@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.
Files changed (62) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/{AppConfigFactory-ByT1D8dM.js → AppConfigFactory-CqKWXqOm.js} +2 -2
  3. package/dist/{AppConfigFactory-ByT1D8dM.js.map → AppConfigFactory-CqKWXqOm.js.map} +1 -1
  4. package/dist/{AppConfigFactory-DHdAGOmC.d.ts → AppConfigFactory-DeULdLzi.d.ts} +3 -3
  5. package/dist/{AppContainerFactory-BKaAUIi-.js → AppContainerFactory-CcSGFNLW.js} +42 -9
  6. package/dist/AppContainerFactory-CcSGFNLW.js.map +1 -0
  7. package/dist/{CodemationConfig-DBbMU3HB.d.ts → CodemationAppContext-DZt_ZwXH.d.ts} +80 -80
  8. package/dist/CodemationAuthoring.types-CT6Kp1vK.d.ts +202 -0
  9. package/dist/CodemationAuthoring.types-SxVJ1qu5.js +86 -0
  10. package/dist/CodemationAuthoring.types-SxVJ1qu5.js.map +1 -0
  11. package/dist/{CodemationConfigNormalizer-C8wC0skq.d.ts → CodemationConfigNormalizer-C2CJnmKY.d.ts} +2 -2
  12. package/dist/{CodemationConsumerConfigLoader-D6LFSlp5.js → CodemationConsumerConfigLoader-DovlxZNb.js} +2 -2
  13. package/dist/{CodemationConsumerConfigLoader-D6LFSlp5.js.map → CodemationConsumerConfigLoader-DovlxZNb.js.map} +1 -1
  14. package/dist/{CodemationConsumerConfigLoader-Ceh6sB3X.d.ts → CodemationConsumerConfigLoader-kijLkRtF.d.ts} +2 -2
  15. package/dist/{CodemationPluginListMerger-Cx9DnyR-.d.ts → CodemationPluginListMerger-Z-qsxAS9.d.ts} +6 -6
  16. package/dist/{CodemationPluginListMerger-CGwOTdZ7.js → CodemationPluginListMerger-_lZaa6gO.js} +1 -1
  17. package/dist/{CodemationPluginListMerger-CGwOTdZ7.js.map → CodemationPluginListMerger-_lZaa6gO.js.map} +1 -1
  18. package/dist/{CodemationAuthConfig-7hEfICPf.d.ts → CodemationWhitelabelConfig-D5rYcLlj.d.ts} +33 -33
  19. package/dist/{ConsoleLogger-ClPU7jtc.js → ConsoleLogger-DuStfHe0.js} +1 -1
  20. package/dist/{ConsoleLogger-ClPU7jtc.js.map → ConsoleLogger-DuStfHe0.js.map} +1 -1
  21. package/dist/{CredentialServices-D8BBZH1i.js → CredentialServices-BPKUF8Xs.js} +3 -3
  22. package/dist/{CredentialServices-D8BBZH1i.js.map → CredentialServices-BPKUF8Xs.js.map} +1 -1
  23. package/dist/{CredentialServices-CYETzKyb.d.ts → CredentialServices-CGS_E7O-.d.ts} +3 -3
  24. package/dist/{LogLevelPolicy-9IcPGZFk.d.ts → LogLevelPolicy-CkiJAH75.d.ts} +2 -2
  25. package/dist/{PublicFrontendBootstrap-DCniMBGu.d.ts → PublicFrontendBootstrap-ci0Vwxrb.d.ts} +2 -2
  26. package/dist/{PublicFrontendBootstrapFactory-DeMjp3cs.d.ts → PublicFrontendBootstrapFactory-CYBuZerA.d.ts} +4 -4
  27. package/dist/{PublicFrontendBootstrapJsonCodec-BdiVGG5R.js → PublicFrontendBootstrapJsonCodec-BZgQ_FnW.js} +1 -1
  28. package/dist/{PublicFrontendBootstrapJsonCodec-BdiVGG5R.js.map → PublicFrontendBootstrapJsonCodec-BZgQ_FnW.js.map} +1 -1
  29. package/dist/{PublicFrontendBootstrapJsonCodec-BE0mhe1v.d.ts → PublicFrontendBootstrapJsonCodec-Ja0GQgpp.d.ts} +2 -2
  30. package/dist/{ServerLoggerFactory-BltIIDfQ.js → ServerLoggerFactory-CsNW5qhz.js} +4 -4
  31. package/dist/{ServerLoggerFactory-BltIIDfQ.js.map → ServerLoggerFactory-CsNW5qhz.js.map} +1 -1
  32. package/dist/authoring.d.ts +5 -0
  33. package/dist/authoring.js +4 -0
  34. package/dist/client.d.ts +4 -4
  35. package/dist/client.js +2 -2
  36. package/dist/consumer.d.ts +5 -5
  37. package/dist/consumer.js +5 -5
  38. package/dist/credentials.d.ts +4 -4
  39. package/dist/credentials.js +3 -3
  40. package/dist/devServerSidecar.d.ts +1 -1
  41. package/dist/{index-dK05sTQ4.d.ts → index-DMedRrli.d.ts} +83 -8
  42. package/dist/index.d.ts +14 -203
  43. package/dist/index.js +14 -98
  44. package/dist/nextServer.d.ts +10 -10
  45. package/dist/nextServer.js +8 -8
  46. package/dist/{persistenceServer-DMvIOGW8.js → persistenceServer-DKbFDxoS.js} +2 -2
  47. package/dist/{persistenceServer-DMvIOGW8.js.map → persistenceServer-DKbFDxoS.js.map} +1 -1
  48. package/dist/{persistenceServer-D9vUTMqc.d.ts → persistenceServer-DdIyEFHH.d.ts} +2 -2
  49. package/dist/persistenceServer.d.ts +6 -6
  50. package/dist/persistenceServer.js +3 -3
  51. package/dist/{server-fxqY2WEi.d.ts → server-Bd7_dgBB.d.ts} +5 -5
  52. package/dist/{server-C-WZcsId.js → server-CFpgKuVE.js} +5 -5
  53. package/dist/{server-C-WZcsId.js.map → server-CFpgKuVE.js.map} +1 -1
  54. package/dist/server.d.ts +11 -11
  55. package/dist/server.js +11 -11
  56. package/package.json +14 -7
  57. package/src/application/commands/StartWorkflowRunCommandHandler.ts +64 -2
  58. package/src/authoring.ts +31 -0
  59. package/dist/AppContainerFactory-BKaAUIi-.js.map +0 -1
  60. package/dist/index.js.map +0 -1
  61. /package/dist/{decorate-B0PP651O.js → decorate-Dq0XLibd.js} +0 -0
  62. /package/dist/{decorateParam-DrsXNPuw.js → decorateParam-D7WPDFAf.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ServerLoggerFactory-BltIIDfQ.js","names":["levelRank: Record<Exclude<LogLevel, \"silent\">, number>","compiled: { matchers: ReadonlyArray<RegExp>; minLevel: LogLevel }[]","inner: Logger","scope: string","filter: LogFilter","ServerLoggerFactory","logLevelPolicyFactory: LogLevelPolicyFactory","ServerLogger"],"sources":["../src/infrastructure/logging/LogLevelPolicy.ts","../src/infrastructure/logging/LogLevelPolicyFactory.ts","../src/infrastructure/logging/FilteringLogger.ts","../src/infrastructure/logging/PerformanceLogPolicy.ts","../src/infrastructure/logging/PerformanceLogPolicyFactory.ts","../src/infrastructure/logging/ServerLoggerFactory.ts"],"sourcesContent":["import type { CodemationLogConfig, CodemationLogRule } from \"../../presentation/config/CodemationLogConfig\";\n\nexport type LogLevel = \"silent\" | \"debug\" | \"info\" | \"warn\" | \"error\";\n\nconst levelRank: Record<Exclude<LogLevel, \"silent\">, number> = {\n debug: 0,\n info: 1,\n warn: 2,\n error: 3,\n};\n\nconst globRegexMetaChars = new Set(\"\\\\^$+?()[]{}|.\");\n\n/**\n * Minimum log level for @codemation/host loggers.\n * - `CODEMATION_LOG_LEVEL` overrides when set to a known level (for namespaces not matched by `codemation.config` log rules).\n * - Under Vitest, defaults to **warn** so routine `info`/`debug` noise stays off the terminal; `warn`/`error` still print.\n * - Otherwise defaults to **info**.\n *\n * When {@link applyCodemationLogConfig} is set, the first matching rule wins per namespace; unmatched namespaces use env defaults.\n *\n * Resolve a shared instance via {@link LogLevelPolicyFactory} (DI or `logLevelPolicyFactory`).\n */\nexport class LogLevelPolicy {\n private cachedMin: LogLevel | undefined;\n\n private codemationRules: ReadonlyArray<{ matchers: ReadonlyArray<RegExp>; minLevel: LogLevel }> | null = null;\n\n resolveMin(): LogLevel {\n const raw = process.env.CODEMATION_LOG_LEVEL?.toLowerCase();\n if (raw === \"silent\" || raw === \"debug\" || raw === \"info\" || raw === \"warn\" || raw === \"error\") {\n return raw;\n }\n if (process.env.VITEST === \"true\") {\n return \"warn\";\n }\n return \"info\";\n }\n\n private minLevelCached(): LogLevel {\n if (this.cachedMin === undefined) {\n this.cachedMin = this.resolveMin();\n }\n return this.cachedMin;\n }\n\n resetForTests(): void {\n this.cachedMin = undefined;\n this.codemationRules = null;\n }\n\n /**\n * Applies `codemation.config` log rules. Pass `undefined` to clear rules and use env-only behavior.\n */\n applyCodemationLogConfig(config: CodemationLogConfig | undefined): void {\n this.codemationRules = null;\n if (!config) {\n return;\n }\n const rawRules = this.normalizeCodemationRules(config);\n if (rawRules.length === 0) {\n return;\n }\n const compiled: { matchers: ReadonlyArray<RegExp>; minLevel: LogLevel }[] = [];\n for (const rule of rawRules) {\n const minLevel = this.parseRuleLevel(rule.level);\n const patterns = this.normalizeFilterPatterns(rule.filter);\n if (patterns.length === 0) {\n throw new Error(\"codemation.config log rule filter must include at least one pattern\");\n }\n const matchers = patterns.map((pattern) => this.compileGlobPattern(pattern));\n compiled.push({\n matchers,\n minLevel,\n });\n }\n this.codemationRules = compiled;\n }\n\n shouldEmit(level: Exclude<LogLevel, \"silent\">, namespace: string): boolean {\n if (this.codemationRules && this.codemationRules.length > 0) {\n for (const rule of this.codemationRules) {\n if (rule.matchers.some((regex) => regex.test(namespace))) {\n return this.levelPassesAgainstMin(level, rule.minLevel);\n }\n }\n }\n return this.levelPassesAgainstMin(level, this.minLevelCached());\n }\n\n private normalizeCodemationRules(config: CodemationLogConfig): ReadonlyArray<CodemationLogRule> {\n if (\"rules\" in config && Array.isArray(config.rules)) {\n return [...config.rules];\n }\n return [config as CodemationLogRule];\n }\n\n private normalizeFilterPatterns(filter: string | ReadonlyArray<string>): ReadonlyArray<string> {\n if (typeof filter === \"string\") {\n return [filter];\n }\n return [...filter];\n }\n\n /**\n * Glob: only `*` is special (matches any substring). A lone `*` matches all namespaces.\n */\n private compileGlobPattern(pattern: string): RegExp {\n const trimmed = pattern.trim();\n if (trimmed === \"*\") {\n return /^.*$/;\n }\n let body = \"\";\n for (const ch of trimmed) {\n if (ch === \"*\") {\n body += \".*\";\n continue;\n }\n if (globRegexMetaChars.has(ch)) {\n body += \"\\\\\" + ch;\n continue;\n }\n body += ch;\n }\n return new RegExp(\"^\" + body + \"$\");\n }\n\n private parseRuleLevel(level: string): LogLevel {\n const normalized = level.toLowerCase();\n if (\n normalized === \"silent\" ||\n normalized === \"debug\" ||\n normalized === \"info\" ||\n normalized === \"warn\" ||\n normalized === \"error\"\n ) {\n return normalized;\n }\n throw new Error(`Invalid codemation.config log level: ${level}`);\n }\n\n private levelPassesAgainstMin(level: Exclude<LogLevel, \"silent\">, min: LogLevel): boolean {\n if (min === \"silent\") {\n return false;\n }\n return levelRank[level] >= levelRank[min];\n }\n}\n","import { LogLevelPolicy } from \"./LogLevelPolicy\";\n\n/**\n * Process-wide {@link LogLevelPolicy} singleton for server and browser loggers.\n * Plain class (no `@injectable` from `@codemation/core`): client components import this file; decorating would pull core into the browser bundle.\n */\nexport class LogLevelPolicyFactory {\n private readonly policy = new LogLevelPolicy();\n\n create(): LogLevelPolicy {\n return this.policy;\n }\n}\n\n/** Shared factory for call sites outside the DI container (e.g. next-host bootstrap). */\nexport const logLevelPolicyFactory = new LogLevelPolicyFactory();\n","import type { LogFilter } from \"../../application/logging/LogFilter\";\nimport type { Logger } from \"../../application/logging/Logger\";\n\nexport class FilteringLogger implements Logger {\n constructor(\n private readonly inner: Logger,\n private readonly scope: string,\n private readonly filter: LogFilter,\n ) {}\n\n info(message: string, exception?: Error): void {\n if (!this.filter({ scope: this.scope, level: \"info\", message })) {\n return;\n }\n this.inner.info(message, exception);\n }\n\n warn(message: string, exception?: Error): void {\n if (!this.filter({ scope: this.scope, level: \"warn\", message })) {\n return;\n }\n this.inner.warn(message, exception);\n }\n\n error(message: string, exception?: Error): void {\n if (!this.filter({ scope: this.scope, level: \"error\", message })) {\n return;\n }\n this.inner.error(message, exception);\n }\n\n debug(message: string, exception?: Error): void {\n if (!this.filter({ scope: this.scope, level: \"debug\", message })) {\n return;\n }\n this.inner.debug(message, exception);\n }\n}\n","/**\n * Opt-in detailed timing / diagnostics lines (used with `ServerLoggerFactory#createPerformanceDiagnostics`).\n *\n * Set `CODEMATION_PERFORMANCE_LOGGING=true` to enable. Otherwise those loggers are silent regardless of level.\n */\nexport class PerformanceLogPolicy {\n shouldEmitDetailedTiming(): boolean {\n return process.env.CODEMATION_PERFORMANCE_LOGGING === \"true\";\n }\n}\n","import { PerformanceLogPolicy } from \"./PerformanceLogPolicy\";\n\n/**\n * Process-wide {@link PerformanceLogPolicy} singleton (same pattern as {@link LogLevelPolicyFactory}).\n */\nexport class PerformanceLogPolicyFactory {\n private readonly policy = new PerformanceLogPolicy();\n\n create(): PerformanceLogPolicy {\n return this.policy;\n }\n}\n\nexport const performanceLogPolicyFactory = new PerformanceLogPolicyFactory();\n","import { inject, injectable } from \"@codemation/core\";\n\nimport type { LogFilter } from \"../../application/logging/LogFilter\";\nimport type { Logger, LoggerFactory } from \"../../application/logging/Logger\";\n\nimport { FilteringLogger } from \"./FilteringLogger\";\nimport { LogLevelPolicyFactory } from \"./LogLevelPolicyFactory\";\nimport { performanceLogPolicyFactory } from \"./PerformanceLogPolicyFactory\";\nimport { ServerLogger } from \"./ServerLogger\";\n\n@injectable()\nexport class ServerLoggerFactory implements LoggerFactory {\n constructor(@inject(LogLevelPolicyFactory) private readonly logLevelPolicyFactory: LogLevelPolicyFactory) {}\n\n create(scope: string): Logger {\n return new ServerLogger(scope, this.logLevelPolicyFactory.create());\n }\n\n createFiltered(scope: string, filter: LogFilter): Logger {\n return new FilteringLogger(this.create(scope), scope, filter);\n }\n\n createPerformanceDiagnostics(scope: string): Logger {\n return this.createFiltered(scope, (_entry) => performanceLogPolicyFactory.create().shouldEmitDetailedTiming());\n }\n}\n\nexport { ServerLogger } from \"./ServerLogger\";\n"],"mappings":";;;;;;AAIA,MAAMA,YAAyD;CAC7D,OAAO;CACP,MAAM;CACN,MAAM;CACN,OAAO;CACR;AAED,MAAM,qCAAqB,IAAI,IAAI,iBAAiB;;;;;;;;;;;AAYpD,IAAa,iBAAb,MAA4B;CAC1B,AAAQ;CAER,AAAQ,kBAAiG;CAEzG,aAAuB;EACrB,MAAM,MAAM,QAAQ,IAAI,sBAAsB,aAAa;AAC3D,MAAI,QAAQ,YAAY,QAAQ,WAAW,QAAQ,UAAU,QAAQ,UAAU,QAAQ,QACrF,QAAO;AAET,MAAI,QAAQ,IAAI,WAAW,OACzB,QAAO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AyB;AAC9C,MAAI,CAAC,KAAK,OAAO;GAAE,OAAO,KAAK;GAAO,OAAO;GAAS;GAAS,CAAC,CAC9D;AAEF,OAAK,MAAM,MAAM,SAAS,UAAU;;;;;;;;;;;AC9BxC,IAAa,uBAAb,MAAkC;CAChC,2BAAoC;AAClC,SAAO,QAAQ,IAAI,mCAAmC;;;;;;;;;ACF1D,IAAa,8BAAb,MAAyC;CACvC,AAAiB,SAAS,IAAI,sBAAsB;CAEpD,SAA+B;AAC7B,SAAO,KAAK;;;AAIhB,MAAa,8BAA8B,IAAI,6BAA6B;;;;;ACFrE,gCAAMC,sBAA6C;CACxD,YAAY,AAAgDC,yBAA8C;EAA9C;;CAE5D,OAAO,OAAuB;AAC5B,SAAO,IAAIC,cAAa,OAAO,KAAK,sBAAsB,QAAQ,CAAC;;CAGrE,eAAe,OAAe,QAA2B;AACvD,SAAO,IAAI,gBAAgB,KAAK,OAAO,MAAM,EAAE,OAAO,OAAO;;CAG/D,6BAA6B,OAAuB;AAClD,SAAO,KAAK,eAAe,QAAQ,WAAW,4BAA4B,QAAQ,CAAC,0BAA0B,CAAC;;;;CAbjH,YAAY;oBAEE,OAAO,sBAAsB"}
