@vectros-ai/mcp-server 0.14.0 → 0.16.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 +40 -0
- package/README.md +5 -4
- package/dist/cli-http.js +510 -258
- package/dist/cli-http.js.map +1 -1
- package/dist/cli-http.mjs +510 -258
- package/dist/cli-http.mjs.map +1 -1
- package/dist/cli.js +510 -258
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +510 -258
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +510 -258
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +510 -258
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2531,7 +2531,7 @@ var AuthClient = class {
|
|
|
2531
2531
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/admin/keys/scoped");
|
|
2532
2532
|
}
|
|
2533
2533
|
/**
|
|
2534
|
-
* 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. A root API key (`sk_`) is exempt from
|
|
2534
|
+
* 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.
|
|
2535
2535
|
*
|
|
2536
2536
|
* @param {Vectros.CreateScopedKeyRequest} request
|
|
2537
2537
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -2863,7 +2863,7 @@ var AuthClient = class {
|
|
|
2863
2863
|
);
|
|
2864
2864
|
}
|
|
2865
2865
|
/**
|
|
2866
|
-
* Creates a new access profile under the given app context. This call is idempotent by `principalId`: if a profile with the same `principalId` already exists, the existing profile is returned (with status 200) instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing profile was returned) tells the two apart. To overwrite an existing profile's `scopes`/`roleId`, `identityOverrides`, and `status` instead of returning it unchanged, set `?upsert=true` (this also requires the `profiles:u` scope, and applies the same `identityOverrides` bounds the update endpoint documents — a scoped credential may not repoint or clear an identity value it does not itself hold). You must provide exactly one of `scopes` (an inline list of scopes) or `roleId` (a reference to a role); supplying both, or neither, is rejected. `identityOverrides` is keyed by ownership namespace in `scope:<namespace>` form — `scope:org` and `scope:client` for the reserved namespaces, or any namespace you have registered — and may name at most two; any other key (including the account identifier or `userId`) is rejected. If you use a scoped credential, the profile's effective scopes may not exceed your own; a root API key (`sk_`) is exempt. Requires the `profiles:c` scope.
|
|
2866
|
+
* Creates a new access profile under the given app context. This call is idempotent by `principalId`: if a profile with the same `principalId` already exists, the existing profile is returned (with status 200) instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing profile was returned) tells the two apart. To overwrite an existing profile's `scopes`/`roleId`, `identityOverrides`, and `status` instead of returning it unchanged, set `?upsert=true` (this also requires the `profiles:u` scope, and applies the same `identityOverrides` bounds the update endpoint documents — a scoped credential may not repoint or clear an identity value it does not itself hold). The `principalId` must name a principal that already exists: a `usr_` principal must be a live user in your tenant, so create the user before granting it a profile. A `usr_` id that names no such user is rejected, and no profile is created. `key_` principals are not checked this way. You must provide exactly one of `scopes` (an inline list of scopes) or `roleId` (a reference to a role); supplying both, or neither, is rejected. `identityOverrides` is keyed by ownership namespace in `scope:<namespace>` form — `scope:org` and `scope:client` for the reserved namespaces, or any namespace you have registered — and may name at most two; any other key (including the account identifier or `userId`) is rejected. If you use a scoped credential, the profile's effective scopes may not exceed your own; a root API key (`sk_`) is exempt. Requires the `profiles:c` scope.
|
|
2867
2867
|
*
|
|
2868
2868
|
* @param {Vectros.CreateAccessProfileRequest} request
|
|
2869
2869
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3964,7 +3964,7 @@ var AuthClient = class {
|
|
|
3964
3964
|
);
|
|
3965
3965
|
}
|
|
3966
3966
|
/**
|
|
3967
|
-
* Returns full usage detail for the requested calendar month, broken down by category (search, documents, and records) with per-category credit estimates and a split between your live and test environments. Defaults to the current month when `year` and `month` are omitted. Requires the `billing:r` scope on scoped tokens; API keys always have access.
|
|
3967
|
+
* Returns full usage detail for the requested calendar month, broken down by category (search, documents, and records) with per-category credit estimates and a split between your live and test environments. Defaults to the current month when `year` and `month` are omitted. Requires the `billing:r` scope on scoped tokens; API keys always have access. **A token confined to a single app context sees only that context's usage**: totals, the environment split, and the `contexts` breakdown narrow to it, and the environment your context is not bound to is omitted (`null`), not zeroed. Only a token with cross-context reach sees your full account-wide totals. Two exceptions to the narrowing, since they have no per-context breakdown to narrow to: `reads.calls.used`/`reads.dataOut.bytes` (metered per account, not per context) read as `0` for a confined token rather than a narrowed figure — the corresponding overage-credit charge fields narrow correctly; and `credits.limit` stays your whole plan's ceiling, so `credits.remaining` may overstate the account's true remaining room.
|
|
3968
3968
|
*
|
|
3969
3969
|
* @param {Vectros.GetUsageRequest} request
|
|
3970
3970
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4027,7 +4027,7 @@ var AuthClient = class {
|
|
|
4027
4027
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/usage");
|
|
4028
4028
|
}
|
|
4029
4029
|
/**
|
|
4030
|
-
* Retrieves a single registered issuer by issuerId. Requires a root API key or the bootstrap's provisioning capability.
|
|
4030
|
+
* Retrieves a single registered issuer by issuerId. Requires a root API key or the bootstrap's provisioning capability. A credential confined to one app context sees only an issuer registered in that context; naming one registered in another context returns 404, identically to a nonexistent issuerId. A root API key sees every context. An ordinary bootstrap credential that didn't specify a context resolves to the `default` app context specifically, not every context — so this call returns 404 for an issuer registered under any other context unless you re-minted the bootstrap token pinned to that context.
|
|
4031
4031
|
*
|
|
4032
4032
|
* @param {Vectros.GetIssuerRequest} request
|
|
4033
4033
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4085,13 +4085,81 @@ var AuthClient = class {
|
|
|
4085
4085
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers/{issuerId}");
|
|
4086
4086
|
}
|
|
4087
4087
|
/**
|
|
4088
|
-
*
|
|
4088
|
+
* Updates the mutable fields of a registered issuer: `subClaim`, `emailClaim`, `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. 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.
|
|
4089
|
+
*
|
|
4090
|
+
* @param {Vectros.IssuerUpdateRequest} request
|
|
4091
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4092
|
+
*
|
|
4093
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4094
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4095
|
+
* @throws {@link Vectros.NotFoundError}
|
|
4096
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4097
|
+
*
|
|
4098
|
+
* @example
|
|
4099
|
+
* await client.auth.updateIssuer({
|
|
4100
|
+
* issuerId: "auth0-prod"
|
|
4101
|
+
* })
|
|
4102
|
+
*/
|
|
4103
|
+
updateIssuer(request, requestOptions) {
|
|
4104
|
+
return HttpResponsePromise.fromPromise(this.__updateIssuer(request, requestOptions));
|
|
4105
|
+
}
|
|
4106
|
+
async __updateIssuer(request, requestOptions) {
|
|
4107
|
+
const { issuerId, ..._body } = request;
|
|
4108
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4109
|
+
const _headers = mergeHeaders(
|
|
4110
|
+
_authRequest.headers,
|
|
4111
|
+
this._options?.headers,
|
|
4112
|
+
requestOptions?.headers
|
|
4113
|
+
);
|
|
4114
|
+
const _response = await fetcher({
|
|
4115
|
+
url: url_exports.join(
|
|
4116
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4117
|
+
`v1/auth/issuers/${url_exports.encodePathParam(issuerId)}`
|
|
4118
|
+
),
|
|
4119
|
+
method: "PUT",
|
|
4120
|
+
headers: _headers,
|
|
4121
|
+
contentType: "application/json",
|
|
4122
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4123
|
+
requestType: "json",
|
|
4124
|
+
body: _body,
|
|
4125
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4126
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4127
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4128
|
+
fetchFn: this._options?.fetch,
|
|
4129
|
+
logging: this._options.logging
|
|
4130
|
+
});
|
|
4131
|
+
if (_response.ok) {
|
|
4132
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4133
|
+
}
|
|
4134
|
+
if (_response.error.reason === "status-code") {
|
|
4135
|
+
switch (_response.error.statusCode) {
|
|
4136
|
+
case 400:
|
|
4137
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4138
|
+
case 403:
|
|
4139
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4140
|
+
case 404:
|
|
4141
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4142
|
+
case 429:
|
|
4143
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4144
|
+
default:
|
|
4145
|
+
throw new VectrosError({
|
|
4146
|
+
statusCode: _response.error.statusCode,
|
|
4147
|
+
body: _response.error.body,
|
|
4148
|
+
rawResponse: _response.rawResponse
|
|
4149
|
+
});
|
|
4150
|
+
}
|
|
4151
|
+
}
|
|
4152
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/auth/issuers/{issuerId}");
|
|
4153
|
+
}
|
|
4154
|
+
/**
|
|
4155
|
+
* 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. Deactivate the affected users first if you intend to cut off their access, or register a replacement issuer before removing this one. An issuer that has never been used for an exchange (no bound users yet) can always be deregistered.
|
|
4089
4156
|
*
|
|
4090
4157
|
* @param {Vectros.DeleteIssuerRequest} request
|
|
4091
4158
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4092
4159
|
*
|
|
4093
4160
|
* @throws {@link Vectros.ForbiddenError}
|
|
4094
4161
|
* @throws {@link Vectros.NotFoundError}
|
|
4162
|
+
* @throws {@link Vectros.ConflictError}
|
|
4095
4163
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
4096
4164
|
*
|
|
4097
4165
|
* @example
|
|
@@ -4133,6 +4201,8 @@ var AuthClient = class {
|
|
|
4133
4201
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4134
4202
|
case 404:
|
|
4135
4203
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4204
|
+
case 409:
|
|
4205
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4136
4206
|
case 429:
|
|
4137
4207
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4138
4208
|
default:
|
|
@@ -4151,7 +4221,7 @@ var AuthClient = class {
|
|
|
4151
4221
|
);
|
|
4152
4222
|
}
|
|
4153
4223
|
/**
|
|
4154
|
-
* Returns the issuers registered in your tenant. Requires a root API key or the bootstrap's provisioning capability. Returns a `{data, nextCursor}` envelope.
|
|
4224
|
+
* Returns the issuers registered in your tenant. Requires a root API key or the bootstrap's provisioning capability. A credential confined to one app context sees only the issuers registered in that context; a root API key sees every context. An ordinary bootstrap credential that didn't specify a context resolves to the `default` app context specifically, not every context — so this call returns an empty page for a tenant whose issuers are all registered under a different context unless you re-minted the bootstrap token pinned to that context. Returns a `{data, nextCursor}` envelope.
|
|
4155
4225
|
*
|
|
4156
4226
|
* @param {Vectros.ListIssuersRequest} request
|
|
4157
4227
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4208,7 +4278,7 @@ var AuthClient = class {
|
|
|
4208
4278
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers");
|
|
4209
4279
|
}
|
|
4210
4280
|
/**
|
|
4211
|
-
* 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. Idempotent by `issuerId` within your tenant; the `(issuer, audience)` pair must not already be registered by a different issuerId/tenant.
|
|
4281
|
+
* 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. Idempotent by `issuerId` within your tenant; the `(issuer, audience)` pair must not already be registered by a different issuerId/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`.
|
|
4212
4282
|
*
|
|
4213
4283
|
* @param {Vectros.IssuerRequest} request
|
|
4214
4284
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4319,7 +4389,7 @@ var AuthClient = class {
|
|
|
4319
4389
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/ping");
|
|
4320
4390
|
}
|
|
4321
4391
|
/**
|
|
4322
|
-
* Returns the access profiles for the given principal across
|
|
4392
|
+
* Returns the access profiles for the given principal. Looking up your OWN principal — or holding the `context-directory-read` capability — returns the profiles across ALL of your contexts, letting you answer questions like "which apps does this user have access to?". A context-bound credential looking up a DIFFERENT principal instead sees only that principal's profile in your credential's own context (at most one result), never across contexts it has no authority over. Results are always confined to your account. Requires the `profiles:r` scope.
|
|
4323
4393
|
*
|
|
4324
4394
|
* @param {Vectros.ListProfilesForPrincipalRequest} request
|
|
4325
4395
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4393,6 +4463,7 @@ var AuthClient = class {
|
|
|
4393
4463
|
*
|
|
4394
4464
|
* @throws {@link Vectros.BadRequestError}
|
|
4395
4465
|
* @throws {@link Vectros.ForbiddenError}
|
|
4466
|
+
* @throws {@link Vectros.NotFoundError}
|
|
4396
4467
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
4397
4468
|
*
|
|
4398
4469
|
* @example
|
|
@@ -4446,6 +4517,8 @@ var AuthClient = class {
|
|
|
4446
4517
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4447
4518
|
case 403:
|
|
4448
4519
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4520
|
+
case 404:
|
|
4521
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4449
4522
|
case 429:
|
|
4450
4523
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4451
4524
|
default:
|
|
@@ -4598,7 +4671,84 @@ var AuthClient = class {
|
|
|
4598
4671
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/users/invite/resend");
|
|
4599
4672
|
}
|
|
4600
4673
|
/**
|
|
4601
|
-
*
|
|
4674
|
+
* Re-mints the presented `st_*` scoped token with one or more `identity.<namespace>` values changed — for a caller whose ROLE explicitly grants assuming those values (an invited hr-admin, a multi-org case-handler) and needs to change which value new writes place records under. The request body names one or more namespaces in canonical `scope:<namespace>` form, e.g. `{"scope:org": "orgB"}` — each value must be a plain literal, never a `${{ ... }}` placeholder. When you name MORE THAN ONE namespace, a single one of your roles must grant all of them together: the combination is never assembled from two different roles, because no role author would have vouched for it. `st_*`-only — a root API key or `ssk_*` scoped API key gets 403; neither needs this (root already has full authority, and an `ssk_*`'s identity shape is not what this resolves against).
|
|
4675
|
+
*
|
|
4676
|
+
* **Only an original token may assume.** A token produced BY this endpoint cannot assume again (403) — every assume starts from the token you exchanged for, so the identity you end up with is always one a single role explicitly granted rather than a combination reached by chaining calls. Keep your original token if you need to switch more than once, or exchange for a new one.
|
|
4677
|
+
*
|
|
4678
|
+
* **Entitlement is checked LIVE, against your roles as they are right now** — not against a copy frozen into your token when it was minted. The requested value must be explicitly granted by a role's `assumable` field for that namespace: a POINT check against the one value requested, and a deliberately separate, explicitly-authored question from what the role's `data_scope` permits reading or writing. Holding broad `data_scope` reach in a namespace does NOT by itself grant assuming any value in it.
|
|
4679
|
+
*
|
|
4680
|
+
* **What is preserved, and what is not.** Every clause of your token that does not reference a requested namespace is preserved verbatim, as are all other claims (`partner_user_id`, `context_id`, mint attribution). Clauses that DO reference a requested namespace are kept only if they come from a role that authorized the new value. A role that does not authorize it loses all of its clauses touching that namespace — including any scoped to the value you already held. Assume into a value one role grants and you keep that role's reach, not the reach of roles that never vouched for it.
|
|
4681
|
+
*
|
|
4682
|
+
* The re-minted token's `exp` is IDENTICAL to the presented token's — this call can never extend a session's life. A fresh, independently-revocable `jti` is stamped on every call, and (except when the presented token predates jti support and has none to chain from) the token also carries a `root_jti` revocation-lineage claim so revoking the token you started from closes every value ever assumed from it. Uses the ordinary Vectros `{"message":...}` error shape, not the OAuth envelope `POST /v1/auth/token/exchange` uses — this endpoint's caller is always Vectros-SDK code already holding a bearer token, never generic OAuth tooling.
|
|
4683
|
+
*
|
|
4684
|
+
* @param {Record<string, unknown>} request
|
|
4685
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4686
|
+
*
|
|
4687
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4688
|
+
* @throws {@link Vectros.UnauthorizedError}
|
|
4689
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4690
|
+
* @throws {@link Vectros.ConflictError}
|
|
4691
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4692
|
+
*
|
|
4693
|
+
* @example
|
|
4694
|
+
* await client.auth.assumeToken({
|
|
4695
|
+
* "scope:org": "orgB"
|
|
4696
|
+
* })
|
|
4697
|
+
*/
|
|
4698
|
+
assumeToken(request, requestOptions) {
|
|
4699
|
+
return HttpResponsePromise.fromPromise(this.__assumeToken(request, requestOptions));
|
|
4700
|
+
}
|
|
4701
|
+
async __assumeToken(request, requestOptions) {
|
|
4702
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4703
|
+
const _headers = mergeHeaders(
|
|
4704
|
+
_authRequest.headers,
|
|
4705
|
+
this._options?.headers,
|
|
4706
|
+
requestOptions?.headers
|
|
4707
|
+
);
|
|
4708
|
+
const _response = await fetcher({
|
|
4709
|
+
url: url_exports.join(
|
|
4710
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4711
|
+
"v1/auth/token/assume"
|
|
4712
|
+
),
|
|
4713
|
+
method: "POST",
|
|
4714
|
+
headers: _headers,
|
|
4715
|
+
contentType: "application/json",
|
|
4716
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4717
|
+
requestType: "json",
|
|
4718
|
+
body: request,
|
|
4719
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4720
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4721
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4722
|
+
fetchFn: this._options?.fetch,
|
|
4723
|
+
logging: this._options.logging
|
|
4724
|
+
});
|
|
4725
|
+
if (_response.ok) {
|
|
4726
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4727
|
+
}
|
|
4728
|
+
if (_response.error.reason === "status-code") {
|
|
4729
|
+
switch (_response.error.statusCode) {
|
|
4730
|
+
case 400:
|
|
4731
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4732
|
+
case 401:
|
|
4733
|
+
throw new UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
4734
|
+
case 403:
|
|
4735
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4736
|
+
case 409:
|
|
4737
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4738
|
+
case 429:
|
|
4739
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4740
|
+
default:
|
|
4741
|
+
throw new VectrosError({
|
|
4742
|
+
statusCode: _response.error.statusCode,
|
|
4743
|
+
body: _response.error.body,
|
|
4744
|
+
rawResponse: _response.rawResponse
|
|
4745
|
+
});
|
|
4746
|
+
}
|
|
4747
|
+
}
|
|
4748
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/auth/token/assume");
|
|
4749
|
+
}
|
|
4750
|
+
/**
|
|
4751
|
+
* RFC 8693 OAuth 2.0 Token Exchange. Trades a JWT issued by a third-party identity provider you've registered (`POST /v1/auth/issuers`) for a Vectros `st_*` scoped bearer token — no Vectros credential required to call this endpoint. The exchanged token's scope is resolved entirely server-side from the matched user's access profile; this endpoint accepts no caller-supplied scope, resource, or audience parameter (RFC 8693 §2.1's `resource`/`audience`/`scope` are not used in v1 — the registered `(issuer, audience)` pair alone pins the target tenant and app context). On a first-time login (no existing Vectros identity for this subject), two opt-in binding paths exist: `invite_token` (a `PENDING` sub-user invitation), and — if the registration declares one or more self-signup policies — `signup_type` (a brand-new user is created and bound to the policy's configured role). If `invite_token` is present at all, it is the ONLY path tried — a failed invite never falls through to self-signup. Neither field is required for a subject with an existing identity. If your issuer is registered against more than one app context (each via its own audience), `context_id` selects which one to target; omit it when your token's `aud` claim matches only one registered context — the common case, unaffected by this field. Uses the OAuth-standard error envelope (`{"error":..., "error_description":...}`, RFC 6749 §5.2), NOT this API's usual `{"message":...}` shape — its client is generic OAuth tooling, not the Vectros SDK.
|
|
4602
4752
|
*
|
|
4603
4753
|
* @param {Vectros.TokenExchangeRequest} request
|
|
4604
4754
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4674,9 +4824,9 @@ var ComplianceClient = class {
|
|
|
4674
4824
|
* @param {Vectros.ErasureRequest} request
|
|
4675
4825
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4676
4826
|
*
|
|
4827
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4677
4828
|
* @throws {@link Vectros.ForbiddenError}
|
|
4678
4829
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
4679
|
-
* @throws {@link Vectros.NotImplementedError}
|
|
4680
4830
|
*
|
|
4681
4831
|
* @example
|
|
4682
4832
|
* await client.compliance.createErasureRequest({
|
|
@@ -4715,12 +4865,12 @@ var ComplianceClient = class {
|
|
|
4715
4865
|
}
|
|
4716
4866
|
if (_response.error.reason === "status-code") {
|
|
4717
4867
|
switch (_response.error.statusCode) {
|
|
4868
|
+
case 400:
|
|
4869
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4718
4870
|
case 403:
|
|
4719
4871
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4720
4872
|
case 429:
|
|
4721
4873
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4722
|
-
case 501:
|
|
4723
|
-
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4724
4874
|
default:
|
|
4725
4875
|
throw new VectrosError({
|
|
4726
4876
|
statusCode: _response.error.statusCode,
|
|
@@ -4739,7 +4889,6 @@ var ComplianceClient = class {
|
|
|
4739
4889
|
*
|
|
4740
4890
|
* @throws {@link Vectros.ForbiddenError}
|
|
4741
4891
|
* @throws {@link Vectros.NotFoundError}
|
|
4742
|
-
* @throws {@link Vectros.NotImplementedError}
|
|
4743
4892
|
*
|
|
4744
4893
|
* @example
|
|
4745
4894
|
* await client.compliance.getErasureRequest({
|
|
@@ -4780,8 +4929,6 @@ var ComplianceClient = class {
|
|
|
4780
4929
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4781
4930
|
case 404:
|
|
4782
4931
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4783
|
-
case 501:
|
|
4784
|
-
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4785
4932
|
default:
|
|
4786
4933
|
throw new VectrosError({
|
|
4787
4934
|
statusCode: _response.error.statusCode,
|
|
@@ -6140,6 +6287,7 @@ var IdentityClient = class {
|
|
|
6140
6287
|
* @example
|
|
6141
6288
|
* await client.identity.listEntities({
|
|
6142
6289
|
* namespace: "team",
|
|
6290
|
+
* contextId: "myapp",
|
|
6143
6291
|
* startFrom: "b3BhcXVlLWN1cnNvci1mcm9tLXRoZS1wcmV2aW91cy1wYWdl"
|
|
6144
6292
|
* })
|
|
6145
6293
|
*/
|
|
@@ -6149,6 +6297,7 @@ var IdentityClient = class {
|
|
|
6149
6297
|
async __listEntities(request, requestOptions) {
|
|
6150
6298
|
const {
|
|
6151
6299
|
namespace,
|
|
6300
|
+
contextId,
|
|
6152
6301
|
userId,
|
|
6153
6302
|
externalId,
|
|
6154
6303
|
scope,
|
|
@@ -6163,6 +6312,7 @@ var IdentityClient = class {
|
|
|
6163
6312
|
limit
|
|
6164
6313
|
} = request;
|
|
6165
6314
|
const _queryParams = {
|
|
6315
|
+
contextId,
|
|
6166
6316
|
userId,
|
|
6167
6317
|
externalId,
|
|
6168
6318
|
scope,
|
|
@@ -6221,6 +6371,7 @@ var IdentityClient = class {
|
|
|
6221
6371
|
* @example
|
|
6222
6372
|
* await client.identity.createEntity({
|
|
6223
6373
|
* namespace: "team",
|
|
6374
|
+
* contextId: "myapp",
|
|
6224
6375
|
* body: {
|
|
6225
6376
|
* externalId: "team_eng_platform"
|
|
6226
6377
|
* }
|
|
@@ -6230,9 +6381,10 @@ var IdentityClient = class {
|
|
|
6230
6381
|
return HttpResponsePromise.fromPromise(this.__createEntity(request, requestOptions));
|
|
6231
6382
|
}
|
|
6232
6383
|
async __createEntity(request, requestOptions) {
|
|
6233
|
-
const { namespace, upsert, body: _body } = request;
|
|
6384
|
+
const { namespace, upsert, contextId, body: _body } = request;
|
|
6234
6385
|
const _queryParams = {
|
|
6235
|
-
upsert
|
|
6386
|
+
upsert,
|
|
6387
|
+
contextId
|
|
6236
6388
|
};
|
|
6237
6389
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6238
6390
|
const _headers = mergeHeaders(
|
|
@@ -6289,14 +6441,18 @@ var IdentityClient = class {
|
|
|
6289
6441
|
* @example
|
|
6290
6442
|
* await client.identity.getEntity({
|
|
6291
6443
|
* namespace: "team",
|
|
6292
|
-
* id: "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
|
|
6444
|
+
* id: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
6445
|
+
* contextId: "myapp"
|
|
6293
6446
|
* })
|
|
6294
6447
|
*/
|
|
6295
6448
|
getEntity(request, requestOptions) {
|
|
6296
6449
|
return HttpResponsePromise.fromPromise(this.__getEntity(request, requestOptions));
|
|
6297
6450
|
}
|
|
6298
6451
|
async __getEntity(request, requestOptions) {
|
|
6299
|
-
const { namespace, id } = request;
|
|
6452
|
+
const { namespace, id, contextId } = request;
|
|
6453
|
+
const _queryParams = {
|
|
6454
|
+
contextId
|
|
6455
|
+
};
|
|
6300
6456
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6301
6457
|
const _headers = mergeHeaders(
|
|
6302
6458
|
_authRequest.headers,
|
|
@@ -6310,7 +6466,7 @@ var IdentityClient = class {
|
|
|
6310
6466
|
),
|
|
6311
6467
|
method: "GET",
|
|
6312
6468
|
headers: _headers,
|
|
6313
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6469
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6314
6470
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6315
6471
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6316
6472
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6347,6 +6503,7 @@ var IdentityClient = class {
|
|
|
6347
6503
|
* await client.identity.updateEntity({
|
|
6348
6504
|
* namespace: "team",
|
|
6349
6505
|
* id: "id",
|
|
6506
|
+
* contextId: "myapp",
|
|
6350
6507
|
* body: {
|
|
6351
6508
|
* externalId: "team_eng_platform"
|
|
6352
6509
|
* }
|
|
@@ -6356,7 +6513,10 @@ var IdentityClient = class {
|
|
|
6356
6513
|
return HttpResponsePromise.fromPromise(this.__updateEntity(request, requestOptions));
|
|
6357
6514
|
}
|
|
6358
6515
|
async __updateEntity(request, requestOptions) {
|
|
6359
|
-
const { namespace, id, body: _body } = request;
|
|
6516
|
+
const { namespace, id, contextId, body: _body } = request;
|
|
6517
|
+
const _queryParams = {
|
|
6518
|
+
contextId
|
|
6519
|
+
};
|
|
6360
6520
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6361
6521
|
const _headers = mergeHeaders(
|
|
6362
6522
|
_authRequest.headers,
|
|
@@ -6371,7 +6531,7 @@ var IdentityClient = class {
|
|
|
6371
6531
|
method: "PUT",
|
|
6372
6532
|
headers: _headers,
|
|
6373
6533
|
contentType: "application/json",
|
|
6374
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6534
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6375
6535
|
requestType: "json",
|
|
6376
6536
|
body: _body,
|
|
6377
6537
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -6411,14 +6571,18 @@ var IdentityClient = class {
|
|
|
6411
6571
|
* @example
|
|
6412
6572
|
* await client.identity.deleteEntity({
|
|
6413
6573
|
* namespace: "team",
|
|
6414
|
-
* id: "id"
|
|
6574
|
+
* id: "id",
|
|
6575
|
+
* contextId: "myapp"
|
|
6415
6576
|
* })
|
|
6416
6577
|
*/
|
|
6417
6578
|
deleteEntity(request, requestOptions) {
|
|
6418
6579
|
return HttpResponsePromise.fromPromise(this.__deleteEntity(request, requestOptions));
|
|
6419
6580
|
}
|
|
6420
6581
|
async __deleteEntity(request, requestOptions) {
|
|
6421
|
-
const { namespace, id } = request;
|
|
6582
|
+
const { namespace, id, contextId } = request;
|
|
6583
|
+
const _queryParams = {
|
|
6584
|
+
contextId
|
|
6585
|
+
};
|
|
6422
6586
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6423
6587
|
const _headers = mergeHeaders(
|
|
6424
6588
|
_authRequest.headers,
|
|
@@ -6432,7 +6596,7 @@ var IdentityClient = class {
|
|
|
6432
6596
|
),
|
|
6433
6597
|
method: "DELETE",
|
|
6434
6598
|
headers: _headers,
|
|
6435
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6599
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6436
6600
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6437
6601
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6438
6602
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6475,6 +6639,7 @@ var IdentityClient = class {
|
|
|
6475
6639
|
* @example
|
|
6476
6640
|
* await client.identity.lookupEntities({
|
|
6477
6641
|
* namespace: "team",
|
|
6642
|
+
* contextId: "myapp",
|
|
6478
6643
|
* body: {
|
|
6479
6644
|
* type: "person_v1",
|
|
6480
6645
|
* field: "ssn"
|
|
@@ -6485,7 +6650,10 @@ var IdentityClient = class {
|
|
|
6485
6650
|
return HttpResponsePromise.fromPromise(this.__lookupEntities(request, requestOptions));
|
|
6486
6651
|
}
|
|
6487
6652
|
async __lookupEntities(request, requestOptions) {
|
|
6488
|
-
const { namespace, body: _body } = request;
|
|
6653
|
+
const { namespace, contextId, body: _body } = request;
|
|
6654
|
+
const _queryParams = {
|
|
6655
|
+
contextId
|
|
6656
|
+
};
|
|
6489
6657
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6490
6658
|
const _headers = mergeHeaders(
|
|
6491
6659
|
_authRequest.headers,
|
|
@@ -6500,7 +6668,7 @@ var IdentityClient = class {
|
|
|
6500
6668
|
method: "POST",
|
|
6501
6669
|
headers: _headers,
|
|
6502
6670
|
contentType: "application/json",
|
|
6503
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6671
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6504
6672
|
requestType: "json",
|
|
6505
6673
|
body: _body,
|
|
6506
6674
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -6544,15 +6712,17 @@ var IdentityClient = class {
|
|
|
6544
6712
|
* @example
|
|
6545
6713
|
* await client.identity.getEntityVersions({
|
|
6546
6714
|
* namespace: "team",
|
|
6547
|
-
* id: "id"
|
|
6715
|
+
* id: "id",
|
|
6716
|
+
* contextId: "myapp"
|
|
6548
6717
|
* })
|
|
6549
6718
|
*/
|
|
6550
6719
|
getEntityVersions(request, requestOptions) {
|
|
6551
6720
|
return HttpResponsePromise.fromPromise(this.__getEntityVersions(request, requestOptions));
|
|
6552
6721
|
}
|
|
6553
6722
|
async __getEntityVersions(request, requestOptions) {
|
|
6554
|
-
const { namespace, id, startFrom } = request;
|
|
6723
|
+
const { namespace, id, contextId, startFrom } = request;
|
|
6555
6724
|
const _queryParams = {
|
|
6725
|
+
contextId,
|
|
6556
6726
|
startFrom
|
|
6557
6727
|
};
|
|
6558
6728
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
@@ -6598,7 +6768,7 @@ var IdentityClient = class {
|
|
|
6598
6768
|
);
|
|
6599
6769
|
}
|
|
6600
6770
|
/**
|
|
6601
|
-
* Retrieves a single scope-namespace registration by name.
|
|
6771
|
+
* Retrieves a single scope-namespace registration by name.
|
|
6602
6772
|
*
|
|
6603
6773
|
* @param {Vectros.GetNamespaceRequest} request
|
|
6604
6774
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6614,7 +6784,10 @@ var IdentityClient = class {
|
|
|
6614
6784
|
return HttpResponsePromise.fromPromise(this.__getNamespace(request, requestOptions));
|
|
6615
6785
|
}
|
|
6616
6786
|
async __getNamespace(request, requestOptions) {
|
|
6617
|
-
const { namespace } = request;
|
|
6787
|
+
const { namespace, contextId } = request;
|
|
6788
|
+
const _queryParams = {
|
|
6789
|
+
contextId
|
|
6790
|
+
};
|
|
6618
6791
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6619
6792
|
const _headers = mergeHeaders(
|
|
6620
6793
|
_authRequest.headers,
|
|
@@ -6628,7 +6801,7 @@ var IdentityClient = class {
|
|
|
6628
6801
|
),
|
|
6629
6802
|
method: "GET",
|
|
6630
6803
|
headers: _headers,
|
|
6631
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6804
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6632
6805
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6633
6806
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6634
6807
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6653,7 +6826,7 @@ var IdentityClient = class {
|
|
|
6653
6826
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/namespaces/{namespace}");
|
|
6654
6827
|
}
|
|
6655
6828
|
/**
|
|
6656
|
-
* Updates the mutable fields (`entityBacked`, `defaultSchemaId`, `specificityRank`) of a registered namespace. The namespace name
|
|
6829
|
+
* Updates the mutable fields (`entityBacked`, `defaultSchemaId`, `specificityRank`) of a registered namespace. The namespace name and its `contextId` (which row is selected) are both immutable. Requires a root API key. `org` and `client` are updatable like any other namespace — there is no reserved-built-in exception.
|
|
6657
6830
|
*
|
|
6658
6831
|
* @param {Vectros.UpdateNamespaceRequest} request
|
|
6659
6832
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6675,7 +6848,10 @@ var IdentityClient = class {
|
|
|
6675
6848
|
return HttpResponsePromise.fromPromise(this.__updateNamespace(request, requestOptions));
|
|
6676
6849
|
}
|
|
6677
6850
|
async __updateNamespace(request, requestOptions) {
|
|
6678
|
-
const { namespace, body: _body } = request;
|
|
6851
|
+
const { namespace, contextId, body: _body } = request;
|
|
6852
|
+
const _queryParams = {
|
|
6853
|
+
contextId
|
|
6854
|
+
};
|
|
6679
6855
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6680
6856
|
const _headers = mergeHeaders(
|
|
6681
6857
|
_authRequest.headers,
|
|
@@ -6690,7 +6866,7 @@ var IdentityClient = class {
|
|
|
6690
6866
|
method: "PUT",
|
|
6691
6867
|
headers: _headers,
|
|
6692
6868
|
contentType: "application/json",
|
|
6693
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6869
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6694
6870
|
requestType: "json",
|
|
6695
6871
|
body: _body,
|
|
6696
6872
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -6721,7 +6897,7 @@ var IdentityClient = class {
|
|
|
6721
6897
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/namespaces/{namespace}");
|
|
6722
6898
|
}
|
|
6723
6899
|
/**
|
|
6724
|
-
* Deletes a registered scope namespace. Requires a root API key.
|
|
6900
|
+
* Deletes a registered scope namespace. Requires a root API key. `org` and `client` are deletable like any other namespace — there is no reserved-built-in exception. A namespace that still has entities cannot be deleted (409) — delete its entities first; this keeps them reachable by the account-teardown and erasure sweeps.
|
|
6725
6901
|
*
|
|
6726
6902
|
* @param {Vectros.DeleteNamespaceRequest} request
|
|
6727
6903
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6739,7 +6915,10 @@ var IdentityClient = class {
|
|
|
6739
6915
|
return HttpResponsePromise.fromPromise(this.__deleteNamespace(request, requestOptions));
|
|
6740
6916
|
}
|
|
6741
6917
|
async __deleteNamespace(request, requestOptions) {
|
|
6742
|
-
const { namespace } = request;
|
|
6918
|
+
const { namespace, contextId } = request;
|
|
6919
|
+
const _queryParams = {
|
|
6920
|
+
contextId
|
|
6921
|
+
};
|
|
6743
6922
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6744
6923
|
const _headers = mergeHeaders(
|
|
6745
6924
|
_authRequest.headers,
|
|
@@ -6753,7 +6932,7 @@ var IdentityClient = class {
|
|
|
6753
6932
|
),
|
|
6754
6933
|
method: "DELETE",
|
|
6755
6934
|
headers: _headers,
|
|
6756
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6935
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6757
6936
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6758
6937
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6759
6938
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6782,7 +6961,7 @@ var IdentityClient = class {
|
|
|
6782
6961
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/namespaces/{namespace}");
|
|
6783
6962
|
}
|
|
6784
6963
|
/**
|
|
6785
|
-
* Returns the scope namespaces registered in your account
|
|
6964
|
+
* Returns the scope namespaces registered in your account. Returns a `{data, nextCursor}` envelope.
|
|
6786
6965
|
*
|
|
6787
6966
|
* @param {Vectros.ListNamespacesRequest} request
|
|
6788
6967
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6794,10 +6973,11 @@ var IdentityClient = class {
|
|
|
6794
6973
|
return HttpResponsePromise.fromPromise(this.__listNamespaces(request, requestOptions));
|
|
6795
6974
|
}
|
|
6796
6975
|
async __listNamespaces(request = {}, requestOptions) {
|
|
6797
|
-
const { startFrom, limit } = request;
|
|
6976
|
+
const { startFrom, limit, contextId } = request;
|
|
6798
6977
|
const _queryParams = {
|
|
6799
6978
|
startFrom,
|
|
6800
|
-
limit
|
|
6979
|
+
limit,
|
|
6980
|
+
contextId
|
|
6801
6981
|
};
|
|
6802
6982
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6803
6983
|
const _headers = mergeHeaders(
|
|
@@ -6832,9 +7012,9 @@ var IdentityClient = class {
|
|
|
6832
7012
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/namespaces");
|
|
6833
7013
|
}
|
|
6834
7014
|
/**
|
|
6835
|
-
* 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.
|
|
7015
|
+
* 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 partner-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.
|
|
6836
7016
|
*
|
|
6837
|
-
* @param {Vectros.
|
|
7017
|
+
* @param {Vectros.RegisterNamespaceRequest} request
|
|
6838
7018
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6839
7019
|
*
|
|
6840
7020
|
* @throws {@link Vectros.BadRequestError}
|
|
@@ -6843,14 +7023,20 @@ var IdentityClient = class {
|
|
|
6843
7023
|
*
|
|
6844
7024
|
* @example
|
|
6845
7025
|
* await client.identity.registerNamespace({
|
|
6846
|
-
*
|
|
6847
|
-
*
|
|
7026
|
+
* body: {
|
|
7027
|
+
* namespace: "team",
|
|
7028
|
+
* specificityRank: 1500
|
|
7029
|
+
* }
|
|
6848
7030
|
* })
|
|
6849
7031
|
*/
|
|
6850
7032
|
registerNamespace(request, requestOptions) {
|
|
6851
7033
|
return HttpResponsePromise.fromPromise(this.__registerNamespace(request, requestOptions));
|
|
6852
7034
|
}
|
|
6853
7035
|
async __registerNamespace(request, requestOptions) {
|
|
7036
|
+
const { contextId, body: _body } = request;
|
|
7037
|
+
const _queryParams = {
|
|
7038
|
+
contextId
|
|
7039
|
+
};
|
|
6854
7040
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6855
7041
|
const _headers = mergeHeaders(
|
|
6856
7042
|
_authRequest.headers,
|
|
@@ -6865,9 +7051,9 @@ var IdentityClient = class {
|
|
|
6865
7051
|
method: "POST",
|
|
6866
7052
|
headers: _headers,
|
|
6867
7053
|
contentType: "application/json",
|
|
6868
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
7054
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6869
7055
|
requestType: "json",
|
|
6870
|
-
body:
|
|
7056
|
+
body: _body,
|
|
6871
7057
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6872
7058
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6873
7059
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6896,7 +7082,7 @@ var IdentityClient = class {
|
|
|
6896
7082
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/namespaces");
|
|
6897
7083
|
}
|
|
6898
7084
|
/**
|
|
6899
|
-
* Returns a paginated list of the users in your account. Pass `externalId` to look up a single user by your own identifier. To filter on schema-declared lookup fields, supply `type` and `field` together with one lookup mode: `value` (exact match), `from`+`to` (range), or `prefix`. Requires the `users:r` scope.
|
|
7085
|
+
* Returns a paginated list of the users in your account. Pass `externalId` to look up a single user by your own identifier. To filter on schema-declared lookup fields, supply `type` and `field` together with one lookup mode: `value` (exact match), `from`+`to` (range), or `prefix`. Requires the `users:r` scope. A context-confined credential only sees users who hold an access profile in the credential's own app context — others are silently absent from the page, not an error.
|
|
6900
7086
|
*
|
|
6901
7087
|
* @param {Vectros.ListUsersRequest} request
|
|
6902
7088
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6961,7 +7147,7 @@ var IdentityClient = class {
|
|
|
6961
7147
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users");
|
|
6962
7148
|
}
|
|
6963
7149
|
/**
|
|
6964
|
-
* Creates a user identity in your account. The operation is idempotent on `externalId`: if a user with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing user was returned) tells the two apart. To overwrite an existing user's mutable fields (email, status, payload, schema binding) instead of returning it unchanged, set `?upsert=true` (this also requires the `users:u` scope). Requires the `users:c` scope to create. Being returned the existing user on a collision is a read of that user's data and additionally requires the `users:r` scope — a credential holding `users:c` alone receives a `400` ("already exists") on collision instead of the user.
|
|
7150
|
+
* Creates a user identity in your account. The operation is idempotent on `externalId`: if a user with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing user was returned) tells the two apart. To overwrite an existing user's mutable fields (email, status, payload, schema binding) instead of returning it unchanged, set `?upsert=true` (this also requires the `users:u` scope). Requires the `users:c` scope to create. Being returned the existing user on a collision is a read of that user's data and additionally requires the `users:r` scope — a credential holding `users:c` alone receives a `400` ("already exists") on collision instead of the user. A context-confined credential additionally receives the collision echo (or, with `?upsert=true`, is allowed to overwrite) only when the colliding user holds an access profile in the credential's own app context — a cross-context collision otherwise gets the same uniform `400` instead of the other context's user data. One narrow exception on the plain (non-upsert) echo only: the CLI's no-code bootstrap credential can be echoed a colliding user across app contexts, needed for a blueprint to idempotently re-apply against a service principal it provisioned in a non-default context; this does not extend to `?upsert=true`.
|
|
6965
7151
|
*
|
|
6966
7152
|
* @param {Vectros.CreateUserRequest} request
|
|
6967
7153
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7085,7 +7271,7 @@ var IdentityClient = class {
|
|
|
7085
7271
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users/{id}");
|
|
7086
7272
|
}
|
|
7087
7273
|
/**
|
|
7088
|
-
* 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. Requires the `users:u` scope.
|
|
7274
|
+
* 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.
|
|
7089
7275
|
*
|
|
7090
7276
|
* @param {Vectros.UpdateUserRequest} request
|
|
7091
7277
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7152,12 +7338,13 @@ var IdentityClient = class {
|
|
|
7152
7338
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/users/{id}");
|
|
7153
7339
|
}
|
|
7154
7340
|
/**
|
|
7155
|
-
* Permanently deletes a user identity. This cannot be undone. If the user is a pending invitation, the associated access profile created for that invitation is also removed. Requires the `users:d` scope.
|
|
7341
|
+
* Permanently deletes a user identity. This cannot be undone. If the user is a pending invitation, the associated access profile created for that invitation is also removed. Requires the `users:d` scope. Deleting your account's last OWNER is refused (409) — an account must always retain at least one owner. Called by a context-confined credential, deletion is also refused (409) when the user holds access in an app context other than the caller's own — remove the user from the caller's own context first, or use a credential with cross-context reach.
|
|
7156
7342
|
*
|
|
7157
7343
|
* @param {Vectros.DeleteUserRequest} request
|
|
7158
7344
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7159
7345
|
*
|
|
7160
7346
|
* @throws {@link Vectros.NotFoundError}
|
|
7347
|
+
* @throws {@link Vectros.ConflictError}
|
|
7161
7348
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
7162
7349
|
*
|
|
7163
7350
|
* @example
|
|
@@ -7197,6 +7384,8 @@ var IdentityClient = class {
|
|
|
7197
7384
|
switch (_response.error.statusCode) {
|
|
7198
7385
|
case 404:
|
|
7199
7386
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7387
|
+
case 409:
|
|
7388
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7200
7389
|
case 429:
|
|
7201
7390
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7202
7391
|
default:
|
|
@@ -7210,7 +7399,7 @@ var IdentityClient = class {
|
|
|
7210
7399
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/users/{id}");
|
|
7211
7400
|
}
|
|
7212
7401
|
/**
|
|
7213
|
-
* Looks up users by a schema lookup field, with the query criteria carried in the request body rather than the URL. Use this when looking up by a sensitive (blind-indexed) field: the value is blind-indexed server-side and never appears in the URL, request logs, or proxies. The query semantics are identical to the GET /v1/users lookup, which rejects sensitive-field values and directs you here. Returns a page in the `{data, nextCursor}` envelope. Requires the `users:r` scope.
|
|
7402
|
+
* Looks up users by a schema lookup field, with the query criteria carried in the request body rather than the URL. Use this when looking up by a sensitive (blind-indexed) field: the value is blind-indexed server-side and never appears in the URL, request logs, or proxies. The query semantics are identical to the GET /v1/users lookup, which rejects sensitive-field values and directs you here. Returns a page in the `{data, nextCursor}` envelope. Requires the `users:r` scope. A context-confined credential only sees users who hold an access profile in the credential's own app context — others are silently absent from the page, not an error.
|
|
7214
7403
|
*
|
|
7215
7404
|
* @param {Vectros.IdentityLookupRequest} request
|
|
7216
7405
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7653,14 +7842,14 @@ var RecordsClient = class {
|
|
|
7653
7842
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
7654
7843
|
}
|
|
7655
7844
|
/**
|
|
7656
|
-
*
|
|
7845
|
+
* Fetches multiple records by ID in one call (`ids`, maximum 100). The response contains only the records you can access — any id that does not exist, belongs to another account/AppContext, or is outside your token's scope is silently omitted, with no per-id existence signal, matching the not-found behavior of the single-record GET. Payloads are hydrated the same way a by-id GET hydrates them (payloads externalized to object storage are rehydrated for this response). Requires the `records:r` scope (and, for a scoped token, `records:r:<type>` per record type).
|
|
7657
7846
|
*
|
|
7658
7847
|
* @param {Vectros.BatchGetRequest} request
|
|
7659
7848
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7660
7849
|
*
|
|
7850
|
+
* @throws {@link Vectros.BadRequestError}
|
|
7661
7851
|
* @throws {@link Vectros.ForbiddenError}
|
|
7662
7852
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
7663
|
-
* @throws {@link Vectros.NotImplementedError}
|
|
7664
7853
|
*
|
|
7665
7854
|
* @example
|
|
7666
7855
|
* await client.records.batchGetRecords()
|
|
@@ -7697,12 +7886,12 @@ var RecordsClient = class {
|
|
|
7697
7886
|
}
|
|
7698
7887
|
if (_response.error.reason === "status-code") {
|
|
7699
7888
|
switch (_response.error.statusCode) {
|
|
7889
|
+
case 400:
|
|
7890
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7700
7891
|
case 403:
|
|
7701
7892
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7702
7893
|
case 429:
|
|
7703
7894
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7704
|
-
case 501:
|
|
7705
|
-
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7706
7895
|
default:
|
|
7707
7896
|
throw new VectrosError({
|
|
7708
7897
|
statusCode: _response.error.statusCode,
|
|
@@ -8516,7 +8705,7 @@ var SchemasClient = class {
|
|
|
8516
8705
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
8517
8706
|
}
|
|
8518
8707
|
/**
|
|
8519
|
-
* Returns a paginated list of the record schemas defined in your account. Filter by `userId` or `scope` to scope to an owner, by `surface` to list the types bindable to one surface, or by `recordType` to resolve the single schema for a type directly. Filtering by
|
|
8708
|
+
* Returns a paginated list of the record schemas defined in your account. Filter by `userId` or `scope` to scope to an owner, by `surface` to list the types bindable to one surface, or by `recordType` to resolve the single schema for a type directly. Filtering by `surface=user` lists your account-wide identity schemas regardless of the calling context (a `user`-surfaced schema always has one tenant-wide home). Filtering by `surface=entity` reads your own app context's entity schemas AND the tenant-wide home together, newest first, through a single cursor — an entity schema may live in either home depending on where its namespace is placed (see `POST /v1/namespaces`). Filtering by `record` or `document` lists within the calling context only. Requires the `schemas:r` scope.
|
|
8520
8709
|
*
|
|
8521
8710
|
* @param {Vectros.ListSchemasRequest} request
|
|
8522
8711
|
* @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -8804,6 +8993,7 @@ var SchemasClient = class {
|
|
|
8804
8993
|
* @param {Vectros.DeleteSchemaRequest} request
|
|
8805
8994
|
* @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8806
8995
|
*
|
|
8996
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
8807
8997
|
* @throws {@link Vectros.NotFoundError}
|
|
8808
8998
|
* @throws {@link Vectros.ConflictError}
|
|
8809
8999
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
@@ -8843,6 +9033,8 @@ var SchemasClient = class {
|
|
|
8843
9033
|
}
|
|
8844
9034
|
if (_response.error.reason === "status-code") {
|
|
8845
9035
|
switch (_response.error.statusCode) {
|
|
9036
|
+
case 403:
|
|
9037
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8846
9038
|
case 404:
|
|
8847
9039
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
8848
9040
|
case 409:
|
|
@@ -9052,7 +9244,7 @@ var logging;
|
|
|
9052
9244
|
|
|
9053
9245
|
// src/server.ts
|
|
9054
9246
|
var import_types3 = require("@modelcontextprotocol/sdk/types.js");
|
|
9055
|
-
var
|
|
9247
|
+
var import_zod23 = require("zod");
|
|
9056
9248
|
|
|
9057
9249
|
// src/auth.ts
|
|
9058
9250
|
var KEY_RE = /^(sk|ssk|st)_(live|test)_/;
|
|
@@ -9096,8 +9288,8 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
9096
9288
|
|
|
9097
9289
|
// src/build-info.ts
|
|
9098
9290
|
var BUILD_INFO = {
|
|
9099
|
-
mcpServer: true ? "0.
|
|
9100
|
-
sdk: true ? "0.
|
|
9291
|
+
mcpServer: true ? "0.16.0" : "dev",
|
|
9292
|
+
sdk: true ? "0.41.0" : "dev"
|
|
9101
9293
|
};
|
|
9102
9294
|
|
|
9103
9295
|
// src/log.ts
|
|
@@ -9405,7 +9597,7 @@ var inputSchema = {
|
|
|
9405
9597
|
// Ownership.
|
|
9406
9598
|
userId: import_zod.z.string().optional().describe("Restrict to content owned by this user (Vectros UUID)."),
|
|
9407
9599
|
scope: import_zod.z.string().optional().describe(
|
|
9408
|
-
'Restrict to content carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "client:<uuid>", "group:eng-team"). `org` and `client` are
|
|
9600
|
+
'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.'
|
|
9409
9601
|
),
|
|
9410
9602
|
// Date window.
|
|
9411
9603
|
createdAfter: import_zod.z.string().optional().describe("Restrict to content created at/after this ISO 8601 UTC timestamp."),
|
|
@@ -9545,7 +9737,7 @@ var inputSchema2 = {
|
|
|
9545
9737
|
// List-mode args:
|
|
9546
9738
|
userId: import_zod2.z.string().optional().describe("List mode: scope to records owned by this user."),
|
|
9547
9739
|
scope: import_zod2.z.string().optional().describe(
|
|
9548
|
-
'List mode: filter to records carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "client:<uuid>", "group:eng-team"). `org` and `client` are
|
|
9740
|
+
'List mode: filter to records 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.'
|
|
9549
9741
|
),
|
|
9550
9742
|
startFrom: import_zod2.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."),
|
|
9551
9743
|
limit: import_zod2.z.number().int().min(1).max(MCP_MAX_LIMIT2).optional().describe(
|
|
@@ -9779,31 +9971,78 @@ var recordGet = ({ client, log }) => ({
|
|
|
9779
9971
|
});
|
|
9780
9972
|
var record_get_default = recordGet;
|
|
9781
9973
|
|
|
9782
|
-
// src/tools/
|
|
9974
|
+
// src/tools/record_batch_get.ts
|
|
9783
9975
|
var import_zod4 = require("zod");
|
|
9976
|
+
var MAX_PAYLOAD_CHARS2 = 32e3;
|
|
9977
|
+
var MCP_MAX_IDS = 100;
|
|
9784
9978
|
var inputSchema4 = {
|
|
9785
|
-
|
|
9786
|
-
|
|
9979
|
+
ids: import_zod4.z.array(import_zod4.z.string()).min(1).max(MCP_MAX_IDS).describe(
|
|
9980
|
+
`Record ids to fetch in one call (1-${MCP_MAX_IDS}). Any id you cannot access \u2014 nonexistent, wrong account, or outside your token's scope \u2014 is silently omitted from the response (no per-id existence signal); compare against the response's \`missingIds\` to see which requested ids came back empty.`
|
|
9981
|
+
)
|
|
9982
|
+
};
|
|
9983
|
+
var recordBatchGet = ({ client, log }) => ({
|
|
9984
|
+
name: "record_batch_get",
|
|
9985
|
+
title: "Get multiple records by id in one call",
|
|
9986
|
+
description: "Fetch several structured records by id in a single call (1-100 ids), each with its full payload \u2014 the same hydration record_get gives a single id. Use this instead of N record_get calls when you already hold several ids (e.g. a page of record_query/hybrid_search results). Any id you can't access is silently omitted from `data`; the response also returns `missingIds` \u2014 every requested id not present in `data` \u2014 so you can tell a partial result from a complete one. As with record_get, an oversized payload is truncated into a labelled `payloadPreview` rather than shipped whole.",
|
|
9987
|
+
inputSchema: inputSchema4,
|
|
9988
|
+
handler: async (args) => {
|
|
9989
|
+
const ids = args.ids;
|
|
9990
|
+
try {
|
|
9991
|
+
const response = await client.records.batchGetRecords({ ids });
|
|
9992
|
+
const records = response.data ?? [];
|
|
9993
|
+
const data = records.map((record) => {
|
|
9994
|
+
const item = { ...record };
|
|
9995
|
+
if (record.payload !== void 0) {
|
|
9996
|
+
const json = JSON.stringify(record.payload);
|
|
9997
|
+
if (json.length > MAX_PAYLOAD_CHARS2) {
|
|
9998
|
+
delete item.payload;
|
|
9999
|
+
item.payloadPreview = json.slice(0, MAX_PAYLOAD_CHARS2);
|
|
10000
|
+
item.payloadTruncated = true;
|
|
10001
|
+
item.payloadTotalChars = json.length;
|
|
10002
|
+
}
|
|
10003
|
+
}
|
|
10004
|
+
return item;
|
|
10005
|
+
});
|
|
10006
|
+
const returnedIds = new Set(records.map((r) => r.id));
|
|
10007
|
+
const missingIds = ids.filter((id) => !returnedIds.has(id));
|
|
10008
|
+
log.debug(
|
|
10009
|
+
{ tool: "record_batch_get", requested: ids.length, returned: data.length, missing: missingIds.length },
|
|
10010
|
+
"record_batch_get ok"
|
|
10011
|
+
);
|
|
10012
|
+
return { content: [{ type: "text", text: JSON.stringify({ data, missingIds }, null, 2) }] };
|
|
10013
|
+
} catch (err) {
|
|
10014
|
+
log.warn({ tool: "record_batch_get", idsCount: ids?.length, err: String(err) }, "record_batch_get failed");
|
|
10015
|
+
return toolError("record_batch_get", err);
|
|
10016
|
+
}
|
|
10017
|
+
}
|
|
10018
|
+
});
|
|
10019
|
+
var record_batch_get_default = recordBatchGet;
|
|
10020
|
+
|
|
10021
|
+
// src/tools/record_create.ts
|
|
10022
|
+
var import_zod5 = require("zod");
|
|
10023
|
+
var inputSchema5 = {
|
|
10024
|
+
type: import_zod5.z.string().min(1, "type is required").describe('Record type / schema name (e.g. "task"). Must match an existing schema \u2014 see list_schemas.'),
|
|
10025
|
+
fields: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.unknown()).describe(
|
|
9787
10026
|
"The record payload \u2014 a JSON object of field\u2192value, validated against the type schema. Call list_schemas to learn required fields, types, and enum values. Every number must fall within the signed 64-bit range (a value outside it, or with >38 significant digits, is refused with a 400 naming the field) \u2014 send a larger whole number (e.g. a big external id) as a STRING, which stores it exactly and supports exact-match lookup."
|
|
9788
10027
|
),
|
|
9789
|
-
externalId:
|
|
10028
|
+
externalId: import_zod5.z.string().optional().describe(
|
|
9790
10029
|
"Stable caller-supplied id. Immutable; unique per type. Re-creating with the same externalId returns the existing record (idempotent) \u2014 use it to make creates safely retryable."
|
|
9791
10030
|
),
|
|
9792
|
-
indexMode:
|
|
10031
|
+
indexMode: import_zod5.z.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
|
|
9793
10032
|
"Search-index strategy for this record, set at create only (immutable after). HYBRID (BM25 + dense), SEMANTIC (dense only), TEXT (BM25 only), NONE (store-only \u2014 never appears in hybrid_search/rag_ask; still retrievable by id and structured-field lookup). Omit to inherit the type schema's default; if the schema default is NONE and you want this record searchable, set it here \u2014 it cannot be changed later."
|
|
9794
10033
|
),
|
|
9795
|
-
status:
|
|
9796
|
-
folderId:
|
|
9797
|
-
userId:
|
|
9798
|
-
scopes:
|
|
9799
|
-
'Scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]). `org` and `client` are
|
|
10034
|
+
status: import_zod5.z.string().optional().describe("Record lifecycle status. Defaults to ACTIVE server-side."),
|
|
10035
|
+
folderId: import_zod5.z.string().optional().describe("Group this record into a folder."),
|
|
10036
|
+
userId: import_zod5.z.string().optional().describe("Owning user id."),
|
|
10037
|
+
scopes: import_zod5.z.array(import_zod5.z.string()).optional().describe(
|
|
10038
|
+
'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 values must come from the credential\'s own identity. An empty array `[]` creates a PRIVATE record owned by the calling user alone. Omit to stamp the credential\'s full identity \u2014 the default.'
|
|
9800
10039
|
)
|
|
9801
10040
|
};
|
|
9802
10041
|
var recordCreate = ({ client, log }) => ({
|
|
9803
10042
|
name: "record_create",
|
|
9804
10043
|
title: "Create a record",
|
|
9805
10044
|
description: "Create a structured record of a given type. Provide `type` and `fields` (the payload, validated against the type schema \u2014 call list_schemas first to learn required fields and enums). Idempotent by `externalId`. Requires the key to allow records:c (and records:r to receive the existing record on a collision).",
|
|
9806
|
-
inputSchema:
|
|
10045
|
+
inputSchema: inputSchema5,
|
|
9807
10046
|
handler: async (args) => {
|
|
9808
10047
|
const type = args.type;
|
|
9809
10048
|
try {
|
|
@@ -9830,18 +10069,18 @@ var recordCreate = ({ client, log }) => ({
|
|
|
9830
10069
|
var record_create_default = recordCreate;
|
|
9831
10070
|
|
|
9832
10071
|
// src/tools/record_update.ts
|
|
9833
|
-
var
|
|
9834
|
-
var
|
|
9835
|
-
id:
|
|
9836
|
-
externalId:
|
|
10072
|
+
var import_zod6 = require("zod");
|
|
10073
|
+
var inputSchema6 = {
|
|
10074
|
+
id: import_zod6.z.string().optional().describe("The Vectros record id to update. Provide this OR externalId+type."),
|
|
10075
|
+
externalId: import_zod6.z.string().optional().describe(
|
|
9837
10076
|
"Your caller-owned externalId \u2014 an alternative selector to `id` (requires `type`). Updates the record you created under that externalId without a manual record_query lookup first."
|
|
9838
10077
|
),
|
|
9839
|
-
type:
|
|
9840
|
-
fields:
|
|
10078
|
+
type: import_zod6.z.string().optional().describe("Record type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
10079
|
+
fields: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.unknown()).describe(
|
|
9841
10080
|
"Field\u2192value changes DEEP-MERGED into the existing payload: keys you send overwrite (recursing into nested objects), a key set to `null` is deleted, and unspecified fields are preserved."
|
|
9842
10081
|
),
|
|
9843
|
-
status:
|
|
9844
|
-
expectedVersion:
|
|
10082
|
+
status: import_zod6.z.string().optional().describe("Set the record lifecycle status (e.g. ARCHIVED) \u2014 archive/workflow without physical deletion."),
|
|
10083
|
+
expectedVersion: import_zod6.z.number().int().optional().describe(
|
|
9845
10084
|
"Optimistic concurrency: the version you last read. If the record changed since, the update is refused as a conflict (re-read and retry). Omit for last-write-wins."
|
|
9846
10085
|
)
|
|
9847
10086
|
};
|
|
@@ -9849,7 +10088,7 @@ var recordUpdate = ({ client, log }) => ({
|
|
|
9849
10088
|
name: "record_update",
|
|
9850
10089
|
title: "Update a record by id or externalId",
|
|
9851
10090
|
description: "Update a record \u2014 select it by its Vectros `id` OR by your own `externalId` + `type` (the same key you passed to record_create, resolved for you). The provided `fields` are DEEP-MERGED into the existing payload (unspecified fields are preserved; a field set to `null` is deleted). Pass `expectedVersion` (the version you last read) for safe concurrent edits \u2014 a stale update is refused (409). Use `status` to archive without deleting. Requires the key to allow records:u.",
|
|
9852
|
-
inputSchema:
|
|
10091
|
+
inputSchema: inputSchema6,
|
|
9853
10092
|
handler: async (args) => {
|
|
9854
10093
|
const id = args.id;
|
|
9855
10094
|
const externalId = args.externalId;
|
|
@@ -9875,15 +10114,15 @@ var recordUpdate = ({ client, log }) => ({
|
|
|
9875
10114
|
var record_update_default = recordUpdate;
|
|
9876
10115
|
|
|
9877
10116
|
// src/tools/record_delete.ts
|
|
9878
|
-
var
|
|
9879
|
-
var
|
|
9880
|
-
id:
|
|
10117
|
+
var import_zod7 = require("zod");
|
|
10118
|
+
var inputSchema7 = {
|
|
10119
|
+
id: import_zod7.z.string().min(1, "id is required").describe("The Vectros record id to delete.")
|
|
9881
10120
|
};
|
|
9882
10121
|
var recordDelete = ({ client, log }) => ({
|
|
9883
10122
|
name: "record_delete",
|
|
9884
10123
|
title: "Delete a record",
|
|
9885
10124
|
description: "Permanently delete a record by id (leaves a tombstone). Requires the key to allow records:d \u2014 a key without it gets a permission error. To archive without deleting, use record_update to set status instead.",
|
|
9886
|
-
inputSchema:
|
|
10125
|
+
inputSchema: inputSchema7,
|
|
9887
10126
|
handler: async (args) => {
|
|
9888
10127
|
const id = args.id;
|
|
9889
10128
|
try {
|
|
@@ -9899,48 +10138,48 @@ var recordDelete = ({ client, log }) => ({
|
|
|
9899
10138
|
var record_delete_default = recordDelete;
|
|
9900
10139
|
|
|
9901
10140
|
// src/tools/rag_ask.ts
|
|
9902
|
-
var
|
|
10141
|
+
var import_zod8 = require("zod");
|
|
9903
10142
|
var SEARCH_MCP_DEFAULT_LIMIT = 5;
|
|
9904
10143
|
var SEARCH_MCP_MAX_LIMIT = 50;
|
|
9905
|
-
var
|
|
9906
|
-
query:
|
|
9907
|
-
instructions:
|
|
10144
|
+
var inputSchema8 = {
|
|
10145
|
+
query: import_zod8.z.string().min(1, "query must be non-empty").describe("Question to ground against retrieved content."),
|
|
10146
|
+
instructions: import_zod8.z.string().optional().describe(
|
|
9908
10147
|
'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.'
|
|
9909
10148
|
),
|
|
9910
|
-
model:
|
|
10149
|
+
model: import_zod8.z.string().optional().describe(
|
|
9911
10150
|
"Inference model alias (e.g. claude-haiku-4-5, claude-sonnet-5, claude-opus-4-8). Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach."
|
|
9912
10151
|
),
|
|
9913
|
-
search:
|
|
9914
|
-
mode:
|
|
9915
|
-
limit:
|
|
10152
|
+
search: import_zod8.z.object({
|
|
10153
|
+
mode: import_zod8.z.enum(["HYBRID", "TEXT", "SEMANTIC"]).optional().describe("Retrieval mode. Default HYBRID."),
|
|
10154
|
+
limit: import_zod8.z.number().int().min(1).max(SEARCH_MCP_MAX_LIMIT).optional().describe(
|
|
9916
10155
|
`Passages to retrieve before generating (the grounding-corpus size). Default ${SEARCH_MCP_DEFAULT_LIMIT}; raise up to ${SEARCH_MCP_MAX_LIMIT} (the RAG search API max) for a broader corpus when the extra grounding is worth the larger prompt.`
|
|
9917
10156
|
),
|
|
9918
10157
|
// Retrieval scoping — parity with hybrid_search so an agent can ground the
|
|
9919
10158
|
// answer on a specific owner / folder / type / metadata subset, not just the
|
|
9920
10159
|
// whole-tenant corpus.
|
|
9921
|
-
userId:
|
|
9922
|
-
scope:
|
|
9923
|
-
'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
|
|
10160
|
+
userId: import_zod8.z.string().optional().describe("Restrict retrieval to content owned by this user (Vectros UUID)."),
|
|
10161
|
+
scope: import_zod8.z.string().optional().describe(
|
|
10162
|
+
'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.'
|
|
9924
10163
|
),
|
|
9925
|
-
folderId:
|
|
9926
|
-
rootFolderId:
|
|
9927
|
-
typeName:
|
|
9928
|
-
contentTypes:
|
|
9929
|
-
filters:
|
|
10164
|
+
folderId: import_zod8.z.string().optional().describe("Restrict retrieval to this exact folder."),
|
|
10165
|
+
rootFolderId: import_zod8.z.string().optional().describe("Restrict retrieval to this folder and all its descendants."),
|
|
10166
|
+
typeName: import_zod8.z.string().optional().describe("Restrict record retrieval to this schema type."),
|
|
10167
|
+
contentTypes: import_zod8.z.array(import_zod8.z.enum(["documents", "records"])).optional().describe('Narrow retrieval to content types. ["documents"] or ["records"]; omit for both.'),
|
|
10168
|
+
filters: import_zod8.z.record(import_zod8.z.unknown()).optional().describe(
|
|
9930
10169
|
'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"}.'
|
|
9931
10170
|
),
|
|
9932
|
-
createdAfter:
|
|
9933
|
-
createdBefore:
|
|
9934
|
-
requireComplete:
|
|
10171
|
+
createdAfter: import_zod8.z.string().optional().describe("Restrict to content created at/after this ISO 8601 UTC timestamp."),
|
|
10172
|
+
createdBefore: import_zod8.z.string().optional().describe("Restrict to content created at/before this ISO 8601 UTC timestamp."),
|
|
10173
|
+
requireComplete: import_zod8.z.boolean().optional().describe("Fail closed (503) on a degraded search backend instead of grounding on partial results. Default false.")
|
|
9935
10174
|
}).optional().describe("Retrieval params + scoping. Default mode HYBRID, limit " + SEARCH_MCP_DEFAULT_LIMIT + "."),
|
|
9936
|
-
maxTokens:
|
|
9937
|
-
temperature:
|
|
10175
|
+
maxTokens: import_zod8.z.number().int().min(1).optional().describe("Max output tokens."),
|
|
10176
|
+
temperature: import_zod8.z.number().min(0).max(1).optional().describe("Sampling temperature (0.0\u20131.0). Default 0.3 \u2014 lower favors deterministic, retrieval-grounded answers.")
|
|
9938
10177
|
};
|
|
9939
10178
|
var ragAsk = ({ client, log }) => ({
|
|
9940
10179
|
name: "rag_ask",
|
|
9941
10180
|
title: "RAG ask (corpus-wide)",
|
|
9942
10181
|
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, 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. Inference runs in-perimeter against AWS Bedrock \u2014 PHI never leaves the BAA boundary.",
|
|
9943
|
-
inputSchema:
|
|
10182
|
+
inputSchema: inputSchema8,
|
|
9944
10183
|
handler: async (args, extra) => {
|
|
9945
10184
|
try {
|
|
9946
10185
|
const searchArg = args.search ?? {};
|
|
@@ -10016,20 +10255,20 @@ var ragAsk = ({ client, log }) => ({
|
|
|
10016
10255
|
var rag_ask_default = ragAsk;
|
|
10017
10256
|
|
|
10018
10257
|
// src/tools/document_ask.ts
|
|
10019
|
-
var
|
|
10020
|
-
var
|
|
10021
|
-
documentId:
|
|
10022
|
-
prompt:
|
|
10023
|
-
model:
|
|
10258
|
+
var import_zod9 = require("zod");
|
|
10259
|
+
var inputSchema9 = {
|
|
10260
|
+
documentId: import_zod9.z.string().min(1, "documentId is required").describe("ID of the document to ask against."),
|
|
10261
|
+
prompt: import_zod9.z.string().min(1, "prompt is required").describe("Question to ask about the document."),
|
|
10262
|
+
model: import_zod9.z.string().optional().describe(
|
|
10024
10263
|
"Inference model alias. Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach."
|
|
10025
10264
|
),
|
|
10026
|
-
maxTokens:
|
|
10265
|
+
maxTokens: import_zod9.z.number().int().min(1).optional().describe("Max output tokens.")
|
|
10027
10266
|
};
|
|
10028
10267
|
var documentAsk = ({ client, log }) => ({
|
|
10029
10268
|
name: "document_ask",
|
|
10030
10269
|
title: "Document ask (single-document)",
|
|
10031
10270
|
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`. Inference runs in-perimeter against AWS Bedrock \u2014 PHI never leaves the BAA boundary.",
|
|
10032
|
-
inputSchema:
|
|
10271
|
+
inputSchema: inputSchema9,
|
|
10033
10272
|
handler: async (args, extra) => {
|
|
10034
10273
|
try {
|
|
10035
10274
|
const stream = await client.inference.documentAsk({
|
|
@@ -10088,18 +10327,18 @@ var documentAsk = ({ client, log }) => ({
|
|
|
10088
10327
|
var document_ask_default = documentAsk;
|
|
10089
10328
|
|
|
10090
10329
|
// src/tools/list_schemas.ts
|
|
10091
|
-
var
|
|
10092
|
-
var
|
|
10093
|
-
userId:
|
|
10330
|
+
var import_zod10 = require("zod");
|
|
10331
|
+
var inputSchema10 = {
|
|
10332
|
+
userId: import_zod10.z.string().optional().describe(
|
|
10094
10333
|
"Filter to schemas visible to a specific user. Optional; default returns all schemas the credential can see."
|
|
10095
10334
|
),
|
|
10096
|
-
scope:
|
|
10097
|
-
'Filter to schemas carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "group:eng-team"). `org` and `client` are
|
|
10335
|
+
scope: import_zod10.z.string().optional().describe(
|
|
10336
|
+
'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.'
|
|
10098
10337
|
),
|
|
10099
|
-
surface:
|
|
10338
|
+
surface: import_zod10.z.enum(["record", "document", "user", "entity"]).optional().describe(
|
|
10100
10339
|
"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."
|
|
10101
10340
|
),
|
|
10102
|
-
recordType:
|
|
10341
|
+
recordType: import_zod10.z.string().optional().describe(
|
|
10103
10342
|
'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.'
|
|
10104
10343
|
)
|
|
10105
10344
|
};
|
|
@@ -10107,7 +10346,7 @@ var listSchemas = ({ client, log }) => ({
|
|
|
10107
10346
|
name: "list_schemas",
|
|
10108
10347
|
title: "List record schemas",
|
|
10109
10348
|
description: 'List the structured-record schema catalog for your tenant. Each schema describes a record type (e.g. "patient", "clinical_note") \u2014 its fields, lookup-indexed fields, and capabilities. Use this to discover what record types exist before calling `record_query`. Filter with `surface` (record/document/user/entity \u2014 e.g. only document types), `recordType` (resolve one schema by its type name), or `userId`/`scope`; default returns everything the credential can see.',
|
|
10110
|
-
inputSchema:
|
|
10349
|
+
inputSchema: inputSchema10,
|
|
10111
10350
|
handler: async (args) => {
|
|
10112
10351
|
const userId = args.userId;
|
|
10113
10352
|
const scope = args.scope;
|
|
@@ -10133,18 +10372,18 @@ var listSchemas = ({ client, log }) => ({
|
|
|
10133
10372
|
var list_schemas_default = listSchemas;
|
|
10134
10373
|
|
|
10135
10374
|
// src/tools/document_get.ts
|
|
10136
|
-
var
|
|
10375
|
+
var import_zod11 = require("zod");
|
|
10137
10376
|
var MAX_TEXT_CHARS = 32e3;
|
|
10138
|
-
var
|
|
10139
|
-
documentId:
|
|
10140
|
-
externalId:
|
|
10377
|
+
var inputSchema11 = {
|
|
10378
|
+
documentId: import_zod11.z.string().optional().describe("The document ID returned by document_ingest or hybrid_search. Provide this OR externalId+type."),
|
|
10379
|
+
externalId: import_zod11.z.string().optional().describe(
|
|
10141
10380
|
"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."
|
|
10142
10381
|
),
|
|
10143
|
-
type:
|
|
10144
|
-
includeText:
|
|
10382
|
+
type: import_zod11.z.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
10383
|
+
includeText: import_zod11.z.boolean().optional().describe(
|
|
10145
10384
|
"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."
|
|
10146
10385
|
),
|
|
10147
|
-
includeDownloadUrl:
|
|
10386
|
+
includeDownloadUrl: import_zod11.z.boolean().optional().describe(
|
|
10148
10387
|
"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."
|
|
10149
10388
|
)
|
|
10150
10389
|
};
|
|
@@ -10161,7 +10400,7 @@ var documentGet = ({ client, log }) => ({
|
|
|
10161
10400
|
name: "document_get",
|
|
10162
10401
|
title: "Get document metadata (and optionally text)",
|
|
10163
10402
|
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.",
|
|
10164
|
-
inputSchema:
|
|
10403
|
+
inputSchema: inputSchema11,
|
|
10165
10404
|
handler: async (args) => {
|
|
10166
10405
|
const documentId = args.documentId;
|
|
10167
10406
|
const externalId = args.externalId;
|
|
@@ -10226,28 +10465,28 @@ var documentGet = ({ client, log }) => ({
|
|
|
10226
10465
|
var document_get_default = documentGet;
|
|
10227
10466
|
|
|
10228
10467
|
// src/tools/document_query.ts
|
|
10229
|
-
var
|
|
10468
|
+
var import_zod12 = require("zod");
|
|
10230
10469
|
var MCP_DEFAULT_LIMIT3 = 3;
|
|
10231
10470
|
var MCP_MAX_LIMIT3 = 100;
|
|
10232
|
-
var
|
|
10471
|
+
var inputSchema12 = {
|
|
10233
10472
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
10234
|
-
field:
|
|
10235
|
-
value:
|
|
10236
|
-
from:
|
|
10237
|
-
to:
|
|
10238
|
-
prefix:
|
|
10239
|
-
order:
|
|
10473
|
+
field: import_zod12.z.string().optional().describe("Lookup mode: name of the lookup-indexed field to query by."),
|
|
10474
|
+
value: import_zod12.z.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields too."),
|
|
10475
|
+
from: import_zod12.z.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Range-enabled, non-sensitive fields only."),
|
|
10476
|
+
to: import_zod12.z.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
10477
|
+
prefix: import_zod12.z.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
10478
|
+
order: import_zod12.z.enum(["asc", "desc"]).optional().describe(
|
|
10240
10479
|
"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."
|
|
10241
10480
|
),
|
|
10242
|
-
type:
|
|
10481
|
+
type: import_zod12.z.string().optional().describe("Lookup mode: the document type (the bound schema's type). Required with `field`."),
|
|
10243
10482
|
// List-mode args:
|
|
10244
|
-
folderId:
|
|
10245
|
-
userId:
|
|
10246
|
-
scope:
|
|
10247
|
-
'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
|
|
10483
|
+
folderId: import_zod12.z.string().optional().describe("List mode: only documents in this folder (Vectros folder id)."),
|
|
10484
|
+
userId: import_zod12.z.string().optional().describe("List mode: scope to documents owned by this user."),
|
|
10485
|
+
scope: import_zod12.z.string().optional().describe(
|
|
10486
|
+
'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.'
|
|
10248
10487
|
),
|
|
10249
|
-
startFrom:
|
|
10250
|
-
limit:
|
|
10488
|
+
startFrom: import_zod12.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."),
|
|
10489
|
+
limit: import_zod12.z.number().int().min(1).max(MCP_MAX_LIMIT3).optional().describe(
|
|
10251
10490
|
`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.`
|
|
10252
10491
|
)
|
|
10253
10492
|
};
|
|
@@ -10255,7 +10494,7 @@ var documentQuery = ({ client, log }) => ({
|
|
|
10255
10494
|
name: "document_query",
|
|
10256
10495
|
title: "Document query (list or lookup)",
|
|
10257
10496
|
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.",
|
|
10258
|
-
inputSchema:
|
|
10497
|
+
inputSchema: inputSchema12,
|
|
10259
10498
|
handler: async (args) => {
|
|
10260
10499
|
const limit = args.limit ?? MCP_DEFAULT_LIMIT3;
|
|
10261
10500
|
const field = args.field;
|
|
@@ -10335,29 +10574,29 @@ var documentQuery = ({ client, log }) => ({
|
|
|
10335
10574
|
var document_query_default = documentQuery;
|
|
10336
10575
|
|
|
10337
10576
|
// src/tools/document_update.ts
|
|
10338
|
-
var
|
|
10339
|
-
var
|
|
10340
|
-
documentId:
|
|
10341
|
-
externalId:
|
|
10577
|
+
var import_zod13 = require("zod");
|
|
10578
|
+
var inputSchema13 = {
|
|
10579
|
+
documentId: import_zod13.z.string().optional().describe("The Vectros document id to update. Provide this OR externalId+type."),
|
|
10580
|
+
externalId: import_zod13.z.string().optional().describe(
|
|
10342
10581
|
"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."
|
|
10343
10582
|
),
|
|
10344
|
-
type:
|
|
10345
|
-
title:
|
|
10346
|
-
fields:
|
|
10583
|
+
type: import_zod13.z.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
10584
|
+
title: import_zod13.z.string().optional().describe("New title. Omit to keep the current title."),
|
|
10585
|
+
fields: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.unknown()).optional().describe(
|
|
10347
10586
|
"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."
|
|
10348
10587
|
),
|
|
10349
|
-
text:
|
|
10588
|
+
text: import_zod13.z.string().optional().describe(
|
|
10350
10589
|
"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."
|
|
10351
10590
|
),
|
|
10352
|
-
folderId:
|
|
10353
|
-
status:
|
|
10591
|
+
folderId: import_zod13.z.string().optional().describe("Move the document into this folder (cannot be cleared once set)."),
|
|
10592
|
+
status: import_zod13.z.enum(["ACTIVE", "ARCHIVED"]).optional().describe(
|
|
10354
10593
|
"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."
|
|
10355
10594
|
),
|
|
10356
|
-
userId:
|
|
10357
|
-
scopes:
|
|
10358
|
-
'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
|
|
10595
|
+
userId: import_zod13.z.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
10596
|
+
scopes: import_zod13.z.array(import_zod13.z.string()).optional().describe(
|
|
10597
|
+
'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).'
|
|
10359
10598
|
),
|
|
10360
|
-
expectedVersion:
|
|
10599
|
+
expectedVersion: import_zod13.z.number().int().optional().describe(
|
|
10361
10600
|
"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."
|
|
10362
10601
|
)
|
|
10363
10602
|
};
|
|
@@ -10365,7 +10604,7 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
10365
10604
|
name: "document_update",
|
|
10366
10605
|
title: "Update a document",
|
|
10367
10606
|
description: 'Update a document \u2014 select it by its Vectros `documentId` OR by your own `externalId` + `type` (resolved for you). `fields` are DEEP-MERGED into the existing typed payload (unspecified fields preserved; a field set to `null` is deleted); title/folderId/status/ownership are updated when provided and preserved otherwise. Supply `text` to re-ingest and re-index the document body in place (text documents only). Set `status: "ARCHIVED"` to soft-retract a document (pulled from search, kept and recoverable) and `status: "ACTIVE"` to restore it. Pass `expectedVersion` (the version you last read) for safe concurrent edits \u2014 a stale update is refused (409). Requires the key to allow documents:u.',
|
|
10368
|
-
inputSchema:
|
|
10607
|
+
inputSchema: inputSchema13,
|
|
10369
10608
|
handler: async (args) => {
|
|
10370
10609
|
const documentId = args.documentId;
|
|
10371
10610
|
const externalId = args.externalId;
|
|
@@ -10405,15 +10644,15 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
10405
10644
|
var document_update_default = documentUpdate;
|
|
10406
10645
|
|
|
10407
10646
|
// src/tools/document_delete.ts
|
|
10408
|
-
var
|
|
10409
|
-
var
|
|
10410
|
-
documentId:
|
|
10647
|
+
var import_zod14 = require("zod");
|
|
10648
|
+
var inputSchema14 = {
|
|
10649
|
+
documentId: import_zod14.z.string().min(1, "documentId is required").describe("The Vectros document id to delete.")
|
|
10411
10650
|
};
|
|
10412
10651
|
var documentDelete = ({ client, log }) => ({
|
|
10413
10652
|
name: "document_delete",
|
|
10414
10653
|
title: "Delete a document",
|
|
10415
10654
|
description: 'Permanently delete a document by id (removes it and its indexed content). Requires the key to allow documents:d \u2014 a key without it gets a permission error. To archive without deleting, use document_update to set status: "ARCHIVED" instead (recoverable, and needs no delete authority).',
|
|
10416
|
-
inputSchema:
|
|
10655
|
+
inputSchema: inputSchema14,
|
|
10417
10656
|
handler: async (args) => {
|
|
10418
10657
|
const documentId = args.documentId;
|
|
10419
10658
|
try {
|
|
@@ -10431,18 +10670,18 @@ var documentDelete = ({ client, log }) => ({
|
|
|
10431
10670
|
var document_delete_default = documentDelete;
|
|
10432
10671
|
|
|
10433
10672
|
// src/tools/folder_query.ts
|
|
10434
|
-
var
|
|
10673
|
+
var import_zod15 = require("zod");
|
|
10435
10674
|
var MCP_DEFAULT_LIMIT4 = 10;
|
|
10436
10675
|
var MCP_MAX_LIMIT4 = 100;
|
|
10437
|
-
var
|
|
10438
|
-
id:
|
|
10439
|
-
parentId:
|
|
10440
|
-
userId:
|
|
10441
|
-
scope:
|
|
10442
|
-
'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
|
|
10676
|
+
var inputSchema15 = {
|
|
10677
|
+
id: import_zod15.z.string().optional().describe("Get mode: fetch this single folder by id."),
|
|
10678
|
+
parentId: import_zod15.z.string().optional().describe("List mode: direct children of this folder (tree navigation). Omit for a flat tenant list."),
|
|
10679
|
+
userId: import_zod15.z.string().optional().describe("List mode: scope to folders owned by this user."),
|
|
10680
|
+
scope: import_zod15.z.string().optional().describe(
|
|
10681
|
+
'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.'
|
|
10443
10682
|
),
|
|
10444
|
-
startFrom:
|
|
10445
|
-
limit:
|
|
10683
|
+
startFrom: import_zod15.z.string().optional().describe("List mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
10684
|
+
limit: import_zod15.z.number().int().min(1).max(MCP_MAX_LIMIT4).optional().describe(
|
|
10446
10685
|
`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\`.`
|
|
10447
10686
|
)
|
|
10448
10687
|
};
|
|
@@ -10450,7 +10689,7 @@ var folderQuery = ({ client, log }) => ({
|
|
|
10450
10689
|
name: "folder_query",
|
|
10451
10690
|
title: "Folder query (list or get)",
|
|
10452
10691
|
description: "Read folders. Two modes:\n \u2022 Get: pass `id` \u2192 returns the single folder.\n \u2022 List: omit `id`; pass `parentId` for a folder's direct children (tree navigation) or omit for a flat tenant list. Optionally filter by `userId` or `scope` (`namespace:value`).\nList mode returns `{ data, nextCursor }` (default 10, max 100 per page \u2014 raise it in one call when you can accept the larger page); a non-null `nextCursor` means more remain \u2014 pass it back as `startFrom` to page through all folders. Get mode returns the single folder object.",
|
|
10453
|
-
inputSchema:
|
|
10692
|
+
inputSchema: inputSchema15,
|
|
10454
10693
|
handler: async (args) => {
|
|
10455
10694
|
const id = args.id;
|
|
10456
10695
|
try {
|
|
@@ -10480,22 +10719,22 @@ var folderQuery = ({ client, log }) => ({
|
|
|
10480
10719
|
var folder_query_default = folderQuery;
|
|
10481
10720
|
|
|
10482
10721
|
// src/tools/folder_create.ts
|
|
10483
|
-
var
|
|
10484
|
-
var
|
|
10485
|
-
name:
|
|
10486
|
-
description:
|
|
10487
|
-
parentId:
|
|
10488
|
-
slug:
|
|
10489
|
-
userId:
|
|
10490
|
-
scopes:
|
|
10491
|
-
'Scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]). `org` and `client` are
|
|
10722
|
+
var import_zod16 = require("zod");
|
|
10723
|
+
var inputSchema16 = {
|
|
10724
|
+
name: import_zod16.z.string().min(1, "name is required").describe("Folder display name."),
|
|
10725
|
+
description: import_zod16.z.string().optional().describe("Optional description of the folder's purpose."),
|
|
10726
|
+
parentId: import_zod16.z.string().optional().describe("Parent folder id \u2014 places the folder under this parent. Omit for the context default root. Create-only."),
|
|
10727
|
+
slug: import_zod16.z.string().optional().describe("Optional stable slug (sibling-unique; idempotency key). Lowercase letters/digits/hyphens. Derived from name when omitted."),
|
|
10728
|
+
userId: import_zod16.z.string().optional().describe("Owning user (Vectros UUID)."),
|
|
10729
|
+
scopes: import_zod16.z.array(import_zod16.z.string()).optional().describe(
|
|
10730
|
+
'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.'
|
|
10492
10731
|
)
|
|
10493
10732
|
};
|
|
10494
10733
|
var folderCreate = ({ client, log }) => ({
|
|
10495
10734
|
name: "folder_create",
|
|
10496
10735
|
title: "Create a folder",
|
|
10497
10736
|
description: "Create a folder to organize documents and records. Pass `parentId` to nest it (create-only \u2014 folders cannot be moved later). Idempotent by `slug` within the parent. Requires the key to allow folders:c (and folders:r to receive the existing folder on a collision).",
|
|
10498
|
-
inputSchema:
|
|
10737
|
+
inputSchema: inputSchema16,
|
|
10499
10738
|
handler: async (args) => {
|
|
10500
10739
|
try {
|
|
10501
10740
|
const folder = await client.folders.createFolder({
|
|
@@ -10519,16 +10758,16 @@ var folderCreate = ({ client, log }) => ({
|
|
|
10519
10758
|
var folder_create_default = folderCreate;
|
|
10520
10759
|
|
|
10521
10760
|
// src/tools/folder_update.ts
|
|
10522
|
-
var
|
|
10523
|
-
var
|
|
10524
|
-
id:
|
|
10525
|
-
name:
|
|
10526
|
-
description:
|
|
10527
|
-
userId:
|
|
10528
|
-
scopes:
|
|
10529
|
-
'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
|
|
10761
|
+
var import_zod17 = require("zod");
|
|
10762
|
+
var inputSchema17 = {
|
|
10763
|
+
id: import_zod17.z.string().min(1, "id is required").describe("The Vectros folder id to update."),
|
|
10764
|
+
name: import_zod17.z.string().optional().describe("New folder name. Omit to keep the current name."),
|
|
10765
|
+
description: import_zod17.z.string().optional().describe("New description. Omit to leave unchanged."),
|
|
10766
|
+
userId: import_zod17.z.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
10767
|
+
scopes: import_zod17.z.array(import_zod17.z.string()).optional().describe(
|
|
10768
|
+
'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).'
|
|
10530
10769
|
),
|
|
10531
|
-
expectedVersion:
|
|
10770
|
+
expectedVersion: import_zod17.z.number().int().optional().describe(
|
|
10532
10771
|
"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."
|
|
10533
10772
|
)
|
|
10534
10773
|
};
|
|
@@ -10536,7 +10775,7 @@ var folderUpdate = ({ client, log }) => ({
|
|
|
10536
10775
|
name: "folder_update",
|
|
10537
10776
|
title: "Update a folder",
|
|
10538
10777
|
description: "Update a folder's name / description / ownership by id (RFC-7386 merge \u2014 omitted fields preserved). Pass `expectedVersion` (the version you last read) for safe concurrent edits \u2014 a stale update is refused (409). Folders cannot be moved (re-parenting is not supported by the API). Requires the key to allow folders:u.",
|
|
10539
|
-
inputSchema:
|
|
10778
|
+
inputSchema: inputSchema17,
|
|
10540
10779
|
handler: async (args) => {
|
|
10541
10780
|
const id = args.id;
|
|
10542
10781
|
const name = args.name;
|
|
@@ -10563,15 +10802,15 @@ var folderUpdate = ({ client, log }) => ({
|
|
|
10563
10802
|
var folder_update_default = folderUpdate;
|
|
10564
10803
|
|
|
10565
10804
|
// src/tools/folder_delete.ts
|
|
10566
|
-
var
|
|
10567
|
-
var
|
|
10568
|
-
id:
|
|
10805
|
+
var import_zod18 = require("zod");
|
|
10806
|
+
var inputSchema18 = {
|
|
10807
|
+
id: import_zod18.z.string().min(1, "id is required").describe("The Vectros folder id to delete.")
|
|
10569
10808
|
};
|
|
10570
10809
|
var folderDelete = ({ client, log }) => ({
|
|
10571
10810
|
name: "folder_delete",
|
|
10572
10811
|
title: "Delete a folder",
|
|
10573
10812
|
description: "Permanently delete a folder by id. 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.",
|
|
10574
|
-
inputSchema:
|
|
10813
|
+
inputSchema: inputSchema18,
|
|
10575
10814
|
handler: async (args) => {
|
|
10576
10815
|
const id = args.id;
|
|
10577
10816
|
try {
|
|
@@ -10587,14 +10826,14 @@ var folderDelete = ({ client, log }) => ({
|
|
|
10587
10826
|
var folder_delete_default = folderDelete;
|
|
10588
10827
|
|
|
10589
10828
|
// src/tools/current_identity.ts
|
|
10590
|
-
var
|
|
10829
|
+
var inputSchema19 = {
|
|
10591
10830
|
// No args — current_identity describes the current credential.
|
|
10592
10831
|
};
|
|
10593
10832
|
var currentIdentity = ({ log, apiKey, environment }) => ({
|
|
10594
10833
|
name: "current_identity",
|
|
10595
10834
|
title: "Current identity (tenant + principal scope)",
|
|
10596
|
-
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 reach as { userId, scopes[] }, where each scope is a `namespace:value` string (e.g. \"org:<uuid>\"). 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.",
|
|
10597
|
-
inputSchema:
|
|
10835
|
+
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 yet include granted_capabilities (member-lifecycle / forensic-read / context-directory-read / delegate-mint) \u2014 a separate reach dimension a scope clause can carry as of API 0.40.0 that /v1/ping does not report yet, 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.",
|
|
10836
|
+
inputSchema: inputSchema19,
|
|
10598
10837
|
handler: async () => {
|
|
10599
10838
|
try {
|
|
10600
10839
|
const identity = await resolveIdentity({ log, apiKey, environment });
|
|
@@ -10610,7 +10849,7 @@ var currentIdentity = ({ log, apiKey, environment }) => ({
|
|
|
10610
10849
|
var current_identity_default = currentIdentity;
|
|
10611
10850
|
|
|
10612
10851
|
// src/tools/document_ingest.ts
|
|
10613
|
-
var
|
|
10852
|
+
var import_zod19 = require("zod");
|
|
10614
10853
|
var import_promises = require("fs/promises");
|
|
10615
10854
|
var import_node_path = require("path");
|
|
10616
10855
|
var IngestPathError = class extends Error {
|
|
@@ -10685,45 +10924,45 @@ function inferMimeType(filePath) {
|
|
|
10685
10924
|
const ext = (0, import_node_path.extname)(filePath).toLowerCase();
|
|
10686
10925
|
return EXT_TO_MIME[ext] ?? "application/octet-stream";
|
|
10687
10926
|
}
|
|
10688
|
-
var
|
|
10689
|
-
title:
|
|
10690
|
-
indexMode:
|
|
10927
|
+
var inputSchema20 = {
|
|
10928
|
+
title: import_zod19.z.string().min(1, "title is required").describe("Human-readable document title \u2014 appears in search results and the UI."),
|
|
10929
|
+
indexMode: import_zod19.z.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
|
|
10691
10930
|
"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."
|
|
10692
10931
|
),
|
|
10693
|
-
externalId:
|
|
10932
|
+
externalId: import_zod19.z.string().optional().describe(
|
|
10694
10933
|
'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.'
|
|
10695
10934
|
),
|
|
10696
|
-
upsert:
|
|
10935
|
+
upsert: import_zod19.z.boolean().optional().describe(
|
|
10697
10936
|
"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, so omitting schemaId resolves in the untyped namespace and mints a duplicate instead of updating. The response `created` flag confirms which happened (created:true = a new document was minted)."
|
|
10698
10937
|
),
|
|
10699
|
-
schemaId:
|
|
10938
|
+
schemaId: import_zod19.z.string().optional().describe(
|
|
10700
10939
|
"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."
|
|
10701
10940
|
),
|
|
10702
|
-
payload:
|
|
10941
|
+
payload: import_zod19.z.record(import_zod19.z.string(), import_zod19.z.unknown()).optional().describe(
|
|
10703
10942
|
"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."
|
|
10704
10943
|
),
|
|
10705
10944
|
// Inline text mode (mutually exclusive with filePath):
|
|
10706
|
-
text:
|
|
10707
|
-
storeText:
|
|
10945
|
+
text: import_zod19.z.string().min(1).optional().describe("Text body to ingest inline. Mutually exclusive with filePath. Either text or filePath is required."),
|
|
10946
|
+
storeText: import_zod19.z.boolean().optional().describe(
|
|
10708
10947
|
"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."
|
|
10709
10948
|
),
|
|
10710
10949
|
// File upload mode (mutually exclusive with text; stdio-transport-only):
|
|
10711
|
-
filePath:
|
|
10950
|
+
filePath: import_zod19.z.string().min(1).optional().describe(
|
|
10712
10951
|
"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."
|
|
10713
10952
|
),
|
|
10714
|
-
fileType:
|
|
10953
|
+
fileType: import_zod19.z.string().optional().describe('MIME type of the file (e.g. "application/pdf"). Inferred from filePath extension if omitted.'),
|
|
10715
10954
|
// Common (both modes):
|
|
10716
|
-
folderId:
|
|
10717
|
-
userId:
|
|
10718
|
-
scopes:
|
|
10719
|
-
"TEXT MODE ONLY. Scope ownership as `namespace:value` entries, at most 2 (e.g. [\"org:<uuid>\", \"group:eng-team\"]). `org` and `client` are
|
|
10955
|
+
folderId: import_zod19.z.string().optional().describe("Optional folder to ingest into. Default: tenant root."),
|
|
10956
|
+
userId: import_zod19.z.string().optional().describe("Owning user ID. Optional."),
|
|
10957
|
+
scopes: import_zod19.z.array(import_zod19.z.string()).optional().describe(
|
|
10958
|
+
"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."
|
|
10720
10959
|
)
|
|
10721
10960
|
};
|
|
10722
10961
|
var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
10723
10962
|
name: "document_ingest",
|
|
10724
10963
|
title: "Ingest a new document (text body or file upload)",
|
|
10725
10964
|
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 with `document_get` until indexStatus is INDEXED.\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). 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). 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`.",
|
|
10726
|
-
inputSchema:
|
|
10965
|
+
inputSchema: inputSchema20,
|
|
10727
10966
|
handler: async (args) => {
|
|
10728
10967
|
const title = args.title;
|
|
10729
10968
|
const text = args.text;
|
|
@@ -10875,39 +11114,43 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
10875
11114
|
var document_ingest_default = documentIngest;
|
|
10876
11115
|
|
|
10877
11116
|
// src/tools/lookup_principal.ts
|
|
10878
|
-
var
|
|
11117
|
+
var import_zod20 = require("zod");
|
|
10879
11118
|
var MCP_DEFAULT_LIMIT5 = 10;
|
|
10880
11119
|
var MCP_MAX_LIMIT5 = 100;
|
|
10881
|
-
var
|
|
10882
|
-
kind:
|
|
10883
|
-
'Which principal to look up: "user" (the fixed principal surface), or an entity namespace \u2014 "org", "client" (
|
|
11120
|
+
var inputSchema21 = {
|
|
11121
|
+
kind: import_zod20.z.string().describe(
|
|
11122
|
+
'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.'
|
|
10884
11123
|
),
|
|
10885
|
-
externalId:
|
|
11124
|
+
externalId: import_zod20.z.string().optional().describe(
|
|
10886
11125
|
"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."
|
|
10887
11126
|
),
|
|
11127
|
+
contextId: import_zod20.z.string().optional().describe(
|
|
11128
|
+
"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."
|
|
11129
|
+
),
|
|
10888
11130
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
10889
|
-
type:
|
|
10890
|
-
field:
|
|
10891
|
-
value:
|
|
10892
|
-
from:
|
|
10893
|
-
to:
|
|
10894
|
-
prefix:
|
|
10895
|
-
order:
|
|
10896
|
-
startFrom:
|
|
10897
|
-
limit:
|
|
11131
|
+
type: import_zod20.z.string().optional().describe('Lookup mode: the identity schema\'s record type (e.g. "person_v1"). Required with `field`.'),
|
|
11132
|
+
field: import_zod20.z.string().optional().describe('Lookup mode: name of the schema-declared lookup field to query by (e.g. "email").'),
|
|
11133
|
+
value: import_zod20.z.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields."),
|
|
11134
|
+
from: import_zod20.z.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Non-sensitive fields only."),
|
|
11135
|
+
to: import_zod20.z.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
11136
|
+
prefix: import_zod20.z.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
11137
|
+
order: import_zod20.z.enum(["asc", "desc"]).optional().describe("Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc`."),
|
|
11138
|
+
startFrom: import_zod20.z.string().optional().describe("Lookup mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
11139
|
+
limit: import_zod20.z.number().int().min(1).max(MCP_MAX_LIMIT5).optional().describe(
|
|
10898
11140
|
`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\`.`
|
|
10899
11141
|
)
|
|
10900
11142
|
};
|
|
10901
11143
|
var lookupPrincipal = ({ client, log }) => ({
|
|
10902
11144
|
name: "lookup_principal",
|
|
10903
11145
|
title: "Look up a user identity or a namespaced identity entity",
|
|
10904
|
-
description: "Resolve a user, or an identity entity in a namespace (org/client/one you registered). Two modes:\n \u2022 Resolve by your own id: pass `externalId` \u2192 the matching principal incl. its Vectros UUID (the id the ownership filters on record_query / hybrid_search / rag_ask expect).\n \u2022 Lookup by a schema field: pass `type` and `field` plus exactly one of `value` (exact), `from`+`to` (range), or `prefix`. Sensitive-field-safe. (If both `externalId` and a `field` lookup are given, `externalId` wins.) Returns a `{ data, nextCursor }` page (default 10, max 100 \u2014 raise it in one call when you can accept the payload); a non-null `nextCursor` means more remain \u2014 pass it back as `startFrom`. Read-only \u2014 does not create or modify identities.",
|
|
10905
|
-
inputSchema:
|
|
11146
|
+
description: "Resolve a user, or an identity entity in a namespace (org/client/one you registered). Two modes:\n \u2022 Resolve by your own id: pass `externalId` \u2192 the matching principal incl. its Vectros UUID (the id the ownership filters on record_query / hybrid_search / rag_ask expect).\n \u2022 Lookup by a schema field: pass `type` and `field` plus exactly one of `value` (exact), `from`+`to` (range), or `prefix`. Sensitive-field-safe. (If both `externalId` and a `field` lookup are given, `externalId` wins.) For an entity kind, `contextId` names a specific app context when the namespace is context-owned rather than tenant-wide; a context-confined credential's own context is used automatically without it. Returns a `{ data, nextCursor }` page (default 10, max 100 \u2014 raise it in one call when you can accept the payload); a non-null `nextCursor` means more remain \u2014 pass it back as `startFrom`. Read-only \u2014 does not create or modify identities.",
|
|
11147
|
+
inputSchema: inputSchema21,
|
|
10906
11148
|
handler: async (args) => {
|
|
10907
11149
|
const kind = args.kind;
|
|
10908
11150
|
const isUser = kind === "user";
|
|
10909
11151
|
const limit = args.limit ?? MCP_DEFAULT_LIMIT5;
|
|
10910
11152
|
const externalId = args.externalId;
|
|
11153
|
+
const contextId = args.contextId;
|
|
10911
11154
|
const type = args.type;
|
|
10912
11155
|
const field = args.field;
|
|
10913
11156
|
const value = args.value;
|
|
@@ -10916,11 +11159,18 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
10916
11159
|
const prefix = args.prefix;
|
|
10917
11160
|
const order = args.order;
|
|
10918
11161
|
const startFrom = args.startFrom;
|
|
11162
|
+
if (contextId !== void 0 && isUser) {
|
|
11163
|
+
return toolError(
|
|
11164
|
+
"lookup_principal",
|
|
11165
|
+
new Error("'contextId' does not apply to kind 'user' \u2014 the user surface is always tenant-wide.")
|
|
11166
|
+
);
|
|
11167
|
+
}
|
|
11168
|
+
const contextIdArg = contextId !== void 0 ? { contextId } : {};
|
|
10919
11169
|
try {
|
|
10920
11170
|
let page;
|
|
10921
11171
|
if (externalId !== void 0) {
|
|
10922
|
-
page = isUser ? await client.identity.listUsers({ externalId, limit }) : await client.identity.listEntities({ namespace: kind, externalId, limit });
|
|
10923
|
-
log.debug({ tool: "lookup_principal", mode: "resolve", kind }, "lookup_principal resolve ok");
|
|
11172
|
+
page = isUser ? await client.identity.listUsers({ externalId, limit }) : await client.identity.listEntities({ namespace: kind, ...contextIdArg, externalId, limit });
|
|
11173
|
+
log.debug({ tool: "lookup_principal", mode: "resolve", kind, contextId }, "lookup_principal resolve ok");
|
|
10924
11174
|
} else if (field !== void 0) {
|
|
10925
11175
|
const hasEquality = value !== void 0;
|
|
10926
11176
|
const hasRange = from !== void 0 || to !== void 0;
|
|
@@ -10948,8 +11198,8 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
10948
11198
|
);
|
|
10949
11199
|
}
|
|
10950
11200
|
const req = { type, field, value, from, to, prefix, order, startFrom, limit };
|
|
10951
|
-
page = isUser ? await client.identity.lookupUsers(req) : await client.identity.lookupEntities({ namespace: kind, body: req });
|
|
10952
|
-
log.debug({ tool: "lookup_principal", mode: "lookup", kind, type, field }, "lookup_principal lookup ok");
|
|
11201
|
+
page = isUser ? await client.identity.lookupUsers(req) : await client.identity.lookupEntities({ namespace: kind, ...contextIdArg, body: req });
|
|
11202
|
+
log.debug({ tool: "lookup_principal", mode: "lookup", kind, type, field, contextId }, "lookup_principal lookup ok");
|
|
10953
11203
|
} else {
|
|
10954
11204
|
return toolError(
|
|
10955
11205
|
"lookup_principal",
|
|
@@ -10960,7 +11210,7 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
10960
11210
|
const nextCursor = page.nextCursor ?? null;
|
|
10961
11211
|
return { content: [{ type: "text", text: JSON.stringify({ data: principals, nextCursor }, null, 2) }] };
|
|
10962
11212
|
} catch (err) {
|
|
10963
|
-
log.warn({ tool: "lookup_principal", kind, err: String(err) }, "lookup_principal failed");
|
|
11213
|
+
log.warn({ tool: "lookup_principal", kind, contextId, err: String(err) }, "lookup_principal failed");
|
|
10964
11214
|
return toolError("lookup_principal", err);
|
|
10965
11215
|
}
|
|
10966
11216
|
}
|
|
@@ -10968,17 +11218,17 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
10968
11218
|
var lookup_principal_default = lookupPrincipal;
|
|
10969
11219
|
|
|
10970
11220
|
// src/tools/version_history.ts
|
|
10971
|
-
var
|
|
10972
|
-
var
|
|
10973
|
-
resourceType:
|
|
10974
|
-
id:
|
|
10975
|
-
startFrom:
|
|
11221
|
+
var import_zod21 = require("zod");
|
|
11222
|
+
var inputSchema22 = {
|
|
11223
|
+
resourceType: import_zod21.z.enum(["record", "document"]).describe("Which kind of entity the id refers to: a record or a document."),
|
|
11224
|
+
id: import_zod21.z.string().min(1, "id is required").describe("The Vectros id of the record or document whose history you want."),
|
|
11225
|
+
startFrom: import_zod21.z.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch older entries.")
|
|
10976
11226
|
};
|
|
10977
11227
|
var versionHistory = ({ client, log }) => ({
|
|
10978
11228
|
name: "version_history",
|
|
10979
11229
|
title: "Version history (record or document)",
|
|
10980
11230
|
description: "Read the audit/version trail (CREATE/UPDATE/DELETE, with actor, timestamp, and diff) for a single record or document. Pass `resourceType` (record|document) and `id`. Returns `{ data, nextCursor }`; pass `nextCursor` back as `startFrom` to page through older entries. Entities without audit history (untyped) return an empty trail. Read-only.",
|
|
10981
|
-
inputSchema:
|
|
11231
|
+
inputSchema: inputSchema22,
|
|
10982
11232
|
handler: async (args) => {
|
|
10983
11233
|
const resourceType = args.resourceType;
|
|
10984
11234
|
const id = args.id;
|
|
@@ -11005,6 +11255,7 @@ var TOOL_NAMES = [
|
|
|
11005
11255
|
"hybrid_search",
|
|
11006
11256
|
"record_query",
|
|
11007
11257
|
"record_get",
|
|
11258
|
+
"record_batch_get",
|
|
11008
11259
|
"record_create",
|
|
11009
11260
|
"record_update",
|
|
11010
11261
|
"record_delete",
|
|
@@ -11030,6 +11281,7 @@ var ALL_TOOL_FACTORIES = {
|
|
|
11030
11281
|
hybrid_search: hybrid_search_default,
|
|
11031
11282
|
record_query: record_query_default,
|
|
11032
11283
|
record_get: record_get_default,
|
|
11284
|
+
record_batch_get: record_batch_get_default,
|
|
11033
11285
|
record_create: record_create_default,
|
|
11034
11286
|
record_update: record_update_default,
|
|
11035
11287
|
record_delete: record_delete_default,
|
|
@@ -11071,7 +11323,7 @@ var identityResource = ({ log, apiKey, environment }) => ({
|
|
|
11071
11323
|
name: "identity",
|
|
11072
11324
|
uri: "vectros://identity",
|
|
11073
11325
|
title: "Current identity (tenant + principal scope)",
|
|
11074
|
-
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[] }),
|
|
11326
|
+
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 yet include granted_capabilities (member-lifecycle / forensic-read / context-directory-read / delegate-mint) \u2014 a separate reach dimension a scope clause can carry as of API 0.40.0 that /v1/ping does not report yet, 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.",
|
|
11075
11327
|
mimeType: "application/json",
|
|
11076
11328
|
read: async () => {
|
|
11077
11329
|
const identity = await resolveIdentity({ log, apiKey, environment });
|
|
@@ -11090,7 +11342,7 @@ var ALL_RESOURCE_FACTORIES = {
|
|
|
11090
11342
|
};
|
|
11091
11343
|
|
|
11092
11344
|
// src/zod-to-json-schema.ts
|
|
11093
|
-
var
|
|
11345
|
+
var import_zod22 = require("zod");
|
|
11094
11346
|
function zodShapeToJsonSchema(shape) {
|
|
11095
11347
|
const properties = {};
|
|
11096
11348
|
const required = [];
|
|
@@ -11105,40 +11357,40 @@ function zodShapeToJsonSchema(shape) {
|
|
|
11105
11357
|
function zodTypeToJsonSchema(schema) {
|
|
11106
11358
|
const description = schema.description;
|
|
11107
11359
|
let current = schema;
|
|
11108
|
-
while (current instanceof
|
|
11360
|
+
while (current instanceof import_zod22.z.ZodOptional || current instanceof import_zod22.z.ZodDefault || current instanceof import_zod22.z.ZodNullable) {
|
|
11109
11361
|
current = current._def.innerType;
|
|
11110
11362
|
}
|
|
11111
11363
|
const base = description ? { description } : {};
|
|
11112
|
-
if (current instanceof
|
|
11364
|
+
if (current instanceof import_zod22.z.ZodString) {
|
|
11113
11365
|
return { ...base, type: "string" };
|
|
11114
11366
|
}
|
|
11115
|
-
if (current instanceof
|
|
11367
|
+
if (current instanceof import_zod22.z.ZodNumber) {
|
|
11116
11368
|
return { ...base, type: "number" };
|
|
11117
11369
|
}
|
|
11118
|
-
if (current instanceof
|
|
11370
|
+
if (current instanceof import_zod22.z.ZodBoolean) {
|
|
11119
11371
|
return { ...base, type: "boolean" };
|
|
11120
11372
|
}
|
|
11121
|
-
if (current instanceof
|
|
11373
|
+
if (current instanceof import_zod22.z.ZodEnum) {
|
|
11122
11374
|
return {
|
|
11123
11375
|
...base,
|
|
11124
11376
|
type: "string",
|
|
11125
11377
|
enum: current.options
|
|
11126
11378
|
};
|
|
11127
11379
|
}
|
|
11128
|
-
if (current instanceof
|
|
11380
|
+
if (current instanceof import_zod22.z.ZodArray) {
|
|
11129
11381
|
return {
|
|
11130
11382
|
...base,
|
|
11131
11383
|
type: "array",
|
|
11132
11384
|
items: zodTypeToJsonSchema(current.element)
|
|
11133
11385
|
};
|
|
11134
11386
|
}
|
|
11135
|
-
if (current instanceof
|
|
11387
|
+
if (current instanceof import_zod22.z.ZodObject) {
|
|
11136
11388
|
return {
|
|
11137
11389
|
...base,
|
|
11138
11390
|
...zodShapeToJsonSchema(current.shape)
|
|
11139
11391
|
};
|
|
11140
11392
|
}
|
|
11141
|
-
if (current instanceof
|
|
11393
|
+
if (current instanceof import_zod22.z.ZodRecord) {
|
|
11142
11394
|
const valueType = current._def.valueType;
|
|
11143
11395
|
return {
|
|
11144
11396
|
...base,
|
|
@@ -11262,7 +11514,7 @@ var VectrosMCPServer = class {
|
|
|
11262
11514
|
if (!tool) {
|
|
11263
11515
|
result = toolError(req.params.name ?? "unknown", new Error("No such tool."));
|
|
11264
11516
|
} else {
|
|
11265
|
-
const parsed =
|
|
11517
|
+
const parsed = import_zod23.z.object(tool.inputSchema).strict().safeParse(req.params.arguments ?? {});
|
|
11266
11518
|
if (!parsed.success) {
|
|
11267
11519
|
result = toolError(tool.name, new Error(formatArgError(tool, parsed.error)));
|
|
11268
11520
|
} else {
|