@cabane/companion 0.6.113 → 0.6.115
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/cli.js +12 -6
- package/dist/runtime.js +12 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2877,6 +2877,14 @@ function apiErrorCode(err) {
|
|
|
2877
2877
|
const body = err.body;
|
|
2878
2878
|
return typeof body === "object" && body !== null && typeof body.error === "string" ? body.error : null;
|
|
2879
2879
|
}
|
|
2880
|
+
function apiErrorMessage(err) {
|
|
2881
|
+
const body = err instanceof ApiError ? err.body : void 0;
|
|
2882
|
+
if (body !== null && typeof body === "object") {
|
|
2883
|
+
const message = body.message;
|
|
2884
|
+
if (typeof message === "string" && message.length > 0) return message;
|
|
2885
|
+
}
|
|
2886
|
+
return err instanceof Error ? err.message : String(err);
|
|
2887
|
+
}
|
|
2880
2888
|
function leaseRefusal(err) {
|
|
2881
2889
|
const code = apiErrorCode(err);
|
|
2882
2890
|
if (code && LEASE_REFUSALS.has(code)) return code;
|
|
@@ -4448,8 +4456,7 @@ var TASK_STAGES = [
|
|
|
4448
4456
|
"in_progress",
|
|
4449
4457
|
"in_review",
|
|
4450
4458
|
"done",
|
|
4451
|
-
"dropped"
|
|
4452
|
-
"deferred"
|
|
4459
|
+
"dropped"
|
|
4453
4460
|
];
|
|
4454
4461
|
var MIN_ASK_OPTIONS = 2;
|
|
4455
4462
|
var MAX_ASK_OPTIONS = 4;
|
|
@@ -8422,12 +8429,12 @@ async function performAct(acts, act) {
|
|
|
8422
8429
|
);
|
|
8423
8430
|
} catch (err) {
|
|
8424
8431
|
if (err instanceof ApiError) {
|
|
8425
|
-
if (err.status === 409) {
|
|
8432
|
+
if (err.status === 409 && apiErrorCode(err) === "no_active_turn") {
|
|
8426
8433
|
return toolError(
|
|
8427
8434
|
"No active turn: this turn has already settled, so the act was not performed."
|
|
8428
8435
|
);
|
|
8429
8436
|
}
|
|
8430
|
-
return toolError(`The act was refused (${err.status}): ${err
|
|
8437
|
+
return toolError(`The act was refused (${err.status}): ${apiErrorMessage(err)}`);
|
|
8431
8438
|
}
|
|
8432
8439
|
const message = err instanceof Error ? err.message : String(err);
|
|
8433
8440
|
return toolError(
|
|
@@ -10967,8 +10974,7 @@ var SseSubscriber = class {
|
|
|
10967
10974
|
}
|
|
10968
10975
|
async connect() {
|
|
10969
10976
|
const base = this.opts.baseUrl.endsWith("/") ? this.opts.baseUrl.slice(0, -1) : this.opts.baseUrl;
|
|
10970
|
-
const
|
|
10971
|
-
const url = this.opts.path ? `${base}${this.opts.path}` : `${base}/api/workspaces/${this.opts.workspaceId}/events${query}`;
|
|
10977
|
+
const url = this.opts.path ? `${base}${this.opts.path}` : `${base}/api/workspaces/${this.opts.workspaceId}/events`;
|
|
10972
10978
|
this.controller = new AbortController();
|
|
10973
10979
|
const headers = {
|
|
10974
10980
|
Authorization: `Bearer ${this.opts.token}`,
|
package/dist/runtime.js
CHANGED
|
@@ -2211,6 +2211,14 @@ function apiErrorCode(err) {
|
|
|
2211
2211
|
const body = err.body;
|
|
2212
2212
|
return typeof body === "object" && body !== null && typeof body.error === "string" ? body.error : null;
|
|
2213
2213
|
}
|
|
2214
|
+
function apiErrorMessage(err) {
|
|
2215
|
+
const body = err instanceof ApiError ? err.body : void 0;
|
|
2216
|
+
if (body !== null && typeof body === "object") {
|
|
2217
|
+
const message = body.message;
|
|
2218
|
+
if (typeof message === "string" && message.length > 0) return message;
|
|
2219
|
+
}
|
|
2220
|
+
return err instanceof Error ? err.message : String(err);
|
|
2221
|
+
}
|
|
2214
2222
|
function leaseRefusal(err) {
|
|
2215
2223
|
const code = apiErrorCode(err);
|
|
2216
2224
|
if (code && LEASE_REFUSALS.has(code)) return code;
|
|
@@ -3861,8 +3869,7 @@ var TASK_STAGES = [
|
|
|
3861
3869
|
"in_progress",
|
|
3862
3870
|
"in_review",
|
|
3863
3871
|
"done",
|
|
3864
|
-
"dropped"
|
|
3865
|
-
"deferred"
|
|
3872
|
+
"dropped"
|
|
3866
3873
|
];
|
|
3867
3874
|
var MIN_ASK_OPTIONS = 2;
|
|
3868
3875
|
var MAX_ASK_OPTIONS = 4;
|
|
@@ -7845,12 +7852,12 @@ async function performAct(acts, act) {
|
|
|
7845
7852
|
);
|
|
7846
7853
|
} catch (err) {
|
|
7847
7854
|
if (err instanceof ApiError) {
|
|
7848
|
-
if (err.status === 409) {
|
|
7855
|
+
if (err.status === 409 && apiErrorCode(err) === "no_active_turn") {
|
|
7849
7856
|
return toolError(
|
|
7850
7857
|
"No active turn: this turn has already settled, so the act was not performed."
|
|
7851
7858
|
);
|
|
7852
7859
|
}
|
|
7853
|
-
return toolError(`The act was refused (${err.status}): ${err
|
|
7860
|
+
return toolError(`The act was refused (${err.status}): ${apiErrorMessage(err)}`);
|
|
7854
7861
|
}
|
|
7855
7862
|
const message = err instanceof Error ? err.message : String(err);
|
|
7856
7863
|
return toolError(
|
|
@@ -10390,8 +10397,7 @@ var SseSubscriber = class {
|
|
|
10390
10397
|
}
|
|
10391
10398
|
async connect() {
|
|
10392
10399
|
const base = this.opts.baseUrl.endsWith("/") ? this.opts.baseUrl.slice(0, -1) : this.opts.baseUrl;
|
|
10393
|
-
const
|
|
10394
|
-
const url = this.opts.path ? `${base}${this.opts.path}` : `${base}/api/workspaces/${this.opts.workspaceId}/events${query}`;
|
|
10400
|
+
const url = this.opts.path ? `${base}${this.opts.path}` : `${base}/api/workspaces/${this.opts.workspaceId}/events`;
|
|
10395
10401
|
this.controller = new AbortController();
|
|
10396
10402
|
const headers = {
|
|
10397
10403
|
Authorization: `Bearer ${this.opts.token}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabane/companion",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.115",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Cabane Companion (headless): connect a coding agent on your machine to your Cabane workspace as a responder — drive work against your own codebase, files, and MCP servers without putting any of it in Cabane.",
|
|
6
6
|
"license": "UNLICENSED",
|