@synergenius/flow-weaver-pack-weaver 0.9.193 → 0.9.196

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 (117) hide show
  1. package/dist/bot/ai-client.d.ts +5 -0
  2. package/dist/bot/ai-client.d.ts.map +1 -1
  3. package/dist/bot/ai-client.js +43 -0
  4. package/dist/bot/ai-client.js.map +1 -1
  5. package/dist/bot/assistant-core.js +2 -2
  6. package/dist/bot/assistant-core.js.map +1 -1
  7. package/dist/bot/behavior-defaults.d.ts +3 -1
  8. package/dist/bot/behavior-defaults.d.ts.map +1 -1
  9. package/dist/bot/behavior-defaults.js +7 -0
  10. package/dist/bot/behavior-defaults.js.map +1 -1
  11. package/dist/bot/capability-registry.js +3 -3
  12. package/dist/bot/capability-registry.js.map +1 -1
  13. package/dist/bot/context-compactor.d.ts +35 -0
  14. package/dist/bot/context-compactor.d.ts.map +1 -0
  15. package/dist/bot/context-compactor.js +130 -0
  16. package/dist/bot/context-compactor.js.map +1 -0
  17. package/dist/bot/dream-task.d.ts +45 -0
  18. package/dist/bot/dream-task.d.ts.map +1 -0
  19. package/dist/bot/dream-task.js +125 -0
  20. package/dist/bot/dream-task.js.map +1 -0
  21. package/dist/bot/knowledge-store.d.ts +9 -0
  22. package/dist/bot/knowledge-store.d.ts.map +1 -1
  23. package/dist/bot/knowledge-store.js +21 -0
  24. package/dist/bot/knowledge-store.js.map +1 -1
  25. package/dist/bot/memory-extraction-worker.d.ts +14 -0
  26. package/dist/bot/memory-extraction-worker.d.ts.map +1 -0
  27. package/dist/bot/memory-extraction-worker.js +42 -0
  28. package/dist/bot/memory-extraction-worker.js.map +1 -0
  29. package/dist/bot/memory-extractor.d.ts +27 -0
  30. package/dist/bot/memory-extractor.d.ts.map +1 -0
  31. package/dist/bot/memory-extractor.js +155 -0
  32. package/dist/bot/memory-extractor.js.map +1 -0
  33. package/dist/bot/operations.d.ts +3 -1
  34. package/dist/bot/operations.d.ts.map +1 -1
  35. package/dist/bot/operations.js +3 -1
  36. package/dist/bot/operations.js.map +1 -1
  37. package/dist/bot/post-turn-hooks.d.ts +57 -0
  38. package/dist/bot/post-turn-hooks.d.ts.map +1 -0
  39. package/dist/bot/post-turn-hooks.js +108 -0
  40. package/dist/bot/post-turn-hooks.js.map +1 -0
  41. package/dist/bot/profile-types.d.ts +16 -0
  42. package/dist/bot/profile-types.d.ts.map +1 -1
  43. package/dist/bot/swarm-controller.d.ts +7 -0
  44. package/dist/bot/swarm-controller.d.ts.map +1 -1
  45. package/dist/bot/swarm-controller.js +121 -1
  46. package/dist/bot/swarm-controller.js.map +1 -1
  47. package/dist/bot/task-prompt-builder.js +35 -21
  48. package/dist/bot/task-prompt-builder.js.map +1 -1
  49. package/dist/bot/task-types.d.ts +13 -0
  50. package/dist/bot/task-types.d.ts.map +1 -1
  51. package/dist/bot/tool-registry.d.ts +13 -0
  52. package/dist/bot/tool-registry.d.ts.map +1 -1
  53. package/dist/bot/tool-registry.js +80 -0
  54. package/dist/bot/tool-registry.js.map +1 -1
  55. package/dist/bot/types.d.ts +2 -0
  56. package/dist/bot/types.d.ts.map +1 -1
  57. package/dist/node-types/agent-execute.d.ts.map +1 -1
  58. package/dist/node-types/agent-execute.js +38 -17
  59. package/dist/node-types/agent-execute.js.map +1 -1
  60. package/dist/node-types/build-context.d.ts +4 -3
  61. package/dist/node-types/build-context.d.ts.map +1 -1
  62. package/dist/node-types/build-context.js +37 -6
  63. package/dist/node-types/build-context.js.map +1 -1
  64. package/dist/node-types/receive-task.d.ts +2 -1
  65. package/dist/node-types/receive-task.d.ts.map +1 -1
  66. package/dist/node-types/receive-task.js +4 -1
  67. package/dist/node-types/receive-task.js.map +1 -1
  68. package/dist/node-types/review-result.d.ts +9 -0
  69. package/dist/node-types/review-result.d.ts.map +1 -1
  70. package/dist/node-types/review-result.js +20 -5
  71. package/dist/node-types/review-result.js.map +1 -1
  72. package/dist/node-types/verify-task.d.ts +22 -0
  73. package/dist/node-types/verify-task.d.ts.map +1 -0
  74. package/dist/node-types/verify-task.js +143 -0
  75. package/dist/node-types/verify-task.js.map +1 -0
  76. package/dist/ui/capability-editor.js +3 -3
  77. package/dist/ui/profile-editor.js +3 -3
  78. package/dist/ui/swarm-dashboard.js +3 -3
  79. package/dist/workflows/weaver-agent.d.ts +3 -3
  80. package/dist/workflows/weaver-agent.d.ts.map +1 -1
  81. package/dist/workflows/weaver-agent.js +267 -18
  82. package/dist/workflows/weaver-agent.js.map +1 -1
  83. package/dist/workflows/weaver-bot-batch.d.ts +3 -3
  84. package/dist/workflows/weaver-bot-batch.d.ts.map +1 -1
  85. package/dist/workflows/weaver-bot-batch.js +280 -24
  86. package/dist/workflows/weaver-bot-batch.js.map +1 -1
  87. package/dist/workflows/weaver-bot.d.ts +2 -0
  88. package/dist/workflows/weaver-bot.d.ts.map +1 -1
  89. package/dist/workflows/weaver-bot.js +15 -10
  90. package/dist/workflows/weaver-bot.js.map +1 -1
  91. package/flowweaver.manifest.json +1 -1
  92. package/package.json +3 -3
  93. package/src/bot/ai-client.ts +54 -0
  94. package/src/bot/assistant-core.ts +2 -2
  95. package/src/bot/behavior-defaults.ts +9 -1
  96. package/src/bot/capability-registry.ts +3 -3
  97. package/src/bot/context-compactor.ts +147 -0
  98. package/src/bot/dream-task.ts +167 -0
  99. package/src/bot/knowledge-store.ts +27 -0
  100. package/src/bot/memory-extraction-worker.ts +58 -0
  101. package/src/bot/memory-extractor.ts +213 -0
  102. package/src/bot/operations.ts +3 -1
  103. package/src/bot/post-turn-hooks.ts +137 -0
  104. package/src/bot/profile-types.ts +17 -0
  105. package/src/bot/swarm-controller.ts +129 -2
  106. package/src/bot/task-prompt-builder.ts +37 -21
  107. package/src/bot/task-types.ts +21 -0
  108. package/src/bot/tool-registry.ts +89 -0
  109. package/src/bot/types.ts +2 -0
  110. package/src/node-types/agent-execute.ts +44 -17
  111. package/src/node-types/build-context.ts +45 -7
  112. package/src/node-types/receive-task.ts +3 -0
  113. package/src/node-types/review-result.ts +22 -5
  114. package/src/node-types/verify-task.ts +181 -0
  115. package/src/workflows/weaver-agent.ts +429 -18
  116. package/src/workflows/weaver-bot-batch.ts +443 -24
  117. package/src/workflows/weaver-bot.ts +16 -11
