@polardbx/pxbaas 0.1.0-beta.8 → 0.1.0-beta.9
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 +5 -4
- package/dist/cli/help-guides.d.ts +1 -1
- package/dist/cli/help-guides.d.ts.map +1 -1
- package/dist/cli/help-guides.js +4 -2
- package/dist/cli/help-guides.js.map +1 -1
- package/dist/commands/skill/index.d.ts.map +1 -1
- package/dist/commands/skill/index.js +89 -14
- package/dist/commands/skill/index.js.map +1 -1
- package/dist/skill/agents-md.d.ts +25 -0
- package/dist/skill/agents-md.d.ts.map +1 -0
- package/dist/skill/agents-md.js +62 -0
- package/dist/skill/agents-md.js.map +1 -0
- package/dist/skill/hosts.d.ts +31 -7
- package/dist/skill/hosts.d.ts.map +1 -1
- package/dist/skill/hosts.js +65 -7
- package/dist/skill/hosts.js.map +1 -1
- package/dist/skill/installer.d.ts +15 -3
- package/dist/skill/installer.d.ts.map +1 -1
- package/dist/skill/installer.js +62 -24
- package/dist/skill/installer.js.map +1 -1
- package/package.json +2 -2
- package/skills/pxbaas-cli/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -46,10 +46,11 @@ developing, deploying, verifying and sharing an app — instance binding,
|
|
|
46
46
|
capability checks, scoped approvals, stage-by-stage failure recovery, and
|
|
47
47
|
network/whitelist handling — without needing credentials or network access.
|
|
48
48
|
Then install the bundled skills (`pxbaas skill install --host
|
|
49
|
-
<qoder|claude|cursor|qwen|hermes>`, or
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
<qoder|claude|cursor|qwen|hermes|codex|gemini|copilot|qwenworkcn|agents>`, or
|
|
50
|
+
`--dir <path>` / `--scope project` for other agent hosts and repo-local
|
|
51
|
+
conventions) and follow `pxbaas-cli` / `pxbaas-app-spec`. `pxbaas login` needs
|
|
52
|
+
a human TTY; agents should bind instances with `pxbaas profile import
|
|
53
|
+
<env-file>` or, with user approval, `pxbaas provision`.
|
|
53
54
|
|
|
54
55
|
Every command accepts `--json` for machine-readable output, and `--profile <name>` to select a profile per invocation (`pxbaas profile ls / use / rm / import` manage them).
|
|
55
56
|
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
/** Short pointer appended to the top-level `pxbaas --help`. */
|
|
14
14
|
export declare const TOP_LEVEL_AGENT_GUIDE = "\nDevelop and deploy an app with pxbaas?\n Run 'pxbaas guide' for the recommended end-to-end workflow\n (skills, instance, capabilities, code, build, init, deploy, verify, share).\n";
|
|
15
15
|
/** Full recommended workflow printed by `pxbaas guide`. */
|
|
16
|
-
export declare const WORKFLOW_GUIDE = "\nRECOMMENDED WORKFLOW (humans and coding agents)\n\n1. Load the bundled skills\n pxbaas skill install --host <qoder|claude|cursor|qwen|hermes
|
|
16
|
+
export declare const WORKFLOW_GUIDE = "\nRECOMMENDED WORKFLOW (humans and coding agents)\n\n1. Load the bundled skills\n pxbaas skill install --host <agent-id> # user scope (default)\n pxbaas skill install --host <agent-id> --scope project # repo-local, travels with code\n user ids: qoder|claude|cursor|qwen|hermes|codex|gemini|copilot|qwenworkcn|agents\n project ids add: trae|codebuddy|cline; other hosts: --dir <skills-dir>\n Read pxbaas-cli/SKILL.md and pxbaas-app-spec/SKILL.md. They define the command\n surface, runtime contract, templates and deploy rules. Use <command> --help for\n exact syntax; never invent flags.\n\n2. Bind an instance (agents must not run 'pxbaas login'; it needs a TTY)\n pxbaas profile ls --json\n pxbaas profile import <env-file> --name <profile> --json # env file from the user\n pxbaas provision --name <profile> --json # only with user approval\n Multi-tenant instance: never deploy into the default or shared tenant and\n never use global keys. With my explicit approval, read DASHBOARD_USERNAME /\n DASHBOARD_PASSWORD only from my env file, pipe them via stdin (never echo),\n and create one isolated tenant bound to a fresh profile:\n printf '%s\\n%s\\n' \"$DASHBOARD_USERNAME\" \"$DASHBOARD_PASSWORD\" | \\\n pxbaas tenant login --endpoint <endpoint> --user-stdin --password-stdin --json\n pxbaas tenant create --generate-id --dry-run --json # preview first\n pxbaas tenant create --generate-id --yes --as-profile --json # after approval\n Continue every later step with that new tenant profile. Without dashboard\n credentials: ask the operator for a tenant access file; never reuse an\n existing tenant or its keys.\n pxbaas --profile <profile> doctor --json # require 0 fail first\n\n3. Check instance capabilities before writing code\n pxbaas --profile <profile> app capabilities --json\n Confirm schemaVersion 2 webapp delivery, Deno/Hono support and the SSR library\n allow-list. Unsupported requirement: stop and report; do not downgrade silently.\n\n4. Scaffold and implement inside the spec\n pxbaas app templates --json\n Pick by each template's meta (delivery/render/frontend/backend/session/\n hasDb/coldStart); spa|api|mpa are legacy workers, not webapps.\n pxbaas app new <name> --template <id> --dir <apps-dir> --json\n Follow pxbaas-app-spec: prebuilt frontend only, Deno backend, no outbound egress,\n no credentials in code or artifacts. Build the frontend when the template needs it.\n\n5. Preview database changes, then get one scoped approval\n pxbaas --profile <profile> app db-init <name> --dir <apps-dir> --dry-run --json\n Table names are fixed by the template: a new app name does not isolate data. Stop\n on unrelated existing tables. After approval:\n pxbaas --profile <profile> app db-init <name> --dir <apps-dir> --yes --json\n\n6. Preflight, then deploy\n pxbaas --profile <profile> app deploy <name> --dir <apps-dir> --dry-run --json\n pxbaas --profile <profile> app deploy <name> --dir <apps-dir> --json\n\n7. Recover by stage, never by restarting everything\n Upload ok but publish timed out (APP_SSR_PROBE_FAILED): retry the SAME candidate,\n max 3 times, 10s apart: pxbaas app publish <name> --dir <apps-dir> --json\n APP_MOUNT_CONFLICT: recover the real mount id from this run's output or local\n state; adopt/destroy only with explicit approval. Never guess ids or generations.\n\n8. Verify and deliver\n pxbaas --profile <profile> app verify <name> --dir <apps-dir> --json\n pxbaas --profile <profile> app url <name> --dir <apps-dir> --json\n Report the returned URL with its Public/Preview classification. A local HTTP 200\n does not prove access from other networks.\n\nCOMMON FAILURES AND THE ONLY SANCTIONED RESPONSES\n- No active profile or not logged in: bind an instance per step 2; never run\n 'pxbaas login' and never paste keys into chat.\n- doctor fail or expired key: stop and report; do not swap in other\n credentials or hand-edit the env file.\n- TENANT_CREDENTIAL_GAP on import: the env lacks tenant-level keys; with my\n approval use the Studio-credential tenant-create chain in step 2, or ask the\n operator for a tenant access file; never use global keys or the default tenant.\n- 401/403 on data or management calls: wrong role or tenant for this profile;\n re-check 'pxbaas whoami --json'; do not broaden privileges.\n- APP_CAPABILITY_UNSUPPORTED or a missing ssrLibs entry: this instance cannot\n run the app shape; stop and report; do not downgrade template or mode.\n- spec-lint blocker: fix the code per the cited pxbaas-app-spec reference;\n --skip-spec-check is never a fix.\n- Quota blocker, or 429/503 from Zero provisioning: stop; do not loop retries\n and do not delete functions to free slots without approval.\n- db-init stops on the first error and never rolls back: report which\n statements completed; do not re-run blindly or hand-write rollback SQL.\n- 409 'Candidate is already active': confirm it is this run's candidate, then\n treat the publish as success.\n- APP_PUBLISH_CONFLICT (stale generation): stop and reconcile from server\n state; never guess a generation.\n- 502/503 right after publish: sandbox cold start; retry the read request\n only, up to 3 times; do not redeploy.\n- Endpoint unreachable or doctor connectivity fail: separate DNS/firewall\n problems from intranet-only endpoints; re-check with 'pxbaas status --json';\n import VPC-internal URLs with --intranet; do not hand-edit the endpoint.\n- Zero instance rejects this machine: the instance is IP-whitelisted to the\n claiming egress IP; run pxbaas on the claiming machine or re-provision with\n --whitelist-ip; do not treat it as an app defect.\n- Others cannot open the URL while you can: IP whitelist or Preview exposure;\n state the limitation in the report; do not promise public access.\n\nSafety: never print or embed credentials; never use --skip-spec-check; never delete\nor adopt resources to work around a blocker.\n";
|
|
17
17
|
//# sourceMappingURL=help-guides.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-guides.d.ts","sourceRoot":"","sources":["../../src/cli/help-guides.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,+DAA+D;AAC/D,eAAO,MAAM,qBAAqB,4LAIjC,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"help-guides.d.ts","sourceRoot":"","sources":["../../src/cli/help-guides.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,+DAA+D;AAC/D,eAAO,MAAM,qBAAqB,4LAIjC,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,cAAc,o7LAmG1B,CAAC"}
|
package/dist/cli/help-guides.js
CHANGED
|
@@ -21,8 +21,10 @@ export const WORKFLOW_GUIDE = `
|
|
|
21
21
|
RECOMMENDED WORKFLOW (humans and coding agents)
|
|
22
22
|
|
|
23
23
|
1. Load the bundled skills
|
|
24
|
-
pxbaas skill install --host <
|
|
25
|
-
|
|
24
|
+
pxbaas skill install --host <agent-id> # user scope (default)
|
|
25
|
+
pxbaas skill install --host <agent-id> --scope project # repo-local, travels with code
|
|
26
|
+
user ids: qoder|claude|cursor|qwen|hermes|codex|gemini|copilot|qwenworkcn|agents
|
|
27
|
+
project ids add: trae|codebuddy|cline; other hosts: --dir <skills-dir>
|
|
26
28
|
Read pxbaas-cli/SKILL.md and pxbaas-app-spec/SKILL.md. They define the command
|
|
27
29
|
surface, runtime contract, templates and deploy rules. Use <command> --help for
|
|
28
30
|
exact syntax; never invent flags.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-guides.js","sourceRoot":"","sources":["../../src/cli/help-guides.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,+DAA+D;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;CAIpC,CAAC;AAEF,2DAA2D;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG
|
|
1
|
+
{"version":3,"file":"help-guides.js","sourceRoot":"","sources":["../../src/cli/help-guides.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,+DAA+D;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;CAIpC,CAAC;AAEF,2DAA2D;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmG7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/skill/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/skill/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBpC;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2D5D"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { formatError, formatSuccess, formatWarning } from '../../credentials/index.js';
|
|
2
2
|
import { SkillManager } from '../../skill/installer.js';
|
|
3
|
-
import { isHostName, SUPPORTED_HOSTS } from '../../skill/hosts.js';
|
|
3
|
+
import { isHostName, isProjectHost, PROJECT_HOSTS, PROJECT_SKILL_DIR, SUPPORTED_HOSTS, } from '../../skill/hosts.js';
|
|
4
|
+
import { agentsMdBlockPresent, removeAgentsMdBlock, upsertAgentsMdBlock, } from '../../skill/agents-md.js';
|
|
4
5
|
/**
|
|
5
6
|
* `pxbaas skill` — install/list/remove ALL bundled Agent Skills (pxbaas-cli,
|
|
6
7
|
* pxbaas-app-spec, ...) into supported Agent hosts (~/.qoder, ~/.claude,
|
|
@@ -17,12 +18,14 @@ export function registerSkillCommands(program) {
|
|
|
17
18
|
skillCmd
|
|
18
19
|
.command('install')
|
|
19
20
|
.description('Install/update all bundled skills into an Agent host skills directory')
|
|
20
|
-
.option('--host <host>', `Target host (${SUPPORTED_HOSTS.join('|')})`)
|
|
21
|
-
.option('--all', 'Install to every detected host')
|
|
21
|
+
.option('--host <host>', `Target host (${SUPPORTED_HOSTS.join('|')}; project scope also: ${PROJECT_HOSTS.filter((h) => !SUPPORTED_HOSTS.includes(h)).join('|')})`)
|
|
22
|
+
.option('--all', 'Install to every detected host (user scope; excludes the neutral "agents" location)')
|
|
23
|
+
.option('--scope <scope>', 'Install scope: user (~/.<host>/skills, default) or project (repo-level convention)')
|
|
22
24
|
.option('--dir <path>', 'Custom skills-root directory (each skill goes under <dir>/<skill>)')
|
|
23
25
|
.option('--skill <name>', 'Install only this bundled skill (default: all)')
|
|
24
26
|
.option('--dry-run', 'Show what would be written without touching disk')
|
|
25
27
|
.option('--force', 'Back up and overwrite a foreign (non-baas) directory')
|
|
28
|
+
.option('--agents-md', 'With --scope project: also write/update the managed pxbaas block in AGENTS.md')
|
|
26
29
|
.option('--json', 'Output in JSON format')
|
|
27
30
|
.action(async (options) => {
|
|
28
31
|
try {
|
|
@@ -49,12 +52,14 @@ export function registerSkillCommands(program) {
|
|
|
49
52
|
skillCmd
|
|
50
53
|
.command('remove')
|
|
51
54
|
.description('Remove bundled skills from a host (only baas-managed dirs; two-phase)')
|
|
52
|
-
.option('--host <host>', `Target host (${SUPPORTED_HOSTS.join('|')})`)
|
|
53
|
-
.option('--all', 'Remove from every detected host')
|
|
55
|
+
.option('--host <host>', `Target host (${SUPPORTED_HOSTS.join('|')}; project scope also: ${PROJECT_HOSTS.filter((h) => !SUPPORTED_HOSTS.includes(h)).join('|')})`)
|
|
56
|
+
.option('--all', 'Remove from every detected host (user scope)')
|
|
57
|
+
.option('--scope <scope>', 'Remove scope: user (default) or project')
|
|
54
58
|
.option('--dir <path>', 'Custom skills-root directory to remove from')
|
|
55
59
|
.option('--skill <name>', 'Remove only this bundled skill (default: all)')
|
|
56
60
|
.option('--dry-run', 'Preview what would be removed')
|
|
57
61
|
.option('--confirm', 'Actually perform the removal (required to delete)')
|
|
62
|
+
.option('--agents-md', 'With --scope project --confirm: also remove the managed pxbaas block from AGENTS.md')
|
|
58
63
|
.option('--json', 'Output in JSON format')
|
|
59
64
|
.action(async (options) => {
|
|
60
65
|
try {
|
|
@@ -75,14 +80,28 @@ function handleError(error, json) {
|
|
|
75
80
|
}
|
|
76
81
|
process.exit(1);
|
|
77
82
|
}
|
|
78
|
-
function resolveHost(host) {
|
|
83
|
+
function resolveHost(host, scope) {
|
|
79
84
|
if (!host)
|
|
80
85
|
return undefined;
|
|
86
|
+
if (scope === 'project') {
|
|
87
|
+
if (!isProjectHost(host)) {
|
|
88
|
+
throw new Error(`Unsupported project-scope host "${host}". Supported: ${PROJECT_HOSTS.join(', ')}.`);
|
|
89
|
+
}
|
|
90
|
+
return host;
|
|
91
|
+
}
|
|
81
92
|
if (!isHostName(host)) {
|
|
82
93
|
throw new Error(`Unsupported host "${host}". Supported: ${SUPPORTED_HOSTS.join(', ')}.`);
|
|
83
94
|
}
|
|
84
95
|
return host;
|
|
85
96
|
}
|
|
97
|
+
function parseScope(scope) {
|
|
98
|
+
if (!scope)
|
|
99
|
+
return 'user';
|
|
100
|
+
if (scope !== 'user' && scope !== 'project') {
|
|
101
|
+
throw new Error(`Invalid --scope "${scope}". Supported: user, project.`);
|
|
102
|
+
}
|
|
103
|
+
return scope;
|
|
104
|
+
}
|
|
86
105
|
function isJson(options, program) {
|
|
87
106
|
return Boolean(options.json || program.opts().json);
|
|
88
107
|
}
|
|
@@ -95,7 +114,8 @@ function emit(results, json, output) {
|
|
|
95
114
|
return;
|
|
96
115
|
}
|
|
97
116
|
for (const r of results) {
|
|
98
|
-
const
|
|
117
|
+
const scopeTag = r.scope && r.scope !== 'user' ? `:${r.scope}` : '';
|
|
118
|
+
const line = `${r.host}${scopeTag}/${r.skill}: ${r.status} -> ${r.targetDir}`;
|
|
99
119
|
if (r.status === 'error' || r.status === 'skipped-foreign') {
|
|
100
120
|
console.log(formatWarning(line + (r.reason ? ` (${r.reason})` : '')));
|
|
101
121
|
}
|
|
@@ -112,10 +132,39 @@ function emit(results, json, output) {
|
|
|
112
132
|
}
|
|
113
133
|
async function handleInstall(options, program) {
|
|
114
134
|
const json = isJson(options, program);
|
|
135
|
+
const scope = parseScope(options.scope);
|
|
136
|
+
if (options.agentsMd && scope !== 'project') {
|
|
137
|
+
throw new Error('--agents-md requires --scope project.');
|
|
138
|
+
}
|
|
115
139
|
const manager = await SkillManager.create();
|
|
116
|
-
const targets = manager.resolveTargets({
|
|
140
|
+
const targets = manager.resolveTargets({
|
|
141
|
+
host: resolveHost(options.host, scope),
|
|
142
|
+
all: options.all,
|
|
143
|
+
dir: options.dir,
|
|
144
|
+
scope,
|
|
145
|
+
});
|
|
117
146
|
const results = await manager.install(targets, { dryRun: options.dryRun, force: options.force, skills: skillFilter(options.skill) });
|
|
118
|
-
|
|
147
|
+
let agentsMd;
|
|
148
|
+
if (options.agentsMd && !options.dryRun) {
|
|
149
|
+
const dirs = [...new Set(targets
|
|
150
|
+
.filter((t) => isProjectHost(t.host))
|
|
151
|
+
.map((t) => PROJECT_SKILL_DIR[t.host]))];
|
|
152
|
+
agentsMd = await upsertAgentsMdBlock(process.cwd(), [
|
|
153
|
+
`- pxbaas skills: ${dirs.join(', ')}`,
|
|
154
|
+
'- Run `pxbaas guide` for the end-to-end develop/deploy/verify/share workflow.',
|
|
155
|
+
]);
|
|
156
|
+
}
|
|
157
|
+
emit(results, json, {
|
|
158
|
+
action: 'install',
|
|
159
|
+
scope,
|
|
160
|
+
dryRun: Boolean(options.dryRun),
|
|
161
|
+
skills: await manager.bundledSkills(),
|
|
162
|
+
...(agentsMd ? { agentsMd } : {}),
|
|
163
|
+
results,
|
|
164
|
+
});
|
|
165
|
+
if (agentsMd && !json) {
|
|
166
|
+
console.log(formatSuccess(`AGENTS.md block ${agentsMd.created ? 'created' : 'updated'}: ${agentsMd.path}`));
|
|
167
|
+
}
|
|
119
168
|
if (results.some((r) => r.status === 'error'))
|
|
120
169
|
process.exit(1);
|
|
121
170
|
}
|
|
@@ -123,27 +172,53 @@ async function handleList(options, program) {
|
|
|
123
172
|
const json = isJson(options, program);
|
|
124
173
|
const manager = await SkillManager.create();
|
|
125
174
|
const bundled = await manager.bundledSkills();
|
|
126
|
-
const results = await manager.list();
|
|
175
|
+
const results = [...(await manager.list()), ...(await manager.listProject())];
|
|
176
|
+
const agentsMd = await agentsMdBlockPresent(process.cwd());
|
|
127
177
|
if (json) {
|
|
128
|
-
console.log(JSON.stringify({ action: 'list', skills: bundled, results }, null, 2));
|
|
178
|
+
console.log(JSON.stringify({ action: 'list', skills: bundled, agentsMd, results }, null, 2));
|
|
129
179
|
return;
|
|
130
180
|
}
|
|
131
181
|
console.log(`Bundled skills: ${bundled.join(', ')}`);
|
|
182
|
+
console.log(`AGENTS.md managed block: ${agentsMd ? 'present' : 'absent'}`);
|
|
132
183
|
if (results.length === 0) {
|
|
133
184
|
console.log(formatWarning('No supported host directories detected.'));
|
|
134
185
|
return;
|
|
135
186
|
}
|
|
136
187
|
for (const r of results) {
|
|
188
|
+
const scopeTag = r.scope && r.scope !== 'user' ? `:${r.scope}` : '';
|
|
137
189
|
const detail = r.status === 'installed' ? ` (v${r.skillVersion}, ${r.installedAt})` : '';
|
|
138
|
-
console.log(`${r.host}/${r.skill}: ${r.status}${detail} -> ${r.targetDir}`);
|
|
190
|
+
console.log(`${r.host}${scopeTag}/${r.skill}: ${r.status}${detail} -> ${r.targetDir}`);
|
|
139
191
|
}
|
|
140
192
|
}
|
|
141
193
|
async function handleRemove(options, program) {
|
|
142
194
|
const json = isJson(options, program);
|
|
195
|
+
const scope = parseScope(options.scope);
|
|
196
|
+
if (options.agentsMd && scope !== 'project') {
|
|
197
|
+
throw new Error('--agents-md requires --scope project.');
|
|
198
|
+
}
|
|
143
199
|
const manager = await SkillManager.create();
|
|
144
|
-
const targets = manager.resolveTargets({
|
|
200
|
+
const targets = manager.resolveTargets({
|
|
201
|
+
host: resolveHost(options.host, scope),
|
|
202
|
+
all: options.all,
|
|
203
|
+
dir: options.dir,
|
|
204
|
+
scope,
|
|
205
|
+
});
|
|
145
206
|
const results = await manager.remove(targets, { dryRun: options.dryRun, confirm: options.confirm, skills: skillFilter(options.skill) });
|
|
146
|
-
|
|
207
|
+
let agentsMd;
|
|
208
|
+
if (options.agentsMd && options.confirm && !options.dryRun) {
|
|
209
|
+
agentsMd = await removeAgentsMdBlock(process.cwd());
|
|
210
|
+
}
|
|
211
|
+
emit(results, json, {
|
|
212
|
+
action: 'remove',
|
|
213
|
+
scope,
|
|
214
|
+
dryRun: Boolean(options.dryRun),
|
|
215
|
+
confirm: Boolean(options.confirm),
|
|
216
|
+
...(agentsMd ? { agentsMd } : {}),
|
|
217
|
+
results,
|
|
218
|
+
});
|
|
219
|
+
if (agentsMd && !json && agentsMd.removed) {
|
|
220
|
+
console.log(formatSuccess(`AGENTS.md block removed: ${agentsMd.path}`));
|
|
221
|
+
}
|
|
147
222
|
if (!options.confirm && !options.dryRun && results.some((r) => r.status === 'dry-run')) {
|
|
148
223
|
console.error(formatWarning('Preview only. Re-run with --confirm to remove.'));
|
|
149
224
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/skill/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/skill/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAE,YAAY,EAAuC,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EACL,UAAU,EACV,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,eAAe,GAGhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,MAAM,QAAQ,GAAG,OAAO;SACrB,OAAO,CAAC,OA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E,IAAI,EAAE;QAClB,MAAM,EAAE,QAAQ;QAChB,KAAK;QACL,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;QAC/B,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;QACjC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,OAAO;KACR,CAAC,CAAC;IACH,IAAI,QAAQ,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QAC1C,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,4BAA4B,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,EAAE,CAAC;QACvF,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,gDAAgD,CAAC,CAAC,CAAC;IACjF,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Managed AGENTS.md block for agents without a SKILL.md convention.
|
|
3
|
+
*
|
|
4
|
+
* Cloud agents (Devin, Jules, Copilot coding agent) and guideline-only tools
|
|
5
|
+
* (Junie, Comate, CodeArts, Windsurf, Kiro steering) read repository-level
|
|
6
|
+
* AGENTS.md. `pxbaas skill install --scope project --agents-md` writes a small
|
|
7
|
+
* marker-delimited block pointing at the exported skill directories and
|
|
8
|
+
* `pxbaas guide`. Everything outside the markers is never touched, and the
|
|
9
|
+
* block is idempotently replaced on re-install.
|
|
10
|
+
*/
|
|
11
|
+
export declare const AGENTS_MD_FILE = "AGENTS.md";
|
|
12
|
+
export declare const BEGIN_MARKER = "<!-- BEGIN pxbaas-skills (managed by pxbaas skill install; do not edit) -->";
|
|
13
|
+
export declare const END_MARKER = "<!-- END pxbaas-skills -->";
|
|
14
|
+
export declare function renderBlock(lines: string[]): string;
|
|
15
|
+
export declare function upsertAgentsMdBlock(projectRoot: string, lines: string[]): Promise<{
|
|
16
|
+
path: string;
|
|
17
|
+
created: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
export declare function removeAgentsMdBlock(projectRoot: string): Promise<{
|
|
20
|
+
path: string;
|
|
21
|
+
removed: boolean;
|
|
22
|
+
deletedFile: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function agentsMdBlockPresent(projectRoot: string): Promise<boolean>;
|
|
25
|
+
//# sourceMappingURL=agents-md.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-md.d.ts","sourceRoot":"","sources":["../../src/skill/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,eAAO,MAAM,cAAc,cAAc,CAAC;AAC1C,eAAO,MAAM,YAAY,gFACsD,CAAC;AAChF,eAAO,MAAM,UAAU,+BAA+B,CAAC;AAUvD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAEnD;AAED,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EAAE,GACd,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAa7C;AAED,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAAC,CAYnE;AAED,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKhF"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Managed AGENTS.md block for agents without a SKILL.md convention.
|
|
3
|
+
*
|
|
4
|
+
* Cloud agents (Devin, Jules, Copilot coding agent) and guideline-only tools
|
|
5
|
+
* (Junie, Comate, CodeArts, Windsurf, Kiro steering) read repository-level
|
|
6
|
+
* AGENTS.md. `pxbaas skill install --scope project --agents-md` writes a small
|
|
7
|
+
* marker-delimited block pointing at the exported skill directories and
|
|
8
|
+
* `pxbaas guide`. Everything outside the markers is never touched, and the
|
|
9
|
+
* block is idempotently replaced on re-install.
|
|
10
|
+
*/
|
|
11
|
+
import { readFile, writeFile, rm } from 'node:fs/promises';
|
|
12
|
+
import { existsSync } from 'node:fs';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
export const AGENTS_MD_FILE = 'AGENTS.md';
|
|
15
|
+
export const BEGIN_MARKER = '<!-- BEGIN pxbaas-skills (managed by pxbaas skill install; do not edit) -->';
|
|
16
|
+
export const END_MARKER = '<!-- END pxbaas-skills -->';
|
|
17
|
+
function escapeRe(s) {
|
|
18
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
19
|
+
}
|
|
20
|
+
function blockRegex() {
|
|
21
|
+
return new RegExp(`\\n*${escapeRe(BEGIN_MARKER)}[\\s\\S]*?${escapeRe(END_MARKER)}\\n*`);
|
|
22
|
+
}
|
|
23
|
+
export function renderBlock(lines) {
|
|
24
|
+
return [BEGIN_MARKER, ...lines, END_MARKER].join('\n');
|
|
25
|
+
}
|
|
26
|
+
export async function upsertAgentsMdBlock(projectRoot, lines) {
|
|
27
|
+
const path = join(projectRoot, AGENTS_MD_FILE);
|
|
28
|
+
const block = renderBlock(lines);
|
|
29
|
+
if (!existsSync(path)) {
|
|
30
|
+
await writeFile(path, `${block}\n`, 'utf8');
|
|
31
|
+
return { path, created: true };
|
|
32
|
+
}
|
|
33
|
+
const content = await readFile(path, 'utf8');
|
|
34
|
+
const updated = blockRegex().test(content)
|
|
35
|
+
? content.replace(blockRegex(), `${block}\n`)
|
|
36
|
+
: `${content.replace(/\s*$/, '')}\n\n${block}\n`;
|
|
37
|
+
await writeFile(path, updated, 'utf8');
|
|
38
|
+
return { path, created: false };
|
|
39
|
+
}
|
|
40
|
+
export async function removeAgentsMdBlock(projectRoot) {
|
|
41
|
+
const path = join(projectRoot, AGENTS_MD_FILE);
|
|
42
|
+
if (!existsSync(path))
|
|
43
|
+
return { path, removed: false, deletedFile: false };
|
|
44
|
+
const content = await readFile(path, 'utf8');
|
|
45
|
+
if (!blockRegex().test(content))
|
|
46
|
+
return { path, removed: false, deletedFile: false };
|
|
47
|
+
const stripped = content.replace(blockRegex(), '');
|
|
48
|
+
if (stripped.trim() === '') {
|
|
49
|
+
await rm(path);
|
|
50
|
+
return { path, removed: true, deletedFile: true };
|
|
51
|
+
}
|
|
52
|
+
await writeFile(path, stripped, 'utf8');
|
|
53
|
+
return { path, removed: true, deletedFile: false };
|
|
54
|
+
}
|
|
55
|
+
export async function agentsMdBlockPresent(projectRoot) {
|
|
56
|
+
const path = join(projectRoot, AGENTS_MD_FILE);
|
|
57
|
+
if (!existsSync(path))
|
|
58
|
+
return false;
|
|
59
|
+
const content = await readFile(path, 'utf8');
|
|
60
|
+
return blockRegex().test(content);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=agents-md.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-md.js","sourceRoot":"","sources":["../../src/skill/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,W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,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACpC,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC7C,OAAO,UAAU,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC"}
|
package/dist/skill/hosts.d.ts
CHANGED
|
@@ -2,20 +2,44 @@
|
|
|
2
2
|
* Skill host mapping & detection.
|
|
3
3
|
*
|
|
4
4
|
* Mirrors the ctxdb0 `#skillTarget` convention: each supported Agent host keeps
|
|
5
|
-
* its skills under `~/.<host>/skills/<skill>/`.
|
|
6
|
-
*
|
|
5
|
+
* its skills under `~/.<host>/skills/<skill>/`. User-level hosts are verified
|
|
6
|
+
* against vendor docs; unverified locations are NOT hardcoded here.
|
|
7
|
+
*
|
|
8
|
+
* Two install scopes exist:
|
|
9
|
+
* - `user` (default): the per-host directory under $HOME.
|
|
10
|
+
* - `project`: the repository-level convention (e.g. `.agents/skills`), so the
|
|
11
|
+
* skills travel with the code and cloud agents cloning the repo pick them up.
|
|
12
|
+
*
|
|
13
|
+
* The vendor-neutral key `agents` maps to `~/.agents/skills` / `.agents/skills`,
|
|
14
|
+
* which Codex scans and Copilot reads. It is intentionally excluded from `--all`
|
|
15
|
+
* (install it explicitly) to avoid duplicate copies next to per-host installs.
|
|
7
16
|
*/
|
|
8
|
-
export type HostName = 'qoder' | 'claude' | 'cursor' | 'qwen' | 'hermes';
|
|
9
|
-
/** Hosts supported by `pxbaas skill install
|
|
17
|
+
export type HostName = 'qoder' | 'claude' | 'cursor' | 'qwen' | 'hermes' | 'codex' | 'gemini' | 'copilot' | 'qwenworkcn' | 'agents';
|
|
18
|
+
/** Hosts supported by `pxbaas skill install --scope user`. */
|
|
10
19
|
export declare const SUPPORTED_HOSTS: HostName[];
|
|
20
|
+
/** Neutral locations: never installed by `--all`, only by explicit `--host`. */
|
|
21
|
+
export declare const ALL_EXCLUDED_HOSTS: HostName[];
|
|
22
|
+
/**
|
|
23
|
+
* Host keys accepted for `--scope project`. Some (trae/codebuddy/cline) publish
|
|
24
|
+
* only a repository-level convention, so they are project-scope only.
|
|
25
|
+
* Every path below is taken from vendor documentation; do not add guesses.
|
|
26
|
+
*/
|
|
27
|
+
export type ProjectHost = 'claude' | 'qwen' | 'codex' | 'agents' | 'gemini' | 'copilot' | 'trae' | 'codebuddy' | 'cline';
|
|
28
|
+
export declare const PROJECT_HOSTS: ProjectHost[];
|
|
29
|
+
/** Repository-relative skills directory per project-scope host. */
|
|
30
|
+
export declare const PROJECT_SKILL_DIR: Record<ProjectHost, string>;
|
|
11
31
|
export declare function isHostName(value: string): value is HostName;
|
|
12
|
-
|
|
32
|
+
export declare function isProjectHost(value: string): value is ProjectHost;
|
|
33
|
+
/** `~/.<host>/skills` root for a user-scope host. */
|
|
13
34
|
export declare function hostSkillsRoot(host: HostName, homeDir: string): string;
|
|
14
|
-
/** Full target directory for
|
|
35
|
+
/** Full target directory for a skill under a user-scope host. */
|
|
15
36
|
export declare function hostSkillDir(host: HostName, homeDir: string, skillName?: string): string;
|
|
37
|
+
/** Repository-level skills root for a project-scope host. */
|
|
38
|
+
export declare function projectSkillsRoot(host: ProjectHost, projectRoot: string): string;
|
|
16
39
|
/**
|
|
17
40
|
* Detect which supported hosts already have a `~/.<host>` directory, i.e. hosts
|
|
18
|
-
* the user plausibly uses. Used for auto-selection and `--all
|
|
41
|
+
* the user plausibly uses. Used for auto-selection and `--all` (which further
|
|
42
|
+
* excludes ALL_EXCLUDED_HOSTS at the caller).
|
|
19
43
|
*/
|
|
20
44
|
export declare function detectInstalledHosts(homeDir: string): HostName[];
|
|
21
45
|
//# sourceMappingURL=hosts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosts.d.ts","sourceRoot":"","sources":["../../src/skill/hosts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hosts.d.ts","sourceRoot":"","sources":["../../src/skill/hosts.ts"],"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|
2
2
|
* Skill host mapping & detection.
|
|
3
3
|
*
|
|
4
4
|
* Mirrors the ctxdb0 `#skillTarget` convention: each supported Agent host keeps
|
|
5
|
-
* its skills under `~/.<host>/skills/<skill>/`.
|
|
6
|
-
*
|
|
5
|
+
* its skills under `~/.<host>/skills/<skill>/`. User-level hosts are verified
|
|
6
|
+
* against vendor docs; unverified locations are NOT hardcoded here.
|
|
7
|
+
*
|
|
8
|
+
* Two install scopes exist:
|
|
9
|
+
* - `user` (default): the per-host directory under $HOME.
|
|
10
|
+
* - `project`: the repository-level convention (e.g. `.agents/skills`), so the
|
|
11
|
+
* skills travel with the code and cloud agents cloning the repo pick them up.
|
|
12
|
+
*
|
|
13
|
+
* The vendor-neutral key `agents` maps to `~/.agents/skills` / `.agents/skills`,
|
|
14
|
+
* which Codex scans and Copilot reads. It is intentionally excluded from `--all`
|
|
15
|
+
* (install it explicitly) to avoid duplicate copies next to per-host installs.
|
|
7
16
|
*/
|
|
8
17
|
import { existsSync } from 'node:fs';
|
|
9
18
|
import { join } from 'node:path';
|
|
10
|
-
/** Hosts supported by `pxbaas skill install
|
|
11
|
-
export const SUPPORTED_HOSTS = [
|
|
19
|
+
/** Hosts supported by `pxbaas skill install --scope user`. */
|
|
20
|
+
export const SUPPORTED_HOSTS = [
|
|
21
|
+
'qoder',
|
|
22
|
+
'claude',
|
|
23
|
+
'cursor',
|
|
24
|
+
'qwen',
|
|
25
|
+
'hermes',
|
|
26
|
+
'codex',
|
|
27
|
+
'gemini',
|
|
28
|
+
'copilot',
|
|
29
|
+
'qwenworkcn',
|
|
30
|
+
'agents',
|
|
31
|
+
];
|
|
32
|
+
/** Neutral locations: never installed by `--all`, only by explicit `--host`. */
|
|
33
|
+
export const ALL_EXCLUDED_HOSTS = ['agents'];
|
|
12
34
|
/** Host name -> the dot-directory under $HOME that hosts its config/skills. */
|
|
13
35
|
const HOST_DIR = {
|
|
14
36
|
qoder: '.qoder',
|
|
@@ -16,21 +38,57 @@ const HOST_DIR = {
|
|
|
16
38
|
cursor: '.cursor',
|
|
17
39
|
qwen: '.qwen',
|
|
18
40
|
hermes: '.hermes',
|
|
41
|
+
codex: '.codex',
|
|
42
|
+
gemini: '.gemini',
|
|
43
|
+
copilot: '.copilot',
|
|
44
|
+
qwenworkcn: '.qwenworkcn',
|
|
45
|
+
agents: '.agents',
|
|
46
|
+
};
|
|
47
|
+
export const PROJECT_HOSTS = [
|
|
48
|
+
'claude',
|
|
49
|
+
'qwen',
|
|
50
|
+
'codex',
|
|
51
|
+
'agents',
|
|
52
|
+
'gemini',
|
|
53
|
+
'copilot',
|
|
54
|
+
'trae',
|
|
55
|
+
'codebuddy',
|
|
56
|
+
'cline',
|
|
57
|
+
];
|
|
58
|
+
/** Repository-relative skills directory per project-scope host. */
|
|
59
|
+
export const PROJECT_SKILL_DIR = {
|
|
60
|
+
claude: '.claude/skills',
|
|
61
|
+
qwen: '.qwen/skills',
|
|
62
|
+
codex: '.agents/skills',
|
|
63
|
+
agents: '.agents/skills',
|
|
64
|
+
gemini: '.gemini/skills',
|
|
65
|
+
copilot: '.github/skills',
|
|
66
|
+
trae: '.trae/skills',
|
|
67
|
+
codebuddy: '.codebuddy/skills',
|
|
68
|
+
cline: '.cline/skills',
|
|
19
69
|
};
|
|
20
70
|
export function isHostName(value) {
|
|
21
71
|
return SUPPORTED_HOSTS.includes(value);
|
|
22
72
|
}
|
|
23
|
-
|
|
73
|
+
export function isProjectHost(value) {
|
|
74
|
+
return PROJECT_HOSTS.includes(value);
|
|
75
|
+
}
|
|
76
|
+
/** `~/.<host>/skills` root for a user-scope host. */
|
|
24
77
|
export function hostSkillsRoot(host, homeDir) {
|
|
25
78
|
return join(homeDir, HOST_DIR[host], 'skills');
|
|
26
79
|
}
|
|
27
|
-
/** Full target directory for
|
|
80
|
+
/** Full target directory for a skill under a user-scope host. */
|
|
28
81
|
export function hostSkillDir(host, homeDir, skillName = 'pxbaas-cli') {
|
|
29
82
|
return join(hostSkillsRoot(host, homeDir), skillName);
|
|
30
83
|
}
|
|
84
|
+
/** Repository-level skills root for a project-scope host. */
|
|
85
|
+
export function projectSkillsRoot(host, projectRoot) {
|
|
86
|
+
return join(projectRoot, PROJECT_SKILL_DIR[host]);
|
|
87
|
+
}
|
|
31
88
|
/**
|
|
32
89
|
* Detect which supported hosts already have a `~/.<host>` directory, i.e. hosts
|
|
33
|
-
* the user plausibly uses. Used for auto-selection and `--all
|
|
90
|
+
* the user plausibly uses. Used for auto-selection and `--all` (which further
|
|
91
|
+
* excludes ALL_EXCLUDED_HOSTS at the caller).
|
|
34
92
|
*/
|
|
35
93
|
export function detectInstalledHosts(homeDir) {
|
|
36
94
|
return SUPPORTED_HOSTS.filter((host) => existsSync(join(homeDir, HOST_DIR[host])));
|
package/dist/skill/hosts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosts.js","sourceRoot":"","sources":["../../src/skill/hosts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hosts.js","sourceRoot":"","sources":["../../src/skill/hosts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAcjC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAAe;IACzC,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,QAAQ;CACT,CAAC;AAEF,gFAAgF;AAChF,MAAM,CAAC,MAAM,kBAAkB,GAAe,CAAC,QAAQ,CAAC,CAAC;AAEzD,+EAA+E;AAC/E,MAAM,QAAQ,GAA6B;IACzC,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,SAAS;IACjB,KAAK,E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AiB,CAAC,IAAI,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Layout: each host has a skills root (`~/.<host>/skills`); every bundled skill is
|
|
10
10
|
* installed into `<skillsRoot>/<skillName>/` with its own fail-closed owner marker.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
export type InstallScope = 'user' | 'project';
|
|
13
13
|
export type InstallStatus = 'installed' | 'updated' | 'skipped-foreign' | 'dry-run' | 'error';
|
|
14
14
|
export type RemoveStatus = 'removed' | 'not-installed' | 'skipped-foreign' | 'dry-run' | 'error';
|
|
15
15
|
export type ListStatus = 'installed' | 'not-installed' | 'foreign';
|
|
@@ -18,6 +18,7 @@ export interface SkillResult {
|
|
|
18
18
|
skill: string;
|
|
19
19
|
targetDir: string;
|
|
20
20
|
status: InstallStatus | RemoveStatus | ListStatus;
|
|
21
|
+
scope?: InstallScope;
|
|
21
22
|
filesWritten?: string[];
|
|
22
23
|
skillVersion?: string;
|
|
23
24
|
installedAt?: string;
|
|
@@ -30,6 +31,8 @@ export interface SkillManagerOptions {
|
|
|
30
31
|
skillsRoot?: string;
|
|
31
32
|
/** CLI version stamped into markers (defaults to readCliVersion()). */
|
|
32
33
|
cliVersion?: string;
|
|
34
|
+
/** Repository root for `--scope project` targets (defaults to process.cwd()). */
|
|
35
|
+
projectRoot?: string;
|
|
33
36
|
}
|
|
34
37
|
export interface InstallOptions {
|
|
35
38
|
dryRun?: boolean;
|
|
@@ -46,11 +49,13 @@ export interface RemoveOptions {
|
|
|
46
49
|
export interface ResolvedTarget {
|
|
47
50
|
host: string;
|
|
48
51
|
destRoot: string;
|
|
52
|
+
scope: InstallScope;
|
|
49
53
|
}
|
|
50
54
|
export declare class SkillManager {
|
|
51
55
|
private readonly homeDir;
|
|
52
56
|
private readonly skillsRoot;
|
|
53
57
|
private readonly cliVersion;
|
|
58
|
+
private readonly projectRoot;
|
|
54
59
|
private skillsCache;
|
|
55
60
|
constructor(options?: SkillManagerOptions);
|
|
56
61
|
/** Async factory that resolves the CLI version from package.json. */
|
|
@@ -61,14 +66,17 @@ export declare class SkillManager {
|
|
|
61
66
|
/**
|
|
62
67
|
* Resolve which host skills-roots to act on.
|
|
63
68
|
* - `--dir` wins (single custom skills-root, host label "custom")
|
|
64
|
-
* - `--
|
|
69
|
+
* - `--scope project` requires `--host` (a ProjectHost) or `--dir`; `--all` is
|
|
70
|
+
* user-scope only because writing every vendor repo directory is spammy
|
|
71
|
+
* - `--all` (user scope) → every detected host except ALL_EXCLUDED_HOSTS
|
|
65
72
|
* - `--host <h>` → that host
|
|
66
73
|
* - none → auto-detect: exactly one detected host is used; 0 or >1 is an error
|
|
67
74
|
*/
|
|
68
75
|
resolveTargets(opts: {
|
|
69
|
-
host?:
|
|
76
|
+
host?: string;
|
|
70
77
|
all?: boolean;
|
|
71
78
|
dir?: string;
|
|
79
|
+
scope?: InstallScope;
|
|
72
80
|
}): ResolvedTarget[];
|
|
73
81
|
/** Install all (or selected) bundled skills into each target's skills root. */
|
|
74
82
|
install(targets: ResolvedTarget[], options?: InstallOptions): Promise<SkillResult[]>;
|
|
@@ -77,6 +85,10 @@ export declare class SkillManager {
|
|
|
77
85
|
list(options?: {
|
|
78
86
|
skills?: string[];
|
|
79
87
|
}): Promise<SkillResult[]>;
|
|
88
|
+
/** Report install state of bundled skills in repository-level directories. */
|
|
89
|
+
listProject(options?: {
|
|
90
|
+
skills?: string[];
|
|
91
|
+
}): Promise<SkillResult[]>;
|
|
80
92
|
private listOne;
|
|
81
93
|
/**
|
|
82
94
|
* Remove bundled skills from each target. Only removes directories owned by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../src/skill/installer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../src/skill/installer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAmBH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,CAAC;AAC9C,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,SAAS,GAAG,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAAC;AAC9F,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,eAAe,GAAG,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAAC;AACjG,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,eAAe,GAAG,SAAS,CAAC;AAEnE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,aAAa,GAAG,YAAY,GAAG,UAAU,CAAC;IAClD,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sEAAsE;IACtE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ACxE,WAAW,CAAC,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;KAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;YAiBhE,OAAO;IAerB;;;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;YAa9E,SAAS;CAsBxB"}
|
package/dist/skill/installer.js
CHANGED
|
@@ -14,17 +14,19 @@ import { existsSync } from 'node:fs';
|
|
|
14
14
|
import { homedir } from 'node:os';
|
|
15
15
|
import { dirname, join } from 'node:path';
|
|
16
16
|
import { listBundledSkillsIn, listSkillFiles, readCliVersion, resolveSkillsRoot } from './assets.js';
|
|
17
|
-
import { detectInstalledHosts, hostSkillsRoot } from './hosts.js';
|
|
17
|
+
import { ALL_EXCLUDED_HOSTS, detectInstalledHosts, hostSkillsRoot, projectSkillsRoot, PROJECT_HOSTS, } from './hosts.js';
|
|
18
18
|
import { classifyTarget, readMarker, sha256File, writeMarker } from './ownership.js';
|
|
19
19
|
export class SkillManager {
|
|
20
20
|
homeDir;
|
|
21
21
|
skillsRoot;
|
|
22
22
|
cliVersion;
|
|
23
|
+
projectRoot;
|
|
23
24
|
skillsCache = null;
|
|
24
25
|
constructor(options = {}) {
|
|
25
26
|
this.homeDir = options.homeDir ?? homedir();
|
|
26
27
|
this.skillsRoot = options.skillsRoot ?? resolveSkillsRoot();
|
|
27
28
|
this.cliVersion = options.cliVersion ?? 'unknown';
|
|
29
|
+
this.projectRoot = options.projectRoot ?? process.cwd();
|
|
28
30
|
}
|
|
29
31
|
/** Async factory that resolves the CLI version from package.json. */
|
|
30
32
|
static async create(options = {}) {
|
|
@@ -51,27 +53,43 @@ export class SkillManager {
|
|
|
51
53
|
/**
|
|
52
54
|
* Resolve which host skills-roots to act on.
|
|
53
55
|
* - `--dir` wins (single custom skills-root, host label "custom")
|
|
54
|
-
* - `--
|
|
56
|
+
* - `--scope project` requires `--host` (a ProjectHost) or `--dir`; `--all` is
|
|
57
|
+
* user-scope only because writing every vendor repo directory is spammy
|
|
58
|
+
* - `--all` (user scope) → every detected host except ALL_EXCLUDED_HOSTS
|
|
55
59
|
* - `--host <h>` → that host
|
|
56
60
|
* - none → auto-detect: exactly one detected host is used; 0 or >1 is an error
|
|
57
61
|
*/
|
|
58
62
|
resolveTargets(opts) {
|
|
63
|
+
const scope = opts.scope ?? 'user';
|
|
64
|
+
if (scope === 'project') {
|
|
65
|
+
if (opts.all) {
|
|
66
|
+
throw new Error(`--all is user-scope only. For --scope project pass --host <${PROJECT_HOSTS.join('|')}> or --dir <path>.`);
|
|
67
|
+
}
|
|
68
|
+
if (opts.dir) {
|
|
69
|
+
return [{ host: 'custom', destRoot: opts.dir, scope }];
|
|
70
|
+
}
|
|
71
|
+
if (!opts.host || !PROJECT_HOSTS.includes(opts.host)) {
|
|
72
|
+
throw new Error(`--scope project requires --host <${PROJECT_HOSTS.join('|')}> (or --dir <path>).`);
|
|
73
|
+
}
|
|
74
|
+
const host = opts.host;
|
|
75
|
+
return [{ host, destRoot: projectSkillsRoot(host, this.projectRoot), scope }];
|
|
76
|
+
}
|
|
59
77
|
if (opts.dir) {
|
|
60
|
-
return [{ host: 'custom', destRoot: opts.dir }];
|
|
78
|
+
return [{ host: 'custom', destRoot: opts.dir, scope }];
|
|
61
79
|
}
|
|
62
80
|
if (opts.all) {
|
|
63
|
-
const detected = detectInstalledHosts(this.homeDir);
|
|
81
|
+
const detected = detectInstalledHosts(this.homeDir).filter((h) => !ALL_EXCLUDED_HOSTS.includes(h));
|
|
64
82
|
if (detected.length === 0) {
|
|
65
83
|
throw new Error(`No supported host directory found under ${this.homeDir}. Pass --host <name> or --dir <path>.`);
|
|
66
84
|
}
|
|
67
|
-
return detected.map((host) => ({ host, destRoot: hostSkillsRoot(host, this.homeDir) }));
|
|
85
|
+
return detected.map((host) => ({ host, destRoot: hostSkillsRoot(host, this.homeDir), scope }));
|
|
68
86
|
}
|
|
69
87
|
if (opts.host) {
|
|
70
|
-
return [{ host: opts.host, destRoot: hostSkillsRoot(opts.host, this.homeDir) }];
|
|
88
|
+
return [{ host: opts.host, destRoot: hostSkillsRoot(opts.host, this.homeDir), scope }];
|
|
71
89
|
}
|
|
72
90
|
const detected = detectInstalledHosts(this.homeDir);
|
|
73
91
|
if (detected.length === 1) {
|
|
74
|
-
return [{ host: detected[0], destRoot: hostSkillsRoot(detected[0], this.homeDir) }];
|
|
92
|
+
return [{ host: detected[0], destRoot: hostSkillsRoot(detected[0], this.homeDir), scope }];
|
|
75
93
|
}
|
|
76
94
|
if (detected.length === 0) {
|
|
77
95
|
throw new Error(`No supported host directory found under ${this.homeDir}. Pass --host <name> or --dir <path>.`);
|
|
@@ -89,12 +107,12 @@ export class SkillManager {
|
|
|
89
107
|
for (const target of targets) {
|
|
90
108
|
for (const skill of skills) {
|
|
91
109
|
const destDir = join(target.destRoot, skill);
|
|
92
|
-
results.push(await this.installOne(target.host, skill, destDir, filesBySkill.get(skill) ?? [], options));
|
|
110
|
+
results.push(await this.installOne(target.host, skill, destDir, filesBySkill.get(skill) ?? [], options, target.scope));
|
|
93
111
|
}
|
|
94
112
|
}
|
|
95
113
|
return results;
|
|
96
114
|
}
|
|
97
|
-
async installOne(host, skill, targetDir, files, options) {
|
|
115
|
+
async installOne(host, skill, targetDir, files, options, scope = 'user') {
|
|
98
116
|
const assetDir = join(this.skillsRoot, skill);
|
|
99
117
|
const state = await classifyTarget(targetDir);
|
|
100
118
|
if (state === 'foreign' && !options.force) {
|
|
@@ -103,13 +121,14 @@ export class SkillManager {
|
|
|
103
121
|
skill,
|
|
104
122
|
targetDir,
|
|
105
123
|
status: 'skipped-foreign',
|
|
124
|
+
scope,
|
|
106
125
|
reason: 'Directory exists but is not managed by pxbaas-cli. Re-run with --force to back it up and overwrite.',
|
|
107
126
|
};
|
|
108
127
|
}
|
|
109
128
|
const plannedStatus = state === 'owned' ? 'updated' : 'installed';
|
|
110
129
|
if (options.dryRun) {
|
|
111
130
|
const verb = state === 'owned' ? 'update' : 'install';
|
|
112
|
-
return { host, skill, targetDir, status: 'dry-run', filesWritten: files, reason: `would ${verb}` };
|
|
131
|
+
return { host, skill, targetDir, status: 'dry-run', scope, filesWritten: files, reason: `would ${verb}` };
|
|
113
132
|
}
|
|
114
133
|
try {
|
|
115
134
|
if (state === 'foreign' && options.force) {
|
|
@@ -139,10 +158,10 @@ export class SkillManager {
|
|
|
139
158
|
throw new Error(`Verification failed: missing ${rel} after copy`);
|
|
140
159
|
}
|
|
141
160
|
}
|
|
142
|
-
return { host, skill, targetDir, status: plannedStatus, filesWritten: files, skillVersion: this.cliVersion };
|
|
161
|
+
return { host, skill, targetDir, status: plannedStatus, scope, filesWritten: files, skillVersion: this.cliVersion };
|
|
143
162
|
}
|
|
144
163
|
catch (err) {
|
|
145
|
-
return { host, skill, targetDir, status: 'error', reason: err instanceof Error ? err.message : String(err) };
|
|
164
|
+
return { host, skill, targetDir, status: 'error', scope, reason: err instanceof Error ? err.message : String(err) };
|
|
146
165
|
}
|
|
147
166
|
}
|
|
148
167
|
/** Report install state of every bundled skill across all detected hosts. */
|
|
@@ -152,20 +171,39 @@ export class SkillManager {
|
|
|
152
171
|
for (const host of detectInstalledHosts(this.homeDir)) {
|
|
153
172
|
const destRoot = hostSkillsRoot(host, this.homeDir);
|
|
154
173
|
for (const skill of skills) {
|
|
155
|
-
results.push(await this.listOne(host, skill, join(destRoot, skill)));
|
|
174
|
+
results.push(await this.listOne(host, skill, join(destRoot, skill), 'user'));
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return results;
|
|
178
|
+
}
|
|
179
|
+
/** Report install state of bundled skills in repository-level directories. */
|
|
180
|
+
async listProject(options = {}) {
|
|
181
|
+
const skills = await this.selectedSkills(options.skills);
|
|
182
|
+
const results = [];
|
|
183
|
+
const seenRoots = new Set();
|
|
184
|
+
for (const host of PROJECT_HOSTS) {
|
|
185
|
+
const destRoot = projectSkillsRoot(host, this.projectRoot);
|
|
186
|
+
// codex and the neutral `agents` key share .agents/skills: report once.
|
|
187
|
+
if (seenRoots.has(destRoot))
|
|
188
|
+
continue;
|
|
189
|
+
seenRoots.add(destRoot);
|
|
190
|
+
if (!existsSync(destRoot))
|
|
191
|
+
continue;
|
|
192
|
+
for (const skill of skills) {
|
|
193
|
+
results.push(await this.listOne(host, skill, join(destRoot, skill), 'project'));
|
|
156
194
|
}
|
|
157
195
|
}
|
|
158
196
|
return results;
|
|
159
197
|
}
|
|
160
|
-
async listOne(host, skill, targetDir) {
|
|
198
|
+
async listOne(host, skill, targetDir, scope = 'user') {
|
|
161
199
|
const state = await classifyTarget(targetDir);
|
|
162
200
|
if (state === 'absent')
|
|
163
|
-
return { host, skill, targetDir, status: 'not-installed' };
|
|
201
|
+
return { host, skill, targetDir, status: 'not-installed', scope };
|
|
164
202
|
if (state === 'foreign') {
|
|
165
|
-
return { host, skill, targetDir, status: 'foreign', reason: 'directory exists but is not managed by pxbaas-cli' };
|
|
203
|
+
return { host, skill, targetDir, status: 'foreign', scope, reason: 'directory exists but is not managed by pxbaas-cli' };
|
|
166
204
|
}
|
|
167
205
|
const marker = await readMarker(targetDir);
|
|
168
|
-
return { host, skill, targetDir, status: 'installed', skillVersion: marker?.skillVersion, installedAt: marker?.installedAt };
|
|
206
|
+
return { host, skill, targetDir, status: 'installed', scope, skillVersion: marker?.skillVersion, installedAt: marker?.installedAt };
|
|
169
207
|
}
|
|
170
208
|
/**
|
|
171
209
|
* Remove bundled skills from each target. Only removes directories owned by
|
|
@@ -176,27 +214,27 @@ export class SkillManager {
|
|
|
176
214
|
const results = [];
|
|
177
215
|
for (const target of targets) {
|
|
178
216
|
for (const skill of skills) {
|
|
179
|
-
results.push(await this.removeOne(target.host, skill, join(target.destRoot, skill), options));
|
|
217
|
+
results.push(await this.removeOne(target.host, skill, join(target.destRoot, skill), options, target.scope));
|
|
180
218
|
}
|
|
181
219
|
}
|
|
182
220
|
return results;
|
|
183
221
|
}
|
|
184
|
-
async removeOne(host, skill, targetDir, options) {
|
|
222
|
+
async removeOne(host, skill, targetDir, options, scope = 'user') {
|
|
185
223
|
const state = await classifyTarget(targetDir);
|
|
186
224
|
if (state === 'absent')
|
|
187
|
-
return { host, skill, targetDir, status: 'not-installed' };
|
|
225
|
+
return { host, skill, targetDir, status: 'not-installed', scope };
|
|
188
226
|
if (state === 'foreign') {
|
|
189
|
-
return { host, skill, targetDir, status: 'skipped-foreign', reason: 'Directory is not managed by pxbaas-cli; refusing to delete.' };
|
|
227
|
+
return { host, skill, targetDir, status: 'skipped-foreign', scope, reason: 'Directory is not managed by pxbaas-cli; refusing to delete.' };
|
|
190
228
|
}
|
|
191
229
|
if (options.dryRun || !options.confirm) {
|
|
192
|
-
return { host, skill, targetDir, status: 'dry-run', reason: options.dryRun ? 'would remove' : 'pass --confirm to remove' };
|
|
230
|
+
return { host, skill, targetDir, status: 'dry-run', scope, reason: options.dryRun ? 'would remove' : 'pass --confirm to remove' };
|
|
193
231
|
}
|
|
194
232
|
try {
|
|
195
233
|
await rm(targetDir, { recursive: true, force: true });
|
|
196
|
-
return { host, skill, targetDir, status: 'removed' };
|
|
234
|
+
return { host, skill, targetDir, status: 'removed', scope };
|
|
197
235
|
}
|
|
198
236
|
catch (err) {
|
|
199
|
-
return { host, skill, targetDir, status: 'error', reason: err instanceof Error ? err.message : String(err) };
|
|
237
|
+
return { host, skill, targetDir, status: 'error', scope, reason: err instanceof Error ? err.message : String(err) };
|
|
200
238
|
}
|
|
201
239
|
}
|
|
202
240
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.js","sourceRoot":"","sources":["../../src/skill/installer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EA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,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,6DAA6D,EAAE,CAAC;QAC7I,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACvC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,0BAA0B,EAAE,CAAC;QACpI,CAAC;QACD,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACtD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QAC9D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QACtH,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polardbx/pxbaas",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.9",
|
|
4
4
|
"description": "PolarDB-X BaaS CLI application",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"polardbx",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"inquirer": "^9.2.0",
|
|
36
36
|
"jsonwebtoken": "^9.0.0",
|
|
37
37
|
"keytar": "^7.9.0",
|
|
38
|
-
"@polardbx/pxbaas-client": "0.1.0-beta.
|
|
38
|
+
"@polardbx/pxbaas-client": "0.1.0-beta.9"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/inquirer": "^9.0.0",
|
|
@@ -178,6 +178,6 @@ For provisioning / multi-instance selection see **provision.md**; for the `pxbaa
|
|
|
178
178
|
## Installing / updating these skills
|
|
179
179
|
|
|
180
180
|
The CLI ships **two** bundled skills — `pxbaas-cli` (this one) and `pxbaas-app-spec` (webapp authoring) — installable into Agent hosts (offline, no login):
|
|
181
|
-
`pxbaas skill install --host <qoder|claude|cursor|qwen|hermes>` (or `--all`) installs **all** bundled skills; `--skill <name>` installs just one. Also `pxbaas skill list` and `pxbaas skill remove
|
|
181
|
+
`pxbaas skill install --host <qoder|claude|cursor|qwen|hermes|codex|gemini|copilot|qwenworkcn|agents>` (or `--all`, which skips the neutral `agents` location) installs **all** bundled skills; `--skill <name>` installs just one. `--scope project` writes repository-level conventions instead (`.agents/skills`, `.gemini/skills`, `.github/skills`, `.claude/skills`, `.qwen/skills`, `.trae/skills`, `.codebuddy/skills`, `.cline/skills`), so skills travel with the code; with `--agents-md` it also maintains a managed pointer block in AGENTS.md for agents without a SKILL.md convention. Also `pxbaas skill list` and `pxbaas skill remove` (two-phase). These are setup/meta commands, not part of the data-plane surface above.
|
|
182
182
|
|
|
183
183
|
> The command surface above is derived from the actual source (`apps/baas/src`). When commands change, update this skill and the references accordingly.
|