Commit a2bcd19
refactor(service-ai): add auth/permissions metadata, user context, ownership, enhanced tool-call loop
- RouteDefinition: add `auth` and `permissions` fields
- RouteRequest: add `user: RouteUserContext` for authenticated user context
- Conversation routes: enforce ownership (create binds userId, list scopes to user, add/delete check ownership)
- chatWithTools: add `onToolError` callback, error tracking across iterations
- Add streamChatWithTools: streaming tool-call loop with SSE events
- ChatWithToolsOptions: add `onToolError` callback in contract
- 27 new tests: 7 auth metadata, 10 ownership, 6 tool-call error handling, 4 streamChatWithTools
- Update CHANGELOG.md
Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/05de3b78-8ac6-4821-a0c8-ae863084c76b
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>1 parent 0ef2e7c commit a2bcd19
8 files changed
Lines changed: 822 additions & 7 deletions
File tree
- packages
- services/service-ai
- src
- __tests__
- routes
- spec/src/contracts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
3 | 14 | | |
4 | 15 | | |
5 | 16 | | |
| |||
0 commit comments