@synergenius/flowweaver-pack-weaver 0.3.1 → 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/bot/dashboard.d.ts +3 -0
- package/dist/bot/dashboard.d.ts.map +1 -1
- package/dist/bot/dashboard.js +141 -0
- package/dist/bot/dashboard.js.map +1 -1
- package/dist/bot/index.d.ts +8 -1
- package/dist/bot/index.d.ts.map +1 -1
- package/dist/bot/index.js +5 -0
- package/dist/bot/index.js.map +1 -1
- package/dist/bot/notifications.d.ts.map +1 -1
- package/dist/bot/notifications.js +18 -0
- package/dist/bot/notifications.js.map +1 -1
- package/dist/bot/session-state.d.ts +19 -0
- package/dist/bot/session-state.d.ts.map +1 -0
- package/dist/bot/session-state.js +56 -0
- package/dist/bot/session-state.js.map +1 -0
- package/dist/bot/steering.d.ts +13 -0
- package/dist/bot/steering.d.ts.map +1 -0
- package/dist/bot/steering.js +35 -0
- package/dist/bot/steering.js.map +1 -0
- package/dist/bot/system-prompt.d.ts +1 -0
- package/dist/bot/system-prompt.d.ts.map +1 -1
- package/dist/bot/system-prompt.js +55 -0
- package/dist/bot/system-prompt.js.map +1 -1
- package/dist/bot/task-queue.d.ts +26 -0
- package/dist/bot/task-queue.d.ts.map +1 -0
- package/dist/bot/task-queue.js +87 -0
- package/dist/bot/task-queue.js.map +1 -0
- package/dist/bot/types.d.ts +37 -1
- package/dist/bot/types.d.ts.map +1 -1
- package/dist/cli-bridge.d.ts +2 -0
- package/dist/cli-bridge.d.ts.map +1 -0
- package/dist/cli-bridge.js +31 -0
- package/dist/cli-bridge.js.map +1 -0
- package/dist/cli-handlers.d.ts +50 -0
- package/dist/cli-handlers.d.ts.map +1 -0
- package/dist/{cli.js → cli-handlers.js} +413 -181
- package/dist/cli-handlers.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-tools.d.ts +13 -0
- package/dist/mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools.js +175 -0
- package/dist/mcp-tools.js.map +1 -0
- package/dist/node-types/abort-task.d.ts +22 -0
- package/dist/node-types/abort-task.d.ts.map +1 -0
- package/dist/node-types/abort-task.js +33 -0
- package/dist/node-types/abort-task.js.map +1 -0
- package/dist/node-types/approval-gate.d.ts +35 -0
- package/dist/node-types/approval-gate.d.ts.map +1 -0
- package/dist/node-types/approval-gate.js +62 -0
- package/dist/node-types/approval-gate.js.map +1 -0
- package/dist/node-types/bot-report.d.ts +22 -0
- package/dist/node-types/bot-report.d.ts.map +1 -0
- package/dist/node-types/bot-report.js +63 -0
- package/dist/node-types/bot-report.js.map +1 -0
- package/dist/node-types/build-context.d.ts +29 -0
- package/dist/node-types/build-context.d.ts.map +1 -0
- package/dist/node-types/build-context.js +73 -0
- package/dist/node-types/build-context.js.map +1 -0
- package/dist/node-types/detect-provider.d.ts +20 -0
- package/dist/node-types/detect-provider.d.ts.map +1 -0
- package/dist/node-types/detect-provider.js +72 -0
- package/dist/node-types/detect-provider.js.map +1 -0
- package/dist/node-types/exec-validate-retry.d.ts +38 -0
- package/dist/node-types/exec-validate-retry.d.ts.map +1 -0
- package/dist/node-types/exec-validate-retry.js +250 -0
- package/dist/node-types/exec-validate-retry.js.map +1 -0
- package/dist/node-types/execute-plan.d.ts +34 -0
- package/dist/node-types/execute-plan.d.ts.map +1 -0
- package/dist/node-types/execute-plan.js +175 -0
- package/dist/node-types/execute-plan.js.map +1 -0
- package/dist/node-types/execute-target.d.ts +26 -0
- package/dist/node-types/execute-target.d.ts.map +1 -0
- package/dist/node-types/execute-target.js +312 -0
- package/dist/node-types/execute-target.js.map +1 -0
- package/dist/node-types/fix-errors.d.ts +32 -0
- package/dist/node-types/fix-errors.d.ts.map +1 -0
- package/dist/node-types/fix-errors.js +106 -0
- package/dist/node-types/fix-errors.js.map +1 -0
- package/dist/node-types/git-ops.d.ts +18 -0
- package/dist/node-types/git-ops.d.ts.map +1 -0
- package/dist/node-types/git-ops.js +65 -0
- package/dist/node-types/git-ops.js.map +1 -0
- package/dist/node-types/index.d.ts +20 -0
- package/dist/node-types/index.d.ts.map +1 -0
- package/dist/node-types/index.js +20 -0
- package/dist/node-types/index.js.map +1 -0
- package/dist/node-types/load-config.d.ts +15 -0
- package/dist/node-types/load-config.d.ts.map +1 -0
- package/dist/node-types/load-config.js +26 -0
- package/dist/node-types/load-config.js.map +1 -0
- package/dist/node-types/plan-task.d.ts +32 -0
- package/dist/node-types/plan-task.d.ts.map +1 -0
- package/dist/node-types/plan-task.js +122 -0
- package/dist/node-types/plan-task.js.map +1 -0
- package/dist/node-types/read-workflow.d.ts +30 -0
- package/dist/node-types/read-workflow.d.ts.map +1 -0
- package/dist/node-types/read-workflow.js +72 -0
- package/dist/node-types/read-workflow.js.map +1 -0
- package/dist/node-types/receive-task.d.ts +31 -0
- package/dist/node-types/receive-task.d.ts.map +1 -0
- package/dist/node-types/receive-task.js +72 -0
- package/dist/node-types/receive-task.js.map +1 -0
- package/dist/node-types/report.d.ts +15 -0
- package/dist/node-types/report.d.ts.map +1 -0
- package/dist/node-types/report.js +25 -0
- package/dist/node-types/report.js.map +1 -0
- package/dist/node-types/resolve-target.d.ts +24 -0
- package/dist/node-types/resolve-target.d.ts.map +1 -0
- package/dist/node-types/resolve-target.js +67 -0
- package/dist/node-types/resolve-target.js.map +1 -0
- package/dist/node-types/route-task.d.ts +26 -0
- package/dist/node-types/route-task.d.ts.map +1 -0
- package/dist/node-types/route-task.js +29 -0
- package/dist/node-types/route-task.js.map +1 -0
- package/dist/node-types/send-notify.d.ts +20 -0
- package/dist/node-types/send-notify.d.ts.map +1 -0
- package/dist/node-types/send-notify.js +75 -0
- package/dist/node-types/send-notify.js.map +1 -0
- package/dist/node-types/validate-result.d.ts +32 -0
- package/dist/node-types/validate-result.d.ts.map +1 -0
- package/dist/node-types/validate-result.js +53 -0
- package/dist/node-types/validate-result.js.map +1 -0
- package/dist/templates/index.d.ts +2 -0
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +3 -1
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/weaver-bot-template.d.ts +3 -0
- package/dist/templates/weaver-bot-template.d.ts.map +1 -0
- package/dist/templates/weaver-bot-template.js +99 -0
- package/dist/templates/weaver-bot-template.js.map +1 -0
- package/dist/templates/weaver-template.d.ts.map +1 -1
- package/dist/templates/weaver-template.js +15 -653
- package/dist/templates/weaver-template.js.map +1 -1
- package/dist/workflows/index.d.ts +5 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/index.js +5 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/weaver-bot-batch.d.ts +57 -0
- package/dist/workflows/weaver-bot-batch.d.ts.map +1 -0
- package/dist/workflows/weaver-bot-batch.js +60 -0
- package/dist/workflows/weaver-bot-batch.js.map +1 -0
- package/dist/workflows/weaver-bot-session.d.ts +65 -0
- package/dist/workflows/weaver-bot-session.d.ts.map +1 -0
- package/dist/workflows/weaver-bot-session.js +68 -0
- package/dist/workflows/weaver-bot-session.js.map +1 -0
- package/dist/workflows/weaver-bot.d.ts +72 -0
- package/dist/workflows/weaver-bot.d.ts.map +1 -0
- package/dist/workflows/weaver-bot.js +75 -0
- package/dist/workflows/weaver-bot.js.map +1 -0
- package/dist/workflows/weaver.d.ts +24 -0
- package/dist/workflows/weaver.d.ts.map +1 -0
- package/dist/workflows/weaver.js +28 -0
- package/dist/workflows/weaver.js.map +1 -0
- package/flowweaver.manifest.json +1004 -3
- package/package.json +23 -5
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the knowledge bundle the AI needs for planning. Calls
|
|
3
|
+
* flow-weaver context authoring for the base knowledge, and
|
|
4
|
+
* appends target file sources for modify tasks.
|
|
5
|
+
*
|
|
6
|
+
* @flowWeaver nodeType
|
|
7
|
+
* @expression
|
|
8
|
+
* @label Build Context
|
|
9
|
+
* @input projectDir [order:0] - Project root directory
|
|
10
|
+
* @input config [order:1] - Config (JSON, pass-through)
|
|
11
|
+
* @input providerType [order:2] - Provider type (pass-through)
|
|
12
|
+
* @input providerInfo [order:3] - Provider info (JSON, pass-through)
|
|
13
|
+
* @input taskJson [order:4] - Task (JSON)
|
|
14
|
+
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
15
|
+
* @output config [order:1] - Config (pass-through)
|
|
16
|
+
* @output providerType [order:2] - Provider type (pass-through)
|
|
17
|
+
* @output providerInfo [order:3] - Provider info (pass-through)
|
|
18
|
+
* @output taskJson [order:4] - Task (pass-through)
|
|
19
|
+
* @output contextBundle [order:5] - Knowledge bundle (markdown string)
|
|
20
|
+
*/
|
|
21
|
+
export declare function weaverBuildContext(projectDir: string, config: string, providerType: string, providerInfo: string, taskJson: string): {
|
|
22
|
+
projectDir: string;
|
|
23
|
+
config: string;
|
|
24
|
+
providerType: string;
|
|
25
|
+
providerInfo: string;
|
|
26
|
+
taskJson: string;
|
|
27
|
+
contextBundle: string;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=build-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-context.d.ts","sourceRoot":"","sources":["../../src/node-types/build-context.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACf;IACD,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAC/E,QAAQ,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;CACzC,CAgDA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
/**
|
|
5
|
+
* Builds the knowledge bundle the AI needs for planning. Calls
|
|
6
|
+
* flow-weaver context authoring for the base knowledge, and
|
|
7
|
+
* appends target file sources for modify tasks.
|
|
8
|
+
*
|
|
9
|
+
* @flowWeaver nodeType
|
|
10
|
+
* @expression
|
|
11
|
+
* @label Build Context
|
|
12
|
+
* @input projectDir [order:0] - Project root directory
|
|
13
|
+
* @input config [order:1] - Config (JSON, pass-through)
|
|
14
|
+
* @input providerType [order:2] - Provider type (pass-through)
|
|
15
|
+
* @input providerInfo [order:3] - Provider info (JSON, pass-through)
|
|
16
|
+
* @input taskJson [order:4] - Task (JSON)
|
|
17
|
+
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
18
|
+
* @output config [order:1] - Config (pass-through)
|
|
19
|
+
* @output providerType [order:2] - Provider type (pass-through)
|
|
20
|
+
* @output providerInfo [order:3] - Provider info (pass-through)
|
|
21
|
+
* @output taskJson [order:4] - Task (pass-through)
|
|
22
|
+
* @output contextBundle [order:5] - Knowledge bundle (markdown string)
|
|
23
|
+
*/
|
|
24
|
+
export function weaverBuildContext(projectDir, config, providerType, providerInfo, taskJson) {
|
|
25
|
+
const passthrough = { projectDir, config, providerType, providerInfo, taskJson };
|
|
26
|
+
const task = JSON.parse(taskJson);
|
|
27
|
+
const sections = [];
|
|
28
|
+
// Base context from flow-weaver CLI
|
|
29
|
+
try {
|
|
30
|
+
const context = execSync('flow-weaver context authoring --profile assistant', {
|
|
31
|
+
encoding: 'utf-8',
|
|
32
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
33
|
+
timeout: 30_000,
|
|
34
|
+
cwd: projectDir,
|
|
35
|
+
}).trim();
|
|
36
|
+
if (context)
|
|
37
|
+
sections.push(context);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
sections.push('(flow-weaver context not available)');
|
|
41
|
+
}
|
|
42
|
+
// For modify tasks, read target files
|
|
43
|
+
if (task.mode === 'modify' && task.targets) {
|
|
44
|
+
for (const target of task.targets) {
|
|
45
|
+
const filePath = path.isAbsolute(target) ? target : path.resolve(projectDir, target);
|
|
46
|
+
try {
|
|
47
|
+
if (fs.existsSync(filePath)) {
|
|
48
|
+
const source = fs.readFileSync(filePath, 'utf-8');
|
|
49
|
+
sections.push(`## Current Source: ${target}\n\n\`\`\`typescript\n${source}\n\`\`\``);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch { /* skip unreadable files */ }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// For create tasks, list available templates
|
|
56
|
+
if (task.mode === 'create') {
|
|
57
|
+
try {
|
|
58
|
+
const templates = execSync('flow-weaver list templates', {
|
|
59
|
+
encoding: 'utf-8',
|
|
60
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
61
|
+
timeout: 10_000,
|
|
62
|
+
cwd: projectDir,
|
|
63
|
+
}).trim();
|
|
64
|
+
if (templates)
|
|
65
|
+
sections.push(`## Available Templates\n\n${templates}`);
|
|
66
|
+
}
|
|
67
|
+
catch { /* templates not available */ }
|
|
68
|
+
}
|
|
69
|
+
const bundle = sections.join('\n\n---\n\n');
|
|
70
|
+
console.log(`\x1b[36m→ Context bundle: ${bundle.length} chars\x1b[0m`);
|
|
71
|
+
return { ...passthrough, contextBundle: bundle };
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=build-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-context.js","sourceRoot":"","sources":["../../src/node-types/build-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC;;;;;;;;;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,sBAAsB,MAAM,yBAAyB,MAAM,UAAU,CAAC,CAAC;gBACvF,CAAC;YACH,CAAC;YAAC,MAAM,CAAC,CAAC,2BAA2B,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED,6CAA6C;IAC7C,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,QAAQ,CAAC,4BAA4B,EAAE;gBACvD,QAAQ,EAAE,OAAO;gBACjB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;gBAC/B,OAAO,EAAE,MAAM;gBACf,GAAG,EAAE,UAAU;aAChB,CAAC,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,SAAS;gBAAE,QAAQ,CAAC,IAAI,CAAC,6BAA6B,SAAS,EAAE,CAAC,CAAC;QACzE,CAAC;QAAC,MAAM,CAAC,CAAC,6BAA6B,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,6BAA6B,MAAM,CAAC,MAAM,eAAe,CAAC,CAAC;IAEvE,OAAO,EAAE,GAAG,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-detect or resolve the configured AI provider.
|
|
3
|
+
*
|
|
4
|
+
* @flowWeaver nodeType
|
|
5
|
+
* @expression
|
|
6
|
+
* @label Detect Provider
|
|
7
|
+
* @input projectDir [order:0] - Project root directory
|
|
8
|
+
* @input config [order:1] - Weaver configuration (JSON)
|
|
9
|
+
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
10
|
+
* @output config [order:1] - Config (pass-through)
|
|
11
|
+
* @output providerType [order:2] - Resolved provider type
|
|
12
|
+
* @output providerInfo [order:3] - Provider details (JSON)
|
|
13
|
+
*/
|
|
14
|
+
export declare function weaverDetectProvider(projectDir: string, config: string): {
|
|
15
|
+
projectDir: string;
|
|
16
|
+
config: string;
|
|
17
|
+
providerType: string;
|
|
18
|
+
providerInfo: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=detect-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-provider.d.ts","sourceRoot":"","sources":["../../src/node-types/detect-provider.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG;IACxE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;CAC5C,CAkDA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
const WHICH_CMD = process.platform === 'win32' ? 'where' : 'which';
|
|
3
|
+
function whichSafe(cmd, cwd) {
|
|
4
|
+
try {
|
|
5
|
+
return execSync(`${WHICH_CMD} ${cmd}`, { cwd, encoding: 'utf-8', stdio: 'pipe' }).trim();
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
return '';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Auto-detect or resolve the configured AI provider.
|
|
13
|
+
*
|
|
14
|
+
* @flowWeaver nodeType
|
|
15
|
+
* @expression
|
|
16
|
+
* @label Detect Provider
|
|
17
|
+
* @input projectDir [order:0] - Project root directory
|
|
18
|
+
* @input config [order:1] - Weaver configuration (JSON)
|
|
19
|
+
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
20
|
+
* @output config [order:1] - Config (pass-through)
|
|
21
|
+
* @output providerType [order:2] - Resolved provider type
|
|
22
|
+
* @output providerInfo [order:3] - Provider details (JSON)
|
|
23
|
+
*/
|
|
24
|
+
export function weaverDetectProvider(projectDir, config) {
|
|
25
|
+
const cfg = JSON.parse(config);
|
|
26
|
+
const providerSetting = cfg.provider ?? 'auto';
|
|
27
|
+
let type;
|
|
28
|
+
let model;
|
|
29
|
+
let maxTokens;
|
|
30
|
+
if (typeof providerSetting === 'object') {
|
|
31
|
+
type = providerSetting.name;
|
|
32
|
+
model = providerSetting.model;
|
|
33
|
+
maxTokens = providerSetting.maxTokens;
|
|
34
|
+
}
|
|
35
|
+
else if (providerSetting !== 'auto') {
|
|
36
|
+
type = providerSetting;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
if (process.env.ANTHROPIC_API_KEY) {
|
|
40
|
+
type = 'anthropic';
|
|
41
|
+
}
|
|
42
|
+
else if (whichSafe('claude', projectDir)) {
|
|
43
|
+
type = 'claude-cli';
|
|
44
|
+
}
|
|
45
|
+
else if (whichSafe('copilot', projectDir)) {
|
|
46
|
+
type = 'copilot-cli';
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
throw new Error('No AI provider found. Options:\n' +
|
|
50
|
+
' 1. Set ANTHROPIC_API_KEY environment variable\n' +
|
|
51
|
+
' 2. Install Claude CLI: https://docs.anthropic.com/claude-code\n' +
|
|
52
|
+
' 3. Install GitHub Copilot CLI: https://github.com/features/copilot');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const providerInfo = {
|
|
56
|
+
type: type,
|
|
57
|
+
model: model ?? (type === 'anthropic' ? 'claude-sonnet-4-6' : undefined),
|
|
58
|
+
maxTokens: maxTokens ?? (type === 'anthropic' ? 4096 : undefined),
|
|
59
|
+
apiKey: type === 'anthropic' ? process.env.ANTHROPIC_API_KEY : undefined,
|
|
60
|
+
};
|
|
61
|
+
if (type === 'anthropic' && !providerInfo.apiKey) {
|
|
62
|
+
throw new Error('Provider is "anthropic" but ANTHROPIC_API_KEY is not set');
|
|
63
|
+
}
|
|
64
|
+
const label = providerInfo.model ? `${type} (${providerInfo.model})` : type;
|
|
65
|
+
console.log(`\x1b[36m→ Provider: ${label}\x1b[0m`);
|
|
66
|
+
return {
|
|
67
|
+
projectDir, config,
|
|
68
|
+
providerType: type,
|
|
69
|
+
providerInfo: JSON.stringify(providerInfo),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=detect-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-provider.js","sourceRoot":"","sources":["../../src/node-types/detect-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;AASnE,SAAS,SAAS,CAAC,GAAW,EAAE,GAAW;IACzC,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,GAAG,SAAS,IAAI,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3F,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAkB,EAAE,MAAc;IAIrE,MAAM,GAAG,GAAiB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,eAAe,GAAG,GAAG,CAAC,QAAQ,IAAI,MAAM,CAAC;IAE/C,IAAI,IAAY,CAAC;IACjB,IAAI,KAAyB,CAAC;IAC9B,IAAI,SAA6B,CAAC;IAElC,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE,CAAC;QACxC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;QAC5B,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC;QAC9B,SAAS,GAAG,eAAe,CAAC,SAAS,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,CAAC,uBAAuB,KAAK,SAAS,CAAC,CAAC;IAEnD,OAAO;QACL,UAAU,EAAE,MAAM;QAClB,YAAY,EAAE,IAAI;QAClB,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;KAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execute-validate-fix retry loop. Runs the plan, validates results,
|
|
3
|
+
* and if validation fails, asks the AI for fixes. Up to 3 attempts.
|
|
4
|
+
*
|
|
5
|
+
* @flowWeaver nodeType
|
|
6
|
+
* @label Execute & Validate
|
|
7
|
+
* @input projectDir [order:0] - Project root directory
|
|
8
|
+
* @input config [order:1] - Config (JSON)
|
|
9
|
+
* @input providerType [order:2] - Provider type
|
|
10
|
+
* @input providerInfo [order:3] - Provider info (JSON)
|
|
11
|
+
* @input planJson [order:4] - Execution plan (JSON)
|
|
12
|
+
* @input taskJson [order:5] - Task (JSON)
|
|
13
|
+
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
14
|
+
* @output config [order:1] - Config (pass-through)
|
|
15
|
+
* @output providerType [order:2] - Provider type (pass-through)
|
|
16
|
+
* @output providerInfo [order:3] - Provider info (pass-through)
|
|
17
|
+
* @output resultJson [order:4] - Final execution result (JSON)
|
|
18
|
+
* @output validationResultJson [order:5] - Final validation result (JSON)
|
|
19
|
+
* @output filesModified [order:6] - All modified files (JSON array)
|
|
20
|
+
* @output taskJson [order:7] - Task (pass-through)
|
|
21
|
+
* @output allValid [order:8] - Whether all files are valid
|
|
22
|
+
* @output onSuccess [order:-2] - On Success
|
|
23
|
+
* @output onFailure [order:-1] - On Failure
|
|
24
|
+
*/
|
|
25
|
+
export declare function weaverExecValidateRetry(execute: boolean, projectDir: string, config: string, providerType: string, providerInfo: string, planJson: string, taskJson: string): Promise<{
|
|
26
|
+
onSuccess: boolean;
|
|
27
|
+
onFailure: boolean;
|
|
28
|
+
projectDir: string;
|
|
29
|
+
config: string;
|
|
30
|
+
providerType: string;
|
|
31
|
+
providerInfo: string;
|
|
32
|
+
resultJson: string;
|
|
33
|
+
validationResultJson: string;
|
|
34
|
+
filesModified: string;
|
|
35
|
+
taskJson: string;
|
|
36
|
+
allValid: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
//# sourceMappingURL=exec-validate-retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec-validate-retry.d.ts","sourceRoot":"","sources":["../../src/node-types/exec-validate-retry.ts"],"names":[],"mappings":"AA0DA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IACT,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAC/E,UAAU,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAC;IACjD,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;CAC5D,CAAC,CA4ED"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import * as os from 'node:os';
|
|
5
|
+
function callCli(provider, prompt) {
|
|
6
|
+
if (provider === 'claude-cli') {
|
|
7
|
+
return execSync('claude -p --output-format text', {
|
|
8
|
+
input: prompt, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 120_000,
|
|
9
|
+
}).trim();
|
|
10
|
+
}
|
|
11
|
+
if (provider === 'copilot-cli') {
|
|
12
|
+
return execSync('copilot -p --silent --allow-all-tools', {
|
|
13
|
+
input: prompt, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 120_000,
|
|
14
|
+
}).trim();
|
|
15
|
+
}
|
|
16
|
+
throw new Error(`Unknown CLI provider: ${provider}`);
|
|
17
|
+
}
|
|
18
|
+
async function callApi(apiKey, model, maxTokens, systemPrompt, userPrompt) {
|
|
19
|
+
const body = JSON.stringify({
|
|
20
|
+
model, max_tokens: maxTokens, system: systemPrompt,
|
|
21
|
+
messages: [{ role: 'user', content: userPrompt }],
|
|
22
|
+
});
|
|
23
|
+
const response = await fetch('https://api.anthropic.com/v1/messages', {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
headers: { 'x-api-key': apiKey, 'anthropic-version': '2023-06-01', 'content-type': 'application/json' },
|
|
26
|
+
body,
|
|
27
|
+
});
|
|
28
|
+
if (!response.ok) {
|
|
29
|
+
const text = await response.text();
|
|
30
|
+
throw new Error(`Anthropic API error ${response.status}: ${text.slice(0, 200)}`);
|
|
31
|
+
}
|
|
32
|
+
const json = await response.json();
|
|
33
|
+
return json.content[0]?.text ?? '';
|
|
34
|
+
}
|
|
35
|
+
function parseJsonResponse(text) {
|
|
36
|
+
let cleaned = text.trim();
|
|
37
|
+
if (cleaned.startsWith('```')) {
|
|
38
|
+
cleaned = cleaned.replace(/^```(?:json)?\s*\n?/, '').replace(/\n?```\s*$/, '');
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
return JSON.parse(cleaned);
|
|
42
|
+
}
|
|
43
|
+
catch { /* fallthrough */ }
|
|
44
|
+
const match = cleaned.match(/\{[\s\S]*\}/);
|
|
45
|
+
if (match)
|
|
46
|
+
return JSON.parse(match[0]);
|
|
47
|
+
throw new Error(`Failed to parse AI response as JSON: ${text.slice(0, 200)}`);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Execute-validate-fix retry loop. Runs the plan, validates results,
|
|
51
|
+
* and if validation fails, asks the AI for fixes. Up to 3 attempts.
|
|
52
|
+
*
|
|
53
|
+
* @flowWeaver nodeType
|
|
54
|
+
* @label Execute & Validate
|
|
55
|
+
* @input projectDir [order:0] - Project root directory
|
|
56
|
+
* @input config [order:1] - Config (JSON)
|
|
57
|
+
* @input providerType [order:2] - Provider type
|
|
58
|
+
* @input providerInfo [order:3] - Provider info (JSON)
|
|
59
|
+
* @input planJson [order:4] - Execution plan (JSON)
|
|
60
|
+
* @input taskJson [order:5] - Task (JSON)
|
|
61
|
+
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
62
|
+
* @output config [order:1] - Config (pass-through)
|
|
63
|
+
* @output providerType [order:2] - Provider type (pass-through)
|
|
64
|
+
* @output providerInfo [order:3] - Provider info (pass-through)
|
|
65
|
+
* @output resultJson [order:4] - Final execution result (JSON)
|
|
66
|
+
* @output validationResultJson [order:5] - Final validation result (JSON)
|
|
67
|
+
* @output filesModified [order:6] - All modified files (JSON array)
|
|
68
|
+
* @output taskJson [order:7] - Task (pass-through)
|
|
69
|
+
* @output allValid [order:8] - Whether all files are valid
|
|
70
|
+
* @output onSuccess [order:-2] - On Success
|
|
71
|
+
* @output onFailure [order:-1] - On Failure
|
|
72
|
+
*/
|
|
73
|
+
export async function weaverExecValidateRetry(execute, projectDir, config, providerType, providerInfo, planJson, taskJson) {
|
|
74
|
+
const passthrough = { projectDir, config, providerType, providerInfo, taskJson };
|
|
75
|
+
if (!execute) {
|
|
76
|
+
return {
|
|
77
|
+
onSuccess: true, onFailure: false, ...passthrough,
|
|
78
|
+
resultJson: JSON.stringify({ success: true, stepsCompleted: 0, stepsTotal: 0 }),
|
|
79
|
+
validationResultJson: '[]', filesModified: '[]', allValid: true,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const pInfo = JSON.parse(providerInfo);
|
|
83
|
+
const maxAttempts = 3;
|
|
84
|
+
let currentPlan = JSON.parse(planJson);
|
|
85
|
+
let allFilesModified = [];
|
|
86
|
+
let lastExecResult = {};
|
|
87
|
+
let lastValidation = [];
|
|
88
|
+
let allValid = false;
|
|
89
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
90
|
+
console.log(`\x1b[36m→ Attempt ${attempt}/${maxAttempts}\x1b[0m`);
|
|
91
|
+
// Execute plan steps
|
|
92
|
+
const execResult = executePlanSteps(currentPlan, projectDir);
|
|
93
|
+
lastExecResult = execResult;
|
|
94
|
+
allFilesModified = [...new Set([...allFilesModified, ...execResult.filesModified])];
|
|
95
|
+
// Validate results
|
|
96
|
+
const validation = validateFiles(execResult.filesModified, projectDir);
|
|
97
|
+
lastValidation = validation;
|
|
98
|
+
allValid = validation.every(v => v.valid);
|
|
99
|
+
if (allValid) {
|
|
100
|
+
console.log('\x1b[32m→ All files valid\x1b[0m');
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
if (attempt < maxAttempts) {
|
|
104
|
+
console.log(`\x1b[33m→ Validation errors found, requesting fix plan...\x1b[0m`);
|
|
105
|
+
const errors = validation.filter(v => !v.valid).map(v => `${v.file}: ${v.errors.join(', ')}`).join('\n');
|
|
106
|
+
try {
|
|
107
|
+
let systemPrompt;
|
|
108
|
+
try {
|
|
109
|
+
const mod = await import('../bot/system-prompt.js');
|
|
110
|
+
systemPrompt = await mod.buildSystemPrompt();
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
systemPrompt = 'You are Weaver. Return ONLY valid JSON.';
|
|
114
|
+
}
|
|
115
|
+
const fixPrompt = `The following validation errors occurred:\n${errors}\n\nProvide a fix plan as JSON with steps and summary.`;
|
|
116
|
+
let text;
|
|
117
|
+
if (pInfo.type === 'anthropic') {
|
|
118
|
+
text = await callApi(pInfo.apiKey, pInfo.model ?? 'claude-sonnet-4-6', pInfo.maxTokens ?? 8192, systemPrompt, fixPrompt);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
text = callCli(pInfo.type, systemPrompt + '\n\n' + fixPrompt);
|
|
122
|
+
}
|
|
123
|
+
currentPlan = parseJsonResponse(text);
|
|
124
|
+
console.log(`\x1b[36m→ Fix plan: ${currentPlan.summary ?? 'generated'}\x1b[0m`);
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
128
|
+
console.error(`\x1b[31m→ Fix planning failed: ${msg}\x1b[0m`);
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
onSuccess: allValid, onFailure: !allValid, ...passthrough,
|
|
135
|
+
resultJson: JSON.stringify(lastExecResult),
|
|
136
|
+
validationResultJson: JSON.stringify(lastValidation),
|
|
137
|
+
filesModified: JSON.stringify(allFilesModified),
|
|
138
|
+
allValid,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function executePlanSteps(plan, projectDir) {
|
|
142
|
+
const filesModified = [];
|
|
143
|
+
const errors = [];
|
|
144
|
+
let completed = 0;
|
|
145
|
+
const steps = plan.steps ?? [];
|
|
146
|
+
for (const step of steps) {
|
|
147
|
+
// Check steering between steps
|
|
148
|
+
const steering = checkSteeringSignal();
|
|
149
|
+
if (steering === 'cancel') {
|
|
150
|
+
errors.push(`Cancelled at step ${step.id}`);
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
try {
|
|
154
|
+
const result = executeStep(step, projectDir);
|
|
155
|
+
if (result.file)
|
|
156
|
+
filesModified.push(result.file);
|
|
157
|
+
if (result.files)
|
|
158
|
+
filesModified.push(...result.files);
|
|
159
|
+
completed++;
|
|
160
|
+
console.log(`\x1b[32m + ${step.id}: ${step.description}\x1b[0m`);
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
164
|
+
errors.push(`${step.id}: ${msg}`);
|
|
165
|
+
console.error(`\x1b[31m x ${step.id}: ${msg}\x1b[0m`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return { success: errors.length === 0, filesModified: [...new Set(filesModified)], errors, stepsCompleted: completed, stepsTotal: steps.length };
|
|
169
|
+
}
|
|
170
|
+
function executeStep(step, projectDir) {
|
|
171
|
+
const args = step.args;
|
|
172
|
+
const file = args.file;
|
|
173
|
+
switch (step.operation) {
|
|
174
|
+
case 'write-file':
|
|
175
|
+
case 'create-workflow':
|
|
176
|
+
case 'modify-source':
|
|
177
|
+
case 'implement-node': {
|
|
178
|
+
const filePath = path.resolve(projectDir, file);
|
|
179
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
180
|
+
fs.writeFileSync(filePath, args.content ?? args.body ?? '', 'utf-8');
|
|
181
|
+
return { file: filePath };
|
|
182
|
+
}
|
|
183
|
+
case 'compile':
|
|
184
|
+
execSync(`flow-weaver compile "${file}"`, { cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 30_000 });
|
|
185
|
+
return { file: file };
|
|
186
|
+
case 'validate':
|
|
187
|
+
execSync(`flow-weaver validate "${file}"`, { cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 30_000 });
|
|
188
|
+
return {};
|
|
189
|
+
case 'add-node':
|
|
190
|
+
execSync(`flow-weaver modify addNode --file "${file}" --nodeId "${args.nodeId}" --nodeType "${args.nodeType}"`, { cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 30_000 });
|
|
191
|
+
return { file: file };
|
|
192
|
+
case 'remove-node':
|
|
193
|
+
execSync(`flow-weaver modify removeNode --file "${file}" --nodeId "${args.nodeId}"`, { cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 30_000 });
|
|
194
|
+
return { file: file };
|
|
195
|
+
case 'add-connection':
|
|
196
|
+
execSync(`flow-weaver modify addConnection --file "${file}" --from "${args.from}" --to "${args.to}"`, { cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 30_000 });
|
|
197
|
+
return { file: file };
|
|
198
|
+
case 'remove-connection':
|
|
199
|
+
execSync(`flow-weaver modify removeConnection --file "${file}" --from "${args.from}" --to "${args.to}"`, { cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 30_000 });
|
|
200
|
+
return { file: file };
|
|
201
|
+
case 'scaffold':
|
|
202
|
+
execSync(`flow-weaver create workflow "${args.template}" "${file}"`, { cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 30_000 });
|
|
203
|
+
return { file: file };
|
|
204
|
+
case 'read-file':
|
|
205
|
+
return {};
|
|
206
|
+
case 'run-cli': {
|
|
207
|
+
const cmd = args.command;
|
|
208
|
+
const cliArgs = args.args?.join(' ') ?? '';
|
|
209
|
+
execSync(`flow-weaver ${cmd} ${cliArgs}`, { cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 30_000 });
|
|
210
|
+
return {};
|
|
211
|
+
}
|
|
212
|
+
default:
|
|
213
|
+
throw new Error(`Unknown operation: ${step.operation}`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function validateFiles(files, projectDir) {
|
|
217
|
+
const results = [];
|
|
218
|
+
for (const file of files) {
|
|
219
|
+
if (!file.endsWith('.ts'))
|
|
220
|
+
continue;
|
|
221
|
+
try {
|
|
222
|
+
execSync(`flow-weaver validate "${file}"`, {
|
|
223
|
+
cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 30_000,
|
|
224
|
+
});
|
|
225
|
+
results.push({ file, valid: true, errors: [], warnings: [] });
|
|
226
|
+
}
|
|
227
|
+
catch (err) {
|
|
228
|
+
const msg = err instanceof Error ? err.stderr ?? err.message : String(err);
|
|
229
|
+
results.push({ file, valid: false, errors: [msg], warnings: [] });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return results;
|
|
233
|
+
}
|
|
234
|
+
function checkSteeringSignal() {
|
|
235
|
+
try {
|
|
236
|
+
const controlPath = path.join(os.homedir(), '.weaver', 'control.json');
|
|
237
|
+
if (!fs.existsSync(controlPath))
|
|
238
|
+
return null;
|
|
239
|
+
const raw = fs.readFileSync(controlPath, 'utf-8');
|
|
240
|
+
fs.unlinkSync(controlPath);
|
|
241
|
+
const cmd = JSON.parse(raw);
|
|
242
|
+
if (cmd.command === 'cancel')
|
|
243
|
+
return 'cancel';
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=exec-validate-retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec-validate-retry.js","sourceRoot":"","sources":["../../src/node-types/exec-validate-retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAS9B,SAAS,OAAO,CAAC,QAAgB,EAAE,MAAc;IAC/C,IAAI,QAAQ,KAAK,YAAY,EAAE,CAAC;QAC9B,OAAO,QAAQ,CAAC,gCAAgC,EAAE;YAChD,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO;SACpF,CAAC,CAAC,IAAI,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,QAAQ,KAAK,aAAa,EAAE,CAAC;QAC/B,OAAO,QAAQ,CAAC,uCAAuC,EAAE;YACvD,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAA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O,IAAI,CAAC;QAC7C,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAClD,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAwB,CAAC;QACnD,IAAI,GAAG,CAAC,OAAO,KAAK,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executes plan steps via the flow-weaver CLI. Checks steering
|
|
3
|
+
* between steps.
|
|
4
|
+
*
|
|
5
|
+
* @flowWeaver nodeType
|
|
6
|
+
* @label Execute Plan
|
|
7
|
+
* @input projectDir [order:0] - Project root directory
|
|
8
|
+
* @input config [order:1] - Config (JSON, pass-through)
|
|
9
|
+
* @input providerType [order:2] - Provider type (pass-through)
|
|
10
|
+
* @input providerInfo [order:3] - Provider info (pass-through)
|
|
11
|
+
* @input planJson [order:4] - Plan (JSON)
|
|
12
|
+
* @input taskJson [order:5] - Task (JSON)
|
|
13
|
+
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
14
|
+
* @output config [order:1] - Config (pass-through)
|
|
15
|
+
* @output providerType [order:2] - Provider type (pass-through)
|
|
16
|
+
* @output providerInfo [order:3] - Provider info (pass-through)
|
|
17
|
+
* @output executionResultJson [order:4] - Execution result (JSON)
|
|
18
|
+
* @output taskJson [order:5] - Task (pass-through)
|
|
19
|
+
* @output filesModified [order:6] - Files modified (JSON array)
|
|
20
|
+
* @output onSuccess [order:-2] - On Success
|
|
21
|
+
* @output onFailure [order:-1] - On Failure
|
|
22
|
+
*/
|
|
23
|
+
export declare function weaverExecutePlan(execute: boolean, projectDir: string, config: string, providerType: string, providerInfo: string, planJson: string, taskJson: string): Promise<{
|
|
24
|
+
onSuccess: boolean;
|
|
25
|
+
onFailure: boolean;
|
|
26
|
+
projectDir: string;
|
|
27
|
+
config: string;
|
|
28
|
+
providerType: string;
|
|
29
|
+
providerInfo: string;
|
|
30
|
+
executionResultJson: string;
|
|
31
|
+
taskJson: string;
|
|
32
|
+
filesModified: string;
|
|
33
|
+
}>;
|
|
34
|
+
//# sourceMappingURL=execute-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-plan.d.ts","sourceRoot":"","sources":["../../src/node-types/execute-plan.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IACT,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAC/E,mBAAmB,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;CACtE,CAAC,CAoED"}
|