@hyperwindmill/caretaker-cli 0.24.0 → 0.25.0

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/dist/acp/index.d.ts +3 -0
  2. package/dist/acp/index.d.ts.map +1 -0
  3. package/dist/acp/index.js +2 -0
  4. package/dist/acp/install.d.ts +12 -0
  5. package/dist/acp/install.d.ts.map +1 -0
  6. package/dist/acp/install.js +110 -0
  7. package/dist/acp/registry.d.ts +10 -0
  8. package/dist/acp/registry.d.ts.map +1 -0
  9. package/dist/acp/registry.js +116 -0
  10. package/dist/cli/web/mcp_bridge.d.ts +7 -1
  11. package/dist/cli/web/mcp_bridge.d.ts.map +1 -1
  12. package/dist/cli/web/mcp_bridge.js +10 -6
  13. package/dist/cli/web/scheduler/memory_sweep.d.ts.map +1 -1
  14. package/dist/cli/web/scheduler/memory_sweep.js +1 -0
  15. package/dist/cli/web/scheduler/task_review.d.ts.map +1 -1
  16. package/dist/cli/web/scheduler/task_review.js +25 -0
  17. package/dist/cli/web/scheduler/task_roles.d.ts +1 -1
  18. package/dist/cli/web/scheduler/task_roles.d.ts.map +1 -1
  19. package/dist/cli/web/scheduler/task_roles.js +6 -6
  20. package/dist/cli/web/scheduler/task_strategy.d.ts.map +1 -1
  21. package/dist/cli/web/scheduler/task_strategy.js +23 -2
  22. package/dist/cli/web/server.d.ts +1 -1
  23. package/dist/cli/web/server.d.ts.map +1 -1
  24. package/dist/cli/web/server.js +27 -5
  25. package/dist/harness/acp_policy.d.ts +41 -0
  26. package/dist/harness/acp_policy.d.ts.map +1 -0
  27. package/dist/harness/acp_policy.js +59 -0
  28. package/dist/harness/acp_pool.d.ts +33 -0
  29. package/dist/harness/acp_pool.d.ts.map +1 -0
  30. package/dist/harness/acp_pool.js +148 -0
  31. package/dist/harness/acp_runner.d.ts +4 -0
  32. package/dist/harness/acp_runner.d.ts.map +1 -0
  33. package/dist/harness/acp_runner.js +347 -0
  34. package/dist/harness/claude_code_runner.d.ts +2 -0
  35. package/dist/harness/claude_code_runner.d.ts.map +1 -1
  36. package/dist/harness/claude_code_runner.js +1 -1
  37. package/dist/harness/confirm_gate.d.ts +12 -0
  38. package/dist/harness/confirm_gate.d.ts.map +1 -0
  39. package/dist/harness/confirm_gate.js +33 -0
  40. package/dist/harness/index.d.ts +1 -0
  41. package/dist/harness/index.d.ts.map +1 -1
  42. package/dist/harness/index.js +1 -0
  43. package/dist/harness/loop.d.ts +3 -0
  44. package/dist/harness/loop.d.ts.map +1 -1
  45. package/dist/harness/loop.js +6 -0
  46. package/dist/harness/memory_recall.d.ts +8 -3
  47. package/dist/harness/memory_recall.d.ts.map +1 -1
  48. package/dist/harness/memory_recall.js +11 -7
  49. package/dist/harness/title.js +1 -1
  50. package/dist/mcp/builtin_server.d.ts +1 -0
  51. package/dist/mcp/builtin_server.d.ts.map +1 -1
  52. package/dist/mcp/builtin_server.js +3 -2
  53. package/dist/mcp/run_command_tool.d.ts +13 -0
  54. package/dist/mcp/run_command_tool.d.ts.map +1 -0
  55. package/dist/mcp/run_command_tool.js +51 -0
  56. package/dist/session/store.d.ts +1 -0
  57. package/dist/session/store.d.ts.map +1 -1
  58. package/dist/session/store.js +6 -0
  59. package/dist/session/types.d.ts +3 -0
  60. package/dist/session/types.d.ts.map +1 -1
  61. package/dist/tui/agents.d.ts.map +1 -1
  62. package/dist/tui/agents.js +57 -23
  63. package/dist/tui/chat.d.ts.map +1 -1
  64. package/dist/tui/chat.js +7 -8
  65. package/dist/tui/providers.d.ts.map +1 -1
  66. package/dist/tui/providers.js +116 -17
  67. package/dist/webview/standalone.css +18 -0
  68. package/dist/webview/standalone.css.map +2 -2
  69. package/dist/webview/standalone.js +235 -25
  70. package/dist/webview/standalone.js.map +2 -2
  71. package/package.json +8 -3
