@devflow-tools/sdk 0.4.0 → 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.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/step-templates/index.d.ts +18 -0
- package/dist/step-templates/index.d.ts.map +1 -0
- package/dist/step-templates/index.js +59 -0
- package/dist/step-templates/index.js.map +1 -0
- package/dist/step-templates/report.d.ts +3 -0
- package/dist/step-templates/report.d.ts.map +1 -0
- package/dist/step-templates/report.js +97 -0
- package/dist/step-templates/report.js.map +1 -0
- package/dist/step-templates/scan.d.ts +3 -0
- package/dist/step-templates/scan.d.ts.map +1 -0
- package/dist/step-templates/scan.js +192 -0
- package/dist/step-templates/scan.js.map +1 -0
- package/dist/step-templates/test.d.ts +3 -0
- package/dist/step-templates/test.d.ts.map +1 -0
- package/dist/step-templates/test.js +85 -0
- package/dist/step-templates/test.js.map +1 -0
- package/dist/step-templates/verify.d.ts +3 -0
- package/dist/step-templates/verify.d.ts.map +1 -0
- package/dist/step-templates/verify.js +102 -0
- package/dist/step-templates/verify.js.map +1 -0
- package/dist/types/workflow.d.ts +11 -1
- package/dist/types/workflow.d.ts.map +1 -1
- package/package.json +6 -2
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,cAAc,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { StepInstruction, WorkflowStepRef } from "../types/workflow.js";
|
|
2
|
+
/** Register a shared step template */
|
|
3
|
+
export declare function registerTemplate(template: StepInstruction): void;
|
|
4
|
+
/** Batch register multiple templates */
|
|
5
|
+
export declare function registerTemplates(templates: StepInstruction[]): void;
|
|
6
|
+
/** Get a registered template by name. Throws if not found. */
|
|
7
|
+
export declare function getTemplate(name: string): StepInstruction;
|
|
8
|
+
/** Resolve a WorkflowStepRef into a full StepInstruction by merging template + overrides */
|
|
9
|
+
export declare function resolveStepRef(ref: WorkflowStepRef): StepInstruction;
|
|
10
|
+
/** Override fields of an existing registered template (e.g., plugin domain override) */
|
|
11
|
+
export declare function overrideTemplate(baseName: string, override: Partial<Omit<StepInstruction, "id">>): void;
|
|
12
|
+
/** List all registered template names */
|
|
13
|
+
export declare function listTemplates(): string[];
|
|
14
|
+
/** Check if a template is registered */
|
|
15
|
+
export declare function hasTemplate(name: string): boolean;
|
|
16
|
+
/** Clear all registered templates (for testing) */
|
|
17
|
+
export declare function clearTemplates(): void;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/step-templates/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAQ7E,sCAAsC;AACtC,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAEhE;AAED,wCAAwC;AACxC,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,IAAI,CAIpE;AAED,8DAA8D;AAC9D,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAMzD;AAED,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,eAAe,CAapE;AAED,wFAAwF;AACxF,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,GAC7C,IAAI,CAQN;AAED,yCAAyC;AACzC,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAExC;AAED,wCAAwC;AACxC,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,mDAAmD;AACnD,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { SCAN_TEMPLATES } from "./scan.js";
|
|
2
|
+
import { VERIFY_TEMPLATES } from "./verify.js";
|
|
3
|
+
import { TEST_TEMPLATES } from "./test.js";
|
|
4
|
+
import { REPORT_TEMPLATES } from "./report.js";
|
|
5
|
+
const registry = new Map();
|
|
6
|
+
/** Register a shared step template */
|
|
7
|
+
export function registerTemplate(template) {
|
|
8
|
+
registry.set(template.id, { ...template });
|
|
9
|
+
}
|
|
10
|
+
/** Batch register multiple templates */
|
|
11
|
+
export function registerTemplates(templates) {
|
|
12
|
+
for (const t of templates) {
|
|
13
|
+
registerTemplate(t);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** Get a registered template by name. Throws if not found. */
|
|
17
|
+
export function getTemplate(name) {
|
|
18
|
+
const template = registry.get(name);
|
|
19
|
+
if (!template) {
|
|
20
|
+
throw new Error(`Step template "${name}" not found. Register it first with registerTemplate().`);
|
|
21
|
+
}
|
|
22
|
+
return { ...template };
|
|
23
|
+
}
|
|
24
|
+
/** Resolve a WorkflowStepRef into a full StepInstruction by merging template + overrides */
|
|
25
|
+
export function resolveStepRef(ref) {
|
|
26
|
+
const template = getTemplate(ref.stepTemplate);
|
|
27
|
+
const overrides = ref.overrides ?? {};
|
|
28
|
+
// Strip id from overrides — ref.id always wins
|
|
29
|
+
const { id: _ignoreId, ...safeOverrides } = overrides;
|
|
30
|
+
return {
|
|
31
|
+
...template,
|
|
32
|
+
...safeOverrides,
|
|
33
|
+
id: ref.id,
|
|
34
|
+
depends: ref.depends ?? safeOverrides.depends ?? template.depends,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** Override fields of an existing registered template (e.g., plugin domain override) */
|
|
38
|
+
export function overrideTemplate(baseName, override) {
|
|
39
|
+
const existing = registry.get(baseName);
|
|
40
|
+
if (!existing) {
|
|
41
|
+
throw new Error(`Step template "${baseName}" not found. Cannot override a non-existent template.`);
|
|
42
|
+
}
|
|
43
|
+
registry.set(baseName, { ...existing, ...override });
|
|
44
|
+
}
|
|
45
|
+
/** List all registered template names */
|
|
46
|
+
export function listTemplates() {
|
|
47
|
+
return Array.from(registry.keys());
|
|
48
|
+
}
|
|
49
|
+
/** Check if a template is registered */
|
|
50
|
+
export function hasTemplate(name) {
|
|
51
|
+
return registry.has(name);
|
|
52
|
+
}
|
|
53
|
+
/** Clear all registered templates (for testing) */
|
|
54
|
+
export function clearTemplates() {
|
|
55
|
+
registry.clear();
|
|
56
|
+
}
|
|
57
|
+
// Auto-register all built-in shared templates
|
|
58
|
+
registerTemplates([...SCAN_TEMPLATES, ...VERIFY_TEMPLATES, ...TEST_TEMPLATES, ...REPORT_TEMPLATES]);
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/step-templates/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,QAAQ,GAAG,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,CAAC,CAAC;IACxC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CACb,kBAAkB,QAAQ,uDAAuD,CAClF,CAAC;IACJ,CAAC;IACD,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;AACvD,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,aAAa;IAC3B,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACrC,CAAC;AAED,wCAAwC;AACxC,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,cAAc;IAC5B,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC;AAED,8CAA8C;AAC9C,iBAAiB,CAAC,CAAC,GAAG,cAAc,EAAE,GAAG,gBAAgB,EAAE,GAAG,cAAc,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/step-templates/report.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,eAAO,MAAM,gBAAgB,EAAE,eAAe,EA+F7C,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export const REPORT_TEMPLATES = [
|
|
2
|
+
{
|
|
3
|
+
id: "generate-report",
|
|
4
|
+
title: "Generate review report",
|
|
5
|
+
instruction: [
|
|
6
|
+
"## Generate Review Report",
|
|
7
|
+
"",
|
|
8
|
+
"Consolidate all findings into a structured report with severity levels.",
|
|
9
|
+
"",
|
|
10
|
+
"**Report format:**",
|
|
11
|
+
"```markdown",
|
|
12
|
+
"## Review Report",
|
|
13
|
+
"",
|
|
14
|
+
"### Critical (must fix)",
|
|
15
|
+
"| File | Line | Issue | Description |",
|
|
16
|
+
"|------|------|-------|-------------|",
|
|
17
|
+
"",
|
|
18
|
+
"### Warning (should fix)",
|
|
19
|
+
"| File | Line | Issue | Description |",
|
|
20
|
+
"|------|------|-------|-------------|",
|
|
21
|
+
"",
|
|
22
|
+
"### Suggestion (optional)",
|
|
23
|
+
"| File | Line | Issue | Description |",
|
|
24
|
+
"|------|------|-------|-------------|",
|
|
25
|
+
"",
|
|
26
|
+
"### Summary",
|
|
27
|
+
"- Critical: N",
|
|
28
|
+
"- Warning: N",
|
|
29
|
+
"- Suggestion: N",
|
|
30
|
+
"```",
|
|
31
|
+
].join("\n"),
|
|
32
|
+
suggestedTools: ["Read"],
|
|
33
|
+
output: "Structured review report with severity levels",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "generate-fix",
|
|
37
|
+
title: "Generate fix plan",
|
|
38
|
+
instruction: [
|
|
39
|
+
"## Generate Fix Plan",
|
|
40
|
+
"",
|
|
41
|
+
"**Principles:**",
|
|
42
|
+
"1. **Minimal change** — only modify what must change",
|
|
43
|
+
"2. **Type safe** — no `any` or `@ts-ignore`",
|
|
44
|
+
"3. **Backward compatible** — don't break downstream consumers",
|
|
45
|
+
"",
|
|
46
|
+
"**Output format:**",
|
|
47
|
+
"```",
|
|
48
|
+
"fix_summary: <one-line summary>",
|
|
49
|
+
"files_changed: [{ path, changes }]",
|
|
50
|
+
"diff_preview: <key diff snippet>",
|
|
51
|
+
"```",
|
|
52
|
+
].join("\n"),
|
|
53
|
+
suggestedTools: ["Read", "Edit"],
|
|
54
|
+
output: "Fix plan with minimal diff",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "human-review",
|
|
58
|
+
title: "Wait for human review",
|
|
59
|
+
instruction: [
|
|
60
|
+
"## Human Review",
|
|
61
|
+
"",
|
|
62
|
+
"Present all changes to the user and wait for explicit confirmation.",
|
|
63
|
+
"",
|
|
64
|
+
"**Show:**",
|
|
65
|
+
"1. Summary of what was found / changed",
|
|
66
|
+
"2. Each diff with explanation",
|
|
67
|
+
"3. Risk assessment (low/medium/high)",
|
|
68
|
+
"",
|
|
69
|
+
"**Wait for user to:** approve / reject / request changes",
|
|
70
|
+
].join("\n"),
|
|
71
|
+
suggestedTools: ["Read"],
|
|
72
|
+
output: "User decision (approved/rejected/needs-changes)",
|
|
73
|
+
requiresUserConfirmation: true,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "git-commit",
|
|
77
|
+
title: "Create git commit",
|
|
78
|
+
instruction: [
|
|
79
|
+
"## Create Git Commit",
|
|
80
|
+
"",
|
|
81
|
+
"**Steps:**",
|
|
82
|
+
"1. `git status` — review changes",
|
|
83
|
+
"2. `git diff` — review diff",
|
|
84
|
+
"3. Stage relevant files",
|
|
85
|
+
"4. Generate conventional commit message:",
|
|
86
|
+
" - `feat:` for new features",
|
|
87
|
+
" - `fix:` for bug fixes",
|
|
88
|
+
" - `refactor:` for refactoring",
|
|
89
|
+
" - `docs:` for documentation",
|
|
90
|
+
" - `test:` for tests",
|
|
91
|
+
"5. `git commit -m \"<message>\"`",
|
|
92
|
+
].join("\n"),
|
|
93
|
+
suggestedTools: ["Bash"],
|
|
94
|
+
output: "Commit hash and message",
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/step-templates/report.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD;QACE,EAAE,EAAE,iBAAiB;QACrB,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE;YACX,2BAA2B;YAC3B,EAAE;YACF,yEAAyE;YACzE,EAAE;YACF,oBAAoB;YACpB,aAAa;YACb,kBAAkB;YAClB,EAAE;YACF,yBAAyB;YACzB,uCAAuC;YACvC,uCAAuC;YACvC,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AAkC;SACnC,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,cAAc,EAAE,CAAC,MAAM,CAAC;QACxB,MAAM,EAAE,yBAAyB;KAClC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../src/step-templates/scan.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,eAAO,MAAM,cAAc,EAAE,eAAe,EA8L3C,CAAC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
export const SCAN_TEMPLATES = [
|
|
2
|
+
{
|
|
3
|
+
id: "scan-files",
|
|
4
|
+
title: "Scan all source files",
|
|
5
|
+
instruction: [
|
|
6
|
+
"## Scan All Source Files",
|
|
7
|
+
"",
|
|
8
|
+
"List all source files in the project to understand the codebase structure.",
|
|
9
|
+
"",
|
|
10
|
+
"**Commands:**",
|
|
11
|
+
"```bash",
|
|
12
|
+
"# Find all source files",
|
|
13
|
+
"find src/ -type f \\( -name '*.tsx' -o -name '*.ts' -o -name '*.jsx' -o -name '*.js' \\) | head -200",
|
|
14
|
+
"",
|
|
15
|
+
"# Count files by directory",
|
|
16
|
+
"find src/ -type f \\( -name '*.tsx' -o -name '*.ts' \\) | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn",
|
|
17
|
+
"```",
|
|
18
|
+
"",
|
|
19
|
+
"**Output format:**",
|
|
20
|
+
"```",
|
|
21
|
+
"total_files: <N>",
|
|
22
|
+
"files_by_dir: { 'src/pages/xxx': N, 'src/components/xxx': N, ... }",
|
|
23
|
+
"```",
|
|
24
|
+
].join("\n"),
|
|
25
|
+
suggestedTools: ["Bash"],
|
|
26
|
+
output: "File inventory with directory distribution",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "scan-hooks",
|
|
30
|
+
title: "Scan all Hooks usage",
|
|
31
|
+
instruction: [
|
|
32
|
+
"## Scan All Hooks Usage",
|
|
33
|
+
"",
|
|
34
|
+
"Find every Hooks call in the project (React built-in + custom hooks).",
|
|
35
|
+
"",
|
|
36
|
+
"**Commands:**",
|
|
37
|
+
"```bash",
|
|
38
|
+
"# Search all React built-in hooks",
|
|
39
|
+
"grep -rn 'useState\\|useEffect\\|useMemo\\|useCallback\\|useRef\\|useContext\\|useReducer\\|useLayoutEffect' src/ --include='*.tsx' --include='*.ts'",
|
|
40
|
+
"",
|
|
41
|
+
"# Search custom hooks (use[A-Z] pattern)",
|
|
42
|
+
"grep -rn 'use[A-Z][a-zA-Z]*\\s*(' src/ --include='*.tsx' --include='*.ts' | grep -v node_modules",
|
|
43
|
+
"",
|
|
44
|
+
"# Count by directory",
|
|
45
|
+
"grep -rl 'use[A-Z]' src/ --include='*.tsx' --include='*.ts' | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn",
|
|
46
|
+
"```",
|
|
47
|
+
"",
|
|
48
|
+
"**Output format:**",
|
|
49
|
+
"```",
|
|
50
|
+
"total_files_with_hooks: <N>",
|
|
51
|
+
"custom_hooks: [list of custom hook names]",
|
|
52
|
+
"hooks_by_dir: { ... }",
|
|
53
|
+
"```",
|
|
54
|
+
].join("\n"),
|
|
55
|
+
suggestedTools: ["Bash", "Read"],
|
|
56
|
+
output: "Complete hooks usage inventory",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "scan-components",
|
|
60
|
+
title: "Scan all component files",
|
|
61
|
+
instruction: [
|
|
62
|
+
"## Scan All Component Files",
|
|
63
|
+
"",
|
|
64
|
+
"Find all React component files in the project.",
|
|
65
|
+
"",
|
|
66
|
+
"**Commands:**",
|
|
67
|
+
"```bash",
|
|
68
|
+
"# Find exported components",
|
|
69
|
+
"find src/ -name '*.tsx' -exec grep -l 'export default\\|export function\\|export const' {} \\;",
|
|
70
|
+
"",
|
|
71
|
+
"# Find component directories",
|
|
72
|
+
"find src/components/ -type d 2>/dev/null",
|
|
73
|
+
"",
|
|
74
|
+
"# List all components with their export type",
|
|
75
|
+
"grep -rn 'export default function\\|export function\\|export const.*= .*(' src/ --include='*.tsx' | head -50",
|
|
76
|
+
"```",
|
|
77
|
+
"",
|
|
78
|
+
"**Output format:**",
|
|
79
|
+
"```",
|
|
80
|
+
"total_components: <N>",
|
|
81
|
+
"component_dirs: [list of directories containing components]",
|
|
82
|
+
"```",
|
|
83
|
+
].join("\n"),
|
|
84
|
+
suggestedTools: ["Bash", "Read"],
|
|
85
|
+
output: "Component file inventory",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "scan-resolvers",
|
|
89
|
+
title: "Scan all GraphQL resolvers",
|
|
90
|
+
instruction: [
|
|
91
|
+
"## Scan All GraphQL Resolvers",
|
|
92
|
+
"",
|
|
93
|
+
"Find all resolver definitions, Query/Mutation/Subscription types.",
|
|
94
|
+
"",
|
|
95
|
+
"**Commands:**",
|
|
96
|
+
"```bash",
|
|
97
|
+
"grep -rn 'Query\\|Mutation\\|Subscription\\|@Resolver\\|@Query\\|@Mutation' src/ --include='*.ts' | head -50",
|
|
98
|
+
"",
|
|
99
|
+
"# Find resolver files",
|
|
100
|
+
"find src/ -name '*.resolver.ts' -o -name '*.resolver.spec.ts'",
|
|
101
|
+
"```",
|
|
102
|
+
"",
|
|
103
|
+
"**Output format:**",
|
|
104
|
+
"```",
|
|
105
|
+
"total_resolvers: <N>",
|
|
106
|
+
"resolver_files: [list]",
|
|
107
|
+
"```",
|
|
108
|
+
].join("\n"),
|
|
109
|
+
suggestedTools: ["Bash", "Read"],
|
|
110
|
+
output: "GraphQL resolver inventory",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: "scan-routes",
|
|
114
|
+
title: "Scan all route definitions",
|
|
115
|
+
instruction: [
|
|
116
|
+
"## Scan All Route Definitions",
|
|
117
|
+
"",
|
|
118
|
+
"Find all route/page definitions in the project.",
|
|
119
|
+
"",
|
|
120
|
+
"**Commands:**",
|
|
121
|
+
"```bash",
|
|
122
|
+
"# List all page directories",
|
|
123
|
+
"find src/pages/ -type d 2>/dev/null || echo 'No src/pages/'",
|
|
124
|
+
"",
|
|
125
|
+
"# List all route files",
|
|
126
|
+
"find src/routes/ -type f 2>/dev/null || echo 'No src/routes/'",
|
|
127
|
+
"",
|
|
128
|
+
"# Find route configuration files",
|
|
129
|
+
"grep -rn 'Route\\|path:' src/ --include='*.tsx' --include='*.ts' | grep -v node_modules | head -30",
|
|
130
|
+
"```",
|
|
131
|
+
"",
|
|
132
|
+
"**Output format:**",
|
|
133
|
+
"```",
|
|
134
|
+
"page_dirs: [list of all page directories]",
|
|
135
|
+
"route_files: [list]",
|
|
136
|
+
"```",
|
|
137
|
+
].join("\n"),
|
|
138
|
+
suggestedTools: ["Bash", "Read"],
|
|
139
|
+
output: "Route/page directory inventory",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: "scan-styles",
|
|
143
|
+
title: "Scan all style files",
|
|
144
|
+
instruction: [
|
|
145
|
+
"## Scan All Style Files",
|
|
146
|
+
"",
|
|
147
|
+
"Find all CSS/SCSS/style files in the project.",
|
|
148
|
+
"",
|
|
149
|
+
"**Commands:**",
|
|
150
|
+
"```bash",
|
|
151
|
+
"find src/ -name '*.css' -o -name '*.scss' -o -name '*.less' -o -name '*.module.css' | head -50",
|
|
152
|
+
"",
|
|
153
|
+
"# Find inline styles (potential issues)",
|
|
154
|
+
"grep -rn 'style={{' src/ --include='*.tsx' | head -20",
|
|
155
|
+
"```",
|
|
156
|
+
"",
|
|
157
|
+
"**Output format:**",
|
|
158
|
+
"```",
|
|
159
|
+
"style_files: [list]",
|
|
160
|
+
"inline_styles_count: <N>",
|
|
161
|
+
"```",
|
|
162
|
+
].join("\n"),
|
|
163
|
+
suggestedTools: ["Bash"],
|
|
164
|
+
output: "Style file inventory",
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: "scan-tests",
|
|
168
|
+
title: "Scan all test files",
|
|
169
|
+
instruction: [
|
|
170
|
+
"## Scan All Test Files",
|
|
171
|
+
"",
|
|
172
|
+
"Find all test/spec files in the project.",
|
|
173
|
+
"",
|
|
174
|
+
"**Commands:**",
|
|
175
|
+
"```bash",
|
|
176
|
+
"find src/ -name '*.test.*' -o -name '*.spec.*' | head -50",
|
|
177
|
+
"",
|
|
178
|
+
"# Count test files by directory",
|
|
179
|
+
"find src/ \\( -name '*.test.*' -o -name '*.spec.*' \\) | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn",
|
|
180
|
+
"```",
|
|
181
|
+
"",
|
|
182
|
+
"**Output format:**",
|
|
183
|
+
"```",
|
|
184
|
+
"total_test_files: <N>",
|
|
185
|
+
"tests_by_dir: { ... }",
|
|
186
|
+
"```",
|
|
187
|
+
].join("\n"),
|
|
188
|
+
suggestedTools: ["Bash"],
|
|
189
|
+
output: "Test file inventory",
|
|
190
|
+
},
|
|
191
|
+
];
|
|
192
|
+
//# sourceMappingURL=scan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../../src/step-templates/scan.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC/C;QACE,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EAAE;YACX,0BAA0B;YAC1B,EAAE;YACF,4EAA4E;YAC5E,EAAE;YACF,eAAe;YACf,SAAS;YACT,yBAAyB;YACzB,sGAAsG;YACtG,EAAE;YACF,4BAA4B;YAC5B,yGAAyG;YACzG,KAAK;YACL,EAAE;YACF,oBAAoB;YACpB,KAAK;YACL,kBAAkB;YAClB,oEAAoE;YACpE,KAAK;SACN,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,cAAc,EAAE,CAAC,MAAM,CAAC;QACxB,MAAM,EAAE,4CAA4C;KACrD;IACD;QACE,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE;YACX,yBAAyB;YACzB,EAAE;YACF,uEAAuE;YAC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AE,qBAAqB;KAC9B;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/step-templates/test.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,eAAO,MAAM,cAAc,EAAE,eAAe,EAmF3C,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export const TEST_TEMPLATES = [
|
|
2
|
+
{
|
|
3
|
+
id: "run-tests",
|
|
4
|
+
title: "Run all tests",
|
|
5
|
+
instruction: [
|
|
6
|
+
"## Run All Tests",
|
|
7
|
+
"",
|
|
8
|
+
"**Commands:**",
|
|
9
|
+
"```bash",
|
|
10
|
+
"npm test 2>&1",
|
|
11
|
+
"```",
|
|
12
|
+
"",
|
|
13
|
+
"**Analyze:**",
|
|
14
|
+
"1. Total tests run / passed / failed / skipped",
|
|
15
|
+
"2. If failures: list failed test names and error messages",
|
|
16
|
+
"3. Coverage delta if available",
|
|
17
|
+
"",
|
|
18
|
+
"**Output format:**",
|
|
19
|
+
"```",
|
|
20
|
+
"test_result: passed | failed",
|
|
21
|
+
"tests_run: <N>",
|
|
22
|
+
"tests_passed: <N>",
|
|
23
|
+
"tests_failed: <N>",
|
|
24
|
+
"failed_tests: [{ name, error }]",
|
|
25
|
+
"```",
|
|
26
|
+
].join("\n"),
|
|
27
|
+
suggestedTools: ["Bash"],
|
|
28
|
+
output: "Test results with pass/fail counts",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "run-related-tests",
|
|
32
|
+
title: "Run tests related to changed files",
|
|
33
|
+
instruction: [
|
|
34
|
+
"## Run Related Tests",
|
|
35
|
+
"",
|
|
36
|
+
"Find and run test files related to recently modified files.",
|
|
37
|
+
"",
|
|
38
|
+
"**Commands:**",
|
|
39
|
+
"```bash",
|
|
40
|
+
"# Find changed files (git)",
|
|
41
|
+
"git diff --name-only HEAD~1 2>/dev/null || git diff --name-only",
|
|
42
|
+
"",
|
|
43
|
+
"# For each changed file, find its test file",
|
|
44
|
+
"# e.g., src/components/Button.tsx → src/components/__tests__/Button.test.tsx",
|
|
45
|
+
"# or src/components/Button.test.tsx",
|
|
46
|
+
"",
|
|
47
|
+
"# Run found test files",
|
|
48
|
+
"npx vitest run <test-file-1> <test-file-2> ... 2>&1",
|
|
49
|
+
"```",
|
|
50
|
+
"",
|
|
51
|
+
"**Output format:**",
|
|
52
|
+
"```",
|
|
53
|
+
"changed_files: [list]",
|
|
54
|
+
"related_tests: [list]",
|
|
55
|
+
"test_result: passed | failed",
|
|
56
|
+
"```",
|
|
57
|
+
].join("\n"),
|
|
58
|
+
suggestedTools: ["Bash"],
|
|
59
|
+
output: "Related test results",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "run-e2e",
|
|
63
|
+
title: "Run E2E tests",
|
|
64
|
+
instruction: [
|
|
65
|
+
"## Run E2E Tests",
|
|
66
|
+
"",
|
|
67
|
+
"**Commands:**",
|
|
68
|
+
"```bash",
|
|
69
|
+
"# Try Playwright first, then Cypress",
|
|
70
|
+
"npx playwright test 2>&1 || npx cypress run 2>&1",
|
|
71
|
+
"```",
|
|
72
|
+
"",
|
|
73
|
+
"**Output format:**",
|
|
74
|
+
"```",
|
|
75
|
+
"e2e_result: passed | failed",
|
|
76
|
+
"tests_run: <N>",
|
|
77
|
+
"tests_passed: <N>",
|
|
78
|
+
"tests_failed: <N>",
|
|
79
|
+
"```",
|
|
80
|
+
].join("\n"),
|
|
81
|
+
suggestedTools: ["Bash"],
|
|
82
|
+
output: "E2E test results",
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
//# sourceMappingURL=test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../src/step-templates/test.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC/C;QACE,EAAE,EAAE,WA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AAE,kBAAkB;KAC3B;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/step-templates/verify.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,eAAO,MAAM,gBAAgB,EAAE,eAAe,EAoG7C,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export const VERIFY_TEMPLATES = [
|
|
2
|
+
{
|
|
3
|
+
id: "type-check",
|
|
4
|
+
title: "Run TypeScript type check",
|
|
5
|
+
instruction: [
|
|
6
|
+
"## Run TypeScript Type Check",
|
|
7
|
+
"",
|
|
8
|
+
"**Commands:**",
|
|
9
|
+
"```bash",
|
|
10
|
+
"npx tsc --noEmit",
|
|
11
|
+
"```",
|
|
12
|
+
"",
|
|
13
|
+
"**If errors found:**",
|
|
14
|
+
"1. List all errors with file:line",
|
|
15
|
+
"2. Categorize by severity (error vs warning)",
|
|
16
|
+
"3. Return error list for fixing",
|
|
17
|
+
"",
|
|
18
|
+
"**Output format:**",
|
|
19
|
+
"```",
|
|
20
|
+
"type_check: passed | failed",
|
|
21
|
+
"errors_count: <N>",
|
|
22
|
+
"errors: [{ file, line, message }]",
|
|
23
|
+
"```",
|
|
24
|
+
].join("\n"),
|
|
25
|
+
suggestedTools: ["Bash"],
|
|
26
|
+
output: "Type check result (passed/failed) with error list",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "lint-check",
|
|
30
|
+
title: "Run ESLint check",
|
|
31
|
+
instruction: [
|
|
32
|
+
"## Run ESLint Check",
|
|
33
|
+
"",
|
|
34
|
+
"**Commands:**",
|
|
35
|
+
"```bash",
|
|
36
|
+
"npx eslint src/ --ext .tsx,.ts,.jsx,.js",
|
|
37
|
+
"```",
|
|
38
|
+
"",
|
|
39
|
+
"**Output format:**",
|
|
40
|
+
"```",
|
|
41
|
+
"lint: passed | failed",
|
|
42
|
+
"errors: <N>",
|
|
43
|
+
"warnings: <N>",
|
|
44
|
+
"issues: [{ file, line, rule, severity, message }]",
|
|
45
|
+
"```",
|
|
46
|
+
].join("\n"),
|
|
47
|
+
suggestedTools: ["Bash"],
|
|
48
|
+
output: "Lint result with issues list",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "build-verify",
|
|
52
|
+
title: "Verify project builds successfully",
|
|
53
|
+
instruction: [
|
|
54
|
+
"## Verify Build",
|
|
55
|
+
"",
|
|
56
|
+
"**Commands:**",
|
|
57
|
+
"```bash",
|
|
58
|
+
"npm run build 2>&1",
|
|
59
|
+
"```",
|
|
60
|
+
"",
|
|
61
|
+
"**Check:**",
|
|
62
|
+
"1. Build exits with code 0",
|
|
63
|
+
"2. No TypeScript errors",
|
|
64
|
+
"3. No bundler errors",
|
|
65
|
+
"",
|
|
66
|
+
"**Output format:**",
|
|
67
|
+
"```",
|
|
68
|
+
"build: passed | failed",
|
|
69
|
+
"output_size: <size>",
|
|
70
|
+
"errors: []",
|
|
71
|
+
"```",
|
|
72
|
+
].join("\n"),
|
|
73
|
+
suggestedTools: ["Bash"],
|
|
74
|
+
output: "Build result (passed/failed)",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "dep-check",
|
|
78
|
+
title: "Check dependency health",
|
|
79
|
+
instruction: [
|
|
80
|
+
"## Check Dependencies",
|
|
81
|
+
"",
|
|
82
|
+
"**Commands:**",
|
|
83
|
+
"```bash",
|
|
84
|
+
"# Check for missing dependencies",
|
|
85
|
+
"npm ls --depth=0 2>&1 | grep -i 'missing\\|invalid\\|deduped'",
|
|
86
|
+
"",
|
|
87
|
+
"# Check for unused dependencies (if depcheck available)",
|
|
88
|
+
"npx depcheck 2>/dev/null || echo 'depcheck not available'",
|
|
89
|
+
"```",
|
|
90
|
+
"",
|
|
91
|
+
"**Output format:**",
|
|
92
|
+
"```",
|
|
93
|
+
"missing_deps: []",
|
|
94
|
+
"unused_deps: []",
|
|
95
|
+
"status: healthy | issues_found",
|
|
96
|
+
"```",
|
|
97
|
+
].join("\n"),
|
|
98
|
+
suggestedTools: ["Bash"],
|
|
99
|
+
output: "Dependency health report",
|
|
100
|
+
},
|
|
101
|
+
];
|
|
102
|
+
//# sourceMappingURL=verify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/step-templates/verify.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD;QACE,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,2BAA2B;QAClC,WAAW,EAAE;YACX,8BAA8B;YAC9B,EAAE;YACF,eAAe;YACf,SAAS;YACT,kBAAkB;YAClB,KAAK;YACL,EAAE;YACF,sBAAsB;YACtB,mCAAmC;YACnC,8CAA8C;YAC9C,iCAAiC;YACjC,EAAE;YACF,oBAAoB;YACpB,KAAK;YACL,6BAA6B;YAC7B,mBAAmB;YACnB,mCAAmC;YACnC,KAAK;SACN,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,cAAc,EAAE,CAAC,MAAM,CAAC;QACxB,MAAM,EAAE,mDAAmD;KAC5D;IACD;QACE,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE;YACX,qBAAqB;YACrB,EAAE;YACF,eAAe;YACf,SAAS;YACT,yCAAyC;YACzC,KAAK;YACL,EAAE;YACF,oBAAoB;YACpB,KAAK;YACL,uBAAuB;YACvB,aAAa;YACb,eAAe;YACf,mDAAmD;YACnD,KAAK;SACN,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,cAAc,EAAE,CAAC,MAAM,CAAC;QACxB,MAAM,EAAE,8BAA8B;KACvC;IACD;QACE,EAAE,EAAE,cAAc;QAClB,KAAK,EAAE,oCAAoC;QAC3C,WAAW,EAAE;YACX,iBAAiB;YACjB,EAAE;YACF,eAAe;YACf,SAAS;YACT,oBAAoB;YACpB,KAAK;YACL,EAAE;YACF,YAAY;YACZ,4BAA4B;YAC5B,yBAAyB;YACzB,sBAAsB;YACtB,EAAE;YACF,oBAAoB;YACpB,KAAK;YACL,wBAAwB;YACxB,qBAAqB;YACrB,YAAY;YACZ,KAAK;SACN,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,cAAc,EAAE,CAAC,MAAM,CAAC;QACxB,MAAM,EAAE,8BAA8B;KACvC;IACD;QACE,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE;YACX,uBAAuB;YACvB,EAAE;YACF,eAAe;YACf,SAAS;YACT,kCAAkC;YAClC,+DAA+D;YAC/D,EAAE;YACF,yDAAyD;YACzD,2DAA2D;YAC3D,KAAK;YACL,EAAE;YACF,oBAAoB;YACpB,KAAK;YACL,kBAAkB;YAClB,iBAAiB;YACjB,gCAAgC;YAChC,KAAK;SACN,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,cAAc,EAAE,CAAC,MAAM,CAAC;QACxB,MAAM,EAAE,0BAA0B;KACnC;CACF,CAAC"}
|
package/dist/types/workflow.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
export interface WorkflowStepRef {
|
|
2
|
+
/** Step ID (unique within the workflow) */
|
|
3
|
+
id: string;
|
|
4
|
+
/** Referenced shared template name */
|
|
5
|
+
stepTemplate: string;
|
|
6
|
+
/** Field-level overrides (merged onto template) */
|
|
7
|
+
overrides?: Partial<Omit<StepInstruction, "id">>;
|
|
8
|
+
/** Dependencies on other step IDs */
|
|
9
|
+
depends?: string[];
|
|
10
|
+
}
|
|
1
11
|
export interface WorkflowDefinition {
|
|
2
12
|
name: string;
|
|
3
13
|
description: string;
|
|
4
14
|
version: string;
|
|
5
|
-
steps: Array<WorkflowStepDef |
|
|
15
|
+
steps: Array<StepInstruction | WorkflowStepDef | WorkflowStepRef>;
|
|
6
16
|
triggers: WorkflowTrigger[];
|
|
7
17
|
}
|
|
8
18
|
export interface WorkflowStepDef {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/types/workflow.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/types/workflow.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,sCAAsC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC;IACjD,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC,eAAe,GAAG,eAAe,GAAG,eAAe,CAAC,CAAC;IAClE,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,W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,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACzE;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAE9B,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IAGd,WAAW,EAAE,MAAM,CAAC;IAGpB,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAG1B,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAGzB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAGnB,sEAAsE;IACtE,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devflow-tools/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
".": {
|
|
9
9
|
"import": "./dist/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"./step-templates": {
|
|
13
|
+
"import": "./dist/step-templates/index.js",
|
|
14
|
+
"types": "./dist/step-templates/index.d.ts"
|
|
11
15
|
}
|
|
12
16
|
},
|
|
13
17
|
"scripts": {
|
|
@@ -26,5 +30,5 @@
|
|
|
26
30
|
"files": [
|
|
27
31
|
"dist"
|
|
28
32
|
],
|
|
29
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "431c0f26e14d476c08d543ef5cd65367413dbc98"
|
|
30
34
|
}
|