@codemation/core 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/{EngineRuntimeRegistration.types-Bjeo7Sfq.d.ts → EngineRuntimeRegistration.types-BtTZolK0.d.ts} +2 -2
  3. package/dist/{EngineWorkflowRunnerService-Dd4yD31l.d.cts → EngineWorkflowRunnerService-Ddl0fekp.d.cts} +2 -2
  4. package/dist/{InMemoryRunDataFactory-OUzDmAHt.d.cts → InMemoryRunDataFactory-i-u2yngD.d.cts} +11 -3
  5. package/dist/{RunIntentService-Bkg4oYrM.d.cts → RunIntentService-Cjx-glgz.d.cts} +232 -237
  6. package/dist/{RunIntentService-BAKikN8h.d.ts → RunIntentService-Dkr4YwN8.d.ts} +313 -259
  7. package/dist/bootstrap/index.cjs +2 -2
  8. package/dist/bootstrap/index.d.cts +19 -7
  9. package/dist/bootstrap/index.d.ts +3 -3
  10. package/dist/bootstrap/index.js +2 -2
  11. package/dist/{bootstrap-DwS5S7s9.cjs → bootstrap-DHH2uo-W.cjs} +4 -2
  12. package/dist/bootstrap-DHH2uo-W.cjs.map +1 -0
  13. package/dist/{bootstrap-BD6CobHl.js → bootstrap-DbUlOl11.js} +4 -2
  14. package/dist/bootstrap-DbUlOl11.js.map +1 -0
  15. package/dist/{index-uCm9l0nw.d.ts → index-B2v4wtys.d.ts} +62 -34
  16. package/dist/index.cjs +22 -15
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +108 -42
  19. package/dist/index.d.ts +3 -3
  20. package/dist/index.js +13 -16
  21. package/dist/index.js.map +1 -1
  22. package/dist/{runtime-Cy-3FTI_.js → runtime-BdH94eBR.js} +502 -123
  23. package/dist/runtime-BdH94eBR.js.map +1 -0
  24. package/dist/{runtime-ZJUpWmPH.cjs → runtime-feFn8OmG.cjs} +561 -122
  25. package/dist/runtime-feFn8OmG.cjs.map +1 -0
  26. package/dist/testing.cjs +40 -36
  27. package/dist/testing.cjs.map +1 -1
  28. package/dist/testing.d.cts +17 -26
  29. package/dist/testing.d.ts +17 -26
  30. package/dist/testing.js +40 -36
  31. package/dist/testing.js.map +1 -1
  32. package/dist/{workflowActivationPolicy-BzyzXLa_.cjs → workflowActivationPolicy-6V3OJD3N.cjs} +65 -19
  33. package/dist/workflowActivationPolicy-6V3OJD3N.cjs.map +1 -0
  34. package/dist/{workflowActivationPolicy-B8HzTk3o.js → workflowActivationPolicy-Td9HTOuD.js} +65 -19
  35. package/dist/workflowActivationPolicy-Td9HTOuD.js.map +1 -0
  36. package/package.json +2 -1
  37. package/src/ai/AgentConfigInspectorFactory.ts +4 -0
  38. package/src/ai/AgentMessageConfigNormalizerFactory.ts +7 -0
  39. package/src/ai/AgentToolFactory.ts +2 -2
  40. package/src/ai/AiHost.ts +11 -10
  41. package/src/ai/NodeBackedToolConfig.ts +1 -1
  42. package/src/authoring/defineNode.types.ts +48 -72
  43. package/src/authoring/index.ts +1 -1
  44. package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +8 -0
  45. package/src/contracts/credentialTypes.ts +9 -0
  46. package/src/contracts/emitPorts.ts +27 -0
  47. package/src/contracts/index.ts +3 -0
  48. package/src/contracts/itemMeta.ts +11 -0
  49. package/src/contracts/itemValue.ts +147 -0
  50. package/src/contracts/runtimeTypes.ts +39 -22
  51. package/src/contracts/workflowTypes.ts +26 -56
  52. package/src/execution/FanInMergeByOriginMerger.ts +67 -0
  53. package/src/execution/ItemValueResolver.ts +27 -0
  54. package/src/execution/NodeActivationRequestComposer.ts +25 -0
  55. package/src/execution/NodeActivationRequestInputPreparer.ts +57 -25
  56. package/src/execution/NodeExecutor.ts +199 -30
  57. package/src/execution/NodeOutputNormalizer.ts +90 -0
  58. package/src/execution/index.ts +2 -0
  59. package/src/index.ts +2 -0
  60. package/src/orchestration/NodeExecutionRequestHandlerService.ts +39 -18
  61. package/src/orchestration/RunContinuationService.ts +11 -17
  62. package/src/planning/CurrentStateFrontierPlanner.ts +20 -20
  63. package/src/planning/RunQueuePlanner.ts +56 -19
  64. package/src/planning/WorkflowTopologyPlanner.ts +57 -33
  65. package/src/testing/ItemHarnessNode.ts +4 -10
  66. package/src/testing/ItemHarnessNodeConfig.ts +7 -16
  67. package/src/testing/RegistrarEngineTestKitFactory.ts +2 -0
  68. package/src/testing/SubWorkflowRunnerTestNode.ts +28 -43
  69. package/src/testing/SwitchHarnessNode.ts +54 -0
  70. package/src/types/index.ts +3 -0
  71. package/src/workflow/dsl/ChainCursorResolver.ts +68 -23
  72. package/src/workflow/dsl/WorkflowBuilder.ts +3 -5
  73. package/src/workflow/dsl/workflowBuilderTypes.ts +5 -8
  74. package/src/workflowSnapshots/MissingRuntimeNode.ts +4 -4
  75. package/src/workflowSnapshots/MissingRuntimeNodeConfig.ts +2 -2
  76. package/src/workflowSnapshots/WorkflowSnapshotCodec.ts +16 -7
  77. package/dist/bootstrap-BD6CobHl.js.map +0 -1
  78. package/dist/bootstrap-DwS5S7s9.cjs.map +0 -1
  79. package/dist/runtime-Cy-3FTI_.js.map +0 -1
  80. package/dist/runtime-ZJUpWmPH.cjs.map +0 -1
  81. package/dist/workflowActivationPolicy-B8HzTk3o.js.map +0 -1
  82. package/dist/workflowActivationPolicy-BzyzXLa_.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @codemation/core
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#60](https://github.com/MadeRelevant/codemation/pull/60) [`056c045`](https://github.com/MadeRelevant/codemation/commit/056c045d7813e7e6b749f0dc03bb43855ff7f58c) Thanks [@cblokland90](https://github.com/cblokland90)! - Harden the Gmail plugin so it imports reliably from the package root, returns an authenticated official Gmail session, and supports trigger/read/send/reply/label workflows with one OAuth credential.
8
+
9
+ Add framework support for OAuth scope presets and custom per-credential scope replacement, and update the plugin starter/docs so future plugins scaffold the same publishable root-entrypoint conventions.
10
+
11
+ ## 0.4.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#54](https://github.com/MadeRelevant/codemation/pull/54) [`35b78bb`](https://github.com/MadeRelevant/codemation/commit/35b78bb4d8c7ee2998a8b8e51e5ffc3fd901e4c7) Thanks [@cblokland90](https://github.com/cblokland90)! - **Breaking change:** `defineNode(...)` now follows the per-item pipeline: implement **`execute(args, context)`** (optional **`inputSchema`**, **`mapInput`**, and **`TWireJson`** on the generated runnable config). Add **`defineBatchNode(...)`** with **`run(items, context)`** for plugin nodes that still require batch **`run`** semantics.
16
+
17
+ Built-in nodes and workflow DSL (`split` / `filter` / `aggregate` on the fluent chain, Switch routing, execution normalization) align with the unified runnable model.
18
+
19
+ Align documentation (site guides, repo **`AGENTS.md`**, **`strict-oop-di`** skill, **`packages/core/docs/item-node-execution.md`**) and the **plugin** starter **`AGENTS.md`** with **config** for static wiring (credentials, retry, presentation) vs **inputs** / wire JSON for per-item behavior.
20
+
21
+ - [#56](https://github.com/MadeRelevant/codemation/pull/56) [`eb97e53`](https://github.com/MadeRelevant/codemation/commit/eb97e5376f4f620099c32c14d7797ed3039bf7bb) Thanks [@cblokland90](https://github.com/cblokland90)! - Add fluent workflow authoring support for port routing and core nodes.
22
+ - `workflow()` DSL: add `route(...)`, `merge(...)`, and `switch(...)` helpers so multi-port graphs can be expressed without manual `edges`.
23
+ - `Callback`: allow returning `emitPorts(...)` and configuring declared output ports and error handling options.
24
+ - Next host: fix execution inspector tree nesting by preferring `snapshot.parent.nodeId` when available (nested agent/tool invocations).
25
+
3
26
  ## 0.3.0
4
27
 
5
28
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import { Dr as WebhookTriggerRoutingDiagnostics, Tr as WebhookTriggerMatcher, fi as DependencyContainer, ji as EngineExecutionLimitsPolicyConfig, ur as TriggerRuntimeDiagnostics } from "./RunIntentService-BAKikN8h.js";
1
+ import { Mi as DependencyContainer, Sr as WebhookTriggerRoutingDiagnostics, Zi as EngineExecutionLimitsPolicyConfig, ar as TriggerRuntimeDiagnostics, br as WebhookTriggerMatcher } from "./RunIntentService-Dkr4YwN8.js";
2
2
 
3
3
  //#region src/bootstrap/runtime/EngineRuntimeRegistration.types.d.ts
4
4
 
@@ -39,4 +39,4 @@ interface EngineRuntimeRegistrationOptions {
39
39
  }
40
40
  //#endregion
41
41
  export { TriggerRuntimeDiagnosticsProvider as n, WebhookTriggerMatcherProvider as r, EngineRuntimeRegistrationOptions as t };
42
- //# sourceMappingURL=EngineRuntimeRegistration.types-Bjeo7Sfq.d.ts.map
42
+ //# sourceMappingURL=EngineRuntimeRegistration.types-BtTZolK0.d.ts.map
@@ -1,4 +1,4 @@
1
- import { Dt as WorkflowId, K as NodeConfigBase, Ln as WebhookTriggerMatcher, On as WorkflowRepository, Q as NodeId, Sn as TriggerRuntimeDiagnostics, Ur as EngineExecutionLimitsPolicyConfig, ar as PersistedWorkflowSnapshotNode, ir as PersistedWorkflowSnapshot, mr as RunResult, or as PersistedWorkflowTokenRegistryLike, ot as ParentExecutionRef, r as Engine, wr as DependencyContainer, xt as WorkflowDefinition, z as Items, zn as WebhookTriggerRoutingDiagnostics } from "./RunIntentService-Bkg4oYrM.cjs";
1
+ import { D as NodeId, Dr as DependencyContainer, F as ParentExecutionRef, In as PersistedWorkflowSnapshot, Kn as RunResult, Kr as EngineExecutionLimitsPolicyConfig, Ln as PersistedWorkflowSnapshotNode, Rn as PersistedWorkflowTokenRegistryLike, Y as WorkflowDefinition, _n as WebhookTriggerRoutingDiagnostics, en as TriggerRuntimeDiagnostics, f as Items, hn as WebhookTriggerMatcher, on as WorkflowRepository, r as Engine, tt as WorkflowId, x as NodeConfigBase } from "./RunIntentService-Cjx-glgz.cjs";
2
2
 
3
3
  //#region src/workflowSnapshots/WorkflowSnapshotCodec.d.ts
4
4
  declare class WorkflowSnapshotCodec {
@@ -70,4 +70,4 @@ declare class EngineWorkflowRunnerService {
70
70
  }
71
71
  //#endregion
72
72
  export { WorkflowSnapshotCodec as a, WebhookTriggerMatcherProvider as i, EngineRuntimeRegistrationOptions as n, TriggerRuntimeDiagnosticsProvider as r, EngineWorkflowRunnerService as t };
73
- //# sourceMappingURL=EngineWorkflowRunnerService-Dd4yD31l.d.cts.map
73
+ //# sourceMappingURL=EngineWorkflowRunnerService-Ddl0fekp.d.cts.map
@@ -1,4 +1,4 @@
1
- import { $t as ExecutionContextFactory, Dt as WorkflowId, G as NodeActivationId, Gt as BinaryStorageStatResult, Ht as BinaryBody, Q as NodeId, Qt as ExecutionContext, Ut as BinaryStorage, W as MutableRunData, Wt as BinaryStorageReadResult, Xr as RetryPolicySpec, Zt as ExecutionBinaryService, b as CredentialSessionService, dt as RunId, k as BinaryAttachment, ln as NodeBinaryAttachmentService, lt as RunDataFactory, mn as NodeExecutionStatePublisher, ot as ParentExecutionRef, qt as BinaryStorageWriteResult, tt as NodeOutputs, un as NodeExecutionContext, ut as RunDataSnapshot } from "./RunIntentService-Bkg4oYrM.cjs";
1
+ import { A as NodeOutputs, At as ExecutionContextFactory, B as RunId, Bt as NodeExecutionContext, D as NodeId, F as ParentExecutionRef, H as RunnableNodeConfig, Ot as ExecutionBinaryService, R as RunDataFactory, St as BinaryStorageStatResult, Wt as NodeExecutionStatePublisher, _t as RetryPolicySpec, a as BinaryAttachment, b as NodeActivationId, bt as BinaryStorage, kt as ExecutionContext, tt as WorkflowId, u as Item, vr as CredentialSessionService, wt as BinaryStorageWriteResult, xt as BinaryStorageReadResult, y as MutableRunData, yt as BinaryBody, z as RunDataSnapshot, zt as NodeBinaryAttachmentService } from "./RunIntentService-Cjx-glgz.cjs";
2
2
 
3
3
  //#region src/execution/CredentialResolverFactory.d.ts
4
4
  declare class CredentialResolverFactory {
@@ -47,6 +47,14 @@ declare class InProcessRetryRunner {
47
47
  private static assertMultiplier;
48
48
  }
49
49
  //#endregion
50
+ //#region src/execution/ItemValueResolver.d.ts
51
+ /**
52
+ * Resolves {@link import("../contracts/itemValue").ItemValue} leaves on runnable config before {@link RunnableNode.execute}.
53
+ */
54
+ declare class ItemValueResolver {
55
+ resolveConfigForItem<TConfig extends RunnableNodeConfig<any, any>>(ctx: NodeExecutionContext<TConfig>, item: Item, itemIndex: number, items: ReadonlyArray<Item>): Promise<NodeExecutionContext<TConfig>>;
56
+ }
57
+ //#endregion
50
58
  //#region src/binaries/UnavailableBinaryStorage.d.ts
51
59
  declare class UnavailableBinaryStorage implements BinaryStorage {
52
60
  readonly driverName = "unavailable";
@@ -90,5 +98,5 @@ declare class InMemoryRunDataFactory implements RunDataFactory {
90
98
  create(initial?: Record<NodeId, NodeOutputs>): MutableRunData;
91
99
  }
92
100
  //#endregion
93
- export { InProcessRetryRunner as a, AsyncSleeper as c, UnavailableBinaryStorage as i, CredentialResolverFactory as l, InMemoryBinaryStorage as n, DefaultExecutionContextFactory as o, DefaultExecutionBinaryService as r, DefaultAsyncSleeper as s, InMemoryRunDataFactory as t };
94
- //# sourceMappingURL=InMemoryRunDataFactory-OUzDmAHt.d.cts.map
101
+ export { ItemValueResolver as a, DefaultAsyncSleeper as c, UnavailableBinaryStorage as i, AsyncSleeper as l, InMemoryBinaryStorage as n, InProcessRetryRunner as o, DefaultExecutionBinaryService as r, DefaultExecutionContextFactory as s, InMemoryRunDataFactory as t, CredentialResolverFactory as u };
102
+ //# sourceMappingURL=InMemoryRunDataFactory-i-u2yngD.d.cts.map