@tutti-os/agent-gui 0.0.67 → 0.0.69

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 (89) 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-BipgG2ib.d.ts} +9 -1
  7. package/dist/app/renderer/agentactivity.css +107 -9
  8. package/dist/app/renderer/assets/icons/agents/opencode-flat-filled.svg +4 -0
  9. package/dist/app/renderer/assets/icons/agents/opencode-rounded.png +0 -0
  10. package/dist/app/renderer/assets/icons/agents/provider-rail-opencode-colorful.png +0 -0
  11. package/dist/{chunk-OEJQJP65.js → chunk-4I2VCAMW.js} +14 -1
  12. package/dist/chunk-4I2VCAMW.js.map +1 -0
  13. package/dist/{chunk-IL2ORY23.js → chunk-4US2YHBY.js} +3 -1
  14. package/dist/chunk-4US2YHBY.js.map +1 -0
  15. package/dist/{chunk-JGU2VMDA.js → chunk-547R2HOD.js} +3 -3
  16. package/dist/{chunk-PFKY5W76.js → chunk-6XRTDIDR.js} +13 -28
  17. package/dist/chunk-6XRTDIDR.js.map +1 -0
  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-CTYXJGSW.js → chunk-DAPKF2SN.js} +3 -3
  23. package/dist/{chunk-XBR7D7X2.js → chunk-EHLJL76A.js} +2 -2
  24. package/dist/{chunk-YYAP6IK7.js → chunk-ERBUQOIL.js} +3 -3
  25. package/dist/{chunk-UAXKJNM2.js → chunk-FRAG4UFU.js} +74 -24
  26. package/dist/chunk-FRAG4UFU.js.map +1 -0
  27. package/dist/{chunk-YU3XLPLC.js → chunk-HAKNLXW7.js} +2 -2
  28. package/dist/{chunk-QZYGCZNQ.js → chunk-JA6Z3QA7.js} +4 -4
  29. package/dist/{chunk-MA254MXR.js → chunk-KAPBUKIT.js} +33 -15
  30. package/dist/chunk-KAPBUKIT.js.map +1 -0
  31. package/dist/{chunk-JWWHS34V.js → chunk-KTIHLBCN.js} +12 -3
  32. package/dist/chunk-KTIHLBCN.js.map +1 -0
  33. package/dist/{chunk-ZABN3POD.js → chunk-KTIKZNGS.js} +6 -2
  34. package/dist/chunk-KTIKZNGS.js.map +1 -0
  35. package/dist/{chunk-SKWDZTEV.js → chunk-N37A62BK.js} +21 -1
  36. package/dist/chunk-N37A62BK.js.map +1 -0
  37. package/dist/{chunk-KS4ULVGM.js → chunk-NH3XBJTZ.js} +2 -2
  38. package/dist/{chunk-DQTBWOIK.js → chunk-NROZAN34.js} +16 -4
  39. package/dist/chunk-NROZAN34.js.map +1 -0
  40. package/dist/{chunk-VIJQ5C33.js → chunk-S32FLJRP.js} +5 -5
  41. package/dist/{chunk-DP2X4J2D.js → chunk-UAAXRSW2.js} +3 -3
  42. package/dist/{chunk-BX4UBTOI.js → chunk-ZZBLWZJR.js} +12 -6
  43. package/dist/chunk-ZZBLWZJR.js.map +1 -0
  44. package/dist/context-mention-palette/index.js +9 -9
  45. package/dist/i18n/index.d.ts +32 -14
  46. package/dist/i18n/index.js +2 -2
  47. package/dist/index.d.ts +22 -6
  48. package/dist/index.js +1895 -998
  49. package/dist/index.js.map +1 -1
  50. package/dist/opencode-flat-filled-CYAJPX45.svg +4 -0
  51. package/dist/queued-prompt-runtime.d.ts +2 -2
  52. package/dist/{types-BxOwnK7K.d.ts → types-DZ79b8Zn.d.ts} +8 -3
  53. package/dist/workbench/contribution.d.ts +1 -1
  54. package/dist/workbench/contribution.js +8 -8
  55. package/dist/workbench/index.d.ts +3 -2
  56. package/dist/workbench/index.js +11 -11
  57. package/dist/workbench/launch.d.ts +1 -1
  58. package/dist/workbench/launch.js +3 -3
  59. package/dist/workbench/providerCatalog.d.ts +3 -3
  60. package/dist/workbench/providerCatalog.js +1 -1
  61. package/dist/workbench/sessionTitle.d.ts +1 -1
  62. package/dist/workbench/sessionTitle.js +3 -3
  63. package/dist/workbench/state.d.ts +11 -2
  64. package/dist/workbench/state.js +5 -3
  65. package/dist/workbench/types.d.ts +2 -2
  66. package/dist/workbench/types.js +1 -1
  67. package/dist/workspace-agent-generated-files.js +4 -4
  68. package/package.json +12 -12
  69. package/dist/chunk-BX4UBTOI.js.map +0 -1
  70. package/dist/chunk-DQTBWOIK.js.map +0 -1
  71. package/dist/chunk-IL2ORY23.js.map +0 -1
  72. package/dist/chunk-JWWHS34V.js.map +0 -1
  73. package/dist/chunk-MA254MXR.js.map +0 -1
  74. package/dist/chunk-NCAVJEHI.js.map +0 -1
  75. package/dist/chunk-OEJQJP65.js.map +0 -1
  76. package/dist/chunk-PFKY5W76.js.map +0 -1
  77. package/dist/chunk-RNFP7CUO.js.map +0 -1
  78. package/dist/chunk-SKWDZTEV.js.map +0 -1
  79. package/dist/chunk-UAXKJNM2.js.map +0 -1
  80. package/dist/chunk-ZABN3POD.js.map +0 -1
  81. /package/dist/{chunk-JGU2VMDA.js.map → chunk-547R2HOD.js.map} +0 -0
  82. /package/dist/{chunk-CTYXJGSW.js.map → chunk-DAPKF2SN.js.map} +0 -0
  83. /package/dist/{chunk-XBR7D7X2.js.map → chunk-EHLJL76A.js.map} +0 -0
  84. /package/dist/{chunk-YYAP6IK7.js.map → chunk-ERBUQOIL.js.map} +0 -0
  85. /package/dist/{chunk-YU3XLPLC.js.map → chunk-HAKNLXW7.js.map} +0 -0
  86. /package/dist/{chunk-QZYGCZNQ.js.map → chunk-JA6Z3QA7.js.map} +0 -0
  87. /package/dist/{chunk-KS4ULVGM.js.map → chunk-NH3XBJTZ.js.map} +0 -0
  88. /package/dist/{chunk-VIJQ5C33.js.map → chunk-S32FLJRP.js.map} +0 -0
  89. /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-BipgG2ib.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-DZ79b8Zn.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-6XRTDIDR.js";
