@usecontextlayer/ctxb 0.5.6 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +120 -5
- package/dist/cli.mjs.map +1 -1
- package/package.json +5 -5
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f9dea1ba-a76f-5d46-a485-6a9e6f541542")}catch(e){}}();
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as Sentry from "@sentry/node";
|
|
6
6
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
@@ -60,7 +60,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
60
60
|
|
|
61
61
|
//#endregion
|
|
62
62
|
//#region package.json
|
|
63
|
-
var version$1 = "0.5.
|
|
63
|
+
var version$1 = "0.5.8";
|
|
64
64
|
|
|
65
65
|
//#endregion
|
|
66
66
|
//#region sentry.ts
|
|
@@ -6891,7 +6891,14 @@ const CreateBindingInput = object$1({
|
|
|
6891
6891
|
models: BindingModels.optionalNullable(),
|
|
6892
6892
|
pluginId: property("plugin_id", string$2())
|
|
6893
6893
|
});
|
|
6894
|
+
const UpdateBindingInput = object$1({
|
|
6895
|
+
auth: BindingAuthInput.optional(),
|
|
6896
|
+
config: record$1(string$2(), unknown$1()).optional(),
|
|
6897
|
+
enabled: boolean$2().optional(),
|
|
6898
|
+
models: BindingModels.optionalNullable()
|
|
6899
|
+
});
|
|
6894
6900
|
const Binding = object$1({
|
|
6901
|
+
auth: BindingAuthInput,
|
|
6895
6902
|
authType: property("auth_type", string$2()),
|
|
6896
6903
|
baseId: property("base_id", string$2()),
|
|
6897
6904
|
bindingId: property("binding_id", string$2()),
|
|
@@ -7383,6 +7390,83 @@ var BindingsClient = class {
|
|
|
7383
7390
|
}
|
|
7384
7391
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/base/bases/{base_id}/bindings");
|
|
7385
7392
|
}
|
|
7393
|
+
/**
|
|
7394
|
+
* @param {BaseAPI.UpdateBindingInput} request
|
|
7395
|
+
* @param {BindingsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7396
|
+
*
|
|
7397
|
+
* @throws {@link BaseAPI.BadRequestError}
|
|
7398
|
+
* @throws {@link BaseAPI.ForbiddenError}
|
|
7399
|
+
* @throws {@link BaseAPI.NotFoundError}
|
|
7400
|
+
*
|
|
7401
|
+
* @example
|
|
7402
|
+
* await client.bindings.updateBinding({
|
|
7403
|
+
* baseId: "base_id",
|
|
7404
|
+
* bindingId: "binding_id"
|
|
7405
|
+
* })
|
|
7406
|
+
*/
|
|
7407
|
+
updateBinding(request, requestOptions) {
|
|
7408
|
+
return HttpResponsePromise.fromPromise(this.__updateBinding(request, requestOptions));
|
|
7409
|
+
}
|
|
7410
|
+
async __updateBinding(request, requestOptions) {
|
|
7411
|
+
const { baseId, bindingId, ..._body } = request;
|
|
7412
|
+
const _headers = mergeHeaders(this._options?.headers, requestOptions?.headers);
|
|
7413
|
+
const _response = await fetcher({
|
|
7414
|
+
url: join(await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment), `base/bases/${encodePathParam(baseId)}/bindings/${encodePathParam(bindingId)}`),
|
|
7415
|
+
method: "PATCH",
|
|
7416
|
+
headers: _headers,
|
|
7417
|
+
contentType: "application/json",
|
|
7418
|
+
queryString: queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
7419
|
+
requestType: "json",
|
|
7420
|
+
body: UpdateBindingInput.jsonOrThrow(_body, {
|
|
7421
|
+
unrecognizedObjectKeys: "strip",
|
|
7422
|
+
omitUndefined: true
|
|
7423
|
+
}),
|
|
7424
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
7425
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
7426
|
+
abortSignal: requestOptions?.abortSignal,
|
|
7427
|
+
fetchFn: this._options?.fetch,
|
|
7428
|
+
logging: this._options.logging
|
|
7429
|
+
});
|
|
7430
|
+
if (_response.ok) return {
|
|
7431
|
+
data: Binding.parseOrThrow(_response.body, {
|
|
7432
|
+
unrecognizedObjectKeys: "passthrough",
|
|
7433
|
+
allowUnrecognizedUnionMembers: true,
|
|
7434
|
+
allowUnrecognizedEnumValues: true,
|
|
7435
|
+
skipValidation: true,
|
|
7436
|
+
breadcrumbsPrefix: ["response"]
|
|
7437
|
+
}),
|
|
7438
|
+
rawResponse: _response.rawResponse
|
|
7439
|
+
};
|
|
7440
|
+
if (_response.error.reason === "status-code") switch (_response.error.statusCode) {
|
|
7441
|
+
case 400: throw new BadRequestError(Error_.parseOrThrow(_response.error.body, {
|
|
7442
|
+
unrecognizedObjectKeys: "passthrough",
|
|
7443
|
+
allowUnrecognizedUnionMembers: true,
|
|
7444
|
+
allowUnrecognizedEnumValues: true,
|
|
7445
|
+
skipValidation: true,
|
|
7446
|
+
breadcrumbsPrefix: ["response"]
|
|
7447
|
+
}), _response.rawResponse);
|
|
7448
|
+
case 403: throw new ForbiddenError(Error_.parseOrThrow(_response.error.body, {
|
|
7449
|
+
unrecognizedObjectKeys: "passthrough",
|
|
7450
|
+
allowUnrecognizedUnionMembers: true,
|
|
7451
|
+
allowUnrecognizedEnumValues: true,
|
|
7452
|
+
skipValidation: true,
|
|
7453
|
+
breadcrumbsPrefix: ["response"]
|
|
7454
|
+
}), _response.rawResponse);
|
|
7455
|
+
case 404: throw new NotFoundError(Error_.parseOrThrow(_response.error.body, {
|
|
7456
|
+
unrecognizedObjectKeys: "passthrough",
|
|
7457
|
+
allowUnrecognizedUnionMembers: true,
|
|
7458
|
+
allowUnrecognizedEnumValues: true,
|
|
7459
|
+
skipValidation: true,
|
|
7460
|
+
breadcrumbsPrefix: ["response"]
|
|
7461
|
+
}), _response.rawResponse);
|
|
7462
|
+
default: throw new BaseAPIError({
|
|
7463
|
+
statusCode: _response.error.statusCode,
|
|
7464
|
+
body: _response.error.body,
|
|
7465
|
+
rawResponse: _response.rawResponse
|
|
7466
|
+
});
|
|
7467
|
+
}
|
|
7468
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/base/bases/{base_id}/bindings/{binding_id}");
|
|
7469
|
+
}
|
|
7386
7470
|
};
|
|
7387
7471
|
var DsnClient = class {
|
|
7388
7472
|
_options;
|
|
@@ -12191,8 +12275,19 @@ const pluginAuthSchema = discriminatedUnion("type", [
|
|
|
12191
12275
|
pluginAuthClientCredentialsSchema,
|
|
12192
12276
|
pluginOAuthSchema
|
|
12193
12277
|
]).meta({ title: "PluginAuth" });
|
|
12278
|
+
const pluginMcpHttpServerSchema = strictObject({
|
|
12279
|
+
type: literal("http"),
|
|
12280
|
+
url: url()
|
|
12281
|
+
}).meta({ title: "PluginMcpHttpServer" });
|
|
12282
|
+
const pluginMcpModuleServerSchema = strictObject({
|
|
12283
|
+
module: string().trim().min(1),
|
|
12284
|
+
type: literal("module")
|
|
12285
|
+
}).meta({ title: "PluginMcpModuleServer" });
|
|
12286
|
+
const pluginMcpServerSchema = discriminatedUnion("type", [pluginMcpHttpServerSchema, pluginMcpModuleServerSchema]).meta({ title: "PluginMcpServer" });
|
|
12287
|
+
const mcpServerNameSchema = string().regex(/^[a-z0-9]+(?:_[a-z0-9]+)*$/);
|
|
12194
12288
|
const pluginManifestSchema = strictObject({
|
|
12195
12289
|
auth: pluginAuthSchema,
|
|
12290
|
+
mcpServers: record(mcpServerNameSchema, pluginMcpServerSchema).optional(),
|
|
12196
12291
|
mode: modeSchema,
|
|
12197
12292
|
plugin_id: string().trim().min(1),
|
|
12198
12293
|
skill: string().optional()
|
|
@@ -12294,12 +12389,28 @@ const pluginRegistry = [
|
|
|
12294
12389
|
plugin_id: "microsoft_calendar"
|
|
12295
12390
|
},
|
|
12296
12391
|
{
|
|
12297
|
-
auth: {
|
|
12392
|
+
auth: {
|
|
12393
|
+
provider_id: "microsoft",
|
|
12394
|
+
scopes: ["Mail.ReadWrite", "Mail.Send"],
|
|
12395
|
+
type: "oauth"
|
|
12396
|
+
},
|
|
12397
|
+
mcpServers: { microsoft_mail: {
|
|
12398
|
+
type: "http",
|
|
12399
|
+
url: "https://mcp-microsoft-365.usecontextlayer.com/mcp"
|
|
12400
|
+
} },
|
|
12298
12401
|
mode: "dagster",
|
|
12299
12402
|
plugin_id: "microsoft_mail"
|
|
12300
12403
|
},
|
|
12301
12404
|
{
|
|
12302
|
-
auth: {
|
|
12405
|
+
auth: {
|
|
12406
|
+
provider_id: "microsoft-dataverse",
|
|
12407
|
+
scopes: [],
|
|
12408
|
+
type: "oauth"
|
|
12409
|
+
},
|
|
12410
|
+
mcpServers: { microsoft_planner_premium: {
|
|
12411
|
+
module: "@usecontextlayer/mcp-microsoft-planner-premium",
|
|
12412
|
+
type: "module"
|
|
12413
|
+
} },
|
|
12303
12414
|
mode: "dagster",
|
|
12304
12415
|
plugin_id: "microsoft_planner_premium"
|
|
12305
12416
|
},
|
|
@@ -12396,6 +12507,10 @@ async function loadPluginManifest(pluginIdInput) {
|
|
|
12396
12507
|
async function listPluginManifests() {
|
|
12397
12508
|
return [...(await getManifestIndex()).values()].sort((left, right) => left.plugin_id.localeCompare(right.plugin_id));
|
|
12398
12509
|
}
|
|
12510
|
+
const providerTokenLeaseSchema = object({
|
|
12511
|
+
accessToken: string().min(1),
|
|
12512
|
+
accessTokenExpiresAt: datetime({ offset: true }).transform((value) => new Date(value)).nullable()
|
|
12513
|
+
}).meta({ title: "ProviderTokenLease" });
|
|
12399
12514
|
|
|
12400
12515
|
//#endregion
|
|
12401
12516
|
//#region bindings/new.ts
|
|
@@ -28464,4 +28579,4 @@ runCli().catch((error) => {
|
|
|
28464
28579
|
//#endregion
|
|
28465
28580
|
export { createProgram, runCli };
|
|
28466
28581
|
//# sourceMappingURL=cli.mjs.map
|
|
28467
|
-
//# debugId=
|
|
28582
|
+
//# debugId=f9dea1ba-a76f-5d46-a485-6a9e6f541542
|