@1agents/acp-service 0.10.12 → 0.11.1
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/src/acp-connection.js +33 -0
- package/dist/src/bridge.js +44 -1
- package/dist/src/capacity-queue.d.ts +3 -1
- package/dist/src/capacity-queue.js +4 -0
- package/dist/src/catalog.js +13 -3
- package/package.json +4 -4
- package/skills/acp-service/SKILL.md +1 -1
- package/vendor/dsh/adapter.d.ts +6 -0
- package/vendor/dsh/adapter.js +23 -0
- package/vendor/dsh/index.js +19 -0
- package/vendor/runtime/README.md +36 -11
- package/vendor/runtime/dist/{agent-registry-DxcyXXqb.js → agent-registry-CsdsVpJb.js} +209 -177
- package/vendor/runtime/dist/agent-registry-CsdsVpJb.js.map +1 -0
- package/vendor/runtime/dist/agent-registry.d.ts +0 -2
- package/vendor/runtime/dist/agent-registry.d.ts.map +1 -1
- package/vendor/runtime/dist/agent-registry.js +1 -1
- package/vendor/runtime/dist/{cli-BKmMxgix.js → cli-B5gQOSDl.js} +33 -14
- package/vendor/runtime/dist/cli-B5gQOSDl.js.map +1 -0
- package/vendor/runtime/dist/cli.d.ts +2 -6
- package/vendor/runtime/dist/cli.d.ts.map +1 -1
- package/vendor/runtime/dist/cli.js +189 -164
- package/vendor/runtime/dist/cli.js.map +1 -1
- package/vendor/runtime/dist/{client-C5zneoBs.d.ts → client-D5y4RXME.d.ts} +4 -12
- package/vendor/runtime/dist/client-D5y4RXME.d.ts.map +1 -0
- package/vendor/runtime/dist/docs-site/CLI.html +19 -21
- package/vendor/runtime/dist/docs-site/VISION.html +3 -2
- package/vendor/runtime/dist/docs-site/agents.html +10 -15
- package/vendor/runtime/dist/docs-site/assets/agents/Apache-2.0.txt +202 -0
- package/vendor/runtime/dist/docs-site/assets/agents/LobeHub-MIT.txt +21 -0
- package/vendor/runtime/dist/docs-site/assets/agents/Mux-AGPL-3.0.txt +661 -0
- package/vendor/runtime/dist/docs-site/assets/agents/README.md +41 -0
- package/vendor/runtime/dist/docs-site/assets/agents/ante.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/antigravity.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/claude.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/codex.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/copilot.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/cursor.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/deepseek-harness.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/devin.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/droid.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/fast-agent.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/fx.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/gemini.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/goose.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/grok-build.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/iflow.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/junie.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/kilocode.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/kimi.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/kiro.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/mcode.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/mux.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/octomind.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/openclaw.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/opencode.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/pi.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/pool.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/qoder.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/qwen.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/trae.png +0 -0
- package/vendor/runtime/dist/docs-site/assets/agents/zeroclaw.png +0 -0
- package/vendor/runtime/dist/docs-site/compare.html +8 -7
- package/vendor/runtime/dist/docs-site/config.html +5 -4
- package/vendor/runtime/dist/docs-site/custom-agents.html +13 -13
- package/vendor/runtime/dist/docs-site/exit-codes.html +4 -3
- package/vendor/runtime/dist/docs-site/flows.html +21 -8
- package/vendor/runtime/dist/docs-site/index.html +7 -6
- package/vendor/runtime/dist/docs-site/install.html +7 -6
- package/vendor/runtime/dist/docs-site/llms.txt +6 -6
- package/vendor/runtime/dist/docs-site/output-formats.html +9 -8
- package/vendor/runtime/dist/docs-site/permissions.html +5 -4
- package/vendor/runtime/dist/docs-site/prompting.html +9 -7
- package/vendor/runtime/dist/docs-site/quickstart.html +5 -4
- package/vendor/runtime/dist/docs-site/releasing.html +9 -8
- package/vendor/runtime/dist/docs-site/runtime-environment.html +28 -5
- package/vendor/runtime/dist/docs-site/runtime-process-lifecycle.html +13 -7
- package/vendor/runtime/dist/docs-site/safe-errors.html +3 -2
- package/vendor/runtime/dist/docs-site/session-control.html +7 -6
- package/vendor/runtime/dist/docs-site/session-watch.html +6 -5
- package/vendor/runtime/dist/docs-site/sessions.html +13 -10
- package/vendor/runtime/dist/docs-site/shared-sessions.html +7 -4
- package/vendor/runtime/dist/{flows-VrII9VKZ.js → flows-CDj5YcTh.js} +136 -68
- package/vendor/runtime/dist/flows-CDj5YcTh.js.map +1 -0
- package/vendor/runtime/dist/flows.d.ts +28 -19
- package/vendor/runtime/dist/flows.d.ts.map +1 -1
- package/vendor/runtime/dist/flows.js +1 -1
- package/vendor/runtime/dist/{invocation-options-DHMZ5Rrb.js → input-file-BsfVGZgn.js} +30 -15
- package/vendor/runtime/dist/input-file-BsfVGZgn.js.map +1 -0
- package/vendor/runtime/dist/{ipc-CNNM5DP_.js → ipc-DfqJsbk6.js} +114 -146
- package/vendor/runtime/dist/ipc-DfqJsbk6.js.map +1 -0
- package/vendor/runtime/dist/{output-DtzXtiBc.js → output-DOIF4iFc.js} +20 -47
- package/vendor/runtime/dist/output-DOIF4iFc.js.map +1 -0
- package/vendor/runtime/dist/{queue-owner-runtime-ehuh3SQU.js → queue-owner-runtime-DHBQbjXo.js} +394 -258
- package/vendor/runtime/dist/queue-owner-runtime-DHBQbjXo.js.map +1 -0
- package/vendor/runtime/dist/runtime.d.ts +37 -36
- package/vendor/runtime/dist/runtime.d.ts.map +1 -1
- package/vendor/runtime/dist/runtime.js +117 -172
- package/vendor/runtime/dist/runtime.js.map +1 -1
- package/vendor/runtime/dist/{session-options-NjpFwf-c.d.ts → session-options-Ci4aw1oD.d.ts} +13 -16
- package/vendor/runtime/dist/session-options-Ci4aw1oD.d.ts.map +1 -0
- package/vendor/runtime/dist/{session-watch-CbKfGRkZ.js → session-watch-DRwFHcWw.js} +5 -6
- package/vendor/runtime/dist/{session-watch-CbKfGRkZ.js.map → session-watch-DRwFHcWw.js.map} +1 -1
- package/vendor/runtime/dist/{watch-BGt4kcE6.js → watch-CUDGkljG.js} +3 -4
- package/vendor/runtime/dist/{watch-BGt4kcE6.js.map → watch-CUDGkljG.js.map} +1 -1
- package/vendor/runtime/package.json +3 -3
- package/vendor/runtime/skills/acpx/SKILL.md +42 -11
- package/vendor/runtime/dist/agent-registry-DxcyXXqb.js.map +0 -1
- package/vendor/runtime/dist/cli-BKmMxgix.js.map +0 -1
- package/vendor/runtime/dist/client-C5zneoBs.d.ts.map +0 -1
- package/vendor/runtime/dist/flows-VrII9VKZ.js.map +0 -1
- package/vendor/runtime/dist/invocation-options-DHMZ5Rrb.js.map +0 -1
- package/vendor/runtime/dist/ipc-CNNM5DP_.js.map +0 -1
- package/vendor/runtime/dist/output-DtzXtiBc.js.map +0 -1
- package/vendor/runtime/dist/queue-owner-runtime-ehuh3SQU.js.map +0 -1
- package/vendor/runtime/dist/session-options-NjpFwf-c.d.ts.map +0 -1
|
@@ -18,6 +18,13 @@ function safeFailureEvent(event, trustedRuntimeErrors) {
|
|
|
18
18
|
return { event: event.event ?? 'error', sessionId: event.sessionId, code: 'CAPACITY_PENDING',
|
|
19
19
|
message: 'CAPACITY_PENDING', scope: 'control', terminal: false, data: { position: data.position, waitedMs: data.waitedMs } };
|
|
20
20
|
}
|
|
21
|
+
// A capacity refusal is composed by this service from its own governor reading; it carries the
|
|
22
|
+
// occupancy a person needs and never provider text, so it keeps its message instead of a summary.
|
|
23
|
+
if (typeof event.code === 'string' && event.code.startsWith('ACP_CAPACITY_')) {
|
|
24
|
+
const data = event.data && typeof event.data === 'object' ? event.data : undefined;
|
|
25
|
+
return { event: 'error', sessionId: event.sessionId, code: event.code, message: String(event.message ?? ''),
|
|
26
|
+
scope: 'control', terminal: true, ...(data ? { data } : {}) };
|
|
27
|
+
}
|
|
21
28
|
if (['tool_call', 'tool_call_update', 'tool_result'].includes(event.event)) {
|
|
22
29
|
if (event.error === undefined && event.errorCode === undefined && event.errorText === undefined)
|
|
23
30
|
return event;
|
|
@@ -143,6 +150,10 @@ export class RuntimePeer {
|
|
|
143
150
|
if (failureEvent.code === 'CAPACITY_PENDING' || failureEvent.message === 'CAPACITY_PENDING') {
|
|
144
151
|
throw new RequestError(-32010, 'CAPACITY_PENDING', failureEvent.data);
|
|
145
152
|
}
|
|
153
|
+
// Occupancy messages are built from numeric readings only, so the client keeps the reason.
|
|
154
|
+
if (typeof failureEvent.code === 'string' && failureEvent.code.startsWith('ACP_CAPACITY_')) {
|
|
155
|
+
throw new RequestError(-32011, failureEvent.message, failureEvent.data);
|
|
156
|
+
}
|
|
146
157
|
const safe = toSafeError(failureEvent.error ?? failureEvent, { origin: 'service', operationId: payload.requestId });
|
|
147
158
|
throw new RequestError(-32000, safe.message, safe);
|
|
148
159
|
}
|
|
@@ -652,6 +663,27 @@ export function attachAcpConnection(ws, req, backend = production, state = new A
|
|
|
652
663
|
return {};
|
|
653
664
|
});
|
|
654
665
|
}
|
|
666
|
+
/**
|
|
667
|
+
* A dropped transport cannot own a live agent process forever. Sessions this connection
|
|
668
|
+
* attached are released after a grace window so a reconnecting client keeps its live
|
|
669
|
+
* session (session/load repoints it) while an abandoned one stops holding a capacity slot
|
|
670
|
+
* until the daemon restarts.
|
|
671
|
+
*/
|
|
672
|
+
function releaseOrphanedSessions() {
|
|
673
|
+
const parsed = Number(process.env.ACP_DISCONNECT_GRACE_MS);
|
|
674
|
+
const grace = Number.isFinite(parsed) && parsed >= 0 ? parsed : 30_000;
|
|
675
|
+
for (const [sessionId, session] of [...backend.sessions]) {
|
|
676
|
+
if (session?.ws !== peer)
|
|
677
|
+
continue;
|
|
678
|
+
const timer = setTimeout(() => {
|
|
679
|
+
// Reattachment repoints the session; another connection owns it now.
|
|
680
|
+
if (backend.sessions.get(sessionId)?.ws !== peer)
|
|
681
|
+
return;
|
|
682
|
+
void peer.command(backend, { action: 'close_session', sessionId }).catch(() => undefined);
|
|
683
|
+
}, grace);
|
|
684
|
+
timer.unref?.();
|
|
685
|
+
}
|
|
686
|
+
}
|
|
655
687
|
ws.once('close', () => {
|
|
656
688
|
connected = false;
|
|
657
689
|
for (const item of interactive.values())
|
|
@@ -659,6 +691,7 @@ export function attachAcpConnection(ws, req, backend = production, state = new A
|
|
|
659
691
|
for (const pending of prompts.values())
|
|
660
692
|
pending.reject(failure(undefined, { origin: 'transport', operationId: pending.requestId, outcomeUnknown: true }));
|
|
661
693
|
prompts.clear();
|
|
694
|
+
releaseOrphanedSessions();
|
|
662
695
|
});
|
|
663
696
|
const connection = app.connect(webSocketStream(ws));
|
|
664
697
|
client = connection.client;
|
package/dist/src/bridge.js
CHANGED
|
@@ -1554,7 +1554,19 @@ export async function dispatchCommand(ws, payload) {
|
|
|
1554
1554
|
console.timeEnd(`ensure_session_${sessionId}`);
|
|
1555
1555
|
break;
|
|
1556
1556
|
}
|
|
1557
|
-
const
|
|
1557
|
+
const origin = capacityId.startsWith("a2a-") ? "job" : "user-opened";
|
|
1558
|
+
// A person opening a session must be told why it cannot start instead of joining an
|
|
1559
|
+
// unbounded queue behind other work and failing much later with a transport error.
|
|
1560
|
+
// Background jobs (origin "job") keep waiting in FIFO order.
|
|
1561
|
+
if (origin === "user-opened") {
|
|
1562
|
+
const capacity = await processCapacity.snapshot("process");
|
|
1563
|
+
if (capacity.availableAutomatic < 1) {
|
|
1564
|
+
sendCapacityExhausted(ws, sessionId, capacity);
|
|
1565
|
+
console.timeEnd(`ensure_session_${sessionId}`);
|
|
1566
|
+
break;
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
const admission = await processCapacity.tryAdmit({ kind: "process", source: "automatic", id: capacityId, origin }, { signal: initializationSignal });
|
|
1558
1570
|
if (admission?.pending === true) {
|
|
1559
1571
|
sendCapacityPending(ws, sessionId, admission);
|
|
1560
1572
|
console.timeEnd(`ensure_session_${sessionId}`);
|
|
@@ -2549,6 +2561,37 @@ function notifySessionTakenOver(previousWs, nextWs, sessionId) {
|
|
|
2549
2561
|
console.warn(`[acpx-server] Failed to notify taken-over ws for ${sessionId}:`, err.message);
|
|
2550
2562
|
}
|
|
2551
2563
|
}
|
|
2564
|
+
/**
|
|
2565
|
+
* A capacity refusal is a control-plane answer, not a turn failure: it is composed here
|
|
2566
|
+
* from the live governor reading so the person sees the reason and the way out immediately.
|
|
2567
|
+
*/
|
|
2568
|
+
function sendCapacityExhausted(ws, sessionId, snapshot) {
|
|
2569
|
+
const gib = value => `${(value / (1024 ** 3)).toFixed(1)} GB`;
|
|
2570
|
+
const memoryBound = snapshot.memory.availableSlots < 1;
|
|
2571
|
+
const code = memoryBound
|
|
2572
|
+
? "ACP_CAPACITY_MEMORY_LIMIT"
|
|
2573
|
+
: snapshot.used >= snapshot.limits.hard
|
|
2574
|
+
? "ACP_CAPACITY_HARD_LIMIT"
|
|
2575
|
+
: "ACP_CAPACITY_SOFT_LIMIT";
|
|
2576
|
+
const message = memoryBound
|
|
2577
|
+
? `ACP capacity is unavailable: ${gib(snapshot.memory.availableBytes)} of reclaimable memory is below the ${gib(snapshot.memory.reserveBytes)} startup reserve. Close an idle ACP session or free memory, then retry.`
|
|
2578
|
+
: `ACP capacity is full: ${snapshot.used} of ${snapshot.used >= snapshot.limits.hard ? snapshot.limits.hard : snapshot.limits.soft} process slots are in use. Archive or close an ACP session, then retry.`;
|
|
2579
|
+
ws.send(JSON.stringify({
|
|
2580
|
+
event: "error",
|
|
2581
|
+
sessionId,
|
|
2582
|
+
code,
|
|
2583
|
+
message,
|
|
2584
|
+
scope: "control",
|
|
2585
|
+
terminal: true,
|
|
2586
|
+
data: {
|
|
2587
|
+
used: snapshot.used,
|
|
2588
|
+
limit: snapshot.limits.soft,
|
|
2589
|
+
hardLimit: snapshot.limits.hard,
|
|
2590
|
+
availableSlots: snapshot.memory.availableSlots,
|
|
2591
|
+
availableBytes: snapshot.memory.availableBytes,
|
|
2592
|
+
},
|
|
2593
|
+
}));
|
|
2594
|
+
}
|
|
2552
2595
|
function sendCapacityPending(ws, sessionId, pending) {
|
|
2553
2596
|
ws.send(JSON.stringify({
|
|
2554
2597
|
event: "error",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CapacityLease, type CapacityOptions, type CapacityRequest } from './capacity.js';
|
|
1
|
+
import { type CapacityKind, type CapacityLease, type CapacityOptions, type CapacityRequest, type CapacitySnapshot } from './capacity.js';
|
|
2
2
|
export interface CapacityQueueWaitOptions {
|
|
3
3
|
signal?: AbortSignal;
|
|
4
4
|
/** Called once only when admission actually has to wait. */
|
|
@@ -18,6 +18,8 @@ export declare class CapacityQueue {
|
|
|
18
18
|
private readonly governor;
|
|
19
19
|
private readonly pollIntervalMs;
|
|
20
20
|
constructor(options?: CapacityOptions, timing?: CapacityQueueTimingOptions);
|
|
21
|
+
/** Read-only occupancy, so a caller can refuse an interactive open without queueing it. */
|
|
22
|
+
snapshot(kind: CapacityKind): Promise<CapacitySnapshot>;
|
|
21
23
|
acquire(request: CapacityRequest, { signal, onPending }?: CapacityQueueWaitOptions): Promise<CapacityLease>;
|
|
22
24
|
/**
|
|
23
25
|
* Enqueue if needed and return immediately.
|
|
@@ -35,6 +35,10 @@ export class CapacityQueue {
|
|
|
35
35
|
if (!isPositiveInteger(this.pollIntervalMs))
|
|
36
36
|
throw new Error('ACP capacity queue poll interval must be a positive safe integer');
|
|
37
37
|
}
|
|
38
|
+
/** Read-only occupancy, so a caller can refuse an interactive open without queueing it. */
|
|
39
|
+
async snapshot(kind) {
|
|
40
|
+
return this.governor.snapshot(kind);
|
|
41
|
+
}
|
|
38
42
|
async acquire(request, { signal, onPending } = {}) {
|
|
39
43
|
if (!validRequest(request))
|
|
40
44
|
throw new Error('Invalid ACP capacity request');
|
package/dist/src/catalog.js
CHANGED
|
@@ -82,11 +82,21 @@ function localLaunch(id, options) {
|
|
|
82
82
|
if (!Array.isArray(argv))
|
|
83
83
|
return undefined;
|
|
84
84
|
if (argv[0] === 'npx') {
|
|
85
|
+
// Adapter argv may carry the package spec in `--package=<spec>` with the
|
|
86
|
+
// bin selector as the first positional (runtime #922 shape), or keep the
|
|
87
|
+
// spec itself positional (legacy shape). Resolve the spec from either
|
|
88
|
+
// shape so local packages keep precedence over PATH shims and npx.
|
|
89
|
+
const packagedFlag = argv.find((arg, i) => i > 0 && arg.startsWith('--package='));
|
|
85
90
|
const index = argv.findIndex((arg, i) => i > 0 && !arg.startsWith('-'));
|
|
86
|
-
|
|
91
|
+
const spec = packagedFlag
|
|
92
|
+
? packagedFlag.slice('--package='.length)
|
|
93
|
+
: index >= 0
|
|
94
|
+
? argv[index]
|
|
95
|
+
: undefined;
|
|
96
|
+
if (!spec)
|
|
87
97
|
return undefined;
|
|
88
|
-
const extraArgs = argv.slice(index + 1);
|
|
89
|
-
const packaged = packageLaunch(
|
|
98
|
+
const extraArgs = index >= 0 ? argv.slice(index + 1) : [];
|
|
99
|
+
const packaged = packageLaunch(spec, extraArgs, options);
|
|
90
100
|
if (packaged)
|
|
91
101
|
return packaged;
|
|
92
102
|
// Use the runtime's adapter entrypoint, rather than the display/native CLI.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1agents/acp-service",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "agent-workflow ACP runtime, CLI, HTTP/WebSocket service and DeepSeek Harness ACP/A2A plugins in one package. Part of 一芥天地 (DreamMate World).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dreammate",
|
|
@@ -91,18 +91,18 @@
|
|
|
91
91
|
"node": ">=22.13.0"
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@1agents/acp-runtime-sdk": "npm:@agentclientprotocol/sdk@^1.
|
|
94
|
+
"@1agents/acp-runtime-sdk": "npm:@agentclientprotocol/sdk@^1.9.0",
|
|
95
95
|
"@1agents/dreammate-network": "^0.5.0",
|
|
96
96
|
"@1agents/dreammate-node": "^0.15.0",
|
|
97
97
|
"@a2a-js/sdk": "1.3.0",
|
|
98
98
|
"@agentclientprotocol/sdk": "1.4.0",
|
|
99
|
-
"@openclaw/fs-safe": "^0.
|
|
99
|
+
"@openclaw/fs-safe": "^0.28.0",
|
|
100
100
|
"commander": "^15.0.0",
|
|
101
101
|
"dsh-zod": "npm:zod@4.4.3",
|
|
102
102
|
"skillflag": "^0.2.1",
|
|
103
103
|
"tsx": "^4.23.15",
|
|
104
104
|
"ws": "^8.18.0",
|
|
105
|
-
"zod": "^4.6.
|
|
105
|
+
"zod": "^4.6.7"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
108
|
"@1agents/chat-view": "0.1.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: acp-service
|
|
3
|
-
version: 0.
|
|
3
|
+
version: 0.11.1
|
|
4
4
|
description: 使用 @1agents/acp-service 管理 ACP 会话与 DSH 插件,通过 A2A 调用固定角色、派发临时任务、查询父子任务和执行轮次、记录业务验收及处理通知,并回投 Codex/DSH 原会话。也用于把已记录产物交给另一个角色(handoff_propose、handoff_decide、handoff_offer)、登记共享产物空间、项目/角色候选探查、目标登记和网络技能更新。用户说交接、下一跳、交给另一个角色、共享产物或 caseId 时使用。不用于无关的系统巡检或模型配置;执行中的 ACP 会话没有 handoff 工具。
|
|
5
5
|
---
|
|
6
6
|
|
package/vendor/dsh/adapter.d.ts
CHANGED
|
@@ -119,6 +119,12 @@ export declare class AcpAdapter implements LlmAdapter {
|
|
|
119
119
|
processReleased: true | 'pending';
|
|
120
120
|
acp: boolean;
|
|
121
121
|
}>;
|
|
122
|
+
/**
|
|
123
|
+
* Reclaim the agent process of every Session the Host archived. Archiving stops the session's
|
|
124
|
+
* work in DSH, but the ACP process and its device capacity slot belong to the service daemon,
|
|
125
|
+
* so the archive has to close them explicitly instead of leaving them to time out.
|
|
126
|
+
*/
|
|
127
|
+
releaseArchivedSessions(archived: ReadonlySet<string>): Promise<void>;
|
|
122
128
|
/**
|
|
123
129
|
* Controlled delete. ACP session/delete closes the process and marks the record deleted.
|
|
124
130
|
* The DSH session and its history stay. A detached session gets a bare link, so no agent process starts.
|
package/vendor/dsh/adapter.js
CHANGED
|
@@ -535,6 +535,29 @@ export class AcpAdapter {
|
|
|
535
535
|
}
|
|
536
536
|
return { processReleased, acp: true };
|
|
537
537
|
}
|
|
538
|
+
/**
|
|
539
|
+
* Reclaim the agent process of every Session the Host archived. Archiving stops the session's
|
|
540
|
+
* work in DSH, but the ACP process and its device capacity slot belong to the service daemon,
|
|
541
|
+
* so the archive has to close them explicitly instead of leaving them to time out.
|
|
542
|
+
*/
|
|
543
|
+
async releaseArchivedSessions(archived) {
|
|
544
|
+
for (const sessionId of archived) {
|
|
545
|
+
const pending = this.links.get(sessionId);
|
|
546
|
+
if (!pending)
|
|
547
|
+
continue;
|
|
548
|
+
try {
|
|
549
|
+
await this.releaseSession(sessionId);
|
|
550
|
+
continue;
|
|
551
|
+
}
|
|
552
|
+
catch { /* Not found (the agent was already gone) or the daemon is unreachable; retry locally. */ }
|
|
553
|
+
try {
|
|
554
|
+
(await pending)?.close();
|
|
555
|
+
}
|
|
556
|
+
catch { /* Connection setup already failed. */ }
|
|
557
|
+
if (this.links.get(sessionId) === pending)
|
|
558
|
+
this.links.delete(sessionId);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
538
561
|
/**
|
|
539
562
|
* Controlled delete. ACP session/delete closes the process and marks the record deleted.
|
|
540
563
|
* The DSH session and its history stay. A detached session gets a bare link, so no agent process starts.
|
package/vendor/dsh/index.js
CHANGED
|
@@ -45,6 +45,25 @@ export async function apply(ctx, input = {}) {
|
|
|
45
45
|
const processRequests = input.a2a?.workbench ? createWorkbenchProcessClient(input.a2a.workbench) : undefined;
|
|
46
46
|
const adapter = new AcpAdapter(ctx, config, diagnostics, processRequests);
|
|
47
47
|
ctx.effect(() => ctx.llm.registerAdapter(['1agents-acp'], adapter));
|
|
48
|
+
// Archiving a Session in DSH stops its work but never reaches the service daemon, where the
|
|
49
|
+
// ACP process and its device capacity slot live. Sweep the Host's archive set so an archived
|
|
50
|
+
// session gives its slot back at once instead of holding it until the daemon restarts.
|
|
51
|
+
ctx.effect(() => {
|
|
52
|
+
const interval = Number(process.env.DSH_ACP_ARCHIVE_SWEEP_MS);
|
|
53
|
+
const every = Number.isFinite(interval) && interval >= 0 ? interval : 2000;
|
|
54
|
+
if (every === 0)
|
|
55
|
+
return () => undefined;
|
|
56
|
+
const timer = setInterval(() => {
|
|
57
|
+
// Read the live archive set rather than a captured copy; the registry mutates it in place.
|
|
58
|
+
const registry = ctx.get('workspaceRegistry');
|
|
59
|
+
const archived = registry?.archivedSessionIds ?? [];
|
|
60
|
+
if (archived.length === 0)
|
|
61
|
+
return;
|
|
62
|
+
void adapter.releaseArchivedSessions(new Set(archived.map(String)));
|
|
63
|
+
}, every);
|
|
64
|
+
timer.unref?.();
|
|
65
|
+
return () => clearInterval(timer);
|
|
66
|
+
});
|
|
48
67
|
// A Cordis listener is released with this plugin's fiber.
|
|
49
68
|
if (processRequests)
|
|
50
69
|
registerNativeApprovals(ctx, processRequests);
|
package/vendor/runtime/README.md
CHANGED
|
@@ -49,17 +49,42 @@ The session is scoped to the current repository and persists across invocations.
|
|
|
49
49
|
|
|
50
50
|
## Choose an agent
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
| Agent
|
|
55
|
-
|
|
|
56
|
-
| Pi
|
|
57
|
-
| OpenClaw
|
|
58
|
-
| Codex
|
|
59
|
-
| Claude Code
|
|
60
|
-
|
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
These 30 built-in launch profiles share one command shape. Each guide covers the required CLI or adapter, authentication, and capability limits. Ante is experimental.
|
|
53
|
+
|
|
54
|
+
| | Agent | Command |
|
|
55
|
+
| ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------- |
|
|
56
|
+
|  | [Pi](https://github.com/openclaw/acpx/blob/main/agents/Pi.md) | `acpx pi …` |
|
|
57
|
+
|  | [OpenClaw](https://github.com/openclaw/acpx/blob/main/agents/OpenClaw.md) | `acpx openclaw …` |
|
|
58
|
+
|  | [Codex](https://github.com/openclaw/acpx/blob/main/agents/Codex.md) | `acpx codex …` |
|
|
59
|
+
|  | [Claude Code](https://github.com/openclaw/acpx/blob/main/agents/Claude.md) | `acpx claude …` |
|
|
60
|
+
|  | [Gemini CLI](https://github.com/openclaw/acpx/blob/main/agents/Gemini.md) | `acpx gemini …` |
|
|
61
|
+
|  | [Cursor](https://github.com/openclaw/acpx/blob/main/agents/Cursor.md) | `acpx cursor …` |
|
|
62
|
+
|  | [GitHub Copilot](https://github.com/openclaw/acpx/blob/main/agents/Copilot.md) | `acpx copilot …` |
|
|
63
|
+
|  | [Ante](https://github.com/openclaw/acpx/blob/main/agents/Ante.md) | `acpx ante …` |
|
|
64
|
+
|  | [Antigravity](https://github.com/openclaw/acpx/blob/main/agents/Antigravity.md) | `acpx antigravity …` |
|
|
65
|
+
|  | [DeepSeek Harness](https://github.com/openclaw/acpx/blob/main/agents/DeepSeekHarness.md) | `acpx deepseek-harness …` |
|
|
66
|
+
|  | [Devin](https://github.com/openclaw/acpx/blob/main/agents/Devin.md) | `acpx devin …` |
|
|
67
|
+
|  | [Factory Droid](https://github.com/openclaw/acpx/blob/main/agents/Droid.md) | `acpx droid …` |
|
|
68
|
+
|  | [fast-agent](https://github.com/openclaw/acpx/blob/main/agents/FastAgent.md) | `acpx fast-agent …` |
|
|
69
|
+
|  | [fx](https://github.com/openclaw/acpx/blob/main/agents/Fx.md) | `acpx fx …` |
|
|
70
|
+
|  | [Grok Build](https://github.com/openclaw/acpx/blob/main/agents/GrokBuild.md) | `acpx grok-build …` |
|
|
71
|
+
|  | [Goose](https://github.com/openclaw/acpx/blob/main/agents/Goose.md) | `acpx goose …` |
|
|
72
|
+
|  | [iFlow](https://github.com/openclaw/acpx/blob/main/agents/Iflow.md) | `acpx iflow …` |
|
|
73
|
+
|  | [Junie](https://github.com/openclaw/acpx/blob/main/agents/Junie.md) | `acpx junie …` |
|
|
74
|
+
|  | [Kilocode](https://github.com/openclaw/acpx/blob/main/agents/Kilocode.md) | `acpx kilocode …` |
|
|
75
|
+
|  | [Kimi](https://github.com/openclaw/acpx/blob/main/agents/Kimi.md) | `acpx kimi …` |
|
|
76
|
+
|  | [Kiro](https://github.com/openclaw/acpx/blob/main/agents/Kiro.md) | `acpx kiro …` |
|
|
77
|
+
|  | [MCode](https://github.com/openclaw/acpx/blob/main/agents/MCode.md) | `acpx mcode …` |
|
|
78
|
+
|  | [Mux](https://github.com/openclaw/acpx/blob/main/agents/Mux.md) | `acpx mux …` |
|
|
79
|
+
|  | [Octomind](https://github.com/openclaw/acpx/blob/main/agents/Octomind.md) | `acpx octomind …` |
|
|
80
|
+
|  | [OpenCode](https://github.com/openclaw/acpx/blob/main/agents/OpenCode.md) | `acpx opencode …` |
|
|
81
|
+
|  | [Poolside](https://github.com/openclaw/acpx/blob/main/agents/Pool.md) | `acpx pool …` |
|
|
82
|
+
|  | [Qoder](https://github.com/openclaw/acpx/blob/main/agents/Qoder.md) | `acpx qoder …` |
|
|
83
|
+
|  | [Qwen Code](https://github.com/openclaw/acpx/blob/main/agents/Qwen.md) | `acpx qwen …` |
|
|
84
|
+
|  | [Trae](https://github.com/openclaw/acpx/blob/main/agents/Trae.md) | `acpx trae …` |
|
|
85
|
+
|  | [ZeroClaw](https://github.com/openclaw/acpx/blob/main/agents/ZeroClaw.md) | `acpx zeroclaw …` |
|
|
86
|
+
|
|
87
|
+
Need another ACP server? Use `acpx --agent '<command>' …` or configure a [custom agent](docs/custom-agents.md). See the [agent registry](docs/agents.md) for adapter commands and aliases. [Logo credits](docs/assets/agents/README.md).
|
|
63
88
|
|
|
64
89
|
## Sessions and one-shot runs
|
|
65
90
|
|