superbee 0.4.3-pre.19 → 0.4.3-pre.20
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/publication-bridge.mjs +96 -96
- package/dist/publication.mjs +96 -96
- package/dist/superbee.mjs +766 -611
- package/package.json +1 -1
|
@@ -2997,16 +2997,6 @@ function stringifyDoc(frontmatter2, body) {
|
|
|
2997
2997
|
return stringifyWithData(frontmatter2, body);
|
|
2998
2998
|
}
|
|
2999
2999
|
|
|
3000
|
-
// ../core/src/meaningful-change-time.ts
|
|
3001
|
-
function meaningfulChangeTimeField(frontmatter2) {
|
|
3002
|
-
const generated = frontmatter2.generated;
|
|
3003
|
-
if (generated !== null && typeof generated === "object" && !Array.isArray(generated) && generated.at !== void 0) return "generated.at";
|
|
3004
|
-
return "timestamp";
|
|
3005
|
-
}
|
|
3006
|
-
function meaningfulChangeTimeValue(frontmatter2) {
|
|
3007
|
-
return meaningfulChangeTimeField(frontmatter2) === "generated.at" ? frontmatter2.generated.at : frontmatter2.timestamp;
|
|
3008
|
-
}
|
|
3009
|
-
|
|
3010
3000
|
// ../core/src/errors.ts
|
|
3011
3001
|
var InvalidInputError = class extends Error {
|
|
3012
3002
|
constructor(message) {
|
|
@@ -3038,73 +3028,6 @@ var ConcurrentReplacementError = class extends Error {
|
|
|
3038
3028
|
}
|
|
3039
3029
|
};
|
|
3040
3030
|
|
|
3041
|
-
// ../core/src/verification.ts
|
|
3042
|
-
var TRUST_TIERS = Object.freeze([
|
|
3043
|
-
"unverified",
|
|
3044
|
-
"machine-confirmed",
|
|
3045
|
-
"human-reviewed"
|
|
3046
|
-
]);
|
|
3047
|
-
var ISO_INSTANT = /^(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(?:([Zz])|([+-])(\d{2})(?::?(\d{2}))?)$/;
|
|
3048
|
-
function parseIsoInstant(raw, rounding = "truncate") {
|
|
3049
|
-
const match = ISO_INSTANT.exec(raw);
|
|
3050
|
-
if (!match) return null;
|
|
3051
|
-
const [, y, mo, d, h, mi, sec = "0", frac = "0", zulu, sign, oh, om = "0"] = match;
|
|
3052
|
-
const year = Number(y);
|
|
3053
|
-
const month = Number(mo);
|
|
3054
|
-
const day = Number(d);
|
|
3055
|
-
const hour = Number(h);
|
|
3056
|
-
const minute = Number(mi);
|
|
3057
|
-
const second = Number(sec);
|
|
3058
|
-
if (month < 1 || month > 12) return null;
|
|
3059
|
-
const probe = /* @__PURE__ */ new Date(0);
|
|
3060
|
-
probe.setUTCFullYear(year, month, 0);
|
|
3061
|
-
if (day < 1 || day > probe.getUTCDate()) return null;
|
|
3062
|
-
if (hour > 23 || minute > 59 || second > 59) return null;
|
|
3063
|
-
let offsetMinutes = 0;
|
|
3064
|
-
if (!zulu) {
|
|
3065
|
-
const offsetHours = Number(oh);
|
|
3066
|
-
const offsetMins = Number(om);
|
|
3067
|
-
if (offsetHours > 23 || offsetMins > 59) return null;
|
|
3068
|
-
offsetMinutes = (sign === "-" ? -1 : 1) * (offsetHours * 60 + offsetMins);
|
|
3069
|
-
}
|
|
3070
|
-
const millis = Number(frac.padEnd(3, "0").slice(0, 3));
|
|
3071
|
-
const instant = /* @__PURE__ */ new Date(0);
|
|
3072
|
-
instant.setUTCFullYear(year, month - 1, day);
|
|
3073
|
-
instant.setUTCHours(hour, minute, second, millis);
|
|
3074
|
-
const remainder = rounding === "ceil" && /[1-9]/.test(frac.slice(3)) ? 1 : 0;
|
|
3075
|
-
return instant.getTime() - offsetMinutes * 6e4 + remainder;
|
|
3076
|
-
}
|
|
3077
|
-
|
|
3078
|
-
// ../core/src/freshness.ts
|
|
3079
|
-
function parseTimestamp(ts, okfVersion) {
|
|
3080
|
-
if (okfVersion === "0.2") return typeof ts === "string" ? parseIsoInstant(ts) : null;
|
|
3081
|
-
if (ts instanceof Date) {
|
|
3082
|
-
const ms2 = ts.getTime();
|
|
3083
|
-
return Number.isNaN(ms2) ? null : ms2;
|
|
3084
|
-
}
|
|
3085
|
-
if (typeof ts === "number") {
|
|
3086
|
-
return Number.isFinite(ts) ? ts : null;
|
|
3087
|
-
}
|
|
3088
|
-
if (typeof ts !== "string" || ts.trim() === "") return null;
|
|
3089
|
-
const ms = Date.parse(ts);
|
|
3090
|
-
return Number.isNaN(ms) ? null : ms;
|
|
3091
|
-
}
|
|
3092
|
-
|
|
3093
|
-
// ../core/src/okf-lifecycle.ts
|
|
3094
|
-
var OKF_LIFECYCLE_STATUSES = Object.freeze(["draft", "stable", "deprecated"]);
|
|
3095
|
-
function isOkfLifecycleStatus(value) {
|
|
3096
|
-
return typeof value === "string" && OKF_LIFECYCLE_STATUSES.includes(value);
|
|
3097
|
-
}
|
|
3098
|
-
|
|
3099
|
-
// ../core/src/mutation-attribution.ts
|
|
3100
|
-
var SUPERBEE_UPDATED_BY_FIELD = "superbee_updated_by";
|
|
3101
|
-
function nonEmptyString(value) {
|
|
3102
|
-
return typeof value === "string" && value.trim() !== "" ? value.trim() : void 0;
|
|
3103
|
-
}
|
|
3104
|
-
function mutationActorFromFrontmatter(frontmatter2) {
|
|
3105
|
-
return nonEmptyString(frontmatter2[SUPERBEE_UPDATED_BY_FIELD]) ?? nonEmptyString(frontmatter2.updated_by) ?? nonEmptyString(frontmatter2.actor);
|
|
3106
|
-
}
|
|
3107
|
-
|
|
3108
3031
|
// ../core/src/paths.ts
|
|
3109
3032
|
var RESERVED_FILENAMES = ["index.md", "log.md"];
|
|
3110
3033
|
function compareStorageKeys(a, b) {
|
|
@@ -3423,6 +3346,102 @@ function parseLinksFromDoc(doc) {
|
|
|
3423
3346
|
return links;
|
|
3424
3347
|
}
|
|
3425
3348
|
|
|
3349
|
+
// ../core/src/version-transport.ts
|
|
3350
|
+
function isContentVersion(value) {
|
|
3351
|
+
return typeof value === "string" && /^sha256:[0-9a-f]{64}$/.test(value);
|
|
3352
|
+
}
|
|
3353
|
+
var VersionConflict = class extends Error {
|
|
3354
|
+
name = "VersionConflict";
|
|
3355
|
+
id;
|
|
3356
|
+
expected;
|
|
3357
|
+
actual;
|
|
3358
|
+
constructor(id, expected, actual) {
|
|
3359
|
+
super(
|
|
3360
|
+
`version conflict on '${id}': expected ${expected ?? "absent"}, found ${actual ?? "none"} (the document changed since you read it \u2014 re-read and retry)`
|
|
3361
|
+
);
|
|
3362
|
+
this.id = id;
|
|
3363
|
+
this.expected = expected;
|
|
3364
|
+
this.actual = actual;
|
|
3365
|
+
}
|
|
3366
|
+
};
|
|
3367
|
+
|
|
3368
|
+
// ../core/src/meaningful-change-time.ts
|
|
3369
|
+
function meaningfulChangeTimeField(frontmatter2) {
|
|
3370
|
+
const generated = frontmatter2.generated;
|
|
3371
|
+
if (generated !== null && typeof generated === "object" && !Array.isArray(generated) && generated.at !== void 0) return "generated.at";
|
|
3372
|
+
return "timestamp";
|
|
3373
|
+
}
|
|
3374
|
+
function meaningfulChangeTimeValue(frontmatter2) {
|
|
3375
|
+
return meaningfulChangeTimeField(frontmatter2) === "generated.at" ? frontmatter2.generated.at : frontmatter2.timestamp;
|
|
3376
|
+
}
|
|
3377
|
+
|
|
3378
|
+
// ../core/src/verification.ts
|
|
3379
|
+
var TRUST_TIERS = Object.freeze([
|
|
3380
|
+
"unverified",
|
|
3381
|
+
"machine-confirmed",
|
|
3382
|
+
"human-reviewed"
|
|
3383
|
+
]);
|
|
3384
|
+
var ISO_INSTANT = /^(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(?:([Zz])|([+-])(\d{2})(?::?(\d{2}))?)$/;
|
|
3385
|
+
function parseIsoInstant(raw, rounding = "truncate") {
|
|
3386
|
+
const match = ISO_INSTANT.exec(raw);
|
|
3387
|
+
if (!match) return null;
|
|
3388
|
+
const [, y, mo, d, h, mi, sec = "0", frac = "0", zulu, sign, oh, om = "0"] = match;
|
|
3389
|
+
const year = Number(y);
|
|
3390
|
+
const month = Number(mo);
|
|
3391
|
+
const day = Number(d);
|
|
3392
|
+
const hour = Number(h);
|
|
3393
|
+
const minute = Number(mi);
|
|
3394
|
+
const second = Number(sec);
|
|
3395
|
+
if (month < 1 || month > 12) return null;
|
|
3396
|
+
const probe = /* @__PURE__ */ new Date(0);
|
|
3397
|
+
probe.setUTCFullYear(year, month, 0);
|
|
3398
|
+
if (day < 1 || day > probe.getUTCDate()) return null;
|
|
3399
|
+
if (hour > 23 || minute > 59 || second > 59) return null;
|
|
3400
|
+
let offsetMinutes = 0;
|
|
3401
|
+
if (!zulu) {
|
|
3402
|
+
const offsetHours = Number(oh);
|
|
3403
|
+
const offsetMins = Number(om);
|
|
3404
|
+
if (offsetHours > 23 || offsetMins > 59) return null;
|
|
3405
|
+
offsetMinutes = (sign === "-" ? -1 : 1) * (offsetHours * 60 + offsetMins);
|
|
3406
|
+
}
|
|
3407
|
+
const millis = Number(frac.padEnd(3, "0").slice(0, 3));
|
|
3408
|
+
const instant = /* @__PURE__ */ new Date(0);
|
|
3409
|
+
instant.setUTCFullYear(year, month - 1, day);
|
|
3410
|
+
instant.setUTCHours(hour, minute, second, millis);
|
|
3411
|
+
const remainder = rounding === "ceil" && /[1-9]/.test(frac.slice(3)) ? 1 : 0;
|
|
3412
|
+
return instant.getTime() - offsetMinutes * 6e4 + remainder;
|
|
3413
|
+
}
|
|
3414
|
+
|
|
3415
|
+
// ../core/src/freshness.ts
|
|
3416
|
+
function parseTimestamp(ts, okfVersion) {
|
|
3417
|
+
if (okfVersion === "0.2") return typeof ts === "string" ? parseIsoInstant(ts) : null;
|
|
3418
|
+
if (ts instanceof Date) {
|
|
3419
|
+
const ms2 = ts.getTime();
|
|
3420
|
+
return Number.isNaN(ms2) ? null : ms2;
|
|
3421
|
+
}
|
|
3422
|
+
if (typeof ts === "number") {
|
|
3423
|
+
return Number.isFinite(ts) ? ts : null;
|
|
3424
|
+
}
|
|
3425
|
+
if (typeof ts !== "string" || ts.trim() === "") return null;
|
|
3426
|
+
const ms = Date.parse(ts);
|
|
3427
|
+
return Number.isNaN(ms) ? null : ms;
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
// ../core/src/okf-lifecycle.ts
|
|
3431
|
+
var OKF_LIFECYCLE_STATUSES = Object.freeze(["draft", "stable", "deprecated"]);
|
|
3432
|
+
function isOkfLifecycleStatus(value) {
|
|
3433
|
+
return typeof value === "string" && OKF_LIFECYCLE_STATUSES.includes(value);
|
|
3434
|
+
}
|
|
3435
|
+
|
|
3436
|
+
// ../core/src/mutation-attribution.ts
|
|
3437
|
+
var SUPERBEE_UPDATED_BY_FIELD = "superbee_updated_by";
|
|
3438
|
+
function nonEmptyString(value) {
|
|
3439
|
+
return typeof value === "string" && value.trim() !== "" ? value.trim() : void 0;
|
|
3440
|
+
}
|
|
3441
|
+
function mutationActorFromFrontmatter(frontmatter2) {
|
|
3442
|
+
return nonEmptyString(frontmatter2[SUPERBEE_UPDATED_BY_FIELD]) ?? nonEmptyString(frontmatter2.updated_by) ?? nonEmptyString(frontmatter2.actor);
|
|
3443
|
+
}
|
|
3444
|
+
|
|
3426
3445
|
// ../core/src/portable-frontmatter.ts
|
|
3427
3446
|
var import_js_yaml2 = __toESM(require_js_yaml2(), 1);
|
|
3428
3447
|
function parseLeadingFrontmatter(raw, context) {
|
|
@@ -4857,25 +4876,6 @@ function sha256HexOfUtf8(input) {
|
|
|
4857
4876
|
return sha256HexOfBytes(encoder.encode(input));
|
|
4858
4877
|
}
|
|
4859
4878
|
|
|
4860
|
-
// ../core/src/version-transport.ts
|
|
4861
|
-
function isContentVersion(value) {
|
|
4862
|
-
return typeof value === "string" && /^sha256:[0-9a-f]{64}$/.test(value);
|
|
4863
|
-
}
|
|
4864
|
-
var VersionConflict = class extends Error {
|
|
4865
|
-
name = "VersionConflict";
|
|
4866
|
-
id;
|
|
4867
|
-
expected;
|
|
4868
|
-
actual;
|
|
4869
|
-
constructor(id, expected, actual) {
|
|
4870
|
-
super(
|
|
4871
|
-
`version conflict on '${id}': expected ${expected ?? "absent"}, found ${actual ?? "none"} (the document changed since you read it \u2014 re-read and retry)`
|
|
4872
|
-
);
|
|
4873
|
-
this.id = id;
|
|
4874
|
-
this.expected = expected;
|
|
4875
|
-
this.actual = actual;
|
|
4876
|
-
}
|
|
4877
|
-
};
|
|
4878
|
-
|
|
4879
4879
|
// ../core/src/versioning.ts
|
|
4880
4880
|
function sha256Hex(input) {
|
|
4881
4881
|
return sha256HexOfUtf8(input);
|
package/dist/publication.mjs
CHANGED
|
@@ -30951,16 +30951,6 @@ function stringifyDoc(frontmatter2, body) {
|
|
|
30951
30951
|
return stringifyWithData(frontmatter2, body);
|
|
30952
30952
|
}
|
|
30953
30953
|
|
|
30954
|
-
// ../core/src/meaningful-change-time.ts
|
|
30955
|
-
function meaningfulChangeTimeField(frontmatter2) {
|
|
30956
|
-
const generated = frontmatter2.generated;
|
|
30957
|
-
if (generated !== null && typeof generated === "object" && !Array.isArray(generated) && generated.at !== void 0) return "generated.at";
|
|
30958
|
-
return "timestamp";
|
|
30959
|
-
}
|
|
30960
|
-
function meaningfulChangeTimeValue(frontmatter2) {
|
|
30961
|
-
return meaningfulChangeTimeField(frontmatter2) === "generated.at" ? frontmatter2.generated.at : frontmatter2.timestamp;
|
|
30962
|
-
}
|
|
30963
|
-
|
|
30964
30954
|
// ../core/src/errors.ts
|
|
30965
30955
|
var InvalidInputError = class extends Error {
|
|
30966
30956
|
constructor(message) {
|
|
@@ -30992,73 +30982,6 @@ var ConcurrentReplacementError = class extends Error {
|
|
|
30992
30982
|
}
|
|
30993
30983
|
};
|
|
30994
30984
|
|
|
30995
|
-
// ../core/src/verification.ts
|
|
30996
|
-
var TRUST_TIERS = Object.freeze([
|
|
30997
|
-
"unverified",
|
|
30998
|
-
"machine-confirmed",
|
|
30999
|
-
"human-reviewed"
|
|
31000
|
-
]);
|
|
31001
|
-
var ISO_INSTANT = /^(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(?:([Zz])|([+-])(\d{2})(?::?(\d{2}))?)$/;
|
|
31002
|
-
function parseIsoInstant(raw, rounding = "truncate") {
|
|
31003
|
-
const match = ISO_INSTANT.exec(raw);
|
|
31004
|
-
if (!match) return null;
|
|
31005
|
-
const [, y, mo, d, h, mi, sec = "0", frac = "0", zulu, sign, oh, om = "0"] = match;
|
|
31006
|
-
const year = Number(y);
|
|
31007
|
-
const month = Number(mo);
|
|
31008
|
-
const day = Number(d);
|
|
31009
|
-
const hour = Number(h);
|
|
31010
|
-
const minute = Number(mi);
|
|
31011
|
-
const second = Number(sec);
|
|
31012
|
-
if (month < 1 || month > 12) return null;
|
|
31013
|
-
const probe = /* @__PURE__ */ new Date(0);
|
|
31014
|
-
probe.setUTCFullYear(year, month, 0);
|
|
31015
|
-
if (day < 1 || day > probe.getUTCDate()) return null;
|
|
31016
|
-
if (hour > 23 || minute > 59 || second > 59) return null;
|
|
31017
|
-
let offsetMinutes = 0;
|
|
31018
|
-
if (!zulu) {
|
|
31019
|
-
const offsetHours = Number(oh);
|
|
31020
|
-
const offsetMins = Number(om);
|
|
31021
|
-
if (offsetHours > 23 || offsetMins > 59) return null;
|
|
31022
|
-
offsetMinutes = (sign === "-" ? -1 : 1) * (offsetHours * 60 + offsetMins);
|
|
31023
|
-
}
|
|
31024
|
-
const millis = Number(frac.padEnd(3, "0").slice(0, 3));
|
|
31025
|
-
const instant = /* @__PURE__ */ new Date(0);
|
|
31026
|
-
instant.setUTCFullYear(year, month - 1, day);
|
|
31027
|
-
instant.setUTCHours(hour, minute, second, millis);
|
|
31028
|
-
const remainder = rounding === "ceil" && /[1-9]/.test(frac.slice(3)) ? 1 : 0;
|
|
31029
|
-
return instant.getTime() - offsetMinutes * 6e4 + remainder;
|
|
31030
|
-
}
|
|
31031
|
-
|
|
31032
|
-
// ../core/src/freshness.ts
|
|
31033
|
-
function parseTimestamp(ts, okfVersion) {
|
|
31034
|
-
if (okfVersion === "0.2") return typeof ts === "string" ? parseIsoInstant(ts) : null;
|
|
31035
|
-
if (ts instanceof Date) {
|
|
31036
|
-
const ms2 = ts.getTime();
|
|
31037
|
-
return Number.isNaN(ms2) ? null : ms2;
|
|
31038
|
-
}
|
|
31039
|
-
if (typeof ts === "number") {
|
|
31040
|
-
return Number.isFinite(ts) ? ts : null;
|
|
31041
|
-
}
|
|
31042
|
-
if (typeof ts !== "string" || ts.trim() === "") return null;
|
|
31043
|
-
const ms = Date.parse(ts);
|
|
31044
|
-
return Number.isNaN(ms) ? null : ms;
|
|
31045
|
-
}
|
|
31046
|
-
|
|
31047
|
-
// ../core/src/okf-lifecycle.ts
|
|
31048
|
-
var OKF_LIFECYCLE_STATUSES = Object.freeze(["draft", "stable", "deprecated"]);
|
|
31049
|
-
function isOkfLifecycleStatus(value) {
|
|
31050
|
-
return typeof value === "string" && OKF_LIFECYCLE_STATUSES.includes(value);
|
|
31051
|
-
}
|
|
31052
|
-
|
|
31053
|
-
// ../core/src/mutation-attribution.ts
|
|
31054
|
-
var SUPERBEE_UPDATED_BY_FIELD = "superbee_updated_by";
|
|
31055
|
-
function nonEmptyString(value) {
|
|
31056
|
-
return typeof value === "string" && value.trim() !== "" ? value.trim() : void 0;
|
|
31057
|
-
}
|
|
31058
|
-
function mutationActorFromFrontmatter(frontmatter2) {
|
|
31059
|
-
return nonEmptyString(frontmatter2[SUPERBEE_UPDATED_BY_FIELD]) ?? nonEmptyString(frontmatter2.updated_by) ?? nonEmptyString(frontmatter2.actor);
|
|
31060
|
-
}
|
|
31061
|
-
|
|
31062
30985
|
// ../core/src/paths.ts
|
|
31063
30986
|
var RESERVED_FILENAMES = ["index.md", "log.md"];
|
|
31064
30987
|
function compareStorageKeys(a, b) {
|
|
@@ -31377,6 +31300,102 @@ function parseLinksFromDoc(doc) {
|
|
|
31377
31300
|
return links;
|
|
31378
31301
|
}
|
|
31379
31302
|
|
|
31303
|
+
// ../core/src/version-transport.ts
|
|
31304
|
+
function isContentVersion(value) {
|
|
31305
|
+
return typeof value === "string" && /^sha256:[0-9a-f]{64}$/.test(value);
|
|
31306
|
+
}
|
|
31307
|
+
var VersionConflict = class extends Error {
|
|
31308
|
+
name = "VersionConflict";
|
|
31309
|
+
id;
|
|
31310
|
+
expected;
|
|
31311
|
+
actual;
|
|
31312
|
+
constructor(id, expected, actual) {
|
|
31313
|
+
super(
|
|
31314
|
+
`version conflict on '${id}': expected ${expected ?? "absent"}, found ${actual ?? "none"} (the document changed since you read it \u2014 re-read and retry)`
|
|
31315
|
+
);
|
|
31316
|
+
this.id = id;
|
|
31317
|
+
this.expected = expected;
|
|
31318
|
+
this.actual = actual;
|
|
31319
|
+
}
|
|
31320
|
+
};
|
|
31321
|
+
|
|
31322
|
+
// ../core/src/meaningful-change-time.ts
|
|
31323
|
+
function meaningfulChangeTimeField(frontmatter2) {
|
|
31324
|
+
const generated = frontmatter2.generated;
|
|
31325
|
+
if (generated !== null && typeof generated === "object" && !Array.isArray(generated) && generated.at !== void 0) return "generated.at";
|
|
31326
|
+
return "timestamp";
|
|
31327
|
+
}
|
|
31328
|
+
function meaningfulChangeTimeValue(frontmatter2) {
|
|
31329
|
+
return meaningfulChangeTimeField(frontmatter2) === "generated.at" ? frontmatter2.generated.at : frontmatter2.timestamp;
|
|
31330
|
+
}
|
|
31331
|
+
|
|
31332
|
+
// ../core/src/verification.ts
|
|
31333
|
+
var TRUST_TIERS = Object.freeze([
|
|
31334
|
+
"unverified",
|
|
31335
|
+
"machine-confirmed",
|
|
31336
|
+
"human-reviewed"
|
|
31337
|
+
]);
|
|
31338
|
+
var ISO_INSTANT = /^(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(?:([Zz])|([+-])(\d{2})(?::?(\d{2}))?)$/;
|
|
31339
|
+
function parseIsoInstant(raw, rounding = "truncate") {
|
|
31340
|
+
const match = ISO_INSTANT.exec(raw);
|
|
31341
|
+
if (!match) return null;
|
|
31342
|
+
const [, y, mo, d, h, mi, sec = "0", frac = "0", zulu, sign, oh, om = "0"] = match;
|
|
31343
|
+
const year = Number(y);
|
|
31344
|
+
const month = Number(mo);
|
|
31345
|
+
const day = Number(d);
|
|
31346
|
+
const hour = Number(h);
|
|
31347
|
+
const minute = Number(mi);
|
|
31348
|
+
const second = Number(sec);
|
|
31349
|
+
if (month < 1 || month > 12) return null;
|
|
31350
|
+
const probe = /* @__PURE__ */ new Date(0);
|
|
31351
|
+
probe.setUTCFullYear(year, month, 0);
|
|
31352
|
+
if (day < 1 || day > probe.getUTCDate()) return null;
|
|
31353
|
+
if (hour > 23 || minute > 59 || second > 59) return null;
|
|
31354
|
+
let offsetMinutes = 0;
|
|
31355
|
+
if (!zulu) {
|
|
31356
|
+
const offsetHours = Number(oh);
|
|
31357
|
+
const offsetMins = Number(om);
|
|
31358
|
+
if (offsetHours > 23 || offsetMins > 59) return null;
|
|
31359
|
+
offsetMinutes = (sign === "-" ? -1 : 1) * (offsetHours * 60 + offsetMins);
|
|
31360
|
+
}
|
|
31361
|
+
const millis = Number(frac.padEnd(3, "0").slice(0, 3));
|
|
31362
|
+
const instant = /* @__PURE__ */ new Date(0);
|
|
31363
|
+
instant.setUTCFullYear(year, month - 1, day);
|
|
31364
|
+
instant.setUTCHours(hour, minute, second, millis);
|
|
31365
|
+
const remainder = rounding === "ceil" && /[1-9]/.test(frac.slice(3)) ? 1 : 0;
|
|
31366
|
+
return instant.getTime() - offsetMinutes * 6e4 + remainder;
|
|
31367
|
+
}
|
|
31368
|
+
|
|
31369
|
+
// ../core/src/freshness.ts
|
|
31370
|
+
function parseTimestamp(ts, okfVersion) {
|
|
31371
|
+
if (okfVersion === "0.2") return typeof ts === "string" ? parseIsoInstant(ts) : null;
|
|
31372
|
+
if (ts instanceof Date) {
|
|
31373
|
+
const ms2 = ts.getTime();
|
|
31374
|
+
return Number.isNaN(ms2) ? null : ms2;
|
|
31375
|
+
}
|
|
31376
|
+
if (typeof ts === "number") {
|
|
31377
|
+
return Number.isFinite(ts) ? ts : null;
|
|
31378
|
+
}
|
|
31379
|
+
if (typeof ts !== "string" || ts.trim() === "") return null;
|
|
31380
|
+
const ms = Date.parse(ts);
|
|
31381
|
+
return Number.isNaN(ms) ? null : ms;
|
|
31382
|
+
}
|
|
31383
|
+
|
|
31384
|
+
// ../core/src/okf-lifecycle.ts
|
|
31385
|
+
var OKF_LIFECYCLE_STATUSES = Object.freeze(["draft", "stable", "deprecated"]);
|
|
31386
|
+
function isOkfLifecycleStatus(value) {
|
|
31387
|
+
return typeof value === "string" && OKF_LIFECYCLE_STATUSES.includes(value);
|
|
31388
|
+
}
|
|
31389
|
+
|
|
31390
|
+
// ../core/src/mutation-attribution.ts
|
|
31391
|
+
var SUPERBEE_UPDATED_BY_FIELD = "superbee_updated_by";
|
|
31392
|
+
function nonEmptyString(value) {
|
|
31393
|
+
return typeof value === "string" && value.trim() !== "" ? value.trim() : void 0;
|
|
31394
|
+
}
|
|
31395
|
+
function mutationActorFromFrontmatter(frontmatter2) {
|
|
31396
|
+
return nonEmptyString(frontmatter2[SUPERBEE_UPDATED_BY_FIELD]) ?? nonEmptyString(frontmatter2.updated_by) ?? nonEmptyString(frontmatter2.actor);
|
|
31397
|
+
}
|
|
31398
|
+
|
|
31380
31399
|
// ../core/src/portable-frontmatter.ts
|
|
31381
31400
|
var import_js_yaml2 = __toESM(require_js_yaml2(), 1);
|
|
31382
31401
|
function parseLeadingFrontmatter(raw, context) {
|
|
@@ -32811,25 +32830,6 @@ function sha256HexOfUtf8(input) {
|
|
|
32811
32830
|
return sha256HexOfBytes(encoder.encode(input));
|
|
32812
32831
|
}
|
|
32813
32832
|
|
|
32814
|
-
// ../core/src/version-transport.ts
|
|
32815
|
-
function isContentVersion(value) {
|
|
32816
|
-
return typeof value === "string" && /^sha256:[0-9a-f]{64}$/.test(value);
|
|
32817
|
-
}
|
|
32818
|
-
var VersionConflict = class extends Error {
|
|
32819
|
-
name = "VersionConflict";
|
|
32820
|
-
id;
|
|
32821
|
-
expected;
|
|
32822
|
-
actual;
|
|
32823
|
-
constructor(id, expected, actual) {
|
|
32824
|
-
super(
|
|
32825
|
-
`version conflict on '${id}': expected ${expected ?? "absent"}, found ${actual ?? "none"} (the document changed since you read it \u2014 re-read and retry)`
|
|
32826
|
-
);
|
|
32827
|
-
this.id = id;
|
|
32828
|
-
this.expected = expected;
|
|
32829
|
-
this.actual = actual;
|
|
32830
|
-
}
|
|
32831
|
-
};
|
|
32832
|
-
|
|
32833
32833
|
// ../core/src/versioning.ts
|
|
32834
32834
|
function sha256Hex(input) {
|
|
32835
32835
|
return sha256HexOfUtf8(input);
|