@tangle-network/agent-app 0.43.47 → 0.43.49

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 (57) hide show
  1. package/dist/assistant/index.d.ts +3 -2
  2. package/dist/assistant/index.js +4 -3
  3. package/dist/assistant/index.js.map +1 -1
  4. package/dist/chat-routes/index.d.ts +394 -4
  5. package/dist/chat-routes/index.js +510 -12
  6. package/dist/chat-routes/index.js.map +1 -1
  7. package/dist/chat-store/index.d.ts +3 -2
  8. package/dist/chat-store/index.js +19 -1
  9. package/dist/chat-store/index.js.map +1 -1
  10. package/dist/chunk-23LUHHHN.js +282 -0
  11. package/dist/chunk-23LUHHHN.js.map +1 -0
  12. package/dist/{chunk-UHXQ3KNX.js → chunk-54GSK2KK.js} +4 -4
  13. package/dist/{chunk-4AUQIAYU.js → chunk-5MG74GVQ.js} +2 -281
  14. package/dist/chunk-5MG74GVQ.js.map +1 -0
  15. package/dist/{chunk-5RJNEEO2.js → chunk-HRJJH3RX.js} +2 -2
  16. package/dist/{chunk-6E2XJSCT.js → chunk-JGYOYY5D.js} +65 -2
  17. package/dist/chunk-JGYOYY5D.js.map +1 -0
  18. package/dist/{chunk-E7QYOOON.js → chunk-MCJSS6SM.js} +2 -1
  19. package/dist/chunk-MCJSS6SM.js.map +1 -0
  20. package/dist/chunk-NBSBRZ6F.js +337 -0
  21. package/dist/chunk-NBSBRZ6F.js.map +1 -0
  22. package/dist/{chunk-7VMUOD3G.js → chunk-O6H2WD3I.js} +2 -2
  23. package/dist/chunk-O6H2WD3I.js.map +1 -0
  24. package/dist/{file-index-Bn6sitKb.d.ts → file-index-b26ee-_R.d.ts} +1 -1
  25. package/dist/harness/index.d.ts +1 -1
  26. package/dist/harness/index.js +1 -1
  27. package/dist/index.d.ts +3 -2
  28. package/dist/index.js +119 -103
  29. package/dist/{parts-1_3y2JmR.d.ts → parts-IB-Kbb7z.d.ts} +146 -2
  30. package/dist/preset-cloudflare/index.js +2 -2
  31. package/dist/profile/index.d.ts +13 -2
  32. package/dist/profile/index.js +25 -4
  33. package/dist/profile/index.js.map +1 -1
  34. package/dist/prompt/index.d.ts +2 -1
  35. package/dist/prompt/index.js.map +1 -1
  36. package/dist/run/index.js +1 -1
  37. package/dist/sandbox/index.d.ts +1 -1
  38. package/dist/sandbox/index.js +2 -2
  39. package/dist/skills/index.d.ts +183 -8
  40. package/dist/skills/index.js +21 -3
  41. package/dist/skills-placement/index.d.ts +52 -0
  42. package/dist/skills-placement/index.js +44 -0
  43. package/dist/skills-placement/index.js.map +1 -0
  44. package/dist/stream/index.d.ts +4 -47
  45. package/dist/stream/index.js +14 -12
  46. package/dist/stream-normalizer-DWvtmY6F.d.ts +48 -0
  47. package/dist/web-react/index.d.ts +4 -3
  48. package/dist/web-react/index.js +25 -3
  49. package/package.json +12 -2
  50. package/dist/chunk-4AUQIAYU.js.map +0 -1
  51. package/dist/chunk-6E2XJSCT.js.map +0 -1
  52. package/dist/chunk-7VMUOD3G.js.map +0 -1
  53. package/dist/chunk-E7QYOOON.js.map +0 -1
  54. package/dist/chunk-KOG473C4.js +0 -132
  55. package/dist/chunk-KOG473C4.js.map +0 -1
  56. /package/dist/{chunk-UHXQ3KNX.js.map → chunk-54GSK2KK.js.map} +0 -0
  57. /package/dist/{chunk-5RJNEEO2.js.map → chunk-HRJJH3RX.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import { F as FileMention } from './parts-1_3y2JmR.js';
1
+ import { K as FileMention } from './parts-IB-Kbb7z.js';
2
2
 
3
3
  /**
4
4
  * `createSandboxFileIndexRoute` — server side of `@`-file-mentions
@@ -23,7 +23,7 @@ export { modelProvider } from '@tangle-network/agent-interface';
23
23
 
24
24
  /** The known coding-agent backends. Mirrors `@tangle-network/sandbox`'s
25
25
  * `BackendType`; kept structural so this module needs no sandbox dependency. */
26
- declare const KNOWN_HARNESSES: readonly ["opencode", "claude-code", "kimi-code", "codex", "amp", "factory-droids", "pi", "hermes", "forge", "openclaw", "acp", "cursor", "cli-base"];
26
+ declare const KNOWN_HARNESSES: readonly ["opencode", "claude-code", "nanoclaw", "kimi-code", "codex", "amp", "factory-droids", "pi", "hermes", "forge", "openclaw", "acp", "cursor", "cli-base"];
27
27
  type Harness = (typeof KNOWN_HARNESSES)[number];
28
28
  declare const DEFAULT_HARNESS: Harness;
29
29
  declare function isHarness(value: unknown): value is Harness;
@@ -9,7 +9,7 @@ import {
9
9
  resolveSessionHarness,
10
10
  snapHarnessToModel,
11
11
  snapModelToHarness
12
- } from "../chunk-E7QYOOON.js";
12
+ } from "../chunk-MCJSS6SM.js";
13
13
  export {
14
14
  DEFAULT_HARNESS,
15
15
  KNOWN_HARNESSES,
package/dist/index.d.ts CHANGED
@@ -17,9 +17,10 @@ export { KeyCrypto, KeyProvisioner, PlanLimit, PlatformBalanceInfo, PlatformBala
17
17
  export { HttpHeadProbeConfig, PreflightProbe, PreflightProbeResult, PreflightProbeVerdict, PreflightReport, RouterChatProbeConfig, SandboxAuthProbeConfig, formatPreflightReport, httpHeadProbe, routerChatProbe, runPreflight, sandboxAuthProbe } from './preflight/index.js';
18
18
  export { ObjectBody, ObjectKeyParts, ObjectStore, PutObjectOptions, R2LikeBucket, R2LikeObjectBody, R2LikeObjectHead, SignObjectUrlArgs, VerifyObjectUrlResult, assertSafeKeySegment, createProxiedArtifactRoute, createR2ObjectStore, objectKey, signObjectUrl, verifyObjectUrl } from './object-store/index.js';
19
19
  export { B as BULK_DELETE_MAX_THREADS, C as ChatStoreInputError, t as threadTitleFromMessage } from './core-7qIM7svy.js';
20
- export { C as ChatFilePart, a as ChatImagePart, b as ChatInteractionPart, c as ChatMentionKind, d as ChatMentionPart, e as ChatMessagePart, f as ChatNoticePart, g as ChatPartTime, h as ChatPlanPart, i as ChatReasoningPart, j as ChatStepFinishPart, k as ChatStepStartPart, l as ChatSubtaskPart, m as ChatTextPart, n as ChatToolPart, o as ChatToolState, p as ChatToolStatus, q as ChatUsageTokens, S as StorableHarnessPartKind, r as isChatInteractionPart, s as isChatMentionPart, t as isChatPlanPart, u as isChatStepFinishPart, v as isChatTextPart, w as isChatToolPart, x as mentionInputToPart, y as mentionPartsFromMessageParts, z as toChatMessageParts } from './parts-1_3y2JmR.js';
20
+ export { C as ChatAttachmentKind, a as ChatAttachmentPart, b as ChatFilePart, c as ChatImagePart, d as ChatInteractionPart, e as ChatMentionKind, f as ChatMentionPart, g as ChatMessagePart, h as ChatNoticePart, i as ChatPartTime, j as ChatPlanPart, k as ChatReasoningPart, l as ChatStepFinishPart, m as ChatStepStartPart, n as ChatSubtaskPart, o as ChatTextPart, p as ChatToolPart, q as ChatToolState, r as ChatToolStatus, s as ChatUsageTokens, D as DEFAULT_ATTACHMENT_PROMPT_HEADER, S as StorableHarnessPartKind, t as attachmentInputToPart, u as attachmentKindForMime, v as attachmentPartsFromMessageParts, w as buildAttachmentPromptBlock, x as historyContentWithAttachments, y as isChatAttachmentPart, z as isChatInteractionPart, A as isChatMentionPart, B as isChatPlanPart, E as isChatStepFinishPart, F as isChatTextPart, G as isChatToolPart, H as mentionInputToPart, I as mentionPartsFromMessageParts, J as toChatMessageParts } from './parts-IB-Kbb7z.js';
21
21
  export { DeriveKeyOptions, createFieldCrypto, decodeHexKey, decryptAesGcm, decryptBytes, decryptWithKey, deriveKey, encryptAesGcm, encryptBytes, encryptWithKey } from './crypto/index.js';
22
- export { JsonRecord, MISSING_TOOL_TERMINAL_ERROR, MISSING_TOOL_TERMINAL_REASON, PersistedChatMessageForTurn, ResolvedChatTurn, StreamEvent, asRecord, asString, attachmentPartKey, buildUserTextParts, collapseRedundantTextParts, encodeEvent, finalizeAssistantParts, finalizePendingInteractionParts, getPartKey, mergePersistedPart, messageHasTurnId, normalizeClientTurnId, normalizePersistedPart, normalizeTime, normalizeToolEvent, resolveChatTurn, resolveToolId, resolveToolName, terminalizeDanglingAssistantToolUpdates, terminalizeDanglingToolPart, terminalizeDanglingToolParts } from './stream/index.js';
22
+ export { J as JsonRecord, M as MISSING_TOOL_TERMINAL_ERROR, a as MISSING_TOOL_TERMINAL_REASON, S as StreamEvent, b as asRecord, c as asString, d as attachmentPartKey, e as collapseRedundantTextParts, f as encodeEvent, g as finalizeAssistantParts, h as finalizePendingInteractionParts, i as getPartKey, m as mergePersistedPart, n as normalizePersistedPart, j as normalizeTime, k as normalizeToolEvent, r as resolveToolId, l as resolveToolName, t as terminalizeDanglingAssistantToolUpdates, o as terminalizeDanglingToolPart, p as terminalizeDanglingToolParts } from './stream-normalizer-DWvtmY6F.js';
23
+ export { PersistedChatMessageForTurn, ResolvedChatTurn, buildUserTextParts, messageHasTurnId, normalizeClientTurnId, resolveChatTurn } from './stream/index.js';
23
24
  export { B as BufferedTurnEvent, a as BufferedTurnOptions, b as BufferedTurnTap, D as D1LikeForTurns, P as PumpBufferedTurnOptions, R as ReplayTurnEventsOptions, T as TURN_EVENTS_MIGRATION_SQL, c as TURN_STATUS_SCOPE_MIGRATION_SQL, d as TurnEventStore, e as TurnStatus, f as coalesceChatStreamEvents, g as coalesceDeltas, h as createBufferedTurnTap, i as createD1TurnEventStore, j as createMemoryTurnEventStore, p as pumpBufferedTurn, r as replayTurnEvents } from './turn-buffer-C9mEgoop.js';
24
25
  export { HubExecClient, HubExecClientOptions, HubExecErrorCode, HubExecResult, HubInvokeDeps, HubInvokeInput, HubInvokeOutcome, ParsedIntegrationAction, invokeIntegrationHub, resolveIntegrationAction } from './integrations/index.js';
25
26
  export { C as ChatInteraction, a as ChatInteractionField, b as ChatInteractionStatus, c as ChatSelectField, d as ComposerAnswerDelivery, I as INTERACTION_CANCEL_EVENT, e as INTERACTION_EVENT, f as INTERACTION_RESOLVED_EVENT, g as InteractionAnswerValue, h as InteractionAnswers, i as InteractionCancelData, j as InteractionPersistedPart, k as InteractionRequestWire, N as NoticeKind, l as NoticePersistedPart, P as ParseInteractionAnswersResult, m as ParseInteractionResult, n as canTransitionInteractionStatus, o as cancelStatusFor, p as composerAnswerData, q as composerAnswerDeliveries, r as dedupeQuestionInteractionsByContent, s as fieldAcceptsFreeText, t as interactionFromWireRequest, u as interactionPartKey, v as interactionToPersistedPart, w as isRenderableInteractionKind, x as isSafeInteractionFieldKey, y as isTerminalInteractionStatus, z as noticePart, A as noticePartKey, B as parseInteractionAnswers, D as parseInteractionCancel, E as parseInteractionRequest, F as persistedPartToInteraction, G as questionInteractionContentSignature, H as stampInteractionAnswers } from './contract-KfqJh_au.js';
package/dist/index.js CHANGED
@@ -2,12 +2,68 @@ import "./chunk-UAKFCMWK.js";
2
2
  import {
3
3
  checkThemeContract
4
4
  } from "./chunk-NYATNLRK.js";
5
+ import {
6
+ CANVAS_ELEMENT_KINDS,
7
+ CANVAS_MCP_TOOLS,
8
+ CANVAS_MCP_TOOL_NAMES,
9
+ DEFAULT_DESIGN_CANVAS_MCP_DESCRIPTION,
10
+ SCENE_OPERATION_TYPES,
11
+ applyBindingsToDocument,
12
+ buildDesignCanvasMcpServerEntry,
13
+ createDesignCanvasMcpHandler,
14
+ findCanvasMcpTool,
15
+ instantiateTemplate,
16
+ listTemplateSlots,
17
+ validateBindings
18
+ } from "./chunk-WFMUDX5J.js";
5
19
  import {
6
20
  darkTheme,
7
21
  lightTheme,
8
22
  themeColor,
9
23
  themeToCssVars
10
24
  } from "./chunk-47C6PJCW.js";
25
+ import {
26
+ CHANNEL_PRESETS,
27
+ EXPORT_PRESETS,
28
+ SCENE_ELEMENT_KINDS,
29
+ SCENE_SCHEMA_VERSION,
30
+ SIZE_PRESETS,
31
+ applySceneOperation,
32
+ applySceneOperations,
33
+ assertColor,
34
+ assertFinite,
35
+ assertPositiveFinite,
36
+ assertSceneMediaSrc,
37
+ bleedAwareExportBounds,
38
+ bleedAwareExportRect,
39
+ boundsIntersect,
40
+ collectSlots,
41
+ createEmptyDocument,
42
+ createPage,
43
+ elementAabb,
44
+ elementExtent,
45
+ estimateTextHeight,
46
+ findElement,
47
+ findPreset,
48
+ matchPreset,
49
+ requireChannelPreset,
50
+ requireElement,
51
+ requirePage,
52
+ scaleForPreset,
53
+ scalePageForChannelPreset,
54
+ storeApplyScenePlan,
55
+ validateSceneOperation,
56
+ validateSceneOperations,
57
+ validateSlotValue
58
+ } from "./chunk-M2EBUDZ7.js";
59
+ import {
60
+ DEFAULT_REDACTION_PATTERNS,
61
+ buildRedactedDocument,
62
+ detectSpans,
63
+ maskSpans,
64
+ redactForIngestion,
65
+ revealSpan
66
+ } from "./chunk-5RMIUJDI.js";
11
67
  import {
12
68
  buildFlowTrace,
13
69
  childSpanContext,
@@ -85,68 +141,12 @@ import {
85
141
  snapshotFrame,
86
142
  trackIntervals
87
143
  } from "./chunk-ZYBWGSAZ.js";
88
- import {
89
- CANVAS_ELEMENT_KINDS,
90
- CANVAS_MCP_TOOLS,
91
- CANVAS_MCP_TOOL_NAMES,
92
- DEFAULT_DESIGN_CANVAS_MCP_DESCRIPTION,
93
- SCENE_OPERATION_TYPES,
94
- applyBindingsToDocument,
95
- buildDesignCanvasMcpServerEntry,
96
- createDesignCanvasMcpHandler,
97
- findCanvasMcpTool,
98
- instantiateTemplate,
99
- listTemplateSlots,
100
- validateBindings
101
- } from "./chunk-WFMUDX5J.js";
102
- import {
103
- CHANNEL_PRESETS,
104
- EXPORT_PRESETS,
105
- SCENE_ELEMENT_KINDS,
106
- SCENE_SCHEMA_VERSION,
107
- SIZE_PRESETS,
108
- applySceneOperation,
109
- applySceneOperations,
110
- assertColor,
111
- assertFinite,
112
- assertPositiveFinite,
113
- assertSceneMediaSrc,
114
- bleedAwareExportBounds,
115
- bleedAwareExportRect,
116
- boundsIntersect,
117
- collectSlots,
118
- createEmptyDocument,
119
- createPage,
120
- elementAabb,
121
- elementExtent,
122
- estimateTextHeight,
123
- findElement,
124
- findPreset,
125
- matchPreset,
126
- requireChannelPreset,
127
- requireElement,
128
- requirePage,
129
- scaleForPreset,
130
- scalePageForChannelPreset,
131
- storeApplyScenePlan,
132
- validateSceneOperation,
133
- validateSceneOperations,
134
- validateSlotValue
135
- } from "./chunk-M2EBUDZ7.js";
136
144
  import {
137
145
  composeMissionFlowTrace,
138
146
  delegationActivityToFlowSpans,
139
147
  loopTraceEventsToFlowSpans,
140
148
  stepActivityFlowTrace
141
149
  } from "./chunk-2QI7XV2T.js";
142
- import {
143
- DEFAULT_REDACTION_PATTERNS,
144
- buildRedactedDocument,
145
- detectSpans,
146
- maskSpans,
147
- redactForIngestion,
148
- revealSpan
149
- } from "./chunk-5RMIUJDI.js";
150
150
  import {
151
151
  HubExecClient,
152
152
  invokeIntegrationHub,
@@ -217,7 +217,18 @@ import {
217
217
  createPresetToolHandlers,
218
218
  createPresetWorkspaceKeyManager,
219
219
  createPresetWorkspaceKeyStore
220
- } from "./chunk-UHXQ3KNX.js";
220
+ } from "./chunk-54GSK2KK.js";
221
+ import {
222
+ createFieldCrypto,
223
+ decodeHexKey,
224
+ decryptAesGcm,
225
+ decryptBytes,
226
+ decryptWithKey,
227
+ deriveKey,
228
+ encryptAesGcm,
229
+ encryptBytes,
230
+ encryptWithKey
231
+ } from "./chunk-TA5Q4I2K.js";
221
232
  import {
222
233
  createPlatformBalanceManager,
223
234
  createTcloudKeyProvisioner,
@@ -244,39 +255,31 @@ import {
244
255
  threadTitleFromMessage
245
256
  } from "./chunk-5EQCITY3.js";
246
257
  import {
247
- MISSING_TOOL_TERMINAL_ERROR,
248
- MISSING_TOOL_TERMINAL_REASON,
258
+ addSecurityHeaders,
259
+ assertMediaUrl,
260
+ checkRateLimit,
261
+ clearCookieHeader,
262
+ extractRequestContext,
263
+ parseJsonObjectBody,
264
+ readCookieValue,
265
+ requireString,
266
+ serializeCookie
267
+ } from "./chunk-HFC4BTWJ.js";
268
+ import {
249
269
  TURN_EVENTS_MIGRATION_SQL,
250
270
  TURN_STATUS_SCOPE_MIGRATION_SQL,
251
- asRecord,
252
- asString,
253
- attachmentPartKey,
254
271
  buildUserTextParts,
255
272
  coalesceChatStreamEvents,
256
273
  coalesceDeltas,
257
- collapseRedundantTextParts,
258
274
  createBufferedTurnTap,
259
275
  createD1TurnEventStore,
260
276
  createMemoryTurnEventStore,
261
- encodeEvent,
262
- finalizeAssistantParts,
263
- finalizePendingInteractionParts,
264
- getPartKey,
265
- mergePersistedPart,
266
277
  messageHasTurnId,
267
278
  normalizeClientTurnId,
268
- normalizePersistedPart,
269
- normalizeTime,
270
- normalizeToolEvent,
271
279
  pumpBufferedTurn,
272
280
  replayTurnEvents,
273
- resolveChatTurn,
274
- resolveToolId,
275
- resolveToolName,
276
- terminalizeDanglingAssistantToolUpdates,
277
- terminalizeDanglingToolPart,
278
- terminalizeDanglingToolParts
279
- } from "./chunk-4AUQIAYU.js";
281
+ resolveChatTurn
282
+ } from "./chunk-23LUHHHN.js";
280
283
  import {
281
284
  createInteractionAnswerRoute,
282
285
  listSessionInteractions,
@@ -285,17 +288,13 @@ import {
285
288
  validateInteractionAnswerBody
286
289
  } from "./chunk-6KVH5SP5.js";
287
290
  import {
288
- addSecurityHeaders,
289
- assertMediaUrl,
290
- checkRateLimit,
291
- clearCookieHeader,
292
- extractRequestContext,
293
- parseJsonObjectBody,
294
- readCookieValue,
295
- requireString,
296
- serializeCookie
297
- } from "./chunk-HFC4BTWJ.js";
298
- import {
291
+ DEFAULT_ATTACHMENT_PROMPT_HEADER,
292
+ attachmentInputToPart,
293
+ attachmentKindForMime,
294
+ attachmentPartsFromMessageParts,
295
+ buildAttachmentPromptBlock,
296
+ historyContentWithAttachments,
297
+ isChatAttachmentPart,
299
298
  isChatInteractionPart,
300
299
  isChatMentionPart,
301
300
  isChatPlanPart,
@@ -305,7 +304,28 @@ import {
305
304
  mentionInputToPart,
306
305
  mentionPartsFromMessageParts,
307
306
  toChatMessageParts
308
- } from "./chunk-6E2XJSCT.js";
307
+ } from "./chunk-JGYOYY5D.js";
308
+ import {
309
+ MISSING_TOOL_TERMINAL_ERROR,
310
+ MISSING_TOOL_TERMINAL_REASON,
311
+ asRecord,
312
+ asString,
313
+ attachmentPartKey,
314
+ collapseRedundantTextParts,
315
+ encodeEvent,
316
+ finalizeAssistantParts,
317
+ finalizePendingInteractionParts,
318
+ getPartKey,
319
+ mergePersistedPart,
320
+ normalizePersistedPart,
321
+ normalizeTime,
322
+ normalizeToolEvent,
323
+ resolveToolId,
324
+ resolveToolName,
325
+ terminalizeDanglingAssistantToolUpdates,
326
+ terminalizeDanglingToolPart,
327
+ terminalizeDanglingToolParts
328
+ } from "./chunk-5MG74GVQ.js";
309
329
  import {
310
330
  INTERACTION_CANCEL_EVENT,
311
331
  INTERACTION_EVENT,
@@ -341,17 +361,6 @@ import {
341
361
  planRevisionKey,
342
362
  planToPersistedPart
343
363
  } from "./chunk-SIXYZ2FB.js";
344
- import {
345
- createFieldCrypto,
346
- decodeHexKey,
347
- decryptAesGcm,
348
- decryptBytes,
349
- decryptWithKey,
350
- deriveKey,
351
- encryptAesGcm,
352
- encryptBytes,
353
- encryptWithKey
354
- } from "./chunk-TA5Q4I2K.js";
355
364
  import {
356
365
  createKnowledgeLoop,
357
366
  createReviewerDecider,
@@ -417,7 +426,7 @@ import {
417
426
  verifySandboxTerminalToken,
418
427
  verifyTerminalProxyToken,
419
428
  writeProfileFilesToBox
420
- } from "./chunk-5RJNEEO2.js";
429
+ } from "./chunk-HRJJH3RX.js";
421
430
  import {
422
431
  DEFAULT_HARNESS,
423
432
  KNOWN_HARNESSES,
@@ -429,7 +438,7 @@ import {
429
438
  resolveSessionHarness,
430
439
  snapHarnessToModel,
431
440
  snapModelToHarness
432
- } from "./chunk-E7QYOOON.js";
441
+ } from "./chunk-MCJSS6SM.js";
433
442
  import {
434
443
  createCapabilityToken,
435
444
  createExpiringCapabilityToken,
@@ -524,6 +533,7 @@ export {
524
533
  ConversionMetricsSchema,
525
534
  CopyContentSchema,
526
535
  DEFAULT_APP_TOOL_PATHS,
536
+ DEFAULT_ATTACHMENT_PROMPT_HEADER,
527
537
  DEFAULT_DESIGN_CANVAS_MCP_DESCRIPTION,
528
538
  DEFAULT_HARNESS,
529
539
  DEFAULT_HEADER_NAMES,
@@ -604,7 +614,10 @@ export {
604
614
  assertSceneMediaSrc,
605
615
  assertSequenceMediaUrl,
606
616
  attachReasoningEffort,
617
+ attachmentInputToPart,
618
+ attachmentKindForMime,
607
619
  attachmentPartKey,
620
+ attachmentPartsFromMessageParts,
608
621
  authenticateToolRequest,
609
622
  bearerSubprotocolToken,
610
623
  bearerToken,
@@ -616,6 +629,7 @@ export {
616
629
  buildAppToolMcpServer,
617
630
  buildAppToolMcpServers,
618
631
  buildAppToolOpenAITools,
632
+ buildAttachmentPromptBlock,
619
633
  buildCaptionChunks,
620
634
  buildCatalog,
621
635
  buildConsentUrl,
@@ -755,6 +769,7 @@ export {
755
769
  getClient,
756
770
  getPartKey,
757
771
  handleAppToolRequest,
772
+ historyContentWithAttachments,
758
773
  httpHeadProbe,
759
774
  instantiateTemplate,
760
775
  interactionFromWireRequest,
@@ -762,6 +777,7 @@ export {
762
777
  interactionToPersistedPart,
763
778
  invokeIntegrationHub,
764
779
  isAppToolName,
780
+ isChatAttachmentPart,
765
781
  isChatInteractionPart,
766
782
  isChatMentionPart,
767
783
  isChatPlanPart,
@@ -29,6 +29,27 @@ interface ChatTurnFilePartInput {
29
29
  content?: string;
30
30
  }
31
31
  type ChatTurnPartInput = ChatTurnTextPartInput | ChatTurnFilePartInput;
32
+ /** The image/file split an attachment is rendered and persisted under — the
33
+ * same discriminant as {@link ChatMentionKind}, but a distinct name because an
34
+ * attachment carries content the product uploaded (`ChatAttachmentInput`)
35
+ * while a mention points at a file the box already has. Defined HERE (the
36
+ * import-free layer) so `ChatAttachmentInput` can reference it and the client
37
+ * composer imports it without pulling the persisted-part vocabulary;
38
+ * `/chat-store`'s parts module re-exports it alongside the attachment helpers. */
39
+ type ChatAttachmentKind = 'image' | 'file';
40
+ /** `POST` turn-body entry describing a file already uploaded to the product's
41
+ * store (vault/object-store) — distinct from an inline {@link
42
+ * ChatTurnFilePartInput} (which carries bytes) and from a {@link FileMention}
43
+ * (a sandbox path the box already holds). The route resolves this field with
44
+ * {@link resolveChatAttachments}: every path is re-validated and every size is
45
+ * re-derived from the stored body, so nothing here is trusted as sent. */
46
+ interface ChatAttachmentInput {
47
+ path: string;
48
+ name: string;
49
+ size: number;
50
+ mediaType: string;
51
+ kind: ChatAttachmentKind;
52
+ }
32
53
  /** POST body for the turn route. `content` may be empty when `parts` carry the
33
54
  * message (an image-only send). Product routing fields (workspaceId etc.) ride
34
55
  * alongside and are read by the product's `authorize` seam. */
@@ -45,6 +66,12 @@ interface ChatTurnRequestPayload {
45
66
  * route validates this field with {@link parseFileMentions} and replaces it
46
67
  * on the payload with the validated, deduped list. */
47
68
  mentions?: FileMention[];
69
+ /** Files uploaded to the product's store ahead of the turn — path
70
+ * references, NOT inline bytes (those ride `parts`). Validated and
71
+ * size-re-derived by {@link resolveChatAttachments} into persistable
72
+ * attachment parts; a product whose `parts` field is spoken for by inline
73
+ * uploads still sends store-backed files here. */
74
+ attachments?: ChatAttachmentInput[];
48
75
  model?: string;
49
76
  effort?: 'auto' | 'low' | 'medium' | 'high';
50
77
  harness?: string;
@@ -57,6 +84,41 @@ interface ChatTurnRequestPayload {
57
84
  * parser. */
58
85
  declare function chatTurnRequestInit(payload: ChatTurnRequestPayload): RequestInit;
59
86
  declare const INLINE_PARTS_MAX_BYTES = 950000;
87
+ /** Hard cap on the whole `/prompt` request body as it crosses the sandbox
88
+ * proxy — smaller in practice than a raw-file write cap because a dispatch
89
+ * carries several inline parts plus the flattened history in one request. */
90
+ declare const DISPATCH_REQUEST_MAX_BYTES: number;
91
+ /** Bytes reserved off the top of {@link DISPATCH_REQUEST_MAX_BYTES} for the
92
+ * JSON structure around the parts array (keys, delimiters, per-part
93
+ * `type`/`filename`/`mediaType` fields) that {@link base64WireLen} does not
94
+ * account for — keeps the inline budget off the exact proxy cap where one
95
+ * stray byte trips the 413. */
96
+ declare const DISPATCH_STRUCTURAL_RESERVE_BYTES: number;
97
+ /** Sidecar's hard cap on the `parts` array of one prompt request — a dispatch
98
+ * must never assemble more parts than this or the whole turn 400s. */
99
+ declare const DISPATCH_MAX_PARTS = 64;
100
+ /** Product-side cap on media parts per dispatch (current turn + carried
101
+ * history), well under {@link DISPATCH_MAX_PARTS}. History trimming that keeps
102
+ * a transcript's native media under this is a PRODUCT concern (the pointer
103
+ * block keeps trimmed media reachable); `buildDispatchParts` enforces only the
104
+ * total {@link DISPATCH_MAX_PARTS} cap. */
105
+ declare const DISPATCH_MAX_MEDIA_PARTS = 24;
106
+ /** Size a base64-encoded string occupies on the wire given the raw
107
+ * (pre-encoding) byte length: base64 packs 3 raw bytes into 4 output
108
+ * characters, rounded up to the next multiple of 4. */
109
+ declare function base64WireLen(byteLen: number): number;
110
+ /**
111
+ * Render a raw byte count as a human-readable size (`512B`, `3KB`, `12MB
112
+ * 500KB`). Ported EXACTLY from gtm-agent's `attachment-limits.ts` — byte-
113
+ * identical implementation, not a reinterpretation — so `resolve-attachments`'s
114
+ * and `promote-file-part`'s error strings match gtm's wording verbatim. Lives
115
+ * in the import-free wire layer (not `resolve-attachments.ts` alone) because
116
+ * BOTH the aggregate-cap message here and the per-file oversize message in
117
+ * `promote-file-part.ts` need it; a browser composer wanting the same
118
+ * formatting for a client-side pre-check can also import it with no engine
119
+ * pulled in.
120
+ */
121
+ declare function formatBytes(bytes: number): string;
60
122
  declare class ChatTurnInputError extends Error {
61
123
  readonly status: number;
62
124
  readonly code: string;
@@ -229,11 +291,15 @@ interface ChatToolPart {
229
291
  state: ChatToolState;
230
292
  }
231
293
  /** Union of the sidecar's legacy (path-based) and AI-SDK (url-based) file
232
- * shapes; response-side every field besides `type` is optional. */
294
+ * shapes; response-side every field besides `type` is optional. `name` is the
295
+ * attachment-flavored display label an uploaded/promoted file carries (see
296
+ * {@link ChatAttachmentPart}) — absent on a harness-emitted file part, which
297
+ * uses `filename`. */
233
298
  interface ChatFilePart {
234
299
  type: 'file';
235
300
  id?: string;
236
301
  filename?: string;
302
+ name?: string;
237
303
  mediaType?: string;
238
304
  url?: string;
239
305
  path?: string;
@@ -242,6 +308,7 @@ interface ChatFilePart {
242
308
  interface ChatImagePart {
243
309
  type: 'image';
244
310
  filename?: string;
311
+ name?: string;
245
312
  mediaType?: string;
246
313
  url?: string;
247
314
  path?: string;
@@ -364,5 +431,82 @@ declare function mentionPartsFromMessageParts(parts: ReadonlyArray<Record<string
364
431
  * than stored as `undefined`, so a stored row never carries a key that means
365
432
  * nothing. */
366
433
  declare function mentionInputToPart(input: FileMention): ChatMentionPart;
434
+ /** `image` for any `image/*` mime, `file` for everything else (including an
435
+ * absent/empty mime) — the same split the composer and the persisted-part
436
+ * discriminant both key on. */
437
+ declare function attachmentKindForMime(mime?: string): ChatAttachmentKind;
438
+
439
+ /**
440
+ * Persisted attachment part: structurally an attachment-flavored `ChatFilePart`
441
+ * / `ChatImagePart` (`path` + `name` promoted to required) rather than a
442
+ * separate union member — see the section note above. The index signature keeps
443
+ * it a `Record<string, unknown>` so it drops into the same untyped `parts`
444
+ * arrays every other stored part rides in, and lets the `type`-driven
445
+ * constructors below build it without union-discriminant gymnastics.
446
+ */
447
+ interface ChatAttachmentPart {
448
+ type: ChatAttachmentKind;
449
+ path: string;
450
+ name: string;
451
+ size?: number;
452
+ mediaType?: string;
453
+ turnId?: string;
454
+ [key: string]: unknown;
455
+ }
456
+ /** True for any `image`/`file` part carrying a non-empty string `path`.
457
+ * DELIBERATELY also matches a sidecar path-bearing file part (a mention-style
458
+ * `file` part with only `path`) — the guard is a structural attachment shape,
459
+ * not proof of provenance; a caller that needs to exclude those filters
460
+ * upstream. The `path.length > 0` check diverges from gtm's original guard
461
+ * (which only checked `typeof`), mirroring sibling {@link isChatMentionPart}:
462
+ * read-side robustness against a stored `{type:'file', path:''}` row — which
463
+ * would otherwise render a malformed `(vault: )` pointer line — justifies the
464
+ * small divergence from byte-for-byte gtm parity here; no legitimate write
465
+ * path ever produces an empty `path`. */
466
+ declare function isChatAttachmentPart(part: unknown): part is ChatAttachmentPart;
467
+ /** Drop absent/empty optional fields rather than persisting `undefined`/`''`
468
+ * — keeps stored parts minimal. */
469
+ declare function attachmentInputToPart(input: ChatAttachmentInput): ChatAttachmentPart;
470
+ /** Every attachment part on one message's stored `parts`, in stored order. */
471
+ declare function attachmentPartsFromMessageParts(parts: ReadonlyArray<Record<string, unknown>> | null | undefined): ChatAttachmentPart[];
472
+ /** gtm's exact default header for {@link buildAttachmentPromptBlock} — kept
473
+ * byte-identical because it feeds dispatched prompts (gtm-agent#618
474
+ * reproduces the prompt bytes through this module). Override only with intent. */
475
+ declare const DEFAULT_ATTACHMENT_PROMPT_HEADER = "Attached files (already saved to the workspace vault \u2014 read them from these paths):";
476
+ /**
477
+ * The agent-facing pointer block appended to the dispatched prompt — never
478
+ * persisted in `message.content`. Empty array → `''` so callers can append
479
+ * unconditionally. The sole producer of this text: both the current turn's
480
+ * dispatch and history projection ({@link historyContentWithAttachments}) build
481
+ * it from here, so the two can never drift. `header` overrides the first line
482
+ * ({@link DEFAULT_ATTACHMENT_PROMPT_HEADER}); the per-file line format is fixed.
483
+ *
484
+ * Every interpolated `name`/`path` is swept for control characters first
485
+ * (newline/carriage-return/tab included) and each one replaced with a single
486
+ * space — a single-line-per-file guarantee. Without it, a control character
487
+ * riding through on a PERSISTED row (`historyContentWithAttachments` reads
488
+ * whatever is already stored; a legacy or hand-edited row was never re-checked
489
+ * against `resolveChatAttachments`) could inject extra lines — fabricated
490
+ * pointer entries or instructions — into a prompt the agent trusts verbatim.
491
+ * The wire-side validator is the primary control; this is the backstop for
492
+ * rows it never saw.
493
+ */
494
+ declare function buildAttachmentPromptBlock(atts: ReadonlyArray<Pick<ChatAttachmentPart, 'name' | 'path'>>, header?: string): string;
495
+ /**
496
+ * History projection for a persisted message: `content` unchanged when it
497
+ * carries no attachment parts, else the block is appended once. The
498
+ * no-double-annotation guarantee holds under the invariant that the block is
499
+ * never persisted INTO `message.content` — it is appended only at read time,
500
+ * by this function and the current turn's dispatch, both sourcing from
501
+ * `attachmentPartsFromMessageParts` — never by content inspection. This
502
+ * function does not (and cannot) detect an already-embedded block by scanning
503
+ * `content` for its text: a message whose stored `content` happens to already
504
+ * contain the block's bytes, alongside attachment parts, still gets the block
505
+ * appended a second time. See the pinned test for that boundary.
506
+ */
507
+ declare function historyContentWithAttachments(message: {
508
+ content: string;
509
+ parts?: ReadonlyArray<Record<string, unknown>> | null;
510
+ }, header?: string): string;
367
511
 
368
- export { type ChatTurnRequestPayload as A, type ChatTurnPartInput as B, type ChatFilePart as C, type ChatTurnFilePartInput as D, ChatTurnInputError as E, type FileMention as F, type ChatTurnTextPartInput as G, type FileMentionsToPartsOptions as H, INLINE_PARTS_MAX_BYTES as I, type SandboxMentionPathCheck as J, assertPromptPartsWithinCap as K, buildMentionPromptBlock as L, MENTION_MAX_COUNT as M, chatTurnRequestInit as N, fileMentionsToParts as O, mediaTypeForMentionPath as P, mentionKindForPath as Q, parseChatTurnParts as R, type StorableHarnessPartKind as S, parseFileMentions as T, promptPartsByteSize as U, validateSandboxMentionPath as V, type ChatImagePart as a, type ChatInteractionPart as b, type ChatMentionKind as c, type ChatMentionPart as d, type ChatMessagePart as e, type ChatNoticePart as f, type ChatPartTime as g, type ChatPlanPart as h, type ChatReasoningPart as i, type ChatStepFinishPart as j, type ChatStepStartPart as k, type ChatSubtaskPart as l, type ChatTextPart as m, type ChatToolPart as n, type ChatToolState as o, type ChatToolStatus as p, type ChatUsageTokens as q, isChatInteractionPart as r, isChatMentionPart as s, isChatPlanPart as t, isChatStepFinishPart as u, isChatTextPart as v, isChatToolPart as w, mentionInputToPart as x, mentionPartsFromMessageParts as y, toChatMessageParts as z };
512
+ export { base64WireLen as $, isChatMentionPart as A, isChatPlanPart as B, type ChatAttachmentKind as C, DEFAULT_ATTACHMENT_PROMPT_HEADER as D, isChatStepFinishPart as E, isChatTextPart as F, isChatToolPart as G, mentionInputToPart as H, mentionPartsFromMessageParts as I, toChatMessageParts as J, type FileMention as K, type ChatTurnRequestPayload as L, type ChatTurnPartInput as M, type ChatTurnFilePartInput as N, type ChatAttachmentInput as O, ChatTurnInputError as P, type ChatTurnTextPartInput as Q, DISPATCH_MAX_MEDIA_PARTS as R, type StorableHarnessPartKind as S, DISPATCH_MAX_PARTS as T, DISPATCH_REQUEST_MAX_BYTES as U, DISPATCH_STRUCTURAL_RESERVE_BYTES as V, type FileMentionsToPartsOptions as W, INLINE_PARTS_MAX_BYTES as X, MENTION_MAX_COUNT as Y, type SandboxMentionPathCheck as Z, assertPromptPartsWithinCap as _, type ChatAttachmentPart as a, buildMentionPromptBlock as a0, chatTurnRequestInit as a1, fileMentionsToParts as a2, formatBytes as a3, mediaTypeForMentionPath as a4, mentionKindForPath as a5, parseChatTurnParts as a6, parseFileMentions as a7, promptPartsByteSize as a8, validateSandboxMentionPath as a9, type ChatFilePart as b, type ChatImagePart as c, type ChatInteractionPart as d, type ChatMentionKind as e, type ChatMentionPart as f, type ChatMessagePart as g, type ChatNoticePart as h, type ChatPartTime as i, type ChatPlanPart as j, type ChatReasoningPart as k, type ChatStepFinishPart as l, type ChatStepStartPart as m, type ChatSubtaskPart as n, type ChatTextPart as o, type ChatToolPart as p, type ChatToolState as q, type ChatToolStatus as r, type ChatUsageTokens as s, attachmentInputToPart as t, attachmentKindForMime as u, attachmentPartsFromMessageParts as v, buildAttachmentPromptBlock as w, historyContentWithAttachments as x, isChatAttachmentPart as y, isChatInteractionPart as z };
@@ -7,9 +7,9 @@ import {
7
7
  createPresetToolHandlers,
8
8
  createPresetWorkspaceKeyManager,
9
9
  createPresetWorkspaceKeyStore
10
- } from "../chunk-UHXQ3KNX.js";
11
- import "../chunk-G3HCU7TA.js";
10
+ } from "../chunk-54GSK2KK.js";
12
11
  import "../chunk-TA5Q4I2K.js";
12
+ import "../chunk-G3HCU7TA.js";
13
13
  export {
14
14
  PRESET_MIGRATION_SQL,
15
15
  PRESET_TABLES,
@@ -1,8 +1,8 @@
1
- import { AgentProfileFileMount, AgentProfileMcpServer, AgentProfile } from '@tangle-network/sandbox';
1
+ import { AgentProfileFileMount, AgentProfileResourceRef, AgentProfileMcpServer, AgentProfile } from '@tangle-network/sandbox';
2
2
  import { profile } from '@tangle-network/agent-eval';
3
3
  export { profile } from '@tangle-network/agent-eval';
4
4
  import { SkillEntry } from '../skills/index.js';
5
- export { ComposeShellResourcesInput, CorpusEntry, CorpusLoadResult, GlobModules, LoadCorpusOptions, composeShellResources, corpusSkills, loadMarkdownCorpus, registrySkills, skillMountPath } from '../skills/index.js';
5
+ export { ComposeShellResourcesInput, ComposedSkills, CorpusEntry, CorpusLoadResult, GlobModules, LoadCorpusOptions, ParsedSkill, SkillDeliveryMode, SkillFrontmatter, assertSkillDeliveryDisjoint, composeShellResources, composeSkills, corpusSkills, loadMarkdownCorpus, mergeComposedSkills, parseCorpusSkills, parseSkillFrontmatter, registrySkills, renderInlineSkills, renderSkillIndex, skillEntryFromMarkdown, skillMountPath, skillRefs } from '../skills/index.js';
6
6
 
7
7
  /**
8
8
  * Profile composer + evolvable-section seam for agent products.
@@ -61,6 +61,17 @@ interface ProfileChannels {
61
61
  userSkills?: UserSkill[];
62
62
  /** Final skip filter applied to the composed mount list by mount `path`. */
63
63
  filesPredicate?: (mount: AgentProfileFileMount) => boolean;
64
+ /** Typed `resources.skills` channel — refs the platform materializer places
65
+ * at the harness-native skill dir (see {@link skillRefs} and
66
+ * `@tangle-network/agent-app/skills-placement`'s `composeSkillsForHarness`).
67
+ * The successor to path-baked mounts: `registry`/`userSkills` above mount
68
+ * files at the hardcoded claude-code path via {@link skillMountPath};
69
+ * `skillRefs` instead rides the provider-neutral `resources.skills` field
70
+ * the platform resolves per harness. */
71
+ skillRefs?: AgentProfileResourceRef[];
72
+ /** Tier passed to {@link registrySkills} for the `registry` channel.
73
+ * Previously hardcoded `'free'`; default unchanged. */
74
+ registryTier?: string;
64
75
  }
65
76
  /** A per-user / per-workspace skill: an id and an inline `SKILL.md` body. The
66
77
  * user-facing analogue of a registry {@link SkillEntry} with no tier gate —