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