@getmodus/sdk 0.11.0 → 0.13.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/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as HttpClient, c as components, M as ModusConfig, P as Page, V as VariationView, S as Scope, a as ScopeConversationsResource, C as Conversation, b as ConversationKind, d as ConversationListItem, W as WorkflowType, e as Workflow, f as ContextItemsQuery, g as ContextItemsQueryResult, h as ContextItem, i as ContextItemLookupRow, j as CustomContextItemsResource, k as ModusClientBase, l as ModusOptions } from './_client-base-DdnxB9JA.cjs';
2
- export { A as Agent, m as AgentType, n as ContextItemAccessUpdate, o as ContextItemAncestor, p as ContextItemDeletion, q as ContextItemMove, r as ContextType, s as CreateCustomContextItemInput, t as CreatedCustomContextItem, u as CustomAttributeInput, v as CustomContextItemDeletion, w as CustomContextItemKind, x as CustomContextItemRelationInput, y as Message, O as OPERATIONS, z as OperationId, B as OperationSpec, D as ScopeStatus, E as ScopeVariation, F as Skill, G as SkillStatus, I as SkillVariation, J as SupervisionView, U as UpdateContextItemAccessInput, K as UpdateCustomContextItemInput, L as conversationScopeId, N as conversationSkillId, Q as operations, R as paths } from './_client-base-DdnxB9JA.cjs';
1
+ import { H as HttpClient, c as components, M as ModusConfig, P as Page, V as VariationView, S as Scope, a as ScopeConversationsResource, C as Conversation, b as ConversationKind, d as ConversationListItem, W as WorkflowType, e as Workflow, f as ContextItemsQuery, g as ContextItemsQueryResult, h as ContextItem, i as ContextItemLookupRow, j as CustomContextItemsResource, k as ModusClientBase, l as ModusOptions } from './_client-base-CGqIZtrm.cjs';
2
+ export { A as Agent, m as AgentType, B as BatchDeleteCustomContextItemsInput, n as BatchDeleteCustomContextItemsResult, o as ContextItemAccessUpdate, p as ContextItemAncestor, q as ContextItemDeletion, r as ContextItemMove, s as ContextType, t as CreateCustomContextItemInput, u as CreatedCustomContextItem, v as CustomAttributeInput, w as CustomContextItemDeletion, x as CustomContextItemKind, y as CustomContextItemRelationInput, z as Message, O as OPERATIONS, D as OperationId, E as OperationSpec, F as ScopeStatus, G as ScopeVariation, I as Skill, J as SkillStatus, K as SkillVariation, L as SupervisionView, U as UpdateContextItemAccessInput, N as UpdateCustomContextItemInput, Q as conversationScopeId, R as conversationSkillId, T as operations, X as paths } from './_client-base-CGqIZtrm.cjs';
3
3
 
4
4
  /**
5
5
  * Base class for all Modus SDK errors.
@@ -135,7 +135,7 @@ declare class ValidationError extends ModusError {
135
135
  constructor(message: string);
136
136
  }
137
137
 
138
- declare const CHAT_MODELS: readonly ["claude-sonnet-5", "claude-sonnet-5.5", "claude-sonnet-4.6", "claude-opus-4.8", "claude-opus-5.5", "claude-haiku-5.5", "gpt-5.2", "gpt-5.5", "gpt-5-mini", "gpt-5.6-luna", "gpt-6-luna", "gpt-oss-120b", "gpt-oss-20b", "qwen3-235b-a22b-2507", "qwen3-coder", "qwen3-32b", "deepseek-chat-v3.1", "deepseek-v4-pro", "deepseek-v4-flash-latest", "deepseek-v4.1-flash-1017", "minimax-m2.7", "llama-4-maverick", "llama-4-scout", "llama-3.3-70b-instruct", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-3.8-flash", "grok-4.3-fast", "grok-4.3", "grok-4.7", "kimi-k3"];
138
+ declare const CHAT_MODELS: readonly ["claude-sonnet-5", "claude-sonnet-5.5", "claude-sonnet-4.6", "claude-opus-4.8", "claude-opus-5.5", "claude-haiku-5.5", "gpt-5.2", "gpt-5.5", "gpt-5-mini", "gpt-5.6-luna", "gpt-6-luna", "gpt-oss-120b", "gpt-oss-20b", "qwen3-235b-a22b-2507", "qwen3-coder", "qwen3-32b", "deepseek-chat-v3.1", "deepseek-v4-pro", "deepseek-v4-flash-latest", "deepseek-v4.1-flash-1017", "minimax-m2.7", "llama-4-maverick", "llama-4-scout", "llama-3.3-70b-instruct", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-3.8-flash", "gemini-4-neon", "grok-4.3-fast", "grok-4.3", "grok-4.7", "kimi-k3"];
139
139
 
140
140
  /** Fields every run event carries. */