10
+ import "../chunk-DAPKF2SN.js";
11
11
  import "../chunk-PSLAWU25.js";
12
- import "../chunk-JGU2VMDA.js";
12
+ import "../chunk-547R2HOD.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-NH3XBJTZ.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-KAPBUKIT.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;A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AAI,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
+ {"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;A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,IACA,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf,QAAQ,MAAM;AAAA,EAChB,CAAC;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-EHLJL76A.js";
4
4
  import {
5
5
  AgentInteractivePromptSurface,
6
6
  approvalOptionDisplayLabel,
7
7
  getPromptToolDetails,
8
8
  isPromptRequestIdTitle
9
- } from "../chunk-QZYGCZNQ.js";
9
+ } from "../chunk-JA6Z3QA7.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-KTIKZNGS.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-DAPKF2SN.js";
29
29
  import {
30
30
  userAvatarPlaceholderUrl,
31
31
  workspaceAgentActivityStatusLabel
32
- } from "../chunk-YU3XLPLC.js";
32
+ } from "../chunk-HAKNLXW7.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-NH3XBJTZ.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-KAPBUKIT.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 { j as AgentHostAgentSessionCommand, k as AgentHostAgentSessionComposerSettings, m as AgentHostAgentSessionReasoningEffort, n as AgentHostAgentSessionSpeed, l as AgentHostAgentSessionPermissionConfig, o as AgentHostAgentSessionState, a as AgentGUIProvider, r as AgentPromptContentBlock, A as AgentGUINodeData, f as AgentGUIProviderTarget, b as AgentGUIProviderRailMode, c as AgentGUIProviderReadinessGate } from './types-DZ79b8Zn.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';
@@ -520,10 +520,17 @@ interface AgentComposerDraftFile {
520
520
  uploading?: boolean;
521
521
  uploadError?: string;
522
522
  }
