@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/CHANGELOG.md +50 -3
- package/dist/{_client-base-DdnxB9JA.d.cts → _client-base-CGqIZtrm.d.cts} +492 -214
- package/dist/{_client-base-DdnxB9JA.d.ts → _client-base-CGqIZtrm.d.ts} +492 -214
- package/dist/{chunk-JVTQBBMZ.js → chunk-KX2P3TAH.js} +64 -23
- package/dist/chunk-KX2P3TAH.js.map +1 -0
- package/dist/{chunk-3MHHVC6C.cjs → chunk-RK4NLJIN.cjs} +64 -23
- package/dist/chunk-RK4NLJIN.cjs.map +1 -0
- package/dist/index.cjs +128 -174
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -46
- package/dist/index.d.ts +21 -46
- package/dist/index.js +12 -58
- package/dist/index.js.map +1 -1
- package/dist/management/index.cjs +272 -261
- package/dist/management/index.cjs.map +1 -1
- package/dist/management/index.d.cts +27 -6
- package/dist/management/index.d.ts +27 -6
- package/dist/management/index.js +16 -5
- package/dist/management/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3MHHVC6C.cjs.map +0 -1
- package/dist/chunk-JVTQBBMZ.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkRK4NLJINcjs = require('./chunk-RK4NLJIN.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,
|
|
165
|
-
if (event.type === "cancelled") throw new (0,
|
|
166
|
-
if (event.type === "stream_timeout") throw new (0,
|
|
164
|
+
if (event.type === "error") throw new (0, _chunkRK4NLJINcjs.ModusError)(event.message, { requestId: event.requestId });
|
|
165
|
+
if (event.type === "cancelled") throw new (0, _chunkRK4NLJINcjs.RunCancelledError)();
|
|
166
|
+
if (event.type === "stream_timeout") throw new (0, _chunkRK4NLJINcjs.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,
|
|
226
|
+
if (this.final === void 0) throw new (0, _chunkRK4NLJINcjs.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,
|
|
260
|
+
throw new (0, _chunkRK4NLJINcjs.ModusError)("resume() needs a finished run: await the chat first");
|
|
261
261
|
}
|
|
262
262
|
const { runId, threadId } = this.final;
|
|
263
|
-
|
|
263
|
+
_chunkRK4NLJINcjs.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")
|
|
335
|
-
|
|
336
|
-
|
|
334
|
+
if (target.kind !== "modus") _chunkRK4NLJINcjs.validateId.call(void 0, target.id, `${target.kind.slice(0, -1)}_id`);
|
|
335
|
+
const runsWithOwnModels = target.kind === "workflows";
|
|
336
|
+
if (!runsWithOwnModels) _chunkRK4NLJINcjs.validateChatModel.call(void 0, options.model);
|
|
337
|
+
const baseUrl = _chunkRK4NLJINcjs.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
|
-
|
|
403
|
+
_chunkRK4NLJINcjs.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 =
|
|
412
|
-
await
|
|
413
|
-
query:
|
|
412
|
+
const data = _chunkRK4NLJINcjs.asRecord.call(void 0,
|
|
413
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowsController_list", {
|
|
414
|
+
query: _chunkRK4NLJINcjs.aipListParams.call(void 0, pageSize, pageToken, extra)
|
|
414
415
|
})
|
|
415
416
|
);
|
|
416
|
-
return
|
|
417
|
+
return _chunkRK4NLJINcjs.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 =
|
|
431
|
+
const token = _chunkRK4NLJINcjs.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 =
|
|
441
|
+
const token = _chunkRK4NLJINcjs.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 =
|
|
449
|
+
const data = _chunkRK4NLJINcjs.asRecord.call(void 0, raw);
|
|
449
450
|
const runs = data.runs;
|
|
450
451
|
if (!Array.isArray(runs)) {
|
|
451
|
-
throw new (0,
|
|
452
|
+
throw new (0, _chunkRK4NLJINcjs.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 =
|
|
459
|
+
const data = _chunkRK4NLJINcjs.asRecord.call(void 0, raw);
|
|
459
460
|
const runs = data.runs;
|
|
460
461
|
if (!Array.isArray(runs)) {
|
|
461
|
-
throw new (0,
|
|
462
|
+
throw new (0, _chunkRK4NLJINcjs.ModusError)(
|
|
462
463
|
`Unexpected active runs response shape: runs must be a list, got ${typeof runs}.`
|
|
463
464
|
);
|
|
464
465
|
}
|
|
465
|
-
return new (0,
|
|
466
|
+
return new (0, _chunkRK4NLJINcjs.Page)(
|
|
466
467
|
runs,
|
|
467
|
-
|
|
468
|
+
_chunkRK4NLJINcjs.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,
|
|
482
|
+
throw new (0, _chunkRK4NLJINcjs.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
|
-
|
|
522
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, workflowId, "workflow_id");
|
|
522
523
|
const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
|
|
523
|
-
|
|
524
|
+
_chunkRK4NLJINcjs.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 =
|
|
528
|
-
await
|
|
528
|
+
const data = _chunkRK4NLJINcjs.asRecord.call(void 0,
|
|
529
|
+
await _chunkRK4NLJINcjs.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,
|
|
543
|
+
throw new (0, _chunkRK4NLJINcjs.ModusError)(
|
|
543
544
|
`Unexpected list response shape: runs must be a list, got ${typeof runs}.`
|
|
544
545
|
);
|
|
545
546
|
}
|
|
546
|
-
return new (0,
|
|
547
|
+
return new (0, _chunkRK4NLJINcjs.Page)(
|
|
547
548
|
runs,
|
|
548
|
-
|
|
549
|
+
_chunkRK4NLJINcjs.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
|
-
|
|
571
|
-
if (!runId.trim()) throw new (0,
|
|
571
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, workflowId, "workflow_id");
|
|
572
|
+
if (!runId.trim()) throw new (0, _chunkRK4NLJINcjs.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
|
|
574
|
+
const data = await _chunkRK4NLJINcjs.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
|
-
|
|
601
|
+
_chunkRK4NLJINcjs.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
|
-
|
|
626
|
+
_chunkRK4NLJINcjs.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
|
-
|
|
674
|
+
_chunkRK4NLJINcjs.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
|
-
|
|
689
|
-
await
|
|
689
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, runId, "run_id");
|
|
690
|
+
await _chunkRK4NLJINcjs.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
|
-
|
|
703
|
-
return await
|
|
703
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, runId, "run_id");
|
|
704
|
+
return await _chunkRK4NLJINcjs.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
|
-
|
|
735
|
+
_chunkRK4NLJINcjs.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
|
|
741
|
+
return await _chunkRK4NLJINcjs.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
|
-
|
|
764
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, runId, "run_id");
|
|
764
765
|
requireSessionId(nextRun.sessionId);
|
|
765
|
-
return await
|
|
766
|
+
return await _chunkRK4NLJINcjs.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
|
-
|
|
780
|
+
_chunkRK4NLJINcjs.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
|
|
785
|
+
await _chunkRK4NLJINcjs.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,
|
|
801
|
+
throw new (0, _chunkRK4NLJINcjs.ValidationError)("sessionIds must contain at most 100 ids");
|
|
801
802
|
}
|
|
802
803
|
return parseActiveRunsArray(
|
|
803
|
-
await
|
|
804
|
+
await _chunkRK4NLJINcjs.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
|
-
|
|
827
|
-
const op =
|
|
828
|
-
const path =
|
|
827
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, runId, "run_id");
|
|
828
|
+
const op = _chunkRK4NLJINcjs.getOperation.call(void 0, "RunLifecycleController_stream");
|
|
829
|
+
const path = _chunkRK4NLJINcjs.formatOperationPath.call(void 0, "RunLifecycleController_stream", { runId });
|
|
829
830
|
const lines = this.http.streamGet(path, void 0, {
|
|
830
|
-
baseUrl:
|
|
831
|
+
baseUrl: _chunkRK4NLJINcjs.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 =
|
|
839
|
-
const path =
|
|
839
|
+
const op = _chunkRK4NLJINcjs.getOperation.call(void 0, operationId);
|
|
840
|
+
const path = _chunkRK4NLJINcjs.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:
|
|
846
|
+
baseUrl: _chunkRK4NLJINcjs.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 =
|
|
876
|
-
const path =
|
|
876
|
+
const op = _chunkRK4NLJINcjs.getOperation.call(void 0, "WorkflowActionsController_execute");
|
|
877
|
+
const path = _chunkRK4NLJINcjs.formatOperationPath.call(void 0, "WorkflowActionsController_execute");
|
|
877
878
|
const lines = this.http.streamPost(path, body, {
|
|
878
|
-
baseUrl:
|
|
879
|
+
baseUrl: _chunkRK4NLJINcjs.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
|
-
|
|
890
|
-
await
|
|
890
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, runId, "run_id");
|
|
891
|
+
await _chunkRK4NLJINcjs.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
|
-
|
|
929
|
+
_chunkRK4NLJINcjs.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
|
|
935
|
+
const data = await _chunkRK4NLJINcjs.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
|
-
*
|
|
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 -
|
|
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
|
|
955
|
-
*
|
|
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
|
-
|
|
989
|
+
_chunkRK4NLJINcjs.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 =
|
|
996
|
-
await
|
|
997
|
-
query:
|
|
995
|
+
const data = _chunkRK4NLJINcjs.asRecord.call(void 0,
|
|
996
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "ConnectionsController_list", {
|
|
997
|
+
query: _chunkRK4NLJINcjs.aipListParams.call(void 0, pageSize, pageToken, extra)
|
|
998
998
|
})
|
|
999
999
|
);
|
|
1000
|
-
return
|
|
1000
|
+
return _chunkRK4NLJINcjs.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
|
-
|
|
1023
|
+
_chunkRK4NLJINcjs.validatePageSize.call(void 0, pageSize);
|
|
1024
1024
|
const target = options.name.trim().toLowerCase();
|
|
1025
1025
|
let token;
|
|
1026
1026
|
do {
|
|
@@ -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
|
-
_chunk3MHHVC6Ccjs.validateId.call(void 0, connectionId, "connection_id");
|
|
1049
|
-
const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
|
|
1050
|
-
_chunk3MHHVC6Ccjs.validatePageSize.call(void 0, pageSize);
|
|
1051
|
-
return this.listSelectionsPage(connectionId, pageSize, options.pageToken);
|
|
1052
|
-
}
|
|
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", {
|
|
1056
|
-
pathParams: { connectionId },
|
|
1057
|
-
query: _chunk3MHHVC6Ccjs.aipListParams.call(void 0, pageSize, pageToken)
|
|
1058
|
-
})
|
|
1059
|
-
);
|
|
1060
|
-
return _chunk3MHHVC6Ccjs.buildAipPage.call(void 0,
|
|
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
|
|
@@ -1107,8 +1061,8 @@ var ContextItemsResourceBase = class {
|
|
|
1107
1061
|
* ```
|
|
1108
1062
|
*/
|
|
1109
1063
|
async query(query) {
|
|
1110
|
-
const data = await
|
|
1111
|
-
jsonBody:
|
|
1064
|
+
const data = await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsQueryController_query", {
|
|
1065
|
+
jsonBody: _chunkRK4NLJINcjs.omitUndefined.call(void 0, query)
|
|
1112
1066
|
});
|
|
1113
1067
|
return data;
|
|
1114
1068
|
}
|
|
@@ -1127,7 +1081,7 @@ function contextListParams(pageSize, pageToken, filters = {}) {
|
|
|
1127
1081
|
if (filters.connectionIds !== void 0) {
|
|
1128
1082
|
extra.connectionIds = filters.connectionIds.length === 0 ? "" : [...filters.connectionIds];
|
|
1129
1083
|
}
|
|
1130
|
-
return
|
|
1084
|
+
return _chunkRK4NLJINcjs.aipListParams.call(void 0, pageSize, pageToken, extra);
|
|
1131
1085
|
}
|
|
1132
1086
|
function parseContextItem(raw) {
|
|
1133
1087
|
return raw;
|
|
@@ -1189,7 +1143,7 @@ var ContextItemsResource = class extends ContextItemsResourceBase {
|
|
|
1189
1143
|
*/
|
|
1190
1144
|
list(options = {}) {
|
|
1191
1145
|
const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
|
|
1192
|
-
|
|
1146
|
+
_chunkRK4NLJINcjs.validatePageSize.call(void 0, pageSize);
|
|
1193
1147
|
return this.listPage(pageSize, options.pageToken, {
|
|
1194
1148
|
contextType: options.contextType,
|
|
1195
1149
|
parentUids: options.parentUids,
|
|
@@ -1198,12 +1152,12 @@ var ContextItemsResource = class extends ContextItemsResourceBase {
|
|
|
1198
1152
|
});
|
|
1199
1153
|
}
|
|
1200
1154
|
async listPage(pageSize, pageToken, filters) {
|
|
1201
|
-
const data =
|
|
1202
|
-
await
|
|
1155
|
+
const data = _chunkRK4NLJINcjs.asRecord.call(void 0,
|
|
1156
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsController_list", {
|
|
1203
1157
|
query: contextListParams(pageSize, pageToken, filters)
|
|
1204
1158
|
})
|
|
1205
1159
|
);
|
|
1206
|
-
return
|
|
1160
|
+
return _chunkRK4NLJINcjs.buildAipPage.call(void 0,
|
|
1207
1161
|
data,
|
|
1208
1162
|
"contextItems",
|
|
1209
1163
|
parseContextItem,
|
|
@@ -1224,7 +1178,7 @@ var ContextItemsResource = class extends ContextItemsResourceBase {
|
|
|
1224
1178
|
* ```
|
|
1225
1179
|
*/
|
|
1226
1180
|
async get(uid) {
|
|
1227
|
-
const data = await
|
|
1181
|
+
const data = await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsController_get", {
|
|
1228
1182
|
pathParams: { uid }
|
|
1229
1183
|
});
|
|
1230
1184
|
return parseContextItem(data);
|
|
@@ -1247,20 +1201,20 @@ var ContextItemsResource = class extends ContextItemsResourceBase {
|
|
|
1247
1201
|
* ```
|
|
1248
1202
|
*/
|
|
1249
1203
|
async lookup(options) {
|
|
1250
|
-
const body =
|
|
1204
|
+
const body = _chunkRK4NLJINcjs.omitUndefined.call(void 0, {
|
|
1251
1205
|
contextType: options.contextType,
|
|
1252
1206
|
dataPath: options.dataPath,
|
|
1253
1207
|
contentProjection: options.contentProjection
|
|
1254
1208
|
});
|
|
1255
1209
|
try {
|
|
1256
|
-
const raw =
|
|
1257
|
-
await
|
|
1210
|
+
const raw = _chunkRK4NLJINcjs.asRecord.call(void 0,
|
|
1211
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsController_lookup", {
|
|
1258
1212
|
jsonBody: body
|
|
1259
1213
|
})
|
|
1260
1214
|
);
|
|
1261
1215
|
return parseLookupResponse(raw);
|
|
1262
1216
|
} catch (error) {
|
|
1263
|
-
if (error instanceof
|
|
1217
|
+
if (error instanceof _chunkRK4NLJINcjs.NotFoundError) return void 0;
|
|
1264
1218
|
throw error;
|
|
1265
1219
|
}
|
|
1266
1220
|
}
|
|
@@ -1293,7 +1247,7 @@ var ContextItemsResource = class extends ContextItemsResourceBase {
|
|
|
1293
1247
|
*/
|
|
1294
1248
|
listValues(uid, contextType, contentKeyPath, options = {}) {
|
|
1295
1249
|
const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
|
|
1296
|
-
|
|
1250
|
+
_chunkRK4NLJINcjs.validatePageSize.call(void 0, pageSize, _chunkRK4NLJINcjs.DEFAULT_MAX_PAGE_SIZE);
|
|
1297
1251
|
return this.listValuesPage(uid, contextType, contentKeyPath, pageSize, options.pageToken);
|
|
1298
1252
|
}
|
|
1299
1253
|
/**
|
|
@@ -1317,16 +1271,16 @@ var ContextItemsResource = class extends ContextItemsResourceBase {
|
|
|
1317
1271
|
return this.listValues(item.uid, item.contextType, contentKeyPath, options);
|
|
1318
1272
|
}
|
|
1319
1273
|
async listValuesPage(uid, contextType, contentKeyPath, pageSize, pageToken) {
|
|
1320
|
-
const data =
|
|
1321
|
-
await
|
|
1274
|
+
const data = _chunkRK4NLJINcjs.asRecord.call(void 0,
|
|
1275
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "ContextItemsController_listValues", {
|
|
1322
1276
|
pathParams: { uid },
|
|
1323
|
-
query:
|
|
1277
|
+
query: _chunkRK4NLJINcjs.aipListParams.call(void 0, pageSize, pageToken, {
|
|
1324
1278
|
contextType,
|
|
1325
1279
|
contentKeyPath
|
|
1326
1280
|
})
|
|
1327
1281
|
})
|
|
1328
1282
|
);
|
|
1329
|
-
return
|
|
1283
|
+
return _chunkRK4NLJINcjs.buildAipPage.call(void 0,
|
|
1330
1284
|
data,
|
|
1331
1285
|
"values",
|
|
1332
1286
|
parseContextValueRow,
|
|
@@ -1340,7 +1294,7 @@ var ContextResource = class {
|
|
|
1340
1294
|
/** @internal */
|
|
1341
1295
|
constructor(http, config) {
|
|
1342
1296
|
this.items = new ContextItemsResource(http, config);
|
|
1343
|
-
this.customItems = new (0,
|
|
1297
|
+
this.customItems = new (0, _chunkRK4NLJINcjs.CustomContextItemsResource)(http, config);
|
|
1344
1298
|
}
|
|
1345
1299
|
};
|
|
1346
1300
|
|
|
@@ -1375,7 +1329,7 @@ var IngestedDataResource = class {
|
|
|
1375
1329
|
* ```
|
|
1376
1330
|
*/
|
|
1377
1331
|
async upload(options) {
|
|
1378
|
-
const data = await
|
|
1332
|
+
const data = await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "IngestedDataController_upload", {
|
|
1379
1333
|
jsonBody: {
|
|
1380
1334
|
integration_type: options.integrationType,
|
|
1381
1335
|
request: options.request,
|
|
@@ -1403,8 +1357,8 @@ var ModusConversationsResourceBase = class {
|
|
|
1403
1357
|
* @param threadId - Thread id from a conversation list or chat response.
|
|
1404
1358
|
*/
|
|
1405
1359
|
async get(threadId) {
|
|
1406
|
-
|
|
1407
|
-
const data = await
|
|
1360
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, threadId, "thread_id");
|
|
1361
|
+
const data = await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "ModusConversationsController_get", {
|
|
1408
1362
|
pathParams: { threadId }
|
|
1409
1363
|
});
|
|
1410
1364
|
return data;
|
|
@@ -1415,7 +1369,7 @@ var ModusConversationsResourceBase = class {
|
|
|
1415
1369
|
var ALLOWED_KINDS = /* @__PURE__ */ new Set(["all", "modus", "scopes"]);
|
|
1416
1370
|
function listParams(pageSize, pageToken, kind, source, sourceRef) {
|
|
1417
1371
|
if (kind !== void 0 && !ALLOWED_KINDS.has(kind)) {
|
|
1418
|
-
throw new (0,
|
|
1372
|
+
throw new (0, _chunkRK4NLJINcjs.ValidationError)(
|
|
1419
1373
|
`kind must be one of ${[...ALLOWED_KINDS].sort().join(", ")}, got ${JSON.stringify(kind)}`
|
|
1420
1374
|
);
|
|
1421
1375
|
}
|
|
@@ -1423,7 +1377,7 @@ function listParams(pageSize, pageToken, kind, source, sourceRef) {
|
|
|
1423
1377
|
if (kind !== void 0) extra.kind = kind;
|
|
1424
1378
|
if (source !== void 0) extra.source = source;
|
|
1425
1379
|
if (sourceRef !== void 0) extra.sourceRef = sourceRef;
|
|
1426
|
-
return
|
|
1380
|
+
return _chunkRK4NLJINcjs.aipListParams.call(void 0, pageSize, pageToken, extra);
|
|
1427
1381
|
}
|
|
1428
1382
|
function parseListItem(raw) {
|
|
1429
1383
|
return raw;
|
|
@@ -1450,16 +1404,16 @@ var ModusConversationsResource = class extends ModusConversationsResourceBase {
|
|
|
1450
1404
|
*/
|
|
1451
1405
|
list(options = {}) {
|
|
1452
1406
|
const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
|
|
1453
|
-
|
|
1407
|
+
_chunkRK4NLJINcjs.validatePageSize.call(void 0, pageSize);
|
|
1454
1408
|
return this.listPage(pageSize, options.pageToken, options.kind, options.source, options.sourceRef);
|
|
1455
1409
|
}
|
|
1456
1410
|
async listPage(pageSize, pageToken, kind, source, sourceRef) {
|
|
1457
|
-
const data =
|
|
1458
|
-
await
|
|
1411
|
+
const data = _chunkRK4NLJINcjs.asRecord.call(void 0,
|
|
1412
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "ModusConversationsController_list", {
|
|
1459
1413
|
query: listParams(pageSize, pageToken, kind, source, sourceRef)
|
|
1460
1414
|
})
|
|
1461
1415
|
);
|
|
1462
|
-
return
|
|
1416
|
+
return _chunkRK4NLJINcjs.buildAipPage.call(void 0,
|
|
1463
1417
|
data,
|
|
1464
1418
|
"conversations",
|
|
1465
1419
|
parseListItem,
|
|
@@ -1492,8 +1446,8 @@ var ModusResource = class {
|
|
|
1492
1446
|
* ```
|
|
1493
1447
|
*/
|
|
1494
1448
|
async getContext(message, options = {}) {
|
|
1495
|
-
const data = await
|
|
1496
|
-
jsonBody:
|
|
1449
|
+
const data = await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "ModusContextComposeController_compose", {
|
|
1450
|
+
jsonBody: _chunkRK4NLJINcjs.omitUndefined.call(void 0, { message, limit: options.limit })
|
|
1497
1451
|
});
|
|
1498
1452
|
return data;
|
|
1499
1453
|
}
|
|
@@ -1560,7 +1514,7 @@ var ScopesResourceBase = class {
|
|
|
1560
1514
|
*/
|
|
1561
1515
|
list(options = {}) {
|
|
1562
1516
|
const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
|
|
1563
|
-
|
|
1517
|
+
_chunkRK4NLJINcjs.validatePageSize.call(void 0, pageSize);
|
|
1564
1518
|
return this.listPage(pageSize, options.pageToken, options.search, options.view, options.managerId);
|
|
1565
1519
|
}
|
|
1566
1520
|
async listPage(pageSize, pageToken, search, view, managerId) {
|
|
@@ -1568,12 +1522,12 @@ var ScopesResourceBase = class {
|
|
|
1568
1522
|
if (search !== void 0) extra.search = search;
|
|
1569
1523
|
if (view !== void 0) extra.view = view;
|
|
1570
1524
|
if (managerId !== void 0) extra.managerId = managerId;
|
|
1571
|
-
const data =
|
|
1572
|
-
await
|
|
1573
|
-
query:
|
|
1525
|
+
const data = _chunkRK4NLJINcjs.asRecord.call(void 0,
|
|
1526
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "ScopesController_list", {
|
|
1527
|
+
query: _chunkRK4NLJINcjs.aipListParams.call(void 0, pageSize, pageToken, extra)
|
|
1574
1528
|
})
|
|
1575
1529
|
);
|
|
1576
|
-
return
|
|
1530
|
+
return _chunkRK4NLJINcjs.buildAipPage.call(void 0,
|
|
1577
1531
|
data,
|
|
1578
1532
|
"scopes",
|
|
1579
1533
|
(raw) => raw,
|
|
@@ -1601,8 +1555,8 @@ var ScopesResourceBase = class {
|
|
|
1601
1555
|
* ```
|
|
1602
1556
|
*/
|
|
1603
1557
|
async get(scopeId, options = {}) {
|
|
1604
|
-
|
|
1605
|
-
const data = await
|
|
1558
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, scopeId, "scope_id");
|
|
1559
|
+
const data = await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "ScopesController_get", {
|
|
1606
1560
|
pathParams: { id: scopeId },
|
|
1607
1561
|
query: { view: options.view }
|
|
1608
1562
|
});
|
|
@@ -1628,7 +1582,7 @@ var ScopesResource = class extends ScopesResourceBase {
|
|
|
1628
1582
|
* ```
|
|
1629
1583
|
*/
|
|
1630
1584
|
conversations(scopeId) {
|
|
1631
|
-
return new (0,
|
|
1585
|
+
return new (0, _chunkRK4NLJINcjs.ScopeConversationsResource)(this.http, this.config, scopeId);
|
|
1632
1586
|
}
|
|
1633
1587
|
/**
|
|
1634
1588
|
* Compose context this scope would use for an intent, without running chat.
|
|
@@ -1652,10 +1606,10 @@ var ScopesResource = class extends ScopesResourceBase {
|
|
|
1652
1606
|
* ```
|
|
1653
1607
|
*/
|
|
1654
1608
|
async getContext(scopeId, message, options = {}) {
|
|
1655
|
-
|
|
1656
|
-
const data = await
|
|
1609
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, scopeId, "scope_id");
|
|
1610
|
+
const data = await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "ScopeContextComposeController_compose", {
|
|
1657
1611
|
pathParams: { id: scopeId },
|
|
1658
|
-
jsonBody:
|
|
1612
|
+
jsonBody: _chunkRK4NLJINcjs.omitUndefined.call(void 0, { message, limit: options.limit })
|
|
1659
1613
|
});
|
|
1660
1614
|
return data;
|
|
1661
1615
|
}
|
|
@@ -1721,19 +1675,19 @@ var SuggestionsResource = class {
|
|
|
1721
1675
|
*/
|
|
1722
1676
|
list(options = {}) {
|
|
1723
1677
|
const pageSize = _nullishCoalesce(options.pageSize, () => ( DEFAULT_SUGGESTIONS_PAGE_SIZE));
|
|
1724
|
-
|
|
1678
|
+
_chunkRK4NLJINcjs.validatePageSize.call(void 0, pageSize, MAX_SUGGESTIONS_PAGE_SIZE);
|
|
1725
1679
|
if (_optionalChain([options, 'access', _27 => _27.scopeIds, 'optionalAccess', _28 => _28.length]) === 0) {
|
|
1726
|
-
throw new (0,
|
|
1680
|
+
throw new (0, _chunkRK4NLJINcjs.ValidationError)("scopeIds requires at least one id; omit it to list suggestions for every scope");
|
|
1727
1681
|
}
|
|
1728
1682
|
return this.listPage(pageSize, options.pageToken, options.scopeId, options.scopeIds);
|
|
1729
1683
|
}
|
|
1730
1684
|
async listPage(pageSize, pageToken, scopeId, scopeIds) {
|
|
1731
|
-
const data =
|
|
1732
|
-
await
|
|
1685
|
+
const data = _chunkRK4NLJINcjs.asRecord.call(void 0,
|
|
1686
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "SuggestionsController_listApproved", {
|
|
1733
1687
|
query: suggestionListParams({ pageSize, pageToken, scopeId, scopeIds })
|
|
1734
1688
|
})
|
|
1735
1689
|
);
|
|
1736
|
-
return
|
|
1690
|
+
return _chunkRK4NLJINcjs.buildAipPage.call(void 0,
|
|
1737
1691
|
data,
|
|
1738
1692
|
"suggestions",
|
|
1739
1693
|
parseSuggestion,
|
|
@@ -1747,8 +1701,8 @@ var SuggestionsResource = class {
|
|
|
1747
1701
|
* @param event - Event details, including `eventType` (`shown`, `clicked`, `dismissed`, or `submitted`).
|
|
1748
1702
|
*/
|
|
1749
1703
|
async recordEvent(id, event) {
|
|
1750
|
-
|
|
1751
|
-
await
|
|
1704
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, id, "id");
|
|
1705
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "SuggestionsController_recordEvent", {
|
|
1752
1706
|
pathParams: { id },
|
|
1753
1707
|
jsonBody: event
|
|
1754
1708
|
});
|
|
@@ -1756,7 +1710,7 @@ var SuggestionsResource = class {
|
|
|
1756
1710
|
};
|
|
1757
1711
|
|
|
1758
1712
|
// src/index.ts
|
|
1759
|
-
var Modus = class extends
|
|
1713
|
+
var Modus = class extends _chunkRK4NLJINcjs.ModusClientBase {
|
|
1760
1714
|
constructor(options = {}) {
|
|
1761
1715
|
super(options);
|
|
1762
1716
|
this.scopes = new ScopesResource(this.http, this.config);
|
|
@@ -1790,5 +1744,5 @@ var Modus = class extends _chunk3MHHVC6Ccjs.ModusClientBase {
|
|
|
1790
1744
|
|
|
1791
1745
|
|
|
1792
1746
|
|
|
1793
|
-
exports.APIConnectionError =
|
|
1747
|
+
exports.APIConnectionError = _chunkRK4NLJINcjs.APIConnectionError; exports.AgentType = AgentType; exports.AuthenticationError = _chunkRK4NLJINcjs.AuthenticationError; exports.BadRequestError = _chunkRK4NLJINcjs.BadRequestError; exports.ChatSession = ChatSession; exports.ConflictError = _chunkRK4NLJINcjs.ConflictError; exports.InternalServerError = _chunkRK4NLJINcjs.InternalServerError; exports.Modus = Modus; exports.ModusError = _chunkRK4NLJINcjs.ModusError; exports.NotFoundError = _chunkRK4NLJINcjs.NotFoundError; exports.OPERATIONS = _chunkRK4NLJINcjs.OPERATIONS; exports.Page = _chunkRK4NLJINcjs.Page; exports.PermissionDeniedError = _chunkRK4NLJINcjs.PermissionDeniedError; exports.RateLimitError = _chunkRK4NLJINcjs.RateLimitError; exports.RunCancelledError = _chunkRK4NLJINcjs.RunCancelledError; exports.StreamTimeoutError = _chunkRK4NLJINcjs.StreamTimeoutError; exports.UnprocessableError = _chunkRK4NLJINcjs.UnprocessableError; exports.ValidationError = _chunkRK4NLJINcjs.ValidationError; exports.WorkflowType = WorkflowType; exports.conversationScopeId = conversationScopeId; exports.conversationSkillId = conversationSkillId;
|
|
1794
1748
|
//# sourceMappingURL=index.cjs.map
|