141
141
  interface RunEventBase {
@@ -222,7 +222,7 @@ type RunEvent = TokenEvent | DoneEvent | ErrorEvent | CancelledEvent | StreamTim
222
222
  * - `qwen3-235b-a22b-2507`, `qwen3-coder`, `qwen3-32b`
223
223
  * - `deepseek-chat-v3.1`, `deepseek-v4-pro`, `deepseek-v4-flash-latest`, `deepseek-v4.1-flash-1017`, `minimax-m2.7`
224
224
  * - `llama-4-maverick`, `llama-4-scout`, `llama-3.3-70b-instruct`
225
- * - `gemini-3.1-pro-preview`, `gemini-3-flash-preview`, `gemini-3.8-flash`
225
+ * - `gemini-3.1-pro-preview`, `gemini-3-flash-preview`, `gemini-3.8-flash`, `gemini-4-neon`
226
226
  * - `grok-4.3-fast`, `grok-4.3`, `grok-4.7`, `kimi-k3`
227
227
  *
228
228
  * @example
@@ -254,6 +254,13 @@ interface ChatOptions {
254
254
  /** Continue this conversation; omit to start a new one. */
255
255
  threadId?: string;
256
256
  }
257
+ /** Options for `workflows.chat()`. A workflow's steps run with the models set in the workflow. */
258
+ interface WorkflowChatOptions {
259
+ /** @deprecated Ignored: each step of the workflow uses the model set in the workflow. */
260
+ model?: ChatModel;
261
+ /** Continue this conversation; omit to start a new one. */
262
+ threadId?: string;
263
+ }
257
264
  interface ChatRequest {
258
265
  readonly path: string;
259
266
  readonly body: Record<string, unknown>;
@@ -356,7 +363,7 @@ type NewRunBody<T extends {
356
363
  }> = Omit<T, 'sessionId'> & {
357
364
  sessionId?: string;
358
365
  };
359
- type AgentRunCreateRequest = NewRunBody<components['schemas']['AgentRunDto']>;
366
+ type AgentRunCreateRequest = components['schemas']['AgentRunDto'];
360
367
  type SkillRunCreateRequest = NewRunBody<components['schemas']['SkillRunDto']>;
361
368
  type ModusRunCreateRequest = NewRunBody<components['schemas']['ModusRunDto']>;
362
369
  type ResumeRunRequest = components['schemas']['ResumeRunDto'];
@@ -654,7 +661,6 @@ declare class WorkflowRunsResource {
654
661
  }
655
662
 
656
663
  type Connection = components['schemas']['ConnectionDto'];
657
- type ConnectionSelection = components['schemas']['ConnectionSelectionDto'];
658
664
 
659
665
  /** One element of a context item's array field, from `listValues`. */
660
666
  type ContextValueRow = {
@@ -1070,26 +1076,25 @@ declare class WorkflowsResource extends WorkflowsResourceBase {
1070
1076
  includeVariation?: boolean;
1071
1077
  }): Promise<Workflow>;
1072
1078
  /**
1073
- * Chat with a published workflow. Node output streams live from the agent
1079
+ * Run a published workflow and stream its node output live from the agent
1074
1080
  * host: iterate `textStream()` for tokens, or `await` the result for the
1075
- * workflow's final output.
1081
+ * workflow's final output. Call it with no message to trigger a run with no input.
1076
1082
  *
1077
1083
  * @param workflowId - Numeric workflow id.
1078
- * @param message - User message text.
1079
- * @param options.model - Required model id (e.g. `"claude-sonnet-5.5"`).
1084
+ * @param message - The run's input; omit it for a run with no input.
1080
1085
  * @param options.threadId - Continue an existing conversation; omit to start new.
1086
+ * @param options.model - Deprecated and ignored: each step uses the model set in the workflow.
1081
1087
  * @returns A chat session — iterate it or `await` it for `content`, `threadId`, `runId`.
1082
1088
  * @throws {ModusError} When no agent host is known for a custom `baseUrl`.
1083
1089
  *
1084
1090
  * @example
1085
1091
  * ```ts
1086
- * const { content } = await client.workflows.chat(workflowId, 'Run this week\'s digest', {
1087
- * model: 'claude-sonnet-5.5',
1088
- * })
1089
- * console.log(content)
1092
+ * const { content } = await client.workflows.chat(workflowId)
1093
+ * const digest = await client.workflows.chat(workflowId, "Run this week's digest")
1094
+ * console.log(content, digest.content)
1090
1095
  * ```
1091
1096
  */
1092
- chat(workflowId: number | string, message: string, options: ChatOptions): ChatSession;
1097
+ chat(workflowId: number | string, message?: string, options?: WorkflowChatOptions): ChatSession;
1093
1098
  }
1094
1099
 
1095
1100
  /** Generated base for the consumption `context.items` resource. */
@@ -1346,36 +1351,6 @@ declare class ConnectionsResource extends ConnectionsResourceBase {
1346
1351
  type?: string;
1347
1352
  pageSize?: number;
1348
1353
  }): Promise<Connection | undefined>;
