@hasna/skills 0.5.2 → 0.5.4
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/README.md +169 -1
- package/bin/index.js +1541 -1042
- package/bin/mcp.js +28461 -27173
- package/bin/migrate.js +9 -1
- package/bin/server.js +80 -56
- package/bin/worker.js +80 -56
- package/dist/admin-contract.js +168 -166
- package/dist/cli/commands/invitation-recovery.d.ts +2 -0
- package/dist/cli/commands/invitation-verification.d.ts +8 -0
- package/dist/cli/commands/workspace-invitations.d.ts +2 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +1516 -611
- package/dist/lib/invitation-customer-action.d.ts +14 -0
- package/dist/lib/invitation-recovery-target.d.ts +5 -0
- package/dist/lib/remote-auth.d.ts +12 -0
- package/dist/lib/remote-client.d.ts +19 -0
- package/dist/lib/remote-invitation-recovery.d.ts +62 -0
- package/dist/lib/remote-invitations.d.ts +128 -0
- package/dist/lib/remote-quote-errors.d.ts +12 -0
- package/dist/lib/skill-bundle.d.ts +54 -1
- package/dist/lib/skill-entry-path.d.ts +6 -0
- package/dist/lib/skill-hash.d.ts +33 -0
- package/dist/mcp/index.d.ts +0 -1
- package/dist/mcp/invitation-recovery.d.ts +2 -0
- package/dist/mcp/remote-invitation-tools.d.ts +2 -0
- package/dist/sdk/index.d.ts +5 -1
- package/dist/sdk/index.js +1316 -389
- package/dist/sdk/registry.d.ts +6 -0
- package/dist/storage.js +35 -33
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -20,12 +20,14 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
20
20
|
}
|
|
21
21
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
22
22
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
24
|
+
for (let key of __getOwnPropNames(mod))
|
|
25
|
+
if (!__hasOwnProp.call(to, key))
|
|
26
|
+
__defProp(to, key, {
|
|
27
|
+
get: __accessProp.bind(mod, key),
|
|
28
|
+
enumerable: true
|
|
29
|
+
});
|
|
30
|
+
}
|
|
29
31
|
if (canCache)
|
|
30
32
|
cache.set(mod, to);
|
|
31
33
|
return to;
|
|
@@ -48,7 +50,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
|
48
50
|
var __require = import.meta.require;
|
|
49
51
|
|
|
50
52
|
// ../../node_modules/.bun/react@18.3.1/node_modules/react/cjs/react.development.js
|
|
51
|
-
var require_react_development = __commonJS((exports, module)
|
|
53
|
+
var require_react_development = __commonJS(function(exports, module) {
|
|
52
54
|
if (true) {
|
|
53
55
|
(function() {
|
|
54
56
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
@@ -1851,7 +1853,7 @@ Check the top-level render call using <` + parentName + ">.";
|
|
|
1851
1853
|
});
|
|
1852
1854
|
|
|
1853
1855
|
// ../../node_modules/.bun/react@18.3.1/node_modules/react/index.js
|
|
1854
|
-
var require_react = __commonJS((exports, module)
|
|
1856
|
+
var require_react = __commonJS(function(exports, module) {
|
|
1855
1857
|
var react_development = __toESM(require_react_development());
|
|
1856
1858
|
if (false) {} else {
|
|
1857
1859
|
module.exports = react_development;
|
|
@@ -1859,7 +1861,7 @@ var require_react = __commonJS((exports, module) => {
|
|
|
1859
1861
|
});
|
|
1860
1862
|
|
|
1861
1863
|
// ../../node_modules/.bun/signal-exit@3.0.7/node_modules/signal-exit/signals.js
|
|
1862
|
-
var require_signals = __commonJS((exports, module)
|
|
1864
|
+
var require_signals = __commonJS(function(exports, module) {
|
|
1863
1865
|
module.exports = [
|
|
1864
1866
|
"SIGABRT",
|
|
1865
1867
|
"SIGALRM",
|
|
@@ -1876,7 +1878,7 @@ var require_signals = __commonJS((exports, module) => {
|
|
|
1876
1878
|
});
|
|
1877
1879
|
|
|
1878
1880
|
// ../../node_modules/.bun/signal-exit@3.0.7/node_modules/signal-exit/index.js
|
|
1879
|
-
var require_signal_exit = __commonJS((exports, module)
|
|
1881
|
+
var require_signal_exit = __commonJS(function(exports, module) {
|
|
1880
1882
|
var process3 = global.process;
|
|
1881
1883
|
var processOk = function(process4) {
|
|
1882
1884
|
return process4 && typeof process4 === "object" && typeof process4.removeListener === "function" && typeof process4.emit === "function" && typeof process4.reallyExit === "function" && typeof process4.listeners === "function" && typeof process4.kill === "function" && typeof process4.pid === "number" && typeof process4.on === "function";
|
|
@@ -2029,7 +2031,7 @@ var require_signal_exit = __commonJS((exports, module) => {
|
|
|
2029
2031
|
});
|
|
2030
2032
|
|
|
2031
2033
|
// ../../node_modules/.bun/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.development.js
|
|
2032
|
-
var require_scheduler_development = __commonJS((exports)
|
|
2034
|
+
var require_scheduler_development = __commonJS(function(exports) {
|
|
2033
2035
|
if (true) {
|
|
2034
2036
|
(function() {
|
|
2035
2037
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
@@ -2472,7 +2474,7 @@ var require_scheduler_development = __commonJS((exports) => {
|
|
|
2472
2474
|
});
|
|
2473
2475
|
|
|
2474
2476
|
// ../../node_modules/.bun/scheduler@0.23.2/node_modules/scheduler/index.js
|
|
2475
|
-
var require_scheduler = __commonJS((exports, module)
|
|
2477
|
+
var require_scheduler = __commonJS(function(exports, module) {
|
|
2476
2478
|
var scheduler_development = __toESM(require_scheduler_development());
|
|
2477
2479
|
if (false) {} else {
|
|
2478
2480
|
module.exports = scheduler_development;
|
|
@@ -2480,7 +2482,7 @@ var require_scheduler = __commonJS((exports, module) => {
|
|
|
2480
2482
|
});
|
|
2481
2483
|
|
|
2482
2484
|
// ../../node_modules/.bun/react-reconciler@0.29.2+f4eacebf2041cd4f/node_modules/react-reconciler/cjs/react-reconciler.development.js
|
|
2483
|
-
var require_react_reconciler_development = __commonJS((exports, module)
|
|
2485
|
+
var require_react_reconciler_development = __commonJS(function(exports, module) {
|
|
2484
2486
|
var React = __toESM(require_react());
|
|
2485
2487
|
var Scheduler = __toESM(require_scheduler());
|
|
2486
2488
|
if (true) {
|
|
@@ -17226,14 +17228,14 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
17226
17228
|
});
|
|
17227
17229
|
|
|
17228
17230
|
// ../../node_modules/.bun/react-reconciler@0.29.2+f4eacebf2041cd4f/node_modules/react-reconciler/index.js
|
|
17229
|
-
var require_react_reconciler = __commonJS((exports, module)
|
|
17231
|
+
var require_react_reconciler = __commonJS(function(exports, module) {
|
|
17230
17232
|
if (false) {} else {
|
|
17231
17233
|
module.exports = require_react_reconciler_development();
|
|
17232
17234
|
}
|
|
17233
17235
|
});
|
|
17234
17236
|
|
|
17235
17237
|
// ../../node_modules/.bun/react-reconciler@0.29.2+f4eacebf2041cd4f/node_modules/react-reconciler/cjs/react-reconciler-constants.development.js
|
|
17236
|
-
var require_react_reconciler_constants_development = __commonJS((exports)
|
|
17238
|
+
var require_react_reconciler_constants_development = __commonJS(function(exports) {
|
|
17237
17239
|
if (true) {
|
|
17238
17240
|
(function() {
|
|
17239
17241
|
var SyncLane = 1;
|
|
@@ -17257,7 +17259,7 @@ var require_react_reconciler_constants_development = __commonJS((exports) => {
|
|
|
17257
17259
|
});
|
|
17258
17260
|
|
|
17259
17261
|
// ../../node_modules/.bun/react-reconciler@0.29.2+f4eacebf2041cd4f/node_modules/react-reconciler/constants.js
|
|
17260
|
-
var require_constants = __commonJS((exports, module)
|
|
17262
|
+
var require_constants = __commonJS(function(exports, module) {
|
|
17261
17263
|
if (false) {} else {
|
|
17262
17264
|
module.exports = require_react_reconciler_constants_development();
|
|
17263
17265
|
}
|
|
@@ -17317,7 +17319,7 @@ var init_devtools_window_polyfill = __esm(() => {
|
|
|
17317
17319
|
});
|
|
17318
17320
|
|
|
17319
17321
|
// ../../node_modules/.bun/react-devtools-core@7.0.1/node_modules/react-devtools-core/dist/backend.js
|
|
17320
|
-
var require_backend = __commonJS((exports, module)
|
|
17322
|
+
var require_backend = __commonJS(function(exports, module) {
|
|
17321
17323
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
17322
17324
|
if (typeof exports === "object" && typeof module === "object")
|
|
17323
17325
|
module.exports = factory();
|
|
@@ -34120,7 +34122,7 @@ var init_devtools = __esm(() => {
|
|
|
34120
34122
|
});
|
|
34121
34123
|
|
|
34122
34124
|
// ../../node_modules/.bun/cli-boxes@3.0.0/node_modules/cli-boxes/boxes.json
|
|
34123
|
-
var require_boxes = __commonJS((exports, module)
|
|
34125
|
+
var require_boxes = __commonJS(function(exports, module) {
|
|
34124
34126
|
module.exports = {
|
|
34125
34127
|
single: {
|
|
34126
34128
|
topLeft: "\u250C",
|
|
@@ -34206,7 +34208,7 @@ var require_boxes = __commonJS((exports, module) => {
|
|
|
34206
34208
|
});
|
|
34207
34209
|
|
|
34208
34210
|
// ../../node_modules/.bun/cli-boxes@3.0.0/node_modules/cli-boxes/index.js
|
|
34209
|
-
var require_cli_boxes = __commonJS((exports, module)
|
|
34211
|
+
var require_cli_boxes = __commonJS(function(exports, module) {
|
|
34210
34212
|
var cliBoxes = require_boxes();
|
|
34211
34213
|
module.exports = cliBoxes;
|
|
34212
34214
|
module.exports.default = cliBoxes;
|
|
@@ -34702,7 +34704,7 @@ var init_source = __esm(() => {
|
|
|
34702
34704
|
});
|
|
34703
34705
|
|
|
34704
34706
|
// ../../node_modules/.bun/mimic-fn@2.1.0/node_modules/mimic-fn/index.js
|
|
34705
|
-
var require_mimic_fn = __commonJS((exports, module)
|
|
34707
|
+
var require_mimic_fn = __commonJS(function(exports, module) {
|
|
34706
34708
|
var mimicFn = (to, from) => {
|
|
34707
34709
|
for (const prop of Reflect.ownKeys(from)) {
|
|
34708
34710
|
Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
|
|
@@ -34714,7 +34716,7 @@ var require_mimic_fn = __commonJS((exports, module) => {
|
|
|
34714
34716
|
});
|
|
34715
34717
|
|
|
34716
34718
|
// ../../node_modules/.bun/onetime@5.1.2/node_modules/onetime/index.js
|
|
34717
|
-
var require_onetime = __commonJS((exports, module)
|
|
34719
|
+
var require_onetime = __commonJS(function(exports, module) {
|
|
34718
34720
|
var mimicFn = require_mimic_fn();
|
|
34719
34721
|
var calledFunctions = new WeakMap;
|
|
34720
34722
|
var onetime = (function_, options = {}) => {
|
|
@@ -34749,7 +34751,7 @@ var require_onetime = __commonJS((exports, module) => {
|
|
|
34749
34751
|
});
|
|
34750
34752
|
|
|
34751
34753
|
// ../../node_modules/.bun/escape-string-regexp@2.0.0/node_modules/escape-string-regexp/index.js
|
|
34752
|
-
var require_escape_string_regexp = __commonJS((exports, module)
|
|
34754
|
+
var require_escape_string_regexp = __commonJS(function(exports, module) {
|
|
34753
34755
|
var matchOperatorsRegex = /[|\\{}()[\]^$+*?.-]/g;
|
|
34754
34756
|
module.exports = (string) => {
|
|
34755
34757
|
if (typeof string !== "string") {
|
|
@@ -34760,7 +34762,7 @@ var require_escape_string_regexp = __commonJS((exports, module) => {
|
|
|
34760
34762
|
});
|
|
34761
34763
|
|
|
34762
34764
|
// ../../node_modules/.bun/stack-utils@2.0.6/node_modules/stack-utils/index.js
|
|
34763
|
-
var require_stack_utils = __commonJS((exports, module)
|
|
34765
|
+
var require_stack_utils = __commonJS(function(exports, module) {
|
|
34764
34766
|
var escapeStringRegexp = require_escape_string_regexp();
|
|
34765
34767
|
var cwd = typeof process === "object" && process && typeof process.cwd === "function" ? process.cwd() : ".";
|
|
34766
34768
|
var natives = [].concat(__require("module").builtinModules, "bootstrap_node", "node").map((n) => new RegExp(`(?:\\((?:node:)?${n}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${n}(?:\\.js)?:\\d+:\\d+$)`));
|
|
@@ -34998,7 +35000,7 @@ var require_stack_utils = __commonJS((exports, module) => {
|
|
|
34998
35000
|
});
|
|
34999
35001
|
|
|
35000
35002
|
// ../../node_modules/.bun/commander@12.1.0/node_modules/commander/lib/error.js
|
|
35001
|
-
var require_error = __commonJS((exports)
|
|
35003
|
+
var require_error = __commonJS(function(exports) {
|
|
35002
35004
|
class CommanderError extends Error {
|
|
35003
35005
|
constructor(exitCode, code, message) {
|
|
35004
35006
|
super(message);
|
|
@@ -35022,7 +35024,7 @@ var require_error = __commonJS((exports) => {
|
|
|
35022
35024
|
});
|
|
35023
35025
|
|
|
35024
35026
|
// ../../node_modules/.bun/commander@12.1.0/node_modules/commander/lib/argument.js
|
|
35025
|
-
var require_argument = __commonJS((exports)
|
|
35027
|
+
var require_argument = __commonJS(function(exports) {
|
|
35026
35028
|
var { InvalidArgumentError } = require_error();
|
|
35027
35029
|
|
|
35028
35030
|
class Argument {
|
|
@@ -35101,7 +35103,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
35101
35103
|
});
|
|
35102
35104
|
|
|
35103
35105
|
// ../../node_modules/.bun/commander@12.1.0/node_modules/commander/lib/help.js
|
|
35104
|
-
var require_help = __commonJS((exports)
|
|
35106
|
+
var require_help = __commonJS(function(exports) {
|
|
35105
35107
|
var { humanReadableArgName } = require_argument();
|
|
35106
35108
|
|
|
35107
35109
|
class Help {
|
|
@@ -35350,7 +35352,7 @@ var require_help = __commonJS((exports) => {
|
|
|
35350
35352
|
});
|
|
35351
35353
|
|
|
35352
35354
|
// ../../node_modules/.bun/commander@12.1.0/node_modules/commander/lib/option.js
|
|
35353
|
-
var require_option = __commonJS((exports)
|
|
35355
|
+
var require_option = __commonJS(function(exports) {
|
|
35354
35356
|
var { InvalidArgumentError } = require_error();
|
|
35355
35357
|
|
|
35356
35358
|
class Option {
|
|
@@ -35501,7 +35503,7 @@ var require_option = __commonJS((exports) => {
|
|
|
35501
35503
|
});
|
|
35502
35504
|
|
|
35503
35505
|
// ../../node_modules/.bun/commander@12.1.0/node_modules/commander/lib/suggestSimilar.js
|
|
35504
|
-
var require_suggestSimilar = __commonJS((exports)
|
|
35506
|
+
var require_suggestSimilar = __commonJS(function(exports) {
|
|
35505
35507
|
var maxDistance = 3;
|
|
35506
35508
|
function editDistance(a, b) {
|
|
35507
35509
|
if (Math.abs(a.length - b.length) > maxDistance)
|
|
@@ -35574,7 +35576,7 @@ var require_suggestSimilar = __commonJS((exports) => {
|
|
|
35574
35576
|
});
|
|
35575
35577
|
|
|
35576
35578
|
// ../../node_modules/.bun/commander@12.1.0/node_modules/commander/lib/command.js
|
|
35577
|
-
var require_command = __commonJS((exports)
|
|
35579
|
+
var require_command = __commonJS(function(exports) {
|
|
35578
35580
|
var EventEmitter3 = __require("events").EventEmitter;
|
|
35579
35581
|
var childProcess = __require("child_process");
|
|
35580
35582
|
var path = __require("path");
|
|
@@ -36817,7 +36819,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
36817
36819
|
});
|
|
36818
36820
|
|
|
36819
36821
|
// ../../node_modules/.bun/commander@12.1.0/node_modules/commander/index.js
|
|
36820
|
-
var require_commander = __commonJS((exports)
|
|
36822
|
+
var require_commander = __commonJS(function(exports) {
|
|
36821
36823
|
var { Argument } = require_argument();
|
|
36822
36824
|
var { Command } = require_command();
|
|
36823
36825
|
var { CommanderError, InvalidArgumentError } = require_error();
|
|
@@ -36860,7 +36862,7 @@ var package_default;
|
|
|
36860
36862
|
var init_package = __esm(() => {
|
|
36861
36863
|
package_default = {
|
|
36862
36864
|
name: "@hasna/skills",
|
|
36863
|
-
version: "0.5.
|
|
36865
|
+
version: "0.5.4",
|
|
36864
36866
|
description: "Skills library for AI coding agents",
|
|
36865
36867
|
type: "module",
|
|
36866
36868
|
bin: {
|
|
@@ -36984,7 +36986,7 @@ var init_package = __esm(() => {
|
|
|
36984
36986
|
});
|
|
36985
36987
|
|
|
36986
36988
|
// ../../node_modules/.bun/react@18.3.1/node_modules/react/cjs/react-jsx-dev-runtime.development.js
|
|
36987
|
-
var require_react_jsx_dev_runtime_development = __commonJS((exports)
|
|
36989
|
+
var require_react_jsx_dev_runtime_development = __commonJS(function(exports) {
|
|
36988
36990
|
var React13 = __toESM(require_react());
|
|
36989
36991
|
if (true) {
|
|
36990
36992
|
(function() {
|
|
@@ -37865,7 +37867,7 @@ Check the top-level render call using <` + parentName + ">.";
|
|
|
37865
37867
|
});
|
|
37866
37868
|
|
|
37867
37869
|
// ../../node_modules/.bun/react@18.3.1/node_modules/react/jsx-dev-runtime.js
|
|
37868
|
-
var require_jsx_dev_runtime = __commonJS((exports, module)
|
|
37870
|
+
var require_jsx_dev_runtime = __commonJS(function(exports, module) {
|
|
37869
37871
|
var react_jsx_dev_runtime_development = __toESM(require_react_jsx_dev_runtime_development());
|
|
37870
37872
|
if (false) {} else {
|
|
37871
37873
|
module.exports = react_jsx_dev_runtime_development;
|
|
@@ -39322,11 +39324,13 @@ var init_skill_validation = __esm(() => {
|
|
|
39322
39324
|
VALID_PROVENANCE_SOURCES = new Set(["official", "custom", "remote", "private", "private-hosted", "upstream", "extension"]);
|
|
39323
39325
|
VALID_BIN_COMMAND = /^[a-z0-9][a-z0-9._-]*$/;
|
|
39324
39326
|
});
|
|
39325
|
-
|
|
39326
39327
|
// src/lib/skill-hash.ts
|
|
39327
39328
|
import { createHash } from "crypto";
|
|
39328
39329
|
import { existsSync as existsSync9, readdirSync as readdirSync4, readFileSync as readFileSync5, statSync as statSync4 } from "fs";
|
|
39329
39330
|
import { join as join9, sep } from "path";
|
|
39331
|
+
function excludedHashEntry(name, directory) {
|
|
39332
|
+
return name.startsWith(".") || directory && HASH_EXCLUDE_DIRS.has(name);
|
|
39333
|
+
}
|
|
39330
39334
|
function normalizeLineEndings(content) {
|
|
39331
39335
|
return content.replace(/\r\n/g, `
|
|
39332
39336
|
`).replace(/\r/g, `
|
|
@@ -39397,7 +39401,7 @@ function collectDirectory(files, dir, rel) {
|
|
|
39397
39401
|
if (stats.isSymbolicLink())
|
|
39398
39402
|
continue;
|
|
39399
39403
|
if (stats.isDirectory()) {
|
|
39400
|
-
if (
|
|
39404
|
+
if (excludedHashEntry(entry, true))
|
|
39401
39405
|
continue;
|
|
39402
39406
|
collectDirectory(files, absolute, childRel);
|
|
39403
39407
|
} else if (stats.isFile()) {
|
|
@@ -39407,26 +39411,34 @@ function collectDirectory(files, dir, rel) {
|
|
|
39407
39411
|
}
|
|
39408
39412
|
function collectFile(files, absolute, rel) {
|
|
39409
39413
|
const buffer = readFileSync5(absolute);
|
|
39414
|
+
files.push(normalizeBundleFile(rel.split(sep).join("/"), buffer));
|
|
39415
|
+
}
|
|
39416
|
+
function normalizeBundleFile(rel, buffer) {
|
|
39410
39417
|
if (rel === "skill.json") {
|
|
39411
|
-
|
|
39412
|
-
return;
|
|
39418
|
+
return { rel, content: new TextEncoder().encode(canonicalizeManifest(new TextDecoder().decode(buffer))) };
|
|
39413
39419
|
}
|
|
39414
39420
|
if (looksLikeText(buffer)) {
|
|
39415
39421
|
const normalized = normalizeLineEndings(new TextDecoder().decode(buffer));
|
|
39416
|
-
|
|
39417
|
-
return;
|
|
39422
|
+
return { rel, content: new TextEncoder().encode(normalized) };
|
|
39418
39423
|
}
|
|
39419
|
-
|
|
39424
|
+
return { rel, content: buffer };
|
|
39420
39425
|
}
|
|
39421
39426
|
function computeContentHash(skillPath) {
|
|
39422
|
-
|
|
39423
|
-
|
|
39424
|
-
|
|
39425
|
-
|
|
39426
|
-
|
|
39427
|
-
|
|
39427
|
+
return hashBundleFiles(collectBundleFiles(skillPath));
|
|
39428
|
+
}
|
|
39429
|
+
function* bundleHashParts(files) {
|
|
39430
|
+
for (const file of files) {
|
|
39431
|
+
yield new TextEncoder().encode(file.rel);
|
|
39432
|
+
yield new TextEncoder().encode(`\x00${file.content.length}\x00`);
|
|
39433
|
+
yield file.content;
|
|
39434
|
+
yield new TextEncoder().encode("\x00");
|
|
39428
39435
|
}
|
|
39429
|
-
|
|
39436
|
+
yield new TextEncoder().encode("\x00");
|
|
39437
|
+
}
|
|
39438
|
+
function hashBundleFiles(files) {
|
|
39439
|
+
const hash = createHash(CONTENT_HASH_ALGORITHM);
|
|
39440
|
+
for (const part of bundleHashParts(files))
|
|
39441
|
+
hash.update(part);
|
|
39430
39442
|
return hash.digest("hex");
|
|
39431
39443
|
}
|
|
39432
39444
|
function verifyContentHash(skillPath, manifest) {
|
|
@@ -39463,7 +39475,7 @@ function hashSkillMarkdown(content) {
|
|
|
39463
39475
|
function hashSkillMarkdownFile(path) {
|
|
39464
39476
|
return hashSkillMarkdown(readFileSync5(path, "utf-8"));
|
|
39465
39477
|
}
|
|
39466
|
-
var CONTENT_HASH_ALGORITHM = "sha256", HASH_EXCLUDE_DIRS, HASH_COVERAGE;
|
|
39478
|
+
var CONTENT_HASH_ALGORITHM = "sha256", HASH_EXCLUDE_DIRS, HASH_COVERAGE, CONTENT_HASH_LIMITS, typedArrayPrototype, byteLengthOf, bufferOf;
|
|
39467
39479
|
var init_skill_hash = __esm(() => {
|
|
39468
39480
|
HASH_EXCLUDE_DIRS = new Set([".git", "node_modules", "dist", "build", ".turbo"]);
|
|
39469
39481
|
HASH_COVERAGE = [
|
|
@@ -39477,6 +39489,20 @@ var init_skill_hash = __esm(() => {
|
|
|
39477
39489
|
"assets",
|
|
39478
39490
|
"references"
|
|
39479
39491
|
];
|
|
39492
|
+
CONTENT_HASH_LIMITS = Object.freeze({
|
|
39493
|
+
entries: 1024,
|
|
39494
|
+
rawBytes: 64 * 1024 * 1024,
|
|
39495
|
+
normalizedBytes: 64 * 1024 * 1024,
|
|
39496
|
+
fileBytes: 16 * 1024 * 1024,
|
|
39497
|
+
normalizedFileBytes: 16 * 1024 * 1024,
|
|
39498
|
+
pathBytes: 100,
|
|
39499
|
+
manifestBytes: 16 * 1024,
|
|
39500
|
+
manifestDepth: 64,
|
|
39501
|
+
timeoutMs: 5000
|
|
39502
|
+
});
|
|
39503
|
+
typedArrayPrototype = Object.getPrototypeOf(Uint8Array.prototype);
|
|
39504
|
+
byteLengthOf = Object.getOwnPropertyDescriptor(typedArrayPrototype, "byteLength").get;
|
|
39505
|
+
bufferOf = Object.getOwnPropertyDescriptor(typedArrayPrototype, "buffer").get;
|
|
39480
39506
|
});
|
|
39481
39507
|
|
|
39482
39508
|
// src/lib/portable-skills-types.ts
|
|
@@ -40891,21 +40917,21 @@ var init_search = __esm(() => {
|
|
|
40891
40917
|
// src/lib/registry.ts
|
|
40892
40918
|
var exports_registry = {};
|
|
40893
40919
|
__export(exports_registry, {
|
|
40894
|
-
|
|
40895
|
-
loadRegistryProfile: () => loadRegistryProfile,
|
|
40896
|
-
loadRegistry: () => loadRegistry,
|
|
40897
|
-
loadBasicRegistry: () => loadBasicRegistry,
|
|
40898
|
-
isBasicSkillName: () => isBasicSkillName,
|
|
40899
|
-
getSkillsByTag: () => getSkillsByTag,
|
|
40900
|
-
getSkillsByCategory: () => getSkillsByCategory,
|
|
40901
|
-
getSkill: () => getSkill,
|
|
40902
|
-
getAllTags: () => getAllTags,
|
|
40903
|
-
findSimilarSkills: () => findSimilarSkills,
|
|
40904
|
-
findExtensionSkillPath: () => findExtensionSkillPath,
|
|
40905
|
-
clearRegistryCache: () => clearRegistryCache,
|
|
40906
|
-
SKILLS: () => SKILLS,
|
|
40920
|
+
BASIC_SKILL_NAMES: () => BASIC_SKILL_NAMES,
|
|
40907
40921
|
CATEGORIES: () => CATEGORIES,
|
|
40908
|
-
|
|
40922
|
+
SKILLS: () => SKILLS,
|
|
40923
|
+
clearRegistryCache: () => clearRegistryCache,
|
|
40924
|
+
findExtensionSkillPath: () => findExtensionSkillPath,
|
|
40925
|
+
findSimilarSkills: () => findSimilarSkills,
|
|
40926
|
+
getAllTags: () => getAllTags,
|
|
40927
|
+
getSkill: () => getSkill,
|
|
40928
|
+
getSkillsByCategory: () => getSkillsByCategory,
|
|
40929
|
+
getSkillsByTag: () => getSkillsByTag,
|
|
40930
|
+
isBasicSkillName: () => isBasicSkillName,
|
|
40931
|
+
loadBasicRegistry: () => loadBasicRegistry,
|
|
40932
|
+
loadRegistry: () => loadRegistry,
|
|
40933
|
+
loadRegistryProfile: () => loadRegistryProfile,
|
|
40934
|
+
searchSkills: () => searchSkills
|
|
40909
40935
|
});
|
|
40910
40936
|
import { existsSync as existsSync12, readFileSync as readFileSync7, readdirSync as readdirSync6 } from "fs";
|
|
40911
40937
|
import { join as join12 } from "path";
|
|
@@ -41082,7 +41108,7 @@ var init_registry = __esm(() => {
|
|
|
41082
41108
|
});
|
|
41083
41109
|
|
|
41084
41110
|
// ../../node_modules/.bun/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json
|
|
41085
|
-
var require_spinners = __commonJS((exports, module)
|
|
41111
|
+
var require_spinners = __commonJS(function(exports, module) {
|
|
41086
41112
|
module.exports = {
|
|
41087
41113
|
dots: {
|
|
41088
41114
|
interval: 80,
|
|
@@ -42708,7 +42734,7 @@ var require_spinners = __commonJS((exports, module) => {
|
|
|
42708
42734
|
});
|
|
42709
42735
|
|
|
42710
42736
|
// ../../node_modules/.bun/cli-spinners@2.9.2/node_modules/cli-spinners/index.js
|
|
42711
|
-
var require_cli_spinners = __commonJS((exports, module)
|
|
42737
|
+
var require_cli_spinners = __commonJS(function(exports, module) {
|
|
42712
42738
|
var spinners = Object.assign({}, require_spinners());
|
|
42713
42739
|
var spinnersList = Object.keys(spinners);
|
|
42714
42740
|
Object.defineProperty(spinners, "random", {
|
|
@@ -43338,30 +43364,30 @@ var init_project_state = __esm(() => {
|
|
|
43338
43364
|
// src/lib/installer.ts
|
|
43339
43365
|
var exports_installer = {};
|
|
43340
43366
|
__export(exports_installer, {
|
|
43341
|
-
|
|
43342
|
-
skillExists: () => skillExists,
|
|
43343
|
-
resolveAgents: () => resolveAgents,
|
|
43344
|
-
removeSkillForAgent: () => removeSkillForAgent,
|
|
43345
|
-
removeSkill: () => removeSkill,
|
|
43346
|
-
pinSkill: () => pinSkill,
|
|
43347
|
-
installSkills: () => installSkills,
|
|
43348
|
-
installSkillSource: () => installSkillSource,
|
|
43349
|
-
installSkillManifest: () => installSkillManifest,
|
|
43350
|
-
installSkillForAgent: () => installSkillForAgent,
|
|
43351
|
-
installSkill: () => installSkill,
|
|
43352
|
-
installRemoteSkill: () => installRemoteSkill,
|
|
43353
|
-
getSkillPath: () => getSkillPath,
|
|
43354
|
-
getPinnedSkills: () => getPinnedSkills,
|
|
43355
|
-
getInstalledSkills: () => getInstalledSkills,
|
|
43356
|
-
getInstallMeta: () => getInstallMeta,
|
|
43357
|
-
getDisabledSkills: () => getDisabledSkills,
|
|
43358
|
-
getAgentSkillsDir: () => getAgentSkillsDir,
|
|
43359
|
-
getAgentSkillPath: () => getAgentSkillPath,
|
|
43360
|
-
enableSkill: () => enableSkill,
|
|
43361
|
-
disableSkill: () => disableSkill,
|
|
43362
|
-
createLocalSkillManifest: () => createLocalSkillManifest,
|
|
43367
|
+
AGENT_LABELS: () => AGENT_LABELS,
|
|
43363
43368
|
AGENT_TARGETS: () => AGENT_TARGETS,
|
|
43364
|
-
|
|
43369
|
+
createLocalSkillManifest: () => createLocalSkillManifest,
|
|
43370
|
+
disableSkill: () => disableSkill,
|
|
43371
|
+
enableSkill: () => enableSkill,
|
|
43372
|
+
getAgentSkillPath: () => getAgentSkillPath,
|
|
43373
|
+
getAgentSkillsDir: () => getAgentSkillsDir,
|
|
43374
|
+
getDisabledSkills: () => getDisabledSkills,
|
|
43375
|
+
getInstallMeta: () => getInstallMeta,
|
|
43376
|
+
getInstalledSkills: () => getInstalledSkills,
|
|
43377
|
+
getPinnedSkills: () => getPinnedSkills,
|
|
43378
|
+
getSkillPath: () => getSkillPath,
|
|
43379
|
+
installRemoteSkill: () => installRemoteSkill,
|
|
43380
|
+
installSkill: () => installSkill,
|
|
43381
|
+
installSkillForAgent: () => installSkillForAgent,
|
|
43382
|
+
installSkillManifest: () => installSkillManifest,
|
|
43383
|
+
installSkillSource: () => installSkillSource,
|
|
43384
|
+
installSkills: () => installSkills,
|
|
43385
|
+
pinSkill: () => pinSkill,
|
|
43386
|
+
removeSkill: () => removeSkill,
|
|
43387
|
+
removeSkillForAgent: () => removeSkillForAgent,
|
|
43388
|
+
resolveAgents: () => resolveAgents,
|
|
43389
|
+
skillExists: () => skillExists,
|
|
43390
|
+
unpinSkill: () => unpinSkill
|
|
43365
43391
|
});
|
|
43366
43392
|
import { existsSync as existsSync16, readFileSync as readFileSync10, rmSync as rmSync4 } from "fs";
|
|
43367
43393
|
import { dirname as dirname5, join as join16 } from "path";
|
|
@@ -43784,7 +43810,7 @@ import { isIP as isIP2 } from "net";
|
|
|
43784
43810
|
import { spawnSync } from "child_process";
|
|
43785
43811
|
import { closeSync, fstatSync, openSync, readFileSync as readFileSync11 } from "fs";
|
|
43786
43812
|
import { O_NOFOLLOW, O_NONBLOCK, O_RDONLY } from "constants";
|
|
43787
|
-
import { createRequire } from "module";
|
|
43813
|
+
import { createRequire as createRequire2 } from "module";
|
|
43788
43814
|
import { hostname as osHostname } from "os";
|
|
43789
43815
|
import { isAbsolute as isAbsolute3, join as join17 } from "path";
|
|
43790
43816
|
function envToken(name) {
|
|
@@ -43905,7 +43931,7 @@ function readAppConfigFile(path) {
|
|
|
43905
43931
|
const uid = process.getuid?.() ?? process.geteuid?.();
|
|
43906
43932
|
if (uid !== undefined && before2.uid !== uid)
|
|
43907
43933
|
unsafe("the file is not owned by the current user");
|
|
43908
|
-
if (before2.size >
|
|
43934
|
+
if (before2.size > MAX_CREDENTIAL_FILE_BYTES2)
|
|
43909
43935
|
unsafe("the file exceeds the size limit");
|
|
43910
43936
|
const bytes = readFileSync11(fd);
|
|
43911
43937
|
const after2 = fstatSync(fd);
|
|
@@ -43989,13 +44015,13 @@ function sealCredential(fields) {
|
|
|
43989
44015
|
configurable: false
|
|
43990
44016
|
});
|
|
43991
44017
|
}
|
|
43992
|
-
Object.defineProperty(sealed,
|
|
44018
|
+
Object.defineProperty(sealed, INSPECT_CUSTOM2, {
|
|
43993
44019
|
value: () => ({ ...visible, apiKey: "[redacted]" }),
|
|
43994
44020
|
enumerable: false,
|
|
43995
44021
|
writable: false,
|
|
43996
44022
|
configurable: false
|
|
43997
44023
|
});
|
|
43998
|
-
Object.defineProperty(sealed,
|
|
44024
|
+
Object.defineProperty(sealed, CREDENTIAL_SEAL2, {
|
|
43999
44025
|
value: true,
|
|
44000
44026
|
enumerable: false,
|
|
44001
44027
|
writable: false,
|
|
@@ -44014,7 +44040,7 @@ function firstEnvValue(env3, keys2) {
|
|
|
44014
44040
|
return null;
|
|
44015
44041
|
}
|
|
44016
44042
|
function isAmbientEnvironment(env3) {
|
|
44017
|
-
return env3 === process.env || env3[
|
|
44043
|
+
return env3 === process.env || env3[AMBIENT_ENVIRONMENT2] === true;
|
|
44018
44044
|
}
|
|
44019
44045
|
function defaultKeychainRunner(argv) {
|
|
44020
44046
|
const result2 = spawnSync(KEYCHAIN_SECURITY_BIN, [...argv], {
|
|
@@ -44108,7 +44134,7 @@ function snapshotClientEnvironment(name, env3) {
|
|
|
44108
44134
|
snapshot[key] = descriptor.value;
|
|
44109
44135
|
}
|
|
44110
44136
|
if (ambient) {
|
|
44111
|
-
Object.defineProperty(snapshot,
|
|
44137
|
+
Object.defineProperty(snapshot, AMBIENT_ENVIRONMENT2, {
|
|
44112
44138
|
value: true,
|
|
44113
44139
|
enumerable: false,
|
|
44114
44140
|
writable: false,
|
|
@@ -44265,7 +44291,7 @@ async function completePointerCredential(name, pointerResolution, env3 = process
|
|
|
44265
44291
|
}
|
|
44266
44292
|
let secretsSdk;
|
|
44267
44293
|
try {
|
|
44268
|
-
secretsSdk =
|
|
44294
|
+
secretsSdk = requireSecretsSdk2(SECRETS_PACKAGE_SPECIFIER2);
|
|
44269
44295
|
} catch {
|
|
44270
44296
|
throw new CredentialResolutionError(name, `${pointerEnvKey} names vault item '${vaultKey}', but the secrets SDK (@hasna/secrets) is not installed ` + `in this process. A vault pointer is TERMINAL: install @hasna/secrets to resolve it, or unset ${pointerEnvKey}.`, [pointerEnvKey]);
|
|
44271
44297
|
}
|
|
@@ -44411,7 +44437,7 @@ function toV1BaseUrl(apiUrl) {
|
|
|
44411
44437
|
url.pathname = `${path}/v1`;
|
|
44412
44438
|
return url.toString().replace(/\/+$/, "");
|
|
44413
44439
|
}
|
|
44414
|
-
var CREDENTIAL_PROFILE_ENV_KEY = "HASNA_PROFILE", CredentialResolutionError, CredentialFileUnsafeError, HASNA_HOME_ENV_KEY = "HASNA_HOME", HASNA_CONFIG_HOME_ENV_KEY = "HASNA_CONFIG_HOME", KEYCHAIN_STATION_ENV_KEY = "HASNA_STATION", HASNA_HOME_DIR = ".hasna", CONFIG_SUBDIR = "config", CREDENTIALS_FILE = "credentials", KEYCHAIN_SECURITY_BIN = "/usr/bin/security", KEYCHAIN_SERVICE_PREFIX = "hasna.credentials", KEYCHAIN_ITEM_NOT_FOUND_STATUS = 44, KEYCHAIN_SPAWN_TIMEOUT_MS = 1e4,
|
|
44440
|
+
var CREDENTIAL_PROFILE_ENV_KEY = "HASNA_PROFILE", CredentialResolutionError, CredentialFileUnsafeError, HASNA_HOME_ENV_KEY = "HASNA_HOME", HASNA_CONFIG_HOME_ENV_KEY = "HASNA_CONFIG_HOME", KEYCHAIN_STATION_ENV_KEY = "HASNA_STATION", HASNA_HOME_DIR = ".hasna", CONFIG_SUBDIR = "config", CREDENTIALS_FILE = "credentials", KEYCHAIN_SECURITY_BIN = "/usr/bin/security", KEYCHAIN_SERVICE_PREFIX = "hasna.credentials", KEYCHAIN_ITEM_NOT_FOUND_STATUS = 44, KEYCHAIN_SPAWN_TIMEOUT_MS = 1e4, MAX_CREDENTIAL_FILE_BYTES2, SAFE_APP_SLUG, SAFE_PROFILE, ILLEGAL_IN_HEADER_VALUE, VAULT_POINTER_SHAPE, CREDENTIAL_SHAPED_KEY, INSPECT_CUSTOM2, CREDENTIAL_SEAL2, AMBIENT_ENVIRONMENT2, SECRETS_PACKAGE_SPECIFIER2, requireSecretsSdk2, DEFAULT_FLEET_GATEWAY_ORIGIN = "https://api.hasna.com", ASCII_CONTROL_PATTERN, DNS_LABEL_PATTERN, IDEMPOTENT_METHODS2, AUTHORITY_OVERRIDE_HEADERS2;
|
|
44415
44441
|
var init_transport = __esm(() => {
|
|
44416
44442
|
CredentialResolutionError = class CredentialResolutionError extends Error {
|
|
44417
44443
|
appName;
|
|
@@ -44431,21 +44457,21 @@ var init_transport = __esm(() => {
|
|
|
44431
44457
|
this.path = path;
|
|
44432
44458
|
}
|
|
44433
44459
|
};
|
|
44434
|
-
|
|
44460
|
+
MAX_CREDENTIAL_FILE_BYTES2 = 64 * 1024;
|
|
44435
44461
|
SAFE_APP_SLUG = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
|
|
44436
44462
|
SAFE_PROFILE = /^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?$/;
|
|
44437
44463
|
ILLEGAL_IN_HEADER_VALUE = /[^\t\x20-\x7e]/;
|
|
44438
44464
|
VAULT_POINTER_SHAPE = /^[a-z0-9][a-z0-9-]*(?:\/[a-z0-9][a-z0-9-_.]*){2,}$/;
|
|
44439
44465
|
CREDENTIAL_SHAPED_KEY = /(?:^|_)(?:API_KEY|KEY|TOKEN|SECRET|PASSWORD|PASSWD|CREDENTIAL|AUTH)(?:_|$)/;
|
|
44440
|
-
|
|
44441
|
-
|
|
44442
|
-
|
|
44443
|
-
|
|
44444
|
-
|
|
44466
|
+
INSPECT_CUSTOM2 = Symbol.for("nodejs.util.inspect.custom");
|
|
44467
|
+
CREDENTIAL_SEAL2 = Symbol.for("hasna:contracts:sealedCredential");
|
|
44468
|
+
AMBIENT_ENVIRONMENT2 = Symbol.for("hasna:contracts:ambientClientEnvironment");
|
|
44469
|
+
SECRETS_PACKAGE_SPECIFIER2 = "@hasna/" + "secrets";
|
|
44470
|
+
requireSecretsSdk2 = createRequire2(import.meta.url);
|
|
44445
44471
|
ASCII_CONTROL_PATTERN = /[\u0000-\u001f\u007f]/;
|
|
44446
44472
|
DNS_LABEL_PATTERN = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
|
|
44447
|
-
|
|
44448
|
-
|
|
44473
|
+
IDEMPOTENT_METHODS2 = new Set(["GET", "HEAD", "PUT", "DELETE", "OPTIONS"]);
|
|
44474
|
+
AUTHORITY_OVERRIDE_HEADERS2 = new Set([
|
|
44449
44475
|
"host",
|
|
44450
44476
|
":authority",
|
|
44451
44477
|
"forwarded",
|
|
@@ -44574,31 +44600,31 @@ var init_local_opt_in = __esm(() => {
|
|
|
44574
44600
|
// src/lib/fleet-credentials.ts
|
|
44575
44601
|
var exports_fleet_credentials = {};
|
|
44576
44602
|
__export(exports_fleet_credentials, {
|
|
44577
|
-
|
|
44578
|
-
skillsCredentialFiles: () => skillsCredentialFiles,
|
|
44579
|
-
skillsCredentialFilePath: () => skillsCredentialFilePath,
|
|
44580
|
-
selectsSkillsLocalMode: () => selectsSkillsLocalMode,
|
|
44581
|
-
resolveSkillsFleet: () => resolveSkillsFleet,
|
|
44582
|
-
resolveSkillsConnection: () => resolveSkillsConnection,
|
|
44583
|
-
resolveSkillsApiOrigin: () => resolveSkillsApiOrigin,
|
|
44584
|
-
resolveSkillsApiKey: () => resolveSkillsApiKey,
|
|
44585
|
-
resetLocalSkillsModeNotice: () => resetLocalSkillsModeNotice,
|
|
44586
|
-
requireSkillsFleet: () => requireSkillsFleet,
|
|
44587
|
-
requireSkillsApiOrigin: () => requireSkillsApiOrigin,
|
|
44588
|
-
requireSkillsApiKey: () => requireSkillsApiKey,
|
|
44589
|
-
noticeLocalSkillsMode: () => noticeLocalSkillsMode,
|
|
44590
|
-
normalizeSkillsApiOrigin: () => normalizeSkillsApiOrigin,
|
|
44591
|
-
isSkillsLocalOptIn: () => isSkillsLocalOptIn,
|
|
44592
|
-
isSkillsFleetCredentialError: () => isSkillsFleetCredentialError,
|
|
44593
|
-
configuredSkillsApiUrl: () => configuredSkillsApiUrl,
|
|
44594
|
-
SkillsFleetCredentialError: () => SkillsFleetCredentialError,
|
|
44595
|
-
SKILLS_LOCAL_OPT_IN_ENV_KEYS: () => SKILLS_LOCAL_OPT_IN_ENV_KEYS,
|
|
44596
|
-
SKILLS_APP: () => SKILLS_APP,
|
|
44597
|
-
SKILLS_API_URL_ENV_KEYS: () => SKILLS_API_URL_ENV_KEYS,
|
|
44598
|
-
SKILLS_API_URL_ENV: () => SKILLS_API_URL_ENV,
|
|
44599
|
-
SKILLS_API_KEY_ENV_KEYS: () => SKILLS_API_KEY_ENV_KEYS,
|
|
44603
|
+
MissingSkillsFleetError: () => MissingSkillsFleetError,
|
|
44600
44604
|
SKILLS_API_KEY_ENV: () => SKILLS_API_KEY_ENV,
|
|
44601
|
-
|
|
44605
|
+
SKILLS_API_KEY_ENV_KEYS: () => SKILLS_API_KEY_ENV_KEYS,
|
|
44606
|
+
SKILLS_API_URL_ENV: () => SKILLS_API_URL_ENV,
|
|
44607
|
+
SKILLS_API_URL_ENV_KEYS: () => SKILLS_API_URL_ENV_KEYS,
|
|
44608
|
+
SKILLS_APP: () => SKILLS_APP,
|
|
44609
|
+
SKILLS_LOCAL_OPT_IN_ENV_KEYS: () => SKILLS_LOCAL_OPT_IN_ENV_KEYS,
|
|
44610
|
+
SkillsFleetCredentialError: () => SkillsFleetCredentialError,
|
|
44611
|
+
configuredSkillsApiUrl: () => configuredSkillsApiUrl,
|
|
44612
|
+
isSkillsFleetCredentialError: () => isSkillsFleetCredentialError,
|
|
44613
|
+
isSkillsLocalOptIn: () => isSkillsLocalOptIn,
|
|
44614
|
+
normalizeSkillsApiOrigin: () => normalizeSkillsApiOrigin,
|
|
44615
|
+
noticeLocalSkillsMode: () => noticeLocalSkillsMode,
|
|
44616
|
+
requireSkillsApiKey: () => requireSkillsApiKey,
|
|
44617
|
+
requireSkillsApiOrigin: () => requireSkillsApiOrigin,
|
|
44618
|
+
requireSkillsFleet: () => requireSkillsFleet,
|
|
44619
|
+
resetLocalSkillsModeNotice: () => resetLocalSkillsModeNotice,
|
|
44620
|
+
resolveSkillsApiKey: () => resolveSkillsApiKey,
|
|
44621
|
+
resolveSkillsApiOrigin: () => resolveSkillsApiOrigin,
|
|
44622
|
+
resolveSkillsConnection: () => resolveSkillsConnection,
|
|
44623
|
+
resolveSkillsFleet: () => resolveSkillsFleet,
|
|
44624
|
+
selectsSkillsLocalMode: () => selectsSkillsLocalMode,
|
|
44625
|
+
skillsCredentialFilePath: () => skillsCredentialFilePath,
|
|
44626
|
+
skillsCredentialFiles: () => skillsCredentialFiles,
|
|
44627
|
+
skillsCredentialOrReason: () => skillsCredentialOrReason
|
|
44602
44628
|
});
|
|
44603
44629
|
function isCredentialResolutionError(error) {
|
|
44604
44630
|
return error instanceof CredentialResolutionError || typeof error === "object" && error !== null && error.name === "CredentialResolutionError";
|
|
@@ -48704,113 +48730,113 @@ var init_types = __esm(() => {
|
|
|
48704
48730
|
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
|
|
48705
48731
|
var exports_external = {};
|
|
48706
48732
|
__export(exports_external, {
|
|
48707
|
-
|
|
48708
|
-
util: () => util,
|
|
48709
|
-
unknown: () => unknownType,
|
|
48710
|
-
union: () => unionType,
|
|
48711
|
-
undefined: () => undefinedType,
|
|
48712
|
-
tuple: () => tupleType,
|
|
48713
|
-
transformer: () => effectsType,
|
|
48714
|
-
symbol: () => symbolType,
|
|
48715
|
-
string: () => stringType,
|
|
48716
|
-
strictObject: () => strictObjectType,
|
|
48717
|
-
setErrorMap: () => setErrorMap,
|
|
48718
|
-
set: () => setType,
|
|
48719
|
-
record: () => recordType,
|
|
48720
|
-
quotelessJson: () => quotelessJson,
|
|
48721
|
-
promise: () => promiseType,
|
|
48722
|
-
preprocess: () => preprocessType,
|
|
48723
|
-
pipeline: () => pipelineType,
|
|
48724
|
-
ostring: () => ostring,
|
|
48725
|
-
optional: () => optionalType,
|
|
48726
|
-
onumber: () => onumber,
|
|
48727
|
-
oboolean: () => oboolean,
|
|
48728
|
-
objectUtil: () => objectUtil,
|
|
48729
|
-
object: () => objectType,
|
|
48730
|
-
number: () => numberType,
|
|
48731
|
-
nullable: () => nullableType,
|
|
48732
|
-
null: () => nullType,
|
|
48733
|
-
never: () => neverType,
|
|
48734
|
-
nativeEnum: () => nativeEnumType,
|
|
48735
|
-
nan: () => nanType,
|
|
48736
|
-
map: () => mapType,
|
|
48737
|
-
makeIssue: () => makeIssue,
|
|
48738
|
-
literal: () => literalType,
|
|
48739
|
-
lazy: () => lazyType,
|
|
48740
|
-
late: () => late,
|
|
48741
|
-
isValid: () => isValid,
|
|
48742
|
-
isDirty: () => isDirty,
|
|
48743
|
-
isAsync: () => isAsync,
|
|
48744
|
-
isAborted: () => isAborted,
|
|
48745
|
-
intersection: () => intersectionType,
|
|
48746
|
-
instanceof: () => instanceOfType,
|
|
48747
|
-
getParsedType: () => getParsedType,
|
|
48748
|
-
getErrorMap: () => getErrorMap,
|
|
48749
|
-
function: () => functionType,
|
|
48750
|
-
enum: () => enumType,
|
|
48751
|
-
effect: () => effectsType,
|
|
48752
|
-
discriminatedUnion: () => discriminatedUnionType,
|
|
48753
|
-
defaultErrorMap: () => en_default,
|
|
48754
|
-
datetimeRegex: () => datetimeRegex,
|
|
48755
|
-
date: () => dateType,
|
|
48756
|
-
custom: () => custom,
|
|
48757
|
-
coerce: () => coerce,
|
|
48758
|
-
boolean: () => booleanType,
|
|
48759
|
-
bigint: () => bigIntType,
|
|
48760
|
-
array: () => arrayType,
|
|
48761
|
-
any: () => anyType,
|
|
48762
|
-
addIssueToContext: () => addIssueToContext,
|
|
48763
|
-
ZodVoid: () => ZodVoid,
|
|
48764
|
-
ZodUnknown: () => ZodUnknown,
|
|
48765
|
-
ZodUnion: () => ZodUnion,
|
|
48766
|
-
ZodUndefined: () => ZodUndefined,
|
|
48767
|
-
ZodType: () => ZodType,
|
|
48768
|
-
ZodTuple: () => ZodTuple,
|
|
48769
|
-
ZodTransformer: () => ZodEffects,
|
|
48770
|
-
ZodSymbol: () => ZodSymbol,
|
|
48771
|
-
ZodString: () => ZodString,
|
|
48772
|
-
ZodSet: () => ZodSet,
|
|
48773
|
-
ZodSchema: () => ZodType,
|
|
48774
|
-
ZodRecord: () => ZodRecord,
|
|
48775
|
-
ZodReadonly: () => ZodReadonly,
|
|
48776
|
-
ZodPromise: () => ZodPromise,
|
|
48777
|
-
ZodPipeline: () => ZodPipeline,
|
|
48778
|
-
ZodParsedType: () => ZodParsedType,
|
|
48779
|
-
ZodOptional: () => ZodOptional,
|
|
48780
|
-
ZodObject: () => ZodObject,
|
|
48781
|
-
ZodNumber: () => ZodNumber,
|
|
48782
|
-
ZodNullable: () => ZodNullable,
|
|
48783
|
-
ZodNull: () => ZodNull,
|
|
48784
|
-
ZodNever: () => ZodNever,
|
|
48785
|
-
ZodNativeEnum: () => ZodNativeEnum,
|
|
48786
|
-
ZodNaN: () => ZodNaN,
|
|
48787
|
-
ZodMap: () => ZodMap,
|
|
48788
|
-
ZodLiteral: () => ZodLiteral,
|
|
48789
|
-
ZodLazy: () => ZodLazy,
|
|
48790
|
-
ZodIssueCode: () => ZodIssueCode,
|
|
48791
|
-
ZodIntersection: () => ZodIntersection,
|
|
48792
|
-
ZodFunction: () => ZodFunction,
|
|
48793
|
-
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
48794
|
-
ZodError: () => ZodError,
|
|
48795
|
-
ZodEnum: () => ZodEnum,
|
|
48796
|
-
ZodEffects: () => ZodEffects,
|
|
48797
|
-
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
48798
|
-
ZodDefault: () => ZodDefault,
|
|
48799
|
-
ZodDate: () => ZodDate,
|
|
48800
|
-
ZodCatch: () => ZodCatch,
|
|
48801
|
-
ZodBranded: () => ZodBranded,
|
|
48802
|
-
ZodBoolean: () => ZodBoolean,
|
|
48803
|
-
ZodBigInt: () => ZodBigInt,
|
|
48804
|
-
ZodArray: () => ZodArray,
|
|
48805
|
-
ZodAny: () => ZodAny,
|
|
48806
|
-
Schema: () => ZodType,
|
|
48807
|
-
ParseStatus: () => ParseStatus,
|
|
48808
|
-
OK: () => OK,
|
|
48809
|
-
NEVER: () => NEVER,
|
|
48810
|
-
INVALID: () => INVALID,
|
|
48811
|
-
EMPTY_PATH: () => EMPTY_PATH,
|
|
48733
|
+
BRAND: () => BRAND,
|
|
48812
48734
|
DIRTY: () => DIRTY,
|
|
48813
|
-
|
|
48735
|
+
EMPTY_PATH: () => EMPTY_PATH,
|
|
48736
|
+
INVALID: () => INVALID,
|
|
48737
|
+
NEVER: () => NEVER,
|
|
48738
|
+
OK: () => OK,
|
|
48739
|
+
ParseStatus: () => ParseStatus,
|
|
48740
|
+
Schema: () => ZodType,
|
|
48741
|
+
ZodAny: () => ZodAny,
|
|
48742
|
+
ZodArray: () => ZodArray,
|
|
48743
|
+
ZodBigInt: () => ZodBigInt,
|
|
48744
|
+
ZodBoolean: () => ZodBoolean,
|
|
48745
|
+
ZodBranded: () => ZodBranded,
|
|
48746
|
+
ZodCatch: () => ZodCatch,
|
|
48747
|
+
ZodDate: () => ZodDate,
|
|
48748
|
+
ZodDefault: () => ZodDefault,
|
|
48749
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
48750
|
+
ZodEffects: () => ZodEffects,
|
|
48751
|
+
ZodEnum: () => ZodEnum,
|
|
48752
|
+
ZodError: () => ZodError,
|
|
48753
|
+
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
48754
|
+
ZodFunction: () => ZodFunction,
|
|
48755
|
+
ZodIntersection: () => ZodIntersection,
|
|
48756
|
+
ZodIssueCode: () => ZodIssueCode,
|
|
48757
|
+
ZodLazy: () => ZodLazy,
|
|
48758
|
+
ZodLiteral: () => ZodLiteral,
|
|
48759
|
+
ZodMap: () => ZodMap,
|
|
48760
|
+
ZodNaN: () => ZodNaN,
|
|
48761
|
+
ZodNativeEnum: () => ZodNativeEnum,
|
|
48762
|
+
ZodNever: () => ZodNever,
|
|
48763
|
+
ZodNull: () => ZodNull,
|
|
48764
|
+
ZodNullable: () => ZodNullable,
|
|
48765
|
+
ZodNumber: () => ZodNumber,
|
|
48766
|
+
ZodObject: () => ZodObject,
|
|
48767
|
+
ZodOptional: () => ZodOptional,
|
|
48768
|
+
ZodParsedType: () => ZodParsedType,
|
|
48769
|
+
ZodPipeline: () => ZodPipeline,
|
|
48770
|
+
ZodPromise: () => ZodPromise,
|
|
48771
|
+
ZodReadonly: () => ZodReadonly,
|
|
48772
|
+
ZodRecord: () => ZodRecord,
|
|
48773
|
+
ZodSchema: () => ZodType,
|
|
48774
|
+
ZodSet: () => ZodSet,
|
|
48775
|
+
ZodString: () => ZodString,
|
|
48776
|
+
ZodSymbol: () => ZodSymbol,
|
|
48777
|
+
ZodTransformer: () => ZodEffects,
|
|
48778
|
+
ZodTuple: () => ZodTuple,
|
|
48779
|
+
ZodType: () => ZodType,
|
|
48780
|
+
ZodUndefined: () => ZodUndefined,
|
|
48781
|
+
ZodUnion: () => ZodUnion,
|
|
48782
|
+
ZodUnknown: () => ZodUnknown,
|
|
48783
|
+
ZodVoid: () => ZodVoid,
|
|
48784
|
+
addIssueToContext: () => addIssueToContext,
|
|
48785
|
+
any: () => anyType,
|
|
48786
|
+
array: () => arrayType,
|
|
48787
|
+
bigint: () => bigIntType,
|
|
48788
|
+
boolean: () => booleanType,
|
|
48789
|
+
coerce: () => coerce,
|
|
48790
|
+
custom: () => custom,
|
|
48791
|
+
date: () => dateType,
|
|
48792
|
+
datetimeRegex: () => datetimeRegex,
|
|
48793
|
+
defaultErrorMap: () => en_default,
|
|
48794
|
+
discriminatedUnion: () => discriminatedUnionType,
|
|
48795
|
+
effect: () => effectsType,
|
|
48796
|
+
enum: () => enumType,
|
|
48797
|
+
function: () => functionType,
|
|
48798
|
+
getErrorMap: () => getErrorMap,
|
|
48799
|
+
getParsedType: () => getParsedType,
|
|
48800
|
+
instanceof: () => instanceOfType,
|
|
48801
|
+
intersection: () => intersectionType,
|
|
48802
|
+
isAborted: () => isAborted,
|
|
48803
|
+
isAsync: () => isAsync,
|
|
48804
|
+
isDirty: () => isDirty,
|
|
48805
|
+
isValid: () => isValid,
|
|
48806
|
+
late: () => late,
|
|
48807
|
+
lazy: () => lazyType,
|
|
48808
|
+
literal: () => literalType,
|
|
48809
|
+
makeIssue: () => makeIssue,
|
|
48810
|
+
map: () => mapType,
|
|
48811
|
+
nan: () => nanType,
|
|
48812
|
+
nativeEnum: () => nativeEnumType,
|
|
48813
|
+
never: () => neverType,
|
|
48814
|
+
null: () => nullType,
|
|
48815
|
+
nullable: () => nullableType,
|
|
48816
|
+
number: () => numberType,
|
|
48817
|
+
object: () => objectType,
|
|
48818
|
+
objectUtil: () => objectUtil,
|
|
48819
|
+
oboolean: () => oboolean,
|
|
48820
|
+
onumber: () => onumber,
|
|
48821
|
+
optional: () => optionalType,
|
|
48822
|
+
ostring: () => ostring,
|
|
48823
|
+
pipeline: () => pipelineType,
|
|
48824
|
+
preprocess: () => preprocessType,
|
|
48825
|
+
promise: () => promiseType,
|
|
48826
|
+
quotelessJson: () => quotelessJson,
|
|
48827
|
+
record: () => recordType,
|
|
48828
|
+
set: () => setType,
|
|
48829
|
+
setErrorMap: () => setErrorMap,
|
|
48830
|
+
strictObject: () => strictObjectType,
|
|
48831
|
+
string: () => stringType,
|
|
48832
|
+
symbol: () => symbolType,
|
|
48833
|
+
transformer: () => effectsType,
|
|
48834
|
+
tuple: () => tupleType,
|
|
48835
|
+
undefined: () => undefinedType,
|
|
48836
|
+
union: () => unionType,
|
|
48837
|
+
unknown: () => unknownType,
|
|
48838
|
+
util: () => util,
|
|
48839
|
+
void: () => voidType
|
|
48814
48840
|
});
|
|
48815
48841
|
var init_external = __esm(() => {
|
|
48816
48842
|
init_errors();
|
|
@@ -49045,50 +49071,210 @@ var init_read_access = __esm(() => {
|
|
|
49045
49071
|
init_remote_registry();
|
|
49046
49072
|
});
|
|
49047
49073
|
|
|
49074
|
+
// src/lib/remote-invitations.ts
|
|
49075
|
+
function invitationFailure(value, status) {
|
|
49076
|
+
if (!record(value) || typeof value.code !== "string" || !Object.hasOwn(invitationFailures, value.code))
|
|
49077
|
+
return null;
|
|
49078
|
+
const code = value.code;
|
|
49079
|
+
return invitationFailures[code][0] === status ? code : null;
|
|
49080
|
+
}
|
|
49081
|
+
function invitationId(value) {
|
|
49082
|
+
return uuid(value) ? value : inputFailure();
|
|
49083
|
+
}
|
|
49084
|
+
function invitationInput(action, input) {
|
|
49085
|
+
if (!record(input))
|
|
49086
|
+
return inputFailure();
|
|
49087
|
+
const keys2 = {
|
|
49088
|
+
list: ["after"],
|
|
49089
|
+
get: ["invitationId"],
|
|
49090
|
+
issue: ["email", "role", "idempotencyKey", "confirm"],
|
|
49091
|
+
resend: ["invitationId", "expectedGeneration", "idempotencyKey", "confirm"],
|
|
49092
|
+
revoke: ["invitationId", "expectedGeneration", "confirm"],
|
|
49093
|
+
accept: ["invitationId", "token", "confirm"]
|
|
49094
|
+
};
|
|
49095
|
+
if (Object.keys(input).some((key) => !keys2[action].includes(key)) || action !== "list" && keys2[action].some((key) => !Object.hasOwn(input, key)))
|
|
49096
|
+
return inputFailure();
|
|
49097
|
+
const value = { ...input };
|
|
49098
|
+
if (action === "list") {
|
|
49099
|
+
if (value.after !== undefined && !uuid(value.after))
|
|
49100
|
+
return inputFailure();
|
|
49101
|
+
}
|
|
49102
|
+
if (["get", "resend", "revoke", "accept"].includes(action) && !uuid(value.invitationId))
|
|
49103
|
+
return inputFailure();
|
|
49104
|
+
if (!["list", "get"].includes(action) && value.confirm !== true)
|
|
49105
|
+
return inputFailure();
|
|
49106
|
+
if (["issue", "resend"].includes(action) && !uuid(value.idempotencyKey))
|
|
49107
|
+
return inputFailure();
|
|
49108
|
+
if (action === "issue") {
|
|
49109
|
+
if (typeof value.email !== "string")
|
|
49110
|
+
return inputFailure();
|
|
49111
|
+
value.email = value.email.trim().toLowerCase();
|
|
49112
|
+
if (!email(value.email) || !role(value.role))
|
|
49113
|
+
return inputFailure();
|
|
49114
|
+
}
|
|
49115
|
+
if (["resend", "revoke"].includes(action) && (!Number.isInteger(value.expectedGeneration) || Number(value.expectedGeneration) < 1 || Number(value.expectedGeneration) > 10))
|
|
49116
|
+
return inputFailure();
|
|
49117
|
+
if (action === "accept" && (typeof value.token !== "string" || !/^[A-Za-z0-9_-]{43}$/.test(value.token)))
|
|
49118
|
+
return inputFailure();
|
|
49119
|
+
return value;
|
|
49120
|
+
}
|
|
49121
|
+
function invitationRequest(action, input) {
|
|
49122
|
+
const base2 = "/api/v1/workspace/invitations", value = input;
|
|
49123
|
+
const { confirm: _confirm, invitationId: id, ...body } = value;
|
|
49124
|
+
if (action === "list")
|
|
49125
|
+
return { path: base2 + (value.after ? `?after=${value.after}` : ""), method: "GET" };
|
|
49126
|
+
if (action === "get")
|
|
49127
|
+
return { path: `${base2}/${id}`, method: "GET" };
|
|
49128
|
+
if (action === "accept")
|
|
49129
|
+
return { path: "/api/v1/account/invitations/accept", method: "POST", body: JSON.stringify({ invitationId: id, token: value.token }) };
|
|
49130
|
+
return { path: action === "issue" ? base2 : `${base2}/${id}${action === "resend" ? "/resend" : ""}`, method: action === "revoke" ? "DELETE" : "POST", body: JSON.stringify(body) };
|
|
49131
|
+
}
|
|
49132
|
+
function invalid() {
|
|
49133
|
+
throw new RemoteWorkspaceInvitationReadError;
|
|
49134
|
+
}
|
|
49135
|
+
function projection(v, organizationId) {
|
|
49136
|
+
if (!record(v) || !uuid(v.id) || v.organizationId !== organizationId || !email(v.email) || v.email !== v.email.trim().toLowerCase() || !role(v.role) || !Number.isInteger(v.generation) || Number(v.generation) < 1 || Number(v.generation) > 10 || typeof v.status !== "string" || !["pending", "expired", "accepted", "revoked"].includes(v.status) || !timestamp(v.expiresAt) || !timestamp(v.createdAt) || !record(v.delivery) || typeof v.delivery.state !== "string" || !["queued", "sending", "uncertain", "provider_accepted", "failed", "cancelled"].includes(v.delivery.state) || !Number.isInteger(v.delivery.attempts) || Number(v.delivery.attempts) < 0 || Number(v.delivery.attempts) > 5)
|
|
49137
|
+
return invalid();
|
|
49138
|
+
return {
|
|
49139
|
+
id: v.id,
|
|
49140
|
+
organizationId,
|
|
49141
|
+
email: v.email,
|
|
49142
|
+
role: v.role,
|
|
49143
|
+
generation: Number(v.generation),
|
|
49144
|
+
status: v.status,
|
|
49145
|
+
expiresAt: v.expiresAt,
|
|
49146
|
+
createdAt: v.createdAt,
|
|
49147
|
+
delivery: { state: v.delivery.state, attempts: Number(v.delivery.attempts) }
|
|
49148
|
+
};
|
|
49149
|
+
}
|
|
49150
|
+
function parseInvitationResult(action, value, input, organizationId) {
|
|
49151
|
+
if (!record(value))
|
|
49152
|
+
return invalid();
|
|
49153
|
+
const request = input;
|
|
49154
|
+
if (action === "accept") {
|
|
49155
|
+
if (!uuid(value.organizationId) || !uuid(value.membershipId) || value.accepted !== true || typeof value.changed !== "boolean")
|
|
49156
|
+
return invalid();
|
|
49157
|
+
return { organizationId: value.organizationId, membershipId: value.membershipId, accepted: true, changed: value.changed };
|
|
49158
|
+
}
|
|
49159
|
+
if (action === "list") {
|
|
49160
|
+
if (value.organizationId !== organizationId || !Array.isArray(value.invitations) || value.invitations.length > 50 || value.nextCursor !== null && !uuid(value.nextCursor))
|
|
49161
|
+
return invalid();
|
|
49162
|
+
const invitations = value.invitations.map((v) => projection(v, organizationId));
|
|
49163
|
+
if (invitations.some((v, n) => v.id <= String(n ? invitations[n - 1].id : request.after ?? "")) || value.nextCursor !== null && (invitations.length !== 50 || value.nextCursor !== invitations.at(-1)?.id))
|
|
49164
|
+
return invalid();
|
|
49165
|
+
return { organizationId, invitations, nextCursor: value.nextCursor };
|
|
49166
|
+
}
|
|
49167
|
+
const invitation = projection(value.invitation, organizationId);
|
|
49168
|
+
if (action !== "issue" && invitation.id !== request.invitationId)
|
|
49169
|
+
return invalid();
|
|
49170
|
+
if (action === "get")
|
|
49171
|
+
return { invitation };
|
|
49172
|
+
if (typeof value.changed !== "boolean")
|
|
49173
|
+
return invalid();
|
|
49174
|
+
if (action === "issue" && (invitation.email !== request.email || invitation.role !== request.role || value.changed && invitation.generation !== 1))
|
|
49175
|
+
return invalid();
|
|
49176
|
+
if (action === "resend" && (value.changed ? invitation.generation !== Number(request.expectedGeneration) + 1 : invitation.generation <= Number(request.expectedGeneration)))
|
|
49177
|
+
return invalid();
|
|
49178
|
+
if (action === "revoke" && (invitation.status !== "revoked" || invitation.generation < Number(request.expectedGeneration) || value.changed && invitation.generation !== request.expectedGeneration))
|
|
49179
|
+
return invalid();
|
|
49180
|
+
return { invitation, changed: value.changed };
|
|
49181
|
+
}
|
|
49182
|
+
var WorkspaceInvitationInputError, invitationFailures, RemoteWorkspaceInvitationError, RemoteWorkspaceInvitationUnconfirmedError, RemoteWorkspaceInvitationReadError, record = (v) => !!v && typeof v === "object" && !Array.isArray(v), uuid = (v) => typeof v === "string" && /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(v), role = (v) => typeof v === "string" && ["owner", "admin", "member", "viewer"].includes(v), email = (v) => typeof v === "string" && v.length <= 254 && !/[\p{Cc}\p{Cs}\u2028\u2029\s]/u.test(v) && /^[^@]+@[^@]+\.[^@]+$/.test(v), timestamp = (v) => typeof v === "string" && v.length <= 40 && /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,6})?(?:Z|[+-]\d\d:\d\d)$/.test(v) && Number.isFinite(Date.parse(v)), inputFailure = () => {
|
|
49183
|
+
throw new WorkspaceInvitationInputError;
|
|
49184
|
+
};
|
|
49185
|
+
var init_remote_invitations = __esm(() => {
|
|
49186
|
+
WorkspaceInvitationInputError = class WorkspaceInvitationInputError extends Error {
|
|
49187
|
+
code = "INVITATION_INPUT_INVALID";
|
|
49188
|
+
constructor() {
|
|
49189
|
+
super("Provide only the documented invitation fields, exact lowercase IDs, expected generation and explicit confirmation. Issue and resend require your stable idempotency key.");
|
|
49190
|
+
this.name = "WorkspaceInvitationInputError";
|
|
49191
|
+
}
|
|
49192
|
+
};
|
|
49193
|
+
invitationFailures = {
|
|
49194
|
+
INVALID_REQUEST: [400, "Invitation parameters were refused."],
|
|
49195
|
+
ACCOUNT_UNAVAILABLE: [403, "Account is unavailable."],
|
|
49196
|
+
INTERACTIVE_SESSION_REQUIRED: [403, "Fresh interactive sign-in is required."],
|
|
49197
|
+
WORKSPACE_ADMIN_REQUIRED: [403, "A current workspace owner or admin is required."],
|
|
49198
|
+
INVITATION_FORBIDDEN: [403, "Your current role cannot manage this invitation."],
|
|
49199
|
+
INVITATION_UNAVAILABLE: [404, "Invitation is unavailable for this account."],
|
|
49200
|
+
INVITATION_CHANGED: [409, "Invitation changed. Read its current generation before another action."],
|
|
49201
|
+
INVITATION_EXISTS: [409, "A pending invitation already exists. Read current invitations."],
|
|
49202
|
+
ALREADY_MEMBER: [409, "An active membership already exists. An invitation cannot change its role."],
|
|
49203
|
+
IDEMPOTENCY_CONFLICT: [409, "This request key was used for different invitation parameters. Reconcile the original request."],
|
|
49204
|
+
INVITATION_LIMIT: [429, "Invitation limit reached. Wait before issuing or resending."],
|
|
49205
|
+
INVITATION_BUSY: [503, "Invitation is busy. Read its state before another action."],
|
|
49206
|
+
INVITATION_DELIVERY_UNAVAILABLE: [503, "Invitation email delivery is unavailable."]
|
|
49207
|
+
};
|
|
49208
|
+
RemoteWorkspaceInvitationError = class RemoteWorkspaceInvitationError extends Error {
|
|
49209
|
+
code;
|
|
49210
|
+
status;
|
|
49211
|
+
constructor(code) {
|
|
49212
|
+
super(invitationFailures[code][1]);
|
|
49213
|
+
this.code = code;
|
|
49214
|
+
this.name = "RemoteWorkspaceInvitationError";
|
|
49215
|
+
this.status = invitationFailures[code][0];
|
|
49216
|
+
}
|
|
49217
|
+
};
|
|
49218
|
+
RemoteWorkspaceInvitationUnconfirmedError = class RemoteWorkspaceInvitationUnconfirmedError extends Error {
|
|
49219
|
+
code = "INVITATION_UNCONFIRMED";
|
|
49220
|
+
constructor() {
|
|
49221
|
+
super("The invitation outcome is unconfirmed. Read current invitations or memberships. Reconcile issue/resend only with the same request key, parameters, server and membership; never generate a new key or retry automatically. Saved credentials are unchanged.");
|
|
49222
|
+
this.name = "RemoteWorkspaceInvitationUnconfirmedError";
|
|
49223
|
+
}
|
|
49224
|
+
};
|
|
49225
|
+
RemoteWorkspaceInvitationReadError = class RemoteWorkspaceInvitationReadError extends Error {
|
|
49226
|
+
code = "INVITATION_READ_FAILED";
|
|
49227
|
+
constructor() {
|
|
49228
|
+
super("Unable to read a valid invitation result. Check the selected server, account, current membership and permissions.");
|
|
49229
|
+
this.name = "RemoteWorkspaceInvitationReadError";
|
|
49230
|
+
}
|
|
49231
|
+
};
|
|
49232
|
+
});
|
|
49233
|
+
|
|
49048
49234
|
// src/lib/remote-workspace-selection.ts
|
|
49049
49235
|
function workspaceExpectedUserId(value) {
|
|
49050
|
-
if (!
|
|
49236
|
+
if (!uuid2(value))
|
|
49051
49237
|
throw new WorkspaceContextInputError;
|
|
49052
49238
|
return value;
|
|
49053
49239
|
}
|
|
49054
49240
|
function workspaceContext(value) {
|
|
49055
|
-
if (!
|
|
49241
|
+
if (!record2(value) || Object.keys(value).sort().join(",") !== "membershipId,userId" || !uuid2(value.userId) || !uuid2(value.membershipId))
|
|
49056
49242
|
throw new WorkspaceContextInputError;
|
|
49057
49243
|
return { userId: value.userId, membershipId: value.membershipId };
|
|
49058
49244
|
}
|
|
49059
|
-
function
|
|
49245
|
+
function invalid2() {
|
|
49060
49246
|
throw new Error(invalidWorkspaceResult);
|
|
49061
49247
|
}
|
|
49062
49248
|
function organization(v) {
|
|
49063
|
-
if (!
|
|
49064
|
-
return
|
|
49249
|
+
if (!record2(v) || !uuid2(v.id) || !text(v.slug) || !text(v.name))
|
|
49250
|
+
return invalid2();
|
|
49065
49251
|
return { id: v.id, slug: v.slug, name: v.name };
|
|
49066
49252
|
}
|
|
49067
49253
|
function parseAccountWorkspaces(value) {
|
|
49068
|
-
if (!
|
|
49069
|
-
return
|
|
49254
|
+
if (!record2(value) || !Array.isArray(value.workspaces) || !value.workspaces.length || value.workspaces.length > 1000)
|
|
49255
|
+
return invalid2();
|
|
49070
49256
|
const workspaces = value.workspaces.map((v) => {
|
|
49071
|
-
if (!
|
|
49072
|
-
return
|
|
49257
|
+
if (!record2(v) || !uuid2(v.membershipId) || !role2(v.role) || typeof v.current !== "boolean")
|
|
49258
|
+
return invalid2();
|
|
49073
49259
|
return { membershipId: v.membershipId, organization: organization(v.organization), role: v.role, current: v.current };
|
|
49074
49260
|
});
|
|
49075
49261
|
if (workspaces.filter((w) => w.current).length !== 1 || new Set(workspaces.map((w) => w.membershipId)).size !== workspaces.length || new Set(workspaces.map((w) => w.organization.id)).size !== workspaces.length)
|
|
49076
|
-
return
|
|
49262
|
+
return invalid2();
|
|
49077
49263
|
return { workspaces };
|
|
49078
49264
|
}
|
|
49079
49265
|
function parseWorkspaceIdentity(value, expectedUserId) {
|
|
49080
|
-
if (!
|
|
49081
|
-
return
|
|
49266
|
+
if (!record2(value))
|
|
49267
|
+
return invalid2();
|
|
49082
49268
|
const user = value.user;
|
|
49083
|
-
if (!
|
|
49084
|
-
return
|
|
49269
|
+
if (!record2(user) || !uuid2(user.id) || !uuid2(user.membershipId) || !text(user.email, 320) || !(user.displayName === null || text(user.displayName)) || !role2(user.role))
|
|
49270
|
+
return invalid2();
|
|
49085
49271
|
if (user.id !== expectedUserId)
|
|
49086
49272
|
throw new WorkspaceIdentityMismatchError;
|
|
49087
49273
|
return { user: { id: user.id, membershipId: user.membershipId, email: user.email, displayName: user.displayName, role: user.role }, organization: organization(value.organization) };
|
|
49088
49274
|
}
|
|
49089
49275
|
function sessionToken(value) {
|
|
49090
49276
|
if (typeof value !== "string" || !value || value.length > 8192 || /[^\x21-\x7e]/.test(value) || value.startsWith("sk_"))
|
|
49091
|
-
return
|
|
49277
|
+
return invalid2();
|
|
49092
49278
|
return value;
|
|
49093
49279
|
}
|
|
49094
49280
|
function parseWorkspaceSession(value, expected) {
|
|
@@ -49098,20 +49284,20 @@ function parseWorkspaceSession(value, expected) {
|
|
|
49098
49284
|
return { token: sessionToken(value.token), ...identity2 };
|
|
49099
49285
|
}
|
|
49100
49286
|
function parseWorkspaceLogin(value, expectedUserId) {
|
|
49101
|
-
const user =
|
|
49102
|
-
if (!
|
|
49103
|
-
return
|
|
49287
|
+
const user = record2(value) && value.user;
|
|
49288
|
+
if (!record2(value) || !record2(user) || !uuid2(user.id))
|
|
49289
|
+
return invalid2();
|
|
49104
49290
|
if (expectedUserId !== undefined && user.id !== expectedUserId)
|
|
49105
49291
|
throw new WorkspaceIdentityMismatchError;
|
|
49106
49292
|
return { token: sessionToken(value.token), userId: user.id };
|
|
49107
49293
|
}
|
|
49108
49294
|
function workspaceSelectionFailure(value, status) {
|
|
49109
|
-
if (!
|
|
49295
|
+
if (!record2(value) || typeof value.code !== "string" || !Object.hasOwn(workspaceSelectionFailures, value.code))
|
|
49110
49296
|
return null;
|
|
49111
49297
|
const code = value.code;
|
|
49112
49298
|
return workspaceSelectionFailures[code][0] === status ? code : null;
|
|
49113
49299
|
}
|
|
49114
|
-
var
|
|
49300
|
+
var record2 = (v) => !!v && typeof v === "object" && !Array.isArray(v), uuid2 = (v) => typeof v === "string" && /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(v), text = (v, max2 = 1024) => typeof v === "string" && !!v.trim() && v.length <= max2 && !/[\p{Cc}\p{Cs}\u2028\u2029]/u.test(v), role2 = (v) => typeof v === "string" && ["owner", "admin", "member", "viewer"].includes(v), invalidWorkspaceResult = "The server returned an invalid workspace selection result.", WorkspaceContextInputError, WorkspaceIdentityMismatchError, workspaceSelectionFailures;
|
|
49115
49301
|
var init_remote_workspace_selection = __esm(() => {
|
|
49116
49302
|
WorkspaceContextInputError = class WorkspaceContextInputError extends Error {
|
|
49117
49303
|
constructor() {
|
|
@@ -49137,7 +49323,7 @@ var init_remote_workspace_selection = __esm(() => {
|
|
|
49137
49323
|
|
|
49138
49324
|
// src/lib/remote-workspace.ts
|
|
49139
49325
|
function workspaceMembersQuery(options = {}) {
|
|
49140
|
-
if (!
|
|
49326
|
+
if (!record3(options) || Object.keys(options).some((key) => key !== "limit" && key !== "cursor") || options.limit !== undefined && (!Number.isInteger(options.limit) || options.limit < 1 || options.limit > 100) || options.cursor !== undefined && !cursor(options.cursor))
|
|
49141
49327
|
throw new Error("Use a roster limit from 1 to 100 and an unchanged continuation cursor.");
|
|
49142
49328
|
const query = new URLSearchParams;
|
|
49143
49329
|
if (options.limit !== undefined)
|
|
@@ -49146,14 +49332,14 @@ function workspaceMembersQuery(options = {}) {
|
|
|
49146
49332
|
query.set("cursor", options.cursor);
|
|
49147
49333
|
return query.size ? `?${query}` : "";
|
|
49148
49334
|
}
|
|
49149
|
-
function
|
|
49335
|
+
function timestamp2(value) {
|
|
49150
49336
|
if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{6}Z$/.test(value))
|
|
49151
49337
|
return false;
|
|
49152
49338
|
const time = Date.parse(value);
|
|
49153
49339
|
return Number.isFinite(time) && new Date(time).toISOString().slice(0, 23) === value.slice(0, 23);
|
|
49154
49340
|
}
|
|
49155
49341
|
function parseMember(row, fail2) {
|
|
49156
|
-
if (!
|
|
49342
|
+
if (!record3(row) || !uuid3(row.membershipId) || !uuid3(row.userId) || typeof row.email !== "string" || !row.email || !(row.displayName === null || typeof row.displayName === "string") || !isRole(row.role) || !timestamp2(row.createdAt))
|
|
49157
49343
|
return fail2();
|
|
49158
49344
|
return {
|
|
49159
49345
|
membershipId: row.membershipId,
|
|
@@ -49165,12 +49351,12 @@ function parseMember(row, fail2) {
|
|
|
49165
49351
|
};
|
|
49166
49352
|
}
|
|
49167
49353
|
function mutationInput(membershipId, input, roleChange) {
|
|
49168
|
-
if (typeof membershipId !== "string" || !
|
|
49354
|
+
if (typeof membershipId !== "string" || !uuid3(membershipId) || membershipId !== membershipId.toLowerCase() || !record3(input) || Object.keys(input).sort().join(",") !== (roleChange ? "expectedRole,role" : "expectedRole"))
|
|
49169
49355
|
throw new WorkspaceMemberInputError;
|
|
49170
|
-
const expectedRole = input.expectedRole,
|
|
49171
|
-
if (!isRole(expectedRole) || roleChange && !isRole(
|
|
49356
|
+
const expectedRole = input.expectedRole, role3 = roleChange ? input.role : undefined;
|
|
49357
|
+
if (!isRole(expectedRole) || roleChange && !isRole(role3))
|
|
49172
49358
|
throw new WorkspaceMemberInputError;
|
|
49173
|
-
return { membershipId, role:
|
|
49359
|
+
return { membershipId, role: role3, expectedRole };
|
|
49174
49360
|
}
|
|
49175
49361
|
function workspaceMemberRoleInput(membershipId, input) {
|
|
49176
49362
|
const value = mutationInput(membershipId, input, true);
|
|
@@ -49180,24 +49366,24 @@ function workspaceMemberRemovalInput(membershipId, input) {
|
|
|
49180
49366
|
const value = mutationInput(membershipId, input, false);
|
|
49181
49367
|
return { membershipId: value.membershipId, body: { expectedRole: value.expectedRole } };
|
|
49182
49368
|
}
|
|
49183
|
-
function parseWorkspaceMemberRoleResult(value, membershipId,
|
|
49369
|
+
function parseWorkspaceMemberRoleResult(value, membershipId, role3) {
|
|
49184
49370
|
const fail2 = () => {
|
|
49185
49371
|
throw new Error(invalidMemberResult);
|
|
49186
49372
|
};
|
|
49187
|
-
if (!
|
|
49373
|
+
if (!record3(value) || !uuid3(value.organizationId) || typeof value.changed !== "boolean")
|
|
49188
49374
|
return fail2();
|
|
49189
49375
|
const member = parseMember(value.member, fail2);
|
|
49190
|
-
if (member.membershipId !== membershipId || member.role !==
|
|
49376
|
+
if (member.membershipId !== membershipId || member.role !== role3)
|
|
49191
49377
|
return fail2();
|
|
49192
49378
|
return { organizationId: value.organizationId, member, changed: value.changed };
|
|
49193
49379
|
}
|
|
49194
49380
|
function parseWorkspaceMemberRemovalResult(value, membershipId) {
|
|
49195
|
-
if (!
|
|
49381
|
+
if (!record3(value) || !uuid3(value.organizationId) || value.membershipId !== membershipId || value.removed !== true || typeof value.alreadyRemoved !== "boolean")
|
|
49196
49382
|
throw new Error(invalidMemberResult);
|
|
49197
49383
|
return { organizationId: value.organizationId, membershipId, removed: true, alreadyRemoved: value.alreadyRemoved };
|
|
49198
49384
|
}
|
|
49199
49385
|
function workspaceMemberFailure(value, status) {
|
|
49200
|
-
if (!
|
|
49386
|
+
if (!record3(value) || typeof value.code !== "string" || !Object.hasOwn(workspaceMemberFailures, value.code))
|
|
49201
49387
|
return null;
|
|
49202
49388
|
const code = value.code;
|
|
49203
49389
|
return workspaceMemberFailures[code][0] === status ? code : null;
|
|
@@ -49206,14 +49392,14 @@ function parseWorkspaceMembersPage(value) {
|
|
|
49206
49392
|
const fail2 = () => {
|
|
49207
49393
|
throw new Error("The server returned an invalid workspace roster.");
|
|
49208
49394
|
};
|
|
49209
|
-
if (!
|
|
49395
|
+
if (!record3(value) || !uuid3(value.organizationId) || !Array.isArray(value.members) || value.members.length > 100 || !(value.nextCursor === null || cursor(value.nextCursor)) || !value.members.length && value.nextCursor !== null)
|
|
49210
49396
|
return fail2();
|
|
49211
49397
|
const members = value.members.map((row) => parseMember(row, fail2));
|
|
49212
49398
|
if (new Set(members.map((row) => row.membershipId)).size !== members.length)
|
|
49213
49399
|
return fail2();
|
|
49214
49400
|
return { organizationId: value.organizationId, members, nextCursor: value.nextCursor };
|
|
49215
49401
|
}
|
|
49216
|
-
var
|
|
49402
|
+
var record3 = (value) => !!value && typeof value === "object" && !Array.isArray(value), cursor = (value) => typeof value === "string" && /^[A-Za-z0-9_-]{1,512}$/.test(value), uuid3 = (value) => typeof value === "string" && /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(value), isRole = (value) => typeof value === "string" && ["owner", "admin", "member", "viewer"].includes(value), WorkspaceMemberInputError, invalidMemberResult = "The server returned an invalid workspace member result. Refresh the roster before another action.", workspaceMemberFailures;
|
|
49217
49403
|
var init_remote_workspace = __esm(() => {
|
|
49218
49404
|
WorkspaceMemberInputError = class WorkspaceMemberInputError extends Error {
|
|
49219
49405
|
constructor() {
|
|
@@ -49322,14 +49508,14 @@ function readIdentity(env3 = process.env) {
|
|
|
49322
49508
|
const parsed = JSON.parse(readFileSync12(getIdentityFilePath(env3), "utf-8"));
|
|
49323
49509
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
49324
49510
|
return {};
|
|
49325
|
-
const
|
|
49511
|
+
const record4 = parsed;
|
|
49326
49512
|
const selected = resolveSkillsApiOrigin(env3)?.origin;
|
|
49327
|
-
const bound = typeof
|
|
49513
|
+
const bound = typeof record4.apiUrl === "string" ? record4.apiUrl : readCredentialValue(SKILLS_BOUND_API_URL, env3) ?? readStoredApiUrl(env3) ?? defaultFleetGatewayBaseUrl("skills");
|
|
49328
49514
|
if (selected && normalizeSkillsApiOrigin(bound) !== selected)
|
|
49329
49515
|
return {};
|
|
49330
49516
|
const identity2 = {};
|
|
49331
49517
|
for (const field of ["email", "orgId", "orgSlug", "userId"]) {
|
|
49332
|
-
const value =
|
|
49518
|
+
const value = record4[field];
|
|
49333
49519
|
if (typeof value === "string" && value.length > 0)
|
|
49334
49520
|
identity2[field] = value;
|
|
49335
49521
|
}
|
|
@@ -49478,44 +49664,44 @@ var init_auth_store = __esm(() => {
|
|
|
49478
49664
|
|
|
49479
49665
|
// src/lib/remote-run-contract.ts
|
|
49480
49666
|
function normalizeRemoteSkillRunContract(payload, fallbackSkill) {
|
|
49481
|
-
const
|
|
49667
|
+
const record4 = isRecord3(payload) ? payload : {};
|
|
49482
49668
|
return {
|
|
49483
49669
|
contractVersion: REMOTE_SKILL_RUN_CONTRACT_VERSION,
|
|
49484
|
-
...pickString(
|
|
49485
|
-
skill: pickStringValue(
|
|
49486
|
-
...pickString(
|
|
49487
|
-
...pickString(
|
|
49488
|
-
...pickNumber(
|
|
49489
|
-
...pickString(
|
|
49490
|
-
...pickString(
|
|
49491
|
-
...pickString(
|
|
49492
|
-
...pickString(
|
|
49493
|
-
...pickNumber(
|
|
49494
|
-
...pickString(
|
|
49495
|
-
...hasOwn(
|
|
49496
|
-
...pickString(
|
|
49497
|
-
...pickString(
|
|
49498
|
-
...pickString(
|
|
49499
|
-
...pickString(
|
|
49500
|
-
...hasOwn(
|
|
49670
|
+
...pickString(record4, "id"),
|
|
49671
|
+
skill: pickStringValue(record4, "skill") ?? fallbackSkill,
|
|
49672
|
+
...pickString(record4, "requestedSlug"),
|
|
49673
|
+
...pickString(record4, "status"),
|
|
49674
|
+
...pickNumber(record4, "exitCode"),
|
|
49675
|
+
...pickString(record4, "correlationId"),
|
|
49676
|
+
...pickString(record4, "createdAt"),
|
|
49677
|
+
...pickString(record4, "startedAt"),
|
|
49678
|
+
...pickString(record4, "completedAt"),
|
|
49679
|
+
...pickNumber(record4, "durationMs"),
|
|
49680
|
+
...pickString(record4, "outputType"),
|
|
49681
|
+
...hasOwn(record4, "outputPreview") ? { outputPreview: record4.outputPreview } : {},
|
|
49682
|
+
...pickString(record4, "errorCode"),
|
|
49683
|
+
...pickString(record4, "errorMessage"),
|
|
49684
|
+
...pickString(record4, "error"),
|
|
49685
|
+
...pickString(record4, "code"),
|
|
49686
|
+
...hasOwn(record4, "details") ? { details: record4.details } : {}
|
|
49501
49687
|
};
|
|
49502
49688
|
}
|
|
49503
49689
|
function isRecord3(value) {
|
|
49504
49690
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
49505
49691
|
}
|
|
49506
|
-
function hasOwn(
|
|
49507
|
-
return Object.prototype.hasOwnProperty.call(
|
|
49692
|
+
function hasOwn(record4, key) {
|
|
49693
|
+
return Object.prototype.hasOwnProperty.call(record4, key);
|
|
49508
49694
|
}
|
|
49509
|
-
function pickString(
|
|
49510
|
-
const value = pickStringValue(
|
|
49695
|
+
function pickString(record4, key) {
|
|
49696
|
+
const value = pickStringValue(record4, key);
|
|
49511
49697
|
return value === undefined ? {} : { [key]: value };
|
|
49512
49698
|
}
|
|
49513
|
-
function pickStringValue(
|
|
49514
|
-
const value =
|
|
49699
|
+
function pickStringValue(record4, key) {
|
|
49700
|
+
const value = record4[key];
|
|
49515
49701
|
return typeof value === "string" ? value : undefined;
|
|
49516
49702
|
}
|
|
49517
|
-
function pickNumber(
|
|
49518
|
-
const value =
|
|
49703
|
+
function pickNumber(record4, key) {
|
|
49704
|
+
const value = record4[key];
|
|
49519
49705
|
return typeof value === "number" && Number.isFinite(value) ? { [key]: value } : {};
|
|
49520
49706
|
}
|
|
49521
49707
|
var REMOTE_SKILL_RUN_CONTRACT_VERSION = 1;
|
|
@@ -49602,11 +49788,11 @@ var init_remote_account = __esm(() => {
|
|
|
49602
49788
|
// src/lib/remote-files.ts
|
|
49603
49789
|
var exports_remote_files = {};
|
|
49604
49790
|
__export(exports_remote_files, {
|
|
49605
|
-
|
|
49606
|
-
readBoundedResponse: () => readBoundedResponse,
|
|
49607
|
-
describeRemoteFiles: () => describeRemoteFiles,
|
|
49791
|
+
MAX_REMOTE_FILE_BYTES: () => MAX_REMOTE_FILE_BYTES,
|
|
49608
49792
|
decodeRemoteFiles: () => decodeRemoteFiles,
|
|
49609
|
-
|
|
49793
|
+
describeRemoteFiles: () => describeRemoteFiles,
|
|
49794
|
+
readBoundedResponse: () => readBoundedResponse,
|
|
49795
|
+
sha256: () => sha256
|
|
49610
49796
|
});
|
|
49611
49797
|
import { createHash as createHash2 } from "crypto";
|
|
49612
49798
|
function describeRemoteFiles(files) {
|
|
@@ -49714,17 +49900,84 @@ function parseUpdatedWorkspace(value) {
|
|
|
49714
49900
|
return { organization: { id: organization2.id, slug: organization2.slug, name: organization2.name } };
|
|
49715
49901
|
}
|
|
49716
49902
|
|
|
49903
|
+
// src/lib/remote-quote-errors.ts
|
|
49904
|
+
async function readQuoteUnavailableCode(response) {
|
|
49905
|
+
const maximum = 16 * 1024;
|
|
49906
|
+
const length = response.headers.get("content-length");
|
|
49907
|
+
if (response.status !== 503 || response.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase() !== "application/json" || length !== null && (!/^\d+$/.test(length) || Number(length) > maximum)) {
|
|
49908
|
+
response.body?.cancel().catch(() => {});
|
|
49909
|
+
return null;
|
|
49910
|
+
}
|
|
49911
|
+
const reader = response.body?.getReader();
|
|
49912
|
+
if (!reader)
|
|
49913
|
+
return null;
|
|
49914
|
+
let timer;
|
|
49915
|
+
let deadlineExceeded = false;
|
|
49916
|
+
const expired = Symbol("quote body deadline");
|
|
49917
|
+
const deadline = new Promise((resolve3) => {
|
|
49918
|
+
timer = setTimeout(() => {
|
|
49919
|
+
deadlineExceeded = true;
|
|
49920
|
+
resolve3(expired);
|
|
49921
|
+
reader.cancel().catch(() => {});
|
|
49922
|
+
}, 1500);
|
|
49923
|
+
});
|
|
49924
|
+
const chunks = [];
|
|
49925
|
+
let size2 = 0;
|
|
49926
|
+
try {
|
|
49927
|
+
while (true) {
|
|
49928
|
+
const next = await Promise.race([reader.read(), deadline]);
|
|
49929
|
+
if (next === expired || deadlineExceeded)
|
|
49930
|
+
return null;
|
|
49931
|
+
if (next.done)
|
|
49932
|
+
break;
|
|
49933
|
+
size2 += next.value.byteLength;
|
|
49934
|
+
if (size2 > maximum)
|
|
49935
|
+
return null;
|
|
49936
|
+
chunks.push(next.value);
|
|
49937
|
+
}
|
|
49938
|
+
const bytes = new Uint8Array(size2);
|
|
49939
|
+
let offset = 0;
|
|
49940
|
+
for (const chunk2 of chunks) {
|
|
49941
|
+
bytes.set(chunk2, offset);
|
|
49942
|
+
offset += chunk2.byteLength;
|
|
49943
|
+
}
|
|
49944
|
+
const value = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
49945
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
49946
|
+
return null;
|
|
49947
|
+
const code = value.code;
|
|
49948
|
+
return typeof code === "string" && Object.hasOwn(quoteUnavailableMessages, code) ? code : null;
|
|
49949
|
+
} catch {
|
|
49950
|
+
return null;
|
|
49951
|
+
} finally {
|
|
49952
|
+
clearTimeout(timer);
|
|
49953
|
+
reader.cancel().catch(() => {});
|
|
49954
|
+
reader.releaseLock();
|
|
49955
|
+
}
|
|
49956
|
+
}
|
|
49957
|
+
var quoteUnavailableMessages;
|
|
49958
|
+
var init_remote_quote_errors = __esm(() => {
|
|
49959
|
+
quoteUnavailableMessages = Object.freeze({
|
|
49960
|
+
HOSTED_PROVIDER_UNAVAILABLE: "Hosted execution is temporarily unavailable on this Skills instance.",
|
|
49961
|
+
HOSTED_CONNECTORS_UNAVAILABLE: "Hosted connector execution is unavailable on this Skills instance.",
|
|
49962
|
+
SKILL_IMPLEMENTATION_UNAVAILABLE: "This skill has no hosted execution implementation.",
|
|
49963
|
+
HOSTED_PRICING_UNAVAILABLE: "Hosted execution is unavailable while this skill's pricing is reviewed.",
|
|
49964
|
+
RUNTIME_ALLOWLIST_REQUIRED: "Hosted execution is unavailable until this Skills instance enables its skill catalog.",
|
|
49965
|
+
RUNTIME_SKILL_NOT_ALLOWED: "This skill is not enabled for hosted execution on this Skills instance."
|
|
49966
|
+
});
|
|
49967
|
+
});
|
|
49968
|
+
|
|
49717
49969
|
// src/lib/remote-client.ts
|
|
49718
49970
|
var exports_remote_client = {};
|
|
49719
49971
|
__export(exports_remote_client, {
|
|
49720
|
-
|
|
49721
|
-
|
|
49722
|
-
RemoteWorkspaceSelectionError: () => RemoteWorkspaceSelectionError,
|
|
49723
|
-
RemoteWorkspaceMemberError: () => RemoteWorkspaceMemberError,
|
|
49724
|
-
RemoteSkillsClient: () => RemoteSkillsClient,
|
|
49725
|
-
RemoteRouteUnsupportedError: () => RemoteRouteUnsupportedError,
|
|
49972
|
+
RemoteCapabilityUnavailableError: () => RemoteCapabilityUnavailableError,
|
|
49973
|
+
RemoteQuoteUnavailableError: () => RemoteQuoteUnavailableError,
|
|
49726
49974
|
RemoteRequestError: () => RemoteRequestError,
|
|
49727
|
-
|
|
49975
|
+
RemoteRouteUnsupportedError: () => RemoteRouteUnsupportedError,
|
|
49976
|
+
RemoteSkillsClient: () => RemoteSkillsClient,
|
|
49977
|
+
RemoteWorkspaceMemberError: () => RemoteWorkspaceMemberError,
|
|
49978
|
+
RemoteWorkspaceSelectionError: () => RemoteWorkspaceSelectionError,
|
|
49979
|
+
createRemoteSkillsClient: () => createRemoteSkillsClient,
|
|
49980
|
+
createRemoteSkillsClientReadOnly: () => createRemoteSkillsClientReadOnly
|
|
49728
49981
|
});
|
|
49729
49982
|
|
|
49730
49983
|
class RemoteSkillsClient {
|
|
@@ -49759,6 +50012,11 @@ class RemoteSkillsClient {
|
|
|
49759
50012
|
throw new RemoteRouteUnsupportedError(routePath, response.status, this.apiUrl);
|
|
49760
50013
|
}
|
|
49761
50014
|
if (!response.ok) {
|
|
50015
|
+
if (opts.quoteRefusal && options?.method === "POST" && /^\/api\/v1\/skills\/[^/?#]+\/quote$/.test(routePath) && response.status === 503) {
|
|
50016
|
+
const code = await readQuoteUnavailableCode(response);
|
|
50017
|
+
if (code)
|
|
50018
|
+
throw new RemoteQuoteUnavailableError(routePath, code);
|
|
50019
|
+
}
|
|
49762
50020
|
if (path === "/api/v1/billing/checkout" && options?.method === "POST" && response.status === 503 && await responseBodyCarriesCode(response, ["SUBSCRIPTION_CHECKOUT_UNAVAILABLE"])) {
|
|
49763
50021
|
throw new RemoteCapabilityUnavailableError;
|
|
49764
50022
|
}
|
|
@@ -49816,7 +50074,7 @@ class RemoteSkillsClient {
|
|
|
49816
50074
|
const response = await this.requestNewRoute(`/api/v1/skills/${encodeURIComponent(slug)}/quote`, {
|
|
49817
50075
|
method: "POST",
|
|
49818
50076
|
body: JSON.stringify({ input, args })
|
|
49819
|
-
});
|
|
50077
|
+
}, { quoteRefusal: true });
|
|
49820
50078
|
return parseRemoteRunQuote(await response.json());
|
|
49821
50079
|
}
|
|
49822
50080
|
getCapabilities() {
|
|
@@ -49981,6 +50239,53 @@ class RemoteSkillsClient {
|
|
|
49981
50239
|
}
|
|
49982
50240
|
return parseWorkspaceLeaveResult(body, captured.context.membershipId, identity2.organization.id);
|
|
49983
50241
|
}
|
|
50242
|
+
listWorkspaceInvitations(context, options = {}) {
|
|
50243
|
+
return this.requestWorkspaceInvitation(context, "list", options);
|
|
50244
|
+
}
|
|
50245
|
+
getWorkspaceInvitation(context, invitationId2) {
|
|
50246
|
+
return this.requestWorkspaceInvitation(context, "get", { invitationId: invitationId2 });
|
|
50247
|
+
}
|
|
50248
|
+
issueWorkspaceInvitation(context, input) {
|
|
50249
|
+
return this.requestWorkspaceInvitation(context, "issue", input);
|
|
50250
|
+
}
|
|
50251
|
+
resendWorkspaceInvitation(context, invitationId2, input) {
|
|
50252
|
+
return this.requestWorkspaceInvitation(context, "resend", { ...input, invitationId: invitationId2 });
|
|
50253
|
+
}
|
|
50254
|
+
revokeWorkspaceInvitation(context, invitationId2, input) {
|
|
50255
|
+
return this.requestWorkspaceInvitation(context, "revoke", { ...input, invitationId: invitationId2 });
|
|
50256
|
+
}
|
|
50257
|
+
acceptWorkspaceInvitation(context, invitationId2, input) {
|
|
50258
|
+
return this.requestWorkspaceInvitation(context, "accept", { ...input, invitationId: invitationId2 });
|
|
50259
|
+
}
|
|
50260
|
+
async requestWorkspaceInvitation(context, action, input) {
|
|
50261
|
+
const target = workspaceContext(context), captured = invitationInput(action, input);
|
|
50262
|
+
const connection = new RemoteSkillsClient(this.apiKey, this.apiUrl);
|
|
50263
|
+
const identityValue = await connection.requestWorkspaceSelection("/api/auth/whoami");
|
|
50264
|
+
if (!identityValue || typeof identityValue !== "object" || identityValue.authMethod !== "jwt")
|
|
50265
|
+
throw new RemoteWorkspaceInvitationError("INTERACTIVE_SESSION_REQUIRED");
|
|
50266
|
+
const identity2 = parseWorkspaceIdentity(identityValue, target.userId);
|
|
50267
|
+
if (identity2.user.membershipId !== target.membershipId)
|
|
50268
|
+
throw new WorkspaceIdentityMismatchError;
|
|
50269
|
+
const request = invitationRequest(action, captured), read = action === "list" || action === "get";
|
|
50270
|
+
let response, value;
|
|
50271
|
+
try {
|
|
50272
|
+
response = await connection.request(request.path, { method: request.method, ...request.body ? { body: request.body } : {}, credentials: "omit" });
|
|
50273
|
+
value = JSON.parse(new TextDecoder().decode(await readBoundedResponse(response, response.ok ? 64 * 1024 : 4096)));
|
|
50274
|
+
} catch {
|
|
50275
|
+
throw read ? new RemoteWorkspaceInvitationReadError : new RemoteWorkspaceInvitationUnconfirmedError;
|
|
50276
|
+
}
|
|
50277
|
+
if (!response.ok) {
|
|
50278
|
+
const code = invitationFailure(value, response.status);
|
|
50279
|
+
if (code)
|
|
50280
|
+
throw new RemoteWorkspaceInvitationError(code);
|
|
50281
|
+
throw read ? new RemoteWorkspaceInvitationReadError : new RemoteWorkspaceInvitationUnconfirmedError;
|
|
50282
|
+
}
|
|
50283
|
+
try {
|
|
50284
|
+
return parseInvitationResult(action, value, captured, identity2.organization.id);
|
|
50285
|
+
} catch {
|
|
50286
|
+
throw read ? new RemoteWorkspaceInvitationReadError : new RemoteWorkspaceInvitationUnconfirmedError;
|
|
50287
|
+
}
|
|
50288
|
+
}
|
|
49984
50289
|
async listApiKeys() {
|
|
49985
50290
|
return this.arrayResponse("/api/auth/keys");
|
|
49986
50291
|
}
|
|
@@ -50231,13 +50536,13 @@ class RemoteSkillsClient {
|
|
|
50231
50536
|
return normalizeUpdatedSincePage(await response.json());
|
|
50232
50537
|
}
|
|
50233
50538
|
}
|
|
50234
|
-
function requireOptionalString(
|
|
50235
|
-
if (
|
|
50539
|
+
function requireOptionalString(record4, field) {
|
|
50540
|
+
if (record4[field] === undefined)
|
|
50236
50541
|
return;
|
|
50237
|
-
if (typeof
|
|
50542
|
+
if (typeof record4[field] !== "string") {
|
|
50238
50543
|
throw new Error(`Remote payload did not match the expected contract (${field} must be a string when present)`);
|
|
50239
50544
|
}
|
|
50240
|
-
return
|
|
50545
|
+
return record4[field];
|
|
50241
50546
|
}
|
|
50242
50547
|
function isVersionRecord(value) {
|
|
50243
50548
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -50259,19 +50564,19 @@ function normalizePin(entry) {
|
|
|
50259
50564
|
if (!entry || typeof entry !== "object") {
|
|
50260
50565
|
throw new Error("Remote pin payload did not match the expected contract (expected an object)");
|
|
50261
50566
|
}
|
|
50262
|
-
const
|
|
50263
|
-
const slug = typeof
|
|
50567
|
+
const record4 = entry;
|
|
50568
|
+
const slug = typeof record4.slug === "string" && record4.slug.trim() ? record4.slug.trim() : undefined;
|
|
50264
50569
|
if (!slug) {
|
|
50265
50570
|
throw new Error("Remote pin payload did not match the expected contract (missing slug)");
|
|
50266
50571
|
}
|
|
50267
50572
|
let metadata;
|
|
50268
|
-
if (
|
|
50269
|
-
if (!
|
|
50573
|
+
if (record4.metadata !== undefined) {
|
|
50574
|
+
if (!record4.metadata || typeof record4.metadata !== "object" || Array.isArray(record4.metadata)) {
|
|
50270
50575
|
throw new Error("Remote pin payload did not match the expected contract (metadata must be a JSON object when present)");
|
|
50271
50576
|
}
|
|
50272
|
-
metadata =
|
|
50577
|
+
metadata = record4.metadata;
|
|
50273
50578
|
}
|
|
50274
|
-
const pinnedAt = requireOptionalString(
|
|
50579
|
+
const pinnedAt = requireOptionalString(record4, "pinnedAt");
|
|
50275
50580
|
return {
|
|
50276
50581
|
slug,
|
|
50277
50582
|
...pinnedAt !== undefined ? { pinnedAt } : {},
|
|
@@ -50288,16 +50593,16 @@ function normalizeSkillSummary(entry) {
|
|
|
50288
50593
|
if (!entry || typeof entry !== "object") {
|
|
50289
50594
|
throw new Error("Remote skill payload did not match the expected contract (expected an object)");
|
|
50290
50595
|
}
|
|
50291
|
-
const
|
|
50292
|
-
const slug = typeof
|
|
50596
|
+
const record4 = entry;
|
|
50597
|
+
const slug = typeof record4.slug === "string" && record4.slug.trim() ? record4.slug.trim() : undefined;
|
|
50293
50598
|
if (!slug) {
|
|
50294
50599
|
throw new Error("Remote skill payload did not match the expected contract (missing slug)");
|
|
50295
50600
|
}
|
|
50296
50601
|
return {
|
|
50297
50602
|
slug,
|
|
50298
|
-
...requireOptionalString(
|
|
50299
|
-
...requireOptionalString(
|
|
50300
|
-
...requireOptionalString(
|
|
50603
|
+
...requireOptionalString(record4, "name") !== undefined ? { name: requireOptionalString(record4, "name") } : {},
|
|
50604
|
+
...requireOptionalString(record4, "version") !== undefined ? { version: requireOptionalString(record4, "version") } : {},
|
|
50605
|
+
...requireOptionalString(record4, "updatedAt") !== undefined ? { updatedAt: requireOptionalString(record4, "updatedAt") } : {}
|
|
50301
50606
|
};
|
|
50302
50607
|
}
|
|
50303
50608
|
function normalizeSkillSummaryList(payload) {
|
|
@@ -50350,12 +50655,12 @@ function normalizeUpdatedSincePage(payload) {
|
|
|
50350
50655
|
if (!payload || typeof payload !== "object") {
|
|
50351
50656
|
throw new Error("Updated-since payload did not match the expected contract (expected an object)");
|
|
50352
50657
|
}
|
|
50353
|
-
const
|
|
50354
|
-
if (!Array.isArray(
|
|
50658
|
+
const record4 = payload;
|
|
50659
|
+
if (!Array.isArray(record4.skills)) {
|
|
50355
50660
|
throw new Error("Updated-since payload did not match the expected contract (missing skills array)");
|
|
50356
50661
|
}
|
|
50357
|
-
const skills =
|
|
50358
|
-
const nextCursor =
|
|
50662
|
+
const skills = record4.skills.map(normalizeSkillSummary);
|
|
50663
|
+
const nextCursor = record4.nextCursor === undefined || record4.nextCursor === null ? null : record4.nextCursor;
|
|
50359
50664
|
if (nextCursor !== null && typeof nextCursor !== "string") {
|
|
50360
50665
|
throw new Error("Updated-since payload did not match the expected contract (nextCursor must be a string or absent)");
|
|
50361
50666
|
}
|
|
@@ -50368,8 +50673,9 @@ async function createRemoteSkillsClient(env3 = process.env) {
|
|
|
50368
50673
|
function createRemoteSkillsClientReadOnly(env3 = process.env) {
|
|
50369
50674
|
return createRemoteSkillsClient(env3);
|
|
50370
50675
|
}
|
|
50371
|
-
var RemoteRouteUnsupportedError, RemoteRequestError, RemoteWorkspaceMemberError, RemoteWorkspaceSelectionError, RemoteCapabilityUnavailableError, INVALID_SKILL_VERSION_RESPONSE = "Remote skill version payload did not match the expected contract.";
|
|
50676
|
+
var RemoteRouteUnsupportedError, RemoteRequestError, RemoteQuoteUnavailableError, RemoteWorkspaceMemberError, RemoteWorkspaceSelectionError, RemoteCapabilityUnavailableError, INVALID_SKILL_VERSION_RESPONSE = "Remote skill version payload did not match the expected contract.";
|
|
50372
50677
|
var init_remote_client = __esm(() => {
|
|
50678
|
+
init_remote_invitations();
|
|
50373
50679
|
init_remote_workspace_leave();
|
|
50374
50680
|
init_remote_workspace_selection();
|
|
50375
50681
|
init_remote_workspace();
|
|
@@ -50378,6 +50684,7 @@ var init_remote_client = __esm(() => {
|
|
|
50378
50684
|
init_fleet_credentials();
|
|
50379
50685
|
init_remote_account();
|
|
50380
50686
|
init_remote_files();
|
|
50687
|
+
init_remote_quote_errors();
|
|
50381
50688
|
RemoteRouteUnsupportedError = class RemoteRouteUnsupportedError extends Error {
|
|
50382
50689
|
path;
|
|
50383
50690
|
status;
|
|
@@ -50400,6 +50707,17 @@ var init_remote_client = __esm(() => {
|
|
|
50400
50707
|
this.name = "RemoteRequestError";
|
|
50401
50708
|
}
|
|
50402
50709
|
};
|
|
50710
|
+
RemoteQuoteUnavailableError = class RemoteQuoteUnavailableError extends RemoteRequestError {
|
|
50711
|
+
code;
|
|
50712
|
+
constructor(path, code) {
|
|
50713
|
+
super(path, 503);
|
|
50714
|
+
this.code = code;
|
|
50715
|
+
if (!Object.hasOwn(quoteUnavailableMessages, code))
|
|
50716
|
+
throw new Error("Unknown quote refusal code");
|
|
50717
|
+
this.name = "RemoteQuoteUnavailableError";
|
|
50718
|
+
this.message = quoteUnavailableMessages[code];
|
|
50719
|
+
}
|
|
50720
|
+
};
|
|
50403
50721
|
RemoteWorkspaceMemberError = class RemoteWorkspaceMemberError extends RemoteRequestError {
|
|
50404
50722
|
code;
|
|
50405
50723
|
constructor(path, code) {
|
|
@@ -50654,7 +50972,7 @@ function concat2(chunks) {
|
|
|
50654
50972
|
}
|
|
50655
50973
|
return merged;
|
|
50656
50974
|
}
|
|
50657
|
-
var BLOCK = 512, ANY_SEGMENT_EXCLUDES, ROOT_EXCLUDES, TOOL_SIDECAR_FILENAMES, CREDENTIAL_FILENAMES, CREDENTIAL_EXTENSIONS, ENV_TEMPLATE_NAMES, NON_DOTENV_EXTENSIONS;
|
|
50975
|
+
var BLOCK = 512, ANY_SEGMENT_EXCLUDES, ROOT_EXCLUDES, TOOL_SIDECAR_FILENAMES, CREDENTIAL_FILENAMES, CREDENTIAL_EXTENSIONS, ENV_TEMPLATE_NAMES, NON_DOTENV_EXTENSIONS, SKILL_BUNDLE_INSPECTION_LIMITS;
|
|
50658
50976
|
var init_skill_bundle = __esm(() => {
|
|
50659
50977
|
ANY_SEGMENT_EXCLUDES = new Set([
|
|
50660
50978
|
".git",
|
|
@@ -50778,6 +51096,14 @@ var init_skill_bundle = __esm(() => {
|
|
|
50778
51096
|
"tar",
|
|
50779
51097
|
"wasm"
|
|
50780
51098
|
]);
|
|
51099
|
+
SKILL_BUNDLE_INSPECTION_LIMITS = Object.freeze({
|
|
51100
|
+
compressedBytes: 16 * 1024 * 1024,
|
|
51101
|
+
decompressedBytes: 64 * 1024 * 1024,
|
|
51102
|
+
entries: 1024,
|
|
51103
|
+
fileBytes: 16 * 1024 * 1024,
|
|
51104
|
+
pathBytes: 100,
|
|
51105
|
+
timeoutMs: 5000
|
|
51106
|
+
});
|
|
50781
51107
|
});
|
|
50782
51108
|
|
|
50783
51109
|
// src/lib/skill-version.ts
|
|
@@ -51146,16 +51472,16 @@ function installBundleAtomically(name, entries, options = {}, marker = {}) {
|
|
|
51146
51472
|
}
|
|
51147
51473
|
return { path: target, created };
|
|
51148
51474
|
}
|
|
51149
|
-
function writePullMarker(dir,
|
|
51475
|
+
function writePullMarker(dir, record4) {
|
|
51150
51476
|
const marker = {
|
|
51151
51477
|
managedBy: "@hasna/skills",
|
|
51152
|
-
skill:
|
|
51153
|
-
source:
|
|
51154
|
-
...
|
|
51155
|
-
...
|
|
51156
|
-
...
|
|
51157
|
-
...
|
|
51158
|
-
...
|
|
51478
|
+
skill: record4.skill,
|
|
51479
|
+
source: record4.source ?? "pull",
|
|
51480
|
+
...record4.version ? { version: record4.version } : {},
|
|
51481
|
+
...record4.contentHash ? { contentHash: record4.contentHash } : {},
|
|
51482
|
+
...record4.sourceCommit ? { sourceCommit: record4.sourceCommit } : {},
|
|
51483
|
+
...record4.signature ? { signature: record4.signature } : {},
|
|
51484
|
+
...record4.revisionId ? { revisionId: record4.revisionId } : {},
|
|
51159
51485
|
syncedAt: new Date().toISOString()
|
|
51160
51486
|
};
|
|
51161
51487
|
writeFileSync8(join20(dir, PULL_MARKER_FILE), `${JSON.stringify(marker, null, 2)}
|
|
@@ -51170,19 +51496,19 @@ async function safeMeta(client, slug) {
|
|
|
51170
51496
|
}
|
|
51171
51497
|
if (!raw || typeof raw !== "object")
|
|
51172
51498
|
return null;
|
|
51173
|
-
const
|
|
51174
|
-
const kind =
|
|
51175
|
-
const tags = Array.isArray(
|
|
51499
|
+
const record4 = raw;
|
|
51500
|
+
const kind = record4.kind === "instruction" || record4.kind === "executable" ? record4.kind : undefined;
|
|
51501
|
+
const tags = Array.isArray(record4.tags) ? record4.tags.filter((tag) => typeof tag === "string" && tag.trim().length > 0) : undefined;
|
|
51176
51502
|
return {
|
|
51177
|
-
...str(
|
|
51178
|
-
...str(
|
|
51179
|
-
...str(
|
|
51503
|
+
...str(record4.displayName) ? { displayName: str(record4.displayName) } : {},
|
|
51504
|
+
...str(record4.description) ? { description: str(record4.description) } : {},
|
|
51505
|
+
...str(record4.category) ? { category: str(record4.category) } : {},
|
|
51180
51506
|
...tags && tags.length ? { tags } : {},
|
|
51181
|
-
...str(
|
|
51507
|
+
...str(record4.version) ? { version: str(record4.version) } : {},
|
|
51182
51508
|
...kind ? { kind } : {},
|
|
51183
|
-
...REVISION_ID_PATTERN.test(str(
|
|
51184
|
-
...typeof
|
|
51185
|
-
...str(
|
|
51509
|
+
...REVISION_ID_PATTERN.test(str(record4.revisionId) ?? "") ? { revisionId: str(record4.revisionId) } : {},
|
|
51510
|
+
...typeof record4.skillMd === "string" && record4.skillMd.length > 0 ? { skillMd: record4.skillMd } : {},
|
|
51511
|
+
...str(record4.publishedSource) ? { publishedSource: str(record4.publishedSource) } : {}
|
|
51186
51512
|
};
|
|
51187
51513
|
}
|
|
51188
51514
|
function pickCorpusOptions(options) {
|
|
@@ -51191,8 +51517,8 @@ function pickCorpusOptions(options) {
|
|
|
51191
51517
|
function extractSlug(entry) {
|
|
51192
51518
|
if (!entry || typeof entry !== "object")
|
|
51193
51519
|
return;
|
|
51194
|
-
const
|
|
51195
|
-
return str(
|
|
51520
|
+
const record4 = entry;
|
|
51521
|
+
return str(record4.slug) ?? str(record4.name);
|
|
51196
51522
|
}
|
|
51197
51523
|
function dedupe(values2) {
|
|
51198
51524
|
return [...new Set(values2)];
|
|
@@ -51233,8 +51559,8 @@ var init_pull = __esm(() => {
|
|
|
51233
51559
|
// src/cli/commands/install.ts
|
|
51234
51560
|
var exports_install = {};
|
|
51235
51561
|
__export(exports_install, {
|
|
51236
|
-
|
|
51237
|
-
|
|
51562
|
+
pinExactVersion: () => pinExactVersion,
|
|
51563
|
+
registerInstall: () => registerInstall
|
|
51238
51564
|
});
|
|
51239
51565
|
function registerInstall(parent) {
|
|
51240
51566
|
parent.command("install").argument("[args...]", "Deprecated. Use 'skills pin <name>' for project skill pins.").option("--json", "Output result as JSON", false).description("Deprecated. Render skills into native agent folders with 'skills render'.").action((args, options) => handleDeprecatedInstall(args, options));
|
|
@@ -51913,14 +52239,14 @@ var init_list = __esm(() => {
|
|
|
51913
52239
|
// src/lib/skillinfo.ts
|
|
51914
52240
|
var exports_skillinfo = {};
|
|
51915
52241
|
__export(exports_skillinfo, {
|
|
51916
|
-
|
|
51917
|
-
getSkillRequirements: () => getSkillRequirements,
|
|
51918
|
-
getSkillDocs: () => getSkillDocs,
|
|
51919
|
-
getSkillDependencyStatus: () => getSkillDependencyStatus,
|
|
51920
|
-
getSkillBestDoc: () => getSkillBestDoc,
|
|
51921
|
-
generateSkillMd: () => generateSkillMd,
|
|
52242
|
+
detectProjectSkills: () => detectProjectSkills,
|
|
51922
52243
|
generateEnvExample: () => generateEnvExample,
|
|
51923
|
-
|
|
52244
|
+
generateSkillMd: () => generateSkillMd,
|
|
52245
|
+
getSkillBestDoc: () => getSkillBestDoc,
|
|
52246
|
+
getSkillDependencyStatus: () => getSkillDependencyStatus,
|
|
52247
|
+
getSkillDocs: () => getSkillDocs,
|
|
52248
|
+
getSkillRequirements: () => getSkillRequirements,
|
|
52249
|
+
runSkill: () => runSkill
|
|
51924
52250
|
});
|
|
51925
52251
|
import { existsSync as existsSync19, readFileSync as readFileSync15 } from "fs";
|
|
51926
52252
|
import { join as join21 } from "path";
|
|
@@ -53515,8 +53841,8 @@ function writeRollbackRecord(mode, entries, appDir = getDataDir()) {
|
|
|
53515
53841
|
const dir = join24(appDir, ROLLBACK_DIRNAME);
|
|
53516
53842
|
mkdirSync9(dir, { recursive: true });
|
|
53517
53843
|
const file = join24(dir, `${mode}-${Date.now()}.json`);
|
|
53518
|
-
const
|
|
53519
|
-
writeFileSync10(file, `${JSON.stringify(
|
|
53844
|
+
const record4 = { version: 1, mode, timestamp: new Date().toISOString(), entries };
|
|
53845
|
+
writeFileSync10(file, `${JSON.stringify(record4, null, 2)}
|
|
53520
53846
|
`);
|
|
53521
53847
|
return file;
|
|
53522
53848
|
}
|
|
@@ -54207,10 +54533,10 @@ var init_diagnostic = __esm(() => {
|
|
|
54207
54533
|
// src/lib/blog-article.ts
|
|
54208
54534
|
var exports_blog_article = {};
|
|
54209
54535
|
__export(exports_blog_article, {
|
|
54210
|
-
|
|
54211
|
-
ARTICLE_MAX_COUNT: () => ARTICLE_MAX_COUNT,
|
|
54536
|
+
ARTICLE_COUNT_ERROR: () => ARTICLE_COUNT_ERROR,
|
|
54212
54537
|
ARTICLE_GENERATION_SLUG: () => ARTICLE_GENERATION_SLUG,
|
|
54213
|
-
|
|
54538
|
+
ARTICLE_MAX_COUNT: () => ARTICLE_MAX_COUNT,
|
|
54539
|
+
validateBlogArticleRunOptions: () => validateBlogArticleRunOptions
|
|
54214
54540
|
});
|
|
54215
54541
|
function validateBlogArticleRunOptions(input, args = [], validation = {}) {
|
|
54216
54542
|
const options = collectRunOptions(input, args);
|
|
@@ -54394,7 +54720,7 @@ function createSkillRun(params, targetDir = process.cwd()) {
|
|
|
54394
54720
|
mkdirSync10(logsDir, { recursive: true });
|
|
54395
54721
|
mkdirSync10(exportDir, { recursive: true });
|
|
54396
54722
|
mkdirSync10(join27(root, "tmp"), { recursive: true });
|
|
54397
|
-
const
|
|
54723
|
+
const record4 = {
|
|
54398
54724
|
id,
|
|
54399
54725
|
skill: skillName,
|
|
54400
54726
|
status: params.status ?? "running",
|
|
@@ -54412,10 +54738,10 @@ function createSkillRun(params, targetDir = process.cwd()) {
|
|
|
54412
54738
|
logsDir: toProjectRelative(targetDir, logsDir)
|
|
54413
54739
|
}
|
|
54414
54740
|
};
|
|
54415
|
-
const context = { targetDir, runDir, exportDir, logsDir, record:
|
|
54741
|
+
const context = { targetDir, runDir, exportDir, logsDir, record: record4 };
|
|
54416
54742
|
writeRunRecord(context);
|
|
54417
54743
|
writeArtifactsManifest(context, []);
|
|
54418
|
-
appendRunEvent(context, "created", { status:
|
|
54744
|
+
appendRunEvent(context, "created", { status: record4.status });
|
|
54419
54745
|
return context;
|
|
54420
54746
|
}
|
|
54421
54747
|
function completeSkillRun(context, patch) {
|
|
@@ -54465,9 +54791,9 @@ function listSkillRuns(targetDir = process.cwd(), limit = 50) {
|
|
|
54465
54791
|
if (!statSync14(dayDir).isDirectory())
|
|
54466
54792
|
continue;
|
|
54467
54793
|
for (const runId of readdirSync13(dayDir).sort().reverse()) {
|
|
54468
|
-
const
|
|
54469
|
-
if (
|
|
54470
|
-
records.push(
|
|
54794
|
+
const record4 = readRunRecord(join27(dayDir, runId));
|
|
54795
|
+
if (record4)
|
|
54796
|
+
records.push(record4);
|
|
54471
54797
|
if (records.length >= limit)
|
|
54472
54798
|
return records;
|
|
54473
54799
|
}
|
|
@@ -54479,9 +54805,9 @@ function findSkillRun(runId, targetDir = process.cwd()) {
|
|
|
54479
54805
|
if (!existsSync25(runsRoot))
|
|
54480
54806
|
return null;
|
|
54481
54807
|
for (const day of readdirSync13(runsRoot)) {
|
|
54482
|
-
const
|
|
54483
|
-
if (
|
|
54484
|
-
return
|
|
54808
|
+
const record4 = readRunRecord(join27(runsRoot, day, runId));
|
|
54809
|
+
if (record4)
|
|
54810
|
+
return record4;
|
|
54485
54811
|
}
|
|
54486
54812
|
return null;
|
|
54487
54813
|
}
|
|
@@ -54650,55 +54976,55 @@ var init_core = __esm(() => {
|
|
|
54650
54976
|
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v4/core/util.js
|
|
54651
54977
|
var exports_util = {};
|
|
54652
54978
|
__export(exports_util, {
|
|
54653
|
-
|
|
54654
|
-
stringifyPrimitive: () => stringifyPrimitive,
|
|
54655
|
-
required: () => required,
|
|
54656
|
-
randomString: () => randomString,
|
|
54657
|
-
propertyKeyTypes: () => propertyKeyTypes,
|
|
54658
|
-
promiseAllObject: () => promiseAllObject,
|
|
54659
|
-
primitiveTypes: () => primitiveTypes,
|
|
54660
|
-
prefixIssues: () => prefixIssues,
|
|
54661
|
-
pick: () => pick2,
|
|
54662
|
-
partial: () => partial2,
|
|
54663
|
-
optionalKeys: () => optionalKeys,
|
|
54664
|
-
omit: () => omit2,
|
|
54665
|
-
numKeys: () => numKeys,
|
|
54666
|
-
nullish: () => nullish,
|
|
54667
|
-
normalizeParams: () => normalizeParams,
|
|
54668
|
-
merge: () => merge2,
|
|
54669
|
-
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
54670
|
-
joinValues: () => joinValues,
|
|
54671
|
-
issue: () => issue,
|
|
54672
|
-
isPlainObject: () => isPlainObject2,
|
|
54673
|
-
isObject: () => isObject2,
|
|
54674
|
-
getSizableOrigin: () => getSizableOrigin,
|
|
54675
|
-
getParsedType: () => getParsedType2,
|
|
54676
|
-
getLengthableOrigin: () => getLengthableOrigin,
|
|
54677
|
-
getEnumValues: () => getEnumValues,
|
|
54678
|
-
getElementAtPath: () => getElementAtPath,
|
|
54679
|
-
floatSafeRemainder: () => floatSafeRemainder2,
|
|
54680
|
-
finalizeIssue: () => finalizeIssue,
|
|
54681
|
-
extend: () => extend,
|
|
54682
|
-
escapeRegex: () => escapeRegex,
|
|
54683
|
-
esc: () => esc,
|
|
54684
|
-
defineLazy: () => defineLazy,
|
|
54685
|
-
createTransparentProxy: () => createTransparentProxy,
|
|
54686
|
-
clone: () => clone3,
|
|
54687
|
-
cleanRegex: () => cleanRegex,
|
|
54688
|
-
cleanEnum: () => cleanEnum,
|
|
54689
|
-
captureStackTrace: () => captureStackTrace,
|
|
54690
|
-
cached: () => cached,
|
|
54691
|
-
assignProp: () => assignProp,
|
|
54692
|
-
assertNotEqual: () => assertNotEqual,
|
|
54693
|
-
assertNever: () => assertNever,
|
|
54694
|
-
assertIs: () => assertIs,
|
|
54695
|
-
assertEqual: () => assertEqual,
|
|
54696
|
-
assert: () => assert,
|
|
54697
|
-
allowsEval: () => allowsEval,
|
|
54698
|
-
aborted: () => aborted,
|
|
54699
|
-
NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
|
|
54979
|
+
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
54700
54980
|
Class: () => Class,
|
|
54701
|
-
|
|
54981
|
+
NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
|
|
54982
|
+
aborted: () => aborted,
|
|
54983
|
+
allowsEval: () => allowsEval,
|
|
54984
|
+
assert: () => assert,
|
|
54985
|
+
assertEqual: () => assertEqual,
|
|
54986
|
+
assertIs: () => assertIs,
|
|
54987
|
+
assertNever: () => assertNever,
|
|
54988
|
+
assertNotEqual: () => assertNotEqual,
|
|
54989
|
+
assignProp: () => assignProp,
|
|
54990
|
+
cached: () => cached,
|
|
54991
|
+
captureStackTrace: () => captureStackTrace,
|
|
54992
|
+
cleanEnum: () => cleanEnum,
|
|
54993
|
+
cleanRegex: () => cleanRegex,
|
|
54994
|
+
clone: () => clone3,
|
|
54995
|
+
createTransparentProxy: () => createTransparentProxy,
|
|
54996
|
+
defineLazy: () => defineLazy,
|
|
54997
|
+
esc: () => esc,
|
|
54998
|
+
escapeRegex: () => escapeRegex,
|
|
54999
|
+
extend: () => extend,
|
|
55000
|
+
finalizeIssue: () => finalizeIssue,
|
|
55001
|
+
floatSafeRemainder: () => floatSafeRemainder2,
|
|
55002
|
+
getElementAtPath: () => getElementAtPath,
|
|
55003
|
+
getEnumValues: () => getEnumValues,
|
|
55004
|
+
getLengthableOrigin: () => getLengthableOrigin,
|
|
55005
|
+
getParsedType: () => getParsedType2,
|
|
55006
|
+
getSizableOrigin: () => getSizableOrigin,
|
|
55007
|
+
isObject: () => isObject2,
|
|
55008
|
+
isPlainObject: () => isPlainObject2,
|
|
55009
|
+
issue: () => issue,
|
|
55010
|
+
joinValues: () => joinValues,
|
|
55011
|
+
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
55012
|
+
merge: () => merge2,
|
|
55013
|
+
normalizeParams: () => normalizeParams,
|
|
55014
|
+
nullish: () => nullish,
|
|
55015
|
+
numKeys: () => numKeys,
|
|
55016
|
+
omit: () => omit2,
|
|
55017
|
+
optionalKeys: () => optionalKeys,
|
|
55018
|
+
partial: () => partial2,
|
|
55019
|
+
pick: () => pick2,
|
|
55020
|
+
prefixIssues: () => prefixIssues,
|
|
55021
|
+
primitiveTypes: () => primitiveTypes,
|
|
55022
|
+
promiseAllObject: () => promiseAllObject,
|
|
55023
|
+
propertyKeyTypes: () => propertyKeyTypes,
|
|
55024
|
+
randomString: () => randomString,
|
|
55025
|
+
required: () => required,
|
|
55026
|
+
stringifyPrimitive: () => stringifyPrimitive,
|
|
55027
|
+
unwrapMessage: () => unwrapMessage
|
|
54702
55028
|
});
|
|
54703
55029
|
function assertEqual(val) {
|
|
54704
55030
|
return val;
|
|
@@ -55317,11 +55643,11 @@ function datetime(args) {
|
|
|
55317
55643
|
const timeRegex2 = `${time2}(?:${opts.join("|")})`;
|
|
55318
55644
|
return new RegExp(`^${dateSource}T(?:${timeRegex2})$`);
|
|
55319
55645
|
}
|
|
55320
|
-
var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, guid,
|
|
55646
|
+
var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, guid, uuid4 = (version) => {
|
|
55321
55647
|
if (!version)
|
|
55322
55648
|
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;
|
|
55323
55649
|
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
55324
|
-
},
|
|
55650
|
+
}, email2, _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`, ipv4, ipv6, cidrv4, cidrv6, base64, base64url, hostname, e164, dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`, date, string2 = (params) => {
|
|
55325
55651
|
const regex2 = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
55326
55652
|
return new RegExp(`^${regex2}$`);
|
|
55327
55653
|
}, integer, number, boolean, _null, lowercase, uppercase;
|
|
@@ -55334,7 +55660,7 @@ var init_regexes = __esm(() => {
|
|
|
55334
55660
|
nanoid = /^[a-zA-Z0-9_-]{21}$/;
|
|
55335
55661
|
duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
55336
55662
|
guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
55337
|
-
|
|
55663
|
+
email2 = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
55338
55664
|
ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
55339
55665
|
ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/;
|
|
55340
55666
|
cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
@@ -56111,13 +56437,13 @@ var init_schemas = __esm(() => {
|
|
|
56111
56437
|
const v = versionMap[def.version];
|
|
56112
56438
|
if (v === undefined)
|
|
56113
56439
|
throw new Error(`Invalid UUID version: "${def.version}"`);
|
|
56114
|
-
def.pattern ?? (def.pattern =
|
|
56440
|
+
def.pattern ?? (def.pattern = uuid4(v));
|
|
56115
56441
|
} else
|
|
56116
|
-
def.pattern ?? (def.pattern =
|
|
56442
|
+
def.pattern ?? (def.pattern = uuid4());
|
|
56117
56443
|
$ZodStringFormat.init(inst, def);
|
|
56118
56444
|
});
|
|
56119
56445
|
$ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
|
|
56120
|
-
def.pattern ?? (def.pattern =
|
|
56446
|
+
def.pattern ?? (def.pattern = email2);
|
|
56121
56447
|
$ZodStringFormat.init(inst, def);
|
|
56122
56448
|
});
|
|
56123
56449
|
$ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
@@ -58437,14 +58763,14 @@ var init_checks2 = __esm(() => {
|
|
|
58437
58763
|
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v4/classic/iso.js
|
|
58438
58764
|
var exports_iso = {};
|
|
58439
58765
|
__export(exports_iso, {
|
|
58440
|
-
|
|
58441
|
-
duration: () => duration2,
|
|
58442
|
-
datetime: () => datetime2,
|
|
58443
|
-
date: () => date2,
|
|
58444
|
-
ZodISOTime: () => ZodISOTime,
|
|
58445
|
-
ZodISODuration: () => ZodISODuration,
|
|
58766
|
+
ZodISODate: () => ZodISODate,
|
|
58446
58767
|
ZodISODateTime: () => ZodISODateTime,
|
|
58447
|
-
|
|
58768
|
+
ZodISODuration: () => ZodISODuration,
|
|
58769
|
+
ZodISOTime: () => ZodISOTime,
|
|
58770
|
+
date: () => date2,
|
|
58771
|
+
datetime: () => datetime2,
|
|
58772
|
+
duration: () => duration2,
|
|
58773
|
+
time: () => time2
|
|
58448
58774
|
});
|
|
58449
58775
|
function datetime2(params) {
|
|
58450
58776
|
return _isoDateTime(ZodISODateTime, params);
|
|
@@ -58593,7 +58919,7 @@ function intersection2(left, right) {
|
|
|
58593
58919
|
right
|
|
58594
58920
|
});
|
|
58595
58921
|
}
|
|
58596
|
-
function
|
|
58922
|
+
function record4(keyType, valueType, params) {
|
|
58597
58923
|
return new ZodRecord2({
|
|
58598
58924
|
type: "record",
|
|
58599
58925
|
keyType,
|
|
@@ -59294,7 +59620,7 @@ var init_types2 = __esm(() => {
|
|
|
59294
59620
|
});
|
|
59295
59621
|
FormElicitationCapabilitySchema = intersection2(object2({
|
|
59296
59622
|
applyDefaults: boolean2().optional()
|
|
59297
|
-
}),
|
|
59623
|
+
}), record4(string3(), unknown()));
|
|
59298
59624
|
ElicitationCapabilitySchema = preprocess((value) => {
|
|
59299
59625
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
59300
59626
|
if (Object.keys(value).length === 0) {
|
|
@@ -59305,7 +59631,7 @@ var init_types2 = __esm(() => {
|
|
|
59305
59631
|
}, intersection2(object2({
|
|
59306
59632
|
form: FormElicitationCapabilitySchema.optional(),
|
|
59307
59633
|
url: AssertObjectSchema.optional()
|
|
59308
|
-
}),
|
|
59634
|
+
}), record4(string3(), unknown()).optional()));
|
|
59309
59635
|
ClientTasksCapabilitySchema = looseObject({
|
|
59310
59636
|
list: AssertObjectSchema.optional(),
|
|
59311
59637
|
cancel: AssertObjectSchema.optional(),
|
|
@@ -59328,7 +59654,7 @@ var init_types2 = __esm(() => {
|
|
|
59328
59654
|
}).optional()
|
|
59329
59655
|
});
|
|
59330
59656
|
ClientCapabilitiesSchema = object2({
|
|
59331
|
-
experimental:
|
|
59657
|
+
experimental: record4(string3(), AssertObjectSchema).optional(),
|
|
59332
59658
|
sampling: object2({
|
|
59333
59659
|
context: AssertObjectSchema.optional(),
|
|
59334
59660
|
tools: AssertObjectSchema.optional()
|
|
@@ -59338,7 +59664,7 @@ var init_types2 = __esm(() => {
|
|
|
59338
59664
|
listChanged: boolean2().optional()
|
|
59339
59665
|
}).optional(),
|
|
59340
59666
|
tasks: ClientTasksCapabilitySchema.optional(),
|
|
59341
|
-
extensions:
|
|
59667
|
+
extensions: record4(string3(), AssertObjectSchema).optional()
|
|
59342
59668
|
});
|
|
59343
59669
|
InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
59344
59670
|
protocolVersion: string3(),
|
|
@@ -59350,7 +59676,7 @@ var init_types2 = __esm(() => {
|
|
|
59350
59676
|
params: InitializeRequestParamsSchema
|
|
59351
59677
|
});
|
|
59352
59678
|
ServerCapabilitiesSchema = object2({
|
|
59353
|
-
experimental:
|
|
59679
|
+
experimental: record4(string3(), AssertObjectSchema).optional(),
|
|
59354
59680
|
logging: AssertObjectSchema.optional(),
|
|
59355
59681
|
completions: AssertObjectSchema.optional(),
|
|
59356
59682
|
prompts: object2({
|
|
@@ -59364,7 +59690,7 @@ var init_types2 = __esm(() => {
|
|
|
59364
59690
|
listChanged: boolean2().optional()
|
|
59365
59691
|
}).optional(),
|
|
59366
59692
|
tasks: ServerTasksCapabilitySchema.optional(),
|
|
59367
|
-
extensions:
|
|
59693
|
+
extensions: record4(string3(), AssertObjectSchema).optional()
|
|
59368
59694
|
});
|
|
59369
59695
|
InitializeResultSchema = ResultSchema.extend({
|
|
59370
59696
|
protocolVersion: string3(),
|
|
@@ -59451,7 +59777,7 @@ var init_types2 = __esm(() => {
|
|
|
59451
59777
|
ResourceContentsSchema = object2({
|
|
59452
59778
|
uri: string3(),
|
|
59453
59779
|
mimeType: optional(string3()),
|
|
59454
|
-
_meta:
|
|
59780
|
+
_meta: record4(string3(), unknown()).optional()
|
|
59455
59781
|
});
|
|
59456
59782
|
TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
59457
59783
|
text: string3()
|
|
@@ -59556,7 +59882,7 @@ var init_types2 = __esm(() => {
|
|
|
59556
59882
|
});
|
|
59557
59883
|
GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
59558
59884
|
name: string3(),
|
|
59559
|
-
arguments:
|
|
59885
|
+
arguments: record4(string3(), string3()).optional()
|
|
59560
59886
|
});
|
|
59561
59887
|
GetPromptRequestSchema = RequestSchema.extend({
|
|
59562
59888
|
method: literal("prompts/get"),
|
|
@@ -59566,34 +59892,34 @@ var init_types2 = __esm(() => {
|
|
|
59566
59892
|
type: literal("text"),
|
|
59567
59893
|
text: string3(),
|
|
59568
59894
|
annotations: AnnotationsSchema.optional(),
|
|
59569
|
-
_meta:
|
|
59895
|
+
_meta: record4(string3(), unknown()).optional()
|
|
59570
59896
|
});
|
|
59571
59897
|
ImageContentSchema = object2({
|
|
59572
59898
|
type: literal("image"),
|
|
59573
59899
|
data: Base64Schema,
|
|
59574
59900
|
mimeType: string3(),
|
|
59575
59901
|
annotations: AnnotationsSchema.optional(),
|
|
59576
|
-
_meta:
|
|
59902
|
+
_meta: record4(string3(), unknown()).optional()
|
|
59577
59903
|
});
|
|
59578
59904
|
AudioContentSchema = object2({
|
|
59579
59905
|
type: literal("audio"),
|
|
59580
59906
|
data: Base64Schema,
|
|
59581
59907
|
mimeType: string3(),
|
|
59582
59908
|
annotations: AnnotationsSchema.optional(),
|
|
59583
|
-
_meta:
|
|
59909
|
+
_meta: record4(string3(), unknown()).optional()
|
|
59584
59910
|
});
|
|
59585
59911
|
ToolUseContentSchema = object2({
|
|
59586
59912
|
type: literal("tool_use"),
|
|
59587
59913
|
name: string3(),
|
|
59588
59914
|
id: string3(),
|
|
59589
|
-
input:
|
|
59590
|
-
_meta:
|
|
59915
|
+
input: record4(string3(), unknown()),
|
|
59916
|
+
_meta: record4(string3(), unknown()).optional()
|
|
59591
59917
|
});
|
|
59592
59918
|
EmbeddedResourceSchema = object2({
|
|
59593
59919
|
type: literal("resource"),
|
|
59594
59920
|
resource: union2([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
59595
59921
|
annotations: AnnotationsSchema.optional(),
|
|
59596
|
-
_meta:
|
|
59922
|
+
_meta: record4(string3(), unknown()).optional()
|
|
59597
59923
|
});
|
|
59598
59924
|
ResourceLinkSchema = ResourceSchema.extend({
|
|
59599
59925
|
type: literal("resource_link")
|
|
@@ -59633,17 +59959,17 @@ var init_types2 = __esm(() => {
|
|
|
59633
59959
|
description: string3().optional(),
|
|
59634
59960
|
inputSchema: object2({
|
|
59635
59961
|
type: literal("object"),
|
|
59636
|
-
properties:
|
|
59962
|
+
properties: record4(string3(), AssertObjectSchema).optional(),
|
|
59637
59963
|
required: array(string3()).optional()
|
|
59638
59964
|
}).catchall(unknown()),
|
|
59639
59965
|
outputSchema: object2({
|
|
59640
59966
|
type: literal("object"),
|
|
59641
|
-
properties:
|
|
59967
|
+
properties: record4(string3(), AssertObjectSchema).optional(),
|
|
59642
59968
|
required: array(string3()).optional()
|
|
59643
59969
|
}).catchall(unknown()).optional(),
|
|
59644
59970
|
annotations: ToolAnnotationsSchema.optional(),
|
|
59645
59971
|
execution: ToolExecutionSchema.optional(),
|
|
59646
|
-
_meta:
|
|
59972
|
+
_meta: record4(string3(), unknown()).optional()
|
|
59647
59973
|
});
|
|
59648
59974
|
ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
59649
59975
|
method: literal("tools/list")
|
|
@@ -59653,7 +59979,7 @@ var init_types2 = __esm(() => {
|
|
|
59653
59979
|
});
|
|
59654
59980
|
CallToolResultSchema = ResultSchema.extend({
|
|
59655
59981
|
content: array(ContentBlockSchema).default([]),
|
|
59656
|
-
structuredContent:
|
|
59982
|
+
structuredContent: record4(string3(), unknown()).optional(),
|
|
59657
59983
|
isError: boolean2().optional()
|
|
59658
59984
|
});
|
|
59659
59985
|
CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
|
|
@@ -59661,7 +59987,7 @@ var init_types2 = __esm(() => {
|
|
|
59661
59987
|
}));
|
|
59662
59988
|
CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
59663
59989
|
name: string3(),
|
|
59664
|
-
arguments:
|
|
59990
|
+
arguments: record4(string3(), unknown()).optional()
|
|
59665
59991
|
});
|
|
59666
59992
|
CallToolRequestSchema = RequestSchema.extend({
|
|
59667
59993
|
method: literal("tools/call"),
|
|
@@ -59710,7 +60036,7 @@ var init_types2 = __esm(() => {
|
|
|
59710
60036
|
content: array(ContentBlockSchema).default([]),
|
|
59711
60037
|
structuredContent: object2({}).loose().optional(),
|
|
59712
60038
|
isError: boolean2().optional(),
|
|
59713
|
-
_meta:
|
|
60039
|
+
_meta: record4(string3(), unknown()).optional()
|
|
59714
60040
|
});
|
|
59715
60041
|
SamplingContentSchema = discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
|
|
59716
60042
|
SamplingMessageContentBlockSchema = discriminatedUnion("type", [
|
|
@@ -59723,7 +60049,7 @@ var init_types2 = __esm(() => {
|
|
|
59723
60049
|
SamplingMessageSchema = object2({
|
|
59724
60050
|
role: RoleSchema,
|
|
59725
60051
|
content: union2([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)]),
|
|
59726
|
-
_meta:
|
|
60052
|
+
_meta: record4(string3(), unknown()).optional()
|
|
59727
60053
|
});
|
|
59728
60054
|
CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
59729
60055
|
messages: array(SamplingMessageSchema),
|
|
@@ -59836,7 +60162,7 @@ var init_types2 = __esm(() => {
|
|
|
59836
60162
|
message: string3(),
|
|
59837
60163
|
requestedSchema: object2({
|
|
59838
60164
|
type: literal("object"),
|
|
59839
|
-
properties:
|
|
60165
|
+
properties: record4(string3(), PrimitiveSchemaDefinitionSchema),
|
|
59840
60166
|
required: array(string3()).optional()
|
|
59841
60167
|
})
|
|
59842
60168
|
});
|
|
@@ -59860,7 +60186,7 @@ var init_types2 = __esm(() => {
|
|
|
59860
60186
|
});
|
|
59861
60187
|
ElicitResultSchema = ResultSchema.extend({
|
|
59862
60188
|
action: _enum(["accept", "decline", "cancel"]),
|
|
59863
|
-
content: preprocess((val) => val === null ? undefined : val,
|
|
60189
|
+
content: preprocess((val) => val === null ? undefined : val, record4(string3(), union2([string3(), number2(), boolean2(), array(string3())])).optional())
|
|
59864
60190
|
});
|
|
59865
60191
|
ResourceTemplateReferenceSchema = object2({
|
|
59866
60192
|
type: literal("ref/resource"),
|
|
@@ -59877,7 +60203,7 @@ var init_types2 = __esm(() => {
|
|
|
59877
60203
|
value: string3()
|
|
59878
60204
|
}),
|
|
59879
60205
|
context: object2({
|
|
59880
|
-
arguments:
|
|
60206
|
+
arguments: record4(string3(), string3()).optional()
|
|
59881
60207
|
}).optional()
|
|
59882
60208
|
});
|
|
59883
60209
|
CompleteRequestSchema = RequestSchema.extend({
|
|
@@ -59894,7 +60220,7 @@ var init_types2 = __esm(() => {
|
|
|
59894
60220
|
RootSchema = object2({
|
|
59895
60221
|
uri: string3().startsWith("file://"),
|
|
59896
60222
|
name: string3().optional(),
|
|
59897
|
-
_meta:
|
|
60223
|
+
_meta: record4(string3(), unknown()).optional()
|
|
59898
60224
|
});
|
|
59899
60225
|
ListRootsRequestSchema = RequestSchema.extend({
|
|
59900
60226
|
method: literal("roots/list"),
|
|
@@ -62666,7 +62992,7 @@ var init_protocol = __esm(() => {
|
|
|
62666
62992
|
});
|
|
62667
62993
|
|
|
62668
62994
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js
|
|
62669
|
-
var require_code = __commonJS((exports)
|
|
62995
|
+
var require_code = __commonJS(function(exports) {
|
|
62670
62996
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62671
62997
|
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = undefined;
|
|
62672
62998
|
|
|
@@ -62820,7 +63146,7 @@ var require_code = __commonJS((exports) => {
|
|
|
62820
63146
|
});
|
|
62821
63147
|
|
|
62822
63148
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js
|
|
62823
|
-
var require_scope = __commonJS((exports)
|
|
63149
|
+
var require_scope = __commonJS(function(exports) {
|
|
62824
63150
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62825
63151
|
exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = undefined;
|
|
62826
63152
|
var code_1 = require_code();
|
|
@@ -62966,7 +63292,7 @@ var require_scope = __commonJS((exports) => {
|
|
|
62966
63292
|
});
|
|
62967
63293
|
|
|
62968
63294
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js
|
|
62969
|
-
var require_codegen = __commonJS((exports)
|
|
63295
|
+
var require_codegen = __commonJS(function(exports) {
|
|
62970
63296
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62971
63297
|
exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = undefined;
|
|
62972
63298
|
var code_1 = require_code();
|
|
@@ -63676,7 +64002,7 @@ var require_codegen = __commonJS((exports) => {
|
|
|
63676
64002
|
});
|
|
63677
64003
|
|
|
63678
64004
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/util.js
|
|
63679
|
-
var require_util = __commonJS((exports)
|
|
64005
|
+
var require_util = __commonJS(function(exports) {
|
|
63680
64006
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63681
64007
|
exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = undefined;
|
|
63682
64008
|
var codegen_1 = require_codegen();
|
|
@@ -63840,7 +64166,7 @@ var require_util = __commonJS((exports) => {
|
|
|
63840
64166
|
});
|
|
63841
64167
|
|
|
63842
64168
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/names.js
|
|
63843
|
-
var require_names = __commonJS((exports)
|
|
64169
|
+
var require_names = __commonJS(function(exports) {
|
|
63844
64170
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63845
64171
|
var codegen_1 = require_codegen();
|
|
63846
64172
|
var names = {
|
|
@@ -63865,7 +64191,7 @@ var require_names = __commonJS((exports) => {
|
|
|
63865
64191
|
});
|
|
63866
64192
|
|
|
63867
64193
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js
|
|
63868
|
-
var require_errors = __commonJS((exports)
|
|
64194
|
+
var require_errors = __commonJS(function(exports) {
|
|
63869
64195
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63870
64196
|
exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = undefined;
|
|
63871
64197
|
var codegen_1 = require_codegen();
|
|
@@ -63983,7 +64309,7 @@ var require_errors = __commonJS((exports) => {
|
|
|
63983
64309
|
});
|
|
63984
64310
|
|
|
63985
64311
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js
|
|
63986
|
-
var require_boolSchema = __commonJS((exports)
|
|
64312
|
+
var require_boolSchema = __commonJS(function(exports) {
|
|
63987
64313
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63988
64314
|
exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = undefined;
|
|
63989
64315
|
var errors_1 = require_errors();
|
|
@@ -64031,7 +64357,7 @@ var require_boolSchema = __commonJS((exports) => {
|
|
|
64031
64357
|
});
|
|
64032
64358
|
|
|
64033
64359
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js
|
|
64034
|
-
var require_rules = __commonJS((exports)
|
|
64360
|
+
var require_rules = __commonJS(function(exports) {
|
|
64035
64361
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64036
64362
|
exports.getRules = exports.isJSONType = undefined;
|
|
64037
64363
|
var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
|
|
@@ -64059,7 +64385,7 @@ var require_rules = __commonJS((exports) => {
|
|
|
64059
64385
|
});
|
|
64060
64386
|
|
|
64061
64387
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js
|
|
64062
|
-
var require_applicability = __commonJS((exports)
|
|
64388
|
+
var require_applicability = __commonJS(function(exports) {
|
|
64063
64389
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64064
64390
|
exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = undefined;
|
|
64065
64391
|
function schemaHasRulesForType({ schema, self: self2 }, type) {
|
|
@@ -64079,7 +64405,7 @@ var require_applicability = __commonJS((exports) => {
|
|
|
64079
64405
|
});
|
|
64080
64406
|
|
|
64081
64407
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js
|
|
64082
|
-
var require_dataType = __commonJS((exports)
|
|
64408
|
+
var require_dataType = __commonJS(function(exports) {
|
|
64083
64409
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64084
64410
|
exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = undefined;
|
|
64085
64411
|
var rules_1 = require_rules();
|
|
@@ -64260,7 +64586,7 @@ var require_dataType = __commonJS((exports) => {
|
|
|
64260
64586
|
});
|
|
64261
64587
|
|
|
64262
64588
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js
|
|
64263
|
-
var require_defaults = __commonJS((exports)
|
|
64589
|
+
var require_defaults = __commonJS(function(exports) {
|
|
64264
64590
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64265
64591
|
exports.assignDefaults = undefined;
|
|
64266
64592
|
var codegen_1 = require_codegen();
|
|
@@ -64294,7 +64620,7 @@ var require_defaults = __commonJS((exports) => {
|
|
|
64294
64620
|
});
|
|
64295
64621
|
|
|
64296
64622
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js
|
|
64297
|
-
var require_code2 = __commonJS((exports)
|
|
64623
|
+
var require_code2 = __commonJS(function(exports) {
|
|
64298
64624
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64299
64625
|
exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = undefined;
|
|
64300
64626
|
var codegen_1 = require_codegen();
|
|
@@ -64423,7 +64749,7 @@ var require_code2 = __commonJS((exports) => {
|
|
|
64423
64749
|
});
|
|
64424
64750
|
|
|
64425
64751
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js
|
|
64426
|
-
var require_keyword = __commonJS((exports)
|
|
64752
|
+
var require_keyword = __commonJS(function(exports) {
|
|
64427
64753
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64428
64754
|
exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = undefined;
|
|
64429
64755
|
var codegen_1 = require_codegen();
|
|
@@ -64538,7 +64864,7 @@ var require_keyword = __commonJS((exports) => {
|
|
|
64538
64864
|
});
|
|
64539
64865
|
|
|
64540
64866
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js
|
|
64541
|
-
var require_subschema = __commonJS((exports)
|
|
64867
|
+
var require_subschema = __commonJS(function(exports) {
|
|
64542
64868
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64543
64869
|
exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = undefined;
|
|
64544
64870
|
var codegen_1 = require_codegen();
|
|
@@ -64618,7 +64944,7 @@ var require_subschema = __commonJS((exports) => {
|
|
|
64618
64944
|
});
|
|
64619
64945
|
|
|
64620
64946
|
// ../../node_modules/.bun/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
64621
|
-
var require_fast_deep_equal = __commonJS((exports, module)
|
|
64947
|
+
var require_fast_deep_equal = __commonJS(function(exports, module) {
|
|
64622
64948
|
module.exports = function equal(a, b) {
|
|
64623
64949
|
if (a === b)
|
|
64624
64950
|
return true;
|
|
@@ -64660,7 +64986,7 @@ var require_fast_deep_equal = __commonJS((exports, module) => {
|
|
|
64660
64986
|
});
|
|
64661
64987
|
|
|
64662
64988
|
// ../../node_modules/.bun/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js
|
|
64663
|
-
var require_json_schema_traverse = __commonJS((exports, module)
|
|
64989
|
+
var require_json_schema_traverse = __commonJS(function(exports, module) {
|
|
64664
64990
|
var traverse = module.exports = function(schema, opts, cb) {
|
|
64665
64991
|
if (typeof opts == "function") {
|
|
64666
64992
|
cb = opts;
|
|
@@ -64743,7 +65069,7 @@ var require_json_schema_traverse = __commonJS((exports, module) => {
|
|
|
64743
65069
|
});
|
|
64744
65070
|
|
|
64745
65071
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js
|
|
64746
|
-
var require_resolve = __commonJS((exports)
|
|
65072
|
+
var require_resolve = __commonJS(function(exports) {
|
|
64747
65073
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64748
65074
|
exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = undefined;
|
|
64749
65075
|
var util_1 = require_util();
|
|
@@ -64896,7 +65222,7 @@ var require_resolve = __commonJS((exports) => {
|
|
|
64896
65222
|
});
|
|
64897
65223
|
|
|
64898
65224
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js
|
|
64899
|
-
var require_validate = __commonJS((exports)
|
|
65225
|
+
var require_validate = __commonJS(function(exports) {
|
|
64900
65226
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64901
65227
|
exports.getData = exports.KeywordCxt = exports.validateFunctionCode = undefined;
|
|
64902
65228
|
var boolSchema_1 = require_boolSchema();
|
|
@@ -65401,7 +65727,7 @@ var require_validate = __commonJS((exports) => {
|
|
|
65401
65727
|
});
|
|
65402
65728
|
|
|
65403
65729
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js
|
|
65404
|
-
var require_validation_error = __commonJS((exports)
|
|
65730
|
+
var require_validation_error = __commonJS(function(exports) {
|
|
65405
65731
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65406
65732
|
|
|
65407
65733
|
class ValidationError extends Error {
|
|
@@ -65415,7 +65741,7 @@ var require_validation_error = __commonJS((exports) => {
|
|
|
65415
65741
|
});
|
|
65416
65742
|
|
|
65417
65743
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js
|
|
65418
|
-
var require_ref_error = __commonJS((exports)
|
|
65744
|
+
var require_ref_error = __commonJS(function(exports) {
|
|
65419
65745
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65420
65746
|
var resolve_1 = require_resolve();
|
|
65421
65747
|
|
|
@@ -65430,7 +65756,7 @@ var require_ref_error = __commonJS((exports) => {
|
|
|
65430
65756
|
});
|
|
65431
65757
|
|
|
65432
65758
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/index.js
|
|
65433
|
-
var require_compile = __commonJS((exports)
|
|
65759
|
+
var require_compile = __commonJS(function(exports) {
|
|
65434
65760
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65435
65761
|
exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = undefined;
|
|
65436
65762
|
var codegen_1 = require_codegen();
|
|
@@ -65651,7 +65977,7 @@ var require_compile = __commonJS((exports) => {
|
|
|
65651
65977
|
});
|
|
65652
65978
|
|
|
65653
65979
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/refs/data.json
|
|
65654
|
-
var require_data = __commonJS((exports, module)
|
|
65980
|
+
var require_data = __commonJS(function(exports, module) {
|
|
65655
65981
|
module.exports = {
|
|
65656
65982
|
$id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
|
|
65657
65983
|
description: "Meta-schema for $data reference (JSON AnySchema extension proposal)",
|
|
@@ -65668,7 +65994,7 @@ var require_data = __commonJS((exports, module) => {
|
|
|
65668
65994
|
});
|
|
65669
65995
|
|
|
65670
65996
|
// ../../node_modules/.bun/fast-uri@3.1.7/node_modules/fast-uri/lib/utils.js
|
|
65671
|
-
var require_utils = __commonJS((exports, module)
|
|
65997
|
+
var require_utils = __commonJS(function(exports, module) {
|
|
65672
65998
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
65673
65999
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
65674
66000
|
var isPort = RegExp.prototype.test.bind(/^\d*$/u);
|
|
@@ -66185,7 +66511,7 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
66185
66511
|
});
|
|
66186
66512
|
|
|
66187
66513
|
// ../../node_modules/.bun/fast-uri@3.1.7/node_modules/fast-uri/lib/schemes.js
|
|
66188
|
-
var require_schemes = __commonJS((exports, module)
|
|
66514
|
+
var require_schemes = __commonJS(function(exports, module) {
|
|
66189
66515
|
var { isUUID } = require_utils();
|
|
66190
66516
|
var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
|
|
66191
66517
|
var supportedSchemeNames = [
|
|
@@ -66360,7 +66686,7 @@ var require_schemes = __commonJS((exports, module) => {
|
|
|
66360
66686
|
});
|
|
66361
66687
|
|
|
66362
66688
|
// ../../node_modules/.bun/fast-uri@3.1.7/node_modules/fast-uri/index.js
|
|
66363
|
-
var require_fast_uri = __commonJS((exports, module)
|
|
66689
|
+
var require_fast_uri = __commonJS(function(exports, module) {
|
|
66364
66690
|
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
66365
66691
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
66366
66692
|
var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
|
|
@@ -66762,7 +67088,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
66762
67088
|
});
|
|
66763
67089
|
|
|
66764
67090
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js
|
|
66765
|
-
var require_uri = __commonJS((exports)
|
|
67091
|
+
var require_uri = __commonJS(function(exports) {
|
|
66766
67092
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66767
67093
|
var uri = require_fast_uri();
|
|
66768
67094
|
uri.code = 'require("ajv/dist/runtime/uri").default';
|
|
@@ -66770,7 +67096,7 @@ var require_uri = __commonJS((exports) => {
|
|
|
66770
67096
|
});
|
|
66771
67097
|
|
|
66772
67098
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/core.js
|
|
66773
|
-
var require_core = __commonJS((exports)
|
|
67099
|
+
var require_core = __commonJS(function(exports) {
|
|
66774
67100
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66775
67101
|
exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = undefined;
|
|
66776
67102
|
var validate_1 = require_validate();
|
|
@@ -67363,7 +67689,7 @@ var require_core = __commonJS((exports) => {
|
|
|
67363
67689
|
});
|
|
67364
67690
|
|
|
67365
67691
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js
|
|
67366
|
-
var require_id = __commonJS((exports)
|
|
67692
|
+
var require_id = __commonJS(function(exports) {
|
|
67367
67693
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67368
67694
|
var def = {
|
|
67369
67695
|
keyword: "id",
|
|
@@ -67375,7 +67701,7 @@ var require_id = __commonJS((exports) => {
|
|
|
67375
67701
|
});
|
|
67376
67702
|
|
|
67377
67703
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js
|
|
67378
|
-
var require_ref = __commonJS((exports)
|
|
67704
|
+
var require_ref = __commonJS(function(exports) {
|
|
67379
67705
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67380
67706
|
exports.callRef = exports.getValidate = undefined;
|
|
67381
67707
|
var ref_error_1 = require_ref_error();
|
|
@@ -67494,7 +67820,7 @@ var require_ref = __commonJS((exports) => {
|
|
|
67494
67820
|
});
|
|
67495
67821
|
|
|
67496
67822
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js
|
|
67497
|
-
var require_core2 = __commonJS((exports)
|
|
67823
|
+
var require_core2 = __commonJS(function(exports) {
|
|
67498
67824
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67499
67825
|
var id_1 = require_id();
|
|
67500
67826
|
var ref_1 = require_ref();
|
|
@@ -67512,7 +67838,7 @@ var require_core2 = __commonJS((exports) => {
|
|
|
67512
67838
|
});
|
|
67513
67839
|
|
|
67514
67840
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
|
|
67515
|
-
var require_limitNumber = __commonJS((exports)
|
|
67841
|
+
var require_limitNumber = __commonJS(function(exports) {
|
|
67516
67842
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67517
67843
|
var codegen_1 = require_codegen();
|
|
67518
67844
|
var ops = codegen_1.operators;
|
|
@@ -67541,7 +67867,7 @@ var require_limitNumber = __commonJS((exports) => {
|
|
|
67541
67867
|
});
|
|
67542
67868
|
|
|
67543
67869
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js
|
|
67544
|
-
var require_multipleOf = __commonJS((exports)
|
|
67870
|
+
var require_multipleOf = __commonJS(function(exports) {
|
|
67545
67871
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67546
67872
|
var codegen_1 = require_codegen();
|
|
67547
67873
|
var error2 = {
|
|
@@ -67558,15 +67884,15 @@ var require_multipleOf = __commonJS((exports) => {
|
|
|
67558
67884
|
const { gen, data, schemaCode, it } = cxt;
|
|
67559
67885
|
const prec = it.opts.multipleOfPrecision;
|
|
67560
67886
|
const res = gen.let("res");
|
|
67561
|
-
const
|
|
67562
|
-
cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${
|
|
67887
|
+
const invalid3 = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`;
|
|
67888
|
+
cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid3}))`);
|
|
67563
67889
|
}
|
|
67564
67890
|
};
|
|
67565
67891
|
exports.default = def;
|
|
67566
67892
|
});
|
|
67567
67893
|
|
|
67568
67894
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js
|
|
67569
|
-
var require_ucs2length = __commonJS((exports)
|
|
67895
|
+
var require_ucs2length = __commonJS(function(exports) {
|
|
67570
67896
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67571
67897
|
function ucs2length(str2) {
|
|
67572
67898
|
const len = str2.length;
|
|
@@ -67589,7 +67915,7 @@ var require_ucs2length = __commonJS((exports) => {
|
|
|
67589
67915
|
});
|
|
67590
67916
|
|
|
67591
67917
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js
|
|
67592
|
-
var require_limitLength = __commonJS((exports)
|
|
67918
|
+
var require_limitLength = __commonJS(function(exports) {
|
|
67593
67919
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67594
67920
|
var codegen_1 = require_codegen();
|
|
67595
67921
|
var util_1 = require_util();
|
|
@@ -67618,7 +67944,7 @@ var require_limitLength = __commonJS((exports) => {
|
|
|
67618
67944
|
});
|
|
67619
67945
|
|
|
67620
67946
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js
|
|
67621
|
-
var require_pattern = __commonJS((exports)
|
|
67947
|
+
var require_pattern = __commonJS(function(exports) {
|
|
67622
67948
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67623
67949
|
var code_1 = require_code2();
|
|
67624
67950
|
var util_1 = require_util();
|
|
@@ -67652,7 +67978,7 @@ var require_pattern = __commonJS((exports) => {
|
|
|
67652
67978
|
});
|
|
67653
67979
|
|
|
67654
67980
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js
|
|
67655
|
-
var require_limitProperties = __commonJS((exports)
|
|
67981
|
+
var require_limitProperties = __commonJS(function(exports) {
|
|
67656
67982
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67657
67983
|
var codegen_1 = require_codegen();
|
|
67658
67984
|
var error2 = {
|
|
@@ -67678,7 +68004,7 @@ var require_limitProperties = __commonJS((exports) => {
|
|
|
67678
68004
|
});
|
|
67679
68005
|
|
|
67680
68006
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js
|
|
67681
|
-
var require_required = __commonJS((exports)
|
|
68007
|
+
var require_required = __commonJS(function(exports) {
|
|
67682
68008
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67683
68009
|
var code_1 = require_code2();
|
|
67684
68010
|
var codegen_1 = require_codegen();
|
|
@@ -67757,7 +68083,7 @@ var require_required = __commonJS((exports) => {
|
|
|
67757
68083
|
});
|
|
67758
68084
|
|
|
67759
68085
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js
|
|
67760
|
-
var require_limitItems = __commonJS((exports)
|
|
68086
|
+
var require_limitItems = __commonJS(function(exports) {
|
|
67761
68087
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67762
68088
|
var codegen_1 = require_codegen();
|
|
67763
68089
|
var error2 = {
|
|
@@ -67783,7 +68109,7 @@ var require_limitItems = __commonJS((exports) => {
|
|
|
67783
68109
|
});
|
|
67784
68110
|
|
|
67785
68111
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js
|
|
67786
|
-
var require_equal = __commonJS((exports)
|
|
68112
|
+
var require_equal = __commonJS(function(exports) {
|
|
67787
68113
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67788
68114
|
var equal = require_fast_deep_equal();
|
|
67789
68115
|
equal.code = 'require("ajv/dist/runtime/equal").default';
|
|
@@ -67791,7 +68117,7 @@ var require_equal = __commonJS((exports) => {
|
|
|
67791
68117
|
});
|
|
67792
68118
|
|
|
67793
68119
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js
|
|
67794
|
-
var require_uniqueItems = __commonJS((exports)
|
|
68120
|
+
var require_uniqueItems = __commonJS(function(exports) {
|
|
67795
68121
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67796
68122
|
var dataType_1 = require_dataType();
|
|
67797
68123
|
var codegen_1 = require_codegen();
|
|
@@ -67855,7 +68181,7 @@ var require_uniqueItems = __commonJS((exports) => {
|
|
|
67855
68181
|
});
|
|
67856
68182
|
|
|
67857
68183
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js
|
|
67858
|
-
var require_const = __commonJS((exports)
|
|
68184
|
+
var require_const = __commonJS(function(exports) {
|
|
67859
68185
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67860
68186
|
var codegen_1 = require_codegen();
|
|
67861
68187
|
var util_1 = require_util();
|
|
@@ -67881,7 +68207,7 @@ var require_const = __commonJS((exports) => {
|
|
|
67881
68207
|
});
|
|
67882
68208
|
|
|
67883
68209
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js
|
|
67884
|
-
var require_enum = __commonJS((exports)
|
|
68210
|
+
var require_enum = __commonJS(function(exports) {
|
|
67885
68211
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67886
68212
|
var codegen_1 = require_codegen();
|
|
67887
68213
|
var util_1 = require_util();
|
|
@@ -67927,7 +68253,7 @@ var require_enum = __commonJS((exports) => {
|
|
|
67927
68253
|
});
|
|
67928
68254
|
|
|
67929
68255
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js
|
|
67930
|
-
var require_validation = __commonJS((exports)
|
|
68256
|
+
var require_validation = __commonJS(function(exports) {
|
|
67931
68257
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67932
68258
|
var limitNumber_1 = require_limitNumber();
|
|
67933
68259
|
var multipleOf_1 = require_multipleOf();
|
|
@@ -67957,7 +68283,7 @@ var require_validation = __commonJS((exports) => {
|
|
|
67957
68283
|
});
|
|
67958
68284
|
|
|
67959
68285
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js
|
|
67960
|
-
var require_additionalItems = __commonJS((exports)
|
|
68286
|
+
var require_additionalItems = __commonJS(function(exports) {
|
|
67961
68287
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67962
68288
|
exports.validateAdditionalItems = undefined;
|
|
67963
68289
|
var codegen_1 = require_codegen();
|
|
@@ -68007,7 +68333,7 @@ var require_additionalItems = __commonJS((exports) => {
|
|
|
68007
68333
|
});
|
|
68008
68334
|
|
|
68009
68335
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js
|
|
68010
|
-
var require_items = __commonJS((exports)
|
|
68336
|
+
var require_items = __commonJS(function(exports) {
|
|
68011
68337
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68012
68338
|
exports.validateTuple = undefined;
|
|
68013
68339
|
var codegen_1 = require_codegen();
|
|
@@ -68061,7 +68387,7 @@ var require_items = __commonJS((exports) => {
|
|
|
68061
68387
|
});
|
|
68062
68388
|
|
|
68063
68389
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js
|
|
68064
|
-
var require_prefixItems = __commonJS((exports)
|
|
68390
|
+
var require_prefixItems = __commonJS(function(exports) {
|
|
68065
68391
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68066
68392
|
var items_1 = require_items();
|
|
68067
68393
|
var def = {
|
|
@@ -68075,7 +68401,7 @@ var require_prefixItems = __commonJS((exports) => {
|
|
|
68075
68401
|
});
|
|
68076
68402
|
|
|
68077
68403
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js
|
|
68078
|
-
var require_items2020 = __commonJS((exports)
|
|
68404
|
+
var require_items2020 = __commonJS(function(exports) {
|
|
68079
68405
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68080
68406
|
var codegen_1 = require_codegen();
|
|
68081
68407
|
var util_1 = require_util();
|
|
@@ -68107,7 +68433,7 @@ var require_items2020 = __commonJS((exports) => {
|
|
|
68107
68433
|
});
|
|
68108
68434
|
|
|
68109
68435
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js
|
|
68110
|
-
var require_contains = __commonJS((exports)
|
|
68436
|
+
var require_contains = __commonJS(function(exports) {
|
|
68111
68437
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68112
68438
|
var codegen_1 = require_codegen();
|
|
68113
68439
|
var util_1 = require_util();
|
|
@@ -68198,7 +68524,7 @@ var require_contains = __commonJS((exports) => {
|
|
|
68198
68524
|
});
|
|
68199
68525
|
|
|
68200
68526
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js
|
|
68201
|
-
var require_dependencies = __commonJS((exports)
|
|
68527
|
+
var require_dependencies = __commonJS(function(exports) {
|
|
68202
68528
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68203
68529
|
exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = undefined;
|
|
68204
68530
|
var codegen_1 = require_codegen();
|
|
@@ -68283,7 +68609,7 @@ var require_dependencies = __commonJS((exports) => {
|
|
|
68283
68609
|
});
|
|
68284
68610
|
|
|
68285
68611
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js
|
|
68286
|
-
var require_propertyNames = __commonJS((exports)
|
|
68612
|
+
var require_propertyNames = __commonJS(function(exports) {
|
|
68287
68613
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68288
68614
|
var codegen_1 = require_codegen();
|
|
68289
68615
|
var util_1 = require_util();
|
|
@@ -68323,7 +68649,7 @@ var require_propertyNames = __commonJS((exports) => {
|
|
|
68323
68649
|
});
|
|
68324
68650
|
|
|
68325
68651
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js
|
|
68326
|
-
var require_additionalProperties = __commonJS((exports)
|
|
68652
|
+
var require_additionalProperties = __commonJS(function(exports) {
|
|
68327
68653
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68328
68654
|
var code_1 = require_code2();
|
|
68329
68655
|
var codegen_1 = require_codegen();
|
|
@@ -68426,7 +68752,7 @@ var require_additionalProperties = __commonJS((exports) => {
|
|
|
68426
68752
|
});
|
|
68427
68753
|
|
|
68428
68754
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js
|
|
68429
|
-
var require_properties = __commonJS((exports)
|
|
68755
|
+
var require_properties = __commonJS(function(exports) {
|
|
68430
68756
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68431
68757
|
var validate_1 = require_validate();
|
|
68432
68758
|
var code_1 = require_code2();
|
|
@@ -68481,7 +68807,7 @@ var require_properties = __commonJS((exports) => {
|
|
|
68481
68807
|
});
|
|
68482
68808
|
|
|
68483
68809
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js
|
|
68484
|
-
var require_patternProperties = __commonJS((exports)
|
|
68810
|
+
var require_patternProperties = __commonJS(function(exports) {
|
|
68485
68811
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68486
68812
|
var code_1 = require_code2();
|
|
68487
68813
|
var codegen_1 = require_codegen();
|
|
@@ -68552,7 +68878,7 @@ var require_patternProperties = __commonJS((exports) => {
|
|
|
68552
68878
|
});
|
|
68553
68879
|
|
|
68554
68880
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js
|
|
68555
|
-
var require_not = __commonJS((exports)
|
|
68881
|
+
var require_not = __commonJS(function(exports) {
|
|
68556
68882
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68557
68883
|
var util_1 = require_util();
|
|
68558
68884
|
var def = {
|
|
@@ -68580,7 +68906,7 @@ var require_not = __commonJS((exports) => {
|
|
|
68580
68906
|
});
|
|
68581
68907
|
|
|
68582
68908
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js
|
|
68583
|
-
var require_anyOf = __commonJS((exports)
|
|
68909
|
+
var require_anyOf = __commonJS(function(exports) {
|
|
68584
68910
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68585
68911
|
var code_1 = require_code2();
|
|
68586
68912
|
var def = {
|
|
@@ -68594,7 +68920,7 @@ var require_anyOf = __commonJS((exports) => {
|
|
|
68594
68920
|
});
|
|
68595
68921
|
|
|
68596
68922
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js
|
|
68597
|
-
var require_oneOf = __commonJS((exports)
|
|
68923
|
+
var require_oneOf = __commonJS(function(exports) {
|
|
68598
68924
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68599
68925
|
var codegen_1 = require_codegen();
|
|
68600
68926
|
var util_1 = require_util();
|
|
@@ -68649,7 +68975,7 @@ var require_oneOf = __commonJS((exports) => {
|
|
|
68649
68975
|
});
|
|
68650
68976
|
|
|
68651
68977
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js
|
|
68652
|
-
var require_allOf = __commonJS((exports)
|
|
68978
|
+
var require_allOf = __commonJS(function(exports) {
|
|
68653
68979
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68654
68980
|
var util_1 = require_util();
|
|
68655
68981
|
var def = {
|
|
@@ -68673,7 +68999,7 @@ var require_allOf = __commonJS((exports) => {
|
|
|
68673
68999
|
});
|
|
68674
69000
|
|
|
68675
69001
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js
|
|
68676
|
-
var require_if = __commonJS((exports)
|
|
69002
|
+
var require_if = __commonJS(function(exports) {
|
|
68677
69003
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68678
69004
|
var codegen_1 = require_codegen();
|
|
68679
69005
|
var util_1 = require_util();
|
|
@@ -68739,7 +69065,7 @@ var require_if = __commonJS((exports) => {
|
|
|
68739
69065
|
});
|
|
68740
69066
|
|
|
68741
69067
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js
|
|
68742
|
-
var require_thenElse = __commonJS((exports)
|
|
69068
|
+
var require_thenElse = __commonJS(function(exports) {
|
|
68743
69069
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68744
69070
|
var util_1 = require_util();
|
|
68745
69071
|
var def = {
|
|
@@ -68754,7 +69080,7 @@ var require_thenElse = __commonJS((exports) => {
|
|
|
68754
69080
|
});
|
|
68755
69081
|
|
|
68756
69082
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js
|
|
68757
|
-
var require_applicator = __commonJS((exports)
|
|
69083
|
+
var require_applicator = __commonJS(function(exports) {
|
|
68758
69084
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68759
69085
|
var additionalItems_1 = require_additionalItems();
|
|
68760
69086
|
var prefixItems_1 = require_prefixItems();
|
|
@@ -68797,7 +69123,7 @@ var require_applicator = __commonJS((exports) => {
|
|
|
68797
69123
|
});
|
|
68798
69124
|
|
|
68799
69125
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js
|
|
68800
|
-
var require_format = __commonJS((exports)
|
|
69126
|
+
var require_format = __commonJS(function(exports) {
|
|
68801
69127
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68802
69128
|
var codegen_1 = require_codegen();
|
|
68803
69129
|
var error2 = {
|
|
@@ -68884,7 +69210,7 @@ var require_format = __commonJS((exports) => {
|
|
|
68884
69210
|
});
|
|
68885
69211
|
|
|
68886
69212
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js
|
|
68887
|
-
var require_format2 = __commonJS((exports)
|
|
69213
|
+
var require_format2 = __commonJS(function(exports) {
|
|
68888
69214
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68889
69215
|
var format_1 = require_format();
|
|
68890
69216
|
var format = [format_1.default];
|
|
@@ -68892,7 +69218,7 @@ var require_format2 = __commonJS((exports) => {
|
|
|
68892
69218
|
});
|
|
68893
69219
|
|
|
68894
69220
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js
|
|
68895
|
-
var require_metadata = __commonJS((exports)
|
|
69221
|
+
var require_metadata = __commonJS(function(exports) {
|
|
68896
69222
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68897
69223
|
exports.contentVocabulary = exports.metadataVocabulary = undefined;
|
|
68898
69224
|
exports.metadataVocabulary = [
|
|
@@ -68912,7 +69238,7 @@ var require_metadata = __commonJS((exports) => {
|
|
|
68912
69238
|
});
|
|
68913
69239
|
|
|
68914
69240
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft7.js
|
|
68915
|
-
var require_draft7 = __commonJS((exports)
|
|
69241
|
+
var require_draft7 = __commonJS(function(exports) {
|
|
68916
69242
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68917
69243
|
var core_1 = require_core2();
|
|
68918
69244
|
var validation_1 = require_validation();
|
|
@@ -68931,7 +69257,7 @@ var require_draft7 = __commonJS((exports) => {
|
|
|
68931
69257
|
});
|
|
68932
69258
|
|
|
68933
69259
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js
|
|
68934
|
-
var require_types = __commonJS((exports)
|
|
69260
|
+
var require_types = __commonJS(function(exports) {
|
|
68935
69261
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68936
69262
|
exports.DiscrError = undefined;
|
|
68937
69263
|
var DiscrError;
|
|
@@ -68942,7 +69268,7 @@ var require_types = __commonJS((exports) => {
|
|
|
68942
69268
|
});
|
|
68943
69269
|
|
|
68944
69270
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js
|
|
68945
|
-
var require_discriminator = __commonJS((exports)
|
|
69271
|
+
var require_discriminator = __commonJS(function(exports) {
|
|
68946
69272
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68947
69273
|
var codegen_1 = require_codegen();
|
|
68948
69274
|
var types_1 = require_types();
|
|
@@ -69044,7 +69370,7 @@ var require_discriminator = __commonJS((exports) => {
|
|
|
69044
69370
|
});
|
|
69045
69371
|
|
|
69046
69372
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-draft-07.json
|
|
69047
|
-
var require_json_schema_draft_07 = __commonJS((exports, module)
|
|
69373
|
+
var require_json_schema_draft_07 = __commonJS(function(exports, module) {
|
|
69048
69374
|
module.exports = {
|
|
69049
69375
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
69050
69376
|
$id: "http://json-schema.org/draft-07/schema#",
|
|
@@ -69199,7 +69525,7 @@ var require_json_schema_draft_07 = __commonJS((exports, module) => {
|
|
|
69199
69525
|
});
|
|
69200
69526
|
|
|
69201
69527
|
// ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/ajv.js
|
|
69202
|
-
var require_ajv = __commonJS((exports, module)
|
|
69528
|
+
var require_ajv = __commonJS(function(exports, module) {
|
|
69203
69529
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
69204
69530
|
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = undefined;
|
|
69205
69531
|
var core_1 = require_core();
|
|
@@ -69267,7 +69593,7 @@ var require_ajv = __commonJS((exports, module) => {
|
|
|
69267
69593
|
});
|
|
69268
69594
|
|
|
69269
69595
|
// ../../node_modules/.bun/ajv-formats@3.0.1/node_modules/ajv-formats/dist/formats.js
|
|
69270
|
-
var require_formats = __commonJS((exports)
|
|
69596
|
+
var require_formats = __commonJS(function(exports) {
|
|
69271
69597
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
69272
69598
|
exports.formatNames = exports.fastFormats = exports.fullFormats = undefined;
|
|
69273
69599
|
function fmtDef(validate2, compare) {
|
|
@@ -69444,7 +69770,7 @@ var require_formats = __commonJS((exports) => {
|
|
|
69444
69770
|
});
|
|
69445
69771
|
|
|
69446
69772
|
// ../../node_modules/.bun/ajv-formats@3.0.1/node_modules/ajv-formats/dist/limit.js
|
|
69447
|
-
var require_limit = __commonJS((exports)
|
|
69773
|
+
var require_limit = __commonJS(function(exports) {
|
|
69448
69774
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
69449
69775
|
exports.formatLimitDefinition = undefined;
|
|
69450
69776
|
var ajv_1 = require_ajv();
|
|
@@ -69513,7 +69839,7 @@ var require_limit = __commonJS((exports) => {
|
|
|
69513
69839
|
});
|
|
69514
69840
|
|
|
69515
69841
|
// ../../node_modules/.bun/ajv-formats@3.0.1/node_modules/ajv-formats/dist/index.js
|
|
69516
|
-
var require_dist = __commonJS((exports, module)
|
|
69842
|
+
var require_dist = __commonJS(function(exports, module) {
|
|
69517
69843
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
69518
69844
|
var formats_1 = require_formats();
|
|
69519
69845
|
var limit_1 = require_limit();
|
|
@@ -72338,9 +72664,9 @@ var init_discovery_tools = __esm(() => {
|
|
|
72338
72664
|
// src/lib/run-routing.ts
|
|
72339
72665
|
var exports_run_routing = {};
|
|
72340
72666
|
__export(exports_run_routing, {
|
|
72341
|
-
|
|
72667
|
+
isServerOwnedSkill: () => isServerOwnedSkill,
|
|
72342
72668
|
resolveConfiguredRunRouting: () => resolveConfiguredRunRouting,
|
|
72343
|
-
|
|
72669
|
+
resolveRunRouting: () => resolveRunRouting
|
|
72344
72670
|
});
|
|
72345
72671
|
function isServerOwnedSkill(skill) {
|
|
72346
72672
|
return skill.serverOwned === true;
|
|
@@ -73636,6 +73962,107 @@ var init_storage_tools = __esm(() => {
|
|
|
73636
73962
|
init_helpers();
|
|
73637
73963
|
});
|
|
73638
73964
|
|
|
73965
|
+
// src/lib/remote-invitation-recovery.ts
|
|
73966
|
+
function invitationEmailIds(invitationId2, challengeId) {
|
|
73967
|
+
if (!uuid5(invitationId2) || !uuid5(challengeId))
|
|
73968
|
+
throw new InvitationEmailInputError;
|
|
73969
|
+
return { invitationId: invitationId2, challengeId };
|
|
73970
|
+
}
|
|
73971
|
+
function invitationEmailInput(action, input) {
|
|
73972
|
+
const keys2 = ["invitationId", "token", "challengeId", "confirm", ...action === "accept" ? ["code"] : []];
|
|
73973
|
+
if (!record6(input) || Object.keys(input).length !== keys2.length || keys2.some((key) => !Object.hasOwn(input, key)))
|
|
73974
|
+
throw new InvitationEmailInputError;
|
|
73975
|
+
const value = { ...input };
|
|
73976
|
+
const ids = invitationEmailIds(value.invitationId, value.challengeId);
|
|
73977
|
+
if (value.confirm !== true || typeof value.token !== "string" || !/^[A-Za-z0-9_-]{43}$/.test(value.token) || action === "accept" && (typeof value.code !== "string" || !/^\d{6}$/.test(value.code)))
|
|
73978
|
+
throw new InvitationEmailInputError;
|
|
73979
|
+
return { ...ids, token: value.token, confirm: true, ...action === "accept" ? { code: value.code } : {} };
|
|
73980
|
+
}
|
|
73981
|
+
async function requestInvitationEmail(origin, action, input) {
|
|
73982
|
+
const value = invitationEmailInput(action, input);
|
|
73983
|
+
let target;
|
|
73984
|
+
try {
|
|
73985
|
+
target = normalizeSkillsApiOrigin(origin);
|
|
73986
|
+
} catch {
|
|
73987
|
+
throw new InvitationEmailInputError;
|
|
73988
|
+
}
|
|
73989
|
+
const body = JSON.stringify({ invitationId: value.invitationId, token: value.token, challengeId: value.challengeId, ...action === "accept" ? { code: value.code } : {} });
|
|
73990
|
+
try {
|
|
73991
|
+
const response = await fetch(`${target}/api/v1/account/invitations/email-${action}`, {
|
|
73992
|
+
method: "POST",
|
|
73993
|
+
headers: { "Content-Type": "application/json" },
|
|
73994
|
+
body,
|
|
73995
|
+
credentials: "omit",
|
|
73996
|
+
redirect: "error",
|
|
73997
|
+
cache: "no-store",
|
|
73998
|
+
referrerPolicy: "no-referrer",
|
|
73999
|
+
signal: AbortSignal.timeout(15000)
|
|
74000
|
+
});
|
|
74001
|
+
const parsed = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(await readBoundedResponse(response, 4096)));
|
|
74002
|
+
if (!response.ok && record6(parsed) && typeof parsed.code === "string" && Object.hasOwn(refusals, parsed.code)) {
|
|
74003
|
+
const code = parsed.code;
|
|
74004
|
+
if (response.status === refusals[code][0])
|
|
74005
|
+
throw new RemoteInvitationEmailError(code);
|
|
74006
|
+
}
|
|
74007
|
+
if (!record6(parsed))
|
|
74008
|
+
throw new RemoteInvitationEmailUnconfirmedError(action);
|
|
74009
|
+
if (action === "challenge" && response.status === 202 && parsed.challengeId === value.challengeId && parsed.expiresIn === 600 && typeof parsed.message === "string" && parsed.message.length <= 256) {
|
|
74010
|
+
return { challengeId: value.challengeId, message: "If this invitation is eligible, a verification code will arrive. Delivery is not confirmed.", expiresIn: 600 };
|
|
74011
|
+
}
|
|
74012
|
+
if (action === "accept" && response.status === 200 && uuid5(parsed.organizationId) && uuid5(parsed.membershipId) && parsed.accepted === true && parsed.changed === true && parsed.signInRequired === true) {
|
|
74013
|
+
return { organizationId: parsed.organizationId, membershipId: parsed.membershipId, accepted: true, changed: true, signInRequired: true };
|
|
74014
|
+
}
|
|
74015
|
+
} catch (error2) {
|
|
74016
|
+
if (error2 instanceof RemoteInvitationEmailError)
|
|
74017
|
+
throw error2;
|
|
74018
|
+
}
|
|
74019
|
+
throw new RemoteInvitationEmailUnconfirmedError(action);
|
|
74020
|
+
}
|
|
74021
|
+
function invitationEmailCustomerError(error2) {
|
|
74022
|
+
if (error2 instanceof InvitationEmailInputError || error2 instanceof RemoteInvitationEmailError || error2 instanceof RemoteInvitationEmailUnconfirmedError)
|
|
74023
|
+
return { code: error2.code, error: error2.message };
|
|
74024
|
+
return { code: "INVITATION_EMAIL_UNAVAILABLE", error: "Unable to prepare this recovery action. Check the explicit server and stable profile. No credential was saved." };
|
|
74025
|
+
}
|
|
74026
|
+
var InvitationEmailInputError, refusals, RemoteInvitationEmailError, RemoteInvitationEmailUnconfirmedError, record6 = (v) => !!v && typeof v === "object" && !Array.isArray(v), uuid5 = (v) => typeof v === "string" && /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(v);
|
|
74027
|
+
var init_remote_invitation_recovery = __esm(() => {
|
|
74028
|
+
init_fleet_credentials();
|
|
74029
|
+
init_remote_files();
|
|
74030
|
+
InvitationEmailInputError = class InvitationEmailInputError extends Error {
|
|
74031
|
+
code = "INVITATION_EMAIL_INPUT_INVALID";
|
|
74032
|
+
constructor() {
|
|
74033
|
+
super("Use an explicit Skills API URL, exact invitation and retained challenge IDs, secret input, and deliberate confirmation.");
|
|
74034
|
+
this.name = "InvitationEmailInputError";
|
|
74035
|
+
}
|
|
74036
|
+
};
|
|
74037
|
+
refusals = {
|
|
74038
|
+
INVALID_REQUEST: [400, "Invitation recovery parameters were refused."],
|
|
74039
|
+
ORIGIN_REQUIRED: [403, "Invitation recovery requires the configured site origin."],
|
|
74040
|
+
INVITATION_PROOF_UNAVAILABLE: [401, "Invitation proof is unavailable. Sign in or explicitly request another recovery code."],
|
|
74041
|
+
RATE_LIMITED: [429, "Invitation verification is rate limited. Wait before another deliberate action."],
|
|
74042
|
+
INVITATION_BUSY: [503, "Invitation is busy. Sign in to check membership before another deliberate action."],
|
|
74043
|
+
INVITATION_DELIVERY_UNAVAILABLE: [503, "Invitation recovery is unavailable on this service."]
|
|
74044
|
+
};
|
|
74045
|
+
RemoteInvitationEmailError = class RemoteInvitationEmailError extends Error {
|
|
74046
|
+
code;
|
|
74047
|
+
status;
|
|
74048
|
+
constructor(code) {
|
|
74049
|
+
super(refusals[code][1]);
|
|
74050
|
+
this.code = code;
|
|
74051
|
+
this.name = "RemoteInvitationEmailError";
|
|
74052
|
+
this.status = refusals[code][0];
|
|
74053
|
+
}
|
|
74054
|
+
};
|
|
74055
|
+
RemoteInvitationEmailUnconfirmedError = class RemoteInvitationEmailUnconfirmedError extends Error {
|
|
74056
|
+
action;
|
|
74057
|
+
code = "INVITATION_EMAIL_UNCONFIRMED";
|
|
74058
|
+
constructor(action) {
|
|
74059
|
+
super(action === "challenge" ? "The recovery challenge outcome is unconfirmed. Retain the same invitation, challenge ID and server. Check your inbox; never rotate the challenge or retry automatically. No delivery is confirmed." : "Invitation acceptance is unconfirmed. Use fresh ordinary sign-in to inspect available memberships. Do not retry acceptance automatically; explicitly request another recovery code only if needed. Saved credentials are unchanged.");
|
|
74060
|
+
this.action = action;
|
|
74061
|
+
this.name = "RemoteInvitationEmailUnconfirmedError";
|
|
74062
|
+
}
|
|
74063
|
+
};
|
|
74064
|
+
});
|
|
74065
|
+
|
|
73639
74066
|
// src/lib/remote-auth.ts
|
|
73640
74067
|
async function requestAuthApi(instance, path, options) {
|
|
73641
74068
|
const url = normalizeSkillsApiOrigin(instance);
|
|
@@ -73658,10 +74085,10 @@ async function requestAuthApi(instance, path, options) {
|
|
|
73658
74085
|
const text2 = await res.text();
|
|
73659
74086
|
const body = text2 ? parseJsonBody(text2) : {};
|
|
73660
74087
|
if (!res.ok) {
|
|
73661
|
-
const
|
|
73662
|
-
const detail = typeof
|
|
73663
|
-
const error2 = typeof
|
|
73664
|
-
const code = typeof
|
|
74088
|
+
const record7 = isRecord5(body) ? body : {};
|
|
74089
|
+
const detail = typeof record7.detail === "string" ? record7.detail : undefined;
|
|
74090
|
+
const error2 = typeof record7.error === "string" ? record7.error : undefined;
|
|
74091
|
+
const code = typeof record7.code === "string" ? record7.code : undefined;
|
|
73665
74092
|
throw new HostedApiError(detail || error2 || `${res.status} ${res.statusText}`, {
|
|
73666
74093
|
status: res.status,
|
|
73667
74094
|
code,
|
|
@@ -73695,11 +74122,17 @@ class RemoteSkillsAuthClient {
|
|
|
73695
74122
|
constructor(apiUrl) {
|
|
73696
74123
|
this.apiOrigin = normalizeSkillsApiOrigin(apiUrl);
|
|
73697
74124
|
}
|
|
73698
|
-
|
|
73699
|
-
return this.
|
|
74125
|
+
requestInvitationEmailChallenge(input) {
|
|
74126
|
+
return requestInvitationEmail(this.apiOrigin, "challenge", input);
|
|
73700
74127
|
}
|
|
73701
|
-
|
|
73702
|
-
return this.
|
|
74128
|
+
acceptInvitationEmailChallenge(input) {
|
|
74129
|
+
return requestInvitationEmail(this.apiOrigin, "accept", input);
|
|
74130
|
+
}
|
|
74131
|
+
requestCode(email3) {
|
|
74132
|
+
return this.request("/api/auth/login", { method: "POST", body: JSON.stringify({ email: email3 }) });
|
|
74133
|
+
}
|
|
74134
|
+
verifyCode(email3, code) {
|
|
74135
|
+
return this.request("/api/auth/verify", { method: "POST", body: JSON.stringify({ email: email3, code }) });
|
|
73703
74136
|
}
|
|
73704
74137
|
startDevice() {
|
|
73705
74138
|
return this.request("/api/auth/device/start", { method: "POST", body: JSON.stringify({ client: "skills-sdk" }) });
|
|
@@ -73707,34 +74140,34 @@ class RemoteSkillsAuthClient {
|
|
|
73707
74140
|
pollDevice(deviceCode) {
|
|
73708
74141
|
return this.request("/api/auth/device/token", { method: "POST", body: JSON.stringify({ deviceCode }) });
|
|
73709
74142
|
}
|
|
73710
|
-
async sessionClient(
|
|
74143
|
+
async sessionClient(email3, code, context) {
|
|
73711
74144
|
if (context !== undefined) {
|
|
73712
74145
|
const target = workspaceContext(context), apiOrigin2 = this.apiOrigin;
|
|
73713
|
-
const session = await this.switchWorkspace(
|
|
74146
|
+
const session = await this.switchWorkspace(email3, code, target);
|
|
73714
74147
|
return new RemoteSkillsClient(session.token, apiOrigin2);
|
|
73715
74148
|
}
|
|
73716
74149
|
const apiOrigin = this.apiOrigin;
|
|
73717
|
-
if (!
|
|
74150
|
+
if (!email3.includes("@") || !/^\d{6}$/.test(code))
|
|
73718
74151
|
throw new Error("Fresh email and six-digit verification code are required to manage this account");
|
|
73719
|
-
const login = await this.verifyCode(
|
|
74152
|
+
const login = await this.verifyCode(email3, code);
|
|
73720
74153
|
if (!login || typeof login.token !== "string" || !login.token)
|
|
73721
74154
|
throw new Error("The server did not return an authorized account session");
|
|
73722
74155
|
return new RemoteSkillsClient(login.token, apiOrigin);
|
|
73723
74156
|
}
|
|
73724
|
-
async listAccountWorkspaces(
|
|
73725
|
-
const login = await this.workspaceLogin(
|
|
74157
|
+
async listAccountWorkspaces(email3, code, expectedUserId) {
|
|
74158
|
+
const login = await this.workspaceLogin(email3, code, expectedUserId);
|
|
73726
74159
|
const result2 = await new RemoteSkillsClient(login.token, login.apiOrigin).listAccountWorkspaces(login.userId);
|
|
73727
74160
|
return { userId: login.userId, ...result2 };
|
|
73728
74161
|
}
|
|
73729
|
-
async switchWorkspace(
|
|
74162
|
+
async switchWorkspace(email3, code, context) {
|
|
73730
74163
|
const target = workspaceContext(context);
|
|
73731
|
-
const login = await this.workspaceLogin(
|
|
74164
|
+
const login = await this.workspaceLogin(email3, code, target.userId);
|
|
73732
74165
|
return new RemoteSkillsClient(login.token, login.apiOrigin).switchWorkspace(target);
|
|
73733
74166
|
}
|
|
73734
|
-
async workspaceLogin(
|
|
74167
|
+
async workspaceLogin(email3, code, expectedUserId) {
|
|
73735
74168
|
const expected = expectedUserId === undefined ? undefined : workspaceExpectedUserId(expectedUserId);
|
|
73736
74169
|
const apiOrigin = this.apiOrigin;
|
|
73737
|
-
if (typeof
|
|
74170
|
+
if (typeof email3 !== "string" || !email3.includes("@") || typeof code !== "string" || !/^\d{6}$/.test(code))
|
|
73738
74171
|
throw new Error("Fresh email and six-digit verification code are required to manage this account");
|
|
73739
74172
|
let response;
|
|
73740
74173
|
try {
|
|
@@ -73744,7 +74177,7 @@ class RemoteSkillsAuthClient {
|
|
|
73744
74177
|
credentials: "omit",
|
|
73745
74178
|
signal: AbortSignal.timeout(15000),
|
|
73746
74179
|
headers: { "Content-Type": "application/json" },
|
|
73747
|
-
body: JSON.stringify({ email:
|
|
74180
|
+
body: JSON.stringify({ email: email3, code })
|
|
73748
74181
|
});
|
|
73749
74182
|
} catch {
|
|
73750
74183
|
throw new HostedApiError("Unable to verify the Skills account.");
|
|
@@ -73761,40 +74194,67 @@ class RemoteSkillsAuthClient {
|
|
|
73761
74194
|
}
|
|
73762
74195
|
return { ...parseWorkspaceLogin(value, expected), apiOrigin };
|
|
73763
74196
|
}
|
|
73764
|
-
async
|
|
74197
|
+
async listWorkspaceInvitations(email3, code, context, options = {}) {
|
|
74198
|
+
const target = workspaceContext(context), captured = invitationInput("list", options);
|
|
74199
|
+
return (await this.sessionClient(email3, code, target)).listWorkspaceInvitations(target, captured);
|
|
74200
|
+
}
|
|
74201
|
+
async getWorkspaceInvitation(email3, code, context, invitationId2) {
|
|
74202
|
+
const target = workspaceContext(context), captured = invitationInput("get", { invitationId: invitationId2 });
|
|
74203
|
+
return (await this.sessionClient(email3, code, target)).getWorkspaceInvitation(target, captured.invitationId);
|
|
74204
|
+
}
|
|
74205
|
+
async issueWorkspaceInvitation(email3, code, context, input) {
|
|
74206
|
+
const target = workspaceContext(context), captured = invitationInput("issue", input);
|
|
74207
|
+
return (await this.sessionClient(email3, code, target)).issueWorkspaceInvitation(target, captured);
|
|
74208
|
+
}
|
|
74209
|
+
async resendWorkspaceInvitation(email3, code, context, invitationId2, input) {
|
|
74210
|
+
const target = workspaceContext(context), captured = invitationInput("resend", { ...input, invitationId: invitationId2 });
|
|
74211
|
+
const { invitationId: id, ...options } = captured;
|
|
74212
|
+
return (await this.sessionClient(email3, code, target)).resendWorkspaceInvitation(target, id, options);
|
|
74213
|
+
}
|
|
74214
|
+
async revokeWorkspaceInvitation(email3, code, context, invitationId2, input) {
|
|
74215
|
+
const target = workspaceContext(context), captured = invitationInput("revoke", { ...input, invitationId: invitationId2 });
|
|
74216
|
+
const { invitationId: id, ...options } = captured;
|
|
74217
|
+
return (await this.sessionClient(email3, code, target)).revokeWorkspaceInvitation(target, id, options);
|
|
74218
|
+
}
|
|
74219
|
+
async acceptWorkspaceInvitation(email3, code, context, invitationId2, input) {
|
|
74220
|
+
const target = workspaceContext(context), captured = invitationInput("accept", { ...input, invitationId: invitationId2 });
|
|
74221
|
+
const { invitationId: id, ...options } = captured;
|
|
74222
|
+
return (await this.sessionClient(email3, code, target)).acceptWorkspaceInvitation(target, id, options);
|
|
74223
|
+
}
|
|
74224
|
+
async createApiKey(email3, code, name, scopes, context) {
|
|
73765
74225
|
const capturedScopes = scopes === undefined ? undefined : [...scopes];
|
|
73766
|
-
return (await this.sessionClient(
|
|
74226
|
+
return (await this.sessionClient(email3, code, context)).createApiKey(name, capturedScopes);
|
|
73767
74227
|
}
|
|
73768
|
-
async listApiKeys(
|
|
73769
|
-
return (await this.sessionClient(
|
|
74228
|
+
async listApiKeys(email3, code, context) {
|
|
74229
|
+
return (await this.sessionClient(email3, code, context)).listApiKeys();
|
|
73770
74230
|
}
|
|
73771
|
-
async revokeApiKey(
|
|
73772
|
-
return (await this.sessionClient(
|
|
74231
|
+
async revokeApiKey(email3, code, keyId, context) {
|
|
74232
|
+
return (await this.sessionClient(email3, code, context)).revokeApiKey(keyId);
|
|
73773
74233
|
}
|
|
73774
|
-
async updateProfile(
|
|
74234
|
+
async updateProfile(email3, code, input, context) {
|
|
73775
74235
|
const body = customerNamePatch(input, "displayName");
|
|
73776
|
-
return (await this.sessionClient(
|
|
74236
|
+
return (await this.sessionClient(email3, code, context)).updateProfile({ displayName: body.displayName });
|
|
73777
74237
|
}
|
|
73778
|
-
async updateCurrentWorkspace(
|
|
74238
|
+
async updateCurrentWorkspace(email3, code, input, context) {
|
|
73779
74239
|
const body = customerNamePatch(input, "name");
|
|
73780
|
-
return (await this.sessionClient(
|
|
74240
|
+
return (await this.sessionClient(email3, code, context)).updateCurrentWorkspace({ name: body.name });
|
|
73781
74241
|
}
|
|
73782
|
-
async listWorkspaceMembers(
|
|
74242
|
+
async listWorkspaceMembers(email3, code, options = {}, context) {
|
|
73783
74243
|
workspaceMembersQuery(options);
|
|
73784
74244
|
const captured = { ...options };
|
|
73785
|
-
return (await this.sessionClient(
|
|
74245
|
+
return (await this.sessionClient(email3, code, context)).listWorkspaceMembers(captured);
|
|
73786
74246
|
}
|
|
73787
|
-
async setWorkspaceMemberRole(
|
|
74247
|
+
async setWorkspaceMemberRole(email3, code, membershipId, input, context) {
|
|
73788
74248
|
const captured = workspaceMemberRoleInput(membershipId, input);
|
|
73789
|
-
return (await this.sessionClient(
|
|
74249
|
+
return (await this.sessionClient(email3, code, context)).setWorkspaceMemberRole(captured.membershipId, captured.body);
|
|
73790
74250
|
}
|
|
73791
|
-
async leaveWorkspace(
|
|
74251
|
+
async leaveWorkspace(email3, code, context, input) {
|
|
73792
74252
|
const captured = workspaceLeaveInput(context, input);
|
|
73793
|
-
return (await this.sessionClient(
|
|
74253
|
+
return (await this.sessionClient(email3, code, captured.context)).leaveWorkspace(captured.context, captured.input);
|
|
73794
74254
|
}
|
|
73795
|
-
async removeWorkspaceMember(
|
|
74255
|
+
async removeWorkspaceMember(email3, code, membershipId, input, context) {
|
|
73796
74256
|
const captured = workspaceMemberRemovalInput(membershipId, input);
|
|
73797
|
-
return (await this.sessionClient(
|
|
74257
|
+
return (await this.sessionClient(email3, code, context)).removeWorkspaceMember(captured.membershipId, captured.body);
|
|
73798
74258
|
}
|
|
73799
74259
|
request(path, options) {
|
|
73800
74260
|
if (!["/api/auth/login", "/api/auth/verify", "/api/auth/device/start", "/api/auth/device/token", "/api/auth/keys", "/api/auth/whoami"].includes(path))
|
|
@@ -73804,6 +74264,8 @@ class RemoteSkillsAuthClient {
|
|
|
73804
74264
|
}
|
|
73805
74265
|
var MAX_ERROR_DETAIL_LENGTH = 200, HostedApiError;
|
|
73806
74266
|
var init_remote_auth = __esm(() => {
|
|
74267
|
+
init_remote_invitation_recovery();
|
|
74268
|
+
init_remote_invitations();
|
|
73807
74269
|
init_remote_workspace_leave();
|
|
73808
74270
|
init_remote_workspace_selection();
|
|
73809
74271
|
init_remote_files();
|
|
@@ -73950,20 +74412,20 @@ async function prepareWorkspaceEnrollment(membershipId, source = process.env) {
|
|
|
73950
74412
|
return {
|
|
73951
74413
|
profile,
|
|
73952
74414
|
origin,
|
|
73953
|
-
async complete(
|
|
74415
|
+
async complete(email3, code) {
|
|
73954
74416
|
unchanged2();
|
|
73955
|
-
if (!
|
|
74417
|
+
if (!email3.includes("@") || !/^\d{6}$/.test(code))
|
|
73956
74418
|
return fail2("A fresh email and six-digit verification code are required.");
|
|
73957
|
-
if (expected && expected.user.email.toLowerCase() !==
|
|
74419
|
+
if (expected && expected.user.email.toLowerCase() !== email3.toLowerCase())
|
|
73958
74420
|
return fail2("This profile belongs to another account. Use a different profile or ordinary replacement login.");
|
|
73959
74421
|
let issued = false;
|
|
73960
74422
|
try {
|
|
73961
|
-
const result2 = await new RemoteSkillsAuthClient(origin).verifyCode(
|
|
74423
|
+
const result2 = await new RemoteSkillsAuthClient(origin).verifyCode(email3, code);
|
|
73962
74424
|
const login = parseWorkspaceLogin(result2, expected?.user.id);
|
|
73963
74425
|
if (result2.firstLogin === true)
|
|
73964
74426
|
return fail2("This sign-in created a new account using the server signup policy. Finish ordinary account login before enrolling a workspace profile.");
|
|
73965
74427
|
const session = await new RemoteSkillsClient(login.token, origin).switchWorkspace({ userId: login.userId, membershipId });
|
|
73966
|
-
if (session.user.email.toLowerCase() !==
|
|
74428
|
+
if (session.user.email.toLowerCase() !== email3.toLowerCase())
|
|
73967
74429
|
return fail2("The verified account does not match the requested email.");
|
|
73968
74430
|
if (session.user.role === "viewer")
|
|
73969
74431
|
return fail2("Viewer memberships cannot enroll API keys.");
|
|
@@ -74047,8 +74509,103 @@ var init_workspace_profile = __esm(() => {
|
|
|
74047
74509
|
};
|
|
74048
74510
|
});
|
|
74049
74511
|
|
|
74512
|
+
// src/lib/invitation-customer-action.ts
|
|
74513
|
+
function invitationProfileContext(userId, membershipId, profile) {
|
|
74514
|
+
const target = workspaceContext({ userId, membershipId });
|
|
74515
|
+
if (profile && (profile.userId !== target.userId || profile.membershipId !== target.membershipId))
|
|
74516
|
+
throw new WorkspaceIdentityMismatchError;
|
|
74517
|
+
return target;
|
|
74518
|
+
}
|
|
74519
|
+
async function invokeFreshInvitation(client, email3, code, context, action, input) {
|
|
74520
|
+
const target = workspaceContext(context), captured = invitationInput(action, input);
|
|
74521
|
+
let result2;
|
|
74522
|
+
switch (action) {
|
|
74523
|
+
case "list":
|
|
74524
|
+
result2 = await client.listWorkspaceInvitations(email3, code, target, captured);
|
|
74525
|
+
break;
|
|
74526
|
+
case "get":
|
|
74527
|
+
result2 = await client.getWorkspaceInvitation(email3, code, target, captured.invitationId);
|
|
74528
|
+
break;
|
|
74529
|
+
case "issue":
|
|
74530
|
+
result2 = await client.issueWorkspaceInvitation(email3, code, target, captured);
|
|
74531
|
+
break;
|
|
74532
|
+
case "resend": {
|
|
74533
|
+
const { invitationId: invitationId2, ...options } = captured;
|
|
74534
|
+
result2 = await client.resendWorkspaceInvitation(email3, code, target, invitationId2, options);
|
|
74535
|
+
break;
|
|
74536
|
+
}
|
|
74537
|
+
case "revoke": {
|
|
74538
|
+
const { invitationId: invitationId2, ...options } = captured;
|
|
74539
|
+
result2 = await client.revokeWorkspaceInvitation(email3, code, target, invitationId2, options);
|
|
74540
|
+
break;
|
|
74541
|
+
}
|
|
74542
|
+
case "accept": {
|
|
74543
|
+
const { invitationId: invitationId2, ...options } = captured;
|
|
74544
|
+
result2 = await client.acceptWorkspaceInvitation(email3, code, target, invitationId2, options);
|
|
74545
|
+
break;
|
|
74546
|
+
}
|
|
74547
|
+
default:
|
|
74548
|
+
throw new WorkspaceInvitationInputError;
|
|
74549
|
+
}
|
|
74550
|
+
return result2;
|
|
74551
|
+
}
|
|
74552
|
+
function invitationCustomerError(error2) {
|
|
74553
|
+
if (error2 instanceof WorkspaceInvitationInputError || error2 instanceof RemoteWorkspaceInvitationError || error2 instanceof RemoteWorkspaceInvitationUnconfirmedError || error2 instanceof RemoteWorkspaceInvitationReadError)
|
|
74554
|
+
return { code: error2.code, error: error2.message };
|
|
74555
|
+
return { code: "INVITATION_VERIFICATION_FAILED", error: "Invitation verification failed. Check the selected server, profile, exact user and current membership, then obtain a fresh code. No invitation result was confirmed; saved credentials are unchanged." };
|
|
74556
|
+
}
|
|
74557
|
+
var init_invitation_customer_action = __esm(() => {
|
|
74558
|
+
init_remote_workspace_selection();
|
|
74559
|
+
init_remote_invitations();
|
|
74560
|
+
});
|
|
74561
|
+
|
|
74562
|
+
// src/mcp/remote-invitation-tools.ts
|
|
74563
|
+
function registerRemoteInvitationTools(server) {
|
|
74564
|
+
const uuid6 = exports_external.string().regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/);
|
|
74565
|
+
const verification = { userId: uuid6, membershipId: uuid6, email: exports_external.string().email().max(254), code: exports_external.string().regex(/^\d{6}$/) };
|
|
74566
|
+
const schemas4 = {
|
|
74567
|
+
list: exports_external.object({ ...verification, after: uuid6.optional() }).strict(),
|
|
74568
|
+
get: exports_external.object({ ...verification, invitationId: uuid6 }).strict(),
|
|
74569
|
+
issue: exports_external.object({ ...verification, recipient: exports_external.string().email().max(254), role: exports_external.enum(["owner", "admin", "member", "viewer"]), idempotencyKey: uuid6, confirm: exports_external.literal(true) }).strict(),
|
|
74570
|
+
resend: exports_external.object({ ...verification, invitationId: uuid6, expectedGeneration: exports_external.number().int().min(1).max(10), idempotencyKey: uuid6, confirm: exports_external.literal(true) }).strict(),
|
|
74571
|
+
revoke: exports_external.object({ ...verification, invitationId: uuid6, expectedGeneration: exports_external.number().int().min(1).max(10), confirm: exports_external.literal(true) }).strict(),
|
|
74572
|
+
accept: exports_external.object({ ...verification, invitationId: uuid6, token: exports_external.string().regex(/^[A-Za-z0-9_-]{43}$/).describe("Secret from the invitation email; supplied only in the MCP request, never returned or saved."), confirm: exports_external.literal(true) }).strict()
|
|
74573
|
+
};
|
|
74574
|
+
for (const action of ["list", "get", "issue", "resend", "revoke", "accept"]) {
|
|
74575
|
+
const read = action === "list" || action === "get";
|
|
74576
|
+
server.registerTool(action === "list" ? "list_workspace_invitations" : `${action}_workspace_invitation`, {
|
|
74577
|
+
title: `${action[0].toUpperCase() + action.slice(1)} Workspace Invitation${action === "list" ? "s" : ""}`,
|
|
74578
|
+
description: "Use fresh verification bound to the exact observed user/current membership and any selected profile. Mutations require confirm=true; issue/resend require a stable caller request key. Never retry uncertain outcomes automatically. Acceptance does not switch workspace or create credentials. Zero-membership account recovery is not supported by this flow.",
|
|
74579
|
+
annotations: { destructiveHint: !read, idempotentHint: true, readOnlyHint: read },
|
|
74580
|
+
inputSchema: schemas4[action]
|
|
74581
|
+
}, async (value) => {
|
|
74582
|
+
try {
|
|
74583
|
+
const { userId, membershipId, email: email3, code, recipient, ...rest2 } = value;
|
|
74584
|
+
const input = invitationInput(action, action === "issue" ? { ...rest2, email: recipient } : rest2);
|
|
74585
|
+
const context = invitationProfileContext(String(userId), String(membershipId));
|
|
74586
|
+
const target = await captureProfileWorkspace("Manage invitations");
|
|
74587
|
+
invitationProfileContext(context.userId, context.membershipId, target.context);
|
|
74588
|
+
target.unchanged();
|
|
74589
|
+
return mcpJson(await invokeFreshInvitation(new RemoteSkillsAuthClient(target.origin), String(email3), String(code), context, action, input));
|
|
74590
|
+
} catch (error2) {
|
|
74591
|
+
const result2 = invitationCustomerError(error2);
|
|
74592
|
+
return mcpError(result2.code, result2.error);
|
|
74593
|
+
}
|
|
74594
|
+
});
|
|
74595
|
+
}
|
|
74596
|
+
}
|
|
74597
|
+
var init_remote_invitation_tools = __esm(() => {
|
|
74598
|
+
init_zod();
|
|
74599
|
+
init_remote_auth();
|
|
74600
|
+
init_workspace_profile();
|
|
74601
|
+
init_invitation_customer_action();
|
|
74602
|
+
init_remote_invitations();
|
|
74603
|
+
init_helpers();
|
|
74604
|
+
});
|
|
74605
|
+
|
|
74050
74606
|
// src/mcp/remote-customer-tools.ts
|
|
74051
74607
|
function registerRemoteCustomerTools(server) {
|
|
74608
|
+
registerRemoteInvitationTools(server);
|
|
74052
74609
|
const memberRole = exports_external.enum(["owner", "admin", "member", "viewer"]);
|
|
74053
74610
|
const memberInput = {
|
|
74054
74611
|
membershipId: exports_external.string().regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/),
|
|
@@ -74061,9 +74618,9 @@ function registerRemoteCustomerTools(server) {
|
|
|
74061
74618
|
description: "Leave exactly the observed user and membership with confirm=true and fresh verification. The server enforces last-owner and last-workspace safeguards. Sign in again afterwards; no automatic retry or saved-profile deletion.",
|
|
74062
74619
|
annotations: { destructiveHint: true, idempotentHint: false, readOnlyHint: false },
|
|
74063
74620
|
inputSchema: exports_external.object({ ...memberInput, userId: memberInput.membershipId, confirm: exports_external.literal(true) }).strict()
|
|
74064
|
-
}, async ({ membershipId, userId, expectedRole, email:
|
|
74621
|
+
}, async ({ membershipId, userId, expectedRole, email: email3, code, confirm }) => {
|
|
74065
74622
|
try {
|
|
74066
|
-
return mcpJson(await freshAccount("Leave workspace", (client, context) => client.leaveWorkspace(
|
|
74623
|
+
return mcpJson(await freshAccount("Leave workspace", (client, context) => client.leaveWorkspace(email3, code, workspaceLeaveProfileContext(membershipId, userId, context), { expectedRole, confirm })));
|
|
74067
74624
|
} catch (error2) {
|
|
74068
74625
|
return error2 instanceof RemoteWorkspaceLeaveError || error2 instanceof RemoteWorkspaceLeaveUnconfirmedError ? mcpError(error2.code, error2.message) : mcpError("WORKSPACE_LEAVE_UNCONFIRMED", "Leaving could not be confirmed. Check the selected profile and exact membership, sign in again and inspect available workspaces before another action. Do not retry automatically; saved credentials are unchanged.");
|
|
74069
74626
|
}
|
|
@@ -74072,9 +74629,9 @@ function registerRemoteCustomerTools(server) {
|
|
|
74072
74629
|
title: "Set Current Workspace Member Role",
|
|
74073
74630
|
description: "Change exactly this membership incarnation with its observed expectedRole and fresh verification. The server enforces owner/admin policy. No automatic refresh or retry; saved credentials stay unchanged.",
|
|
74074
74631
|
inputSchema: exports_external.object({ ...memberInput, role: memberRole }).strict()
|
|
74075
|
-
}, async ({ membershipId, role:
|
|
74632
|
+
}, async ({ membershipId, role: role3, expectedRole, email: email3, code }) => {
|
|
74076
74633
|
try {
|
|
74077
|
-
return mcpJson(await freshAccount("Set workspace member role", (client, context) => client.setWorkspaceMemberRole(
|
|
74634
|
+
return mcpJson(await freshAccount("Set workspace member role", (client, context) => client.setWorkspaceMemberRole(email3, code, membershipId, { role: role3, expectedRole }, context)));
|
|
74078
74635
|
} catch (error2) {
|
|
74079
74636
|
return memberError(error2);
|
|
74080
74637
|
}
|
|
@@ -74083,9 +74640,9 @@ function registerRemoteCustomerTools(server) {
|
|
|
74083
74640
|
title: "Remove Current Workspace Member",
|
|
74084
74641
|
description: "Remove exactly this membership incarnation using its observed expectedRole and fresh verification. Self-removal is unavailable. A retry cannot remove a later replacement membership; saved credentials stay unchanged.",
|
|
74085
74642
|
inputSchema: exports_external.object(memberInput).strict()
|
|
74086
|
-
}, async ({ membershipId, expectedRole, email:
|
|
74643
|
+
}, async ({ membershipId, expectedRole, email: email3, code }) => {
|
|
74087
74644
|
try {
|
|
74088
|
-
return mcpJson(await freshAccount("Remove workspace member", (client, context) => client.removeWorkspaceMember(
|
|
74645
|
+
return mcpJson(await freshAccount("Remove workspace member", (client, context) => client.removeWorkspaceMember(email3, code, membershipId, { expectedRole }, context)));
|
|
74089
74646
|
} catch (error2) {
|
|
74090
74647
|
return memberError(error2);
|
|
74091
74648
|
}
|
|
@@ -74099,9 +74656,9 @@ function registerRemoteCustomerTools(server) {
|
|
|
74099
74656
|
limit: exports_external.number().int().min(1).max(100).optional(),
|
|
74100
74657
|
cursor: exports_external.string().regex(/^[A-Za-z0-9_-]{1,512}$/).optional()
|
|
74101
74658
|
}).strict()
|
|
74102
|
-
}, async ({ email:
|
|
74659
|
+
}, async ({ email: email3, code, limit, cursor: cursor2 }) => {
|
|
74103
74660
|
try {
|
|
74104
|
-
return mcpJson(await freshAccount("List workspace members", (client, context) => client.listWorkspaceMembers(
|
|
74661
|
+
return mcpJson(await freshAccount("List workspace members", (client, context) => client.listWorkspaceMembers(email3, code, { limit, cursor: cursor2 }, context)));
|
|
74105
74662
|
} catch {
|
|
74106
74663
|
return mcpError("WORKSPACE_MEMBERS_FAILED", "Unable to list workspace members. Check the selected server, owner/admin permissions, pagination and fresh verification code.");
|
|
74107
74664
|
}
|
|
@@ -74111,9 +74668,9 @@ function registerRemoteCustomerTools(server) {
|
|
|
74111
74668
|
title: kind === "profile" ? "Update Account Display Name" : "Update Workspace Name",
|
|
74112
74669
|
description: "Update only the name on the explicitly selected Skills server using fresh email OTP. Workspace changes require an owner/admin. Saved credentials are unchanged.",
|
|
74113
74670
|
inputSchema: exports_external.object({ name: exports_external.string().min(1), email: exports_external.string().email(), code: exports_external.string().regex(/^\d{6}$/) }).strict()
|
|
74114
|
-
}, async ({ name, email:
|
|
74671
|
+
}, async ({ name, email: email3, code }) => {
|
|
74115
74672
|
try {
|
|
74116
|
-
return mcpJson(await freshAccount("Update customer name", async (client, context) => kind === "profile" ? client.updateProfile(
|
|
74673
|
+
return mcpJson(await freshAccount("Update customer name", async (client, context) => kind === "profile" ? client.updateProfile(email3, code, { displayName: name }, context) : client.updateCurrentWorkspace(email3, code, { name }, context)));
|
|
74117
74674
|
} catch {
|
|
74118
74675
|
return mcpError("NAME_UPDATE_FAILED", "Unable to update the name. Check the selected server, name, permissions and fresh verification code.");
|
|
74119
74676
|
}
|
|
@@ -74133,9 +74690,9 @@ function registerRemoteCustomerTools(server) {
|
|
|
74133
74690
|
title: "List API Keys",
|
|
74134
74691
|
description: "List account API keys using fresh email OTP reauthentication.",
|
|
74135
74692
|
inputSchema: { email: exports_external.string().email(), code: exports_external.string().regex(/^\d{6}$/) }
|
|
74136
|
-
}, async ({ email:
|
|
74693
|
+
}, async ({ email: email3, code }) => {
|
|
74137
74694
|
try {
|
|
74138
|
-
return mcpJson(await freshAccount("List API keys", (client, context) => client.listApiKeys(
|
|
74695
|
+
return mcpJson(await freshAccount("List API keys", (client, context) => client.listApiKeys(email3, code, context)));
|
|
74139
74696
|
} catch {
|
|
74140
74697
|
return mcpError("KEY_LIST_FAILED", "Unable to list API keys. Check the selected profile, server, account and fresh verification code.");
|
|
74141
74698
|
}
|
|
@@ -74144,9 +74701,9 @@ function registerRemoteCustomerTools(server) {
|
|
|
74144
74701
|
title: "Revoke API Key",
|
|
74145
74702
|
description: "Revoke an account API key using fresh email OTP reauthentication.",
|
|
74146
74703
|
inputSchema: { key_id: exports_external.string().min(1), email: exports_external.string().email(), code: exports_external.string().regex(/^\d{6}$/) }
|
|
74147
|
-
}, async ({ key_id, email:
|
|
74704
|
+
}, async ({ key_id, email: email3, code }) => {
|
|
74148
74705
|
try {
|
|
74149
|
-
return mcpJson(await freshAccount("Revoke API key", (client, context) => client.revokeApiKey(
|
|
74706
|
+
return mcpJson(await freshAccount("Revoke API key", (client, context) => client.revokeApiKey(email3, code, key_id, context)));
|
|
74150
74707
|
} catch {
|
|
74151
74708
|
return mcpError("KEY_REVOKE_FAILED", "Unable to revoke this API key. Check the selected profile, key, account and fresh verification code.");
|
|
74152
74709
|
}
|
|
@@ -74155,10 +74712,10 @@ function registerRemoteCustomerTools(server) {
|
|
|
74155
74712
|
title: "Create API Key",
|
|
74156
74713
|
description: "Create an API key using fresh email OTP reauthentication; returns its secret once. A stored API key cannot grant this authority.",
|
|
74157
74714
|
inputSchema: { name: exports_external.string().min(1), email: exports_external.string().email(), code: exports_external.string().regex(/^\d{6}$/), scopes: exports_external.array(exports_external.string()).optional() }
|
|
74158
|
-
}, async ({ name, email:
|
|
74715
|
+
}, async ({ name, email: email3, code, scopes }) => {
|
|
74159
74716
|
const capturedScopes = scopes === undefined ? undefined : [...scopes];
|
|
74160
74717
|
try {
|
|
74161
|
-
return mcpJson(await freshAccount("Create API key", (client, context) => client.createApiKey(
|
|
74718
|
+
return mcpJson(await freshAccount("Create API key", (client, context) => client.createApiKey(email3, code, name, capturedScopes, context)));
|
|
74162
74719
|
} catch {
|
|
74163
74720
|
return mcpError("KEY_CREATION_FAILED", "API key creation could not be confirmed. Check the selected profile and workspace keys before retrying; a lost response may still have created a key.");
|
|
74164
74721
|
}
|
|
@@ -74200,6 +74757,7 @@ async function freshAccount(action, operation) {
|
|
|
74200
74757
|
return operation(new RemoteSkillsAuthClient(target.origin), target.context);
|
|
74201
74758
|
}
|
|
74202
74759
|
var init_remote_customer_tools = __esm(() => {
|
|
74760
|
+
init_remote_invitation_tools();
|
|
74203
74761
|
init_zod();
|
|
74204
74762
|
init_remote_auth();
|
|
74205
74763
|
init_workspace_profile();
|
|
@@ -74210,6 +74768,11 @@ var init_remote_customer_tools = __esm(() => {
|
|
|
74210
74768
|
});
|
|
74211
74769
|
|
|
74212
74770
|
// src/mcp/server.ts
|
|
74771
|
+
var exports_server = {};
|
|
74772
|
+
__export(exports_server, {
|
|
74773
|
+
buildServer: () => buildServer,
|
|
74774
|
+
server: () => server
|
|
74775
|
+
});
|
|
74213
74776
|
function buildServer() {
|
|
74214
74777
|
const server = new McpServer({
|
|
74215
74778
|
name: "skills",
|
|
@@ -74236,372 +74799,11 @@ var init_server3 = __esm(() => {
|
|
|
74236
74799
|
server = buildServer();
|
|
74237
74800
|
});
|
|
74238
74801
|
|
|
74239
|
-
// ../../node_modules/.bun/@hono+node-server@1.19.17+2145b681a064c8e9/node_modules/@hono/node-server/dist/index.mjs
|
|
74240
|
-
import { Readable } from "stream";
|
|
74241
|
-
import crypto2 from "crypto";
|
|
74242
|
-
var GlobalRequest, Request, newHeadersFromIncoming = (incoming) => {
|
|
74243
|
-
const headerRecord = [];
|
|
74244
|
-
const rawHeaders = incoming.rawHeaders;
|
|
74245
|
-
for (let i = 0;i < rawHeaders.length; i += 2) {
|
|
74246
|
-
const { [i]: key, [i + 1]: value } = rawHeaders;
|
|
74247
|
-
if (key.charCodeAt(0) !== 58) {
|
|
74248
|
-
headerRecord.push([key, value]);
|
|
74249
|
-
}
|
|
74250
|
-
}
|
|
74251
|
-
return new Headers(headerRecord);
|
|
74252
|
-
}, wrapBodyStream, newRequestFromIncoming = (method2, url, headers, incoming, abortController) => {
|
|
74253
|
-
const init = {
|
|
74254
|
-
method: method2,
|
|
74255
|
-
headers,
|
|
74256
|
-
signal: abortController.signal
|
|
74257
|
-
};
|
|
74258
|
-
if (method2 === "TRACE") {
|
|
74259
|
-
init.method = "GET";
|
|
74260
|
-
const req = new Request(url, init);
|
|
74261
|
-
Object.defineProperty(req, "method", {
|
|
74262
|
-
get() {
|
|
74263
|
-
return "TRACE";
|
|
74264
|
-
}
|
|
74265
|
-
});
|
|
74266
|
-
return req;
|
|
74267
|
-
}
|
|
74268
|
-
if (!(method2 === "GET" || method2 === "HEAD")) {
|
|
74269
|
-
if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) {
|
|
74270
|
-
init.body = new ReadableStream({
|
|
74271
|
-
start(controller) {
|
|
74272
|
-
controller.enqueue(incoming.rawBody);
|
|
74273
|
-
controller.close();
|
|
74274
|
-
}
|
|
74275
|
-
});
|
|
74276
|
-
} else if (incoming[wrapBodyStream]) {
|
|
74277
|
-
let reader;
|
|
74278
|
-
init.body = new ReadableStream({
|
|
74279
|
-
async pull(controller) {
|
|
74280
|
-
try {
|
|
74281
|
-
reader ||= Readable.toWeb(incoming).getReader();
|
|
74282
|
-
const { done, value } = await reader.read();
|
|
74283
|
-
if (done) {
|
|
74284
|
-
controller.close();
|
|
74285
|
-
} else {
|
|
74286
|
-
controller.enqueue(value);
|
|
74287
|
-
}
|
|
74288
|
-
} catch (error2) {
|
|
74289
|
-
controller.error(error2);
|
|
74290
|
-
}
|
|
74291
|
-
}
|
|
74292
|
-
});
|
|
74293
|
-
} else {
|
|
74294
|
-
init.body = Readable.toWeb(incoming);
|
|
74295
|
-
}
|
|
74296
|
-
}
|
|
74297
|
-
return new Request(url, init);
|
|
74298
|
-
}, getRequestCache, requestCache, incomingKey, urlKey, headersKey, abortControllerKey, getAbortController, requestPrototype, responseCache, getResponseCache, cacheKey, GlobalResponse, Response2, outgoingEnded, incomingDraining, MAX_DRAIN_BYTES;
|
|
74299
|
-
var init_dist = __esm(() => {
|
|
74300
|
-
GlobalRequest = global.Request;
|
|
74301
|
-
Request = class extends GlobalRequest {
|
|
74302
|
-
constructor(input, options) {
|
|
74303
|
-
if (typeof input === "object" && getRequestCache in input) {
|
|
74304
|
-
input = input[getRequestCache]();
|
|
74305
|
-
}
|
|
74306
|
-
if (typeof options?.body?.getReader !== "undefined") {
|
|
74307
|
-
options.duplex ??= "half";
|
|
74308
|
-
}
|
|
74309
|
-
super(input, options);
|
|
74310
|
-
}
|
|
74311
|
-
};
|
|
74312
|
-
wrapBodyStream = Symbol("wrapBodyStream");
|
|
74313
|
-
getRequestCache = Symbol("getRequestCache");
|
|
74314
|
-
requestCache = Symbol("requestCache");
|
|
74315
|
-
incomingKey = Symbol("incomingKey");
|
|
74316
|
-
urlKey = Symbol("urlKey");
|
|
74317
|
-
headersKey = Symbol("headersKey");
|
|
74318
|
-
abortControllerKey = Symbol("abortControllerKey");
|
|
74319
|
-
getAbortController = Symbol("getAbortController");
|
|
74320
|
-
requestPrototype = {
|
|
74321
|
-
get method() {
|
|
74322
|
-
return this[incomingKey].method || "GET";
|
|
74323
|
-
},
|
|
74324
|
-
get url() {
|
|
74325
|
-
return this[urlKey];
|
|
74326
|
-
},
|
|
74327
|
-
get headers() {
|
|
74328
|
-
return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]);
|
|
74329
|
-
},
|
|
74330
|
-
[getAbortController]() {
|
|
74331
|
-
this[getRequestCache]();
|
|
74332
|
-
return this[abortControllerKey];
|
|
74333
|
-
},
|
|
74334
|
-
[getRequestCache]() {
|
|
74335
|
-
this[abortControllerKey] ||= new AbortController;
|
|
74336
|
-
return this[requestCache] ||= newRequestFromIncoming(this.method, this[urlKey], this.headers, this[incomingKey], this[abortControllerKey]);
|
|
74337
|
-
}
|
|
74338
|
-
};
|
|
74339
|
-
[
|
|
74340
|
-
"body",
|
|
74341
|
-
"bodyUsed",
|
|
74342
|
-
"cache",
|
|
74343
|
-
"credentials",
|
|
74344
|
-
"destination",
|
|
74345
|
-
"integrity",
|
|
74346
|
-
"mode",
|
|
74347
|
-
"redirect",
|
|
74348
|
-
"referrer",
|
|
74349
|
-
"referrerPolicy",
|
|
74350
|
-
"signal",
|
|
74351
|
-
"keepalive"
|
|
74352
|
-
].forEach((k) => {
|
|
74353
|
-
Object.defineProperty(requestPrototype, k, {
|
|
74354
|
-
get() {
|
|
74355
|
-
return this[getRequestCache]()[k];
|
|
74356
|
-
}
|
|
74357
|
-
});
|
|
74358
|
-
});
|
|
74359
|
-
["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => {
|
|
74360
|
-
Object.defineProperty(requestPrototype, k, {
|
|
74361
|
-
value: function() {
|
|
74362
|
-
return this[getRequestCache]()[k]();
|
|
74363
|
-
}
|
|
74364
|
-
});
|
|
74365
|
-
});
|
|
74366
|
-
Object.defineProperty(requestPrototype, Symbol.for("nodejs.util.inspect.custom"), {
|
|
74367
|
-
value: function(depth, options, inspectFn) {
|
|
74368
|
-
const props = {
|
|
74369
|
-
method: this.method,
|
|
74370
|
-
url: this.url,
|
|
74371
|
-
headers: this.headers,
|
|
74372
|
-
nativeRequest: this[requestCache]
|
|
74373
|
-
};
|
|
74374
|
-
return `Request (lightweight) ${inspectFn(props, { ...options, depth: depth == null ? null : depth - 1 })}`;
|
|
74375
|
-
}
|
|
74376
|
-
});
|
|
74377
|
-
Object.setPrototypeOf(requestPrototype, Request.prototype);
|
|
74378
|
-
responseCache = Symbol("responseCache");
|
|
74379
|
-
getResponseCache = Symbol("getResponseCache");
|
|
74380
|
-
cacheKey = Symbol("cache");
|
|
74381
|
-
GlobalResponse = global.Response;
|
|
74382
|
-
Response2 = class _Response {
|
|
74383
|
-
#body;
|
|
74384
|
-
#init;
|
|
74385
|
-
[getResponseCache]() {
|
|
74386
|
-
delete this[cacheKey];
|
|
74387
|
-
return this[responseCache] ||= new GlobalResponse(this.#body, this.#init);
|
|
74388
|
-
}
|
|
74389
|
-
constructor(body, init) {
|
|
74390
|
-
let headers;
|
|
74391
|
-
this.#body = body;
|
|
74392
|
-
if (init instanceof _Response) {
|
|
74393
|
-
const cachedGlobalResponse = init[responseCache];
|
|
74394
|
-
if (cachedGlobalResponse) {
|
|
74395
|
-
this.#init = cachedGlobalResponse;
|
|
74396
|
-
this[getResponseCache]();
|
|
74397
|
-
return;
|
|
74398
|
-
} else {
|
|
74399
|
-
this.#init = init.#init;
|
|
74400
|
-
headers = new Headers(init.#init.headers);
|
|
74401
|
-
}
|
|
74402
|
-
} else {
|
|
74403
|
-
this.#init = init;
|
|
74404
|
-
}
|
|
74405
|
-
if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) {
|
|
74406
|
-
this[cacheKey] = [init?.status || 200, body, headers || init?.headers];
|
|
74407
|
-
}
|
|
74408
|
-
}
|
|
74409
|
-
get headers() {
|
|
74410
|
-
const cache3 = this[cacheKey];
|
|
74411
|
-
if (cache3) {
|
|
74412
|
-
if (!(cache3[2] instanceof Headers)) {
|
|
74413
|
-
cache3[2] = new Headers(cache3[2] || { "content-type": "text/plain; charset=UTF-8" });
|
|
74414
|
-
}
|
|
74415
|
-
return cache3[2];
|
|
74416
|
-
}
|
|
74417
|
-
return this[getResponseCache]().headers;
|
|
74418
|
-
}
|
|
74419
|
-
get status() {
|
|
74420
|
-
return this[cacheKey]?.[0] ?? this[getResponseCache]().status;
|
|
74421
|
-
}
|
|
74422
|
-
get ok() {
|
|
74423
|
-
const status = this.status;
|
|
74424
|
-
return status >= 200 && status < 300;
|
|
74425
|
-
}
|
|
74426
|
-
};
|
|
74427
|
-
["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => {
|
|
74428
|
-
Object.defineProperty(Response2.prototype, k, {
|
|
74429
|
-
get() {
|
|
74430
|
-
return this[getResponseCache]()[k];
|
|
74431
|
-
}
|
|
74432
|
-
});
|
|
74433
|
-
});
|
|
74434
|
-
["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => {
|
|
74435
|
-
Object.defineProperty(Response2.prototype, k, {
|
|
74436
|
-
value: function() {
|
|
74437
|
-
return this[getResponseCache]()[k]();
|
|
74438
|
-
}
|
|
74439
|
-
});
|
|
74440
|
-
});
|
|
74441
|
-
Object.defineProperty(Response2.prototype, Symbol.for("nodejs.util.inspect.custom"), {
|
|
74442
|
-
value: function(depth, options, inspectFn) {
|
|
74443
|
-
const props = {
|
|
74444
|
-
status: this.status,
|
|
74445
|
-
headers: this.headers,
|
|
74446
|
-
ok: this.ok,
|
|
74447
|
-
nativeResponse: this[responseCache]
|
|
74448
|
-
};
|
|
74449
|
-
return `Response (lightweight) ${inspectFn(props, { ...options, depth: depth == null ? null : depth - 1 })}`;
|
|
74450
|
-
}
|
|
74451
|
-
});
|
|
74452
|
-
Object.setPrototypeOf(Response2, GlobalResponse);
|
|
74453
|
-
Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype);
|
|
74454
|
-
if (typeof global.crypto === "undefined") {
|
|
74455
|
-
global.crypto = crypto2;
|
|
74456
|
-
}
|
|
74457
|
-
outgoingEnded = Symbol("outgoingEnded");
|
|
74458
|
-
incomingDraining = Symbol("incomingDraining");
|
|
74459
|
-
MAX_DRAIN_BYTES = 64 * 1024 * 1024;
|
|
74460
|
-
});
|
|
74461
|
-
|
|
74462
|
-
// ../../node_modules/.bun/content-type@1.0.5/node_modules/content-type/index.js
|
|
74463
|
-
var require_content_type = __commonJS((exports) => {
|
|
74464
|
-
/*!
|
|
74465
|
-
* content-type
|
|
74466
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
74467
|
-
* MIT Licensed
|
|
74468
|
-
*/
|
|
74469
|
-
var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;
|
|
74470
|
-
var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/;
|
|
74471
|
-
var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
74472
|
-
var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g;
|
|
74473
|
-
var QUOTE_REGEXP = /([\\"])/g;
|
|
74474
|
-
var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
74475
|
-
exports.format = format;
|
|
74476
|
-
exports.parse = parse6;
|
|
74477
|
-
function format(obj) {
|
|
74478
|
-
if (!obj || typeof obj !== "object") {
|
|
74479
|
-
throw new TypeError("argument obj is required");
|
|
74480
|
-
}
|
|
74481
|
-
var parameters = obj.parameters;
|
|
74482
|
-
var type = obj.type;
|
|
74483
|
-
if (!type || !TYPE_REGEXP.test(type)) {
|
|
74484
|
-
throw new TypeError("invalid type");
|
|
74485
|
-
}
|
|
74486
|
-
var string5 = type;
|
|
74487
|
-
if (parameters && typeof parameters === "object") {
|
|
74488
|
-
var param;
|
|
74489
|
-
var params = Object.keys(parameters).sort();
|
|
74490
|
-
for (var i = 0;i < params.length; i++) {
|
|
74491
|
-
param = params[i];
|
|
74492
|
-
if (!TOKEN_REGEXP.test(param)) {
|
|
74493
|
-
throw new TypeError("invalid parameter name");
|
|
74494
|
-
}
|
|
74495
|
-
string5 += "; " + param + "=" + qstring(parameters[param]);
|
|
74496
|
-
}
|
|
74497
|
-
}
|
|
74498
|
-
return string5;
|
|
74499
|
-
}
|
|
74500
|
-
function parse6(string5) {
|
|
74501
|
-
if (!string5) {
|
|
74502
|
-
throw new TypeError("argument string is required");
|
|
74503
|
-
}
|
|
74504
|
-
var header = typeof string5 === "object" ? getcontenttype(string5) : string5;
|
|
74505
|
-
if (typeof header !== "string") {
|
|
74506
|
-
throw new TypeError("argument string is required to be a string");
|
|
74507
|
-
}
|
|
74508
|
-
var index = header.indexOf(";");
|
|
74509
|
-
var type = index !== -1 ? header.slice(0, index).trim() : header.trim();
|
|
74510
|
-
if (!TYPE_REGEXP.test(type)) {
|
|
74511
|
-
throw new TypeError("invalid media type");
|
|
74512
|
-
}
|
|
74513
|
-
var obj = new ContentType(type.toLowerCase());
|
|
74514
|
-
if (index !== -1) {
|
|
74515
|
-
var key;
|
|
74516
|
-
var match;
|
|
74517
|
-
var value;
|
|
74518
|
-
PARAM_REGEXP.lastIndex = index;
|
|
74519
|
-
while (match = PARAM_REGEXP.exec(header)) {
|
|
74520
|
-
if (match.index !== index) {
|
|
74521
|
-
throw new TypeError("invalid parameter format");
|
|
74522
|
-
}
|
|
74523
|
-
index += match[0].length;
|
|
74524
|
-
key = match[1].toLowerCase();
|
|
74525
|
-
value = match[2];
|
|
74526
|
-
if (value.charCodeAt(0) === 34) {
|
|
74527
|
-
value = value.slice(1, -1);
|
|
74528
|
-
if (value.indexOf("\\") !== -1) {
|
|
74529
|
-
value = value.replace(QESC_REGEXP, "$1");
|
|
74530
|
-
}
|
|
74531
|
-
}
|
|
74532
|
-
obj.parameters[key] = value;
|
|
74533
|
-
}
|
|
74534
|
-
if (index !== header.length) {
|
|
74535
|
-
throw new TypeError("invalid parameter format");
|
|
74536
|
-
}
|
|
74537
|
-
}
|
|
74538
|
-
return obj;
|
|
74539
|
-
}
|
|
74540
|
-
function getcontenttype(obj) {
|
|
74541
|
-
var header;
|
|
74542
|
-
if (typeof obj.getHeader === "function") {
|
|
74543
|
-
header = obj.getHeader("content-type");
|
|
74544
|
-
} else if (typeof obj.headers === "object") {
|
|
74545
|
-
header = obj.headers && obj.headers["content-type"];
|
|
74546
|
-
}
|
|
74547
|
-
if (typeof header !== "string") {
|
|
74548
|
-
throw new TypeError("content-type header is missing from object");
|
|
74549
|
-
}
|
|
74550
|
-
return header;
|
|
74551
|
-
}
|
|
74552
|
-
function qstring(val) {
|
|
74553
|
-
var str2 = String(val);
|
|
74554
|
-
if (TOKEN_REGEXP.test(str2)) {
|
|
74555
|
-
return str2;
|
|
74556
|
-
}
|
|
74557
|
-
if (str2.length > 0 && !TEXT_REGEXP.test(str2)) {
|
|
74558
|
-
throw new TypeError("invalid parameter value");
|
|
74559
|
-
}
|
|
74560
|
-
return '"' + str2.replace(QUOTE_REGEXP, "\\$1") + '"';
|
|
74561
|
-
}
|
|
74562
|
-
function ContentType(type) {
|
|
74563
|
-
this.parameters = Object.create(null);
|
|
74564
|
-
this.type = type;
|
|
74565
|
-
}
|
|
74566
|
-
});
|
|
74567
|
-
|
|
74568
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js
|
|
74569
|
-
var import_content_type;
|
|
74570
|
-
var init_mediaType = __esm(() => {
|
|
74571
|
-
import_content_type = __toESM(require_content_type(), 1);
|
|
74572
|
-
});
|
|
74573
|
-
|
|
74574
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js
|
|
74575
|
-
var MAX_TIMER_DELAY_MS;
|
|
74576
|
-
var init_sseKeepAlive = __esm(() => {
|
|
74577
|
-
MAX_TIMER_DELAY_MS = 2 ** 31 - 1;
|
|
74578
|
-
});
|
|
74579
|
-
|
|
74580
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js
|
|
74581
|
-
var init_webStandardStreamableHttp = __esm(() => {
|
|
74582
|
-
init_mediaType();
|
|
74583
|
-
init_sseKeepAlive();
|
|
74584
|
-
init_types2();
|
|
74585
|
-
});
|
|
74586
|
-
|
|
74587
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js
|
|
74588
|
-
var init_streamableHttp = __esm(() => {
|
|
74589
|
-
init_dist();
|
|
74590
|
-
init_webStandardStreamableHttp();
|
|
74591
|
-
});
|
|
74592
|
-
|
|
74593
|
-
// src/mcp/http.ts
|
|
74594
|
-
var init_http = __esm(() => {
|
|
74595
|
-
init_streamableHttp();
|
|
74596
|
-
init_server3();
|
|
74597
|
-
});
|
|
74598
|
-
|
|
74599
74802
|
// src/mcp/index.ts
|
|
74600
74803
|
var exports_mcp = {};
|
|
74601
74804
|
__export(exports_mcp, {
|
|
74602
|
-
|
|
74603
|
-
|
|
74604
|
-
assertSkillsMcpConfigured: () => assertSkillsMcpConfigured
|
|
74805
|
+
assertSkillsMcpConfigured: () => assertSkillsMcpConfigured,
|
|
74806
|
+
startMcpStdio: () => startMcpStdio
|
|
74605
74807
|
});
|
|
74606
74808
|
function printHelp() {
|
|
74607
74809
|
console.log(`Usage: skills-mcp [options]
|
|
@@ -74611,6 +74813,7 @@ MCP server for ${package_default.name}
|
|
|
74611
74813
|
Options:
|
|
74612
74814
|
-V, --version output the version number
|
|
74613
74815
|
-h, --help display help for command
|
|
74816
|
+
--invitation-recovery --stdio expose only anonymous invitation recovery tools
|
|
74614
74817
|
--stdio run newline-delimited JSON-RPC for agent hosts
|
|
74615
74818
|
--http run Streamable HTTP transport on 127.0.0.1 (default; port 8836)
|
|
74616
74819
|
--port <n> HTTP port (--http or MCP_HTTP=1)`);
|
|
@@ -74627,23 +74830,21 @@ function assertSkillsMcpConfigured(env3 = process.env) {
|
|
|
74627
74830
|
}
|
|
74628
74831
|
async function startMcpStdio() {
|
|
74629
74832
|
assertSkillsMcpConfigured();
|
|
74630
|
-
const
|
|
74833
|
+
const { buildServer: buildServer2 } = await Promise.resolve().then(() => (init_server3(), exports_server));
|
|
74834
|
+
const server2 = buildServer2();
|
|
74631
74835
|
await server2.connect(new StdioServerTransport);
|
|
74632
74836
|
}
|
|
74633
74837
|
var args;
|
|
74634
74838
|
var init_mcp2 = __esm(() => {
|
|
74635
74839
|
init_stdio2();
|
|
74636
74840
|
init_package();
|
|
74637
|
-
init_server3();
|
|
74638
|
-
init_http();
|
|
74639
74841
|
init_fleet_credentials();
|
|
74640
|
-
init_server3();
|
|
74641
74842
|
args = process.argv.slice(2);
|
|
74642
|
-
if (args.includes("--help") || args.includes("-h")) {
|
|
74843
|
+
if (!args.some((value) => value.startsWith("--invitation-recovery")) && (args.includes("--help") || args.includes("-h"))) {
|
|
74643
74844
|
printHelp();
|
|
74644
74845
|
process.exit(0);
|
|
74645
74846
|
}
|
|
74646
|
-
if (args.includes("--version") || args.includes("-V")) {
|
|
74847
|
+
if (!args.some((value) => value.startsWith("--invitation-recovery")) && (args.includes("--version") || args.includes("-V"))) {
|
|
74647
74848
|
console.log(package_default.version);
|
|
74648
74849
|
process.exit(0);
|
|
74649
74850
|
}
|
|
@@ -74876,8 +75077,8 @@ var init_runtime_mcp = __esm(() => {
|
|
|
74876
75077
|
// src/cli/commands/remote-account.ts
|
|
74877
75078
|
var exports_remote_account = {};
|
|
74878
75079
|
__export(exports_remote_account, {
|
|
74879
|
-
|
|
74880
|
-
|
|
75080
|
+
execute: () => execute,
|
|
75081
|
+
registerRemoteAccount: () => registerRemoteAccount
|
|
74881
75082
|
});
|
|
74882
75083
|
function registerRemoteAccount(parent) {
|
|
74883
75084
|
parent.command("capabilities").option("--json", "Output as JSON", false).description("Inspect the selected server's supported API contract").action((options) => execute(options, (client) => client.getCapabilities()));
|
|
@@ -74904,7 +75105,7 @@ async function execute(options, action) {
|
|
|
74904
75105
|
if (options.json)
|
|
74905
75106
|
console.log(JSON.stringify({
|
|
74906
75107
|
error: message,
|
|
74907
|
-
...error2 instanceof RemoteCapabilityUnavailableError ? { code: error2.code, status: error2.status } : {}
|
|
75108
|
+
...error2 instanceof RemoteCapabilityUnavailableError || error2 instanceof RemoteQuoteUnavailableError ? { code: error2.code, status: error2.status } : {}
|
|
74908
75109
|
}));
|
|
74909
75110
|
else
|
|
74910
75111
|
console.error(message);
|
|
@@ -77471,9 +77672,9 @@ var init_registry_sync = __esm(() => {
|
|
|
77471
77672
|
// src/cli/commands/registry.ts
|
|
77472
77673
|
var exports_registry2 = {};
|
|
77473
77674
|
__export(exports_registry2, {
|
|
77474
|
-
|
|
77675
|
+
registerPull: () => registerPull,
|
|
77475
77676
|
registerRegistry: () => registerRegistry,
|
|
77476
|
-
|
|
77677
|
+
registerVersions: () => registerVersions
|
|
77477
77678
|
});
|
|
77478
77679
|
function registerRegistry(parent) {
|
|
77479
77680
|
const registry2 = parent.command("registry").description("Generate registry artifacts for hosted skills services");
|
|
@@ -77515,10 +77716,10 @@ async function handleRegistrySync(options) {
|
|
|
77515
77716
|
await writeJson2(artifact, 2);
|
|
77516
77717
|
return;
|
|
77517
77718
|
}
|
|
77518
|
-
const
|
|
77719
|
+
const invalid3 = artifact.summary.invalidSkillCount ?? "not checked";
|
|
77519
77720
|
console.log(source_default.green(`Registry sync artifact written to ${options.output}`));
|
|
77520
77721
|
console.log(source_default.dim(` Skills: ${artifact.summary.skillCount}`));
|
|
77521
|
-
console.log(source_default.dim(` Invalid: ${
|
|
77722
|
+
console.log(source_default.dim(` Invalid: ${invalid3}`));
|
|
77522
77723
|
}
|
|
77523
77724
|
function registerPull(parent) {
|
|
77524
77725
|
parent.command("pull").argument("[names...]", "Skills to pull from the configured instance (name or name@version)").option("--all", "Pull every skill the instance serves", false).option("--for-machine", "Prepare this machine with the instance's full catalog (implies --all)", false).option("--json", "Output results as JSON", false).description("Fetch skills from the configured Skills instance into this machine's corpus").action(async (names, options) => {
|
|
@@ -77615,12 +77816,12 @@ var init_registry2 = __esm(() => {
|
|
|
77615
77816
|
// src/cli/commands/publish.ts
|
|
77616
77817
|
var exports_publish = {};
|
|
77617
77818
|
__export(exports_publish, {
|
|
77618
|
-
|
|
77619
|
-
registerPublish: () => registerPublish,
|
|
77620
|
-
pushSkill: () => pushSkill,
|
|
77621
|
-
bumpPatch: () => bumpPatch,
|
|
77819
|
+
PushSkillError: () => PushSkillError,
|
|
77622
77820
|
buildVersionManifest: () => buildVersionManifest,
|
|
77623
|
-
|
|
77821
|
+
bumpPatch: () => bumpPatch,
|
|
77822
|
+
pushSkill: () => pushSkill,
|
|
77823
|
+
registerPublish: () => registerPublish,
|
|
77824
|
+
sanitizeGitRemote: () => sanitizeGitRemote
|
|
77624
77825
|
});
|
|
77625
77826
|
import { execFileSync } from "child_process";
|
|
77626
77827
|
import { existsSync as existsSync32, readFileSync as readFileSync30 } from "fs";
|
|
@@ -77738,21 +77939,21 @@ async function readPublishRevision(client, slug) {
|
|
|
77738
77939
|
throw new PushSkillError("Publishing was refused because the current skill revision could not be verified.", ["Check the configured instance and connection, then retry the push. No upload was attempted."]);
|
|
77739
77940
|
}
|
|
77740
77941
|
const body = lookup.body;
|
|
77741
|
-
const
|
|
77742
|
-
const nestedError =
|
|
77743
|
-
const code = typeof
|
|
77942
|
+
const record7 = body !== null && typeof body === "object" && !Array.isArray(body) ? body : undefined;
|
|
77943
|
+
const nestedError = record7?.error;
|
|
77944
|
+
const code = typeof record7?.code === "string" ? record7.code : nestedError !== null && typeof nestedError === "object" && !Array.isArray(nestedError) ? nestedError.code : undefined;
|
|
77744
77945
|
if (lookup.status === 404 && code === "SKILL_NOT_FOUND")
|
|
77745
77946
|
return;
|
|
77746
77947
|
if (lookup.status < 200 || lookup.status >= 300) {
|
|
77747
77948
|
throw new PushSkillError(`Publishing was refused because the current skill lookup failed: HTTP ${lookup.status}.`, ["Only an explicit SKILL_NOT_FOUND response establishes an initial publish. Check access and server compatibility before retrying."]);
|
|
77748
77949
|
}
|
|
77749
|
-
const revision =
|
|
77750
|
-
if (
|
|
77751
|
-
if (
|
|
77950
|
+
const revision = record7?.revisionId;
|
|
77951
|
+
if (record7?.publicationState === "catalogue-only") {
|
|
77952
|
+
if (record7.name === slug && (record7.slug === undefined || record7.slug === slug) && revision === null)
|
|
77752
77953
|
return;
|
|
77753
77954
|
throw new PushSkillError("Publishing was refused because the catalogue-only response had contradictory identity or revision state.", ["Check the configured instance and server compatibility. No upload was attempted."]);
|
|
77754
77955
|
}
|
|
77755
|
-
if (
|
|
77956
|
+
if (record7?.slug !== slug || typeof revision !== "string" || revision.length === 0 || revision !== revision.trim() || !/^[\x21-\x7e]+$/.test(revision)) {
|
|
77756
77957
|
throw new PushSkillError("Publishing was refused because the current skill response did not contain a matching slug and valid revision.", ["Check the configured instance and server compatibility. No upload was attempted."]);
|
|
77757
77958
|
}
|
|
77758
77959
|
return revision;
|
|
@@ -78126,22 +78327,22 @@ function authIdentityPayload(authSource, live, cached2, offline = false) {
|
|
|
78126
78327
|
const data = recordField(root.data);
|
|
78127
78328
|
const user = recordField(root.user) ?? recordField(data?.user);
|
|
78128
78329
|
const organization2 = recordField(root.organization) ?? recordField(root.org) ?? recordField(data?.organization);
|
|
78129
|
-
const
|
|
78330
|
+
const email3 = stringField2(user?.email) ?? cached2?.email;
|
|
78130
78331
|
const orgSlug = stringField2(organization2?.slug) ?? cached2?.orgSlug;
|
|
78131
78332
|
const orgName = stringField2(organization2?.name);
|
|
78132
78333
|
const userId = stringField2(user?.id) ?? cached2?.userId;
|
|
78133
78334
|
const orgId = stringField2(organization2?.id) ?? cached2?.orgId;
|
|
78134
|
-
const
|
|
78335
|
+
const role3 = stringField2(user?.role);
|
|
78135
78336
|
return {
|
|
78136
78337
|
status: "authenticated",
|
|
78137
78338
|
authSource,
|
|
78138
78339
|
...offline ? { offline: true } : {},
|
|
78139
|
-
...
|
|
78340
|
+
...email3 ? { email: email3 } : {},
|
|
78140
78341
|
...orgSlug ? { organization: orgSlug } : {},
|
|
78141
78342
|
...orgName ? { organizationName: orgName } : {},
|
|
78142
78343
|
...userId ? { userId } : {},
|
|
78143
78344
|
...orgId ? { orgId } : {},
|
|
78144
|
-
...
|
|
78345
|
+
...role3 ? { role: role3 } : {}
|
|
78145
78346
|
};
|
|
78146
78347
|
}
|
|
78147
78348
|
function printWhoami(payload) {
|
|
@@ -78218,7 +78419,7 @@ function printLoginSuccess(loginResult, json) {
|
|
|
78218
78419
|
console.log(source_default.dim(` API key saved to ${getAuthFilePath()}`));
|
|
78219
78420
|
}
|
|
78220
78421
|
}
|
|
78221
|
-
async function doLogin(
|
|
78422
|
+
async function doLogin(email3, code, json) {
|
|
78222
78423
|
const env3 = { ...process.env };
|
|
78223
78424
|
let origin;
|
|
78224
78425
|
try {
|
|
@@ -78227,7 +78428,7 @@ async function doLogin(email2, code, json) {
|
|
|
78227
78428
|
writeCommandError(error2, "Configure a Skills API before signing in", json);
|
|
78228
78429
|
return;
|
|
78229
78430
|
}
|
|
78230
|
-
if (!
|
|
78431
|
+
if (!email3 || !email3.includes("@")) {
|
|
78231
78432
|
writeCommandError(new Error("Invalid email"), "Invalid email", json);
|
|
78232
78433
|
process.exitCode = 1;
|
|
78233
78434
|
return;
|
|
@@ -78239,7 +78440,7 @@ async function doLogin(email2, code, json) {
|
|
|
78239
78440
|
try {
|
|
78240
78441
|
sendRes = await apiRequest("/api/auth/login", {
|
|
78241
78442
|
method: "POST",
|
|
78242
|
-
body: JSON.stringify({ email:
|
|
78443
|
+
body: JSON.stringify({ email: email3 })
|
|
78243
78444
|
}, origin);
|
|
78244
78445
|
} catch (err) {
|
|
78245
78446
|
writeCommandError(err, "Failed to request login code", json);
|
|
@@ -78250,9 +78451,9 @@ async function doLogin(email2, code, json) {
|
|
|
78250
78451
|
return;
|
|
78251
78452
|
}
|
|
78252
78453
|
if (!json)
|
|
78253
|
-
console.log(source_default.green("\u2713 Code sent to " +
|
|
78454
|
+
console.log(source_default.green("\u2713 Code sent to " + email3));
|
|
78254
78455
|
if (json || !isTTY) {
|
|
78255
|
-
console.log(JSON.stringify({ status: "code_sent", email:
|
|
78456
|
+
console.log(JSON.stringify({ status: "code_sent", email: email3, message: "Check email for 6-digit code, then run: skills auth login --email " + email3 + " --code <CODE>" }));
|
|
78256
78457
|
return;
|
|
78257
78458
|
}
|
|
78258
78459
|
const answer = await prompt(source_default.bold("Code: "));
|
|
@@ -78264,7 +78465,7 @@ async function doLogin(email2, code, json) {
|
|
|
78264
78465
|
try {
|
|
78265
78466
|
verifyRes = await apiRequest("/api/auth/verify", {
|
|
78266
78467
|
method: "POST",
|
|
78267
|
-
body: JSON.stringify({ email:
|
|
78468
|
+
body: JSON.stringify({ email: email3, code })
|
|
78268
78469
|
}, origin);
|
|
78269
78470
|
} catch (err) {
|
|
78270
78471
|
writeCommandError(err, "Failed to verify login code", json);
|
|
@@ -78311,13 +78512,13 @@ async function doApiKeyLogin(apiKey, json) {
|
|
|
78311
78512
|
return;
|
|
78312
78513
|
}
|
|
78313
78514
|
const identity2 = authIdentityPayload("stored", whoami);
|
|
78314
|
-
const
|
|
78515
|
+
const email3 = stringField2(identity2.email);
|
|
78315
78516
|
const orgId = stringField2(identity2.orgId);
|
|
78316
78517
|
const orgSlug = stringField2(identity2.organization);
|
|
78317
78518
|
const userId = stringField2(identity2.userId);
|
|
78318
78519
|
saveAuthConfig({
|
|
78319
78520
|
apiKey: trimmed,
|
|
78320
|
-
...
|
|
78521
|
+
...email3 ? { email: email3 } : {},
|
|
78321
78522
|
...orgId ? { orgId } : {},
|
|
78322
78523
|
...orgSlug ? { orgSlug } : {},
|
|
78323
78524
|
...userId ? { userId } : {}
|
|
@@ -78487,8 +78688,8 @@ function registerAuth(parent) {
|
|
|
78487
78688
|
await doDeviceLogin(options);
|
|
78488
78689
|
return;
|
|
78489
78690
|
}
|
|
78490
|
-
let
|
|
78491
|
-
if (!
|
|
78691
|
+
let email3 = options.email;
|
|
78692
|
+
if (!email3 && isTTY && !options.json) {
|
|
78492
78693
|
const existing = authForPrompt();
|
|
78493
78694
|
if (existing) {
|
|
78494
78695
|
console.log(source_default.dim(`Already signed in as ${existing.email}`));
|
|
@@ -78499,17 +78700,17 @@ function registerAuth(parent) {
|
|
|
78499
78700
|
const answer = await prompt(source_default.bold("Email: "));
|
|
78500
78701
|
if (answer === null)
|
|
78501
78702
|
return;
|
|
78502
|
-
|
|
78703
|
+
email3 = answer;
|
|
78503
78704
|
}
|
|
78504
|
-
if (!
|
|
78705
|
+
if (!email3) {
|
|
78505
78706
|
writeCommandError(new Error("Email required. Use: skills auth login --email you@example.com"), "Email required", options.json);
|
|
78506
78707
|
return;
|
|
78507
78708
|
}
|
|
78508
|
-
await doLogin(
|
|
78709
|
+
await doLogin(email3, options.code, options.json);
|
|
78509
78710
|
});
|
|
78510
78711
|
auth.command("signup").description("Create or sign in with your email (passwordless)").option("--email <email>", "Email address (non-interactive)").option("--code <code>", "Verification code (non-interactive)").option("--json", "Output result as JSON without prompting", false).action(async (options) => {
|
|
78511
|
-
let
|
|
78512
|
-
if (!
|
|
78712
|
+
let email3 = options.email;
|
|
78713
|
+
if (!email3 && isTTY && !options.json) {
|
|
78513
78714
|
const existing = authForPrompt();
|
|
78514
78715
|
if (existing) {
|
|
78515
78716
|
console.log(source_default.dim(`Already signed in as ${existing.email}`));
|
|
@@ -78520,9 +78721,9 @@ function registerAuth(parent) {
|
|
|
78520
78721
|
const answer = await prompt(source_default.bold("Email: "));
|
|
78521
78722
|
if (answer === null)
|
|
78522
78723
|
return;
|
|
78523
|
-
|
|
78724
|
+
email3 = answer;
|
|
78524
78725
|
}
|
|
78525
|
-
if (!
|
|
78726
|
+
if (!email3) {
|
|
78526
78727
|
const error2 = "Email required. Use: skills auth signup --email you@example.com";
|
|
78527
78728
|
if (options.json)
|
|
78528
78729
|
console.log(JSON.stringify({ error: error2 }));
|
|
@@ -78531,7 +78732,7 @@ function registerAuth(parent) {
|
|
|
78531
78732
|
process.exitCode = 1;
|
|
78532
78733
|
return;
|
|
78533
78734
|
}
|
|
78534
|
-
await doLogin(
|
|
78735
|
+
await doLogin(email3, options.code, options.json);
|
|
78535
78736
|
});
|
|
78536
78737
|
auth.command("logout").description("Remove this profile's stored credentials; injected keys remain configured").option("--json", "Output as JSON", false).action((options) => {
|
|
78537
78738
|
const { stillResolves } = clearAuthConfig();
|
|
@@ -78597,6 +78798,285 @@ var init_auth = __esm(() => {
|
|
|
78597
78798
|
CONFIG_HINT_STATUSES = new Set([401, 403, 404, 405, 501]);
|
|
78598
78799
|
});
|
|
78599
78800
|
|
|
78801
|
+
// src/lib/invitation-recovery-target.ts
|
|
78802
|
+
function prepareInvitationRecoveryTarget(source = process.env) {
|
|
78803
|
+
const env3 = { ...source }, names = ["HASNA_SKILLS_API_URL", "SKILLS_API_URL"];
|
|
78804
|
+
const urls = names.map((name) => env3[name]?.trim()).filter((value) => !!value);
|
|
78805
|
+
if (!urls.length)
|
|
78806
|
+
throw new InvitationEmailInputError;
|
|
78807
|
+
let origin;
|
|
78808
|
+
try {
|
|
78809
|
+
const normalized = urls.map(normalizeSkillsApiOrigin);
|
|
78810
|
+
if (normalized.some((value) => value !== normalized[0]))
|
|
78811
|
+
throw new InvitationEmailInputError;
|
|
78812
|
+
origin = normalized[0];
|
|
78813
|
+
} catch {
|
|
78814
|
+
throw new InvitationEmailInputError;
|
|
78815
|
+
}
|
|
78816
|
+
const unchangedFiles = captureSkillsCredentialFiles(skillsProfileCredentialFiles(env3));
|
|
78817
|
+
return { origin, unchanged() {
|
|
78818
|
+
unchangedFiles();
|
|
78819
|
+
if ([...names, "HASNA_PROFILE", "HASNA_HOME", "HOME"].some((name) => source[name] !== env3[name]))
|
|
78820
|
+
throw new InvitationEmailInputError;
|
|
78821
|
+
} };
|
|
78822
|
+
}
|
|
78823
|
+
var init_invitation_recovery_target = __esm(() => {
|
|
78824
|
+
init_fleet_credentials();
|
|
78825
|
+
init_instance_credentials();
|
|
78826
|
+
init_remote_invitation_recovery();
|
|
78827
|
+
});
|
|
78828
|
+
|
|
78829
|
+
// src/cli/commands/invitation-verification.ts
|
|
78830
|
+
import { emitKeypressEvents as emitKeypressEvents2 } from "readline";
|
|
78831
|
+
async function readInvitationSecrets() {
|
|
78832
|
+
if (process.stdin.isTTY)
|
|
78833
|
+
throw new NameInputError("Pipe the six-digit code and invitation token on two separate lines with --secrets-stdin.");
|
|
78834
|
+
let text2 = "";
|
|
78835
|
+
for await (const chunk2 of process.stdin) {
|
|
78836
|
+
text2 += chunk2.toString();
|
|
78837
|
+
if (text2.length > 64)
|
|
78838
|
+
throw new NameInputError("Supply only the code and invitation token on two separate lines.");
|
|
78839
|
+
}
|
|
78840
|
+
const matched = /^(\d{6})\r?\n([A-Za-z0-9_-]{43})(?:\r?\n)?$/.exec(text2);
|
|
78841
|
+
if (!matched)
|
|
78842
|
+
throw new NameInputError("Supply only the code and invitation token on two separate lines.");
|
|
78843
|
+
return { code: matched[1], token: matched[2] };
|
|
78844
|
+
}
|
|
78845
|
+
function promptInvitationToken() {
|
|
78846
|
+
return promptInvitationProof("token");
|
|
78847
|
+
}
|
|
78848
|
+
function promptInvitationRecoveryCode() {
|
|
78849
|
+
return promptInvitationProof("code");
|
|
78850
|
+
}
|
|
78851
|
+
function promptInvitationProof(kind) {
|
|
78852
|
+
const length = kind === "token" ? 43 : 6;
|
|
78853
|
+
const label = kind === "token" ? "invitation token" : "recovery code";
|
|
78854
|
+
const character = kind === "token" ? /^[A-Za-z0-9_-]$/ : /^\d$/;
|
|
78855
|
+
const { stdin, stderr: output } = process, wasRaw = stdin.isRaw, wasFlowing = stdin.readableFlowing;
|
|
78856
|
+
return new Promise((resolve5) => {
|
|
78857
|
+
let value = "", settled = false, overflow = false;
|
|
78858
|
+
const finish = (answer) => {
|
|
78859
|
+
if (settled)
|
|
78860
|
+
return;
|
|
78861
|
+
settled = true;
|
|
78862
|
+
clearTimeout(timer);
|
|
78863
|
+
stdin.off("keypress", keypress);
|
|
78864
|
+
stdin.off("end", cancel);
|
|
78865
|
+
process.off("SIGINT", cancel);
|
|
78866
|
+
stdin.setRawMode(wasRaw);
|
|
78867
|
+
if (wasFlowing !== true)
|
|
78868
|
+
stdin.pause();
|
|
78869
|
+
output.write(`
|
|
78870
|
+
`);
|
|
78871
|
+
if (answer === null)
|
|
78872
|
+
process.exitCode = 130;
|
|
78873
|
+
resolve5(answer);
|
|
78874
|
+
};
|
|
78875
|
+
const cancel = () => finish(null);
|
|
78876
|
+
const keypress = (text2, key) => {
|
|
78877
|
+
if (key.ctrl && ["c", "d"].includes(key.name ?? "") || key.name === "escape")
|
|
78878
|
+
return cancel();
|
|
78879
|
+
if (key.name === "return" || key.name === "enter") {
|
|
78880
|
+
if (overflow) {
|
|
78881
|
+
value = "";
|
|
78882
|
+
overflow = false;
|
|
78883
|
+
output.write(`
|
|
78884
|
+
Enter exactly ${length} ${label} characters: `);
|
|
78885
|
+
return;
|
|
78886
|
+
}
|
|
78887
|
+
if (value.length === length)
|
|
78888
|
+
return finish(value);
|
|
78889
|
+
output.write(`
|
|
78890
|
+
Enter the complete ${label}: `);
|
|
78891
|
+
value = "";
|
|
78892
|
+
return;
|
|
78893
|
+
}
|
|
78894
|
+
if (overflow)
|
|
78895
|
+
return;
|
|
78896
|
+
if (key.name === "backspace") {
|
|
78897
|
+
if (value) {
|
|
78898
|
+
value = value.slice(0, -1);
|
|
78899
|
+
output.write("\b \b");
|
|
78900
|
+
}
|
|
78901
|
+
} else if (character.test(text2)) {
|
|
78902
|
+
if (value.length === length) {
|
|
78903
|
+
overflow = true;
|
|
78904
|
+
output.write(`
|
|
78905
|
+
The ${label} is too long. Press Enter to start again.`);
|
|
78906
|
+
} else {
|
|
78907
|
+
value += text2;
|
|
78908
|
+
output.write("*");
|
|
78909
|
+
}
|
|
78910
|
+
} else if (text2 && !key.ctrl && !key.meta) {
|
|
78911
|
+
overflow = true;
|
|
78912
|
+
output.write(`
|
|
78913
|
+
The ${label} contains invalid characters. Press Enter to start again.`);
|
|
78914
|
+
}
|
|
78915
|
+
};
|
|
78916
|
+
const timer = setTimeout(cancel, 5 * 60 * 1000);
|
|
78917
|
+
emitKeypressEvents2(stdin);
|
|
78918
|
+
stdin.setRawMode(true);
|
|
78919
|
+
stdin.on("keypress", keypress);
|
|
78920
|
+
stdin.once("end", cancel);
|
|
78921
|
+
process.once("SIGINT", cancel);
|
|
78922
|
+
output.write(kind === "token" ? "Enter the invitation token from your email: " : "Enter the six-digit recovery code from your email: ");
|
|
78923
|
+
stdin.resume();
|
|
78924
|
+
});
|
|
78925
|
+
}
|
|
78926
|
+
var init_invitation_verification = __esm(() => {
|
|
78927
|
+
init_customer_verification();
|
|
78928
|
+
});
|
|
78929
|
+
|
|
78930
|
+
// src/cli/commands/invitation-recovery.ts
|
|
78931
|
+
async function readToken() {
|
|
78932
|
+
if (process.stdin.isTTY)
|
|
78933
|
+
throw new InvitationEmailInputError;
|
|
78934
|
+
let value = "";
|
|
78935
|
+
for await (const chunk2 of process.stdin) {
|
|
78936
|
+
value += chunk2.toString();
|
|
78937
|
+
if (value.length > 45)
|
|
78938
|
+
throw new InvitationEmailInputError;
|
|
78939
|
+
}
|
|
78940
|
+
const matched = /^([A-Za-z0-9_-]{43})(?:\r?\n)?$/.exec(value);
|
|
78941
|
+
if (!matched)
|
|
78942
|
+
throw new InvitationEmailInputError;
|
|
78943
|
+
return matched[1];
|
|
78944
|
+
}
|
|
78945
|
+
function registerInvitationRecoveryCommands(invitations) {
|
|
78946
|
+
for (const action of ["challenge", "accept"]) {
|
|
78947
|
+
const command = invitations.createCommand(`email-${action}`).argument("<invitation-id>").allowExcessArguments(false).enablePositionalOptions().configureOutput({ writeErr: () => {
|
|
78948
|
+
process.stderr.write(`Invitation recovery arguments were refused. Supply proof only through masked input or the documented stdin flags.
|
|
78949
|
+
`);
|
|
78950
|
+
} }).description(action === "challenge" ? "Request an eligibility-neutral recovery code; does not confirm delivery" : "Accept with invitation proof; requires ordinary sign-in afterward").requiredOption("--challenge-id <id>", "Your retained challenge UUID; generate it before the request and keep the same exact context").requiredOption("--confirm", "Confirm this exact invitation recovery action").option(action === "challenge" ? "--token-stdin" : "--secrets-stdin", action === "challenge" ? "Read the invitation token from one stdin line" : "Read the recovery code then invitation token from two stdin lines").option("--json", "Output only validated results").action(async (invitationId2, options) => {
|
|
78951
|
+
try {
|
|
78952
|
+
if (options.confirm !== true)
|
|
78953
|
+
throw new InvitationEmailInputError;
|
|
78954
|
+
const ids = invitationEmailIds(invitationId2, options.challengeId), target = prepareInvitationRecoveryTarget();
|
|
78955
|
+
const piped = action === "challenge" ? options.tokenStdin : options.secretsStdin;
|
|
78956
|
+
if (!piped && (options.json || !process.stdin.isTTY || !process.stderr.isTTY))
|
|
78957
|
+
throw new InvitationEmailInputError;
|
|
78958
|
+
let token, code = null;
|
|
78959
|
+
if (piped && action === "accept")
|
|
78960
|
+
({ token, code } = await readInvitationSecrets());
|
|
78961
|
+
else if (piped)
|
|
78962
|
+
token = await readToken();
|
|
78963
|
+
else {
|
|
78964
|
+
token = await promptInvitationToken();
|
|
78965
|
+
if (token === null)
|
|
78966
|
+
return;
|
|
78967
|
+
if (action === "accept") {
|
|
78968
|
+
code = await promptInvitationRecoveryCode();
|
|
78969
|
+
if (code === null)
|
|
78970
|
+
return;
|
|
78971
|
+
}
|
|
78972
|
+
}
|
|
78973
|
+
target.unchanged();
|
|
78974
|
+
const client = new RemoteSkillsAuthClient(target.origin);
|
|
78975
|
+
const result2 = action === "challenge" ? await client.requestInvitationEmailChallenge({ ...ids, token, confirm: true }) : await client.acceptInvitationEmailChallenge({ ...ids, token, code, confirm: true });
|
|
78976
|
+
console.log(JSON.stringify(result2, null, options.json ? undefined : 2));
|
|
78977
|
+
} catch (error2) {
|
|
78978
|
+
const result2 = invitationEmailCustomerError(error2);
|
|
78979
|
+
if (options.json)
|
|
78980
|
+
console.log(JSON.stringify(result2));
|
|
78981
|
+
else
|
|
78982
|
+
console.error(result2.error);
|
|
78983
|
+
process.exitCode = 1;
|
|
78984
|
+
}
|
|
78985
|
+
});
|
|
78986
|
+
invitations.addCommand(command);
|
|
78987
|
+
}
|
|
78988
|
+
}
|
|
78989
|
+
var init_invitation_recovery = __esm(() => {
|
|
78990
|
+
init_remote_auth();
|
|
78991
|
+
init_invitation_recovery_target();
|
|
78992
|
+
init_remote_invitation_recovery();
|
|
78993
|
+
init_invitation_verification();
|
|
78994
|
+
});
|
|
78995
|
+
|
|
78996
|
+
// src/cli/commands/workspace-invitations.ts
|
|
78997
|
+
function registerWorkspaceInvitationCommands(workspace) {
|
|
78998
|
+
const invitations = workspace.command("invitations").description("Manage workspace invitations with fresh verification and unchanged saved credentials");
|
|
78999
|
+
registerInvitationRecoveryCommands(invitations);
|
|
79000
|
+
for (const action of ["list", "get", "issue", "resend", "revoke", "accept"]) {
|
|
79001
|
+
const targeted = ["get", "resend", "revoke", "accept"].includes(action), mutation = !["list", "get"].includes(action);
|
|
79002
|
+
const command = invitations.command(action + (targeted ? " <invitation-id>" : "")).allowExcessArguments(false).description(action === "accept" ? "Accept a received invitation; does not switch workspace or create credentials" : `${action} invitations in the exact observed workspace`).requiredOption("--user-id <id>", "Observed account ID from workspace list").requiredOption("--membership-id <id>", "Exact observed current membership; must match any selected profile").requiredOption("--email <email>", "Account email for fresh verification").option("--json", "Output the validated result as JSON");
|
|
79003
|
+
if (mutation)
|
|
79004
|
+
command.requiredOption("--confirm", "Confirm this exact invitation action");
|
|
79005
|
+
if (action === "list")
|
|
79006
|
+
command.option("--after <id>", "Exact nextCursor from the previous page");
|
|
79007
|
+
if (action === "issue")
|
|
79008
|
+
command.requiredOption("--recipient <email>", "Invitation recipient").requiredOption("--role <role>", "owner, admin, member or viewer");
|
|
79009
|
+
if (action === "issue" || action === "resend")
|
|
79010
|
+
command.requiredOption("--idempotency-key <id>", "Your stable request UUID; reuse only with the same original context and parameters");
|
|
79011
|
+
if (action === "resend" || action === "revoke")
|
|
79012
|
+
command.requiredOption("--expected-generation <number>", "Generation you observed before confirming");
|
|
79013
|
+
if (action === "accept")
|
|
79014
|
+
command.option("--secrets-stdin", "Read a fresh six-digit code and invitation token on two separate stdin lines");
|
|
79015
|
+
else
|
|
79016
|
+
command.option("--code-stdin", "Read a previously requested six-digit verification code from stdin");
|
|
79017
|
+
command.action(async (...args2) => {
|
|
79018
|
+
const id = targeted ? String(args2[0]) : undefined, options = args2[targeted ? 1 : 0];
|
|
79019
|
+
try {
|
|
79020
|
+
if (mutation && options.confirm !== true)
|
|
79021
|
+
throw new WorkspaceInvitationInputError;
|
|
79022
|
+
let input = action === "list" ? { ...options.after === undefined ? {} : { after: options.after } } : action === "get" ? { invitationId: id } : action === "issue" ? { email: options.recipient, role: options.role, idempotencyKey: options.idempotencyKey, confirm: true } : action === "resend" ? { invitationId: id, expectedGeneration: Number(options.expectedGeneration), idempotencyKey: options.idempotencyKey, confirm: true } : action === "revoke" ? { invitationId: id, expectedGeneration: Number(options.expectedGeneration), confirm: true } : { invitationId: id, token: "", confirm: true };
|
|
79023
|
+
if (action === "accept")
|
|
79024
|
+
invitationId(id);
|
|
79025
|
+
else
|
|
79026
|
+
input = invitationInput(action, input);
|
|
79027
|
+
const context = invitationProfileContext(options.userId, options.membershipId);
|
|
79028
|
+
if (!options.email.includes("@"))
|
|
79029
|
+
throw new NameInputError("Provide the verified account email.");
|
|
79030
|
+
const stdin = action === "accept" ? options.secretsStdin : options.codeStdin;
|
|
79031
|
+
if (!stdin && (options.json || !process.stdin.isTTY || !process.stderr.isTTY))
|
|
79032
|
+
throw new NameInputError(action === "accept" ? "Use --secrets-stdin with a fresh code and invitation token on two separate lines." : "Use --code-stdin with a fresh verification code.");
|
|
79033
|
+
const target = await prepareProfileWorkspace("Manage invitations").resolve();
|
|
79034
|
+
invitationProfileContext(context.userId, context.membershipId, target.context);
|
|
79035
|
+
const client = new RemoteSkillsAuthClient(target.origin);
|
|
79036
|
+
let code, token = null;
|
|
79037
|
+
if (action === "accept" && stdin)
|
|
79038
|
+
({ code, token } = await readInvitationSecrets());
|
|
79039
|
+
else {
|
|
79040
|
+
if (action === "accept") {
|
|
79041
|
+
token = await promptInvitationToken();
|
|
79042
|
+
if (token === null)
|
|
79043
|
+
return;
|
|
79044
|
+
}
|
|
79045
|
+
if (stdin)
|
|
79046
|
+
code = await readCode();
|
|
79047
|
+
else {
|
|
79048
|
+
await client.requestCode(options.email);
|
|
79049
|
+
code = await promptCode();
|
|
79050
|
+
}
|
|
79051
|
+
}
|
|
79052
|
+
if (code === null)
|
|
79053
|
+
return;
|
|
79054
|
+
if (action === "accept")
|
|
79055
|
+
input = invitationInput("accept", { invitationId: id, token, confirm: true });
|
|
79056
|
+
target.unchanged();
|
|
79057
|
+
const result2 = await invokeFreshInvitation(client, options.email, code, context, action, input);
|
|
79058
|
+
console.log(JSON.stringify(result2, null, options.json ? undefined : 2));
|
|
79059
|
+
} catch (error2) {
|
|
79060
|
+
const result2 = error2 instanceof NameInputError ? { code: "INVITATION_INPUT_INVALID", error: error2.message } : invitationCustomerError(error2);
|
|
79061
|
+
if (options.json)
|
|
79062
|
+
console.log(JSON.stringify(result2));
|
|
79063
|
+
else
|
|
79064
|
+
console.error(result2.error);
|
|
79065
|
+
process.exitCode = 1;
|
|
79066
|
+
}
|
|
79067
|
+
});
|
|
79068
|
+
}
|
|
79069
|
+
}
|
|
79070
|
+
var init_workspace_invitations = __esm(() => {
|
|
79071
|
+
init_invitation_recovery();
|
|
79072
|
+
init_workspace_profile();
|
|
79073
|
+
init_remote_auth();
|
|
79074
|
+
init_invitation_customer_action();
|
|
79075
|
+
init_remote_invitations();
|
|
79076
|
+
init_customer_verification();
|
|
79077
|
+
init_invitation_verification();
|
|
79078
|
+
});
|
|
79079
|
+
|
|
78600
79080
|
// src/cli/commands/workspace-leave.ts
|
|
78601
79081
|
function registerWorkspaceLeaveCommand(workspace) {
|
|
78602
79082
|
workspace.command("leave <membership-id>").allowExcessArguments(false).description("Leave exactly this membership after fresh verification; saved profiles stay unchanged").requiredOption("--expected-role <role>", "Observed role: owner, admin, member or viewer").requiredOption("--email <email>", "Account email for fresh verification").requiredOption("--confirm", "Confirm losing access through this membership and signing in again").option("--user-id <id>", "Observed user ID; required without a named workspace profile").option("--code-stdin", "Read a previously requested six-digit verification code from stdin").option("--json", "Output the confirmed result as JSON").action(async (membershipId, options) => {
|
|
@@ -78769,6 +79249,7 @@ function registerCustomerProfileCommands(program2) {
|
|
|
78769
79249
|
registerWorkspaceMembersCommand(workspace);
|
|
78770
79250
|
registerWorkspaceMemberMutationCommands(workspace);
|
|
78771
79251
|
registerWorkspaceLeaveCommand(workspace);
|
|
79252
|
+
registerWorkspaceInvitationCommands(workspace);
|
|
78772
79253
|
const commands = [
|
|
78773
79254
|
{ kind: "account", command: account.command("update") },
|
|
78774
79255
|
{ kind: "workspace", command: workspace.command("update") }
|
|
@@ -78811,6 +79292,7 @@ function registerCustomerProfileCommands(program2) {
|
|
|
78811
79292
|
}
|
|
78812
79293
|
}
|
|
78813
79294
|
var init_customer_profile = __esm(() => {
|
|
79295
|
+
init_workspace_invitations();
|
|
78814
79296
|
init_workspace_profile();
|
|
78815
79297
|
init_workspace_selection();
|
|
78816
79298
|
init_remote_auth();
|
|
@@ -79012,14 +79494,14 @@ function resolveCorpusRootReadOnly(options) {
|
|
|
79012
79494
|
}
|
|
79013
79495
|
return { root: join39(appDir, INSTALLED_SKILLS_DIRNAME), migrationPending: true };
|
|
79014
79496
|
}
|
|
79015
|
-
function remoteRowToSkill(
|
|
79016
|
-
const slug = typeof
|
|
79497
|
+
function remoteRowToSkill(record7) {
|
|
79498
|
+
const slug = typeof record7.slug === "string" ? record7.slug : typeof record7.name === "string" ? record7.name : undefined;
|
|
79017
79499
|
if (!slug)
|
|
79018
79500
|
return;
|
|
79019
79501
|
return {
|
|
79020
79502
|
slug,
|
|
79021
|
-
version: typeof
|
|
79022
|
-
sha256: typeof
|
|
79503
|
+
version: typeof record7.version === "string" ? record7.version : undefined,
|
|
79504
|
+
sha256: typeof record7.bundleSha256 === "string" && record7.bundleSha256 ? record7.bundleSha256 : undefined
|
|
79023
79505
|
};
|
|
79024
79506
|
}
|
|
79025
79507
|
function recheckLocalSide(plannedLocal, localDir, ops = {
|
|
@@ -79504,43 +79986,43 @@ function throttle(func, throttleMs = 0, options = {}) {
|
|
|
79504
79986
|
// ../../node_modules/.bun/ansi-escapes@7.3.0/node_modules/ansi-escapes/base.js
|
|
79505
79987
|
var exports_base = {};
|
|
79506
79988
|
__export(exports_base, {
|
|
79507
|
-
|
|
79508
|
-
setCwd: () => setCwd,
|
|
79509
|
-
scrollUp: () => scrollUp,
|
|
79510
|
-
scrollDown: () => scrollDown,
|
|
79511
|
-
link: () => link,
|
|
79512
|
-
image: () => image,
|
|
79513
|
-
iTerm: () => iTerm,
|
|
79514
|
-
exitAlternativeScreen: () => exitAlternativeScreen,
|
|
79515
|
-
eraseUp: () => eraseUp,
|
|
79516
|
-
eraseStartLine: () => eraseStartLine,
|
|
79517
|
-
eraseScreen: () => eraseScreen,
|
|
79518
|
-
eraseLines: () => eraseLines,
|
|
79519
|
-
eraseLine: () => eraseLine,
|
|
79520
|
-
eraseEndLine: () => eraseEndLine,
|
|
79521
|
-
eraseDown: () => eraseDown,
|
|
79522
|
-
enterAlternativeScreen: () => enterAlternativeScreen,
|
|
79523
|
-
endSynchronizedOutput: () => endSynchronizedOutput,
|
|
79524
|
-
cursorUp: () => cursorUp,
|
|
79525
|
-
cursorTo: () => cursorTo,
|
|
79526
|
-
cursorShow: () => cursorShow,
|
|
79527
|
-
cursorSavePosition: () => cursorSavePosition,
|
|
79528
|
-
cursorRestorePosition: () => cursorRestorePosition,
|
|
79529
|
-
cursorPrevLine: () => cursorPrevLine,
|
|
79530
|
-
cursorNextLine: () => cursorNextLine,
|
|
79531
|
-
cursorMove: () => cursorMove,
|
|
79532
|
-
cursorLeft: () => cursorLeft,
|
|
79533
|
-
cursorHide: () => cursorHide,
|
|
79534
|
-
cursorGetPosition: () => cursorGetPosition,
|
|
79535
|
-
cursorForward: () => cursorForward,
|
|
79536
|
-
cursorDown: () => cursorDown,
|
|
79537
|
-
cursorBackward: () => cursorBackward,
|
|
79538
|
-
clearViewport: () => clearViewport,
|
|
79539
|
-
clearTerminal: () => clearTerminal,
|
|
79540
|
-
clearScreen: () => clearScreen,
|
|
79541
|
-
beginSynchronizedOutput: () => beginSynchronizedOutput,
|
|
79989
|
+
ConEmu: () => ConEmu,
|
|
79542
79990
|
beep: () => beep,
|
|
79543
|
-
|
|
79991
|
+
beginSynchronizedOutput: () => beginSynchronizedOutput,
|
|
79992
|
+
clearScreen: () => clearScreen,
|
|
79993
|
+
clearTerminal: () => clearTerminal,
|
|
79994
|
+
clearViewport: () => clearViewport,
|
|
79995
|
+
cursorBackward: () => cursorBackward,
|
|
79996
|
+
cursorDown: () => cursorDown,
|
|
79997
|
+
cursorForward: () => cursorForward,
|
|
79998
|
+
cursorGetPosition: () => cursorGetPosition,
|
|
79999
|
+
cursorHide: () => cursorHide,
|
|
80000
|
+
cursorLeft: () => cursorLeft,
|
|
80001
|
+
cursorMove: () => cursorMove,
|
|
80002
|
+
cursorNextLine: () => cursorNextLine,
|
|
80003
|
+
cursorPrevLine: () => cursorPrevLine,
|
|
80004
|
+
cursorRestorePosition: () => cursorRestorePosition,
|
|
80005
|
+
cursorSavePosition: () => cursorSavePosition,
|
|
80006
|
+
cursorShow: () => cursorShow,
|
|
80007
|
+
cursorTo: () => cursorTo,
|
|
80008
|
+
cursorUp: () => cursorUp,
|
|
80009
|
+
endSynchronizedOutput: () => endSynchronizedOutput,
|
|
80010
|
+
enterAlternativeScreen: () => enterAlternativeScreen,
|
|
80011
|
+
eraseDown: () => eraseDown,
|
|
80012
|
+
eraseEndLine: () => eraseEndLine,
|
|
80013
|
+
eraseLine: () => eraseLine,
|
|
80014
|
+
eraseLines: () => eraseLines,
|
|
80015
|
+
eraseScreen: () => eraseScreen,
|
|
80016
|
+
eraseStartLine: () => eraseStartLine,
|
|
80017
|
+
eraseUp: () => eraseUp,
|
|
80018
|
+
exitAlternativeScreen: () => exitAlternativeScreen,
|
|
80019
|
+
iTerm: () => iTerm,
|
|
80020
|
+
image: () => image,
|
|
80021
|
+
link: () => link,
|
|
80022
|
+
scrollDown: () => scrollDown,
|
|
80023
|
+
scrollUp: () => scrollUp,
|
|
80024
|
+
setCwd: () => setCwd,
|
|
80025
|
+
synchronizedOutput: () => synchronizedOutput
|
|
79544
80026
|
});
|
|
79545
80027
|
import process2 from "process";
|
|
79546
80028
|
import os from "os";
|
|
@@ -84425,6 +84907,7 @@ import { spawn } from "child_process";
|
|
|
84425
84907
|
import { request as nodeHttpRequest } from "http";
|
|
84426
84908
|
import { request as nodeHttpsRequest } from "https";
|
|
84427
84909
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
84910
|
+
import { createRequire } from "module";
|
|
84428
84911
|
function getPathValue(input, path) {
|
|
84429
84912
|
return path.split(".").reduce((value, part) => {
|
|
84430
84913
|
if (value && typeof value === "object" && part in value) {
|
|
@@ -85522,6 +86005,22 @@ function setPath(input, path, replacement) {
|
|
|
85522
86005
|
if (last2 && last2 in cursor)
|
|
85523
86006
|
cursor[last2] = replacement;
|
|
85524
86007
|
}
|
|
86008
|
+
var MAX_CREDENTIAL_FILE_BYTES = 64 * 1024;
|
|
86009
|
+
var INSPECT_CUSTOM = Symbol.for("nodejs.util.inspect.custom");
|
|
86010
|
+
var CREDENTIAL_SEAL = Symbol.for("hasna:contracts:sealedCredential");
|
|
86011
|
+
var AMBIENT_ENVIRONMENT = Symbol.for("hasna:contracts:ambientClientEnvironment");
|
|
86012
|
+
var SECRETS_PACKAGE_SPECIFIER = "@hasna/" + "secrets";
|
|
86013
|
+
var requireSecretsSdk = createRequire(import.meta.url);
|
|
86014
|
+
var IDEMPOTENT_METHODS = new Set(["GET", "HEAD", "PUT", "DELETE", "OPTIONS"]);
|
|
86015
|
+
var AUTHORITY_OVERRIDE_HEADERS = new Set([
|
|
86016
|
+
"host",
|
|
86017
|
+
":authority",
|
|
86018
|
+
"forwarded",
|
|
86019
|
+
"x-forwarded-host",
|
|
86020
|
+
"x-original-host"
|
|
86021
|
+
]);
|
|
86022
|
+
var MAX_ENVELOPE_BYTES = 256 * 1024;
|
|
86023
|
+
var MAX_REQUEST_BYTES = MAX_ENVELOPE_BYTES * 2 + 8192;
|
|
85525
86024
|
function createEvent(input) {
|
|
85526
86025
|
return {
|
|
85527
86026
|
id: input.id ?? randomUUID2(),
|