@tutti-os/agent-gui 0.0.67 → 0.0.68

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.
Files changed (86) hide show
  1. package/dist/agent-conversation/index.d.ts +2 -2
  2. package/dist/agent-conversation/index.js +8 -8
  3. package/dist/agent-env/index.js +2 -1
  4. package/dist/agent-env/index.js.map +1 -1
  5. package/dist/agent-message-center/index.js +10 -10
  6. package/dist/{agentGuiNodeTypes-DNXndXhV.d.ts → agentGuiNodeTypes-BTHu_g4m.d.ts} +2 -1
  7. package/dist/app/renderer/agentactivity.css +66 -5
  8. package/dist/app/renderer/assets/icons/agents/opencode-rounded.png +0 -0
  9. package/dist/app/renderer/assets/icons/agents/provider-rail-opencode-colorful.png +0 -0
  10. package/dist/{chunk-MA254MXR.js → chunk-3QPN2Y7R.js} +13 -1
  11. package/dist/chunk-3QPN2Y7R.js.map +1 -0
  12. package/dist/{chunk-OEJQJP65.js → chunk-4I2VCAMW.js} +14 -1
  13. package/dist/chunk-4I2VCAMW.js.map +1 -0
  14. package/dist/{chunk-IL2ORY23.js → chunk-4US2YHBY.js} +3 -1
  15. package/dist/chunk-4US2YHBY.js.map +1 -0
  16. package/dist/{chunk-YU3XLPLC.js → chunk-A2KZVRUO.js} +2 -2
  17. package/dist/{chunk-KS4ULVGM.js → chunk-AIR6A4NP.js} +2 -2
  18. package/dist/{chunk-NCAVJEHI.js → chunk-ATEZXUHK.js} +1 -1
  19. package/dist/chunk-ATEZXUHK.js.map +1 -0
  20. package/dist/{chunk-RNFP7CUO.js → chunk-BHNJN2TR.js} +5 -2
  21. package/dist/chunk-BHNJN2TR.js.map +1 -0
  22. package/dist/{chunk-JGU2VMDA.js → chunk-C2M2ELXF.js} +3 -3
  23. package/dist/{chunk-ZABN3POD.js → chunk-D22A3KGQ.js} +6 -2
  24. package/dist/chunk-D22A3KGQ.js.map +1 -0
  25. package/dist/{chunk-QZYGCZNQ.js → chunk-DYX6466P.js} +4 -4
  26. package/dist/{chunk-XBR7D7X2.js → chunk-GOEL3BO7.js} +2 -2
  27. package/dist/{chunk-YYAP6IK7.js → chunk-GXHZNIWT.js} +3 -3
  28. package/dist/{chunk-PFKY5W76.js → chunk-J335PQ5H.js} +6 -6
  29. package/dist/{chunk-CTYXJGSW.js → chunk-KJLSZETD.js} +3 -3
  30. package/dist/{chunk-JWWHS34V.js → chunk-LQRD4X6R.js} +12 -3
  31. package/dist/chunk-LQRD4X6R.js.map +1 -0
  32. package/dist/{chunk-VIJQ5C33.js → chunk-QGKK6FHC.js} +5 -5
  33. package/dist/{chunk-UAXKJNM2.js → chunk-TB7PKP6F.js} +74 -24
  34. package/dist/chunk-TB7PKP6F.js.map +1 -0
  35. package/dist/{chunk-DP2X4J2D.js → chunk-UAAXRSW2.js} +3 -3
  36. package/dist/{chunk-DQTBWOIK.js → chunk-VRV6GBF5.js} +9 -4
  37. package/dist/chunk-VRV6GBF5.js.map +1 -0
  38. package/dist/{chunk-SKWDZTEV.js → chunk-YE5JSME7.js} +5 -1
  39. package/dist/chunk-YE5JSME7.js.map +1 -0
  40. package/dist/{chunk-BX4UBTOI.js → chunk-ZZBLWZJR.js} +12 -6
  41. package/dist/chunk-ZZBLWZJR.js.map +1 -0
  42. package/dist/context-mention-palette/index.js +9 -9
  43. package/dist/i18n/index.d.ts +12 -0
  44. package/dist/i18n/index.js +2 -2
  45. package/dist/index.d.ts +18 -5
  46. package/dist/index.js +1442 -846
  47. package/dist/index.js.map +1 -1
  48. package/dist/queued-prompt-runtime.d.ts +2 -2
  49. package/dist/{types-BxOwnK7K.d.ts → types-BwDrG654.d.ts} +2 -2
  50. package/dist/workbench/contribution.d.ts +1 -1
  51. package/dist/workbench/contribution.js +8 -8
  52. package/dist/workbench/index.d.ts +3 -2
  53. package/dist/workbench/index.js +11 -11
  54. package/dist/workbench/launch.d.ts +1 -1
  55. package/dist/workbench/launch.js +3 -3
  56. package/dist/workbench/providerCatalog.d.ts +3 -3
  57. package/dist/workbench/providerCatalog.js +1 -1
  58. package/dist/workbench/sessionTitle.d.ts +1 -1
  59. package/dist/workbench/sessionTitle.js +3 -3
  60. package/dist/workbench/state.d.ts +11 -2
  61. package/dist/workbench/state.js +5 -3
  62. package/dist/workbench/types.d.ts +2 -2
  63. package/dist/workbench/types.js +1 -1
  64. package/dist/workspace-agent-generated-files.js +4 -4
  65. package/package.json +12 -12
  66. package/dist/chunk-BX4UBTOI.js.map +0 -1
  67. package/dist/chunk-DQTBWOIK.js.map +0 -1
  68. package/dist/chunk-IL2ORY23.js.map +0 -1
  69. package/dist/chunk-JWWHS34V.js.map +0 -1
  70. package/dist/chunk-MA254MXR.js.map +0 -1
  71. package/dist/chunk-NCAVJEHI.js.map +0 -1
  72. package/dist/chunk-OEJQJP65.js.map +0 -1
  73. package/dist/chunk-RNFP7CUO.js.map +0 -1
  74. package/dist/chunk-SKWDZTEV.js.map +0 -1
  75. package/dist/chunk-UAXKJNM2.js.map +0 -1
  76. package/dist/chunk-ZABN3POD.js.map +0 -1
  77. /package/dist/{chunk-YU3XLPLC.js.map → chunk-A2KZVRUO.js.map} +0 -0
  78. /package/dist/{chunk-KS4ULVGM.js.map → chunk-AIR6A4NP.js.map} +0 -0
  79. /package/dist/{chunk-JGU2VMDA.js.map → chunk-C2M2ELXF.js.map} +0 -0
  80. /package/dist/{chunk-QZYGCZNQ.js.map → chunk-DYX6466P.js.map} +0 -0
  81. /package/dist/{chunk-XBR7D7X2.js.map → chunk-GOEL3BO7.js.map} +0 -0
  82. /package/dist/{chunk-YYAP6IK7.js.map → chunk-GXHZNIWT.js.map} +0 -0
  83. /package/dist/{chunk-PFKY5W76.js.map → chunk-J335PQ5H.js.map} +0 -0
  84. /package/dist/{chunk-CTYXJGSW.js.map → chunk-KJLSZETD.js.map} +0 -0
  85. /package/dist/{chunk-VIJQ5C33.js.map → chunk-QGKK6FHC.js.map} +0 -0
  86. /package/dist/{chunk-DP2X4J2D.js.map → chunk-UAAXRSW2.js.map} +0 -0
@@ -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-DPAgUJlR.js';
6
6
  export { B as BuildWorkspaceAgentSessionDetailInput, d as buildWorkspaceAgentSessionDetailViewModel } from '../agentConversationVM-DPAgUJlR.js';
7
- import { c as AgentGUIProviderSkillOption } from '../agentGuiNodeTypes-DNXndXhV.js';
7
+ import { c as AgentGUIProviderSkillOption } from '../agentGuiNodeTypes-BTHu_g4m.js';
8
8
  export { W as WorkspaceAgentActivityCard, n as WorkspaceAgentActivitySession, q as WorkspaceAgentActivityTimelineItem } from '../workspaceAgentActivityListViewModel-DJvAqZso.js';
9
9
  import '@tutti-os/workspace-issue-manager/core';
10
10
  import '@tutti-os/agent-activity-core';
11
- import '../types-BxOwnK7K.js';
11
+ import '../types-BwDrG654.js';
12
12
  import '@tutti-os/workspace-user-project/contracts';
13
13
 
14
14
  interface AgentConversationFlowProps {
@@ -6,20 +6,20 @@ import {
6
6
  projectAgentConversationVM,
7
7
  reconcileProjectedAgentConversationVM,
8
8
  useProjectedAgentConversation
9
- } from "../chunk-PFKY5W76.js";
10
- import "../chunk-CTYXJGSW.js";
9
+ } from "../chunk-J335PQ5H.js";
10
+ import "../chunk-KJLSZETD.js";
11
11
  import "../chunk-PSLAWU25.js";
12
- import "../chunk-JGU2VMDA.js";
12
+ import "../chunk-C2M2ELXF.js";
13
13
  import "../chunk-Y35GDLP2.js";
14
14
  import "../chunk-LUGELG5V.js";
15
- import "../chunk-BX4UBTOI.js";
16
- import "../chunk-IL2ORY23.js";
15
+ import "../chunk-ZZBLWZJR.js";
16
+ import "../chunk-4US2YHBY.js";
17
17
  import {
18
18
  translate
19
- } from "../chunk-KS4ULVGM.js";
19
+ } from "../chunk-AIR6A4NP.js";
20
20
  import "../chunk-PJP5BUU6.js";
21
- import "../chunk-OEJQJP65.js";
22
- import "../chunk-MA254MXR.js";
21
+ import "../chunk-4I2VCAMW.js";
22
+ import "../chunk-3QPN2Y7R.js";
23
23
 
24
24
  // shared/WorkspaceAgentSessionDetail.tsx
