@happyvertical/smrt-chat 0.60.18 → 0.61.1
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 +16 -22
- package/README.md +78 -0
- package/agents/owner-approvals.md +161 -0
- package/agents/runtime-exposure.md +28 -0
- package/agents/runtime-report-tools.md +26 -0
- package/agents/token-streaming.md +6 -0
- package/agents/tool-loop.md +13 -0
- package/agents/tool-summaries.md +155 -0
- package/agents/turn-drivers.md +293 -0
- package/dist/assistant-approvals.d.ts +45 -0
- package/dist/assistant-approvals.d.ts.map +1 -0
- package/dist/assistant-approvals.js +83 -0
- package/dist/assistant-approvals.js.map +1 -0
- package/dist/assistant-turn-driver.d.ts +73 -0
- package/dist/assistant-turn-driver.d.ts.map +1 -0
- package/dist/assistant-turn-events.d.ts +28 -1
- package/dist/assistant-turn-events.d.ts.map +1 -1
- package/dist/assistant-turn-events.js +2 -2
- package/dist/assistant-turn.d.ts +24 -37
- package/dist/assistant-turn.d.ts.map +1 -1
- package/dist/chunks/{ChatService-BGBAqmZq.js → ChatService-C1UBz0MR.js} +684 -657
- package/dist/chunks/ChatService-C1UBz0MR.js.map +1 -0
- package/dist/chunks/{assistant-turn-events-BbZUf-Ju.js → assistant-turn-events-DwdCZzQ0.js} +15 -2
- package/dist/chunks/assistant-turn-events-DwdCZzQ0.js.map +1 -0
- package/dist/chunks/chat-stream-4jlK2XS2.js +3571 -0
- package/dist/chunks/chat-stream-4jlK2XS2.js.map +1 -0
- package/dist/engines.d.ts +34 -0
- package/dist/engines.d.ts.map +1 -0
- package/dist/engines.js +260 -0
- package/dist/engines.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/internal/agent-runtime.js +1 -1
- package/dist/manifest.json +3 -1
- package/dist/persona-conversation.d.ts.map +1 -1
- package/dist/runtime-report-tools.d.ts.map +1 -1
- package/dist/services/ChatService.d.ts +3 -13
- package/dist/services/ChatService.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +46 -9
- package/dist/smrt-knowledge.okf.md +29 -4
- package/dist/svelte/components/assistant/AssistantApprovalCard.svelte +198 -0
- package/dist/svelte/components/assistant/AssistantApprovalCard.svelte.d.ts +34 -0
- package/dist/svelte/components/assistant/AssistantApprovalCard.svelte.d.ts.map +1 -0
- package/dist/svelte/components/assistant/AssistantComposer.svelte +6 -3
- package/dist/svelte/components/assistant/AssistantComposer.svelte.d.ts +2 -0
- package/dist/svelte/components/assistant/AssistantComposer.svelte.d.ts.map +1 -1
- package/dist/svelte/components/assistant/AssistantDock.svelte +66 -17
- package/dist/svelte/components/assistant/AssistantDock.svelte.d.ts +2 -0
- package/dist/svelte/components/assistant/AssistantDock.svelte.d.ts.map +1 -1
- package/dist/svelte/components/assistant/assistant-http-client.d.ts +2 -0
- package/dist/svelte/components/assistant/assistant-http-client.d.ts.map +1 -1
- package/dist/svelte/components/assistant/assistant-http-client.js +28 -1
- package/dist/svelte/components/assistant/assistant-transport.d.ts +18 -1
- package/dist/svelte/components/assistant/assistant-transport.d.ts.map +1 -1
- package/dist/svelte/components/assistant/assistant-transport.js +2 -0
- package/dist/svelte/components/assistant/create-assistant-dock-controller.svelte.d.ts +5 -1
- 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 +80 -4
- package/dist/svelte/i18n.d.ts +14 -0
- package/dist/svelte/i18n.d.ts.map +1 -1
- package/dist/svelte/i18n.js +14 -0
- package/dist/svelte/i18n.messages.d.ts +13 -0
- package/dist/svelte/i18n.messages.d.ts.map +1 -1
- package/dist/svelte/i18n.messages.js +13 -0
- package/dist/svelte/index.d.ts +2 -1
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +1 -0
- package/dist/sveltekit.d.ts +72 -4
- package/dist/sveltekit.d.ts.map +1 -1
- package/dist/sveltekit.js +439 -21
- package/dist/sveltekit.js.map +1 -1
- package/dist/tool-loop.d.ts +36 -3
- package/dist/tool-loop.d.ts.map +1 -1
- package/dist/tool-summary.d.ts +15 -0
- package/dist/tool-summary.d.ts.map +1 -0
- package/dist/tool-summary.js +95 -0
- package/dist/tool-summary.js.map +1 -0
- package/dist/work-profile.d.ts +64 -0
- package/dist/work-profile.d.ts.map +1 -0
- package/package.json +36 -22
- package/dist/chunks/ChatService-BGBAqmZq.js.map +0 -1
- package/dist/chunks/assistant-turn-events-BbZUf-Ju.js.map +0 -1
- package/dist/chunks/chat-stream-Blri3lj0.js +0 -2743
- package/dist/chunks/chat-stream-Blri3lj0.js.map +0 -1
|
@@ -5,10 +5,10 @@ description: "Chat rooms, DMs, threads, and agent conversations for the SMRT fra
|
|
|
5
5
|
status: "stable"
|
|
6
6
|
generated:
|
|
7
7
|
by: "smrt/scripts/generate-knowledge-okf.ts"
|
|
8
|
-
at: "2026-11-
|
|
8
|
+
at: "2026-11-13T04:10:05Z"
|
|
9
9
|
audience: "internal"
|
|
10
10
|
evidence_level: "source-inspected"
|
|
11
|
-
source_revision: "sha256:
|
|
11
|
+
source_revision: "sha256:29dca37e4d24196b2775d936bb0b398380e8d7fc155a27e129cf3b733fcdd191"
|
|
12
12
|
sources:
|
|
13
13
|
- id: "manifest"
|
|
14
14
|
resource: "https://github.com/happyvertical/smrt/blob/main/packages/chat/package.json"
|
|
@@ -29,14 +29,29 @@ sources:
|
|
|
29
29
|
resource: "https://github.com/happyvertical/smrt/blob/main/packages/chat/agents/overview-tools.md"
|
|
30
30
|
title: "@happyvertical/smrt-chat packages/chat/agents/overview-tools.md"
|
|
31
31
|
- id: "agents-6"
|
|
32
|
+
resource: "https://github.com/happyvertical/smrt/blob/main/packages/chat/agents/owner-approvals.md"
|
|
33
|
+
title: "@happyvertical/smrt-chat packages/chat/agents/owner-approvals.md"
|
|
34
|
+
- id: "agents-7"
|
|
32
35
|
resource: "https://github.com/happyvertical/smrt/blob/main/packages/chat/agents/recipes.md"
|
|
33
36
|
title: "@happyvertical/smrt-chat packages/chat/agents/recipes.md"
|
|
34
|
-
- id: "agents-
|
|
37
|
+
- id: "agents-8"
|
|
38
|
+
resource: "https://github.com/happyvertical/smrt/blob/main/packages/chat/agents/runtime-exposure.md"
|
|
39
|
+
title: "@happyvertical/smrt-chat packages/chat/agents/runtime-exposure.md"
|
|
40
|
+
- id: "agents-9"
|
|
41
|
+
resource: "https://github.com/happyvertical/smrt/blob/main/packages/chat/agents/runtime-report-tools.md"
|
|
42
|
+
title: "@happyvertical/smrt-chat packages/chat/agents/runtime-report-tools.md"
|
|
43
|
+
- id: "agents-10"
|
|
35
44
|
resource: "https://github.com/happyvertical/smrt/blob/main/packages/chat/agents/token-streaming.md"
|
|
36
45
|
title: "@happyvertical/smrt-chat packages/chat/agents/token-streaming.md"
|
|
37
|
-
- id: "agents-
|
|
46
|
+
- id: "agents-11"
|
|
38
47
|
resource: "https://github.com/happyvertical/smrt/blob/main/packages/chat/agents/tool-loop.md"
|
|
39
48
|
title: "@happyvertical/smrt-chat packages/chat/agents/tool-loop.md"
|
|
49
|
+
- id: "agents-12"
|
|
50
|
+
resource: "https://github.com/happyvertical/smrt/blob/main/packages/chat/agents/tool-summaries.md"
|
|
51
|
+
title: "@happyvertical/smrt-chat packages/chat/agents/tool-summaries.md"
|
|
52
|
+
- id: "agents-13"
|
|
53
|
+
resource: "https://github.com/happyvertical/smrt/blob/main/packages/chat/agents/turn-drivers.md"
|
|
54
|
+
title: "@happyvertical/smrt-chat packages/chat/agents/turn-drivers.md"
|
|
40
55
|
---
|
|
41
56
|
|
|
42
57
|
# @happyvertical/smrt-chat
|
|
@@ -55,17 +70,24 @@ sources:
|
|
|
55
70
|
- `packages/chat/agents/assistant-questions.md`
|
|
56
71
|
- `packages/chat/agents/dev-workbench.md`
|
|
57
72
|
- `packages/chat/agents/overview-tools.md`
|
|
73
|
+
- `packages/chat/agents/owner-approvals.md`
|
|
58
74
|
- `packages/chat/agents/recipes.md`
|
|
75
|
+
- `packages/chat/agents/runtime-exposure.md`
|
|
76
|
+
- `packages/chat/agents/runtime-report-tools.md`
|
|
59
77
|
- `packages/chat/agents/token-streaming.md`
|
|
60
78
|
- `packages/chat/agents/tool-loop.md`
|
|
79
|
+
- `packages/chat/agents/tool-summaries.md`
|
|
80
|
+
- `packages/chat/agents/turn-drivers.md`
|
|
61
81
|
|
|
62
82
|
## Framework dependencies
|
|
63
83
|
|
|
64
84
|
- [smrt-agents](/components/smrt-agents.md)
|
|
85
|
+
- [smrt-app-runtime](/components/smrt-app-runtime.md)
|
|
65
86
|
- [smrt-assets](/components/smrt-assets.md)
|
|
66
87
|
- [smrt-config](/components/smrt-config.md)
|
|
67
88
|
- [smrt-core](/components/smrt-core.md)
|
|
68
89
|
- [smrt-images](/components/smrt-images.md)
|
|
90
|
+
- [smrt-inference](/components/smrt-inference.md)
|
|
69
91
|
- [smrt-personas](/components/smrt-personas.md)
|
|
70
92
|
- [smrt-playground](/components/smrt-playground.md)
|
|
71
93
|
- [smrt-profiles](/components/smrt-profiles.md)
|
|
@@ -87,10 +109,12 @@ sources:
|
|
|
87
109
|
## Exports
|
|
88
110
|
|
|
89
111
|
- `.`
|
|
112
|
+
- `./assistant-approvals`
|
|
90
113
|
- `./assistant-turn`
|
|
91
114
|
- `./client`
|
|
92
115
|
- `./data-surface`
|
|
93
116
|
- `./data-surface-bridge`
|
|
117
|
+
- `./engines`
|
|
94
118
|
- `./helper-preferences`
|
|
95
119
|
- `./internal/agent-runtime`
|
|
96
120
|
- `./manifest`
|
|
@@ -98,6 +122,7 @@ sources:
|
|
|
98
122
|
- `./playground`
|
|
99
123
|
- `./svelte`
|
|
100
124
|
- `./sveltekit`
|
|
125
|
+
- `./tool-summary`
|
|
101
126
|
- `./ui`
|
|
102
127
|
|
|
103
128
|
## Models
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
3
|
+
import { Button, Card } from '@happyvertical/smrt-ui/ui';
|
|
4
|
+
import { onMount, type Snippet, untrack } from 'svelte';
|
|
5
|
+
import {
|
|
6
|
+
type AssistantApprovalRequest,
|
|
7
|
+
type AssistantApprovalView,
|
|
8
|
+
reconcileAssistantApprovalView,
|
|
9
|
+
} from '../../../assistant-turn-events.js';
|
|
10
|
+
import { M } from '../../i18n.js';
|
|
11
|
+
import type { AssistantTransport } from './assistant-transport.js';
|
|
12
|
+
|
|
13
|
+
export interface Props {
|
|
14
|
+
/** The pending request this card asks the owner to approve or deny. */
|
|
15
|
+
approval?: AssistantApprovalRequest;
|
|
16
|
+
/** Conversation the request belongs to, sent with the decision. */
|
|
17
|
+
threadId?: string;
|
|
18
|
+
/** Show a plain summary in place of the tool's own name and arguments. */
|
|
19
|
+
toolPresentation?: 'generic';
|
|
20
|
+
/** Connection used to send the owner's decision to the assistant. */
|
|
21
|
+
transport?: AssistantTransport;
|
|
22
|
+
/** Host-authorized presentation for an existing decision endpoint and persisted view. */
|
|
23
|
+
presentation?: {
|
|
24
|
+
id: string;
|
|
25
|
+
summary: string;
|
|
26
|
+
statusLabel: string;
|
|
27
|
+
badgeClass: string;
|
|
28
|
+
headingSize?: string;
|
|
29
|
+
pending: boolean;
|
|
30
|
+
busy?: boolean;
|
|
31
|
+
busyLabel?: string;
|
|
32
|
+
message?: string;
|
|
33
|
+
ondecide?: (approve: boolean) => void;
|
|
34
|
+
};
|
|
35
|
+
/** Extra content shown under the summary, such as what will change. */
|
|
36
|
+
detail?: Snippet;
|
|
37
|
+
/** Called after the decision has been accepted, to refresh the surrounding view. */
|
|
38
|
+
ondecided?: () => void | Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
const {
|
|
41
|
+
approval,
|
|
42
|
+
threadId,
|
|
43
|
+
transport,
|
|
44
|
+
ondecided,
|
|
45
|
+
presentation,
|
|
46
|
+
toolPresentation,
|
|
47
|
+
detail,
|
|
48
|
+
}: Props = $props();
|
|
49
|
+
const { t } = useI18n();
|
|
50
|
+
let view = $state<AssistantApprovalView>(
|
|
51
|
+
untrack(() => ({
|
|
52
|
+
id: approval?.id ?? '',
|
|
53
|
+
tool: approval?.tool ?? '',
|
|
54
|
+
callId: approval?.callId ?? '',
|
|
55
|
+
summary: approval?.summary ?? '',
|
|
56
|
+
...(approval?.presentation ? { presentation: approval.presentation } : {}),
|
|
57
|
+
status: 'pending',
|
|
58
|
+
})),
|
|
59
|
+
);
|
|
60
|
+
let busy = $state(false);
|
|
61
|
+
let error = $state(false);
|
|
62
|
+
let verified = $state(false);
|
|
63
|
+
const labels = {
|
|
64
|
+
pending: M['chat.approval.pending'],
|
|
65
|
+
approved: M['chat.approval.approved'],
|
|
66
|
+
denied: M['chat.approval.denied'],
|
|
67
|
+
expired: M['chat.approval.expired'],
|
|
68
|
+
executing: M['chat.approval.executing'],
|
|
69
|
+
succeeded: M['chat.approval.succeeded'],
|
|
70
|
+
failed: M['chat.approval.failed'],
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
onMount(() => {
|
|
74
|
+
if (presentation || !approval || !transport) return;
|
|
75
|
+
const boundTransport = transport;
|
|
76
|
+
const boundThread = threadId;
|
|
77
|
+
const boundApproval = approval;
|
|
78
|
+
let active = true;
|
|
79
|
+
let timer: ReturnType<typeof setTimeout>;
|
|
80
|
+
const refresh = async () => {
|
|
81
|
+
try {
|
|
82
|
+
const rows = await boundTransport.listApprovals?.(boundThread);
|
|
83
|
+
if (!active) return;
|
|
84
|
+
const current = rows?.find((row) => row.id === boundApproval.id);
|
|
85
|
+
if (current) {
|
|
86
|
+
view = reconcileAssistantApprovalView(view, current);
|
|
87
|
+
verified = true;
|
|
88
|
+
}
|
|
89
|
+
} catch {
|
|
90
|
+
if (active) error = true;
|
|
91
|
+
}
|
|
92
|
+
if (active && ['pending', 'approved', 'executing'].includes(view.status))
|
|
93
|
+
timer = setTimeout(refresh, 1000);
|
|
94
|
+
};
|
|
95
|
+
void refresh();
|
|
96
|
+
return () => {
|
|
97
|
+
active = false;
|
|
98
|
+
clearTimeout(timer);
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
async function decide(approve: boolean) {
|
|
103
|
+
if (
|
|
104
|
+
busy ||
|
|
105
|
+
!verified ||
|
|
106
|
+
view.status !== 'pending' ||
|
|
107
|
+
!approval ||
|
|
108
|
+
!transport?.decideApproval
|
|
109
|
+
)
|
|
110
|
+
return;
|
|
111
|
+
busy = true;
|
|
112
|
+
error = false;
|
|
113
|
+
try {
|
|
114
|
+
view = reconcileAssistantApprovalView(
|
|
115
|
+
view,
|
|
116
|
+
await transport.decideApproval(approval.id, approve),
|
|
117
|
+
);
|
|
118
|
+
await ondecided?.();
|
|
119
|
+
} catch {
|
|
120
|
+
error = true;
|
|
121
|
+
} finally {
|
|
122
|
+
busy = false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
</script>
|
|
126
|
+
|
|
127
|
+
{#if presentation}
|
|
128
|
+
<article class="smrt-app-shell__card" data-smrt-component="AssistantApprovalCard" aria-labelledby="ap-{presentation.id}-title" style:--smrt-approval-heading-size={presentation.headingSize ?? 'var(--smrt-typography-title-medium-size)'}>
|
|
129
|
+
<header class="smrt-assistant-approval-card__top">
|
|
130
|
+
<h3 id="ap-{presentation.id}-title">{presentation.summary}</h3>
|
|
131
|
+
<span class="smrt-app-shell__badge {presentation.badgeClass}">{presentation.statusLabel}</span>
|
|
132
|
+
</header>
|
|
133
|
+
{@render detail?.()}
|
|
134
|
+
{#if presentation.message}<p class="smrt-app-shell__alert smrt-app-shell__alert-error" role="alert">{presentation.message}</p>{/if}
|
|
135
|
+
{#if presentation.pending && presentation.ondecide}
|
|
136
|
+
<div class="smrt-app-shell__actions">
|
|
137
|
+
<Button labelWhitespace="trim" class="smrt-app-shell__btn smrt-app-shell__btn-primary" disabled={presentation.busy} aria-label={`${presentation.busy ? (presentation.busyLabel ?? t(M['chat.approval.pending'])) : t(M['chat.approval.approve'])}: ${presentation.summary}`} onclick={() => presentation.ondecide?.(true)}>{presentation.busy ? (presentation.busyLabel ?? t(M['chat.approval.pending'])) : t(M['chat.approval.approve'])}</Button>
|
|
138
|
+
<Button labelWhitespace="trim" class="smrt-app-shell__btn" variant="secondary" disabled={presentation.busy} aria-label={`${t(M['chat.approval.deny'])}: ${presentation.summary}`} onclick={() => presentation.ondecide?.(false)}>{t(M['chat.approval.deny'])}</Button>
|
|
139
|
+
</div>
|
|
140
|
+
{/if}
|
|
141
|
+
</article>
|
|
142
|
+
{:else if approval && transport}
|
|
143
|
+
<div data-smrt-component="AssistantApprovalCard">
|
|
144
|
+
<Card padding="sm">
|
|
145
|
+
<div class="smrt-assistant-approval-card__approval" aria-busy={busy}>
|
|
146
|
+
<p>{toolPresentation === 'generic' ? view.presentation?.summary ?? t(M['chat.approval.review_change']) : view.summary}</p>
|
|
147
|
+
<p role="status" aria-live="polite">{t(labels[view.status])}</p>
|
|
148
|
+
{#if view.status === 'pending' && transport.decideApproval && transport.listApprovals}
|
|
149
|
+
<div class="smrt-assistant-approval-card__actions">
|
|
150
|
+
<Button disabled={busy || !verified} onclick={() => decide(true)}>{t(M['chat.approval.approve'])}</Button>
|
|
151
|
+
<Button variant="secondary" disabled={busy || !verified} onclick={() => decide(false)}>{t(M['chat.approval.deny'])}</Button>
|
|
152
|
+
</div>
|
|
153
|
+
{:else if !transport?.decideApproval || !transport.listApprovals}
|
|
154
|
+
<p>{t(M['chat.approval.unavailable'])}</p>
|
|
155
|
+
{/if}
|
|
156
|
+
{#if error}<p role="alert">{t(M['chat.approval.error'])}</p>{/if}
|
|
157
|
+
</div>
|
|
158
|
+
</Card>
|
|
159
|
+
</div>
|
|
160
|
+
{/if}
|
|
161
|
+
|
|
162
|
+
<style>
|
|
163
|
+
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
164
|
+
|
|
165
|
+
@layer smrt.structure {
|
|
166
|
+
.smrt-assistant-approval-card__top {
|
|
167
|
+
display: flex;
|
|
168
|
+
flex-wrap: wrap;
|
|
169
|
+
align-items: baseline;
|
|
170
|
+
justify-content: space-between;
|
|
171
|
+
gap: var(--smrt-spacing-2);
|
|
172
|
+
}
|
|
173
|
+
.smrt-assistant-approval-card__top h3 {
|
|
174
|
+
margin: 0;
|
|
175
|
+
}
|
|
176
|
+
.smrt-assistant-approval-card__approval {
|
|
177
|
+
display: grid;
|
|
178
|
+
gap: var(--smrt-spacing-2);
|
|
179
|
+
}
|
|
180
|
+
.smrt-assistant-approval-card__approval p {
|
|
181
|
+
margin: var(--smrt-spacing-0);
|
|
182
|
+
}
|
|
183
|
+
.smrt-assistant-approval-card__actions {
|
|
184
|
+
display: flex;
|
|
185
|
+
gap: var(--smrt-spacing-2);
|
|
186
|
+
flex-wrap: wrap;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@layer smrt.theme {
|
|
191
|
+
.smrt-assistant-approval-card__top h3 {
|
|
192
|
+
font-size: var(--smrt-approval-heading-size);
|
|
193
|
+
}
|
|
194
|
+
.smrt-assistant-approval-card__approval {
|
|
195
|
+
color: var(--smrt-color-on-surface);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Snippet } from 'svelte';
|
|
2
|
+
import { type AssistantApprovalRequest } from '../../../assistant-turn-events.js';
|
|
3
|
+
import type { AssistantTransport } from './assistant-transport.js';
|
|
4
|
+
export interface Props {
|
|
5
|
+
/** The pending request this card asks the owner to approve or deny. */
|
|
6
|
+
approval?: AssistantApprovalRequest;
|
|
7
|
+
/** Conversation the request belongs to, sent with the decision. */
|
|
8
|
+
threadId?: string;
|
|
9
|
+
/** Show a plain summary in place of the tool's own name and arguments. */
|
|
10
|
+
toolPresentation?: 'generic';
|
|
11
|
+
/** Connection used to send the owner's decision to the assistant. */
|
|
12
|
+
transport?: AssistantTransport;
|
|
13
|
+
/** Host-authorized presentation for an existing decision endpoint and persisted view. */
|
|
14
|
+
presentation?: {
|
|
15
|
+
id: string;
|
|
16
|
+
summary: string;
|
|
17
|
+
statusLabel: string;
|
|
18
|
+
badgeClass: string;
|
|
19
|
+
headingSize?: string;
|
|
20
|
+
pending: boolean;
|
|
21
|
+
busy?: boolean;
|
|
22
|
+
busyLabel?: string;
|
|
23
|
+
message?: string;
|
|
24
|
+
ondecide?: (approve: boolean) => void;
|
|
25
|
+
};
|
|
26
|
+
/** Extra content shown under the summary, such as what will change. */
|
|
27
|
+
detail?: Snippet;
|
|
28
|
+
/** Called after the decision has been accepted, to refresh the surrounding view. */
|
|
29
|
+
ondecided?: () => void | Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
declare const AssistantApprovalCard: import("svelte").Component<Props, {}, "">;
|
|
32
|
+
type AssistantApprovalCard = ReturnType<typeof AssistantApprovalCard>;
|
|
33
|
+
export default AssistantApprovalCard;
|
|
34
|
+
//# sourceMappingURL=AssistantApprovalCard.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssistantApprovalCard.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/assistant/AssistantApprovalCard.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,EAAW,KAAK,OAAO,EAAW,MAAM,QAAQ,CAAC;AACxD,OAAO,EACL,KAAK,wBAAwB,EAG9B,MAAM,mCAAmC,CAAC;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGnE,MAAM,WAAW,KAAK;IACpB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,wBAAwB,CAAC;IACpC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,qEAAqE;IACrE,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,yFAAyF;IACzF,YAAY,CAAC,EAAE;QACb,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;KACvC,CAAC;IACF,uEAAuE;IACvE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAuID,QAAA,MAAM,qBAAqB,2CAAwC,CAAC;AACpE,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACtE,eAAe,qBAAqB,CAAC"}
|
|
@@ -31,6 +31,8 @@ import type { AssistantAttachmentRef } from './assistant-transport.js';
|
|
|
31
31
|
const { t } = useI18n();
|
|
32
32
|
|
|
33
33
|
export interface Props {
|
|
34
|
+
/** A containing dock owns the send error and retry; standalone composers show it locally. */
|
|
35
|
+
showSendError?: boolean;
|
|
34
36
|
/** Called with the trimmed message text and any staged attachments when
|
|
35
37
|
* the user sends — via Enter or the Send button. May return a Promise
|
|
36
38
|
* (or reject/throw): the draft text and staged attachments are kept until
|
|
@@ -108,6 +110,7 @@ export interface Props {
|
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
let {
|
|
113
|
+
showSendError = true,
|
|
111
114
|
onsend,
|
|
112
115
|
onupload,
|
|
113
116
|
disabled = false,
|
|
@@ -394,8 +397,8 @@ function removeAttachment(id: string) {
|
|
|
394
397
|
ondrop={onupload ? handleDrop : undefined}
|
|
395
398
|
ondragover={onupload ? (event) => event.preventDefault() : undefined} data-smrt-component="AssistantComposer"
|
|
396
399
|
>
|
|
397
|
-
{#if sendError}
|
|
398
|
-
<p class="smrt-assistant-composer__error"
|
|
400
|
+
{#if sendError && showSendError}
|
|
401
|
+
<p class="smrt-assistant-composer__error" role="alert">
|
|
399
402
|
{t(M['chat.assistant_composer.send_error'], { message: sendError })}
|
|
400
403
|
</p>
|
|
401
404
|
{/if}
|
|
@@ -501,6 +504,7 @@ function removeAttachment(id: string) {
|
|
|
501
504
|
|
|
502
505
|
<style>
|
|
503
506
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
507
|
+
|
|
504
508
|
@layer smrt.structure {
|
|
505
509
|
.smrt-assistant-composer__root {
|
|
506
510
|
padding: var(--smrt-spacing-2);
|
|
@@ -652,5 +656,4 @@ function removeAttachment(id: string) {
|
|
|
652
656
|
font: var(--smrt-typography-body-small-font, 0.8125rem/1.4 sans-serif);
|
|
653
657
|
}
|
|
654
658
|
}
|
|
655
|
-
|
|
656
659
|
</style>
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
import { type DictationSourceProvider, type DictationTranscribe, type HandsFreeCaptureFactory, type HandsFreeVadOptions } from '@happyvertical/smrt-ui/forms';
|
|
12
12
|
import type { AssistantAttachmentRef } from './assistant-transport.js';
|
|
13
13
|
export interface Props {
|
|
14
|
+
/** A containing dock owns the send error and retry; standalone composers show it locally. */
|
|
15
|
+
showSendError?: boolean;
|
|
14
16
|
/** Called with the trimmed message text and any staged attachments when
|
|
15
17
|
* the user sends — via Enter or the Send button. May return a Promise
|
|
16
18
|
* (or reject/throw): the draft text and staged attachments are kept until
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantComposer.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/assistant/AssistantComposer.svelte.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,OAAO,EAGL,KAAK,uBAAuB,EAE5B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EAKzB,MAAM,8BAA8B,CAAC;AAKtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGvE,MAAM,WAAW,KAAK;IACpB;;;;4DAIwD;IACxD,MAAM,EAAE,CACN,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,sBAAsB,EAAE,KAClC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B;sEACkE;IAClE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC;IAClE,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;0CAEsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC3C;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACxC;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IACtC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAClD,+EAA+E;IAC/E,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"AssistantComposer.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/assistant/AssistantComposer.svelte.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,OAAO,EAGL,KAAK,uBAAuB,EAE5B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EAKzB,MAAM,8BAA8B,CAAC;AAKtC,OAAO,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
30
|
import { type Component, type Snippet, tick, untrack } from 'svelte';
|
|
31
31
|
import type { AssistantStatus } from '../../../assistant-turn-events.js';
|
|
32
32
|
import type { ChatUnavailableStatus } from '../../../client.js';
|
|
33
|
+
import { describeAssistantTool } from '../../../tool-summary.js';
|
|
33
34
|
import { M } from '../../i18n.js';
|
|
34
35
|
import ToolCallDisplay from '../agent/ToolCallDisplay.svelte';
|
|
35
36
|
import AiUnavailableNotice from '../shared/AiUnavailableNotice.svelte';
|
|
36
37
|
import ModelPicker from '../shared/ModelPicker.svelte';
|
|
38
|
+
import AssistantApprovalCard from './AssistantApprovalCard.svelte';
|
|
37
39
|
import AssistantChoiceCards from './AssistantChoiceCards.svelte';
|
|
38
40
|
import AssistantComposer from './AssistantComposer.svelte';
|
|
39
41
|
import AssistantQuestionForm from './AssistantQuestionForm.svelte';
|
|
@@ -160,6 +162,8 @@ export interface Props {
|
|
|
160
162
|
toolResultComponent?: (
|
|
161
163
|
message: AssistantMessage,
|
|
162
164
|
) => Component<{ message: AssistantMessage }> | undefined;
|
|
165
|
+
/** Trusted host presentation; tool execution data stays out of visible fallback text. */
|
|
166
|
+
toolPresentation?: 'generic';
|
|
163
167
|
/** How an assistant message's text renders (#4505). `'text'` (default)
|
|
164
168
|
* shows it verbatim, as before. `'markdown'` renders paragraphs, headings
|
|
165
169
|
* (`#`–`###`), lists, fenced and inline code, bold/italic and http(s) links
|
|
@@ -271,6 +275,7 @@ const {
|
|
|
271
275
|
threadList = true,
|
|
272
276
|
toolCall,
|
|
273
277
|
toolResultComponent,
|
|
278
|
+
toolPresentation,
|
|
274
279
|
messageFormat = 'text',
|
|
275
280
|
renderMessage,
|
|
276
281
|
oncontroller,
|
|
@@ -299,6 +304,36 @@ const {
|
|
|
299
304
|
aiSettingsHref,
|
|
300
305
|
}: Props = $props();
|
|
301
306
|
const { t } = useI18n();
|
|
307
|
+
function toolMessageContent(message: AssistantMessage): string {
|
|
308
|
+
if (toolPresentation !== 'generic' || message.role !== 'tool')
|
|
309
|
+
return message.content;
|
|
310
|
+
const data =
|
|
311
|
+
message.toolCallData && typeof message.toolCallData === 'object'
|
|
312
|
+
? (message.toolCallData as Record<string, unknown>)
|
|
313
|
+
: {};
|
|
314
|
+
if (
|
|
315
|
+
typeof data.label === 'string' &&
|
|
316
|
+
[
|
|
317
|
+
'Checked the app structure',
|
|
318
|
+
'Checked app history',
|
|
319
|
+
'Checked pending approvals',
|
|
320
|
+
'Checked records',
|
|
321
|
+
'Completed this action',
|
|
322
|
+
'Could not complete this action',
|
|
323
|
+
].includes(data.label)
|
|
324
|
+
)
|
|
325
|
+
return data.label;
|
|
326
|
+
const name = typeof data.name === 'string' ? data.name : '';
|
|
327
|
+
const ok = !['error', 'refused', 'rejected', 'denied'].includes(
|
|
328
|
+
String(data.status),
|
|
329
|
+
);
|
|
330
|
+
return describeAssistantTool(
|
|
331
|
+
name,
|
|
332
|
+
undefined,
|
|
333
|
+
{ ok, observation: undefined },
|
|
334
|
+
{ recordLabels: 'generic' },
|
|
335
|
+
);
|
|
336
|
+
}
|
|
302
337
|
|
|
303
338
|
// Set when the server answered `ai_unavailable` (#4757); cleared by the next
|
|
304
339
|
// successful send. Rendered as a notice with the host's settings link.
|
|
@@ -645,11 +680,11 @@ async function handleSend(
|
|
|
645
680
|
) {
|
|
646
681
|
// Finding 4 (#2904 review, fresh cycle): controller.send()/doSend()
|
|
647
682
|
// already marks the pendingSend 'failed' and rethrows on a transport
|
|
648
|
-
// error.
|
|
649
|
-
//
|
|
650
|
-
//
|
|
651
|
-
// instead of discarding it.
|
|
683
|
+
// error. The pending send owns the inline error and retry. Keep the
|
|
684
|
+
// controller's error for compatibility; the dock suppresses its duplicate.
|
|
685
|
+
// Rethrow so the composer restores the draft without adding another alert.
|
|
652
686
|
try {
|
|
687
|
+
controller.setError(null);
|
|
653
688
|
await controller.send(content, attachments);
|
|
654
689
|
controller.setError(null);
|
|
655
690
|
aiUnavailable = null;
|
|
@@ -759,8 +794,8 @@ async function handleConfirmAction(requestId: string) {
|
|
|
759
794
|
{#if aiUnavailable}
|
|
760
795
|
<AiUnavailableNotice status={aiUnavailable} settingsHref={aiSettingsHref} />
|
|
761
796
|
{/if}
|
|
762
|
-
{#if controller.error}
|
|
763
|
-
<p class="smrt-assistant-dock__error"
|
|
797
|
+
{#if controller.error && !controller.pendingSends.some((p) => p.status === 'failed' && p.error === controller.error)}
|
|
798
|
+
<p class="smrt-assistant-dock__error" role="alert">
|
|
764
799
|
{t(M['chat.assistant_dock.error'], { message: controller.error })}
|
|
765
800
|
{#if conversations === 'single' && !controller.activeThreadId}
|
|
766
801
|
<Button
|
|
@@ -905,6 +940,14 @@ async function handleConfirmAction(requestId: string) {
|
|
|
905
940
|
<div class="smrt-assistant-dock__card" data-smrt-part="item">
|
|
906
941
|
<ResultComponent {message} />
|
|
907
942
|
</div>
|
|
943
|
+
{:else if message.role === 'tool' && message.toolCallData && typeof message.toolCallData === 'object' && 'approval' in message.toolCallData}
|
|
944
|
+
<AssistantApprovalCard
|
|
945
|
+
approval={(message.toolCallData as { approval: import('../../../assistant-turn-events.js').AssistantApprovalRequest }).approval}
|
|
946
|
+
threadId={message.threadId}
|
|
947
|
+
{toolPresentation}
|
|
948
|
+
{transport}
|
|
949
|
+
ondecided={() => controller.openThread(message.threadId)}
|
|
950
|
+
/>
|
|
908
951
|
{:else}
|
|
909
952
|
<MessageBubble
|
|
910
953
|
variant={bubbleVariant(message.role)}
|
|
@@ -914,7 +957,7 @@ async function handleConfirmAction(requestId: string) {
|
|
|
914
957
|
{#if message.role === 'assistant'}
|
|
915
958
|
{@render assistantText(message, false)}
|
|
916
959
|
{:else}
|
|
917
|
-
<p class="smrt-assistant-dock__message-content"
|
|
960
|
+
<p class="smrt-assistant-dock__message-content">{toolMessageContent(message)}</p>
|
|
918
961
|
{/if}
|
|
919
962
|
{#if message.attachments && message.attachments.length > 0}
|
|
920
963
|
<ul
|
|
@@ -962,7 +1005,7 @@ async function handleConfirmAction(requestId: string) {
|
|
|
962
1005
|
/>
|
|
963
1006
|
</div>
|
|
964
1007
|
{/if}
|
|
965
|
-
{#if toolCall && message.toolCallData != null}
|
|
1008
|
+
{#if toolPresentation !== 'generic' && toolCall && message.toolCallData != null}
|
|
966
1009
|
<!-- A host's cards (a report preview, an offer) span the thread
|
|
967
1010
|
under the message's text bubble. -->
|
|
968
1011
|
<div class="smrt-assistant-dock__card smrt-assistant-dock__tool-call" data-smrt-part="panel">
|
|
@@ -1003,17 +1046,19 @@ async function handleConfirmAction(requestId: string) {
|
|
|
1003
1046
|
<p class="smrt-assistant-dock__tool-request-title" data-smrt-part="title">
|
|
1004
1047
|
{t(M['chat.assistant_dock.tool_request_title'])}
|
|
1005
1048
|
</p>
|
|
1006
|
-
<p class="smrt-assistant-dock__tool-request-description"
|
|
1049
|
+
<p class="smrt-assistant-dock__tool-request-description">{toolPresentation === 'generic' ? t(M['chat.assistant_dock.review_action']) : request.description || request.name}</p>
|
|
1007
1050
|
{#if request.effect === 'destructive'}
|
|
1008
1051
|
<p class="smrt-assistant-dock__tool-request-warning" data-smrt-part="description">
|
|
1009
1052
|
{t(M['chat.assistant_dock.tool_request_destructive'])}
|
|
1010
1053
|
</p>
|
|
1011
1054
|
{/if}
|
|
1012
|
-
|
|
1055
|
+
{#if toolPresentation !== 'generic'}
|
|
1056
|
+
<details class="smrt-assistant-dock__tool-request-details">
|
|
1013
1057
|
<summary>{t(M['chat.assistant_dock.tool_request_details'])}</summary>
|
|
1014
1058
|
<pre>{formatToolArgs(request.args)}</pre>
|
|
1015
1059
|
</details>
|
|
1016
|
-
|
|
1060
|
+
{/if}
|
|
1061
|
+
<div class="smrt-assistant-dock__tool-request-actions">
|
|
1017
1062
|
<Button type="button" size="sm" onclick={() => controller.approveToolRequest(request.id)}>
|
|
1018
1063
|
{t(M['chat.assistant_dock.tool_request_allow'])}
|
|
1019
1064
|
</Button>
|
|
@@ -1101,9 +1146,9 @@ async function handleConfirmAction(requestId: string) {
|
|
|
1101
1146
|
all — only 'stale' rendered above. retry(clientRequestId)
|
|
1102
1147
|
already exists and reuses the same id, so it's the same
|
|
1103
1148
|
affordance as the stale case. -->
|
|
1104
|
-
<div class="smrt-assistant-dock__failed"
|
|
1105
|
-
<p>{t(M['chat.assistant_dock.send_failed'])}</p>
|
|
1149
|
+
<div class="smrt-assistant-dock__failed">
|
|
1106
1150
|
{#each controller.pendingSends.filter((p) => p.status === 'failed') as pending (pending.clientRequestId)}
|
|
1151
|
+
<p role="alert">{pending.error ?? t(M['chat.assistant_dock.send_failed'])}</p>
|
|
1107
1152
|
<Button
|
|
1108
1153
|
type="button"
|
|
1109
1154
|
size="sm"
|
|
@@ -1116,9 +1161,12 @@ async function handleConfirmAction(requestId: string) {
|
|
|
1116
1161
|
{/if}
|
|
1117
1162
|
</div>
|
|
1118
1163
|
|
|
1119
|
-
{#if controller.status.state === 'working'}
|
|
1120
|
-
<div class="smrt-assistant-dock__status"
|
|
1121
|
-
<span class="smrt-assistant-dock__status-label"
|
|
1164
|
+
{#if controller.status.state === 'working' || (controller.status.state === 'idle' && controller.status.label)}
|
|
1165
|
+
<div class="smrt-assistant-dock__status" role="status" aria-live="polite">
|
|
1166
|
+
<span class="smrt-assistant-dock__status-label">{controller.status.label}</span>
|
|
1167
|
+
{#if controller.designRun?.status === 'stopped'}
|
|
1168
|
+
<Button type="button" size="sm" variant="ghost" onclick={() => controller.resumeDesignRun()}>{t(M['chat.assistant_dock.resume_design'])}</Button>
|
|
1169
|
+
{/if}
|
|
1122
1170
|
{#if controller.status.cancellable}
|
|
1123
1171
|
<Button type="button" size="sm" variant="ghost" onclick={() => controller.cancel()}>
|
|
1124
1172
|
{t(M['chat.assistant_dock.stop'])}
|
|
@@ -1145,6 +1193,7 @@ async function handleConfirmAction(requestId: string) {
|
|
|
1145
1193
|
() => controller.draft, (text) => controller.setDraft(text)
|
|
1146
1194
|
}
|
|
1147
1195
|
onsend={handleSend}
|
|
1196
|
+
showSendError={false}
|
|
1148
1197
|
onupload={transport.uploadAttachment ? handleUpload : undefined}
|
|
1149
1198
|
disabled={!controller.activeThreadId || composerDisabled}
|
|
1150
1199
|
placeholder={composerPlaceholder}
|
|
@@ -1166,6 +1215,7 @@ async function handleConfirmAction(requestId: string) {
|
|
|
1166
1215
|
|
|
1167
1216
|
<style>
|
|
1168
1217
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
1218
|
+
|
|
1169
1219
|
@layer smrt.structure {
|
|
1170
1220
|
/* #3000: the dock sizes itself against its own container (a shell dock
|
|
1171
1221
|
* edge can be ~250px wide) rather than the viewport. A container cannot
|
|
@@ -1582,5 +1632,4 @@ async function handleConfirmAction(requestId: string) {
|
|
|
1582
1632
|
border-bottom: var(--smrt-hairline);
|
|
1583
1633
|
}
|
|
1584
1634
|
}
|
|
1585
|
-
|
|
1586
1635
|
</style>
|
|
@@ -77,6 +77,8 @@ export interface Props {
|
|
|
77
77
|
toolResultComponent?: (message: AssistantMessage) => Component<{
|
|
78
78
|
message: AssistantMessage;
|
|
79
79
|
}> | undefined;
|
|
80
|
+
/** Trusted host presentation; tool execution data stays out of visible fallback text. */
|
|
81
|
+
toolPresentation?: 'generic';
|
|
80
82
|
/** How an assistant message's text renders (#4505). `'text'` (default)
|
|
81
83
|
* shows it verbatim, as before. `'markdown'` renders paragraphs, headings
|
|
82
84
|
* (`#`–`###`), lists, fenced and inline code, bold/italic and http(s) links
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantDock.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/assistant/AssistantDock.svelte.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAiB,MAAM,QAAQ,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantDock.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/assistant/AssistantDock.svelte.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAiB,MAAM,QAAQ,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAazE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAOnF,OAAO,KAAK,EAEV,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAE/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EAElB,MAAM,8CAA8C,CAAC;AAGtD,MAAM,WAAW,KAAK;IACpB,kFAAkF;IAClF,WAAW,CAAC,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3D,kEAAkE;IAClE,SAAS,EAAE,kBAAkB,CAAC;IAC9B;;qBAEiB;IACjB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;2EAEuE;IACvE,WAAW,CAAC,EAAE,eAAe,GAAG,QAAQ,CAAC;IACzC;qEACiE;IACjE,YAAY,CAAC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AAC;IACnB;;2DAEuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAs2BD,QAAA,MAAM,aAAa,0BAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -26,6 +26,8 @@ export interface AssistantHttpOptions {
|
|
|
26
26
|
}
|
|
27
27
|
/** Options for {@link createAssistantHttpTransport}. */
|
|
28
28
|
export interface AssistantHttpTransportOptions extends AssistantHttpOptions {
|
|
29
|
+
/** Enable authenticated host design-run status and control routes. */
|
|
30
|
+
designRuns?: boolean;
|
|
29
31
|
/** When set, the dock renders `ModelPicker`; the server checks the choice. */
|
|
30
32
|
models?: ModelOption[];
|
|
31
33
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistant-http-client.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/assistant/assistant-http-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,wBAAwB,EAExB,mBAAmB,EACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"assistant-http-client.d.ts","sourceRoot":"","sources":["../../../../src/svelte/components/assistant/assistant-http-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,wBAAwB,EAExB,mBAAmB,EACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAQL,KAAK,kBAAkB,EAGvB,KAAK,WAAW,EAIjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAE1F,8DAA8D;AAC9D,MAAM,WAAW,oBAAoB;IACnC,s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