@falkenslab/agent-kit 0.25.0 → 0.27.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 (35) hide show
  1. package/dist/chat/extensions.d.ts +14 -0
  2. package/dist/chat/extensions.js +39 -3
  3. package/dist/core/agentSpec.d.ts +33 -0
  4. package/dist/core/claudeAiConnectors.d.ts +35 -0
  5. package/dist/core/claudeAiConnectors.js +76 -0
  6. package/dist/core/extensions.d.ts +7 -0
  7. package/dist/core/externalExtensions.d.ts +30 -0
  8. package/dist/core/externalExtensions.js +37 -0
  9. package/dist/core/hooks/guidedGate.d.ts +57 -0
  10. package/dist/core/hooks/guidedGate.js +97 -0
  11. package/dist/core/hooks/remoteGate.d.ts +22 -0
  12. package/dist/core/hooks/remoteGate.js +35 -0
  13. package/dist/core/hooks/transcriptLogger.d.ts +2 -0
  14. package/dist/core/hooks/transcriptLogger.js +1 -1
  15. package/dist/core/messages/de.js +10 -1
  16. package/dist/core/messages/en.d.ts +22 -0
  17. package/dist/core/messages/en.js +10 -1
  18. package/dist/core/messages/es.js +10 -1
  19. package/dist/core/messages/fr.js +10 -1
  20. package/dist/core/readOnlyHints.d.ts +12 -6
  21. package/dist/core/readOnlyHints.js +14 -8
  22. package/dist/core/runner.js +24 -0
  23. package/dist/core/session.d.ts +5 -0
  24. package/dist/core/session.js +88 -6
  25. package/dist/core/sessionFacts.d.ts +6 -0
  26. package/dist/core/sessionFacts.js +1 -0
  27. package/dist/core/tools/humanApproval.d.ts +4 -2
  28. package/dist/core/tools/humanApproval.js +3 -1
  29. package/dist/extensions/awareness/tools.js +6 -0
  30. package/dist/index.d.ts +3 -2
  31. package/dist/index.js +2 -1
  32. package/dist/tui/extensionCommand.d.ts +1 -1
  33. package/dist/tui/extensionCommand.js +14 -6
  34. package/package.json +1 -1
  35. package/schemas/agent-kit-metadata.schema.json +5 -0
@@ -3,7 +3,7 @@ import path from "node:path";
3
3
  import { createInterface } from "node:readline/promises";
4
4
  import { addMarketplace, findPlugin, inspectMarketplace, installFromMarketplace, removeMarketplace, updateMarketplace, } from "../core/marketplaces.js";
5
5
  import { addExtension, extensionOptionStates, installTarget, folderSize, isGitSource, isRemoteServer, remoteHosts, listInstalled, removeExtension, setExtensionEnabled, setExtensionOptions, } from "../core/externalExtensions.js";
6
- import { describe, describeOptions } from "../chat/extensions.js";
6
+ import { applyConfirm, describe, describeConfirm, describeOptions } from "../chat/extensions.js";
7
7
  import { extensionCatalog, knownMarketplaces as catalogMarketplaces, restoreExtensions, updateExtension } from "../core/extensionCatalog.js";
8
8
  import { trustWorkspace } from "../core/workspaceTrust.js";
9
9
  import { describeCapability, describeInLanguage } from "../core/extensions.js";
@@ -21,7 +21,7 @@ export { chatExtensionsCommand, describe } from "../chat/extensions.js";
21
21
  * - `extension add <folder> --link [--project]`: registered where it is, to develop it (not copied, its files not checked)
22
22
  * - `extension remove <name> [--project | --agent] [--yes | --keep-data]`: asks before deleting its data folder
23
23
  * - `extension enable|disable <name> [--project | --agent]`
