@codemation/core-nodes 0.0.15 → 0.0.18

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/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ReadableStream } from "node:stream/web";
2
2
  import { DependencyContainer as Container, InjectionToken as TypeToken } from "tsyringe";
3
- import { ZodType, input, output } from "zod";
3
+ import { ZodType, input, output, z } from "zod";
4
4
  import { AIMessage, BaseMessage, HumanMessage, SystemMessage, ToolMessage } from "@langchain/core/messages";
5
5
  import { DynamicStructuredTool } from "@langchain/core/tools";
6
6
 
@@ -114,6 +114,68 @@ interface TriggerInstanceId {
114
114
  nodeId: NodeId;
115
115
  }
116
116
  //#endregion
117
+ //#region ../core/src/workflow/dsl/workflowBuilderTypes.d.ts
118
+ type AnyRunnableNodeConfig = RunnableNodeConfig<any, any>;
119
+ type AnyTriggerNodeConfig = TriggerNodeConfig<any>;
120
+ type ValidStepSequence<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps extends readonly [] ? readonly [] : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<TCurrentJson, infer TNextJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? readonly [TFirst, ...ValidStepSequence<TNextJson, TRest>] : never : never : TSteps;
121
+ type StepSequenceOutput<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? TSteps extends readonly [] ? TCurrentJson : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<TCurrentJson, infer TNextJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? StepSequenceOutput<TNextJson, TRest> : never : never : TCurrentJson : TCurrentJson;
122
+ type TypesMatch<TLeft, TRight> = [TLeft] extends [TRight] ? ([TRight] extends [TLeft] ? true : false) : false;
123
+ type BranchOutputGuard<TCurrentJson, TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TypesMatch<StepSequenceOutput<TCurrentJson, TTrueSteps>, StepSequenceOutput<TCurrentJson, TFalseSteps>> extends true ? unknown : never;
124
+ type BranchStepsArg<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps & ValidStepSequence<TCurrentJson, TSteps>;
125
+ type BranchMoreArgs<TCurrentJson, TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TRestSteps & ValidStepSequence<RunnableNodeOutputJson<TFirstStep>, TRestSteps>;
126
+ type BooleanWhenOverloads<TCurrentJson, TReturn> = {
127
+ <TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, steps: BranchStepsArg<TCurrentJson, TSteps>): TReturn;
128
+ <TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, step: TFirstStep, ...more: BranchMoreArgs<TCurrentJson, TFirstStep, TRestSteps>): TReturn;
129
+ };
130
+ //#endregion
131
+ //#region ../core/src/workflow/dsl/WhenBuilder.d.ts
132
+ declare class WhenBuilder<TCurrentJson> {
133
+ private readonly wf;
134
+ private readonly from;
135
+ private readonly branchPort;
136
+ constructor(wf: WorkflowBuilder, from: NodeRef, branchPort: OutputPortKey);
137
+ addBranch<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(steps: TSteps & ValidStepSequence<TCurrentJson, TSteps>): this;
138
+ readonly when: BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>>;
139
+ build(): WorkflowDefinition;
140
+ }
141
+ //#endregion
142
+ //#region ../core/src/workflow/dsl/ChainCursorResolver.d.ts
143
+ type ChainCursorWhenOverloads<TCurrentJson> = BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>> & {
144
+ <TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined>(branches: Readonly<{
145
+ true?: TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TTrueSteps> : never;
146
+ false?: TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TFalseSteps> : never;
147
+ }> & BranchOutputGuard<TCurrentJson, TTrueSteps, TFalseSteps>): ChainCursor<StepSequenceOutput<TCurrentJson, TTrueSteps>>;
148
+ };
149
+ declare class ChainCursor<TCurrentJson> {
150
+ private readonly wf;
151
+ private readonly cursor;
152
+ private readonly cursorOutput;
153
+ constructor(wf: WorkflowBuilder, cursor: NodeRef, cursorOutput: OutputPortKey);
154
+ then<TConfig extends RunnableNodeConfig<TCurrentJson, any>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
155
+ readonly when: ChainCursorWhenOverloads<TCurrentJson>;
156
+ build(): WorkflowDefinition;
157
+ }
158
+ //#endregion
159
+ //#region ../core/src/workflow/dsl/WorkflowBuilder.d.ts
160
+ declare class WorkflowBuilder {
161
+ private readonly meta;
162
+ private readonly options?;
163
+ private readonly nodes;
164
+ private readonly edges;
165
+ private seq;
166
+ constructor(meta: {
167
+ id: WorkflowId;
168
+ name: string;
169
+ }, options?: Readonly<{
170
+ makeMergeNode?: (name: string) => AnyRunnableNodeConfig;
171
+ }> | undefined);
172
+ private add;
173
+ private connect;
174
+ trigger<TConfig extends AnyTriggerNodeConfig>(config: TConfig): ChainCursor<TriggerNodeOutputJson<TConfig>>;
175
+ start<TConfig extends AnyRunnableNodeConfig>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
176
+ build(): WorkflowDefinition;
177
+ }
178
+ //#endregion
117
179
  //#region ../core/src/contracts/runtimeTypes.d.ts