523
+ interface AgentComposerDraftLargeText {
524
+ id: string;
525
+ name: string;
526
+ text: string;
527
+ sizeBytes?: number;
528
+ }
523
529
  interface AgentComposerDraft {
524
530
  prompt: string;
525
531
  images: AgentComposerDraftImage[];
526
532
  files?: AgentComposerDraftFile[];
533
+ largeTexts?: AgentComposerDraftLargeText[];
527
534
  }
528
535
  interface AgentGUIComposerSettingsVM {
529
536
  sessionSettings: AgentSessionComposerSettings | null;
@@ -557,6 +564,7 @@ interface AgentGUIComposerSettingsVM {
557
564
  permissionConfig?: AgentSessionPermissionConfig | null;
558
565
  selectedProjectPath?: string | null;
559
566
  projectLocked?: boolean;
567
+ projectPathIsRemote?: boolean;
560
568
  modelListCollapsedToLatest?: boolean;
561
569
  availableModels: AgentGUIComposerSettingOption[];
562
570
  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
  }
@@ -4312,13 +4312,20 @@ aside.workspace-agents-status-panel
4312
4312
  overflow: hidden;
4313
4313
  }
4314
4314
 
4315
- .workbench-window:has([data-agent-gui-workbench-header="true"])
4316
- .agent-gui-node__rail-toolbar,
4317
4315
  .workbench-window:has([data-agent-gui-workbench-header="true"])
4318
4316
  .agent-gui-node__provider-rail-panel {
4319
4317
  padding-top: var(--agent-gui-workbench-header-height);
4320
4318
  }
4321
4319
 
4320
+ /* The provider rail nests the workbench-header offset on the panel and the 2px
4321
+ breathing room on the inner rail, so the "All" tile sits at header + 2px. The
4322
+ toolbar has no such wrapper, so fold the same 2px into its offset to keep the
4323
+ search field top aligned with the provider tiles. */
4324
+ .workbench-window:has([data-agent-gui-workbench-header="true"])
4325
+ .agent-gui-node__rail-toolbar {
4326
+ padding-top: calc(var(--agent-gui-workbench-header-height) + 2px);
4327
+ }
4328
+
4322
4329
  .workbench-window:has([data-agent-gui-workbench-header="true"])
4323
4330
  .agent-gui-node__detail-panel {
4324
4331
  position: relative;
@@ -4419,7 +4426,7 @@ aside.workspace-agents-status-panel
4419
4426
  user-select: none;
4420
4427
  }
4421
4428
 