24
- * - `extension config <name> [key=value… | key… | --unset key…] [--project | --agent]`: its options; `key` alone asks for it (without echo when it's a secret)
24
+ * - `extension config <name> [key=value… | key… | --unset key… | confirm=on|off|reset] [--project | --agent]`: its options; `key` alone asks for it (without echo when it's a secret); `confirm=` what guided mode asks about its tools (#74, #76)
25
25
  * - `extension update [name] [--yes]`: one installed from a marketplace (or all that have a newer version there) to the version it offers now, its data and options kept
26
26
  * - `extension restore [--trust]`: gets the code a workspace's lock lists and this computer lacks (#57); `--trust` trusts it too
27
27
  * - `extension trust [name…]`: lets a workspace's extensions run, as their code is now
@@ -200,16 +200,22 @@ export async function runExtensionCommand(argv, options) {
200
200
  case "config": {
201
201
  const name = positional[0];
202
202
  if (!name)
203
- return fail(`Usage: ${command} extension config <name> [key=value… | key… | --unset key…] [--project | --agent]`);
203
+ return fail(`Usage: ${command} extension config <name> [key=value… | key… | --unset key… | confirm=on|off|reset] [--project | --agent]`);
204
204
  const found = (await listInstalled(options.dirs)).filter((extension) => extension.name === name && !extension.shadowed && (!askedScope || extension.scope === askedScope));
205
205
  if (!found.length)
206
206
  return fail(`${name} isn't installed${askedScope ? ` in the ${askedScope} scope` : ""}. \`${command} extension list\` lists them.`);
207
207
  const installed = found[0];
208
208
  const declared = installed.manifest?.userConfig ?? {};
209
+ // Guided mode's answers about its tools (#74, #76): confirm=on|off|reset.
210
+ const confirm = await applyConfirm(installed, positional.slice(1));
211
+ if ("error" in confirm)
212
+ return fail(`${confirm.error}.`);
213
+ if (confirm.changed)
214
+ write(`${name}'s guided-mode answers saved in the ${installed.scope} scope.`);
209
215
  const typed = {};
210
216
  for (const key of values("unset"))
211
217
  typed[key] = undefined;
212
- for (const pair of positional.slice(1)) {
218
+ for (const pair of confirm.rest) {
213
219
  const at = pair.indexOf("=");
214
220
  if (at > 0)
215
221
  typed[pair.slice(0, at)] = pair.slice(at + 1);
@@ -224,10 +230,11 @@ export async function runExtensionCommand(argv, options) {
224
230
  await setExtensionOptions(installed, name, typed);
225
231
  write(`${name}'s options saved in the ${installed.scope} scope. They apply when its server starts again: the next session, or in a chat \`/extensions disable ${name}\` and \`enable\`.`);
226
232
  }
227
- const lines = await describeOptions((await listInstalled(options.dirs)).find((extension) => extension.name === name && extension.scopeDir === installed.scopeDir));
233
+ const now = (await listInstalled(options.dirs)).find((extension) => extension.name === name && extension.scopeDir === installed.scopeDir);
234
+ const lines = await describeOptions(now);
228
235
  if (!lines.length)
229
236
  write(`${name} has no options.`);
230
- for (const line of lines)
237
+ for (const line of [...lines, ...describeConfirm(now)])
231
238
  write(line);
232
239
  return true;
233
240
  }
@@ -297,6 +304,7 @@ export async function runExtensionCommand(argv, options) {
297
304
  " remove <name> [--project | --agent] [--yes | --keep-data]",
298
305
  " enable|disable <name> [--project | --agent]",
299
306
  " config <name> [key=value… | key… | --unset key…] its options (key alone asks for it)",
307
+ " config <name> confirm=on|off|reset whether guided mode asks before its tools, or forget the answers kept",
300
308
  " update [name] to the version its marketplace offers now (all that have one, without a name)",
301
309
  " restore [--trust] gets what this workspace's lock lists and this computer lacks",
302
310
  " trust [name…] lets this workspace's extensions run, as they are now",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@falkenslab/agent-kit",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "Library for building an agent on top of the Claude Agent SDK",
5
5
  "author": "Francisco Vargas Ruiz",
6
6
  "license": "MIT",
@@ -34,6 +34,11 @@
34
34
  "type": "array",
35
35
  "items": { "type": "string", "minLength": 1 }
36
36
  },
37
+ "confirmTools": {
38
+ "description": "Its tools that always ask the person in guided mode (short names), even inside a batch they approved, and are never offered \"always\": what creates, edits or publishes in their account. Without it, its servers' destructiveHint says which.",
39
+ "type": "array",
40
+ "items": { "type": "string", "minLength": 1 }
41
+ },
37
42
  "labels": {
38
43
  "description": "How the chat shows each tool (short name), per language (en, es, fr, de): {field} takes the call's input.",
39
44
  "type": "object",