@agentage/cli 0.38.1 → 0.40.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 (130) hide show
  1. package/README.md +111 -25
  2. package/dist/commands/auth/setup.d.ts +8 -2
  3. package/dist/commands/auth/setup.js +38 -7
  4. package/dist/commands/extension/account.d.ts +5 -0
  5. package/dist/commands/extension/account.js +18 -0
  6. package/dist/commands/extension/check.d.ts +10 -0
  7. package/dist/commands/extension/check.js +35 -0
  8. package/dist/commands/extension/delegate.d.ts +4 -0
  9. package/dist/commands/extension/delegate.js +45 -0
  10. package/dist/commands/extension/install-load.d.ts +7 -0
  11. package/dist/commands/extension/install-load.js +33 -0
  12. package/dist/commands/extension/install.d.ts +10 -0
  13. package/dist/commands/extension/install.js +35 -0
  14. package/dist/commands/extension/latest.d.ts +2 -0
  15. package/dist/commands/extension/latest.js +70 -0
  16. package/dist/commands/extension/list.d.ts +17 -0
  17. package/dist/commands/extension/list.js +102 -0
  18. package/dist/commands/extension/plan.d.ts +8 -0
  19. package/dist/commands/extension/plan.js +67 -0
  20. package/dist/commands/extension/remove.d.ts +15 -0
  21. package/dist/commands/extension/remove.js +86 -0
  22. package/dist/commands/extension/row-lines.d.ts +4 -0
  23. package/dist/commands/extension/row-lines.js +68 -0
  24. package/dist/commands/extension/rows.d.ts +56 -0
  25. package/dist/commands/extension/rows.js +61 -0
  26. package/dist/commands/extension/secrets-prompt.d.ts +6 -0
  27. package/dist/commands/extension/secrets-prompt.js +47 -0
  28. package/dist/commands/extension/setup-cloud.d.ts +6 -0
  29. package/dist/commands/extension/setup-cloud.js +98 -0
  30. package/dist/commands/extension/setup.d.ts +5 -0
  31. package/dist/commands/extension/setup.js +68 -0
  32. package/dist/commands/extension/sync.d.ts +22 -0
  33. package/dist/commands/extension/sync.js +81 -0
  34. package/dist/commands/status/account-status.d.ts +3 -0
  35. package/dist/commands/status/account-status.js +27 -0
  36. package/dist/commands/status/status.d.ts +7 -1
  37. package/dist/commands/status/status.js +50 -6
  38. package/dist/core/installer/compare-lock.d.ts +8 -0
  39. package/dist/core/installer/compare-lock.js +51 -0
  40. package/dist/core/installer/compat.d.ts +12 -0
  41. package/dist/core/installer/compat.js +35 -0
  42. package/dist/core/installer/installer.d.ts +28 -0
  43. package/dist/core/installer/installer.js +87 -0
  44. package/dist/core/installer/latest.d.ts +26 -0
  45. package/dist/core/installer/latest.js +88 -0
  46. package/dist/core/installer/npm.d.ts +11 -0
  47. package/dist/core/installer/npm.js +76 -0
  48. package/dist/core/installer/plan.d.ts +25 -0
  49. package/dist/core/installer/plan.js +52 -0
  50. package/dist/core/installer/resolve.d.ts +25 -0
  51. package/dist/core/installer/resolve.js +139 -0
  52. package/dist/core/installer/tree.d.ts +21 -0
  53. package/dist/core/installer/tree.js +100 -0
  54. package/dist/core/loader/config.d.ts +7 -0
  55. package/dist/core/loader/config.js +59 -0
  56. package/dist/core/loader/ctx.d.ts +16 -0
  57. package/dist/core/loader/ctx.js +76 -0
  58. package/dist/core/loader/dev-path.d.ts +1 -0
  59. package/dist/core/loader/dev-path.js +20 -0
  60. package/dist/core/loader/discover.d.ts +35 -0
  61. package/dist/core/loader/discover.js +118 -0
  62. package/dist/core/loader/dispose.d.ts +4 -0
  63. package/dist/core/loader/dispose.js +24 -0
  64. package/dist/core/loader/load.d.ts +13 -0
  65. package/dist/core/loader/load.js +61 -0
  66. package/dist/core/loader/log.d.ts +3 -0
  67. package/dist/core/loader/log.js +23 -0
  68. package/dist/core/loader/manifest.d.ts +14 -0
  69. package/dist/core/loader/manifest.js +77 -0
  70. package/dist/core/loader/order.d.ts +2 -0
  71. package/dist/core/loader/order.js +20 -0
  72. package/dist/core/loader/register.d.ts +19 -0
  73. package/dist/core/loader/register.js +39 -0
  74. package/dist/core/loader/scan.d.ts +18 -0
  75. package/dist/core/loader/scan.js +34 -0
  76. package/dist/core/loader/secrets.d.ts +9 -0
  77. package/dist/core/loader/secrets.js +28 -0
  78. package/dist/core/loader/state.d.ts +12 -0
  79. package/dist/core/loader/state.js +31 -0
  80. package/dist/core/loader/states.d.ts +7 -0
  81. package/dist/core/loader/states.js +52 -0
  82. package/dist/core/loader/timeout.d.ts +1 -0
  83. package/dist/core/loader/timeout.js +8 -0
  84. package/dist/core/loader/use.d.ts +8 -0
  85. package/dist/core/loader/use.js +18 -0
  86. package/dist/core/paths.d.ts +8 -0
  87. package/dist/core/paths.js +10 -0
  88. package/dist/core/profile/cloud.d.ts +53 -0
  89. package/dist/core/profile/cloud.js +109 -0
  90. package/dist/core/profile/edit.d.ts +4 -0
  91. package/dist/core/profile/edit.js +27 -0
  92. package/dist/core/profile/machine.d.ts +18 -0
  93. package/dist/core/profile/machine.js +83 -0
  94. package/dist/core/profile/merge.d.ts +11 -0
  95. package/dist/core/profile/merge.js +21 -0
  96. package/dist/core/profile/profile.d.ts +6 -0
  97. package/dist/core/profile/profile.js +68 -0
  98. package/dist/core/profile/push.d.ts +16 -0
  99. package/dist/core/profile/push.js +49 -0
  100. package/dist/core/profile/register.d.ts +5 -0
  101. package/dist/core/profile/register.js +57 -0
  102. package/dist/core/profile/schema.d.ts +28 -0
  103. package/dist/core/profile/schema.js +165 -0
  104. package/dist/core/semver-range.d.ts +17 -0
  105. package/dist/core/semver-range.js +124 -0
  106. package/dist/extension-test.d.ts +7 -0
  107. package/dist/extension-test.js +49 -0
  108. package/dist/extension.d.ts +83 -0
  109. package/dist/extension.js +6 -0
  110. package/dist/lib/auth/api.d.ts +2 -2
  111. package/dist/lib/auth/api.js +3 -3
  112. package/dist/lib/auth/callback-page.d.ts +2 -0
  113. package/dist/lib/auth/callback-page.js +40 -0
  114. package/dist/lib/auth/callback-server.js +1 -4
  115. package/dist/lib/fs/file-lock.d.ts +3 -1
  116. package/dist/lib/fs/file-lock.js +26 -11
  117. package/dist/lib/fs/json-file.d.ts +1 -0
  118. package/dist/lib/fs/json-file.js +3 -2
  119. package/dist/lib/net/fetch.js +1 -1
  120. package/dist/lib/net/origins.d.ts +1 -0
  121. package/dist/lib/net/origins.js +11 -11
  122. package/dist/lib/npm/npm-cli.d.ts +2 -0
  123. package/dist/lib/npm/npm-cli.js +4 -4
  124. package/dist/program.d.ts +9 -1
  125. package/dist/program.js +44 -10
  126. package/package.json +8 -4
  127. package/dist/core/flag.d.ts +0 -1
  128. package/dist/core/flag.js +0 -1
  129. package/dist/plugin.d.ts +0 -1
  130. package/dist/plugin.js +0 -2
