@synergenius/flowweaver-pack-weaver 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/bot/dashboard.d.ts +3 -0
  2. package/dist/bot/dashboard.d.ts.map +1 -1
  3. package/dist/bot/dashboard.js +141 -0
  4. package/dist/bot/dashboard.js.map +1 -1
  5. package/dist/bot/index.d.ts +8 -1
  6. package/dist/bot/index.d.ts.map +1 -1
  7. package/dist/bot/index.js +5 -0
  8. package/dist/bot/index.js.map +1 -1
  9. package/dist/bot/notifications.d.ts.map +1 -1
  10. package/dist/bot/notifications.js +18 -0
  11. package/dist/bot/notifications.js.map +1 -1
  12. package/dist/bot/session-state.d.ts +19 -0
  13. package/dist/bot/session-state.d.ts.map +1 -0
  14. package/dist/bot/session-state.js +56 -0
  15. package/dist/bot/session-state.js.map +1 -0
  16. package/dist/bot/steering.d.ts +13 -0
  17. package/dist/bot/steering.d.ts.map +1 -0
  18. package/dist/bot/steering.js +35 -0
  19. package/dist/bot/steering.js.map +1 -0
  20. package/dist/bot/system-prompt.d.ts +1 -0
  21. package/dist/bot/system-prompt.d.ts.map +1 -1
  22. package/dist/bot/system-prompt.js +55 -0
  23. package/dist/bot/system-prompt.js.map +1 -1
  24. package/dist/bot/task-queue.d.ts +26 -0
  25. package/dist/bot/task-queue.d.ts.map +1 -0
  26. package/dist/bot/task-queue.js +87 -0
  27. package/dist/bot/task-queue.js.map +1 -0
  28. package/dist/bot/types.d.ts +37 -1
  29. package/dist/bot/types.d.ts.map +1 -1
  30. package/dist/cli-bridge.d.ts.map +1 -1
  31. package/dist/cli-bridge.js +5 -4
  32. package/dist/cli-bridge.js.map +1 -1
  33. package/dist/cli-handlers.d.ts +10 -1
  34. package/dist/cli-handlers.d.ts.map +1 -1
  35. package/dist/cli-handlers.js +261 -0
  36. package/dist/cli-handlers.js.map +1 -1
  37. package/dist/index.d.ts +3 -1
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +3 -1
  40. package/dist/index.js.map +1 -1
  41. package/dist/mcp-tools.d.ts.map +1 -1
  42. package/dist/mcp-tools.js +91 -0
  43. package/dist/mcp-tools.js.map +1 -1
  44. package/dist/node-types/abort-task.d.ts +22 -0
  45. package/dist/node-types/abort-task.d.ts.map +1 -0
  46. package/dist/node-types/abort-task.js +33 -0
  47. package/dist/node-types/abort-task.js.map +1 -0
  48. package/dist/node-types/approval-gate.d.ts +35 -0
  49. package/dist/node-types/approval-gate.d.ts.map +1 -0
  50. package/dist/node-types/approval-gate.js +62 -0
  51. package/dist/node-types/approval-gate.js.map +1 -0
  52. package/dist/node-types/bot-report.d.ts +22 -0
  53. package/dist/node-types/bot-report.d.ts.map +1 -0
  54. package/dist/node-types/bot-report.js +63 -0
  55. package/dist/node-types/bot-report.js.map +1 -0
  56. package/dist/node-types/build-context.d.ts +29 -0
  57. package/dist/node-types/build-context.d.ts.map +1 -0
  58. package/dist/node-types/build-context.js +73 -0
  59. package/dist/node-types/build-context.js.map +1 -0
  60. package/dist/node-types/exec-validate-retry.d.ts +38 -0
  61. package/dist/node-types/exec-validate-retry.d.ts.map +1 -0
  62. package/dist/node-types/exec-validate-retry.js +250 -0
  63. package/dist/node-types/exec-validate-retry.js.map +1 -0
  64. package/dist/node-types/execute-plan.d.ts +34 -0
  65. package/dist/node-types/execute-plan.d.ts.map +1 -0
  66. package/dist/node-types/execute-plan.js +175 -0
  67. package/dist/node-types/execute-plan.js.map +1 -0
  68. package/dist/node-types/fix-errors.d.ts +32 -0
  69. package/dist/node-types/fix-errors.d.ts.map +1 -0
  70. package/dist/node-types/fix-errors.js +106 -0
  71. package/dist/node-types/fix-errors.js.map +1 -0
  72. package/dist/node-types/git-ops.d.ts +18 -0
  73. package/dist/node-types/git-ops.d.ts.map +1 -0
  74. package/dist/node-types/git-ops.js +65 -0
  75. package/dist/node-types/git-ops.js.map +1 -0
  76. package/dist/node-types/index.d.ts +13 -0
  77. package/dist/node-types/index.d.ts.map +1 -1
  78. package/dist/node-types/index.js +13 -0
  79. package/dist/node-types/index.js.map +1 -1
  80. package/dist/node-types/plan-task.d.ts +32 -0
  81. package/dist/node-types/plan-task.d.ts.map +1 -0
  82. package/dist/node-types/plan-task.js +122 -0
  83. package/dist/node-types/plan-task.js.map +1 -0
  84. package/dist/node-types/read-workflow.d.ts +30 -0
  85. package/dist/node-types/read-workflow.d.ts.map +1 -0
  86. package/dist/node-types/read-workflow.js +72 -0
  87. package/dist/node-types/read-workflow.js.map +1 -0
  88. package/dist/node-types/receive-task.d.ts +31 -0
  89. package/dist/node-types/receive-task.d.ts.map +1 -0
  90. package/dist/node-types/receive-task.js +72 -0
  91. package/dist/node-types/receive-task.js.map +1 -0
  92. package/dist/node-types/route-task.d.ts +26 -0
  93. package/dist/node-types/route-task.d.ts.map +1 -0
  94. package/dist/node-types/route-task.js +29 -0
  95. package/dist/node-types/route-task.js.map +1 -0
  96. package/dist/node-types/validate-result.d.ts +32 -0
  97. package/dist/node-types/validate-result.d.ts.map +1 -0
  98. package/dist/node-types/validate-result.js +53 -0
  99. package/dist/node-types/validate-result.js.map +1 -0
  100. package/dist/templates/index.d.ts +2 -0
  101. package/dist/templates/index.d.ts.map +1 -1
  102. package/dist/templates/index.js +3 -1
  103. package/dist/templates/index.js.map +1 -1
  104. package/dist/templates/weaver-bot-template.d.ts +3 -0
  105. package/dist/templates/weaver-bot-template.d.ts.map +1 -0
  106. package/dist/templates/weaver-bot-template.js +99 -0
  107. package/dist/templates/weaver-bot-template.js.map +1 -0
  108. package/dist/workflows/index.d.ts +3 -0
  109. package/dist/workflows/index.d.ts.map +1 -1
  110. package/dist/workflows/index.js +3 -0
  111. package/dist/workflows/index.js.map +1 -1
  112. package/dist/workflows/weaver-bot-batch.d.ts +57 -0
  113. package/dist/workflows/weaver-bot-batch.d.ts.map +1 -0
  114. package/dist/workflows/weaver-bot-batch.js +60 -0
  115. package/dist/workflows/weaver-bot-batch.js.map +1 -0
  116. package/dist/workflows/weaver-bot-session.d.ts +65 -0
  117. package/dist/workflows/weaver-bot-session.d.ts.map +1 -0
  118. package/dist/workflows/weaver-bot-session.js +68 -0
  119. package/dist/workflows/weaver-bot-session.js.map +1 -0
  120. package/dist/workflows/weaver-bot.d.ts +72 -0
  121. package/dist/workflows/weaver-bot.d.ts.map +1 -0
  122. package/dist/workflows/weaver-bot.js +75 -0
  123. package/dist/workflows/weaver-bot.js.map +1 -0
  124. package/flowweaver.manifest.json +720 -3
  125. package/package.json +7 -3
