@objectstack/service-ai 4.0.3 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +293 -0
  2. package/dist/index.cjs +1176 -135
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +1225 -430
  5. package/dist/index.d.ts +1225 -430
  6. package/dist/index.js +1160 -128
  7. package/dist/index.js.map +1 -1
  8. package/package.json +35 -8
  9. package/.turbo/turbo-build.log +0 -22
  10. package/CHANGELOG.md +0 -53
  11. package/src/__tests__/ai-service.test.ts +0 -964
  12. package/src/__tests__/auth-and-toolcalling.test.ts +0 -677
  13. package/src/__tests__/chatbot-features.test.ts +0 -1116
  14. package/src/__tests__/metadata-tools.test.ts +0 -970
  15. package/src/__tests__/objectql-conversation-service.test.ts +0 -382
  16. package/src/__tests__/tool-routes.test.ts +0 -191
  17. package/src/__tests__/vercel-stream-encoder.test.ts +0 -310
  18. package/src/adapters/index.ts +0 -6
  19. package/src/adapters/memory-adapter.ts +0 -72
  20. package/src/adapters/types.ts +0 -3
  21. package/src/adapters/vercel-adapter.ts +0 -148
  22. package/src/agent-runtime.ts +0 -154
  23. package/src/agents/data-chat-agent.ts +0 -79
  24. package/src/agents/index.ts +0 -4
  25. package/src/agents/metadata-assistant-agent.ts +0 -87
  26. package/src/ai-service.ts +0 -364
  27. package/src/conversation/in-memory-conversation-service.ts +0 -103
  28. package/src/conversation/index.ts +0 -4
  29. package/src/conversation/objectql-conversation-service.ts +0 -301
  30. package/src/index.ts +0 -60
  31. package/src/objects/ai-conversation.object.ts +0 -86
  32. package/src/objects/ai-message.object.ts +0 -86
  33. package/src/objects/index.ts +0 -10
  34. package/src/plugin.ts +0 -391
  35. package/src/routes/agent-routes.ts +0 -190
  36. package/src/routes/ai-routes.ts +0 -439
  37. package/src/routes/index.ts +0 -5
  38. package/src/routes/message-utils.ts +0 -90
  39. package/src/routes/tool-routes.ts +0 -142
  40. package/src/stream/index.ts +0 -3
  41. package/src/stream/vercel-stream-encoder.ts +0 -153
  42. package/src/tools/add-field.tool.ts +0 -70
  43. package/src/tools/create-object.tool.ts +0 -66
  44. package/src/tools/data-tools.ts +0 -293
  45. package/src/tools/delete-field.tool.ts +0 -38
  46. package/src/tools/describe-object.tool.ts +0 -31
  47. package/src/tools/index.ts +0 -18
  48. package/src/tools/list-objects.tool.ts +0 -34
  49. package/src/tools/metadata-tools.ts +0 -430
  50. package/src/tools/modify-field.tool.ts +0 -44
  51. package/src/tools/tool-registry.ts +0 -132
  52. package/tsconfig.json +0 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectstack/service-ai",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "license": "Apache-2.0",
5
5
  "description": "AI Service for ObjectStack — implements IAIService with LLM adapter layer, conversation management, tool registry, and REST/SSE routes",
6
6
  "type": "module",
@@ -14,10 +14,10 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@ai-sdk/provider": "^3.0.8",
18
- "ai": "^6.0.158",
19
- "@objectstack/core": "4.0.3",
20
- "@objectstack/spec": "4.0.3"
17
+ "@ai-sdk/provider": "^3.0.10",
18
+ "ai": "^6.0.177",
19
+ "@objectstack/core": "4.0.5",
20
+ "@objectstack/spec": "4.0.5"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@ai-sdk/anthropic": "^3.0.0",
@@ -40,9 +40,36 @@
40
40
  }
41
41
  },
