@tangle-network/agent-app 0.49.38 → 0.50.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.
Files changed (69) hide show
  1. package/dist/DesignCanvas-H6PVRRLU.js +12 -0
  2. package/dist/DesignCanvasEditor-ZHKJIDOB.js +15 -0
  3. package/dist/app-auth/index.js +3 -2
  4. package/dist/app-auth/index.js.map +1 -1
  5. package/dist/assistant/index.js +7 -7
  6. package/dist/chat-routes/index.js +10 -9
  7. package/dist/chat-routes/index.js.map +1 -1
  8. package/dist/chat-store/index.js +4 -4
  9. package/dist/{chunk-EA4UVS4T.js → chunk-3NCPXNBZ.js} +35 -90
  10. package/dist/chunk-3NCPXNBZ.js.map +1 -0
  11. package/dist/{chunk-C2VHOSY3.js → chunk-5P6TB74H.js} +11 -6
  12. package/dist/chunk-5P6TB74H.js.map +1 -0
  13. package/dist/{chunk-WAMJSZYB.js → chunk-ACFM2GFL.js} +3 -3
  14. package/dist/{chunk-XTLYE2VO.js → chunk-FRVVHMZO.js} +10 -10
  15. package/dist/{chunk-BWQPVS7D.js → chunk-H6XQZFTT.js} +2 -2
  16. package/dist/{chunk-FEVVF6JJ.js → chunk-HQ7R6CGM.js} +2 -2
  17. package/dist/{chunk-MIFVOYZ7.js → chunk-KJEW23GR.js} +3 -3
  18. package/dist/{chunk-G2B23BZ6.js → chunk-KU5YAGLB.js} +5 -5
  19. package/dist/{chunk-ZMMIQOFI.js → chunk-MX55JP7D.js} +5 -5
  20. package/dist/{chunk-S3344RBY.js → chunk-RACQDXJ7.js} +4 -4
  21. package/dist/{chunk-2WVBGQ2Y.js → chunk-RRWC77YY.js} +2 -2
  22. package/dist/chunk-TZEEGDHS.js +89 -0
  23. package/dist/chunk-TZEEGDHS.js.map +1 -0
  24. package/dist/{chunk-KWN5PGXM.js → chunk-YJYPXMDL.js} +3 -3
  25. package/dist/design-canvas/index.js +3 -2
  26. package/dist/design-canvas/index.js.map +1 -1
  27. package/dist/design-canvas-react/engine.js +5 -4
  28. package/dist/design-canvas-react/index.js +11 -10
  29. package/dist/design-canvas-react/index.js.map +1 -1
  30. package/dist/design-canvas-react/lazy.js +1 -1
  31. package/dist/hosted-agent/application.d.ts +25 -0
  32. package/dist/hosted-agent/application.js +97 -0
  33. package/dist/hosted-agent/application.js.map +1 -0
  34. package/dist/hosted-agent/react/ApplicationLineSetup.d.ts +15 -0
  35. package/dist/hosted-agent/react/LineSetup.d.ts +1 -1
  36. package/dist/hosted-agent/react/contracts.d.ts +8 -1
  37. package/dist/hosted-agent/react/index.d.ts +1 -0
  38. package/dist/hosted-agent/react/index.js +90 -8
  39. package/dist/hosted-agent/react/index.js.map +1 -1
  40. package/dist/hosted-agent/react/lines.css +5 -0
  41. package/dist/hosted-agent/workspace-line.d.ts +9 -0
  42. package/dist/platform/index.js +3 -2
  43. package/dist/platform/index.js.map +1 -1
  44. package/dist/platform/sso.d.ts +18 -4
  45. package/dist/public-consultation/index.js +7 -6
  46. package/dist/public-consultation/index.js.map +1 -1
  47. package/dist/sequences/index.js +2 -1
  48. package/dist/sequences/index.js.map +1 -1
  49. package/dist/stream/index.js +2 -2
  50. package/dist/web/core.d.ts +3 -1
  51. package/dist/web/index.js +5 -3
  52. package/dist/web-react/index.js +20 -20
  53. package/package.json +15 -10
  54. package/dist/DesignCanvas-YLVDCX6H.js +0 -11
  55. package/dist/DesignCanvasEditor-4QWY2LHM.js +0 -14
  56. package/dist/chunk-C2VHOSY3.js.map +0 -1
  57. package/dist/chunk-EA4UVS4T.js.map +0 -1
  58. /package/dist/{DesignCanvas-YLVDCX6H.js.map → DesignCanvas-H6PVRRLU.js.map} +0 -0
  59. /package/dist/{DesignCanvasEditor-4QWY2LHM.js.map → DesignCanvasEditor-ZHKJIDOB.js.map} +0 -0
  60. /package/dist/{chunk-WAMJSZYB.js.map → chunk-ACFM2GFL.js.map} +0 -0
  61. /package/dist/{chunk-XTLYE2VO.js.map → chunk-FRVVHMZO.js.map} +0 -0
  62. /package/dist/{chunk-BWQPVS7D.js.map → chunk-H6XQZFTT.js.map} +0 -0
  63. /package/dist/{chunk-FEVVF6JJ.js.map → chunk-HQ7R6CGM.js.map} +0 -0
  64. /package/dist/{chunk-MIFVOYZ7.js.map → chunk-KJEW23GR.js.map} +0 -0
  65. /package/dist/{chunk-G2B23BZ6.js.map → chunk-KU5YAGLB.js.map} +0 -0
  66. /package/dist/{chunk-ZMMIQOFI.js.map → chunk-MX55JP7D.js.map} +0 -0
  67. /package/dist/{chunk-S3344RBY.js.map → chunk-RACQDXJ7.js.map} +0 -0
  68. /package/dist/{chunk-2WVBGQ2Y.js.map → chunk-RRWC77YY.js.map} +0 -0
  69. /package/dist/{chunk-KWN5PGXM.js.map → chunk-YJYPXMDL.js.map} +0 -0
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  persistedPartToWorkProduct
6
6
  } from "./chunk-ZVEEWGDK.js";
