@tangle-network/agent-app 0.63.59 → 0.63.61
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-YWDEFWYQ.js} +3 -2
- 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 +38 -0
- package/dist/chat-routes/index.d.ts +1 -0
- package/dist/chat-routes/index.js +25 -8
- 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 +38 -1
- package/dist/chat-routes/wire.d.ts +29 -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-P7UB7ZVP.js → chunk-75I4RXIE.js} +2 -2
- package/dist/{chunk-GGJYAV7R.js → chunk-DPZXCVVS.js} +2 -2
- package/dist/{chunk-GGJYAV7R.js.map → chunk-DPZXCVVS.js.map} +1 -1
- package/dist/{chunk-LAZCUQFZ.js → chunk-F2N55QQX.js} +47 -10
- package/dist/chunk-F2N55QQX.js.map +1 -0
- package/dist/{chunk-QGJOT6R6.js → chunk-F6UC2T6U.js} +49 -9
- package/dist/{chunk-QGJOT6R6.js.map → chunk-F6UC2T6U.js.map} +1 -1
- package/dist/{chunk-AICYKYYF.js → chunk-MIQL36JS.js} +17 -4
- package/dist/chunk-MIQL36JS.js.map +1 -0
- package/dist/{chunk-RILVJYXJ.js → chunk-N5KBDRSX.js} +2 -2
- package/dist/{chunk-IDQ7N36R.js → chunk-O2TYB3DH.js} +2 -2
- package/dist/{chunk-H6BRJU5M.js → chunk-RKNNMC6T.js} +1 -1
- package/dist/{chunk-HHPQMFKP.js → chunk-RNFVAAJJ.js} +2 -2
- package/dist/{chunk-KFO5R4SN.js → chunk-RVC7EHJI.js} +135 -64
- package/dist/chunk-RVC7EHJI.js.map +1 -0
- package/dist/{chunk-4E2MUVGL.js → chunk-TFV4QOCG.js} +3 -3
- package/dist/chunk-XBBXPZJI.js +47 -0
- package/dist/chunk-XBBXPZJI.js.map +1 -0
- 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 +3 -2
- 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 +4 -4
- package/dist/public-consultation/index.d.ts +2 -2
- package/dist/public-consultation/index.js +7 -6
- package/dist/public-consultation/index.js.map +1 -1
- package/dist/sandbox/index.js +2 -2
- 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/tokens.css +2 -4
- package/dist/vault/store/index.js +330 -259
- package/dist/vault/store/index.js.map +1 -1
- package/dist/vault/store/sandbox-hydrate.d.ts +22 -1
- package/dist/vault/store/sandbox-reconcile.d.ts +11 -3
- package/dist/vault/store/sandbox-sync.d.ts +26 -0
- 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/entry-composer.d.ts +2 -2
- package/dist/web-react/index.js +8 -5
- package/dist/web-react/use-file-mentions.d.ts +23 -4
- 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 +5 -5
- 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/{DesignCanvas-Q65UV4D5.js.map → DesignCanvas-566V5KVC.js.map} +0 -0
- /package/dist/{DesignCanvasEditor-THEFESEX.js.map → DesignCanvasEditor-YWDEFWYQ.js.map} +0 -0
- /package/dist/{chunk-P7UB7ZVP.js.map → chunk-75I4RXIE.js.map} +0 -0
- /package/dist/{chunk-RILVJYXJ.js.map → chunk-N5KBDRSX.js.map} +0 -0
- /package/dist/{chunk-IDQ7N36R.js.map → chunk-O2TYB3DH.js.map} +0 -0
- /package/dist/{chunk-H6BRJU5M.js.map → chunk-RKNNMC6T.js.map} +0 -0
- /package/dist/{chunk-HHPQMFKP.js.map → chunk-RNFVAAJJ.js.map} +0 -0
- /package/dist/{chunk-4E2MUVGL.js.map → chunk-TFV4QOCG.js.map} +0 -0
|
@@ -50,9 +50,12 @@ import {
|
|
|
50
50
|
import {
|
|
51
51
|
AsyncView
|
|
52
52
|
} from "./chunk-AVP5SNIG.js";
|
|
53
|
+
import {
|
|
54
|
+
expandSpeakerRows
|
|
55
|
+
} from "./chunk-XBBXPZJI.js";
|
|
53
56
|
import {
|
|
54
57
|
attachmentPartsFromMessageParts
|
|
55
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-MIQL36JS.js";
|
|
56
59
|
import {
|
|
57
60
|
cancelStatusFor,
|
|
58
61
|
fieldAcceptsFreeText,
|
|
@@ -69,7 +72,7 @@ import {
|
|
|
69
72
|
isTurnIntentEvent,
|
|
70
73
|
isTurnPhaseEvent,
|
|
71
74
|
settleTurnResponse
|
|
72
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-F6UC2T6U.js";
|
|
73
76
|
import {
|
|
74
77
|
parsePlanSubmittedEvent,
|
|
75
78
|
persistedPartToPlan
|
|
@@ -181,6 +184,11 @@ function dispatchChatStreamLine(line, cb) {
|
|
|
181
184
|
receivedContent = true;
|
|
182
185
|
}
|
|
183
186
|
break;
|
|
187
|
+
case "speaker":
|
|
188
|
+
if (typeof evt.id === "string" && typeof evt.name === "string") {
|
|
189
|
+
cb.onSpeaker?.({ id: evt.id, name: evt.name, ...typeof evt.handle === "string" ? { handle: evt.handle } : {} });
|
|
190
|
+
}
|
|
191
|
+
break;
|
|
184
192
|
case "reasoning":
|
|
185
193
|
if (typeof evt.text === "string") {
|
|
186
194
|
cb.onReasoning?.(evt.text);
|
|
@@ -2409,6 +2417,21 @@ function useChatInteractions(options = {}) {
|
|
|
2409
2417
|
// src/web-react/use-file-mentions.ts
|
|
2410
2418
|
import { useCallback as useCallback4, useMemo as useMemo5, useRef as useRef7, useState as useState11 } from "react";
|
|
2411
2419
|
var FILE_MENTION_KIND = "file";
|
|
2420
|
+
var AGENT_MENTION_KIND = "agent";
|
|
2421
|
+
function agentToMentionItem(agent) {
|
|
2422
|
+
return { id: agent.handle, label: agent.name, detail: agent.description ?? `@${agent.handle}`, kind: AGENT_MENTION_KIND };
|
|
2423
|
+
}
|
|
2424
|
+
function rankAgentMentions(agents, query) {
|
|
2425
|
+
const q = query.trim().toLowerCase();
|
|
2426
|
+
if (!q) return [...agents];
|
|
2427
|
+
const tier = (agent) => {
|
|
2428
|
+
const name = agent.name.toLowerCase();
|
|
2429
|
+
if (name.startsWith(q) || agent.handle.startsWith(q)) return 0;
|
|
2430
|
+
if (name.includes(q) || agent.handle.includes(q)) return 1;
|
|
2431
|
+
return -1;
|
|
2432
|
+
};
|
|
2433
|
+
return agents.map((agent) => ({ agent, tier: tier(agent) })).filter((entry) => entry.tier >= 0).sort((a, b) => a.tier - b.tier || a.agent.name.localeCompare(b.agent.name)).map((entry) => entry.agent);
|
|
2434
|
+
}
|
|
2412
2435
|
function toMentionItem(file) {
|
|
2413
2436
|
return { id: file.path, label: file.name, detail: file.path, kind: FILE_MENTION_KIND };
|
|
2414
2437
|
}
|
|
@@ -2462,7 +2485,8 @@ function useFileMentions(options) {
|
|
|
2462
2485
|
indexUrl,
|
|
2463
2486
|
limit = DEFAULT_MENTION_LIMIT,
|
|
2464
2487
|
refreshAfterMs = INDEX_REFRESH_AFTER_MS,
|
|
2465
|
-
emptyText = DEFAULT_MENTION_EMPTY_TEXT
|
|
2488
|
+
emptyText = DEFAULT_MENTION_EMPTY_TEXT,
|
|
2489
|
+
agents
|
|
2466
2490
|
} = options;
|
|
2467
2491
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
2468
2492
|
const [state, setState] = useState11({ kind: "idle" });
|
|
@@ -2470,6 +2494,7 @@ function useFileMentions(options) {
|
|
|
2470
2494
|
stateRef.current = state;
|
|
2471
2495
|
const inFlightRef = useRef7(null);
|
|
2472
2496
|
const [mentions, setMentions] = useState11([]);
|
|
2497
|
+
const agentsByHandle = useMemo5(() => new Map((agents ?? []).map((agent) => [agent.handle, agent])), [agents]);
|
|
2473
2498
|
const load = useCallback4(() => {
|
|
2474
2499
|
if (inFlightRef.current) return inFlightRef.current;
|
|
2475
2500
|
if (stateRef.current.kind === "idle") {
|
|
@@ -2515,14 +2540,24 @@ function useFileMentions(options) {
|
|
|
2515
2540
|
} else if (Date.now() - current.attemptedAt > RETRY_AFTER_MS) {
|
|
2516
2541
|
void load();
|
|
2517
2542
|
}
|
|
2518
|
-
|
|
2519
|
-
|
|
2543
|
+
const agentItems = rankAgentMentions(agents ?? [], query).map(agentToMentionItem);
|
|
2544
|
+
if (current.kind !== "ready") return agentItems;
|
|
2545
|
+
return [...agentItems, ...rankFileMentions(current.files, query, Math.max(0, limit - agentItems.length)).map(toMentionItem)];
|
|
2520
2546
|
},
|
|
2521
|
-
[load, limit, refreshAfterMs]
|
|
2547
|
+
[load, limit, refreshAfterMs, agents]
|
|
2522
2548
|
);
|
|
2523
2549
|
const onMentionsChange = useCallback4((items) => {
|
|
2524
|
-
|
|
2525
|
-
|
|
2550
|
+
const next = [];
|
|
2551
|
+
for (const item of items) {
|
|
2552
|
+
if (item.kind === AGENT_MENTION_KIND) {
|
|
2553
|
+
const agent = agentsByHandle.get(item.id);
|
|
2554
|
+
if (agent) next.push({ kind: "agent", agentId: agent.id, handle: agent.handle, name: agent.name });
|
|
2555
|
+
} else if (item.kind === void 0 || item.kind === FILE_MENTION_KIND) {
|
|
2556
|
+
next.push(toFileMention(item));
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
setMentions(next);
|
|
2560
|
+
}, [agentsByHandle]);
|
|
2526
2561
|
const clearMentions = useCallback4(() => setMentions([]), []);
|
|
2527
2562
|
const mention = useMemo5(
|
|
2528
2563
|
() => ({
|
|
@@ -7965,7 +8000,7 @@ function OtherPersonMessage({
|
|
|
7965
8000
|
] });
|
|
7966
8001
|
}
|
|
7967
8002
|
function ChatMessages({
|
|
7968
|
-
messages,
|
|
8003
|
+
messages: storedMessages,
|
|
7969
8004
|
messageSize = "default",
|
|
7970
8005
|
chrome = "labeled",
|
|
7971
8006
|
models = [],
|
|
@@ -7994,6 +8029,7 @@ function ChatMessages({
|
|
|
7994
8029
|
() => renderMarkdown ?? ((content) => /* @__PURE__ */ jsx28("p", { className: "whitespace-pre-wrap", children: content })),
|
|
7995
8030
|
[renderMarkdown]
|
|
7996
8031
|
);
|
|
8032
|
+
const messages = useMemo11(() => expandSpeakerRows(storedMessages), [storedMessages]);
|
|
7997
8033
|
const lastIsUser = messages[messages.length - 1]?.role === "user";
|
|
7998
8034
|
const quiet = chrome === "quiet";
|
|
7999
8035
|
if (messages.length === 0 && !loading && !error) {
|
|
@@ -8482,6 +8518,7 @@ export {
|
|
|
8482
8518
|
restoreChatInteractions,
|
|
8483
8519
|
hydrateChatInteractions,
|
|
8484
8520
|
useChatInteractions,
|
|
8521
|
+
rankAgentMentions,
|
|
8485
8522
|
rankFileMentions,
|
|
8486
8523
|
DEFAULT_MENTION_LIMIT,
|
|
8487
8524
|
INDEX_REFRESH_AFTER_MS,
|
|
@@ -8583,4 +8620,4 @@ export {
|
|
|
8583
8620
|
AgentProfileChoices,
|
|
8584
8621
|
ComposerProfilePill
|
|
8585
8622
|
};
|
|
8586
|
-
//# sourceMappingURL=chunk-
|
|
8623
|
+
//# sourceMappingURL=chunk-F2N55QQX.js.map
|