1349
- /**
1350
- * List the selectable units on a connection (a repository, a schema, a project).
1351
- *
1352
- * @param connectionId - Connection id.
1353
- * @param options.pageSize - Maximum items per page (default 25).
1354
- * @param options.pageToken - Opaque token from a previous page.
1355
- * @returns A page of selectable units — use {@link iterSelections} or `.autoPagingIter()` for every page.
1356
- * @example
1357
- * for await (const unit of client.connections.iterSelections('7a3f9d2c-1111-4000-a000-000000000abc')) {
1358
- * console.log(unit.objectType, unit.path)
1359
- * }
1360
- */
1361
- listSelections(connectionId: string, options?: {
1362
- pageSize?: number;
1363
- pageToken?: string;
1364
- }): Promise<Page<ConnectionSelection>>;
1365
- private listSelectionsPage;
1366
- /**
1367
- * Yield every selectable unit on a connection, following pages.
1368
- *
1369
- * @param connectionId - Connection id.
1370
- * @param options.pageSize - Maximum items per page (default 25).
1371
- * @example
1372
- * for await (const unit of client.connections.iterSelections('7a3f9d2c-1111-4000-a000-000000000abc')) {
1373
- * console.log(unit.objectType, unit.displayName)
1374
- * }
1375
- */
1376
- iterSelections(connectionId: string, options?: {
1377
- pageSize?: number;
1378
- }): AsyncGenerator<ConnectionSelection>;
1379
1354
  }
1380
1355
 