25
25
  import { useMemo } from "react";
@@ -207,7 +207,8 @@ function autoStartCandidate(focus) {
207
207
  var MANUAL_INSTALL_COMMANDS = {
208
208
  codex: "npm install -g @openai/codex --include=optional",
209
209
  "claude-code": "curl -fsSL https://claude.ai/install.sh | bash",
210
- cursor: "curl https://cursor.com/install -fsS | bash"
210
+ cursor: "curl https://cursor.com/install -fsS | bash",
211
+ opencode: "curl -fsSL https://opencode.ai/install | bash"
211
212
  };
212
213
  function endpointHost(endpoint) {
213
214
  if (!endpoint) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../shared/agentEnv/codexSetupContract.ts","../../shared/agentEnv/agentEnvWizardFlow.ts","../../shared/agentEnv/agentEnvViewModel.ts"],"sourcesContent":["/**\n * Frontend contract for the Codex setup progress stream surfaced on the agent\n * provider status snapshot as `activeAction` (片3 progress-flow contract). The\n * backend slice that populates this field has its own source of truth; the\n * generated `AgentProviderStatus` type does not (yet) declare it, so the panel\n * reads it defensively and degrades to detection-only state when it is absent.\n */\n\nexport type CodexSetupStepStatus =\n | \"pending\"\n | \"running\"\n | \"ok\"\n | \"error\"\n | \"skipped\";\n\nexport interface CodexSetupStep {\n id: string;\n label: string | null;\n status: CodexSetupStepStatus;\n detail: string | null;\n}\n\nexport type CodexSetupPhase =\n | \"detect\"\n | \"install\"\n | \"repair\"\n | \"verify\"\n | \"done\"\n | \"error\";\n\nexport interface CodexSetupActiveActionError {\n code: string | null;\n message: string | null;\n}\n\nexport interface CodexSetupActiveAction {\n phase: CodexSetupPhase;\n steps: CodexSetupStep[];\n registry: string | null;\n log: string[];\n error: CodexSetupActiveActionError | null;\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null;\n}\n\nfunction asString(value: unknown): string | null {\n return typeof value === \"string\" && value.length > 0 ? value : null;\n}\n\nconst STEP_STATUSES: ReadonlySet<CodexSetupStepStatus> = new Set([\n \"pending\",\n \"running\",\n \"ok\",\n \"error\",\n \"skipped\"\n]);\n\nconst PHASES: ReadonlySet<CodexSetupPhase> = new Set([\n \"detect\",\n \"install\",\n \"repair\",\n \"verify\",\n \"done\",\n \"error\"\n]);\n\nfunction normalizeStep(value: unknown, index: number): CodexSetupStep | null {\n const record = asRecord(value);\n if (!record) {\n return null;\n }\n const status = asString(record.status);\n return {\n id: asString(record.id) ?? `step-${index}`,\n label: asString(record.label),\n status:\n status && STEP_STATUSES.has(status as CodexSetupStepStatus)\n ? (status as CodexSetupStepStatus)\n : \"pending\",\n detail: asString(record.detail)\n };\n}\n\n/**\n * Defensively reads the `activeAction` field off an AgentProviderStatus-like\n * object. Returns null when the field is missing or malformed, which the panel\n * treats as \"no live setup action in progress\".\n */\nexport function readCodexSetupActiveAction(\n status: unknown\n): CodexSetupActiveAction | null {\n const statusRecord = asRecord(status);\n if (!statusRecord) {\n return null;\n }\n const raw = asRecord(statusRecord.activeAction);\n if (!raw) {\n return null;\n }\n const phase = asString(raw.phase);\n const steps = Array.isArray(raw.steps)\n ? raw.steps\n .map((step, index) => normalizeStep(step, index))\n .filter((step): step is CodexSetupStep => step !== null)\n : [];\n const log = Array.isArray(raw.log)\n ? raw.log.filter((entry): entry is string => typeof entry === \"string\")\n : [];\n const errorRecord = asRecord(raw.error);\n return {\n phase:\n phase && PHASES.has(phase as CodexSetupPhase)\n ? (phase as CodexSetupPhase)\n : \"detect\",\n steps,\n registry: asString(raw.registry),\n log,\n error: errorRecord\n ? {\n code: asString(errorRecord.code),\n message: asString(errorRecord.message)\n }\n : null\n };\n}\n","import type { AgentEnvPanelFocus } from \"./agentEnvPanelStore\";\nimport type {\n CodexSetupPhase,\n CodexSetupStepStatus\n} from \"./codexSetupContract\";\n\nexport type AgentSetupStageId =\n | \"detect\"\n | \"network\"\n | \"install\"\n | \"adapter\"\n | \"login\"\n | \"ready\";\n\nexport type StageDetailToken =\n | { kind: \"text\"; text: string }\n | { kind: \"version-floor\"; current: string; required: string }\n | { kind: \"version-mismatch\"; current: string; required: string };\n\n// Whether an availability reason code means the CLI itself is on an unsupported\n// version — as opposed to an ADAPTER version mismatch. The adapter reason code\n// `acp_adapter_version_mismatch` also contains the substring \"version\", so a\n// plain `includes(\"version\")` test wrongly paints the CLI step red (\"版本不受支持\")\n// when only the adapter is mismatched. Require \"version\" but exclude any adapter\n// reason so the CLI and adapter stages stay independent.\nexport function reasonCodeIndicatesCliVersionUnsupported(\n reasonCode: string | null | undefined\n): boolean {\n const lower = (reasonCode ?? \"\").toLowerCase();\n return lower.includes(\"version\") && !lower.includes(\"adapter\");\n}\n\nexport interface AgentSetupStage {\n id: AgentSetupStageId;\n label: string;\n status: CodexSetupStepStatus;\n detail: StageDetailToken | null;\n /**\n * Optional explicit problem token for a blocked stage that can't be inferred\n * from `status` alone. Today only the install stage sets it — when the codex\n * launcher is present but its platform subpackage is missing, the stage is\n * `pending` (the daemon repairs it via the install action) yet needs a distinct\n * \"platform package missing\" problem rather than the generic \"install-missing\".\n */\n problem?: StageProblem;\n authMethod?: string | null;\n}\n\nexport interface AgentSetupStageLabels {\n detect: string;\n network: string;\n install: string;\n adapter: string;\n login: string;\n ready: string;\n}\n\nexport interface DeriveAgentSetupStagesInput {\n detected: boolean;\n cliInstalled: boolean;\n versionTooOld: boolean;\n /**\n * The codex CLI launcher is resolved but its platform-specific optional\n * dependency subpackage (e.g. @openai/codex-darwin-arm64) is missing — the\n * binary spawns ENOENT. The daemon repairs this in place via the install\n * action, so the install stage is `pending` (not `ok`) with a distinct\n * \"platform package missing\" problem token.\n */\n platformPackageIncomplete?: boolean;\n adapterInstalled: boolean;\n adapterVersionMismatch: boolean;\n authenticated: boolean;\n authRequired: boolean;\n ready: boolean;\n activePhase: CodexSetupPhase | null;\n /**\n * Whether the daemon-driven install action is in flight. This is the\n * authoritative \"installing\" signal: the adapter (external-registry) installer\n * emits no activeAction phase, so without this an in-progress adapter install\n * would show no spinner.\n */\n installActionPending: boolean;\n loginPending: boolean;\n /**\n * Active connectivity probe verdict: true (reachable), false (offline), or\n * null when the daemon reported no network info (older daemon / not probed) —\n * null is treated as \"don't block\".\n */\n networkReachable: boolean | null;\n cliVersionDetail: StageDetailToken | null;\n adapterDetail: StageDetailToken | null;\n accountDetail: StageDetailToken | null;\n authMethod: string | null;\n networkDetail: StageDetailToken | null;\n labels: AgentSetupStageLabels;\n}\n\nconst INSTALLING_PHASES: ReadonlySet<CodexSetupPhase> = new Set([\n \"install\",\n \"repair\",\n \"verify\"\n]);\n\n/**\n * Maps primitive provider-status flags onto the fixed 5-stage track the wizard\n * renders. Version verification folds into the install (CLI) stage (an\n * unsupported version means install is `error`, not `ok`). The adapter stage\n * covers the ACP adapter, which for some providers (e.g. claude-code) is a\n * separate, slow npm install distinct from the CLI; for providers where the\n * adapter is the CLI itself it simply tracks the CLI. Login `running` is driven\n * by the caller's pending flag because login runs as a terminal action, not via\n * the activeAction phase stream.\n */\nexport function deriveAgentSetupStages(\n input: DeriveAgentSetupStagesInput\n): AgentSetupStage[] {\n const installing =\n input.installActionPending ||\n (input.activePhase ? INSTALLING_PHASES.has(input.activePhase) : false);\n\n const detectStatus: CodexSetupStepStatus = input.detected ? \"ok\" : \"running\";\n\n // Network is an independent live-connectivity check (registry + provider API),\n // so it is NOT folded into the `ready` short-circuit — a real outage shows even\n // when the CLI is otherwise configured. It can only be judged once detection\n // has run; `false` is the only blocking value (null = no daemon verdict).\n const networkStatus: CodexSetupStepStatus = !input.detected\n ? \"pending\"\n : input.networkReachable === false\n ? \"error\"\n : \"ok\";\n\n // A satisfied CLI stays checked even while an install runs, so the spinner\n // lands on the stage actually being worked on (e.g. the adapter during a\n // repair) rather than flipping every install-related stage back to running.\n // A present launcher with a missing platform subpackage is NOT ok — the\n // daemon repairs it via the install action, so it reads as a pending install.\n const cliOk =\n input.ready ||\n (input.cliInstalled &&\n !input.versionTooOld &&\n !input.platformPackageIncomplete);\n const installStatus: CodexSetupStepStatus = cliOk\n ? \"ok\"\n : installing\n ? \"running\"\n : input.versionTooOld\n ? \"error\"\n : \"pending\";\n const installProblem: StageProblem | undefined =\n input.platformPackageIncomplete && !cliOk\n ? \"install-platform-incomplete\"\n : undefined;\n\n const adapterOk =\n input.ready || (input.adapterInstalled && !input.adapterVersionMismatch);\n const adapterStatus: CodexSetupStepStatus = adapterOk\n ? \"ok\"\n : installing\n ? \"running\"\n : input.adapterVersionMismatch\n ? \"error\"\n : \"pending\";\n\n const loginStatus: CodexSetupStepStatus = input.authenticated\n ? \"ok\"\n : input.loginPending\n ? \"running\"\n : \"pending\";\n\n const readyStatus: CodexSetupStepStatus = input.ready ? \"ok\" : \"pending\";\n\n return [\n {\n id: \"detect\",\n label: input.labels.detect,\n status: detectStatus,\n detail: null\n },\n {\n id: \"network\",\n label: input.labels.network,\n status: networkStatus,\n detail: input.networkDetail\n },\n {\n id: \"install\",\n label: input.labels.install,\n status: installStatus,\n detail: input.cliVersionDetail,\n ...(installProblem ? { problem: installProblem } : {})\n },\n {\n id: \"adapter\",\n label: input.labels.adapter,\n status: adapterStatus,\n detail: input.adapterDetail\n },\n {\n id: \"login\",\n label: input.labels.login,\n status: loginStatus,\n detail: input.accountDetail,\n authMethod: input.authMethod\n },\n {\n id: \"ready\",\n label: input.labels.ready,\n status: readyStatus,\n detail: null\n }\n ];\n}\n\n/**\n * Step-by-step reveal: even when prerequisites are already satisfied, the wizard\n * walks a cursor down the track so each stage visibly \"checks off\" one at a time\n * instead of all flashing complete at once.\n *\n * `revealIndex` is the cursor position. Stages before it show their real status\n * (already revealed). The stage AT the cursor is shown as `running` when its\n * real status is terminal-ok (the brief \"working on it\" moment before it checks\n * off) and otherwise shows its real status (so a genuinely running install, an\n * error, or a blocked prerequisite are honest). Stages after the cursor are\n * dimmed to `pending`.\n */\nexport function projectRevealedStages(\n realStages: AgentSetupStage[],\n revealIndex: number\n): AgentSetupStage[] {\n return realStages.map((stage, index) => {\n if (index < revealIndex) {\n return stage;\n }\n if (index === revealIndex) {\n if (stage.status === \"ok\" || stage.status === \"skipped\") {\n return { ...stage, status: \"running\" };\n }\n return stage;\n }\n return { ...stage, status: \"pending\" };\n });\n}\n\n/**\n * The reveal cursor advances past a stage only once that stage is really done\n * (`ok`/`skipped`). It parks on a stage that is still `running` (a real install\n * in progress), `error`, or `pending` (a blocked prerequisite) — so the\n * animation never races ahead of reality.\n */\nexport function shouldAdvanceReveal(\n realStages: AgentSetupStage[],\n revealIndex: number\n): boolean {\n const cursor = realStages[revealIndex];\n if (!cursor) {\n return false;\n }\n return cursor.status === \"ok\" || cursor.status === \"skipped\";\n}\n\nexport type StageActionId = \"install\" | \"login\" | \"redetect\";\n\n/**\n * The problem token a blocked stage represents. The UI maps this to \"未xxx\"\n * copy; keeping it i18n-agnostic here lets the mapping stay tested without\n * pulling translation strings into the pure flow module.\n */\nexport type StageProblem =\n | \"network-unreachable\"\n | \"install-missing\"\n | \"install-outdated\"\n | \"install-platform-incomplete\"\n | \"adapter-missing\"\n | \"adapter-mismatch\"\n | \"login-missing\";\n\nexport interface StageRemediation {\n actionId: StageActionId;\n problem: StageProblem;\n}\n\n/**\n * For a stage the user must act on (idle `pending`/`error`, never `running` or\n * `ok`), returns what is wrong and which action fixes it. `detect`/`ready` never\n * carry their own remediation — they reflect prerequisites, not user actions.\n *\n * `error` means a version problem on the install/adapter stages (the only stages\n * derive marks `error`); `pending` means the step simply has not run yet.\n */\nexport function stageRemediation(\n stage: AgentSetupStage\n): StageRemediation | null {\n if (stage.status !== \"pending\" && stage.status !== \"error\") {\n return null;\n }\n switch (stage.id) {\n case \"network\":\n // Connectivity isn't fixed by an install/login action — re-running\n // detection (which re-probes the network) is the remediation.\n return { actionId: \"redetect\", problem: \"network-unreachable\" };\n case \"install\":\n // An explicit problem token (today: platform subpackage missing) takes\n // precedence — the daemon repairs it in place via the install action, so\n // route through install rather than the manual-upgrade error path.\n if (stage.problem) {\n return { actionId: \"install\", problem: stage.problem };\n }\n // A genuinely missing CLI is installed for the user; a present-but-\n // outdated CLI is NOT — we don't silently reinstall a binary the user\n // manages. Instead the panel shows the manual upgrade command and\n // re-detection confirms it once they've upgraded.\n return stage.status === \"error\"\n ? { actionId: \"redetect\", problem: \"install-outdated\" }\n : { actionId: \"install\", problem: \"install-missing\" };\n case \"adapter\":\n return {\n actionId: \"install\",\n problem:\n stage.status === \"error\" ? \"adapter-mismatch\" : \"adapter-missing\"\n };\n case \"login\":\n return { actionId: \"login\", problem: \"login-missing\" };\n default:\n return null;\n }\n}\n\nexport interface ResolveWizardAutoStartInput {\n focus: AgentEnvPanelFocus | null;\n detected: boolean;\n ready: boolean;\n installPending: boolean;\n loginPending: boolean;\n}\n\n/**\n * Decides whether opening the wizard with a remediation focus should auto-start\n * an action. Returns the action id to run, or null when nothing should run\n * (non-remediation focus, detection not settled, already ready, or already\n * pending). The caller is responsible for firing this at most once per open.\n */\nexport function resolveWizardAutoStartAction(\n input: ResolveWizardAutoStartInput\n): \"install\" | \"login\" | null {\n const candidate = autoStartCandidate(input.focus);\n if (!candidate) {\n return null;\n }\n if (!input.detected || input.ready) {\n return null;\n }\n if (candidate === \"install\" && input.installPending) {\n return null;\n }\n if (candidate === \"login\" && input.loginPending) {\n return null;\n }\n return candidate;\n}\n\nfunction autoStartCandidate(\n focus: AgentEnvPanelFocus | null\n): \"install\" | \"login\" | null {\n switch (focus) {\n case \"install\":\n case \"repair\":\n return \"install\";\n case \"upgrade\":\n // CLI upgrades are user-driven: opening the panel from a version error\n // shows the manual upgrade command rather than auto-running an install\n // (which can't upgrade an already-present binary anyway).\n return null;\n case \"auth\":\n return \"login\";\n default:\n return null;\n }\n}\n","import type {\n AgentProviderStatus,\n WorkspaceAgentProvider\n} from \"@tutti-os/client-tuttid-ts\";\nimport {\n deriveAgentSetupStages,\n projectRevealedStages,\n reasonCodeIndicatesCliVersionUnsupported,\n type AgentSetupStage,\n type AgentSetupStageId,\n type AgentSetupStageLabels,\n type StageDetailToken\n} from \"./agentEnvWizardFlow.ts\";\nimport type {\n CodexSetupActiveAction,\n CodexSetupActiveActionError,\n CodexSetupPhase\n} from \"./codexSetupContract.ts\";\n\nexport interface NetworkCheck {\n kind: \"registry\" | \"api\" | \"proxy\";\n reachable: boolean;\n host: string | null;\n configured?: boolean;\n}\n\nconst MANUAL_INSTALL_COMMANDS: Partial<Record<WorkspaceAgentProvider, string>> =\n {\n codex: \"npm install -g @openai/codex --include=optional\",\n \"claude-code\": \"curl -fsSL https://claude.ai/install.sh | bash\",\n cursor: \"curl https://cursor.com/install -fsS | bash\"\n };\n\nfunction endpointHost(endpoint: string | null | undefined): string | null {\n if (!endpoint) {\n return null;\n }\n return endpoint.replace(/^https?:\\/\\//, \"\").replace(/\\/.*$/, \"\") || null;\n}\n\n// A proxy URL may carry credentials (http://user:pass@host:port). Strip the\n// userinfo before it reaches the renderer/UI so proxy passwords are never\n// surfaced; the scheme + host:port are kept for display.\nfunction scrubProxyUrl(url: string | null | undefined): string | null {\n if (!url) {\n return null;\n }\n try {\n const parsed = new URL(url);\n parsed.username = \"\";\n parsed.password = \"\";\n return `${parsed.protocol}//${parsed.host}`;\n } catch {\n // Not a parseable URL — still strip a leading userinfo segment defensively.\n return url.replace(/\\/\\/[^/@]*@/, \"//\") || null;\n }\n}\n\nfunction textToken(text: string | null): StageDetailToken | null {\n return text ? { kind: \"text\", text } : null;\n}\n\nfunction joinDetail(parts: Array<string | null | undefined>): string | null {\n const joined = parts.filter((p): p is string => Boolean(p)).join(\" · \");\n return joined || null;\n}\n\nexport function deriveHasAnomaly(\n stages: AgentSetupStage[],\n activeActionError: CodexSetupActiveActionError | null\n): boolean {\n return stages.some((s) => s.status === \"error\") || Boolean(activeActionError);\n}\n\nexport interface AgentEnvWizardViewModelInput {\n provider: WorkspaceAgentProvider;\n status: AgentProviderStatus | null;\n isLoading: boolean;\n activeAction: CodexSetupActiveAction | null;\n installActionPending: boolean;\n loginPending: boolean;\n revealIndex: number;\n stageLabels: AgentSetupStageLabels;\n}\n\nexport interface AgentEnvWizardViewModel {\n ready: boolean;\n busy: boolean;\n redetecting: boolean;\n displayStages: AgentSetupStage[];\n blockingStageId: AgentSetupStageId | null;\n networkChecks: NetworkCheck[];\n hasAnomaly: boolean;\n activePhase: CodexSetupPhase | null;\n log: string[];\n registry: string | null;\n error: CodexSetupActiveActionError | null;\n manualCommand: string | null;\n installPending: boolean;\n loginPending: boolean;\n}\n\nexport function buildAgentEnvWizardViewModel(\n input: AgentEnvWizardViewModelInput\n): AgentEnvWizardViewModel {\n const { status, activeAction, provider } = input;\n const ready = status?.availability.status === \"ready\";\n const installPending = input.installActionPending;\n const loginPending = input.loginPending;\n const busy =\n installPending ||\n activeAction?.phase === \"install\" ||\n activeAction?.phase === \"repair\" ||\n activeAction?.phase === \"verify\";\n\n const reasonCode = (status?.availability.reasonCode ?? \"\").toLowerCase();\n const versionTooOld = reasonCodeIndicatesCliVersionUnsupported(reasonCode);\n const cliBelowFloor = reasonCode.includes(\"codex_version_too_old\");\n // The codex launcher is present but its platform subpackage is missing — the\n // CLI spawns ENOENT. The daemon repairs this in place via the install action;\n // the wizard must NOT mark the install stage ok just because the launcher\n // resolved.\n const platformPackageIncomplete = reasonCode.includes(\n \"codex_platform_pkg_incomplete\"\n );\n const adapterVersionMismatch = reasonCode.includes(\n \"acp_adapter_version_mismatch\"\n );\n\n const cliDetail: StageDetailToken | null =\n cliBelowFloor && status?.cli.version && status.cli.minVersion\n ? {\n kind: \"version-floor\",\n current: status.cli.version,\n required: status.cli.minVersion\n }\n : status?.cli.installed\n ? textToken(joinDetail([status?.cli.version, status?.cli.binaryPath]))\n : textToken(status?.cli.version ?? null);\n\n const adapterDetail: StageDetailToken | null =\n adapterVersionMismatch &&\n status?.adapter.version &&\n status?.adapter.requiredVersion\n ? {\n kind: \"version-mismatch\",\n current: status.adapter.version,\n required: status.adapter.requiredVersion\n }\n : status?.adapter.installed\n ? textToken(\n joinDetail([status?.adapter.version, status?.adapter.binaryPath])\n )\n : textToken(\n status?.adapter.binaryPath ??\n (status?.adapter.command?.length\n ? status.adapter.command.join(\" \")\n : null)\n );\n\n const networkChecks: NetworkCheck[] = status?.network\n ? [\n {\n kind: \"registry\",\n reachable: status.network.registry.reachable,\n host: endpointHost(status.network.registry.endpoint)\n },\n ...(status.network.providerApi\n ? [\n {\n kind: \"api\" as const,\n reachable: status.network.providerApi.reachable,\n host: endpointHost(status.network.providerApi.endpoint)\n }\n ]\n : []),\n ...(status.network.proxy\n ? [\n {\n kind: \"proxy\" as const,\n reachable:\n !status.network.proxy.configured ||\n status.network.proxy.reachable,\n host: scrubProxyUrl(status.network.proxy.url),\n configured: status.network.proxy.configured\n }\n ]\n : [])\n ]\n : [];\n const networkReachable =\n networkChecks.length === 0 ? null : networkChecks.every((c) => c.reachable);\n\n const accountDetail: StageDetailToken | null = status?.auth.accountLabel\n ? { kind: \"text\", text: status.auth.accountLabel }\n : status?.auth.status === \"authenticated\"\n ? { kind: \"text\", text: \"__SIGNED_IN__\" }\n : null;\n const authMethod: string | null = status?.auth.authMethod ?? null;\n\n const stages = deriveAgentSetupStages({\n detected: status !== null,\n cliInstalled: status?.cli.installed ?? false,\n versionTooOld,\n platformPackageIncomplete,\n adapterInstalled: status?.adapter.installed ?? false,\n adapterVersionMismatch,\n authenticated: status?.auth.status === \"authenticated\",\n authRequired: status?.auth.status === \"required\",\n ready: Boolean(ready),\n activePhase: activeAction?.phase ?? null,\n installActionPending: installPending,\n loginPending,\n networkReachable,\n cliVersionDetail: cliDetail,\n adapterDetail,\n accountDetail,\n authMethod,\n networkDetail: null,\n labels: input.stageLabels\n });\n\n const registry = activeAction?.registry ?? null;\n const stagesWithDetail = registry\n ? stages.map((s) =>\n s.id === \"ready\"\n ? { ...s, detail: { kind: \"text\" as const, text: registry } }\n : s\n )\n : stages;\n const displayStages = projectRevealedStages(\n stagesWithDetail,\n input.revealIndex\n );\n\n const blockingIndex = stages.findIndex((s) => s.status !== \"ok\");\n const blockingStage = blockingIndex >= 0 ? stages[blockingIndex] : undefined;\n const blockingStageId: AgentSetupStageId | null =\n blockingStage && input.revealIndex >= blockingIndex\n ? blockingStage.id\n : null;\n\n return {\n ready: Boolean(ready),\n busy: Boolean(busy),\n redetecting: input.isLoading,\n displayStages,\n blockingStageId,\n networkChecks,\n hasAnomaly: deriveHasAnomaly(stages, activeAction?.error ?? null),\n activePhase: activeAction?.phase ?? null,\n log: activeAction?.log ?? [],\n registry,\n error: activeAction?.error ?? null,\n manualCommand: MANUAL_INSTALL_COMMANDS[provider] ?? null,\n installPending,\n loginPending\n };\n}\n"],"mappings":";;;;;;;;;;AA2CA,SAAS,SAAS,OAAgD;AAChE,SAAO,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAC5D,QACD;AACN;AAEA,SAAS,SAAS,OAA+B;AAC/C,SAAO,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI,QAAQ;AACjE;AAEA,IAAM,gBAAmD,oBAAI,IAAI;AAAA,EAC/D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,IAAM,SAAuC,oBAAI,IAAI;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,cAAc,OAAgB,OAAsC;AAC3E,QAAM,SAAS,SAAS,KAAK;AAC7B,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,EACT;AACA,QAAM,SAAS,SAAS,OAAO,MAAM;AACrC,SAAO;AAAA,IACL,IAAI,SAAS,OAAO,EAAE,KAAK,QAAQ,KAAK;AAAA,IACxC,OAAO,SAAS,OAAO,KAAK;AAAA,IAC5B,QACE,UAAU,cAAc,IAAI,MAA8B,IACrD,SACD;AAAA,IACN,QAAQ,SAAS,OAAO,MAAM;AAAA,EAChC;A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AAAA,EACN,IACA;AACJ,QAAM,gBAAgB;AAAA,IACpB;AAAA,IACA,MAAM;AAAA,EACR;AAEA,QAAM,gBAAgB,OAAO,UAAU,CAAC,MAAM,EAAE,WAAW,IAAI;AAC/D,QAAM,gBAAgB,iBAAiB,IAAI,OAAO,aAAa,IAAI;AACnE,QAAM,kBACJ,iBAAiB,MAAM,eAAe,gBAClC,cAAc,KACd;AAEN,SAAO;AAAA,IACL,OAAO,QAAQ,KAAK;AAAA,IACpB,MAAM,QAAQ,IAAI;AAAA,IAClB,aAAa,MAAM;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,iBAAiB,QAAQ,cAAc,SAAS,IAAI;AAAA,IAChE,aAAa,cAAc,SAAS;AAAA,IACpC,KAAK,cAAc,OAAO,CAAC;AAAA,IAC3B;AAAA,IACA,OAAO,cAAc,SAAS;AAAA,IAC9B,eAAe,wBAAwB,QAAQ,KAAK;AAAA,IACpD;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../shared/agentEnv/codexSetupContract.ts","../../shared/agentEnv/agentEnvWizardFlow.ts","../../shared/agentEnv/agentEnvViewModel.ts"],"sourcesContent":["/**\n * Frontend contract for the Codex setup progress stream surfaced on the agent\n * provider status snapshot as `activeAction` (片3 progress-flow contract). The\n * backend slice that populates this field has its own source of truth; the\n * generated `AgentProviderStatus` type does not (yet) declare it, so the panel\n * reads it defensively and degrades to detection-only state when it is absent.\n */\n\nexport type CodexSetupStepStatus =\n | \"pending\"\n | \"running\"\n | \"ok\"\n | \"error\"\n | \"skipped\";\n\nexport interface CodexSetupStep {\n id: string;\n label: string | null;\n status: CodexSetupStepStatus;\n detail: string | null;\n}\n\nexport type CodexSetupPhase =\n | \"detect\"\n | \"install\"\n | \"repair\"\n | \"verify\"\n | \"done\"\n | \"error\";\n\nexport interface CodexSetupActiveActionError {\n code: string | null;\n message: string | null;\n}\n\nexport interface CodexSetupActiveAction {\n phase: CodexSetupPhase;\n steps: CodexSetupStep[];\n registry: string | null;\n log: string[];\n error: CodexSetupActiveActionError | null;\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null;\n}\n\nfunction asString(value: unknown): string | null {\n return typeof value === \"string\" && value.length > 0 ? value : null;\n}\n\nconst STEP_STATUSES: ReadonlySet<CodexSetupStepStatus> = new Set([\n \"pending\",\n \"running\",\n \"ok\",\n \"error\",\n \"skipped\"\n]);\n\nconst PHASES: ReadonlySet<CodexSetupPhase> = new Set([\n \"detect\",\n \"install\",\n \"repair\",\n \"verify\",\n \"done\",\n \"error\"\n]);\n\nfunction normalizeStep(value: unknown, index: number): CodexSetupStep | null {\n const record = asRecord(value);\n if (!record) {\n return null;\n }\n const status = asString(record.status);\n return {\n id: asString(record.id) ?? `step-${index}`,\n label: asString(record.label),\n status:\n status && STEP_STATUSES.has(status as CodexSetupStepStatus)\n ? (status as CodexSetupStepStatus)\n : \"pending\",\n detail: asString(record.detail)\n };\n}\n\n/**\n * Defensively reads the `activeAction` field off an AgentProviderStatus-like\n * object. Returns null when the field is missing or malformed, which the panel\n * treats as \"no live setup action in progress\".\n */\nexport function readCodexSetupActiveAction(\n status: unknown\n): CodexSetupActiveAction | null {\n const statusRecord = asRecord(status);\n if (!statusRecord) {\n return null;\n }\n const raw = asRecord(statusRecord.activeAction);\n if (!raw) {\n return null;\n }\n const phase = asString(raw.phase);\n const steps = Array.isArray(raw.steps)\n ? raw.steps\n .map((step, index) => normalizeStep(step, index))\n .filter((step): step is CodexSetupStep => step !== null)\n : [];\n const log = Array.isArray(raw.log)\n ? raw.log.filter((entry): entry is string => typeof entry === \"string\")\n : [];\n const errorRecord = asRecord(raw.error);\n return {\n phase:\n phase && PHASES.has(phase as CodexSetupPhase)\n ? (phase as CodexSetupPhase)\n : \"detect\",\n steps,\n registry: asString(raw.registry),\n log,\n error: errorRecord\n ? {\n code: asString(errorRecord.code),\n message: asString(errorRecord.message)\n }\n : null\n };\n}\n","import type { AgentEnvPanelFocus } from \"./agentEnvPanelStore\";\nimport type {\n CodexSetupPhase,\n CodexSetupStepStatus\n} from \"./codexSetupContract\";\n\nexport type AgentSetupStageId =\n | \"detect\"\n | \"network\"\n | \"install\"\n | \"adapter\"\n | \"login\"\n | \"ready\";\n\nexport type StageDetailToken =\n | { kind: \"text\"; text: string }\n | { kind: \"version-floor\"; current: string; required: string }\n | { kind: \"version-mismatch\"; current: string; required: string };\n\n// Whether an availability reason code means the CLI itself is on an unsupported\n// version — as opposed to an ADAPTER version mismatch. The adapter reason code\n// `acp_adapter_version_mismatch` also contains the substring \"version\", so a\n// plain `includes(\"version\")` test wrongly paints the CLI step red (\"版本不受支持\")\n// when only the adapter is mismatched. Require \"version\" but exclude any adapter\n// reason so the CLI and adapter stages stay independent.\nexport function reasonCodeIndicatesCliVersionUnsupported(\n reasonCode: string | null | undefined\n): boolean {\n const lower = (reasonCode ?? \"\").toLowerCase();\n return lower.includes(\"version\") && !lower.includes(\"adapter\");\n}\n\nexport interface AgentSetupStage {\n id: AgentSetupStageId;\n label: string;\n status: CodexSetupStepStatus;\n detail: StageDetailToken | null;\n /**\n * Optional explicit problem token for a blocked stage that can't be inferred\n * from `status` alone. Today only the install stage sets it — when the codex\n * launcher is present but its platform subpackage is missing, the stage is\n * `pending` (the daemon repairs it via the install action) yet needs a distinct\n * \"platform package missing\" problem rather than the generic \"install-missing\".\n */\n problem?: StageProblem;\n authMethod?: string | null;\n}\n\nexport interface AgentSetupStageLabels {\n detect: string;\n network: string;\n install: string;\n adapter: string;\n login: string;\n ready: string;\n}\n\nexport interface DeriveAgentSetupStagesInput {\n detected: boolean;\n cliInstalled: boolean;\n versionTooOld: boolean;\n /**\n * The codex CLI launcher is resolved but its platform-specific optional\n * dependency subpackage (e.g. @openai/codex-darwin-arm64) is missing — the\n * binary spawns ENOENT. The daemon repairs this in place via the install\n * action, so the install stage is `pending` (not `ok`) with a distinct\n * \"platform package missing\" problem token.\n */\n platformPackageIncomplete?: boolean;\n adapterInstalled: boolean;\n adapterVersionMismatch: boolean;\n authenticated: boolean;\n authRequired: boolean;\n ready: boolean;\n activePhase: CodexSetupPhase | null;\n /**\n * Whether the daemon-driven install action is in flight. This is the\n * authoritative \"installing\" signal: the adapter (external-registry) installer\n * emits no activeAction phase, so without this an in-progress adapter install\n * would show no spinner.\n */\n installActionPending: boolean;\n loginPending: boolean;\n /**\n * Active connectivity probe verdict: true (reachable), false (offline), or\n * null when the daemon reported no network info (older daemon / not probed) —\n * null is treated as \"don't block\".\n */\n networkReachable: boolean | null;\n cliVersionDetail: StageDetailToken | null;\n adapterDetail: StageDetailToken | null;\n accountDetail: StageDetailToken | null;\n authMethod: string | null;\n networkDetail: StageDetailToken | null;\n labels: AgentSetupStageLabels;\n}\n\nconst INSTALLING_PHASES: ReadonlySet<CodexSetupPhase> = new Set([\n \"install\",\n \"repair\",\n \"verify\"\n]);\n\n/**\n * Maps primitive provider-status flags onto the fixed 5-stage track the wizard\n * renders. Version verification folds into the install (CLI) stage (an\n * unsupported version means install is `error`, not `ok`). The adapter stage\n * covers the ACP adapter, which for some providers (e.g. claude-code) is a\n * separate, slow npm install distinct from the CLI; for providers where the\n * adapter is the CLI itself it simply tracks the CLI. Login `running` is driven\n * by the caller's pending flag because login runs as a terminal action, not via\n * the activeAction phase stream.\n */\nexport function deriveAgentSetupStages(\n input: DeriveAgentSetupStagesInput\n): AgentSetupStage[] {\n const installing =\n input.installActionPending ||\n (input.activePhase ? INSTALLING_PHASES.has(input.activePhase) : false);\n\n const detectStatus: CodexSetupStepStatus = input.detected ? \"ok\" : \"running\";\n\n // Network is an independent live-connectivity check (registry + provider API),\n // so it is NOT folded into the `ready` short-circuit — a real outage shows even\n // when the CLI is otherwise configured. It can only be judged once detection\n // has run; `false` is the only blocking value (null = no daemon verdict).\n const networkStatus: CodexSetupStepStatus = !input.detected\n ? \"pending\"\n : input.networkReachable === false\n ? \"error\"\n : \"ok\";\n\n // A satisfied CLI stays checked even while an install runs, so the spinner\n // lands on the stage actually being worked on (e.g. the adapter during a\n // repair) rather than flipping every install-related stage back to running.\n // A present launcher with a missing platform subpackage is NOT ok — the\n // daemon repairs it via the install action, so it reads as a pending install.\n const cliOk =\n input.ready ||\n (input.cliInstalled &&\n !input.versionTooOld &&\n !input.platformPackageIncomplete);\n const installStatus: CodexSetupStepStatus = cliOk\n ? \"ok\"\n : installing\n ? \"running\"\n : input.versionTooOld\n ? \"error\"\n : \"pending\";\n const installProblem: StageProblem | undefined =\n input.platformPackageIncomplete && !cliOk\n ? \"install-platform-incomplete\"\n : undefined;\n\n const adapterOk =\n input.ready || (input.adapterInstalled && !input.adapterVersionMismatch);\n const adapterStatus: CodexSetupStepStatus = adapterOk\n ? \"ok\"\n : installing\n ? \"running\"\n : input.adapterVersionMismatch\n ? \"error\"\n : \"pending\";\n\n const loginStatus: CodexSetupStepStatus = input.authenticated\n ? \"ok\"\n : input.loginPending\n ? \"running\"\n : \"pending\";\n\n const readyStatus: CodexSetupStepStatus = input.ready ? \"ok\" : \"pending\";\n\n return [\n {\n id: \"detect\",\n label: input.labels.detect,\n status: detectStatus,\n detail: null\n },\n {\n id: \"network\",\n label: input.labels.network,\n status: networkStatus,\n detail: input.networkDetail\n },\n {\n id: \"install\",\n label: input.labels.install,\n status: installStatus,\n detail: input.cliVersionDetail,\n ...(installProblem ? { problem: installProblem } : {})\n },\n {\n id: \"adapter\",\n label: input.labels.adapter,\n status: adapterStatus,\n detail: input.adapterDetail\n },\n {\n id: \"login\",\n label: input.labels.login,\n status: loginStatus,\n detail: input.accountDetail,\n authMethod: input.authMethod\n },\n {\n id: \"ready\",\n label: input.labels.ready,\n status: readyStatus,\n detail: null\n }\n ];\n}\n\n/**\n * Step-by-step reveal: even when prerequisites are already satisfied, the wizard\n * walks a cursor down the track so each stage visibly \"checks off\" one at a time\n * instead of all flashing complete at once.\n *\n * `revealIndex` is the cursor position. Stages before it show their real status\n * (already revealed). The stage AT the cursor is shown as `running` when its\n * real status is terminal-ok (the brief \"working on it\" moment before it checks\n * off) and otherwise shows its real status (so a genuinely running install, an\n * error, or a blocked prerequisite are honest). Stages after the cursor are\n * dimmed to `pending`.\n */\nexport function projectRevealedStages(\n realStages: AgentSetupStage[],\n revealIndex: number\n): AgentSetupStage[] {\n return realStages.map((stage, index) => {\n if (index < revealIndex) {\n return stage;\n }\n if (index === revealIndex) {\n if (stage.status === \"ok\" || stage.status === \"skipped\") {\n return { ...stage, status: \"running\" };\n }\n return stage;\n }\n return { ...stage, status: \"pending\" };\n });\n}\n\n/**\n * The reveal cursor advances past a stage only once that stage is really done\n * (`ok`/`skipped`). It parks on a stage that is still `running` (a real install\n * in progress), `error`, or `pending` (a blocked prerequisite) — so the\n * animation never races ahead of reality.\n */\nexport function shouldAdvanceReveal(\n realStages: AgentSetupStage[],\n revealIndex: number\n): boolean {\n const cursor = realStages[revealIndex];\n if (!cursor) {\n return false;\n }\n return cursor.status === \"ok\" || cursor.status === \"skipped\";\n}\n\nexport type StageActionId = \"install\" | \"login\" | \"redetect\";\n\n/**\n * The problem token a blocked stage represents. The UI maps this to \"未xxx\"\n * copy; keeping it i18n-agnostic here lets the mapping stay tested without\n * pulling translation strings into the pure flow module.\n */\nexport type StageProblem =\n | \"network-unreachable\"\n | \"install-missing\"\n | \"install-outdated\"\n | \"install-platform-incomplete\"\n | \"adapter-missing\"\n | \"adapter-mismatch\"\n | \"login-missing\";\n\nexport interface StageRemediation {\n actionId: StageActionId;\n problem: StageProblem;\n}\n\n/**\n * For a stage the user must act on (idle `pending`/`error`, never `running` or\n * `ok`), returns what is wrong and which action fixes it. `detect`/`ready` never\n * carry their own remediation — they reflect prerequisites, not user actions.\n *\n * `error` means a version problem on the install/adapter stages (the only stages\n * derive marks `error`); `pending` means the step simply has not run yet.\n */\nexport function stageRemediation(\n stage: AgentSetupStage\n): StageRemediation | null {\n if (stage.status !== \"pending\" && stage.status !== \"error\") {\n return null;\n }\n switch (stage.id) {\n case \"network\":\n // Connectivity isn't fixed by an install/login action — re-running\n // detection (which re-probes the network) is the remediation.\n return { actionId: \"redetect\", problem: \"network-unreachable\" };\n case \"install\":\n // An explicit problem token (today: platform subpackage missing) takes\n // precedence — the daemon repairs it in place via the install action, so\n // route through install rather than the manual-upgrade error path.\n if (stage.problem) {\n return { actionId: \"install\", problem: stage.problem };\n }\n // A genuinely missing CLI is installed for the user; a present-but-\n // outdated CLI is NOT — we don't silently reinstall a binary the user\n // manages. Instead the panel shows the manual upgrade command and\n // re-detection confirms it once they've upgraded.\n return stage.status === \"error\"\n ? { actionId: \"redetect\", problem: \"install-outdated\" }\n : { actionId: \"install\", problem: \"install-missing\" };\n case \"adapter\":\n return {\n actionId: \"install\",\n problem:\n stage.status === \"error\" ? \"adapter-mismatch\" : \"adapter-missing\"\n };\n case \"login\":\n return { actionId: \"login\", problem: \"login-missing\" };\n default:\n return null;\n }\n}\n\nexport interface ResolveWizardAutoStartInput {\n focus: AgentEnvPanelFocus | null;\n detected: boolean;\n ready: boolean;\n installPending: boolean;\n loginPending: boolean;\n}\n\n/**\n * Decides whether opening the wizard with a remediation focus should auto-start\n * an action. Returns the action id to run, or null when nothing should run\n * (non-remediation focus, detection not settled, already ready, or already\n * pending). The caller is responsible for firing this at most once per open.\n */\nexport function resolveWizardAutoStartAction(\n input: ResolveWizardAutoStartInput\n): \"install\" | \"login\" | null {\n const candidate = autoStartCandidate(input.focus);\n if (!candidate) {\n return null;\n }\n if (!input.detected || input.ready) {\n return null;\n }\n if (candidate === \"install\" && input.installPending) {\n return null;\n }\n if (candidate === \"login\" && input.loginPending) {\n return null;\n }\n return candidate;\n}\n\nfunction autoStartCandidate(\n focus: AgentEnvPanelFocus | null\n): \"install\" | \"login\" | null {\n switch (focus) {\n case \"install\":\n case \"repair\":\n return \"install\";\n case \"upgrade\":\n // CLI upgrades are user-driven: opening the panel from a version error\n // shows the manual upgrade command rather than auto-running an install\n // (which can't upgrade an already-present binary anyway).\n return null;\n case \"auth\":\n return \"login\";\n default:\n return null;\n }\n}\n","import type {\n AgentProviderStatus,\n WorkspaceAgentProvider\n} from \"@tutti-os/client-tuttid-ts\";\nimport {\n deriveAgentSetupStages,\n projectRevealedStages,\n reasonCodeIndicatesCliVersionUnsupported,\n type AgentSetupStage,\n type AgentSetupStageId,\n type AgentSetupStageLabels,\n type StageDetailToken\n} from \"./agentEnvWizardFlow.ts\";\nimport type {\n CodexSetupActiveAction,\n CodexSetupActiveActionError,\n CodexSetupPhase\n} from \"./codexSetupContract.ts\";\n\nexport interface NetworkCheck {\n kind: \"registry\" | \"api\" | \"proxy\";\n reachable: boolean;\n host: string | null;\n configured?: boolean;\n}\n\nconst MANUAL_INSTALL_COMMANDS: Partial<Record<WorkspaceAgentProvider, string>> =\n {\n codex: \"npm install -g @openai/codex --include=optional\",\n \"claude-code\": \"curl -fsSL https://claude.ai/install.sh | bash\",\n cursor: \"curl https://cursor.com/install -fsS | bash\",\n opencode: \"curl -fsSL https://opencode.ai/install | bash\"\n };\n\nfunction endpointHost(endpoint: string | null | undefined): string | null {\n if (!endpoint) {\n return null;\n }\n return endpoint.replace(/^https?:\\/\\//, \"\").replace(/\\/.*$/, \"\") || null;\n}\n\n// A proxy URL may carry credentials (http://user:pass@host:port). Strip the\n// userinfo before it reaches the renderer/UI so proxy passwords are never\n// surfaced; the scheme + host:port are kept for display.\nfunction scrubProxyUrl(url: string | null | undefined): string | null {\n if (!url) {\n return null;\n }\n try {\n const parsed = new URL(url);\n parsed.username = \"\";\n parsed.password = \"\";\n return `${parsed.protocol}//${parsed.host}`;\n } catch {\n // Not a parseable URL — still strip a leading userinfo segment defensively.\n return url.replace(/\\/\\/[^/@]*@/, \"//\") || null;\n }\n}\n\nfunction textToken(text: string | null): StageDetailToken | null {\n return text ? { kind: \"text\", text } : null;\n}\n\nfunction joinDetail(parts: Array<string | null | undefined>): string | null {\n const joined = parts.filter((p): p is string => Boolean(p)).join(\" · \");\n return joined || null;\n}\n\nexport function deriveHasAnomaly(\n stages: AgentSetupStage[],\n activeActionError: CodexSetupActiveActionError | null\n): boolean {\n return stages.some((s) => s.status === \"error\") || Boolean(activeActionError);\n}\n\nexport interface AgentEnvWizardViewModelInput {\n provider: WorkspaceAgentProvider;\n status: AgentProviderStatus | null;\n isLoading: boolean;\n activeAction: CodexSetupActiveAction | null;\n installActionPending: boolean;\n loginPending: boolean;\n revealIndex: number;\n stageLabels: AgentSetupStageLabels;\n}\n\nexport interface AgentEnvWizardViewModel {\n ready: boolean;\n busy: boolean;\n redetecting: boolean;\n displayStages: AgentSetupStage[];\n blockingStageId: AgentSetupStageId | null;\n networkChecks: NetworkCheck[];\n hasAnomaly: boolean;\n activePhase: CodexSetupPhase | null;\n log: string[];\n registry: string | null;\n error: CodexSetupActiveActionError | null;\n manualCommand: string | null;\n installPending: boolean;\n loginPending: boolean;\n}\n\nexport function buildAgentEnvWizardViewModel(\n input: AgentEnvWizardViewModelInput\n): AgentEnvWizardViewModel {\n const { status, activeAction, provider } = input;\n const ready = status?.availability.status === \"ready\";\n const installPending = input.installActionPending;\n const loginPending = input.loginPending;\n const busy =\n installPending ||\n activeAction?.phase === \"install\" ||\n activeAction?.phase === \"repair\" ||\n activeAction?.phase === \"verify\";\n\n const reasonCode = (status?.availability.reasonCode ?? \"\").toLowerCase();\n const versionTooOld = reasonCodeIndicatesCliVersionUnsupported(reasonCode);\n const cliBelowFloor = reasonCode.includes(\"codex_version_too_old\");\n // The codex launcher is present but its platform subpackage is missing — the\n // CLI spawns ENOENT. The daemon repairs this in place via the install action;\n // the wizard must NOT mark the install stage ok just because the launcher\n // resolved.\n const platformPackageIncomplete = reasonCode.includes(\n \"codex_platform_pkg_incomplete\"\n );\n const adapterVersionMismatch = reasonCode.includes(\n \"acp_adapter_version_mismatch\"\n );\n\n const cliDetail: StageDetailToken | null =\n cliBelowFloor && status?.cli.version && status.cli.minVersion\n ? {\n kind: \"version-floor\",\n current: status.cli.version,\n required: status.cli.minVersion\n }\n : status?.cli.installed\n ? textToken(joinDetail([status?.cli.version, status?.cli.binaryPath]))\n : textToken(status?.cli.version ?? null);\n\n const adapterDetail: StageDetailToken | null =\n adapterVersionMismatch &&\n status?.adapter.version &&\n status?.adapter.requiredVersion\n ? {\n kind: \"version-mismatch\",\n current: status.adapter.version,\n required: status.adapter.requiredVersion\n }\n : status?.adapter.installed\n ? textToken(\n joinDetail([status?.adapter.version, status?.adapter.binaryPath])\n )\n : textToken(\n status?.adapter.binaryPath ??\n (status?.adapter.command?.length\n ? status.adapter.command.join(\" \")\n : null)\n );\n\n const networkChecks: NetworkCheck[] = status?.network\n ? [\n {\n kind: \"registry\",\n reachable: status.network.registry.reachable,\n host: endpointHost(status.network.registry.endpoint)\n },\n ...(status.network.providerApi\n ? [\n {\n kind: \"api\" as const,\n reachable: status.network.providerApi.reachable,\n host: endpointHost(status.network.providerApi.endpoint)\n }\n ]\n : []),\n ...(status.network.proxy\n ? [\n {\n kind: \"proxy\" as const,\n reachable:\n !status.network.proxy.configured ||\n status.network.proxy.reachable,\n host: scrubProxyUrl(status.network.proxy.url),\n configured: status.network.proxy.configured\n }\n ]\n : [])\n ]\n : [];\n const networkReachable =\n networkChecks.length === 0 ? null : networkChecks.every((c) => c.reachable);\n\n const accountDetail: StageDetailToken | null = status?.auth.accountLabel\n ? { kind: \"text\", text: status.auth.accountLabel }\n : status?.auth.status === \"authenticated\"\n ? { kind: \"text\", text: \"__SIGNED_IN__\" }\n : null;\n const authMethod: string | null = status?.auth.authMethod ?? null;\n\n const stages = deriveAgentSetupStages({\n detected: status !== null,\n cliInstalled: status?.cli.installed ?? false,\n versionTooOld,\n platformPackageIncomplete,\n adapterInstalled: status?.adapter.installed ?? false,\n adapterVersionMismatch,\n authenticated: status?.auth.status === \"authenticated\",\n authRequired: status?.auth.status === \"required\",\n ready: Boolean(ready),\n activePhase: activeAction?.phase ?? null,\n installActionPending: installPending,\n loginPending,\n networkReachable,\n cliVersionDetail: cliDetail,\n adapterDetail,\n accountDetail,\n authMethod,\n networkDetail: null,\n labels: input.stageLabels\n });\n\n const registry = activeAction?.registry ?? null;\n const stagesWithDetail = registry\n ? stages.map((s) =>\n s.id === \"ready\"\n ? { ...s, detail: { kind: \"text\" as const, text: registry } }\n : s\n )\n : stages;\n const displayStages = projectRevealedStages(\n stagesWithDetail,\n input.revealIndex\n );\n\n const blockingIndex = stages.findIndex((s) => s.status !== \"ok\");\n const blockingStage = blockingIndex >= 0 ? stages[blockingIndex] : undefined;\n const blockingStageId: AgentSetupStageId | null =\n blockingStage && input.revealIndex >= blockingIndex\n ? blockingStage.id\n : null;\n\n return {\n ready: Boolean(ready),\n busy: Boolean(busy),\n redetecting: input.isLoading,\n displayStages,\n blockingStageId,\n networkChecks,\n hasAnomaly: deriveHasAnomaly(stages, activeAction?.error ?? null),\n activePhase: activeAction?.phase ?? null,\n log: activeAction?.log ?? [],\n registry,\n error: activeAction?.error ?? null,\n manualCommand: MANUAL_INSTALL_COMMANDS[provider] ?? null,\n installPending,\n loginPending\n };\n}\n"],"mappings":";;;;;;;;;;AA2CA,SAAS,SAAS,OAAgD;AAChE,SAAO,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAC5D,QACD;AACN;AAEA,SAAS,SAAS,OAA+B;AAC/C,SAAO,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI,QAAQ;AACjE;AAEA,IAAM,gBAAmD,oBAAI,IAAI;AAAA,EAC/D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,IAAM,SAAuC,oBAAI,IAAI;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,cAAc,OAAgB,OAAsC;AAC3E,QAAM,SAAS,SAAS,KAAK;AAC7B,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,EACT;AACA,QAAM,SAAS,SAAS,OAAO,MAAM;AACrC,SAAO;AAAA,IACL,IAAI,SAAS,OAAO,EAAE,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AAC;AAED,QAAM,WAAW,cAAc,YAAY;AAC3C,QAAM,mBAAmB,WACrB,OAAO;AAAA,IAAI,CAAC,MACV,EAAE,OAAO,UACL,EAAE,GAAG,GAAG,QAAQ,EAAE,MAAM,QAAiB,MAAM,SAAS,EAAE,IAC1D;AAAA,EACN,IACA;AACJ,QAAM,gBAAgB;AAAA,IACpB;AAAA,IACA,MAAM;AAAA,EACR;AAEA,QAAM,gBAAgB,OAAO,UAAU,CAAC,MAAM,EAAE,WAAW,IAAI;AAC/D,QAAM,gBAAgB,iBAAiB,IAAI,OAAO,aAAa,IAAI;AACnE,QAAM,kBACJ,iBAAiB,MAAM,eAAe,gBAClC,cAAc,KACd;AAEN,SAAO;AAAA,IACL,OAAO,QAAQ,KAAK;AAAA,IACpB,MAAM,QAAQ,IAAI;AAAA,IAClB,aAAa,MAAM;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,iBAAiB,QAAQ,cAAc,SAAS,IAAI;AAAA,IAChE,aAAa,cAAc,SAAS;AAAA,IACpC,KAAK,cAAc,OAAO,CAAC;AAAA,IAC3B;AAAA,IACA,OAAO,cAAc,SAAS;AAAA,IAC9B,eAAe,wBAAwB,QAAQ,KAAK;AAAA,IACpD;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  formatAgentGuiConversationPlainTitle