1
+ {"version":3,"file":"ServerLoggerFactory-CsNW5qhz.js","names":["levelRank: Record<Exclude<LogLevel, \"silent\">, number>","compiled: { matchers: ReadonlyArray<RegExp>; minLevel: LogLevel }[]","inner: Logger","scope: string","filter: LogFilter","ServerLoggerFactory","logLevelPolicyFactory: LogLevelPolicyFactory","ServerLogger"],"sources":["../src/infrastructure/logging/LogLevelPolicy.ts","../src/infrastructure/logging/LogLevelPolicyFactory.ts","../src/infrastructure/logging/FilteringLogger.ts","../src/infrastructure/logging/PerformanceLogPolicy.ts","../src/infrastructure/logging/PerformanceLogPolicyFactory.ts","../src/infrastructure/logging/ServerLoggerFactory.ts"],"sourcesContent":["import type { CodemationLogConfig, CodemationLogRule } from \"../../presentation/config/CodemationLogConfig\";\n\nexport type LogLevel = \"silent\" | \"debug\" | \"info\" | \"warn\" | \"error\";\n\nconst levelRank: Record<Exclude<LogLevel, \"silent\">, number> = {\n debug: 0,\n info: 1,\n warn: 2,\n error: 3,\n};\n\nconst globRegexMetaChars = new Set(\"\\\\^$+?()[]{}|.\");\n\n/**\n * Minimum log level for @codemation/host loggers.\n * - `CODEMATION_LOG_LEVEL` overrides when set to a known level (for namespaces not matched by `codemation.config` log rules).\n * - Under Vitest, defaults to **warn** so routine `info`/`debug` noise stays off the terminal; `warn`/`error` still print.\n * - Otherwise defaults to **info**.\n *\n * When {@link applyCodemationLogConfig} is set, the first matching rule wins per namespace; unmatched namespaces use env defaults.\n *\n * Resolve a shared instance via {@link LogLevelPolicyFactory} (DI or `logLevelPolicyFactory`).\n */\nexport class LogLevelPolicy {\n private cachedMin: LogLevel | undefined;\n\n private codemationRules: ReadonlyArray<{ matchers: ReadonlyArray<RegExp>; minLevel: LogLevel }> | null = null;\n\n resolveMin(): LogLevel {\n const raw = process.env.CODEMATION_LOG_LEVEL?.toLowerCase();\n if (raw === \"silent\" || raw === \"debug\" || raw === \"info\" || raw === \"warn\" || raw === \"error\") {\n return raw;\n }\n if (process.env.VITEST === \"true\") {\n return \"warn\";\n }\n return \"info\";\n }\n\n private minLevelCached(): LogLevel {\n if (this.cachedMin === undefined) {\n this.cachedMin = this.resolveMin();\n }\n return this.cachedMin;\n }\n\n resetForTests(): void {\n this.cachedMin = undefined;\n this.codemationRules = null;\n }\n\n /**\n * Applies `codemation.config` log rules. Pass `undefined` to clear rules and use env-only behavior.\n */\n applyCodemationLogConfig(config: CodemationLogConfig | undefined): void {\n this.codemationRules = null;\n if (!config) {\n return;\n }\n const rawRules = this.normalizeCodemationRules(config);\n if (rawRules.length === 0) {\n return;\n }\n const compiled: { matchers: ReadonlyArray<RegExp>; minLevel: LogLevel }[] = [];\n for (const rule of rawRules) {\n const minLevel = this.parseRuleLevel(rule.level);\n const patterns = this.normalizeFilterPatterns(rule.filter);\n if (patterns.length === 0) {\n throw new Error(\"codemation.config log rule filter must include at least one pattern\");\n }\n const matchers = patterns.map((pattern) => this.compileGlobPattern(pattern));\n compiled.push({\n matchers,\n minLevel,\n });\n }\n this.codemationRules = compiled;\n }\n\n shouldEmit(level: Exclude<LogLevel, \"silent\">, namespace: string): boolean {\n if (this.codemationRules && this.codemationRules.length > 0) {\n for (const rule of this.codemationRules) {\n if (rule.matchers.some((regex) => regex.test(namespace))) {\n return this.levelPassesAgainstMin(level, rule.minLevel);\n }\n }\n }\n return this.levelPassesAgainstMin(level, this.minLevelCached());\n }\n\n private normalizeCodemationRules(config: CodemationLogConfig): ReadonlyArray<CodemationLogRule> {\n if (\"rules\" in config && Array.isArray(config.rules)) {\n return [...config.rules];\n }\n return [config as CodemationLogRule];\n }\n\n private normalizeFilterPatterns(filter: string | ReadonlyArray<string>): ReadonlyArray<string> {\n if (typeof filter === \"string\") {\n return [filter];\n }\n return [...filter];\n }\n\n /**\n * Glob: only `*` is special (matches any substring). A lone `*` matches all namespaces.\n */\n private compileGlobPattern(pattern: string): RegExp {\n const trimmed = pattern.trim();\n if (trimmed === \"*\") {\n return /^.*$/;\n }\n let body = \"\";\n for (const ch of trimmed) {\n if (ch === \"*\") {\n body += \".*\";\n continue;\n }\n if (globRegexMetaChars.has(ch)) {\n body += \"\\\\\" + ch;\n continue;\n }\n body += ch;\n }\n return new RegExp(\"^\" + body + \"$\");\n }\n\n private parseRuleLevel(level: string): LogLevel {\n const normalized = level.toLowerCase();\n if (\n normalized === \"silent\" ||\n normalized === \"debug\" ||\n normalized === \"info\" ||\n normalized === \"warn\" ||\n normalized === \"error\"\n ) {\n return normalized;\n }\n throw new Error(`Invalid codemation.config log level: ${level}`);\n }\n\n private levelPassesAgainstMin(level: Exclude<LogLevel, \"silent\">, min: LogLevel): boolean {\n if (min === \"silent\") {\n return false;\n }\n return levelRank[level] >= levelRank[min];\n }\n}\n","import { LogLevelPolicy } from \"./LogLevelPolicy\";\n\n/**\n * Process-wide {@link LogLevelPolicy} singleton for server and browser loggers.\n * Plain class (no `@injectable` from `@codemation/core`): client components import this file; decorating would pull core into the browser bundle.\n */\nexport class LogLevelPolicyFactory {\n private readonly policy = new LogLevelPolicy();\n\n create(): LogLevelPolicy {\n return this.policy;\n }\n}\n\n/** Shared factory for call sites outside the DI container (e.g. next-host bootstrap). */\nexport const logLevelPolicyFactory = new LogLevelPolicyFactory();\n","import type { LogFilter } from \"../../application/logging/LogFilter\";\nimport type { Logger } from \"../../application/logging/Logger\";\n\nexport class FilteringLogger implements Logger {\n constructor(\n private readonly inner: Logger,\n private readonly scope: string,\n private readonly filter: LogFilter,\n ) {}\n\n info(message: string, exception?: Error): void {\n if (!this.filter({ scope: this.scope, level: \"info\", message })) {\n return;\n }\n this.inner.info(message, exception);\n }\n\n warn(message: string, exception?: Error): void {\n if (!this.filter({ scope: this.scope, level: \"warn\", message })) {\n return;\n }\n this.inner.warn(message, exception);\n }\n\n error(message: string, exception?: Error): void {\n if (!this.filter({ scope: this.scope, level: \"error\", message })) {\n return;\n }\n this.inner.error(message, exception);\n }\n\n debug(message: string, exception?: Error): void {\n if (!this.filter({ scope: this.scope, level: \"debug\", message })) {\n return;\n }\n this.inner.debug(message, exception);\n }\n}\n","/**\n * Opt-in detailed timing / diagnostics lines (used with `ServerLoggerFactory#createPerformanceDiagnostics`).\n *\n * Set `CODEMATION_PERFORMANCE_LOGGING=true` to enable. Otherwise those loggers are silent regardless of level.\n */\nexport class PerformanceLogPolicy {\n shouldEmitDetailedTiming(): boolean {\n return process.env.CODEMATION_PERFORMANCE_LOGGING === \"true\";\n }\n}\n","import { PerformanceLogPolicy } from \"./PerformanceLogPolicy\";\n\n/**\n * Process-wide {@link PerformanceLogPolicy} singleton (same pattern as {@link LogLevelPolicyFactory}).\n */\nexport class PerformanceLogPolicyFactory {\n private readonly policy = new PerformanceLogPolicy();\n\n create(): PerformanceLogPolicy {\n return this.policy;\n }\n}\n\nexport const performanceLogPolicyFactory = new PerformanceLogPolicyFactory();\n","import { inject, injectable } from \"@codemation/core\";\n\nimport type { LogFilter } from \"../../application/logging/LogFilter\";\nimport type { Logger, LoggerFactory } from \"../../application/logging/Logger\";\n\nimport { FilteringLogger } from \"./FilteringLogger\";\nimport { LogLevelPolicyFactory } from \"./LogLevelPolicyFactory\";\nimport { performanceLogPolicyFactory } from \"./PerformanceLogPolicyFactory\";\nimport { ServerLogger } from \"./ServerLogger\";\n\n@injectable()\nexport class ServerLoggerFactory implements LoggerFactory {\n constructor(@inject(LogLevelPolicyFactory) private readonly logLevelPolicyFactory: LogLevelPolicyFactory) {}\n\n create(scope: string): Logger {\n return new ServerLogger(scope, this.logLevelPolicyFactory.create());\n }\n\n createFiltered(scope: string, filter: LogFilter): Logger {\n return new FilteringLogger(this.create(scope), scope, filter);\n }\n\n createPerformanceDiagnostics(scope: string): Logger {\n return this.createFiltered(scope, (_entry) => performanceLogPolicyFactory.create().shouldEmitDetailedTiming());\n }\n}\n\nexport { ServerLogger } from \"./ServerLogger\";\n"],"mappings":";;;;;;AAIA,MAAMA,YAAyD;CAC7D,OAAO;CACP,MAAM;CACN,MAAM;CACN,OAAO;CACR;AAED,MAAM,qCAAqB,IAAI,IAAI,iBAAiB;;;;;;;;;;;AAYpD,IAAa,iBAAb,MAA4B;CAC1B,AAAQ;CAER,AAAQ,kBAAiG;CAEzG,aAAuB;EACrB,MAAM,MAAM,QAAQ,IAAI,sBAAsB,aAAa;AAC3D,MAAI,QAAQ,YAAY,QAAQ,WAAW,QAAQ,UAAU,QAAQ,UAAU,QAAQ,QACrF,QAAO;AAET,MAAI,QAAQ,IAAI,WAAW,OACzB,QAAO;AAET,SAAO;;CAGT,AAAQ,iBAA2B;AACjC,MAAI,KAAK,cAAc,OACrB,MAAK,YAAY,KAAK,YAAY;AAEpC,SAAO,KAAK;;CAGd,gBAAsB;AACpB,OAAK,YAAY;AACjB,OAAK,kBAAkB;;;;;CAMzB,yBAAyB,QAA+C;AACtE,OAAK,kBAAkB;AACvB,MAAI,CAAC,OACH;EAEF,MAAM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b,MAAyC;CACvC,AAAiB,SAAS,IAAI,sBAAsB;CAEpD,SAA+B;AAC7B,SAAO,KAAK;;;AAIhB,MAAa,8BAA8B,IAAI,6BAA6B;;;;;ACFrE,gCAAMC,sBAA6C;CACxD,YAAY,AAAgDC,yBAA8C;EAA9C;;CAE5D,OAAO,OAAuB;AAC5B,SAAO,IAAIC,cAAa,OAAO,KAAK,sBAAsB,QAAQ,CAAC;;CAGrE,eAAe,OAAe,QAA2B;AACvD,SAAO,IAAI,gBAAgB,KAAK,OAAO,MAAM,EAAE,OAAO,OAAO;;CAG/D,6BAA6B,OAAuB;AAClD,SAAO,KAAK,eAAe,QAAQ,WAAW,4BAA4B,QAAQ,CAAC,0BAA0B,CAAC;;;;CAbjH,YAAY;oBAEE,OAAO,sBAAsB"}
@@ -0,0 +1,5 @@
1
+ import "./index-DMedRrli.js";
2
+ import { a as defineCodemationApp, i as FriendlyCodemationExecutionConfig, n as DefinePluginOptions, o as definePlugin, r as FriendlyCodemationDatabaseConfig, s as workflow, t as DefineCodemationAppOptions } from "./CodemationAuthoring.types-CT6Kp1vK.js";
3
+ import { _ as CodemationEngineExecutionLimitsConfig, b as CodemationSchedulerConfig, c as CodemationPluginContext, d as CodemationAppSchedulerConfig, f as CodemationAppSchedulerKind, g as CodemationDatabaseKind, h as CodemationDatabaseConfig, m as CodemationConfig, n as CodemationRegistrationContextBase, o as CodemationPlugin, p as CodemationApplicationRuntimeConfig, s as CodemationPluginConfig, t as CodemationAppContext, u as CodemationAppDefinition, v as CodemationEventBusConfig, x as CodemationSchedulerKind, y as CodemationEventBusKind } from "./CodemationAppContext-DZt_ZwXH.js";
4
+ import "./CodemationWhitelabelConfig-D5rYcLlj.js";
5
+ export { type CodemationAppContext, type CodemationAppDefinition, type CodemationAppSchedulerConfig, type CodemationAppSchedulerKind, type CodemationApplicationRuntimeConfig, type CodemationConfig, type CodemationDatabaseConfig, type CodemationDatabaseKind, type CodemationEngineExecutionLimitsConfig, type CodemationEventBusConfig, type CodemationEventBusKind, type CodemationPlugin, type CodemationPluginConfig, type CodemationPluginContext, type CodemationRegistrationContextBase, type CodemationSchedulerConfig, type CodemationSchedulerKind, type DefineCodemationAppOptions, type DefinePluginOptions, type FriendlyCodemationDatabaseConfig, type FriendlyCodemationExecutionConfig, defineCodemationApp, definePlugin, workflow };
@@ -0,0 +1,4 @@
1
+ import { n as definePlugin, t as defineCodemationApp } from "./CodemationAuthoring.types-SxVJ1qu5.js";
2
+ import { workflow } from "@codemation/core-nodes";
3
+
4
+ export { defineCodemationApp, definePlugin, workflow };
package/dist/client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { a as CodemationWhitelabelConfig, l as Logger, u as LoggerFactory } from "./CodemationAuthConfig-7hEfICPf.js";
2
- import { t as LogLevelPolicy } from "./LogLevelPolicy-9IcPGZFk.js";
3
- import { a as CodemationFrontendAuthSnapshot, i as CodemationFrontendAuthProviderSnapshot, n as InternalAuthBootstrap, r as FrontendAppConfig, t as PublicFrontendBootstrap } from "./PublicFrontendBootstrap-DCniMBGu.js";
4
- import { i as CodemationFrontendAuthSnapshotJsonCodec, n as InternalAuthBootstrapJsonCodec, r as FrontendAppConfigJsonCodec, t as PublicFrontendBootstrapJsonCodec } from "./PublicFrontendBootstrapJsonCodec-BE0mhe1v.js";
1
+ import { l as Logger, t as CodemationWhitelabelConfig, u as LoggerFactory } from "./CodemationWhitelabelConfig-D5rYcLlj.js";
2
+ import { t as LogLevelPolicy } from "./LogLevelPolicy-CkiJAH75.js";
3
+ import { a as CodemationFrontendAuthSnapshot, i as CodemationFrontendAuthProviderSnapshot, n as InternalAuthBootstrap, r as FrontendAppConfig, t as PublicFrontendBootstrap } from "./PublicFrontendBootstrap-ci0Vwxrb.js";
4
+ import { i as CodemationFrontendAuthSnapshotJsonCodec, n as InternalAuthBootstrapJsonCodec, r as FrontendAppConfigJsonCodec, t as PublicFrontendBootstrapJsonCodec } from "./PublicFrontendBootstrapJsonCodec-Ja0GQgpp.js";
5
5
 