4422
- .agent-gui-workbench-header::after {
4429
+ .agent-gui-workbench-header[data-agent-gui-workbench-header-has-session="true"]::after {
4423
4430
  position: absolute;
4424
4431
  right: 0;
4425
4432
  bottom: 0;
@@ -4605,6 +4612,21 @@ aside.workspace-agents-status-panel
4605
4612
  border-radius: 5px;
4606
4613
  }
4607
4614
 
4615
+ .agent-gui-workbench-header__session-icon--pending {
4616
+ background: var(--transparency-block);
4617
+ animation: agent-gui-workbench-header-icon-pending 1.2s ease-in-out infinite;
4618
+ }
4619
+
4620
+ @keyframes agent-gui-workbench-header-icon-pending {
4621
+ 0%,
4622
+ 100% {
4623
+ opacity: 0.6;
4624
+ }
4625
+ 50% {
4626
+ opacity: 1;
4627
+ }
4628
+ }
4629
+
4608
4630
  .agent-gui-workbench-header__detail-title {
4609
4631
  display: flex;
4610
4632
  height: 100%;
@@ -4861,7 +4883,7 @@ aside.workspace-agents-status-panel
4861
4883
  align-items: center;
4862
4884
  gap: 10px;
4863
4885
  min-width: 0;
4864
- padding: 0 16px 16px;
4886
+ padding: 2px 16px 16px;
4865
4887
  }
4866
4888
 
4867
4889
  .agent-gui-node__project-rail-header {
@@ -8409,7 +8431,7 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8409
8431
  flex: 1 1 auto;
8410
8432
  flex-direction: column;
8411
8433
  align-items: center;
8412
- padding: 0 0 12px;
8434
+ padding: 2px 0 12px;
8413
8435
  overflow-x: hidden;
8414
8436
  overflow-y: auto;
8415
8437
  mask-image: linear-gradient(
@@ -8473,6 +8495,7 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8473
8495
  }
8474
8496
 
8475
8497
  .agent-gui-node__provider-rail-tile {
8498
+ position: relative;
8476
8499
  display: grid;
8477
8500
  width: 52px;
8478
8501
  min-width: 0;
@@ -8487,9 +8510,21 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8487
8510
  font-weight: 600;
8488
8511
  line-height: 14px;
8489
8512
  text-align: center;
8513
+ transition:
8514
+ color 120ms ease,
8515
+ margin 140ms ease,
8516
+ opacity 140ms ease;
8490
8517
  -webkit-app-region: no-drag;
8491
8518
  }
8492
8519
 
8520
+ .agent-gui-node__provider-rail-tile[draggable="true"] {
8521
+ cursor: grab;
8522
+ }
8523
+
8524
+ .agent-gui-node__provider-rail-tile[draggable="true"]:active {
8525
+ cursor: grabbing;
8526
+ }
8527
+
8493
8528
  .agent-gui-node__provider-rail-tile + .agent-gui-node__provider-rail-tile {
8494
8529
  margin-top: 12px;
8495
8530
  }
@@ -8517,6 +8552,38 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8517
8552
  opacity: 0.3;
8518
8553
  }
8519
8554
 
8555
+ .agent-gui-node__provider-rail-tile[data-dragging="true"] {
8556
+ opacity: 0.42;
8557
+ }
8558
+
8559
+ .agent-gui-node__provider-rail-tile[data-drag-over="before"] {
8560
+ margin-top: 24px;
8561
+ }
8562
+
8563
+ .agent-gui-node__provider-rail-tile[data-drag-over="after"] {
8564
+ margin-bottom: 12px;
8565
+ }
8566
+
8567
+ .agent-gui-node__provider-rail-tile[data-drag-over="before"]::before,
8568
+ .agent-gui-node__provider-rail-tile[data-drag-over="after"]::after {
8569
+ content: "";
8570
+ position: absolute;
8571
+ left: 12px;
8572
+ right: 12px;
8573
+ height: 2px;
8574
+ border-radius: 999px;
8575
+ background: var(--brand-primary, var(--tutti-purple));
8576
+ pointer-events: none;
8577
+ }
8578
+
8579
+ .agent-gui-node__provider-rail-tile[data-drag-over="before"]::before {
8580
+ top: -13px;
8581
+ }
8582
+
8583
+ .agent-gui-node__provider-rail-tile[data-drag-over="after"]::after {
8584
+ bottom: -13px;
8585
+ }
8586
+
8520
8587
  .agent-gui-node__provider-rail-separator {
8521
8588
  display: block;
8522
8589
  width: 28px;
@@ -8531,6 +8598,7 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8531
8598
  }
8532
8599
 
8533
8600
  .agent-gui-node__provider-rail-avatar {
8601
+ position: relative;
8534
8602
  box-sizing: border-box;
8535
8603
  display: grid;
8536
8604
  width: 32px;
@@ -8550,7 +8618,7 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8550
8618
 
8551
8619
  .agent-gui-node__provider-rail-tile:not([data-selected="true"])
8552
8620
  .agent-gui-node__provider-rail-avatar {
8553
- opacity: 0.5;
8621
+ opacity: 0.38;
8554
8622
  }
8555
8623
 
8556
8624
  .agent-gui-node__provider-rail-tile:hover:not(:disabled)
@@ -8566,7 +8634,8 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8566
8634
  .agent-gui-node__provider-rail-tile[data-selected="true"]
8567
8635
  .agent-gui-node__provider-rail-avatar {
8568
8636
  border-color: var(--brand-primary, var(--tutti-purple));
8569
- background: transparent;
8637
+ background: color-mix(in srgb, var(--background-fronted) 80%, white);
8638
+ box-shadow: 0 0 0 1px color-mix(in srgb, white 45%, transparent);
8570
8639
  color: var(--brand-primary, var(--tutti-purple));
8571
8640
  }
8572
8641
 
@@ -8605,6 +8674,28 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8605
8674
  object-fit: contain;
8606
8675
  }
8607
8676
 
8677
+ .agent-gui-node__provider-rail-badge {
8678
+ position: absolute;
8679
+ right: -4px;
8680
+ bottom: -4px;
8681
+ box-sizing: border-box;
8682
+ display: grid;
8683
+ width: 16px;
8684
+ height: 16px;
8685
+ place-items: center;
8686
+ overflow: hidden;
8687
+ border: 1px solid #fff;
8688
+ border-radius: 999px;
8689
+ background: #fff;
8690
+ pointer-events: none;
8691
+ }
8692
+
8693
+ .agent-gui-node__provider-rail-badge-image {
8694
+ width: 100%;
8695
+ height: 100%;
8696
+ object-fit: cover;
8697
+ }
8698
+
8608
8699
  .agent-gui-node__provider-rail-launchpad-icon {
8609
8700
  box-sizing: border-box;
8610
8701
  display: grid;
@@ -8706,6 +8797,13 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8706
8797
  justify-items: center;
8707
8798
  }
8708
8799
 
8800
+ .agent-gui-node__empty-hero-icon-slot {
8801
+ display: grid;
8802
+ width: 54px;
8803
+ height: 54px;
8804
+ place-items: center;
8805
+ }
8806
+
8709
8807
  .agent-gui-node__empty-hero-icon-effect {
8710
8808
  display: block;
8711
8809
  width: 48px;
@@ -8791,7 +8889,7 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8791
8889
 
8792
8890
  .agent-gui-node__empty-provider-gate {
8793
8891
  max-width: 520px;
8794
- gap: 14px;
8892
+ gap: 8px;
8795
8893
  }
8796
8894
 
8797
8895
  .agent-gui-node__empty-provider-gate > .agent-gui-node__empty-hero-icon-effect {
@@ -0,0 +1,4 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M3.41382 0.991348C3.8204 1.02608 4.73175 1.00009 5.1687 1.00014H8.70679L20.2244 1.00209L20.2205 22.9904L9.71069 22.9757H5.87476C5.06579 22.9757 4.22438 22.9637 3.4187 22.9913C3.38439 22.0528 3.40898 20.9887 3.40894 20.0402V14.632L3.41382 0.991348ZM7.29272 4.87807C7.28438 6.53493 7.27638 8.21526 7.29272 9.87123L7.29663 19.0988C8.53026 19.1177 9.7903 19.1055 11.0261 19.1056L16.3337 19.0997L16.3347 14.004C16.3345 12.4565 16.3505 10.8828 16.3337 9.33803C16.3388 7.86364 16.3492 6.34738 16.3337 4.87416L7.29272 4.87807Z" fill="black"/>
3
+ <rect opacity="0.3" x="7.28322" y="10.0502" width="9.05882" height="9.05882" fill="black"/>
4
+ </svg>