@hyperwindmill/caretaker-cli 0.24.0 → 0.25.1

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 +34 -0
  29. package/dist/harness/acp_pool.d.ts.map +1 -0
  30. package/dist/harness/acp_pool.js +154 -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 +385 -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 +230 -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,45 @@ ${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
+ setCommand(preset.dist.kind === "binary" ? "" : preset.dist.command);
15972
+ setArgs((preset.dist.args ?? []).join(" "));
15973
+ };
15928
15974
  const startEdit = (provider) => {
15929
15975
  setEditingProvider(provider);
15930
15976
  setIsCreating(false);
@@ -15933,6 +15979,11 @@ ${text}</tr>
15933
15979
  setEndpoint(provider.endpoint);
15934
15980
  setApiKey(provider.apiKey || "");
15935
15981
  setCommand(provider.command || "");
15982
+ setArgs((provider.args ?? []).join(" "));
15983
+ setPresetId("custom");
15984
+ setSelfLoaded(provider.selfLoadedContextFiles ?? []);
15985
+ setPresetEnv(provider.env);
15986
+ setInstalling(false);
15936
15987
  setErrorMsg(null);
15937
15988
  };
15938
15989
  const startCreate = () => {
@@ -15943,11 +15994,20 @@ ${text}</tr>
15943
15994
  setEndpoint("");
15944
15995
  setApiKey("");
15945
15996
  setCommand("");
15997
+ setArgs("");
15998
+ setPresetId("custom");
15999
+ setSelfLoaded([]);
16000
+ setPresetEnv(void 0);
16001
+ setInstalling(false);
15946
16002
  setErrorMsg(null);
15947
16003
  };
15948
16004
  const cancelForm = () => {
15949
16005
  setIsCreating(false);
15950
16006
  setEditingProvider(null);
16007
+ setPresetId("custom");
16008
+ setSelfLoaded([]);
16009
+ setPresetEnv(void 0);
16010
+ setInstalling(false);
15951
16011
  setErrorMsg(null);
15952
16012
  };
