@tutti-os/agent-gui 0.0.211 → 0.0.213

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 (71) hide show
  1. package/README.md +19 -11
  2. package/dist/{AgentRichTextReadonly-GEGDM5UJ.js → AgentRichTextReadonly-TASIMIK4.js} +5 -5
  3. package/dist/agent-conversation/index.d.ts +1 -1
  4. package/dist/agent-conversation/index.js +9 -9
  5. package/dist/agent-conversation/interactive-answer.d.ts +34 -0
  6. package/dist/agent-conversation/interactive-answer.js +11 -0
  7. package/dist/agent-conversation/interactive-answer.js.map +1 -0
  8. package/dist/agent-env/index.d.ts +1 -8
  9. package/dist/agent-env/index.js +1 -1
  10. package/dist/agent-gui.d.ts +21 -48
  11. package/dist/agent-gui.js +17 -16
  12. package/dist/agent-message-center/index.js +8 -7
  13. package/dist/agent-message-center/index.js.map +1 -1
  14. package/dist/{agentFileMentionContracts-B0yQizXB.d.ts → agentFileMentionContracts-BeBex-Sf.d.ts} +5 -0
  15. package/dist/{agentGuiNodeTypes-DTeerTzS.d.ts → agentGuiNodeTypes-BMcpfKTn.d.ts} +5 -1
  16. package/dist/app/renderer/agentactivity.css +45 -30
  17. package/dist/{chunk-7CJEFNHW.js → chunk-2HYADTQP.js} +7 -2
  18. package/dist/chunk-2HYADTQP.js.map +1 -0
  19. package/dist/{chunk-4VXUWPPZ.js → chunk-7SSORDQY.js} +18 -32
  20. package/dist/chunk-7SSORDQY.js.map +1 -0
  21. package/dist/{chunk-3MMKYY6R.js → chunk-AD2RTSMS.js} +2 -2
  22. package/dist/{chunk-X2LSVRRX.js → chunk-BYHNJQYH.js} +2 -2
  23. package/dist/{chunk-SXZJ3MDI.js → chunk-FEUU4YMY.js} +31 -32
  24. package/dist/chunk-FEUU4YMY.js.map +1 -0
  25. package/dist/chunk-FMTWYOHM.js +25 -0
  26. package/dist/chunk-FMTWYOHM.js.map +1 -0
  27. package/dist/{chunk-CVGUT36H.js → chunk-G2QO6HPB.js} +2 -2
  28. package/dist/{chunk-PLAOIDNY.js → chunk-ISC67YBJ.js} +171 -36
  29. package/dist/chunk-ISC67YBJ.js.map +1 -0
  30. package/dist/{chunk-U5NVLMW2.js → chunk-L4E2Y52A.js} +2 -2
  31. package/dist/{chunk-Z23HCYYR.js → chunk-LQKLBDBK.js} +3 -3
  32. package/dist/{chunk-JZ6KUUDY.js → chunk-N4HLBSMJ.js} +2 -32
  33. package/dist/chunk-N4HLBSMJ.js.map +1 -0
  34. package/dist/{chunk-Y2VQMPUR.js → chunk-QVLEP54U.js} +4 -56
  35. package/dist/chunk-QVLEP54U.js.map +1 -0
  36. package/dist/{chunk-AT4DII34.js → chunk-RLFO3NJV.js} +1692 -2046
  37. package/dist/chunk-RLFO3NJV.js.map +1 -0
  38. package/dist/{chunk-KY2IYJXK.js → chunk-XERDRMSF.js} +11 -5
  39. package/dist/chunk-XERDRMSF.js.map +1 -0
  40. package/dist/{chunk-HH5EWBH2.js → chunk-YBIT37P5.js} +2 -2
  41. package/dist/{chunk-P4LVBSFC.js → chunk-ZNHMWCO4.js} +8 -8
  42. package/dist/context-mention-palette/index.d.ts +1 -1
  43. package/dist/context-mention-palette/index.js +8 -8
  44. package/dist/i18n/index.d.ts +3 -55
  45. package/dist/i18n/index.js +2 -2
  46. package/dist/index.d.ts +46 -624
  47. package/dist/index.js +18 -25
  48. package/dist/index.js.map +1 -1
  49. package/dist/mention-search.d.ts +2 -2
  50. package/dist/mention-search.js +6 -6
  51. package/dist/workbench/contribution.js +3 -3
  52. package/dist/workbench/index.js +6 -6
  53. package/dist/workbench/sessionTitle.js +2 -2
  54. package/package.json +22 -15
  55. package/dist/app/renderer/assets/commercial/registration-credits-bg.png +0 -0
  56. package/dist/chunk-4VXUWPPZ.js.map +0 -1
  57. package/dist/chunk-7CJEFNHW.js.map +0 -1
  58. package/dist/chunk-AT4DII34.js.map +0 -1
  59. package/dist/chunk-JZ6KUUDY.js.map +0 -1
  60. package/dist/chunk-KY2IYJXK.js.map +0 -1
  61. package/dist/chunk-PLAOIDNY.js.map +0 -1
  62. package/dist/chunk-SXZJ3MDI.js.map +0 -1
  63. package/dist/chunk-Y2VQMPUR.js.map +0 -1
  64. /package/dist/{AgentRichTextReadonly-GEGDM5UJ.js.map → AgentRichTextReadonly-TASIMIK4.js.map} +0 -0
  65. /package/dist/{chunk-3MMKYY6R.js.map → chunk-AD2RTSMS.js.map} +0 -0
  66. /package/dist/{chunk-X2LSVRRX.js.map → chunk-BYHNJQYH.js.map} +0 -0
  67. /package/dist/{chunk-CVGUT36H.js.map → chunk-G2QO6HPB.js.map} +0 -0
  68. /package/dist/{chunk-U5NVLMW2.js.map → chunk-L4E2Y52A.js.map} +0 -0
  69. /package/dist/{chunk-Z23HCYYR.js.map → chunk-LQKLBDBK.js.map} +0 -0
  70. /package/dist/{chunk-HH5EWBH2.js.map → chunk-YBIT37P5.js.map} +0 -0
  71. /package/dist/{chunk-P4LVBSFC.js.map → chunk-ZNHMWCO4.js.map} +0 -0
