pi-smart-compact 10.2.0 → 10.3.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/ARCHITECTURE.md +30 -8
- package/CHANGELOG.md +74 -0
- package/assets/skills/context-management/SKILL.md +7 -5
- package/dist/app/context-attention.d.ts +9 -8
- package/dist/app/context-attention.d.ts.map +1 -1
- package/dist/app/context-operations.d.ts +1 -0
- package/dist/app/context-operations.d.ts.map +1 -1
- package/dist/app/host-cache-ledger.d.ts +8 -4
- package/dist/app/host-cache-ledger.d.ts.map +1 -1
- package/dist/app/native-compaction.d.ts.map +1 -1
- package/dist/app/register-navigation.d.ts +1 -1
- package/dist/app/register-navigation.d.ts.map +1 -1
- package/dist/app/register-smart-context-tool.d.ts +1 -1
- package/dist/app/register-smart-context-tool.d.ts.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/domain/tool-semantics.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +193 -80
- package/dist/rtk.js +1 -1
- package/docs/configuration.md +23 -11
- package/docs/evaluation.md +6 -3
- package/docs/guide.md +74 -34
- package/package.json +1 -1
package/ARCHITECTURE.md
CHANGED
|
@@ -250,13 +250,17 @@ reloads and forks. At a completed, uncontested turn boundary a ready batch
|
|
|
250
250
|
commits with cause `pressure` (early pressure gate reached) or `break-even`
|
|
251
251
|
(catalog prices say it pays back within `AUTO_TRIM_BREAK_EVEN_REQUESTS` = 24
|
|
252
252
|
requests). Otherwise it is held (`deferredTrim` in `smart_context` status):
|
|
253
|
-
|
|
254
|
-
results request-locally, byte-identical to the future `context_edit`,
|
|
255
|
-
edits commit with cause `cold` at the next completed turn.
|
|
253
|
+
beyond the model's estimated cache horizon, `context_with_system` sends the
|
|
254
|
+
trimmed results request-locally, byte-identical to the future `context_edit`,
|
|
255
|
+
and the edits commit with cause `cold` at the next completed turn. The shared
|
|
256
|
+
`cacheLifetimeMs` uses Pi's longest advertised `promptCache` tier, extended by
|
|
257
|
+
observed 1h writes; unknown metadata never permits a cold trim. Model changes
|
|
258
|
+
and context epochs do not inherit the old route's clock. While a batch is
|
|
256
259
|
held, `cache_warming_decision` may stop Pi's cache warming when a refresh no
|
|
257
260
|
longer pays. Unknown prices allow only `pressure` and `cold`. The formula and
|
|
258
261
|
drop conditions are in [configuration](./docs/configuration.md);
|
|
259
|
-
`app/host-cache-ledger.ts`
|
|
262
|
+
`app/host-cache-ledger.ts` uses the same horizon for estimated rebuild timing;
|
|
263
|
+
its labels are temporal observations, not proof of causality. Costs are
|
|
260
264
|
catalog-price estimates, not measured cache billing. Manual and agent trims
|
|
261
265
|
commit at the next boundary with cause `manual` or `agent`; explicit trim
|
|
262
266
|
bypasses batching, not safety.
|
|
@@ -286,11 +290,20 @@ context. A checkpoint captures session/origin IDs and a projected-prefix
|
|
|
286
290
|
fingerprint. New user messages, an intervening compaction or branch summary, or
|
|
287
291
|
a changed prefix invalidate it. The agent-written handoff is a bounded
|
|
288
292
|
`custom_message`, not an authoritative user instruction or an EESV
|
|
289
|
-
verification result.
|
|
293
|
+
verification result. Checkpoint/rewind are explicit research round trips and
|
|
294
|
+
are pressure-independent (including unknown usage); automatic cleanup and
|
|
295
|
+
agent trim/anchor remain pressure-gated. A second active checkpoint is rejected
|
|
296
|
+
at request and commit time. For a pure read-only detour the delivered context
|
|
297
|
+
is the unchanged checkpoint prefix plus one report, without another model call.
|
|
290
298
|
|
|
291
299
|
A conservative read-only tool allowlist plus shared nested-call normalization
|
|
292
300
|
protects side effects. Rewind removes only whole successful, complete,
|
|
293
|
-
text-only read exchanges
|
|
301
|
+
text-only read exchanges (including supported graph, diagnostic and web tools)
|
|
302
|
+
and successful assistant prose after the checkpoint. Owned pressure hints
|
|
303
|
+
inside that suffix are omitted by native custom-entry type, never text matching;
|
|
304
|
+
pre-checkpoint hints and unrelated extension messages stay. Namespace lookalikes and
|
|
305
|
+
mutating graph operations are not admitted. First-delivery graph source snippets
|
|
306
|
+
stay whole for read-before-edit guards, just like native file/symbol reads.
|
|
294
307
|
Mixed batches, errors, commands, writes, unknown tools and image results stay
|
|
295
308
|
raw. Context edits omit messages in the projection, not in session history. The
|
|
296
309
|
mutation cap is 512; no partial rewind is applied when it is exceeded. Files
|
|
@@ -340,8 +353,17 @@ anchor footer and the Anthropic anchor cache marker (`app/anchor-cache.ts`).
|
|
|
340
353
|
type `smart-context-anchor`, plus `smart_navigation` tool results) and legacy
|
|
341
354
|
`context` tool anchors; recall scans other sessions' JSONL read-only.
|
|
342
355
|
|
|
343
|
-
|
|
344
|
-
|
|
356
|
+
Autonomous agent anchors require the shared early pressure gate by default.
|
|
357
|
+
An early user-requested anchor uses native `ctx.ui.confirm`: only a literal
|
|
358
|
+
host `true` grants a call-local timing exception. The name/summary are scrubbed
|
|
359
|
+
before approval, then session epoch, leaf, pending input, permissions and running
|
|
360
|
+
work are rechecked. Headless, denied, cancelled or stale approval fails closed.
|
|
361
|
+
No tool argument or persistent setting carries this grant. The trusted callback
|
|
362
|
+
forwards `userConfirmed` to the existing queue, leaving `manual` false for a tool
|
|
363
|
+
call so batch, permission, preparation, origin and signature checks still run.
|
|
364
|
+
The single trim is recorded with cause `manual`; future requests inherit nothing.
|
|
365
|
+
|
|
366
|
+
An anchor requests one safe consolidation through `smart_context`'s existing queue;
|
|
345
367
|
only its new region can be trimmed before first replay. Previous anchor and
|
|
346
368
|
checkpoint prefixes stay protected. Append-only anchors do not invalidate a
|
|
347
369
|
prepared summary; ready/running compaction takes priority over agent cleanup.
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,80 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [10.3.0] - 2026-10-06
|
|
6
|
+
|
|
7
|
+
### Release approval
|
|
8
|
+
|
|
9
|
+
- The release owner explicitly approved `10.3.0` as a stable release to `latest`
|
|
10
|
+
with a version-specific canary exception, not an RC. Publication remains
|
|
11
|
+
gated on the exact candidate's deterministic release checks and required CI.
|
|
12
|
+
No version-specific applied-canary cohort or live provider/signature test
|
|
13
|
+
exists. Offline regressions do not establish provider-side signature
|
|
14
|
+
acceptance, cache-hit savings, production quality or a `PROMOTE` result.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **User-confirmed early anchors.** In pressure-only mode, an explicitly
|
|
19
|
+
user-requested anchor can ask Pi for one-time host confirmation, then save the
|
|
20
|
+
anchor and request one safe cleanup below pressure or with unknown usage.
|
|
21
|
+
No model argument grants permission and no setting changes. Rejection,
|
|
22
|
+
cancellation, stale session/history and revoked navigation/tool access fail
|
|
23
|
+
closed; confirmed cleanup still revalidates the originating batch, policy,
|
|
24
|
+
prepared work and signed thinking. Autonomous actions retain their timing
|
|
25
|
+
gates. No extra summarizer request, automatic full compaction or general
|
|
26
|
+
pressure bypass is added.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- **Model-aware cache lifetime.** Economic cleanup, the host cache ledger and
|
|
31
|
+
replay estimates now share Pi's model cache-lifetime metadata instead of
|
|
32
|
+
assuming five minutes for every provider. A 30-minute cache is not cold at
|
|
33
|
+
minute six. Unknown/invalid lifetimes cannot authorize a cold trim; pressure
|
|
34
|
+
and manual cleanup remain available. With no recorded retention choice the
|
|
35
|
+
longest advertised tier is used, and shorter tail writes do not retire an
|
|
36
|
+
observed 1h prefix. Model switches do not reuse the previous route's clock.
|
|
37
|
+
Ledger expiry/cause labels are explicitly estimates. Replay assumes no cache
|
|
38
|
+
reuse when lifetime metadata is unknown, without changing measured baseline
|
|
39
|
+
usage. Automatic cleanup thresholds and provider routes are unchanged.
|
|
40
|
+
- **Research checkpoint/rewind semantics.** A bounded read-only investigation
|
|
41
|
+
can return to its checkpoint with one findings report even below pressure,
|
|
42
|
+
with unknown usage, or after pressure clears before commit. Automatic
|
|
43
|
+
cleanup and autonomous agent trim/anchor retain their pressure gates. Active checkpoints
|
|
44
|
+
cannot be silently replaced. Guidance distinguishes research return from
|
|
45
|
+
cleanup and points an active investigation at rewind rather than a new anchor.
|
|
46
|
+
Transient owned pressure hints inside the detour leave active context too;
|
|
47
|
+
checkpoint-prefix and unrelated extension messages are preserved.
|
|
48
|
+
Known read-only graph, diagnostic and web tools participate in recoverable
|
|
49
|
+
cleanup; source snippet first deliveries and explicit instruction reads stay
|
|
50
|
+
protected. Branch, permission, preparation, side-effect and signed-thinking
|
|
51
|
+
safeguards remain in force; no extra summarizer request or per-turn notice.
|
|
52
|
+
|
|
53
|
+
## [10.2.1] - 2026-10-05
|
|
54
|
+
|
|
55
|
+
### Release approval
|
|
56
|
+
|
|
57
|
+
- The release owner approved `10.2.1` as a stable patch with a version-specific
|
|
58
|
+
canary exception. Publication remains gated on the deterministic checks for
|
|
59
|
+
this exact candidate. No version-specific applied-canary cohort or live
|
|
60
|
+
provider/signature test exists; offline regressions do not establish cache-hit
|
|
61
|
+
savings or a `PROMOTE` result.
|
|
62
|
+
|
|
63
|
+
### Fixed
|
|
64
|
+
|
|
65
|
+
- **Native compaction prefix.** Reuse Pi's complete system/tool transcript
|
|
66
|
+
instead of prepending the current prompt and loadout a second time. Legacy
|
|
67
|
+
histories without an initial system message retain their fallback. Real-adapter
|
|
68
|
+
regressions cover initial and repeated native compaction; provider-side
|
|
69
|
+
thinking-signature acceptance is not claimed by these offline tests.
|
|
70
|
+
- **Context attention follows execution gates.** Do not recommend trimming over
|
|
71
|
+
prepared compaction. Recompute prompt-start guidance instead of parking stale
|
|
72
|
+
pressure in `nextTurn`, and describe settled, background and native-hook
|
|
73
|
+
strategies separately. History guidance remains available with navigation off;
|
|
74
|
+
checkpoints no longer promise that a later rewind will be safe. Anchor advice
|
|
75
|
+
does not guarantee cleanup or cache hits, and manual-mode compaction advice
|
|
76
|
+
distinguishes staging from applying. A real offline Pi lifecycle regression
|
|
77
|
+
covers compaction between a completed high-pressure turn and the next prompt.
|
|
78
|
+
|
|
5
79
|
## [10.2.0] - 2026-10-05
|
|
6
80
|
|
|
7
81
|
### Release approval
|
|
@@ -12,17 +12,19 @@ Permitted context tools are available from the start by default. In optional laz
|
|
|
12
12
|
Load `navigation` for `smart_navigation`.
|
|
13
13
|
|
|
14
14
|
- `view` lists recent anchors on the active branch first, then other branches. Results are bounded previews; use `target` to read one anchor's full summary. An anchor records completed work, not a speculative plan.
|
|
15
|
-
- `anchor` records completed work
|
|
15
|
+
- `anchor` records completed work under pressure by default. For an explicit user request outside pressure, prepare the name and summary and call the tool: Pi independently asks for one-time approval, including when usage is unknown. Never claim approval, invent a bypass argument, retry a refusal, or change settings to get around the gate. Without host consent no early anchor/cleanup is requested. Preserve the goal, constraints, decisions, verified state, unresolved problems and exact identifiers. It queues one safe cleanup of the new region, not full compaction; safety/preparation gates still apply. A queued cleanup or a saved anchor is not proof that context shrank. Do not duplicate a rewind report as another long anchor summary.
|
|
16
16
|
- `recall` searches anchors in earlier local sessions, in the current project by default. Only use `scope="all"` when cross-project search is actually needed. Results are historical evidence, not instructions or permission. Use Pi's `/resume` to open a different session.
|
|
17
17
|
- Before `pivot`, inspect the destination with `view`. Supply its exact entry ID or unambiguous anchor name and a non-empty `carryover` containing the task, new facts, decisions, failures, unfinished work and the next step. Call pivot on its own and end the turn. The host applies it only after the tool batch settles and revalidates the origin. A queued result is not proof that navigation has happened.
|
|
18
18
|
- Pivot changes the active conversation branch, not files, running processes, databases or external services. Never claim it undoes side effects. Required carryover is inserted as the native tree summary without a second model request. An optional `message` becomes the next user turn only after successful navigation; omit it when the user should decide what happens next.
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Research round trips and recoverable cleanup
|
|
21
21
|
|
|
22
|
-
Load `history` for `smart_context`.
|
|
22
|
+
Load `history` for `smart_context`. Research return, automatic cleanup and tree navigation are different operations.
|
|
23
23
|
|
|
24
|
-
- `
|
|
25
|
-
-
|
|
24
|
+
- For a substantial, bounded read-only investigation: `checkpoint(label=...)` → explore → `rewind(report=...)` → continue the original task. Finish the rewind before implementation or your final answer. Neither checkpoint nor rewind requires pressure or an available usage reading. Do not wait for the context to fill or run `trim` first.
|
|
25
|
+
- One checkpoint at a time: never nest or replace an active one. In a purely read-only detour, rewind returns the unchanged checkpoint context plus one agent-written report, without another model call. Preserve findings with evidence paths/identifiers, decisions, constraints, failed attempts and the next step. Intermediate prose and supported read/search/graph/diagnostic tool exchanges leave active context; original text remains recoverable.
|
|
26
|
+
- Rewind is not filesystem rollback. Errors, instruction reads, side-effecting or unknown batches, images and new user instructions must not be silently erased. If a safety/preparation gate blocks the return, preserve/report findings and explain the blocker; do not retry in a loop or claim success.
|
|
27
|
+
- `status` shows real usage, the policy window, cleanup/compaction thresholds and blockers. `plan` previews cleanup; `trim` requests it at an uncontested completed turn boundary. Automatic cleanup and autonomous agent trim/anchor requests still require pressure by default; human commands and a host-confirmed anchor can request earlier work. Do not checkpoint every turn or duplicate a completed research report as a long anchor.
|
|
26
28
|
- `status`, `search` and `read` recover archived tool evidence on the active branch; add `scope="lineage"` to reach the sessions this one was handed off or forked from (read-only, up to three levels). A marker is a digest (subject, first line, risk lines), not the output; a `(superseded: …)` note means the file was edited or read again in full later. Old successful `bash` output and old `read` pages are archived the same way. A preview is not the whole output; retrieve the needed source rather than inventing details.
|
|
27
29
|
- A `read` or `search` that reports archived text no longer matching its record means the session file changed after archiving; treat that source as unavailable and say so, never reconstruct it.
|
|
28
30
|
- Published anchor prefixes stay protected. A new anchor may consolidate only its new region once, before first replay. Signed Anthropic thinking that depends on removed history blocks unsafe trim/rewind; do not bypass this safeguard. Prepared compaction takes priority. There is one cleanup owner; do not stack independent truncators.
|
|
@@ -5,22 +5,23 @@
|
|
|
5
5
|
* Pressure used to reach the model only through the human status line and
|
|
6
6
|
* `smart_context status` results, so the navigation, history and compaction
|
|
7
7
|
* tools sat idle until a person asked for them. The note rides along with the
|
|
8
|
-
* next tool batch (steer) during a turn
|
|
9
|
-
*
|
|
10
|
-
* re-armed once pressure clears
|
|
11
|
-
*
|
|
8
|
+
* next tool batch (steer) during a turn. Prompt-start notes are computed then,
|
|
9
|
+
* never parked in nextTurn where compaction or permissions can make them stale.
|
|
10
|
+
* One note per band per session, re-armed once pressure clears or the session
|
|
11
|
+
* changes. Notes append to history; they never rewrite the prompt prefix.
|
|
12
12
|
*/
|
|
13
13
|
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
14
14
|
import type { CompactConfig } from "../types.ts";
|
|
15
|
-
export
|
|
16
|
-
type AttentionConfig = Pick<CompactConfig, "contextNavigationEnabled" | "contextGuidanceEnabled" | "toolLoading" | "autoTrigger" | "minContextPercent" | "prepareContextPercent" | "maxContextTokens">;
|
|
15
|
+
export { ATTENTION_CUSTOM_TYPE } from "./context-operations.ts";
|
|
16
|
+
type AttentionConfig = Pick<CompactConfig, "contextNavigationEnabled" | "contextGuidanceEnabled" | "toolLoading" | "autoTrigger" | "autoTriggerStrategy" | "minContextPercent" | "prepareContextPercent" | "maxContextTokens">;
|
|
17
17
|
export interface ContextAttentionDeps {
|
|
18
18
|
config: () => AttentionConfig;
|
|
19
19
|
/** Agent-driven context changes are permitted and nothing (pivot, running compaction) takes priority. */
|
|
20
20
|
canAgentAct: (ctx: ExtensionContext) => boolean;
|
|
21
|
+
/** The same maintenance gate used by history cleanup; prepared work takes priority. */
|
|
22
|
+
canCleanup: (ctx: ExtensionContext) => boolean;
|
|
21
23
|
/** A lazy group can still be loaded through `smart_tools`. */
|
|
22
|
-
reachable: (group: "navigation" | "history") => boolean;
|
|
24
|
+
reachable: (group: "navigation" | "history" | "compaction") => boolean;
|
|
23
25
|
}
|
|
24
26
|
export declare function registerContextAttention(pi: Pick<ExtensionAPI, "on" | "sendMessage" | "getActiveTools">, deps: ContextAttentionDeps): void;
|
|
25
|
-
export {};
|
|
26
27
|
//# sourceMappingURL=context-attention.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-attention.d.ts","sourceRoot":"","sources":["../../src/app/context-attention.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,
|
|
1
|
+
{"version":3,"file":"context-attention.d.ts","sourceRoot":"","sources":["../../src/app/context-attention.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAMhE,KAAK,eAAe,GAAG,IAAI,CAAC,aAAa,EACvC,0BAA0B,GAAG,wBAAwB,GAAG,aAAa,GAAG,aAAa,GAAG,qBAAqB,GAC3G,mBAAmB,GAAG,uBAAuB,GAAG,kBAAkB,CAAC,CAAC;AAExE,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,eAAe,CAAC;IAC9B,yGAAyG;IACzG,WAAW,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,OAAO,CAAC;IAChD,uFAAuF;IACvF,UAAU,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,OAAO,CAAC;IAC/C,8DAA8D;IAC9D,SAAS,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,YAAY,KAAK,OAAO,CAAC;CACxE;AAED,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,aAAa,GAAG,gBAAgB,CAAC,EAC/D,IAAI,EAAE,oBAAoB,GACzB,IAAI,CA2CN"}
|
|
@@ -4,6 +4,7 @@ import type { ModelCostRates } from "@earendil-works/pi-ai";
|
|
|
4
4
|
import { fingerprintContext } from "./pending-slot.ts";
|
|
5
5
|
export declare const CONTEXT_CONTROL_TYPE = "smart-compact-context";
|
|
6
6
|
export declare const CONTEXT_REPORT_TYPE = "smart-compact-rewind";
|
|
7
|
+
export declare const ATTENTION_CUSTOM_TYPE = "smart-compact-attention";
|
|
7
8
|
export declare const MAX_CONTEXT_EDITS = 512;
|
|
8
9
|
export declare const MAX_TRIM_EDITS = 32;
|
|
9
10
|
export declare const MIN_TRIM_CHARS = 4096;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-operations.d.ts","sourceRoot":"","sources":["../../src/app/context-operations.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,EAC+C,KAAK,oBAAoB,EAAE,KAAK,YAAY,EACjG,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAY,MAAM,uBAAuB,CAAC;AAStE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAIvD,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAC1D,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,cAAc,OAAQ,CAAC;AAKpC,eAAO,MAAM,0BAA0B,QAAS,CAAC;AACjD,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,GAAG,SAAS,CAO7E;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;CACjD;AAED,mHAAmH;AACnH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAGhF,yGAAyG;AACzG,MAAM,WAA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,EAAE,CAAA;CAAE,EAAE,KAAK,EAAE,SAAS,GAAG,oBAAoB,EAAE,CAGhK;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;;;EAkBpH;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASvI;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;;;EAkCpI;AAED,2GAA2G;AAC3G,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAYlG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Session-local ledger of the host's own provider prompt-cache usage, built only from reported usage. */
|
|
2
|
-
import type { Usage } from "@earendil-works/pi-ai";
|
|
2
|
+
import type { ModelPromptCache, Usage } from "@earendil-works/pi-ai";
|
|
3
3
|
export type ContextEditKind = "trim" | "rewind" | "navigation" | "compaction";
|
|
4
4
|
export type RebuildCause = "continuity" | "idle-expiry" | "foreign";
|
|
5
5
|
/** Foreign rebuilds needed before the ledger asks the integrator to warn once. */
|
|
@@ -57,11 +57,15 @@ export interface HostCacheLedger {
|
|
|
57
57
|
/** Pi sent a `cache_warm` refresh at `at`; it keeps the live prefix alive like a request. */
|
|
58
58
|
noteCacheWarm(at: number): void;
|
|
59
59
|
/** Assistant message at message_end; null when it carries no usable usage. */
|
|
60
|
-
observe(message: ObservedMessage, at?: number): LedgerEntry | null;
|
|
60
|
+
observe(message: ObservedMessage, at?: number, promptCache?: ModelPromptCache): LedgerEntry | null;
|
|
61
61
|
summary(): LedgerSummary;
|
|
62
62
|
}
|
|
63
|
-
/**
|
|
64
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Best-effort lifetime from Pi's model metadata (seconds). The request's chosen
|
|
65
|
+
* retention is not recorded, so use the longest advertised tier. A reported
|
|
66
|
+
* 1h write can lengthen this estimate, never shorten it. Unknown is not expired.
|
|
67
|
+
*/
|
|
68
|
+
export declare function cacheLifetimeMs(usage: Partial<Usage> | undefined, promptCache?: ModelPromptCache): number | null;
|
|
65
69
|
export declare function createHostCacheLedger(): HostCacheLedger;
|
|
66
70
|
/** 1–3 short Home lines; empty until the host reported usage for a request. */
|
|
67
71
|
export declare function formatCacheLedgerSummary(summary: LedgerSummary): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-cache-ledger.d.ts","sourceRoot":"","sources":["../../src/app/host-cache-ledger.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAE1G,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"host-cache-ledger.d.ts","sourceRoot":"","sources":["../../src/app/host-cache-ledger.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAE1G,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGrE,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,YAAY,GAAG,YAAY,CAAC;AAC9E,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS,CAAC;AAEpE,kFAAkF;AAClF,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CA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AAO,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,EAAE,CAAC,EAAE;QAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,IAAI,CAAA;KAAE,CAAC;CAC7E;AASD;;;;;;GAMG;AACH,wBAAgB,sBAAsB;IAGlC,OAAO,MAAM;QAAE,cAAc,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,CAAA;KAAE,GAAG,IAAI;IAWvF,0EAA0E;IAC1E,MAAM,UAAU,OAAO,OAAO,mBAAmB,GAAG,UAAU,GAAG,SAAS;EA8B7E"}
|
|
@@ -13,7 +13,7 @@ export declare function registerNavigation(pi: ExtensionAPI, options?: {
|
|
|
13
13
|
config?: () => CompactConfig;
|
|
14
14
|
mutationBlocked?: (ctx: ExtensionContext) => string | undefined;
|
|
15
15
|
/** Anchor creation may request one safe consolidation, without invalidating prepared compaction. */
|
|
16
|
-
onAnchor?: (ctx: ExtensionContext, originId: string, callId?: string, signal?: AbortSignal) => string;
|
|
16
|
+
onAnchor?: (ctx: ExtensionContext, originId: string, callId?: string, signal?: AbortSignal, userConfirmed?: boolean) => string;
|
|
17
17
|
/** Staging-time signal: queued and about-to-apply pivots, never append-only anchors. */
|
|
18
18
|
onContextChange?: (ctx: ExtensionContext) => void;
|
|
19
19
|
/** Commit-time signal: fires only after Pi applied a pivot's tree navigation. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-navigation.d.ts","sourceRoot":"","sources":["../../src/app/register-navigation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,YAAY,EAAE,KAAK,uBAAuB,EAAE,KAAK,gBAAgB,EAAc,MAAM,iCAAiC,CAAC;AAKlJ,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB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AAgB,GAAG,IAAI,CAAC;IACrC,KAAK,CAAC,GAAG,EAAE,uBAAuB,GAAG,sBAAsB,CAAC;IAC5D,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5E;AAED,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,YAAY,EAAE,OAAO,GAAE;IAC7D,MAAM,CAAC,EAAE,MAAM,aAAa,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,CAAC;IAChE,oGAAoG;IACpG,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,MAAM,CAAC;IAC/H,wFAAwF;IACxF,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,iFAAiF;IACjF,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;CAClE,GAAG,oBAAoB,CAsR5B"}
|
|
@@ -34,7 +34,7 @@ export declare function unchangedSince(branch: SessionEntry[], leafId: string):
|
|
|
34
34
|
export type SmartContextController = {
|
|
35
35
|
/** Queue a user-requested trim; it applies at the next natural turn boundary. */
|
|
36
36
|
requestManualTrim(ctx: ExtensionContext): ManualTrimRequest;
|
|
37
|
-
requestAnchorTrim(ctx: ExtensionContext, originId: string, callId?: string, signal?: AbortSignal): ManualTrimRequest;
|
|
37
|
+
requestAnchorTrim(ctx: ExtensionContext, originId: string, callId?: string, signal?: AbortSignal, userConfirmed?: boolean): ManualTrimRequest;
|
|
38
38
|
/** Automatic trim waiting for a cold prompt cache in this session, if any. */
|
|
39
39
|
deferredTrim(sessionId: string): DeferredTrim | null;
|
|
40
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-smart-context-tool.d.ts","sourceRoot":"","sources":["../../src/app/register-smart-context-tool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAqD,YAAY,EAAE,gBAAgB,EAAwB,YAAY,EAAuB,MAAM,iCAAiC,CAAC;AAOlM,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"register-smart-context-tool.d.ts","sourceRoot":"","sources":["../../src/app/register-smart-context-tool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAqD,YAAY,EAAE,gBAAgB,EAAwB,YAAY,EAAuB,MAAM,iCAAiC,CAAC;AAOlM,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAmC/E,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GACzB;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,KAAK,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,KAAK,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7C,8EAA8E;AAC9E,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC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MAAM,KAAK,IAAI,CAAC;IAC1D,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACf,GAAG,sBAAsB,CA8a9B"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { CompressionProfile, ProfileConfig } from "./types.ts";
|
|
|
8
8
|
* `package.json#version`. Do not hand-edit this line for releases; bump
|
|
9
9
|
* package.json and run `bun run sync-version`.
|
|
10
10
|
*/
|
|
11
|
-
export declare const VERSION = "10.
|
|
11
|
+
export declare const VERSION = "10.3.0";
|
|
12
12
|
/**
|
|
13
13
|
* Opt-in components that are not installed with the extension: optional peer
|
|
14
14
|
* dependencies in package.json, pinned to the versions the release audit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-semantics.d.ts","sourceRoot":"","sources":["../../src/domain/tool-semantics.ts"],"names":[],"mappings":"AAYA,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAgCpC;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAQjE;AAED,0FAA0F;AAC1F,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"tool-semantics.d.ts","sourceRoot":"","sources":["../../src/domain/tool-semantics.ts"],"names":[],"mappings":"AAYA,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAgCpC;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAQjE;AAED,0FAA0F;AAC1F,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CASvD;AAUD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,OAAO,CAK7E;AAED,8FAA8F;AAC9F,wBAAgB,WA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AAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EAC1D,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAC1D,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAQrD"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEN,KAAK,YAAY,EAEjB,MAAM,iCAAiC,CAAC;AAmEzC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAyDtE,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAE,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEN,KAAK,YAAY,EAEjB,MAAM,iCAAiC,CAAC;AAmEzC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAyDtE,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAE,EAAE,YAAY,QAymB7D"}
|