@tangle-network/agent-app 0.63.60 → 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.
Files changed (75) hide show
  1. package/dist/{DesignCanvas-Q65UV4D5.js → DesignCanvas-566V5KVC.js} +3 -2
  2. package/dist/{DesignCanvasEditor-THEFESEX.js → DesignCanvasEditor-YWDEFWYQ.js} +3 -2
  3. package/dist/app-auth/index.js +2 -1
  4. package/dist/app-auth/index.js.map +1 -1
  5. package/dist/assistant/index.js +6 -5
  6. package/dist/assistant/index.js.map +1 -1
  7. package/dist/chat-react/index.js +3 -3
  8. package/dist/chat-routes/agent-producers.d.ts +38 -0
  9. package/dist/chat-routes/index.d.ts +1 -0
  10. package/dist/chat-routes/index.js +25 -8
  11. package/dist/chat-routes/index.js.map +1 -1
  12. package/dist/chat-routes/turn-admission.d.ts +3 -3
  13. package/dist/chat-routes/turn-route-contracts.d.ts +38 -1
  14. package/dist/chat-routes/wire.d.ts +29 -4
  15. package/dist/chat-store/index.js +4 -2
  16. package/dist/chat-store/index.js.map +1 -1
  17. package/dist/chat-store/parts.d.ts +19 -3
  18. package/dist/{chunk-P7UB7ZVP.js → chunk-75I4RXIE.js} +2 -2
  19. package/dist/{chunk-GGJYAV7R.js → chunk-DPZXCVVS.js} +2 -2
  20. package/dist/{chunk-GGJYAV7R.js.map → chunk-DPZXCVVS.js.map} +1 -1
  21. package/dist/{chunk-LAZCUQFZ.js → chunk-F2N55QQX.js} +47 -10
  22. package/dist/chunk-F2N55QQX.js.map +1 -0
  23. package/dist/{chunk-QGJOT6R6.js → chunk-F6UC2T6U.js} +49 -9
  24. package/dist/{chunk-QGJOT6R6.js.map → chunk-F6UC2T6U.js.map} +1 -1
  25. package/dist/{chunk-AICYKYYF.js → chunk-MIQL36JS.js} +17 -4
  26. package/dist/chunk-MIQL36JS.js.map +1 -0
  27. package/dist/{chunk-RILVJYXJ.js → chunk-N5KBDRSX.js} +2 -2
  28. package/dist/{chunk-IDQ7N36R.js → chunk-O2TYB3DH.js} +2 -2
  29. package/dist/{chunk-H6BRJU5M.js → chunk-RKNNMC6T.js} +1 -1
  30. package/dist/{chunk-HHPQMFKP.js → chunk-RNFVAAJJ.js} +2 -2
  31. package/dist/{chunk-KFO5R4SN.js → chunk-RVC7EHJI.js} +135 -64
  32. package/dist/chunk-RVC7EHJI.js.map +1 -0
  33. package/dist/{chunk-4E2MUVGL.js → chunk-TFV4QOCG.js} +3 -3
  34. package/dist/chunk-XBBXPZJI.js +47 -0
  35. package/dist/chunk-XBBXPZJI.js.map +1 -0
  36. package/dist/design-canvas/index.js +2 -1
  37. package/dist/design-canvas/index.js.map +1 -1
  38. package/dist/design-canvas-react/engine.js +2 -1
  39. package/dist/design-canvas-react/index.js +3 -2
  40. package/dist/design-canvas-react/index.js.map +1 -1
  41. package/dist/design-canvas-react/lazy.js +1 -1
  42. package/dist/operator/index.js +2 -2
  43. package/dist/platform/index.js +2 -1
  44. package/dist/platform/index.js.map +1 -1
  45. package/dist/preset-cloudflare/index.js +4 -4
  46. package/dist/public-consultation/index.d.ts +2 -2
  47. package/dist/public-consultation/index.js +7 -6
  48. package/dist/public-consultation/index.js.map +1 -1
  49. package/dist/sandbox/index.js +2 -2
  50. package/dist/sequences/index.js +2 -1
  51. package/dist/sequences/index.js.map +1 -1
  52. package/dist/stories/chat/fixtures.d.ts +4 -0
  53. package/dist/web/index.d.ts +1 -0
  54. package/dist/web/index.js +7 -1
  55. package/dist/web/speakers.d.ts +30 -0
  56. package/dist/web-react/chat-messages.d.ts +1 -1
  57. package/dist/web-react/chat-stream.d.ts +7 -0
  58. package/dist/web-react/entry-composer.d.ts +2 -2
  59. package/dist/web-react/index.js +8 -5
  60. package/dist/web-react/use-file-mentions.d.ts +23 -4
  61. package/dist/workspace-react/index.d.ts +29 -1
  62. package/dist/workspace-react/index.js +34 -0
  63. package/dist/workspace-react/index.js.map +1 -1
  64. package/package.json +1 -1
  65. package/dist/chunk-AICYKYYF.js.map +0 -1
  66. package/dist/chunk-KFO5R4SN.js.map +0 -1
  67. package/dist/chunk-LAZCUQFZ.js.map +0 -1
  68. /package/dist/{DesignCanvas-Q65UV4D5.js.map → DesignCanvas-566V5KVC.js.map} +0 -0
  69. /package/dist/{DesignCanvasEditor-THEFESEX.js.map → DesignCanvasEditor-YWDEFWYQ.js.map} +0 -0
  70. /package/dist/{chunk-P7UB7ZVP.js.map → chunk-75I4RXIE.js.map} +0 -0
  71. /package/dist/{chunk-RILVJYXJ.js.map → chunk-N5KBDRSX.js.map} +0 -0
  72. /package/dist/{chunk-IDQ7N36R.js.map → chunk-O2TYB3DH.js.map} +0 -0
  73. /package/dist/{chunk-H6BRJU5M.js.map → chunk-RKNNMC6T.js.map} +0 -0
  74. /package/dist/{chunk-HHPQMFKP.js.map → chunk-RNFVAAJJ.js.map} +0 -0
  75. /package/dist/{chunk-4E2MUVGL.js.map → chunk-TFV4QOCG.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ComposerModeControls,
3
3
  EntryComposer
4
- } from "../chunk-GGJYAV7R.js";
4
+ } from "../chunk-DPZXCVVS.js";
5
5
  import "../chunk-L7MB2LLM.js";
