@haven_ai/cli 0.0.0-dev.202610141333.0d33318 → 0.0.0-dev.202610141909.1546aaa
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.cjs +8 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +8 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +8 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3148,7 +3148,7 @@ async function checkTextForSecrets(text, deps) {
|
|
|
3148
3148
|
|
|
3149
3149
|
// src/commands.ts
|
|
3150
3150
|
var DEFAULT_API = "https://havenbackend-production-8a00.up.railway.app";
|
|
3151
|
-
var CLI_VERSION = "0.0.0-dev.
|
|
3151
|
+
var CLI_VERSION = "0.0.0-dev.202610141909.1546aaa";
|
|
3152
3152
|
var CLI_CLIENT_IDENTITY = `@haven_ai/cli/${CLI_VERSION}`;
|
|
3153
3153
|
function accountAddressOf(s) {
|
|
3154
3154
|
return s.account_address ?? "";
|
|
@@ -3607,6 +3607,11 @@ function budgetSummary(allowances) {
|
|
|
3607
3607
|
if (!allowances || allowances.length === 0) return "\u2014";
|
|
3608
3608
|
return allowances.map((a) => `${a.allowance_amount} ${a.token_symbol}`).join(", ");
|
|
3609
3609
|
}
|
|
3610
|
+
var STILL_ENABLED_STATUSES = /* @__PURE__ */ new Set([
|
|
3611
|
+
"pending",
|
|
3612
|
+
"active",
|
|
3613
|
+
"replaced"
|
|
3614
|
+
]);
|
|
3610
3615
|
var BUDGET_WAIT_TIMEOUT_S = 15 * 60;
|
|
3611
3616
|
var BUDGET_WAIT_INTERVAL_MS = 5e3;
|
|
3612
3617
|
async function cmdBudgetGrant(args, d) {
|
|
@@ -3671,7 +3676,7 @@ async function cmdBudgetGrant(args, d) {
|
|
|
3671
3676
|
await d.sleep(BUDGET_WAIT_INTERVAL_MS);
|
|
3672
3677
|
const { delegations } = await api.get(`/agents/${id}/delegations`);
|
|
3673
3678
|
const mine = delegations.find((row) => row.delegation_hash === built.delegation_hash);
|
|
3674
|
-
if (mine
|
|
3679
|
+
if (mine && (mine.is_live ?? mine.status === "active")) {
|
|
3675
3680
|
emitGrant("active");
|
|
3676
3681
|
return EXIT.ok;
|
|
3677
3682
|
}
|
|
@@ -3775,7 +3780,7 @@ async function cmdAgentRevoke(args, d) {
|
|
|
3775
3780
|
const agent = await api.get(`/agents/${id}`);
|
|
3776
3781
|
if ((agent.live_delegation_count ?? 0) > 0) {
|
|
3777
3782
|
const { delegations } = await api.get(`/agents/${id}/delegations`);
|
|
3778
|
-
live = delegations.filter((r) =>
|
|
3783
|
+
live = delegations.filter((r) => STILL_ENABLED_STATUSES.has(r.status));
|
|
3779
3784
|
}
|
|
3780
3785
|
} catch (err) {
|
|
3781
3786
|
d.o.note(`Couldn't check budgets for agent ${id}, so the revocation was not attempted.`);
|