@codemation/host 0.1.6 → 0.1.7
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/CHANGELOG.md +9 -0
- package/dist/{AppConfigFactory-BiFHnorf.d.ts → AppConfigFactory-BBEn2B-i.d.ts} +3 -3
- package/dist/{AppContainerFactory-BRU02PTm.js → AppContainerFactory-CeKsjo8L.js} +79 -19
- package/dist/AppContainerFactory-CeKsjo8L.js.map +1 -0
- package/dist/{CodemationConfig-DuGk7uN5.d.ts → CodemationConfig-9PkOBCh-.d.ts} +2 -2
- package/dist/{CodemationConfigNormalizer-BP2-0ZDE.d.ts → CodemationConfigNormalizer-DIc-LYqW.d.ts} +2 -2
- package/dist/{CodemationConsumerConfigLoader-D5CSz3TQ.d.ts → CodemationConsumerConfigLoader-CeW4bnOg.d.ts} +3 -2
- package/dist/{CodemationConsumerConfigLoader-C_ISRrpI.js → CodemationConsumerConfigLoader-D6LFSlp5.js} +20 -7
- package/dist/CodemationConsumerConfigLoader-D6LFSlp5.js.map +1 -0
- package/dist/{CodemationPluginListMerger-DFzGgfyI.d.ts → CodemationPluginListMerger-Cv7CaM5_.d.ts} +5 -5
- package/dist/{CredentialServices-Bhejvys-.d.ts → CredentialServices-Dp_jXTJo.d.ts} +3 -3
- package/dist/{PublicFrontendBootstrapFactory-CSgWyTra.d.ts → PublicFrontendBootstrapFactory-SQVHMxLg.d.ts} +5 -2
- package/dist/consumer.d.ts +4 -4
- package/dist/consumer.js +1 -1
- package/dist/credentials.d.ts +3 -3
- package/dist/devServerSidecar.d.ts +1 -1
- package/dist/{index-BQaZZmOm.d.ts → index-CLRTQLAp.d.ts} +42 -60
- package/dist/index.d.ts +97 -12
- package/dist/index.js +3 -3
- package/dist/nextServer.d.ts +14 -7
- package/dist/nextServer.js +1 -1
- package/dist/{persistenceServer-fdldtXJH.d.ts → persistenceServer-Dv7fg_Jf.d.ts} +2 -2
- package/dist/persistenceServer.d.ts +5 -5
- package/dist/{server-Cpzpy1Ar.d.ts → server-C5oqDnZQ.d.ts} +5 -5
- package/dist/{server-ChTCEc6R.js → server-CioY8PP3.js} +4 -5
- package/dist/{server-ChTCEc6R.js.map → server-CioY8PP3.js.map} +1 -1
- package/dist/server.d.ts +8 -8
- package/dist/server.js +3 -3
- package/package.json +6 -5
- package/playwright.config.ts +10 -6
- package/src/application/contracts/WorkflowViewContracts.ts +3 -0
- package/src/application/mapping/WorkflowDefinitionMapper.ts +117 -19
- package/src/bootstrap/AppContainerFactory.ts +2 -0
- package/src/presentation/http/routeHandlers/CredentialHttpRouteHandler.ts +2 -1
- package/src/presentation/http/routeHandlers/WorkflowHttpRouteHandler.ts +4 -2
- package/src/presentation/server/CodemationConsumerConfigLoader.ts +28 -5
- package/src/presentation/server/CodemationPluginDiscovery.ts +4 -6
- package/dist/AppContainerFactory-BRU02PTm.js.map +0 -1
- package/dist/CodemationConsumerConfigLoader-C_ISRrpI.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @codemation/host
|
|
2
2
|
|
|
3
|
+
## 0.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`35b78bb`](https://github.com/MadeRelevant/codemation/commit/35b78bb4d8c7ee2998a8b8e51e5ffc3fd901e4c7), [`eb97e53`](https://github.com/MadeRelevant/codemation/commit/eb97e5376f4f620099c32c14d7797ed3039bf7bb)]:
|
|
8
|
+
- @codemation/core@0.4.0
|
|
9
|
+
- @codemation/core-nodes@0.1.0
|
|
10
|
+
- @codemation/eventbus-redis@0.0.26
|
|
11
|
+
|
|
3
12
|
## 0.1.6
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as AppPersistenceConfig, g as AppConfig } from "./CodemationConfig-
|
|
2
|
-
import { t as NormalizedCodemationConfig } from "./CodemationConfigNormalizer-
|
|
1
|
+
import { _ as AppPersistenceConfig, g as AppConfig } from "./CodemationConfig-9PkOBCh-.js";
|
|
2
|
+
import { t as NormalizedCodemationConfig } from "./CodemationConfigNormalizer-DIc-LYqW.js";
|
|
3
3
|
import { AnyNull, AnyNullClass, DbNull, DbNullClass, Decimal, JsonNull, JsonNullClass, NullTypes as NullTypes$1, ObjectEnumValue, PrismaClientInitializationError, PrismaClientKnownRequestError, PrismaClientRustPanicError, PrismaClientUnknownRequestError, PrismaClientValidationError, RawValue, Sql, Value, empty, isAnyNull, isDbNull, isJsonNull, isObjectEnumValue, join, raw, sql as sqltag } from "@prisma/client-runtime-utils";
|
|
4
4
|
|
|
5
5
|
//#region src/infrastructure/persistence/generated/prisma-postgresql-client/runtime/client.d.ts
|
|
@@ -28903,4 +28903,4 @@ declare class AppConfigFactory {
|
|
|
28903
28903
|
}
|
|
28904
28904
|
//#endregion
|
|
28905
28905
|
export { PrismaClient as i, PrismaMigrationDeployer as n, PrismaDatabaseClient as r, AppConfigFactory as t };
|
|
28906
|
-
//# sourceMappingURL=AppConfigFactory-
|
|
28906
|
+
//# sourceMappingURL=AppConfigFactory-BBEn2B-i.d.ts.map
|
|
@@ -2494,13 +2494,14 @@ let WorkflowDefinitionMapper = class WorkflowDefinitionMapper$1 {
|
|
|
2494
2494
|
return this.mapSync(workflow);
|
|
2495
2495
|
}
|
|
2496
2496
|
mapSync(workflow) {
|
|
2497
|
+
const mapped = this.mapNodesAndEdges(workflow);
|
|
2497
2498
|
return {
|
|
2498
2499
|
id: workflow.id,
|
|
2499
2500
|
name: workflow.name,
|
|
2500
2501
|
active: this.workflowActivationPolicy.isActive(workflow.id),
|
|
2501
2502
|
hasWorkflowErrorHandler: this.policyUi.workflowHasErrorHandler(workflow),
|
|
2502
|
-
nodes:
|
|
2503
|
-
edges:
|
|
2503
|
+
nodes: mapped.nodes,
|
|
2504
|
+
edges: mapped.edges
|
|
2504
2505
|
};
|
|
2505
2506
|
}
|
|
2506
2507
|
toSummary(workflow) {
|
|
@@ -2519,17 +2520,40 @@ let WorkflowDefinitionMapper = class WorkflowDefinitionMapper$1 {
|
|
|
2519
2520
|
});
|
|
2520
2521
|
return map;
|
|
2521
2522
|
}
|
|
2522
|
-
|
|
2523
|
+
mapNodesAndEdges(workflow) {
|
|
2523
2524
|
const connectionChildMeta = this.buildConnectionChildMeta(workflow);
|
|
2524
2525
|
const materializedConnectionNodeIds = new Set(connectionChildMeta.keys());
|
|
2526
|
+
const nodesById = new Map(workflow.nodes.map((node) => [node.id, node]));
|
|
2527
|
+
const agentConnectionDescriptors = this.buildAgentConnectionDescriptorIndex(workflow);
|
|
2528
|
+
return {
|
|
2529
|
+
nodes: this.toNodes({
|
|
2530
|
+
workflow,
|
|
2531
|
+
connectionChildMeta,
|
|
2532
|
+
materializedConnectionNodeIds,
|
|
2533
|
+
nodesById,
|
|
2534
|
+
agentConnectionDescriptors
|
|
2535
|
+
}),
|
|
2536
|
+
edges: this.toEdges({
|
|
2537
|
+
workflow,
|
|
2538
|
+
materializedConnectionNodeIds,
|
|
2539
|
+
agentConnectionDescriptors
|
|
2540
|
+
})
|
|
2541
|
+
};
|
|
2542
|
+
}
|
|
2543
|
+
toNodes(args) {
|
|
2544
|
+
const workflow = args.workflow;
|
|
2545
|
+
const connectionChildMeta = args.connectionChildMeta;
|
|
2546
|
+
const materializedConnectionNodeIds = args.materializedConnectionNodeIds;
|
|
2547
|
+
const nodesById = args.nodesById;
|
|
2548
|
+
const agentConnectionDescriptors = args.agentConnectionDescriptors;
|
|
2525
2549
|
const nodes = [];
|
|
2526
2550
|
for (const node of workflow.nodes) {
|
|
2527
2551
|
const conn = connectionChildMeta.get(node.id);
|
|
2528
2552
|
if (conn) {
|
|
2529
|
-
const parentNode =
|
|
2553
|
+
const parentNode = nodesById.get(conn.parentNodeId);
|
|
2530
2554
|
let role = conn.connectionName === "llm" ? "languageModel" : "tool";
|
|
2531
2555
|
if (parentNode && AgentConfigInspector.isAgentNodeConfig(parentNode.config)) {
|
|
2532
|
-
const descriptor =
|
|
2556
|
+
const descriptor = agentConnectionDescriptors.byChildNodeIdByAgentNodeId.get(conn.parentNodeId)?.get(node.id);
|
|
2533
2557
|
if (descriptor) role = descriptor.role;
|
|
2534
2558
|
}
|
|
2535
2559
|
nodes.push({
|
|
@@ -2541,6 +2565,7 @@ let WorkflowDefinitionMapper = class WorkflowDefinitionMapper$1 {
|
|
|
2541
2565
|
icon: node.config?.icon,
|
|
2542
2566
|
retryPolicySummary: this.policyUi.nodeRetrySummary(node.config),
|
|
2543
2567
|
hasNodeErrorHandler: this.policyUi.nodeHasErrorHandler(node.config),
|
|
2568
|
+
...this.nodePortFieldsFromConfig(node.config),
|
|
2544
2569
|
parentNodeId: conn.parentNodeId
|
|
2545
2570
|
});
|
|
2546
2571
|
continue;
|
|
@@ -2553,21 +2578,23 @@ let WorkflowDefinitionMapper = class WorkflowDefinitionMapper$1 {
|
|
|
2553
2578
|
role: AgentConfigInspector.isAgentNodeConfig(node.config) ? "agent" : "workflowNode",
|
|
2554
2579
|
icon: node.config?.icon,
|
|
2555
2580
|
retryPolicySummary: this.policyUi.nodeRetrySummary(node.config),
|
|
2556
|
-
hasNodeErrorHandler: this.policyUi.nodeHasErrorHandler(node.config)
|
|
2581
|
+
hasNodeErrorHandler: this.policyUi.nodeHasErrorHandler(node.config),
|
|
2582
|
+
...this.nodePortFieldsFromConfig(node.config)
|
|
2557
2583
|
});
|
|
2558
|
-
if (AgentConfigInspector.isAgentNodeConfig(node.config)) this.appendVirtualConnectionNodes(
|
|
2584
|
+
if (AgentConfigInspector.isAgentNodeConfig(node.config)) this.appendVirtualConnectionNodes(materializedConnectionNodeIds, nodes, agentConnectionDescriptors.byAgentNodeId.get(node.id) ?? []);
|
|
2559
2585
|
}
|
|
2560
2586
|
return nodes;
|
|
2561
2587
|
}
|
|
2562
|
-
toEdges(
|
|
2563
|
-
const
|
|
2564
|
-
const materializedConnectionNodeIds =
|
|
2588
|
+
toEdges(args) {
|
|
2589
|
+
const workflow = args.workflow;
|
|
2590
|
+
const materializedConnectionNodeIds = args.materializedConnectionNodeIds;
|
|
2591
|
+
const agentConnectionDescriptors = args.agentConnectionDescriptors;
|
|
2565
2592
|
const edges = [...workflow.edges];
|
|
2566
2593
|
const edgeKeys = new Set(edges.map((edge) => this.edgeKey(edge.from.nodeId, edge.to.nodeId, edge.to.input)));
|
|
2567
2594
|
this.appendMaterializedConnectionEdges(workflow, edgeKeys, edges);
|
|
2568
2595
|
for (const node of workflow.nodes) {
|
|
2569
2596
|
if (!AgentConfigInspector.isAgentNodeConfig(node.config)) continue;
|
|
2570
|
-
this.appendVirtualConnectionEdges(
|
|
2597
|
+
this.appendVirtualConnectionEdges(materializedConnectionNodeIds, edgeKeys, edges, agentConnectionDescriptors.byAgentNodeId.get(node.id) ?? []);
|
|
2571
2598
|
}
|
|
2572
2599
|
return edges;
|
|
2573
2600
|
}
|
|
@@ -2588,14 +2615,30 @@ let WorkflowDefinitionMapper = class WorkflowDefinitionMapper$1 {
|
|
|
2588
2615
|
edgeKeys.add(key);
|
|
2589
2616
|
}
|
|
2590
2617
|
}
|
|
2591
|
-
|
|
2592
|
-
|
|
2618
|
+
buildAgentConnectionDescriptorIndex(workflow) {
|
|
2619
|
+
const byAgentNodeId = /* @__PURE__ */ new Map();
|
|
2620
|
+
const byChildNodeIdByAgentNodeId = /* @__PURE__ */ new Map();
|
|
2621
|
+
for (const node of workflow.nodes) {
|
|
2622
|
+
if (!AgentConfigInspector.isAgentNodeConfig(node.config)) continue;
|
|
2623
|
+
const descriptors = AgentConnectionNodeCollector.collect(node.id, node.config);
|
|
2624
|
+
byAgentNodeId.set(node.id, descriptors);
|
|
2625
|
+
const byChildId = /* @__PURE__ */ new Map();
|
|
2626
|
+
for (const descriptor of descriptors) byChildId.set(descriptor.nodeId, descriptor);
|
|
2627
|
+
byChildNodeIdByAgentNodeId.set(node.id, byChildId);
|
|
2628
|
+
}
|
|
2629
|
+
return {
|
|
2630
|
+
byAgentNodeId,
|
|
2631
|
+
byChildNodeIdByAgentNodeId
|
|
2632
|
+
};
|
|
2633
|
+
}
|
|
2634
|
+
appendVirtualConnectionNodes(materializedConnectionNodeIds, nodes, descriptors) {
|
|
2635
|
+
for (const connectionNode of descriptors) {
|
|
2593
2636
|
if (materializedConnectionNodeIds.has(connectionNode.nodeId)) continue;
|
|
2594
2637
|
nodes.push(this.createConnectionNode(connectionNode));
|
|
2595
2638
|
}
|
|
2596
2639
|
}
|
|
2597
|
-
appendVirtualConnectionEdges(
|
|
2598
|
-
for (const connectionNode of
|
|
2640
|
+
appendVirtualConnectionEdges(materializedConnectionNodeIds, edgeKeys, edges, descriptors) {
|
|
2641
|
+
for (const connectionNode of descriptors) {
|
|
2599
2642
|
if (materializedConnectionNodeIds.has(connectionNode.nodeId)) continue;
|
|
2600
2643
|
const key = this.edgeKey(connectionNode.parentNodeId, connectionNode.nodeId, "in");
|
|
2601
2644
|
if (edgeKeys.has(key)) continue;
|
|
@@ -2626,6 +2669,19 @@ let WorkflowDefinitionMapper = class WorkflowDefinitionMapper$1 {
|
|
|
2626
2669
|
parentNodeId: connectionNode.parentNodeId
|
|
2627
2670
|
};
|
|
2628
2671
|
}
|
|
2672
|
+
/**
|
|
2673
|
+
* Omit optional port fields when undefined so persisted snapshot DTOs (which never serialize
|
|
2674
|
+
* undefined keys) stay aligned with live workflow mapping.
|
|
2675
|
+
*/
|
|
2676
|
+
nodePortFieldsFromConfig(config$1) {
|
|
2677
|
+
if (!config$1 || typeof config$1 !== "object") return {};
|
|
2678
|
+
const c = config$1;
|
|
2679
|
+
return {
|
|
2680
|
+
...c.continueWhenEmptyOutput !== void 0 && { continueWhenEmptyOutput: c.continueWhenEmptyOutput },
|
|
2681
|
+
...c.declaredOutputPorts !== void 0 && { declaredOutputPorts: c.declaredOutputPorts },
|
|
2682
|
+
...c.declaredInputPorts !== void 0 && { declaredInputPorts: c.declaredInputPorts }
|
|
2683
|
+
};
|
|
2684
|
+
}
|
|
2629
2685
|
nodeTypeName(node) {
|
|
2630
2686
|
const configToken = node.config?.type;
|
|
2631
2687
|
if (typeof configToken?.name === "string" && configToken.name) return configToken.name;
|
|
@@ -4025,7 +4081,8 @@ let CredentialHttpRouteHandler = class CredentialHttpRouteHandler$1 {
|
|
|
4025
4081
|
}
|
|
4026
4082
|
async getWorkflowCredentialHealth(_$1, params) {
|
|
4027
4083
|
try {
|
|
4028
|
-
|
|
4084
|
+
const health = await this.queryBus.execute(new GetWorkflowCredentialHealthQuery(params.workflowId));
|
|
4085
|
+
return Response.json(health);
|
|
4029
4086
|
} catch (error) {
|
|
4030
4087
|
return ServerHttpErrorResponseFactory.fromUnknown(error);
|
|
4031
4088
|
}
|
|
@@ -4639,14 +4696,16 @@ let WorkflowHttpRouteHandler = class WorkflowHttpRouteHandler$1 {
|
|
|
4639
4696
|
}
|
|
4640
4697
|
async getWorkflowRuns(_$1, params) {
|
|
4641
4698
|
try {
|
|
4642
|
-
|
|
4699
|
+
const runs = await this.queryBus.execute(new ListWorkflowRunsQuery(params.workflowId));
|
|
4700
|
+
return Response.json(runs);
|
|
4643
4701
|
} catch (error) {
|
|
4644
4702
|
return ServerHttpErrorResponseFactory.fromUnknown(error);
|
|
4645
4703
|
}
|
|
4646
4704
|
}
|
|
4647
4705
|
async getWorkflowDebuggerOverlay(_$1, params) {
|
|
4648
4706
|
try {
|
|
4649
|
-
|
|
4707
|
+
const overlay = await this.queryBus.execute(new GetWorkflowDebuggerOverlayQuery(params.workflowId));
|
|
4708
|
+
return Response.json(overlay);
|
|
4650
4709
|
} catch (error) {
|
|
4651
4710
|
return ServerHttpErrorResponseFactory.fromUnknown(error);
|
|
4652
4711
|
}
|
|
@@ -14950,6 +15009,7 @@ var AppContainerFactory = class AppContainerFactory {
|
|
|
14950
15009
|
VerifyUserInviteQueryHandler,
|
|
14951
15010
|
GetRunBinaryAttachmentQueryHandler,
|
|
14952
15011
|
GetRunStateQueryHandler,
|
|
15012
|
+
GetWorkflowRunDetailQueryHandler,
|
|
14953
15013
|
GetWorkflowDebuggerOverlayQueryHandler,
|
|
14954
15014
|
GetWorkflowDetailQueryHandler,
|
|
14955
15015
|
GetWorkflowOverlayBinaryAttachmentQueryHandler,
|
|
@@ -15273,4 +15333,4 @@ var AppContainerFactory = class AppContainerFactory {
|
|
|
15273
15333
|
|
|
15274
15334
|
//#endregion
|
|
15275
15335
|
export { GetWorkflowDetailQuery as C, ListUserAccountsQuery as E, GetWorkflowSummariesQuery as S, UpsertLocalBootstrapUserCommand as T, CodemationFrontendAuthSnapshotFactory as _, AppContainerLifecycle as a, WorkflowDefinitionMapper as b, RequestToWebhookItemMapper as c, CredentialHttpRouteHandler as d, CodemationHonoApiApp as f, FrontendAppConfigFactory as g, InternalAuthBootstrapFactory as h, DatabaseMigrations as i, RunHttpRouteHandler as l, PublicFrontendBootstrapFactory as m, WorkerRuntime as n, WorkflowHttpRouteHandler as o, BinaryHttpRouteHandler as p, FrontendRuntime as r, WebhookHttpRouteHandler as s, AppContainerFactory as t, OAuth2HttpRouteHandler as u, WorkflowWebsocketServer as v, RunBinaryAttachmentLookupService as w, WorkflowPolicyUiPresentationFactory as x, ApiPaths as y };
|
|
15276
|
-
//# sourceMappingURL=AppContainerFactory-
|
|
15336
|
+
//# sourceMappingURL=AppContainerFactory-CeKsjo8L.js.map
|