sneakoscope 1.13.0 → 1.14.1
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/README.md +22 -4
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/crates/sks-core/src/main.rs +1 -1
- package/dist/bin/sks.js +1 -1
- package/dist/build-manifest.json +23 -1
- package/dist/cli/command-registry.d.ts +2 -0
- package/dist/cli/command-registry.js +1 -0
- package/dist/cli/feature-commands.js +58 -7
- package/dist/cli/hermes-command.d.ts +2 -0
- package/dist/cli/hermes-command.js +99 -0
- package/dist/cli/install-helpers.js +13 -3
- package/dist/commands/hermes.d.ts +2 -0
- package/dist/commands/hermes.js +5 -0
- package/dist/commands/image-ux-review.d.ts +74 -44
- package/dist/core/codex-compat/codex-0-133.d.ts +56 -0
- package/dist/core/codex-compat/codex-0-133.js +155 -0
- package/dist/core/codex-compat/codex-compat-report.d.ts +38 -10
- package/dist/core/codex-compat/codex-compat-report.js +10 -3
- package/dist/core/codex-compat/codex-version-policy.d.ts +2 -2
- package/dist/core/codex-compat/codex-version-policy.js +2 -2
- package/dist/core/codex-hooks/codex-hook-actual-discovery.d.ts +67 -0
- package/dist/core/codex-hooks/codex-hook-actual-discovery.js +326 -0
- package/dist/core/codex-hooks/codex-hook-managed-install.d.ts +33 -0
- package/dist/core/codex-hooks/codex-hook-managed-install.js +102 -0
- package/dist/core/codex-hooks/codex-hook-official-hash-oracle.d.ts +19 -0
- package/dist/core/codex-hooks/codex-hook-official-hash-oracle.js +96 -0
- package/dist/core/codex-hooks/codex-hook-official-parity.d.ts +228 -0
- package/dist/core/codex-hooks/codex-hook-official-parity.js +158 -0
- package/dist/core/codex-hooks/codex-hook-state-writer.d.ts +21 -1
- package/dist/core/codex-hooks/codex-hook-state-writer.js +16 -1
- package/dist/core/codex-hooks/codex-hook-trust-doctor.d.ts +50 -0
- package/dist/core/codex-hooks/codex-hook-trust-doctor.js +43 -1
- package/dist/core/commands/image-ux-review-command.d.ts +74 -44
- package/dist/core/commands/image-ux-review-command.js +39 -24
- package/dist/core/commands/scouts-command.js +90 -6
- package/dist/core/evidence/flagship-proof-graph-validator.d.ts +11 -0
- package/dist/core/evidence/flagship-proof-graph-validator.js +215 -0
- package/dist/core/feature-fixture-runner.d.ts +4 -0
- package/dist/core/feature-fixture-runner.js +54 -7
- package/dist/core/feature-fixtures.js +4 -2
- package/dist/core/feature-registry.js +9 -4
- package/dist/core/fsx.d.ts +1 -1
- package/dist/core/fsx.js +1 -1
- package/dist/core/goal-workflow.d.ts +1 -0
- package/dist/core/goal-workflow.js +1 -0
- package/dist/core/hermes.d.ts +23 -0
- package/dist/core/hermes.js +180 -0
- package/dist/core/image-ux-review/imagegen-adapter.d.ts +2 -1
- package/dist/core/image-ux-review/imagegen-adapter.js +221 -30
- package/dist/core/image-ux-review/real-callout-extractor.d.ts +36 -0
- package/dist/core/image-ux-review/real-callout-extractor.js +52 -1
- package/dist/core/image-ux-review.d.ts +91 -49
- package/dist/core/image-ux-review.js +334 -41
- package/dist/core/imagegen/gpt-image-2-request-validator.d.ts +55 -0
- package/dist/core/imagegen/gpt-image-2-request-validator.js +53 -0
- package/dist/core/imagegen/imagegen-capability.d.ts +37 -0
- package/dist/core/imagegen/imagegen-capability.js +140 -0
- package/dist/core/init.js +1 -1
- package/dist/core/memory-summary.d.ts +1 -0
- package/dist/core/memory-summary.js +1 -0
- package/dist/core/pipeline-internals/runtime-gates.js +49 -14
- package/dist/core/ppt-review/index.js +3 -0
- package/dist/core/ppt-review/slide-exporter.js +2 -2
- package/dist/core/ppt-review/slide-imagegen-review.js +15 -5
- package/dist/core/ppt-review/slide-issue-extraction.d.ts +4 -4
- package/dist/core/ppt-review/slide-issue-extraction.js +27 -2
- package/dist/core/proof/auto-finalize.d.ts +1 -1
- package/dist/core/proof/auto-finalize.js +14 -3
- package/dist/core/proof/evidence-collector.d.ts +3 -0
- package/dist/core/proof/route-adapter.d.ts +8 -0
- package/dist/core/proof/route-finalizer.d.ts +9 -1
- package/dist/core/proof/route-finalizer.js +9 -4
- package/dist/core/proof/route-proof-gate.js +2 -1
- package/dist/core/proof/selftest-proof-fixtures.d.ts +8 -0
- package/dist/core/routes.d.ts +2 -2
- package/dist/core/routes.js +6 -5
- package/dist/core/scouts/engines/codex-app-subagent-engine.d.ts +11 -2
- package/dist/core/scouts/engines/codex-app-subagent-engine.js +21 -7
- package/dist/core/scouts/engines/codex-exec-parallel-engine.d.ts +23 -1
- package/dist/core/scouts/engines/codex-exec-parallel-engine.js +54 -7
- package/dist/core/scouts/engines/scout-engine-base.d.ts +15 -2
- package/dist/core/scouts/engines/scout-engine-base.js +51 -7
- package/dist/core/scouts/engines/scout-engine-detect.js +18 -0
- package/dist/core/scouts/engines/scout-engine-policy.d.ts +2 -1
- package/dist/core/scouts/engines/scout-engine-policy.js +7 -3
- package/dist/core/scouts/engines/tmux-lane-engine.d.ts +4 -1
- package/dist/core/scouts/engines/tmux-lane-engine.js +30 -7
- package/dist/core/scouts/scout-consensus.d.ts +6 -2
- package/dist/core/scouts/scout-consensus.js +39 -14
- package/dist/core/scouts/scout-gate.d.ts +1 -0
- package/dist/core/scouts/scout-gate.js +25 -5
- package/dist/core/scouts/scout-output-parser.d.ts +2 -2
- package/dist/core/scouts/scout-output-parser.js +77 -8
- package/dist/core/scouts/scout-proof-evidence.d.ts +11 -0
- package/dist/core/scouts/scout-proof-evidence.js +25 -0
- package/dist/core/scouts/scout-readonly-guard.d.ts +41 -0
- package/dist/core/scouts/scout-readonly-guard.js +93 -3
- package/dist/core/scouts/scout-runner.d.ts +49 -5
- package/dist/core/scouts/scout-runner.js +213 -57
- package/dist/core/scouts/scout-schema.d.ts +4 -2
- package/dist/core/scouts/scout-schema.js +8 -2
- package/dist/core/structured-output-adapter.js +1 -1
- package/dist/core/triwiki-wrongness/wrongness-proof-linker.d.ts +6 -1
- package/dist/core/triwiki-wrongness/wrongness-proof-linker.js +14 -8
- package/dist/core/triwiki-wrongness/wrongness-trust-policy.js +9 -2
- package/dist/core/trust-kernel/completion-contract.js +9 -1
- package/dist/core/trust-kernel/trust-report.d.ts +16 -0
- package/dist/core/trust-kernel/trust-report.js +4 -1
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/dist/vendor/openai-codex/latest/hooks/snapshot-metadata.json +1 -1
- package/package.json +34 -5
- package/schemas/codex/image-ux-issue-ledger.schema.json +20 -2
- package/schemas/codex/ppt-slide-extraction-report.schema.json +7 -2
- package/schemas/codex/ppt-slide-issue-ledger.schema.json +12 -3
- package/schemas/codex/scout-result.schema.json +163 -6
package/README.md
CHANGED
|
@@ -10,14 +10,15 @@ SKS does not try to clone every other harness. It focuses on one thing: making C
|
|
|
10
10
|
|
|
11
11
|
## Current Release
|
|
12
12
|
|
|
13
|
-
SKS **1.
|
|
13
|
+
SKS **1.14.1** is an extreme stabilization release for hook trust, real imagegen smoke checks, PPT E2E review evidence, Codex 0.133 compatibility, and Scout multi-session intake. Scout runs now carry `engine_run_id`, `scout_session_id`, output-schema metadata, isolated benchmark artifacts, read-only guard v2 evidence, and speedup-claim caps for mock/static paths.
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
sks features complete --json
|
|
17
17
|
sks ux-review run --image <path> --generate-callouts --json
|
|
18
18
|
sks ppt fixture --mock --json
|
|
19
19
|
sks dfix fixture --json
|
|
20
|
-
sks hooks trust-doctor --json
|
|
20
|
+
sks hooks trust-doctor --actual --json
|
|
21
|
+
sks hooks install --managed --json
|
|
21
22
|
```
|
|
22
23
|
|
|
23
24
|
Detailed release history lives in [CHANGELOG.md](CHANGELOG.md). Current release gate status lives in [docs/release-readiness.md](docs/release-readiness.md).
|
|
@@ -115,7 +116,7 @@ sks selftest --mock
|
|
|
115
116
|
|
|
116
117
|
## What Sneakoscope Adds
|
|
117
118
|
|
|
118
|
-
`sks` adds a tmux Codex CLI runtime, Codex App `$` commands, Team/QA/PPT/Research/DB/GX/Wiki routes, OpenClaw skill generation, Context7-gated current docs, TriWiki context packs, DB safety, design SSOT policy, skill dreaming, release checks, and Honest Mode.
|
|
119
|
+
`sks` adds a tmux Codex CLI runtime, Codex App `$` commands, Team/QA/PPT/Research/DB/GX/Wiki routes, OpenClaw and Hermes skill generation, Context7-gated current docs, TriWiki context packs, DB safety, design SSOT policy, skill dreaming, release checks, and Honest Mode.
|
|
119
120
|
|
|
120
121
|
## Report-Only Planning Surfaces
|
|
121
122
|
|
|
@@ -409,7 +410,7 @@ SKS does not install Git pre-commit hooks. Release metadata is changed only by e
|
|
|
409
410
|
|
|
410
411
|
TriWiki is intentionally sparse: `sks wiki sweep` records demote, soft-forget, archive, delete, promote-to-skill, and promote-to-rule candidates instead of injecting every old claim into future prompts. `sks harness fixture` validates the broader Harness Growth Factory contract: deliberate forgetting fixtures, skill card metadata, experiment schema, tool-error taxonomy, permission profiles, MultiAgentV2 defaults, and tmux cockpit view coverage. `sks code-structure scan` flags handwritten files above 1000/2000/3000-line thresholds so new logic can be extracted before command files become harder to maintain.
|
|
411
412
|
|
|
412
|
-
## OpenClaw Agent Usage
|
|
413
|
+
## OpenClaw And Hermes Agent Usage
|
|
413
414
|
|
|
414
415
|
Sneakoscope can generate an OpenClaw skill package for agents that need to operate SKS-enabled repositories.
|
|
415
416
|
|
|
@@ -430,6 +431,23 @@ SKS_OPENCLAW=1 sks proof-field scan --intent "small CLI change" --changed src/cl
|
|
|
430
431
|
|
|
431
432
|
If OpenClaw runs in a sandbox, grant shell execution only for trusted workspaces. Database, migration, and destructive work still follows SKS safety routes.
|
|
432
433
|
|
|
434
|
+
Sneakoscope can also generate a Hermes Agent skill package for the Hermes `/skills` surface.
|
|
435
|
+
|
|
436
|
+
```sh
|
|
437
|
+
sks hermes install
|
|
438
|
+
sks hermes status --json
|
|
439
|
+
sks hermes path
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
By default this writes `~/.hermes/skills/sneakoscope-codex/` with `SKILL.md`, a README, `hermes-config.example.yaml`, and `skill-bundle.example.yaml`. Set `HERMES_HOME` or pass `--dir` for a custom location. Hermes agents should invoke `/sneakoscope-codex` with the terminal toolset enabled and run shell commands with `SKS_HERMES=1`; this enables non-interactive dependency/update prompts while leaving SKS DB, migration, and destructive-operation safety routes intact. If you use Hermes `skills.external_dirs`, remember writable external directories can be updated by Hermes, so protect shared skill folders with filesystem permissions when needed.
|
|
443
|
+
|
|
444
|
+
```sh
|
|
445
|
+
SKS_HERMES=1 sks root --json
|
|
446
|
+
SKS_HERMES=1 sks commands --json
|
|
447
|
+
SKS_HERMES=1 sks dollar-commands --json
|
|
448
|
+
SKS_HERMES=1 sks status --json
|
|
449
|
+
```
|
|
450
|
+
|
|
433
451
|
## Prompt `$` Commands
|
|
434
452
|
|
|
435
453
|
Use these inside Codex App or another agent prompt. They are prompt commands, not terminal commands.
|
|
@@ -4,7 +4,7 @@ use std::io::{self, Read, Seek, SeekFrom};
|
|
|
4
4
|
fn main() {
|
|
5
5
|
let mut args = std::env::args().skip(1);
|
|
6
6
|
match args.next().as_deref() {
|
|
7
|
-
Some("--version") => println!("sks-rs 1.
|
|
7
|
+
Some("--version") => println!("sks-rs 1.14.1"),
|
|
8
8
|
Some("compact-info") => {
|
|
9
9
|
let mut input = String::new();
|
|
10
10
|
let _ = io::stdin().read_to_string(&mut input);
|
package/dist/bin/sks.js
CHANGED
package/dist/build-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "sks.dist-build.v2",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.1",
|
|
4
4
|
"typescript": true,
|
|
5
5
|
"mjs_runtime_files": 0,
|
|
6
6
|
"files": [
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
"cli/feature-commands.js",
|
|
19
19
|
"cli/help-fast.d.ts",
|
|
20
20
|
"cli/help-fast.js",
|
|
21
|
+
"cli/hermes-command.d.ts",
|
|
22
|
+
"cli/hermes-command.js",
|
|
21
23
|
"cli/install-helpers.d.ts",
|
|
22
24
|
"cli/install-helpers.js",
|
|
23
25
|
"cli/main.d.ts",
|
|
@@ -92,6 +94,8 @@
|
|
|
92
94
|
"commands/harness.js",
|
|
93
95
|
"commands/help.d.ts",
|
|
94
96
|
"commands/help.js",
|
|
97
|
+
"commands/hermes.d.ts",
|
|
98
|
+
"commands/hermes.js",
|
|
95
99
|
"commands/hook.d.ts",
|
|
96
100
|
"commands/hook.js",
|
|
97
101
|
"commands/hooks.d.ts",
|
|
@@ -186,6 +190,8 @@
|
|
|
186
190
|
"core/codex-app.js",
|
|
187
191
|
"core/codex-compat/codex-0-132.d.ts",
|
|
188
192
|
"core/codex-compat/codex-0-132.js",
|
|
193
|
+
"core/codex-compat/codex-0-133.d.ts",
|
|
194
|
+
"core/codex-compat/codex-0-133.js",
|
|
189
195
|
"core/codex-compat/codex-compat-report.d.ts",
|
|
190
196
|
"core/codex-compat/codex-compat-report.js",
|
|
191
197
|
"core/codex-compat/codex-config-policy.d.ts",
|
|
@@ -212,10 +218,18 @@
|
|
|
212
218
|
"core/codex-compat/codex-version.js",
|
|
213
219
|
"core/codex-exec-output-schema.d.ts",
|
|
214
220
|
"core/codex-exec-output-schema.js",
|
|
221
|
+
"core/codex-hooks/codex-hook-actual-discovery.d.ts",
|
|
222
|
+
"core/codex-hooks/codex-hook-actual-discovery.js",
|
|
215
223
|
"core/codex-hooks/codex-hook-config-writer.d.ts",
|
|
216
224
|
"core/codex-hooks/codex-hook-config-writer.js",
|
|
217
225
|
"core/codex-hooks/codex-hook-hash.d.ts",
|
|
218
226
|
"core/codex-hooks/codex-hook-hash.js",
|
|
227
|
+
"core/codex-hooks/codex-hook-managed-install.d.ts",
|
|
228
|
+
"core/codex-hooks/codex-hook-managed-install.js",
|
|
229
|
+
"core/codex-hooks/codex-hook-official-hash-oracle.d.ts",
|
|
230
|
+
"core/codex-hooks/codex-hook-official-hash-oracle.js",
|
|
231
|
+
"core/codex-hooks/codex-hook-official-parity.d.ts",
|
|
232
|
+
"core/codex-hooks/codex-hook-official-parity.js",
|
|
219
233
|
"core/codex-hooks/codex-hook-state-writer.d.ts",
|
|
220
234
|
"core/codex-hooks/codex-hook-state-writer.js",
|
|
221
235
|
"core/codex-hooks/codex-hook-trust-doctor.d.ts",
|
|
@@ -358,6 +372,8 @@
|
|
|
358
372
|
"core/evidence/evidence-schema.js",
|
|
359
373
|
"core/evidence/evidence-store.d.ts",
|
|
360
374
|
"core/evidence/evidence-store.js",
|
|
375
|
+
"core/evidence/flagship-proof-graph-validator.d.ts",
|
|
376
|
+
"core/evidence/flagship-proof-graph-validator.js",
|
|
361
377
|
"core/feature-fixture-runner.d.ts",
|
|
362
378
|
"core/feature-fixture-runner.js",
|
|
363
379
|
"core/feature-fixtures.d.ts",
|
|
@@ -406,6 +422,8 @@
|
|
|
406
422
|
"core/harness-conflicts.js",
|
|
407
423
|
"core/harness-guard.d.ts",
|
|
408
424
|
"core/harness-guard.js",
|
|
425
|
+
"core/hermes.d.ts",
|
|
426
|
+
"core/hermes.js",
|
|
409
427
|
"core/hooks-runtime.d.ts",
|
|
410
428
|
"core/hooks-runtime.js",
|
|
411
429
|
"core/hproof.d.ts",
|
|
@@ -426,6 +444,10 @@
|
|
|
426
444
|
"core/image-ux-review/real-callout-extractor.js",
|
|
427
445
|
"core/image-ux-review/recapture.d.ts",
|
|
428
446
|
"core/image-ux-review/recapture.js",
|
|
447
|
+
"core/imagegen/gpt-image-2-request-validator.d.ts",
|
|
448
|
+
"core/imagegen/gpt-image-2-request-validator.js",
|
|
449
|
+
"core/imagegen/imagegen-capability.d.ts",
|
|
450
|
+
"core/imagegen/imagegen-capability.js",
|
|
429
451
|
"core/init.d.ts",
|
|
430
452
|
"core/init.js",
|
|
431
453
|
"core/json-schema-validator.d.ts",
|
|
@@ -47,6 +47,7 @@ export declare const COMMANDS: {
|
|
|
47
47
|
auth: CommandEntry;
|
|
48
48
|
hooks: CommandEntry;
|
|
49
49
|
openclaw: CommandEntry;
|
|
50
|
+
hermes: CommandEntry;
|
|
50
51
|
tmux: CommandEntry;
|
|
51
52
|
mad: CommandEntry;
|
|
52
53
|
'mad-sks': CommandEntry;
|
|
@@ -132,6 +133,7 @@ export declare const TYPED_COMMANDS: {
|
|
|
132
133
|
auth: CommandEntry;
|
|
133
134
|
hooks: CommandEntry;
|
|
134
135
|
openclaw: CommandEntry;
|
|
136
|
+
hermes: CommandEntry;
|
|
135
137
|
tmux: CommandEntry;
|
|
136
138
|
mad: CommandEntry;
|
|
137
139
|
'mad-sks': CommandEntry;
|
|
@@ -100,6 +100,7 @@ export const COMMANDS = {
|
|
|
100
100
|
auth: entry('beta', 'Alias for codex-lb auth commands', 'dist/commands/codex-lb.js', directCommand(() => import('../commands/codex-lb.js'), 'dist/commands/codex-lb.js')),
|
|
101
101
|
hooks: entry('beta', 'Explain and inspect Codex hooks', 'dist/commands/hooks.js', directCommand(() => import('../commands/hooks.js'), 'dist/commands/hooks.js')),
|
|
102
102
|
openclaw: entry('labs', 'Create OpenClaw skill package', 'dist/commands/openclaw.js', directCommand(() => import('../commands/openclaw.js'), 'dist/commands/openclaw.js')),
|
|
103
|
+
hermes: entry('labs', 'Create Hermes Agent skill package', 'dist/commands/hermes.js', directCommand(() => import('../commands/hermes.js'), 'dist/commands/hermes.js')),
|
|
103
104
|
tmux: entry('beta', 'Open/check SKS tmux UI', 'dist/commands/tmux.js', directCommand(() => import('../commands/tmux.js'), 'dist/commands/tmux.js')),
|
|
104
105
|
mad: entry('beta', 'MAD-SKS tmux permission launcher', 'dist/commands/mad-sks.js', directCommand(() => import('../commands/mad-sks.js'), 'dist/commands/mad-sks.js')),
|
|
105
106
|
'mad-sks': entry('beta', 'MAD-SKS scoped permission modifier', 'dist/commands/mad-sks.js', directCommand(() => import('../commands/mad-sks.js'), 'dist/commands/mad-sks.js')),
|
|
@@ -12,6 +12,8 @@ import { validateCodexFixtureOutputs } from '../core/codex-compat/codex-hook-sch
|
|
|
12
12
|
import { codexHookWarningCheck } from '../core/codex-compat/codex-hook-warning-detector.js';
|
|
13
13
|
import { codexHookTrustDoctor } from '../core/codex-hooks/codex-hook-trust-doctor.js';
|
|
14
14
|
import { writeTrustedHashStateForHooksFile } from '../core/codex-hooks/codex-hook-state-writer.js';
|
|
15
|
+
import { installManagedCodexHooks } from '../core/codex-hooks/codex-hook-managed-install.js';
|
|
16
|
+
import { writeCodexHookOfficialParityReport } from '../core/codex-hooks/codex-hook-official-parity.js';
|
|
15
17
|
const flag = (args, name) => args.includes(name);
|
|
16
18
|
export async function featuresCommand(sub = 'list', args = []) {
|
|
17
19
|
const action = sub || 'list';
|
|
@@ -122,7 +124,7 @@ export async function hooksCommand(sub = 'explain', args = []) {
|
|
|
122
124
|
return;
|
|
123
125
|
}
|
|
124
126
|
if (action === 'doctor' || action === 'trust-doctor') {
|
|
125
|
-
const report = await codexHookTrustDoctor(root, { fix: flag(args, '--fix'), managed: flag(args, '--managed') });
|
|
127
|
+
const report = await codexHookTrustDoctor(root, { fix: flag(args, '--fix'), managed: flag(args, '--managed'), actual: flag(args, '--actual') });
|
|
126
128
|
if (flag(args, '--json'))
|
|
127
129
|
return console.log(JSON.stringify(report, null, 2));
|
|
128
130
|
console.log(`Hooks trust doctor: ${report.ok ? 'ok' : 'blocked'}`);
|
|
@@ -133,9 +135,10 @@ export async function hooksCommand(sub = 'explain', args = []) {
|
|
|
133
135
|
return;
|
|
134
136
|
}
|
|
135
137
|
if (action === 'trust-state') {
|
|
136
|
-
const report = await codexHookTrustDoctor(root, { managed: flag(args, '--managed') });
|
|
138
|
+
const report = await codexHookTrustDoctor(root, { managed: flag(args, '--managed'), actual: flag(args, '--actual') });
|
|
139
|
+
const anyReport = report;
|
|
137
140
|
if (flag(args, '--json'))
|
|
138
|
-
return console.log(JSON.stringify({ schema: 'sks.codex-hook-trust-state-command.v1', ok: report.ok, entries: report.entries, trust: report.trust }, null, 2));
|
|
141
|
+
return console.log(JSON.stringify({ schema: flag(args, '--actual') ? 'sks.codex-hook-trust-state-command.v2' : 'sks.codex-hook-trust-state-command.v1', ok: report.ok, actual: flag(args, '--actual'), entries: report.entries, trust: report.trust, sources: anyReport.sources || [], managed_dirs: anyReport.managed_dirs || [], blockers: anyReport.blockers || [] }, null, 2));
|
|
139
142
|
console.log(`Hook trust entries: ${report.entries.length}`);
|
|
140
143
|
return;
|
|
141
144
|
}
|
|
@@ -148,11 +151,59 @@ export async function hooksCommand(sub = 'explain', args = []) {
|
|
|
148
151
|
process.exitCode = 1;
|
|
149
152
|
return;
|
|
150
153
|
}
|
|
154
|
+
if (action === 'repair') {
|
|
155
|
+
if (flag(args, '--trusted')) {
|
|
156
|
+
const parity = await writeCodexHookOfficialParityReport(root);
|
|
157
|
+
if (!parity.official_hash_available) {
|
|
158
|
+
const blocked = {
|
|
159
|
+
schema: 'sks.codex-hooks-repair.v1',
|
|
160
|
+
ok: false,
|
|
161
|
+
mode: 'trusted',
|
|
162
|
+
status: 'blocked',
|
|
163
|
+
blocker: 'official_hash_oracle_unavailable',
|
|
164
|
+
next_command: 'sks hooks repair --managed --json',
|
|
165
|
+
parity
|
|
166
|
+
};
|
|
167
|
+
if (flag(args, '--json'))
|
|
168
|
+
return console.log(JSON.stringify(blocked, null, 2));
|
|
169
|
+
console.log('Hooks trusted repair blocked: official hash oracle unavailable. Run `sks hooks repair --managed --json`.');
|
|
170
|
+
process.exitCode = 1;
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
const report = await installManagedCodexHooks(root);
|
|
175
|
+
const result = {
|
|
176
|
+
...report,
|
|
177
|
+
schema: 'sks.codex-hooks-repair.v1',
|
|
178
|
+
mode: 'managed',
|
|
179
|
+
next_command: 'sks hooks trust-doctor --actual --json',
|
|
180
|
+
actions: ['requirements_toml_managed_install_default']
|
|
181
|
+
};
|
|
182
|
+
if (flag(args, '--json'))
|
|
183
|
+
return console.log(JSON.stringify(result, null, 2));
|
|
184
|
+
console.log(`Hooks managed repair: ${report.ok ? 'ok' : 'blocked'}`);
|
|
185
|
+
if (!report.ok)
|
|
186
|
+
process.exitCode = 1;
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
151
189
|
if (action === 'install') {
|
|
152
|
-
const report =
|
|
190
|
+
const report = flag(args, '--managed')
|
|
191
|
+
? await installManagedCodexHooks(root)
|
|
192
|
+
: await writeTrustedHashStateForHooksFile(root, undefined, undefined, { allowSksHashFallback: flag(args, '--trusted'), reason: 'Use --managed unless you intentionally accept SKS-only trusted_hash fallback with --trusted.' });
|
|
193
|
+
if (flag(args, '--json'))
|
|
194
|
+
return console.log(JSON.stringify({ ...report, schema: flag(args, '--managed') ? 'sks.codex-hooks-managed-install.v1' : 'sks.codex-hook-install-command.v2', mode: flag(args, '--managed') ? 'managed' : flag(args, '--project') ? 'project' : 'trust-state-only', trusted: flag(args, '--trusted') }, null, 2));
|
|
195
|
+
console.log(flag(args, '--managed') ? `Hooks managed install: ${report.ok ? 'ok' : 'blocked'}` : `Hooks install trust state: ${report.ok ? 'ok' : 'blocked'}`);
|
|
196
|
+
if (!report.ok)
|
|
197
|
+
process.exitCode = 1;
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
if (action === 'actual-parity' || action === 'official-parity' || (action === 'parity' && flag(args, '--official'))) {
|
|
201
|
+
const report = await writeCodexHookOfficialParityReport(root);
|
|
153
202
|
if (flag(args, '--json'))
|
|
154
|
-
return console.log(JSON.stringify(
|
|
155
|
-
console.log(`Hooks
|
|
203
|
+
return console.log(JSON.stringify(report, null, 2));
|
|
204
|
+
console.log(`Hooks official parity: ${report.ok ? 'ok' : 'blocked'} (${report.path})`);
|
|
205
|
+
if (!report.ok)
|
|
206
|
+
process.exitCode = 1;
|
|
156
207
|
return;
|
|
157
208
|
}
|
|
158
209
|
if (action === 'replay') {
|
|
@@ -204,7 +255,7 @@ export async function hooksCommand(sub = 'explain', args = []) {
|
|
|
204
255
|
return;
|
|
205
256
|
}
|
|
206
257
|
if (action !== 'explain') {
|
|
207
|
-
console.error('Usage: sks hooks explain|status|doctor|trust-report|trust-state|trust-doctor|trust-fix|install|replay <fixture.json>|codex-schema|codex-validate|warning-check|replay-codex-fixtures [--json]');
|
|
258
|
+
console.error('Usage: sks hooks explain|status|doctor|trust-report|trust-state|trust-doctor|trust-fix|install|repair|actual-parity|official-parity|parity --official|replay <fixture.json>|codex-schema|codex-validate|warning-check|replay-codex-fixtures [--json]');
|
|
208
259
|
process.exitCode = 1;
|
|
209
260
|
return;
|
|
210
261
|
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { HERMES_SKILL_NAME, buildHermesSkillFiles, defaultHermesSkillDir, installHermesSkill } from '../core/hermes.js';
|
|
3
|
+
import { exists } from '../core/fsx.js';
|
|
4
|
+
const flag = (args, name) => args.includes(name);
|
|
5
|
+
function readFlagValue(args, name, fallback) {
|
|
6
|
+
const i = args.indexOf(name);
|
|
7
|
+
return i >= 0 && args[i + 1] ? args[i + 1] : fallback;
|
|
8
|
+
}
|
|
9
|
+
function positionalArgs(args = []) {
|
|
10
|
+
const out = [];
|
|
11
|
+
const valueFlags = new Set(['--dir']);
|
|
12
|
+
for (let i = 0; i < args.length; i++) {
|
|
13
|
+
const arg = String(args[i]);
|
|
14
|
+
if (valueFlags.has(arg)) {
|
|
15
|
+
i++;
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
if (!arg.startsWith('--'))
|
|
19
|
+
out.push(arg);
|
|
20
|
+
}
|
|
21
|
+
return out;
|
|
22
|
+
}
|
|
23
|
+
export async function hermesCommand(args = []) {
|
|
24
|
+
const action = args[0] || 'help';
|
|
25
|
+
const targetDir = readFlagValue(args, '--dir', defaultHermesSkillDir());
|
|
26
|
+
const resultOptions = {
|
|
27
|
+
targetDir,
|
|
28
|
+
force: flag(args, '--force'),
|
|
29
|
+
dryRun: flag(args, '--dry-run')
|
|
30
|
+
};
|
|
31
|
+
if (action === 'path') {
|
|
32
|
+
const result = { skill: HERMES_SKILL_NAME, target_dir: path.resolve(targetDir) };
|
|
33
|
+
if (flag(args, '--json'))
|
|
34
|
+
return console.log(JSON.stringify(result, null, 2));
|
|
35
|
+
console.log(result.target_dir);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (action === 'status') {
|
|
39
|
+
const files = buildHermesSkillFiles();
|
|
40
|
+
const target = path.resolve(targetDir);
|
|
41
|
+
const installed = await exists(path.join(target, 'SKILL.md'));
|
|
42
|
+
const result = {
|
|
43
|
+
schema: 'sks.hermes-skill-status.v1',
|
|
44
|
+
ok: true,
|
|
45
|
+
skill: HERMES_SKILL_NAME,
|
|
46
|
+
target_dir: target,
|
|
47
|
+
installed,
|
|
48
|
+
expected_files: Object.keys(files),
|
|
49
|
+
env_mode: 'SKS_HERMES=1',
|
|
50
|
+
slash_command: `/${HERMES_SKILL_NAME}`
|
|
51
|
+
};
|
|
52
|
+
if (flag(args, '--json'))
|
|
53
|
+
return console.log(JSON.stringify(result, null, 2));
|
|
54
|
+
console.log(`Hermes skill: ${installed ? 'installed' : 'not installed'} ${target}`);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (action === 'print') {
|
|
58
|
+
const files = buildHermesSkillFiles();
|
|
59
|
+
const file = (positionalArgs(args.slice(1))[0] || 'SKILL.md');
|
|
60
|
+
if (!files[file]) {
|
|
61
|
+
console.error(`Unknown Hermes skill file: ${file}`);
|
|
62
|
+
console.error(`Files: ${Object.keys(files).join(', ')}`);
|
|
63
|
+
process.exitCode = 1;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
console.log(files[file]);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (action === 'install') {
|
|
70
|
+
const result = await installHermesSkill(resultOptions);
|
|
71
|
+
if (flag(args, '--json'))
|
|
72
|
+
return console.log(JSON.stringify(result, null, 2));
|
|
73
|
+
if (!result.ok) {
|
|
74
|
+
console.error(`Hermes skill install blocked: ${result.reason}`);
|
|
75
|
+
console.error(`Target: ${result.target_dir}`);
|
|
76
|
+
process.exitCode = 1;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
console.log(`Hermes skill ${result.status}: ${result.target_dir}`);
|
|
80
|
+
console.log(`Use it in Hermes as /${HERMES_SKILL_NAME} and run SKS shell commands with SKS_HERMES=1.`);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
console.log(`Hermes
|
|
84
|
+
|
|
85
|
+
Usage:
|
|
86
|
+
sks hermes install [--dir path] [--force] [--dry-run] [--json]
|
|
87
|
+
sks hermes status [--dir path] [--json]
|
|
88
|
+
sks hermes path [--dir path] [--json]
|
|
89
|
+
sks hermes print [SKILL.md|README.md|hermes-config.example.yaml|skill-bundle.example.yaml]
|
|
90
|
+
|
|
91
|
+
Default skill: ${HERMES_SKILL_NAME}
|
|
92
|
+
Default path: ${defaultHermesSkillDir()}
|
|
93
|
+
|
|
94
|
+
After install, open Hermes and invoke:
|
|
95
|
+
|
|
96
|
+
/${HERMES_SKILL_NAME} Use SKS in this repository.
|
|
97
|
+
`);
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=hermes-command.js.map
|
|
@@ -2063,7 +2063,7 @@ export async function maybePromptCodexUpdateForLaunch(args = [], opts = {}) {
|
|
|
2063
2063
|
return installCodexLatest(command, latest.version, current);
|
|
2064
2064
|
}
|
|
2065
2065
|
export function shouldAutoApproveInstall(args = [], env = process.env) {
|
|
2066
|
-
return hasFlag(args, '--yes') || hasFlag(args, '-y') ||
|
|
2066
|
+
return hasFlag(args, '--yes') || hasFlag(args, '-y') || isAgentRuntime(env);
|
|
2067
2067
|
}
|
|
2068
2068
|
function canAskYesNo() {
|
|
2069
2069
|
return Boolean(input.isTTY && output.isTTY && process.env.CI !== 'true');
|
|
@@ -2071,8 +2071,18 @@ function canAskYesNo() {
|
|
|
2071
2071
|
function hasFlag(args = [], name) {
|
|
2072
2072
|
return args.includes(name);
|
|
2073
2073
|
}
|
|
2074
|
-
function
|
|
2075
|
-
return [
|
|
2074
|
+
function isAgentRuntime(env = process.env) {
|
|
2075
|
+
return [
|
|
2076
|
+
'SKS_OPENCLAW',
|
|
2077
|
+
'OPENCLAW',
|
|
2078
|
+
'OPENCLAW_AGENT',
|
|
2079
|
+
'OPENCLAW_RUN_ID',
|
|
2080
|
+
'OPENCLAW_SESSION_ID',
|
|
2081
|
+
'SKS_HERMES',
|
|
2082
|
+
'HERMES_AGENT',
|
|
2083
|
+
'HERMES_RUN_ID',
|
|
2084
|
+
'HERMES_SESSION_ID'
|
|
2085
|
+
]
|
|
2076
2086
|
.some((key) => /^(1|true|yes|y)$/i.test(String(env[key] || '').trim()));
|
|
2077
2087
|
}
|
|
2078
2088
|
async function installCodexLatest(command, latestVersion, previousVersion = null) {
|