3
- } from "../chunk-XBR7D7X2.js";
3
+ } from "../chunk-GOEL3BO7.js";
4
4
  import {
5
5
  AgentInteractivePromptSurface,
6
6
  approvalOptionDisplayLabel,
7
7
  getPromptToolDetails,
8
8
  isPromptRequestIdTitle
9
- } from "../chunk-QZYGCZNQ.js";
9
+ } from "../chunk-DYX6466P.js";
10
10
  import {
11
11
  PLAN_IMPLEMENTATION_ACTION_IMPLEMENT,
12
12
  PLAN_IMPLEMENTATION_PROMPT,
@@ -15,7 +15,7 @@ import {
15
15
  } from "../chunk-MKHDRIGN.js";
16
16
  import {
17
17
  formatAgentSessionMentionText
18
- } from "../chunk-ZABN3POD.js";
18
+ } from "../chunk-D22A3KGQ.js";
19
19
  import {
20
20
  AgentMessageMarkdown,
21
21
  CustomScrollArea,
@@ -25,28 +25,28 @@ import {
25
25
  extractExitPlanModeOptions,
26
26
  isExitPlanSwitchModeInput,
27
27
  normalizeAskUserQuestions
28
- } from "../chunk-CTYXJGSW.js";
28
+ } from "../chunk-KJLSZETD.js";
29
29
  import {
30
30
  userAvatarPlaceholderUrl,
31
31
  workspaceAgentActivityStatusLabel
32
- } from "../chunk-YU3XLPLC.js";
32
+ } from "../chunk-A2KZVRUO.js";
33
33
  import {
34
34
  resolveWorkspaceAgentSessionSortTimeUnixMs
35
35
  } from "../chunk-IBIMGLCD.js";
