@tangle-network/agent-app 0.44.28 → 0.44.30

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 (50) hide show
  1. package/dist/assistant/index.d.ts +8 -6
  2. package/dist/assistant/index.js +6 -3
  3. package/dist/assistant/index.js.map +1 -1
  4. package/dist/{attachment-validation-Dvc_Livy.d.ts → attachment-validation-CNkH91Gs.d.ts} +1 -1
  5. package/dist/chat-react/index.d.ts +192 -0
  6. package/dist/chat-react/index.js +179 -0
  7. package/dist/chat-react/index.js.map +1 -0
  8. package/dist/chat-routes/index.d.ts +7 -6
  9. package/dist/chat-routes/index.js +13 -9
  10. package/dist/chat-routes/index.js.map +1 -1
  11. package/dist/chat-store/index.d.ts +6 -5
  12. package/dist/chat-store/index.js +2 -1
  13. package/dist/chat-store/index.js.map +1 -1
  14. package/dist/chunk-4OO7P3ZF.js +292 -0
  15. package/dist/chunk-4OO7P3ZF.js.map +1 -0
  16. package/dist/chunk-4PUMUTLU.js +158 -0
  17. package/dist/chunk-4PUMUTLU.js.map +1 -0
  18. package/dist/{chunk-7775L5NN.js → chunk-BAC2B2KI.js} +170 -7
  19. package/dist/chunk-BAC2B2KI.js.map +1 -0
  20. package/dist/{chunk-PRKSYTMQ.js → chunk-GCH3BUAZ.js} +31 -317
  21. package/dist/chunk-GCH3BUAZ.js.map +1 -0
  22. package/dist/{chunk-BI6NKSO4.js → chunk-IYLJS6VW.js} +3 -84
  23. package/dist/chunk-IYLJS6VW.js.map +1 -0
  24. package/dist/chunk-QY4BRKRJ.js +84 -0
  25. package/dist/chunk-QY4BRKRJ.js.map +1 -0
  26. package/dist/{chunk-C3SRFZGL.js → chunk-QYAQGCHF.js} +2 -154
  27. package/dist/chunk-QYAQGCHF.js.map +1 -0
  28. package/dist/{contract-CEewO6DI.d.ts → contract-CQNvv5th.d.ts} +1 -1
  29. package/dist/interactions/index.d.ts +2 -2
  30. package/dist/{parts-fyPPdDdK.d.ts → parts-7fbe2rj8.d.ts} +4 -274
  31. package/dist/{queue-vRI0Qx3X.d.ts → queue-VTBA5ONX.d.ts} +1 -1
  32. package/dist/sandbox/index.d.ts +253 -1
  33. package/dist/sandbox/index.js +9 -1
  34. package/dist/stream/index.d.ts +3 -3
  35. package/dist/{stream-normalizer-DnuqkZvw.d.ts → stream-normalizer-CnPnMaTp.d.ts} +1 -1
  36. package/dist/teams/index.js +5 -5
  37. package/dist/teams/invitations-api.js +4 -4
  38. package/dist/teams-react/index.js +3 -3
  39. package/dist/{types-DB82fktc.d.ts → types-CCeYywdS.d.ts} +1 -1
  40. package/dist/use-file-mentions-E6a7_cbH.d.ts +98 -0
  41. package/dist/web-react/index.d.ts +13 -104
  42. package/dist/web-react/index.js +17 -12
  43. package/dist/wire-DSp4LzEE.d.ts +272 -0
  44. package/dist/work-product/index.d.ts +3 -3
  45. package/dist/work-product-react/index.d.ts +1 -1
  46. package/package.json +6 -1
  47. package/dist/chunk-7775L5NN.js.map +0 -1
  48. package/dist/chunk-BI6NKSO4.js.map +0 -1
  49. package/dist/chunk-C3SRFZGL.js.map +0 -1
  50. package/dist/chunk-PRKSYTMQ.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import { J as JsonRecord } from '../stream-normalizer-DnuqkZvw.js';
2
- export { M as MISSING_TOOL_TERMINAL_ERROR, b as MISSING_TOOL_TERMINAL_REASON, S as StreamEvent, c as asRecord, d as asString, a as attachmentPartKey, e as collapseRedundantTextParts, f as draftAssistantParts, g as encodeEvent, h as finalizeAssistantParts, i as finalizePendingInteractionParts, j as getPartKey, m as mergePersistedPart, n as normalizePersistedPart, k as normalizeTime, l as normalizeToolEvent, r as resolveToolId, o as resolveToolName, t as terminalizeDanglingAssistantToolUpdates, p as terminalizeDanglingToolPart, q as terminalizeDanglingToolParts } from '../stream-normalizer-DnuqkZvw.js';
1
+ import { J as JsonRecord } from '../stream-normalizer-CnPnMaTp.js';
2
+ export { M as MISSING_TOOL_TERMINAL_ERROR, b as MISSING_TOOL_TERMINAL_REASON, S as StreamEvent, c as asRecord, d as asString, a as attachmentPartKey, e as collapseRedundantTextParts, f as draftAssistantParts, g as encodeEvent, h as finalizeAssistantParts, i as finalizePendingInteractionParts, j as getPartKey, m as mergePersistedPart, n as normalizePersistedPart, k as normalizeTime, l as normalizeToolEvent, r as resolveToolId, o as resolveToolName, t as terminalizeDanglingAssistantToolUpdates, p as terminalizeDanglingToolPart, q as terminalizeDanglingToolParts } from '../stream-normalizer-CnPnMaTp.js';
3
3
  export { B as BufferedTurnEvent, a as BufferedTurnOptions, b as BufferedTurnTap, D as D1LikeForTurns, P as PumpBufferedTurnOptions, R as ReplayTurnEventsOptions, c as TURN_EVENTS_MIGRATION_SQL, d as TURN_STATUS_SCOPE_MIGRATION_SQL, T 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, s as stampReplaySeq } from '../turn-buffer-BcPfhr1_.js';