@@ -475,13 +475,14 @@ class GeneratedExecutionContext {
475
475
  * @param taskJson [order:0] - TaskJson
476
476
  * @param projectDir [order:1] - ProjectDir
477
477
  * @param behaviorJson [order:2] - Profile behavior config (JSON, optional)
478
+ * @param frozenPromptPrefix [order:3] - Frozen system prompt prefix for cache sharing
478
479
  * @returns onSuccess [order:-2] - On Success
479
480
  * @returns onFailure [order:-1] - On Failure
480
481
  * @returns summary [order:0] - Summary text
481
482
  */
482
483
  export async function weaverBot(
483
484
  execute: boolean,
484
- params: { taskJson?: string; projectDir?: string; behaviorJson?: string },
485
+ params: { taskJson?: string; projectDir?: string; behaviorJson?: string; frozenPromptPrefix?: string },
485
486
  __abortSignal__?: AbortSignal,
486
487
  ): Promise<{ onSuccess: boolean; onFailure: boolean; summary: string | null }> {
487
488
  // @flow-weaver-body-start
@@ -512,6 +513,7 @@ export async function weaverBot(
512
513
  await ctx.setVariable({ id: 'Start', portName: 'taskJson', executionIndex: startIdx, nodeTypeName: 'Start' }, params.taskJson);
513
514
  await ctx.setVariable({ id: 'Start', portName: 'projectDir', executionIndex: startIdx, nodeTypeName: 'Start' }, params.projectDir);
514
515
  await ctx.setVariable({ id: 'Start', portName: 'behaviorJson', executionIndex: startIdx, nodeTypeName: 'Start' }, params.behaviorJson);
516
+ await ctx.setVariable({ id: 'Start', portName: 'frozenPromptPrefix', executionIndex: startIdx, nodeTypeName: 'Start' }, params.frozenPromptPrefix);
515
517
  await ctx.sendStatusChangedEvent({
516
518
  nodeTypeName: 'Start',
517
519
  id: 'Start',
@@ -545,6 +547,7 @@ export async function weaverBot(
545
547
  let readWf_success = false;
546
548
  let abort_success = false;
547
549
  let notify_success = false;
550
+ let review_success = false;
548
551
  let cfg_success = false;
549
552
  let detect_success = false;
550
553
  let receive_success = false;
@@ -557,7 +560,6 @@ export async function weaverBot(
557
560
  let resolveExecModel_success = false;
558
561
  let execRetry_success = false;
559
562
  let resolveReviewModel_success = false;
560
- let review_success = false;
561
563
  let mergeReview_success = false;
562
564
  let gitOps_success = false;
563
565
 
@@ -751,7 +753,9 @@ export async function weaverBot(
751
753
  await ctx.setVariable({ id: 'receive', portName: 'env', executionIndex: receiveIdx, nodeTypeName: 'weaverReceiveTask' }, receive_env);
752
754
  const receive_taskJson = await ctx.getVariable({ id: 'Start', portName: 'taskJson', executionIndex: startIdx }) as string;
753
755
  await ctx.setVariable({ id: 'receive', portName: 'taskJson', executionIndex: receiveIdx, nodeTypeName: 'weaverReceiveTask' }, receive_taskJson);
754
- const receiveResult = await weaverReceiveTask(receive_execute, receive_env, receive_taskJson);
756
+ const receive_frozenPromptPrefix = await ctx.getVariable({ id: 'Start', portName: 'frozenPromptPrefix', executionIndex: startIdx }) as string;
757
+ await ctx.setVariable({ id: 'receive', portName: 'frozenPromptPrefix', executionIndex: receiveIdx, nodeTypeName: 'weaverReceiveTask' }, receive_frozenPromptPrefix);
758
+ const receiveResult = await weaverReceiveTask(receive_execute, receive_env, receive_taskJson, receive_frozenPromptPrefix);
755
759
  await ctx.setVariable({ id: 'receive', portName: 'ctx', executionIndex: receiveIdx, nodeTypeName: 'weaverReceiveTask' }, receiveResult.ctx);
756
760
  await ctx.setVariable({ id: 'receive', portName: 'onSuccess', executionIndex: receiveIdx, nodeTypeName: 'weaverReceiveTask' }, receiveResult.onSuccess);
757
761
  await ctx.setVariable({ id: 'receive', portName: 'onFailure', executionIndex: receiveIdx, nodeTypeName: 'weaverReceiveTask' }, receiveResult.onFailure);
@@ -930,14 +934,14 @@ export async function weaverBot(
930
934
  context_success = false;
931
935
 
932
936
  try {
933
- await ctx.setVariable({ id: 'context', portName: 'execute', executionIndex: contextIdx, nodeTypeName: 'weaverBuildContext' }, true);
937
+ const context_execute = routeIdx !== undefined ? await ctx.getVariable({ id: 'route', portName: 'onSuccess', executionIndex: routeIdx }) as boolean : false;
938
+ await ctx.setVariable({ id: 'context', portName: 'execute', executionIndex: contextIdx, nodeTypeName: 'weaverBuildContext' }, context_execute);
934
939
  const context_ctx = await ctx.getVariable({ id: 'route', portName: 'ctx', executionIndex: routeIdx! }) as string;
935
940
  await ctx.setVariable({ id: 'context', portName: 'ctx', executionIndex: contextIdx, nodeTypeName: 'weaverBuildContext' }, context_ctx);
936
- const contextResult = weaverBuildContext(context_ctx);
937
- const contextResult_raw: unknown = contextResult;
938
- await ctx.setVariable({ id: 'context', portName: 'ctx', executionIndex: contextIdx, nodeTypeName: 'weaverBuildContext' }, typeof contextResult_raw === 'object' && contextResult_raw !== null && 'ctx' in contextResult_raw ? contextResult_raw.ctx : contextResult_raw);
939
- await ctx.setVariable({ id: 'context', portName: 'onSuccess', executionIndex: contextIdx, nodeTypeName: 'weaverBuildContext' }, true);
940
- await ctx.setVariable({ id: 'context', portName: 'onFailure', executionIndex: contextIdx, nodeTypeName: 'weaverBuildContext' }, false);
941
+ const contextResult = await weaverBuildContext(context_execute, context_ctx);
942
+ await ctx.setVariable({ id: 'context', portName: 'ctx', executionIndex: contextIdx, nodeTypeName: 'weaverBuildContext' }, contextResult.ctx);
943
+ await ctx.setVariable({ id: 'context', portName: 'onFailure', executionIndex: contextIdx, nodeTypeName: 'weaverBuildContext' }, contextResult.onFailure);
944
+ await ctx.setVariable({ id: 'context', portName: 'onSuccess', executionIndex: contextIdx, nodeTypeName: 'weaverBuildContext' }, contextResult.onSuccess);
941
945
  await ctx.sendStatusChangedEvent({
942
946
  nodeTypeName: 'weaverBuildContext',
943
947
  id: 'context',
@@ -945,7 +949,7 @@ export async function weaverBot(
945
949
  status: 'SUCCEEDED',
946
950
  });
947
951
  await __ctrl__.afterNode('context', ctx);
948
- context_success = true;
952
+ context_success = contextResult.onSuccess;
949
953
  } catch (error: unknown) {
950
954
  const isCancellation = CancellationError.isCancellationError(error);
951
955
  await ctx.sendStatusChangedEvent({
@@ -2117,7 +2121,7 @@ export async function weaverBot(
2117
2121
  });
2118
2122
 
2119
2123
  try {
2120
- const report_execute = (readWfIdx !== undefined ? await ctx.getVariable({ id: 'readWf', portName: 'onSuccess', executionIndex: readWfIdx }) as boolean : false) || (abortIdx !== undefined ? await ctx.getVariable({ id: 'abort', portName: 'onSuccess', executionIndex: abortIdx }) as boolean : false) || (notifyIdx !== undefined ? await ctx.getVariable({ id: 'notify', portName: 'onSuccess', executionIndex: notifyIdx }) as boolean : false) || (gitOpsIdx !== undefined ? await ctx.getVariable({ id: 'gitOps', portName: 'onSuccess', executionIndex: gitOpsIdx }) as boolean : false) || (receiveIdx !== undefined ? await ctx.getVariable({ id: 'receive', portName: 'onFailure', executionIndex: receiveIdx }) as boolean : false) || (planIdx !== undefined ? await ctx.getVariable({ id: 'plan', portName: 'onFailure', executionIndex: planIdx }) as boolean : false) || (execRetryIdx !== undefined ? await ctx.getVariable({ id: 'execRetry', portName: 'onFailure', executionIndex: execRetryIdx }) as boolean : false) || (reviewIdx !== undefined ? await ctx.getVariable({ id: 'review', portName: 'onFailure', executionIndex: reviewIdx }) as boolean : false);
2124
+ const report_execute = (readWfIdx !== undefined ? await ctx.getVariable({ id: 'readWf', portName: 'onSuccess', executionIndex: readWfIdx }) as boolean : false) || (abortIdx !== undefined ? await ctx.getVariable({ id: 'abort', portName: 'onSuccess', executionIndex: abortIdx }) as boolean : false) || (notifyIdx !== undefined ? await ctx.getVariable({ id: 'notify', portName: 'onSuccess', executionIndex: notifyIdx }) as boolean : false) || (reviewIdx !== undefined ? await ctx.getVariable({ id: 'review', portName: 'onFailure', executionIndex: reviewIdx }) as boolean : false) || (gitOpsIdx !== undefined ? await ctx.getVariable({ id: 'gitOps', portName: 'onSuccess', executionIndex: gitOpsIdx }) as boolean : false) || (receiveIdx !== undefined ? await ctx.getVariable({ id: 'receive', portName: 'onFailure', executionIndex: receiveIdx }) as boolean : false) || (planIdx !== undefined ? await ctx.getVariable({ id: 'plan', portName: 'onFailure', executionIndex: planIdx }) as boolean : false) || (execRetryIdx !== undefined ? await ctx.getVariable({ id: 'execRetry', portName: 'onFailure', executionIndex: execRetryIdx }) as boolean : false);
2121
2125
  await ctx.setVariable({ id: 'report', portName: 'execute', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, report_execute);
2122
2126
  const report_mainCtx = mergePlanIdx !== undefined ? await ctx.getVariable({ id: 'mergePlan', portName: 'ctx', executionIndex: mergePlanIdx }) as string : undefined;
2123
2127
  await ctx.setVariable({ id: 'report', portName: 'mainCtx', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, report_mainCtx);
@@ -2129,6 +2133,7 @@ export async function weaverBot(
2129
2133
  await ctx.setVariable({ id: 'report', portName: 'failCtx', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, report_failCtx);
2130
2134
  const reportResult = await weaverBotReport(report_execute, report_mainCtx, report_readCtx, report_abortCtx, report_failCtx);
2131
2135
  await ctx.setVariable({ id: 'report', portName: 'summary', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, reportResult.summary);
2136
+ await ctx.setVariable({ id: 'report', portName: 'report', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, reportResult.report);
2132
2137
  await ctx.setVariable({ id: 'report', portName: 'reportJson', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, reportResult.reportJson);
2133
2138
  await ctx.setVariable({ id: 'report', portName: 'onFailure', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, reportResult.onFailure);
2134
2139
  await ctx.setVariable({ id: 'report', portName: 'onSuccess', executionIndex: reportIdx, nodeTypeName: 'weaverBotReport' }, reportResult.onSuccess);