@webpresso/agent-kit 0.21.4 → 0.21.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/README.md +105 -41
  3. package/catalog/agent/skills/plan-refine/SKILL.md +5 -4
  4. package/catalog/base-kit/commitlint.config.ts.tmpl +1 -3
  5. package/catalog/base-kit/e2e/fixtures/smoke.html.tmpl +13 -0
  6. package/catalog/base-kit/e2e/smoke.spec.ts.tmpl +13 -0
  7. package/catalog/base-kit/oxlint.config.ts.tmpl +26 -0
  8. package/catalog/base-kit/playwright.config.ts.tmpl +10 -0
  9. package/catalog/base-kit/src/quality-sample.test.ts.tmpl +19 -0
  10. package/catalog/base-kit/src/quality-sample.ts.tmpl +11 -0
  11. package/catalog/base-kit/stryker.config.ts.tmpl +14 -0
  12. package/catalog/base-kit/tsconfig.json.tmpl +9 -0
  13. package/catalog/base-kit/vitest.config.ts.tmpl +10 -0
  14. package/catalog/docs/templates/adr.md +1 -1
  15. package/catalog/docs/templates/blueprint.md +1 -0
  16. package/catalog/docs/templates/blueprint.yaml +6 -3
  17. package/catalog/docs/templates/guide.md +1 -1
  18. package/catalog/docs/templates/postmortem.md +1 -1
  19. package/catalog/docs/templates/research.md +1 -1
  20. package/catalog/docs/templates/runbook.md +1 -1
  21. package/catalog/docs/templates/system.md +12 -3
  22. package/catalog/docs/templates/tech-debt.md +1 -0
  23. package/commands/blueprint.md +37 -4
  24. package/dist/esm/audit/resolve-audit-script.d.ts +24 -0
  25. package/dist/esm/audit/resolve-audit-script.js +27 -0
  26. package/dist/esm/blueprint/index.d.ts +0 -1
  27. package/dist/esm/blueprint/index.js +0 -2
  28. package/dist/esm/blueprint/local.d.ts +0 -3
  29. package/dist/esm/blueprint/local.js +0 -2
  30. package/dist/esm/blueprint/service/BlueprintCreationService.js +5 -2
  31. package/dist/esm/blueprint/utils/package-assets.d.ts +11 -0
  32. package/dist/esm/blueprint/utils/package-assets.js +33 -4
  33. package/dist/esm/build/sync-catalog-doc-templates.d.ts +23 -0
  34. package/dist/esm/build/sync-catalog-doc-templates.js +93 -0
  35. package/dist/esm/cli/commands/audit.js +2 -7
  36. package/dist/esm/cli/commands/blueprint/router.js +5 -2
  37. package/dist/esm/cli/commands/blueprint/template-resolver.js +8 -4
  38. package/dist/esm/cli/commands/init/host-visibility.js +4 -2
  39. package/dist/esm/cli/commands/init/index.js +46 -7
  40. package/dist/esm/cli/commands/init/scaffold-base-kit.d.ts +12 -0
  41. package/dist/esm/cli/commands/init/scaffold-base-kit.js +141 -6
  42. package/dist/esm/cli/commands/typecheck.js +10 -4
  43. package/dist/esm/e2e/command-builder.js +26 -7
  44. package/dist/esm/e2e/execution.js +4 -0
  45. package/dist/esm/e2e/run-planner.js +1 -0
  46. package/dist/esm/e2e/types.d.ts +1 -0
  47. package/dist/esm/format/index.js +7 -1
  48. package/dist/esm/lint/index.js +3 -1
  49. package/dist/esm/mcp/blueprint-server.js +361 -66
  50. package/dist/esm/mcp/tools/audit.js +2 -8
  51. package/dist/esm/mcp/tools/e2e.d.ts +1 -1
  52. package/dist/esm/package.json +3 -0
  53. package/dist/esm/test/command-builder.d.ts +1 -0
  54. package/dist/esm/test/command-builder.js +8 -2
  55. package/dist/esm/test-helpers/hermetic-env.d.ts +25 -0
  56. package/dist/esm/test-helpers/hermetic-env.js +31 -0
  57. package/dist/esm/tool-runtime/index.d.ts +5 -0
  58. package/dist/esm/tool-runtime/index.js +23 -0
  59. package/dist/esm/tool-runtime/resolve-runner.d.ts +13 -0
  60. package/dist/esm/tool-runtime/resolve-runner.js +40 -0
  61. package/package.json +12 -19
  62. package/skills/plan-refine/SKILL.md +5 -4
  63. package/dist/esm/blueprint/dag/cycle-detector.d.ts +0 -12
  64. package/dist/esm/blueprint/dag/cycle-detector.js +0 -46
  65. package/dist/esm/blueprint/dag/executor.d.ts +0 -140
  66. package/dist/esm/blueprint/dag/executor.js +0 -292
  67. package/dist/esm/blueprint/dag/index.d.ts +0 -20
  68. package/dist/esm/blueprint/dag/index.js +0 -17
  69. package/dist/esm/blueprint/dag/interfaces.d.ts +0 -56
  70. package/dist/esm/blueprint/dag/interfaces.js +0 -13
  71. package/dist/esm/blueprint/dag/local/independence.d.ts +0 -107
  72. package/dist/esm/blueprint/dag/local/independence.js +0 -231
  73. package/dist/esm/blueprint/dag/local/index.d.ts +0 -14
  74. package/dist/esm/blueprint/dag/local/index.js +0 -14
  75. package/dist/esm/blueprint/dag/local/package-graph.d.ts +0 -66
  76. package/dist/esm/blueprint/dag/local/package-graph.js +0 -148
  77. package/dist/esm/blueprint/dag/plan-parser.d.ts +0 -54
  78. package/dist/esm/blueprint/dag/plan-parser.js +0 -236
  79. package/dist/esm/blueprint/dag/task-graph-algorithms.d.ts +0 -13
  80. package/dist/esm/blueprint/dag/task-graph-algorithms.js +0 -236
  81. package/dist/esm/blueprint/dag/task-graph.d.ts +0 -171
  82. package/dist/esm/blueprint/dag/task-graph.js +0 -370
  83. package/dist/esm/blueprint/dag/types.d.ts +0 -17
  84. package/dist/esm/blueprint/dag/types.js +0 -2
  85. package/dist/esm/blueprint/graph/index.d.ts +0 -5
  86. package/dist/esm/blueprint/graph/index.js +0 -5
  87. package/dist/esm/blueprint/graph/mermaid-parser.d.ts +0 -3
  88. package/dist/esm/blueprint/graph/mermaid-parser.js +0 -93
  89. package/dist/esm/blueprint/graph/mermaid-serializer.d.ts +0 -3
  90. package/dist/esm/blueprint/graph/mermaid-serializer.js +0 -20
  91. package/dist/esm/blueprint/graph/schema.d.ts +0 -89
  92. package/dist/esm/blueprint/graph/schema.js +0 -104
  93. package/dist/esm/blueprint/graph/task-graph-adapter.d.ts +0 -6
  94. package/dist/esm/blueprint/graph/task-graph-adapter.js +0 -30
