@getmodus/sdk 0.11.0 → 0.12.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.cjs CHANGED
@@ -31,7 +31,7 @@
31
31
 
32
32
 
33
33
 
34
- var _chunk3MHHVC6Ccjs = require('./chunk-3MHHVC6C.cjs');
34
+ var _chunkQHA3LF2Qcjs = require('./chunk-QHA3LF2Q.cjs');
35
35
 
36
36
  // src/_agent_run_request.ts
37
37
  var _crypto = require('crypto');
@@ -161,9 +161,9 @@ function runsPath(target) {
161
161
  return `/agent/v1/${target.kind}/${encodeURIComponent(String(target.id))}/runs`;
162
162
  }
163
163
  function raiseForEvent(event) {
164
- if (event.type === "error") throw new (0, _chunk3MHHVC6Ccjs.ModusError)(event.message, { requestId: event.requestId });
165
- if (event.type === "cancelled") throw new (0, _chunk3MHHVC6Ccjs.RunCancelledError)();
166
- if (event.type === "stream_timeout") throw new (0, _chunk3MHHVC6Ccjs.StreamTimeoutError)();
164
+ if (event.type === "error") throw new (0, _chunkQHA3LF2Qcjs.ModusError)(event.message, { requestId: event.requestId });
165
+ if (event.type === "cancelled") throw new (0, _chunkQHA3LF2Qcjs.RunCancelledError)();
166
+ if (event.type === "stream_timeout") throw new (0, _chunkQHA3LF2Qcjs.StreamTimeoutError)();
167
167
  return event;
168
168
  }
