ctxpool 0.1.1 → 0.5.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/README.md +107 -99
- package/dist/cli.js +336 -183
- package/dist/cli.js.map +1 -1
- package/dist/clipboard.js +8 -10
- package/dist/clipboard.js.map +1 -1
- package/dist/format.d.ts +32 -0
- package/dist/format.js +110 -0
- package/dist/format.js.map +1 -0
- package/dist/handoff.d.ts +18 -13
- package/dist/handoff.js +495 -706
- package/dist/handoff.js.map +1 -1
- package/dist/mcp.js +99 -221
- package/dist/mcp.js.map +1 -1
- package/dist/pack.d.ts +14 -0
- package/dist/pack.js +121 -0
- package/dist/pack.js.map +1 -0
- package/dist/paths.d.ts +15 -0
- package/dist/paths.js +35 -5
- package/dist/paths.js.map +1 -1
- package/dist/redact.d.ts +6 -0
- package/dist/redact.js +85 -0
- package/dist/redact.js.map +1 -0
- package/dist/repo.d.ts +6 -1
- package/dist/repo.js +109 -123
- package/dist/repo.js.map +1 -1
- package/dist/session.d.ts +45 -1
- package/dist/session.js +1307 -302
- package/dist/session.js.map +1 -1
- package/dist/store.d.ts +14 -6
- package/dist/store.js +90 -115
- package/dist/store.js.map +1 -1
- package/dist/text.d.ts +6 -0
- package/dist/text.js +25 -0
- package/dist/text.js.map +1 -0
- package/dist/types.d.ts +92 -7
- package/dist/ui.d.ts +10 -1
- package/dist/ui.js +355 -382
- package/dist/ui.js.map +1 -1
- package/dist/util.d.ts +10 -1
- package/dist/util.js +40 -10
- package/dist/util.js.map +1 -1
- package/dist/verify.d.ts +16 -0
- package/dist/verify.js +74 -0
- package/dist/verify.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -0
- package/dist-web/assets/Geist-Variable-B48wpBRb.woff2 +0 -0
- package/dist-web/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
- package/dist-web/assets/antigravity-Vc0oU6JN.svg +1 -0
- package/dist-web/assets/contextpool-mark-4vSRiUeZ.svg +1 -0
- package/dist-web/assets/index-BztZuBPJ.js +21 -0
- package/dist-web/assets/index-LvoT6mmM.css +2 -0
- package/dist-web/index.html +4 -3
- package/package.json +18 -17
- package/dist/logs.d.ts +0 -9
- package/dist/logs.js +0 -82
- package/dist/logs.js.map +0 -1
- package/dist-web/assets/contextpool-mark-Bu_00i5t.svg +0 -16
- package/dist-web/assets/index-BfHRocKl.js +0 -14
- package/dist-web/assets/index-l1QjYqDb.css +0 -2
package/dist/types.d.ts
CHANGED
|
@@ -28,13 +28,33 @@ export type FileChange = {
|
|
|
28
28
|
untracked: boolean;
|
|
29
29
|
diff?: string;
|
|
30
30
|
};
|
|
31
|
-
export type WorkPhase = "planning" | "implementation" | "debugging" | "verification" | "blocked" | "handoff";
|
|
31
|
+
export type WorkPhase = "planning" | "implementation" | "debugging" | "verification" | "review" | "blocked" | "handoff";
|
|
32
32
|
export type VerificationStatus = "passed" | "failed" | "unknown";
|
|
33
33
|
export type VerificationCommand = {
|
|
34
34
|
command: string;
|
|
35
35
|
status: VerificationStatus;
|
|
36
|
+
exitCode?: number;
|
|
36
37
|
evidence?: string;
|
|
37
38
|
};
|
|
39
|
+
export type PlanStatus = "pending" | "in_progress" | "completed";
|
|
40
|
+
export type PlanItem = {
|
|
41
|
+
text: string;
|
|
42
|
+
status: PlanStatus;
|
|
43
|
+
};
|
|
44
|
+
/** A shell command the agent ran, with its real exit status when the log records one. */
|
|
45
|
+
export type CommandRun = {
|
|
46
|
+
command: string;
|
|
47
|
+
status: VerificationStatus;
|
|
48
|
+
exitCode?: number;
|
|
49
|
+
/** First meaningful error line from a failed run. */
|
|
50
|
+
errorLine?: string;
|
|
51
|
+
/** Position in the session event stream, used to order runs against edits. */
|
|
52
|
+
seq: number;
|
|
53
|
+
};
|
|
54
|
+
export type FileEdit = {
|
|
55
|
+
path: string;
|
|
56
|
+
seq: number;
|
|
57
|
+
};
|
|
38
58
|
export type VerificationSummary = {
|
|
39
59
|
status: VerificationStatus;
|
|
40
60
|
commands: VerificationCommand[];
|
|
@@ -82,10 +102,11 @@ export type TeamSyncPolicy = {
|
|
|
82
102
|
export type EngineeringMemory = {
|
|
83
103
|
version: 1;
|
|
84
104
|
identity: StableIdentity;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
105
|
+
/** Present on packets captured before v0.2; no longer written. */
|
|
106
|
+
positioning?: {
|
|
107
|
+
category: string;
|
|
108
|
+
buyer: string;
|
|
109
|
+
moat: string;
|
|
89
110
|
};
|
|
90
111
|
intent: MemoryFact[];
|
|
91
112
|
decisions: MemoryFact[];
|
|
@@ -97,12 +118,12 @@ export type EngineeringMemory = {
|
|
|
97
118
|
teamSync: TeamSyncPolicy;
|
|
98
119
|
};
|
|
99
120
|
export type AgentSignal = {
|
|
100
|
-
source:
|
|
121
|
+
source: SourceAgent | "unknown";
|
|
101
122
|
path: string;
|
|
102
123
|
modifiedAt: string;
|
|
103
124
|
snippets: string[];
|
|
104
125
|
};
|
|
105
|
-
export type SourceAgent = "codex" | "claude";
|
|
126
|
+
export type SourceAgent = "codex" | "claude" | "gemini" | "antigravity";
|
|
106
127
|
export type TranscriptEntry = {
|
|
107
128
|
role: "user" | "assistant" | "tool" | "system";
|
|
108
129
|
text: string;
|
|
@@ -121,6 +142,15 @@ export type SourceSession = {
|
|
|
121
142
|
transcriptExcerpt: string;
|
|
122
143
|
threadName?: string;
|
|
123
144
|
supplementalPaths?: string[];
|
|
145
|
+
/** Latest structured plan the agent maintained (TodoWrite, update_plan, task tools). */
|
|
146
|
+
plan?: PlanItem[];
|
|
147
|
+
/** Latest plan the agent proposed in prose (ExitPlanMode, plan mode). */
|
|
148
|
+
planText?: string;
|
|
149
|
+
commands?: CommandRun[];
|
|
150
|
+
edits?: FileEdit[];
|
|
151
|
+
/** Summary the agent wrote when it compacted earlier context. */
|
|
152
|
+
compactSummary?: string;
|
|
153
|
+
links?: string[];
|
|
124
154
|
};
|
|
125
155
|
export type HandoffSections = {
|
|
126
156
|
goal: string;
|
|
@@ -155,6 +185,9 @@ export type HandoffContinuitySummary = {
|
|
|
155
185
|
commandsRun: string[];
|
|
156
186
|
errors: string[];
|
|
157
187
|
decisions: string[];
|
|
188
|
+
plan?: PlanItem[];
|
|
189
|
+
constraints?: string[];
|
|
190
|
+
title?: string;
|
|
158
191
|
sourceSession?: {
|
|
159
192
|
source: SourceAgent;
|
|
160
193
|
id: string;
|
|
@@ -183,6 +216,8 @@ export type HandoffPacket = {
|
|
|
183
216
|
engineeringMemory?: EngineeringMemory;
|
|
184
217
|
markdown: string;
|
|
185
218
|
markdownPath: string;
|
|
219
|
+
/** Estimated tokens in `markdown`. */
|
|
220
|
+
tokenEstimate?: number;
|
|
186
221
|
};
|
|
187
222
|
export type HandoffSummary = {
|
|
188
223
|
id: string;
|
|
@@ -197,6 +232,54 @@ export type HandoffSummary = {
|
|
|
197
232
|
filesTouched: string[];
|
|
198
233
|
status: string[];
|
|
199
234
|
};
|
|
235
|
+
/** Compact view of a handoff for the web UI's lists and charts. */
|
|
236
|
+
export type HandoffListItem = {
|
|
237
|
+
id: string;
|
|
238
|
+
task: string;
|
|
239
|
+
createdAt: string;
|
|
240
|
+
title?: string;
|
|
241
|
+
source?: SourceAgent;
|
|
242
|
+
sessionId?: string;
|
|
243
|
+
targetAgent?: string;
|
|
244
|
+
repoPath: string;
|
|
245
|
+
repoName: string;
|
|
246
|
+
branch: string;
|
|
247
|
+
commit: string;
|
|
248
|
+
isGitRepo: boolean;
|
|
249
|
+
phase: WorkPhase;
|
|
250
|
+
objective: string;
|
|
251
|
+
nextAction: string;
|
|
252
|
+
verification: VerificationStatus;
|
|
253
|
+
checks: {
|
|
254
|
+
passed: number;
|
|
255
|
+
failed: number;
|
|
256
|
+
unknown: number;
|
|
257
|
+
};
|
|
258
|
+
plan: {
|
|
259
|
+
total: number;
|
|
260
|
+
completed: number;
|
|
261
|
+
inProgress: number;
|
|
262
|
+
};
|
|
263
|
+
files: {
|
|
264
|
+
count: number;
|
|
265
|
+
additions: number;
|
|
266
|
+
deletions: number;
|
|
267
|
+
paths: string[];
|
|
268
|
+
};
|
|
269
|
+
blockers: number;
|
|
270
|
+
tokens: number;
|
|
271
|
+
transcriptItems: number;
|
|
272
|
+
};
|
|
273
|
+
export type UiStatus = {
|
|
274
|
+
version: string;
|
|
275
|
+
home: string;
|
|
276
|
+
handoffCount: number;
|
|
277
|
+
taskCount: number;
|
|
278
|
+
packCount: number;
|
|
279
|
+
/** Newest handoff time; the UI polls this to pick up new captures. */
|
|
280
|
+
latestAt?: string;
|
|
281
|
+
agents: Record<SourceAgent, boolean>;
|
|
282
|
+
};
|
|
200
283
|
export type ContextBlockCategory = "intent" | "instruction" | "decision" | "constraint" | "verification" | "risk" | "next-action" | "changed-file" | "transcript";
|
|
201
284
|
export type ContextBlock = {
|
|
202
285
|
id: string;
|
|
@@ -234,9 +317,11 @@ export type ContextPackOutput = {
|
|
|
234
317
|
updatedAt: string;
|
|
235
318
|
includeRawTranscript: boolean;
|
|
236
319
|
estimatedChars: number;
|
|
320
|
+
estimatedTokens: number;
|
|
237
321
|
warnings: string[];
|
|
238
322
|
items: ContextPackItem[];
|
|
239
323
|
};
|
|
240
324
|
estimatedChars: number;
|
|
325
|
+
estimatedTokens: number;
|
|
241
326
|
warnings: string[];
|
|
242
327
|
};
|
package/dist/ui.d.ts
CHANGED
|
@@ -2,6 +2,14 @@ import { type IncomingMessage } from "node:http";
|
|
|
2
2
|
export type UiOptions = {
|
|
3
3
|
host?: string;
|
|
4
4
|
port?: number;
|
|
5
|
+
/** Try the next ports when the requested one is busy. */
|
|
6
|
+
fallback?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type RunningUi = {
|
|
9
|
+
url: string;
|
|
10
|
+
host: string;
|
|
11
|
+
port: number;
|
|
12
|
+
close: () => Promise<void>;
|
|
5
13
|
};
|
|
6
14
|
export type FileViewResult = {
|
|
7
15
|
ok: true;
|
|
@@ -19,9 +27,10 @@ export type FileViewResult = {
|
|
|
19
27
|
error: string;
|
|
20
28
|
};
|
|
21
29
|
export declare function isValidContextPackBody(body: Record<string, unknown>): boolean;
|
|
22
|
-
export declare function startUi(options?: UiOptions): Promise<
|
|
30
|
+
export declare function startUi(options?: UiOptions): Promise<RunningUi>;
|
|
23
31
|
export declare function isLocalRequest(req: Pick<IncomingMessage, "headers">): boolean;
|
|
24
32
|
export declare function readRepoFileForView(repoPath: string, filePath: string): FileViewResult;
|
|
33
|
+
/** Resolve `filePath` inside `repoPath`, following symlinks so a link cannot point outside the repository. */
|
|
25
34
|
export declare function resolveSafeRepoPath(repoPath: string, filePath: string): {
|
|
26
35
|
ok: true;
|
|
27
36
|
path: string;
|