@codemation/host 0.2.0 → 0.2.2
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 +24 -0
- package/dist/{AppConfigFactory-ByT1D8dM.js → AppConfigFactory-CqKWXqOm.js} +2 -2
- package/dist/{AppConfigFactory-ByT1D8dM.js.map → AppConfigFactory-CqKWXqOm.js.map} +1 -1
- package/dist/{AppConfigFactory-DHdAGOmC.d.ts → AppConfigFactory-DeULdLzi.d.ts} +3 -3
- package/dist/{AppContainerFactory-BKaAUIi-.js → AppContainerFactory-CcSGFNLW.js} +42 -9
- package/dist/AppContainerFactory-CcSGFNLW.js.map +1 -0
- package/dist/{CodemationConfig-DBbMU3HB.d.ts → CodemationAppContext-DZt_ZwXH.d.ts} +80 -80
- package/dist/CodemationAuthoring.types-CT6Kp1vK.d.ts +202 -0
- package/dist/CodemationAuthoring.types-SxVJ1qu5.js +86 -0
- package/dist/CodemationAuthoring.types-SxVJ1qu5.js.map +1 -0
- package/dist/{CodemationConfigNormalizer-C8wC0skq.d.ts → CodemationConfigNormalizer-C2CJnmKY.d.ts} +2 -2
- package/dist/{CodemationConsumerConfigLoader-D6LFSlp5.js → CodemationConsumerConfigLoader-DovlxZNb.js} +2 -2
- package/dist/{CodemationConsumerConfigLoader-D6LFSlp5.js.map → CodemationConsumerConfigLoader-DovlxZNb.js.map} +1 -1
- package/dist/{CodemationConsumerConfigLoader-Ceh6sB3X.d.ts → CodemationConsumerConfigLoader-kijLkRtF.d.ts} +2 -2
- package/dist/{CodemationPluginListMerger-Cx9DnyR-.d.ts → CodemationPluginListMerger-Z-qsxAS9.d.ts} +6 -6
- package/dist/{CodemationPluginListMerger-CGwOTdZ7.js → CodemationPluginListMerger-_lZaa6gO.js} +1 -1
- package/dist/{CodemationPluginListMerger-CGwOTdZ7.js.map → CodemationPluginListMerger-_lZaa6gO.js.map} +1 -1
- package/dist/{CodemationAuthConfig-7hEfICPf.d.ts → CodemationWhitelabelConfig-D5rYcLlj.d.ts} +33 -33
- package/dist/{ConsoleLogger-ClPU7jtc.js → ConsoleLogger-DuStfHe0.js} +1 -1
- package/dist/{ConsoleLogger-ClPU7jtc.js.map → ConsoleLogger-DuStfHe0.js.map} +1 -1
- package/dist/{CredentialServices-D8BBZH1i.js → CredentialServices-BPKUF8Xs.js} +3 -3
- package/dist/{CredentialServices-D8BBZH1i.js.map → CredentialServices-BPKUF8Xs.js.map} +1 -1
- package/dist/{CredentialServices-CYETzKyb.d.ts → CredentialServices-CGS_E7O-.d.ts} +3 -3
- package/dist/{LogLevelPolicy-9IcPGZFk.d.ts → LogLevelPolicy-CkiJAH75.d.ts} +2 -2
- package/dist/{PublicFrontendBootstrap-DCniMBGu.d.ts → PublicFrontendBootstrap-ci0Vwxrb.d.ts} +2 -2
- package/dist/{PublicFrontendBootstrapFactory-DeMjp3cs.d.ts → PublicFrontendBootstrapFactory-CYBuZerA.d.ts} +4 -4
- package/dist/{PublicFrontendBootstrapJsonCodec-BdiVGG5R.js → PublicFrontendBootstrapJsonCodec-BZgQ_FnW.js} +1 -1
- package/dist/{PublicFrontendBootstrapJsonCodec-BdiVGG5R.js.map → PublicFrontendBootstrapJsonCodec-BZgQ_FnW.js.map} +1 -1
- package/dist/{PublicFrontendBootstrapJsonCodec-BE0mhe1v.d.ts → PublicFrontendBootstrapJsonCodec-Ja0GQgpp.d.ts} +2 -2
- package/dist/{ServerLoggerFactory-BltIIDfQ.js → ServerLoggerFactory-CsNW5qhz.js} +4 -4
- package/dist/{ServerLoggerFactory-BltIIDfQ.js.map → ServerLoggerFactory-CsNW5qhz.js.map} +1 -1
- package/dist/authoring.d.ts +5 -0
- package/dist/authoring.js +4 -0
- package/dist/client.d.ts +4 -4
- package/dist/client.js +2 -2
- package/dist/consumer.d.ts +5 -5
- package/dist/consumer.js +5 -5
- package/dist/credentials.d.ts +4 -4
- package/dist/credentials.js +3 -3
- package/dist/devServerSidecar.d.ts +1 -1
- package/dist/{index-dK05sTQ4.d.ts → index-DMedRrli.d.ts} +83 -8
- package/dist/index.d.ts +14 -203
- package/dist/index.js +14 -98
- package/dist/nextServer.d.ts +10 -10
- package/dist/nextServer.js +8 -8
- package/dist/{persistenceServer-DMvIOGW8.js → persistenceServer-DKbFDxoS.js} +2 -2
- package/dist/{persistenceServer-DMvIOGW8.js.map → persistenceServer-DKbFDxoS.js.map} +1 -1
- package/dist/{persistenceServer-D9vUTMqc.d.ts → persistenceServer-DdIyEFHH.d.ts} +2 -2
- package/dist/persistenceServer.d.ts +6 -6
- package/dist/persistenceServer.js +3 -3
- package/dist/{server-fxqY2WEi.d.ts → server-Bd7_dgBB.d.ts} +5 -5
- package/dist/{server-C-WZcsId.js → server-CFpgKuVE.js} +5 -5
- package/dist/{server-C-WZcsId.js.map → server-CFpgKuVE.js.map} +1 -1
- package/dist/server.d.ts +11 -11
- package/dist/server.js +11 -11
- package/package.json +14 -7
- package/src/application/commands/StartWorkflowRunCommandHandler.ts +64 -2
- package/src/authoring.ts +31 -0
- package/dist/AppContainerFactory-BKaAUIi-.js.map +0 -1
- package/dist/index.js.map +0 -1
- /package/dist/{decorate-B0PP651O.js → decorate-Dq0XLibd.js} +0 -0
- /package/dist/{decorateParam-DrsXNPuw.js → decorateParam-D7WPDFAf.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as NormalizedCodemationConfig } from "./CodemationConfigNormalizer-
|
|
1
|
+
import { i as AppPersistenceConfig, r as AppConfig } from "./CodemationAppContext-DZt_ZwXH.js";
|
|
2
|
+
import { t as NormalizedCodemationConfig } from "./CodemationConfigNormalizer-C2CJnmKY.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-DeULdLzi.d.ts.map
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { i as __toESM, r as __require, t as __commonJS } from "./chunk-7V6ThxGB.js";
|
|
2
|
-
import { o as LogLevelPolicyFactory, s as logLevelPolicyFactory, t as ServerLoggerFactory } from "./ServerLoggerFactory-
|
|
3
|
-
import { n as __decorateMetadata, t as __decorateParam } from "./decorateParam-
|
|
4
|
-
import { t as __decorate } from "./decorate-
|
|
5
|
-
import { a as CredentialInstanceService, c as CredentialSecretCipher, d as ApplicationTokens, f as ApplicationRequestError, h as OpenAiApiKeyCredentialHealthTester, i as CredentialBindingService, l as CredentialFieldEnvOverlayService, m as OpenAiApiKeyCredentialTypeFactory, n as CredentialSessionServiceImpl, o as CredentialOAuth2ScopeResolver, p as CredentialTypeRegistryImpl, r as CredentialRuntimeMaterialService, s as CredentialMaterialResolver, t as CredentialTestService, u as WorkflowCredentialNodeResolver } from "./CredentialServices-
|
|
6
|
-
import { i as require_client$2, r as PrismaMigrationDeployer } from "./AppConfigFactory-
|
|
2
|
+
import { o as LogLevelPolicyFactory, s as logLevelPolicyFactory, t as ServerLoggerFactory } from "./ServerLoggerFactory-CsNW5qhz.js";
|
|
3
|
+
import { n as __decorateMetadata, t as __decorateParam } from "./decorateParam-D7WPDFAf.js";
|
|
4
|
+
import { t as __decorate } from "./decorate-Dq0XLibd.js";
|
|
5
|
+
import { a as CredentialInstanceService, c as CredentialSecretCipher, d as ApplicationTokens, f as ApplicationRequestError, h as OpenAiApiKeyCredentialHealthTester, i as CredentialBindingService, l as CredentialFieldEnvOverlayService, m as OpenAiApiKeyCredentialTypeFactory, n as CredentialSessionServiceImpl, o as CredentialOAuth2ScopeResolver, p as CredentialTypeRegistryImpl, r as CredentialRuntimeMaterialService, s as CredentialMaterialResolver, t as CredentialTestService, u as WorkflowCredentialNodeResolver } from "./CredentialServices-BPKUF8Xs.js";
|
|
6
|
+
import { i as require_client$2, r as PrismaMigrationDeployer } from "./AppConfigFactory-CqKWXqOm.js";
|
|
7
|
+
import { AIAgentConnectionWorkflowExpander, ConnectionCredentialNodeConfigFactory, ManualTriggerNode } from "@codemation/core-nodes";
|
|
7
8
|
import { mkdir, rm, stat } from "node:fs/promises";
|
|
8
9
|
import path from "node:path";
|
|
9
10
|
import { pathToFileURL } from "node:url";
|
|
@@ -11,7 +12,6 @@ import { AgentConfigInspector, AgentConnectionNodeCollector, CoreTokens, Default
|
|
|
11
12
|
import { createHash, randomBytes } from "node:crypto";
|
|
12
13
|
import "reflect-metadata";
|
|
13
14
|
import { ConfigDrivenOffloadPolicy, DefaultDrivingScheduler, DefaultExecutionContextFactory, Engine, EngineRuntimeRegistrar, InMemoryBinaryStorage, InMemoryRunDataFactory, InlineDrivingScheduler, MissingRuntimeTriggerToken, PersistedWorkflowTokenRegistry, RunIntentService, RunSummaryMapper, WorkflowRepositoryWebhookTriggerMatcher } from "@codemation/core/bootstrap";
|
|
14
|
-
import { AIAgentConnectionWorkflowExpander, ConnectionCredentialNodeConfigFactory, ManualTriggerNode } from "@codemation/core-nodes";
|
|
15
15
|
import { compare, hash } from "bcryptjs";
|
|
16
16
|
import sanitizeFilename from "sanitize-filename";
|
|
17
17
|
import { WebSocket, WebSocketServer } from "ws";
|
|
@@ -1226,12 +1226,19 @@ let StartWorkflowRunCommandHandler = class StartWorkflowRunCommandHandler$1 exte
|
|
|
1226
1226
|
sourceState,
|
|
1227
1227
|
debuggerOverlay
|
|
1228
1228
|
});
|
|
1229
|
+
const synthesizeTriggerItems = this.resolveSynthesizeTriggerItems({
|
|
1230
|
+
workflow,
|
|
1231
|
+
mode: body.mode,
|
|
1232
|
+
requestedItems,
|
|
1233
|
+
requestedSynthesizeTriggerItems: body.synthesizeTriggerItems,
|
|
1234
|
+
currentState
|
|
1235
|
+
});
|
|
1229
1236
|
const result = legacyStartNodeId && this.hasReusableCurrentState(currentState) && !clearFromNodeId ? await this.runIntentService.rerunFromNode({
|
|
1230
1237
|
workflow,
|
|
1231
1238
|
nodeId: legacyStartNodeId,
|
|
1232
1239
|
currentState,
|
|
1233
1240
|
items: requestedItems,
|
|
1234
|
-
synthesizeTriggerItems
|
|
1241
|
+
synthesizeTriggerItems,
|
|
1235
1242
|
executionOptions,
|
|
1236
1243
|
workflowSnapshot: sourceState?.workflowSnapshot,
|
|
1237
1244
|
mutableState: this.cloneMutableState(currentState.mutableState)
|
|
@@ -1239,7 +1246,7 @@ let StartWorkflowRunCommandHandler = class StartWorkflowRunCommandHandler$1 exte
|
|
|
1239
1246
|
workflow,
|
|
1240
1247
|
startAt: legacyStartNodeId && !body.sourceRunId && !body.stopAt ? legacyStartNodeId : void 0,
|
|
1241
1248
|
items,
|
|
1242
|
-
synthesizeTriggerItems
|
|
1249
|
+
synthesizeTriggerItems,
|
|
1243
1250
|
executionOptions,
|
|
1244
1251
|
workflowSnapshot: sourceState?.workflowSnapshot,
|
|
1245
1252
|
mutableState: this.cloneMutableState(currentState.mutableState),
|
|
@@ -1319,6 +1326,32 @@ let StartWorkflowRunCommandHandler = class StartWorkflowRunCommandHandler$1 exte
|
|
|
1319
1326
|
hasReusableCurrentState(currentState) {
|
|
1320
1327
|
return Object.keys(currentState.outputsByNode).length > 0 || Object.keys(currentState.nodeSnapshotsByNodeId).length > 0 || Object.keys(currentState.mutableState?.nodesById ?? {}).length > 0;
|
|
1321
1328
|
}
|
|
1329
|
+
resolveSynthesizeTriggerItems(args) {
|
|
1330
|
+
if (this.hasNonEmptyItems(args.requestedItems)) return false;
|
|
1331
|
+
if (args.requestedSynthesizeTriggerItems === true) return true;
|
|
1332
|
+
if (args.mode !== "manual") return args.requestedSynthesizeTriggerItems ?? false;
|
|
1333
|
+
if (!this.workflowHasTrigger(args.workflow)) return args.requestedSynthesizeTriggerItems ?? false;
|
|
1334
|
+
if (this.currentStateHasTriggerData(args.workflow, args.currentState)) return args.requestedSynthesizeTriggerItems ?? false;
|
|
1335
|
+
return true;
|
|
1336
|
+
}
|
|
1337
|
+
workflowHasTrigger(workflow) {
|
|
1338
|
+
return workflow.nodes.some((node) => node.kind === "trigger");
|
|
1339
|
+
}
|
|
1340
|
+
currentStateHasTriggerData(workflow, currentState) {
|
|
1341
|
+
const triggerNodeIds = workflow.nodes.filter((node) => node.kind === "trigger").map((node) => node.id);
|
|
1342
|
+
for (const triggerNodeId of triggerNodeIds) {
|
|
1343
|
+
if (this.hasOutputItems(currentState.outputsByNode[triggerNodeId])) return true;
|
|
1344
|
+
if (this.hasOutputItems(currentState.mutableState?.nodesById?.[triggerNodeId]?.pinnedOutputsByPort)) return true;
|
|
1345
|
+
}
|
|
1346
|
+
return false;
|
|
1347
|
+
}
|
|
1348
|
+
hasOutputItems(outputsByPort) {
|
|
1349
|
+
if (!outputsByPort) return false;
|
|
1350
|
+
return Object.values(outputsByPort).some((items) => this.hasNonEmptyItems(items));
|
|
1351
|
+
}
|
|
1352
|
+
hasNonEmptyItems(items) {
|
|
1353
|
+
return (items?.length ?? 0) > 0;
|
|
1354
|
+
}
|
|
1322
1355
|
};
|
|
1323
1356
|
StartWorkflowRunCommandHandler = __decorate([
|
|
1324
1357
|
HandlesCommand.forCommand(StartWorkflowRunCommand),
|
|
@@ -15337,4 +15370,4 @@ var AppContainerFactory = class AppContainerFactory {
|
|
|
15337
15370
|
|
|
15338
15371
|
//#endregion
|
|
15339
15372
|
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 };
|
|
15340
|
-
//# sourceMappingURL=AppContainerFactory-
|
|
15373
|
+
//# sourceMappingURL=AppContainerFactory-CcSGFNLW.js.map
|