@tutti-os/agent-gui 0.0.63 → 0.0.64

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 (88) hide show
  1. package/dist/agent-conversation/index.d.ts +2 -2
  2. package/dist/agent-conversation/index.js +7 -7
  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 +9 -9
  6. package/dist/{agentGuiNodeTypes-CC52zXAV.d.ts → agentGuiNodeTypes-CCjzXdTe.d.ts} +4 -1
  7. package/dist/app/renderer/agentactivity.css +38 -4
  8. package/dist/app/renderer/assets/icons/agents/agent-colorful.png +0 -0
  9. package/dist/app/renderer/assets/icons/agents/cursor-colorful.png +0 -0
  10. package/dist/app/renderer/assets/icons/agents/cursor-flat-filled.svg +3 -0
  11. package/dist/app/renderer/assets/icons/agents/cursor-rounded.png +0 -0
  12. package/dist/{chunk-IIVHPXAB.js → chunk-2IMBPRKV.js} +1 -1
  13. package/dist/chunk-2IMBPRKV.js.map +1 -0
  14. package/dist/{chunk-4UTWOSHP.js → chunk-3NSUJ7OF.js} +5 -1
  15. package/dist/chunk-3NSUJ7OF.js.map +1 -0
  16. package/dist/{chunk-SGXYVGQT.js → chunk-52VZ54WH.js} +5 -5
  17. package/dist/{chunk-CVSCZ3CK.js → chunk-76GTKO4Q.js} +7 -2
  18. package/dist/chunk-76GTKO4Q.js.map +1 -0
  19. package/dist/{chunk-G6UO6JVM.js → chunk-C465B7WK.js} +2 -2
  20. package/dist/{chunk-22L4VWUR.js → chunk-CKCUEHBW.js} +3 -1
  21. package/dist/chunk-CKCUEHBW.js.map +1 -0
  22. package/dist/{chunk-FRCIPTUD.js → chunk-ERWDRI3F.js} +8 -18
  23. package/dist/chunk-ERWDRI3F.js.map +1 -0
  24. package/dist/{chunk-6MUKWI6Z.js → chunk-F6GDUU4X.js} +167 -113
  25. package/dist/chunk-F6GDUU4X.js.map +1 -0
  26. package/dist/{chunk-FQQDBBNI.js → chunk-FLTLZGIN.js} +3 -3
  27. package/dist/{chunk-5WB3NGIN.js → chunk-FUJ73PTH.js} +29 -2
  28. package/dist/chunk-FUJ73PTH.js.map +1 -0
  29. package/dist/{chunk-RO6KQD3J.js → chunk-IIXCU2UU.js} +2 -2
  30. package/dist/{chunk-CA25GD5Q.js → chunk-MQ6RKXXW.js} +34 -4
  31. package/dist/chunk-MQ6RKXXW.js.map +1 -0
  32. package/dist/{chunk-NZN43XT5.js → chunk-PVVM7MZZ.js} +8 -6
  33. package/dist/chunk-PVVM7MZZ.js.map +1 -0
  34. package/dist/{chunk-V4JGVBUN.js → chunk-R2NGSPQS.js} +32 -1
  35. package/dist/chunk-R2NGSPQS.js.map +1 -0
  36. package/dist/{chunk-QC642RAG.js → chunk-RDRKIMAC.js} +15 -8
  37. package/dist/chunk-RDRKIMAC.js.map +1 -0
  38. package/dist/{chunk-ZUVEBW5T.js → chunk-TFPKI4XJ.js} +2 -2
  39. package/dist/{chunk-SW6JCJCO.js → chunk-TT2YJNEP.js} +3 -3
  40. package/dist/{chunk-K4UUEG7X.js → chunk-YFTQK2G4.js} +113 -34
  41. package/dist/chunk-YFTQK2G4.js.map +1 -0
  42. package/dist/{chunk-3KS22CG2.js → chunk-YUMHFZ5A.js} +3 -3
  43. package/dist/{chunk-7P6CUYQT.js → chunk-ZTZ6STJZ.js} +2 -2
  44. package/dist/context-mention-palette/index.js +8 -8
  45. package/dist/cursor-flat-filled-CL7N3BTZ.svg +3 -0
  46. package/dist/i18n/index.d.ts +33 -3
  47. package/dist/i18n/index.js +2 -2
  48. package/dist/index.d.ts +7 -5
  49. package/dist/index.js +666 -214
  50. package/dist/index.js.map +1 -1
  51. package/dist/queued-prompt-runtime.d.ts +2 -2
  52. package/dist/{types-DSc2ta3s.d.ts → types-BAPEle8b.d.ts} +3 -3
  53. package/dist/workbench/contribution.d.ts +10 -3
  54. package/dist/workbench/contribution.js +10 -8
  55. package/dist/workbench/index.d.ts +4 -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 +2 -2
  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 +1 -1
  64. package/dist/workbench/state.js +3 -3
  65. package/dist/workbench/types.d.ts +3 -2
  66. package/dist/workbench/types.js +1 -1
  67. package/dist/workspace-agent-generated-files.js +3 -3
  68. package/package.json +12 -12
  69. package/dist/chunk-22L4VWUR.js.map +0 -1
  70. package/dist/chunk-4UTWOSHP.js.map +0 -1
  71. package/dist/chunk-5WB3NGIN.js.map +0 -1
  72. package/dist/chunk-6MUKWI6Z.js.map +0 -1
  73. package/dist/chunk-CA25GD5Q.js.map +0 -1
  74. package/dist/chunk-CVSCZ3CK.js.map +0 -1
  75. package/dist/chunk-FRCIPTUD.js.map +0 -1
  76. package/dist/chunk-IIVHPXAB.js.map +0 -1
  77. package/dist/chunk-K4UUEG7X.js.map +0 -1
  78. package/dist/chunk-NZN43XT5.js.map +0 -1
  79. package/dist/chunk-QC642RAG.js.map +0 -1
  80. package/dist/chunk-V4JGVBUN.js.map +0 -1
  81. /package/dist/{chunk-SGXYVGQT.js.map → chunk-52VZ54WH.js.map} +0 -0
  82. /package/dist/{chunk-G6UO6JVM.js.map → chunk-C465B7WK.js.map} +0 -0
  83. /package/dist/{chunk-FQQDBBNI.js.map → chunk-FLTLZGIN.js.map} +0 -0
  84. /package/dist/{chunk-RO6KQD3J.js.map → chunk-IIXCU2UU.js.map} +0 -0
  85. /package/dist/{chunk-ZUVEBW5T.js.map → chunk-TFPKI4XJ.js.map} +0 -0
  86. /package/dist/{chunk-SW6JCJCO.js.map → chunk-TT2YJNEP.js.map} +0 -0
  87. /package/dist/{chunk-3KS22CG2.js.map → chunk-YUMHFZ5A.js.map} +0 -0
  88. /package/dist/{chunk-7P6CUYQT.js.map → chunk-ZTZ6STJZ.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-CC52zXAV.js';
7
+ import { c as AgentGUIProviderSkillOption } from '../agentGuiNodeTypes-CCjzXdTe.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-DSc2ta3s.js';
11
+ import '../types-BAPEle8b.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-6MUKWI6Z.js";
10
- import "../chunk-SW6JCJCO.js";
9
+ } from "../chunk-F6GDUU4X.js";
10
+ import "../chunk-TT2YJNEP.js";
11
11
  import "../chunk-PSLAWU25.js";
