@garygentry/system1 0.1.0 → 0.2.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-IIUCANF7.mjs → bin-NQTRZGKT.mjs} +9 -9
- package/dist/bundle/chunks/{chunk-V7OTO67I.mjs → chunk-JPP6DB7K.mjs} +13 -6
- package/dist/bundle/chunks/{chunk-A7ODZFMY.mjs → chunk-NDEAV2HD.mjs} +2 -2
- package/dist/bundle/chunks/{chunk-7LVHD6A5.mjs → chunk-PGNYF7TH.mjs} +1 -1
- package/dist/bundle/chunks/{config-QR35VKVT.mjs → config-6HS7JBVK.mjs} +6 -4
- package/dist/bundle/chunks/{decide-PW7REJ6Y.mjs → decide-UOND3JAL.mjs} +3 -3
- package/dist/bundle/chunks/{doctor-HAT6XVTW.mjs → doctor-YCSJSTJ2.mjs} +8 -3
- package/dist/bundle/chunks/{misc-6VZKJEN4.mjs → misc-EROARLGM.mjs} +6 -4
- package/dist/bundle/chunks/{spec-Z2LZJ5EZ.mjs → spec-GIYAEVUZ.mjs} +11 -9
- package/dist/bundle/decide.mjs +1 -1
- package/package.json +3 -3
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
VERSION,
|
|
7
7
|
emit,
|
|
8
8
|
extractFormat
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PGNYF7TH.mjs";
|
|
10
10
|
|
|
11
11
|
// src/bin.ts
|
|
12
12
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
@@ -91,21 +91,21 @@ async function main(argv, io) {
|
|
|
91
91
|
}
|
|
92
92
|
switch (command) {
|
|
93
93
|
case "ask":
|
|
94
|
-
return (await import("./decide-
|
|
94
|
+
return (await import("./decide-UOND3JAL.mjs")).runAskCommand(rest, io, format);
|
|
95
95
|
case "many":
|
|
96
|
-
return (await import("./decide-
|
|
96
|
+
return (await import("./decide-UOND3JAL.mjs")).runManyCommand(rest, io, format);
|
|
97
97
|
case "usage":
|
|
98
|
-
return (await import("./misc-
|
|
98
|
+
return (await import("./misc-EROARLGM.mjs")).runUsageCommand(rest, io, format);
|
|
99
99
|
case "config":
|
|
100
|
-
return (await import("./config-
|
|
100
|
+
return (await import("./config-6HS7JBVK.mjs")).runConfigCommand(rest, io, format);
|
|
101
101
|
case "spec":
|
|
102
|
-
return (await import("./spec-
|
|
102
|
+
return (await import("./spec-GIYAEVUZ.mjs")).runSpecCommand(rest, io, format);
|
|
103
103
|
case "schema":
|
|
104
|
-
return (await import("./misc-
|
|
104
|
+
return (await import("./misc-EROARLGM.mjs")).runSchemaCommand(rest, io, format);
|
|
105
105
|
case "ping":
|
|
106
|
-
return (await import("./misc-
|
|
106
|
+
return (await import("./misc-EROARLGM.mjs")).runPingCommand(io, format);
|
|
107
107
|
case "doctor":
|
|
108
|
-
return (await import("./doctor-
|
|
108
|
+
return (await import("./doctor-YCSJSTJ2.mjs")).runDoctorCommand(io, format);
|
|
109
109
|
case "version":
|
|
110
110
|
case "--version":
|
|
111
111
|
case "-v":
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
__require,
|
|
10
10
|
__toESM,
|
|
11
11
|
isDecisionsError
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PGNYF7TH.mjs";
|
|
13
13
|
|
|
14
14
|
// ../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js
|
|
15
15
|
var require_identity = __commonJS({
|
|
@@ -9618,7 +9618,7 @@ function setConsent(repoRoot, granted, by, now = /* @__PURE__ */ new Date()) {
|
|
|
9618
9618
|
function assertConsent(consent, repoRoot) {
|
|
9619
9619
|
if (consent.granted)
|
|
9620
9620
|
return;
|
|
9621
|
-
throw new DecisionsError("egress-refused", `This repo has not agreed to send content to the decision model's provider.
|
|
9621
|
+
throw new DecisionsError("egress-refused", `This repo has not agreed to send content to the decision model's provider. Consent is the user's: they run \`decide config egress allow\` in ${repoRoot} themselves (the setup skill explains what gets sent). Replay of recorded answers works without consent.`, { repoRoot });
|
|
9622
9622
|
}
|
|
9623
9623
|
|
|
9624
9624
|
// ../core/dist/egress/exclude.js
|
|
@@ -18822,7 +18822,12 @@ function resolvePath(cwd, path) {
|
|
|
18822
18822
|
realAbsolute = realpathSync2(absolute);
|
|
18823
18823
|
} catch {
|
|
18824
18824
|
}
|
|
18825
|
-
|
|
18825
|
+
let realCwd = cwd;
|
|
18826
|
+
try {
|
|
18827
|
+
realCwd = realpathSync2(cwd);
|
|
18828
|
+
} catch {
|
|
18829
|
+
}
|
|
18830
|
+
const real = toRel(realCwd, realAbsolute);
|
|
18826
18831
|
return {
|
|
18827
18832
|
absolute,
|
|
18828
18833
|
display: toRel(cwd, absolute),
|
|
@@ -18951,7 +18956,7 @@ function gitIgnored(cwd, paths) {
|
|
|
18951
18956
|
if (error.status === 1)
|
|
18952
18957
|
return [];
|
|
18953
18958
|
if (error.signal === "SIGKILL") {
|
|
18954
|
-
throw new DecisionsError("source-error", `git check-ignore did not answer within ${GIT_TIMEOUT_MS} ms. Name the files with --file, or run where git works.`);
|
|
18959
|
+
throw new DecisionsError("source-error", `git check-ignore did not answer within ${GIT_TIMEOUT_MS} ms, which usually means a sandbox is blocking child processes (\`decide doctor\` prints the fix for Codex). Name the files with --file, or run where git works.`);
|
|
18955
18960
|
}
|
|
18956
18961
|
throw new DecisionsError("source-error", `git check-ignore failed: ${String(error)}`);
|
|
18957
18962
|
}
|
|
@@ -19756,7 +19761,8 @@ function createDecider(options) {
|
|
|
19756
19761
|
const started = performance.now();
|
|
19757
19762
|
const record = fixtures?.lookup(namespace, request);
|
|
19758
19763
|
if (!record) {
|
|
19759
|
-
|
|
19764
|
+
const where = `(namespace "${namespace}", key ${key.slice(0, 12)}\u2026)`;
|
|
19765
|
+
throw new DecisionsError("replay-miss", transport ? `No recorded answer for this request ${where}. Record it with a live call (without --replay or SYSTEM1_REPLAY).` : `No API key is set, so only recorded answers can be used, and this request has none ${where}. Set OPENROUTER_API_KEY for a live answer (the setup skill shows where it goes).`, { namespace, key });
|
|
19760
19766
|
}
|
|
19761
19767
|
log2("replay", profile.id, ZERO);
|
|
19762
19768
|
return {
|
|
@@ -20259,7 +20265,8 @@ async function runDoctor(options) {
|
|
|
20259
20265
|
name: "key",
|
|
20260
20266
|
status: "warn",
|
|
20261
20267
|
detail: "no API key: only replay works",
|
|
20262
|
-
|
|
20268
|
+
// The file this shell would read: XDG_CONFIG_HOME moves it.
|
|
20269
|
+
fix: `set OPENROUTER_API_KEY, or write \`openrouter_api_key: <key>\` to ${join5(userConfigDir(env, options.home), "credentials")} (chmod 600)`
|
|
20263
20270
|
});
|
|
20264
20271
|
checks.push(config.egress.consent.granted ? { name: "consent", status: "ok", detail: `egress consent granted for ${config.repoRoot}` } : {
|
|
20265
20272
|
name: "consent",
|
|
@@ -2,10 +2,10 @@ import { createRequire as __decideRequire } from "node:module"; const require =
|
|
|
2
2
|
import {
|
|
3
3
|
parseFileRef,
|
|
4
4
|
parseQuestionSet
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JPP6DB7K.mjs";
|
|
6
6
|
import {
|
|
7
7
|
DecisionsError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PGNYF7TH.mjs";
|
|
9
9
|
|
|
10
10
|
// src/args.ts
|
|
11
11
|
import { readFileSync } from "node:fs";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { createRequire as __decideRequire } from "node:module"; const require = __decideRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
typedParse
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NDEAV2HD.mjs";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_EXCLUDES,
|
|
7
7
|
createContext,
|
|
8
8
|
loadConfig,
|
|
9
9
|
repoConfigPath,
|
|
10
10
|
setConsent
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JPP6DB7K.mjs";
|
|
12
12
|
import {
|
|
13
13
|
DecisionsError,
|
|
14
14
|
emit
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PGNYF7TH.mjs";
|
|
16
16
|
|
|
17
17
|
// src/commands/config.ts
|
|
18
18
|
function runConfigCommand(argv, io, format) {
|
|
@@ -24,11 +24,12 @@ function runConfigCommand(argv, io, format) {
|
|
|
24
24
|
(r, f) => f === "brief" ? brief(r) : void 0
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
|
+
var CONFIG_OPTIONS = { confirm: { type: "boolean" }, by: { type: "string" } };
|
|
27
28
|
function body(argv, io) {
|
|
28
29
|
const { values, positionals } = typedParse({
|
|
29
30
|
args: argv,
|
|
30
31
|
allowPositionals: true,
|
|
31
|
-
options:
|
|
32
|
+
options: CONFIG_OPTIONS
|
|
32
33
|
});
|
|
33
34
|
const [section = "show", action = "status"] = positionals;
|
|
34
35
|
const cwd = io.cwd ?? process.cwd();
|
|
@@ -112,5 +113,6 @@ function brief(r) {
|
|
|
112
113
|
].join("\n");
|
|
113
114
|
}
|
|
114
115
|
export {
|
|
116
|
+
CONFIG_OPTIONS,
|
|
115
117
|
runConfigCommand
|
|
116
118
|
};
|
|
@@ -6,17 +6,17 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
buildInput,
|
|
8
8
|
parseDecideFlags
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NDEAV2HD.mjs";
|
|
10
10
|
import {
|
|
11
11
|
createContext,
|
|
12
12
|
runAsk,
|
|
13
13
|
runMany
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JPP6DB7K.mjs";
|
|
15
15
|
import {
|
|
16
16
|
DecisionsError,
|
|
17
17
|
ENVELOPE_VERSION,
|
|
18
18
|
emit
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-PGNYF7TH.mjs";
|
|
20
20
|
|
|
21
21
|
// src/commands/decide.ts
|
|
22
22
|
import { readFileSync } from "node:fs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __decideRequire } from "node:module"; const require = __decideRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
runDoctor
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JPP6DB7K.mjs";
|
|
5
5
|
import {
|
|
6
6
|
emit
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PGNYF7TH.mjs";
|
|
8
8
|
|
|
9
9
|
// src/commands/doctor.ts
|
|
10
10
|
import { execFile } from "node:child_process";
|
|
@@ -25,7 +25,7 @@ function runDoctorCommand(io, format) {
|
|
|
25
25
|
}
|
|
26
26
|
function brief(r) {
|
|
27
27
|
const lines = [
|
|
28
|
-
`decide doctor: ${r
|
|
28
|
+
`decide doctor: ${headline(r)} \xB7 ${r.live ? "live ready" : "replay only"} \xB7 harness ${r.harness ?? "none"} \xB7 session ${r.session ?? "none"}`
|
|
29
29
|
];
|
|
30
30
|
for (const c of r.checks) {
|
|
31
31
|
lines.push(` ${c.status.padEnd(4)} ${c.name}: ${c.detail}`);
|
|
@@ -33,6 +33,11 @@ function brief(r) {
|
|
|
33
33
|
}
|
|
34
34
|
return lines.join("\n");
|
|
35
35
|
}
|
|
36
|
+
function headline(r) {
|
|
37
|
+
if (!r.healthy) return "PROBLEMS FOUND";
|
|
38
|
+
const missing = r.checks.filter((c) => c.status === "warn").map((c) => c.name);
|
|
39
|
+
return !r.live && missing.length > 0 ? `SETUP NEEDED (${missing.join(", ")})` : "healthy";
|
|
40
|
+
}
|
|
36
41
|
function probeVersion(path, env, timeoutMs = 2e3) {
|
|
37
42
|
return new Promise((resolve) => {
|
|
38
43
|
let settled = false;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createRequire as __decideRequire } from "node:module"; const require = __decideRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
typedParse
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NDEAV2HD.mjs";
|
|
5
5
|
import {
|
|
6
6
|
TOOL_SCHEMAS,
|
|
7
7
|
createContext,
|
|
8
8
|
ping,
|
|
9
9
|
resolveConnection,
|
|
10
10
|
runUsage
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JPP6DB7K.mjs";
|
|
12
12
|
import {
|
|
13
13
|
DecisionsError,
|
|
14
14
|
EXIT,
|
|
15
15
|
emit
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PGNYF7TH.mjs";
|
|
17
17
|
|
|
18
18
|
// src/commands/misc.ts
|
|
19
19
|
function runSchemaCommand(argv, io, format) {
|
|
@@ -28,6 +28,7 @@ function runSchemaCommand(argv, io, format) {
|
|
|
28
28
|
return TOOL_SCHEMAS[tool];
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
+
var USAGE_OPTIONS = { session: { type: "string" }, since: { type: "string" } };
|
|
31
32
|
function runUsageCommand(argv, io, format) {
|
|
32
33
|
return emit(
|
|
33
34
|
io,
|
|
@@ -36,7 +37,7 @@ function runUsageCommand(argv, io, format) {
|
|
|
36
37
|
() => {
|
|
37
38
|
const { values } = typedParse({
|
|
38
39
|
args: argv,
|
|
39
|
-
options:
|
|
40
|
+
options: USAGE_OPTIONS
|
|
40
41
|
});
|
|
41
42
|
const ctx = createContext({ ...io, cwd: io.cwd ?? process.cwd(), env: io.env });
|
|
42
43
|
return runUsage(ctx, {
|
|
@@ -72,6 +73,7 @@ async function runPingCommand(io, format) {
|
|
|
72
73
|
return failed ? EXIT.providerError : code;
|
|
73
74
|
}
|
|
74
75
|
export {
|
|
76
|
+
USAGE_OPTIONS,
|
|
75
77
|
runPingCommand,
|
|
76
78
|
runSchemaCommand,
|
|
77
79
|
runUsageCommand
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-5LVOFZF3.mjs";
|
|
5
5
|
import {
|
|
6
6
|
typedParse
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NDEAV2HD.mjs";
|
|
8
8
|
import {
|
|
9
9
|
assertExamples,
|
|
10
10
|
createContext,
|
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
listSpecs,
|
|
13
13
|
loadSpec,
|
|
14
14
|
runSpecCheck
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JPP6DB7K.mjs";
|
|
16
16
|
import {
|
|
17
17
|
DecisionsError,
|
|
18
18
|
emit
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-PGNYF7TH.mjs";
|
|
20
20
|
|
|
21
21
|
// src/commands/spec.ts
|
|
22
22
|
function runSpecCommand(argv, io, format) {
|
|
@@ -105,19 +105,21 @@ function checkInput(argv) {
|
|
|
105
105
|
...values.model ? { model: values.model } : {}
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
+
var SPEC_OPTIONS = {
|
|
109
|
+
live: { type: "boolean" },
|
|
110
|
+
replay: { type: "boolean" },
|
|
111
|
+
confirm: { type: "boolean" },
|
|
112
|
+
model: { type: "string" }
|
|
113
|
+
};
|
|
108
114
|
function parse(argv) {
|
|
109
115
|
return typedParse({
|
|
110
116
|
args: argv,
|
|
111
117
|
allowPositionals: true,
|
|
112
118
|
strict: true,
|
|
113
|
-
options:
|
|
114
|
-
live: { type: "boolean" },
|
|
115
|
-
replay: { type: "boolean" },
|
|
116
|
-
confirm: { type: "boolean" },
|
|
117
|
-
model: { type: "string" }
|
|
118
|
-
}
|
|
119
|
+
options: SPEC_OPTIONS
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
122
|
export {
|
|
123
|
+
SPEC_OPTIONS,
|
|
122
124
|
runSpecCommand
|
|
123
125
|
};
|
package/dist/bundle/decide.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@garygentry/system1",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "The `decide` CLI: typed, calibrated decisions for coding agents, hooks and CI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
],
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
23
|
-
"url": "https://github.com/garygentry/system1",
|
|
23
|
+
"url": "git+https://github.com/garygentry/system1.git",
|
|
24
24
|
"directory": "packages/cli"
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
27
27
|
"node": ">=22"
|
|
28
28
|
},
|
|
29
29
|
"bin": {
|
|
30
|
-
"decide": "
|
|
30
|
+
"decide": "dist/bundle/decide.mjs"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"dist/bundle",
|