peaks-loop 4.0.0-beta.12 → 4.0.0-beta.15
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 +282 -147
- package/README-en.md +1 -1
- package/README.md +32 -1
- package/bin/peaks.js +0 -0
- package/dist/cli/cli-helpers.d.ts +1 -1
- package/dist/cli/cli-helpers.js +1 -1
- package/dist/cli/commands/adapter-commands-s2a.js +1 -1
- package/dist/cli/commands/asset-commands.js +33 -16
- package/dist/cli/commands/audit-commands.js +1 -1
- package/dist/cli/commands/bee-commands.js +1 -1
- package/dist/cli/commands/capability-commands.js +1 -1
- package/dist/cli/commands/classify-classify-commands.js +1 -1
- package/dist/cli/commands/code-commands.js +1 -1
- package/dist/cli/commands/code-review-commands.js +1 -1
- package/dist/cli/commands/codegraph-commands.js +1 -1
- package/dist/cli/commands/compact-command.js +1 -1
- package/dist/cli/commands/complexity-commands.js +1 -1
- package/dist/cli/commands/config-commands.js +1 -1
- package/dist/cli/commands/context-commands.js +1 -1
- package/dist/cli/commands/contract-commands.js +1 -1
- package/dist/cli/commands/core/artifacts-command.js +1 -1
- package/dist/cli/commands/core/binding-commands.js +1 -1
- package/dist/cli/commands/core/doctor-command.js +63 -3
- package/dist/cli/commands/core/memory-command.js +1 -1
- package/dist/cli/commands/core/profile-command.js +1 -1
- package/dist/cli/commands/core/proxy-command.js +1 -1
- package/dist/cli/commands/core/session-command.js +1 -1
- package/dist/cli/commands/core/skill-command.js +2 -2
- package/dist/cli/commands/core/standards-command.js +1 -1
- package/dist/cli/commands/dispatch-commands.js +2 -2
- package/dist/cli/commands/dispatch-from-dag.js +1 -1
- package/dist/cli/commands/doc-commands.js +1 -1
- package/dist/cli/commands/ecc-commands.js +2 -2
- package/dist/cli/commands/evolution-commands.js +1 -1
- package/dist/cli/commands/feedback-commands.js +1 -1
- package/dist/cli/commands/final-review-commands.js +1 -1
- package/dist/cli/commands/fixture-commands.js +1 -1
- package/dist/cli/commands/fork-commands.js +1 -1
- package/dist/cli/commands/gate-commands.js +1 -1
- package/dist/cli/commands/heartbeat-commands.js +1 -1
- package/dist/cli/commands/hook-handle.js +1 -1
- package/dist/cli/commands/hooks-commands.js +1 -1
- package/dist/cli/commands/ide-commands.js +1 -1
- package/dist/cli/commands/impact-commands.js +1 -1
- package/dist/cli/commands/job-commands.js +1 -1
- package/dist/cli/commands/legacy-commands.js +1 -1
- package/dist/cli/commands/log-commands.js +1 -1
- package/dist/cli/commands/loop-commands.js +1 -1
- package/dist/cli/commands/loop-eval-commands.js +1 -1
- package/dist/cli/commands/memory-commands.js +1 -1
- package/dist/cli/commands/migrate-1-4-1-command.js +1 -1
- package/dist/cli/commands/migrate-v2-10-to-v2-11-command.js +1 -1
- package/dist/cli/commands/mut-commands.d.ts +1 -1
- package/dist/cli/commands/mut-commands.js +1 -5
- package/dist/cli/commands/observability-commands.js +1 -1
- package/dist/cli/commands/openspec-commands.js +2 -2
- package/dist/cli/commands/perf-audit-commands.js +2 -2
- package/dist/cli/commands/perf-commands.js +1 -1
- package/dist/cli/commands/polyrepo-commands.js +1 -1
- package/dist/cli/commands/prd-blocks-commands.js +1 -1
- package/dist/cli/commands/prd-commands.js +1 -1
- package/dist/cli/commands/project-commands.js +1 -1
- package/dist/cli/commands/qa-business-review-commands.js +1 -1
- package/dist/cli/commands/qa-commands.d.ts +1 -1
- package/dist/cli/commands/qa-commands.js +2 -2
- package/dist/cli/commands/release-commands.js +1 -1
- package/dist/cli/commands/request-commands.js +1 -1
- package/dist/cli/commands/retrospective-commands.js +1 -1
- package/dist/cli/commands/reviewer-commands.js +1 -1
- package/dist/cli/commands/role-commands.js +1 -1
- package/dist/cli/commands/runtime-commands.js +1 -2
- package/dist/cli/commands/sc-commands.js +1 -1
- package/dist/cli/commands/scan-commands.js +1 -1
- package/dist/cli/commands/security-audit-commands.js +2 -2
- package/dist/cli/commands/sediment-commands.js +10 -1
- package/dist/cli/commands/share-commands.d.ts +19 -0
- package/dist/cli/commands/share-commands.js +121 -2
- package/dist/cli/commands/skill-conformance-commands.js +1 -1
- package/dist/cli/commands/skill-loop-engineering-readiness-commands.js +1 -1
- package/dist/cli/commands/skill-search-commands.js +1 -1
- package/dist/cli/commands/slice-commands.js +1 -1
- package/dist/cli/commands/slice-integrate-commands.js +1 -1
- package/dist/cli/commands/slice-review-commands.js +1 -1
- package/dist/cli/commands/smoke-commands.js +1 -1
- package/dist/cli/commands/sop-commands.js +1 -1
- package/dist/cli/commands/statusline-commands.js +1 -1
- package/dist/cli/commands/sub-agent-commands.js +2 -1
- package/dist/cli/commands/understand-commands.js +1 -1
- package/dist/cli/commands/upgrade-commands.js +1 -1
- package/dist/cli/commands/user-touchpoint-commands.js +1 -1
- package/dist/cli/commands/verdict-aggregate-command.js +1 -1
- package/dist/cli/commands/workflow-commands.js +1 -1
- package/dist/cli/commands/workflow-plan-commands.js +1 -1
- package/dist/cli/commands/workspace/init-command.js +1 -1
- package/dist/cli/commands/workspace/migrate-command.js +1 -1
- package/dist/cli/commands/workspace/reconcile-command.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/program.js +2 -2
- package/dist/services/artifacts/artifact-prerequisites.js +1 -1
- package/dist/services/artifacts/request-artifact-service.js +1 -1
- package/dist/services/artifacts/workspace-service.js +1 -1
- package/dist/services/code/auto-compact-orchestrator.js +5 -2
- package/dist/services/code-review/ocr-service.d.ts +1 -1
- package/dist/services/code-review/ocr-service.js +6 -3
- package/dist/services/config/config-types.js +1 -1
- package/dist/services/dashboard/project-dashboard-service.js +2 -2
- package/dist/services/dispatch/batch-counter.js +1 -1
- package/dist/services/dispatch/dispatch-record-writer.js +1 -1
- package/dist/services/job/job-progress-store.d.ts +2 -2
- package/dist/services/job/job-types.d.ts +27 -27
- package/dist/services/log/retention.js +1 -1
- package/dist/services/openspec/openspec-archive-service.js +1 -1
- package/dist/services/openspec/openspec-bridge-service.js +1 -1
- package/dist/services/openspec/openspec-init-service.js +1 -1
- package/dist/services/openspec/openspec-propose-from-doctor-service.js +1 -1
- package/dist/services/openspec/openspec-render-service.js +1 -1
- package/dist/services/openspec/openspec-scan-service.js +1 -1
- package/dist/services/openspec/openspec-validate-service.js +1 -1
- package/dist/services/scan/acceptance-coverage-service.js +1 -1
- package/dist/services/scan/archetype-service.js +1 -1
- package/dist/services/scan/existing-system-service.js +1 -1
- package/dist/services/scan/libraries-service.js +1 -1
- package/dist/services/skill/skill-search-service.d.ts +5 -5
- package/dist/services/skill/skill-search-service.js +2 -2
- package/dist/services/skillhub/migrations/001-initial.sql +71 -0
- package/dist/services/skillhub/migrations/002-loop-release.sql +32 -0
- package/dist/services/skillhub/migrations/003-loop-bee-relation.sql +35 -0
- package/dist/services/skillhub/migrations/004-loop-bee-extension.sql +65 -0
- package/dist/services/skillhub/migrations/005-evolution-evaluation.sql +81 -0
- package/dist/services/skillhub/migrations/006-crystallization-event.sql +92 -0
- package/dist/services/skills/skill-registry.js +2 -2
- package/dist/services/skills/skill-runbook-service.js +1 -1
- package/dist/services/slice/slice-check-service.js +1 -1
- package/dist/services/understand/understand-hybrid-service.js +1 -1
- package/dist/services/understand/understand-scan-service.js +2 -2
- package/dist/services/upgrade/upgrade-service.js +4 -3
- package/dist/services/verdict/envelopes.d.ts +2 -2
- package/dist/services/verdict/envelopes.js +2 -2
- package/dist/services/verdict/verdict-aggregator.d.ts +3 -3
- package/dist/services/workflow/autonomous-resume-writer.js +1 -1
- package/dist/services/workflow/plan-reader.d.ts +1 -1
- package/dist/services/workflow/plan-reader.js +1 -1
- package/dist/services/workflow/plan-refresher.d.ts +1 -1
- package/dist/services/workflow/plan-refresher.js +1 -1
- package/dist/services/workflow/plan-trigger-detector.d.ts +1 -1
- package/dist/services/workflow/plan-trigger-detector.js +1 -1
- package/dist/services/workflow/workflow-router-service.js +11 -9
- package/dist/services/workspace/migrate-service.js +1 -1
- package/dist/services/workspace/workspace-service.js +1 -1
- package/package.json +14 -8
- package/scripts/copy-templates.mjs +16 -0
- package/scripts/sync-version.mjs +8 -1
- package/skills/bee/peaks-rd/SKILL.md +14 -1
- package/skills/peaks-code/SKILL.md +44 -0
- package/skills/peaks-code/references/sub-agent-dispatch.md +30 -0
- package/dist/services/agent/ecc-cache-service.d.ts +0 -97
- package/dist/services/agent/ecc-cache-service.js +0 -491
- package/dist/services/audit-independent/perf-audit-service.d.ts +0 -151
- package/dist/services/audit-independent/perf-audit-service.js +0 -316
- package/dist/services/audit-independent/security-audit-service.d.ts +0 -155
- package/dist/services/audit-independent/security-audit-service.js +0 -316
- package/dist/services/context/dispatch-context-guard.d.ts +0 -27
- package/dist/services/context/dispatch-context-guard.js +0 -192
- package/dist/services/context/shared-channel.d.ts +0 -93
- package/dist/services/context/shared-channel.js +0 -308
- package/dist/services/crystallization/crystallization-service.d.ts +0 -239
- package/dist/services/crystallization/crystallization-service.js +0 -397
- package/dist/services/crystallization/crystallization-store.d.ts +0 -75
- package/dist/services/crystallization/crystallization-store.js +0 -193
- package/dist/services/crystallization/crystallization-types.d.ts +0 -313
- package/dist/services/crystallization/crystallization-types.js +0 -299
- package/dist/services/crystallization/evidence-brief-builder.d.ts +0 -237
- package/dist/services/crystallization/evidence-brief-builder.js +0 -240
- package/dist/services/doctor/doctor-service.d.ts +0 -149
- package/dist/services/doctor/doctor-service.js +0 -929
- package/dist/services/filesystem/file-lock.d.ts +0 -11
- package/dist/services/filesystem/file-lock.js +0 -152
- package/dist/services/final-review/final-review-service.d.ts +0 -12
- package/dist/services/final-review/final-review-service.js +0 -52
- package/dist/services/final-review/final-review-types.d.ts +0 -42
- package/dist/services/final-review/final-review-types.js +0 -18
- package/dist/services/job/job-resource-snapshot.d.ts +0 -7
- package/dist/services/job/job-resource-snapshot.js +0 -75
- package/dist/services/mut/assert-scanner.d.ts +0 -6
- package/dist/services/mut/assert-scanner.js +0 -116
- package/dist/services/mut/index.d.ts +0 -8
- package/dist/services/mut/index.js +0 -7
- package/dist/services/mut/mut-runner.d.ts +0 -39
- package/dist/services/mut/mut-runner.js +0 -29
- package/dist/services/mut/production-stryker.d.ts +0 -2
- package/dist/services/mut/production-stryker.js +0 -75
- package/dist/services/mut/report-builder.d.ts +0 -11
- package/dist/services/mut/report-builder.js +0 -110
- package/dist/services/mut/report-loader.d.ts +0 -31
- package/dist/services/mut/report-loader.js +0 -78
- package/dist/services/mut/thresholds.d.ts +0 -21
- package/dist/services/mut/thresholds.js +0 -22
- package/dist/services/mut/types.d.ts +0 -336
- package/dist/services/mut/types.js +0 -59
- package/dist/shared/fs.d.ts +0 -4
- package/dist/shared/fs.js +0 -26
- package/dist/shared/paths.d.ts +0 -6
- package/dist/shared/paths.js +0 -50
- package/dist/shared/result.d.ts +0 -22
- package/dist/shared/result.js +0 -46
- package/dist/shared/version.d.ts +0 -1
- package/dist/shared/version.js +0 -1
- package/examples/video-demo/README.md +0 -142
- package/examples/video-demo/out/en-closing-960.png +0 -0
- package/examples/video-demo/out/zh-closing-960.png +0 -0
- package/examples/video-demo/preview/peaks-loop-demo-en.mp4 +0 -0
- package/examples/video-demo/preview/peaks-loop-demo.mp4 +0 -0
package/README-en.md
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
style="border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.55); display: block;"
|
|
23
23
|
/>
|
|
24
24
|
<br>
|
|
25
|
-
<sub>👆 18s looping GIF (<a href="https://
|
|
25
|
+
<sub>👆 18s looping GIF (full 30s mp4 is no longer shipped with the npm package — see <a href="https://github.com/SquabbyZ/peaks-loop/releases">GitHub Releases</a> · 13MB · 480p)</sub>
|
|
26
26
|
</p>
|
|
27
27
|
|
|
28
28
|
---
|
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
style="border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.55); display: block;"
|
|
23
23
|
/>
|
|
24
24
|
<br>
|
|
25
|
-
<sub>👆 18s 循环 GIF(<a href="https://
|
|
25
|
+
<sub>👆 18s 循环 GIF(完整 30s mp4 不再随 npm 包发布,见 <a href="https://github.com/SquabbyZ/peaks-loop/releases">GitHub Release</a> · 13MB · 480p)</sub>
|
|
26
26
|
</p>
|
|
27
27
|
|
|
28
28
|
---
|
|
@@ -220,6 +220,37 @@ peaks-loop 的两条工程脊柱直接来自这两个项目:
|
|
|
220
220
|
|
|
221
221
|
---
|
|
222
222
|
|
|
223
|
+
## 发布(Trusted Publishing · OIDC)
|
|
224
|
+
|
|
225
|
+
本仓库发布链路**不**使用 npm token,改用 **Trusted Publishing + OIDC**:
|
|
226
|
+
|
|
227
|
+
- 维护者**不需要**也不会持有 `NPM_TOKEN` —— `~/.npmrc` 已被清理,npmjs.com 已把 Publishing access 切到 disallow tokens。
|
|
228
|
+
- 触发方式 1:`git tag vX.Y.Z && git push --tags`(走 `.github/workflows/publish.yml` 的 `push: tags: v*.*.*` 触发器)。
|
|
229
|
+
- 触发方式 2:GitHub UI → Actions → publish → Run workflow(手动兜底,可用于 dry-run / 补发)。
|
|
230
|
+
- 每次发布跑完整链路:`install → typecheck → build → vitest → changesets version → changesets publish`,全部通过才会真正落到 npm。
|
|
231
|
+
- 维护者的本地动作只有两步:`pnpm changeset` 写变更说明 + 合并 PR(剩下的 CI 自动跑)。
|
|
232
|
+
|
|
233
|
+
**npmjs 侧一次性配置**(本 slice 完成后由人工做一次):
|
|
234
|
+
|
|
235
|
+
1. 登录 https://www.npmjs.com → Settings → Trusted Publishers → Add GitHub Action。
|
|
236
|
+
2. Owner / Org:`SquabbyZ` · Repository:`peaks-loop` · Workflow filename:`publish.yml` · Environment name:留空。
|
|
237
|
+
3. 保存。
|
|
238
|
+
|
|
239
|
+
**撤销** = npmjs 端删 trusted publisher,**无需** rotate token。
|
|
240
|
+
|
|
241
|
+
**常见故障**:
|
|
242
|
+
|
|
243
|
+
| 现象 | 原因 | 修法 |
|
|
244
|
+
|------|------|------|
|
|
245
|
+
| publish 步骤报 `Cannot get JWT` | 缺 `id-token: write` | 检查 `.github/workflows/publish.yml#permissions` |
|
|
246
|
+
| publish 步骤报 `ENEEDAUTH` 或 `404 from registry.npmjs.org` | npmjs 端没配 trusted publisher | 走上面的 3 步配置 |
|
|
247
|
+
| `changeset version` 把 `package.json` 改了我没想要 | 漏掉了手动 version | 提交前先本地 `pnpm changeset version`,CI 端为 no-op |
|
|
248
|
+
| tag 推了但 CI 没跑 | tag 格式不符 `v*.*.*` | 检查 `git tag` 输出 |
|
|
249
|
+
|
|
250
|
+
详细 RD 文档见 [`docs/superpowers/slices/slice-s1-trusted-publish.md`](./docs/superpowers/slices/slice-s1-trusted-publish.md)。
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
223
254
|
<div align="center">
|
|
224
255
|
|
|
225
256
|
MIT License · Made by [SquabbyZ](https://github.com/SquabbyZ) · 中文版 · [English version](./README-en.md)
|
package/bin/peaks.js
CHANGED
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import { getErrorMessage, ok, redactSensitiveErrorMessage, type ResultEnvelope } from '
|
|
2
|
+
import { getErrorMessage, ok, redactSensitiveErrorMessage, type ResultEnvelope } from 'peaks-loop-shared/result';
|
|
3
3
|
import type { ArtifactProvider, GuidedArtifactSetup } from '../services/artifacts/artifact-service.js';
|
|
4
4
|
import type { ConfigLayer } from '../services/config/config-service.js';
|
|
5
5
|
import type { RecommendationWorkflow } from '../services/recommendations/recommendation-service.js';
|
package/dist/cli/cli-helpers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fail, getErrorMessage, ok, redactSensitiveErrorMessage } from '
|
|
1
|
+
import { fail, getErrorMessage, ok, redactSensitiveErrorMessage } from 'peaks-loop-shared/result';
|
|
2
2
|
export function printResult(io, result, asJson = false) {
|
|
3
3
|
if (asJson) {
|
|
4
4
|
io.stdout(JSON.stringify(result, null, 2));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
3
|
-
import { fail, ok, getErrorMessage } from '
|
|
3
|
+
import { fail, ok, getErrorMessage } from 'peaks-loop-shared/result';
|
|
4
4
|
import { AdapterRegistry } from '../../services/adapter/adapter-registry.js';
|
|
5
5
|
import { registryFileFor } from './runtime-commands.js';
|
|
6
6
|
function resolveProjectRoot(explicit) {
|
|
@@ -43,12 +43,14 @@
|
|
|
43
43
|
import { existsSync, mkdirSync } from "node:fs";
|
|
44
44
|
import { join } from "node:path";
|
|
45
45
|
import { openStateDb } from "../../services/skillhub/sqlite-store.js";
|
|
46
|
-
import { CrystallizationService, CrystallizationIntegrityError, } from "
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
46
|
+
import { CrystallizationService, CrystallizationIntegrityError, BriefSectionError, safeRenderRecommendationPayload, CRYSTALLIZATION_TRIGGERS, parseEvidenceBrief, } from "peaks-loop-crystallization";
|
|
47
|
+
import { LoopReleaseSchema, } from "../../services/loop/loop-release-types.js";
|
|
48
|
+
import { insertLoopRelease, } from "../../services/loop/loop-release-store.js";
|
|
49
|
+
import { insertLoopBeeRelation, } from "../../services/loop/loop-bee-relation-store.js";
|
|
50
|
+
import { LoopBeeRelationSchema, } from "../../services/loop/loop-bee-relation-types.js";
|
|
49
51
|
import { findProjectRoot } from "../../services/config/config-safety.js";
|
|
50
52
|
import { addJsonOption, getErrorMessage, printResult } from "../cli-helpers.js";
|
|
51
|
-
import { fail, ok } from
|
|
53
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
52
54
|
function collectRepeatable(value, previous) {
|
|
53
55
|
if (Array.isArray(previous))
|
|
54
56
|
return [...previous, value];
|
|
@@ -120,7 +122,8 @@ export function registerAssetCommands(program, io) {
|
|
|
120
122
|
}
|
|
121
123
|
catch (err) {
|
|
122
124
|
if (err instanceof BriefSectionError) {
|
|
123
|
-
|
|
125
|
+
const briefErr = err;
|
|
126
|
+
printResult(io, fail("asset.crystallize", "MISSING_BRIEF_SECTION", briefErr.message, { findings: [...briefErr.findings], flagsProvided: Object.keys(candidateBrief) }, [
|
|
124
127
|
"Pass ALL FOUR brief sections via --brief-what-happened / --brief-why-it-matters / --brief-what-learned / --brief-what-action.",
|
|
125
128
|
"The CLI refuses to render a recommendation without a complete 4-section brief (spec §4.7 / RL-7).",
|
|
126
129
|
]), options.json);
|
|
@@ -155,7 +158,12 @@ export function registerAssetCommands(program, io) {
|
|
|
155
158
|
}
|
|
156
159
|
const db = openStateDb(join(projectRoot, ".peaks", "state.db"));
|
|
157
160
|
try {
|
|
158
|
-
const svc = new CrystallizationService(db
|
|
161
|
+
const svc = new CrystallizationService(db, {
|
|
162
|
+
loopReleaseSchema: LoopReleaseSchema,
|
|
163
|
+
loopBeeRelationSchema: LoopBeeRelationSchema,
|
|
164
|
+
insertLoopRelease: insertLoopRelease,
|
|
165
|
+
insertLoopBeeRelation: insertLoopBeeRelation,
|
|
166
|
+
});
|
|
159
167
|
const result = svc.crystallize({
|
|
160
168
|
task: {
|
|
161
169
|
task_id: options.fromTask,
|
|
@@ -217,10 +225,11 @@ export function registerAssetCommands(program, io) {
|
|
|
217
225
|
}
|
|
218
226
|
catch (err) {
|
|
219
227
|
if (err instanceof CrystallizationIntegrityError) {
|
|
220
|
-
|
|
221
|
-
|
|
228
|
+
const integrityErr = err;
|
|
229
|
+
printResult(io, fail("asset.crystallize", integrityErr.code, integrityErr.message, { findings: [...integrityErr.findings] }, [
|
|
230
|
+
integrityErr.code === "CRYSTALLIZATION_PRE_RUN"
|
|
222
231
|
? "Re-shape the candidate task so task_status=completed AND gates_passed=true AND evidence_collected=true (spec §5 / RL-2)."
|
|
223
|
-
:
|
|
232
|
+
: integrityErr.code === "MISSING_BRIEF_SECTION"
|
|
224
233
|
? "Pass ALL FOUR brief sections (RL-7); the CLI refuses to render a recommendation without them."
|
|
225
234
|
: "Inspect the failure findings and re-shape the payload.",
|
|
226
235
|
]), options.json);
|
|
@@ -228,14 +237,12 @@ export function registerAssetCommands(program, io) {
|
|
|
228
237
|
return;
|
|
229
238
|
}
|
|
230
239
|
if (err instanceof BriefSectionError) {
|
|
231
|
-
|
|
240
|
+
const briefErr = err;
|
|
241
|
+
printResult(io, fail("asset.crystallize", "MISSING_BRIEF_SECTION", briefErr.message, { findings: [...briefErr.findings] }, ["Pass all 4 brief sections (RL-7)."]), options.json);
|
|
232
242
|
process.exitCode = 1;
|
|
233
243
|
return;
|
|
234
244
|
}
|
|
235
|
-
|
|
236
|
-
"Verify the brief flags and the loop/bee identifiers are valid.",
|
|
237
|
-
]), options.json);
|
|
238
|
-
process.exitCode = 1;
|
|
245
|
+
throw err;
|
|
239
246
|
}
|
|
240
247
|
});
|
|
241
248
|
// ---------- peaks asset dispose ----------
|
|
@@ -258,7 +265,12 @@ export function registerAssetCommands(program, io) {
|
|
|
258
265
|
}
|
|
259
266
|
const db = openStateDb(join(projectRoot, ".peaks", "state.db"));
|
|
260
267
|
try {
|
|
261
|
-
const svc = new CrystallizationService(db
|
|
268
|
+
const svc = new CrystallizationService(db, {
|
|
269
|
+
loopReleaseSchema: LoopReleaseSchema,
|
|
270
|
+
loopBeeRelationSchema: LoopBeeRelationSchema,
|
|
271
|
+
insertLoopRelease: insertLoopRelease,
|
|
272
|
+
insertLoopBeeRelation: insertLoopBeeRelation,
|
|
273
|
+
});
|
|
262
274
|
const existing = svc.read(options.crystallizationEvent);
|
|
263
275
|
if (!existing) {
|
|
264
276
|
printResult(io, fail("asset.dispose", "ASSET_EVENT_NOT_FOUND", `crystallization event '${options.crystallizationEvent}' not found`, { eventId: options.crystallizationEvent }, ["Verify the event id."]), options.json);
|
|
@@ -331,7 +343,12 @@ export function registerAssetCommands(program, io) {
|
|
|
331
343
|
}
|
|
332
344
|
const db = openStateDb(join(projectRoot, ".peaks", "state.db"));
|
|
333
345
|
try {
|
|
334
|
-
const svc = new CrystallizationService(db
|
|
346
|
+
const svc = new CrystallizationService(db, {
|
|
347
|
+
loopReleaseSchema: LoopReleaseSchema,
|
|
348
|
+
loopBeeRelationSchema: LoopBeeRelationSchema,
|
|
349
|
+
insertLoopRelease: insertLoopRelease,
|
|
350
|
+
insertLoopBeeRelation: insertLoopBeeRelation,
|
|
351
|
+
});
|
|
335
352
|
let events = [];
|
|
336
353
|
if (options.loop) {
|
|
337
354
|
events = [
|
|
@@ -12,7 +12,7 @@ import { resolve } from 'node:path';
|
|
|
12
12
|
import { runRedLinesAudit } from '../../services/audit/red-lines-service.js';
|
|
13
13
|
import { runStaticAudit } from '../../services/audit/static-service.js';
|
|
14
14
|
import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
|
|
15
|
-
import { fail, ok } from '
|
|
15
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
16
16
|
import { writeAuditDecision } from '../../services/audit/decision-writer.js';
|
|
17
17
|
import { computeProseRatio } from '../../services/audit/prose-ratio-calculator.js';
|
|
18
18
|
import { writeMachineOutput, writeNarrative, writePrompt, } from '../../services/audit/artifact-writer.js';
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
import { existsSync, mkdirSync } from 'node:fs';
|
|
25
25
|
import { join } from 'node:path';
|
|
26
26
|
import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
|
|
27
|
-
import { fail, ok } from '
|
|
27
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
28
28
|
import { findProjectRoot } from '../../services/config/config-safety.js';
|
|
29
29
|
import { openStateDb } from '../../services/skillhub/sqlite-store.js';
|
|
30
30
|
import { writeBundle, BundleNotShareableError, BundleAssetNotFoundError, } from '../../services/share/bundle-writer.js';
|
|
@@ -2,7 +2,7 @@ import { readConfig } from '../../services/config/config-service.js';
|
|
|
2
2
|
import { resolveCapabilityAvailability } from '../../services/recommendations/capability-availability.js';
|
|
3
3
|
import { createCapabilityMapPlan } from '../../services/recommendations/capability-map-service.js';
|
|
4
4
|
import { seedCapabilityItems, seedCapabilitySources } from '../../services/recommendations/seed-capability-catalog.js';
|
|
5
|
-
import { fail, ok } from '
|
|
5
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
6
6
|
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
7
7
|
const CAPABILITY_SOURCE_FILTERS = new Set(['all', 'access-repo', 'mcp-server']);
|
|
8
8
|
export function registerCapabilityCommands(program, io) {
|
|
@@ -20,7 +20,7 @@ import { classifyTask } from '../../services/classify/classify-service.js';
|
|
|
20
20
|
import { TASK_LEVELS } from '../../services/classify/classify-types.js';
|
|
21
21
|
import { loadPreferences } from '../../services/preferences/preferences-service.js';
|
|
22
22
|
import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
|
|
23
|
-
import { fail, ok } from '
|
|
23
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
24
24
|
const CLASSIFY_AUDIT_FILE = 'classify-audit.jsonl';
|
|
25
25
|
function getSignalsFromGitDiff(projectRoot) {
|
|
26
26
|
// Use git diff --stat to extract file count + line count. Fall back to
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
import { existsSync, readFileSync } from 'node:fs';
|
|
19
19
|
import { join } from 'node:path';
|
|
20
20
|
import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
|
|
21
|
-
import { fail, ok } from '
|
|
21
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
22
22
|
import { emitObservabilityEvent } from '../../services/observability/observability-service.js';
|
|
23
23
|
import { findProjectRoot } from '../../services/config/config-safety.js';
|
|
24
24
|
import { GATED_STEPS, isHardFloorCategory, isCodeMode, isCommitBoundaryAction, shouldPauseAtGate, formatAutoProceedLogLine } from '../../services/code/mode-gate.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getOcrConfigTemplate, detectOcr, runOcrReview } from '../../services/code-review/ocr-service.js';
|
|
2
2
|
import { getOcrLlmConfig, getUserConfigPath, redactConfigSecrets } from '../../services/config/config-service.js';
|
|
3
3
|
import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
|
|
4
|
-
import { fail, ok } from '
|
|
4
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
5
5
|
export function registerCodeReviewCommands(program, io) {
|
|
6
6
|
const codeReview = program
|
|
7
7
|
.command('code-review', { hidden: true })
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InvalidArgumentError } from 'commander';
|
|
2
2
|
import { createCodegraphInvocation, executeCodegraphInvocation } from '../../services/codegraph/codegraph-service.js';
|
|
3
|
-
import { fail } from '
|
|
3
|
+
import { fail } from 'peaks-loop-shared/result';
|
|
4
4
|
import { getErrorMessage, printResult, redactSensitiveErrorMessage } from '../cli-helpers.js';
|
|
5
5
|
function addPeaksJsonOption(command) {
|
|
6
6
|
return command.option('--peaks-json', 'print Peaks error envelope as machine-readable JSON');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveCanonicalProjectRoot } from '../../services/config/config-service.js';
|
|
2
2
|
import { findProjectRoot } from '../../services/config/config-safety.js';
|
|
3
|
-
import { fail, ok, getErrorMessage } from '
|
|
3
|
+
import { fail, ok, getErrorMessage } from 'peaks-loop-shared/result';
|
|
4
4
|
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
5
5
|
import { writeCheckpoint } from '../../services/session/session-checkpoint-service.js';
|
|
6
6
|
import { getSessionIdCanonical } from '../../services/session/session-manager.js';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { findProjectRoot } from '../../services/config/config-safety.js';
|
|
8
8
|
import { estimateComplexity } from '../../services/complexity/complexity-estimator.js';
|
|
9
|
-
import { fail, ok } from '
|
|
9
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
10
10
|
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
11
11
|
export function registerComplexityCommands(program, io) {
|
|
12
12
|
addJsonOption(program
|
|
@@ -2,7 +2,7 @@ import { executeMigration, planMigration } from '../../services/config/config-mi
|
|
|
2
2
|
import { getConfig, isSensitiveConfigPath, redactConfigSecrets, setConfig } from '../../services/config/config-service.js';
|
|
3
3
|
import { listAvailableFields, restoreField } from '../../services/config/config-restore.js';
|
|
4
4
|
import { executeRollback, planRollback } from '../../services/config/config-rollback.js';
|
|
5
|
-
import { fail, ok } from '
|
|
5
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
6
6
|
import { addJsonOption, getErrorMessage, parseConfigLayer, printInvalidConfigLayer, printResult } from '../cli-helpers.js';
|
|
7
7
|
export function registerConfigCommands(program, io) {
|
|
8
8
|
const config = program.command('config').description('Manage Peaks configuration');
|
|
@@ -19,7 +19,7 @@ import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
|
19
19
|
import { join } from 'node:path';
|
|
20
20
|
import { searchMemory } from '../../services/memory/memory-search-service.js';
|
|
21
21
|
import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
|
|
22
|
-
import { fail, ok } from '
|
|
22
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
23
23
|
import { emitObservabilityEvent } from '../../services/observability/observability-service.js';
|
|
24
24
|
import { findProjectRoot } from '../../services/config/config-safety.js';
|
|
25
25
|
import { getSessionIdCanonical } from '../../services/session/session-manager.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fail, ok, getErrorMessage } from '
|
|
1
|
+
import { fail, ok, getErrorMessage } from 'peaks-loop-shared/result';
|
|
2
2
|
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
3
3
|
import { writeContract } from '../../services/dispatch/contract-store.js';
|
|
4
4
|
import { getCurrentSessionId } from '../../services/skills/skill-presence-service.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createArtifactInitPlan, getArtifactStatus, createGuidedArtifactSetup } from '../../../services/artifacts/artifact-service.js';
|
|
2
2
|
import { getArtifactWorkspaceStatus, planArtifactSync } from '../../../services/artifacts/workspace-service.js';
|
|
3
|
-
import { fail, ok } from '
|
|
3
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
4
4
|
import { addJsonOption, failUnsupportedNonDryRun, isArtifactProvider, isArtifactSetupStep, printResult } from '../../cli-helpers.js';
|
|
5
5
|
export function registerArtifactsCommand(program, io) {
|
|
6
6
|
const artifacts = program.command('artifacts').description('Manage intermediate artifact repositories');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addJsonOption, printResult } from '../../cli-helpers.js';
|
|
2
2
|
import { findProjectRoot } from '../../../services/config/config-safety.js';
|
|
3
3
|
import { loadBindingStatus, formatTable, formatJson } from '../../../services/session/binding-status-service.js';
|
|
4
|
-
import { fail, ok } from '
|
|
4
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
5
5
|
// v2.18.2 PATCH scope (follow-up issues #2). Read-only introspection
|
|
6
6
|
// CLI. Surface is intentionally minimal: one subcommand
|
|
7
7
|
// (`peaks binding status`), two output modes (table + json), one
|
|
@@ -1,8 +1,62 @@
|
|
|
1
|
-
import { runDoctor } from '
|
|
1
|
+
import { runDoctor } from 'peaks-loop-doctor';
|
|
2
2
|
import { readBinding, dropStale, rebuildBindingFromLegacy } from '../../../services/session/binding-store.js';
|
|
3
3
|
import { findProjectRoot } from '../../../services/config/config-safety.js';
|
|
4
|
+
import { loadSkillRegistry } from '../../../services/skills/skill-registry.js';
|
|
5
|
+
import { planStatusLineInstall } from '../../../services/skills/statusline-settings-service.js';
|
|
4
6
|
import { addJsonOption, printResult } from '../../cli-helpers.js';
|
|
5
|
-
import { fail, ok } from '
|
|
7
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
8
|
+
// slice-3b Option C: the doctor subpackage owns the check pipeline but
|
|
9
|
+
// does NOT import cross-domain utils from the main package (avoids
|
|
10
|
+
// circular deps). The CLI is the natural wiring point — every cross-
|
|
11
|
+
// domain util the doctor used to import directly is now injected as a
|
|
12
|
+
// probe on DoctorOptions at call-site:
|
|
13
|
+
//
|
|
14
|
+
// loadSkills ← loadSkillRegistry (main/services/skills/skill-registry.ts)
|
|
15
|
+
// skillPresenceProbe ← leave as-is; doctor-command does not own the presence probe
|
|
16
|
+
// statusLineInstalledProbe ← defaults to a `planStatusLineInstall` wrapper below
|
|
17
|
+
// projectRootResolver ← findProjectRoot (main/services/config/config-safety.ts)
|
|
18
|
+
// isValidSessionIdProbe ← the regex kept in main/services/workspace/sid-naming-guard.ts
|
|
19
|
+
//
|
|
20
|
+
// Inlining isValidSessionId via the doctor subpackage's default regex
|
|
21
|
+
// (which mirrors the upstream file byte-for-byte) keeps the L3 orphan
|
|
22
|
+
// check behaviour-identical without dragging sid-naming-guard into a
|
|
23
|
+
// workspace package. If sid-naming-guard is ever moved into
|
|
24
|
+
// peaks-loop-shared, swap this for a re-import.
|
|
25
|
+
function doctorIsValidSessionId(sid) {
|
|
26
|
+
return /^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])-session-[0-9a-z]{3,6}$/.test(sid);
|
|
27
|
+
}
|
|
28
|
+
function statusLineAlreadyInstalledForScope(scope, projectRoot) {
|
|
29
|
+
try {
|
|
30
|
+
if (scope === 'project') {
|
|
31
|
+
if (projectRoot === undefined)
|
|
32
|
+
return false;
|
|
33
|
+
return planStatusLineInstall('project', projectRoot).alreadyInstalled;
|
|
34
|
+
}
|
|
35
|
+
return planStatusLineInstall('global').alreadyInstalled;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function doctorStatusLineInstalledProbe() {
|
|
42
|
+
const projectRoot = findProjectRoot(process.cwd());
|
|
43
|
+
// Check both scopes: a user may have installed the statusLine globally, which
|
|
44
|
+
// the project-only check would miss and falsely report as "not installed".
|
|
45
|
+
try {
|
|
46
|
+
if (projectRoot !== null && statusLineAlreadyInstalledForScope('project', projectRoot)) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch { // TODO(g2): legacy silent catch — grace: 1 minor release (v2.14.0)
|
|
51
|
+
/* fall through to global */
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
return statusLineAlreadyInstalledForScope('global');
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
6
60
|
// Slice v2.16.0 AC-10: stale binding TTL is 5 minutes by default. The
|
|
7
61
|
// threshold is exposed as a CLI flag so users can tune it for
|
|
8
62
|
// long-running sessions.
|
|
@@ -129,7 +183,13 @@ export function registerDoctorCommand(program, io) {
|
|
|
129
183
|
}
|
|
130
184
|
return;
|
|
131
185
|
}
|
|
132
|
-
const report = await runDoctor(
|
|
186
|
+
const report = await runDoctor({
|
|
187
|
+
// slice-3b Option C: wire cross-domain probes at call-site.
|
|
188
|
+
loadSkills: loadSkillRegistry,
|
|
189
|
+
projectRootResolver: () => findProjectRoot(process.cwd()),
|
|
190
|
+
isValidSessionIdProbe: doctorIsValidSessionId,
|
|
191
|
+
statusLineInstalledProbe: doctorStatusLineInstalledProbe
|
|
192
|
+
});
|
|
133
193
|
let logsSection = null;
|
|
134
194
|
if (options.log === true) {
|
|
135
195
|
logsSection = await buildDoctorLogsSection();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { executeProjectMemoryBackup, executeProjectMemoryExtract, summarizeProjectMemoryBackupResult, summarizeProjectMemoryExtractResult } from '../../../services/memory/project-memory-service.js';
|
|
2
|
-
import { fail, ok } from '
|
|
2
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
3
3
|
import { addJsonOption, getErrorMessage, printResult } from '../../cli-helpers.js';
|
|
4
4
|
export function registerMemoryCommand(program, io) {
|
|
5
5
|
const memory = program.command('memory').description('Manage project-local Peaks memory');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { listProfiles } from '../../../services/profiles/profile-service.js';
|
|
2
|
-
import { ok } from '
|
|
2
|
+
import { ok } from 'peaks-loop-shared/result';
|
|
3
3
|
import { addJsonOption, printResult } from '../../cli-helpers.js';
|
|
4
4
|
export function registerProfileCommand(program, io) {
|
|
5
5
|
const profile = program.command('profile').description('Manage runtime profiles');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { planProxyTest } from '../../../services/proxy/proxy-service.js';
|
|
2
|
-
import { fail, ok } from '
|
|
2
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
3
3
|
import { addJsonOption, failUnsupportedNonDryRun, getErrorMessage, printResult } from '../../cli-helpers.js';
|
|
4
4
|
export function registerProxyCommand(program, io) {
|
|
5
5
|
const proxy = program.command('proxy').description('Manage proxy settings');
|
|
@@ -3,7 +3,7 @@ import { join } from 'node:path';
|
|
|
3
3
|
import { getSessionMeta, rotateSessionBinding, setSessionTitle, listSessionMetas } from '../../../services/session/session-manager.js';
|
|
4
4
|
import { resolveCanonicalProjectRoot } from '../../../services/config/config-service.js';
|
|
5
5
|
import { findProjectRoot } from '../../../services/config/config-safety.js';
|
|
6
|
-
import { fail, ok } from '
|
|
6
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
7
7
|
import { addJsonOption, getErrorMessage, printResult } from '../../cli-helpers.js';
|
|
8
8
|
// Slice 2026-07-01-strategic-compact-cli fix: register the
|
|
9
9
|
// `peaks session checkpoint` and `peaks session resume` subcommands
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { runDoctor } from '
|
|
1
|
+
import { runDoctor } from 'peaks-loop-doctor';
|
|
2
2
|
import { listSkills } from '../../../services/skills/skill-registry.js';
|
|
3
3
|
import { runSkillSync, SYNC_PLATFORMS } from '../../../services/skills/sync-service.js';
|
|
4
4
|
import { inspectSkillRunbook } from '../../../services/skills/skill-runbook-service.js';
|
|
@@ -7,7 +7,7 @@ import { detectPresenceMarker } from '../../../services/hooks/presence-marker-de
|
|
|
7
7
|
import { findProjectRoot } from '../../../services/config/config-safety.js';
|
|
8
8
|
import { generateProjectContext } from '../../../services/memory/project-context-service.js';
|
|
9
9
|
import { getSessionId, setSessionMeta } from '../../../services/session/session-manager.js';
|
|
10
|
-
import { fail, ok } from '
|
|
10
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
11
11
|
import { addJsonOption, getErrorMessage, printResult } from '../../cli-helpers.js';
|
|
12
12
|
// Slice S0 (4.0.0-beta.5 peaks-solo dispatcher release):
|
|
13
13
|
// `peaks skill search` is the CLI primitive that feeds the
|
|
@@ -2,7 +2,7 @@ import { summarizeProjectStandardsInitResult, summarizeProjectStandardsUpdateRes
|
|
|
2
2
|
import { executeProjectStandardsInitIdeAware, executeProjectStandardsUpdateIdeAware } from '../../../services/standards/ide-aware-standards-service.js';
|
|
3
3
|
import { migrateStandards } from '../../../services/standards/migrate-service.js';
|
|
4
4
|
import { migrateClaudeRules } from '../../../services/standards/migrate-claude-rules-service.js';
|
|
5
|
-
import { fail, ok } from '
|
|
5
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
6
6
|
import { addJsonOption, getErrorMessage, printResult } from '../../cli-helpers.js';
|
|
7
7
|
export function registerStandardsCommand(program, io) {
|
|
8
8
|
const standards = program.command('standards').description('Manage project-local coding standards');
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { existsSync } from 'node:fs';
|
|
18
18
|
import { randomUUID } from 'node:crypto';
|
|
19
|
-
import { fail, getErrorMessage, ok } from '
|
|
19
|
+
import { fail, getErrorMessage, ok } from 'peaks-loop-shared/result';
|
|
20
20
|
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
21
21
|
import { detectInstalledIde } from '../../services/ide/ide-detector.js';
|
|
22
22
|
import { getAdapter } from '../../services/ide/ide-registry.js';
|
|
@@ -27,7 +27,7 @@ import { writeInitialDispatchRecord } from '../../services/dispatch/dispatch-rec
|
|
|
27
27
|
import { evaluatePromptSize } from '../../services/context/context-guard.js';
|
|
28
28
|
import { getCurrentSessionId } from '../../services/skills/skill-presence-service.js';
|
|
29
29
|
import { buildArtifactMeta, buildContextImpact } from '../../services/context/artifact-meta.js';
|
|
30
|
-
import { assertSafeArtifactPath } from '
|
|
30
|
+
import { assertSafeArtifactPath } from 'peaks-loop-shared-channel';
|
|
31
31
|
import { compressPrompt } from '../../services/context/headroom-client.js';
|
|
32
32
|
import { resolveHeadroomOptions } from '../../services/context/headroom-prefs.js';
|
|
33
33
|
import { loadPreferences } from '../../services/preferences/preferences-service.js';
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import { randomUUID } from 'node:crypto';
|
|
30
30
|
import { printResult } from '../cli-helpers.js';
|
|
31
|
-
import { fail, ok } from '
|
|
31
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
32
32
|
import { detectInstalledIde } from '../../services/ide/ide-detector.js';
|
|
33
33
|
import { getAdapter } from '../../services/ide/ide-registry.js';
|
|
34
34
|
import { getCurrentSessionId } from '../../services/skills/skill-presence-service.js';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { resolve as resolvePath } from 'node:path';
|
|
10
10
|
import { findProjectRoot } from '../../services/config/config-safety.js';
|
|
11
11
|
import { generateSkillFromCommands, gitLogSince, renderSkillMarkdown, suggestChangelog } from '../../services/doc/doc-generator.js';
|
|
12
|
-
import { fail, ok } from '
|
|
12
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
13
13
|
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
14
14
|
export function registerDocCommands(program, io) {
|
|
15
15
|
const doc = program
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { downloadToCache, listCachedAgents, readAgentSkill, readCacheManifest, } from '
|
|
1
|
+
import { downloadToCache, listCachedAgents, readAgentSkill, readCacheManifest, } from 'peaks-loop-mut';
|
|
2
2
|
import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
|
|
3
|
-
import { fail, ok } from '
|
|
3
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
4
4
|
export function registerEccCommands(program, io) {
|
|
5
5
|
const ecc = program
|
|
6
6
|
.command('ecc')
|
|
@@ -30,7 +30,7 @@ import { EVOLUTION_TARGET_KINDS, } from "../../services/evolution/evolution-type
|
|
|
30
30
|
import { findProjectRoot } from "../../services/config/config-safety.js";
|
|
31
31
|
import { runIndependentEvaluator, } from "../../services/evolution/independent-evaluator-runner.js";
|
|
32
32
|
import { addJsonOption, getErrorMessage, printResult } from "../cli-helpers.js";
|
|
33
|
-
import { fail, ok } from
|
|
33
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
34
34
|
/**
|
|
35
35
|
* Parse `--target <kind:id>`. Returns the kind + id, or `null` on
|
|
36
36
|
* failure. Validates `kind` against the EVOLUTION_TARGET_KINDS
|
|
@@ -17,7 +17,7 @@ import { resolve as resolvePath } from 'node:path';
|
|
|
17
17
|
import { findProjectRoot } from '../../services/config/config-safety.js';
|
|
18
18
|
import { getCurrentSessionId } from '../../services/skills/skill-presence-service.js';
|
|
19
19
|
import { generatePromotionStub, isPromotionLayer, listUnpromotedFeedback, parseFeedbackMemory, PROMOTION_LAYER_DETAILS, PROMOTION_LAYERS, promoteFeedback } from '../../services/feedback/feedback-promotion-service.js';
|
|
20
|
-
import { fail, ok } from '
|
|
20
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
21
21
|
import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
|
|
22
22
|
export function registerFeedbackCommands(program, io) {
|
|
23
23
|
const feedback = program
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import { existsSync, statSync } from 'node:fs';
|
|
21
21
|
import { join, resolve } from 'node:path';
|
|
22
22
|
import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
|
|
23
|
-
import { fail, ok } from '
|
|
23
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
24
24
|
/** Whitelist of supported `--llm-provider` values for `peaks prepare-final-review`. */
|
|
25
25
|
const SUPPORTED_LLM_PROVIDERS = ['stub'];
|
|
26
26
|
function isSupportedLlmProvider(value) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
2
|
import { captureDerivedVariant, captureHistoricalFixture, EDGE_CASE_VARIANTS, ENVELOPE_KINDS } from '../../services/fixture/index.js';
|
|
3
3
|
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
4
|
-
import { fail, ok } from '
|
|
4
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
5
5
|
function isEnvelopeKind(v) {
|
|
6
6
|
return ENVELOPE_KINDS.includes(v);
|
|
7
7
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { findProjectRoot } from '../../services/config/config-safety.js';
|
|
15
15
|
import { appendSyncRecord, buildForkStatusReport, makeSyncId, readForkState, recommendStableTags, updateSyncRecordStatus, writeForkState } from '../../services/fork/fork-sync-state.js';
|
|
16
|
-
import { fail, ok } from '
|
|
16
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
17
17
|
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
18
18
|
export function registerForkCommands(program, io) {
|
|
19
19
|
const fork = program
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { enforceBashCommand, recordGateBypass, GateBypassError } from '../../services/sop/gate-enforce-service.js';
|
|
2
|
-
import { fail, ok } from '
|
|
2
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
3
3
|
import { addJsonOption, getErrorMessage, printResult } from '../cli-helpers.js';
|
|
4
4
|
import { detectIdeFromContext, parseClaudeShapeStdin } from '../../services/ide/hook-translator.js';
|
|
5
5
|
import { getAdapter } from '../../services/ide/ide-registry.js';
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* point at a sensitive file outside the runtime tree.
|
|
13
13
|
*/
|
|
14
14
|
import { existsSync } from 'node:fs';
|
|
15
|
-
import { fail, getErrorMessage, ok } from '
|
|
15
|
+
import { fail, getErrorMessage, ok } from 'peaks-loop-shared/result';
|
|
16
16
|
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
17
17
|
import { appendHeartbeat } from '../../services/dispatch/dispatch-record-writer.js';
|
|
18
18
|
import { assertSafeDispatchRecordPath } from '../../services/security/safe-settings-path.js';
|
|
@@ -6,7 +6,7 @@ import { evaluateCodeBan } from '../../services/audit/enforcers/code-ban.js';
|
|
|
6
6
|
import { isRootWrite } from '../../services/audit/enforcers/no-root-pollution.js';
|
|
7
7
|
import { checkLoginGate } from '../../services/audit/enforcers/login-gate.js';
|
|
8
8
|
import { resolveActiveSkillForCaller } from '../../services/audit/enforcers/active-skill-resolver.js';
|
|
9
|
-
import { fail, ok } from '
|
|
9
|
+
import { fail, ok } from 'peaks-loop-shared/result';
|
|
10
10
|
import { emitDecision, emitHint } from '../../services/hooks/output.js';
|
|
11
11
|
/**
|
|
12
12
|
* Read the hook payload. `PEAKS_HOOK_STDIN` is a test seam (same convention as
|