@helmiq/crew 0.1.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/defaults/personas/architect.persona.yaml +72 -0
- package/defaults/personas/engineer.persona.yaml +137 -0
- package/defaults/personas/persona-spec.schema.yaml +149 -0
- package/defaults/personas/reviewer.persona.yaml +47 -0
- package/defaults/rubrics/adr.rubric.yaml +48 -0
- package/defaults/rubrics/code-review.rubric.yaml +39 -0
- package/defaults/rubrics/pull-request.rubric.yaml +40 -0
- package/dist/actions/actions.test.d.ts +2 -0
- package/dist/actions/actions.test.d.ts.map +1 -0
- package/dist/actions/actions.test.js +158 -0
- package/dist/actions/direct-dispatcher.d.ts +10 -0
- package/dist/actions/direct-dispatcher.d.ts.map +1 -0
- package/dist/actions/direct-dispatcher.js +27 -0
- package/dist/actions/dispatcher.d.ts +11 -0
- package/dist/actions/dispatcher.d.ts.map +1 -0
- package/dist/actions/dispatcher.js +1 -0
- package/dist/actions/index.d.ts +7 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +3 -0
- package/dist/actions/registry.d.ts +13 -0
- package/dist/actions/registry.d.ts.map +1 -0
- package/dist/actions/registry.js +40 -0
- package/dist/actions/resolver.d.ts +47 -0
- package/dist/actions/resolver.d.ts.map +1 -0
- package/dist/actions/resolver.js +43 -0
- package/dist/cli/cli.test.d.ts +2 -0
- package/dist/cli/cli.test.d.ts.map +1 -0
- package/dist/cli/cli.test.js +392 -0
- package/dist/cli/run.d.ts +45 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +236 -0
- package/dist/common/errors.d.ts +76 -0
- package/dist/common/errors.d.ts.map +1 -0
- package/dist/common/errors.js +74 -0
- package/dist/config/config.test.d.ts +2 -0
- package/dist/config/config.test.d.ts.map +1 -0
- package/dist/config/config.test.js +691 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +4 -0
- package/dist/config/loader.d.ts +16 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +56 -0
- package/dist/config/model-resolver.d.ts +24 -0
- package/dist/config/model-resolver.d.ts.map +1 -0
- package/dist/config/model-resolver.js +39 -0
- package/dist/config/resolver.d.ts +22 -0
- package/dist/config/resolver.d.ts.map +1 -0
- package/dist/config/resolver.js +115 -0
- package/dist/config/schemas.d.ts +266 -0
- package/dist/config/schemas.d.ts.map +1 -0
- package/dist/config/schemas.js +115 -0
- package/dist/context/artifact-reader.d.ts +12 -0
- package/dist/context/artifact-reader.d.ts.map +1 -0
- package/dist/context/artifact-reader.js +92 -0
- package/dist/context/assembler.d.ts +22 -0
- package/dist/context/assembler.d.ts.map +1 -0
- package/dist/context/assembler.js +126 -0
- package/dist/context/code-reader.d.ts +14 -0
- package/dist/context/code-reader.d.ts.map +1 -0
- package/dist/context/code-reader.js +56 -0
- package/dist/context/context.test.d.ts +2 -0
- package/dist/context/context.test.d.ts.map +1 -0
- package/dist/context/context.test.js +260 -0
- package/dist/context/index.d.ts +9 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +5 -0
- package/dist/context/section-extractor.d.ts +9 -0
- package/dist/context/section-extractor.d.ts.map +1 -0
- package/dist/context/section-extractor.js +32 -0
- package/dist/context/token-budget.d.ts +11 -0
- package/dist/context/token-budget.d.ts.map +1 -0
- package/dist/context/token-budget.js +22 -0
- package/dist/control/control.test.d.ts +2 -0
- package/dist/control/control.test.d.ts.map +1 -0
- package/dist/control/control.test.js +137 -0
- package/dist/control/id-generator.d.ts +12 -0
- package/dist/control/id-generator.d.ts.map +1 -0
- package/dist/control/id-generator.js +20 -0
- package/dist/control/index.d.ts +5 -0
- package/dist/control/index.d.ts.map +1 -0
- package/dist/control/index.js +3 -0
- package/dist/control/lock-manager.d.ts +13 -0
- package/dist/control/lock-manager.d.ts.map +1 -0
- package/dist/control/lock-manager.js +72 -0
- package/dist/control/run-state.d.ts +16 -0
- package/dist/control/run-state.d.ts.map +1 -0
- package/dist/control/run-state.js +55 -0
- package/dist/engine/composite.d.ts +34 -0
- package/dist/engine/composite.d.ts.map +1 -0
- package/dist/engine/composite.js +192 -0
- package/dist/engine/composite.test.d.ts +2 -0
- package/dist/engine/composite.test.d.ts.map +1 -0
- package/dist/engine/composite.test.js +1947 -0
- package/dist/engine/engine.test.d.ts +2 -0
- package/dist/engine/engine.test.d.ts.map +1 -0
- package/dist/engine/engine.test.js +334 -0
- package/dist/engine/index.d.ts +10 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +5 -0
- package/dist/engine/llm-client.d.ts +27 -0
- package/dist/engine/llm-client.d.ts.map +1 -0
- package/dist/engine/llm-client.js +46 -0
- package/dist/engine/simple.d.ts +21 -0
- package/dist/engine/simple.d.ts.map +1 -0
- package/dist/engine/simple.js +59 -0
- package/dist/engine/tool-dispatch.d.ts +37 -0
- package/dist/engine/tool-dispatch.d.ts.map +1 -0
- package/dist/engine/tool-dispatch.js +146 -0
- package/dist/engine/tool-dispatch.test.d.ts +2 -0
- package/dist/engine/tool-dispatch.test.d.ts.map +1 -0
- package/dist/engine/tool-dispatch.test.js +348 -0
- package/dist/engine/tool-filter.d.ts +13 -0
- package/dist/engine/tool-filter.d.ts.map +1 -0
- package/dist/engine/tool-filter.js +25 -0
- package/dist/evaluation/evaluation.test.d.ts +2 -0
- package/dist/evaluation/evaluation.test.d.ts.map +1 -0
- package/dist/evaluation/evaluation.test.js +490 -0
- package/dist/evaluation/evaluator.d.ts +19 -0
- package/dist/evaluation/evaluator.d.ts.map +1 -0
- package/dist/evaluation/evaluator.js +78 -0
- package/dist/evaluation/index.d.ts +4 -0
- package/dist/evaluation/index.d.ts.map +1 -0
- package/dist/evaluation/index.js +2 -0
- package/dist/evaluation/scorer.d.ts +38 -0
- package/dist/evaluation/scorer.d.ts.map +1 -0
- package/dist/evaluation/scorer.js +94 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +1 -0
- package/dist/providers/provider-factory.d.ts +11 -0
- package/dist/providers/provider-factory.d.ts.map +1 -0
- package/dist/providers/provider-factory.js +30 -0
- package/dist/publication/frontmatter.d.ts +21 -0
- package/dist/publication/frontmatter.d.ts.map +1 -0
- package/dist/publication/frontmatter.js +15 -0
- package/dist/publication/git-ops.d.ts +18 -0
- package/dist/publication/git-ops.d.ts.map +1 -0
- package/dist/publication/git-ops.js +74 -0
- package/dist/publication/index.d.ts +9 -0
- package/dist/publication/index.d.ts.map +1 -0
- package/dist/publication/index.js +5 -0
- package/dist/publication/provenance-writer.d.ts +27 -0
- package/dist/publication/provenance-writer.d.ts.map +1 -0
- package/dist/publication/provenance-writer.js +21 -0
- package/dist/publication/publication.test.d.ts +2 -0
- package/dist/publication/publication.test.d.ts.map +1 -0
- package/dist/publication/publication.test.js +235 -0
- package/dist/publication/publisher.d.ts +32 -0
- package/dist/publication/publisher.d.ts.map +1 -0
- package/dist/publication/publisher.js +113 -0
- package/dist/publication/secret-scanner.d.ts +6 -0
- package/dist/publication/secret-scanner.d.ts.map +1 -0
- package/dist/publication/secret-scanner.js +19 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +2 -0
- package/dist/tools/registry.d.ts +15 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +288 -0
- package/dist/tools/registry.test.d.ts +2 -0
- package/dist/tools/registry.test.d.ts.map +1 -0
- package/dist/tools/registry.test.js +131 -0
- package/dist/tools/tool-groups.d.ts +20 -0
- package/dist/tools/tool-groups.d.ts.map +1 -0
- package/dist/tools/tool-groups.js +48 -0
- package/dist/tools/tool-groups.test.d.ts +2 -0
- package/dist/tools/tool-groups.test.d.ts.map +1 -0
- package/dist/tools/tool-groups.test.js +127 -0
- package/dist/types/artifact-store.d.ts +33 -0
- package/dist/types/artifact-store.d.ts.map +1 -0
- package/dist/types/artifact-store.js +9 -0
- package/dist/types/evaluation-rubric.d.ts +18 -0
- package/dist/types/evaluation-rubric.d.ts.map +1 -0
- package/dist/types/evaluation-rubric.js +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/llm-provider.d.ts +47 -0
- package/dist/types/llm-provider.d.ts.map +1 -0
- package/dist/types/llm-provider.js +8 -0
- package/dist/types/persona-spec.d.ts +79 -0
- package/dist/types/persona-spec.d.ts.map +1 -0
- package/dist/types/persona-spec.js +1 -0
- package/dist/types/project-config.d.ts +28 -0
- package/dist/types/project-config.d.ts.map +1 -0
- package/dist/types/project-config.js +1 -0
- package/dist/types/provenance.d.ts +67 -0
- package/dist/types/provenance.d.ts.map +1 -0
- package/dist/types/provenance.js +1 -0
- package/dist/types/run-state.d.ts +11 -0
- package/dist/types/run-state.d.ts.map +1 -0
- package/dist/types/run-state.js +1 -0
- package/dist/types/tool-runtime.d.ts +43 -0
- package/dist/types/tool-runtime.d.ts.map +1 -0
- package/dist/types/tool-runtime.js +30 -0
- package/dist/workspace/detect.d.ts +11 -0
- package/dist/workspace/detect.d.ts.map +1 -0
- package/dist/workspace/detect.js +28 -0
- package/dist/workspace/detect.test.d.ts +2 -0
- package/dist/workspace/detect.test.d.ts.map +1 -0
- package/dist/workspace/detect.test.js +53 -0
- package/dist/workspace/index.d.ts +2 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { getAction, listActions, listActionNames, resolveAction, parseWorkItemId, UnknownActionError, DirectDispatcher, } from './index.js';
|
|
3
|
+
describe('action registry', () => {
|
|
4
|
+
it('returns the implement action definition', () => {
|
|
5
|
+
const action = getAction('implement');
|
|
6
|
+
expect(action).toBeDefined();
|
|
7
|
+
expect(action.persona).toBe('engineer');
|
|
8
|
+
expect(action.task).toBe('implement-story');
|
|
9
|
+
expect(action.track).toBe('delivery');
|
|
10
|
+
expect(action.idLevel).toBe('task');
|
|
11
|
+
});
|
|
12
|
+
it('returns the review action definition', () => {
|
|
13
|
+
const action = getAction('review');
|
|
14
|
+
expect(action).toBeDefined();
|
|
15
|
+
expect(action.persona).toBe('reviewer');
|
|
16
|
+
expect(action.task).toBe('review-pr');
|
|
17
|
+
expect(action.track).toBe('delivery');
|
|
18
|
+
expect(action.idLevel).toBe('task');
|
|
19
|
+
});
|
|
20
|
+
it('returns the address action definition', () => {
|
|
21
|
+
const action = getAction('address');
|
|
22
|
+
expect(action).toBeDefined();
|
|
23
|
+
expect(action.persona).toBe('engineer');
|
|
24
|
+
expect(action.task).toBe('address-feedback');
|
|
25
|
+
expect(action.track).toBe('delivery');
|
|
26
|
+
expect(action.idLevel).toBe('task');
|
|
27
|
+
});
|
|
28
|
+
it('returns the decide action definition', () => {
|
|
29
|
+
const action = getAction('decide');
|
|
30
|
+
expect(action).toBeDefined();
|
|
31
|
+
expect(action.persona).toBe('architect');
|
|
32
|
+
expect(action.task).toBe('adr-workflow');
|
|
33
|
+
expect(action.track).toBe('architecture');
|
|
34
|
+
expect(action.idLevel).toBe('epic');
|
|
35
|
+
});
|
|
36
|
+
it('returns undefined for unknown actions', () => {
|
|
37
|
+
expect(getAction('nonexistent')).toBeUndefined();
|
|
38
|
+
});
|
|
39
|
+
it('lists all registered actions', () => {
|
|
40
|
+
const actions = listActions();
|
|
41
|
+
expect(actions.length).toBeGreaterThanOrEqual(4);
|
|
42
|
+
expect(actions.some((a) => a.name === 'implement')).toBe(true);
|
|
43
|
+
expect(actions.some((a) => a.name === 'review')).toBe(true);
|
|
44
|
+
expect(actions.some((a) => a.name === 'address')).toBe(true);
|
|
45
|
+
expect(actions.some((a) => a.name === 'decide')).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
it('lists action names', () => {
|
|
48
|
+
const names = listActionNames();
|
|
49
|
+
expect(names).toContain('implement');
|
|
50
|
+
expect(names).toContain('review');
|
|
51
|
+
expect(names).toContain('address');
|
|
52
|
+
expect(names).toContain('decide');
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
describe('parseWorkItemId', () => {
|
|
56
|
+
it('parses a task-level ID into epicId and storyId', () => {
|
|
57
|
+
const result = parseWorkItemId('CREW-03-001');
|
|
58
|
+
expect(result.epicId).toBe('CREW-03');
|
|
59
|
+
expect(result.storyId).toBe('CREW-03-001');
|
|
60
|
+
});
|
|
61
|
+
it('parses an epic-level ID into epicId only', () => {
|
|
62
|
+
const result = parseWorkItemId('CREW-03');
|
|
63
|
+
expect(result.epicId).toBe('CREW-03');
|
|
64
|
+
expect(result.storyId).toBeUndefined();
|
|
65
|
+
});
|
|
66
|
+
it('handles IDs with more than three segments', () => {
|
|
67
|
+
const result = parseWorkItemId('CREW-03-001-sub');
|
|
68
|
+
expect(result.epicId).toBe('CREW-03');
|
|
69
|
+
expect(result.storyId).toBe('CREW-03-001-sub');
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
describe('resolveAction', () => {
|
|
73
|
+
it('resolves implement action to engineer persona', () => {
|
|
74
|
+
const resolved = resolveAction({
|
|
75
|
+
action: 'implement',
|
|
76
|
+
id: 'CREW-03-001',
|
|
77
|
+
workspace: '/tmp/workspace',
|
|
78
|
+
});
|
|
79
|
+
expect(resolved.action).toBe('implement');
|
|
80
|
+
expect(resolved.persona).toBe('engineer');
|
|
81
|
+
expect(resolved.task).toBe('implement-story');
|
|
82
|
+
expect(resolved.scope).toBe('CREW-03');
|
|
83
|
+
expect(resolved.epicId).toBe('CREW-03');
|
|
84
|
+
expect(resolved.storyId).toBe('CREW-03-001');
|
|
85
|
+
expect(resolved.workspace).toBe('/tmp/workspace');
|
|
86
|
+
});
|
|
87
|
+
it('resolves review action to reviewer persona', () => {
|
|
88
|
+
const resolved = resolveAction({
|
|
89
|
+
action: 'review',
|
|
90
|
+
id: 'CREW-04-001',
|
|
91
|
+
workspace: '/tmp/workspace',
|
|
92
|
+
});
|
|
93
|
+
expect(resolved.action).toBe('review');
|
|
94
|
+
expect(resolved.persona).toBe('reviewer');
|
|
95
|
+
expect(resolved.task).toBe('review-pr');
|
|
96
|
+
expect(resolved.scope).toBe('CREW-04');
|
|
97
|
+
expect(resolved.epicId).toBe('CREW-04');
|
|
98
|
+
expect(resolved.storyId).toBe('CREW-04-001');
|
|
99
|
+
});
|
|
100
|
+
it('resolves address action to engineer persona address-feedback task', () => {
|
|
101
|
+
const resolved = resolveAction({
|
|
102
|
+
action: 'address',
|
|
103
|
+
id: 'CREW-04-001',
|
|
104
|
+
workspace: '/tmp/workspace',
|
|
105
|
+
});
|
|
106
|
+
expect(resolved.action).toBe('address');
|
|
107
|
+
expect(resolved.persona).toBe('engineer');
|
|
108
|
+
expect(resolved.task).toBe('address-feedback');
|
|
109
|
+
expect(resolved.scope).toBe('CREW-04');
|
|
110
|
+
expect(resolved.epicId).toBe('CREW-04');
|
|
111
|
+
expect(resolved.storyId).toBe('CREW-04-001');
|
|
112
|
+
});
|
|
113
|
+
it('resolves decide action to architect persona at epic level', () => {
|
|
114
|
+
const resolved = resolveAction({
|
|
115
|
+
action: 'decide',
|
|
116
|
+
id: 'CREW-05',
|
|
117
|
+
workspace: '/tmp/workspace',
|
|
118
|
+
});
|
|
119
|
+
expect(resolved.action).toBe('decide');
|
|
120
|
+
expect(resolved.persona).toBe('architect');
|
|
121
|
+
expect(resolved.task).toBe('adr-workflow');
|
|
122
|
+
expect(resolved.scope).toBe('CREW-05');
|
|
123
|
+
expect(resolved.epicId).toBe('CREW-05');
|
|
124
|
+
expect(resolved.storyId).toBeUndefined();
|
|
125
|
+
expect(resolved.workspace).toBe('/tmp/workspace');
|
|
126
|
+
});
|
|
127
|
+
it('passes dryRun through', () => {
|
|
128
|
+
const resolved = resolveAction({
|
|
129
|
+
action: 'implement',
|
|
130
|
+
id: 'CREW-03-001',
|
|
131
|
+
workspace: '/tmp/ws',
|
|
132
|
+
dryRun: true,
|
|
133
|
+
});
|
|
134
|
+
expect(resolved.dryRun).toBe(true);
|
|
135
|
+
});
|
|
136
|
+
it('throws UnknownActionError for unregistered actions', () => {
|
|
137
|
+
expect(() => resolveAction({ action: 'deploy', id: 'CREW-01', workspace: '/tmp/ws' })).toThrow(UnknownActionError);
|
|
138
|
+
});
|
|
139
|
+
it('error message lists available actions', () => {
|
|
140
|
+
try {
|
|
141
|
+
resolveAction({ action: 'deploy', id: 'CREW-01', workspace: '/tmp/ws' });
|
|
142
|
+
expect.fail('should have thrown');
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
expect(err).toBeInstanceOf(UnknownActionError);
|
|
146
|
+
expect(err.message).toContain('implement');
|
|
147
|
+
expect(err.message).toContain('review');
|
|
148
|
+
expect(err.message).toContain('address');
|
|
149
|
+
expect(err.message).toContain('decide');
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
describe('ActionDispatcher interface', () => {
|
|
154
|
+
it('DirectDispatcher implements ActionDispatcher', () => {
|
|
155
|
+
const dispatcher = new DirectDispatcher();
|
|
156
|
+
expect(typeof dispatcher.dispatch).toBe('function');
|
|
157
|
+
});
|
|
158
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ActionDispatcher } from './dispatcher.js';
|
|
2
|
+
import type { ResolvedAction, ActionResult } from './resolver.js';
|
|
3
|
+
/**
|
|
4
|
+
* DirectDispatcher calls the execution engine in-process (synchronous).
|
|
5
|
+
* This is the Phase 1 dispatcher per ADR-0013.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DirectDispatcher implements ActionDispatcher {
|
|
8
|
+
dispatch(resolved: ResolvedAction): Promise<ActionResult>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=direct-dispatcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"direct-dispatcher.d.ts","sourceRoot":"","sources":["../../src/actions/direct-dispatcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElE;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,gBAAgB;IACjD,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;CAqBhE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { executeRunCommand } from '../cli/run.js';
|
|
2
|
+
/**
|
|
3
|
+
* DirectDispatcher calls the execution engine in-process (synchronous).
|
|
4
|
+
* This is the Phase 1 dispatcher per ADR-0013.
|
|
5
|
+
*/
|
|
6
|
+
export class DirectDispatcher {
|
|
7
|
+
async dispatch(resolved) {
|
|
8
|
+
const result = await executeRunCommand({
|
|
9
|
+
persona: resolved.persona,
|
|
10
|
+
task: resolved.task,
|
|
11
|
+
scope: resolved.scope,
|
|
12
|
+
workspace: resolved.workspace,
|
|
13
|
+
dryRun: resolved.dryRun,
|
|
14
|
+
storyId: resolved.storyId,
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
runId: result.runId,
|
|
18
|
+
status: result.status,
|
|
19
|
+
artifactPath: result.artifactPath,
|
|
20
|
+
provenancePath: result.provenancePath,
|
|
21
|
+
evaluationScore: result.evaluationScore,
|
|
22
|
+
durationMs: result.durationMs,
|
|
23
|
+
feedbackIteration: result.feedbackIteration,
|
|
24
|
+
escalated: result.escalated,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ResolvedAction, ActionResult } from './resolver.js';
|
|
2
|
+
/**
|
|
3
|
+
* ActionDispatcher interface per ADR-0013.
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: DirectDispatcher calls the execution engine in-process.
|
|
6
|
+
* Phase 2: InngestDispatcher sends events to Inngest for durable workflows.
|
|
7
|
+
*/
|
|
8
|
+
export interface ActionDispatcher {
|
|
9
|
+
dispatch(resolved: ResolvedAction): Promise<ActionResult>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=dispatcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../src/actions/dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElE;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { getAction, listActions, listActionNames } from './registry.js';
|
|
2
|
+
export type { ActionDefinition, ActionTrack, ActionIdLevel } from './registry.js';
|
|
3
|
+
export { resolveAction, parseWorkItemId, UnknownActionError } from './resolver.js';
|
|
4
|
+
export type { ResolvedAction, ActionResult, ResolveOptions } from './resolver.js';
|
|
5
|
+
export type { ActionDispatcher } from './dispatcher.js';
|
|
6
|
+
export { DirectDispatcher } from './direct-dispatcher.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACxE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAElF,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnF,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAElF,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ActionTrack = 'delivery' | 'discovery' | 'architecture' | 'refine';
|
|
2
|
+
export type ActionIdLevel = 'task' | 'epic' | 'sprint';
|
|
3
|
+
export interface ActionDefinition {
|
|
4
|
+
name: string;
|
|
5
|
+
track: ActionTrack;
|
|
6
|
+
idLevel: ActionIdLevel;
|
|
7
|
+
persona: string;
|
|
8
|
+
task: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function getAction(name: string): ActionDefinition | undefined;
|
|
11
|
+
export declare function listActions(): ActionDefinition[];
|
|
12
|
+
export declare function listActionNames(): string[];
|
|
13
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/actions/registry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;AAC/E,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAmCD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAEpE;AAED,wBAAgB,WAAW,IAAI,gBAAgB,EAAE,CAEhD;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAE1C"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const ACTIONS = [
|
|
2
|
+
{
|
|
3
|
+
name: 'implement',
|
|
4
|
+
track: 'delivery',
|
|
5
|
+
idLevel: 'task',
|
|
6
|
+
persona: 'engineer',
|
|
7
|
+
task: 'implement-story',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: 'review',
|
|
11
|
+
track: 'delivery',
|
|
12
|
+
idLevel: 'task',
|
|
13
|
+
persona: 'reviewer',
|
|
14
|
+
task: 'review-pr',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'address',
|
|
18
|
+
track: 'delivery',
|
|
19
|
+
idLevel: 'task',
|
|
20
|
+
persona: 'engineer',
|
|
21
|
+
task: 'address-feedback',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'decide',
|
|
25
|
+
track: 'architecture',
|
|
26
|
+
idLevel: 'epic',
|
|
27
|
+
persona: 'architect',
|
|
28
|
+
task: 'adr-workflow',
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
const actionMap = new Map(ACTIONS.map((a) => [a.name, a]));
|
|
32
|
+
export function getAction(name) {
|
|
33
|
+
return actionMap.get(name);
|
|
34
|
+
}
|
|
35
|
+
export function listActions() {
|
|
36
|
+
return [...ACTIONS];
|
|
37
|
+
}
|
|
38
|
+
export function listActionNames() {
|
|
39
|
+
return ACTIONS.map((a) => a.name);
|
|
40
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { RunStatus } from '../types/index.js';
|
|
2
|
+
export interface ResolvedAction {
|
|
3
|
+
action: string;
|
|
4
|
+
persona: string;
|
|
5
|
+
task: string;
|
|
6
|
+
scope: string;
|
|
7
|
+
workspace: string;
|
|
8
|
+
epicId: string;
|
|
9
|
+
storyId?: string;
|
|
10
|
+
dryRun?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface ActionResult {
|
|
13
|
+
runId: string;
|
|
14
|
+
status: RunStatus;
|
|
15
|
+
artifactPath?: string;
|
|
16
|
+
provenancePath?: string;
|
|
17
|
+
evaluationScore?: number;
|
|
18
|
+
durationMs: number;
|
|
19
|
+
feedbackIteration?: number;
|
|
20
|
+
escalated?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare class UnknownActionError extends Error {
|
|
23
|
+
readonly code: "UNKNOWN_ACTION";
|
|
24
|
+
constructor(action: string);
|
|
25
|
+
}
|
|
26
|
+
export interface ResolveOptions {
|
|
27
|
+
action: string;
|
|
28
|
+
id: string;
|
|
29
|
+
workspace: string;
|
|
30
|
+
dryRun?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Parse a work item ID into epic and optional story components.
|
|
34
|
+
*
|
|
35
|
+
* `CREW-03-001` yields `{ epicId: 'CREW-03', storyId: 'CREW-03-001' }`
|
|
36
|
+
* `CREW-03` yields `{ epicId: 'CREW-03' }`
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseWorkItemId(id: string): {
|
|
39
|
+
epicId: string;
|
|
40
|
+
storyId?: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Resolve a CLI action + ID into a fully-qualified ResolvedAction
|
|
44
|
+
* that the dispatcher can execute.
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveAction(options: ResolveOptions): ResolvedAction;
|
|
47
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/actions/resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGnD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,EAAG,gBAAgB,CAAU;gBAE9B,MAAM,EAAE,MAAM;CAK3B;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAMhF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAkBrE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { getAction, listActionNames } from './registry.js';
|
|
2
|
+
export class UnknownActionError extends Error {
|
|
3
|
+
code = 'UNKNOWN_ACTION';
|
|
4
|
+
constructor(action) {
|
|
5
|
+
const available = listActionNames().join(', ');
|
|
6
|
+
super(`Unknown action '${action}'. Available: ${available}`);
|
|
7
|
+
this.name = 'UnknownActionError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Parse a work item ID into epic and optional story components.
|
|
12
|
+
*
|
|
13
|
+
* `CREW-03-001` yields `{ epicId: 'CREW-03', storyId: 'CREW-03-001' }`
|
|
14
|
+
* `CREW-03` yields `{ epicId: 'CREW-03' }`
|
|
15
|
+
*/
|
|
16
|
+
export function parseWorkItemId(id) {
|
|
17
|
+
const parts = id.split('-');
|
|
18
|
+
if (parts.length >= 3) {
|
|
19
|
+
return { epicId: `${parts[0]}-${parts[1]}`, storyId: id };
|
|
20
|
+
}
|
|
21
|
+
return { epicId: id };
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Resolve a CLI action + ID into a fully-qualified ResolvedAction
|
|
25
|
+
* that the dispatcher can execute.
|
|
26
|
+
*/
|
|
27
|
+
export function resolveAction(options) {
|
|
28
|
+
const definition = getAction(options.action);
|
|
29
|
+
if (!definition) {
|
|
30
|
+
throw new UnknownActionError(options.action);
|
|
31
|
+
}
|
|
32
|
+
const { epicId, storyId } = parseWorkItemId(options.id);
|
|
33
|
+
return {
|
|
34
|
+
action: definition.name,
|
|
35
|
+
persona: definition.persona,
|
|
36
|
+
task: definition.task,
|
|
37
|
+
scope: epicId,
|
|
38
|
+
workspace: options.workspace,
|
|
39
|
+
epicId,
|
|
40
|
+
storyId,
|
|
41
|
+
dryRun: options.dryRun,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.test.d.ts","sourceRoot":"","sources":["../../src/cli/cli.test.ts"],"names":[],"mappings":""}
|