@xenosystem/agent-interface-ui 0.1.36 → 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,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plan one GUI composer submission for a provider-owned terminal writer.
|
|
3
|
-
* Multiline text uses bracketed paste so embedded newlines remain one prompt.
|
|
4
|
-
* Submit is deliberately a second PTY write: Codex and other native TUIs use
|
|
5
|
-
* input-burst detection, so text plus CR in one write can be classified as a
|
|
6
|
-
* paste and leave the prompt sitting in the native composer.
|
|
7
|
-
*/
|
|
8
|
-
export declare function planNativeTuiComposerInput(text: string): readonly [content: string, submit: '\r'];
|
|
9
|
-
export interface AgentComposerInputLockState {
|
|
10
|
-
workspaceUnselected: boolean;
|
|
11
|
-
externalInputLocked: boolean;
|
|
12
|
-
nativeTuiWriterAttached: boolean;
|
|
13
|
-
commandRunning: boolean;
|
|
14
|
-
acpRuntimeReadinessPending: boolean;
|
|
15
|
-
nonAcpModelNotReady: boolean;
|
|
16
|
-
cloudModelUnavailable: boolean;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* A provider-owned PTY is already a ready model/session boundary. Registry and
|
|
20
|
-
* model-catalog readiness are prerequisites for creating a structured turn,
|
|
21
|
-
* not for writing text to that retained writer. Keep workspace and concurrent
|
|
22
|
-
* command safety locks, but do not let stale catalog hydration disable the
|
|
23
|
-
* GUI half of an attached native session.
|
|
24
|
-
*/
|
|
25
|
-
export declare function isAgentComposerInputLocked(state: AgentComposerInputLockState): boolean;
|
|
26
|
-
interface NativeTuiWriterTab {
|
|
27
|
-
conversationId: string;
|
|
28
|
-
laneId?: string;
|
|
29
|
-
kind: string;
|
|
30
|
-
terminalId: string | null;
|
|
31
|
-
exited: boolean;
|
|
32
|
-
detached?: boolean;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Prefer the current lane binding. During session-bound reconciliation the
|
|
36
|
-
* Host can advance lane metadata before the renderer tab cache catches up;
|
|
37
|
-
* one unambiguous attached provider writer for the same conversation remains
|
|
38
|
-
* safe to use because the Host still enforces terminal ownership.
|
|
39
|
-
*/
|
|
40
|
-
export declare function resolveNativeTuiWriterTerminalId(tabs: NativeTuiWriterTab[], conversationId: string | null, laneId?: string): string | undefined;
|
|
41
|
-
export {};
|
|
42
|
-
//# sourceMappingURL=nativeTuiComposerInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nativeTuiComposerInput.d.ts","sourceRoot":"","sources":["../../../src/components/agent/nativeTuiComposerInput.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAMjG;AAED,MAAM,WAAW,2BAA2B;IAC1C,mBAAmB,EAAE,OAAO,CAAA;IAC5B,mBAAmB,EAAE,OAAO,CAAA;IAC5B,uBAAuB,EAAE,OAAO,CAAA;IAChC,cAAc,EAAE,OAAO,CAAA;IACvB,0BAA0B,EAAE,OAAO,CAAA;IACnC,mBAAmB,EAAE,OAAO,CAAA;IAC5B,qBAAqB,EAAE,OAAO,CAAA;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAOtF;AAED,UAAU,kBAAkB;IAC1B,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,kBAAkB,EAAE,EAC1B,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAYpB"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plan one GUI composer submission for a provider-owned terminal writer.
|
|
3
|
-
* Multiline text uses bracketed paste so embedded newlines remain one prompt.
|
|
4
|
-
* Submit is deliberately a second PTY write: Codex and other native TUIs use
|
|
5
|
-
* input-burst detection, so text plus CR in one write can be classified as a
|
|
6
|
-
* paste and leave the prompt sitting in the native composer.
|
|
7
|
-
*/
|
|
8
|
-
export function planNativeTuiComposerInput(text) {
|
|
9
|
-
const clean = text.replace(/\u0000/gu, '').replace(/\u001b/gu, '');
|
|
10
|
-
const content = clean.includes('\n')
|
|
11
|
-
? `\u001b[200~${clean}\u001b[201~`
|
|
12
|
-
: clean;
|
|
13
|
-
return [content, '\r'];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A provider-owned PTY is already a ready model/session boundary. Registry and
|
|
17
|
-
* model-catalog readiness are prerequisites for creating a structured turn,
|
|
18
|
-
* not for writing text to that retained writer. Keep workspace and concurrent
|
|
19
|
-
* command safety locks, but do not let stale catalog hydration disable the
|
|
20
|
-
* GUI half of an attached native session.
|
|
21
|
-
*/
|
|
22
|
-
export function isAgentComposerInputLocked(state) {
|
|
23
|
-
if (state.workspaceUnselected || state.commandRunning)
|
|
24
|
-
return true;
|
|
25
|
-
if (state.nativeTuiWriterAttached)
|
|
26
|
-
return false;
|
|
27
|
-
return state.externalInputLocked
|
|
28
|
-
|| state.acpRuntimeReadinessPending
|
|
29
|
-
|| state.nonAcpModelNotReady
|
|
30
|
-
|| state.cloudModelUnavailable;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Prefer the current lane binding. During session-bound reconciliation the
|
|
34
|
-
* Host can advance lane metadata before the renderer tab cache catches up;
|
|
35
|
-
* one unambiguous attached provider writer for the same conversation remains
|
|
36
|
-
* safe to use because the Host still enforces terminal ownership.
|
|
37
|
-
*/
|
|
38
|
-
export function resolveNativeTuiWriterTerminalId(tabs, conversationId, laneId) {
|
|
39
|
-
if (!conversationId)
|
|
40
|
-
return undefined;
|
|
41
|
-
const attached = tabs.filter((tab) => (tab.conversationId === conversationId
|
|
42
|
-
&& tab.kind === 'provider-session'
|
|
43
|
-
&& !tab.exited
|
|
44
|
-
&& !tab.detached
|
|
45
|
-
&& !!tab.terminalId));
|
|
46
|
-
const exact = laneId ? attached.find((tab) => tab.laneId === laneId) : undefined;
|
|
47
|
-
if (exact?.terminalId)
|
|
48
|
-
return exact.terminalId;
|
|
49
|
-
return attached.length === 1 ? attached[0]?.terminalId || undefined : undefined;
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=nativeTuiComposerInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nativeTuiComposerInput.js","sourceRoot":"","sources":["../../../src/components/agent/nativeTuiComposerInput.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACrD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;IAClE,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;QAClC,CAAC,CAAC,cAAc,KAAK,aAAa;QAClC,CAAC,CAAC,KAAK,CAAA;IACT,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACxB,CAAC;AAYD;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAAkC;IAC3E,IAAI,KAAK,CAAC,mBAAmB,IAAI,KAAK,CAAC,cAAc;QAAE,OAAO,IAAI,CAAA;IAClE,IAAI,KAAK,CAAC,uBAAuB;QAAE,OAAO,KAAK,CAAA;IAC/C,OAAO,KAAK,CAAC,mBAAmB;WAC3B,KAAK,CAAC,0BAA0B;WAChC,KAAK,CAAC,mBAAmB;WACzB,KAAK,CAAC,qBAAqB,CAAA;AAClC,CAAC;AAWD;;;;;GAKG;AACH,MAAM,UAAU,gCAAgC,CAC9C,IAA0B,EAC1B,cAA6B,EAC7B,MAAe;IAEf,IAAI,CAAC,cAAc;QAAE,OAAO,SAAS,CAAA;IACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACpC,GAAG,CAAC,cAAc,KAAK,cAAc;WAClC,GAAG,CAAC,IAAI,KAAK,kBAAkB;WAC/B,CAAC,GAAG,CAAC,MAAM;WACX,CAAC,GAAG,CAAC,QAAQ;WACb,CAAC,CAAC,GAAG,CAAC,UAAU,CACpB,CAAC,CAAA;IACF,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAChF,IAAI,KAAK,EAAE,UAAU;QAAE,OAAO,KAAK,CAAC,UAAU,CAAA;IAC9C,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;AACjF,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface ConfirmationPrompt {
|
|
3
|
-
id: number;
|
|
4
|
-
authority: string;
|
|
5
|
-
title: string;
|
|
6
|
-
description: string;
|
|
7
|
-
confirmLabel: string;
|
|
8
|
-
}
|
|
9
|
-
/** Consumes a confirmation exactly once and only in the authority incarnation that opened it. */
|
|
10
|
-
export declare class ConfirmationController<T extends ConfirmationPrompt> {
|
|
11
|
-
private sequence;
|
|
12
|
-
private pending;
|
|
13
|
-
begin(input: Omit<T, 'id'>): T;
|
|
14
|
-
confirm(authority: string, id: number): T | null;
|
|
15
|
-
cancel(id: number): boolean;
|
|
16
|
-
invalidate(): void;
|
|
17
|
-
}
|
|
18
|
-
interface InAppConfirmationDialogProps {
|
|
19
|
-
prompt: ConfirmationPrompt;
|
|
20
|
-
onCancel(): void;
|
|
21
|
-
onConfirm(): void;
|
|
22
|
-
}
|
|
23
|
-
export declare function InAppConfirmationDialog({ prompt, onCancel, onConfirm }: InAppConfirmationDialogProps): React.ReactPortal | null;
|
|
24
|
-
export {};
|
|
25
|
-
//# sourceMappingURL=InAppConfirmationDialog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InAppConfirmationDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/agent/settings/shared/InAppConfirmationDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgD,MAAM,OAAO,CAAA;AAIpE,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,iGAAiG;AACjG,qBAAa,sBAAsB,CAAC,CAAC,SAAS,kBAAkB;IAC9D,OAAO,CAAC,QAAQ,CAAI;IACpB,OAAO,CAAC,OAAO,CAAiB;IAChC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC;IAK9B,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI;IAMhD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAC3B,UAAU,IAAI,IAAI;CACnB;AAED,UAAU,4BAA4B;IACpC,MAAM,EAAE,kBAAkB,CAAA;IAC1B,QAAQ,IAAI,IAAI,CAAA;IAChB,SAAS,IAAI,IAAI,CAAA;CAClB;AAID,wBAAgB,uBAAuB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,4BAA4B,4BA6DpG"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useCallback, useEffect, useId, useRef } from 'react';
|
|
3
|
-
import { createPortal } from 'react-dom';
|
|
4
|
-
import { X } from 'lucide-react';
|
|
5
|
-
/** Consumes a confirmation exactly once and only in the authority incarnation that opened it. */
|
|
6
|
-
export class ConfirmationController {
|
|
7
|
-
sequence = 0;
|
|
8
|
-
pending = null;
|
|
9
|
-
begin(input) {
|
|
10
|
-
const prompt = Object.freeze({ ...input, id: ++this.sequence });
|
|
11
|
-
this.pending = prompt;
|
|
12
|
-
return prompt;
|
|
13
|
-
}
|
|
14
|
-
confirm(authority, id) {
|
|
15
|
-
const prompt = this.pending;
|
|
16
|
-
if (prompt?.id !== id)
|
|
17
|
-
return null;
|
|
18
|
-
this.pending = null;
|
|
19
|
-
return prompt?.authority === authority ? prompt : null;
|
|
20
|
-
}
|
|
21
|
-
cancel(id) { if (this.pending?.id !== id)
|
|
22
|
-
return false; this.pending = null; return true; }
|
|
23
|
-
invalidate() { this.pending = null; this.sequence++; }
|
|
24
|
-
}
|
|
25
|
-
const focusableSelector = 'button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])';
|
|
26
|
-
export function InAppConfirmationDialog({ prompt, onCancel, onConfirm }) {
|
|
27
|
-
const titleId = useId(), descriptionId = useId();
|
|
28
|
-
const overlayRef = useRef(null), dialogRef = useRef(null), cancelRef = useRef(null);
|
|
29
|
-
const settled = useRef(false);
|
|
30
|
-
const actions = useRef({ onCancel, onConfirm });
|
|
31
|
-
actions.current = { onCancel, onConfirm };
|
|
32
|
-
const cancel = useCallback(() => { if (settled.current)
|
|
33
|
-
return; settled.current = true; actions.current.onCancel(); }, []);
|
|
34
|
-
const confirm = useCallback(() => { if (settled.current)
|
|
35
|
-
return; settled.current = true; actions.current.onConfirm(); }, []);
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
38
|
-
const overflow = document.body.style.overflow;
|
|
39
|
-
const background = Array.from(document.body.children).filter((element) => element instanceof HTMLElement && element !== overlayRef.current)
|
|
40
|
-
.map(element => ({ element, inert: element.inert }));
|
|
41
|
-
for (const { element } of background)
|
|
42
|
-
element.inert = true;
|
|
43
|
-
document.body.style.overflow = 'hidden';
|
|
44
|
-
cancelRef.current?.focus();
|
|
45
|
-
const keydown = (event) => {
|
|
46
|
-
if (event.key === 'Escape') {
|
|
47
|
-
event.preventDefault();
|
|
48
|
-
event.stopImmediatePropagation();
|
|
49
|
-
cancel();
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
if (event.key !== 'Tab')
|
|
53
|
-
return;
|
|
54
|
-
const controls = Array.from(dialogRef.current?.querySelectorAll(focusableSelector) || []);
|
|
55
|
-
if (controls.length === 0) {
|
|
56
|
-
event.preventDefault();
|
|
57
|
-
dialogRef.current?.focus();
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const first = controls[0], last = controls[controls.length - 1];
|
|
61
|
-
if (event.shiftKey && document.activeElement === first) {
|
|
62
|
-
event.preventDefault();
|
|
63
|
-
last.focus();
|
|
64
|
-
}
|
|
65
|
-
else if (!event.shiftKey && document.activeElement === last) {
|
|
66
|
-
event.preventDefault();
|
|
67
|
-
first.focus();
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
const focusin = (event) => { if (event.target instanceof Node && !dialogRef.current?.contains(event.target))
|
|
71
|
-
cancelRef.current?.focus(); };
|
|
72
|
-
document.addEventListener('keydown', keydown, true);
|
|
73
|
-
document.addEventListener('focusin', focusin);
|
|
74
|
-
return () => {
|
|
75
|
-
document.removeEventListener('keydown', keydown, true);
|
|
76
|
-
document.removeEventListener('focusin', focusin);
|
|
77
|
-
for (const { element, inert } of background)
|
|
78
|
-
element.inert = inert;
|
|
79
|
-
document.body.style.overflow = overflow;
|
|
80
|
-
if (opener?.isConnected)
|
|
81
|
-
opener.focus();
|
|
82
|
-
};
|
|
83
|
-
}, [cancel]);
|
|
84
|
-
if (typeof document === 'undefined')
|
|
85
|
-
return null;
|
|
86
|
-
return createPortal(_jsx("div", { ref: overlayRef, className: "fixed inset-0 z-[500] flex items-center justify-center bg-black/70", onMouseDown: event => { if (event.target === event.currentTarget)
|
|
87
|
-
cancel(); }, children: _jsxs("div", { ref: dialogRef, role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, "aria-describedby": descriptionId, tabIndex: -1, className: "flex w-[420px] max-w-[calc(100vw-32px)] flex-col overflow-hidden rounded-md border border-white/[0.10] bg-[#111115] text-white", children: [_jsxs("div", { className: "flex h-[34px] items-center justify-between gap-2 border-b border-white/[0.05] px-3", children: [_jsx("h2", { id: titleId, className: "truncate text-[11px] font-medium uppercase tracking-[0.08em] text-white/80", children: prompt.title }), _jsx("button", { type: "button", onClick: cancel, "aria-label": "Cancel confirmation", className: "flex h-6 w-6 cursor-pointer items-center justify-center rounded-sm bg-white/[0.06] text-white/40 transition-colors hover:bg-white/[0.10] hover:text-white/70 focus-visible:outline focus-visible:outline-2 focus-visible:outline-white/25", children: _jsx(X, { className: "h-3.5 w-3.5", strokeWidth: 1.5 }) })] }), _jsx("div", { className: "px-3 py-3", children: _jsx("p", { id: descriptionId, className: "break-words text-[12px] leading-relaxed text-[#a8a8b1]", children: prompt.description }) }), _jsxs("div", { className: "flex h-8 items-center justify-end gap-2 border-t border-white/[0.05] px-3", children: [_jsx("button", { ref: cancelRef, type: "button", onClick: cancel, className: "h-7 cursor-pointer rounded-sm bg-white/[0.06] px-3 text-[11px] text-white/60 transition-colors hover:bg-white/[0.10] hover:text-white/80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-white/25", children: "Cancel" }), _jsx("button", { type: "button", onClick: confirm, className: "h-7 cursor-pointer rounded-sm border border-red-500/30 px-3 text-[11px] text-red-400/70 transition-colors hover:bg-red-500/10 hover:text-red-400 focus-visible:outline focus-visible:outline-2 focus-visible:outline-white/25", children: prompt.confirmLabel })] })] }) }), document.body);
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=InAppConfirmationDialog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InAppConfirmationDialog.js","sourceRoot":"","sources":["../../../../../src/components/agent/settings/shared/InAppConfirmationDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AAUhC,iGAAiG;AACjG,MAAM,OAAO,sBAAsB;IACzB,QAAQ,GAAG,CAAC,CAAA;IACZ,OAAO,GAAa,IAAI,CAAA;IAChC,KAAK,CAAC,KAAoB;QACxB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAM,CAAA;QACpE,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QACrB,OAAO,MAAM,CAAA;IACf,CAAC;IACD,OAAO,CAAC,SAAiB,EAAE,EAAU;QACnC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAA;QAC3B,IAAI,MAAM,EAAE,EAAE,KAAK,EAAE;YAAE,OAAO,IAAI,CAAA;QAClC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QACnB,OAAO,MAAM,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAA;IACxD,CAAC;IACD,MAAM,CAAC,EAAU,IAAa,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CA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IAAI,CAAC,CAAA;AACxB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export interface ToolCardDisplay {
|
|
2
|
-
eyebrow: string;
|
|
3
|
-
title: string;
|
|
4
|
-
}
|
|
5
|
-
export type ToolInteractionState = 'running' | 'awaiting_user' | 'succeeded' | 'cancelled' | 'failed';
|
|
6
|
-
export interface ToolCardInteractionInput {
|
|
7
|
-
toolName: string;
|
|
8
|
-
params?: Record<string, unknown>;
|
|
9
|
-
status: 'running' | 'done';
|
|
10
|
-
outcome?: 'succeeded' | 'cancelled' | 'failed';
|
|
11
|
-
success?: boolean;
|
|
12
|
-
permissionRequest?: {
|
|
13
|
-
status: 'pending' | 'granted' | 'denied' | 'cancelled';
|
|
14
|
-
};
|
|
15
|
-
askUserRequest?: {
|
|
16
|
-
status: 'pending' | 'answered' | 'cancelled';
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export declare function isCommandToolCall(toolCall: Pick<ToolCardInteractionInput, 'toolName' | 'params'>): boolean;
|
|
20
|
-
export declare function commandPreviewText(value: string): string;
|
|
21
|
-
export declare function compactCommandPreview(value: string, maxCharacters?: number): string;
|
|
22
|
-
export declare function deriveToolInteractionState(toolCall: ToolCardInteractionInput): ToolInteractionState;
|
|
23
|
-
export declare function hideDuplicateToolTitle(display: ToolCardDisplay): ToolCardDisplay;
|
|
24
|
-
//# sourceMappingURL=toolCardDisplay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toolCardDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/agent/toolCardDisplay.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,eAAe,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAA;AAErG,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAA;IAC1B,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAA;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iBAAiB,CAAC,EAAE;QAClB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAA;KACvD,CAAA;IACD,cAAc,CAAC,EAAE;QACf,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,CAAA;KAC7C,CAAA;CACF;AAYD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,wBAAwB,EAAE,UAAU,GAAG,QAAQ,CAAC,GAAG,OAAO,CAG1G;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA6BxD;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,SAAM,GAAG,MAAM,CAIhF;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,wBAAwB,GAAG,oBAAoB,CAwBnG;AAUD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,CAMhF"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
const COMMAND_TOOL_NAMES = new Set([
|
|
2
|
-
'bash',
|
|
3
|
-
'run_command',
|
|
4
|
-
'runcommand',
|
|
5
|
-
'shell',
|
|
6
|
-
'shell_command',
|
|
7
|
-
'shellcommand',
|
|
8
|
-
'terminal',
|
|
9
|
-
]);
|
|
10
|
-
export function isCommandToolCall(toolCall) {
|
|
11
|
-
if (COMMAND_TOOL_NAMES.has((toolCall.toolName || '').trim().toLowerCase()))
|
|
12
|
-
return true;
|
|
13
|
-
return typeof toolCall.params?.command === 'string' && toolCall.params.command.trim().length > 0;
|
|
14
|
-
}
|
|
15
|
-
export function commandPreviewText(value) {
|
|
16
|
-
let command = value.trim();
|
|
17
|
-
const powershellWrapper = /^(?:"[^"\r\n]*(?:powershell|pwsh)\.exe"|(?:powershell|pwsh)(?:\.exe)?)\s+(?:(?:-NoProfile|-NonInteractive|-NoLogo)\s+)*(?:-Command\s+)?/i;
|
|
18
|
-
const wrapped = powershellWrapper.test(command);
|
|
19
|
-
if (wrapped) {
|
|
20
|
-
command = command.replace(powershellWrapper, '').trim();
|
|
21
|
-
// Codex reports its Windows process argv here, not the logical command. Decode only this
|
|
22
|
-
// known wrapper so historical ACP events remain readable without rewriting stored history.
|
|
23
|
-
if (command.startsWith("'") || command.startsWith('"')) {
|
|
24
|
-
const wrapperQuote = command[0];
|
|
25
|
-
command = command.slice(1);
|
|
26
|
-
if (command.endsWith(wrapperQuote))
|
|
27
|
-
command = command.slice(0, -1);
|
|
28
|
-
}
|
|
29
|
-
command = command
|
|
30
|
-
.replace(/'"'"'/g, "'")
|
|
31
|
-
.replace(/'"'/g, "'")
|
|
32
|
-
.replace(/\\""'/g, '"')
|
|
33
|
-
.replace(/\\"/g, '"')
|
|
34
|
-
.replace(/"'(?=[!$`"])/g, '')
|
|
35
|
-
.replace(/\\\\/g, '\\');
|
|
36
|
-
}
|
|
37
|
-
command = command.trim().replace(/\s+/g, ' ');
|
|
38
|
-
const cmd = command.match(/^"[^"]*cmd\.exe"\s+\/d\s+\/c\s+(.+)$/i);
|
|
39
|
-
if (cmd?.[1])
|
|
40
|
-
command = cmd[1].trim();
|
|
41
|
-
return command;
|
|
42
|
-
}
|
|
43
|
-
export function compactCommandPreview(value, maxCharacters = 140) {
|
|
44
|
-
const command = commandPreviewText(value);
|
|
45
|
-
if (command.length <= maxCharacters)
|
|
46
|
-
return command;
|
|
47
|
-
return `${command.slice(0, Math.max(1, maxCharacters - 1)).trimEnd()}…`;
|
|
48
|
-
}
|
|
49
|
-
export function deriveToolInteractionState(toolCall) {
|
|
50
|
-
if (toolCall.permissionRequest?.status === 'pending'
|
|
51
|
-
|| toolCall.askUserRequest?.status === 'pending') {
|
|
52
|
-
return 'awaiting_user';
|
|
53
|
-
}
|
|
54
|
-
if (toolCall.status === 'running')
|
|
55
|
-
return 'running';
|
|
56
|
-
if (toolCall.outcome === 'succeeded')
|
|
57
|
-
return 'succeeded';
|
|
58
|
-
if (toolCall.outcome === 'failed')
|
|
59
|
-
return 'failed';
|
|
60
|
-
if (toolCall.outcome === 'cancelled')
|
|
61
|
-
return 'cancelled';
|
|
62
|
-
if (toolCall.permissionRequest?.status === 'cancelled'
|
|
63
|
-
|| toolCall.askUserRequest?.status === 'cancelled') {
|
|
64
|
-
return 'cancelled';
|
|
65
|
-
}
|
|
66
|
-
if (toolCall.success === false
|
|
67
|
-
|| toolCall.permissionRequest?.status === 'denied') {
|
|
68
|
-
return 'failed';
|
|
69
|
-
}
|
|
70
|
-
return 'succeeded';
|
|
71
|
-
}
|
|
72
|
-
function normalizeToolCardLabel(value) {
|
|
73
|
-
return value
|
|
74
|
-
.trim()
|
|
75
|
-
.replace(/\(\s*\)\s*$/, '')
|
|
76
|
-
.replace(/\s+/g, ' ')
|
|
77
|
-
.toLowerCase();
|
|
78
|
-
}
|
|
79
|
-
export function hideDuplicateToolTitle(display) {
|
|
80
|
-
if (normalizeToolCardLabel(display.eyebrow) !== normalizeToolCardLabel(display.title)) {
|
|
81
|
-
return display;
|
|
82
|
-
}
|
|
83
|
-
return { ...display, title: '' };
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=toolCardDisplay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toolCardDisplay.js","sourceRoot":"","sources":["../../../src/components/agent/toolCardDisplay.ts"],"names":[],"mappings":"AAqBA,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,MAAM;IACN,aAAa;IACb,YAAY;IACZ,OAAO;IACP,eAAe;IACf,cAAc;IACd,UAAU;CACX,CAAC,CAAA;AAEF,MAAM,UAAU,iBAAi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E,QAAQ,CAAC,iBAAiB,EAAE,MAAM,KAAK,WAAW;WAC/C,QAAQ,CAAC,cAAc,EAAE,MAAM,KAAK,WAAW,EAClD,CAAC;QACD,OAAO,WAAW,CAAA;IACpB,CAAC;IACD,IACE,QAAQ,CAAC,OAAO,KAAK,KAAK;WACvB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,KAAK,QAAQ,EAClD,CAAC;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;IACD,OAAO,WAAW,CAAA;AACpB,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAa;IAC3C,OAAO,KAAK;SACT,IAAI,EAAE;SACN,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;SAC1B,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,WAAW,EAAE,CAAA;AAClB,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,OAAwB;IAC7D,IAAI,sBAAsB,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,sBAAsB,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACtF,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,OAAO,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;AAClC,CAAC"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { WebJobProgressV1 } from '@xenosystem/agent-interface-contract';
|
|
2
|
-
/**
|
|
3
|
-
* The rendering decisions for one durable-web-job observation, as plain data.
|
|
4
|
-
*
|
|
5
|
-
* This is deliberately not inside the component. Every judgement that can be
|
|
6
|
-
* wrong — whether a percentage is honest, whether a Stop action would tell the
|
|
7
|
-
* truth, what a screen reader is told — is decided here, where it is testable
|
|
8
|
-
* without a DOM. The workspace collects `packages/**\/src/**\/*.test.ts` and has
|
|
9
|
-
* no React test environment, so logic left in JSX is logic nothing can gate.
|
|
10
|
-
*/
|
|
11
|
-
export type WebJobProgressTone = 'queued' | 'running' | 'succeeded' | 'partial' | 'failed' | 'cancelled';
|
|
12
|
-
export interface WebJobProgressView {
|
|
13
|
-
jobId: string;
|
|
14
|
-
tone: WebJobProgressTone;
|
|
15
|
-
stateLabel: string;
|
|
16
|
-
operationLabel: string;
|
|
17
|
-
/**
|
|
18
|
-
* Whole percent of known pages that have settled, or `null` when the job has
|
|
19
|
-
* not yet accounted for a single page.
|
|
20
|
-
*
|
|
21
|
-
* 🔴 `null` is not 0. A crawl that has discovered nothing and a crawl that has
|
|
22
|
-
* discovered 400 pages and finished none are different facts, and rendering
|
|
23
|
-
* both as "0%" invents a denominator the server never supplied. `null` renders
|
|
24
|
-
* as an indeterminate bar, which claims nothing.
|
|
25
|
-
*/
|
|
26
|
-
percent: number | null;
|
|
27
|
-
/** Short "12/40 pages" style summary, or a bare page count when nothing is known yet. */
|
|
28
|
-
countersText: string;
|
|
29
|
-
/** Everything the counters say, spelled out for assistive technology. */
|
|
30
|
-
valueText: string;
|
|
31
|
-
ariaLabel: string;
|
|
32
|
-
terminal: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* True when the tool call that owned this job has closed while the last
|
|
35
|
-
* observation was still non-terminal.
|
|
36
|
-
*
|
|
37
|
-
* 🔴 This is the ONE place the "running" label is allowed to become a lie, so
|
|
38
|
-
* it is handled here rather than by deleting the observation somewhere in the
|
|
39
|
-
* store. Nothing has watched the job since the tool call ended — after a
|
|
40
|
-
* reload, nothing in this process ever watched it — so the honest statement is
|
|
41
|
-
* what was LAST SEEN, not what is happening. Dropping the observation instead
|
|
42
|
-
* would have to be done identically on three separate store paths, and a rule
|
|
43
|
-
* enforced in three places is a rule that will hold in two.
|
|
44
|
-
*/
|
|
45
|
-
stale: boolean;
|
|
46
|
-
/** Server-supplied terminal reason, forwarded verbatim only when present. */
|
|
47
|
-
terminalReason?: string;
|
|
48
|
-
}
|
|
49
|
-
export declare function deriveWebJobProgressView(progress: WebJobProgressV1, toolCallStatus?: 'running' | 'done'): WebJobProgressView;
|
|
50
|
-
export interface WebJobStopAvailabilityInput {
|
|
51
|
-
progress: WebJobProgressV1;
|
|
52
|
-
/** Status of the tool call the job is running inside. */
|
|
53
|
-
toolCallStatus: 'running' | 'done';
|
|
54
|
-
/** Request id of the turn this tool call belongs to. */
|
|
55
|
-
requestId?: string | undefined;
|
|
56
|
-
/** Request id of the turn the host currently has in flight, if any. */
|
|
57
|
-
activeRequestId?: string | null | undefined;
|
|
58
|
-
/** Whether the composition actually exposes a cancellation path today. */
|
|
59
|
-
hostExposesCancellation: boolean;
|
|
60
|
-
}
|
|
61
|
-
export type WebJobStopUnavailableReason = 'job_terminal' | 'tool_call_finished' | 'turn_not_active' | 'host_exposes_no_cancellation';
|
|
62
|
-
export interface WebJobStopAvailability {
|
|
63
|
-
available: boolean;
|
|
64
|
-
reason?: WebJobStopUnavailableReason;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Decide whether a Stop control may be offered, and refuse to offer one that
|
|
68
|
-
* would not do what its label says.
|
|
69
|
-
*
|
|
70
|
-
* 🔴 Four conditions, and dropping any of them produces a lie rather than a bug.
|
|
71
|
-
* A settled job cannot be stopped. A closed tool call has no turn to interrupt.
|
|
72
|
-
* A turn that is not the one in flight is not the turn cancellation would reach —
|
|
73
|
-
* pressing Stop on an older card would cancel somebody else's work. And a
|
|
74
|
-
* composition that exposes no cancellation at all must show no control, because
|
|
75
|
-
* a button that silently does nothing is worse than an absent one.
|
|
76
|
-
*
|
|
77
|
-
* ⚠️ What this authorises is a TURN cancellation, which is the only cancellation
|
|
78
|
-
* this surface is allowed to reach: cancelling the durable job itself is a
|
|
79
|
-
* provider call, and the renderer may not make one. The label and title must say
|
|
80
|
-
* so — see `WEB_JOB_STOP_TITLE`.
|
|
81
|
-
*/
|
|
82
|
-
export declare function webJobStopAvailability(input: WebJobStopAvailabilityInput): WebJobStopAvailability;
|
|
83
|
-
export declare const WEB_JOB_STOP_LABEL = "Stop";
|
|
84
|
-
/**
|
|
85
|
-
* The exact wording matters. This stops the agent turn; it does not reach into
|
|
86
|
-
* the web service and cancel the job, and claiming otherwise would be the
|
|
87
|
-
* fabricated-success failure this repo forbids.
|
|
88
|
-
*/
|
|
89
|
-
export declare const WEB_JOB_STOP_TITLE = "Stop this agent turn. The web job may keep running on the server until it settles.";
|
|
90
|
-
//# sourceMappingURL=webJobProgressView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webJobProgressView.d.ts","sourceRoot":"","sources":["../../../src/components/agent/webJobProgressView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAE5E;;;;;;;;GAQG;AAEH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAA;AAExG,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,kBAAkB,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,CAAA;IACtB;;;;;;;;OAQG;IACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,yFAAyF;IACzF,YAAY,EAAE,MAAM,CAAA;IACpB,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB;;;;;;;;;;;OAWG;IACH,KAAK,EAAE,OAAO,CAAA;IACd,6EAA6E;IAC7E,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AA8BD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,gBAAgB,EAC1B,cAAc,GAAE,SAAS,GAAG,MAAkB,GAC7C,kBAAkB,CA6CpB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,yDAAyD;IACzD,cAAc,EAAE,SAAS,GAAG,MAAM,CAAA;IAClC,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,uEAAuE;IACvE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IAC3C,0EAA0E;IAC1E,uBAAuB,EAAE,OAAO,CAAA;CACjC;AAED,MAAM,MAAM,2BAA2B,GACnC,cAAc,GACd,oBAAoB,GACpB,iBAAiB,GACjB,8BAA8B,CAAA;AAElC,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,2BAA2B,CAAA;CACrC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,sBAAsB,CAQjG;AAED,eAAO,MAAM,kBAAkB,SAAS,CAAA;AAExC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,uFACuD,CAAA"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
const OPERATION_LABELS = {
|
|
2
|
-
scrape: 'Scrape',
|
|
3
|
-
'batch-scrape': 'Batch scrape',
|
|
4
|
-
map: 'Map',
|
|
5
|
-
crawl: 'Crawl',
|
|
6
|
-
render: 'Render',
|
|
7
|
-
extract: 'Extract',
|
|
8
|
-
};
|
|
9
|
-
const STATE_LABELS = {
|
|
10
|
-
queued: 'Queued',
|
|
11
|
-
running: 'Running',
|
|
12
|
-
completed: 'Completed',
|
|
13
|
-
partial: 'Partial',
|
|
14
|
-
failed: 'Failed',
|
|
15
|
-
cancelled: 'Cancelled',
|
|
16
|
-
};
|
|
17
|
-
const STATE_TONES = {
|
|
18
|
-
queued: 'queued',
|
|
19
|
-
running: 'running',
|
|
20
|
-
completed: 'succeeded',
|
|
21
|
-
partial: 'partial',
|
|
22
|
-
failed: 'failed',
|
|
23
|
-
cancelled: 'cancelled',
|
|
24
|
-
};
|
|
25
|
-
export function deriveWebJobProgressView(progress, toolCallStatus = 'running') {
|
|
26
|
-
const { counters } = progress;
|
|
27
|
-
const stale = !progress.terminal && toolCallStatus === 'done';
|
|
28
|
-
// `knownPages` is the producer's own sum and the contract validator has already
|
|
29
|
-
// refused any payload where it disagrees with its operands, so no division here
|
|
30
|
-
// can exceed 1 and none can divide by a number the counters do not support.
|
|
31
|
-
const settled = counters.completedPages + counters.failedPages + counters.excludedPages;
|
|
32
|
-
const percent = counters.knownPages > 0
|
|
33
|
-
? Math.max(0, Math.min(100, Math.round((settled / counters.knownPages) * 100)))
|
|
34
|
-
: null;
|
|
35
|
-
const countersText = counters.knownPages > 0
|
|
36
|
-
? `${settled}/${counters.knownPages} pages`
|
|
37
|
-
: 'no pages yet';
|
|
38
|
-
// Spoken as adjectives ("10 completed"), so no pluralisation is involved and a
|
|
39
|
-
// count of one cannot read as broken English in a screen reader.
|
|
40
|
-
const detail = [
|
|
41
|
-
`${counters.completedPages} completed`,
|
|
42
|
-
`${counters.activePages} active`,
|
|
43
|
-
`${counters.queuedPages} queued`,
|
|
44
|
-
];
|
|
45
|
-
if (counters.failedPages > 0)
|
|
46
|
-
detail.push(`${counters.failedPages} failed`);
|
|
47
|
-
if (counters.excludedPages > 0)
|
|
48
|
-
detail.push(`${counters.excludedPages} excluded`);
|
|
49
|
-
const operationLabel = OPERATION_LABELS[progress.operation];
|
|
50
|
-
const observedLabel = STATE_LABELS[progress.state];
|
|
51
|
-
const stateLabel = stale ? `Last seen ${observedLabel.toLowerCase()}` : observedLabel;
|
|
52
|
-
const valueText = `${stateLabel}. ${countersText}. ${detail.join(', ')}.`;
|
|
53
|
-
return {
|
|
54
|
-
jobId: progress.jobId,
|
|
55
|
-
// A stale row is never tinted as live. `queued` is the quietest tone and is
|
|
56
|
-
// the right one for "we are not watching this any more".
|
|
57
|
-
tone: stale ? 'queued' : STATE_TONES[progress.state],
|
|
58
|
-
stateLabel,
|
|
59
|
-
operationLabel,
|
|
60
|
-
stale,
|
|
61
|
-
percent,
|
|
62
|
-
countersText,
|
|
63
|
-
valueText,
|
|
64
|
-
ariaLabel: `Web ${operationLabel.toLowerCase()} job progress`,
|
|
65
|
-
terminal: progress.terminal,
|
|
66
|
-
...(progress.terminalReason ? { terminalReason: progress.terminalReason } : {}),
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Decide whether a Stop control may be offered, and refuse to offer one that
|
|
71
|
-
* would not do what its label says.
|
|
72
|
-
*
|
|
73
|
-
* 🔴 Four conditions, and dropping any of them produces a lie rather than a bug.
|
|
74
|
-
* A settled job cannot be stopped. A closed tool call has no turn to interrupt.
|
|
75
|
-
* A turn that is not the one in flight is not the turn cancellation would reach —
|
|
76
|
-
* pressing Stop on an older card would cancel somebody else's work. And a
|
|
77
|
-
* composition that exposes no cancellation at all must show no control, because
|
|
78
|
-
* a button that silently does nothing is worse than an absent one.
|
|
79
|
-
*
|
|
80
|
-
* ⚠️ What this authorises is a TURN cancellation, which is the only cancellation
|
|
81
|
-
* this surface is allowed to reach: cancelling the durable job itself is a
|
|
82
|
-
* provider call, and the renderer may not make one. The label and title must say
|
|
83
|
-
* so — see `WEB_JOB_STOP_TITLE`.
|
|
84
|
-
*/
|
|
85
|
-
export function webJobStopAvailability(input) {
|
|
86
|
-
if (input.progress.terminal)
|
|
87
|
-
return { available: false, reason: 'job_terminal' };
|
|
88
|
-
if (input.toolCallStatus !== 'running')
|
|
89
|
-
return { available: false, reason: 'tool_call_finished' };
|
|
90
|
-
if (!input.requestId || input.requestId !== input.activeRequestId) {
|
|
91
|
-
return { available: false, reason: 'turn_not_active' };
|
|
92
|
-
}
|
|
93
|
-
if (!input.hostExposesCancellation)
|
|
94
|
-
return { available: false, reason: 'host_exposes_no_cancellation' };
|
|
95
|
-
return { available: true };
|
|
96
|
-
}
|
|
97
|
-
export const WEB_JOB_STOP_LABEL = 'Stop';
|
|
98
|
-
/**
|
|
99
|
-
* The exact wording matters. This stops the agent turn; it does not reach into
|
|
100
|
-
* the web service and cancel the job, and claiming otherwise would be the
|
|
101
|
-
* fabricated-success failure this repo forbids.
|
|
102
|
-
*/
|
|
103
|
-
export const WEB_JOB_STOP_TITLE = 'Stop this agent turn. The web job may keep running on the server until it settles.';
|
|
104
|
-
//# sourceMappingURL=webJobProgressView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webJobProgressView.js","sourceRoot":"","sources":["../../../src/components/agent/webJobProgressView.ts"],"names":[],"mappings":"AAoDA,MAAM,gBAAgB,GAAkD;IACtE,MAAM,EAAE,QAAQ;IAChB,cAAc,EAAE,cAAc;IAC9B,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACnB,CAAA;AAED,MAAM,YAAY,GAA8C;IAC9D,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;CACvB,CAAA;AAED,MAAM,WAAW,GAA0D;IACzE,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;CACvB,CAAA;AAGD,MAAM,UAAU,wBAAwB,CACtC,QAA0B,EAC1B,iBAAqC,SAAS;IAE9C,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAA;IAC7B,MAAM,KAAK,GAAG,CAAC,QAAQ,CAAC,QAAQ,IAAI,cAAc,KAAK,MAAM,CAAA;IAC7D,gFAAgF;IAChF,gFAAgF;IAChF,4EAA4E;IAC5E,MAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,GAAG,QAAQ,CAAC,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAA;IACvF,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,GAAG,CAAC;QACrC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,G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;
|
|
5
|
-
}
|
|
6
|
-
export default function CodeBlock({ inline, className, children }: CodeBlockProps): import("react").JSX.Element;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=CodeBlock.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../src/components/ui/CodeBlock.tsx"],"names":[],"mappings":"AASA,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAwDD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,cAAc,+BAmFhF"}
|