6
6
  import "../chunk-ARCXYOMS.js";
7
7
  import "../chunk-2HQP2CTA.js";
@@ -10,8 +10,8 @@ import "../chunk-RO25WIVS.js";
10
10
  import "../chunk-ZAMHLXNS.js";
11
11
  import "../chunk-SJWIZT7B.js";
12
12
  import "../chunk-RASGKEAL.js";
13
- import "../chunk-P7UB7ZVP.js";
14
- import "../chunk-QGJOT6R6.js";
13
+ import "../chunk-75I4RXIE.js";
14
+ import "../chunk-F6UC2T6U.js";
15
15
  import "../chunk-AMUXRAUO.js";
16
16
  import "../chunk-RCSAAWOH.js";
17
17
  import "../chunk-TXD5HXLE.js";
@@ -0,0 +1,38 @@
1
+ /**
2
+ * A turn addressed to several agents runs them one after another, in mention
3
+ * order, as one producer: the route sees one stream, persists one assistant
4
+ * row, and the row's parts carry a `speaker` part before each responder's
5
+ * parts so a transcript can draw each answer under its author. The live
6
+ * stream carries the same boundary as a `speaker` event, so a viewer can
7
+ * open a new block as each agent starts.
8
+ *
9
+ * Sequential on purpose: one live block at a time is what a reader can follow,
10
+ * the order is the order typed, and the box runs one session at a time per
11
+ * turn. Running responders concurrently is an internal change here, not a
12
+ * change to what is stored.
13
+ */
14
+ import type { ChatTurnIdentity } from '@tangle-network/agent-runtime/durable';
15
+ import type { TurnTrace } from '../turn-trace/recorder';
16
+ import type { ChatTurnAgentsOptions, ChatTurnAgentTarget, ChatTurnProduceArgs, ChatTurnRouteProducer } from './turn-route-contracts';
17
+ import { type ChatMention } from './wire';
18
+ /**
19
+ * Name a turn's responders from its agent mentions, before any lock, row or
20
+ * model call: the product's resolver maps mentioned ids to the profiles they
21
+ * run as, and a mention it does not return is refused. The thread's binding
22
+ * does not move. Returns the response to send on refusal, otherwise the
23
+ * produce args carrying `agents` in mention order (unchanged when none).
24
+ */
25
+ export declare function addressAgents<TContext, TResource>(input: {
26
+ options: {
27
+ agents?: ChatTurnAgentsOptions<TContext>;
28
+ };
29
+ mentions: readonly ChatMention[];
30
+ identity: ChatTurnIdentity;
31
+ context: TContext;
32
+ produceArgs: ChatTurnProduceArgs<TContext, TResource>;
33
+ trace: TurnTrace;
34
+ }): Promise<Response | ChatTurnProduceArgs<TContext, TResource>>;
35
+ /** The event a viewer receives when the next responder starts. */
36
+ export declare const SPEAKER_EVENT = "speaker";
37
+ export declare function speakerPart(agent: ChatTurnAgentTarget): Record<string, unknown>;
38
+ export declare function composeAgentProducers<TContext, TResource>(args: ChatTurnProduceArgs<TContext, TResource>, produce: (final: ChatTurnProduceArgs<TContext, TResource>) => ChatTurnRouteProducer | Promise<ChatTurnRouteProducer>): Promise<ChatTurnRouteProducer>;
@@ -7,6 +7,7 @@
7
7
  * re-exported through `/web-react`'s chat-stream glue.
