sarvam-agents-client 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apis/AgentsApi.d.ts +4 -4
- package/dist/apis/AgentsApi.js +4 -4
- package/dist/apis/AppsApi.d.ts +1 -0
- package/dist/apis/AppsApi.js +3 -0
- package/dist/apis/QueueApi.d.ts +1 -0
- package/dist/apis/QueueApi.js +3 -0
- package/dist/apis/ResponsesApi.d.ts +2 -0
- package/dist/apis/ResponsesApi.js +6 -0
- package/dist/compose/agent.d.ts +10 -3
- package/dist/compose/agent.js +8 -0
- package/dist/compose/deploy.d.ts +3 -2
- package/dist/compose/errors.d.ts +17 -0
- package/dist/compose/errors.js +17 -0
- package/dist/compose/events.d.ts +44 -0
- package/dist/compose/events.js +32 -2
- package/dist/compose/index.d.ts +3 -2
- package/dist/compose/output.d.ts +29 -0
- package/dist/compose/output.js +451 -0
- package/dist/compose/run.d.ts +45 -13
- package/dist/compose/run.js +68 -3
- package/dist/compose/runState.d.ts +2 -1
- package/dist/compose/settingsTransport.d.ts +3 -2
- package/dist/compose/transport.d.ts +3 -2
- package/dist/esm/apis/AgentsApi.d.ts +4 -4
- package/dist/esm/apis/AgentsApi.js +4 -4
- package/dist/esm/apis/AppsApi.d.ts +1 -0
- package/dist/esm/apis/AppsApi.js +3 -0
- package/dist/esm/apis/QueueApi.d.ts +1 -0
- package/dist/esm/apis/QueueApi.js +3 -0
- package/dist/esm/apis/ResponsesApi.d.ts +2 -0
- package/dist/esm/apis/ResponsesApi.js +6 -0
- package/dist/esm/compose/agent.d.ts +10 -3
- package/dist/esm/compose/agent.js +8 -0
- package/dist/esm/compose/deploy.d.ts +3 -2
- package/dist/esm/compose/errors.d.ts +17 -0
- package/dist/esm/compose/errors.js +17 -0
- package/dist/esm/compose/events.d.ts +44 -0
- package/dist/esm/compose/events.js +32 -2
- package/dist/esm/compose/index.d.ts +3 -2
- package/dist/esm/compose/output.d.ts +29 -0
- package/dist/esm/compose/output.js +445 -0
- package/dist/esm/compose/run.d.ts +45 -13
- package/dist/esm/compose/run.js +69 -4
- package/dist/esm/compose/runState.d.ts +2 -1
- package/dist/esm/compose/settingsTransport.d.ts +3 -2
- package/dist/esm/compose/transport.d.ts +3 -2
- package/dist/esm/models/AppResource.d.ts +29 -0
- package/dist/esm/models/AppResource.js +16 -0
- package/dist/esm/models/AppToolsResponse.d.ts +3 -4
- package/dist/esm/models/AppToolsResponse.js +3 -2
- package/dist/esm/models/AppView.d.ts +48 -0
- package/dist/esm/models/AppView.js +23 -0
- package/dist/esm/models/McpSecurityAppealView.d.ts +50 -0
- package/dist/esm/models/McpSecurityAppealView.js +47 -0
- package/dist/esm/models/McpSecurityView.d.ts +105 -0
- package/dist/esm/models/McpSecurityView.js +66 -0
- package/dist/esm/models/MessagesResponse.d.ts +6 -0
- package/dist/esm/models/MessagesResponse.js +2 -0
- package/dist/esm/models/ResponseDetail.d.ts +32 -0
- package/dist/esm/models/ResponseDetail.js +10 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +2 -0
- package/dist/models/AppResource.d.ts +29 -0
- package/dist/models/AppResource.js +17 -1
- package/dist/models/AppToolsResponse.d.ts +3 -4
- package/dist/models/AppToolsResponse.js +3 -2
- package/dist/models/AppView.d.ts +48 -0
- package/dist/models/AppView.js +24 -1
- package/dist/models/McpSecurityAppealView.d.ts +50 -0
- package/dist/models/McpSecurityAppealView.js +54 -0
- package/dist/models/McpSecurityView.d.ts +105 -0
- package/dist/models/McpSecurityView.js +73 -0
- package/dist/models/MessagesResponse.d.ts +6 -0
- package/dist/models/MessagesResponse.js +2 -0
- package/dist/models/ResponseDetail.d.ts +32 -0
- package/dist/models/ResponseDetail.js +10 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/package.json +4 -3
- package/src/apis/AgentsApi.ts +4 -4
- package/src/apis/AppsApi.ts +5 -0
- package/src/apis/QueueApi.ts +5 -0
- package/src/apis/ResponsesApi.ts +10 -0
- package/src/compose/agent.ts +21 -6
- package/src/compose/deploy.ts +6 -5
- package/src/compose/errors.ts +28 -1
- package/src/compose/events.ts +61 -1
- package/src/compose/index.ts +3 -2
- package/src/compose/output.ts +415 -0
- package/src/compose/run.ts +114 -20
- package/src/compose/runState.ts +2 -1
- package/src/compose/settingsTransport.ts +4 -3
- package/src/compose/transport.ts +3 -2
- package/src/models/AppResource.ts +42 -0
- package/src/models/AppToolsResponse.ts +11 -4
- package/src/models/AppView.ts +73 -0
- package/src/models/McpSecurityAppealView.ts +89 -0
- package/src/models/McpSecurityView.ts +169 -0
- package/src/models/MessagesResponse.ts +8 -0
- package/src/models/ResponseDetail.ts +40 -0
- package/src/models/index.ts +2 -0
package/dist/esm/compose/run.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { FetchError } from "../runtime.js";
|
|
2
2
|
import { agentIdFor, getDefaultClient, resolveTransport } from "./deploy.js";
|
|
3
|
-
import { NotSupportedError, RunError, UserError } from "./errors.js";
|
|
3
|
+
import { ModelBehaviorError, NotSupportedError, RunError, UserError } from "./errors.js";
|
|
4
|
+
import { parseOutput } from "./output.js";
|
|
4
5
|
import { RunState } from "./runState.js";
|
|
5
6
|
const MAX_RECONNECTS = 3;
|
|
6
7
|
/** The abort reason ResponseStream (src/streaming.ts) uses when a stream goes quiet. */
|
|
7
8
|
const IDLE_TIMEOUT_MESSAGE = "stream idle timeout";
|
|
9
|
+
/** Server cap kind (`data-turn-limit`) -> stop reason, named like the `limits` field that set it. */
|
|
10
|
+
const STOP_REASONS = {
|
|
11
|
+
max_turns: "max_turns",
|
|
12
|
+
tool_calls: "max_tool_calls",
|
|
13
|
+
tokens: "max_tokens",
|
|
14
|
+
};
|
|
8
15
|
function stateOf(conversationId, interruptions) {
|
|
9
16
|
if (conversationId === undefined)
|
|
10
17
|
throw new UserError("this run has no conversation to resume");
|
|
@@ -17,7 +24,12 @@ export class RunResult {
|
|
|
17
24
|
this.outputText = outcome.outputText;
|
|
18
25
|
this.newItems = outcome.newItems;
|
|
19
26
|
this.interruptions = outcome.interruptions;
|
|
27
|
+
this.stopReason = outcome.stopReason;
|
|
20
28
|
this.conversationId = outcome.conversationId;
|
|
29
|
+
this.outputCitations = outcome.outputCitations;
|
|
30
|
+
this.outputNote = outcome.outputNote;
|
|
31
|
+
this.outputSkipped = outcome.outputSkipped;
|
|
32
|
+
this.outputMode = outcome.outputMode;
|
|
21
33
|
}
|
|
22
34
|
/** A RunState to answer the interruptions and continue; throws UserError when the run has no conversation. */
|
|
23
35
|
get state() {
|
|
@@ -97,6 +109,9 @@ class Loop {
|
|
|
97
109
|
this.onConversation = onConversation;
|
|
98
110
|
this.conversationId = null;
|
|
99
111
|
this.items = [];
|
|
112
|
+
this.stopReason = undefined;
|
|
113
|
+
/** The turn's structured output (`data-output` / `data-output-error`), when the agent has an `outputType`. */
|
|
114
|
+
this.output = undefined;
|
|
100
115
|
// Text of the current segment, per text block. Kept per block so a resumed stream, which replays from the start
|
|
101
116
|
// of the block it dropped in, doesn't repeat text.
|
|
102
117
|
this.blocks = [];
|
|
@@ -241,6 +256,13 @@ class Loop {
|
|
|
241
256
|
if (this.signal.aborted)
|
|
242
257
|
throw new Cancelled();
|
|
243
258
|
throw new RunError("stopped", `the turn was stopped on the server (${event.reason})`);
|
|
259
|
+
case "turn_limit":
|
|
260
|
+
this.stopReason = STOP_REASONS[event.capKind];
|
|
261
|
+
return false;
|
|
262
|
+
case "output":
|
|
263
|
+
case "output_error":
|
|
264
|
+
this.output = event;
|
|
265
|
+
return false;
|
|
244
266
|
case "text_start":
|
|
245
267
|
case "text_end":
|
|
246
268
|
this.onText(event);
|
|
@@ -355,8 +377,18 @@ function link(signal, controller) {
|
|
|
355
377
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
356
378
|
return () => signal.removeEventListener("abort", onAbort);
|
|
357
379
|
}
|
|
380
|
+
/** `finalOutput` for an agent with an `outputType`: the parsed value, or undefined when the turn produced none
|
|
381
|
+
* (`outputSkipped` says why). A mismatch throws `ModelBehaviorError`. */
|
|
382
|
+
function structuredOutput(outputType, event) {
|
|
383
|
+
if ((event === null || event === void 0 ? void 0 : event.kind) === "output_error")
|
|
384
|
+
throw new ModelBehaviorError(event.rawText, event.errors, event.note);
|
|
385
|
+
if ((event === null || event === void 0 ? void 0 : event.kind) === "output" && event.output !== null && event.output !== undefined) {
|
|
386
|
+
return parseOutput(outputType, event.output, event.note);
|
|
387
|
+
}
|
|
388
|
+
return undefined;
|
|
389
|
+
}
|
|
358
390
|
async function execute(p, controller, emit) {
|
|
359
|
-
var _a, _b;
|
|
391
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
360
392
|
const signal = controller.signal;
|
|
361
393
|
const unlink = link(p.opts.signal, controller);
|
|
362
394
|
const stopper = new Stopper(p.transport, signal);
|
|
@@ -392,13 +424,34 @@ async function execute(p, controller, emit) {
|
|
|
392
424
|
}
|
|
393
425
|
cancelled = cancelled || signal.aborted;
|
|
394
426
|
const text = loop.text;
|
|
427
|
+
const outputType = p.agent.outputType;
|
|
428
|
+
let finalOutput;
|
|
429
|
+
if (interruptions.length || cancelled)
|
|
430
|
+
finalOutput = undefined;
|
|
431
|
+
else if (outputType !== undefined) {
|
|
432
|
+
try {
|
|
433
|
+
finalOutput = structuredOutput(outputType, loop.output);
|
|
434
|
+
}
|
|
435
|
+
catch (err) {
|
|
436
|
+
if (err instanceof ModelBehaviorError)
|
|
437
|
+
err.conversationId = (_b = loop.conversationId) !== null && _b !== void 0 ? _b : fallbackConversation;
|
|
438
|
+
throw err;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
else
|
|
442
|
+
finalOutput = text;
|
|
395
443
|
return {
|
|
396
|
-
finalOutput
|
|
444
|
+
finalOutput,
|
|
397
445
|
outputText: text,
|
|
398
446
|
newItems: loop.items,
|
|
399
447
|
interruptions,
|
|
400
|
-
|
|
448
|
+
stopReason: loop.stopReason,
|
|
449
|
+
conversationId: (_c = loop.conversationId) !== null && _c !== void 0 ? _c : fallbackConversation,
|
|
401
450
|
cancelled,
|
|
451
|
+
outputCitations: ((_d = loop.output) === null || _d === void 0 ? void 0 : _d.kind) === "output" ? ((_e = loop.output.citations) !== null && _e !== void 0 ? _e : []).slice() : [],
|
|
452
|
+
outputNote: (_f = loop.output) === null || _f === void 0 ? void 0 : _f.note,
|
|
453
|
+
outputSkipped: ((_g = loop.output) === null || _g === void 0 ? void 0 : _g.kind) === "output" ? loop.output.skipped : undefined,
|
|
454
|
+
outputMode: ((_h = loop.output) === null || _h === void 0 ? void 0 : _h.kind) === "output" ? loop.output.mode : undefined,
|
|
402
455
|
};
|
|
403
456
|
}
|
|
404
457
|
// -- streaming ---------------------------------------------------------------------------------------------------
|
|
@@ -410,8 +463,15 @@ export class StreamedRunResult {
|
|
|
410
463
|
this.outputText = "";
|
|
411
464
|
this.newItems = [];
|
|
412
465
|
this.interruptions = [];
|
|
466
|
+
/** Set when an agent.json limit ended the turn; read after `completed` settles. */
|
|
467
|
+
this.stopReason = undefined;
|
|
413
468
|
this.conversationId = undefined;
|
|
414
469
|
this.cancelled = false;
|
|
470
|
+
/** As on `RunResult`; read after `completed` settles. */
|
|
471
|
+
this.outputCitations = [];
|
|
472
|
+
this.outputNote = undefined;
|
|
473
|
+
this.outputSkipped = undefined;
|
|
474
|
+
this.outputMode = undefined;
|
|
415
475
|
this.queue = [];
|
|
416
476
|
this.waiters = [];
|
|
417
477
|
this.done = false;
|
|
@@ -424,8 +484,13 @@ export class StreamedRunResult {
|
|
|
424
484
|
this.outputText = outcome.outputText;
|
|
425
485
|
this.newItems = outcome.newItems;
|
|
426
486
|
this.interruptions = outcome.interruptions;
|
|
487
|
+
this.stopReason = outcome.stopReason;
|
|
427
488
|
this.conversationId = outcome.conversationId;
|
|
428
489
|
this.cancelled = outcome.cancelled;
|
|
490
|
+
this.outputCitations = outcome.outputCitations;
|
|
491
|
+
this.outputNote = outcome.outputNote;
|
|
492
|
+
this.outputSkipped = outcome.outputSkipped;
|
|
493
|
+
this.outputMode = outcome.outputMode;
|
|
429
494
|
this.end();
|
|
430
495
|
}, (error) => {
|
|
431
496
|
this.failure = { error };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** RunState: what a paused run needs to continue (conversation, pending interruptions and the caller's answers). */
|
|
2
2
|
import type { Agent } from "./agent.js";
|
|
3
|
+
import type { OutputType } from "./output.js";
|
|
3
4
|
import type { ClarifyQuestion } from "./events.js";
|
|
4
5
|
export interface Interruption {
|
|
5
6
|
kind: "clarify";
|
|
@@ -22,5 +23,5 @@ export declare class RunState {
|
|
|
22
23
|
/** JSON in the format Python's `RunState.to_json()` writes. */
|
|
23
24
|
toString(): string;
|
|
24
25
|
/** Read a state written by `toString()` (or by Python's `to_json()`). */
|
|
25
|
-
static fromString(agent: Agent
|
|
26
|
+
static fromString(agent: Agent<OutputType | undefined>, s: string): Promise<RunState>;
|
|
26
27
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Configuration } from "../runtime.js";
|
|
2
2
|
import type { Agent } from "./agent.js";
|
|
3
|
+
import type { OutputType } from "./output.js";
|
|
3
4
|
import type { RemoteAgent, Transport, TurnStream } from "./transport.js";
|
|
4
5
|
export declare class SettingsTransport implements Transport {
|
|
5
6
|
private readonly config;
|
|
@@ -10,8 +11,8 @@ export declare class SettingsTransport implements Transport {
|
|
|
10
11
|
constructor(config: Configuration);
|
|
11
12
|
findAgents(sdkName: string): Promise<RemoteAgent[]>;
|
|
12
13
|
readAgent(agentId: string): Promise<RemoteAgent>;
|
|
13
|
-
createAgent(agent: Agent): Promise<RemoteAgent>;
|
|
14
|
-
updateAgent(agentId: string, agent: Agent): Promise<RemoteAgent>;
|
|
14
|
+
createAgent(agent: Agent<OutputType | undefined>): Promise<RemoteAgent>;
|
|
15
|
+
updateAgent(agentId: string, agent: Agent<OutputType | undefined>): Promise<RemoteAgent>;
|
|
15
16
|
deleteAgent(agentId: string): Promise<void>;
|
|
16
17
|
startTurn(agentId: string, conversationId: string | null, text: string, signal?: AbortSignal): Promise<TurnStream>;
|
|
17
18
|
answerClarify(conversationId: string, requestId: string, answers: Record<string, unknown>, signal?: AbortSignal): Promise<TurnStream>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Transport interface: the seam between the compose layer and the server. */
|
|
2
2
|
import type { Agent } from "./agent.js";
|
|
3
|
+
import type { OutputType } from "./output.js";
|
|
3
4
|
import type { Event } from "./events.js";
|
|
4
5
|
export interface SettingsWarning {
|
|
5
6
|
code: string;
|
|
@@ -24,8 +25,8 @@ export interface Transport {
|
|
|
24
25
|
readonly kind: "settings";
|
|
25
26
|
findAgents(sdkName: string): Promise<RemoteAgent[]>;
|
|
26
27
|
readAgent(agentId: string): Promise<RemoteAgent>;
|
|
27
|
-
createAgent(agent: Agent): Promise<RemoteAgent>;
|
|
28
|
-
updateAgent(agentId: string, agent: Agent): Promise<RemoteAgent>;
|
|
28
|
+
createAgent(agent: Agent<OutputType | undefined>): Promise<RemoteAgent>;
|
|
29
|
+
updateAgent(agentId: string, agent: Agent<OutputType | undefined>): Promise<RemoteAgent>;
|
|
29
30
|
deleteAgent(agentId: string): Promise<void>;
|
|
30
31
|
startTurn(agentId: string, conversationId: string | null, text: string, signal?: AbortSignal): Promise<TurnStream>;
|
|
31
32
|
answerClarify(conversationId: string, requestId: string, answers: Record<string, unknown>, signal?: AbortSignal): Promise<TurnStream>;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
import type { McpSecurityView } from './McpSecurityView.js';
|
|
12
13
|
import type { Scope } from './Scope.js';
|
|
13
14
|
import type { Capabilities } from './Capabilities.js';
|
|
14
15
|
import type { FieldHighlight } from './FieldHighlight.js';
|
|
@@ -165,6 +166,24 @@ export interface AppResource {
|
|
|
165
166
|
* @memberof AppResource
|
|
166
167
|
*/
|
|
167
168
|
connectorMode?: string | null;
|
|
169
|
+
/**
|
|
170
|
+
*
|
|
171
|
+
* @type {boolean}
|
|
172
|
+
* @memberof AppResource
|
|
173
|
+
*/
|
|
174
|
+
isCustom?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
*
|
|
177
|
+
* @type {string}
|
|
178
|
+
* @memberof AppResource
|
|
179
|
+
*/
|
|
180
|
+
authKind?: AppResourceAuthKindEnum | null;
|
|
181
|
+
/**
|
|
182
|
+
*
|
|
183
|
+
* @type {McpSecurityView}
|
|
184
|
+
* @memberof AppResource
|
|
185
|
+
*/
|
|
186
|
+
security?: McpSecurityView | null;
|
|
168
187
|
}
|
|
169
188
|
/**
|
|
170
189
|
* @export
|
|
@@ -182,6 +201,16 @@ export declare const AppResourceAuthTypeEnum: {
|
|
|
182
201
|
readonly None: "none";
|
|
183
202
|
};
|
|
184
203
|
export type AppResourceAuthTypeEnum = typeof AppResourceAuthTypeEnum[keyof typeof AppResourceAuthTypeEnum];
|
|
204
|
+
/**
|
|
205
|
+
* @export
|
|
206
|
+
*/
|
|
207
|
+
export declare const AppResourceAuthKindEnum: {
|
|
208
|
+
readonly Oauth: "oauth";
|
|
209
|
+
readonly ApiKey: "api_key";
|
|
210
|
+
readonly SharedKey: "shared_key";
|
|
211
|
+
readonly None: "none";
|
|
212
|
+
};
|
|
213
|
+
export type AppResourceAuthKindEnum = typeof AppResourceAuthKindEnum[keyof typeof AppResourceAuthKindEnum];
|
|
185
214
|
/**
|
|
186
215
|
* Check if a given object implements the AppResource interface.
|
|
187
216
|
*/
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* https://openapi-generator.tech
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
|
+
import { McpSecurityViewFromJSON, McpSecurityViewToJSON, } from './McpSecurityView.js';
|
|
14
15
|
import { ScopeFromJSON, ScopeToJSON, } from './Scope.js';
|
|
15
16
|
import { CapabilitiesFromJSON, CapabilitiesToJSON, } from './Capabilities.js';
|
|
16
17
|
import { FieldHighlightFromJSON, FieldHighlightToJSON, } from './FieldHighlight.js';
|
|
@@ -29,6 +30,15 @@ export const AppResourceAuthTypeEnum = {
|
|
|
29
30
|
ApiKey: 'api_key',
|
|
30
31
|
None: 'none'
|
|
31
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* @export
|
|
35
|
+
*/
|
|
36
|
+
export const AppResourceAuthKindEnum = {
|
|
37
|
+
Oauth: 'oauth',
|
|
38
|
+
ApiKey: 'api_key',
|
|
39
|
+
SharedKey: 'shared_key',
|
|
40
|
+
None: 'none'
|
|
41
|
+
};
|
|
32
42
|
/**
|
|
33
43
|
* Check if a given object implements the AppResource interface.
|
|
34
44
|
*/
|
|
@@ -81,6 +91,9 @@ export function AppResourceFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
81
91
|
'orgName': json['orgName'] == null ? undefined : json['orgName'],
|
|
82
92
|
'isManagedConnector': json['isManagedConnector'] == null ? undefined : json['isManagedConnector'],
|
|
83
93
|
'connectorMode': json['connectorMode'] == null ? undefined : json['connectorMode'],
|
|
94
|
+
'isCustom': json['isCustom'] == null ? undefined : json['isCustom'],
|
|
95
|
+
'authKind': json['authKind'] == null ? undefined : json['authKind'],
|
|
96
|
+
'security': json['security'] == null ? undefined : McpSecurityViewFromJSON(json['security']),
|
|
84
97
|
};
|
|
85
98
|
}
|
|
86
99
|
export function AppResourceToJSON(json) {
|
|
@@ -115,5 +128,8 @@ export function AppResourceToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
115
128
|
'orgName': value['orgName'],
|
|
116
129
|
'isManagedConnector': value['isManagedConnector'],
|
|
117
130
|
'connectorMode': value['connectorMode'],
|
|
131
|
+
'isCustom': value['isCustom'],
|
|
132
|
+
'authKind': value['authKind'],
|
|
133
|
+
'security': McpSecurityViewToJSON(value['security']),
|
|
118
134
|
};
|
|
119
135
|
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import type { AppToolView } from './AppToolView.js';
|
|
13
|
+
import type { McpSecurityView } from './McpSecurityView.js';
|
|
13
14
|
/**
|
|
14
15
|
* FE dialog payload for ``GET /v1/apps/{integration_id}/tools``.
|
|
15
16
|
* @export
|
|
@@ -42,12 +43,10 @@ export interface AppToolsResponse {
|
|
|
42
43
|
tools: Array<AppToolView>;
|
|
43
44
|
/**
|
|
44
45
|
*
|
|
45
|
-
* @type {
|
|
46
|
+
* @type {McpSecurityView}
|
|
46
47
|
* @memberof AppToolsResponse
|
|
47
48
|
*/
|
|
48
|
-
security?:
|
|
49
|
-
[key: string]: any;
|
|
50
|
-
} | null;
|
|
49
|
+
security?: McpSecurityView | null;
|
|
51
50
|
/**
|
|
52
51
|
*
|
|
53
52
|
* @type {string}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
import { AppToolViewFromJSON, AppToolViewToJSON, } from './AppToolView.js';
|
|
15
|
+
import { McpSecurityViewFromJSON, McpSecurityViewToJSON, } from './McpSecurityView.js';
|
|
15
16
|
/**
|
|
16
17
|
* @export
|
|
17
18
|
*/
|
|
@@ -46,7 +47,7 @@ export function AppToolsResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
46
47
|
'name': json['name'],
|
|
47
48
|
'authStatus': json['authStatus'],
|
|
48
49
|
'tools': (json['tools'].map(AppToolViewFromJSON)),
|
|
49
|
-
'security': json['security'] == null ? undefined : json['security'],
|
|
50
|
+
'security': json['security'] == null ? undefined : McpSecurityViewFromJSON(json['security']),
|
|
50
51
|
'trust': json['trust'] == null ? undefined : json['trust'],
|
|
51
52
|
};
|
|
52
53
|
}
|
|
@@ -62,7 +63,7 @@ export function AppToolsResponseToJSONTyped(value, ignoreDiscriminator = false)
|
|
|
62
63
|
'name': value['name'],
|
|
63
64
|
'authStatus': value['authStatus'],
|
|
64
65
|
'tools': (value['tools'].map(AppToolViewToJSON)),
|
|
65
|
-
'security': value['security'],
|
|
66
|
+
'security': McpSecurityViewToJSON(value['security']),
|
|
66
67
|
'trust': value['trust'],
|
|
67
68
|
};
|
|
68
69
|
}
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
import type { McpSecurityView } from './McpSecurityView.js';
|
|
13
|
+
import type { Scope } from './Scope.js';
|
|
12
14
|
import type { AppCategory } from './AppCategory.js';
|
|
13
15
|
/**
|
|
14
16
|
*
|
|
@@ -124,6 +126,42 @@ export interface AppView {
|
|
|
124
126
|
* @memberof AppView
|
|
125
127
|
*/
|
|
126
128
|
connectorMode?: string | null;
|
|
129
|
+
/**
|
|
130
|
+
*
|
|
131
|
+
* @type {boolean}
|
|
132
|
+
* @memberof AppView
|
|
133
|
+
*/
|
|
134
|
+
isCustom?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
*
|
|
137
|
+
* @type {boolean}
|
|
138
|
+
* @memberof AppView
|
|
139
|
+
*/
|
|
140
|
+
isOwnedByMe?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* @type {Scope}
|
|
144
|
+
* @memberof AppView
|
|
145
|
+
*/
|
|
146
|
+
scope?: Scope | null;
|
|
147
|
+
/**
|
|
148
|
+
*
|
|
149
|
+
* @type {string}
|
|
150
|
+
* @memberof AppView
|
|
151
|
+
*/
|
|
152
|
+
createdByName?: string | null;
|
|
153
|
+
/**
|
|
154
|
+
*
|
|
155
|
+
* @type {string}
|
|
156
|
+
* @memberof AppView
|
|
157
|
+
*/
|
|
158
|
+
authKind?: AppViewAuthKindEnum | null;
|
|
159
|
+
/**
|
|
160
|
+
*
|
|
161
|
+
* @type {McpSecurityView}
|
|
162
|
+
* @memberof AppView
|
|
163
|
+
*/
|
|
164
|
+
security?: McpSecurityView | null;
|
|
127
165
|
}
|
|
128
166
|
/**
|
|
129
167
|
* @export
|
|
@@ -134,6 +172,16 @@ export declare const AppViewAuthTypeEnum: {
|
|
|
134
172
|
readonly None: "none";
|
|
135
173
|
};
|
|
136
174
|
export type AppViewAuthTypeEnum = typeof AppViewAuthTypeEnum[keyof typeof AppViewAuthTypeEnum];
|
|
175
|
+
/**
|
|
176
|
+
* @export
|
|
177
|
+
*/
|
|
178
|
+
export declare const AppViewAuthKindEnum: {
|
|
179
|
+
readonly Oauth: "oauth";
|
|
180
|
+
readonly ApiKey: "api_key";
|
|
181
|
+
readonly SharedKey: "shared_key";
|
|
182
|
+
readonly None: "none";
|
|
183
|
+
};
|
|
184
|
+
export type AppViewAuthKindEnum = typeof AppViewAuthKindEnum[keyof typeof AppViewAuthKindEnum];
|
|
137
185
|
/**
|
|
138
186
|
* Check if a given object implements the AppView interface.
|
|
139
187
|
*/
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
* https://openapi-generator.tech
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
|
+
import { McpSecurityViewFromJSON, McpSecurityViewToJSON, } from './McpSecurityView.js';
|
|
15
|
+
import { ScopeFromJSON, ScopeToJSON, } from './Scope.js';
|
|
14
16
|
import { AppCategoryFromJSON, AppCategoryToJSON, } from './AppCategory.js';
|
|
15
17
|
/**
|
|
16
18
|
* @export
|
|
@@ -20,6 +22,15 @@ export const AppViewAuthTypeEnum = {
|
|
|
20
22
|
ApiKey: 'api_key',
|
|
21
23
|
None: 'none'
|
|
22
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* @export
|
|
27
|
+
*/
|
|
28
|
+
export const AppViewAuthKindEnum = {
|
|
29
|
+
Oauth: 'oauth',
|
|
30
|
+
ApiKey: 'api_key',
|
|
31
|
+
SharedKey: 'shared_key',
|
|
32
|
+
None: 'none'
|
|
33
|
+
};
|
|
23
34
|
/**
|
|
24
35
|
* Check if a given object implements the AppView interface.
|
|
25
36
|
*/
|
|
@@ -72,6 +83,12 @@ export function AppViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
72
83
|
'alreadyUsingUrl': json['alreadyUsingUrl'] == null ? undefined : json['alreadyUsingUrl'],
|
|
73
84
|
'isManagedConnector': json['isManagedConnector'] == null ? undefined : json['isManagedConnector'],
|
|
74
85
|
'connectorMode': json['connectorMode'] == null ? undefined : json['connectorMode'],
|
|
86
|
+
'isCustom': json['isCustom'] == null ? undefined : json['isCustom'],
|
|
87
|
+
'isOwnedByMe': json['isOwnedByMe'] == null ? undefined : json['isOwnedByMe'],
|
|
88
|
+
'scope': json['scope'] == null ? undefined : ScopeFromJSON(json['scope']),
|
|
89
|
+
'createdByName': json['createdByName'] == null ? undefined : json['createdByName'],
|
|
90
|
+
'authKind': json['authKind'] == null ? undefined : json['authKind'],
|
|
91
|
+
'security': json['security'] == null ? undefined : McpSecurityViewFromJSON(json['security']),
|
|
75
92
|
};
|
|
76
93
|
}
|
|
77
94
|
export function AppViewToJSON(json) {
|
|
@@ -100,5 +117,11 @@ export function AppViewToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
100
117
|
'alreadyUsingUrl': value['alreadyUsingUrl'],
|
|
101
118
|
'isManagedConnector': value['isManagedConnector'],
|
|
102
119
|
'connectorMode': value['connectorMode'],
|
|
120
|
+
'isCustom': value['isCustom'],
|
|
121
|
+
'isOwnedByMe': value['isOwnedByMe'],
|
|
122
|
+
'scope': ScopeToJSON(value['scope']),
|
|
123
|
+
'createdByName': value['createdByName'],
|
|
124
|
+
'authKind': value['authKind'],
|
|
125
|
+
'security': McpSecurityViewToJSON(value['security']),
|
|
103
126
|
};
|
|
104
127
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sarvam Agents API
|
|
3
|
+
* Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
* Contact: support@sarvam.ai
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Appeal metadata on a BYO security projection. Status ``none`` when idle.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface McpSecurityAppealView
|
|
16
|
+
*/
|
|
17
|
+
export interface McpSecurityAppealView {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof McpSecurityAppealView
|
|
22
|
+
*/
|
|
23
|
+
status?: string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof McpSecurityAppealView
|
|
28
|
+
*/
|
|
29
|
+
contactEmail?: string | null;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof McpSecurityAppealView
|
|
34
|
+
*/
|
|
35
|
+
contactPhone?: string | null;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof McpSecurityAppealView
|
|
40
|
+
*/
|
|
41
|
+
denialReason?: string | null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Check if a given object implements the McpSecurityAppealView interface.
|
|
45
|
+
*/
|
|
46
|
+
export declare function instanceOfMcpSecurityAppealView(value: object): value is McpSecurityAppealView;
|
|
47
|
+
export declare function McpSecurityAppealViewFromJSON(json: any): McpSecurityAppealView;
|
|
48
|
+
export declare function McpSecurityAppealViewFromJSONTyped(json: any, ignoreDiscriminator: boolean): McpSecurityAppealView;
|
|
49
|
+
export declare function McpSecurityAppealViewToJSON(json: any): McpSecurityAppealView;
|
|
50
|
+
export declare function McpSecurityAppealViewToJSONTyped(value?: McpSecurityAppealView | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Sarvam Agents API
|
|
5
|
+
* Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
* Contact: support@sarvam.ai
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Check if a given object implements the McpSecurityAppealView interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfMcpSecurityAppealView(value) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
export function McpSecurityAppealViewFromJSON(json) {
|
|
21
|
+
return McpSecurityAppealViewFromJSONTyped(json, false);
|
|
22
|
+
}
|
|
23
|
+
export function McpSecurityAppealViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
24
|
+
if (json == null) {
|
|
25
|
+
return json;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
'status': json['status'] == null ? undefined : json['status'],
|
|
29
|
+
'contactEmail': json['contactEmail'] == null ? undefined : json['contactEmail'],
|
|
30
|
+
'contactPhone': json['contactPhone'] == null ? undefined : json['contactPhone'],
|
|
31
|
+
'denialReason': json['denialReason'] == null ? undefined : json['denialReason'],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function McpSecurityAppealViewToJSON(json) {
|
|
35
|
+
return McpSecurityAppealViewToJSONTyped(json, false);
|
|
36
|
+
}
|
|
37
|
+
export function McpSecurityAppealViewToJSONTyped(value, ignoreDiscriminator = false) {
|
|
38
|
+
if (value == null) {
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
'status': value['status'],
|
|
43
|
+
'contactEmail': value['contactEmail'],
|
|
44
|
+
'contactPhone': value['contactPhone'],
|
|
45
|
+
'denialReason': value['denialReason'],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sarvam Agents API
|
|
3
|
+
* Chat with a Sarvam agent, exchange files with it, and set it up (instructions, skills, knowledge bases, connectors, deploy) from your own code. Authenticate with a service token sent as a Bearer token, and send the header X-Panja-Origin: managed_agents on every request.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
* Contact: support@sarvam.ai
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { McpSecurityAppealView } from './McpSecurityAppealView.js';
|
|
13
|
+
/**
|
|
14
|
+
* Card-facing BYO security object (list, agent-bound apps, catalog, tools).
|
|
15
|
+
* @export
|
|
16
|
+
* @interface McpSecurityView
|
|
17
|
+
*/
|
|
18
|
+
export interface McpSecurityView {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof McpSecurityView
|
|
23
|
+
*/
|
|
24
|
+
state?: string | null;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @memberof McpSecurityView
|
|
29
|
+
*/
|
|
30
|
+
progress?: string | null;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @type {boolean}
|
|
34
|
+
* @memberof McpSecurityView
|
|
35
|
+
*/
|
|
36
|
+
blocking?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {boolean}
|
|
40
|
+
* @memberof McpSecurityView
|
|
41
|
+
*/
|
|
42
|
+
enforced?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {string}
|
|
46
|
+
* @memberof McpSecurityView
|
|
47
|
+
*/
|
|
48
|
+
lastFailure?: string | null;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @type {string}
|
|
52
|
+
* @memberof McpSecurityView
|
|
53
|
+
*/
|
|
54
|
+
message?: string | null;
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @type {boolean}
|
|
58
|
+
* @memberof McpSecurityView
|
|
59
|
+
*/
|
|
60
|
+
ownerActionRequired?: boolean | null;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @type {boolean}
|
|
64
|
+
* @memberof McpSecurityView
|
|
65
|
+
*/
|
|
66
|
+
unverifiable?: boolean | null;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @type {number}
|
|
70
|
+
* @memberof McpSecurityView
|
|
71
|
+
*/
|
|
72
|
+
auditAttempts?: number;
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @type {number}
|
|
76
|
+
* @memberof McpSecurityView
|
|
77
|
+
*/
|
|
78
|
+
auditAttemptLimit?: number;
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @type {number}
|
|
82
|
+
* @memberof McpSecurityView
|
|
83
|
+
*/
|
|
84
|
+
attemptsRemaining?: number;
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @type {Array<string>}
|
|
88
|
+
* @memberof McpSecurityView
|
|
89
|
+
*/
|
|
90
|
+
lastHoldReasons?: Array<string>;
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
* @type {McpSecurityAppealView}
|
|
94
|
+
* @memberof McpSecurityView
|
|
95
|
+
*/
|
|
96
|
+
appeal?: McpSecurityAppealView | null;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Check if a given object implements the McpSecurityView interface.
|
|
100
|
+
*/
|
|
101
|
+
export declare function instanceOfMcpSecurityView(value: object): value is McpSecurityView;
|
|
102
|
+
export declare function McpSecurityViewFromJSON(json: any): McpSecurityView;
|
|
103
|
+
export declare function McpSecurityViewFromJSONTyped(json: any, ignoreDiscriminator: boolean): McpSecurityView;
|
|
104
|
+
export declare function McpSecurityViewToJSON(json: any): McpSecurityView;
|
|
105
|
+
export declare function McpSecurityViewToJSONTyped(value?: McpSecurityView | null, ignoreDiscriminator?: boolean): any;
|