12
- import "../chunk-FQQDBBNI.js";
12
+ import "../chunk-FLTLZGIN.js";
13
13
  import "../chunk-Y35GDLP2.js";
14
14
  import "../chunk-LUGELG5V.js";
15
- import "../chunk-FRCIPTUD.js";
15
+ import "../chunk-ERWDRI3F.js";
16
16
  import "../chunk-TYGL25EL.js";
17
17
  import {
18
18
  translate
19
- } from "../chunk-RO6KQD3J.js";
19
+ } from "../chunk-IIXCU2UU.js";
20
20
  import "../chunk-PJP5BUU6.js";
21
- import "../chunk-V4JGVBUN.js";
22
- import "../chunk-CA25GD5Q.js";
21
+ import "../chunk-R2NGSPQS.js";
22
+ import "../chunk-MQ6RKXXW.js";
23
23
 
24
24
  // shared/WorkspaceAgentSessionDetail.tsx
25
25
  import { useMemo } from "react";
@@ -206,7 +206,8 @@ function autoStartCandidate(focus) {
206
206
  // shared/agentEnv/agentEnvViewModel.ts
207
207
  var MANUAL_INSTALL_COMMANDS = {
208
208
  codex: "npm install -g @openai/codex --include=optional",
209
- "claude-code": "curl -fsSL https://claude.ai/install.sh | bash"
209
+ "claude-code": "curl -fsSL https://claude.ai/install.sh | bash",
210
+ cursor: "curl https://cursor.com/install -fsS | bash"
210
211
  };
211
212
  function endpointHost(endpoint) {
212
213
  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 };\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;AAA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ACN,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 };\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,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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-G6UO6JVM.js";
3
+ } from "../chunk-C465B7WK.js";
4
4
  import {
5
5
  AgentInteractivePromptSurface,
6
6
  approvalOptionDisplayLabel,
7
7
  getPromptToolDetails,
8
8
  isPromptRequestIdTitle
9
- } from "../chunk-QC642RAG.js";
9
+ } from "../chunk-RDRKIMAC.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-CVSCZ3CK.js";
18
+ } from "../chunk-76GTKO4Q.js";
19
19
  import {
20
20
  AgentMessageMarkdown,
21
21
  CustomScrollArea,
@@ -25,17 +25,17 @@ import {
25
25
  extractExitPlanModeOptions,
26
26
  isExitPlanSwitchModeInput,
27
27
  normalizeAskUserQuestions
28
- } from "../chunk-SW6JCJCO.js";
28
+ } from "../chunk-TT2YJNEP.js";
29
29
  import {
30
30
  userAvatarPlaceholderUrl,
31
31
  workspaceAgentActivityStatusLabel
32
- } from "../chunk-ZUVEBW5T.js";
32
+ } from "../chunk-TFPKI4XJ.js";
33
33
  import {
34
34
  resolveWorkspaceAgentSessionSortTimeUnixMs
35
35
  } from "../chunk-IBIMGLCD.js";
36
36
  import {
37
37
  managedAgentRoundedIconUrl
38
- } from "../chunk-FRCIPTUD.js";
38
+ } from "../chunk-ERWDRI3F.js";
39
39
  import {
40
40
  workspaceAgentProviderLabel
41
41
  } from "../chunk-TYGL25EL.js";
@@ -43,10 +43,10 @@ import {
43
43
  AgentGuiI18nProvider,
44
44
  getActiveUiLanguage,
45
45
  useTranslation
46
- } from "../chunk-RO6KQD3J.js";
46
+ } from "../chunk-IIXCU2UU.js";
47
47
  import "../chunk-PJP5BUU6.js";
48
- import "../chunk-V4JGVBUN.js";
49
- import "../chunk-CA25GD5Q.js";
48
+ import "../chunk-R2NGSPQS.js";
49
+ import "../chunk-MQ6RKXXW.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 { h as AgentHostAgentSessionCommand, i as AgentHostAgentSessionComposerSettings, k as AgentHostAgentSessionReasoningEffort, l as AgentHostAgentSessionSpeed, j as AgentHostAgentSessionPermissionConfig, m as AgentHostAgentSessionState, a as AgentGUIProvider, p as AgentPromptContentBlock, A as AgentGUINodeData, e as AgentGUIProviderTarget, b as AgentGUIProviderReadinessGate } from './types-DSc2ta3s.js';
2
+ import { h as AgentHostAgentSessionCommand, i as AgentHostAgentSessionComposerSettings, k as AgentHostAgentSessionReasoningEffort, l as AgentHostAgentSessionSpeed, j as AgentHostAgentSessionPermissionConfig, m as AgentHostAgentSessionState, a as AgentGUIProvider, p as AgentPromptContentBlock, A as AgentGUINodeData, e as AgentGUIProviderTarget, b as AgentGUIProviderReadinessGate } from './types-BAPEle8b.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
+ modelListCollapsedToLatest?: boolean;
560
561
  availableModels: AgentGUIComposerSettingOption[];
561
562
  availableReasoningEfforts: AgentGUIComposerSettingOption[];
562
563
  availableSpeeds: AgentGUIComposerSettingOption[];
@@ -577,6 +578,8 @@ interface AgentGUINodeViewModel {
577
578
  selectedProviderTarget: AgentGUIProviderTarget;
578
579
  providerTargets: readonly AgentGUIProviderTarget[];
579
580
  providerTargetsLoading: boolean;
581
+ /** Providers gated by the host (feature-gated) — rail renders coming-soon placeholders. */
582
+ comingSoonProviders: readonly AgentGUIProvider[];
580
583
  conversationFilter: AgentGUIConversationFilter;
581
584
  conversations: AgentGUIConversationSummary[];
582
585
  userProjects: AgentGUIConversationUserProject[];
@@ -3320,13 +3320,13 @@ aside.workspace-agents-status-panel
3320
3320
  width: 100%;
3321
3321
  min-height: 72px;
3322
3322
  border: 1px solid var(--line-2);
3323
- border-radius: 14px;
3323
+ border-radius: 8px;
3324
3324
  background: var(--background-fronted);
3325
3325
  color: var(--text-primary);
3326
3326
  font: inherit;
3327
3327
  font-size: 13px;
3328
3328
  line-height: 1.5;
3329
- padding: 12px 14px;
3329
+ padding: 12px;
3330
3330
  resize: vertical;
3331
3331
  }
