peaks-loop 4.0.49 → 4.0.51
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/CHANGELOG.md +38 -0
- package/README-en.md +1 -1
- package/README.md +1 -1
- package/dist/cli/commands/audit-commands.js +1 -0
- package/dist/cli/commands/baseline-commands.js +163 -25
- package/dist/cli/commands/core/skill-command.js +53 -4
- package/dist/cli/commands/core/standards-command.d.ts +24 -0
- package/dist/cli/commands/core/standards-command.js +74 -0
- package/dist/cli/commands/hooks-commands.js +55 -38
- package/dist/cli/commands/share-commands.js +113 -20
- package/dist/cli/commands/web-commands.js +8 -1
- package/dist/cli/commands/workflow-lifecycle-commands.d.ts +6 -0
- package/dist/cli/commands/workflow-lifecycle-commands.js +64 -3
- package/dist/services/adapter/adapter.d.ts +30 -0
- package/dist/services/adapter/auto-adapter.d.ts +13 -0
- package/dist/services/adapter/claude-adapter.js +12 -0
- package/dist/services/adapter/codex-adapter.d.ts +12 -0
- package/dist/services/adapter/codex-adapter.js +12 -0
- package/dist/services/adapter/copilot-adapter.d.ts +12 -0
- package/dist/services/adapter/copilot-adapter.js +12 -0
- package/dist/services/audit/backing-detector.d.ts +25 -7
- package/dist/services/audit/backing-detector.js +33 -17
- package/dist/services/audit/enforcer-liveness.d.ts +12 -0
- package/dist/services/audit/enforcer-liveness.js +100 -0
- package/dist/services/audit/enforcers/lint-catalog-governance.d.ts +23 -11
- package/dist/services/audit/enforcers/lint-catalog-governance.js +10 -14
- package/dist/services/audit/enforcers/lint-rd-handoff-coverage.d.ts +5 -15
- package/dist/services/audit/enforcers/lint-rd-handoff-coverage.js +94 -25
- package/dist/services/audit/enforcers/lint-style.d.ts +9 -1
- package/dist/services/audit/enforcers/lint-style.js +38 -2
- package/dist/services/audit/prose-ratio-calculator.d.ts +28 -17
- package/dist/services/audit/prose-ratio-calculator.js +25 -18
- package/dist/services/audit/red-line-catalog-p2-a.js +1 -1
- package/dist/services/audit/red-lines-service.js +51 -7
- package/dist/services/capability-audit-service/independent-checker.d.ts +15 -0
- package/dist/services/capability-audit-service/independent-checker.js +140 -0
- package/dist/services/capability-audit-service/index.d.ts +3 -1
- package/dist/services/capability-audit-service/index.js +1 -0
- package/dist/services/capability-audit-service/runner.d.ts +17 -13
- package/dist/services/capability-audit-service/runner.js +76 -15
- package/dist/services/capability-audit-service/types.d.ts +48 -0
- package/dist/services/capability-guard-runner/contracts/J01.js +21 -22
- package/dist/services/capability-guard-runner/contracts/J02.d.ts +1 -1
- package/dist/services/capability-guard-runner/contracts/J02.js +114 -28
- package/dist/services/capability-guard-runner/contracts/J03.d.ts +13 -0
- package/dist/services/capability-guard-runner/contracts/J03.js +72 -21
- package/dist/services/capability-guard-runner/contracts/J04.d.ts +6 -0
- package/dist/services/capability-guard-runner/contracts/J04.js +65 -32
- package/dist/services/capability-guard-runner/contracts/J05.js +118 -16
- package/dist/services/capability-guard-runner/contracts/J06.d.ts +14 -0
- package/dist/services/capability-guard-runner/contracts/J06.js +57 -39
- package/dist/services/capability-guard-runner/contracts/J07.d.ts +9 -0
- package/dist/services/capability-guard-runner/contracts/J07.js +76 -47
- package/dist/services/capability-guard-runner/contracts/J08.d.ts +11 -0
- package/dist/services/capability-guard-runner/contracts/J08.js +66 -39
- package/dist/services/capability-guard-runner/contracts/J09.d.ts +13 -0
- package/dist/services/capability-guard-runner/contracts/J09.js +95 -39
- package/dist/services/capability-guard-runner/contracts/J10.d.ts +12 -0
- package/dist/services/capability-guard-runner/contracts/J10.js +69 -35
- package/dist/services/capability-guard-runner/contracts/J11.d.ts +8 -0
- package/dist/services/capability-guard-runner/contracts/J11.js +73 -33
- package/dist/services/capability-guard-runner/contracts/J12.d.ts +12 -0
- package/dist/services/capability-guard-runner/contracts/J12.js +66 -30
- package/dist/services/capability-guard-runner/contracts/J13.d.ts +11 -0
- package/dist/services/capability-guard-runner/contracts/J13.js +62 -40
- package/dist/services/capability-guard-runner/contracts/J14.d.ts +11 -0
- package/dist/services/capability-guard-runner/contracts/J14.js +60 -31
- package/dist/services/capability-guard-runner/contracts/J15.d.ts +11 -0
- package/dist/services/capability-guard-runner/contracts/J15.js +70 -35
- package/dist/services/capability-guard-runner/contracts/_shared.d.ts +24 -0
- package/dist/services/capability-guard-runner/contracts/_shared.js +67 -0
- package/dist/services/capability-guard-runner/registry.d.ts +5 -0
- package/dist/services/capability-guard-runner/registry.js +140 -0
- package/dist/services/capability-guard-runner/runner.d.ts +26 -0
- package/dist/services/capability-guard-runner/runner.js +63 -6
- package/dist/services/code/auto-compact-modes.d.ts +13 -2
- package/dist/services/code/auto-compact-modes.js +20 -4
- package/dist/services/code/post-compact-detector.js +20 -11
- package/dist/services/code/step-08-gate.js +21 -6
- package/dist/services/config/config-safety.js +11 -9
- package/dist/services/dispatch/sub-agent-dispatcher.d.ts +11 -30
- package/dist/services/dispatch/sub-agent-dispatcher.js +5 -48
- package/dist/services/final-review/pre-post-diff.js +10 -2
- package/dist/services/ide/adapters/claude-code-adapter.js +0 -1
- package/dist/services/ide/adapters/codex-adapter.js +1 -2
- package/dist/services/ide/adapters/cursor-adapter.js +1 -2
- package/dist/services/ide/adapters/hermes-adapter.js +1 -2
- package/dist/services/ide/adapters/openclaw-adapter.js +1 -2
- package/dist/services/ide/adapters/qoder-adapter.js +1 -2
- package/dist/services/ide/adapters/tongyi-lingma-adapter.js +1 -2
- package/dist/services/ide/adapters/trae-adapter.js +1 -2
- package/dist/services/ide/adapters/zcode-adapter.js +0 -1
- package/dist/services/ide/ide-types.d.ts +0 -2
- package/dist/services/observability/observability-service.d.ts +1 -1
- package/dist/services/scan/api-diff-types.js +20 -2
- package/dist/services/security/safe-settings-path.js +19 -1
- package/dist/services/skill/skill-search-service.d.ts +3 -3
- package/dist/services/standards/loop-engineering-lint.d.ts +1 -1
- package/dist/services/standards/loop-engineering-lint.js +6 -0
- package/dist/services/web/daemon-registry.js +27 -2
- package/dist/services/workspace/claude-settings-template.d.ts +53 -37
- package/dist/services/workspace/claude-settings-template.js +105 -83
- package/dist/services/workspace/generated-artifacts-stamp.d.ts +119 -0
- package/dist/services/workspace/generated-artifacts-stamp.js +167 -0
- package/dist/services/workspace/workspace-claude-settings-materializer.d.ts +8 -0
- package/dist/services/workspace/workspace-claude-settings-materializer.js +38 -3
- package/dist/services/workspace/workspace-service.js +11 -1
- package/dist/shared/fs-utils.d.ts +26 -0
- package/dist/shared/fs-utils.js +35 -0
- package/package.json +9 -7
- package/scripts/copy-templates.mjs +0 -12
- package/scripts/install-skills.mjs +154 -53
- package/skills/bee/peaks-perf-audit/SKILL.md +2 -2
- package/skills/bee/peaks-perf-audit/references/audit-protocol.md +1 -1
- package/skills/bee/peaks-prd/SKILL.md +3 -3
- package/skills/bee/peaks-prd/references/prd-for-multi-pass.md +1 -1
- package/skills/bee/peaks-prd/references/workflow.md +1 -1
- package/skills/bee/peaks-qa/SKILL.md +6 -7
- package/skills/bee/peaks-qa/references/external-capability-guidance.md +1 -1
- package/skills/bee/peaks-qa/references/qa-fanout-contract.md +1 -1
- package/skills/bee/peaks-qa/references/reading-handoff-frontmatter.md +2 -2
- package/skills/bee/peaks-rd/SKILL.md +2 -3
- package/skills/bee/peaks-rd/references/code-reviewer-4dim-hint.md +1 -1
- package/skills/bee/peaks-rd/references/external-references.md +1 -1
- package/skills/bee/peaks-rd/references/mandatory-perf-baseline.md +1 -1
- package/skills/bee/peaks-rd/references/ocr-multilang-1.8.md +2 -2
- package/skills/bee/peaks-rd/references/parallel-review-fanout.md +2 -2
- package/skills/bee/peaks-rd/references/rd-fanout-contracts.md +11 -8
- package/skills/bee/peaks-rd/references/rd-runbook.md +1 -1
- package/skills/bee/peaks-rd/references/rd-sub-agent-dispatch.md +7 -7
- package/skills/bee/peaks-rd/references/rd-transition-gates.md +1 -1
- package/skills/bee/peaks-rd/references/reading-v2-slice-results.md +1 -1
- package/skills/bee/peaks-rd/references/v2-12-fanout-collapse.md +7 -5
- package/skills/bee/peaks-rd/references/writing-handoff-frontmatter.md +3 -3
- package/skills/bee/peaks-reviewer/SKILL.md +1 -1
- package/skills/bee/peaks-security-audit/SKILL.md +3 -3
- package/skills/bee/peaks-security-audit/references/audit-protocol.md +1 -1
- package/skills/bee/peaks-txt/references/context-capsule.md +1 -1
- package/skills/bee/peaks-ui/SKILL.md +1 -1
- package/skills/peaks-audit/SKILL.md +1 -1
- package/skills/peaks-code/SKILL.md +20 -18
- package/skills/peaks-code/references/context-governance.md +1 -1
- package/skills/peaks-code/references/dag-orchestrator.md +3 -4
- package/skills/peaks-code/references/external-references.md +1 -1
- package/skills/peaks-code/references/external-skill-invocation.md +2 -2
- package/skills/peaks-code/references/fanout-mandatory.md +3 -3
- package/skills/peaks-code/references/frontend-only-mode.md +2 -2
- package/skills/peaks-code/references/gstack-integration.md +1 -1
- package/skills/peaks-code/references/micro-cycle.md +1 -1
- package/skills/peaks-code/references/periodic-checkpoint.md +4 -4
- package/skills/peaks-code/references/project-scan-checklist.md +1 -1
- package/skills/peaks-code/references/resume-detection.md +1 -1
- package/skills/peaks-code/references/runbook.md +6 -3
- package/skills/peaks-code/references/session-overload-signal-index.md +6 -4
- package/skills/peaks-code/references/startup-sequence.md +17 -17
- package/skills/peaks-code/references/step-0-8-gate.md +1 -1
- package/skills/peaks-code/references/step-11-memory-sediment.md +2 -2
- package/skills/peaks-code/references/sub-agent-dispatch.md +26 -25
- package/skills/peaks-code/references/swarm-dispatch-contract.md +1 -1
- package/skills/peaks-code/references/workflow-gates-and-types.md +3 -3
- package/skills/peaks-code/references/worktree-governance.md +1 -1
- package/skills/peaks-final-review/SKILL.md +3 -3
- package/skills/peaks-ide/references/audit-log-helper.md +5 -4
- package/skills/peaks-resume/SKILL.md +1 -1
- package/skills/peaks-slice-decompose/SKILL.md +4 -4
- package/skills/peaks-slice-decompose/references/cross-pass-edge-interpretation.md +1 -1
- package/skills/peaks-slice-decompose/references/granularity-decision.md +1 -1
- package/skills/peaks-slice-decompose/references/v2-schema.md +2 -2
- package/skills/peaks-solo/SKILL.md +1 -2
- package/dist/cli/commands/context-builder-commands.d.ts +0 -11
- package/dist/cli/commands/context-builder-commands.js +0 -85
- package/dist/services/hooks/write-gate.js +0 -111
- package/skills/bee/peaks-prd/references/command-migration.md +0 -3
- package/skills/bee/peaks-qa/references/command-migration.md +0 -3
- package/skills/bee/peaks-rd/references/command-migration.md +0 -3
- package/skills/bee/peaks-sc/references/command-migration.md +0 -3
- package/skills/bee/peaks-txt/references/command-migration.md +0 -3
- package/skills/bee/peaks-ui/references/command-migration.md +0 -3
- package/skills/peaks-code/references/command-migration.md +0 -3
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `peaks context <sub>` — CLI surface for the ContextBuilder.
|
|
3
|
-
* Per spec §4.1 — these commands are the only sanctioned entry point;
|
|
4
|
-
* peaks-rd / peaks-qa / peaks-mut invoke them programmatically.
|
|
5
|
-
*/
|
|
6
|
-
import { Command } from 'commander';
|
|
7
|
-
import { readFile } from 'node:fs/promises';
|
|
8
|
-
import { buildContext } from '../../services/context/context-builder.js';
|
|
9
|
-
import { ContextJsonSchema } from '../../services/context/context-schema.js';
|
|
10
|
-
export function createContextCommands(options) {
|
|
11
|
-
const context = new Command('context').description('peaks-context: build versioned, version-locked context.json (spec §4.1)');
|
|
12
|
-
context
|
|
13
|
-
.command('build')
|
|
14
|
-
.requiredOption('--goal <text>', 'user request goal')
|
|
15
|
-
.requiredOption('--project <path>', 'project root')
|
|
16
|
-
.option('--audience <role>', 'peaks-rd | peaks-qa | peaks-mut | all', 'all')
|
|
17
|
-
.option('--deps-mode <mode>', 'locked | latest', 'locked')
|
|
18
|
-
.option('--doc-budget-tokens <n>', 'token budget for renderer', '8000')
|
|
19
|
-
.requiredOption('--out <path>', 'output path for context.json')
|
|
20
|
-
.option('--json', 'machine-readable output', false)
|
|
21
|
-
.action(async (opts) => {
|
|
22
|
-
const ctx = await buildContext({
|
|
23
|
-
goal: opts.goal,
|
|
24
|
-
project: opts.project,
|
|
25
|
-
audience: opts.audience,
|
|
26
|
-
depsMode: opts.depsMode,
|
|
27
|
-
docBudgetTokens: Number(opts.docBudgetTokens),
|
|
28
|
-
out: opts.out,
|
|
29
|
-
fetcher: options.fetcher,
|
|
30
|
-
});
|
|
31
|
-
if (opts.json) {
|
|
32
|
-
process.stdout.write(JSON.stringify({ ok: true, sha256: ctx.sha256 }) + '\n');
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
process.stdout.write(`context.json written: ${opts.out}\nsha256: ${ctx.sha256}\n`);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
context
|
|
39
|
-
.command('validate <file>')
|
|
40
|
-
.action(async (file) => {
|
|
41
|
-
const raw = await readFile(file, 'utf8');
|
|
42
|
-
const parsed = JSON.parse(raw);
|
|
43
|
-
const result = ContextJsonSchema.safeParse(parsed);
|
|
44
|
-
if (!result.success) {
|
|
45
|
-
process.stderr.write(`INVALID: ${result.error.message}\n`);
|
|
46
|
-
process.exit(2);
|
|
47
|
-
}
|
|
48
|
-
process.stdout.write(`OK: ${file}\n`);
|
|
49
|
-
});
|
|
50
|
-
context
|
|
51
|
-
.command('inspect <file>')
|
|
52
|
-
.action(async (file) => {
|
|
53
|
-
const raw = await readFile(file, 'utf8');
|
|
54
|
-
const ctx = JSON.parse(raw);
|
|
55
|
-
process.stdout.write([
|
|
56
|
-
`version: ${ctx.version}`,
|
|
57
|
-
`goal: ${ctx.goal}`,
|
|
58
|
-
`sha256: ${ctx.sha256}`,
|
|
59
|
-
`deps: ${Object.keys(ctx.collector.deps).join(', ')}`,
|
|
60
|
-
`fetchedDocs: ${ctx.docRetriever.fetchedDocs.length}`,
|
|
61
|
-
`skipped: ${ctx.docRetriever.skipped.length}`,
|
|
62
|
-
`truncated: ${ctx.renderer.truncated}`,
|
|
63
|
-
`audience: ${ctx.renderer.audience}`,
|
|
64
|
-
].join('\n') + '\n');
|
|
65
|
-
});
|
|
66
|
-
context
|
|
67
|
-
.command('schema')
|
|
68
|
-
.action(async () => {
|
|
69
|
-
// Pre-flight fix #3: read from the canonical schemas/context.schema.json
|
|
70
|
-
// (generated by Task 12) instead of serializing Zod internals at runtime.
|
|
71
|
-
// Both files must agree; if schema.json is missing, this command fails
|
|
72
|
-
// with a clear message pointing at Task 12.
|
|
73
|
-
const fs = await import('node:fs/promises');
|
|
74
|
-
try {
|
|
75
|
-
const content = await fs.readFile('schemas/context.schema.json', 'utf8');
|
|
76
|
-
process.stdout.write(content + '\n');
|
|
77
|
-
}
|
|
78
|
-
catch {
|
|
79
|
-
process.stderr.write('BLOCKED: schemas/context.schema.json not found.\n' +
|
|
80
|
-
'Run Task 12 of Plan 1 to generate it.\n');
|
|
81
|
-
process.exit(2);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
return context;
|
|
85
|
-
}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* write-gate.js — peaks Write|Edit|MultiEdit PreToolUse path gate.
|
|
4
|
-
*
|
|
5
|
-
* Slice c5-write-hook-exec-form (session 2026-09-10-session-528a63).
|
|
6
|
-
* VERBATIM RELOCATION: the predicate chain below was character-for-character
|
|
7
|
-
* the chain that used to be inlined into `claude-settings-template.ts` as a
|
|
8
|
-
* `node -e "<js>"` one-liner.
|
|
9
|
-
*
|
|
10
|
-
* Slice c5b-write-gate-polarity (same session) NARROWED the decision to match
|
|
11
|
-
* the contract `.claude/HOOKS.md` documents for this handler. The relocated
|
|
12
|
-
* chain read its eight directory names as an EXCLUSION list, so `_runtime`
|
|
13
|
-
* AND every other `.peaks/<slug>/` were allowed; it now allows only paths
|
|
14
|
-
* under `.peaks/_runtime/` and falls through on everything else. That earlier
|
|
15
|
-
* polarity also permitted a top-level `.peaks/<change-id>/` write, which
|
|
16
|
-
* `CLAUDE.md`'s hard ban forbids outright.
|
|
17
|
-
*
|
|
18
|
-
* Why it moved into a file: the inlined form was shell-dialect-coupled. Its
|
|
19
|
-
* escaping contract was defined in terms of bash reducing `\\` to `\` inside a
|
|
20
|
-
* `"..."` wrapper, which PowerShell does NOT do — so the handler could not take
|
|
21
|
-
* the platform `shell` pin its Bash siblings carry. `node <path>` has no inline
|
|
22
|
-
* payload, so there is nothing left to escape and no dialect to couple to.
|
|
23
|
-
*
|
|
24
|
-
* Why `.js` and not `.sh` (the convention for the other hook scripts here):
|
|
25
|
-
* - `.sh` needs `bash`; on Windows that means Git Bash, so it is itself a
|
|
26
|
-
* shell dependency and the escaping problem merely moves to the
|
|
27
|
-
* `bash <script>` boundary.
|
|
28
|
-
* - `node` is already a hard dependency — the previous form invoked it.
|
|
29
|
-
* - A plain `.js` needs no compile step, so the SAME relative filename
|
|
30
|
-
* exists in `src/` (used by `tsx` + vitest) and in `dist/` (copied by
|
|
31
|
-
* `scripts/copy-templates.mjs`), which lets one emitted path string be
|
|
32
|
-
* valid for both the repo and an installed consumer.
|
|
33
|
-
*
|
|
34
|
-
* Contract (`.claude/HOOKS.md`): this handler ALWAYS ABSTAINS: exit 0, no
|
|
35
|
-
* output, on every path. Only exit 2 blocks a tool call, and this handler
|
|
36
|
-
* never returns it, so any other non-zero exit is a non-blocking ERROR
|
|
37
|
-
* rather than a decision. See `decide` below for the correction this file
|
|
38
|
-
* went through.
|
|
39
|
-
*
|
|
40
|
-
* Path source: the hook payload arrives as JSON on STDIN (Claude Code's
|
|
41
|
-
* documented channel; it appends no argv). `process.argv[2]` is honoured as a
|
|
42
|
-
* fallback so a positional-arg invocation keeps working.
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
/** First string found at any of the candidate keys of `root`. */
|
|
46
|
-
function pathFrom(root) {
|
|
47
|
-
if (!root || typeof root !== 'object') return '';
|
|
48
|
-
for (const key of ['file_path', 'path', 'notebook_path']) {
|
|
49
|
-
if (typeof root[key] === 'string') return root[key];
|
|
50
|
-
}
|
|
51
|
-
return '';
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** Pull the candidate file path out of a parsed hook payload. */
|
|
55
|
-
function candidatePath(payload) {
|
|
56
|
-
if (!payload || typeof payload !== 'object') return '';
|
|
57
|
-
return pathFrom(payload.tool_input) || pathFrom(payload);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* This handler ABSTAINS on every path, including `.peaks/_runtime/`.
|
|
62
|
-
*
|
|
63
|
-
* It used to return 1 for anything outside `.peaks/_runtime/`, documented as
|
|
64
|
-
* "fall through to the gate". That concept does not exist in the Claude Code
|
|
65
|
-
* hook protocol. Exit 2 is the only code that blocks; every other non-zero
|
|
66
|
-
* exit is a NON-BLOCKING ERROR — the action still proceeds, but the transcript
|
|
67
|
-
* shows `<hook> hook error` followed by `Failed with non-blocking status code:
|
|
68
|
-
* No stderr output`. The "silent fall-through" was therefore the LOUDEST
|
|
69
|
-
* available outcome, reported once per edit for every path a developer
|
|
70
|
-
* actually touches.
|
|
71
|
-
*
|
|
72
|
-
* The documented abstention is exit 0 with no output: "no decision". All
|
|
73
|
-
* matching PreToolUse hooks run in parallel and their results are merged
|
|
74
|
-
* (`deny` > `defer` > `ask` > `allow`), so abstaining neither approves the call
|
|
75
|
-
* nor suppresses a sibling's deny — the fact gate still applies to every path
|
|
76
|
-
* it always applied to.
|
|
77
|
-
*
|
|
78
|
-
* Runtime behaviour is unchanged for every path. What changes is that the
|
|
79
|
-
* handler stops reporting a spurious error while abstaining.
|
|
80
|
-
*/
|
|
81
|
-
function decide(p) {
|
|
82
|
-
// The path is still read (it is the payload's whole point) but no longer
|
|
83
|
-
// branches: every path abstains.
|
|
84
|
-
void p;
|
|
85
|
-
return 0;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const ARGV_PATH = typeof process.argv[2] === 'string' ? process.argv[2] : '';
|
|
89
|
-
|
|
90
|
-
// No stdin to read (a human running this by hand): decide on argv alone
|
|
91
|
-
// instead of blocking forever waiting for an 'end' that never comes.
|
|
92
|
-
if (process.stdin.isTTY) {
|
|
93
|
-
process.exit(decide(ARGV_PATH));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
let raw = '';
|
|
97
|
-
process.stdin.setEncoding('utf8');
|
|
98
|
-
process.stdin.on('data', (chunk) => { raw += chunk; });
|
|
99
|
-
process.stdin.on('end', () => {
|
|
100
|
-
let payload;
|
|
101
|
-
try {
|
|
102
|
-
payload = JSON.parse(raw);
|
|
103
|
-
} catch {
|
|
104
|
-
// Malformed or empty payload → no path. This is NOT a deny: `decide`
|
|
105
|
-
// abstains for every input including the empty string, and a deny would
|
|
106
|
-
// take exit 2. The old comment here said "deny" while returning 1, which
|
|
107
|
-
// is the non-blocking error — the same misreading this file corrects.
|
|
108
|
-
payload = undefined;
|
|
109
|
-
}
|
|
110
|
-
process.exit(decide(candidatePath(payload) || ARGV_PATH));
|
|
111
|
-
});
|