@collective-intelligence/ai 0.10.0 → 0.12.0
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.
- package/docs/guide/ai/index.md +1 -1
- package/docs/guide/develop/sdks.md +10 -9
- package/package.json +6 -6
package/docs/guide/ai/index.md
CHANGED
|
@@ -226,7 +226,7 @@ Your server invokes an Agent with `agents.invoke({ agentId, input })`, which ret
|
|
|
226
226
|
|
|
227
227
|
For a multi-turn chat, use the shared chat. Start a Conversation with the Agent with `ci.chat.createConversation({ organizationId, payload: { agentId } })`, send each message with `createChatClient(ci, { organizationId }).send({ conversationId, message })` from `@collective-intelligence/external-apps-server-sdk/chat`, and read earlier turns with `ci.chat.getTranscript`. Each turn is an ordinary Agent run, and the earlier successful turns, with their saved Agent Output, become the model's conversation history. A message sent while a turn still runs steers that turn and starts no second turn, and a resend with the same message `id` adds nothing.
|
|
228
228
|
|
|
229
|
-
`send` resolves `{ ok: true, value, runId }`: `runId` is the id of the turn's run, which the answer message also carries as `metadata.invocationId`, and `turnRunId(message)` reads it from any answer message. `runs.get`, `runs.sources` and `runs.feedback` accept that id like the `runId` of `agents.invoke`. They answer only the caller that owns the Conversation (the member, the app server or the visitor) through the application where the Conversation started, and answer `not_found` to every other caller. As for any run, only a signed-in member reads `runs.sources` and gives `runs.feedback`. `runs.get` gives the status and `result: { message, output? }`, where `output` is the Agent Output that the turn saved. `runs.feedback` also rates a succeeded turn whose answer is only its Agent Output, with the Output's JSON text as the rated answer; a turn with neither text nor Output has no answer to rate and gets `not_found`. The member can also rate and clear the answer with `ci.chat.putAnswerFeedback` and `ci.chat.clearAnswerFeedback` (`params: { invocationId: runId }`); it is the same rating. Each completed Agent turn with an answer to rate (its text or its Agent Output) of `ci.chat.getTranscript` gives that member `feedbackTargetId` (the turn's run id) and `currentUserFeedback`, so the app shows a saved rating again after a reload. `runs.sources` gives the searched Document Versions with their pages and a download link. `runs.stream`
|
|
229
|
+
`send` resolves `{ ok: true, value, runId }`: `runId` is the id of the turn's run, which the answer message also carries as `metadata.invocationId`, and `turnRunId(message)` reads it from any answer message. `runs.get`, `runs.stream`, `runs.cancel`, `runs.sources` and `runs.feedback` accept that id like the `runId` of `agents.invoke`. They answer only the caller that owns the Conversation (the member, the app server or the visitor) through the application where the Conversation started, and answer `not_found` to every other caller. As for any run, only a signed-in member reads `runs.sources` and gives `runs.feedback`. `runs.get` gives the status and `result: { message, output? }`, where `output` is the Agent Output that the turn saved. `runs.feedback` also rates a succeeded turn whose answer is only its Agent Output, with the Output's JSON text as the rated answer; a turn with neither text nor Output has no answer to rate and gets `not_found`. The member can also rate and clear the answer with `ci.chat.putAnswerFeedback` and `ci.chat.clearAnswerFeedback` (`params: { invocationId: runId }`); it is the same rating. Each completed Agent turn with an answer to rate (its text or its Agent Output) of `ci.chat.getTranscript` gives that member `feedbackTargetId` (the turn's run id) and `currentUserFeedback`, so the app shows a saved rating again after a reload. `runs.sources` gives the searched Document Versions with their pages and a download link. `runs.stream` pages the turn's events as for `agents.invoke`: `accepted`, the `agent.*` events and the application events that its tools publish, then one terminal event with the `runs.get` result. `runs.cancel` stops the turn. The answer itself streams from `GET /runs/:runId/stream` of the chat mount.
|
|
230
230
|
|
|
231
231
|
Anonymous visitors can chat with an Agent only when its audience has `anonymous: [app]` for that application and the call passes `caller: { kind: "anonymous_visitor", visitor: { issuer, subjectId } }`. Their turns run with the Agent's own bindings, never with the application's grants, and visitors never see each other's conversations.
|
|
232
232
|
|
|
@@ -197,15 +197,16 @@ At the time of writing, the template catalog pins these versions:
|
|
|
197
197
|
> **Note:** The release workflow bumps the template pins after each npm release. Copy the
|
|
198
198
|
> catalog from the current template instead of this table.
|
|
199
199
|
|
|
200
|
-
Some names from older examples no longer exist. An old server SDK subpath fails with `ERR_PACKAGE_PATH_NOT_EXPORTED
|
|
201
|
-
|
|
202
|
-
| Old import | Use instead
|
|
203
|
-
| -------------------------------------------------------- |
|
|
204
|
-
| `@collective-intelligence/extensions-sdk-backend-effect` | `@collective-intelligence/extensions-sdk-backend/effect`, same export names
|
|
205
|
-
| `@collective-intelligence/extensions-sdk-backend-zod` | Effect Schema through `effectSchema` from `extensions-sdk-backend/effect`
|
|
206
|
-
| `external-apps-server-sdk/runtime/effect` | `external-apps-server-sdk/effect`
|
|
207
|
-
| `external-apps-server-sdk/persistence/drizzle/effect` | `external-apps-server-sdk/effect` plus `/effect/node-postgres`
|
|
208
|
-
| `external-apps-server-sdk/runtime/next` | `external-apps-server-sdk/next`
|
|
200
|
+
Some names from older examples no longer exist. An old server SDK subpath fails with `ERR_PACKAGE_PATH_NOT_EXPORTED`. The lint rule `effect-subpath` reports the old Effect paths, and `package-entrypoint` reports any subpath that the package does not export.
|
|
201
|
+
|
|
202
|
+
| Old import | Use instead |
|
|
203
|
+
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
204
|
+
| `@collective-intelligence/extensions-sdk-backend-effect` | `@collective-intelligence/extensions-sdk-backend/effect`, same export names |
|
|
205
|
+
| `@collective-intelligence/extensions-sdk-backend-zod` | Effect Schema through `effectSchema` from `extensions-sdk-backend/effect` |
|
|
206
|
+
| `external-apps-server-sdk/runtime/effect` | `external-apps-server-sdk/effect` |
|
|
207
|
+
| `external-apps-server-sdk/persistence/drizzle/effect` | `external-apps-server-sdk/effect` plus `/effect/node-postgres` |
|
|
208
|
+
| `external-apps-server-sdk/runtime/next` | `external-apps-server-sdk/next` |
|
|
209
|
+
| `external-apps-server-sdk/knowledge-sources/payload` | `ciPayloadPlugin` from `external-apps-server-sdk/payload`, which serves the site's collections as a Gateway |
|
|
209
210
|
|
|
210
211
|
The two removed packages stopped at version 0.2.0, and npm marks them deprecated.
|
|
211
212
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@collective-intelligence/ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "The Collective Intelligence AI package: the CI message domain, the chat contract, the chat transports, the headless chat session and the chat views, one subpath per layer.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@ai-sdk/react": "^4.0.177",
|
|
61
|
-
"@collective-intelligence/effect-xstate": "0.
|
|
62
|
-
"@collective-intelligence/ui-react": "0.
|
|
61
|
+
"@collective-intelligence/effect-xstate": "0.12.0",
|
|
62
|
+
"@collective-intelligence/ui-react": "0.12.0",
|
|
63
63
|
"@tanstack/react-query": "^5.101.4",
|
|
64
64
|
"@xstate/react": "^6.1.0",
|
|
65
65
|
"ai": ">=7.0.173 <8",
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@ai-sdk/react": "4.0.177",
|
|
98
|
-
"@collective-intelligence/effect-xstate": "0.
|
|
99
|
-
"@collective-intelligence/ui-react": "0.
|
|
98
|
+
"@collective-intelligence/effect-xstate": "0.12.0",
|
|
99
|
+
"@collective-intelligence/ui-react": "0.12.0",
|
|
100
100
|
"@effect/eslint-plugin": "0.3.2",
|
|
101
101
|
"@oxlint/plugins": "1.94.0",
|
|
102
102
|
"@punks/lints": "0.2.0",
|
|
@@ -121,5 +121,5 @@
|
|
|
121
121
|
"vitest": "5.0.2",
|
|
122
122
|
"xstate": "5.33.3"
|
|
123
123
|
},
|
|
124
|
-
"gitHead": "
|
|
124
|
+
"gitHead": "995aa5542f6f440c5cebe836b57bc9bae57ae7e8"
|
|
125
125
|
}
|