118
180
  interface WorkflowRunnerService {
119
181
  runById(args: {
@@ -431,6 +493,28 @@ type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
431
493
  //#endregion
432
494
  //#region ../core/src/contracts/credentialTypes.d.ts
433
495
  type CredentialTypeId = string;
496
+ type CredentialInstanceId = string;
497
+ type CredentialMaterialSourceKind = "db" | "env" | "code";
498
+ type CredentialSetupStatus = "draft" | "ready";
499
+ type CredentialHealthStatus = "unknown" | "healthy" | "failing";
500
+ type CredentialFieldSchema = Readonly<{
501
+ key: string;
502
+ label: string;
503
+ type: "string" | "password" | "textarea" | "json" | "boolean";
504
+ required?: true;
505
+ order?: number;
506
+ placeholder?: string;
507
+ helpText?: string;
508
+ /** When set, host resolves this field from process.env at runtime; env wins over stored values. */
509
+ envVarName?: string;
510
+ /**
511
+ * When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
512
+ * pattern or documentation URL). Do not use for secret values.
513
+ */
514
+ copyValue?: string;
515
+ /** Accessible label for the copy control (default: Copy). */
516
+ copyButtonLabel?: string;
517
+ }>;
434
518
  type CredentialRequirement = Readonly<{
435
519
  slotKey: string;
436
520
  label: string;
@@ -439,6 +523,89 @@ type CredentialRequirement = Readonly<{
439
523
  helpText?: string;
440
524
  helpUrl?: string;
441
525
  }>;
526
+ type CredentialHealth = Readonly<{
527
+ status: CredentialHealthStatus;
528
+ message?: string;
529
+ testedAt?: string;
530
+ expiresAt?: string;
531
+ details?: Readonly<Record<string, unknown>>;
532
+ }>;
533
+ type OAuth2ProviderFromPublicConfig = Readonly<{
534
+ authorizeUrlFieldKey: string;
535
+ tokenUrlFieldKey: string;
536
+ userInfoUrlFieldKey?: string;
537
+ }>;
538
+ type CredentialOAuth2AuthDefinition = Readonly<{
539
+ kind: "oauth2";
540
+ providerId: string;
541
+ scopes: ReadonlyArray<string>;
542
+ clientIdFieldKey?: string;
543
+ clientSecretFieldKey?: string;
544
+ } | {
545
+ kind: "oauth2";
546
+ providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
547
+ scopes: ReadonlyArray<string>;
548
+ clientIdFieldKey?: string;
549
+ clientSecretFieldKey?: string;
550
+ }>;
551
+ type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
552
+ type CredentialTypeDefinition = Readonly<{
553
+ typeId: CredentialTypeId;
554
+ displayName: string;
555
+ description?: string;
556
+ publicFields?: ReadonlyArray<CredentialFieldSchema>;
557
+ secretFields?: ReadonlyArray<CredentialFieldSchema>;
558
+ supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
559
+ auth?: CredentialAuthDefinition;
560
+ }>;
561
+ /**
562
+ * JSON-shaped credential field bag (public config, resolved secret material, etc.).
563
+ */
564
+ type CredentialJsonRecord = Readonly<Record<string, unknown>>;
565
+ /**
566
+ * Persisted credential instance with typed `publicConfig`.
567
+ * Hosts may specialize `secretRef` with a stricter union while remaining
568
+ * assignable here for session/test callbacks.
569
+ */
570
+ type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
571
+ instanceId: CredentialInstanceId;
572
+ typeId: CredentialTypeId;
573
+ displayName: string;
574
+ sourceKind: CredentialMaterialSourceKind;
575
+ publicConfig: TPublicConfig;
576
+ secretRef: CredentialJsonRecord;
577
+ tags: ReadonlyArray<string>;
578
+ setupStatus: CredentialSetupStatus;
579
+ createdAt: string;
580
+ updatedAt: string;
581
+ }>;
582
+ /**
583
+ * Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
584
+ * Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
585
+ * against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
586
+ */
587
+ type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
588
+ instance: CredentialInstanceRecord<TPublicConfig>;
589
+ material: TMaterial;
590
+ publicConfig: TPublicConfig;
591
+ }>;
592
+ type CredentialSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;
593
+ type CredentialHealthTester<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;
594
+ /**
595
+ * Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.
596
+ * Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
597
+ */
598
+ type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
599
+ definition: CredentialTypeDefinition;
600
+ createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
601
+ test: CredentialHealthTester<TPublicConfig, TMaterial>;
602
+ }>;
603
+ /**
604
+ * Credential type with unspecified generics — used for `CodemationConfig.credentialTypes`, the host registry,
605
+ * and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
606
+ * Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
607
+ */
608
+ type AnyCredentialType = CredentialType<any, any, unknown>;
442
609
  interface CredentialSessionService {
443
610
  getSession<TSession = unknown>(args: Readonly<{
444
611
  workflowId: WorkflowId;
@@ -447,66 +614,25 @@ interface CredentialSessionService {
447
614
  }>): Promise<TSession>;
448
615
  }
449
616
  //#endregion
450
- //#region ../core/src/workflow/dsl/workflowBuilderTypes.d.ts
451
- type AnyRunnableNodeConfig = RunnableNodeConfig<any, any>;
452
- type AnyTriggerNodeConfig = TriggerNodeConfig<any>;
453
- type ValidStepSequence<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps extends readonly [] ? readonly [] : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<TCurrentJson, infer TNextJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? readonly [TFirst, ...ValidStepSequence<TNextJson, TRest>] : never : never : TSteps;
454
- type StepSequenceOutput<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? TSteps extends readonly [] ? TCurrentJson : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<TCurrentJson, infer TNextJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? StepSequenceOutput<TNextJson, TRest> : never : never : TCurrentJson : TCurrentJson;
455
- type TypesMatch<TLeft, TRight> = [TLeft] extends [TRight] ? ([TRight] extends [TLeft] ? true : false) : false;
456
- type BranchOutputGuard<TCurrentJson, TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TypesMatch<StepSequenceOutput<TCurrentJson, TTrueSteps>, StepSequenceOutput<TCurrentJson, TFalseSteps>> extends true ? unknown : never;
457
- type BranchStepsArg<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps & ValidStepSequence<TCurrentJson, TSteps>;
458
- type BranchMoreArgs<TCurrentJson, TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TRestSteps & ValidStepSequence<RunnableNodeOutputJson<TFirstStep>, TRestSteps>;
459
- type BooleanWhenOverloads<TCurrentJson, TReturn> = {
460
- <TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, steps: BranchStepsArg<TCurrentJson, TSteps>): TReturn;
461
- <TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, step: TFirstStep, ...more: BranchMoreArgs<TCurrentJson, TFirstStep, TRestSteps>): TReturn;
462
- };
463
- //#endregion
464
- //#region ../core/src/workflow/dsl/WhenBuilder.d.ts
465
- declare class WhenBuilder<TCurrentJson> {
466
- private readonly wf;
467
- private readonly from;
468
- private readonly branchPort;
469
- constructor(wf: WorkflowBuilder, from: NodeRef, branchPort: OutputPortKey);
470
- addBranch<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(steps: TSteps & ValidStepSequence<TCurrentJson, TSteps>): this;
471
- readonly when: BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>>;
472
- build(): WorkflowDefinition;
473
- }
474
- //#endregion
475
- //#region ../core/src/workflow/dsl/ChainCursorResolver.d.ts
476
- type ChainCursorWhenOverloads<TCurrentJson> = BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>> & {
477
- <TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined>(branches: Readonly<{
478
- true?: TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TTrueSteps> : never;
479
- false?: TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TFalseSteps> : never;
480
- }> & BranchOutputGuard<TCurrentJson, TTrueSteps, TFalseSteps>): ChainCursor<StepSequenceOutput<TCurrentJson, TTrueSteps>>;
481
- };
482
- declare class ChainCursor<TCurrentJson> {
483
- private readonly wf;
484
- private readonly cursor;
485
- private readonly cursorOutput;
486
- constructor(wf: WorkflowBuilder, cursor: NodeRef, cursorOutput: OutputPortKey);
487
- then<TConfig extends RunnableNodeConfig<TCurrentJson, any>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
488
- readonly when: ChainCursorWhenOverloads<TCurrentJson>;
489
- build(): WorkflowDefinition;
490
- }
491
- //#endregion
492
- //#region ../core/src/workflow/dsl/WorkflowBuilder.d.ts
493
- declare class WorkflowBuilder {
494
- private readonly meta;
495
- private readonly options?;
496
- private readonly nodes;
497
- private readonly edges;
498
- private seq;
499
- constructor(meta: {
500
- id: WorkflowId;
501
- name: string;
502
- }, options?: Readonly<{
503
- makeMergeNode?: (name: string) => AnyRunnableNodeConfig;
504
- }> | undefined);
505
- private add;
506
- private connect;
507
- trigger<TConfig extends AnyTriggerNodeConfig>(config: TConfig): ChainCursor<TriggerNodeOutputJson<TConfig>>;
508
- start<TConfig extends AnyRunnableNodeConfig>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
509
- build(): WorkflowDefinition;
617
+ //#region ../core/src/authoring/defineNode.types.d.ts
618
+ type ResolvableCredentialType = AnyCredentialType | CredentialTypeId;
619
+ type DefinedNodeCredentialBinding = ResolvableCredentialType | Readonly<{
620
+ readonly type: ResolvableCredentialType | ReadonlyArray<ResolvableCredentialType>;
621
+ readonly label?: string;
622
+ readonly optional?: true;
623
+ readonly helpText?: string;
624
+ readonly helpUrl?: string;
625
+ }>;
626
+ type DefinedNodeCredentialBindings = Readonly<Record<string, DefinedNodeCredentialBinding>>;
627
+ interface DefinedNode<TKey$1 extends string, TConfig extends CredentialJsonRecord, TInputJson$1, TOutputJson$1, _TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
628
+ readonly kind: "defined-node";
629
+ readonly key: TKey$1;
630
+ readonly title: string;
631
+ readonly description?: string;
632
+ create(config: TConfig, name?: string, id?: string): RunnableNodeConfig<TInputJson$1, TOutputJson$1>;
633
+ register(context: {
634
+ registerNode<TValue>(token: TypeToken<TValue>, implementation?: TypeToken<TValue>): void;
635
+ }): void;
510
636
  }
