@tutti-os/agent-gui 0.0.56 → 0.0.58
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/@-lined-14px-64O2KKB4.svg +3 -0
- package/dist/agent-conversation/index.d.ts +2 -2
- package/dist/agent-conversation/index.js +9 -8
- package/dist/agent-conversation/index.js.map +1 -1
- package/dist/agent-env/index.d.ts +285 -0
- package/dist/agent-env/index.js +360 -0
- package/dist/agent-env/index.js.map +1 -0
- package/dist/agent-message-center/index.js +11 -11
- package/dist/{agentGuiNodeTypes-DCnsaqJr.d.ts → agentGuiNodeTypes-BRU6P22B.d.ts} +2 -1
- package/dist/app/renderer/agentactivity.css +56 -36
- package/dist/app/renderer/assets/icons/@-lined-14px.svg +3 -0
- package/dist/{chunk-EVVIWZLX.js → chunk-2WUDORCV.js} +2 -2
- package/dist/{chunk-5PGMLZ4W.js → chunk-5SRRKWE4.js} +2 -2
- package/dist/{chunk-X4C4HD6E.js → chunk-BEFNWUOZ.js} +194 -159
- package/dist/chunk-BEFNWUOZ.js.map +1 -0
- package/dist/{chunk-PQYSB2WC.js → chunk-BT5WEZO5.js} +7 -7
- package/dist/{chunk-4URDQNBP.js → chunk-CEMXB7LA.js} +5 -5
- package/dist/{chunk-S6PCOX3S.js → chunk-HVU46DDA.js} +1 -1
- package/dist/chunk-HVU46DDA.js.map +1 -0
- package/dist/{chunk-54CMFCHF.js → chunk-IS6JUDDY.js} +39 -1
- package/dist/chunk-IS6JUDDY.js.map +1 -0
- package/dist/{chunk-VOXUYDQF.js → chunk-N756UO52.js} +11 -7
- package/dist/chunk-N756UO52.js.map +1 -0
- package/dist/{chunk-MXDPRBS6.js → chunk-NX6T3DDS.js} +3 -3
- package/dist/{chunk-752VTG4P.js → chunk-OFMORNBO.js} +5 -5
- package/dist/{chunk-SITURZG6.js → chunk-OLI2A3EM.js} +2 -2
- package/dist/chunk-PSLAWU25.js +145 -0
- package/dist/chunk-PSLAWU25.js.map +1 -0
- package/dist/{chunk-6QFURP4M.js → chunk-SLT5Q37C.js} +6 -6
- package/dist/{chunk-PQYMG6PQ.js → chunk-UCCUIUGK.js} +4 -4
- package/dist/context-mention-palette/index.js +7 -7
- package/dist/i18n/index.d.ts +38 -0
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +59 -4
- package/dist/index.js +802 -99
- package/dist/index.js.map +1 -1
- package/dist/queued-prompt-runtime.d.ts +2 -2
- package/dist/{types-B2m7UcBb.d.ts → types-BsHvTjIZ.d.ts} +8 -1
- package/dist/workbench/contribution.d.ts +1 -1
- package/dist/workbench/contribution.js +2 -2
- package/dist/workbench/index.d.ts +1 -1
- package/dist/workbench/index.js +14 -14
- package/dist/workbench/launch.d.ts +1 -1
- package/dist/workbench/providerCatalog.d.ts +1 -1
- package/dist/workbench/sessionTitle.d.ts +1 -1
- package/dist/workbench/sessionTitle.js +3 -3
- package/dist/workbench/state.d.ts +1 -1
- package/dist/workbench/types.d.ts +1 -1
- package/dist/workspace-agent-generated-files.js +3 -3
- package/package.json +19 -12
- package/dist/chunk-54CMFCHF.js.map +0 -1
- package/dist/chunk-S6PCOX3S.js.map +0 -1
- package/dist/chunk-VOXUYDQF.js.map +0 -1
- package/dist/chunk-X4C4HD6E.js.map +0 -1
- /package/dist/{chunk-EVVIWZLX.js.map → chunk-2WUDORCV.js.map} +0 -0
- /package/dist/{chunk-5PGMLZ4W.js.map → chunk-5SRRKWE4.js.map} +0 -0
- /package/dist/{chunk-PQYSB2WC.js.map → chunk-BT5WEZO5.js.map} +0 -0
- /package/dist/{chunk-4URDQNBP.js.map → chunk-CEMXB7LA.js.map} +0 -0
- /package/dist/{chunk-MXDPRBS6.js.map → chunk-NX6T3DDS.js.map} +0 -0
- /package/dist/{chunk-752VTG4P.js.map → chunk-OFMORNBO.js.map} +0 -0
- /package/dist/{chunk-SITURZG6.js.map → chunk-OLI2A3EM.js.map} +0 -0
- /package/dist/{chunk-6QFURP4M.js.map → chunk-SLT5Q37C.js.map} +0 -0
- /package/dist/{chunk-PQYMG6PQ.js.map → chunk-UCCUIUGK.js.map} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M4.15672 0.923957C5.52544 0.283494 7.07068 0.123903 8.54141 0.471076C10.012 0.818299 11.3224 1.652 12.2602 2.83688C13.198 4.02185 13.7082 5.48879 13.7082 6.99996V7.5833C13.7082 8.27949 13.4315 8.94697 12.9392 9.43925C12.4469 9.93152 11.7794 10.2083 11.0832 10.2083C10.3871 10.2083 9.71954 9.93152 9.22728 9.43925C9.20473 9.4167 9.18341 9.39303 9.16177 9.36976C8.59144 9.89033 7.83294 10.2083 6.9999 10.2083C5.22803 10.2082 3.79157 8.77185 3.79157 6.99996C3.79159 5.2281 5.22805 3.79168 6.9999 3.79163C7.57711 3.79163 8.11847 3.94468 8.58641 4.21147C8.74008 3.95987 9.01686 3.79166 9.33324 3.79163C9.81648 3.79163 10.2082 4.1834 10.2082 4.66663V7.5833C10.2082 7.81533 10.3005 8.03786 10.4646 8.20195C10.6287 8.36602 10.8512 8.45827 11.0832 8.4583C11.3153 8.4583 11.5378 8.36603 11.7019 8.20195C11.866 8.03786 11.9582 7.81536 11.9582 7.5833V6.99996C11.9582 5.88302 11.581 4.7985 10.8878 3.92265C10.1947 3.04698 9.22614 2.43098 8.13923 2.17436C7.05219 1.91777 5.91006 2.0354 4.89842 2.50875C3.88684 2.98212 3.06461 3.78336 2.56509 4.78227C2.06558 5.7813 1.91811 6.92003 2.14639 8.01339C2.37468 9.10674 2.96539 10.0913 3.8229 10.807C4.68041 11.5226 5.75467 11.9276 6.87116 11.9566C7.98766 11.9856 9.08115 11.6366 9.97468 10.9665C10.3612 10.6766 10.91 10.7549 11.2 11.1414C11.4899 11.528 11.4117 12.0768 11.0251 12.3667C9.81619 13.2734 8.33625 13.7453 6.82559 13.706C5.31501 13.6667 3.86197 13.1185 2.70181 12.1503C1.54166 11.182 0.742296 9.85035 0.433417 8.37114C0.12458 6.89196 0.32394 5.3517 0.99966 4.00013C1.67547 2.64852 2.78802 1.56444 4.15672 0.923957ZM6.9999 5.54163C6.19454 5.54168 5.54159 6.1946 5.54157 6.99996C5.54157 7.80535 6.19453 8.45825 6.9999 8.4583C7.80532 8.4583 8.45824 7.80538 8.45824 6.99996C8.45822 6.19457 7.80531 5.54163 6.9999 5.54163Z" fill="black"/>
|
|
3
|
+
</svg>
|
|
@@ -4,11 +4,11 @@ import { W as WorkspaceLinkAction } from '../workspaceLinkActions-Bjy_XfBm.js';
|
|
|
4
4
|
import { A as AgentMessageMarkdownWorkspaceAppIcon } from '../AgentMessageMarkdown-DeYPURtF.js';
|
|
5
5
|
import { c as AgentConversationVM, W as WorkspaceAgentSessionDetailViewModel } from '../agentConversationVM-Qbz9GBwR.js';
|
|
6
6
|
export { B as BuildWorkspaceAgentSessionDetailInput, d as buildWorkspaceAgentSessionDetailViewModel } from '../agentConversationVM-Qbz9GBwR.js';
|
|
7
|
-
import { d as AgentGUIProviderSkillOption } from '../agentGuiNodeTypes-
|
|
7
|
+
import { d as AgentGUIProviderSkillOption } from '../agentGuiNodeTypes-BRU6P22B.js';
|
|
8
8
|
export { W as WorkspaceAgentActivityCard, n as WorkspaceAgentActivitySession, q as WorkspaceAgentActivityTimelineItem } from '../workspaceAgentActivityListViewModel-B5viw5Da.js';
|
|
9
9
|
import '@tutti-os/workspace-issue-manager/core';
|
|
10
10
|
import '@tutti-os/agent-activity-core';
|
|
11
|
-
import '../types-
|
|
11
|
+
import '../types-BsHvTjIZ.js';
|
|
12
12
|
import '@tutti-os/workspace-user-project/contracts';
|
|
13
13
|
|
|
14
14
|
interface AgentConversationFlowProps {
|
|
@@ -6,19 +6,20 @@ import {
|
|
|
6
6
|
projectAgentConversationVM,
|
|
7
7
|
reconcileProjectedAgentConversationVM,
|
|
8
8
|
useProjectedAgentConversation
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-BEFNWUOZ.js";
|
|
10
|
+
import "../chunk-SLT5Q37C.js";
|
|
11
|
+
import "../chunk-PSLAWU25.js";
|
|
12
|
+
import "../chunk-NX6T3DDS.js";
|
|
12
13
|
import "../chunk-Y35GDLP2.js";
|
|
13
14
|
import "../chunk-LUGELG5V.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-HVU46DDA.js";
|
|
15
16
|
import "../chunk-TYGL25EL.js";
|
|
16
|
-
import "../chunk-PJP5BUU6.js";
|
|
17
|
-
import "../chunk-MTFSQWZ6.js";
|
|
18
17
|
import {
|
|
19
18
|
translate
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-5SRRKWE4.js";
|
|
20
|
+
import "../chunk-PJP5BUU6.js";
|
|
21
|
+
import "../chunk-MTFSQWZ6.js";
|
|
22
|
+
import "../chunk-IS6JUDDY.js";
|
|
22
23
|
|
|
23
24
|
// shared/WorkspaceAgentSessionDetail.tsx
|
|
24
25
|
import { useMemo } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../shared/WorkspaceAgentSessionDetail.tsx"],"sourcesContent":["import { useMemo, type JSX } from \"react\";\nimport type { WorkspaceLinkAction } from \"../contexts/workspace/presentation/renderer/actions/workspaceLinkActions\";\nimport { translate } from \"../i18n/index\";\nimport { AgentConversationFlow } from \"./agentConversation/components/AgentConversationFlow\";\nimport { useProjectedAgentConversation } from \"./agentConversation/projection/useProjectedAgentConversation\";\nimport type { WorkspaceAgentSessionDetailViewModel } from \"./workspaceAgentSessionDetailViewModel\";\n\ninterface WorkspaceAgentSessionDetailProps {\n detail: WorkspaceAgentSessionDetailViewModel;\n avoidGroupingEdits?: boolean;\n isLoading: boolean;\n timelineItemCount: number;\n onLinkAction?: (action: WorkspaceLinkAction) => void;\n toolCallsLabel: (count: number) => string;\n thinkingLabel?: string;\n loadingLabel?: string;\n rawTimelineJsonLabel?: string;\n showRawTimelineJson?: boolean;\n}\n\nexport function WorkspaceAgentSessionDetail({\n detail,\n avoidGroupingEdits = false,\n isLoading,\n timelineItemCount,\n onLinkAction,\n toolCallsLabel,\n thinkingLabel = translate(\"agentHost.workspaceAgentSessionDetailThinking\"),\n loadingLabel = translate(\"common.loading\"),\n rawTimelineJsonLabel,\n showRawTimelineJson = false\n}: WorkspaceAgentSessionDetailProps): JSX.Element {\n const conversation = useProjectedAgentConversation({\n detail,\n avoidGroupingEdits\n });\n const showLoadingSkeleton =\n detail.turns.length === 0 &&\n (isLoading ||\n detail.activity.status === \"waiting\" ||\n detail.activity.status === \"working\");\n const emptySummary =\n detail.activity.latestActivitySummary ||\n (timelineItemCount > 0\n ? translate(\"agentHost.workspaceAgentSessionDetailEmptyWithTimeline\")\n : translate(\"agentHost.workspaceAgentSessionDetailEmptyNoTimeline\"));\n const flowLabels = useMemo(\n () => ({\n thinkingLabel,\n toolCallsLabel,\n processing: translate(\"agentHost.agentGui.processing\"),\n turnSummary: translate(\"agentHost.agentGui.turnSummary\"),\n rawTimelineJson: rawTimelineJsonLabel\n }),\n [rawTimelineJsonLabel, thinkingLabel, toolCallsLabel]\n );\n const emptyState = useMemo(\n () => (\n <div className=\"workspace-agents-status-panel__detail-empty\">\n {emptySummary}\n </div>\n ),\n [emptySummary]\n );\n\n return (\n <div className=\"workspace-agents-status-panel__detail\">\n <AgentConversationFlow\n conversation={detail.turns.length > 0 ? conversation : null}\n isLoading={showLoadingSkeleton}\n loadingLabel={loadingLabel}\n empty={emptyState}\n onLinkAction={onLinkAction}\n showRawTimelineJson={showRawTimelineJson}\n labels={flowLabels}\n />\n </div>\n );\n}\n\nexport function WorkspaceAgentSessionDetailSkeleton({\n loading = true,\n loadingLabel = translate(\"common.loading\")\n}: {\n loading?: boolean;\n loadingLabel?: string;\n}): JSX.Element {\n const flowLabels = useMemo(\n () => ({\n thinkingLabel: translate(\"agentHost.workspaceAgentSessionDetailThinking\"),\n toolCallsLabel: (count: number) =>\n translate(\"agentHost.workspaceAgentSessionDetailToolCalls\", { count }),\n processing: translate(\"agentHost.agentGui.processing\"),\n turnSummary: translate(\"agentHost.agentGui.turnSummary\")\n }),\n []\n );\n\n if (!loading) {\n return <></>;\n }\n\n return (\n <div\n className=\"workspace-agents-status-panel__detail-skeleton\"\n data-testid=\"workspace-agents-status-panel-detail-skeleton\"\n role=\"status\"\n aria-busy=\"true\"\n aria-label={loadingLabel}\n >\n <AgentConversationFlow\n conversation={null}\n isLoading\n loadingLabel={loadingLabel}\n loadingTestId=\"workspace-agents-status-panel-detail-skeleton\"\n empty={null}\n labels={flowLabels}\n />\n </div>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../shared/WorkspaceAgentSessionDetail.tsx"],"sourcesContent":["import { useMemo, type JSX } from \"react\";\nimport type { WorkspaceLinkAction } from \"../contexts/workspace/presentation/renderer/actions/workspaceLinkActions\";\nimport { translate } from \"../i18n/index\";\nimport { AgentConversationFlow } from \"./agentConversation/components/AgentConversationFlow\";\nimport { useProjectedAgentConversation } from \"./agentConversation/projection/useProjectedAgentConversation\";\nimport type { WorkspaceAgentSessionDetailViewModel } from \"./workspaceAgentSessionDetailViewModel\";\n\ninterface WorkspaceAgentSessionDetailProps {\n detail: WorkspaceAgentSessionDetailViewModel;\n avoidGroupingEdits?: boolean;\n isLoading: boolean;\n timelineItemCount: number;\n onLinkAction?: (action: WorkspaceLinkAction) => void;\n toolCallsLabel: (count: number) => string;\n thinkingLabel?: string;\n loadingLabel?: string;\n rawTimelineJsonLabel?: string;\n showRawTimelineJson?: boolean;\n}\n\nexport function WorkspaceAgentSessionDetail({\n detail,\n avoidGroupingEdits = false,\n isLoading,\n timelineItemCount,\n onLinkAction,\n toolCallsLabel,\n thinkingLabel = translate(\"agentHost.workspaceAgentSessionDetailThinking\"),\n loadingLabel = translate(\"common.loading\"),\n rawTimelineJsonLabel,\n showRawTimelineJson = false\n}: WorkspaceAgentSessionDetailProps): JSX.Element {\n const conversation = useProjectedAgentConversation({\n detail,\n avoidGroupingEdits\n });\n const showLoadingSkeleton =\n detail.turns.length === 0 &&\n (isLoading ||\n detail.activity.status === \"waiting\" ||\n detail.activity.status === \"working\");\n const emptySummary =\n detail.activity.latestActivitySummary ||\n (timelineItemCount > 0\n ? translate(\"agentHost.workspaceAgentSessionDetailEmptyWithTimeline\")\n : translate(\"agentHost.workspaceAgentSessionDetailEmptyNoTimeline\"));\n const flowLabels = useMemo(\n () => ({\n thinkingLabel,\n toolCallsLabel,\n processing: translate(\"agentHost.agentGui.processing\"),\n turnSummary: translate(\"agentHost.agentGui.turnSummary\"),\n rawTimelineJson: rawTimelineJsonLabel\n }),\n [rawTimelineJsonLabel, thinkingLabel, toolCallsLabel]\n );\n const emptyState = useMemo(\n () => (\n <div className=\"workspace-agents-status-panel__detail-empty\">\n {emptySummary}\n </div>\n ),\n [emptySummary]\n );\n\n return (\n <div className=\"workspace-agents-status-panel__detail\">\n <AgentConversationFlow\n conversation={detail.turns.length > 0 ? conversation : null}\n isLoading={showLoadingSkeleton}\n loadingLabel={loadingLabel}\n empty={emptyState}\n onLinkAction={onLinkAction}\n showRawTimelineJson={showRawTimelineJson}\n labels={flowLabels}\n />\n </div>\n );\n}\n\nexport function WorkspaceAgentSessionDetailSkeleton({\n loading = true,\n loadingLabel = translate(\"common.loading\")\n}: {\n loading?: boolean;\n loadingLabel?: string;\n}): JSX.Element {\n const flowLabels = useMemo(\n () => ({\n thinkingLabel: translate(\"agentHost.workspaceAgentSessionDetailThinking\"),\n toolCallsLabel: (count: number) =>\n translate(\"agentHost.workspaceAgentSessionDetailToolCalls\", { count }),\n processing: translate(\"agentHost.agentGui.processing\"),\n turnSummary: translate(\"agentHost.agentGui.turnSummary\")\n }),\n []\n );\n\n if (!loading) {\n return <></>;\n }\n\n return (\n <div\n className=\"workspace-agents-status-panel__detail-skeleton\"\n data-testid=\"workspace-agents-status-panel-detail-skeleton\"\n role=\"status\"\n aria-busy=\"true\"\n aria-label={loadingLabel}\n >\n <AgentConversationFlow\n conversation={null}\n isLoading\n loadingLabel={loadingLabel}\n loadingTestId=\"workspace-agents-status-panel-detail-skeleton\"\n empty={null}\n labels={flowLabels}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAyB;AA0D5B,SAyCK,UAzCL;AAtCC,SAAS,4BAA4B;AAAA,EAC1C;AAAA,EACA,qBAAqB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB,UAAU,+CAA+C;AAAA,EACzE,eAAe,UAAU,gBAAgB;AAAA,EACzC;AAAA,EACA,sBAAsB;AACxB,GAAkD;AAChD,QAAM,eAAe,8BAA8B;AAAA,IACjD;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,sBACJ,OAAO,MAAM,WAAW,MACvB,aACC,OAAO,SAAS,WAAW,aAC3B,OAAO,SAAS,WAAW;AAC/B,QAAM,eACJ,OAAO,SAAS,0BACf,oBAAoB,IACjB,UAAU,wDAAwD,IAClE,UAAU,sDAAsD;AACtE,QAAM,aAAa;AAAA,IACjB,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,YAAY,UAAU,+BAA+B;AAAA,MACrD,aAAa,UAAU,gCAAgC;AAAA,MACvD,iBAAiB;AAAA,IACnB;AAAA,IACA,CAAC,sBAAsB,eAAe,cAAc;AAAA,EACtD;AACA,QAAM,aAAa;AAAA,IACjB,MACE,oBAAC,SAAI,WAAU,+CACZ,wBACH;AAAA,IAEF,CAAC,YAAY;AAAA,EACf;AAEA,SACE,oBAAC,SAAI,WAAU,yCACb;AAAA,IAAC;AAAA;AAAA,MACC,cAAc,OAAO,MAAM,SAAS,IAAI,eAAe;AAAA,MACvD,WAAW;AAAA,MACX;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA,QAAQ;AAAA;AAAA,EACV,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { WorkspaceAgentProvider, AgentProviderStatus } from '@tutti-os/client-tuttid-ts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Section the Agent Env panel (the片6 Setup Wizard / config panel) should scroll
|
|
5
|
+
* to / emphasise when opened via a deep-link. The error card (片5) maps a domain
|
|
6
|
+
* error code to one of these so the user lands on the relevant remediation.
|
|
7
|
+
*/
|
|
8
|
+
type AgentEnvPanelFocus = "detect" | "install" | "repair" | "upgrade" | "auth" | "network" | "registry";
|
|
9
|
+
interface AgentEnvPanelRequest {
|
|
10
|
+
open: boolean;
|
|
11
|
+
provider: string | null;
|
|
12
|
+
focus: AgentEnvPanelFocus | null;
|
|
13
|
+
/**
|
|
14
|
+
* Bumped on every openAgentEnvPanel() call. The host panel watches this to
|
|
15
|
+
* re-run detection even when it is already open (e.g. a second deep-link).
|
|
16
|
+
*/
|
|
17
|
+
requestSequence: number;
|
|
18
|
+
}
|
|
19
|
+
interface OpenAgentEnvPanelInput {
|
|
20
|
+
provider?: string | null;
|
|
21
|
+
focus?: AgentEnvPanelFocus | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Open the agent environment panel. Safe to call from anywhere in the agent-gui
|
|
25
|
+
* tree (rail footer entry, error-card deep-link). The host renders the actual
|
|
26
|
+
* panel and reacts to this singleton store.
|
|
27
|
+
*/
|
|
28
|
+
declare function openAgentEnvPanel(input?: OpenAgentEnvPanelInput): void;
|
|
29
|
+
declare function closeAgentEnvPanel(): void;
|
|
30
|
+
/** Imperative read, mainly for tests. Components should use the hook. */
|
|
31
|
+
declare function getAgentEnvPanelStore(): AgentEnvPanelRequest;
|
|
32
|
+
/** Reactive snapshot of the panel request for the host renderer. */
|
|
33
|
+
declare function useAgentEnvPanelRequest(): AgentEnvPanelRequest;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Run-failure codes actually emitted by the daemon runtime classifier
|
|
37
|
+
* (packages/agent/daemon/runtime/visible_error.go `visibleFailureCode`). These
|
|
38
|
+
* are the codes the conversation error card really receives — unlike the
|
|
39
|
+
* aspirational `CODEX_*` codes, which the run pipeline never produces.
|
|
40
|
+
*
|
|
41
|
+
* Keep this union aligned with the Go switch in `visibleFailureCode`.
|
|
42
|
+
*/
|
|
43
|
+
type AgentRunErrorCode = "auth_required" | "cli_not_found" | "cli_version_unsupported" | "network_error" | "runtime_unavailable" | "request_timed_out" | "provider_config_timeout" | "provider_stream_disconnected" | "provider_concurrency_limit" | "quota_or_rate_limit" | "process_exited" | "provider_error" | "unknown";
|
|
44
|
+
interface AgentErrorPresentation {
|
|
45
|
+
/**
|
|
46
|
+
* i18n key for the one human sentence shown in the card, or null to let the
|
|
47
|
+
* caller fall back to its phase-aware generic title.
|
|
48
|
+
*/
|
|
49
|
+
messageKey: string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Env-panel section the remediation button deep-links to, or null when the
|
|
52
|
+
* failure is transient/server-side and the wizard cannot fix it — in which
|
|
53
|
+
* case no call-to-action is shown (showing one would misrepresent reality).
|
|
54
|
+
*/
|
|
55
|
+
focus: AgentEnvPanelFocus | null;
|
|
56
|
+
/** i18n key for the remediation button. Only meaningful when `focus` is set. */
|
|
57
|
+
actionKey: string | null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Resolves the card presentation for a run-failure code. Returns null for codes
|
|
61
|
+
* outside the known vocabulary so the caller renders its plain generic card with
|
|
62
|
+
* no call-to-action.
|
|
63
|
+
*/
|
|
64
|
+
declare function resolveAgentErrorPresentation(code: string | null | undefined): AgentErrorPresentation | null;
|
|
65
|
+
/**
|
|
66
|
+
* Some providers (notably Claude Code) report an environment failure — e.g. a
|
|
67
|
+
* dropped login (401) — as a plain failed assistant message rather than a
|
|
68
|
+
* structured visibleError, so it never gets the remediation card. This recovers
|
|
69
|
+
* the env-fixable code from that message's text so the caller can still route the
|
|
70
|
+
* user to the wizard. Returns null when the text isn't a recognized env failure
|
|
71
|
+
* (so transient/unknown failures stay plain).
|
|
72
|
+
*/
|
|
73
|
+
declare function classifyFailedAgentMessage(body: string | null | undefined): AgentRunErrorCode | null;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Frontend contract for the Codex setup progress stream surfaced on the agent
|
|
77
|
+
* provider status snapshot as `activeAction` (片3 progress-flow contract). The
|
|
78
|
+
* backend slice that populates this field has its own source of truth; the
|
|
79
|
+
* generated `AgentProviderStatus` type does not (yet) declare it, so the panel
|
|
80
|
+
* reads it defensively and degrades to detection-only state when it is absent.
|
|
81
|
+
*/
|
|
82
|
+
type CodexSetupStepStatus = "pending" | "running" | "ok" | "error" | "skipped";
|
|
83
|
+
interface CodexSetupStep {
|
|
84
|
+
id: string;
|
|
85
|
+
label: string | null;
|
|
86
|
+
status: CodexSetupStepStatus;
|
|
87
|
+
detail: string | null;
|
|
88
|
+
}
|
|
89
|
+
type CodexSetupPhase = "detect" | "install" | "repair" | "verify" | "done" | "error";
|
|
90
|
+
interface CodexSetupActiveActionError {
|
|
91
|
+
code: string | null;
|
|
92
|
+
message: string | null;
|
|
93
|
+
}
|
|
94
|
+
interface CodexSetupActiveAction {
|
|
95
|
+
phase: CodexSetupPhase;
|
|
96
|
+
steps: CodexSetupStep[];
|
|
97
|
+
registry: string | null;
|
|
98
|
+
log: string[];
|
|
99
|
+
error: CodexSetupActiveActionError | null;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Defensively reads the `activeAction` field off an AgentProviderStatus-like
|
|
103
|
+
* object. Returns null when the field is missing or malformed, which the panel
|
|
104
|
+
* treats as "no live setup action in progress".
|
|
105
|
+
*/
|
|
106
|
+
declare function readCodexSetupActiveAction(status: unknown): CodexSetupActiveAction | null;
|
|
107
|
+
|
|
108
|
+
type AgentSetupStageId = "detect" | "network" | "install" | "adapter" | "login" | "ready";
|
|
109
|
+
type StageDetailToken = {
|
|
110
|
+
kind: "text";
|
|
111
|
+
text: string;
|
|
112
|
+
} | {
|
|
113
|
+
kind: "version-floor";
|
|
114
|
+
current: string;
|
|
115
|
+
required: string;
|
|
116
|
+
} | {
|
|
117
|
+
kind: "version-mismatch";
|
|
118
|
+
current: string;
|
|
119
|
+
required: string;
|
|
120
|
+
};
|
|
121
|
+
declare function reasonCodeIndicatesCliVersionUnsupported(reasonCode: string | null | undefined): boolean;
|
|
122
|
+
interface AgentSetupStage {
|
|
123
|
+
id: AgentSetupStageId;
|
|
124
|
+
label: string;
|
|
125
|
+
status: CodexSetupStepStatus;
|
|
126
|
+
detail: StageDetailToken | null;
|
|
127
|
+
/**
|
|
128
|
+
* Optional explicit problem token for a blocked stage that can't be inferred
|
|
129
|
+
* from `status` alone. Today only the install stage sets it — when the codex
|
|
130
|
+
* launcher is present but its platform subpackage is missing, the stage is
|
|
131
|
+
* `pending` (the daemon repairs it via the install action) yet needs a distinct
|
|
132
|
+
* "platform package missing" problem rather than the generic "install-missing".
|
|
133
|
+
*/
|
|
134
|
+
problem?: StageProblem;
|
|
135
|
+
authMethod?: string | null;
|
|
136
|
+
}
|
|
137
|
+
interface AgentSetupStageLabels {
|
|
138
|
+
detect: string;
|
|
139
|
+
network: string;
|
|
140
|
+
install: string;
|
|
141
|
+
adapter: string;
|
|
142
|
+
login: string;
|
|
143
|
+
ready: string;
|
|
144
|
+
}
|
|
145
|
+
interface DeriveAgentSetupStagesInput {
|
|
146
|
+
detected: boolean;
|
|
147
|
+
cliInstalled: boolean;
|
|
148
|
+
versionTooOld: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* The codex CLI launcher is resolved but its platform-specific optional
|
|
151
|
+
* dependency subpackage (e.g. @openai/codex-darwin-arm64) is missing — the
|
|
152
|
+
* binary spawns ENOENT. The daemon repairs this in place via the install
|
|
153
|
+
* action, so the install stage is `pending` (not `ok`) with a distinct
|
|
154
|
+
* "platform package missing" problem token.
|
|
155
|
+
*/
|
|
156
|
+
platformPackageIncomplete?: boolean;
|
|
157
|
+
adapterInstalled: boolean;
|
|
158
|
+
adapterVersionMismatch: boolean;
|
|
159
|
+
authenticated: boolean;
|
|
160
|
+
authRequired: boolean;
|
|
161
|
+
ready: boolean;
|
|
162
|
+
activePhase: CodexSetupPhase | null;
|
|
163
|
+
/**
|
|
164
|
+
* Whether the daemon-driven install action is in flight. This is the
|
|
165
|
+
* authoritative "installing" signal: the adapter (external-registry) installer
|
|
166
|
+
* emits no activeAction phase, so without this an in-progress adapter install
|
|
167
|
+
* would show no spinner.
|
|
168
|
+
*/
|
|
169
|
+
installActionPending: boolean;
|
|
170
|
+
loginPending: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Active connectivity probe verdict: true (reachable), false (offline), or
|
|
173
|
+
* null when the daemon reported no network info (older daemon / not probed) —
|
|
174
|
+
* null is treated as "don't block".
|
|
175
|
+
*/
|
|
176
|
+
networkReachable: boolean | null;
|
|
177
|
+
cliVersionDetail: StageDetailToken | null;
|
|
178
|
+
adapterDetail: StageDetailToken | null;
|
|
179
|
+
accountDetail: StageDetailToken | null;
|
|
180
|
+
authMethod: string | null;
|
|
181
|
+
networkDetail: StageDetailToken | null;
|
|
182
|
+
labels: AgentSetupStageLabels;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Maps primitive provider-status flags onto the fixed 5-stage track the wizard
|
|
186
|
+
* renders. Version verification folds into the install (CLI) stage (an
|
|
187
|
+
* unsupported version means install is `error`, not `ok`). The adapter stage
|
|
188
|
+
* covers the ACP adapter, which for some providers (e.g. claude-code) is a
|
|
189
|
+
* separate, slow npm install distinct from the CLI; for providers where the
|
|
190
|
+
* adapter is the CLI itself it simply tracks the CLI. Login `running` is driven
|
|
191
|
+
* by the caller's pending flag because login runs as a terminal action, not via
|
|
192
|
+
* the activeAction phase stream.
|
|
193
|
+
*/
|
|
194
|
+
declare function deriveAgentSetupStages(input: DeriveAgentSetupStagesInput): AgentSetupStage[];
|
|
195
|
+
/**
|
|
196
|
+
* Step-by-step reveal: even when prerequisites are already satisfied, the wizard
|
|
197
|
+
* walks a cursor down the track so each stage visibly "checks off" one at a time
|
|
198
|
+
* instead of all flashing complete at once.
|
|
199
|
+
*
|
|
200
|
+
* `revealIndex` is the cursor position. Stages before it show their real status
|
|
201
|
+
* (already revealed). The stage AT the cursor is shown as `running` when its
|
|
202
|
+
* real status is terminal-ok (the brief "working on it" moment before it checks
|
|
203
|
+
* off) and otherwise shows its real status (so a genuinely running install, an
|
|
204
|
+
* error, or a blocked prerequisite are honest). Stages after the cursor are
|
|
205
|
+
* dimmed to `pending`.
|
|
206
|
+
*/
|
|
207
|
+
declare function projectRevealedStages(realStages: AgentSetupStage[], revealIndex: number): AgentSetupStage[];
|
|
208
|
+
/**
|
|
209
|
+
* The reveal cursor advances past a stage only once that stage is really done
|
|
210
|
+
* (`ok`/`skipped`). It parks on a stage that is still `running` (a real install
|
|
211
|
+
* in progress), `error`, or `pending` (a blocked prerequisite) — so the
|
|
212
|
+
* animation never races ahead of reality.
|
|
213
|
+
*/
|
|
214
|
+
declare function shouldAdvanceReveal(realStages: AgentSetupStage[], revealIndex: number): boolean;
|
|
215
|
+
type StageActionId = "install" | "login" | "redetect";
|
|
216
|
+
/**
|
|
217
|
+
* The problem token a blocked stage represents. The UI maps this to "未xxx"
|
|
218
|
+
* copy; keeping it i18n-agnostic here lets the mapping stay tested without
|
|
219
|
+
* pulling translation strings into the pure flow module.
|
|
220
|
+
*/
|
|
221
|
+
type StageProblem = "network-unreachable" | "install-missing" | "install-outdated" | "install-platform-incomplete" | "adapter-missing" | "adapter-mismatch" | "login-missing";
|
|
222
|
+
interface StageRemediation {
|
|
223
|
+
actionId: StageActionId;
|
|
224
|
+
problem: StageProblem;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* For a stage the user must act on (idle `pending`/`error`, never `running` or
|
|
228
|
+
* `ok`), returns what is wrong and which action fixes it. `detect`/`ready` never
|
|
229
|
+
* carry their own remediation — they reflect prerequisites, not user actions.
|
|
230
|
+
*
|
|
231
|
+
* `error` means a version problem on the install/adapter stages (the only stages
|
|
232
|
+
* derive marks `error`); `pending` means the step simply has not run yet.
|
|
233
|
+
*/
|
|
234
|
+
declare function stageRemediation(stage: AgentSetupStage): StageRemediation | null;
|
|
235
|
+
interface ResolveWizardAutoStartInput {
|
|
236
|
+
focus: AgentEnvPanelFocus | null;
|
|
237
|
+
detected: boolean;
|
|
238
|
+
ready: boolean;
|
|
239
|
+
installPending: boolean;
|
|
240
|
+
loginPending: boolean;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Decides whether opening the wizard with a remediation focus should auto-start
|
|
244
|
+
* an action. Returns the action id to run, or null when nothing should run
|
|
245
|
+
* (non-remediation focus, detection not settled, already ready, or already
|
|
246
|
+
* pending). The caller is responsible for firing this at most once per open.
|
|
247
|
+
*/
|
|
248
|
+
declare function resolveWizardAutoStartAction(input: ResolveWizardAutoStartInput): "install" | "login" | null;
|
|
249
|
+
|
|
250
|
+
interface NetworkCheck {
|
|
251
|
+
kind: "registry" | "api" | "proxy";
|
|
252
|
+
reachable: boolean;
|
|
253
|
+
host: string | null;
|
|
254
|
+
configured?: boolean;
|
|
255
|
+
}
|
|
256
|
+
declare function deriveHasAnomaly(stages: AgentSetupStage[], activeActionError: CodexSetupActiveActionError | null): boolean;
|
|
257
|
+
interface AgentEnvWizardViewModelInput {
|
|
258
|
+
provider: WorkspaceAgentProvider;
|
|
259
|
+
status: AgentProviderStatus | null;
|
|
260
|
+
isLoading: boolean;
|
|
261
|
+
activeAction: CodexSetupActiveAction | null;
|
|
262
|
+
installActionPending: boolean;
|
|
263
|
+
loginPending: boolean;
|
|
264
|
+
revealIndex: number;
|
|
265
|
+
stageLabels: AgentSetupStageLabels;
|
|
266
|
+
}
|
|
267
|
+
interface AgentEnvWizardViewModel {
|
|
268
|
+
ready: boolean;
|
|
269
|
+
busy: boolean;
|
|
270
|
+
redetecting: boolean;
|
|
271
|
+
displayStages: AgentSetupStage[];
|
|
272
|
+
blockingStageId: AgentSetupStageId | null;
|
|
273
|
+
networkChecks: NetworkCheck[];
|
|
274
|
+
hasAnomaly: boolean;
|
|
275
|
+
activePhase: CodexSetupPhase | null;
|
|
276
|
+
log: string[];
|
|
277
|
+
registry: string | null;
|
|
278
|
+
error: CodexSetupActiveActionError | null;
|
|
279
|
+
manualCommand: string | null;
|
|
280
|
+
installPending: boolean;
|
|
281
|
+
loginPending: boolean;
|
|
282
|
+
}
|
|
283
|
+
declare function buildAgentEnvWizardViewModel(input: AgentEnvWizardViewModelInput): AgentEnvWizardViewModel;
|
|
284
|
+
|
|
285
|
+
export { type AgentEnvPanelFocus, type AgentEnvPanelRequest, type AgentEnvWizardViewModel, type AgentEnvWizardViewModelInput, type AgentErrorPresentation, type AgentRunErrorCode, type AgentSetupStage, type AgentSetupStageId, type AgentSetupStageLabels, type CodexSetupActiveAction, type CodexSetupActiveActionError, type CodexSetupPhase, type CodexSetupStep, type CodexSetupStepStatus, type DeriveAgentSetupStagesInput, type NetworkCheck, type OpenAgentEnvPanelInput, type ResolveWizardAutoStartInput, type StageActionId, type StageDetailToken, type StageProblem, type StageRemediation, buildAgentEnvWizardViewModel, classifyFailedAgentMessage, closeAgentEnvPanel, deriveAgentSetupStages, deriveHasAnomaly, getAgentEnvPanelStore, openAgentEnvPanel, projectRevealedStages, readCodexSetupActiveAction, reasonCodeIndicatesCliVersionUnsupported, resolveAgentErrorPresentation, resolveWizardAutoStartAction, shouldAdvanceReveal, stageRemediation, useAgentEnvPanelRequest };
|