15953
16013
  const validateAndSave = () => {
@@ -15956,11 +16016,17 @@ ${text}</tr>
15956
16016
  const trimmedApiKey = apiKey.trim();
15957
16017
  const trimmedCommand = command.trim();
15958
16018
  const isClaudeCode = type === "claude-code";
16019
+ const isAcp = type === "acp";
15959
16020
  if (!trimmedName) {
15960
16021
  setErrorMsg("Name is required.");
15961
16022
  return;
15962
16023
  }
15963
- if (!isClaudeCode) {
16024
+ if (isAcp) {
16025
+ if (!trimmedCommand) {
16026
+ setErrorMsg("Command is required for ACP agents (e.g. npx or binary path).");
16027
+ return;
16028
+ }
16029
+ } else if (!isClaudeCode) {
15964
16030
  if (!trimmedEndpoint) {
15965
16031
  setErrorMsg("Endpoint is required.");
15966
16032
  return;
@@ -15982,16 +16048,35 @@ ${text}</tr>
15982
16048
  return;
15983
16049
  }
15984
16050
  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
- };
16051
+ let newProv;
16052
+ if (isAcp) {
16053
+ const p = {
16054
+ name: trimmedName,
16055
+ type: "acp",
16056
+ endpoint: "",
16057
+ command: trimmedCommand
16058
+ };
16059
+ const argList = args.trim() ? args.trim().split(/\s+/) : [];
16060
+ if (argList.length) p.args = argList;
16061
+ const envToSave = presetEnv ?? editingProvider?.env;
16062
+ if (envToSave) p.env = envToSave;
16063
+ const selfLoadedToSave = selfLoaded.length ? selfLoaded : editingProvider?.selfLoadedContextFiles;
16064
+ if (selfLoadedToSave && selfLoadedToSave.length) p.selfLoadedContextFiles = selfLoadedToSave;
16065
+ newProv = p;
16066
+ } else if (isClaudeCode) {
16067
+ newProv = {
16068
+ name: trimmedName,
16069
+ type: "claude-code",
16070
+ endpoint: "",
16071
+ ...trimmedCommand ? { command: trimmedCommand } : {}
16072
+ };
16073
+ } else {
16074
+ newProv = {
16075
+ name: trimmedName,
16076
+ endpoint: trimmedEndpoint,
16077
+ ...trimmedApiKey ? { apiKey: trimmedApiKey } : {}
16078
+ };
16079
+ }
15995
16080
  if (isCreating) {
15996
16081
  updatedProviders.push(newProv);
15997
16082
  } else if (editingProvider) {
@@ -16052,7 +16137,8 @@ ${text}</tr>
16052
16137
  disabled: editingProvider !== null,
16053
16138
  children: [
16054
16139
  /* @__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)" })
16140
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "claude-code", children: "Claude Code (local CLI)" }),
16141
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "acp", children: "External agent (ACP)" })
16056
16142
  ]
16057
16143
  }
16058
16144
  )
@@ -16064,14 +16150,82 @@ ${text}</tr>
16064
16150
  {
16065
16151
  id: "provider-name",
16066
16152
  type: "text",
16067
- placeholder: "e.g. Ollama, OpenRouter",
16153
+ placeholder: "e.g. Ollama, OpenRouter, ACP",
16068
16154
  value: name,
16069
16155
  onChange: (e) => setName(e.target.value),
16070
16156
  disabled: editingProvider !== null
16071
16157
  }
16072
16158
  )
16073
16159
  ] }),
16074
- type === "claude-code" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "form-group", children: [
16160
+ type === "acp" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
16161
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "form-group", children: [
16162
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: "acp-preset", children: "Agent" }),
16163
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
16164
+ "select",
16165
+ {
16166
+ id: "acp-preset",
16167
+ value: presetId,
16168
+ onChange: (e) => applyPreset(e.target.value),
16169
+ children: [
16170
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "custom", children: "Custom (manual command)" }),
16171
+ acpRegistry?.ok && acpRegistry.agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("option", { value: a.id, disabled: a.dist === null, children: [
16172
+ a.name,
16173
+ a.dist === null ? " (not available on this platform)" : ""
16174
+ ] }, a.id))
16175
+ ]
16176
+ }
16177
+ ),
16178
+ acpRegistry && !acpRegistry.ok && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { className: "form-error", children: [
16179
+ "Registry unavailable: ",
16180
+ acpRegistry.error,
16181
+ " \u2014 use Custom."
16182
+ ] })
16183
+ ] }),
16184
+ selectedPreset?.dist?.kind === "binary" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "form-group", children: [
16185
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
16186
+ "button",
16187
+ {
16188
+ type: "button",
16189
+ className: "btn btn--secondary",
16190
+ disabled: installing,
16191
+ onClick: () => {
16192
+ resetAcpInstall();
16193
+ setInstalling(true);
16194
+ postMessage({ type: "installAcpAgent", agentId: presetId });
16195
+ },
16196
+ children: installing ? "Installing\u2026" : "Install"
16197
+ }
16198
+ ),
16199
+ acpInstall?.agentId === presetId && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { className: "install-log", children: acpInstall.lines.join("\n") })
16200
+ ] }),
16201
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "form-group", children: [
16202
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: "provider-command", children: "Command" }),
16203
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
16204
+ "input",
16205
+ {
16206
+ id: "provider-command",
16207
+ type: "text",
16208
+ placeholder: selectedPreset?.dist?.kind === "binary" ? "filled by Install, or paste the binary path" : "npx",
16209
+ value: command,
16210
+ onChange: (e) => setCommand(e.target.value)
16211
+ }
16212
+ )
16213
+ ] }),
16214
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "form-group", children: [
16215
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: "provider-args", children: "Arguments" }),
16216
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
16217
+ "input",
16218
+ {
16219
+ id: "provider-args",
16220
+ type: "text",
16221
+ placeholder: "@agentclientprotocol/claude-agent-acp",
16222
+ value: args,
16223
+ onChange: (e) => setArgs(e.target.value)
16224
+ }
16225
+ ),
16226
+ /* @__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." })
16227
+ ] })
16228
+ ] }) : type === "claude-code" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "form-group", children: [
16075
16229
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: "provider-command", children: "Command (Optional)" }),
16076
16230
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
16077
16231
  "input",
@@ -16120,7 +16274,7 @@ ${text}</tr>
16120
16274
  ] }) : /* @__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
16275
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "settings-card__body", children: [
16122
16276
  /* @__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 }),
16277
+ /* @__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
16278
  prov.apiKey && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "settings-card__badge", children: "Key Configured" })
16125
16279
  ] }),
16126
16280
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "settings-card__actions", children: [
@@ -16997,6 +17151,7 @@ ${text}</tr>
16997
17151
  const [maxTurns, setMaxTurns] = (0, import_react10.useState)(30);
16998
17152
  const [workingDir, setWorkingDir] = (0, import_react10.useState)("");
16999
17153
  const [permissionMode, setPermissionMode] = (0, import_react10.useState)("");
17154
+ const [acpMode, setAcpMode] = (0, import_react10.useState)("");
17000
17155
  const [strictMcp, setStrictMcp] = (0, import_react10.useState)(false);
17001
17156
  const [selectedTools, setSelectedTools] = (0, import_react10.useState)({});
17002
17157
  const [confirmTools, setConfirmTools] = (0, import_react10.useState)({});
@@ -17006,6 +17161,8 @@ ${text}</tr>
17006
17161
  const [errorMsg, setErrorMsg] = (0, import_react10.useState)(null);
17007
17162
  const providerType = config.providers.find((p) => p.name === provider)?.type ?? "openai";
17008
17163
  const isClaudeCode = providerType === "claude-code";
17164
+ const isAcp = providerType === "acp";
17165
+ const isExternalRunner = isClaudeCode || isAcp;
17009
17166
  (0, import_react10.useEffect)(() => {
17010
17167
  if (modelsResult) {
17011
17168
  setFetchingModels(false);
@@ -17025,6 +17182,7 @@ ${text}</tr>
17025
17182
  setMaxTurns(30);
17026
17183
  setWorkingDir("");
17027
17184
  setPermissionMode("");
17185
+ setAcpMode("");
17028
17186
  setStrictMcp(false);
17029
17187
  const initialTools = {};
17030
17188
  availableTools.forEach((t) => {
@@ -17047,6 +17205,7 @@ ${text}</tr>
17047
17205
  setMaxTurns(agent.maxTurns || 30);
17048
17206
  setWorkingDir(agent.workingDir || "");
17049
17207
  setPermissionMode(agent.permissionMode ?? "");
17208
+ setAcpMode(agent.acpMode ?? "");
17050
17209
  setStrictMcp(agent.strictMcp ?? false);
17051
17210
  const initialTools = {};
17052
17211
  const initialConfirm = {};
@@ -17109,7 +17268,7 @@ ${text}</tr>
17109
17268
  setErrorMsg("Provider is required.");
17110
17269
  return;
17111
17270
  }
17112
- if (!trimmedModel) {
17271
+ if (!trimmedModel && !isAcp) {
17113
17272
  setErrorMsg("Model is required.");
17114
17273
  return;
17115
17274
  }
@@ -17128,9 +17287,9 @@ ${text}</tr>
17128
17287
  setErrorMsg(`An agent named "${trimmedName}" already exists.`);
17129
17288
  return;
17130
17289
  }
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]);
17290
+ const allowedToolsList = isExternalRunner ? editingAgent?.allowedTools ?? [] : Object.keys(selectedTools).filter((t) => selectedTools[t]);
17291
+ const confirmToolsList = isExternalRunner ? editingAgent?.confirmTools ?? [] : Object.keys(confirmTools).filter((t) => selectedTools[t] && confirmTools[t]);
17292
+ const pluginsList = isExternalRunner ? editingAgent?.plugins ?? [] : Object.keys(selectedPlugins).filter((p) => selectedPlugins[p]);
17134
17293
  const mcpServersList = Object.keys(selectedMcpServers).filter((s) => selectedMcpServers[s]);
17135
17294
  const finalAgent = {
17136
17295
  id: editingAgent ? editingAgent.id : `agent-${Math.random().toString(36).substring(2, 10)}`,
@@ -17145,6 +17304,7 @@ ${text}</tr>
17145
17304
  maxTurns,
17146
17305
  ...trimmedWorkingDir ? { workingDir: trimmedWorkingDir } : {},
17147
17306
  ...isClaudeCode && permissionMode ? { permissionMode } : {},
17307
+ ...isAcp && acpMode.trim() ? { acpMode: acpMode.trim() } : {},
17148
17308
  ...isClaudeCode && strictMcp ? { strictMcp: true } : {},
17149
17309
  // Preserve plugin-managed properties
17150
17310
  ...editingAgent?.pluginId ? { pluginId: editingAgent.pluginId } : {},
@@ -17221,7 +17381,7 @@ ${text}</tr>
17221
17381
  }
17222
17382
  )
17223
17383
  ] }),
17224
- !isClaudeCode && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "form-group", children: [
17384
+ !isExternalRunner && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "form-group", children: [
17225
17385
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: "agent-turns", children: "Max Turns" }),
17226
17386
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
17227
17387
  "input",
@@ -17239,7 +17399,7 @@ ${text}</tr>
17239
17399
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "form-group", children: [
17240
17400
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: "agent-model", children: "Model" }),
17241
17401
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "input-with-action", children: [
17242
- !isClaudeCode && modelsResult?.ok ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
17402
+ !isExternalRunner && modelsResult?.ok ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
17243
17403
  "select",
17244
17404
  {
17245
17405
  id: "agent-model",
@@ -17255,12 +17415,12 @@ ${text}</tr>
17255
17415
  {
17256
17416
  id: "agent-model",
17257
17417
  type: "text",
17258
- placeholder: isClaudeCode ? "sonnet | opus | haiku (or full model id)" : "e.g. claude-3-5-sonnet-latest",
17418
+ 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
17419
  value: model,
17260
17420
  onChange: (e) => setModel(e.target.value)
17261
17421
  }
17262
17422
  ),
17263
- !isClaudeCode && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
17423
+ !isExternalRunner && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
17264
17424
  "button",
17265
17425
  {
17266
17426
  type: "button",
@@ -17323,6 +17483,25 @@ ${text}</tr>
17323
17483
  ] })
17324
17484
  ] })
17325
17485
  ] })
17486
+ ) : isAcp ? (
17487
+ /* ACP agents own their tools and permissions; the native pickers don't apply. */
17488
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
17489
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "form-group", children: [
17490
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: "agent-acp-mode", children: "Session mode (Optional)" }),
17491
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
17492
+ "input",
17493
+ {
17494
+ id: "agent-acp-mode",
17495
+ type: "text",
17496
+ placeholder: "e.g. acceptEdits | bypassPermissions (agent-specific)",
17497
+ value: acpMode,
17498
+ onChange: (e) => setAcpMode(e.target.value)
17499
+ }
17500
+ ),
17501
+ /* @__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." })
17502
+ ] }),
17503
+ /* @__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." }) })
17504
+ ] })
17326
17505
  ) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
17327
17506
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "form-group form-group--chips", children: [
17328
17507
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { children: "Exposed Tools" }),
@@ -19900,6 +20079,9 @@ ${text}</tr>
19900
20079
  postMessage,
19901
20080
  settingsData,
19902
20081
  modelsResult,
20082
+ acpRegistry,
20083
+ acpInstall,
20084
+ resetAcpInstall,
19903
20085
  sttCatalogResult,
19904
20086
  ttsCatalogResult,
19905
20087
  setModelsResult,
@@ -19933,7 +20115,10 @@ ${text}</tr>
19933
20115
  {
19934
20116
  config,
19935
20117
  agents,
19936
- postMessage
20118
+ postMessage,
20119
+ acpRegistry,
20120
+ acpInstall,
20121
+ resetAcpInstall
19937
20122
  }
19938
20123
  );
19939
20124
  case "projects":
@@ -22077,6 +22262,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
22077
22262
  const [activeScreen, setActiveScreen] = (0, import_react20.useState)("chat");
22078
22263
  const [settingsData, setSettingsData] = (0, import_react20.useState)(null);
22079
22264
  const [modelsResult, setModelsResult] = (0, import_react20.useState)(null);
22265
+ const [acpRegistry, setAcpRegistry] = (0, import_react20.useState)(null);
22266
+ const [acpInstall, setAcpInstall] = (0, import_react20.useState)(null);
22080
22267
  const [refreshingSourceId, setRefreshingSourceId] = (0, import_react20.useState)(null);
22081
22268
  const [refreshOutcome, setRefreshOutcome] = (0, import_react20.useState)(null);
22082
22269
  const [mcpAuthOutcome, setMcpAuthOutcome] = (0, import_react20.useState)(null);
@@ -22145,6 +22332,21 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
22145
22332
  case "modelsFetched":
22146
22333
  setModelsResult(msg.result);
22147
22334
  return;
22335
+ case "acpRegistryFetched":
22336
+ setAcpRegistry(msg.result);
22337
+ return;
22338
+ case "acpInstallProgress":
22339
+ setAcpInstall(
22340
+ (prev) => prev && prev.agentId === msg.agentId ? { ...prev, lines: [...prev.lines, msg.line] } : { agentId: msg.agentId, lines: [msg.line] }
22341
+ );
22342
+ return;
22343
+ case "acpInstallResult":
22344
+ setAcpInstall((prev) => ({
22345
+ agentId: msg.agentId,
22346
+ lines: prev?.agentId === msg.agentId ? prev.lines : [],
22347
+ result: { ok: msg.ok, command: msg.command, args: msg.args, env: msg.env, error: msg.error }
22348
+ }));
22349
+ return;
22148
22350
  case "voiceModelsFetched":
22149
22351
  if (msg.target === "tts") setTtsCatalogResult(msg.result);
22150
22352
  else setSttCatalogResult(msg.result);
@@ -22312,6 +22514,9 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
22312
22514
  postMessage,
22313
22515
  settingsData,
22314
22516
  modelsResult,
22517
+ acpRegistry,
22518
+ acpInstall,
22519
+ resetAcpInstall: () => setAcpInstall(null),
22315
22520
  sttCatalogResult,
22316
22521
  ttsCatalogResult,
22317
22522
  setModelsResult,