billion-context-omp 0.2.9 → 0.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.
@@ -19,6 +19,14 @@ export interface StreamCompressCall {
19
19
  compressCallId: string;
20
20
  }[];
21
21
  }
22
+ /** Most recent REJECTED compress call+result pair (issue #104): the kernel's
23
+ * hide-compress-calls node strips orphaned calls (KEEP_LAST_ORPHANED=0) — a
24
+ * rejected call creates no block, so BOTH the call and its result vanish
25
+ * from the model's view on the next turn; it cannot see the rejection or
26
+ * the loop-guard STOP and retries forever (observed: 92 in a row). The
27
+ * transform re-appends this pair so the last attempt's outcome stays
28
+ * visible. Returns null when no rejected call exists. */
29
+ export declare function lastRejectedCompressPair(stream: AgentMessage[]): AgentMessage[] | null;
22
30
  export declare function findCompressCalls(message: AgentMessage): StreamCompressCall[];
23
31
  /** Extract a compress tool's arguments from a stream toolCall. Two call
24
32
  * shapes exist: (1) top-level — our tools are registered with
package/dist/runtime.d.ts CHANGED
@@ -44,6 +44,10 @@ export interface AcpRuntime {
44
44
  * `ok=false` increments and returns the new streak; `ok=true` resets to 0.
45
45
  * A re-fold (rewritten stream prefix) drops the slot and starts at 0. */
46
46
  noteCompressOutcome(ctx: ExtensionContext, ok: boolean): number;
47
+ /** Current consecutive-reject streak in the space the session's CURRENT
48
+ * mode folds in (issue #104: the nudge must not demand compression while
49
+ * compress calls are being rejected in a row). */
50
+ rejectStreakFor(ctx: ExtensionContext): number;
47
51
  forgetSession(sid: string): void;
48
52
  /** Rebuild blocks from the persisted session at session_start so /acp and
49
53
  * acp_status show them BEFORE the first LLM call of a resumed session.
@@ -3,3 +3,18 @@ export declare function hostVersionAtLeast(min: readonly [number, number, number
3
3
  export declare function resolveTransformMode(adapter: Pick<AdapterConfig, "transformMode">, model: {
4
4
  api?: string;
5
5
  } | undefined, hostVersion?: string): "context" | "provider";
6
+ export interface ProviderDeliveryWarning {
7
+ key: string;
8
+ reason: string;
9
+ message: string;
10
+ }
11
+ /** An explicit transformMode "provider" is an escape hatch for patched hosts
12
+ * — but on stock hosts some APIs silently deliver NOTHING: before 17.3.8 the
13
+ * host drops the before_provider_request replacement on openai-completions /
14
+ * bedrock / cursor (upstream can1357/oh-my-pi#8717, issue #83), and bedrock /
15
+ * cursor bodies still have no codec path even on newer hosts. The unset
16
+ * default already avoids all of this; only an explicit override can land
17
+ * here, so surface why instead of failing silently (ework issue #3). */
18
+ export declare function providerDeliveryWarning(adapter: Pick<AdapterConfig, "transformMode">, model: {
19
+ api?: string;
20
+ } | undefined, hostVersion?: string): ProviderDeliveryWarning | undefined;
package/dist/update.d.ts CHANGED
@@ -1,2 +1,21 @@
1
1
  export declare function findNpmRoot(extDir: string): string | undefined;
2
+ export type NpmRunner = (args: string[], cwd: string) => Promise<{
3
+ code: number;
4
+ stdout: string;
5
+ stderr: string;
6
+ }>;
7
+ export type NodeRunner = (args: string[]) => Promise<{
8
+ code: number;
9
+ stdout: string;
10
+ stderr: string;
11
+ }>;
12
+ export declare function setRunNpmForTest(impl: NpmRunner | undefined): void;
13
+ export declare function setRunNodeForTest(impl: NodeRunner | undefined): void;
14
+ export type InstallOutcome = "ok" | "failed" | "rolled-back";
15
+ /**
16
+ * npmDirOverride exists only for tests: the test process is not installed
17
+ * under a node_modules tree, so the real discovery walk can never reach a
18
+ * fixture. Production callers pass nothing and discovery runs as usual.
19
+ */
20
+ export declare function autoInstallLatest(latest: string, npmDirOverride?: string): Promise<InstallOutcome>;
2
21
  export declare function checkForUpdate(autoUpdate: boolean, notify?: (msg: string) => void): Promise<void>;
@@ -22,6 +22,13 @@ export type Representability = {
22
22
  * the rebuild. Unrepresentable payloads must fail the transform OPEN —
23
23
  * pass through untouched rather than lose content (issue #3 review). */
24
24
  export declare function payloadRepresentable(payload: unknown, fmt: ProviderWireFormat): Representability;
25
+ /** Restore openai wire fields the kernel codec cannot carry (issue #105).
26
+ * omp's buildParams emits assistant tool-call messages with content "" (a
27
+ * null trips strict/proxy implementations) and replays encrypted reasoning
28
+ * as reasoning_details keyed to the tool call ids. The codec rebuild drops
29
+ * the details and flips "" back to null; this pass re-attaches both so the
30
+ * post-surgery body keeps the host's wire contract. */
31
+ export declare function restoreOpenaiWireFidelity(originalMessages: unknown[], rebuilt: unknown[]): unknown[];
25
32
  export type WireTagRenderScope = {
26
33
  config: Config;
27
34
  tokenCount: number;
@@ -53,6 +60,11 @@ export declare function coreIdentity(msg: BiliMessage): string;
53
60
  * checks (compress results stay ref-BLOCKED) resolve the name here. */
54
61
  export declare function toolCallNames(msgs: BiliMessage[]): Map<string, string>;
55
62
  export declare function toolResultTextsCore(msgs: BiliMessage[]): Map<string, string>;
63
+ /** Core-space twin of lastRejectedCompressPair (issue #104): the most recent
64
+ * rejected compress call+result pair, re-appended to the wire output so the
65
+ * model sees the outcome of its last attempt (hide-compress-calls strips
66
+ * orphaned calls and their results). Null when no rejected call exists. */
67
+ export declare function lastRejectedPairCore(msgs: BiliMessage[]): BiliMessage[] | null;
56
68
  /** Compress calls carried by a core tool-call piece. Same two shapes as the
57
69
  * AgentMessage stream (direct compress; legacy xd://compress via write),
58
70
  * with the arguments JSON-encoded in the piece's text. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "billion-context-omp",
3
- "version": "0.2.9",
3
+ "version": "0.3.0",
4
4
  "description": "One billion, not one million. Model-driven context management for the oh-my-pi (omp) coding agent.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",