throughline 0.10.1 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -1
- package/README.ja.md +9 -3
- package/README.md +9 -2
- package/docs/00_overview.md +1 -0
- package/docs/16_readonly_handoff_context_plan.md +2 -2
- package/docs/adr/0022-cursor-host-capture.md +39 -0
- package/package.json +9 -8
- package/src/auditor-context.mjs +3 -3
- package/src/cli/auditor-context.mjs +2 -1
- package/src/cli/doctor.mjs +7 -6
- package/src/cli/install.mjs +91 -0
- package/src/cli/install.test.mjs +57 -0
- package/src/cli/trim.mjs +3 -2
- package/src/codex-auto-refresh.mjs +3 -3
- package/src/codex-sidecar.mjs +2 -1
- package/src/completed-turn-receipts.mjs +5 -5
- package/src/hosts/claude.mjs +1 -0
- package/src/hosts/codex.mjs +1 -0
- package/src/hosts/cursor.mjs +128 -0
- package/src/hosts/cursor.test.mjs +104 -0
- package/src/hosts/grok.mjs +1 -0
- package/src/hosts/identity.mjs +20 -3
- package/src/hosts/identity.test.mjs +27 -4
- package/src/hosts/index.mjs +11 -2
- package/src/os/app-dirs.mjs +25 -0
- package/src/os/paths.mjs +4 -0
- package/src/runtime-error-store.mjs +6 -7
- package/src/session-start.mjs +24 -1
- package/src/transcript-reader-cursor.test.mjs +43 -0
- package/src/transcript-reader.mjs +14 -7
- package/src/trim-model.mjs +6 -5
package/src/trim-model.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { inspectCodexPlannedRollbackRestoreSafety } from './codex-rollout-memory.mjs';
|
|
2
|
+
import { CLAUDE_HOST, CODEX_HOST } from './hosts/identity.mjs';
|
|
2
3
|
import { buildHandoffRecord, N_RECENT_L2 } from './handoff-record.mjs';
|
|
3
4
|
import { sameProjectPath } from './project-path.mjs';
|
|
4
5
|
import { estimateTokens } from './token-estimator.mjs';
|
|
@@ -48,7 +49,7 @@ export function findLatestSessionIdForProject(db, projectPath) {
|
|
|
48
49
|
|
|
49
50
|
function resolveDefaultSessionId({ sessionId, host, codexThreadId, db, projectPath }) {
|
|
50
51
|
if (sessionId) return sessionId;
|
|
51
|
-
if (host ===
|
|
52
|
+
if (host === CODEX_HOST) {
|
|
52
53
|
return codexThreadId ? `codex:${codexThreadId}` : null;
|
|
53
54
|
}
|
|
54
55
|
return findLatestSessionIdForProject(db, projectPath);
|
|
@@ -79,7 +80,7 @@ function countDistinctCapturedTurns(db, sessionId) {
|
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
export function describeTrimHost(host) {
|
|
82
|
-
if (host ===
|
|
83
|
+
if (host === CLAUDE_HOST) {
|
|
83
84
|
return {
|
|
84
85
|
host,
|
|
85
86
|
automaticRollback: false,
|
|
@@ -94,7 +95,7 @@ export function describeTrimHost(host) {
|
|
|
94
95
|
};
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
if (host ===
|
|
98
|
+
if (host === CODEX_HOST) {
|
|
98
99
|
return {
|
|
99
100
|
host,
|
|
100
101
|
automaticRollback: true,
|
|
@@ -123,7 +124,7 @@ export function describeTrimHost(host) {
|
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
function buildSafeContinuation({ host, hostIdentity }) {
|
|
126
|
-
if (host !==
|
|
127
|
+
if (host !== CODEX_HOST) return null;
|
|
127
128
|
|
|
128
129
|
const threadId = hostIdentity?.codexThreadId ?? '<thread-id>';
|
|
129
130
|
const sessionId = threadId === '<thread-id>' ? 'codex:<thread-id>' : `codex:${threadId}`;
|
|
@@ -561,7 +562,7 @@ function buildPlanSession({ resolvedSessionId, session, trimSource, projectPath
|
|
|
561
562
|
}
|
|
562
563
|
|
|
563
564
|
function buildHostIdentity({ host, codexThreadId, codexThreadIdSource = null }) {
|
|
564
|
-
if (host !==
|
|
565
|
+
if (host !== CODEX_HOST) {
|
|
565
566
|
return {
|
|
566
567
|
host,
|
|
567
568
|
codexThreadId: null,
|