@agentage/cli 0.80.1 → 0.81.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.
package/README.md CHANGED
@@ -52,7 +52,7 @@ personal access token: `AGENTAGE_TOKEN=aga_... agentage status`.
52
52
  You need git and network. Run these in an empty folder:
53
53
 
54
54
  ```bash
55
- agentage extension create my-ext
55
+ agentage extension create my-ext app api # parts to keep; none = all eight
56
56
  cd extension-my-ext
57
57
  npm ci
58
58
  npm run verify
@@ -12,5 +12,6 @@ export interface ExtensionCreateOptions {
12
12
  yes?: boolean;
13
13
  json?: boolean;
14
14
  }
15
+ export declare const splitParts: (parts: string[]) => string[];
15
16
  export declare const runExtensionCreate: (opts: ExtensionCreateOptions, url?: (from: string) => string, after?: typeof installCreated, io?: ConfirmIo) => Promise<unknown>;
16
17
  export declare const addCreate: (group: Command, create: (o: ExtensionCreateOptions) => Promise<void>) => Command;
@@ -1,5 +1,5 @@
1
1
  import { existsSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
2
- import { join } from 'node:path';
2
+ import { join, resolve } from 'node:path';
3
3
  import {} from 'commander';
4
4
  import { addJson, CliError } from '../../lib/json-output.js';
5
5
  import { siteFqdn } from '../../lib/net/origins.js';
@@ -20,6 +20,8 @@ const PRUNE = {
20
20
  store: { paths: ['migrations', 'seeds'] },
21
21
  app: { keys: [['agentage', 'app']], paths: ['src/app-part.test.tsx', 'src/app-lint.test.ts'] },
22
22
  };
23
+ // Parts come as separate words, comma lists or both: `app,api`, `app api`, `app, api`.
24
+ export const splitParts = (parts) => parts.flatMap((part) => part.split(/[\s,]+/)).filter(Boolean);
23
25
  const refusal = ({ id, parts, from = TEMPLATE }, kept) => {
24
26
  const unknown = parts.find((part) => !PARTS.includes(part));
25
27
  if (unknown)
@@ -119,15 +121,18 @@ const printNext = (dir, from, id, kept) => {
119
121
  const branch = ref ? `branch ${ref}` : 'default branch';
120
122
  console.log(` template ${repo}${folder ? `:${folder}` : ''} (${branch}, kit ${kit.replace(/^[\^~]/, '')})`);
121
123
  console.log(` kept ${kept.join(', ')}`);
122
- console.log(` id ${id} · ${hostLine(id)} · contract ${id}.mcpc.json`);
124
+ const contract = kept.includes('mcp') ? ` · contract ${id}.mcpc.json` : '';
125
+ console.log(` folder ${resolve(dir)}`);
126
+ console.log(` id ${id} · ${hostLine(id)}${contract}`);
123
127
  console.log(` next cd ${dir} && agentage extension up`);
124
128
  };
125
129
  // Clones the template's default branch (or the #branch of --from; only its :folder) into ./extension-<id>, no history;
126
130
  // then installs its dependencies, builds it and (unless --no-install) gives it to the daemon.
127
131
  export const runExtensionCreate = async (opts, url = (from) => `https://github.com/${from}`, after = installCreated, io = terminalIo()) => {
128
132
  const { id, from = TEMPLATE } = opts;
129
- const kept = opts.parts.length > 0 ? [...new Set(opts.parts)] : PARTS;
130
- const refused = refusal(opts, kept);
133
+ const parts = splitParts(opts.parts);
134
+ const kept = parts.length > 0 ? [...new Set(parts)] : PARTS;
135
+ const refused = refusal({ ...opts, parts }, kept);
131
136
  if (refused)
132
137
  throw new CliError('invalid_argument', refused);
133
138
  await trustFrom(from, opts, opts.json ? { ...io, isTTY: false } : io);