3332
3332
 
@@ -3405,7 +3405,8 @@ aside.workspace-agents-status-panel
3405
3405
  gap: 8px;
3406
3406
  }
3407
3407
 
3408
- .agent-gui-conversation__interactive-prompt-actions button {
3408
+ .agent-gui-conversation__interactive-prompt-actions
3409
+ button:not([data-slot="button"]) {
3409
3410
  min-height: 30px;
3410
3411
  border: 1px solid var(--line-2);
3411
3412
  border-radius: 999px;
@@ -3417,7 +3418,8 @@ aside.workspace-agents-status-panel
3417
3418
  padding: 6px 12px;
3418
3419
  }
3419
3420
 
3420
- .agent-gui-conversation__interactive-prompt-actions button:disabled {
3421
+ .agent-gui-conversation__interactive-prompt-actions
3422
+ button:not([data-slot="button"]):disabled {
3421
3423
  cursor: not-allowed;
3422
3424
  background: var(--transparency-block);
3423
3425
  color: var(--text-disabled);
@@ -4370,6 +4372,20 @@ aside.workspace-agents-status-panel
4370
4372
  object-position: center;
4371
4373
  }
4372
4374
 
4375
+ .agent-gui-workbench-dock-icon--single {
4376
+ display: block;
4377
+ padding: 0;
4378
+ border: 0;
4379
+ background: transparent;
4380
+ }
4381
+
4382
+ .agent-gui-workbench-dock-icon--single > img {
4383
+ display: block;
4384
+ width: 100%;
4385
+ height: 100%;
4386
+ object-fit: contain;
4387
+ }
4388
+
4373
4389
  .agent-gui-workbench-header {
4374
4390
  --agent-gui-workbench-header-rail-width: 280px;
4375
4391
  --agent-gui-workbench-header-padding-x: 16px;
@@ -4420,6 +4436,7 @@ aside.workspace-agents-status-panel
4420
4436
 
4421
4437
  .agent-gui-workbench-header[data-agent-gui-workbench-header-collapsed="true"]
4422
4438
  .agent-gui-workbench-header__primary {
4439
+ grid-column: 1 / -1;
4423
4440
  width: min(100%, 720px);
4424
4441
  background: transparent;
4425
4442
  }
@@ -4556,6 +4573,15 @@ aside.workspace-agents-status-panel
4556
4573
  flex: 1 1 auto;
4557
4574
  max-width: min(100%, var(--agent-gui-workbench-header-title-max-width));
4558
4575
  margin-left: 4px;
4576
+ align-items: center;
4577
+ gap: 8px;
4578
+ }
4579
+
4580
+ .agent-gui-workbench-header__session-icon {
4581
+ width: 20px;
4582
+ height: 20px;
4583
+ flex: 0 0 auto;
4584
+ border-radius: 5px;
4559
4585
  }
4560
4586
 
4561
4587
  .agent-gui-workbench-header__detail-title {
@@ -8359,6 +8385,14 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8359
8385
  margin-top: 12px;
8360
8386
  }
8361
8387
 
8388
+ .agent-gui-node__provider-rail-tile-label {
8389
+ max-width: 100%;
8390
+ margin-top: 4px;
8391
+ overflow: hidden;
8392
+ white-space: nowrap;
8393
+ text-overflow: ellipsis;
8394
+ }
8395
+
8362
8396
  .agent-gui-node__provider-rail-tile:has(
8363
8397
  + .agent-gui-node__provider-rail-separator
8364
8398
  ) {
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M11.6938 1.10116C11.8436 1.07739 12.2047 1.20319 12.3256 1.27792C13.6093 2.07185 20.4975 5.75063 21.2211 6.50644C21.4804 7.31389 21.5087 16.4896 21.2211 17.3853C21.1677 17.5512 21.0501 17.6349 20.9145 17.732C19.9505 18.4215 18.8218 18.9741 17.7914 19.568C15.9244 20.6441 14.0655 21.7399 12.182 22.7867C12.0256 22.8329 11.8387 22.8879 11.6752 22.8844C11.2559 22.8754 2.71449 17.9184 2.24259 17.4273C2.22213 16.8742 2.2107 16.3135 2.21818 15.7603C2.25977 12.6902 2.14029 9.57721 2.24161 6.51132C2.69694 6.095 5.27095 4.64421 6.00528 4.23593C7.77292 3.25319 9.70198 2.02797 11.4799 1.108C11.5237 1.1053 11.6696 1.10474 11.6938 1.10116ZM8.39298 6.82577C7.44715 6.82998 3.72595 6.75303 3.08341 6.87167C3.377 7.20472 4.6331 7.88441 5.07657 8.13925L9.35196 10.5934C9.98708 10.9578 11.1863 11.6042 11.7455 12.0318L11.7436 18.5055C11.7436 19.6583 11.7074 21.0779 11.7729 22.2096C12.851 20.5502 14.0633 18.3 15.0707 16.5514L18.3627 10.8658C18.7576 10.1857 20.2944 7.64865 20.4311 7.06894C20.1775 6.80839 19.7582 6.81209 19.3949 6.81503C15.7403 6.84455 12.0423 6.80939 8.39298 6.82577Z" fill="black"/>
3
+ </svg>
@@ -6,4 +6,4 @@ export {
6
6
  agentGuiWorkbenchOpenSessionActivationType,
7
7
  agentGuiWorkbenchPrefillPromptActivationType
8
8
  };
9
- //# sourceMappingURL=chunk-IIVHPXAB.js.map
9
+ //# sourceMappingURL=chunk-2IMBPRKV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../workbench/types.ts"],"sourcesContent":["import type { AgentGUIProviderTargetRef } from \"../types\";\n\nexport type AgentGuiWorkbenchProvider =\n | \"claude-code\"\n | \"codex\"\n | \"cursor\"\n | \"nexight\"\n | \"gemini\"\n | \"hermes\"\n | \"openclaw\";\n\nexport const agentGuiWorkbenchOpenSessionActivationType =\n \"agent-gui:open-session\";\n\nexport const agentGuiWorkbenchPrefillPromptActivationType =\n \"agent-gui:prefill-prompt\";\n\nexport interface AgentGuiWorkbenchPrefillPromptPayload {\n agentTargetId?: string | null;\n autoSubmit?: boolean;\n draftPrompt: string;\n provider?: AgentGuiWorkbenchProvider;\n userProjectPath?: string | null;\n}\n\nexport interface AgentGuiWorkbenchComposerOverrides {\n model?: string | null;\n permissionModeId?: string | null;\n planMode?: boolean;\n reasoningEffort?: string | null;\n speed?: string | null;\n}\n\nexport type AgentGuiWorkbenchComposerOverridesByProvider = Partial<\n Record<AgentGuiWorkbenchProvider, AgentGuiWorkbenchComposerOverrides | null>\n>;\n\nexport type AgentGuiWorkbenchComposerOverridesByAgentTargetId = Record<\n string,\n AgentGuiWorkbenchComposerOverrides | null\n>;\n\nexport interface AgentGuiWorkbenchNodeState {\n agentTargetId?: string | null;\n composerOverrides?: AgentGuiWorkbenchComposerOverrides | null;\n composerOverridesByAgentTargetId?: AgentGuiWorkbenchComposerOverridesByAgentTargetId | null;\n composerOverridesByProvider?: AgentGuiWorkbenchComposerOverridesByProvider | null;\n conversationCount?: number | null;\n conversationRailCollapsed?: boolean | null;\n conversationRailWidthPx?: number | null;\n lastActiveAgentSessionId: string | null;\n /** @deprecated Conversation titles are derived from the active session id. */\n lastActiveConversationTitle?: string | null;\n provider: AgentGuiWorkbenchProvider;\n /** @deprecated Use agentTargetId for selection restore. */\n providerTargetId?: string | null;\n /** @deprecated Provider target refs are resolved from the current target list. */\n providerTargetRef?: AgentGUIProviderTargetRef | null;\n}\n\nexport interface AgentGuiWorkbenchState {\n agentTargetId?: string | null;\n conversationRailCollapsed?: boolean | null;\n conversationRailWidthPx?: number | null;\n lastActiveAgentSessionId: string | null;\n lastActiveConversationTitle?: string | null;\n}\n\nexport interface AgentGuiWorkbenchWorkspaceState {\n workspaceId: string;\n}\n"],"mappings":";AAWO,IAAM,6CACX;AAEK,IAAM,+CACX;","names":[]}
@@ -2,6 +2,7 @@
2
2
  var agentGUIProviderTargetStaticLabels = {
3
3
  "claude-code": "Claude Code",
4
4
  codex: "Codex",
5
+ cursor: "Cursor",
5
6
  gemini: "Gemini",
6
7
  hermes: "Hermes",
7
8
  nexight: "Tutti Agent",
@@ -10,6 +11,7 @@ var agentGUIProviderTargetStaticLabels = {
10
11
  var agentGUIDefaultTargetProviders = [
11
12
  "codex",
12
13
  "claude-code",
14
+ "cursor",
13
15
  "nexight",
14
16
  "hermes",
15
17
  "openclaw"
@@ -61,6 +63,8 @@ function localAgentGUIAgentTargetId(provider) {
61
63
  return "local:codex";
62
64
  case "claude-code":
63
65
  return "local:claude-code";
66
+ case "cursor":
67
+ return "local:cursor";
64
68
  case "hermes":
65
69
  return "local:hermes";
66
70
  case "nexight":
@@ -187,4 +191,4 @@ export {
187
191
  resolveAgentGUIProviderTarget,
188
192
  agentGUIProviderTargetRefsEqual
189
193
  };
190
- //# sourceMappingURL=chunk-4UTWOSHP.js.map
194
+ //# sourceMappingURL=chunk-3NSUJ7OF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../providerTargets.ts"],"sourcesContent":["import type {\n AgentGUIProvider,\n AgentGUIProviderTarget,\n AgentGUIProviderTargetRef\n} from \"./types.ts\";\n\nconst agentGUIProviderTargetStaticLabels: Record<AgentGUIProvider, string> = {\n \"claude-code\": \"Claude Code\",\n codex: \"Codex\",\n cursor: \"Cursor\",\n gemini: \"Gemini\",\n hermes: \"Hermes\",\n nexight: \"Tutti Agent\",\n openclaw: \"OpenClaw\"\n};\n\nexport const agentGUIDefaultTargetProviders = [\n \"codex\",\n \"claude-code\",\n \"cursor\",\n \"nexight\",\n \"hermes\",\n \"openclaw\"\n] as const satisfies readonly AgentGUIProvider[];\n\nconst agentGUIDisabledPlaceholderProviders = [\n \"nexight\",\n \"hermes\",\n \"openclaw\"\n] as const satisfies readonly AgentGUIProvider[];\n\nexport function createLocalAgentGUIProviderTarget(\n provider: AgentGUIProvider\n): AgentGUIProviderTarget {\n const targetId = localAgentGUIProviderTargetId(provider);\n const agentTargetId = localAgentGUIAgentTargetId(provider);\n return {\n targetId,\n ...(agentTargetId ? { agentTargetId } : {}),\n provider,\n ref: {\n kind: \"local\",\n provider\n },\n label: agentGUIProviderTargetStaticLabels[provider] ?? provider\n };\n}\n\nexport function createDisabledPlaceholderAgentGUIProviderTarget(\n provider: AgentGUIProvider\n): AgentGUIProviderTarget {\n return {\n ...createLocalAgentGUIProviderTarget(provider),\n disabled: true\n };\n}\n\nexport function createLocalAgentGUIProviderTargets(\n providers: readonly AgentGUIProvider[] = agentGUIDefaultTargetProviders\n): AgentGUIProviderTarget[] {\n return providers.map((provider) =>\n createLocalAgentGUIProviderTarget(provider)\n );\n}\n\nfunction createStaticAgentGUIProviderTargets(\n providers: readonly AgentGUIProvider[] = agentGUIDefaultTargetProviders,\n options?: { includeDisabledPlaceholders?: boolean }\n): AgentGUIProviderTarget[] {\n const disabledProviders = new Set<AgentGUIProvider>(\n options?.includeDisabledPlaceholders === true\n ? agentGUIDisabledPlaceholderProviders\n : []\n );\n return providers.map((provider) =>\n disabledProviders.has(provider)\n ? createDisabledPlaceholderAgentGUIProviderTarget(provider)\n : createLocalAgentGUIProviderTarget(provider)\n );\n}\n\nexport function localAgentGUIProviderTargetId(\n provider: AgentGUIProvider\n): string {\n return `local:${provider}`;\n}\n\nexport function localAgentGUIAgentTargetId(\n provider: AgentGUIProvider\n): string | null {\n switch (provider) {\n case \"codex\":\n return \"local:codex\";\n case \"claude-code\":\n return \"local:claude-code\";\n case \"cursor\":\n return \"local:cursor\";\n case \"hermes\":\n return \"local:hermes\";\n case \"nexight\":\n return \"local:nexight\";\n case \"openclaw\":\n return \"local:openclaw\";\n default:\n return null;\n }\n}\n\nexport function normalizeAgentGUIProviderTargets(\n targets: readonly AgentGUIProviderTarget[] | null | undefined,\n options?: {\n includeDisabledPlaceholders?: boolean;\n useStaticCatalog?: boolean;\n }\n): AgentGUIProviderTarget[] {\n const includeDisabledPlaceholders =\n options?.includeDisabledPlaceholders === true;\n const useStaticCatalog = options?.useStaticCatalog !== false;\n const source = targets && targets.length > 0 ? targets : [];\n const normalizedTargets: AgentGUIProviderTarget[] = [];\n const seenTargetKeys = new Set<string>();\n const seenProviders = new Set<AgentGUIProvider>();\n for (const target of source) {\n const normalized = normalizeAgentGUIProviderTarget(target);\n if (!normalized) {\n continue;\n }\n const dedupeKey = `${normalized.provider}\\u0000${normalized.targetId}`;\n if (seenTargetKeys.has(dedupeKey)) {\n continue;\n }\n seenTargetKeys.add(dedupeKey);\n seenProviders.add(normalized.provider);\n normalizedTargets.push(normalized);\n }\n if (includeDisabledPlaceholders && normalizedTargets.length > 0) {\n for (const provider of agentGUIDisabledPlaceholderProviders) {\n if (seenProviders.has(provider)) {\n continue;\n }\n normalizedTargets.push(\n createDisabledPlaceholderAgentGUIProviderTarget(provider)\n );\n }\n }\n return normalizedTargets.length > 0 || !useStaticCatalog\n ? normalizedTargets\n : createStaticAgentGUIProviderTargets(undefined, {\n includeDisabledPlaceholders\n });\n}\n\nexport function resolveAgentGUIProviderTarget(input: {\n agentTargetId?: string | null;\n defaultProviderTargetId?: string | null;\n provider: AgentGUIProvider;\n providerTargetId?: string | null;\n providerTargets: readonly AgentGUIProviderTarget[];\n useStaticCatalog?: boolean;\n}): AgentGUIProviderTarget | null {\n const targetByAgentTargetId = new Map(\n input.providerTargets.flatMap((target) =>\n target.agentTargetId ? [[target.agentTargetId, target] as const] : []\n )\n );\n const agentTarget = targetByAgentTargetId.get(\n input.agentTargetId?.trim() ?? \"\"\n );\n if (agentTarget) {\n return agentTarget;\n }\n const providerTargets = input.providerTargets.filter(\n (target) => target.provider === input.provider\n );\n const targetById = new Map(\n providerTargets.map((target) => [target.targetId, target])\n );\n return (\n targetById.get(input.providerTargetId?.trim() ?? \"\") ??\n targetById.get(input.defaultProviderTargetId?.trim() ?? \"\") ??\n targetById.get(localAgentGUIProviderTargetId(input.provider)) ??\n providerTargets.find((target) => target.disabled !== true) ??\n providerTargets[0] ??\n (input.useStaticCatalog === false\n ? null\n : createLocalAgentGUIProviderTarget(input.provider))\n );\n}\n\nexport function agentGUIProviderTargetRefsEqual(\n left: AgentGUIProviderTargetRef | null | undefined,\n right: AgentGUIProviderTargetRef | null | undefined\n): boolean {\n if (left === right) {\n return true;\n }\n if (!left && !right) {\n return true;\n }\n if (!left || !right) {\n return false;\n }\n return stableProviderTargetRefKey(left) === stableProviderTargetRefKey(right);\n}\n\nfunction normalizeAgentGUIProviderTarget(\n target: AgentGUIProviderTarget\n): AgentGUIProviderTarget | null {\n const targetId = target.targetId.trim();\n const agentTargetId = target.agentTargetId?.trim();\n const label = target.label.trim();\n const kind =\n typeof target.ref.kind === \"string\" ? target.ref.kind.trim() : \"\";\n if (!targetId || !label || !kind || target.ref.provider !== target.provider) {\n return null;\n }\n return {\n ...target,\n targetId,\n ...(agentTargetId ? { agentTargetId } : {}),\n provider: target.provider,\n ref: {\n ...target.ref,\n kind,\n provider: target.provider\n },\n label,\n ...(target.description?.trim()\n ? { description: target.description.trim() }\n : {}),\n ...(target.ownerLabel?.trim()\n ? { ownerLabel: target.ownerLabel.trim() }\n : {}),\n ...(target.unavailableReason?.trim()\n ? { unavailableReason: target.unavailableReason.trim() }\n : {})\n };\n}\n\nfunction stableProviderTargetRefKey(ref: AgentGUIProviderTargetRef): string {\n return JSON.stringify(sortProviderTargetRefValue(ref));\n}\n\nfunction sortProviderTargetRefValue(value: unknown): unknown {\n if (Array.isArray(value)) {\n return value.map(sortProviderTargetRefValue);\n }\n if (!value || typeof value !== \"object\") {\n return value;\n }\n return Object.fromEntries(\n Object.entries(value)\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([key, entryValue]) => [key, sortProviderTargetRefValue(entryValue)])\n );\n}\n"],"mappings":";AAMA,IAAM,qCAAuE;AAAA,EAC3E,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AACZ;AAEO,IAAM,iCAAiC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,uCAAuC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AACF;AAEO,SAAS,kCACd,UACwB;AACxB,QAAM,WAAW,8BAA8B,QAAQ;AACvD,QAAM,gBAAgB,2BAA2B,QAAQ;AACzD,SAAO;AAAA,IACL;AAAA,IACA,GAAI,gBAAgB,E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AS,2BAA2B,OAAyB;AAC3D,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,WAAO,MAAM,IAAI,0BAA0B;AAAA,EAC7C;AACA,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,WAAO;AAAA,EACT;AACA,SAAO,OAAO;AAAA,IACZ,OAAO,QAAQ,KAAK,EACjB,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,MAAM,KAAK,cAAc,KAAK,CAAC,EACnD,IAAI,CAAC,CAAC,KAAK,UAAU,MAAM,CAAC,KAAK,2BAA2B,UAAU,CAAC,CAAC;AAAA,EAC7E;AACF;","names":[]}
@@ -2,10 +2,10 @@ import {
2
2
  Spinner,
3
3
  userAvatarPlaceholderUrl,
4
4
  workspaceAgentActivityStatusLabel
5
- } from "./chunk-ZUVEBW5T.js";
5
+ } from "./chunk-TFPKI4XJ.js";
6
6
  import {
7
7
  normalizeAgentSessionMentionTitle
8
- } from "./chunk-FQQDBBNI.js";
8
+ } from "./chunk-FLTLZGIN.js";
9
9
  import {
10
10
  resolveAgentMentionFileThumbnailUrl,
11
11
  resolveAgentMentionFileVisualKind
@@ -13,10 +13,10 @@ import {
13
13
  import {
14
14
  getOptionalAgentHostApi,
15
15
  managedAgentRoundedIconUrl
16
- } from "./chunk-FRCIPTUD.js";
16
+ } from "./chunk-ERWDRI3F.js";
17
17
  import {
18
18
  translate
19
- } from "./chunk-RO6KQD3J.js";
19
+ } from "./chunk-IIXCU2UU.js";
20
20
  import {
21
21
  AGENT_CONTEXT_MENTION_PROVIDER_IDS
22
22
  } from "./chunk-JM24HADP.js";
@@ -2211,4 +2211,4 @@ export {
2211
2211
  AgentFileMentionPalette,
2212
2212
  AgentContextMentionPalette
2213
2213
  };
2214
- //# sourceMappingURL=chunk-SGXYVGQT.js.map
2214
+ //# sourceMappingURL=chunk-52VZ54WH.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  translateInUiLanguage
3
- } from "./chunk-CA25GD5Q.js";
3
+ } from "./chunk-MQ6RKXXW.js";
4
4
  import {
5
5
  normalizeAgentTitleText
6
6
  } from "./chunk-GCBDIQDX.js";
@@ -98,6 +98,7 @@ function unescapeMarkdownLabel(label) {
98
98
  var AGENT_PROVIDER_LABEL = {
99
99
  "claude-code": "Claude Code",
100
100
  codex: "Codex",
101
+ cursor: "Cursor",
101
102
  nexight: "Nexight",
102
103
  opencode: "OpenCode",
103
104
  gemini: "Gemini CLI",
@@ -114,6 +115,10 @@ function normalizeAgentGUIProviderIdentity(provider) {
114
115
  return "claude-code";
115
116
  case "codex":
116
117
  return "codex";
118
+ case "cursor":
119
+ case "cursor-agent":
120
+ case "cursor agent":
121
+ return "cursor";
117
122
  case "nexight":
118
123
  case "tutti":
119
124
  return "nexight";
@@ -314,4 +319,4 @@ export {
314
319
  resolveAgentGUIProviderDisplayLabel,
315
320
  firstAgentGUIUserMessageTitle
316
321
  };
317
- //# sourceMappingURL=chunk-CVSCZ3CK.js.map
322
+ //# sourceMappingURL=chunk-76GTKO4Q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../shared/utils/agentSessionMentionText.ts","../contexts/settings/domain/agentSettings.providerMeta.ts","../shared/agentConversationTitleProjection.ts"],"sourcesContent":["import type { UiLanguage } from \"../../contexts/settings/domain/agentSettings\";\nimport { normalizeAgentTitleText } from \"./agentTitleText.ts\";\nimport {\n isRichTextMentionHref,\n parseRichTextMentionHref\n} from \"@tutti-os/ui-rich-text/core\";\n\nconst MARKDOWN_LINK_PATTERN = /\\[((?:\\\\.|[^\\]\\\\])*)\\]\\(([^)\\s]+)\\)/g;\nconst MARKDOWN_LABEL_ESCAPE_PATTERN = /\\\\([\\\\[\\]()])/g;\nconst SESSION_MENTION_DISPLAY_PREFIX_BY_LANGUAGE: Record<UiLanguage, string> = {\n \"zh-CN\": \"@会话 · \",\n en: \"@session · \"\n};\nconst PLAIN_SESSION_AGENT_LABELS = [\n \"Claude Code\",\n \"Gemini CLI\",\n \"Hermes Agent\",\n \"OpenClaw\",\n \"Nexight\",\n \"Gemini\",\n \"Hermes\",\n \"Codex\"\n] as const;\n\nexport interface FormatAgentSessionMentionTextOptions {\n language?: UiLanguage;\n}\n\nexport function formatAgentSessionMentionText(\n value: string | null | undefined,\n options: FormatAgentSessionMentionTextOptions = {}\n): string {\n const trimmed = value?.trim() ?? \"\";\n if (!trimmed) {\n return \"\";\n }\n const sessionMentionDisplayPrefix = sessionMentionDisplayPrefixForLanguage(\n options.language\n );\n\n const withSessionMentionsNormalized = trimmed.replace(\n MARKDOWN_LINK_PATTERN,\n (fullMatch, rawLabel: string, href: string) => {\n const label = unescapeMarkdownLabel(rawLabel);\n const mention = parseRichTextMentionHref(href, label);\n if (!mention) {\n return isRichTextMentionHref(href) ? label : fullMatch;\n }\n const providerId = mention.providerId.trim().toLowerCase();\n const displayLabel = label || mention.label;\n if (providerId === \"agent-session\") {\n return formatSessionLabel(displayLabel, sessionMentionDisplayPrefix);\n }\n if (providerId === \"workspace-issue\") {\n return formatIssueLabel(displayLabel);\n }\n return displayLabel;\n }\n );\n const normalized = normalizeAgentTitleText(withSessionMentionsNormalized);\n if (isPlainSessionMentionText(normalized, sessionMentionDisplayPrefix)) {\n return formatSessionLabel(normalized, sessionMentionDisplayPrefix);\n }\n return normalized;\n}\n\nfunction isPlainSessionMentionText(\n value: string,\n sessionMentionDisplayPrefix: string\n): boolean {\n const trimmed = value.trim();\n if (\n !trimmed.startsWith(\"@\") ||\n trimmed.startsWith(sessionMentionDisplayPrefix)\n ) {\n return false;\n }\n\n return PLAIN_SESSION_AGENT_LABELS.some((agentLabel) => {\n const ampersandSeparator = ` & ${agentLabel}`;\n const ampersandIndex = trimmed.indexOf(ampersandSeparator);\n if (ampersandIndex > 1) {\n const trailing = trimmed.slice(\n ampersandIndex + ampersandSeparator.length\n );\n if (trailing === \"\" || trailing.startsWith(\" \")) {\n return true;\n }\n }\n\n const dottedSeparator = ` · ${agentLabel} · `;\n return trimmed.indexOf(dottedSeparator) > 1;\n });\n}\n\nfunction sessionMentionDisplayPrefixForLanguage(\n language: UiLanguage | undefined\n): string {\n return SESSION_MENTION_DISPLAY_PREFIX_BY_LANGUAGE[language ?? \"en\"];\n}\n\nfunction formatSessionLabel(\n label: string,\n sessionMentionDisplayPrefix: string\n): string {\n const normalizedLabel = label.trim().replace(/^@+/, \"\").trim();\n return normalizedLabel\n ? `${sessionMentionDisplayPrefix}${normalizedLabel}`\n : label.trim();\n}\n\nfunction formatIssueLabel(label: string): string {\n const normalizedLabel = label.trim().replace(/^@+/, \"\").trim();\n return normalizedLabel ? `@Task · ${normalizedLabel}` : label.trim();\n}\n\nfunction unescapeMarkdownLabel(label: string): string {\n return label.replace(MARKDOWN_LABEL_ESCAPE_PATTERN, \"$1\");\n}\n","import type { AgentProvider } from \"./agentSettings\";\n\nexport const AGENT_PROVIDER_LABEL: Record<AgentProvider, string> = {\n \"claude-code\": \"Claude Code\",\n codex: \"Codex\",\n cursor: \"Cursor\",\n nexight: \"Nexight\",\n opencode: \"OpenCode\",\n gemini: \"Gemini CLI\",\n openclaw: \"OpenClaw\",\n hermes: \"Hermes Agent\"\n};\n\nexport interface AgentProviderCapabilities {\n runtimeObservation: \"jsonl\" | \"provider-api\" | \"none\";\n experimental: boolean;\n}\n\nexport const AGENT_PROVIDER_CAPABILITIES: Record<\n AgentProvider,\n AgentProviderCapabilities\n> = {\n \"claude-code\": {\n runtimeObservation: \"jsonl\",\n experimental: false\n },\n codex: {\n runtimeObservation: \"jsonl\",\n experimental: false\n },\n cursor: {\n runtimeObservation: \"jsonl\",\n experimental: false\n },\n nexight: {\n runtimeObservation: \"jsonl\",\n experimental: false\n },\n opencode: {\n runtimeObservation: \"provider-api\",\n experimental: false\n },\n gemini: {\n runtimeObservation: \"none\",\n experimental: false\n },\n openclaw: {\n runtimeObservation: \"jsonl\",\n experimental: false\n },\n hermes: {\n runtimeObservation: \"jsonl\",\n experimental: false\n }\n};\n","import { AGENT_PROVIDER_LABEL } from \"../contexts/settings/domain/agentSettings.providerMeta.ts\";\nimport type { UiLanguage } from \"../contexts/settings/domain/agentSettings.ts\";\nimport { translateInUiLanguage } from \"../i18n/runtime.ts\";\nimport type { AgentGUIProvider } from \"../types.ts\";\nimport type { WorkspaceAgentActivityTimelineItem } from \"./workspaceAgentActivityTypes.ts\";\nimport { formatAgentSessionMentionText } from \"./utils/agentSessionMentionText.ts\";\nimport { normalizeAgentTitleText } from \"./utils/agentTitleText.ts\";\n\nexport type AgentGUIResolvedProvider = AgentGUIProvider | \"unknown\";\nexport type AgentGUIConversationTitleFallback = \"generic-agent\" | null;\n\nexport interface AgentGUIConversationPlainTitleOptions {\n fallbackAgentLabel?: string;\n language?: UiLanguage;\n}\n\nexport interface AgentGUIConversationTitleMessage {\n id?: number | string | null;\n messageId?: string | null;\n version?: number | null;\n role?: string | null;\n kind?: string | null;\n payload?: {\n content?: unknown;\n displayPrompt?: unknown;\n text?: unknown;\n } | null;\n occurredAtUnixMs?: number | null;\n completedAtUnixMs?: number | null;\n startedAtUnixMs?: number | null;\n}\n\nexport function normalizeAgentGUIProviderIdentity(\n provider: string | null | undefined\n): AgentGUIResolvedProvider {\n switch (provider?.trim().toLowerCase() ?? \"\") {\n case \"claude-code\":\n case \"claude\":\n case \"claude code\":\n return \"claude-code\";\n case \"codex\":\n return \"codex\";\n case \"cursor\":\n case \"cursor-agent\":\n case \"cursor agent\":\n return \"cursor\";\n case \"nexight\":\n case \"tutti\":\n return \"nexight\";\n case \"gemini\":\n return \"gemini\";\n case \"hermes\":\n return \"hermes\";\n case \"openclaw\":\n return \"openclaw\";\n default:\n return \"unknown\";\n }\n}\n\nexport function resolveAgentGUIProviderIdentity(input: {\n sessionProvider?: string | null;\n workspaceSessionProvider?: string | null;\n conversationProvider?: string | null;\n timelineItems?: readonly WorkspaceAgentActivityTimelineItem[];\n}): AgentGUIResolvedProvider {\n const candidates = [\n input.sessionProvider,\n input.workspaceSessionProvider,\n input.conversationProvider,\n timelineProviderHint(input.timelineItems ?? [])\n ];\n for (const candidate of candidates) {\n const normalized = normalizeAgentGUIProviderIdentity(candidate);\n if (normalized !== \"unknown\") {\n return normalized;\n }\n }\n return \"unknown\";\n}\n\nexport function resolveAgentGUIConversationTitle(\n title: string | null | undefined,\n provider: AgentGUIResolvedProvider\n): {\n title: string;\n titleFallback: AgentGUIConversationTitleFallback;\n} {\n const normalizedTitle = stripAgentGUITitleTrailingPeriod(\n normalizeAgentTitleText(title)\n );\n if (normalizedTitle) {\n return {\n title: normalizedTitle,\n titleFallback: null\n };\n }\n if (provider === \"unknown\") {\n return {\n title: \"\",\n titleFallback: \"generic-agent\"\n };\n }\n return {\n title: AGENT_PROVIDER_LABEL[provider],\n titleFallback: null\n };\n}\n\nexport function resolveAgentGUIConversationDisplayTitle(\n input: {\n title: string;\n titleFallback?: AgentGUIConversationTitleFallback;\n },\n fallbackAgentLabel: string\n): string {\n if (input.title) {\n return stripAgentGUITitleTrailingPeriod(\n normalizeAgentTitleText(input.title)\n );\n }\n if (input.titleFallback === \"generic-agent\") {\n return stripAgentGUITitleTrailingPeriod(fallbackAgentLabel);\n }\n return \"\";\n}\n\nexport function formatAgentGUIConversationPlainTitle(\n input: {\n title: string;\n titleFallback?: AgentGUIConversationTitleFallback;\n },\n options: AgentGUIConversationPlainTitleOptions = {}\n): string {\n return formatAgentSessionMentionText(\n resolveAgentGUIConversationDisplayTitle(\n input,\n options.fallbackAgentLabel ?? \"Agent\"\n ),\n {\n language: options.language\n }\n );\n}\n\nexport function resolveAgentGUIDockConversationTitle(input: {\n provider: AgentGUIResolvedProvider;\n title: string;\n titleFallback?: AgentGUIConversationTitleFallback;\n}): string | null {\n return resolveAgentGUIExplicitConversationTitle(input);\n}\n\nexport function resolveAgentGUIExplicitConversationTitle(input: {\n provider: AgentGUIResolvedProvider;\n title: string;\n titleFallback?: AgentGUIConversationTitleFallback;\n}): string | null {\n if (input.titleFallback) {\n return null;\n }\n\n const title = stripAgentGUITitleTrailingPeriod(\n normalizeAgentTitleText(input.title)\n );\n if (!title) {\n return null;\n }\n if (isAgentGUIUntitledTaskTitle(title)) {\n return null;\n }\n\n if (\n input.provider !== \"unknown\" &&\n title === AGENT_PROVIDER_LABEL[input.provider]\n ) {\n return null;\n }\n\n return title;\n}\n\nexport function resolveAgentGUIProviderDisplayLabel(\n provider: string | null | undefined,\n fallbackAgentLabel: string\n): string {\n const resolvedProvider = normalizeAgentGUIProviderIdentity(provider);\n if (resolvedProvider === \"unknown\") {\n return fallbackAgentLabel;\n }\n return AGENT_PROVIDER_LABEL[resolvedProvider];\n}\n\nexport function firstAgentGUIUserMessageTitle(\n messages: readonly AgentGUIConversationTitleMessage[]\n): string {\n const userMessage = [...messages]\n .filter(\n (message) =>\n messageRole(message) === \"user\" && messageText(message).length > 0\n )\n .sort(compareMessagesAscending)[0];\n return userMessage ? messageText(userMessage) : \"\";\n}\n\nfunction messageRole(\n message: AgentGUIConversationTitleMessage\n): \"user\" | \"agent\" | null {\n const role = message.role?.trim().toLowerCase();\n if (role === \"user\") {\n return \"user\";\n }\n if (role === \"assistant\" || role === \"agent\") {\n return \"agent\";\n }\n const kind = message.kind?.trim().toLowerCase() ?? \"\";\n if (kind === \"message.user\") {\n return \"user\";\n }\n if (kind === \"message.assistant\" || kind === \"message.agent\") {\n return \"agent\";\n }\n return null;\n}\n\nfunction messageText(message: AgentGUIConversationTitleMessage): string {\n const payload = message.payload;\n const displayPrompt =\n typeof payload?.displayPrompt === \"string\" ? payload.displayPrompt : \"\";\n const text = typeof payload?.text === \"string\" ? payload.text : \"\";\n const content = typeof payload?.content === \"string\" ? payload.content : \"\";\n return normalizeAgentTitleText(displayPrompt || text || content);\n}\n\nfunction compareMessagesAscending(\n left: AgentGUIConversationTitleMessage,\n right: AgentGUIConversationTitleMessage\n): number {\n const leftTime =\n left.occurredAtUnixMs ??\n left.completedAtUnixMs ??\n left.startedAtUnixMs ??\n 0;\n const rightTime =\n right.occurredAtUnixMs ??\n right.completedAtUnixMs ??\n right.startedAtUnixMs ??\n 0;\n const timeDiff = leftTime - rightTime;\n if (timeDiff !== 0) {\n return timeDiff;\n }\n const sequenceDiff =\n messageSequence(left) - messageSequence(right) ||\n (left.messageId ?? \"\").localeCompare(right.messageId ?? \"\");\n return sequenceDiff;\n}\n\nfunction messageSequence(message: AgentGUIConversationTitleMessage): number {\n const numericId =\n typeof message.id === \"number\" && Number.isFinite(message.id)\n ? message.id\n : 0;\n return message.version ?? numericId;\n}\n\nfunction stripAgentGUITitleTrailingPeriod(title: string): string {\n return title\n .trimEnd()\n .replace(/[.。]+$/u, \"\")\n .trimEnd();\n}\n\nfunction isAgentGUIUntitledTaskTitle(title: string): boolean {\n return localizedAgentGUIUntitledTaskLabels().has(compactTitleText(title));\n}\n\nfunction localizedAgentGUIUntitledTaskLabels(): Set<string> {\n return new Set(\n ([\"en\", \"zh-CN\"] as const)\n .map((language) =>\n compactTitleText(\n translateInUiLanguage(\n language,\n \"agentHost.workspaceAgentsUntitledTask\"\n )\n )\n )\n .filter(Boolean)\n );\n}\n\nfunction timelineProviderHint(\n timelineItems: readonly WorkspaceAgentActivityTimelineItem[]\n): string | null {\n for (const item of timelineItems) {\n if (isUserTimelineItem(item)) {\n continue;\n }\n const normalized = normalizeAgentGUIProviderIdentity(item.actorId);\n if (normalized !== \"unknown\") {\n return normalized;\n }\n }\n return null;\n}\n\nfunction isUserTimelineItem(item: WorkspaceAgentActivityTimelineItem): boolean {\n const role = item.role?.trim().toLowerCase();\n if (role === \"user\") {\n return true;\n }\n const actorType = item.actorType.trim().toLowerCase();\n if (actorType === \"user\") {\n return true;\n }\n return item.itemType.trim().toLowerCase() === \"message.user\";\n}\n\nfunction compactTitleText(value: string): string {\n return value.trim().replace(/\\s+/g, \" \");\n}\n"],"mappings":";;;;;;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,IAAM,wBAAwB;AAC9B,IAAM,gCAAgC;AACtC,IAAM,6CAAyE;AAAA,EAC7E,SAAS;AAAA,EACT,IAAI;AACN;AACA,IAA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AAAA,EACT;AACA,SAAO,KAAK,SAAS,KAAK,EAAE,YAAY,MAAM;AAChD;AAEA,SAAS,iBAAiB,OAAuB;AAC/C,SAAO,MAAM,KAAK,EAAE,QAAQ,QAAQ,GAAG;AACzC;","names":[]}
@@ -4,7 +4,7 @@ import {
4
4
  formatAgentSessionMentionText,
5
5
  normalizeAgentGUIProviderIdentity,
6
6
  resolveAgentGUIExplicitConversationTitle
7
- } from "./chunk-CVSCZ3CK.js";
7
+ } from "./chunk-76GTKO4Q.js";
8
8
 
9
9
  // workbench/sessionTitle.ts
10
10
  function formatAgentGuiSessionPlainTitle(title, options = {}) {
@@ -96,4 +96,4 @@ export {
96
96
  formatAgentGuiConversationPlainTitle,
97
97
  resolveAgentGuiWorkbenchSessionTitle
98
98
  };
99
- //# sourceMappingURL=chunk-G6UO6JVM.js.map
99
+ //# sourceMappingURL=chunk-C465B7WK.js.map