7
- import {
8
- persistedPartToInteraction
9
- } from "./chunk-M3K2HVQD.js";
10
7
  import {
11
8
  persistedPartToPlan,
12
9
  planToPersistedPart
13
10
  } from "./chunk-YJMCRXQQ.js";
11
+ import {
12
+ persistedPartToInteraction
13
+ } from "./chunk-M3K2HVQD.js";
14
14
 
15
15
  // src/chat-store/parts.ts
16
16
  function toChatMessageParts(parts) {
@@ -155,4 +155,4 @@ export {
155
155
  buildAttachmentPromptBlock,
156
156
  historyContentWithAttachments
157
157
  };
158
- //# sourceMappingURL=chunk-S3344RBY.js.map
158
+ //# sourceMappingURL=chunk-RACQDXJ7.js.map
@@ -4,7 +4,7 @@ import {
4
4
  boundsIntersect,
5
5
  elementAabb,
6
6
  scaleForPreset
7
- } from "./chunk-BWQPVS7D.js";
7
+ } from "./chunk-H6XQZFTT.js";
8
8
 
9
9
  // src/design-canvas-react/engine/snap.ts
10
10
  var KIND_PRIORITY = {
@@ -447,4 +447,4 @@ export {
447
447
  buildInsertImageOp,
448
448
  DEFAULT_INSERT_TEMPLATES
449
449
  };
450
- //# sourceMappingURL=chunk-2WVBGQ2Y.js.map
450
+ //# sourceMappingURL=chunk-RRWC77YY.js.map
@@ -0,0 +1,89 @@
1
+ // src/web/message-groups.ts
2
+ function groupConversationMessages(items = []) {
3
+ let speaker = null;
4
+ let conversation;
5
+ let groupId;
6
+ return items.map((item, index) => {
7
+ if (item.conversationId !== void 0 && item.conversationId !== conversation) {
8
+ conversation = item.conversationId;
9
+ speaker = null;
10
+ groupId = void 0;
11
+ }
12
+ const role = item.kind === "thinking" ? "assistant" : !item.kind || item.kind === "message" ? item.role : void 0;
13
+ if (role === "user") {
14
+ speaker = null;
15
+ groupId = void 0;
16
+ return { ...item, isContinuation: false };
17
+ }
18
+ if (role !== "assistant") return item;
19
+ const current = item.speakerId ?? "assistant";
20
+ const isContinuation = speaker === current;
21
+ if (!isContinuation) groupId = String(item.id ?? `assistant-${index}`);
22
+ speaker = current;
23
+ return { ...item, isContinuation, groupId };
24
+ });
25
+ }
26
+
27
+ // src/web/api-key-fetch.ts
28
+ function createApiKeyFetch(options) {
29
+ const origin = new URL(options.origin);
30
+ const loopback = ["localhost", "127.0.0.1", "[::1]"].includes(origin.hostname);
31
+ if (origin.username || origin.password || origin.pathname !== "/" || origin.search || origin.hash || origin.protocol !== "https:" && !(origin.protocol === "http:" && loopback && options.allowHttpLoopback)) {
32
+ throw new TypeError("API origin must be HTTPS without credentials, path, query, or fragment");
33
+ }
34
+ const fetchImpl = options.fetchImpl ?? globalThis.fetch;
35
+ if (typeof fetchImpl !== "function") throw new TypeError("A fetch implementation is required");
36
+ const getApiKey = options.getApiKey;
37
+ return async (path, init = {}) => {
38
+ if (typeof path !== "string" || !path.startsWith("/") || path.startsWith("//") || /[\\\u0000-\u0020\u007f]/.test(path)) {
39
+ throw new TypeError("API requests require a root-relative path without whitespace or backslashes");
40
+ }
41
+ const target = new URL(path, origin);
42
+ if (target.origin !== origin.origin || target.username || target.password || target.hash) {
43
+ throw new TypeError("API requests must stay on the configured origin without a fragment");
44
+ }
45
+ const headers = new Headers(init.headers);
46
+ if (headers.has("authorization") || headers.has("cookie") || headers.has("proxy-authorization")) {
47
+ throw new TypeError("Authentication headers must come from the configured secret resolver");
48
+ }
49
+ init.signal?.throwIfAborted();
50
+ let apiKey;
51
+ try {
52
+ apiKey = await getApiKey();
53
+ } catch {
54
+ throw new Error("API credential is unavailable");
55
+ }
56
+ if (typeof apiKey !== "string" || !apiKey || /\s|[^\x21-\x7e]/.test(apiKey)) {
57
+ throw new TypeError("API credential must be a nonempty printable token without whitespace");
58
+ }
59
+ init.signal?.throwIfAborted();
60
+ headers.set("Authorization", `Bearer ${apiKey}`);
61
+ let response;
62
+ try {
63
+ response = await fetchImpl(target.href, {
64
+ ...init,
65
+ headers,
66
+ credentials: "omit",
67
+ redirect: "manual",
68
+ referrerPolicy: "no-referrer"
69
+ });
70
+ } catch {
71
+ init.signal?.throwIfAborted();
72
+ throw new Error("API transport failed; inspect retained state before retrying a write");
73
+ }
74
+ if (response.type === "opaqueredirect" || response.redirected || response.status >= 300 && response.status < 400 && response.status !== 304) {
75
+ try {
76
+ await response.body?.cancel();
77
+ } catch {
78
+ }
79
+ throw new Error("API redirects are not allowed");
80
+ }
81
+ return response;
82
+ };
83
+ }
84
+
85
+ export {
86
+ groupConversationMessages,
87
+ createApiKeyFetch
88
+ };
89
+ //# sourceMappingURL=chunk-TZEEGDHS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/web/message-groups.ts","../src/web/api-key-fetch.ts"],"sourcesContent":["/** Renderer-neutral attribution. Not a transcript merger or an execution state machine. */\nexport interface ConversationGroupItem {\n id?: string | number\n kind?: string\n role?: string\n /** A different assistant/persona must never inherit the previous speaker's label. */\n speakerId?: string\n /** Distinct threads must not be grouped if their rows share a viewport. */\n conversationId?: string\n}\nexport type GroupedConversationItem<T> = T & { isContinuation?: boolean; groupId?: string }\n\n/**\n * Annotate assistant rows until an actual user message, speaker or conversation change.\n * Tool/progress notices do not interrupt the group. The first visible assistant is\n * always labeled, including when a renderer has paged earlier history away.\n * Pass display order; stored content, IDs, timestamps and input objects are untouched.\n */\nexport function groupConversationMessages<T extends ConversationGroupItem>(items: readonly T[] = []): GroupedConversationItem<T>[] {\n let speaker: string | null = null\n let conversation: string | undefined\n let groupId: string | undefined\n return items.map((item, index) => {\n if (item.conversationId !== undefined && item.conversationId !== conversation) {\n conversation = item.conversationId\n speaker = null\n groupId = undefined\n }\n const role = item.kind === 'thinking' ? 'assistant' : (!item.kind || item.kind === 'message' ? item.role : undefined)\n if (role === 'user') { speaker = null; groupId = undefined; return { ...item, isContinuation: false } }\n if (role !== 'assistant') return item\n const current = item.speakerId ?? 'assistant'\n const isContinuation = speaker === current\n if (!isContinuation) groupId = String(item.id ?? `assistant-${index}`)\n speaker = current\n return { ...item, isContinuation, groupId }\n })\n}\n","/** A credential-bearing client for one application origin, not a web fetch tool. */\nexport interface ApiKeyFetchOptions {\n origin: string\n /** Resolve from trusted client secret storage; never from an agent's arguments. */\n getApiKey(): string | Promise<string>\n fetchImpl?: typeof fetch\n /** Explicit local-development opt-in; never permits remote plaintext origins. */\n allowHttpLoopback?: boolean\n}\n\nexport type ApiKeyFetch = (path: string, init?: RequestInit) => Promise<Response>\n\n/** No redirects, cookie fallback, hidden retries, or model-selected credential destination. */\nexport function createApiKeyFetch(options: ApiKeyFetchOptions): ApiKeyFetch {\n const origin = new URL(options.origin)\n const loopback = ['localhost', '127.0.0.1', '[::1]'].includes(origin.hostname)\n if (origin.username || origin.password || origin.pathname !== '/' || origin.search || origin.hash\n || (origin.protocol !== 'https:' && !(origin.protocol === 'http:' && loopback && options.allowHttpLoopback))) {\n throw new TypeError('API origin must be HTTPS without credentials, path, query, or fragment')\n }\n const fetchImpl = options.fetchImpl ?? globalThis.fetch\n if (typeof fetchImpl !== 'function') throw new TypeError('A fetch implementation is required')\n const getApiKey = options.getApiKey\n\n return async (path, init = {}) => {\n // Reject URL-parser repairs and authority-relative references before resolving secrets.\n if (typeof path !== 'string' || !path.startsWith('/') || path.startsWith('//')\n || /[\\\\\\u0000-\\u0020\\u007f]/.test(path)) {\n throw new TypeError('API requests require a root-relative path without whitespace or backslashes')\n }\n const target = new URL(path, origin)\n if (target.origin !== origin.origin || target.username || target.password || target.hash) {\n throw new TypeError('API requests must stay on the configured origin without a fragment')\n }\n const headers = new Headers(init.headers)\n if (headers.has('authorization') || headers.has('cookie') || headers.has('proxy-authorization')) {\n throw new TypeError('Authentication headers must come from the configured secret resolver')\n }\n init.signal?.throwIfAborted()\n let apiKey: string\n try {\n apiKey = await getApiKey()\n } catch {\n throw new Error('API credential is unavailable')\n }\n if (typeof apiKey !== 'string' || !apiKey || /\\s|[^\\x21-\\x7e]/.test(apiKey)) {\n throw new TypeError('API credential must be a nonempty printable token without whitespace')\n }\n init.signal?.throwIfAborted()\n headers.set('Authorization', `Bearer ${apiKey}`)\n let response: Response\n try {\n response = await fetchImpl(target.href, {\n ...init, headers, credentials: 'omit', redirect: 'manual', referrerPolicy: 'no-referrer',\n })\n } catch {\n // A failed transport does not establish that an external action did not run.\n // Do not forward an adapter's diagnostic, which could include the bearer.\n init.signal?.throwIfAborted()\n throw new Error('API transport failed; inspect retained state before retrying a write')\n }\n if (response.type === 'opaqueredirect' || response.redirected\n || (response.status >= 300 && response.status < 400 && response.status !== 304)) {\n try { await response.body?.cancel() } catch { /* Preserve the redirect refusal. */ }\n throw new Error('API redirects are not allowed')\n }\n return response\n }\n}\n"],"mappings":";AAkBO,SAAS,0BAA2D,QAAsB,CAAC,GAAiC;AACjI,MAAI,UAAyB;AAC7B,MAAI;AACJ,MAAI;AACJ,SAAO,MAAM,IAAI,CAAC,MAAM,UAAU;AAChC,QAAI,KAAK,mBAAmB,UAAa,KAAK,mBAAmB,cAAc;AAC7E,qBAAe,KAAK;AACpB,gBAAU;AACV,gBAAU;AAAA,IACZ;AACA,UAAM,OAAO,KAAK,SAAS,aAAa,cAAe,CAAC,KAAK,QAAQ,KAAK,SAAS,YAAY,KAAK,OAAO;AAC3G,QAAI,SAAS,QA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,KAAK,QAAQ,IAAI,qBAAqB,GAAG;AAC/F,YAAM,IAAI,UAAU,sEAAsE;AAAA,IAC5F;AACA,SAAK,QAAQ,eAAe;AAC5B,QAAI;AACJ,QAAI;AACF,eAAS,MAAM,UAAU;AAAA,IAC3B,QAAQ;AACN,YAAM,IAAI,MAAM,+BAA+B;AAAA,IACjD;AACA,QAAI,OAAO,WAAW,YAAY,CAAC,UAAU,kBAAkB,KAAK,MAAM,GAAG;AAC3E,YAAM,IAAI,UAAU,sEAAsE;AAAA,IAC5F;AACA,SAAK,QAAQ,eAAe;AAC5B,YAAQ,IAAI,iBAAiB,UAAU,MAAM,EAAE;AAC/C,QAAI;AACJ,QAAI;AACF,iBAAW,MAAM,UAAU,OAAO,MAAM;AAAA,QACtC,GAAG;AAAA,QAAM;AAAA,QAAS,aAAa;AAAA,QAAQ,UAAU;AAAA,QAAU,gBAAgB;AAAA,MAC7E,CAAC;AAAA,IACH,QAAQ;AAGN,WAAK,QAAQ,eAAe;AAC5B,YAAM,IAAI,MAAM,sEAAsE;AAAA,IACxF;AACA,QAAI,SAAS,SAAS,oBAAoB,SAAS,cAC7C,SAAS,UAAU,OAAO,SAAS,SAAS,OAAO,SAAS,WAAW,KAAM;AACjF,UAAI;AAAE,cAAM,SAAS,MAAM,OAAO;AAAA,MAAE,QAAQ;AAAA,MAAuC;AACnF,YAAM,IAAI,MAAM,+BAA+B;AAAA,IACjD;AACA,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -13,13 +13,13 @@ import {
13
13
  setPageGuidesCommand,
14
14
  setPagePropsCommand,
15
15
  ungroupElementCommand
16
- } from "./chunk-FEVVF6JJ.js";
16
+ } from "./chunk-HQ7R6CGM.js";
17
17
  import {
18
18
  SIZE_PRESETS,
19
19
  findElement,
20
20
  matchPreset,
21
21
  requirePage
22
- } from "./chunk-BWQPVS7D.js";
22
+ } from "./chunk-H6XQZFTT.js";
23
23
 
