@haven_ai/connect 0.1.32-alpha.0 → 0.1.34-alpha.0
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 +18 -5
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +18 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +18 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/package.json +15 -8
package/dist/cli.cjs
CHANGED
|
@@ -535,9 +535,9 @@ var init_runtime_manifest = __esm({
|
|
|
535
535
|
mcpPackage: "@haven_ai/mcp",
|
|
536
536
|
mcpVersion: mcp.MCP_VERSION,
|
|
537
537
|
sdkPackage: "@haven_ai/sdk",
|
|
538
|
-
sdkVersion: "0.1.
|
|
538
|
+
sdkVersion: "0.1.34-alpha.0",
|
|
539
539
|
signerPackage: "@haven_ai/signer",
|
|
540
|
-
signerVersion: "0.1.
|
|
540
|
+
signerVersion: "0.1.34-alpha.0",
|
|
541
541
|
// Sourced from the SDK, never a literal (#1161). This field read '20.0.0'
|
|
542
542
|
// while every package's `engines` said `>=24` and the docs said `>=24.0.0`,
|
|
543
543
|
// so the guard that was supposed to enforce the floor waved Node v23 through
|
|
@@ -4055,7 +4055,7 @@ function defaultPromptIo() {
|
|
|
4055
4055
|
// src/runtime.ts
|
|
4056
4056
|
init_local_mcp_runtime();
|
|
4057
4057
|
init_runtime_manifest();
|
|
4058
|
-
var CONNECTOR_VERSION = "0.1.
|
|
4058
|
+
var CONNECTOR_VERSION = "0.1.34-alpha.0";
|
|
4059
4059
|
var CONNECT_OUTCOME_SCHEMA_VERSION = 1;
|
|
4060
4060
|
var failureOutcomesByError = /* @__PURE__ */ new WeakMap();
|
|
4061
4061
|
function failureOutcomeFor(runtimeHint, error) {
|
|
@@ -4267,6 +4267,9 @@ async function executeConnect(options, deps, trace) {
|
|
|
4267
4267
|
errorCode: early.errorCode ?? null,
|
|
4268
4268
|
environmentLabel: options.environmentLabel ?? "Local workspace"
|
|
4269
4269
|
});
|
|
4270
|
+
if (!early.errorCode || early.errorCode === "manual_runtime_setup_required") {
|
|
4271
|
+
log("\u2192 Action needed: approve this agent's budget in the Haven dashboard \u2014 the approval button is live now. Setup continues here in the meantime.");
|
|
4272
|
+
}
|
|
4270
4273
|
} catch {
|
|
4271
4274
|
}
|
|
4272
4275
|
}
|
|
@@ -4503,6 +4506,13 @@ function describeApprovedBudget(budget) {
|
|
|
4503
4506
|
const amount = token ? `${formatAtomicAmount(BigInt(budget.amount), token.decimals)} ${budget.token_symbol}` : `${budget.amount} ${budget.token_symbol} (atomic units)`;
|
|
4504
4507
|
return `${amount} ${describeResetPeriod(budget.reset_period_min)}`;
|
|
4505
4508
|
}
|
|
4509
|
+
function describeWaitBound(timeoutMs) {
|
|
4510
|
+
if (timeoutMs >= 12e4) {
|
|
4511
|
+
const minutes = Math.round(timeoutMs / 6e4);
|
|
4512
|
+
return `${minutes} minutes`;
|
|
4513
|
+
}
|
|
4514
|
+
return `${Math.round(timeoutMs / 1e3)}s`;
|
|
4515
|
+
}
|
|
4506
4516
|
async function waitForBudgetApproval(api, setupId, apiKey, log, options = {}) {
|
|
4507
4517
|
const intervalMs = options.intervalMs ?? 5e3;
|
|
4508
4518
|
const timeoutMs = options.timeoutMs ?? 18e4;
|
|
@@ -4513,7 +4523,7 @@ async function waitForBudgetApproval(api, setupId, apiKey, log, options = {}) {
|
|
|
4513
4523
|
const announceWaiting = () => {
|
|
4514
4524
|
if (waitingAnnounced) return;
|
|
4515
4525
|
waitingAnnounced = true;
|
|
4516
|
-
log("
|
|
4526
|
+
log("Now waiting for you to approve the budget in the Haven dashboard \u2014 approval is what unlocks the agent's Haven tools\u2026");
|
|
4517
4527
|
};
|
|
4518
4528
|
for (let i = 0; i < maxPolls; i++) {
|
|
4519
4529
|
if (i > 0) await sleep(intervalMs);
|
|
@@ -4540,7 +4550,10 @@ async function waitForBudgetApproval(api, setupId, apiKey, log, options = {}) {
|
|
|
4540
4550
|
}
|
|
4541
4551
|
announceWaiting();
|
|
4542
4552
|
if (i > 0 && i % remindEvery === 0) {
|
|
4543
|
-
|
|
4553
|
+
const elapsedSeconds = Math.round(i * intervalMs / 1e3);
|
|
4554
|
+
log(
|
|
4555
|
+
`Still waiting for budget approval in Haven \u2014 ${elapsedSeconds}s elapsed, checking every ${Math.round(intervalMs / 1e3)}s. I'll stop waiting after ${describeWaitBound(timeoutMs)}; you can approve later and the tools unlock then.`
|
|
4556
|
+
);
|
|
4544
4557
|
}
|
|
4545
4558
|
}
|
|
4546
4559
|
log(
|