@garygentry/system1 0.3.2 → 0.4.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/bundle/chunks/{bin-3EWFISFQ.mjs → bin-TIEUYIP3.mjs} +18 -14
- package/dist/bundle/chunks/{chunk-5LVOFZF3.mjs → chunk-FU3D2MBS.mjs} +33 -4
- package/dist/bundle/chunks/{chunk-5TUBFH7M.mjs → chunk-QYUSJUFX.mjs} +894 -144
- package/dist/bundle/chunks/{chunk-4ZZ3ZSJN.mjs → chunk-WZIVOY5Q.mjs} +6 -2
- package/dist/bundle/chunks/{chunk-BGL272OK.mjs → chunk-XNRV73UE.mjs} +6 -2
- package/dist/bundle/chunks/{config-UUPD2JL4.mjs → config-KXGUNAJR.mjs} +3 -3
- package/dist/bundle/chunks/{decide-AAXD3ITT.mjs → decide-HI5CUH3C.mjs} +4 -4
- package/dist/bundle/chunks/{doctor-KPJ5KVLS.mjs → doctor-NDV3Y6T7.mjs} +2 -2
- package/dist/bundle/chunks/{misc-IW4I3SO6.mjs → misc-6SDKH2PI.mjs} +3 -3
- package/dist/bundle/chunks/opportunities-ONEIYAG3.mjs +144 -0
- package/dist/bundle/chunks/{route-7N3J5NP6.mjs → route-BF5J2NLU.mjs} +3 -3
- package/dist/bundle/chunks/{spec-RKA3K6ZZ.mjs → spec-GLTPEEON.mjs} +42 -7
- package/dist/bundle/decide.mjs +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
VERSION,
|
|
7
7
|
emit,
|
|
8
8
|
extractFormat
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WZIVOY5Q.mjs";
|
|
10
10
|
|
|
11
11
|
// src/bin.ts
|
|
12
12
|
import { readFileSync } from "node:fs";
|
|
@@ -21,8 +21,9 @@ Commands:
|
|
|
21
21
|
many One question set over many items (fan-out), filtered to what matters
|
|
22
22
|
usage Measured spend from the ledger (--session, --since)
|
|
23
23
|
config Show resolved config; \`config egress allow|deny|status\` for consent
|
|
24
|
-
spec list | show <name> | validate [name|path] | check <name> [--live]
|
|
25
|
-
|
|
24
|
+
spec list | show <name> | validate [name|path] | lint [name|path] | check <name> [--live]
|
|
25
|
+
opportunities add --file <json> | list [--keep \u2026] | check: the scout backlog (local)
|
|
26
|
+
schema Print the JSON Schema of a tool's input (\`decide schema\` lists them)
|
|
26
27
|
route Does a prompt call for the ask skill? (--text|--stdin|--hook; local, sends nothing)
|
|
27
28
|
ping Check the endpoint is reachable (no key, no spend)
|
|
28
29
|
doctor Check decide works from this shell; prints the fix for each problem
|
|
@@ -35,14 +36,15 @@ Questions: --spec <name|path> | --question name:noul:<text>
|
|
|
35
36
|
--input <file|-> (full tool input as JSON; flags override it)
|
|
36
37
|
Sources: --glob <pattern>\u2026 --file <path[:L1-L2]>\u2026 --jsonl <path>
|
|
37
38
|
--diff <range> [--staged] --text <text> --stdin
|
|
39
|
+
--exclude <glob>\u2026 (leave matching paths out; reported as filtered)
|
|
38
40
|
Split: --split file|hunk|row|join|lines:N[/overlap] (default: file; join = one state)
|
|
39
|
-
Project: --keep 'relevant>=0.7'\u2026 --sort relevant:desc --limit N --fields a,b
|
|
41
|
+
Project: --keep 'relevant>=0.7'\u2026 (all) --keep-any 'a>=0.3'\u2026 (any) --sort relevant:desc --limit N --fields a,b
|
|
40
42
|
--allow-outside (read files that resolve outside the repo)
|
|
41
43
|
Run: --dry-run --confirm --record | --replay | --live --model <id> --concurrency N
|
|
42
44
|
|
|
43
45
|
Output is one JSON envelope by default: {v, ok, command, result | error}.
|
|
44
46
|
Exit codes: 0 ok \xB7 1 failure \xB7 2 usage \xB7 3 egress refused \xB7 4 budget guard
|
|
45
|
-
5 provider error \xB7 6 replay miss
|
|
47
|
+
5 provider error \xB7 6 replay miss \xB7 7 check or lint did not pass
|
|
46
48
|
`;
|
|
47
49
|
var DEFAULT_FORMAT = "json";
|
|
48
50
|
async function main(argv, io) {
|
|
@@ -64,23 +66,25 @@ async function main(argv, io) {
|
|
|
64
66
|
}
|
|
65
67
|
switch (command) {
|
|
66
68
|
case "ask":
|
|
67
|
-
return (await import("./decide-
|
|
69
|
+
return (await import("./decide-HI5CUH3C.mjs")).runAskCommand(rest, io, format);
|
|
68
70
|
case "many":
|
|
69
|
-
return (await import("./decide-
|
|
71
|
+
return (await import("./decide-HI5CUH3C.mjs")).runManyCommand(rest, io, format);
|
|
70
72
|
case "usage":
|
|
71
|
-
return (await import("./misc-
|
|
73
|
+
return (await import("./misc-6SDKH2PI.mjs")).runUsageCommand(rest, io, format);
|
|
72
74
|
case "config":
|
|
73
|
-
return (await import("./config-
|
|
75
|
+
return (await import("./config-KXGUNAJR.mjs")).runConfigCommand(rest, io, format);
|
|
74
76
|
case "spec":
|
|
75
|
-
return (await import("./spec-
|
|
77
|
+
return (await import("./spec-GLTPEEON.mjs")).runSpecCommand(rest, io, format);
|
|
78
|
+
case "opportunities":
|
|
79
|
+
return (await import("./opportunities-ONEIYAG3.mjs")).runOpportunitiesCommand(rest, io, format);
|
|
76
80
|
case "schema":
|
|
77
|
-
return (await import("./misc-
|
|
81
|
+
return (await import("./misc-6SDKH2PI.mjs")).runSchemaCommand(rest, io, format);
|
|
78
82
|
case "route":
|
|
79
|
-
return (await import("./route-
|
|
83
|
+
return (await import("./route-BF5J2NLU.mjs")).runRouteCommand(rest, io, format);
|
|
80
84
|
case "ping":
|
|
81
|
-
return (await import("./misc-
|
|
85
|
+
return (await import("./misc-6SDKH2PI.mjs")).runPingCommand(io, format);
|
|
82
86
|
case "doctor":
|
|
83
|
-
return (await import("./doctor-
|
|
87
|
+
return (await import("./doctor-NDV3Y6T7.mjs")).runDoctorCommand(io, format);
|
|
84
88
|
case "version":
|
|
85
89
|
case "--version":
|
|
86
90
|
case "-v":
|
|
@@ -87,20 +87,48 @@ function briefSpecCheck(r) {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
lines.push(...withheld(r.skipped, { total: 0, items: 0 }));
|
|
90
|
+
if (r.lint.length) {
|
|
91
|
+
lines.push(
|
|
92
|
+
`lint: ${r.lint.length} finding(s), not part of PASSED/FAILED (decide spec lint ${r.spec})`
|
|
93
|
+
);
|
|
94
|
+
lines.push(...r.lint.map(briefFinding));
|
|
95
|
+
}
|
|
90
96
|
return lines.join("\n");
|
|
91
97
|
}
|
|
98
|
+
function briefSpecLint(r) {
|
|
99
|
+
const c = r.counts;
|
|
100
|
+
const lines = [
|
|
101
|
+
`decide spec lint: ${r.passed ? "PASSED" : "FAILED"} \xB7 ${c.specs} spec(s) \xB7 ${c.errors} error(s) \xB7 ${c.warnings} warning(s)${c.invalid ? ` \xB7 ${c.invalid} invalid` : ""}`
|
|
102
|
+
];
|
|
103
|
+
for (const s of r.specs) {
|
|
104
|
+
if (s.invalid) lines.push(` INVALID ${s.name} ${s.invalid.split("\n")[0]}`);
|
|
105
|
+
else if (s.findings.length === 0) lines.push(` ok ${s.name}`);
|
|
106
|
+
else {
|
|
107
|
+
lines.push(` ${s.name} (${s.file})`);
|
|
108
|
+
lines.push(...s.findings.map(briefFinding));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return lines.join("\n");
|
|
112
|
+
}
|
|
113
|
+
function briefFinding(f) {
|
|
114
|
+
return ` ${f.severity} ${f.check}: ${f.message}
|
|
115
|
+
fix: ${f.fix}`;
|
|
116
|
+
}
|
|
92
117
|
function distribution(probabilities) {
|
|
93
118
|
return Object.entries(probabilities).sort((a, b) => b[1] - a[1]).map(([k, p]) => `${k} ${fix(p)}`).join(" \xB7 ");
|
|
94
119
|
}
|
|
95
120
|
function withheld(skipped, redactions) {
|
|
96
121
|
const lines = [];
|
|
97
|
-
|
|
98
|
-
|
|
122
|
+
const filtered = skipped.byReason.filtered ?? 0;
|
|
123
|
+
const held = skipped.total - filtered;
|
|
124
|
+
if (held > 0) {
|
|
125
|
+
const reasons = Object.entries(skipped.byReason).filter(([k]) => k !== "filtered").map(([k, v]) => `${k} ${v}`).join(", ");
|
|
99
126
|
const excluded = skipped.sample.filter((s) => s.reason === "excluded").map((s) => s.path);
|
|
100
127
|
lines.push(
|
|
101
|
-
`withheld: ${
|
|
128
|
+
`withheld: ${held} (${reasons})${excluded.length ? ` e.g. ${excluded.join(", ")}` : ""}`
|
|
102
129
|
);
|
|
103
130
|
}
|
|
131
|
+
if (filtered > 0) lines.push(`left out by --exclude: ${filtered}`);
|
|
104
132
|
if (redactions.total > 0)
|
|
105
133
|
lines.push(
|
|
106
134
|
`redacted: ${redactions.total} secret(s) in ${redactions.items} item(s) before sending`
|
|
@@ -126,5 +154,6 @@ function firstLine(text) {
|
|
|
126
154
|
export {
|
|
127
155
|
briefMany,
|
|
128
156
|
briefAsk,
|
|
129
|
-
briefSpecCheck
|
|
157
|
+
briefSpecCheck,
|
|
158
|
+
briefSpecLint
|
|
130
159
|
};
|