@happyvertical/smrt-chat 0.53.3 → 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.
@@ -74,6 +74,9 @@ export { default as AssistantComposer } from './components/assistant/AssistantCo
74
74
  export { default as AssistantDock } from './components/assistant/AssistantDock.svelte';
75
75
  export { default as AssistantThreadList } from './components/assistant/AssistantThreadList.svelte';
76
76
  export { ASSISTANT_CHOICE_MAX_OPTIONS, ASSISTANT_CHOICE_TOOL_PREFIX, AssistantChoices, choiceToolName, createAssistantChoiceSourceRegistry, normalizeChoiceOptions, safeChoiceImageUrl, } from './components/assistant/assistant-choices.svelte.js';
77
+ // HTTP client half of `@happyvertical/smrt-chat/sveltekit`'s
78
+ // `mountAssistantRoutes` (#3368).
79
+ export { AssistantHttpError, createAssistantHttpActionClient, createAssistantHttpTransport, } from './components/assistant/assistant-http-client.js';
77
80
  export { createInMemoryAssistantTransport, createSmrtAssistantTransport, readAssistantTurnResult, } from './components/assistant/assistant-transport.js';
78
81
  export { ASSISTANT_PROPOSE_ACTION_TOOL, declareClientTools, defaultClientToolPolicy, resolveClientToolPolicy, } from './components/assistant/client-tools.js';
79
82
  export { ASSISTANT_ACTION_UNKNOWN_OUTCOME_REASONS, createAssistantDockController, } from './components/assistant/create-assistant-dock-controller.svelte.js';
