@vinaverse/client 0.1.0-alpha.10 → 0.1.0-alpha.11
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/README.md +19 -3
- package/dist/agent/index.cjs +2 -0
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +3 -3
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.js +1 -1
- package/dist/backend/index.cjs +37 -10
- package/dist/backend/index.cjs.map +1 -1
- package/dist/backend/index.d.cts +13 -3
- package/dist/backend/index.d.ts +13 -3
- package/dist/backend/index.js +38 -11
- package/dist/backend/index.js.map +1 -1
- package/dist/chunk-D56MNG3E.js +9 -0
- package/dist/{chunk-YNUHXJD6.js.map → chunk-D56MNG3E.js.map} +1 -1
- package/dist/{chunk-O3NLAZGZ.js → chunk-JI6HUXH3.js} +4 -2
- package/dist/chunk-JI6HUXH3.js.map +1 -0
- package/dist/contract-Be2oVHNr.d.cts +6 -0
- package/dist/contract-Be2oVHNr.d.ts +6 -0
- package/dist/conversation/index.cjs +2 -2
- package/dist/conversation/index.cjs.map +1 -1
- package/dist/conversation/index.d.cts +5 -5
- package/dist/conversation/index.d.ts +5 -5
- package/dist/conversation/index.js +1 -1
- package/dist/history/index.cjs +282 -0
- package/dist/history/index.cjs.map +1 -0
- package/dist/history/index.d.cts +91 -0
- package/dist/history/index.d.ts +91 -0
- package/dist/history/index.js +261 -0
- package/dist/history/index.js.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{runtime-Z1RI10lU.d.ts → runtime-6O0qIPmo.d.cts} +25 -2
- package/dist/{runtime-CISPp9nJ.d.cts → runtime-CNgz2_8G.d.ts} +25 -2
- package/dist/{session-CPz4pcPu.d.cts → session-D0ijOQX3.d.cts} +98 -5
- package/dist/{session-CPz4pcPu.d.ts → session-D0ijOQX3.d.ts} +98 -5
- package/dist/{store-DZka9T2-.d.ts → store-CGRSxVcL.d.ts} +1 -1
- package/dist/{store-BxiicOKG.d.cts → store-CxoHwd64.d.cts} +1 -1
- package/dist/testing/index.cjs +158 -14
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +42 -5
- package/dist/testing/index.d.ts +42 -5
- package/dist/testing/index.js +159 -15
- package/dist/testing/index.js.map +1 -1
- package/package.json +24 -1
- package/dist/chunk-O3NLAZGZ.js.map +0 -1
- package/dist/chunk-YNUHXJD6.js +0 -9
- package/dist/contract-DmQs8amJ.d.cts +0 -6
- package/dist/contract-DmQs8amJ.d.ts +0 -6
package/README.md
CHANGED
|
@@ -139,7 +139,8 @@ app comes back to the foreground).
|
|
|
139
139
|
**Your backend, in two lines** (`@vinaverse/client/backend`): `backendFromFetch({ routes, headers })` is an
|
|
140
140
|
`AgentBackend` over your own routes, sending the person's credentials from `headers`, never in a body.
|
|
141
141
|
`backendRoutes(base)` gives the routes the .NET SDK's `MapVinaverseAgentSessions` serves by default (`session`,
|
|
142
|
-
`refresh`, `status`, `feedback`, `end`, `context`, `delete
|
|
142
|
+
`refresh`, `status`, `feedback`, `end`, `context`, `delete`, and history's `list` and `read`, answered
|
|
143
|
+
`{ version: 1, page }` as the gateway wrote the page); give your own where they differ. Both sides speak
|
|
143
144
|
`vinaverse.agent-backend/1` (vinaverse-contracts `docs/agent-backend.md`, tested here against its fixture): successes
|
|
144
145
|
wrapped with the version (`{ version: 1, session }`, `{ version: 1, client_secret: { value, expires_at } }`,
|
|
145
146
|
`{ version: 1, status }`, or 204), and one failure body for every route. Every session creation (a first open, a
|
|
@@ -192,8 +193,23 @@ For a mock mode and tests, `@vinaverse/client/testing` has a scripted agent:
|
|
|
192
193
|
`createMockAgent({ script, reply, refuse, welcome })` gives an `AgentBackend` and a WebSocket factory that speaks the
|
|
193
194
|
protocol (`conversation.transport.webSocket`). `script` is the replies in order, one per turn, each with its text, its
|
|
194
195
|
cards or a failure; `reply` answers after it. `mockCards` gives the cards your tools would: `professional`,
|
|
195
|
-
`workspace`, `timeSlots`, `proposal` (pending, confirmed in your app) and `links`.
|
|
196
|
-
|
|
196
|
+
`workspace`, `timeSlots`, `proposal` (pending, confirmed in your app) and `links`. `history` scripts past
|
|
197
|
+
conversations (`{ id, title, state, items: [{ role, text, refusal? }, { card, proposal_outcome? }] }`): listed, read
|
|
198
|
+
back, continued with their messages, deleted (then `not_found`); a conversation begun in the mock is listed too once
|
|
199
|
+
something was said.
|
|
200
|
+
|
|
201
|
+
**History** (`@vinaverse/client/history`, an entry of its own): `createAgentHistory({ runtime, mode, scope, agent,
|
|
202
|
+
pageSize })` is the person's past conversations, newest activity first, a page at a time (`refresh`, `loadMore`, and
|
|
203
|
+
`retry` for the page that failed, the first or the next; `failure` says `off` when your backend serves no
|
|
204
|
+
`listConversations`; a cursor the gateway no longer takes, refused `unavailable` with its `invalid_request`, starts the
|
|
205
|
+
list over once, and any other refusal is said); `remove(key, id)` deletes through `runtime.deleteConversation` and drops
|
|
206
|
+
the row, one already gone too. `createAgentTranscript({ runtime, conversationId })` reads one back, the newest page
|
|
207
|
+
first and earlier pages prepended (`load`, `loadEarlier`, `retry`; a stale cursor reads back from the newest page
|
|
208
|
+
once), its items as the kits draw them (`historyItems`: messages
|
|
209
|
+
as sent, a cut-off reply and a guardrail's refusal kept, cards restored and inert, a proposal with the outcome it
|
|
210
|
+
had). `continueKey(conversation, subject)` is the key it continues under (its side and business as bound when it
|
|
211
|
+
started), for `runtime.continue` and `deleteConversation`. Nothing begun before a sign-out lands after it
|
|
212
|
+
(`runtime.epoch()`), nor a page from before a newer read.
|
|
197
213
|
|
|
198
214
|
The contract's types are exported too (`paths`, `components`, `operations`, `Schemas`): import them instead of copying
|
|
199
215
|
the spec. Design: [docs/architecture/agent-runtime.md](../../docs/architecture/agent-runtime.md).
|
package/dist/agent/index.cjs
CHANGED
|
@@ -3126,6 +3126,8 @@ function createAgentRuntime(options) {
|
|
|
3126
3126
|
},
|
|
3127
3127
|
getStatus: () => status?.value ?? null,
|
|
3128
3128
|
getStatusState: () => statusState,
|
|
3129
|
+
backend,
|
|
3130
|
+
epoch: () => generation,
|
|
3129
3131
|
getName: () => sessionName ?? status?.value.displayName ?? null,
|
|
3130
3132
|
subscribe(listener) {
|
|
3131
3133
|
listeners.add(listener);
|