@getmodus/sdk 0.12.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 +7 -1
- package/dist/{_client-base-DvrAQWuU.d.cts → _client-base-CGqIZtrm.d.cts} +75 -256
- package/dist/{_client-base-DvrAQWuU.d.ts → _client-base-CGqIZtrm.d.ts} +75 -256
- package/dist/{chunk-3CKUUDEJ.js → chunk-KX2P3TAH.js} +3 -13
- package/dist/chunk-KX2P3TAH.js.map +1 -0
- package/dist/{chunk-QHA3LF2Q.cjs → chunk-RK4NLJIN.cjs} +3 -13
- package/dist/chunk-RK4NLJIN.cjs.map +1 -0
- package/dist/index.cjs +118 -164
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -36
- package/dist/index.d.ts +5 -36
- package/dist/index.js +1 -47
- package/dist/index.js.map +1 -1
- package/dist/management/index.cjs +258 -258
- package/dist/management/index.cjs.map +1 -1
- package/dist/management/index.d.cts +4 -2
- package/dist/management/index.d.ts +4 -2
- package/dist/management/index.js +1 -1
- package/dist/management/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3CKUUDEJ.js.map +0 -1
- package/dist/chunk-QHA3LF2Q.cjs.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,10 +331,10 @@ function startChat(http, config, target, message, options) {
|
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
function chatRequest(config, target, message, options) {
|
|
334
|
-
if (target.kind !== "modus")
|
|
334
|
+
if (target.kind !== "modus") _chunkRK4NLJINcjs.validateId.call(void 0, target.id, `${target.kind.slice(0, -1)}_id`);
|
|
335
335
|
const runsWithOwnModels = target.kind === "workflows";
|
|
336
|
-
if (!runsWithOwnModels)
|
|
337
|
-
const baseUrl =
|
|
336
|
+
if (!runsWithOwnModels) _chunkRK4NLJINcjs.validateChatModel.call(void 0, options.model);
|
|
337
|
+
const baseUrl = _chunkRK4NLJINcjs.requireAgentHost.call(void 0, config);
|
|
338
338
|
const sessionId = resolveAgentRunSessionId(effectiveThreadId(options.threadId));
|
|
339
339
|
return {
|
|
340
340
|
path: runsPath(target),
|
|
@@ -400,7 +400,7 @@ var WorkflowsResourceBase = class {
|
|
|
400
400
|
*/
|
|
401
401
|
list(options = {}) {
|
|
402
402
|
const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
|
|
403
|
-
|
|
403
|
+
_chunkRK4NLJINcjs.validatePageSize.call(void 0, pageSize);
|
|
404
404
|
return this.listPage(pageSize, options.pageToken, options.search, options.type, options.view, options.includeVariation);
|
|
405
405
|
}
|
|
406
406
|
async listPage(pageSize, pageToken, search, type, view, includeVariation) {
|
|
@@ -409,12 +409,12 @@ var WorkflowsResourceBase = class {
|
|
|
409
409
|
if (type !== void 0) extra.type = type;
|
|
410
410
|
if (view !== void 0) extra.view = view;
|
|
411
411
|
if (includeVariation !== void 0) extra.includeVariation = includeVariation;
|
|
412
|
-
const data =
|
|
413
|
-
await
|
|
414
|
-
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)
|
|
415
415
|
})
|
|
416
416
|
);
|
|
417
|
-
return
|
|
417
|
+
return _chunkRK4NLJINcjs.buildAipPage.call(void 0,
|
|
418
418
|
data,
|
|
419
419
|
"workflows",
|
|
420
420
|
(raw) => raw,
|
|
@@ -428,7 +428,7 @@ var WorkflowsResourceBase = class {
|
|
|
428
428
|
var RUNS_MAX_PAGE_SIZE = 100;
|
|
429
429
|
function runsListParams(pageSize, pageToken, status, timeframe, approvalScope, search) {
|
|
430
430
|
const params = { pageSize };
|
|
431
|
-
const token =
|
|
431
|
+
const token = _chunkRK4NLJINcjs.normalizePageToken.call(void 0, pageToken);
|
|
432
432
|
if (token !== void 0) params.pageToken = token;
|
|
433
433
|
if (status !== void 0) params.status = status;
|
|
434
434
|
if (timeframe !== void 0) params.timeframe = timeframe;
|
|
@@ -438,7 +438,7 @@ function runsListParams(pageSize, pageToken, status, timeframe, approvalScope, s
|
|
|
438
438
|
}
|
|
439
439
|
function activeRunsParams(pageSize, pageToken) {
|
|
440
440
|
const params = { pageSize };
|
|
441
|
-
const token =
|
|
441
|
+
const token = _chunkRK4NLJINcjs.normalizePageToken.call(void 0, pageToken);
|
|
442
442
|
if (token !== void 0) params.pageToken = token;
|
|
443
443
|
return params;
|
|
444
444
|
}
|
|
@@ -446,26 +446,26 @@ function parseRun(raw) {
|
|
|
446
446
|
return raw;
|
|
447
447
|
}
|
|
448
448
|
function parseActiveRunsArray(raw) {
|
|
449
|
-
const data =
|
|
449
|
+
const data = _chunkRK4NLJINcjs.asRecord.call(void 0, raw);
|
|
450
450
|
const runs = data.runs;
|
|
451
451
|
if (!Array.isArray(runs)) {
|
|
452
|
-
throw new (0,
|
|
452
|
+
throw new (0, _chunkRK4NLJINcjs.ModusError)(
|
|
453
453
|
`Unexpected active runs response shape: runs must be a list, got ${typeof runs}.`
|
|
454
454
|
);
|
|
455
455
|
}
|
|
456
456
|
return runs;
|
|
457
457
|
}
|
|
458
458
|
function parseActiveRunsPage(raw, fetchPage) {
|
|
459
|
-
const data =
|
|
459
|
+
const data = _chunkRK4NLJINcjs.asRecord.call(void 0, raw);
|
|
460
460
|
const runs = data.runs;
|
|
461
461
|
if (!Array.isArray(runs)) {
|
|
462
|
-
throw new (0,
|
|
462
|
+
throw new (0, _chunkRK4NLJINcjs.ModusError)(
|
|
463
463
|
`Unexpected active runs response shape: runs must be a list, got ${typeof runs}.`
|
|
464
464
|
);
|
|
465
465
|
}
|
|
466
|
-
return new (0,
|
|
466
|
+
return new (0, _chunkRK4NLJINcjs.Page)(
|
|
467
467
|
runs,
|
|
468
|
-
|
|
468
|
+
_chunkRK4NLJINcjs.normalizePageToken.call(void 0,
|
|
469
469
|
typeof data.nextPageToken === "string" ? data.nextPageToken : void 0
|
|
470
470
|
),
|
|
471
471
|
fetchPage
|
|
@@ -479,7 +479,7 @@ function sessionIdFromBody(body) {
|
|
|
479
479
|
}
|
|
480
480
|
function requireSessionId(sessionId) {
|
|
481
481
|
if (!_optionalChain([sessionId, 'optionalAccess', _4 => _4.trim, 'call', _5 => _5()])) {
|
|
482
|
-
throw new (0,
|
|
482
|
+
throw new (0, _chunkRK4NLJINcjs.ValidationError)("sessionId must be the run's conversation id (a non-empty string)");
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
485
|
function makeAgentRunStream(runId, events) {
|
|
@@ -519,14 +519,14 @@ var WorkflowRunsResource = class {
|
|
|
519
519
|
* ```
|
|
520
520
|
*/
|
|
521
521
|
list(workflowId, options = {}) {
|
|
522
|
-
|
|
522
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, workflowId, "workflow_id");
|
|
523
523
|
const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
|
|
524
|
-
|
|
524
|
+
_chunkRK4NLJINcjs.validatePageSize.call(void 0, pageSize, RUNS_MAX_PAGE_SIZE);
|
|
525
525
|
return this.listPage(workflowId, pageSize, options.pageToken, options);
|
|
526
526
|
}
|
|
527
527
|
async listPage(workflowId, pageSize, pageToken, filters) {
|
|
528
|
-
const data =
|
|
529
|
-
await
|
|
528
|
+
const data = _chunkRK4NLJINcjs.asRecord.call(void 0,
|
|
529
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowRunsController_list", {
|
|
530
530
|
pathParams: { id: workflowId },
|
|
531
531
|
query: runsListParams(
|
|
532
532
|
pageSize,
|
|
@@ -540,13 +540,13 @@ var WorkflowRunsResource = class {
|
|
|
540
540
|
);
|
|
541
541
|
const runs = data.runs;
|
|
542
542
|
if (!Array.isArray(runs)) {
|
|
543
|
-
throw new (0,
|
|
543
|
+
throw new (0, _chunkRK4NLJINcjs.ModusError)(
|
|
544
544
|
`Unexpected list response shape: runs must be a list, got ${typeof runs}.`
|
|
545
545
|
);
|
|
546
546
|
}
|
|
547
|
-
return new (0,
|
|
547
|
+
return new (0, _chunkRK4NLJINcjs.Page)(
|
|
548
548
|
runs,
|
|
549
|
-
|
|
549
|
+
_chunkRK4NLJINcjs.normalizePageToken.call(void 0,
|
|
550
550
|
typeof data.nextPageToken === "string" ? data.nextPageToken : void 0
|
|
551
551
|
),
|
|
552
552
|
(token) => this.listPage(workflowId, pageSize, token, filters)
|
|
@@ -568,10 +568,10 @@ var WorkflowRunsResource = class {
|
|
|
568
568
|
* ```
|
|
569
569
|
*/
|
|
570
570
|
async get(workflowId, runId, options = {}) {
|
|
571
|
-
|
|
572
|
-
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");
|
|
573
573
|
const query = options.temporalRunId !== void 0 ? { temporalRunId: options.temporalRunId } : void 0;
|
|
574
|
-
const data = await
|
|
574
|
+
const data = await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowRunsController_get", {
|
|
575
575
|
pathParams: { id: workflowId, runId },
|
|
576
576
|
query
|
|
577
577
|
});
|
|
@@ -598,7 +598,7 @@ var WorkflowRunsResource = class {
|
|
|
598
598
|
* ```
|
|
599
599
|
*/
|
|
600
600
|
create(workflowId, body, options = {}) {
|
|
601
|
-
|
|
601
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, workflowId, "workflow_id");
|
|
602
602
|
return this.createRun("WorkflowRunsController_create", body, { id: workflowId }, options);
|
|
603
603
|
}
|
|
604
604
|
/**
|
|
@@ -623,7 +623,7 @@ var WorkflowRunsResource = class {
|
|
|
623
623
|
* ```
|
|
624
624
|
*/
|
|
625
625
|
createScope(scopeId, body, options = {}) {
|
|
626
|
-
|
|
626
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, scopeId, "scope_id");
|
|
627
627
|
return this.createRun("ScopeRunsController_create", body, { id: scopeId }, options);
|
|
628
628
|
}
|
|
629
629
|
/**
|
|
@@ -671,7 +671,7 @@ var WorkflowRunsResource = class {
|
|
|
671
671
|
* ```
|
|
672
672
|
*/
|
|
673
673
|
resume(runId, body, options = {}) {
|
|
674
|
-
|
|
674
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, runId, "run_id");
|
|
675
675
|
requireSessionId(body.sessionId);
|
|
676
676
|
return this.createRun("ResumeRunsController_create", body, { runId }, options);
|
|
677
677
|
}
|
|
@@ -686,8 +686,8 @@ var WorkflowRunsResource = class {
|
|
|
686
686
|
* ```
|
|
687
687
|
*/
|
|
688
688
|
async cancel(runId) {
|
|
689
|
-
|
|
690
|
-
await
|
|
689
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, runId, "run_id");
|
|
690
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_cancel", {
|
|
691
691
|
pathParams: { runId },
|
|
692
692
|
jsonBody: {}
|
|
693
693
|
});
|
|
@@ -700,8 +700,8 @@ var WorkflowRunsResource = class {
|
|
|
700
700
|
* `status` and `done`.
|
|
701
701
|
*/
|
|
702
702
|
async events(runId) {
|
|
703
|
-
|
|
704
|
-
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", {
|
|
705
705
|
pathParams: { runId }
|
|
706
706
|
});
|
|
707
707
|
}
|
|
@@ -732,13 +732,13 @@ var WorkflowRunsResource = class {
|
|
|
732
732
|
* ```
|
|
733
733
|
*/
|
|
734
734
|
async interrupt(runId, nextRun, options = {}) {
|
|
735
|
-
|
|
735
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, runId, "run_id");
|
|
736
736
|
requireSessionId(nextRun.sessionId);
|
|
737
737
|
const jsonBody = {
|
|
738
738
|
nextRun: { ...nextRun, runId: _optionalChain([nextRun, 'access', _6 => _6.runId, 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]) || randomRunId() },
|
|
739
739
|
...options.lastSeenEventId ? { lastSeenEventId: options.lastSeenEventId } : {}
|
|
740
740
|
};
|
|
741
|
-
return await
|
|
741
|
+
return await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_interrupt", {
|
|
742
742
|
pathParams: { runId },
|
|
743
743
|
jsonBody
|
|
744
744
|
});
|
|
@@ -761,9 +761,9 @@ var WorkflowRunsResource = class {
|
|
|
761
761
|
* ```
|
|
762
762
|
*/
|
|
763
763
|
async editQueued(runId, nextRun) {
|
|
764
|
-
|
|
764
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, runId, "run_id");
|
|
765
765
|
requireSessionId(nextRun.sessionId);
|
|
766
|
-
return await
|
|
766
|
+
return await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_editQueued", {
|
|
767
767
|
pathParams: { runId },
|
|
768
768
|
jsonBody: { nextRun }
|
|
769
769
|
});
|
|
@@ -777,12 +777,12 @@ var WorkflowRunsResource = class {
|
|
|
777
777
|
*/
|
|
778
778
|
active(options = {}) {
|
|
779
779
|
const pageSize = _nullishCoalesce(options.pageSize, () => ( 50));
|
|
780
|
-
|
|
780
|
+
_chunkRK4NLJINcjs.validatePageSize.call(void 0, pageSize, RUNS_MAX_PAGE_SIZE);
|
|
781
781
|
return this.activePage(pageSize, options.pageToken);
|
|
782
782
|
}
|
|
783
783
|
async activePage(pageSize, pageToken) {
|
|
784
784
|
return parseActiveRunsPage(
|
|
785
|
-
await
|
|
785
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_active", {
|
|
786
786
|
query: activeRunsParams(pageSize, pageToken)
|
|
787
787
|
}),
|
|
788
788
|
(token) => this.activePage(pageSize, token)
|
|
@@ -798,10 +798,10 @@ var WorkflowRunsResource = class {
|
|
|
798
798
|
async activeBySession(sessionIds) {
|
|
799
799
|
const uniqueSessionIds = [...new Set(sessionIds.map((id) => id.trim()).filter(Boolean))];
|
|
800
800
|
if (uniqueSessionIds.length > 100) {
|
|
801
|
-
throw new (0,
|
|
801
|
+
throw new (0, _chunkRK4NLJINcjs.ValidationError)("sessionIds must contain at most 100 ids");
|
|
802
802
|
}
|
|
803
803
|
return parseActiveRunsArray(
|
|
804
|
-
await
|
|
804
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "RunLifecycleController_activeBySession", {
|
|
805
805
|
jsonBody: { sessionIds: uniqueSessionIds }
|
|
806
806
|
})
|
|
807
807
|
);
|
|
@@ -824,11 +824,11 @@ var WorkflowRunsResource = class {
|
|
|
824
824
|
* ```
|
|
825
825
|
*/
|
|
826
826
|
stream(runId, options = {}) {
|
|
827
|
-
|
|
828
|
-
const op =
|
|
829
|
-
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 });
|
|
830
830
|
const lines = this.http.streamGet(path, void 0, {
|
|
831
|
-
baseUrl:
|
|
831
|
+
baseUrl: _chunkRK4NLJINcjs.operationBaseUrl.call(void 0, this.http, op),
|
|
832
832
|
headers: options.lastEventId ? { "Last-Event-ID": options.lastEventId } : void 0
|
|
833
833
|
});
|
|
834
834
|
return makeAgentRunStream(runId, this.parseEvents(lines));
|
|
@@ -836,14 +836,14 @@ var WorkflowRunsResource = class {
|
|
|
836
836
|
createRun(operationId, body, pathParams, options) {
|
|
837
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();
|
|
838
838
|
const sessionId = sessionIdFromBody(body);
|
|
839
|
-
const op =
|
|
840
|
-
const path =
|
|
839
|
+
const op = _chunkRK4NLJINcjs.getOperation.call(void 0, operationId);
|
|
840
|
+
const path = _chunkRK4NLJINcjs.formatOperationPath.call(void 0, operationId, pathParams);
|
|
841
841
|
const lines = this.http.streamPost(path, {
|
|
842
842
|
...body,
|
|
843
843
|
sessionId,
|
|
844
844
|
streamProtocolVersion: 2
|
|
845
845
|
}, {
|
|
846
|
-
baseUrl:
|
|
846
|
+
baseUrl: _chunkRK4NLJINcjs.operationBaseUrl.call(void 0, this.http, op),
|
|
847
847
|
headers: { "Idempotency-Key": runId }
|
|
848
848
|
});
|
|
849
849
|
return makeAgentRunStream(runId, this.parseEvents(lines));
|
|
@@ -873,10 +873,10 @@ var AgentWorkflowActionsResource = class {
|
|
|
873
873
|
*/
|
|
874
874
|
execute(body, options = {}) {
|
|
875
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();
|
|
876
|
-
const op =
|
|
877
|
-
const path =
|
|
876
|
+
const op = _chunkRK4NLJINcjs.getOperation.call(void 0, "WorkflowActionsController_execute");
|
|
877
|
+
const path = _chunkRK4NLJINcjs.formatOperationPath.call(void 0, "WorkflowActionsController_execute");
|
|
878
878
|
const lines = this.http.streamPost(path, body, {
|
|
879
|
-
baseUrl:
|
|
879
|
+
baseUrl: _chunkRK4NLJINcjs.operationBaseUrl.call(void 0, this.http, op),
|
|
880
880
|
headers: { "Idempotency-Key": runId }
|
|
881
881
|
});
|
|
882
882
|
return makeAgentRunStream(runId, this.parseEvents(lines));
|
|
@@ -887,8 +887,8 @@ var AgentWorkflowActionsResource = class {
|
|
|
887
887
|
* @param runId - Action run id to cancel.
|
|
888
888
|
*/
|
|
889
889
|
async cancel(runId) {
|
|
890
|
-
|
|
891
|
-
await
|
|
890
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, runId, "run_id");
|
|
891
|
+
await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowActionsController_cancel", {
|
|
892
892
|
pathParams: { runId },
|
|
893
893
|
jsonBody: {}
|
|
894
894
|
});
|
|
@@ -926,13 +926,13 @@ var WorkflowsResource = class extends WorkflowsResourceBase {
|
|
|
926
926
|
* ```
|
|
927
927
|
*/
|
|
928
928
|
async get(workflowId, options = {}) {
|
|
929
|
-
|
|
929
|
+
_chunkRK4NLJINcjs.validateId.call(void 0, workflowId, "workflow_id");
|
|
930
930
|
const query = {};
|
|
931
931
|
if (options.view !== void 0) query.view = options.view;
|
|
932
932
|
if (options.includeVariation !== void 0) {
|
|
933
933
|
query.includeVariation = options.includeVariation;
|
|
934
934
|
}
|
|
935
|
-
const data = await
|
|
935
|
+
const data = await _chunkRK4NLJINcjs.invokeWithRetry.call(void 0, this.config, this.http, "WorkflowsController_get", {
|
|
936
936
|
pathParams: { id: workflowId },
|
|
937
937
|
query: Object.keys(query).length > 0 ? query : void 0
|
|
938
938
|
});
|
|
@@ -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
|
-
_chunkQHA3LF2Qcjs.validateId.call(void 0, connectionId, "connection_id");
|
|
1049
|
-
const pageSize = _nullishCoalesce(options.pageSize, () => ( 25));
|
|
1050
|
-
_chunkQHA3LF2Qcjs.validatePageSize.call(void 0, pageSize);
|
|
1051
|
-
return this.listSelectionsPage(connectionId, pageSize, options.pageToken);
|
|
1052
|
-
}
|
|
1053
|
-
async listSelectionsPage(connectionId, pageSize, pageToken) {
|
|
1054
|
-
const data = _chunkQHA3LF2Qcjs.asRecord.call(void 0,
|
|
1055
|
-
await _chunkQHA3LF2Qcjs.invokeWithRetry.call(void 0, this.config, this.http, "ConnectionsController_listSelections", {
|
|
1056
|
-
pathParams: { connectionId },
|
|
1057
|
-
query: _chunkQHA3LF2Qcjs.aipListParams.call(void 0, pageSize, pageToken)
|
|
1058
|
-
})
|
|
1059
|
-
);
|
|
1060
|
-
return _chunkQHA3LF2Qcjs.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 _chunkQHA3LF2Qcjs.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
|