pi-smart-compact 9.7.0 → 10.0.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 (211) hide show
  1. package/ARCHITECTURE.md +979 -372
  2. package/CHANGELOG.md +720 -0
  3. package/LICENSE +8 -0
  4. package/README.md +130 -640
  5. package/SECURITY.md +34 -12
  6. package/SUPPORT.md +26 -9
  7. package/assets/DejaVu-LICENSE.txt +187 -0
  8. package/assets/DejaVuSansMono.ttf +0 -0
  9. package/assets/README.md +26 -0
  10. package/assets/skills/context-management/SKILL.md +34 -0
  11. package/dist/app/anchor-cache.d.ts +36 -0
  12. package/dist/app/anchor-cache.d.ts.map +1 -0
  13. package/dist/app/artifact-storage.d.ts +47 -0
  14. package/dist/app/artifact-storage.d.ts.map +1 -0
  15. package/dist/app/background-preparation.d.ts +39 -0
  16. package/dist/app/background-preparation.d.ts.map +1 -0
  17. package/dist/app/compaction-commit-store.d.ts +5 -1
  18. package/dist/app/compaction-commit-store.d.ts.map +1 -1
  19. package/dist/app/context-evidence.d.ts +57 -0
  20. package/dist/app/context-evidence.d.ts.map +1 -0
  21. package/dist/app/context-guide.d.ts +3 -0
  22. package/dist/app/context-guide.d.ts.map +1 -0
  23. package/dist/app/context-operations.d.ts +106 -0
  24. package/dist/app/context-operations.d.ts.map +1 -0
  25. package/dist/app/effective-state.d.ts +23 -0
  26. package/dist/app/effective-state.d.ts.map +1 -0
  27. package/dist/app/extension-conflicts.d.ts +15 -0
  28. package/dist/app/extension-conflicts.d.ts.map +1 -0
  29. package/dist/app/global-settings-runtime.d.ts +3 -3
  30. package/dist/app/global-settings-runtime.d.ts.map +1 -1
  31. package/dist/app/hindsight-memory.d.ts +100 -0
  32. package/dist/app/hindsight-memory.d.ts.map +1 -0
  33. package/dist/app/host-cache-ledger.d.ts +68 -0
  34. package/dist/app/host-cache-ledger.d.ts.map +1 -0
  35. package/dist/app/lazy-tools.d.ts +36 -0
  36. package/dist/app/lazy-tools.d.ts.map +1 -0
  37. package/dist/app/memory-backend.d.ts +58 -0
  38. package/dist/app/memory-backend.d.ts.map +1 -0
  39. package/dist/app/mnemopi-memory.d.ts +13 -0
  40. package/dist/app/mnemopi-memory.d.ts.map +1 -0
  41. package/dist/app/mnemopi-protocol.d.ts +78 -0
  42. package/dist/app/mnemopi-protocol.d.ts.map +1 -0
  43. package/dist/app/mnemopi-worker.d.ts +2 -0
  44. package/dist/app/mnemopi-worker.d.ts.map +1 -0
  45. package/dist/app/model-feasibility.d.ts +20 -0
  46. package/dist/app/model-feasibility.d.ts.map +1 -0
  47. package/dist/app/native-compaction.d.ts +88 -0
  48. package/dist/app/native-compaction.d.ts.map +1 -0
  49. package/dist/app/native-continuity-bridge.d.ts.map +1 -1
  50. package/dist/app/navigation-data.d.ts +28 -0
  51. package/dist/app/navigation-data.d.ts.map +1 -0
  52. package/dist/app/navigation-types.d.ts +60 -0
  53. package/dist/app/navigation-types.d.ts.map +1 -0
  54. package/dist/app/pending-slot.d.ts +11 -1
  55. package/dist/app/pending-slot.d.ts.map +1 -1
  56. package/dist/app/preflight.d.ts.map +1 -1
  57. package/dist/app/register-context-tools.d.ts +16 -3
  58. package/dist/app/register-context-tools.d.ts.map +1 -1
  59. package/dist/app/register-navigation.d.ts +20 -0
  60. package/dist/app/register-navigation.d.ts.map +1 -0
  61. package/dist/app/register-smart-compact-command.d.ts +17 -2
  62. package/dist/app/register-smart-compact-command.d.ts.map +1 -1
  63. package/dist/app/register-smart-compact-tool.d.ts.map +1 -1
  64. package/dist/app/register-smart-context-tool.d.ts +55 -0
  65. package/dist/app/register-smart-context-tool.d.ts.map +1 -0
  66. package/dist/app/run-context.d.ts +4 -1
  67. package/dist/app/run-context.d.ts.map +1 -1
  68. package/dist/app/run-smart-compact.d.ts +3 -3
  69. package/dist/app/run-smart-compact.d.ts.map +1 -1
  70. package/dist/app/session-handoff.d.ts +64 -0
  71. package/dist/app/session-handoff.d.ts.map +1 -0
  72. package/dist/app/session-lineage.d.ts +17 -0
  73. package/dist/app/session-lineage.d.ts.map +1 -0
  74. package/dist/app/session-run-lock.d.ts +0 -2
  75. package/dist/app/session-run-lock.d.ts.map +1 -1
  76. package/dist/app/settled-auto-trigger.d.ts +2 -0
  77. package/dist/app/settled-auto-trigger.d.ts.map +1 -1
  78. package/dist/app/smart-compact-input.d.ts +1 -1
  79. package/dist/app/smart-compact-input.d.ts.map +1 -1
  80. package/dist/app/smart-compact-policy.d.ts +1 -1
  81. package/dist/app/smart-compact-policy.d.ts.map +1 -1
  82. package/dist/app/steps/extract.d.ts +45 -1
  83. package/dist/app/steps/extract.d.ts.map +1 -1
  84. package/dist/app/steps/metrics.d.ts +1 -0
  85. package/dist/app/steps/metrics.d.ts.map +1 -1
  86. package/dist/app/steps/persist.d.ts.map +1 -1
  87. package/dist/app/steps/prepare.d.ts.map +1 -1
  88. package/dist/app/steps/recover.d.ts +9 -0
  89. package/dist/app/steps/recover.d.ts.map +1 -1
  90. package/dist/app/steps/state.d.ts.map +1 -1
  91. package/dist/app/steps/synthesize.d.ts.map +1 -1
  92. package/dist/app/steps/tier.d.ts.map +1 -1
  93. package/dist/app/steps/verify.d.ts.map +1 -1
  94. package/dist/app/steps/visual.d.ts +4 -0
  95. package/dist/app/steps/visual.d.ts.map +1 -0
  96. package/dist/app/steps/window.d.ts.map +1 -1
  97. package/dist/app/tool-artifacts.d.ts +27 -0
  98. package/dist/app/tool-artifacts.d.ts.map +1 -0
  99. package/dist/app/visual-archive.d.ts +29 -0
  100. package/dist/app/visual-archive.d.ts.map +1 -0
  101. package/dist/constants.d.ts +96 -1
  102. package/dist/constants.d.ts.map +1 -1
  103. package/dist/domain/compaction-usage.d.ts +16 -0
  104. package/dist/domain/compaction-usage.d.ts.map +1 -0
  105. package/dist/domain/model-capacity.d.ts +12 -0
  106. package/dist/domain/model-capacity.d.ts.map +1 -0
  107. package/dist/domain/provider-evaluation.d.ts +7 -0
  108. package/dist/domain/provider-evaluation.d.ts.map +1 -1
  109. package/dist/domain/telemetry.d.ts +43 -2
  110. package/dist/domain/telemetry.d.ts.map +1 -1
  111. package/dist/domain/tool-semantics.d.ts +23 -0
  112. package/dist/domain/tool-semantics.d.ts.map +1 -1
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/index.js +17298 -8331
  115. package/dist/infra/ai-messages.d.ts +1 -1
  116. package/dist/infra/ai-messages.d.ts.map +1 -1
  117. package/dist/infra/context-graph.d.ts +38 -7
  118. package/dist/infra/context-graph.d.ts.map +1 -1
  119. package/dist/infra/fs.d.ts.map +1 -1
  120. package/dist/infra/hindsight-client.d.ts +73 -0
  121. package/dist/infra/hindsight-client.d.ts.map +1 -0
  122. package/dist/infra/hindsight-receipts.d.ts +68 -0
  123. package/dist/infra/hindsight-receipts.d.ts.map +1 -0
  124. package/dist/infra/llm-client.d.ts +26 -23
  125. package/dist/infra/llm-client.d.ts.map +1 -1
  126. package/dist/infra/memory-ref.d.ts +27 -0
  127. package/dist/infra/memory-ref.d.ts.map +1 -0
  128. package/dist/infra/native-protocol.d.ts +54 -0
  129. package/dist/infra/native-protocol.d.ts.map +1 -0
  130. package/dist/infra/optional-components.d.ts +15 -0
  131. package/dist/infra/optional-components.d.ts.map +1 -0
  132. package/dist/infra/paths.d.ts +2 -0
  133. package/dist/infra/paths.d.ts.map +1 -1
  134. package/dist/infra/services.d.ts +15 -5
  135. package/dist/infra/services.d.ts.map +1 -1
  136. package/dist/infra/visual-renderer.d.ts +16 -0
  137. package/dist/infra/visual-renderer.d.ts.map +1 -0
  138. package/dist/mnemopi-worker.js +213 -0
  139. package/dist/phases/explore.d.ts +12 -9
  140. package/dist/phases/explore.d.ts.map +1 -1
  141. package/dist/phases/synthesize.d.ts +18 -3
  142. package/dist/phases/synthesize.d.ts.map +1 -1
  143. package/dist/phases/verify.d.ts +20 -2
  144. package/dist/phases/verify.d.ts.map +1 -1
  145. package/dist/rtk.d.ts +7 -0
  146. package/dist/rtk.d.ts.map +1 -0
  147. package/dist/rtk.js +767 -0
  148. package/dist/types.d.ts +128 -4
  149. package/dist/types.d.ts.map +1 -1
  150. package/dist/ui/dashboard-format.d.ts +2 -1
  151. package/dist/ui/dashboard-format.d.ts.map +1 -1
  152. package/dist/ui/dashboard-insights.d.ts +9 -1
  153. package/dist/ui/dashboard-insights.d.ts.map +1 -1
  154. package/dist/ui/error-format.d.ts +7 -2
  155. package/dist/ui/error-format.d.ts.map +1 -1
  156. package/dist/ui/handoff-overlay.d.ts +26 -0
  157. package/dist/ui/handoff-overlay.d.ts.map +1 -0
  158. package/dist/ui/home-overlay.d.ts +54 -0
  159. package/dist/ui/home-overlay.d.ts.map +1 -0
  160. package/dist/ui/metrics-dashboard-overlay.d.ts.map +1 -1
  161. package/dist/ui/metrics-report.d.ts.map +1 -1
  162. package/dist/ui/navigation-overlay.d.ts +92 -0
  163. package/dist/ui/navigation-overlay.d.ts.map +1 -0
  164. package/dist/ui/overlays.d.ts +12 -2
  165. package/dist/ui/overlays.d.ts.map +1 -1
  166. package/dist/ui/profiles.d.ts +51 -0
  167. package/dist/ui/profiles.d.ts.map +1 -0
  168. package/dist/ui/settings-complex.d.ts +49 -3
  169. package/dist/ui/settings-complex.d.ts.map +1 -1
  170. package/dist/ui/settings-list.d.ts +28 -0
  171. package/dist/ui/settings-list.d.ts.map +1 -0
  172. package/dist/ui/settings-overlay.d.ts +13 -6
  173. package/dist/ui/settings-overlay.d.ts.map +1 -1
  174. package/dist/ui/storage-report.d.ts +4 -0
  175. package/dist/ui/storage-report.d.ts.map +1 -0
  176. package/dist/utils/backups.d.ts.map +1 -1
  177. package/dist/utils/cache.d.ts +6 -2
  178. package/dist/utils/cache.d.ts.map +1 -1
  179. package/dist/utils/config.d.ts +12 -0
  180. package/dist/utils/config.d.ts.map +1 -1
  181. package/dist/utils/extraction.d.ts +7 -0
  182. package/dist/utils/extraction.d.ts.map +1 -1
  183. package/dist/utils/helpers.d.ts.map +1 -1
  184. package/dist/utils/id-fingerprint.d.ts +3 -1
  185. package/dist/utils/id-fingerprint.d.ts.map +1 -1
  186. package/dist/utils/issues.d.ts +61 -0
  187. package/dist/utils/issues.d.ts.map +1 -0
  188. package/dist/utils/pruning.d.ts.map +1 -1
  189. package/dist/utils/session-log.d.ts +0 -2
  190. package/dist/utils/session-log.d.ts.map +1 -1
  191. package/dist/utils/state.d.ts +21 -2
  192. package/dist/utils/state.d.ts.map +1 -1
  193. package/dist/utils/tokens.d.ts +10 -2
  194. package/dist/utils/tokens.d.ts.map +1 -1
  195. package/docs/MIGRATING_TO_V8.md +7 -1
  196. package/docs/README.md +69 -0
  197. package/docs/RELEASE.md +174 -56
  198. package/docs/assets/banner.png +0 -0
  199. package/docs/assets/banner.svg +1158 -70
  200. package/docs/assets/pi-smart-compact.png +0 -0
  201. package/docs/assets/pi-smart-compact.svg +24 -0
  202. package/docs/configuration.md +637 -0
  203. package/docs/evaluation.md +409 -0
  204. package/docs/guide.md +879 -0
  205. package/docs/hindsight-memory.md +314 -0
  206. package/docs/identity.md +124 -0
  207. package/package.json +44 -11
  208. package/dist/provider-eval.js +0 -2107
  209. package/dist/provider-scenario-eval.js +0 -2884
  210. package/dist/telemetry-report.js +0 -1958
  211. package/docs/provider-evaluation-2026-08-06.md +0 -63
