@camerontaylor/paseo-plugin 0.11.2-fork.2 → 0.12.0-fork.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.
|
@@ -308,6 +308,8 @@ class AcpRuntime {
|
|
|
308
308
|
this.nativeSessionId = "";
|
|
309
309
|
this.messages = new Map();
|
|
310
310
|
this.toolCalls = new Map();
|
|
311
|
+
// Running tool rows published by transformers; the turn's terminal closes any left open.
|
|
312
|
+
this.vendorToolCalls = new Map();
|
|
311
313
|
this.pendingCompactions = new Set();
|
|
312
314
|
this.permissions = new Map();
|
|
313
315
|
this.configOptions = [];
|
|
@@ -416,8 +418,11 @@ class AcpRuntime {
|
|
|
416
418
|
this.emit({ type: "session.ready", requestId: input.requestId, sessionId: input.sessionId });
|
|
417
419
|
return sessionCapabilities;
|
|
418
420
|
}
|
|
419
|
-
async discover(cwd
|
|
420
|
-
|
|
421
|
+
async discover(cwd) {
|
|
422
|
+
if (cwd === undefined && this.options.options.acpOptions?.workspaceOnlyCatalog) {
|
|
423
|
+
return { models: [], modes: [] };
|
|
424
|
+
}
|
|
425
|
+
const response = await this.call(this.connection.newSession({ cwd: cwd ?? process.cwd(), mcpServers: [] }));
|
|
421
426
|
this.nativeSessionId = response.sessionId;
|
|
422
427
|
this.modes = response.modes;
|
|
423
428
|
this.configOptions = response.configOptions ?? [];
|
|
@@ -462,7 +467,10 @@ class AcpRuntime {
|
|
|
462
467
|
turnId,
|
|
463
468
|
state: "started",
|
|
464
469
|
});
|
|
465
|
-
|
|
470
|
+
// The SDK dispatches notifications without awaiting them, so the prompt response can resolve
|
|
471
|
+
// while earlier session updates are still queued. Apply them before the turn ends.
|
|
472
|
+
const settled = this.call(this.connection.prompt({ sessionId: this.nativeSessionId, prompt })).then(async (response) => {
|
|
473
|
+
await this.drainNotifications();
|
|
466
474
|
const state = response.stopReason === "cancelled" ? "canceled" : "completed";
|
|
467
475
|
this.fallbackChunkIds.clear();
|
|
468
476
|
this.terminalizeTransientItems(state);
|
|
@@ -473,7 +481,8 @@ class AcpRuntime {
|
|
|
473
481
|
state,
|
|
474
482
|
});
|
|
475
483
|
return undefined;
|
|
476
|
-
}, (error) => {
|
|
484
|
+
}, async (error) => {
|
|
485
|
+
await this.drainNotifications();
|
|
477
486
|
this.fallbackChunkIds.clear();
|
|
478
487
|
this.terminalizeTransientItems("failed");
|
|
479
488
|
this.emit({
|
|
@@ -859,9 +868,17 @@ class AcpRuntime {
|
|
|
859
868
|
this.emit({
|
|
860
869
|
type: "timeline.item",
|
|
861
870
|
sessionId: this.options.boundarySessionId,
|
|
862
|
-
item: toolTimelineItem(
|
|
871
|
+
item: terminalToolItem(toolTimelineItem(snapshot), state),
|
|
863
872
|
});
|
|
864
873
|
}
|
|
874
|
+
for (const item of this.vendorToolCalls.values()) {
|
|
875
|
+
this.emit({
|
|
876
|
+
type: "timeline.item",
|
|
877
|
+
sessionId: this.options.boundarySessionId,
|
|
878
|
+
item: terminalToolItem(item, state),
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
this.vendorToolCalls.clear();
|
|
865
882
|
for (const id of this.pendingCompactions) {
|
|
866
883
|
this.emit({
|
|
867
884
|
type: "timeline.item",
|
|
@@ -911,6 +928,12 @@ class AcpRuntime {
|
|
|
911
928
|
this.emitConfigSnapshot(update.config);
|
|
912
929
|
}
|
|
913
930
|
else if (update.type === "timeline") {
|
|
931
|
+
if (update.item.type === "tool_call") {
|
|
932
|
+
if (update.item.status === "running")
|
|
933
|
+
this.vendorToolCalls.set(update.item.id, update.item);
|
|
934
|
+
else
|
|
935
|
+
this.vendorToolCalls.delete(update.item.id);
|
|
936
|
+
}
|
|
914
937
|
this.emit({
|
|
915
938
|
type: "timeline.item",
|
|
916
939
|
sessionId: this.options.boundarySessionId,
|
|
@@ -1195,6 +1218,14 @@ function toolTimelineItem(snapshot) {
|
|
|
1195
1218
|
return { ...base, status, error: snapshot.output };
|
|
1196
1219
|
return { ...base, status, error: null };
|
|
1197
1220
|
}
|
|
1221
|
+
// A row the turn left open ends with the turn. The wire contract requires a non-null error on a
|
|
1222
|
+
// failed tool call, so a canceled turn cancels its rows instead of failing them.
|
|
1223
|
+
function terminalToolItem(item, state) {
|
|
1224
|
+
if (state === "failed") {
|
|
1225
|
+
return { ...item, status: "failed", error: item.error ?? { message: "Turn failed" } };
|
|
1226
|
+
}
|
|
1227
|
+
return { ...item, status: state, error: null };
|
|
1228
|
+
}
|
|
1198
1229
|
function jsonValue(value) {
|
|
1199
1230
|
return z.json().parse(value);
|
|
1200
1231
|
}
|
package/dist/server/acp.d.ts
CHANGED
|
@@ -45,6 +45,8 @@ export type AcpConnector = () => AcpStream | Promise<AcpStream>;
|
|
|
45
45
|
export interface AcpOptions {
|
|
46
46
|
protocol?: "auto" | "v1";
|
|
47
47
|
startupTimeoutMs?: number;
|
|
48
|
+
/** Global discovery initializes ACP but returns an empty catalog without opening a session. */
|
|
49
|
+
workspaceOnlyCatalog?: boolean;
|
|
48
50
|
waitForInitialCommands?: boolean;
|
|
49
51
|
initialCommandsTimeoutMs?: number;
|
|
50
52
|
}
|
|
@@ -6,6 +6,8 @@ export type ProviderCapability = (typeof PROVIDER_CAPABILITIES)[number];
|
|
|
6
6
|
export interface ProviderRegistration {
|
|
7
7
|
/** False rejects nonempty system instructions. Omission preserves the existing provider contract. */
|
|
8
8
|
supportsSystemPrompt?: boolean;
|
|
9
|
+
/** Activate only while agents.providers contains this provider ID, independently of enabled. */
|
|
10
|
+
requiresConfiguration?: boolean;
|
|
9
11
|
/** Equal keys share discovery within this provider. Include effective configuration and execution environment. */
|
|
10
12
|
getCatalogCacheKey?(options: ProviderCatalogOptions): Promise<string | undefined>;
|
|
11
13
|
/** Default executable and arguments; the daemon resolves overrides before status/connect. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camerontaylor/paseo-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0-fork.1",
|
|
4
4
|
"description": "Paseo plugin SDK package",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"use-sync-external-store": "^1.6.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@camerontaylor/paseo-client": "0.
|
|
74
|
-
"@camerontaylor/paseo-protocol": "0.
|
|
73
|
+
"@camerontaylor/paseo-client": "0.12.0-fork.1",
|
|
74
|
+
"@camerontaylor/paseo-protocol": "0.12.0-fork.1",
|
|
75
75
|
"@types/node": "^20.9.0",
|
|
76
76
|
"@types/react": "~19.2.0",
|
|
77
77
|
"react": "19.1.0",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"zod": "^4.4.3"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"@camerontaylor/paseo-client": "0.
|
|
85
|
-
"@camerontaylor/paseo-protocol": "0.
|
|
84
|
+
"@camerontaylor/paseo-client": "0.12.0-fork.1",
|
|
85
|
+
"@camerontaylor/paseo-protocol": "0.12.0-fork.1",
|
|
86
86
|
"react": "~19.1.0",
|
|
87
87
|
"react-native": ">=0.81.5",
|
|
88
88
|
"zod": "^4.4.3"
|