4
- import '../contract-CEewO6DI.js';
4
+ import '../contract-CQNvv5th.js';
5
5
  import '@tangle-network/agent-interface';
6
6
 
7
7
  /** Define the structure of a chat message stored for a specific conversation turn */
@@ -1,4 +1,4 @@
1
- import { C as ChatInteractionStatus } from './contract-CEewO6DI.js';
1
+ import { a as ChatInteractionStatus } from './contract-CQNvv5th.js';
2
2
 
3
3
  /** Represent a JSON-compatible object with string keys and values of any type */
4
4
  type JsonRecord = Record<string, unknown>;
@@ -1,3 +1,8 @@
1
+ import {
2
+ generateInviteToken,
3
+ isInviteTokenShape,
4
+ validateInviteToken
5
+ } from "../chunk-DJ4VJIH5.js";
1
6
  import {
2
7
  INVITATION_EXPIRY_DAYS,
3
8
  generateInvitationToken,
@@ -7,11 +12,6 @@ import {
7
12
  parseInvitationPermission,
8
13
  renderInvitationEmail
9
14
  } from "../chunk-2DRYTJHI.js";
10
- import {
11
- generateInviteToken,
12
- isInviteTokenShape,
13
- validateInviteToken
14
- } from "../chunk-DJ4VJIH5.js";
15
15
  import {
16
16
  ASSIGNABLE_WORKSPACE_ROLES,
17
17
  ORGANIZATION_ROLES,
@@ -1,3 +1,7 @@
1
+ import {
2
+ SeatLimitError
3
+ } from "../chunk-MEUNTJL5.js";
4
+ import "../chunk-DJ4VJIH5.js";
1
5
  import {
2
6
  generateInvitationToken,
3
7
  getInvitationExpiresAt,
@@ -5,10 +9,6 @@ import {
5
9
  normalizeInvitationEmail,
6
10
  parseInvitationPermission
7
11
  } from "../chunk-2DRYTJHI.js";
8
- import {
9
- SeatLimitError
10
- } from "../chunk-MEUNTJL5.js";
11
- import "../chunk-DJ4VJIH5.js";
12
12
  import {
13
13
  hasWorkspaceRole
14
14
  } from "../chunk-6XIAPIW6.js";
@@ -1,12 +1,12 @@
1
+ import {
2
+ InvitationsPanel
3
+ } from "../chunk-5SXS3YAB.js";
1
4
  import {
2
5
  InviteAcceptPage
3
6
  } from "../chunk-VCPZ3HTN.js";
4
7
  import {
5
8
  MembersPanel
6
9
  } from "../chunk-S564OFTL.js";
7
- import {
8
- InvitationsPanel
9
- } from "../chunk-5SXS3YAB.js";
10
10
  import "../chunk-6XIAPIW6.js";
11
11
  export {
12
12
  InvitationsPanel,
@@ -297,4 +297,4 @@ declare function workProductToPersistedPart(record: WorkProductRecord): WorkProd
297
297
  /** Re-validate a stored/wire part into the typed anchor; null for junk. */
298
298
  declare function persistedPartToWorkProduct(part: Record<string, unknown>): WorkProductPersistedPart | null;
299
299
 
300
- export { type AgentCheckInput as A, type EvidenceEntry as E, type ProfileBacktestSummary as P, type QualityCheck as Q, type WorkProductRef as W, type WorkProductProvenance as a, type WorkProductRecord as b, type WorkProductPersistedPart as c, type WorkProductStorePort as d, type WorkProductAuditEvent as e, type WorkProductArtifact as f, type ExceptionEntry as g, type WorkProductStatus as h, type EvidenceLocator as i, type EvidenceSpan as j, type ExceptionSeverity as k, type QuoteBasis as l, type WorkProductParseResult as m, type WorkProductPatch as n, type WorkProductUpdateGuard as o, type WorkProductVersionEntry as p, isWorkProductStatus as q, parseAgentCheckInput as r, parseArtifactInput as s, parseEvidenceInput as t, parseExceptionInput as u, persistedPartToWorkProduct as v, unresolvedBlockingExceptions as w, workProductToPersistedPart as x };
300
+ export { type AgentCheckInput as A, type EvidenceEntry as E, type ProfileBacktestSummary as P, type QualityCheck as Q, type WorkProductPersistedPart as W, type WorkProductRef as a, type WorkProductProvenance as b, type WorkProductRecord as c, type WorkProductStorePort as d, type WorkProductAuditEvent as e, type WorkProductArtifact as f, type ExceptionEntry as g, type WorkProductStatus as h, type EvidenceLocator as i, type EvidenceSpan as j, type ExceptionSeverity as k, type QuoteBasis as l, type WorkProductParseResult as m, type WorkProductPatch as n, type WorkProductUpdateGuard as o, type WorkProductVersionEntry as p, isWorkProductStatus as q, parseAgentCheckInput as r, parseArtifactInput as s, parseEvidenceInput as t, parseExceptionInput as u, persistedPartToWorkProduct as v, unresolvedBlockingExceptions as w, workProductToPersistedPart as x };
@@ -0,0 +1,98 @@
1
+ import { ReactNode } from 'react';
2
+ import { F as FileMention } from './wire-DSp4LzEE.js';
3
+
4
+ /**
5
+ * `useFileMentions` — the glue a host passes straight into `AgentComposer`'s
6
+ * `mention` prop (`@tangle-network/sandbox-ui#184`) to wire up `@`-file
7
+ * mentions against `createSandboxFileIndexRoute` (`/chat-routes`).
8
+ *
9
+ * Fetches the index once per session from `indexUrl`, refreshes it in the
10
+ * background whenever the popover opens (a `fetchItems` call) if the cached
11
+ * copy has aged past `refreshAfterMs`, and answers every keystroke from an
12
+ * in-memory fuzzy filter — no per-keystroke network round trip. The returned
13
+ * `refresh()` lets a caller force a re-fetch immediately instead of waiting
14
+ * on `refreshAfterMs` — e.g. right after the agent creates a file mid-session.
15
+ *
16
+ * `MentionItem`/the `mention` prop shape mirror the FROZEN contract from
17
+ * sandbox-ui#184 structurally (no import: `/web-react` stays dependency-free
18
+ * beyond React, and `@tangle-network/sandbox-ui` is an optional peer).
19
+ */
20
+
21
+ /** Mirrors sandbox-ui#184's `MentionItem` — the atomic pill's payload. For a
22
+ * file mention, `id` is the workspace-relative path (the pill's stable
23
+ * identity and the `@<id>` serialization sandbox-ui uses to round-trip
24
+ * `value`), `label` is the display name, and `detail` carries the full path
25
+ * for the popover row's secondary line. */
26
+ interface MentionItem {
27
+ id: string;
28
+ label: string;
29
+ detail?: string;
30
+ kind?: string;
31
+ }
32
+ /** Mirrors sandbox-ui#184's `AgentComposerProps['mention']` shape — plug the
33
+ * hook's `mention` return value straight into that prop. */
34
+ interface ComposerMentionProp {
35
+ trigger?: string;
36
+ fetchItems(query: string): Promise<MentionItem[]>;
37
+ onMentionsChange?(mentions: MentionItem[]): void;
38
+ renderItem?(item: MentionItem): ReactNode;
39
+ emptyText?: string;
40
+ }
41
+ /**
42
+ * Ranks `files` against `query` (case-insensitive), capped to `limit`:
43
+ * name-prefix matches first, then name-substring, then path-substring.
44
+ * Within a tier, shorter names sort first (the more specific match), then
45
+ * alphabetically by path for a stable order. An empty query returns the
46
+ * first `limit` entries unranked — the popover's default list before typing.
47
+ * Pure and dependency-free (no fuzzy-match library) so it's cheap enough to
48
+ * re-run on every keystroke against a 10k-entry index.
49
+ */
50
+ declare function rankFileMentions(files: readonly FileMention[], query: string, limit: number): FileMention[];
51
+ /** Max popover results per query — enough to show a useful spread of matches
52
+ * without pushing the fuzzy-filtered list past what a popover can usefully
53
+ * render in one screen. */
54
+ declare const DEFAULT_MENTION_LIMIT = 20;
55
+ /** How long a `ready` index is served before a background refetch — long
56
+ * enough that a full session's worth of popover opens don't repeatedly hit
57
+ * the index endpoint, short enough that a stale listing doesn't linger too
58
+ * far past workspace file changes. Callers who need the index current right
59
+ * now (e.g. just after the agent creates a file) call `refresh()` instead of
60
+ * waiting on this window. */
61
+ declare const INDEX_REFRESH_AFTER_MS: number;
62
+ /** Popover empty-state copy for a `ready` index whose query matched nothing.
63
+ * Loading/warming/error states have their own copy — see `emptyTextFor`. */
64
+ declare const DEFAULT_MENTION_EMPTY_TEXT = "No matching files";
65
+ /** Define options for configuring file mention fetching, caching, and display behavior */
66
+ interface UseFileMentionsOptions {
67
+ /** GET endpoint returning `FileIndexResponse` (a `createSandboxFileIndexRoute`). */
68
+ indexUrl: string;
69
+ /** Max popover results per query. Default {@link DEFAULT_MENTION_LIMIT}. */
70
+ limit?: number;
71
+ /** How long a `ready` index is served without a background refetch.
72
+ * Default {@link INDEX_REFRESH_AFTER_MS}. */
73
+ refreshAfterMs?: number;
74
+ /** `fetch` override for tests / non-global-fetch hosts. Default `fetch`. */
75
+ fetchImpl?: typeof fetch;
76
+ /** Text shown in the popover's empty state once the index is loaded and
77
+ * the query matched nothing. Default {@link DEFAULT_MENTION_EMPTY_TEXT}. */
78
+ emptyText?: string;
79
+ }
80
+ /** Provide properties and methods to manage and refresh file mentions in a composer interface */
81
+ interface UseFileMentionsResult {
82
+ /** Spread straight into `AgentComposer`'s `mention` prop. */
83
+ mention: ComposerMentionProp;
84
+ /** The files currently referenced by mentions in the composer's value —
85
+ * the send-body list (map through `fileMentionsToParts`). */
86
+ mentions: FileMention[];
87
+ /** Drop all currently-referenced mentions (e.g. after a successful send). */
88
+ clearMentions: () => void;
89
+ /** Force a re-fetch of the index right now, ignoring `refreshAfterMs` — for
90
+ * example right after the agent creates a file mid-session, so the next
91
+ * popover open sees it. Dedupes against an already-in-flight load rather
92
+ * than firing a second request. */
93
+ refresh: () => Promise<void>;
94
+ }
95
+ /** Resolve and manage file mention data with configurable fetching and state handling */
96
+ declare function useFileMentions(options: UseFileMentionsOptions): UseFileMentionsResult;
97
+
98
+ export { type ComposerMentionProp as C, DEFAULT_MENTION_EMPTY_TEXT as D, INDEX_REFRESH_AFTER_MS as I, type MentionItem as M, type UseFileMentionsResult as U, DEFAULT_MENTION_LIMIT as a, type UseFileMentionsOptions as b, rankFileMentions as r, useFileMentions as u };
@@ -1,22 +1,25 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { a as ChatInteractionField, I as InteractionAnswers, C as ChatInteractionStatus, b as ChatInteraction, c as InteractionCancelData, d as ChatSelectField, e as InteractionRequestWire } from '../contract-CEewO6DI.js';
4
- export { f as ChatFreeTextField, g as ComposerAnswerDelivery, h as INTERACTION_CANCEL_EVENT, i as INTERACTION_EVENT, j as INTERACTION_RESOLVED_EVENT, k as InteractionAnswerValue, l as InteractionPersistedPart, N as NoticeKind, m as NoticePersistedPart, P as ParseInteractionAnswersResult, n as ParseInteractionResult, o as canTransitionInteractionStatus, p as cancelStatusFor, q as composerAnswerData, r as composerAnswerDeliveries, s as dedupeQuestionInteractionsByContent, t as fieldAcceptsFreeText, u as interactionFromWireRequest, v as interactionPartKey, w as interactionToPersistedPart, x as isRenderableInteractionKind, y as isSafeInteractionFieldKey, z as isTerminalInteractionStatus, A as noticePart, B as noticePartKey, D as parseInteractionAnswers, E as parseInteractionCancel, F as parseInteractionRequest, G as persistedPartToInteraction, H as questionInteractionContentSignature, J as stampInteractionAnswers } from '../contract-CEewO6DI.js';
3
+ import { C as ChatInteractionField, I as InteractionAnswers, a as ChatInteractionStatus, b as ChatInteraction, c as InteractionCancelData, d as ChatSelectField, e as InteractionRequestWire } from '../contract-CQNvv5th.js';
4
+ export { f as ChatFreeTextField, g as ComposerAnswerDelivery, h as INTERACTION_CANCEL_EVENT, i as INTERACTION_EVENT, j as INTERACTION_RESOLVED_EVENT, k as InteractionAnswerValue, l as InteractionPersistedPart, N as NoticeKind, m as NoticePersistedPart, P as ParseInteractionAnswersResult, n as ParseInteractionResult, o as canTransitionInteractionStatus, p as cancelStatusFor, q as composerAnswerData, r as composerAnswerDeliveries, s as dedupeQuestionInteractionsByContent, t as fieldAcceptsFreeText, u as interactionFromWireRequest, v as interactionPartKey, w as interactionToPersistedPart, x as isRenderableInteractionKind, y as isSafeInteractionFieldKey, z as isTerminalInteractionStatus, A as noticePart, B as noticePartKey, D as parseInteractionAnswers, E as parseInteractionCancel, F as parseInteractionRequest, G as persistedPartToInteraction, H as questionInteractionContentSignature, J as stampInteractionAnswers } from '../contract-CQNvv5th.js';
5
5
  import { ChatPlan } from '../plans/index.js';
6
6
  import { InteractionData } from '@tangle-network/agent-interface';
7
7
  export { InteractionData, InteractionOutcome, InteractionRequest } from '@tangle-network/agent-interface';
8
- import { M as FileMention, g as ChatMentionPart, b as ChatAttachmentPart, a as ChatAttachmentKind, Q as ChatAttachmentInput } from '../parts-fyPPdDdK.js';
9
- export { f as ChatMentionKind, P as ChatTurnFilePartInput, O as ChatTurnPartInput, N as ChatTurnRequestPayload, U as DISPATCH_MAX_MEDIA_PARTS, V as DISPATCH_MAX_PARTS, W as DISPATCH_REQUEST_MAX_BYTES, X as DISPATCH_STRUCTURAL_RESERVE_BYTES, $ as ProducerErrorEvent, a0 as ProducerNoticeEvent, a1 as ProducerPassthroughEvent, a2 as ProducerPassthroughEventType, a3 as ProducerReasoningEvent, a4 as ProducerTextEvent, a5 as ProducerToolCallEvent, a6 as ProducerToolResultEvent, a7 as ProducerUsageEvent, a8 as ProducerWireEvent, u as attachmentInputToPart, v as attachmentKindForMime, w as attachmentPartsFromMessageParts, ab as base64WireLen, ac as buildMentionPromptBlock, ad as chatTurnRequestInit, ae as fileMentionsToParts, z as isChatAttachmentPart, ag as mediaTypeForMentionPath, J as mentionInputToPart, ah as mentionKindForPath, K as mentionPartsFromMessageParts } from '../parts-fyPPdDdK.js';
10
- import { E as EvidenceEntry, g as ExceptionEntry, a as WorkProductProvenance, P as ProfileBacktestSummary, Q as QualityCheck, c as WorkProductPersistedPart, h as WorkProductStatus } from '../types-DB82fktc.js';
8
+ import { e as ChatMentionPart, a as ChatAttachmentPart } from '../parts-7fbe2rj8.js';
9
+ export { s as attachmentInputToPart, t as attachmentKindForMime, u as attachmentPartsFromMessageParts, x as isChatAttachmentPart, H as mentionInputToPart, I as mentionPartsFromMessageParts } from '../parts-7fbe2rj8.js';
10
+ import { E as EvidenceEntry, g as ExceptionEntry, b as WorkProductProvenance, P as ProfileBacktestSummary, Q as QualityCheck, W as WorkProductPersistedPart, h as WorkProductStatus } from '../types-CCeYywdS.js';
11
+ export { C as ComposerMentionProp, D as DEFAULT_MENTION_EMPTY_TEXT, a as DEFAULT_MENTION_LIMIT, I as INDEX_REFRESH_AFTER_MS, M as MentionItem, b as UseFileMentionsOptions, U as UseFileMentionsResult, r as rankFileMentions, u as useFileMentions } from '../use-file-mentions-E6a7_cbH.js';
12
+ import { a as ChatAttachmentKind, b as ChatAttachmentInput } from '../wire-DSp4LzEE.js';
13
+ export { C as ChatMentionKind, e as ChatTurnFilePartInput, d as ChatTurnPartInput, c as ChatTurnRequestPayload, D as DISPATCH_MAX_MEDIA_PARTS, h as DISPATCH_MAX_PARTS, i as DISPATCH_REQUEST_MAX_BYTES, j as DISPATCH_STRUCTURAL_RESERVE_BYTES, F as FileMention, P as ProducerErrorEvent, l as ProducerNoticeEvent, m as ProducerPassthroughEvent, n as ProducerPassthroughEventType, o as ProducerReasoningEvent, p as ProducerTextEvent, q as ProducerToolCallEvent, r as ProducerToolResultEvent, s as ProducerUsageEvent, t as ProducerWireEvent, v as base64WireLen, w as buildMentionPromptBlock, x as chatTurnRequestInit, y as fileMentionsToParts, A as mediaTypeForMentionPath, B as mentionKindForPath } from '../wire-DSp4LzEE.js';
11
14
  import { S as StepAgentActivity } from '../agent-activity-C8ZG0F0M.js';
12
15
  import { F as FlowTrace } from '../flow-types-CJxEmaRy.js';
13
- import { a as ReviewQueueItem, c as ReviewQueueState } from '../queue-vRI0Qx3X.js';
14
- export { p as parseReviewQueueItem } from '../queue-vRI0Qx3X.js';
16
+ import { a as ReviewQueueItem, c as ReviewQueueState } from '../queue-VTBA5ONX.js';
17
+ export { p as parseReviewQueueItem } from '../queue-VTBA5ONX.js';
15
18
  export { S as SandboxTerminalConnection, a as SandboxTerminalConnectionResponse, U as UseSandboxTerminalConnectionOptions, b as UseSandboxTerminalConnectionResult, t as tabTerminalConnectionId, u as useSandboxTerminalConnection } from '../sandbox-terminal-ChNEdHF8.js';
16
19
  import { CatalogModel } from '../catalog/index.js';
17
20
  import { Harness } from '../harness/index.js';
18
- export { a as ATTACHMENT_ACCEPT, e as FileIndexReadyResponse, f as FileIndexResponse, g as FileIndexWarmingResponse } from '../attachment-validation-Dvc_Livy.js';
19
- export { a as attachmentPartKey } from '../stream-normalizer-DnuqkZvw.js';
21
+ export { a as ATTACHMENT_ACCEPT, e as FileIndexReadyResponse, f as FileIndexResponse, g as FileIndexWarmingResponse } from '../attachment-validation-CNkH91Gs.js';
22
+ export { a as attachmentPartKey } from '../stream-normalizer-CnPnMaTp.js';
20
23
 
21
24
  /** Represent durable plan decisions as either approved or rejected */
22
25
  type DurablePlanDecision = 'approved' | 'rejected';
@@ -624,100 +627,6 @@ type UseChatInteractionsOptions = RestoreChatInteractionsOptions;
624
627
  /** Manage chat interactions state with upsert, cancel, resolve, and restore capabilities */
625
628
  declare function useChatInteractions(options?: UseChatInteractionsOptions): UseChatInteractionsResult;
626
629
 
627
- /**
628
- * `useFileMentions` — the glue a host passes straight into `AgentComposer`'s
629
- * `mention` prop (`@tangle-network/sandbox-ui#184`) to wire up `@`-file
630
- * mentions against `createSandboxFileIndexRoute` (`/chat-routes`).
631
- *
632
- * Fetches the index once per session from `indexUrl`, refreshes it in the
633
- * background whenever the popover opens (a `fetchItems` call) if the cached
634
- * copy has aged past `refreshAfterMs`, and answers every keystroke from an
635
- * in-memory fuzzy filter — no per-keystroke network round trip. The returned
636
- * `refresh()` lets a caller force a re-fetch immediately instead of waiting
637
- * on `refreshAfterMs` — e.g. right after the agent creates a file mid-session.
638
- *
639
- * `MentionItem`/the `mention` prop shape mirror the FROZEN contract from
640
- * sandbox-ui#184 structurally (no import: `/web-react` stays dependency-free
641
- * beyond React, and `@tangle-network/sandbox-ui` is an optional peer).
642
- */
643
-
644
- /** Mirrors sandbox-ui#184's `MentionItem` — the atomic pill's payload. For a
645
- * file mention, `id` is the workspace-relative path (the pill's stable
646
- * identity and the `@<id>` serialization sandbox-ui uses to round-trip
647
- * `value`), `label` is the display name, and `detail` carries the full path
648
- * for the popover row's secondary line. */
649
- interface MentionItem {
650
- id: string;
651
- label: string;
652
- detail?: string;
653
- kind?: string;
654
- }
655
- /** Mirrors sandbox-ui#184's `AgentComposerProps['mention']` shape — plug the
656
- * hook's `mention` return value straight into that prop. */
657
- interface ComposerMentionProp {
658
- trigger?: string;
659
- fetchItems(query: string): Promise<MentionItem[]>;
660
- onMentionsChange?(mentions: MentionItem[]): void;
661
- renderItem?(item: MentionItem): ReactNode;
662
- emptyText?: string;
663
- }
664
- /**
665
- * Ranks `files` against `query` (case-insensitive), capped to `limit`:
666
- * name-prefix matches first, then name-substring, then path-substring.
667
- * Within a tier, shorter names sort first (the more specific match), then
668
- * alphabetically by path for a stable order. An empty query returns the
669
- * first `limit` entries unranked — the popover's default list before typing.
670
- * Pure and dependency-free (no fuzzy-match library) so it's cheap enough to
671
- * re-run on every keystroke against a 10k-entry index.
672
- */
673
- declare function rankFileMentions(files: readonly FileMention[], query: string, limit: number): FileMention[];
674
- /** Max popover results per query — enough to show a useful spread of matches
675
- * without pushing the fuzzy-filtered list past what a popover can usefully
676
- * render in one screen. */
677
- declare const DEFAULT_MENTION_LIMIT = 20;
678
- /** How long a `ready` index is served before a background refetch — long
679
- * enough that a full session's worth of popover opens don't repeatedly hit
680
- * the index endpoint, short enough that a stale listing doesn't linger too
681
- * far past workspace file changes. Callers who need the index current right
682
- * now (e.g. just after the agent creates a file) call `refresh()` instead of
683
- * waiting on this window. */
684
- declare const INDEX_REFRESH_AFTER_MS: number;
685
- /** Popover empty-state copy for a `ready` index whose query matched nothing.
686
- * Loading/warming/error states have their own copy — see `emptyTextFor`. */
687
- declare const DEFAULT_MENTION_EMPTY_TEXT = "No matching files";
688
- /** Define options for configuring file mention fetching, caching, and display behavior */
689
- interface UseFileMentionsOptions {
690
- /** GET endpoint returning `FileIndexResponse` (a `createSandboxFileIndexRoute`). */
691
- indexUrl: string;
692
- /** Max popover results per query. Default {@link DEFAULT_MENTION_LIMIT}. */
693
- limit?: number;
694
- /** How long a `ready` index is served without a background refetch.
695
- * Default {@link INDEX_REFRESH_AFTER_MS}. */
696
- refreshAfterMs?: number;
697
- /** `fetch` override for tests / non-global-fetch hosts. Default `fetch`. */
698
- fetchImpl?: typeof fetch;
699
- /** Text shown in the popover's empty state once the index is loaded and
700
- * the query matched nothing. Default {@link DEFAULT_MENTION_EMPTY_TEXT}. */
701
- emptyText?: string;
702
- }
703
- /** Provide properties and methods to manage and refresh file mentions in a composer interface */
704
- interface UseFileMentionsResult {
705
- /** Spread straight into `AgentComposer`'s `mention` prop. */
706
- mention: ComposerMentionProp;
707
- /** The files currently referenced by mentions in the composer's value —
708
- * the send-body list (map through `fileMentionsToParts`). */
709
- mentions: FileMention[];
710
- /** Drop all currently-referenced mentions (e.g. after a successful send). */
711
- clearMentions: () => void;
712
- /** Force a re-fetch of the index right now, ignoring `refreshAfterMs` — for
713
- * example right after the agent creates a file mid-session, so the next
714
- * popover open sees it. Dedupes against an already-in-flight load rather
715
- * than firing a second request. */
716
- refresh: () => Promise<void>;
717
- }
718
- /** Resolve and manage file mention data with configurable fetching and state handling */
719
- declare function useFileMentions(options: UseFileMentionsOptions): UseFileMentionsResult;
720
-
721
630
  /**
722
631
  * Transcript-side counterpart to the composer's `@`-mention primitive
723
632
  * (sandbox-ui#184). The composer serializes a picked file into the message
@@ -1469,4 +1378,4 @@ declare function useThinkingSeconds(active: boolean): number;
1469
1378
  */
1470
1379
  declare function ChatMessages({ messages, models, renderMarkdown, renderExtras, durableCards, userLabel, agentLabel, loading, approval, onToolCallClick, toolRenderers, error, onRetry, renderEmpty, emptyState, header, resolveAttachmentUrl, workProductCards, }: ChatMessagesProps): react.JSX.Element;
1471
1380
 
1472
- export { type ActivityTone, type AgentActivityPage, AgentActivityPanel, type AgentActivityPanelProps, type AgentActivityRecord, AgentSessionControls, type AgentSessionControlsProps, type AttachmentFileResult, CatalogModel, ChatAttachmentInput, ChatAttachmentKind, ChatAttachmentPart, ChatComposer, type ChatComposerProps, type ChatEmptyDoor, ChatEmptyState, type ChatEmptyStateProps, ChatInteraction, ChatInteractionField, type ChatInteractionRestoreMode, ChatInteractionStatus, ChatMentionPart, type ChatMessageMetrics, type ChatMessageSegment, ChatMessages, type ChatMessagesProps, ChatSelectField, type ChatStreamCallbacks, type ChatStreamToolCall, type ChatStreamToolResult, type ChatToolCallInfo, type ChatUiMessage, type ComposerFile, type ComposerFilePart, type ComposerMentionProp, type ConsumeChatStreamResult, DEFAULT_EFFORT_LEVELS, DEFAULT_MENTION_EMPTY_TEXT, DEFAULT_MENTION_LIMIT, type DurableChatCard, DurableChatCards, type DurableChatCardsProps, type DurableInteractionAnswerSubmitterOptions, DurablePlanCard, type DurablePlanCardProps, DurablePlanClientError, type DurablePlanCurrentInput, type DurablePlanDecision, type DurablePlanDecisionClient, type DurablePlanDecisionClientOptions, type DurablePlanDecisionInput, type DurablePlanDecisionResult, type DurablePlanFollowUpReceipt, type EffortLevel, EffortPicker, type EffortPickerProps, EvidenceLineageTable, type EvidenceLineageTableProps, ExceptionList, type ExceptionListProps, type FieldValues, FileMention, FlowWaterfall, type FlowWaterfallProps, INDEX_REFRESH_AFTER_MS, INTERACTION_SUBMIT_TIMEOUT_MESSAGE, INTERACTION_SUBMIT_TIMEOUT_MS, InteractionActionButton, type InteractionAnswerSubmission, type InteractionAnswerSubmitterOptions, InteractionAnswers, type InteractionAttemptStore, InteractionBadge, type InteractionBadgeVariant, InteractionCancelData, InteractionPlanCard, type InteractionPlanCardProps, InteractionQuestionCard, type InteractionQuestionCardProps, InteractionRequestWire, type InteractionSubmitResult, type MentionItem, type MentionTextSegment, MessageAttachments, type MessageAttachmentsProps, MissionActivityLane, type MissionActivityLaneProps, ModelPicker, type ModelPickerProps, type ProposalApprovalHandlers, ProvenanceStamp, type ProvenanceStampProps, ProviderLogo, type ProviderLogoProps, QualityCheckList, type QualityCheckListProps, QuestionOptionList, type QuestionOptionListProps, type RestoreChatInteractionsOptions, ReviewQueueItem, type ReviewQueuePage, ReviewQueuePanel, type ReviewQueuePanelProps, ReviewQueueState, RunDrillIn, type RunDrillInProps, SeatPaywall, type SeatPaywallProps, type SmoothRevealOptions, type StreamChatOptions, type SubmitInteractionAnswer, type ToolDetailRenderers, type ToolRunRecord, type ToolRunStep, type UseChatInteractionsOptions, type UseChatInteractionsResult, type UseComposerAttachmentsOptions, type UseComposerAttachmentsResult, type UseDurablePlanFlowOptions, type UseDurablePlanFlowResult, type UseFileMentionsOptions, type UseFileMentionsResult, type WaterfallRow, WorkProductCard, type WorkProductCardProps, __resetAttachmentFileCacheForTests, activityTone, buildAnswerData, cancelChatInteraction, consumeChatStream, createDurableInteractionAnswerSubmitter, createDurablePlanDecisionClient, createInteractionAnswerSubmitter, createMemoryInteractionAttemptStore, createSessionInteractionAttemptStore, dispatchChatStreamLine, durableChatCardsFromParts, fieldAnswer, fieldValuesFromAnswers, formatActivityCost, formatActivityDuration, formatModelCost, formatTokensPerSecond, hasSecretField, hydrateChatInteractions, interactionStatusLabels, interactionSubmissionSignature, interactionTerminalNotes, isLateAnswerableStatus, lateAnswerMessage, loadAttachmentFile, mergeActivityPages, mergeReviewQueuePages, nextRevealCount, pendingApprovalOf, rankFileMentions, resolveChatInteraction, responseErrorMessage, restoreChatInteractions, reviewQueueStateLabel, segmentMentionContent, settleInteractionSubmit, streamChatTurn, terminalizePendingChatInteractions, triggerAttachmentDownload, upsertChatInteraction, useChatInteractions, useComposerAttachments, useDurablePlanFlow, useFileMentions, usePending, usePopover, useSmoothText, useThinkingSeconds, waterfallLayout, workProductPartsFromMessageParts, workProductStatusLabel };
1381
+ export { type ActivityTone, type AgentActivityPage, AgentActivityPanel, type AgentActivityPanelProps, type AgentActivityRecord, AgentSessionControls, type AgentSessionControlsProps, type AttachmentFileResult, CatalogModel, ChatAttachmentInput, ChatAttachmentKind, ChatAttachmentPart, ChatComposer, type ChatComposerProps, type ChatEmptyDoor, ChatEmptyState, type ChatEmptyStateProps, ChatInteraction, ChatInteractionField, type ChatInteractionRestoreMode, ChatInteractionStatus, ChatMentionPart, type ChatMessageMetrics, type ChatMessageSegment, ChatMessages, type ChatMessagesProps, ChatSelectField, type ChatStreamCallbacks, type ChatStreamToolCall, type ChatStreamToolResult, type ChatToolCallInfo, type ChatUiMessage, type ComposerFile, type ComposerFilePart, type ConsumeChatStreamResult, DEFAULT_EFFORT_LEVELS, type DurableChatCard, DurableChatCards, type DurableChatCardsProps, type DurableInteractionAnswerSubmitterOptions, DurablePlanCard, type DurablePlanCardProps, DurablePlanClientError, type DurablePlanCurrentInput, type DurablePlanDecision, type DurablePlanDecisionClient, type DurablePlanDecisionClientOptions, type DurablePlanDecisionInput, type DurablePlanDecisionResult, type DurablePlanFollowUpReceipt, type EffortLevel, EffortPicker, type EffortPickerProps, EvidenceLineageTable, type EvidenceLineageTableProps, ExceptionList, type ExceptionListProps, type FieldValues, FlowWaterfall, type FlowWaterfallProps, INTERACTION_SUBMIT_TIMEOUT_MESSAGE, INTERACTION_SUBMIT_TIMEOUT_MS, InteractionActionButton, type InteractionAnswerSubmission, type InteractionAnswerSubmitterOptions, InteractionAnswers, type InteractionAttemptStore, InteractionBadge, type InteractionBadgeVariant, InteractionCancelData, InteractionPlanCard, type InteractionPlanCardProps, InteractionQuestionCard, type InteractionQuestionCardProps, InteractionRequestWire, type InteractionSubmitResult, type MentionTextSegment, MessageAttachments, type MessageAttachmentsProps, MissionActivityLane, type MissionActivityLaneProps, ModelPicker, type ModelPickerProps, type ProposalApprovalHandlers, ProvenanceStamp, type ProvenanceStampProps, ProviderLogo, type ProviderLogoProps, QualityCheckList, type QualityCheckListProps, QuestionOptionList, type QuestionOptionListProps, type RestoreChatInteractionsOptions, ReviewQueueItem, type ReviewQueuePage, ReviewQueuePanel, type ReviewQueuePanelProps, ReviewQueueState, RunDrillIn, type RunDrillInProps, SeatPaywall, type SeatPaywallProps, type SmoothRevealOptions, type StreamChatOptions, type SubmitInteractionAnswer, type ToolDetailRenderers, type ToolRunRecord, type ToolRunStep, type UseChatInteractionsOptions, type UseChatInteractionsResult, type UseComposerAttachmentsOptions, type UseComposerAttachmentsResult, type UseDurablePlanFlowOptions, type UseDurablePlanFlowResult, type WaterfallRow, WorkProductCard, type WorkProductCardProps, __resetAttachmentFileCacheForTests, activityTone, buildAnswerData, cancelChatInteraction, consumeChatStream, createDurableInteractionAnswerSubmitter, createDurablePlanDecisionClient, createInteractionAnswerSubmitter, createMemoryInteractionAttemptStore, createSessionInteractionAttemptStore, dispatchChatStreamLine, durableChatCardsFromParts, fieldAnswer, fieldValuesFromAnswers, formatActivityCost, formatActivityDuration, formatModelCost, formatTokensPerSecond, hasSecretField, hydrateChatInteractions, interactionStatusLabels, interactionSubmissionSignature, interactionTerminalNotes, isLateAnswerableStatus, lateAnswerMessage, loadAttachmentFile, mergeActivityPages, mergeReviewQueuePages, nextRevealCount, pendingApprovalOf, resolveChatInteraction, responseErrorMessage, restoreChatInteractions, reviewQueueStateLabel, segmentMentionContent, settleInteractionSubmit, streamChatTurn, terminalizePendingChatInteractions, triggerAttachmentDownload, upsertChatInteraction, useChatInteractions, useComposerAttachments, useDurablePlanFlow, usePending, usePopover, useSmoothText, useThinkingSeconds, waterfallLayout, workProductPartsFromMessageParts, workProductStatusLabel };
@@ -66,7 +66,6 @@ import {
66
66
  triggerAttachmentDownload,
67
67
  upsertChatInteraction,
68
68
  useChatInteractions,
69
- useComposerAttachments,
70
69
  useDurablePlanFlow,
71
70
  useFileMentions,
72
71
  usePending,
@@ -74,7 +73,7 @@ import {
74
73
  useSmoothText,
75
74
  useThinkingSeconds,
76
75
  waterfallLayout
77
- } from "../chunk-PRKSYTMQ.js";
76
+ } from "../chunk-GCH3BUAZ.js";
78
77
  import "../chunk-FBVLEGEG.js";
79
78
  import {
80
79
  EvidenceLineageTable,
@@ -91,32 +90,38 @@ import {
91
90
  import {
92
91
  parseReviewQueueItem
93
92
  } from "../chunk-GEYACSFW.js";
93
+ import {
94
+ useComposerAttachments
95
+ } from "../chunk-4OO7P3ZF.js";
94
96
  import {
95
97
  tabTerminalConnectionId,
96
98
  useSandboxTerminalConnection
97
99
  } from "../chunk-HCOROIRT.js";
100
+ import "../chunk-QY4BRKRJ.js";
98
101
  import {
99
102
  ATTACHMENT_ACCEPT
100
- } from "../chunk-BI6NKSO4.js";
103
+ } from "../chunk-IYLJS6VW.js";
104
+ import {
105
+ attachmentInputToPart,
106
+ attachmentKindForMime,
107
+ attachmentPartsFromMessageParts,
108
+ isChatAttachmentPart,
109
+ mentionInputToPart,
110
+ mentionPartsFromMessageParts
111
+ } from "../chunk-4PUMUTLU.js";
112
+ import "../chunk-ZVEEWGDK.js";
101
113
  import {
102
114
  DISPATCH_MAX_MEDIA_PARTS,
103
115
  DISPATCH_MAX_PARTS,
104
116
  DISPATCH_REQUEST_MAX_BYTES,
105
117
  DISPATCH_STRUCTURAL_RESERVE_BYTES,
106
- attachmentInputToPart,
107
- attachmentKindForMime,
108
- attachmentPartsFromMessageParts,
109
118
  base64WireLen,
110
119
  buildMentionPromptBlock,
111
120
  chatTurnRequestInit,
112
121
  fileMentionsToParts,
113
- isChatAttachmentPart,
114
122
  mediaTypeForMentionPath,
115
- mentionInputToPart,
116
- mentionKindForPath,
117
- mentionPartsFromMessageParts
118
- } from "../chunk-C3SRFZGL.js";
119
- import "../chunk-ZVEEWGDK.js";
123
+ mentionKindForPath
124
+ } from "../chunk-QYAQGCHF.js";
120
125
  import {
121
126
  attachmentPartKey
122
127
  } from "../chunk-5EPIPT4V.js";