@kitman-sh/cli 0.12.0-rc.7 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-gspfm7qh.js → chunk-0h49y8gf.js} +1 -1
- package/dist/{chunk-pd2vz4bm.js → chunk-0wdm7br1.js} +13 -15
- package/dist/{chunk-xcf887a4.js → chunk-4k5jfyqd.js} +39 -41
- package/dist/{chunk-znar1th3.js → chunk-4x06mdcd.js} +4 -4
- package/dist/{chunk-0346hwh6.js → chunk-5zhh41gb.js} +4 -5
- package/dist/{chunk-ewhzaqp3.js → chunk-5zth85pj.js} +2 -2
- package/dist/{chunk-j5t5nye5.js → chunk-cb78rzqd.js} +4 -4
- package/dist/{chunk-56knbdt6.js → chunk-cbpb2rww.js} +19 -21
- package/dist/{chunk-nzjb36ad.js → chunk-gq7y5v3e.js} +1 -1
- package/dist/{chunk-z450wa10.js → chunk-gy9rf14f.js} +3 -4
- package/dist/{chunk-xe8qf2xy.js → chunk-h3em3y8r.js} +111 -113
- package/dist/{chunk-bheg4ybe.js → chunk-mjdt8wbv.js} +18 -19
- package/dist/{chunk-xwya1er0.js → chunk-mtkstrh3.js} +4 -4
- package/dist/{chunk-qrm334c6.js → chunk-pf13sv65.js} +4 -4
- package/dist/{chunk-0qz10ek8.js → chunk-q5w3v4k1.js} +4 -4
- package/dist/{chunk-15geyg2d.js → chunk-qj6gjtdd.js} +87 -90
- package/dist/{chunk-wc2kba4z.js → chunk-s6z4aqag.js} +6 -7
- package/dist/{chunk-1t12wvv1.js → chunk-shv2xs9y.js} +92 -94
- package/dist/{chunk-r5sw3fe0.js → chunk-vw462m91.js} +10 -12
- package/dist/{chunk-8twjqszj.js → chunk-wh2ep6fc.js} +1 -1
- package/dist/{chunk-4w4spvb1.js → chunk-wyhg9cyk.js} +3 -3
- package/dist/{chunk-2e91ymwn.js → chunk-xaspqegt.js} +1 -1
- package/dist/{chunk-e4an66v2.js → chunk-xsdceanv.js} +5 -5
- package/dist/{chunk-5j848ckb.js → chunk-y1krmnbv.js} +2 -2
- package/dist/{chunk-vtfwjhzh.js → chunk-zw3gf6r5.js} +154 -24
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-c6rbt85q.js +0 -141
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
constVoid,
|
|
9
9
|
pipe,
|
|
10
10
|
flow,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
isString,
|
|
12
|
+
isNumber,
|
|
13
|
+
isBoolean,
|
|
14
|
+
isUndefined,
|
|
15
15
|
isNotUndefined,
|
|
16
16
|
isNotNull,
|
|
17
17
|
isNullish,
|
|
@@ -245,11 +245,23 @@ import {
|
|
|
245
245
|
toCodecJson,
|
|
246
246
|
Json,
|
|
247
247
|
JsonObject,
|
|
248
|
+
toJsonValue,
|
|
249
|
+
isOneOf,
|
|
250
|
+
isBigInt,
|
|
251
|
+
isBoolean2,
|
|
252
|
+
isFunction2,
|
|
253
|
+
isNumber2,
|
|
254
|
+
isObject2,
|
|
255
|
+
isJsonObject,
|
|
256
|
+
isString2,
|
|
257
|
+
isSymbol,
|
|
258
|
+
isUndefined2,
|
|
259
|
+
kindOf,
|
|
248
260
|
decodeJsonString,
|
|
249
261
|
decodeJsonStringOption,
|
|
250
262
|
encodeJsonStringSync,
|
|
251
263
|
encodePrettyJsonString
|
|
252
|
-
} from "./chunk-
|
|
264
|
+
} from "./chunk-zw3gf6r5.js";
|
|
253
265
|
import {
|
|
254
266
|
map,
|
|
255
267
|
makeEquivalence,
|
|
@@ -316,7 +328,7 @@ import {
|
|
|
316
328
|
String2,
|
|
317
329
|
optionalEnv,
|
|
318
330
|
harnessesUnsupportedInSrt2
|
|
319
|
-
} from "./chunk-
|
|
331
|
+
} from "./chunk-0h49y8gf.js";
|
|
320
332
|
import {
|
|
321
333
|
isDateTime,
|
|
322
334
|
Numeric,
|
|
@@ -329,21 +341,7 @@ import {
|
|
|
329
341
|
SecretScope,
|
|
330
342
|
SecretHosts,
|
|
331
343
|
isSecretReference
|
|
332
|
-
} from "./chunk-
|
|
333
|
-
import {
|
|
334
|
-
toJsonValue,
|
|
335
|
-
isOneOf,
|
|
336
|
-
isBigInt,
|
|
337
|
-
isBoolean,
|
|
338
|
-
isFunction,
|
|
339
|
-
isNumber,
|
|
340
|
-
isObject,
|
|
341
|
-
isJsonObject,
|
|
342
|
-
isString,
|
|
343
|
-
isSymbol,
|
|
344
|
-
isUndefined,
|
|
345
|
-
kindOf
|
|
346
|
-
} from "./chunk-c6rbt85q.js";
|
|
344
|
+
} from "./chunk-q5w3v4k1.js";
|
|
347
345
|
import {
|
|
348
346
|
isRedacted,
|
|
349
347
|
make,
|
|
@@ -357,7 +355,7 @@ import {
|
|
|
357
355
|
make3,
|
|
358
356
|
parseFdName,
|
|
359
357
|
fdName
|
|
360
|
-
} from "./chunk-
|
|
358
|
+
} from "./chunk-mtkstrh3.js";
|
|
361
359
|
|
|
362
360
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Tuple.js
|
|
363
361
|
var makeEquivalence3 = Tuple;
|
|
@@ -629,7 +627,7 @@ class Metric$ {
|
|
|
629
627
|
const key = this.key(context);
|
|
630
628
|
const registry = get4(context, MetricRegistry);
|
|
631
629
|
let metadata = registry.get(key);
|
|
632
|
-
if (
|
|
630
|
+
if (isUndefined(metadata)) {
|
|
633
631
|
metadata = this.metadata(this.createHooks());
|
|
634
632
|
registry.set(key, metadata);
|
|
635
633
|
}
|
|
@@ -1233,7 +1231,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
|
|
|
1233
1231
|
const fs = yield* FileSystem;
|
|
1234
1232
|
const path = yield* Path;
|
|
1235
1233
|
const resolveWorkingDirectory = fnUntraced(function* (options) {
|
|
1236
|
-
if (
|
|
1234
|
+
if (isUndefined(options.cwd))
|
|
1237
1235
|
return;
|
|
1238
1236
|
yield* fs.access(options.cwd);
|
|
1239
1237
|
return path.resolve(options.cwd);
|
|
@@ -1260,7 +1258,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
|
|
|
1260
1258
|
encoding: "utf-8",
|
|
1261
1259
|
endOnDone: true
|
|
1262
1260
|
};
|
|
1263
|
-
if (
|
|
1261
|
+
if (isUndefined(options.stdin)) {
|
|
1264
1262
|
return defaultConfig;
|
|
1265
1263
|
}
|
|
1266
1264
|
if (typeof options.stdin === "string") {
|
|
@@ -1283,7 +1281,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
|
|
|
1283
1281
|
};
|
|
1284
1282
|
const resolveOutputOption = (options, streamName) => {
|
|
1285
1283
|
const option = options[streamName];
|
|
1286
|
-
if (
|
|
1284
|
+
if (isUndefined(option)) {
|
|
1287
1285
|
return {
|
|
1288
1286
|
stream: "pipe"
|
|
1289
1287
|
};
|
|
@@ -1303,7 +1301,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
|
|
|
1303
1301
|
};
|
|
1304
1302
|
};
|
|
1305
1303
|
const resolveAdditionalFds = (options) => {
|
|
1306
|
-
if (
|
|
1304
|
+
if (isUndefined(options.additionalFds)) {
|
|
1307
1305
|
return [];
|
|
1308
1306
|
}
|
|
1309
1307
|
const result = [];
|
|
@@ -1541,7 +1539,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
|
|
|
1541
1539
|
const terminateProcessGroup = fnUntraced(function* (command, childProcess, exitSignal, options) {
|
|
1542
1540
|
const signalGroup = (signal) => ownsProcessGroup(command, childProcess) ? killProcessGroup(command, childProcess, signal).pipe(catch_((error) => hasExited(childProcess) && isUnsignallableProcessGroup(error.cause) ? void_3 : killProcess(command, childProcess, signal))) : killProcess(command, childProcess, signal);
|
|
1543
1541
|
yield* signalGroup(options?.killSignal ?? "SIGTERM");
|
|
1544
|
-
if (
|
|
1542
|
+
if (isUndefined(options?.forceKillAfter)) {
|
|
1545
1543
|
yield* _await(exitSignal);
|
|
1546
1544
|
yield* awaitProcessExit(command, childProcess, processGroupGraceMillis);
|
|
1547
1545
|
} else {
|
|
@@ -3460,7 +3458,7 @@ var placeholders = [
|
|
|
3460
3458
|
/^runner-secret:[A-Z0-9_]+:(?:env|file|exec)$/u
|
|
3461
3459
|
];
|
|
3462
3460
|
var isPlaceholder = (value) => placeholders.some((pattern) => pattern.test(value)) || isSecretReference(value);
|
|
3463
|
-
var holdsNoSecret = (classification, value) => (classification === "secret" || classification === "credential") &&
|
|
3461
|
+
var holdsNoSecret = (classification, value) => (classification === "secret" || classification === "credential") && isString2(value) && isPlaceholder(value.trim());
|
|
3464
3462
|
var unwrapped = (value) => value.replace(/^["'`(]+/u, "").replace(/["'`).]+$/u, "");
|
|
3465
3463
|
function looksLikeCredential(raw, matched) {
|
|
3466
3464
|
const value = unwrapped(raw);
|
|
@@ -3491,10 +3489,10 @@ var globalPattern = (rule) => {
|
|
|
3491
3489
|
};
|
|
3492
3490
|
var redactedBy = (text, rule) => text.replace(globalPattern(rule), (matched, ...rest) => {
|
|
3493
3491
|
const groups = rest.at(-1);
|
|
3494
|
-
const offset =
|
|
3495
|
-
const named =
|
|
3496
|
-
const value =
|
|
3497
|
-
const start = (
|
|
3492
|
+
const offset = isObject2(groups) ? rest.at(-3) : rest.at(-2);
|
|
3493
|
+
const named = isObject2(groups) && groups !== null && "value" in groups ? groups.value : undefined;
|
|
3494
|
+
const value = isString2(named) ? named : matched;
|
|
3495
|
+
const start = (isNumber2(offset) ? offset : 0) + matched.lastIndexOf(value);
|
|
3498
3496
|
return rule.holds === undefined || rule.holds(value, matched, text, start) ? `[REDACTED:${rule.classification}]` : matched;
|
|
3499
3497
|
});
|
|
3500
3498
|
var runnerSecretReference = /^runner-secret:[A-Z0-9_]+:(?:env|file|exec)$/u;
|
|
@@ -3508,7 +3506,7 @@ function classifiedValue(key, value, options) {
|
|
|
3508
3506
|
const classified = classifyAnything(key, value);
|
|
3509
3507
|
if (options.leavesKitman === true || classified === undefined || keptClassifications.has(classified.classification))
|
|
3510
3508
|
return classified;
|
|
3511
|
-
return
|
|
3509
|
+
return isString2(value) ? credentialIn(value) : undefined;
|
|
3512
3510
|
}
|
|
3513
3511
|
var keptClassifications = new Set(["secret", "credential", "unknown"]);
|
|
3514
3512
|
function credentialIn(value) {
|
|
@@ -3521,14 +3519,14 @@ function credentialIn(value) {
|
|
|
3521
3519
|
}
|
|
3522
3520
|
function classifyAnything(key, value) {
|
|
3523
3521
|
const normalizedKey = normalizeKey(key);
|
|
3524
|
-
if (LOCAL_PATH_KEYS.has(normalizedKey) &&
|
|
3522
|
+
if (LOCAL_PATH_KEYS.has(normalizedKey) && isString2(value) && isUnsafeLocalPath(value))
|
|
3525
3523
|
return { classification: "path" };
|
|
3526
3524
|
const byKey = KEY_CLASSIFICATION[normalizedKey];
|
|
3527
3525
|
if (byKey !== undefined)
|
|
3528
3526
|
return holdsNoSecret(byKey, value) ? undefined : { classification: byKey };
|
|
3529
3527
|
if (Array.isArray(value) || isPlainObject(value))
|
|
3530
3528
|
return;
|
|
3531
|
-
if (!
|
|
3529
|
+
if (!isString2(value)) {
|
|
3532
3530
|
const unsupported = unsupportedValueClassification(value);
|
|
3533
3531
|
return unsupported === undefined ? undefined : { classification: unsupported };
|
|
3534
3532
|
}
|
|
@@ -3566,13 +3564,13 @@ function scanValue(value, path, key, findings, depth, options = {}) {
|
|
|
3566
3564
|
findings.push(finding(path, "unknown", value, "max-depth"));
|
|
3567
3565
|
return;
|
|
3568
3566
|
}
|
|
3569
|
-
if (
|
|
3567
|
+
if (isString2(value) && REDACTED_PATTERN.test(value.trim()))
|
|
3570
3568
|
return;
|
|
3571
3569
|
if (key !== undefined) {
|
|
3572
3570
|
const normalizedKey = normalizeKey(key);
|
|
3573
3571
|
const classified = classifiedValue(key, value, options);
|
|
3574
3572
|
const keyClassification = classified?.classification;
|
|
3575
|
-
if ((keyClassification === undefined || keyClassification === "pii") && options.allowCanonicalIds === true && LIVE_CANONICAL_ID_KEYS.has(normalizedKey) &&
|
|
3573
|
+
if ((keyClassification === undefined || keyClassification === "pii") && options.allowCanonicalIds === true && LIVE_CANONICAL_ID_KEYS.has(normalizedKey) && isString2(value) && CANONICAL_ID_PATTERN.test(value) && /[A-Za-z]/u.test(value))
|
|
3576
3574
|
return;
|
|
3577
3575
|
if (classified !== undefined) {
|
|
3578
3576
|
findings.push(classifiedFinding(path, classified, value));
|
|
@@ -3591,7 +3589,7 @@ function scanValue(value, path, key, findings, depth, options = {}) {
|
|
|
3591
3589
|
const classified = classifiedValue(key ?? path, value, options);
|
|
3592
3590
|
if (classified !== undefined)
|
|
3593
3591
|
findings.push(classifiedFinding(path, classified, value));
|
|
3594
|
-
else if (
|
|
3592
|
+
else if (isString2(value) && value.length > (options.maxTextLength ?? durableTextLimit))
|
|
3595
3593
|
findings.push(finding(path, "unknown", value, "unbounded-text"));
|
|
3596
3594
|
}
|
|
3597
3595
|
function finding(path, classification, value, rule = "classified-key") {
|
|
@@ -3611,7 +3609,7 @@ function isUnsafeLocalPath(value) {
|
|
|
3611
3609
|
return value.startsWith("/") || value.startsWith("~") || value.includes("/.ssh") || value.includes("/.config") || value.includes("docker.sock");
|
|
3612
3610
|
}
|
|
3613
3611
|
function unsupportedValueClassification(value) {
|
|
3614
|
-
if (value !== null && value !== undefined && !
|
|
3612
|
+
if (value !== null && value !== undefined && !isString2(value) && !isNumber2(value) && !isBoolean2(value))
|
|
3615
3613
|
return "unknown";
|
|
3616
3614
|
return;
|
|
3617
3615
|
}
|
|
@@ -3631,7 +3629,7 @@ function boundText(value, max) {
|
|
|
3631
3629
|
return value.length <= max ? value : `${value.slice(0, max - 1)}\u2026`;
|
|
3632
3630
|
}
|
|
3633
3631
|
function isPlainObject(value) {
|
|
3634
|
-
if (!
|
|
3632
|
+
if (!isObject2(value) || value === null)
|
|
3635
3633
|
return false;
|
|
3636
3634
|
const prototype = Object.getPrototypeOf(value);
|
|
3637
3635
|
return prototype === Object.prototype || prototype === null;
|
|
@@ -3639,9 +3637,9 @@ function isPlainObject(value) {
|
|
|
3639
3637
|
function canonicalJson2(value) {
|
|
3640
3638
|
if (value === null)
|
|
3641
3639
|
return "null";
|
|
3642
|
-
if (
|
|
3640
|
+
if (isString2(value))
|
|
3643
3641
|
return JSON.stringify(value);
|
|
3644
|
-
if (
|
|
3642
|
+
if (isNumber2(value) || isBoolean2(value))
|
|
3645
3643
|
return String(value);
|
|
3646
3644
|
if (Array.isArray(value))
|
|
3647
3645
|
return `[${value.map(canonicalJson2).join(",")}]`;
|
|
@@ -3798,16 +3796,16 @@ function redactResponseValue(value, key, depth) {
|
|
|
3798
3796
|
return "[REDACTED:unknown]";
|
|
3799
3797
|
const byKey = key === undefined ? undefined : KEY_CLASSIFICATION[normalizeKey(key)];
|
|
3800
3798
|
if ((byKey === "secret" || byKey === "credential") && value !== null && value !== undefined && !holdsNoSecret(byKey, value))
|
|
3801
|
-
return
|
|
3799
|
+
return isString2(value) && REDACTED_PATTERN.test(value.trim()) ? value : `[REDACTED:${byKey}]`;
|
|
3802
3800
|
if (Array.isArray(value))
|
|
3803
3801
|
return value.map((item) => redactResponseValue(item, undefined, depth + 1));
|
|
3804
3802
|
if (isPlainObject(value))
|
|
3805
3803
|
return Object.fromEntries(Object.entries(value).flatMap(([childKey, child]) => child === undefined ? [] : [[childKey, redactResponseValue(child, childKey, depth + 1)]]));
|
|
3806
|
-
if (
|
|
3804
|
+
if (isString2(value))
|
|
3807
3805
|
return runnerSecretReference.test(value) ? value : RESPONSE_RULES.reduce(redactedBy, value);
|
|
3808
|
-
if (value === undefined ||
|
|
3806
|
+
if (value === undefined || isNumber2(value) && !Number.isFinite(value))
|
|
3809
3807
|
return null;
|
|
3810
|
-
if (value === null ||
|
|
3808
|
+
if (value === null || isNumber2(value) || isBoolean2(value))
|
|
3811
3809
|
return value;
|
|
3812
3810
|
return "[REDACTED:unknown]";
|
|
3813
3811
|
}
|
|
@@ -4601,7 +4599,7 @@ function findForbiddenSecretPath(value, path) {
|
|
|
4601
4599
|
}
|
|
4602
4600
|
return;
|
|
4603
4601
|
}
|
|
4604
|
-
if (!
|
|
4602
|
+
if (!isObject2(value) || value === null)
|
|
4605
4603
|
return secretStringPath(value, path);
|
|
4606
4604
|
for (const key of Object.keys(value)) {
|
|
4607
4605
|
const item = Object.getOwnPropertyDescriptor(value, key)?.value;
|
|
@@ -4615,7 +4613,7 @@ function findForbiddenSecretPath(value, path) {
|
|
|
4615
4613
|
return;
|
|
4616
4614
|
}
|
|
4617
4615
|
function secretStringPath(value, path) {
|
|
4618
|
-
if (!
|
|
4616
|
+
if (!isString2(value))
|
|
4619
4617
|
return;
|
|
4620
4618
|
const key = path[path.length - 1] ?? "";
|
|
4621
4619
|
const parentKey = path[path.length - 2] ?? "";
|
|
@@ -4646,7 +4644,7 @@ function isSecretLikeValue(value) {
|
|
|
4646
4644
|
return /secret|token|password|private/i.test(value) || SecretLikeValuePattern.test(value);
|
|
4647
4645
|
}
|
|
4648
4646
|
function isAllowedEnvironmentReferenceField(value, path) {
|
|
4649
|
-
if (!
|
|
4647
|
+
if (!isString2(value))
|
|
4650
4648
|
return false;
|
|
4651
4649
|
const parentKey = path[path.length - 2] ?? "";
|
|
4652
4650
|
if (!/^(env|headers)$/i.test(parentKey))
|
|
@@ -4768,14 +4766,14 @@ function findForbiddenRepoBindingValuePath(value, path) {
|
|
|
4768
4766
|
}
|
|
4769
4767
|
return;
|
|
4770
4768
|
}
|
|
4771
|
-
if (!
|
|
4769
|
+
if (!isObject2(value) || value === null)
|
|
4772
4770
|
return forbiddenRepoBindingStringPath(value, path);
|
|
4773
4771
|
for (const key of Object.keys(value)) {
|
|
4774
4772
|
const nextPath = [...path, key];
|
|
4775
4773
|
const item = Object.getOwnPropertyDescriptor(value, key)?.value;
|
|
4776
4774
|
if (isForbiddenSecretKey2(key))
|
|
4777
4775
|
return nextPath.join(".");
|
|
4778
|
-
if (key === "repositoryUrl" &&
|
|
4776
|
+
if (key === "repositoryUrl" && isString2(item) && repositoryUrlContainsCredentials(item))
|
|
4779
4777
|
return nextPath.join(".");
|
|
4780
4778
|
const found = findForbiddenRepoBindingValuePath(item, nextPath);
|
|
4781
4779
|
if (found !== undefined)
|
|
@@ -4784,7 +4782,7 @@ function findForbiddenRepoBindingValuePath(value, path) {
|
|
|
4784
4782
|
return;
|
|
4785
4783
|
}
|
|
4786
4784
|
function forbiddenRepoBindingStringPath(value, path) {
|
|
4787
|
-
if (!
|
|
4785
|
+
if (!isString2(value))
|
|
4788
4786
|
return;
|
|
4789
4787
|
const key = path[path.length - 1] ?? "";
|
|
4790
4788
|
if (isSecretValueKey2(key) && /secret|token|password|private|ghp_|glpat-|sk-[A-Za-z0-9_-]{8,}/i.test(value))
|
|
@@ -5396,22 +5394,22 @@ function canonicalJson(value) {
|
|
|
5396
5394
|
function canonicalJsonValue(value, propertyName) {
|
|
5397
5395
|
if (value === null)
|
|
5398
5396
|
return "null";
|
|
5399
|
-
if (
|
|
5397
|
+
if (isString2(value))
|
|
5400
5398
|
return JSON.stringify(propertyName !== undefined && /(?:digest|sha256)$/i.test(propertyName) ? value.toLowerCase() : value);
|
|
5401
|
-
if (
|
|
5399
|
+
if (isBoolean2(value))
|
|
5402
5400
|
return value ? "true" : "false";
|
|
5403
|
-
if (
|
|
5401
|
+
if (isNumber2(value)) {
|
|
5404
5402
|
if (!Number.isFinite(value))
|
|
5405
5403
|
throw new TypeError("Canonical JSON cannot contain non-finite numbers");
|
|
5406
5404
|
return JSON.stringify(value);
|
|
5407
5405
|
}
|
|
5408
|
-
if (
|
|
5406
|
+
if (isUndefined2(value))
|
|
5409
5407
|
throw new TypeError("Canonical JSON cannot contain undefined values");
|
|
5410
|
-
if (isBigInt(value) ||
|
|
5408
|
+
if (isBigInt(value) || isFunction2(value) || isSymbol(value))
|
|
5411
5409
|
throw new TypeError(`Canonical JSON cannot contain ${kindOf(value)}`);
|
|
5412
5410
|
if (Array.isArray(value))
|
|
5413
5411
|
return `[${value.map((item) => canonicalJsonValue(item)).join(",")}]`;
|
|
5414
|
-
if (
|
|
5412
|
+
if (isObject2(value))
|
|
5415
5413
|
return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalJsonValue(Object.getOwnPropertyDescriptor(value, key)?.value, key)}`).join(",")}}`;
|
|
5416
5414
|
throw new TypeError("Canonical JSON value is not supported");
|
|
5417
5415
|
}
|
|
@@ -11099,7 +11097,7 @@ var spanIdPattern = /^[a-f0-9]{16}$/u;
|
|
|
11099
11097
|
var traceFlagsPattern = /^[a-f0-9]{2}$/u;
|
|
11100
11098
|
var telemetrySequence = 0;
|
|
11101
11099
|
function parseTraceparent(value) {
|
|
11102
|
-
if (!
|
|
11100
|
+
if (!isString2(value))
|
|
11103
11101
|
return;
|
|
11104
11102
|
const parts = value.trim().split("-");
|
|
11105
11103
|
if (parts.length !== 4 || parts[0] !== "00")
|
|
@@ -11129,7 +11127,7 @@ function injectTraceContext(headers, context, requestId) {
|
|
|
11129
11127
|
}
|
|
11130
11128
|
}
|
|
11131
11129
|
function normalizeRequestId(value) {
|
|
11132
|
-
if (
|
|
11130
|
+
if (isString2(value) && /^[A-Za-z0-9._:-]{1,128}$/u.test(value))
|
|
11133
11131
|
return value;
|
|
11134
11132
|
telemetrySequence += 1;
|
|
11135
11133
|
return `req-${Date.now().toString(36)}-${telemetrySequence.toString(36)}`;
|
|
@@ -11501,7 +11499,7 @@ class KitmanEffectClient {
|
|
|
11501
11499
|
for (const [key, value] of new Headers(input.headers))
|
|
11502
11500
|
headers.set(key, value);
|
|
11503
11501
|
let body;
|
|
11504
|
-
if (
|
|
11502
|
+
if (isString2(input.body))
|
|
11505
11503
|
body = input.body;
|
|
11506
11504
|
else if (input.body !== undefined)
|
|
11507
11505
|
body = JSON.stringify(input.body);
|
|
@@ -13239,7 +13237,7 @@ function errorResponseDetails(response) {
|
|
|
13239
13237
|
}), orElseSucceed(() => ({})));
|
|
13240
13238
|
}
|
|
13241
13239
|
function parseErrorResponse(body) {
|
|
13242
|
-
if (
|
|
13240
|
+
if (isString2(body)) {
|
|
13243
13241
|
const message = sanitizeErrorDetail(body);
|
|
13244
13242
|
return message === undefined ? {} : { message };
|
|
13245
13243
|
}
|
|
@@ -13250,27 +13248,27 @@ function parseErrorResponse(body) {
|
|
|
13250
13248
|
const message = firstErrorMessage(error);
|
|
13251
13249
|
return {
|
|
13252
13250
|
...message === undefined ? undefined : { message },
|
|
13253
|
-
...
|
|
13254
|
-
...
|
|
13255
|
-
...
|
|
13251
|
+
...isString2(error.code) ? { code: error.code } : undefined,
|
|
13252
|
+
...isBoolean2(error.retryable) ? { retryable: error.retryable } : undefined,
|
|
13253
|
+
...isString2(error.requestId) ? { requestId: error.requestId } : undefined,
|
|
13256
13254
|
...error.details === undefined ? undefined : { details: error.details },
|
|
13257
|
-
...
|
|
13258
|
-
...
|
|
13255
|
+
...isNumber2(error.retryAfterSeconds) ? { retryAfterSeconds: error.retryAfterSeconds } : undefined,
|
|
13256
|
+
...isNumber2(error.currentResourceVersion) ? { currentResourceVersion: error.currentResourceVersion } : undefined
|
|
13259
13257
|
};
|
|
13260
13258
|
}
|
|
13261
13259
|
function firstErrorMessage(record) {
|
|
13262
13260
|
for (const candidate of [record.message, record.error, record.detail, record.details]) {
|
|
13263
|
-
if (
|
|
13261
|
+
if (isString2(candidate))
|
|
13264
13262
|
return sanitizeErrorDetail(candidate);
|
|
13265
13263
|
if (Array.isArray(candidate))
|
|
13266
|
-
return sanitizeErrorDetail(candidate.map((item) =>
|
|
13267
|
-
if (
|
|
13264
|
+
return sanitizeErrorDetail(candidate.map((item) => isString2(item) ? item : JSON.stringify(item)).join("; "));
|
|
13265
|
+
if (isObject2(candidate) && candidate !== null)
|
|
13268
13266
|
return sanitizeErrorDetail(JSON.stringify(candidate));
|
|
13269
13267
|
}
|
|
13270
13268
|
return sanitizeErrorDetail(JSON.stringify(record));
|
|
13271
13269
|
}
|
|
13272
13270
|
function errorResponseObject(value) {
|
|
13273
|
-
if (!
|
|
13271
|
+
if (!isObject2(value) || value === null || Array.isArray(value))
|
|
13274
13272
|
return;
|
|
13275
13273
|
const object = {};
|
|
13276
13274
|
for (const field of Object.keys(value))
|
|
@@ -13497,9 +13495,9 @@ function parseCliConfig(value) {
|
|
|
13497
13495
|
return;
|
|
13498
13496
|
const text = (key) => {
|
|
13499
13497
|
const field = value[key];
|
|
13500
|
-
return
|
|
13498
|
+
return isString2(field) ? { [key]: field } : undefined;
|
|
13501
13499
|
};
|
|
13502
|
-
const ids = (field) => Array.isArray(field) && field.every(
|
|
13500
|
+
const ids = (field) => Array.isArray(field) && field.every(isString2) ? field : undefined;
|
|
13503
13501
|
const onboarding = isJsonObject(value.onboarding) ? value.onboarding : undefined;
|
|
13504
13502
|
const mcpSkippedTeamIds = ids(onboarding?.mcpSkippedTeamIds);
|
|
13505
13503
|
return {
|
|
@@ -13788,19 +13786,19 @@ function isStoredAgentCredential(value) {
|
|
|
13788
13786
|
function isStoredJwk(value) {
|
|
13789
13787
|
if (!isRecord(value) || !isNonEmptyString(value.kty))
|
|
13790
13788
|
return false;
|
|
13791
|
-
return Object.values(value).every((item) =>
|
|
13789
|
+
return Object.values(value).every((item) => isString2(item) || isBoolean2(item) || isStringArray(item));
|
|
13792
13790
|
}
|
|
13793
13791
|
function isRecord(value) {
|
|
13794
|
-
return
|
|
13792
|
+
return isObject2(value) && value !== null;
|
|
13795
13793
|
}
|
|
13796
13794
|
function isNonEmptyString(value) {
|
|
13797
|
-
return
|
|
13795
|
+
return isString2(value) && value.length > 0;
|
|
13798
13796
|
}
|
|
13799
13797
|
function optionalString(value) {
|
|
13800
|
-
return value === undefined ||
|
|
13798
|
+
return value === undefined || isString2(value);
|
|
13801
13799
|
}
|
|
13802
13800
|
function isStringArray(value) {
|
|
13803
|
-
return Array.isArray(value) && value.every((item) =>
|
|
13801
|
+
return Array.isArray(value) && value.every((item) => isString2(item));
|
|
13804
13802
|
}
|
|
13805
13803
|
|
|
13806
13804
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/PrimaryKey.js
|
|
@@ -14969,18 +14967,18 @@ function tokenResponse(response, failure) {
|
|
|
14969
14967
|
try: () => response.json(),
|
|
14970
14968
|
catch: () => new CliError({ message: `${failure}: invalid JSON` })
|
|
14971
14969
|
});
|
|
14972
|
-
if (!
|
|
14970
|
+
if (!isObject2(body) || body === null)
|
|
14973
14971
|
return yield* new CliError({ message: `${failure}: invalid body` });
|
|
14974
14972
|
const field = (key) => Object.getOwnPropertyDescriptor(body, key)?.value;
|
|
14975
14973
|
const accessToken = field("access_token");
|
|
14976
14974
|
const refreshTokenValue = field("refresh_token");
|
|
14977
14975
|
const expiresIn = field("expires_in");
|
|
14978
|
-
if (!
|
|
14976
|
+
if (!isString2(accessToken))
|
|
14979
14977
|
return yield* new CliError({ message: `${failure}: missing access_token` });
|
|
14980
14978
|
return {
|
|
14981
14979
|
access_token: accessToken,
|
|
14982
|
-
...
|
|
14983
|
-
...
|
|
14980
|
+
...isString2(refreshTokenValue) ? { refresh_token: refreshTokenValue } : undefined,
|
|
14981
|
+
...isNumber2(expiresIn) ? { expires_in: expiresIn } : undefined
|
|
14984
14982
|
};
|
|
14985
14983
|
});
|
|
14986
14984
|
}
|
|
@@ -15125,7 +15123,7 @@ function fetchWithTimeout(fetchImpl, endpoint, init, timeoutMs) {
|
|
|
15125
15123
|
var ClockSkewAllowanceSeconds = 30;
|
|
15126
15124
|
var createAgentAuthBearerToken = fn("createAgentAuthBearerToken")(function* (input) {
|
|
15127
15125
|
const privateJwk = toJsonWebKey(input.credential.privateKeyJwk);
|
|
15128
|
-
if (!
|
|
15126
|
+
if (!isString2(privateJwk.d) || privateJwk.d.length === 0) {
|
|
15129
15127
|
return yield* new AgentAuthClientError({
|
|
15130
15128
|
status: 0,
|
|
15131
15129
|
code: "invalid_credentials",
|
|
@@ -15182,13 +15180,13 @@ function base64UrlBytes(value) {
|
|
|
15182
15180
|
function toJsonWebKey(value) {
|
|
15183
15181
|
const jwk = {};
|
|
15184
15182
|
for (const [key, item] of Object.entries(value)) {
|
|
15185
|
-
if (
|
|
15183
|
+
if (isString2(item) || isBoolean2(item) || Array.isArray(item))
|
|
15186
15184
|
Object.assign(jwk, { [key]: item });
|
|
15187
15185
|
}
|
|
15188
15186
|
return jwk;
|
|
15189
15187
|
}
|
|
15190
15188
|
function stringValue(value) {
|
|
15191
|
-
return
|
|
15189
|
+
return isString2(value) && value.length > 0 ? value : undefined;
|
|
15192
15190
|
}
|
|
15193
15191
|
|
|
15194
15192
|
// node_modules/.bun/@effect+platform-node-shared@4.1.2+edf248c88a527e3e/node_modules/@effect/platform-node-shared/dist/NodeCrypto.js
|
|
@@ -15295,7 +15293,7 @@ function parseSetupResponse(value) {
|
|
|
15295
15293
|
function toStoredJwk(value) {
|
|
15296
15294
|
const result = {};
|
|
15297
15295
|
for (const [key, item] of Object.entries(value)) {
|
|
15298
|
-
if (
|
|
15296
|
+
if (isString2(item) || isBoolean2(item) || isStringArray2(item))
|
|
15299
15297
|
result[key] = item;
|
|
15300
15298
|
}
|
|
15301
15299
|
if (!isStoredJwk2(result))
|
|
@@ -15314,10 +15312,10 @@ function isStoredJwk2(value) {
|
|
|
15314
15312
|
const record = recordValue(value);
|
|
15315
15313
|
if (!record || !stringValue2(record.kty))
|
|
15316
15314
|
return false;
|
|
15317
|
-
return Object.values(record).every((item) =>
|
|
15315
|
+
return Object.values(record).every((item) => isString2(item) || isBoolean2(item) || isStringArray2(item));
|
|
15318
15316
|
}
|
|
15319
15317
|
function recordValue(value) {
|
|
15320
|
-
if (!
|
|
15318
|
+
if (!isObject2(value) || value === null)
|
|
15321
15319
|
return;
|
|
15322
15320
|
const record = {};
|
|
15323
15321
|
for (const key of Object.keys(value)) {
|
|
@@ -15326,13 +15324,13 @@ function recordValue(value) {
|
|
|
15326
15324
|
return record;
|
|
15327
15325
|
}
|
|
15328
15326
|
function stringValue2(value) {
|
|
15329
|
-
return
|
|
15327
|
+
return isString2(value) && value.length > 0 ? value : undefined;
|
|
15330
15328
|
}
|
|
15331
15329
|
function stringArrayValue(value) {
|
|
15332
|
-
return Array.isArray(value) ? value.filter((item) =>
|
|
15330
|
+
return Array.isArray(value) ? value.filter((item) => isString2(item)) : [];
|
|
15333
15331
|
}
|
|
15334
15332
|
function isStringArray2(value) {
|
|
15335
|
-
return Array.isArray(value) && value.every((item) =>
|
|
15333
|
+
return Array.isArray(value) && value.every((item) => isString2(item));
|
|
15336
15334
|
}
|
|
15337
15335
|
|
|
15338
15336
|
// packages/agent-runtime/src/herdr-core-connection.ts
|
|
@@ -15919,9 +15917,9 @@ ${instructionsEnd}
|
|
|
15919
15917
|
};
|
|
15920
15918
|
};
|
|
15921
15919
|
var tomlInline = (value) => {
|
|
15922
|
-
if (
|
|
15920
|
+
if (isString(value))
|
|
15923
15921
|
return JSON.stringify(value);
|
|
15924
|
-
if (
|
|
15922
|
+
if (isNumber(value) || isBoolean(value))
|
|
15925
15923
|
return String(value);
|
|
15926
15924
|
if (Array.isArray(value))
|
|
15927
15925
|
return `[${value.map(tomlInline).join(", ")}]`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
isObject,
|
|
4
4
|
isUint8Array,
|
|
5
5
|
isSuccess,
|
|
6
6
|
TaggedError,
|
|
@@ -10,32 +10,30 @@ import {
|
|
|
10
10
|
andThen2,
|
|
11
11
|
catchReason,
|
|
12
12
|
orElseSucceed,
|
|
13
|
+
isJsonObject,
|
|
13
14
|
decodeJsonString,
|
|
14
15
|
encodePrettyJsonString
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import"./chunk-
|
|
17
|
-
import {
|
|
18
|
-
isJsonObject
|
|
19
|
-
} from "./chunk-c6rbt85q.js";
|
|
16
|
+
} from "./chunk-zw3gf6r5.js";
|
|
17
|
+
import"./chunk-q5w3v4k1.js";
|
|
20
18
|
import {
|
|
21
19
|
FileSystem,
|
|
22
20
|
Path
|
|
23
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-0h49y8gf.js";
|
|
24
22
|
import {
|
|
25
23
|
tomlTableHeader2,
|
|
26
24
|
tomlKeyPath2,
|
|
27
25
|
kitmanSkillEntry,
|
|
28
26
|
isPathWithin2
|
|
29
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-0wdm7br1.js";
|
|
30
28
|
import {
|
|
31
29
|
instructionsStart,
|
|
32
30
|
instructionsEnd,
|
|
33
31
|
renderMcpServer,
|
|
34
32
|
materializeKitSetup,
|
|
35
33
|
tomlInline
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import"./chunk-
|
|
38
|
-
import"./chunk-
|
|
34
|
+
} from "./chunk-shv2xs9y.js";
|
|
35
|
+
import"./chunk-xsdceanv.js";
|
|
36
|
+
import"./chunk-mtkstrh3.js";
|
|
39
37
|
|
|
40
38
|
// packages/agent-runtime/src/kit-setup-sync.ts
|
|
41
39
|
class KitSyncError extends TaggedError("KitSyncError") {
|
|
@@ -93,7 +91,7 @@ var withEntries = (value, key, entries) => {
|
|
|
93
91
|
var tomlKey = (key) => /^[A-Za-z0-9_-]+$/u.test(key) ? key : JSON.stringify(key);
|
|
94
92
|
var tomlTable = (header, value) => [
|
|
95
93
|
header,
|
|
96
|
-
...
|
|
94
|
+
...isObject(value) && !Array.isArray(value) ? Object.entries(value).map(([key, entry]) => `${tomlKey(key)} = ${tomlInline(entry)}`) : [],
|
|
97
95
|
""
|
|
98
96
|
];
|
|
99
97
|
var codexConfigKept = (text, servers) => {
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
Defect,
|
|
97
97
|
Exit,
|
|
98
98
|
toCodecJson
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-zw3gf6r5.js";
|
|
100
100
|
import {
|
|
101
101
|
interrupt,
|
|
102
102
|
getCurrent,
|
|
@@ -108,7 +108,7 @@ import {
|
|
|
108
108
|
shutdownUnsafe,
|
|
109
109
|
fromQueue,
|
|
110
110
|
unwrap
|
|
111
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-0h49y8gf.js";
|
|
112
112
|
import {
|
|
113
113
|
Clock,
|
|
114
114
|
empty,
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
ParseOptions,
|
|
124
124
|
RpcClientDefect,
|
|
125
125
|
RpcClientError
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-shv2xs9y.js";
|
|
127
127
|
|
|
128
128
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/workers/Transferable.js
|
|
129
129
|
class Collector extends (/* @__PURE__ */ Service2()("effect/workers/Transferable/Collector")) {
|
|
@@ -1444,7 +1444,7 @@ var pathOfLink = (link) => {
|
|
|
1444
1444
|
return page === null ? link : page[1] || "index";
|
|
1445
1445
|
};
|
|
1446
1446
|
var UnpinnedSdkLink = "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/";
|
|
1447
|
-
var pinnedLink2 = (link, version = "0.12.0
|
|
1447
|
+
var pinnedLink2 = (link, version = "0.12.0") => version === undefined || !link.startsWith(UnpinnedSdkLink) ? link : link.replace(UnpinnedSdkLink, `https://cdn.jsdelivr.net/npm/@kitman-sh/sdk@${version}/`);
|
|
1448
1448
|
var pageOf = (path) => path.split("#")[0];
|
|
1449
1449
|
var exportName = (section) => section.path.startsWith("sdk/") ? section.path.split("#")[1] ?? "" : "";
|
|
1450
1450
|
function excerpt(text, queryTerms) {
|