@@ -6,14 +6,14 @@ import {
6
6
  import {
7
7
  getOptionalAgentHostApi,
8
8
  useOptionalAgentHostApi
9
- } from "./chunk-HH5EWBH2.js";
9
+ } from "./chunk-YBIT37P5.js";
10
10
  import {
11
11
  managedAgentRoundedIconUrl
12
12
  } from "./chunk-M6HTOCQK.js";
13
13
  import {
14
14
  translate,
15
15
  useTranslation
16
- } from "./chunk-X2LSVRRX.js";
16
+ } from "./chunk-BYHNJQYH.js";
17
17
  import {
18
18
  resolveAgentWorkspaceFileVisualKind
19
19
  } from "./chunk-5BJYO6X3.js";
@@ -3731,4 +3731,4 @@ export {
3731
3731
  AgentMessageMarkdown,
3732
3732
  CustomScrollArea
3733
3733
  };
3734
- //# sourceMappingURL=chunk-Z23HCYYR.js.map
3734
+ //# sourceMappingURL=chunk-LQKLBDBK.js.map
@@ -84,42 +84,12 @@ var PRESENTATIONS = {
84
84
  provider_error: SELF_DETECT,
85
85
  unknown: SELF_DETECT
86
86
  };
87
- function resolveAgentErrorPresentation(code, commerce) {
87
+ function resolveAgentErrorPresentation(code) {
88
88
  if (!code) {
89
89
  return null;
90
90
  }
91
- if (code === "insufficient_credits") {
92
- return insufficientCreditsPresentation(commerce);
93
- }
94
91
  return PRESENTATIONS[code] ?? null;
95
92
  }
96
- function insufficientCreditsPresentation(commerce) {
97
- const externalUrl = commerce?.planUrl?.trim() || null;
98
- switch (commerce?.membershipAccess) {
99
- case "free":
100
- case "inactive":
101
- return {
102
- messageKey: "agentHost.agentGui.visibleErrorInsufficientCreditsFree",
103
- focus: null,
104
- actionKey: externalUrl ? "agentHost.agentGui.visibleErrorActionUpgradeMembership" : null,
105
- externalUrl
106
- };
107
- case "active":
108
- return {
109
- messageKey: "agentHost.agentGui.visibleErrorInsufficientCreditsActive",
110
- focus: null,
111
- actionKey: externalUrl ? "agentHost.agentGui.visibleErrorActionRechargeCredits" : null,
112
- externalUrl
113
- };
114
- default:
115
- return {
116
- messageKey: "agentHost.agentGui.visibleErrorInsufficientCreditsUnknown",
117
- focus: null,
118
- actionKey: externalUrl ? "agentHost.agentGui.visibleErrorActionViewCreditPlans" : null,
119
- externalUrl
120
- };
121
- }
122
- }
123
93
  var FAILED_MESSAGE_CODE_MARKERS = [
124
94
  [
125
95
  "auth_required",
@@ -482,4 +452,4 @@ export {
482
452
  deriveHasAnomaly,
483
453
  buildAgentEnvWizardViewModel
484
454
  };
485
- //# sourceMappingURL=chunk-JZ6KUUDY.js.map
455
+ //# sourceMappingURL=chunk-N4HLBSMJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../shared/agentEnv/agentEnvPanelActions.ts","../shared/agentEnv/agentErrorPresentation.ts","../shared/agentEnv/codexSetupContract.ts","../shared/agentEnv/agentEnvWizardFlow.ts","../shared/agentEnv/agentEnvViewModel.ts"],"sourcesContent":["import {\n createContext,\n createElement,\n useContext,\n type ReactElement,\n type ReactNode\n} from \"react\";\n\n/** Setup section requested by an AgentGUI remediation action. */\nexport type AgentEnvPanelFocus =\n | \"detect\"\n | \"install\"\n | \"repair\"\n | \"upgrade\"\n | \"auth\"\n | \"network\"\n | \"registry\";\n\nexport interface OpenAgentEnvPanelInput {\n provider?: string | null;\n focus?: AgentEnvPanelFocus | null;\n}\n\nexport type OpenAgentEnvPanelAction = (input?: OpenAgentEnvPanelInput) => void;\n\nconst AgentEnvPanelActionContext =\n createContext<OpenAgentEnvPanelAction | null>(null);\n\nexport function AgentEnvPanelActionProvider({\n children,\n openPanel\n}: {\n children: ReactNode;\n openPanel?: OpenAgentEnvPanelAction;\n}): ReactElement {\n return createElement(\n AgentEnvPanelActionContext.Provider,\n { value: openPanel ?? null },\n children\n );\n}\n\n/** Host-injected command; AgentGUI never owns the panel workflow state. */\nexport function useOpenAgentEnvPanel(): OpenAgentEnvPanelAction | null {\n return useContext(AgentEnvPanelActionContext);\n}\n","import type { AgentEnvPanelFocus } from \"./agentEnvPanelActions\";\n\n/**\n * Run-failure codes actually emitted by the daemon runtime classifier\n * (packages/agent/daemon/runtime/visible_error.go `visibleFailureCode`). These\n * are the codes the conversation error card really receives — unlike the\n * aspirational `CODEX_*` codes, which the run pipeline never produces.\n *\n * Keep this union aligned with the Go switch in `visibleFailureCode`.\n */\nexport type AgentRunErrorCode =\n | \"auth_required\"\n | \"cli_not_found\"\n | \"cli_version_unsupported\"\n | \"network_error\"\n | \"runtime_unavailable\"\n | \"request_timed_out\"\n | \"provider_config_timeout\"\n | \"provider_stream_disconnected\"\n | \"provider_concurrency_limit\"\n | \"insufficient_credits\"\n | \"quota_or_rate_limit\"\n | \"process_exited\"\n | \"provider_error\"\n | \"unknown\";\n\nexport interface AgentVisibleErrorOverride {\n message: string;\n /** Provider ids for which this product-owned override is valid. */\n providers: readonly string[];\n action?: {\n label: string;\n url: string;\n } | null;\n}\n\n/**\n * Product-owned structured errors whose copy may be supplied by a Host.\n * Environment/runtime errors remain canonical AgentGUI policy.\n */\nexport type AgentVisibleErrorOverrideCode = \"insufficient_credits\";\n\nexport type AgentVisibleErrorOverrides = Partial<\n Record<AgentVisibleErrorOverrideCode, AgentVisibleErrorOverride>\n>;\n\nexport interface AgentErrorPresentation {\n /**\n * i18n key for the one human sentence shown in the card, or null to let the\n * caller fall back to its phase-aware generic title.\n */\n messageKey: string | null;\n /**\n * Env-panel section the remediation button deep-links to, or null when the\n * failure is transient/server-side and the wizard cannot fix it — in which\n * case no call-to-action is shown (showing one would misrepresent reality).\n */\n focus: AgentEnvPanelFocus | null;\n /** i18n key for the remediation button. */\n actionKey: string | null;\n /** External remediation destination, when the action is account-level. */\n externalUrl?: string | null;\n}\n\nconst NO_CTA = { focus: null, actionKey: null } as const;\n\n// The escape hatch for hard failures whose cause is ambiguous from the message\n// alone (a non-zero exit, an unclassified provider error): send the user into\n// the wizard to self-detect, but keep the generic message.\nconst SELF_DETECT = {\n messageKey: null,\n focus: \"detect\" as const,\n actionKey: \"agentHost.agentGui.visibleErrorActionDetect\"\n};\n\nconst PRESENTATIONS: Record<AgentRunErrorCode, AgentErrorPresentation> = {\n // Environment problems the wizard can detect or repair → route to its step.\n auth_required: {\n messageKey: \"agentHost.agentGui.visibleErrorAuthRequired\",\n focus: \"auth\",\n actionKey: \"agentHost.agentGui.visibleErrorActionRelogin\"\n },\n cli_not_found: {\n messageKey: \"agentHost.agentGui.visibleErrorCliNotFound\",\n focus: \"install\",\n actionKey: \"agentHost.agentGui.visibleErrorActionInstall\"\n },\n cli_version_unsupported: {\n messageKey: \"agentHost.agentGui.visibleErrorVersionUnsupported\",\n focus: \"upgrade\",\n actionKey: \"agentHost.agentGui.visibleErrorActionUpgrade\"\n },\n network_error: {\n messageKey: \"agentHost.agentGui.visibleErrorNetwork\",\n focus: \"network\",\n actionKey: \"agentHost.agentGui.visibleErrorActionCheckNetwork\"\n },\n runtime_unavailable: {\n messageKey: \"agentHost.agentGui.visibleErrorRuntimeUnavailable\",\n focus: \"detect\",\n actionKey: \"agentHost.agentGui.visibleErrorActionDetect\"\n },\n // Transient / server-side failures: accurate copy, but no wizard CTA — it\n // cannot fix a rate limit or a dropped stream.\n request_timed_out: {\n messageKey: \"agentHost.agentGui.visibleErrorRequestTimedOut\",\n ...NO_CTA\n },\n provider_config_timeout: {\n messageKey: \"agentHost.agentGui.visibleErrorConfigTimeout\",\n ...NO_CTA\n },\n provider_stream_disconnected: {\n messageKey: \"agentHost.agentGui.visibleErrorStreamDisconnected\",\n ...NO_CTA\n },\n provider_concurrency_limit: {\n messageKey: \"agentHost.agentGui.visibleErrorConcurrencyLimit\",\n ...NO_CTA\n },\n insufficient_credits: {\n messageKey: \"agentHost.agentGui.visibleErrorInsufficientCreditsUnknown\",\n ...NO_CTA\n },\n quota_or_rate_limit: {\n messageKey: \"agentHost.agentGui.visibleErrorQuotaOrRateLimit\",\n ...NO_CTA\n },\n // Ambiguous hard failures → generic message + self-detect escape hatch.\n process_exited: SELF_DETECT,\n provider_error: SELF_DETECT,\n unknown: SELF_DETECT\n};\n\n/**\n * Resolves the card presentation for a run-failure code. Returns null for codes\n * outside the known vocabulary so the caller renders its plain generic card with\n * no call-to-action.\n */\nexport function resolveAgentErrorPresentation(\n code: string | null | undefined\n): AgentErrorPresentation | null {\n if (!code) {\n return null;\n }\n return PRESENTATIONS[code as AgentRunErrorCode] ?? null;\n}\n\nconst FAILED_MESSAGE_CODE_MARKERS: ReadonlyArray<\n readonly [AgentRunErrorCode, readonly string[]]\n> = [\n [\n \"auth_required\",\n [\n \"authentication_failed\",\n \"invalid authentication credentials\",\n \"401 invalid authentication\",\n \"unauthorized\",\n \"not logged in\",\n \"please run /login\",\n \"invalid api key\"\n ]\n ],\n [\n \"cli_version_unsupported\",\n [\"requires a newer version\", \"version is too old\", \"unsupported version\"]\n ],\n [\n \"cli_not_found\",\n [\n \"no such file or directory\",\n \"command not found\",\n \"enoent\",\n \"executable file not found\"\n ]\n ],\n [\n \"network_error\",\n [\"enotfound\", \"econnrefused\", \"econnreset\", \"getaddrinfo\", \"socket hang up\"]\n ],\n [\n \"quota_or_rate_limit\",\n [\"upgrade your plan to continue\", \"add a payment method to continue\"]\n ]\n];\n\n/**\n * Some providers (notably Claude Code) report an environment failure — e.g. a\n * dropped login (401) — as a plain failed assistant message rather than a\n * structured visibleError, so it never gets the remediation card. This recovers\n * the env-fixable code from that message's text so the caller can still route the\n * user to the wizard. Returns null when the text isn't a recognized env failure\n * (so transient/unknown failures stay plain).\n */\nexport function classifyFailedAgentMessage(\n body: string | null | undefined\n): AgentRunErrorCode | null {\n if (!body) {\n return null;\n }\n const lower = body.toLowerCase();\n for (const [code, markers] of FAILED_MESSAGE_CODE_MARKERS) {\n if (markers.some((marker) => lower.includes(marker))) {\n return code;\n }\n }\n return null;\n}\n\nconst COMPLETED_AUTH_MESSAGE_MAX_LENGTH = 160;\nconst COMPLETED_AUTH_MESSAGE_PATTERN =\n /^not logged in\\s*(?:[·•:—-]|\\.)?\\s*please run\\s+\\/login[.!]?$/i;\n\n/**\n * Resolves a plain assistant message that should be recovered into a visible\n * error card. Failed messages keep the provider-agnostic fallback above.\n *\n * Claude Code demonstrates why completed messages need a narrow exception: its\n * SDK can return the standalone \"Not logged in · Please run /login\" notice\n * together with a successful result. Match the provider-owned output shape,\n * rather than branching on provider identity, and keep it short and\n * whole-message anchored so normal answers are not reclassified.\n */\nexport function classifyRecoverableAgentMessage(input: {\n body: string | null | undefined;\n statusKind: string | null | undefined;\n}): AgentRunErrorCode | null {\n if (input.statusKind === \"failed\") {\n return classifyFailedAgentMessage(input.body);\n }\n if (\n input.statusKind !== \"completed\" ||\n !input.body ||\n input.body.length > COMPLETED_AUTH_MESSAGE_MAX_LENGTH\n ) {\n return null;\n }\n return COMPLETED_AUTH_MESSAGE_PATTERN.test(input.body.trim())\n ? \"auth_required\"\n : null;\n}\n","import type {\n AgentProviderActiveAction,\n AgentProviderActiveActionError,\n AgentProviderActiveActionPhase,\n AgentProviderActiveActionStep,\n AgentProviderActiveActionStepStatus,\n AgentProviderStatus\n} from \"@tutti-os/client-tuttid-ts\";\n\n// Compatibility aliases for the existing Agent Environment UI. The wire\n// contract is generated from OpenAPI; this module must not maintain a second\n// parser or enum vocabulary.\nexport type CodexSetupStepStatus = AgentProviderActiveActionStepStatus;\nexport type CodexSetupStep = AgentProviderActiveActionStep;\nexport type CodexSetupPhase = AgentProviderActiveActionPhase;\nexport type CodexSetupActiveActionError = AgentProviderActiveActionError;\nexport type CodexSetupActiveAction = AgentProviderActiveAction;\n\nexport function readCodexSetupActiveAction(\n status: Pick<AgentProviderStatus, \"activeAction\"> | null | undefined\n): AgentProviderActiveAction | null {\n return status?.activeAction ?? null;\n}\n","import type { AgentEnvPanelFocus } from \"./agentEnvPanelActions\";\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 /** Whether a provider CLI update is in flight. */\n updateActionPending: 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 any provider runtime component installed separately from its CLI,\n * such as an SDK sidecar; where no separate component exists it simply tracks\n * 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 const updating = input.updateActionPending || input.activePhase === \"update\";\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 = updating\n ? \"running\"\n : 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\" | \"update\";\n\n/**\n * The problem token a blocked stage represents. The UI maps this to \"未xxx\"\n * copy; keeping it i18n-agnostic here lets the mapping stay tested without\n * pulling translation strings into the pure flow module.\n */\nexport type StageProblem =\n | \"network-unreachable\"\n | \"install-missing\"\n | \"install-outdated\"\n | \"install-platform-incomplete\"\n | \"adapter-missing\"\n | \"adapter-mismatch\"\n | \"login-missing\";\n\nexport interface StageRemediation {\n actionId: StageActionId;\n problem: StageProblem;\n}\n\n/**\n * For a stage the user must act on (idle `pending`/`error`, never `running` or\n * `ok`), returns what is wrong and which action fixes it. `detect`/`ready` never\n * carry their own remediation — they reflect prerequisites, not user actions.\n *\n * `error` means a version problem on the install/adapter stages (the only stages\n * derive marks `error`); `pending` means the step simply has not run yet.\n */\nexport function stageRemediation(\n stage: AgentSetupStage\n): StageRemediation | null {\n if (stage.status !== \"pending\" && stage.status !== \"error\") {\n return null;\n }\n switch (stage.id) {\n case \"network\":\n // Connectivity isn't fixed by an install/login action — re-running\n // detection (which re-probes the network) is the remediation.\n return { actionId: \"redetect\", problem: \"network-unreachable\" };\n case \"install\":\n // An explicit problem token (today: platform subpackage missing) takes\n // precedence — the daemon repairs it in place via the install action, so\n // route through install rather than the manual-upgrade error path.\n if (stage.problem) {\n return { actionId: \"install\", problem: stage.problem };\n }\n // A genuinely missing CLI is installed for the user; a present-but-\n // outdated CLI is NOT — we don't silently reinstall a binary the user\n // manages. Instead the panel shows the manual upgrade command and\n // re-detection confirms it once they've upgraded.\n return stage.status === \"error\"\n ? { actionId: \"redetect\", problem: \"install-outdated\" }\n : { actionId: \"install\", problem: \"install-missing\" };\n case \"adapter\":\n return {\n actionId: \"install\",\n problem:\n stage.status === \"error\" ? \"adapter-mismatch\" : \"adapter-missing\"\n };\n case \"login\":\n return { actionId: \"login\", problem: \"login-missing\" };\n default:\n return null;\n }\n}\n\nexport interface ResolveWizardAutoStartInput {\n focus: AgentEnvPanelFocus | null;\n detected: boolean;\n ready: boolean;\n installPending: boolean;\n loginPending: boolean;\n}\n\n/**\n * Decides whether opening the wizard with a remediation focus should auto-start\n * an action. Returns the action id to run, or null when nothing should run\n * (non-remediation focus, detection not settled, already ready, or already\n * pending). The caller is responsible for firing this at most once per open.\n */\nexport function resolveWizardAutoStartAction(\n input: ResolveWizardAutoStartInput\n): \"install\" | \"login\" | null {\n const candidate = autoStartCandidate(input.focus);\n if (!candidate) {\n return null;\n }\n if (!input.detected || input.ready) {\n return null;\n }\n if (candidate === \"install\" && input.installPending) {\n return null;\n }\n if (candidate === \"login\" && input.loginPending) {\n return null;\n }\n return candidate;\n}\n\nfunction autoStartCandidate(\n focus: AgentEnvPanelFocus | null\n): \"install\" | \"login\" | null {\n switch (focus) {\n case \"install\":\n case \"repair\":\n return \"install\";\n case \"upgrade\":\n // CLI upgrades are user-driven: opening the panel from a version error\n // shows the manual upgrade command rather than auto-running an install\n // (which can't upgrade an already-present binary anyway).\n return null;\n case \"auth\":\n return \"login\";\n default:\n return null;\n }\n}\n","import type {\n AgentProviderStatus,\n WorkspaceAgentProvider\n} from \"@tutti-os/client-tuttid-ts\";\nimport {\n deriveAgentSetupStages,\n projectRevealedStages,\n reasonCodeIndicatesCliVersionUnsupported,\n type AgentSetupStage,\n type AgentSetupStageId,\n type AgentSetupStageLabels,\n type StageDetailToken\n} from \"./agentEnvWizardFlow.ts\";\nimport type {\n CodexSetupActiveAction,\n CodexSetupActiveActionError,\n CodexSetupPhase\n} from \"./codexSetupContract.ts\";\n\nexport interface NetworkCheck {\n kind: \"registry\" | \"api\" | \"proxy\";\n reachable: boolean;\n host: string | null;\n configured?: boolean;\n}\n\nconst MANUAL_INSTALL_COMMANDS: Partial<Record<WorkspaceAgentProvider, string>> =\n {\n codex: \"npm install -g @openai/codex --include=optional\",\n \"claude-code\": \"curl -fsSL https://claude.ai/install.sh | bash\",\n cursor: \"curl https://cursor.com/install -fsS | bash\",\n opencode: \"curl -fsSL https://opencode.ai/install | bash\"\n };\n\nfunction endpointHost(endpoint: string | null | undefined): string | null {\n if (!endpoint) {\n return null;\n }\n return endpoint.replace(/^https?:\\/\\//, \"\").replace(/\\/.*$/, \"\") || null;\n}\n\n// A proxy URL may carry credentials (http://user:pass@host:port). Strip the\n// userinfo before it reaches the renderer/UI so proxy passwords are never\n// surfaced; the scheme + host:port are kept for display.\nfunction scrubProxyUrl(url: string | null | undefined): string | null {\n if (!url) {\n return null;\n }\n try {\n const parsed = new URL(url);\n parsed.username = \"\";\n parsed.password = \"\";\n return `${parsed.protocol}//${parsed.host}`;\n } catch {\n // Not a parseable URL — still strip a leading userinfo segment defensively.\n return url.replace(/\\/\\/[^/@]*@/, \"//\") || null;\n }\n}\n\nfunction textToken(text: string | null): StageDetailToken | null {\n return text ? { kind: \"text\", text } : null;\n}\n\nfunction joinDetail(parts: Array<string | null | undefined>): string | null {\n const joined = parts.filter((p): p is string => Boolean(p)).join(\" · \");\n return joined || null;\n}\n\nexport function deriveHasAnomaly(\n stages: AgentSetupStage[],\n activeActionError: CodexSetupActiveActionError | null\n): boolean {\n return stages.some((s) => s.status === \"error\") || Boolean(activeActionError);\n}\n\nexport interface AgentEnvWizardViewModelInput {\n provider: WorkspaceAgentProvider;\n status: AgentProviderStatus | null;\n isLoading: boolean;\n activeAction: CodexSetupActiveAction | null;\n installActionPending: boolean;\n updateActionPending: 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 updateAvailable: boolean;\n updating: 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 updatePending = input.updateActionPending;\n const loginPending = input.loginPending;\n const updating = updatePending || activeAction?.phase === \"update\";\n const busy =\n installPending ||\n updating ||\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 = versionTooOld;\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 updateActionPending: updatePending,\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 updateAvailable:\n updatePending ||\n (status?.update?.updateAvailable === true &&\n status.actions.some((action) => action.id === \"update\")),\n updating,\n loginPending\n };\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,E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AAK;AAAA,IACpD;AAAA,IACA,iBACE,iBACC,QAAQ,QAAQ,oBAAoB,QACnC,OAAO,QAAQ,KAAK,CAAC,WAAW,OAAO,OAAO,QAAQ;AAAA,IAC1D;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -68,19 +68,17 @@ var enAgentGuiOrchestration = {
68
68
  tuttiBudgetIntensityLabel: "Intensity",
69
69
  tuttiBudgetPreviewTitle: "Planner tendency",
70
70
  tuttiBudgetPreviewHint: "The exact model, total task count, and safe parallelism are inferred from the request and selected Skills.",
71
- tuttiBudgetPreviewCost: "Cost",
72
- tuttiBudgetPreviewBalance: "Balance",
71
+ tuttiBudgetPreviewCost: "Economical",
72
+ tuttiBudgetPreviewBalance: "Balanced",
73
73
  tuttiBudgetPreviewPowerful: "Powerful",
74
74
  tuttiBudgetModelStrengthLabel: "Model strength",
75
75
  tuttiBudgetModelStrengthCost: "Economical",
76
76
  tuttiBudgetModelStrengthBalance: "Balanced",
77
- tuttiBudgetModelStrengthPowerful: "Most capable",
77
+ tuttiBudgetModelStrengthPowerful: "Powerful",
78
78
  tuttiBudgetAgentCountLabel: "Parallel Agents",
79
79
  tuttiBudgetAgentCountCost: "1",
80
80
  tuttiBudgetAgentCountBalance: "2\u20133",
81
81
  tuttiBudgetAgentCountPowerful: "Up to 4",
82
- tuttiBudgetConfirm: "Confirm",
83
- tuttiBudgetCancel: "Cancel",
84
82
  tuttiModeUpdateFailed: "Tutti mode couldn't be updated. Try again.",
85
83
  tuttiModeUpdateUncertain: "Tutti mode is still being reconciled. Try again after it finishes.",
86
84
  tuttiModePlan: enTuttiModePlan,
@@ -254,17 +252,12 @@ var enAgentGuiRuntimeNotices = {
254
252
  visibleErrorConfigTimeout: "{{provider}} couldn't apply session settings before the request timed out. Try again in a moment.",
255
253
  visibleErrorStreamDisconnected: "{{provider}}'s response was interrupted before it completed. Try again in a moment.",
256
254
  visibleErrorConcurrencyLimit: "{{provider}} is handling too many requests right now. Try again after another task finishes.",
257
- visibleErrorInsufficientCreditsFree: "Your available credits are exhausted. Upgrade your membership for more credits",
258
- visibleErrorInsufficientCreditsActive: "Your Tutti credits are insufficient. Recharge credits to continue",
259
255
  visibleErrorInsufficientCreditsUnknown: "Your Tutti credits are insufficient. Review credit options to continue",
260
256
  visibleErrorActionInstall: "Connect",
261
257
  visibleErrorActionUpgrade: "Upgrade",
262
258
  visibleErrorActionRelogin: "Sign in",
263
259
  visibleErrorActionCheckNetwork: "Check network",
264
260
  visibleErrorActionDetect: "Open setup",
265
- visibleErrorActionUpgradeMembership: "Upgrade membership",
266
- visibleErrorActionRechargeCredits: "Recharge credits",
267
- visibleErrorActionViewCreditPlans: "View credit options",
268
261
  systemNoticeTransportRetry: "Agent connection interrupted. Reconnecting...",
269
262
  systemNoticeTransportFallback: "Agent switched to HTTPS transport",
270
263
  systemNoticePlanImplementationPendingConfirmation: "Plan implementation is awaiting confirmation",
@@ -723,25 +716,6 @@ var enAgentGui = {
723
716
  },
724
717
  conversations: "Sessions",
725
718
  newConversation: "New session",
726
- accountMenuTitle: "Tutti Agent",
727
- accountMenuMember: "Membership",
728
- accountMenuUpgrade: "Upgrade",
729
- accountMenuRecharge: "Recharge credits",
730
- accountMenuViewPlans: "View credit options",
731
- accountMenuCreditsBalance: "Credits",
732
- accountMenuAccountCenter: "Account center",
733
- accountMenuSettings: "Settings",
734
- accountMenuFree: "Free",
735
- accountMenuSignIn: "Sign in",
736
- accountMenuSignOut: "Sign out",
737
- accountMenuCopyUserId: "Copy user ID",
738
- accountMenuLoading: "Loading",
739
- accountMenuUnavailable: "--",
740
- accountMenuDataUnavailable: "Some account data is unavailable",
741
- accountRewardToastTitle: "New user credits",
742
- accountRewardToastCreditsUnit: "credits",
743
- accountRewardToastDescription: "Added to account balance",
744
- accountRewardToastClose: "Close credits reward notification",
745
719
  agentConfig: "Check & Settings",
746
720
  agentSettingsMenu: "Settings",
747
721
  agentEnvSetup: "Environment Check",
@@ -3065,17 +3039,12 @@ var zhCNAgentGuiRuntimeNotices = {
3065
3039
  visibleErrorConfigTimeout: "{{provider}} \u5728\u8BF7\u6C42\u8D85\u65F6\u524D\u672A\u80FD\u5E94\u7528\u4F1A\u8BDD\u8BBE\u7F6E\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",
3066
3040
  visibleErrorStreamDisconnected: "{{provider}} \u7684\u54CD\u5E94\u5728\u5B8C\u6210\u524D\u88AB\u4E2D\u65AD\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",
3067
3041
  visibleErrorConcurrencyLimit: "{{provider}} \u5F53\u524D\u5904\u7406\u7684\u8BF7\u6C42\u8FC7\u591A\u3002\u8BF7\u5728\u5176\u4ED6\u4EFB\u52A1\u5B8C\u6210\u540E\u518D\u8BD5\u3002",
3068
- visibleErrorInsufficientCreditsFree: "\u60A8\u8D26\u6237\u4E0B\u53EF\u7528\u7684\u79EF\u5206\u989D\u5EA6\u5DF2\u8017\u5C3D\uFF0C\u5347\u7EA7\u4F1A\u5458\u83B7\u53D6\u66F4\u591A\u989D\u5EA6",
3069
- visibleErrorInsufficientCreditsActive: "Tutti \u79EF\u5206\u4E0D\u8DB3\uFF0C\u5145\u503C\u79EF\u5206\u540E\u53EF\u7EE7\u7EED\u4F7F\u7528",
3070
3042
  visibleErrorInsufficientCreditsUnknown: "Tutti \u79EF\u5206\u4E0D\u8DB3\uFF0C\u8BF7\u67E5\u770B\u79EF\u5206\u65B9\u6848\u540E\u7EE7\u7EED",
3071
3043
  visibleErrorActionInstall: "\u53BB\u8FDE\u63A5",
3072
3044
  visibleErrorActionUpgrade: "\u53BB\u5347\u7EA7",
3073
3045
  visibleErrorActionRelogin: "\u767B\u5F55",
3074
3046
  visibleErrorActionCheckNetwork: "\u68C0\u6D4B\u7F51\u7EDC",
3075
3047
  visibleErrorActionDetect: "\u6253\u5F00\u68C0\u6D4B",
3076
- visibleErrorActionUpgradeMembership: "\u5347\u7EA7\u4F1A\u5458",
3077
- visibleErrorActionRechargeCredits: "\u5145\u503C\u79EF\u5206",
3078
- visibleErrorActionViewCreditPlans: "\u67E5\u770B\u79EF\u5206\u65B9\u6848",
3079
3048
  systemNoticeTransportRetry: "Agent \u8FDE\u63A5\u4E2D\u65AD\uFF0C\u6B63\u5728\u91CD\u8FDE",
3080
3049
  systemNoticeTransportFallback: "Agent \u5DF2\u5207\u6362\u5230 HTTPS \u4F20\u8F93",
3081
3050
  systemNoticePlanImplementationPendingConfirmation: "\u8BA1\u5212\u5B9E\u73B0\u6B63\u5728\u7B49\u5F85\u786E\u8BA4",
@@ -3463,8 +3432,6 @@ var zhCNAgentGui = {
3463
3432
  tuttiBudgetAgentCountCost: "1 \u4E2A",
3464
3433
  tuttiBudgetAgentCountBalance: "2\u20133 \u4E2A",
3465
3434
  tuttiBudgetAgentCountPowerful: "\u6700\u591A 4 \u4E2A",
3466
- tuttiBudgetConfirm: "\u786E\u8BA4",
3467
- tuttiBudgetCancel: "\u53D6\u6D88",
3468
3435
  tuttiModeUpdateFailed: "Tutti \u6A21\u5F0F\u66F4\u65B0\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",
3469
3436
  tuttiModeUpdateUncertain: "Tutti \u6A21\u5F0F\u72B6\u6001\u4ECD\u5728\u786E\u8BA4\u4E2D\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5",
3470
3437
  tuttiModePlan: zhCNTuttiModePlan,
@@ -3599,25 +3566,6 @@ var zhCNAgentGui = {
3599
3566
  },
3600
3567
  conversations: "\u4F1A\u8BDD",
3601
3568
  newConversation: "\u65B0\u5EFA\u4F1A\u8BDD",
3602
- accountMenuTitle: "Tutti Agent",
3603
- accountMenuMember: "\u4F1A\u5458",
3604
- accountMenuUpgrade: "\u5347\u7EA7\u4F1A\u5458",
3605
- accountMenuRecharge: "\u5145\u503C\u79EF\u5206",
3606
- accountMenuViewPlans: "\u67E5\u770B\u79EF\u5206\u65B9\u6848",
3607
- accountMenuCreditsBalance: "\u79EF\u5206\u4F59\u989D",
3608
- accountMenuAccountCenter: "\u8D26\u53F7\u4E2D\u5FC3",
3609
- accountMenuSettings: "\u8BBE\u7F6E",
3610
- accountMenuFree: "Free",
3611
- accountMenuSignIn: "\u767B\u5F55",
3612
- accountMenuSignOut: "\u9000\u51FA\u767B\u5F55",
3613
- accountMenuCopyUserId: "\u590D\u5236\u7528\u6237 ID",
3614
- accountMenuLoading: "\u52A0\u8F7D\u4E2D",
3615
- accountMenuUnavailable: "--",
3616
- accountMenuDataUnavailable: "\u90E8\u5206\u8D26\u53F7\u6570\u636E\u6682\u4E0D\u53EF\u7528",
3617
- accountRewardToastTitle: "\u65B0\u7528\u6237\u79EF\u5206\u5230\u8D26",
3618
- accountRewardToastCreditsUnit: "\u79EF\u5206",
3619
- accountRewardToastDescription: "\u5DF2\u52A0\u5165\u8D26\u6237\u4F59\u989D",
3620
- accountRewardToastClose: "\u5173\u95ED\u79EF\u5206\u5230\u8D26\u63D0\u793A",
3621
3569
  agentConfig: "\u68C0\u6D4B\u4E0E\u8BBE\u7F6E",
3622
3570
  agentSettingsMenu: "\u8BBE\u7F6E",
3623
3571
  agentEnvSetup: "\u73AF\u5883\u68C0\u6D4B",
@@ -5824,4 +5772,4 @@ export {
5824
5772
  translateInUiLanguage,
5825
5773
  getActiveUiLanguage
5826
5774
  };
5827
- //# sourceMappingURL=chunk-Y2VQMPUR.js.map
5775
+ //# sourceMappingURL=chunk-QVLEP54U.js.map