@@ -15916,7 +15916,15 @@ ${text}</tr>
15916
15916
  // src/ProvidersTab.tsx
15917
15917
  var import_react6 = __toESM(require_react(), 1);
15918
15918
  var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
15919
- function ProvidersTab({ config, agents, postMessage }) {
15919
+ function ProvidersTab({
15920
+ config,
15921
+ agents,
15922
+ postMessage,
15923
+ acpRegistry = null,
15924
+ acpInstall = null,
15925
+ resetAcpInstall = () => {
15926
+ }
15927
+ }) {
15920
15928
  const [editingProvider, setEditingProvider] = (0, import_react6.useState)(null);
15921
15929
  const [isCreating, setIsCreating] = (0, import_react6.useState)(false);
15922
15930
  const [name, setName] = (0, import_react6.useState)("");
@@ -15924,7 +15932,50 @@ ${text}</tr>
15924
15932
  const [endpoint, setEndpoint] = (0, import_react6.useState)("");
15925
15933
  const [apiKey, setApiKey] = (0, import_react6.useState)("");
15926
15934
  const [command, setCommand] = (0, import_react6.useState)("");
15935
+ const [args, setArgs] = (0, import_react6.useState)("");
15936
+ const [presetId, setPresetId] = (0, import_react6.useState)("custom");
15937
+ const [selfLoaded, setSelfLoaded] = (0, import_react6.useState)([]);
15938
+ const [presetEnv, setPresetEnv] = (0, import_react6.useState)(void 0);
15939
+ const [installing, setInstalling] = (0, import_react6.useState)(false);
15927
15940
  const [errorMsg, setErrorMsg] = (0, import_react6.useState)(null);
15941
+ const selectedPreset = acpRegistry?.ok ? acpRegistry.agents.find((a) => a.id === presetId) : null;
15942
+ (0, import_react6.useEffect)(() => {
15943
+ if (type === "acp" && acpRegistry === null) {
15944
+ postMessage({ type: "fetchAcpRegistry" });
15945
+ }
15946
+ }, [type, acpRegistry, postMessage]);
15947
+ (0, import_react6.useEffect)(() => {
15948
+ if (acpInstall?.agentId === presetId && acpInstall.result) {
15949
+ if (acpInstall.result.ok) {
15950
+ if (acpInstall.result.command) setCommand(acpInstall.result.command);
15951
+ setArgs((acpInstall.result.args ?? []).join(" "));
15952
+ if (acpInstall.result.env) setPresetEnv(acpInstall.result.env);
15953
+ setInstalling(false);
15954
+ } else {
15955
+ setErrorMsg(acpInstall.result.error || "Installation failed");
15956
+ setInstalling(false);
15957
+ }
15958
+ }
15959
+ }, [acpInstall, presetId]);
15960
+ const applyPreset = (id) => {
15961
+ setPresetId(id);
15962
+ if (id === "custom") {
15963
+ setSelfLoaded([]);
15964
+ setPresetEnv(void 0);
15965
+ return;
15966
+ }
15967
+ const preset = acpRegistry?.ok ? acpRegistry.agents.find((a) => a.id === id) : null;
15968
+ if (!preset || !preset.dist) return;
15969
+ setSelfLoaded(preset.selfLoadedContextFiles);
15970
+ setPresetEnv(preset.dist.env);
15971
+ if (preset.dist.kind === "binary") {
15972
+ setCommand("");
15973
+ setArgs("");
15974
+ } else {
15975
+ setCommand(preset.dist.command);
15976
+ setArgs(preset.dist.args.join(" "));
15977
+ }
15978
+ };
15928
15979
  const startEdit = (provider) => {
15929
15980
  setEditingProvider(provider);
15930
15981
  setIsCreating(false);
@@ -15933,6 +15984,11 @@ ${text}</tr>
15933
15984
  setEndpoint(provider.endpoint);
15934
15985
  setApiKey(provider.apiKey || "");
15935
15986
  setCommand(provider.command || "");
15987
+ setArgs((provider.args ?? []).join(" "));
15988
+ setPresetId("custom");
15989
+ setSelfLoaded(provider.selfLoadedContextFiles ?? []);
15990
+ setPresetEnv(provider.env);
15991
+ setInstalling(false);
15936
15992
  setErrorMsg(null);
15937
15993
  };
15938
15994
  const startCreate = () => {
@@ -15943,11 +15999,20 @@ ${text}</tr>
15943
15999
  setEndpoint("");
15944
16000
  setApiKey("");
15945
16001
  setCommand("");
16002
+ setArgs("");
16003
+ setPresetId("custom");
16004
+ setSelfLoaded([]);
16005
+ setPresetEnv(void 0);
16006
+ setInstalling(false);
15946
16007
  setErrorMsg(null);
15947
16008
  };
15948
16009
  const cancelForm = () => {
15949
16010
  setIsCreating(false);
15950
16011
  setEditingProvider(null);
16012
+ setPresetId("custom");
16013
+ setSelfLoaded([]);
16014
+ setPresetEnv(void 0);
16015
+ setInstalling(false);
15951
16016
  setErrorMsg(null);
15952
16017
  };
15953
16018
  const validateAndSave = () => {
@@ -15956,11 +16021,17 @@ ${text}</tr>
15956
16021
  const trimmedApiKey = apiKey.trim();
15957
16022
  const trimmedCommand = command.trim();
15958
16023
  const isClaudeCode = type === "claude-code";
16024
+ const isAcp = type === "acp";
15959
16025
  if (!trimmedName) {
15960
16026
  setErrorMsg("Name is required.");
15961
16027
  return;
15962
16028
  }
15963
- if (!isClaudeCode) {
16029
+ if (isAcp) {
16030
+ if (!trimmedCommand) {
16031
+ setErrorMsg("Command is required for ACP agents (e.g. npx or binary path).");
16032
+ return;
16033
+ }
16034
+ } else if (!isClaudeCode) {
15964
16035
  if (!trimmedEndpoint) {
15965
16036
  setErrorMsg("Endpoint is required.");
15966
16037
  return;
@@ -15982,16 +16053,35 @@ ${text}</tr>
15982
16053
  return;
15983
16054
  }
15984
16055
  const updatedProviders = [...config.providers];
15985
- const newProv = isClaudeCode ? {
15986
- name: trimmedName,
15987
- type,
15988
- endpoint: "",
15989
- ...trimmedCommand ? { command: trimmedCommand } : {}
15990
- } : {
15991
- name: trimmedName,
15992
- endpoint: trimmedEndpoint,
15993
- ...trimmedApiKey ? { apiKey: trimmedApiKey } : {}
15994
- };
16056
+ let newProv;
16057
+ if (isAcp) {
16058
+ const p = {
16059
+ name: trimmedName,
16060
+ type: "acp",
16061
+ endpoint: "",
16062
+ command: trimmedCommand
16063
+ };
16064
+ const argList = args.trim() ? args.trim().split(/\s+/) : [];
16065
+ if (argList.length) p.args = argList;
16066
+ const envToSave = presetEnv ?? editingProvider?.env;
16067
+ if (envToSave) p.env = envToSave;
16068
+ const selfLoadedToSave = selfLoaded.length ? selfLoaded : editingProvider?.selfLoadedContextFiles;
16069
+ if (selfLoadedToSave && selfLoadedToSave.length) p.selfLoadedContextFiles = selfLoadedToSave;
16070
+ newProv = p;
16071
+ } else if (isClaudeCode) {
16072
+ newProv = {
16073
+ name: trimmedName,
16074
+ type: "claude-code",
16075
+ endpoint: "",
16076
+ ...trimmedCommand ? { command: trimmedCommand } : {}
16077
+ };
16078
+ } else {
16079
+ newProv = {
16080
+ name: trimmedName,
16081
+ endpoint: trimmedEndpoint,
16082
+ ...trimmedApiKey ? { apiKey: trimmedApiKey } : {}
16083
+ };
16084
+ }
15995
16085
  if (isCreating) {
15996
16086
  updatedProviders.push(newProv);
15997
16087
  } else if (editingProvider) {
@@ -16052,7 +16142,8 @@ ${text}</tr>
16052
16142
  disabled: editingProvider !== null,
16053
16143
  children: [
16054
16144
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "openai", children: "OpenAI-compatible endpoint" }),
16055
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "claude-code", children: "Claude Code (local CLI)" })
16145
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "claude-code", children: "Claude Code (local CLI)" }),
16146
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "acp", children: "External agent (ACP)" })
16056
16147
  ]
