@tangle-network/agent-app 0.63.76 → 0.63.77
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-DRVL3MWL.js → DesignCanvas-JA5O6Y6C.js} +2 -3
- package/dist/{DesignCanvasEditor-5T3MHHFH.js → DesignCanvasEditor-6SQAQGOY.js} +2 -3
- package/dist/agent-profiles/d1.js +3 -3
- package/dist/agent-profiles/index.js +3 -3
- package/dist/app-auth/index.js +1 -2
- package/dist/app-auth/index.js.map +1 -1
- package/dist/assistant/index.js +2 -3
- package/dist/assistant/index.js.map +1 -1
- package/dist/chat-routes/agent-producers.d.ts +5 -2
- package/dist/chat-routes/index.js +9 -10
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-store/index.js +1 -1
- package/dist/chat-store/parts.d.ts +4 -1
- package/dist/{chunk-JLFFTSWN.js → chunk-2CRRXINH.js} +20 -8
- package/dist/chunk-2CRRXINH.js.map +1 -0
- package/dist/{chunk-SK6WU2TI.js → chunk-DNM5CN3R.js} +3 -3
- package/dist/{chunk-CGBB2AUP.js → chunk-DURND7YS.js} +5 -5
- package/dist/{chunk-CGBB2AUP.js.map → chunk-DURND7YS.js.map} +1 -1
- package/dist/{chunk-GAYWV565.js → chunk-H3XWDX4Z.js} +2 -2
- package/dist/chunk-H3XWDX4Z.js.map +1 -0
- package/dist/{chunk-RKNNMC6T.js → chunk-H6BRJU5M.js} +1 -1
- package/dist/{chunk-YG3DSMPS.js → chunk-IWEGCOQR.js} +40 -21
- package/dist/chunk-IWEGCOQR.js.map +1 -0
- package/dist/{chunk-DS3FDGVJ.js → chunk-M42DQ6HM.js} +2 -2
- package/dist/{chunk-5DXOFO4V.js → chunk-OWNWWT76.js} +2 -2
- package/dist/{chunk-5ERXADSW.js → chunk-Q54SXI57.js} +2 -2
- package/dist/{chunk-CI6Z2C4L.js → chunk-X32H7TXZ.js} +2 -2
- package/dist/{chunk-YGMJ6NDY.js → chunk-YAIUAUWJ.js} +3 -3
- package/dist/{chunk-7O62NYGT.js → chunk-YHA6W3OW.js} +2 -2
- package/dist/design-canvas/index.js +1 -2
- package/dist/design-canvas/index.js.map +1 -1
- package/dist/design-canvas-react/engine.js +1 -2
- package/dist/design-canvas-react/index.js +2 -3
- package/dist/design-canvas-react/index.js.map +1 -1
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/platform/index.js +1 -2
- package/dist/platform/index.js.map +1 -1
- package/dist/preset-cloudflare/index.js +5 -5
- package/dist/public-consultation/index.js +8 -9
- package/dist/public-consultation/index.js.map +1 -1
- package/dist/sandbox/index.js +4 -4
- package/dist/sequences/index.js +1 -2
- package/dist/sequences/index.js.map +1 -1
- package/dist/stories/chat/fixtures.d.ts +5 -5
- package/dist/tools/index.js +4 -4
- package/dist/web/index.d.ts +0 -1
- package/dist/web/index.js +1 -7
- package/dist/web-react/chat-stream.d.ts +3 -1
- package/dist/web-react/index.js +2 -3
- package/dist/web-react/message-projection.d.ts +2 -2
- package/dist/work-product/index.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-GAYWV565.js.map +0 -1
- package/dist/chunk-JLFFTSWN.js.map +0 -1
- package/dist/chunk-XBBXPZJI.js +0 -47
- package/dist/chunk-XBBXPZJI.js.map +0 -1
- package/dist/chunk-YG3DSMPS.js.map +0 -1
- package/dist/web/speakers.d.ts +0 -30
- /package/dist/{DesignCanvas-DRVL3MWL.js.map → DesignCanvas-JA5O6Y6C.js.map} +0 -0
- /package/dist/{DesignCanvasEditor-5T3MHHFH.js.map → DesignCanvasEditor-6SQAQGOY.js.map} +0 -0
- /package/dist/{chunk-SK6WU2TI.js.map → chunk-DNM5CN3R.js.map} +0 -0
- /package/dist/{chunk-RKNNMC6T.js.map → chunk-H6BRJU5M.js.map} +0 -0
- /package/dist/{chunk-DS3FDGVJ.js.map → chunk-M42DQ6HM.js.map} +0 -0
- /package/dist/{chunk-5DXOFO4V.js.map → chunk-OWNWWT76.js.map} +0 -0
- /package/dist/{chunk-5ERXADSW.js.map → chunk-Q54SXI57.js.map} +0 -0
- /package/dist/{chunk-CI6Z2C4L.js.map → chunk-X32H7TXZ.js.map} +0 -0
- /package/dist/{chunk-YGMJ6NDY.js.map → chunk-YAIUAUWJ.js.map} +0 -0
- /package/dist/{chunk-7O62NYGT.js.map → chunk-YHA6W3OW.js.map} +0 -0
package/dist/chat-store/index.js
CHANGED
|
@@ -218,12 +218,15 @@ export interface ChatMentionPart {
|
|
|
218
218
|
/** Who wrote the parts that follow, when one assistant row holds more than one
|
|
219
219
|
* responder: a turn addressed to `@a @b` is one row whose parts read
|
|
220
220
|
* speaker a, a's text, speaker b, b's text. A renderer splits the row at
|
|
221
|
-
* these (`
|
|
221
|
+
* these (`partitionBySpeaker` in `@tangle-network/ui/chat`); a row with none
|
|
222
|
+
* is one speaker. `state` is how the responder ended; rows written before
|
|
223
|
+
* responders reported an end have none. */
|
|
222
224
|
export interface ChatSpeakerPart {
|
|
223
225
|
type: 'speaker';
|
|
224
226
|
id: string;
|
|
225
227
|
name: string;
|
|
226
228
|
handle?: string;
|
|
229
|
+
state?: 'done' | 'failed';
|
|
227
230
|
}
|
|
228
231
|
/** Represent parts of a chat message including text, reasoning, tools, files, images, subtasks, steps, interactions, notices, plans, and mentions */
|
|
229
232
|
export type ChatMessagePart = ChatTextPart | ChatReasoningPart | ChatToolPart | ChatFilePart | ChatImagePart | ChatSubtaskPart | ChatStepStartPart | ChatStepFinishPart | ChatInteractionPart | ChatNoticePart | ChatPlanPart | ChatWorkProductPart | ChatMentionPart | ChatSpeakerPart;
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
createAssistantDraftWriter,
|
|
38
38
|
rowIdOf,
|
|
39
39
|
storeSupportsDraftPersistence
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-YHA6W3OW.js";
|
|
41
41
|
import {
|
|
42
42
|
normalizeClientTurnId,
|
|
43
43
|
resolveChatTurn
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
historyContentWithAttachments,
|
|
47
47
|
mentionInputToPart,
|
|
48
48
|
toChatMessageParts
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-H3XWDX4Z.js";
|
|
50
50
|
import {
|
|
51
51
|
asRecord,
|
|
52
52
|
asString,
|
|
@@ -2218,8 +2218,8 @@ async function addressAgents(input) {
|
|
|
2218
2218
|
return { ...input.produceArgs, agents: addressed.map((mention) => byId.get(mention.agentId)) };
|
|
2219
2219
|
}
|
|
2220
2220
|
var SPEAKER_EVENT = "speaker";
|
|
2221
|
-
function speakerPart(agent) {
|
|
2222
|
-
return { type: "speaker", id: agent.id, name: agent.name, handle: agent.handle };
|
|
2221
|
+
function speakerPart(agent, state) {
|
|
2222
|
+
return { type: "speaker", id: agent.id, name: agent.name, handle: agent.handle, ...state ? { state } : {} };
|
|
2223
2223
|
}
|
|
2224
2224
|
function addressedTurnText(content, agent, agents) {
|
|
2225
2225
|
let text = content;
|
|
@@ -2293,11 +2293,17 @@ async function composeAgentProducers(args, produce) {
|
|
|
2293
2293
|
}
|
|
2294
2294
|
})();
|
|
2295
2295
|
});
|
|
2296
|
+
const endOf = (index) => {
|
|
2297
|
+
const slot = slots[index];
|
|
2298
|
+
if (!slot.done) return void 0;
|
|
2299
|
+
return slot.error !== void 0 || slot.failure !== void 0 ? "failed" : "done";
|
|
2300
|
+
};
|
|
2296
2301
|
const stream = (async function* () {
|
|
2297
2302
|
for (const agent of agents) {
|
|
2298
|
-
yield { type: SPEAKER_EVENT,
|
|
2303
|
+
yield { type: SPEAKER_EVENT, ...speakerPart(agent) };
|
|
2299
2304
|
}
|
|
2300
2305
|
const reported = /* @__PURE__ */ new Set();
|
|
2306
|
+
const ended = /* @__PURE__ */ new Set();
|
|
2301
2307
|
for (; ; ) {
|
|
2302
2308
|
if (args.admissionSignal?.aborted) return;
|
|
2303
2309
|
let yielded = false;
|
|
@@ -2312,6 +2318,12 @@ async function composeAgentProducers(args, produce) {
|
|
|
2312
2318
|
yield failedNotice(agent, slot.error instanceof Error ? slot.error.message : String(slot.error));
|
|
2313
2319
|
yielded = true;
|
|
2314
2320
|
}
|
|
2321
|
+
const end = slot.queue.length === 0 ? endOf(index) : void 0;
|
|
2322
|
+
if (end && !ended.has(index)) {
|
|
2323
|
+
ended.add(index);
|
|
2324
|
+
yield { type: SPEAKER_EVENT, ...speakerPart(agents[index], end) };
|
|
2325
|
+
yielded = true;
|
|
2326
|
+
}
|
|
2315
2327
|
}
|
|
2316
2328
|
if (slots.every((slot) => slot.done && slot.queue.length === 0)) {
|
|
2317
2329
|
const failed = slots.every((slot) => slot.error !== void 0 || slot.failure !== void 0);
|
|
@@ -2326,7 +2338,7 @@ async function composeAgentProducers(args, produce) {
|
|
|
2326
2338
|
if (!yielded) await new Promise((resolve) => {
|
|
2327
2339
|
wake = resolve;
|
|
2328
2340
|
if (slots.some((slot) => slot.queue.length > 0 || slot.done)) {
|
|
2329
|
-
const pending = slots.some((slot) => slot.queue.length > 0 || slot.done &&
|
|
2341
|
+
const pending = slots.some((slot, index) => slot.queue.length > 0 || slot.done && !ended.has(index));
|
|
2330
2342
|
if (pending || slots.every((slot) => slot.done)) {
|
|
2331
2343
|
wake = void 0;
|
|
2332
2344
|
resolve();
|
|
@@ -2350,7 +2362,7 @@ async function composeAgentProducers(args, produce) {
|
|
|
2350
2362
|
const parts = own ?? (text ? [{ type: "text", text }] : []);
|
|
2351
2363
|
const failure = failureOf(index);
|
|
2352
2364
|
const notice = failure === void 0 ? [] : [{ type: "notice", noticeKind: "error", id: `speaker-failed:${agent.id}`, text: `${agent.name} could not answer: ${failure}` }];
|
|
2353
|
-
return [speakerPart(agent), ...parts, ...notice];
|
|
2365
|
+
return [speakerPart(agent, endOf(index)), ...parts, ...notice];
|
|
2354
2366
|
};
|
|
2355
2367
|
const last = () => entries().at(-1)?.producer;
|
|
2356
2368
|
return {
|
|
@@ -4155,4 +4167,4 @@ export {
|
|
|
4155
4167
|
createChatTurnRoutes,
|
|
4156
4168
|
streamChatRouteAsSandboxEvents
|
|
4157
4169
|
};
|
|
4158
|
-
//# sourceMappingURL=chunk-
|
|
4170
|
+
//# sourceMappingURL=chunk-2CRRXINH.js.map
|