billion-context-pi-lean 0.1.83-lean.10 → 0.2.1

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.
@@ -26,11 +26,7 @@ export interface AcpNudgeRecord {
26
26
  * acp-rule reports)
27
27
  * (Pi-native projection semantics, session-manager.d.ts). The non-empty gate
28
28
  * uses the exact same extractText check as the projection below, so an entry
29
- * either enters context or it doesn't — and only entries that enter context
30
- * can delimit a turn (#364 acceptance c: empty control signals start none).
31
- * Shared by the turn-boundary predicate in src/turn-boundary.ts so the two
32
- * views can never drift apart; defined here (not there) because it needs
33
- * extractText — importing that back would create a cycle. */
29
+ * either enters context or it doesn't. */
34
30
  export declare function isCustomMessageEntry(entry: TurnBoundaryEntry): entry is TurnBoundaryEntry & {
35
31
  type: "custom_message";
36
32
  };
@@ -64,10 +60,7 @@ export declare class EntryProjectionCache {
64
60
  export declare function extractText(content: unknown): string;
65
61
  export declare function thinkingTokenCount(content: unknown): number;
66
62
  export declare function countImageBlocks(content: unknown): number;
67
- export declare function messageIdentity(message: unknown): string;
68
- export declare function messageRef(message: unknown): string | undefined;
69
63
  export declare const TRUNCATION_MARKER = "[truncated for context space]";
70
- export declare function matchesStoredText(stored: string, visible: string): boolean;
71
64
  export declare function coreOutToAgentMessages(coreOut: CoreMessage[], originalById: Map<string, AgentMessage>): AgentMessage[];
72
65
  export interface LatestUserGuardResult {
73
66
  messages: CoreMessage[];
@@ -1,7 +1,7 @@
1
1
  import type { SessionMessageEntry } from "@earendil-works/pi-coding-agent";
2
2
  type AgentMessage = SessionMessageEntry["message"];
3
3
  /** [#336] Config for dropping oversized reasoning (thinking) parts from
4
- * historical `compress` tool calls — exact alignment with opencode-acp #377.
4
+ * historical `compress` tool calls.
5
5
  * `compress` calls are hard-exempt from compression (their tool results are
6
6
  * the anchors that keep block summaries addressable), so their thinking
7
7
  * rides along every request as an unreclaimable context floor. This pass
@@ -42,7 +42,7 @@ export declare function isStrictReasoningEcho(provider?: string, baseUrl?: strin
42
42
  * no `thinking` parts, so the pass would be a no-op regardless. */
43
43
  export declare function applyStrictReasoningGate(cfg: Required<CompressReasoningConfig>, provider?: string, baseUrl?: string): Required<CompressReasoningConfig>;
44
44
  export declare function countThinkingChars(messages: AgentMessage[]): number;
45
- /** Request-time pass aligned with opencode-acp #377: remove `thinking` parts
45
+ /** Request-time pass: remove `thinking` parts
46
46
  * from a message only when ALL gates hold —
47
47
  * 1. closed round [#348]: EVERY `compress` toolCall in the message has its
48
48
  * tool-result message (role `toolResult`, matching `toolCallId`) at a
package/dist/runtime.d.ts CHANGED
@@ -7,35 +7,17 @@ import { entriesToCoreMessages } from "./messages.js";
7
7
  import { SessionStateStore } from "./state.js";
8
8
  import { ThrottleEpisode } from "./throttle-retry.js";
9
9
  import { OverflowEpisode } from "./overflow-selfheal.js";
10
- import { type TurnBoundaryPolicy } from "./turn-boundary.js";
11
10
  type AgentMessage = SessionMessageEntry["message"];
12
- export declare function readContextEntries(sm: ExtensionContext["sessionManager"]): SessionEntry[];
13
- export declare function isPiHost(sm: ExtensionContext["sessionManager"]): boolean;
14
- /** #453: key for the compress-retry circuit breaker, derived from PERSISTED
15
- * entries only. Live-merged tail ids (content-addressed since #459) can still
16
- * churn when the host's view of a not-yet-persisted message drifts, so a
17
- * breaker keyed on the merged view could reset failCount mid-episode (#452
18
- * log: cap → inject loop). Persisted entry ids are immutable; this key
19
- * changes only when a genuine new user message reaches the session log.
20
- * pi-native hosts see no change. */
21
- export declare function retryBreakerKey(sm: ExtensionContext["sessionManager"], policy?: TurnBoundaryPolicy): string | undefined;
22
- /** Minimal identity of a session for state operations that don't need a live
23
- * ExtensionContext (hosts deriving inline child sessions build these from
24
- * whatever session handles they hold). */
25
- export interface SessionRef {
26
- sessionId: string;
27
- sessionFile?: string;
28
- }
29
11
  export interface AcpRuntime {
30
12
  core: CompressionCore;
31
- /** Set when the host is unsupported (currently: OMP / oh-my-pi) or when the
32
- * model's baseUrl routes through the billion-context wire proxy (#296).
13
+ /** Set when the model's traffic routes through the billion-context wire
14
+ * proxy (#296), which then owns compression.
33
15
  * Once true, the extension stands down: the context transform, system-prompt
34
16
  * injection, compaction-cancel and ACP tools all no-op so the host runs
35
17
  * untouched. Set at session_start (first context event as fallback). */
36
18
  refused: boolean;
37
- /** User-facing reason shown when a refused ACP tool is invoked; null means
38
- * the default OMP refusal text applies. Set together with `refused`. */
19
+ /** User-facing reason shown when a refused ACP tool is invoked. Set
20
+ * together with `refused`. */
39
21
  refusalMessage: string | null;
40
22
  /** Per-session provider-throttle retry episode (attempt budget + kick
41
23
  * pacing), keyed by session id so concurrent sessions in one extension
@@ -71,9 +53,7 @@ export interface AcpRuntime {
71
53
  nudgeRecordedFor(sid: string, turnKey: string): boolean;
72
54
  /** Process compress toolResults for the CURRENT user turn only (the caller
73
55
  * scopes the list — see collectCompressOutcomes in src/index.ts); idempotent
74
- * per toolCallId. turnKey MUST be the stable persisted-boundary key
75
- * (retryBreakerKey) — a key derived from live-merged entries churns under
76
- * fork hosts and resets the counter mid-episode (#453). Outcome classes:
56
+ * per toolCallId. turnKey is the last user-turn boundary. Outcome classes:
77
57
  * isError or noop (0-block panel) → failure (count++), success panel
78
58
  * (>= 1 block) → reset, other non-error text → neutral (count unchanged).
79
59
  * Returns the failure count and whether the cap was just reached. */
@@ -108,7 +88,7 @@ export interface AcpRuntime {
108
88
  * config when the contents change. Cheap no-op when unchanged. Called at
109
89
  * session_start and on every context event so config edits apply live. */
110
90
  reloadConfig(cwd: string): Promise<void>;
111
- stateFor(ctx: ExtensionContext, liveMessages?: AgentMessage[]): Promise<{
91
+ stateFor(ctx: ExtensionContext): Promise<{
112
92
  state: CompressionState;
113
93
  coreMessages: ReturnType<typeof entriesToCoreMessages>;
114
94
  entries: SessionEntry[];
@@ -129,16 +109,6 @@ export interface AcpRuntime {
129
109
  * holds the full projected CoreMessage[] for the session history. */
130
110
  dropProjectionCache(sid: string): void;
131
111
  save(state: CompressionState, ctx: ExtensionContext): Promise<void>;
132
- /** #364 inline child sessions (same process, e.g. Prime RLM): derive the
133
- * child's compression state from another session's. Inherits blocks /
134
- * message refs / token snapshot so decompress + search_context keep working
135
- * on inherited blocks; resets every rhythm ledger (nudge cadence, stats,
136
- * absorb). One-time: writes a derivation marker into the child sidecar and
137
- * refuses to run again; also refuses when the child already owns real
138
- * (non-derived) blocks or when the parent has no blocks. Separate-process
139
- * pi-native delegates must NOT call this — their parentSession header
140
- * already inherits verbatim. Returns true when the child state was derived. */
141
- deriveChildState(child: SessionRef, parent: SessionRef): Promise<boolean>;
142
112
  acquireLock(sid: string): Promise<() => void>;
143
113
  /** Per-session overflow self-heal state (learned window + armed emergency).
144
114
  * Keyed by session id so concurrent sessions cannot share an episode. */
@@ -2,22 +2,11 @@ import type { SessionEntry } from "@earendil-works/pi-coding-agent";
2
2
  /** Parse a session jsonl into entries — mirrors pi's own loadEntriesFromFile
3
3
  * (JSON.parse per line; blank and malformed lines skipped). */
4
4
  export declare function parseSessionLog(text: string): SessionEntry[];
5
- /** Read-only lookup of entries in ANCESTOR sessions (issue #531): a derived
6
- * child session (Prime RLM inline) inherits blocks whose message ids exist
7
- * only in the parent's session log, so decompress must fall back up the
8
- * parentSession header chain. Walks upward from `sessionFile` (nearest
5
+ /** Read-only lookup of entries in ANCESTOR sessions (issue #531): a session
6
+ * that inherited its parent's blocks through the parentSession header can
7
+ * cover message ids that exist only in the parent's session log, so
8
+ * decompress must fall back up the parentSession header chain. Walks upward from `sessionFile` (nearest
9
9
  * ancestor first), cycle-safe and depth-capped like state inheritance, and
10
10
  * returns entries whose base id is in `wantedBaseIds`. The starting session
11
11
  * itself is never included; nearest-ancestor entries win on duplicate ids. */
12
12
  export declare function loadAncestorEntries(sessionFile: string | undefined, wantedBaseIds: Set<string>): Promise<SessionEntry[]>;
13
- /** Read-only content recovery for content-addressed `live-*` refs (issue
14
- * #579): fork hosts alias not-yet-persisted tail messages with `live-*` ids
15
- * (runtime.ts mergeLiveEntries); those aliases appear in NO jsonl, so the
16
- * entry-id lookup above can never find them. The rawId→identity bridge lives
17
- * in each session's OWN sidecar (liveRefOrigins). Walks the chain — itself
18
- * first, then ancestors, same depth/cycle rules as loadAncestorEntries — and
19
- * at each level pairs that level's declared origins with that same level's
20
- * log entries matched by messageIdentity. First matching entry wins per rawId
21
- * (identical identities are interchangeable: identity covers full normalized
22
- * content). Never writes any sidecar. */
23
- export declare function loadLiveRefEntries(sessionFile: string | undefined, wantedRawIds: Set<string>): Promise<Map<string, SessionEntry>>;
package/dist/state.d.ts CHANGED
@@ -1,16 +1,5 @@
1
1
  import { type CompressionState } from "acp-kernel";
2
2
  export declare const STATE_SUFFIX = ".acp.json";
3
- export interface LiveRefOrigin {
4
- rawId: string;
5
- identity: string;
6
- }
7
- /** One-time marker persisted in a child sidecar when deriveChildState ran
8
- * (#364): proves this session's state was explicitly derived from a parent,
9
- * so later loads never re-derive. */
10
- export interface DerivedFrom {
11
- parentSessionId: string;
12
- derivedAt: number;
13
- }
14
3
  export declare function readParentSessionPath(sessionFile: string): Promise<string | undefined>;
15
4
  export declare class SessionStateStore {
16
5
  private cache;
@@ -22,23 +11,6 @@ export declare class SessionStateStore {
22
11
  setActivePack(sessionFile: string | undefined, sessionId: string, activePack: string): void;
23
12
  getActivePack(sessionFile: string | undefined, sessionId: string): string | undefined;
24
13
  save(state: CompressionState, sessionFile: string | undefined, sessionId: string): Promise<void>;
25
- getLiveRefOrigins(sessionFile: string | undefined, sessionId: string): LiveRefOrigin[];
26
- setLiveRefOrigins(sessionFile: string | undefined, sessionId: string, origins: LiveRefOrigin[]): void;
27
- getDerivedFrom(sessionFile: string | undefined, sessionId: string): DerivedFrom | null;
28
- setDerivedFrom(sessionFile: string | undefined, sessionId: string, mark: DerivedFrom | null): void;
29
14
  invalidate(): void;
30
15
  private tryLoadParentState;
31
16
  }
32
- /** #364: derive an INLINE child session's compression state from its parent's
33
- * (same-process sub-sessions, e.g. Prime RLM). Inherits exactly what makes
34
- * inherited blocks usable — blocks (deep-copied: they carry mutable fields),
35
- * message refs, the per-message token snapshot, the id counters so new
36
- * child blocks cannot collide with inherited ids, and the persistent
37
- * acp_rule reminders (kernel cloneState precedent: never silently drop
38
- * model-set rules) — and resets every rhythm ledger (nudge cadence
39
- * baseline, stats counters, absorb records) so the
40
- * child starts its own clock. Separate-process pi-native delegates must NOT
41
- * use this: their session files carry a parentSession header that already
42
- * inherits the parent state verbatim. */
43
- export declare function deriveChildState(parent: CompressionState): CompressionState;
44
- export declare function parseLiveRefOrigins(value: unknown): LiveRefOrigin[];
@@ -1,9 +1,5 @@
1
1
  import { type ExtensionAPI, type ToolResultEvent } from "@earendil-works/pi-coding-agent";
2
2
  import type { AcpRuntime } from "./runtime.js";
3
- export type BashToolResultEvent = Extract<ToolResultEvent, {
4
- toolName: "bash";
5
- }>;
6
- export declare function isBashToolResult(e: ToolResultEvent): e is BashToolResultEvent;
7
3
  export declare function resolveBashTimeout(input: {
8
4
  timeout?: number;
9
5
  }, defaultTimeout: number | undefined): number | undefined;
@@ -1,13 +1,6 @@
1
- /** Single source of truth for turn-boundary decisions (#364).
2
- *
3
- * "What counts as a new-turn start" used to be decided independently in three
4
- * places (per-turn token estimation, turnKey scoping, context-entry
5
- * projection) and disagreed on host-injected custom_message entries: they
6
- * enter LLM context but started no turn, so multiple real turns collapsed
7
- * into one turnKey — nudge ledger cells misaligned, retry-cap and throttle
8
- * cycle stats distorted, reasoning-drop closing against the wrong turn.
9
- * Every turn-boundary check in the adapter goes through isTurnBoundary.
10
- */
1
+ /** Single source of truth for turn-boundary decisions (#364): per-turn token
2
+ * estimation, turnKey scoping and compress-outcome scoping all ask the same
3
+ * question. A turn starts at a genuine user-role message. */
11
4
  /** Minimal structural shape of a session-log entry for boundary checks. Pi's
12
5
  * SessionEntry and the narrower arrays used by token accounting both satisfy
13
6
  * it without casts. */
@@ -20,34 +13,12 @@ export interface TurnBoundaryEntry {
20
13
  role?: string;
21
14
  };
22
15
  }
23
- /** Host multi-session policy (#364). Unset/false = pi-native behavior: only
24
- * genuine user-role messages start a turn. Inline multi-session hosts (Prime
25
- * RLM & co.) inject agent turns as custom_message entries; set
26
- * countCustomMessages to make those delimit turns too. Default-off keeps
27
- * standalone pi users' nudge cadence unchanged. */
28
- export interface TurnBoundaryPolicy {
29
- countCustomMessages?: boolean;
30
- /** #578: optional customType allowlist refining countCustomMessages. When
31
- * set, only injected entries whose customType is listed delimit turns —
32
- * host metadata injections (harness_digest, ipython_state, …) that enter
33
- * LLM context without being a real host turn stay out of turn accounting.
34
- * Unset = every non-empty injected message counts (pre-#578 behavior).
35
- * Entries without a customType never match; UI-only types stay excluded
36
- * even when listed. Ignored unless countCustomMessages is true. */
37
- customMessageTypes?: readonly string[];
38
- }
39
- /** The ONE turn-boundary predicate (#364): does this entry start a new turn?
40
- * Genuine user-role messages always do (pi-native); host-injected
41
- * custom_message entries do only when the host opts in via policy, optionally
42
- * refined by a customMessageTypes allowlist so metadata injections
43
- * (harness_digest, ipython_state) stay out of turn accounting (#578). */
44
- export declare function isTurnBoundary(entry: TurnBoundaryEntry, policy?: TurnBoundaryPolicy): boolean;
16
+ /** Does this entry start a new turn? */
17
+ export declare function isTurnBoundary(entry: TurnBoundaryEntry): boolean;
45
18
  /** Id of the last turn-boundary entry — the per-turn key for nudge
46
- * accounting, retry caps and outcome scoping. Defaults to pi-native
47
- * boundaries (user-role only); pass a host policy to also count injected
48
- * custom_message entries. Returns undefined when no boundary exists yet. */
49
- export declare function lastTurnBoundaryId(entries: readonly TurnBoundaryEntry[], policy?: TurnBoundaryPolicy): string | undefined;
19
+ * accounting, retry caps and outcome scoping. Returns undefined when no
20
+ * boundary exists yet. */
21
+ export declare function lastTurnBoundaryId(entries: readonly TurnBoundaryEntry[]): string | undefined;
50
22
  /** Index of the last turn-boundary entry — the start of the current turn for
51
- * compress-outcome scoping. Same policy semantics as lastTurnBoundaryId;
52
- * -1 when no boundary has been seen yet. */
53
- export declare function lastTurnBoundaryIndex(entries: readonly TurnBoundaryEntry[], policy?: TurnBoundaryPolicy): number;
23
+ * compress-outcome scoping; -1 when no boundary has been seen yet. */
24
+ export declare function lastTurnBoundaryIndex(entries: readonly TurnBoundaryEntry[]): number;
@@ -1,16 +1,16 @@
1
1
  import type { Prompts } from "acp-kernel";
2
- import type { AdapterConfig, CompressConfig, HostSessionConfig, RepetitionGuardConfig } from "./config.js";
2
+ import type { AdapterConfig, CompressConfig, RepetitionGuardConfig } from "./config.js";
3
3
  import type { PiPromptSections } from "./system-prompt.js";
4
4
  import type { NudgeSectionsConfig, ToolPromptsConfig } from "./surface.js";
5
5
  import type { DegenerationGuardConfig } from "./degeneration.js";
6
6
  import type { ThrottleRetryConfig } from "./throttle-retry.js";
7
+ import type { IdleCompactConfig } from "./idle-compact.js";
7
8
  /** User-facing config keys (subset of AdapterConfig). Loaded from
8
9
  * ~/.<CONFIG_DIR_NAME>/acp.json (global) and <cwd>/.<CONFIG_DIR_NAME>/acp.json
9
10
  * (project-local overrides project-global). Project wins over global. */
10
11
  export interface UserAcpConfig {
11
12
  enabled?: boolean;
12
13
  debug?: boolean;
13
- autoUpdate?: boolean;
14
14
  modelContextLimit?: number;
15
15
  protectedTools?: string[];
16
16
  protectedLatestTools?: string[];
@@ -21,6 +21,7 @@ export interface UserAcpConfig {
21
21
  compress?: CompressConfig;
22
22
  outputHeadroomMaxPct?: number | string;
23
23
  throttleRetry?: boolean | ThrottleRetryConfig;
24
+ idleCompact?: boolean | IdleCompactConfig;
24
25
  repetitionGuard?: boolean | RepetitionGuardConfig;
25
26
  degenerationGuard?: boolean | DegenerationGuardConfig;
26
27
  prompts?: Partial<Prompts>;
@@ -28,7 +29,6 @@ export interface UserAcpConfig {
28
29
  promptSections?: PiPromptSections;
29
30
  nudgeSections?: NudgeSectionsConfig;
30
31
  toolPrompts?: ToolPromptsConfig;
31
- hostSession?: boolean | HostSessionConfig;
32
32
  rules?: boolean;
33
33
  compressionModelId?: string;
34
34
  }
@@ -59,3 +59,8 @@ export declare function applyUserConfig(adapter: AdapterConfig, user: UserAcpCon
59
59
  * acp.json still overrides the global value. A present-but-unparseable file
60
60
  * is never overwritten. */
61
61
  export declare function saveCompressionModelId(value: string | null): Promise<void>;
62
+ /** Read-modify-write the GLOBAL acp.json, keeping every key the mutator does
63
+ * not touch. A present-but-unparseable file is never overwritten. Calls are
64
+ * serialized so quick successive changes (settings panel) never read the same
65
+ * old snapshot and drop each other. */
66
+ export declare function updateGlobalAcpConfig(mutate: (current: Record<string, unknown>) => void): Promise<void>;
package/lean/index.ts CHANGED
@@ -29,7 +29,7 @@ function decorateWithCollapsedDisplay<T extends CollapsedDisplayTool>(tool: T):
29
29
 
30
30
  // Resident rules only: what the model must know before any ACP call. Guidance
31
31
  // needed after a call already arrives with it — nudges (what/how to compress),
32
- // compress errors (live refs, acp_status), decompress results (file path),
32
+ // compress errors (valid refs, acp_status), decompress results (file path),
33
33
  // the throttle retry message, acp_context help and arg errors. The op
34
34
  // signatures stay: without them models pass compress-style startId/endId.
35
35
  const LEAN_SYSTEM_PROMPT = `ACP context management
@@ -322,7 +322,7 @@ function facadeTool(tools: Map<string, CapturedTool>): ToolDefinition<typeof FAC
322
322
  }
323
323
 
324
324
  export function createLeanAcpExtension(
325
- upstream: UpstreamExtension = createAcpExtension({ autoUpdate: false, externalSystemPrompt: true }),
325
+ upstream: UpstreamExtension = createAcpExtension({ externalSystemPrompt: true }),
326
326
  ): (pi: ExtensionAPI) => void {
327
327
  return (pi: ExtensionAPI): void => {
328
328
  const tools = new Map<string, CapturedTool>();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "billion-context-pi-lean",
3
- "version": "0.1.83-lean.10",
3
+ "version": "0.2.1",
4
4
  "description": "Lean fork of billion-context-pi for Pi: long-session context compression with an optional cheap summary model — 486 initialization tokens, 94% fewer than the original.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -79,6 +79,7 @@
79
79
  "@earendil-works/pi-tui": "0.83.0",
80
80
  "@types/node": "^26.1.2",
81
81
  "acp-kernel": "0.0.101",
82
+ "billion-context-pi": "0.1.83",
82
83
  "tsup": "^8.5.1",
83
84
  "tsx": "^4.23.1",
84
85
  "typescript": "^7.0.2"
package/dist/compat.d.ts DELETED
@@ -1,23 +0,0 @@
1
- import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
2
- /**
3
- * Host compatibility layer for pi vs omp (oh-my-pi) API differences.
4
- *
5
- * pi: systemPrompt is string, getSystemPrompt() returns string
6
- * omp: systemPrompt is string[], getSystemPrompt() returns string[]
7
- *
8
- * These helpers normalize the differences so the rest of the codebase
9
- * can work with a consistent string interface.
10
- */
11
- /** Normalize systemPrompt to a single string (join with newlines if array). */
12
- export declare function normalizeSystemPrompt(input: string | string[] | undefined): string;
13
- /**
14
- * Format systemPrompt for before_agent_start event handler.
15
- * Always returns string to satisfy pi's type definition, but handles
16
- * both string (pi) and string[] (omp) input types at runtime.
17
- */
18
- export declare function formatSystemPromptForEvent(base: string | string[], append: string): string;
19
- /**
20
- * Get the system prompt as a single string, regardless of host type.
21
- * Handles both pi (string) and omp (string[]) return types.
22
- */
23
- export declare function getSystemPromptText(ctx: ExtensionContext): string;
package/dist/host.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
2
- /** Which session-entry source API the host exposes (same precedence as readContextEntries). */
3
- export type EntrySourceKind = "buildContextEntries" | "getBranch";
4
- export declare function entrySourceOf(sm: ExtensionContext["sessionManager"]): EntrySourceKind | null;
5
- /**
6
- * Whether the host declared itself a Pi-compatible fork via environment.
7
- *
8
- * The SessionManager shape alone cannot distinguish e.g. Prime from OMP — both are
9
- * Pi forks exposing `getBranch()` but not `buildContextEntries()` — so an
10
- * unsupported shape requires an explicit declaration before the adapter runs.
11
- * Read at call time so hosts can set it per-launch. See docs/host-adapter.md.
12
- */
13
- export declare function isDeclaredForkHost(): boolean;
14
- /** Unsupported host: not Pi-shaped and not declared as a fork. OMP stays blocked by default. */
15
- export declare function isUnsupportedHost(sm: ExtensionContext["sessionManager"]): boolean;
package/dist/omp.d.ts DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Shown (and logged) when the extension detects an unsupported host and stands down.
3
- *
4
- * Unsupported = no Pi `buildContextEntries()` API AND no `PI_ACP_FORK_HOST` declaration
5
- * (see ./host.ts). OMP (oh-my-pi) falls into this by default: its in-process live-entries
6
- * integration diverges the nudge's example refs from the session's real refs, so compress
7
- * calls fail with "does not exist in this session" ([#234]). The billion-context proxy runs
8
- * compression server-side (it owns the ref coordinate space) and works on OMP.
9
- */
10
- export declare const UNSUPPORTED_HOST_MESSAGE: string;
11
- /**
12
- * Shown (and logged) when a session runs on a host that declared itself a
13
- * Pi-compatible fork via PI_ACP_FORK_HOST (see ./host.ts). Live-tail refs are
14
- * content-addressed and stable across context fires (#459), which assumes the
15
- * host's view of the session grows append-only; a host that rewrites or
16
- * shrinks in-flight messages can still drift refs, so long sessions on such
17
- * hosts are safer on the proxy (it owns the ref coordinate space server-side).
18
- */
19
- export declare const FORK_HOST_WARNING_MESSAGE: string;
@@ -1,7 +0,0 @@
1
- export interface MatchRange {
2
- candidateStart: number;
3
- liveStart: number;
4
- length: number;
5
- }
6
- export declare function findUniqueLongestRun<Key>(candidates: readonly Key[], live: readonly Key[]): MatchRange | undefined;
7
- export declare function findPositionalPrefixRun<Key>(candidates: readonly Key[], live: readonly Key[]): MatchRange | undefined;
package/dist/update.d.ts DELETED
@@ -1,43 +0,0 @@
1
- export declare const readOnlyMarkerFile: (extDir: string) => string;
2
- export type NpmRunner = (args: string[], opts: {
3
- cwd?: string;
4
- timeout: number;
5
- }) => Promise<{
6
- code: number;
7
- stdout: string;
8
- stderr: string;
9
- }>;
10
- export declare const runNpm: NpmRunner;
11
- export declare function setRunNpmForTest(impl: NpmRunner): void;
12
- export type NodeRunner = (args: string[], opts: {
13
- timeout: number;
14
- }) => Promise<{
15
- code: number;
16
- stdout: string;
17
- stderr: string;
18
- }>;
19
- export declare const runNode: NodeRunner;
20
- export declare function setRunNodeForTest(impl: NodeRunner): void;
21
- export declare function setInstalledSpecForTest(spec: string | null): void;
22
- export declare function isAutoUpdatableSpec(spec: string): boolean;
23
- /**
24
- * Registry dist-tag the auto-updater should track for a spec.
25
- * - `stable`, `dev`, `pr-327`, `latest` → that dist-tag
26
- * - ranges (`^1.2.3`, `>=1.0.0`, `*`) → `latest`
27
- * - exact pins / non-registry specs → undefined (never auto-update)
28
- * - exact *prerelease* versions → `latest`: npm records tag installs
29
- * (`@pr-N`, `@dev`) as the resolved exact version, so without this
30
- * fallback those users would freeze on a stale PR/dev build forever
31
- */
32
- export declare function specUpdateTag(spec: string): string | undefined;
33
- export declare function isVersionNewer(latest: string, current: string): boolean;
34
- export declare function findNpmRoot(extDir: string): string | undefined;
35
- export declare function findExtensionDir(): Promise<string | undefined>;
36
- export type InstallOutcome = "ok" | "failed" | "rolled-back" | "read-only";
37
- export declare function verifyInstall(npmDir: string, latest: string): Promise<{
38
- ok: boolean;
39
- reason?: string;
40
- }>;
41
- export declare function autoInstallLatest(latest: string, extDirOverride?: string): Promise<InstallOutcome>;
42
- export declare function checkForUpdate(autoUpdate: boolean, notify?: (msg: string) => void): Promise<void>;
43
- export declare function resetUpdateStateForTest(): void;