@@ -146,4 +151,5 @@ export const addCreate = (group, create) => addJson(group
146
151
  .argument('[parts...]', `parts to keep (default: all eight): ${PARTS.join(', ')}`)
147
152
  .option('--from <owner/repo[#branch][:folder]>', `the template repo and folder (default: ${TEMPLATE})`)
148
153
  .option('--no-install', 'build the folder, but do not give it to the daemon')
149
- .option('--yes', 'run code from another --from repo or branch without asking')).action((id, parts, o) => create({ id, parts, ...o }));
154
+ .option('--yes', 'run code from another --from repo or branch without asking')
155
+ .addHelpText('after', '\nExample:\n agentage extension create my-ext app api (parts may also be app,api)')).action((id, parts, o) => create({ id, parts, ...o }));
@@ -43,8 +43,7 @@ const addUp = (group, up) => {
43
43
  .command('up')
44
44
  .description('Run the working copy on the daemon and reload each change; --docker = on Docker')
45
45
  .option(DIR, DIR_TEXT)
46
- .option('--docker', 'the images, store, issuer and gateway on Docker')
47
- .option('--local', 'deprecated: the old name of plain up (removed in the next minor)'))
46
+ .option('--docker', 'the images, store, issuer and gateway on Docker'))
48
47
  .addHelpText('after', UP_HELP)
49
48
  .action(up);
50
49
  };
@@ -14,11 +14,9 @@ export interface ExtensionTokenOptions extends ExtensionUpOptions {
14
14
  }
15
15
  export interface ExtensionUpFlags extends ExtensionUpOptions {
16
16
  docker?: boolean;
17
- local?: boolean;
18
17
  }
19
- export declare const LOCAL_DEPRECATED = "--local is deprecated (removed in the next minor): extension up runs the working copy on the daemon";
20
18
  type LocalRun = (dir: string | undefined, json: boolean) => Promise<unknown>;
21
- export declare const runExtensionUp: ({ docker, local: asked, ...opts }?: ExtensionUpFlags, tool?: LoadKitTool, local?: LocalRun) => Promise<unknown>;
19
+ export declare const runExtensionUp: ({ docker, ...opts }?: ExtensionUpFlags, tool?: LoadKitTool, local?: LocalRun) => Promise<unknown>;
22
20
  type Host = () => Promise<HostClient>;
23
21
  export declare const runExtensionDown: (opts?: ExtensionDownOptions, tool?: LoadKitTool, host?: Host, stopMs?: number) => Promise<unknown>;
24
22
  export declare const runExtensionToken: ({ dir, json, ...opts }: ExtensionTokenOptions, tool?: LoadKitTool, exec?: Exec) => Promise<unknown>;
@@ -2,7 +2,7 @@ import { existsSync } from 'node:fs';
2
2
  import { join, resolve } from 'node:path';
3
3
  import { ensureDaemon } from '../../lib/daemon/daemon-client.js';
4
4
  import { hostClient } from '../../lib/daemon/host-client.js';
5
- import { CliError, omitJson } from '../../lib/json-output.js';
5
+ import { omitJson } from '../../lib/json-output.js';
6
6
  import { folderRow } from './install-once.js';
7
7
  import { loadKitTool } from './kit-tool.js';
8
8
  import { execIn } from './release-guard.js';
@@ -15,17 +15,10 @@ const printed = () => {
15
15
  const lines = [];
16
16
  return { lines, onLine: (line) => void (console.log(line), lines.push(line)) };
17
17
  };
18
- // S1.1.1 D10: an old flag is kept for one minor with a line that names the new form.
19
- export const LOCAL_DEPRECATED = '--local is deprecated (removed in the next minor): extension up runs the working copy on the daemon';
20
18
  // No Docker: the working copy on the daemon, watched (D12); in CI too. --docker: the kit's path.
21
- export const runExtensionUp = async ({ docker, local: asked, ...opts } = {}, tool = loadKitTool, local = (dir, json) => runLocalUp(dir, undefined, json)) => {
22
- if (docker && asked)
23
- throw new CliError('invalid_argument', '--docker and --local: pick one');
24
- if (!docker) {
25
- if (asked)
26
- console.error(LOCAL_DEPRECATED);
19
+ export const runExtensionUp = async ({ docker, ...opts } = {}, tool = loadKitTool, local = (dir, json) => runLocalUp(dir, undefined, json)) => {
20
+ if (!docker)
27
21
  return local(opts.dir, opts.json === true);
28
- }
29
22
  const { up } = await tool();
30
23
  const { lines, onLine } = printed();
31
24
  await up({ ...omitJson(opts), onLine });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentage/cli",
3
- "version": "0.80.1",
3
+ "version": "0.81.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",