@agentage/cli 0.80.0 → 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 +1 -1
- package/dist/commands/extension/create.d.ts +1 -0
- package/dist/commands/extension/create.js +11 -5
- package/dist/commands/extension/up-commands.js +1 -2
- package/dist/commands/extension/up.d.ts +1 -3
- package/dist/commands/extension/up.js +3 -10
- package/dist/lib/daemon/daemon-health.js +1 -1
- package/dist/lib/daemon/daemon-probe.d.ts +1 -0
- package/package.json +2 -2
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
|
-
|
|
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
|
|
130
|
-
const
|
|
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')
|
|
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,
|
|
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 {
|
|
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,
|
|
22
|
-
if (docker
|
|
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 });
|
|
@@ -13,7 +13,7 @@ export const degradedReasons = (health) => {
|
|
|
13
13
|
return [];
|
|
14
14
|
const reasons = health.extensions
|
|
15
15
|
.filter((ext) => UNSETTLED.includes(ext.state))
|
|
16
|
-
.map((ext) => `${ext.id} is ${ext.state}`);
|
|
16
|
+
.map((ext) => `${ext.id} is ${ext.state}${ext.error ? `: ${ext.error}` : ''}`);
|
|
17
17
|
if (health.unsynced?.length)
|
|
18
18
|
reasons.push(`a change of ${health.unsynced.join(', ')} was not undone: its files disagree`);
|
|
19
19
|
if (health.installation === 'unreadable')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentage/cli",
|
|
3
|
-
"version": "0.
|
|
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",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@agentage/apphost": "0.8.5",
|
|
58
|
-
"@agentage/extension": "0.25.
|
|
58
|
+
"@agentage/extension": "0.25.8",
|
|
59
59
|
"@electric-sql/pglite": "^0.6.0",
|
|
60
60
|
"@tailwindcss/postcss": "^4.3.5",
|
|
61
61
|
"chalk": "^6.0.0",
|