billion-context-omp 0.1.9 → 0.2.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/README.md +1 -0
- package/dist/config.d.ts +7 -0
- package/dist/index.js +394 -118
- package/dist/index.js.map +1 -1
- package/dist/user-config.d.ts +1 -0
- package/dist/wire-transform.d.ts +53 -0
- package/package.json +2 -2
package/dist/user-config.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { AdapterConfig, CompressConfig, DelegateConfig } from "./config.js"
|
|
|
6
6
|
export interface UserAcpConfig {
|
|
7
7
|
debug?: boolean;
|
|
8
8
|
autoUpdate?: boolean;
|
|
9
|
+
transformMode?: "context" | "provider";
|
|
9
10
|
modelContextLimit?: number;
|
|
10
11
|
toolBashDefaultTimeout?: number;
|
|
11
12
|
toolOutputMaxBytes?: number;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { AgentMessage } from "./messages.js";
|
|
2
|
+
import type { AnthropicRequestBody } from "acp-kernel/wire";
|
|
3
|
+
export type WireFormat = "anthropic" | "openai" | "unknown";
|
|
4
|
+
interface AnthropicBlock {
|
|
5
|
+
type?: string;
|
|
6
|
+
text?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
input?: unknown;
|
|
10
|
+
tool_use_id?: string;
|
|
11
|
+
content?: unknown;
|
|
12
|
+
is_error?: boolean;
|
|
13
|
+
cache_control?: unknown;
|
|
14
|
+
[k: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
interface AnthropicWireMessage {
|
|
17
|
+
role: string;
|
|
18
|
+
content: string | AnthropicBlock[];
|
|
19
|
+
[k: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
interface OpenAIWireMessage {
|
|
22
|
+
role: string;
|
|
23
|
+
content?: unknown;
|
|
24
|
+
tool_calls?: Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
function?: {
|
|
27
|
+
name?: string;
|
|
28
|
+
arguments?: string;
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
tool_call_id?: string;
|
|
32
|
+
[k: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
export interface SynthesisResult {
|
|
35
|
+
stream: AgentMessage[];
|
|
36
|
+
back: Array<{
|
|
37
|
+
wi: number;
|
|
38
|
+
kind: "text" | "toolCall" | "toolResult";
|
|
39
|
+
}>;
|
|
40
|
+
format: WireFormat;
|
|
41
|
+
}
|
|
42
|
+
export declare function detectWireFormat(payload: unknown): WireFormat;
|
|
43
|
+
export declare function synthesizeStream(payload: unknown, format: WireFormat): SynthesisResult;
|
|
44
|
+
/** Rebuild the wire payload from the transformed stream. Survivors reuse the
|
|
45
|
+
* ORIGINAL wire message objects (patched text only) so every field we do not
|
|
46
|
+
* understand — cache_control, citations, provider extras — passes through
|
|
47
|
+
* byte-identical. Only synthesized messages (nudge) are built from scratch.
|
|
48
|
+
* Returns the ORIGINAL payload object when nothing changed (cache-safe). */
|
|
49
|
+
export declare function rebuildWirePayload(rebuilt: AgentMessage[], payload: unknown, synth: SynthesisResult): unknown;
|
|
50
|
+
/** True when the payload carries no messages we could fold (e.g. an empty
|
|
51
|
+
* tools-only probe). The caller bypasses instead of transforming. */
|
|
52
|
+
export declare function synthesisIsEmpty(synth: SynthesisResult): boolean;
|
|
53
|
+
export type { AnthropicRequestBody, OpenAIWireMessage, AnthropicWireMessage };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "billion-context-omp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@oh-my-pi/pi-coding-agent": "17.3.2",
|
|
69
69
|
"@oh-my-pi/pi-utils": "17.3.2",
|
|
70
70
|
"@types/node": "^26.1.2",
|
|
71
|
-
"acp-kernel": "0.0.
|
|
71
|
+
"acp-kernel": "0.0.25",
|
|
72
72
|
"billion-context-kit": "0.2.0",
|
|
73
73
|
"bun-types": "^1.3.14",
|
|
74
74
|
"tsup": "^8.5.1",
|