169
169
  var ChatSession = class _ChatSession {
@@ -223,7 +223,7 @@ var ChatSession = class _ChatSession {
223
223
  async result() {
224
224
  for await (const _event of this.replay(true)) {
225
225
  }
226
- if (this.final === void 0) throw new (0, _chunk3MHHVC6Ccjs.ModusError)("Chat stream ended without a done event");
226
+ if (this.final === void 0) throw new (0, _chunkQHA3LF2Qcjs.ModusError)("Chat stream ended without a done event");
227
227
  return this.final;
228
228
  }
229
229
  /** Resolve with the final {@link ChatResult}, so the session can be awaited. */
@@ -257,10 +257,10 @@ var ChatSession = class _ChatSession {
257
257
  */
258
258
  resume(input) {
259
259
  if (this.final === void 0) {
260
- throw new (0, _chunk3MHHVC6Ccjs.ModusError)("resume() needs a finished run: await the chat first");
260
+ throw new (0, _chunkQHA3LF2Qcjs.ModusError)("resume() needs a finished run: await the chat first");
261
261
  }
262
262
  const { runId, threadId } = this.final;
263
- _chunk3MHHVC6Ccjs.validateId.call(void 0, runId, "run_id");
263
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, runId, "run_id");
264
264
  return new _ChatSession(this.http, {
265
265
  path: `/agent/v1/runs/${encodeURIComponent(runId)}/resume`,
266
266
  body: { sessionId: threadId, decision: input.decision },
@@ -331,15 +331,16 @@ function startChat(http, config, target, message, options) {
331
331
  }
332
332
  }
333
333
  function chatRequest(config, target, message, options) {
334
- if (target.kind !== "modus") _chunk3MHHVC6Ccjs.validateId.call(void 0, target.id, `${target.kind.slice(0, -1)}_id`);
335
- _chunk3MHHVC6Ccjs.validateChatModel.call(void 0, options.model);
336
- const baseUrl = _chunk3MHHVC6Ccjs.requireAgentHost.call(void 0, config);
334
+ if (target.kind !== "modus") _chunkQHA3LF2Qcjs.validateId.call(void 0, target.id, `${target.kind.slice(0, -1)}_id`);
335
+ const runsWithOwnModels = target.kind === "workflows";
336
+ if (!runsWithOwnModels) _chunkQHA3LF2Qcjs.validateChatModel.call(void 0, options.model);
337
+ const baseUrl = _chunkQHA3LF2Qcjs.requireAgentHost.call(void 0, 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
  },
@@ -399,7 +400,7 @@ var WorkflowsResourceBase = class {
399
400
  */
400
401
  list(options = {}) {
401
402
  const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
402
- _chunk3MHHVC6Ccjs.validatePageSize.call(void 0, pageSize);
403
+ _chunkQHA3LF2Qcjs.validatePageSize.call(void 0, pageSize);
403
404
  return this.listPage(pageSize, options.pageToken, options.search, options.type, options.view, options.includeVariation);
404
405
  }
405
406
  async listPage(pageSize, pageToken, search, type, view, includeVariation) {
@@ -408,12 +409,12 @@ var WorkflowsResourceBase = class {
408
409
  if (type !== void 0) extra.type = type;
409
410
  if (view !== void 0) extra.view = view;
410
411
  if (includeVariation !== void 0) extra.includeVariation = includeVariation;
411
- const data = _chunk3MHHVC6Ccjs.asRecord.call(void 0,
412
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowsController_list", {
413
- query: _chunk3MHHVC6Ccjs.aipListParams.call(void 0, pageSize, pageToken, extra)
412
+ const data = _chunkQHA3LF2Qcjs.asRecord.call(void 0,
413
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowsController_list", {
414
+ query: _chunkQHA3LF2Qcjs.aipListParams.call(void 0, pageSize, pageToken, extra)
414
415
  })
415
416
  );
416
- return _chunk3MHHVC6Ccjs.buildAipPage.call(void 0,
417
+ return _chunkQHA3LF2Qcjs.buildAipPage.call(void 0,
417
418
  data,
418
419
  "workflows",
419
420
  (raw) => raw,
@@ -427,7 +428,7 @@ var WorkflowsResourceBase = class {
427
428
  var RUNS_MAX_PAGE_SIZE = 100;
428
429
  function runsListParams(pageSize, pageToken, status, timeframe, approvalScope, search) {
429
430
  const params = { pageSize };
430
- const token = _chunk3MHHVC6Ccjs.normalizePageToken.call(void 0, pageToken);
431
+ const token = _chunkQHA3LF2Qcjs.normalizePageToken.call(void 0, pageToken);
431
432
  if (token !== void 0) params.pageToken = token;
432
433
  if (status !== void 0) params.status = status;
433
434
  if (timeframe !== void 0) params.timeframe = timeframe;
@@ -437,7 +438,7 @@ function runsListParams(pageSize, pageToken, status, timeframe, approvalScope, s
437
438
  }
438
439
  function activeRunsParams(pageSize, pageToken) {
439
440
  const params = { pageSize };
440
- const token = _chunk3MHHVC6Ccjs.normalizePageToken.call(void 0, pageToken);
441
+ const token = _chunkQHA3LF2Qcjs.normalizePageToken.call(void 0, pageToken);
441
442
  if (token !== void 0) params.pageToken = token;
442
443
  return params;
443
444
  }
@@ -445,26 +446,26 @@ function parseRun(raw) {
445
446
  return raw;
446
447
  }
447
448
  function parseActiveRunsArray(raw) {
448
- const data = _chunk3MHHVC6Ccjs.asRecord.call(void 0, raw);
449
+ const data = _chunkQHA3LF2Qcjs.asRecord.call(void 0, raw);
449
450
  const runs = data.runs;
450
451
  if (!Array.isArray(runs)) {
451
- throw new (0, _chunk3MHHVC6Ccjs.ModusError)(
452
+ throw new (0, _chunkQHA3LF2Qcjs.ModusError)(
452
453
  `Unexpected active runs response shape: runs must be a list, got ${typeof runs}.`
453
454
  );
454
455
  }
455
456
  return runs;
456
457
  }
457
458
  function parseActiveRunsPage(raw, fetchPage) {
458
- const data = _chunk3MHHVC6Ccjs.asRecord.call(void 0, raw);
459
+ const data = _chunkQHA3LF2Qcjs.asRecord.call(void 0, raw);
459
460
  const runs = data.runs;
460
461
  if (!Array.isArray(runs)) {
461
- throw new (0, _chunk3MHHVC6Ccjs.ModusError)(
462
+ throw new (0, _chunkQHA3LF2Qcjs.ModusError)(
462
463
  `Unexpected active runs response shape: runs must be a list, got ${typeof runs}.`
463
464
  );
464
465
  }
465
- return new (0, _chunk3MHHVC6Ccjs.Page)(
466
+ return new (0, _chunkQHA3LF2Qcjs.Page)(
466
467
  runs,
467
- _chunk3MHHVC6Ccjs.normalizePageToken.call(void 0,
468
+ _chunkQHA3LF2Qcjs.normalizePageToken.call(void 0,
468
469
  typeof data.nextPageToken === "string" ? data.nextPageToken : void 0
469
470
  ),
470
471
  fetchPage
@@ -478,7 +479,7 @@ function sessionIdFromBody(body) {
478
479
  }
479
480
  function requireSessionId(sessionId) {
480
481
  if (!_optionalChain([sessionId, 'optionalAccess', _4 => _4.trim, 'call', _5 => _5()])) {
481
- throw new (0, _chunk3MHHVC6Ccjs.ValidationError)("sessionId must be the run's conversation id (a non-empty string)");
482
+ throw new (0, _chunkQHA3LF2Qcjs.ValidationError)("sessionId must be the run's conversation id (a non-empty string)");
482
483
  }
483
484
  }
484
485
  function makeAgentRunStream(runId, events) {
@@ -518,14 +519,14 @@ var WorkflowRunsResource = class {
518
519
  * ```
519
520
  */
520
521
  list(workflowId, options = {}) {
521
- _chunk3MHHVC6Ccjs.validateId.call(void 0, workflowId, "workflow_id");
522
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, workflowId, "workflow_id");
522
523
  const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
523
- _chunk3MHHVC6Ccjs.validatePageSize.call(void 0, pageSize, RUNS_MAX_PAGE_SIZE);
524
+ _chunkQHA3LF2Qcjs.validatePageSize.call(void 0, pageSize, RUNS_MAX_PAGE_SIZE);
524
525
  return this.listPage(workflowId, pageSize, options.pageToken, options);
525
526
  }
526
527
  async listPage(workflowId, pageSize, pageToken, filters) {
527
- const data = _chunk3MHHVC6Ccjs.asRecord.call(void 0,
528
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowRunsController_list", {
528
+ const data = _chunkQHA3LF2Qcjs.asRecord.call(void 0,
529
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowRunsController_list", {
529
530
  pathParams: { id: workflowId },
530
531
  query: runsListParams(
531
532
  pageSize,
@@ -539,13 +540,13 @@ var WorkflowRunsResource = class {
539
540
  );
540
541
  const runs = data.runs;
541
542
  if (!Array.isArray(runs)) {
542
- throw new (0, _chunk3MHHVC6Ccjs.ModusError)(
543
+ throw new (0, _chunkQHA3LF2Qcjs.ModusError)(
543
544
  `Unexpected list response shape: runs must be a list, got ${typeof runs}.`
544
545
  );
545
546
  }
546
- return new (0, _chunk3MHHVC6Ccjs.Page)(
547
+ return new (0, _chunkQHA3LF2Qcjs.Page)(
547
548
  runs,
548
- _chunk3MHHVC6Ccjs.normalizePageToken.call(void 0,
549
+ _chunkQHA3LF2Qcjs.normalizePageToken.call(void 0,
549
550
  typeof data.nextPageToken === "string" ? data.nextPageToken : void 0
550
551
  ),
551
552
  (token) => this.listPage(workflowId, pageSize, token, filters)
@@ -567,10 +568,10 @@ var WorkflowRunsResource = class {
567
568
  * ```
568
569
  */
569
570
  async get(workflowId, runId, options = {}) {
570
- _chunk3MHHVC6Ccjs.validateId.call(void 0, workflowId, "workflow_id");
571
- if (!runId.trim()) throw new (0, _chunk3MHHVC6Ccjs.ValidationError)("run_id must be a non-empty string");
571
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, workflowId, "workflow_id");
572
+ if (!runId.trim()) throw new (0, _chunkQHA3LF2Qcjs.ValidationError)("run_id must be a non-empty string");
572
573
  const query = options.temporalRunId !== void 0 ? { temporalRunId: options.temporalRunId } : void 0;
573
- const data = await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowRunsController_get", {
574
+ const data = await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowRunsController_get", {
574
575
  pathParams: { id: workflowId, runId },
575
576
  query
576
577
  });
@@ -597,7 +598,7 @@ var WorkflowRunsResource = class {
597
598
  * ```
598
599
  */
599
600
  create(workflowId, body, options = {}) {
600
- _chunk3MHHVC6Ccjs.validateId.call(void 0, workflowId, "workflow_id");
601
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, workflowId, "workflow_id");
601
602
  return this.createRun("WorkflowRunsController_create", body, { id: workflowId }, options);
602
603
  }
603
604
  /**
@@ -622,7 +623,7 @@ var WorkflowRunsResource = class {
622
623
  * ```
623
624
  */
624
625
  createScope(scopeId, body, options = {}) {
625
- _chunk3MHHVC6Ccjs.validateId.call(void 0, scopeId, "scope_id");
626
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, scopeId, "scope_id");
626
627
  return this.createRun("ScopeRunsController_create", body, { id: scopeId }, options);
627
628
  }
628
629
  /**
@@ -670,7 +671,7 @@ var WorkflowRunsResource = class {
670
671
  * ```
671
672
  */
672
673
  resume(runId, body, options = {}) {
673
- _chunk3MHHVC6Ccjs.validateId.call(void 0, runId, "run_id");
674
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, runId, "run_id");
674
675
  requireSessionId(body.sessionId);
675
676
  return this.createRun("ResumeRunsController_create", body, { runId }, options);
676
677
  }
@@ -685,8 +686,8 @@ var WorkflowRunsResource = class {
685
686
  * ```
686
687
  */
687
688
  async cancel(runId) {
688
- _chunk3MHHVC6Ccjs.validateId.call(void 0, runId, "run_id");
689
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_cancel", {
689
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, runId, "run_id");
690
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_cancel", {
690
691
  pathParams: { runId },
691
692
  jsonBody: {}
692
693
  });
@@ -699,8 +700,8 @@ var WorkflowRunsResource = class {
699
700
  * `status` and `done`.
700
701
  */
701
702
  async events(runId) {
702
- _chunk3MHHVC6Ccjs.validateId.call(void 0, runId, "run_id");
703
- return await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_events", {
703
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, runId, "run_id");
704
+ return await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_events", {
704
705
  pathParams: { runId }
705
706
  });
706
707
  }
@@ -731,13 +732,13 @@ var WorkflowRunsResource = class {
731
732
  * ```
732
733
  */
733
734
  async interrupt(runId, nextRun, options = {}) {
734
- _chunk3MHHVC6Ccjs.validateId.call(void 0, runId, "run_id");
735
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, runId, "run_id");
735
736
  requireSessionId(nextRun.sessionId);
736
737
  const jsonBody = {
737
738
  nextRun: { ...nextRun, runId: _optionalChain([nextRun, 'access', _6 => _6.runId, 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]) || randomRunId() },
738
739
  ...options.lastSeenEventId ? { lastSeenEventId: options.lastSeenEventId } : {}
739
740
  };
740
- return await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_interrupt", {
741
+ return await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_interrupt", {
741
742
  pathParams: { runId },
742
743
  jsonBody
743
744
  });
@@ -760,9 +761,9 @@ var WorkflowRunsResource = class {
760
761
  * ```
761
762
  */
762
763
  async editQueued(runId, nextRun) {
763
- _chunk3MHHVC6Ccjs.validateId.call(void 0, runId, "run_id");
764
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, runId, "run_id");
764
765
  requireSessionId(nextRun.sessionId);
765
- return await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_editQueued", {
766
+ return await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_editQueued", {
766
767
  pathParams: { runId },
767
768
  jsonBody: { nextRun }
768
769
  });
@@ -776,12 +777,12 @@ var WorkflowRunsResource = class {
776
777
  */
777
778
  active(options = {}) {
778
779
  const pageSize = _nullishCoalesce(options.pageSize, () => ( 50));
779
- _chunk3MHHVC6Ccjs.validatePageSize.call(void 0, pageSize, RUNS_MAX_PAGE_SIZE);
780
+ _chunkQHA3LF2Qcjs.validatePageSize.call(void 0, pageSize, RUNS_MAX_PAGE_SIZE);
780
781
  return this.activePage(pageSize, options.pageToken);
781
782
  }
782
783
  async activePage(pageSize, pageToken) {
783
784
  return parseActiveRunsPage(
784
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_active", {
785
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_active", {
785
786
  query: activeRunsParams(pageSize, pageToken)
786
787
  }),
787
788
  (token) => this.activePage(pageSize, token)
@@ -797,10 +798,10 @@ var WorkflowRunsResource = class {
797
798
  async activeBySession(sessionIds) {
798
799
  const uniqueSessionIds = [...new Set(sessionIds.map((id) => id.trim()).filter(Boolean))];
799
800
  if (uniqueSessionIds.length > 100) {
800
- throw new (0, _chunk3MHHVC6Ccjs.ValidationError)("sessionIds must contain at most 100 ids");
801
+ throw new (0, _chunkQHA3LF2Qcjs.ValidationError)("sessionIds must contain at most 100 ids");
801
802
  }
802
803
  return parseActiveRunsArray(
803
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_activeBySession", {
804
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_activeBySession", {
804
805
  jsonBody: { sessionIds: uniqueSessionIds }
805
806
  })
806
807
  );
@@ -823,11 +824,11 @@ var WorkflowRunsResource = class {
823
824
  * ```
824
825
  */
825
826
  stream(runId, options = {}) {
826
- _chunk3MHHVC6Ccjs.validateId.call(void 0, runId, "run_id");
827
- const op = _chunk3MHHVC6Ccjs.getOperation.call(void 0, "RunLifecycleController_stream");
828
- const path = _chunk3MHHVC6Ccjs.formatOperationPath.call(void 0, "RunLifecycleController_stream", { runId });
827
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, runId, "run_id");
828
+ const op = _chunkQHA3LF2Qcjs.getOperation.call(void 0, "RunLifecycleController_stream");
829
+ const path = _chunkQHA3LF2Qcjs.formatOperationPath.call(void 0, "RunLifecycleController_stream", { runId });
829
830
  const lines = this.http.streamGet(path, void 0, {
830
- baseUrl: _chunk3MHHVC6Ccjs.operationBaseUrl.call(void 0, this.http, op),
831
+ baseUrl: _chunkQHA3LF2Qcjs.operationBaseUrl.call(void 0, this.http, op),
831
832
  headers: options.lastEventId ? { "Last-Event-ID": options.lastEventId } : void 0
832
833
  });
833
834
  return makeAgentRunStream(runId, this.parseEvents(lines));
@@ -835,14 +836,14 @@ var WorkflowRunsResource = class {
835
836
  createRun(operationId, body, pathParams, options) {
836
837
  const runId = _optionalChain([options, 'access', _9 => _9.idempotencyKey, 'optionalAccess', _10 => _10.trim, 'call', _11 => _11()]) || _optionalChain([body, 'access', _12 => _12.runId, 'optionalAccess', _13 => _13.trim, 'call', _14 => _14()]) || randomRunId();
837
838
  const sessionId = sessionIdFromBody(body);
838
- const op = _chunk3MHHVC6Ccjs.getOperation.call(void 0, operationId);
839
- const path = _chunk3MHHVC6Ccjs.formatOperationPath.call(void 0, operationId, pathParams);
839
+ const op = _chunkQHA3LF2Qcjs.getOperation.call(void 0, operationId);
840
+ const path = _chunkQHA3LF2Qcjs.formatOperationPath.call(void 0, operationId, pathParams);
840
841
  const lines = this.http.streamPost(path, {
841
842
  ...body,
842
843
  sessionId,
843
844
  streamProtocolVersion: 2
844
845
  }, {
845
- baseUrl: _chunk3MHHVC6Ccjs.operationBaseUrl.call(void 0, this.http, op),
846
+ baseUrl: _chunkQHA3LF2Qcjs.operationBaseUrl.call(void 0, this.http, op),
846
847
  headers: { "Idempotency-Key": runId }
847
848
  });
848
849
  return makeAgentRunStream(runId, this.parseEvents(lines));
@@ -872,10 +873,10 @@ var AgentWorkflowActionsResource = class {
872
873
  */
873
874
  execute(body, options = {}) {
874
875
  const runId = _optionalChain([options, 'access', _15 => _15.idempotencyKey, 'optionalAccess', _16 => _16.trim, 'call', _17 => _17()]) || _optionalChain([body, 'access', _18 => _18.runId, 'optionalAccess', _19 => _19.trim, 'call', _20 => _20()]) || randomRunId2();
875
- const op = _chunk3MHHVC6Ccjs.getOperation.call(void 0, "WorkflowActionsController_execute");
876
- const path = _chunk3MHHVC6Ccjs.formatOperationPath.call(void 0, "WorkflowActionsController_execute");
876
+ const op = _chunkQHA3LF2Qcjs.getOperation.call(void 0, "WorkflowActionsController_execute");
877
+ const path = _chunkQHA3LF2Qcjs.formatOperationPath.call(void 0, "WorkflowActionsController_execute");
877
878
  const lines = this.http.streamPost(path, body, {
878
- baseUrl: _chunk3MHHVC6Ccjs.operationBaseUrl.call(void 0, this.http, op),
879
+ baseUrl: _chunkQHA3LF2Qcjs.operationBaseUrl.call(void 0, this.http, op),
879
880
  headers: { "Idempotency-Key": runId }
880
881
  });
881
882
  return makeAgentRunStream(runId, this.parseEvents(lines));
@@ -886,8 +887,8 @@ var AgentWorkflowActionsResource = class {
886
887
  * @param runId - Action run id to cancel.
887
888
  */
888
889
  async cancel(runId) {
889
- _chunk3MHHVC6Ccjs.validateId.call(void 0, runId, "run_id");
890
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowActionsController_cancel", {
890
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, runId, "run_id");
891
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowActionsController_cancel", {
891
892
  pathParams: { runId },
892
893
  jsonBody: {}
893
894
  });
@@ -925,39 +926,38 @@ var WorkflowsResource = class extends WorkflowsResourceBase {
925
926
  * ```
926
927
  */
927
928
  async get(workflowId, options = {}) {
928
- _chunk3MHHVC6Ccjs.validateId.call(void 0, workflowId, "workflow_id");
929
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, workflowId, "workflow_id");
929
930
  const query = {};
930
931
  if (options.view !== void 0) query.view = options.view;
931
932
  if (options.includeVariation !== void 0) {
932
933
  query.includeVariation = options.includeVariation;
933
934
  }
934
- const data = await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowsController_get", {
935
+ const data = await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowsController_get", {
935
936
  pathParams: { id: workflowId },
936
937
  query: Object.keys(query).length > 0 ? query : void 0
937
938
  });
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
  };
@@ -986,18 +986,18 @@ var ConnectionsResourceBase = class {
986
986
  */
987
987
  list(options = {}) {
988
988
  const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
989
- _chunk3MHHVC6Ccjs.validatePageSize.call(void 0, pageSize);
989
+ _chunkQHA3LF2Qcjs.validatePageSize.call(void 0, pageSize);
990
990
  return this.listPage(pageSize, options.pageToken, options.type);
991
991
  }
992
992
  async listPage(pageSize, pageToken, type) {
993
993
  const extra = {};
994
994
  if (type !== void 0) extra.type = type;
995
- const data = _chunk3MHHVC6Ccjs.asRecord.call(void 0,
996
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "ConnectionsController_list", {
997
- query: _chunk3MHHVC6Ccjs.aipListParams.call(void 0, pageSize, pageToken, extra)
995
+ const data = _chunkQHA3LF2Qcjs.asRecord.call(void 0,
996
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ConnectionsController_list", {
997
+ query: _chunkQHA3LF2Qcjs.aipListParams.call(void 0, pageSize, pageToken, extra)
998
998
  })
999
999
  );
1000
- return _chunk3MHHVC6Ccjs.buildAipPage.call(void 0,
1000
+ return _chunkQHA3LF2Qcjs.buildAipPage.call(void 0,
1001
1001
  data,
1002
1002
  "connections",
1003
1003
  (raw) => raw,
@@ -1020,7 +1020,7 @@ var ConnectionsResource = class extends ConnectionsResourceBase {
1020
1020
  */
1021
1021
  async find(options) {
1022
1022
  const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
1023
- _chunk3MHHVC6Ccjs.validatePageSize.call(void 0, pageSize);
1023
+ _chunkQHA3LF2Qcjs.validatePageSize.call(void 0, pageSize);
1024
1024
  const target = options.name.trim().toLowerCase();
1025
1025
  let token;
1026
1026
  do {
@@ -1045,19 +1045,19 @@ var ConnectionsResource = class extends ConnectionsResourceBase {
1045
1045
  * }
1046
1046
  */
1047
1047
  listSelections(connectionId, options = {}) {
1048
- _chunk3MHHVC6Ccjs.validateId.call(void 0, connectionId, "connection_id");
1048
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, connectionId, "connection_id");
1049
1049
  const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
1050
- _chunk3MHHVC6Ccjs.validatePageSize.call(void 0, pageSize);
1050
+ _chunkQHA3LF2Qcjs.validatePageSize.call(void 0, pageSize);
1051
1051
  return this.listSelectionsPage(connectionId, pageSize, options.pageToken);
1052
1052
  }
1053
1053
  async listSelectionsPage(connectionId, pageSize, pageToken) {
1054
- const data = _chunk3MHHVC6Ccjs.asRecord.call(void 0,
1055
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "ConnectionsController_listSelections", {
1054
+ const data = _chunkQHA3LF2Qcjs.asRecord.call(void 0,
1055
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ConnectionsController_listSelections", {
1056
1056
  pathParams: { connectionId },
1057
- query: _chunk3MHHVC6Ccjs.aipListParams.call(void 0, pageSize, pageToken)
1057
+ query: _chunkQHA3LF2Qcjs.aipListParams.call(void 0, pageSize, pageToken)
1058
1058
  })
1059
1059
  );
1060
- return _chunk3MHHVC6Ccjs.buildAipPage.call(void 0,
1060
+ return _chunkQHA3LF2Qcjs.buildAipPage.call(void 0,
1061
1061
  data,
1062
1062
  "selections",
1063
1063
  (raw) => raw,
@@ -1107,8 +1107,8 @@ var ContextItemsResourceBase = class {
1107
1107
  * ```
1108
1108
  */
1109
1109
  async query(query) {
1110
- const data = await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsQueryController_query", {
1111
- jsonBody: _chunk3MHHVC6Ccjs.omitUndefined.call(void 0, query)
1110
+ const data = await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsQueryController_query", {
1111
+ jsonBody: _chunkQHA3LF2Qcjs.omitUndefined.call(void 0, query)
1112
1112
  });
1113
1113
  return data;
1114
1114
  }
@@ -1127,7 +1127,7 @@ function contextListParams(pageSize, pageToken, filters = {}) {
1127
1127
  if (filters.connectionIds !== void 0) {
1128
1128
  extra.connectionIds = filters.connectionIds.length === 0 ? "" : [...filters.connectionIds];
1129
1129
  }
1130
- return _chunk3MHHVC6Ccjs.aipListParams.call(void 0, pageSize, pageToken, extra);
1130
+ return _chunkQHA3LF2Qcjs.aipListParams.call(void 0, pageSize, pageToken, extra);
1131
1131
  }
1132
1132
  function parseContextItem(raw) {
1133
1133
  return raw;
@@ -1189,7 +1189,7 @@ var ContextItemsResource = class extends ContextItemsResourceBase {
1189
1189
  */
1190
1190
  list(options = {}) {
1191
1191
  const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
1192
- _chunk3MHHVC6Ccjs.validatePageSize.call(void 0, pageSize);
1192
+ _chunkQHA3LF2Qcjs.validatePageSize.call(void 0, pageSize);
1193
1193
  return this.listPage(pageSize, options.pageToken, {
1194
1194
  contextType: options.contextType,
1195
1195
  parentUids: options.parentUids,
@@ -1198,12 +1198,12 @@ var ContextItemsResource = class extends ContextItemsResourceBase {
1198
1198
  });
1199
1199
  }
1200
1200
  async listPage(pageSize, pageToken, filters) {
1201
- const data = _chunk3MHHVC6Ccjs.asRecord.call(void 0,
1202
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsController_list", {
1201
+ const data = _chunkQHA3LF2Qcjs.asRecord.call(void 0,
1202
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsController_list", {
1203
1203
  query: contextListParams(pageSize, pageToken, filters)
1204
1204
  })
1205
1205
  );
1206
- return _chunk3MHHVC6Ccjs.buildAipPage.call(void 0,
1206
+ return _chunkQHA3LF2Qcjs.buildAipPage.call(void 0,
1207
1207
  data,
1208
1208
  "contextItems",
1209
1209
  parseContextItem,
@@ -1224,7 +1224,7 @@ var ContextItemsResource = class extends ContextItemsResourceBase {
1224
1224
  * ```
1225
1225
  */
1226
1226
  async get(uid) {
1227
- const data = await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsController_get", {
1227
+ const data = await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsController_get", {
1228
1228
  pathParams: { uid }
1229
1229
  });
1230
1230
  return parseContextItem(data);
@@ -1247,20 +1247,20 @@ var ContextItemsResource = class extends ContextItemsResourceBase {
1247
1247
  * ```
1248
1248
  */
1249
1249
  async lookup(options) {
1250
- const body = _chunk3MHHVC6Ccjs.omitUndefined.call(void 0, {
1250
+ const body = _chunkQHA3LF2Qcjs.omitUndefined.call(void 0, {
1251
1251
  contextType: options.contextType,
1252
1252
  dataPath: options.dataPath,
1253
1253
  contentProjection: options.contentProjection
1254
1254
  });
1255
1255
  try {
1256
- const raw = _chunk3MHHVC6Ccjs.asRecord.call(void 0,
1257
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsController_lookup", {
1256
+ const raw = _chunkQHA3LF2Qcjs.asRecord.call(void 0,
1257
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsController_lookup", {
1258
1258
  jsonBody: body
1259
1259
  })
1260
1260
  );
1261
1261
  return parseLookupResponse(raw);
1262
1262
  } catch (error) {
1263
- if (error instanceof _chunk3MHHVC6Ccjs.NotFoundError) return void 0;
1263
+ if (error instanceof _chunkQHA3LF2Qcjs.NotFoundError) return void 0;
1264
1264
  throw error;
1265
1265
  }
1266
1266
  }
@@ -1293,7 +1293,7 @@ var ContextItemsResource = class extends ContextItemsResourceBase {
1293
1293
  */
1294
1294
  listValues(uid, contextType, contentKeyPath, options = {}) {
1295
1295
  const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
1296
- _chunk3MHHVC6Ccjs.validatePageSize.call(void 0, pageSize, _chunk3MHHVC6Ccjs.DEFAULT_MAX_PAGE_SIZE);
1296
+ _chunkQHA3LF2Qcjs.validatePageSize.call(void 0, pageSize, _chunkQHA3LF2Qcjs.DEFAULT_MAX_PAGE_SIZE);
1297
1297
  return this.listValuesPage(uid, contextType, contentKeyPath, pageSize, options.pageToken);
1298
1298
  }
1299
1299
  /**
@@ -1317,16 +1317,16 @@ var ContextItemsResource = class extends ContextItemsResourceBase {
1317
1317
  return this.listValues(item.uid, item.contextType, contentKeyPath, options);
1318
1318
  }
1319
1319
  async listValuesPage(uid, contextType, contentKeyPath, pageSize, pageToken) {
1320
- const data = _chunk3MHHVC6Ccjs.asRecord.call(void 0,
1321
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsController_listValues", {
1320
+ const data = _chunkQHA3LF2Qcjs.asRecord.call(void 0,
1321
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsController_listValues", {
1322
1322
  pathParams: { uid },
1323
- query: _chunk3MHHVC6Ccjs.aipListParams.call(void 0, pageSize, pageToken, {
1323
+ query: _chunkQHA3LF2Qcjs.aipListParams.call(void 0, pageSize, pageToken, {
1324
1324
  contextType,
1325
1325
  contentKeyPath
1326
1326
  })
1327
1327
  })
1328
1328
  );
1329
- return _chunk3MHHVC6Ccjs.buildAipPage.call(void 0,
1329
+ return _chunkQHA3LF2Qcjs.buildAipPage.call(void 0,
1330
1330
  data,
1331
1331
  "values",
1332
1332
  parseContextValueRow,
@@ -1340,7 +1340,7 @@ var ContextResource = class {
1340
1340
  /** @internal */
1341
1341
  constructor(http, config) {
1342
1342
  this.items = new ContextItemsResource(http, config);
1343
- this.customItems = new (0, _chunk3MHHVC6Ccjs.CustomContextItemsResource)(http, config);
1343
+ this.customItems = new (0, _chunkQHA3LF2Qcjs.CustomContextItemsResource)(http, config);
1344
1344
  }
1345
1345
  };
1346
1346
 
@@ -1375,7 +1375,7 @@ var IngestedDataResource = class {
1375
1375
  * ```
1376
1376
  */
1377
1377
  async upload(options) {
1378
- const data = await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "IngestedDataController_upload", {
1378
+ const data = await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "IngestedDataController_upload", {
1379
1379
  jsonBody: {
1380
1380
  integration_type: options.integrationType,
1381
1381
  request: options.request,
@@ -1403,8 +1403,8 @@ var ModusConversationsResourceBase = class {
1403
1403
  * @param threadId - Thread id from a conversation list or chat response.
1404
1404
  */
1405
1405
  async get(threadId) {
1406
- _chunk3MHHVC6Ccjs.validateId.call(void 0, threadId, "thread_id");
1407
- const data = await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "ModusConversationsController_get", {
1406
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, threadId, "thread_id");
1407
+ const data = await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ModusConversationsController_get", {
1408
1408
  pathParams: { threadId }
1409
1409
  });
1410
1410
  return data;
@@ -1415,7 +1415,7 @@ var ModusConversationsResourceBase = class {
1415
1415
  var ALLOWED_KINDS = /* @__PURE__ */ new Set(["all", "modus", "scopes"]);
1416
1416
  function listParams(pageSize, pageToken, kind, source, sourceRef) {
1417
1417
  if (kind !== void 0 && !ALLOWED_KINDS.has(kind)) {
1418
- throw new (0, _chunk3MHHVC6Ccjs.ValidationError)(
1418
+ throw new (0, _chunkQHA3LF2Qcjs.ValidationError)(
1419
1419
  `kind must be one of ${[...ALLOWED_KINDS].sort().join(", ")}, got ${JSON.stringify(kind)}`
1420
1420
  );
1421
1421
  }
@@ -1423,7 +1423,7 @@ function listParams(pageSize, pageToken, kind, source, sourceRef) {
1423
1423
  if (kind !== void 0) extra.kind = kind;
1424
1424
  if (source !== void 0) extra.source = source;
1425
1425
  if (sourceRef !== void 0) extra.sourceRef = sourceRef;
1426
- return _chunk3MHHVC6Ccjs.aipListParams.call(void 0, pageSize, pageToken, extra);
1426
+ return _chunkQHA3LF2Qcjs.aipListParams.call(void 0, pageSize, pageToken, extra);
1427
1427
  }
1428
1428
  function parseListItem(raw) {
1429
1429
  return raw;
@@ -1450,16 +1450,16 @@ var ModusConversationsResource = class extends ModusConversationsResourceBase {
1450
1450
  */
1451
1451
  list(options = {}) {
1452
1452
  const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
1453
- _chunk3MHHVC6Ccjs.validatePageSize.call(void 0, pageSize);
1453
+ _chunkQHA3LF2Qcjs.validatePageSize.call(void 0, pageSize);
1454
1454
  return this.listPage(pageSize, options.pageToken, options.kind, options.source, options.sourceRef);
1455
1455
  }
1456
1456
  async listPage(pageSize, pageToken, kind, source, sourceRef) {
1457
- const data = _chunk3MHHVC6Ccjs.asRecord.call(void 0,
1458
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "ModusConversationsController_list", {
1457
+ const data = _chunkQHA3LF2Qcjs.asRecord.call(void 0,
1458
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ModusConversationsController_list", {
1459
1459
  query: listParams(pageSize, pageToken, kind, source, sourceRef)
1460
1460
  })
1461
1461
  );
1462
- return _chunk3MHHVC6Ccjs.buildAipPage.call(void 0,
1462
+ return _chunkQHA3LF2Qcjs.buildAipPage.call(void 0,
1463
1463
  data,
1464
1464
  "conversations",
1465
1465
  parseListItem,
@@ -1492,8 +1492,8 @@ var ModusResource = class {
1492
1492
  * ```
1493
1493
  */
1494
1494
  async getContext(message, options = {}) {
1495
- const data = await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "ModusContextComposeController_compose", {
1496
- jsonBody: _chunk3MHHVC6Ccjs.omitUndefined.call(void 0, { message, limit: options.limit })
1495
+ const data = await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ModusContextComposeController_compose", {
1496
+ jsonBody: _chunkQHA3LF2Qcjs.omitUndefined.call(void 0, { message, limit: options.limit })
1497
1497
  });
1498
1498
  return data;
1499
1499
  }
@@ -1560,7 +1560,7 @@ var ScopesResourceBase = class {
1560
1560
  */
1561
1561
  list(options = {}) {
1562
1562
  const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
1563
- _chunk3MHHVC6Ccjs.validatePageSize.call(void 0, pageSize);
1563
+ _chunkQHA3LF2Qcjs.validatePageSize.call(void 0, pageSize);
1564
1564
  return this.listPage(pageSize, options.pageToken, options.search, options.view, options.managerId);
1565
1565
  }
1566
1566
  async listPage(pageSize, pageToken, search, view, managerId) {
@@ -1568,12 +1568,12 @@ var ScopesResourceBase = class {
1568
1568
  if (search !== void 0) extra.search = search;
1569
1569
  if (view !== void 0) extra.view = view;
1570
1570
  if (managerId !== void 0) extra.managerId = managerId;
1571
- const data = _chunk3MHHVC6Ccjs.asRecord.call(void 0,
1572
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "ScopesController_list", {
1573
- query: _chunk3MHHVC6Ccjs.aipListParams.call(void 0, pageSize, pageToken, extra)
1571
+ const data = _chunkQHA3LF2Qcjs.asRecord.call(void 0,
1572
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ScopesController_list", {
1573
+ query: _chunkQHA3LF2Qcjs.aipListParams.call(void 0, pageSize, pageToken, extra)
1574
1574
  })
1575
1575
  );
1576
- return _chunk3MHHVC6Ccjs.buildAipPage.call(void 0,
1576
+ return _chunkQHA3LF2Qcjs.buildAipPage.call(void 0,
1577
1577
  data,
1578
1578
  "scopes",
1579
1579
  (raw) => raw,
@@ -1601,8 +1601,8 @@ var ScopesResourceBase = class {
1601
1601
  * ```
1602
1602
  */
1603
1603
  async get(scopeId, options = {}) {
1604
- _chunk3MHHVC6Ccjs.validateId.call(void 0, scopeId, "scope_id");
1605
- const data = await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "ScopesController_get", {
1604
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, scopeId, "scope_id");
1605
+ const data = await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ScopesController_get", {
1606
1606
  pathParams: { id: scopeId },
1607
1607
  query: { view: options.view }
1608
1608
  });
@@ -1628,7 +1628,7 @@ var ScopesResource = class extends ScopesResourceBase {
1628
1628
  * ```
1629
1629
  */
1630
1630
  conversations(scopeId) {
1631
- return new (0, _chunk3MHHVC6Ccjs.ScopeConversationsResource)(this.http, this.config, scopeId);
1631
+ return new (0, _chunkQHA3LF2Qcjs.ScopeConversationsResource)(this.http, this.config, scopeId);
1632
1632
  }
1633
1633
  /**
1634
1634
  * Compose context this scope would use for an intent, without running chat.
@@ -1652,10 +1652,10 @@ var ScopesResource = class extends ScopesResourceBase {
1652
1652
  * ```
1653
1653
  */
1654
1654
  async getContext(scopeId, message, options = {}) {
1655
- _chunk3MHHVC6Ccjs.validateId.call(void 0, scopeId, "scope_id");
1656
- const data = await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "ScopeContextComposeController_compose", {
1655
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, scopeId, "scope_id");
1656
+ const data = await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ScopeContextComposeController_compose", {
1657
1657
  pathParams: { id: scopeId },
1658
- jsonBody: _chunk3MHHVC6Ccjs.omitUndefined.call(void 0, { message, limit: options.limit })
1658
+ jsonBody: _chunkQHA3LF2Qcjs.omitUndefined.call(void 0, { message, limit: options.limit })
1659
1659
  });
1660
1660
  return data;
1661
1661
  }
@@ -1721,19 +1721,19 @@ var SuggestionsResource = class {
1721
1721
  */
1722
1722
  list(options = {}) {
1723
1723
  const pageSize = _nullishCoalesce(options.pageSize, () => ( DEFAULT_SUGGESTIONS_PAGE_SIZE));
1724
- _chunk3MHHVC6Ccjs.validatePageSize.call(void 0, pageSize, MAX_SUGGESTIONS_PAGE_SIZE);
1724
+ _chunkQHA3LF2Qcjs.validatePageSize.call(void 0, pageSize, MAX_SUGGESTIONS_PAGE_SIZE);
1725
1725
  if (_optionalChain([options, 'access', _27 => _27.scopeIds, 'optionalAccess', _28 => _28.length]) === 0) {
1726
- throw new (0, _chunk3MHHVC6Ccjs.ValidationError)("scopeIds requires at least one id; omit it to list suggestions for every scope");
1726
+ throw new (0, _chunkQHA3LF2Qcjs.ValidationError)("scopeIds requires at least one id; omit it to list suggestions for every scope");
1727
1727
  }
1728
1728
  return this.listPage(pageSize, options.pageToken, options.scopeId, options.scopeIds);
1729
1729
  }
1730
1730
  async listPage(pageSize, pageToken, scopeId, scopeIds) {
1731
- const data = _chunk3MHHVC6Ccjs.asRecord.call(void 0,
1732
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "SuggestionsController_listApproved", {
1731
+ const data = _chunkQHA3LF2Qcjs.asRecord.call(void 0,
1732
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "SuggestionsController_listApproved", {
1733
1733
  query: suggestionListParams({ pageSize, pageToken, scopeId, scopeIds })
1734
1734
  })
1735
1735
  );
1736
- return _chunk3MHHVC6Ccjs.buildAipPage.call(void 0,
1736
+ return _chunkQHA3LF2Qcjs.buildAipPage.call(void 0,
1737
1737
  data,
1738
1738
  "suggestions",
1739
1739
  parseSuggestion,
@@ -1747,8 +1747,8 @@ var SuggestionsResource = class {
1747
1747
  * @param event - Event details, including `eventType` (`shown`, `clicked`, `dismissed`, or `submitted`).
1748
1748
  */
1749
1749
  async recordEvent(id, event) {
1750
- _chunk3MHHVC6Ccjs.validateId.call(void 0, id, "id");
1751
- await _chunk3MHHVC6Ccjs.invokeWithRetry.call(void 0, this.config, this.http, "SuggestionsController_recordEvent", {
1750
+ _chunkQHA3LF2Qcjs.validateId.call(void 0, id, "id");
1751
+ await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "SuggestionsController_recordEvent", {
1752
1752
  pathParams: { id },
1753
1753
  jsonBody: event
1754
1754
  });
@@ -1756,7 +1756,7 @@ var SuggestionsResource = class {
1756
1756
  };
1757
1757
 
1758
1758
  // src/index.ts
1759
- var Modus = class extends _chunk3MHHVC6Ccjs.ModusClientBase {
1759
+ var Modus = class extends _chunkQHA3LF2Qcjs.ModusClientBase {
1760
1760
  constructor(options = {}) {
1761
1761
  super(options);
1762
1762
  this.scopes = new ScopesResource(this.http, this.config);
@@ -1790,5 +1790,5 @@ var Modus = class extends _chunk3MHHVC6Ccjs.ModusClientBase {
1790
1790
 
1791
1791
 
1792
1792
 
1793
- exports.APIConnectionError = _chunk3MHHVC6Ccjs.APIConnectionError; exports.AgentType = AgentType; exports.AuthenticationError = _chunk3MHHVC6Ccjs.AuthenticationError; exports.BadRequestError = _chunk3MHHVC6Ccjs.BadRequestError; exports.ChatSession = ChatSession; exports.ConflictError = _chunk3MHHVC6Ccjs.ConflictError; exports.InternalServerError = _chunk3MHHVC6Ccjs.InternalServerError; exports.Modus = Modus; exports.ModusError = _chunk3MHHVC6Ccjs.ModusError; exports.NotFoundError = _chunk3MHHVC6Ccjs.NotFoundError; exports.OPERATIONS = _chunk3MHHVC6Ccjs.OPERATIONS; exports.Page = _chunk3MHHVC6Ccjs.Page; exports.PermissionDeniedError = _chunk3MHHVC6Ccjs.PermissionDeniedError; exports.RateLimitError = _chunk3MHHVC6Ccjs.RateLimitError; exports.RunCancelledError = _chunk3MHHVC6Ccjs.RunCancelledError; exports.StreamTimeoutError = _chunk3MHHVC6Ccjs.StreamTimeoutError; exports.UnprocessableError = _chunk3MHHVC6Ccjs.UnprocessableError; exports.ValidationError = _chunk3MHHVC6Ccjs.ValidationError; exports.WorkflowType = WorkflowType; exports.conversationScopeId = conversationScopeId; exports.conversationSkillId = conversationSkillId;
1793
+ exports.APIConnectionError = _chunkQHA3LF2Qcjs.APIConnectionError; exports.AgentType = AgentType; exports.AuthenticationError = _chunkQHA3LF2Qcjs.AuthenticationError; exports.BadRequestError = _chunkQHA3LF2Qcjs.BadRequestError; exports.ChatSession = ChatSession; exports.ConflictError = _chunkQHA3LF2Qcjs.ConflictError; exports.InternalServerError = _chunkQHA3LF2Qcjs.InternalServerError; exports.Modus = Modus; exports.ModusError = _chunkQHA3LF2Qcjs.ModusError; exports.NotFoundError = _chunkQHA3LF2Qcjs.NotFoundError; exports.OPERATIONS = _chunkQHA3LF2Qcjs.OPERATIONS; exports.Page = _chunkQHA3LF2Qcjs.Page; exports.PermissionDeniedError = _chunkQHA3LF2Qcjs.PermissionDeniedError; exports.RateLimitError = _chunkQHA3LF2Qcjs.RateLimitError; exports.RunCancelledError = _chunkQHA3LF2Qcjs.RunCancelledError; exports.StreamTimeoutError = _chunkQHA3LF2Qcjs.StreamTimeoutError; exports.UnprocessableError = _chunkQHA3LF2Qcjs.UnprocessableError; exports.ValidationError = _chunkQHA3LF2Qcjs.ValidationError; exports.WorkflowType = WorkflowType; exports.conversationScopeId = conversationScopeId; exports.conversationSkillId = conversationSkillId;
1794
1794
  //# sourceMappingURL=index.cjs.map