@tangle-network/agent-app 0.63.60 → 0.63.62
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-Q65UV4D5.js → DesignCanvas-566V5KVC.js} +3 -2
- package/dist/{DesignCanvasEditor-THEFESEX.js → DesignCanvasEditor-6XNHSREG.js} +5 -4
- package/dist/agent-profiles/d1.js +3 -3
- package/dist/agent-profiles/index.js +3 -3
- package/dist/app-auth/index.js +2 -1
- package/dist/app-auth/index.js.map +1 -1
- package/dist/assistant/index.js +6 -5
- package/dist/assistant/index.js.map +1 -1
- package/dist/chat-react/index.js +3 -3
- package/dist/chat-routes/agent-producers.d.ts +39 -0
- package/dist/chat-routes/dispatch-parts.d.ts +24 -2
- package/dist/chat-routes/hybrid-producer.d.ts +6 -2
- package/dist/chat-routes/index.d.ts +1 -0
- package/dist/chat-routes/index.js +31 -12
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-routes/turn-admission.d.ts +3 -3
- package/dist/chat-routes/turn-route-contracts.d.ts +39 -1
- package/dist/chat-routes/wire.d.ts +35 -4
- package/dist/chat-store/index.js +4 -2
- package/dist/chat-store/index.js.map +1 -1
- package/dist/chat-store/parts.d.ts +19 -3
- package/dist/{chunk-6XSQCP6W.js → chunk-43CV4JIT.js} +2 -2
- package/dist/{chunk-SFZELD6V.js → chunk-4JTEPK2G.js} +2 -2
- package/dist/{chunk-RILVJYXJ.js → chunk-5ERXADSW.js} +2 -2
- package/dist/{chunk-LAZCUQFZ.js → chunk-73AVOSH6.js} +179 -86
- package/dist/chunk-73AVOSH6.js.map +1 -0
- package/dist/{chunk-HHPQMFKP.js → chunk-7O62NYGT.js} +2 -2
- package/dist/{chunk-GGJYAV7R.js → chunk-AHBVQRJA.js} +2 -2
- package/dist/{chunk-GGJYAV7R.js.map → chunk-AHBVQRJA.js.map} +1 -1
- package/dist/{chunk-UTF7H6BK.js → chunk-EUQ46YWK.js} +15 -15
- package/dist/chunk-EUQ46YWK.js.map +1 -0
- package/dist/{chunk-PIGW5LRM.js → chunk-FJRQCF43.js} +3 -3
- package/dist/{chunk-AICYKYYF.js → chunk-GAYWV565.js} +17 -4
- package/dist/chunk-GAYWV565.js.map +1 -0
- package/dist/{chunk-5C3RXQQ7.js → chunk-H3DAXUKV.js} +2 -2
- package/dist/{chunk-SRA7VAVK.js → chunk-HJYEK4SU.js} +2 -2
- package/dist/{chunk-P7UB7ZVP.js → chunk-IAK227OO.js} +2 -2
- package/dist/{chunk-QGJOT6R6.js → chunk-K2JPSXKI.js} +54 -9
- package/dist/{chunk-QGJOT6R6.js.map → chunk-K2JPSXKI.js.map} +1 -1
- package/dist/{chunk-QFIVY6WA.js → chunk-NJW4JCSF.js} +2 -2
- package/dist/{chunk-IDQ7N36R.js → chunk-Q55WW6DO.js} +15 -15
- package/dist/{chunk-H6BRJU5M.js → chunk-RKNNMC6T.js} +1 -1
- package/dist/{chunk-KFO5R4SN.js → chunk-RYKANV3P.js} +945 -801
- package/dist/chunk-RYKANV3P.js.map +1 -0
- package/dist/{chunk-4E2MUVGL.js → chunk-VQIH5NAB.js} +3 -3
- package/dist/chunk-XBBXPZJI.js +47 -0
- package/dist/chunk-XBBXPZJI.js.map +1 -0
- package/dist/{chunk-DCGATWZ5.js → chunk-XPB2UYHU.js} +5 -5
- package/dist/{chunk-DCGATWZ5.js.map → chunk-XPB2UYHU.js.map} +1 -1
- package/dist/design-canvas/index.js +2 -1
- package/dist/design-canvas/index.js.map +1 -1
- package/dist/design-canvas-react/engine.js +2 -1
- package/dist/design-canvas-react/index.js +5 -4
- package/dist/design-canvas-react/index.js.map +1 -1
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/operator/index.js +2 -2
- package/dist/platform/index.js +2 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/preset-cloudflare/index.js +6 -6
- package/dist/public-consultation/index.d.ts +2 -2
- package/dist/public-consultation/index.js +11 -10
- package/dist/public-consultation/index.js.map +1 -1
- package/dist/sandbox/index.js +6 -6
- package/dist/sequences/index.js +2 -1
- package/dist/sequences/index.js.map +1 -1
- package/dist/stories/chat/fixtures.d.ts +4 -0
- package/dist/theme/brand.generated.d.ts +15 -15
- package/dist/theme/dom.js +2 -2
- package/dist/theme/index.js +1 -1
- package/dist/theme/tokens.css +210 -356
- package/dist/tools/index.js +4 -4
- package/dist/web/index.d.ts +1 -0
- package/dist/web/index.js +7 -1
- package/dist/web/speakers.d.ts +30 -0
- package/dist/web-react/chat-messages.d.ts +1 -1
- package/dist/web-react/chat-stream.d.ts +7 -0
- package/dist/web-react/document.js +2 -2
- package/dist/web-react/entry-composer.d.ts +2 -2
- package/dist/web-react/index.d.ts +3 -0
- package/dist/web-react/index.js +18 -5
- package/dist/web-react/message-projection.d.ts +19 -0
- package/dist/web-react/use-file-mentions.d.ts +23 -4
- package/dist/work-product/index.js +2 -2
- package/dist/workspace-react/index.d.ts +29 -1
- package/dist/workspace-react/index.js +34 -0
- package/dist/workspace-react/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-AICYKYYF.js.map +0 -1
- package/dist/chunk-KFO5R4SN.js.map +0 -1
- package/dist/chunk-LAZCUQFZ.js.map +0 -1
- package/dist/chunk-UTF7H6BK.js.map +0 -1
- /package/dist/{DesignCanvas-Q65UV4D5.js.map → DesignCanvas-566V5KVC.js.map} +0 -0
- /package/dist/{DesignCanvasEditor-THEFESEX.js.map → DesignCanvasEditor-6XNHSREG.js.map} +0 -0
- /package/dist/{chunk-6XSQCP6W.js.map → chunk-43CV4JIT.js.map} +0 -0
- /package/dist/{chunk-SFZELD6V.js.map → chunk-4JTEPK2G.js.map} +0 -0
- /package/dist/{chunk-RILVJYXJ.js.map → chunk-5ERXADSW.js.map} +0 -0
- /package/dist/{chunk-HHPQMFKP.js.map → chunk-7O62NYGT.js.map} +0 -0
- /package/dist/{chunk-PIGW5LRM.js.map → chunk-FJRQCF43.js.map} +0 -0
- /package/dist/{chunk-5C3RXQQ7.js.map → chunk-H3DAXUKV.js.map} +0 -0
- /package/dist/{chunk-SRA7VAVK.js.map → chunk-HJYEK4SU.js.map} +0 -0
- /package/dist/{chunk-P7UB7ZVP.js.map → chunk-IAK227OO.js.map} +0 -0
- /package/dist/{chunk-QFIVY6WA.js.map → chunk-NJW4JCSF.js.map} +0 -0
- /package/dist/{chunk-IDQ7N36R.js.map → chunk-Q55WW6DO.js.map} +0 -0
- /package/dist/{chunk-H6BRJU5M.js.map → chunk-RKNNMC6T.js.map} +0 -0
- /package/dist/{chunk-4E2MUVGL.js.map → chunk-VQIH5NAB.js.map} +0 -0
package/dist/tools/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
outcomeStatus,
|
|
6
6
|
resolveToolCapabilities,
|
|
7
7
|
restrictTaxonomy
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-FJRQCF43.js";
|
|
9
9
|
import {
|
|
10
10
|
DEFAULT_APP_TOOL_PATHS,
|
|
11
11
|
DEFAULT_HEADER_NAMES,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
verifyCapabilityToken,
|
|
25
25
|
verifyExpiringCapabilityToken
|
|
26
26
|
} from "../chunk-O7UX55EU.js";
|
|
27
|
-
import "../chunk-
|
|
27
|
+
import "../chunk-43CV4JIT.js";
|
|
28
28
|
import "../chunk-S5SRJJQG.js";
|
|
29
29
|
import {
|
|
30
30
|
APP_TOOL_NAMES,
|
|
@@ -33,9 +33,9 @@ import {
|
|
|
33
33
|
defineAppTool,
|
|
34
34
|
findCustomTool,
|
|
35
35
|
isAppToolName
|
|
36
|
-
} from "../chunk-
|
|
36
|
+
} from "../chunk-HJYEK4SU.js";
|
|
37
37
|
import "../chunk-UGWQLQDS.js";
|
|
38
|
-
import "../chunk-
|
|
38
|
+
import "../chunk-XPB2UYHU.js";
|
|
39
39
|
import {
|
|
40
40
|
ToolInputError
|
|
41
41
|
} from "../chunk-F4XBNR5L.js";
|
package/dist/web/index.d.ts
CHANGED
package/dist/web/index.js
CHANGED
|
@@ -8,7 +8,11 @@ import {
|
|
|
8
8
|
parseChatStreamErrorEvent,
|
|
9
9
|
parseRetryAfterSeconds,
|
|
10
10
|
readFirstTouchAcquisition
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-RKNNMC6T.js";
|
|
12
|
+
import {
|
|
13
|
+
SPEAKER_ROLE_LABEL,
|
|
14
|
+
expandSpeakerRows
|
|
15
|
+
} from "../chunk-XBBXPZJI.js";
|
|
12
16
|
import {
|
|
13
17
|
createApiKeyFetch
|
|
14
18
|
} from "../chunk-RN4WPTBH.js";
|
|
@@ -46,6 +50,7 @@ import {
|
|
|
46
50
|
export {
|
|
47
51
|
FREE_ROUTE_BUDGETS,
|
|
48
52
|
FreeRouteLimitError,
|
|
53
|
+
SPEAKER_ROLE_LABEL,
|
|
49
54
|
STANDARD_SECURITY_HEADERS,
|
|
50
55
|
WORKSPACE_BUDGET_MULTIPLIER,
|
|
51
56
|
acquisitionFromRequest,
|
|
@@ -57,6 +62,7 @@ export {
|
|
|
57
62
|
clearCookieHeader,
|
|
58
63
|
createApiKeyFetch,
|
|
59
64
|
createRateLimiterBinding,
|
|
65
|
+
expandSpeakerRows,
|
|
60
66
|
extractRequestContext,
|
|
61
67
|
firstTouchAcquisitionCookie,
|
|
62
68
|
freeRouteLimitResponse,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A turn addressed to several agents is persisted as ONE assistant row whose
|
|
3
|
+
* parts carry a `speaker` part before each responder's parts. A transcript
|
|
4
|
+
* draws each answer under its author, so this splits such a row into one row
|
|
5
|
+
* per speaker in stored order. Rows without a speaker part pass through
|
|
6
|
+
* untouched, byte for byte. Pure and renderer-neutral: no React, no DOM.
|
|
7
|
+
*/
|
|
8
|
+
export interface SpeakerRow {
|
|
9
|
+
id: string | number;
|
|
10
|
+
role?: string;
|
|
11
|
+
content: string;
|
|
12
|
+
/** Stored parts; the typed store union and raw records are both read. */
|
|
13
|
+
parts?: ReadonlyArray<unknown>;
|
|
14
|
+
author?: {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
role?: string;
|
|
18
|
+
avatarUrl?: string;
|
|
19
|
+
};
|
|
20
|
+
segments?: unknown;
|
|
21
|
+
toolCalls?: unknown;
|
|
22
|
+
}
|
|
23
|
+
export interface Speaker {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
handle?: string;
|
|
27
|
+
}
|
|
28
|
+
/** The role label a split row shows beside the agent's name. */
|
|
29
|
+
export declare const SPEAKER_ROLE_LABEL = "Agent";
|
|
30
|
+
export declare function expandSpeakerRows<T extends SpeakerRow>(rows: readonly T[]): Array<T & Pick<SpeakerRow, 'author'>>;
|
|
@@ -14,4 +14,4 @@ export declare function useThinkingSeconds(active: boolean): number;
|
|
|
14
14
|
* reader's `viewerId`: the reader's own messages stay right-aligned, everyone
|
|
15
15
|
* else's are named, and a named agent replaces the agent label.
|
|
16
16
|
*/
|
|
17
|
-
export declare function ChatMessages({ messages, messageSize, chrome, models, renderMarkdown, renderExtras, durableCards, userLabel, agentLabel, loading, turnPhase, approval, onToolCallClick, toolRenderers, error, onRetry, renderEmpty, emptyState, header, resolveAttachmentUrl, workProductCards, viewerId, }: ChatMessagesProps): import("react").JSX.Element;
|
|
17
|
+
export declare function ChatMessages({ messages: storedMessages, messageSize, chrome, models, renderMarkdown, renderExtras, durableCards, userLabel, agentLabel, loading, turnPhase, approval, onToolCallClick, toolRenderers, error, onRetry, renderEmpty, emptyState, header, resolveAttachmentUrl, workProductCards, viewerId, }: ChatMessagesProps): import("react").JSX.Element;
|
|
@@ -44,6 +44,13 @@ export interface ChatStreamCallbacks {
|
|
|
44
44
|
/** The turn's intent line (`session.run.intent`): show it as a labeled status line until the first `onText`. */
|
|
45
45
|
onIntent?: (intent: TurnIntentData) => void;
|
|
46
46
|
onText?: (delta: string) => void;
|
|
47
|
+
/** The next responder of a turn addressed to several agents starts: open a
|
|
48
|
+
* new assistant block under this author; text that follows is theirs. */
|
|
49
|
+
onSpeaker?: (speaker: {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
handle?: string;
|
|
53
|
+
}) => void;
|
|
47
54
|
onReasoning?: (delta: string) => void;
|
|
48
55
|
/** The message's reasoning so far, when it started and when it ended, after every reasoning delta and once
|
|
49
56
|
* when thinking ends. Spread it onto `ReasoningRow`. `consumeChatStream` and `streamChatTurn` keep it;
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
THEME_BOOTSTRAP_SCRIPT,
|
|
5
5
|
applyThemeDom,
|
|
6
6
|
shouldFollowSystemTheme
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-4JTEPK2G.js";
|
|
8
8
|
import {
|
|
9
9
|
darkTheme,
|
|
10
10
|
lightTheme,
|
|
11
11
|
themeColor
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-EUQ46YWK.js";
|
|
13
13
|
|
|
14
14
|
// src/web-react/document.tsx
|
|
15
15
|
import { useEffect } from "react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { ComposerFileRejection } from './composer-file-accept';
|
|
3
3
|
import type { UseFileMentionsResult } from './use-file-mentions';
|
|
4
|
-
import type { ChatAttachmentInput,
|
|
4
|
+
import type { ChatAttachmentInput, ChatMention } from '../chat-routes/wire';
|
|
5
5
|
import { type AgentSessionControlsProps } from './agent-session-controls';
|
|
6
6
|
import { type ComposerPlanModeSelection } from './composer-mode-controls';
|
|
7
7
|
export interface EntryComposerProps {
|
|
@@ -60,7 +60,7 @@ export interface EntryComposerProps {
|
|
|
60
60
|
/** Block submit until a persisted selection has resolved against the catalog,
|
|
61
61
|
* so the first turn cannot go out under the wrong model. Defaults to true. */
|
|
62
62
|
ready?: boolean;
|
|
63
|
-
onSubmit: (prompt: string, attachments: ChatAttachmentInput[], mentions:
|
|
63
|
+
onSubmit: (prompt: string, attachments: ChatAttachmentInput[], mentions: ChatMention[]) => void;
|
|
64
64
|
className?: string;
|
|
65
65
|
composerClassName?: string;
|
|
66
66
|
/** Max width of the centered column. Defaults to the fleet's 820px. */
|
|
@@ -47,6 +47,9 @@ export * from './durable-interaction-submit';
|
|
|
47
47
|
export * from './use-chat-interactions';
|
|
48
48
|
export * from './use-file-mentions';
|
|
49
49
|
export * from './chat-mentions';
|
|
50
|
+
export * from './message-projection';
|
|
51
|
+
export { agentHandle, AGENT_HANDLE_PATTERN } from '../chat-routes/wire';
|
|
52
|
+
export type { AgentMention, ChatMention } from '../chat-routes/wire';
|
|
50
53
|
export * from './mention-pill';
|
|
51
54
|
export * from './entry-composer';
|
|
52
55
|
export * from './composer-mode-controls';
|
package/dist/web-react/index.js
CHANGED
|
@@ -101,6 +101,7 @@ import {
|
|
|
101
101
|
provenanceStandingMeta,
|
|
102
102
|
provenanceTriggerLabel,
|
|
103
103
|
pruneRecordGridOverlay,
|
|
104
|
+
rankAgentMentions,
|
|
104
105
|
rankFileMentions,
|
|
105
106
|
readRecordGridCell,
|
|
106
107
|
recordGridEditorText,
|
|
@@ -115,6 +116,7 @@ import {
|
|
|
115
116
|
rollUpProvenanceStanding,
|
|
116
117
|
sameRecordGridValue,
|
|
117
118
|
segmentMentionContent,
|
|
119
|
+
segmentsFromParts,
|
|
118
120
|
settleInteractionSubmit,
|
|
119
121
|
sparklineGeometry,
|
|
120
122
|
sparklineLabel,
|
|
@@ -124,6 +126,8 @@ import {
|
|
|
124
126
|
streamChatTurn,
|
|
125
127
|
sumRecordGridColumn,
|
|
126
128
|
terminalizePendingChatInteractions,
|
|
129
|
+
toolCallFromPart,
|
|
130
|
+
toolCallsFromParts,
|
|
127
131
|
trackChatReasoning,
|
|
128
132
|
triggerAttachmentDownload,
|
|
129
133
|
upsertChatInteraction,
|
|
@@ -147,7 +151,7 @@ import {
|
|
|
147
151
|
withoutRecordGridCreated,
|
|
148
152
|
withoutRecordGridRemoved,
|
|
149
153
|
withoutRecordGridUpdate
|
|
150
|
-
} from "../chunk-
|
|
154
|
+
} from "../chunk-73AVOSH6.js";
|
|
151
155
|
import {
|
|
152
156
|
useInfiniteScroll
|
|
153
157
|
} from "../chunk-UHSUY6H6.js";
|
|
@@ -189,7 +193,7 @@ import {
|
|
|
189
193
|
preloadWhenIdle,
|
|
190
194
|
useComposerAttachments,
|
|
191
195
|
useDictation
|
|
192
|
-
} from "../chunk-
|
|
196
|
+
} from "../chunk-AHBVQRJA.js";
|
|
193
197
|
import "../chunk-L7MB2LLM.js";
|
|
194
198
|
import {
|
|
195
199
|
AgentSessionControls,
|
|
@@ -249,8 +253,9 @@ import {
|
|
|
249
253
|
ALLOWED_ATTACHMENT_SNIFFED_MIMES,
|
|
250
254
|
ATTACHMENT_ACCEPT,
|
|
251
255
|
OOXML_SNIFFED_MIMES
|
|
252
|
-
} from "../chunk-
|
|
256
|
+
} from "../chunk-IAK227OO.js";
|
|
253
257
|
import "../chunk-B7CL7ENS.js";
|
|
258
|
+
import "../chunk-XBBXPZJI.js";
|
|
254
259
|
import {
|
|
255
260
|
attachmentInputToPart,
|
|
256
261
|
attachmentKindForMime,
|
|
@@ -258,7 +263,7 @@ import {
|
|
|
258
263
|
isChatAttachmentPart,
|
|
259
264
|
mentionInputToPart,
|
|
260
265
|
mentionPartsFromMessageParts
|
|
261
|
-
} from "../chunk-
|
|
266
|
+
} from "../chunk-GAYWV565.js";
|
|
262
267
|
import "../chunk-ZVEEWGDK.js";
|
|
263
268
|
import {
|
|
264
269
|
attachmentPartKey
|
|
@@ -289,6 +294,7 @@ import {
|
|
|
289
294
|
stampInteractionAnswers
|
|
290
295
|
} from "../chunk-TB6KNPFI.js";
|
|
291
296
|
import {
|
|
297
|
+
AGENT_HANDLE_PATTERN,
|
|
292
298
|
DISPATCH_MAX_MEDIA_PARTS,
|
|
293
299
|
DISPATCH_MAX_PARTS,
|
|
294
300
|
DISPATCH_REQUEST_MAX_BYTES,
|
|
@@ -300,6 +306,7 @@ import {
|
|
|
300
306
|
TURN_RESPONSE_EVENT,
|
|
301
307
|
TURN_ROUTE_PHASE_MESSAGES,
|
|
302
308
|
TURN_STREAM_LOST_CODE,
|
|
309
|
+
agentHandle,
|
|
303
310
|
base64WireLen,
|
|
304
311
|
buildMentionPromptBlock,
|
|
305
312
|
buildTurnPhaseEvent,
|
|
@@ -310,13 +317,14 @@ import {
|
|
|
310
317
|
mediaTypeForMentionPath,
|
|
311
318
|
mentionKindForPath,
|
|
312
319
|
settleTurnResponse
|
|
313
|
-
} from "../chunk-
|
|
320
|
+
} from "../chunk-K2JPSXKI.js";
|
|
314
321
|
import "../chunk-AMUXRAUO.js";
|
|
315
322
|
import "../chunk-PV33JZKV.js";
|
|
316
323
|
import "../chunk-RCSAAWOH.js";
|
|
317
324
|
import "../chunk-4PIN6QYQ.js";
|
|
318
325
|
import "../chunk-TXD5HXLE.js";
|
|
319
326
|
export {
|
|
327
|
+
AGENT_HANDLE_PATTERN,
|
|
320
328
|
AGENT_PROFILE_EDITOR_SECTIONS,
|
|
321
329
|
ALLOWED_ATTACHMENT_SNIFFED_MIMES,
|
|
322
330
|
ATTACHMENT_ACCEPT,
|
|
@@ -415,6 +423,7 @@ export {
|
|
|
415
423
|
__resetAttachmentFileCacheForTests,
|
|
416
424
|
acceptRejectionReason,
|
|
417
425
|
activityTone,
|
|
426
|
+
agentHandle,
|
|
418
427
|
attachmentInputToPart,
|
|
419
428
|
attachmentKindForMime,
|
|
420
429
|
attachmentPartKey,
|
|
@@ -518,6 +527,7 @@ export {
|
|
|
518
527
|
provenanceTriggerLabel,
|
|
519
528
|
pruneRecordGridOverlay,
|
|
520
529
|
questionInteractionContentSignature,
|
|
530
|
+
rankAgentMentions,
|
|
521
531
|
rankFileMentions,
|
|
522
532
|
readRecordGridCell,
|
|
523
533
|
reconcileEffortLevels,
|
|
@@ -535,6 +545,7 @@ export {
|
|
|
535
545
|
rollUpProvenanceStanding,
|
|
536
546
|
sameRecordGridValue,
|
|
537
547
|
segmentMentionContent,
|
|
548
|
+
segmentsFromParts,
|
|
538
549
|
settleInteractionSubmit,
|
|
539
550
|
settleTurnResponse,
|
|
540
551
|
sparklineGeometry,
|
|
@@ -547,6 +558,8 @@ export {
|
|
|
547
558
|
sumRecordGridColumn,
|
|
548
559
|
tabTerminalConnectionId,
|
|
549
560
|
terminalizePendingChatInteractions,
|
|
561
|
+
toolCallFromPart,
|
|
562
|
+
toolCallsFromParts,
|
|
550
563
|
trackChatReasoning,
|
|
551
564
|
triggerAttachmentDownload,
|
|
552
565
|
upsertChatInteraction,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One projection from a message's stored parts to what the transcript draws:
|
|
3
|
+
* the ordered text and tool segments, the tool calls, and the reasoning. A
|
|
4
|
+
* product's history loader and a split speaker row (`expandSpeakerRows`)
|
|
5
|
+
* read the same parts the same way, so an agent's tool timeline renders
|
|
6
|
+
* under that agent whether the row was written by one responder or several.
|
|
7
|
+
* Pure: no React, no DOM.
|
|
8
|
+
*/
|
|
9
|
+
import type { ChatMessageSegment, ChatToolCallInfo } from './chat-message-types';
|
|
10
|
+
/** A stored `tool` part as the card the transcript draws. */
|
|
11
|
+
export declare function toolCallFromPart(part: unknown): ChatToolCallInfo | null;
|
|
12
|
+
/** Every tool call on a message, in stored order. */
|
|
13
|
+
export declare function toolCallsFromParts(parts: ReadonlyArray<unknown> | null | undefined): ChatToolCallInfo[];
|
|
14
|
+
/** The ordered text, tool and notice runs of a message, as the transcript
|
|
15
|
+
* interleaves them. Adjacent text parts fold into one run; reasoning,
|
|
16
|
+
* speaker, mention and file parts are not segments (they have their own
|
|
17
|
+
* rows). Returns an empty list for a message with no tool or notice, so a
|
|
18
|
+
* caller can keep the plain body for the common case. */
|
|
19
|
+
export declare function segmentsFromParts(parts: ReadonlyArray<unknown> | null | undefined): ChatMessageSegment[];
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* (tangle-network/agent-container#5934) without an import either way.
|
|
18
18
|
*/
|
|
19
19
|
import type { ReactNode } from 'react';
|
|
20
|
-
import type { FileMention } from '../chat-routes/wire';
|
|
20
|
+
import type { ChatMention, FileMention } from '../chat-routes/wire';
|
|
21
21
|
/** The atomic pill's payload. For a file mention, `id` is the
|
|
22
22
|
* workspace-relative path (the pill's stable identity and the `@<id>`
|
|
23
23
|
* serialization the editor uses to round-trip `value`), `label` is the
|
|
@@ -50,6 +50,20 @@ export interface ComposerMentionProp {
|
|
|
50
50
|
* ARIA attributes. */
|
|
51
51
|
popoverClassName?: string;
|
|
52
52
|
}
|
|
53
|
+
/** A workspace agent the composer can `@`. `handle` is what the text carries
|
|
54
|
+
* after `@` and the pill's identity; `id` is the stable profile id the turn
|
|
55
|
+
* is addressed with. */
|
|
56
|
+
export interface AgentMentionOption {
|
|
57
|
+
id: string;
|
|
58
|
+
handle: string;
|
|
59
|
+
name: string;
|
|
60
|
+
/** One line under the name in the popover, such as what the agent does. */
|
|
61
|
+
description?: string;
|
|
62
|
+
}
|
|
63
|
+
/** Agents whose name or handle starts with, then contains, the query; an
|
|
64
|
+
* empty query lists them all. Agents come before files in the popover: a
|
|
65
|
+
* workspace has a handful, a box has thousands. */
|
|
66
|
+
export declare function rankAgentMentions(agents: readonly AgentMentionOption[], query: string): AgentMentionOption[];
|
|
53
67
|
/**
|
|
54
68
|
* Ranks `files` against `query` (case-insensitive), capped to `limit`:
|
|
55
69
|
* name-prefix matches first, then name-substring, then path-substring.
|
|
@@ -88,14 +102,19 @@ export interface UseFileMentionsOptions {
|
|
|
88
102
|
/** Text shown in the popover's empty state once the index is loaded and
|
|
89
103
|
* the query matched nothing. Default {@link DEFAULT_MENTION_EMPTY_TEXT}. */
|
|
90
104
|
emptyText?: string;
|
|
105
|
+
/** The workspace's agents, offered in the same `@` popover before files.
|
|
106
|
+
* A picked agent is sent as an `AgentMention` and the turn is addressed
|
|
107
|
+
* to it (the route's `agents.resolve` seam). Omit → files only. */
|
|
108
|
+
agents?: readonly AgentMentionOption[];
|
|
91
109
|
}
|
|
92
110
|
/** Provide properties and methods to manage and refresh file mentions in a composer interface */
|
|
93
111
|
export interface UseFileMentionsResult {
|
|
94
112
|
/** Spread straight into `ChatComposer`'s `mention` prop. */
|
|
95
113
|
mention: ComposerMentionProp;
|
|
96
|
-
/** The files currently referenced by mentions in the composer's
|
|
97
|
-
* the send-body list
|
|
98
|
-
|
|
114
|
+
/** The files and agents currently referenced by mentions in the composer's
|
|
115
|
+
* value, in document order — the send-body list. Files go through
|
|
116
|
+
* `fileMentionsToParts`; agents are addressed by the route. */
|
|
117
|
+
mentions: ChatMention[];
|
|
99
118
|
/** Drop all currently-referenced mentions (e.g. after a successful send). */
|
|
100
119
|
clearMentions: () => void;
|
|
101
120
|
/** Force a re-fetch of the index right now, ignoring `refreshAfterMs` — for
|
|
@@ -26,9 +26,9 @@ import {
|
|
|
26
26
|
} from "../chunk-ZVEEWGDK.js";
|
|
27
27
|
import {
|
|
28
28
|
defineAppTool
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-HJYEK4SU.js";
|
|
30
30
|
import "../chunk-UGWQLQDS.js";
|
|
31
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-XPB2UYHU.js";
|
|
32
32
|
import {
|
|
33
33
|
ToolInputError
|
|
34
34
|
} from "../chunk-F4XBNR5L.js";
|
|
@@ -57,6 +57,32 @@ export interface AgentWorkspaceAppsConfig {
|
|
|
57
57
|
hrefForApp: (appId: string) => string;
|
|
58
58
|
prefetch?: RailPrefetch;
|
|
59
59
|
}
|
|
60
|
+
/** One agent in the workspace roster the rail lists. */
|
|
61
|
+
export interface AgentWorkspaceAgentRow {
|
|
62
|
+
/** The stable profile id. */
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
/** What the composer's `@` carries; shown beside the name. */
|
|
66
|
+
handle?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The workspace's agents under one expandable rail row, like Apps: each row
|
|
70
|
+
* opens the agent's own thread (its direct line and its feed), and an optional
|
|
71
|
+
* create route adds "New agent". Products supply authorized rows and real
|
|
72
|
+
* routes; the roster comes from the product's agent-profile catalog.
|
|
73
|
+
*/
|
|
74
|
+
export interface AgentWorkspaceAgentsConfig {
|
|
75
|
+
icon: WorkspaceIcon;
|
|
76
|
+
items: readonly AgentWorkspaceAgentRow[];
|
|
77
|
+
hrefForAgent: (agentId: string) => string;
|
|
78
|
+
/** Row label. Defaults to `Agents`. */
|
|
79
|
+
label?: string;
|
|
80
|
+
/** Route that creates an agent; adds a "New agent" row at the end. */
|
|
81
|
+
createHref?: string;
|
|
82
|
+
/** Label for the create row. Defaults to `New agent`. */
|
|
83
|
+
createLabel?: string;
|
|
84
|
+
prefetch?: RailPrefetch;
|
|
85
|
+
}
|
|
60
86
|
/** Route data for the shared active-nav resolver. */
|
|
61
87
|
export interface AgentWorkspaceActiveRoute {
|
|
62
88
|
/** Current browser pathname, including the product's workspace base. */
|
|
@@ -86,6 +112,8 @@ export interface AgentWorkspaceLayoutProps extends Omit<SidebarLayoutProps, 'act
|
|
|
86
112
|
sessions?: AgentWorkspaceSessionConfig;
|
|
87
113
|
/** Authorized app destinations, in the product's persisted order. */
|
|
88
114
|
apps?: AgentWorkspaceAppsConfig;
|
|
115
|
+
/** The workspace's agents, each opening its own thread. */
|
|
116
|
+
agents?: AgentWorkspaceAgentsConfig;
|
|
89
117
|
/** When supplied, active navigation is resolved by the shared route rules. */
|
|
90
118
|
activeRoute?: AgentWorkspaceActiveRoute;
|
|
91
119
|
/** Escape hatch for routers that already resolved the active item. */
|
|
@@ -113,7 +141,7 @@ export interface AgentWorkspaceLayoutProps extends Omit<SidebarLayoutProps, 'act
|
|
|
113
141
|
* with `SessionHistoryPanel` and `EntryComposer` for the complete chat-first
|
|
114
142
|
* structure.
|
|
115
143
|
*/
|
|
116
|
-
export declare function AgentWorkspaceLayout({ children, navItems, sessions, apps, activeRoute, activeId, product, workspace, prewarm, ...sidebarProps }: AgentWorkspaceLayoutProps): import("react").JSX.Element;
|
|
144
|
+
export declare function AgentWorkspaceLayout({ children, navItems, sessions, apps, agents, activeRoute, activeId, product, workspace, prewarm, ...sidebarProps }: AgentWorkspaceLayoutProps): import("react").JSX.Element;
|
|
117
145
|
export { AgentWorkspaceCompanion, createAgentWorkspaceCompanionTabs, type AgentWorkspaceCompanionHandle, type AgentWorkspaceCompanionProps, type AgentWorkspaceCompanionTab, type AgentWorkspaceCompanionTool, type AgentWorkspaceCompanionTools, type AgentWorkspaceCompanionNavigation } from './companion';
|
|
118
146
|
export { WorkspaceSwitcher, type WorkspaceSwitcherItem, type WorkspaceSwitcherProps } from '../web-react/workspace-switcher';
|
|
119
147
|
export { WorkspaceInitial } from '../web-react/workspace-switcher';
|
|
@@ -820,6 +820,7 @@ function AgentWorkspaceLayout({
|
|
|
820
820
|
navItems,
|
|
821
821
|
sessions,
|
|
822
822
|
apps,
|
|
823
|
+
agents,
|
|
823
824
|
activeRoute,
|
|
824
825
|
activeId,
|
|
825
826
|
product,
|
|
@@ -868,6 +869,27 @@ function AgentWorkspaceLayout({
|
|
|
868
869
|
prefetch: apps.prefetch
|
|
869
870
|
};
|
|
870
871
|
});
|
|
872
|
+
const agentNavItems = [
|
|
873
|
+
...(agents?.items ?? []).map((agent) => {
|
|
874
|
+
const href = agents.hrefForAgent(agent.id);
|
|
875
|
+
if (!href.startsWith("/") || href.startsWith("//") || /[?#\\]/.test(href)) {
|
|
876
|
+
throw new Error("Workspace agent href must be a local route path");
|
|
877
|
+
}
|
|
878
|
+
return {
|
|
879
|
+
id: "workspace-agent:" + agent.id,
|
|
880
|
+
label: agent.handle ? `${agent.name} \xB7 @${agent.handle}` : agent.name,
|
|
881
|
+
icon: agents.icon,
|
|
882
|
+
href,
|
|
883
|
+
prefetch: agents.prefetch
|
|
884
|
+
};
|
|
885
|
+
}),
|
|
886
|
+
...agents?.createHref ? [{ id: "workspace-agent:new", label: agents.createLabel ?? "New agent", icon: agents.icon, href: agents.createHref, prefetch: agents.prefetch }] : []
|
|
887
|
+
];
|
|
888
|
+
const agentRoutes = activeRoute ? agentNavItems.map((item) => {
|
|
889
|
+
const path = routePathFromHref(item.href, activeRoute.base);
|
|
890
|
+
if (!path) throw new Error("Workspace agent href must be under the active workspace");
|
|
891
|
+
return { id: item.id, path };
|
|
892
|
+
}) : [];
|
|
871
893
|
const appRoutes = activeRoute ? appNavItems.map((item) => {
|
|
872
894
|
const path = routePathFromHref(item.href, activeRoute.base);
|
|
873
895
|
if (!path) throw new Error("Workspace app href must be under the active workspace");
|
|
@@ -879,6 +901,7 @@ function AgentWorkspaceLayout({
|
|
|
879
901
|
routes: [
|
|
880
902
|
...activeRoute.routes,
|
|
881
903
|
...appRoutes,
|
|
904
|
+
...agentRoutes,
|
|
882
905
|
...sessionNav && historyRoutePath ? [{ id: sessions?.id ?? "history", path: historyRoutePath }] : []
|
|
883
906
|
]
|
|
884
907
|
}) : activeId;
|
|
@@ -898,8 +921,19 @@ function AgentWorkspaceLayout({
|
|
|
898
921
|
})),
|
|
899
922
|
subActiveIds: activeAppId ? [activeAppId] : void 0
|
|
900
923
|
} : void 0;
|
|
924
|
+
const activeAgentId = agentNavItems.some((item) => item.id === resolvedActiveId) ? resolvedActiveId : void 0;
|
|
925
|
+
const agentGroup = agents && agentNavItems.length > 0 ? {
|
|
926
|
+
id: "workspace-agents",
|
|
927
|
+
label: agents.label ?? "Agents",
|
|
928
|
+
icon: agents.icon,
|
|
929
|
+
expandable: true,
|
|
930
|
+
defaultOpen: true,
|
|
931
|
+
subItems: agentNavItems.map(({ id, label, icon, href, prefetch }) => ({ id, label, icon, href, prefetch })),
|
|
932
|
+
subActiveIds: activeAgentId ? [activeAgentId] : void 0
|
|
933
|
+
} : void 0;
|
|
901
934
|
const workspaceNavItems = [
|
|
902
935
|
...navItems,
|
|
936
|
+
...agentGroup ? [agentGroup] : [],
|
|
903
937
|
...appGroup ? [appGroup] : [],
|
|
904
938
|
...sessionNav ? [sessionNav] : []
|
|
905
939
|
];
|