@zibby/core 0.4.5 → 0.5.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.
Files changed (81) hide show
  1. package/dist/index.js +147 -150
  2. package/dist/package.json +1 -8
  3. package/dist/register-built-in-strategies.js +32 -32
  4. package/dist/strategies/claude-strategy.js +2 -2
  5. package/dist/strategies/index.js +45 -45
  6. package/dist/utils/run-index-post-cli.js +1 -4
  7. package/package.json +1 -8
  8. package/dist/templates/browser-test-automation/README.md +0 -136
  9. package/dist/templates/browser-test-automation/chat.mjs +0 -36
  10. package/dist/templates/browser-test-automation/graph.mjs +0 -80
  11. package/dist/templates/browser-test-automation/nodes/cache-replay.mjs +0 -213
  12. package/dist/templates/browser-test-automation/nodes/execute-live.mjs +0 -254
  13. package/dist/templates/browser-test-automation/nodes/generate-script.mjs +0 -108
  14. package/dist/templates/browser-test-automation/nodes/index.mjs +0 -4
  15. package/dist/templates/browser-test-automation/nodes/preflight.mjs +0 -94
  16. package/dist/templates/browser-test-automation/nodes/utils.mjs +0 -297
  17. package/dist/templates/browser-test-automation/pipeline-ids.js +0 -12
  18. package/dist/templates/browser-test-automation/result-handler.mjs +0 -327
  19. package/dist/templates/browser-test-automation/run-index.mjs +0 -420
  20. package/dist/templates/browser-test-automation/run_test.json +0 -358
  21. package/dist/templates/browser-test-automation/state.js +0 -61
  22. package/dist/templates/code-analysis/README.md +0 -60
  23. package/dist/templates/code-analysis/graph.js +0 -72
  24. package/dist/templates/code-analysis/graph.mjs +0 -33
  25. package/dist/templates/code-analysis/index.js +0 -18
  26. package/dist/templates/code-analysis/nodes/analyze-ticket-node.js +0 -204
  27. package/dist/templates/code-analysis/nodes/create-pr-node.js +0 -175
  28. package/dist/templates/code-analysis/nodes/finalize-node.js +0 -118
  29. package/dist/templates/code-analysis/nodes/generate-code-node.js +0 -425
  30. package/dist/templates/code-analysis/nodes/generate-test-cases-node.js +0 -376
  31. package/dist/templates/code-analysis/nodes/services/prMetaService.js +0 -86
  32. package/dist/templates/code-analysis/nodes/setup-node.js +0 -142
  33. package/dist/templates/code-analysis/prompts/analyze-ticket.md +0 -181
  34. package/dist/templates/code-analysis/prompts/generate-code.md +0 -33
  35. package/dist/templates/code-analysis/prompts/generate-test-cases.md +0 -110
  36. package/dist/templates/code-analysis/state.js +0 -48
  37. package/dist/templates/generate-test-cases/README.md +0 -72
  38. package/dist/templates/generate-test-cases/graph.mjs +0 -46
  39. package/dist/templates/generate-test-cases/nodes/generate-test-cases-node.js +0 -381
  40. package/dist/templates/generate-test-cases/nodes/setup-node.js +0 -142
  41. package/dist/templates/generate-test-cases/state.js +0 -54
  42. package/dist/templates/global-setup.js +0 -56
  43. package/dist/templates/index.js +0 -147
  44. package/dist/templates/register-nodes.js +0 -24
  45. package/templates/browser-test-automation/README.md +0 -136
  46. package/templates/browser-test-automation/chat.mjs +0 -36
  47. package/templates/browser-test-automation/graph.mjs +0 -80
  48. package/templates/browser-test-automation/nodes/cache-replay.mjs +0 -213
  49. package/templates/browser-test-automation/nodes/execute-live.mjs +0 -254
  50. package/templates/browser-test-automation/nodes/generate-script.mjs +0 -108
  51. package/templates/browser-test-automation/nodes/index.mjs +0 -4
  52. package/templates/browser-test-automation/nodes/preflight.mjs +0 -94
  53. package/templates/browser-test-automation/nodes/utils.mjs +0 -297
  54. package/templates/browser-test-automation/pipeline-ids.js +0 -12
  55. package/templates/browser-test-automation/result-handler.mjs +0 -327
  56. package/templates/browser-test-automation/run-index.mjs +0 -420
  57. package/templates/browser-test-automation/run_test.json +0 -358
  58. package/templates/browser-test-automation/state.js +0 -61
  59. package/templates/code-analysis/README.md +0 -60
  60. package/templates/code-analysis/graph.js +0 -72
  61. package/templates/code-analysis/graph.mjs +0 -33
  62. package/templates/code-analysis/index.js +0 -18
  63. package/templates/code-analysis/nodes/analyze-ticket-node.js +0 -204
  64. package/templates/code-analysis/nodes/create-pr-node.js +0 -175
  65. package/templates/code-analysis/nodes/finalize-node.js +0 -118
  66. package/templates/code-analysis/nodes/generate-code-node.js +0 -425
  67. package/templates/code-analysis/nodes/generate-test-cases-node.js +0 -376
  68. package/templates/code-analysis/nodes/services/prMetaService.js +0 -86
  69. package/templates/code-analysis/nodes/setup-node.js +0 -142
  70. package/templates/code-analysis/prompts/analyze-ticket.md +0 -181
  71. package/templates/code-analysis/prompts/generate-code.md +0 -33
  72. package/templates/code-analysis/prompts/generate-test-cases.md +0 -110
  73. package/templates/code-analysis/state.js +0 -48
  74. package/templates/generate-test-cases/README.md +0 -72
  75. package/templates/generate-test-cases/graph.mjs +0 -46
  76. package/templates/generate-test-cases/nodes/generate-test-cases-node.js +0 -381
  77. package/templates/generate-test-cases/nodes/setup-node.js +0 -142
  78. package/templates/generate-test-cases/state.js +0 -54
  79. package/templates/global-setup.js +0 -56
  80. package/templates/index.js +0 -147
  81. package/templates/register-nodes.js +0 -24
