claude-code-session-manager 0.135.0 → 0.136.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/dist/assets/{AgentLibrary-DRlcF1YD.js → AgentLibrary-BFztz90B.js} +1 -1
- package/dist/assets/{AppSettings-CBhYHKGI.js → AppSettings-6_dqi9Ti.js} +1 -1
- package/dist/assets/{Button-DtBUGvGI.js → Button-5wbUTtD5.js} +1 -1
- package/dist/assets/{DocumentEditorPane-C82c7Qtl.js → DocumentEditorPane-CRgJFjka.js} +1 -1
- package/dist/assets/{Extensions-Kn-oUD2_.js → Extensions-ZXSJbnK7.js} +2 -2
- package/dist/assets/{History-B4c3Uz9u.js → History-CmSTZeiu.js} +1 -1
- package/dist/assets/{Library-1RpLT-aH.js → Library-DcTnW9kq.js} +1 -1
- package/dist/assets/{ListDetail-xr0oxNkv.js → ListDetail-BGsdNFiK.js} +1 -1
- package/dist/assets/{Panel-O8XPrpJu.js → Panel-BR2PeMf6.js} +1 -1
- package/dist/assets/{ProjectClaudeConfig-DBGhhzg2.js → ProjectClaudeConfig-DJYcUU1G.js} +1 -1
- package/dist/assets/{ProvenanceBadge-DSaizfZL.js → ProvenanceBadge-B_TDAI3k.js} +1 -1
- package/dist/assets/{Scheduler-D2_5NyiR.js → Scheduler-DqocyumD.js} +1 -1
- package/dist/assets/{Settings-Clgqb3Lq.js → Settings-BzPe2TH6.js} +1 -1
- package/dist/assets/{SkillReferenceGraph-D80RA7kR.js → SkillReferenceGraph-DfdO0Q_N.js} +1 -1
- package/dist/assets/{Skills-DNG7tHSf.js → Skills-CGPJxKhR.js} +1 -1
- package/dist/assets/{SourceChip-D-Imzszd.js → SourceChip-CI8xpHRi.js} +1 -1
- package/dist/assets/{SystemPrompt-CGlOpUQA.js → SystemPrompt-BbzGIHoz.js} +1 -1
- package/dist/assets/{TiptapBody-CJFGfBdz.js → TiptapBody-CTmjUhAI.js} +1 -1
- package/dist/assets/{Toggle-0Ff0bPa_.js → Toggle-CWx9Rq6E.js} +1 -1
- package/dist/assets/{ViewTabs-BCMYQwo_.js → ViewTabs-BnjD0Crp.js} +1 -1
- package/dist/assets/{VoiceButton-JzyC6DAB.js → VoiceButton-C-iQGCL1.js} +1 -1
- package/dist/assets/{historyTotals-B01WPBwh.js → historyTotals-BaxAMu7r.js} +1 -1
- package/dist/assets/{index-CjQ_p5y7.css → index-62tyjEQB.css} +1 -1
- package/dist/assets/index-Cob2iZhR.js +3116 -0
- package/dist/index.html +2 -2
- package/dist-web/app.css +1 -1
- package/dist-web/app.js +412 -412
- package/package.json +1 -1
- package/plugins/CLAUDE.md +9 -8
- package/plugins/packs/apple-design/.claude-plugin/plugin.json +6 -0
- package/plugins/packs/apple-design/laws.md +14 -0
- package/plugins/packs/apple-design/skills/hig-layout-and-accessibility/SKILL.md +152 -0
- package/plugins/packs/apple-design/skills/liquid-glass-adoption/SKILL.md +132 -0
- package/plugins/packs/apple-design/sm-pack.json +5 -0
- package/plugins/packs/apple-swift-core/.claude-plugin/plugin.json +12 -0
- package/plugins/packs/apple-swift-core/laws.md +13 -0
- package/plugins/packs/apple-swift-core/skills/swift-concurrency/SKILL.md +160 -0
- package/plugins/packs/apple-swift-core/skills/swiftui-state-and-navigation/SKILL.md +165 -0
- package/plugins/packs/apple-swift-core/sm-pack.json +5 -0
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
- package/plugins/session-manager-dev/skills/builder/SKILL.md +136 -91
- package/plugins/session-manager-dev/skills/builder/manual.md +80 -0
- package/plugins/session-manager-dev/skills/develop/SKILL.md +29 -56
- package/plugins/session-manager-dev/skills/develop/standards.md +11 -19
- package/plugins/session-manager-dev/skills/maintaining-md-network/SKILL.md +9 -0
- package/plugins/session-manager-dev/skills/maintaining-md-network/drift-check.md +5 -2
- package/plugins/session-manager-dev/skills/maintaining-md-network/scripts/drift-check.cjs +100 -5
- package/plugins/session-manager-dev/skills/send-feedback/SKILL.md +65 -21
- package/scripts/scheduler-mcp-server.cjs +65 -5
- package/src/main/build-info.json +4 -4
- package/src/main/chatRunner.cjs +26 -2
- package/src/main/index.cjs +4 -0
- package/src/main/ipcSchemas.cjs +13 -0
- package/src/main/lib/CLAUDE.md +2 -0
- package/src/main/lib/claude/agentModelResolve.cjs +23 -0
- package/src/main/lib/epic/epicMint.cjs +12 -6
- package/src/main/lib/epic/epicTranscriptPath.cjs +5 -4
- package/src/main/lib/epic/promptSessionsCreateEpic.cjs +8 -4
- package/src/main/lib/epic/restorableSessions.cjs +16 -8
- package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +201 -8
- package/src/main/lib/feedback-remote/crossProjectReply.cjs +375 -0
- package/src/main/lib/feedback-remote/remoteIpcDispatch.cjs +2 -0
- package/src/main/lib/mcpToolCatalog.cjs +38 -4
- package/src/main/lib/mdNetworkScan.cjs +61 -11
- package/src/main/lib/mdReviewRecord.cjs +287 -0
- package/src/main/lib/packs/packCatalog.cjs +120 -0
- package/src/main/lib/packs/packSpawnArgs.cjs +59 -0
- package/src/main/lib/packs/packsIpc.cjs +76 -0
- package/src/main/lib/persona-macro/builtinMacros.cjs +3 -2
- package/src/main/lib/persona-macro/shippedPersonaSeeds.cjs +34 -0
- package/src/main/lib/prd/prdCreate.cjs +2 -2
- package/src/main/lib/promptSessionSchema.cjs +8 -0
- package/src/main/projectPages.cjs +19 -0
- package/src/main/promptSessionEvents.cjs +8 -1
- package/src/main/scheduler.cjs +23 -2
- package/src/preload/api.d.ts +71 -0
- package/src/preload/apiSurface.json +21 -0
- package/src/preload/index.cjs +7 -0
- package/src/seed/agents/demo-video-builder.md +28 -33
- package/src/seed/agents/dev-lead.md +3 -3
- package/dist/assets/index-rt7pTODX.js +0 -3116
- package/plugins/session-manager-dev/skills/builder/0-diff/SKILL.md +0 -44
- package/plugins/session-manager-dev/skills/builder/1-classify-and-bump/SKILL.md +0 -37
- package/plugins/session-manager-dev/skills/builder/2-gate/SKILL.md +0 -37
- package/plugins/session-manager-dev/skills/builder/3-publish/SKILL.md +0 -137
- package/plugins/session-manager-dev/skills/builder/4-manual/SKILL.md +0 -124
- package/plugins/session-manager-dev/skills/builder/5-report/SKILL.md +0 -35
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Engineering standards
|
|
2
2
|
|
|
3
3
|
> Single source of truth for the engineering rationale behind every scheduled PRD.
|
|
4
|
-
> `scheduler_create_prd`
|
|
4
|
+
> `scheduler_create_prd` appends a one-line pointer to this file's
|
|
5
5
|
> absolute path to every PRD — never a copy — and the executor's ordered run contract lives in
|
|
6
6
|
> the `dev-lead` persona it is launched as. Read a section here when a contract line needs its
|
|
7
7
|
> reasoning; edit here once and every PRD sees it.
|
|
@@ -13,32 +13,24 @@
|
|
|
13
13
|
|
|
14
14
|
## Debugging approach
|
|
15
15
|
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
- If three hypotheses fail, stop and re-examine your assumptions from scratch.
|
|
19
|
-
- When a bug was recently introduced, bisect commits to find the offender.
|
|
20
|
-
- When a bug is in a long pipeline, halve the input or code path until it localizes.
|
|
21
|
-
- Record each bisection step so the path to the root cause is reproducible.
|
|
22
|
-
- Never attempt a fix until you can reproduce the bug on demand.
|
|
16
|
+
- Never attempt a fix until you can reproduce the bug on demand; if you can't, instrument the
|
|
17
|
+
system until you can.
|
|
23
18
|
- Capture the reproduction as a failing test before changing production code.
|
|
24
|
-
-
|
|
19
|
+
- For a recent regression, bisect commits; record the steps in your report.
|
|
25
20
|
|
|
26
21
|
## API reuse and single source of truth
|
|
27
22
|
|
|
28
|
-
- One concept = one implementation. Before writing code that computes, fetches, formats
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
- Treat duplication as a latent bug. Copy-pasted logic drifts; divergence between copies is how silent inconsistencies ship (e.g. one site reads a 0–100 percentage as a 0–1 fraction). When you see the same logic in two places, consolidate it on sight and route both through the shared unit.
|
|
32
|
-
- Design for extensibility: stable shared contracts, single ownership, callers depend on the contract — not on a private copy. New surfaces consume the canonical API; they never reimplement it.
|
|
33
|
-
- When reviewing or implementing, explicitly check: "is this value/behaviour already produced elsewhere, and am I reusing that path?" If not, fix the reuse before adding the feature.
|
|
23
|
+
- One concept = one implementation. Before writing code that computes, fetches, formats or displays a value, search for the existing implementation and reuse it; a datum shown in N places flows from one shared accessor, store, hook or endpoint.
|
|
24
|
+
- Extend, don't fork: generalize a close-but-insufficient function (add a param, widen the contract) instead of cloning a variant. Why: copies drift, and divergence is how silent inconsistencies ship (one site reads a 0–100 percentage as a 0–1 fraction).
|
|
25
|
+
- Duplication you touch is a bug in scope: route both copies through the shared unit when both are in the PRD's `# Files`; otherwise name the duplicate in your report.
|
|
34
26
|
|
|
35
27
|
## Test-driven development
|
|
36
28
|
|
|
37
29
|
- Write the failing test first, then the implementation that makes it pass — for every feature and every bugfix.
|
|
38
30
|
- A bugfix starts with a test that reproduces the bug (red), then the fix (green).
|
|
39
31
|
- Do not write production code without a test asserting the behavior it adds.
|
|
40
|
-
- (Interactive sessions:
|
|
41
|
-
workflow. Headless PRD runs can't load it — the three rules above are the
|
|
32
|
+
- (Interactive sessions: if a `test-driven-development` skill is installed, it has the full
|
|
33
|
+
red-green-refactor workflow. Headless PRD runs can't load it — the three rules above are the core.)
|
|
42
34
|
- Put the red test in the nearest existing scenario test for that workflow.
|
|
43
35
|
- Create a new test file only for a new module or a new workflow.
|
|
44
36
|
- Name tests and files by behaviour, never by PRD id.
|
|
@@ -77,8 +69,8 @@ Long hangs, not bad code, cause most failed runs. The PRD body carries a one-lin
|
|
|
77
69
|
- **Verify before done.** Run the acceptance test once before declaring success. Why: a run that ends on a failing test is not done — fix it or `exit 1` with the failure instead.
|
|
78
70
|
- **Fail loud, fail fast.** On any step failure, print one diagnostic line and `exit 1`. Do not swallow it with `|| true` or retry silently. Exception: a `rateLimited` exit-1 is the scheduler's own benign auto-pause — it resumes next window on its own, so do not engineer around it.
|
|
79
71
|
- **Stay in the AC.** Do not add work past the acceptance checklist — "while we're here" extras are how runs overrun. Keep the body clean UTF-8, with no NUL or control bytes.
|
|
80
|
-
- **You ARE the executor — never re-queue or self-schedule.** Do the acceptance criteria yourself. Why: `/develop` or any queue-authoring skill just writes a *new* PRD and returns — the run exits 0 having done nothing, with no commit and no verdict line (`needs_review` with `no_verdict_sentinel`). The same applies to calling `ScheduleWakeup`, or backgrounding a review agent (`/code-review`, `/security-review`) and ending your turn with something like "I'll wait for the review agents to complete": a headless run has no next turn, so nothing ever resumes it — no verdict line prints, and the job parks in `needs_review` even though the work already landed. Run a required second review pass synchronously, inline, before the finish protocol — call the reviewer and read its result in the same turn. If the work is too big for one run, do not queue more work; see the timeout rule below.
|
|
81
|
-
- **Never `git stash`, `git reset`, `git checkout -- <path>`, or `git clean` against working-tree state you did not create.**
|
|
72
|
+
- **You ARE the executor — never re-queue or self-schedule.** Do the acceptance criteria yourself. Why: `/develop` or any queue-authoring skill just writes a *new* PRD and returns — the run exits 0 having done nothing, with no commit and no verdict line (`needs_review` with `no_verdict_sentinel`). The same applies to calling `ScheduleWakeup`, or backgrounding a review agent (`/code-review`, `/security-review`) and ending your turn with something like "I'll wait for the review agents to complete": a headless run has no next turn, so nothing ever resumes it — no verdict line prints, and the job parks in `needs_review` even though the work already landed. Run a required second review pass synchronously, inline, before the finish protocol — call the reviewer and read its result in the same turn. If the work is too big for one run, do not queue more work; see the timeout rule below.
|
|
73
|
+
- **Never `git stash`, `git reset`, `git checkout -- <path>`, or `git clean` against working-tree state you did not create.** You are normally isolated in your own `git worktree` on branch `sm-job/<slug>`, and the scheduler salvages any uncommitted diff of yours on teardown — so you never need to touch shared state to protect your own work. Confirm isolation with `git rev-parse --git-common-dir` (a worktree's common-dir differs from its own `.git`) or by checking your cwd; `git diff`/`git status` are always safe. If you land in a SHARED tree with pre-existing dirty tracked files anyway, work around them — scope `git add`/commits to only the paths you touched — or end with `SCHEDULER_VERDICT: FAIL <reason>` (`SCHEDULER_VERDICT: BLOCKED_BY_FOREIGN_WIP` only when your gate failed on those files, as the finish protocol says); never discard, stash, or revert someone else's uncommitted changes to get a clean checkout. A shared tree may be feeding a running service that reads its config straight from the working tree, so reverting it is a production change, not a local inconvenience. The scheduler runs a shared-tree stash guard as a backstop (`checkSharedTreeGuard`/`evaluateSharedTreeGuard`), but that guard exists to catch a mistake, not to license one. Executors have stashed a sibling job's WIP and an operator's live config edit and never restored either.
|
|
82
74
|
- **`gh pr edit --body` can fail on repos with legacy GitHub Projects (classic) boards.** It queries the deprecated `repository.pullRequest.projectCards` field and errors with a `GraphQL: Projects (classic) is being deprecated` message even though the edit itself would otherwise succeed — a known `gh` CLI quirk, not a defect in your work. Prefer `gh api -X PATCH repos/<owner>/<repo>/pulls/<n> -f body="$(cat body.md)"` instead; it skips that field. If `gh pr edit` fails this way anyway retry immediately with the `gh api` form and note the fallback in your report.
|
|
83
75
|
- **Never `sleep N && <cmd>` to poll remote CI/job status.** The harness hard-blocks a `sleep` chained to another command. Use the tool's own blocking watcher under a hard cap instead: `timeout 600 gh run watch <run-id> --repo <owner>/<repo> --exit-status`. `gh pr checks` exits 8 while checks are pending and 1 on failure — that is not a defect in your work.
|
|
84
76
|
- **The verdict line is your authoritative "I passed" signal — emit it truthfully.** The scheduler's finish protocol ends by printing `SCHEDULER_VERDICT: PASS` once the AC gate is green and the commit has landed (or `SCHEDULER_VERDICT: FAIL <reason>` + `exit 1` otherwise). `PASS` plus a landed commit is authoritative: it overrides incidental transcript markers, so a deliberately reproduced red test or a grep result containing "Error" will not false-trip `needs_review`, as long as the run genuinely ends green and committed. An artifact-only PRD (`deliverable: artifact` + `artifactPaths`) commits nothing by design: a green gate with a clean tree is a `PASS`, never a `FAIL` for the missing commit. Exiting 0 with uncommitted changes, or with no verdict line at all, is the #1 cause of needless `needs_review`. Never print `PASS` when the gate is red — that turns a safety net into a silent-failure machine.
|
|
@@ -23,6 +23,15 @@ description: >-
|
|
|
23
23
|
|
|
24
24
|
Research and report in the first turn. Change no files until the human approves, then plan the work with `/develop`.
|
|
25
25
|
|
|
26
|
+
## What counts as a link
|
|
27
|
+
|
|
28
|
+
A doc reference in the map, an owner pointer or any doc is a link when it is one of:
|
|
29
|
+
- a markdown link [text](path);
|
|
30
|
+
- a backticked repo-root path to an existing `.md` file;
|
|
31
|
+
- an @path.md import.
|
|
32
|
+
|
|
33
|
+
All three count for reachability in Project Home's link map and in drift-check's orphans check. Prefer markdown links where humans read the doc rendered.
|
|
34
|
+
|
|
26
35
|
## References
|
|
27
36
|
|
|
28
37
|
Each is one level deep; none links another.
|
|
@@ -25,7 +25,7 @@ node <skill base dir>/scripts/drift-check.cjs --root <repo>
|
|
|
25
25
|
| `--map <path>` | The entry map. Default: the first file that holds the maintainer comment, searched in this order: the root CLAUDE.md, the root AGENTS.md, then the `.md` files those two import directly with at-sign imports (see below). |
|
|
26
26
|
| `--file <path>` | Check only this file. Repeat for each file. Default: every tracked `.md` file (all `.md` files outside `.git` and `node_modules` when the repo is not git). |
|
|
27
27
|
| `--exclude <prefix>` | Skip files whose repo-relative path starts with the prefix. Repeat as needed. |
|
|
28
|
-
| `--checks <list>` | Comma list from `links`, `paths`, `limits`, `contents`. Default:
|
|
28
|
+
| `--checks <list>` | Comma list from `links`, `paths`, `limits`, `contents`, `orphans`. Default: the first four. `orphans` is opt-in: it reports docs the root CLAUDE.md never reaches, by the [link convention](SKILL.md#what-counts-as-a-link) in SKILL.md. |
|
|
29
29
|
| `--strict-paths` | Report `unanchored-path` findings, and treat a link starting with `/` that matches no file as broken. Off by default. |
|
|
30
30
|
|
|
31
31
|
A flag that needs a value fails if the value is missing or starts with `--`.
|
|
@@ -52,6 +52,7 @@ One JSON object on stdout, with its keys in this order:
|
|
|
52
52
|
| `unanchored-path` | file, line, target, matches | Only with `--strict-paths`. The span does not resolve from the root or the doc, but tracked files match it as a path suffix or folder. The doc names the path without its full prefix. |
|
|
53
53
|
| `over-line-limit` | file, lines, expandedLines, limit | A CLAUDE.md, AGENTS.md or unscoped `.claude/rules` file has more than 200 lines, or the map has more than 70. `expandedLines` counts the file plus every `.md` it pulls in with an at-sign import (up to 4 hops, each file once); the limit applies to `expandedLines`. |
|
|
54
54
|
| `no-contents-list` | file, lines | A doc over 100 lines has no Contents heading and no list of anchor links near the top. |
|
|
55
|
+
| `orphan` | file | Only with `--checks orphans` (opt-in). No chain of references from the root CLAUDE.md reaches this checked doc, by SKILL.md's [link convention](SKILL.md#what-counts-as-a-link): markdown links and `<x.md>` autolinks, backticked `.md` paths (repo-root form first, then doc-relative) and at-sign imports, outside fences and HTML comments. All tracked docs carry reachability; `--exclude` and `--file` only limit what is reported. No root CLAUDE.md adds a note instead. Keep record collections out with `--exclude`. |
|
|
55
56
|
|
|
56
57
|
Links and code spans inside fenced code blocks and HTML comments are ignored.
|
|
57
58
|
|
|
@@ -65,7 +66,7 @@ Rules the script applies:
|
|
|
65
66
|
|
|
66
67
|
## Path conventions
|
|
67
68
|
|
|
68
|
-
A backticked path claims the file exists in this repo. The script checks every such span, so write paths that legitimately do not exist here in a form it skips:
|
|
69
|
+
A backticked path claims the file exists in this repo and, when it names a `.md` doc, counts as a link per SKILL.md. The script checks every such span, so write paths that legitimately do not exist here in a form it skips:
|
|
69
70
|
|
|
70
71
|
- A path in another repo: use a repo prefix and colon, such as Bilko:server/x.ts. The script skips it like a URL scheme. A ~/Projects/<repo>/ path also works, because a leading tilde is skipped.
|
|
71
72
|
- A retired or forbidden path named on purpose: write it in plain text, without backticks. Or end its line with the `<!-- drift-check-ignore -->` marker.
|
|
@@ -141,6 +142,7 @@ Template:
|
|
|
141
142
|
- Date: <YYYY-MM-DD>
|
|
142
143
|
- Mode: Full review | Drift check
|
|
143
144
|
- Scope: <folder, or the whole project>
|
|
145
|
+
- Session: <Epic id of the session that ran the review>
|
|
144
146
|
- Base commit: <full sha of HEAD when the review finished>
|
|
145
147
|
- Owner: <name or team that owns the map>
|
|
146
148
|
- Map: <path of the entry map>
|
|
@@ -171,6 +173,7 @@ Rules:
|
|
|
171
173
|
|
|
172
174
|
- Drift-check command holds the exact flags, so the next run repeats the same scope and exclusions.
|
|
173
175
|
- Base commit is a full sha. A short sha or a branch name drifts.
|
|
176
|
+
- Session lets Project Home link the record to its session and validation record.
|
|
174
177
|
- In a Drift check record, the Verdicts table lists only the files reviewed.
|
|
175
178
|
- Next review due is also due after a major model release.
|
|
176
179
|
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
* drift-check.cjs — dependency-free drift check for a repo's markdown network.
|
|
5
5
|
*
|
|
6
6
|
* node drift-check.cjs [--root <dir>] [--map <path>] [--file <path>]...
|
|
7
|
-
* [--exclude <prefix>]... [--checks links,paths,limits,contents] [--strict-paths]
|
|
7
|
+
* [--exclude <prefix>]... [--checks links,paths,limits,contents[,orphans]] [--strict-paths]
|
|
8
|
+
*
|
|
9
|
+
* `orphans` is opt-in (not in the default set): docs no chain of references from the root
|
|
10
|
+
* CLAUDE.md reaches, by the maintaining-md-network SKILL.md link convention.
|
|
8
11
|
*
|
|
9
12
|
* Prints one JSON object { root, map, notes, findings, counts, checkedFiles } to stdout.
|
|
10
13
|
* Exit 0 = no findings, 1 = findings, 2 = usage error / missing root.
|
|
@@ -14,7 +17,8 @@ const fs = require('fs');
|
|
|
14
17
|
const path = require('path');
|
|
15
18
|
const { spawnSync } = require('child_process');
|
|
16
19
|
|
|
17
|
-
const ALL_CHECKS = ['links', 'paths', 'limits', 'contents'];
|
|
20
|
+
const ALL_CHECKS = ['links', 'paths', 'limits', 'contents', 'orphans'];
|
|
21
|
+
const DEFAULT_CHECKS = ['links', 'paths', 'limits', 'contents'];
|
|
18
22
|
const LIMIT_ALWAYS_LOADED = 200;
|
|
19
23
|
const LIMIT_MAP = 70;
|
|
20
24
|
const CONTENTS_MIN_LINES = 100;
|
|
@@ -23,7 +27,7 @@ const CONTENTS_WINDOW = 60;
|
|
|
23
27
|
class UsageError extends Error {}
|
|
24
28
|
|
|
25
29
|
function parseArgs(argv) {
|
|
26
|
-
const opts = { root: null, map: null, files: [], excludes: [], checks:
|
|
30
|
+
const opts = { root: null, map: null, files: [], excludes: [], checks: DEFAULT_CHECKS.slice(), strictPaths: false };
|
|
27
31
|
const needValue = (i, flag) => {
|
|
28
32
|
if (i + 1 >= argv.length || argv[i + 1].startsWith('--')) {
|
|
29
33
|
throw new UsageError(`missing value for ${flag}`);
|
|
@@ -122,6 +126,8 @@ function parseDoc(text) {
|
|
|
122
126
|
const links = [];
|
|
123
127
|
const spans = [];
|
|
124
128
|
const importTokens = [];
|
|
129
|
+
const autolinks = [];
|
|
130
|
+
const refTokens = [];
|
|
125
131
|
const ignoredLines = new Set();
|
|
126
132
|
let fence = null;
|
|
127
133
|
let inComment = false;
|
|
@@ -161,16 +167,96 @@ function parseDoc(text) {
|
|
|
161
167
|
if (t.startsWith('<') && t.endsWith('>')) t = t.slice(1, -1);
|
|
162
168
|
links.push({ line: lineNo, target: t });
|
|
163
169
|
}
|
|
170
|
+
for (const am of noCode.replace(linkRe, ' ').matchAll(AUTOLINK_RE)) {
|
|
171
|
+
if (/\.md$/i.test(am[1].replace(/[?#].*$/, ''))) autolinks.push({ line: lineNo, target: am[1] });
|
|
172
|
+
}
|
|
173
|
+
for (const cm of line.matchAll(MULTI_CODE_RE)) {
|
|
174
|
+
const tok = pathToken(cm[2]);
|
|
175
|
+
if (tok !== null && !refTokens.includes(tok)) refTokens.push(tok);
|
|
176
|
+
}
|
|
164
177
|
const impRe = /(?:^|\s)@(\S+)/g;
|
|
165
178
|
while ((m = impRe.exec(noCode))) importTokens.push(m[1]);
|
|
166
179
|
const spanRe = /`([^`]+)`/g;
|
|
167
180
|
while ((m = spanRe.exec(line))) spans.push({ line: lineNo, span: m[1].trim() });
|
|
168
181
|
});
|
|
169
|
-
return { lines: rawLines, links, spans, importTokens, ignoredLines };
|
|
182
|
+
return { lines: rawLines, links, spans, importTokens, autolinks, refTokens, ignoredLines };
|
|
170
183
|
}
|
|
171
184
|
|
|
172
185
|
const MAX_IMPORT_HOPS = 4;
|
|
173
186
|
|
|
187
|
+
const AUTOLINK_RE = /<([^<>\s]{1,1024})>/g;
|
|
188
|
+
const MULTI_CODE_RE = /(`+)(.{0,1024}?)\1/g;
|
|
189
|
+
|
|
190
|
+
/** A backticked repo-path token (SKILL.md link convention), or null. */
|
|
191
|
+
function pathToken(raw) {
|
|
192
|
+
const t = raw.trim();
|
|
193
|
+
if (t === '' || !t.includes('/') || /\s/.test(t) || /^(?:[/~$<]|http)/i.test(t)) return null;
|
|
194
|
+
const bare = t.replace(/:\d+$/, '').replace(/#.*$/, '');
|
|
195
|
+
if (bare === '' || /[*{}<>:]/.test(bare)) return null;
|
|
196
|
+
if (!bare.endsWith('/') && !/\.[A-Za-z0-9]{1,8}$/.test(bare)) return null;
|
|
197
|
+
return bare;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** Repo-relative POSIX form: no `./` or trailing `/`; `.` is the root. */
|
|
201
|
+
const toRepoPath = (p) => path.posix.normalize(p).replace(/\/+$/, '') || '.';
|
|
202
|
+
const escapesRoot = (p) => p === '..' || p.startsWith('../') || p.startsWith('/');
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Docs a parsed doc references, by SKILL.md's link convention (the same rule as the
|
|
206
|
+
* app's src/main/lib/mdNetworkScan.cjs): markdown links and `<x.md>` autolinks resolved
|
|
207
|
+
* against the doc's folder; `@path.md` imports resolved against the doc's folder;
|
|
208
|
+
* backticked `.md` paths, repo-root form first, then doc-relative. Only targets that are
|
|
209
|
+
* docs (per `isDoc`) count.
|
|
210
|
+
*/
|
|
211
|
+
function docRefs(from, parsed, isDoc) {
|
|
212
|
+
const dir = path.posix.dirname(from);
|
|
213
|
+
const out = [];
|
|
214
|
+
const add = (to) => { if (to !== from && !out.includes(to)) out.push(to); };
|
|
215
|
+
for (const l of [...parsed.links, ...parsed.autolinks]) {
|
|
216
|
+
const written = l.target.trim();
|
|
217
|
+
if (written === '' || written[0] === '#' || written[0] === '/' || SCHEME_RE.test(written)) continue;
|
|
218
|
+
const target = written.replace(/[?#].*$/, '');
|
|
219
|
+
if (target === '') continue;
|
|
220
|
+
let decoded = target;
|
|
221
|
+
try { decoded = decodeURIComponent(target); } catch { /* a stray % is part of the name */ }
|
|
222
|
+
const to = toRepoPath(path.posix.join(dir, decoded));
|
|
223
|
+
if (!escapesRoot(to) && isDoc(to)) add(to);
|
|
224
|
+
}
|
|
225
|
+
for (let tok of parsed.importTokens) {
|
|
226
|
+
tok = tok.replace(/[),.;:!?'"\]]+$/, '');
|
|
227
|
+
if (!/\.md$/i.test(tok) || tok.startsWith('~') || tok.startsWith('/')) continue;
|
|
228
|
+
const to = toRepoPath(path.posix.join(dir, tok));
|
|
229
|
+
if (!escapesRoot(to) && isDoc(to)) add(to);
|
|
230
|
+
}
|
|
231
|
+
for (const tok of parsed.refTokens) {
|
|
232
|
+
if (!tok.endsWith('.md')) continue;
|
|
233
|
+
const forms = dir === '.' ? [toRepoPath(tok)] : [toRepoPath(tok), toRepoPath(path.posix.join(dir, tok))];
|
|
234
|
+
const to = forms.find((f) => !escapesRoot(f) && isDoc(f));
|
|
235
|
+
if (to !== undefined) add(to);
|
|
236
|
+
}
|
|
237
|
+
return out;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** Every doc reachable from the root CLAUDE.md over docRefs, BFS. */
|
|
241
|
+
function reachableDocs(root, allDocs) {
|
|
242
|
+
const docSet = new Set(allDocs);
|
|
243
|
+
docSet.add(ROOT_DOC);
|
|
244
|
+
const isDoc = (p) => docSet.has(p);
|
|
245
|
+
const seen = new Set([ROOT_DOC]);
|
|
246
|
+
const queue = [ROOT_DOC];
|
|
247
|
+
while (queue.length) {
|
|
248
|
+
const from = queue.shift();
|
|
249
|
+
let text;
|
|
250
|
+
try { text = fs.readFileSync(path.join(root, from), 'utf8'); } catch { continue; }
|
|
251
|
+
for (const to of docRefs(from, parseDoc(text), isDoc)) {
|
|
252
|
+
if (!seen.has(to)) { seen.add(to); queue.push(to); }
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return seen;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const ROOT_DOC = 'CLAUDE.md';
|
|
259
|
+
|
|
174
260
|
/** Claude Code `@path` imports of a doc: absolute .md paths inside root. */
|
|
175
261
|
function parseImports(text, fileAbs, root) {
|
|
176
262
|
const out = [];
|
|
@@ -229,7 +315,7 @@ function hasPathsFrontmatter(text) {
|
|
|
229
315
|
}
|
|
230
316
|
|
|
231
317
|
function runDriftCheck(options) {
|
|
232
|
-
const opts = Object.assign({ root: null, map: null, files: [], excludes: [], checks:
|
|
318
|
+
const opts = Object.assign({ root: null, map: null, files: [], excludes: [], checks: DEFAULT_CHECKS, strictPaths: false }, options);
|
|
233
319
|
const root = path.resolve(opts.root || process.cwd());
|
|
234
320
|
if (!fs.existsSync(root) || !fs.statSync(root).isDirectory()) {
|
|
235
321
|
throw new UsageError(`root is not a directory: ${root}`);
|
|
@@ -374,6 +460,15 @@ function runDriftCheck(options) {
|
|
|
374
460
|
}
|
|
375
461
|
}
|
|
376
462
|
|
|
463
|
+
if (checks.has('orphans')) {
|
|
464
|
+
if (!fs.existsSync(path.join(root, ROOT_DOC))) {
|
|
465
|
+
notes.push(`no root ${ROOT_DOC}; the orphans check was skipped`);
|
|
466
|
+
} else {
|
|
467
|
+
const reached = reachableDocs(root, listDocs(root).files);
|
|
468
|
+
for (const rel of docs) if (!reached.has(rel)) findings.push({ kind: 'orphan', file: rel });
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
377
472
|
findings.sort((x, y) => (x.file < y.file ? -1 : x.file > y.file ? 1 : (x.line || 0) - (y.line || 0)));
|
|
378
473
|
const counts = {};
|
|
379
474
|
for (const f of findings) counts[f.kind] = (counts[f.kind] || 0) + 1;
|
|
@@ -6,12 +6,9 @@ description: >-
|
|
|
6
6
|
Session Manager's cross-project conduit (the feedback_open_session MCP tool).
|
|
7
7
|
Use whenever work in one repo surfaces something that is genuinely another
|
|
8
8
|
repo's to fix — a bug in a sibling service, a broken contract between two
|
|
9
|
-
projects, a doc that lies about another project's behavior
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
here". NOT for work in the project you are already in — that is /develop.
|
|
13
|
-
Keywords: feedback, proposal, plan, cross-project, project to project, another repo, sibling
|
|
14
|
-
project, hand off, file against, route finding, x-folder.
|
|
9
|
+
projects, a doc that lies about another project's behavior — or when the user
|
|
10
|
+
asks to send, file or hand a finding to another project ("/send-feedback").
|
|
11
|
+
NOT for work in the project you are already in — that is /develop.
|
|
15
12
|
---
|
|
16
13
|
|
|
17
14
|
# send-feedback
|
|
@@ -19,16 +16,15 @@ description: >-
|
|
|
19
16
|
**Role:** the ONE channel for project-to-project communication. You are a
|
|
20
17
|
*courier*, never a fixer — you deliver a report into another project's inbox
|
|
21
18
|
and stop. You never edit the other project's files, never queue a PRD there,
|
|
22
|
-
and never wait for a reply.
|
|
19
|
+
and never wait for a reply. (Answering a project that asked YOU is a different
|
|
20
|
+
tool — see [Replying to a project that asked you](#replying-to-a-project-that-asked-you).)
|
|
23
21
|
|
|
24
22
|
## Why this exists
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
— narrowed to exactly one shape: **a proposal deposited in another project's
|
|
31
|
-
queue, which a human there must approve before anything runs.**
|
|
24
|
+
A PRD can only join an Epic a human already approved, so nothing in one project
|
|
25
|
+
can start work in another. This skill is the one way across that boundary:
|
|
26
|
+
**a proposal deposited in another project's queue, which a human there must
|
|
27
|
+
approve before anything runs.**
|
|
32
28
|
|
|
33
29
|
## The one hard rule
|
|
34
30
|
|
|
@@ -43,9 +39,8 @@ round-trip, not a wrong write.
|
|
|
43
39
|
| Another project on this machine | this skill |
|
|
44
40
|
| Nothing actionable | say so explicitly |
|
|
45
41
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
you delivered.
|
|
42
|
+
Routing a finding is the **default action, not a question**: a proposal starts
|
|
43
|
+
nothing until a human there approves it. Send it, then report what you delivered.
|
|
49
44
|
|
|
50
45
|
## Steps
|
|
51
46
|
|
|
@@ -174,8 +169,17 @@ starting in `<toCwd>` — not that it is done.
|
|
|
174
169
|
|
|
175
170
|
Do **not** say the other project has been notified-and-is-working-on-it, that
|
|
176
171
|
the bug is filed/fixed/assigned, or that you'll follow up when they respond.
|
|
177
|
-
|
|
178
|
-
|
|
172
|
+
|
|
173
|
+
**Whether an answer can come back** depends on the result `note`:
|
|
174
|
+
|
|
175
|
+
- If it says the receiving session **can answer into this session** (your
|
|
176
|
+
sending session was identified), say that any answer comes back **into this
|
|
177
|
+
session as its next prompt**, when the receiving project sends one. Do not
|
|
178
|
+
wait for it, poll for it or promise it: it may never come, and when it does it
|
|
179
|
+
is an agent's claim about its own project — verify it before acting on it.
|
|
180
|
+
- If it says **no reply path exists** (your session could not be identified,
|
|
181
|
+
e.g. you are a scheduled job), say so: if the user needs an answer, the next
|
|
182
|
+
step is a human conversation.
|
|
179
183
|
|
|
180
184
|
## What this skill never does
|
|
181
185
|
|
|
@@ -186,6 +190,45 @@ next step is a human conversation, and you should say so.
|
|
|
186
190
|
- Send to the project you're already in.
|
|
187
191
|
- Poll or wait for a response.
|
|
188
192
|
|
|
193
|
+
## Replying to a project that asked you
|
|
194
|
+
|
|
195
|
+
If THIS session was opened by another project's `feedback_open_session` (its
|
|
196
|
+
opening prompt says it came from another project and that the receiving session
|
|
197
|
+
can answer with `feedback_reply`), report back with `feedback_reply` — **never
|
|
198
|
+
with a new `feedback_open_session`**, which would open yet another proposed
|
|
199
|
+
session over there instead of answering the session that asked.
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
feedback_reply({
|
|
203
|
+
message: "<what was done or what blocks you — concrete paths, tool names, commits, version>",
|
|
204
|
+
outcome: "done" | "blocked" | "question",
|
|
205
|
+
referencePaths: ["/abs/path", ...], // optional
|
|
206
|
+
})
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
- **Call it from this Epic's own chat session**, once the work is **verified**.
|
|
210
|
+
For a `/develop` plan that means after the PLAN SETTLED digest shows it
|
|
211
|
+
VERIFIED — not when the PRDs are merely queued. Use `blocked` or `question`
|
|
212
|
+
when you cannot finish or need an answer from them.
|
|
213
|
+
- **The message is read by an agent that never saw your code.** Name the real
|
|
214
|
+
file paths, tool names, commit hashes and released version. Never a
|
|
215
|
+
placeholder ("see the fix", "<commit>", "TBD").
|
|
216
|
+
- **Only the asking session can receive it.** Identity comes from your chat
|
|
217
|
+
session, not from any argument; a session that was not opened by another
|
|
218
|
+
project, or a scheduled job (which has no chat session), is refused — a job
|
|
219
|
+
reports in its result instead. `toEpicId`, if passed, may only restate the
|
|
220
|
+
asking session.
|
|
221
|
+
- **At most 3 replies per thread.** Send one good `done`, not a running
|
|
222
|
+
commentary.
|
|
223
|
+
- **If the asking session is gone** (closed, completed, or its Claude session
|
|
224
|
+
changed), the reply falls back to a new `proposed` session in that project
|
|
225
|
+
that links the one that asked. The result's `delivery` tells you which
|
|
226
|
+
happened: `delivered` (into the asking session), `event-only` (recorded on the
|
|
227
|
+
asking session, which was not prompted) or `fallback`.
|
|
228
|
+
- The receiving agent is told the reply came from another project's agent and
|
|
229
|
+
must be verified before acting on. Report only the `delivery` you got — never
|
|
230
|
+
that the other project acted on your reply.
|
|
231
|
+
|
|
189
232
|
## If the tool isn't there
|
|
190
233
|
|
|
191
234
|
Two distinct failure modes — don't conflate them:
|
|
@@ -198,6 +241,7 @@ Two distinct failure modes — don't conflate them:
|
|
|
198
241
|
them in the meantime so it isn't lost.
|
|
199
242
|
- **`feedback_open_session` is absent from your tool list entirely** — the
|
|
200
243
|
`session-manager-scheduler` MCP server isn't registered for this project.
|
|
201
|
-
That's a misconfiguration, not an offline app.
|
|
202
|
-
|
|
203
|
-
|
|
244
|
+
That's a misconfiguration, not an offline app. Tell the human: the app
|
|
245
|
+
registers the server at user scope the first time it starts; if it is still
|
|
246
|
+
missing, delete `~/.claude/session-manager/.scheduler-mcp-seeded`, restart the
|
|
247
|
+
app, and open a new session. Never add an MCP entry yourself.
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* feedback_list_projects() -> GET /admin/feedback/targets
|
|
12
12
|
* feedback_open_session({ ... }) -> POST /admin/feedback/open-session
|
|
13
|
+
* feedback_reply({ message, outcome, ... }) -> POST /admin/feedback/reply
|
|
13
14
|
*
|
|
14
15
|
* project_home_write({ cwd?, html }) -> POST /admin/project-home/write
|
|
15
16
|
* project_demo_video_write({ cwd?, html? | htmlPath? }) -> POST /admin/project-home/demo-video/write
|
|
@@ -538,6 +539,23 @@ const TOOLS = [
|
|
|
538
539
|
required: ['toCwd', 'fromCwd', 'title', 'motivation', 'acceptanceCriteria', 'body'],
|
|
539
540
|
},
|
|
540
541
|
},
|
|
542
|
+
{
|
|
543
|
+
name: 'feedback_reply',
|
|
544
|
+
description: descriptionFor('feedback_reply'),
|
|
545
|
+
inputSchema: {
|
|
546
|
+
type: 'object',
|
|
547
|
+
properties: {
|
|
548
|
+
message: { type: 'string', description: 'The answer for the Epic that asked: what was done (with commit/version), what blocks it, or the question. Self-contained — the reader cannot see your project.' },
|
|
549
|
+
outcome: { type: 'string', enum: ['done', 'blocked', 'question'], description: "'done' only after the work is verified; 'blocked' or 'question' otherwise." },
|
|
550
|
+
referencePaths: {
|
|
551
|
+
type: 'array', items: { type: 'string' },
|
|
552
|
+
description: 'Optional absolute paths worth reading, appended as Reference lines',
|
|
553
|
+
},
|
|
554
|
+
toEpicId: { type: 'string', description: 'Optional: the asking Epic id. May only restate the thread\'s own target — any other id is refused.' },
|
|
555
|
+
},
|
|
556
|
+
required: ['message', 'outcome'],
|
|
557
|
+
},
|
|
558
|
+
},
|
|
541
559
|
{
|
|
542
560
|
name: 'project_home_write',
|
|
543
561
|
description: descriptionFor('project_home_write'),
|
|
@@ -636,13 +654,13 @@ const TOOLS = [
|
|
|
636
654
|
cwd: { type: 'string', description: "Optional: absolute path to the target project. Defaults to the calling session's own project root (SM_PROJECT_ROOT or process.cwd()) when omitted." },
|
|
637
655
|
videoId: { type: 'string', description: 'Stable id (kebab-case) of the video; writing the same id replaces that video.' },
|
|
638
656
|
title: { type: 'string', description: 'Human title shown in the video list.' },
|
|
639
|
-
kind: { type: 'string', description: 'What the video is
|
|
657
|
+
kind: { type: 'string', description: 'What the video is: exactly one of project-demo, blog-post, feature.' },
|
|
640
658
|
lengthS: { type: 'number', description: 'Length of the video in seconds.' },
|
|
641
659
|
html: { type: 'string', description: 'The complete self-contained HTML/JS video document (<= 2MB; no remote references or network-capable APIs).' },
|
|
642
660
|
htmlPath: { type: 'string', description: 'Absolute path to a local .html/.htm file holding the document (<= 2MB). Prefer this for base64 data URIs. Give exactly one of html / htmlPath.' },
|
|
643
|
-
meta: { type: 'object', description: '
|
|
661
|
+
meta: { type: 'object', description: 'Required by the save route, which rejects any other key. Keys: title, kind, target (optional), style, lengthS, character (null when there is no mascot), sources [{claim, source, ref}], report {lufs, truePeakDb, speechS, readingGrade, checks [{id, ok, detail}]}, macroVersion, seedVersion, model, effort.' },
|
|
644
662
|
},
|
|
645
|
-
required: ['videoId', 'title', 'kind', 'lengthS'],
|
|
663
|
+
required: ['videoId', 'title', 'kind', 'lengthS', 'meta'],
|
|
646
664
|
},
|
|
647
665
|
},
|
|
648
666
|
{
|
|
@@ -1029,9 +1047,9 @@ async function handleCallTool(request) {
|
|
|
1029
1047
|
let note = '';
|
|
1030
1048
|
if (result?.ok !== false) {
|
|
1031
1049
|
if (result?.status === 'auto-approved') {
|
|
1032
|
-
note = ' — the session was auto-approved and is starting in the receiving project
|
|
1050
|
+
note = ' — the session was auto-approved and is starting in the receiving project; the work is not done yet. The receiving session can answer into this Epic with feedback_reply.';
|
|
1033
1051
|
} else {
|
|
1034
|
-
note = ' — delivered as a PROPOSED session in the receiving project; it runs only if a human there presses Approve & start.
|
|
1052
|
+
note = ' — delivered as a PROPOSED session in the receiving project; it runs only if a human there presses Approve & start. The receiving session can answer into this Epic with feedback_reply.';
|
|
1035
1053
|
if (result?.autoStart && result.autoStart.granted === false && result.autoStart.reason) {
|
|
1036
1054
|
note += ` Auto-start was requested but not granted: ${result.autoStart.reason}`;
|
|
1037
1055
|
}
|
|
@@ -1039,6 +1057,48 @@ async function handleCallTool(request) {
|
|
|
1039
1057
|
}
|
|
1040
1058
|
return { content: [{ type: 'text', text: JSON.stringify(result) + note }] };
|
|
1041
1059
|
}
|
|
1060
|
+
if (name === 'feedback_reply') {
|
|
1061
|
+
// Only the Epic's own interactive session can reply: a scheduled job has
|
|
1062
|
+
// no chat identity, and its work is reported in its result instead.
|
|
1063
|
+
if (process.env.SM_SCHEDULER_JOB_SLUG) {
|
|
1064
|
+
return errorResult(
|
|
1065
|
+
`refused: feedback_reply was called from inside headless scheduled job '${process.env.SM_SCHEDULER_JOB_SLUG}'. `
|
|
1066
|
+
+ "A scheduled job never replies to another project. Report the outcome in your final result so the Epic's own session can reply with feedback_reply.",
|
|
1067
|
+
);
|
|
1068
|
+
}
|
|
1069
|
+
if (!args || typeof args.message !== 'string' || !args.message.trim()) {
|
|
1070
|
+
return errorResult('missing required argument: message');
|
|
1071
|
+
}
|
|
1072
|
+
if (typeof args.outcome !== 'string' || !args.outcome) {
|
|
1073
|
+
return errorResult('missing required argument: outcome');
|
|
1074
|
+
}
|
|
1075
|
+
const payload = { ...args };
|
|
1076
|
+
// Identity comes only from this process's env — never from the caller.
|
|
1077
|
+
delete payload.originClaudeSessionId;
|
|
1078
|
+
delete payload.originProjectRoot;
|
|
1079
|
+
if (process.env.SM_CHAT_SESSION_ID) {
|
|
1080
|
+
payload.originClaudeSessionId = process.env.SM_CHAT_SESSION_ID;
|
|
1081
|
+
}
|
|
1082
|
+
if (process.env.SM_PROJECT_ROOT) {
|
|
1083
|
+
payload.originProjectRoot = process.env.SM_PROJECT_ROOT;
|
|
1084
|
+
}
|
|
1085
|
+
payload.fromCwd = process.cwd();
|
|
1086
|
+
const result = await adminRequest('POST', '/admin/feedback/reply', payload);
|
|
1087
|
+
// Say only where the reply landed — never that the other project acted.
|
|
1088
|
+
let note = '';
|
|
1089
|
+
if (result?.ok !== false) {
|
|
1090
|
+
if (result?.delivery === 'delivered') {
|
|
1091
|
+
note = ' — delivered into the asking session; it has not acted on it yet.';
|
|
1092
|
+
} else if (result?.delivery === 'event-only') {
|
|
1093
|
+
note = " — delivered as an event only on the asking Epic; its session was not prompted"
|
|
1094
|
+
+ `${result.reason ? ` (${result.reason})` : ''}.`;
|
|
1095
|
+
} else if (result?.delivery === 'fallback') {
|
|
1096
|
+
note = ' — the asking Epic could not take it, so the reply fell back to a new proposed session in that project'
|
|
1097
|
+
+ `${result.fallbackEpicId ? ` (${result.fallbackEpicId})` : ''}; a human there must approve it.`;
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) + note }] };
|
|
1101
|
+
}
|
|
1042
1102
|
if (name === 'chat_send_prompt') {
|
|
1043
1103
|
const tabId = args && typeof args.tabId === 'string' ? args.tabId : null;
|
|
1044
1104
|
const prompt = args && typeof args.prompt === 'string' ? args.prompt : null;
|
package/src/main/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"gitSha": "
|
|
4
|
-
"gitShortSha": "
|
|
2
|
+
"version": "0.136.0",
|
|
3
|
+
"gitSha": "c88268236c0bb683ee824d70ed3b7e8f2290e32f",
|
|
4
|
+
"gitShortSha": "c8826823",
|
|
5
5
|
"gitBranch": "HEAD",
|
|
6
|
-
"builtAt": "2026-11-
|
|
6
|
+
"builtAt": "2026-11-16T19:09:58.278Z",
|
|
7
7
|
"dirty": false
|
|
8
8
|
}
|
package/src/main/chatRunner.cjs
CHANGED
|
@@ -50,6 +50,8 @@ const telemetryCounters = require('./lib/telemetry/telemetryCounters.cjs');
|
|
|
50
50
|
const { killTree, detachedSpawnOpts } = require('./lib/process/killTree.cjs');
|
|
51
51
|
const agentModelResolve = require('./lib/claude/agentModelResolve.cjs');
|
|
52
52
|
const { developLoopOffSettingsArgs } = require('./lib/epic/developLoopSpawn.cjs');
|
|
53
|
+
// Called through the module object (not destructured) so tests can inject a catalog.
|
|
54
|
+
const packSpawnArgs = require('./lib/packs/packSpawnArgs.cjs');
|
|
53
55
|
const { resolveEpicEffort, effortArgs } = require('./lib/claude/agentEffortResolve.cjs');
|
|
54
56
|
const { planEpicSpawn } = require('./lib/epic/epicSpawnPlan.cjs');
|
|
55
57
|
const epicWorktreeMint = require('./lib/epic/epicWorktreeMint.cjs');
|
|
@@ -643,11 +645,31 @@ function executeRun({ tabId, sessionId, prompt, cwd, resume, silent, onSilentRes
|
|
|
643
645
|
const effortFlags = isAgentCli ? [] : effortArgs(resolveEpicEffort({ cwd, claudeSessionId: sessionId }).effort);
|
|
644
646
|
|
|
645
647
|
// Develop-loop-off Epics launch with the dev plugin disabled for this session only.
|
|
648
|
+
// The Epic's selected context packs ride every turn: --plugin-dir per pack + their laws
|
|
649
|
+
// via --append-system-prompt (each turn is a fresh process, so every turn must carry them).
|
|
646
650
|
let loopOffArgs = [];
|
|
651
|
+
/** @type {string[]} */ let packPluginDirArgs = [];
|
|
652
|
+
let packLaws = '';
|
|
647
653
|
if (!isAgentCli) {
|
|
648
654
|
try {
|
|
649
|
-
|
|
650
|
-
|
|
655
|
+
const epic = agentModelResolve.findEpicByClaudeSessionId(cwd, sessionId);
|
|
656
|
+
loopOffArgs = developLoopOffSettingsArgs(epic);
|
|
657
|
+
const packArgs = packSpawnArgs.composePackSpawnArgs({ packIds: epic?.packs });
|
|
658
|
+
packPluginDirArgs = Array.isArray(packArgs.pluginDirArgs) ? packArgs.pluginDirArgs : [];
|
|
659
|
+
packLaws = typeof packArgs.laws === 'string' ? packArgs.laws : '';
|
|
660
|
+
} catch (e) {
|
|
661
|
+
// Lookup or compose failure: launch without packs (loop-off args kept if already resolved).
|
|
662
|
+
packPluginDirArgs = [];
|
|
663
|
+
packLaws = '';
|
|
664
|
+
try {
|
|
665
|
+
logs.writeLine({
|
|
666
|
+
scope: 'chatRunner',
|
|
667
|
+
level: 'warn',
|
|
668
|
+
message: `context packs skipped for this turn: ${/** @type {Error} */ (e)?.message || String(e)}`,
|
|
669
|
+
meta: { tabId, sessionId },
|
|
670
|
+
});
|
|
671
|
+
} catch { /* logging must never fail a turn */ }
|
|
672
|
+
}
|
|
651
673
|
}
|
|
652
674
|
|
|
653
675
|
// Main is authoritative about --resume vs --session-id AND the spawn cwd, and it decides
|
|
@@ -702,6 +724,8 @@ function executeRun({ tabId, sessionId, prompt, cwd, resume, silent, onSilentRes
|
|
|
702
724
|
...effortFlags,
|
|
703
725
|
'--dangerously-skip-permissions',
|
|
704
726
|
...loopOffArgs,
|
|
727
|
+
...packPluginDirArgs,
|
|
728
|
+
...(packLaws ? ['--append-system-prompt', packLaws] : []),
|
|
705
729
|
'--output-format', 'stream-json',
|
|
706
730
|
'--verbose',
|
|
707
731
|
];
|
package/src/main/index.cjs
CHANGED
|
@@ -97,6 +97,9 @@ chatRunner.registerAdminRoute(adminHttp);
|
|
|
97
97
|
// several projects' operations roots open, so it performs the cross-folder
|
|
98
98
|
// write (lib/feedback-remote/crossProjectFeedback.cjs).
|
|
99
99
|
crossProjectFeedback.registerAdminRoute(adminHttp);
|
|
100
|
+
// Its return leg: the receiving session answers INTO the Epic that asked
|
|
101
|
+
// (lib/feedback-remote/crossProjectReply.cjs).
|
|
102
|
+
require('./lib/feedback-remote/crossProjectReply.cjs').registerAdminRoute(adminHttp);
|
|
100
103
|
require('./lib/feedback-remote/customerFeedbackAdminRoutes.cjs').registerAdminRoute(adminHttp);
|
|
101
104
|
const supervisor = require('./supervisor.cjs');
|
|
102
105
|
const watchers = require('./watchers.cjs');
|
|
@@ -1112,6 +1115,7 @@ registerDocEditHandlers();
|
|
|
1112
1115
|
webRemote.registerRemoteHandlers();
|
|
1113
1116
|
registerAgentsHandlers({ ipcMain, getWindow: () => mainWindow });
|
|
1114
1117
|
require('./lib/agent-cli/agentCliIpc.cjs').registerAgentCliHandlers({ ipcMain });
|
|
1118
|
+
require('./lib/packs/packsIpc.cjs').registerPacksHandlers({ ipcMain });
|
|
1115
1119
|
try {
|
|
1116
1120
|
registerUpdaterIpc({ ipcMain, getWindow: () => mainWindow, ptyManager });
|
|
1117
1121
|
} catch (e) {
|