@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.
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "version": "1.0.0",
3
- "timestamp": 1783819645340,
3
+ "timestamp": 1783845616112,
4
4
  "packageName": "@happyvertical/smrt-chat",
5
- "packageVersion": "0.39.4",
5
+ "packageVersion": "0.39.6",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-chat:AgentSessionCollection": {
8
8
  "name": "agentsessioncollection",
9
9
  "className": "AgentSessionCollection",
10
10
  "qualifiedName": "@happyvertical/smrt-chat:AgentSessionCollection",
11
11
  "collection": "agentsessions",
12
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/collections/AgentSessionCollection.ts",
12
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/collections/AgentSessionCollection.ts",
13
13
  "packageName": "@happyvertical/smrt-chat",
14
14
  "fields": {},
15
15
  "methods": {
@@ -165,7 +165,7 @@
165
165
  "className": "ChatMessageCollection",
166
166
  "qualifiedName": "@happyvertical/smrt-chat:ChatMessageCollection",
167
167
  "collection": "chatmessages",
168
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/collections/ChatMessageCollection.ts",
168
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/collections/ChatMessageCollection.ts",
169
169
  "packageName": "@happyvertical/smrt-chat",
170
170
  "fields": {},
171
171
  "methods": {
@@ -350,7 +350,7 @@
350
350
  "className": "ChatParticipantCollection",
351
351
  "qualifiedName": "@happyvertical/smrt-chat:ChatParticipantCollection",
352
352
  "collection": "chatparticipants",
353
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/collections/ChatParticipantCollection.ts",
353
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/collections/ChatParticipantCollection.ts",
354
354
  "packageName": "@happyvertical/smrt-chat",
355
355
  "fields": {},
356
356
  "methods": {
@@ -558,7 +558,7 @@
558
558
  "className": "ChatReactionCollection",
559
559
  "qualifiedName": "@happyvertical/smrt-chat:ChatReactionCollection",
560
560
  "collection": "chatreactions",
561
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/collections/ChatReactionCollection.ts",
561
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/collections/ChatReactionCollection.ts",
562
562
  "packageName": "@happyvertical/smrt-chat",
563
563
  "fields": {},
564
564
  "methods": {
@@ -681,7 +681,7 @@
681
681
  "className": "ChatRoomCollection",
682
682
  "qualifiedName": "@happyvertical/smrt-chat:ChatRoomCollection",
683
683
  "collection": "chatrooms",
684
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/collections/ChatRoomCollection.ts",
684
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/collections/ChatRoomCollection.ts",
685
685
  "packageName": "@happyvertical/smrt-chat",
686
686
  "fields": {},
687
687
  "methods": {
@@ -833,7 +833,7 @@
833
833
  "className": "ChatThreadCollection",
834
834
  "qualifiedName": "@happyvertical/smrt-chat:ChatThreadCollection",
835
835
  "collection": "chatthreads",
836
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/collections/ChatThreadCollection.ts",
836
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/collections/ChatThreadCollection.ts",
837
837
  "packageName": "@happyvertical/smrt-chat",
838
838
  "fields": {},
839
839
  "methods": {
@@ -935,7 +935,7 @@
935
935
  "className": "VoiceGatewayTurnCollection",
936
936
  "qualifiedName": "@happyvertical/smrt-chat:VoiceGatewayTurnCollection",
937
937
  "collection": "voicegatewayturns",
938
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/collections/VoiceGatewayTurnCollection.ts",
938
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/collections/VoiceGatewayTurnCollection.ts",
939
939
  "packageName": "@happyvertical/smrt-chat",
940
940
  "fields": {},
941
941
  "methods": {
@@ -1015,7 +1015,7 @@
1015
1015
  "className": "VoiceSessionCollection",
1016
1016
  "qualifiedName": "@happyvertical/smrt-chat:VoiceSessionCollection",
1017
1017
  "collection": "voicesessions",
1018
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/collections/VoiceSessionCollection.ts",
1018
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/collections/VoiceSessionCollection.ts",
1019
1019
  "packageName": "@happyvertical/smrt-chat",
1020
1020
  "fields": {},
1021
1021
  "methods": {
@@ -1120,7 +1120,7 @@
1120
1120
  "className": "AgentSession",
1121
1121
  "qualifiedName": "@happyvertical/smrt-chat:AgentSession",
1122
1122
  "collection": "agentsessions",
1123
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/models/AgentSession.ts",
1123
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/models/AgentSession.ts",
1124
1124
  "packageName": "@happyvertical/smrt-chat",
1125
1125
  "fields": {
1126
1126
  "tenantId": {
@@ -1523,7 +1523,7 @@
1523
1523
  "className": "ChatMessage",
1524
1524
  "qualifiedName": "@happyvertical/smrt-chat:ChatMessage",
1525
1525
  "collection": "chatmessages",
1526
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/models/ChatMessage.ts",
1526
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/models/ChatMessage.ts",
1527
1527
  "packageName": "@happyvertical/smrt-chat",
1528
1528
  "fields": {
1529
1529
  "tenantId": {
@@ -1956,7 +1956,7 @@
1956
1956
  "className": "ChatParticipant",
1957
1957
  "qualifiedName": "@happyvertical/smrt-chat:ChatParticipant",
1958
1958
  "collection": "chatparticipants",
1959
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/models/ChatParticipant.ts",
1959
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/models/ChatParticipant.ts",
1960
1960
  "packageName": "@happyvertical/smrt-chat",
1961
1961
  "fields": {
1962
1962
  "tenantId": {
@@ -2282,7 +2282,7 @@
2282
2282
  "className": "ChatReaction",
2283
2283
  "qualifiedName": "@happyvertical/smrt-chat:ChatReaction",
2284
2284
  "collection": "chatreactions",
2285
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/models/ChatReaction.ts",
2285
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/models/ChatReaction.ts",
2286
2286
  "packageName": "@happyvertical/smrt-chat",
2287
2287
  "fields": {
2288
2288
  "tenantId": {
@@ -2445,7 +2445,7 @@
2445
2445
  "className": "ChatRoom",
2446
2446
  "qualifiedName": "@happyvertical/smrt-chat:ChatRoom",
2447
2447
  "collection": "chatrooms",
2448
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/models/ChatRoom.ts",
2448
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/models/ChatRoom.ts",
2449
2449
  "packageName": "@happyvertical/smrt-chat",
2450
2450
  "fields": {
2451
2451
  "tenantId": {
@@ -2776,7 +2776,7 @@
2776
2776
  "className": "ChatThread",
2777
2777
  "qualifiedName": "@happyvertical/smrt-chat:ChatThread",
2778
2778
  "collection": "chatthreads",
2779
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/models/ChatThread.ts",
2779
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/models/ChatThread.ts",
2780
2780
  "packageName": "@happyvertical/smrt-chat",
2781
2781
  "fields": {
2782
2782
  "tenantId": {
@@ -2990,7 +2990,7 @@
2990
2990
  "className": "VoiceGatewayTurn",
2991
2991
  "qualifiedName": "@happyvertical/smrt-chat:VoiceGatewayTurn",
2992
2992
  "collection": "voicegatewayturns",
2993
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/models/VoiceGatewayTurn.ts",
2993
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/models/VoiceGatewayTurn.ts",
2994
2994
  "packageName": "@happyvertical/smrt-chat",
2995
2995
  "fields": {
2996
2996
  "tenantId": {
@@ -3247,7 +3247,7 @@
3247
3247
  "className": "VoiceSession",
3248
3248
  "qualifiedName": "@happyvertical/smrt-chat:VoiceSession",
3249
3249
  "collection": "voicesessions",
3250
- "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-b6zmd/smrt/smrt/packages/chat/src/models/VoiceSession.ts",
3250
+ "filePath": "/home/runner/.local/share/pnpm/store/.workspaces/arc-happyvertical-node-phdrb-runner-xv52x/smrt/smrt/packages/chat/src/models/VoiceSession.ts",
3251
3251
  "packageName": "@happyvertical/smrt-chat",
3252
3252
  "fields": {
3253
3253
  "tenantId": {
@@ -152,6 +152,13 @@ export interface PersonaConversationTurnOptions {
152
152
  postgresRls?: boolean;
153
153
  /** Correlation id for the turn (feedback ties back to it). Auto-generated when omitted. */
154
154
  correlationId?: string;
155
+ /**
156
+ * Token sink for live streaming (#1936). Forwarded to {@link runToolLoop}: the
157
+ * model's text deltas stream here as they arrive. Best-effort (see
158
+ * `ToolLoopOptions.onToken`); the authored assistant message remains the
159
+ * authoritative final content.
160
+ */
161
+ onToken?: (chunk: string) => void;
155
162
  }
156
163
  /** The outcome of a persona-bound conversation turn. */
157
164
  export interface PersonaConversationTurnResult {
@@ -1 +1 @@
1
- {"version":3,"file":"persona-conversation.d.ts","sourceRoot":"","sources":["../src/persona-conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;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C,OAAO,CAAC,YAAY,CAAC,CAavB"}
1
+ {"version":3,"file":"persona-conversation.d.ts","sourceRoot":"","sources":["../src/persona-conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,2EAA2E;IAC3E,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,qBAAqB;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,2EAA2E;IAC3E,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qFAAqF;AACrF,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE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AO,CAAC,YAAY,CAAC,CAAC;KAC3B,CAAC;IACF,2BAA2B;IAC3B,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAClC,iEAAiE;IACjE,cAAc,EAAE,MAAM,CAAC;IACvB,qCAAqC;IACrC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,0CAA0C;IAC1C,OAAO,EAAE,mBAAmB,CAAC;IAC7B,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,YAAY,CAAC,CAavB"}
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-07-12T01:27:30.792Z",
3
+ "generatedAt": "2026-07-12T08:40:19.578Z",
4
4
  "packageName": "@happyvertical/smrt-chat",
5
- "packageVersion": "0.39.4",
5
+ "packageVersion": "0.39.6",
6
6
  "sourceManifestPath": "dist/manifest.json",
7
7
  "agentDocPath": "AGENTS.md",
8
8
  "sourceHashes": {
9
- "manifest": "cc98480e2a704b73aed1133bd4c198f93275d7f942a282c5844183c47f4a457c",
10
- "packageJson": "f970f900b199051edce117e27906f87c5900aedbab955548712650a320622d54",
11
- "agents": "6cd3406a8954dd51b7c3354115a022333c96f125c9e2ac1ede272951da2a1f10"
9
+ "manifest": "f9b7927176d3b01dc06b4b8f870c62caa51406199435530730e6c360a44578c2",
10
+ "packageJson": "a9b5f3436b3655046646433ed9fa6bbd5fd34f0a298e776b73d11d700e729764",
11
+ "agents": "beab006bbe914a6c772647b6a4250d9819bdf627e63faadf021bc8564de4b834"
12
12
  },
13
13
  "exports": [
14
14
  ".",
@@ -1984,5 +1984,5 @@
1984
1984
  "polymorphicAssociations": 0,
1985
1985
  "uuidColumns": 46
1986
1986
  },
1987
- "agentDoc": "# @happyvertical/smrt-chat\n\nChat rooms, threads, and agent sessions with app-controlled tool whitelisting.\n\n## Dev Server\n\n`pnpm --dir packages/chat dev` runs a package-local SvelteKit workbench. The root\nroute is an interactive chat surface with a dev-only `/api/dev-chat` endpoint:\nit uses `@happyvertical/ai` when local provider credentials are present and\nfalls back to a deterministic local assistant otherwise. `/previews` hosts the\nshared component playground entries from `src/svelte/playground.ts`.\n\nThe root workbench also has a dev-only voice conversation mode. It reads voice\ngateway connection details through `/api/dev-voice/config`, streams browser mic\naudio to `WS /ws/voice` as PCM16 mono, appends gateway transcripts/responses to\nthe chat, and plays returned TTS audio. Exposing\n`SMRT_CHAT_DEV_VOICE_GATEWAY_TOKEN` to the browser requires\n`SMRT_CHAT_DEV_VOICE_GATEWAY_EXPOSE_TOKEN=true`; keep that local-only.\n\n## Models\n\nInternal models — all mutations go through the membership/owner-checked `ChatService` (S5 #1392) or the voice adapter's binding-checked flow. EVERY `@smrt()` model in this package (ChatRoom, ChatMessage, ChatParticipant, ChatThread, ChatReaction, AgentSession, VoiceSession) has a READ-ONLY generated REST/MCP surface (`list`/`get` only); `create`/`update`/`delete` are intentionally NOT generated so the raw collection routes cannot skip the service-layer authorization. A structural regression test enumerates the registry to assert no chat model exposes a mutating op.\n\n`ChatService` is a CLOSED FACADE (S5 #1392). The raw collections (`rooms`, `messages`, `participants`, `threads`, `agentSessions`, `reactions`, `voiceSessions`) are ES `#private` fields — they are NOT on the public `ChatService` type and the package index does NOT export the collection classes, so a consumer cannot do `chat.messages.create({senderProfileId, role})` / `new ChatParticipantCollection(...)` to mutate around the authorization. The security-sensitive internals (`#writeMessage`, `#emitAgentReply`, `#enrollParticipant`, `#loadActiveSession`, `#requireActiveMembership`, `#requireRoomAdmin`, `#extractToolName`) are ES `#private` too, so they are unreachable at runtime — TypeScript `private` alone is erased and would leave them callable on the prototype. The agent-reply bridge is a `Symbol`-keyed static (not the old enumerable `_runAgentReply`), reachable only by the module-local `sendAgentReply` that holds the non-exported symbol.\n\n- **ChatRoom**: `roomType` (public/private/dm/agent), `status`, `topic`, `maxParticipants`, `lastMessageAt`. Tenant-scoped (required).\n- **ChatMessage**: shared by users + agents. `role` (user/assistant/system/tool), `messageType` (text/system/action/file/tool_call/tool_result), `toolCallData` JSON. Unified model — no separate agent message type. Tenant-scoped (required).\n- **ChatParticipant**: `role` (owner/admin/member/viewer), `onlineStatus`, `lastReadMessageId`, `isMuted`. Tenant-scoped (required).\n- **ChatThread**: `rootMessageId`, `isResolved`, `messageCount`. Created via `ChatService.startThread()` (member-checked). Tenant-scoped (required).\n- **ChatReaction**: `messageId`, `profileId`, `emoji`. Added/removed via `ChatService.addReaction()`/`removeReaction()` (member-checked, self-keyed). Tenant-scoped (required).\n- **AgentSession**: `agentId` (string ref, not FK), `allowedTools` (JSON string array), `sessionContext` (JSON), `systemPrompt`, limits (`maxTokens`/`maxMessages`/`expiresAt`). Optional tenancy.\n- **VoiceSession**: short-lived voice-gateway binding over `(tenant, actorProfileId, personaId, room/thread/agentSession)` plus a persona snapshot, gateway `session_id`, expiry, replay tracking, and metadata. Tenant-scoped (required). Generated surface is read-only; creation and turns go through `createVoiceChatSession()` / `handleVoiceGatewayTurn()`.\n\n## ChatService\n\nEvery public write takes an explicit server-supplied `actorProfileId` (the authenticated principal the route injects) — never a caller-controlled `senderProfileId`/`role` (S5 #1392).\n\nFacade: `sendMessage()` (authors as the actor with `role: 'user'`; room-membership-checked; no caller-supplied sender/role and no public membership-skip), `createRoom()` (acting actor becomes owner — no caller-supplied `createdByProfileId`), `startThread()` (member-checked; optional `rootMessageId` bound to the same room+tenant), `addParticipant()`/`removeParticipant()` (owner/admin-checked; self-leave allowed), `updateRoom()` (owner/admin-checked), `addReaction()`/`removeReaction()` (member-checked, self-keyed), `getOrCreateDM()` (actor must be a DM participant), `createAgentSession()` (acting actor becomes the session participant — no caller-supplied `participantProfileId`; the existing-session room lookup is tenant-bound; optional `sessionKey` scopes session identity to a conversation subject so distinct keys get distinct sessions/rooms and a session opened for one subject is never reused/rewritten for another). Tenant-bound read facade (replaces raw-collection reach-ins; consumers apply their own ownership/context checks on the returned rows): `getAgentSession({agentSessionId, tenantId})`, `findActiveAgentSessions({tenantId, agentId, participantProfileId})`, `getThread({threadId, tenantId})`, `listRoomThreads({roomId, actorProfileId, tenantId})` (membership-gated), `getThreadMessages({threadId, actorProfileId, tenantId, limit?})` (membership-gated, chronological), `getRoomMessages({roomId, actorProfileId, tenantId})`/`getRoomForMember(roomId, actorProfileId, tenantId)` (membership-checked reads gated on the server-supplied `actorProfileId`, never a caller-controlled subject id — confused-deputy avoidance; `tenantId` required), `updateAgentSessionConfig()` (owner-checked; `tenantId` mandatory and bound into the lookup). Agent session messaging is split by authority: `sendAgentUserMessage()` (caller `actorProfileId` must be the session participant; always authored as the participant). The agent-authored reply path `sendAgentReply(service, params)` is an exported **function — NOT a `ChatService` method and NOT on the package index**; it is reachable only via the dedicated `@happyvertical/smrt-chat/internal/agent-runtime` subpath (S5 #1392), so only trusted in-process agent-runtime code that explicitly opts into that subpath can author as the agent. It authors as `session.agentId`, accepts an optional same-room/tenant `threadId`, and gates tool calls fail-closed against `allowedTools`. The shared internal persistence path (`writeMessage`) is private — it alone may author an arbitrary profile/role or skip the membership check, and is unreachable from any route; it also validates every supplied `threadId`/`agentSessionId`/`replyToMessageId` belongs to the SAME room AND tenant (tenant/room-bound lookups) before use, rejecting cross-room/cross-tenant references. Auto-creates rooms/sessions/participants via an internal `enrollParticipant`.\n\n## Agent Tool Whitelisting\n\n`allowedTools` is a JSON array controlled by the consuming app. Fail-closed: an empty/unparseable whitelist permits NO tools. The internal `sendAgentReply(service, params)` function enforces the whitelist before emitting any `tool`/`tool_call` message; a caller cannot supply a `senderProfileId`/`role` to post as the agent, and the function is not reachable from the package index.\n\n## Conversational Harness (L3, #1891)\n\nThe \"chat with your learning agent\" surface — the real agentic runtime for `AgentSession` (the only shipping chat runtime before this was a single-shot completion). This is the new **acyclic `chat → personas` / `chat → agents` / `chat → users` edge**; keep it that way (personas/agents/users never depend back on chat).\n\n- **`runToolLoop(options)`** (`tool-loop.ts`) — a bounded `tool_call → observe → respond` loop. Tools are **manifest operations** of installed packages: `buildManifestToolCatalog({ allowedTools })` reads the `PermissionCatalogService` catalog and keeps only the `(collection, action)` entries named in the persona's allow-list (the **offer gate**; absent/empty ⇒ NO tools). The loop runs inside one `executeAsPrincipal` context, and `invokeManifestTool` executes each op **in-process (\"side door\")** against `run.context.database` (the RLS tx when Postgres RLS is on), after re-asserting the fail-closed allow-list (`run.assertToolAllowed`) AND the catalog permission (`run.assertOperation`) — the **execution gate**. Bounded by a max-steps ceiling (`DEFAULT_MAX_STEPS = 8`): on the ceiling it disables tools for one final completion so the turn always terminates with text.\n- **`runPersonaConversationTurn(options)`** (`persona-conversation.ts`) — binds a conversation to an `AgentPersona`/`ResolvedPersona`: runs as its principal (`runAsUserId`), offers only its `allowedTools`, speaks its instructions (`resolvePersonaInstructions`, layering approved learned directives), and injects its **recalled learning memory** (`personaLearningMemory`, isolated per `memoryScope`) into the system prompt. `bindPersonaToSession()` mirrors the persona's `allowedTools`/instructions onto the `AgentSession` so the chat authoring gate agrees with the loop's offer gate. Authors the reply (and each executed tool) via the internal `sendAgentReply` bridge.\n- **Agent orchestration** (L3, #1892) — the loop accepts non-manifest **`extraTools`** (`PrincipalTool[]`, from `@happyvertical/smrt-agents`), gated by the *same* fail-closed allow-list. The standard **`invoke-agent`** tool (`createInvokeAgentTool`, slug `agents.invoke`) lets a conversational agent delegate to a **worker agent under its own principal** — the worker runs via `executeAsPrincipal` as the originating user (never its own authority), the principal is immutable along the chain, and its completion is surfaced back into the conversation. `runPersonaConversationTurn` filters `extraTools` by the persona's `allowedTools` (offer gate); the tool's `execute` re-asserts `assertToolAllowed` (execution gate). See `@happyvertical/smrt-agents` for the delegation envelope + transports.\n- **Chat feedback capture** (`chat-feedback.ts`) — `captureChatFeedback()` + `acceptAppliedChange`/`rejectAppliedChange`/`correctResponse`/`rateResponse`/`thumbsUp`/`thumbsDown` write a `Feedback` row (personas) carrying the conversation's **correlation-id**, and (by default) reinforce the persona's learning memory (`reinforceFromFeedback`). So an in-chat reject decays a strategy below the reuse floor and it stops being recalled; a correction supersedes its stored value.\n\n## Voice Gateway Turns (#1910)\n\nVoice is an input mode for the existing persona chat harness, not a separate chat runtime. `createVoiceChatSession()` creates a short-lived `VoiceSession` for an authenticated actor/profile, binding tenant, persona, agent session, room, and optional thread. `handleVoiceGatewayTurn()` resolves that binding from `metadata.voiceSessionId`, checks the gateway's `session_id` and any supplied tenant/profile/persona/session/thread metadata against the server-side binding, persists the transcript through `ChatService.sendAgentUserMessage()`, runs `runPersonaConversationTurn()`, stamps voice/correlation metadata onto the persisted user/assistant/tool messages, records the gateway `turn_id`, and returns the gateway response contract. The Fetch-compatible `createVoiceGatewayTurnHandler()` adds the coarse gateway bearer-token check.\n\nThe 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()`.\n\n## Gotchas\n\n- **sessionContext, not context**: `context` is reserved for slug scoping. Use `getSessionContext()`/`updateSessionContext()` for agent memory.\n- **Agent rooms auto-created**: `roomType: 'agent'`, `maxParticipants` defaults to 2; the agent is enrolled as a member so its replies pass the membership check. `createAgentSession()` re-enrolls the participant AND the agent on the existing-session path, so legacy sessions created before the agent was enrolled self-heal.\n- **Per-subject sessions need `sessionKey`**: `createAgentSession()` reuses ANY active session for the same `(agentId, participantProfileId, tenantId)`. Callers that open separate conversations per subject (e.g. one content-editor session per content id) MUST pass a stable `sessionKey` (stored in `sessionContext.__sessionKey`, read via `AgentSession.getSessionKey()`); otherwise a session opened for one subject is reused and its context overwritten for another, surfacing the wrong room/threads (S5 #1392). A keyed create never reuses a keyless/legacy session.\n- **Session expiry**: check `isActive()` before allowing messages (expiresAt or limit-based)\n- **DM identity**: derived from the deterministic per-tenant `canonicalDmRoomId()` and the authoritative `chat_participants` join, not client metadata; concurrent creates upsert onto one row.\n- **Tenant-bound lookups**: membership/session/DM lookups REQUIRE `tenantId` and always bind it into the WHERE clause (`findActiveMembership`/`isActiveMember`/`findActiveSession` take a required `tenantId`; AgentSession's `null` tenant is an explicit bound scope, not \"any tenant\") so they can never resolve a row from another tenant.\n"
1987
+ "agentDoc": "# @happyvertical/smrt-chat\n\nChat rooms, threads, and agent sessions with app-controlled tool whitelisting.\n\n## Dev Server\n\n`pnpm --dir packages/chat dev` runs a package-local SvelteKit workbench. The root\nroute is an interactive chat surface with a dev-only `/api/dev-chat` endpoint:\nit uses `@happyvertical/ai` when local provider credentials are present and\nfalls back to a deterministic local assistant otherwise. `/api/dev-chat-stream`\nis its SSE companion (#1936) — the same provider/local-fallback resolution wired\nthrough `createChatStreamHandler` in plain mode, so an embedded `SmrtChatBackend`\nclient can exercise token streaming locally. `/previews` hosts the shared\ncomponent playground entries from `src/svelte/playground.ts`.\n\nThe root workbench also has a dev-only voice conversation mode. It reads voice\ngateway connection details through `/api/dev-voice/config`, streams browser mic\naudio to `WS /ws/voice` as PCM16 mono, appends gateway transcripts/responses to\nthe chat, and plays returned TTS audio. Exposing\n`SMRT_CHAT_DEV_VOICE_GATEWAY_TOKEN` to the browser requires\n`SMRT_CHAT_DEV_VOICE_GATEWAY_EXPOSE_TOKEN=true`; keep that local-only.\n\n## Models\n\nInternal models — all mutations go through the membership/owner-checked `ChatService` (S5 #1392) or the voice adapter's binding-checked flow. EVERY `@smrt()` model in this package (ChatRoom, ChatMessage, ChatParticipant, ChatThread, ChatReaction, AgentSession, VoiceSession) has a READ-ONLY generated REST/MCP surface (`list`/`get` only); `create`/`update`/`delete` are intentionally NOT generated so the raw collection routes cannot skip the service-layer authorization. A structural regression test enumerates the registry to assert no chat model exposes a mutating op.\n\n`ChatService` is a CLOSED FACADE (S5 #1392). The raw collections (`rooms`, `messages`, `participants`, `threads`, `agentSessions`, `reactions`, `voiceSessions`) are ES `#private` fields — they are NOT on the public `ChatService` type and the package index does NOT export the collection classes, so a consumer cannot do `chat.messages.create({senderProfileId, role})` / `new ChatParticipantCollection(...)` to mutate around the authorization. The security-sensitive internals (`#writeMessage`, `#emitAgentReply`, `#enrollParticipant`, `#loadActiveSession`, `#requireActiveMembership`, `#requireRoomAdmin`, `#extractToolName`) are ES `#private` too, so they are unreachable at runtime — TypeScript `private` alone is erased and would leave them callable on the prototype. The agent-reply bridge is a `Symbol`-keyed static (not the old enumerable `_runAgentReply`), reachable only by the module-local `sendAgentReply` that holds the non-exported symbol.\n\n- **ChatRoom**: `roomType` (public/private/dm/agent), `status`, `topic`, `maxParticipants`, `lastMessageAt`. Tenant-scoped (required).\n- **ChatMessage**: shared by users + agents. `role` (user/assistant/system/tool), `messageType` (text/system/action/file/tool_call/tool_result), `toolCallData` JSON. Unified model — no separate agent message type. Tenant-scoped (required).\n- **ChatParticipant**: `role` (owner/admin/member/viewer), `onlineStatus`, `lastReadMessageId`, `isMuted`. Tenant-scoped (required).\n- **ChatThread**: `rootMessageId`, `isResolved`, `messageCount`. Created via `ChatService.startThread()` (member-checked). Tenant-scoped (required).\n- **ChatReaction**: `messageId`, `profileId`, `emoji`. Added/removed via `ChatService.addReaction()`/`removeReaction()` (member-checked, self-keyed). Tenant-scoped (required).\n- **AgentSession**: `agentId` (string ref, not FK), `allowedTools` (JSON string array), `sessionContext` (JSON), `systemPrompt`, limits (`maxTokens`/`maxMessages`/`expiresAt`). Optional tenancy.\n- **VoiceSession**: short-lived voice-gateway binding over `(tenant, actorProfileId, personaId, room/thread/agentSession)` plus a persona snapshot, gateway `session_id`, expiry, replay tracking, and metadata. Tenant-scoped (required). Generated surface is read-only; creation and turns go through `createVoiceChatSession()` / `handleVoiceGatewayTurn()`.\n\n## ChatService\n\nEvery public write takes an explicit server-supplied `actorProfileId` (the authenticated principal the route injects) — never a caller-controlled `senderProfileId`/`role` (S5 #1392).\n\nFacade: `sendMessage()` (authors as the actor with `role: 'user'`; room-membership-checked; no caller-supplied sender/role and no public membership-skip), `createRoom()` (acting actor becomes owner — no caller-supplied `createdByProfileId`), `startThread()` (member-checked; optional `rootMessageId` bound to the same room+tenant), `addParticipant()`/`removeParticipant()` (owner/admin-checked; self-leave allowed), `updateRoom()` (owner/admin-checked), `addReaction()`/`removeReaction()` (member-checked, self-keyed), `getOrCreateDM()` (actor must be a DM participant), `createAgentSession()` (acting actor becomes the session participant — no caller-supplied `participantProfileId`; the existing-session room lookup is tenant-bound; optional `sessionKey` scopes session identity to a conversation subject so distinct keys get distinct sessions/rooms and a session opened for one subject is never reused/rewritten for another). Tenant-bound read facade (replaces raw-collection reach-ins; consumers apply their own ownership/context checks on the returned rows): `getAgentSession({agentSessionId, tenantId})`, `findActiveAgentSessions({tenantId, agentId, participantProfileId})`, `getThread({threadId, tenantId})`, `listRoomThreads({roomId, actorProfileId, tenantId})` (membership-gated), `getThreadMessages({threadId, actorProfileId, tenantId, limit?})` (membership-gated, chronological), `getRoomMessages({roomId, actorProfileId, tenantId})`/`getRoomForMember(roomId, actorProfileId, tenantId)` (membership-checked reads gated on the server-supplied `actorProfileId`, never a caller-controlled subject id — confused-deputy avoidance; `tenantId` required), `updateAgentSessionConfig()` (owner-checked; `tenantId` mandatory and bound into the lookup). Agent session messaging is split by authority: `sendAgentUserMessage()` (caller `actorProfileId` must be the session participant; always authored as the participant). The agent-authored reply path `sendAgentReply(service, params)` is an exported **function — NOT a `ChatService` method and NOT on the package index**; it is reachable only via the dedicated `@happyvertical/smrt-chat/internal/agent-runtime` subpath (S5 #1392), so only trusted in-process agent-runtime code that explicitly opts into that subpath can author as the agent. It authors as `session.agentId`, accepts an optional same-room/tenant `threadId`, and gates tool calls fail-closed against `allowedTools`. The shared internal persistence path (`writeMessage`) is private — it alone may author an arbitrary profile/role or skip the membership check, and is unreachable from any route; it also validates every supplied `threadId`/`agentSessionId`/`replyToMessageId` belongs to the SAME room AND tenant (tenant/room-bound lookups) before use, rejecting cross-room/cross-tenant references. Auto-creates rooms/sessions/participants via an internal `enrollParticipant`.\n\n## Agent Tool Whitelisting\n\n`allowedTools` is a JSON array controlled by the consuming app. Fail-closed: an empty/unparseable whitelist permits NO tools. The internal `sendAgentReply(service, params)` function enforces the whitelist before emitting any `tool`/`tool_call` message; a caller cannot supply a `senderProfileId`/`role` to post as the agent, and the function is not reachable from the package index.\n\n## Conversational Harness (L3, #1891)\n\nThe \"chat with your learning agent\" surface — the real agentic runtime for `AgentSession` (the only shipping chat runtime before this was a single-shot completion). This is the new **acyclic `chat → personas` / `chat → agents` / `chat → users` edge**; keep it that way (personas/agents/users never depend back on chat).\n\n- **`runToolLoop(options)`** (`tool-loop.ts`) — a bounded `tool_call → observe → respond` loop. Tools are **manifest operations** of installed packages: `buildManifestToolCatalog({ allowedTools })` reads the `PermissionCatalogService` catalog and keeps only the `(collection, action)` entries named in the persona's allow-list (the **offer gate**; absent/empty ⇒ NO tools). The loop runs inside one `executeAsPrincipal` context, and `invokeManifestTool` executes each op **in-process (\"side door\")** against `run.context.database` (the RLS tx when Postgres RLS is on), after re-asserting the fail-closed allow-list (`run.assertToolAllowed`) AND the catalog permission (`run.assertOperation`) — the **execution gate**. Bounded by a max-steps ceiling (`DEFAULT_MAX_STEPS = 8`): on the ceiling it disables tools for one final completion so the turn always terminates with text.\n- **`runPersonaConversationTurn(options)`** (`persona-conversation.ts`) — binds a conversation to an `AgentPersona`/`ResolvedPersona`: runs as its principal (`runAsUserId`), offers only its `allowedTools`, speaks its instructions (`resolvePersonaInstructions`, layering approved learned directives), and injects its **recalled learning memory** (`personaLearningMemory`, isolated per `memoryScope`) into the system prompt. `bindPersonaToSession()` mirrors the persona's `allowedTools`/instructions onto the `AgentSession` so the chat authoring gate agrees with the loop's offer gate. Authors the reply (and each executed tool) via the internal `sendAgentReply` bridge.\n- **Agent orchestration** (L3, #1892) — the loop accepts non-manifest **`extraTools`** (`PrincipalTool[]`, from `@happyvertical/smrt-agents`), gated by the *same* fail-closed allow-list. The standard **`invoke-agent`** tool (`createInvokeAgentTool`, slug `agents.invoke`) lets a conversational agent delegate to a **worker agent under its own principal** — the worker runs via `executeAsPrincipal` as the originating user (never its own authority), the principal is immutable along the chain, and its completion is surfaced back into the conversation. `runPersonaConversationTurn` filters `extraTools` by the persona's `allowedTools` (offer gate); the tool's `execute` re-asserts `assertToolAllowed` (execution gate). See `@happyvertical/smrt-agents` for the delegation envelope + transports.\n- **Chat feedback capture** (`chat-feedback.ts`) — `captureChatFeedback()` + `acceptAppliedChange`/`rejectAppliedChange`/`correctResponse`/`rateResponse`/`thumbsUp`/`thumbsDown` write a `Feedback` row (personas) carrying the conversation's **correlation-id**, and (by default) reinforce the persona's learning memory (`reinforceFromFeedback`). So an in-chat reject decays a strategy below the reuse floor and it stops being recalled; a correction supersedes its stored value.\n\n## Voice Gateway Turns (#1910)\n\nVoice is an input mode for the existing persona chat harness, not a separate chat runtime. `createVoiceChatSession()` creates a short-lived `VoiceSession` for an authenticated actor/profile, binding tenant, persona, agent session, room, and optional thread. `handleVoiceGatewayTurn()` resolves that binding from `metadata.voiceSessionId`, checks the gateway's `session_id` and any supplied tenant/profile/persona/session/thread metadata against the server-side binding, persists the transcript through `ChatService.sendAgentUserMessage()`, runs `runPersonaConversationTurn()`, stamps voice/correlation metadata onto the persisted user/assistant/tool messages, records the gateway `turn_id`, and returns the gateway response contract. The Fetch-compatible `createVoiceGatewayTurnHandler()` adds the coarse gateway bearer-token check.\n\nThe 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()`.\n\n## Token Streaming (SSE, #1936)\n\n`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`.\n\n- **`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).\n- **`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.\n- **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.\n\n## Gotchas\n\n- **sessionContext, not context**: `context` is reserved for slug scoping. Use `getSessionContext()`/`updateSessionContext()` for agent memory.\n- **Agent rooms auto-created**: `roomType: 'agent'`, `maxParticipants` defaults to 2; the agent is enrolled as a member so its replies pass the membership check. `createAgentSession()` re-enrolls the participant AND the agent on the existing-session path, so legacy sessions created before the agent was enrolled self-heal.\n- **Per-subject sessions need `sessionKey`**: `createAgentSession()` reuses ANY active session for the same `(agentId, participantProfileId, tenantId)`. Callers that open separate conversations per subject (e.g. one content-editor session per content id) MUST pass a stable `sessionKey` (stored in `sessionContext.__sessionKey`, read via `AgentSession.getSessionKey()`); otherwise a session opened for one subject is reused and its context overwritten for another, surfacing the wrong room/threads (S5 #1392). A keyed create never reuses a keyless/legacy session.\n- **Session expiry**: check `isActive()` before allowing messages (expiresAt or limit-based)\n- **DM identity**: derived from the deterministic per-tenant `canonicalDmRoomId()` and the authoritative `chat_participants` join, not client metadata; concurrent creates upsert onto one row.\n- **Tenant-bound lookups**: membership/session/DM lookups REQUIRE `tenantId` and always bind it into the WHERE clause (`findActiveMembership`/`isActiveMember`/`findActiveSession` take a required `tenantId`; AgentSession's `null` tenant is an explicit bound scope, not \"any tenant\") so they can never resolve a row from another tenant.\n"
1988
1988
  }
@@ -110,6 +110,17 @@ export interface ToolLoopOptions {
110
110
  executeTool?: (ctx: ToolExecutionContext) => Promise<unknown>;
111
111
  /** Notified after each tool invocation (for streaming/telemetry). */
112
112
  onInvocation?: (invocation: ToolInvocation) => void | Promise<void>;
113
+ /**
114
+ * Token sink for live streaming (#1936). When set, each `ai.chat` round is run
115
+ * with `stream: true` and the model's text deltas are forwarded here as they
116
+ * arrive. It is best-effort: a provider that cannot stream (or streams no text
117
+ * on a tool-call round) simply never calls it, and the fully-resolved response
118
+ * is still returned. Deltas across ALL rounds are forwarded — a tool-call
119
+ * round may narrate before calling a tool — so the emitted tokens are a live
120
+ * PREVIEW; the loop's final `content` (persisted + surfaced by the caller as
121
+ * the authoritative message) is the source of truth.
122
+ */
123
+ onToken?: (chunk: string) => void;
113
124
  /** The originating user the turn runs on behalf of (audited). */
114
125
  onBehalfOfUserId?: string | null;
115
126
  /** Canonical agent class, recorded in the audit entry. */
@@ -1 +1 @@
1
- {"version":3,"file":"tool-loop.d.ts","sourceRoot":"","sources":["../src/tool-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,SAAS,E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AO,CAAC,CAkFlB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,cAAc,CAAC,CA6KzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-chat",
3
- "version": "0.39.4",
3
+ "version": "0.39.6",
4
4
  "description": "Chat rooms, DMs, threads, and agent conversations for the SMRT framework",
5
5
  "type": "module",
6
6
  "smrtRawPrimitives": "strict",
@@ -58,13 +58,13 @@
58
58
  "dependencies": {
59
59
  "@happyvertical/ai": "^0.78.0",
60
60
  "@happyvertical/sql": "^0.78.0",
61
- "@happyvertical/smrt-agents": "0.39.4",
62
- "@happyvertical/smrt-personas": "0.39.4",
63
- "@happyvertical/smrt-tenancy": "0.39.4",
64
- "@happyvertical/smrt-types": "0.39.4",
65
- "@happyvertical/smrt-ui": "0.39.4",
66
- "@happyvertical/smrt-core": "0.39.4",
67
- "@happyvertical/smrt-users": "0.39.4"
61
+ "@happyvertical/smrt-core": "0.39.6",
62
+ "@happyvertical/smrt-agents": "0.39.6",
63
+ "@happyvertical/smrt-tenancy": "0.39.6",
64
+ "@happyvertical/smrt-personas": "0.39.6",
65
+ "@happyvertical/smrt-ui": "0.39.6",
66
+ "@happyvertical/smrt-types": "0.39.6",
67
+ "@happyvertical/smrt-users": "0.39.6"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "svelte": "^5.56.4"
@@ -85,9 +85,9 @@
85
85
  "typescript": "^5.9.3",
86
86
  "vite": "^8.1.3",
87
87
  "vitest": "^4.1.9",
88
- "@happyvertical/smrt-playground": "0.39.4",
89
- "@happyvertical/smrt-profiles": "0.39.4",
90
- "@happyvertical/smrt-vitest": "0.39.4"
88
+ "@happyvertical/smrt-playground": "0.39.6",
89
+ "@happyvertical/smrt-profiles": "0.39.6",
90
+ "@happyvertical/smrt-vitest": "0.39.6"
91
91
  },
92
92
  "scripts": {
93
93
  "build": "SMRT_PACKAGE_BUILD=1 vite build --mode library && SMRT_PACKAGE_BUILD=1 svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json",