@intellectual-frontiers/ergonex 0.3.5 → 0.3.6

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/mod.js CHANGED
@@ -911,7 +911,7 @@ function toSarif(findings, tool = "ergonex") {
911
911
  }
912
912
 
913
913
  // src/state-record.ts
914
- var ERGONEX_VERSION = "0.3.5";
914
+ var ERGONEX_VERSION = "0.3.6";
915
915
  var STATE_RECORD_PATH = ".ergonex/state.auto.json";
916
916
  var EMPTY_RECORD = {
917
917
  ergonex: ERGONEX_VERSION,
@@ -14,7 +14,7 @@ import { type Sha256 } from "@intellectual-frontiers/crypto";
14
14
  import { type Finding } from "./findings.js";
15
15
  import { type GeneratedFile } from "./render.js";
16
16
  /** The version of Ergonex the record names. */
17
- export declare const ERGONEX_VERSION = "0.3.5";
17
+ export declare const ERGONEX_VERSION = "0.3.6";
18
18
  /** Where the state record is, below the root. */
19
19
  export declare const STATE_RECORD_PATH = ".ergonex/state.auto.json";
20
20
  /** One generated file as it was written. */
package/ergonex.mjs CHANGED
@@ -3859,7 +3859,7 @@ function checkFiles(files, repositories) {
3859
3859
  }
3860
3860
 
3861
3861
  // src/state-record.ts
3862
- var ERGONEX_VERSION = "0.3.5";
3862
+ var ERGONEX_VERSION = "0.3.6";
3863
3863
  var STATE_RECORD_PATH = ".ergonex/state.auto.json";
3864
3864
  var EMPTY_RECORD = {
3865
3865
  ergonex: ERGONEX_VERSION,
@@ -10581,90 +10581,9 @@ var CONTROL2 = new RegExp(`[${String.fromCharCode(0)}-${String.fromCharCode(31)}
10581
10581
  var parseSpanId2 = parseSpanId;
10582
10582
  var parseTraceId2 = parseTraceId;
10583
10583
 
10584
- // ../ts/kernel/grc.ts
10585
- var INSTANT = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:[.,](\d{1,9}))?(Z|[+-]\d{2}:\d{2})$/i;
10586
- var CANONICAL_INSTANT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
10587
- function instantOf(text) {
10588
- const m = INSTANT.exec(text.trim());
10589
- if (m === null)
10590
- return;
10591
- const [y, mo, d, h, mi, s] = [m[1], m[2], m[3], m[4], m[5], m[6]].map((x) => Number(x ?? ""));
10592
- if (y === undefined || mo === undefined || d === undefined || h === undefined || mi === undefined || s === undefined)
10593
- return;
10594
- const ms = Number((m[7] ?? "").padEnd(3, "0").slice(0, 3));
10595
- if (mo < 1 || mo > 12 || d < 1 || d > daysInMonth(y, mo) || h > 23 || mi > 59 || s > 59)
10596
- return;
10597
- const zone = (m[8] ?? "Z").toUpperCase();
10598
- let offset = 0;
10599
- if (zone !== "Z") {
10600
- const oh = Number(zone.slice(1, 3));
10601
- const om = Number(zone.slice(4, 6));
10602
- if (oh > 23 || om > 59)
10603
- return;
10604
- offset = (zone.startsWith("-") ? -1 : 1) * (oh * 60 + om) * 60000;
10605
- }
10606
- const date = new Date(0);
10607
- date.setUTCFullYear(y, mo - 1, d);
10608
- date.setUTCHours(h, mi, s, ms);
10609
- return instantFromEpochMs(date.getTime() - offset);
10610
- }
10611
- function instantFromEpochMs(ms) {
10612
- if (!Number.isFinite(ms))
10613
- return;
10614
- const date = new Date(Math.trunc(ms));
10615
- if (Number.isNaN(date.getTime()))
10616
- return;
10617
- const text = date.toISOString();
10618
- return CANONICAL_INSTANT.test(text) ? text : undefined;
10619
- }
10620
- function daysInMonth(year, month) {
10621
- const leap = year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
10622
- return month === 2 ? leap ? 29 : 28 : [4, 6, 9, 11].includes(month) ? 30 : 31;
10623
- }
10624
- var DURATION = /^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:[.,]\d+)?)S)?)?$/;
10625
- function parseDuration(text) {
10626
- const m = DURATION.exec(text);
10627
- if (m === null || text === "P" || text.endsWith("T"))
10628
- return err({ kind: "duration", text });
10629
- const n = (i) => Number((m[i] ?? "0").replace(",", "."));
10630
- return ok({ text, years: n(1), months: n(2), weeks: n(3), days: n(4), hours: n(5), minutes: n(6), seconds: n(7) });
10631
- }
10632
- function duration(text) {
10633
- const r = parseDuration(text);
10634
- if (r.kind === "err")
10635
- throw new Error(`not an ISO 8601 duration: ${JSON.stringify(text)}`);
10636
- return r.value;
10637
- }
10584
+ // ../test/src/record.ts
10638
10585
  var ROLE = /^[a-z][a-z0-9]*(?:[-_./][a-z0-9]+)*$/;
10639
- function roleOf2(text) {
10640
- return ROLE.test(text) ? text : undefined;
10641
- }
10642
- var SEVERITIES2 = ["info", "low", "medium", "high", "critical"];
10643
- var refined = (name, f) => {
10644
- return (input, path = "$") => {
10645
- if (typeof input === "string") {
10646
- const v = f(input);
10647
- if (v !== undefined)
10648
- return ok(v);
10649
- }
10650
- return err({
10651
- kind: "decode",
10652
- path,
10653
- expected: name,
10654
- found: typeof input === "string" ? `the string ${JSON.stringify(input).slice(0, 60)}` : typeof input
10655
- });
10656
- };
10657
- };
10658
- var instantDecoder = refined("an ISO 8601 date-time with a zone", instantOf);
10659
- var roleDecoder = refined("a role (lower-case words joined by - _ . or /)", roleOf2);
10660
- var durationDecoder = refined("an ISO 8601 duration", (t) => {
10661
- const r = parseDuration(t);
10662
- return r.kind === "ok" ? r.value : undefined;
10663
- });
10664
- var severityDecoder = literal(...SEVERITIES2);
10665
- var waiverInput = mapDecoder(object({ id: string, control: string, subjects: array(string), reason: string, approvedBy: roleDecoder, grantedAt: instantDecoder }, { expiresAt: instantDecoder }), (w) => w);
10666
-
10667
- // ../ts/kernel/test-record.ts
10586
+ var roleOf2 = (text) => ROLE.test(text) ? text : undefined;
10668
10587
  var OUTCOMES = ["pass", "fail", "skip", "todo", "cancelled"];
10669
10588
  function isOutcome(text) {
10670
10589
  return OUTCOMES.includes(text);
@@ -10974,6 +10893,89 @@ var EVIDENCE_ROOT = "quality/evidence";
10974
10893
  var CASE_EVENT = "ifc.test.case";
10975
10894
  var RUN_GRADE = "E3";
10976
10895
  var NO_GRADE = "E0";
10896
+ // ../ts/kernel/grc.ts
10897
+ var INSTANT = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:[.,](\d{1,9}))?(Z|[+-]\d{2}:\d{2})$/i;
10898
+ var CANONICAL_INSTANT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
10899
+ function instantOf(text) {
10900
+ const m = INSTANT.exec(text.trim());
10901
+ if (m === null)
10902
+ return;
10903
+ const [y, mo, d, h, mi, s] = [m[1], m[2], m[3], m[4], m[5], m[6]].map((x) => Number(x ?? ""));
10904
+ if (y === undefined || mo === undefined || d === undefined || h === undefined || mi === undefined || s === undefined)
10905
+ return;
10906
+ const ms = Number((m[7] ?? "").padEnd(3, "0").slice(0, 3));
10907
+ if (mo < 1 || mo > 12 || d < 1 || d > daysInMonth(y, mo) || h > 23 || mi > 59 || s > 59)
10908
+ return;
10909
+ const zone = (m[8] ?? "Z").toUpperCase();
10910
+ let offset = 0;
10911
+ if (zone !== "Z") {
10912
+ const oh = Number(zone.slice(1, 3));
10913
+ const om = Number(zone.slice(4, 6));
10914
+ if (oh > 23 || om > 59)
10915
+ return;
10916
+ offset = (zone.startsWith("-") ? -1 : 1) * (oh * 60 + om) * 60000;
10917
+ }
10918
+ const date = new Date(0);
10919
+ date.setUTCFullYear(y, mo - 1, d);
10920
+ date.setUTCHours(h, mi, s, ms);
10921
+ return instantFromEpochMs(date.getTime() - offset);
10922
+ }
10923
+ function instantFromEpochMs(ms) {
10924
+ if (!Number.isFinite(ms))
10925
+ return;
10926
+ const date = new Date(Math.trunc(ms));
10927
+ if (Number.isNaN(date.getTime()))
10928
+ return;
10929
+ const text = date.toISOString();
10930
+ return CANONICAL_INSTANT.test(text) ? text : undefined;
10931
+ }
10932
+ function daysInMonth(year, month) {
10933
+ const leap = year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
10934
+ return month === 2 ? leap ? 29 : 28 : [4, 6, 9, 11].includes(month) ? 30 : 31;
10935
+ }
10936
+ var DURATION = /^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:[.,]\d+)?)S)?)?$/;
10937
+ function parseDuration(text) {
10938
+ const m = DURATION.exec(text);
10939
+ if (m === null || text === "P" || text.endsWith("T"))
10940
+ return err({ kind: "duration", text });
10941
+ const n = (i) => Number((m[i] ?? "0").replace(",", "."));
10942
+ return ok({ text, years: n(1), months: n(2), weeks: n(3), days: n(4), hours: n(5), minutes: n(6), seconds: n(7) });
10943
+ }
10944
+ function duration(text) {
10945
+ const r = parseDuration(text);
10946
+ if (r.kind === "err")
10947
+ throw new Error(`not an ISO 8601 duration: ${JSON.stringify(text)}`);
10948
+ return r.value;
10949
+ }
10950
+ var ROLE2 = /^[a-z][a-z0-9]*(?:[-_./][a-z0-9]+)*$/;
10951
+ function roleOf3(text) {
10952
+ return ROLE2.test(text) ? text : undefined;
10953
+ }
10954
+ var SEVERITIES2 = ["info", "low", "medium", "high", "critical"];
10955
+ var refined = (name, f) => {
10956
+ return (input, path = "$") => {
10957
+ if (typeof input === "string") {
10958
+ const v = f(input);
10959
+ if (v !== undefined)
10960
+ return ok(v);
10961
+ }
10962
+ return err({
10963
+ kind: "decode",
10964
+ path,
10965
+ expected: name,
10966
+ found: typeof input === "string" ? `the string ${JSON.stringify(input).slice(0, 60)}` : typeof input
10967
+ });
10968
+ };
10969
+ };
10970
+ var instantDecoder = refined("an ISO 8601 date-time with a zone", instantOf);
10971
+ var roleDecoder = refined("a role (lower-case words joined by - _ . or /)", roleOf3);
10972
+ var durationDecoder = refined("an ISO 8601 duration", (t) => {
10973
+ const r = parseDuration(t);
10974
+ return r.kind === "ok" ? r.value : undefined;
10975
+ });
10976
+ var severityDecoder = literal(...SEVERITIES2);
10977
+ var waiverInput = mapDecoder(object({ id: string, control: string, subjects: array(string), reason: string, approvedBy: roleDecoder, grantedAt: instantDecoder }, { expiresAt: instantDecoder }), (w) => w);
10978
+
10977
10979
  // ../ts/kernel/evidence.ts
10978
10980
  var GENESIS = "0".repeat(64);
10979
10981
  var sha256Decoder = (input, path = "$") => {
@@ -12071,15 +12073,9 @@ function placesOf(env, os) {
12071
12073
  const shims = d.bin ?? rules.join(tools, "bin");
12072
12074
  return ok({ os, data: d.data, state: d.state, cache: d.cache, tools, shims });
12073
12075
  }
12074
- // ../ts/kernel/attest.ts
12075
- var PASSING = new Set(["pass"]);
12076
+
12076
12077
  // src/platform/k-test-record.ts
12077
- var TEST_SCOPE2 = TEST_SCOPE;
12078
12078
  var installationFromEnv2 = installationFromEnv;
12079
- var installationResource2 = installationResource;
12080
- var testCaseLog2 = testCaseLog;
12081
- var testCaseSpan2 = testCaseSpan;
12082
- var testId2 = testId;
12083
12079
 
12084
12080
  // src/setup/evidence.ts
12085
12081
  function optionNames(argv) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intellectual-frontiers/ergonex",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Ergonex, the workspaces management of Intellectual Frontiers: one command that sets up, configures and operates a team's software repositories, package registries and builds, on Windows, macOS and Linux, with Bun by default and Node 26 as the backup.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,11 +19,11 @@
19
19
  }
20
20
  },
21
21
  "dependencies": {
22
- "@intellectual-frontiers/core": "0.1.1",
23
- "@intellectual-frontiers/crypto": "0.1.1",
24
- "@intellectual-frontiers/formats": "0.1.1",
25
- "@intellectual-frontiers/net": "0.1.0",
26
- "@intellectual-frontiers/terminal": "0.1.1"
22
+ "@intellectual-frontiers/core": "0.1.2",
23
+ "@intellectual-frontiers/crypto": "0.1.2",
24
+ "@intellectual-frontiers/formats": "0.1.2",
25
+ "@intellectual-frontiers/net": "0.1.1",
26
+ "@intellectual-frontiers/terminal": "0.1.2"
27
27
  },
28
28
  "files": [
29
29
  "dist",