16057
16148
  }
16058
16149
  )
@@ -16064,14 +16155,82 @@ ${text}</tr>
16064
16155
  {
16065
16156
  id: "provider-name",
16066
16157
  type: "text",
16067
- placeholder: "e.g. Ollama, OpenRouter",
16158
+ placeholder: "e.g. Ollama, OpenRouter, ACP",
16068
16159
  value: name,
16069
16160
  onChange: (e) => setName(e.target.value),
16070
16161
  disabled: editingProvider !== null
16071
16162
  }
16072
16163
  )
16073
16164
  ] }),
16074
- type === "claude-code" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "form-group", children: [
16165
+ type === "acp" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
16166
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "form-group", children: [
16167
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: "acp-preset", children: "Agent" }),
16168
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
16169
+ "select",
16170
+ {
16171
+ id: "acp-preset",
16172
+ value: presetId,
16173
+ onChange: (e) => applyPreset(e.target.value),
16174
+ children: [
16175
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "custom", children: "Custom (manual command)" }),
16176
+ acpRegistry?.ok && acpRegistry.agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("option", { value: a.id, disabled: a.dist === null, children: [
16177
+ a.name,
16178
+ a.dist === null ? " (not available on this platform)" : ""
16179
+ ] }, a.id))
16180
+ ]
16181
+ }
16182
+ ),
16183
+ acpRegistry && !acpRegistry.ok && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { className: "form-error", children: [
16184
+ "Registry unavailable: ",
16185
+ acpRegistry.error,
16186
+ " \u2014 use Custom."
16187
+ ] })
16188
+ ] }),
16189
+ selectedPreset?.dist?.kind === "binary" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "form-group", children: [
16190
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
16191
+ "button",
16192
+ {
16193
+ type: "button",
16194
+ className: "btn btn--secondary",
16195
+ disabled: installing,
16196
+ onClick: () => {
16197
+ resetAcpInstall();
16198
+ setInstalling(true);
16199
+ postMessage({ type: "installAcpAgent", agentId: presetId });
16200
+ },
16201
+ children: installing ? "Installing\u2026" : "Install"
16202
+ }
16203
+ ),
16204
+ acpInstall?.agentId === presetId && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { className: "install-log", children: acpInstall.lines.join("\n") })
16205
+ ] }),
16206
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "form-group", children: [
16207
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: "provider-command", children: "Command" }),
16208
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
16209
+ "input",
16210
+ {
16211
+ id: "provider-command",
16212
+ type: "text",
16213
+ placeholder: selectedPreset?.dist?.kind === "binary" ? "filled by Install, or paste the binary path" : "npx",
16214
+ value: command,
16215
+ onChange: (e) => setCommand(e.target.value)
16216
+ }
16217
+ )
16218
+ ] }),
16219
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "form-group", children: [
16220
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: "provider-args", children: "Arguments" }),
16221
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
16222
+ "input",
16223
+ {
16224
+ id: "provider-args",
16225
+ type: "text",
16226
+ placeholder: "@agentclientprotocol/claude-agent-acp",
16227
+ value: args,
16228
+ onChange: (e) => setArgs(e.target.value)
16229
+ }
16230
+ ),
16231
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { style: { fontSize: "11px", color: "var(--vscode-descriptionForeground)", lineHeight: "1.4", margin: "4px 0 0" }, children: "Space-separated. Env vars can be added by editing caretaker.json." })
16232
+ ] })
16233
+ ] }) : type === "claude-code" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "form-group", children: [
16075
16234
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: "provider-command", children: "Command (Optional)" }),
16076
16235
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
16077
16236
  "input",
