@tangle-network/agent-app 0.45.33 → 0.45.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-session-controls-1q1XR3j8.d.ts +257 -0
- package/dist/assistant/index.d.ts +1 -1
- package/dist/assistant/index.js +2 -2
- package/dist/chat-react/index.d.ts +1 -1
- package/dist/chat-react/index.js +1 -1
- package/dist/{chunk-XHD4Y54K.js → chunk-AIHKKLKY.js} +2 -2
- package/dist/{chunk-SFSR3CAH.js → chunk-MIZMWCKW.js} +4 -3
- package/dist/{chunk-SFSR3CAH.js.map → chunk-MIZMWCKW.js.map} +1 -1
- package/dist/web-react/index.d.ts +2 -120
- package/dist/web-react/index.js +2 -2
- package/package.json +1 -1
- package/dist/agent-session-controls-BwImzYKC.d.ts +0 -129
- /package/dist/{chunk-XHD4Y54K.js.map → chunk-AIHKKLKY.js.map} +0 -0
|
@@ -8,7 +8,7 @@ export { InteractionData, InteractionOutcome, InteractionRequest } from '@tangle
|
|
|
8
8
|
import { e as ChatMentionPart, a as ChatAttachmentPart } from '../parts-BqIHMdyu.js';
|
|
9
9
|
export { s as attachmentInputToPart, t as attachmentKindForMime, u as attachmentPartsFromMessageParts, x as isChatAttachmentPart, H as mentionInputToPart, I as mentionPartsFromMessageParts } from '../parts-BqIHMdyu.js';
|
|
10
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 { a as AgentSessionControls, A as AgentSessionControlsProps, C as ComposerMentionProp, D as
|
|
11
|
+
export { a as AgentSessionControls, A as AgentSessionControlsProps, C as ComposerMentionProp, D as DEFAULT_EFFORT_LEVELS, b as DEFAULT_MENTION_EMPTY_TEXT, c as DEFAULT_MENTION_LIMIT, E as EFFORT_METER_SEGMENTS, d as EffortLevel, e as EffortMeter, f as EffortPicker, g as EffortPickerProps, I as INDEX_REFRESH_AFTER_MS, M as MentionItem, h as ModelPicker, i as ModelPickerProps, O as OVERLAY_SHADOW, j as UseFileMentionsOptions, U as UseFileMentionsResult, k as effortMeterFill, r as rankFileMentions, u as useFileMentions, l as usePending, m as usePopover } from '../agent-session-controls-1q1XR3j8.js';
|
|
12
12
|
import { a as ChatAttachmentKind, b as ChatAttachmentInput } from '../wire-DOZ-O6hD.js';
|
|
13
13
|
export { C as ChatMentionKind, e as ChatTurnFilePartInput, d as ChatTurnPartInput, c as ChatTurnRequestPayload, D as DISPATCH_MAX_MEDIA_PARTS, i as DISPATCH_MAX_PARTS, j as DISPATCH_REQUEST_MAX_BYTES, k as DISPATCH_STRUCTURAL_RESERVE_BYTES, F as FileMention, P as ProducerErrorEvent, m as ProducerNoticeEvent, n as ProducerPassthroughEvent, o as ProducerPassthroughEventType, p as ProducerReasoningEvent, q as ProducerTextEvent, r as ProducerToolCallEvent, s as ProducerToolResultEvent, t as ProducerUsageEvent, u as ProducerWireEvent, w as base64WireLen, x as buildMentionPromptBlock, y as chatTurnRequestInit, z as fileMentionsToParts, B as mediaTypeForMentionPath, E as mentionKindForPath } from '../wire-DOZ-O6hD.js';
|
|
14
14
|
import { Harness } from '../harness/index.js';
|
|
@@ -1947,124 +1947,6 @@ interface RecordGridProps {
|
|
|
1947
1947
|
*/
|
|
1948
1948
|
declare function RecordGrid({ columns, caption, state, empty, onCreate, onUpdate, onDelete, newRowDefaults, addLabel, locale, toolbar, loadingRowCount, className, }: RecordGridProps): react.JSX.Element;
|
|
1949
1949
|
|
|
1950
|
-
/**
|
|
1951
|
-
* Keyboard + pointer model for a trigger-and-popover pair, dependency-free.
|
|
1952
|
-
* Outside-mousedown and Escape both close; Escape also returns focus to the
|
|
1953
|
-
* trigger so keyboard users aren't dropped at the top of the document. The
|
|
1954
|
-
* returned `triggerProps` carry the ARIA contract (`aria-haspopup`/
|
|
1955
|
-
* `aria-expanded`); spread them onto the trigger button.
|
|
1956
|
-
*/
|
|
1957
|
-
declare function usePopover(open: boolean, setOpen: (open: boolean) => void): {
|
|
1958
|
-
containerRef: react.RefObject<HTMLDivElement | null>;
|
|
1959
|
-
triggerRef: react.RefObject<HTMLButtonElement | null>;
|
|
1960
|
-
triggerProps: {
|
|
1961
|
-
ref: react.RefObject<HTMLButtonElement | null>;
|
|
1962
|
-
'aria-haspopup': true;
|
|
1963
|
-
'aria-expanded': boolean;
|
|
1964
|
-
};
|
|
1965
|
-
};
|
|
1966
|
-
/**
|
|
1967
|
-
* The one overlay elevation for floating surfaces — picker menus, popovers,
|
|
1968
|
-
* drawers, modals. The theme's `shadow-overlay` utility is landing with the
|
|
1969
|
-
* token work; until it does, this is the composer's raised-card literal kept
|
|
1970
|
-
* in a single place so every overlay paints the same shadow and the later
|
|
1971
|
-
* token swap is a one-line edit (`shadow-overlay` here, `shadow-raised` on
|
|
1972
|
-
* the composer card).
|
|
1973
|
-
* TODO(theme): swap to `shadow-overlay` once the preset ships it.
|
|
1974
|
-
*/
|
|
1975
|
-
declare const OVERLAY_SHADOW = "shadow-[0_1px_2px_hsl(var(--foreground)/0.05),0_12px_28px_hsl(var(--foreground)/0.07)] dark:shadow-[0_1px_2px_hsl(var(--foreground)/0.14),0_12px_28px_hsl(var(--foreground)/0.22)]";
|
|
1976
|
-
/**
|
|
1977
|
-
* Guard an async action against double-submit. `run` ignores re-entrant calls
|
|
1978
|
-
* while a promise is in flight and flips `pending` so the caller can disable
|
|
1979
|
-
* the control — the fix for double-charge / double-approve on a slow network.
|
|
1980
|
-
* Settles (success or throw) before clearing, and no-ops state updates after
|
|
1981
|
-
* unmount.
|
|
1982
|
-
*/
|
|
1983
|
-
declare function usePending(): {
|
|
1984
|
-
pending: boolean;
|
|
1985
|
-
run: (action: () => void | Promise<void>) => void;
|
|
1986
|
-
};
|
|
1987
|
-
interface ModelPickerProps {
|
|
1988
|
-
value: string;
|
|
1989
|
-
onChange: (id: string) => void;
|
|
1990
|
-
/** Catalogue models — from `GET`ing the app's catalogue route (see
|
|
1991
|
-
* `runtime/model-catalog`), plus any product-specific entries appended. */
|
|
1992
|
-
models: CatalogModel[];
|
|
1993
|
-
loading?: boolean;
|
|
1994
|
-
/** Render a provider logo/badge; default is a generic sparkle. */
|
|
1995
|
-
renderProviderBadge?: (provider: string) => ReactNode;
|
|
1996
|
-
/** Section label for `featured` models. */
|
|
1997
|
-
recommendedLabel?: string;
|
|
1998
|
-
/** Pin a labeled section to the TOP of the list (above Recommended) for the
|
|
1999
|
-
* models a product wants surfaced first — e.g. a tuner app's own fine-tuned
|
|
2000
|
-
* models (`{ label: 'Your Fine-Tuned Models', match: (m) => m.provider === 'tuner' }`).
|
|
2001
|
-
* Matching models are shown only in this section, not duplicated below. */
|
|
2002
|
-
priorityGroup?: {
|
|
2003
|
-
label: string;
|
|
2004
|
-
match: (model: CatalogModel) => boolean;
|
|
2005
|
-
};
|
|
2006
|
-
}
|
|
2007
|
-
/**
|
|
2008
|
-
* Searchable model picker pill + popover: a featured/recommended section
|
|
2009
|
-
* first, then per-provider groups in catalogue order (the server already
|
|
2010
|
-
* sorts providers by tier).
|
|
2011
|
-
*
|
|
2012
|
-
* This is the CANONICAL ecosystem model picker (see "UI chrome ownership
|
|
2013
|
-
* (picker canon)" in AGENTS.md). sandbox-ui's `dashboard/ModelPicker` is
|
|
2014
|
-
* legacy — deprecated, frozen, removed at sandbox-ui's next major; new code
|
|
2015
|
-
* belongs here.
|
|
2016
|
-
*/
|
|
2017
|
-
declare function ModelPicker({ value, onChange, models, loading, renderProviderBadge, recommendedLabel, priorityGroup }: ModelPickerProps): react.JSX.Element;
|
|
2018
|
-
/** One reasoning-budget level: the engine `id` is unchanged (the value the
|
|
2019
|
-
* product sends to the loop); only the user-facing `label` is renamed to the
|
|
2020
|
-
* plainer "how hard should it think" vocabulary from docs/product-surfaces.md.
|
|
2021
|
-
* `low`→Quick, `medium`→Standard, `high`→Extended. The mapping is overridable
|
|
2022
|
-
* via `EffortPickerProps.levels`, so a product can relabel without losing the
|
|
2023
|
-
* ids the runtime expects. */
|
|
2024
|
-
interface EffortLevel {
|
|
2025
|
-
id: string;
|
|
2026
|
-
label: string;
|
|
2027
|
-
}
|
|
2028
|
-
declare const DEFAULT_EFFORT_LEVELS: readonly EffortLevel[];
|
|
2029
|
-
/** Segments the meter draws — fixed geometry so the ladder stays tabular
|
|
2030
|
-
* across levels (and across the trigger and its menu rows). */
|
|
2031
|
-
declare const EFFORT_METER_SEGMENTS = 4;
|
|
2032
|
-
/**
|
|
2033
|
-
* Filled-segment count for a level: 0 for off/none (or an id the levels list
|
|
2034
|
-
* does not carry); otherwise the level's position among the non-off choices
|
|
2035
|
-
* scaled onto the meter, so the ladder reads low < medium < high and the top
|
|
2036
|
-
* level fills the whole scale. The canonical four levels land 0 / 1 / 2 / 4.
|
|
2037
|
-
*/
|
|
2038
|
-
declare function effortMeterFill(levelId: string, levels?: readonly EffortLevel[]): number;
|
|
2039
|
-
/**
|
|
2040
|
-
* The thinking-strength meter: four 12px bars, filled count = level, filled
|
|
2041
|
-
* opacity ramping 25→100% left to right (unfilled at a faint ghost). Purely
|
|
2042
|
-
* decorative — the level name is always rendered as text beside it, so the
|
|
2043
|
-
* meter is `aria-hidden` and adds no second accessible name.
|
|
2044
|
-
*/
|
|
2045
|
-
declare function EffortMeter({ fill, className }: {
|
|
2046
|
-
fill: number;
|
|
2047
|
-
className?: string;
|
|
2048
|
-
}): react.JSX.Element;
|
|
2049
|
-
interface EffortPickerProps {
|
|
2050
|
-
value: string;
|
|
2051
|
-
onChange: (id: string) => void;
|
|
2052
|
-
/** Selectable levels (engine id + user-facing label). Defaults to the plain
|
|
2053
|
-
* "Thinking" vocabulary; override to relabel without changing the ids the
|
|
2054
|
-
* runtime receives. */
|
|
2055
|
-
levels?: readonly EffortLevel[];
|
|
2056
|
-
/** Prefix shown before the active level on the pill — the "what is this"
|
|
2057
|
-
* context the bare value lacked. Default "Thinking". Pass '' to hide it. */
|
|
2058
|
-
label?: string;
|
|
2059
|
-
}
|
|
2060
|
-
/** Thinking-budget selector pill, styled to match {@link ModelPicker}. Show
|
|
2061
|
-
* it only when the selected model `supportsReasoning`. "Thinking" is the
|
|
2062
|
-
* plain-English name for what was internally called "effort".
|
|
2063
|
-
*
|
|
2064
|
-
* The CANONICAL ecosystem effort picker — sandbox-ui's reasoning menu (inside
|
|
2065
|
-
* its `chat/AgentSessionControls`) is legacy and frozen. */
|
|
2066
|
-
declare function EffortPicker({ value, onChange, levels, label }: EffortPickerProps): react.JSX.Element;
|
|
2067
|
-
|
|
2068
1950
|
/** Describe metrics related to a chat message including model, token counts, and duration */
|
|
2069
1951
|
interface ChatMessageMetrics {
|
|
2070
1952
|
modelUsed?: string;
|
|
@@ -2260,4 +2142,4 @@ declare function useThinkingSeconds(active: boolean): number;
|
|
|
2260
2142
|
*/
|
|
2261
2143
|
declare function ChatMessages({ messages, messageSize, chrome, models, renderMarkdown, renderExtras, durableCards, userLabel, agentLabel, loading, approval, onToolCallClick, toolRenderers, error, onRetry, renderEmpty, emptyState, header, resolveAttachmentUrl, workProductCards, }: ChatMessagesProps): react.JSX.Element;
|
|
2262
2144
|
|
|
2263
|
-
export { type ActivityTone, type AgentActivityPage, AgentActivityPanel, type AgentActivityPanelProps, type AgentActivityRecord, 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 ComposerSendFailure, type ComposerSendHandler, type ComposerSendOutcome, type ComposerSendPartsHandler, type ComposerSendRejected, type ComposerSendResult, type ConsumeChatStreamResult,
|
|
2145
|
+
export { type ActivityTone, type AgentActivityPage, AgentActivityPanel, type AgentActivityPanelProps, type AgentActivityRecord, 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 ComposerSendFailure, type ComposerSendHandler, type ComposerSendOutcome, type ComposerSendPartsHandler, type ComposerSendRejected, type ComposerSendResult, type ConsumeChatStreamResult, DEFAULT_PROVENANCE_CONFIDENCE_POLICY, 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, EMPTY_RECORD_GRID_OVERLAY, EvidenceLineageTable, type EvidenceLineageTableProps, ExceptionList, type ExceptionListProps, type FetchSessionPage, type FieldValues, FlowWaterfall, type FlowWaterfallProps, HarnessGlyph, type HarnessGlyphProps, 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 LinkLikeComponent, type LinkLikeProps, type MentionTextSegment, MessageAttachments, type MessageAttachmentsProps, MissionActivityLane, type MissionActivityLaneProps, PROVENANCE_BASES, type ProposalApprovalHandlers, type ProvenanceBasis, type ProvenanceBasisMeta, type ProvenanceConfidencePolicy, type ProvenanceGap, type ProvenanceGapKind, ProvenanceLegend, type ProvenanceLegendProps, type ProvenanceRecord, type ProvenanceSource, type ProvenanceSourceStatus, ProvenanceStamp, type ProvenanceStampProps, type ProvenanceStanding, type ProvenanceStandingMeta, ProvenanceValue, type ProvenanceValueProps, ProviderLogo, type ProviderLogoProps, QualityCheckList, type QualityCheckListProps, QuestionOptionList, type QuestionOptionListProps, RecordGrid, type RecordGridBooleanColumn, type RecordGridCellChange, type RecordGridCellOutcome, type RecordGridCellSource, type RecordGridColumn, type RecordGridColumnBase, type RecordGridCreateOutcome, type RecordGridCurrencyColumn, type RecordGridDateColumn, type RecordGridDependency, type RecordGridNumberColumn, type RecordGridOverlay, type RecordGridProps, type RecordGridRow, type RecordGridRowOutcome, type RecordGridSelectColumn, type RecordGridSelectOption, type RecordGridSourceBasis, type RecordGridTextColumn, type RecordGridValue, type RecordGridWriteOutcome, type RestoreChatInteractionsOptions, ReviewQueueItem, type ReviewQueuePage, ReviewQueuePanel, type ReviewQueuePanelProps, ReviewQueueState, RunDrillIn, type RunDrillInProps, SeatPaywall, type SeatPaywallProps, type SessionActionLabels, type SessionActions, type SessionActionsOptions, type SessionBulkAction, SessionHistoryPanel, type SessionHistoryPanelProps, type SessionHistoryState, type SessionPageQuery, 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 UseInfiniteScrollOptions, type UseSessionHistoryOptions, type WaterfallRow, WorkProductCard, type WorkProductCardProps, __resetAttachmentFileCacheForTests, activityTone, buildAnswerData, cancelChatInteraction, consumeChatStream, createDurableInteractionAnswerSubmitter, createDurablePlanDecisionClient, createInteractionAnswerSubmitter, createMemoryInteractionAttemptStore, createSessionInteractionAttemptStore, describeProvenance, describeProvenanceSourceStatus, dispatchChatStreamLine, durableChatCardsFromParts, fieldAnswer, fieldValuesFromAnswers, formatActivityCost, formatActivityDuration, formatModelCost, formatRecordGridValue, formatSessionTimestamp, formatTokensPerSecond, hasSecretField, hydrateChatInteractions, interactionStatusLabels, interactionSubmissionSignature, interactionTerminalNotes, isLateAnswerableStatus, isRecordGridCellApplicable, lateAnswerMessage, loadAttachmentFile, loadingProvenanceSources, mergeActivityPages, mergeReviewQueuePages, nextRevealCount, parseRecordGridInput, pendingApprovalOf, projectRecordGridRows, provenanceBasisMeta, provenanceGaps, provenanceNextMove, provenanceStandingMeta, provenanceTriggerLabel, pruneRecordGridOverlay, readRecordGridCell, recordGridEditorText, recordGridFail, recordGridOk, recordGridRowLabel, resolveChatInteraction, resolveProvenanceStanding, responseErrorMessage, restoreChatInteractions, reviewQueueStateLabel, rollUpProvenanceStanding, sameRecordGridValue, segmentMentionContent, settleInteractionSubmit, standingFromConfidence, streamChatTurn, sumRecordGridColumn, terminalizePendingChatInteractions, triggerAttachmentDownload, upsertChatInteraction, useChatInteractions, useComposerAttachments, useDurablePlanFlow, useInfiniteScroll, useSessionActions, useSessionHistory, useSmoothText, useThinkingSeconds, validateRecordGridCell, validateRecordGridRow, waterfallLayout, weakerProvenanceStanding, withRecordGridCreated, withRecordGridRemoved, withRecordGridServerRow, withRecordGridUpdate, withoutRecordGridCreated, withoutRecordGridRemoved, withoutRecordGridUpdate, workProductPartsFromMessageParts, workProductStatusLabel };
|
package/dist/web-react/index.js
CHANGED
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
withoutRecordGridCreated,
|
|
111
111
|
withoutRecordGridRemoved,
|
|
112
112
|
withoutRecordGridUpdate
|
|
113
|
-
} from "../chunk-
|
|
113
|
+
} from "../chunk-AIHKKLKY.js";
|
|
114
114
|
import "../chunk-FBVLEGEG.js";
|
|
115
115
|
import {
|
|
116
116
|
EvidenceLineageTable,
|
|
@@ -141,7 +141,7 @@ import {
|
|
|
141
141
|
useComposerAttachments,
|
|
142
142
|
usePending,
|
|
143
143
|
usePopover
|
|
144
|
-
} from "../chunk-
|
|
144
|
+
} from "../chunk-MIZMWCKW.js";
|
|
145
145
|
import {
|
|
146
146
|
tabTerminalConnectionId,
|
|
147
147
|
useSandboxTerminalConnection
|
package/package.json
CHANGED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { F as FileMention } from './wire-DOZ-O6hD.js';
|
|
4
|
-
import { Harness } from './harness/index.js';
|
|
5
|
-
import { CatalogModel } from './catalog/index.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* `useFileMentions` — the glue a host passes straight into `AgentComposer`'s
|
|
9
|
-
* `mention` prop (`@tangle-network/sandbox-ui#184`) to wire up `@`-file
|
|
10
|
-
* mentions against `createSandboxFileIndexRoute` (`/chat-routes`).
|
|
11
|
-
*
|
|
12
|
-
* Fetches the index once per session from `indexUrl`, refreshes it in the
|
|
13
|
-
* background whenever the popover opens (a `fetchItems` call) if the cached
|
|
14
|
-
* copy has aged past `refreshAfterMs`, and answers every keystroke from an
|
|
15
|
-
* in-memory fuzzy filter — no per-keystroke network round trip. The returned
|
|
16
|
-
* `refresh()` lets a caller force a re-fetch immediately instead of waiting
|
|
17
|
-
* on `refreshAfterMs` — e.g. right after the agent creates a file mid-session.
|
|
18
|
-
*
|
|
19
|
-
* `MentionItem`/the `mention` prop shape mirror the FROZEN contract from
|
|
20
|
-
* sandbox-ui#184 structurally (no import: `/web-react` stays dependency-free
|
|
21
|
-
* beyond React, and `@tangle-network/sandbox-ui` is an optional peer).
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/** Mirrors sandbox-ui#184's `MentionItem` — the atomic pill's payload. For a
|
|
25
|
-
* file mention, `id` is the workspace-relative path (the pill's stable
|
|
26
|
-
* identity and the `@<id>` serialization sandbox-ui uses to round-trip
|
|
27
|
-
* `value`), `label` is the display name, and `detail` carries the full path
|
|
28
|
-
* for the popover row's secondary line. */
|
|
29
|
-
interface MentionItem {
|
|
30
|
-
id: string;
|
|
31
|
-
label: string;
|
|
32
|
-
detail?: string;
|
|
33
|
-
kind?: string;
|
|
34
|
-
}
|
|
35
|
-
/** Mirrors sandbox-ui#184's `AgentComposerProps['mention']` shape — plug the
|
|
36
|
-
* hook's `mention` return value straight into that prop. */
|
|
37
|
-
interface ComposerMentionProp {
|
|
38
|
-
trigger?: string;
|
|
39
|
-
fetchItems(query: string): Promise<MentionItem[]>;
|
|
40
|
-
onMentionsChange?(mentions: MentionItem[]): void;
|
|
41
|
-
renderItem?(item: MentionItem): ReactNode;
|
|
42
|
-
emptyText?: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Ranks `files` against `query` (case-insensitive), capped to `limit`:
|
|
46
|
-
* name-prefix matches first, then name-substring, then path-substring.
|
|
47
|
-
* Within a tier, shorter names sort first (the more specific match), then
|
|
48
|
-
* alphabetically by path for a stable order. An empty query returns the
|
|
49
|
-
* first `limit` entries unranked — the popover's default list before typing.
|
|
50
|
-
* Pure and dependency-free (no fuzzy-match library) so it's cheap enough to
|
|
51
|
-
* re-run on every keystroke against a 10k-entry index.
|
|
52
|
-
*/
|
|
53
|
-
declare function rankFileMentions(files: readonly FileMention[], query: string, limit: number): FileMention[];
|
|
54
|
-
/** Max popover results per query — enough to show a useful spread of matches
|
|
55
|
-
* without pushing the fuzzy-filtered list past what a popover can usefully
|
|
56
|
-
* render in one screen. */
|
|
57
|
-
declare const DEFAULT_MENTION_LIMIT = 20;
|
|
58
|
-
/** How long a `ready` index is served before a background refetch — long
|
|
59
|
-
* enough that a full session's worth of popover opens don't repeatedly hit
|
|
60
|
-
* the index endpoint, short enough that a stale listing doesn't linger too
|
|
61
|
-
* far past workspace file changes. Callers who need the index current right
|
|
62
|
-
* now (e.g. just after the agent creates a file) call `refresh()` instead of
|
|
63
|
-
* waiting on this window. */
|
|
64
|
-
declare const INDEX_REFRESH_AFTER_MS: number;
|
|
65
|
-
/** Popover empty-state copy for a `ready` index whose query matched nothing.
|
|
66
|
-
* Loading/warming/error states have their own copy — see `emptyTextFor`. */
|
|
67
|
-
declare const DEFAULT_MENTION_EMPTY_TEXT = "No matching files";
|
|
68
|
-
/** Define options for configuring file mention fetching, caching, and display behavior */
|
|
69
|
-
interface UseFileMentionsOptions {
|
|
70
|
-
/** GET endpoint returning `FileIndexResponse` (a `createSandboxFileIndexRoute`). */
|
|
71
|
-
indexUrl: string;
|
|
72
|
-
/** Max popover results per query. Default {@link DEFAULT_MENTION_LIMIT}. */
|
|
73
|
-
limit?: number;
|
|
74
|
-
/** How long a `ready` index is served without a background refetch.
|
|
75
|
-
* Default {@link INDEX_REFRESH_AFTER_MS}. */
|
|
76
|
-
refreshAfterMs?: number;
|
|
77
|
-
/** `fetch` override for tests / non-global-fetch hosts. Default `fetch`. */
|
|
78
|
-
fetchImpl?: typeof fetch;
|
|
79
|
-
/** Text shown in the popover's empty state once the index is loaded and
|
|
80
|
-
* the query matched nothing. Default {@link DEFAULT_MENTION_EMPTY_TEXT}. */
|
|
81
|
-
emptyText?: string;
|
|
82
|
-
}
|
|
83
|
-
/** Provide properties and methods to manage and refresh file mentions in a composer interface */
|
|
84
|
-
interface UseFileMentionsResult {
|
|
85
|
-
/** Spread straight into `AgentComposer`'s `mention` prop. */
|
|
86
|
-
mention: ComposerMentionProp;
|
|
87
|
-
/** The files currently referenced by mentions in the composer's value —
|
|
88
|
-
* the send-body list (map through `fileMentionsToParts`). */
|
|
89
|
-
mentions: FileMention[];
|
|
90
|
-
/** Drop all currently-referenced mentions (e.g. after a successful send). */
|
|
91
|
-
clearMentions: () => void;
|
|
92
|
-
/** Force a re-fetch of the index right now, ignoring `refreshAfterMs` — for
|
|
93
|
-
* example right after the agent creates a file mid-session, so the next
|
|
94
|
-
* popover open sees it. Dedupes against an already-in-flight load rather
|
|
95
|
-
* than firing a second request. */
|
|
96
|
-
refresh: () => Promise<void>;
|
|
97
|
-
}
|
|
98
|
-
/** Resolve and manage file mention data with configurable fetching and state handling */
|
|
99
|
-
declare function useFileMentions(options: UseFileMentionsOptions): UseFileMentionsResult;
|
|
100
|
-
|
|
101
|
-
interface AgentSessionControlsProps {
|
|
102
|
-
/** Catalog models — canonical provider-prefixed ids. */
|
|
103
|
-
models: CatalogModel[];
|
|
104
|
-
modelsLoading?: boolean;
|
|
105
|
-
/** Selected canonical model id. */
|
|
106
|
-
model: string;
|
|
107
|
-
onModelChange(modelId: string): void;
|
|
108
|
-
/** Current harness; harness↔model coherence is enforced on every change. */
|
|
109
|
-
harness: Harness;
|
|
110
|
-
onHarnessChange(harness: Harness): void;
|
|
111
|
-
/** Harnesses to offer; defaults to the labeled set. */
|
|
112
|
-
availableHarnesses?: ReadonlyArray<Harness>;
|
|
113
|
-
/** Reasoning-effort value + setter. Shown only when the selected model
|
|
114
|
-
* `supportsReasoning`, matching `EffortPicker`'s guidance. */
|
|
115
|
-
effort: string;
|
|
116
|
-
onEffortChange(effort: string): void;
|
|
117
|
-
/**
|
|
118
|
-
* `inline` (default): model, harness, effort side by side — the prior
|
|
119
|
-
* behavior. `compact`: model inline, harness + effort behind a gear popover.
|
|
120
|
-
*/
|
|
121
|
-
layout?: 'inline' | 'compact';
|
|
122
|
-
/** Hide the harness control entirely (single-harness products). */
|
|
123
|
-
showHarness?: boolean;
|
|
124
|
-
renderProviderBadge?: (provider: string) => ReactNode;
|
|
125
|
-
className?: string;
|
|
126
|
-
}
|
|
127
|
-
declare function AgentSessionControls(props: AgentSessionControlsProps): react.JSX.Element;
|
|
128
|
-
|
|
129
|
-
export { type AgentSessionControlsProps as A, type ComposerMentionProp as C, DEFAULT_MENTION_EMPTY_TEXT as D, INDEX_REFRESH_AFTER_MS as I, type MentionItem as M, type UseFileMentionsResult as U, AgentSessionControls as a, DEFAULT_MENTION_LIMIT as b, type UseFileMentionsOptions as c, rankFileMentions as r, useFileMentions as u };
|
|
File without changes
|