@agentage/cli 0.40.0 → 0.41.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 (45) hide show
  1. package/README.md +23 -8
  2. package/dist/commands/extension/build.d.ts +6 -0
  3. package/dist/commands/extension/build.js +25 -0
  4. package/dist/commands/extension/delegate.d.ts +4 -2
  5. package/dist/commands/extension/delegate.js +19 -15
  6. package/dist/commands/extension/doctor.d.ts +13 -0
  7. package/dist/commands/extension/{check.js → doctor.js} +14 -6
  8. package/dist/commands/extension/install-load.js +10 -1
  9. package/dist/commands/extension/install.js +4 -1
  10. package/dist/commands/extension/kit-commands.d.ts +14 -0
  11. package/dist/commands/extension/kit-commands.js +42 -0
  12. package/dist/commands/extension/kit-tool.d.ts +6 -0
  13. package/dist/commands/extension/kit-tool.js +5 -0
  14. package/dist/commands/extension/latest.js +3 -2
  15. package/dist/commands/extension/list.d.ts +8 -3
  16. package/dist/commands/extension/list.js +35 -21
  17. package/dist/commands/extension/rows.d.ts +2 -0
  18. package/dist/commands/extension/rows.js +15 -9
  19. package/dist/commands/extension/up.d.ts +22 -0
  20. package/dist/commands/extension/up.js +80 -0
  21. package/dist/core/installer/compat.d.ts +10 -2
  22. package/dist/core/installer/compat.js +13 -4
  23. package/dist/core/installer/latest.d.ts +1 -0
  24. package/dist/core/installer/latest.js +7 -5
  25. package/dist/core/installer/npm.js +1 -1
  26. package/dist/core/installer/resolve.d.ts +1 -0
  27. package/dist/core/installer/resolve.js +6 -5
  28. package/dist/core/kit-version.d.ts +1 -0
  29. package/dist/core/kit-version.js +15 -0
  30. package/dist/core/loader/discover.d.ts +4 -0
  31. package/dist/core/loader/discover.js +6 -2
  32. package/dist/core/loader/kit-manifest.d.ts +9 -0
  33. package/dist/core/loader/kit-manifest.js +52 -0
  34. package/dist/core/loader/load.d.ts +2 -1
  35. package/dist/core/loader/load.js +21 -4
  36. package/dist/core/loader/manifest.d.ts +7 -1
  37. package/dist/core/loader/manifest.js +37 -6
  38. package/dist/core/loader/verbs.d.ts +15 -0
  39. package/dist/core/loader/verbs.js +57 -0
  40. package/dist/core/paths.d.ts +1 -0
  41. package/dist/core/paths.js +1 -0
  42. package/dist/program.d.ts +10 -2
  43. package/dist/program.js +21 -5
  44. package/package.json +2 -1
  45. package/dist/commands/extension/check.d.ts +0 -10
@@ -3,6 +3,7 @@ import { getConfigDir } from '../lib/fs/config.js';
3
3
  export const profilePath = () => join(getConfigDir(), 'profile.json');
4
4
  export const machinePath = () => join(getConfigDir(), 'machine.json');
5
5
  export const stateDir = () => join(getConfigDir(), 'state');
6
+ export const commandsPath = () => join(getConfigDir(), 'commands.json');
6
7
  export const extensionsDir = () => process.env['AGENTAGE_EXTENSIONS_DIR'] || join(getConfigDir(), 'extensions');
7
8
  export const secretsPath = () => join(getConfigDir(), 'secrets.json');
8
9
  export const dataDir = (id) => join(getConfigDir(), 'data', id);
package/dist/program.d.ts CHANGED
@@ -1,9 +1,12 @@
1
1
  import { Command } from 'commander';
2
2
  import { type SetupOptions } from './commands/auth/setup.js';