36
36
  import {
37
37
  managedAgentRoundedIconUrl
38
- } from "../chunk-BX4UBTOI.js";
38
+ } from "../chunk-ZZBLWZJR.js";
39
39
  import {
40
40
  workspaceAgentProviderLabel
41
- } from "../chunk-IL2ORY23.js";
41
+ } from "../chunk-4US2YHBY.js";
42
42
  import {
43
43
  AgentGuiI18nProvider,
44
44
  getActiveUiLanguage,
45
45
  useTranslation
46
- } from "../chunk-KS4ULVGM.js";
46
+ } from "../chunk-AIR6A4NP.js";
47
47
  import "../chunk-PJP5BUU6.js";
48
- import "../chunk-OEJQJP65.js";
49
- import "../chunk-MA254MXR.js";
48
+ import "../chunk-4I2VCAMW.js";
49
+ import "../chunk-3QPN2Y7R.js";
50
50
  import "../chunk-GCBDIQDX.js";
51
51
 
52
52
  // agent-message-center/WorkspaceAgentMessageCenterPanel.tsx
@@ -1,5 +1,5 @@
1
1
  import { AgentActivityUsage } from '@tutti-os/agent-activity-core';
2
- import { i as AgentHostAgentSessionCommand, j as AgentHostAgentSessionComposerSettings, l as AgentHostAgentSessionReasoningEffort, m as AgentHostAgentSessionSpeed, k as AgentHostAgentSessionPermissionConfig, n as AgentHostAgentSessionState, a as AgentGUIProvider, q as AgentPromptContentBlock, A as AgentGUINodeData, f as AgentGUIProviderTarget, b as AgentGUIProviderRailMode, c as AgentGUIProviderReadinessGate } from './types-BxOwnK7K.js';
2
+ import { i as AgentHostAgentSessionCommand, j as AgentHostAgentSessionComposerSettings, l as AgentHostAgentSessionReasoningEffort, m as AgentHostAgentSessionSpeed, k as AgentHostAgentSessionPermissionConfig, n as AgentHostAgentSessionState, a as AgentGUIProvider, q as AgentPromptContentBlock, A as AgentGUINodeData, f as AgentGUIProviderTarget, b as AgentGUIProviderRailMode, c as AgentGUIProviderReadinessGate } from './types-BwDrG654.js';
3
3
  import { A as AgentHostBatchUserInfoInput, a as AgentHostBatchUserInfoResult, b as AgentHostDeleteWorkspaceAgentSessionInput, k as AgentHostWorkspaceAgentSessionSummaryInput, j as AgentHostWorkspaceAgentSessionSummary, e as AgentHostWorkspaceAgentListInput, l as AgentHostWorkspaceAgentSnapshot, i as AgentHostWorkspaceAgentSessionMessagesInput, h as AgentHostWorkspaceAgentSessionMessages, p as WorkspaceAgentActivitySyncState } from './workspaceAgentActivityListViewModel-DJvAqZso.js';
