@happyvertical/smrt-chat 0.39.4 → 0.39.6
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 +13 -2
- package/dist/chat-stream.d.ts +185 -0
- package/dist/chat-stream.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +425 -63
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +18 -18
- package/dist/persona-conversation.d.ts +7 -0
- package/dist/persona-conversation.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +6 -6
- package/dist/tool-loop.d.ts +11 -0
- package/dist/tool-loop.d.ts.map +1 -1
- package/package.json +11 -11
package/AGENTS.md
CHANGED
|
@@ -7,8 +7,11 @@ Chat rooms, threads, and agent sessions with app-controlled tool whitelisting.
|
|
|
7
7
|
`pnpm --dir packages/chat dev` runs a package-local SvelteKit workbench. The root
|
|
8
8
|
route is an interactive chat surface with a dev-only `/api/dev-chat` endpoint:
|
|
9
9
|
it uses `@happyvertical/ai` when local provider credentials are present and
|
|
10
|
-
falls back to a deterministic local assistant otherwise. `/
|
|
11
|
-
|
|
10
|
+
falls back to a deterministic local assistant otherwise. `/api/dev-chat-stream`
|
|
11
|
+
is its SSE companion (#1936) — the same provider/local-fallback resolution wired
|
|
12
|
+
through `createChatStreamHandler` in plain mode, so an embedded `SmrtChatBackend`
|
|
13
|
+
client can exercise token streaming locally. `/previews` hosts the shared
|
|
14
|
+
component playground entries from `src/svelte/playground.ts`.
|
|
12
15
|
|
|
13
16
|
The root workbench also has a dev-only voice conversation mode. It reads voice
|
|
14
17
|
gateway connection details through `/api/dev-voice/config`, streams browser mic
|
|
@@ -56,6 +59,14 @@ Voice is an input mode for the existing persona chat harness, not a separate cha
|
|
|
56
59
|
|
|
57
60
|
The gateway bearer token proves only "this request came from the gateway"; it never authorizes the end user. The short-lived `VoiceSession` binding is the user/session proof, and untrusted gateway metadata must be validated against that binding before any chat write or tool loop. Tool execution remains fail-closed through the persona allow-list mirrored onto `AgentSession` by `bindPersonaToSession()`.
|
|
58
61
|
|
|
62
|
+
## Token Streaming (SSE, #1936)
|
|
63
|
+
|
|
64
|
+
`chat-stream.ts` is the SSE seam for embeddable conversational UIs (first consumer: the Happy chat widget, `animation#5`): a client POSTs the conversation so far and receives a `text/event-stream` of `data: <json>` frames — `token` deltas as the model generates, then a final `done` frame with the message. The wire `ChatStreamEvent` union also declares `emotion` and `control` (#1921 host-page control commands) lanes for forward compatibility; the v1 engine emits `token`/`done`/`error`.
|
|
65
|
+
|
|
66
|
+
- **`runChatConversationStream({ context, messages })`** — the transport-agnostic engine (an `AsyncGenerator<ChatStreamEvent>`). Dispatches on `context.binding`: **persona-bound** runs the full `runPersonaConversationTurn` with a token sink wired through the tool loop (`onToken` → `ai.chat({ stream: true, onProgress })`), then persists via `ChatService` and emits the persisted message as `done`; **plain/unbound** streams `ai.stream()` directly and emits a synthesized (unpersisted) `done`. Streamed tokens are a live PREVIEW (a tool-call round may narrate before acting); the `done` message is authoritative. Failures surface as an in-band `error` event, never a throw (the 200 has already committed once streaming starts).
|
|
67
|
+
- **`createChatStreamHandler({ authorize, allowedOrigins?, allowCredentials? })`** — a Fetch-compatible handler returning `text/event-stream` (mirrors `createVoiceGatewayTurnHandler`). `authorize(request, body)` is the SOLE trust boundary and works exactly like the voice gateway: this module NEVER authorizes from the request's `session` metadata — the app validates the caller (bearer session id / cookie / same-origin) and the claimed ids against the authenticated principal, and returns an already-authorized `ChatStreamContext`. Generation caps (`model`/`maxTokens`/`maxSteps`) live on the context (server-resolved), never on the request. Cross-origin embedding uses the same fail-closed CORS posture as core `_events` (#1861): the `Origin` is echoed only when allow-listed (never `*`), credentials only when opted in.
|
|
68
|
+
- **Persona path reuses the harness's own gates unchanged** — persona principal, fail-closed `allowedTools` offer+execution gates, tenant binding. `onToken` is best-effort telemetry threaded through `runToolLoop`; it never changes what the loop persists or authorizes.
|
|
69
|
+
|
|
59
70
|
## Gotchas
|
|
60
71
|
|
|
61
72
|
- **sessionContext, not context**: `context` is reserved for slug scoping. Use `getSessionContext()`/`updateSessionContext()` for agent memory.
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { AIInterface } from '@happyvertical/ai';
|
|
2
|
+
import { PrincipalAuditSink } from '@happyvertical/smrt-agents';
|
|
3
|
+
import { SmrtClassOptions } from '@happyvertical/smrt-core';
|
|
4
|
+
import { AgentSession } from './models/AgentSession.js';
|
|
5
|
+
import { ConversationPersona, PersonaRecallOptions } from './persona-conversation.js';
|
|
6
|
+
import { ChatService } from './services/index.js';
|
|
7
|
+
import { VoiceGatewayTurnMetadata } from './voice.js';
|
|
8
|
+
/** Max conversation messages accepted on one streaming request. */
|
|
9
|
+
export declare const MAX_CHAT_STREAM_MESSAGES = 50;
|
|
10
|
+
/** Max characters per message (matches the voice gateway text cap). */
|
|
11
|
+
export declare const MAX_CHAT_STREAM_CONTENT_LENGTH = 12000;
|
|
12
|
+
/**
|
|
13
|
+
* Default SSE keep-alive interval (ms). A persona turn can go quiet for tens of
|
|
14
|
+
* seconds during a silent tool-calling round (an LLM round-trip + an in-process
|
|
15
|
+
* tool op emit no tokens), and idle intermediaries (nginx / ALB / Cloudflare —
|
|
16
|
+
* the expected home for an embedded widget backend) drop a connection with no
|
|
17
|
+
* traffic. A periodic SSE comment line keeps it warm, mirroring the core
|
|
18
|
+
* `_events` route's `DEFAULT_EVENTS_HEARTBEAT_MS`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const DEFAULT_CHAT_STREAM_HEARTBEAT_MS = 15000;
|
|
21
|
+
/** Roles carried on the wire (a subset of the internal `ChatMessageRole`). */
|
|
22
|
+
export type ChatStreamRole = 'user' | 'assistant' | 'system';
|
|
23
|
+
/**
|
|
24
|
+
* A conversation message on the wire — the shape the client sends in `messages`
|
|
25
|
+
* and the shape the final `done` frame carries back. Kept self-contained (not
|
|
26
|
+
* the internal `ChatMessage` model) so the contract is stable and JSON-only.
|
|
27
|
+
*/
|
|
28
|
+
export interface ChatStreamMessage {
|
|
29
|
+
id?: string;
|
|
30
|
+
role: ChatStreamRole;
|
|
31
|
+
content: string;
|
|
32
|
+
/** ISO-8601 timestamp. */
|
|
33
|
+
createdAt?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Session metadata the client attaches to a turn — `VoiceGatewayTurnMetadata`-
|
|
37
|
+
* shaped so voice and chat share one binding vocabulary. It is UNTRUSTED input:
|
|
38
|
+
* the handler's `authorize` callback is responsible for validating any of these
|
|
39
|
+
* ids against the authenticated principal before they reach a chat write or the
|
|
40
|
+
* tool loop.
|
|
41
|
+
*/
|
|
42
|
+
export type ChatStreamSession = VoiceGatewayTurnMetadata;
|
|
43
|
+
/**
|
|
44
|
+
* A host-page control command (#1921, smrt-ui `control-interaction.ts`) carried
|
|
45
|
+
* on the optional `control` lane. Kept structural here so the streaming
|
|
46
|
+
* contract does not hard-couple to `@happyvertical/smrt-ui/forms`' exact union:
|
|
47
|
+
* the client adapter (the Happy widget) executes it against its own control
|
|
48
|
+
* registry, where sensitivity gating and the stage→apply consent split stay
|
|
49
|
+
* enforced registry-side.
|
|
50
|
+
*/
|
|
51
|
+
export interface ChatStreamControlCommand {
|
|
52
|
+
action: string;
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* One frame of the stream. `token`/`done`/`error` are emitted today; `emotion`
|
|
57
|
+
* and `control` are part of the wire contract (so clients can rely on the union
|
|
58
|
+
* and a future server hook can emit them without a breaking change) but are not
|
|
59
|
+
* produced by the v1 engine.
|
|
60
|
+
*/
|
|
61
|
+
export type ChatStreamEvent = {
|
|
62
|
+
type: 'token';
|
|
63
|
+
text: string;
|
|
64
|
+
} | {
|
|
65
|
+
type: 'emotion';
|
|
66
|
+
name: string;
|
|
67
|
+
} | {
|
|
68
|
+
type: 'control';
|
|
69
|
+
command: ChatStreamControlCommand;
|
|
70
|
+
} | {
|
|
71
|
+
type: 'done';
|
|
72
|
+
message: ChatStreamMessage;
|
|
73
|
+
} | {
|
|
74
|
+
type: 'error';
|
|
75
|
+
error: string;
|
|
76
|
+
};
|
|
77
|
+
/** The JSON body of a streaming request. */
|
|
78
|
+
export interface ChatStreamRequestBody {
|
|
79
|
+
messages?: unknown;
|
|
80
|
+
session?: ChatStreamSession;
|
|
81
|
+
}
|
|
82
|
+
/** The minimal `AgentSession` surface the persona turn needs. */
|
|
83
|
+
type StreamSessionLike = Pick<AgentSession, 'id' | 'chatRoomId' | 'systemPrompt'>;
|
|
84
|
+
/**
|
|
85
|
+
* A resolved, ALREADY-AUTHORIZED persona binding. The `authorize` callback
|
|
86
|
+
* produces this after validating the request against the authenticated
|
|
87
|
+
* principal; nothing here is taken from untrusted request metadata.
|
|
88
|
+
*/
|
|
89
|
+
export interface ChatStreamPersonaBinding {
|
|
90
|
+
chatService: ChatService;
|
|
91
|
+
/** Database handle the persona turn's side-door operations run against. */
|
|
92
|
+
db: SmrtClassOptions['db'];
|
|
93
|
+
persona: ConversationPersona;
|
|
94
|
+
session: StreamSessionLike;
|
|
95
|
+
tenantId: string;
|
|
96
|
+
/** Thread within the bound session room to author into. */
|
|
97
|
+
threadId?: string | null;
|
|
98
|
+
/** Originating user the turn runs on behalf of (audited). */
|
|
99
|
+
onBehalfOfUserId?: string | null;
|
|
100
|
+
/** Recall configuration, or `false` to skip memory recall. */
|
|
101
|
+
recall?: PersonaRecallOptions | false;
|
|
102
|
+
/** Audit sink forwarded to the principal execution. */
|
|
103
|
+
audit?: PrincipalAuditSink;
|
|
104
|
+
/** Opt into Postgres RLS transaction wrapping. */
|
|
105
|
+
postgresRls?: boolean;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The trusted context a turn runs in. `binding` present ⇒ persona-bound; absent
|
|
109
|
+
* ⇒ plain `ai.stream()`. Generation caps live here (server-resolved), never on
|
|
110
|
+
* the request, so a caller cannot widen `maxTokens`/`maxSteps`.
|
|
111
|
+
*/
|
|
112
|
+
export interface ChatStreamContext {
|
|
113
|
+
ai: AIInterface;
|
|
114
|
+
binding?: ChatStreamPersonaBinding;
|
|
115
|
+
/** System prompt for the PLAIN path. Ignored when `binding` is set. */
|
|
116
|
+
systemPrompt?: string;
|
|
117
|
+
model?: string;
|
|
118
|
+
temperature?: number;
|
|
119
|
+
maxTokens?: number;
|
|
120
|
+
maxSteps?: number;
|
|
121
|
+
}
|
|
122
|
+
/** Options for {@link runChatConversationStream}. */
|
|
123
|
+
export interface RunChatConversationStreamOptions {
|
|
124
|
+
context: ChatStreamContext;
|
|
125
|
+
/** The conversation so far; the last user message is this turn's prompt. */
|
|
126
|
+
messages: ChatStreamMessage[];
|
|
127
|
+
}
|
|
128
|
+
/** Base error carrying an HTTP status + code for the handler to render. */
|
|
129
|
+
export declare class ChatStreamError extends Error {
|
|
130
|
+
readonly status: number;
|
|
131
|
+
readonly code: string;
|
|
132
|
+
constructor(message: string, status: number, code: string);
|
|
133
|
+
}
|
|
134
|
+
/** 400 — malformed request body. */
|
|
135
|
+
export declare class ChatStreamBadRequestError extends ChatStreamError {
|
|
136
|
+
constructor(message?: string);
|
|
137
|
+
}
|
|
138
|
+
/** 401 — the request could not be authorized. */
|
|
139
|
+
export declare class ChatStreamUnauthorizedError extends ChatStreamError {
|
|
140
|
+
constructor(message?: string);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Run one streaming conversation turn, yielding SSE events. Dispatches on
|
|
144
|
+
* `context.binding`: persona-bound turns run the full harness; unbound turns
|
|
145
|
+
* stream `ai.stream()`. Errors surface as an in-band `error` event (the HTTP
|
|
146
|
+
* response has already committed to 200 once streaming starts), never a throw.
|
|
147
|
+
*/
|
|
148
|
+
export declare function runChatConversationStream(options: RunChatConversationStreamOptions): AsyncGenerator<ChatStreamEvent>;
|
|
149
|
+
/**
|
|
150
|
+
* Options for {@link createChatStreamHandler}.
|
|
151
|
+
*/
|
|
152
|
+
export interface ChatStreamHandlerOptions {
|
|
153
|
+
/**
|
|
154
|
+
* Resolve an ALREADY-AUTHORIZED context from the request. This is the sole
|
|
155
|
+
* trust boundary: validate the caller (bearer session id / cookie /
|
|
156
|
+
* same-origin) and the claimed `body.session` ids against the authenticated
|
|
157
|
+
* principal here, and return the context the turn runs in. Throw a
|
|
158
|
+
* {@link ChatStreamError} (or any error ⇒ 500) to reject before any byte is
|
|
159
|
+
* streamed.
|
|
160
|
+
*/
|
|
161
|
+
authorize: (request: Request, body: ChatStreamRequestBody) => ChatStreamContext | Promise<ChatStreamContext>;
|
|
162
|
+
/**
|
|
163
|
+
* Cross-origin allowlist for the embedded widget (#1861 posture): the request
|
|
164
|
+
* `Origin` is echoed only when a member (never `*`). Empty/omitted ⇒
|
|
165
|
+
* same-origin only.
|
|
166
|
+
*/
|
|
167
|
+
allowedOrigins?: string[];
|
|
168
|
+
/** Emit `Access-Control-Allow-Credentials: true` for an allow-listed origin. */
|
|
169
|
+
allowCredentials?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* SSE keep-alive interval (ms). Defaults to
|
|
172
|
+
* {@link DEFAULT_CHAT_STREAM_HEARTBEAT_MS}. `0` disables the heartbeat.
|
|
173
|
+
*/
|
|
174
|
+
heartbeatMs?: number;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Build a Fetch-compatible SSE handler for the streaming contract (mirrors
|
|
178
|
+
* `createVoiceGatewayTurnHandler`). Returns `text/event-stream`; wire it into a
|
|
179
|
+
* SvelteKit `+server.ts`, a Bun/Node server, or any Fetch host.
|
|
180
|
+
*/
|
|
181
|
+
export declare function createChatStreamHandler(options: ChatStreamHandlerOptions): (request: Request) => Promise<Response>;
|
|
182
|
+
/** SSE serialization of one event: a single `data:` frame. */
|
|
183
|
+
export declare function encodeChatStreamEvent(event: ChatStreamEvent): string;
|
|
184
|
+
export {};
|
|
185
|
+
//# sourceMappingURL=chat-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-stream.d.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KAAK,OAAO,CAAC,QAAQ,CAAC,CAkFzC;AAID,8DAA8D;AAC9D,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAEpE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { acceptAppliedChange, type CaptureChatFeedbackOptions, type ChatFeedbackBase, type ChatFeedbackPersona, type ChatFeedbackResult, captureChatFeedback, correctResponse, rateResponse, rejectAppliedChange, thumbsDown, thumbsUp, } from './chat-feedback.js';
|
|
2
|
+
export { ChatStreamBadRequestError, type ChatStreamContext, type ChatStreamControlCommand, ChatStreamError, type ChatStreamEvent, type ChatStreamHandlerOptions, type ChatStreamMessage, type ChatStreamPersonaBinding, type ChatStreamRequestBody, type ChatStreamRole, type ChatStreamSession, ChatStreamUnauthorizedError, createChatStreamHandler, DEFAULT_CHAT_STREAM_HEARTBEAT_MS, encodeChatStreamEvent, MAX_CHAT_STREAM_CONTENT_LENGTH, MAX_CHAT_STREAM_MESSAGES, type RunChatConversationStreamOptions, runChatConversationStream, } from './chat-stream.js';
|
|
2
3
|
export { AgentSession, ChatMessage, ChatParticipant, ChatReaction, ChatRoom, ChatThread, VoiceGatewayTurn, VoiceSession, } from './models/index.js';
|
|
3
4
|
export { type AuthoredConversationMessages, type BindPersonaToSessionOptions, bindPersonaToSession, type ConversationPersona, type ConversationReplyService, conversationPersonaFromAgentPersona, conversationPersonaFromResolved, formatRecalledMemory, type PersonaConversationTurnOptions, type PersonaConversationTurnResult, type PersonaRecallOptions, principalBindingFor, recallPersonaMemory, resolveConversationInstructions, runPersonaConversationTurn, } from './persona-conversation.js';
|
|
4
5
|
export { ChatService } from './services/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;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