6
6
  //#region src/infrastructure/logging/BrowserLoggerFactory.d.ts
7
7
  declare class BrowserLoggerFactory implements LoggerFactory {
package/dist/client.js CHANGED
@@ -1,5 +1,5 @@
1
- import { t as ConsoleLogger } from "./ConsoleLogger-ClPU7jtc.js";
2
- import { i as CodemationFrontendAuthSnapshotJsonCodec, n as InternalAuthBootstrapJsonCodec, r as FrontendAppConfigJsonCodec, t as PublicFrontendBootstrapJsonCodec } from "./PublicFrontendBootstrapJsonCodec-BdiVGG5R.js";
1
+ import { t as ConsoleLogger } from "./ConsoleLogger-DuStfHe0.js";
2
+ import { i as CodemationFrontendAuthSnapshotJsonCodec, n as InternalAuthBootstrapJsonCodec, r as FrontendAppConfigJsonCodec, t as PublicFrontendBootstrapJsonCodec } from "./PublicFrontendBootstrapJsonCodec-BZgQ_FnW.js";
3
3
 
4
4
  //#region src/infrastructure/logging/BrowserLoggerFactory.ts
5
5
  var BrowserLoggerFactory = class {
@@ -1,6 +1,6 @@
1
- import "./CodemationAuthConfig-7hEfICPf.js";
2
- import "./index-dK05sTQ4.js";
3
- import "./CodemationConfig-DBbMU3HB.js";
4
- import "./CodemationConfigNormalizer-C8wC0skq.js";
5
- import { i as CodemationConsumerAppResolver, n as CodemationConsumerConfigResolution, r as CodemationConsumerApp, t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-Ceh6sB3X.js";
1
+ import "./index-DMedRrli.js";
2
+ import "./CodemationAppContext-DZt_ZwXH.js";
3
+ import "./CodemationWhitelabelConfig-D5rYcLlj.js";
4
+ import "./CodemationConfigNormalizer-C2CJnmKY.js";
5
+ import { i as CodemationConsumerAppResolver, n as CodemationConsumerConfigResolution, r as CodemationConsumerApp, t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-kijLkRtF.js";
6
6
  export { type CodemationConsumerApp, CodemationConsumerAppResolver, CodemationConsumerConfigLoader, type CodemationConsumerConfigResolution };
package/dist/consumer.js CHANGED
@@ -1,7 +1,7 @@
1
- import "./ConsoleLogger-ClPU7jtc.js";
2
- import { i as CodemationConsumerAppResolver, t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-D6LFSlp5.js";
3
- import "./ServerLoggerFactory-BltIIDfQ.js";
4
- import "./decorateParam-DrsXNPuw.js";
5
- import "./decorate-B0PP651O.js";
1
+ import "./ConsoleLogger-DuStfHe0.js";
2
+ import { i as CodemationConsumerAppResolver, t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-DovlxZNb.js";
3
+ import "./ServerLoggerFactory-CsNW5qhz.js";
4
+ import "./decorateParam-D7WPDFAf.js";
5
+ import "./decorate-Dq0XLibd.js";
6
6
 
7
7
  export { CodemationConsumerAppResolver, CodemationConsumerConfigLoader };
@@ -1,7 +1,7 @@
1
- import "./CodemationAuthConfig-7hEfICPf.js";
2
- import { d as CredentialHealth, s as AnyCredentialType, v as CredentialSessionFactoryArgs } from "./index-dK05sTQ4.js";
3
- import "./CodemationConfig-DBbMU3HB.js";
4
- import { a as CredentialInstanceService, i as CredentialBindingService, n as CredentialType } from "./CredentialServices-CYETzKyb.js";
1
+ import { c as AnyCredentialType, f as CredentialHealth, y as CredentialSessionFactoryArgs } from "./index-DMedRrli.js";
2
+ import "./CodemationAppContext-DZt_ZwXH.js";
3
+ import "./CodemationWhitelabelConfig-D5rYcLlj.js";
4
+ import { a as CredentialInstanceService, i as CredentialBindingService, n as CredentialType } from "./CredentialServices-CGS_E7O-.js";
5
5
 
6
6
  //#region src/infrastructure/credentials/OpenAiApiKeyCredentialShapes.types.d.ts
7
7
  /**
@@ -1,6 +1,6 @@
1
- import "./decorateParam-DrsXNPuw.js";
2
- import "./decorate-B0PP651O.js";
3
- import { a as CredentialInstanceService, h as OpenAiApiKeyCredentialHealthTester, i as CredentialBindingService, m as OpenAiApiKeyCredentialTypeFactory } from "./CredentialServices-D8BBZH1i.js";
1
+ import "./decorateParam-D7WPDFAf.js";
2
+ import "./decorate-Dq0XLibd.js";
3
+ import { a as CredentialInstanceService, h as OpenAiApiKeyCredentialHealthTester, i as CredentialBindingService, m as OpenAiApiKeyCredentialTypeFactory } from "./CredentialServices-BPKUF8Xs.js";
4
4
 
5
5
  //#region src/credentials.ts
6
6
  const defaultOpenAiApiKeyCredentialTypeFactory = new OpenAiApiKeyCredentialTypeFactory(new OpenAiApiKeyCredentialHealthTester(globalThis.fetch));
@@ -1,4 +1,4 @@
1
- import { B as Container, N as WorkflowDefinition } from "./index-dK05sTQ4.js";
1
+ import { P as WorkflowDefinition, V as Container } from "./index-DMedRrli.js";
2
2
 
3
3
  //#region src/presentation/server/CodemationTsyringeParamInfoReader.d.ts
4
4
  declare class CodemationTsyringeParamInfoReader {
@@ -9,6 +9,31 @@ interface Clock {
9
9
  now(): Date;
10
10
  }
11
11
  //#endregion
12
+ //#region ../core/src/contracts/itemValue.d.ts
13
+ declare const ITEM_VALUE_BRAND: unique symbol;
14
+ type ItemValueResolvedContext = Readonly<{
15
+ runId: RunId;
16
+ workflowId: WorkflowId;
17
+ nodeId: NodeId;
18
+ activationId: NodeActivationId;
19
+ data: RunDataSnapshot;
20
+ }>;
21
+ /**
22
+ * Context aligned with former {@link ItemInputMapperContext} — use **`data`** to read any completed upstream node.
23
+ */
24
+ type ItemValueContext = ItemValueResolvedContext;
25
+ type ItemValueArgs<TItemJson = unknown> = Readonly<{
26
+ item: Item<TItemJson>;
27
+ itemIndex: number;
28
+ items: Items<TItemJson>;
29
+ ctx: ItemValueContext;
30
+ }>;
31
+ type ItemValueCallback<T, TItemJson = unknown> = (args: ItemValueArgs<TItemJson>) => T | Promise<T>;
32
+ type ItemValue<T, TItemJson = unknown> = Readonly<{
33
+ readonly [ITEM_VALUE_BRAND]: true;
34
+ readonly fn: ItemValueCallback<T, TItemJson>;
35
+ }>;
36
+ //#endregion
12
37
  //#region ../core/src/contracts/retryPolicySpec.types.d.ts
13
38
  /**
14
39
  * In-process retry policy for runnable nodes. Serialized configs use the same
@@ -749,7 +774,6 @@ interface NodeConfigBase {
749
774
  declare const runnableNodeInputType: unique symbol;
750
775
  declare const runnableNodeOutputType: unique symbol;
751
776
  declare const triggerNodeOutputType: unique symbol;
752
- type LineageCarryPolicy = "emitOnly" | "carryThrough";
753
777
  /**
754
778
  * Runnable node: **`TInputJson`** is what **`inputSchema`** validates on **`item.json`** (the wire payload).
755
779
  * **`TOutputJson`** is emitted `item.json` on outputs.
@@ -763,11 +787,6 @@ interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> ex
763
787
  * Resolution order: node instance `inputSchema`, then config `inputSchema`, then `z.unknown()`.
764
788
  */
765
789
  readonly inputSchema?: ZodType<TInputJson$1>;
766
- /**
767
- * Overrides default lineage propagation for `execute` outputs (binary/meta/paired).
768
- * Routers with multiple {@link RunnableNode#outputPorts} default to **`carryThrough`**; others default to **`emitOnly`**.
769
- */
770
- readonly lineageCarry?: LineageCarryPolicy;
771
790
  /**
772
791
  * When an activation receives **zero** input items, the engine normally runs `execute` zero times.
773
792
  * Set to **`runOnce`** to run `execute` once with an empty `items` batch (and a synthetic wire item for schema parsing).
@@ -909,6 +928,12 @@ type CredentialFieldSchema = Readonly<{
909
928
  type: "string" | "password" | "textarea" | "json" | "boolean";
910
929
  required?: true;
911
930
  order?: number;
931
+ /**
932
+ * Where this field appears in the credential dialog. Use `"advanced"` for optional or
933
+ * power-user fields; they render inside a collapsible section (see `CredentialTypeDefinition.advancedSection`).
934
+ * Defaults to `"default"` when omitted.
935
+ */
936
+ visibility?: "default" | "advanced";
912
937
  placeholder?: string;
913
938
  helpText?: string;
914
939
  /** When set, host resolves this field from process.env at runtime; env wins over stored values. */
@@ -973,12 +998,25 @@ type CredentialOAuth2AuthDefinition = Readonly<{
973
998
  clientSecretFieldKey?: string;
974
999
  }>;
975
1000
  type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
1001
+ type CredentialAdvancedSectionPresentation = Readonly<{
1002
+ /** Collapsible section title (default: "Advanced"). */
1003
+ title?: string;
1004
+ /** Optional short helper text shown inside the section (above the fields). */
1005
+ description?: string;
1006
+ /** When true, the advanced section starts expanded. Default: false (collapsed). */
1007
+ defaultOpen?: boolean;
1008
+ }>;
976
1009
  type CredentialTypeDefinition = Readonly<{
977
1010
  typeId: CredentialTypeId;
978
1011
  displayName: string;
979
1012
  description?: string;
980
1013
  publicFields?: ReadonlyArray<CredentialFieldSchema>;
981
1014
  secretFields?: ReadonlyArray<CredentialFieldSchema>;
1015
+ /**
1016
+ * Optional labels for the collapsible block that contains every field with `visibility: "advanced"`.
1017
+ * If omitted, the UI still shows that block with defaults (title "Advanced", collapsed).
1018
+ */
1019
+ advancedSection?: CredentialAdvancedSectionPresentation;
982
1020
  supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
983
1021
  auth?: CredentialAuthDefinition;
984
1022
  }>;
@@ -1068,6 +1106,7 @@ interface AgentCanvasPresentation<TIcon extends string = string> {
1068
1106
  readonly label?: string;
1069
1107
  readonly icon?: TIcon;
1070
1108
  }
1109
+ type ZodSchemaAny = ZodType<any, any, any>;
1071
1110
  interface ToolConfig {
1072
1111
  readonly type: TypeToken<unknown>;
1073
1112
  readonly name: string;
@@ -1075,6 +1114,32 @@ interface ToolConfig {
1075
1114
  readonly presentation?: AgentCanvasPresentation;
1076
1115
  getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
1077
1116
  }
1117
+ type AgentMessageRole = "system" | "user" | "assistant";
1118
+ type AgentMessageBuildArgs<TInputJson$1 = unknown> = Readonly<{
1119
+ item: Item<TInputJson$1>;
1120
+ itemIndex: number;
1121
+ items: Items<TInputJson$1>;
1122
+ ctx: NodeExecutionContext<any>;
1123
+ }>;
1124
+ interface AgentMessageDto {
1125
+ readonly role: AgentMessageRole;
1126
+ readonly content: string;
1127
+ }
1128
+ type AgentMessageTemplateContent<TInputJson$1 = unknown> = string | ((args: AgentMessageBuildArgs<TInputJson$1>) => string);
1129
+ interface AgentMessageTemplate<TInputJson$1 = unknown> {
1130
+ readonly role: AgentMessageRole;
1131
+ readonly content: AgentMessageTemplateContent<TInputJson$1>;
1132
+ }
1133
+ /** A single prompt line: fixed DTO or template with optional function `content`. */
1134
+ type AgentMessageLine<TInputJson$1 = unknown> = AgentMessageDto | AgentMessageTemplate<TInputJson$1>;
1135
+ /**
1136
+ * Message list for an agent. Prefer a **plain array** of `{ role, content }` (optionally with function `content` for templates).
1137
+ * Use the object form only when you need `buildMessages` to append messages after optional `prompt` lines.
1138
+ */
1139
+ type AgentMessageConfig<TInputJson$1 = unknown> = ItemValue<ReadonlyArray<AgentMessageLine<TInputJson$1>>, TInputJson$1> | ReadonlyArray<AgentMessageLine<TInputJson$1>> | {
1140
+ readonly prompt?: ReadonlyArray<AgentMessageLine<TInputJson$1>>;
1141
+ readonly buildMessages?: (args: AgentMessageBuildArgs<TInputJson$1>) => ReadonlyArray<AgentMessageDto>;
1142
+ };
1078
1143
  type AgentTurnLimitBehavior = "error" | "respondWithLastMessage";
1079
1144
  interface AgentModelInvocationOptions {
1080
1145
  readonly maxTokens?: number;
@@ -1094,6 +1159,16 @@ interface ChatModelConfig {
1094
1159
  interface LangChainChatModelLike {
1095
1160
  invoke(input: unknown, options?: unknown): Promise<unknown>;
1096
1161
  bindTools?(tools: ReadonlyArray<unknown>): LangChainChatModelLike;
1162
+ withStructuredOutput?(outputSchema: ZodSchemaAny, config?: ChatModelStructuredOutputOptions): LangChainStructuredOutputModelLike;
1163
+ }
1164
+ interface LangChainStructuredOutputModelLike {
1165
+ invoke(input: unknown, options?: unknown): Promise<unknown>;
1166
+ }
1167
+ interface ChatModelStructuredOutputOptions {
1168
+ readonly method?: "jsonSchema" | "functionCalling" | "jsonMode";
1169
+ readonly strict?: boolean;
1170
+ readonly includeRaw?: boolean;
1171
+ readonly tools?: ReadonlyArray<unknown>;
1097
1172
  }
1098
1173
  interface ChatModelFactory<TConfig$1 extends ChatModelConfig = ChatModelConfig> {
1099
1174
  create(args: Readonly<{
@@ -1296,5 +1371,5 @@ declare class RunIntentService {
1296
1371
  private createWebhookExecutionOptions;
1297
1372
  }
1298
1373
  //#endregion
1299
- export { RunSummary as $, RunIdFactory as A, Container as B, CredentialTypeId as C, Item as D, BinaryAttachment as E, BinaryStorage as F, ChainCursor as G, EngineExecutionLimitsPolicyConfig as H, NodeExecutionContext as I, WebhookInvocationMatch as J, AnyRunnableNodeConfig as K, NodeExecutionRequestHandler as L, RunnableNodeOutputJson as M, WorkflowDefinition as N, Items as O, WorkflowId as P, RunPruneCandidate as Q, NodeExecutionScheduler as R, CredentialTypeDefinition as S, ActivationIdFactory as T, RunEvent as U, TypeToken as V, RunEventBus as W, PersistedRunState as X, WorkflowRunDetailDto as Y, RunCurrentState as Z, CredentialRequirement as _, ToolConfig as a, CredentialSetupStatus as b, CredentialBinding as c, CredentialHealth as d, Clock as et, CredentialInstanceId as f, CredentialOAuth2AuthDefinition as g, CredentialMaterialSourceKind as h, ChatModelConfig as i, RunnableNodeConfig as j, RunId as k, CredentialBindingKey as l, CredentialJsonRecord as m, Engine as n, DefinedNode as o, CredentialInstanceRecord as p, WorkflowActivationPolicy as q, AgentGuardrailConfig as r, AnyCredentialType as s, RunIntentService as t, CredentialFieldSchema as u, CredentialSessionFactoryArgs as v, CredentialTypeRegistry as w, CredentialType as x, CredentialSessionService as y, WorkflowRepository as z };
1300
- //# sourceMappingURL=index-dK05sTQ4.d.ts.map
1374
+ export { RunPruneCandidate as $, RunId as A, WorkflowRepository as B, CredentialTypeDefinition as C, BinaryAttachment as D, ActivationIdFactory as E, WorkflowId as F, RunEventBus as G, TypeToken as H, BinaryStorage as I, WorkflowActivationPolicy as J, ChainCursor as K, NodeExecutionContext as L, RunnableNodeConfig as M, RunnableNodeOutputJson as N, Item as O, WorkflowDefinition as P, RunCurrentState as Q, NodeExecutionRequestHandler as R, CredentialType as S, CredentialTypeRegistry as T, EngineExecutionLimitsPolicyConfig as U, Container as V, RunEvent as W, WorkflowRunDetailDto as X, WebhookInvocationMatch as Y, PersistedRunState as Z, CredentialOAuth2AuthDefinition as _, ChatModelConfig as a, CredentialSessionService as b, AnyCredentialType as c, CredentialFieldSchema as d, RunSummary as et, CredentialHealth as f, CredentialMaterialSourceKind as g, CredentialJsonRecord as h, AgentMessageConfig as i, RunIdFactory as j, Items as k, CredentialBinding as l, CredentialInstanceRecord as m, Engine as n, ToolConfig as o, CredentialInstanceId as p, AnyRunnableNodeConfig as q, AgentGuardrailConfig as r, DefinedNode as s, RunIntentService as t, Clock as tt, CredentialBindingKey as u, CredentialRequirement as v, CredentialTypeId as w, CredentialSetupStatus as x, CredentialSessionFactoryArgs as y, NodeExecutionScheduler as z };
1375
+ //# sourceMappingURL=index-DMedRrli.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- import { a as CodemationWhitelabelConfig, c as CodemationLogRule, i as CodemationAuthOidcProviderConfig, n as CodemationAuthKind, o as CodemationLogConfig, r as CodemationAuthOAuthProviderConfig, s as CodemationLogLevelName, t as CodemationAuthConfig } from "./CodemationAuthConfig-7hEfICPf.js";
2
- import { a as CodemationFrontendAuthSnapshot, i as CodemationFrontendAuthProviderSnapshot, n as InternalAuthBootstrap, r as FrontendAppConfig, t as PublicFrontendBootstrap } from "./PublicFrontendBootstrap-DCniMBGu.js";
3
- import { i as CodemationFrontendAuthSnapshotJsonCodec, n as InternalAuthBootstrapJsonCodec, r as FrontendAppConfigJsonCodec, t as PublicFrontendBootstrapJsonCodec } from "./PublicFrontendBootstrapJsonCodec-BE0mhe1v.js";
4
- import { D as Item, G as ChainCursor, I as NodeExecutionContext, K as AnyRunnableNodeConfig, M as RunnableNodeOutputJson, N as WorkflowDefinition, O as Items, V as TypeToken, a as ToolConfig, i as ChatModelConfig, j as RunnableNodeConfig, o as DefinedNode, r as AgentGuardrailConfig, s as AnyCredentialType } from "./index-dK05sTQ4.js";
5
- import { S as CodemationPluginPackageMetadata, a as CodemationConfig, b as CodemationPluginConfig, c as CodemationEngineExecutionLimitsConfig, d as CodemationSchedulerConfig, f as CodemationSchedulerKind, g as AppConfig, h as CodemationRegistrationContextBase, i as CodemationApplicationRuntimeConfig, l as CodemationEventBusConfig, m as CodemationAppContext, n as CodemationAppSchedulerConfig, o as CodemationDatabaseConfig, p as CodemationWorkflowDiscovery, r as CodemationAppSchedulerKind, s as CodemationDatabaseKind, t as CodemationAppDefinition, u as CodemationEventBusKind, v as AppPluginLoadSummary, w as CodemationClassToken, x as CodemationPluginContext, y as CodemationPlugin } from "./CodemationConfig-DBbMU3HB.js";
6
- import "./CodemationConfigNormalizer-C8wC0skq.js";
7
- import { t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-Ceh6sB3X.js";
8
- import "./CredentialServices-CYETzKyb.js";
9
- import { _ as Command, c as WorkerRuntime, d as AppContainerLifecycle, f as AppContainerFactory, g as CommandBus, h as Query, l as FrontendRuntime, m as QueryBus, n as CodemationBootstrapRequest, r as ApplicationTokens, t as CodemationPluginListMerger, u as DatabaseMigrations } from "./CodemationPluginListMerger-Cx9DnyR-.js";
10
- import { r as PrismaDatabaseClient, t as AppConfigFactory } from "./AppConfigFactory-DHdAGOmC.js";
11
- import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-D9vUTMqc.js";
12
- import { c as CodemationServerGateway, l as ApiPaths } from "./server-fxqY2WEi.js";
13
- import { i as CodemationFrontendAuthSnapshotFactory, n as InternalAuthBootstrapFactory, r as FrontendAppConfigFactory, t as PublicFrontendBootstrapFactory } from "./PublicFrontendBootstrapFactory-DeMjp3cs.js";
14
- import { ZodType, z } from "zod";
1
+ import "./index-DMedRrli.js";
2
+ import { a as defineCodemationApp, i as FriendlyCodemationExecutionConfig, n as DefinePluginOptions, o as definePlugin, r as FriendlyCodemationDatabaseConfig, s as workflow, t as DefineCodemationAppOptions } from "./CodemationAuthoring.types-CT6Kp1vK.js";
3
+ import { S as CodemationWorkflowDiscovery, _ as CodemationEngineExecutionLimitsConfig, a as AppPluginLoadSummary, b as CodemationSchedulerConfig, c as CodemationPluginContext, d as CodemationAppSchedulerConfig, f as CodemationAppSchedulerKind, g as CodemationDatabaseKind, h as CodemationDatabaseConfig, l as CodemationPluginPackageMetadata, m as CodemationConfig, n as CodemationRegistrationContextBase, o as CodemationPlugin, p as CodemationApplicationRuntimeConfig, r as AppConfig, s as CodemationPluginConfig, t as CodemationAppContext, u as CodemationAppDefinition, v as CodemationEventBusConfig, w as CodemationClassToken, x as CodemationSchedulerKind, y as CodemationEventBusKind } from "./CodemationAppContext-DZt_ZwXH.js";
4
+ import { a as CodemationAuthConfig, c as CodemationAuthOidcProviderConfig, i as CodemationLogRule, n as CodemationLogConfig, o as CodemationAuthKind, r as CodemationLogLevelName, s as CodemationAuthOAuthProviderConfig, t as CodemationWhitelabelConfig } from "./CodemationWhitelabelConfig-D5rYcLlj.js";
5
+ import { a as CodemationFrontendAuthSnapshot, i as CodemationFrontendAuthProviderSnapshot, n as InternalAuthBootstrap, r as FrontendAppConfig, t as PublicFrontendBootstrap } from "./PublicFrontendBootstrap-ci0Vwxrb.js";
6
+ import { i as CodemationFrontendAuthSnapshotJsonCodec, n as InternalAuthBootstrapJsonCodec, r as FrontendAppConfigJsonCodec, t as PublicFrontendBootstrapJsonCodec } from "./PublicFrontendBootstrapJsonCodec-Ja0GQgpp.js";
7
+ import "./CodemationConfigNormalizer-C2CJnmKY.js";
8
+ import { t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-kijLkRtF.js";
9
+ import "./CredentialServices-CGS_E7O-.js";
10
+ import { _ as Command, c as WorkerRuntime, d as AppContainerLifecycle, f as AppContainerFactory, g as CommandBus, h as Query, l as FrontendRuntime, m as QueryBus, n as CodemationBootstrapRequest, r as ApplicationTokens, t as CodemationPluginListMerger, u as DatabaseMigrations } from "./CodemationPluginListMerger-Z-qsxAS9.js";
11
+ import { r as PrismaDatabaseClient, t as AppConfigFactory } from "./AppConfigFactory-DeULdLzi.js";
12
+ import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-DdIyEFHH.js";
13
+ import { c as CodemationServerGateway, l as ApiPaths } from "./server-Bd7_dgBB.js";
14
+ import { i as CodemationFrontendAuthSnapshotFactory, n as InternalAuthBootstrapFactory, r as FrontendAppConfigFactory, t as PublicFrontendBootstrapFactory } from "./PublicFrontendBootstrapFactory-CYBuZerA.js";
15
15
 
16
16
  //#region src/application/contracts/userDirectoryContracts.types.d.ts
17
17
  type UserAccountStatus = "invited" | "active" | "inactive";
@@ -38,195 +38,6 @@ declare class UpsertLocalBootstrapUserCommand extends Command<UpsertLocalBootstr
38
38
  constructor(email: string, password: string);
39
39
  }
40
40
  //#endregion
41
- //#region ../core-nodes/src/nodes/aggregate.d.ts
42
- declare class Aggregate<TIn = unknown, TOut = unknown> implements RunnableNodeConfig<TIn, TOut> {
43
- readonly name: string;
44
- readonly aggregate: (items: Items<TIn>, ctx: NodeExecutionContext<Aggregate<TIn, TOut>>) => TOut | Promise<TOut>;
45
- readonly id?: string | undefined;
46
- readonly kind: "node";
47
- readonly type: TypeToken<unknown>;
48
- readonly execution: {
49
- readonly hint: "local";
50
- };
51
- readonly icon: "lucide:layers";
52
- constructor(name: string, aggregate: (items: Items<TIn>, ctx: NodeExecutionContext<Aggregate<TIn, TOut>>) => TOut | Promise<TOut>, id?: string | undefined);
53
- }
54
- //#endregion
55
- //#region ../core-nodes/src/nodes/filter.d.ts
56
- declare class Filter<TIn = unknown> implements RunnableNodeConfig<TIn, TIn> {
57
- readonly name: string;
58
- readonly predicate: (item: Item<TIn>, index: number, items: Items<TIn>, ctx: NodeExecutionContext<Filter<TIn>>) => boolean;
59
- readonly id?: string | undefined;
60
- readonly kind: "node";
61
- readonly type: TypeToken<unknown>;
62
- readonly execution: {
63
- readonly hint: "local";
64
- };
65
- readonly icon: "lucide:filter";
66
- constructor(name: string, predicate: (item: Item<TIn>, index: number, items: Items<TIn>, ctx: NodeExecutionContext<Filter<TIn>>) => boolean, id?: string | undefined);
67
- }
68
- //#endregion
69
- //#region ../core-nodes/src/nodes/split.d.ts
70
- declare class Split<TIn = unknown, TElem = unknown> implements RunnableNodeConfig<TIn, TElem> {
71
- readonly name: string;
72
- readonly getElements: (item: Item<TIn>, ctx: NodeExecutionContext<Split<TIn, TElem>>) => readonly TElem[];
73
- readonly id?: string | undefined;
74
- readonly kind: "node";
75
- readonly type: TypeToken<unknown>;
76
- readonly execution: {
77
- readonly hint: "local";
78
- };
79
- /**
80
- * When splitting yields zero items for a batch, downstream single-input nodes still run once with an empty batch.
81
- * Mirrors {@link MapData}'s empty-output behavior.
82
- */
83
- readonly continueWhenEmptyOutput: true;
84
- readonly icon: "lucide:ungroup";
85
- constructor(name: string, getElements: (item: Item<TIn>, ctx: NodeExecutionContext<Split<TIn, TElem>>) => readonly TElem[], id?: string | undefined);
86
- }
87
- //#endregion
88
- //#region ../core-nodes/src/nodes/merge.d.ts
89
- type MergeMode = "passThrough" | "append" | "mergeByPosition";
90
- //#endregion
91
- //#region ../core-nodes/src/workflowAuthoring/WorkflowAuthoringOptions.types.d.ts
92
- type WorkflowAgentPrompt<TCurrentJson> = string | ((item: TCurrentJson) => string);
93
- interface WorkflowAgentOptions<TCurrentJson, TOutputSchema extends z.ZodTypeAny | undefined = undefined> {
94
- readonly prompt: WorkflowAgentPrompt<TCurrentJson>;
95
- readonly model: string | ChatModelConfig;
96
- readonly tools?: ReadonlyArray<ToolConfig>;
97
- readonly outputSchema?: TOutputSchema;
98
- readonly retryPolicy?: RunnableNodeConfig["retryPolicy"];
99
- readonly guardrails?: AgentGuardrailConfig;
100
- readonly id?: string;
101
- }
102
- //#endregion
103
- //#region ../core-nodes/src/workflowAuthoring/WorkflowBranchBuilder.types.d.ts
104
- declare class WorkflowBranchBuilder<TCurrentJson> {
105
- private readonly steps;
106
- constructor(steps?: ReadonlyArray<AnyRunnableNodeConfig>);
107
- then<TOutputJson, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson>>(config: TConfig): WorkflowBranchBuilder<RunnableNodeOutputJson<TConfig>>;
108
- map<TNextJson>(mapper: (item: TCurrentJson) => TNextJson): WorkflowBranchBuilder<TNextJson>;
109
- map<TNextJson>(name: string, mapper: (item: TCurrentJson) => TNextJson, id?: string): WorkflowBranchBuilder<TNextJson>;
110
- wait(duration: number | string): WorkflowBranchBuilder<TCurrentJson>;
111
- wait(name: string, duration: number | string, id?: string): WorkflowBranchBuilder<TCurrentJson>;
112
- split<TElem>(getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[]): WorkflowBranchBuilder<TElem>;
113
- split<TElem>(name: string, getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[], id?: string): WorkflowBranchBuilder<TElem>;
114
- filter(predicate: (item: Item<TCurrentJson>, index: number, items: Items<TCurrentJson>, ctx: NodeExecutionContext<Filter<TCurrentJson>>) => boolean): WorkflowBranchBuilder<TCurrentJson>;
115
- filter(name: string, predicate: (item: Item<TCurrentJson>, index: number, items: Items<TCurrentJson>, ctx: NodeExecutionContext<Filter<TCurrentJson>>) => boolean, id?: string): WorkflowBranchBuilder<TCurrentJson>;
116
- aggregate<TOut>(aggregateFn: (items: Items<TCurrentJson>, ctx: NodeExecutionContext<Aggregate<TCurrentJson, TOut>>) => TOut | Promise<TOut>): WorkflowBranchBuilder<TOut>;
117
- aggregate<TOut>(name: string, aggregateFn: (items: Items<TCurrentJson>, ctx: NodeExecutionContext<Aggregate<TCurrentJson, TOut>>) => TOut | Promise<TOut>, id?: string): WorkflowBranchBuilder<TOut>;
118
- agent<TOutputSchema extends z.ZodTypeAny>(options: WorkflowAgentOptions<TCurrentJson, TOutputSchema>): WorkflowBranchBuilder<z.output<TOutputSchema>>;
119
- agent(options: WorkflowAgentOptions<TCurrentJson, undefined>): WorkflowBranchBuilder<Record<string, unknown>>;
120
- agent<TOutputSchema extends z.ZodTypeAny>(name: string, options: WorkflowAgentOptions<TCurrentJson, TOutputSchema | undefined>): WorkflowBranchBuilder<TOutputSchema extends z.ZodTypeAny ? z.output<TOutputSchema> : Record<string, unknown>>;
121
- node<TConfig extends Record<string, unknown>, TOutputJson>(definitionOrKey: DefinedNode<string, TConfig, TCurrentJson, TOutputJson> | string, config: TConfig, name?: string, id?: string): WorkflowBranchBuilder<TOutputJson>;
122
- getSteps(): ReadonlyArray<AnyRunnableNodeConfig>;
123
- }
124
- //#endregion
125
- //#region ../core-nodes/src/workflowAuthoring/WorkflowChain.types.d.ts
126
- type BranchCallback<TCurrentJson, TNextJson> = (branch: WorkflowBranchBuilder<TCurrentJson>) => WorkflowBranchBuilder<TNextJson>;
127
- type RouteBranchCallback<TCurrentJson, TNextJson> = (branch: WorkflowChain<TCurrentJson>) => WorkflowChain<TNextJson>;
128
- declare class WorkflowChain<TCurrentJson> {
129
- private readonly chain;
130
- constructor(chain: ChainCursor<TCurrentJson>);
131
- then<TOutputJson, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson>>(config: TConfig): WorkflowChain<RunnableNodeOutputJson<TConfig>>;
132
- map<TNextJson>(mapper: (item: TCurrentJson) => TNextJson): WorkflowChain<TNextJson>;
133
- map<TNextJson>(name: string, mapper: (item: TCurrentJson) => TNextJson, id?: string): WorkflowChain<TNextJson>;
134
- wait(duration: number | string): WorkflowChain<TCurrentJson>;
135
- wait(name: string, duration: number | string, id?: string): WorkflowChain<TCurrentJson>;
136
- split<TElem>(getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[]): WorkflowChain<TElem>;
137
- split<TElem>(name: string, getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[], id?: string): WorkflowChain<TElem>;
138
- filter(predicate: (item: Item<TCurrentJson>, index: number, items: Items<TCurrentJson>, ctx: NodeExecutionContext<Filter<TCurrentJson>>) => boolean): WorkflowChain<TCurrentJson>;
139
- filter(name: string, predicate: (item: Item<TCurrentJson>, index: number, items: Items<TCurrentJson>, ctx: NodeExecutionContext<Filter<TCurrentJson>>) => boolean, id?: string): WorkflowChain<TCurrentJson>;
140
- aggregate<TOut>(aggregateFn: (items: Items<TCurrentJson>, ctx: NodeExecutionContext<Aggregate<TCurrentJson, TOut>>) => TOut | Promise<TOut>): WorkflowChain<TOut>;
141
- aggregate<TOut>(name: string, aggregateFn: (items: Items<TCurrentJson>, ctx: NodeExecutionContext<Aggregate<TCurrentJson, TOut>>) => TOut | Promise<TOut>, id?: string): WorkflowChain<TOut>;
142
- merge(): WorkflowChain<TCurrentJson>;
143
- merge(cfg: Readonly<{
144
- mode: MergeMode;
145
- prefer?: ReadonlyArray<string>;
146
- }>, id?: string): WorkflowChain<TCurrentJson>;
147
- merge(name: string, cfg?: Readonly<{
148
- mode: MergeMode;
149
- prefer?: ReadonlyArray<string>;
150
- }>, id?: string): WorkflowChain<TCurrentJson>;
151
- if<TBranchJson>(predicate: (item: TCurrentJson) => boolean, branches: Readonly<{
152
- true?: BranchCallback<TCurrentJson, TBranchJson>;
153
- false?: BranchCallback<TCurrentJson, TBranchJson>;
154
- }>): WorkflowChain<TBranchJson>;
155
- if<TBranchJson>(name: string, predicate: (item: TCurrentJson) => boolean, branches: Readonly<{
156
- true?: BranchCallback<TCurrentJson, TBranchJson>;
157
- false?: BranchCallback<TCurrentJson, TBranchJson>;
158
- }>): WorkflowChain<TBranchJson>;
159
- route<TBranchJson>(branches: Readonly<Record<string, RouteBranchCallback<TCurrentJson, TBranchJson> | undefined>>): WorkflowChain<TBranchJson>;
160
- switch<TBranchJson>(cfg: Readonly<{
161
- cases: readonly string[];
162
- defaultCase: string;
163
- resolveCaseKey: (item: TCurrentJson) => string | Promise<string>;
164
- branches: Readonly<Record<string, RouteBranchCallback<TCurrentJson, TBranchJson> | undefined>>;
165
- }>): WorkflowChain<TBranchJson>;
166
- switch<TBranchJson>(name: string, cfg: Readonly<{
167
- cases: readonly string[];
168
- defaultCase: string;
169
- resolveCaseKey: (item: TCurrentJson) => string | Promise<string>;
170
- branches: Readonly<Record<string, RouteBranchCallback<TCurrentJson, TBranchJson> | undefined>>;
171
- }>, id?: string): WorkflowChain<TBranchJson>;
172
- agent<TOutputSchema extends z.ZodTypeAny>(options: WorkflowAgentOptions<TCurrentJson, TOutputSchema>): WorkflowChain<z.output<TOutputSchema>>;
173
- agent(options: WorkflowAgentOptions<TCurrentJson, undefined>): WorkflowChain<Record<string, unknown>>;
174
- agent<TOutputSchema extends z.ZodTypeAny>(name: string, options: WorkflowAgentOptions<TCurrentJson, TOutputSchema | undefined>): WorkflowChain<TOutputSchema extends z.ZodTypeAny ? z.output<TOutputSchema> : Record<string, unknown>>;
175
- node<TConfig extends Record<string, unknown>, TOutputJson>(definitionOrKey: DefinedNode<string, TConfig, TCurrentJson, TOutputJson> | string, config: TConfig, name?: string, id?: string): WorkflowChain<TOutputJson>;
176
- build(): WorkflowDefinition;
177
- }
178
- //#endregion
179
- //#region ../core-nodes/src/workflowAuthoring/WorkflowAuthoringBuilder.types.d.ts
180
- declare class WorkflowAuthoringBuilder {
181
- private readonly id;
182
- private readonly workflowName;
183
- constructor(id: string, workflowName?: string);
184
- name(name: string): WorkflowAuthoringBuilder;
185
- manualTrigger<TOutputJson>(defaultItems: TOutputJson | ReadonlyArray<TOutputJson>): WorkflowChain<TOutputJson>;
186
- manualTrigger<TOutputJson>(name: string, defaultItems?: TOutputJson | ReadonlyArray<TOutputJson>, id?: string): WorkflowChain<TOutputJson>;
187
- }
188
- //#endregion
189
- //#region ../core-nodes/src/workflowAuthoring.types.d.ts
190
- declare function workflow(id: string): WorkflowAuthoringBuilder;
191
- //#endregion
192
- //#region src/presentation/config/CodemationAuthoring.types.d.ts
193
- interface FriendlyCodemationDatabaseConfig {
194
- readonly kind: "postgresql" | "sqlite";
195
- readonly url?: string;
196
- readonly filePath?: string;
197
- }
198
- interface FriendlyCodemationExecutionConfig {
199
- readonly mode?: "inline" | "queue";
200
- readonly queuePrefix?: string;
201
- readonly workerQueues?: ReadonlyArray<string>;
202
- readonly redisUrl?: string;
203
- }
204
- interface DefineCodemationAppOptions extends Omit<CodemationConfig, "app" | "credentialTypes" | "register" | "whitelabel" | "auth"> {
205
- readonly name?: string;
206
- readonly auth?: CodemationConfig["auth"];
207
- readonly database?: FriendlyCodemationDatabaseConfig;
208
- readonly execution?: FriendlyCodemationExecutionConfig;
209
- readonly nodes?: ReadonlyArray<DefinedNode<string, Record<string, unknown>, unknown, unknown>>;
210
- readonly credentialTypes?: ReadonlyArray<AnyCredentialType>;
211
- readonly credentials?: ReadonlyArray<AnyCredentialType>;
212
- readonly register?: (context: CodemationAppContext) => void;
213
- readonly whitelabel?: CodemationWhitelabelConfig;
214
- }
215
- interface DefinePluginOptions {
216
- readonly name?: string;
217
- readonly pluginPackageId?: string;
218
- readonly nodes?: ReadonlyArray<DefinedNode<string, Record<string, unknown>, unknown, unknown>>;
219
- readonly credentials?: ReadonlyArray<AnyCredentialType>;
220
- readonly register?: (context: CodemationPluginContext) => void | Promise<void>;
221
- readonly sandbox?: DefineCodemationAppOptions & Readonly<{
222
- workflows?: ReadonlyArray<WorkflowDefinition>;
223
- }>;
224
- }
225
- declare function defineCodemationApp(options: DefineCodemationAppOptions): CodemationConfig;
226
- declare function definePlugin(options: DefinePluginOptions): CodemationPlugin & Readonly<{
227
- sandbox?: DefinePluginOptions["sandbox"];
228
- }>;
229
- //#endregion
230
41
  //#region src/presentation/config/CodemationPackageManifest.d.ts
231
42
  interface CodemationPackageManifest {
232
43
  readonly plugin?: string;