24
24
  // src/design-canvas-react/components/DesignCanvas.tsx
25
25
  import { useCallback as useCallback2, useEffect as useEffect3, useMemo, useRef as useRef5, useState as useState5, useSyncExternalStore } from "react";
@@ -2261,4 +2261,4 @@ export {
2261
2261
  ExportControl,
2262
2262
  DesignCanvas
2263
2263
  };
2264
- //# sourceMappingURL=chunk-KWN5PGXM.js.map
2264
+ //# sourceMappingURL=chunk-YJYPXMDL.js.map
@@ -31,12 +31,13 @@ import {
31
31
  validateSceneOperation,
32
32
  validateSceneOperations,
33
33
  validateSlotValue
34
- } from "../chunk-BWQPVS7D.js";
34
+ } from "../chunk-H6XQZFTT.js";
35
35
  import {
36
36
  buildScopedMcpServerEntry,
37
37
  createMcpToolHandler
38
38
  } from "../chunk-6A7MYOUI.js";
39
- import "../chunk-EA4UVS4T.js";
39
+ import "../chunk-TZEEGDHS.js";
40
+ import "../chunk-3NCPXNBZ.js";
40
41
  import "../chunk-TXD5HXLE.js";
41
42
 
42
43
  // src/design-canvas/operations.ts