@codemation/host 0.5.0 → 0.6.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.
- package/CHANGELOG.md +43 -0
- package/dist/{AppConfigFactory-CvpFScwB.js → AppConfigFactory-C6q-CSKb.js} +7 -6
- package/dist/{AppConfigFactory-CvpFScwB.js.map → AppConfigFactory-C6q-CSKb.js.map} +1 -1
- package/dist/{AppConfigFactory-LK76niPc.d.ts → AppConfigFactory-YnveXE9k.d.ts} +40 -4
- package/dist/{AppContainerFactory-BlLrm6_h.js → AppContainerFactory-qaqc-R1D.js} +21 -13
- package/dist/AppContainerFactory-qaqc-R1D.js.map +1 -0
- package/dist/{CodemationAppContext-CvWi5gey.d.ts → CodemationAppContext-DRu1Dpri.d.ts} +3 -3
- package/dist/{CodemationAuthoring.types-BuKNTDC1.d.ts → CodemationAuthoring.types-fBRppnmi.d.ts} +4 -4
- package/dist/{CodemationConfigNormalizer-CYdR0PR5.d.ts → CodemationConfigNormalizer-DVko3cVN.d.ts} +3 -3
- package/dist/{CodemationConsumerConfigLoader-C3nAj9Bj.d.ts → CodemationConsumerConfigLoader-DJWr86f-.d.ts} +2 -2
- package/dist/{CodemationPluginListMerger-D-gwVwtw.d.ts → CodemationPluginListMerger-DGc-jfa2.d.ts} +7 -7
- package/dist/{CredentialContractsRegistry-D7mcPed2.d.ts → CredentialContractsRegistry-DrMIDSw8.d.ts} +2 -2
- package/dist/CredentialServices-CgxwguAv.js.map +1 -1
- package/dist/{CredentialServices-DdCEP2xt.d.ts → CredentialServices-UfvHB-rN.d.ts} +4 -4
- package/dist/{ItemsInputNormalizer-D1WppVMU.d.ts → ItemsInputNormalizer-C-KHg9Mo.d.ts} +20 -1
- package/dist/{PublicFrontendBootstrapFactory-BMWqNM9a.d.ts → PublicFrontendBootstrapFactory-Cb2pLmDd.d.ts} +2 -2
- package/dist/{TelemetryContracts-BsOD_Y17.d.ts → TelemetryContracts-DbaNomrH.d.ts} +2 -2
- package/dist/{WorkflowPolicyUiPresentationFactory-DNE5oAI6.d.ts → WorkflowPolicyUiPresentationFactory-DQEY-h_S.d.ts} +2 -2
- package/dist/{WorkflowViewContracts-0ZgsHQdp.d.ts → WorkflowViewContracts-CzK2KFuz.d.ts} +6 -1
- package/dist/authoring.d.ts +4 -4
- package/dist/consumer.d.ts +5 -5
- package/dist/credentials.d.ts +5 -5
- package/dist/devServerSidecar.d.ts +2 -2
- package/dist/dto.d.ts +5 -5
- package/dist/{index-BlGs9e9Q.d.ts → index-BbBk26m0.d.ts} +2 -2
- package/dist/index.d.ts +15 -15
- package/dist/index.js +4 -4
- package/dist/mapping.d.ts +2 -2
- package/dist/nextServer.d.ts +12 -12
- package/dist/nextServer.js +2 -2
- package/dist/{persistenceServer-CpNFYa_q.js → persistenceServer-CmsIKnO9.js} +2 -2
- package/dist/{persistenceServer-CpNFYa_q.js.map → persistenceServer-CmsIKnO9.js.map} +1 -1
- package/dist/{persistenceServer-CIVt3UOX.d.ts → persistenceServer-vtJAGDat.d.ts} +2 -2
- package/dist/persistenceServer.d.ts +6 -6
- package/dist/persistenceServer.js +2 -2
- package/dist/{server-BK43OKxW.js → server-CJFfY67o.js} +3 -3
- package/dist/{server-BK43OKxW.js.map → server-CJFfY67o.js.map} +1 -1
- package/dist/{server-CQWdkT7t.d.ts → server-MUNGsBYK.d.ts} +5 -5
- package/dist/server.d.ts +10 -10
- package/dist/server.js +4 -4
- package/package.json +5 -5
- package/prisma/migrations/20260507120000_execution_instance_child_run_id/migration.sql +5 -0
- package/prisma/migrations.sqlite/20260507120000_execution_instance_child_run_id/migration.sql +5 -0
- package/prisma/schema.postgresql.prisma +1 -0
- package/prisma/schema.sqlite.prisma +1 -0
- package/prisma-generated/prisma-postgresql-client/edge.js +6 -5
- package/prisma-generated/prisma-postgresql-client/index-browser.js +2 -1
- package/prisma-generated/prisma-postgresql-client/index.d.ts +38 -2
- package/prisma-generated/prisma-postgresql-client/index.js +6 -5
- package/prisma-generated/prisma-postgresql-client/package.json +1 -1
- package/prisma-generated/prisma-postgresql-client/schema.prisma +1 -0
- package/prisma-generated/prisma-sqlite-client/edge.js +6 -5
- package/prisma-generated/prisma-sqlite-client/index-browser.js +2 -1
- package/prisma-generated/prisma-sqlite-client/index.d.ts +38 -2
- package/prisma-generated/prisma-sqlite-client/index.js +6 -5
- package/prisma-generated/prisma-sqlite-client/package.json +1 -1
- package/prisma-generated/prisma-sqlite-client/schema.prisma +1 -0
- package/src/application/contracts/WorkflowViewContracts.ts +5 -0
- package/src/application/mapping/WorkflowDefinitionMapper.ts +4 -0
- package/src/domain/credentials/CredentialSecretCipher.ts +4 -0
- package/src/infrastructure/persistence/InMemoryWorkflowRunRepository.ts +1 -0
- package/src/infrastructure/persistence/PrismaWorkflowRunRepository.ts +7 -0
- package/dist/AppContainerFactory-BlLrm6_h.js.map +0 -1
|
@@ -107,6 +107,7 @@ model ExecutionInstance {
|
|
|
107
107
|
iterationId String? @map("iteration_id")
|
|
108
108
|
itemIndex Int? @map("item_index")
|
|
109
109
|
parentInvocationId String? @map("parent_invocation_id")
|
|
110
|
+
childRunId String? @map("child_run_id")
|
|
110
111
|
|
|
111
112
|
run Run @relation(fields: [runId], references: [runId], onDelete: Cascade)
|
|
112
113
|
|
|
@@ -23,6 +23,11 @@ export type WorkflowNodeDto = Readonly<{
|
|
|
23
23
|
* mailbox / fixture file / data source the test cases originate from.
|
|
24
24
|
*/
|
|
25
25
|
description?: string;
|
|
26
|
+
/**
|
|
27
|
+
* When present, the node is a SubWorkflow invocation targeting this workflow id. Surfaced in
|
|
28
|
+
* the properties panel as an "Open in editor" navigation link.
|
|
29
|
+
*/
|
|
30
|
+
referencedWorkflowId?: string;
|
|
26
31
|
}>;
|
|
27
32
|
|
|
28
33
|
export type WorkflowEdgeDto = Readonly<{
|
|
@@ -133,6 +133,7 @@ export class WorkflowDefinitionMapper implements DataMapper<WorkflowDefinition,
|
|
|
133
133
|
? ((node.config as { triggerKind?: "live" | "test" }).triggerKind ?? "live")
|
|
134
134
|
: undefined;
|
|
135
135
|
const description = (node.config as { description?: string }).description;
|
|
136
|
+
const referencedWorkflowId = (node.config as { workflowId?: string }).workflowId;
|
|
136
137
|
nodes.push({
|
|
137
138
|
id: node.id,
|
|
138
139
|
kind: node.kind,
|
|
@@ -145,6 +146,9 @@ export class WorkflowDefinitionMapper implements DataMapper<WorkflowDefinition,
|
|
|
145
146
|
...this.nodePortFieldsFromConfig(node.config),
|
|
146
147
|
...(triggerKind ? { triggerKind } : {}),
|
|
147
148
|
...(typeof description === "string" && description.trim().length > 0 ? { description } : {}),
|
|
149
|
+
...(typeof referencedWorkflowId === "string" && referencedWorkflowId.trim().length > 0
|
|
150
|
+
? { referencedWorkflowId }
|
|
151
|
+
: {}),
|
|
148
152
|
});
|
|
149
153
|
if (AgentConfigInspector.isAgentNodeConfig(node.config)) {
|
|
150
154
|
this.appendVirtualConnectionNodes(
|
|
@@ -26,9 +26,11 @@ export class CredentialSecretCipher {
|
|
|
26
26
|
const iv = randomBytes(CredentialSecretCipher.ivLength);
|
|
27
27
|
const cipher = createCipheriv(CredentialSecretCipher.algorithm, this.resolveKeyMaterial(), iv);
|
|
28
28
|
const plaintext = Buffer.from(JSON.stringify(value), "utf8");
|
|
29
|
+
// eslint-disable-next-line codemation/no-buffer-everything -- AES-GCM credential cipher operates on bounded KB-sized JSON payloads; streaming crypto is not applicable here.
|
|
29
30
|
const encrypted = Buffer.concat([cipher.update(plaintext), cipher.final()]);
|
|
30
31
|
const authTag = cipher.getAuthTag();
|
|
31
32
|
return {
|
|
33
|
+
// eslint-disable-next-line codemation/no-buffer-everything -- AES-GCM credential cipher operates on bounded KB-sized JSON payloads; streaming crypto is not applicable here.
|
|
32
34
|
encryptedJson: Buffer.concat([iv, authTag, encrypted]).toString("base64"),
|
|
33
35
|
encryptionKeyId: this.resolveKeyId(),
|
|
34
36
|
schemaVersion: CredentialSecretCipher.schemaVersion,
|
|
@@ -42,12 +44,14 @@ export class CredentialSecretCipher {
|
|
|
42
44
|
schemaVersion: number;
|
|
43
45
|
}>,
|
|
44
46
|
): JsonRecord {
|
|
47
|
+
// eslint-disable-next-line codemation/no-buffer-everything -- AES-GCM credential cipher operates on bounded KB-sized JSON payloads; streaming crypto is not applicable here.
|
|
45
48
|
const packed = Buffer.from(record.encryptedJson, "base64");
|
|
46
49
|
const iv = packed.subarray(0, CredentialSecretCipher.ivLength);
|
|
47
50
|
const authTag = packed.subarray(CredentialSecretCipher.ivLength, CredentialSecretCipher.ivLength + 16);
|
|
48
51
|
const encrypted = packed.subarray(CredentialSecretCipher.ivLength + 16);
|
|
49
52
|
const decipher = createDecipheriv(CredentialSecretCipher.algorithm, this.resolveKeyMaterial(), iv);
|
|
50
53
|
decipher.setAuthTag(authTag);
|
|
54
|
+
// eslint-disable-next-line codemation/no-buffer-everything -- AES-GCM credential cipher operates on bounded KB-sized JSON payloads; streaming crypto is not applicable here.
|
|
51
55
|
const plaintext = Buffer.concat([decipher.update(encrypted), decipher.final()]).toString("utf8");
|
|
52
56
|
return JSON.parse(plaintext) as JsonRecord;
|
|
53
57
|
}
|
|
@@ -119,6 +119,7 @@ export class InMemoryWorkflowRunRepository implements WorkflowRunRepository, Wor
|
|
|
119
119
|
inputJson: snapshot.inputsByPort as never,
|
|
120
120
|
outputJson: snapshot.outputs as never,
|
|
121
121
|
error: snapshot.error,
|
|
122
|
+
...(snapshot.childRunId !== undefined ? { childRunId: snapshot.childRunId } : {}),
|
|
122
123
|
}),
|
|
123
124
|
);
|
|
124
125
|
const invocationInstances: ExecutionInstanceDto[] = (state.connectionInvocations ?? []).map(
|
|
@@ -52,6 +52,7 @@ type ExecutionInstanceRow = {
|
|
|
52
52
|
iterationId: string | null;
|
|
53
53
|
itemIndex: number | null;
|
|
54
54
|
parentInvocationId: string | null;
|
|
55
|
+
childRunId: string | null;
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
type RunWorkItemRecord = {
|
|
@@ -345,6 +346,7 @@ export class PrismaWorkflowRunRepository implements WorkflowRunRepository, Workf
|
|
|
345
346
|
inputTruncated: instance.inputTruncated,
|
|
346
347
|
outputTruncated: instance.outputTruncated,
|
|
347
348
|
usedPinnedOutput: instance.usedPinnedOutput,
|
|
349
|
+
childRunId: instance.childRunId,
|
|
348
350
|
},
|
|
349
351
|
});
|
|
350
352
|
continue;
|
|
@@ -510,6 +512,9 @@ export class PrismaWorkflowRunRepository implements WorkflowRunRepository, Workf
|
|
|
510
512
|
inputsByPort,
|
|
511
513
|
outputs,
|
|
512
514
|
error,
|
|
515
|
+
...(row.childRunId !== null && row.childRunId !== undefined
|
|
516
|
+
? { childRunId: row.childRunId as NodeExecutionSnapshot["childRunId"] }
|
|
517
|
+
: {}),
|
|
513
518
|
};
|
|
514
519
|
}
|
|
515
520
|
|
|
@@ -564,6 +569,7 @@ export class PrismaWorkflowRunRepository implements WorkflowRunRepository, Workf
|
|
|
564
569
|
iterationId: row.iterationId ?? undefined,
|
|
565
570
|
itemIndex: row.itemIndex ?? undefined,
|
|
566
571
|
parentInvocationId: row.parentInvocationId ?? undefined,
|
|
572
|
+
...(row.childRunId !== null && row.childRunId !== undefined ? { childRunId: row.childRunId } : {}),
|
|
567
573
|
};
|
|
568
574
|
}
|
|
569
575
|
|
|
@@ -636,6 +642,7 @@ export class PrismaWorkflowRunRepository implements WorkflowRunRepository, Workf
|
|
|
636
642
|
inputStorageKind: "inline",
|
|
637
643
|
outputStorageKind: "inline",
|
|
638
644
|
usedPinnedOutput: snap.usedPinnedOutput ?? null,
|
|
645
|
+
childRunId: snap.childRunId ?? null,
|
|
639
646
|
});
|
|
640
647
|
}
|
|
641
648
|
let cIdx = 0;
|