1381
1356
  /**
@@ -1461,4 +1436,4 @@ declare class Modus extends ModusClientBase {
1461
1436
  constructor(options?: ModusOptions);
1462
1437
  }
1463
1438
 
1464
- export { APIConnectionError, type ActiveConversationRun, type ActiveConversationRunStatus, type AgentRun, type AgentRunCreateRequest, type AgentRunListItem, type AgentRunStream, AgentWorkflowActionsResource, type ApprovalRequiredEvent, type ApprovalScope, type AssistantContentResetEvent, AuthenticationError, BadRequestError, type CancelRunRequest, type CancelledEvent, type ChatModel, type ChatOptions, type ChatResult, ChatSession, type ComposeSkillContextRequest, ConflictError, type Connection, type ConnectionSelection, ConnectionsResource, type ContentProjection, ContextItem, ContextItemLookupRow, ContextItemsQuery, ContextItemsQueryResult, ContextItemsResource, ContextResource, type ContextValueRow, Conversation, ConversationKind, ConversationListItem, type CreateAgentRunRequest, CustomContextItemsResource, type DoneEvent, type EditQueuedRunRequest, type ErrorEvent, type FollowUpRunRequest, type HttpIngestedDataRequest, type IngestedDataRequest, IngestedDataResource, type IngestedDataResponse, type IngestedDataResponseFormat, type IngestedDataUploadResult, InternalServerError, type InterruptRunRequest, type JsonObjectInput, Modus, ModusConfig, type ModusContextComposition, type ModusContextRequest, ModusConversationsResource, ModusError, ModusOptions, ModusResource, type ModusRunCreateRequest, NotFoundError, Page, PermissionDeniedError, RateLimitError, type RecordSuggestionEventRequest, type ResumeRunRequest, type RunAdmission, RunCancelledError, type RunEvent, type RunEventBase, type RunEventsPollResponse, type RunStatus, type RunTimeframe, Scope, ScopeConversationsResource, ScopesResource, type SkillContextComposition, type SkillRunCreateRequest, type SqlIngestedDataRequest, StreamTimeoutError, type StreamTimeoutEvent, type SuggestionEventSource, type SuggestionEventType, type SuggestionQuestion, SuggestionsResource, type TokenEvent, UnprocessableError, type UploadIngestedDataOptions, ValidationError, VariationView, Workflow, type WorkflowActionRequest, WorkflowRunsResource, WorkflowType, WorkflowsResource, components };
1439
+ export { APIConnectionError, type ActiveConversationRun, type ActiveConversationRunStatus, type AgentRun, type AgentRunCreateRequest, type AgentRunListItem, type AgentRunStream, AgentWorkflowActionsResource, type ApprovalRequiredEvent, type ApprovalScope, type AssistantContentResetEvent, AuthenticationError, BadRequestError, type CancelRunRequest, type CancelledEvent, type ChatModel, type ChatOptions, type ChatResult, ChatSession, type ComposeSkillContextRequest, ConflictError, type Connection, ConnectionsResource, type ContentProjection, ContextItem, ContextItemLookupRow, ContextItemsQuery, ContextItemsQueryResult, ContextItemsResource, ContextResource, type ContextValueRow, Conversation, ConversationKind, ConversationListItem, type CreateAgentRunRequest, CustomContextItemsResource, type DoneEvent, type EditQueuedRunRequest, type ErrorEvent, type FollowUpRunRequest, type HttpIngestedDataRequest, type IngestedDataRequest, IngestedDataResource, type IngestedDataResponse, type IngestedDataResponseFormat, type IngestedDataUploadResult, InternalServerError, type InterruptRunRequest, type JsonObjectInput, Modus, ModusConfig, type ModusContextComposition, type ModusContextRequest, ModusConversationsResource, ModusError, ModusOptions, ModusResource, type ModusRunCreateRequest, NotFoundError, Page, PermissionDeniedError, RateLimitError, type RecordSuggestionEventRequest, type ResumeRunRequest, type RunAdmission, RunCancelledError, type RunEvent, type RunEventBase, type RunEventsPollResponse, type RunStatus, type RunTimeframe, Scope, ScopeConversationsResource, ScopesResource, type SkillContextComposition, type SkillRunCreateRequest, type SqlIngestedDataRequest, StreamTimeoutError, type StreamTimeoutEvent, type SuggestionEventSource, type SuggestionEventType, type SuggestionQuestion, SuggestionsResource, type TokenEvent, UnprocessableError, type UploadIngestedDataOptions, ValidationError, VariationView, Workflow, type WorkflowActionRequest, type WorkflowChatOptions, WorkflowRunsResource, WorkflowType, WorkflowsResource, components };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as HttpClient, c as components, M as ModusConfig, P as Page, V as VariationView, S as Scope, a as ScopeConversationsResource, C as Conversation, b as ConversationKind, d as ConversationListItem, W as WorkflowType, e as Workflow, f as ContextItemsQuery, g as ContextItemsQueryResult, h as ContextItem, i as ContextItemLookupRow, j as CustomContextItemsResource, k as ModusClientBase, l as ModusOptions } from './_client-base-DdnxB9JA.js';
2
- export { A as Agent, m as AgentType, n as ContextItemAccessUpdate, o as ContextItemAncestor, p as ContextItemDeletion, q as ContextItemMove, r as ContextType, s as CreateCustomContextItemInput, t as CreatedCustomContextItem, u as CustomAttributeInput, v as CustomContextItemDeletion, w as CustomContextItemKind, x as CustomContextItemRelationInput, y as Message, O as OPERATIONS, z as OperationId, B as OperationSpec, D as ScopeStatus, E as ScopeVariation, F as Skill, G as SkillStatus, I as SkillVariation, J as SupervisionView, U as UpdateContextItemAccessInput, K as UpdateCustomContextItemInput, L as conversationScopeId, N as conversationSkillId, Q as operations, R as paths } from './_client-base-DdnxB9JA.js';
1
+ import { H as HttpClient, c as components, M as ModusConfig, P as Page, V as VariationView, S as Scope, a as ScopeConversationsResource, C as Conversation, b as ConversationKind, d as ConversationListItem, W as WorkflowType, e as Workflow, f as ContextItemsQuery, g as ContextItemsQueryResult, h as ContextItem, i as ContextItemLookupRow, j as CustomContextItemsResource, k as ModusClientBase, l as ModusOptions } from './_client-base-CGqIZtrm.js';
2
+ export { A as Agent, m as AgentType, B as BatchDeleteCustomContextItemsInput, n as BatchDeleteCustomContextItemsResult, o as ContextItemAccessUpdate, p as ContextItemAncestor, q as ContextItemDeletion, r as ContextItemMove, s as ContextType, t as CreateCustomContextItemInput, u as CreatedCustomContextItem, v as CustomAttributeInput, w as CustomContextItemDeletion, x as CustomContextItemKind, y as CustomContextItemRelationInput, z as Message, O as OPERATIONS, D as OperationId, E as OperationSpec, F as ScopeStatus, G as ScopeVariation, I as Skill, J as SkillStatus, K as SkillVariation, L as SupervisionView, U as UpdateContextItemAccessInput, N as UpdateCustomContextItemInput, Q as conversationScopeId, R as conversationSkillId, T as operations, X as paths } from './_client-base-CGqIZtrm.js';
3
3
 
4
4
  /**
5
5
  * Base class for all Modus SDK errors.
@@ -135,7 +135,7 @@ declare class ValidationError extends ModusError {
135
135
  constructor(message: string);
136
136
  }
137
137
 
138
- declare const CHAT_MODELS: readonly ["claude-sonnet-5", "claude-sonnet-5.5", "claude-sonnet-4.6", "claude-opus-4.8", "claude-opus-5.5", "claude-haiku-5.5", "gpt-5.2", "gpt-5.5", "gpt-5-mini", "gpt-5.6-luna", "gpt-6-luna", "gpt-oss-120b", "gpt-oss-20b", "qwen3-235b-a22b-2507", "qwen3-coder", "qwen3-32b", "deepseek-chat-v3.1", "deepseek-v4-pro", "deepseek-v4-flash-latest", "deepseek-v4.1-flash-1017", "minimax-m2.7", "llama-4-maverick", "llama-4-scout", "llama-3.3-70b-instruct", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-3.8-flash", "grok-4.3-fast", "grok-4.3", "grok-4.7", "kimi-k3"];
138
+ declare const CHAT_MODELS: readonly ["claude-sonnet-5", "claude-sonnet-5.5", "claude-sonnet-4.6", "claude-opus-4.8", "claude-opus-5.5", "claude-haiku-5.5", "gpt-5.2", "gpt-5.5", "gpt-5-mini", "gpt-5.6-luna", "gpt-6-luna", "gpt-oss-120b", "gpt-oss-20b", "qwen3-235b-a22b-2507", "qwen3-coder", "qwen3-32b", "deepseek-chat-v3.1", "deepseek-v4-pro", "deepseek-v4-flash-latest", "deepseek-v4.1-flash-1017", "minimax-m2.7", "llama-4-maverick", "llama-4-scout", "llama-3.3-70b-instruct", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-3.8-flash", "gemini-4-neon", "grok-4.3-fast", "grok-4.3", "grok-4.7", "kimi-k3"];
139
139
 
140
140
  /** Fields every run event carries. */
