@happyvertical/smrt-chat 0.55.9 → 0.55.10
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 +25 -14
- package/README.md +12 -0
- package/agents/dev-workbench.md +69 -0
- package/agents/helper-preferences.md +65 -0
- package/agents/overview-tools.md +172 -0
- package/agents/token-streaming.md +3 -2
- package/dist/chunks/{ChatService-C9UxuJaw.js → ChatService-CFaaDHyU.js} +2 -2
- package/dist/chunks/{ChatService-C9UxuJaw.js.map → ChatService-CFaaDHyU.js.map} +1 -1
- package/dist/chunks/chat-stream-DN6Tw-Xu.js +2027 -0
- package/dist/chunks/chat-stream-DN6Tw-Xu.js.map +1 -0
- package/dist/dev-assistant-transport.d.ts +5 -0
- package/dist/dev-assistant-transport.d.ts.map +1 -0
- package/dist/dev-character-persistence-client.d.ts +24 -0
- package/dist/dev-character-persistence-client.d.ts.map +1 -0
- package/dist/dev-helper-client.d.ts +4 -0
- package/dist/dev-helper-client.d.ts.map +1 -0
- package/dist/dev-helper-server.d.ts +18 -0
- package/dist/dev-helper-server.d.ts.map +1 -0
- package/dist/helper-preferences-service.d.ts +22 -0
- package/dist/helper-preferences-service.d.ts.map +1 -0
- package/dist/helper-preferences.d.ts +84 -0
- package/dist/helper-preferences.d.ts.map +1 -0
- package/dist/helper-preferences.js +32 -0
- package/dist/helper-preferences.js.map +1 -0
- package/dist/helper-profile-store.d.ts +27 -0
- package/dist/helper-profile-store.d.ts.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +683 -5
- package/dist/index.js.map +1 -1
- package/dist/internal/agent-runtime.js +1 -1
- package/dist/manifest.json +122 -3
- package/dist/overview-tools.d.ts +221 -0
- package/dist/overview-tools.d.ts.map +1 -0
- package/dist/playground.d.ts +1 -1
- package/dist/playground.d.ts.map +1 -1
- package/dist/playground.js +99 -88
- package/dist/playground.js.map +1 -1
- package/dist/recipes.d.ts +81 -0
- package/dist/recipes.d.ts.map +1 -1
- package/dist/routes/api/dev-character-conversation/protocol.d.ts +33 -0
- package/dist/routes/api/dev-character-conversation/protocol.d.ts.map +1 -0
- package/dist/routes/api/dev-character-persistence/config.d.ts +24 -0
- package/dist/routes/api/dev-character-persistence/config.d.ts.map +1 -0
- package/dist/scripts/provision-dev-character-persistence.d.ts +3 -0
- package/dist/scripts/provision-dev-character-persistence.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +144 -11
- package/dist/svelte/components/assistant/AssistantDock.svelte +58 -2
- package/dist/svelte/components/assistant/AssistantDock.svelte.d.ts +9 -0
- package/dist/svelte/components/assistant/AssistantDock.svelte.d.ts.map +1 -1
- package/dist/svelte/components/assistant/FloatingAssistant.svelte +309 -0
- package/dist/svelte/components/assistant/FloatingAssistant.svelte.d.ts +27 -0
- package/dist/svelte/components/assistant/FloatingAssistant.svelte.d.ts.map +1 -0
- package/dist/svelte/components/assistant/captions/CaptionOverlay.svelte +105 -0
- package/dist/svelte/components/assistant/captions/CaptionOverlay.svelte.d.ts +11 -0
- package/dist/svelte/components/assistant/captions/CaptionOverlay.svelte.d.ts.map +1 -0
- package/dist/svelte/components/assistant/captions/HeardCaptions.svelte +65 -0
- package/dist/svelte/components/assistant/captions/HeardCaptions.svelte.d.ts +19 -0
- package/dist/svelte/components/assistant/captions/HeardCaptions.svelte.d.ts.map +1 -0
- package/dist/svelte/components/assistant/captions/SpokenCaptions.svelte +65 -0
- package/dist/svelte/components/assistant/captions/SpokenCaptions.svelte.d.ts +21 -0
- package/dist/svelte/components/assistant/captions/SpokenCaptions.svelte.d.ts.map +1 -0
- package/dist/svelte/components/assistant/captions/caption-overlay-context.d.ts +3 -0
- package/dist/svelte/components/assistant/captions/caption-overlay-context.d.ts.map +1 -0
- package/dist/svelte/components/assistant/captions/caption-overlay-context.js +2 -0
- package/dist/svelte/components/assistant/captions/caption-state.svelte.d.ts +71 -0
- package/dist/svelte/components/assistant/captions/caption-state.svelte.d.ts.map +1 -0
- package/dist/svelte/components/assistant/captions/caption-state.svelte.js +225 -0
- package/dist/svelte/components/assistant/create-assistant-dock-controller.svelte.d.ts.map +1 -1
- package/dist/svelte/components/assistant/create-assistant-dock-controller.svelte.js +3 -1
- package/dist/svelte/components/helper/HelperControlPanel.svelte +401 -0
- package/dist/svelte/components/helper/HelperControlPanel.svelte.d.ts +23 -0
- package/dist/svelte/components/helper/HelperControlPanel.svelte.d.ts.map +1 -0
- package/dist/svelte/components/helper/registry.d.ts +53 -0
- package/dist/svelte/components/helper/registry.d.ts.map +1 -0
- package/dist/svelte/components/helper/registry.js +100 -0
- package/dist/svelte/i18n.d.ts +14 -0
- package/dist/svelte/i18n.d.ts.map +1 -1
- package/dist/svelte/i18n.js +17 -0
- package/dist/svelte/i18n.messages.d.ts +32 -0
- package/dist/svelte/i18n.messages.d.ts.map +1 -1
- package/dist/svelte/i18n.messages.js +33 -0
- package/dist/svelte/index.d.ts +7 -0
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +15 -5
- package/dist/svelte/playground.d.ts +94 -0
- package/dist/svelte/playground.d.ts.map +1 -1
- package/dist/svelte/playground.js +16 -5
- package/dist/sveltekit.js +2 -2
- package/package.json +27 -17
- package/dist/chunks/chat-stream-BBk_5_Ph.js +0 -2027
- package/dist/chunks/chat-stream-BBk_5_Ph.js.map +0 -1
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assistant tools for customizable overview pages (#3727 phase 4): the
|
|
3
|
+
* assistant adds and configures widgets ("add a chart of overdue invoices")
|
|
4
|
+
* with structured operations, and the person can undo the change.
|
|
5
|
+
*
|
|
6
|
+
* The model only ever supplies data: a page id and a list of operations
|
|
7
|
+
* (`add`, `configure`, `move`, `resize`, `remove`) over the page's closed
|
|
8
|
+
* option vocabulary. It never names a query, a table or a tenant. Every
|
|
9
|
+
* authority decision is the host's, made from the live {@link PrincipalRun}:
|
|
10
|
+
*
|
|
11
|
+
* - `open(run, pageId)` returns the overview for THIS principal (its
|
|
12
|
+
* definition, the principal's stored override, whether the principal may
|
|
13
|
+
* customize, and how to persist), or `null` when the page is not offered.
|
|
14
|
+
* - The surface validates every batch with the overview model and
|
|
15
|
+
* `checkOverviewOverride` (smrt-svelte's `createOverviewAssistantSurface`
|
|
16
|
+
* is the implementation), so the assistant can only store an override the
|
|
17
|
+
* page's own save endpoint would accept. A batch is atomic.
|
|
18
|
+
* - Undo is single-step and keyed by tenant, user and page: an undo token is
|
|
19
|
+
* only ever looked up under the principal that is calling, so one
|
|
20
|
+
* principal can never restore another's state.
|
|
21
|
+
*
|
|
22
|
+
* This package depends on no UI package, so the surface is typed
|
|
23
|
+
* structurally.
|
|
24
|
+
*
|
|
25
|
+
* @module
|
|
26
|
+
*/
|
|
27
|
+
import { type PrincipalRun, type PrincipalTool } from '@happyvertical/smrt-agents';
|
|
28
|
+
/** Tool slug (permission/allow-list name) for describing an overview. */
|
|
29
|
+
export declare const OVERVIEW_DESCRIBE_TOOL_SLUG = "overviews.describe";
|
|
30
|
+
/** Tool slug for applying a batch of operations. */
|
|
31
|
+
export declare const OVERVIEW_APPLY_TOOL_SLUG = "overviews.apply";
|
|
32
|
+
/** Tool slug for undoing the last applied batch. */
|
|
33
|
+
export declare const OVERVIEW_UNDO_TOOL_SLUG = "overviews.undo";
|
|
34
|
+
/** Provider function name for {@link OVERVIEW_DESCRIBE_TOOL_SLUG}. */
|
|
35
|
+
export declare const OVERVIEW_DESCRIBE_FUNCTION_NAME = "overviews-describe";
|
|
36
|
+
/** Provider function name for {@link OVERVIEW_APPLY_TOOL_SLUG}. */
|
|
37
|
+
export declare const OVERVIEW_APPLY_FUNCTION_NAME = "overviews-apply";
|
|
38
|
+
/** Provider function name for {@link OVERVIEW_UNDO_TOOL_SLUG}. */
|
|
39
|
+
export declare const OVERVIEW_UNDO_FUNCTION_NAME = "overviews-undo";
|
|
40
|
+
/** Default cap on operations in one batch (matches smrt-svelte's). */
|
|
41
|
+
export declare const OVERVIEW_TOOL_MAX_OPERATIONS = 20;
|
|
42
|
+
/** A plan result, as the surface returns it. */
|
|
43
|
+
export type OverviewToolPlan = {
|
|
44
|
+
ok: true;
|
|
45
|
+
override: unknown;
|
|
46
|
+
document: unknown;
|
|
47
|
+
results: readonly unknown[];
|
|
48
|
+
unchanged?: boolean;
|
|
49
|
+
} | {
|
|
50
|
+
ok: false;
|
|
51
|
+
issues: readonly unknown[];
|
|
52
|
+
};
|
|
53
|
+
/** A save-style check of an override, as the surface returns it. */
|
|
54
|
+
export type OverviewToolCheck = {
|
|
55
|
+
ok: true;
|
|
56
|
+
override: unknown;
|
|
57
|
+
} | {
|
|
58
|
+
ok: false;
|
|
59
|
+
issues: readonly unknown[];
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* One overview for one principal. smrt-svelte's
|
|
63
|
+
* `createOverviewAssistantSurface` (on `./overview/server`) implements it.
|
|
64
|
+
*/
|
|
65
|
+
export interface OverviewToolSurface {
|
|
66
|
+
readonly pageId: string;
|
|
67
|
+
/** Whether this principal may customize the page (the role gate). */
|
|
68
|
+
readonly canCustomize: boolean;
|
|
69
|
+
/** Allowed widget types with their option fields, and the arrangement. */
|
|
70
|
+
describe(): unknown;
|
|
71
|
+
/** The canonical override in effect (`null` = defaults). */
|
|
72
|
+
current(): unknown;
|
|
73
|
+
/** Validate and plan a batch against {@link current}. Applies nothing. */
|
|
74
|
+
plan(operations: unknown): OverviewToolPlan;
|
|
75
|
+
/** Validate an override the way a save is validated. */
|
|
76
|
+
check(override: unknown): OverviewToolCheck;
|
|
77
|
+
/**
|
|
78
|
+
* Persist a canonical override in the principal's tier, CONDITIONALLY: only
|
|
79
|
+
* if the stored value is still the one this surface loaded (its revision).
|
|
80
|
+
* A save that landed since the surface was opened must answer
|
|
81
|
+
* `{ ok: false, reason: 'conflict' }`, never be overwritten. On success the
|
|
82
|
+
* surface's `current()` and revision follow the written value.
|
|
83
|
+
*/
|
|
84
|
+
persist(override: unknown): Promise<OverviewToolPersistResult>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Outcome of {@link OverviewToolSurface.persist}. Structurally the phase-3
|
|
88
|
+
* store's save result (`OverviewSaveResult` of `@happyvertical/smrt-preferences`'
|
|
89
|
+
* `createOverviewStore`).
|
|
90
|
+
*/
|
|
91
|
+
export type OverviewToolPersistResult = {
|
|
92
|
+
ok: true;
|
|
93
|
+
} | {
|
|
94
|
+
ok: false;
|
|
95
|
+
reason: 'conflict' | 'not_allowed' | 'invalid';
|
|
96
|
+
issues?: readonly unknown[];
|
|
97
|
+
};
|
|
98
|
+
/** The application side: which overviews a principal may reach. */
|
|
99
|
+
export interface OverviewToolsHost {
|
|
100
|
+
/**
|
|
101
|
+
* The page for this principal, or `null` when it is unknown or not offered
|
|
102
|
+
* to them. Build the surface from the principal's own stored override and
|
|
103
|
+
* role; never from model input other than the page id. Scope every read
|
|
104
|
+
* and the surface's `persist` by `run.context.tenantId` (with tenancy on,
|
|
105
|
+
* the tools call `open` and every surface method inside that tenant's
|
|
106
|
+
* context and refuse a run without one).
|
|
107
|
+
*/
|
|
108
|
+
open(run: PrincipalRun, pageId: string): OverviewToolSurface | null | Promise<OverviewToolSurface | null>;
|
|
109
|
+
/** Overview pages offered to this principal (for `describe` without a page). */
|
|
110
|
+
pages?(run: PrincipalRun): ReadonlyArray<{
|
|
111
|
+
id: string;
|
|
112
|
+
title?: string;
|
|
113
|
+
}> | Promise<ReadonlyArray<{
|
|
114
|
+
id: string;
|
|
115
|
+
title?: string;
|
|
116
|
+
}>>;
|
|
117
|
+
}
|
|
118
|
+
/** What Undo restores: the override before the last applied batch. */
|
|
119
|
+
export interface OverviewUndoEntry {
|
|
120
|
+
token: string;
|
|
121
|
+
before: unknown;
|
|
122
|
+
after: unknown;
|
|
123
|
+
/**
|
|
124
|
+
* When the batch's conditional write succeeded (epoch ms, strictly
|
|
125
|
+
* increasing within a process). Orders entries for
|
|
126
|
+
* {@link OverviewUndoStore.set} and drives expiry.
|
|
127
|
+
*/
|
|
128
|
+
createdAt: number;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Where undo entries live, keyed by an opaque principal-and-page key the
|
|
132
|
+
* tools compute. The default is in-process memory; a multi-replica host
|
|
133
|
+
* passes a shared store (for example the assistant session context).
|
|
134
|
+
*/
|
|
135
|
+
export interface OverviewUndoStore {
|
|
136
|
+
get(key: string): OverviewUndoEntry | undefined | Promise<OverviewUndoEntry | undefined>;
|
|
137
|
+
/**
|
|
138
|
+
* Conditional set: store `entry` under `key` unless the stored entry is
|
|
139
|
+
* NEWER (a larger `createdAt`); then it is a no-op. Overlapping applies for
|
|
140
|
+
* one principal and page can finish their entry writes out of order, and an
|
|
141
|
+
* older apply's late write must not replace the newer batch's entry. A
|
|
142
|
+
* shared store implements this atomically (for example a conditional
|
|
143
|
+
* upsert on `createdAt`).
|
|
144
|
+
*/
|
|
145
|
+
set(key: string, entry: OverviewUndoEntry): void | Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Compare-and-delete: remove the entry under `key` ONLY if its `token` is
|
|
148
|
+
* `token`; a no-op otherwise. An undo that finishes after a newer batch
|
|
149
|
+
* stored its own entry under the same key must not remove that entry. A
|
|
150
|
+
* shared store implements this atomically (for example a conditional
|
|
151
|
+
* delete on the token).
|
|
152
|
+
*/
|
|
153
|
+
delete(key: string, token: string): void | Promise<void>;
|
|
154
|
+
}
|
|
155
|
+
/** Agent-level audit record of an overview change. */
|
|
156
|
+
export interface OverviewToolAuditEntry {
|
|
157
|
+
action: 'apply' | 'undo';
|
|
158
|
+
userId: string;
|
|
159
|
+
tenantId: string | null;
|
|
160
|
+
pageId: string;
|
|
161
|
+
operations?: number;
|
|
162
|
+
}
|
|
163
|
+
export interface OverviewToolsOptions {
|
|
164
|
+
host: OverviewToolsHost;
|
|
165
|
+
/**
|
|
166
|
+
* Where undo entries live. It must outlive a request and a turn. Defaults
|
|
167
|
+
* to {@link defaultOverviewUndoStore} (process-wide memory); pass a shared
|
|
168
|
+
* store when several replicas serve one assistant.
|
|
169
|
+
*/
|
|
170
|
+
undoStore?: OverviewUndoStore;
|
|
171
|
+
audit?: (entry: OverviewToolAuditEntry) => void | Promise<void>;
|
|
172
|
+
/** Batch cap (default 20); keep it equal to the surface's. */
|
|
173
|
+
maxOperations?: number;
|
|
174
|
+
/** Token source (tests). Defaults to `crypto.randomUUID`. */
|
|
175
|
+
createToken?: () => string;
|
|
176
|
+
/**
|
|
177
|
+
* Receives best-effort failures after a change was stored (undo entry,
|
|
178
|
+
* audit). Defaults to `console.warn`; route it to the host's logger.
|
|
179
|
+
*/
|
|
180
|
+
onError?: (error: unknown, context: string) => void;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* A tool refusal the loop classifies by `status`: 422/404/409 are repairable
|
|
184
|
+
* (`invalid_request`, the model sees `publicMessage`), 403 is `not_permitted`.
|
|
185
|
+
*/
|
|
186
|
+
export declare class OverviewToolError extends Error {
|
|
187
|
+
readonly status: number;
|
|
188
|
+
readonly code: string;
|
|
189
|
+
readonly publicMessage: string;
|
|
190
|
+
readonly issues: readonly unknown[];
|
|
191
|
+
constructor(status: number, code: string, message: string, issues?: readonly unknown[]);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* In-process undo store: single entry per key, expiring after `ttlMs`
|
|
195
|
+
* (default 30 minutes), at most `maxEntries` keys (oldest dropped).
|
|
196
|
+
*/
|
|
197
|
+
export declare function createMemoryOverviewUndoStore(options?: {
|
|
198
|
+
ttlMs?: number;
|
|
199
|
+
maxEntries?: number;
|
|
200
|
+
now?: () => number;
|
|
201
|
+
}): OverviewUndoStore;
|
|
202
|
+
/**
|
|
203
|
+
* The process-wide in-memory undo store `createOverviewTools` uses when no
|
|
204
|
+
* `undoStore` is passed. It outlives every tool set, so tools built per turn
|
|
205
|
+
* (`extraTools: (context) => createOverviewTools(...)`) can undo a batch an
|
|
206
|
+
* earlier turn applied. Keys carry tenant, user and page, so sharing it is
|
|
207
|
+
* safe; it is per process, so a multi-replica host passes a shared store.
|
|
208
|
+
*/
|
|
209
|
+
export declare function defaultOverviewUndoStore(): OverviewUndoStore;
|
|
210
|
+
/** "#2 add: widget type "map" is not registered; ..." for the model. */
|
|
211
|
+
export declare function formatOverviewIssues(issues: readonly unknown[]): string;
|
|
212
|
+
/**
|
|
213
|
+
* Build the overview assistant tools. Offer them through `extraTools`; each
|
|
214
|
+
* is gated by the same fail-closed `allowedTools` offer and execution gates
|
|
215
|
+
* as every other principal tool.
|
|
216
|
+
*
|
|
217
|
+
* @param options - The host adapter, undo store, audit sink and batch cap.
|
|
218
|
+
* @returns The `describe`, `apply` and `undo` principal tools.
|
|
219
|
+
*/
|
|
220
|
+
export declare function createOverviewTools(options: OverviewToolsOptions): PrincipalTool[];
|
|
221
|
+
//# sourceMappingURL=overview-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overview-tools.d.ts","sourceRoot":"","sources":["../src/overview-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,aAAa,EAEnB,MAAM,4BAA4B,CAAC;AASpC,yEAAyE;AACzE,eAAO,MAAM,2BAA2B,uBAAuB,CAAC;AAChE,oDAAoD;AACpD,eAAO,MAAM,wBAAwB,oBAAoB,CAAC;AAC1D,oDAAoD;AACpD,eAAO,MAAM,uBAAuB,mBAAmB,CAAC;AAExD,sEAAsE;AACtE,eAAO,MAAM,+BAA+B,uBAAuB,CAAC;AACpE,mEAAmE;AACnE,eAAO,MAAM,4BAA4B,oBAAoB,CAAC;AAC9D,kEAAkE;AAClE,eAAO,MAAM,2BAA2B,mBAAmB,CAAC;AAE5D,sEAAsE;AACtE,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAI/C,gDAAgD;AAChD,MAAM,MAAM,gBAAgB,GACxB;IACE,EAAE,EAAE,IAAI,CAAC;IACT,QAAQ,EAAE,OA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 +1,2 @@
|
|
|
1
|
-
export { default } from './svelte/playground.js';
|
|
1
|
+
export { chatRoomsFixture, default } from './svelte/playground.js';
|
|
2
2
|
//# sourceMappingURL=playground.d.ts.map
|
package/dist/playground.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/playground.js
CHANGED
|
@@ -1,91 +1,93 @@
|
|
|
1
1
|
import { CHAT_MODULE_META } from "./ui.js";
|
|
2
2
|
//#region src/svelte/playground.ts
|
|
3
3
|
var noop = () => {};
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
4
|
+
var chatRoomsFixture = {
|
|
5
|
+
rooms: [
|
|
6
|
+
{
|
|
7
|
+
id: "room-editorial",
|
|
8
|
+
name: "Editorial Ops",
|
|
9
|
+
description: "Daily coordination room",
|
|
10
|
+
roomType: "public",
|
|
11
|
+
topic: "Launch readiness and governance",
|
|
12
|
+
participantCount: 8,
|
|
13
|
+
unreadCount: 4,
|
|
14
|
+
lastMessageAt: "2026-03-21T16:08:00.000Z",
|
|
15
|
+
lastMessage: {
|
|
16
|
+
id: "room-editorial-last",
|
|
17
|
+
roomId: "room-editorial",
|
|
18
|
+
senderProfileId: "profile-taylor",
|
|
19
|
+
senderName: "Taylor Rowan",
|
|
20
|
+
content: "Content QA is clear for tonight’s publication window.",
|
|
21
|
+
messageType: "text",
|
|
22
|
+
role: "user",
|
|
23
|
+
isEdited: false,
|
|
24
|
+
isDeleted: false,
|
|
25
|
+
reactions: [],
|
|
26
|
+
attachments: [],
|
|
27
|
+
createdAt: "2026-03-21T16:08:00.000Z"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "room-governance",
|
|
32
|
+
name: "Governance",
|
|
33
|
+
description: "Policy review",
|
|
34
|
+
roomType: "agent",
|
|
35
|
+
topic: "Publication profile monitoring",
|
|
36
|
+
participantCount: 3,
|
|
37
|
+
unreadCount: 1,
|
|
38
|
+
isPinned: true,
|
|
39
|
+
lastMessageAt: "2026-03-21T15:55:00.000Z"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "room-jordan",
|
|
43
|
+
name: "Jordan Lee",
|
|
44
|
+
description: "Direct message",
|
|
45
|
+
roomType: "dm",
|
|
46
|
+
topic: "",
|
|
47
|
+
participantCount: 2,
|
|
48
|
+
unreadCount: 0,
|
|
49
|
+
lastMessageAt: "2026-03-21T14:12:00.000Z"
|
|
27
50
|
}
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
id: "room-governance",
|
|
31
|
-
name: "Governance",
|
|
32
|
-
description: "Policy review",
|
|
33
|
-
roomType: "agent",
|
|
34
|
-
topic: "Publication profile monitoring",
|
|
35
|
-
participantCount: 3,
|
|
36
|
-
unreadCount: 1,
|
|
37
|
-
isPinned: true,
|
|
38
|
-
lastMessageAt: "2026-03-21T15:55:00.000Z"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: "room-jordan",
|
|
42
|
-
name: "Jordan Lee",
|
|
43
|
-
description: "Direct message",
|
|
44
|
-
roomType: "dm",
|
|
45
|
-
topic: "",
|
|
46
|
-
participantCount: 2,
|
|
47
|
-
unreadCount: 0,
|
|
48
|
-
lastMessageAt: "2026-03-21T14:12:00.000Z"
|
|
49
|
-
}
|
|
50
|
-
];
|
|
51
|
-
var sampleMessages = [{
|
|
52
|
-
id: "chat-message-1",
|
|
53
|
-
roomId: "room-editorial",
|
|
54
|
-
senderProfileId: "profile-taylor",
|
|
55
|
-
senderName: "Taylor Rowan",
|
|
56
|
-
content: "The editorial checklist is ready for review.",
|
|
57
|
-
messageType: "text",
|
|
58
|
-
role: "user",
|
|
59
|
-
isEdited: false,
|
|
60
|
-
isDeleted: false,
|
|
61
|
-
replyTo: null,
|
|
62
|
-
reactions: [{
|
|
63
|
-
emoji: "✅",
|
|
64
|
-
count: 2,
|
|
65
|
-
reacted: true,
|
|
66
|
-
profileIds: ["profile-taylor", "profile-jordan"]
|
|
67
|
-
}],
|
|
68
|
-
attachments: [],
|
|
69
|
-
createdAt: "2026-03-21T15:52:00.000Z"
|
|
70
|
-
}, {
|
|
71
|
-
id: "chat-message-2",
|
|
72
|
-
roomId: "room-editorial",
|
|
73
|
-
senderProfileId: "profile-jordan",
|
|
74
|
-
senderName: "Jordan Lee",
|
|
75
|
-
content: "I’ll verify the governance states and flag anything that needs attention.",
|
|
76
|
-
messageType: "text",
|
|
77
|
-
role: "user",
|
|
78
|
-
isEdited: false,
|
|
79
|
-
isDeleted: false,
|
|
80
|
-
replyTo: {
|
|
51
|
+
],
|
|
52
|
+
messages: [{
|
|
81
53
|
id: "chat-message-1",
|
|
54
|
+
roomId: "room-editorial",
|
|
55
|
+
senderProfileId: "profile-taylor",
|
|
82
56
|
senderName: "Taylor Rowan",
|
|
83
|
-
content: "The editorial checklist is ready for review."
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
57
|
+
content: "The editorial checklist is ready for review.",
|
|
58
|
+
messageType: "text",
|
|
59
|
+
role: "user",
|
|
60
|
+
isEdited: false,
|
|
61
|
+
isDeleted: false,
|
|
62
|
+
replyTo: null,
|
|
63
|
+
reactions: [{
|
|
64
|
+
emoji: "✅",
|
|
65
|
+
count: 2,
|
|
66
|
+
reacted: true,
|
|
67
|
+
profileIds: ["profile-taylor", "profile-jordan"]
|
|
68
|
+
}],
|
|
69
|
+
attachments: [],
|
|
70
|
+
createdAt: "2026-03-21T15:52:00.000Z"
|
|
71
|
+
}, {
|
|
72
|
+
id: "chat-message-2",
|
|
73
|
+
roomId: "room-editorial",
|
|
74
|
+
senderProfileId: "profile-jordan",
|
|
75
|
+
senderName: "Jordan Lee",
|
|
76
|
+
content: "I’ll verify the governance states and flag anything that needs attention.",
|
|
77
|
+
messageType: "text",
|
|
78
|
+
role: "user",
|
|
79
|
+
isEdited: false,
|
|
80
|
+
isDeleted: false,
|
|
81
|
+
replyTo: {
|
|
82
|
+
id: "chat-message-1",
|
|
83
|
+
senderName: "Taylor Rowan",
|
|
84
|
+
content: "The editorial checklist is ready for review."
|
|
85
|
+
},
|
|
86
|
+
reactions: [],
|
|
87
|
+
attachments: [],
|
|
88
|
+
createdAt: "2026-03-21T15:58:00.000Z"
|
|
89
|
+
}]
|
|
90
|
+
};
|
|
89
91
|
var loadMessageInput = () => import("./svelte/components/messages/MessageInput.svelte");
|
|
90
92
|
var loadMessageList = () => import("./svelte/components/messages/MessageList.svelte");
|
|
91
93
|
var loadRoomList = () => import("./svelte/components/layout/RoomList.svelte");
|
|
@@ -102,12 +104,15 @@ var playground_default = {
|
|
|
102
104
|
loadComponent: loadRoomList,
|
|
103
105
|
order: 1,
|
|
104
106
|
props: {
|
|
105
|
-
rooms:
|
|
107
|
+
rooms: chatRoomsFixture.rooms,
|
|
106
108
|
currentRoomId: "room-editorial",
|
|
107
109
|
onselectroom: noop,
|
|
108
110
|
oncreateroom: noop
|
|
109
111
|
},
|
|
110
|
-
modes: { mock: {
|
|
112
|
+
modes: { mock: {
|
|
113
|
+
label: "Static mock fixture",
|
|
114
|
+
description: "Static room data only; no live chat service is connected."
|
|
115
|
+
} }
|
|
111
116
|
},
|
|
112
117
|
{
|
|
113
118
|
id: "message-list",
|
|
@@ -116,12 +121,15 @@ var playground_default = {
|
|
|
116
121
|
loadComponent: loadMessageList,
|
|
117
122
|
order: 2,
|
|
118
123
|
props: {
|
|
119
|
-
messages:
|
|
124
|
+
messages: chatRoomsFixture.messages,
|
|
120
125
|
currentProfileId: "profile-taylor",
|
|
121
126
|
onreply: noop,
|
|
122
127
|
onreact: noop
|
|
123
128
|
},
|
|
124
|
-
modes: { mock: {
|
|
129
|
+
modes: { mock: {
|
|
130
|
+
label: "Static mock fixture",
|
|
131
|
+
description: "Static transcript data only; no live chat service is connected."
|
|
132
|
+
} }
|
|
125
133
|
},
|
|
126
134
|
{
|
|
127
135
|
id: "message-input",
|
|
@@ -139,11 +147,14 @@ var playground_default = {
|
|
|
139
147
|
},
|
|
140
148
|
oncancelreply: noop
|
|
141
149
|
},
|
|
142
|
-
modes: { mock: {
|
|
150
|
+
modes: { mock: {
|
|
151
|
+
label: "Static mock fixture",
|
|
152
|
+
description: "Static composer state only; no live chat service is connected."
|
|
153
|
+
} }
|
|
143
154
|
}
|
|
144
155
|
]
|
|
145
156
|
};
|
|
146
157
|
//#endregion
|
|
147
|
-
export { playground_default as default };
|
|
158
|
+
export { chatRoomsFixture, playground_default as default };
|
|
148
159
|
|
|
149
160
|
//# sourceMappingURL=playground.js.map
|
package/dist/playground.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.js","names":[],"sources":["../src/svelte/playground.ts"],"sourcesContent":["import { CHAT_MODULE_META } from '../ui.js';\n\nconst noop = () => {};\n\nconst sampleRooms = [\n {\n id: 'room-editorial',\n name: 'Editorial Ops',\n description: 'Daily coordination room',\n roomType: 'public',\n topic: 'Launch readiness and governance',\n participantCount: 8,\n unreadCount: 4,\n lastMessageAt: '2026-03-21T16:08:00.000Z',\n lastMessage: {\n id: 'room-editorial-last',\n roomId: 'room-editorial',\n senderProfileId: 'profile-taylor',\n senderName: 'Taylor Rowan',\n content: 'Content QA is clear for tonight’s publication window.',\n messageType: 'text',\n role: 'user',\n isEdited: false,\n isDeleted: false,\n reactions: [],\n attachments: [],\n createdAt: '2026-03-21T16:08:00.000Z',\n },\n },\n {\n id: 'room-governance',\n name: 'Governance',\n description: 'Policy review',\n roomType: 'agent',\n topic: 'Publication profile monitoring',\n participantCount: 3,\n unreadCount: 1,\n isPinned: true,\n lastMessageAt: '2026-03-21T15:55:00.000Z',\n },\n {\n id: 'room-jordan',\n name: 'Jordan Lee',\n description: 'Direct message',\n roomType: 'dm',\n topic: '',\n participantCount: 2,\n unreadCount: 0,\n lastMessageAt: '2026-03-21T14:12:00.000Z',\n },\n];\n\nconst sampleMessages = [\n {\n id: 'chat-message-1',\n roomId: 'room-editorial',\n senderProfileId: 'profile-taylor',\n senderName: 'Taylor Rowan',\n content: 'The editorial checklist is ready for review.',\n messageType: 'text',\n role: 'user',\n isEdited: false,\n isDeleted: false,\n replyTo: null,\n reactions: [\n {\n emoji: '✅',\n count: 2,\n reacted: true,\n profileIds: ['profile-taylor', 'profile-jordan'],\n },\n ],\n attachments: [],\n createdAt: '2026-03-21T15:52:00.000Z',\n },\n {\n id: 'chat-message-2',\n roomId: 'room-editorial',\n senderProfileId: 'profile-jordan',\n senderName: 'Jordan Lee',\n content:\n 'I’ll verify the governance states and flag anything that needs attention.',\n messageType: 'text',\n role: 'user',\n isEdited: false,\n isDeleted: false,\n replyTo: {\n id: 'chat-message-1',\n senderName: 'Taylor Rowan',\n content: 'The editorial checklist is ready for review.',\n },\n reactions: [],\n attachments: [],\n createdAt: '2026-03-21T15:58:00.000Z',\n },\n];\n\nconst loadMessageInput = () =>\n import('./components/messages/MessageInput.svelte');\nconst loadMessageList = () =>\n import('./components/messages/MessageList.svelte');\nconst loadRoomList = () => import('./components/layout/RoomList.svelte');\n\nexport default {\n packageName: '@happyvertical/smrt-chat',\n displayName: CHAT_MODULE_META.displayName,\n description: CHAT_MODULE_META.description,\n moduleMeta: CHAT_MODULE_META,\n entries: [\n {\n id: 'room-list',\n title: 'Room List',\n description:\n 'Sidebar navigation for rooms, DMs, and agent conversations with unread state.',\n loadComponent: loadRoomList,\n order: 1,\n props: {\n rooms:
|
|
1
|
+
{"version":3,"file":"playground.js","names":[],"sources":["../src/svelte/playground.ts"],"sourcesContent":["import { CHAT_MODULE_META } from '../ui.js';\n\nconst noop = () => {};\n\nconst sampleRooms = [\n {\n id: 'room-editorial',\n name: 'Editorial Ops',\n description: 'Daily coordination room',\n roomType: 'public',\n topic: 'Launch readiness and governance',\n participantCount: 8,\n unreadCount: 4,\n lastMessageAt: '2026-03-21T16:08:00.000Z',\n lastMessage: {\n id: 'room-editorial-last',\n roomId: 'room-editorial',\n senderProfileId: 'profile-taylor',\n senderName: 'Taylor Rowan',\n content: 'Content QA is clear for tonight’s publication window.',\n messageType: 'text',\n role: 'user',\n isEdited: false,\n isDeleted: false,\n reactions: [],\n attachments: [],\n createdAt: '2026-03-21T16:08:00.000Z',\n },\n },\n {\n id: 'room-governance',\n name: 'Governance',\n description: 'Policy review',\n roomType: 'agent',\n topic: 'Publication profile monitoring',\n participantCount: 3,\n unreadCount: 1,\n isPinned: true,\n lastMessageAt: '2026-03-21T15:55:00.000Z',\n },\n {\n id: 'room-jordan',\n name: 'Jordan Lee',\n description: 'Direct message',\n roomType: 'dm',\n topic: '',\n participantCount: 2,\n unreadCount: 0,\n lastMessageAt: '2026-03-21T14:12:00.000Z',\n },\n];\n\nconst sampleMessages = [\n {\n id: 'chat-message-1',\n roomId: 'room-editorial',\n senderProfileId: 'profile-taylor',\n senderName: 'Taylor Rowan',\n content: 'The editorial checklist is ready for review.',\n messageType: 'text',\n role: 'user',\n isEdited: false,\n isDeleted: false,\n replyTo: null,\n reactions: [\n {\n emoji: '✅',\n count: 2,\n reacted: true,\n profileIds: ['profile-taylor', 'profile-jordan'],\n },\n ],\n attachments: [],\n createdAt: '2026-03-21T15:52:00.000Z',\n },\n {\n id: 'chat-message-2',\n roomId: 'room-editorial',\n senderProfileId: 'profile-jordan',\n senderName: 'Jordan Lee',\n content:\n 'I’ll verify the governance states and flag anything that needs attention.',\n messageType: 'text',\n role: 'user',\n isEdited: false,\n isDeleted: false,\n replyTo: {\n id: 'chat-message-1',\n senderName: 'Taylor Rowan',\n content: 'The editorial checklist is ready for review.',\n },\n reactions: [],\n attachments: [],\n createdAt: '2026-03-21T15:58:00.000Z',\n },\n];\n\n/**\n * Browser-safe static fixture for hosts demonstrating the chat.rooms recipe.\n * It is intentionally mock data and does not connect to ChatService.\n */\nexport const chatRoomsFixture = {\n rooms: sampleRooms,\n messages: sampleMessages,\n};\n\nconst loadMessageInput = () =>\n import('./components/messages/MessageInput.svelte');\nconst loadMessageList = () =>\n import('./components/messages/MessageList.svelte');\nconst loadRoomList = () => import('./components/layout/RoomList.svelte');\n\nexport default {\n packageName: '@happyvertical/smrt-chat',\n displayName: CHAT_MODULE_META.displayName,\n description: CHAT_MODULE_META.description,\n moduleMeta: CHAT_MODULE_META,\n entries: [\n {\n id: 'room-list',\n title: 'Room List',\n description:\n 'Sidebar navigation for rooms, DMs, and agent conversations with unread state.',\n loadComponent: loadRoomList,\n order: 1,\n props: {\n rooms: chatRoomsFixture.rooms,\n currentRoomId: 'room-editorial',\n onselectroom: noop,\n oncreateroom: noop,\n },\n modes: {\n mock: {\n label: 'Static mock fixture',\n description:\n 'Static room data only; no live chat service is connected.',\n },\n },\n },\n {\n id: 'message-list',\n title: 'Message List',\n description:\n 'Grouped chat transcript with replies and reactions for a conversation thread.',\n loadComponent: loadMessageList,\n order: 2,\n props: {\n messages: chatRoomsFixture.messages,\n currentProfileId: 'profile-taylor',\n onreply: noop,\n onreact: noop,\n },\n modes: {\n mock: {\n label: 'Static mock fixture',\n description:\n 'Static transcript data only; no live chat service is connected.',\n },\n },\n },\n {\n id: 'message-input',\n title: 'Message Input',\n description:\n 'Chat composer with reply context and keyboard send affordance.',\n loadComponent: loadMessageInput,\n order: 3,\n props: {\n onsend: noop,\n placeholder: 'Reply to Editorial Ops…',\n replyTo: {\n id: 'chat-message-1',\n senderName: 'Taylor Rowan',\n content: 'The editorial checklist is ready for review.',\n },\n oncancelreply: noop,\n },\n modes: {\n mock: {\n label: 'Static mock fixture',\n description:\n 'Static composer state only; no live chat service is connected.',\n },\n },\n },\n ],\n};\n"],"mappings":";;AAEA,IAAM,aAAa,CAAC;AAmGb,IAAM,mBAAmB;CAC9B,OAAO;EAjGP;GACE,IAAI;GACJ,MAAM;GACN,aAAa;GACb,UAAU;GACV,OAAO;GACP,kBAAkB;GAClB,aAAa;GACb,eAAe;GACf,aAAa;IACX,IAAI;IACJ,QAAQ;IACR,iBAAiB;IACjB,YAAY;IACZ,SAAS;IACT,aAAa;IACb,MAAM;IACN,UAAU;IACV,WAAW;IACX,WAAW,CAAC;IACZ,aAAa,CAAC;IACd,WAAW;GACb;EACF;EACA;GACE,IAAI;GACJ,MAAM;GACN,aAAa;GACb,UAAU;GACV,OAAO;GACP,kBAAkB;GAClB,aAAa;GACb,UAAU;GACV,eAAe;EACjB;EACA;GACE,IAAI;GACJ,MAAM;GACN,aAAa;GACb,UAAU;GACV,OAAO;GACP,kBAAkB;GAClB,aAAa;GACb,eAAe;EACjB;CAqDO;CACP,UAAU,CAlDV;EACE,IAAI;EACJ,QAAQ;EACR,iBAAiB;EACjB,YAAY;EACZ,SAAS;EACT,aAAa;EACb,MAAM;EACN,UAAU;EACV,WAAW;EACX,SAAS;EACT,WAAW,CACT;GACE,OAAO;GACP,OAAO;GACP,SAAS;GACT,YAAY,CAAC,kBAAkB,gBAAgB;EACjD,CACF;EACA,aAAa,CAAC;EACd,WAAW;CACb,GACA;EACE,IAAI;EACJ,QAAQ;EACR,iBAAiB;EACjB,YAAY;EACZ,SACE;EACF,aAAa;EACb,MAAM;EACN,UAAU;EACV,WAAW;EACX,SAAS;GACP,IAAI;GACJ,YAAY;GACZ,SAAS;EACX;EACA,WAAW,CAAC;EACZ,aAAa,CAAC;EACd,WAAW;CACb,CASU;AACZ;AAEA,IAAM,yBACJ,OAAO;AACT,IAAM,wBACJ,OAAO;AACT,IAAM,qBAAqB,OAAO;AAElC,IAAA,qBAAe;CACb,aAAa;CACb,aAAa,iBAAiB;CAC9B,aAAa,iBAAiB;CAC9B,YAAY;CACZ,SAAS;EACP;GACE,IAAI;GACJ,OAAO;GACP,aACE;GACF,eAAe;GACf,OAAO;GACP,OAAO;IACL,OAAO,iBAAiB;IACxB,eAAe;IACf,cAAc;IACd,cAAc;GAChB;GACA,OAAO,EACL,MAAM;IACJ,OAAO;IACP,aACE;GACJ,EACF;EACF;EACA;GACE,IAAI;GACJ,OAAO;GACP,aACE;GACF,eAAe;GACf,OAAO;GACP,OAAO;IACL,UAAU,iBAAiB;IAC3B,kBAAkB;IAClB,SAAS;IACT,SAAS;GACX;GACA,OAAO,EACL,MAAM;IACJ,OAAO;IACP,aACE;GACJ,EACF;EACF;EACA;GACE,IAAI;GACJ,OAAO;GACP,aACE;GACF,eAAe;GACf,OAAO;GACP,OAAO;IACL,QAAQ;IACR,aAAa;IACb,SAAS;KACP,IAAI;KACJ,YAAY;KACZ,SAAS;IACX;IACA,eAAe;GACjB;GACA,OAAO,EACL,MAAM;IACJ,OAAO;IACP,aACE;GACJ,EACF;EACF;CACF;AACF"}
|
package/dist/recipes.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { SmrtRecipe } from '@happyvertical/smrt-core';
|
|
|
10
10
|
import { AgentSession } from './models/AgentSession.js';
|
|
11
11
|
import { ChatMessage } from './models/ChatMessage.js';
|
|
12
12
|
import { ChatParticipant } from './models/ChatParticipant.js';
|
|
13
|
+
import { ChatReaction } from './models/ChatReaction.js';
|
|
13
14
|
import { ChatRoom } from './models/ChatRoom.js';
|
|
14
15
|
import { ChatThread } from './models/ChatThread.js';
|
|
15
16
|
/**
|
|
@@ -45,4 +46,84 @@ export declare class AssistantRecipe extends SmrtRecipe {
|
|
|
45
46
|
readonly browserOptions: readonly ["webllm", "bitgpu"];
|
|
46
47
|
}];
|
|
47
48
|
}
|
|
49
|
+
/** Team rooms and their conversations. */
|
|
50
|
+
export declare class ChatRoomsRecipe extends SmrtRecipe {
|
|
51
|
+
static id: string;
|
|
52
|
+
static help: string;
|
|
53
|
+
static label: string;
|
|
54
|
+
static summary: string;
|
|
55
|
+
static synonyms: string[];
|
|
56
|
+
static models: (typeof ChatMessage | typeof ChatParticipant | typeof ChatReaction | typeof ChatRoom | typeof ChatThread)[];
|
|
57
|
+
static group: {
|
|
58
|
+
id: string;
|
|
59
|
+
label: string;
|
|
60
|
+
summary: string;
|
|
61
|
+
};
|
|
62
|
+
static section: {
|
|
63
|
+
id: string;
|
|
64
|
+
label: string;
|
|
65
|
+
icon: string;
|
|
66
|
+
description: string;
|
|
67
|
+
};
|
|
68
|
+
static nav: {
|
|
69
|
+
label: string;
|
|
70
|
+
model: typeof ChatRoom;
|
|
71
|
+
icon: string;
|
|
72
|
+
description: string;
|
|
73
|
+
noun: string;
|
|
74
|
+
}[];
|
|
75
|
+
static runtime: "both";
|
|
76
|
+
static surfaces: readonly [{
|
|
77
|
+
readonly kind: "route";
|
|
78
|
+
readonly path: "/chat/rooms";
|
|
79
|
+
readonly export: "@happyvertical/smrt-chat/svelte#ChatLayout";
|
|
80
|
+
readonly label: "Team chat";
|
|
81
|
+
}, {
|
|
82
|
+
readonly kind: "playground";
|
|
83
|
+
readonly export: "@happyvertical/smrt-chat/playground#default";
|
|
84
|
+
readonly label: "Static chat fixtures";
|
|
85
|
+
}];
|
|
86
|
+
static demoSeed: {
|
|
87
|
+
readonly export: "@happyvertical/smrt-chat/playground#chatRoomsFixture";
|
|
88
|
+
};
|
|
89
|
+
static options: {
|
|
90
|
+
readonly ChatRoom: {
|
|
91
|
+
readonly fields: {
|
|
92
|
+
readonly metadata: {
|
|
93
|
+
readonly visibility: "hidden";
|
|
94
|
+
};
|
|
95
|
+
readonly createdByProfileId: {
|
|
96
|
+
readonly visibility: "hidden";
|
|
97
|
+
};
|
|
98
|
+
readonly lastMessageAt: {
|
|
99
|
+
readonly label: "Last message";
|
|
100
|
+
readonly order: 1;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
readonly ChatMessage: {
|
|
105
|
+
readonly fields: {
|
|
106
|
+
readonly metadata: {
|
|
107
|
+
readonly visibility: "hidden";
|
|
108
|
+
};
|
|
109
|
+
readonly toolCallData: {
|
|
110
|
+
readonly visibility: "hidden";
|
|
111
|
+
};
|
|
112
|
+
readonly attachments: {
|
|
113
|
+
readonly visibility: "advanced";
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
readonly ChatParticipant: {
|
|
118
|
+
readonly fields: {
|
|
119
|
+
readonly lastReadMessageId: {
|
|
120
|
+
readonly visibility: "hidden";
|
|
121
|
+
};
|
|
122
|
+
readonly lastSeenAt: {
|
|
123
|
+
readonly visibility: "advanced";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
}
|
|
48
129
|
//# sourceMappingURL=recipes.d.ts.map
|
package/dist/recipes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../src/recipes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD;;;;;;;;GAQG;AACH,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,MAAM,CAAC,EAAE,SAAoB;IAC7B,MAAM,CAAC,IAAI,SAA2B;IACtC,MAAM,CAAC,KAAK,SAAe;IAC3B,MAAM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3E,MAAM,CAAC,MAAM,8GAMX;IACF,MAAM,CAAC,KAAK;;;;MAIV;IACF,MAAM,CAAC,OAAO;;;;;MAKZ;IACF,MAAM,CAAC,GAAG;;;;;;QAQR;IACF,MAAM,CAAC,OAAO,EAAG,MAAM,CAAU;IACjC,MAAM,CAAC,QAAQ;;;;;;;;;OAYJ;IACX,MAAM,CAAC,QAAQ;;MAEJ;IACX,MAAM,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqBH;CACZ"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const DEV_CHARACTER_MAX_DRAFT_LENGTH = 200;
|
|
2
|
+
export declare const DEV_CHARACTER_MAX_REQUEST_BYTES: number;
|
|
3
|
+
export declare const DEV_CHARACTER_MAX_MESSAGES = 24;
|
|
4
|
+
/**
|
|
5
|
+
* Browser-safe protocol for the local character conversation workbench.
|
|
6
|
+
*
|
|
7
|
+
* The proposal is deliberately descriptive: a host renders its canonical
|
|
8
|
+
* preview and performs any browser-side effect only after a trusted user
|
|
9
|
+
* confirmation. This module contains no capability to apply a proposal.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEV_CHARACTER_CONVERSATION_SECTIONS: readonly ["character", "conversation", "chat"];
|
|
12
|
+
export type DevCharacterConversationSection = (typeof DEV_CHARACTER_CONVERSATION_SECTIONS)[number];
|
|
13
|
+
export type DevCharacterConversationProposal = {
|
|
14
|
+
kind: 'navigate';
|
|
15
|
+
section: DevCharacterConversationSection;
|
|
16
|
+
preview: {
|
|
17
|
+
title: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'stageDraft';
|
|
22
|
+
value: string;
|
|
23
|
+
preview: {
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export interface DevCharacterConversationResponse {
|
|
29
|
+
content: string;
|
|
30
|
+
model?: string;
|
|
31
|
+
proposal?: DevCharacterConversationProposal;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../src/routes/api/dev-character-conversation/protocol.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,MAAM,CAAC;AAClD,eAAO,MAAM,+BAA+B,QAAY,CAAC;AACzD,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC,gDAItC,CAAC;AAEX,MAAM,MAAM,+BAA+B,GACzC,CAAC,OAAO,mCAAmC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,MAAM,MAAM,gCAAgC,GACxC;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,+BAA+B,CAAC;IACzC,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC;AAEN,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,gCAAgC,CAAC;CAC7C"}
|