@@ -16120,7 +16279,7 @@ ${text}</tr>
16120
16279
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "settings-list", children: config.providers.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "empty-message", children: "No providers registered. Add one to connect your agents." }) : config.providers.map((prov) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "settings-card", children: [
16121
16280
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "settings-card__body", children: [
16122
16281
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "settings-card__title", children: prov.name }),
16123
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "settings-card__subtitle", children: prov.type === "claude-code" ? `Claude Code (local CLI)${prov.command ? ` \u2014 ${prov.command}` : ""}` : prov.endpoint }),
16282
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "settings-card__subtitle", children: prov.type === "acp" ? `External agent (ACP) \u2014 ${prov.command ?? ""} ${(prov.args ?? []).join(" ")}`.trim() : prov.type === "claude-code" ? `Claude Code (local CLI)${prov.command ? ` \u2014 ${prov.command}` : ""}` : prov.endpoint }),
16124
16283
  prov.apiKey && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "settings-card__badge", children: "Key Configured" })
16125
16284
  ] }),
16126
16285
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "settings-card__actions", children: [
@@ -16997,6 +17156,7 @@ ${text}</tr>
16997
17156
  const [maxTurns, setMaxTurns] = (0, import_react10.useState)(30);
16998
17157
  const [workingDir, setWorkingDir] = (0, import_react10.useState)("");
16999
17158
  const [permissionMode, setPermissionMode] = (0, import_react10.useState)("");
17159
+ const [acpMode, setAcpMode] = (0, import_react10.useState)("");
17000
17160
  const [strictMcp, setStrictMcp] = (0, import_react10.useState)(false);
17001
17161
  const [selectedTools, setSelectedTools] = (0, import_react10.useState)({});
17002
17162
  const [confirmTools, setConfirmTools] = (0, import_react10.useState)({});
@@ -17006,6 +17166,8 @@ ${text}</tr>
17006
17166
  const [errorMsg, setErrorMsg] = (0, import_react10.useState)(null);
17007
17167
  const providerType = config.providers.find((p) => p.name === provider)?.type ?? "openai";
17008
17168
  const isClaudeCode = providerType === "claude-code";
17169
+ const isAcp = providerType === "acp";
17170
+ const isExternalRunner = isClaudeCode || isAcp;
17009
17171
  (0, import_react10.useEffect)(() => {
17010
17172
  if (modelsResult) {
17011
17173
  setFetchingModels(false);
@@ -17025,6 +17187,7 @@ ${text}</tr>
17025
17187
  setMaxTurns(30);
17026
17188
  setWorkingDir("");
17027
17189
  setPermissionMode("");
17190
+ setAcpMode("");
17028
17191
  setStrictMcp(false);
17029
17192
  const initialTools = {};
17030
17193
  availableTools.forEach((t) => {
@@ -17047,6 +17210,7 @@ ${text}</tr>
17047
17210
  setMaxTurns(agent.maxTurns || 30);
17048
17211
  setWorkingDir(agent.workingDir || "");
17049
17212
  setPermissionMode(agent.permissionMode ?? "");
17213
+ setAcpMode(agent.acpMode ?? "");
17050
17214
  setStrictMcp(agent.strictMcp ?? false);
17051
17215
  const initialTools = {};
17052
17216
  const initialConfirm = {};
@@ -17109,7 +17273,7 @@ ${text}</tr>
17109
17273
  setErrorMsg("Provider is required.");
17110
17274
  return;
17111
17275
  }
17112
- if (!trimmedModel) {
17276
+ if (!trimmedModel && !isAcp) {
17113
17277
  setErrorMsg("Model is required.");
17114
17278
  return;
17115
17279
  }
@@ -17128,9 +17292,9 @@ ${text}</tr>
17128
17292
  setErrorMsg(`An agent named "${trimmedName}" already exists.`);
17129
17293
  return;
17130
17294
  }
17131
- const allowedToolsList = isClaudeCode ? editingAgent?.allowedTools ?? [] : Object.keys(selectedTools).filter((t) => selectedTools[t]);
17132
- const confirmToolsList = isClaudeCode ? editingAgent?.confirmTools ?? [] : Object.keys(confirmTools).filter((t) => selectedTools[t] && confirmTools[t]);
17133
- const pluginsList = isClaudeCode ? editingAgent?.plugins ?? [] : Object.keys(selectedPlugins).filter((p) => selectedPlugins[p]);
17295
+ const allowedToolsList = isExternalRunner ? editingAgent?.allowedTools ?? [] : Object.keys(selectedTools).filter((t) => selectedTools[t]);
17296
+ const confirmToolsList = isExternalRunner ? editingAgent?.confirmTools ?? [] : Object.keys(confirmTools).filter((t) => selectedTools[t] && confirmTools[t]);
17297
+ const pluginsList = isExternalRunner ? editingAgent?.plugins ?? [] : Object.keys(selectedPlugins).filter((p) => selectedPlugins[p]);
17134
17298
  const mcpServersList = Object.keys(selectedMcpServers).filter((s) => selectedMcpServers[s]);
17135
17299
  const finalAgent = {
17136
17300
  id: editingAgent ? editingAgent.id : `agent-${Math.random().toString(36).substring(2, 10)}`,
@@ -17145,6 +17309,7 @@ ${text}</tr>
17145
17309
  maxTurns,
17146
17310
  ...trimmedWorkingDir ? { workingDir: trimmedWorkingDir } : {},
17147
17311
  ...isClaudeCode && permissionMode ? { permissionMode } : {},
17312
+ ...isAcp && acpMode.trim() ? { acpMode: acpMode.trim() } : {},
17148
17313
  ...isClaudeCode && strictMcp ? { strictMcp: true } : {},
17149
17314
  // Preserve plugin-managed properties
17150
17315
  ...editingAgent?.pluginId ? { pluginId: editingAgent.pluginId } : {},
@@ -17221,7 +17386,7 @@ ${text}</tr>
17221
17386
  }
17222
17387
  )
17223
17388
  ] }),
17224
- !isClaudeCode && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "form-group", children: [
17389
+ !isExternalRunner && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "form-group", children: [
17225
17390
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: "agent-turns", children: "Max Turns" }),
17226
17391
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
17227
17392
  "input",
@@ -17239,7 +17404,7 @@ ${text}</tr>
17239
17404
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "form-group", children: [
17240
17405
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: "agent-model", children: "Model" }),
17241
17406
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "input-with-action", children: [
17242
- !isClaudeCode && modelsResult?.ok ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
17407
+ !isExternalRunner && modelsResult?.ok ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
17243
17408
  "select",
17244
17409
  {
17245
17410
  id: "agent-model",
@@ -17255,12 +17420,12 @@ ${text}</tr>
17255
17420
  {
17256
17421
  id: "agent-model",
17257
17422
  type: "text",
17258
- placeholder: isClaudeCode ? "sonnet | opus | haiku (or full model id)" : "e.g. claude-3-5-sonnet-latest",
17423
+ placeholder: isClaudeCode ? "sonnet | opus | haiku (or full model id)" : isAcp ? "optional \u2014 label shown in task threads" : "e.g. claude-3-5-sonnet-latest",
17259
17424
  value: model,
17260
17425
  onChange: (e) => setModel(e.target.value)
17261
17426
  }
17262
17427
  ),
17263
- !isClaudeCode && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
17428
+ !isExternalRunner && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
17264
17429
  "button",
17265
17430
  {
17266
17431
  type: "button",
@@ -17323,6 +17488,25 @@ ${text}</tr>
17323
17488
  ] })