141
141
  interface RunEventBase {
@@ -222,7 +222,7 @@ type RunEvent = TokenEvent | DoneEvent | ErrorEvent | CancelledEvent | StreamTim
222
222
  * - `qwen3-235b-a22b-2507`, `qwen3-coder`, `qwen3-32b`
223
223
  * - `deepseek-chat-v3.1`, `deepseek-v4-pro`, `deepseek-v4-flash-latest`, `deepseek-v4.1-flash-1017`, `minimax-m2.7`
224
224
  * - `llama-4-maverick`, `llama-4-scout`, `llama-3.3-70b-instruct`
225
- * - `gemini-3.1-pro-preview`, `gemini-3-flash-preview`, `gemini-3.8-flash`
225
+ * - `gemini-3.1-pro-preview`, `gemini-3-flash-preview`, `gemini-3.8-flash`, `gemini-4-neon`
226
226
  * - `grok-4.3-fast`, `grok-4.3`, `grok-4.7`, `kimi-k3`
227
227
  *
228
228
  * @example
@@ -254,6 +254,13 @@ interface ChatOptions {
254
254
  /** Continue this conversation; omit to start a new one. */
255
255
  threadId?: string;
256
256
  }
257
+ /** Options for `workflows.chat()`. A workflow's steps run with the models set in the workflow. */
258
+ interface WorkflowChatOptions {
259
+ /** @deprecated Ignored: each step of the workflow uses the model set in the workflow. */
260
+ model?: ChatModel;
261
+ /** Continue this conversation; omit to start a new one. */
262
+ threadId?: string;
263
+ }
257
264
  interface ChatRequest {
258
265
  readonly path: string;
259
266
  readonly body: Record<string, unknown>;
@@ -356,7 +363,7 @@ type NewRunBody<T extends {
356
363
  }> = Omit<T, 'sessionId'> & {
357
364
  sessionId?: string;
358
365
  };
359
- type AgentRunCreateRequest = NewRunBody<components['schemas']['AgentRunDto']>;
366
+ type AgentRunCreateRequest = components['schemas']['AgentRunDto'];
360
367
  type SkillRunCreateRequest = NewRunBody<components['schemas']['SkillRunDto']>;
361
368
  type ModusRunCreateRequest = NewRunBody<components['schemas']['ModusRunDto']>;
362
369
  type ResumeRunRequest = components['schemas']['ResumeRunDto'];
@@ -654,7 +661,6 @@ declare class WorkflowRunsResource {
654
661
  }
655
662
 
656
663
  type Connection = components['schemas']['ConnectionDto'];
657
- type ConnectionSelection = components['schemas']['ConnectionSelectionDto'];
658
664
 
659
665
  /** One element of a context item's array field, from `listValues`. */
660
666
  type ContextValueRow = {
@@ -1070,26 +1076,25 @@ declare class WorkflowsResource extends WorkflowsResourceBase {
1070
1076
  includeVariation?: boolean;
1071
1077
  }): Promise<Workflow>;
1072
1078
  /**
1073
- * Chat with a published workflow. Node output streams live from the agent
1079
+ * Run a published workflow and stream its node output live from the agent
1074
1080
  * host: iterate `textStream()` for tokens, or `await` the result for the
1075
- * workflow's final output.
1081
+ * workflow's final output. Call it with no message to trigger a run with no input.
1076
1082
  *
1077
1083
  * @param workflowId - Numeric workflow id.
1078
- * @param message - User message text.
1079
- * @param options.model - Required model id (e.g. `"claude-sonnet-5.5"`).
1084
+ * @param message - The run's input; omit it for a run with no input.
1080
1085
  * @param options.threadId - Continue an existing conversation; omit to start new.
1086
+ * @param options.model - Deprecated and ignored: each step uses the model set in the workflow.
1081
1087
  * @returns A chat session — iterate it or `await` it for `content`, `threadId`, `runId`.
1082
1088
  * @throws {ModusError} When no agent host is known for a custom `baseUrl`.
1083
1089
  *
1084
1090
  * @example
1085
1091
  * ```ts
1086
- * const { content } = await client.workflows.chat(workflowId, 'Run this week\'s digest', {
1087
- * model: 'claude-sonnet-5.5',
1088
- * })
1089
- * console.log(content)
1092
+ * const { content } = await client.workflows.chat(workflowId)
1093
+ * const digest = await client.workflows.chat(workflowId, "Run this week's digest")
1094
+ * console.log(content, digest.content)
1090
1095
  * ```
1091
1096
  */
1092
- chat(workflowId: number | string, message: string, options: ChatOptions): ChatSession;
1097
+ chat(workflowId: number | string, message?: string, options?: WorkflowChatOptions): ChatSession;
1093
1098
  }
1094
1099
 
1095
1100
  /** Generated base for the consumption `context.items` resource. */
@@ -1346,36 +1351,6 @@ declare class ConnectionsResource extends ConnectionsResourceBase {
1346
1351
  type?: string;
1347
1352
  pageSize?: number;
1348
1353
  }): Promise<Connection | undefined>;
