@synergenius/flowweaver-pack-weaver 0.5.0 → 0.5.2
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/README.md +167 -0
- package/dist/bot/agent-provider.d.ts +15 -1
- package/dist/bot/agent-provider.d.ts.map +1 -1
- package/dist/bot/agent-provider.js +78 -2
- package/dist/bot/agent-provider.js.map +1 -1
- package/dist/bot/ai-client.d.ts +4 -0
- package/dist/bot/ai-client.d.ts.map +1 -0
- package/dist/bot/ai-client.js +46 -0
- package/dist/bot/ai-client.js.map +1 -0
- package/dist/bot/bot-agent-channel.d.ts +14 -1
- package/dist/bot/bot-agent-channel.d.ts.map +1 -1
- package/dist/bot/bot-agent-channel.js +16 -0
- package/dist/bot/bot-agent-channel.js.map +1 -1
- package/dist/bot/cli-provider.d.ts +16 -1
- package/dist/bot/cli-provider.d.ts.map +1 -1
- package/dist/bot/cli-provider.js +10 -0
- package/dist/bot/cli-provider.js.map +1 -1
- package/dist/bot/dashboard.d.ts.map +1 -1
- package/dist/bot/dashboard.js +2 -2
- package/dist/bot/dashboard.js.map +1 -1
- package/dist/bot/file-lock.d.ts +7 -0
- package/dist/bot/file-lock.d.ts.map +1 -0
- package/dist/bot/file-lock.js +64 -0
- package/dist/bot/file-lock.js.map +1 -0
- package/dist/bot/file-validator.d.ts +7 -0
- package/dist/bot/file-validator.d.ts.map +1 -0
- package/dist/bot/file-validator.js +20 -0
- package/dist/bot/file-validator.js.map +1 -0
- package/dist/bot/genesis-store.d.ts +18 -0
- package/dist/bot/genesis-store.d.ts.map +1 -0
- package/dist/bot/genesis-store.js +89 -0
- package/dist/bot/genesis-store.js.map +1 -0
- package/dist/bot/index.d.ts +7 -1
- package/dist/bot/index.d.ts.map +1 -1
- package/dist/bot/index.js +8 -0
- package/dist/bot/index.js.map +1 -1
- package/dist/bot/runner.d.ts.map +1 -1
- package/dist/bot/runner.js +2 -4
- package/dist/bot/runner.js.map +1 -1
- package/dist/bot/session-state.d.ts +3 -3
- package/dist/bot/session-state.d.ts.map +1 -1
- package/dist/bot/session-state.js +24 -15
- package/dist/bot/session-state.js.map +1 -1
- package/dist/bot/steering.d.ts +2 -2
- package/dist/bot/steering.d.ts.map +1 -1
- package/dist/bot/steering.js +20 -15
- package/dist/bot/steering.js.map +1 -1
- package/dist/bot/step-executor.d.ts +9 -0
- package/dist/bot/step-executor.d.ts.map +1 -0
- package/dist/bot/step-executor.js +51 -0
- package/dist/bot/step-executor.js.map +1 -0
- package/dist/bot/task-queue.d.ts +8 -8
- package/dist/bot/task-queue.d.ts.map +1 -1
- package/dist/bot/task-queue.js +58 -47
- package/dist/bot/task-queue.js.map +1 -1
- package/dist/bot/types.d.ts +131 -0
- package/dist/bot/types.d.ts.map +1 -1
- package/dist/cli-bridge.d.ts.map +1 -1
- package/dist/cli-bridge.js +2 -4
- package/dist/cli-bridge.js.map +1 -1
- package/dist/cli-handlers.d.ts +4 -1
- package/dist/cli-handlers.d.ts.map +1 -1
- package/dist/cli-handlers.js +84 -8
- package/dist/cli-handlers.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-tools.d.ts.map +1 -1
- package/dist/mcp-tools.js +27 -5
- package/dist/mcp-tools.js.map +1 -1
- package/dist/node-types/abort-task.d.ts +5 -12
- package/dist/node-types/abort-task.d.ts.map +1 -1
- package/dist/node-types/abort-task.js +11 -16
- package/dist/node-types/abort-task.js.map +1 -1
- package/dist/node-types/approval-gate.d.ts +4 -21
- package/dist/node-types/approval-gate.d.ts.map +1 -1
- package/dist/node-types/approval-gate.js +17 -23
- package/dist/node-types/approval-gate.js.map +1 -1
- package/dist/node-types/bot-report.d.ts +8 -10
- package/dist/node-types/bot-report.d.ts.map +1 -1
- package/dist/node-types/bot-report.js +28 -24
- package/dist/node-types/bot-report.js.map +1 -1
- package/dist/node-types/build-context.d.ts +5 -18
- package/dist/node-types/build-context.d.ts.map +1 -1
- package/dist/node-types/build-context.js +14 -23
- package/dist/node-types/build-context.js.map +1 -1
- package/dist/node-types/detect-provider.d.ts +7 -10
- package/dist/node-types/detect-provider.d.ts.map +1 -1
- package/dist/node-types/detect-provider.js +8 -12
- package/dist/node-types/detect-provider.js.map +1 -1
- package/dist/node-types/exec-validate-retry.d.ts +5 -26
- package/dist/node-types/exec-validate-retry.d.ts.map +1 -1
- package/dist/node-types/exec-validate-retry.js +21 -144
- package/dist/node-types/exec-validate-retry.js.map +1 -1
- package/dist/node-types/execute-plan.d.ts +10 -18
- package/dist/node-types/execute-plan.d.ts.map +1 -1
- package/dist/node-types/execute-plan.js +13 -68
- package/dist/node-types/execute-plan.js.map +1 -1
- package/dist/node-types/execute-target.d.ts +5 -15
- package/dist/node-types/execute-target.d.ts.map +1 -1
- package/dist/node-types/execute-target.js +17 -85
- package/dist/node-types/execute-target.js.map +1 -1
- package/dist/node-types/fix-errors.d.ts +9 -17
- package/dist/node-types/fix-errors.d.ts.map +1 -1
- package/dist/node-types/fix-errors.js +13 -64
- package/dist/node-types/fix-errors.js.map +1 -1
- package/dist/node-types/genesis-apply-retry.d.ts +24 -0
- package/dist/node-types/genesis-apply-retry.d.ts.map +1 -0
- package/dist/node-types/genesis-apply-retry.js +95 -0
- package/dist/node-types/genesis-apply-retry.js.map +1 -0
- package/dist/node-types/genesis-apply.d.ts +29 -0
- package/dist/node-types/genesis-apply.d.ts.map +1 -0
- package/dist/node-types/genesis-apply.js +76 -0
- package/dist/node-types/genesis-apply.js.map +1 -0
- package/dist/node-types/genesis-approve.d.ts +19 -0
- package/dist/node-types/genesis-approve.d.ts.map +1 -0
- package/dist/node-types/genesis-approve.js +54 -0
- package/dist/node-types/genesis-approve.js.map +1 -0
- package/dist/node-types/genesis-check-stabilize.d.ts +16 -0
- package/dist/node-types/genesis-check-stabilize.d.ts.map +1 -0
- package/dist/node-types/genesis-check-stabilize.js +32 -0
- package/dist/node-types/genesis-check-stabilize.js.map +1 -0
- package/dist/node-types/genesis-check-threshold.d.ts +15 -0
- package/dist/node-types/genesis-check-threshold.d.ts.map +1 -0
- package/dist/node-types/genesis-check-threshold.js +29 -0
- package/dist/node-types/genesis-check-threshold.js.map +1 -0
- package/dist/node-types/genesis-commit.d.ts +17 -0
- package/dist/node-types/genesis-commit.d.ts.map +1 -0
- package/dist/node-types/genesis-commit.js +59 -0
- package/dist/node-types/genesis-commit.js.map +1 -0
- package/dist/node-types/genesis-compile-validate.d.ts +26 -0
- package/dist/node-types/genesis-compile-validate.d.ts.map +1 -0
- package/dist/node-types/genesis-compile-validate.js +60 -0
- package/dist/node-types/genesis-compile-validate.js.map +1 -0
- package/dist/node-types/genesis-diff-fingerprint.d.ts +15 -0
- package/dist/node-types/genesis-diff-fingerprint.d.ts.map +1 -0
- package/dist/node-types/genesis-diff-fingerprint.js +59 -0
- package/dist/node-types/genesis-diff-fingerprint.js.map +1 -0
- package/dist/node-types/genesis-diff-workflow.d.ts +15 -0
- package/dist/node-types/genesis-diff-workflow.d.ts.map +1 -0
- package/dist/node-types/genesis-diff-workflow.js +39 -0
- package/dist/node-types/genesis-diff-workflow.js.map +1 -0
- package/dist/node-types/genesis-load-config.d.ts +17 -0
- package/dist/node-types/genesis-load-config.d.ts.map +1 -0
- package/dist/node-types/genesis-load-config.js +35 -0
- package/dist/node-types/genesis-load-config.js.map +1 -0
- package/dist/node-types/genesis-observe.d.ts +18 -0
- package/dist/node-types/genesis-observe.d.ts.map +1 -0
- package/dist/node-types/genesis-observe.js +101 -0
- package/dist/node-types/genesis-observe.js.map +1 -0
- package/dist/node-types/genesis-propose.d.ts +17 -0
- package/dist/node-types/genesis-propose.d.ts.map +1 -0
- package/dist/node-types/genesis-propose.js +67 -0
- package/dist/node-types/genesis-propose.js.map +1 -0
- package/dist/node-types/genesis-report.d.ts +18 -0
- package/dist/node-types/genesis-report.d.ts.map +1 -0
- package/dist/node-types/genesis-report.js +61 -0
- package/dist/node-types/genesis-report.js.map +1 -0
- package/dist/node-types/genesis-snapshot.d.ts +15 -0
- package/dist/node-types/genesis-snapshot.d.ts.map +1 -0
- package/dist/node-types/genesis-snapshot.js +26 -0
- package/dist/node-types/genesis-snapshot.js.map +1 -0
- package/dist/node-types/genesis-try-apply.d.ts +18 -0
- package/dist/node-types/genesis-try-apply.d.ts.map +1 -0
- package/dist/node-types/genesis-try-apply.js +109 -0
- package/dist/node-types/genesis-try-apply.js.map +1 -0
- package/dist/node-types/genesis-update-history.d.ts +15 -0
- package/dist/node-types/genesis-update-history.d.ts.map +1 -0
- package/dist/node-types/genesis-update-history.js +57 -0
- package/dist/node-types/genesis-update-history.js.map +1 -0
- package/dist/node-types/genesis-validate-proposal.d.ts +16 -0
- package/dist/node-types/genesis-validate-proposal.d.ts.map +1 -0
- package/dist/node-types/genesis-validate-proposal.js +52 -0
- package/dist/node-types/genesis-validate-proposal.js.map +1 -0
- package/dist/node-types/git-ops.d.ts +5 -8
- package/dist/node-types/git-ops.d.ts.map +1 -1
- package/dist/node-types/git-ops.js +16 -14
- package/dist/node-types/git-ops.js.map +1 -1
- package/dist/node-types/index.d.ts +17 -0
- package/dist/node-types/index.d.ts.map +1 -1
- package/dist/node-types/index.js +17 -0
- package/dist/node-types/index.js.map +1 -1
- package/dist/node-types/load-config.d.ts +4 -2
- package/dist/node-types/load-config.d.ts.map +1 -1
- package/dist/node-types/load-config.js +3 -2
- package/dist/node-types/load-config.js.map +1 -1
- package/dist/node-types/plan-task.d.ts +5 -20
- package/dist/node-types/plan-task.d.ts.map +1 -1
- package/dist/node-types/plan-task.js +16 -85
- package/dist/node-types/plan-task.js.map +1 -1
- package/dist/node-types/read-workflow.d.ts +5 -20
- package/dist/node-types/read-workflow.d.ts.map +1 -1
- package/dist/node-types/read-workflow.js +16 -28
- package/dist/node-types/read-workflow.js.map +1 -1
- package/dist/node-types/receive-task.d.ts +9 -20
- package/dist/node-types/receive-task.d.ts.map +1 -1
- package/dist/node-types/receive-task.js +16 -19
- package/dist/node-types/receive-task.js.map +1 -1
- package/dist/node-types/report.d.ts +3 -4
- package/dist/node-types/report.d.ts.map +1 -1
- package/dist/node-types/report.js +6 -6
- package/dist/node-types/report.js.map +1 -1
- package/dist/node-types/resolve-target.d.ts +7 -15
- package/dist/node-types/resolve-target.d.ts.map +1 -1
- package/dist/node-types/resolve-target.js +47 -47
- package/dist/node-types/resolve-target.js.map +1 -1
- package/dist/node-types/route-task.d.ts +4 -16
- package/dist/node-types/route-task.d.ts.map +1 -1
- package/dist/node-types/route-task.js +6 -13
- package/dist/node-types/route-task.js.map +1 -1
- package/dist/node-types/send-notify.d.ts +5 -11
- package/dist/node-types/send-notify.d.ts.map +1 -1
- package/dist/node-types/send-notify.js +17 -24
- package/dist/node-types/send-notify.js.map +1 -1
- package/dist/node-types/validate-result.d.ts +11 -19
- package/dist/node-types/validate-result.d.ts.map +1 -1
- package/dist/node-types/validate-result.js +18 -33
- package/dist/node-types/validate-result.js.map +1 -1
- package/dist/workflows/genesis-task.d.ts +52 -0
- package/dist/workflows/genesis-task.d.ts.map +1 -0
- package/dist/workflows/genesis-task.js +56 -0
- package/dist/workflows/genesis-task.js.map +1 -0
- package/dist/workflows/index.d.ts +1 -1
- package/dist/workflows/index.d.ts.map +1 -1
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/weaver-bot-batch.d.ts +15 -26
- package/dist/workflows/weaver-bot-batch.d.ts.map +1 -1
- package/dist/workflows/weaver-bot-batch.js +15 -26
- package/dist/workflows/weaver-bot-batch.js.map +1 -1
- package/dist/workflows/weaver-bot.d.ts +18 -32
- package/dist/workflows/weaver-bot.d.ts.map +1 -1
- package/dist/workflows/weaver-bot.js +18 -32
- package/dist/workflows/weaver-bot.js.map +1 -1
- package/dist/workflows/weaver.d.ts +9 -9
- package/dist/workflows/weaver.js +9 -9
- package/flowweaver.manifest.json +494 -558
- package/package.json +3 -3
- package/dist/workflows/weaver-bot-session.d.ts +0 -65
- package/dist/workflows/weaver-bot-session.d.ts.map +0 -1
- package/dist/workflows/weaver-bot-session.js +0 -68
- package/dist/workflows/weaver-bot-session.js.map +0 -1
|
@@ -5,31 +5,14 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @flowWeaver nodeType
|
|
7
7
|
* @label Approval Gate
|
|
8
|
-
* @input
|
|
9
|
-
* @
|
|
10
|
-
* @input providerType [order:2] - Provider type (pass-through)
|
|
11
|
-
* @input providerInfo [order:3] - Provider info (pass-through)
|
|
12
|
-
* @input planJson [order:4] - Plan (JSON)
|
|
13
|
-
* @input taskJson [order:5] - 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 planJson [order:4] - Plan (pass-through)
|
|
19
|
-
* @output taskJson [order:5] - Task (pass-through)
|
|
20
|
-
* @output rejectionReason [order:6] - Rejection reason (on failure path)
|
|
8
|
+
* @input ctx [order:0] - Weaver context (JSON)
|
|
9
|
+
* @output ctx [order:0] - Weaver context with rejectionReason (JSON)
|
|
21
10
|
* @output onSuccess [order:-2] - On Success
|
|
22
11
|
* @output onFailure [order:-1] - On Failure
|
|
23
12
|
*/
|
|
24
|
-
export declare function weaverApprovalGate(execute: boolean,
|
|
13
|
+
export declare function weaverApprovalGate(execute: boolean, ctx: string): Promise<{
|
|
25
14
|
onSuccess: boolean;
|
|
26
15
|
onFailure: boolean;
|
|
27
|
-
|
|
28
|
-
config: string;
|
|
29
|
-
providerType: string;
|
|
30
|
-
providerInfo: string;
|
|
31
|
-
planJson: string;
|
|
32
|
-
taskJson: string;
|
|
33
|
-
rejectionReason: string;
|
|
16
|
+
ctx: string;
|
|
34
17
|
}>;
|
|
35
18
|
//# sourceMappingURL=approval-gate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-gate.d.ts","sourceRoot":"","sources":["../../src/node-types/approval-gate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"approval-gate.d.ts","sourceRoot":"","sources":["../../src/node-types/approval-gate.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IACT,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IACvC,GAAG,EAAE,MAAM,CAAC;CACb,CAAC,CAiDD"}
|
|
@@ -6,37 +6,29 @@ import * as readline from 'node:readline';
|
|
|
6
6
|
*
|
|
7
7
|
* @flowWeaver nodeType
|
|
8
8
|
* @label Approval Gate
|
|
9
|
-
* @input
|
|
10
|
-
* @
|
|
11
|
-
* @input providerType [order:2] - Provider type (pass-through)
|
|
12
|
-
* @input providerInfo [order:3] - Provider info (pass-through)
|
|
13
|
-
* @input planJson [order:4] - Plan (JSON)
|
|
14
|
-
* @input taskJson [order:5] - Task (JSON)
|
|
15
|
-
* @output projectDir [order:0] - Project root directory (pass-through)
|
|
16
|
-
* @output config [order:1] - Config (pass-through)
|
|
17
|
-
* @output providerType [order:2] - Provider type (pass-through)
|
|
18
|
-
* @output providerInfo [order:3] - Provider info (pass-through)
|
|
19
|
-
* @output planJson [order:4] - Plan (pass-through)
|
|
20
|
-
* @output taskJson [order:5] - Task (pass-through)
|
|
21
|
-
* @output rejectionReason [order:6] - Rejection reason (on failure path)
|
|
9
|
+
* @input ctx [order:0] - Weaver context (JSON)
|
|
10
|
+
* @output ctx [order:0] - Weaver context with rejectionReason (JSON)
|
|
22
11
|
* @output onSuccess [order:-2] - On Success
|
|
23
12
|
* @output onFailure [order:-1] - On Failure
|
|
24
13
|
*/
|
|
25
|
-
export async function weaverApprovalGate(execute,
|
|
26
|
-
const
|
|
14
|
+
export async function weaverApprovalGate(execute, ctx) {
|
|
15
|
+
const context = JSON.parse(ctx);
|
|
16
|
+
const { env } = context;
|
|
27
17
|
if (!execute) {
|
|
28
|
-
|
|
18
|
+
context.rejectionReason = '';
|
|
19
|
+
return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
|
|
29
20
|
}
|
|
30
|
-
const
|
|
31
|
-
const approvalMode = typeof
|
|
21
|
+
const { config } = env;
|
|
22
|
+
const approvalMode = typeof config.approval === 'string' ? config.approval : config.approval?.mode ?? 'prompt';
|
|
32
23
|
// Check for autoApprove in task options
|
|
33
|
-
const task = JSON.parse(taskJson);
|
|
24
|
+
const task = JSON.parse(context.taskJson);
|
|
34
25
|
if (task.options?.autoApprove || approvalMode === 'auto') {
|
|
35
26
|
console.log('\x1b[36m→ Auto-approved\x1b[0m');
|
|
36
|
-
|
|
27
|
+
context.rejectionReason = '';
|
|
28
|
+
return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
|
|
37
29
|
}
|
|
38
30
|
// Display the plan
|
|
39
|
-
const plan = JSON.parse(planJson);
|
|
31
|
+
const plan = JSON.parse(context.planJson);
|
|
40
32
|
console.log('\n\x1b[1m┌─ Bot Plan ─────────────────────────────┐\x1b[0m');
|
|
41
33
|
console.log(`\x1b[1m│\x1b[0m Summary: ${plan.summary}`);
|
|
42
34
|
console.log(`\x1b[1m│\x1b[0m Steps: ${plan.steps.length}`);
|
|
@@ -53,10 +45,12 @@ export async function weaverApprovalGate(execute, projectDir, config, providerTy
|
|
|
53
45
|
const approved = !answer || answer.toLowerCase().startsWith('y');
|
|
54
46
|
if (approved) {
|
|
55
47
|
console.log('\x1b[32m→ Plan approved\x1b[0m');
|
|
56
|
-
|
|
48
|
+
context.rejectionReason = '';
|
|
49
|
+
return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
|
|
57
50
|
}
|
|
58
51
|
const reason = answer || 'rejected by user';
|
|
59
52
|
console.log(`\x1b[33m→ Plan rejected: ${reason}\x1b[0m`);
|
|
60
|
-
|
|
53
|
+
context.rejectionReason = reason;
|
|
54
|
+
return { onSuccess: false, onFailure: true, ctx: JSON.stringify(context) };
|
|
61
55
|
}
|
|
62
56
|
//# sourceMappingURL=approval-gate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-gate.js","sourceRoot":"","sources":["../../src/node-types/approval-gate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"approval-gate.js","sourceRoot":"","sources":["../../src/node-types/approval-gate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAG1C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAgB,EAChB,GAAW;IAKX,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB,CAAC;IACjD,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IAExB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,eAAe,GAAG,EAAE,CAAC;QAC7B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7E,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IACvB,MAAM,YAAY,GAAG,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,IAAI,QAAQ,CAAC;IAE/G,wCAAwC;IACxC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAS,CAA4C,CAAC;IACtF,IAAI,IAAI,CAAC,OAAO,EAAE,WAAW,IAAI,YAAY,KAAK,MAAM,EAAE,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;QA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AAG,CAAC,gCAAgC,CAAC,CAAC;QAC9C,OAAO,CAAC,eAAe,GAAG,EAAE,CAAC;QAC7B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7E,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,IAAI,kBAAkB,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,4BAA4B,MAAM,SAAS,CAAC,CAAC;IACzD,OAAO,CAAC,eAAe,GAAG,MAAM,CAAC;IACjC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;AAC7E,CAAC"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generates the final bot session report.
|
|
3
|
-
*
|
|
2
|
+
* Generates the final bot session report. Receives context from any
|
|
3
|
+
* of the three paths: read-only, main execution, or abort.
|
|
4
4
|
*
|
|
5
5
|
* @flowWeaver nodeType
|
|
6
6
|
* @expression
|
|
7
7
|
* @label Bot Report
|
|
8
8
|
* @executeWhen DISJUNCTION
|
|
9
|
-
* @input [
|
|
10
|
-
* @input [
|
|
11
|
-
* @input [
|
|
12
|
-
* @input [taskJson] [order:3] - Task (JSON, optional)
|
|
13
|
-
* @input [filesModified] [order:4] - Files modified (JSON array, optional)
|
|
14
|
-
* @input [gitResultJson] [order:5] - Git result (JSON, optional)
|
|
9
|
+
* @input [mainCtx] [order:0] - Context from main path (JSON, optional)
|
|
10
|
+
* @input [readCtx] [order:1] - Context from read-only path (JSON, optional)
|
|
11
|
+
* @input [abortCtx] [order:2] - Context from abort path (JSON, optional)
|
|
15
12
|
* @output summary [order:0] - Summary text
|
|
16
|
-
* @output reportJson [order:1] - Full report (JSON)
|
|
13
|
+
* @output reportJson [order:1] [hidden] - Full report (JSON)
|
|
14
|
+
* @output onFailure [hidden]
|
|
17
15
|
*/
|
|
18
|
-
export declare function weaverBotReport(
|
|
16
|
+
export declare function weaverBotReport(mainCtx?: string, readCtx?: string, abortCtx?: string): {
|
|
19
17
|
summary: string;
|
|
20
18
|
reportJson: string;
|
|
21
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-report.d.ts","sourceRoot":"","sources":["../../src/node-types/bot-report.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bot-report.d.ts","sourceRoot":"","sources":["../../src/node-types/bot-report.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CA4DzC"}
|
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generates the final bot session report.
|
|
3
|
-
*
|
|
2
|
+
* Generates the final bot session report. Receives context from any
|
|
3
|
+
* of the three paths: read-only, main execution, or abort.
|
|
4
4
|
*
|
|
5
5
|
* @flowWeaver nodeType
|
|
6
6
|
* @expression
|
|
7
7
|
* @label Bot Report
|
|
8
8
|
* @executeWhen DISJUNCTION
|
|
9
|
-
* @input [
|
|
10
|
-
* @input [
|
|
11
|
-
* @input [
|
|
12
|
-
* @input [taskJson] [order:3] - Task (JSON, optional)
|
|
13
|
-
* @input [filesModified] [order:4] - Files modified (JSON array, optional)
|
|
14
|
-
* @input [gitResultJson] [order:5] - Git result (JSON, optional)
|
|
9
|
+
* @input [mainCtx] [order:0] - Context from main path (JSON, optional)
|
|
10
|
+
* @input [readCtx] [order:1] - Context from read-only path (JSON, optional)
|
|
11
|
+
* @input [abortCtx] [order:2] - Context from abort path (JSON, optional)
|
|
15
12
|
* @output summary [order:0] - Summary text
|
|
16
|
-
* @output reportJson [order:1] - Full report (JSON)
|
|
13
|
+
* @output reportJson [order:1] [hidden] - Full report (JSON)
|
|
14
|
+
* @output onFailure [hidden]
|
|
17
15
|
*/
|
|
18
|
-
export function weaverBotReport(
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
export function weaverBotReport(mainCtx, readCtx, abortCtx) {
|
|
17
|
+
const ctxStr = mainCtx ?? readCtx ?? abortCtx;
|
|
18
|
+
if (!ctxStr) {
|
|
19
|
+
const report = { task: {}, path: 'unknown', result: null, filesModified: [], gitResult: null, timestamp: Date.now() };
|
|
20
|
+
return { summary: '', reportJson: JSON.stringify(report) };
|
|
21
|
+
}
|
|
22
|
+
const context = JSON.parse(ctxStr);
|
|
23
|
+
const task = context.taskJson ? JSON.parse(context.taskJson) : {};
|
|
24
|
+
const files = context.filesModified ? JSON.parse(context.filesModified) : [];
|
|
25
|
+
const gitResult = context.gitResultJson ? JSON.parse(context.gitResultJson) : null;
|
|
22
26
|
let result = null;
|
|
23
|
-
let
|
|
24
|
-
if (
|
|
25
|
-
result = JSON.parse(
|
|
26
|
-
|
|
27
|
+
let pathName = 'unknown';
|
|
28
|
+
if (readCtx) {
|
|
29
|
+
result = context.resultJson ? JSON.parse(context.resultJson) : null;
|
|
30
|
+
pathName = 'read';
|
|
27
31
|
}
|
|
28
|
-
else if (
|
|
29
|
-
result = JSON.parse(
|
|
30
|
-
|
|
32
|
+
else if (mainCtx) {
|
|
33
|
+
result = context.resultJson ? JSON.parse(context.resultJson) : null;
|
|
34
|
+
pathName = 'main';
|
|
31
35
|
}
|
|
32
|
-
else if (
|
|
33
|
-
result = JSON.parse(
|
|
34
|
-
|
|
36
|
+
else if (abortCtx) {
|
|
37
|
+
result = context.resultJson ? JSON.parse(context.resultJson) : null;
|
|
38
|
+
pathName = 'abort';
|
|
35
39
|
}
|
|
36
40
|
const parts = [];
|
|
37
41
|
if (task.instruction) {
|
|
@@ -51,7 +55,7 @@ export function weaverBotReport(readResult, mainResult, abortResult, taskJson, f
|
|
|
51
55
|
const summary = parts.join(' | ');
|
|
52
56
|
const report = {
|
|
53
57
|
task,
|
|
54
|
-
path,
|
|
58
|
+
path: pathName,
|
|
55
59
|
result,
|
|
56
60
|
filesModified: files,
|
|
57
61
|
gitResult,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-report.js","sourceRoot":"","sources":["../../src/node-types/bot-report.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bot-report.js","sourceRoot":"","sources":["../../src/node-types/bot-report.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAgB,EAChB,OAAgB,EAChB,QAAiB;IAEjB,MAAM,MAAM,GAAG,OAAO,IAAI,OAAO,IAAI,QAAQ,CAAC;IAE9C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;QACtH,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;IAC7D,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAkB,CAAC;IACpD,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAA4C,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7G,MAAM,KAAK,GAAa,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAA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,IAAI,CAAC,YAAY,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,UAAU,KAAK,CAAC,MAAM,WAAW,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,SAAS,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAElC,MAAM,MAAM,GAAG;QACb,IAAI;QACJ,IAAI,EAAE,QAAQ;QACd,MAAM;QACN,aAAa,EAAE,KAAK;QACpB,SAAS;QACT,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;KACtB,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,EAAE,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,eAAe,OAAO,WAAW,CAAC,CAAC;IAE9G,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -6,24 +6,11 @@
|
|
|
6
6
|
* @flowWeaver nodeType
|
|
7
7
|
* @expression
|
|
8
8
|
* @label Build Context
|
|
9
|
-
* @input
|
|
10
|
-
* @
|
|
11
|
-
* @
|
|
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)
|
|
9
|
+
* @input ctx [order:0] - Weaver context (JSON)
|
|
10
|
+
* @output ctx [order:0] - Weaver context with contextBundle (JSON)
|
|
11
|
+
* @output onFailure [hidden]
|
|
20
12
|
*/
|
|
21
|
-
export declare function weaverBuildContext(
|
|
22
|
-
|
|
23
|
-
config: string;
|
|
24
|
-
providerType: string;
|
|
25
|
-
providerInfo: string;
|
|
26
|
-
taskJson: string;
|
|
27
|
-
contextBundle: string;
|
|
13
|
+
export declare function weaverBuildContext(ctx: string): {
|
|
14
|
+
ctx: string;
|
|
28
15
|
};
|
|
29
16
|
//# sourceMappingURL=build-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-context.d.ts","sourceRoot":"","sources":["../../src/node-types/build-context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-context.d.ts","sourceRoot":"","sources":["../../src/node-types/build-context.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CA+C/D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
3
|
import * as path from 'node:path';
|
|
4
4
|
/**
|
|
@@ -9,37 +9,28 @@ import * as path from 'node:path';
|
|
|
9
9
|
* @flowWeaver nodeType
|
|
10
10
|
* @expression
|
|
11
11
|
* @label Build Context
|
|
12
|
-
* @input
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
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)
|
|
12
|
+
* @input ctx [order:0] - Weaver context (JSON)
|
|
13
|
+
* @output ctx [order:0] - Weaver context with contextBundle (JSON)
|
|
14
|
+
* @output onFailure [hidden]
|
|
23
15
|
*/
|
|
24
|
-
export function weaverBuildContext(
|
|
25
|
-
const
|
|
26
|
-
const
|
|
16
|
+
export function weaverBuildContext(ctx) {
|
|
17
|
+
const context = JSON.parse(ctx);
|
|
18
|
+
const { projectDir } = context.env;
|
|
19
|
+
const task = JSON.parse(context.taskJson);
|
|
27
20
|
const sections = [];
|
|
28
|
-
// Base context from flow-weaver CLI
|
|
29
21
|
try {
|
|
30
|
-
const
|
|
22
|
+
const ctxOutput = execFileSync('flow-weaver', ['context', 'authoring', '--profile', 'assistant'], {
|
|
31
23
|
encoding: 'utf-8',
|
|
32
24
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
33
25
|
timeout: 30_000,
|
|
34
26
|
cwd: projectDir,
|
|
35
27
|
}).trim();
|
|
36
|
-
if (
|
|
37
|
-
sections.push(
|
|
28
|
+
if (ctxOutput)
|
|
29
|
+
sections.push(ctxOutput);
|
|
38
30
|
}
|
|
39
31
|
catch {
|
|
40
32
|
sections.push('(flow-weaver context not available)');
|
|
41
33
|
}
|
|
42
|
-
// For modify tasks, read target files
|
|
43
34
|
if (task.mode === 'modify' && task.targets) {
|
|
44
35
|
for (const target of task.targets) {
|
|
45
36
|
const filePath = path.isAbsolute(target) ? target : path.resolve(projectDir, target);
|
|
@@ -52,10 +43,9 @@ export function weaverBuildContext(projectDir, config, providerType, providerInf
|
|
|
52
43
|
catch { /* skip unreadable files */ }
|
|
53
44
|
}
|
|
54
45
|
}
|
|
55
|
-
// For create tasks, list available templates
|
|
56
46
|
if (task.mode === 'create') {
|
|
57
47
|
try {
|
|
58
|
-
const templates =
|
|
48
|
+
const templates = execFileSync('flow-weaver', ['list', 'templates'], {
|
|
59
49
|
encoding: 'utf-8',
|
|
60
50
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
61
51
|
timeout: 10_000,
|
|
@@ -68,6 +58,7 @@ export function weaverBuildContext(projectDir, config, providerType, providerInf
|
|
|
68
58
|
}
|
|
69
59
|
const bundle = sections.join('\n\n---\n\n');
|
|
70
60
|
console.log(`\x1b[36m→ Context bundle: ${bundle.length} chars\x1b[0m`);
|
|
71
|
-
|
|
61
|
+
context.contextBundle = bundle;
|
|
62
|
+
return { ctx: JSON.stringify(context) };
|
|
72
63
|
}
|
|
73
64
|
//# sourceMappingURL=build-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-context.js","sourceRoot":"","sources":["../../src/node-types/build-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"build-context.js","sourceRoot":"","sources":["../../src/node-types/build-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAkB,CAAC;IACjD,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAS,CAA0C,CAAC;IACpF,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,YAAY,CAAC,aAAa,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,EAAE;YAChG,QAAQ,EAA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AAU;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,CAAC,aAAa,GAAG,MAAM,CAAC;IAC/B,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
+
import type { WeaverConfig, WeaverEnv } from '../bot/types.js';
|
|
1
2
|
/**
|
|
2
3
|
* Auto-detect or resolve the configured AI provider.
|
|
4
|
+
* Assembles the WeaverEnv bundle from projectDir, config, and detected provider.
|
|
3
5
|
*
|
|
4
6
|
* @flowWeaver nodeType
|
|
5
7
|
* @expression
|
|
6
8
|
* @label Detect Provider
|
|
7
9
|
* @input projectDir [order:0] - Project root directory
|
|
8
|
-
* @input config [order:1] - Weaver configuration
|
|
9
|
-
* @output
|
|
10
|
-
* @output
|
|
11
|
-
* @output providerType [order:2] - Resolved provider type
|
|
12
|
-
* @output providerInfo [order:3] - Provider details (JSON)
|
|
10
|
+
* @input config [order:1] - Weaver configuration
|
|
11
|
+
* @output env [order:0] - Weaver environment bundle
|
|
12
|
+
* @output onFailure [hidden]
|
|
13
13
|
*/
|
|
14
|
-
export declare function weaverDetectProvider(projectDir: string, config:
|
|
15
|
-
|
|
16
|
-
config: string;
|
|
17
|
-
providerType: string;
|
|
18
|
-
providerInfo: string;
|
|
14
|
+
export declare function weaverDetectProvider(projectDir: string, config: WeaverConfig): {
|
|
15
|
+
env: WeaverEnv;
|
|
19
16
|
};
|
|
20
17
|
//# sourceMappingURL=detect-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-provider.d.ts","sourceRoot":"","sources":["../../src/node-types/detect-provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"detect-provider.d.ts","sourceRoot":"","sources":["../../src/node-types/detect-provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAgB,MAAM,iBAAiB,CAAC;AAY7E;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG;IAC9E,GAAG,EAAE,SAAS,CAAC;CAChB,CA+CA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
2
|
const WHICH_CMD = process.platform === 'win32' ? 'where' : 'which';
|
|
3
3
|
function whichSafe(cmd, cwd) {
|
|
4
4
|
try {
|
|
5
|
-
return
|
|
5
|
+
return execFileSync(WHICH_CMD, [cmd], { cwd, encoding: 'utf-8', stdio: 'pipe' }).trim();
|
|
6
6
|
}
|
|
7
7
|
catch {
|
|
8
8
|
return '';
|
|
@@ -10,20 +10,18 @@ function whichSafe(cmd, cwd) {
|
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Auto-detect or resolve the configured AI provider.
|
|
13
|
+
* Assembles the WeaverEnv bundle from projectDir, config, and detected provider.
|
|
13
14
|
*
|
|
14
15
|
* @flowWeaver nodeType
|
|
15
16
|
* @expression
|
|
16
17
|
* @label Detect Provider
|
|
17
18
|
* @input projectDir [order:0] - Project root directory
|
|
18
|
-
* @input config [order:1] - Weaver configuration
|
|
19
|
-
* @output
|
|
20
|
-
* @output
|
|
21
|
-
* @output providerType [order:2] - Resolved provider type
|
|
22
|
-
* @output providerInfo [order:3] - Provider details (JSON)
|
|
19
|
+
* @input config [order:1] - Weaver configuration
|
|
20
|
+
* @output env [order:0] - Weaver environment bundle
|
|
21
|
+
* @output onFailure [hidden]
|
|
23
22
|
*/
|
|
24
23
|
export function weaverDetectProvider(projectDir, config) {
|
|
25
|
-
const
|
|
26
|
-
const providerSetting = cfg.provider ?? 'auto';
|
|
24
|
+
const providerSetting = config.provider ?? 'auto';
|
|
27
25
|
let type;
|
|
28
26
|
let model;
|
|
29
27
|
let maxTokens;
|
|
@@ -64,9 +62,7 @@ export function weaverDetectProvider(projectDir, config) {
|
|
|
64
62
|
const label = providerInfo.model ? `${type} (${providerInfo.model})` : type;
|
|
65
63
|
console.log(`\x1b[36m→ Provider: ${label}\x1b[0m`);
|
|
66
64
|
return {
|
|
67
|
-
projectDir, config,
|
|
68
|
-
providerType: type,
|
|
69
|
-
providerInfo: JSON.stringify(providerInfo),
|
|
65
|
+
env: { projectDir, config, providerType: type, providerInfo },
|
|
70
66
|
};
|
|
71
67
|
}
|
|
72
68
|
//# sourceMappingURL=detect-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-provider.js","sourceRoot":"","sources":["../../src/node-types/detect-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"detect-provider.js","sourceRoot":"","sources":["../../src/node-types/detect-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;AAEnE,SAAS,SAAS,CAAC,GAAW,EAAE,GAAW;IACzC,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1F,CAAC;IAAC,MAAM,CAAC;QACP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,SAAS,CAAC;QACjE,MAAM,EAAE,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS;KACzE,CAAC;IAEF,IAAI,IAAI,KAAK,WAAW,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IAED,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,YAAY,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,uBAAuB,KAAK,SAAS,CAAC,CAAC;IAEnD,OAAO;QACL,GAAG,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE;KAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -4,35 +4,14 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @flowWeaver nodeType
|
|
6
6
|
* @label Execute & Validate
|
|
7
|
-
* @input
|
|
8
|
-
* @
|
|
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
|
|
7
|
+
* @input ctx [order:0] - Weaver context (JSON)
|
|
8
|
+
* @output ctx [order:0] - Weaver context with results (JSON)
|
|
22
9
|
* @output onSuccess [order:-2] - On Success
|
|
23
|
-
* @output onFailure [order:-1] - On Failure
|
|
10
|
+
* @output onFailure [order:-1] [hidden] - On Failure
|
|
24
11
|
*/
|
|
25
|
-
export declare function weaverExecValidateRetry(execute: boolean,
|
|
12
|
+
export declare function weaverExecValidateRetry(execute: boolean, ctx: string): Promise<{
|
|
26
13
|
onSuccess: boolean;
|
|
27
14
|
onFailure: boolean;
|
|
28
|
-
|
|
29
|
-
config: string;
|
|
30
|
-
providerType: string;
|
|
31
|
-
providerInfo: string;
|
|
32
|
-
resultJson: string;
|
|
33
|
-
validationResultJson: string;
|
|
34
|
-
filesModified: string;
|
|
35
|
-
taskJson: string;
|
|
36
|
-
allValid: boolean;
|
|
15
|
+
ctx: string;
|
|
37
16
|
}>;
|
|
38
17
|
//# sourceMappingURL=exec-validate-retry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec-validate-retry.d.ts","sourceRoot":"","sources":["../../src/node-types/exec-validate-retry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exec-validate-retry.d.ts","sourceRoot":"","sources":["../../src/node-types/exec-validate-retry.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IACT,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IACvC,GAAG,EAAE,MAAM,CAAC;CACb,CAAC,CA0ED"}
|