@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
isString,
|
|
4
4
|
isNone,
|
|
5
5
|
match,
|
|
6
6
|
fromUndefinedOr,
|
|
@@ -24,11 +24,11 @@ import {
|
|
|
24
24
|
Record,
|
|
25
25
|
Int,
|
|
26
26
|
fromJsonString
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-zw3gf6r5.js";
|
|
28
28
|
import {
|
|
29
29
|
withDefault,
|
|
30
30
|
String2
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-0h49y8gf.js";
|
|
32
32
|
import {
|
|
33
33
|
digestSha256,
|
|
34
34
|
digestSha512,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
get2,
|
|
39
39
|
layer4,
|
|
40
40
|
KitDigest
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-shv2xs9y.js";
|
|
42
42
|
|
|
43
43
|
// packages/core/src/npm-registry.ts
|
|
44
44
|
var KitManifest = Struct({
|
|
@@ -101,7 +101,7 @@ var untar = (tar) => {
|
|
|
101
101
|
};
|
|
102
102
|
var registryUrl = String2("NPM_CONFIG_REGISTRY").pipe(withDefault("https://registry.npmjs.org"));
|
|
103
103
|
var npmRegistryAt = (url = registryUrl) => {
|
|
104
|
-
const base = (
|
|
104
|
+
const base = (isString(url) ? succeed6(url) : orDie(url)).pipe(map8((value) => value.replace(/\/+$/u, "")));
|
|
105
105
|
const unreachable = (name, version) => (error) => new NpmRegistryError({
|
|
106
106
|
kind: "unreachable",
|
|
107
107
|
message: `npm did not answer for ${name}@${version}: ${error.message}; try again`
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
ArraySchema,
|
|
14
14
|
decodeJsonStringOption,
|
|
15
15
|
encodeUnknownJsonStringSync
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-zw3gf6r5.js";
|
|
17
17
|
import {
|
|
18
18
|
replaceSecretReferences,
|
|
19
19
|
secretReferencesIn
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-q5w3v4k1.js";
|
|
21
21
|
|
|
22
22
|
// packages/agent-runtime/src/srt-step.ts
|
|
23
23
|
import { SandboxRuntimeConfigSchema } from "@anthropic-ai/sandbox-runtime";
|
|
@@ -197,13 +197,13 @@ var addBackEdge = () => {
|
|
|
197
197
|
};
|
|
198
198
|
|
|
199
199
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Predicate.js
|
|
200
|
-
function
|
|
200
|
+
function isString(input) {
|
|
201
201
|
return typeof input === "string";
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function isNumber(input) {
|
|
204
204
|
return typeof input === "number";
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function isBoolean(input) {
|
|
207
207
|
return typeof input === "boolean";
|
|
208
208
|
}
|
|
209
209
|
function isBigInt2(input) {
|
|
@@ -213,12 +213,12 @@ function isSymbol2(input) {
|
|
|
213
213
|
return typeof input === "symbol";
|
|
214
214
|
}
|
|
215
215
|
function isPropertyKey(u) {
|
|
216
|
-
return
|
|
216
|
+
return isString(u) || isNumber(u) || isSymbol2(u);
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function isFunction(input) {
|
|
219
219
|
return typeof input === "function";
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function isUndefined(input) {
|
|
222
222
|
return input === undefined;
|
|
223
223
|
}
|
|
224
224
|
function isNotUndefined(input) {
|
|
@@ -242,11 +242,11 @@ function isUnknown(_) {
|
|
|
242
242
|
function isObjectOrArray(input) {
|
|
243
243
|
return typeof input === "object" && input !== null;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function isObject(input) {
|
|
246
246
|
return typeof input === "object" && input !== null && !Array.isArray(input);
|
|
247
247
|
}
|
|
248
248
|
function isObjectKeyword(input) {
|
|
249
|
-
return typeof input === "object" && input !== null ||
|
|
249
|
+
return typeof input === "object" && input !== null || isFunction(input);
|
|
250
250
|
}
|
|
251
251
|
var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObjectKeyword(self) && (property in self));
|
|
252
252
|
var isTagged = /* @__PURE__ */ dual(2, (self, tag) => hasProperty(self, "_tag") && self["_tag"] === tag);
|
|
@@ -257,7 +257,7 @@ function isUint8Array(input) {
|
|
|
257
257
|
return input instanceof Uint8Array;
|
|
258
258
|
}
|
|
259
259
|
function isIterable(input) {
|
|
260
|
-
return hasProperty(input, Symbol.iterator) ||
|
|
260
|
+
return hasProperty(input, Symbol.iterator) || isString(input);
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Hash.js
|
|
@@ -770,7 +770,7 @@ var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")
|
|
|
770
770
|
var toJson = (input) => {
|
|
771
771
|
try {
|
|
772
772
|
input = redact(input);
|
|
773
|
-
if (hasProperty(input, "toJSON") &&
|
|
773
|
+
if (hasProperty(input, "toJSON") && isFunction(input["toJSON"]) && input["toJSON"].length === 0) {
|
|
774
774
|
return input.toJSON();
|
|
775
775
|
} else if (Array.isArray(input)) {
|
|
776
776
|
return input.map(toJson);
|
|
@@ -1857,7 +1857,7 @@ var fromInputUnsafe = (input) => {
|
|
|
1857
1857
|
if (TypeId4 in input)
|
|
1858
1858
|
return input;
|
|
1859
1859
|
if (Array.isArray(input)) {
|
|
1860
|
-
if (input.length !== 2 || !input.every(
|
|
1860
|
+
if (input.length !== 2 || !input.every(isNumber)) {
|
|
1861
1861
|
return invalid(input);
|
|
1862
1862
|
}
|
|
1863
1863
|
if (Number.isNaN(input[0]) || Number.isNaN(input[1])) {
|
|
@@ -2232,7 +2232,7 @@ var normalize = (n) => n > 0 ? Math.floor(n) : 0;
|
|
|
2232
2232
|
var succeed = succeed7;
|
|
2233
2233
|
var fail3 = fail;
|
|
2234
2234
|
var try_ = (evaluate) => {
|
|
2235
|
-
if (
|
|
2235
|
+
if (isFunction(evaluate)) {
|
|
2236
2236
|
try {
|
|
2237
2237
|
return succeed(evaluate());
|
|
2238
2238
|
} catch (e) {
|
|
@@ -3822,7 +3822,7 @@ var catchTags2 = /* @__PURE__ */ dual((args) => isEffect2(args[0]), (self, cases
|
|
|
3822
3822
|
let keys;
|
|
3823
3823
|
return catchFilter(self, (e) => {
|
|
3824
3824
|
keys ??= Object.keys(cases);
|
|
3825
|
-
return hasProperty(e, "_tag") &&
|
|
3825
|
+
return hasProperty(e, "_tag") && isString(e["_tag"]) && keys.includes(e["_tag"]) ? succeed(e) : fail3(e);
|
|
3826
3826
|
}, (e) => cases[e["_tag"]](e), orElse);
|
|
3827
3827
|
});
|
|
3828
3828
|
var catchReason2 = /* @__PURE__ */ dual((args) => isEffect2(args[0]), (self, errorTag, reasonTag, f, orElse) => catchIf2(self, (e) => isTagged(e, errorTag) && hasProperty(e, "reason") && (orElse !== undefined || isTagged(e.reason, reasonTag)), (e) => {
|
|
@@ -6307,7 +6307,7 @@ function passthrough3() {
|
|
|
6307
6307
|
}
|
|
6308
6308
|
var numberFromString = /* @__PURE__ */ new Transformation(/* @__PURE__ */ Number3(), /* @__PURE__ */ String2());
|
|
6309
6309
|
var dateFromString = /* @__PURE__ */ new Transformation(/* @__PURE__ */ Date3(), /* @__PURE__ */ transform2(formatDate));
|
|
6310
|
-
var isJsonError = (input) =>
|
|
6310
|
+
var isJsonError = (input) => isObject(input) && typeof input["message"] === "string";
|
|
6311
6311
|
var decodeJsonError = (input) => {
|
|
6312
6312
|
const hasCause = Object.hasOwn(input, "cause");
|
|
6313
6313
|
const err = hasCause ? new Error(input.message, {
|
|
@@ -6561,7 +6561,7 @@ function literalToString(ast) {
|
|
|
6561
6561
|
var String5 = class extends ASTNodeImpl {
|
|
6562
6562
|
_tag = "String";
|
|
6563
6563
|
getParser() {
|
|
6564
|
-
return fromRefinement(this,
|
|
6564
|
+
return fromRefinement(this, isString);
|
|
6565
6565
|
}
|
|
6566
6566
|
matchPart(s, options) {
|
|
6567
6567
|
const checks = this.checks;
|
|
@@ -6575,7 +6575,7 @@ var string2 = /* @__PURE__ */ new String5;
|
|
|
6575
6575
|
var Number4 = class extends ASTNodeImpl {
|
|
6576
6576
|
_tag = "Number";
|
|
6577
6577
|
getParser() {
|
|
6578
|
-
return fromRefinement(this,
|
|
6578
|
+
return fromRefinement(this, isNumber);
|
|
6579
6579
|
}
|
|
6580
6580
|
matchKey(s, options) {
|
|
6581
6581
|
return this._match(isStringNumberRegExp, s, options);
|
|
@@ -6614,7 +6614,7 @@ var number2 = /* @__PURE__ */ new Number4;
|
|
|
6614
6614
|
var Boolean3 = class extends ASTNodeImpl {
|
|
6615
6615
|
_tag = "Boolean";
|
|
6616
6616
|
getParser() {
|
|
6617
|
-
return fromRefinement(this,
|
|
6617
|
+
return fromRefinement(this, isBoolean);
|
|
6618
6618
|
}
|
|
6619
6619
|
getExpected() {
|
|
6620
6620
|
return "boolean";
|
|
@@ -8068,7 +8068,7 @@ function getConstructorDescriptor(ast) {
|
|
|
8068
8068
|
if (!isDeclaration(ast))
|
|
8069
8069
|
return;
|
|
8070
8070
|
const getDescriptor = ast.annotations?.[CONSTRUCTOR_ANNOTATION_KEY];
|
|
8071
|
-
return
|
|
8071
|
+
return isFunction(getDescriptor) ? getDescriptor(ast.typeParameters) : undefined;
|
|
8072
8072
|
}
|
|
8073
8073
|
function isJsonLeaf(u) {
|
|
8074
8074
|
return u === null || typeof u === "string" || typeof u === "boolean" || typeof u === "number" && globalThis.Number.isFinite(u);
|
|
@@ -8739,7 +8739,7 @@ function toCodecJsonASTStep(ast, recur) {
|
|
|
8739
8739
|
switch (ast._tag) {
|
|
8740
8740
|
case "Declaration": {
|
|
8741
8741
|
const getLink = ast.annotations?.toCodecJson ?? ast.annotations?.toCodec;
|
|
8742
|
-
if (!
|
|
8742
|
+
if (!isFunction(getLink)) {
|
|
8743
8743
|
return replaceEncoding(ast, [unknownToJson]);
|
|
8744
8744
|
}
|
|
8745
8745
|
const typeParameters = ast.typeParameters.map((tp) => make5(toEncoded(tp)));
|
|
@@ -8799,16 +8799,16 @@ function toCodecStringTreeASTStep(ast, recur, onMissingAnnotation) {
|
|
|
8799
8799
|
case "Declaration": {
|
|
8800
8800
|
const typeParameters = ast.typeParameters.map((tp) => make5(recur(toEncoded(tp))));
|
|
8801
8801
|
const getStringTreeLink = ast.annotations?.toCodecStringTree;
|
|
8802
|
-
if (
|
|
8802
|
+
if (isFunction(getStringTreeLink)) {
|
|
8803
8803
|
const link = getStringTreeLink(typeParameters);
|
|
8804
8804
|
if (link === undefined)
|
|
8805
8805
|
return ast;
|
|
8806
8806
|
return replaceEncoding(ast, [mapLink(link, recur)]);
|
|
8807
8807
|
}
|
|
8808
8808
|
const getJsonLink = ast.annotations?.toCodecJson;
|
|
8809
|
-
const jsonLink =
|
|
8809
|
+
const jsonLink = isFunction(getJsonLink) ? getJsonLink(typeParameters) : undefined;
|
|
8810
8810
|
const getLink = jsonLink === undefined ? ast.annotations?.toCodec : undefined;
|
|
8811
|
-
const link = jsonLink ?? (
|
|
8811
|
+
const link = jsonLink ?? (isFunction(getLink) ? getLink(typeParameters) : undefined);
|
|
8812
8812
|
return link === undefined ? onMissingAnnotation(ast) : replaceEncoding(ast, [mapLink(link, recur)]);
|
|
8813
8813
|
}
|
|
8814
8814
|
case "Null":
|
|
@@ -8925,7 +8925,7 @@ function recur(ast) {
|
|
|
8925
8925
|
const propertySignatures = ast.propertySignatures.map((ps) => recur(ps.type));
|
|
8926
8926
|
const indexSignatures = ast.indexSignatures.map((is) => recur(is.type));
|
|
8927
8927
|
return make14((a, b) => {
|
|
8928
|
-
if (!
|
|
8928
|
+
if (!isObject(a) || !isObject(b)) {
|
|
8929
8929
|
return false;
|
|
8930
8930
|
}
|
|
8931
8931
|
for (let i = 0;i < propertySignatures.length; i++) {
|
|
@@ -10157,6 +10157,134 @@ var Json = /* @__PURE__ */ make17(/* @__PURE__ */ annotate(Json2, {
|
|
|
10157
10157
|
}));
|
|
10158
10158
|
var JsonObject = /* @__PURE__ */ Record(String4, Json);
|
|
10159
10159
|
|
|
10160
|
+
// packages/core/src/runtime-type.ts
|
|
10161
|
+
var UnsafeJsonObjectKeys = new Set(["__proto__", "constructor", "prototype"]);
|
|
10162
|
+
function jsonDataError() {
|
|
10163
|
+
throw new TypeError("Value is not JSON data");
|
|
10164
|
+
}
|
|
10165
|
+
function parseJsonValue(value, ancestors) {
|
|
10166
|
+
if (value === null)
|
|
10167
|
+
return null;
|
|
10168
|
+
if (value === undefined)
|
|
10169
|
+
return jsonDataError();
|
|
10170
|
+
if (isString2(value))
|
|
10171
|
+
return String(value);
|
|
10172
|
+
if (isNumber2(value))
|
|
10173
|
+
return Number.isFinite(value) ? Number(value) : jsonDataError();
|
|
10174
|
+
if (isBoolean2(value))
|
|
10175
|
+
return Boolean(value);
|
|
10176
|
+
if (value instanceof Date) {
|
|
10177
|
+
const timestamp = Date.prototype.getTime.call(value);
|
|
10178
|
+
return Number.isNaN(timestamp) ? jsonDataError() : Date.prototype.toISOString.call(value);
|
|
10179
|
+
}
|
|
10180
|
+
if (!isObject2(value))
|
|
10181
|
+
return jsonDataError();
|
|
10182
|
+
if (ancestors.has(value))
|
|
10183
|
+
throw new TypeError("JSON data must not contain cycles");
|
|
10184
|
+
const prototype = Object.getPrototypeOf(value);
|
|
10185
|
+
if (Array.isArray(value)) {
|
|
10186
|
+
ancestors.add(value);
|
|
10187
|
+
try {
|
|
10188
|
+
const keys = Object.keys(value);
|
|
10189
|
+
const hasNamedProperty = keys.some((key, index) => key !== String(index)) || Object.getOwnPropertySymbols(value).some((symbol) => Object.getOwnPropertyDescriptor(value, symbol)?.enumerable);
|
|
10190
|
+
if (hasNamedProperty)
|
|
10191
|
+
throw new TypeError("JSON arrays must not contain named properties");
|
|
10192
|
+
if (keys.length !== value.length)
|
|
10193
|
+
throw new TypeError("JSON arrays must not contain sparse slots");
|
|
10194
|
+
const result = [];
|
|
10195
|
+
for (const key of keys) {
|
|
10196
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
10197
|
+
if (descriptor === undefined || !("value" in descriptor))
|
|
10198
|
+
throw new TypeError("JSON array entries must be data properties");
|
|
10199
|
+
result.push(parseJsonValue(descriptor.value, ancestors));
|
|
10200
|
+
}
|
|
10201
|
+
return result;
|
|
10202
|
+
} finally {
|
|
10203
|
+
ancestors.delete(value);
|
|
10204
|
+
}
|
|
10205
|
+
}
|
|
10206
|
+
if (prototype !== Object.prototype && prototype !== null)
|
|
10207
|
+
return jsonDataError();
|
|
10208
|
+
ancestors.add(value);
|
|
10209
|
+
try {
|
|
10210
|
+
const result = Object.create(null);
|
|
10211
|
+
for (const key of Object.keys(value)) {
|
|
10212
|
+
if (UnsafeJsonObjectKeys.has(key))
|
|
10213
|
+
throw new TypeError(`Unsafe JSON object key: ${key}`);
|
|
10214
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
10215
|
+
if (descriptor === undefined || !("value" in descriptor))
|
|
10216
|
+
throw new TypeError("JSON object properties must be data properties");
|
|
10217
|
+
if (descriptor.value !== undefined)
|
|
10218
|
+
result[key] = parseJsonValue(descriptor.value, ancestors);
|
|
10219
|
+
}
|
|
10220
|
+
return result;
|
|
10221
|
+
} finally {
|
|
10222
|
+
ancestors.delete(value);
|
|
10223
|
+
}
|
|
10224
|
+
}
|
|
10225
|
+
function toJsonValue(value) {
|
|
10226
|
+
return parseJsonValue(value, new WeakSet);
|
|
10227
|
+
}
|
|
10228
|
+
function isJsonArray(value) {
|
|
10229
|
+
return Array.isArray(value);
|
|
10230
|
+
}
|
|
10231
|
+
function isOneOf(values, value) {
|
|
10232
|
+
return values.some((item) => Object.is(item, value));
|
|
10233
|
+
}
|
|
10234
|
+
function isKeyOf(record, key) {
|
|
10235
|
+
return Object.hasOwn(record, key);
|
|
10236
|
+
}
|
|
10237
|
+
function toJsonObject(value) {
|
|
10238
|
+
const parsed = toJsonValue(value);
|
|
10239
|
+
if (parsed === null || isJsonArray(parsed) || !isObject2(parsed))
|
|
10240
|
+
throw new TypeError("Value is not a JSON object");
|
|
10241
|
+
return parsed;
|
|
10242
|
+
}
|
|
10243
|
+
function isBigInt(value) {
|
|
10244
|
+
return isBigInt2(value);
|
|
10245
|
+
}
|
|
10246
|
+
function isBoolean2(value) {
|
|
10247
|
+
return isBoolean(value);
|
|
10248
|
+
}
|
|
10249
|
+
function isFunction2(value) {
|
|
10250
|
+
return isFunction(value);
|
|
10251
|
+
}
|
|
10252
|
+
function isNumber2(value) {
|
|
10253
|
+
return isNumber(value);
|
|
10254
|
+
}
|
|
10255
|
+
function isObject2(value) {
|
|
10256
|
+
return isObjectOrArray(value);
|
|
10257
|
+
}
|
|
10258
|
+
function isJsonObject(value) {
|
|
10259
|
+
return isObject2(value) && value !== null && !Array.isArray(value);
|
|
10260
|
+
}
|
|
10261
|
+
function isString2(value) {
|
|
10262
|
+
return isString(value);
|
|
10263
|
+
}
|
|
10264
|
+
function isSymbol(value) {
|
|
10265
|
+
return isSymbol2(value);
|
|
10266
|
+
}
|
|
10267
|
+
function isUndefined2(value) {
|
|
10268
|
+
return isUndefined(value);
|
|
10269
|
+
}
|
|
10270
|
+
function kindOf(value) {
|
|
10271
|
+
if (isString2(value))
|
|
10272
|
+
return "string";
|
|
10273
|
+
if (isNumber2(value))
|
|
10274
|
+
return "number";
|
|
10275
|
+
if (isBoolean2(value))
|
|
10276
|
+
return "boolean";
|
|
10277
|
+
if (isBigInt(value))
|
|
10278
|
+
return "bigint";
|
|
10279
|
+
if (isSymbol(value))
|
|
10280
|
+
return "symbol";
|
|
10281
|
+
if (isUndefined2(value))
|
|
10282
|
+
return "undefined";
|
|
10283
|
+
if (isFunction2(value))
|
|
10284
|
+
return "function";
|
|
10285
|
+
return "object";
|
|
10286
|
+
}
|
|
10287
|
+
|
|
10160
10288
|
// packages/core/src/json.ts
|
|
10161
10289
|
var JsonFromString = fromJsonString(Json);
|
|
10162
10290
|
var decodeJsonString = decodeUnknownEffect2(JsonFromString);
|
|
@@ -10165,5 +10293,7 @@ var encodeJsonStringSync = encodeSync(JsonFromString);
|
|
|
10165
10293
|
var encodePrettyJsonString = encodeEffect(fromJsonString(Json, { space: 2 }));
|
|
10166
10294
|
var decodeJsonStringSync = decodeUnknownSync(JsonFromString);
|
|
10167
10295
|
var encodeUnknownJsonStringSync = encodeSync(fromJsonString(Unknown));
|
|
10296
|
+
var storableText = (text) => text.replaceAll("\x00", "").replaceAll(/\p{Cs}/gu, "");
|
|
10297
|
+
var storable = (value) => isString2(value) ? storableText(value) : Array.isArray(value) ? value.map(storable) : isJsonObject(value) ? Object.fromEntries(Object.entries(value).map(([key, field]) => [storableText(key), storable(field)])) : value;
|
|
10168
10298
|
|
|
10169
|
-
export { pipeArguments, dual, identity, constant, constTrue, constFalse, constVoid, pipe, flow, memoize,
|
|
10299
|
+
export { pipeArguments, dual, identity, constant, constTrue, constFalse, constVoid, pipe, flow, memoize, isString, isNumber, isBoolean, isFunction, isUndefined, isNotUndefined, isNotNull, isNullish, isObject, hasProperty, isTagged, isUint8Array, symbol, hash, combine, number, string, structure, array, symbol2, equals, asEquivalence, symbolRedactable, redact, currentFiberTypeId, format, NodeInspectSymbol, toJson, BaseProto, Class, getStackTraceLimit, setStackTraceLimit, assignProperty, args, evaluate, PipeInspectableProto, isExit, causeFail, makePrimitive, exitSucceed, exitFailCause, exitFail, withFiber, Done, Prototype, make14, strictEqual, Tuple, String3, Number2, mapInput, none, some, isNone, isSome, match, getOrElse, orElse, fromNullishOr, fromUndefinedOr, getOrUndefined, liftThrowable, map4, flatMap, toArray, filter2, exists, Service2, makeUnsafe4, empty3, make15, add, getOrUndefined2, getOrUndefinedUnsafe, getUnsafe, get4, merge3, Reference, fromInputUnsafe, isFinite, zero, infinity, millis, seconds, minutes, toMillis, toMinutes, min, max, subtract, format2, normalize, succeed, fail3, try_, isResult, isFailure, isSuccess, map5, getOrElse2, getOrThrow, all2, allocate, fromIterable, isArrayNonEmpty, isReadonlyArrayNonEmpty, isCanonicalArrayIndex, getUnsafe2, sort, of, map6, makeEquivalence2, TaggedClass, Error2, TaggedError, encode, DisablePropagation, getCurrentFiber, fiberJoin, fiberInterrupt, succeed2, sync, suspend2, succeedNone, void_, callback2, asSome, andThen, flatMap2, map7, exitInterrupt, exitVoid, exitZipRight, scopeAddFinalizer, scope, onExitPrimitive, onExitUnsafe, uninterruptibleMask, fiberRunIn, makeLatchUnsafe, makeLatch, ClockRef, currentTimeMillis2, ConsoleRef, succeed3, failCause2, fail4, die, interrupt2, void_2, isSuccess2, isFailure2, hasInterrupts, asVoidAll, makeUnsafe5, make16, _await, fail5, interruptWith, isDone, isDoneUnsafe, succeed4, doneUnsafe, TracerTimingEnabled, Scope, makeUnsafe6, provide, addFinalizerExit, addFinalizer, forkUnsafe, close, build, buildWithScope, succeed5, effect, effectContext, effectDiscard, mergeAll, provide2, provideMerge, isCause, isFailReason, isDieReason, fromReasons, fail6, die2, makeFailReason, makeDieReason, hasInterruptsOnly, squash, findError, findErrorOption, hasInterrupts2, interruptors, pretty, isDone2, Done2, done, IllegalArgumentError, UnknownError, reasonAnnotations, Random, catchDone, isDoneCause, filterDone, doneExitFromCause, matchEffect, max2, during, min2, exponential, jittered, spaced, isEffect, all3, findFirst, forEach, whileLoop, promise, tryPromise, succeed6, suspend3, sync2, void_3, undefined_, callback3, never, gen, fail7, failSync, failCause3, die3, try_2, yieldNow, withFiber2, fromResult, fromNullishOr2, flatMap3, flatten, andThen2, tap2, result, option2, exit, map8, as, asSome2, asVoid, zipWith, catch_, catchTag, catchTags, catchReason, catchCause2, catchDefect, catchIf, catchCauseIf, mapError2, orDie, tapError2, tapCause, retry, retryOrElse, ignore, ignoreCause, orElseSucceed, timeout, timeoutOption, timeoutOrElse, delay, sleep, raceAllFirst, raceFirst, filter3, filterOrFail, when, matchCauseEffect, matchEffect2, context, contextWith, provide3, provideContext2, service, serviceOption, updateContext, updateService, provideService, scope2, scoped, scopedWith, acquireRelease, acquireUseRelease, addFinalizer2, ensuring2, onError, onExitPrimitive2, onExit, cached, interrupt3, interruptible, onInterrupt, uninterruptible, uninterruptibleMask2, forever, repeat, annotateCurrentSpan, makeSpanScoped, useSpan, withSpan, withParentSpan, forkChild, forkIn, forkScoped, forkDetach, runFork, runForkWith, runPromise, runPromiseWith, runSync, runSyncExitWith, fnUntraced, fn, clockWith, logWarning, logError, logInfo, annotateLogs, effectify, mapEager, flatMapEager, catchEager, encode2, decode, Pointer, makeFormatterStandardSchemaV1, passthrough, transformEffect, Transformation, transform, defaultParseOptions, unknown, getIndexSignatureKeys, applyToSelfOrLastLinkEncoding, decodeTo, toEncoded, decodeUnknownEffect, omit, map9, declare, SchemaError, is, decodeUnknownEffect2, decodeEffect, decodeUnknownExit, decodeUnknownOption, decodeOption, decodeSync, encodeEffect, make17, isSchema, optionalKey, optional, toType, Literal, Never, Unknown, Null, String4, Boolean2, Void, Struct, Record, StructWithRest, ArraySchema, NonEmptyArray, Union, Literals, NullOr, UndefinedOr, suspend4, decodeTo2, withDecodingDefaultKey, tag, TaggedStruct, makeFilter, isPattern, Finite, isGreaterThan, isGreaterThanOrEqualTo, isLessThanOrEqualTo, Int, isMinLength, isMaxLength, isMinProperties, isMaxProperties, isUnique, NonEmptyString, Defect, Date2, fromJsonString, FiniteFromString, Cause, Exit, Class2, Error3, TaggedError2, toEquivalence, toCodecJson, toCodecStringTree, Json, JsonObject, toJsonValue, isOneOf, isKeyOf, toJsonObject, isBigInt, isBoolean2, isFunction2, isNumber2, isObject2, isJsonObject, isString2, isSymbol, isUndefined2, kindOf, decodeJsonString, decodeJsonStringOption, encodeJsonStringSync, encodePrettyJsonString, decodeJsonStringSync, encodeUnknownJsonStringSync, storable };
|
package/dist/index.js
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
var args = process.argv.slice(2);
|
|
6
6
|
if (args[0] === "srt") {
|
|
7
7
|
process.argv.splice(2, 1);
|
|
8
|
-
const { runSrtCli } = await import("./chunk-
|
|
8
|
+
const { runSrtCli } = await import("./chunk-5zth85pj.js");
|
|
9
9
|
await runSrtCli();
|
|
10
10
|
} else if (args[0] === "srt-step") {
|
|
11
|
-
const { runSrtStep } = await import("./chunk-
|
|
11
|
+
const { runSrtStep } = await import("./chunk-gy9rf14f.js");
|
|
12
12
|
await runSrtStep(args.slice(1));
|
|
13
13
|
} else if (args[0] === "opencode-read") {
|
|
14
|
-
const { runOpencodeReader } = await import("./chunk-
|
|
14
|
+
const { runOpencodeReader } = await import("./chunk-5zhh41gb.js");
|
|
15
15
|
runOpencodeReader();
|
|
16
16
|
} else {
|
|
17
|
-
const { runCli } = await import("./chunk-
|
|
17
|
+
const { runCli } = await import("./chunk-4k5jfyqd.js");
|
|
18
18
|
runCli(args);
|
|
19
19
|
}
|
package/package.json
CHANGED
package/dist/chunk-c6rbt85q.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
isString2,
|
|
4
|
-
isNumber2,
|
|
5
|
-
isBoolean2,
|
|
6
|
-
isBigInt2,
|
|
7
|
-
isSymbol2,
|
|
8
|
-
isFunction2,
|
|
9
|
-
isUndefined2,
|
|
10
|
-
isObjectOrArray
|
|
11
|
-
} from "./chunk-vtfwjhzh.js";
|
|
12
|
-
|
|
13
|
-
// packages/core/src/runtime-type.ts
|
|
14
|
-
var UnsafeJsonObjectKeys = new Set(["__proto__", "constructor", "prototype"]);
|
|
15
|
-
function jsonDataError() {
|
|
16
|
-
throw new TypeError("Value is not JSON data");
|
|
17
|
-
}
|
|
18
|
-
function parseJsonValue(value, ancestors) {
|
|
19
|
-
if (value === null)
|
|
20
|
-
return null;
|
|
21
|
-
if (value === undefined)
|
|
22
|
-
return jsonDataError();
|
|
23
|
-
if (isString(value))
|
|
24
|
-
return String(value);
|
|
25
|
-
if (isNumber(value))
|
|
26
|
-
return Number.isFinite(value) ? Number(value) : jsonDataError();
|
|
27
|
-
if (isBoolean(value))
|
|
28
|
-
return Boolean(value);
|
|
29
|
-
if (value instanceof Date) {
|
|
30
|
-
const timestamp = Date.prototype.getTime.call(value);
|
|
31
|
-
return Number.isNaN(timestamp) ? jsonDataError() : Date.prototype.toISOString.call(value);
|
|
32
|
-
}
|
|
33
|
-
if (!isObject(value))
|
|
34
|
-
return jsonDataError();
|
|
35
|
-
if (ancestors.has(value))
|
|
36
|
-
throw new TypeError("JSON data must not contain cycles");
|
|
37
|
-
const prototype = Object.getPrototypeOf(value);
|
|
38
|
-
if (Array.isArray(value)) {
|
|
39
|
-
ancestors.add(value);
|
|
40
|
-
try {
|
|
41
|
-
const keys = Object.keys(value);
|
|
42
|
-
const hasNamedProperty = keys.some((key, index) => key !== String(index)) || Object.getOwnPropertySymbols(value).some((symbol) => Object.getOwnPropertyDescriptor(value, symbol)?.enumerable);
|
|
43
|
-
if (hasNamedProperty)
|
|
44
|
-
throw new TypeError("JSON arrays must not contain named properties");
|
|
45
|
-
if (keys.length !== value.length)
|
|
46
|
-
throw new TypeError("JSON arrays must not contain sparse slots");
|
|
47
|
-
const result = [];
|
|
48
|
-
for (const key of keys) {
|
|
49
|
-
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
50
|
-
if (descriptor === undefined || !("value" in descriptor))
|
|
51
|
-
throw new TypeError("JSON array entries must be data properties");
|
|
52
|
-
result.push(parseJsonValue(descriptor.value, ancestors));
|
|
53
|
-
}
|
|
54
|
-
return result;
|
|
55
|
-
} finally {
|
|
56
|
-
ancestors.delete(value);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (prototype !== Object.prototype && prototype !== null)
|
|
60
|
-
return jsonDataError();
|
|
61
|
-
ancestors.add(value);
|
|
62
|
-
try {
|
|
63
|
-
const result = Object.create(null);
|
|
64
|
-
for (const key of Object.keys(value)) {
|
|
65
|
-
if (UnsafeJsonObjectKeys.has(key))
|
|
66
|
-
throw new TypeError(`Unsafe JSON object key: ${key}`);
|
|
67
|
-
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
68
|
-
if (descriptor === undefined || !("value" in descriptor))
|
|
69
|
-
throw new TypeError("JSON object properties must be data properties");
|
|
70
|
-
if (descriptor.value !== undefined)
|
|
71
|
-
result[key] = parseJsonValue(descriptor.value, ancestors);
|
|
72
|
-
}
|
|
73
|
-
return result;
|
|
74
|
-
} finally {
|
|
75
|
-
ancestors.delete(value);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function toJsonValue(value) {
|
|
79
|
-
return parseJsonValue(value, new WeakSet);
|
|
80
|
-
}
|
|
81
|
-
function isJsonArray(value) {
|
|
82
|
-
return Array.isArray(value);
|
|
83
|
-
}
|
|
84
|
-
function isOneOf(values, value) {
|
|
85
|
-
return values.some((item) => Object.is(item, value));
|
|
86
|
-
}
|
|
87
|
-
function isKeyOf(record, key) {
|
|
88
|
-
return Object.hasOwn(record, key);
|
|
89
|
-
}
|
|
90
|
-
function toJsonObject(value) {
|
|
91
|
-
const parsed = toJsonValue(value);
|
|
92
|
-
if (parsed === null || isJsonArray(parsed) || !isObject(parsed))
|
|
93
|
-
throw new TypeError("Value is not a JSON object");
|
|
94
|
-
return parsed;
|
|
95
|
-
}
|
|
96
|
-
function isBigInt(value) {
|
|
97
|
-
return isBigInt2(value);
|
|
98
|
-
}
|
|
99
|
-
function isBoolean(value) {
|
|
100
|
-
return isBoolean2(value);
|
|
101
|
-
}
|
|
102
|
-
function isFunction(value) {
|
|
103
|
-
return isFunction2(value);
|
|
104
|
-
}
|
|
105
|
-
function isNumber(value) {
|
|
106
|
-
return isNumber2(value);
|
|
107
|
-
}
|
|
108
|
-
function isObject(value) {
|
|
109
|
-
return isObjectOrArray(value);
|
|
110
|
-
}
|
|
111
|
-
function isJsonObject(value) {
|
|
112
|
-
return isObject(value) && value !== null && !Array.isArray(value);
|
|
113
|
-
}
|
|
114
|
-
function isString(value) {
|
|
115
|
-
return isString2(value);
|
|
116
|
-
}
|
|
117
|
-
function isSymbol(value) {
|
|
118
|
-
return isSymbol2(value);
|
|
119
|
-
}
|
|
120
|
-
function isUndefined(value) {
|
|
121
|
-
return isUndefined2(value);
|
|
122
|
-
}
|
|
123
|
-
function kindOf(value) {
|
|
124
|
-
if (isString(value))
|
|
125
|
-
return "string";
|
|
126
|
-
if (isNumber(value))
|
|
127
|
-
return "number";
|
|
128
|
-
if (isBoolean(value))
|
|
129
|
-
return "boolean";
|
|
130
|
-
if (isBigInt(value))
|
|
131
|
-
return "bigint";
|
|
132
|
-
if (isSymbol(value))
|
|
133
|
-
return "symbol";
|
|
134
|
-
if (isUndefined(value))
|
|
135
|
-
return "undefined";
|
|
136
|
-
if (isFunction(value))
|
|
137
|
-
return "function";
|
|
138
|
-
return "object";
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export { toJsonValue, isOneOf, isKeyOf, toJsonObject, isBigInt, isBoolean, isFunction, isNumber, isObject, isJsonObject, isString, isSymbol, isUndefined, kindOf };
|