@@ -0,0 +1,72 @@
1
+ import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import * as os from 'node:os';
4
+ /**
5
+ * Receives a task from CLI args, MCP tool call, or the task queue.
6
+ * Parses the instruction into a structured BotTask.
7
+ *
8
+ * @flowWeaver nodeType
9
+ * @label Receive Task
10
+ * @input projectDir [order:0] - Project root directory
11
+ * @input config [order:1] - Weaver configuration (JSON)
12
+ * @input providerType [order:2] - Provider type (pass-through)
13
+ * @input providerInfo [order:3] - Provider info (JSON, pass-through)
14
+ * @input [taskJson] [order:4] - Pre-supplied task (JSON, optional)
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 taskJson [order:4] - Parsed task (JSON)
20
+ * @output hasTask [order:5] - Whether a task was found
21
+ * @output onSuccess [order:-2] - On Success
22
+ * @output onFailure [order:-1] - On Failure
23
+ */
24
+ export async function weaverReceiveTask(execute, projectDir, config, providerType, providerInfo, taskJson) {
25
+ const passthrough = { projectDir, config, providerType, providerInfo };
26
+ if (!execute) {
27
+ return { onSuccess: true, onFailure: false, ...passthrough, taskJson: '{}', hasTask: false };
28
+ }
29
+ // If taskJson is pre-supplied, use it directly
30
+ if (taskJson) {
31
+ try {
32
+ const parsed = JSON.parse(taskJson);
33
+ if (parsed.instruction) {
34
+ console.log(`\x1b[36m→ Task received: ${parsed.instruction.slice(0, 80)}\x1b[0m`);
35
+ return { onSuccess: true, onFailure: false, ...passthrough, taskJson, hasTask: true };
36
+ }
37
+ }
38
+ catch { /* fall through to queue check */ }
39
+ }
40
+ // Check task queue
41
+ const queuePath = path.join(os.homedir(), '.weaver', 'task-queue.ndjson');
42
+ try {
43
+ if (fs.existsSync(queuePath)) {
44
+ const content = fs.readFileSync(queuePath, 'utf-8').trim();
45
+ if (content) {
46
+ const tasks = content.split('\n').map(l => JSON.parse(l));
47
+ const pending = tasks
48
+ .filter(t => t.status === 'pending')
49
+ .sort((a, b) => b.priority - a.priority || a.addedAt - b.addedAt);
50
+ if (pending.length > 0) {
51
+ const task = pending[0];
52
+ // Mark as running
53
+ const updated = tasks.map(t => t.id === task.id ? { ...t, status: 'running' } : t);
54
+ fs.writeFileSync(queuePath, updated.map(t => JSON.stringify(t)).join('\n') + '\n', 'utf-8');
55
+ const botTask = {
56
+ instruction: task.instruction,
57
+ mode: task.mode ?? 'create',
58
+ targets: task.targets,
59
+ options: task.options,
60
+ queueId: task.id,
61
+ };
62
+ console.log(`\x1b[36m→ Task from queue [${task.id}]: ${task.instruction.slice(0, 80)}\x1b[0m`);
63
+ return { onSuccess: true, onFailure: false, ...passthrough, taskJson: JSON.stringify(botTask), hasTask: true };
64
+ }
65
+ }
66
+ }
67
+ }
68
+ catch { /* ignore queue errors */ }
69
+ console.log('\x1b[33m→ No task found\x1b[0m');
70
+ return { onSuccess: false, onFailure: true, ...passthrough, taskJson: '{}', hasTask: false };
71
+ }
72
+ //# sourceMappingURL=receive-task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receive-task.js","sourceRoot":"","sources":["../../src/node-types/receive-task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAa9B;;;;;;;;;;;;;;;;;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G,CAAC,8BAA8B,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC;oBAC/F,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gBACjH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAC,yBAAyB,CAAC,CAAC;IAErC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC/F,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Routes based on task mode. onSuccess fires for actionable tasks
3
+ * (create/modify/batch). onFailure fires for read-only tasks.
4
+ *
5
+ * @flowWeaver nodeType
6
+ * @expression
7
+ * @label Route Task
8
+ * @input projectDir [order:0] - Project root directory
9
+ * @input config [order:1] - Config (JSON)
10
+ * @input providerType [order:2] - Provider type
11
+ * @input providerInfo [order:3] - Provider info (JSON)
12
+ * @input taskJson [order:4] - 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 taskJson [order:4] - Task (pass-through)
18
+ */
19
+ export declare function weaverRouteTask(projectDir: string, config: string, providerType: string, providerInfo: string, taskJson: string): {
20
+ projectDir: string;
21
+ config: string;
22
+ providerType: string;
23
+ providerInfo: string;
24
+ taskJson: string;
25
+ };
26
+ //# sourceMappingURL=route-task.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-task.d.ts","sourceRoot":"","sources":["../../src/node-types/route-task.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACf;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAWtG"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Routes based on task mode. onSuccess fires for actionable tasks
3
+ * (create/modify/batch). onFailure fires for read-only tasks.
4
+ *
5
+ * @flowWeaver nodeType
6
+ * @expression
7
+ * @label Route Task
8
+ * @input projectDir [order:0] - Project root directory
9
+ * @input config [order:1] - Config (JSON)
10
+ * @input providerType [order:2] - Provider type
11
+ * @input providerInfo [order:3] - Provider info (JSON)
12
+ * @input taskJson [order:4] - 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 taskJson [order:4] - Task (pass-through)
18
+ */
19
+ export function weaverRouteTask(projectDir, config, providerType, providerInfo, taskJson) {
20
+ const task = JSON.parse(taskJson);
21
+ const mode = task.mode ?? 'create';
22
+ if (mode === 'read') {
23
+ console.log('\x1b[36m→ Routing to read-only path\x1b[0m');
24
+ throw new Error('read-only-route');
25
+ }
26
+ console.log(`\x1b[36m→ Routing to ${mode} path\x1b[0m`);
27
+ return { projectDir, config, providerType, providerInfo, taskJson };
28
+ }
29
+ //# sourceMappingURL=route-task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-task.js","sourceRoot":"","sources":["../../src/node-types/route-task.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,eAAe,CAC7B,UAAkB,EAClB,MAAc,EACd,YAAoB,EACpB,YAAoB,EACpB,QAAgB;IAEhB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAsB,CAAC;IACvD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC;IAEnC,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,cAAc,CAAC,CAAC;IACxD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;AACtE,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Validates all modified/created files using flow-weaver validate
3
+ * and compile. Branches on validation success/failure.
4
+ *
5
+ * @flowWeaver nodeType
6
+ * @expression
7
+ * @label Validate Result
8
+ * @input projectDir [order:0] - Project root directory
9
+ * @input config [order:1] - Config (JSON, pass-through)
10
+ * @input providerType [order:2] - Provider type (pass-through)
11
+ * @input providerInfo [order:3] - Provider info (pass-through)
12
+ * @input executionResultJson [order:4] - Execution result (JSON)
13
+ * @input taskJson [order:5] - Task (JSON, pass-through)
14
+ * @input filesModified [order:6] - Files modified (JSON array)
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 validationResultJson [order:4] - Validation results (JSON)
20
+ * @output taskJson [order:5] - Task (pass-through)
21
+ * @output allValid [order:6] - Whether all files passed validation
22
+ */
23
+ export declare function weaverValidateResult(projectDir: string, config: string, providerType: string, providerInfo: string, executionResultJson: string, taskJson: string, filesModified: string): {
24
+ projectDir: string;
25
+ config: string;
26
+ providerType: string;
27
+ providerInfo: string;
28
+ validationResultJson: string;
29
+ taskJson: string;
30
+ allValid: boolean;
31
+ };
32
+ //# sourceMappingURL=validate-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-result.d.ts","sourceRoot":"","sources":["../../src/node-types/validate-result.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,GACpB;IACD,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAC/E,oBAAoB,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;CACnE,CA+BA"}
@@ -0,0 +1,53 @@
1
+ import { execSync } from 'node:child_process';
2
+ /**
3
+ * Validates all modified/created files using flow-weaver validate
4
+ * and compile. Branches on validation success/failure.
5
+ *
6
+ * @flowWeaver nodeType
7
+ * @expression
8
+ * @label Validate Result
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 (pass-through)
13
+ * @input executionResultJson [order:4] - Execution result (JSON)
14
+ * @input taskJson [order:5] - Task (JSON, pass-through)
15
+ * @input filesModified [order:6] - Files modified (JSON array)
16
+ * @output projectDir [order:0] - Project root directory (pass-through)
17
+ * @output config [order:1] - Config (pass-through)
18
+ * @output providerType [order:2] - Provider type (pass-through)
19
+ * @output providerInfo [order:3] - Provider info (pass-through)
20
+ * @output validationResultJson [order:4] - Validation results (JSON)
21
+ * @output taskJson [order:5] - Task (pass-through)
22
+ * @output allValid [order:6] - Whether all files passed validation
23
+ */
24
+ export function weaverValidateResult(projectDir, config, providerType, providerInfo, executionResultJson, taskJson, filesModified) {
25
+ const files = JSON.parse(filesModified);
26
+ const results = [];
27
+ for (const file of files) {
28
+ if (!file.endsWith('.ts'))
29
+ continue;
30
+ try {
31
+ execSync(`flow-weaver validate "${file}"`, {
32
+ cwd: projectDir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 30_000,
33
+ });
34
+ results.push({ file, valid: true, errors: [], warnings: [] });
35
+ console.log(`\x1b[32m ✓ ${file}\x1b[0m`);
36
+ }
37
+ catch (err) {
38
+ const stderr = err.stderr ?? (err instanceof Error ? err.message : String(err));
39
+ results.push({ file, valid: false, errors: [stderr], warnings: [] });
40
+ console.log(`\x1b[31m x ${file}: ${stderr.slice(0, 100)}\x1b[0m`);
41
+ }
42
+ }
43
+ const allValid = results.length === 0 || results.every(r => r.valid);
44
+ if (!allValid) {
45
+ throw new Error('Validation failed: ' + results.filter(r => !r.valid).map(r => r.file).join(', '));
46
+ }
47
+ return {
48
+ projectDir, config, providerType, providerInfo,
49
+ validationResultJson: JSON.stringify(results),
50
+ taskJson, allValid,
51
+ };
52
+ }
53
+ //# sourceMappingURL=validate-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-result.js","sourceRoot":"","sources":["../../src/node-types/validate-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,oBAAoB,CAClC,UAAkB,EAClB,MAAc,EACd,YAAoB,EACpB,YAAoB,EACpB,mBAA2B,EAC3B,QAAgB,EAChB,aAAqB;IAKrB,MAAM,KAAK,GAAa,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;IAErE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrG,CAAC;IAED,OAAO;QACL,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY;QAC9C,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;QAC7C,QAAQ,EAAE,QAAQ;KACnB,CAAC;AACJ,CAAC"}
@@ -1,5 +1,7 @@
1
1
  import { weaverTemplate } from './weaver-template.js';