4
4
  import { A as AgentApprovalItemVM, a as AgentAskUserQuestionVM, b as AgentConversationPromptVM, c as AgentConversationVM, W as WorkspaceAgentSessionDetailViewModel } from './agentConversationVM-DPAgUJlR.js';
5
5
  import { WorkspaceUserProjectService } from '@tutti-os/workspace-user-project/contracts';
@@ -557,6 +557,7 @@ interface AgentGUIComposerSettingsVM {
557
557
  permissionConfig?: AgentSessionPermissionConfig | null;
558
558
  selectedProjectPath?: string | null;
559
559
  projectLocked?: boolean;
560
+ projectPathIsRemote?: boolean;
560
561
  modelListCollapsedToLatest?: boolean;
561
562
  availableModels: AgentGUIComposerSettingOption[];
562
563
  availableReasoningEfforts: AgentGUIComposerSettingOption[];
@@ -606,7 +606,7 @@ aside.workspace-agents-status-panel
606
606
  .workspace-agents-status-panel__detail-titlebar-main {
607
607
  display: flex;
608
608
  flex: 1 1 auto;
609
- gap: 4px;
609
+ gap: 6px;
610
610
  align-items: center;
611
611
  min-width: 0;
612
612
  }
@@ -4419,7 +4419,7 @@ aside.workspace-agents-status-panel
4419
4419
  user-select: none;
4420
4420
  }
