@lambdacurry/arbor 0.21.41 → 0.21.42
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/arbor.js +8 -4
- package/package.json +1 -1
package/dist/arbor.js
CHANGED
|
@@ -16,7 +16,7 @@ var __export = (target, all) => {
|
|
|
16
16
|
// package.json
|
|
17
17
|
var package_default = {
|
|
18
18
|
name: "@lambdacurry/arbor",
|
|
19
|
-
version: "0.21.
|
|
19
|
+
version: "0.21.42",
|
|
20
20
|
description: "The Arbor CLI — a shared workspace for people and agents. The human + headless-agent write path over Arbor's guarded operation surface.",
|
|
21
21
|
keywords: [
|
|
22
22
|
"agents",
|
|
@@ -22792,7 +22792,7 @@ async function runObjectVerb(positionals, flags, ctx) {
|
|
|
22792
22792
|
|
|
22793
22793
|
// src/connect.ts
|
|
22794
22794
|
var DEFAULT_POLL_INTERVAL_MS = 2000;
|
|
22795
|
-
var sleep2 = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
22795
|
+
var sleep2 = (ms) => new Promise((r) => globalThis.setTimeout(r, ms));
|
|
22796
22796
|
function bareConnectUrl(apiUrl, returnedUrl) {
|
|
22797
22797
|
const fallback = `${apiUrl.replace(/\/$/, "")}/connect`;
|
|
22798
22798
|
if (!returnedUrl)
|
|
@@ -22836,7 +22836,6 @@ async function connect(opts) {
|
|
|
22836
22836
|
if (Date.now() > deadline) {
|
|
22837
22837
|
throw new Error("pairing timed out — ask for a new pairing key and run `arbor connect` again");
|
|
22838
22838
|
}
|
|
22839
|
-
await sleep2(pollIntervalMs);
|
|
22840
22839
|
const tokRes = await fetch(`${apiUrl}/api/agent/connect/token`, {
|
|
22841
22840
|
method: "POST",
|
|
22842
22841
|
headers,
|
|
@@ -22847,8 +22846,13 @@ async function connect(opts) {
|
|
|
22847
22846
|
saveConfig({ apiUrl, token: tok.apiKey });
|
|
22848
22847
|
return;
|
|
22849
22848
|
}
|
|
22850
|
-
if (tok.status === "pending")
|
|
22849
|
+
if (tok.status === "pending") {
|
|
22850
|
+
if (typeof globalThis.setTimeout !== "function") {
|
|
22851
|
+
throw new Error("approval pending — approve it, then rerun the same `arbor connect` command to finish saving this agent's credential");
|
|
22852
|
+
}
|
|
22853
|
+
await sleep2(pollIntervalMs);
|
|
22851
22854
|
continue;
|
|
22855
|
+
}
|
|
22852
22856
|
if (tok.status === "expired")
|
|
22853
22857
|
throw new Error("pairing expired — ask for a new pairing key");
|
|
22854
22858
|
if (tok.status === "consumed")
|
package/package.json
CHANGED