17324
17489
  ] })
17325
17490
  ] })
17491
+ ) : isAcp ? (
17492
+ /* ACP agents own their tools and permissions; the native pickers don't apply. */
17493
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
17494
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "form-group", children: [
17495
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: "agent-acp-mode", children: "Session mode (Optional)" }),
17496
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
17497
+ "input",
17498
+ {
17499
+ id: "agent-acp-mode",
17500
+ type: "text",
17501
+ placeholder: "e.g. acceptEdits | bypassPermissions (agent-specific)",
17502
+ value: acpMode,
17503
+ onChange: (e) => setAcpMode(e.target.value)
17504
+ }
17505
+ ),
17506
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { style: { fontSize: "11px", color: "var(--vscode-descriptionForeground)", lineHeight: "1.4", margin: "4px 0 0" }, children: "Pins the agent to one of its own permission modes at session start (session/set_mode). Unknown modes are ignored with a warning; autonomous task runs ignore this." })
17507
+ ] }),
17508
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { style: { fontSize: "11px", color: "var(--vscode-descriptionForeground)", lineHeight: "1.4", margin: "4px 0 0" }, children: "ACP agents use the agent's own tools and permission model. When the agent asks for permission, caretaker shows a confirmation card in interactive chats; unattended runs (scheduler, tasks) are auto-approved with the task policy applied." }) })
17509
+ ] })
17326
17510
  ) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
