@happyvertical/smrt-chat 0.53.4 → 0.53.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.
- package/AGENTS.md +10 -9
- package/README.md +11 -2
- package/dist/chunks/{chat-stream-DigP1_dw.js → chat-stream-DJQO6uHe.js} +2 -2
- package/dist/chunks/{chat-stream-DigP1_dw.js.map → chat-stream-DJQO6uHe.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +5 -5
- package/dist/sveltekit.d.ts +84 -11
- package/dist/sveltekit.d.ts.map +1 -1
- package/dist/sveltekit.js +265 -57
- package/dist/sveltekit.js.map +1 -1
- package/package.json +16 -16
package/AGENTS.md
CHANGED
|
@@ -149,15 +149,16 @@ Actions: `normalizeDataSurfaceActionRequest` → `AssistantActionClient`
|
|
|
149
149
|
`data-surface-bridge.ts` channel). Generated `ChatThread`/`ChatMessage`
|
|
150
150
|
`list`/`get` are tenant- not member-scoped; the dock never calls them.
|
|
151
151
|
|
|
152
|
-
**Server routes (#3368).** `./sveltekit` `mountAssistantRoutes(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
`ai`
|
|
159
|
-
makes the row id a UUIDv5
|
|
160
|
-
|
|
152
|
+
**Server routes (#3368).** `./sveltekit` `mountAssistantRoutes()` serves the
|
|
153
|
+
dock from one `[...path]` route; `createAssistantHttp{Transport,ActionClient}`
|
|
154
|
+
(`./svelte`) are its browser half. Principal from `event.locals` or
|
|
155
|
+
`resolvePrincipal`; threads only from the actor's keyed session room in that
|
|
156
|
+
tenant (else 404). `allowedTools` is fail-closed; without `tools` it offers
|
|
157
|
+
those manifest ops (an unprovided name is an error, #3414). `ai` defaults to
|
|
158
|
+
the config `ai` block. Pass `runtime`: a turn never keeps the RLS request tx
|
|
159
|
+
(own `runAsPrincipal` tx). `clientRequestId` makes the row id a UUIDv5
|
|
160
|
+
(`clientRequestMessageId`): the PK is the retry reservation. See
|
|
161
|
+
[docs](../../docs/assistant-dock.md).
|
|
161
162
|
|
|
162
163
|
## Gotchas
|
|
163
164
|
|
package/README.md
CHANGED
|
@@ -263,12 +263,21 @@ waiting | done | failed | cancelled`), with `pauseRun` / `continueRun`,
|
|
|
263
263
|
The server side mounts in one route file. The principal comes from
|
|
264
264
|
`event.locals` (`@happyvertical/smrt-users/sveltekit`); threads are scoped to
|
|
265
265
|
the caller's own assistant session in the active tenant; tools are
|
|
266
|
-
fail-closed (`allowedTools`, absent means none)
|
|
266
|
+
fail-closed (`allowedTools`, absent means none) and, without `tools`, are the
|
|
267
|
+
manifest operations `allowedTools` names. `ai` defaults to the `smrt.config`
|
|
268
|
+
`ai` block. Pass the application `runtime`: each request then uses its own
|
|
269
|
+
database (`runtime.databaseConfig()`), and under `database-rls` a streamed
|
|
270
|
+
turn, which outlives the request's transaction, runs in a transaction of its
|
|
271
|
+
own for the same principal (`runtime.runAsPrincipal`):
|
|
267
272
|
|
|
268
273
|
```ts
|
|
269
274
|
// src/routes/api/assistant/[...path]/+server.ts
|
|
270
275
|
import { mountAssistantRoutes } from '@happyvertical/smrt-chat/sveltekit';
|
|
271
|
-
|
|
276
|
+
import { runtime } from '$lib/server/smrt';
|
|
277
|
+
export const { GET, POST } = mountAssistantRoutes({
|
|
278
|
+
allowedTools: ['notes.read', 'notes.create'],
|
|
279
|
+
runtime,
|
|
280
|
+
});
|
|
272
281
|
```
|
|
273
282
|
|
|
274
283
|
In the page, `createAssistantHttpTransport({ endpoint: '/api/assistant' })`
|