@@ -0,0 +1,343 @@
1
+ /**
2
+ * Mountable SvelteKit routes for the AssistantDock (#3368).
3
+ *
4
+ * One call serves everything the dock's HTTP transport
5
+ * (`createAssistantHttpTransport` / `createSmrtAssistantTransport`) and HTTP
6
+ * action client (`createAssistantHttpActionClient`) call:
7
+ *
8
+ * ```ts
9
+ * // src/routes/api/assistant/[...path]/+server.ts
10
+ * import { mountAssistantRoutes } from '@happyvertical/smrt-chat/sveltekit';
11
+ * import { runtime } from '$lib/server/smrt';
12
+ * export const { GET, POST } = mountAssistantRoutes({
13
+ * allowedTools: ['notes.read', 'notes.create'],
14
+ * runtime,
15
+ * });
16
+ * ```
17
+ *
18
+ * `ai` defaults to the `smrt.config` `ai` block (resolved per turn through
19
+ * `@happyvertical/smrt-config`); `allowedTools` alone offers the manifest
20
+ * operations it names; `runtime` supplies the per-request database and the
21
+ * streamed turn's own database lifetime (`db` may instead be a per-request
22
+ * resolver).
23
+ *
24
+ * GET threads member-scoped thread list
25
+ * POST threads { title } → { thread }
26
+ * GET threads/:id/messages member-scoped, chronological
27
+ * POST threads/:id/messages { content, clientRequestId, ... } → SSE turn
28
+ * POST threads/:id/resume { continuationId, results, ... } → SSE turn
29
+ * POST attachments multipart `file` (host storage only)
30
+ * POST actions/preview | actions/apply DataSurfaceActionWireRequest → { result }
31
+ *
32
+ * Trust boundary: the principal comes from SvelteKit `event.locals` (as
33
+ * populated by `createSessionHandler` from `@happyvertical/smrt-users/sveltekit`)
34
+ * or an injected resolver — never from a header, hostname or request body.
35
+ * Every actor gets ONE assistant `AgentSession` per tenant (keyed, so it never
36
+ * reuses another feature's session); threads are readable and writable only
37
+ * when they live in that session's room. Reads never create anything. Model
38
+ * tools run under `executeAsPrincipal` (inside `runToolLoop`) with a
39
+ * fail-closed allow-list: no `allowedTools` means no tools.
40
+ *
41
+ * Server-only: imports no Svelte or browser code.
42
+ *
43
+ * @packageDocumentation
44
+ */
45
+ import './__smrt-register__.js';
46
+ import type { AIInterface } from '@happyvertical/ai';
47
+ import type { PrincipalAuditSink, PrincipalTool } from '@happyvertical/smrt-agents';
48
+ import type { DataSurfaceActionAdapter } from '@happyvertical/smrt-agents/server';
49
+ import type { SmrtClassOptions } from '@happyvertical/smrt-core';
50
+ import { type AssistantContinuationStore, type AssistantTurnErrorLogger, type AuthoredToolReply } from './assistant-turn.js';
51
+ import type { AgentSession } from './models/AgentSession.js';
52
+ import type { ChatMessage } from './models/ChatMessage.js';
53
+ import type { ChatThread } from './models/ChatThread.js';
54
+ import { type ManifestTool, type ToolInvocation, type ToolLoopUsage } from './tool-loop.js';
55
+ /** The slice of a SvelteKit `RequestEvent` these handlers read. */
56
+ export interface AssistantRouteEvent {
57
+ request: Request;
58
+ url: URL;
59
+ params?: Partial<Record<string, string>>;
60
+ locals?: unknown;
61
+ }
62
+ /** A SvelteKit `+server.ts` handler with no `@sveltejs/kit` dependency. */
63
+ export type AssistantRouteHandler = (event: AssistantRouteEvent) => Promise<Response>;
64
+ /** The authenticated caller, resolved server-side. */
65
+ export interface AssistantPrincipal {
66
+ /** The user whose live permissions bound every tool call (`runAsUserId`). */
67
+ userId: string;
68
+ /** The user's Profile: the chat actor that owns the assistant session. */
69
+ profileId: string;
70
+ /** The active, session-authorized tenant. */
71
+ tenantId: string;
72
+ /** Optional permission snapshot; omitted resolves live permissions. */
73
+ permissions?: string[];
74
+ }
75
+ /**
76
+ * Resolves the caller. Return `null` for an unauthenticated request (401);
77
+ * throw {@link AssistantRouteError} for any other refusal.
78
+ */
79
+ export type AssistantPrincipalResolver = (event: AssistantRouteEvent) => AssistantPrincipal | null | undefined | Promise<AssistantPrincipal | null | undefined>;
80
+ /** What every per-request option callback receives. */
81
+ export interface AssistantRequestContext {
82
+ event: AssistantRouteEvent;
83
+ principal: AssistantPrincipal;
84
+ }
85
+ /** A value, or a per-request callback producing it. */
86
+ export type AssistantRouteValue<T> = T | ((context: AssistantRequestContext) => T | Promise<T>);
87
+ /** A stored attachment, as the host's storage reports it. */
88
+ export interface AssistantAttachmentRecord {
89
+ id: string;
90
+ name: string;
91
+ contentType: string;
92
+ size: number;
93
+ url?: string;
94
+ }
95
+ /**
96
+ * Host-owned attachment storage. Without it, uploads and sends with
97
+ * attachments are refused: the chat package stores no files.
98
+ */
99
+ export interface AssistantAttachmentStorage {
100
+ /** Store an upload for the principal and describe it. */
101
+ upload(file: File, context: AssistantRequestContext): Promise<AssistantAttachmentRecord>;
102
+ /**
103
+ * Check that the references a send names belong to the principal and
104
+ * return the records to store on the message, or `null` to refuse. The
105
+ * references are request input: never trust their `url`/`size` as given.
106
+ */
107
+ verify(references: unknown[], context: AssistantRequestContext): Promise<AssistantAttachmentRecord[] | null>;
108
+ /** Largest accepted upload, bytes. Default 10 MiB. */
109
+ maxBytes?: number;
110
+ }
111
+ /** The two adapter calls the action routes make. */
112
+ export type AssistantActionAdapter = Pick<DataSurfaceActionAdapter, 'preview' | 'apply'>;
113
+ /** Selectable model, the same shape the dock's `ModelPicker` uses. */
114
+ export interface AssistantRouteModel {
115
+ id: string;
116
+ label?: string;
117
+ }
118
+ /**
119
+ * The two application-runtime calls the routes use; the runtime from
120
+ * `@happyvertical/smrt-app-runtime/sveltekit` satisfies it as is.
121
+ */
122
+ export interface AssistantRouteRuntime {
123
+ /** The request's database (its RLS transaction inside one). */
124
+ databaseConfig(): SmrtClassOptions['db'];
125
+ /**
126
+ * Run `fn` as a principal: under `database-rls` in a fresh transaction
127
+ * publishing that user, tenant and live permissions (capped to `scopes`;
128
+ * omitted means no cap), which `databaseConfig()` returns inside `fn`.
129
+ * `fn` receives the bound principal, whose `scopes` are the effective set.
130
+ */
131
+ runAsPrincipal<T>(principal: {
132
+ readonly id: string;
133
+ readonly tenantId: string;
134
+ readonly scopes?: readonly string[];
135
+ }, fn: (bound: AssistantRouteBoundPrincipal) => Promise<T>): Promise<T>;
136
+ }
137
+ /** What {@link AssistantRouteRuntime.runAsPrincipal} hands its callback. */
138
+ export interface AssistantRouteBoundPrincipal {
139
+ /** The effective permissions: live at bind time, capped to the scopes. */
140
+ readonly scopes: readonly string[];
141
+ }
142
+ /** Options for {@link mountAssistantRoutes}. */
143
+ export interface MountAssistantRoutesOptions {
144
+ /**
145
+ * The AI client, or a factory called once per turn. Omitted, each turn
146
+ * builds a client from the `smrt.config` `ai` block through the shared
147
+ * resolver (`resolveConfiguredAIProvider` → `toAIClientOptions` →
148
+ * `getAI`), loading the config file first if nothing has. A factory that
149
+ * throws (including `AIProviderNotConfiguredError` when nothing is
150
+ * configured) answers 503 before anything is written; the error goes to
151
+ * `onError` only. Passing `ai` explicitly as `undefined`/`null` is a mount
152
+ * error, not a fallback.
153
+ */
154
+ ai?: AIInterface | ((context: AssistantRequestContext & {
155
+ model?: string;
156
+ }) => AIInterface | Promise<AIInterface>);
157
+ /**
158
+ * Database for chat persistence, the tool catalog and the principal run:
159
+ * a fixed value, or a resolver called once per request (and once more
160
+ * inside a streamed turn's own database lifetime, see `runtime`). Default
161
+ * with `runtime`: `() => runtime.databaseConfig()`.
162
+ */
163
+ db?: AssistantRouteValue<SmrtClassOptions['db']>;
164
+ /**
165
+ * The application runtime (`runtime` from
166
+ * `@happyvertical/smrt-app-runtime/sveltekit`). A request inside an RLS
167
+ * transaction (`database-rls`) ends, committing that transaction, when the
168
+ * handler returns its streaming response, so a turn never keeps it: with
169
+ * `runtime`, a streamed turn waits for the request's transaction to end and
170
+ * then runs, persists its reply and records its outcome in its own
171
+ * transaction for the same principal (`runtime.runAsPrincipal`). Without
172
+ * it, such a turn runs to completion before the response is returned (the
173
+ * events arrive at once, not incrementally). Outside an RLS transaction
174
+ * (SQLite, the local profile) the turn streams as before either way.
175
+ */
176
+ runtime?: AssistantRouteRuntime;
177
+ /** Default: {@link resolveAssistantPrincipalFromLocals}. */
178
+ resolvePrincipal?: AssistantPrincipalResolver;
179
+ /** The assistant's agent id (its `bot` profile slug). Default `smrt-assistant`. */
180
+ agentId?: string;
181
+ systemPrompt?: AssistantRouteValue<string | undefined>;
182
+ /**
183
+ * Server tool allow-list, fail-closed: absent or empty offers NO tools.
184
+ * Gates `extraTools`, `tools` and the data-surface action adapter. Without
185
+ * `tools`, the route offers the manifest operations named here
186
+ * (`buildManifestToolCatalog`), except names an `extraTools` entry serves.
187
+ * A name nothing provides is a configuration error: at mount when its
188
+ * collection is already registered, otherwise the turn answers 503 (the
189
+ * check is skipped when `actions` is set, since action tools may be named).
190
+ */
191
+ allowedTools?: AssistantRouteValue<readonly string[]>;
192
+ /** Server tools (e.g. `createDataSurfaceTools()`), narrowed by `allowedTools`. */
193
+ extraTools?: AssistantRouteValue<readonly PrincipalTool[]>;
194
+ /**
195
+ * Manifest tools, narrowed by `allowedTools`. Omitted, they are built from
196
+ * `allowedTools`; pass a value (even `[]`) to supply them yourself.
197
+ */
198
+ tools?: AssistantRouteValue<readonly ManifestTool[]>;
199
+ /**
200
+ * Browser tools the page may declare (exact names or `prefix*`). Empty
201
+ * (the default) admits none.
202
+ */
203
+ clientToolAllowList?: readonly string[];
204
+ /**
205
+ * Where suspended turns wait. Default: the actor's assistant session
206
+ * context (`createSessionContinuationStore`), re-read before every write.
207
+ * A shared store must keep keys private to the session it is given.
208
+ */
209
+ continuations?: (context: AssistantRequestContext & {
210
+ session: AgentSession;
211
+ }) => AssistantContinuationStore;
212
+ /** When set, a requested model must be listed; otherwise it is ignored. */
213
+ models?: readonly AssistantRouteModel[];
214
+ /** Model used when the request names none. */
215
+ defaultModel?: string;
216
+ maxSteps?: number;
217
+ maxTurnTokens?: number;
218
+ maxTurnMs?: number;
219
+ maxTokens?: number;
220
+ temperature?: number;
221
+ /** Earlier messages sent with a new turn. Default 20. */
222
+ historyLimit?: number;
223
+ /**
224
+ * A stored send with no reply and no recorded outcome (e.g. its process
225
+ * died) counts as failed after this long. Default 15 minutes.
226
+ */
227
+ abandonedTurnMs?: number;
228
+ /**
229
+ * How long a streamed turn waits for its request's RLS transaction to end
230
+ * before it reports an error instead of running (see `runtime`). It then
231
+ * keeps watching, up to `abandonedTurnMs`, and settles a send that
232
+ * committed late as `failed`. Default 60 s.
233
+ */
234
+ turnStartTimeoutMs?: number;
235
+ describeTool?: (name: string, args?: Record<string, unknown>) => string;
236
+ /**
237
+ * Persist a server tool invocation into the thread (default: none). Its
238
+ * tool name must be on `allowedTools`, which is mirrored onto the session.
239
+ */
240
+ authorInvocation?: (invocation: ToolInvocation) => AuthoredToolReply | null;
241
+ onUsage?: (usage: ToolLoopUsage, context: AssistantRequestContext) => void;
242
+ audit?: PrincipalAuditSink;
243
+ postgresRls?: boolean;
244
+ /** Host attachment storage; absent refuses attachments. */
245
+ attachments?: AssistantAttachmentStorage;
246
+ /** Data-surface action adapter; absent answers the action routes 404. */
247
+ actions?: {
248
+ adapter: AssistantRouteValue<AssistantActionAdapter>;
249
+ };
250
+ /**
251
+ * Refuse mutating requests whose `Origin` (or `Sec-Fetch-Site`/`Referer`)
252
+ * is not this origin. Default `true`.
253
+ */
254
+ checkOrigin?: boolean;
255
+ /** Extra origins accepted by the origin check (e.g. behind a proxy). */
256
+ trustedOrigins?: readonly string[];
257
+ /** Largest JSON body, bytes. Default 1 MiB. */
258
+ maxBodyBytes?: number;
259
+ /** Longest user message, characters. Default 12,000. */
260
+ maxContentLength?: number;
261
+ /** SSE keep-alive interval. */
262
+ heartbeatMs?: number;
263
+ /** Server-side log for failures withheld from the browser. */
264
+ onError?: AssistantTurnErrorLogger;
265
+ /** Rest parameter name of the mounting route. Default `path`. */
266
+ paramName?: string;
267
+ /** Used when the route has no rest parameter: the prefix to strip. */
268
+ basePath?: string;
269
+ }
270
+ /** The handlers {@link mountAssistantRoutes} returns. */
271
+ export interface AssistantRoutes {
272
+ GET: AssistantRouteHandler;
273
+ POST: AssistantRouteHandler;
274
+ /** Method-agnostic entry point (GET and POST both delegate here). */
275
+ handle: AssistantRouteHandler;
276
+ }
277
+ /** A refusal with an HTTP status and a stable, user-safe code. */
278
+ export declare class AssistantRouteError extends Error {
279
+ readonly status: number;
280
+ readonly code: string;
281
+ constructor(status: number, code: string, message: string);
282
+ }
283
+ /** Thread summary as the routes send it. */
284
+ export interface AssistantThreadWire {
285
+ id: string;
286
+ title: string;
287
+ isResolved: boolean;
288
+ messageCount: number;
289
+ lastMessageAt: string | null;
290
+ }
291
+ /** Message as the routes send it (chronological in lists). */
292
+ export interface AssistantMessageWire {
293
+ id: string;
294
+ threadId: string;
295
+ content: string;
296
+ role: 'user' | 'assistant' | 'system' | 'tool';
297
+ createdAt: string;
298
+ attachments?: AssistantAttachmentRecord[];
299
+ toolCallData?: Record<string, unknown>;
300
+ clientRequestId?: string;
301
+ }
302
+ /**
303
+ * JSON answer to a send whose `clientRequestId` is already stored for this
304
+ * thread and actor. `outcome`: `completed` (a reply follows), `cancelled`
305
+ * (stopped, no reply), or `in_progress` (still running, or waiting on
306
+ * browser tools). A failed or abandoned turn answers 409 `turn_failed`.
307
+ */
308
+ export interface AssistantDuplicateSendWire {
309
+ duplicate: true;
310
+ inProgress: boolean;
311
+ outcome: 'completed' | 'cancelled' | 'in_progress';
312
+ userMessage: AssistantMessageWire;
313
+ assistantMessage?: AssistantMessageWire;
314
+ messages: AssistantMessageWire[];
315
+ }
316
+ /** Default assistant agent id. */
317
+ export declare const DEFAULT_ASSISTANT_AGENT_ID = "smrt-assistant";
318
+ /** Session key isolating the dock's session from other uses of the agent id. */
319
+ export declare const ASSISTANT_DOCK_SESSION_KEY = "assistant-dock";
320
+ /** Default JSON body cap. */
321
+ export declare const DEFAULT_ASSISTANT_MAX_BODY_BYTES: number;
322
+ /** Default attachment cap. */
323
+ export declare const DEFAULT_ASSISTANT_MAX_ATTACHMENT_BYTES: number;
324
+ /** Default age after which an unanswered, unsettled send counts as failed. */
325
+ export declare const DEFAULT_ASSISTANT_ABANDONED_TURN_MS: number;
326
+ /**
327
+ * The default principal resolver: SvelteKit `event.locals` as populated by
328
+ * `createSessionHandler` (`user`, `tenantId`). No user → `null` (401); a user
329
+ * without a Profile or an active tenant is refused with 403.
330
+ */
331
+ export declare function resolveAssistantPrincipalFromLocals(locals: unknown): AssistantPrincipal | null;
332
+ /** Map a persisted thread to the wire. */
333
+ export declare function toAssistantThreadWire(thread: ChatThread): AssistantThreadWire;
334
+ /** Map a persisted message to the wire. */
335
+ export declare function toAssistantMessageWire(message: ChatMessage): AssistantMessageWire;
336
+ /**
337
+ * Build the AssistantDock's server routes for one SvelteKit rest route
338
+ * (e.g. `src/routes/api/assistant/[...path]/+server.ts`).
339
+ */
340
+ export declare function mountAssistantRoutes(options?: MountAssistantRoutesOptions): AssistantRoutes;
341
+ /** Default for `turnStartTimeoutMs`. */
342
+ export declare const DEFAULT_ASSISTANT_TURN_START_TIMEOUT_MS = 60000;
343
+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