throughline 0.3.25 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/tl.md +6 -21
- package/CHANGELOG.md +88 -0
- package/README.ja.md +46 -58
- package/README.md +85 -81
- package/bin/throughline.mjs +9 -11
- package/docs/INHERITANCE_ON_CLEAR_ONLY.md +22 -0
- package/docs/PUBLIC_RELEASE_PLAN.md +4 -1
- package/docs/THROUGHLINE_CLEAR_AUTO_HANDOFF_PLAN.md +304 -0
- package/package.json +1 -1
- package/src/baton.mjs +17 -45
- package/src/baton.test.mjs +4 -41
- package/src/cli/install.mjs +2 -2
- package/src/cli/install.test.mjs +1 -3
- package/src/db-schema.test.mjs +2 -3
- package/src/db.mjs +14 -1
- package/src/hook-entrypoints.test.mjs +61 -18
- package/src/prompt-submit.mjs +24 -2
- package/src/prompt-submit.test.mjs +66 -0
- package/src/resume-context.mjs +31 -48
- package/src/resume-context.test.mjs +18 -13
- package/src/session-start.mjs +77 -21
- package/.claude/commands/tl-trim.md +0 -42
- package/src/cli/save-inflight.mjs +0 -81
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* throughline save-inflight — /tl 発動後、現行 Claude が中断地点の in-flight メモを
|
|
3
|
-
* stdin 経由で書き込む CLI。
|
|
4
|
-
*
|
|
5
|
-
* 使い方 (Claude Code の Bash ツールから):
|
|
6
|
-
* throughline save-inflight <<'EOF'
|
|
7
|
-
* **次の一手**: ...
|
|
8
|
-
* **現在の方針**: ...
|
|
9
|
-
* **未解決の疑問**: ...
|
|
10
|
-
* **進行中 TODO**: ...
|
|
11
|
-
* EOF
|
|
12
|
-
*
|
|
13
|
-
* 動作:
|
|
14
|
-
* 1. stdin を UTF-8 で全部読む
|
|
15
|
-
* 2. 空なら exit 1 (§0 フォールバック禁止 — サイレント成功しない)
|
|
16
|
-
* 3. cwd に対応する handoff_batons 行の memo_text を UPDATE
|
|
17
|
-
* 4. バトン未登録なら updated=false で警告して exit 1
|
|
18
|
-
*
|
|
19
|
-
* 呼び出し元: [.claude/commands/tl.md] が Claude に実行させる
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import { getDb } from '../db.mjs';
|
|
23
|
-
import { updateBatonMemo } from '../baton.mjs';
|
|
24
|
-
import { readFileSync, appendFileSync, mkdirSync } from 'node:fs';
|
|
25
|
-
import { join, dirname } from 'node:path';
|
|
26
|
-
import { homedir } from 'node:os';
|
|
27
|
-
|
|
28
|
-
function logInflight(entry) {
|
|
29
|
-
const path = join(homedir(), '.throughline', 'logs', 'inflight-memo.log');
|
|
30
|
-
try {
|
|
31
|
-
mkdirSync(dirname(path), { recursive: true });
|
|
32
|
-
appendFileSync(path, JSON.stringify(entry) + '\n', 'utf8');
|
|
33
|
-
} catch (err) {
|
|
34
|
-
const msg = err instanceof Error ? err.message : 'unknown';
|
|
35
|
-
process.stderr.write(`[save-inflight:log] ${msg}\n`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export async function run() {
|
|
40
|
-
let memoText;
|
|
41
|
-
try {
|
|
42
|
-
memoText = readFileSync(0, 'utf8').trim();
|
|
43
|
-
} catch (err) {
|
|
44
|
-
const msg = err instanceof Error ? err.message : 'unknown';
|
|
45
|
-
process.stderr.write(`[save-inflight] failed to read stdin: ${msg}\n`);
|
|
46
|
-
process.exit(1);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (!memoText) {
|
|
51
|
-
process.stderr.write(
|
|
52
|
-
'[save-inflight] stdin was empty. Provide the in-flight memo via stdin (here-doc or pipe).\n',
|
|
53
|
-
);
|
|
54
|
-
process.exit(1);
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const projectPath = process.cwd();
|
|
59
|
-
const db = getDb();
|
|
60
|
-
const { updated } = updateBatonMemo(db, { projectPath, memoText });
|
|
61
|
-
|
|
62
|
-
logInflight({
|
|
63
|
-
ts: new Date().toISOString(),
|
|
64
|
-
project_path: projectPath,
|
|
65
|
-
memo_length: memoText.length,
|
|
66
|
-
baton_updated: updated,
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
if (!updated) {
|
|
70
|
-
process.stderr.write(
|
|
71
|
-
`[save-inflight] no baton found for ${projectPath}. ` +
|
|
72
|
-
`Run /tl first so the baton exists, then save-inflight can attach the memo.\n`,
|
|
73
|
-
);
|
|
74
|
-
process.exit(1);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
process.stdout.write(
|
|
79
|
-
`[throughline] in-flight memo saved (${memoText.length} chars) for next session\n`,
|
|
80
|
-
);
|
|
81
|
-
}
|