@@ -1,5 +1,5 @@
1
1
  import { randomBytes } from 'node:crypto';
2
- import { linkSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs';
2
+ import { linkSync, mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from 'node:fs';
3
3
  import { dirname } from 'node:path';
4
4
  // Sized for sub-millisecond config read-modify-writes; the wait outlives the TTL on purpose.
5
5
  const DEFAULTS = { ttlMs: 10_000, hardStaleMs: 60_000, maxWaitMs: 15_000 };
@@ -132,22 +132,37 @@ export const releaseFileLock = (target) => {
132
132
  if (holderOf(path)?.pid === process.pid)
133
133
  unlinkQuiet(path);
134
134
  };
135
+ // Heartbeat for a long holder: a fresh stamp keeps waiters from ever reading it as crashed.
136
+ export const refreshFileLock = (target, now = Date.now()) => {
137
+ const path = lockPath(target);
138
+ if (holderOf(path)?.pid !== process.pid)
139
+ return false;
140
+ const tmp = `${path}.${process.pid}.${randomBytes(4).toString('hex')}.new`;
141
+ writeFileSync(tmp, `${process.pid} ${now}`);
142
+ try {
143
+ renameSync(tmp, path);
144
+ }
145
+ finally {
146
+ unlinkQuiet(tmp);
147
+ }
148
+ return true;
149
+ };
135
150
  const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
136
- // `fn` MUST be synchronous and hold the whole read-modify-write; released in a finally.
151
+ // Held for all of `fn`, sync or async; a holder past hardStaleMs keeps it with refreshFileLock.
137
152
  export const withFileLock = async (target, fn, opts = {}) => {
138
153
  const { maxWaitMs } = limitsOf(opts);
139
154
  const deadline = Date.now() + maxWaitMs;
140
- for (;;) {
141
- if (acquireFileLock(target, Date.now(), opts)) {
142
- try {
143
- return fn();
144
- }
145
- finally {
146
- releaseFileLock(target);
147
- }
148
- }
155
+ for (let tries = 0; !acquireFileLock(target, Date.now(), opts); tries++) {
156
+ if (tries === 0)
157
+ opts.onWait?.();
149
158
  if (Date.now() >= deadline)
150
159
  throw new Error(`could not acquire lock for ${target} within ${maxWaitMs}ms`);
151
160
  await sleep(STEP_MS + Math.floor(Math.random() * STEP_MS));
152
161
  }
162
+ try {
163
+ return await fn();
164
+ }
165
+ finally {
166
+ releaseFileLock(target);
167
+ }
153
168
  };
@@ -1,3 +1,4 @@
1
1
  export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
2
2
  export declare const readJson: <T>(path: string, guard: (value: unknown) => value is T) => T | null;
3
+ export declare const writeTextAtomic: (path: string, text: string, mode?: number) => void;
3
4
  export declare const writeJsonAtomic: (path: string, value: unknown, mode?: number) => void;
@@ -27,11 +27,11 @@ const unlinkQuiet = (path) => {
27
27
  }
28
28
  };
29
29
  // Unique temp sibling + chmod before rename: never half-written, never briefly world-readable.
30
- export const writeJsonAtomic = (path, value, mode = 0o600) => {
30
+ export const writeTextAtomic = (path, text, mode = 0o600) => {
31
31
  const tmp = `${path}.${process.pid}.${randomBytes(4).toString('hex')}.tmp`;
32
32
  let renamed = false;
33
33
  try {
34
- writeFileSync(tmp, JSON.stringify(value, null, 2) + '\n', { encoding: 'utf-8', mode });
34
+ writeFileSync(tmp, text, { encoding: 'utf-8', mode });
35
35
  chmodSync(tmp, mode);
36
36
  renameSync(tmp, path);
37
37
  renamed = true;
@@ -41,3 +41,4 @@ export const writeJsonAtomic = (path, value, mode = 0o600) => {
41
41
  unlinkQuiet(tmp);
42
42
  }
43
43
  };
44
+ export const writeJsonAtomic = (path, value, mode = 0o600) => writeTextAtomic(path, JSON.stringify(value, null, 2) + '\n', mode);
@@ -1,7 +1,7 @@
1
1
  import { requestHeaders } from './user-agent.js';
2
2
  export const DEFAULT_TIMEOUT_MS = 10_000;
3
3
  export const AUTH_TIMEOUT_MS = 15_000;
4
- // Captured at load: plugins loaded later must not be able to swap the fetch that carries tokens.
4
+ // Captured at load: extensions loaded later must not be able to swap the fetch that carries tokens.
5
5
  const baseFetch = globalThis.fetch;
6
6
  // redirect: 'manual' so a bearer or form body is never replayed to a redirect target.
7
7
  export const cliFetch = (url, init = {}, opts = {}) => baseFetch(url, {
@@ -7,4 +7,5 @@ export interface Links {
7
7
  export declare const normalizeFqdn: (raw?: string) => string;
8
8
  export declare const siteFqdn: () => string;
9
9
  export declare const environment: (fqdn: string) => Env;
10
+ export declare const apiOrigin: (fqdn: string) => string;
10
11
  export declare const links: (fqdn: string) => Links;
@@ -17,19 +17,19 @@ const stubOrigin = (fqdn) => {
17
17
  return m ? `http://127.0.0.1:${m[1]}` : null;
18
18
  };
19
19
  export const environment = (fqdn) => isLocal(fqdn) || fqdn.startsWith('dev.') ? 'development' : 'production';
20
+ // The account routes (/v1/...) sit at the root of the API origin; `links().api` is its /api family.
21
+ export const apiOrigin = (fqdn) => {
22
+ const stub = stubOrigin(fqdn);
23
+ if (stub)
24
+ return stub;
25
+ return isLocal(fqdn) ? 'http://localhost:3001' : `https://api.${fqdn}`;
26
+ };
20
27
  export const links = (fqdn) => {
21
28
  const stub = stubOrigin(fqdn);
29
+ const api = `${apiOrigin(fqdn)}/api`;
22
30
  if (stub)
23
- return { site: stub, api: `${stub}/api`, auth: stub };
31
+ return { site: stub, api, auth: stub };
24
32
  return isLocal(fqdn)
25
- ? {
26
- site: 'http://localhost:3000',
27
- api: 'http://localhost:3001/api',
28
- auth: 'http://localhost:3010',
29
- }
30
- : {
31
- site: `https://${fqdn}`,
32
- api: `https://api.${fqdn}/api`,
33
- auth: `https://auth.${fqdn}`,
34
- };
33
+ ? { site: 'http://localhost:3000', api, auth: 'http://localhost:3010' }
34
+ : { site: `https://${fqdn}`, api, auth: `https://auth.${fqdn}` };
35
35
  };
@@ -7,11 +7,13 @@ export interface RunNpmOptions {
7
7
  cwd?: string;
8
8
  env?: NodeJS.ProcessEnv;
9
9
  timeoutMs: number;
10
+ npmCli?: string;
10
11
  }
11
12
  export interface ResolveNpmOptions {
12
13
  execPath?: string;
13
14
  env?: NodeJS.ProcessEnv;
14
15
  }
15
16
  export declare const resolveNpmCli: (opts?: ResolveNpmOptions) => string;
17
+ export declare const scrubNpmEnv: (parent: NodeJS.ProcessEnv, env?: NodeJS.ProcessEnv) => NodeJS.ProcessEnv;
16
18
  export declare const runNpm: (args: string[], opts: RunNpmOptions) => Promise<NpmResult>;
17
19
  export declare const requireNpm10: (run?: typeof runNpm) => Promise<string>;
@@ -43,8 +43,8 @@ export const resolveNpmCli = (opts = {}) => {
43
43
  };
44
44
  const isScrubbed = (key) => /^npm_config_/i.test(key) || key.toUpperCase() === 'NODE_OPTIONS';
45
45
  // Inherited npm_config_* (an `npx` or `npm run` parent) would redirect a global install.
46
- const childEnv = (env = {}) => ({
47
- ...Object.fromEntries(Object.entries(process.env).filter(([key]) => !isScrubbed(key))),
46
+ export const scrubNpmEnv = (parent, env = {}) => ({
47
+ ...Object.fromEntries(Object.entries(parent).filter(([key]) => !isScrubbed(key))),
48
48
  ...env,
49
49
  });
50
50
  const failureNote = (err, timeoutMs) => {
@@ -55,10 +55,10 @@ const failureNote = (err, timeoutMs) => {
55
55
  return `\nnpm could not run (${String(err.code ?? err.signal ?? 'unknown')})`;
56
56
  };
57
57
  export const runNpm = (args, opts) => new Promise((resolve) => {
58
- const argv = [resolveNpmCli(), ...args, '--no-audit', '--no-fund'];
58
+ const argv = [opts.npmCli ?? resolveNpmCli(), ...args, '--no-audit', '--no-fund'];
59
59
  const options = {
60
60
  cwd: opts.cwd,
61
- env: childEnv(opts.env),
61
+ env: scrubNpmEnv(process.env, opts.env),
62
62
  timeout: opts.timeoutMs,
63
63
  maxBuffer: MAX_BUFFER,
64
64
  windowsHide: true,
package/dist/program.d.ts CHANGED
@@ -1,11 +1,19 @@
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';
4
+ import { type ExtensionInstallOptions } from './commands/extension/install.js';
5
+ import { type ExtensionListOptions } from './commands/extension/list.js';
6
+ import { type ExtensionRemoveOptions } from './commands/extension/remove.js';
3
7
  import { type StatusOptions } from './commands/status/status.js';
4
8
  import { type UpdateOptions } from './commands/update/update.js';
5
9
  export interface ProgramDeps {
6
10
  setup: (opts: SetupOptions) => Promise<void>;
7
11
  status: (opts: StatusOptions) => Promise<void>;
8
12
  update: (opts: UpdateOptions) => Promise<void>;
13
+ extensionInstall: (opts: ExtensionInstallOptions) => Promise<void>;
14
+ extensionRemove: (opts: ExtensionRemoveOptions) => Promise<void>;
15
+ extensionList: (opts: ExtensionListOptions) => Promise<void>;
16
+ extensionCheck: (opts: ExtensionCheckOptions) => Promise<void>;
9
17
  updateHint: () => string | null;
10
18
  refreshUpdateCache: () => Promise<void>;
11
19
  writeOut: (text: string) => void;
@@ -14,5 +22,5 @@ export interface ProgramDeps {
14
22
  export declare const EXIT_OK = 0;
15
23
  export declare const EXIT_FAILED = 1;
16
24
  export declare const EXIT_USAGE = 2;
17
- export declare const createProgram: (deps?: ProgramDeps) => Command;
25
+ export declare const createProgram: (deps?: ProgramDeps, argv?: string[]) => Command;
18
26
  export declare const run: (argv?: string[], deps?: ProgramDeps) => Promise<number>;
package/dist/program.js CHANGED
@@ -1,19 +1,34 @@
1
1
  import chalk from 'chalk';
2
2
  import { Command, CommanderError } from 'commander';
3
- import { registerSetup, runSetup } from './commands/auth/setup.js';
4
- import { registerStatus, runStatus } from './commands/status/status.js';
3
+ import { registerSetup } from './commands/auth/setup.js';
4
+ import { runExtensionCheck } from './commands/extension/check.js';
5
+ import { registerDelegates } from './commands/extension/delegate.js';
6
+ import { runExtensionInstall } from './commands/extension/install.js';
7
+ import { registerExtension, runExtensionList, } from './commands/extension/list.js';
8
+ import { runExtensionRemove, terminalIo, } from './commands/extension/remove.js';
9
+ import { signedInAccount } from './commands/extension/account.js';
10
+ import { runExtensionSetup } from './commands/extension/setup.js';
11
+ import { registerStatus, runStatus, statusDeps, } from './commands/status/status.js';
5
12
  import { registerUpdate, runUpdate } from './commands/update/update.js';
13
+ import { npmMajor, prepareManifest, prepareNpm } from './core/installer/npm.js';
6
14
  import { ensureSignedIn, signOut } from './lib/auth/sign-in.js';
7
15
  import { refreshUpdateCache, updateHint } from './lib/update/update-cache.js';
8
16
  import { VERSION } from './utils/version.js';
17
+ const setupDeps = {
18
+ ensureSignedIn: (signInOpts) => ensureSignedIn(signInOpts),
19
+ signOut: () => signOut(),
20
+ printStatus: (opts) => runStatus(opts, statusDeps(false)),
21
+ };
22
+ // What a profile edit reaches: npm, and the account it syncs with when signed in.
23
+ const editDeps = { npm: () => prepareNpm(), npmMajor: () => npmMajor(), account: signedInAccount };
9
24
  const defaultDeps = {
10
- setup: (opts) => runSetup(opts, {
11
- ensureSignedIn: (signInOpts) => ensureSignedIn(signInOpts),
12
- signOut: () => signOut(),
13
- printStatus: () => runStatus({}),
14
- }),
25
+ setup: (opts) => runExtensionSetup(opts, { ...setupDeps, ...editDeps }),
15
26
  status: (opts) => runStatus(opts),
16
27
  update: (opts) => runUpdate(opts),
28
+ extensionInstall: (opts) => runExtensionInstall(opts, { ...editDeps, manifest: () => prepareManifest() }),
29
+ extensionRemove: (opts) => runExtensionRemove(opts, { ...editDeps, io: terminalIo() }),
30
+ extensionList: (opts) => runExtensionList(opts),
31
+ extensionCheck: (opts) => runExtensionCheck(opts),
17
32
  updateHint,
18
33
  refreshUpdateCache: () => refreshUpdateCache(),
19
34
  writeOut: (text) => void process.stdout.write(text),
@@ -24,12 +39,14 @@ export const EXIT_FAILED = 1;
24
39
  export const EXIT_USAGE = 2;
25
40
  const ACTION_FAILED = 'agentage.actionFailed';
26
41
  const messageOf = (err) => (err instanceof Error ? err.message : String(err));
27
- // One failure path for every command: a red stderr line, then exit 1 through run().
42
+ // One failure path: a red stderr line, exit 1; an extension's --help or usage error keeps its code.
28
43
  const withAction = (deps, fn, prefix = '') => async (opts) => {
29
44
  try {
30
45
  await fn(opts);
31
46
  }
32
47
  catch (err) {
48
+ if (err instanceof CommanderError)
49
+ throw err;
33
50
  deps.writeErr(`${chalk.red(`${prefix}${messageOf(err)}`)}\n`);
34
51
  throw new CommanderError(EXIT_FAILED, ACTION_FAILED, messageOf(err));
35
52
  }
@@ -43,7 +60,23 @@ const hintAfter = (deps) => (_program, action) => {
43
60
  deps.writeErr(`${chalk.dim(hint)}\n`);
44
61
  void deps.refreshUpdateCache();
45
62
  };
46
- export const createProgram = (deps = defaultDeps) => {
63
+ // Extension manifests are read as data; whatever goes wrong there, today's commands still run.
64
+ const addExtensions = (program, deps, argv) => {
65
+ registerExtension(program, {
66
+ install: withAction(deps, deps.extensionInstall),
67
+ remove: withAction(deps, deps.extensionRemove),
68
+ list: withAction(deps, deps.extensionList),
69
+ check: withAction(deps, deps.extensionCheck),
70
+ });
71
+ try {
72
+ registerDelegates(program, argv, (fn) => withAction(deps, fn));
73
+ }
74
+ catch (err) {
75
+ deps.writeErr(`${chalk.yellow(`warning: extension commands skipped: ${messageOf(err)}`)}\n`);
76
+ }
77
+ };
78
+ // `argv` reaches an extension's own Command unchanged, so it parses exactly what was typed.
79
+ export const createProgram = (deps = defaultDeps, argv = process.argv) => {
47
80
  const program = new Command()
48
81
  .name('agentage')
49
82
  .description('Connect this machine to agentage from the terminal')
@@ -55,6 +88,7 @@ export const createProgram = (deps = defaultDeps) => {
55
88
  registerSetup(program, withAction(deps, deps.setup, 'Setup failed: '));
56
89
  registerStatus(program, withAction(deps, deps.status));
57
90
  registerUpdate(program, withAction(deps, deps.update));
91
+ addExtensions(program, deps, argv);
58
92
  return program;
59
93
  };
60
94
  // Commander's own exit 0 (--help, --version) stays 0; any other commander error is usage.
@@ -72,7 +106,7 @@ export const run = async (argv = process.argv, deps = defaultDeps) => {
72
106
  if (process.env['NO_COLOR'])
73
107
  chalk.level = 0; // chalk ignores NO_COLOR on its own
74
108
  try {
75
- await createProgram(deps).parseAsync(argv);
109
+ await createProgram(deps, argv).parseAsync(argv);
76
110
  return EXIT_OK;
77
111
  }
78
112
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentage/cli",
3
- "version": "0.38.1",
3
+ "version": "0.40.0",
4
4
  "description": "The agentage CLI - connect this machine to agentage from the terminal",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -10,9 +10,13 @@
10
10
  "types": "./dist/index.d.ts",
11
11
  "default": "./dist/index.js"
12
12
  },
13
- "./plugin": {
14
- "types": "./dist/plugin.d.ts",
15
- "default": "./dist/plugin.js"
13
+ "./extension": {
14
+ "types": "./dist/extension.d.ts",
15
+ "default": "./dist/extension.js"
16
+ },
17
+ "./extension/test": {
18
+ "types": "./dist/extension-test.d.ts",
19
+ "default": "./dist/extension-test.js"
16
20
  },
17
21
  "./package.json": "./package.json"
18
22
  },
@@ -1 +0,0 @@
1
- export declare const pluginsEnabled: () => boolean;
package/dist/core/flag.js DELETED
@@ -1 +0,0 @@
1
- export const pluginsEnabled = () => process.env['AGENTAGE_PLUGINS'] === '1';
package/dist/plugin.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const PLUGIN_API_VERSION = "1.0.0";
package/dist/plugin.js DELETED
@@ -1,2 +0,0 @@
1
- // The plugin contract is versioned apart from the CLI, so plugins pin it, not a CLI release.
2
- export const PLUGIN_API_VERSION = '1.0.0';