@@ -1,147 +0,0 @@
1
- import { join, dirname } from 'path';
2
- import { fileURLToPath } from 'url';
3
- import { existsSync } from 'fs';
4
-
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = dirname(__filename);
7
-
8
- export const TEMPLATES = {
9
- 'browser-test-automation': {
10
- name: 'browser-test-automation',
11
- displayName: 'Browser Test Automation (Full Workflow)',
12
- description: 'Complete browser test automation workflow with title generation, live execution, and script generation',
13
- path: join(__dirname, 'browser-test-automation'),
14
- default: true,
15
- // Suggested slug for `zibby workflow new <slug> -t <name>`. Used in
16
- // the `template list` scaffold hint so the printed command is
17
- // copy-paste-ready instead of `your-workflow-name`. Users can still
18
- // pick anything they want at scaffold time.
19
- defaultSlug: 'browser-tests',
20
- // Runtime deps the scaffolded copy needs in addition to @zibby/core.
21
- // graph.mjs now imports state.js which `import { z } from 'zod'`s
22
- // directly, so the user's package.json must declare zod or the
23
- // scaffolded workflow fails on first import.
24
- deps: {
25
- zod: '^3.23.0',
26
- },
27
- features: [
28
- 'Preflight analysis: extract title + assertion checklist from spec',
29
- 'Execute test live with AI + browser (Claude or Cursor)',
30
- 'Generate Playwright script with stable IDs',
31
- 'Real-time streaming output',
32
- 'Video recording of browser sessions'
33
- ]
34
- },
35
- 'code-analysis': {
36
- name: 'code-analysis',
37
- displayName: 'Code Analysis (Ticket → Code + Tests)',
38
- description: 'Multi-node workflow that analyzes a Jira ticket against a code repo, generates code changes, and emits test cases',
39
- path: join(__dirname, 'code-analysis'),
40
- defaultSlug: 'ticket-analyzer',
41
- // Runtime deps the scaffolded copy needs in addition to @zibby/core.
42
- // Merged into the generated package.json so `npm install` works
43
- // without manual edits. Browser-test doesn't declare any because
44
- // its nodes only depend on @zibby/core.
45
- deps: {
46
- axios: '^1.6.0',
47
- handlebars: '^4.7.8',
48
- zod: '^3.23.0',
49
- },
50
- features: [
51
- 'Clone repos + snapshot git baseline',
52
- 'LLM analysis of ticket against codebase (canProceed gate)',
53
- 'Conditional routing: skip code-gen if ticket is invalid',
54
- 'Generate scoped code changes',
55
- 'Generate test cases covering the changes',
56
- 'Customizable prompts in prompts/*.md'
57
- ]
58
- },
59
- 'generate-test-cases': {
60
- name: 'generate-test-cases',
61
- displayName: 'Generate Test Cases (Diff → Test Specs)',
62
- description: 'Standalone slice — takes an existing code diff and generates plain-English test specifications for it. Skips ticket-analysis and code-gen.',
63
- path: join(__dirname, 'generate-test-cases'),
64
- defaultSlug: 'tests-from-diff',
65
- deps: {
66
- zod: '^3.23.0',
67
- },
68
- features: [
69
- 'Two-node graph: setup → generate_test_cases',
70
- 'Takes a PR diff directly as state input (no upstream code-gen needed)',
71
- 'LLM explores codebase routing/components for accurate test steps',
72
- 'Emits 4-8 prioritized test specs (Critical/High/Medium/Low)',
73
- 'Plain-English test steps — runnable by AI agents'
74
- ]
75
- }
76
- };
77
-
78
- export class TemplateFactory {
79
- static listTemplates() {
80
- return Object.values(TEMPLATES);
81
- }
82
-
83
- static getDefault() {
84
- return Object.values(TEMPLATES).find(t => t.default) || TEMPLATES['browser-test-automation'];
85
- }
86
-
87
- static getTemplate(name) {
88
- const template = TEMPLATES[name];
89
- if (!template) {
90
- const available = Object.keys(TEMPLATES).join(', ');
91
- throw new Error(`Template "${name}" not found. Available: ${available}`);
92
- }
93
- return template;
94
- }
95
-
96
- static validateTemplate(templatePath) {
97
- const requiredFiles = ['graph.mjs', 'nodes', 'README.md'];
98
-
99
- for (const file of requiredFiles) {
100
- const filePath = join(templatePath, file);
101
- if (!existsSync(filePath)) {
102
- throw new Error(`Template missing required file: ${file}`);
103
- }
104
- }
105
-
106
- return true;
107
- }
108
-
109
- static getTemplateFiles(templateName) {
110
- const template = this.getTemplate(templateName);
111
- this.validateTemplate(template.path);
112
-
113
- const resultHandlerPath = join(template.path, 'result-handler.mjs');
114
- return {
115
- graphPath: join(template.path, 'graph.mjs'),
116
- nodesPath: join(template.path, 'nodes'),
117
- readmePath: join(template.path, 'README.md'),
118
- resultHandlerPath: existsSync(resultHandlerPath) ? resultHandlerPath : null,
119
- template
120
- };
121
- }
122
-
123
- static registerCustomTemplate(name, config) {
124
- if (TEMPLATES[name]) {
125
- throw new Error(`Template "${name}" already exists`);
126
- }
127
-
128
- if (!config.path || !config.displayName) {
129
- throw new Error('Custom template must have "path" and "displayName"');
130
- }
131
-
132
- this.validateTemplate(config.path);
133
-
134
- TEMPLATES[name] = {
135
- name,
136
- displayName: config.displayName,
137
- description: config.description || '',
138
- path: config.path,
139
- features: config.features || [],
140
- custom: true
141
- };
142
-
143
- return TEMPLATES[name];
144
- }
145
- }
146
-
147
- export default TemplateFactory;
@@ -1,24 +0,0 @@
1
- /**
2
- * Template node registrations
3
- *
4
- * Import this module as a side-effect to register all built-in
5
- * template nodes with the framework's node registry.
6
- *
7
- * Usage: import '@zibby/core/templates/register-nodes.js';
8
- */
9
-
10
- import { registerNode } from '@zibby/agent-workflow';
11
- import { setupNode } from './code-analysis/nodes/setup-node.js';
12
- import { analyzeTicketNode } from './code-analysis/nodes/analyze-ticket-node.js';
13
- import { generateCodeNode, implementCodeNode } from './code-analysis/nodes/generate-code-node.js';
14
- import { generateTestCasesNode } from './code-analysis/nodes/generate-test-cases-node.js';
15
- import { finalizeNode } from './code-analysis/nodes/finalize-node.js';
16
- import { createPRNode } from './code-analysis/nodes/create-pr-node.js';
17
-
18
- registerNode('setup', setupNode);
19
- registerNode('analyze_ticket', analyzeTicketNode);
20
- registerNode('generate_code', generateCodeNode);
21
- registerNode('generate_test_cases', generateTestCasesNode);
22
- registerNode('finalize', finalizeNode);
23
- registerNode('implement_code', implementCodeNode);
24
- registerNode('create_pr', createPRNode);