@kodizm/acp 0.6.3 → 0.6.5

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.
Files changed (2) hide show
  1. package/dist/index.js +31 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -16171,7 +16171,15 @@ class ClaudeDriver {
16171
16171
  if (typeof input === "string") {
16172
16172
  return input;
16173
16173
  }
16174
- return { type: "preset", preset: "claude_code", append: input.append };
16174
+ const prompt = {
16175
+ type: "preset",
16176
+ preset: "claude_code",
16177
+ append: input.append
16178
+ };
16179
+ if (input.excludeDynamicSections === true) {
16180
+ prompt.excludeDynamicSections = true;
16181
+ }
16182
+ return prompt;
16175
16183
  }
16176
16184
  applyManualCompactLatch(state, events) {
16177
16185
  if (state.pendingManualCompact !== true) {
@@ -55866,6 +55874,7 @@ class OpencodeEventMapper {
55866
55874
  subagents = new Map;
55867
55875
  toolBegan = new Set;
55868
55876
  toolEnded = new Set;
55877
+ usageByMessage = new Map;
55869
55878
  compactingActive = false;
55870
55879
  constructor(options) {
55871
55880
  this.options = options;
@@ -56003,14 +56012,29 @@ class OpencodeEventMapper {
56003
56012
  const tokens = info.tokens;
56004
56013
  if (tokens === undefined)
56005
56014
  return;
56006
- this.options.emit({
56007
- sessionId: this.options.sessionId,
56008
- type: "usage",
56015
+ const current = {
56009
56016
  inputTokens: tokens.input ?? 0,
56010
56017
  outputTokens: tokens.output ?? 0,
56011
56018
  cacheReadTokens: tokens.cache?.read ?? 0,
56012
56019
  cacheCreationTokens: tokens.cache?.write ?? 0,
56013
56020
  costUsd: typeof info.cost === "number" ? info.cost : 0
56021
+ };
56022
+ const previous = this.usageByMessage.get(info.id);
56023
+ this.usageByMessage.set(info.id, current);
56024
+ const delta = previous === undefined ? current : {
56025
+ inputTokens: current.inputTokens - previous.inputTokens,
56026
+ outputTokens: current.outputTokens - previous.outputTokens,
56027
+ cacheReadTokens: current.cacheReadTokens - previous.cacheReadTokens,
56028
+ cacheCreationTokens: current.cacheCreationTokens - previous.cacheCreationTokens,
56029
+ costUsd: current.costUsd - previous.costUsd
56030
+ };
56031
+ const changed = delta.inputTokens !== 0 || delta.outputTokens !== 0 || delta.cacheReadTokens !== 0 || delta.cacheCreationTokens !== 0 || delta.costUsd !== 0;
56032
+ if (!changed)
56033
+ return;
56034
+ this.options.emit({
56035
+ sessionId: this.options.sessionId,
56036
+ type: "usage",
56037
+ ...delta
56014
56038
  });
56015
56039
  }
56016
56040
  handleSessionUpdated(payload) {
@@ -62634,7 +62658,7 @@ var init_driver2 = __esm(() => {
62634
62658
  // package.json
62635
62659
  var package_default = {
62636
62660
  name: "@kodizm/acp",
62637
- version: "0.6.3",
62661
+ version: "0.6.5",
62638
62662
  description: "Custom ACP server bridging Claude Code, codex, and opencode CLIs through a single Kodizm-flavored protocol surface.",
62639
62663
  type: "module",
62640
62664
  bin: {
@@ -62728,7 +62752,8 @@ var McpServerSchema = exports_external.object({
62728
62752
  var SystemPromptSchema = exports_external.union([
62729
62753
  exports_external.string(),
62730
62754
  exports_external.object({
62731
- append: exports_external.string()
62755
+ append: exports_external.string(),
62756
+ excludeDynamicSections: exports_external.boolean().optional()
62732
62757
  })
62733
62758
  ]);
62734
62759
  var MetaSchema = exports_external.record(exports_external.string(), exports_external.unknown());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kodizm/acp",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "Custom ACP server bridging Claude Code, codex, and opencode CLIs through a single Kodizm-flavored protocol surface.",
5
5
  "type": "module",
6
6
  "bin": {