@vectros-ai/mcp-server 0.18.1 → 0.19.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 -1
- package/README.md +105 -28
- package/dist/cli-http.js +1430 -302
- package/dist/cli-http.js.map +1 -1
- package/dist/cli-http.mjs +1430 -302
- package/dist/cli-http.mjs.map +1 -1
- package/dist/cli.js +1428 -300
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1428 -300
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +10 -11
- package/dist/index.d.ts +10 -11
- package/dist/index.js +1428 -300
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1428 -300
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/server.ts
|
|
2
2
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
3
|
|
|
4
|
-
//
|
|
4
|
+
// node_modules/@vectros-ai/sdk/dist/index.mjs
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __export = (target, all) => {
|
|
7
7
|
for (var name in all)
|
|
@@ -16,10 +16,13 @@ __export(api_exports, {
|
|
|
16
16
|
BatchWriteRequest: () => BatchWriteRequest,
|
|
17
17
|
BatchWriteResult: () => BatchWriteResult,
|
|
18
18
|
ChatMessage: () => ChatMessage,
|
|
19
|
+
ChatRequest: () => ChatRequest,
|
|
19
20
|
ConflictError: () => ConflictError,
|
|
20
21
|
ContentDeltaEvent: () => ContentDeltaEvent,
|
|
21
22
|
ContentTooLargeError: () => ContentTooLargeError,
|
|
23
|
+
DocumentAskRequest: () => DocumentAskRequest,
|
|
22
24
|
DocumentContextEvent: () => DocumentContextEvent,
|
|
25
|
+
DocumentExtraction: () => DocumentExtraction,
|
|
23
26
|
DocumentLookupRequest: () => DocumentLookupRequest,
|
|
24
27
|
DocumentPatchRequest: () => DocumentPatchRequest,
|
|
25
28
|
DocumentRequest: () => DocumentRequest,
|
|
@@ -49,8 +52,10 @@ __export(api_exports, {
|
|
|
49
52
|
NotImplementedError: () => NotImplementedError,
|
|
50
53
|
PaymentRequiredError: () => PaymentRequiredError,
|
|
51
54
|
PingResponse: () => PingResponse,
|
|
55
|
+
RagRequest: () => RagRequest,
|
|
52
56
|
RagSearch: () => RagSearch,
|
|
53
57
|
ReadAccessLogResponse: () => ReadAccessLogResponse,
|
|
58
|
+
ReasoningDeltaEvent: () => ReasoningDeltaEvent,
|
|
54
59
|
RecordLookupRequest: () => RecordLookupRequest,
|
|
55
60
|
RecordRequest: () => RecordRequest,
|
|
56
61
|
RecordResponse: () => RecordResponse,
|
|
@@ -70,6 +75,7 @@ __export(api_exports, {
|
|
|
70
75
|
UserExistsResponse: () => UserExistsResponse,
|
|
71
76
|
UserRequest: () => UserRequest,
|
|
72
77
|
UserResponse: () => UserResponse,
|
|
78
|
+
agents: () => agents_exports,
|
|
73
79
|
auth: () => auth_exports,
|
|
74
80
|
compliance: () => compliance_exports,
|
|
75
81
|
documents: () => documents_exports,
|
|
@@ -335,6 +341,7 @@ var UnprocessableEntityError = class extends VectrosError {
|
|
|
335
341
|
this.name = this.constructor.name;
|
|
336
342
|
}
|
|
337
343
|
};
|
|
344
|
+
var agents_exports = {};
|
|
338
345
|
var auth_exports = {};
|
|
339
346
|
var ErasureRequest;
|
|
340
347
|
((ErasureRequest2) => {
|
|
@@ -406,7 +413,33 @@ var ListUsersRequestOrder = {
|
|
|
406
413
|
Asc: "asc",
|
|
407
414
|
Desc: "desc"
|
|
408
415
|
};
|
|
416
|
+
var ChatRequest;
|
|
417
|
+
((ChatRequest2) => {
|
|
418
|
+
ChatRequest2.Reasoning = {
|
|
419
|
+
Omit: "omit",
|
|
420
|
+
Stream: "stream"
|
|
421
|
+
};
|
|
422
|
+
})(ChatRequest || (ChatRequest = {}));
|
|
423
|
+
var DocumentAskRequest;
|
|
424
|
+
((DocumentAskRequest2) => {
|
|
425
|
+
DocumentAskRequest2.Reasoning = {
|
|
426
|
+
Omit: "omit",
|
|
427
|
+
Stream: "stream"
|
|
428
|
+
};
|
|
429
|
+
})(DocumentAskRequest || (DocumentAskRequest = {}));
|
|
430
|
+
var RagRequest;
|
|
431
|
+
((RagRequest2) => {
|
|
432
|
+
RagRequest2.Reasoning = {
|
|
433
|
+
Omit: "omit",
|
|
434
|
+
Stream: "stream"
|
|
435
|
+
};
|
|
436
|
+
})(RagRequest || (RagRequest = {}));
|
|
409
437
|
var inference_exports = {};
|
|
438
|
+
__export(inference_exports, {
|
|
439
|
+
ChatRequest: () => ChatRequest,
|
|
440
|
+
DocumentAskRequest: () => DocumentAskRequest,
|
|
441
|
+
RagRequest: () => RagRequest
|
|
442
|
+
});
|
|
410
443
|
var BatchWriteRequest;
|
|
411
444
|
((BatchWriteRequest2) => {
|
|
412
445
|
BatchWriteRequest2.Atomicity = {
|
|
@@ -513,6 +546,18 @@ var DocumentContextEvent;
|
|
|
513
546
|
DocumentContext: "document_context"
|
|
514
547
|
};
|
|
515
548
|
})(DocumentContextEvent || (DocumentContextEvent = {}));
|
|
549
|
+
var DocumentExtraction;
|
|
550
|
+
((DocumentExtraction2) => {
|
|
551
|
+
DocumentExtraction2.Outcome = {
|
|
552
|
+
Ok: "OK",
|
|
553
|
+
Truncated: "TRUNCATED",
|
|
554
|
+
NoText: "NO_TEXT",
|
|
555
|
+
Encrypted: "ENCRYPTED",
|
|
556
|
+
Unsupported: "UNSUPPORTED",
|
|
557
|
+
TooLarge: "TOO_LARGE",
|
|
558
|
+
Unreadable: "UNREADABLE"
|
|
559
|
+
};
|
|
560
|
+
})(DocumentExtraction || (DocumentExtraction = {}));
|
|
516
561
|
var DocumentRequest;
|
|
517
562
|
((DocumentRequest2) => {
|
|
518
563
|
DocumentRequest2.IndexMode = {
|
|
@@ -679,6 +724,12 @@ var ReadAccessLogResponse;
|
|
|
679
724
|
Rag: "rag"
|
|
680
725
|
};
|
|
681
726
|
})(ReadAccessLogResponse || (ReadAccessLogResponse = {}));
|
|
727
|
+
var ReasoningDeltaEvent;
|
|
728
|
+
((ReasoningDeltaEvent2) => {
|
|
729
|
+
ReasoningDeltaEvent2.Event = {
|
|
730
|
+
ReasoningDelta: "reasoning_delta"
|
|
731
|
+
};
|
|
732
|
+
})(ReasoningDeltaEvent || (ReasoningDeltaEvent = {}));
|
|
682
733
|
var RecordRequest;
|
|
683
734
|
((RecordRequest2) => {
|
|
684
735
|
RecordRequest2.Status = {
|
|
@@ -1812,13 +1863,13 @@ function joinPathSegments(left, right) {
|
|
|
1812
1863
|
}
|
|
1813
1864
|
return `${left}/${right}`;
|
|
1814
1865
|
}
|
|
1815
|
-
function trimSlashes(
|
|
1816
|
-
if (!
|
|
1866
|
+
function trimSlashes(str2) {
|
|
1867
|
+
if (!str2) return str2;
|
|
1817
1868
|
let start = 0;
|
|
1818
|
-
let end =
|
|
1819
|
-
if (
|
|
1820
|
-
if (
|
|
1821
|
-
return start === 0 && end ===
|
|
1869
|
+
let end = str2.length;
|
|
1870
|
+
if (str2.startsWith("/")) start = 1;
|
|
1871
|
+
if (str2.endsWith("/")) end = str2.length - 1;
|
|
1872
|
+
return start === 0 && end === str2.length ? str2 : str2.slice(start, end);
|
|
1822
1873
|
}
|
|
1823
1874
|
var Supplier = {
|
|
1824
1875
|
get: async (supplier) => {
|
|
@@ -2241,140 +2292,767 @@ var QueryStringBuilder = class {
|
|
|
2241
2292
|
}
|
|
2242
2293
|
}
|
|
2243
2294
|
}
|
|
2244
|
-
return this;
|
|
2295
|
+
return this;
|
|
2296
|
+
}
|
|
2297
|
+
/**
|
|
2298
|
+
* Returns the assembled query string (without the leading `?`).
|
|
2299
|
+
* Returns an empty string when no parameters were added.
|
|
2300
|
+
*/
|
|
2301
|
+
build() {
|
|
2302
|
+
return [...this.parts.values()].join("&");
|
|
2303
|
+
}
|
|
2304
|
+
};
|
|
2305
|
+
var TOKEN_PARAM = "token";
|
|
2306
|
+
var BearerAuthProvider = class _BearerAuthProvider {
|
|
2307
|
+
constructor(options) {
|
|
2308
|
+
this.options = options;
|
|
2309
|
+
}
|
|
2310
|
+
static canCreate(options) {
|
|
2311
|
+
return options?.[TOKEN_PARAM] != null;
|
|
2312
|
+
}
|
|
2313
|
+
async getAuthRequest({
|
|
2314
|
+
endpointMetadata
|
|
2315
|
+
} = {}) {
|
|
2316
|
+
const token = await Supplier.get(this.options[TOKEN_PARAM]);
|
|
2317
|
+
if (token == null) {
|
|
2318
|
+
throw new VectrosError({
|
|
2319
|
+
message: _BearerAuthProvider.AUTH_CONFIG_ERROR_MESSAGE
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
return {
|
|
2323
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
2324
|
+
};
|
|
2325
|
+
}
|
|
2326
|
+
};
|
|
2327
|
+
((BearerAuthProvider2) => {
|
|
2328
|
+
BearerAuthProvider2.AUTH_SCHEME = "BearerAuth";
|
|
2329
|
+
BearerAuthProvider2.AUTH_CONFIG_ERROR_MESSAGE = `Please provide '${TOKEN_PARAM}' when initializing the client`;
|
|
2330
|
+
function createInstance(options) {
|
|
2331
|
+
return new BearerAuthProvider2(options);
|
|
2332
|
+
}
|
|
2333
|
+
BearerAuthProvider2.createInstance = createInstance;
|
|
2334
|
+
})(BearerAuthProvider || (BearerAuthProvider = {}));
|
|
2335
|
+
function mergeHeaders(...headersArray) {
|
|
2336
|
+
const result = {};
|
|
2337
|
+
for (const [key, value] of headersArray.filter((headers) => headers != null).flatMap((headers) => Object.entries(headers))) {
|
|
2338
|
+
const insensitiveKey = key.toLowerCase();
|
|
2339
|
+
if (value != null) {
|
|
2340
|
+
result[insensitiveKey] = value;
|
|
2341
|
+
} else if (insensitiveKey in result) {
|
|
2342
|
+
delete result[insensitiveKey];
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
return result;
|
|
2346
|
+
}
|
|
2347
|
+
function mergeOnlyDefinedHeaders(...headersArray) {
|
|
2348
|
+
const result = {};
|
|
2349
|
+
for (const [key, value] of headersArray.filter((headers) => headers != null).flatMap((headers) => Object.entries(headers))) {
|
|
2350
|
+
const insensitiveKey = key.toLowerCase();
|
|
2351
|
+
if (value != null) {
|
|
2352
|
+
result[insensitiveKey] = value;
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
return result;
|
|
2356
|
+
}
|
|
2357
|
+
function normalizeClientOptions(options) {
|
|
2358
|
+
const headers = mergeHeaders(
|
|
2359
|
+
{
|
|
2360
|
+
"X-Fern-Language": "JavaScript",
|
|
2361
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
2362
|
+
"X-Fern-Runtime-Version": RUNTIME.version
|
|
2363
|
+
},
|
|
2364
|
+
options?.headers
|
|
2365
|
+
);
|
|
2366
|
+
return {
|
|
2367
|
+
...options,
|
|
2368
|
+
logging: logging_exports.createLogger(options?.logging),
|
|
2369
|
+
headers
|
|
2370
|
+
};
|
|
2371
|
+
}
|
|
2372
|
+
function normalizeClientOptionsWithAuth(options) {
|
|
2373
|
+
const normalized = normalizeClientOptions(options);
|
|
2374
|
+
if (options.auth === false) {
|
|
2375
|
+
normalized.authProvider = new NoOpAuthProvider();
|
|
2376
|
+
return normalized;
|
|
2377
|
+
}
|
|
2378
|
+
if (options.auth != null) {
|
|
2379
|
+
if (typeof options.auth === "function") {
|
|
2380
|
+
normalized.authProvider = { getAuthRequest: options.auth };
|
|
2381
|
+
return normalized;
|
|
2382
|
+
}
|
|
2383
|
+
if (isAuthProvider(options.auth)) {
|
|
2384
|
+
normalized.authProvider = options.auth;
|
|
2385
|
+
return normalized;
|
|
2386
|
+
}
|
|
2387
|
+
Object.assign(normalized, options.auth);
|
|
2388
|
+
}
|
|
2389
|
+
const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
|
|
2390
|
+
normalized.authProvider ?? (normalized.authProvider = new BearerAuthProvider(normalizedWithNoOpAuthProvider));
|
|
2391
|
+
return normalized;
|
|
2392
|
+
}
|
|
2393
|
+
function withNoOpAuthProvider(options) {
|
|
2394
|
+
return {
|
|
2395
|
+
...options,
|
|
2396
|
+
authProvider: new NoOpAuthProvider()
|
|
2397
|
+
};
|
|
2398
|
+
}
|
|
2399
|
+
function handleNonStatusCodeError(error, rawResponse, method, path) {
|
|
2400
|
+
switch (error.reason) {
|
|
2401
|
+
case "non-json":
|
|
2402
|
+
throw new VectrosError({
|
|
2403
|
+
statusCode: error.statusCode,
|
|
2404
|
+
body: error.rawBody,
|
|
2405
|
+
rawResponse
|
|
2406
|
+
});
|
|
2407
|
+
case "body-is-null":
|
|
2408
|
+
throw new VectrosError({
|
|
2409
|
+
statusCode: error.statusCode,
|
|
2410
|
+
rawResponse
|
|
2411
|
+
});
|
|
2412
|
+
case "timeout":
|
|
2413
|
+
throw new VectrosTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, {
|
|
2414
|
+
cause: error.cause
|
|
2415
|
+
});
|
|
2416
|
+
case "unknown":
|
|
2417
|
+
throw new VectrosError({
|
|
2418
|
+
message: error.errorMessage,
|
|
2419
|
+
rawResponse,
|
|
2420
|
+
cause: error.cause
|
|
2421
|
+
});
|
|
2422
|
+
default:
|
|
2423
|
+
throw new VectrosError({
|
|
2424
|
+
message: "Unknown error",
|
|
2425
|
+
rawResponse
|
|
2426
|
+
});
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
var AgentsClient = class {
|
|
2430
|
+
constructor(options) {
|
|
2431
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
2432
|
+
}
|
|
2433
|
+
/**
|
|
2434
|
+
* Returns a page of the agents in the app context, newest first, each at its latest version. A caller holding `runs:c` but not `agents:r` gets only each agent's `id`, `name`, `description`, `latestVersion` and `status`. Retired and purged agents are left out unless `includeRetired=true`. Requires `agents:r` or `runs:c`.
|
|
2435
|
+
*
|
|
2436
|
+
* @param {Vectros.ListAgentsRequest} request
|
|
2437
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2438
|
+
*
|
|
2439
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
2440
|
+
*
|
|
2441
|
+
* @example
|
|
2442
|
+
* await client.agents.listAgents()
|
|
2443
|
+
*/
|
|
2444
|
+
listAgents(request = {}, requestOptions) {
|
|
2445
|
+
return HttpResponsePromise.fromPromise(this.__listAgents(request, requestOptions));
|
|
2446
|
+
}
|
|
2447
|
+
async __listAgents(request = {}, requestOptions) {
|
|
2448
|
+
const { contextId, includeRetired, startFrom, limit } = request;
|
|
2449
|
+
const _queryParams = {
|
|
2450
|
+
contextId,
|
|
2451
|
+
includeRetired,
|
|
2452
|
+
startFrom,
|
|
2453
|
+
limit
|
|
2454
|
+
};
|
|
2455
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2456
|
+
const _headers = mergeHeaders(
|
|
2457
|
+
_authRequest.headers,
|
|
2458
|
+
this._options?.headers,
|
|
2459
|
+
requestOptions?.headers
|
|
2460
|
+
);
|
|
2461
|
+
const _response = await fetcher({
|
|
2462
|
+
url: url_exports.join(
|
|
2463
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2464
|
+
"v1/agents"
|
|
2465
|
+
),
|
|
2466
|
+
method: "GET",
|
|
2467
|
+
headers: _headers,
|
|
2468
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2469
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
2470
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
2471
|
+
abortSignal: requestOptions?.abortSignal,
|
|
2472
|
+
fetchFn: this._options?.fetch,
|
|
2473
|
+
logging: this._options.logging
|
|
2474
|
+
});
|
|
2475
|
+
if (_response.ok) {
|
|
2476
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2477
|
+
}
|
|
2478
|
+
if (_response.error.reason === "status-code") {
|
|
2479
|
+
switch (_response.error.statusCode) {
|
|
2480
|
+
case 403:
|
|
2481
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2482
|
+
default:
|
|
2483
|
+
throw new VectrosError({
|
|
2484
|
+
statusCode: _response.error.statusCode,
|
|
2485
|
+
body: _response.error.body,
|
|
2486
|
+
rawResponse: _response.rawResponse
|
|
2487
|
+
});
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/agents");
|
|
2491
|
+
}
|
|
2492
|
+
/**
|
|
2493
|
+
* Stores a new agent at version 1, or returns the existing agent of this name unchanged. With `?upsert=true` an existing agent whose definition differs gets a new version instead. Requires the `agents:c` scope (also `agents:u` with `?upsert=true`).
|
|
2494
|
+
*
|
|
2495
|
+
* @param {Vectros.CreateAgentRequest} request
|
|
2496
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2497
|
+
*
|
|
2498
|
+
* @throws {@link Vectros.BadRequestError}
|
|
2499
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
2500
|
+
* @throws {@link Vectros.ConflictError}
|
|
2501
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2502
|
+
*
|
|
2503
|
+
* @example
|
|
2504
|
+
* await client.agents.createAgent({
|
|
2505
|
+
* body: {
|
|
2506
|
+
* model: "claude-sonnet-5-5"
|
|
2507
|
+
* }
|
|
2508
|
+
* })
|
|
2509
|
+
*/
|
|
2510
|
+
createAgent(request, requestOptions) {
|
|
2511
|
+
return HttpResponsePromise.fromPromise(this.__createAgent(request, requestOptions));
|
|
2512
|
+
}
|
|
2513
|
+
async __createAgent(request, requestOptions) {
|
|
2514
|
+
const { upsert, contextId, body: _body } = request;
|
|
2515
|
+
const _queryParams = {
|
|
2516
|
+
upsert,
|
|
2517
|
+
contextId
|
|
2518
|
+
};
|
|
2519
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2520
|
+
const _headers = mergeHeaders(
|
|
2521
|
+
_authRequest.headers,
|
|
2522
|
+
this._options?.headers,
|
|
2523
|
+
requestOptions?.headers
|
|
2524
|
+
);
|
|
2525
|
+
const _response = await fetcher({
|
|
2526
|
+
url: url_exports.join(
|
|
2527
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2528
|
+
"v1/agents"
|
|
2529
|
+
),
|
|
2530
|
+
method: "POST",
|
|
2531
|
+
headers: _headers,
|
|
2532
|
+
contentType: "application/json",
|
|
2533
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2534
|
+
requestType: "json",
|
|
2535
|
+
body: _body,
|
|
2536
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
2537
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
2538
|
+
abortSignal: requestOptions?.abortSignal,
|
|
2539
|
+
fetchFn: this._options?.fetch,
|
|
2540
|
+
logging: this._options.logging
|
|
2541
|
+
});
|
|
2542
|
+
if (_response.ok) {
|
|
2543
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2544
|
+
}
|
|
2545
|
+
if (_response.error.reason === "status-code") {
|
|
2546
|
+
switch (_response.error.statusCode) {
|
|
2547
|
+
case 400:
|
|
2548
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
2549
|
+
case 403:
|
|
2550
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2551
|
+
case 409:
|
|
2552
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
2553
|
+
case 429:
|
|
2554
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2555
|
+
default:
|
|
2556
|
+
throw new VectrosError({
|
|
2557
|
+
statusCode: _response.error.statusCode,
|
|
2558
|
+
body: _response.error.body,
|
|
2559
|
+
rawResponse: _response.rawResponse
|
|
2560
|
+
});
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/agents");
|
|
2564
|
+
}
|
|
2565
|
+
/**
|
|
2566
|
+
* Returns the agent at its latest version, or at `version`. Requires the `agents:r` scope.
|
|
2567
|
+
*
|
|
2568
|
+
* @param {Vectros.GetAgentRequest} request
|
|
2569
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2570
|
+
*
|
|
2571
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
2572
|
+
* @throws {@link Vectros.NotFoundError}
|
|
2573
|
+
*
|
|
2574
|
+
* @example
|
|
2575
|
+
* await client.agents.getAgent({
|
|
2576
|
+
* id: "id"
|
|
2577
|
+
* })
|
|
2578
|
+
*/
|
|
2579
|
+
getAgent(request, requestOptions) {
|
|
2580
|
+
return HttpResponsePromise.fromPromise(this.__getAgent(request, requestOptions));
|
|
2581
|
+
}
|
|
2582
|
+
async __getAgent(request, requestOptions) {
|
|
2583
|
+
const { id, contextId, version } = request;
|
|
2584
|
+
const _queryParams = {
|
|
2585
|
+
contextId,
|
|
2586
|
+
version
|
|
2587
|
+
};
|
|
2588
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2589
|
+
const _headers = mergeHeaders(
|
|
2590
|
+
_authRequest.headers,
|
|
2591
|
+
this._options?.headers,
|
|
2592
|
+
requestOptions?.headers
|
|
2593
|
+
);
|
|
2594
|
+
const _response = await fetcher({
|
|
2595
|
+
url: url_exports.join(
|
|
2596
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2597
|
+
`v1/agents/${url_exports.encodePathParam(id)}`
|
|
2598
|
+
),
|
|
2599
|
+
method: "GET",
|
|
2600
|
+
headers: _headers,
|
|
2601
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2602
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
2603
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
2604
|
+
abortSignal: requestOptions?.abortSignal,
|
|
2605
|
+
fetchFn: this._options?.fetch,
|
|
2606
|
+
logging: this._options.logging
|
|
2607
|
+
});
|
|
2608
|
+
if (_response.ok) {
|
|
2609
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2610
|
+
}
|
|
2611
|
+
if (_response.error.reason === "status-code") {
|
|
2612
|
+
switch (_response.error.statusCode) {
|
|
2613
|
+
case 403:
|
|
2614
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2615
|
+
case 404:
|
|
2616
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2617
|
+
default:
|
|
2618
|
+
throw new VectrosError({
|
|
2619
|
+
statusCode: _response.error.statusCode,
|
|
2620
|
+
body: _response.error.body,
|
|
2621
|
+
rawResponse: _response.rawResponse
|
|
2622
|
+
});
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/agents/{id}");
|
|
2626
|
+
}
|
|
2627
|
+
/**
|
|
2628
|
+
* Stores the body as the agent's next version. Earlier versions never change. Every optional field you leave out takes its default; `model` is required. With `?restore=true` a retired agent becomes active again with this version. Requires the `agents:u` scope.
|
|
2629
|
+
*
|
|
2630
|
+
* @param {Vectros.UpdateAgentRequest} request
|
|
2631
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2632
|
+
*
|
|
2633
|
+
* @throws {@link Vectros.BadRequestError}
|
|
2634
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
2635
|
+
* @throws {@link Vectros.NotFoundError}
|
|
2636
|
+
* @throws {@link Vectros.ConflictError}
|
|
2637
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2638
|
+
*
|
|
2639
|
+
* @example
|
|
2640
|
+
* await client.agents.updateAgent({
|
|
2641
|
+
* id: "id",
|
|
2642
|
+
* body: {
|
|
2643
|
+
* model: "claude-sonnet-5-5"
|
|
2644
|
+
* }
|
|
2645
|
+
* })
|
|
2646
|
+
*/
|
|
2647
|
+
updateAgent(request, requestOptions) {
|
|
2648
|
+
return HttpResponsePromise.fromPromise(this.__updateAgent(request, requestOptions));
|
|
2649
|
+
}
|
|
2650
|
+
async __updateAgent(request, requestOptions) {
|
|
2651
|
+
const { id, restore, contextId, body: _body } = request;
|
|
2652
|
+
const _queryParams = {
|
|
2653
|
+
restore,
|
|
2654
|
+
contextId
|
|
2655
|
+
};
|
|
2656
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2657
|
+
const _headers = mergeHeaders(
|
|
2658
|
+
_authRequest.headers,
|
|
2659
|
+
this._options?.headers,
|
|
2660
|
+
requestOptions?.headers
|
|
2661
|
+
);
|
|
2662
|
+
const _response = await fetcher({
|
|
2663
|
+
url: url_exports.join(
|
|
2664
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2665
|
+
`v1/agents/${url_exports.encodePathParam(id)}`
|
|
2666
|
+
),
|
|
2667
|
+
method: "PUT",
|
|
2668
|
+
headers: _headers,
|
|
2669
|
+
contentType: "application/json",
|
|
2670
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2671
|
+
requestType: "json",
|
|
2672
|
+
body: _body,
|
|
2673
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
2674
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
2675
|
+
abortSignal: requestOptions?.abortSignal,
|
|
2676
|
+
fetchFn: this._options?.fetch,
|
|
2677
|
+
logging: this._options.logging
|
|
2678
|
+
});
|
|
2679
|
+
if (_response.ok) {
|
|
2680
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2681
|
+
}
|
|
2682
|
+
if (_response.error.reason === "status-code") {
|
|
2683
|
+
switch (_response.error.statusCode) {
|
|
2684
|
+
case 400:
|
|
2685
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
2686
|
+
case 403:
|
|
2687
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2688
|
+
case 404:
|
|
2689
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2690
|
+
case 409:
|
|
2691
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
2692
|
+
case 429:
|
|
2693
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2694
|
+
default:
|
|
2695
|
+
throw new VectrosError({
|
|
2696
|
+
statusCode: _response.error.statusCode,
|
|
2697
|
+
body: _response.error.body,
|
|
2698
|
+
rawResponse: _response.rawResponse
|
|
2699
|
+
});
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2702
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/agents/{id}");
|
|
2703
|
+
}
|
|
2704
|
+
/**
|
|
2705
|
+
* Retires the agent: its versions stay readable, it leaves the default listing, and it can be restored. With `?purge=true` a retired agent's content (every version's prompt, description, tools, model, limits and budget) is erased, leaving its id, name, version numbers and timestamps; its change history keeps only a one-way hash of the prompt, description and tools. If the agent is restored while a purge is running, the purge stops (409) and versions it already erased stay erased; purge it again after retiring it. With `?purge=true&version=N` one version that is not the latest is erased. The name of a purged agent stays reserved. Requires the `agents:d` scope.
|
|
2706
|
+
*
|
|
2707
|
+
* @param {Vectros.DeleteAgentRequest} request
|
|
2708
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2709
|
+
*
|
|
2710
|
+
* @throws {@link Vectros.BadRequestError}
|
|
2711
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
2712
|
+
* @throws {@link Vectros.NotFoundError}
|
|
2713
|
+
* @throws {@link Vectros.ConflictError}
|
|
2714
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2715
|
+
*
|
|
2716
|
+
* @example
|
|
2717
|
+
* await client.agents.deleteAgent({
|
|
2718
|
+
* id: "id"
|
|
2719
|
+
* })
|
|
2720
|
+
*/
|
|
2721
|
+
deleteAgent(request, requestOptions) {
|
|
2722
|
+
return HttpResponsePromise.fromPromise(this.__deleteAgent(request, requestOptions));
|
|
2723
|
+
}
|
|
2724
|
+
async __deleteAgent(request, requestOptions) {
|
|
2725
|
+
const { id, purge, version, contextId } = request;
|
|
2726
|
+
const _queryParams = {
|
|
2727
|
+
purge,
|
|
2728
|
+
version,
|
|
2729
|
+
contextId
|
|
2730
|
+
};
|
|
2731
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2732
|
+
const _headers = mergeHeaders(
|
|
2733
|
+
_authRequest.headers,
|
|
2734
|
+
this._options?.headers,
|
|
2735
|
+
requestOptions?.headers
|
|
2736
|
+
);
|
|
2737
|
+
const _response = await fetcher({
|
|
2738
|
+
url: url_exports.join(
|
|
2739
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2740
|
+
`v1/agents/${url_exports.encodePathParam(id)}`
|
|
2741
|
+
),
|
|
2742
|
+
method: "DELETE",
|
|
2743
|
+
headers: _headers,
|
|
2744
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2745
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
2746
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
2747
|
+
abortSignal: requestOptions?.abortSignal,
|
|
2748
|
+
fetchFn: this._options?.fetch,
|
|
2749
|
+
logging: this._options.logging
|
|
2750
|
+
});
|
|
2751
|
+
if (_response.ok) {
|
|
2752
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2753
|
+
}
|
|
2754
|
+
if (_response.error.reason === "status-code") {
|
|
2755
|
+
switch (_response.error.statusCode) {
|
|
2756
|
+
case 400:
|
|
2757
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
2758
|
+
case 403:
|
|
2759
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2760
|
+
case 404:
|
|
2761
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2762
|
+
case 409:
|
|
2763
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
2764
|
+
case 429:
|
|
2765
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2766
|
+
default:
|
|
2767
|
+
throw new VectrosError({
|
|
2768
|
+
statusCode: _response.error.statusCode,
|
|
2769
|
+
body: _response.error.body,
|
|
2770
|
+
rawResponse: _response.rawResponse
|
|
2771
|
+
});
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2774
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/agents/{id}");
|
|
2775
|
+
}
|
|
2776
|
+
/**
|
|
2777
|
+
* Returns a page of the agent's versions, newest first: who wrote each and when, and whether it was purged. With `includeContent=true` each entry carries its full definition. Requires the `agents:r` scope.
|
|
2778
|
+
*
|
|
2779
|
+
* @param {Vectros.ListAgentVersionsRequest} request
|
|
2780
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2781
|
+
*
|
|
2782
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
2783
|
+
* @throws {@link Vectros.NotFoundError}
|
|
2784
|
+
*
|
|
2785
|
+
* @example
|
|
2786
|
+
* await client.agents.listAgentVersions({
|
|
2787
|
+
* id: "id"
|
|
2788
|
+
* })
|
|
2789
|
+
*/
|
|
2790
|
+
listAgentVersions(request, requestOptions) {
|
|
2791
|
+
return HttpResponsePromise.fromPromise(this.__listAgentVersions(request, requestOptions));
|
|
2792
|
+
}
|
|
2793
|
+
async __listAgentVersions(request, requestOptions) {
|
|
2794
|
+
const { id, contextId, includeContent, startFrom, limit } = request;
|
|
2795
|
+
const _queryParams = {
|
|
2796
|
+
contextId,
|
|
2797
|
+
includeContent,
|
|
2798
|
+
startFrom,
|
|
2799
|
+
limit
|
|
2800
|
+
};
|
|
2801
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2802
|
+
const _headers = mergeHeaders(
|
|
2803
|
+
_authRequest.headers,
|
|
2804
|
+
this._options?.headers,
|
|
2805
|
+
requestOptions?.headers
|
|
2806
|
+
);
|
|
2807
|
+
const _response = await fetcher({
|
|
2808
|
+
url: url_exports.join(
|
|
2809
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2810
|
+
`v1/agents/${url_exports.encodePathParam(id)}/versions`
|
|
2811
|
+
),
|
|
2812
|
+
method: "GET",
|
|
2813
|
+
headers: _headers,
|
|
2814
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2815
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
2816
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
2817
|
+
abortSignal: requestOptions?.abortSignal,
|
|
2818
|
+
fetchFn: this._options?.fetch,
|
|
2819
|
+
logging: this._options.logging
|
|
2820
|
+
});
|
|
2821
|
+
if (_response.ok) {
|
|
2822
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2823
|
+
}
|
|
2824
|
+
if (_response.error.reason === "status-code") {
|
|
2825
|
+
switch (_response.error.statusCode) {
|
|
2826
|
+
case 403:
|
|
2827
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2828
|
+
case 404:
|
|
2829
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2830
|
+
default:
|
|
2831
|
+
throw new VectrosError({
|
|
2832
|
+
statusCode: _response.error.statusCode,
|
|
2833
|
+
body: _response.error.body,
|
|
2834
|
+
rawResponse: _response.rawResponse
|
|
2835
|
+
});
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/agents/{id}/versions");
|
|
2839
|
+
}
|
|
2840
|
+
/**
|
|
2841
|
+
* Stops a run. The answer is `202` with the run still `RUNNING`: read it with `GET /v1/runs/{id}` to see it end. A model call in progress is cut within a few seconds; a tool call in progress is first allowed to finish, for up to about 30 seconds, so its change is recorded and billed, and the run stops as soon as it has. The run then ends `CANCELLED` with `errorCode` `CANCELLED_BY_CALLER`, unless it had already completed, in which case it stays `COMPLETED`. Its reservation is settled once, like any run's: a model call in progress when it stopped is charged up to its maximum. A run that has ended (or that had not started, which this cancel ends) answers `200` with its final state, so a cancel can always be retried. A run can be cancelled by the credential that started it (for a token bound to a user, by that user) and by your root key. Requires the `runs:c` scope; with `runs:r` as well the answer is the whole run, otherwise only its `id`, `status`, `terminal`, `reason` and `errorCode`. Takes no body.
|
|
2842
|
+
*
|
|
2843
|
+
* @param {Vectros.CancelRunRequest} request
|
|
2844
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2845
|
+
*
|
|
2846
|
+
* @throws {@link Vectros.BadRequestError}
|
|
2847
|
+
* @throws {@link Vectros.UnauthorizedError}
|
|
2848
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
2849
|
+
* @throws {@link Vectros.NotFoundError}
|
|
2850
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
2851
|
+
*
|
|
2852
|
+
* @example
|
|
2853
|
+
* await client.agents.cancelRun({
|
|
2854
|
+
* id: "id"
|
|
2855
|
+
* })
|
|
2856
|
+
*/
|
|
2857
|
+
cancelRun(request, requestOptions) {
|
|
2858
|
+
return HttpResponsePromise.fromPromise(this.__cancelRun(request, requestOptions));
|
|
2859
|
+
}
|
|
2860
|
+
async __cancelRun(request, requestOptions) {
|
|
2861
|
+
const { id, contextId } = request;
|
|
2862
|
+
const _queryParams = {
|
|
2863
|
+
contextId
|
|
2864
|
+
};
|
|
2865
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2866
|
+
const _headers = mergeHeaders(
|
|
2867
|
+
_authRequest.headers,
|
|
2868
|
+
this._options?.headers,
|
|
2869
|
+
requestOptions?.headers
|
|
2870
|
+
);
|
|
2871
|
+
const _response = await fetcher({
|
|
2872
|
+
url: url_exports.join(
|
|
2873
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2874
|
+
`v1/runs/${url_exports.encodePathParam(id)}/cancel`
|
|
2875
|
+
),
|
|
2876
|
+
method: "POST",
|
|
2877
|
+
headers: _headers,
|
|
2878
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2879
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
2880
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
2881
|
+
abortSignal: requestOptions?.abortSignal,
|
|
2882
|
+
fetchFn: this._options?.fetch,
|
|
2883
|
+
logging: this._options.logging
|
|
2884
|
+
});
|
|
2885
|
+
if (_response.ok) {
|
|
2886
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2887
|
+
}
|
|
2888
|
+
if (_response.error.reason === "status-code") {
|
|
2889
|
+
switch (_response.error.statusCode) {
|
|
2890
|
+
case 400:
|
|
2891
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
2892
|
+
case 401:
|
|
2893
|
+
throw new UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
2894
|
+
case 403:
|
|
2895
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2896
|
+
case 404:
|
|
2897
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2898
|
+
case 429:
|
|
2899
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2900
|
+
default:
|
|
2901
|
+
throw new VectrosError({
|
|
2902
|
+
statusCode: _response.error.statusCode,
|
|
2903
|
+
body: _response.error.body,
|
|
2904
|
+
rawResponse: _response.rawResponse
|
|
2905
|
+
});
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/runs/{id}/cancel");
|
|
2909
|
+
}
|
|
2910
|
+
/**
|
|
2911
|
+
* Returns the status and metadata of one run: the agent version that ran, how it ended, its tool calls (never their arguments or results) and what it was charged. It never returns text: the answer is delivered only in the run's stream. A run is visible to the credential that started it (for a token bound to a user, to that user) and to your root key, and is kept for 30 days after it ends. Requires the `runs:r` scope.
|
|
2912
|
+
*
|
|
2913
|
+
* @param {Vectros.GetRunRequest} request
|
|
2914
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
2915
|
+
*
|
|
2916
|
+
* @throws {@link Vectros.BadRequestError}
|
|
2917
|
+
* @throws {@link Vectros.UnauthorizedError}
|
|
2918
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
2919
|
+
* @throws {@link Vectros.NotFoundError}
|
|
2920
|
+
*
|
|
2921
|
+
* @example
|
|
2922
|
+
* await client.agents.getRun({
|
|
2923
|
+
* id: "id"
|
|
2924
|
+
* })
|
|
2925
|
+
*/
|
|
2926
|
+
getRun(request, requestOptions) {
|
|
2927
|
+
return HttpResponsePromise.fromPromise(this.__getRun(request, requestOptions));
|
|
2928
|
+
}
|
|
2929
|
+
async __getRun(request, requestOptions) {
|
|
2930
|
+
const { id, contextId } = request;
|
|
2931
|
+
const _queryParams = {
|
|
2932
|
+
contextId
|
|
2933
|
+
};
|
|
2934
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2935
|
+
const _headers = mergeHeaders(
|
|
2936
|
+
_authRequest.headers,
|
|
2937
|
+
this._options?.headers,
|
|
2938
|
+
requestOptions?.headers
|
|
2939
|
+
);
|
|
2940
|
+
const _response = await fetcher({
|
|
2941
|
+
url: url_exports.join(
|
|
2942
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2943
|
+
`v1/runs/${url_exports.encodePathParam(id)}`
|
|
2944
|
+
),
|
|
2945
|
+
method: "GET",
|
|
2946
|
+
headers: _headers,
|
|
2947
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
2948
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
2949
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
2950
|
+
abortSignal: requestOptions?.abortSignal,
|
|
2951
|
+
fetchFn: this._options?.fetch,
|
|
2952
|
+
logging: this._options.logging
|
|
2953
|
+
});
|
|
2954
|
+
if (_response.ok) {
|
|
2955
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2956
|
+
}
|
|
2957
|
+
if (_response.error.reason === "status-code") {
|
|
2958
|
+
switch (_response.error.statusCode) {
|
|
2959
|
+
case 400:
|
|
2960
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
2961
|
+
case 401:
|
|
2962
|
+
throw new UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
2963
|
+
case 403:
|
|
2964
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2965
|
+
case 404:
|
|
2966
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
2967
|
+
default:
|
|
2968
|
+
throw new VectrosError({
|
|
2969
|
+
statusCode: _response.error.statusCode,
|
|
2970
|
+
body: _response.error.body,
|
|
2971
|
+
rawResponse: _response.rawResponse
|
|
2972
|
+
});
|
|
2973
|
+
}
|
|
2974
|
+
}
|
|
2975
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/runs/{id}");
|
|
2245
2976
|
}
|
|
2246
2977
|
/**
|
|
2247
|
-
*
|
|
2248
|
-
* Returns an empty string when no parameters were added.
|
|
2978
|
+
* Starts a run of a stored agent and streams what it does as Server-Sent Events. The response is always `text/event-stream`, whatever `Accept` you send; its `X-Vectros-Run-Id` header names the run. The run's tool calls act as you, with your own permissions, and only through the tools the agent lists. On a prepaid account the run reserves its budget from your inference balance when it starts and returns what its model calls did not use when it ends; a fixed fee per run, tool calls and run time are billed separately, against your plan. Read each event's `type`; ignore types and fields you do not know; stop at the event with `terminal: true`. A stream that ends without one: read the run with `GET /v1/runs/{id}`. Closing the stream stops the run only on a best-effort basis. Requires the `runs:c` scope, and agent runs switched on for your tenant by an account owner.
|
|
2249
2979
|
*/
|
|
2250
|
-
|
|
2251
|
-
return
|
|
2252
|
-
}
|
|
2253
|
-
};
|
|
2254
|
-
var TOKEN_PARAM = "token";
|
|
2255
|
-
var BearerAuthProvider = class _BearerAuthProvider {
|
|
2256
|
-
constructor(options) {
|
|
2257
|
-
this.options = options;
|
|
2258
|
-
}
|
|
2259
|
-
static canCreate(options) {
|
|
2260
|
-
return options?.[TOKEN_PARAM] != null;
|
|
2261
|
-
}
|
|
2262
|
-
async getAuthRequest({
|
|
2263
|
-
endpointMetadata
|
|
2264
|
-
} = {}) {
|
|
2265
|
-
const token = await Supplier.get(this.options[TOKEN_PARAM]);
|
|
2266
|
-
if (token == null) {
|
|
2267
|
-
throw new VectrosError({
|
|
2268
|
-
message: _BearerAuthProvider.AUTH_CONFIG_ERROR_MESSAGE
|
|
2269
|
-
});
|
|
2270
|
-
}
|
|
2271
|
-
return {
|
|
2272
|
-
headers: { Authorization: `Bearer ${token}` }
|
|
2273
|
-
};
|
|
2274
|
-
}
|
|
2275
|
-
};
|
|
2276
|
-
((BearerAuthProvider2) => {
|
|
2277
|
-
BearerAuthProvider2.AUTH_SCHEME = "BearerAuth";
|
|
2278
|
-
BearerAuthProvider2.AUTH_CONFIG_ERROR_MESSAGE = `Please provide '${TOKEN_PARAM}' when initializing the client`;
|
|
2279
|
-
function createInstance(options) {
|
|
2280
|
-
return new BearerAuthProvider2(options);
|
|
2281
|
-
}
|
|
2282
|
-
BearerAuthProvider2.createInstance = createInstance;
|
|
2283
|
-
})(BearerAuthProvider || (BearerAuthProvider = {}));
|
|
2284
|
-
function mergeHeaders(...headersArray) {
|
|
2285
|
-
const result = {};
|
|
2286
|
-
for (const [key, value] of headersArray.filter((headers) => headers != null).flatMap((headers) => Object.entries(headers))) {
|
|
2287
|
-
const insensitiveKey = key.toLowerCase();
|
|
2288
|
-
if (value != null) {
|
|
2289
|
-
result[insensitiveKey] = value;
|
|
2290
|
-
} else if (insensitiveKey in result) {
|
|
2291
|
-
delete result[insensitiveKey];
|
|
2292
|
-
}
|
|
2293
|
-
}
|
|
2294
|
-
return result;
|
|
2295
|
-
}
|
|
2296
|
-
function mergeOnlyDefinedHeaders(...headersArray) {
|
|
2297
|
-
const result = {};
|
|
2298
|
-
for (const [key, value] of headersArray.filter((headers) => headers != null).flatMap((headers) => Object.entries(headers))) {
|
|
2299
|
-
const insensitiveKey = key.toLowerCase();
|
|
2300
|
-
if (value != null) {
|
|
2301
|
-
result[insensitiveKey] = value;
|
|
2302
|
-
}
|
|
2303
|
-
}
|
|
2304
|
-
return result;
|
|
2305
|
-
}
|
|
2306
|
-
function normalizeClientOptions(options) {
|
|
2307
|
-
const headers = mergeHeaders(
|
|
2308
|
-
{
|
|
2309
|
-
"X-Fern-Language": "JavaScript",
|
|
2310
|
-
"X-Fern-Runtime": RUNTIME.type,
|
|
2311
|
-
"X-Fern-Runtime-Version": RUNTIME.version
|
|
2312
|
-
},
|
|
2313
|
-
options?.headers
|
|
2314
|
-
);
|
|
2315
|
-
return {
|
|
2316
|
-
...options,
|
|
2317
|
-
logging: logging_exports.createLogger(options?.logging),
|
|
2318
|
-
headers
|
|
2319
|
-
};
|
|
2320
|
-
}
|
|
2321
|
-
function normalizeClientOptionsWithAuth(options) {
|
|
2322
|
-
const normalized = normalizeClientOptions(options);
|
|
2323
|
-
if (options.auth === false) {
|
|
2324
|
-
normalized.authProvider = new NoOpAuthProvider();
|
|
2325
|
-
return normalized;
|
|
2980
|
+
createRun(request, requestOptions) {
|
|
2981
|
+
return HttpResponsePromise.fromPromise(this.__createRun(request, requestOptions));
|
|
2326
2982
|
}
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2983
|
+
async __createRun(request, requestOptions) {
|
|
2984
|
+
const { "Idempotency-Key": idempotencyKey, ..._body } = request;
|
|
2985
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
2986
|
+
const _headers = mergeHeaders(
|
|
2987
|
+
_authRequest.headers,
|
|
2988
|
+
this._options?.headers,
|
|
2989
|
+
mergeOnlyDefinedHeaders({ "Idempotency-Key": idempotencyKey }),
|
|
2990
|
+
requestOptions?.headers
|
|
2991
|
+
);
|
|
2992
|
+
const _response = await fetcher({
|
|
2993
|
+
url: url_exports.join(
|
|
2994
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2995
|
+
"v1/runs"
|
|
2996
|
+
),
|
|
2997
|
+
method: "POST",
|
|
2998
|
+
headers: _headers,
|
|
2999
|
+
contentType: "application/json",
|
|
3000
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
3001
|
+
requestType: "json",
|
|
3002
|
+
body: _body,
|
|
3003
|
+
responseType: "sse",
|
|
3004
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
3005
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
3006
|
+
abortSignal: requestOptions?.abortSignal,
|
|
3007
|
+
fetchFn: this._options?.fetch,
|
|
3008
|
+
logging: this._options.logging
|
|
3009
|
+
});
|
|
3010
|
+
if (_response.ok) {
|
|
3011
|
+
return {
|
|
3012
|
+
data: new Stream({
|
|
3013
|
+
stream: _response.body,
|
|
3014
|
+
parse: (data) => data,
|
|
3015
|
+
signal: requestOptions?.abortSignal,
|
|
3016
|
+
eventShape: {
|
|
3017
|
+
type: "sse"
|
|
3018
|
+
}
|
|
3019
|
+
}),
|
|
3020
|
+
rawResponse: _response.rawResponse
|
|
3021
|
+
};
|
|
2331
3022
|
}
|
|
2332
|
-
if (
|
|
2333
|
-
|
|
2334
|
-
|
|
3023
|
+
if (_response.error.reason === "status-code") {
|
|
3024
|
+
switch (_response.error.statusCode) {
|
|
3025
|
+
case 400:
|
|
3026
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
3027
|
+
case 401:
|
|
3028
|
+
throw new UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
3029
|
+
case 402:
|
|
3030
|
+
throw new PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
3031
|
+
case 403:
|
|
3032
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3033
|
+
case 404:
|
|
3034
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3035
|
+
case 409:
|
|
3036
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
3037
|
+
case 413:
|
|
3038
|
+
throw new ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
3039
|
+
case 422:
|
|
3040
|
+
throw new UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
3041
|
+
case 429:
|
|
3042
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3043
|
+
case 503:
|
|
3044
|
+
throw new ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
3045
|
+
default:
|
|
3046
|
+
throw new VectrosError({
|
|
3047
|
+
statusCode: _response.error.statusCode,
|
|
3048
|
+
body: _response.error.body,
|
|
3049
|
+
rawResponse: _response.rawResponse
|
|
3050
|
+
});
|
|
3051
|
+
}
|
|
2335
3052
|
}
|
|
2336
|
-
|
|
2337
|
-
}
|
|
2338
|
-
const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
|
|
2339
|
-
normalized.authProvider ?? (normalized.authProvider = new BearerAuthProvider(normalizedWithNoOpAuthProvider));
|
|
2340
|
-
return normalized;
|
|
2341
|
-
}
|
|
2342
|
-
function withNoOpAuthProvider(options) {
|
|
2343
|
-
return {
|
|
2344
|
-
...options,
|
|
2345
|
-
authProvider: new NoOpAuthProvider()
|
|
2346
|
-
};
|
|
2347
|
-
}
|
|
2348
|
-
function handleNonStatusCodeError(error, rawResponse, method, path) {
|
|
2349
|
-
switch (error.reason) {
|
|
2350
|
-
case "non-json":
|
|
2351
|
-
throw new VectrosError({
|
|
2352
|
-
statusCode: error.statusCode,
|
|
2353
|
-
body: error.rawBody,
|
|
2354
|
-
rawResponse
|
|
2355
|
-
});
|
|
2356
|
-
case "body-is-null":
|
|
2357
|
-
throw new VectrosError({
|
|
2358
|
-
statusCode: error.statusCode,
|
|
2359
|
-
rawResponse
|
|
2360
|
-
});
|
|
2361
|
-
case "timeout":
|
|
2362
|
-
throw new VectrosTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, {
|
|
2363
|
-
cause: error.cause
|
|
2364
|
-
});
|
|
2365
|
-
case "unknown":
|
|
2366
|
-
throw new VectrosError({
|
|
2367
|
-
message: error.errorMessage,
|
|
2368
|
-
rawResponse,
|
|
2369
|
-
cause: error.cause
|
|
2370
|
-
});
|
|
2371
|
-
default:
|
|
2372
|
-
throw new VectrosError({
|
|
2373
|
-
message: "Unknown error",
|
|
2374
|
-
rawResponse
|
|
2375
|
-
});
|
|
3053
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/runs");
|
|
2376
3054
|
}
|
|
2377
|
-
}
|
|
3055
|
+
};
|
|
2378
3056
|
var AuthClient = class {
|
|
2379
3057
|
constructor(options) {
|
|
2380
3058
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
@@ -2573,7 +3251,7 @@ var AuthClient = class {
|
|
|
2573
3251
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/admin/keys/scoped");
|
|
2574
3252
|
}
|
|
2575
3253
|
/**
|
|
2576
|
-
* Creates a scoped API key (an `ssk_*` secret) that inherits its permissions from an existing access profile in your account. The call is idempotent on the combination of tenant, context, user, and key name: re-issuing the same request returns the existing key WITHOUT re-disclosing its raw secret. The raw key is returned ONLY in this response — store it securely, as it cannot be retrieved again. Requires the `keys:c` scope. If you use a scoped credential, `keys:c` alone is not sufficient: because the minted key is durably bound to the profile you name, the profile's effective scopes may not exceed your own, and you may only mint against a profile whose `identityOverrides` values your own identity holds. Minting a key bound to your OWN principal needs nothing further; minting one bound to a DIFFERENT principal additionally requires the `delegate-mint` capability (`granted_capabilities`) on your credential — without it the request is refused. A root API key (`sk_`) is exempt from all three bounds. The profile you name must be `active` AND the user you name must not be `SUSPENDED`: either is refused with `409`, and no root exemption applies to that. Both refusals stop ISSUANCE only. Suspending the profile additionally stops credentials already bound to it, within about five minutes
|
|
3254
|
+
* Creates a scoped API key (an `ssk_*` secret) that inherits its permissions from an existing access profile in your account. The call is idempotent on the combination of tenant, context, user, and key name: re-issuing the same request returns the existing key WITHOUT re-disclosing its raw secret. The raw key is returned ONLY in this response — store it securely, as it cannot be retrieved again. Requires the `keys:c` scope. If you use a scoped credential, `keys:c` alone is not sufficient: because the minted key is durably bound to the profile you name, the profile's effective scopes may not exceed your own, and you may only mint against a profile whose `identityOverrides` values your own identity holds. Minting a key bound to your OWN principal needs nothing further; minting one bound to a DIFFERENT principal additionally requires the `delegate-mint` capability (`granted_capabilities`) on your credential — without it the request is refused. A root API key (`sk_`) is exempt from all three bounds. The profile you name must be `active` AND the user you name must not be `SUSPENDED`: either is refused with `409`, and no root exemption applies to that. Both refusals stop ISSUANCE only. Suspending the profile or the user additionally stops credentials already bound to it, within about five minutes. A `PENDING` user is fine.
|
|
2577
3255
|
*
|
|
2578
3256
|
* @param {Vectros.CreateScopedKeyRequest} request
|
|
2579
3257
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -2916,14 +3594,13 @@ var AuthClient = class {
|
|
|
2916
3594
|
* @throws {@link Vectros.BadRequestError}
|
|
2917
3595
|
* @throws {@link Vectros.ForbiddenError}
|
|
2918
3596
|
* @throws {@link Vectros.NotFoundError}
|
|
3597
|
+
* @throws {@link Vectros.ConflictError}
|
|
2919
3598
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
2920
3599
|
*
|
|
2921
3600
|
* @example
|
|
2922
3601
|
* await client.auth.createAccessProfile({
|
|
2923
3602
|
* contextId: "contextId",
|
|
2924
|
-
* body: {
|
|
2925
|
-
* principalId: "usr_6ba7b810-9dad-11d1-80b4-00c04fd430c8"
|
|
2926
|
-
* }
|
|
3603
|
+
* body: {}
|
|
2927
3604
|
* })
|
|
2928
3605
|
*/
|
|
2929
3606
|
createAccessProfile(request, requestOptions) {
|
|
@@ -2968,6 +3645,8 @@ var AuthClient = class {
|
|
|
2968
3645
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2969
3646
|
case 404:
|
|
2970
3647
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3648
|
+
case 409:
|
|
3649
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
2971
3650
|
case 429:
|
|
2972
3651
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
2973
3652
|
default:
|
|
@@ -3051,14 +3730,13 @@ var AuthClient = class {
|
|
|
3051
3730
|
* @throws {@link Vectros.BadRequestError}
|
|
3052
3731
|
* @throws {@link Vectros.PaymentRequiredError}
|
|
3053
3732
|
* @throws {@link Vectros.ForbiddenError}
|
|
3733
|
+
* @throws {@link Vectros.NotFoundError}
|
|
3734
|
+
* @throws {@link Vectros.ConflictError}
|
|
3054
3735
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
3055
3736
|
*
|
|
3056
3737
|
* @example
|
|
3057
3738
|
* await client.auth.createAppContext({
|
|
3058
|
-
* body: {
|
|
3059
|
-
* contextId: "myapp",
|
|
3060
|
-
* name: "My Internal App"
|
|
3061
|
-
* }
|
|
3739
|
+
* body: {}
|
|
3062
3740
|
* })
|
|
3063
3741
|
*/
|
|
3064
3742
|
createAppContext(request, requestOptions) {
|
|
@@ -3103,6 +3781,10 @@ var AuthClient = class {
|
|
|
3103
3781
|
throw new PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
3104
3782
|
case 403:
|
|
3105
3783
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3784
|
+
case 404:
|
|
3785
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3786
|
+
case 409:
|
|
3787
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
3106
3788
|
case 429:
|
|
3107
3789
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3108
3790
|
default:
|
|
@@ -3191,18 +3873,13 @@ var AuthClient = class {
|
|
|
3191
3873
|
* @throws {@link Vectros.BadRequestError}
|
|
3192
3874
|
* @throws {@link Vectros.ForbiddenError}
|
|
3193
3875
|
* @throws {@link Vectros.NotFoundError}
|
|
3876
|
+
* @throws {@link Vectros.ConflictError}
|
|
3194
3877
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
3195
3878
|
*
|
|
3196
3879
|
* @example
|
|
3197
3880
|
* await client.auth.createRole({
|
|
3198
3881
|
* contextId: "contextId",
|
|
3199
|
-
* body: {
|
|
3200
|
-
* roleId: "engineering-member",
|
|
3201
|
-
* name: "Engineering Team Member",
|
|
3202
|
-
* scopes: [{
|
|
3203
|
-
* allowed_actions: ["records:cru", "search:r"]
|
|
3204
|
-
* }]
|
|
3205
|
-
* }
|
|
3882
|
+
* body: {}
|
|
3206
3883
|
* })
|
|
3207
3884
|
*/
|
|
3208
3885
|
createRole(request, requestOptions) {
|
|
@@ -3247,6 +3924,8 @@ var AuthClient = class {
|
|
|
3247
3924
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3248
3925
|
case 404:
|
|
3249
3926
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3927
|
+
case 409:
|
|
3928
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
3250
3929
|
case 429:
|
|
3251
3930
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3252
3931
|
default:
|
|
@@ -3337,15 +4016,14 @@ var AuthClient = class {
|
|
|
3337
4016
|
* @throws {@link Vectros.BadRequestError}
|
|
3338
4017
|
* @throws {@link Vectros.ForbiddenError}
|
|
3339
4018
|
* @throws {@link Vectros.NotFoundError}
|
|
4019
|
+
* @throws {@link Vectros.ConflictError}
|
|
3340
4020
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
3341
4021
|
*
|
|
3342
4022
|
* @example
|
|
3343
4023
|
* await client.auth.updateAccessProfile({
|
|
3344
4024
|
* contextId: "contextId",
|
|
3345
4025
|
* principalId: "principalId",
|
|
3346
|
-
* body: {
|
|
3347
|
-
* principalId: "usr_6ba7b810-9dad-11d1-80b4-00c04fd430c8"
|
|
3348
|
-
* }
|
|
4026
|
+
* body: {}
|
|
3349
4027
|
* })
|
|
3350
4028
|
*/
|
|
3351
4029
|
updateAccessProfile(request, requestOptions) {
|
|
@@ -3387,6 +4065,8 @@ var AuthClient = class {
|
|
|
3387
4065
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3388
4066
|
case 404:
|
|
3389
4067
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4068
|
+
case 409:
|
|
4069
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
3390
4070
|
case 429:
|
|
3391
4071
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3392
4072
|
default:
|
|
@@ -3533,22 +4213,20 @@ var AuthClient = class {
|
|
|
3533
4213
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/app-contexts/{contextId}");
|
|
3534
4214
|
}
|
|
3535
4215
|
/**
|
|
3536
|
-
* Updates an app context. This is a partial update: any field you omit (or send as null) keeps its existing value. The `contextId` is immutable and is taken from the URL path, so any `contextId` in the request body is ignored. Patchable fields: `name`, `description`, `companyName`; the per-principal metering trio (`meteringAxis`, `principalBurstLimit`, `principalUsageCap` — only takes effect for
|
|
4216
|
+
* Updates an app context. This is a partial update: any field you omit (or send as null) keeps its existing value. The `contextId` is immutable and is taken from the URL path, so any `contextId` in the request body is ignored. Patchable fields: `name`, `description`, `companyName`; the per-principal metering trio (`meteringAxis`, `principalBurstLimit`, `principalUsageCap` — only takes effect for an account with the corresponding feature enabled); `readAccessLogDefault` (the PHI read-access-logging context default); and `identityProjectionClaims` (requires the platform provisioning capability on top of the ordinary scope below — see its own field description). Requires the `app-contexts:u` scope.
|
|
3537
4217
|
*
|
|
3538
4218
|
* @param {Vectros.UpdateAppContextRequest} request
|
|
3539
4219
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3540
4220
|
*
|
|
3541
4221
|
* @throws {@link Vectros.ForbiddenError}
|
|
3542
4222
|
* @throws {@link Vectros.NotFoundError}
|
|
4223
|
+
* @throws {@link Vectros.ConflictError}
|
|
3543
4224
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
3544
4225
|
*
|
|
3545
4226
|
* @example
|
|
3546
4227
|
* await client.auth.updateAppContext({
|
|
3547
4228
|
* contextId: "contextId",
|
|
3548
|
-
* body: {
|
|
3549
|
-
* contextId: "myapp",
|
|
3550
|
-
* name: "My Internal App"
|
|
3551
|
-
* }
|
|
4229
|
+
* body: {}
|
|
3552
4230
|
* })
|
|
3553
4231
|
*/
|
|
3554
4232
|
updateAppContext(request, requestOptions) {
|
|
@@ -3588,6 +4266,8 @@ var AuthClient = class {
|
|
|
3588
4266
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3589
4267
|
case 404:
|
|
3590
4268
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4269
|
+
case 409:
|
|
4270
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
3591
4271
|
case 429:
|
|
3592
4272
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3593
4273
|
default:
|
|
@@ -3744,19 +4424,14 @@ var AuthClient = class {
|
|
|
3744
4424
|
*
|
|
3745
4425
|
* @throws {@link Vectros.ForbiddenError}
|
|
3746
4426
|
* @throws {@link Vectros.NotFoundError}
|
|
4427
|
+
* @throws {@link Vectros.ConflictError}
|
|
3747
4428
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
3748
4429
|
*
|
|
3749
4430
|
* @example
|
|
3750
4431
|
* await client.auth.updateRole({
|
|
3751
4432
|
* contextId: "contextId",
|
|
3752
4433
|
* roleId: "roleId",
|
|
3753
|
-
* body: {
|
|
3754
|
-
* roleId: "engineering-member",
|
|
3755
|
-
* name: "Engineering Team Member",
|
|
3756
|
-
* scopes: [{
|
|
3757
|
-
* allowed_actions: ["records:cru", "search:r"]
|
|
3758
|
-
* }]
|
|
3759
|
-
* }
|
|
4434
|
+
* body: {}
|
|
3760
4435
|
* })
|
|
3761
4436
|
*/
|
|
3762
4437
|
updateRole(request, requestOptions) {
|
|
@@ -3796,6 +4471,8 @@ var AuthClient = class {
|
|
|
3796
4471
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3797
4472
|
case 404:
|
|
3798
4473
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4474
|
+
case 409:
|
|
4475
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
3799
4476
|
case 429:
|
|
3800
4477
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3801
4478
|
default:
|
|
@@ -3821,6 +4498,7 @@ var AuthClient = class {
|
|
|
3821
4498
|
*
|
|
3822
4499
|
* @throws {@link Vectros.ForbiddenError}
|
|
3823
4500
|
* @throws {@link Vectros.NotFoundError}
|
|
4501
|
+
* @throws {@link Vectros.ConflictError}
|
|
3824
4502
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
3825
4503
|
*
|
|
3826
4504
|
* @example
|
|
@@ -3863,6 +4541,8 @@ var AuthClient = class {
|
|
|
3863
4541
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3864
4542
|
case 404:
|
|
3865
4543
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4544
|
+
case 409:
|
|
4545
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
3866
4546
|
case 429:
|
|
3867
4547
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3868
4548
|
default:
|
|
@@ -4144,6 +4824,7 @@ var AuthClient = class {
|
|
|
4144
4824
|
* @throws {@link Vectros.BadRequestError}
|
|
4145
4825
|
* @throws {@link Vectros.ForbiddenError}
|
|
4146
4826
|
* @throws {@link Vectros.NotFoundError}
|
|
4827
|
+
* @throws {@link Vectros.ConflictError}
|
|
4147
4828
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
4148
4829
|
*
|
|
4149
4830
|
* @example
|
|
@@ -4190,6 +4871,8 @@ var AuthClient = class {
|
|
|
4190
4871
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4191
4872
|
case 404:
|
|
4192
4873
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4874
|
+
case 409:
|
|
4875
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4193
4876
|
case 429:
|
|
4194
4877
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4195
4878
|
default:
|
|
@@ -4203,7 +4886,7 @@ var AuthClient = class {
|
|
|
4203
4886
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/auth/issuers/{issuerId}");
|
|
4204
4887
|
}
|
|
4205
4888
|
/**
|
|
4206
|
-
* Deregisters a trusted third-party IdP issuer. Requires a root API key or the bootstrap's provisioning capability. A credential confined to one app context may only deregister an issuer registered in that context; naming one registered in another context returns 404, identically to a nonexistent issuerId. A root API key may deregister any issuer. Refused if any user account was ever created or matched via this issuer (by a prior self-signup or accepted invite, through `POST /v1/auth/token/exchange`) — that access cannot be silently orphaned. This is unconditional on the affected users' `status`: suspending them first does not lift the refusal. **A bound registration cannot be replaced, self-service, within its own app context**: registering a replacement issuer under a different issuerId in the SAME context also fails, because the context's one-active-issuer claim is released only when THIS registration is deleted. Two real options: suspend this issuer (stops new exchanges immediately) and register a replacement under a DIFFERENT app context — note that targets a different context, so this context's existing users/roles/access profiles are not carried over; or contact
|
|
4889
|
+
* Deregisters a trusted third-party IdP issuer. Requires a root API key or the bootstrap's provisioning capability. A credential confined to one app context may only deregister an issuer registered in that context; naming one registered in another context returns 404, identically to a nonexistent issuerId. A root API key may deregister any issuer. Refused if any user account was ever created or matched via this issuer (by a prior self-signup or accepted invite, through `POST /v1/auth/token/exchange`) — that access cannot be silently orphaned. This is unconditional on the affected users' `status`: suspending them first does not lift the refusal. **A bound registration cannot be replaced, self-service, within its own app context**: registering a replacement issuer under a different issuerId in the SAME context also fails, because the context's one-active-issuer claim is released only when THIS registration is deleted. Two real options: suspend this issuer (stops new exchanges immediately) and register a replacement under a DIFFERENT app context — note that targets a different context, so this context's existing users/roles/access profiles are not carried over; or contact support, who can force-release this registration so a replacement may be registered in the SAME context under a new issuerId. **The support path is not a lighter-weight alternative to the first — it PERMANENTLY RETIRES this issuerId and leaves every bound user unable to ever exchange through it again; it does not preserve continuity for them any better than registering under a different context does.** An issuer that has never been used for an exchange (no bound users yet) can always be deregistered.
|
|
4207
4890
|
*
|
|
4208
4891
|
* @param {Vectros.DeleteIssuerRequest} request
|
|
4209
4892
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4329,7 +5012,7 @@ var AuthClient = class {
|
|
|
4329
5012
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers");
|
|
4330
5013
|
}
|
|
4331
5014
|
/**
|
|
4332
|
-
* Registers a trusted third-party IdP issuer that BYO-IdP token exchange (`POST /v1/auth/token/exchange`) may accept a `subject_token` from. Requires a root API key or the CLI bootstrap's provisioning capability — never an ordinary
|
|
5015
|
+
* Registers a trusted third-party IdP issuer that BYO-IdP token exchange (`POST /v1/auth/token/exchange`) may accept a `subject_token` from. Requires a root API key or the CLI bootstrap's provisioning capability — never an ordinary grantable scope. A credential authorized only via the provisioning capability may register only against the app context it is bound to; naming a different one returns 403. A root API key is unaffected and may register against any of its contexts. A registration without `restrictedToDomain` is created `pending_verification` with a one-time challenge (`verificationClaim`, `verificationNonce`, `verificationExpiresAt`) and accepts no token until you prove you control the issuer with `POST /v1/auth/issuers/{issuerId}/verify`; it claims no `(issuer, audience)` pair until then, so registering never reveals whether another tenant holds one. A registration scoped to an already-verified domain with `restrictedToDomain` is `active` at once. Idempotent by `issuerId` within your tenant. If `issuerId` collides with a registration owned by a different app context than the one you're confined to, the request fails with 400 rather than returning that context's configuration. An app context may have at most one active issuer — deregister the existing one first if you need to replace it. One issuer MAY serve several contexts, each via its own registration row with a distinct `audience`. Optionally name `restrictedToDomain` to scope this registration's (issuer, audience) uniqueness to a specific VERIFIED domain rather than the bare pair — see that field's own description. A domain-scoped registration proves control of the DOMAIN, not of the issuer itself: it routes only tokens carrying that domain's `hd` claim.
|
|
4333
5016
|
*
|
|
4334
5017
|
* @param {Vectros.IssuerRequest} request
|
|
4335
5018
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4738,6 +5421,7 @@ var AuthClient = class {
|
|
|
4738
5421
|
* @throws {@link Vectros.BadRequestError}
|
|
4739
5422
|
* @throws {@link Vectros.ForbiddenError}
|
|
4740
5423
|
* @throws {@link Vectros.NotFoundError}
|
|
5424
|
+
* @throws {@link Vectros.ConflictError}
|
|
4741
5425
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
4742
5426
|
*
|
|
4743
5427
|
* @example
|
|
@@ -4785,6 +5469,8 @@ var AuthClient = class {
|
|
|
4785
5469
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4786
5470
|
case 404:
|
|
4787
5471
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5472
|
+
case 409:
|
|
5473
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4788
5474
|
case 429:
|
|
4789
5475
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4790
5476
|
default:
|
|
@@ -4884,6 +5570,7 @@ var AuthClient = class {
|
|
|
4884
5570
|
* @throws {@link Vectros.UnauthorizedError}
|
|
4885
5571
|
* @throws {@link Vectros.ForbiddenError}
|
|
4886
5572
|
* @throws {@link Vectros.NotFoundError}
|
|
5573
|
+
* @throws {@link Vectros.ContentTooLargeError}
|
|
4887
5574
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
4888
5575
|
*
|
|
4889
5576
|
* @example
|
|
@@ -4928,6 +5615,8 @@ var AuthClient = class {
|
|
|
4928
5615
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4929
5616
|
case 404:
|
|
4930
5617
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5618
|
+
case 413:
|
|
5619
|
+
throw new ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
4931
5620
|
case 429:
|
|
4932
5621
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4933
5622
|
default:
|
|
@@ -5067,7 +5756,7 @@ var ComplianceClient = class {
|
|
|
5067
5756
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/erasure-requests/{id}");
|
|
5068
5757
|
}
|
|
5069
5758
|
/**
|
|
5070
|
-
*
|
|
5759
|
+
* Reserved: with a root API key this operation answers `501` and starts no job. The request and response shapes are published so that integrations can be written against them: a request names the contexts, or a single end-subject, to export, and the response carries an `exportJobId` that `GET /v1/admin/export/{id}` reports on. Requires a root API key — a scoped credential is rejected with 403.
|
|
5071
5760
|
*
|
|
5072
5761
|
* @param {Vectros.ExportRequest} request
|
|
5073
5762
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5128,7 +5817,7 @@ var ComplianceClient = class {
|
|
|
5128
5817
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/admin/export");
|
|
5129
5818
|
}
|
|
5130
5819
|
/**
|
|
5131
|
-
*
|
|
5820
|
+
* Reserved: with a root API key this operation answers `501`. Its response shape is the one the export operation above refers to: the job status, and a short-lived presigned download URL and a manifest (format version and per-context counts) for a completed job. Requires a root API key.
|
|
5132
5821
|
*
|
|
5133
5822
|
* @param {Vectros.GetExportRequest} request
|
|
5134
5823
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5194,7 +5883,7 @@ var DocumentsClient = class {
|
|
|
5194
5883
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
5195
5884
|
}
|
|
5196
5885
|
/**
|
|
5197
|
-
* Returns a paginated list of your documents, optionally filtered by folder (`folderId`)
|
|
5886
|
+
* Returns a paginated list of your documents, optionally filtered by folder (`folderId`), owner (`userId` or `scope`) and/or type (`type`). The response is a `{data, nextCursor}` envelope; pass `nextCursor` back as `startFrom` to fetch the next page. A page can hold fewer documents than `limit`, or none, while `nextCursor` is still set: keep paging until `nextCursor` is null. Requires the `documents:r` scope.
|
|
5198
5887
|
*
|
|
5199
5888
|
* @param {Vectros.ListDocumentsRequest} request
|
|
5200
5889
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5204,6 +5893,7 @@ var DocumentsClient = class {
|
|
|
5204
5893
|
* userId: "550e8400-e29b-41d4-a716-446655440000",
|
|
5205
5894
|
* scope: "group:eng-team",
|
|
5206
5895
|
* folderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
5896
|
+
* type: "investigation_report",
|
|
5207
5897
|
* startFrom: "b3BhcXVlLWN1cnNvci1mcm9tLXRoZS1wcmV2aW91cy1wYWdl"
|
|
5208
5898
|
* })
|
|
5209
5899
|
*/
|
|
@@ -5211,11 +5901,12 @@ var DocumentsClient = class {
|
|
|
5211
5901
|
return HttpResponsePromise.fromPromise(this.__listDocuments(request, requestOptions));
|
|
5212
5902
|
}
|
|
5213
5903
|
async __listDocuments(request = {}, requestOptions) {
|
|
5214
|
-
const { userId, scope, folderId, startFrom, limit } = request;
|
|
5904
|
+
const { userId, scope, folderId, type: type_, startFrom, limit } = request;
|
|
5215
5905
|
const _queryParams = {
|
|
5216
5906
|
userId,
|
|
5217
5907
|
scope,
|
|
5218
5908
|
folderId,
|
|
5909
|
+
type: type_,
|
|
5219
5910
|
startFrom,
|
|
5220
5911
|
limit
|
|
5221
5912
|
};
|
|
@@ -5259,13 +5950,13 @@ var DocumentsClient = class {
|
|
|
5259
5950
|
*
|
|
5260
5951
|
* @throws {@link Vectros.BadRequestError}
|
|
5261
5952
|
* @throws {@link Vectros.ForbiddenError}
|
|
5953
|
+
* @throws {@link Vectros.NotFoundError}
|
|
5954
|
+
* @throws {@link Vectros.ConflictError}
|
|
5262
5955
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
5263
5956
|
*
|
|
5264
5957
|
* @example
|
|
5265
5958
|
* await client.documents.ingestDocument({
|
|
5266
|
-
* body: {
|
|
5267
|
-
* title: "Patient Intake Form \u2014 Jane Doe"
|
|
5268
|
-
* }
|
|
5959
|
+
* body: {}
|
|
5269
5960
|
* })
|
|
5270
5961
|
*/
|
|
5271
5962
|
ingestDocument(request, requestOptions) {
|
|
@@ -5310,6 +6001,10 @@ var DocumentsClient = class {
|
|
|
5310
6001
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5311
6002
|
case 403:
|
|
5312
6003
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6004
|
+
case 404:
|
|
6005
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6006
|
+
case 409:
|
|
6007
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
5313
6008
|
case 429:
|
|
5314
6009
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5315
6010
|
default:
|
|
@@ -5391,9 +6086,7 @@ var DocumentsClient = class {
|
|
|
5391
6086
|
* @example
|
|
5392
6087
|
* await client.documents.updateDocument({
|
|
5393
6088
|
* id: "id",
|
|
5394
|
-
* body: {
|
|
5395
|
-
* title: "Patient Intake Form \u2014 Jane Doe"
|
|
5396
|
-
* }
|
|
6089
|
+
* body: {}
|
|
5397
6090
|
* })
|
|
5398
6091
|
*/
|
|
5399
6092
|
updateDocument(request, requestOptions) {
|
|
@@ -5457,6 +6150,7 @@ var DocumentsClient = class {
|
|
|
5457
6150
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5458
6151
|
*
|
|
5459
6152
|
* @throws {@link Vectros.NotFoundError}
|
|
6153
|
+
* @throws {@link Vectros.ConflictError}
|
|
5460
6154
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
5461
6155
|
*
|
|
5462
6156
|
* @example
|
|
@@ -5496,6 +6190,8 @@ var DocumentsClient = class {
|
|
|
5496
6190
|
switch (_response.error.statusCode) {
|
|
5497
6191
|
case 404:
|
|
5498
6192
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6193
|
+
case 409:
|
|
6194
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
5499
6195
|
case 429:
|
|
5500
6196
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5501
6197
|
default:
|
|
@@ -5788,11 +6484,12 @@ var DocumentsClient = class {
|
|
|
5788
6484
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents/{id}/download");
|
|
5789
6485
|
}
|
|
5790
6486
|
/**
|
|
5791
|
-
* Returns the document's full text body when it is retained:
|
|
6487
|
+
* Returns the document's full text body when it is retained: retained for text-ingested documents, and for file-uploaded documents unless they were uploaded with `storeText=false` (which discards the extracted text once indexing completes — the original file remains available via `GET /v1/documents/{id}/download`). Returns 404 when the document does not exist, its text was not retained, extraction has not yet completed, or no text could be extracted from its file (see the document's `extraction`). To read a long text in parts, pass `limit` (and `offset` from the second part on): offsets and lengths count Unicode characters (code points), `totalLength` is the length of the whole text, and `nextOffset` is where the next part starts, absent once the end is reached. Requires the `documents:r` scope.
|
|
5792
6488
|
*
|
|
5793
6489
|
* @param {Vectros.GetDocumentTextRequest} request
|
|
5794
6490
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5795
6491
|
*
|
|
6492
|
+
* @throws {@link Vectros.BadRequestError}
|
|
5796
6493
|
* @throws {@link Vectros.NotFoundError}
|
|
5797
6494
|
*
|
|
5798
6495
|
* @example
|
|
@@ -5804,7 +6501,11 @@ var DocumentsClient = class {
|
|
|
5804
6501
|
return HttpResponsePromise.fromPromise(this.__getDocumentText(request, requestOptions));
|
|
5805
6502
|
}
|
|
5806
6503
|
async __getDocumentText(request, requestOptions) {
|
|
5807
|
-
const { id } = request;
|
|
6504
|
+
const { id, offset, limit } = request;
|
|
6505
|
+
const _queryParams = {
|
|
6506
|
+
offset,
|
|
6507
|
+
limit
|
|
6508
|
+
};
|
|
5808
6509
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5809
6510
|
const _headers = mergeHeaders(
|
|
5810
6511
|
_authRequest.headers,
|
|
@@ -5818,7 +6519,7 @@ var DocumentsClient = class {
|
|
|
5818
6519
|
),
|
|
5819
6520
|
method: "GET",
|
|
5820
6521
|
headers: _headers,
|
|
5821
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6522
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5822
6523
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5823
6524
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5824
6525
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5830,6 +6531,8 @@ var DocumentsClient = class {
|
|
|
5830
6531
|
}
|
|
5831
6532
|
if (_response.error.reason === "status-code") {
|
|
5832
6533
|
switch (_response.error.statusCode) {
|
|
6534
|
+
case 400:
|
|
6535
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5833
6536
|
case 404:
|
|
5834
6537
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5835
6538
|
default:
|
|
@@ -5908,6 +6611,7 @@ var DocumentsClient = class {
|
|
|
5908
6611
|
*
|
|
5909
6612
|
* @throws {@link Vectros.BadRequestError}
|
|
5910
6613
|
* @throws {@link Vectros.ForbiddenError}
|
|
6614
|
+
* @throws {@link Vectros.ConflictError}
|
|
5911
6615
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
5912
6616
|
*
|
|
5913
6617
|
* @example
|
|
@@ -5957,6 +6661,8 @@ var DocumentsClient = class {
|
|
|
5957
6661
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
5958
6662
|
case 403:
|
|
5959
6663
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6664
|
+
case 409:
|
|
6665
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
5960
6666
|
case 429:
|
|
5961
6667
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
5962
6668
|
default:
|
|
@@ -6040,13 +6746,13 @@ var FoldersClient = class {
|
|
|
6040
6746
|
*
|
|
6041
6747
|
* @throws {@link Vectros.BadRequestError}
|
|
6042
6748
|
* @throws {@link Vectros.ForbiddenError}
|
|
6749
|
+
* @throws {@link Vectros.NotFoundError}
|
|
6750
|
+
* @throws {@link Vectros.ConflictError}
|
|
6043
6751
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
6044
6752
|
*
|
|
6045
6753
|
* @example
|
|
6046
6754
|
* await client.folders.createFolder({
|
|
6047
|
-
* body: {
|
|
6048
|
-
* name: "Patient Records 2024"
|
|
6049
|
-
* }
|
|
6755
|
+
* body: {}
|
|
6050
6756
|
* })
|
|
6051
6757
|
*/
|
|
6052
6758
|
createFolder(request, requestOptions) {
|
|
@@ -6089,6 +6795,10 @@ var FoldersClient = class {
|
|
|
6089
6795
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6090
6796
|
case 403:
|
|
6091
6797
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6798
|
+
case 404:
|
|
6799
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6800
|
+
case 409:
|
|
6801
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
6092
6802
|
case 429:
|
|
6093
6803
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6094
6804
|
default:
|
|
@@ -6164,14 +6874,13 @@ var FoldersClient = class {
|
|
|
6164
6874
|
*
|
|
6165
6875
|
* @throws {@link Vectros.ForbiddenError}
|
|
6166
6876
|
* @throws {@link Vectros.NotFoundError}
|
|
6877
|
+
* @throws {@link Vectros.ConflictError}
|
|
6167
6878
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
6168
6879
|
*
|
|
6169
6880
|
* @example
|
|
6170
6881
|
* await client.folders.updateFolder({
|
|
6171
6882
|
* id: "id",
|
|
6172
|
-
* body: {
|
|
6173
|
-
* name: "Patient Records 2024"
|
|
6174
|
-
* }
|
|
6883
|
+
* body: {}
|
|
6175
6884
|
* })
|
|
6176
6885
|
*/
|
|
6177
6886
|
updateFolder(request, requestOptions) {
|
|
@@ -6211,6 +6920,8 @@ var FoldersClient = class {
|
|
|
6211
6920
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
6212
6921
|
case 404:
|
|
6213
6922
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6923
|
+
case 409:
|
|
6924
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
6214
6925
|
case 429:
|
|
6215
6926
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6216
6927
|
default:
|
|
@@ -6231,6 +6942,7 @@ var FoldersClient = class {
|
|
|
6231
6942
|
*
|
|
6232
6943
|
* @throws {@link Vectros.BadRequestError}
|
|
6233
6944
|
* @throws {@link Vectros.NotFoundError}
|
|
6945
|
+
* @throws {@link Vectros.ConflictError}
|
|
6234
6946
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
6235
6947
|
*
|
|
6236
6948
|
* @example
|
|
@@ -6272,6 +6984,8 @@ var FoldersClient = class {
|
|
|
6272
6984
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6273
6985
|
case 404:
|
|
6274
6986
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6987
|
+
case 409:
|
|
6988
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
6275
6989
|
case 429:
|
|
6276
6990
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6277
6991
|
default:
|
|
@@ -6285,7 +6999,7 @@ var FoldersClient = class {
|
|
|
6285
6999
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/folders/{id}");
|
|
6286
7000
|
}
|
|
6287
7001
|
/**
|
|
6288
|
-
* Partially updates a folder using an RFC 7386 JSON Merge Patch. The `name`, `description`, and ownership fields (`userId`, `scopes`) are applied when present and left unchanged when omitted; sending any of these as null is rejected, because clearing a field is not supported
|
|
7002
|
+
* Partially updates a folder using an RFC 7386 JSON Merge Patch. The `name`, `description`, and ownership fields (`userId`, `scopes`) are applied when present and left unchanged when omitted; sending any of these as null is rejected, because clearing a field is not supported (omit it instead). `slug` and `parentFolderId` are immutable — a folder cannot be re-slugged or moved via the API — and the request is rejected if either is present. Pass `expectedVersion` for optimistic concurrency (you get a 409 if the folder changed since you last read it). Requires the `folders:u` scope.
|
|
6289
7003
|
*
|
|
6290
7004
|
* @param {Vectros.PatchFolderRequest} request
|
|
6291
7005
|
* @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6299,9 +7013,7 @@ var FoldersClient = class {
|
|
|
6299
7013
|
* @example
|
|
6300
7014
|
* await client.folders.patchFolder({
|
|
6301
7015
|
* id: "id",
|
|
6302
|
-
* body: {
|
|
6303
|
-
* name: "Patient Records 2024"
|
|
6304
|
-
* }
|
|
7016
|
+
* body: {}
|
|
6305
7017
|
* })
|
|
6306
7018
|
*/
|
|
6307
7019
|
patchFolder(request, requestOptions) {
|
|
@@ -6508,15 +7220,15 @@ var IdentityClient = class {
|
|
|
6508
7220
|
*
|
|
6509
7221
|
* @throws {@link Vectros.BadRequestError}
|
|
6510
7222
|
* @throws {@link Vectros.ForbiddenError}
|
|
7223
|
+
* @throws {@link Vectros.NotFoundError}
|
|
7224
|
+
* @throws {@link Vectros.ConflictError}
|
|
6511
7225
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
6512
7226
|
*
|
|
6513
7227
|
* @example
|
|
6514
7228
|
* await client.identity.createEntity({
|
|
6515
7229
|
* namespace: "team",
|
|
6516
7230
|
* contextId: "myapp",
|
|
6517
|
-
* body: {
|
|
6518
|
-
* externalId: "team_eng_platform"
|
|
6519
|
-
* }
|
|
7231
|
+
* body: {}
|
|
6520
7232
|
* })
|
|
6521
7233
|
*/
|
|
6522
7234
|
createEntity(request, requestOptions) {
|
|
@@ -6560,6 +7272,10 @@ var IdentityClient = class {
|
|
|
6560
7272
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6561
7273
|
case 403:
|
|
6562
7274
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7275
|
+
case 404:
|
|
7276
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7277
|
+
case 409:
|
|
7278
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
6563
7279
|
case 429:
|
|
6564
7280
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6565
7281
|
default:
|
|
@@ -6640,6 +7356,7 @@ var IdentityClient = class {
|
|
|
6640
7356
|
*
|
|
6641
7357
|
* @throws {@link Vectros.BadRequestError}
|
|
6642
7358
|
* @throws {@link Vectros.NotFoundError}
|
|
7359
|
+
* @throws {@link Vectros.ConflictError}
|
|
6643
7360
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
6644
7361
|
*
|
|
6645
7362
|
* @example
|
|
@@ -6647,9 +7364,7 @@ var IdentityClient = class {
|
|
|
6647
7364
|
* namespace: "team",
|
|
6648
7365
|
* id: "id",
|
|
6649
7366
|
* contextId: "myapp",
|
|
6650
|
-
* body: {
|
|
6651
|
-
* externalId: "team_eng_platform"
|
|
6652
|
-
* }
|
|
7367
|
+
* body: {}
|
|
6653
7368
|
* })
|
|
6654
7369
|
*/
|
|
6655
7370
|
updateEntity(request, requestOptions) {
|
|
@@ -6692,6 +7407,8 @@ var IdentityClient = class {
|
|
|
6692
7407
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
6693
7408
|
case 404:
|
|
6694
7409
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7410
|
+
case 409:
|
|
7411
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
6695
7412
|
case 429:
|
|
6696
7413
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6697
7414
|
default:
|
|
@@ -6711,6 +7428,7 @@ var IdentityClient = class {
|
|
|
6711
7428
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6712
7429
|
*
|
|
6713
7430
|
* @throws {@link Vectros.NotFoundError}
|
|
7431
|
+
* @throws {@link Vectros.ConflictError}
|
|
6714
7432
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
6715
7433
|
*
|
|
6716
7434
|
* @example
|
|
@@ -6755,6 +7473,8 @@ var IdentityClient = class {
|
|
|
6755
7473
|
switch (_response.error.statusCode) {
|
|
6756
7474
|
case 404:
|
|
6757
7475
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7476
|
+
case 409:
|
|
7477
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
6758
7478
|
case 429:
|
|
6759
7479
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
6760
7480
|
default:
|
|
@@ -6978,15 +7698,13 @@ var IdentityClient = class {
|
|
|
6978
7698
|
*
|
|
6979
7699
|
* @throws {@link Vectros.ForbiddenError}
|
|
6980
7700
|
* @throws {@link Vectros.NotFoundError}
|
|
7701
|
+
* @throws {@link Vectros.ConflictError}
|
|
6981
7702
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
6982
7703
|
*
|
|
6983
7704
|
* @example
|
|
6984
7705
|
* await client.identity.updateNamespace({
|
|
6985
7706
|
* namespace: "team",
|
|
6986
|
-
* body: {
|
|
6987
|
-
* namespace: "team",
|
|
6988
|
-
* specificityRank: 1500
|
|
6989
|
-
* }
|
|
7707
|
+
* body: {}
|
|
6990
7708
|
* })
|
|
6991
7709
|
*/
|
|
6992
7710
|
updateNamespace(request, requestOptions) {
|
|
@@ -7029,6 +7747,8 @@ var IdentityClient = class {
|
|
|
7029
7747
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7030
7748
|
case 404:
|
|
7031
7749
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7750
|
+
case 409:
|
|
7751
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7032
7752
|
case 429:
|
|
7033
7753
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7034
7754
|
default:
|
|
@@ -7049,6 +7769,7 @@ var IdentityClient = class {
|
|
|
7049
7769
|
*
|
|
7050
7770
|
* @throws {@link Vectros.ForbiddenError}
|
|
7051
7771
|
* @throws {@link Vectros.NotFoundError}
|
|
7772
|
+
* @throws {@link Vectros.ConflictError}
|
|
7052
7773
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
7053
7774
|
*
|
|
7054
7775
|
* @example
|
|
@@ -7093,6 +7814,8 @@ var IdentityClient = class {
|
|
|
7093
7814
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7094
7815
|
case 404:
|
|
7095
7816
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7817
|
+
case 409:
|
|
7818
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7096
7819
|
case 429:
|
|
7097
7820
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7098
7821
|
default:
|
|
@@ -7157,7 +7880,7 @@ var IdentityClient = class {
|
|
|
7157
7880
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/namespaces");
|
|
7158
7881
|
}
|
|
7159
7882
|
/**
|
|
7160
|
-
* Registers a new scope namespace and declares whether its values resolve to identity entities (`entityBacked`). Also requires `specificityRank`, an explicit, account-unique position in the specificity order used to break recordType schema-resolution ties. Requires a root API key or one of the CLI bootstrap's two provisioning capabilities — never an ordinary
|
|
7883
|
+
* Registers a new scope namespace and declares whether its values resolve to identity entities (`entityBacked`). Also requires `specificityRank`, an explicit, account-unique position in the specificity order used to break recordType schema-resolution ties. Requires a root API key or one of the CLI bootstrap's two provisioning capabilities — never an ordinary grantable scope. A bootstrap credential's registration is confined to its own app context UNLESS it additionally holds the tenant-wide namespace-provisioning capability and `contextId` is omitted, in which case it may register a TENANT-WIDE namespace (visible to every context). `org` and `client` are reserved names, registered the same way as any other namespace.
|
|
7161
7884
|
*
|
|
7162
7885
|
* @param {Vectros.RegisterNamespaceRequest} request
|
|
7163
7886
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7168,10 +7891,7 @@ var IdentityClient = class {
|
|
|
7168
7891
|
*
|
|
7169
7892
|
* @example
|
|
7170
7893
|
* await client.identity.registerNamespace({
|
|
7171
|
-
* body: {
|
|
7172
|
-
* namespace: "team",
|
|
7173
|
-
* specificityRank: 1500
|
|
7174
|
-
* }
|
|
7894
|
+
* body: {}
|
|
7175
7895
|
* })
|
|
7176
7896
|
*/
|
|
7177
7897
|
registerNamespace(request, requestOptions) {
|
|
@@ -7299,13 +8019,12 @@ var IdentityClient = class {
|
|
|
7299
8019
|
*
|
|
7300
8020
|
* @throws {@link Vectros.BadRequestError}
|
|
7301
8021
|
* @throws {@link Vectros.ForbiddenError}
|
|
8022
|
+
* @throws {@link Vectros.ConflictError}
|
|
7302
8023
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
7303
8024
|
*
|
|
7304
8025
|
* @example
|
|
7305
8026
|
* await client.identity.createUser({
|
|
7306
|
-
* body: {
|
|
7307
|
-
* externalId: "usr_12345"
|
|
7308
|
-
* }
|
|
8027
|
+
* body: {}
|
|
7309
8028
|
* })
|
|
7310
8029
|
*/
|
|
7311
8030
|
createUser(request, requestOptions) {
|
|
@@ -7348,6 +8067,8 @@ var IdentityClient = class {
|
|
|
7348
8067
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7349
8068
|
case 403:
|
|
7350
8069
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8070
|
+
case 409:
|
|
8071
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7351
8072
|
case 429:
|
|
7352
8073
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7353
8074
|
default:
|
|
@@ -7416,21 +8137,21 @@ var IdentityClient = class {
|
|
|
7416
8137
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users/{id}");
|
|
7417
8138
|
}
|
|
7418
8139
|
/**
|
|
7419
|
-
* Updates mutable fields on an existing user (such as email, status, payload, or schema binding). The `type` field is immutable after creation, and `email` cannot be changed while an invitation to that user is still outstanding — revoke the invitation, or invite the new address instead. This endpoint also activates an invited user: a PUT that moves a PENDING user to ACTIVE and carries `inviteToken`, `externalSubject`, and `emailVerifiedAttestation=true` completes the invitation. **`externalSubject` set this way is NOT an authentication binding and does not enable sign-in anywhere** — not the Vectros DevPortal/Admin App/web apps, and not `/v1/auth/token/exchange` either; both are granted only by the invitee authenticating themselves. If the invitee needs dev-portal/web-app access, send them the invitation link and let them accept it directly. If the invitee needs to sign in via token exchange, have them redeem `inviteToken` themselves at `/v1/auth/token/exchange` with their own credential — Vectros verifies it there and computes its own value for this field from the verified credential. The value you send here is stored exactly as-is, with no normalization, and does NOT automatically match or deduplicate against what a later token-exchange sign-in computes for the same real-world identity. Call this endpoint directly only if you run your own backend and want Vectros to record which of your own users a given account corresponds to — treat this field as informational for that purpose, not as a way to pre-authorize sign-in. Requires the `users:u` scope.
|
|
8140
|
+
* Updates mutable fields on an existing user (such as email, status, payload, or schema binding). The `type` field is immutable after creation, and `email` cannot be changed while an invitation to that user is still outstanding — revoke the invitation, or invite the new address instead. This endpoint also activates an invited user: a PUT that moves a PENDING user to ACTIVE and carries `inviteToken`, `externalSubject`, and `emailVerifiedAttestation=true` completes the invitation. **`externalSubject` set this way is NOT an authentication binding and does not enable sign-in anywhere** — not the Vectros DevPortal/Admin App/web apps, and not `/v1/auth/token/exchange` either; both are granted only by the invitee authenticating themselves. A subject stored through `PUT /v1/users/{id}` does not make the person a member of your account: it is ignored for the tenant claims in sign-in tokens, the developer portal's memberships list and tenant switching, and an ownership transfer. To give such a person access, delete the user and invite them again; accepting the invitation binds the subject and counts it. If the invitee needs dev-portal/web-app access, send them the invitation link and let them accept it directly. If the invitee needs to sign in via token exchange, have them redeem `inviteToken` themselves at `/v1/auth/token/exchange` with their own credential — Vectros verifies it there and computes its own value for this field from the verified credential. The value you send here is stored exactly as-is, with no normalization, and does NOT automatically match or deduplicate against what a later token-exchange sign-in computes for the same real-world identity. Call this endpoint directly only if you run your own backend and want Vectros to record which of your own users a given account corresponds to — treat this field as informational for that purpose, not as a way to pre-authorize sign-in. Requires the `users:u` scope.
|
|
7420
8141
|
*
|
|
7421
8142
|
* @param {Vectros.UpdateUserRequest} request
|
|
7422
8143
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7423
8144
|
*
|
|
7424
8145
|
* @throws {@link Vectros.BadRequestError}
|
|
8146
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
7425
8147
|
* @throws {@link Vectros.NotFoundError}
|
|
8148
|
+
* @throws {@link Vectros.ConflictError}
|
|
7426
8149
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
7427
8150
|
*
|
|
7428
8151
|
* @example
|
|
7429
8152
|
* await client.identity.updateUser({
|
|
7430
8153
|
* id: "550e8400-e29b-41d4-a716-446655440000",
|
|
7431
|
-
* body: {
|
|
7432
|
-
* externalId: "usr_12345"
|
|
7433
|
-
* }
|
|
8154
|
+
* body: {}
|
|
7434
8155
|
* })
|
|
7435
8156
|
*/
|
|
7436
8157
|
updateUser(request, requestOptions) {
|
|
@@ -7468,8 +8189,12 @@ var IdentityClient = class {
|
|
|
7468
8189
|
switch (_response.error.statusCode) {
|
|
7469
8190
|
case 400:
|
|
7470
8191
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8192
|
+
case 403:
|
|
8193
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7471
8194
|
case 404:
|
|
7472
8195
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
8196
|
+
case 409:
|
|
8197
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7473
8198
|
case 429:
|
|
7474
8199
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7475
8200
|
default:
|
|
@@ -7488,6 +8213,7 @@ var IdentityClient = class {
|
|
|
7488
8213
|
* @param {Vectros.DeleteUserRequest} request
|
|
7489
8214
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7490
8215
|
*
|
|
8216
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
7491
8217
|
* @throws {@link Vectros.NotFoundError}
|
|
7492
8218
|
* @throws {@link Vectros.ConflictError}
|
|
7493
8219
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
@@ -7527,6 +8253,8 @@ var IdentityClient = class {
|
|
|
7527
8253
|
}
|
|
7528
8254
|
if (_response.error.reason === "status-code") {
|
|
7529
8255
|
switch (_response.error.statusCode) {
|
|
8256
|
+
case 403:
|
|
8257
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7530
8258
|
case 404:
|
|
7531
8259
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7532
8260
|
case 409:
|
|
@@ -7731,7 +8459,7 @@ var InferenceClient = class {
|
|
|
7731
8459
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
7732
8460
|
}
|
|
7733
8461
|
/**
|
|
7734
|
-
* Returns
|
|
8462
|
+
* Returns the whole platform model catalog, whatever your plan: `availableOn` names each model's plan tiers. Each entry also carries the context window and the credit rates per 1K input and output tokens: `regionPricing.base` for global-region requests, `regionPricing.us` for default requests, `longContext` for prompts over its threshold, and `cachePricing` for prompt-cache tokens on a model that has cache prices. A model reached through a `providerAlias` is not listed. Use this to populate model pickers and to validate a request before calling `/v1/chat`, `/v1/rag`, or `/v1/documents/{id}/ask`.
|
|
7735
8463
|
*
|
|
7736
8464
|
* @param {InferenceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7737
8465
|
*
|
|
@@ -7775,7 +8503,7 @@ var InferenceClient = class {
|
|
|
7775
8503
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/models");
|
|
7776
8504
|
}
|
|
7777
8505
|
/**
|
|
7778
|
-
* Streams a model response as Server-Sent Events (SSE). Send the full conversation history in the `messages` array; a message with role `system` is extracted and used as the system prompt.
|
|
8506
|
+
* Streams a model response as Server-Sent Events (SSE). Send the full conversation history in the `messages` array; a message with role `system` is extracted and used as the system prompt. On a pre-paid account, token cost is debited from your inference balance; usage-billed accounts accrue it for post-billing. A request routed through your own `providerAlias` incurs no Vectros token cost. A per-call platform fee is charged to your monthly credit allowance, except when the call fails on the server side: 0.2 credits for a call of up to 60 seconds, then 1 credit per 5 minutes of the call's duration. Requires the `inference:r` scope.
|
|
7779
8507
|
*/
|
|
7780
8508
|
chatInference(request, requestOptions) {
|
|
7781
8509
|
return HttpResponsePromise.fromPromise(this.__chatInference(request, requestOptions));
|
|
@@ -7828,10 +8556,14 @@ var InferenceClient = class {
|
|
|
7828
8556
|
throw new PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
7829
8557
|
case 403:
|
|
7830
8558
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8559
|
+
case 404:
|
|
8560
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7831
8561
|
case 413:
|
|
7832
8562
|
throw new ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
7833
8563
|
case 429:
|
|
7834
8564
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8565
|
+
case 503:
|
|
8566
|
+
throw new ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
7835
8567
|
default:
|
|
7836
8568
|
throw new VectrosError({
|
|
7837
8569
|
statusCode: _response.error.statusCode,
|
|
@@ -7843,7 +8575,7 @@ var InferenceClient = class {
|
|
|
7843
8575
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/chat");
|
|
7844
8576
|
}
|
|
7845
8577
|
/**
|
|
7846
|
-
* Loads a single document's extracted text, supplies it as context, and streams a model answer about it. The document must
|
|
8578
|
+
* Loads a single document's extracted text, supplies it as context, and streams a model answer about it. The document must have finished processing and have text. If the document exceeds the 32K-token cap, the call returns 413 with no credits charged — use `POST /v1/rag` instead to answer over larger or multi-document collections. Requires the `inference:r` scope.
|
|
7847
8579
|
*/
|
|
7848
8580
|
documentAsk(request, requestOptions) {
|
|
7849
8581
|
return HttpResponsePromise.fromPromise(this.__documentAsk(request, requestOptions));
|
|
@@ -7905,6 +8637,8 @@ var InferenceClient = class {
|
|
|
7905
8637
|
throw new ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
7906
8638
|
case 429:
|
|
7907
8639
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8640
|
+
case 503:
|
|
8641
|
+
throw new ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
7908
8642
|
default:
|
|
7909
8643
|
throw new VectrosError({
|
|
7910
8644
|
statusCode: _response.error.statusCode,
|
|
@@ -7969,12 +8703,16 @@ var InferenceClient = class {
|
|
|
7969
8703
|
throw new PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
7970
8704
|
case 403:
|
|
7971
8705
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8706
|
+
case 404:
|
|
8707
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7972
8708
|
case 413:
|
|
7973
8709
|
throw new ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
7974
8710
|
case 429:
|
|
7975
8711
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7976
8712
|
case 500:
|
|
7977
8713
|
throw new InternalServerError(_response.error.body, _response.rawResponse);
|
|
8714
|
+
case 503:
|
|
8715
|
+
throw new ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
7978
8716
|
default:
|
|
7979
8717
|
throw new VectrosError({
|
|
7980
8718
|
statusCode: _response.error.statusCode,
|
|
@@ -8052,7 +8790,7 @@ var RecordsClient = class {
|
|
|
8052
8790
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/records/batch-get");
|
|
8053
8791
|
}
|
|
8054
8792
|
/**
|
|
8055
|
-
* Reserved endpoint for batch lookup and reference resolution. The published response shape correlates results to each input and carries a per-item status envelope.
|
|
8793
|
+
* Reserved endpoint for batch lookup and reference resolution. With the `records:r` scope it answers 501 (not implemented). The published response shape correlates results to each input and carries a per-item status envelope. Requires the `records:r` scope.
|
|
8056
8794
|
*
|
|
8057
8795
|
* @param {Vectros.BatchLookupRequest} request
|
|
8058
8796
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -8113,7 +8851,7 @@ var RecordsClient = class {
|
|
|
8113
8851
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/records/lookup/batch");
|
|
8114
8852
|
}
|
|
8115
8853
|
/**
|
|
8116
|
-
* Writes up to 50 records
|
|
8854
|
+
* Writes up to 50 records per request in `best_effort` mode and up to 50 with `atomicity: all_or_nothing`, in a single request. Each item in `items` has exactly the same shape, and goes through exactly the same validation, authorization and idempotency rules, as the body of a single `POST /v1/records` — including schema validation, `externalId` idempotency, unique-field enforcement, and the `records:c:<type>` scope check, which is applied per item against that item's own record type. A batch is not a way to write a type your credential could not write one at a time.
|
|
8117
8855
|
*
|
|
8118
8856
|
* `atomicity` selects how the batch commits. `best_effort` (the default) writes each item independently: some can succeed while others fail, and each item's own outcome is reported. `all_or_nothing` commits every item in one transaction — if any item fails, no record is created or updated at all, and every item that was itself fine reports `not_committed` while the ones that failed report why. Because the transaction is bounded by the number of underlying storage rows rather than by the number of records, a large `all_or_nothing` batch can be refused as too large to commit atomically even when it is within the item limit; the error says so, and nothing is written when it happens.
|
|
8119
8857
|
*
|
|
@@ -8252,6 +8990,8 @@ var RecordsClient = class {
|
|
|
8252
8990
|
*
|
|
8253
8991
|
* @throws {@link Vectros.BadRequestError}
|
|
8254
8992
|
* @throws {@link Vectros.ForbiddenError}
|
|
8993
|
+
* @throws {@link Vectros.NotFoundError}
|
|
8994
|
+
* @throws {@link Vectros.ConflictError}
|
|
8255
8995
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
8256
8996
|
*
|
|
8257
8997
|
* @example
|
|
@@ -8308,6 +9048,10 @@ var RecordsClient = class {
|
|
|
8308
9048
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
8309
9049
|
case 403:
|
|
8310
9050
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
9051
|
+
case 404:
|
|
9052
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
9053
|
+
case 409:
|
|
9054
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
8311
9055
|
case 429:
|
|
8312
9056
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8313
9057
|
default:
|
|
@@ -8456,6 +9200,7 @@ var RecordsClient = class {
|
|
|
8456
9200
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8457
9201
|
*
|
|
8458
9202
|
* @throws {@link Vectros.NotFoundError}
|
|
9203
|
+
* @throws {@link Vectros.ConflictError}
|
|
8459
9204
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
8460
9205
|
*
|
|
8461
9206
|
* @example
|
|
@@ -8495,6 +9240,8 @@ var RecordsClient = class {
|
|
|
8495
9240
|
switch (_response.error.statusCode) {
|
|
8496
9241
|
case 404:
|
|
8497
9242
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
9243
|
+
case 409:
|
|
9244
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
8498
9245
|
case 429:
|
|
8499
9246
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
8500
9247
|
default:
|
|
@@ -8508,7 +9255,7 @@ var RecordsClient = class {
|
|
|
8508
9255
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/records/{id}");
|
|
8509
9256
|
}
|
|
8510
9257
|
/**
|
|
8511
|
-
* Partially updates a record using an RFC 7386 JSON Merge Patch. The `payload` object is deep-merged into the existing payload: keys you send overwrite (recursing into nested objects), a key set to null is deleted, and keys you omit are left unchanged — so you can change a single field without re-sending the rest (unlike the full-replacement PUT). Top-level fields (`status`, `folderId`, `userId`, `scopes`) are set when present and left unchanged when omitted; sending a top-level field as null is rejected (clearing a top-level field is not supported
|
|
9258
|
+
* Partially updates a record using an RFC 7386 JSON Merge Patch. The `payload` object is deep-merged into the existing payload: keys you send overwrite (recursing into nested objects), a key set to null is deleted, and keys you omit are left unchanged — so you can change a single field without re-sending the rest (unlike the full-replacement PUT). Top-level fields (`status`, `folderId`, `userId`, `scopes`) are set when present and left unchanged when omitted; sending a top-level field as null is rejected (clearing a top-level field is not supported — omit it instead). `typeName`, `schemaId`, `externalId`, and `indexMode` are immutable and rejected if present. The merged result is validated against the schema. Pass `expectedVersion` to make the patch conditional (optimistic concurrency, 409 on conflict). Requires the `records:u:<type>` scope.
|
|
8512
9259
|
*
|
|
8513
9260
|
* @param {Vectros.PatchRecordRequest} request
|
|
8514
9261
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -8937,6 +9684,8 @@ var SchemasClient = class {
|
|
|
8937
9684
|
*
|
|
8938
9685
|
* @throws {@link Vectros.BadRequestError}
|
|
8939
9686
|
* @throws {@link Vectros.ForbiddenError}
|
|
9687
|
+
* @throws {@link Vectros.NotFoundError}
|
|
9688
|
+
* @throws {@link Vectros.ConflictError}
|
|
8940
9689
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
8941
9690
|
*
|
|
8942
9691
|
* @example
|
|
@@ -8961,8 +9710,7 @@ var SchemasClient = class {
|
|
|
8961
9710
|
* }],
|
|
8962
9711
|
* capabilities: {
|
|
8963
9712
|
* "auditHistory": true
|
|
8964
|
-
* }
|
|
8965
|
-
* allowedSurfaces: ["record"]
|
|
9713
|
+
* }
|
|
8966
9714
|
* }
|
|
8967
9715
|
* })
|
|
8968
9716
|
*/
|
|
@@ -9006,6 +9754,10 @@ var SchemasClient = class {
|
|
|
9006
9754
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
9007
9755
|
case 403:
|
|
9008
9756
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
9757
|
+
case 404:
|
|
9758
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
9759
|
+
case 409:
|
|
9760
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
9009
9761
|
case 429:
|
|
9010
9762
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
9011
9763
|
default:
|
|
@@ -9088,11 +9840,7 @@ var SchemasClient = class {
|
|
|
9088
9840
|
* @example
|
|
9089
9841
|
* await client.schemas.updateSchema({
|
|
9090
9842
|
* id: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
9091
|
-
* body: {
|
|
9092
|
-
* typeName: "intake_form",
|
|
9093
|
-
* displayName: "Client Intake Form",
|
|
9094
|
-
* allowedSurfaces: ["record"]
|
|
9095
|
-
* }
|
|
9843
|
+
* body: {}
|
|
9096
9844
|
* })
|
|
9097
9845
|
*/
|
|
9098
9846
|
updateSchema(request, requestOptions) {
|
|
@@ -9149,7 +9897,7 @@ var SchemasClient = class {
|
|
|
9149
9897
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/schemas/{id}");
|
|
9150
9898
|
}
|
|
9151
9899
|
/**
|
|
9152
|
-
* Permanently deletes a record schema. The request is refused with 409 if records of this type still exist — delete those records first, since every record must reference a live schema. The same applies to documents bound to this schema (for a schema declaring the `document` surface) — delete those documents first. A lineage base (a schema other schemas declare `basedOn`) also cannot be deleted while any such variant still exists — delete the variant schema(s) first. It is likewise refused while any trigger rule fires off this schema — delete those trigger rules first. Requires the `schemas:d` scope.
|
|
9900
|
+
* Permanently deletes a record schema. The request is refused with 409 if records of this type still exist — delete those records first, since every record must reference a live schema. The same applies to documents bound to this schema (for a schema declaring the `document` surface) — delete those documents first. A lineage base (a schema other schemas declare `basedOn`) also cannot be deleted while any such variant still exists — delete the variant schema(s) first. It is likewise refused while any trigger rule fires off this schema — delete those trigger rules first — and, for a schema declaring the `user` or `entity` surface, while any user or entity bound to it still exists. Requires the `schemas:d` scope.
|
|
9153
9901
|
*
|
|
9154
9902
|
* @param {Vectros.DeleteSchemaRequest} request
|
|
9155
9903
|
* @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -9276,7 +10024,7 @@ var ScriptsClient = class {
|
|
|
9276
10024
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
9277
10025
|
}
|
|
9278
10026
|
/**
|
|
9279
|
-
* Runs a script you previously pushed to `POST /v1/scripts`, under your own credential, and returns what it returned. Every write the script makes is buffered and committed as ONE transaction after the script finishes: either all of them land or none do, and the response is sent only after they have committed — so everything in `result` is committed state or the script's own computation over it. On any failure the body is the standard error envelope and nothing the script staged is committed: its rows are written only when the transaction commits, and a document body or a large payload is DECIDED at that point and WRITTEN to storage only after the commit, so an aborted execution leaves nothing behind. The one residual sits after a successful commit, outside this response: if storing a body fails then, the row exists and the body
|
|
10027
|
+
* Runs a script you previously pushed to `POST /v1/scripts`, under your own credential, and returns what it returned. Every write the script makes is buffered and committed as ONE transaction after the script finishes: either all of them land or none do, and the response is sent only after they have committed — so everything in `result` is committed state or the script's own computation over it. On any failure the body is the standard error envelope and nothing the script staged is committed: its rows are written only when the transaction commits, and a document body or a large payload is DECIDED at that point and WRITTEN to storage only after the commit, so an aborted execution leaves nothing behind. The one residual sits after a successful commit, outside this response: if storing a body fails then, the row exists and the body may not — so a `200` guarantees the rows, and a document's text should be read before it is relied on.
|
|
9280
10028
|
*
|
|
9281
10029
|
* **Permission.** Requires the `scripts:x` scope — the permission to *execute* — separate from the `scripts:c` permission to push scripts. Bare `scripts:x` grants every script in the context; `scripts:x:<name>` grants exactly that script name, every version of it. Execution discloses no source, so `scripts:r` is not needed. Inside the script, every read and write is enforced by your credential's data scopes exactly as the equivalent REST call would be — `scripts:x` alone can read and write nothing.
|
|
9282
10030
|
*
|
|
@@ -9632,7 +10380,7 @@ var ScriptsClient = class {
|
|
|
9632
10380
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/scripts/{id}");
|
|
9633
10381
|
}
|
|
9634
10382
|
/**
|
|
9635
|
-
* Permanently deletes one script version by ID. Deleting one version does not affect any other version of the same name. Requires the `scripts:d` scope. Refused with 409 if a live trigger rule still references this version — either directly (a pinned `scriptRef`), or via `"latest"` when this IS the newest version of its name. Delete or re-point those rules first.
|
|
10383
|
+
* Permanently deletes one script version by ID. Deleting one version does not affect any other version of the same name. Requires the `scripts:d` scope. Refused with 409 if a live trigger rule still references this version — either directly (a pinned `scriptRef`), or via `"latest"` when this IS the newest version of its name. Delete or re-point those rules first. Also refused with a retryable 409, deleting nothing, when it cannot be told yet whether this is the newest version (for example just after several of this name's newest versions were deleted, or while its first version is gone and the listing has not caught up) and a `"latest"` rule depends on the script: try again shortly.
|
|
9636
10384
|
*
|
|
9637
10385
|
* @param {Vectros.DeleteScriptRequest} request
|
|
9638
10386
|
* @param {ScriptsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -9890,21 +10638,13 @@ var TriggersClient = class {
|
|
|
9890
10638
|
*
|
|
9891
10639
|
* @throws {@link Vectros.BadRequestError}
|
|
9892
10640
|
* @throws {@link Vectros.ForbiddenError}
|
|
10641
|
+
* @throws {@link Vectros.NotFoundError}
|
|
10642
|
+
* @throws {@link Vectros.ConflictError}
|
|
9893
10643
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
9894
10644
|
*
|
|
9895
10645
|
* @example
|
|
9896
10646
|
* await client.triggers.createTrigger({
|
|
9897
|
-
* body: {
|
|
9898
|
-
* name: "on-intake-create",
|
|
9899
|
-
* firingSource: {
|
|
9900
|
-
* schemaId: "sch_9f8e7d6c",
|
|
9901
|
-
* event: "CREATE"
|
|
9902
|
-
* },
|
|
9903
|
-
* scriptRef: {
|
|
9904
|
-
* name: "notify-assignee",
|
|
9905
|
-
* version: "3"
|
|
9906
|
-
* }
|
|
9907
|
-
* }
|
|
10647
|
+
* body: {}
|
|
9908
10648
|
* })
|
|
9909
10649
|
*/
|
|
9910
10650
|
createTrigger(request, requestOptions) {
|
|
@@ -9947,6 +10687,10 @@ var TriggersClient = class {
|
|
|
9947
10687
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
9948
10688
|
case 403:
|
|
9949
10689
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
10690
|
+
case 404:
|
|
10691
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
10692
|
+
case 409:
|
|
10693
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
9950
10694
|
case 429:
|
|
9951
10695
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
9952
10696
|
default:
|
|
@@ -10023,22 +10767,13 @@ var TriggersClient = class {
|
|
|
10023
10767
|
* @throws {@link Vectros.BadRequestError}
|
|
10024
10768
|
* @throws {@link Vectros.ForbiddenError}
|
|
10025
10769
|
* @throws {@link Vectros.NotFoundError}
|
|
10770
|
+
* @throws {@link Vectros.ConflictError}
|
|
10026
10771
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
10027
10772
|
*
|
|
10028
10773
|
* @example
|
|
10029
10774
|
* await client.triggers.updateTrigger({
|
|
10030
10775
|
* id: "id",
|
|
10031
|
-
* body: {
|
|
10032
|
-
* name: "on-intake-create",
|
|
10033
|
-
* firingSource: {
|
|
10034
|
-
* schemaId: "sch_9f8e7d6c",
|
|
10035
|
-
* event: "CREATE"
|
|
10036
|
-
* },
|
|
10037
|
-
* scriptRef: {
|
|
10038
|
-
* name: "notify-assignee",
|
|
10039
|
-
* version: "3"
|
|
10040
|
-
* }
|
|
10041
|
-
* }
|
|
10776
|
+
* body: {}
|
|
10042
10777
|
* })
|
|
10043
10778
|
*/
|
|
10044
10779
|
updateTrigger(request, requestOptions) {
|
|
@@ -10080,6 +10815,8 @@ var TriggersClient = class {
|
|
|
10080
10815
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
10081
10816
|
case 404:
|
|
10082
10817
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
10818
|
+
case 409:
|
|
10819
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
10083
10820
|
case 429:
|
|
10084
10821
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
10085
10822
|
default:
|
|
@@ -10099,6 +10836,7 @@ var TriggersClient = class {
|
|
|
10099
10836
|
* @param {TriggersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
10100
10837
|
*
|
|
10101
10838
|
* @throws {@link Vectros.NotFoundError}
|
|
10839
|
+
* @throws {@link Vectros.ConflictError}
|
|
10102
10840
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
10103
10841
|
*
|
|
10104
10842
|
* @example
|
|
@@ -10138,6 +10876,8 @@ var TriggersClient = class {
|
|
|
10138
10876
|
switch (_response.error.statusCode) {
|
|
10139
10877
|
case 404:
|
|
10140
10878
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
10879
|
+
case 409:
|
|
10880
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
10141
10881
|
case 429:
|
|
10142
10882
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
10143
10883
|
default:
|
|
@@ -10158,6 +10898,9 @@ var VectrosClient = class {
|
|
|
10158
10898
|
get auth() {
|
|
10159
10899
|
return this._auth ?? (this._auth = new AuthClient(this._options));
|
|
10160
10900
|
}
|
|
10901
|
+
get agents() {
|
|
10902
|
+
return this._agents ?? (this._agents = new AgentsClient(this._options));
|
|
10903
|
+
}
|
|
10161
10904
|
get documents() {
|
|
10162
10905
|
return this._documents ?? (this._documents = new DocumentsClient(this._options));
|
|
10163
10906
|
}
|
|
@@ -10228,7 +10971,7 @@ import {
|
|
|
10228
10971
|
ListToolsRequestSchema,
|
|
10229
10972
|
ReadResourceRequestSchema
|
|
10230
10973
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
10231
|
-
import { z as
|
|
10974
|
+
import { z as z28 } from "zod";
|
|
10232
10975
|
|
|
10233
10976
|
// src/auth.ts
|
|
10234
10977
|
var KEY_RE = /^(sk|ssk|st)_(live|test)_/;
|
|
@@ -10272,8 +11015,8 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
10272
11015
|
|
|
10273
11016
|
// src/build-info.ts
|
|
10274
11017
|
var BUILD_INFO = {
|
|
10275
|
-
mcpServer: true ? "0.
|
|
10276
|
-
sdk: true ? "0.
|
|
11018
|
+
mcpServer: true ? "0.19.0" : "dev",
|
|
11019
|
+
sdk: true ? "0.49.0" : "dev"
|
|
10277
11020
|
};
|
|
10278
11021
|
|
|
10279
11022
|
// src/log.ts
|
|
@@ -10529,6 +11272,11 @@ ${detail}${trailer}`
|
|
|
10529
11272
|
};
|
|
10530
11273
|
}
|
|
10531
11274
|
|
|
11275
|
+
// src/tools/limits.ts
|
|
11276
|
+
var MAX_OWNERSHIP_SCOPES = 2;
|
|
11277
|
+
var MAX_SCOPE_FILTERS = 16;
|
|
11278
|
+
var MAX_CONTENT_TYPES = 2;
|
|
11279
|
+
|
|
10532
11280
|
// src/tools/hybrid_search.ts
|
|
10533
11281
|
var MCP_DEFAULT_LIMIT = 3;
|
|
10534
11282
|
var MCP_MAX_LIMIT = 50;
|
|
@@ -10571,11 +11319,11 @@ var inputSchema = {
|
|
|
10571
11319
|
folderId: z.string().optional().describe("Scope to content in this EXACT folder (Vectros folder id)."),
|
|
10572
11320
|
rootFolderId: z.string().optional().describe("Scope to content under this folder AND all its descendants (subtree-root folder id)."),
|
|
10573
11321
|
// Content narrowing.
|
|
10574
|
-
contentTypes: z.array(z.enum(["documents", "records"])).optional().describe('Narrow to content types. ["documents"] or ["records"]; omit for unified (both).'),
|
|
11322
|
+
contentTypes: z.array(z.enum(["documents", "records"])).max(MAX_CONTENT_TYPES, `contentTypes accepts at most ${MAX_CONTENT_TYPES} entries`).optional().describe('Narrow to content types. ["documents"] or ["records"]; omit for unified (both).'),
|
|
10575
11323
|
typeName: z.string().optional().describe(
|
|
10576
11324
|
'Restrict hits to this schema type (e.g. "patient", "runbook"). Applies to BOTH documents and records \u2014 combine with contentTypes to scope within one content type. Untyped content never matches.'
|
|
10577
11325
|
),
|
|
10578
|
-
filters: z.record(z.unknown()).optional().describe(
|
|
11326
|
+
filters: z.record(z.string(), z.unknown()).optional().describe(
|
|
10579
11327
|
'Field-level metadata filters (AND-combined). Value = scalar (equality), array (OR-set), or operator map: $eq/$ne/$gt/$gte/$lt/$lte (scalar) or $in/$nin (array). e.g. {"status":"open"} or {"price":{"$gte":100,"$lte":500}}.'
|
|
10580
11328
|
),
|
|
10581
11329
|
// Ownership.
|
|
@@ -10583,7 +11331,7 @@ var inputSchema = {
|
|
|
10583
11331
|
scope: z.string().optional().describe(
|
|
10584
11332
|
'Restrict to content carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "client:<uuid>", "group:eng-team"). `org` and `client` are reserved namespace names, registered like any other; others are namespaces you registered yourself. Mutually exclusive with `scopeFilters` \u2014 use this for ONE dimension.'
|
|
10585
11333
|
),
|
|
10586
|
-
scopeFilters: z.array(z.string()).min(1, "scopeFilters must name at least one dimension when supplied").optional().describe(
|
|
11334
|
+
scopeFilters: z.array(z.string()).min(1, "scopeFilters must name at least one dimension when supplied").max(MAX_SCOPE_FILTERS, `scopeFilters accepts at most ${MAX_SCOPE_FILTERS} entries`).optional().describe(
|
|
10587
11335
|
'Restrict to content matching ALL of these scope values \u2014 one per namespace \u2014 for a credential whose access spans more than one ownership dimension. e.g. ["org:<uuid>", "client:<uuid>"] narrows to one specific client WITHIN one specific org, which `scope` alone cannot express. Same `namespace:value` form as `scope`; naming the same namespace twice is rejected. Mutually exclusive with `scope` \u2014 use `scope` for a single dimension.'
|
|
10588
11336
|
),
|
|
10589
11337
|
// Date window.
|
|
@@ -11104,7 +11852,7 @@ var inputSchema5 = {
|
|
|
11104
11852
|
status: z5.string().optional().describe("Record lifecycle status. Defaults to ACTIVE server-side."),
|
|
11105
11853
|
folderId: z5.string().optional().describe("Group this record into a folder."),
|
|
11106
11854
|
userId: z5.string().optional().describe("Owning user id."),
|
|
11107
|
-
scopes: z5.array(z5.string()).optional().describe(
|
|
11855
|
+
scopes: z5.array(z5.string()).max(MAX_OWNERSHIP_SCOPES, `scopes accepts at most ${MAX_OWNERSHIP_SCOPES} entries`).optional().describe(
|
|
11108
11856
|
'Scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]). `org` and `client` are reserved namespace names, registered like any other; others are namespaces you registered yourself. This is the record\'s COMPLETE scope declaration, and each entry must fall inside the `data_scope` of a single clause of your credential that also grants this write \u2014 your identity supplies the DEFAULT when you state none, it does not limit which value you may state. An empty array `[]` creates a PRIVATE record owned by the calling user alone. Omit to stamp the credential\'s full identity \u2014 the default.'
|
|
11109
11857
|
)
|
|
11110
11858
|
};
|
|
@@ -11162,7 +11910,7 @@ var itemSchema = z6.strictObject({
|
|
|
11162
11910
|
status: z6.string().optional().describe("Record lifecycle status. Defaults to ACTIVE server-side."),
|
|
11163
11911
|
folderId: z6.string().optional().describe("Group this record into a folder."),
|
|
11164
11912
|
userId: z6.string().optional().describe("Owning user id."),
|
|
11165
|
-
scopes: z6.array(z6.string()).optional().describe(
|
|
11913
|
+
scopes: z6.array(z6.string()).max(MAX_OWNERSHIP_SCOPES, `scopes accepts at most ${MAX_OWNERSHIP_SCOPES} entries`).optional().describe(
|
|
11166
11914
|
"Scope ownership as `namespace:value` entries, at most 2 namespaces. When supplied this is the record's COMPLETE scope declaration, and each entry must fall inside the `data_scope` of a single clause of your credential that also grants this write \u2014 your identity supplies the DEFAULT when you state none, it does not limit which value you may state. `[]` creates a PRIVATE record owned by the calling user alone. Omit to inherit the credential's full identity."
|
|
11167
11915
|
)
|
|
11168
11916
|
});
|
|
@@ -11249,7 +11997,7 @@ var inputSchema7 = {
|
|
|
11249
11997
|
),
|
|
11250
11998
|
status: z7.string().optional().describe("Set the record lifecycle status (e.g. ARCHIVED) \u2014 archive/workflow without physical deletion."),
|
|
11251
11999
|
expectedVersion: z7.number().int().optional().describe(
|
|
11252
|
-
"Optimistic concurrency: the version you last read. If the record changed since, the update is refused as a conflict (re-read and retry). Omit
|
|
12000
|
+
"Optimistic concurrency: the version you last read. If the record changed since, the update is refused as a conflict (re-read and retry). Omit it to update whatever version is current: an update that meets another change to the same record at the same moment is still refused as a conflict."
|
|
11253
12001
|
)
|
|
11254
12002
|
};
|
|
11255
12003
|
var recordUpdate = ({ client, log }) => ({
|
|
@@ -11319,7 +12067,7 @@ import { z as z10 } from "zod";
|
|
|
11319
12067
|
// src/tools/provider-alias.ts
|
|
11320
12068
|
import { z as z9 } from "zod";
|
|
11321
12069
|
var providerAliasInput = z9.string().min(1, "providerAlias must be non-empty when supplied").optional().describe(
|
|
11322
|
-
"Route THIS call through your own model provider instead of the platform-hosted default, by the alias of a provider config your account has activated. It works only after your account has set up that provider and signed the platform's risk-acceptance waiver; without both, the platform refuses the call with a 403, which is returned to you as written. If your account has accepted the Business Associate Agreement with Vectros in the developer portal, an account owner must also have attested that provider config in the developer portal (Model Providers); until then the platform refuses the call with a 403 that says it needs a BAA-holder attestation. A call served by your own provider leaves the Vectros perimeter. Omit it (the default) to use the platform-hosted path. When set, `model` names the model on your provider's own id space, and falls back to that provider config's default model when omitted."
|
|
12070
|
+
"Route THIS call through your own model provider instead of the platform-hosted default, by the alias of a provider config your account has activated. It works only after your account has set up that provider and signed the platform's risk-acceptance waiver; without both, the platform refuses the call with a 403, which is returned to you as written. When the waiver is the cause, the 403 carries an `errorCode` that says which case it is: `WAIVER_NOT_SIGNED` (the waiver has not been signed), `WAIVER_TEXT_CHANGED` (Vectros now requires a newer version of the waiver than the one in force for your account), or `WAIVER_REVOKED` (an owner revoked it). An account owner resolves each in the developer portal (Model Providers); retrying the call does not help. If your account has accepted the Business Associate Agreement with Vectros in the developer portal, an account owner must also have attested that provider config in the developer portal (Model Providers); until then the platform refuses the call with a 403 that says it needs a BAA-holder attestation. A call served by your own provider leaves the Vectros perimeter. Omit it (the default) to use the platform-hosted path. When set, `model` names the model on your provider's own id space, and falls back to that provider config's default model when omitted."
|
|
11323
12071
|
);
|
|
11324
12072
|
|
|
11325
12073
|
// src/tools/rag_ask.ts
|
|
@@ -11346,14 +12094,14 @@ var inputSchema9 = {
|
|
|
11346
12094
|
scope: z10.string().optional().describe(
|
|
11347
12095
|
'Restrict retrieval to content carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "client:<uuid>", "group:eng-team"). `org` and `client` are reserved namespace names, registered like any other; others are namespaces you registered yourself. Mutually exclusive with `scopeFilters` \u2014 use this for ONE dimension.'
|
|
11348
12096
|
),
|
|
11349
|
-
scopeFilters: z10.array(z10.string()).min(1, "scopeFilters must name at least one dimension when supplied").optional().describe(
|
|
12097
|
+
scopeFilters: z10.array(z10.string()).min(1, "scopeFilters must name at least one dimension when supplied").max(MAX_SCOPE_FILTERS, `scopeFilters accepts at most ${MAX_SCOPE_FILTERS} entries`).optional().describe(
|
|
11350
12098
|
'Restrict retrieval to content matching ALL of these scope values \u2014 one per namespace \u2014 for a credential whose access spans more than one ownership dimension. e.g. ["org:<uuid>", "client:<uuid>"] grounds the answer on one specific client WITHIN one specific org, which `scope` alone cannot express. Naming the same namespace twice is rejected. Mutually exclusive with `scope`.'
|
|
11351
12099
|
),
|
|
11352
12100
|
folderId: z10.string().optional().describe("Restrict retrieval to this exact folder."),
|
|
11353
12101
|
rootFolderId: z10.string().optional().describe("Restrict retrieval to this folder and all its descendants."),
|
|
11354
12102
|
typeName: z10.string().optional().describe("Restrict record retrieval to this schema type."),
|
|
11355
|
-
contentTypes: z10.array(z10.enum(["documents", "records"])).optional().describe('Narrow retrieval to content types. ["documents"] or ["records"]; omit for both.'),
|
|
11356
|
-
filters: z10.record(z10.unknown()).optional().describe(
|
|
12103
|
+
contentTypes: z10.array(z10.enum(["documents", "records"])).max(MAX_CONTENT_TYPES, `contentTypes accepts at most ${MAX_CONTENT_TYPES} entries`).optional().describe('Narrow retrieval to content types. ["documents"] or ["records"]; omit for both.'),
|
|
12104
|
+
filters: z10.record(z10.string(), z10.unknown()).optional().describe(
|
|
11357
12105
|
'Field-level metadata filters (AND-combined). Value = scalar (equality), array (OR-set), or operator map ($eq/$ne/$gt/$gte/$lt/$lte, $in/$nin). e.g. {"status":"open"}.'
|
|
11358
12106
|
),
|
|
11359
12107
|
createdAfter: z10.string().optional().describe(
|
|
@@ -11628,7 +12376,7 @@ function isNotAvailable(err) {
|
|
|
11628
12376
|
var documentGet = ({ client, log }) => ({
|
|
11629
12377
|
name: "document_get",
|
|
11630
12378
|
title: "Get document metadata (and optionally text)",
|
|
11631
|
-
description: "Fetch metadata for a single document \u2014 select it by its Vectros `documentId` OR by your own `externalId` + `type` (resolved for you). Pass `includeText: true` to also fetch the text body (capped at ~8K tokens; `truncated: true` flag if cut). Text is available for every text-ingested document and for file-ingested documents unless they were uploaded with `storeText: false` (extracted text discarded after indexing) \u2014 then `textAvailable: false` is set; the original file is still retrievable via `includeDownloadUrl`. Pass `includeDownloadUrl: true` to also get a short-lived presigned `downloadUrl` for the original file (file-backed documents only). Returns the full document metadata, including its lifecycle `status` (ACTIVE, or ARCHIVED when soft-retracted from search \u2014 restorable via document_update) and its processing `indexStatus`. When `indexStatus` is FAILED the response also carries `indexFailure` with a machine-readable `code` telling you whether the content is still findable \u2014 e.g. TEXT_INDEX_FAILED / VECTOR_LIMIT_EXCEEDED (one leg still serves it) vs INDEXING_FAILED (not findable by search at all). Branch on `code`, not on the message.",
|
|
12379
|
+
description: "Fetch metadata for a single document \u2014 select it by its Vectros `documentId` OR by your own `externalId` + `type` (resolved for you). Pass `includeText: true` to also fetch the text body (capped at ~8K tokens; `truncated: true` flag if cut). Text is available for every text-ingested document and for file-ingested documents unless they were uploaded with `storeText: false` (extracted text discarded after indexing) or no text could be extracted from the file (`extraction.outcome` other than OK/TRUNCATED, e.g. an image or a scanned page) \u2014 then `textAvailable: false` is set; the original file is still retrievable via `includeDownloadUrl`. Pass `includeDownloadUrl: true` to also get a short-lived presigned `downloadUrl` for the original file (file-backed documents only). Returns the full document metadata, including its lifecycle `status` (ACTIVE, or ARCHIVED when soft-retracted from search \u2014 restorable via document_update) and its processing `indexStatus`. When `indexStatus` is FAILED the response also carries `indexFailure` with a machine-readable `code` telling you whether the content is still findable \u2014 e.g. TEXT_INDEX_FAILED / VECTOR_LIMIT_EXCEEDED (one leg still serves it) vs INDEXING_FAILED (not findable by search at all). Branch on `code`, not on the message.",
|
|
11632
12380
|
inputSchema: inputSchema12,
|
|
11633
12381
|
// A pure read — never creates, modifies, or deletes anything server-side.
|
|
11634
12382
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
@@ -11654,7 +12402,7 @@ var documentGet = ({ client, log }) => ({
|
|
|
11654
12402
|
if (isNotAvailable(textErr)) {
|
|
11655
12403
|
log.debug(
|
|
11656
12404
|
{ tool: "document_get", id },
|
|
11657
|
-
"document_get text unavailable (not retained
|
|
12405
|
+
"document_get text unavailable (not retained, or no text could be extracted from the file)"
|
|
11658
12406
|
);
|
|
11659
12407
|
extra = { ...extra, textAvailable: false };
|
|
11660
12408
|
} else {
|
|
@@ -11707,10 +12455,12 @@ var inputSchema13 = {
|
|
|
11707
12455
|
to: z14.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
11708
12456
|
prefix: z14.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
11709
12457
|
order: z14.enum(["asc", "desc"]).optional().describe(
|
|
11710
|
-
"Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc` \u2014 use `desc` with a range/prefix lookup to get the most-recent / highest values first (e.g. latest-N).
|
|
12458
|
+
"Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc` \u2014 use `desc` with a range/prefix lookup to get the most-recent / highest values first (e.g. latest-N). Refused without `field`."
|
|
11711
12459
|
),
|
|
11712
|
-
type: z14.string().
|
|
11713
|
-
|
|
12460
|
+
type: z14.string().min(1, "type must be non-empty: omit it to list every type").optional().describe(
|
|
12461
|
+
"The document type (the bound schema's type). Required with `field` (lookup mode); in list mode it narrows the list to documents of this type. The list filter applies page by page: a page can hold fewer documents than `limit`, or none, while `nextCursor` is set, so keep paging until `nextCursor` is null before concluding there are none. For a large collection, hybrid_search with `typeName` finds documents of one type directly."
|
|
12462
|
+
),
|
|
12463
|
+
// List-mode args (`type` above applies to both modes):
|
|
11714
12464
|
folderId: z14.string().optional().describe("List mode: only documents in this folder (Vectros folder id)."),
|
|
11715
12465
|
userId: z14.string().optional().describe("List mode: scope to documents owned by this user."),
|
|
11716
12466
|
scope: z14.string().optional().describe(
|
|
@@ -11724,7 +12474,7 @@ var inputSchema13 = {
|
|
|
11724
12474
|
var documentQuery = ({ client, log }) => ({
|
|
11725
12475
|
name: "document_query",
|
|
11726
12476
|
title: "Document query (list or lookup)",
|
|
11727
|
-
description: "Query document metadata. Two modes:\n \u2022 Lookup on a lookup-indexed field: pass `type` and `field` plus exactly one of `value` (exact), `from`+`to` (range), or `prefix`. Works on sensitive fields (equality only there); range/prefix need a range-enabled field.\n \u2022 List: omit `field`; optionally filter by `folderId`/`userId`/`scope` (`namespace:value`).\nReturns a `{ data, nextCursor }` page: `data` holds up to `limit` documents (default 3, max 100 \u2014 raise it in one call when you can accept the payload), and a non-null `nextCursor` means more remain \u2014 pass it back as `startFrom` to page. Mode is auto-detected. Use document_get for the full text/download URL of one document.",
|
|
12477
|
+
description: "Query document metadata. Two modes:\n \u2022 Lookup on a lookup-indexed field: pass `type` and `field` plus exactly one of `value` (exact), `from`+`to` (range), or `prefix`. Works on sensitive fields (equality only there); range/prefix need a range-enabled field.\n \u2022 List: omit `field`; optionally filter by `type`/`folderId`/`userId`/`scope` (`namespace:value`). The `type` filter is applied page by page, so a page can be short or empty while `nextCursor` is set: keep paging before concluding there are none.\nReturns a `{ data, nextCursor }` page: `data` holds up to `limit` documents (default 3, max 100 \u2014 raise it in one call when you can accept the payload), and a non-null `nextCursor` means more remain \u2014 pass it back as `startFrom` to page. Mode is auto-detected. Use document_get for the full text/download URL of one document.",
|
|
11728
12478
|
inputSchema: inputSchema13,
|
|
11729
12479
|
// A pure read — never creates, modifies, or deletes anything server-side.
|
|
11730
12480
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
@@ -11783,7 +12533,19 @@ var documentQuery = ({ client, log }) => ({
|
|
|
11783
12533
|
"document_query lookup ok"
|
|
11784
12534
|
);
|
|
11785
12535
|
} else {
|
|
12536
|
+
const strayLookupArgs = ["value", "from", "to", "prefix", "order"].filter(
|
|
12537
|
+
(k) => args[k] !== void 0
|
|
12538
|
+
);
|
|
12539
|
+
if (strayLookupArgs.length > 0) {
|
|
12540
|
+
return toolError(
|
|
12541
|
+
"document_query",
|
|
12542
|
+
new Error(
|
|
12543
|
+
`Lookup arguments need 'field' (and 'type'): ${strayLookupArgs.map((k) => `'${k}'`).join(", ")}. Without 'field' the call lists documents: filter the list with 'type', 'folderId', 'userId' or 'scope'.`
|
|
12544
|
+
)
|
|
12545
|
+
);
|
|
12546
|
+
}
|
|
11786
12547
|
page = await client.documents.listDocuments({
|
|
12548
|
+
type,
|
|
11787
12549
|
folderId: args.folderId,
|
|
11788
12550
|
userId: args.userId,
|
|
11789
12551
|
scope: args.scope,
|
|
@@ -11791,7 +12553,7 @@ var documentQuery = ({ client, log }) => ({
|
|
|
11791
12553
|
limit
|
|
11792
12554
|
});
|
|
11793
12555
|
log.debug(
|
|
11794
|
-
{ tool: "document_query", mode: "list", limit, returned: pageItems(page).length },
|
|
12556
|
+
{ tool: "document_query", mode: "list", type, limit, returned: pageItems(page).length },
|
|
11795
12557
|
"document_query list ok"
|
|
11796
12558
|
);
|
|
11797
12559
|
}
|
|
@@ -11826,11 +12588,11 @@ var inputSchema14 = {
|
|
|
11826
12588
|
"Lifecycle status. `ARCHIVED` soft-retracts the document \u2014 it is pulled from search and recall but kept and recoverable; set it back to `ACTIVE` to re-index and restore it. The way to retire superseded content when the credential has no delete authority. Omit to leave unchanged."
|
|
11827
12589
|
),
|
|
11828
12590
|
userId: z15.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
11829
|
-
scopes: z15.array(z15.string()).optional().describe(
|
|
12591
|
+
scopes: z15.array(z15.string()).max(MAX_OWNERSHIP_SCOPES, `scopes accepts at most ${MAX_OWNERSHIP_SCOPES} entries`).optional().describe(
|
|
11830
12592
|
'Reassign scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]) \u2014 the COMPLETE new parent set. `org`/`client` are reserved namespace names, registered like any other. Omit to leave ownership unchanged; `[]` clears it (private to the owning user).'
|
|
11831
12593
|
),
|
|
11832
12594
|
expectedVersion: z15.number().int().optional().describe(
|
|
11833
|
-
"Optimistic concurrency: the version you last read. If the document changed since, the update is refused as a conflict (re-read and retry). Omit
|
|
12595
|
+
"Optimistic concurrency: the version you last read. If the document changed since, the update is refused as a conflict (re-read and retry). Omit it to update whatever version is current: an update that meets another change to the same document at the same moment is still refused as a conflict."
|
|
11834
12596
|
)
|
|
11835
12597
|
};
|
|
11836
12598
|
var documentUpdate = ({ client, log }) => ({
|
|
@@ -11970,7 +12732,7 @@ var inputSchema17 = {
|
|
|
11970
12732
|
"Optional stable slug (sibling-unique; idempotency key). Lowercase letters/digits/hyphens. SUPPLY THIS to make a retry safe \u2014 if omitted, a derived slug is only ever a freshly-proved-free one, so a redelivered call creates a new sibling folder every time rather than matching the first."
|
|
11971
12733
|
),
|
|
11972
12734
|
userId: z18.string().optional().describe("Owning user (Vectros UUID)."),
|
|
11973
|
-
scopes: z18.array(z18.string()).optional().describe(
|
|
12735
|
+
scopes: z18.array(z18.string()).max(MAX_OWNERSHIP_SCOPES, `scopes accepts at most ${MAX_OWNERSHIP_SCOPES} entries`).optional().describe(
|
|
11974
12736
|
'Scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]). `org` and `client` are reserved namespace names, registered like any other; others are namespaces you registered yourself. This is the folder\'s COMPLETE scope declaration and values must come from the credential\'s own identity. An empty array `[]` creates a PRIVATE folder owned by the calling user alone. Omit to stamp the credential\'s full identity \u2014 the default.'
|
|
11975
12737
|
)
|
|
11976
12738
|
};
|
|
@@ -11984,10 +12746,8 @@ var folderCreate = ({ client, log }) => ({
|
|
|
11984
12746
|
// freshly-proved-free value, so the idempotency check running after that derivation can never
|
|
11985
12747
|
// match on the default path. `slug` is optional, so this is annotated for the less-safe default —
|
|
11986
12748
|
// the same standard applied to record_create/document_ingest/record_batch_write's identical
|
|
11987
|
-
// optional-dedupe-key shape. (
|
|
11988
|
-
//
|
|
11989
|
-
// from the optional-externalId tools — that reasoning was wrong: the derivation is unconditional,
|
|
11990
|
-
// but it is unconditionally NON-colliding by construction, which is the opposite property.)
|
|
12749
|
+
// optional-dedupe-key shape. (The slug derivation being unconditional does not make the tool
|
|
12750
|
+
// idempotent: it is unconditionally NON-colliding by construction, which is the opposite property.)
|
|
11991
12751
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
|
|
11992
12752
|
handler: async (args) => {
|
|
11993
12753
|
try {
|
|
@@ -12018,11 +12778,11 @@ var inputSchema18 = {
|
|
|
12018
12778
|
name: z19.string().optional().describe("New folder name. Omit to keep the current name."),
|
|
12019
12779
|
description: z19.string().optional().describe("New description. Omit to leave unchanged."),
|
|
12020
12780
|
userId: z19.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
12021
|
-
scopes: z19.array(z19.string()).optional().describe(
|
|
12781
|
+
scopes: z19.array(z19.string()).max(MAX_OWNERSHIP_SCOPES, `scopes accepts at most ${MAX_OWNERSHIP_SCOPES} entries`).optional().describe(
|
|
12022
12782
|
'Reassign scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]) \u2014 the COMPLETE new parent set. `org`/`client` are reserved namespace names, registered like any other. Omit to leave ownership unchanged; `[]` clears it (private to the owning user).'
|
|
12023
12783
|
),
|
|
12024
12784
|
expectedVersion: z19.number().int().optional().describe(
|
|
12025
|
-
"Optimistic concurrency: the version you last read. If the folder changed since, the update is refused as a conflict (re-read and retry). Omit
|
|
12785
|
+
"Optimistic concurrency: the version you last read. If the folder changed since, the update is refused as a conflict (re-read and retry). Omit it to update whatever version is current: an update that meets another change to the same folder at the same moment is still refused as a conflict."
|
|
12026
12786
|
)
|
|
12027
12787
|
};
|
|
12028
12788
|
var folderUpdate = ({ client, log }) => ({
|
|
@@ -12067,7 +12827,7 @@ var inputSchema19 = {
|
|
|
12067
12827
|
var folderDelete = ({ client, log }) => ({
|
|
12068
12828
|
name: "folder_delete",
|
|
12069
12829
|
title: "Delete a folder",
|
|
12070
|
-
description: 'Permanently delete a folder by id. The folder must be EMPTY first \u2014 it must contain no documents, no records, and no sub-folders \u2014 and a non-empty folder is refused, which is the most common way this call fails. Use record_query with this folderId, and document_query, to see what is in it. Clearing it differs by content type: a document can be moved out (document_update with a different folderId) or deleted. A RECORD can also be re-filed into another folder \u2014 the API supports it \u2014 but THIS SERVER does not expose that
|
|
12830
|
+
description: 'Permanently delete a folder by id. The folder must be EMPTY first \u2014 it must contain no documents, no records, and no sub-folders \u2014 and a non-empty folder is refused, which is the most common way this call fails. Use record_query with this folderId, and document_query, to see what is in it. Clearing it differs by content type: a document can be moved out (document_update with a different folderId) or deleted. A RECORD can also be re-filed into another folder \u2014 the API supports it \u2014 but THIS SERVER does not expose that: record_update has no folderId argument, so from here your only option is record_delete (needs records:d). Do NOT read that as "the record cannot be moved" and delete the record on that basis: if the record should be kept, tell the user to move it with the Vectros API/SDK directly rather than deleting it here. A sub-folder cannot be re-parented at all, so nested folders have to be emptied and deleted innermost-first. Note the emptiness check counts everything in the folder, INCLUDING items your credential cannot read \u2014 so a refusal you cannot account for from what you can list is expected behaviour, not a bug, and retrying will not clear it. Requires the key to allow folders:d \u2014 a key without it gets a permission error. Protected folders (e.g. a context root) cannot be deleted at all, however empty.',
|
|
12071
12831
|
inputSchema: inputSchema19,
|
|
12072
12832
|
// Deletes. Idempotent in the standard REST sense: the end state ("this id no longer
|
|
12073
12833
|
// resolves") is the same whether this is the first delete or a repeat of one.
|
|
@@ -12093,7 +12853,7 @@ var inputSchema20 = {
|
|
|
12093
12853
|
var currentIdentity = ({ log, apiKey, environment }) => ({
|
|
12094
12854
|
name: "current_identity",
|
|
12095
12855
|
title: "Current identity (tenant + principal scope)",
|
|
12096
|
-
description: "Describe the credential the MCP server is operating under. Returns tenantId, environment (staging|production), principalType (root_key|scoped_key|token), principalKeyId, principalLabel, and (for scoped credentials) allowedActions plus dataScope \u2014 the credential's verb+ownership reach as { userId, scopes[] }, where each scope is a `namespace:value` string (e.g. \"org:<uuid>\"). Note: this does not
|
|
12856
|
+
description: "Describe the credential the MCP server is operating under. Returns tenantId, environment (staging|production), principalType (root_key|scoped_key|token), principalKeyId, principalLabel, and (for scoped credentials) allowedActions plus dataScope \u2014 the credential's verb+ownership reach as { userId, scopes[] }, where each scope is a `namespace:value` string (e.g. \"org:<uuid>\"). Note: this does not include granted_capabilities (member-lifecycle / forensic-read / context-directory-read / delegate-mint, as of API 0.40.0, joined by delegate-principal-stamp in 0.42.0 and trigger-control-plane-grant in 0.44.0) \u2014 a separate reach dimension a scope clause can carry that /v1/ping does not report, so allowedActions+dataScope may understate a credential's true reach. Also reports mcpServerVersion (this server's own package version) and sdkVersion (the bundled @vectros-ai/sdk version) so a caller can tell what build it's talking to. Use this when the user asks 'what can you do here?', 'what tenant am I in?', or 'what version is this?'. Calls GET /v1/ping under the hood.",
|
|
12097
12857
|
inputSchema: inputSchema20,
|
|
12098
12858
|
// A pure read (/v1/ping) — never creates, modifies, or deletes anything server-side.
|
|
12099
12859
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
@@ -12220,14 +12980,14 @@ var inputSchema21 = {
|
|
|
12220
12980
|
// Common (both modes):
|
|
12221
12981
|
folderId: z21.string().optional().describe("Optional folder to ingest into. Default: tenant root."),
|
|
12222
12982
|
userId: z21.string().optional().describe("Owning user ID. Optional."),
|
|
12223
|
-
scopes: z21.array(z21.string()).optional().describe(
|
|
12983
|
+
scopes: z21.array(z21.string()).max(MAX_OWNERSHIP_SCOPES, `scopes accepts at most ${MAX_OWNERSHIP_SCOPES} entries`).optional().describe(
|
|
12224
12984
|
"TEXT MODE ONLY. Scope ownership as `namespace:value` entries, at most 2 (e.g. [\"org:<uuid>\", \"group:eng-team\"]). `org` and `client` are reserved namespace names, registered like any other; others are namespaces you registered yourself. This is the document's COMPLETE scope declaration and values must come from the credential's own identity. An empty array `[]` creates a PRIVATE document owned by the calling user alone. Omit to stamp the credential's full identity \u2014 the default. Rejected with `filePath` (file uploads do not accept a scope declaration): a file-uploaded document is stamped with the credential's full identity."
|
|
12225
12985
|
)
|
|
12226
12986
|
};
|
|
12227
12987
|
var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
12228
12988
|
name: "document_ingest",
|
|
12229
12989
|
title: "Ingest a new document (text body or file upload)",
|
|
12230
|
-
description: "Create a new document in your Vectros tenant. Two modes:\n \u2022 Text mode: pass `text` (string body). Single-call. Use for crawled content, notes, generated text.\n \u2022 File mode: pass `filePath` (local path on the MCP server's host machine). STDIO-TRANSPORT ONLY \u2014 rejected on HTTP transport. MCP server reads the bytes, requests a presigned upload URL, and PUTs them. Returns when the upload is accepted (indexStatus: PENDING_INDEX); poll `document_get` until indexStatus is INDEXED. EXCEPTION \u2014 re-ingesting file mode against an externalId that already has a document (response `created:false`): the file body is replaced by ANY such re-ingest, whether or not `upsert` was set (`upsert` there only additionally applies `payload`/`title` to the matched document). The document keeps serving the OLD file's bytes until the new one is adopted, and indexStatus already reads INDEXED left over from that old file, so polling it returns immediately without waiting for the new content. Poll `document_get` and watch `fileItemId` instead \u2014 once it differs from the value it held before this call, the new file has been adopted. Re-request any download URL after that: one minted before adoption can stop working even within its stated `downloadExpires`.\nEither `text` or `filePath` must be present; both is an error. Idempotent by `externalId` (re-ingest returns the existing document, not a duplicate \u2014 requires documents:r in addition to documents:c, since being handed the existing document is a read of it; in FILE MODE a re-ingest against an existing externalId needs documents:u). TEXT MODE: without `upsert`, the existing document's content is genuinely unchanged. FILE MODE: as noted above, a re-ingest against an existing externalId always replaces the file body regardless of `upsert` \u2014 only the `payload`/`title` metadata overwrite is gated by it. To UPDATE an existing document instead \u2014 re-index an edited body \u2014 pass `upsert:true` with the same `externalId` (and the same `schemaId`); this is the re-sync primitive for keeping a knowledge base current. Pass `schemaId` + `payload` for a typed, lookup-queryable document (records parity). An `externalId` with no `schemaId` is refused (400) unless you also pass `confirmUntyped:true` to confirm that an untyped document is intended. indexMode defaults to HYBRID for untyped documents (omit to inherit a bound schema's default). storeText is a FILE-MODE knob (default true): false discards the uploaded file's extracted text after indexing (search + file download keep working; text retrieval and document_ask do not). Text-mode bodies are always retained, so storeText is not accepted with `text`.",
|
|
12990
|
+
description: "Create a new document in your Vectros tenant. Two modes:\n \u2022 Text mode: pass `text` (string body). Single-call. Use for crawled content, notes, generated text.\n \u2022 File mode: pass `filePath` (local path on the MCP server's host machine). STDIO-TRANSPORT ONLY \u2014 rejected on HTTP transport. MCP server reads the bytes, requests a presigned upload URL, and PUTs them. Returns when the upload is accepted (indexStatus: PENDING_INDEX); poll `document_get` until indexStatus is terminal: INDEXED, SKIPPED (no indexable text: `extraction.outcome` says why, e.g. NO_TEXT for an image or a scanned page), STORED (indexMode NONE) or FAILED. EXCEPTION \u2014 re-ingesting file mode against an externalId that already has a document (response `created:false`): the file body is replaced by ANY such re-ingest, whether or not `upsert` was set (`upsert` there only additionally applies `payload`/`title` to the matched document). The document keeps serving the OLD file's bytes until the new one is adopted, and indexStatus already reads INDEXED left over from that old file, so polling it returns immediately without waiting for the new content. Poll `document_get` and watch `fileItemId` instead \u2014 once it differs from the value it held before this call, the new file has been adopted. Re-request any download URL after that: one minted before adoption can stop working even within its stated `downloadExpires`.\nEither `text` or `filePath` must be present; both is an error. Idempotent by `externalId` (re-ingest returns the existing document, not a duplicate \u2014 requires documents:r in addition to documents:c, since being handed the existing document is a read of it; in FILE MODE a re-ingest against an existing externalId needs documents:u). TEXT MODE: without `upsert`, the existing document's content is genuinely unchanged. FILE MODE: as noted above, a re-ingest against an existing externalId always replaces the file body regardless of `upsert` \u2014 only the `payload`/`title` metadata overwrite is gated by it. To UPDATE an existing document instead \u2014 re-index an edited body \u2014 pass `upsert:true` with the same `externalId` (and the same `schemaId`); this is the re-sync primitive for keeping a knowledge base current. Pass `schemaId` + `payload` for a typed, lookup-queryable document (records parity). An `externalId` with no `schemaId` is refused (400) unless you also pass `confirmUntyped:true` to confirm that an untyped document is intended. indexMode defaults to HYBRID for untyped documents (omit to inherit a bound schema's default). storeText is a FILE-MODE knob (default true): false discards the uploaded file's extracted text after indexing (search + file download keep working; text retrieval and document_ask do not). Text-mode bodies are always retained, so storeText is not accepted with `text`.",
|
|
12231
12991
|
inputSchema: inputSchema21,
|
|
12232
12992
|
// Creates by default, idempotent ONLY when the caller supplies `externalId` (optional,
|
|
12233
12993
|
// per the doc comment above) — re-ingest then returns the existing document rather than
|
|
@@ -12369,7 +13129,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12369
13129
|
"document_ingest file ok"
|
|
12370
13130
|
);
|
|
12371
13131
|
const uploadCreated = upload?.created;
|
|
12372
|
-
const note = uploadCreated === false ? "File replaced: this re-ingest matched an existing externalId, which always replaces that document's file body (upsert or not \u2014 upsert only additionally applies payload/title to it). The next document_get call may already show indexStatus: INDEXED \u2014 that is left over from the PREVIOUS file, not confirmation the new one is ready, and the document keeps serving the old file's bytes until adoption completes. Poll document_get(id) and watch fileItemId instead: once it differs from the value it held before this call, the new file has been adopted. Any download URL already held for this document was minted for the old file and can stop working before its stated downloadExpires once adoption happens \u2014 request a fresh one after fileItemId changes." : "File uploaded; indexing is asynchronous. Poll document_get(id) until indexStatus is INDEXED.";
|
|
13132
|
+
const note = uploadCreated === false ? "File replaced: this re-ingest matched an existing externalId, which always replaces that document's file body (upsert or not \u2014 upsert only additionally applies payload/title to it). The next document_get call may already show indexStatus: INDEXED \u2014 that is left over from the PREVIOUS file, not confirmation the new one is ready, and the document keeps serving the old file's bytes until adoption completes. Poll document_get(id) and watch fileItemId instead: once it differs from the value it held before this call, the new file has been adopted. Any download URL already held for this document was minted for the old file and can stop working before its stated downloadExpires once adoption happens \u2014 request a fresh one after fileItemId changes." : "File uploaded; indexing is asynchronous. Poll document_get(id) until indexStatus is INDEXED, SKIPPED (no indexable text; see extraction.outcome), STORED or FAILED.";
|
|
12373
13133
|
return {
|
|
12374
13134
|
content: [
|
|
12375
13135
|
{
|
|
@@ -12542,6 +13302,365 @@ var versionHistory = ({ client, log }) => ({
|
|
|
12542
13302
|
});
|
|
12543
13303
|
var version_history_default = versionHistory;
|
|
12544
13304
|
|
|
13305
|
+
// src/tools/agent_list.ts
|
|
13306
|
+
import { z as z24 } from "zod";
|
|
13307
|
+
var MCP_DEFAULT_LIMIT6 = 10;
|
|
13308
|
+
var MCP_MAX_LIMIT6 = 100;
|
|
13309
|
+
function toAgentSummary(agent) {
|
|
13310
|
+
return {
|
|
13311
|
+
id: agent.id,
|
|
13312
|
+
name: agent.name,
|
|
13313
|
+
description: agent.description,
|
|
13314
|
+
latestVersion: agent.latestVersion,
|
|
13315
|
+
status: agent.status
|
|
13316
|
+
};
|
|
13317
|
+
}
|
|
13318
|
+
var inputSchema24 = {
|
|
13319
|
+
includeRetired: z24.boolean().optional().describe("Also list retired and purged agents (neither can be run). Default false."),
|
|
13320
|
+
startFrom: z24.string().optional().describe("Pagination cursor: pass the `nextCursor` from the previous page to fetch the next."),
|
|
13321
|
+
limit: z24.number().int().min(1).max(MCP_MAX_LIMIT6).optional().describe(`Max agents per page. Default ${MCP_DEFAULT_LIMIT6}, max ${MCP_MAX_LIMIT6}.`)
|
|
13322
|
+
};
|
|
13323
|
+
var agentList = ({ client, log }) => ({
|
|
13324
|
+
name: "agent_list",
|
|
13325
|
+
title: "List agents",
|
|
13326
|
+
description: "List the stored agents you can run with agent_run, newest first. Each is returned as its `id`, `name`, `description`, `latestVersion` and `status`; only an `ACTIVE` agent can be run. Retired and purged agents are left out unless `includeRetired` is true. Returns a `{ data, nextCursor }` page: a non-null `nextCursor` means more remain, pass it back as `startFrom`. Needs the `runs:c` or `agents:r` scope; running a listed agent needs `runs:c`, so a credential with only `agents:r` can list agents but not run them.",
|
|
13327
|
+
inputSchema: inputSchema24,
|
|
13328
|
+
// A pure read: it lists definitions and changes nothing.
|
|
13329
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
13330
|
+
handler: async (args) => {
|
|
13331
|
+
const limit = args.limit ?? MCP_DEFAULT_LIMIT6;
|
|
13332
|
+
try {
|
|
13333
|
+
const page = await client.agents.listAgents({
|
|
13334
|
+
includeRetired: args.includeRetired,
|
|
13335
|
+
startFrom: args.startFrom,
|
|
13336
|
+
limit
|
|
13337
|
+
});
|
|
13338
|
+
const data = (page.data ?? []).map(toAgentSummary);
|
|
13339
|
+
const nextCursor = page.nextCursor ?? null;
|
|
13340
|
+
log.debug({ tool: "agent_list", limit, returned: data.length }, "agent_list ok");
|
|
13341
|
+
return { content: [{ type: "text", text: JSON.stringify({ data, nextCursor }, null, 2) }] };
|
|
13342
|
+
} catch (err) {
|
|
13343
|
+
log.warn({ tool: "agent_list", err: String(err) }, "agent_list failed");
|
|
13344
|
+
return toolError("agent_list", err);
|
|
13345
|
+
}
|
|
13346
|
+
}
|
|
13347
|
+
});
|
|
13348
|
+
var agent_list_default = agentList;
|
|
13349
|
+
|
|
13350
|
+
// src/tools/agent_run.ts
|
|
13351
|
+
import { randomUUID } from "crypto";
|
|
13352
|
+
import { z as z25 } from "zod";
|
|
13353
|
+
|
|
13354
|
+
// src/run-stream.ts
|
|
13355
|
+
var TEXT_PROGRESS_CHARS = 256;
|
|
13356
|
+
var HEARTBEAT_MS = 15e3;
|
|
13357
|
+
var TERMINAL_STATUS = {
|
|
13358
|
+
"run.completed": "COMPLETED",
|
|
13359
|
+
"run.failed": "FAILED",
|
|
13360
|
+
"run.cancelled": "CANCELLED"
|
|
13361
|
+
};
|
|
13362
|
+
function str(v) {
|
|
13363
|
+
return typeof v === "string" && v.length > 0 ? v : void 0;
|
|
13364
|
+
}
|
|
13365
|
+
function num(v) {
|
|
13366
|
+
return typeof v === "number" && Number.isFinite(v) ? v : void 0;
|
|
13367
|
+
}
|
|
13368
|
+
async function consumeRunStream(stream, initialRunId, onProgress, heartbeatMs = HEARTBEAT_MS) {
|
|
13369
|
+
const result = {
|
|
13370
|
+
runId: initialRunId,
|
|
13371
|
+
terminal: false,
|
|
13372
|
+
status: "UNKNOWN",
|
|
13373
|
+
text: "",
|
|
13374
|
+
toolCalls: []
|
|
13375
|
+
};
|
|
13376
|
+
const blocks = [];
|
|
13377
|
+
let pending = "";
|
|
13378
|
+
let unsentChars = 0;
|
|
13379
|
+
const emit = async (message) => {
|
|
13380
|
+
if (!onProgress) return;
|
|
13381
|
+
try {
|
|
13382
|
+
await onProgress(message);
|
|
13383
|
+
} catch {
|
|
13384
|
+
}
|
|
13385
|
+
};
|
|
13386
|
+
let heartbeat;
|
|
13387
|
+
let lastEventAt = Date.now();
|
|
13388
|
+
if (onProgress) {
|
|
13389
|
+
heartbeat = setInterval(() => {
|
|
13390
|
+
if (Date.now() - lastEventAt >= heartbeatMs) {
|
|
13391
|
+
lastEventAt = Date.now();
|
|
13392
|
+
void emit("run still working");
|
|
13393
|
+
}
|
|
13394
|
+
}, Math.max(1, Math.floor(heartbeatMs / 3)));
|
|
13395
|
+
heartbeat.unref?.();
|
|
13396
|
+
}
|
|
13397
|
+
try {
|
|
13398
|
+
for await (const raw of stream) {
|
|
13399
|
+
lastEventAt = Date.now();
|
|
13400
|
+
if (!raw || typeof raw !== "object") continue;
|
|
13401
|
+
const ev = raw;
|
|
13402
|
+
result.runId ??= str(ev.runId);
|
|
13403
|
+
const type = typeof ev.type === "string" ? ev.type : "";
|
|
13404
|
+
switch (type) {
|
|
13405
|
+
case "run.started":
|
|
13406
|
+
result.agentId = str(ev.agentId) ?? result.agentId;
|
|
13407
|
+
result.agentVersion = num(ev.agentVersion) ?? result.agentVersion;
|
|
13408
|
+
await emit("run started");
|
|
13409
|
+
break;
|
|
13410
|
+
case "message.delta": {
|
|
13411
|
+
const piece = typeof ev.text === "string" ? ev.text : "";
|
|
13412
|
+
pending += piece;
|
|
13413
|
+
unsentChars += piece.length;
|
|
13414
|
+
if (unsentChars >= TEXT_PROGRESS_CHARS) {
|
|
13415
|
+
unsentChars = 0;
|
|
13416
|
+
await emit(`answer: ${blocks.join("\n\n").length + pending.length} characters so far`);
|
|
13417
|
+
}
|
|
13418
|
+
break;
|
|
13419
|
+
}
|
|
13420
|
+
case "message.completed": {
|
|
13421
|
+
const full = str(ev.text) ?? pending;
|
|
13422
|
+
if (full.length > 0) blocks.push(full);
|
|
13423
|
+
pending = "";
|
|
13424
|
+
unsentChars = 0;
|
|
13425
|
+
await emit("model call completed");
|
|
13426
|
+
break;
|
|
13427
|
+
}
|
|
13428
|
+
case "tool.completed": {
|
|
13429
|
+
const call = {
|
|
13430
|
+
tool: str(ev.tool),
|
|
13431
|
+
outcome: str(ev.outcome),
|
|
13432
|
+
code: str(ev.code)
|
|
13433
|
+
};
|
|
13434
|
+
result.toolCalls.push(call);
|
|
13435
|
+
await emit(`tool ${call.tool ?? "call"}: ${call.outcome ?? "ended"}`);
|
|
13436
|
+
break;
|
|
13437
|
+
}
|
|
13438
|
+
default:
|
|
13439
|
+
break;
|
|
13440
|
+
}
|
|
13441
|
+
if (ev.terminal === true || Object.hasOwn(TERMINAL_STATUS, type)) {
|
|
13442
|
+
result.terminal = true;
|
|
13443
|
+
result.status = str(ev.status) ?? TERMINAL_STATUS[type] ?? "ENDED";
|
|
13444
|
+
result.reason = str(ev.reason);
|
|
13445
|
+
result.errorCode = str(ev.errorCode);
|
|
13446
|
+
if (typeof ev.settled === "boolean" || ev.inferenceBalanceCentsChargedMilli !== void 0 || ev.inferenceBalanceCentsRefundedMilli !== void 0) {
|
|
13447
|
+
result.charged = {
|
|
13448
|
+
settled: typeof ev.settled === "boolean" ? ev.settled : void 0,
|
|
13449
|
+
inferenceBalanceCentsChargedMilli: num(ev.inferenceBalanceCentsChargedMilli),
|
|
13450
|
+
inferenceBalanceCentsRefundedMilli: num(ev.inferenceBalanceCentsRefundedMilli)
|
|
13451
|
+
};
|
|
13452
|
+
}
|
|
13453
|
+
break;
|
|
13454
|
+
}
|
|
13455
|
+
}
|
|
13456
|
+
} catch (err) {
|
|
13457
|
+
result.streamError = err instanceof Error ? err.message : String(err);
|
|
13458
|
+
} finally {
|
|
13459
|
+
if (heartbeat) clearInterval(heartbeat);
|
|
13460
|
+
}
|
|
13461
|
+
if (pending.length > 0) blocks.push(pending);
|
|
13462
|
+
result.text = blocks.join("\n\n");
|
|
13463
|
+
return result;
|
|
13464
|
+
}
|
|
13465
|
+
|
|
13466
|
+
// src/tools/agent_run.ts
|
|
13467
|
+
var RUN_ID_HEADER = "x-vectros-run-id";
|
|
13468
|
+
var MAX_INPUT_CHARS = 1e5;
|
|
13469
|
+
var MAX_INPUT_BYTES = 24e4;
|
|
13470
|
+
function encodedInputBytes(v) {
|
|
13471
|
+
return Buffer.byteLength(JSON.stringify(v), "utf8");
|
|
13472
|
+
}
|
|
13473
|
+
var TERMINAL_EVENT_TYPES = /* @__PURE__ */ new Set(["run.completed", "run.failed", "run.cancelled"]);
|
|
13474
|
+
var ENDED_STATUSES = /* @__PURE__ */ new Set(["COMPLETED", "FAILED", "CANCELLED", "EXPIRED"]);
|
|
13475
|
+
var inputSchema25 = {
|
|
13476
|
+
agentId: z25.string().min(1, "agentId must be non-empty").describe("The agent to run: an `id` from agent_list."),
|
|
13477
|
+
input: z25.string().min(1, "input must be non-empty").max(MAX_INPUT_CHARS, `input accepts at most ${MAX_INPUT_CHARS} characters`).refine(
|
|
13478
|
+
(v) => encodedInputBytes(v) <= MAX_INPUT_BYTES,
|
|
13479
|
+
`input accepts at most ${MAX_INPUT_BYTES} bytes as sent (a JSON string in UTF-8)`
|
|
13480
|
+
).describe(
|
|
13481
|
+
`What the agent is asked, 1 to ${MAX_INPUT_CHARS} characters and at most ${MAX_INPUT_BYTES} bytes as sent (a JSON string in UTF-8; most control characters other than newline and tab count six bytes).`
|
|
13482
|
+
),
|
|
13483
|
+
agentVersion: z25.number().int().min(1).optional().describe("The agent version to run. Default: its latest version."),
|
|
13484
|
+
maxInferenceCents: z25.number().int().min(1).optional().describe(
|
|
13485
|
+
"The most this run's model calls may cost, in US cents. It can only lower the agent's own budget (a higher value is refused); a value below the platform minimum is refused with errorCode `BUDGET_TOO_LOW`, whose message names the minimum. Default: the agent's budget. A run that reaches it ends `FAILED` with errorCode `BUDGET_EXCEEDED`."
|
|
13486
|
+
),
|
|
13487
|
+
readOnly: z25.boolean().optional().describe("When true, every tool call that would change data is refused in this run. Default false."),
|
|
13488
|
+
idempotencyKey: z25.string().regex(/^[A-Za-z0-9._:-]{1,128}$/, "idempotencyKey is 1 to 128 letters, digits, `.`, `_`, `:` or `-`").optional().describe(
|
|
13489
|
+
"Makes a retried call safe: the same key with the same arguments never starts a second run; the retry returns that run's id and status (`alreadyStarted: true`) instead. Its answer text is not returned again; read how it ended with run_get. Default: a new key per call."
|
|
13490
|
+
)
|
|
13491
|
+
};
|
|
13492
|
+
var agentRun = ({ client, log }) => ({
|
|
13493
|
+
name: "agent_run",
|
|
13494
|
+
title: "Run an agent",
|
|
13495
|
+
description: "Run a stored agent (from agent_list) on one `input` and return its answer. The agent's tool calls act as you, with your own permissions, and only through the tools the agent lists; set `readOnly` to refuse every tool call that would change data. Cap the run's model cost with `maxInferenceCents` (it can only lower the agent's own budget). The run is billed: model calls against your inference balance, and a fee per run, tool calls and run time against your plan. An agent can search the web or fetch a page when its definition lists that web tool (web fetch also needs your tenant's owner to switch it on, and a run of an agent that lists `web_search` is refused while the platform has web search disabled). Returns `{ runId, agentId, agentVersion, status, terminal, reason, errorCode, text, toolCalls, charged }`; `charged` carries the run's charge and refund in milli-cents (1 cent = 1000). Progress notifications keep the call alive while the run works for a client that resets its timeout on progress; cancelling the call cancels the run once the run is named (almost at once). If `terminal` is false the result arrived before the run ended: read it with run_get, which needs `runs:r` as well. Calling again without `idempotencyKey` starts a new, billed run. Needs the `runs:c` scope.",
|
|
13496
|
+
inputSchema: inputSchema25,
|
|
13497
|
+
// Not a read: a run is billed, and its tool calls may create, change or delete data with the
|
|
13498
|
+
// caller's permissions, so a host should confirm it. Not idempotent: each call is a new paid run
|
|
13499
|
+
// unless the same idempotencyKey is passed again.
|
|
13500
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
13501
|
+
handler: async (args, extra) => {
|
|
13502
|
+
const agentId = args.agentId;
|
|
13503
|
+
const maxInferenceCents = args.maxInferenceCents;
|
|
13504
|
+
const idempotencyKey = args.idempotencyKey ?? randomUUID();
|
|
13505
|
+
const request = {
|
|
13506
|
+
"Idempotency-Key": idempotencyKey,
|
|
13507
|
+
agentId,
|
|
13508
|
+
agentVersion: args.agentVersion,
|
|
13509
|
+
input: { text: args.input },
|
|
13510
|
+
budget: maxInferenceCents !== void 0 ? { maxInferenceCents } : void 0,
|
|
13511
|
+
readOnly: args.readOnly
|
|
13512
|
+
};
|
|
13513
|
+
const progressToken = extra._meta?.progressToken;
|
|
13514
|
+
let progressCount = 0;
|
|
13515
|
+
const onProgress = progressToken !== void 0 && extra.sendNotification ? async (message) => {
|
|
13516
|
+
progressCount += 1;
|
|
13517
|
+
await extra.sendNotification({
|
|
13518
|
+
method: "notifications/progress",
|
|
13519
|
+
params: { progressToken, progress: progressCount, message }
|
|
13520
|
+
});
|
|
13521
|
+
} : void 0;
|
|
13522
|
+
const streamAbort = new AbortController();
|
|
13523
|
+
const callSignal = extra.signal;
|
|
13524
|
+
let knownRunId;
|
|
13525
|
+
let headersReceived = false;
|
|
13526
|
+
let cancelRequested = false;
|
|
13527
|
+
let cancelSent = false;
|
|
13528
|
+
let runEnded = false;
|
|
13529
|
+
const sendCancel = () => {
|
|
13530
|
+
if (!cancelRequested || cancelSent || !knownRunId || runEnded) return;
|
|
13531
|
+
cancelSent = true;
|
|
13532
|
+
const id = knownRunId;
|
|
13533
|
+
client.agents.cancelRun({ id }).then(
|
|
13534
|
+
() => log.info({ tool: "agent_run", runId: id }, "agent_run cancelled by the client"),
|
|
13535
|
+
(err) => log.warn({ tool: "agent_run", runId: id, err: String(err) }, "agent_run cancel failed")
|
|
13536
|
+
);
|
|
13537
|
+
};
|
|
13538
|
+
const cancelIfNamed = () => {
|
|
13539
|
+
if (!cancelRequested || !headersReceived || !knownRunId) return;
|
|
13540
|
+
sendCancel();
|
|
13541
|
+
streamAbort.abort();
|
|
13542
|
+
};
|
|
13543
|
+
const onCancel = () => {
|
|
13544
|
+
cancelRequested = true;
|
|
13545
|
+
cancelIfNamed();
|
|
13546
|
+
};
|
|
13547
|
+
if (callSignal?.aborted) {
|
|
13548
|
+
return toolError("agent_run", new Error("The call was cancelled before the run started."));
|
|
13549
|
+
}
|
|
13550
|
+
callSignal?.addEventListener("abort", onCancel, { once: true });
|
|
13551
|
+
try {
|
|
13552
|
+
const { data: stream, rawResponse } = await client.agents.createRun(request, { abortSignal: streamAbort.signal }).withRawResponse();
|
|
13553
|
+
headersReceived = true;
|
|
13554
|
+
knownRunId = rawResponse.headers.get(RUN_ID_HEADER) ?? void 0;
|
|
13555
|
+
cancelIfNamed();
|
|
13556
|
+
const naming = async function* () {
|
|
13557
|
+
for await (const ev of stream) {
|
|
13558
|
+
if (!knownRunId && ev && typeof ev === "object") {
|
|
13559
|
+
const id = ev.runId;
|
|
13560
|
+
if (typeof id === "string" && id.length > 0) {
|
|
13561
|
+
knownRunId = id;
|
|
13562
|
+
cancelIfNamed();
|
|
13563
|
+
}
|
|
13564
|
+
}
|
|
13565
|
+
if (ev && typeof ev === "object") {
|
|
13566
|
+
const e = ev;
|
|
13567
|
+
if (e.terminal === true || typeof e.type === "string" && TERMINAL_EVENT_TYPES.has(e.type)) runEnded = true;
|
|
13568
|
+
}
|
|
13569
|
+
yield ev;
|
|
13570
|
+
}
|
|
13571
|
+
};
|
|
13572
|
+
const run = await consumeRunStream(naming(), knownRunId, onProgress);
|
|
13573
|
+
knownRunId ??= run.runId;
|
|
13574
|
+
if (run.terminal) runEnded = true;
|
|
13575
|
+
sendCancel();
|
|
13576
|
+
log.debug(
|
|
13577
|
+
{
|
|
13578
|
+
tool: "agent_run",
|
|
13579
|
+
runId: run.runId,
|
|
13580
|
+
status: run.status,
|
|
13581
|
+
terminal: run.terminal,
|
|
13582
|
+
toolCalls: run.toolCalls.length,
|
|
13583
|
+
textLength: run.text.length
|
|
13584
|
+
},
|
|
13585
|
+
"agent_run ok"
|
|
13586
|
+
);
|
|
13587
|
+
const body = {
|
|
13588
|
+
runId: run.runId,
|
|
13589
|
+
agentId: run.agentId ?? agentId,
|
|
13590
|
+
agentVersion: run.agentVersion,
|
|
13591
|
+
status: run.status,
|
|
13592
|
+
terminal: run.terminal,
|
|
13593
|
+
reason: run.reason,
|
|
13594
|
+
errorCode: run.errorCode,
|
|
13595
|
+
text: run.text,
|
|
13596
|
+
toolCalls: run.toolCalls,
|
|
13597
|
+
charged: run.charged
|
|
13598
|
+
};
|
|
13599
|
+
if (!run.terminal) {
|
|
13600
|
+
body.note = cancelRequested ? "The call was cancelled and the run was asked to stop. Read it with run_get (needs the `runs:r` scope) to see how it ended." : "The stream ended before the run did" + (run.streamError ? ` (${run.streamError})` : "") + ". The run may still be working: read it with run_get until `terminal` is true (run_get needs the `runs:r` scope).";
|
|
13601
|
+
}
|
|
13602
|
+
return { content: [{ type: "text", text: JSON.stringify(body, null, 2) }] };
|
|
13603
|
+
} catch (err) {
|
|
13604
|
+
const e = err;
|
|
13605
|
+
if (e?.body?.errorCode === "IDEMPOTENCY_IN_PROGRESS") {
|
|
13606
|
+
const runId = (typeof e.body.runId === "string" ? e.body.runId : void 0) ?? e.rawResponse?.headers?.get?.(RUN_ID_HEADER) ?? void 0;
|
|
13607
|
+
if (runId) {
|
|
13608
|
+
const status = typeof e.body.status === "string" ? e.body.status : void 0;
|
|
13609
|
+
log.info({ tool: "agent_run", runId }, "agent_run: the idempotency key already started a run");
|
|
13610
|
+
const body = {
|
|
13611
|
+
runId,
|
|
13612
|
+
agentId,
|
|
13613
|
+
status,
|
|
13614
|
+
// The 409 names the run's status at the time; an ended status is final.
|
|
13615
|
+
terminal: status !== void 0 && ENDED_STATUSES.has(status),
|
|
13616
|
+
alreadyStarted: true,
|
|
13617
|
+
note: "This idempotency key already started this run, so no new run was started. Its answer text is not returned again and cannot be read back: run_get (needs the `runs:r` scope) shows how the run ended and what it was charged, never its text. To start another run, pass a new idempotencyKey."
|
|
13618
|
+
};
|
|
13619
|
+
return { content: [{ type: "text", text: JSON.stringify(body, null, 2) }] };
|
|
13620
|
+
}
|
|
13621
|
+
}
|
|
13622
|
+
log.warn({ tool: "agent_run", agentId, err: String(err) }, "agent_run failed");
|
|
13623
|
+
const result = toolError("agent_run", err);
|
|
13624
|
+
const statusCode = err?.statusCode;
|
|
13625
|
+
if (typeof statusCode !== "number" || statusCode === 408 || statusCode >= 500) {
|
|
13626
|
+
result.content[0].text += `
|
|
13627
|
+
idempotencyKey: ${idempotencyKey}
|
|
13628
|
+
A run may have started before this error. Call agent_run again with the same arguments and this idempotencyKey: if a run started, the call names it; if not, it starts one.` + (cancelRequested ? " (The call was cancelled; a run that started could not be cancelled.)" : "");
|
|
13629
|
+
}
|
|
13630
|
+
return result;
|
|
13631
|
+
} finally {
|
|
13632
|
+
callSignal?.removeEventListener("abort", onCancel);
|
|
13633
|
+
}
|
|
13634
|
+
}
|
|
13635
|
+
});
|
|
13636
|
+
var agent_run_default = agentRun;
|
|
13637
|
+
|
|
13638
|
+
// src/tools/run_get.ts
|
|
13639
|
+
import { z as z26 } from "zod";
|
|
13640
|
+
var inputSchema26 = {
|
|
13641
|
+
runId: z26.string().min(1, "runId must be non-empty").describe("The run id agent_run returned (`runId`).")
|
|
13642
|
+
};
|
|
13643
|
+
var runGet = ({ client, log }) => ({
|
|
13644
|
+
name: "run_get",
|
|
13645
|
+
title: "Get an agent run",
|
|
13646
|
+
description: "Read one agent run by id: `status` (`RUNNING`, `COMPLETED`, `FAILED`, `CANCELLED` or `EXPIRED`), `terminal` (whether it has ended; poll until true), `reason`, `errorCode`, `steps`, its `toolCalls` (each tool and how it ended, never its arguments or result) and `usage` (what it was charged, in milli-cents). It does not return the answer text: agent_run returns that. Use it when agent_run returned `terminal: false`. Needs the `runs:r` scope, which starting a run (`runs:c`) does not include: a credential with only `runs:c` gets `403` here, and learns how its runs end only from agent_run's own result.",
|
|
13647
|
+
inputSchema: inputSchema26,
|
|
13648
|
+
// A pure read: polling a run does not change it.
|
|
13649
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
13650
|
+
handler: async (args) => {
|
|
13651
|
+
const runId = args.runId;
|
|
13652
|
+
try {
|
|
13653
|
+
const run = await client.agents.getRun({ id: runId });
|
|
13654
|
+
log.debug({ tool: "run_get", runId, status: run.status, terminal: run.terminal }, "run_get ok");
|
|
13655
|
+
return { content: [{ type: "text", text: JSON.stringify(run, null, 2) }] };
|
|
13656
|
+
} catch (err) {
|
|
13657
|
+
log.warn({ tool: "run_get", runId, err: String(err) }, "run_get failed");
|
|
13658
|
+
return toolError("run_get", err);
|
|
13659
|
+
}
|
|
13660
|
+
}
|
|
13661
|
+
});
|
|
13662
|
+
var run_get_default = runGet;
|
|
13663
|
+
|
|
12545
13664
|
// src/tools/types.ts
|
|
12546
13665
|
var TOOL_NAMES = [
|
|
12547
13666
|
"hybrid_search",
|
|
@@ -12566,7 +13685,10 @@ var TOOL_NAMES = [
|
|
|
12566
13685
|
"current_identity",
|
|
12567
13686
|
"document_ingest",
|
|
12568
13687
|
"lookup_principal",
|
|
12569
|
-
"version_history"
|
|
13688
|
+
"version_history",
|
|
13689
|
+
"agent_list",
|
|
13690
|
+
"agent_run",
|
|
13691
|
+
"run_get"
|
|
12570
13692
|
];
|
|
12571
13693
|
|
|
12572
13694
|
// src/tools/index.ts
|
|
@@ -12593,7 +13715,10 @@ var ALL_TOOL_FACTORIES = {
|
|
|
12593
13715
|
current_identity: current_identity_default,
|
|
12594
13716
|
document_ingest: document_ingest_default,
|
|
12595
13717
|
lookup_principal: lookup_principal_default,
|
|
12596
|
-
version_history: version_history_default
|
|
13718
|
+
version_history: version_history_default,
|
|
13719
|
+
agent_list: agent_list_default,
|
|
13720
|
+
agent_run: agent_run_default,
|
|
13721
|
+
run_get: run_get_default
|
|
12597
13722
|
};
|
|
12598
13723
|
|
|
12599
13724
|
// src/resources/schemas.ts
|
|
@@ -12617,7 +13742,7 @@ var identityResource = ({ log, apiKey, environment }) => ({
|
|
|
12617
13742
|
name: "identity",
|
|
12618
13743
|
uri: "vectros://identity",
|
|
12619
13744
|
title: "Current identity (tenant + principal scope)",
|
|
12620
|
-
description: "The tenant + principal scope the MCP server is authenticated as. Returns the same payload as the `current_identity` tool: status, tenantId, environment, principalType, principalKeyId, principalLabel, (for scoped credentials) allowedActions + dataScope ({ userId, scopes[] }). Note: this does not
|
|
13745
|
+
description: "The tenant + principal scope the MCP server is authenticated as. Returns the same payload as the `current_identity` tool: status, tenantId, environment, principalType, principalKeyId, principalLabel, (for scoped credentials) allowedActions + dataScope ({ userId, scopes[] }). Note: this does not include granted_capabilities (member-lifecycle / forensic-read / context-directory-read / delegate-mint, as of API 0.40.0, joined by delegate-principal-stamp in 0.42.0 and trigger-control-plane-grant in 0.44.0) \u2014 a separate reach dimension a scope clause can carry that /v1/ping does not report, so allowedActions+dataScope may understate a credential's true reach. Also reports mcpServerVersion and sdkVersion (this build's own version and the bundled @vectros-ai/sdk version). The /v1/ping backing call ships the extended shape today; the version fields are always client-derived.",
|
|
12621
13746
|
mimeType: "application/json",
|
|
12622
13747
|
read: async () => {
|
|
12623
13748
|
const identity = await resolveIdentity({ log, apiKey, environment });
|
|
@@ -12636,11 +13761,12 @@ var ALL_RESOURCE_FACTORIES = {
|
|
|
12636
13761
|
};
|
|
12637
13762
|
|
|
12638
13763
|
// src/zod-to-json-schema.ts
|
|
12639
|
-
import { z as
|
|
13764
|
+
import { z as z27 } from "zod";
|
|
12640
13765
|
function zodShapeToJsonSchema(shape) {
|
|
12641
13766
|
const properties = {};
|
|
12642
13767
|
const required = [];
|
|
12643
|
-
for (const [name,
|
|
13768
|
+
for (const [name, entry] of Object.entries(shape)) {
|
|
13769
|
+
const schema = entry;
|
|
12644
13770
|
properties[name] = zodTypeToJsonSchema(schema);
|
|
12645
13771
|
if (!schema.isOptional()) required.push(name);
|
|
12646
13772
|
}
|
|
@@ -12649,43 +13775,45 @@ function zodShapeToJsonSchema(shape) {
|
|
|
12649
13775
|
return out;
|
|
12650
13776
|
}
|
|
12651
13777
|
function zodTypeToJsonSchema(schema) {
|
|
12652
|
-
const
|
|
13778
|
+
const descriptionOf = (s) => s.description;
|
|
13779
|
+
let description = descriptionOf(schema);
|
|
12653
13780
|
let current = schema;
|
|
12654
|
-
while (current instanceof
|
|
13781
|
+
while (current instanceof z27.ZodOptional || current instanceof z27.ZodDefault || current instanceof z27.ZodNullable) {
|
|
12655
13782
|
current = current._def.innerType;
|
|
13783
|
+
description ??= descriptionOf(current);
|
|
12656
13784
|
}
|
|
12657
13785
|
const base = description ? { description } : {};
|
|
12658
|
-
if (current instanceof
|
|
13786
|
+
if (current instanceof z27.ZodString) {
|
|
12659
13787
|
return { ...base, type: "string" };
|
|
12660
13788
|
}
|
|
12661
|
-
if (current instanceof
|
|
13789
|
+
if (current instanceof z27.ZodNumber) {
|
|
12662
13790
|
return { ...base, type: "number" };
|
|
12663
13791
|
}
|
|
12664
|
-
if (current instanceof
|
|
13792
|
+
if (current instanceof z27.ZodBoolean) {
|
|
12665
13793
|
return { ...base, type: "boolean" };
|
|
12666
13794
|
}
|
|
12667
|
-
if (current instanceof
|
|
13795
|
+
if (current instanceof z27.ZodEnum) {
|
|
12668
13796
|
return {
|
|
12669
13797
|
...base,
|
|
12670
13798
|
type: "string",
|
|
12671
13799
|
enum: current.options
|
|
12672
13800
|
};
|
|
12673
13801
|
}
|
|
12674
|
-
if (current instanceof
|
|
13802
|
+
if (current instanceof z27.ZodArray) {
|
|
12675
13803
|
return {
|
|
12676
13804
|
...base,
|
|
12677
13805
|
type: "array",
|
|
12678
13806
|
items: zodTypeToJsonSchema(current.element)
|
|
12679
13807
|
};
|
|
12680
13808
|
}
|
|
12681
|
-
if (current instanceof
|
|
13809
|
+
if (current instanceof z27.ZodObject) {
|
|
12682
13810
|
return {
|
|
12683
13811
|
...base,
|
|
12684
13812
|
...zodShapeToJsonSchema(current.shape)
|
|
12685
13813
|
};
|
|
12686
13814
|
}
|
|
12687
|
-
if (current instanceof
|
|
12688
|
-
const valueType = current.
|
|
13815
|
+
if (current instanceof z27.ZodRecord) {
|
|
13816
|
+
const valueType = current.valueType;
|
|
12689
13817
|
return {
|
|
12690
13818
|
...base,
|
|
12691
13819
|
type: "object",
|
|
@@ -12813,7 +13941,7 @@ var VectrosMCPServer = class {
|
|
|
12813
13941
|
if (!tool) {
|
|
12814
13942
|
result = toolError(req.params.name ?? "unknown", new Error("No such tool."));
|
|
12815
13943
|
} else {
|
|
12816
|
-
const parsed =
|
|
13944
|
+
const parsed = z28.object(tool.inputSchema).strict().safeParse(req.params.arguments ?? {});
|
|
12817
13945
|
if (!parsed.success) {
|
|
12818
13946
|
result = toolError(tool.name, new Error(formatArgError(tool, parsed.error)));
|
|
12819
13947
|
} else {
|
|
@@ -12876,7 +14004,7 @@ var VectrosMCPServer = class {
|
|
|
12876
14004
|
*
|
|
12877
14005
|
* If `validateOnStart` (default true) is enabled, performs a
|
|
12878
14006
|
* GET /v1/ping check BEFORE wiring the transport. On failure,
|
|
12879
|
-
* throws —
|
|
14007
|
+
* throws — your MCP client sees a startup error instead
|
|
12880
14008
|
* of a confusing "tools work but the first call 401s" experience.
|
|
12881
14009
|
*/
|
|
12882
14010
|
async connect(transport) {
|