@openma/deepseek-harness-acp 0.4.15 → 0.4.17-beta.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/cordis.patch.yml +15 -2
- package/dist/bridge.js +32 -11
- package/dist/plugin.js +32 -11
- package/dist/server.js +32 -11
- package/package.json +2 -1
package/cordis.patch.yml
CHANGED
|
@@ -97,8 +97,21 @@
|
|
|
97
97
|
disabled: true
|
|
98
98
|
|
|
99
99
|
- insert:
|
|
100
|
-
#
|
|
101
|
-
#
|
|
100
|
+
# Host-plane services must be loaded by the profile include so they come
|
|
101
|
+
# from the same dsh installation as AgentLoop and dsh-scope. Loading
|
|
102
|
+
# either one from the ACP package's development dependency tree would mix
|
|
103
|
+
# scope identities when --dsh-path points at a newer standalone host.
|
|
104
|
+
- id: agent-presets
|
|
105
|
+
name: '@deepseek-ai/dsh-agent-presets'
|
|
106
|
+
config:
|
|
107
|
+
default: standard
|
|
108
|
+
|
|
109
|
+
- id: cordis-host-runner
|
|
110
|
+
name: '@deepseek-ai/dsh-cordis-host-runner'
|
|
111
|
+
|
|
112
|
+
# ACP's surface service owns its bridge/session server, but no transport.
|
|
113
|
+
# The host-service rows above close this profile without borrowing another
|
|
114
|
+
# profile or relying on a development node_modules tree.
|
|
102
115
|
- id: acp-plugin
|
|
103
116
|
name: '@openma/deepseek-harness-acp/plugin'
|
|
104
117
|
config:
|
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
|
-
|
|
1755
|
-
if (
|
|
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
|
}
|
|
@@ -1816,6 +1822,10 @@ async function apply3(ctx, config = {}) {
|
|
|
1816
1822
|
}
|
|
1817
1823
|
return void 0;
|
|
1818
1824
|
};
|
|
1825
|
+
const executeCommand = (agent, line, signal) => {
|
|
1826
|
+
const execute = commandRuntime.execute;
|
|
1827
|
+
return execute.length >= 4 ? execute.call(commandRuntime, agent, line, [], signal) : execute.call(commandRuntime, agent, line, signal);
|
|
1828
|
+
};
|
|
1819
1829
|
await ctx.plugin(tui_client_plugin_exports, { rpc, findAgent, advertisement: tuiClient });
|
|
1820
1830
|
const modelCandidates = () => {
|
|
1821
1831
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -2001,6 +2011,11 @@ async function apply3(ctx, config = {}) {
|
|
|
2001
2011
|
}
|
|
2002
2012
|
setApprovalPolicy(record, record.approvals);
|
|
2003
2013
|
};
|
|
2014
|
+
const mutateSession = (record, mutation) => {
|
|
2015
|
+
const run = record.mutationTail.then(mutation);
|
|
2016
|
+
record.mutationTail = run.catch(() => void 0);
|
|
2017
|
+
return run;
|
|
2018
|
+
};
|
|
2004
2019
|
const listProviderRoutes = async () => {
|
|
2005
2020
|
try {
|
|
2006
2021
|
const raw2 = llm.listProviders();
|
|
@@ -2312,9 +2327,14 @@ async function apply3(ctx, config = {}) {
|
|
|
2312
2327
|
const permission = permissionService();
|
|
2313
2328
|
if (permission.names.includes(modeId)) {
|
|
2314
2329
|
let bundledApproval = record.approvals;
|
|
2315
|
-
permission.apply(
|
|
2316
|
-
|
|
2317
|
-
|
|
2330
|
+
permission.apply(
|
|
2331
|
+
record.agent.session,
|
|
2332
|
+
modeId,
|
|
2333
|
+
(policy) => {
|
|
2334
|
+
bundledApproval = policy;
|
|
2335
|
+
},
|
|
2336
|
+
"selection"
|
|
2337
|
+
);
|
|
2318
2338
|
setApprovalPolicy(record, bundledApproval);
|
|
2319
2339
|
record.modeId = permission.resolve(modeId).sandbox;
|
|
2320
2340
|
notify(sessionId, { sessionUpdate: "current_mode_update", currentModeId: modeId });
|
|
@@ -2625,7 +2645,7 @@ async function apply3(ctx, config = {}) {
|
|
|
2625
2645
|
}
|
|
2626
2646
|
const target = matches[0];
|
|
2627
2647
|
if (target.value === currentValue) return `already on ${target.label}`;
|
|
2628
|
-
await switchModel(record, acpSessionId, target.value);
|
|
2648
|
+
await mutateSession(record, () => switchModel(record, acpSessionId, target.value));
|
|
2629
2649
|
publishCommands(acpSessionId, record);
|
|
2630
2650
|
publishConfigOptions(acpSessionId, record);
|
|
2631
2651
|
return `model \u2192 ${target.label}`;
|
|
@@ -2664,7 +2684,8 @@ async function apply3(ctx, config = {}) {
|
|
|
2664
2684
|
model,
|
|
2665
2685
|
approvals: modeId === "danger-full-access" ? "never" : "ask",
|
|
2666
2686
|
cancelled: false,
|
|
2667
|
-
inflight: void 0
|
|
2687
|
+
inflight: void 0,
|
|
2688
|
+
mutationTail: Promise.resolve()
|
|
2668
2689
|
};
|
|
2669
2690
|
sessions.set(sessionId, record);
|
|
2670
2691
|
watchSubagentParent(agent);
|
|
@@ -2945,7 +2966,7 @@ async function apply3(ctx, config = {}) {
|
|
|
2945
2966
|
if (commandMatch !== null && commandMatch[1] !== void 0) {
|
|
2946
2967
|
let execution;
|
|
2947
2968
|
try {
|
|
2948
|
-
execution = await
|
|
2969
|
+
execution = await executeCommand(
|
|
2949
2970
|
record.agent,
|
|
2950
2971
|
trimmed,
|
|
2951
2972
|
new AbortController().signal
|
|
@@ -3025,7 +3046,7 @@ async function apply3(ctx, config = {}) {
|
|
|
3025
3046
|
}
|
|
3026
3047
|
case "agent":
|
|
3027
3048
|
case "preset": {
|
|
3028
|
-
await switchPreset(record, params.sessionId, value);
|
|
3049
|
+
await mutateSession(record, () => switchPreset(record, params.sessionId, value));
|
|
3029
3050
|
break;
|
|
3030
3051
|
}
|
|
3031
3052
|
case "effort": {
|
|
@@ -3050,7 +3071,7 @@ async function apply3(ctx, config = {}) {
|
|
|
3050
3071
|
if (value !== "default" && value !== "plan") {
|
|
3051
3072
|
throw invalidParams(`unknown collaboration mode: ${value}`);
|
|
3052
3073
|
}
|
|
3053
|
-
const execution = await
|
|
3074
|
+
const execution = await executeCommand(
|
|
3054
3075
|
record.agent,
|
|
3055
3076
|
value === "plan" ? "/plan" : "/plan off",
|
|
3056
3077
|
new AbortController().signal
|
|
@@ -3064,7 +3085,7 @@ async function apply3(ctx, config = {}) {
|
|
|
3064
3085
|
break;
|
|
3065
3086
|
}
|
|
3066
3087
|
case "model": {
|
|
3067
|
-
await switchModel(record, params.sessionId, value);
|
|
3088
|
+
await mutateSession(record, () => switchModel(record, params.sessionId, value));
|
|
3068
3089
|
break;
|
|
3069
3090
|
}
|
|
3070
3091
|
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
|
-
|
|
1756
|
-
if (
|
|
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
|
}
|
|
@@ -1817,6 +1823,10 @@ async function apply3(ctx, config = {}) {
|
|
|
1817
1823
|
}
|
|
1818
1824
|
return void 0;
|
|
1819
1825
|
};
|
|
1826
|
+
const executeCommand = (agent, line, signal) => {
|
|
1827
|
+
const execute = commandRuntime.execute;
|
|
1828
|
+
return execute.length >= 4 ? execute.call(commandRuntime, agent, line, [], signal) : execute.call(commandRuntime, agent, line, signal);
|
|
1829
|
+
};
|
|
1820
1830
|
await ctx.plugin(tui_client_plugin_exports, { rpc, findAgent, advertisement: tuiClient });
|
|
1821
1831
|
const modelCandidates = () => {
|
|
1822
1832
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -2002,6 +2012,11 @@ async function apply3(ctx, config = {}) {
|
|
|
2002
2012
|
}
|
|
2003
2013
|
setApprovalPolicy(record, record.approvals);
|
|
2004
2014
|
};
|
|
2015
|
+
const mutateSession = (record, mutation) => {
|
|
2016
|
+
const run = record.mutationTail.then(mutation);
|
|
2017
|
+
record.mutationTail = run.catch(() => void 0);
|
|
2018
|
+
return run;
|
|
2019
|
+
};
|
|
2005
2020
|
const listProviderRoutes = async () => {
|
|
2006
2021
|
try {
|
|
2007
2022
|
const raw2 = llm.listProviders();
|
|
@@ -2313,9 +2328,14 @@ async function apply3(ctx, config = {}) {
|
|
|
2313
2328
|
const permission = permissionService();
|
|
2314
2329
|
if (permission.names.includes(modeId)) {
|
|
2315
2330
|
let bundledApproval = record.approvals;
|
|
2316
|
-
permission.apply(
|
|
2317
|
-
|
|
2318
|
-
|
|
2331
|
+
permission.apply(
|
|
2332
|
+
record.agent.session,
|
|
2333
|
+
modeId,
|
|
2334
|
+
(policy) => {
|
|
2335
|
+
bundledApproval = policy;
|
|
2336
|
+
},
|
|
2337
|
+
"selection"
|
|
2338
|
+
);
|
|
2319
2339
|
setApprovalPolicy(record, bundledApproval);
|
|
2320
2340
|
record.modeId = permission.resolve(modeId).sandbox;
|
|
2321
2341
|
notify(sessionId, { sessionUpdate: "current_mode_update", currentModeId: modeId });
|
|
@@ -2626,7 +2646,7 @@ async function apply3(ctx, config = {}) {
|
|
|
2626
2646
|
}
|
|
2627
2647
|
const target = matches[0];
|
|
2628
2648
|
if (target.value === currentValue) return `already on ${target.label}`;
|
|
2629
|
-
await switchModel(record, acpSessionId, target.value);
|
|
2649
|
+
await mutateSession(record, () => switchModel(record, acpSessionId, target.value));
|
|
2630
2650
|
publishCommands(acpSessionId, record);
|
|
2631
2651
|
publishConfigOptions(acpSessionId, record);
|
|
2632
2652
|
return `model \u2192 ${target.label}`;
|
|
@@ -2665,7 +2685,8 @@ async function apply3(ctx, config = {}) {
|
|
|
2665
2685
|
model,
|
|
2666
2686
|
approvals: modeId === "danger-full-access" ? "never" : "ask",
|
|
2667
2687
|
cancelled: false,
|
|
2668
|
-
inflight: void 0
|
|
2688
|
+
inflight: void 0,
|
|
2689
|
+
mutationTail: Promise.resolve()
|
|
2669
2690
|
};
|
|
2670
2691
|
sessions.set(sessionId, record);
|
|
2671
2692
|
watchSubagentParent(agent);
|
|
@@ -2946,7 +2967,7 @@ async function apply3(ctx, config = {}) {
|
|
|
2946
2967
|
if (commandMatch !== null && commandMatch[1] !== void 0) {
|
|
2947
2968
|
let execution;
|
|
2948
2969
|
try {
|
|
2949
|
-
execution = await
|
|
2970
|
+
execution = await executeCommand(
|
|
2950
2971
|
record.agent,
|
|
2951
2972
|
trimmed,
|
|
2952
2973
|
new AbortController().signal
|
|
@@ -3026,7 +3047,7 @@ async function apply3(ctx, config = {}) {
|
|
|
3026
3047
|
}
|
|
3027
3048
|
case "agent":
|
|
3028
3049
|
case "preset": {
|
|
3029
|
-
await switchPreset(record, params.sessionId, value);
|
|
3050
|
+
await mutateSession(record, () => switchPreset(record, params.sessionId, value));
|
|
3030
3051
|
break;
|
|
3031
3052
|
}
|
|
3032
3053
|
case "effort": {
|
|
@@ -3051,7 +3072,7 @@ async function apply3(ctx, config = {}) {
|
|
|
3051
3072
|
if (value !== "default" && value !== "plan") {
|
|
3052
3073
|
throw invalidParams(`unknown collaboration mode: ${value}`);
|
|
3053
3074
|
}
|
|
3054
|
-
const execution = await
|
|
3075
|
+
const execution = await executeCommand(
|
|
3055
3076
|
record.agent,
|
|
3056
3077
|
value === "plan" ? "/plan" : "/plan off",
|
|
3057
3078
|
new AbortController().signal
|
|
@@ -3065,7 +3086,7 @@ async function apply3(ctx, config = {}) {
|
|
|
3065
3086
|
break;
|
|
3066
3087
|
}
|
|
3067
3088
|
case "model": {
|
|
3068
|
-
await switchModel(record, params.sessionId, value);
|
|
3089
|
+
await mutateSession(record, () => switchModel(record, params.sessionId, value));
|
|
3069
3090
|
break;
|
|
3070
3091
|
}
|
|
3071
3092
|
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
|
-
|
|
1751
|
-
if (
|
|
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
|
}
|
|
@@ -1812,6 +1818,10 @@ async function apply3(ctx, config = {}) {
|
|
|
1812
1818
|
}
|
|
1813
1819
|
return void 0;
|
|
1814
1820
|
};
|
|
1821
|
+
const executeCommand = (agent, line, signal) => {
|
|
1822
|
+
const execute = commandRuntime.execute;
|
|
1823
|
+
return execute.length >= 4 ? execute.call(commandRuntime, agent, line, [], signal) : execute.call(commandRuntime, agent, line, signal);
|
|
1824
|
+
};
|
|
1815
1825
|
await ctx.plugin(tui_client_plugin_exports, { rpc, findAgent, advertisement: tuiClient });
|
|
1816
1826
|
const modelCandidates = () => {
|
|
1817
1827
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -1997,6 +2007,11 @@ async function apply3(ctx, config = {}) {
|
|
|
1997
2007
|
}
|
|
1998
2008
|
setApprovalPolicy(record, record.approvals);
|
|
1999
2009
|
};
|
|
2010
|
+
const mutateSession = (record, mutation) => {
|
|
2011
|
+
const run = record.mutationTail.then(mutation);
|
|
2012
|
+
record.mutationTail = run.catch(() => void 0);
|
|
2013
|
+
return run;
|
|
2014
|
+
};
|
|
2000
2015
|
const listProviderRoutes = async () => {
|
|
2001
2016
|
try {
|
|
2002
2017
|
const raw2 = llm.listProviders();
|
|
@@ -2308,9 +2323,14 @@ async function apply3(ctx, config = {}) {
|
|
|
2308
2323
|
const permission = permissionService();
|
|
2309
2324
|
if (permission.names.includes(modeId)) {
|
|
2310
2325
|
let bundledApproval = record.approvals;
|
|
2311
|
-
permission.apply(
|
|
2312
|
-
|
|
2313
|
-
|
|
2326
|
+
permission.apply(
|
|
2327
|
+
record.agent.session,
|
|
2328
|
+
modeId,
|
|
2329
|
+
(policy) => {
|
|
2330
|
+
bundledApproval = policy;
|
|
2331
|
+
},
|
|
2332
|
+
"selection"
|
|
2333
|
+
);
|
|
2314
2334
|
setApprovalPolicy(record, bundledApproval);
|
|
2315
2335
|
record.modeId = permission.resolve(modeId).sandbox;
|
|
2316
2336
|
notify(sessionId, { sessionUpdate: "current_mode_update", currentModeId: modeId });
|
|
@@ -2621,7 +2641,7 @@ async function apply3(ctx, config = {}) {
|
|
|
2621
2641
|
}
|
|
2622
2642
|
const target = matches[0];
|
|
2623
2643
|
if (target.value === currentValue) return `already on ${target.label}`;
|
|
2624
|
-
await switchModel(record, acpSessionId, target.value);
|
|
2644
|
+
await mutateSession(record, () => switchModel(record, acpSessionId, target.value));
|
|
2625
2645
|
publishCommands(acpSessionId, record);
|
|
2626
2646
|
publishConfigOptions(acpSessionId, record);
|
|
2627
2647
|
return `model \u2192 ${target.label}`;
|
|
@@ -2660,7 +2680,8 @@ async function apply3(ctx, config = {}) {
|
|
|
2660
2680
|
model,
|
|
2661
2681
|
approvals: modeId === "danger-full-access" ? "never" : "ask",
|
|
2662
2682
|
cancelled: false,
|
|
2663
|
-
inflight: void 0
|
|
2683
|
+
inflight: void 0,
|
|
2684
|
+
mutationTail: Promise.resolve()
|
|
2664
2685
|
};
|
|
2665
2686
|
sessions.set(sessionId, record);
|
|
2666
2687
|
watchSubagentParent(agent);
|
|
@@ -2941,7 +2962,7 @@ async function apply3(ctx, config = {}) {
|
|
|
2941
2962
|
if (commandMatch !== null && commandMatch[1] !== void 0) {
|
|
2942
2963
|
let execution;
|
|
2943
2964
|
try {
|
|
2944
|
-
execution = await
|
|
2965
|
+
execution = await executeCommand(
|
|
2945
2966
|
record.agent,
|
|
2946
2967
|
trimmed,
|
|
2947
2968
|
new AbortController().signal
|
|
@@ -3021,7 +3042,7 @@ async function apply3(ctx, config = {}) {
|
|
|
3021
3042
|
}
|
|
3022
3043
|
case "agent":
|
|
3023
3044
|
case "preset": {
|
|
3024
|
-
await switchPreset(record, params.sessionId, value);
|
|
3045
|
+
await mutateSession(record, () => switchPreset(record, params.sessionId, value));
|
|
3025
3046
|
break;
|
|
3026
3047
|
}
|
|
3027
3048
|
case "effort": {
|
|
@@ -3046,7 +3067,7 @@ async function apply3(ctx, config = {}) {
|
|
|
3046
3067
|
if (value !== "default" && value !== "plan") {
|
|
3047
3068
|
throw invalidParams(`unknown collaboration mode: ${value}`);
|
|
3048
3069
|
}
|
|
3049
|
-
const execution = await
|
|
3070
|
+
const execution = await executeCommand(
|
|
3050
3071
|
record.agent,
|
|
3051
3072
|
value === "plan" ? "/plan" : "/plan off",
|
|
3052
3073
|
new AbortController().signal
|
|
@@ -3060,7 +3081,7 @@ async function apply3(ctx, config = {}) {
|
|
|
3060
3081
|
break;
|
|
3061
3082
|
}
|
|
3062
3083
|
case "model": {
|
|
3063
|
-
await switchModel(record, params.sessionId, value);
|
|
3084
|
+
await mutateSession(record, () => switchModel(record, params.sessionId, value));
|
|
3064
3085
|
break;
|
|
3065
3086
|
}
|
|
3066
3087
|
default:
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.4.
|
|
6
|
+
"version": "0.4.17-beta.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/openma-ai/deepseek-harness-acp.git"
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"start": "node --import tsx src/index.ts",
|
|
37
37
|
"pretest": "npm run build",
|
|
38
38
|
"test": "vitest run --exclude test/profile-install.test.ts",
|
|
39
|
+
"test:host": "vitest run test/e2e.test.ts -t \"serves session controls through the host tree\"",
|
|
39
40
|
"test:install": "vitest run test/profile-install.test.ts",
|
|
40
41
|
"test:watch": "vitest",
|
|
41
42
|
"typecheck": "tsc --noEmit",
|