@xenosystem/agent-interface-ui 0.1.35 → 0.1.37
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/adapters/agentHostPlatformBridge.d.ts.map +1 -1
- package/dist/adapters/agentHostPlatformBridge.js +21 -1
- package/dist/adapters/agentHostPlatformBridge.js.map +1 -1
- package/dist/agent.css +2180 -7
- package/dist/components/agent/AgentAuthGate.d.ts +86 -0
- package/dist/components/agent/AgentAuthGate.d.ts.map +1 -0
- package/dist/components/agent/AgentAuthGate.js +189 -0
- package/dist/components/agent/AgentAuthGate.js.map +1 -0
- package/dist/components/agent/AgentInterface.d.ts +8 -1
- package/dist/components/agent/AgentInterface.d.ts.map +1 -1
- package/dist/components/agent/AgentInterface.js +27 -8
- package/dist/components/agent/AgentInterface.js.map +1 -1
- package/dist/components/agent/settings/sections/AccountWorkspacePanel.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/AccountWorkspacePanel.js +37 -6
- package/dist/components/agent/settings/sections/AccountWorkspacePanel.js.map +1 -1
- package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.d.ts.map +1 -1
- package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js +1 -0
- package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js.map +1 -1
- package/dist/components/product/XenoAgentProductHeader.d.ts +2 -1
- package/dist/components/product/XenoAgentProductHeader.d.ts.map +1 -1
- package/dist/components/product/XenoAgentProductHeader.js +2 -2
- package/dist/components/product/XenoAgentProductHeader.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -4
- package/dist/index.js.map +1 -1
- package/dist/stores/workspaceStore.d.ts.map +1 -1
- package/dist/stores/workspaceStore.js +1 -0
- package/dist/stores/workspaceStore.js.map +1 -1
- package/package.json +8 -7
- package/src/agent.css +5 -0
- package/src/fonts/inter/OFL.txt +92 -0
- package/src/fonts/inter/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2 +0 -0
- package/src/fonts/inter/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2 +0 -0
- package/src/fonts/inter/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7SUc.woff2 +0 -0
- package/src/fonts/inter/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2 +0 -0
- package/src/fonts/inter/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2 +0 -0
- package/src/fonts/inter/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7SUc.woff2 +0 -0
- package/src/fonts/inter/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7SUc.woff2 +0 -0
- package/src/fonts/inter.css +75 -0
- package/dist/adapters/xenoAgentCompatibilityBridge.d.ts +0 -14
- package/dist/adapters/xenoAgentCompatibilityBridge.d.ts.map +0 -1
- package/dist/adapters/xenoAgentCompatibilityBridge.js +0 -247
- package/dist/adapters/xenoAgentCompatibilityBridge.js.map +0 -1
- package/dist/adapters/xenoAgentHostCatalog.d.ts +0 -40
- package/dist/adapters/xenoAgentHostCatalog.d.ts.map +0 -1
- package/dist/adapters/xenoAgentHostCatalog.js +0 -231
- package/dist/adapters/xenoAgentHostCatalog.js.map +0 -1
- package/dist/components/agent/AIStatusIndicator.d.ts +0 -25
- package/dist/components/agent/AIStatusIndicator.d.ts.map +0 -1
- package/dist/components/agent/AIStatusIndicator.js +0 -85
- package/dist/components/agent/AIStatusIndicator.js.map +0 -1
- package/dist/components/agent/AgentNotificationBanner.d.ts +0 -10
- package/dist/components/agent/AgentNotificationBanner.d.ts.map +0 -1
- package/dist/components/agent/AgentNotificationBanner.js +0 -28
- package/dist/components/agent/AgentNotificationBanner.js.map +0 -1
- package/dist/components/agent/AgentView.d.ts +0 -185
- package/dist/components/agent/AgentView.d.ts.map +0 -1
- package/dist/components/agent/AgentView.js +0 -7850
- package/dist/components/agent/AgentView.js.map +0 -1
- package/dist/components/agent/AssistantTurnStatusNotice.d.ts +0 -16
- package/dist/components/agent/AssistantTurnStatusNotice.d.ts.map +0 -1
- package/dist/components/agent/AssistantTurnStatusNotice.js +0 -54
- package/dist/components/agent/AssistantTurnStatusNotice.js.map +0 -1
- package/dist/components/agent/CommandToolCard.d.ts +0 -11
- package/dist/components/agent/CommandToolCard.d.ts.map +0 -1
- package/dist/components/agent/CommandToolCard.js +0 -29
- package/dist/components/agent/CommandToolCard.js.map +0 -1
- package/dist/components/agent/GhostTextArea.d.ts +0 -13
- package/dist/components/agent/GhostTextArea.d.ts.map +0 -1
- package/dist/components/agent/GhostTextArea.js +0 -21
- package/dist/components/agent/GhostTextArea.js.map +0 -1
- package/dist/components/agent/LiveConversationCollaboration.d.ts +0 -27
- package/dist/components/agent/LiveConversationCollaboration.d.ts.map +0 -1
- package/dist/components/agent/LiveConversationCollaboration.js +0 -127
- package/dist/components/agent/LiveConversationCollaboration.js.map +0 -1
- package/dist/components/agent/SdkSessionPanel.d.ts +0 -25
- package/dist/components/agent/SdkSessionPanel.d.ts.map +0 -1
- package/dist/components/agent/SdkSessionPanel.js +0 -15
- package/dist/components/agent/SdkSessionPanel.js.map +0 -1
- package/dist/components/agent/SlashCommandAutocomplete.d.ts +0 -12
- package/dist/components/agent/SlashCommandAutocomplete.d.ts.map +0 -1
- package/dist/components/agent/SlashCommandAutocomplete.js +0 -33
- package/dist/components/agent/SlashCommandAutocomplete.js.map +0 -1
- package/dist/components/agent/collaborationWindow.d.ts +0 -11
- package/dist/components/agent/collaborationWindow.d.ts.map +0 -1
- package/dist/components/agent/collaborationWindow.js +0 -10
- package/dist/components/agent/collaborationWindow.js.map +0 -1
- package/dist/components/agent/conversationCollaborationAppendJournal.d.ts +0 -25
- package/dist/components/agent/conversationCollaborationAppendJournal.d.ts.map +0 -1
- package/dist/components/agent/conversationCollaborationAppendJournal.js +0 -118
- package/dist/components/agent/conversationCollaborationAppendJournal.js.map +0 -1
- package/dist/components/agent/conversationCollaborationController.d.ts +0 -96
- package/dist/components/agent/conversationCollaborationController.d.ts.map +0 -1
- package/dist/components/agent/conversationCollaborationController.js +0 -597
- package/dist/components/agent/conversationCollaborationController.js.map +0 -1
- package/dist/components/agent/destructiveConfirmation.d.ts +0 -76
- package/dist/components/agent/destructiveConfirmation.d.ts.map +0 -1
- package/dist/components/agent/destructiveConfirmation.js +0 -231
- package/dist/components/agent/destructiveConfirmation.js.map +0 -1
- package/dist/components/agent/editorOperationAuthority.d.ts +0 -29
- package/dist/components/agent/editorOperationAuthority.d.ts.map +0 -1
- package/dist/components/agent/editorOperationAuthority.js +0 -73
- package/dist/components/agent/editorOperationAuthority.js.map +0 -1
- package/dist/components/agent/mainAssistant.d.ts +0 -24
- package/dist/components/agent/mainAssistant.d.ts.map +0 -1
- package/dist/components/agent/mainAssistant.js +0 -24
- package/dist/components/agent/mainAssistant.js.map +0 -1
- package/dist/components/agent/nativeTuiComposerInput.d.ts +0 -42
- package/dist/components/agent/nativeTuiComposerInput.d.ts.map +0 -1
- package/dist/components/agent/nativeTuiComposerInput.js +0 -51
- package/dist/components/agent/nativeTuiComposerInput.js.map +0 -1
- package/dist/components/agent/settings/shared/InAppConfirmationDialog.d.ts +0 -25
- package/dist/components/agent/settings/shared/InAppConfirmationDialog.d.ts.map +0 -1
- package/dist/components/agent/settings/shared/InAppConfirmationDialog.js +0 -89
- package/dist/components/agent/settings/shared/InAppConfirmationDialog.js.map +0 -1
- package/dist/components/agent/toolCardDisplay.d.ts +0 -24
- package/dist/components/agent/toolCardDisplay.d.ts.map +0 -1
- package/dist/components/agent/toolCardDisplay.js +0 -85
- package/dist/components/agent/toolCardDisplay.js.map +0 -1
- package/dist/components/agent/webJobProgressView.d.ts +0 -90
- package/dist/components/agent/webJobProgressView.d.ts.map +0 -1
- package/dist/components/agent/webJobProgressView.js +0 -104
- package/dist/components/agent/webJobProgressView.js.map +0 -1
- package/dist/components/ui/CodeBlock.d.ts +0 -8
- package/dist/components/ui/CodeBlock.d.ts.map +0 -1
- package/dist/components/ui/CodeBlock.js +0 -89
- package/dist/components/ui/CodeBlock.js.map +0 -1
- package/dist/platformApiTypes.d.ts +0 -4176
- package/dist/platformApiTypes.d.ts.map +0 -1
- package/dist/platformApiTypes.js +0 -2
- package/dist/platformApiTypes.js.map +0 -1
- package/dist/platformBridge.d.ts +0 -43
- package/dist/platformBridge.d.ts.map +0 -1
- package/dist/platformBridge.js +0 -67
- package/dist/platformBridge.js.map +0 -1
- package/dist/providerSelector.d.ts +0 -28
- package/dist/providerSelector.d.ts.map +0 -1
- package/dist/providerSelector.js +0 -104
- package/dist/providerSelector.js.map +0 -1
- package/dist/services/connectionMode.d.ts +0 -13
- package/dist/services/connectionMode.d.ts.map +0 -1
- package/dist/services/connectionMode.js +0 -31
- package/dist/services/connectionMode.js.map +0 -1
- package/dist/sessionTabs.d.ts +0 -48
- package/dist/sessionTabs.d.ts.map +0 -1
- package/dist/sessionTabs.js +0 -106
- package/dist/sessionTabs.js.map +0 -1
- package/dist/stores/acpAgentStore.d.ts +0 -264
- package/dist/stores/acpAgentStore.d.ts.map +0 -1
- package/dist/stores/acpAgentStore.js +0 -825
- package/dist/stores/acpAgentStore.js.map +0 -1
- package/dist/stores/agentChatStore.d.ts +0 -693
- package/dist/stores/agentChatStore.d.ts.map +0 -1
- package/dist/stores/agentChatStore.js +0 -5876
- package/dist/stores/agentChatStore.js.map +0 -1
- package/dist/stores/authStore.d.ts +0 -26
- package/dist/stores/authStore.d.ts.map +0 -1
- package/dist/stores/authStore.js +0 -163
- package/dist/stores/authStore.js.map +0 -1
- package/dist/stores/suggestionStore.d.ts +0 -36
- package/dist/stores/suggestionStore.d.ts.map +0 -1
- package/dist/stores/suggestionStore.js +0 -187
- package/dist/stores/suggestionStore.js.map +0 -1
- package/dist/stores/tabStore.d.ts +0 -30
- package/dist/stores/tabStore.d.ts.map +0 -1
- package/dist/stores/tabStore.js +0 -252
- package/dist/stores/tabStore.js.map +0 -1
- package/dist/stores/xenoChatStore.d.ts +0 -88
- package/dist/stores/xenoChatStore.d.ts.map +0 -1
- package/dist/stores/xenoChatStore.js +0 -583
- package/dist/stores/xenoChatStore.js.map +0 -1
- package/dist/types/agentEditor.d.ts +0 -40
- package/dist/types/agentEditor.d.ts.map +0 -1
- package/dist/types/agentEditor.js +0 -2
- package/dist/types/agentEditor.js.map +0 -1
- package/dist/types/agentRuntimeProvider.d.ts +0 -2
- package/dist/types/agentRuntimeProvider.d.ts.map +0 -1
- package/dist/types/agentRuntimeProvider.js +0 -2
- package/dist/types/agentRuntimeProvider.js.map +0 -1
- package/dist/utils/acpExecutionAuthority.d.ts +0 -26
- package/dist/utils/acpExecutionAuthority.d.ts.map +0 -1
- package/dist/utils/acpExecutionAuthority.js +0 -46
- package/dist/utils/acpExecutionAuthority.js.map +0 -1
- package/dist/utils/advertisedReasoning.d.ts +0 -25
- package/dist/utils/advertisedReasoning.d.ts.map +0 -1
- package/dist/utils/advertisedReasoning.js +0 -62
- package/dist/utils/advertisedReasoning.js.map +0 -1
- package/dist/utils/agentAttachedContextPrompt.d.ts +0 -2
- package/dist/utils/agentAttachedContextPrompt.d.ts.map +0 -1
- package/dist/utils/agentAttachedContextPrompt.js +0 -2
- package/dist/utils/agentAttachedContextPrompt.js.map +0 -1
- package/dist/utils/agentModelContext.d.ts +0 -2
- package/dist/utils/agentModelContext.d.ts.map +0 -1
- package/dist/utils/agentModelContext.js +0 -2
- package/dist/utils/agentModelContext.js.map +0 -1
- package/dist/utils/agentReasoningEffort.d.ts +0 -3
- package/dist/utils/agentReasoningEffort.d.ts.map +0 -1
- package/dist/utils/agentReasoningEffort.js +0 -2
- package/dist/utils/agentReasoningEffort.js.map +0 -1
- package/dist/utils/agentRuntimeProvider.d.ts +0 -3
- package/dist/utils/agentRuntimeProvider.d.ts.map +0 -1
- package/dist/utils/agentRuntimeProvider.js +0 -2
- package/dist/utils/agentRuntimeProvider.js.map +0 -1
- package/dist/utils/clipboardCopy.d.ts +0 -4
- package/dist/utils/clipboardCopy.d.ts.map +0 -1
- package/dist/utils/clipboardCopy.js +0 -27
- package/dist/utils/clipboardCopy.js.map +0 -1
- package/dist/utils/cloudModels.d.ts +0 -3
- package/dist/utils/cloudModels.d.ts.map +0 -1
- package/dist/utils/cloudModels.js +0 -181
- package/dist/utils/cloudModels.js.map +0 -1
- package/dist/utils/conversationRuntime.d.ts +0 -3
- package/dist/utils/conversationRuntime.d.ts.map +0 -1
- package/dist/utils/conversationRuntime.js +0 -2
- package/dist/utils/conversationRuntime.js.map +0 -1
- package/dist/utils/fileCreateIntent.d.ts +0 -16
- package/dist/utils/fileCreateIntent.d.ts.map +0 -1
- package/dist/utils/fileCreateIntent.js +0 -123
- package/dist/utils/fileCreateIntent.js.map +0 -1
- package/dist/utils/legacyAgentRuntimeEvents.d.ts +0 -2
- package/dist/utils/legacyAgentRuntimeEvents.d.ts.map +0 -1
- package/dist/utils/legacyAgentRuntimeEvents.js +0 -2
- package/dist/utils/legacyAgentRuntimeEvents.js.map +0 -1
- package/dist/utils/markdownWindowsPaths.d.ts +0 -2
- package/dist/utils/markdownWindowsPaths.d.ts.map +0 -1
- package/dist/utils/markdownWindowsPaths.js +0 -2
- package/dist/utils/markdownWindowsPaths.js.map +0 -1
- package/dist/utils/modelAvailability.d.ts +0 -11
- package/dist/utils/modelAvailability.d.ts.map +0 -1
- package/dist/utils/modelAvailability.js +0 -10
- package/dist/utils/modelAvailability.js.map +0 -1
- package/dist/utils/providerAvailability.d.ts +0 -8
- package/dist/utils/providerAvailability.d.ts.map +0 -1
- package/dist/utils/providerAvailability.js +0 -13
- package/dist/utils/providerAvailability.js.map +0 -1
- package/dist/utils/providerCommandArgs.d.ts +0 -11
- package/dist/utils/providerCommandArgs.d.ts.map +0 -1
- package/dist/utils/providerCommandArgs.js +0 -18
- package/dist/utils/providerCommandArgs.js.map +0 -1
- package/dist/utils/workspaceSelectionContinuation.d.ts +0 -2
- package/dist/utils/workspaceSelectionContinuation.d.ts.map +0 -1
- package/dist/utils/workspaceSelectionContinuation.js +0 -2
- package/dist/utils/workspaceSelectionContinuation.js.map +0 -1
|
@@ -1,693 +0,0 @@
|
|
|
1
|
-
import type { ConversationEditorDiff, ConversationEditorState } from '../types/agentEditor.js';
|
|
2
|
-
import type { WorkbenchPanelTab } from '../components/agent/AgentWorkbenchPanel.js';
|
|
3
|
-
import type { HubConversationRunSnapshot, HubConversationRuntimeBinding } from '../types/agentRuntimeProvider.js';
|
|
4
|
-
import type { AgentSessionTabState } from '../sessionTabs.js';
|
|
5
|
-
import type { AgentSessionHostBindingV1, ProviderLaneProjectionV1, WebContextToolResultV1, WebJobProgressV1, AcpAvailableCommand, AcpMcpStatus, AcpNotification } from '@xenosystem/agent-interface-contract';
|
|
6
|
-
export interface ChatAttachment {
|
|
7
|
-
id: string;
|
|
8
|
-
name: string;
|
|
9
|
-
type: string;
|
|
10
|
-
dataUrl: string;
|
|
11
|
-
}
|
|
12
|
-
export interface PermissionRequestInfo {
|
|
13
|
-
permissionId: string;
|
|
14
|
-
toolName: string;
|
|
15
|
-
path: string;
|
|
16
|
-
directory: string;
|
|
17
|
-
browserOrigin?: string;
|
|
18
|
-
reason?: string;
|
|
19
|
-
/**
|
|
20
|
-
* The option id meaning "allow always", when the agent offered one (ACP).
|
|
21
|
-
* Its presence is what lets a surface offer a persist choice for a permission
|
|
22
|
-
* that names no directory — an ACP `execute` has no path, and gating the
|
|
23
|
-
* affordance on `directory` alone made policy rules uncreatable by a user.
|
|
24
|
-
*/
|
|
25
|
-
allowAlwaysOptionId?: string;
|
|
26
|
-
/** The option id meaning "always refuse", when the agent offered one (ACP). */
|
|
27
|
-
rejectAlwaysOptionId?: string;
|
|
28
|
-
status: 'pending' | 'granted' | 'denied' | 'cancelled';
|
|
29
|
-
}
|
|
30
|
-
export interface AskUserRequestInfo {
|
|
31
|
-
askUserId: string;
|
|
32
|
-
question: string;
|
|
33
|
-
options?: string[];
|
|
34
|
-
context?: string;
|
|
35
|
-
answer?: string;
|
|
36
|
-
selectedOption?: string;
|
|
37
|
-
status: 'pending' | 'answered' | 'cancelled';
|
|
38
|
-
}
|
|
39
|
-
export interface AgentRunCapabilities {
|
|
40
|
-
terminal?: boolean;
|
|
41
|
-
browser?: boolean;
|
|
42
|
-
fileRead?: boolean;
|
|
43
|
-
fileWrite?: boolean;
|
|
44
|
-
appLaunch?: boolean;
|
|
45
|
-
webSearch?: boolean;
|
|
46
|
-
codeExecution?: boolean;
|
|
47
|
-
imageGeneration?: boolean;
|
|
48
|
-
dataAnalysis?: boolean;
|
|
49
|
-
}
|
|
50
|
-
export type AgentPermissionProfileName = 'standard' | 'read-only' | 'edit-with-approval' | 'trusted-workspace' | 'plan';
|
|
51
|
-
export interface AgentApprovalRule {
|
|
52
|
-
id?: string;
|
|
53
|
-
surface: 'terminal' | 'browser';
|
|
54
|
-
action: 'TerminalWriteInput' | 'BrowserGoto' | 'BrowserClick' | 'BrowserType' | 'BrowserKey';
|
|
55
|
-
matcher: string;
|
|
56
|
-
command?: string;
|
|
57
|
-
browserOrigin?: string;
|
|
58
|
-
urlPattern?: string;
|
|
59
|
-
selector?: string;
|
|
60
|
-
key?: string;
|
|
61
|
-
label?: string;
|
|
62
|
-
createdAt?: number;
|
|
63
|
-
}
|
|
64
|
-
export type ToolCallCategory = 'file' | 'terminal' | 'search' | 'app' | 'workspace' | 'other';
|
|
65
|
-
export type ToolRiskLevel = 'none' | 'low' | 'medium' | 'high';
|
|
66
|
-
export type ToolCallOutcome = 'succeeded' | 'cancelled' | 'failed';
|
|
67
|
-
export interface ToolArtifact {
|
|
68
|
-
type: 'file' | 'directory' | 'command' | 'query' | 'app';
|
|
69
|
-
label: string;
|
|
70
|
-
value: string;
|
|
71
|
-
openInEditor?: boolean;
|
|
72
|
-
}
|
|
73
|
-
export interface ToolCallInfo {
|
|
74
|
-
id: string;
|
|
75
|
-
toolName: string;
|
|
76
|
-
params?: Record<string, unknown>;
|
|
77
|
-
result?: string;
|
|
78
|
-
success?: boolean;
|
|
79
|
-
status: 'running' | 'done';
|
|
80
|
-
outcome?: ToolCallOutcome;
|
|
81
|
-
permissionRequest?: PermissionRequestInfo;
|
|
82
|
-
askUserRequest?: AskUserRequestInfo;
|
|
83
|
-
startedAt?: number;
|
|
84
|
-
endedAt?: number;
|
|
85
|
-
durationMs?: number;
|
|
86
|
-
category?: ToolCallCategory;
|
|
87
|
-
riskLevel?: ToolRiskLevel;
|
|
88
|
-
summary?: string;
|
|
89
|
-
cwd?: string;
|
|
90
|
-
artifacts?: ToolArtifact[];
|
|
91
|
-
diff?: ConversationEditorDiff;
|
|
92
|
-
webContext?: WebContextToolResultV1;
|
|
93
|
-
/**
|
|
94
|
-
* Latest accepted observation of the durable web job this tool call is driving.
|
|
95
|
-
*
|
|
96
|
-
* Separate from `webContext`, which is terminal EVIDENCE and only ever arrives
|
|
97
|
-
* once. Progress is a live projection that changes while the tool runs, and a
|
|
98
|
-
* tool call may carry either, both, or — for every agent that reports no
|
|
99
|
-
* progress at all — neither. Absent is the pre-existing final-only behaviour
|
|
100
|
-
* and must stay indistinguishable from it.
|
|
101
|
-
*/
|
|
102
|
-
webJobProgress?: WebJobProgressV1;
|
|
103
|
-
}
|
|
104
|
-
export interface AssistantTextTurnSegment {
|
|
105
|
-
id: string;
|
|
106
|
-
kind: 'text';
|
|
107
|
-
createdAt: number;
|
|
108
|
-
text: string;
|
|
109
|
-
}
|
|
110
|
-
export interface AssistantToolTurnSegment {
|
|
111
|
-
id: string;
|
|
112
|
-
kind: 'tool_call';
|
|
113
|
-
createdAt: number;
|
|
114
|
-
toolCallId: string;
|
|
115
|
-
}
|
|
116
|
-
export type AssistantTurnSegment = AssistantTextTurnSegment | AssistantToolTurnSegment;
|
|
117
|
-
export type AssistantTurnStatus = 'cancelled' | 'interrupted';
|
|
118
|
-
export interface ChatMessage {
|
|
119
|
-
id: string;
|
|
120
|
-
role: 'user' | 'assistant';
|
|
121
|
-
content: string;
|
|
122
|
-
model?: string;
|
|
123
|
-
attachments?: ChatAttachment[];
|
|
124
|
-
showThinking?: boolean;
|
|
125
|
-
command?: string;
|
|
126
|
-
isCommandResult?: boolean;
|
|
127
|
-
thinking?: string;
|
|
128
|
-
timestamp: number;
|
|
129
|
-
isStreaming?: boolean;
|
|
130
|
-
isThinking?: boolean;
|
|
131
|
-
error?: string;
|
|
132
|
-
toolCalls?: ToolCallInfo[];
|
|
133
|
-
segments?: AssistantTurnSegment[];
|
|
134
|
-
hideToolbar?: boolean;
|
|
135
|
-
runtimeKind?: 'acp' | 'agent' | 'llm';
|
|
136
|
-
runtime?: HubConversationRuntimeBinding;
|
|
137
|
-
run?: HubConversationRunSnapshot;
|
|
138
|
-
deliveryState?: 'queued';
|
|
139
|
-
queuedTurnId?: string;
|
|
140
|
-
turnStatus?: AssistantTurnStatus;
|
|
141
|
-
}
|
|
142
|
-
export interface DeterministicFileCreateRequest {
|
|
143
|
-
path: string;
|
|
144
|
-
content: string;
|
|
145
|
-
selectedDirectory: string;
|
|
146
|
-
overwrite?: boolean;
|
|
147
|
-
}
|
|
148
|
-
export interface ConversationBranchRuntimeState {
|
|
149
|
-
events: AgentRuntimeEvent[];
|
|
150
|
-
runtimeTextProjectedRequestIds?: string[];
|
|
151
|
-
backgroundTasks?: AgentBackgroundTask[];
|
|
152
|
-
tokenUsage?: {
|
|
153
|
-
input: number;
|
|
154
|
-
output: number;
|
|
155
|
-
total: number;
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
export interface ConversationBranch {
|
|
159
|
-
messages: ChatMessage[];
|
|
160
|
-
timestamp: number;
|
|
161
|
-
source?: 'edit' | 'navigation' | 'legacy';
|
|
162
|
-
inactiveReason?: string;
|
|
163
|
-
tasks?: PlanTask[];
|
|
164
|
-
runtime?: ConversationBranchRuntimeState;
|
|
165
|
-
}
|
|
166
|
-
export interface ConversationCheckpointSnapshot {
|
|
167
|
-
schemaVersion?: number;
|
|
168
|
-
model?: string;
|
|
169
|
-
runtime?: HubConversationRuntimeBinding;
|
|
170
|
-
workspaceId?: string;
|
|
171
|
-
teamId?: string;
|
|
172
|
-
workspaceMode?: ConversationWorkspaceMode;
|
|
173
|
-
rootDirectory?: string;
|
|
174
|
-
grantedDirectories?: string[];
|
|
175
|
-
editorState?: ConversationEditorState;
|
|
176
|
-
sessionUi?: ConversationSessionUiState;
|
|
177
|
-
messages: ChatMessage[];
|
|
178
|
-
branches?: Record<string, ConversationBranch[]>;
|
|
179
|
-
activeBranch?: Record<string, number>;
|
|
180
|
-
materializedBranches?: Record<string, boolean>;
|
|
181
|
-
tasks?: PlanTask[];
|
|
182
|
-
}
|
|
183
|
-
export interface ConversationCheckpoint {
|
|
184
|
-
id: string;
|
|
185
|
-
name: string;
|
|
186
|
-
createdAt: number;
|
|
187
|
-
source: 'manual' | 'restore';
|
|
188
|
-
messageCount: number;
|
|
189
|
-
queuedCount: number;
|
|
190
|
-
editorTabCount: number;
|
|
191
|
-
snapshot: ConversationCheckpointSnapshot;
|
|
192
|
-
}
|
|
193
|
-
export interface ConversationTerminalEntry {
|
|
194
|
-
id: string;
|
|
195
|
-
command: string;
|
|
196
|
-
cwd: string;
|
|
197
|
-
stdout: string;
|
|
198
|
-
stderr: string;
|
|
199
|
-
exitCode: number | null;
|
|
200
|
-
error?: string | null;
|
|
201
|
-
startedAt: number;
|
|
202
|
-
endedAt: number;
|
|
203
|
-
durationMs: number;
|
|
204
|
-
success: boolean;
|
|
205
|
-
}
|
|
206
|
-
export interface AgentBackgroundTask {
|
|
207
|
-
taskId: string;
|
|
208
|
-
toolName: string;
|
|
209
|
-
command?: string;
|
|
210
|
-
status: 'running' | 'stopped' | 'completed' | 'failed' | 'unknown';
|
|
211
|
-
startedAt: number;
|
|
212
|
-
updatedAt: number;
|
|
213
|
-
lastOutput?: string;
|
|
214
|
-
outputOffset?: number;
|
|
215
|
-
totalSize?: number;
|
|
216
|
-
exitCode?: number | null;
|
|
217
|
-
}
|
|
218
|
-
export interface AgentRuntimeEvent {
|
|
219
|
-
id?: string;
|
|
220
|
-
sequence?: number;
|
|
221
|
-
requestId?: string;
|
|
222
|
-
conversationId?: string;
|
|
223
|
-
source?: string;
|
|
224
|
-
type: string;
|
|
225
|
-
timestamp?: string;
|
|
226
|
-
[key: string]: unknown;
|
|
227
|
-
}
|
|
228
|
-
export interface ConversationSessionUiState {
|
|
229
|
-
sessionTab?: AgentSessionTabState;
|
|
230
|
-
panelOpen?: boolean;
|
|
231
|
-
panelTab?: WorkbenchPanelTab;
|
|
232
|
-
selectedTraceMessageId?: string;
|
|
233
|
-
tasksCollapsed?: boolean;
|
|
234
|
-
terminalInput?: string;
|
|
235
|
-
terminalCwd?: string;
|
|
236
|
-
terminalHistory?: ConversationTerminalEntry[];
|
|
237
|
-
attachedCodeContextPacks?: Array<{
|
|
238
|
-
id: string;
|
|
239
|
-
name: string;
|
|
240
|
-
tokenEstimate: number;
|
|
241
|
-
attachedAt: number;
|
|
242
|
-
}>;
|
|
243
|
-
attachedCodeContextPrompt?: string;
|
|
244
|
-
sdkSessionId?: string;
|
|
245
|
-
sdkSessionDir?: string;
|
|
246
|
-
sdkSessionHistoryPath?: string;
|
|
247
|
-
coordinationSessionId?: string;
|
|
248
|
-
acpSessionId?: string;
|
|
249
|
-
acpAgentConfigId?: string;
|
|
250
|
-
acpAgentConfigFingerprint?: string;
|
|
251
|
-
acpWorkspaceFingerprint?: string;
|
|
252
|
-
hostBinding?: AgentSessionHostBindingV1;
|
|
253
|
-
activeLane?: ProviderLaneProjectionV1;
|
|
254
|
-
lanes?: ProviderLaneProjectionV1[];
|
|
255
|
-
acpLastCompletedRequestId?: string;
|
|
256
|
-
acpBindingUpdatedAt?: number;
|
|
257
|
-
subagentRunId?: string;
|
|
258
|
-
parentConversationId?: string;
|
|
259
|
-
parentAgentId?: string;
|
|
260
|
-
childAgentId?: string;
|
|
261
|
-
backgroundTasks?: AgentBackgroundTask[];
|
|
262
|
-
runtimeEvents?: AgentRuntimeEvent[];
|
|
263
|
-
runtimeTextProjectedRequestIds?: string[];
|
|
264
|
-
runtimeTokenUsage?: {
|
|
265
|
-
input: number;
|
|
266
|
-
output: number;
|
|
267
|
-
total: number;
|
|
268
|
-
};
|
|
269
|
-
lastRuntimeEventType?: string;
|
|
270
|
-
lastRuntimeEventAt?: number;
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Which capability profile a conversation is — the SAME WORDS as `launchMode`, deliberately.
|
|
274
|
-
*
|
|
275
|
-
* 🔴 These were `'workspace' | 'chat-only'` against a launch mode of `'chat' | 'agent'`, and one
|
|
276
|
-
* concept in two vocabularies cost a real defect: the scoped-backup projection builds an untyped
|
|
277
|
-
* record and wrote `workspaceMode: 'chat'` — a value in NEITHER union — so a RESTORED chat
|
|
278
|
-
* conversation failed `assertResumeLaunchScope` and refused to resume. With one vocabulary the
|
|
279
|
-
* guard is `scope.workspaceMode !== launchMode` and that class of mistake cannot be written.
|
|
280
|
-
*
|
|
281
|
-
* - `chat` — a private managed workspace, no local tool calls (the claude.ai / ChatGPT shape)
|
|
282
|
-
* - `agent` — an explicit local folder, the full development harness (the Claude Code shape)
|
|
283
|
-
*
|
|
284
|
-
* ⚠️ Persisted records predating 2026-09-07 still carry the old words. Read them through
|
|
285
|
-
* `normalizeWorkspaceMode`, never by comparing literals.
|
|
286
|
-
*/
|
|
287
|
-
export type ConversationWorkspaceMode = 'unselected' | 'chat' | 'agent';
|
|
288
|
-
export interface ConversationWorkspaceBindingInput {
|
|
289
|
-
workspaceMode?: ConversationWorkspaceMode;
|
|
290
|
-
rootDirectory?: string;
|
|
291
|
-
grantedDirectories?: string[];
|
|
292
|
-
inheritedDirectories?: string[];
|
|
293
|
-
hasMessages?: boolean;
|
|
294
|
-
}
|
|
295
|
-
export interface ResolvedConversationWorkspaceBinding {
|
|
296
|
-
mode: ConversationWorkspaceMode;
|
|
297
|
-
rootDirectory?: string;
|
|
298
|
-
allowedDirectories: string[];
|
|
299
|
-
legacyInferred: boolean;
|
|
300
|
-
}
|
|
301
|
-
export declare function resolveConversationWorkspaceBinding(input: ConversationWorkspaceBindingInput): ResolvedConversationWorkspaceBinding;
|
|
302
|
-
export declare function resetAcpContinuationForWorkspaceChange(sessionUi: ConversationSessionUiState | undefined): ConversationSessionUiState;
|
|
303
|
-
export type PlanTaskStatus = 'pending' | 'in_progress' | 'done' | 'blocked';
|
|
304
|
-
export type PlanTaskSource = 'assistant_message' | 'structured_tool' | 'acp_plan';
|
|
305
|
-
export interface PlanTask {
|
|
306
|
-
id: string;
|
|
307
|
-
sourceMessageId?: string;
|
|
308
|
-
sourceRequestId?: string;
|
|
309
|
-
text: string;
|
|
310
|
-
detail?: string;
|
|
311
|
-
status: PlanTaskStatus;
|
|
312
|
-
createdAt: number;
|
|
313
|
-
updatedAt: number;
|
|
314
|
-
completedAt?: number;
|
|
315
|
-
order?: number;
|
|
316
|
-
source?: PlanTaskSource;
|
|
317
|
-
}
|
|
318
|
-
interface AgentTaskEventPayload {
|
|
319
|
-
action: 'create' | 'update' | 'clear';
|
|
320
|
-
timestamp?: string | number;
|
|
321
|
-
task?: {
|
|
322
|
-
id: string;
|
|
323
|
-
text: string;
|
|
324
|
-
detail?: string;
|
|
325
|
-
status?: PlanTaskStatus;
|
|
326
|
-
order?: number;
|
|
327
|
-
};
|
|
328
|
-
taskId?: string;
|
|
329
|
-
patch?: {
|
|
330
|
-
text?: string;
|
|
331
|
-
detail?: string;
|
|
332
|
-
status?: PlanTaskStatus;
|
|
333
|
-
order?: number;
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
interface QueuedConversationTurnBase {
|
|
337
|
-
id: string;
|
|
338
|
-
agentId: string;
|
|
339
|
-
model: string;
|
|
340
|
-
content: string;
|
|
341
|
-
queuedAt: number;
|
|
342
|
-
userMessageId?: string;
|
|
343
|
-
runtime?: HubConversationRuntimeBinding;
|
|
344
|
-
}
|
|
345
|
-
export interface QueuedAgentConversationTurn extends QueuedConversationTurnBase {
|
|
346
|
-
kind?: 'agent';
|
|
347
|
-
systemPrompt?: string;
|
|
348
|
-
attachments: ChatAttachment[];
|
|
349
|
-
appendUserMessage: boolean;
|
|
350
|
-
enableThinking: boolean;
|
|
351
|
-
initialToolCalls?: ToolCallInfo[];
|
|
352
|
-
capabilities?: AgentRunCapabilities;
|
|
353
|
-
permissionProfile?: AgentPermissionProfileName;
|
|
354
|
-
allowedDirectories?: string[];
|
|
355
|
-
approvalRules?: AgentApprovalRule[];
|
|
356
|
-
acpAgentConfigId?: string;
|
|
357
|
-
acpProviderModel?: string;
|
|
358
|
-
}
|
|
359
|
-
export interface QueuedDeterministicFileCreateTurn extends QueuedConversationTurnBase {
|
|
360
|
-
kind: 'deterministic_file_create';
|
|
361
|
-
appendUserMessage: boolean;
|
|
362
|
-
allowedDirectories?: string[];
|
|
363
|
-
fileCreate: DeterministicFileCreateRequest;
|
|
364
|
-
}
|
|
365
|
-
export type QueuedConversationTurn = QueuedAgentConversationTurn | QueuedDeterministicFileCreateTurn;
|
|
366
|
-
export interface Conversation {
|
|
367
|
-
schemaVersion?: number;
|
|
368
|
-
id: string;
|
|
369
|
-
agentId: string;
|
|
370
|
-
model?: string;
|
|
371
|
-
runtime?: HubConversationRuntimeBinding;
|
|
372
|
-
workspaceId?: string;
|
|
373
|
-
teamId?: string;
|
|
374
|
-
workspaceMode?: ConversationWorkspaceMode;
|
|
375
|
-
rootDirectory?: string;
|
|
376
|
-
grantedDirectories?: string[];
|
|
377
|
-
editorState?: ConversationEditorState;
|
|
378
|
-
messages: ChatMessage[];
|
|
379
|
-
title: string;
|
|
380
|
-
createdAt: number;
|
|
381
|
-
lastMessageAt: number;
|
|
382
|
-
pendingTurns?: QueuedConversationTurn[];
|
|
383
|
-
checkpoints?: ConversationCheckpoint[];
|
|
384
|
-
tasks?: PlanTask[];
|
|
385
|
-
sessionUi?: ConversationSessionUiState;
|
|
386
|
-
branches?: Record<string, ConversationBranch[]>;
|
|
387
|
-
activeBranch?: Record<string, number>;
|
|
388
|
-
materializedBranches?: Record<string, boolean>;
|
|
389
|
-
activeNotifications?: Record<string, AcpNotification>;
|
|
390
|
-
availableCommands?: AcpAvailableCommand[];
|
|
391
|
-
mcpStatuses?: Record<string, AcpMcpStatus>;
|
|
392
|
-
dismissedNotificationKeys?: string[];
|
|
393
|
-
capabilitySnapshot?: unknown;
|
|
394
|
-
}
|
|
395
|
-
export interface ConversationRuntimeProjection {
|
|
396
|
-
conversationId?: string;
|
|
397
|
-
messages: ChatMessage[];
|
|
398
|
-
tasks: PlanTask[];
|
|
399
|
-
backgroundTasks: AgentBackgroundTask[];
|
|
400
|
-
runtimeEvents: AgentRuntimeEvent[];
|
|
401
|
-
checkpointEvents: AgentRuntimeEvent[];
|
|
402
|
-
permissionProfileEvents: AgentRuntimeEvent[];
|
|
403
|
-
eventCount: number;
|
|
404
|
-
source: 'runtime-events' | 'stored';
|
|
405
|
-
latestHubSession?: AgentRuntimeEvent;
|
|
406
|
-
latestSessionError?: AgentRuntimeEvent;
|
|
407
|
-
latestPermissionProfile?: AgentRuntimeEvent;
|
|
408
|
-
lastRuntimeEventType?: string;
|
|
409
|
-
lastRuntimeEventAt?: number;
|
|
410
|
-
}
|
|
411
|
-
export interface PreparedSubagentMainRun {
|
|
412
|
-
requestId: string;
|
|
413
|
-
userMessageId?: string;
|
|
414
|
-
messages: Array<{
|
|
415
|
-
role: 'user' | 'assistant';
|
|
416
|
-
content: string;
|
|
417
|
-
}>;
|
|
418
|
-
systemPrompt?: string;
|
|
419
|
-
allowedDirectories: string[];
|
|
420
|
-
}
|
|
421
|
-
export interface CloudRunStatusInfo {
|
|
422
|
-
requestId: string;
|
|
423
|
-
runId: string;
|
|
424
|
-
status?: string;
|
|
425
|
-
statusReason?: string | null;
|
|
426
|
-
creditsHeld?: number | null;
|
|
427
|
-
creditsSettled?: number | null;
|
|
428
|
-
url?: string;
|
|
429
|
-
}
|
|
430
|
-
interface AgentChatState {
|
|
431
|
-
conversations: Record<string, Conversation>;
|
|
432
|
-
/**
|
|
433
|
-
* 🔴 THE AUTHORITY for "is a turn running, and which one" — conversationId -> requestId.
|
|
434
|
-
*
|
|
435
|
-
* `activeRequestId` below is a single global slot and CANNOT represent two live turns:
|
|
436
|
-
* a second turn overwrites it, so completing the second frees the lock while the first is
|
|
437
|
-
* still streaming, and the first completing later matches nothing and frees nothing.
|
|
438
|
-
* That is measured, not assumed — `agentChatStore.concurrentTurns.test.ts`.
|
|
439
|
-
*
|
|
440
|
-
* So this map owns admission AND completion matching. `activeRequestId`/`activeConversationId`
|
|
441
|
-
* are retained as the FOREGROUND turn for the ~80 existing readers that mean "the turn the
|
|
442
|
-
* user is looking at"; they are no longer consulted to decide whether a new turn may start.
|
|
443
|
-
*/
|
|
444
|
-
activeTurnsByConversation: Record<string, string>;
|
|
445
|
-
activeRequestId: string | null;
|
|
446
|
-
activeConversationId: string | null;
|
|
447
|
-
persistenceNotice?: {
|
|
448
|
-
action: 'save' | 'load' | 'delete' | 'runtime-load' | 'recovery';
|
|
449
|
-
conversationId?: string;
|
|
450
|
-
message: string;
|
|
451
|
-
timestamp: number;
|
|
452
|
-
};
|
|
453
|
-
/** "Run in cloud" toggle; when true the next turn dispatches a HOSTED run. */
|
|
454
|
-
cloudRunEnabled: boolean;
|
|
455
|
-
/** Live hosted-run status/credit indicator, keyed by hub requestId. */
|
|
456
|
-
cloudRuns: Record<string, CloudRunStatusInfo>;
|
|
457
|
-
setCloudRunEnabled: (enabled: boolean) => void;
|
|
458
|
-
/** Active structured notifications (rate-limits, MCP auth warnings, etc.) keyed by conversationId -> notificationId */
|
|
459
|
-
activeNotifications: Record<string, Record<string, AcpNotification>>;
|
|
460
|
-
dismissNotification: (conversationId: string, notificationId: string) => void;
|
|
461
|
-
clearNotifications: (conversationId: string) => void;
|
|
462
|
-
/** Available slash commands and skills reported by the active agent/CLI, keyed by conversationId */
|
|
463
|
-
availableCommands: Record<string, AcpAvailableCommand[]>;
|
|
464
|
-
setAvailableCommands: (conversationId: string, commands: AcpAvailableCommand[]) => void;
|
|
465
|
-
/** MCP server status records keyed by conversationId -> serverName */
|
|
466
|
-
mcpStatuses: Record<string, Record<string, AcpMcpStatus>>;
|
|
467
|
-
getConversation: (conversationId: string) => Conversation | undefined;
|
|
468
|
-
getConversationRuntimeProjection: (conversationId: string) => ConversationRuntimeProjection | null;
|
|
469
|
-
createConversation: (agentId: string, conversationId?: string) => string;
|
|
470
|
-
prepareSubagentMainRun: (params: {
|
|
471
|
-
conversationId: string;
|
|
472
|
-
agentId: string;
|
|
473
|
-
model: string;
|
|
474
|
-
content: string;
|
|
475
|
-
requestId: string;
|
|
476
|
-
systemPrompt?: string;
|
|
477
|
-
appendUserMessage?: boolean;
|
|
478
|
-
attachments?: ChatAttachment[];
|
|
479
|
-
enableThinking?: boolean;
|
|
480
|
-
initialToolCalls?: ToolCallInfo[];
|
|
481
|
-
allowedDirectories?: string[];
|
|
482
|
-
}) => PreparedSubagentMainRun | null;
|
|
483
|
-
appendMessage: (conversationId: string, message: {
|
|
484
|
-
id?: string;
|
|
485
|
-
role: 'user' | 'assistant';
|
|
486
|
-
content: string;
|
|
487
|
-
model?: string;
|
|
488
|
-
attachments?: ChatAttachment[];
|
|
489
|
-
error?: string;
|
|
490
|
-
thinking?: string;
|
|
491
|
-
showThinking?: boolean;
|
|
492
|
-
isThinking?: boolean;
|
|
493
|
-
isStreaming?: boolean;
|
|
494
|
-
command?: string;
|
|
495
|
-
isCommandResult?: boolean;
|
|
496
|
-
hideToolbar?: boolean;
|
|
497
|
-
toolCalls?: ToolCallInfo[];
|
|
498
|
-
runtime?: HubConversationRuntimeBinding;
|
|
499
|
-
run?: HubConversationRunSnapshot;
|
|
500
|
-
}) => void;
|
|
501
|
-
renameConversation: (conversationId: string, title: string) => void;
|
|
502
|
-
setConversationModel: (conversationId: string, modelId: string) => void;
|
|
503
|
-
truncateToMessage: (conversationId: string, messageId: string) => Promise<boolean>;
|
|
504
|
-
switchBranch: (conversationId: string, messageId: string, direction: 'prev' | 'next') => void;
|
|
505
|
-
getBranchInfo: (conversationId: string, messageId: string) => {
|
|
506
|
-
current: number;
|
|
507
|
-
total: number;
|
|
508
|
-
} | null;
|
|
509
|
-
deleteConversation: (conversationId: string) => void;
|
|
510
|
-
sendMessage: (conversationId: string, agentId: string, model: string, content: string, systemPrompt?: string, options?: {
|
|
511
|
-
appendUserMessage?: boolean;
|
|
512
|
-
attachments?: ChatAttachment[];
|
|
513
|
-
enableThinking?: boolean;
|
|
514
|
-
initialToolCalls?: ToolCallInfo[];
|
|
515
|
-
capabilities?: AgentRunCapabilities;
|
|
516
|
-
permissionProfile?: AgentPermissionProfileName;
|
|
517
|
-
allowedDirectories?: string[];
|
|
518
|
-
approvalRules?: AgentApprovalRule[];
|
|
519
|
-
existingUserMessageId?: string;
|
|
520
|
-
queuedTurnId?: string;
|
|
521
|
-
acpAgentConfigId?: string;
|
|
522
|
-
acpProviderModel?: string;
|
|
523
|
-
runtime?: HubConversationRuntimeBinding;
|
|
524
|
-
}) => void;
|
|
525
|
-
sendAcpMessage: (conversationId: string, agentId: string, acpAgentConfigId: string, model: string, content: string, systemPrompt?: string, options?: {
|
|
526
|
-
appendUserMessage?: boolean;
|
|
527
|
-
attachments?: ChatAttachment[];
|
|
528
|
-
enableThinking?: boolean;
|
|
529
|
-
initialToolCalls?: ToolCallInfo[];
|
|
530
|
-
capabilities?: AgentRunCapabilities;
|
|
531
|
-
permissionProfile?: AgentPermissionProfileName;
|
|
532
|
-
allowedDirectories?: string[];
|
|
533
|
-
approvalRules?: AgentApprovalRule[];
|
|
534
|
-
existingUserMessageId?: string;
|
|
535
|
-
queuedTurnId?: string;
|
|
536
|
-
acpProviderModel?: string;
|
|
537
|
-
runtime?: HubConversationRuntimeBinding;
|
|
538
|
-
}) => void;
|
|
539
|
-
sendDeterministicFileCreate: (conversationId: string, agentId: string, model: string, content: string, fileCreate: DeterministicFileCreateRequest, options?: {
|
|
540
|
-
appendUserMessage?: boolean;
|
|
541
|
-
allowedDirectories?: string[];
|
|
542
|
-
existingUserMessageId?: string;
|
|
543
|
-
queuedTurnId?: string;
|
|
544
|
-
}) => void;
|
|
545
|
-
appendChunk: (requestId: string, content: string, thinking: string) => void;
|
|
546
|
-
addToolCall: (requestId: string, toolCall: ToolCallInfo) => void;
|
|
547
|
-
updateToolCall: (requestId: string, toolCallId: string, update: Partial<ToolCallInfo>) => void;
|
|
548
|
-
appendRuntimeEvent: (requestId: string, event: AgentRuntimeEvent) => void;
|
|
549
|
-
setPermissionRequest: (requestId: string, toolName: string, permissionRequest: PermissionRequestInfo) => void;
|
|
550
|
-
resolvePermission: (requestId: string, permissionId: string, granted: boolean) => void;
|
|
551
|
-
setAskUserRequest: (requestId: string, askUserRequest: AskUserRequestInfo) => void;
|
|
552
|
-
resolveAskUser: (requestId: string, askUserId: string, answer: string, selectedOption?: string) => void;
|
|
553
|
-
cancelAskUser: (requestId: string, askUserId: string) => void;
|
|
554
|
-
grantConversationDirectory: (conversationOrRequestId: string, directory: string) => void;
|
|
555
|
-
updateConversation: (conversationId: string, updates: Partial<Conversation>) => void;
|
|
556
|
-
createCheckpoint: (conversationId: string, options?: {
|
|
557
|
-
name?: string;
|
|
558
|
-
source?: 'manual' | 'restore';
|
|
559
|
-
}) => {
|
|
560
|
-
success: boolean;
|
|
561
|
-
checkpointId?: string;
|
|
562
|
-
error?: string;
|
|
563
|
-
};
|
|
564
|
-
restoreCheckpoint: (conversationId: string, checkpointId: string) => {
|
|
565
|
-
success: boolean;
|
|
566
|
-
error?: string;
|
|
567
|
-
};
|
|
568
|
-
deleteCheckpoint: (conversationId: string, checkpointId: string) => void;
|
|
569
|
-
setTaskStatus: (conversationId: string, taskId: string, status: PlanTaskStatus) => void;
|
|
570
|
-
applyTaskEvent: (requestId: string, event: AgentTaskEventPayload) => void;
|
|
571
|
-
removeQueuedTurn: (conversationId: string, queuedTurnId: string) => void;
|
|
572
|
-
finalizeStream: (requestId: string) => void;
|
|
573
|
-
setStreamError: (requestId: string, error: string) => void;
|
|
574
|
-
resumeQueuedTurns: () => void;
|
|
575
|
-
/**
|
|
576
|
-
* Cancel the turn running IN `conversationId`.
|
|
577
|
-
*
|
|
578
|
-
* 🔴 The argument is not optional in spirit, only in signature. With concurrent turns the
|
|
579
|
-
* global `activeRequestId` names the FOREGROUND turn, so an argument-less abort pressed
|
|
580
|
-
* while viewing one conversation could cancel a different conversation's turn. Callers that
|
|
581
|
-
* know which conversation the Stop button belongs to must say so; the fallback exists only
|
|
582
|
-
* for legacy call sites and keeps the old single-turn behaviour.
|
|
583
|
-
*/
|
|
584
|
-
abort: (conversationId?: string) => void;
|
|
585
|
-
}
|
|
586
|
-
/** Resolve a live runtime event without requiring a renderer-created message. */
|
|
587
|
-
export declare function resolveConversationIdForRuntimeEvent(conversations: Record<string, Conversation>, requestId: string, eventConversationId?: string, preferredConversationId?: string | null): string | null;
|
|
588
|
-
/**
|
|
589
|
-
* The next queued turn to run: OLDEST first, across every conversation.
|
|
590
|
-
*
|
|
591
|
-
* 🔴 Exported for the same reason `projectConversationRuntimeEvents` is —
|
|
592
|
-
* it is a pure rule with a consequence, and it had no test. A queue of
|
|
593
|
-
* corrections run newest-first would apply a person's second thought before
|
|
594
|
-
* their first, which is worse than not queueing at all.
|
|
595
|
-
*/
|
|
596
|
-
export declare function findOldestQueuedTurn(conversations: Record<string, Conversation>): {
|
|
597
|
-
conversationId: string;
|
|
598
|
-
turn: QueuedConversationTurn;
|
|
599
|
-
} | null;
|
|
600
|
-
/**
|
|
601
|
-
* 🔴 THE CONCURRENCY CEILING, and it is not optional.
|
|
602
|
-
*
|
|
603
|
-
* The global turn lock this file used to hold was accidentally also a RESOURCE ceiling:
|
|
604
|
-
* exactly one provider process could run at a time. Making turns per-conversation without
|
|
605
|
-
* replacing that ceiling would let a user with fifteen conversations spawn fifteen agent
|
|
606
|
-
* child processes, each with a real model bill — a worse bug than the one being fixed, and
|
|
607
|
-
* one a two-conversation test would never show.
|
|
608
|
-
*
|
|
609
|
-
* So the model is: **one turn per conversation, N turns overall.** Anything beyond N queues
|
|
610
|
-
* exactly as it does today, which is why the queue machinery is preserved rather than
|
|
611
|
-
* deleted — it becomes the ceiling's overflow path.
|
|
612
|
-
*
|
|
613
|
-
* N is a resource decision, not a correctness one. Three is chosen to be plainly more than
|
|
614
|
-
* one (the reported bug) and plainly less than "unbounded"; raise it deliberately, with the
|
|
615
|
-
* cost of a concurrent provider process in mind.
|
|
616
|
-
*/
|
|
617
|
-
export declare const MAX_CONCURRENT_TURNS = 3;
|
|
618
|
-
/** The requestId currently running IN this conversation, or null. */
|
|
619
|
-
export declare function conversationActiveRequestId(activeTurnsByConversation: Record<string, string>, conversationId: string): string | null;
|
|
620
|
-
export declare function activeTurnCount(activeTurnsByConversation: Record<string, string>): number;
|
|
621
|
-
/**
|
|
622
|
-
* The admission decision for a new turn, and the ONLY place it is made.
|
|
623
|
-
*
|
|
624
|
-
* 🔴 All three reasons are conversation-aware or global-by-design; none of them is the old
|
|
625
|
-
* "is anything running anywhere" test:
|
|
626
|
-
*
|
|
627
|
-
* - `conversation_busy` — this conversation already has a live turn. One at a time per
|
|
628
|
-
* conversation is the actual invariant a user expects.
|
|
629
|
-
* - `conversation_queued` — this conversation already has queued work, so a new send must
|
|
630
|
-
* go behind it or messages would arrive out of order.
|
|
631
|
-
* - `ceiling` — N turns are already running elsewhere. Overflow queues.
|
|
632
|
-
*
|
|
633
|
-
* ⚠️ `conversation_queued` reads THIS conversation's `pendingTurns`, never
|
|
634
|
-
* `findOldestQueuedTurn`, which scans every conversation. That scan is what made a queued
|
|
635
|
-
* turn in A block a send in B, and fixing only the active-turn half would have left the
|
|
636
|
-
* symptom alive in a narrower form.
|
|
637
|
-
*/
|
|
638
|
-
export type TurnAdmission = {
|
|
639
|
-
admit: true;
|
|
640
|
-
} | {
|
|
641
|
-
admit: false;
|
|
642
|
-
reason: 'conversation_busy' | 'conversation_queued' | 'ceiling';
|
|
643
|
-
};
|
|
644
|
-
export declare function decideTurnAdmission(conversations: Record<string, Conversation>, activeTurnsByConversation: Record<string, string>, conversationId: string, maxConcurrentTurns?: number): TurnAdmission;
|
|
645
|
-
/**
|
|
646
|
-
* The oldest queued turn in a conversation that could actually run right now.
|
|
647
|
-
*
|
|
648
|
-
* The old drain took the globally oldest queued turn and ran it only when NOTHING was
|
|
649
|
-
* active. With per-conversation turns that starves every other conversation behind one
|
|
650
|
-
* long-running turn, so the candidate set is filtered by the same admission rule.
|
|
651
|
-
*/
|
|
652
|
-
/**
|
|
653
|
-
* 🔴 COMPLETION MATCHING, and this is the function the whole design rests on.
|
|
654
|
-
*
|
|
655
|
-
* It releases the slot held BY THIS requestId, wherever it is — never "the current slot".
|
|
656
|
-
* That distinction is the entire bug the global field had: with one scalar, completing the
|
|
657
|
-
* SECOND turn freed the lock while the FIRST was still streaming, and the first completing
|
|
658
|
-
* later matched nothing and freed nothing. Keyed by requestId, a late or out-of-order
|
|
659
|
-
* terminal event can only ever free its own turn, and a stale one frees nothing.
|
|
660
|
-
*
|
|
661
|
-
* Returns the SAME object when there is nothing to release, so an unrelated terminal event
|
|
662
|
-
* cannot invalidate referential equality and churn every subscriber.
|
|
663
|
-
*/
|
|
664
|
-
export declare function releaseTurnSlot(activeTurnsByConversation: Record<string, string>, requestId: string): Record<string, string>;
|
|
665
|
-
/**
|
|
666
|
-
* Release whatever slot a conversation holds, because the conversation itself is going away.
|
|
667
|
-
*
|
|
668
|
-
* ⚠️ Without this, deleting a conversation mid-turn leaks its slot FOREVER: the map entry
|
|
669
|
-
* survives, no terminal event can ever arrive for a conversation that no longer exists, and
|
|
670
|
-
* the ceiling silently tightens by one every time it happens until nothing may start at all.
|
|
671
|
-
* The old global lock had no equivalent failure because it was cleared by conversation
|
|
672
|
-
* identity on the same path.
|
|
673
|
-
*/
|
|
674
|
-
export declare function releaseConversationSlot(activeTurnsByConversation: Record<string, string>, conversationId: string): Record<string, string>;
|
|
675
|
-
export declare function findOldestAdmissibleQueuedTurn(conversations: Record<string, Conversation>, activeTurnsByConversation: Record<string, string>, maxConcurrentTurns?: number): {
|
|
676
|
-
conversationId: string;
|
|
677
|
-
turn: QueuedConversationTurn;
|
|
678
|
-
} | null;
|
|
679
|
-
interface RuntimeProjectionOptions {
|
|
680
|
-
textAuthority?: 'compatibility' | 'runtime';
|
|
681
|
-
activeRequestId?: string | null;
|
|
682
|
-
}
|
|
683
|
-
export declare function projectConversationRuntimeEvents(messages: ChatMessage[], runtimeEvents: AgentRuntimeEvent[], backgroundTasks?: AgentBackgroundTask[], tasks?: PlanTask[], options?: RuntimeProjectionOptions): {
|
|
684
|
-
messages: ChatMessage[];
|
|
685
|
-
backgroundTasks?: AgentBackgroundTask[];
|
|
686
|
-
tasks?: PlanTask[];
|
|
687
|
-
};
|
|
688
|
-
export declare function projectConversationRuntimeState(conversation?: Conversation | null): ConversationRuntimeProjection;
|
|
689
|
-
export declare const useAgentChatStore: import("zustand").UseBoundStore<import("zustand").StoreApi<AgentChatState>>;
|
|
690
|
-
export declare function setupAgentChatListeners(): () => void;
|
|
691
|
-
export declare function loadLocalAgentConversations(): Promise<void>;
|
|
692
|
-
export {};
|
|
693
|
-
//# sourceMappingURL=agentChatStore.d.ts.map
|