3
- import { type ExtensionCheckOptions } from './commands/extension/check.js';
3
+ import { type ExtensionBuildOptions } from './commands/extension/build.js';
4
+ import { type ExtensionDoctorOptions } from './commands/extension/doctor.js';
4
5
  import { type ExtensionInstallOptions } from './commands/extension/install.js';
5
6
  import { type ExtensionListOptions } from './commands/extension/list.js';
6
7
  import { type ExtensionRemoveOptions } from './commands/extension/remove.js';
8
+ import { type LoadKitTool } from './commands/extension/kit-tool.js';
9
+ import { type ExtensionDownOptions, type ExtensionTokenOptions, type ExtensionUpOptions } from './commands/extension/up.js';
7
10
  import { type StatusOptions } from './commands/status/status.js';
8
11
  import { type UpdateOptions } from './commands/update/update.js';
9
12
  export interface ProgramDeps {
@@ -13,7 +16,12 @@ export interface ProgramDeps {
13
16
  extensionInstall: (opts: ExtensionInstallOptions) => Promise<void>;
14
17
  extensionRemove: (opts: ExtensionRemoveOptions) => Promise<void>;
15
18
  extensionList: (opts: ExtensionListOptions) => Promise<void>;
16
- extensionCheck: (opts: ExtensionCheckOptions) => Promise<void>;
19
+ extensionDoctor: (opts: ExtensionDoctorOptions) => Promise<void>;
20
+ extensionBuild: (opts: ExtensionBuildOptions) => Promise<void>;
21
+ extensionUp: (opts: ExtensionUpOptions) => Promise<void>;
22
+ extensionDown: (opts: ExtensionDownOptions) => Promise<void>;
23
+ extensionToken: (opts: ExtensionTokenOptions) => Promise<void>;
24
+ kitTool: LoadKitTool;
17
25
  updateHint: () => string | null;
18
26
  refreshUpdateCache: () => Promise<void>;
19
27
  writeOut: (text: string) => void;
package/dist/program.js CHANGED
@@ -1,13 +1,17 @@
1
1
  import chalk from 'chalk';
2
2
  import { Command, CommanderError } from 'commander';
3
3
  import { registerSetup } from './commands/auth/setup.js';
4
- import { runExtensionCheck } from './commands/extension/check.js';
4
+ import { runExtensionBuild } from './commands/extension/build.js';
5
5
  import { registerDelegates } from './commands/extension/delegate.js';
6
+ import { deprecatedCheck, runExtensionDoctor, } from './commands/extension/doctor.js';
6
7
  import { runExtensionInstall } from './commands/extension/install.js';
7
8
  import { registerExtension, runExtensionList, } from './commands/extension/list.js';
8
9
  import { runExtensionRemove, terminalIo, } from './commands/extension/remove.js';
9
10
  import { signedInAccount } from './commands/extension/account.js';
11
+ import { KIT_EXIT } from './commands/extension/kit-commands.js';
12
+ import { loadKitTool } from './commands/extension/kit-tool.js';
10
13
  import { runExtensionSetup } from './commands/extension/setup.js';
14
+ import { runExtensionDown, runExtensionToken, runExtensionUp, } from './commands/extension/up.js';
11
15
  import { registerStatus, runStatus, statusDeps, } from './commands/status/status.js';
12
16
  import { registerUpdate, runUpdate } from './commands/update/update.js';
13
17
  import { npmMajor, prepareManifest, prepareNpm } from './core/installer/npm.js';
@@ -28,7 +32,12 @@ const defaultDeps = {
28
32
  extensionInstall: (opts) => runExtensionInstall(opts, { ...editDeps, manifest: () => prepareManifest() }),
29
33
  extensionRemove: (opts) => runExtensionRemove(opts, { ...editDeps, io: terminalIo() }),
30
34
  extensionList: (opts) => runExtensionList(opts),
31
- extensionCheck: (opts) => runExtensionCheck(opts),
35
+ extensionDoctor: (opts) => runExtensionDoctor(opts),
36
+ extensionBuild: (opts) => runExtensionBuild(opts),
37
+ extensionUp: (opts) => runExtensionUp(opts),
38
+ extensionDown: (opts) => runExtensionDown(opts),
39
+ extensionToken: (opts) => runExtensionToken(opts),
40
+ kitTool: loadKitTool,
32
41
  updateHint,
33
42
  refreshUpdateCache: () => refreshUpdateCache(),
34
43
  writeOut: (text) => void process.stdout.write(text),
@@ -66,10 +75,15 @@ const addExtensions = (program, deps, argv) => {
66
75
  install: withAction(deps, deps.extensionInstall),
67
76
  remove: withAction(deps, deps.extensionRemove),
68
77
  list: withAction(deps, deps.extensionList),
69
- check: withAction(deps, deps.extensionCheck),
78
+ doctor: withAction(deps, deps.extensionDoctor),
79
+ check: withAction(deps, deprecatedCheck(deps.extensionDoctor, deps.writeErr)),
80
+ build: withAction(deps, deps.extensionBuild),
81
+ up: withAction(deps, deps.extensionUp),
82
+ down: withAction(deps, deps.extensionDown),
83
+ token: withAction(deps, deps.extensionToken),
70
84
  });
71
85
  try {
72
- registerDelegates(program, argv, (fn) => withAction(deps, fn));
86
+ registerDelegates(program, argv, (fn) => withAction(deps, fn), deps.kitTool);
73
87
  }
74
88
  catch (err) {
75
89
  deps.writeErr(`${chalk.yellow(`warning: extension commands skipped: ${messageOf(err)}`)}\n`);
@@ -91,7 +105,7 @@ export const createProgram = (deps = defaultDeps, argv = process.argv) => {
91
105
  addExtensions(program, deps, argv);
92
106
  return program;
93
107
  };
94
- // Commander's own exit 0 (--help, --version) stays 0; any other commander error is usage.
108
+ // --help and --version stay 0; a kit command keeps its code; any other commander error is usage.
95
109
  const exitCodeOf = (err, deps) => {
96
110
  if (!(err instanceof CommanderError)) {
97
111
  deps.writeErr(`${chalk.red(messageOf(err))}\n`);
@@ -99,6 +113,8 @@ const exitCodeOf = (err, deps) => {
99
113
  }
100
114
  if (err.code === ACTION_FAILED)
101
115
  return EXIT_FAILED;
116
+ if (err.code === KIT_EXIT)
117
+ return err.exitCode;
102
118
  return err.exitCode === 0 ? EXIT_OK : EXIT_USAGE;
103
119
  };
104
120
  // Returns the exit code instead of exiting, so piped stdout is never cut short.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentage/cli",
3
- "version": "0.40.0",
3
+ "version": "0.41.1",
4
4
  "description": "The agentage CLI - connect this machine to agentage from the terminal",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -55,6 +55,7 @@
55
55
  "prepublishOnly": "npm run verify"
56
56
  },
57
57
  "dependencies": {
58
+ "@agentage/extension": "^0.2.1",
58
59
  "chalk": "^6.0.0",
59
60
  "commander": "^15.0.0",
60
61
  "open": "^11.0.0"
@@ -1,10 +0,0 @@
1
- import { type DiscoveredExtension } from '../../core/loader/discover.js';
2
- import { type ExtensionRow, type ExtensionsGather } from './rows.js';
3
- export interface ExtensionCheckOptions {
4
- json?: boolean;
5
- }
6
- type BeforeLoad = (extensions: DiscoveredExtension[]) => Promise<void>;
7
- export declare const loadAndGather: (beforeLoad?: BeforeLoad, tree?: string) => Promise<ExtensionsGather>;
8
- export declare const failedError: (rows: ExtensionRow[]) => Error | null;
9
- export declare const runExtensionCheck: (opts?: ExtensionCheckOptions) => Promise<void>;
10
- export {};