@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.mjs
CHANGED
|
@@ -2490,7 +2490,7 @@ var AuthClient = class {
|
|
|
2490
2490
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/admin/keys/scoped");
|
|
2491
2491
|
}
|
|
2492
2492
|
/**
|
|
2493
|
-
* 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
|
|
2493
|
+
* 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.
|
|
2494
2494
|
*
|
|
2495
2495
|
* @param {Vectros.CreateScopedKeyRequest} request
|
|
2496
2496
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -2822,7 +2822,7 @@ var AuthClient = class {
|
|
|
2822
2822
|
);
|
|
2823
2823
|
}
|
|
2824
2824
|
/**
|
|
2825
|
-
* 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.
|
|
2825
|
+
* 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.
|
|
2826
2826
|
*
|
|
2827
2827
|
* @param {Vectros.CreateAccessProfileRequest} request
|
|
2828
2828
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3923,7 +3923,7 @@ var AuthClient = class {
|
|
|
3923
3923
|
);
|
|
3924
3924
|
}
|
|
3925
3925
|
/**
|
|
3926
|
-
* 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.
|
|
3926
|
+
* 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.
|
|
3927
3927
|
*
|
|
3928
3928
|
* @param {Vectros.GetUsageRequest} request
|
|
3929
3929
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3986,7 +3986,7 @@ var AuthClient = class {
|
|
|
3986
3986
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/usage");
|
|
3987
3987
|
}
|
|
3988
3988
|
/**
|
|
3989
|
-
* Retrieves a single registered issuer by issuerId. Requires a root API key or the bootstrap's provisioning capability.
|
|
3989
|
+
* 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.
|
|
3990
3990
|
*
|
|
3991
3991
|
* @param {Vectros.GetIssuerRequest} request
|
|
3992
3992
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4044,13 +4044,81 @@ var AuthClient = class {
|
|
|
4044
4044
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers/{issuerId}");
|
|
4045
4045
|
}
|
|
4046
4046
|
/**
|
|
4047
|
-
*
|
|
4047
|
+
* 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.
|
|
4048
|
+
*
|
|
4049
|
+
* @param {Vectros.IssuerUpdateRequest} request
|
|
4050
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4051
|
+
*
|
|
4052
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4053
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4054
|
+
* @throws {@link Vectros.NotFoundError}
|
|
4055
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4056
|
+
*
|
|
4057
|
+
* @example
|
|
4058
|
+
* await client.auth.updateIssuer({
|
|
4059
|
+
* issuerId: "auth0-prod"
|
|
4060
|
+
* })
|
|
4061
|
+
*/
|
|
4062
|
+
updateIssuer(request, requestOptions) {
|
|
4063
|
+
return HttpResponsePromise.fromPromise(this.__updateIssuer(request, requestOptions));
|
|
4064
|
+
}
|
|
4065
|
+
async __updateIssuer(request, requestOptions) {
|
|
4066
|
+
const { issuerId, ..._body } = request;
|
|
4067
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4068
|
+
const _headers = mergeHeaders(
|
|
4069
|
+
_authRequest.headers,
|
|
4070
|
+
this._options?.headers,
|
|
4071
|
+
requestOptions?.headers
|
|
4072
|
+
);
|
|
4073
|
+
const _response = await fetcher({
|
|
4074
|
+
url: url_exports.join(
|
|
4075
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4076
|
+
`v1/auth/issuers/${url_exports.encodePathParam(issuerId)}`
|
|
4077
|
+
),
|
|
4078
|
+
method: "PUT",
|
|
4079
|
+
headers: _headers,
|
|
4080
|
+
contentType: "application/json",
|
|
4081
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4082
|
+
requestType: "json",
|
|
4083
|
+
body: _body,
|
|
4084
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4085
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4086
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4087
|
+
fetchFn: this._options?.fetch,
|
|
4088
|
+
logging: this._options.logging
|
|
4089
|
+
});
|
|
4090
|
+
if (_response.ok) {
|
|
4091
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4092
|
+
}
|
|
4093
|
+
if (_response.error.reason === "status-code") {
|
|
4094
|
+
switch (_response.error.statusCode) {
|
|
4095
|
+
case 400:
|
|
4096
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4097
|
+
case 403:
|
|
4098
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4099
|
+
case 404:
|
|
4100
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4101
|
+
case 429:
|
|
4102
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4103
|
+
default:
|
|
4104
|
+
throw new VectrosError({
|
|
4105
|
+
statusCode: _response.error.statusCode,
|
|
4106
|
+
body: _response.error.body,
|
|
4107
|
+
rawResponse: _response.rawResponse
|
|
4108
|
+
});
|
|
4109
|
+
}
|
|
4110
|
+
}
|
|
4111
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/auth/issuers/{issuerId}");
|
|
4112
|
+
}
|
|
4113
|
+
/**
|
|
4114
|
+
* 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.
|
|
4048
4115
|
*
|
|
4049
4116
|
* @param {Vectros.DeleteIssuerRequest} request
|
|
4050
4117
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4051
4118
|
*
|
|
4052
4119
|
* @throws {@link Vectros.ForbiddenError}
|
|
4053
4120
|
* @throws {@link Vectros.NotFoundError}
|
|
4121
|
+
* @throws {@link Vectros.ConflictError}
|
|
4054
4122
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
4055
4123
|
*
|
|
4056
4124
|
* @example
|
|
@@ -4092,6 +4160,8 @@ var AuthClient = class {
|
|
|
4092
4160
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4093
4161
|
case 404:
|
|
4094
4162
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4163
|
+
case 409:
|
|
4164
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4095
4165
|
case 429:
|
|
4096
4166
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4097
4167
|
default:
|
|
@@ -4110,7 +4180,7 @@ var AuthClient = class {
|
|
|
4110
4180
|
);
|
|
4111
4181
|
}
|
|
4112
4182
|
/**
|
|
4113
|
-
* Returns the issuers registered in your tenant. Requires a root API key or the bootstrap's provisioning capability. Returns a `{data, nextCursor}` envelope.
|
|
4183
|
+
* 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.
|
|
4114
4184
|
*
|
|
4115
4185
|
* @param {Vectros.ListIssuersRequest} request
|
|
4116
4186
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4167,7 +4237,7 @@ var AuthClient = class {
|
|
|
4167
4237
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers");
|
|
4168
4238
|
}
|
|
4169
4239
|
/**
|
|
4170
|
-
* 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.
|
|
4240
|
+
* 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`.
|
|
4171
4241
|
*
|
|
4172
4242
|
* @param {Vectros.IssuerRequest} request
|
|
4173
4243
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4278,7 +4348,7 @@ var AuthClient = class {
|
|
|
4278
4348
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/ping");
|
|
4279
4349
|
}
|
|
4280
4350
|
/**
|
|
4281
|
-
* Returns the access profiles for the given principal across
|
|
4351
|
+
* 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.
|
|
4282
4352
|
*
|
|
4283
4353
|
* @param {Vectros.ListProfilesForPrincipalRequest} request
|
|
4284
4354
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4352,6 +4422,7 @@ var AuthClient = class {
|
|
|
4352
4422
|
*
|
|
4353
4423
|
* @throws {@link Vectros.BadRequestError}
|
|
4354
4424
|
* @throws {@link Vectros.ForbiddenError}
|
|
4425
|
+
* @throws {@link Vectros.NotFoundError}
|
|
4355
4426
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
4356
4427
|
*
|
|
4357
4428
|
* @example
|
|
@@ -4405,6 +4476,8 @@ var AuthClient = class {
|
|
|
4405
4476
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4406
4477
|
case 403:
|
|
4407
4478
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4479
|
+
case 404:
|
|
4480
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4408
4481
|
case 429:
|
|
4409
4482
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4410
4483
|
default:
|
|
@@ -4557,7 +4630,84 @@ var AuthClient = class {
|
|
|
4557
4630
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/users/invite/resend");
|
|
4558
4631
|
}
|
|
4559
4632
|
/**
|
|
4560
|
-
*
|
|
4633
|
+
* 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).
|
|
4634
|
+
*
|
|
4635
|
+
* **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.
|
|
4636
|
+
*
|
|
4637
|
+
* **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.
|
|
4638
|
+
*
|
|
4639
|
+
* **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.
|
|
4640
|
+
*
|
|
4641
|
+
* 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.
|
|
4642
|
+
*
|
|
4643
|
+
* @param {Record<string, unknown>} request
|
|
4644
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4645
|
+
*
|
|
4646
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4647
|
+
* @throws {@link Vectros.UnauthorizedError}
|
|
4648
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4649
|
+
* @throws {@link Vectros.ConflictError}
|
|
4650
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4651
|
+
*
|
|
4652
|
+
* @example
|
|
4653
|
+
* await client.auth.assumeToken({
|
|
4654
|
+
* "scope:org": "orgB"
|
|
4655
|
+
* })
|
|
4656
|
+
*/
|
|
4657
|
+
assumeToken(request, requestOptions) {
|
|
4658
|
+
return HttpResponsePromise.fromPromise(this.__assumeToken(request, requestOptions));
|
|
4659
|
+
}
|
|
4660
|
+
async __assumeToken(request, requestOptions) {
|
|
4661
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4662
|
+
const _headers = mergeHeaders(
|
|
4663
|
+
_authRequest.headers,
|
|
4664
|
+
this._options?.headers,
|
|
4665
|
+
requestOptions?.headers
|
|
4666
|
+
);
|
|
4667
|
+
const _response = await fetcher({
|
|
4668
|
+
url: url_exports.join(
|
|
4669
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4670
|
+
"v1/auth/token/assume"
|
|
4671
|
+
),
|
|
4672
|
+
method: "POST",
|
|
4673
|
+
headers: _headers,
|
|
4674
|
+
contentType: "application/json",
|
|
4675
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4676
|
+
requestType: "json",
|
|
4677
|
+
body: request,
|
|
4678
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4679
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4680
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4681
|
+
fetchFn: this._options?.fetch,
|
|
4682
|
+
logging: this._options.logging
|
|
4683
|
+
});
|
|
4684
|
+
if (_response.ok) {
|
|
4685
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4686
|
+
}
|
|
4687
|
+
if (_response.error.reason === "status-code") {
|
|
4688
|
+
switch (_response.error.statusCode) {
|
|
4689
|
+
case 400:
|
|
4690
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4691
|
+
case 401:
|
|
4692
|
+
throw new UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
4693
|
+
case 403:
|
|
4694
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4695
|
+
case 409:
|
|
4696
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4697
|
+
case 429:
|
|
4698
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4699
|
+
default:
|
|
4700
|
+
throw new VectrosError({
|
|
4701
|
+
statusCode: _response.error.statusCode,
|
|
4702
|
+
body: _response.error.body,
|
|
4703
|
+
rawResponse: _response.rawResponse
|
|
4704
|
+
});
|
|
4705
|
+
}
|
|
4706
|
+
}
|
|
4707
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/auth/token/assume");
|
|
4708
|
+
}
|
|
4709
|
+
/**
|
|
4710
|
+
* 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.
|
|
4561
4711
|
*
|
|
4562
4712
|
* @param {Vectros.TokenExchangeRequest} request
|
|
4563
4713
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4633,9 +4783,9 @@ var ComplianceClient = class {
|
|
|
4633
4783
|
* @param {Vectros.ErasureRequest} request
|
|
4634
4784
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4635
4785
|
*
|
|
4786
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4636
4787
|
* @throws {@link Vectros.ForbiddenError}
|
|
4637
4788
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
4638
|
-
* @throws {@link Vectros.NotImplementedError}
|
|
4639
4789
|
*
|
|
4640
4790
|
* @example
|
|
4641
4791
|
* await client.compliance.createErasureRequest({
|
|
@@ -4674,12 +4824,12 @@ var ComplianceClient = class {
|
|
|
4674
4824
|
}
|
|
4675
4825
|
if (_response.error.reason === "status-code") {
|
|
4676
4826
|
switch (_response.error.statusCode) {
|
|
4827
|
+
case 400:
|
|
4828
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4677
4829
|
case 403:
|
|
4678
4830
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4679
4831
|
case 429:
|
|
4680
4832
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4681
|
-
case 501:
|
|
4682
|
-
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4683
4833
|
default:
|
|
4684
4834
|
throw new VectrosError({
|
|
4685
4835
|
statusCode: _response.error.statusCode,
|
|
@@ -4698,7 +4848,6 @@ var ComplianceClient = class {
|
|
|
4698
4848
|
*
|
|
4699
4849
|
* @throws {@link Vectros.ForbiddenError}
|
|
4700
4850
|
* @throws {@link Vectros.NotFoundError}
|
|
4701
|
-
* @throws {@link Vectros.NotImplementedError}
|
|
4702
4851
|
*
|
|
4703
4852
|
* @example
|
|
4704
4853
|
* await client.compliance.getErasureRequest({
|
|
@@ -4739,8 +4888,6 @@ var ComplianceClient = class {
|
|
|
4739
4888
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4740
4889
|
case 404:
|
|
4741
4890
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4742
|
-
case 501:
|
|
4743
|
-
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4744
4891
|
default:
|
|
4745
4892
|
throw new VectrosError({
|
|
4746
4893
|
statusCode: _response.error.statusCode,
|
|
@@ -6099,6 +6246,7 @@ var IdentityClient = class {
|
|
|
6099
6246
|
* @example
|
|
6100
6247
|
* await client.identity.listEntities({
|
|
6101
6248
|
* namespace: "team",
|
|
6249
|
+
* contextId: "myapp",
|
|
6102
6250
|
* startFrom: "b3BhcXVlLWN1cnNvci1mcm9tLXRoZS1wcmV2aW91cy1wYWdl"
|
|
6103
6251
|
* })
|
|
6104
6252
|
*/
|
|
@@ -6108,6 +6256,7 @@ var IdentityClient = class {
|
|
|
6108
6256
|
async __listEntities(request, requestOptions) {
|
|
6109
6257
|
const {
|
|
6110
6258
|
namespace,
|
|
6259
|
+
contextId,
|
|
6111
6260
|
userId,
|
|
6112
6261
|
externalId,
|
|
6113
6262
|
scope,
|
|
@@ -6122,6 +6271,7 @@ var IdentityClient = class {
|
|
|
6122
6271
|
limit
|
|
6123
6272
|
} = request;
|
|
6124
6273
|
const _queryParams = {
|
|
6274
|
+
contextId,
|
|
6125
6275
|
userId,
|
|
6126
6276
|
externalId,
|
|
6127
6277
|
scope,
|
|
@@ -6180,6 +6330,7 @@ var IdentityClient = class {
|
|
|
6180
6330
|
* @example
|
|
6181
6331
|
* await client.identity.createEntity({
|
|
6182
6332
|
* namespace: "team",
|
|
6333
|
+
* contextId: "myapp",
|
|
6183
6334
|
* body: {
|
|
6184
6335
|
* externalId: "team_eng_platform"
|
|
6185
6336
|
* }
|
|
@@ -6189,9 +6340,10 @@ var IdentityClient = class {
|
|
|
6189
6340
|
return HttpResponsePromise.fromPromise(this.__createEntity(request, requestOptions));
|
|
6190
6341
|
}
|
|
6191
6342
|
async __createEntity(request, requestOptions) {
|
|
6192
|
-
const { namespace, upsert, body: _body } = request;
|
|
6343
|
+
const { namespace, upsert, contextId, body: _body } = request;
|
|
6193
6344
|
const _queryParams = {
|
|
6194
|
-
upsert
|
|
6345
|
+
upsert,
|
|
6346
|
+
contextId
|
|
6195
6347
|
};
|
|
6196
6348
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6197
6349
|
const _headers = mergeHeaders(
|
|
@@ -6248,14 +6400,18 @@ var IdentityClient = class {
|
|
|
6248
6400
|
* @example
|
|
6249
6401
|
* await client.identity.getEntity({
|
|
6250
6402
|
* namespace: "team",
|
|
6251
|
-
* id: "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
|
|
6403
|
+
* id: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
6404
|
+
* contextId: "myapp"
|
|
6252
6405
|
* })
|
|
6253
6406
|
*/
|
|
6254
6407
|
getEntity(request, requestOptions) {
|
|
6255
6408
|
return HttpResponsePromise.fromPromise(this.__getEntity(request, requestOptions));
|
|
6256
6409
|
}
|
|
6257
6410
|
async __getEntity(request, requestOptions) {
|
|
6258
|
-
const { namespace, id } = request;
|
|
6411
|
+
const { namespace, id, contextId } = request;
|
|
6412
|
+
const _queryParams = {
|
|
6413
|
+
contextId
|
|
6414
|
+
};
|
|
6259
6415
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6260
6416
|
const _headers = mergeHeaders(
|
|
6261
6417
|
_authRequest.headers,
|
|
@@ -6269,7 +6425,7 @@ var IdentityClient = class {
|
|
|
6269
6425
|
),
|
|
6270
6426
|
method: "GET",
|
|
6271
6427
|
headers: _headers,
|
|
6272
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6428
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6273
6429
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6274
6430
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6275
6431
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6306,6 +6462,7 @@ var IdentityClient = class {
|
|
|
6306
6462
|
* await client.identity.updateEntity({
|
|
6307
6463
|
* namespace: "team",
|
|
6308
6464
|
* id: "id",
|
|
6465
|
+
* contextId: "myapp",
|
|
6309
6466
|
* body: {
|
|
6310
6467
|
* externalId: "team_eng_platform"
|
|
6311
6468
|
* }
|
|
@@ -6315,7 +6472,10 @@ var IdentityClient = class {
|
|
|
6315
6472
|
return HttpResponsePromise.fromPromise(this.__updateEntity(request, requestOptions));
|
|
6316
6473
|
}
|
|
6317
6474
|
async __updateEntity(request, requestOptions) {
|
|
6318
|
-
const { namespace, id, body: _body } = request;
|
|
6475
|
+
const { namespace, id, contextId, body: _body } = request;
|
|
6476
|
+
const _queryParams = {
|
|
6477
|
+
contextId
|
|
6478
|
+
};
|
|
6319
6479
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6320
6480
|
const _headers = mergeHeaders(
|
|
6321
6481
|
_authRequest.headers,
|
|
@@ -6330,7 +6490,7 @@ var IdentityClient = class {
|
|
|
6330
6490
|
method: "PUT",
|
|
6331
6491
|
headers: _headers,
|
|
6332
6492
|
contentType: "application/json",
|
|
6333
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6493
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6334
6494
|
requestType: "json",
|
|
6335
6495
|
body: _body,
|
|
6336
6496
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -6370,14 +6530,18 @@ var IdentityClient = class {
|
|
|
6370
6530
|
* @example
|
|
6371
6531
|
* await client.identity.deleteEntity({
|
|
6372
6532
|
* namespace: "team",
|
|
6373
|
-
* id: "id"
|
|
6533
|
+
* id: "id",
|
|
6534
|
+
* contextId: "myapp"
|
|
6374
6535
|
* })
|
|
6375
6536
|
*/
|
|
6376
6537
|
deleteEntity(request, requestOptions) {
|
|
6377
6538
|
return HttpResponsePromise.fromPromise(this.__deleteEntity(request, requestOptions));
|
|
6378
6539
|
}
|
|
6379
6540
|
async __deleteEntity(request, requestOptions) {
|
|
6380
|
-
const { namespace, id } = request;
|
|
6541
|
+
const { namespace, id, contextId } = request;
|
|
6542
|
+
const _queryParams = {
|
|
6543
|
+
contextId
|
|
6544
|
+
};
|
|
6381
6545
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6382
6546
|
const _headers = mergeHeaders(
|
|
6383
6547
|
_authRequest.headers,
|
|
@@ -6391,7 +6555,7 @@ var IdentityClient = class {
|
|
|
6391
6555
|
),
|
|
6392
6556
|
method: "DELETE",
|
|
6393
6557
|
headers: _headers,
|
|
6394
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6558
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6395
6559
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6396
6560
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6397
6561
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6434,6 +6598,7 @@ var IdentityClient = class {
|
|
|
6434
6598
|
* @example
|
|
6435
6599
|
* await client.identity.lookupEntities({
|
|
6436
6600
|
* namespace: "team",
|
|
6601
|
+
* contextId: "myapp",
|
|
6437
6602
|
* body: {
|
|
6438
6603
|
* type: "person_v1",
|
|
6439
6604
|
* field: "ssn"
|
|
@@ -6444,7 +6609,10 @@ var IdentityClient = class {
|
|
|
6444
6609
|
return HttpResponsePromise.fromPromise(this.__lookupEntities(request, requestOptions));
|
|
6445
6610
|
}
|
|
6446
6611
|
async __lookupEntities(request, requestOptions) {
|
|
6447
|
-
const { namespace, body: _body } = request;
|
|
6612
|
+
const { namespace, contextId, body: _body } = request;
|
|
6613
|
+
const _queryParams = {
|
|
6614
|
+
contextId
|
|
6615
|
+
};
|
|
6448
6616
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6449
6617
|
const _headers = mergeHeaders(
|
|
6450
6618
|
_authRequest.headers,
|
|
@@ -6459,7 +6627,7 @@ var IdentityClient = class {
|
|
|
6459
6627
|
method: "POST",
|
|
6460
6628
|
headers: _headers,
|
|
6461
6629
|
contentType: "application/json",
|
|
6462
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6630
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6463
6631
|
requestType: "json",
|
|
6464
6632
|
body: _body,
|
|
6465
6633
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -6503,15 +6671,17 @@ var IdentityClient = class {
|
|
|
6503
6671
|
* @example
|
|
6504
6672
|
* await client.identity.getEntityVersions({
|
|
6505
6673
|
* namespace: "team",
|
|
6506
|
-
* id: "id"
|
|
6674
|
+
* id: "id",
|
|
6675
|
+
* contextId: "myapp"
|
|
6507
6676
|
* })
|
|
6508
6677
|
*/
|
|
6509
6678
|
getEntityVersions(request, requestOptions) {
|
|
6510
6679
|
return HttpResponsePromise.fromPromise(this.__getEntityVersions(request, requestOptions));
|
|
6511
6680
|
}
|
|
6512
6681
|
async __getEntityVersions(request, requestOptions) {
|
|
6513
|
-
const { namespace, id, startFrom } = request;
|
|
6682
|
+
const { namespace, id, contextId, startFrom } = request;
|
|
6514
6683
|
const _queryParams = {
|
|
6684
|
+
contextId,
|
|
6515
6685
|
startFrom
|
|
6516
6686
|
};
|
|
6517
6687
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
@@ -6557,7 +6727,7 @@ var IdentityClient = class {
|
|
|
6557
6727
|
);
|
|
6558
6728
|
}
|
|
6559
6729
|
/**
|
|
6560
|
-
* Retrieves a single scope-namespace registration by name.
|
|
6730
|
+
* Retrieves a single scope-namespace registration by name.
|
|
6561
6731
|
*
|
|
6562
6732
|
* @param {Vectros.GetNamespaceRequest} request
|
|
6563
6733
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6573,7 +6743,10 @@ var IdentityClient = class {
|
|
|
6573
6743
|
return HttpResponsePromise.fromPromise(this.__getNamespace(request, requestOptions));
|
|
6574
6744
|
}
|
|
6575
6745
|
async __getNamespace(request, requestOptions) {
|
|
6576
|
-
const { namespace } = request;
|
|
6746
|
+
const { namespace, contextId } = request;
|
|
6747
|
+
const _queryParams = {
|
|
6748
|
+
contextId
|
|
6749
|
+
};
|
|
6577
6750
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6578
6751
|
const _headers = mergeHeaders(
|
|
6579
6752
|
_authRequest.headers,
|
|
@@ -6587,7 +6760,7 @@ var IdentityClient = class {
|
|
|
6587
6760
|
),
|
|
6588
6761
|
method: "GET",
|
|
6589
6762
|
headers: _headers,
|
|
6590
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6763
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6591
6764
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6592
6765
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6593
6766
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6612,7 +6785,7 @@ var IdentityClient = class {
|
|
|
6612
6785
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/namespaces/{namespace}");
|
|
6613
6786
|
}
|
|
6614
6787
|
/**
|
|
6615
|
-
* Updates the mutable fields (`entityBacked`, `defaultSchemaId`, `specificityRank`) of a registered namespace. The namespace name
|
|
6788
|
+
* 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.
|
|
6616
6789
|
*
|
|
6617
6790
|
* @param {Vectros.UpdateNamespaceRequest} request
|
|
6618
6791
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6634,7 +6807,10 @@ var IdentityClient = class {
|
|
|
6634
6807
|
return HttpResponsePromise.fromPromise(this.__updateNamespace(request, requestOptions));
|
|
6635
6808
|
}
|
|
6636
6809
|
async __updateNamespace(request, requestOptions) {
|
|
6637
|
-
const { namespace, body: _body } = request;
|
|
6810
|
+
const { namespace, contextId, body: _body } = request;
|
|
6811
|
+
const _queryParams = {
|
|
6812
|
+
contextId
|
|
6813
|
+
};
|
|
6638
6814
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6639
6815
|
const _headers = mergeHeaders(
|
|
6640
6816
|
_authRequest.headers,
|
|
@@ -6649,7 +6825,7 @@ var IdentityClient = class {
|
|
|
6649
6825
|
method: "PUT",
|
|
6650
6826
|
headers: _headers,
|
|
6651
6827
|
contentType: "application/json",
|
|
6652
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6828
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6653
6829
|
requestType: "json",
|
|
6654
6830
|
body: _body,
|
|
6655
6831
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
@@ -6680,7 +6856,7 @@ var IdentityClient = class {
|
|
|
6680
6856
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/namespaces/{namespace}");
|
|
6681
6857
|
}
|
|
6682
6858
|
/**
|
|
6683
|
-
* Deletes a registered scope namespace. Requires a root API key.
|
|
6859
|
+
* 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.
|
|
6684
6860
|
*
|
|
6685
6861
|
* @param {Vectros.DeleteNamespaceRequest} request
|
|
6686
6862
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6698,7 +6874,10 @@ var IdentityClient = class {
|
|
|
6698
6874
|
return HttpResponsePromise.fromPromise(this.__deleteNamespace(request, requestOptions));
|
|
6699
6875
|
}
|
|
6700
6876
|
async __deleteNamespace(request, requestOptions) {
|
|
6701
|
-
const { namespace } = request;
|
|
6877
|
+
const { namespace, contextId } = request;
|
|
6878
|
+
const _queryParams = {
|
|
6879
|
+
contextId
|
|
6880
|
+
};
|
|
6702
6881
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6703
6882
|
const _headers = mergeHeaders(
|
|
6704
6883
|
_authRequest.headers,
|
|
@@ -6712,7 +6891,7 @@ var IdentityClient = class {
|
|
|
6712
6891
|
),
|
|
6713
6892
|
method: "DELETE",
|
|
6714
6893
|
headers: _headers,
|
|
6715
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6894
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6716
6895
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6717
6896
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6718
6897
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6741,7 +6920,7 @@ var IdentityClient = class {
|
|
|
6741
6920
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/namespaces/{namespace}");
|
|
6742
6921
|
}
|
|
6743
6922
|
/**
|
|
6744
|
-
* Returns the scope namespaces registered in your account
|
|
6923
|
+
* Returns the scope namespaces registered in your account. Returns a `{data, nextCursor}` envelope.
|
|
6745
6924
|
*
|
|
6746
6925
|
* @param {Vectros.ListNamespacesRequest} request
|
|
6747
6926
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6753,10 +6932,11 @@ var IdentityClient = class {
|
|
|
6753
6932
|
return HttpResponsePromise.fromPromise(this.__listNamespaces(request, requestOptions));
|
|
6754
6933
|
}
|
|
6755
6934
|
async __listNamespaces(request = {}, requestOptions) {
|
|
6756
|
-
const { startFrom, limit } = request;
|
|
6935
|
+
const { startFrom, limit, contextId } = request;
|
|
6757
6936
|
const _queryParams = {
|
|
6758
6937
|
startFrom,
|
|
6759
|
-
limit
|
|
6938
|
+
limit,
|
|
6939
|
+
contextId
|
|
6760
6940
|
};
|
|
6761
6941
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6762
6942
|
const _headers = mergeHeaders(
|
|
@@ -6791,9 +6971,9 @@ var IdentityClient = class {
|
|
|
6791
6971
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/namespaces");
|
|
6792
6972
|
}
|
|
6793
6973
|
/**
|
|
6794
|
-
* 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.
|
|
6974
|
+
* 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.
|
|
6795
6975
|
*
|
|
6796
|
-
* @param {Vectros.
|
|
6976
|
+
* @param {Vectros.RegisterNamespaceRequest} request
|
|
6797
6977
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6798
6978
|
*
|
|
6799
6979
|
* @throws {@link Vectros.BadRequestError}
|
|
@@ -6802,14 +6982,20 @@ var IdentityClient = class {
|
|
|
6802
6982
|
*
|
|
6803
6983
|
* @example
|
|
6804
6984
|
* await client.identity.registerNamespace({
|
|
6805
|
-
*
|
|
6806
|
-
*
|
|
6985
|
+
* body: {
|
|
6986
|
+
* namespace: "team",
|
|
6987
|
+
* specificityRank: 1500
|
|
6988
|
+
* }
|
|
6807
6989
|
* })
|
|
6808
6990
|
*/
|
|
6809
6991
|
registerNamespace(request, requestOptions) {
|
|
6810
6992
|
return HttpResponsePromise.fromPromise(this.__registerNamespace(request, requestOptions));
|
|
6811
6993
|
}
|
|
6812
6994
|
async __registerNamespace(request, requestOptions) {
|
|
6995
|
+
const { contextId, body: _body } = request;
|
|
6996
|
+
const _queryParams = {
|
|
6997
|
+
contextId
|
|
6998
|
+
};
|
|
6813
6999
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6814
7000
|
const _headers = mergeHeaders(
|
|
6815
7001
|
_authRequest.headers,
|
|
@@ -6824,9 +7010,9 @@ var IdentityClient = class {
|
|
|
6824
7010
|
method: "POST",
|
|
6825
7011
|
headers: _headers,
|
|
6826
7012
|
contentType: "application/json",
|
|
6827
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
7013
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
6828
7014
|
requestType: "json",
|
|
6829
|
-
body:
|
|
7015
|
+
body: _body,
|
|
6830
7016
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
6831
7017
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
6832
7018
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -6855,7 +7041,7 @@ var IdentityClient = class {
|
|
|
6855
7041
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/namespaces");
|
|
6856
7042
|
}
|
|
6857
7043
|
/**
|
|
6858
|
-
* 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.
|
|
7044
|
+
* 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.
|
|
6859
7045
|
*
|
|
6860
7046
|
* @param {Vectros.ListUsersRequest} request
|
|
6861
7047
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6920,7 +7106,7 @@ var IdentityClient = class {
|
|
|
6920
7106
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users");
|
|
6921
7107
|
}
|
|
6922
7108
|
/**
|
|
6923
|
-
* 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.
|
|
7109
|
+
* 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`.
|
|
6924
7110
|
*
|
|
6925
7111
|
* @param {Vectros.CreateUserRequest} request
|
|
6926
7112
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7044,7 +7230,7 @@ var IdentityClient = class {
|
|
|
7044
7230
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users/{id}");
|
|
7045
7231
|
}
|
|
7046
7232
|
/**
|
|
7047
|
-
* 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.
|
|
7233
|
+
* 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.
|
|
7048
7234
|
*
|
|
7049
7235
|
* @param {Vectros.UpdateUserRequest} request
|
|
7050
7236
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7111,12 +7297,13 @@ var IdentityClient = class {
|
|
|
7111
7297
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/users/{id}");
|
|
7112
7298
|
}
|
|
7113
7299
|
/**
|
|
7114
|
-
* 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.
|
|
7300
|
+
* 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.
|
|
7115
7301
|
*
|
|
7116
7302
|
* @param {Vectros.DeleteUserRequest} request
|
|
7117
7303
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7118
7304
|
*
|
|
7119
7305
|
* @throws {@link Vectros.NotFoundError}
|
|
7306
|
+
* @throws {@link Vectros.ConflictError}
|
|
7120
7307
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
7121
7308
|
*
|
|
7122
7309
|
* @example
|
|
@@ -7156,6 +7343,8 @@ var IdentityClient = class {
|
|
|
7156
7343
|
switch (_response.error.statusCode) {
|
|
7157
7344
|
case 404:
|
|
7158
7345
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7346
|
+
case 409:
|
|
7347
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
7159
7348
|
case 429:
|
|
7160
7349
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7161
7350
|
default:
|
|
@@ -7169,7 +7358,7 @@ var IdentityClient = class {
|
|
|
7169
7358
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/users/{id}");
|
|
7170
7359
|
}
|
|
7171
7360
|
/**
|
|
7172
|
-
* 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.
|
|
7361
|
+
* 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.
|
|
7173
7362
|
*
|
|
7174
7363
|
* @param {Vectros.IdentityLookupRequest} request
|
|
7175
7364
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7612,14 +7801,14 @@ var RecordsClient = class {
|
|
|
7612
7801
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
7613
7802
|
}
|
|
7614
7803
|
/**
|
|
7615
|
-
*
|
|
7804
|
+
* 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).
|
|
7616
7805
|
*
|
|
7617
7806
|
* @param {Vectros.BatchGetRequest} request
|
|
7618
7807
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7619
7808
|
*
|
|
7809
|
+
* @throws {@link Vectros.BadRequestError}
|
|
7620
7810
|
* @throws {@link Vectros.ForbiddenError}
|
|
7621
7811
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
7622
|
-
* @throws {@link Vectros.NotImplementedError}
|
|
7623
7812
|
*
|
|
7624
7813
|
* @example
|
|
7625
7814
|
* await client.records.batchGetRecords()
|
|
@@ -7656,12 +7845,12 @@ var RecordsClient = class {
|
|
|
7656
7845
|
}
|
|
7657
7846
|
if (_response.error.reason === "status-code") {
|
|
7658
7847
|
switch (_response.error.statusCode) {
|
|
7848
|
+
case 400:
|
|
7849
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7659
7850
|
case 403:
|
|
7660
7851
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7661
7852
|
case 429:
|
|
7662
7853
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7663
|
-
case 501:
|
|
7664
|
-
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7665
7854
|
default:
|
|
7666
7855
|
throw new VectrosError({
|
|
7667
7856
|
statusCode: _response.error.statusCode,
|
|
@@ -8475,7 +8664,7 @@ var SchemasClient = class {
|
|
|
8475
8664
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
8476
8665
|
}
|
|
8477
8666
|
/**
|
|
8478
|
-
* 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
|
|
8667
|
+
* 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.
|
|
8479
8668
|
*
|
|
8480
8669
|
* @param {Vectros.ListSchemasRequest} request
|
|
8481
8670
|
* @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -8763,6 +8952,7 @@ var SchemasClient = class {
|
|
|
8763
8952
|
* @param {Vectros.DeleteSchemaRequest} request
|
|
8764
8953
|
* @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8765
8954
|
*
|
|
8955
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
8766
8956
|
* @throws {@link Vectros.NotFoundError}
|
|
8767
8957
|
* @throws {@link Vectros.ConflictError}
|
|
8768
8958
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
@@ -8802,6 +8992,8 @@ var SchemasClient = class {
|
|
|
8802
8992
|
}
|
|
8803
8993
|
if (_response.error.reason === "status-code") {
|
|
8804
8994
|
switch (_response.error.statusCode) {
|
|
8995
|
+
case 403:
|
|
8996
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8805
8997
|
case 404:
|
|
8806
8998
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
8807
8999
|
case 409:
|
|
@@ -9016,7 +9208,7 @@ import {
|
|
|
9016
9208
|
ListToolsRequestSchema,
|
|
9017
9209
|
ReadResourceRequestSchema
|
|
9018
9210
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
9019
|
-
import { z as
|
|
9211
|
+
import { z as z23 } from "zod";
|
|
9020
9212
|
|
|
9021
9213
|
// src/auth.ts
|
|
9022
9214
|
var KEY_RE = /^(sk|ssk|st)_(live|test)_/;
|
|
@@ -9060,8 +9252,8 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
9060
9252
|
|
|
9061
9253
|
// src/build-info.ts
|
|
9062
9254
|
var BUILD_INFO = {
|
|
9063
|
-
mcpServer: true ? "0.
|
|
9064
|
-
sdk: true ? "0.
|
|
9255
|
+
mcpServer: true ? "0.16.0" : "dev",
|
|
9256
|
+
sdk: true ? "0.41.0" : "dev"
|
|
9065
9257
|
};
|
|
9066
9258
|
|
|
9067
9259
|
// src/log.ts
|
|
@@ -9369,7 +9561,7 @@ var inputSchema = {
|
|
|
9369
9561
|
// Ownership.
|
|
9370
9562
|
userId: z.string().optional().describe("Restrict to content owned by this user (Vectros UUID)."),
|
|
9371
9563
|
scope: z.string().optional().describe(
|
|
9372
|
-
'Restrict to content carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "client:<uuid>", "group:eng-team"). `org` and `client` are
|
|
9564
|
+
'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.'
|
|
9373
9565
|
),
|
|
9374
9566
|
// Date window.
|
|
9375
9567
|
createdAfter: z.string().optional().describe("Restrict to content created at/after this ISO 8601 UTC timestamp."),
|
|
@@ -9509,7 +9701,7 @@ var inputSchema2 = {
|
|
|
9509
9701
|
// List-mode args:
|
|
9510
9702
|
userId: z2.string().optional().describe("List mode: scope to records owned by this user."),
|
|
9511
9703
|
scope: z2.string().optional().describe(
|
|
9512
|
-
'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
|
|
9704
|
+
'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.'
|
|
9513
9705
|
),
|
|
9514
9706
|
startFrom: z2.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next. Works in both list and lookup mode."),
|
|
9515
9707
|
limit: z2.number().int().min(1).max(MCP_MAX_LIMIT2).optional().describe(
|
|
@@ -9743,31 +9935,78 @@ var recordGet = ({ client, log }) => ({
|
|
|
9743
9935
|
});
|
|
9744
9936
|
var record_get_default = recordGet;
|
|
9745
9937
|
|
|
9746
|
-
// src/tools/
|
|
9938
|
+
// src/tools/record_batch_get.ts
|
|
9747
9939
|
import { z as z4 } from "zod";
|
|
9940
|
+
var MAX_PAYLOAD_CHARS2 = 32e3;
|
|
9941
|
+
var MCP_MAX_IDS = 100;
|
|
9748
9942
|
var inputSchema4 = {
|
|
9749
|
-
|
|
9750
|
-
|
|
9943
|
+
ids: z4.array(z4.string()).min(1).max(MCP_MAX_IDS).describe(
|
|
9944
|
+
`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.`
|
|
9945
|
+
)
|
|
9946
|
+
};
|
|
9947
|
+
var recordBatchGet = ({ client, log }) => ({
|
|
9948
|
+
name: "record_batch_get",
|
|
9949
|
+
title: "Get multiple records by id in one call",
|
|
9950
|
+
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.",
|
|
9951
|
+
inputSchema: inputSchema4,
|
|
9952
|
+
handler: async (args) => {
|
|
9953
|
+
const ids = args.ids;
|
|
9954
|
+
try {
|
|
9955
|
+
const response = await client.records.batchGetRecords({ ids });
|
|
9956
|
+
const records = response.data ?? [];
|
|
9957
|
+
const data = records.map((record) => {
|
|
9958
|
+
const item = { ...record };
|
|
9959
|
+
if (record.payload !== void 0) {
|
|
9960
|
+
const json = JSON.stringify(record.payload);
|
|
9961
|
+
if (json.length > MAX_PAYLOAD_CHARS2) {
|
|
9962
|
+
delete item.payload;
|
|
9963
|
+
item.payloadPreview = json.slice(0, MAX_PAYLOAD_CHARS2);
|
|
9964
|
+
item.payloadTruncated = true;
|
|
9965
|
+
item.payloadTotalChars = json.length;
|
|
9966
|
+
}
|
|
9967
|
+
}
|
|
9968
|
+
return item;
|
|
9969
|
+
});
|
|
9970
|
+
const returnedIds = new Set(records.map((r) => r.id));
|
|
9971
|
+
const missingIds = ids.filter((id) => !returnedIds.has(id));
|
|
9972
|
+
log.debug(
|
|
9973
|
+
{ tool: "record_batch_get", requested: ids.length, returned: data.length, missing: missingIds.length },
|
|
9974
|
+
"record_batch_get ok"
|
|
9975
|
+
);
|
|
9976
|
+
return { content: [{ type: "text", text: JSON.stringify({ data, missingIds }, null, 2) }] };
|
|
9977
|
+
} catch (err) {
|
|
9978
|
+
log.warn({ tool: "record_batch_get", idsCount: ids?.length, err: String(err) }, "record_batch_get failed");
|
|
9979
|
+
return toolError("record_batch_get", err);
|
|
9980
|
+
}
|
|
9981
|
+
}
|
|
9982
|
+
});
|
|
9983
|
+
var record_batch_get_default = recordBatchGet;
|
|
9984
|
+
|
|
9985
|
+
// src/tools/record_create.ts
|
|
9986
|
+
import { z as z5 } from "zod";
|
|
9987
|
+
var inputSchema5 = {
|
|
9988
|
+
type: z5.string().min(1, "type is required").describe('Record type / schema name (e.g. "task"). Must match an existing schema \u2014 see list_schemas.'),
|
|
9989
|
+
fields: z5.record(z5.string(), z5.unknown()).describe(
|
|
9751
9990
|
"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."
|
|
9752
9991
|
),
|
|
9753
|
-
externalId:
|
|
9992
|
+
externalId: z5.string().optional().describe(
|
|
9754
9993
|
"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."
|
|
9755
9994
|
),
|
|
9756
|
-
indexMode:
|
|
9995
|
+
indexMode: z5.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
|
|
9757
9996
|
"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."
|
|
9758
9997
|
),
|
|
9759
|
-
status:
|
|
9760
|
-
folderId:
|
|
9761
|
-
userId:
|
|
9762
|
-
scopes:
|
|
9763
|
-
'Scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]). `org` and `client` are
|
|
9998
|
+
status: z5.string().optional().describe("Record lifecycle status. Defaults to ACTIVE server-side."),
|
|
9999
|
+
folderId: z5.string().optional().describe("Group this record into a folder."),
|
|
10000
|
+
userId: z5.string().optional().describe("Owning user id."),
|
|
10001
|
+
scopes: z5.array(z5.string()).optional().describe(
|
|
10002
|
+
'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.'
|
|
9764
10003
|
)
|
|
9765
10004
|
};
|
|
9766
10005
|
var recordCreate = ({ client, log }) => ({
|
|
9767
10006
|
name: "record_create",
|
|
9768
10007
|
title: "Create a record",
|
|
9769
10008
|
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).",
|
|
9770
|
-
inputSchema:
|
|
10009
|
+
inputSchema: inputSchema5,
|
|
9771
10010
|
handler: async (args) => {
|
|
9772
10011
|
const type = args.type;
|
|
9773
10012
|
try {
|
|
@@ -9794,18 +10033,18 @@ var recordCreate = ({ client, log }) => ({
|
|
|
9794
10033
|
var record_create_default = recordCreate;
|
|
9795
10034
|
|
|
9796
10035
|
// src/tools/record_update.ts
|
|
9797
|
-
import { z as
|
|
9798
|
-
var
|
|
9799
|
-
id:
|
|
9800
|
-
externalId:
|
|
10036
|
+
import { z as z6 } from "zod";
|
|
10037
|
+
var inputSchema6 = {
|
|
10038
|
+
id: z6.string().optional().describe("The Vectros record id to update. Provide this OR externalId+type."),
|
|
10039
|
+
externalId: z6.string().optional().describe(
|
|
9801
10040
|
"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."
|
|
9802
10041
|
),
|
|
9803
|
-
type:
|
|
9804
|
-
fields:
|
|
10042
|
+
type: z6.string().optional().describe("Record type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
10043
|
+
fields: z6.record(z6.string(), z6.unknown()).describe(
|
|
9805
10044
|
"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."
|
|
9806
10045
|
),
|
|
9807
|
-
status:
|
|
9808
|
-
expectedVersion:
|
|
10046
|
+
status: z6.string().optional().describe("Set the record lifecycle status (e.g. ARCHIVED) \u2014 archive/workflow without physical deletion."),
|
|
10047
|
+
expectedVersion: z6.number().int().optional().describe(
|
|
9809
10048
|
"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."
|
|
9810
10049
|
)
|
|
9811
10050
|
};
|
|
@@ -9813,7 +10052,7 @@ var recordUpdate = ({ client, log }) => ({
|
|
|
9813
10052
|
name: "record_update",
|
|
9814
10053
|
title: "Update a record by id or externalId",
|
|
9815
10054
|
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.",
|
|
9816
|
-
inputSchema:
|
|
10055
|
+
inputSchema: inputSchema6,
|
|
9817
10056
|
handler: async (args) => {
|
|
9818
10057
|
const id = args.id;
|
|
9819
10058
|
const externalId = args.externalId;
|
|
@@ -9839,15 +10078,15 @@ var recordUpdate = ({ client, log }) => ({
|
|
|
9839
10078
|
var record_update_default = recordUpdate;
|
|
9840
10079
|
|
|
9841
10080
|
// src/tools/record_delete.ts
|
|
9842
|
-
import { z as
|
|
9843
|
-
var
|
|
9844
|
-
id:
|
|
10081
|
+
import { z as z7 } from "zod";
|
|
10082
|
+
var inputSchema7 = {
|
|
10083
|
+
id: z7.string().min(1, "id is required").describe("The Vectros record id to delete.")
|
|
9845
10084
|
};
|
|
9846
10085
|
var recordDelete = ({ client, log }) => ({
|
|
9847
10086
|
name: "record_delete",
|
|
9848
10087
|
title: "Delete a record",
|
|
9849
10088
|
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.",
|
|
9850
|
-
inputSchema:
|
|
10089
|
+
inputSchema: inputSchema7,
|
|
9851
10090
|
handler: async (args) => {
|
|
9852
10091
|
const id = args.id;
|
|
9853
10092
|
try {
|
|
@@ -9863,48 +10102,48 @@ var recordDelete = ({ client, log }) => ({
|
|
|
9863
10102
|
var record_delete_default = recordDelete;
|
|
9864
10103
|
|
|
9865
10104
|
// src/tools/rag_ask.ts
|
|
9866
|
-
import { z as
|
|
10105
|
+
import { z as z8 } from "zod";
|
|
9867
10106
|
var SEARCH_MCP_DEFAULT_LIMIT = 5;
|
|
9868
10107
|
var SEARCH_MCP_MAX_LIMIT = 50;
|
|
9869
|
-
var
|
|
9870
|
-
query:
|
|
9871
|
-
instructions:
|
|
10108
|
+
var inputSchema8 = {
|
|
10109
|
+
query: z8.string().min(1, "query must be non-empty").describe("Question to ground against retrieved content."),
|
|
10110
|
+
instructions: z8.string().optional().describe(
|
|
9872
10111
|
'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.'
|
|
9873
10112
|
),
|
|
9874
|
-
model:
|
|
10113
|
+
model: z8.string().optional().describe(
|
|
9875
10114
|
"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."
|
|
9876
10115
|
),
|
|
9877
|
-
search:
|
|
9878
|
-
mode:
|
|
9879
|
-
limit:
|
|
10116
|
+
search: z8.object({
|
|
10117
|
+
mode: z8.enum(["HYBRID", "TEXT", "SEMANTIC"]).optional().describe("Retrieval mode. Default HYBRID."),
|
|
10118
|
+
limit: z8.number().int().min(1).max(SEARCH_MCP_MAX_LIMIT).optional().describe(
|
|
9880
10119
|
`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.`
|
|
9881
10120
|
),
|
|
9882
10121
|
// Retrieval scoping — parity with hybrid_search so an agent can ground the
|
|
9883
10122
|
// answer on a specific owner / folder / type / metadata subset, not just the
|
|
9884
10123
|
// whole-tenant corpus.
|
|
9885
|
-
userId:
|
|
9886
|
-
scope:
|
|
9887
|
-
'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
|
|
10124
|
+
userId: z8.string().optional().describe("Restrict retrieval to content owned by this user (Vectros UUID)."),
|
|
10125
|
+
scope: z8.string().optional().describe(
|
|
10126
|
+
'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.'
|
|
9888
10127
|
),
|
|
9889
|
-
folderId:
|
|
9890
|
-
rootFolderId:
|
|
9891
|
-
typeName:
|
|
9892
|
-
contentTypes:
|
|
9893
|
-
filters:
|
|
10128
|
+
folderId: z8.string().optional().describe("Restrict retrieval to this exact folder."),
|
|
10129
|
+
rootFolderId: z8.string().optional().describe("Restrict retrieval to this folder and all its descendants."),
|
|
10130
|
+
typeName: z8.string().optional().describe("Restrict record retrieval to this schema type."),
|
|
10131
|
+
contentTypes: z8.array(z8.enum(["documents", "records"])).optional().describe('Narrow retrieval to content types. ["documents"] or ["records"]; omit for both.'),
|
|
10132
|
+
filters: z8.record(z8.unknown()).optional().describe(
|
|
9894
10133
|
'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"}.'
|
|
9895
10134
|
),
|
|
9896
|
-
createdAfter:
|
|
9897
|
-
createdBefore:
|
|
9898
|
-
requireComplete:
|
|
10135
|
+
createdAfter: z8.string().optional().describe("Restrict to content created at/after this ISO 8601 UTC timestamp."),
|
|
10136
|
+
createdBefore: z8.string().optional().describe("Restrict to content created at/before this ISO 8601 UTC timestamp."),
|
|
10137
|
+
requireComplete: z8.boolean().optional().describe("Fail closed (503) on a degraded search backend instead of grounding on partial results. Default false.")
|
|
9899
10138
|
}).optional().describe("Retrieval params + scoping. Default mode HYBRID, limit " + SEARCH_MCP_DEFAULT_LIMIT + "."),
|
|
9900
|
-
maxTokens:
|
|
9901
|
-
temperature:
|
|
10139
|
+
maxTokens: z8.number().int().min(1).optional().describe("Max output tokens."),
|
|
10140
|
+
temperature: z8.number().min(0).max(1).optional().describe("Sampling temperature (0.0\u20131.0). Default 0.3 \u2014 lower favors deterministic, retrieval-grounded answers.")
|
|
9902
10141
|
};
|
|
9903
10142
|
var ragAsk = ({ client, log }) => ({
|
|
9904
10143
|
name: "rag_ask",
|
|
9905
10144
|
title: "RAG ask (corpus-wide)",
|
|
9906
10145
|
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.",
|
|
9907
|
-
inputSchema:
|
|
10146
|
+
inputSchema: inputSchema8,
|
|
9908
10147
|
handler: async (args, extra) => {
|
|
9909
10148
|
try {
|
|
9910
10149
|
const searchArg = args.search ?? {};
|
|
@@ -9980,20 +10219,20 @@ var ragAsk = ({ client, log }) => ({
|
|
|
9980
10219
|
var rag_ask_default = ragAsk;
|
|
9981
10220
|
|
|
9982
10221
|
// src/tools/document_ask.ts
|
|
9983
|
-
import { z as
|
|
9984
|
-
var
|
|
9985
|
-
documentId:
|
|
9986
|
-
prompt:
|
|
9987
|
-
model:
|
|
10222
|
+
import { z as z9 } from "zod";
|
|
10223
|
+
var inputSchema9 = {
|
|
10224
|
+
documentId: z9.string().min(1, "documentId is required").describe("ID of the document to ask against."),
|
|
10225
|
+
prompt: z9.string().min(1, "prompt is required").describe("Question to ask about the document."),
|
|
10226
|
+
model: z9.string().optional().describe(
|
|
9988
10227
|
"Inference model alias. Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach."
|
|
9989
10228
|
),
|
|
9990
|
-
maxTokens:
|
|
10229
|
+
maxTokens: z9.number().int().min(1).optional().describe("Max output tokens.")
|
|
9991
10230
|
};
|
|
9992
10231
|
var documentAsk = ({ client, log }) => ({
|
|
9993
10232
|
name: "document_ask",
|
|
9994
10233
|
title: "Document ask (single-document)",
|
|
9995
10234
|
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.",
|
|
9996
|
-
inputSchema:
|
|
10235
|
+
inputSchema: inputSchema9,
|
|
9997
10236
|
handler: async (args, extra) => {
|
|
9998
10237
|
try {
|
|
9999
10238
|
const stream = await client.inference.documentAsk({
|
|
@@ -10052,18 +10291,18 @@ var documentAsk = ({ client, log }) => ({
|
|
|
10052
10291
|
var document_ask_default = documentAsk;
|
|
10053
10292
|
|
|
10054
10293
|
// src/tools/list_schemas.ts
|
|
10055
|
-
import { z as
|
|
10056
|
-
var
|
|
10057
|
-
userId:
|
|
10294
|
+
import { z as z10 } from "zod";
|
|
10295
|
+
var inputSchema10 = {
|
|
10296
|
+
userId: z10.string().optional().describe(
|
|
10058
10297
|
"Filter to schemas visible to a specific user. Optional; default returns all schemas the credential can see."
|
|
10059
10298
|
),
|
|
10060
|
-
scope:
|
|
10061
|
-
'Filter to schemas carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "group:eng-team"). `org` and `client` are
|
|
10299
|
+
scope: z10.string().optional().describe(
|
|
10300
|
+
'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.'
|
|
10062
10301
|
),
|
|
10063
|
-
surface:
|
|
10302
|
+
surface: z10.enum(["record", "document", "user", "entity"]).optional().describe(
|
|
10064
10303
|
"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."
|
|
10065
10304
|
),
|
|
10066
|
-
recordType:
|
|
10305
|
+
recordType: z10.string().optional().describe(
|
|
10067
10306
|
'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.'
|
|
10068
10307
|
)
|
|
10069
10308
|
};
|
|
@@ -10071,7 +10310,7 @@ var listSchemas = ({ client, log }) => ({
|
|
|
10071
10310
|
name: "list_schemas",
|
|
10072
10311
|
title: "List record schemas",
|
|
10073
10312
|
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.',
|
|
10074
|
-
inputSchema:
|
|
10313
|
+
inputSchema: inputSchema10,
|
|
10075
10314
|
handler: async (args) => {
|
|
10076
10315
|
const userId = args.userId;
|
|
10077
10316
|
const scope = args.scope;
|
|
@@ -10097,18 +10336,18 @@ var listSchemas = ({ client, log }) => ({
|
|
|
10097
10336
|
var list_schemas_default = listSchemas;
|
|
10098
10337
|
|
|
10099
10338
|
// src/tools/document_get.ts
|
|
10100
|
-
import { z as
|
|
10339
|
+
import { z as z11 } from "zod";
|
|
10101
10340
|
var MAX_TEXT_CHARS = 32e3;
|
|
10102
|
-
var
|
|
10103
|
-
documentId:
|
|
10104
|
-
externalId:
|
|
10341
|
+
var inputSchema11 = {
|
|
10342
|
+
documentId: z11.string().optional().describe("The document ID returned by document_ingest or hybrid_search. Provide this OR externalId+type."),
|
|
10343
|
+
externalId: z11.string().optional().describe(
|
|
10105
10344
|
"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."
|
|
10106
10345
|
),
|
|
10107
|
-
type:
|
|
10108
|
-
includeText:
|
|
10346
|
+
type: z11.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
10347
|
+
includeText: z11.boolean().optional().describe(
|
|
10109
10348
|
"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."
|
|
10110
10349
|
),
|
|
10111
|
-
includeDownloadUrl:
|
|
10350
|
+
includeDownloadUrl: z11.boolean().optional().describe(
|
|
10112
10351
|
"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."
|
|
10113
10352
|
)
|
|
10114
10353
|
};
|
|
@@ -10125,7 +10364,7 @@ var documentGet = ({ client, log }) => ({
|
|
|
10125
10364
|
name: "document_get",
|
|
10126
10365
|
title: "Get document metadata (and optionally text)",
|
|
10127
10366
|
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.",
|
|
10128
|
-
inputSchema:
|
|
10367
|
+
inputSchema: inputSchema11,
|
|
10129
10368
|
handler: async (args) => {
|
|
10130
10369
|
const documentId = args.documentId;
|
|
10131
10370
|
const externalId = args.externalId;
|
|
@@ -10190,28 +10429,28 @@ var documentGet = ({ client, log }) => ({
|
|
|
10190
10429
|
var document_get_default = documentGet;
|
|
10191
10430
|
|
|
10192
10431
|
// src/tools/document_query.ts
|
|
10193
|
-
import { z as
|
|
10432
|
+
import { z as z12 } from "zod";
|
|
10194
10433
|
var MCP_DEFAULT_LIMIT3 = 3;
|
|
10195
10434
|
var MCP_MAX_LIMIT3 = 100;
|
|
10196
|
-
var
|
|
10435
|
+
var inputSchema12 = {
|
|
10197
10436
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
10198
|
-
field:
|
|
10199
|
-
value:
|
|
10200
|
-
from:
|
|
10201
|
-
to:
|
|
10202
|
-
prefix:
|
|
10203
|
-
order:
|
|
10437
|
+
field: z12.string().optional().describe("Lookup mode: name of the lookup-indexed field to query by."),
|
|
10438
|
+
value: z12.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields too."),
|
|
10439
|
+
from: z12.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Range-enabled, non-sensitive fields only."),
|
|
10440
|
+
to: z12.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
10441
|
+
prefix: z12.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
10442
|
+
order: z12.enum(["asc", "desc"]).optional().describe(
|
|
10204
10443
|
"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."
|
|
10205
10444
|
),
|
|
10206
|
-
type:
|
|
10445
|
+
type: z12.string().optional().describe("Lookup mode: the document type (the bound schema's type). Required with `field`."),
|
|
10207
10446
|
// List-mode args:
|
|
10208
|
-
folderId:
|
|
10209
|
-
userId:
|
|
10210
|
-
scope:
|
|
10211
|
-
'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
|
|
10447
|
+
folderId: z12.string().optional().describe("List mode: only documents in this folder (Vectros folder id)."),
|
|
10448
|
+
userId: z12.string().optional().describe("List mode: scope to documents owned by this user."),
|
|
10449
|
+
scope: z12.string().optional().describe(
|
|
10450
|
+
'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.'
|
|
10212
10451
|
),
|
|
10213
|
-
startFrom:
|
|
10214
|
-
limit:
|
|
10452
|
+
startFrom: z12.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next. Works in both list and lookup mode."),
|
|
10453
|
+
limit: z12.number().int().min(1).max(MCP_MAX_LIMIT3).optional().describe(
|
|
10215
10454
|
`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.`
|
|
10216
10455
|
)
|
|
10217
10456
|
};
|
|
@@ -10219,7 +10458,7 @@ var documentQuery = ({ client, log }) => ({
|
|
|
10219
10458
|
name: "document_query",
|
|
10220
10459
|
title: "Document query (list or lookup)",
|
|
10221
10460
|
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.",
|
|
10222
|
-
inputSchema:
|
|
10461
|
+
inputSchema: inputSchema12,
|
|
10223
10462
|
handler: async (args) => {
|
|
10224
10463
|
const limit = args.limit ?? MCP_DEFAULT_LIMIT3;
|
|
10225
10464
|
const field = args.field;
|
|
@@ -10299,29 +10538,29 @@ var documentQuery = ({ client, log }) => ({
|
|
|
10299
10538
|
var document_query_default = documentQuery;
|
|
10300
10539
|
|
|
10301
10540
|
// src/tools/document_update.ts
|
|
10302
|
-
import { z as
|
|
10303
|
-
var
|
|
10304
|
-
documentId:
|
|
10305
|
-
externalId:
|
|
10541
|
+
import { z as z13 } from "zod";
|
|
10542
|
+
var inputSchema13 = {
|
|
10543
|
+
documentId: z13.string().optional().describe("The Vectros document id to update. Provide this OR externalId+type."),
|
|
10544
|
+
externalId: z13.string().optional().describe(
|
|
10306
10545
|
"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."
|
|
10307
10546
|
),
|
|
10308
|
-
type:
|
|
10309
|
-
title:
|
|
10310
|
-
fields:
|
|
10547
|
+
type: z13.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
10548
|
+
title: z13.string().optional().describe("New title. Omit to keep the current title."),
|
|
10549
|
+
fields: z13.record(z13.string(), z13.unknown()).optional().describe(
|
|
10311
10550
|
"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."
|
|
10312
10551
|
),
|
|
10313
|
-
text:
|
|
10552
|
+
text: z13.string().optional().describe(
|
|
10314
10553
|
"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."
|
|
10315
10554
|
),
|
|
10316
|
-
folderId:
|
|
10317
|
-
status:
|
|
10555
|
+
folderId: z13.string().optional().describe("Move the document into this folder (cannot be cleared once set)."),
|
|
10556
|
+
status: z13.enum(["ACTIVE", "ARCHIVED"]).optional().describe(
|
|
10318
10557
|
"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."
|
|
10319
10558
|
),
|
|
10320
|
-
userId:
|
|
10321
|
-
scopes:
|
|
10322
|
-
'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
|
|
10559
|
+
userId: z13.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
10560
|
+
scopes: z13.array(z13.string()).optional().describe(
|
|
10561
|
+
'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).'
|
|
10323
10562
|
),
|
|
10324
|
-
expectedVersion:
|
|
10563
|
+
expectedVersion: z13.number().int().optional().describe(
|
|
10325
10564
|
"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."
|
|
10326
10565
|
)
|
|
10327
10566
|
};
|
|
@@ -10329,7 +10568,7 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
10329
10568
|
name: "document_update",
|
|
10330
10569
|
title: "Update a document",
|
|
10331
10570
|
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.',
|
|
10332
|
-
inputSchema:
|
|
10571
|
+
inputSchema: inputSchema13,
|
|
10333
10572
|
handler: async (args) => {
|
|
10334
10573
|
const documentId = args.documentId;
|
|
10335
10574
|
const externalId = args.externalId;
|
|
@@ -10369,15 +10608,15 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
10369
10608
|
var document_update_default = documentUpdate;
|
|
10370
10609
|
|
|
10371
10610
|
// src/tools/document_delete.ts
|
|
10372
|
-
import { z as
|
|
10373
|
-
var
|
|
10374
|
-
documentId:
|
|
10611
|
+
import { z as z14 } from "zod";
|
|
10612
|
+
var inputSchema14 = {
|
|
10613
|
+
documentId: z14.string().min(1, "documentId is required").describe("The Vectros document id to delete.")
|
|
10375
10614
|
};
|
|
10376
10615
|
var documentDelete = ({ client, log }) => ({
|
|
10377
10616
|
name: "document_delete",
|
|
10378
10617
|
title: "Delete a document",
|
|
10379
10618
|
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).',
|
|
10380
|
-
inputSchema:
|
|
10619
|
+
inputSchema: inputSchema14,
|
|
10381
10620
|
handler: async (args) => {
|
|
10382
10621
|
const documentId = args.documentId;
|
|
10383
10622
|
try {
|
|
@@ -10395,18 +10634,18 @@ var documentDelete = ({ client, log }) => ({
|
|
|
10395
10634
|
var document_delete_default = documentDelete;
|
|
10396
10635
|
|
|
10397
10636
|
// src/tools/folder_query.ts
|
|
10398
|
-
import { z as
|
|
10637
|
+
import { z as z15 } from "zod";
|
|
10399
10638
|
var MCP_DEFAULT_LIMIT4 = 10;
|
|
10400
10639
|
var MCP_MAX_LIMIT4 = 100;
|
|
10401
|
-
var
|
|
10402
|
-
id:
|
|
10403
|
-
parentId:
|
|
10404
|
-
userId:
|
|
10405
|
-
scope:
|
|
10406
|
-
'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
|
|
10640
|
+
var inputSchema15 = {
|
|
10641
|
+
id: z15.string().optional().describe("Get mode: fetch this single folder by id."),
|
|
10642
|
+
parentId: z15.string().optional().describe("List mode: direct children of this folder (tree navigation). Omit for a flat tenant list."),
|
|
10643
|
+
userId: z15.string().optional().describe("List mode: scope to folders owned by this user."),
|
|
10644
|
+
scope: z15.string().optional().describe(
|
|
10645
|
+
'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.'
|
|
10407
10646
|
),
|
|
10408
|
-
startFrom:
|
|
10409
|
-
limit:
|
|
10647
|
+
startFrom: z15.string().optional().describe("List mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
10648
|
+
limit: z15.number().int().min(1).max(MCP_MAX_LIMIT4).optional().describe(
|
|
10410
10649
|
`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\`.`
|
|
10411
10650
|
)
|
|
10412
10651
|
};
|
|
@@ -10414,7 +10653,7 @@ var folderQuery = ({ client, log }) => ({
|
|
|
10414
10653
|
name: "folder_query",
|
|
10415
10654
|
title: "Folder query (list or get)",
|
|
10416
10655
|
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.",
|
|
10417
|
-
inputSchema:
|
|
10656
|
+
inputSchema: inputSchema15,
|
|
10418
10657
|
handler: async (args) => {
|
|
10419
10658
|
const id = args.id;
|
|
10420
10659
|
try {
|
|
@@ -10444,22 +10683,22 @@ var folderQuery = ({ client, log }) => ({
|
|
|
10444
10683
|
var folder_query_default = folderQuery;
|
|
10445
10684
|
|
|
10446
10685
|
// src/tools/folder_create.ts
|
|
10447
|
-
import { z as
|
|
10448
|
-
var
|
|
10449
|
-
name:
|
|
10450
|
-
description:
|
|
10451
|
-
parentId:
|
|
10452
|
-
slug:
|
|
10453
|
-
userId:
|
|
10454
|
-
scopes:
|
|
10455
|
-
'Scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]). `org` and `client` are
|
|
10686
|
+
import { z as z16 } from "zod";
|
|
10687
|
+
var inputSchema16 = {
|
|
10688
|
+
name: z16.string().min(1, "name is required").describe("Folder display name."),
|
|
10689
|
+
description: z16.string().optional().describe("Optional description of the folder's purpose."),
|
|
10690
|
+
parentId: z16.string().optional().describe("Parent folder id \u2014 places the folder under this parent. Omit for the context default root. Create-only."),
|
|
10691
|
+
slug: z16.string().optional().describe("Optional stable slug (sibling-unique; idempotency key). Lowercase letters/digits/hyphens. Derived from name when omitted."),
|
|
10692
|
+
userId: z16.string().optional().describe("Owning user (Vectros UUID)."),
|
|
10693
|
+
scopes: z16.array(z16.string()).optional().describe(
|
|
10694
|
+
'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.'
|
|
10456
10695
|
)
|
|
10457
10696
|
};
|
|
10458
10697
|
var folderCreate = ({ client, log }) => ({
|
|
10459
10698
|
name: "folder_create",
|
|
10460
10699
|
title: "Create a folder",
|
|
10461
10700
|
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).",
|
|
10462
|
-
inputSchema:
|
|
10701
|
+
inputSchema: inputSchema16,
|
|
10463
10702
|
handler: async (args) => {
|
|
10464
10703
|
try {
|
|
10465
10704
|
const folder = await client.folders.createFolder({
|
|
@@ -10483,16 +10722,16 @@ var folderCreate = ({ client, log }) => ({
|
|
|
10483
10722
|
var folder_create_default = folderCreate;
|
|
10484
10723
|
|
|
10485
10724
|
// src/tools/folder_update.ts
|
|
10486
|
-
import { z as
|
|
10487
|
-
var
|
|
10488
|
-
id:
|
|
10489
|
-
name:
|
|
10490
|
-
description:
|
|
10491
|
-
userId:
|
|
10492
|
-
scopes:
|
|
10493
|
-
'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
|
|
10725
|
+
import { z as z17 } from "zod";
|
|
10726
|
+
var inputSchema17 = {
|
|
10727
|
+
id: z17.string().min(1, "id is required").describe("The Vectros folder id to update."),
|
|
10728
|
+
name: z17.string().optional().describe("New folder name. Omit to keep the current name."),
|
|
10729
|
+
description: z17.string().optional().describe("New description. Omit to leave unchanged."),
|
|
10730
|
+
userId: z17.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
10731
|
+
scopes: z17.array(z17.string()).optional().describe(
|
|
10732
|
+
'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).'
|
|
10494
10733
|
),
|
|
10495
|
-
expectedVersion:
|
|
10734
|
+
expectedVersion: z17.number().int().optional().describe(
|
|
10496
10735
|
"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."
|
|
10497
10736
|
)
|
|
10498
10737
|
};
|
|
@@ -10500,7 +10739,7 @@ var folderUpdate = ({ client, log }) => ({
|
|
|
10500
10739
|
name: "folder_update",
|
|
10501
10740
|
title: "Update a folder",
|
|
10502
10741
|
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.",
|
|
10503
|
-
inputSchema:
|
|
10742
|
+
inputSchema: inputSchema17,
|
|
10504
10743
|
handler: async (args) => {
|
|
10505
10744
|
const id = args.id;
|
|
10506
10745
|
const name = args.name;
|
|
@@ -10527,15 +10766,15 @@ var folderUpdate = ({ client, log }) => ({
|
|
|
10527
10766
|
var folder_update_default = folderUpdate;
|
|
10528
10767
|
|
|
10529
10768
|
// src/tools/folder_delete.ts
|
|
10530
|
-
import { z as
|
|
10531
|
-
var
|
|
10532
|
-
id:
|
|
10769
|
+
import { z as z18 } from "zod";
|
|
10770
|
+
var inputSchema18 = {
|
|
10771
|
+
id: z18.string().min(1, "id is required").describe("The Vectros folder id to delete.")
|
|
10533
10772
|
};
|
|
10534
10773
|
var folderDelete = ({ client, log }) => ({
|
|
10535
10774
|
name: "folder_delete",
|
|
10536
10775
|
title: "Delete a folder",
|
|
10537
10776
|
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.",
|
|
10538
|
-
inputSchema:
|
|
10777
|
+
inputSchema: inputSchema18,
|
|
10539
10778
|
handler: async (args) => {
|
|
10540
10779
|
const id = args.id;
|
|
10541
10780
|
try {
|
|
@@ -10551,14 +10790,14 @@ var folderDelete = ({ client, log }) => ({
|
|
|
10551
10790
|
var folder_delete_default = folderDelete;
|
|
10552
10791
|
|
|
10553
10792
|
// src/tools/current_identity.ts
|
|
10554
|
-
var
|
|
10793
|
+
var inputSchema19 = {
|
|
10555
10794
|
// No args — current_identity describes the current credential.
|
|
10556
10795
|
};
|
|
10557
10796
|
var currentIdentity = ({ log, apiKey, environment }) => ({
|
|
10558
10797
|
name: "current_identity",
|
|
10559
10798
|
title: "Current identity (tenant + principal scope)",
|
|
10560
|
-
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.",
|
|
10561
|
-
inputSchema:
|
|
10799
|
+
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.",
|
|
10800
|
+
inputSchema: inputSchema19,
|
|
10562
10801
|
handler: async () => {
|
|
10563
10802
|
try {
|
|
10564
10803
|
const identity = await resolveIdentity({ log, apiKey, environment });
|
|
@@ -10574,7 +10813,7 @@ var currentIdentity = ({ log, apiKey, environment }) => ({
|
|
|
10574
10813
|
var current_identity_default = currentIdentity;
|
|
10575
10814
|
|
|
10576
10815
|
// src/tools/document_ingest.ts
|
|
10577
|
-
import { z as
|
|
10816
|
+
import { z as z19 } from "zod";
|
|
10578
10817
|
import { readFile, realpath } from "fs/promises";
|
|
10579
10818
|
import { basename, extname, resolve, relative, isAbsolute } from "path";
|
|
10580
10819
|
var IngestPathError = class extends Error {
|
|
@@ -10649,45 +10888,45 @@ function inferMimeType(filePath) {
|
|
|
10649
10888
|
const ext = extname(filePath).toLowerCase();
|
|
10650
10889
|
return EXT_TO_MIME[ext] ?? "application/octet-stream";
|
|
10651
10890
|
}
|
|
10652
|
-
var
|
|
10653
|
-
title:
|
|
10654
|
-
indexMode:
|
|
10891
|
+
var inputSchema20 = {
|
|
10892
|
+
title: z19.string().min(1, "title is required").describe("Human-readable document title \u2014 appears in search results and the UI."),
|
|
10893
|
+
indexMode: z19.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
|
|
10655
10894
|
"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."
|
|
10656
10895
|
),
|
|
10657
|
-
externalId:
|
|
10896
|
+
externalId: z19.string().optional().describe(
|
|
10658
10897
|
'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.'
|
|
10659
10898
|
),
|
|
10660
|
-
upsert:
|
|
10899
|
+
upsert: z19.boolean().optional().describe(
|
|
10661
10900
|
"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)."
|
|
10662
10901
|
),
|
|
10663
|
-
schemaId:
|
|
10902
|
+
schemaId: z19.string().optional().describe(
|
|
10664
10903
|
"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."
|
|
10665
10904
|
),
|
|
10666
|
-
payload:
|
|
10905
|
+
payload: z19.record(z19.string(), z19.unknown()).optional().describe(
|
|
10667
10906
|
"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."
|
|
10668
10907
|
),
|
|
10669
10908
|
// Inline text mode (mutually exclusive with filePath):
|
|
10670
|
-
text:
|
|
10671
|
-
storeText:
|
|
10909
|
+
text: z19.string().min(1).optional().describe("Text body to ingest inline. Mutually exclusive with filePath. Either text or filePath is required."),
|
|
10910
|
+
storeText: z19.boolean().optional().describe(
|
|
10672
10911
|
"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."
|
|
10673
10912
|
),
|
|
10674
10913
|
// File upload mode (mutually exclusive with text; stdio-transport-only):
|
|
10675
|
-
filePath:
|
|
10914
|
+
filePath: z19.string().min(1).optional().describe(
|
|
10676
10915
|
"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."
|
|
10677
10916
|
),
|
|
10678
|
-
fileType:
|
|
10917
|
+
fileType: z19.string().optional().describe('MIME type of the file (e.g. "application/pdf"). Inferred from filePath extension if omitted.'),
|
|
10679
10918
|
// Common (both modes):
|
|
10680
|
-
folderId:
|
|
10681
|
-
userId:
|
|
10682
|
-
scopes:
|
|
10683
|
-
"TEXT MODE ONLY. Scope ownership as `namespace:value` entries, at most 2 (e.g. [\"org:<uuid>\", \"group:eng-team\"]). `org` and `client` are
|
|
10919
|
+
folderId: z19.string().optional().describe("Optional folder to ingest into. Default: tenant root."),
|
|
10920
|
+
userId: z19.string().optional().describe("Owning user ID. Optional."),
|
|
10921
|
+
scopes: z19.array(z19.string()).optional().describe(
|
|
10922
|
+
"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."
|
|
10684
10923
|
)
|
|
10685
10924
|
};
|
|
10686
10925
|
var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
10687
10926
|
name: "document_ingest",
|
|
10688
10927
|
title: "Ingest a new document (text body or file upload)",
|
|
10689
10928
|
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`.",
|
|
10690
|
-
inputSchema:
|
|
10929
|
+
inputSchema: inputSchema20,
|
|
10691
10930
|
handler: async (args) => {
|
|
10692
10931
|
const title = args.title;
|
|
10693
10932
|
const text = args.text;
|
|
@@ -10839,39 +11078,43 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
10839
11078
|
var document_ingest_default = documentIngest;
|
|
10840
11079
|
|
|
10841
11080
|
// src/tools/lookup_principal.ts
|
|
10842
|
-
import { z as
|
|
11081
|
+
import { z as z20 } from "zod";
|
|
10843
11082
|
var MCP_DEFAULT_LIMIT5 = 10;
|
|
10844
11083
|
var MCP_MAX_LIMIT5 = 100;
|
|
10845
|
-
var
|
|
10846
|
-
kind:
|
|
10847
|
-
'Which principal to look up: "user" (the fixed principal surface), or an entity namespace \u2014 "org", "client" (
|
|
11084
|
+
var inputSchema21 = {
|
|
11085
|
+
kind: z20.string().describe(
|
|
11086
|
+
'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.'
|
|
10848
11087
|
),
|
|
10849
|
-
externalId:
|
|
11088
|
+
externalId: z20.string().optional().describe(
|
|
10850
11089
|
"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."
|
|
10851
11090
|
),
|
|
11091
|
+
contextId: z20.string().optional().describe(
|
|
11092
|
+
"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."
|
|
11093
|
+
),
|
|
10852
11094
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
10853
|
-
type:
|
|
10854
|
-
field:
|
|
10855
|
-
value:
|
|
10856
|
-
from:
|
|
10857
|
-
to:
|
|
10858
|
-
prefix:
|
|
10859
|
-
order:
|
|
10860
|
-
startFrom:
|
|
10861
|
-
limit:
|
|
11095
|
+
type: z20.string().optional().describe('Lookup mode: the identity schema\'s record type (e.g. "person_v1"). Required with `field`.'),
|
|
11096
|
+
field: z20.string().optional().describe('Lookup mode: name of the schema-declared lookup field to query by (e.g. "email").'),
|
|
11097
|
+
value: z20.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields."),
|
|
11098
|
+
from: z20.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Non-sensitive fields only."),
|
|
11099
|
+
to: z20.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
11100
|
+
prefix: z20.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
11101
|
+
order: z20.enum(["asc", "desc"]).optional().describe("Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc`."),
|
|
11102
|
+
startFrom: z20.string().optional().describe("Lookup mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
11103
|
+
limit: z20.number().int().min(1).max(MCP_MAX_LIMIT5).optional().describe(
|
|
10862
11104
|
`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\`.`
|
|
10863
11105
|
)
|
|
10864
11106
|
};
|
|
10865
11107
|
var lookupPrincipal = ({ client, log }) => ({
|
|
10866
11108
|
name: "lookup_principal",
|
|
10867
11109
|
title: "Look up a user identity or a namespaced identity entity",
|
|
10868
|
-
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.",
|
|
10869
|
-
inputSchema:
|
|
11110
|
+
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.",
|
|
11111
|
+
inputSchema: inputSchema21,
|
|
10870
11112
|
handler: async (args) => {
|
|
10871
11113
|
const kind = args.kind;
|
|
10872
11114
|
const isUser = kind === "user";
|
|
10873
11115
|
const limit = args.limit ?? MCP_DEFAULT_LIMIT5;
|
|
10874
11116
|
const externalId = args.externalId;
|
|
11117
|
+
const contextId = args.contextId;
|
|
10875
11118
|
const type = args.type;
|
|
10876
11119
|
const field = args.field;
|
|
10877
11120
|
const value = args.value;
|
|
@@ -10880,11 +11123,18 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
10880
11123
|
const prefix = args.prefix;
|
|
10881
11124
|
const order = args.order;
|
|
10882
11125
|
const startFrom = args.startFrom;
|
|
11126
|
+
if (contextId !== void 0 && isUser) {
|
|
11127
|
+
return toolError(
|
|
11128
|
+
"lookup_principal",
|
|
11129
|
+
new Error("'contextId' does not apply to kind 'user' \u2014 the user surface is always tenant-wide.")
|
|
11130
|
+
);
|
|
11131
|
+
}
|
|
11132
|
+
const contextIdArg = contextId !== void 0 ? { contextId } : {};
|
|
10883
11133
|
try {
|
|
10884
11134
|
let page;
|
|
10885
11135
|
if (externalId !== void 0) {
|
|
10886
|
-
page = isUser ? await client.identity.listUsers({ externalId, limit }) : await client.identity.listEntities({ namespace: kind, externalId, limit });
|
|
10887
|
-
log.debug({ tool: "lookup_principal", mode: "resolve", kind }, "lookup_principal resolve ok");
|
|
11136
|
+
page = isUser ? await client.identity.listUsers({ externalId, limit }) : await client.identity.listEntities({ namespace: kind, ...contextIdArg, externalId, limit });
|
|
11137
|
+
log.debug({ tool: "lookup_principal", mode: "resolve", kind, contextId }, "lookup_principal resolve ok");
|
|
10888
11138
|
} else if (field !== void 0) {
|
|
10889
11139
|
const hasEquality = value !== void 0;
|
|
10890
11140
|
const hasRange = from !== void 0 || to !== void 0;
|
|
@@ -10912,8 +11162,8 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
10912
11162
|
);
|
|
10913
11163
|
}
|
|
10914
11164
|
const req = { type, field, value, from, to, prefix, order, startFrom, limit };
|
|
10915
|
-
page = isUser ? await client.identity.lookupUsers(req) : await client.identity.lookupEntities({ namespace: kind, body: req });
|
|
10916
|
-
log.debug({ tool: "lookup_principal", mode: "lookup", kind, type, field }, "lookup_principal lookup ok");
|
|
11165
|
+
page = isUser ? await client.identity.lookupUsers(req) : await client.identity.lookupEntities({ namespace: kind, ...contextIdArg, body: req });
|
|
11166
|
+
log.debug({ tool: "lookup_principal", mode: "lookup", kind, type, field, contextId }, "lookup_principal lookup ok");
|
|
10917
11167
|
} else {
|
|
10918
11168
|
return toolError(
|
|
10919
11169
|
"lookup_principal",
|
|
@@ -10924,7 +11174,7 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
10924
11174
|
const nextCursor = page.nextCursor ?? null;
|
|
10925
11175
|
return { content: [{ type: "text", text: JSON.stringify({ data: principals, nextCursor }, null, 2) }] };
|
|
10926
11176
|
} catch (err) {
|
|
10927
|
-
log.warn({ tool: "lookup_principal", kind, err: String(err) }, "lookup_principal failed");
|
|
11177
|
+
log.warn({ tool: "lookup_principal", kind, contextId, err: String(err) }, "lookup_principal failed");
|
|
10928
11178
|
return toolError("lookup_principal", err);
|
|
10929
11179
|
}
|
|
10930
11180
|
}
|
|
@@ -10932,17 +11182,17 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
10932
11182
|
var lookup_principal_default = lookupPrincipal;
|
|
10933
11183
|
|
|
10934
11184
|
// src/tools/version_history.ts
|
|
10935
|
-
import { z as
|
|
10936
|
-
var
|
|
10937
|
-
resourceType:
|
|
10938
|
-
id:
|
|
10939
|
-
startFrom:
|
|
11185
|
+
import { z as z21 } from "zod";
|
|
11186
|
+
var inputSchema22 = {
|
|
11187
|
+
resourceType: z21.enum(["record", "document"]).describe("Which kind of entity the id refers to: a record or a document."),
|
|
11188
|
+
id: z21.string().min(1, "id is required").describe("The Vectros id of the record or document whose history you want."),
|
|
11189
|
+
startFrom: z21.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch older entries.")
|
|
10940
11190
|
};
|
|
10941
11191
|
var versionHistory = ({ client, log }) => ({
|
|
10942
11192
|
name: "version_history",
|
|
10943
11193
|
title: "Version history (record or document)",
|
|
10944
11194
|
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.",
|
|
10945
|
-
inputSchema:
|
|
11195
|
+
inputSchema: inputSchema22,
|
|
10946
11196
|
handler: async (args) => {
|
|
10947
11197
|
const resourceType = args.resourceType;
|
|
10948
11198
|
const id = args.id;
|
|
@@ -10969,6 +11219,7 @@ var TOOL_NAMES = [
|
|
|
10969
11219
|
"hybrid_search",
|
|
10970
11220
|
"record_query",
|
|
10971
11221
|
"record_get",
|
|
11222
|
+
"record_batch_get",
|
|
10972
11223
|
"record_create",
|
|
10973
11224
|
"record_update",
|
|
10974
11225
|
"record_delete",
|
|
@@ -10994,6 +11245,7 @@ var ALL_TOOL_FACTORIES = {
|
|
|
10994
11245
|
hybrid_search: hybrid_search_default,
|
|
10995
11246
|
record_query: record_query_default,
|
|
10996
11247
|
record_get: record_get_default,
|
|
11248
|
+
record_batch_get: record_batch_get_default,
|
|
10997
11249
|
record_create: record_create_default,
|
|
10998
11250
|
record_update: record_update_default,
|
|
10999
11251
|
record_delete: record_delete_default,
|
|
@@ -11035,7 +11287,7 @@ var identityResource = ({ log, apiKey, environment }) => ({
|
|
|
11035
11287
|
name: "identity",
|
|
11036
11288
|
uri: "vectros://identity",
|
|
11037
11289
|
title: "Current identity (tenant + principal scope)",
|
|
11038
|
-
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[] }),
|
|
11290
|
+
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.",
|
|
11039
11291
|
mimeType: "application/json",
|
|
11040
11292
|
read: async () => {
|
|
11041
11293
|
const identity = await resolveIdentity({ log, apiKey, environment });
|
|
@@ -11054,7 +11306,7 @@ var ALL_RESOURCE_FACTORIES = {
|
|
|
11054
11306
|
};
|
|
11055
11307
|
|
|
11056
11308
|
// src/zod-to-json-schema.ts
|
|
11057
|
-
import { z as
|
|
11309
|
+
import { z as z22 } from "zod";
|
|
11058
11310
|
function zodShapeToJsonSchema(shape) {
|
|
11059
11311
|
const properties = {};
|
|
11060
11312
|
const required = [];
|
|
@@ -11069,40 +11321,40 @@ function zodShapeToJsonSchema(shape) {
|
|
|
11069
11321
|
function zodTypeToJsonSchema(schema) {
|
|
11070
11322
|
const description = schema.description;
|
|
11071
11323
|
let current = schema;
|
|
11072
|
-
while (current instanceof
|
|
11324
|
+
while (current instanceof z22.ZodOptional || current instanceof z22.ZodDefault || current instanceof z22.ZodNullable) {
|
|
11073
11325
|
current = current._def.innerType;
|
|
11074
11326
|
}
|
|
11075
11327
|
const base = description ? { description } : {};
|
|
11076
|
-
if (current instanceof
|
|
11328
|
+
if (current instanceof z22.ZodString) {
|
|
11077
11329
|
return { ...base, type: "string" };
|
|
11078
11330
|
}
|
|
11079
|
-
if (current instanceof
|
|
11331
|
+
if (current instanceof z22.ZodNumber) {
|
|
11080
11332
|
return { ...base, type: "number" };
|
|
11081
11333
|
}
|
|
11082
|
-
if (current instanceof
|
|
11334
|
+
if (current instanceof z22.ZodBoolean) {
|
|
11083
11335
|
return { ...base, type: "boolean" };
|
|
11084
11336
|
}
|
|
11085
|
-
if (current instanceof
|
|
11337
|
+
if (current instanceof z22.ZodEnum) {
|
|
11086
11338
|
return {
|
|
11087
11339
|
...base,
|
|
11088
11340
|
type: "string",
|
|
11089
11341
|
enum: current.options
|
|
11090
11342
|
};
|
|
11091
11343
|
}
|
|
11092
|
-
if (current instanceof
|
|
11344
|
+
if (current instanceof z22.ZodArray) {
|
|
11093
11345
|
return {
|
|
11094
11346
|
...base,
|
|
11095
11347
|
type: "array",
|
|
11096
11348
|
items: zodTypeToJsonSchema(current.element)
|
|
11097
11349
|
};
|
|
11098
11350
|
}
|
|
11099
|
-
if (current instanceof
|
|
11351
|
+
if (current instanceof z22.ZodObject) {
|
|
11100
11352
|
return {
|
|
11101
11353
|
...base,
|
|
11102
11354
|
...zodShapeToJsonSchema(current.shape)
|
|
11103
11355
|
};
|
|
11104
11356
|
}
|
|
11105
|
-
if (current instanceof
|
|
11357
|
+
if (current instanceof z22.ZodRecord) {
|
|
11106
11358
|
const valueType = current._def.valueType;
|
|
11107
11359
|
return {
|
|
11108
11360
|
...base,
|
|
@@ -11226,7 +11478,7 @@ var VectrosMCPServer = class {
|
|
|
11226
11478
|
if (!tool) {
|
|
11227
11479
|
result = toolError(req.params.name ?? "unknown", new Error("No such tool."));
|
|
11228
11480
|
} else {
|
|
11229
|
-
const parsed =
|
|
11481
|
+
const parsed = z23.object(tool.inputSchema).strict().safeParse(req.params.arguments ?? {});
|
|
11230
11482
|
if (!parsed.success) {
|
|
11231
11483
|
result = toolError(tool.name, new Error(formatArgError(tool, parsed.error)));
|
|
11232
11484
|
} else {
|