4421
4421
 
4422
- .agent-gui-workbench-header::after {
4422
+ .agent-gui-workbench-header[data-agent-gui-workbench-header-has-session="true"]::after {
4423
4423
  position: absolute;
4424
4424
  right: 0;
4425
4425
  bottom: 0;
@@ -4605,6 +4605,21 @@ aside.workspace-agents-status-panel
4605
4605
  border-radius: 5px;
4606
4606
  }
4607
4607
 
4608
+ .agent-gui-workbench-header__session-icon--pending {
4609
+ background: var(--transparency-block);
4610
+ animation: agent-gui-workbench-header-icon-pending 1.2s ease-in-out infinite;
4611
+ }
4612
+
4613
+ @keyframes agent-gui-workbench-header-icon-pending {
4614
+ 0%,
4615
+ 100% {
4616
+ opacity: 0.6;
4617
+ }
4618
+ 50% {
4619
+ opacity: 1;
4620
+ }
4621
+ }
4622
+
4608
4623
  .agent-gui-workbench-header__detail-title {
4609
4624
  display: flex;
4610
4625
  height: 100%;
@@ -8473,6 +8488,7 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8473
8488
  }
8474
8489
 
8475
8490
  .agent-gui-node__provider-rail-tile {
8491
+ position: relative;
8476
8492
  display: grid;
8477
8493
  width: 52px;
8478
8494
  min-width: 0;
@@ -8487,9 +8503,21 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8487
8503
  font-weight: 600;
8488
8504
  line-height: 14px;
8489
8505
  text-align: center;
8506
+ transition:
8507
+ color 120ms ease,
8508
+ margin 140ms ease,
8509
+ opacity 140ms ease;
8490
8510
  -webkit-app-region: no-drag;
8491
8511
  }
8492
8512
 
8513
+ .agent-gui-node__provider-rail-tile[draggable="true"] {
8514
+ cursor: grab;
8515
+ }
8516
+
8517
+ .agent-gui-node__provider-rail-tile[draggable="true"]:active {
8518
+ cursor: grabbing;
8519
+ }
8520
+
8493
8521
  .agent-gui-node__provider-rail-tile + .agent-gui-node__provider-rail-tile {
8494
8522
  margin-top: 12px;
8495
8523
  }
@@ -8517,6 +8545,38 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8517
8545
  opacity: 0.3;
8518
8546
  }
