@haven_ai/connect 0.0.0-dev.202610101740.1018deb → 0.0.0-dev.202610130724.e847be6

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/README.md CHANGED
@@ -454,7 +454,12 @@ untouched — and `superseded_agents_retired_locally` is `true` when that
454
454
  retirement covered every collision entry (`false`: the install ended with an
455
455
  error code and the retirement was skipped, or one entry failed). Both fields
456
456
  are absent on any other run and say nothing about the backend, where nothing is
457
- revoked.
457
+ revoked. Separately, since #3772 a run that retired at least one directory tells
458
+ Haven which ones (`POST /agent-connection-setups/{setupId}/retired-agents`, with
459
+ the new agent's key, `retired_agent_ids` only), so a session still running as a
460
+ retired agent sees a `supersededBy` warning on its own `haven_get_agent` /
461
+ `haven_get_allowances`. That report is best-effort — an older backend's 404 is
462
+ ignored silently and any other failure is one log line — and it still pauses and revokes nothing.
458
463
 
459
464
  A `wiring_collision` refusal (a non-interactive bare setup over a live
460
465
  previous agent, #2551) carries `error.superseded_agent_ids` and
package/dist/cli.cjs CHANGED
@@ -72,6 +72,25 @@ function createConnectApiClient(baseUrl, fetchImpl = fetch, clientIdentity) {
72
72
  method: "GET",
73
73
  headers: { Authorization: `Bearer ${apiKey}` }
74
74
  }),
75
+ reportRetiredAgents: async (input) => {
76
+ try {
77
+ const body = await send(
78
+ `${root}/agent-connection-setups/${encodeURIComponent(input.setupId)}/retired-agents`,
79
+ {
80
+ method: "POST",
81
+ headers: { Authorization: `Bearer ${input.apiKey}` },
82
+ body: JSON.stringify({ retired_agent_ids: input.retiredAgentIds })
83
+ }
84
+ );
85
+ const recorded = body?.recorded_agent_ids;
86
+ return {
87
+ recordedAgentIds: Array.isArray(recorded) ? recorded.filter((id) => typeof id === "string") : []
88
+ };
89
+ } catch (err) {
90
+ if (err instanceof ConnectRequestError && err.status === 404) return null;
91
+ throw err;
92
+ }
93
+ },
75
94
  updateInstallStatus: async (setupId, apiKey, input) => {
76
95
  await send(`${root}/agent-connection-setups/${encodeURIComponent(setupId)}/install-status`, {
77
96
  method: "POST",
@@ -257,9 +276,9 @@ var init_runtime_manifest = __esm({
257
276
  mcpPackage: "@haven_ai/mcp",
258
277
  mcpVersion: mcp.MCP_VERSION,
259
278
  sdkPackage: "@haven_ai/sdk",
260
- sdkVersion: "0.0.0-dev.202610101740.1018deb",
279
+ sdkVersion: "0.0.0-dev.202610130724.e847be6",
261
280
  signerPackage: "@haven_ai/signer",
262
- signerVersion: "0.0.0-dev.202610101740.1018deb",
281
+ signerVersion: "0.0.0-dev.202610130724.e847be6",
263
282
  // Sourced from the SDK, never a literal (#1161). This field read '20.0.0'
264
283
  // while every package's `engines` said `>=24` and the docs said `>=24.0.0`,
265
284
  // so the guard that was supposed to enforce the floor waved Node v23 through
@@ -4213,6 +4232,18 @@ async function executeConnect(options, deps, trace) {
4213
4232
  } catch (err) {
4214
4233
  log(`Could not report install status to Haven: ${err instanceof Error ? err.message : String(err)}`);
4215
4234
  }
4235
+ const reportableRetiredIds = [...new Set(retiredAgentIds.filter((id) => UUID_SHAPE.test(id)))];
4236
+ if (reportableRetiredIds.length > 0 && api.reportRetiredAgents) {
4237
+ try {
4238
+ await api.reportRetiredAgents({
4239
+ setupId: registration.setup_id,
4240
+ apiKey: localApiKey,
4241
+ retiredAgentIds: reportableRetiredIds
4242
+ });
4243
+ } catch (err) {
4244
+ log(`Could not tell Haven which agents were retired: ${err instanceof Error ? err.message : String(err)}`);
4245
+ }
4246
+ }
4216
4247
  let approval;
4217
4248
  const narrateApprovalWait = options.waitForApproval === true || options.waitForApproval === void 0 && (deps.isStdoutTty ?? Boolean(process.stdout.isTTY));
4218
4249
  if (narrateApprovalWait && !runtimeInstall.errorCode) {
@@ -4655,7 +4686,7 @@ async function listOtherAgentIds(baseDir, currentDirectory) {
4655
4686
  function printNextSteps(result, log, approval, approvalUrl) {
4656
4687
  for (const line of completionHandoffLines(result, approval, approvalUrl)) log(line);
4657
4688
  }
4658
- var CONNECTOR_VERSION, PRODUCTION_CHAIN_ID, CONNECTOR_CLIENT_IDENTITY, CONNECT_OUTCOME_SCHEMA_VERSION, failureOutcomesByError, RERUN_HINT;
4689
+ var CONNECTOR_VERSION, PRODUCTION_CHAIN_ID, UUID_SHAPE, CONNECTOR_CLIENT_IDENTITY, CONNECT_OUTCOME_SCHEMA_VERSION, failureOutcomesByError, RERUN_HINT;
4659
4690
  var init_runtime = __esm({
4660
4691
  "src/runtime.ts"() {
4661
4692
  init_api();
@@ -4672,8 +4703,9 @@ var init_runtime = __esm({
4672
4703
  init_tombstone();
4673
4704
  init_local_mcp_runtime();
4674
4705
  init_runtime_manifest();
4675
- CONNECTOR_VERSION = "0.0.0-dev.202610101740.1018deb";
4706
+ CONNECTOR_VERSION = "0.0.0-dev.202610130724.e847be6";
4676
4707
  PRODUCTION_CHAIN_ID = 8453;
4708
+ UUID_SHAPE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
4677
4709
  CONNECTOR_CLIENT_IDENTITY = `@haven_ai/connect/${CONNECTOR_VERSION}`;
4678
4710
  CONNECT_OUTCOME_SCHEMA_VERSION = 1;
4679
4711
  failureOutcomesByError = /* @__PURE__ */ new WeakMap();