2
+ import { weaverBotTemplate } from './weaver-bot-template.js';
2
3
  export type { WorkflowTemplate } from './weaver-template.js';
3
4
  export { weaverTemplate };
5
+ export { weaverBotTemplate };
4
6
  export declare const workflowTemplates: import("./weaver-template.js").WorkflowTemplate[];
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,eAAO,MAAM,iBAAiB,mDAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,eAAO,MAAM,iBAAiB,mDAAsC,CAAC"}
@@ -1,4 +1,6 @@
1
1
  import { weaverTemplate } from './weaver-template.js';
2
+ import { weaverBotTemplate } from './weaver-bot-template.js';
2
3
  export { weaverTemplate };
3
- export const workflowTemplates = [weaverTemplate];
4
+ export { weaverBotTemplate };
5
+ export const workflowTemplates = [weaverTemplate, weaverBotTemplate];
4
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { WorkflowTemplate } from './weaver-template.js';
2
+ export declare const weaverBotTemplate: WorkflowTemplate;
3
+ //# sourceMappingURL=weaver-bot-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weaver-bot-template.d.ts","sourceRoot":"","sources":["../../src/templates/weaver-bot-template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,eAAO,MAAM,iBAAiB,EAAE,gBAiG/B,CAAC"}
@@ -0,0 +1,99 @@
1
+ export const weaverBotTemplate = {
2
+ id: 'weaver-bot',
3
+ name: 'Weaver Bot: Autonomous workflow creator',
4
+ description: 'AI-powered bot that creates, modifies, and manages Flow Weaver workflows autonomously from natural language instructions',
5
+ category: 'automation',
6
+ generate: (_opts) => {
7
+ return `// Generated by flowweaver-pack-weaver. Compile before running:
8
+ // flow-weaver compile weaver-bot.ts
9
+ // flow-weaver weaver bot "Create a hello world workflow"
10
+
11
+ import { weaverLoadConfig } from '@synergenius/flowweaver-pack-weaver/node-types';
12
+ import { weaverDetectProvider } from '@synergenius/flowweaver-pack-weaver/node-types';
13
+ import { weaverReceiveTask } from '@synergenius/flowweaver-pack-weaver/node-types';
14
+ import { weaverRouteTask } from '@synergenius/flowweaver-pack-weaver/node-types';
15
+ import { weaverReadWorkflow } from '@synergenius/flowweaver-pack-weaver/node-types';
16
+ import { weaverBuildContext } from '@synergenius/flowweaver-pack-weaver/node-types';
17
+ import { weaverPlanTask } from '@synergenius/flowweaver-pack-weaver/node-types';
18
+ import { weaverApprovalGate } from '@synergenius/flowweaver-pack-weaver/node-types';
19
+ import { weaverAbortTask } from '@synergenius/flowweaver-pack-weaver/node-types';
20
+ import { weaverExecValidateRetry } from '@synergenius/flowweaver-pack-weaver/node-types';
21
+ import { weaverGitOps } from '@synergenius/flowweaver-pack-weaver/node-types';
22
+ import { weaverSendNotify } from '@synergenius/flowweaver-pack-weaver/node-types';
23
+ import { weaverBotReport } from '@synergenius/flowweaver-pack-weaver/node-types';
24
+
25
+ /**
26
+ * Autonomous workflow bot.
27
+ *
28
+ * @flowWeaver workflow
29
+ *
30
+ * @node cfg weaverLoadConfig [color: "slate"] [icon: "settings"] [position: 80 200]
31
+ * @node detect weaverDetectProvider [color: "cyan"] [icon: "search"] [position: 230 200]
32
+ * @node receive weaverReceiveTask [color: "indigo"] [icon: "inbox"] [position: 400 200]
33
+ * @node route weaverRouteTask [color: "violet"] [icon: "alt_route"] [position: 570 200]
34
+ * @node readWf weaverReadWorkflow [color: "sky"] [icon: "visibility"] [position: 740 450]
35
+ * @node context weaverBuildContext [color: "teal"] [icon: "auto_stories"] [position: 740 200]
36
+ * @node plan weaverPlanTask [color: "blue"] [icon: "psychology"] [position: 910 200]
37
+ * @node approve weaverApprovalGate [color: "amber"] [icon: "gavel"] [position: 1080 200]
38
+ * @node abort weaverAbortTask [color: "red"] [icon: "cancel"] [position: 1250 450]
39
+ * @node execRetry weaverExecValidateRetry [color: "purple"] [icon: "replay"] [position: 1250 200]
40
+ * @node gitOps weaverGitOps [color: "stone"] [icon: "commit"] [position: 1420 100]
41
+ * @node notify weaverSendNotify [color: "yellow"] [icon: "notifications"] [position: 1420 300]
42
+ * @node report weaverBotReport [color: "green"] [icon: "summarize"] [position: 1600 200]
43
+ *
44
+ * @path Start -> cfg -> detect -> receive -> route -> context -> plan -> approve -> execRetry -> gitOps -> report -> Exit
45
+ * @path Start -> execRetry -> notify -> report -> Exit
46
+ * @path Start -> route:fail -> readWf -> report -> Exit
47
+ * @path Start -> approve:fail -> abort -> report -> Exit
48
+ *
49
+ * @connect route.taskJson -> readWf.taskJson
50
+ * @connect route.projectDir -> readWf.projectDir
51
+ * @connect readWf.resultJson -> report.readResult
52
+ * @connect readWf.taskJson -> report.taskJson
53
+ * @connect route.taskJson -> context.taskJson
54
+ * @connect context.contextBundle -> plan.contextBundle
55
+ * @connect plan.planJson -> approve.planJson
56
+ * @connect approve.rejectionReason -> abort.rejectionReason
57
+ * @connect approve.taskJson -> abort.taskJson
58
+ * @connect approve.projectDir -> abort.projectDir
59
+ * @connect abort.resultJson -> report.abortResult
60
+ * @connect abort.taskJson -> report.taskJson
61
+ * @connect approve.planJson -> execRetry.planJson
62
+ * @connect approve.taskJson -> execRetry.taskJson
63
+ * @connect execRetry.filesModified -> gitOps.filesModified
64
+ * @connect execRetry.projectDir -> gitOps.projectDir
65
+ * @connect cfg.config -> gitOps.config
66
+ * @connect execRetry.resultJson -> notify.resultJson
67
+ * @connect execRetry.projectDir -> notify.projectDir
68
+ * @connect cfg.config -> notify.config
69
+ * @connect execRetry.resultJson -> report.mainResult
70
+ * @connect execRetry.filesModified -> report.filesModified
71
+ * @connect receive.taskJson -> report.taskJson
72
+ * @connect gitOps.gitResultJson -> report.gitResultJson
73
+ * @connect report.summary -> Exit.summary
74
+ *
75
+ * @position Start 0 200
76
+ * @position Exit 1750 200
77
+ *
78
+ * @param execute [order:-1] - Execute
79
+ * @param taskJson [order:0] [optional] - Task instruction (JSON)
80
+ * @param projectDir [order:1] [optional] - Project directory
81
+ * @returns onSuccess [order:-2] - On Success
82
+ * @returns onFailure [order:-1] - On Failure
83
+ * @returns summary [order:0] - Summary text
84
+ */
85
+ export async function weaverBot(
86
+ execute: boolean,
87
+ taskJson?: string,
88
+ projectDir?: string,
89
+ __abortSignal__?: AbortSignal,
90
+ ): Promise<{ onSuccess: boolean; onFailure: boolean; summary: string | null }> {
91
+ // @flow-weaver-body-start
92
+ // (auto-generated by compiler)
93
+ // @flow-weaver-body-end
94
+ return { onSuccess: false, onFailure: true, summary: null };
95
+ }
96
+ `;
97
+ },
98
+ };
99
+ //# sourceMappingURL=weaver-bot-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weaver-bot-template.js","sourceRoot":"","sources":["../../src/templates/weaver-bot-template.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAqB;IACjD,EAAE,EAAE,YAAY;IAChB,IAAI,EAAE,yCAAyC;IAC/C,WAAW,EAAE,0HAA0H;IACvI,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;QAClB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyFV,CAAC;IACA,CAAC;CACF,CAAC"}
@@ -1,2 +1,5 @@
1
1
  export { weaver } from './weaver.js';