17327
17511
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "form-group form-group--chips", children: [
17328
17512
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { children: "Exposed Tools" }),
@@ -19900,6 +20084,9 @@ ${text}</tr>
19900
20084
  postMessage,
19901
20085
  settingsData,
19902
20086
  modelsResult,
20087
+ acpRegistry,
20088
+ acpInstall,
20089
+ resetAcpInstall,
19903
20090
  sttCatalogResult,
19904
20091
  ttsCatalogResult,
19905
20092
  setModelsResult,
@@ -19933,7 +20120,10 @@ ${text}</tr>
19933
20120
  {
19934
20121
  config,
19935
20122
  agents,
19936
- postMessage
20123
+ postMessage,
20124
+ acpRegistry,
20125
+ acpInstall,
20126
+ resetAcpInstall
19937
20127
  }
19938
20128
  );
19939
20129
  case "projects":
@@ -22077,6 +22267,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
22077
22267
  const [activeScreen, setActiveScreen] = (0, import_react20.useState)("chat");
22078
22268
  const [settingsData, setSettingsData] = (0, import_react20.useState)(null);
22079
22269
  const [modelsResult, setModelsResult] = (0, import_react20.useState)(null);
22270
+ const [acpRegistry, setAcpRegistry] = (0, import_react20.useState)(null);
22271
+ const [acpInstall, setAcpInstall] = (0, import_react20.useState)(null);
22080
22272
  const [refreshingSourceId, setRefreshingSourceId] = (0, import_react20.useState)(null);
