opentasks 0.0.8 → 0.1.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/dist/cli.js +0 -0
- package/dist/graph/query.js +3 -3
- package/dist/graph/query.js.map +1 -1
- package/dist/providers/map-connector.d.ts +4 -0
- package/dist/providers/map-connector.d.ts.map +1 -1
- package/dist/providers/map-connector.js +48 -0
- package/dist/providers/map-connector.js.map +1 -1
- package/dist/storage/interface.d.ts +6 -0
- package/dist/storage/interface.d.ts.map +1 -1
- package/dist/storage/interface.js.map +1 -1
- package/dist/storage/sqlite.d.ts +1 -0
- package/dist/storage/sqlite.d.ts.map +1 -1
- package/dist/storage/sqlite.js +11 -0
- package/dist/storage/sqlite.js.map +1 -1
- package/package.json +2 -2
- package/dist/daemon/entire-linker.d.ts +0 -71
- package/dist/daemon/entire-linker.d.ts.map +0 -1
- package/dist/daemon/entire-linker.js +0 -466
- package/dist/daemon/entire-linker.js.map +0 -1
- package/dist/daemon/entire-watcher.d.ts +0 -66
- package/dist/daemon/entire-watcher.d.ts.map +0 -1
- package/dist/daemon/entire-watcher.js +0 -258
- package/dist/daemon/entire-watcher.js.map +0 -1
- package/dist/providers/entire.d.ts +0 -68
- package/dist/providers/entire.d.ts.map +0 -1
- package/dist/providers/entire.js +0 -461
- package/dist/providers/entire.js.map +0 -1
- package/dist/tracking/claude-task-reconstructor.d.ts +0 -41
- package/dist/tracking/claude-task-reconstructor.d.ts.map +0 -1
- package/dist/tracking/claude-task-reconstructor.js +0 -91
- package/dist/tracking/claude-task-reconstructor.js.map +0 -1
- package/dist/tracking/plan-mode-tracker.d.ts +0 -20
- package/dist/tracking/plan-mode-tracker.d.ts.map +0 -1
- package/dist/tracking/plan-mode-tracker.js +0 -35
- package/dist/tracking/plan-mode-tracker.js.map +0 -1
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Entire Session Watcher
|
|
3
|
-
*
|
|
4
|
-
* Watches .git/sessionlog-sessions/ for session state changes and emits
|
|
5
|
-
* structured events. Used by the auto-linker to correlate sessions
|
|
6
|
-
* with OpenTasks tasks.
|
|
7
|
-
*/
|
|
8
|
-
import * as path from 'node:path';
|
|
9
|
-
import * as fs from 'node:fs';
|
|
10
|
-
import chokidar from 'chokidar';
|
|
11
|
-
// ============================================================================
|
|
12
|
-
// Git Directory Resolution
|
|
13
|
-
// ============================================================================
|
|
14
|
-
/**
|
|
15
|
-
* Resolve the git directory from a location path.
|
|
16
|
-
* Handles worktrees by checking for .git file that references the real git dir.
|
|
17
|
-
*/
|
|
18
|
-
function resolveGitDir(locationPath) {
|
|
19
|
-
// Walk up from the opentasks location to find .git
|
|
20
|
-
let dir = path.dirname(locationPath); // Go from .opentasks/ to project root
|
|
21
|
-
const root = path.parse(dir).root;
|
|
22
|
-
while (dir !== root) {
|
|
23
|
-
const gitPath = path.join(dir, '.git');
|
|
24
|
-
try {
|
|
25
|
-
const stat = fs.statSync(gitPath);
|
|
26
|
-
if (stat.isDirectory()) {
|
|
27
|
-
return gitPath;
|
|
28
|
-
}
|
|
29
|
-
// Worktree: .git is a file containing "gitdir: <path>"
|
|
30
|
-
if (stat.isFile()) {
|
|
31
|
-
const content = fs.readFileSync(gitPath, 'utf-8').trim();
|
|
32
|
-
const match = content.match(/^gitdir:\s*(.+)$/);
|
|
33
|
-
if (match) {
|
|
34
|
-
const resolved = path.resolve(dir, match[1]);
|
|
35
|
-
return resolved;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
catch {
|
|
40
|
-
// .git doesn't exist at this level, keep looking
|
|
41
|
-
}
|
|
42
|
-
dir = path.dirname(dir);
|
|
43
|
-
}
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
// ============================================================================
|
|
47
|
-
// Session File Parsing
|
|
48
|
-
// ============================================================================
|
|
49
|
-
/**
|
|
50
|
-
* Parse a session state file
|
|
51
|
-
*/
|
|
52
|
-
function parseSessionFile(filePath) {
|
|
53
|
-
try {
|
|
54
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
55
|
-
const data = JSON.parse(content);
|
|
56
|
-
const id = path.basename(filePath, '.json');
|
|
57
|
-
return {
|
|
58
|
-
id,
|
|
59
|
-
agent: String(data.agent ?? data.agentType ?? 'unknown'),
|
|
60
|
-
phase: normalizePhase(String(data.phase ?? data.state ?? 'ACTIVE')),
|
|
61
|
-
baseCommit: data.baseCommit,
|
|
62
|
-
branch: data.branch,
|
|
63
|
-
startedAt: data.startedAt,
|
|
64
|
-
endedAt: data.endedAt,
|
|
65
|
-
checkpoints: Array.isArray(data.checkpoints) ? data.checkpoints.map(String) : [],
|
|
66
|
-
lastPromptAt: data.lastPromptAt,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
catch {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function normalizePhase(phase) {
|
|
74
|
-
const upper = phase.toUpperCase();
|
|
75
|
-
if (upper === 'ACTIVE' || upper === 'IDLE' || upper === 'ENDED') {
|
|
76
|
-
return upper;
|
|
77
|
-
}
|
|
78
|
-
return 'ACTIVE';
|
|
79
|
-
}
|
|
80
|
-
// ============================================================================
|
|
81
|
-
// Implementation
|
|
82
|
-
// ============================================================================
|
|
83
|
-
/**
|
|
84
|
-
* Create an Entire session watcher
|
|
85
|
-
*/
|
|
86
|
-
export function createEntireWatcher(config) {
|
|
87
|
-
const { locationPath, debounceMs = 200, usePolling = false } = config;
|
|
88
|
-
// Resolve git dir
|
|
89
|
-
const gitDir = config.gitDir ?? resolveGitDir(locationPath);
|
|
90
|
-
const sessionsDir = gitDir ? path.join(gitDir, 'sessionlog-sessions') : '';
|
|
91
|
-
let watcher = null;
|
|
92
|
-
let watching = false;
|
|
93
|
-
const handlers = [];
|
|
94
|
-
// Cache of known session states for diff detection
|
|
95
|
-
const sessionCache = new Map();
|
|
96
|
-
// Debounce map
|
|
97
|
-
const pendingChanges = new Map();
|
|
98
|
-
function emitEvent(event) {
|
|
99
|
-
for (const handler of handlers) {
|
|
100
|
-
try {
|
|
101
|
-
handler(event);
|
|
102
|
-
}
|
|
103
|
-
catch {
|
|
104
|
-
// Ignore handler errors
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
function determineEventType(previous, current) {
|
|
109
|
-
const timestamp = new Date().toISOString();
|
|
110
|
-
if (!previous) {
|
|
111
|
-
// New session
|
|
112
|
-
return {
|
|
113
|
-
type: current.phase === 'ENDED' ? 'ended' : 'started',
|
|
114
|
-
sessionId: current.id,
|
|
115
|
-
session: current,
|
|
116
|
-
timestamp,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
// Phase change to ENDED
|
|
120
|
-
if (previous.phase !== 'ENDED' && current.phase === 'ENDED') {
|
|
121
|
-
return {
|
|
122
|
-
type: 'ended',
|
|
123
|
-
sessionId: current.id,
|
|
124
|
-
session: current,
|
|
125
|
-
previousPhase: previous.phase,
|
|
126
|
-
timestamp,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
// New checkpoints
|
|
130
|
-
if (current.checkpoints.length > previous.checkpoints.length) {
|
|
131
|
-
const newCheckpointId = current.checkpoints[current.checkpoints.length - 1];
|
|
132
|
-
return {
|
|
133
|
-
type: 'checkpoint',
|
|
134
|
-
sessionId: current.id,
|
|
135
|
-
session: current,
|
|
136
|
-
checkpointId: newCheckpointId,
|
|
137
|
-
previousPhase: previous.phase,
|
|
138
|
-
timestamp,
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
// Phase change (ACTIVE → IDLE, etc.)
|
|
142
|
-
if (previous.phase !== current.phase) {
|
|
143
|
-
return {
|
|
144
|
-
type: 'updated',
|
|
145
|
-
sessionId: current.id,
|
|
146
|
-
session: current,
|
|
147
|
-
previousPhase: previous.phase,
|
|
148
|
-
timestamp,
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
// No meaningful change
|
|
152
|
-
return null;
|
|
153
|
-
}
|
|
154
|
-
function handleFileChange(filePath) {
|
|
155
|
-
if (!filePath.endsWith('.json'))
|
|
156
|
-
return;
|
|
157
|
-
// Cancel existing debounce
|
|
158
|
-
const existing = pendingChanges.get(filePath);
|
|
159
|
-
if (existing)
|
|
160
|
-
clearTimeout(existing);
|
|
161
|
-
pendingChanges.set(filePath, setTimeout(() => {
|
|
162
|
-
pendingChanges.delete(filePath);
|
|
163
|
-
const current = parseSessionFile(filePath);
|
|
164
|
-
if (!current)
|
|
165
|
-
return;
|
|
166
|
-
const previous = sessionCache.get(current.id);
|
|
167
|
-
const event = determineEventType(previous, current);
|
|
168
|
-
// Update cache
|
|
169
|
-
sessionCache.set(current.id, current);
|
|
170
|
-
if (event) {
|
|
171
|
-
emitEvent(event);
|
|
172
|
-
}
|
|
173
|
-
}, debounceMs));
|
|
174
|
-
}
|
|
175
|
-
function handleFileDelete(filePath) {
|
|
176
|
-
if (!filePath.endsWith('.json'))
|
|
177
|
-
return;
|
|
178
|
-
const sessionId = path.basename(filePath, '.json');
|
|
179
|
-
const previous = sessionCache.get(sessionId);
|
|
180
|
-
if (previous) {
|
|
181
|
-
sessionCache.delete(sessionId);
|
|
182
|
-
emitEvent({
|
|
183
|
-
type: 'deleted',
|
|
184
|
-
sessionId,
|
|
185
|
-
session: previous,
|
|
186
|
-
timestamp: new Date().toISOString(),
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
get isWatching() {
|
|
192
|
-
return watching;
|
|
193
|
-
},
|
|
194
|
-
get sessionsDir() {
|
|
195
|
-
return sessionsDir;
|
|
196
|
-
},
|
|
197
|
-
async start() {
|
|
198
|
-
if (watching || !sessionsDir)
|
|
199
|
-
return;
|
|
200
|
-
// Process existing session files on startup
|
|
201
|
-
try {
|
|
202
|
-
if (fs.existsSync(sessionsDir)) {
|
|
203
|
-
const files = fs.readdirSync(sessionsDir).filter((f) => f.endsWith('.json'));
|
|
204
|
-
for (const file of files) {
|
|
205
|
-
const filePath = path.join(sessionsDir, file);
|
|
206
|
-
const session = parseSessionFile(filePath);
|
|
207
|
-
if (session) {
|
|
208
|
-
sessionCache.set(session.id, session);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
catch {
|
|
214
|
-
// Ignore errors reading existing files
|
|
215
|
-
}
|
|
216
|
-
return new Promise((resolve) => {
|
|
217
|
-
watcher = chokidar.watch(path.join(sessionsDir, '*.json'), {
|
|
218
|
-
ignoreInitial: true,
|
|
219
|
-
persistent: true,
|
|
220
|
-
ignorePermissionErrors: true,
|
|
221
|
-
usePolling,
|
|
222
|
-
interval: usePolling ? 100 : undefined,
|
|
223
|
-
awaitWriteFinish: {
|
|
224
|
-
stabilityThreshold: usePolling ? 100 : 200,
|
|
225
|
-
pollInterval: 50,
|
|
226
|
-
},
|
|
227
|
-
});
|
|
228
|
-
watcher.on('add', handleFileChange);
|
|
229
|
-
watcher.on('change', handleFileChange);
|
|
230
|
-
watcher.on('unlink', handleFileDelete);
|
|
231
|
-
watcher.on('ready', () => {
|
|
232
|
-
watching = true;
|
|
233
|
-
resolve();
|
|
234
|
-
});
|
|
235
|
-
watcher.on('error', () => {
|
|
236
|
-
// Log but don't crash — directory may not exist yet
|
|
237
|
-
resolve();
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
},
|
|
241
|
-
async stop() {
|
|
242
|
-
// Clear pending changes
|
|
243
|
-
for (const timeout of pendingChanges.values()) {
|
|
244
|
-
clearTimeout(timeout);
|
|
245
|
-
}
|
|
246
|
-
pendingChanges.clear();
|
|
247
|
-
if (watcher) {
|
|
248
|
-
await watcher.close();
|
|
249
|
-
watcher = null;
|
|
250
|
-
}
|
|
251
|
-
watching = false;
|
|
252
|
-
},
|
|
253
|
-
onSessionEvent(handler) {
|
|
254
|
-
handlers.push(handler);
|
|
255
|
-
},
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
//# sourceMappingURL=ent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AAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;wBAC1C,YAAY,EAAE,EAAE;qBACjB;iBACF,CAAC,CAAC;gBAEH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;gBACpC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;gBACvC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;gBAEvC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;oBACvB,QAAQ,GAAG,IAAI,CAAC;oBAChB,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC,CAAC;gBAEH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;oBACvB,oDAAoD;oBACpD,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,IAAI;YACR,wBAAwB;YACxB,KAAK,MAAM,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC9C,YAAY,CAAC,OAAO,CAAC,CAAC;YACxB,CAAC;YACD,cAAc,CAAC,KAAK,EAAE,CAAC;YAEvB,IAAI,OAAO,EAAE,CAAC;gBACZ,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;gBACtB,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC;YACD,QAAQ,GAAG,KAAK,CAAC;QACnB,CAAC;QAED,cAAc,CAAC,OAA4B;YACzC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Entire Provider
|
|
3
|
-
*
|
|
4
|
-
* Read-only provider that resolves entire:// URIs to Entire session
|
|
5
|
-
* and checkpoint data. Uses the sessionlog package for direct
|
|
6
|
-
* filesystem/git access — no external binary required.
|
|
7
|
-
*
|
|
8
|
-
* URI formats:
|
|
9
|
-
* entire://session/<session-id>
|
|
10
|
-
* entire://checkpoint/<checkpoint-id>
|
|
11
|
-
*/
|
|
12
|
-
import type { Provider } from './types.js';
|
|
13
|
-
export type { SessionlogSession as EntireSession, SessionlogCheckpoint as EntireCheckpoint, SessionlogTokenUsage as EntireTokenUsage, SessionlogSkillUsage as EntireSkillUsage, SessionlogStore as EntireStore, } from 'sessionlog';
|
|
14
|
-
import type { SessionlogSession, SessionlogCheckpoint, SessionlogStore } from 'sessionlog';
|
|
15
|
-
type EntireSession = SessionlogSession;
|
|
16
|
-
type EntireCheckpoint = SessionlogCheckpoint;
|
|
17
|
-
type EntireStore = SessionlogStore;
|
|
18
|
-
/**
|
|
19
|
-
* Configuration for Entire provider
|
|
20
|
-
*/
|
|
21
|
-
export interface EntireConfig {
|
|
22
|
-
/** Optional path to Entire CLI executable (e.g. 'entire' or '/usr/local/bin/entire').
|
|
23
|
-
* When set, the Go CLI is preferred if available, with fallback to the built-in TS store.
|
|
24
|
-
* When omitted, the built-in TS store is used directly. */
|
|
25
|
-
executable?: string;
|
|
26
|
-
/** Command timeout (ms) */
|
|
27
|
-
timeout?: number;
|
|
28
|
-
/** Working directory */
|
|
29
|
-
cwd?: string;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Create an Entire store that shells out to the Go CLI binary.
|
|
33
|
-
* Used when the user explicitly configures an executable path.
|
|
34
|
-
*/
|
|
35
|
-
export declare function createEntireExecStore(config: {
|
|
36
|
-
executable: string;
|
|
37
|
-
timeout?: number;
|
|
38
|
-
cwd?: string;
|
|
39
|
-
}): EntireStore;
|
|
40
|
-
/**
|
|
41
|
-
* Create an Entire store with optional CLI fallback.
|
|
42
|
-
*
|
|
43
|
-
* - If `config.executable` is set and the binary is found, uses the Go CLI.
|
|
44
|
-
* - Otherwise, uses the built-in TS store (sessionlog package).
|
|
45
|
-
*/
|
|
46
|
-
export declare function createEntireCliStoreAsync(config?: EntireConfig): Promise<EntireStore>;
|
|
47
|
-
/**
|
|
48
|
-
* Create an Entire store (sync — always uses built-in TS store).
|
|
49
|
-
* For the CLI-preferred path, use createEntireCliStoreAsync instead.
|
|
50
|
-
*/
|
|
51
|
-
export declare function createEntireCliStore(config?: EntireConfig): EntireStore;
|
|
52
|
-
/**
|
|
53
|
-
* Create an in-memory Entire store for testing
|
|
54
|
-
*/
|
|
55
|
-
export declare function createInMemoryEntireStore(): EntireStore & {
|
|
56
|
-
addSession(session: EntireSession): void;
|
|
57
|
-
addCheckpoint(checkpoint: EntireCheckpoint): void;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Create an Entire provider.
|
|
61
|
-
*
|
|
62
|
-
* When a pre-built store is provided, it is used directly.
|
|
63
|
-
* Otherwise, falls back to the sync native store (createEntireCliStore).
|
|
64
|
-
* For CLI-preferred creation, build the store via createEntireCliStoreAsync
|
|
65
|
-
* and pass it as the `store` parameter.
|
|
66
|
-
*/
|
|
67
|
-
export declare function createEntireProvider(config?: EntireConfig, store?: EntireStore): Provider;
|
|
68
|
-
//# sourceMappingURL=entire.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entire.d.ts","sourceRoot":"","sources":["../../src/providers/entire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,QAAQ,EAST,MAAM,YAAY,CAAC;AAKpB,YAAY,EACV,iBAAiB,IAAI,aAAa,EAClC,oBAAoB,IAAI,gBAAgB,EACxC,oBAAoB,IAAI,gBAAgB,EACxC,oBAAoB,IAAI,gBAAgB,EACxC,eAAe,IAAI,WAAW,GAC/B,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAI3F,KAAK,aAAa,GAAG,iBAAiB,CAAC;AACvC,KAAK,gBAAgB,GAAG,oBAAoB,CAAC;AAC7C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