2
+ export { weaverBot } from './weaver-bot.js';
3
+ export { weaverBotBatch } from './weaver-bot-batch.js';
4
+ export { weaverBotSession } from './weaver-bot-session.js';
2
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workflows/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workflows/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,2 +1,5 @@
1
1
  export { weaver } from './weaver.js';
2
+ export { weaverBot } from './weaver-bot.js';
3
+ export { weaverBotBatch } from './weaver-bot-batch.js';
4
+ export { weaverBotSession } from './weaver-bot-session.js';
2
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflows/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflows/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Batch workflow bot. Processes multiple sub-tasks sequentially,
3
+ * running the full plan-approve-execute cycle for each.
4
+ *
5
+ * @flowWeaver workflow
6
+ *
7
+ * @node cfg weaverLoadConfig [color: "teal"] [icon: "settings"] [position: 80 200]
8
+ * @node detect weaverDetectProvider [color: "cyan"] [icon: "search"] [position: 230 200]
9
+ * @node receive weaverReceiveTask [color: "blue"] [icon: "send"] [position: 380 200]
10
+ * @node context weaverBuildContext [color: "teal"] [icon: "code"] [position: 530 200]
11
+ * @node plan weaverPlanTask [color: "blue"] [icon: "psychology"] [position: 680 200]
12
+ * @node approve weaverApprovalGate [color: "orange"] [icon: "send"] [position: 830 200]
13
+ * @node abort weaverAbortTask [color: "red"] [icon: "code"] [position: 980 400]
14
+ * @node execRetry weaverExecValidateRetry [color: "purple"] [icon: "code"] [position: 980 200]
15
+ * @node gitOps weaverGitOps [color: "green"] [icon: "code"] [position: 1130 100]
16
+ * @node notify weaverSendNotify [color: "yellow"] [icon: "send"] [position: 1130 300]
17
+ * @node report weaverBotReport [color: "green"] [icon: "description"] [position: 1300 200]
18
+ *
19
+ * @path Start -> cfg -> detect -> receive -> context -> plan -> approve -> execRetry -> gitOps -> report -> Exit
20
+ * @path execRetry -> notify
21
+ * @path approve:fail -> abort
22
+ *
23
+ * @connect notify.onSuccess -> report.execute
24
+ * @connect abort.onSuccess -> report.execute
25
+ *
26
+ * @connect context.contextBundle -> plan.contextBundle
27
+ *
28
+ * @connect approve.rejectionReason -> abort.rejectionReason
29
+ * @connect approve.taskJson -> abort.taskJson
30
+ * @connect approve.projectDir -> abort.projectDir
31
+ * @connect abort.resultJson -> report.abortResult
32
+ *
33
+ * @connect execRetry.resultJson -> notify.resultJson
34
+ * @connect execRetry.projectDir -> notify.targetPath
35
+ *
36
+ * @connect execRetry.resultJson -> report.mainResult
37
+ * @connect execRetry.filesModified -> report.filesModified
38
+ * @connect gitOps.gitResultJson -> report.gitResultJson
39
+ *
40
+ * @connect report.summary -> Exit.summary
41
+ *
42
+ * @position Start 0 200
43
+ * @position Exit 1450 200
44
+ *
45
+ * @param execute [order:-1] - Execute
46
+ * @param taskJson [order:0] [optional] - Batch task instruction (JSON)
47
+ * @param projectDir [order:1] [optional] - Project directory
48
+ * @returns onSuccess [order:-2] - On Success
49
+ * @returns onFailure [order:-1] - On Failure
50
+ * @returns summary [order:0] - Summary text
51
+ */
52
+ export declare function weaverBotBatch(execute: boolean, taskJson?: string, projectDir?: string, __abortSignal__?: AbortSignal): Promise<{
53
+ onSuccess: boolean;
54
+ onFailure: boolean;
55
+ summary: string | null;
56
+ }>;
57
+ //# sourceMappingURL=weaver-bot-batch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weaver-bot-batch.d.ts","sourceRoot":"","sources":["../../src/workflows/weaver-bot-batch.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE,WAAW,GAC5B,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAK7E"}
@@ -0,0 +1,60 @@
1
+ // Managed weaver bot batch workflow - processes multiple tasks via forEach scope.
2
+ // Run `weaver eject` to customize.
3
+ /**
4
+ * Batch workflow bot. Processes multiple sub-tasks sequentially,
5
+ * running the full plan-approve-execute cycle for each.
6
+ *
7
+ * @flowWeaver workflow
8
+ *
9
+ * @node cfg weaverLoadConfig [color: "teal"] [icon: "settings"] [position: 80 200]
10
+ * @node detect weaverDetectProvider [color: "cyan"] [icon: "search"] [position: 230 200]
11
+ * @node receive weaverReceiveTask [color: "blue"] [icon: "send"] [position: 380 200]
12
+ * @node context weaverBuildContext [color: "teal"] [icon: "code"] [position: 530 200]
13
+ * @node plan weaverPlanTask [color: "blue"] [icon: "psychology"] [position: 680 200]
14
+ * @node approve weaverApprovalGate [color: "orange"] [icon: "send"] [position: 830 200]
15
+ * @node abort weaverAbortTask [color: "red"] [icon: "code"] [position: 980 400]
16
+ * @node execRetry weaverExecValidateRetry [color: "purple"] [icon: "code"] [position: 980 200]
17
+ * @node gitOps weaverGitOps [color: "green"] [icon: "code"] [position: 1130 100]
18
+ * @node notify weaverSendNotify [color: "yellow"] [icon: "send"] [position: 1130 300]
19
+ * @node report weaverBotReport [color: "green"] [icon: "description"] [position: 1300 200]
20
+ *
21
+ * @path Start -> cfg -> detect -> receive -> context -> plan -> approve -> execRetry -> gitOps -> report -> Exit
22
+ * @path execRetry -> notify
23
+ * @path approve:fail -> abort
24
+ *
25
+ * @connect notify.onSuccess -> report.execute
26
+ * @connect abort.onSuccess -> report.execute
27
+ *
28
+ * @connect context.contextBundle -> plan.contextBundle
29
+ *
30
+ * @connect approve.rejectionReason -> abort.rejectionReason
31
+ * @connect approve.taskJson -> abort.taskJson
32
+ * @connect approve.projectDir -> abort.projectDir
33
+ * @connect abort.resultJson -> report.abortResult
34
+ *
35
+ * @connect execRetry.resultJson -> notify.resultJson
36
+ * @connect execRetry.projectDir -> notify.targetPath
37
+ *
38
+ * @connect execRetry.resultJson -> report.mainResult
39
+ * @connect execRetry.filesModified -> report.filesModified
40
+ * @connect gitOps.gitResultJson -> report.gitResultJson
41
+ *
42
+ * @connect report.summary -> Exit.summary
43
+ *
44
+ * @position Start 0 200
45
+ * @position Exit 1450 200
46
+ *
47
+ * @param execute [order:-1] - Execute
48
+ * @param taskJson [order:0] [optional] - Batch task instruction (JSON)
49
+ * @param projectDir [order:1] [optional] - Project directory
50
+ * @returns onSuccess [order:-2] - On Success
51
+ * @returns onFailure [order:-1] - On Failure
52
+ * @returns summary [order:0] - Summary text
53
+ */
54
+ export async function weaverBotBatch(execute, taskJson, projectDir, __abortSignal__) {
55
+ // @flow-weaver-body-start
56
+ // (auto-generated by compiler)
57
+ // @flow-weaver-body-end
58
+ return { onSuccess: false, onFailure: true, summary: null };
59
+ }
60
+ //# sourceMappingURL=weaver-bot-batch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weaver-bot-batch.js","sourceRoot":"","sources":["../../src/workflows/weaver-bot-batch.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,mCAAmC;AAcnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAAgB,EAChB,QAAiB,EACjB,UAAmB,EACnB,eAA6B;IAE7B,0BAA0B;IAC1B,+BAA+B;IAC/B,wBAAwB;IACxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Session mode bot. Continuously polls the task queue and processes
3
+ * tasks through the full bot pipeline.
4
+ *
5
+ * @flowWeaver workflow
6
+ *
7
+ * @node cfg weaverLoadConfig [color: "teal"] [icon: "settings"] [position: 80 200]
8
+ * @node detect weaverDetectProvider [color: "cyan"] [icon: "search"] [position: 230 200]
9
+ * @node receive weaverReceiveTask [color: "blue"] [icon: "send"] [position: 400 200]
10
+ * @node route weaverRouteTask [color: "purple"] [icon: "flow"] [position: 570 200]
11
+ * @node readWf weaverReadWorkflow [color: "cyan"] [icon: "description"] [position: 740 450]
12
+ * @node context weaverBuildContext [color: "teal"] [icon: "code"] [position: 740 200]
13
+ * @node plan weaverPlanTask [color: "blue"] [icon: "psychology"] [position: 910 200]
14
+ * @node approve weaverApprovalGate [color: "orange"] [icon: "send"] [position: 1080 200]
15
+ * @node abort weaverAbortTask [color: "red"] [icon: "code"] [position: 1250 450]
16
+ * @node execRetry weaverExecValidateRetry [color: "purple"] [icon: "code"] [position: 1250 200]
17
+ * @node gitOps weaverGitOps [color: "green"] [icon: "code"] [position: 1420 100]
18
+ * @node notify weaverSendNotify [color: "yellow"] [icon: "send"] [position: 1420 300]
19
+ * @node report weaverBotReport [color: "green"] [icon: "description"] [position: 1600 200]
20
+ *
21
+ * @path Start -> cfg -> detect -> receive -> route -> context -> plan -> approve -> execRetry -> gitOps -> report -> Exit
22
+ * @path execRetry -> notify
23
+ * @path route:fail -> readWf
24
+ * @path approve:fail -> abort
25
+ *
26
+ * @connect readWf.onSuccess -> report.execute
27
+ * @connect abort.onSuccess -> report.execute
28
+ * @connect notify.onSuccess -> report.execute
29
+ *
30
+ * @connect route.taskJson -> readWf.taskJson
31
+ * @connect route.projectDir -> readWf.projectDir
32
+ * @connect readWf.resultJson -> report.readResult
33
+ *
34
+ * @connect context.contextBundle -> plan.contextBundle
35
+ *
36
+ * @connect approve.rejectionReason -> abort.rejectionReason
37
+ * @connect approve.taskJson -> abort.taskJson
38
+ * @connect approve.projectDir -> abort.projectDir
39
+ * @connect abort.resultJson -> report.abortResult
40
+ *
41
+ * @connect execRetry.resultJson -> notify.resultJson
42
+ * @connect execRetry.projectDir -> notify.targetPath
43
+ *
44
+ * @connect execRetry.resultJson -> report.mainResult
45
+ * @connect execRetry.filesModified -> report.filesModified
46
+ * @connect gitOps.gitResultJson -> report.gitResultJson
47
+ *
48
+ * @connect report.summary -> Exit.summary
49
+ *
50
+ * @position Start 0 200
51
+ * @position Exit 1750 200
52
+ *
53
+ * @param execute [order:-1] - Execute
54
+ * @param taskJson [order:0] [optional] - Task instruction (JSON)
55
+ * @param projectDir [order:1] [optional] - Project directory
56
+ * @returns onSuccess [order:-2] - On Success
57
+ * @returns onFailure [order:-1] - On Failure
58
+ * @returns summary [order:0] - Summary text
59
+ */
60
+ export declare function weaverBotSession(execute: boolean, taskJson?: string, projectDir?: string, __abortSignal__?: AbortSignal): Promise<{
61
+ onSuccess: boolean;
62
+ onFailure: boolean;
63
+ summary: string | null;
64
+ }>;
65
+ //# sourceMappingURL=weaver-bot-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weaver-bot-session.d.ts","sourceRoot":"","sources":["../../src/workflows/weaver-bot-session.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE,WAAW,GAC5B,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAK7E"}