42
42
  "devDependencies": {
43
- "@types/node": "^25.6.0",
44
- "typescript": "^6.0.2",
45
- "vitest": "^4.1.4"
43
+ "@types/node": "^25.6.2",
44
+ "typescript": "^6.0.3",
45
+ "vitest": "^4.1.5",
46
+ "@objectstack/platform-objects": "4.0.5"
47
+ },
48
+ "keywords": [
49
+ "objectstack",
50
+ "service",
51
+ "ai",
52
+ "agents",
53
+ "rag",
54
+ "llm"
55
+ ],
56
+ "author": "ObjectStack",
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "https://github.com/objectstack-ai/framework.git",
60
+ "directory": "packages/services/service-ai"
61
+ },
62
+ "homepage": "https://objectstack.ai/docs",
63
+ "bugs": "https://github.com/objectstack-ai/framework/issues",
64
+ "publishConfig": {
65
+ "access": "public"
66
+ },
67
+ "files": [
68
+ "dist",
69
+ "README.md"
70
+ ],
71
+ "engines": {
72
+ "node": ">=18.0.0"
46
73
  },
47
74
  "scripts": {
48
75
  "build": "tsup --config ../../../tsup.config.ts",
@@ -1,22 +0,0 @@
1
-
2
- > @objectstack/service-ai@4.0.3 build /home/runner/work/framework/framework/packages/services/service-ai
3
- > tsup --config ../../../tsup.config.ts
4
-
5
- CLI Building entry: src/index.ts
6
- CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.5.1
8
- CLI Using tsup config: /home/runner/work/framework/framework/tsup.config.ts
9
- CLI Target: es2020
10
- CLI Cleaning output folder
11
- ESM Build start
12
- CJS Build start
13
- CJS dist/index.cjs 97.08 KB
14
- CJS dist/index.cjs.map 195.12 KB
15
- CJS ⚡️ Build success in 237ms
16
- ESM dist/index.js 94.76 KB
17
- ESM dist/index.js.map 194.96 KB
18
- ESM ⚡️ Build success in 240ms
19
- DTS Build start
20
- DTS ⚡️ Build success in 19870ms
21
- DTS dist/index.d.ts 157.91 KB
22
- DTS dist/index.d.cts 157.91 KB
package/CHANGELOG.md DELETED
@@ -1,53 +0,0 @@
1
- # @objectstack/service-ai
2
-
3
- ## 4.0.3
4
-
5
- ### Patch Changes
6
-
7
- - ee39bff: fix ai.
8
- - @objectstack/spec@4.0.3
9
- - @objectstack/core@4.0.3
10
-
11
- ## 4.0.2
12
-
13
- ### Patch Changes
14
-
15
- - 5f659e9: fix ai
16
- - Updated dependencies [5f659e9]
17
- - @objectstack/spec@4.0.2
18
- - @objectstack/core@4.0.2
19
-
20
- ## 4.1.0
21
-
22
- ### Minor Changes
23
-
24
- - **Route auth/permissions metadata**: Every route definition (`RouteDefinition`) now declares `auth` and `permissions` fields, enabling HTTP server adapters to enforce authentication and authorization automatically.
25
- - **User context on RouteRequest**: `RouteRequest` now carries an optional `user: RouteUserContext` object populated by the auth middleware, providing `userId`, `displayName`, `roles`, and `permissions`.
26
- - **Conversation ownership enforcement**: Conversation routes (create, list, add message, delete) are scoped to the authenticated user when a user context is present and the conversation has a `userId`. For backward compatibility, requests without user context and conversations created without a `userId` remain accessible under the existing behavior.
27
- - **Enhanced tool-call loop error handling**: `chatWithTools` now tracks tool execution errors across iterations and supports an `onToolError` callback (`'continue'` | `'abort'`) for fine-grained error control.
28
- - **`streamChatWithTools`**: New streaming tool-call loop that yields SSE events while automatically resolving intermediate tool calls.
29
- - **New `RouteUserContext` type**: Exported from the package for use by HTTP adapters and middleware.
30
-
31
- ## 4.0.0
32
-
33
- ### Major Changes
34
-
35
- - ad4e04b: service ai
36
-
37
- ### Patch Changes
38
-
39
- - Updated dependencies [f08ffc3]
40
- - Updated dependencies [e0b0a78]
41
- - @objectstack/spec@4.0.0
42
- - @objectstack/core@4.0.0
43
-
44
- ## 3.3.1
45
-
46
- ### Patch Changes
47
-
48
- - Initial release of AI Service plugin
49
- - LLM adapter layer with provider abstraction (memory adapter included)
50
- - Conversation management service with in-memory persistence
51
- - Tool registry for metadata/business tool registration
52
- - REST/SSE route self-registration (`/api/v1/ai/*`)
53
- - Kernel plugin registering as `'ai'` service conforming to `IAIService` contract