8519
8547
 
8548
+ .agent-gui-node__provider-rail-tile[data-dragging="true"] {
8549
+ opacity: 0.42;
8550
+ }
8551
+
8552
+ .agent-gui-node__provider-rail-tile[data-drag-over="before"] {
8553
+ margin-top: 24px;
8554
+ }
8555
+
8556
+ .agent-gui-node__provider-rail-tile[data-drag-over="after"] {
8557
+ margin-bottom: 12px;
8558
+ }
8559
+
8560
+ .agent-gui-node__provider-rail-tile[data-drag-over="before"]::before,
8561
+ .agent-gui-node__provider-rail-tile[data-drag-over="after"]::after {
8562
+ content: "";
8563
+ position: absolute;
8564
+ left: 12px;
8565
+ right: 12px;
8566
+ height: 2px;
8567
+ border-radius: 999px;
8568
+ background: var(--brand-primary, var(--tutti-purple));
8569
+ pointer-events: none;
8570
+ }
8571
+
8572
+ .agent-gui-node__provider-rail-tile[data-drag-over="before"]::before {
8573
+ top: -13px;
8574
+ }
8575
+
8576
+ .agent-gui-node__provider-rail-tile[data-drag-over="after"]::after {
8577
+ bottom: -13px;
8578
+ }
8579
+
8520
8580
  .agent-gui-node__provider-rail-separator {
8521
8581
  display: block;
8522
8582
  width: 28px;
@@ -8550,7 +8610,7 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8550
8610
 
8551
8611
  .agent-gui-node__provider-rail-tile:not([data-selected="true"])
8552
8612
  .agent-gui-node__provider-rail-avatar {
8553
- opacity: 0.5;
8613
+ opacity: 0.38;
8554
8614
  }
8555
8615
 
8556
8616
  .agent-gui-node__provider-rail-tile:hover:not(:disabled)
@@ -8566,7 +8626,8 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8566
8626
  .agent-gui-node__provider-rail-tile[data-selected="true"]
8567
8627
  .agent-gui-node__provider-rail-avatar {
8568
8628
  border-color: var(--brand-primary, var(--tutti-purple));
8569
- background: transparent;
8629
+ background: color-mix(in srgb, var(--background-fronted) 80%, white);
8630
+ box-shadow: 0 0 0 1px color-mix(in srgb, white 45%, transparent);
8570
8631
  color: var(--brand-primary, var(--tutti-purple));
8571
8632
  }
8572
8633
 
@@ -8791,7 +8852,7 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8791
8852
 
8792
8853
  .agent-gui-node__empty-provider-gate {
8793
8854
  max-width: 520px;
8794
- gap: 14px;
8855
+ gap: 8px;
8795
8856
  }
8796
8857
 
8797
8858
  .agent-gui-node__empty-provider-gate > .agent-gui-node__empty-hero-icon-effect {
@@ -632,6 +632,12 @@ var en = {
632
632
  slashStatusContextValue: "{{percentLeft}}% left ({{usedTokens}} used / {{totalTokens}})",
633
633
  slashStatusContextUnavailable: "Context usage unavailable",
634
634
  slashStatusLimitsUnavailable: "Rate limits unavailable from this agent",
635
+ slashStatusUsageJustUpdated: "Updated just now",
636
+ slashStatusUsageMinutesAgo: "Updated {{count}}m ago",
637
+ slashStatusUsageHoursAgo: "Updated {{count}}h ago",
638
+ slashStatusUsageUpdating: "Updating\u2026",
639
+ slashStatusUsageRefreshFailed: "Refresh failed",
640
+ slashStatusUsageRefreshAria: "Refresh usage",
635
641
  usageChipLabel: "Context {{percent}}%",
636
642
  usageTooltipLabel: "Context usage",
637
643
  usagePopoverTitle: "Context Usage",
@@ -3178,6 +3184,12 @@ var zhCN = {
3178
3184
  slashStatusContextValue: "{{percentLeft}}% \u5269\u4F59\uFF08\u5DF2\u7528 {{usedTokens}} / {{totalTokens}}\uFF09",
3179
3185
  slashStatusContextUnavailable: "\u4E0A\u4E0B\u6587\u7528\u91CF\u4E0D\u53EF\u7528",
3180
3186
  slashStatusLimitsUnavailable: "\u5F53\u524D Agent \u672A\u63D0\u4F9B\u989D\u5EA6\u9650\u5236",
3187
+ slashStatusUsageJustUpdated: "\u521A\u521A\u66F4\u65B0",
3188
+ slashStatusUsageMinutesAgo: "{{count}} \u5206\u949F\u524D\u66F4\u65B0",
3189
+ slashStatusUsageHoursAgo: "{{count}} \u5C0F\u65F6\u524D\u66F4\u65B0",
3190
+ slashStatusUsageUpdating: "\u66F4\u65B0\u4E2D\u2026",
3191
+ slashStatusUsageRefreshFailed: "\u5237\u65B0\u5931\u8D25",
3192
+ slashStatusUsageRefreshAria: "\u5237\u65B0\u989D\u5EA6\u7528\u91CF",
3181
3193
  usageChipLabel: "\u4E0A\u4E0B\u6587 {{percent}}%",
3182
3194
  usageTooltipLabel: "\u4E0A\u4E0B\u6587\u7528\u91CF",
3183
3195
  usagePopoverTitle: "\u4E0A\u4E0B\u6587\u7528\u91CF",
@@ -5153,4 +5165,4 @@ export {
5153
5165
  translateInUiLanguage,
5154
5166
  getActiveUiLanguage
5155
5167
  };
5156
- //# sourceMappingURL=chunk-MA254MXR.js.map
5168
+ //# sourceMappingURL=chunk-3QPN2Y7R.js.map