@vectros-ai/mcp-server 0.17.1 → 0.18.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 +37 -0
- package/README.md +37 -20
- package/dist/cli-http.js +275 -168
- package/dist/cli-http.js.map +1 -1
- package/dist/cli-http.mjs +275 -168
- package/dist/cli-http.mjs.map +1 -1
- package/dist/cli.js +275 -168
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +275 -168
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +275 -168
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +275 -168
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/cli-http.js
CHANGED
|
@@ -46,6 +46,7 @@ __export(api_exports, {
|
|
|
46
46
|
ContentTooLargeError: () => ContentTooLargeError,
|
|
47
47
|
DocumentContextEvent: () => DocumentContextEvent,
|
|
48
48
|
DocumentLookupRequest: () => DocumentLookupRequest,
|
|
49
|
+
DocumentPatchRequest: () => DocumentPatchRequest,
|
|
49
50
|
DocumentRequest: () => DocumentRequest,
|
|
50
51
|
DocumentResponse: () => DocumentResponse,
|
|
51
52
|
DoneEvent: () => DoneEvent,
|
|
@@ -389,6 +390,13 @@ var DocumentLookupRequest;
|
|
|
389
390
|
Desc: "desc"
|
|
390
391
|
};
|
|
391
392
|
})(DocumentLookupRequest || (DocumentLookupRequest = {}));
|
|
393
|
+
var DocumentPatchRequest;
|
|
394
|
+
((DocumentPatchRequest2) => {
|
|
395
|
+
DocumentPatchRequest2.Status = {
|
|
396
|
+
Active: "ACTIVE",
|
|
397
|
+
Archived: "ARCHIVED"
|
|
398
|
+
};
|
|
399
|
+
})(DocumentPatchRequest || (DocumentPatchRequest = {}));
|
|
392
400
|
var FileUploadRequest;
|
|
393
401
|
((FileUploadRequest2) => {
|
|
394
402
|
FileUploadRequest2.IndexMode = {
|
|
@@ -401,6 +409,7 @@ var FileUploadRequest;
|
|
|
401
409
|
var documents_exports = {};
|
|
402
410
|
__export(documents_exports, {
|
|
403
411
|
DocumentLookupRequest: () => DocumentLookupRequest,
|
|
412
|
+
DocumentPatchRequest: () => DocumentPatchRequest,
|
|
404
413
|
FileUploadRequest: () => FileUploadRequest,
|
|
405
414
|
LookupDocumentsRequestOrder: () => LookupDocumentsRequestOrder
|
|
406
415
|
});
|
|
@@ -3065,6 +3074,7 @@ var AuthClient = class {
|
|
|
3065
3074
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3066
3075
|
*
|
|
3067
3076
|
* @throws {@link Vectros.BadRequestError}
|
|
3077
|
+
* @throws {@link Vectros.PaymentRequiredError}
|
|
3068
3078
|
* @throws {@link Vectros.ForbiddenError}
|
|
3069
3079
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
3070
3080
|
*
|
|
@@ -3114,6 +3124,8 @@ var AuthClient = class {
|
|
|
3114
3124
|
switch (_response.error.statusCode) {
|
|
3115
3125
|
case 400:
|
|
3116
3126
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
3127
|
+
case 402:
|
|
3128
|
+
throw new PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
3117
3129
|
case 403:
|
|
3118
3130
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3119
3131
|
case 429:
|
|
@@ -3546,7 +3558,7 @@ var AuthClient = class {
|
|
|
3546
3558
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/app-contexts/{contextId}");
|
|
3547
3559
|
}
|
|
3548
3560
|
/**
|
|
3549
|
-
* Updates
|
|
3561
|
+
* 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 a partner with the corresponding account-level 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.
|
|
3550
3562
|
*
|
|
3551
3563
|
* @param {Vectros.UpdateAppContextRequest} request
|
|
3552
3564
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4149,7 +4161,7 @@ var AuthClient = class {
|
|
|
4149
4161
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers/{issuerId}");
|
|
4150
4162
|
}
|
|
4151
4163
|
/**
|
|
4152
|
-
* Updates the mutable fields of a registered issuer: `subClaim`, `emailClaim`, `userinfoUri`, `capturedClaims`, `restrictedToDomain` (a new non-blank value must already be a VERIFIED domain for your account; an empty string clears it back to domain-less; see `IssuerUpdateRequest.restrictedToDomain` for the full semantics), `status` (`active`/`suspended` — a suspended issuer's tokens are rejected identically to an unregistered issuer at exchange time), and `selfSignupPolicies`. Fields omitted from the body are left unchanged (partial update). `issuer`, `jwksUri`, `audience`, and `contextId` are trust-anchor / routing-pin fields and are immutable via this route — supplying a value that differs from the current registration is rejected with 400; supplying the current value back is a no-op. Rotating a trust anchor requires deleting and re-registering the issuer, which is itself refused while any user is bound through it. **`subClaim` is identity-determining, not merely cosmetic**: it names which verified JWT claim is read as the federated user's identifier, so changing it on an issuer that already has bound users would silently re-identify (or, under self-signup, orphan) every one of them — changing it is therefore refused once any user has bound through this issuer, the same guard `DELETE` already applies, and is only free before the first real login. Requires a root API key or the bootstrap's provisioning capability, gated identically to every other operation on this surface. A credential confined to one app context may only update an issuer registered in that context; naming one registered in another context returns 404, identically to a nonexistent issuerId. A root API key may update any issuer.
|
|
4164
|
+
* Updates the mutable fields of a registered issuer: `subClaim`, `emailClaim`, `userinfoUri`, `capturedClaims`, `restrictedToDomain` (a new non-blank value must already be a VERIFIED domain for your account; an empty string clears it back to domain-less; see `IssuerUpdateRequest.restrictedToDomain` for the full semantics), `status` (`active`/`suspended` — a registration awaiting verification (`pending_verification`) accepts no status change until it is verified; a suspended issuer's tokens are rejected identically to an unregistered issuer at exchange time), and `selfSignupPolicies`. Fields omitted from the body are left unchanged (partial update). `issuer`, `jwksUri`, `audience`, and `contextId` are trust-anchor / routing-pin fields and are immutable via this route — supplying a value that differs from the current registration is rejected with 400; supplying the current value back is a no-op. Rotating a trust anchor requires deleting and re-registering the issuer, which is itself refused while any user is bound through it. **`subClaim` is identity-determining, not merely cosmetic**: it names which verified JWT claim is read as the federated user's identifier, so changing it on an issuer that already has bound users would silently re-identify (or, under self-signup, orphan) every one of them — changing it is therefore refused once any user has bound through this issuer, the same guard `DELETE` already applies, and is only free before the first real login. Requires a root API key or the bootstrap's provisioning capability, gated identically to every other operation on this surface. A credential confined to one app context may only update an issuer registered in that context; naming one registered in another context returns 404, identically to a nonexistent issuerId. A root API key may update any issuer.
|
|
4153
4165
|
*
|
|
4154
4166
|
* @param {Vectros.IssuerUpdateRequest} request
|
|
4155
4167
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4342,7 +4354,7 @@ var AuthClient = class {
|
|
|
4342
4354
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers");
|
|
4343
4355
|
}
|
|
4344
4356
|
/**
|
|
4345
|
-
* 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 partner-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.
|
|
4357
|
+
* 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 partner-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 today, 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.
|
|
4346
4358
|
*
|
|
4347
4359
|
* @param {Vectros.IssuerRequest} request
|
|
4348
4360
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4408,6 +4420,82 @@ var AuthClient = class {
|
|
|
4408
4420
|
}
|
|
4409
4421
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/auth/issuers");
|
|
4410
4422
|
}
|
|
4423
|
+
/**
|
|
4424
|
+
* Proves you administer the IdP application a `pending_verification` registration names, activating it. A registration created without `restrictedToDomain` accepts no tokens until this succeeds. Configure your IdP, with an admin-controlled rule (an Auth0 Action, an Okta inline hook, an Entra claims-mapping policy, a Keycloak protocol mapper), to add the registration's `verificationClaim` to the tokens it issues, set to its `verificationNonce`; sign in once; and send that token here. The `jwksUri` you registered must be exactly the `jwks_uri` your issuer's OpenID Connect discovery document (`<issuer>/.well-known/openid-configuration`) publishes, and the token must verify against that key set — an issuer that publishes no discovery document cannot be verified this way. The token is checked and discarded; it is never stored. The `(issuer, audience)` pair is claimed at this moment, so a pair another registration already holds is refused with 400. A challenge expires 7 days after registration; an expired registration cannot be verified — delete it and register again. Requires a root API key or the bootstrap's provisioning capability, gated identically to every other operation on this surface. A credential confined to one app context may only verify an issuer registered in that context; naming one registered in another context returns 404, identically to a nonexistent issuerId.
|
|
4425
|
+
*
|
|
4426
|
+
* @param {Vectros.IssuerVerifyRequest} request
|
|
4427
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4428
|
+
*
|
|
4429
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4430
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4431
|
+
* @throws {@link Vectros.NotFoundError}
|
|
4432
|
+
* @throws {@link Vectros.ConflictError}
|
|
4433
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4434
|
+
*
|
|
4435
|
+
* @example
|
|
4436
|
+
* await client.auth.verifyIssuer({
|
|
4437
|
+
* issuerId: "auth0-prod",
|
|
4438
|
+
* token: "token"
|
|
4439
|
+
* })
|
|
4440
|
+
*/
|
|
4441
|
+
verifyIssuer(request, requestOptions) {
|
|
4442
|
+
return HttpResponsePromise.fromPromise(this.__verifyIssuer(request, requestOptions));
|
|
4443
|
+
}
|
|
4444
|
+
async __verifyIssuer(request, requestOptions) {
|
|
4445
|
+
const { issuerId, ..._body } = request;
|
|
4446
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4447
|
+
const _headers = mergeHeaders(
|
|
4448
|
+
_authRequest.headers,
|
|
4449
|
+
this._options?.headers,
|
|
4450
|
+
requestOptions?.headers
|
|
4451
|
+
);
|
|
4452
|
+
const _response = await fetcher({
|
|
4453
|
+
url: url_exports.join(
|
|
4454
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4455
|
+
`v1/auth/issuers/${url_exports.encodePathParam(issuerId)}/verify`
|
|
4456
|
+
),
|
|
4457
|
+
method: "POST",
|
|
4458
|
+
headers: _headers,
|
|
4459
|
+
contentType: "application/json",
|
|
4460
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4461
|
+
requestType: "json",
|
|
4462
|
+
body: _body,
|
|
4463
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4464
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4465
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4466
|
+
fetchFn: this._options?.fetch,
|
|
4467
|
+
logging: this._options.logging
|
|
4468
|
+
});
|
|
4469
|
+
if (_response.ok) {
|
|
4470
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4471
|
+
}
|
|
4472
|
+
if (_response.error.reason === "status-code") {
|
|
4473
|
+
switch (_response.error.statusCode) {
|
|
4474
|
+
case 400:
|
|
4475
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4476
|
+
case 403:
|
|
4477
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4478
|
+
case 404:
|
|
4479
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4480
|
+
case 409:
|
|
4481
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4482
|
+
case 429:
|
|
4483
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4484
|
+
default:
|
|
4485
|
+
throw new VectrosError({
|
|
4486
|
+
statusCode: _response.error.statusCode,
|
|
4487
|
+
body: _response.error.body,
|
|
4488
|
+
rawResponse: _response.rawResponse
|
|
4489
|
+
});
|
|
4490
|
+
}
|
|
4491
|
+
}
|
|
4492
|
+
return handleNonStatusCodeError(
|
|
4493
|
+
_response.error,
|
|
4494
|
+
_response.rawResponse,
|
|
4495
|
+
"POST",
|
|
4496
|
+
"/v1/auth/issuers/{issuerId}/verify"
|
|
4497
|
+
);
|
|
4498
|
+
}
|
|
4411
4499
|
/**
|
|
4412
4500
|
* Returns the identity bound to your credential — your account, principal type, key id, and scope details — so you can confirm who you are authenticated as and that the credential is valid. MCP clients use this to render "signed in as ..." in a chat UI without a separate identity endpoint.
|
|
4413
4501
|
*
|
|
@@ -4883,7 +4971,7 @@ var ComplianceClient = class {
|
|
|
4883
4971
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
4884
4972
|
}
|
|
4885
4973
|
/**
|
|
4886
|
-
* Submits a right-to-erasure request for a single end-subject (a user, or an identity entity in any namespace). Erasure removes exactly the data the subject solely owns across the declared contexts, plus
|
|
4974
|
+
* Submits a right-to-erasure request for a single end-subject (a user, or an identity entity in any namespace). Erasure removes exactly the data the subject solely owns across the declared contexts, plus its identity and lookup rows when all contexts are covered. It never touches another account's data and never cascades into another subject's data. The request is asynchronous: it returns 202 with a `requestId`; poll `GET /v1/erasure-requests/{id}` until the job completes to obtain the completion certificate. Requires a root API key — a scoped credential is rejected with 403.
|
|
4887
4975
|
*
|
|
4888
4976
|
* @param {Vectros.ErasureRequest} request
|
|
4889
4977
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4946,7 +5034,7 @@ var ComplianceClient = class {
|
|
|
4946
5034
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/erasure-requests");
|
|
4947
5035
|
}
|
|
4948
5036
|
/**
|
|
4949
|
-
* Polls an erasure request by id. While the job is still running this returns its status only; once it completes, the response also includes the verifiable completion certificate (which contexts were swept, per-context deletion counts, and reports of dangling references and shared rows
|
|
5037
|
+
* Polls an erasure request by id. While the job is still running this returns its status only; once it completes, the response also includes the verifiable completion certificate (which contexts were swept, per-context deletion counts, whether the identity was kept, and reports of dangling references and shared rows left intact). Requires a root API key.
|
|
4950
5038
|
*
|
|
4951
5039
|
* @param {Vectros.GetErasureRequestRequest} request
|
|
4952
5040
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5189,7 +5277,7 @@ var DocumentsClient = class {
|
|
|
5189
5277
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents");
|
|
5190
5278
|
}
|
|
5191
5279
|
/**
|
|
5192
|
-
* Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Optionally supply an `externalId` to make the create idempotent — if a document with the same `externalId` already exists in your context, that existing document is returned unchanged instead of a duplicate being created. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing document was returned) tells the two apart. To overwrite an existing document's content instead of returning it unchanged, set `?upsert=true` (this also requires the `documents:u` scope). Requires the `documents:c` scope to create. Being returned the existing document on a collision is a read of that document's data and additionally requires the `documents:r` scope — a credential holding `documents:c` alone receives a `400` ("already exists") on collision instead of the document.
|
|
5280
|
+
* Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Optionally supply an `externalId` to make the create idempotent — if a document with the same `externalId` already exists in your context, that existing document is returned unchanged instead of a duplicate being created. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing document was returned) tells the two apart. To overwrite an existing document's content instead of returning it unchanged, set `?upsert=true` (this also requires the `documents:u` scope). Requires the `documents:c` scope to create. Being returned the existing document on a collision is a read of that document's data and additionally requires the `documents:r` scope — a credential holding `documents:c` alone receives a `400` ("already exists") on collision instead of the document. Supplying `externalId` WITHOUT `schemaId` is refused (`400`) unless you also pass `confirmUntyped=true` — externalId uniqueness is scoped per schema, so omitting `schemaId` by mistake would otherwise silently create a separate untyped document instead of targeting the typed one you likely meant.
|
|
5193
5281
|
*
|
|
5194
5282
|
* @param {Vectros.IngestDocumentRequest} request
|
|
5195
5283
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5209,10 +5297,11 @@ var DocumentsClient = class {
|
|
|
5209
5297
|
return HttpResponsePromise.fromPromise(this.__ingestDocument(request, requestOptions));
|
|
5210
5298
|
}
|
|
5211
5299
|
async __ingestDocument(request, requestOptions) {
|
|
5212
|
-
const { upsert, allowClear, body: _body } = request;
|
|
5300
|
+
const { upsert, allowClear, confirmUntyped, body: _body } = request;
|
|
5213
5301
|
const _queryParams = {
|
|
5214
5302
|
upsert,
|
|
5215
|
-
allowClear
|
|
5303
|
+
allowClear,
|
|
5304
|
+
confirmUntyped
|
|
5216
5305
|
};
|
|
5217
5306
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5218
5307
|
const _headers = mergeHeaders(
|
|
@@ -5447,7 +5536,7 @@ var DocumentsClient = class {
|
|
|
5447
5536
|
/**
|
|
5448
5537
|
* Partially updates a document using an RFC 7386 JSON Merge Patch. The `payload` object is deep-merged: keys you send overwrite existing values (recursing into nested objects), a key set to `null` is deleted, and keys you omit are preserved — unlike PUT, which replaces the whole payload. Top-level fields (`title`, `folderId`, `schemaId`, ownership) are set when present and left unchanged when omitted; sending a top-level field as `null` is rejected. Supplying `text` re-ingests the document body (same as PUT). `indexMode`, `externalId`, and `storeText` (text retention is fixed at ingest) are immutable and rejected if present. The merged result is validated against the bound schema. Pass `expectedVersion` for optimistic concurrency (409 on conflict). Requires the `documents:u` scope.
|
|
5449
5538
|
*
|
|
5450
|
-
* @param {Vectros.
|
|
5539
|
+
* @param {Vectros.DocumentPatchRequest} request
|
|
5451
5540
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5452
5541
|
*
|
|
5453
5542
|
* @throws {@link Vectros.BadRequestError}
|
|
@@ -5458,17 +5547,14 @@ var DocumentsClient = class {
|
|
|
5458
5547
|
*
|
|
5459
5548
|
* @example
|
|
5460
5549
|
* await client.documents.patchDocument({
|
|
5461
|
-
* id: "id"
|
|
5462
|
-
* body: {
|
|
5463
|
-
* title: "Patient Intake Form \u2014 Jane Doe"
|
|
5464
|
-
* }
|
|
5550
|
+
* id: "id"
|
|
5465
5551
|
* })
|
|
5466
5552
|
*/
|
|
5467
5553
|
patchDocument(request, requestOptions) {
|
|
5468
5554
|
return HttpResponsePromise.fromPromise(this.__patchDocument(request, requestOptions));
|
|
5469
5555
|
}
|
|
5470
5556
|
async __patchDocument(request, requestOptions) {
|
|
5471
|
-
const { id,
|
|
5557
|
+
const { id, ..._body } = request;
|
|
5472
5558
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5473
5559
|
const _headers = mergeHeaders(
|
|
5474
5560
|
_authRequest.headers,
|
|
@@ -5840,7 +5926,7 @@ var DocumentsClient = class {
|
|
|
5840
5926
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents/{id}/versions");
|
|
5841
5927
|
}
|
|
5842
5928
|
/**
|
|
5843
|
-
* Starts a file-based document by returning a short-lived presigned S3 PUT URL. Upload the file bytes directly to `uploadUrl`; the document is then automatically queued for text extraction and asynchronous indexing. Supplying an `externalId` makes this idempotent — re-initiating an upload with the same `externalId` re-issues a fresh presigned URL for the SAME existing document, targeting a newly-staged object rather than the document's current one — your PUT lands there first, and the document only adopts it once the upload is validated (so a re-upload inherently replaces the file body) rather than creating a duplicate. The response's `created` field (and the HTTP status — 201 when a new document was minted, 200 when an existing one was matched) tells the two apart. With `?upsert=true`, the submitted `payload`/`title` are also applied to the matched document (file-body divergence cannot be diffed at upload-init — the bytes have not arrived yet — so the re-upload itself replaces the body). Creating a NEW document requires the `documents:c` scope. Re-uploading over an EXISTING document overwrites (and re-indexes) its body, so it is an update: it requires the `documents:u` scope (as does `?upsert=true` for the metadata). **Your PUT to `uploadUrl` MUST include the header named in the response's `requiredHeaderName`, set to `requiredHeaderValue` exactly.** It is a signed part of the presigned request — the PUT never reaches this service either way, so neither failure uses this API's JSON error shape. Omitting it, or sending a different value, invalidates the request's signature and S3 rejects it with a 403 `SignatureDoesNotMatch`. Sending it correctly makes the URL single-use: `requiredHeaderName` is always `If-None-Match` and `requiredHeaderValue` is always `*` — a create, a recovery upload for a document whose earlier file is missing, and a re-upload ALL target a freshly-minted, never-written key, so the same S3 conditional-write precondition applies uniformly (S3's own documented conditional-write behavior): a replay after the object already exists (from your own completed PUT, or anyone else's) fails with `412 Precondition Failed`; a replay after the object was deleted and never re-created finds an absent key again and can succeed — single-use is a property of the object's existence, not a one-time token. **Either precondition can also fail with `409 Conflict` if your PUT genuinely races a concurrent delete on the same object.** Whichever of `412` or `409` you receive, the remedy is the same: call this endpoint again for a fresh URL rather than retrying the same PUT — a fresh call always targets a new key, so it is never subject to whatever raced the previous one.
|
|
5929
|
+
* Starts a file-based document by returning a short-lived presigned S3 PUT URL. Upload the file bytes directly to `uploadUrl`; the document is then automatically queued for text extraction and asynchronous indexing. Supplying an `externalId` makes this idempotent — re-initiating an upload with the same `externalId` re-issues a fresh presigned URL for the SAME existing document, targeting a newly-staged object rather than the document's current one — your PUT lands there first, and the document only adopts it once the upload is validated (so a re-upload inherently replaces the file body) rather than creating a duplicate. The response's `created` field (and the HTTP status — 201 when a new document was minted, 200 when an existing one was matched) tells the two apart. With `?upsert=true`, the submitted `payload`/`title` are also applied to the matched document (file-body divergence cannot be diffed at upload-init — the bytes have not arrived yet — so the re-upload itself replaces the body). Creating a NEW document requires the `documents:c` scope. Re-uploading over an EXISTING document overwrites (and re-indexes) its body, so it is an update: it requires the `documents:u` scope (as does `?upsert=true` for the metadata). **Your PUT to `uploadUrl` MUST include the header named in the response's `requiredHeaderName`, set to `requiredHeaderValue` exactly.** It is a signed part of the presigned request — the PUT never reaches this service either way, so neither failure uses this API's JSON error shape. Omitting it, or sending a different value, invalidates the request's signature and S3 rejects it with a 403 `SignatureDoesNotMatch`. Sending it correctly makes the URL single-use: `requiredHeaderName` is always `If-None-Match` and `requiredHeaderValue` is always `*` — a create, a recovery upload for a document whose earlier file is missing, and a re-upload ALL target a freshly-minted, never-written key, so the same S3 conditional-write precondition applies uniformly (S3's own documented conditional-write behavior): a replay after the object already exists (from your own completed PUT, or anyone else's) fails with `412 Precondition Failed`; a replay after the object was deleted and never re-created finds an absent key again and can succeed — single-use is a property of the object's existence, not a one-time token. **Either precondition can also fail with `409 Conflict` if your PUT genuinely races a concurrent delete on the same object.** Whichever of `412` or `409` you receive, the remedy is the same: call this endpoint again for a fresh URL rather than retrying the same PUT — a fresh call always targets a new key, so it is never subject to whatever raced the previous one. Supplying `externalId` WITHOUT `schemaId` is refused (`400`) unless you also pass `confirmUntyped=true` — externalId uniqueness is scoped per schema, so omitting `schemaId` by mistake would otherwise silently create a separate untyped document instead of targeting the typed one you likely meant.
|
|
5844
5930
|
*
|
|
5845
5931
|
* @param {Vectros.FileUploadRequest} request
|
|
5846
5932
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5859,9 +5945,10 @@ var DocumentsClient = class {
|
|
|
5859
5945
|
return HttpResponsePromise.fromPromise(this.__uploadDocument(request, requestOptions));
|
|
5860
5946
|
}
|
|
5861
5947
|
async __uploadDocument(request, requestOptions) {
|
|
5862
|
-
const { upsert, ..._body } = request;
|
|
5948
|
+
const { upsert, confirmUntyped, ..._body } = request;
|
|
5863
5949
|
const _queryParams = {
|
|
5864
|
-
upsert
|
|
5950
|
+
upsert,
|
|
5951
|
+
confirmUntyped
|
|
5865
5952
|
};
|
|
5866
5953
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5867
5954
|
const _headers = mergeHeaders(
|
|
@@ -10157,7 +10244,7 @@ var logging;
|
|
|
10157
10244
|
|
|
10158
10245
|
// src/server.ts
|
|
10159
10246
|
var import_types3 = require("@modelcontextprotocol/sdk/types.js");
|
|
10160
|
-
var
|
|
10247
|
+
var import_zod25 = require("zod");
|
|
10161
10248
|
|
|
10162
10249
|
// src/auth.ts
|
|
10163
10250
|
var KEY_RE = /^(sk|ssk|st)_(live|test)_/;
|
|
@@ -10201,8 +10288,8 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
10201
10288
|
|
|
10202
10289
|
// src/build-info.ts
|
|
10203
10290
|
var BUILD_INFO = {
|
|
10204
|
-
mcpServer: true ? "0.
|
|
10205
|
-
sdk: true ? "0.
|
|
10291
|
+
mcpServer: true ? "0.18.0" : "dev",
|
|
10292
|
+
sdk: true ? "0.46.0" : "dev"
|
|
10206
10293
|
};
|
|
10207
10294
|
|
|
10208
10295
|
// src/log.ts
|
|
@@ -10494,7 +10581,7 @@ var inputSchema = {
|
|
|
10494
10581
|
"Keyword-match precision for the BM25 leg (TEXT/HYBRID modes). OR = any term (broad recall), AND = all terms (higher precision), PHRASE = contiguous phrase. Default: PHRASE (slop 3) in HYBRID, OR in TEXT. (The advanced raw-query COMPLEX mode is intentionally not exposed here.)"
|
|
10495
10582
|
),
|
|
10496
10583
|
limit: import_zod.z.number().int().min(1).max(MCP_MAX_LIMIT).optional().describe(
|
|
10497
|
-
`Max hits per page. Defaults to a low ${MCP_DEFAULT_LIMIT} to protect the agent context window; raise up to ${MCP_MAX_LIMIT} (
|
|
10584
|
+
`Max hits per page. Defaults to a low ${MCP_DEFAULT_LIMIT} to protect the agent context window; raise up to ${MCP_MAX_LIMIT} (this tool's ceiling) in one call when you can accept the larger result, or page with \`offset\` instead.`
|
|
10498
10585
|
),
|
|
10499
10586
|
offset: import_zod.z.number().int().min(0).max(200).optional().describe("Skip the first N hits \u2014 for pagination (0\u2013200)."),
|
|
10500
10587
|
folderId: import_zod.z.string().optional().describe("Scope to content in this EXACT folder (Vectros folder id)."),
|
|
@@ -11243,52 +11330,61 @@ var recordDelete = ({ client, log }) => ({
|
|
|
11243
11330
|
var record_delete_default = recordDelete;
|
|
11244
11331
|
|
|
11245
11332
|
// src/tools/rag_ask.ts
|
|
11333
|
+
var import_zod10 = require("zod");
|
|
11334
|
+
|
|
11335
|
+
// src/tools/provider-alias.ts
|
|
11246
11336
|
var import_zod9 = require("zod");
|
|
11337
|
+
var providerAliasInput = import_zod9.z.string().min(1, "providerAlias must be non-empty when supplied").optional().describe(
|
|
11338
|
+
"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. A call served by your own provider leaves the platform-hosted Bedrock path, and Vectros's AWS BAA boundary. 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."
|
|
11339
|
+
);
|
|
11340
|
+
|
|
11341
|
+
// src/tools/rag_ask.ts
|
|
11247
11342
|
var SEARCH_MCP_DEFAULT_LIMIT = 5;
|
|
11248
11343
|
var SEARCH_MCP_MAX_LIMIT = 50;
|
|
11249
11344
|
var inputSchema9 = {
|
|
11250
|
-
query:
|
|
11251
|
-
instructions:
|
|
11345
|
+
query: import_zod10.z.string().min(1, "query must be non-empty").describe("Question to ground against retrieved content."),
|
|
11346
|
+
instructions: import_zod10.z.string().optional().describe(
|
|
11252
11347
|
'System prompt that overrides the default for the generation step \u2014 e.g. "answer only from the provided context, cite sources, be concise". Default: a generic answer-from-context instruction.'
|
|
11253
11348
|
),
|
|
11254
|
-
model:
|
|
11255
|
-
"Inference model alias (e.g. claude-haiku-4-5, claude-sonnet-5, claude-opus-
|
|
11349
|
+
model: import_zod10.z.string().optional().describe(
|
|
11350
|
+
"Inference model alias (e.g. claude-haiku-4-5, claude-sonnet-5, claude-opus-5-5). Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach. When `providerAlias` is set, this instead names the model on that provider's own id space."
|
|
11256
11351
|
),
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11352
|
+
providerAlias: providerAliasInput,
|
|
11353
|
+
search: import_zod10.z.object({
|
|
11354
|
+
mode: import_zod10.z.enum(["HYBRID", "TEXT", "SEMANTIC"]).optional().describe("Retrieval mode. Default HYBRID."),
|
|
11355
|
+
limit: import_zod10.z.number().int().min(1).max(SEARCH_MCP_MAX_LIMIT).optional().describe(
|
|
11356
|
+
`Passages to retrieve before generating (the grounding-corpus size). Default ${SEARCH_MCP_DEFAULT_LIMIT}; raise up to ${SEARCH_MCP_MAX_LIMIT} (this tool's ceiling) for a broader corpus when the extra grounding is worth the larger prompt.`
|
|
11261
11357
|
),
|
|
11262
11358
|
// Retrieval scoping — parity with hybrid_search so an agent can ground the
|
|
11263
11359
|
// answer on a specific owner / folder / type / metadata subset, not just the
|
|
11264
11360
|
// whole-tenant corpus.
|
|
11265
|
-
userId:
|
|
11266
|
-
scope:
|
|
11361
|
+
userId: import_zod10.z.string().optional().describe("Restrict retrieval to content owned by this user (Vectros UUID)."),
|
|
11362
|
+
scope: import_zod10.z.string().optional().describe(
|
|
11267
11363
|
'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.'
|
|
11268
11364
|
),
|
|
11269
|
-
scopeFilters:
|
|
11365
|
+
scopeFilters: import_zod10.z.array(import_zod10.z.string()).min(1, "scopeFilters must name at least one dimension when supplied").optional().describe(
|
|
11270
11366
|
'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`.'
|
|
11271
11367
|
),
|
|
11272
|
-
folderId:
|
|
11273
|
-
rootFolderId:
|
|
11274
|
-
typeName:
|
|
11275
|
-
contentTypes:
|
|
11276
|
-
filters:
|
|
11368
|
+
folderId: import_zod10.z.string().optional().describe("Restrict retrieval to this exact folder."),
|
|
11369
|
+
rootFolderId: import_zod10.z.string().optional().describe("Restrict retrieval to this folder and all its descendants."),
|
|
11370
|
+
typeName: import_zod10.z.string().optional().describe("Restrict record retrieval to this schema type."),
|
|
11371
|
+
contentTypes: import_zod10.z.array(import_zod10.z.enum(["documents", "records"])).optional().describe('Narrow retrieval to content types. ["documents"] or ["records"]; omit for both.'),
|
|
11372
|
+
filters: import_zod10.z.record(import_zod10.z.unknown()).optional().describe(
|
|
11277
11373
|
'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"}.'
|
|
11278
11374
|
),
|
|
11279
|
-
createdAfter:
|
|
11375
|
+
createdAfter: import_zod10.z.string().optional().describe(
|
|
11280
11376
|
"Restrict retrieval to content CREATED at/after this ISO 8601 UTC timestamp \u2014 the item's own creation time, which does not move when it is re-indexed. An item matched on its FIRST index may be checked against its index time instead, a bounded clock-skew allowance."
|
|
11281
11377
|
),
|
|
11282
|
-
createdBefore:
|
|
11283
|
-
requireComplete:
|
|
11378
|
+
createdBefore: import_zod10.z.string().optional().describe("Same creation-time basis as createdAfter, bounding at/before this ISO 8601 UTC value."),
|
|
11379
|
+
requireComplete: import_zod10.z.boolean().optional().describe("Fail closed (503) on a degraded search backend instead of grounding on partial results. Default false.")
|
|
11284
11380
|
}).optional().describe("Retrieval params + scoping. Default mode HYBRID, limit " + SEARCH_MCP_DEFAULT_LIMIT + "."),
|
|
11285
|
-
maxTokens:
|
|
11286
|
-
temperature:
|
|
11381
|
+
maxTokens: import_zod10.z.number().int().min(1).optional().describe("Max output tokens."),
|
|
11382
|
+
temperature: import_zod10.z.number().min(0).max(1).optional().describe("Sampling temperature (0.0\u20131.0). Default 0.3 \u2014 lower favors deterministic, retrieval-grounded answers.")
|
|
11287
11383
|
};
|
|
11288
11384
|
var ragAsk = ({ client, log }) => ({
|
|
11289
11385
|
name: "rag_ask",
|
|
11290
11386
|
title: "RAG ask (corpus-wide)",
|
|
11291
|
-
description: "Ask a question grounded against your tenant's indexed content. Vectros performs a hybrid search, injects the top-K passages into the prompt, and streams a model answer back. Scope retrieval with `search` (ownership \u2014 `scope` for one ownership dimension or `scopeFilters` for several at once, e.g. one client within one org \u2014 folder, type, metadata filters, date window) to ground on a subset \u2014 e.g. one patient or one folder \u2014 and steer generation with `instructions` / `temperature`. The full answer is returned as a single response; progress notifications keep the call alive during the 30-45s generation window.
|
|
11387
|
+
description: "Ask a question grounded against your tenant's indexed content. Vectros performs a hybrid search, injects the top-K passages into the prompt, and streams a model answer back. Scope retrieval with `search` (ownership \u2014 `scope` for one ownership dimension or `scopeFilters` for several at once, e.g. one client within one org \u2014 folder, type, metadata filters, date window) to ground on a subset \u2014 e.g. one patient or one folder \u2014 and steer generation with `instructions` / `temperature`. The full answer is returned as a single response; progress notifications keep the call alive during the 30-45s generation window. Calls without `providerAlias` are served by platform-hosted AWS Bedrock. A call that sets `providerAlias` goes to your own model provider, outside Vectros's AWS BAA boundary.",
|
|
11292
11388
|
inputSchema: inputSchema9,
|
|
11293
11389
|
// NOT a pure read: this call reserves an atomic hold against the caller's prepaid inference
|
|
11294
11390
|
// balance before generation starts, then debits it on completion — a real financial side
|
|
@@ -11330,6 +11426,7 @@ var ragAsk = ({ client, log }) => ({
|
|
|
11330
11426
|
query: args.query,
|
|
11331
11427
|
instructions: args.instructions,
|
|
11332
11428
|
model: args.model,
|
|
11429
|
+
providerAlias: args.providerAlias,
|
|
11333
11430
|
search,
|
|
11334
11431
|
maxTokens: args.maxTokens,
|
|
11335
11432
|
temperature: args.temperature
|
|
@@ -11384,19 +11481,20 @@ var ragAsk = ({ client, log }) => ({
|
|
|
11384
11481
|
var rag_ask_default = ragAsk;
|
|
11385
11482
|
|
|
11386
11483
|
// src/tools/document_ask.ts
|
|
11387
|
-
var
|
|
11484
|
+
var import_zod11 = require("zod");
|
|
11388
11485
|
var inputSchema10 = {
|
|
11389
|
-
documentId:
|
|
11390
|
-
prompt:
|
|
11391
|
-
model:
|
|
11392
|
-
"Inference model alias. Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach."
|
|
11486
|
+
documentId: import_zod11.z.string().min(1, "documentId is required").describe("ID of the document to ask against."),
|
|
11487
|
+
prompt: import_zod11.z.string().min(1, "prompt is required").describe("Question to ask about the document."),
|
|
11488
|
+
model: import_zod11.z.string().optional().describe(
|
|
11489
|
+
"Inference model alias. Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach. When `providerAlias` is set, this instead names the model on that provider's own id space."
|
|
11393
11490
|
),
|
|
11394
|
-
|
|
11491
|
+
providerAlias: providerAliasInput,
|
|
11492
|
+
maxTokens: import_zod11.z.number().int().min(1).optional().describe("Max output tokens.")
|
|
11395
11493
|
};
|
|
11396
11494
|
var documentAsk = ({ client, log }) => ({
|
|
11397
11495
|
name: "document_ask",
|
|
11398
11496
|
title: "Document ask (single-document)",
|
|
11399
|
-
description: "Ask a question against a single indexed document. Returns a grounded answer with the document context that informed it. For documents exceeding the input-token cap, the API returns a structured 413 with `estimatedTokens` and `limitTokens`.
|
|
11497
|
+
description: "Ask a question against a single indexed document. Returns a grounded answer with the document context that informed it. For documents exceeding the input-token cap, the API returns a structured 413 with `estimatedTokens` and `limitTokens`. Calls without `providerAlias` are served by platform-hosted AWS Bedrock. A call that sets `providerAlias` goes to your own model provider, outside Vectros's AWS BAA boundary.",
|
|
11400
11498
|
inputSchema: inputSchema10,
|
|
11401
11499
|
// NOT a pure read: this call reserves an atomic hold against the caller's prepaid inference
|
|
11402
11500
|
// balance before generation starts, then debits it on completion — a real financial side
|
|
@@ -11413,6 +11511,7 @@ var documentAsk = ({ client, log }) => ({
|
|
|
11413
11511
|
id: args.documentId,
|
|
11414
11512
|
prompt: args.prompt,
|
|
11415
11513
|
model: args.model,
|
|
11514
|
+
providerAlias: args.providerAlias,
|
|
11416
11515
|
maxTokens: args.maxTokens
|
|
11417
11516
|
});
|
|
11418
11517
|
const progressToken = extra._meta?.progressToken;
|
|
@@ -11465,18 +11564,18 @@ var documentAsk = ({ client, log }) => ({
|
|
|
11465
11564
|
var document_ask_default = documentAsk;
|
|
11466
11565
|
|
|
11467
11566
|
// src/tools/list_schemas.ts
|
|
11468
|
-
var
|
|
11567
|
+
var import_zod12 = require("zod");
|
|
11469
11568
|
var inputSchema11 = {
|
|
11470
|
-
userId:
|
|
11569
|
+
userId: import_zod12.z.string().optional().describe(
|
|
11471
11570
|
"Filter to schemas visible to a specific user. Optional; default returns all schemas the credential can see."
|
|
11472
11571
|
),
|
|
11473
|
-
scope:
|
|
11572
|
+
scope: import_zod12.z.string().optional().describe(
|
|
11474
11573
|
'Filter to schemas carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "group:eng-team"). `org` and `client` are reserved namespace names, registered like any other. Optional; default returns all schemas the credential can see.'
|
|
11475
11574
|
),
|
|
11476
|
-
surface:
|
|
11575
|
+
surface: import_zod12.z.enum(["record", "document", "user", "entity"]).optional().describe(
|
|
11477
11576
|
"Filter to schemas bindable to this surface \u2014 e.g. `document` to list only document types, or `record` for record types. Identity entities in any namespace (org/client/one you registered) bind under the single `entity` surface; `user` and `entity` are account-wide. Optional."
|
|
11478
11577
|
),
|
|
11479
|
-
recordType:
|
|
11578
|
+
recordType: import_zod12.z.string().optional().describe(
|
|
11480
11579
|
'Resolve the single schema for this record type (its natural handle, e.g. "patient") instead of listing \u2014 returns a one-element result, or empty if none. Combine with `surface=user|entity` for an identity schema. Takes precedence over userId. Optional.'
|
|
11481
11580
|
)
|
|
11482
11581
|
};
|
|
@@ -11512,19 +11611,19 @@ var listSchemas = ({ client, log }) => ({
|
|
|
11512
11611
|
var list_schemas_default = listSchemas;
|
|
11513
11612
|
|
|
11514
11613
|
// src/tools/document_get.ts
|
|
11515
|
-
var
|
|
11614
|
+
var import_zod13 = require("zod");
|
|
11516
11615
|
var MAX_TEXT_CHARS = 32e3;
|
|
11517
11616
|
var inputSchema12 = {
|
|
11518
|
-
documentId:
|
|
11519
|
-
externalId:
|
|
11617
|
+
documentId: import_zod13.z.string().optional().describe("The document ID returned by document_ingest or hybrid_search. Provide this OR externalId+type."),
|
|
11618
|
+
externalId: import_zod13.z.string().optional().describe(
|
|
11520
11619
|
"Your caller-owned externalId \u2014 an alternative selector to `documentId` (requires `type`). Fetches the document you ingested under that externalId without a manual lookup first."
|
|
11521
11620
|
),
|
|
11522
|
-
type:
|
|
11523
|
-
includeText:
|
|
11621
|
+
type: import_zod13.z.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
11622
|
+
includeText: import_zod13.z.boolean().optional().describe(
|
|
11524
11623
|
"If true, fetch and include the document text (capped at ~8K tokens, truncated: true flag if cut). Default false \u2014 metadata only. For larger documents, prefer `document_ask` over dumping text into context."
|
|
11525
11624
|
),
|
|
11526
|
-
includeDownloadUrl:
|
|
11527
|
-
"If true, also return a short-lived presigned `downloadUrl` for the original file (file-backed documents only \u2014 the way to retrieve the raw bytes of a document ingested via file mode). Default false. Unavailable for text-only documents \u2014 `downloadAvailable: false` is set instead."
|
|
11625
|
+
includeDownloadUrl: import_zod13.z.boolean().optional().describe(
|
|
11626
|
+
"If true, also return a short-lived presigned `downloadUrl` for the original file (file-backed documents only \u2014 the way to retrieve the raw bytes of a document ingested via file mode). Default false. Unavailable for text-only documents \u2014 `downloadAvailable: false` is set instead. `downloadExpires` is an upper bound, not a guarantee: if the file behind this document is replaced (a document_ingest upsert) after this URL is minted, the URL can stop working before that time. Request a fresh one after any re-ingest rather than reusing one you already hold."
|
|
11528
11627
|
)
|
|
11529
11628
|
};
|
|
11530
11629
|
function truncateText(text) {
|
|
@@ -11607,28 +11706,28 @@ var documentGet = ({ client, log }) => ({
|
|
|
11607
11706
|
var document_get_default = documentGet;
|
|
11608
11707
|
|
|
11609
11708
|
// src/tools/document_query.ts
|
|
11610
|
-
var
|
|
11709
|
+
var import_zod14 = require("zod");
|
|
11611
11710
|
var MCP_DEFAULT_LIMIT3 = 3;
|
|
11612
11711
|
var MCP_MAX_LIMIT3 = 100;
|
|
11613
11712
|
var inputSchema13 = {
|
|
11614
11713
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
11615
|
-
field:
|
|
11616
|
-
value:
|
|
11617
|
-
from:
|
|
11618
|
-
to:
|
|
11619
|
-
prefix:
|
|
11620
|
-
order:
|
|
11714
|
+
field: import_zod14.z.string().optional().describe("Lookup mode: name of the lookup-indexed field to query by."),
|
|
11715
|
+
value: import_zod14.z.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields too."),
|
|
11716
|
+
from: import_zod14.z.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Range-enabled, non-sensitive fields only."),
|
|
11717
|
+
to: import_zod14.z.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
11718
|
+
prefix: import_zod14.z.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
11719
|
+
order: import_zod14.z.enum(["asc", "desc"]).optional().describe(
|
|
11621
11720
|
"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). Ignored in list mode."
|
|
11622
11721
|
),
|
|
11623
|
-
type:
|
|
11722
|
+
type: import_zod14.z.string().optional().describe("Lookup mode: the document type (the bound schema's type). Required with `field`."),
|
|
11624
11723
|
// List-mode args:
|
|
11625
|
-
folderId:
|
|
11626
|
-
userId:
|
|
11627
|
-
scope:
|
|
11724
|
+
folderId: import_zod14.z.string().optional().describe("List mode: only documents in this folder (Vectros folder id)."),
|
|
11725
|
+
userId: import_zod14.z.string().optional().describe("List mode: scope to documents owned by this user."),
|
|
11726
|
+
scope: import_zod14.z.string().optional().describe(
|
|
11628
11727
|
'List mode: filter to documents 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.'
|
|
11629
11728
|
),
|
|
11630
|
-
startFrom:
|
|
11631
|
-
limit:
|
|
11729
|
+
startFrom: import_zod14.z.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next. Works in both list and lookup mode."),
|
|
11730
|
+
limit: import_zod14.z.number().int().min(1).max(MCP_MAX_LIMIT3).optional().describe(
|
|
11632
11731
|
`Max documents per page. Defaults to a low ${MCP_DEFAULT_LIMIT3} to protect the agent context window; raise up to ${MCP_MAX_LIMIT3} (the documents API max) in one call when you can accept the larger payload, or page with \`startFrom\` instead.`
|
|
11633
11732
|
)
|
|
11634
11733
|
};
|
|
@@ -11718,29 +11817,29 @@ var documentQuery = ({ client, log }) => ({
|
|
|
11718
11817
|
var document_query_default = documentQuery;
|
|
11719
11818
|
|
|
11720
11819
|
// src/tools/document_update.ts
|
|
11721
|
-
var
|
|
11820
|
+
var import_zod15 = require("zod");
|
|
11722
11821
|
var inputSchema14 = {
|
|
11723
|
-
documentId:
|
|
11724
|
-
externalId:
|
|
11822
|
+
documentId: import_zod15.z.string().optional().describe("The Vectros document id to update. Provide this OR externalId+type."),
|
|
11823
|
+
externalId: import_zod15.z.string().optional().describe(
|
|
11725
11824
|
"Your caller-owned externalId \u2014 an alternative selector to `documentId` (requires `type`). Updates the document you ingested under that externalId without a manual lookup first."
|
|
11726
11825
|
),
|
|
11727
|
-
type:
|
|
11728
|
-
title:
|
|
11729
|
-
fields:
|
|
11826
|
+
type: import_zod15.z.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
11827
|
+
title: import_zod15.z.string().optional().describe("New title. Omit to keep the current title."),
|
|
11828
|
+
fields: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.unknown()).optional().describe(
|
|
11730
11829
|
"Typed-payload field\u2192value changes DEEP-MERGED into the existing payload (a field set to `null` is deleted; unspecified fields preserved). Omit to leave the payload unchanged."
|
|
11731
11830
|
),
|
|
11732
|
-
text:
|
|
11831
|
+
text: import_zod15.z.string().optional().describe(
|
|
11733
11832
|
"New raw text body. Supplying it re-ingests the document body and re-queues it for indexing, so the search index reflects the edit (text-ingested documents only \u2014 not file-backed ones). Omit to leave the stored text unchanged. This is the in-place alternative to re-ingesting with upsert:true."
|
|
11734
11833
|
),
|
|
11735
|
-
folderId:
|
|
11736
|
-
status:
|
|
11834
|
+
folderId: import_zod15.z.string().optional().describe("Move the document into this folder (cannot be cleared once set)."),
|
|
11835
|
+
status: import_zod15.z.enum(["ACTIVE", "ARCHIVED"]).optional().describe(
|
|
11737
11836
|
"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."
|
|
11738
11837
|
),
|
|
11739
|
-
userId:
|
|
11740
|
-
scopes:
|
|
11838
|
+
userId: import_zod15.z.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
11839
|
+
scopes: import_zod15.z.array(import_zod15.z.string()).optional().describe(
|
|
11741
11840
|
'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).'
|
|
11742
11841
|
),
|
|
11743
|
-
expectedVersion:
|
|
11842
|
+
expectedVersion: import_zod15.z.number().int().optional().describe(
|
|
11744
11843
|
"Optimistic concurrency: the version you last read. If the document changed since, the update is refused as a conflict (re-read and retry). Omit for last-write-wins."
|
|
11745
11844
|
)
|
|
11746
11845
|
};
|
|
@@ -11768,18 +11867,18 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
11768
11867
|
try {
|
|
11769
11868
|
const resolved = await resolveDocumentIdByExternalId(client, { id: documentId, externalId, type });
|
|
11770
11869
|
if ("error" in resolved) return toolError("document_update", new Error(resolved.error));
|
|
11771
|
-
const
|
|
11772
|
-
if (title !== void 0)
|
|
11773
|
-
if (fields !== void 0)
|
|
11774
|
-
if (text !== void 0)
|
|
11775
|
-
if (folderId !== void 0)
|
|
11776
|
-
if (status !== void 0)
|
|
11777
|
-
if (userId !== void 0)
|
|
11778
|
-
if (scopes !== void 0)
|
|
11779
|
-
if (expectedVersion !== void 0)
|
|
11870
|
+
const patch = {};
|
|
11871
|
+
if (title !== void 0) patch.title = title;
|
|
11872
|
+
if (fields !== void 0) patch.payload = fields;
|
|
11873
|
+
if (text !== void 0) patch.text = text;
|
|
11874
|
+
if (folderId !== void 0) patch.folderId = folderId;
|
|
11875
|
+
if (status !== void 0) patch.status = status;
|
|
11876
|
+
if (userId !== void 0) patch.userId = userId;
|
|
11877
|
+
if (scopes !== void 0) patch.scopes = scopes;
|
|
11878
|
+
if (expectedVersion !== void 0) patch.expectedVersion = expectedVersion;
|
|
11780
11879
|
const updated = await client.documents.patchDocument({
|
|
11781
11880
|
id: resolved.id,
|
|
11782
|
-
|
|
11881
|
+
...patch
|
|
11783
11882
|
});
|
|
11784
11883
|
log.debug({ tool: "document_update", documentId: resolved.id, externalId }, "document_update ok");
|
|
11785
11884
|
return { content: [{ type: "text", text: JSON.stringify(updated, null, 2) }] };
|
|
@@ -11792,9 +11891,9 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
11792
11891
|
var document_update_default = documentUpdate;
|
|
11793
11892
|
|
|
11794
11893
|
// src/tools/document_delete.ts
|
|
11795
|
-
var
|
|
11894
|
+
var import_zod16 = require("zod");
|
|
11796
11895
|
var inputSchema15 = {
|
|
11797
|
-
documentId:
|
|
11896
|
+
documentId: import_zod16.z.string().min(1, "documentId is required").describe("The Vectros document id to delete.")
|
|
11798
11897
|
};
|
|
11799
11898
|
var documentDelete = ({ client, log }) => ({
|
|
11800
11899
|
name: "document_delete",
|
|
@@ -11821,18 +11920,18 @@ var documentDelete = ({ client, log }) => ({
|
|
|
11821
11920
|
var document_delete_default = documentDelete;
|
|
11822
11921
|
|
|
11823
11922
|
// src/tools/folder_query.ts
|
|
11824
|
-
var
|
|
11923
|
+
var import_zod17 = require("zod");
|
|
11825
11924
|
var MCP_DEFAULT_LIMIT4 = 10;
|
|
11826
11925
|
var MCP_MAX_LIMIT4 = 100;
|
|
11827
11926
|
var inputSchema16 = {
|
|
11828
|
-
id:
|
|
11829
|
-
parentId:
|
|
11830
|
-
userId:
|
|
11831
|
-
scope:
|
|
11927
|
+
id: import_zod17.z.string().optional().describe("Get mode: fetch this single folder by id."),
|
|
11928
|
+
parentId: import_zod17.z.string().optional().describe("List mode: direct children of this folder (tree navigation). Omit for a flat tenant list."),
|
|
11929
|
+
userId: import_zod17.z.string().optional().describe("List mode: scope to folders owned by this user."),
|
|
11930
|
+
scope: import_zod17.z.string().optional().describe(
|
|
11832
11931
|
'List mode: filter to folders 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.'
|
|
11833
11932
|
),
|
|
11834
|
-
startFrom:
|
|
11835
|
-
limit:
|
|
11933
|
+
startFrom: import_zod17.z.string().optional().describe("List mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
11934
|
+
limit: import_zod17.z.number().int().min(1).max(MCP_MAX_LIMIT4).optional().describe(
|
|
11836
11935
|
`List mode: max folders per page. Default 10; raise up to ${MCP_MAX_LIMIT4} (the folders API max) in one call when you can accept the larger page, or page with \`startFrom\`.`
|
|
11837
11936
|
)
|
|
11838
11937
|
};
|
|
@@ -11872,16 +11971,16 @@ var folderQuery = ({ client, log }) => ({
|
|
|
11872
11971
|
var folder_query_default = folderQuery;
|
|
11873
11972
|
|
|
11874
11973
|
// src/tools/folder_create.ts
|
|
11875
|
-
var
|
|
11974
|
+
var import_zod18 = require("zod");
|
|
11876
11975
|
var inputSchema17 = {
|
|
11877
|
-
name:
|
|
11878
|
-
description:
|
|
11879
|
-
parentId:
|
|
11880
|
-
slug:
|
|
11976
|
+
name: import_zod18.z.string().min(1, "name is required").describe("Folder display name."),
|
|
11977
|
+
description: import_zod18.z.string().optional().describe("Optional description of the folder's purpose."),
|
|
11978
|
+
parentId: import_zod18.z.string().optional().describe("Parent folder id \u2014 places the folder under this parent. Omit for the context default root. Create-only."),
|
|
11979
|
+
slug: import_zod18.z.string().optional().describe(
|
|
11881
11980
|
"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."
|
|
11882
11981
|
),
|
|
11883
|
-
userId:
|
|
11884
|
-
scopes:
|
|
11982
|
+
userId: import_zod18.z.string().optional().describe("Owning user (Vectros UUID)."),
|
|
11983
|
+
scopes: import_zod18.z.array(import_zod18.z.string()).optional().describe(
|
|
11885
11984
|
'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.'
|
|
11886
11985
|
)
|
|
11887
11986
|
};
|
|
@@ -11923,16 +12022,16 @@ var folderCreate = ({ client, log }) => ({
|
|
|
11923
12022
|
var folder_create_default = folderCreate;
|
|
11924
12023
|
|
|
11925
12024
|
// src/tools/folder_update.ts
|
|
11926
|
-
var
|
|
12025
|
+
var import_zod19 = require("zod");
|
|
11927
12026
|
var inputSchema18 = {
|
|
11928
|
-
id:
|
|
11929
|
-
name:
|
|
11930
|
-
description:
|
|
11931
|
-
userId:
|
|
11932
|
-
scopes:
|
|
12027
|
+
id: import_zod19.z.string().min(1, "id is required").describe("The Vectros folder id to update."),
|
|
12028
|
+
name: import_zod19.z.string().optional().describe("New folder name. Omit to keep the current name."),
|
|
12029
|
+
description: import_zod19.z.string().optional().describe("New description. Omit to leave unchanged."),
|
|
12030
|
+
userId: import_zod19.z.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
12031
|
+
scopes: import_zod19.z.array(import_zod19.z.string()).optional().describe(
|
|
11933
12032
|
'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).'
|
|
11934
12033
|
),
|
|
11935
|
-
expectedVersion:
|
|
12034
|
+
expectedVersion: import_zod19.z.number().int().optional().describe(
|
|
11936
12035
|
"Optimistic concurrency: the version you last read. If the folder changed since, the update is refused as a conflict (re-read and retry). Omit for last-write-wins."
|
|
11937
12036
|
)
|
|
11938
12037
|
};
|
|
@@ -11971,9 +12070,9 @@ var folderUpdate = ({ client, log }) => ({
|
|
|
11971
12070
|
var folder_update_default = folderUpdate;
|
|
11972
12071
|
|
|
11973
12072
|
// src/tools/folder_delete.ts
|
|
11974
|
-
var
|
|
12073
|
+
var import_zod20 = require("zod");
|
|
11975
12074
|
var inputSchema19 = {
|
|
11976
|
-
id:
|
|
12075
|
+
id: import_zod20.z.string().min(1, "id is required").describe("The Vectros folder id to delete.")
|
|
11977
12076
|
};
|
|
11978
12077
|
var folderDelete = ({ client, log }) => ({
|
|
11979
12078
|
name: "folder_delete",
|
|
@@ -12023,7 +12122,7 @@ var currentIdentity = ({ log, apiKey, environment }) => ({
|
|
|
12023
12122
|
var current_identity_default = currentIdentity;
|
|
12024
12123
|
|
|
12025
12124
|
// src/tools/document_ingest.ts
|
|
12026
|
-
var
|
|
12125
|
+
var import_zod21 = require("zod");
|
|
12027
12126
|
var import_promises = require("fs/promises");
|
|
12028
12127
|
var import_node_path = require("path");
|
|
12029
12128
|
var IngestPathError = class extends Error {
|
|
@@ -12099,43 +12198,46 @@ function inferMimeType(filePath) {
|
|
|
12099
12198
|
return EXT_TO_MIME[ext] ?? "application/octet-stream";
|
|
12100
12199
|
}
|
|
12101
12200
|
var inputSchema21 = {
|
|
12102
|
-
title:
|
|
12103
|
-
indexMode:
|
|
12201
|
+
title: import_zod21.z.string().min(1, "title is required").describe("Human-readable document title \u2014 appears in search results and the UI."),
|
|
12202
|
+
indexMode: import_zod21.z.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
|
|
12104
12203
|
"Index strategy. HYBRID (BM25 + dense, default; best for general retrieval), SEMANTIC (dense only; concept-driven queries), TEXT (BM25 only; exact-match / keyword), NONE (store-only / archival \u2014 retrievable by id and structured-field lookup but never in search results). Omit to inherit the bound schema's default."
|
|
12105
12204
|
),
|
|
12106
|
-
externalId:
|
|
12107
|
-
'Stable caller-supplied id. Immutable; unique per type within your context. Re-ingesting with the same externalId returns the existing document (idempotent) instead of creating a duplicate \u2014 use it to make ingests safely retryable and as the key other records reference. Mirrors record_create. Receiving the existing document back is a read of it and needs documents:r in addition to documents:c; a create-only key gets an "already exists" error instead of the document.'
|
|
12205
|
+
externalId: import_zod21.z.string().optional().describe(
|
|
12206
|
+
'Stable caller-supplied id. Immutable; unique per type within your context. Re-ingesting with the same externalId returns the existing document (idempotent) instead of creating a duplicate \u2014 use it to make ingests safely retryable and as the key other records reference. Mirrors record_create. Receiving the existing document back is a read of it and needs documents:r in addition to documents:c; a create-only key gets an "already exists" error instead of the document. Pass `schemaId` with it: an externalId with no `schemaId` is refused (400) unless `confirmUntyped` is true.'
|
|
12207
|
+
),
|
|
12208
|
+
upsert: import_zod21.z.boolean().optional().describe(
|
|
12209
|
+
"When true, re-ingesting an existing externalId OVERWRITES that document and re-indexes the new body (text mode) / re-uploads and re-indexes the new file (file mode), instead of returning the existing one unchanged. This is the curation/re-sync primitive: edit a source, re-ingest with upsert:true, and the search index reflects the new content. Requires the documents:u scope. IMPORTANT: pass the SAME schemaId (and type) you used originally \u2014 externalId is unique WITHIN a type. Omitting schemaId is refused (400) unless `confirmUntyped` is true, and with it the call targets the UNTYPED namespace, so it mints or updates an untyped document and never touches the typed one. The response `created` flag confirms which happened (created:true = a new document was minted)."
|
|
12108
12210
|
),
|
|
12109
|
-
|
|
12110
|
-
"
|
|
12211
|
+
schemaId: import_zod21.z.string().optional().describe(
|
|
12212
|
+
"Bind this document to a record schema. When set, `payload` is validated against the schema and its lookup fields become directly queryable via document_query (records parity). Resolve a schema id from its type via list_schemas. Omit for an untyped document (an untyped document that also carries an `externalId` needs `confirmUntyped`)."
|
|
12111
12213
|
),
|
|
12112
|
-
|
|
12113
|
-
"
|
|
12214
|
+
confirmUntyped: import_zod21.z.boolean().optional().describe(
|
|
12215
|
+
"Set true to confirm that an UNTYPED document is what you intend when you pass `externalId` without `schemaId`. Without it the platform refuses that combination (400): externalId is unique per schema, so a forgotten `schemaId` would otherwise quietly create a separate untyped copy instead of reaching the typed document you meant. Do not set it just to get past that error \u2014 check that the document really is untyped first. Ignored when `schemaId` is given or `externalId` is omitted."
|
|
12114
12216
|
),
|
|
12115
|
-
payload:
|
|
12217
|
+
payload: import_zod21.z.record(import_zod21.z.string(), import_zod21.z.unknown()).optional().describe(
|
|
12116
12218
|
"The document's structured data \u2014 a flat key/value object. With `schemaId`, declared fields are validated and lookup fields indexed; undeclared keys pass through as free-form and are searchable via the hybrid_search `filters` param. Without a schema it is stored as free-form metadata. Every number must fall within the signed 64-bit range \u2014 send a larger whole number as a STRING (stored exactly, exact-match lookup), else the ingest is refused with a 400 naming the field."
|
|
12117
12219
|
),
|
|
12118
12220
|
// Inline text mode (mutually exclusive with filePath):
|
|
12119
|
-
text:
|
|
12120
|
-
storeText:
|
|
12221
|
+
text: import_zod21.z.string().min(1).optional().describe("Text body to ingest inline. Mutually exclusive with filePath. Either text or filePath is required."),
|
|
12222
|
+
storeText: import_zod21.z.boolean().optional().describe(
|
|
12121
12223
|
"FILE MODE ONLY. Whether the uploaded file's EXTRACTED text is retained after indexing (default true), fixed at ingest. true keeps the extracted text retrievable via document_get(includeText:true) and usable by document_ask; false discards it once indexing completes \u2014 search still works and the original file remains downloadable, but includeText returns textAvailable:false and document_ask is unavailable. NOT accepted with `text`: a text-ingested body is the document itself and is ALWAYS retained, so the backend has no storeText knob on the text path \u2014 passing it with `text` is rejected rather than silently ignored."
|
|
12122
12224
|
),
|
|
12123
12225
|
// File upload mode (mutually exclusive with text; stdio-transport-only):
|
|
12124
|
-
filePath:
|
|
12226
|
+
filePath: import_zod21.z.string().min(1).optional().describe(
|
|
12125
12227
|
"Local filesystem path to upload. Mutually exclusive with text. STDIO TRANSPORT ONLY \u2014 rejected on HTTP transport (remote MCP servers can't read your filesystem; use text mode or call the SDK's uploadDocument directly). Must resolve INSIDE the configured ingest root (VECTROS_MCP_INGEST_ROOT, else the server's working directory); paths that escape it (traversal/absolute/symlink) or match a sensitive pattern are rejected."
|
|
12126
12228
|
),
|
|
12127
|
-
fileType:
|
|
12229
|
+
fileType: import_zod21.z.string().optional().describe('MIME type of the file (e.g. "application/pdf"). Inferred from filePath extension if omitted.'),
|
|
12128
12230
|
// Common (both modes):
|
|
12129
|
-
folderId:
|
|
12130
|
-
userId:
|
|
12131
|
-
scopes:
|
|
12231
|
+
folderId: import_zod21.z.string().optional().describe("Optional folder to ingest into. Default: tenant root."),
|
|
12232
|
+
userId: import_zod21.z.string().optional().describe("Owning user ID. Optional."),
|
|
12233
|
+
scopes: import_zod21.z.array(import_zod21.z.string()).optional().describe(
|
|
12132
12234
|
"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."
|
|
12133
12235
|
)
|
|
12134
12236
|
};
|
|
12135
12237
|
var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
12136
12238
|
name: "document_ingest",
|
|
12137
12239
|
title: "Ingest a new document (text body or file upload)",
|
|
12138
|
-
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
|
|
12240
|
+
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`.",
|
|
12139
12241
|
inputSchema: inputSchema21,
|
|
12140
12242
|
// Creates by default, idempotent ONLY when the caller supplies `externalId` (optional,
|
|
12141
12243
|
// per the doc comment above) — re-ingest then returns the existing document rather than
|
|
@@ -12153,6 +12255,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12153
12255
|
const filePath = args.filePath;
|
|
12154
12256
|
const schemaId = args.schemaId;
|
|
12155
12257
|
const upsert = args.upsert;
|
|
12258
|
+
const confirmUntyped = args.confirmUntyped;
|
|
12156
12259
|
const indexMode = args.indexMode ?? (schemaId ? void 0 : "HYBRID");
|
|
12157
12260
|
if (!text && !filePath) {
|
|
12158
12261
|
return toolError(
|
|
@@ -12201,6 +12304,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12201
12304
|
if (text) {
|
|
12202
12305
|
const result = await client.documents.ingestDocument({
|
|
12203
12306
|
upsert,
|
|
12307
|
+
confirmUntyped,
|
|
12204
12308
|
body: {
|
|
12205
12309
|
title,
|
|
12206
12310
|
text,
|
|
@@ -12241,6 +12345,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12241
12345
|
const storeTextFile = args.storeText ?? true;
|
|
12242
12346
|
const upload = await client.documents.uploadDocument({
|
|
12243
12347
|
upsert,
|
|
12348
|
+
confirmUntyped,
|
|
12244
12349
|
fileName,
|
|
12245
12350
|
fileType,
|
|
12246
12351
|
indexMode,
|
|
@@ -12273,6 +12378,8 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12273
12378
|
{ tool: "document_ingest", mode: "file", id: docId, fileName, fileType, bytes: bytes.length },
|
|
12274
12379
|
"document_ingest file ok"
|
|
12275
12380
|
);
|
|
12381
|
+
const uploadCreated = upload?.created;
|
|
12382
|
+
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.";
|
|
12276
12383
|
return {
|
|
12277
12384
|
content: [
|
|
12278
12385
|
{
|
|
@@ -12281,7 +12388,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12281
12388
|
{
|
|
12282
12389
|
...upload,
|
|
12283
12390
|
indexStatus: "PENDING_INDEX",
|
|
12284
|
-
_note:
|
|
12391
|
+
_note: note
|
|
12285
12392
|
},
|
|
12286
12393
|
null,
|
|
12287
12394
|
2
|
|
@@ -12305,29 +12412,29 @@ function presignedUploadHeaders(response) {
|
|
|
12305
12412
|
}
|
|
12306
12413
|
|
|
12307
12414
|
// src/tools/lookup_principal.ts
|
|
12308
|
-
var
|
|
12415
|
+
var import_zod22 = require("zod");
|
|
12309
12416
|
var MCP_DEFAULT_LIMIT5 = 10;
|
|
12310
12417
|
var MCP_MAX_LIMIT5 = 100;
|
|
12311
12418
|
var inputSchema22 = {
|
|
12312
|
-
kind:
|
|
12419
|
+
kind: import_zod22.z.string().describe(
|
|
12313
12420
|
'Which principal to look up: "user" (the fixed principal surface), or an entity namespace \u2014 "org", "client" (reserved, registered like any other), or a namespace you registered.'
|
|
12314
12421
|
),
|
|
12315
|
-
externalId:
|
|
12422
|
+
externalId: import_zod22.z.string().optional().describe(
|
|
12316
12423
|
"Resolve mode: your own stable identifier for the principal. Returns the single matching principal (with its Vectros UUID), or an empty array if none. The fastest path to the UUID the ownership filters need. Takes precedence if both this and a `field` lookup are supplied."
|
|
12317
12424
|
),
|
|
12318
|
-
contextId:
|
|
12425
|
+
contextId: import_zod22.z.string().optional().describe(
|
|
12319
12426
|
"Entity kinds only (not `user`, which is always tenant-wide): the app context to look up entities in, for a namespace registered as context-owned rather than tenant-wide. A context-confined credential's own context is used automatically without this; supply it to name a context explicitly (required for an unconfined/root credential to reach a context-owned namespace). Rejected if the namespace turns out to be tenant-wide."
|
|
12320
12427
|
),
|
|
12321
12428
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
12322
|
-
type:
|
|
12323
|
-
field:
|
|
12324
|
-
value:
|
|
12325
|
-
from:
|
|
12326
|
-
to:
|
|
12327
|
-
prefix:
|
|
12328
|
-
order:
|
|
12329
|
-
startFrom:
|
|
12330
|
-
limit:
|
|
12429
|
+
type: import_zod22.z.string().optional().describe('Lookup mode: the identity schema\'s record type (e.g. "person_v1"). Required with `field`.'),
|
|
12430
|
+
field: import_zod22.z.string().optional().describe('Lookup mode: name of the schema-declared lookup field to query by (e.g. "email").'),
|
|
12431
|
+
value: import_zod22.z.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields."),
|
|
12432
|
+
from: import_zod22.z.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Non-sensitive fields only."),
|
|
12433
|
+
to: import_zod22.z.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
12434
|
+
prefix: import_zod22.z.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
12435
|
+
order: import_zod22.z.enum(["asc", "desc"]).optional().describe("Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc`."),
|
|
12436
|
+
startFrom: import_zod22.z.string().optional().describe("Lookup mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
12437
|
+
limit: import_zod22.z.number().int().min(1).max(MCP_MAX_LIMIT5).optional().describe(
|
|
12331
12438
|
`Max principals per page. Defaults to ${MCP_DEFAULT_LIMIT5}; raise up to ${MCP_MAX_LIMIT5} (the principals API max) in one call when you can accept the payload, or page with \`startFrom\`.`
|
|
12332
12439
|
)
|
|
12333
12440
|
};
|
|
@@ -12411,11 +12518,11 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
12411
12518
|
var lookup_principal_default = lookupPrincipal;
|
|
12412
12519
|
|
|
12413
12520
|
// src/tools/version_history.ts
|
|
12414
|
-
var
|
|
12521
|
+
var import_zod23 = require("zod");
|
|
12415
12522
|
var inputSchema23 = {
|
|
12416
|
-
resourceType:
|
|
12417
|
-
id:
|
|
12418
|
-
startFrom:
|
|
12523
|
+
resourceType: import_zod23.z.enum(["record", "document"]).describe("Which kind of entity the id refers to: a record or a document."),
|
|
12524
|
+
id: import_zod23.z.string().min(1, "id is required").describe("The Vectros id of the record or document whose history you want."),
|
|
12525
|
+
startFrom: import_zod23.z.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch older entries.")
|
|
12419
12526
|
};
|
|
12420
12527
|
var versionHistory = ({ client, log }) => ({
|
|
12421
12528
|
name: "version_history",
|
|
@@ -12539,7 +12646,7 @@ var ALL_RESOURCE_FACTORIES = {
|
|
|
12539
12646
|
};
|
|
12540
12647
|
|
|
12541
12648
|
// src/zod-to-json-schema.ts
|
|
12542
|
-
var
|
|
12649
|
+
var import_zod24 = require("zod");
|
|
12543
12650
|
function zodShapeToJsonSchema(shape) {
|
|
12544
12651
|
const properties = {};
|
|
12545
12652
|
const required = [];
|
|
@@ -12554,40 +12661,40 @@ function zodShapeToJsonSchema(shape) {
|
|
|
12554
12661
|
function zodTypeToJsonSchema(schema) {
|
|
12555
12662
|
const description = schema.description;
|
|
12556
12663
|
let current = schema;
|
|
12557
|
-
while (current instanceof
|
|
12664
|
+
while (current instanceof import_zod24.z.ZodOptional || current instanceof import_zod24.z.ZodDefault || current instanceof import_zod24.z.ZodNullable) {
|
|
12558
12665
|
current = current._def.innerType;
|
|
12559
12666
|
}
|
|
12560
12667
|
const base = description ? { description } : {};
|
|
12561
|
-
if (current instanceof
|
|
12668
|
+
if (current instanceof import_zod24.z.ZodString) {
|
|
12562
12669
|
return { ...base, type: "string" };
|
|
12563
12670
|
}
|
|
12564
|
-
if (current instanceof
|
|
12671
|
+
if (current instanceof import_zod24.z.ZodNumber) {
|
|
12565
12672
|
return { ...base, type: "number" };
|
|
12566
12673
|
}
|
|
12567
|
-
if (current instanceof
|
|
12674
|
+
if (current instanceof import_zod24.z.ZodBoolean) {
|
|
12568
12675
|
return { ...base, type: "boolean" };
|
|
12569
12676
|
}
|
|
12570
|
-
if (current instanceof
|
|
12677
|
+
if (current instanceof import_zod24.z.ZodEnum) {
|
|
12571
12678
|
return {
|
|
12572
12679
|
...base,
|
|
12573
12680
|
type: "string",
|
|
12574
12681
|
enum: current.options
|
|
12575
12682
|
};
|
|
12576
12683
|
}
|
|
12577
|
-
if (current instanceof
|
|
12684
|
+
if (current instanceof import_zod24.z.ZodArray) {
|
|
12578
12685
|
return {
|
|
12579
12686
|
...base,
|
|
12580
12687
|
type: "array",
|
|
12581
12688
|
items: zodTypeToJsonSchema(current.element)
|
|
12582
12689
|
};
|
|
12583
12690
|
}
|
|
12584
|
-
if (current instanceof
|
|
12691
|
+
if (current instanceof import_zod24.z.ZodObject) {
|
|
12585
12692
|
return {
|
|
12586
12693
|
...base,
|
|
12587
12694
|
...zodShapeToJsonSchema(current.shape)
|
|
12588
12695
|
};
|
|
12589
12696
|
}
|
|
12590
|
-
if (current instanceof
|
|
12697
|
+
if (current instanceof import_zod24.z.ZodRecord) {
|
|
12591
12698
|
const valueType = current._def.valueType;
|
|
12592
12699
|
return {
|
|
12593
12700
|
...base,
|
|
@@ -12716,7 +12823,7 @@ var VectrosMCPServer = class {
|
|
|
12716
12823
|
if (!tool) {
|
|
12717
12824
|
result = toolError(req.params.name ?? "unknown", new Error("No such tool."));
|
|
12718
12825
|
} else {
|
|
12719
|
-
const parsed =
|
|
12826
|
+
const parsed = import_zod25.z.object(tool.inputSchema).strict().safeParse(req.params.arguments ?? {});
|
|
12720
12827
|
if (!parsed.success) {
|
|
12721
12828
|
result = toolError(tool.name, new Error(formatArgError(tool, parsed.error)));
|
|
12722
12829
|
} else {
|