8
8
  */
9
9
  export * from './wire';
10
+ export { composeAgentProducers, SPEAKER_EVENT, speakerPart } from './agent-producers';
10
11
  export * from './binary-sniff';
11
12
  export * from './attachment-validation';
12
13
  export * from './turn-routes';
@@ -27,7 +27,7 @@ import {
27
27
  sanitizeAttachmentFileName,
28
28
  sniffBinary,
29
29
  sniffedMimeImpliedByName
30
- } from "../chunk-P7UB7ZVP.js";
30
+ } from "../chunk-75I4RXIE.js";
31
31
  import {
32
32
  assertSafeKeySegment
33
33
  } from "../chunk-6DOQ6T2O.js";
@@ -40,7 +40,7 @@ import {
40
40
  observeNativeCompletion,
41
41
  readCompletedSandboxTurn,
42
42
  recoverSandboxAssistantMessage
43
- } from "../chunk-RILVJYXJ.js";
43
+ } from "../chunk-N5KBDRSX.js";
44
44
  import {
45
45
  runProtectedRouterTurn
46
46
  } from "../chunk-6XEW5YXP.js";
@@ -53,12 +53,14 @@ import {
53
53
  INTENT_LINE_TIMEOUT_MS,
54
54
  MAX_EMPTY_TURN_RETRIES,
55
55
  ModelFailoverTimeoutError,
56
+ SPEAKER_EVENT,
56
57
  UPLOAD_INLINE_MAX_BYTES,
57
58
  UPLOAD_MAX_FILE_BYTES,
58
59
  buildDispatchParts,
59
60
  bytesToBase64,
60
61
  cancelChatTurn,
61
62
  classifyTerminalFailure,
63
+ composeAgentProducers,
62
64
  createChatTurnRoutes,
63
65
  createHybridTurnProducer,
64
66
  createRouterTurnProducer,
@@ -72,6 +74,7 @@ import {
72
74
  resolveEmptyTurnRetries,
73
75
  routerTurnHistory,
74
76
  sanitizeUploadFilename,
77
+ speakerPart,
75
78
  startHybridBox,
76
79
  streamChatRouteAsSandboxEvents,
77
80
  streamWithModelFailover,
@@ -79,13 +82,14 @@ import {
79
82
  turnCarriesFiles,
80
83
  turnPromptText,
81
84
  withProducerStream
82
- } from "../chunk-KFO5R4SN.js";
85
+ } from "../chunk-RVC7EHJI.js";
83
86
  import "../chunk-SBHFMDR7.js";
84
- import "../chunk-H6BRJU5M.js";
87
+ import "../chunk-RKNNMC6T.js";
88
+ import "../chunk-XBBXPZJI.js";
85
89
  import "../chunk-4DBHC63F.js";
86
90
  import "../chunk-RN4WPTBH.js";
87
91
  import "../chunk-MM6RLOXF.js";
88
- import "../chunk-IDQ7N36R.js";
92
+ import "../chunk-O2TYB3DH.js";
89
93
  import "../chunk-F4TUZYMX.js";
90
94
  import {
91
95
  redactErrorMessage
@@ -96,14 +100,14 @@ import {
96
100
  isDraftContentEvent,
97
101
  rowIdOf,
98
102
  storeSupportsDraftPersistence
99
- } from "../chunk-HHPQMFKP.js";
103
+ } from "../chunk-RNFVAAJJ.js";
100
104
  import "../chunk-2PCNHHN2.js";
101
105
  import "../chunk-YG66IHDU.js";
102
106
  import {
103
107
  attachmentInputToPart,
104
108
  attachmentKindForMime,
105
109
  toChatMessageParts
106
- } from "../chunk-AICYKYYF.js";
110
+ } from "../chunk-MIQL36JS.js";
107
111
  import "../chunk-ZVEEWGDK.js";
