@ycodium-ai/agent-acp 0.2.2126 → 0.2.2130
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/index.js +37 -31
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5098,7 +5098,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
|
|
|
5098
5098
|
var NONE = 0;
|
|
5099
5099
|
var ASSUMED = 1;
|
|
5100
5100
|
var PROVEN = 2;
|
|
5101
|
-
function isRecursive(inst, stack,
|
|
5101
|
+
function isRecursive(inst, stack, resolve2) {
|
|
5102
5102
|
const cached2 = recursive.get(inst);
|
|
5103
5103
|
if (cached2 !== void 0)
|
|
5104
5104
|
return cached2 ? PROVEN : NONE;
|
|
@@ -5108,7 +5108,7 @@ function isRecursive(inst, stack, resolve) {
|
|
|
5108
5108
|
let result = NONE;
|
|
5109
5109
|
const check2 = (child) => {
|
|
5110
5110
|
if (result !== PROVEN && child?._zod) {
|
|
5111
|
-
const answer = isRecursive(child, stack,
|
|
5111
|
+
const answer = isRecursive(child, stack, resolve2);
|
|
5112
5112
|
if (answer > result)
|
|
5113
5113
|
result = answer;
|
|
5114
5114
|
}
|
|
@@ -5119,7 +5119,7 @@ function isRecursive(inst, stack, resolve) {
|
|
|
5119
5119
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
5120
5120
|
if (spread && !desc.enumerable)
|
|
5121
5121
|
continue;
|
|
5122
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
5122
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve2) : NONE;
|
|
5123
5123
|
if (child > answer)
|
|
5124
5124
|
answer = child;
|
|
5125
5125
|
}
|
|
@@ -5183,7 +5183,7 @@ function isRecursive(inst, stack, resolve) {
|
|
|
5183
5183
|
break;
|
|
5184
5184
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
5185
5185
|
case "lazy": {
|
|
5186
|
-
const inner = def._cachedInner ?? (
|
|
5186
|
+
const inner = def._cachedInner ?? (resolve2 ? inst._zod.innerType : void 0);
|
|
5187
5187
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
5188
5188
|
break;
|
|
5189
5189
|
}
|
|
@@ -21847,11 +21847,11 @@ var Connection = class {
|
|
|
21847
21847
|
const id = this.nextRequestId++;
|
|
21848
21848
|
let cancel = () => {
|
|
21849
21849
|
};
|
|
21850
|
-
const response = new Promise((
|
|
21850
|
+
const response = new Promise((resolve2, reject) => {
|
|
21851
21851
|
const pendingResponse = {
|
|
21852
21852
|
resolve: (value) => {
|
|
21853
21853
|
try {
|
|
21854
|
-
|
|
21854
|
+
resolve2(mapResponse ? mapResponse(value) : value);
|
|
21855
21855
|
} catch (error62) {
|
|
21856
21856
|
reject(error62);
|
|
21857
21857
|
}
|
|
@@ -21908,8 +21908,8 @@ var Connection = class {
|
|
|
21908
21908
|
this.stream = stream;
|
|
21909
21909
|
this.staticHandlers = handlers;
|
|
21910
21910
|
this.allowBatches = options?.allowBatches ?? true;
|
|
21911
|
-
this.closedPromise = new Promise((
|
|
21912
|
-
this.abortController.signal.addEventListener("abort", () =>
|
|
21911
|
+
this.closedPromise = new Promise((resolve2) => {
|
|
21912
|
+
this.abortController.signal.addEventListener("abort", () => resolve2());
|
|
21913
21913
|
});
|
|
21914
21914
|
void this.receive();
|
|
21915
21915
|
}
|
|
@@ -22803,8 +22803,8 @@ var AsyncQueue = class {
|
|
|
22803
22803
|
if (this.failed) {
|
|
22804
22804
|
return Promise.reject(this.failure);
|
|
22805
22805
|
}
|
|
22806
|
-
return new Promise((
|
|
22807
|
-
this.waiters.push({ resolve, reject });
|
|
22806
|
+
return new Promise((resolve2, reject) => {
|
|
22807
|
+
this.waiters.push({ resolve: resolve2, reject });
|
|
22808
22808
|
});
|
|
22809
22809
|
}
|
|
22810
22810
|
};
|
|
@@ -23829,8 +23829,8 @@ function createAcpConnection(options) {
|
|
|
23829
23829
|
failIfClosed();
|
|
23830
23830
|
const id = nextRequestId;
|
|
23831
23831
|
nextRequestId += 1;
|
|
23832
|
-
const { promise: promise2, resolve, reject } = Promise.withResolvers();
|
|
23833
|
-
pending.set(String(id), { method, resolve, reject });
|
|
23832
|
+
const { promise: promise2, resolve: resolve2, reject } = Promise.withResolvers();
|
|
23833
|
+
pending.set(String(id), { method, resolve: resolve2, reject });
|
|
23834
23834
|
const message = params === void 0 ? { jsonrpc: "2.0", id, method } : { jsonrpc: "2.0", id, method, params };
|
|
23835
23835
|
try {
|
|
23836
23836
|
await writeMessage(message);
|
|
@@ -23851,8 +23851,8 @@ function createAcpConnection(options) {
|
|
|
23851
23851
|
if (inboundBatches === 0) {
|
|
23852
23852
|
return;
|
|
23853
23853
|
}
|
|
23854
|
-
await new Promise((
|
|
23855
|
-
idleWaiters.push(
|
|
23854
|
+
await new Promise((resolve2) => {
|
|
23855
|
+
idleWaiters.push(resolve2);
|
|
23856
23856
|
if (inboundBatches === 0) {
|
|
23857
23857
|
releaseIdleWaiters();
|
|
23858
23858
|
}
|
|
@@ -24031,8 +24031,8 @@ var UnboundedEventStream = class {
|
|
|
24031
24031
|
iterators.subscribers.delete(subscriber);
|
|
24032
24032
|
return { value: void 0, done: true };
|
|
24033
24033
|
}
|
|
24034
|
-
await new Promise((
|
|
24035
|
-
subscriber.wake =
|
|
24034
|
+
await new Promise((resolve2) => {
|
|
24035
|
+
subscriber.wake = resolve2;
|
|
24036
24036
|
});
|
|
24037
24037
|
}
|
|
24038
24038
|
},
|
|
@@ -24523,8 +24523,8 @@ var Mutex = class {
|
|
|
24523
24523
|
this.locked = true;
|
|
24524
24524
|
return Promise.resolve();
|
|
24525
24525
|
}
|
|
24526
|
-
return new Promise((
|
|
24527
|
-
this.waiters.push(
|
|
24526
|
+
return new Promise((resolve2) => {
|
|
24527
|
+
this.waiters.push(resolve2);
|
|
24528
24528
|
});
|
|
24529
24529
|
}
|
|
24530
24530
|
tryAcquire() {
|
|
@@ -25658,14 +25658,14 @@ function createAcpExecutor(options) {
|
|
|
25658
25658
|
}
|
|
25659
25659
|
}
|
|
25660
25660
|
const requestId = randomId();
|
|
25661
|
-
const outcome = await new Promise((
|
|
25661
|
+
const outcome = await new Promise((resolve2) => {
|
|
25662
25662
|
const pending = {
|
|
25663
25663
|
requestId,
|
|
25664
25664
|
request: params,
|
|
25665
25665
|
permissionRequest,
|
|
25666
25666
|
turnId: activeTurnId,
|
|
25667
25667
|
settled: false,
|
|
25668
|
-
resolve
|
|
25668
|
+
resolve: resolve2
|
|
25669
25669
|
};
|
|
25670
25670
|
approvals.add(pending);
|
|
25671
25671
|
emit(
|
|
@@ -25948,14 +25948,14 @@ function createAcpExecutor(options) {
|
|
|
25948
25948
|
if (!promptMutex.isLocked) {
|
|
25949
25949
|
return true;
|
|
25950
25950
|
}
|
|
25951
|
-
return await new Promise((
|
|
25951
|
+
return await new Promise((resolve2) => {
|
|
25952
25952
|
const timer = setTimeout(() => {
|
|
25953
25953
|
promptWaiters = promptWaiters.filter((waiter) => waiter !== onSettle);
|
|
25954
|
-
|
|
25954
|
+
resolve2(false);
|
|
25955
25955
|
}, timeoutMs);
|
|
25956
25956
|
const onSettle = () => {
|
|
25957
25957
|
clearTimeout(timer);
|
|
25958
|
-
|
|
25958
|
+
resolve2(true);
|
|
25959
25959
|
};
|
|
25960
25960
|
promptWaiters.push(onSettle);
|
|
25961
25961
|
});
|
|
@@ -26329,7 +26329,7 @@ function createAcpExecutor(options) {
|
|
|
26329
26329
|
|
|
26330
26330
|
// ../../packages/ycodium-acp-executor/src/probe.ts
|
|
26331
26331
|
function withProbeTimeout(promise2, timeoutMs, method) {
|
|
26332
|
-
return new Promise((
|
|
26332
|
+
return new Promise((resolve2, reject) => {
|
|
26333
26333
|
const timer = setTimeout(() => {
|
|
26334
26334
|
reject(new Error(`ACP probe request '${method}' timed out after ${timeoutMs}ms`));
|
|
26335
26335
|
}, timeoutMs);
|
|
@@ -26337,7 +26337,7 @@ function withProbeTimeout(promise2, timeoutMs, method) {
|
|
|
26337
26337
|
promise2.then(
|
|
26338
26338
|
(value) => {
|
|
26339
26339
|
clearTimeout(timer);
|
|
26340
|
-
|
|
26340
|
+
resolve2(value);
|
|
26341
26341
|
},
|
|
26342
26342
|
(error62) => {
|
|
26343
26343
|
clearTimeout(timer);
|
|
@@ -26705,7 +26705,7 @@ function kimiProbeModels(stdout) {
|
|
|
26705
26705
|
return out;
|
|
26706
26706
|
}
|
|
26707
26707
|
function withProbeTimeout2(promise2, what) {
|
|
26708
|
-
return new Promise((
|
|
26708
|
+
return new Promise((resolve2, reject) => {
|
|
26709
26709
|
const timer = setTimeout(
|
|
26710
26710
|
() => reject(new Error(`${what} timed out after ${PROBE_TIMEOUT_MS}ms`)),
|
|
26711
26711
|
PROBE_TIMEOUT_MS
|
|
@@ -26714,7 +26714,7 @@ function withProbeTimeout2(promise2, what) {
|
|
|
26714
26714
|
promise2.then(
|
|
26715
26715
|
(value) => {
|
|
26716
26716
|
clearTimeout(timer);
|
|
26717
|
-
|
|
26717
|
+
resolve2(value);
|
|
26718
26718
|
},
|
|
26719
26719
|
(error62) => {
|
|
26720
26720
|
clearTimeout(timer);
|
|
@@ -26912,8 +26912,8 @@ function acpSessionModeToApply(requestedNativeModeId, startedModeId) {
|
|
|
26912
26912
|
// src/acpInstance.ts
|
|
26913
26913
|
var RESUME_SCHEMA_VERSION = 1;
|
|
26914
26914
|
var CLIENT_INFO2 = { name: "ycodium-agent-acp", version: "0.2.0" };
|
|
26915
|
-
var yieldTick = () => new Promise((
|
|
26916
|
-
setImmediate(
|
|
26915
|
+
var yieldTick = () => new Promise((resolve2) => {
|
|
26916
|
+
setImmediate(resolve2);
|
|
26917
26917
|
});
|
|
26918
26918
|
var EventBus = class {
|
|
26919
26919
|
#queued = [];
|
|
@@ -26940,8 +26940,8 @@ var EventBus = class {
|
|
|
26940
26940
|
const queued = this.#queued.shift();
|
|
26941
26941
|
if (queued !== void 0) return Promise.resolve({ done: false, value: queued });
|
|
26942
26942
|
if (this.#closed) return Promise.resolve({ done: true, value: void 0 });
|
|
26943
|
-
return new Promise((
|
|
26944
|
-
this.#waiters.push(
|
|
26943
|
+
return new Promise((resolve2) => {
|
|
26944
|
+
this.#waiters.push(resolve2);
|
|
26945
26945
|
});
|
|
26946
26946
|
}
|
|
26947
26947
|
};
|
|
@@ -26975,6 +26975,11 @@ function buildSpawnEnv(recipe, configuredHomePath, launchEnv = {}) {
|
|
|
26975
26975
|
function nowIso() {
|
|
26976
26976
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
26977
26977
|
}
|
|
26978
|
+
function acpContinuationKey(recipe) {
|
|
26979
|
+
const homePath = recipe.homePath.trim();
|
|
26980
|
+
const resolvedHomePath = homePath.length > 0 ? NodePath3.resolve(expandHomePath(homePath)) : "";
|
|
26981
|
+
return `acp:home:${recipe.binaryPath.trim()}\0${resolvedHomePath}`;
|
|
26982
|
+
}
|
|
26978
26983
|
function resolveHomePath(recipe, launchHomePath) {
|
|
26979
26984
|
const envVar = recipe.homeEnvVar.trim();
|
|
26980
26985
|
const fromEnvironment = envVar.length > 0 ? recipe.environment[envVar]?.trim() : void 0;
|
|
@@ -27249,6 +27254,7 @@ var createAcpInstance = (config2, host) => {
|
|
|
27249
27254
|
return { threadId, turns: booked.turns };
|
|
27250
27255
|
},
|
|
27251
27256
|
events,
|
|
27257
|
+
continuationKey: acpContinuationKey(recipe),
|
|
27252
27258
|
dispose: async () => {
|
|
27253
27259
|
if (disposed) return;
|
|
27254
27260
|
disposed = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/agent-acp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2130",
|
|
4
4
|
"description": "Generic ACP executor: user-supplied CLI over Agent Client Protocol stdio.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@types/node": "24.12.4",
|
|
21
21
|
"esbuild": "0.28.1",
|
|
22
22
|
"vite-plus": "0.2.2",
|
|
23
|
-
"@ycodium-ai/plugin-api": "0.2.
|
|
23
|
+
"@ycodium-ai/plugin-api": "0.2.2130",
|
|
24
24
|
"ycodium-acp-executor": "0.0.0",
|
|
25
25
|
"ycodium-acp-protocol": "0.0.0"
|
|
26
26
|
},
|