@openma/deepseek-harness-acp 0.4.15 → 0.4.16

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/dist/bridge.js CHANGED
@@ -1750,9 +1750,15 @@ function apply2(ctx, config) {
1750
1750
  }
1751
1751
 
1752
1752
  // src/bridge/presets.ts
1753
+ var BUILT_IN_PRESET_NAMES = {
1754
+ standard: "Standard",
1755
+ code: "Code",
1756
+ minimal: "Minimal",
1757
+ cordis: "Creator"
1758
+ };
1753
1759
  function presetDisplayName(preset) {
1754
- if (preset.id === "cordis") return "Creator";
1755
- if (preset.id === "code") return "Code";
1760
+ const builtInName = BUILT_IN_PRESET_NAMES[preset.id];
1761
+ if (builtInName !== void 0) return builtInName;
1756
1762
  const name5 = preset.name?.trim();
1757
1763
  return name5 !== void 0 && name5.length > 0 ? name5 : preset.id;
1758
1764
  }
@@ -2001,6 +2007,11 @@ async function apply3(ctx, config = {}) {
2001
2007
  }
2002
2008
  setApprovalPolicy(record, record.approvals);
2003
2009
  };
2010
+ const mutateSession = (record, mutation) => {
2011
+ const run = record.mutationTail.then(mutation);
2012
+ record.mutationTail = run.catch(() => void 0);
2013
+ return run;
2014
+ };
2004
2015
  const listProviderRoutes = async () => {
2005
2016
  try {
2006
2017
  const raw2 = llm.listProviders();
@@ -2625,7 +2636,7 @@ async function apply3(ctx, config = {}) {
2625
2636
  }
2626
2637
  const target = matches[0];
2627
2638
  if (target.value === currentValue) return `already on ${target.label}`;
2628
- await switchModel(record, acpSessionId, target.value);
2639
+ await mutateSession(record, () => switchModel(record, acpSessionId, target.value));
2629
2640
  publishCommands(acpSessionId, record);
2630
2641
  publishConfigOptions(acpSessionId, record);
2631
2642
  return `model \u2192 ${target.label}`;
@@ -2664,7 +2675,8 @@ async function apply3(ctx, config = {}) {
2664
2675
  model,
2665
2676
  approvals: modeId === "danger-full-access" ? "never" : "ask",
2666
2677
  cancelled: false,
2667
- inflight: void 0
2678
+ inflight: void 0,
2679
+ mutationTail: Promise.resolve()
2668
2680
  };
2669
2681
  sessions.set(sessionId, record);
2670
2682
  watchSubagentParent(agent);
@@ -3025,7 +3037,7 @@ async function apply3(ctx, config = {}) {
3025
3037
  }
3026
3038
  case "agent":
3027
3039
  case "preset": {
3028
- await switchPreset(record, params.sessionId, value);
3040
+ await mutateSession(record, () => switchPreset(record, params.sessionId, value));
3029
3041
  break;
3030
3042
  }
3031
3043
  case "effort": {
@@ -3064,7 +3076,7 @@ async function apply3(ctx, config = {}) {
3064
3076
  break;
3065
3077
  }
3066
3078
  case "model": {
3067
- await switchModel(record, params.sessionId, value);
3079
+ await mutateSession(record, () => switchModel(record, params.sessionId, value));
3068
3080
  break;
3069
3081
  }
3070
3082
  default:
package/dist/plugin.js CHANGED
@@ -1751,9 +1751,15 @@ function apply2(ctx, config) {
1751
1751
  }
1752
1752
 
1753
1753
  // src/bridge/presets.ts
1754
+ var BUILT_IN_PRESET_NAMES = {
1755
+ standard: "Standard",
1756
+ code: "Code",
1757
+ minimal: "Minimal",
1758
+ cordis: "Creator"
1759
+ };
1754
1760
  function presetDisplayName(preset) {
1755
- if (preset.id === "cordis") return "Creator";
1756
- if (preset.id === "code") return "Code";
1761
+ const builtInName = BUILT_IN_PRESET_NAMES[preset.id];
1762
+ if (builtInName !== void 0) return builtInName;
1757
1763
  const name6 = preset.name?.trim();
1758
1764
  return name6 !== void 0 && name6.length > 0 ? name6 : preset.id;
1759
1765
  }
@@ -2002,6 +2008,11 @@ async function apply3(ctx, config = {}) {
2002
2008
  }
2003
2009
  setApprovalPolicy(record, record.approvals);
2004
2010
  };
2011
+ const mutateSession = (record, mutation) => {
2012
+ const run = record.mutationTail.then(mutation);
2013
+ record.mutationTail = run.catch(() => void 0);
2014
+ return run;
2015
+ };
2005
2016
  const listProviderRoutes = async () => {
2006
2017
  try {
2007
2018
  const raw2 = llm.listProviders();
@@ -2626,7 +2637,7 @@ async function apply3(ctx, config = {}) {
2626
2637
  }
2627
2638
  const target = matches[0];
2628
2639
  if (target.value === currentValue) return `already on ${target.label}`;
2629
- await switchModel(record, acpSessionId, target.value);
2640
+ await mutateSession(record, () => switchModel(record, acpSessionId, target.value));
2630
2641
  publishCommands(acpSessionId, record);
2631
2642
  publishConfigOptions(acpSessionId, record);
2632
2643
  return `model \u2192 ${target.label}`;
@@ -2665,7 +2676,8 @@ async function apply3(ctx, config = {}) {
2665
2676
  model,
2666
2677
  approvals: modeId === "danger-full-access" ? "never" : "ask",
2667
2678
  cancelled: false,
2668
- inflight: void 0
2679
+ inflight: void 0,
2680
+ mutationTail: Promise.resolve()
2669
2681
  };
2670
2682
  sessions.set(sessionId, record);
2671
2683
  watchSubagentParent(agent);
@@ -3026,7 +3038,7 @@ async function apply3(ctx, config = {}) {
3026
3038
  }
3027
3039
  case "agent":
3028
3040
  case "preset": {
3029
- await switchPreset(record, params.sessionId, value);
3041
+ await mutateSession(record, () => switchPreset(record, params.sessionId, value));
3030
3042
  break;
3031
3043
  }
3032
3044
  case "effort": {
@@ -3065,7 +3077,7 @@ async function apply3(ctx, config = {}) {
3065
3077
  break;
3066
3078
  }
3067
3079
  case "model": {
3068
- await switchModel(record, params.sessionId, value);
3080
+ await mutateSession(record, () => switchModel(record, params.sessionId, value));
3069
3081
  break;
3070
3082
  }
3071
3083
  default:
package/dist/server.js CHANGED
@@ -1746,9 +1746,15 @@ function apply2(ctx, config) {
1746
1746
  }
1747
1747
 
1748
1748
  // src/bridge/presets.ts
1749
+ var BUILT_IN_PRESET_NAMES = {
1750
+ standard: "Standard",
1751
+ code: "Code",
1752
+ minimal: "Minimal",
1753
+ cordis: "Creator"
1754
+ };
1749
1755
  function presetDisplayName(preset) {
1750
- if (preset.id === "cordis") return "Creator";
1751
- if (preset.id === "code") return "Code";
1756
+ const builtInName = BUILT_IN_PRESET_NAMES[preset.id];
1757
+ if (builtInName !== void 0) return builtInName;
1752
1758
  const name5 = preset.name?.trim();
1753
1759
  return name5 !== void 0 && name5.length > 0 ? name5 : preset.id;
1754
1760
  }
@@ -1997,6 +2003,11 @@ async function apply3(ctx, config = {}) {
1997
2003
  }
1998
2004
  setApprovalPolicy(record, record.approvals);
1999
2005
  };
2006
+ const mutateSession = (record, mutation) => {
2007
+ const run = record.mutationTail.then(mutation);
2008
+ record.mutationTail = run.catch(() => void 0);
2009
+ return run;
2010
+ };
2000
2011
  const listProviderRoutes = async () => {
2001
2012
  try {
2002
2013
  const raw2 = llm.listProviders();
@@ -2621,7 +2632,7 @@ async function apply3(ctx, config = {}) {
2621
2632
  }
2622
2633
  const target = matches[0];
2623
2634
  if (target.value === currentValue) return `already on ${target.label}`;
2624
- await switchModel(record, acpSessionId, target.value);
2635
+ await mutateSession(record, () => switchModel(record, acpSessionId, target.value));
2625
2636
  publishCommands(acpSessionId, record);
2626
2637
  publishConfigOptions(acpSessionId, record);
2627
2638
  return `model \u2192 ${target.label}`;
@@ -2660,7 +2671,8 @@ async function apply3(ctx, config = {}) {
2660
2671
  model,
2661
2672
  approvals: modeId === "danger-full-access" ? "never" : "ask",
2662
2673
  cancelled: false,
2663
- inflight: void 0
2674
+ inflight: void 0,
2675
+ mutationTail: Promise.resolve()
2664
2676
  };
2665
2677
  sessions.set(sessionId, record);
2666
2678
  watchSubagentParent(agent);
@@ -3021,7 +3033,7 @@ async function apply3(ctx, config = {}) {
3021
3033
  }
3022
3034
  case "agent":
3023
3035
  case "preset": {
3024
- await switchPreset(record, params.sessionId, value);
3036
+ await mutateSession(record, () => switchPreset(record, params.sessionId, value));
3025
3037
  break;
3026
3038
  }
3027
3039
  case "effort": {
@@ -3060,7 +3072,7 @@ async function apply3(ctx, config = {}) {
3060
3072
  break;
3061
3073
  }
3062
3074
  case "model": {
3063
- await switchModel(record, params.sessionId, value);
3075
+ await mutateSession(record, () => switchModel(record, params.sessionId, value));
3064
3076
  break;
3065
3077
  }
3066
3078
  default:
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.4.15",
6
+ "version": "0.4.16",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/openma-ai/deepseek-harness-acp.git"