@@ -1,3 +1,4 @@
1
+ import { getManagedRunner } from '#tool-runtime';
1
2
  import { spawnSync } from 'node:child_process';
2
3
  import { existsSync, readFileSync } from 'node:fs';
3
4
  import { join } from 'node:path';
@@ -17,14 +18,19 @@ export function registerTypecheckCommand(cli) {
17
18
  export function buildTypecheckCommand(options = {}) {
18
19
  const cwd = options.cwd ?? process.cwd();
19
20
  if (hasCheckTypesScript(cwd)) {
21
+ const resolution = getManagedRunner('vp');
20
22
  return {
21
- command: 'vp',
22
- args: ['run', 'check-types'],
23
+ command: resolution.command,
24
+ args: [...resolution.args, 'run', 'check-types'],
23
25
  };
24
26
  }
27
+ const resolution = getManagedRunner('tsc', {
28
+ fallbackCommand: 'tsc',
29
+ fallbackArgs: [],
30
+ });
25
31
  return {
26
- command: 'tsc',
27
- args: ['--noEmit', ...(options.pretty ? [] : ['--pretty', 'false'])],
32
+ command: resolution.command,
33
+ args: [...resolution.args, '--noEmit', ...(options.pretty ? [] : ['--pretty', 'false'])],
28
34
  };
29
35
  }
30
36
  export function runTypecheckCommand(options = {}, deps = {}) {
@@ -1,3 +1,4 @@
1
+ import { getManagedRunner } from '#tool-runtime';
1
2
  import path from 'node:path';
2
3
  export function buildE2eCommand(options) {
3
4
  switch (options.step.runner) {
@@ -15,10 +16,11 @@ function buildPlaywrightCommand(options) {
15
16
  throw new Error(`Step ${step.logName} uses runner "playwright" but does not define configPath.`);
16
17
  }
17
18
  const { baseDir, configArg, files } = resolveRunnerPaths(step.configPath, options.files ?? []);
18
- const args = [...buildPnpmExecPrefix(baseDir), 'playwright', 'test', '--config', configArg];
19
+ const resolution = withBaseDir(getManagedRunner('playwright', { filterOutput: options.filterOutput }), baseDir);
20
+ const args = [...resolution.args, 'test', '--config', configArg];
19
21
  appendPlaywrightFlags(args, options);
20
22
  args.push(...(step.fixedArgs ?? []), ...files, ...(options.passthrough ?? []));
21
- return { command: 'pnpm', args };
23
+ return { command: resolution.command, args };
22
24
  }
23
25
  function buildVitestE2eCommand(options) {
24
26
  const { step } = options;
@@ -26,12 +28,13 @@ function buildVitestE2eCommand(options) {
26
28
  throw new Error(`Step ${step.logName} uses runner "vitest" but does not define configPath.`);
27
29
  }
28
30
  const { baseDir, configArg, files } = resolveRunnerPaths(step.configPath, options.files ?? []);
29
- const args = [...buildPnpmExecPrefix(baseDir), 'vitest', 'run', '--config', configArg];
31
+ const resolution = withBaseDir(getManagedRunner('vitest', { filterOutput: options.filterOutput }), baseDir);
32
+ const args = [...resolution.args, 'run', '--config', configArg];
30
33
  if (options.workers !== undefined) {
31
34
  args.push('--poolOptions.threads.maxThreads', String(options.workers));
32
35
  }
33
36
  args.push(...(step.fixedArgs ?? []), ...files, ...(options.passthrough ?? []));
34
- return { command: 'pnpm', args };
37
+ return { command: resolution.command, args };
35
38
  }
36
39
  function buildCustomCommand(options) {
37
40
  const { step } = options;
@@ -69,9 +72,6 @@ function appendPlaywrightFlags(args, options) {
69
72
  args.push('--test-list', options.testList);
70
73
  }
71
74
  }
72
- function buildPnpmExecPrefix(baseDir) {
73
- return baseDir === '.' ? ['exec'] : ['--dir', baseDir, 'exec'];
74
- }
75
75
  function resolveRunnerPaths(configPath, files) {
76
76
  const normalizedConfigPath = configPath.replace(/\\/gu, '/');
77
77
  const baseDir = path.posix.dirname(normalizedConfigPath);
@@ -95,4 +95,23 @@ function resolveRunnerPaths(configPath, files) {
95
95
  }),
96
96
  };
97
97
  }
98
+ function withBaseDir(resolution, baseDir) {
99
+ if (baseDir === '.') {
100
+ return { command: resolution.command, args: [...resolution.args] };
101
+ }
102
+ if (resolution.command === 'vp') {
103
+ return {
104
+ command: resolution.command,
105
+ args: ['--dir', baseDir, ...resolution.args],
106
+ };
107
+ }
108
+ const [wrappedCommand, ...wrappedArgs] = resolution.args;
109
+ if (resolution.command === 'rtk' && wrappedCommand === 'vp') {
110
+ return {
111
+ command: resolution.command,
112
+ args: ['vp', '--dir', baseDir, ...wrappedArgs],
113
+ };
114
+ }
115
+ return { command: resolution.command, args: [...resolution.args] };
116
+ }
98
117
  //# sourceMappingURL=command-builder.js.map
@@ -18,6 +18,7 @@ export async function createE2eExecutionPlan(input, cwd = process.cwd()) {
18
18
  workers: input.workers,
19
19
  testList: input.testList,
20
20
  passthrough: input.passthrough,
21
+ filterOutput: input.filterOutput,
21
22
  });
