@webpresso/agent-kit 0.21.5 → 0.24.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +87 -124
- package/bin/_run.js +143 -1
- package/bin/runtime-manifest.json +40 -0
- package/catalog/AGENTS.md.tpl +7 -6
- package/catalog/agent/commands/plan-refine.md +3 -3
- package/catalog/agent/commands/pll.md +2 -0
- package/catalog/agent/guides/parallel-execution.md +2 -0
- package/catalog/agent/rules/extraction-parity.md +27 -1
- package/catalog/agent/rules/public-package-safety.md +24 -1
- package/catalog/agent/skills/pll/SKILL.md +1 -0
- package/catalog/base-kit/.github/workflows/ci.webpresso.yml.tmpl +33 -0
- package/catalog/base-kit/stryker.config.ts.tmpl +2 -2
- package/catalog/docs/templates/blueprint.md +1 -0
- package/catalog/docs/templates/blueprint.yaml +10 -12
- package/commands/blueprint.md +8 -43
- package/dist/esm/audit/blueprint-db-consistency.d.ts +1 -1
- package/dist/esm/audit/blueprint-db-consistency.js +6 -8
- package/dist/esm/audit/blueprint-lifecycle-sql.js +10 -3
- package/dist/esm/audit/cloudflare-deploy-contract.d.ts +3 -0
- package/dist/esm/audit/cloudflare-deploy-contract.js +80 -0
- package/dist/esm/audit/no-legacy-cli-bin.d.ts +3 -0
- package/dist/esm/audit/no-legacy-cli-bin.js +100 -0
- package/dist/esm/audit/package-surface.js +14 -1
- package/dist/esm/audit/repo-guardrails.js +40 -13
- package/dist/esm/audit/roadmap-links.js +23 -10
- package/dist/esm/blueprint/core/schema.d.ts +8 -8
- package/dist/esm/blueprint/core/schema.js +2 -2
- package/dist/esm/blueprint/db/enums.d.ts +1 -1
- package/dist/esm/blueprint/db/ingester.js +18 -10
- package/dist/esm/blueprint/lifecycle/audit.js +9 -2
- package/dist/esm/blueprint/lifecycle/local.js +15 -4
- package/dist/esm/blueprint/service/BlueprintCreationService.js +11 -6
- package/dist/esm/blueprint/service/BlueprintService.js +37 -19
- package/dist/esm/blueprint/service/scanner.js +73 -9
- package/dist/esm/blueprint/tracked-document/schema.d.ts +2 -2
- package/dist/esm/blueprint/utils/document-paths.d.ts +23 -0
- package/dist/esm/blueprint/utils/document-paths.js +91 -0
- package/dist/esm/build/package-manifest.js +7 -0
- package/dist/esm/build/release-policy.d.ts +27 -0
- package/dist/esm/build/release-policy.js +29 -0
- package/dist/esm/build/runtime-targets.d.ts +13 -0
- package/dist/esm/build/runtime-targets.js +48 -0
- package/dist/esm/cli/auto-update/detect-pm.d.ts +15 -0
- package/dist/esm/cli/auto-update/detect-pm.js +24 -9
- package/dist/esm/cli/auto-update/skip.js +9 -1
- package/dist/esm/cli/bundle/agent-command-inventory.d.ts +120 -0
- package/dist/esm/cli/bundle/agent-command-inventory.js +100 -0
- package/dist/esm/cli/bundle/index.d.ts +17 -0
- package/dist/esm/cli/bundle/index.js +15 -0
- package/dist/esm/cli/cli.d.ts +1 -1
- package/dist/esm/cli/cli.js +49 -5
- package/dist/esm/cli/commands/audit-core.d.ts +1 -1
- package/dist/esm/cli/commands/audit.js +2 -0
- package/dist/esm/cli/commands/blueprint/router.js +11 -8
- package/dist/esm/cli/commands/hook.d.ts +8 -0
- package/dist/esm/cli/commands/hook.js +47 -0
- package/dist/esm/cli/commands/init/index.js +35 -1
- package/dist/esm/cli/commands/init/scaffold-base-kit.js +1 -1
- package/dist/esm/cli/commands/init/scaffolders/agent-hooks/codex-ownership.js +9 -1
- package/dist/esm/cli/commands/init/scaffolders/agent-hooks/index.js +130 -20
- package/dist/esm/cli/commands/init/scaffolders/agent-kit-global/index.d.ts +65 -0
- package/dist/esm/cli/commands/init/scaffolders/agent-kit-global/index.js +64 -0
- package/dist/esm/cli/commands/package-manager.d.ts +15 -0
- package/dist/esm/cli/commands/package-manager.js +42 -0
- package/dist/esm/cli/commands/test.d.ts +1 -0
- package/dist/esm/cli/commands/test.js +2 -1
- package/dist/esm/cli/commands/typecheck.js +5 -20
- package/dist/esm/cli/package-scripts.d.ts +12 -0
- package/dist/esm/cli/package-scripts.js +59 -0
- package/dist/esm/cli/utils.js +3 -22
- package/dist/esm/cli/wp-extensions.d.ts +14 -0
- package/dist/esm/cli/wp-extensions.js +34 -0
- package/dist/esm/config/docs-lint/schemas/common.d.ts +1 -1
- package/dist/esm/config/docs-lint/schemas/implementation-plan.d.ts +2 -2
- package/dist/esm/config/docs-lint/schemas/parent-roadmap.d.ts +1 -1
- package/dist/esm/config/stryker/index.d.ts +85 -0
- package/dist/esm/config/stryker/index.js +31 -0
- package/dist/esm/e2e/command-builder.js +11 -2
- package/dist/esm/e2e/config.d.ts +65 -0
- package/dist/esm/e2e/config.js +126 -0
- package/dist/esm/e2e/execution.js +4 -0
- package/dist/esm/e2e/load-host-adapter.d.ts +6 -1
- package/dist/esm/e2e/load-host-adapter.js +27 -9
- package/dist/esm/e2e/run-planner.js +1 -0
- package/dist/esm/e2e/types.d.ts +2 -0
- package/dist/esm/format/index.js +1 -3
- package/dist/esm/hooks/guard-switch/index.d.ts +1 -1
- package/dist/esm/hooks/guard-switch/index.js +22 -14
- package/dist/esm/hooks/post-tool/lint-after-edit.d.ts +1 -0
- package/dist/esm/hooks/post-tool/lint-after-edit.js +5 -2
- package/dist/esm/hooks/pretool-guard/validators/file-conventions.js +1 -1
- package/dist/esm/hooks/pretool-guard/validators/forbidden-commands.d.ts +6 -0
- package/dist/esm/hooks/pretool-guard/validators/forbidden-commands.js +27 -2
- package/dist/esm/hooks/pretool-guard/validators/path-contract.d.ts +2 -1
- package/dist/esm/hooks/pretool-guard/validators/path-contract.js +59 -34
- package/dist/esm/hooks/pretool-guard/validators/plan-frontmatter.js +3 -3
- package/dist/esm/hooks/shared/routing-block.js +18 -4
- package/dist/esm/hooks/shared/validators/blueprint.js +3 -0
- package/dist/esm/hooks/stop/qa-changed-files.d.ts +1 -0
- package/dist/esm/hooks/stop/qa-changed-files.js +5 -2
- package/dist/esm/lint/index.js +1 -1
- package/dist/esm/mcp/auto-discover.d.ts +2 -0
- package/dist/esm/mcp/auto-discover.js +14 -6
- package/dist/esm/mcp/blueprint-server.js +30 -26
- package/dist/esm/mcp/cli.js +21 -0
- package/dist/esm/mcp/runners/test.js +15 -0
- package/dist/esm/mcp/server.d.ts +7 -0
- package/dist/esm/mcp/server.js +16 -27
- package/dist/esm/mcp/tools/_registry.d.ts +3 -0
- package/dist/esm/mcp/tools/_registry.js +21 -0
- package/dist/esm/mcp/tools/audit.d.ts +1 -0
- package/dist/esm/mcp/tools/audit.js +11 -0
- package/dist/esm/mcp/tools/e2e.d.ts +1 -1
- package/dist/esm/mcp/tools/typecheck.js +4 -2
- package/dist/esm/mutation/affected.d.ts +9 -0
- package/dist/esm/mutation/affected.js +36 -0
- package/dist/esm/package.json +5 -0
- package/dist/esm/runtime/package-version.d.ts +2 -0
- package/dist/esm/runtime/package-version.js +43 -0
- package/dist/esm/test/command-builder.d.ts +3 -0
- package/dist/esm/test/command-builder.js +22 -3
- package/dist/esm/tool-runtime/index.d.ts +2 -2
- package/dist/esm/tool-runtime/index.js +2 -1
- package/dist/esm/tool-runtime/resolve-runner.d.ts +3 -0
- package/dist/esm/tool-runtime/resolve-runner.js +7 -5
- package/dist/esm/typecheck/index.js +4 -2
- package/dist/esm/wp-extension/index.d.ts +50 -0
- package/dist/esm/wp-extension/index.js +268 -0
- package/package.json +67 -31
- package/skills/pll/SKILL.md +1 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
export const BLUEPRINT_OVERVIEW_FILENAME = '_overview.md';
|
|
3
|
+
export const BLUEPRINT_STATUSES = [
|
|
4
|
+
'draft',
|
|
5
|
+
'planned',
|
|
6
|
+
'parked',
|
|
7
|
+
'in-progress',
|
|
8
|
+
'completed',
|
|
9
|
+
'archived',
|
|
10
|
+
];
|
|
11
|
+
const BLUEPRINT_STATUS_SET = new Set(BLUEPRINT_STATUSES);
|
|
12
|
+
const BLUEPRINT_SLUG_SEGMENT_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
13
|
+
export function normalizeBlueprintPath(filePath) {
|
|
14
|
+
return filePath.replace(/\\/g, '/').replace(/^\/+/, '');
|
|
15
|
+
}
|
|
16
|
+
export function isBlueprintStatus(value) {
|
|
17
|
+
return value !== undefined && BLUEPRINT_STATUS_SET.has(value);
|
|
18
|
+
}
|
|
19
|
+
export function isBlueprintSlugSegment(value) {
|
|
20
|
+
return value !== undefined && BLUEPRINT_SLUG_SEGMENT_PATTERN.test(value);
|
|
21
|
+
}
|
|
22
|
+
export function parseBlueprintDocumentRelativePath(filePath) {
|
|
23
|
+
const normalized = normalizeBlueprintPath(filePath);
|
|
24
|
+
const parts = normalized.split('/').filter((segment) => segment.length > 0);
|
|
25
|
+
const [state, second, third] = parts;
|
|
26
|
+
if (!isBlueprintStatus(state)) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
if (parts.length === 2 && typeof second === 'string' && second.endsWith('.md')) {
|
|
30
|
+
const slug = second.slice(0, -3);
|
|
31
|
+
if (!isBlueprintSlugSegment(slug)) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
relativePath: `${state}/${slug}.md`,
|
|
36
|
+
shape: 'flat',
|
|
37
|
+
slug,
|
|
38
|
+
state,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (parts.length === 3 &&
|
|
42
|
+
isBlueprintSlugSegment(second) &&
|
|
43
|
+
third === BLUEPRINT_OVERVIEW_FILENAME) {
|
|
44
|
+
return {
|
|
45
|
+
relativePath: `${state}/${second}/${BLUEPRINT_OVERVIEW_FILENAME}`,
|
|
46
|
+
shape: 'folder',
|
|
47
|
+
slug: second,
|
|
48
|
+
state,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
export function isBlueprintSupportingMarkdownRelativePath(filePath) {
|
|
54
|
+
const normalized = normalizeBlueprintPath(filePath);
|
|
55
|
+
const parts = normalized.split('/').filter((segment) => segment.length > 0);
|
|
56
|
+
const [state, slug, doc] = parts;
|
|
57
|
+
return (parts.length === 3 &&
|
|
58
|
+
isBlueprintStatus(state) &&
|
|
59
|
+
isBlueprintSlugSegment(slug) &&
|
|
60
|
+
typeof doc === 'string' &&
|
|
61
|
+
doc.endsWith('.md') &&
|
|
62
|
+
doc !== BLUEPRINT_OVERVIEW_FILENAME);
|
|
63
|
+
}
|
|
64
|
+
export function getBlueprintDocumentPaths(root, state, slug) {
|
|
65
|
+
const directory = path.join(root, state, slug);
|
|
66
|
+
return {
|
|
67
|
+
directory,
|
|
68
|
+
flat: path.join(root, state, `${slug}.md`),
|
|
69
|
+
folder: path.join(directory, BLUEPRINT_OVERVIEW_FILENAME),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export function getBlueprintDocumentCandidates(root, slug) {
|
|
73
|
+
const normalized = normalizeBlueprintPath(slug);
|
|
74
|
+
const segments = normalized.split('/').filter((segment) => segment.length > 0);
|
|
75
|
+
const [state, name] = segments;
|
|
76
|
+
if (segments.length !== 2 || !isBlueprintStatus(state) || !isBlueprintSlugSegment(name)) {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
const { flat, folder } = getBlueprintDocumentPaths(root, state, name);
|
|
80
|
+
return [flat, folder];
|
|
81
|
+
}
|
|
82
|
+
export function getBlueprintAlternateDocumentPath(root, filePath) {
|
|
83
|
+
const normalized = normalizeBlueprintPath(path.relative(root, filePath));
|
|
84
|
+
const parsed = parseBlueprintDocumentRelativePath(normalized);
|
|
85
|
+
if (!parsed) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
const paths = getBlueprintDocumentPaths(root, parsed.state, parsed.slug);
|
|
89
|
+
return parsed.shape === 'flat' ? paths.folder : paths.flat;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=document-paths.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync, } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { parse as parseYaml } from 'yaml';
|
|
4
|
+
import { RUNTIME_TARGETS } from './runtime-targets.js';
|
|
4
5
|
const DEPENDENCY_SECTIONS = [
|
|
5
6
|
'dependencies',
|
|
6
7
|
'devDependencies',
|
|
@@ -74,6 +75,12 @@ export function createPackedManifest(manifest, workspaceCatalogs) {
|
|
|
74
75
|
if ('bin' in packedManifest) {
|
|
75
76
|
packedManifest.bin = normalizePackedBinField(packedManifest.bin);
|
|
76
77
|
}
|
|
78
|
+
if (typeof manifest.version === 'string') {
|
|
79
|
+
packedManifest.optionalDependencies = {
|
|
80
|
+
...packedManifest.optionalDependencies,
|
|
81
|
+
...Object.fromEntries(RUNTIME_TARGETS.map((target) => [target.packageName, manifest.version])),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
77
84
|
return packedManifest;
|
|
78
85
|
}
|
|
79
86
|
function writeJson(filePath, value) {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release-time policy decisions for the publish pipeline.
|
|
3
|
+
*
|
|
4
|
+
* The per-platform native runtime packages (`@webpresso/agent-kit-runtime-*`)
|
|
5
|
+
* are a deferred capability: they are not yet created on the registry, the main
|
|
6
|
+
* package declares no `optionalDependencies` on them, and the plugin manifest
|
|
7
|
+
* still launches via the node entrypoint rather than a staged native `bin/wp`.
|
|
8
|
+
*
|
|
9
|
+
* Until that native-distribution work is intentionally activated, the release
|
|
10
|
+
* MUST NOT attempt to publish the matrix: a first-time `npm publish` of a
|
|
11
|
+
* never-created scoped package returns 404, which previously aborted the entire
|
|
12
|
+
* release before the main `@webpresso/agent-kit` package published (the root
|
|
13
|
+
* cause of the 0.22.x publish stall).
|
|
14
|
+
*
|
|
15
|
+
* The matrix publish is therefore gated behind an explicit opt-in. When the
|
|
16
|
+
* native-distribution feature lands, the release workflow sets
|
|
17
|
+
* `WP_PUBLISH_RUNTIME_MATRIX=1` (after bootstrapping the scoped packages on the
|
|
18
|
+
* registry) to turn it back on.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PUBLISH_RUNTIME_MATRIX_ENV = "WP_PUBLISH_RUNTIME_MATRIX";
|
|
21
|
+
/**
|
|
22
|
+
* Whether the release pipeline should build, stage, and publish the per-platform
|
|
23
|
+
* native runtime matrix. Defaults to `false` (matrix deferred); enabled only
|
|
24
|
+
* when `WP_PUBLISH_RUNTIME_MATRIX=1` is set explicitly.
|
|
25
|
+
*/
|
|
26
|
+
export declare function shouldPublishRuntimeMatrix(env: NodeJS.ProcessEnv): boolean;
|
|
27
|
+
//# sourceMappingURL=release-policy.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release-time policy decisions for the publish pipeline.
|
|
3
|
+
*
|
|
4
|
+
* The per-platform native runtime packages (`@webpresso/agent-kit-runtime-*`)
|
|
5
|
+
* are a deferred capability: they are not yet created on the registry, the main
|
|
6
|
+
* package declares no `optionalDependencies` on them, and the plugin manifest
|
|
7
|
+
* still launches via the node entrypoint rather than a staged native `bin/wp`.
|
|
8
|
+
*
|
|
9
|
+
* Until that native-distribution work is intentionally activated, the release
|
|
10
|
+
* MUST NOT attempt to publish the matrix: a first-time `npm publish` of a
|
|
11
|
+
* never-created scoped package returns 404, which previously aborted the entire
|
|
12
|
+
* release before the main `@webpresso/agent-kit` package published (the root
|
|
13
|
+
* cause of the 0.22.x publish stall).
|
|
14
|
+
*
|
|
15
|
+
* The matrix publish is therefore gated behind an explicit opt-in. When the
|
|
16
|
+
* native-distribution feature lands, the release workflow sets
|
|
17
|
+
* `WP_PUBLISH_RUNTIME_MATRIX=1` (after bootstrapping the scoped packages on the
|
|
18
|
+
* registry) to turn it back on.
|
|
19
|
+
*/
|
|
20
|
+
export const PUBLISH_RUNTIME_MATRIX_ENV = 'WP_PUBLISH_RUNTIME_MATRIX';
|
|
21
|
+
/**
|
|
22
|
+
* Whether the release pipeline should build, stage, and publish the per-platform
|
|
23
|
+
* native runtime matrix. Defaults to `false` (matrix deferred); enabled only
|
|
24
|
+
* when `WP_PUBLISH_RUNTIME_MATRIX=1` is set explicitly.
|
|
25
|
+
*/
|
|
26
|
+
export function shouldPublishRuntimeMatrix(env) {
|
|
27
|
+
return env[PUBLISH_RUNTIME_MATRIX_ENV] === '1';
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=release-policy.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface RuntimeTarget {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly bunTarget: string;
|
|
4
|
+
readonly os: NodeJS.Platform;
|
|
5
|
+
readonly cpu: NodeJS.Architecture;
|
|
6
|
+
readonly packageName: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const RUNTIME_BINARY_NAME = "wp";
|
|
9
|
+
export declare const RUNTIME_TARGETS: readonly RuntimeTarget[];
|
|
10
|
+
export declare function runtimeBinaryFilename(target: RuntimeTarget): string;
|
|
11
|
+
export declare function runtimePackageDirName(packageName: string): string;
|
|
12
|
+
export declare function resolveRuntimeTarget(platform?: NodeJS.Platform, arch?: NodeJS.Architecture): RuntimeTarget | undefined;
|
|
13
|
+
//# sourceMappingURL=runtime-targets.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const RUNTIME_BINARY_NAME = 'wp';
|
|
2
|
+
export const RUNTIME_TARGETS = [
|
|
3
|
+
{
|
|
4
|
+
id: 'darwin-arm64',
|
|
5
|
+
bunTarget: 'bun-darwin-arm64',
|
|
6
|
+
os: 'darwin',
|
|
7
|
+
cpu: 'arm64',
|
|
8
|
+
packageName: '@webpresso/agent-kit-runtime-darwin-arm64',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: 'darwin-x64',
|
|
12
|
+
bunTarget: 'bun-darwin-x64',
|
|
13
|
+
os: 'darwin',
|
|
14
|
+
cpu: 'x64',
|
|
15
|
+
packageName: '@webpresso/agent-kit-runtime-darwin-x64',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: 'linux-x64',
|
|
19
|
+
bunTarget: 'bun-linux-x64',
|
|
20
|
+
os: 'linux',
|
|
21
|
+
cpu: 'x64',
|
|
22
|
+
packageName: '@webpresso/agent-kit-runtime-linux-x64',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 'linux-arm64',
|
|
26
|
+
bunTarget: 'bun-linux-arm64',
|
|
27
|
+
os: 'linux',
|
|
28
|
+
cpu: 'arm64',
|
|
29
|
+
packageName: '@webpresso/agent-kit-runtime-linux-arm64',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'windows-x64',
|
|
33
|
+
bunTarget: 'bun-windows-x64',
|
|
34
|
+
os: 'win32',
|
|
35
|
+
cpu: 'x64',
|
|
36
|
+
packageName: '@webpresso/agent-kit-runtime-windows-x64',
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
export function runtimeBinaryFilename(target) {
|
|
40
|
+
return target.os === 'win32' ? `${RUNTIME_BINARY_NAME}.exe` : RUNTIME_BINARY_NAME;
|
|
41
|
+
}
|
|
42
|
+
export function runtimePackageDirName(packageName) {
|
|
43
|
+
return packageName.split('/').at(-1) ?? packageName;
|
|
44
|
+
}
|
|
45
|
+
export function resolveRuntimeTarget(platform = process.platform, arch = process.arch) {
|
|
46
|
+
return RUNTIME_TARGETS.find((target) => target.os === platform && target.cpu === arch);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=runtime-targets.js.map
|
|
@@ -28,6 +28,21 @@ export interface DetectAbort {
|
|
|
28
28
|
export type DetectResult = DetectSuccess | DetectAbort;
|
|
29
29
|
export declare const PUBLIC_PACKAGE_NAME = "@webpresso/agent-kit";
|
|
30
30
|
export declare const PUBLIC_NPM_REGISTRY = "https://registry.npmjs.org";
|
|
31
|
+
/**
|
|
32
|
+
* Canonical global-install command for the public agent-kit.
|
|
33
|
+
*
|
|
34
|
+
* No `--registry` flag: npmjs.org is already the default registry, and a global
|
|
35
|
+
* `--registry` does NOT override a scoped `@webpresso:registry` mapping
|
|
36
|
+
* (npm/pnpm resolve the scope first). The flag was therefore redundant when no
|
|
37
|
+
* scope override exists and ineffective when one does. To force-public inside a
|
|
38
|
+
* repo that scopes `@webpresso` to a private registry, use the scoped form
|
|
39
|
+
* `--@webpresso:registry=${PUBLIC_NPM_REGISTRY}` instead.
|
|
40
|
+
*
|
|
41
|
+
* Exported so the `wp setup` self-update scaffolder reuses the exact same
|
|
42
|
+
* command (single source of truth — see `ensureAgentKitGlobal`).
|
|
43
|
+
*/
|
|
44
|
+
export declare function buildVpGlobalInstallCommand(): [string, ...string[]];
|
|
45
|
+
export declare function formatLegacyCommandReplacementMessage(legacyCommand: string): string | null;
|
|
31
46
|
/**
|
|
32
47
|
* Detect whether argv1 is a symlink pointing into a supported source clone.
|
|
33
48
|
* Returns the git worktree root if so, null otherwise.
|
|
@@ -20,17 +20,26 @@
|
|
|
20
20
|
import { execFileSync } from 'node:child_process';
|
|
21
21
|
import { realpathSync } from 'node:fs';
|
|
22
22
|
import { delimiter, dirname, sep } from 'node:path';
|
|
23
|
+
import { getLegacyAgentCommandReplacement } from '#cli/bundle/agent-command-inventory.js';
|
|
23
24
|
export const PUBLIC_PACKAGE_NAME = '@webpresso/agent-kit';
|
|
24
25
|
export const PUBLIC_NPM_REGISTRY = 'https://registry.npmjs.org';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Canonical global-install command for the public agent-kit.
|
|
28
|
+
*
|
|
29
|
+
* No `--registry` flag: npmjs.org is already the default registry, and a global
|
|
30
|
+
* `--registry` does NOT override a scoped `@webpresso:registry` mapping
|
|
31
|
+
* (npm/pnpm resolve the scope first). The flag was therefore redundant when no
|
|
32
|
+
* scope override exists and ineffective when one does. To force-public inside a
|
|
33
|
+
* repo that scopes `@webpresso` to a private registry, use the scoped form
|
|
34
|
+
* `--@webpresso:registry=${PUBLIC_NPM_REGISTRY}` instead.
|
|
35
|
+
*
|
|
36
|
+
* Exported so the `wp setup` self-update scaffolder reuses the exact same
|
|
37
|
+
* command (single source of truth — see `ensureAgentKitGlobal`).
|
|
38
|
+
*/
|
|
39
|
+
export function buildVpGlobalInstallCommand() {
|
|
40
|
+
return ['vp', 'install', '-g', PUBLIC_PACKAGE_NAME];
|
|
41
|
+
}
|
|
42
|
+
const VP_INSTALL_COMMAND = buildVpGlobalInstallCommand();
|
|
34
43
|
const INSTALL_COMMANDS = {
|
|
35
44
|
npm: VP_INSTALL_COMMAND,
|
|
36
45
|
pnpm: VP_INSTALL_COMMAND,
|
|
@@ -38,6 +47,12 @@ const INSTALL_COMMANDS = {
|
|
|
38
47
|
bun: VP_INSTALL_COMMAND,
|
|
39
48
|
vp: VP_INSTALL_COMMAND,
|
|
40
49
|
};
|
|
50
|
+
export function formatLegacyCommandReplacementMessage(legacyCommand) {
|
|
51
|
+
const replacement = getLegacyAgentCommandReplacement(legacyCommand);
|
|
52
|
+
if (replacement === null)
|
|
53
|
+
return null;
|
|
54
|
+
return `Legacy agent-kit command \`${legacyCommand}\` has a future replacement: \`${replacement}\`.`;
|
|
55
|
+
}
|
|
41
56
|
/**
|
|
42
57
|
* Detect whether argv1 is a symlink pointing into a supported source clone.
|
|
43
58
|
* Returns the git worktree root if so, null otherwise.
|
|
@@ -37,7 +37,7 @@ export const CI_ENV_KEYS = [
|
|
|
37
37
|
'DRONE',
|
|
38
38
|
'JENKINS_URL',
|
|
39
39
|
];
|
|
40
|
-
const SKIP_SUBCOMMANDS = new Set(['mcp']);
|
|
40
|
+
const SKIP_SUBCOMMANDS = new Set(['mcp', 'hook']);
|
|
41
41
|
export function shouldSkipUpdateCheck(env, argv) {
|
|
42
42
|
if (hasInformationalFlag(argv))
|
|
43
43
|
return true;
|
|
@@ -45,6 +45,8 @@ export function shouldSkipUpdateCheck(env, argv) {
|
|
|
45
45
|
return true;
|
|
46
46
|
if (env.WP_SKIP_UPDATE_CHECK === '1')
|
|
47
47
|
return true;
|
|
48
|
+
if (isPackageLifecycleEnvironment(env))
|
|
49
|
+
return true;
|
|
48
50
|
if (isCiEnvironment(env))
|
|
49
51
|
return true;
|
|
50
52
|
return false;
|
|
@@ -81,4 +83,10 @@ function isCiEnvironment(env) {
|
|
|
81
83
|
}
|
|
82
84
|
return false;
|
|
83
85
|
}
|
|
86
|
+
function isPackageLifecycleEnvironment(env) {
|
|
87
|
+
const lifecycleEvent = env.npm_lifecycle_event;
|
|
88
|
+
const packageJsonPath = env.npm_package_json;
|
|
89
|
+
return Boolean((lifecycleEvent && lifecycleEvent.trim().length > 0) ||
|
|
90
|
+
(packageJsonPath && packageJsonPath.trim().length > 0));
|
|
91
|
+
}
|
|
84
92
|
//# sourceMappingURL=skip.js.map
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export type AgentCommandVisibility = 'public' | 'internal';
|
|
2
|
+
export interface LegacyAgentCommandAlias {
|
|
3
|
+
legacyCommand: string;
|
|
4
|
+
replacementCommand: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AgentCommandInventoryEntry {
|
|
7
|
+
id: string;
|
|
8
|
+
namespace: 'agent';
|
|
9
|
+
visibility: AgentCommandVisibility;
|
|
10
|
+
replacementCommand: string;
|
|
11
|
+
legacyAliases: readonly LegacyAgentCommandAlias[];
|
|
12
|
+
}
|
|
13
|
+
export declare const AGENT_COMMAND_INVENTORY: readonly [{
|
|
14
|
+
readonly id: "agent setup";
|
|
15
|
+
readonly namespace: "agent";
|
|
16
|
+
readonly visibility: "public";
|
|
17
|
+
readonly replacementCommand: "webpresso agent setup";
|
|
18
|
+
readonly legacyAliases: readonly [{
|
|
19
|
+
readonly legacyCommand: "wp setup";
|
|
20
|
+
readonly replacementCommand: "webpresso agent setup";
|
|
21
|
+
}, {
|
|
22
|
+
readonly legacyCommand: "wp init";
|
|
23
|
+
readonly replacementCommand: "webpresso agent setup";
|
|
24
|
+
}];
|
|
25
|
+
}, {
|
|
26
|
+
readonly id: "agent sync";
|
|
27
|
+
readonly namespace: "agent";
|
|
28
|
+
readonly visibility: "public";
|
|
29
|
+
readonly replacementCommand: "webpresso agent sync";
|
|
30
|
+
readonly legacyAliases: readonly [{
|
|
31
|
+
readonly legacyCommand: "wp sync";
|
|
32
|
+
readonly replacementCommand: "webpresso agent sync";
|
|
33
|
+
}];
|
|
34
|
+
}, {
|
|
35
|
+
readonly id: "agent audit";
|
|
36
|
+
readonly namespace: "agent";
|
|
37
|
+
readonly visibility: "public";
|
|
38
|
+
readonly replacementCommand: "webpresso agent audit";
|
|
39
|
+
readonly legacyAliases: readonly [{
|
|
40
|
+
readonly legacyCommand: "wp audit";
|
|
41
|
+
readonly replacementCommand: "webpresso agent audit";
|
|
42
|
+
}];
|
|
43
|
+
}, {
|
|
44
|
+
readonly id: "agent skills";
|
|
45
|
+
readonly namespace: "agent";
|
|
46
|
+
readonly visibility: "public";
|
|
47
|
+
readonly replacementCommand: "webpresso agent skills";
|
|
48
|
+
readonly legacyAliases: readonly [{
|
|
49
|
+
readonly legacyCommand: "wp skill";
|
|
50
|
+
readonly replacementCommand: "webpresso agent skills";
|
|
51
|
+
}, {
|
|
52
|
+
readonly legacyCommand: "wp skills";
|
|
53
|
+
readonly replacementCommand: "webpresso agent skills";
|
|
54
|
+
}];
|
|
55
|
+
}, {
|
|
56
|
+
readonly id: "agent docs lint";
|
|
57
|
+
readonly namespace: "agent";
|
|
58
|
+
readonly visibility: "public";
|
|
59
|
+
readonly replacementCommand: "webpresso agent docs lint";
|
|
60
|
+
readonly legacyAliases: readonly [{
|
|
61
|
+
readonly legacyCommand: "wp docs";
|
|
62
|
+
readonly replacementCommand: "webpresso agent docs lint";
|
|
63
|
+
}, {
|
|
64
|
+
readonly legacyCommand: "wp docs lint";
|
|
65
|
+
readonly replacementCommand: "webpresso agent docs lint";
|
|
66
|
+
}];
|
|
67
|
+
}, {
|
|
68
|
+
readonly id: "agent hooks doctor";
|
|
69
|
+
readonly namespace: "agent";
|
|
70
|
+
readonly visibility: "public";
|
|
71
|
+
readonly replacementCommand: "webpresso agent hooks doctor";
|
|
72
|
+
readonly legacyAliases: readonly [{
|
|
73
|
+
readonly legacyCommand: "wp hooks";
|
|
74
|
+
readonly replacementCommand: "webpresso agent hooks doctor";
|
|
75
|
+
}, {
|
|
76
|
+
readonly legacyCommand: "wp hooks doctor";
|
|
77
|
+
readonly replacementCommand: "webpresso agent hooks doctor";
|
|
78
|
+
}, {
|
|
79
|
+
readonly legacyCommand: "wp doctor";
|
|
80
|
+
readonly replacementCommand: "webpresso agent hooks doctor";
|
|
81
|
+
}];
|
|
82
|
+
}, {
|
|
83
|
+
readonly id: "agent blueprint";
|
|
84
|
+
readonly namespace: "agent";
|
|
85
|
+
readonly visibility: "public";
|
|
86
|
+
readonly replacementCommand: "webpresso agent blueprint";
|
|
87
|
+
readonly legacyAliases: readonly [{
|
|
88
|
+
readonly legacyCommand: "wp blueprint";
|
|
89
|
+
readonly replacementCommand: "webpresso agent blueprint";
|
|
90
|
+
}];
|
|
91
|
+
}, {
|
|
92
|
+
readonly id: "agent test";
|
|
93
|
+
readonly namespace: "agent";
|
|
94
|
+
readonly visibility: "public";
|
|
95
|
+
readonly replacementCommand: "webpresso agent test";
|
|
96
|
+
readonly legacyAliases: readonly [{
|
|
97
|
+
readonly legacyCommand: "wp test";
|
|
98
|
+
readonly replacementCommand: "webpresso agent test";
|
|
99
|
+
}];
|
|
100
|
+
}, {
|
|
101
|
+
readonly id: "agent e2e";
|
|
102
|
+
readonly namespace: "agent";
|
|
103
|
+
readonly visibility: "public";
|
|
104
|
+
readonly replacementCommand: "webpresso agent e2e";
|
|
105
|
+
readonly legacyAliases: readonly [{
|
|
106
|
+
readonly legacyCommand: "wp e2e";
|
|
107
|
+
readonly replacementCommand: "webpresso agent e2e";
|
|
108
|
+
}];
|
|
109
|
+
}, {
|
|
110
|
+
readonly id: "agent tech-debt";
|
|
111
|
+
readonly namespace: "agent";
|
|
112
|
+
readonly visibility: "public";
|
|
113
|
+
readonly replacementCommand: "webpresso agent tech-debt";
|
|
114
|
+
readonly legacyAliases: readonly [{
|
|
115
|
+
readonly legacyCommand: "wp tech-debt";
|
|
116
|
+
readonly replacementCommand: "webpresso agent tech-debt";
|
|
117
|
+
}];
|
|
118
|
+
}];
|
|
119
|
+
export declare function getLegacyAgentCommandReplacement(legacyCommand: string): string | null;
|
|
120
|
+
//# sourceMappingURL=agent-command-inventory.d.ts.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export const AGENT_COMMAND_INVENTORY = [
|
|
2
|
+
{
|
|
3
|
+
id: 'agent setup',
|
|
4
|
+
namespace: 'agent',
|
|
5
|
+
visibility: 'public',
|
|
6
|
+
replacementCommand: 'webpresso agent setup',
|
|
7
|
+
legacyAliases: [
|
|
8
|
+
{ legacyCommand: 'wp setup', replacementCommand: 'webpresso agent setup' },
|
|
9
|
+
{ legacyCommand: 'wp init', replacementCommand: 'webpresso agent setup' },
|
|
10
|
+
],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 'agent sync',
|
|
14
|
+
namespace: 'agent',
|
|
15
|
+
visibility: 'public',
|
|
16
|
+
replacementCommand: 'webpresso agent sync',
|
|
17
|
+
legacyAliases: [{ legacyCommand: 'wp sync', replacementCommand: 'webpresso agent sync' }],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'agent audit',
|
|
21
|
+
namespace: 'agent',
|
|
22
|
+
visibility: 'public',
|
|
23
|
+
replacementCommand: 'webpresso agent audit',
|
|
24
|
+
legacyAliases: [{ legacyCommand: 'wp audit', replacementCommand: 'webpresso agent audit' }],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'agent skills',
|
|
28
|
+
namespace: 'agent',
|
|
29
|
+
visibility: 'public',
|
|
30
|
+
replacementCommand: 'webpresso agent skills',
|
|
31
|
+
legacyAliases: [
|
|
32
|
+
{ legacyCommand: 'wp skill', replacementCommand: 'webpresso agent skills' },
|
|
33
|
+
{ legacyCommand: 'wp skills', replacementCommand: 'webpresso agent skills' },
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'agent docs lint',
|
|
38
|
+
namespace: 'agent',
|
|
39
|
+
visibility: 'public',
|
|
40
|
+
replacementCommand: 'webpresso agent docs lint',
|
|
41
|
+
legacyAliases: [
|
|
42
|
+
{ legacyCommand: 'wp docs', replacementCommand: 'webpresso agent docs lint' },
|
|
43
|
+
{ legacyCommand: 'wp docs lint', replacementCommand: 'webpresso agent docs lint' },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: 'agent hooks doctor',
|
|
48
|
+
namespace: 'agent',
|
|
49
|
+
visibility: 'public',
|
|
50
|
+
replacementCommand: 'webpresso agent hooks doctor',
|
|
51
|
+
legacyAliases: [
|
|
52
|
+
{ legacyCommand: 'wp hooks', replacementCommand: 'webpresso agent hooks doctor' },
|
|
53
|
+
{ legacyCommand: 'wp hooks doctor', replacementCommand: 'webpresso agent hooks doctor' },
|
|
54
|
+
{ legacyCommand: 'wp doctor', replacementCommand: 'webpresso agent hooks doctor' },
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'agent blueprint',
|
|
59
|
+
namespace: 'agent',
|
|
60
|
+
visibility: 'public',
|
|
61
|
+
replacementCommand: 'webpresso agent blueprint',
|
|
62
|
+
legacyAliases: [
|
|
63
|
+
{ legacyCommand: 'wp blueprint', replacementCommand: 'webpresso agent blueprint' },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'agent test',
|
|
68
|
+
namespace: 'agent',
|
|
69
|
+
visibility: 'public',
|
|
70
|
+
replacementCommand: 'webpresso agent test',
|
|
71
|
+
legacyAliases: [{ legacyCommand: 'wp test', replacementCommand: 'webpresso agent test' }],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'agent e2e',
|
|
75
|
+
namespace: 'agent',
|
|
76
|
+
visibility: 'public',
|
|
77
|
+
replacementCommand: 'webpresso agent e2e',
|
|
78
|
+
legacyAliases: [{ legacyCommand: 'wp e2e', replacementCommand: 'webpresso agent e2e' }],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'agent tech-debt',
|
|
82
|
+
namespace: 'agent',
|
|
83
|
+
visibility: 'public',
|
|
84
|
+
replacementCommand: 'webpresso agent tech-debt',
|
|
85
|
+
legacyAliases: [
|
|
86
|
+
{ legacyCommand: 'wp tech-debt', replacementCommand: 'webpresso agent tech-debt' },
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
];
|
|
90
|
+
export function getLegacyAgentCommandReplacement(legacyCommand) {
|
|
91
|
+
const normalized = legacyCommand.trim().replace(/\s+/gu, ' ').toLowerCase();
|
|
92
|
+
for (const entry of AGENT_COMMAND_INVENTORY) {
|
|
93
|
+
for (const alias of entry.legacyAliases) {
|
|
94
|
+
if (alias.legacyCommand.toLowerCase() === normalized)
|
|
95
|
+
return alias.replacementCommand;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=agent-command-inventory.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type AgentCommandInventoryEntry } from '#cli/bundle/agent-command-inventory.js';
|
|
2
|
+
export interface AgentBundleCommandDefinition {
|
|
3
|
+
readonly id: AgentCommandInventoryEntry['id'];
|
|
4
|
+
readonly namespace: AgentCommandInventoryEntry['namespace'];
|
|
5
|
+
readonly visibility: AgentCommandInventoryEntry['visibility'];
|
|
6
|
+
readonly replacementCommand: AgentCommandInventoryEntry['replacementCommand'];
|
|
7
|
+
readonly legacyAliases: AgentCommandInventoryEntry['legacyAliases'];
|
|
8
|
+
}
|
|
9
|
+
export interface AgentBundleDefinition {
|
|
10
|
+
readonly bundleId: 'agent-kit';
|
|
11
|
+
readonly commandRoot: 'agent';
|
|
12
|
+
readonly sourcePackage: '@webpresso/agent-kit';
|
|
13
|
+
readonly intendedHostPackage: '@repo/cli';
|
|
14
|
+
readonly commands: readonly AgentBundleCommandDefinition[];
|
|
15
|
+
}
|
|
16
|
+
export declare const AGENT_BUNDLE: AgentBundleDefinition;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AGENT_COMMAND_INVENTORY, } from '#cli/bundle/agent-command-inventory.js';
|
|
2
|
+
export const AGENT_BUNDLE = {
|
|
3
|
+
bundleId: 'agent-kit',
|
|
4
|
+
commandRoot: 'agent',
|
|
5
|
+
sourcePackage: '@webpresso/agent-kit',
|
|
6
|
+
intendedHostPackage: '@repo/cli',
|
|
7
|
+
commands: AGENT_COMMAND_INVENTORY.map((entry) => ({
|
|
8
|
+
id: entry.id,
|
|
9
|
+
namespace: entry.namespace,
|
|
10
|
+
visibility: entry.visibility,
|
|
11
|
+
replacementCommand: entry.replacementCommand,
|
|
12
|
+
legacyAliases: entry.legacyAliases,
|
|
13
|
+
})),
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
package/dist/esm/cli/cli.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Lazy-loads subcommand modules based on the first argv to keep startup
|
|
6
6
|
* cheap. Modeled on apps/cli-wp/src/cli.ts.
|
|
7
7
|
*/
|
|
8
|
-
declare const SUPPORTED_COMMANDS: readonly ["blueprint", "config", "roadmap", "sync", "audit", "compile", "rule", "skill", "skills", "docs", "setup", "init", "dev", "doctor", "err", "test", "e2e", "ci", "typecheck", "lint", "format", "tech-debt", "worktree", "mcp", "hooks", "gain", "bench"];
|
|
8
|
+
declare const SUPPORTED_COMMANDS: readonly ["blueprint", "config", "roadmap", "sync", "audit", "compile", "rule", "skill", "skills", "docs", "setup", "init", "dev", "doctor", "err", "test", "e2e", "ci", "typecheck", "lint", "format", "tech-debt", "worktree", "mcp", "hook", "hooks", "gain", "bench", "install", "add", "remove", "update", "exec", "run"];
|
|
9
9
|
export { SUPPORTED_COMMANDS };
|
|
10
10
|
export declare function main(): Promise<number>;
|
|
11
11
|
//# sourceMappingURL=cli.d.ts.map
|