511
637
  //#endregion
512
638
  //#region ../core/src/ai/NodeBackedToolConfig.d.ts
@@ -1184,6 +1310,72 @@ declare function createWorkflowBuilder(meta: Readonly<{
1184
1310
  name: string;
1185
1311
  }>): WorkflowBuilder;
1186
1312
  //#endregion
1313
+ //#region src/workflowAuthoring/WorkflowAuthoringOptions.types.d.ts
1314
+ type WorkflowAgentPrompt<TCurrentJson> = string | ((item: TCurrentJson) => string);
1315
+ interface WorkflowAgentOptions<TCurrentJson, TOutputSchema extends z.ZodTypeAny | undefined = undefined> {
1316
+ readonly prompt: WorkflowAgentPrompt<TCurrentJson>;
1317
+ readonly model: string | ChatModelConfig;
1318
+ readonly tools?: ReadonlyArray<ToolConfig>;
1319
+ readonly outputSchema?: TOutputSchema;
1320
+ readonly retryPolicy?: RunnableNodeConfig["retryPolicy"];
1321
+ readonly guardrails?: AgentGuardrailConfig;
1322
+ readonly id?: string;
1323
+ }
1324
+ //#endregion
1325
+ //#region src/workflowAuthoring/WorkflowBranchBuilder.types.d.ts
1326
+ declare class WorkflowBranchBuilder<TCurrentJson> {
1327
+ private readonly steps;
1328
+ constructor(steps?: ReadonlyArray<AnyRunnableNodeConfig>);
1329
+ then<TConfig extends RunnableNodeConfig<TCurrentJson, any>>(config: TConfig): WorkflowBranchBuilder<RunnableNodeOutputJson<TConfig>>;
1330
+ map<TNextJson$1>(mapper: (item: TCurrentJson) => TNextJson$1): WorkflowBranchBuilder<TNextJson$1>;
1331
+ map<TNextJson$1>(name: string, mapper: (item: TCurrentJson) => TNextJson$1, id?: string): WorkflowBranchBuilder<TNextJson$1>;
1332
+ wait(duration: number | string): WorkflowBranchBuilder<TCurrentJson>;
1333
+ wait(name: string, duration: number | string, id?: string): WorkflowBranchBuilder<TCurrentJson>;
1334
+ agent<TOutputSchema extends z.ZodTypeAny>(options: WorkflowAgentOptions<TCurrentJson, TOutputSchema>): WorkflowBranchBuilder<z.output<TOutputSchema>>;
1335
+ agent(options: WorkflowAgentOptions<TCurrentJson, undefined>): WorkflowBranchBuilder<Record<string, unknown>>;
1336
+ agent<TOutputSchema extends z.ZodTypeAny>(name: string, options: WorkflowAgentOptions<TCurrentJson, TOutputSchema | undefined>): WorkflowBranchBuilder<TOutputSchema extends z.ZodTypeAny ? z.output<TOutputSchema> : Record<string, unknown>>;
1337
+ node<TConfig extends Record<string, unknown>, TOutputJson$1>(definitionOrKey: DefinedNode<string, TConfig, TCurrentJson, TOutputJson$1> | string, config: TConfig, name?: string, id?: string): WorkflowBranchBuilder<TOutputJson$1>;
1338
+ getSteps(): ReadonlyArray<AnyRunnableNodeConfig>;
1339
+ }
1340
+ //#endregion
1341
+ //#region src/workflowAuthoring/WorkflowChain.types.d.ts
1342
+ type BranchCallback<TCurrentJson, TNextJson$1> = (branch: WorkflowBranchBuilder<TCurrentJson>) => WorkflowBranchBuilder<TNextJson$1>;
1343
+ declare class WorkflowChain<TCurrentJson> {
1344
+ private readonly chain;
1345
+ constructor(chain: ChainCursor<TCurrentJson>);
1346
+ then<TConfig extends RunnableNodeConfig<TCurrentJson, any>>(config: TConfig): WorkflowChain<RunnableNodeOutputJson<TConfig>>;
1347
+ map<TNextJson$1>(mapper: (item: TCurrentJson) => TNextJson$1): WorkflowChain<TNextJson$1>;
1348
+ map<TNextJson$1>(name: string, mapper: (item: TCurrentJson) => TNextJson$1, id?: string): WorkflowChain<TNextJson$1>;
1349
+ wait(duration: number | string): WorkflowChain<TCurrentJson>;
1350
+ wait(name: string, duration: number | string, id?: string): WorkflowChain<TCurrentJson>;
1351
+ if<TBranchJson>(predicate: (item: TCurrentJson) => boolean, branches: Readonly<{
1352
+ true?: BranchCallback<TCurrentJson, TBranchJson>;
1353
+ false?: BranchCallback<TCurrentJson, TBranchJson>;
1354
+ }>): WorkflowChain<TBranchJson>;
1355
+ if<TBranchJson>(name: string, predicate: (item: TCurrentJson) => boolean, branches: Readonly<{
1356
+ true?: BranchCallback<TCurrentJson, TBranchJson>;
1357
+ false?: BranchCallback<TCurrentJson, TBranchJson>;
1358
+ }>): WorkflowChain<TBranchJson>;
1359
+ agent<TOutputSchema extends z.ZodTypeAny>(options: WorkflowAgentOptions<TCurrentJson, TOutputSchema>): WorkflowChain<z.output<TOutputSchema>>;
1360
+ agent(options: WorkflowAgentOptions<TCurrentJson, undefined>): WorkflowChain<Record<string, unknown>>;
1361
+ agent<TOutputSchema extends z.ZodTypeAny>(name: string, options: WorkflowAgentOptions<TCurrentJson, TOutputSchema | undefined>): WorkflowChain<TOutputSchema extends z.ZodTypeAny ? z.output<TOutputSchema> : Record<string, unknown>>;
1362
+ node<TConfig extends Record<string, unknown>, TOutputJson$1>(definitionOrKey: DefinedNode<string, TConfig, TCurrentJson, TOutputJson$1> | string, config: TConfig, name?: string, id?: string): WorkflowChain<TOutputJson$1>;
1363
+ build(): WorkflowDefinition;
1364
+ }
1365
+ //#endregion
1366
+ //#region src/workflowAuthoring/WorkflowAuthoringBuilder.types.d.ts
1367
+ declare class WorkflowAuthoringBuilder {
1368
+ private readonly id;
1369
+ private readonly workflowName;
1370
+ constructor(id: string, workflowName?: string);
1371
+ name(name: string): WorkflowAuthoringBuilder;
1372
+ manualTrigger<TOutputJson$1>(defaultItems: TOutputJson$1 | ReadonlyArray<TOutputJson$1>): WorkflowChain<TOutputJson$1>;
1373
+ manualTrigger<TOutputJson$1>(name: string, defaultItems?: TOutputJson$1 | ReadonlyArray<TOutputJson$1>, id?: string): WorkflowChain<TOutputJson$1>;
1374
+ }
1375
+ //#endregion
1376
+ //#region src/workflowAuthoring.types.d.ts
1377
+ declare function workflow(id: string): WorkflowAuthoringBuilder;
1378
+ //#endregion
1187
1379
  //#region src/nodes/ConnectionCredentialNode.d.ts