22
23
  }
23
24
  const hostAdapter = await loadConfiguredHostAdapter(cwd);
@@ -35,6 +36,7 @@ export async function createE2eExecutionPlan(input, cwd = process.cwd()) {
35
36
  workers: input.workers,
36
37
  testList: input.testList,
37
38
  passthrough: input.passthrough,
39
+ filterOutput: input.filterOutput,
38
40
  });
39
41
  }
40
42
  if (hostAdapter.adapter.buildExecutionPlan) {
@@ -49,6 +51,7 @@ export async function createE2eExecutionPlan(input, cwd = process.cwd()) {
49
51
  workers: input.workers,
50
52
  testList: input.testList,
51
53
  passthrough: input.passthrough,
54
+ filterOutput: input.filterOutput,
52
55
  });
53
56
  }
54
57
  return planE2eRun({
@@ -60,6 +63,7 @@ export async function createE2eExecutionPlan(input, cwd = process.cwd()) {
60
63
  workers: input.workers,
61
64
  testList: input.testList,
62
65
  passthrough: input.passthrough,
66
+ filterOutput: input.filterOutput,
63
67
  });
64
68
  }
65
69
  export function plannedGroupsToCommandConfigs(groups) {
@@ -76,6 +76,7 @@ function planE2eRunsFromSuites(options) {
76
76
  workers: options.request.workers,
77
77
  testList: options.request.testList,
78
78
  passthrough: options.request.passthrough,
79
+ filterOutput: options.request.filterOutput,
79
80
  });
