@tangle-network/agent-app 0.43.12 → 0.43.14
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/.claude/skills/eval-campaign/SKILL.md +1 -1
- package/dist/assistant/index.d.ts +1 -1
- package/dist/assistant/index.js +1 -1
- package/dist/{chunk-4X7OOVII.js → chunk-VMY4TKMN.js} +171 -1
- package/dist/chunk-VMY4TKMN.js.map +1 -0
- package/dist/web-react/index.d.ts +103 -2
- package/dist/web-react/index.js +43 -1
- package/package.json +1 -1
- package/dist/chunk-4X7OOVII.js.map +0 -1
|
@@ -1,11 +1,105 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { InteractionField, InteractionRequest, InteractionData } from '@tangle-network/agent-interface';
|
|
4
|
+
export { InteractionData, InteractionOutcome, InteractionRequest } from '@tangle-network/agent-interface';
|
|
3
5
|
import { S as StepAgentActivity } from '../agent-activity-C8ZG0F0M.js';
|
|
4
6
|
import { a as FlowTrace } from '../flow-types-Cb_AblZs.js';
|
|
5
7
|
export { S as SandboxTerminalConnection, a as SandboxTerminalConnectionResponse, U as UseSandboxTerminalConnectionOptions, b as UseSandboxTerminalConnectionResult, t as tabTerminalConnectionId, u as useSandboxTerminalConnection } from '../sandbox-terminal-BIIC__CP.js';
|
|
6
8
|
import { C as CatalogModel } from '../model-catalog-BEAEVDaa.js';
|
|
7
9
|
import { Harness } from '../harness/index.js';
|
|
8
|
-
|
|
10
|
+
|
|
11
|
+
/** Sidecar → client: the agent raised an ask; data = `{ request }`. */
|
|
12
|
+
declare const INTERACTION_EVENT: "interaction";
|
|
13
|
+
/** Sidecar → client: the ask was withdrawn; data = `{ id, reason? }`. */
|
|
14
|
+
declare const INTERACTION_CANCEL_EVENT: "interaction.cancel";
|
|
15
|
+
/** An ask was answered; data = `{ id, status }`. In the wire contract so a
|
|
16
|
+
* server broadcast and a client-local mark share one event name. */
|
|
17
|
+
declare const INTERACTION_RESOLVED_EVENT: "interaction.resolved";
|
|
18
|
+
declare function isRenderableInteractionKind(kind: string): boolean;
|
|
19
|
+
/** Answer/field keys the sidecar will accept: identifier-safe and never a
|
|
20
|
+
* prototype-pollution vector. */
|
|
21
|
+
declare function isSafeInteractionFieldKey(key: string): boolean;
|
|
22
|
+
type ChatSelectField = Extract<InteractionField, {
|
|
23
|
+
type: 'select';
|
|
24
|
+
}> & {
|
|
25
|
+
allowCustom?: boolean;
|
|
26
|
+
};
|
|
27
|
+
type ChatInteractionField = Exclude<InteractionField, {
|
|
28
|
+
type: 'select';
|
|
29
|
+
}> | ChatSelectField;
|
|
30
|
+
/** `InteractionRequest` whose select fields may carry `allowCustom`. */
|
|
31
|
+
type InteractionRequestWire = Omit<InteractionRequest, 'answerSpec'> & {
|
|
32
|
+
answerSpec: {
|
|
33
|
+
fields: ChatInteractionField[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
type ChatInteractionStatus = 'pending' | 'answered' | 'declined' | 'cancelled' | 'expired';
|
|
37
|
+
/** The client/persisted view of one ask. `fields` come verbatim off the wire. */
|
|
38
|
+
interface ChatInteraction {
|
|
39
|
+
id: string;
|
|
40
|
+
kind: string;
|
|
41
|
+
title: string;
|
|
42
|
+
body?: string;
|
|
43
|
+
fields: ChatInteractionField[];
|
|
44
|
+
status: ChatInteractionStatus;
|
|
45
|
+
/** Set when status came from an `interaction.cancel` (e.g. "timeout"). */
|
|
46
|
+
cancelReason?: string;
|
|
47
|
+
}
|
|
48
|
+
declare function isTerminalInteractionStatus(status: ChatInteractionStatus): boolean;
|
|
49
|
+
/** Statuses only move forward (pending → terminal); a replayed/stale `pending`
|
|
50
|
+
* must never resurrect a resolved card. */
|
|
51
|
+
declare function canTransitionInteractionStatus(from: ChatInteractionStatus, to: ChatInteractionStatus): boolean;
|
|
52
|
+
/** Maps an `interaction.cancel` reason to the card's terminal status. */
|
|
53
|
+
declare function cancelStatusFor(reason: string | undefined): ChatInteractionStatus;
|
|
54
|
+
/** Content identity for duplicate safety nets. Excludes volatile ids/statuses. */
|
|
55
|
+
declare function questionInteractionContentSignature(interaction: ChatInteraction): string | null;
|
|
56
|
+
declare function dedupeQuestionInteractionsByContent(interactions: ChatInteraction[]): ChatInteraction[];
|
|
57
|
+
type ParseInteractionResult = {
|
|
58
|
+
succeeded: true;
|
|
59
|
+
value: InteractionRequestWire;
|
|
60
|
+
} | {
|
|
61
|
+
succeeded: false;
|
|
62
|
+
error: string;
|
|
63
|
+
};
|
|
64
|
+
/** Parses an `interaction` event's data (`{ request }`). Validates the shape
|
|
65
|
+
* with the agent-interface schema but returns the raw request so a field a
|
|
66
|
+
* pinned schema predates (`allowCustom`) survives. */
|
|
67
|
+
declare function parseInteractionRequest(data: Record<string, unknown> | undefined): ParseInteractionResult;
|
|
68
|
+
interface InteractionCancelData {
|
|
69
|
+
id: string;
|
|
70
|
+
reason?: string;
|
|
71
|
+
}
|
|
72
|
+
declare function parseInteractionCancel(data: Record<string, unknown> | undefined): {
|
|
73
|
+
succeeded: true;
|
|
74
|
+
value: InteractionCancelData;
|
|
75
|
+
} | {
|
|
76
|
+
succeeded: false;
|
|
77
|
+
error: string;
|
|
78
|
+
};
|
|
79
|
+
declare function fieldAcceptsFreeText(field: ChatInteractionField): boolean;
|
|
80
|
+
interface ComposerAnswerDelivery {
|
|
81
|
+
interactionId: string;
|
|
82
|
+
field: ChatInteractionField;
|
|
83
|
+
}
|
|
84
|
+
/** One delivery per pending ask: the first free-text-capable field, else the
|
|
85
|
+
* first field. Zero-field asks are skipped (nothing to carry the text). */
|
|
86
|
+
declare function composerAnswerDeliveries(pending: ChatInteraction[]): ComposerAnswerDelivery[];
|
|
87
|
+
/** Shapes composer text into the respond payload for the routed field
|
|
88
|
+
* (select answers are string arrays on the wire; text answers are strings). */
|
|
89
|
+
declare function composerAnswerData(field: ChatInteractionField, text: string): InteractionData;
|
|
90
|
+
declare function interactionPartKey(id: string): string;
|
|
91
|
+
declare function noticePartKey(id: string): string;
|
|
92
|
+
type NoticeKind = 'warning' | 'auto-declined';
|
|
93
|
+
/** Builds the persisted/streamed `notice` part — a one-line transcript notice
|
|
94
|
+
* explaining an out-of-band event (warning, auto-declined interaction). */
|
|
95
|
+
declare function noticePart(noticeKind: NoticeKind, id: string, text: string): Record<string, unknown>;
|
|
96
|
+
/** Reads a wire request into the client's pending `ChatInteraction`. */
|
|
97
|
+
declare function interactionFromWireRequest(request: InteractionRequestWire): ChatInteraction;
|
|
98
|
+
/** Builds the persisted/streamed `interaction` part from a wire request. */
|
|
99
|
+
declare function interactionToPersistedPart(request: InteractionRequestWire, status: ChatInteractionStatus, cancelReason?: string): Record<string, unknown>;
|
|
100
|
+
/** Reads a persisted/streamed `interaction` part back into a `ChatInteraction`.
|
|
101
|
+
* Returns null (caller logs) when the part is not one of ours. */
|
|
102
|
+
declare function persistedPartToInteraction(part: Record<string, unknown>): ChatInteraction | null;
|
|
9
103
|
|
|
10
104
|
/**
|
|
11
105
|
* Client-side chat-stream consumption — the NDJSON parse loop every agent
|
|
@@ -15,11 +109,13 @@ import '@tangle-network/agent-interface';
|
|
|
15
109
|
* {kind:'event', event:{type:'text'|'reasoning'|'tool_call'|'usage', ...}}
|
|
16
110
|
* {kind:'tool_result', toolCallId, toolName, label, outcome}
|
|
17
111
|
* {type:'turn'|'metadata'|'error'|'turn_status', ...} (route-level)
|
|
112
|
+
* {type:'interaction', data:{request}} (sidecar ask)
|
|
18
113
|
*
|
|
19
114
|
* Replayed lines carry an extra `seq` — transparently ignored. Works for
|
|
20
115
|
* router-backed and sandbox-backed chats alike: anything producing these
|
|
21
116
|
* lines (live pump, queued follow, resume replay) feeds the same callbacks.
|
|
22
117
|
*/
|
|
118
|
+
|
|
23
119
|
interface ChatStreamToolCall {
|
|
24
120
|
toolCallId?: string;
|
|
25
121
|
toolName: string;
|
|
@@ -49,6 +145,11 @@ interface ChatStreamCallbacks {
|
|
|
49
145
|
onMetadata?: (data: Record<string, unknown>) => void;
|
|
50
146
|
/** A loop-level error event (the turn failed server-side). */
|
|
51
147
|
onErrorEvent?: (message: string) => void;
|
|
148
|
+
/** A sidecar interaction ask (kind: "question"/"plan"/…). The run is BLOCKED
|
|
149
|
+
* in the broker until the user answers; a pending ask is "waiting on the
|
|
150
|
+
* user", not "model working". Optional — a consumer that doesn't wire it
|
|
151
|
+
* parses the same stream unchanged. */
|
|
152
|
+
onInteraction?: (interaction: ChatInteraction) => void;
|
|
52
153
|
}
|
|
53
154
|
interface ConsumeChatStreamResult {
|
|
54
155
|
turnId: string | null;
|
|
@@ -555,4 +656,4 @@ declare function useThinkingSeconds(active: boolean): number;
|
|
|
555
656
|
*/
|
|
556
657
|
declare function ChatMessages({ messages, models, renderMarkdown, renderExtras, userLabel, agentLabel, loading, approval, onToolCallClick, toolRenderers, error, onRetry, renderEmpty, emptyState, header, }: ChatMessagesProps): react.JSX.Element;
|
|
557
658
|
|
|
558
|
-
export { type ActivityTone, type AgentActivityPage, AgentActivityPanel, type AgentActivityPanelProps, type AgentActivityRecord, AgentSessionControls, type AgentSessionControlsProps, CatalogModel, ChatComposer, type ChatComposerProps, type ChatEmptyDoor, ChatEmptyState, type ChatEmptyStateProps, type ChatMessageMetrics, type ChatMessageSegment, ChatMessages, type ChatMessagesProps, type ChatStreamCallbacks, type ChatStreamToolCall, type ChatStreamToolResult, type ChatToolCallInfo, type ChatUiMessage, type ComposerFile, type ConsumeChatStreamResult, DEFAULT_EFFORT_LEVELS, type EffortLevel, EffortPicker, type EffortPickerProps, FlowWaterfall, type FlowWaterfallProps, MissionActivityLane, type MissionActivityLaneProps, ModelPicker, type ModelPickerProps, type ProposalApprovalHandlers, ProviderLogo, type ProviderLogoProps, RunDrillIn, type RunDrillInProps, SeatPaywall, type SeatPaywallProps, type SmoothRevealOptions, type StreamChatOptions, type ToolDetailRenderers, type ToolRunRecord, type ToolRunStep, type WaterfallRow, activityTone, consumeChatStream, dispatchChatStreamLine, formatActivityCost, formatActivityDuration, formatModelCost, formatTokensPerSecond, mergeActivityPages, nextRevealCount, pendingApprovalOf, streamChatTurn, usePending, usePopover, useSmoothText, useThinkingSeconds, waterfallLayout };
|
|
659
|
+
export { type ActivityTone, type AgentActivityPage, AgentActivityPanel, type AgentActivityPanelProps, type AgentActivityRecord, AgentSessionControls, type AgentSessionControlsProps, CatalogModel, ChatComposer, type ChatComposerProps, type ChatEmptyDoor, ChatEmptyState, type ChatEmptyStateProps, type ChatInteraction, type ChatInteractionField, type ChatInteractionStatus, type ChatMessageMetrics, type ChatMessageSegment, ChatMessages, type ChatMessagesProps, type ChatSelectField, type ChatStreamCallbacks, type ChatStreamToolCall, type ChatStreamToolResult, type ChatToolCallInfo, type ChatUiMessage, type ComposerAnswerDelivery, type ComposerFile, type ConsumeChatStreamResult, DEFAULT_EFFORT_LEVELS, type EffortLevel, EffortPicker, type EffortPickerProps, FlowWaterfall, type FlowWaterfallProps, INTERACTION_CANCEL_EVENT, INTERACTION_EVENT, INTERACTION_RESOLVED_EVENT, type InteractionCancelData, type InteractionRequestWire, MissionActivityLane, type MissionActivityLaneProps, ModelPicker, type ModelPickerProps, type NoticeKind, type ParseInteractionResult, type ProposalApprovalHandlers, ProviderLogo, type ProviderLogoProps, RunDrillIn, type RunDrillInProps, SeatPaywall, type SeatPaywallProps, type SmoothRevealOptions, type StreamChatOptions, type ToolDetailRenderers, type ToolRunRecord, type ToolRunStep, type WaterfallRow, activityTone, canTransitionInteractionStatus, cancelStatusFor, composerAnswerData, composerAnswerDeliveries, consumeChatStream, dedupeQuestionInteractionsByContent, dispatchChatStreamLine, fieldAcceptsFreeText, formatActivityCost, formatActivityDuration, formatModelCost, formatTokensPerSecond, interactionFromWireRequest, interactionPartKey, interactionToPersistedPart, isRenderableInteractionKind, isSafeInteractionFieldKey, isTerminalInteractionStatus, mergeActivityPages, nextRevealCount, noticePart, noticePartKey, parseInteractionCancel, parseInteractionRequest, pendingApprovalOf, persistedPartToInteraction, questionInteractionContentSignature, streamChatTurn, usePending, usePopover, useSmoothText, useThinkingSeconds, waterfallLayout };
|
package/dist/web-react/index.js
CHANGED
|
@@ -7,28 +7,49 @@ import {
|
|
|
7
7
|
DEFAULT_EFFORT_LEVELS,
|
|
8
8
|
EffortPicker,
|
|
9
9
|
FlowWaterfall,
|
|
10
|
+
INTERACTION_CANCEL_EVENT,
|
|
11
|
+
INTERACTION_EVENT,
|
|
12
|
+
INTERACTION_RESOLVED_EVENT,
|
|
10
13
|
MissionActivityLane,
|
|
11
14
|
ModelPicker,
|
|
12
15
|
ProviderLogo,
|
|
13
16
|
RunDrillIn,
|
|
14
17
|
SeatPaywall,
|
|
15
18
|
activityTone,
|
|
19
|
+
canTransitionInteractionStatus,
|
|
20
|
+
cancelStatusFor,
|
|
21
|
+
composerAnswerData,
|
|
22
|
+
composerAnswerDeliveries,
|
|
16
23
|
consumeChatStream,
|
|
24
|
+
dedupeQuestionInteractionsByContent,
|
|
17
25
|
dispatchChatStreamLine,
|
|
26
|
+
fieldAcceptsFreeText,
|
|
18
27
|
formatActivityCost,
|
|
19
28
|
formatActivityDuration,
|
|
20
29
|
formatModelCost,
|
|
21
30
|
formatTokensPerSecond,
|
|
31
|
+
interactionFromWireRequest,
|
|
32
|
+
interactionPartKey,
|
|
33
|
+
interactionToPersistedPart,
|
|
34
|
+
isRenderableInteractionKind,
|
|
35
|
+
isSafeInteractionFieldKey,
|
|
36
|
+
isTerminalInteractionStatus,
|
|
22
37
|
mergeActivityPages,
|
|
23
38
|
nextRevealCount,
|
|
39
|
+
noticePart,
|
|
40
|
+
noticePartKey,
|
|
41
|
+
parseInteractionCancel,
|
|
42
|
+
parseInteractionRequest,
|
|
24
43
|
pendingApprovalOf,
|
|
44
|
+
persistedPartToInteraction,
|
|
45
|
+
questionInteractionContentSignature,
|
|
25
46
|
streamChatTurn,
|
|
26
47
|
usePending,
|
|
27
48
|
usePopover,
|
|
28
49
|
useSmoothText,
|
|
29
50
|
useThinkingSeconds,
|
|
30
51
|
waterfallLayout
|
|
31
|
-
} from "../chunk-
|
|
52
|
+
} from "../chunk-VMY4TKMN.js";
|
|
32
53
|
import {
|
|
33
54
|
tabTerminalConnectionId,
|
|
34
55
|
useSandboxTerminalConnection
|
|
@@ -44,21 +65,42 @@ export {
|
|
|
44
65
|
DEFAULT_EFFORT_LEVELS,
|
|
45
66
|
EffortPicker,
|
|
46
67
|
FlowWaterfall,
|
|
68
|
+
INTERACTION_CANCEL_EVENT,
|
|
69
|
+
INTERACTION_EVENT,
|
|
70
|
+
INTERACTION_RESOLVED_EVENT,
|
|
47
71
|
MissionActivityLane,
|
|
48
72
|
ModelPicker,
|
|
49
73
|
ProviderLogo,
|
|
50
74
|
RunDrillIn,
|
|
51
75
|
SeatPaywall,
|
|
52
76
|
activityTone,
|
|
77
|
+
canTransitionInteractionStatus,
|
|
78
|
+
cancelStatusFor,
|
|
79
|
+
composerAnswerData,
|
|
80
|
+
composerAnswerDeliveries,
|
|
53
81
|
consumeChatStream,
|
|
82
|
+
dedupeQuestionInteractionsByContent,
|
|
54
83
|
dispatchChatStreamLine,
|
|
84
|
+
fieldAcceptsFreeText,
|
|
55
85
|
formatActivityCost,
|
|
56
86
|
formatActivityDuration,
|
|
57
87
|
formatModelCost,
|
|
58
88
|
formatTokensPerSecond,
|
|
89
|
+
interactionFromWireRequest,
|
|
90
|
+
interactionPartKey,
|
|
91
|
+
interactionToPersistedPart,
|
|
92
|
+
isRenderableInteractionKind,
|
|
93
|
+
isSafeInteractionFieldKey,
|
|
94
|
+
isTerminalInteractionStatus,
|
|
59
95
|
mergeActivityPages,
|
|
60
96
|
nextRevealCount,
|
|
97
|
+
noticePart,
|
|
98
|
+
noticePartKey,
|
|
99
|
+
parseInteractionCancel,
|
|
100
|
+
parseInteractionRequest,
|
|
61
101
|
pendingApprovalOf,
|
|
102
|
+
persistedPartToInteraction,
|
|
103
|
+
questionInteractionContentSignature,
|
|
62
104
|
streamChatTurn,
|
|
63
105
|
tabTerminalConnectionId,
|
|
64
106
|
usePending,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-app",
|
|
3
|
-
"version": "0.43.
|
|
3
|
+
"version": "0.43.14",
|
|
4
4
|
"packageManager": "pnpm@10.33.4",
|
|
5
5
|
"description": "Application-shell framework for Tangle agent products: a bounded tool loop, the structured agent→app tool side channel, integration-hub client, per-workspace billing, and crypto — composed over the Tangle agent substrate through typed seams.",
|
|
6
6
|
"keywords": [
|