@tangle-network/agent-app 0.45.28 → 0.45.30
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/dist/{DesignCanvas-3RRPVPCP.js → DesignCanvas-RSWQCXM3.js} +2 -2
- package/dist/{DesignCanvasEditor-KAMMEX7E.js → DesignCanvasEditor-XZMGIST7.js} +4 -4
- package/dist/{use-file-mentions-CZ-Ua_sb.d.ts → agent-session-controls-BwImzYKC.d.ts} +32 -1
- package/dist/alerting/index.d.ts +178 -0
- package/dist/alerting/index.js +9 -0
- package/dist/alerting/index.js.map +1 -0
- package/dist/assistant/index.d.ts +65 -42
- package/dist/assistant/index.js +31 -12
- package/dist/assistant/index.js.map +1 -1
- package/dist/chat-react/index.d.ts +20 -140
- package/dist/chat-react/index.js +15 -133
- package/dist/chat-react/index.js.map +1 -1
- package/dist/chat-routes/index.js +7 -7
- package/dist/chunk-COP2K4LF.js +190 -0
- package/dist/chunk-COP2K4LF.js.map +1 -0
- package/dist/{chunk-NC2V63EL.js → chunk-FNM7JYME.js} +88 -21
- package/dist/chunk-FNM7JYME.js.map +1 -0
- package/dist/{chunk-WC43OQMR.js → chunk-IFYJDX3J.js} +867 -1260
- package/dist/chunk-IFYJDX3J.js.map +1 -0
- package/dist/chunk-L7FHRORY.js +763 -0
- package/dist/chunk-L7FHRORY.js.map +1 -0
- package/dist/{chunk-4QVG4WJQ.js → chunk-OYTMILRK.js} +10 -3
- package/dist/chunk-OYTMILRK.js.map +1 -0
- package/dist/{chunk-OYGM5WLD.js → chunk-PURHUAOR.js} +52 -15
- package/dist/chunk-PURHUAOR.js.map +1 -0
- package/dist/{chunk-AWPK7ZDS.js → chunk-QGOU3VXH.js} +3 -3
- package/dist/{chunk-OTLEYHOG.js → chunk-RRH23CGS.js} +24 -4
- package/dist/chunk-RRH23CGS.js.map +1 -0
- package/dist/{chunk-5FAKBTCK.js → chunk-XDB7IBYE.js} +22 -1
- package/dist/chunk-XDB7IBYE.js.map +1 -0
- package/dist/design-canvas-react/engine.d.ts +15 -1
- package/dist/design-canvas-react/engine.js +6 -2
- package/dist/design-canvas-react/index.d.ts +13 -1
- package/dist/design-canvas-react/index.js +13 -8
- package/dist/design-canvas-react/index.js.map +1 -1
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/preflight/cli.js +2 -1
- package/dist/preflight/cli.js.map +1 -1
- package/dist/preflight/index.d.ts +35 -2
- package/dist/preflight/index.js +6 -3
- package/dist/sandbox/index.d.ts +11 -1
- package/dist/sandbox/index.js +1 -1
- package/dist/teams/index.js +5 -5
- package/dist/teams/invitations-api.js +4 -4
- package/dist/web-react/index.d.ts +26 -35
- package/dist/web-react/index.js +10 -10
- package/package.json +19 -3
- package/dist/chunk-4QVG4WJQ.js.map +0 -1
- package/dist/chunk-5FAKBTCK.js.map +0 -1
- package/dist/chunk-E4DHYENH.js +0 -292
- package/dist/chunk-E4DHYENH.js.map +0 -1
- package/dist/chunk-NC2V63EL.js.map +0 -1
- package/dist/chunk-OTLEYHOG.js.map +0 -1
- package/dist/chunk-OYGM5WLD.js.map +0 -1
- package/dist/chunk-WC43OQMR.js.map +0 -1
- /package/dist/{DesignCanvas-3RRPVPCP.js.map → DesignCanvas-RSWQCXM3.js.map} +0 -0
- /package/dist/{DesignCanvasEditor-KAMMEX7E.js.map → DesignCanvasEditor-XZMGIST7.js.map} +0 -0
- /package/dist/{chunk-AWPK7ZDS.js.map → chunk-QGOU3VXH.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DesignCanvas
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FNM7JYME.js";
|
|
4
4
|
import "./chunk-X5DQ5QOP.js";
|
|
5
5
|
import "./chunk-DRB77FYL.js";
|
|
6
6
|
import "./chunk-F7VH4G5C.js";
|
|
7
7
|
export {
|
|
8
8
|
DesignCanvas
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=DesignCanvas-
|
|
10
|
+
//# sourceMappingURL=DesignCanvas-RSWQCXM3.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DesignCanvasEditor
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-PURHUAOR.js";
|
|
4
|
+
import "./chunk-FNM7JYME.js";
|
|
5
5
|
import "./chunk-LSQR6HM6.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-OYTMILRK.js";
|
|
7
7
|
import "./chunk-X5DQ5QOP.js";
|
|
8
8
|
import "./chunk-DRB77FYL.js";
|
|
9
9
|
import "./chunk-F7VH4G5C.js";
|
|
10
10
|
export {
|
|
11
11
|
DesignCanvasEditor
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=DesignCanvasEditor-
|
|
13
|
+
//# sourceMappingURL=DesignCanvasEditor-XZMGIST7.js.map
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
import { F as FileMention } from './wire-DOZ-O6hD.js';
|
|
4
|
+
import { Harness } from './harness/index.js';
|
|
5
|
+
import { CatalogModel } from './catalog/index.js';
|
|
3
6
|
|
|
4
7
|
/**
|
|
5
8
|
* `useFileMentions` — the glue a host passes straight into `AgentComposer`'s
|
|
@@ -95,4 +98,32 @@ interface UseFileMentionsResult {
|
|
|
95
98
|
/** Resolve and manage file mention data with configurable fetching and state handling */
|
|
96
99
|
declare function useFileMentions(options: UseFileMentionsOptions): UseFileMentionsResult;
|
|
97
100
|
|
|
98
|
-
|
|
101
|
+
interface AgentSessionControlsProps {
|
|
102
|
+
/** Catalog models — canonical provider-prefixed ids. */
|
|
103
|
+
models: CatalogModel[];
|
|
104
|
+
modelsLoading?: boolean;
|
|
105
|
+
/** Selected canonical model id. */
|
|
106
|
+
model: string;
|
|
107
|
+
onModelChange(modelId: string): void;
|
|
108
|
+
/** Current harness; harness↔model coherence is enforced on every change. */
|
|
109
|
+
harness: Harness;
|
|
110
|
+
onHarnessChange(harness: Harness): void;
|
|
111
|
+
/** Harnesses to offer; defaults to the labeled set. */
|
|
112
|
+
availableHarnesses?: ReadonlyArray<Harness>;
|
|
113
|
+
/** Reasoning-effort value + setter. Shown only when the selected model
|
|
114
|
+
* `supportsReasoning`, matching `EffortPicker`'s guidance. */
|
|
115
|
+
effort: string;
|
|
116
|
+
onEffortChange(effort: string): void;
|
|
117
|
+
/**
|
|
118
|
+
* `inline` (default): model, harness, effort side by side — the prior
|
|
119
|
+
* behavior. `compact`: model inline, harness + effort behind a gear popover.
|
|
120
|
+
*/
|
|
121
|
+
layout?: 'inline' | 'compact';
|
|
122
|
+
/** Hide the harness control entirely (single-harness products). */
|
|
123
|
+
showHarness?: boolean;
|
|
124
|
+
renderProviderBadge?: (provider: string) => ReactNode;
|
|
125
|
+
className?: string;
|
|
126
|
+
}
|
|
127
|
+
declare function AgentSessionControls(props: AgentSessionControlsProps): react.JSX.Element;
|
|
128
|
+
|
|
129
|
+
export { type AgentSessionControlsProps as A, type ComposerMentionProp as C, DEFAULT_MENTION_EMPTY_TEXT as D, INDEX_REFRESH_AFTER_MS as I, type MentionItem as M, type UseFileMentionsResult as U, AgentSessionControls as a, DEFAULT_MENTION_LIMIT as b, type UseFileMentionsOptions as c, rankFileMentions as r, useFileMentions as u };
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/alerting` — post an operational alert to Slack, and say honestly when it
|
|
3
|
+
* did not arrive.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS: on 2026-08-06 an audit of every Slack credential the org
|
|
6
|
+
* held found three of four dead — the fleet incoming webhook 404ing
|
|
7
|
+
* (`no_service`), a second company webhook likewise, and the bot token
|
|
8
|
+
* answering `account_inactive`. One ops webhook was still live. Nobody knew
|
|
9
|
+
* which was which until each was tested by hand, and that is the actual
|
|
10
|
+
* problem: the credentials were indistinguishable from where the code stood.
|
|
11
|
+
*
|
|
12
|
+
* This failure has already been paid for once, with numbers: in
|
|
13
|
+
* `agent-dev-container`, a revoked webhook let the CI healthcheck sit dead for
|
|
14
|
+
* 18 days — 2,567 consecutive failures, 27 successes, zero alerts — because
|
|
15
|
+
* fifteen call sites across six workflows posted with no body inspection and
|
|
16
|
+
* then asserted delivery. That repo fixed the reporting (its `post-slack.sh`
|
|
17
|
+
* confirms 2xx AND Slack's literal `ok` body, and fails closed otherwise) and
|
|
18
|
+
* that half of the lesson is theirs, adopted here.
|
|
19
|
+
*
|
|
20
|
+
* What their fix cannot do, and this module can, is answer the question BEFORE
|
|
21
|
+
* an alert needs to fire. A fail-closed post still only discovers a dead
|
|
22
|
+
* credential at the moment a page is lost. That is the second half.
|
|
23
|
+
*
|
|
24
|
+
* Two design consequences, and they are the whole module:
|
|
25
|
+
*
|
|
26
|
+
* 1. **A bot token and `chat.postMessage` is the preferred transport; an
|
|
27
|
+
* incoming webhook is supported because one is usually what you already
|
|
28
|
+
* have.** A token reaches every channel (a webhook is bolted to one), is
|
|
29
|
+
* revocable and rotatable in place, and — the part that matters — is
|
|
30
|
+
* VERIFIABLE: `auth.test` answers whether the credential is alive without
|
|
31
|
+
* posting anything, which is what lets `/preflight` fail a deploy on a dead
|
|
32
|
+
* alerting channel instead of discovering it during an incident. A webhook
|
|
33
|
+
* can only be tested by posting to it, which is why the three dead
|
|
34
|
+
* credentials above went unnoticed. A token is never fallen back FROM: if
|
|
35
|
+
* one is configured and dead, delivering over a webhook instead would hide
|
|
36
|
+
* the very condition worth reporting.
|
|
37
|
+
*
|
|
38
|
+
* 2. **Slack answers `ok:false` under HTTP 200.** `invalid_auth`,
|
|
39
|
+
* `channel_not_found` and `not_in_channel` all arrive as a successful
|
|
40
|
+
* response with a failure inside it, so a status check reads a dead channel
|
|
41
|
+
* as a delivered page. The body is always parsed, and the outcome
|
|
42
|
+
* distinguishes a MISSING credential (configuration absent — not an
|
|
43
|
+
* incident) from a DEAD one (the alerting channel itself is broken — the
|
|
44
|
+
* loudest thing this module can report). A summary that calls those two the
|
|
45
|
+
* same thing is the defect wearing a different hat.
|
|
46
|
+
*
|
|
47
|
+
* The caller decides what to do with a non-delivery; this module never throws
|
|
48
|
+
* on one, because an alerting path that can take down the thing it reports on
|
|
49
|
+
* is worse than the outage it was watching for. It is also never the only
|
|
50
|
+
* channel: a durable record (an issue, an audit row) is the caller's job, and
|
|
51
|
+
* that is what survives the credential going dead again.
|
|
52
|
+
*
|
|
53
|
+
* Server-only: holds a bot token. This subpath must never reach a browser
|
|
54
|
+
* bundle.
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* Why an alert did not reach Slack. The split is by what a human must DO about
|
|
58
|
+
* it, since that is the only distinction a caller can act on.
|
|
59
|
+
*/
|
|
60
|
+
type SlackFailureReason =
|
|
61
|
+
/** No token or no channel configured. Configuration is absent, nothing is broken. */
|
|
62
|
+
'not-configured'
|
|
63
|
+
/**
|
|
64
|
+
* The token is dead — revoked, or its app removed from the workspace. No
|
|
65
|
+
* alert will EVER arrive until a human mints a new one. This is itself an
|
|
66
|
+
* incident and the caller should escalate it on a channel that does not
|
|
67
|
+
* depend on Slack.
|
|
68
|
+
*/
|
|
69
|
+
| 'credential'
|
|
70
|
+
/**
|
|
71
|
+
* The credential is alive but cannot post HERE: the channel is wrong,
|
|
72
|
+
* archived, or the bot was never invited to it. One human action fixes it.
|
|
73
|
+
*/
|
|
74
|
+
| 'channel'
|
|
75
|
+
/** Slack asked us to slow down. Transient; the alert is worth retrying. */
|
|
76
|
+
| 'rate-limited'
|
|
77
|
+
/** The request never got an answer — network, DNS, timeout. Transient. */
|
|
78
|
+
| 'transport'
|
|
79
|
+
/** Slack refused for some other reason; `detail` carries its error code. */
|
|
80
|
+
| 'api';
|
|
81
|
+
/** An alert that did not arrive, and why. Named because the classifiers only ever produce this half. */
|
|
82
|
+
interface SlackAlertFailure {
|
|
83
|
+
delivered: false;
|
|
84
|
+
reason: SlackFailureReason;
|
|
85
|
+
/** One line naming what is wrong and what fixes it. Safe to log; carries no token. */
|
|
86
|
+
detail: string;
|
|
87
|
+
}
|
|
88
|
+
/** What one `postSlackAlert` call did. Never a bare boolean — the caller pages differently per reason. */
|
|
89
|
+
type SlackAlertOutcome = {
|
|
90
|
+
delivered: true;
|
|
91
|
+
/** The channel id Slack resolved (not necessarily the name that was passed). */
|
|
92
|
+
channel: string;
|
|
93
|
+
/** Slack's message timestamp — the message's identity, for a later thread reply. */
|
|
94
|
+
ts: string;
|
|
95
|
+
} | SlackAlertFailure;
|
|
96
|
+
/** Define configuration options for posting an alert message to a Slack channel */
|
|
97
|
+
interface SlackAlertOptions {
|
|
98
|
+
/**
|
|
99
|
+
* Slack bot token (`xoxb-…`) with `chat:write`. The PREFERRED transport,
|
|
100
|
+
* because it is the only one whose liveness can be checked before an alert
|
|
101
|
+
* needs it. An empty or absent value is `not-configured`, never an error — a
|
|
102
|
+
* product that has not adopted Slack yet must not fail its alerting path.
|
|
103
|
+
*/
|
|
104
|
+
token?: string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Channel to post to: a name (`#infra-alerts`) or an id (`C01234567`). The
|
|
107
|
+
* bot must be a member; Slack answers `not_in_channel` otherwise. Required
|
|
108
|
+
* with `token`, meaningless with `webhookUrl` (a webhook carries its own
|
|
109
|
+
* channel, fixed when it was created).
|
|
110
|
+
*/
|
|
111
|
+
channel?: string | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* Slack incoming-webhook URL, used only when no `token` is configured.
|
|
114
|
+
*
|
|
115
|
+
* It works and it needs no setup, which is why it is supported — but it
|
|
116
|
+
* cannot be verified without posting, cannot be pointed at a second channel,
|
|
117
|
+
* and gives back an error token instead of a code. Two of the three webhooks
|
|
118
|
+
* this org has held were found revoked. Treat it as the transport you have,
|
|
119
|
+
* not the one you want.
|
|
120
|
+
*
|
|
121
|
+
* When a `token` is also configured this is IGNORED rather than used as a
|
|
122
|
+
* fallback: a dead token must surface as the incident it is, and quietly
|
|
123
|
+
* succeeding over a second transport is how the last outage stayed invisible.
|
|
124
|
+
*/
|
|
125
|
+
webhookUrl?: string | undefined;
|
|
126
|
+
/** Message body as Slack mrkdwn. Newlines are preserved. */
|
|
127
|
+
text: string;
|
|
128
|
+
/**
|
|
129
|
+
* Attempts for a TRANSIENT failure (429 / 5xx / transport). Default 3. A
|
|
130
|
+
* dead credential or a wrong channel is never retried — the answer will not
|
|
131
|
+
* change, and retrying an auth failure is how a token gets rate-limited.
|
|
132
|
+
*/
|
|
133
|
+
attempts?: number;
|
|
134
|
+
/** Per-request deadline. Default 10s. */
|
|
135
|
+
timeoutMs?: number;
|
|
136
|
+
/** Injection seam for tests; defaults to global `fetch`. */
|
|
137
|
+
fetchImpl?: typeof fetch;
|
|
138
|
+
/** Injection seam for tests; defaults to a real delay between retries. */
|
|
139
|
+
sleepImpl?: (ms: number) => Promise<void>;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Post one alert to a Slack channel.
|
|
143
|
+
*
|
|
144
|
+
* Never throws and never retries a failure whose answer cannot change. The
|
|
145
|
+
* returned outcome is the whole result — a caller that ignores it has an
|
|
146
|
+
* alerting path it cannot prove works, which is the failure this module was
|
|
147
|
+
* written for.
|
|
148
|
+
*/
|
|
149
|
+
declare function postSlackAlert(options: SlackAlertOptions): Promise<SlackAlertOutcome>;
|
|
150
|
+
/** Define configuration options for verifying that a Slack bot token is live */
|
|
151
|
+
interface SlackCredentialCheckOptions {
|
|
152
|
+
token: string | undefined;
|
|
153
|
+
/** Per-request deadline. Default 10s. */
|
|
154
|
+
timeoutMs?: number;
|
|
155
|
+
/** Injection seam for tests; defaults to global `fetch`. */
|
|
156
|
+
fetchImpl?: typeof fetch;
|
|
157
|
+
}
|
|
158
|
+
/** What `checkSlackCredential` concluded. `team`/`botId` are present only when live. */
|
|
159
|
+
type SlackCredentialVerdict = {
|
|
160
|
+
live: true;
|
|
161
|
+
team: string;
|
|
162
|
+
botId: string;
|
|
163
|
+
} | {
|
|
164
|
+
live: false;
|
|
165
|
+
reason: SlackFailureReason;
|
|
166
|
+
detail: string;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Ask Slack whether the bot token is alive, WITHOUT posting anything.
|
|
170
|
+
*
|
|
171
|
+
* This is the check that was missing. An incoming webhook offers no equivalent
|
|
172
|
+
* — the only way to test one is to post to it — which is how a revoked webhook
|
|
173
|
+
* sat in a repo secret for months looking configured. Wire it into `/preflight`
|
|
174
|
+
* so a dead alerting channel fails a deploy rather than an incident.
|
|
175
|
+
*/
|
|
176
|
+
declare function checkSlackCredential(options: SlackCredentialCheckOptions): Promise<SlackCredentialVerdict>;
|
|
177
|
+
|
|
178
|
+
export { type SlackAlertFailure, type SlackAlertOptions, type SlackAlertOutcome, type SlackCredentialCheckOptions, type SlackCredentialVerdict, type SlackFailureReason, checkSlackCredential, postSlackAlert };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { ToolDetailRenderers, ChatUiMessage } from '../web-react/index.js';
|
|
3
|
+
import { ToolDetailRenderers, ComposerFile, ChatUiMessage } from '../web-react/index.js';
|
|
4
4
|
import '../contract-OxG_jVMx.js';
|
|
5
5
|
import '@tangle-network/agent-interface';
|
|
6
6
|
import '../plans/index.js';
|
|
7
7
|
import '../parts-BqIHMdyu.js';
|
|
8
8
|
import '../types-CCeYywdS.js';
|
|
9
9
|
import '../wire-DOZ-O6hD.js';
|
|
10
|
-
import '../
|
|
10
|
+
import '../agent-session-controls-BwImzYKC.js';
|
|
11
|
+
import '../harness/index.js';
|
|
12
|
+
import '../catalog/index.js';
|
|
11
13
|
import '../agent-activity-C8ZG0F0M.js';
|
|
12
14
|
import '../flow-types-CJxEmaRy.js';
|
|
13
15
|
import '../queue-VTBA5ONX.js';
|
|
@@ -16,8 +18,6 @@ import '../billing-BibxgALe.js';
|
|
|
16
18
|
import '../billing/index.js';
|
|
17
19
|
import '../session-shell/index.js';
|
|
18
20
|
import '../web-react/async/index.js';
|
|
19
|
-
import '../catalog/index.js';
|
|
20
|
-
import '../harness/index.js';
|
|
21
21
|
import '../attachment-validation-BfJDBU1g.js';
|
|
22
22
|
import '../stream-normalizer-DKRxyVlZ.js';
|
|
23
23
|
|
|
@@ -609,43 +609,6 @@ interface AssistantThreads {
|
|
|
609
609
|
/** Resolve and manage assistant threads state for a given user including pending deletions and refresh logic */
|
|
610
610
|
declare function useAssistantThreads(userId: string | null): AssistantThreads;
|
|
611
611
|
|
|
612
|
-
interface AssistantDockProps {
|
|
613
|
-
/** The signed-in user this conversation belongs to (null when signed out). */
|
|
614
|
-
userId: string | null;
|
|
615
|
-
/** Host navigation for error CTAs and connect targets. */
|
|
616
|
-
navigate?: (path: string) => void;
|
|
617
|
-
balanceUsd?: number | null;
|
|
618
|
-
formatMoney?: (usd: number | null) => string;
|
|
619
|
-
/** Render workflow YAML as a node graph in a proposal card. */
|
|
620
|
-
renderGraph?: (yaml: string) => ReactNode;
|
|
621
|
-
/** Render the brand icon for a proposal requirement's integration provider.
|
|
622
|
-
* The host owns the provider→icon mapping (its integrations catalog); when
|
|
623
|
-
* absent, the card falls back to its built-in provider mark. */
|
|
624
|
-
renderProviderIcon?: (provider: string) => ReactNode;
|
|
625
|
-
/** Called after a workflow-mutating tool is confirmed (host re-fetches its list). */
|
|
626
|
-
onWorkflowMutation?: () => void;
|
|
627
|
-
/** In-place connect handler for a proposal's integration requirements. The host
|
|
628
|
-
* runs its own connect flow (OAuth popup, api-key modal, app install) and
|
|
629
|
-
* resolves whether the requirement is now satisfied; the proposal card then
|
|
630
|
-
* flips it to connected. Host-agnostic — when omitted, the card falls back to
|
|
631
|
-
* navigating the requirement's connect target via `navigate`. */
|
|
632
|
-
onConnectRequirement?: (requirement: ConnectionRequirement) => Promise<ConnectRequirementResult>;
|
|
633
|
-
/** Markdown renderer for assistant message content (plain text when absent). */
|
|
634
|
-
renderMarkdown?: (content: string) => ReactNode;
|
|
635
|
-
/** Per-tool custom detail renderers for expanded tool cards in the transcript. */
|
|
636
|
-
toolRenderers?: ToolDetailRenderers;
|
|
637
|
-
/** Render a prominent card for a CONFIRMED tool's result (e.g. a one-time
|
|
638
|
-
* API-key reveal for `create_api_key`), shown inline after the action's status
|
|
639
|
-
* line. The result's `output` may carry a one-time secret — see
|
|
640
|
-
* {@link ConfirmedResult} for the never-persist/never-to-model contract. */
|
|
641
|
-
renderConfirmedResult?: (result: ConfirmedResult) => ReactNode;
|
|
642
|
-
/** Swap the conversation rendering for a host-supplied renderer (see
|
|
643
|
-
* {@link AssistantPanelProps.renderTranscript}); the dock chrome, composer,
|
|
644
|
-
* transport, and proposal flow stay owned by the panel. */
|
|
645
|
-
renderTranscript?: (view: AssistantTranscriptView) => ReactNode;
|
|
646
|
-
}
|
|
647
|
-
declare function AssistantDock({ userId, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, onWorkflowMutation, onConnectRequirement, renderMarkdown, toolRenderers, renderConfirmedResult, renderTranscript, }: AssistantDockProps): react.JSX.Element;
|
|
648
|
-
|
|
649
612
|
interface AssistantPanelProps {
|
|
650
613
|
chat: AssistantChat;
|
|
651
614
|
userId: string | null;
|
|
@@ -684,8 +647,68 @@ interface AssistantPanelProps {
|
|
|
684
647
|
* clears its seed state (consume-once). */
|
|
685
648
|
composerSeed?: string | null;
|
|
686
649
|
onComposerSeedApplied?: () => void;
|
|
650
|
+
/** Opt-in attachment surface for the composer, mirroring `ChatComposer`'s
|
|
651
|
+
* attachment props: pass `onAttach` to show the attach button and accept
|
|
652
|
+
* drag-and-drop, and drive the staged-file chips with `pendingFiles` /
|
|
653
|
+
* `onRemoveFile` (web-react's `useComposerAttachments` owns that lifecycle).
|
|
654
|
+
* Omitted, the composer stays text-only. The assistant wire carries text
|
|
655
|
+
* only, so a host that stages files owns getting their content to the model
|
|
656
|
+
* (e.g. inlined on the next `chat.send`); `onComposerSend` is the signal to
|
|
657
|
+
* consume and clear the staged set. */
|
|
658
|
+
composerAttachments?: {
|
|
659
|
+
onAttach: (files: FileList) => void;
|
|
660
|
+
onAttachFolder?: (files: FileList) => void;
|
|
661
|
+
pendingFiles?: ComposerFile[];
|
|
662
|
+
onRemoveFile?: (id: string) => void;
|
|
663
|
+
accept?: string;
|
|
664
|
+
};
|
|
665
|
+
/** Fired when the composer sends (alongside `chat.send`) — the host's signal
|
|
666
|
+
* to consume and clear its staged attachments. */
|
|
667
|
+
onComposerSend?: (message: string) => void;
|
|
668
|
+
}
|
|
669
|
+
declare function AssistantPanel({ chat, userId, onClose, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, renderMarkdown, toolRenderers, renderConfirmedResult, renderTranscript, composerSeed, onComposerSeedApplied, composerAttachments, onComposerSend, }: AssistantPanelProps): react.JSX.Element;
|
|
670
|
+
|
|
671
|
+
interface AssistantDockProps {
|
|
672
|
+
/** The signed-in user this conversation belongs to (null when signed out). */
|
|
673
|
+
userId: string | null;
|
|
674
|
+
/** Host navigation for error CTAs and connect targets. */
|
|
675
|
+
navigate?: (path: string) => void;
|
|
676
|
+
balanceUsd?: number | null;
|
|
677
|
+
formatMoney?: (usd: number | null) => string;
|
|
678
|
+
/** Render workflow YAML as a node graph in a proposal card. */
|
|
679
|
+
renderGraph?: (yaml: string) => ReactNode;
|
|
680
|
+
/** Render the brand icon for a proposal requirement's integration provider.
|
|
681
|
+
* The host owns the provider→icon mapping (its integrations catalog); when
|
|
682
|
+
* absent, the card falls back to its built-in provider mark. */
|
|
683
|
+
renderProviderIcon?: (provider: string) => ReactNode;
|
|
684
|
+
/** Called after a workflow-mutating tool is confirmed (host re-fetches its list). */
|
|
685
|
+
onWorkflowMutation?: () => void;
|
|
686
|
+
/** In-place connect handler for a proposal's integration requirements. The host
|
|
687
|
+
* runs its own connect flow (OAuth popup, api-key modal, app install) and
|
|
688
|
+
* resolves whether the requirement is now satisfied; the proposal card then
|
|
689
|
+
* flips it to connected. Host-agnostic — when omitted, the card falls back to
|
|
690
|
+
* navigating the requirement's connect target via `navigate`. */
|
|
691
|
+
onConnectRequirement?: (requirement: ConnectionRequirement) => Promise<ConnectRequirementResult>;
|
|
692
|
+
/** Markdown renderer for assistant message content (plain text when absent). */
|
|
693
|
+
renderMarkdown?: (content: string) => ReactNode;
|
|
694
|
+
/** Per-tool custom detail renderers for expanded tool cards in the transcript. */
|
|
695
|
+
toolRenderers?: ToolDetailRenderers;
|
|
696
|
+
/** Render a prominent card for a CONFIRMED tool's result (e.g. a one-time
|
|
697
|
+
* API-key reveal for `create_api_key`), shown inline after the action's status
|
|
698
|
+
* line. The result's `output` may carry a one-time secret — see
|
|
699
|
+
* {@link ConfirmedResult} for the never-persist/never-to-model contract. */
|
|
700
|
+
renderConfirmedResult?: (result: ConfirmedResult) => ReactNode;
|
|
701
|
+
/** Swap the conversation rendering for a host-supplied renderer (see
|
|
702
|
+
* {@link AssistantPanelProps.renderTranscript}); the dock chrome, composer,
|
|
703
|
+
* transport, and proposal flow stay owned by the panel. */
|
|
704
|
+
renderTranscript?: (view: AssistantTranscriptView) => ReactNode;
|
|
705
|
+
/** Opt-in attachment surface for the dock's composer — forwarded to
|
|
706
|
+
* {@link AssistantPanelProps.composerAttachments}. */
|
|
707
|
+
composerAttachments?: AssistantPanelProps["composerAttachments"];
|
|
708
|
+
/** Forwarded to {@link AssistantPanelProps.onComposerSend}. */
|
|
709
|
+
onComposerSend?: AssistantPanelProps["onComposerSend"];
|
|
687
710
|
}
|
|
688
|
-
declare function
|
|
711
|
+
declare function AssistantDock({ userId, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, onWorkflowMutation, onConnectRequirement, renderMarkdown, toolRenderers, renderConfirmedResult, renderTranscript, composerAttachments, onComposerSend, }: AssistantDockProps): react.JSX.Element;
|
|
689
712
|
|
|
690
713
|
/**
|
|
691
714
|
* True while a turn is streaming but the model hasn't emitted its first answer
|
package/dist/assistant/index.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AsyncView
|
|
3
|
-
} from "../chunk-YIQHOAHN.js";
|
|
4
1
|
import {
|
|
5
2
|
ChatComposer,
|
|
6
|
-
ChatMessages
|
|
7
|
-
|
|
8
|
-
ProviderLogo
|
|
9
|
-
} from "../chunk-WC43OQMR.js";
|
|
3
|
+
ChatMessages
|
|
4
|
+
} from "../chunk-IFYJDX3J.js";
|
|
10
5
|
import "../chunk-FBVLEGEG.js";
|
|
11
6
|
import "../chunk-HZ4WCA37.js";
|
|
12
7
|
import "../chunk-GEYACSFW.js";
|
|
13
|
-
import
|
|
8
|
+
import {
|
|
9
|
+
ModelPicker,
|
|
10
|
+
ProviderLogo
|
|
11
|
+
} from "../chunk-L7FHRORY.js";
|
|
14
12
|
import "../chunk-BATKJP3P.js";
|
|
13
|
+
import {
|
|
14
|
+
AsyncView
|
|
15
|
+
} from "../chunk-YIQHOAHN.js";
|
|
15
16
|
import "../chunk-PC2WYTK7.js";
|
|
16
17
|
import "../chunk-QY4BRKRJ.js";
|
|
17
18
|
import "../chunk-CCVG2TL6.js";
|
|
@@ -2391,7 +2392,9 @@ function AssistantPanel({
|
|
|
2391
2392
|
renderConfirmedResult,
|
|
2392
2393
|
renderTranscript,
|
|
2393
2394
|
composerSeed = null,
|
|
2394
|
-
onComposerSeedApplied
|
|
2395
|
+
onComposerSeedApplied,
|
|
2396
|
+
composerAttachments,
|
|
2397
|
+
onComposerSend
|
|
2395
2398
|
}) {
|
|
2396
2399
|
const models = useAssistantModels();
|
|
2397
2400
|
const threads = useAssistantThreads(userId);
|
|
@@ -2712,6 +2715,7 @@ function AssistantPanel({
|
|
|
2712
2715
|
onSend: (message) => {
|
|
2713
2716
|
setView("chat");
|
|
2714
2717
|
chat.send(message);
|
|
2718
|
+
onComposerSend?.(message);
|
|
2715
2719
|
},
|
|
2716
2720
|
onCancel: chat.stop,
|
|
2717
2721
|
isStreaming: streaming,
|
|
@@ -2719,6 +2723,11 @@ function AssistantPanel({
|
|
|
2719
2723
|
placeholder: "Message the assistant\u2026",
|
|
2720
2724
|
seed: composerSeed,
|
|
2721
2725
|
onSeedApplied: onComposerSeedApplied,
|
|
2726
|
+
onAttach: composerAttachments?.onAttach,
|
|
2727
|
+
onAttachFolder: composerAttachments?.onAttachFolder,
|
|
2728
|
+
pendingFiles: composerAttachments?.pendingFiles,
|
|
2729
|
+
onRemoveFile: composerAttachments?.onRemoveFile,
|
|
2730
|
+
accept: composerAttachments?.accept,
|
|
2722
2731
|
controls: pickerModels.length > 0 ? /* @__PURE__ */ jsx5(
|
|
2723
2732
|
ModelPicker,
|
|
2724
2733
|
{
|
|
@@ -2868,7 +2877,9 @@ function AssistantDock({
|
|
|
2868
2877
|
renderMarkdown,
|
|
2869
2878
|
toolRenderers,
|
|
2870
2879
|
renderConfirmedResult,
|
|
2871
|
-
renderTranscript
|
|
2880
|
+
renderTranscript,
|
|
2881
|
+
composerAttachments,
|
|
2882
|
+
onComposerSend
|
|
2872
2883
|
}) {
|
|
2873
2884
|
const { open, openAssistant, closeAssistant, seed, clearSeed } = useAssistantLauncher();
|
|
2874
2885
|
const chat = useAssistantChat(userId, {
|
|
@@ -2884,7 +2895,13 @@ function AssistantDock({
|
|
|
2884
2895
|
useEffect7(() => {
|
|
2885
2896
|
if (!open) return;
|
|
2886
2897
|
const onKeyDown = (e) => {
|
|
2887
|
-
if (e.key
|
|
2898
|
+
if (e.key !== "Escape") return;
|
|
2899
|
+
if (dialogRef.current?.querySelector(
|
|
2900
|
+
'[aria-haspopup="true"][aria-expanded="true"]'
|
|
2901
|
+
)) {
|
|
2902
|
+
return;
|
|
2903
|
+
}
|
|
2904
|
+
closeAssistant();
|
|
2888
2905
|
};
|
|
2889
2906
|
document.addEventListener("keydown", onKeyDown);
|
|
2890
2907
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
@@ -2982,7 +2999,9 @@ function AssistantDock({
|
|
|
2982
2999
|
renderConfirmedResult,
|
|
2983
3000
|
renderTranscript,
|
|
2984
3001
|
composerSeed: seed,
|
|
2985
|
-
onComposerSeedApplied: clearSeed
|
|
3002
|
+
onComposerSeedApplied: clearSeed,
|
|
3003
|
+
composerAttachments,
|
|
3004
|
+
onComposerSend
|
|
2986
3005
|
},
|
|
2987
3006
|
userId ?? "anon"
|
|
2988
3007
|
),
|