1349
- /**
1350
- * List the selectable units on a connection (a repository, a schema, a project).
1351
- *
1352
- * @param connectionId - Connection id.
1353
- * @param options.pageSize - Maximum items per page (default 25).
1354
- * @param options.pageToken - Opaque token from a previous page.
1355
- * @returns A page of selectable units — use {@link iterSelections} or `.autoPagingIter()` for every page.
1356
- * @example
1357
- * for await (const unit of client.connections.iterSelections('7a3f9d2c-1111-4000-a000-000000000abc')) {
1358
- * console.log(unit.objectType, unit.path)
1359
- * }
1360
- */
1361
- listSelections(connectionId: string, options?: {
1362
- pageSize?: number;
1363
- pageToken?: string;
1364
- }): Promise<Page<ConnectionSelection>>;
1365
- private listSelectionsPage;
1366
- /**
1367
- * Yield every selectable unit on a connection, following pages.
1368
- *
1369
- * @param connectionId - Connection id.
1370
- * @param options.pageSize - Maximum items per page (default 25).
1371
- * @example
1372
- * for await (const unit of client.connections.iterSelections('7a3f9d2c-1111-4000-a000-000000000abc')) {
1373
- * console.log(unit.objectType, unit.displayName)
1374
- * }
1375
- */
1376
- iterSelections(connectionId: string, options?: {
1377
- pageSize?: number;
1378
- }): AsyncGenerator<ConnectionSelection>;
1379
1354
  }
1380
1355
 