@@ -0,0 +1,213 @@
1
+ // @bun
2
+ // src/app/mnemopi-worker.ts
3
+ import { Mnemopi } from "@oh-my-pi/pi-mnemopi";
4
+ import { existsSync, mkdirSync } from "fs";
5
+ import path from "path";
6
+ import { Check } from "typebox/value";
7
+
8
+ // src/app/mnemopi-protocol.ts
9
+ import { Type } from "typebox";
10
+ var MNEMOPI_READY = "psc-mnemopi-ready-v1";
11
+ var target = { dbPath: Type.String(), projectId: Type.String() };
12
+ var fact = {
13
+ memoryId: Type.String(),
14
+ kind: Type.String(),
15
+ title: Type.String({ maxLength: 200 }),
16
+ content: Type.String({ minLength: 1, maxLength: 2000 }),
17
+ relatedPaths: Type.Array(Type.String({ maxLength: 300 }), { maxItems: 20 })
18
+ };
19
+ var MnemopiMetadataSchema = Type.Object({
20
+ projectId: target.projectId,
21
+ memoryId: fact.memoryId,
22
+ kind: fact.kind,
23
+ title: fact.title,
24
+ relatedPaths: fact.relatedPaths
25
+ });
26
+ var MnemopiRequestSchema = Type.Union([
27
+ Type.Object({ ...target, ...fact, operation: Type.Literal("save") }),
28
+ Type.Object({
29
+ ...target,
30
+ operation: Type.Literal("resolve"),
31
+ memoryId: fact.memoryId
32
+ }),
33
+ Type.Object({
34
+ ...target,
35
+ operation: Type.Literal("inspect"),
36
+ memoryId: fact.memoryId
37
+ }),
38
+ Type.Object({
39
+ ...target,
40
+ operation: Type.Literal("recall"),
41
+ query: Type.String({ maxLength: 500 }),
42
+ limit: Type.Integer({ minimum: 1, maximum: 20 }),
43
+ kinds: Type.Optional(Type.Array(Type.String()))
44
+ })
45
+ ]);
46
+ var MnemopiOutcomeSchema = Type.Union([
47
+ Type.Object({
48
+ state: Type.Literal("saved"),
49
+ dbPath: Type.String(),
50
+ id: Type.String(),
51
+ memoryId: Type.String(),
52
+ existing: Type.Boolean()
53
+ }),
54
+ Type.Object({
55
+ state: Type.Literal("resolved"),
56
+ dbPath: Type.String(),
57
+ closed: Type.Boolean()
58
+ }),
59
+ Type.Object({
60
+ state: Type.Literal("inspected"),
61
+ dbPath: Type.String(),
62
+ fact: Type.Union([
63
+ Type.Object({
64
+ memoryId: Type.String(),
65
+ kind: Type.String(),
66
+ title: Type.String(),
67
+ content: Type.String()
68
+ }),
69
+ Type.Null()
70
+ ])
71
+ }),
72
+ Type.Object({
73
+ state: Type.Literal("recalled"),
74
+ dbPath: Type.String(),
75
+ facts: Type.Array(Type.Object({
76
+ id: Type.String(),
77
+ memoryId: Type.String(),
78
+ kind: Type.String(),
79
+ title: Type.String(),
80
+ content: Type.String(),
81
+ score: Type.Number()
82
+ }), { maxItems: 20 })
83
+ }),
84
+ Type.Object({
85
+ state: Type.Literal("failed"),
86
+ reason: Type.String(),
87
+ dbPath: Type.Optional(Type.String())
88
+ }),
89
+ Type.Object({
90
+ state: Type.Literal("unknown"),
91
+ reason: Type.String(),
92
+ dbPath: Type.Optional(Type.String())
93
+ })
94
+ ]);
95
+
96
+ // src/app/mnemopi-worker.ts
97
+ async function execute(request) {
98
+ const { dbPath, projectId } = request;
99
+ if (request.operation !== "save" && !existsSync(dbPath)) {
100
+ if (request.operation === "recall")
101
+ return { state: "recalled", dbPath, facts: [] };
102
+ if (request.operation === "inspect")
103
+ return { state: "inspected", dbPath, fact: null };
104
+ return { state: "resolved", dbPath, closed: false };
105
+ }
106
+ process.umask(63);
107
+ if (request.operation === "save")
108
+ mkdirSync(path.dirname(dbPath), { recursive: true, mode: 448 });
109
+ const byRef = request.operation !== "recall";
110
+ const memory = new Mnemopi({
111
+ dbPath,
112
+ sessionId: byRef ? request.memoryId : projectId,
113
+ authorId: projectId,
114
+ channelId: request.operation === "save" ? request.kind : request.operation === "recall" ? projectId : "resolve",
115
+ noEmbeddings: true,
116
+ embeddings: false,
117
+ llmEnabled: false,
118
+ llm: false,
119
+ proactiveLinking: false,
120
+ reconcile: false
121
+ });
122
+ try {
123
+ if (request.operation === "recall") {
124
+ const groups = request.kinds?.length ? [...new Set(request.kinds)] : [undefined];
125
+ const facts = [];
126
+ for (const kind of groups) {
127
+ const matches = await memory.recall(request.query, request.limit, {
128
+ authorId: projectId,
129
+ channelId: kind,
130
+ queryEmbedding: null,
131
+ contentPreviewChars: 2000
132
+ });
133
+ for (const match of matches) {
134
+ let metadata;
135
+ try {
136
+ metadata = JSON.parse(match.metadata_json ?? "");
137
+ } catch {
138
+ continue;
139
+ }
140
+ if (!Check(MnemopiMetadataSchema, metadata) || metadata.projectId !== projectId || match.source !== "pi-smart-compact:" + metadata.memoryId || kind !== undefined && metadata.kind !== kind)
141
+ continue;
142
+ facts.push({
143
+ id: match.id,
144
+ memoryId: metadata.memoryId,
145
+ kind: metadata.kind,
146
+ title: metadata.title,
147
+ content: match.content.slice(0, 2000),
148
+ score: match.score ?? 0
149
+ });
150
+ }
151
+ }
152
+ facts.sort((a, b) => b.score - a.score);
153
+ return { state: "recalled", dbPath, facts: facts.slice(0, request.limit) };
154
+ }
155
+ const source = "pi-smart-compact:" + request.memoryId;
156
+ const rows = memory.getContext(2);
157
+ const row = rows[0];
158
+ if (rows.length > 1 || row !== undefined && (!row || typeof row !== "object" || !("source" in row) || row.source !== source || !("id" in row) || typeof row.id !== "string")) {
159
+ throw new Error("Mnemopi fact scope contains unexpected entries; nothing changed");
160
+ }
161
+ const existingId = row && typeof row === "object" && "id" in row && typeof row.id === "string" ? row.id : null;
162
+ if (request.operation === "inspect") {
163
+ if (!existingId)
164
+ return { state: "inspected", dbPath, fact: null };
165
+ const raw = memory.get(existingId);
166
+ const metadata = raw && typeof raw === "object" && "metadata" in raw ? Check(MnemopiMetadataSchema, raw.metadata) ? raw.metadata : null : null;
167
+ const content = raw && typeof raw === "object" && "content" in raw && typeof raw.content === "string" ? raw.content : "";
168
+ return {
169
+ state: "inspected",
170
+ dbPath,
171
+ fact: {
172
+ memoryId: request.memoryId,
173
+ kind: metadata?.kind ?? "fact",
174
+ title: metadata?.title ?? "Saved fact",
175
+ content: content.slice(0, 2000)
176
+ }
177
+ };
178
+ }
179
+ if (request.operation === "resolve") {
180
+ return { state: "resolved", dbPath, closed: existingId !== null && memory.forget(existingId) };
181
+ }
182
+ if (existingId)
183
+ return { state: "saved", dbPath, id: existingId, memoryId: request.memoryId, existing: true };
184
+ const id = memory.remember(request.content, {
185
+ source,
186
+ scope: "session",
187
+ veracity: "stated",
188
+ extract: false,
189
+ extractEntities: false,
190
+ metadata: { projectId, memoryId: request.memoryId, kind: request.kind, title: request.title, relatedPaths: request.relatedPaths }
191
+ });
192
+ return { state: "saved", dbPath, id, memoryId: request.memoryId, existing: false };
193
+ } finally {
194
+ memory.close();
195
+ }
196
+ }
197
+ console.log(MNEMOPI_READY);
198
+ try {
199
+ const input = JSON.parse(await Bun.stdin.text());
200
+ if (!Check(MnemopiRequestSchema, input))
201
+ throw new Error("Invalid Mnemopi worker request");
202
+ let outcome;
203
+ try {
204
+ outcome = await execute(input);
205
+ } catch (error) {
206
+ const reason = error instanceof Error ? error.message : String(error);
207
+ const dbPath = typeof input.dbPath === "string" ? input.dbPath : undefined;
208
+ outcome = input.operation === "recall" ? { state: "failed", reason, dbPath } : { state: "unknown", reason, dbPath };
209
+ }
210
+ console.log(JSON.stringify(outcome));
211
+ } catch (error) {
212
+ console.log(JSON.stringify({ state: "failed", reason: error instanceof Error ? error.message : String(error) }));
213
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Phase 2: Targeted LLM Exploration.
3
3
  */
4
- import type { Model, Api, ProviderHeaders } from "@earendil-works/pi-ai";
4
+ import type { Model, Api, Context, ProviderHeaders } from "@earendil-works/pi-ai";
5
5
  import type { LlmMessage, StructuredExtraction, ExplorationReport } from "../types.ts";
6
6
  import type { SmartCompactServices } from "../infra/services.ts";
7
7
  import { SecretScrubber } from "../domain/scrub.ts";
@@ -18,14 +18,13 @@ export declare function executeExplorationTool(call: {
18
18
  export declare function parseExplorationReport(text: string, llmMessages: LlmMessage[]): ExplorationReport;
19
19
  export declare function buildExplorationReportFromParsed(parsed: unknown, llmMessages: LlmMessage[]): ExplorationReport;
20
20
  export declare function fallbackExplorationReport(llmMessages: LlmMessage[]): ExplorationReport;
21
- /**
22
- * Top-level exploration entry point.
23
- *
24
- * `services` is threaded in explicitly so concurrent production runs never
25
- * share mutable tool-support state. The optional `getDefaultServices()`
26
- * fallback exists only for legacy direct callers and test/REPL use; the
27
- * production orchestrator always supplies a run-scoped container.
28
- */
21
+ /** Build the known first explorer request; tool-feedback rounds are checked at dispatch. */
22
+ export declare function buildExplorerRequest(extraction: StructuredExtraction, model: Model<Api>, prevSummary?: string, userNote?: string): {
23
+ context: Context;
24
+ maxTokens: number;
25
+ userContent: string;
26
+ };
27
+ export declare function explorationToolSupportKey(model: Model<Api>): string;
29
28
  export declare function exploreConversation(llmMessages: LlmMessage[], extraction: StructuredExtraction, model: Model<Api>, auth: {
30
29
  apiKey: string;
31
30
  headers?: ProviderHeaders;
@@ -34,4 +33,8 @@ export declare function exploreConversation(llmMessages: LlmMessage[], extractio
34
33
  rounds: number;
35
34
  toolSupported: boolean;
36
35
  }>;
36
+ export declare function buildDirectExplorationRequest(llmMessages: LlmMessage[], extraction: StructuredExtraction, model: Model<Api>, prevSummary?: string, userNote?: string): {
37
+ context: Context;
38
+ maxTokens: number;
39
+ };
37
40
  //# sourceMappingURL=explore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../src/phases/explore.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,GAAG,EAKH,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EACpB,iBAAiB,EAElB,MAAM,aAAa,CAAC;AAcrB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAIjE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAuBpD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,oBAAoB,GAAG,OAAO,CAqBvE;AAsHD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EAC1D,WAAW,EAAE,UAAU,EAAE,EACzB,QAAQ,iBAAuB,GAC9B,MAAM,CA6MR;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,UAAU,EAAE,GACxB,iBAAiB,CAkDnB;AA6DD,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,OAAO,EACf,WAAW,EAAE,UAAU,EAAE,GACxB,iBAAiB,CAgCnB;AAED,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,UAAU,EAAE,GACxB,iBAAiB,CAWnB;A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AM,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAAC,CAsQhF;AAyED,wBAAgB,6BAA6B,CAC5C,WAAW,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,oBAAoB,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAC9E,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GACrC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAyCzC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Phase 3: Hierarchical Synthesis.
3
3
  */
4
- import type { Model, Api, ProviderHeaders } from "@earendil-works/pi-ai";
4
+ import type { Model, Api, Context, ProviderHeaders } from "@earendil-works/pi-ai";
5
5
  import type { LlmMessage, LlmChunk, ChunkSummary, StructuredExtraction, ExplorationReport, ProfileConfig, CompactionState } from "../types.ts";
6
6
  import { type TokenEstimator } from "../utils/tokens.ts";
7
7
  import type { SmartCompactServices } from "../infra/services.ts";
@@ -11,13 +11,28 @@ export declare class BatchSummaryFormatError extends Error {
11
11
  constructor(reason: string);
12
12
  }
13
13
  export declare function chunkLlmMessages(msgs: LlmMessage[], boundaries: import("../types.ts").TopicBoundary[], pc: ProfileConfig, estimator?: TokenEstimator, focus?: string): LlmChunk[];
14
- export declare function singlePassCompact(convText: string, extraction: StructuredExtraction, report: ExplorationReport | null, prevContext: string, model: Model<Api>, auth: {
14
+ export declare function heuristicTopicBoundaries(extraction: StructuredExtraction): {
15
+ afterIndex: number;
16
+ topic: string;
17
+ priority: "high" | "normal";
18
+ confidence: number;
19
+ }[];
20
+ export interface SynthesisRequest {
21
+ context: Context;
22
+ maxTokens: number;
23
+ }
24
+ /** The same concrete request is inspected by model selection and sent at runtime. */
25
+ export declare function buildSinglePassRequest(convText: string, extraction: StructuredExtraction, report: ExplorationReport | null, prevContext: string, model: Model<Api>, budgetTokens: number, focus?: string): SynthesisRequest;
26
+ export declare function singlePassCompact(request: SynthesisRequest, model: Model<Api>, auth: {
15
27
  apiKey: string;
16
28
  headers?: ProviderHeaders;
17
- }, budgetTokens: number, signal?: AbortSignal, services?: SmartCompactServices, focus?: string): Promise<{
29
+ }, signal?: AbortSignal, services?: SmartCompactServices): Promise<{
18
30
  summary: string;
19
31
  llmCalls: 1;
20
32
  }>;
33
+ export declare function buildBatchRequest(batch: LlmChunk[], extraction: StructuredExtraction, model: Model<Api>, maxOutputTokens?: number): SynthesisRequest & {
34
+ dynamicSuffix: string;
35
+ };
21
36
  export declare function summarizeBatch(batch: LlmChunk[], extraction: StructuredExtraction, model: Model<Api>, auth: {
22
37
  apiKey: string;
23
38
  headers?: ProviderHeaders;
@@ -1 +1 @@
1
- {"version":3,"file":"synthesize.d.ts","sourceRoot":"","sources":["../../src/phases/synthesize.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,MAAM,aAAa,CAAC;AAYrB,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,oBAAoB,CAAC;AAW5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AA0BjE,oFAAoF;AACpF,qBAAa,uBAAwB,SAAQ,KAAK;IACjD,QAAQ,CAAC,IAAI,6BAA6B;IAE1C,YAAY,MAAM,EAAE,MAAM,EAEzB;CACD;AAoRD,wBAAgB,gBAAgB,CAC/B,IAAI,EAAE,UAAU,EAAE,EAClB,UAAU,EAAE,OAAO,aAAa,EAAE,aAAa,EAAE,EACjD,EAAE,EAAE,aAAa,EACjB,SAAS,GAAE,cAAqC,EAChD,KAAK,CAAC,EAAE,MAAM,GACZ,QAAQ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EAAE,oBAAoB,EAC/B,eAAe,CAAC,EAAE,MAAM,EACxB,UAAU,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,YAAY,EAAE,CAAC,CAqIzB;AA6BD,wBAAsB,WAAW,CAChC,SAAS,EAAE,YAAY,EAAE,EACzB,UAAU,EAAE,oBAAoB,EAChC,MAAM,EAAE,iBAAiB,GAAG,IAAI,EAChC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EACjB,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,eAAe,CAAA;CAAE,EACnD,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,WAAW,EACpB,QAAQ,CAAC,EAAE,oBAAoB,EAC/B,KAAK,CAAC,EAAE,MAAM,EACd,UAAU,GAAE,eAAe,GAAG,IAAW,GACvC,OAAO,CAAC,MAAM,CAAC,CAmDjB;AAED,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,YAAY,EAAE,EACzB,UAAU,EAAE,oBAAoB,EAChC,QAAQ,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,EAChD,YAAY,GAAE,MAAc,EAC5B,UAAU,GAAE,eAAe,GAAG,IAAW,GACvC,MAAM,CAwIR;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,GAAG,YAAY,CAiB7D"}
@@ -4,8 +4,8 @@
4
4
  * Verification findings are structured data. Formatting belongs at the UI/LLM
5
5
  * boundary; repair logic switches on `kind` and never reparses its own prose.
6
6
  */
7
- import type { Model, Api, ProviderHeaders } from "@earendil-works/pi-ai";
8
- import type { CompactionState, StructuredExtraction, VerificationGap, VerificationGateStage, VerificationResult, LlmMessage } from "../types.ts";
7
+ import type { Model, Api, Context, ProviderHeaders } from "@earendil-works/pi-ai";
8
+ import type { CompactionState, ContinuityOverride, StructuredExtraction, VerificationGap, VerificationGateStage, VerificationResult, LlmMessage } from "../types.ts";
9
9
  import type { SmartCompactServices } from "../infra/services.ts";
10
10
  export interface VerificationEvidence {
11
11
  sourceMessages?: readonly LlmMessage[];
@@ -14,6 +14,8 @@ export interface VerificationEvidence {
14
14
  note?: string;
15
15
  };
16
16
  summaryBudgetTokens?: number;
17
+ /** Run-scoped fact overrides (e.g. constraints retired this run). */
18
+ factOverrides?: readonly ContinuityOverride[];
17
19
  }
18
20
  export declare function formatVerificationGap(gap: VerificationGap): string;
19
21
  export declare function verificationFailureMessage(result: VerificationResult): string | null;
@@ -26,6 +28,18 @@ export declare class VerificationGateError extends Error {
26
28
  readonly gapCount: number;
27
29
  constructor(result: VerificationResult, initialScore: number, stage: VerificationGateStage);
28
30
  }
31
+ export declare function hasSemanticContradiction(source: string, target: string): boolean;
32
+ /**
33
+ * True when `release` (a later user message) frees `constraint`.
34
+ *
35
+ * Two safe paths: a rich release trips the full contradiction check, and a
36
+ * terse release ("ok push it now") flips the polarity of the constrained
37
+ * action — but only for deferral constraints. Standing rules ("never commit
38
+ * directly to main") keep the strict check: a terse imperative sharing one
39
+ * verb must not silently drop a live rule the summary is still checked
40
+ * against.
41
+ */
42
+ export declare function releasesConstraint(constraint: string, release: string): boolean;
29
43
  export declare function isDeterministicallyPatchable(gap: VerificationGap): boolean;
30
44
  /** Apply safe repairs to a fixed point; newly introduced patchable gaps get another bounded pass. */
31
45
  export declare function repairSummaryDeterministically(summary: string, result: VerificationResult, extraction: StructuredExtraction, continuity?: CompactionState | null, evidence?: VerificationEvidence, maxRounds?: number): {
@@ -36,6 +50,10 @@ export declare function repairSummaryDeterministically(summary: string, result:
36
50
  export declare function verifySummary(summary: string, extraction: StructuredExtraction, continuity?: CompactionState | null, evidence?: VerificationEvidence): VerificationResult;
37
51
  /** Apply every safe, deterministic repair. Hallucination/inconsistency gaps stay visible for LLM/user review. */
38
52
  export declare function patchDeterministic(summary: string, gaps: VerificationGap[], extraction: StructuredExtraction, continuity?: CompactionState | null, evidence?: VerificationEvidence): string;
53
+ export declare function buildPatchRequest(summary: string, gaps: VerificationGap[], model: Model<Api>): {
54
+ context: Context;
55
+ maxTokens: number;
56
+ };
39
57
  export declare function patchSummary(summary: string, gaps: VerificationGap[], model: Model<Api>, auth: {
40
58
  apiKey: string;
41
59
  headers?: ProviderHeaders;
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/phases/verify.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACX,KAAK,EACL,GAAG,EACH,eAAe,EAEf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACX,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,UAAU,EACV,MAAM,aAAa,CAAC;AAoCrB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,MAAM,WAAW,oBAAoB;IACpC,cAAc,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACvC,QAAQ,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAiTD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAkClE;AAED,wBAAgB,0BAA0B,CACzC,MAAM,EAAE,kBAAkB,GACxB,MAAM,GAAG,IAAI,CAcf;AAED,wFAAwF;AACxF,qBAAa,qBAAsB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAAC;IACtC,QAAQ,CAAC,QAA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AAE,eAAe,CAAA;CAAE,EAAE,MAAM,CAAC,EAAE,WAAW,EACzE,QAAQ,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,MAAM,CAAC,CAkCjB"}
package/dist/rtk.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ /** Optional companion. Explicitly load this entry point; never auto-loaded by Smart Compact.
2
+ * Delegates rules to RTK's public `rewrite` CLI; requires >=0.50 for the tested recall behavior.
3
+ * No RTK source or filtering rules are bundled. https://github.com/rtk-ai/rtk/tree/master/hooks/pi
4
+ */
5
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
6
+ export default function rtkCompanion(pi: Pick<ExtensionAPI, "on" | "exec">): void;
7
+ //# sourceMappingURL=rtk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rtk.d.ts","sourceRoot":"","sources":["../src/rtk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAGpE,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC,GAAG,IAAI,CAiDhF"}