@lunnoa/client 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.d.cts CHANGED
@@ -107,7 +107,10 @@ declare class HttpClient {
107
107
 
108
108
  type ChatMode = 'builder' | 'preview';
109
109
  interface StreamMessageOptions {
110
- /** Agent chat mode; defaults to the server default (`builder`). */
110
+ /**
111
+ * Agent chat mode. Defaults to `preview` (10 model rounds, a normal agent run).
112
+ * `builder` is the agent-editor interview and stops after 4 rounds.
113
+ */
111
114
  chatMode?: ChatMode;
112
115
  /** Optional image attachment forwarded with this turn. */
113
116
  data?: {
@@ -822,6 +825,41 @@ interface components {
822
825
  /** @description Step description. */
823
826
  description?: string;
824
827
  };
828
+ UpsertWorkflowTriggerInputFieldDto: {
829
+ /** @description Field id. Callers pass this key to workflows.execute. */
830
+ id: string;
831
+ /** @description Label shown on the Manually Run form. */
832
+ label?: string;
833
+ description?: string;
834
+ /** @description text, number, date, or select. Defaults to text. */
835
+ inputType?: string;
836
+ /** @description true, or { missingMessage, missingStatus }. */
837
+ required?: boolean | {
838
+ [key: string]: unknown;
839
+ };
840
+ /** @description Used when the caller omits the field. */
841
+ defaultValue?: unknown;
842
+ selectOptions?: {
843
+ [key: string]: unknown;
844
+ }[];
845
+ };
846
+ UpsertWorkflowTriggerDto: {
847
+ /** @description Catalogue trigger id, for example flow-control_trigger_manual. */
848
+ triggerId: string;
849
+ /** @description Workflow app id. Inferred from triggerId when it contains _trigger_. */
850
+ appId?: string;
851
+ /** @description Connection instance UUID for this trigger. */
852
+ connectionId?: string;
853
+ /** @description Trigger config fields from the catalogue inputConfig. */
854
+ input?: {
855
+ [key: string]: unknown;
856
+ };
857
+ /** @description Manual-trigger fields. Stored on the trigger as customInputConfig. */
858
+ inputs?: components["schemas"]["UpsertWorkflowTriggerInputFieldDto"][];
859
+ /** @description Display name for the trigger node. */
860
+ name?: string;
861
+ description?: string;
862
+ };
825
863
  UpsertWorkflowBySlugDto: {
826
864
  /**
827
865
  * @description Stable workspace-scoped slug (lowercase, digits, hyphens). Used as the upsert key.
@@ -833,6 +871,8 @@ interface components {
833
871
  description?: string;
834
872
  /** @description Whether the workflow is active. */
835
873
  isActive?: boolean;
874
+ /** @description Catalogue trigger. Omit for a Manually Run trigger with no input fields. */
875
+ trigger?: components["schemas"]["UpsertWorkflowTriggerDto"];
836
876
  /** @description Linear catalogue-action steps (v1; no branches). */
837
877
  steps: components["schemas"]["UpsertWorkflowStepDto"][];
838
878
  /** @description Marks the row as managed by code (CLI / SDK). Defaults to true on this endpoint. */
@@ -937,7 +977,7 @@ interface components {
937
977
  description?: string;
938
978
  /** @description System instructions / prompt for the agent. */
939
979
  instructions: string;
940
- /** @description Selected model id on the AI provider connection (e.g. `gpt-4o`). */
980
+ /** @description Catalogue model id enabled on the AI connection. Example: `deepseek-ai/DeepSeek-V4-Pro`. Discover ids with GET /api/ai-connections. */
941
981
  model: string;
942
982
  /** @description AiProviderConnection UUID. When omitted, platform AI defaults apply. */
943
983
  aiConnectionId?: string;
@@ -2074,6 +2114,32 @@ interface components {
2074
2114
  /** Format: date-time */
2075
2115
  updatedAt: string;
2076
2116
  };
2117
+ PublicAiModelResponseDto: {
2118
+ /** @description Catalogue model id passed to agent deploy as `model`. Example: `deepseek-ai/DeepSeek-V4-Pro`. */
2119
+ id: string;
2120
+ /** @description Display name. */
2121
+ name: string;
2122
+ /** @description True when this is the model used if an agent deploy omits `model` on this connection. */
2123
+ isDefault: boolean;
2124
+ /** @description Whether the model can call tools. */
2125
+ supportsTools: boolean;
2126
+ /** @description Whether the model accepts image input. */
2127
+ supportsVision: boolean;
2128
+ /** @description Whether the model exposes a reasoning mode. */
2129
+ supportsReasoning: boolean;
2130
+ };
2131
+ PublicAiConnectionResponseDto: {
2132
+ /** @description AiProviderConnection UUID. Pass as `aiConnectionId` / `defineAiConnection({ id })` when this connection is not the default. */
2133
+ id: string;
2134
+ /** @description Connection display name. Example: `Lunnoa LLMs`. */
2135
+ name: string;
2136
+ /** @description Provider slug. Example: `featherless` or `openai`. */
2137
+ provider: string;
2138
+ /** @description True for the connection used when an agent deploy omits `aiConnectionId`. */
2139
+ isDefault: boolean;
2140
+ /** @description Models this connection accepts. Inactive models are omitted. */
2141
+ models: components["schemas"]["PublicAiModelResponseDto"][];
2142
+ };
2077
2143
  ConnectionWorkspaceDto: {
2078
2144
  /** @description Workspace ID. */
2079
2145
  id: string;
@@ -2622,6 +2688,7 @@ declare const DEFINE_KINDS: {
2622
2688
  readonly connection: "connection";
2623
2689
  readonly aiConnection: "aiConnection";
2624
2690
  readonly action: "action";
2691
+ readonly trigger: "trigger";
2625
2692
  readonly workflow: "workflow";
2626
2693
  readonly agent: "agent";
2627
2694
  readonly entityType: "entityType";
@@ -2656,6 +2723,43 @@ interface ActionDefinition {
2656
2723
  name?: string;
2657
2724
  description?: string;
2658
2725
  }
2726
+ /** One field on a Manually Run trigger. Stored as `customInputConfig`. */
2727
+ interface TriggerInputFieldDefinition {
2728
+ /** Field id. Callers pass this key to `workflows.execute`. */
2729
+ id: string;
2730
+ label?: string;
2731
+ description?: string;
2732
+ /** `text`, `number`, `date`, or `select`. Defaults to `text` on deploy. */
2733
+ inputType?: string;
2734
+ required?: boolean | {
2735
+ missingMessage?: string;
2736
+ missingStatus?: string;
2737
+ };
2738
+ defaultValue?: unknown;
2739
+ selectOptions?: Array<{
2740
+ label?: string;
2741
+ value?: string;
2742
+ }>;
2743
+ }
2744
+ /** Ref to a catalogue trigger. Credentials stay on the connection, when one is set. */
2745
+ interface TriggerDefinition {
2746
+ kind: typeof DEFINE_KINDS.trigger;
2747
+ /**
2748
+ * Catalogue trigger id, e.g. `flow-control_trigger_manual`.
2749
+ * Discover with `apps get <appId> --json` (`triggers[].triggerId`).
2750
+ */
2751
+ id: string;
2752
+ /** Workflow app id. Inferred from `id` when it matches `{app}_trigger_…`. */
2753
+ appId?: string;
2754
+ /** Optional Connection ref. Omit to let the platform resolve. */
2755
+ connection?: ConnectionDefinition;
2756
+ /** Catalogue trigger config (webhook method, schedule, app trigger fields). */
2757
+ input?: Record<string, unknown>;
2758
+ /** Manual-trigger fields. Stored as `customInputConfig`. */
2759
+ inputs?: TriggerInputFieldDefinition[];
2760
+ name?: string;
2761
+ description?: string;
2762
+ }
2659
2763
  interface WorkflowStepDefinition {
2660
2764
  /** Action definition (or inline action-shaped object). */
2661
2765
  use: ActionDefinition;
@@ -2670,6 +2774,11 @@ interface WorkflowDefinition {
2670
2774
  name?: string;
2671
2775
  description?: string;
2672
2776
  isActive?: boolean;
2777
+ /**
2778
+ * Catalogue trigger. Omit for Manually Run with no input fields.
2779
+ * `runs.start` ignores this and runs the steps only.
2780
+ */
2781
+ trigger?: TriggerDefinition;
2673
2782
  /** Linear steps (v1; no branches). */
2674
2783
  steps: WorkflowStepDefinition[];
2675
2784
  }
@@ -2682,7 +2791,10 @@ interface AgentDefinition {
2682
2791
  slug: string;
2683
2792
  name?: string;
2684
2793
  description?: string;
2685
- /** Selected model id on the AI provider connection. */
2794
+ /**
2795
+ * Catalogue model id from `ai-connections list` (`models[].id`).
2796
+ * Example on Lunnoa LLMs: `deepseek-ai/DeepSeek-V4-Pro`.
2797
+ */
2686
2798
  model: string;
2687
2799
  instructions: string;
2688
2800
  aiConnection?: AiConnectionDefinition;
@@ -2885,6 +2997,36 @@ declare class SsoAuthResource {
2885
2997
  getLoginUrl(providerId: string): string;
2886
2998
  }
2887
2999
 
3000
+ interface AiConnectionModel {
3001
+ /** Catalogue id for `defineAgent({ model })`. */
3002
+ id: string;
3003
+ name: string;
3004
+ isDefault: boolean;
3005
+ supportsTools: boolean;
3006
+ supportsVision: boolean;
3007
+ supportsReasoning: boolean;
3008
+ }
3009
+ interface AiConnection {
3010
+ /** AiProviderConnection UUID for `defineAiConnection({ id })`. */
3011
+ id: string;
3012
+ name: string;
3013
+ /** Provider slug, for example `featherless` or `openai`. */
3014
+ provider: string;
3015
+ /** True when agent deploy uses this connection if `aiConnection` is omitted. */
3016
+ isDefault: boolean;
3017
+ models: AiConnectionModel[];
3018
+ }
3019
+ declare class AiConnectionsResource {
3020
+ private readonly http;
3021
+ constructor(http: HttpClient);
3022
+ /**
3023
+ * Lists AI connections the caller can assign to an agent, with the model
3024
+ * ids each connection accepts. Credentials are never included.
3025
+ * Requires `agents:create` (the same permission as agent deploy).
3026
+ */
3027
+ list(): Promise<AiConnection[]>;
3028
+ }
3029
+
2888
3030
  declare class ConnectionsResource {
2889
3031
  private readonly http;
2890
3032
  constructor(http: HttpClient);
@@ -3407,11 +3549,24 @@ interface UpsertWorkflowStepInput {
3407
3549
  name?: string;
3408
3550
  description?: string;
3409
3551
  }
3552
+ interface UpsertWorkflowTriggerInput {
3553
+ triggerId: string;
3554
+ appId?: string;
3555
+ connectionId?: string;
3556
+ /** Catalogue trigger config. */
3557
+ input?: Record<string, unknown>;
3558
+ /** Manual-trigger fields. Stored as `customInputConfig`. */
3559
+ inputs?: TriggerDefinition['inputs'];
3560
+ name?: string;
3561
+ description?: string;
3562
+ }
3410
3563
  interface UpsertWorkflowBySlugInput {
3411
3564
  slug: string;
3412
3565
  name?: string;
3413
3566
  description?: string;
3414
3567
  isActive?: boolean;
3568
+ /** Omit for Manually Run with no input fields. */
3569
+ trigger?: UpsertWorkflowTriggerInput;
3415
3570
  steps: UpsertWorkflowStepInput[];
3416
3571
  managedByCode?: boolean;
3417
3572
  }
@@ -3494,6 +3649,8 @@ declare class LunnoaClient {
3494
3649
  readonly variables: VariablesResource;
3495
3650
  readonly scorecards: ScorecardsResource;
3496
3651
  readonly connections: ConnectionsResource;
3652
+ /** AI provider connections and the model ids each one accepts. */
3653
+ readonly aiConnections: AiConnectionsResource;
3497
3654
  readonly workflowApps: WorkflowAppsResource;
3498
3655
  readonly discovery: DiscoveryResource;
3499
3656
  constructor(options: LunnoaClientOptions);
@@ -3645,7 +3802,10 @@ interface UseNeedsInputResult {
3645
3802
  declare function useNeedsInput(source: NeedsInputSource, options?: UseNeedsInputOptions): UseNeedsInputResult;
3646
3803
 
3647
3804
  interface UseAgentChatOptions {
3648
- /** Agent chat mode forwarded in the request body. */
3805
+ /**
3806
+ * Agent chat mode forwarded in the request body.
3807
+ * Defaults to `preview` (10 model rounds). `builder` stops after 4 rounds.
3808
+ */
3649
3809
  chatMode?: 'builder' | 'preview';
3650
3810
  }
3651
3811
  interface UseAgentChatResult {
package/dist/react.d.ts CHANGED
@@ -107,7 +107,10 @@ declare class HttpClient {
107
107
 
108
108
  type ChatMode = 'builder' | 'preview';
109
109
  interface StreamMessageOptions {
110
- /** Agent chat mode; defaults to the server default (`builder`). */
110
+ /**
111
+ * Agent chat mode. Defaults to `preview` (10 model rounds, a normal agent run).
112
+ * `builder` is the agent-editor interview and stops after 4 rounds.
113
+ */
111
114
  chatMode?: ChatMode;
112
115
  /** Optional image attachment forwarded with this turn. */
113
116
  data?: {
@@ -822,6 +825,41 @@ interface components {
822
825
  /** @description Step description. */
823
826
  description?: string;
824
827
  };
828
+ UpsertWorkflowTriggerInputFieldDto: {
829
+ /** @description Field id. Callers pass this key to workflows.execute. */
830
+ id: string;
831
+ /** @description Label shown on the Manually Run form. */
832
+ label?: string;
833
+ description?: string;
834
+ /** @description text, number, date, or select. Defaults to text. */
835
+ inputType?: string;
836
+ /** @description true, or { missingMessage, missingStatus }. */
837
+ required?: boolean | {
838
+ [key: string]: unknown;
839
+ };
840
+ /** @description Used when the caller omits the field. */
841
+ defaultValue?: unknown;
842
+ selectOptions?: {
843
+ [key: string]: unknown;
844
+ }[];
845
+ };
846
+ UpsertWorkflowTriggerDto: {
847
+ /** @description Catalogue trigger id, for example flow-control_trigger_manual. */
848
+ triggerId: string;
849
+ /** @description Workflow app id. Inferred from triggerId when it contains _trigger_. */
850
+ appId?: string;
851
+ /** @description Connection instance UUID for this trigger. */
852
+ connectionId?: string;
853
+ /** @description Trigger config fields from the catalogue inputConfig. */
854
+ input?: {
855
+ [key: string]: unknown;
856
+ };
857
+ /** @description Manual-trigger fields. Stored on the trigger as customInputConfig. */
858
+ inputs?: components["schemas"]["UpsertWorkflowTriggerInputFieldDto"][];
859
+ /** @description Display name for the trigger node. */
860
+ name?: string;
861
+ description?: string;
862
+ };
825
863
  UpsertWorkflowBySlugDto: {
826
864
  /**
827
865
  * @description Stable workspace-scoped slug (lowercase, digits, hyphens). Used as the upsert key.
@@ -833,6 +871,8 @@ interface components {
833
871
  description?: string;
834
872
  /** @description Whether the workflow is active. */
835
873
  isActive?: boolean;
874
+ /** @description Catalogue trigger. Omit for a Manually Run trigger with no input fields. */
875
+ trigger?: components["schemas"]["UpsertWorkflowTriggerDto"];
836
876
  /** @description Linear catalogue-action steps (v1; no branches). */
837
877
  steps: components["schemas"]["UpsertWorkflowStepDto"][];
838
878
  /** @description Marks the row as managed by code (CLI / SDK). Defaults to true on this endpoint. */
@@ -937,7 +977,7 @@ interface components {
937
977
  description?: string;
938
978
  /** @description System instructions / prompt for the agent. */
939
979
  instructions: string;
940
- /** @description Selected model id on the AI provider connection (e.g. `gpt-4o`). */
980
+ /** @description Catalogue model id enabled on the AI connection. Example: `deepseek-ai/DeepSeek-V4-Pro`. Discover ids with GET /api/ai-connections. */
941
981
  model: string;
942
982
  /** @description AiProviderConnection UUID. When omitted, platform AI defaults apply. */
943
983
  aiConnectionId?: string;
@@ -2074,6 +2114,32 @@ interface components {
2074
2114
  /** Format: date-time */
2075
2115
  updatedAt: string;
2076
2116
  };
2117
+ PublicAiModelResponseDto: {
2118
+ /** @description Catalogue model id passed to agent deploy as `model`. Example: `deepseek-ai/DeepSeek-V4-Pro`. */
2119
+ id: string;
2120
+ /** @description Display name. */
2121
+ name: string;
2122
+ /** @description True when this is the model used if an agent deploy omits `model` on this connection. */
2123
+ isDefault: boolean;
2124
+ /** @description Whether the model can call tools. */
2125
+ supportsTools: boolean;
2126
+ /** @description Whether the model accepts image input. */
2127
+ supportsVision: boolean;
2128
+ /** @description Whether the model exposes a reasoning mode. */
2129
+ supportsReasoning: boolean;
2130
+ };
2131
+ PublicAiConnectionResponseDto: {
2132
+ /** @description AiProviderConnection UUID. Pass as `aiConnectionId` / `defineAiConnection({ id })` when this connection is not the default. */
2133
+ id: string;
2134
+ /** @description Connection display name. Example: `Lunnoa LLMs`. */
2135
+ name: string;
2136
+ /** @description Provider slug. Example: `featherless` or `openai`. */
2137
+ provider: string;
2138
+ /** @description True for the connection used when an agent deploy omits `aiConnectionId`. */
2139
+ isDefault: boolean;
2140
+ /** @description Models this connection accepts. Inactive models are omitted. */
2141
+ models: components["schemas"]["PublicAiModelResponseDto"][];
2142
+ };
2077
2143
  ConnectionWorkspaceDto: {
2078
2144
  /** @description Workspace ID. */
2079
2145
  id: string;
@@ -2622,6 +2688,7 @@ declare const DEFINE_KINDS: {
2622
2688
  readonly connection: "connection";
2623
2689
  readonly aiConnection: "aiConnection";
2624
2690
  readonly action: "action";
2691
+ readonly trigger: "trigger";
2625
2692
  readonly workflow: "workflow";
2626
2693
  readonly agent: "agent";
2627
2694
  readonly entityType: "entityType";
@@ -2656,6 +2723,43 @@ interface ActionDefinition {
2656
2723
  name?: string;
2657
2724
  description?: string;
2658
2725
  }
2726
+ /** One field on a Manually Run trigger. Stored as `customInputConfig`. */
2727
+ interface TriggerInputFieldDefinition {
2728
+ /** Field id. Callers pass this key to `workflows.execute`. */
2729
+ id: string;
2730
+ label?: string;
2731
+ description?: string;
2732
+ /** `text`, `number`, `date`, or `select`. Defaults to `text` on deploy. */
2733
+ inputType?: string;
2734
+ required?: boolean | {
2735
+ missingMessage?: string;
2736
+ missingStatus?: string;
2737
+ };
2738
+ defaultValue?: unknown;
2739
+ selectOptions?: Array<{
2740
+ label?: string;
2741
+ value?: string;
2742
+ }>;
2743
+ }
2744
+ /** Ref to a catalogue trigger. Credentials stay on the connection, when one is set. */
2745
+ interface TriggerDefinition {
2746
+ kind: typeof DEFINE_KINDS.trigger;
2747
+ /**
2748
+ * Catalogue trigger id, e.g. `flow-control_trigger_manual`.
2749
+ * Discover with `apps get <appId> --json` (`triggers[].triggerId`).
2750
+ */
2751
+ id: string;
2752
+ /** Workflow app id. Inferred from `id` when it matches `{app}_trigger_…`. */
2753
+ appId?: string;
2754
+ /** Optional Connection ref. Omit to let the platform resolve. */
2755
+ connection?: ConnectionDefinition;
2756
+ /** Catalogue trigger config (webhook method, schedule, app trigger fields). */
2757
+ input?: Record<string, unknown>;
2758
+ /** Manual-trigger fields. Stored as `customInputConfig`. */
2759
+ inputs?: TriggerInputFieldDefinition[];
2760
+ name?: string;
2761
+ description?: string;
2762
+ }
2659
2763
  interface WorkflowStepDefinition {
2660
2764
  /** Action definition (or inline action-shaped object). */
2661
2765
  use: ActionDefinition;
@@ -2670,6 +2774,11 @@ interface WorkflowDefinition {
2670
2774
  name?: string;
2671
2775
  description?: string;
2672
2776
  isActive?: boolean;
2777
+ /**
2778
+ * Catalogue trigger. Omit for Manually Run with no input fields.
2779
+ * `runs.start` ignores this and runs the steps only.
2780
+ */
2781
+ trigger?: TriggerDefinition;
2673
2782
  /** Linear steps (v1; no branches). */
2674
2783
  steps: WorkflowStepDefinition[];
2675
2784
  }
@@ -2682,7 +2791,10 @@ interface AgentDefinition {
2682
2791
  slug: string;
2683
2792
  name?: string;
2684
2793
  description?: string;
2685
- /** Selected model id on the AI provider connection. */
2794
+ /**
2795
+ * Catalogue model id from `ai-connections list` (`models[].id`).
2796
+ * Example on Lunnoa LLMs: `deepseek-ai/DeepSeek-V4-Pro`.
2797
+ */
2686
2798
  model: string;
2687
2799
  instructions: string;
2688
2800
  aiConnection?: AiConnectionDefinition;
@@ -2885,6 +2997,36 @@ declare class SsoAuthResource {
2885
2997
  getLoginUrl(providerId: string): string;
2886
2998
  }
2887
2999
 
3000
+ interface AiConnectionModel {
3001
+ /** Catalogue id for `defineAgent({ model })`. */
3002
+ id: string;
3003
+ name: string;
3004
+ isDefault: boolean;
3005
+ supportsTools: boolean;
3006
+ supportsVision: boolean;
3007
+ supportsReasoning: boolean;
3008
+ }
3009
+ interface AiConnection {
3010
+ /** AiProviderConnection UUID for `defineAiConnection({ id })`. */
3011
+ id: string;
3012
+ name: string;
3013
+ /** Provider slug, for example `featherless` or `openai`. */
3014
+ provider: string;
3015
+ /** True when agent deploy uses this connection if `aiConnection` is omitted. */
3016
+ isDefault: boolean;
3017
+ models: AiConnectionModel[];
3018
+ }
3019
+ declare class AiConnectionsResource {
3020
+ private readonly http;
3021
+ constructor(http: HttpClient);
3022
+ /**
3023
+ * Lists AI connections the caller can assign to an agent, with the model
3024
+ * ids each connection accepts. Credentials are never included.
3025
+ * Requires `agents:create` (the same permission as agent deploy).
3026
+ */
3027
+ list(): Promise<AiConnection[]>;
3028
+ }
3029
+
2888
3030
  declare class ConnectionsResource {
2889
3031
  private readonly http;
2890
3032
  constructor(http: HttpClient);
@@ -3407,11 +3549,24 @@ interface UpsertWorkflowStepInput {
3407
3549
  name?: string;
3408
3550
  description?: string;
3409
3551
  }
3552
+ interface UpsertWorkflowTriggerInput {
3553
+ triggerId: string;
3554
+ appId?: string;
3555
+ connectionId?: string;
3556
+ /** Catalogue trigger config. */
3557
+ input?: Record<string, unknown>;
3558
+ /** Manual-trigger fields. Stored as `customInputConfig`. */
3559
+ inputs?: TriggerDefinition['inputs'];
3560
+ name?: string;
3561
+ description?: string;
3562
+ }
3410
3563
  interface UpsertWorkflowBySlugInput {
3411
3564
  slug: string;
3412
3565
  name?: string;
3413
3566
  description?: string;
3414
3567
  isActive?: boolean;
3568
+ /** Omit for Manually Run with no input fields. */
3569
+ trigger?: UpsertWorkflowTriggerInput;
3415
3570
  steps: UpsertWorkflowStepInput[];
3416
3571
  managedByCode?: boolean;
3417
3572
  }
@@ -3494,6 +3649,8 @@ declare class LunnoaClient {
3494
3649
  readonly variables: VariablesResource;
3495
3650
  readonly scorecards: ScorecardsResource;
3496
3651
  readonly connections: ConnectionsResource;
3652
+ /** AI provider connections and the model ids each one accepts. */
3653
+ readonly aiConnections: AiConnectionsResource;
3497
3654
  readonly workflowApps: WorkflowAppsResource;
3498
3655
  readonly discovery: DiscoveryResource;
3499
3656
  constructor(options: LunnoaClientOptions);
@@ -3645,7 +3802,10 @@ interface UseNeedsInputResult {
3645
3802
  declare function useNeedsInput(source: NeedsInputSource, options?: UseNeedsInputOptions): UseNeedsInputResult;
3646
3803
 
3647
3804
  interface UseAgentChatOptions {
3648
- /** Agent chat mode forwarded in the request body. */
3805
+ /**
3806
+ * Agent chat mode forwarded in the request body.
3807
+ * Defaults to `preview` (10 model rounds). `builder` stops after 4 rounds.
3808
+ */
3649
3809
  chatMode?: 'builder' | 'preview';
3650
3810
  }
3651
3811
  interface UseAgentChatResult {
package/dist/react.js CHANGED
@@ -516,7 +516,7 @@ var AgentChatClient = class {
516
516
  function messageTaskBody(message, options = {}) {
517
517
  return {
518
518
  messages: [message],
519
- ...options.chatMode ? { chatMode: options.chatMode } : {},
519
+ chatMode: options.chatMode ?? "preview",
520
520
  ...options.data ? { data: options.data } : {},
521
521
  ...options.piiResolution ? { piiResolution: options.piiResolution } : {}
522
522
  };
@@ -602,6 +602,40 @@ function resolveActionAppId(action) {
602
602
  `Cannot infer appId for action "${id}". Pass appId explicitly.`
603
603
  );
604
604
  }
605
+ function resolveTriggerAppId(trigger) {
606
+ if (trigger.appId?.trim()) {
607
+ return trigger.appId.trim();
608
+ }
609
+ const id = trigger.id.trim();
610
+ const marker = "_trigger_";
611
+ const markerIndex = id.indexOf(marker);
612
+ if (markerIndex > 0) {
613
+ return id.slice(0, markerIndex);
614
+ }
615
+ const dot = id.indexOf(".");
616
+ if (dot > 0) {
617
+ return id.slice(0, dot);
618
+ }
619
+ throw new Error(
620
+ `Cannot infer appId for trigger "${id}". Pass appId explicitly.`
621
+ );
622
+ }
623
+ function resolveTriggerId(trigger) {
624
+ const id = trigger.id.trim();
625
+ const appId = trigger.appId?.trim();
626
+ if (appId && id.startsWith(`${appId}.`)) {
627
+ return id.slice(appId.length + 1);
628
+ }
629
+ const marker = "_trigger_";
630
+ if (id.includes(marker)) {
631
+ return id;
632
+ }
633
+ const dot = id.indexOf(".");
634
+ if (dot > 0) {
635
+ return id.slice(dot + 1);
636
+ }
637
+ return id;
638
+ }
605
639
  function resolveActionId(action) {
606
640
  const id = action.id.trim();
607
641
  const appId = action.appId?.trim();
@@ -891,6 +925,22 @@ var SsoAuthResource = class {
891
925
  }
892
926
  };
893
927
 
928
+ // src/resources/ai-connections.ts
929
+ var AiConnectionsResource = class {
930
+ constructor(http) {
931
+ this.http = http;
932
+ }
933
+ http;
934
+ /**
935
+ * Lists AI connections the caller can assign to an agent, with the model
936
+ * ids each connection accepts. Credentials are never included.
937
+ * Requires `agents:create` (the same permission as agent deploy).
938
+ */
939
+ list() {
940
+ return this.http.get("/api/ai-connections");
941
+ }
942
+ };
943
+
894
944
  // src/resources/connections.ts
895
945
  var ConnectionsResource = class {
896
946
  constructor(http) {
@@ -2000,6 +2050,17 @@ var WorkflowAppsResource = class {
2000
2050
  };
2001
2051
 
2002
2052
  // src/resources/workflows.ts
2053
+ function triggerToUpsertInput(trigger) {
2054
+ return {
2055
+ triggerId: resolveTriggerId(trigger),
2056
+ appId: resolveTriggerAppId(trigger),
2057
+ ...trigger.connection?.id ? { connectionId: trigger.connection.id } : {},
2058
+ ...trigger.input ? { input: trigger.input } : {},
2059
+ ...trigger.inputs?.length ? { inputs: trigger.inputs } : {},
2060
+ ...trigger.name ? { name: trigger.name } : {},
2061
+ ...trigger.description ? { description: trigger.description } : {}
2062
+ };
2063
+ }
2003
2064
  function stepToUpsertInput(step) {
2004
2065
  const use = step.use;
2005
2066
  return {
@@ -2020,6 +2081,7 @@ function workflowDefinitionToUpsert(def) {
2020
2081
  name: def.name,
2021
2082
  description: def.description,
2022
2083
  isActive: def.isActive,
2084
+ ...def.trigger ? { trigger: triggerToUpsertInput(def.trigger) } : {},
2023
2085
  managedByCode: true,
2024
2086
  steps: def.steps.map(stepToUpsertInput)
2025
2087
  };
@@ -2116,6 +2178,8 @@ var LunnoaClient = class {
2116
2178
  variables;
2117
2179
  scorecards;
2118
2180
  connections;
2181
+ /** AI provider connections and the model ids each one accepts. */
2182
+ aiConnections;
2119
2183
  workflowApps;
2120
2184
  discovery;
2121
2185
  constructor(options) {
@@ -2139,6 +2203,7 @@ var LunnoaClient = class {
2139
2203
  this.variables = new VariablesResource(this.http);
2140
2204
  this.scorecards = new ScorecardsResource(this.http);
2141
2205
  this.connections = new ConnectionsResource(this.http);
2206
+ this.aiConnections = new AiConnectionsResource(this.http);
2142
2207
  this.discovery = new DiscoveryResource(this.http);
2143
2208
  }
2144
2209
  };
@@ -2540,7 +2605,7 @@ function useAgentChat(agentId, taskId, options = {}) {
2540
2605
  if (!token) return {};
2541
2606
  return { Authorization: `Bearer ${token}` };
2542
2607
  },
2543
- body: chatMode ? { chatMode } : void 0,
2608
+ body: { chatMode: chatMode ?? "preview" },
2544
2609
  prepareReconnectToStreamRequest: ({ headers, credentials }) => ({
2545
2610
  api,
2546
2611
  headers,