1381
1356
  /**
@@ -1461,4 +1436,4 @@ declare class Modus extends ModusClientBase {
1461
1436
  constructor(options?: ModusOptions);
1462
1437
  }
1463
1438
 
1464
- export { APIConnectionError, type ActiveConversationRun, type ActiveConversationRunStatus, type AgentRun, type AgentRunCreateRequest, type AgentRunListItem, type AgentRunStream, AgentWorkflowActionsResource, type ApprovalRequiredEvent, type ApprovalScope, type AssistantContentResetEvent, AuthenticationError, BadRequestError, type CancelRunRequest, type CancelledEvent, type ChatModel, type ChatOptions, type ChatResult, ChatSession, type ComposeSkillContextRequest, ConflictError, type Connection, type ConnectionSelection, ConnectionsResource, type ContentProjection, ContextItem, ContextItemLookupRow, ContextItemsQuery, ContextItemsQueryResult, ContextItemsResource, ContextResource, type ContextValueRow, Conversation, ConversationKind, ConversationListItem, type CreateAgentRunRequest, CustomContextItemsResource, type DoneEvent, type EditQueuedRunRequest, type ErrorEvent, type FollowUpRunRequest, type HttpIngestedDataRequest, type IngestedDataRequest, IngestedDataResource, type IngestedDataResponse, type IngestedDataResponseFormat, type IngestedDataUploadResult, InternalServerError, type InterruptRunRequest, type JsonObjectInput, Modus, ModusConfig, type ModusContextComposition, type ModusContextRequest, ModusConversationsResource, ModusError, ModusOptions, ModusResource, type ModusRunCreateRequest, NotFoundError, Page, PermissionDeniedError, RateLimitError, type RecordSuggestionEventRequest, type ResumeRunRequest, type RunAdmission, RunCancelledError, type RunEvent, type RunEventBase, type RunEventsPollResponse, type RunStatus, type RunTimeframe, Scope, ScopeConversationsResource, ScopesResource, type SkillContextComposition, type SkillRunCreateRequest, type SqlIngestedDataRequest, StreamTimeoutError, type StreamTimeoutEvent, type SuggestionEventSource, type SuggestionEventType, type SuggestionQuestion, SuggestionsResource, type TokenEvent, UnprocessableError, type UploadIngestedDataOptions, ValidationError, VariationView, Workflow, type WorkflowActionRequest, WorkflowRunsResource, WorkflowType, WorkflowsResource, components };
1439
+ export { APIConnectionError, type ActiveConversationRun, type ActiveConversationRunStatus, type AgentRun, type AgentRunCreateRequest, type AgentRunListItem, type AgentRunStream, AgentWorkflowActionsResource, type ApprovalRequiredEvent, type ApprovalScope, type AssistantContentResetEvent, AuthenticationError, BadRequestError, type CancelRunRequest, type CancelledEvent, type ChatModel, type ChatOptions, type ChatResult, ChatSession, type ComposeSkillContextRequest, ConflictError, type Connection, ConnectionsResource, type ContentProjection, ContextItem, ContextItemLookupRow, ContextItemsQuery, ContextItemsQueryResult, ContextItemsResource, ContextResource, type ContextValueRow, Conversation, ConversationKind, ConversationListItem, type CreateAgentRunRequest, CustomContextItemsResource, type DoneEvent, type EditQueuedRunRequest, type ErrorEvent, type FollowUpRunRequest, type HttpIngestedDataRequest, type IngestedDataRequest, IngestedDataResource, type IngestedDataResponse, type IngestedDataResponseFormat, type IngestedDataUploadResult, InternalServerError, type InterruptRunRequest, type JsonObjectInput, Modus, ModusConfig, type ModusContextComposition, type ModusContextRequest, ModusConversationsResource, ModusError, ModusOptions, ModusResource, type ModusRunCreateRequest, NotFoundError, Page, PermissionDeniedError, RateLimitError, type RecordSuggestionEventRequest, type ResumeRunRequest, type RunAdmission, RunCancelledError, type RunEvent, type RunEventBase, type RunEventsPollResponse, type RunStatus, type RunTimeframe, Scope, ScopeConversationsResource, ScopesResource, type SkillContextComposition, type SkillRunCreateRequest, type SqlIngestedDataRequest, StreamTimeoutError, type StreamTimeoutEvent, type SuggestionEventSource, type SuggestionEventType, type SuggestionQuestion, SuggestionsResource, type TokenEvent, UnprocessableError, type UploadIngestedDataOptions, ValidationError, VariationView, Workflow, type WorkflowActionRequest, type WorkflowChatOptions, WorkflowRunsResource, WorkflowType, WorkflowsResource, components };
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  validateChatModel,
32
32
  validateId,
33
33
  validatePageSize
34
- } from "./chunk-JVTQBBMZ.js";
34
+ } from "./chunk-KX2P3TAH.js";
35
35
 
36
36
  // src/_agent_run_request.ts
37
37
  import { randomUUID } from "crypto";
@@ -332,14 +332,15 @@ function startChat(http, config, target, message, options) {
332
332
  }
333
333
  function chatRequest(config, target, message, options) {
334
334
  if (target.kind !== "modus") validateId(target.id, `${target.kind.slice(0, -1)}_id`);
335
- validateChatModel(options.model);
335
+ const runsWithOwnModels = target.kind === "workflows";
336
+ if (!runsWithOwnModels) validateChatModel(options.model);
336
337
  const baseUrl = requireAgentHost(config);
337
338
  const sessionId = resolveAgentRunSessionId(effectiveThreadId(options.threadId));
338
339
  return {
339
340
  path: runsPath(target),
340
341
  body: {
341
342
  message,
342
- config: { model: options.model },
343
+ ...runsWithOwnModels ? {} : { config: { model: options.model } },
343
344
  sessionId,
344
345
  ...config.organizationId !== void 0 ? { organizationId: config.organizationId } : {}
345
346
  },
@@ -938,26 +939,25 @@ var WorkflowsResource = class extends WorkflowsResourceBase {
938
939
  return parseWorkflow(data);
939
940
  }
940
941
  /**
941
- * Chat with a published workflow. Node output streams live from the agent
942
+ * Run a published workflow and stream its node output live from the agent
942
943
  * host: iterate `textStream()` for tokens, or `await` the result for the
943
- * workflow's final output.
944
+ * workflow's final output. Call it with no message to trigger a run with no input.
944
945
  *
945
946
  * @param workflowId - Numeric workflow id.
946
- * @param message - User message text.
947
- * @param options.model - Required model id (e.g. `"claude-sonnet-5.5"`).
947
+ * @param message - The run's input; omit it for a run with no input.
948
948
  * @param options.threadId - Continue an existing conversation; omit to start new.
949
+ * @param options.model - Deprecated and ignored: each step uses the model set in the workflow.
949
950
  * @returns A chat session — iterate it or `await` it for `content`, `threadId`, `runId`.
950
951
  * @throws {ModusError} When no agent host is known for a custom `baseUrl`.
951
952
  *
952
953
  * @example
953
954
  * ```ts
954
- * const { content } = await client.workflows.chat(workflowId, 'Run this week\'s digest', {
955
- * model: 'claude-sonnet-5.5',
956
- * })
957
- * console.log(content)
955
+ * const { content } = await client.workflows.chat(workflowId)
956
+ * const digest = await client.workflows.chat(workflowId, "Run this week's digest")
957
+ * console.log(content, digest.content)
958
958
  * ```
959
959
  */
