@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,104 +0,0 @@
1
- import { z } from 'zod';
2
- export const graphNodeTypeSchema = z.enum([
3
- 'task',
4
- 'milestone',
5
- 'decision',
6
- 'external',
7
- 'tech_debt',
8
- 'blueprint',
9
- ]);
10
- export const graphEdgeTypeSchema = z.enum(['depends_on', 'blocks', 'relates_to']);
11
- export const graphNodeSchema = z.object({
12
- id: z.string().min(1),
13
- type: graphNodeTypeSchema,
14
- label: z.string().min(1),
15
- metadata: z.record(z.string(), z.unknown()).optional(),
16
- });
17
- export const graphEdgeSchema = z.object({
18
- source: z.string().min(1),
19
- target: z.string().min(1),
20
- type: graphEdgeTypeSchema,
21
- label: z.string().optional(),
22
- metadata: z.record(z.string(), z.unknown()).optional(),
23
- });
24
- export const graphLayoutSchema = z.object({
25
- direction: z.enum(['TD', 'LR', 'BT', 'RL']).default('TD'),
26
- rankdir: z.string().optional(),
27
- });
28
- function hasCycle(edges) {
29
- const adjacency = new Map();
30
- const visiting = new Set();
31
- const visited = new Set();
32
- for (const edge of edges) {
33
- const targets = adjacency.get(edge.source) ?? [];
34
- targets.push(edge.target);
35
- adjacency.set(edge.source, targets);
36
- }
37
- function visit(node) {
38
- if (visiting.has(node)) {
39
- return true;
40
- }
41
- if (visited.has(node)) {
42
- return false;
43
- }
44
- visiting.add(node);
45
- const targets = adjacency.get(node) ?? [];
46
- for (const target of targets) {
47
- if (visit(target)) {
48
- return true;
49
- }
50
- }
51
- visiting.delete(node);
52
- visited.add(node);
53
- return false;
54
- }
55
- for (const node of adjacency.keys()) {
56
- if (visit(node)) {
57
- return true;
58
- }
59
- }
60
- return false;
61
- }
62
- export const normalizedGraphSchema = z
63
- .object({
64
- nodes: z.array(graphNodeSchema),
65
- edges: z.array(graphEdgeSchema),
66
- layout: graphLayoutSchema.optional(),
67
- })
68
- .superRefine((graph, context) => {
69
- const nodeIds = new Set();
70
- for (const [index, node] of graph.nodes.entries()) {
71
- if (nodeIds.has(node.id)) {
72
- context.addIssue({
73
- code: z.ZodIssueCode.custom,
74
- message: `Duplicate node id: ${node.id}`,
75
- path: ['nodes', index, 'id'],
76
- });
77
- }
78
- nodeIds.add(node.id);
79
- }
80
- for (const [index, edge] of graph.edges.entries()) {
81
- if (!nodeIds.has(edge.source)) {
82
- context.addIssue({
83
- code: z.ZodIssueCode.custom,
84
- message: `Edge source not found: ${edge.source}`,
85
- path: ['edges', index, 'source'],
86
- });
87
- }
88
- if (!nodeIds.has(edge.target)) {
89
- context.addIssue({
90
- code: z.ZodIssueCode.custom,
91
- message: `Edge target not found: ${edge.target}`,
92
- path: ['edges', index, 'target'],
93
- });
94
- }
95
- }
96
- if (hasCycle(graph.edges)) {
97
- context.addIssue({
98
- code: z.ZodIssueCode.custom,
99
- message: 'Graph contains a cycle',
100
- path: ['edges'],
101
- });
102
- }
103
- });
104
- //# sourceMappingURL=schema.js.map
@@ -1,6 +0,0 @@
1
- import type { TaskGraph } from '#dag/task-graph';
2
- import { type NormalizedGraph } from '#graph/schema';
3
- export declare function taskGraphToNormalizedGraph(taskGraph: TaskGraph<{
4
- title: string;
5
- }>): NormalizedGraph;
6
- //# sourceMappingURL=task-graph-adapter.d.ts.map
@@ -1,30 +0,0 @@
1
- import { normalizedGraphSchema } from '#graph/schema';
2
- export function taskGraphToNormalizedGraph(taskGraph) {
3
- const tasks = taskGraph.getTopologicalOrder();
4
- const waves = taskGraph.getWaves();
5
- const waveByTaskId = new Map();
6
- for (const [waveIndex, wave] of waves.entries()) {
7
- for (const task of wave) {
8
- waveByTaskId.set(task.id, waveIndex);
9
- }
10
- }
11
- const nodes = tasks.map((task) => ({
12
- id: task.id,
13
- type: 'task',
14
- label: task.data?.title ?? task.id,
15
- metadata: {
16
- wave_number: waveByTaskId.get(task.id) ?? 0,
17
- },
18
- }));
19
- const edges = tasks.flatMap((task) => task.dependencies.map((dependencyId) => ({
20
- source: dependencyId,
21
- target: task.id,
22
- type: 'depends_on',
23
- })));
24
- return normalizedGraphSchema.parse({
25
- nodes,
26
- edges,
27
- layout: { direction: 'TD' },
28
- });
29
- }
30
- //# sourceMappingURL=task-graph-adapter.js.map