1188
1380
  /**
1189
1381
  * Placeholder runnable node for connection-owned workflow nodes (LLM/tool slots).
@@ -1225,5 +1417,5 @@ declare class AIAgentConnectionWorkflowExpander {
1225
1417
  private assertNoIdCollision;
1226
1418
  }
1227
1419
  //#endregion
1228
- export { AIAgent, AIAgentConnectionWorkflowExpander, AIAgentExecutionHelpersFactory, AIAgentNode, AgentItemPortMap, AgentMessageFactory, AgentOutputFactory, AgentToolCallPortMap, Callback, CallbackHandler, CallbackNode, CallbackResultNormalizer, CanvasIconName, ConnectionCredentialExecutionContextFactory, ConnectionCredentialNode, ConnectionCredentialNodeConfig, ConnectionCredentialNodeConfigFactory, ExecutedToolCall, HttpRequest, HttpRequestDownloadMode, HttpRequestNode, HttpRequestOutputJson, If, IfNode, ItemScopedToolBinding, ManualTrigger, ManualTriggerNode, MapData, MapDataNode, Merge, MergeMode, MergeNode, NoOp, NoOpNode, OpenAIChatModelConfig, OpenAIChatModelFactory, OpenAiChatModelPresets, OpenAiCredentialSession, PlannedToolCall, ResolvedTool, SubWorkflow, SubWorkflowNode, Wait, WaitDuration, WaitNode, WebhookRespondNowAndContinueError, WebhookRespondNowError, WebhookTrigger, WebhookTriggerNode, createWorkflowBuilder, openAiChatModelPresets, registerCoreNodes };
1420
+ export { AIAgent, AIAgentConnectionWorkflowExpander, AIAgentExecutionHelpersFactory, AIAgentNode, AgentItemPortMap, AgentMessageFactory, AgentOutputFactory, AgentToolCallPortMap, Callback, CallbackHandler, CallbackNode, CallbackResultNormalizer, CanvasIconName, ConnectionCredentialExecutionContextFactory, ConnectionCredentialNode, ConnectionCredentialNodeConfig, ConnectionCredentialNodeConfigFactory, ExecutedToolCall, HttpRequest, HttpRequestDownloadMode, HttpRequestNode, HttpRequestOutputJson, If, IfNode, ItemScopedToolBinding, ManualTrigger, ManualTriggerNode, MapData, MapDataNode, Merge, MergeMode, MergeNode, NoOp, NoOpNode, OpenAIChatModelConfig, OpenAIChatModelFactory, OpenAiChatModelPresets, OpenAiCredentialSession, PlannedToolCall, ResolvedTool, SubWorkflow, SubWorkflowNode, Wait, WaitDuration, WaitNode, WebhookRespondNowAndContinueError, WebhookRespondNowError, WebhookTrigger, WebhookTriggerNode, type WorkflowAgentOptions, WorkflowAuthoringBuilder, WorkflowBranchBuilder, WorkflowChain, createWorkflowBuilder, openAiChatModelPresets, registerCoreNodes, workflow };
1229
1421
  //# sourceMappingURL=index.d.cts.map