80
81
  runs.push({
81
82
  suiteId: suite.id,
@@ -48,6 +48,7 @@ export interface E2eCommandRequest {
48
48
  workers?: number | string;
49
49
  testList?: string;
50
50
  passthrough?: readonly string[];
51
+ filterOutput?: boolean;
51
52
  }
52
53
  export interface E2eExecutionRequest extends E2eCommandRequest {
53
54
  suite?: string;
@@ -8,6 +8,7 @@
8
8
  */
9
9
  import { isMissingBinary, isRunFailure, runCommand } from '#mcp/tools/_shared/run-command';
10
10
  import { resolveProjectRoot } from '#mcp/tools/_shared/project-root';
11
+ import { getManagedRunner } from '#tool-runtime';
11
12
  const DEFAULT_FORMAT_TIMEOUT_MS = 5 * 60 * 1_000;
12
13
  /**
13
14
  * Run formatter and return a structured result. Throws a clear error when
@@ -33,7 +34,12 @@ export async function runFormat(options = {}) {
33
34
  args.push('--ignore-path', '.gitignore');
34
35
  if (options.files && options.files.length > 0)
35
36
  args.push(...options.files);
36
- const outcome = await runCommand('oxfmt', args, runOptions);
37
+ const resolution = getManagedRunner('oxfmt', {
38
+ fallbackCommand: 'oxfmt',
39
+ fallbackArgs: [],
40
+ filterOutput: false,
41
+ });
42
+ const outcome = await runCommand(resolution.command, [...resolution.args, ...args], runOptions);
37
43
  if (isRunFailure(outcome)) {
38
44
  if (isMissingBinary(outcome)) {
39
45
  throw new Error("oxfmt binary not found on PATH. Install it as a devDependency: 'vp install -D oxfmt'");
@@ -8,6 +8,7 @@
8
8
  */
9
9
  import { isRunFailure, runCommand } from '#mcp/tools/_shared/run-command';
10
10
  import { resolveProjectRoot } from '#mcp/tools/_shared/project-root';
11
+ import { getManagedRunner } from '#tool-runtime';
11
12
  const DEFAULT_LINT_TIMEOUT_MS = 5 * 60 * 1_000;
12
13
  /**
13
14
  * Parse oxlint's `--format=json` output (ESLint-compatible array shape) into
@@ -92,7 +93,8 @@ export async function runLint(options = {}) {
92
93
  else {
93
94
  lintArgs.push('.');
94
95
  }
95
- const vpOutcome = await runCommand('vp', lintArgs, runOptions);
96
+ const resolution = getManagedRunner('vp', { filterOutput: false });
97
+ const vpOutcome = await runCommand(resolution.command, [...resolution.args, ...lintArgs], runOptions);
96
98
  if (isRunFailure(vpOutcome)) {
97
99
  return {
98
100
  passed: false,