108
112
  import {
109
113
  getPartKey,
@@ -122,6 +126,7 @@ import {
122
126
  createBufferedTurnTap
123
127
  } from "../chunk-3Q3UEWKK.js";
124
128
  import {
129
+ AGENT_HANDLE_PATTERN,
125
130
  ChatTurnInputError,
126
131
  DISPATCH_MAX_MEDIA_PARTS,
127
132
  DISPATCH_MAX_PARTS,
@@ -136,24 +141,28 @@ import {
136
141
  TURN_RESPONSE_EVENT,
137
142
  TURN_ROUTE_PHASE_MESSAGES,
138
143
  TURN_STREAM_LOST_CODE,
144
+ agentMentionsOf,
139
145
  assertPromptPartsWithinCap,
140
146
  base64WireLen,
141
147
  buildMentionPromptBlock,
142
148
  buildTurnPhaseEvent,
143
149
  chatTurnRequestInit,
150
+ fileMentionsOf,
144
151
  fileMentionsToParts,
145
152
  formatBytes,
153
+ isAgentMention,
146
154
  isTurnIntentEvent,
147
155
  isTurnPhaseEvent,
148
156
  mediaTypeForMentionPath,
149
157
  mentionKindForPath,
150
158
  parseChatTurnParts,
151
159
  parseFileMentions,
160
+ parseMentions,
152
161
  promptPartsByteSize,
153
162
  settleTurnResponse,
154
163
  turnResponseEventFor,
155
164
  validateSandboxMentionPath
156
- } from "../chunk-QGJOT6R6.js";
165
+ } from "../chunk-F6UC2T6U.js";
157
166
  import "../chunk-L3QR274L.js";
158
167
  import "../chunk-XELWWXJJ.js";
159
168
  import "../chunk-DSMGS4IV.js";
@@ -1916,6 +1925,7 @@ function createStoredChatAttachments(options) {
1916
1925
  return { readAttachment, writeAttachment, getAttachmentObject, attachmentObjectKey };
1917
1926
  }
1918
1927
  export {
1928
+ AGENT_HANDLE_PATTERN,
1919
1929
  ALLOWED_ATTACHMENT_SNIFFED_MIMES,
1920
1930
  ATTACHMENT_ACCEPT,
1921
1931
  ATTACHMENT_MAX_COUNT,
@@ -1953,6 +1963,7 @@ export {
1953
1963
  OOXML_WORD_MIME,
1954
1964
  PROMOTE_MAX_FILE_BYTES,
1955
1965
  RUNTIME_RESTARTED_ERROR,
1966
+ SPEAKER_EVENT,
1956
1967
  STREAM_SNIFF_HEAD_BYTES,
1957
1968
  STREAM_SNIFF_TAIL_BYTES,
1958
1969
  TOOL_ABORTED_ERROR,
@@ -1965,6 +1976,7 @@ export {
1965
1976
  TURN_STREAM_LOST_CODE,
1966
1977
  UPLOAD_INLINE_MAX_BYTES,
1967
1978
  UPLOAD_MAX_FILE_BYTES,
1979
+ agentMentionsOf,
1968
1980
  aggregateNativeCompletionReceipts,
1969
1981
  assertPromptPartsWithinCap,
1970
1982
  assistantRowIdForTurn,
@@ -1980,6 +1992,7 @@ export {
1980
1992
  chatTurnRequestInit,
1981
1993
  checkAttachmentType,
1982
1994
  classifyTerminalFailure,
1995
+ composeAgentProducers,
1983
1996
  createAssistantDraftWriter,
1984
1997
  createAtomicAttachmentWriter,
1985
1998
  createAttachmentUploadRoute,
@@ -1994,9 +2007,11 @@ export {
1994
2007
  createStreamingSniffer,
1995
2008
  createUploadRoute,
1996
2009
  defaultValidateAttachmentPath,
2010
+ fileMentionsOf,
1997
2011
  fileMentionsToParts,
1998
2012
  formatBytes,
1999
2013
  immutableAttachmentPath,
2014
+ isAgentMention,
2000
2015
  isCommittingSandboxEvent,
2001
2016
  isDraftContentEvent,
2002
2017
  isLiveLifecycleEvent,
@@ -2011,6 +2026,7 @@ export {
2011
2026
  parseChatAttachmentInputs,
2012
2027
  parseChatTurnParts,
2013
2028
  parseFileMentions,
2029
+ parseMentions,
2014
2030
  parsePlanFollowUpAttach,
2015
2031
  planFollowUpExecutionId,
2016
2032
  prepareDispatchAttachments,
@@ -2033,6 +2049,7 @@ export {
2033
2049
  sniffBinary,
2034
2050
  sniffMimeFromName,
2035
2051
  sniffedMimeImpliedByName,
2052
+ speakerPart,
2036
2053
  startHybridBox,
2037
2054
  storeSupportsDraftPersistence,
2038
2055
  streamChatRouteAsSandboxEvents,