960
- chat(workflowId, message, options) {
960
+ chat(workflowId, message = "", options = {}) {
961
961
  return startChat(this.http, this.config, { kind: "workflows", id: workflowId }, message, options);
962
962
  }
963
963
  };
@@ -1032,52 +1032,6 @@ var ConnectionsResource = class extends ConnectionsResourceBase {
1032
1032
  } while (token !== void 0);
1033
1033
  return void 0;
1034
1034
  }
1035
- /**
1036
- * List the selectable units on a connection (a repository, a schema, a project).
1037
- *
1038
- * @param connectionId - Connection id.
1039
- * @param options.pageSize - Maximum items per page (default 25).
1040
- * @param options.pageToken - Opaque token from a previous page.
1041
- * @returns A page of selectable units — use {@link iterSelections} or `.autoPagingIter()` for every page.
1042
- * @example
1043
- * for await (const unit of client.connections.iterSelections('7a3f9d2c-1111-4000-a000-000000000abc')) {
1044
- * console.log(unit.objectType, unit.path)
1045
- * }
1046
- */
1047
- listSelections(connectionId, options = {}) {
1048
- validateId(connectionId, "connection_id");
1049
- const pageSize = options.pageSize ?? 25;
1050
- validatePageSize(pageSize);
1051
- return this.listSelectionsPage(connectionId, pageSize, options.pageToken);
1052
- }
1053
- async listSelectionsPage(connectionId, pageSize, pageToken) {
1054
- const data = asRecord(
1055
- await invokeWithRetry(this.config, this.http, "ConnectionsController_listSelections", {
1056
- pathParams: { connectionId },
1057
- query: aipListParams(pageSize, pageToken)
1058
- })
1059
- );
1060
- return buildAipPage(
1061
- data,
1062
- "selections",
1063
- (raw) => raw,
1064
- (token) => this.listSelectionsPage(connectionId, pageSize, token)
1065
- );
1066
- }
1067
- /**
1068
- * Yield every selectable unit on a connection, following pages.
1069
- *
1070
- * @param connectionId - Connection id.
1071
- * @param options.pageSize - Maximum items per page (default 25).
1072
- * @example
1073
- * for await (const unit of client.connections.iterSelections('7a3f9d2c-1111-4000-a000-000000000abc')) {
1074
- * console.log(unit.objectType, unit.displayName)
1075
- * }
1076
- */
1077
- async *iterSelections(connectionId, options = {}) {
1078
- const page = await this.listSelections(connectionId, options);
1079
- yield* page.autoPagingIter();
1080
- }
1081
1035
  };
1082
1036
 
1083
1037
  // src/_generated/resources/consumption/context/items.ts