ctxpool 0.1.1 → 0.4.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.
Files changed (58) hide show
  1. package/README.md +94 -103
  2. package/dist/cli.js +328 -184
  3. package/dist/cli.js.map +1 -1
  4. package/dist/clipboard.js +8 -10
  5. package/dist/clipboard.js.map +1 -1
  6. package/dist/format.d.ts +32 -0
  7. package/dist/format.js +110 -0
  8. package/dist/format.js.map +1 -0
  9. package/dist/handoff.d.ts +16 -13
  10. package/dist/handoff.js +441 -706
  11. package/dist/handoff.js.map +1 -1
  12. package/dist/mcp.js +99 -221
  13. package/dist/mcp.js.map +1 -1
  14. package/dist/pack.d.ts +14 -0
  15. package/dist/pack.js +121 -0
  16. package/dist/pack.js.map +1 -0
  17. package/dist/paths.d.ts +15 -0
  18. package/dist/paths.js +35 -5
  19. package/dist/paths.js.map +1 -1
  20. package/dist/redact.d.ts +6 -0
  21. package/dist/redact.js +85 -0
  22. package/dist/redact.js.map +1 -0
  23. package/dist/repo.d.ts +6 -1
  24. package/dist/repo.js +109 -123
  25. package/dist/repo.js.map +1 -1
  26. package/dist/session.d.ts +40 -1
  27. package/dist/session.js +1295 -302
  28. package/dist/session.js.map +1 -1
  29. package/dist/store.d.ts +13 -6
  30. package/dist/store.js +88 -115
  31. package/dist/store.js.map +1 -1
  32. package/dist/text.d.ts +6 -0
  33. package/dist/text.js +25 -0
  34. package/dist/text.js.map +1 -0
  35. package/dist/types.d.ts +44 -7
  36. package/dist/ui.d.ts +10 -1
  37. package/dist/ui.js +329 -383
  38. package/dist/ui.js.map +1 -1
  39. package/dist/util.d.ts +10 -1
  40. package/dist/util.js +40 -10
  41. package/dist/util.js.map +1 -1
  42. package/dist/verify.d.ts +16 -0
  43. package/dist/verify.js +74 -0
  44. package/dist/verify.js.map +1 -0
  45. package/dist/version.d.ts +1 -0
  46. package/dist/version.js +4 -0
  47. package/dist/version.js.map +1 -0
  48. package/dist-web/assets/contextpool-mark-4vSRiUeZ.svg +1 -0
  49. package/dist-web/assets/index-BBjy_S2c.css +2 -0
  50. package/dist-web/assets/index-QwGbBEu2.js +17 -0
  51. package/dist-web/index.html +4 -3
  52. package/package.json +18 -17
  53. package/dist/logs.d.ts +0 -9
  54. package/dist/logs.js +0 -82
  55. package/dist/logs.js.map +0 -1
  56. package/dist-web/assets/contextpool-mark-Bu_00i5t.svg +0 -16
  57. package/dist-web/assets/index-BfHRocKl.js +0 -14
  58. 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
- positioning: {
86
- category: "handoff-ledger";
87
- buyer: "ai-heavy-engineering-teams";
88
- moat: "provenance-backed-engineering-memory";
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: "codex" | "claude" | "unknown";
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;
@@ -234,9 +269,11 @@ export type ContextPackOutput = {
234
269
  updatedAt: string;
235
270
  includeRawTranscript: boolean;
236
271
  estimatedChars: number;
272
+ estimatedTokens: number;
237
273
  warnings: string[];
238
274
  items: ContextPackItem[];
239
275
  };
240
276
  estimatedChars: number;
277
+ estimatedTokens: number;
241
278
  warnings: string[];
242
279
  };
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<void>;
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;