22081
22273
  const [refreshOutcome, setRefreshOutcome] = (0, import_react20.useState)(null);
22082
22274
  const [mcpAuthOutcome, setMcpAuthOutcome] = (0, import_react20.useState)(null);
@@ -22145,6 +22337,21 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
22145
22337
  case "modelsFetched":
22146
22338
  setModelsResult(msg.result);
22147
22339
  return;
22340
+ case "acpRegistryFetched":
22341
+ setAcpRegistry(msg.result);
22342
+ return;
22343
+ case "acpInstallProgress":
22344
+ setAcpInstall(
22345
+ (prev) => prev && prev.agentId === msg.agentId ? { ...prev, lines: [...prev.lines, msg.line] } : { agentId: msg.agentId, lines: [msg.line] }
22346
+ );
22347
+ return;
22348
+ case "acpInstallResult":
22349
+ setAcpInstall((prev) => ({
22350
+ agentId: msg.agentId,
22351
+ lines: prev?.agentId === msg.agentId ? prev.lines : [],
22352
+ result: { ok: msg.ok, command: msg.command, args: msg.args, env: msg.env, error: msg.error }
22353
+ }));
22354
+ return;
22148
22355
  case "voiceModelsFetched":
22149
22356
  if (msg.target === "tts") setTtsCatalogResult(msg.result);
22150
22357
  else setSttCatalogResult(msg.result);
@@ -22312,6 +22519,9 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
22312
22519
  postMessage,
22313
22520
  settingsData,
22314
22521
  modelsResult,
22522
+ acpRegistry,
22523
+ acpInstall,
22524
+ resetAcpInstall: () => setAcpInstall(null),
22315
22525
  sttCatalogResult,
22316
22526
  ttsCatalogResult,
22317
22527
  setModelsResult,