claude-code-session-manager 0.135.1 → 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-BBY7E1ag.js → AgentLibrary-BFztz90B.js} +1 -1
- package/dist/assets/{AppSettings-vMiIi0xn.js → AppSettings-6_dqi9Ti.js} +1 -1
- package/dist/assets/{Button-C0Z090Ui.js → Button-5wbUTtD5.js} +1 -1
- package/dist/assets/{DocumentEditorPane-Ds10W8SZ.js → DocumentEditorPane-CRgJFjka.js} +1 -1
- package/dist/assets/{Extensions-CjPiz2I5.js → Extensions-ZXSJbnK7.js} +2 -2
- package/dist/assets/{History-Bm3KXXs1.js → History-CmSTZeiu.js} +1 -1
- package/dist/assets/{Library-D-khizDg.js → Library-DcTnW9kq.js} +1 -1
- package/dist/assets/{ListDetail-CJYpp8fW.js → ListDetail-BGsdNFiK.js} +1 -1
- package/dist/assets/{Panel-BHFGylfy.js → Panel-BR2PeMf6.js} +1 -1
- package/dist/assets/{ProjectClaudeConfig-DIzNAala.js → ProjectClaudeConfig-DJYcUU1G.js} +1 -1
- package/dist/assets/{ProvenanceBadge-CYryeTYF.js → ProvenanceBadge-B_TDAI3k.js} +1 -1
- package/dist/assets/{Scheduler-BS82wfRP.js → Scheduler-DqocyumD.js} +1 -1
- package/dist/assets/{Settings-DWPHJ94d.js → Settings-BzPe2TH6.js} +1 -1
- package/dist/assets/{SkillReferenceGraph-Cf2M7YNq.js → SkillReferenceGraph-DfdO0Q_N.js} +1 -1
- package/dist/assets/{Skills-DLq55Odf.js → Skills-CGPJxKhR.js} +1 -1
- package/dist/assets/{SourceChip-CHxAzRlD.js → SourceChip-CI8xpHRi.js} +1 -1
- package/dist/assets/{SystemPrompt-BYtKMAr3.js → SystemPrompt-BbzGIHoz.js} +1 -1
- package/dist/assets/{TiptapBody-O_Gfq0Ha.js → TiptapBody-CTmjUhAI.js} +1 -1
- package/dist/assets/{Toggle-BJOUI5NY.js → Toggle-CWx9Rq6E.js} +1 -1
- package/dist/assets/{ViewTabs-kkvNGu-S.js → ViewTabs-BnjD0Crp.js} +1 -1
- package/dist/assets/{VoiceButton-3i-6ju2L.js → VoiceButton-C-iQGCL1.js} +1 -1
- package/dist/assets/{historyTotals-CHrIptK1.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 +2 -0
- 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 +23 -0
- 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 +52 -3
- 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/agentModelResolve.cjs +23 -0
- package/src/main/lib/epic/epicMint.cjs +12 -6
- package/src/main/lib/epic/promptSessionsCreateEpic.cjs +8 -4
- 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 +11 -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 +5 -3
- package/dist/assets/index-D9qgN9_V.js +0 -3116
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "apple-swift-core",
|
|
3
|
+
"label": "Apple · Swift core",
|
|
4
|
+
"description": "Modern Swift 6 and SwiftUI rules for iOS apps: strict concurrency, @Observable state, NavigationStack, async/await, SwiftData, previews, accessibility and String Catalogs, plus skills for state, navigation and concurrency."
|
|
5
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "session-manager-dev",
|
|
3
3
|
"description": "The default end-to-end development skillset for the Claude Code Session Manager: decompose work into scheduler PRDs and track them to a validated finish (/develop), publish releases to npm (/builder), hand a finding to another project on this machine (/send-feedback), and review or drift-check a project's CLAUDE.md/markdown network (/maintaining-md-network). Together with the session-manager scheduler these form a develop → queue → validate → release loop.",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Bilko Bibitkov",
|
|
7
7
|
"email": "BilkoBibitkov2000@gmail.com",
|
|
@@ -62,6 +62,29 @@ Run in this order:
|
|
|
62
62
|
- ..."
|
|
63
63
|
```
|
|
64
64
|
4. `git tag v<version>`
|
|
65
|
+
|
|
66
|
+
**CI-publish path.** If `grep -q 'npm-publish:' .github/workflows/release.yml` succeeds, CI
|
|
67
|
+
publishes on the tag push (npm Trusted Publishing, OIDC). Skip the local worktree build and
|
|
68
|
+
`npm publish` (steps 5-7 and 9) and run instead:
|
|
69
|
+
|
|
70
|
+
- `git push origin main` and `git push origin v<version>`.
|
|
71
|
+
- Wait on the release run with a bounded blocking watcher (never an open-ended poll):
|
|
72
|
+
```
|
|
73
|
+
timeout 1200 gh run watch "$(gh run list --workflow release.yml --branch v<version> --limit 1 --json databaseId --jq '.[0].databaseId')" --exit-status
|
|
74
|
+
```
|
|
75
|
+
- Verify the registry: re-read the cache-busted packument
|
|
76
|
+
`curl -s "https://registry.npmjs.org/<packageName>?t=$(date +%s)"` until `dist-tags.latest`
|
|
77
|
+
is `<version>` — at most 20 tries, 30 s apart (`sleep 30` between tries). Then do steps 10
|
|
78
|
+
(tarball 200) and 11 (installer assets) as written.
|
|
79
|
+
|
|
80
|
+
If the `npm-publish` job fails, or the version never appears within the 20 tries: report the
|
|
81
|
+
failing job log (`gh run view <run-id> --log-failed`), then fall back to the local worktree
|
|
82
|
+
publish below (steps 5-7, 9, 10) **exactly once** — the tag is already pushed, so skip step 8.
|
|
83
|
+
An E409 "staged" from that fallback still means a human approves it on npmjs.com; report that.
|
|
84
|
+
|
|
85
|
+
**Local worktree path (fallback).** Projects whose `release.yml` has no `npm-publish` job (or
|
|
86
|
+
have no `release.yml`) always use steps 5-11:
|
|
87
|
+
|
|
65
88
|
5. `mkdir -p "$HOME/.cache/sm-publish" && git worktree add "$HOME/.cache/sm-publish/v<version>" v<version>`
|
|
66
89
|
— never under `/tmp` or `os.tmpdir()`: some test suites (this repo's included) treat those
|
|
67
90
|
paths as fixtures and fail there.
|
|
@@ -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;
|
|
@@ -16,7 +16,8 @@ description: >-
|
|
|
16
16
|
**Role:** the ONE channel for project-to-project communication. You are a
|
|
17
17
|
*courier*, never a fixer — you deliver a report into another project's inbox
|
|
18
18
|
and stop. You never edit the other project's files, never queue a PRD there,
|
|
19
|
-
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).)
|
|
20
21
|
|
|
21
22
|
## Why this exists
|
|
22
23
|
|
|
@@ -168,8 +169,17 @@ starting in `<toCwd>` — not that it is done.
|
|
|
168
169
|
|
|
169
170
|
Do **not** say the other project has been notified-and-is-working-on-it, that
|
|
170
171
|
the bug is filed/fixed/assigned, or that you'll follow up when they respond.
|
|
171
|
-
|
|
172
|
-
|
|
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.
|
|
173
183
|
|
|
174
184
|
## What this skill never does
|
|
175
185
|
|
|
@@ -180,6 +190,45 @@ next step is a human conversation, and you should say so.
|
|
|
180
190
|
- Send to the project you're already in.
|
|
181
191
|
- Poll or wait for a response.
|
|
182
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
|
+
|
|
183
232
|
## If the tool isn't there
|
|
184
233
|
|
|
185
234
|
Two distinct failure modes — don't conflate them:
|
|
@@ -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) {
|
package/src/main/ipcSchemas.cjs
CHANGED
|
@@ -247,6 +247,9 @@ const promptSessionsCreateEpic = z.object({
|
|
|
247
247
|
agentCli: z.enum(['claude', 'codex', 'gemini', 'antigravity', 'cursor', 'opencode']).optional(),
|
|
248
248
|
// Model passed to a non-Claude CLI; absent = that CLI's own default.
|
|
249
249
|
agentCliModel: z.string().min(1).max(128).optional(),
|
|
250
|
+
// Selected context pack ids (same bounds as PromptSessionSchema.packs); absent = none.
|
|
251
|
+
// ensureEpic dedupes them and drops them for a non-Claude agentCli.
|
|
252
|
+
packs: z.array(z.string().min(1).max(64)).max(16).optional(),
|
|
250
253
|
});
|
|
251
254
|
|
|
252
255
|
// Renderer entry point for the "Restore a session" picker: this project's CLI
|
|
@@ -932,6 +935,14 @@ const projectPagesMdNetwork = z.object({
|
|
|
932
935
|
docFolders: mdNetworkFolderList.optional(),
|
|
933
936
|
}).strict();
|
|
934
937
|
|
|
938
|
+
// project-pages:md-review — cwd plus optional Review MD network Epic ids whose
|
|
939
|
+
// reviews/validation/<id>/ folders to list. Ids are joined onto the fs, so the
|
|
940
|
+
// slug regex (same as lib/mdReviewRecord.cjs EPIC_ID_RE) is load-bearing.
|
|
941
|
+
const projectPagesMdReview = z.object({
|
|
942
|
+
cwd: z.string().min(1).max(4096),
|
|
943
|
+
epicIds: z.array(z.string().regex(/^[a-z0-9][a-z0-9-]{0,127}$/)).max(50).optional(),
|
|
944
|
+
}).strict();
|
|
945
|
+
|
|
935
946
|
// ──────────────────────────────────────────── Project Home admin route
|
|
936
947
|
// Real path validation is projectRootResolve.cjs + config.cjs's validatePath;
|
|
937
948
|
// html content limits live in projectHomeAdminRoutes.cjs's validateHomeHtml.
|
|
@@ -967,6 +978,7 @@ const projectVideoMeta = z.object({
|
|
|
967
978
|
id: entryId,
|
|
968
979
|
title: z.string().min(1).max(120),
|
|
969
980
|
kind: z.enum(['project-demo', 'blog-post', 'feature']),
|
|
981
|
+
target: z.string().max(300).optional(),
|
|
970
982
|
style: z.string().max(40),
|
|
971
983
|
lengthS: z.number().int().min(5).max(60),
|
|
972
984
|
createdAt: z.string().datetime(),
|
|
@@ -1567,6 +1579,7 @@ module.exports = {
|
|
|
1567
1579
|
projectBriefCwd,
|
|
1568
1580
|
projectPagesCwd,
|
|
1569
1581
|
projectPagesMdNetwork,
|
|
1582
|
+
projectPagesMdReview,
|
|
1570
1583
|
projectPagesRename,
|
|
1571
1584
|
projectPagesDelete,
|
|
1572
1585
|
projectHomeAdminWriteBody,
|
|
@@ -85,6 +85,28 @@ function findEpicByClaudeSessionId(cwd, claudeSessionId, deps = {}) {
|
|
|
85
85
|
return null;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Looks up an Epic (PromptSession) row by its own Epic id — the key of the
|
|
90
|
+
* active index, or a row whose `id` matches. Same reader as
|
|
91
|
+
* findEpicByClaudeSessionId. Returns the row or null; never throws.
|
|
92
|
+
*/
|
|
93
|
+
function findEpicById(cwd, epicId, deps = {}) {
|
|
94
|
+
if (!cwd || !epicId) return null;
|
|
95
|
+
try {
|
|
96
|
+
const load = deps.readActiveIndex || readActiveIndex;
|
|
97
|
+
const { sessions } = load(cwd);
|
|
98
|
+
if (!sessions || typeof sessions !== 'object') return null;
|
|
99
|
+
const direct = Object.prototype.hasOwnProperty.call(sessions, epicId) ? sessions[epicId] : null;
|
|
100
|
+
if (direct && typeof direct === 'object') return direct;
|
|
101
|
+
for (const session of Object.values(sessions)) {
|
|
102
|
+
if (session && session.id === epicId) return session;
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
} catch {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
88
110
|
function findAgentTypeByClaudeSessionId(cwd, claudeSessionId, deps = {}) {
|
|
89
111
|
return findEpicByClaudeSessionId(cwd, claudeSessionId, deps)?.agentType || null;
|
|
90
112
|
}
|
|
@@ -265,6 +287,7 @@ module.exports = {
|
|
|
265
287
|
resolveEpicModel,
|
|
266
288
|
findAgentTypeByClaudeSessionId,
|
|
267
289
|
findEpicByClaudeSessionId,
|
|
290
|
+
findEpicById,
|
|
268
291
|
epicOverrideValue,
|
|
269
292
|
readOverlayAwarePersonaModel,
|
|
270
293
|
readOverlayAwarePersona,
|