opencode-acp 1.18.2 → 1.18.3-pr.475.210
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 +22 -9
- package/README.zh-CN.md +15 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +276 -76
- package/dist/index.js.map +1 -1
- package/dist/lib/bili-proxy.d.ts +37 -0
- package/dist/lib/bili-proxy.d.ts.map +1 -1
- package/dist/lib/compress/decompress-logic.d.ts +36 -0
- package/dist/lib/compress/decompress-logic.d.ts.map +1 -1
- package/dist/lib/compress/decompress.d.ts.map +1 -1
- package/dist/lib/compress/quality-gate/rejection.d.ts +9 -1
- package/dist/lib/compress/quality-gate/rejection.d.ts.map +1 -1
- package/dist/lib/compress/range.d.ts.map +1 -1
- package/dist/lib/compress/types.d.ts.map +1 -1
- package/dist/lib/host-permissions.d.ts +20 -0
- package/dist/lib/host-permissions.d.ts.map +1 -1
- package/dist/lib/messages/truncate-tools.d.ts +1 -0
- package/dist/lib/messages/truncate-tools.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/lib/bili-proxy.d.ts
CHANGED
|
@@ -24,4 +24,41 @@ export interface BiliProxyMatch {
|
|
|
24
24
|
* input and for providers without a string baseURL.
|
|
25
25
|
*/
|
|
26
26
|
export declare function findBiliProxyProviders(provider: unknown): BiliProxyMatch[];
|
|
27
|
+
/**
|
|
28
|
+
* [FIX #405] Process-env ownership markers left by billion-context.
|
|
29
|
+
*
|
|
30
|
+
* Two owner modes are invisible to the provider-config signal above:
|
|
31
|
+
*
|
|
32
|
+
* - Launcher mode (`bili <client>`): sets `BILLION_CONTEXT_PROXY` for the
|
|
33
|
+
* launched child process. ACP's setup-time sample catches it only if the
|
|
34
|
+
* variable already exists when the plugin factory runs — re-sampling env at
|
|
35
|
+
* action time removes that timing assumption entirely.
|
|
36
|
+
*
|
|
37
|
+
* - Native mode (billion-context opencode-native plugin, #820/#824): the
|
|
38
|
+
* plugin replaces model-API requests at `http.request` time, so the
|
|
39
|
+
* configured provider baseURL never contains `/bili/`, and
|
|
40
|
+
* `BILLION_CONTEXT_PROXY` is written only after the async proxy bootstrap.
|
|
41
|
+
* The native entry marks ownership synchronously at module evaluation
|
|
42
|
+
* (`markNativeHost()`, first-writer-wins) — but that evaluation can still
|
|
43
|
+
* land AFTER ACP's setup sampled env, depending on plugin load order.
|
|
44
|
+
*
|
|
45
|
+
* Consumers must therefore sample env at ACTION time (hook invocations,
|
|
46
|
+
* config runs, tool calls) and never trust a startup snapshot.
|
|
47
|
+
*/
|
|
48
|
+
export declare const BILI_PROXY_ENV_VAR = "BILLION_CONTEXT_PROXY";
|
|
49
|
+
export declare const BILI_NATIVE_ENV_VAR = "BILLION_CONTEXT_NATIVE";
|
|
50
|
+
export type BiliEnvYield = "launcher" | "native";
|
|
51
|
+
/**
|
|
52
|
+
* Detect a billion-context ownership marker in the given environment
|
|
53
|
+
* (defaults to `process.env`). Pure — safe to unit test.
|
|
54
|
+
*
|
|
55
|
+
* Returns `"launcher"` when `BILLION_CONTEXT_PROXY` is set (takes precedence —
|
|
56
|
+
* native bootstrap refuses to run while it is set, so both cannot normally
|
|
57
|
+
* coexist), `"native"` when only `BILLION_CONTEXT_NATIVE` is set, else `null`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function detectBiliEnvYield(env?: Record<string, string | undefined>): BiliEnvYield | null;
|
|
60
|
+
/** Human-readable ownership source for error messages thrown by tool gates. */
|
|
61
|
+
export declare function describeBiliEnvYield(source: BiliEnvYield): string;
|
|
62
|
+
/** Console announcement text per ownership source (callers log once each). */
|
|
63
|
+
export declare function biliYieldLogMessage(source: BiliEnvYield): string;
|
|
27
64
|
//# sourceMappingURL=bili-proxy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bili-proxy.d.ts","sourceRoot":"","sources":["../../lib/bili-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,iBAAiB,WAAW,CAAA;AAEzC,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAClB;AAqBD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,cAAc,EAAE,CAU1E"}
|
|
1
|
+
{"version":3,"file":"bili-proxy.d.ts","sourceRoot":"","sources":["../../lib/bili-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,iBAAiB,WAAW,CAAA;AAEzC,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAClB;AAqBD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,cAAc,EAAE,CAU1E;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,kBAAkB,0BAA0B,CAAA;AACzD,eAAO,MAAM,mBAAmB,2BAA2B,CAAA;AAE3D,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAA;AAEhD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAC9B,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACtD,YAAY,GAAG,IAAI,CAIrB;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAIjE;AAED,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAIhE"}
|
|
@@ -21,6 +21,42 @@ export interface RestoredMessagesResult {
|
|
|
21
21
|
restoredTokens: number;
|
|
22
22
|
}
|
|
23
23
|
export declare function computeRestoredMessages(messagesState: PruneMessagesState, activeMessagesBefore: Map<string, number>): RestoredMessagesResult;
|
|
24
|
+
export interface DecompressAvailabilityResult {
|
|
25
|
+
/** Message IDs whose visibility this decompression would restore (membership-wise). */
|
|
26
|
+
requiredMessageIds: string[];
|
|
27
|
+
/** Subset of requiredMessageIds present in the fetched host history. */
|
|
28
|
+
availableMessageIds: string[];
|
|
29
|
+
/** Subset of requiredMessageIds absent from the fetched host history.
|
|
30
|
+
* Non-empty ⇒ committing would claim restored content that does not exist. */
|
|
31
|
+
missingMessageIds: string[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Compute the message IDs whose visibility changes if `targets` are deactivated.
|
|
35
|
+
*
|
|
36
|
+
* A message becomes visible iff every block currently covering it belongs to the
|
|
37
|
+
* deactivation set AND (one-tier only) it is not re-covered by a consumed block
|
|
38
|
+
* that syncCompressionBlocks will reactivate. One-tier decompression leaves
|
|
39
|
+
* non-user-deactivated consumed blocks alive, so their covered messages stay
|
|
40
|
+
* hidden and are not required sources; full decompression deep-deactivates them,
|
|
41
|
+
* so everything under the targets must be present in history.
|
|
42
|
+
*
|
|
43
|
+
* The result is conservative by design: over-requiring an ID can only cause a
|
|
44
|
+
* safe-direction abort, never a false "restored" claim.
|
|
45
|
+
*/
|
|
46
|
+
export declare function collectRequiredDecompressMessageIds(messagesState: PruneMessagesState, targets: CompressionTarget[], options?: {
|
|
47
|
+
full?: boolean;
|
|
48
|
+
}): string[];
|
|
49
|
+
/**
|
|
50
|
+
* [Issue #446] Verify that every source message a decompression would restore is
|
|
51
|
+
* actually present in the fetched host history. Membership transitions alone prove
|
|
52
|
+
* nothing about content: if the host removed the originals (native compaction,
|
|
53
|
+
* external deletion), deactivating the target still reports "Restored N" while
|
|
54
|
+
* nothing returns to context, stats are decremented by phantom tokens, and the
|
|
55
|
+
* terminal user-deactivation discards the summary coverage.
|
|
56
|
+
*/
|
|
57
|
+
export declare function checkDecompressSourceAvailability(messagesState: PruneMessagesState, targets: CompressionTarget[], options: {
|
|
58
|
+
full?: boolean;
|
|
59
|
+
}, presentInHistory: Set<string>): DecompressAvailabilityResult;
|
|
24
60
|
export declare function computeReactivatedBlockIds(messagesState: PruneMessagesState, activeBlockIdsBefore: Set<number>): number[];
|
|
25
61
|
export declare function buildRestoredContentPreview(messages: WithParts[], activeMessagesBefore: Map<string, number>, messagesState: PruneMessagesState): string;
|
|
26
62
|
//# sourceMappingURL=decompress-logic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decompress-logic.d.ts","sourceRoot":"","sources":["../../../lib/compress/decompress-logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAG/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAa1D;AAED,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,CAAA;AAE9C,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7D;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,GAClC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAYjC;AAED,wBAAgB,mCAAmC,CAC/C,aAAa,EAAE,kBAAkB,EACjC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,GACxB,gBAAgB,EAAE,CAoBpB;AAED,wBAAgB,uBAAuB,CACnC,aAAa,EAAE,kBAAkB,EACjC,KAAK,EAAE,gBAAgB,GACxB,MAAM,GAAG,IAAI,CA4Bf;AAED,wBAAgB,yBAAyB,CACrC,aAAa,EAAE,kBAAkB,EACjC,MAAM,EAAE,iBAAiB,GAC1B,MAAM,GAAG,IAAI,CASf;AAED,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,kBAAkB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAQ7F;AAED,wBAAgB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H,wBAAgB,iCAAiC,CAC7C,aAAa,EAAE,kBAAkB,EACjC,OAAO,EAAE,iBAAiB,EAAE,EAC5B,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,EAC3B,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,GAC9B,4BAA4B,CAY9B;AAED,wBAAgB,0BAA0B,CACtC,aAAa,EAAE,kBAAkB,EACjC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,GAClC,MAAM,EAAE,CAIV;AAKD,wBAAgB,2BAA2B,CACvC,QAAQ,EAAE,SAAS,EAAE,EACrB,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACzC,aAAa,EAAE,kBAAkB,GAClC,MAAM,CAoCR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decompress.d.ts","sourceRoot":"","sources":["../../../lib/compress/decompress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAoB,KAAK,kBAAkB,EAAsB,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"decompress.d.ts","sourceRoot":"","sources":["../../../lib/compress/decompress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAoB,KAAK,kBAAkB,EAAsB,MAAM,SAAS,CAAA;AAoSvF,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,kBAAkB,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAwL5F"}
|
|
@@ -6,5 +6,13 @@ export interface RejectionPlanInfo {
|
|
|
6
6
|
messageIds: string[];
|
|
7
7
|
messageTokenById: Map<string, number>;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Minimal logging surface for full rejection diagnostics. Kept structural (not
|
|
11
|
+
* the concrete `Logger` class) so tests can inject a plain mock without casting,
|
|
12
|
+
* and so this module has no runtime dependency on the logger implementation.
|
|
13
|
+
*/
|
|
14
|
+
export interface RejectionDiagnosticsLogger {
|
|
15
|
+
warn(message: string, data?: Record<string, unknown>): void;
|
|
16
|
+
}
|
|
17
|
+
export declare function buildQualityRejectionError(plan: RejectionPlanInfo, result: QualityGateResult, logger?: RejectionDiagnosticsLogger): Error;
|
|
10
18
|
//# sourceMappingURL=rejection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rejection.d.ts","sourceRoot":"","sources":["../../../../lib/compress/quality-gate/rejection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACxC;
|
|
1
|
+
{"version":3,"file":"rejection.d.ts","sourceRoot":"","sources":["../../../../lib/compress/quality-gate/rejection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACxC;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACvC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAC9D;AA+CD,wBAAgB,0BAA0B,CACtC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,iBAAiB,EACzB,MAAM,CAAC,EAAE,0BAA0B,GACpC,KAAK,CA4BP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../../lib/compress/range.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,SAAS,CAAA;AAuCrE,wBAAgB,iBAAiB,CAC7B,iBAAiB,EAAE,OAAO,EAC1B,OAAO,EAAE,KAAK,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GACnD,OAAO,CAKT;AAqDD,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,kBAAkB,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../../lib/compress/range.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,SAAS,CAAA;AAuCrE,wBAAgB,iBAAiB,CAC7B,iBAAiB,EAAE,OAAO,EAC1B,OAAO,EAAE,KAAK,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GACnD,OAAO,CAKT;AAqDD,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,kBAAkB,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CA0S/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/compress/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/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AE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,kBAAkB,CAAA;IACzB,SAAS,EAAE,mBAAmB,CAAA;IAC9B,eAAe,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,iCAAiC;IAC9C,KAAK,EAAE,0BAA0B,EAAE,CAAA;IACnC,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,sBAAsB;IACnC,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,qBAAqB;IAClC,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACrC,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,yBAAyB,EAAE,MAAM,EAAE,CAAA;IACnC,sBAAsB,EAAE,MAAM,EAAE,CAAA;CACnC;AAED,MAAM,WAAW,qBAAqB;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,eAAe,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB,EAAE,MAAM,CAAA;IACzB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;CACxB"}
|
|
@@ -8,4 +8,24 @@ export interface HostPermissionSnapshot {
|
|
|
8
8
|
export declare const compressDisabledByOpencode: (...permissionConfigs: PermissionConfig[]) => boolean;
|
|
9
9
|
export declare const resolveEffectiveCompressPermission: (basePermission: PermissionAction, hostPermissions: HostPermissionSnapshot, agentName?: string) => PermissionAction;
|
|
10
10
|
export declare const hasExplicitToolPermission: (permissionConfig: PermissionConfig, tool: string) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* True when the user has made any decision that resolves `tool` in this map:
|
|
13
|
+
* an exact key in any value form (scalar or nested pattern object — including
|
|
14
|
+
* a degenerate empty object, which produces no rules but still counts as key
|
|
15
|
+
* presence), or a wildcard key (`"*"`, `"acp*"`) matching via the same rule
|
|
16
|
+
* machinery the host resolution models ([#465]).
|
|
17
|
+
*/
|
|
18
|
+
export declare const anyRuleResolves: (permissionConfig: PermissionConfig, tool: string) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Merge ACP's tool permissions into the host map. An explicit user `compress`
|
|
21
|
+
* rule means the user owns the map (returned unchanged). Otherwise write
|
|
22
|
+
* `compress` + default `acp_status: "allow"` — but never override a user
|
|
23
|
+
* decision on `acp_status`, whether an exact key ([#457]: it used to be
|
|
24
|
+
* silently rewritten to `"allow"`, inverting the decision; the host reads its
|
|
25
|
+
* own permissions from this same map) or a wildcard like `"*"` / `"acp*"`
|
|
26
|
+
* ([#465]: appended after the user's rules it would win last-match and erase
|
|
27
|
+
* their decision). The default write is strictly additive over [#457]: it only
|
|
28
|
+
* stops where a user rule already resolves the tool.
|
|
29
|
+
*/
|
|
30
|
+
export declare const applyAcpToolPermissions: (permissionConfig: PermissionConfig, compressPermission: PermissionAction) => Record<string, PermissionValue>;
|
|
11
31
|
//# sourceMappingURL=host-permissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-permissions.d.ts","sourceRoot":"","sources":["../../lib/host-permissions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAA;AAEvD,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;AAEjF,MAAM,MAAM,gBAAgB,GA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,eAAe,GAAI,kBAAkB,gBAAgB,EAAE,MAAM,MAAM,KAAG,OAUlF,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAChC,kBAAkB,gBAAgB,EAClC,oBAAoB,gBAAgB,KACrC,MAAM,CAAC,MAAM,EAAE,eAAe,CAehC,CAAA"}
|
|
@@ -2,6 +2,7 @@ import { SessionState, WithParts } from "../state";
|
|
|
2
2
|
import type { PluginConfig } from "../config";
|
|
3
3
|
import { Logger } from "../logger";
|
|
4
4
|
export declare const OUTPUT_RESERVE_TOKENS = 16384;
|
|
5
|
+
export declare const MAX_OVERHEAD_ERROR_SESSIONS = 1024;
|
|
5
6
|
/**
|
|
6
7
|
* When context reaches the GC threshold, truncate the largest visible tool outputs
|
|
7
8
|
* (keeping prefix + suffix) to free space. Summaries are never touched — they contain
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"truncate-tools.d.ts","sourceRoot":"","sources":["../../../lib/messages/truncate-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAgBlC,eAAO,MAAM,qBAAqB,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"truncate-tools.d.ts","sourceRoot":"","sources":["../../../lib/messages/truncate-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAgBlC,eAAO,MAAM,qBAAqB,QAAQ,CAAA;AAS1C,eAAO,MAAM,2BAA2B,OAAO,CAAA;AAyB/C;;;;GAIG;AACH,wBAAgB,wBAAwB,CACpC,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EAAE,GACtB,IAAI,CAkGN"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "opencode-acp",
|
|
4
|
-
"version": "1.18.
|
|
4
|
+
"version": "1.18.3-pr.475.210",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Active Context Pruning — model-driven context management for OpenCode (hardened fork of DCP with 35 bug fixes)",
|
|
7
7
|
"main": "./dist/index.js",
|