@lazehq/cli 0.1.131 → 0.1.132

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.
Files changed (2) hide show
  1. package/dist/laze.mjs +423 -365
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -19486,7 +19486,7 @@ var require_snapshot_utils = __commonJS({
19486
19486
  var require_snapshot_recorder = __commonJS({
19487
19487
  "../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
19488
19488
  "use strict";
19489
- var { writeFile: writeFile12, readFile: readFile40, mkdir: mkdir14 } = __require("node:fs/promises");
19489
+ var { writeFile: writeFile12, readFile: readFile39, mkdir: mkdir14 } = __require("node:fs/promises");
19490
19490
  var { dirname: dirname29, resolve: resolve27 } = __require("node:path");
19491
19491
  var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers");
19492
19492
  var { InvalidArgumentError, UndiciError } = require_errors();
@@ -19703,7 +19703,7 @@ var require_snapshot_recorder = __commonJS({
19703
19703
  throw new InvalidArgumentError("Snapshot path is required");
19704
19704
  }
19705
19705
  try {
19706
- const data = await readFile40(resolve27(path), "utf8");
19706
+ const data = await readFile39(resolve27(path), "utf8");
19707
19707
  const parsed = JSON.parse(data);
19708
19708
  if (Array.isArray(parsed)) {
19709
19709
  this.#snapshots.clear();
@@ -36960,7 +36960,7 @@ function shadowedLinkLineOf({ shadow }) {
36960
36960
  }
36961
36961
 
36962
36962
  // src/rules/cli-version.rules.ts
36963
- var STAMPED = "0.1.131";
36963
+ var STAMPED = "0.1.132";
36964
36964
  function cliVersionOf({ stamped = STAMPED } = {}) {
36965
36965
  return stamped.startsWith("__") ? "dev" : stamped;
36966
36966
  }
@@ -37535,7 +37535,7 @@ function parseArgs({ argv }) {
37535
37535
  const words = [];
37536
37536
  const flags2 = {};
37537
37537
  const lists = {};
37538
- const remember = (name3, value) => {
37538
+ const remember2 = (name3, value) => {
37539
37539
  flags2[name3] = value;
37540
37540
  lists[name3] = [...lists[name3] ?? [], value];
37541
37541
  };
@@ -37548,10 +37548,10 @@ function parseArgs({ argv }) {
37548
37548
  }
37549
37549
  const [name3 = "", inline] = arg.slice(2).split(/=(.*)/s, 2);
37550
37550
  const next = argv[index + 1];
37551
- if (inline !== void 0) remember(name3, inline);
37551
+ if (inline !== void 0) remember2(name3, inline);
37552
37552
  else if (SWITCHES.has(name3) || next === void 0 || next.startsWith("--")) flags2[name3] = true;
37553
37553
  else {
37554
- remember(name3, next);
37554
+ remember2(name3, next);
37555
37555
  index += 1;
37556
37556
  }
37557
37557
  }
@@ -60209,12 +60209,11 @@ var vaultValueShapeSchemaDefinition = external_exports.object({
60209
60209
  symbols: external_exports.string()
60210
60210
  });
60211
60211
  var vaultValueShapeSchema = vaultValueShapeSchemaDefinition;
60212
- var vaultBoundaryKeySchemaDefinition = external_exports.object({
60213
- connectionId: external_exports.string().min(1),
60214
- name: external_exports.string().min(1),
60215
- field: external_exports.string().min(1),
60216
- shape: vaultValueShapeSchema
60212
+ var vaultBoundaryHandoutSchemaDefinition = external_exports.object({
60213
+ connectionId: external_exports.string(),
60214
+ shapes: external_exports.record(external_exports.string(), vaultValueShapeSchema).optional()
60217
60215
  });
60216
+ var vaultBoundaryHandoutSchema = vaultBoundaryHandoutSchemaDefinition;
60218
60217
  var vaultEgressHostSchemaDefinition = external_exports.object({
60219
60218
  host: external_exports.string(),
60220
60219
  addedBy: external_exports.enum(["judge", "person"]),
@@ -60998,7 +60997,9 @@ var vaultRunReleaseSchemaDefinition = external_exports.discriminatedUnion("outco
60998
60997
  /** A sealed connection's values, encrypted to the run's own key. */
60999
60998
  sealed: vaultRunSealedReleaseSchema.optional(),
61000
60999
  /** What the approver told the agent, for the run to print. */
61001
- message: external_exports.string().optional()
61000
+ message: external_exports.string().optional(),
61001
+ /** On a hosted computer: the values are placeholders the egress proxy swaps. */
61002
+ boundary: vaultBoundaryHandoutSchema.optional()
61002
61003
  }),
61003
61004
  external_exports.object({
61004
61005
  outcome: external_exports.literal("ask"),
@@ -61039,7 +61040,9 @@ var vaultEgressReleaseInputSchemaDefinition = external_exports.object({
61039
61040
  reason: external_exports.string(),
61040
61041
  command: external_exports.array(external_exports.string()).default([]),
61041
61042
  /** The run's P-256 public key, base64url; a sealed connection is released only to it. */
61042
- recipient: external_exports.string().max(200).optional()
61043
+ recipient: external_exports.string().max(200).optional(),
61044
+ /** Set by a computer's egress proxy: a key it swaps comes back as shapes, not values. */
61045
+ placeholders: external_exports.boolean().default(false)
61043
61046
  });
61044
61047
  var vaultEgressReleaseInputSchema = vaultEgressReleaseInputSchemaDefinition;
61045
61048
  var vaultEgressStatusInputSchemaDefinition = external_exports.object({
@@ -62445,7 +62448,7 @@ var vaultBatchReleaseInputSchemaDefinition = external_exports.object({
62445
62448
  var vaultBatchReleaseInputSchema = vaultBatchReleaseInputSchemaDefinition;
62446
62449
  var vaultEgressBatchReleaseInputSchemaDefinition = external_exports.object({
62447
62450
  ...vaultBatchReleaseInputSchemaDefinition.shape,
62448
- /** The computer holds placeholders: a key swapped at the boundary comes back as `boundary`. */
62451
+ /** Set by a computer's egress proxy: a key it swaps comes back as `boundary`, not values. */
62449
62452
  placeholders: external_exports.boolean().default(false)
62450
62453
  });
62451
62454
  var vaultBatchConnectionSchemaDefinition = external_exports.object({
@@ -62460,8 +62463,8 @@ var vaultBatchEntrySchemaDefinition = external_exports.object({
62460
62463
  ref: external_exports.string(),
62461
62464
  connection: vaultBatchConnectionSchema.nullable(),
62462
62465
  release: vaultRunReleaseSchema.nullable(),
62463
- /** The key is swapped at the egress boundary: the computer's own placeholder stands in for it. */
62464
- boundary: external_exports.object({ connectionId: external_exports.string() }).optional()
62466
+ /** A key swapped at the egress boundary: its shapes, which the proxy makes placeholders of. */
62467
+ boundary: vaultBoundaryHandoutSchema.optional()
62465
62468
  });
62466
62469
  var vaultBatchEntrySchema = vaultBatchEntrySchemaDefinition;
62467
62470
  var vaultBatchReleaseSchemaDefinition = external_exports.object({
@@ -62497,7 +62500,7 @@ var vaultSessionSchemaDefinition = external_exports.object({
62497
62500
  });
62498
62501
  var vaultSessionSchema = vaultSessionSchemaDefinition;
62499
62502
  var vaultSessionReleaseInputSchemaDefinition = external_exports.object({
62500
- ...vaultEgressReleaseInputSchema.omit({ agentId: true }).shape,
62503
+ ...vaultEgressReleaseInputSchema.omit({ agentId: true, placeholders: true }).shape,
62501
62504
  session: vaultSessionSchema
62502
62505
  });
62503
62506
  var vaultSessionStatusInputSchemaDefinition = external_exports.object({
@@ -63967,6 +63970,7 @@ var reachableConversationSchemaDefinition = external_exports.object({
63967
63970
  readable: external_exports.boolean()
63968
63971
  });
63969
63972
  var replySideSchema = external_exports.enum(["laze", "slack"]);
63973
+ var sendViaSchema = external_exports.enum(["laze", "slack", "both"]);
63970
63974
  var conversationSummarySchemaDefinition = external_exports.object({
63971
63975
  ...conversationSchemaDefinition.shape,
63972
63976
  lastReadSeq: external_exports.number().int().nonnegative(),
@@ -64327,6 +64331,11 @@ var postMessageInputSchemaDefinition = external_exports.object({
64327
64331
  notifyAnyway: external_exports.boolean().optional(),
64328
64332
  /** In a Laze DM: also post it to this paired Slack DM, as the sender; one Laze message. */
64329
64333
  alsoSendTo: idSchema4.optional(),
64334
+ /**
64335
+ * In a Laze DM paired with the sender's Slack DM: where this post goes. Absent, a person's
64336
+ * top-level post follows the side they picked in that DM, both when they picked none.
64337
+ */
64338
+ via: sendViaSchema.optional(),
64330
64339
  attachmentIds: external_exports.array(idSchema4).max(10).default([]),
64331
64340
  /** The feed cards an agent's reply links; chat keeps them only when an agent posts. */
64332
64341
  feedRefs: external_exports.array(messageFeedRefSchemaDefinition).max(MESSAGE_FEED_REFS_MAX).optional(),
@@ -65229,7 +65238,7 @@ var chatConversationsTrpc = defineTrpcContract("chat").query("overview", { mirro
65229
65238
  var chatChannelRolesTrpc = defineTrpcContract("chat").mutation("setChannelRole").withInput(setChannelRoleInputSchema).withOutput(conversationSchema).mutation("extendChannel").withInput(extendChannelInputSchema).withOutput(conversationSchema).build();
65230
65239
  var chatMessagesTrpc = defineTrpcContract("chat").query("history", { mirrored: historyMirror }).withInput(historyInputSchema).withOutput(historyPageSchema).query("thread").withInput(messageInputSchema).withOutput(threadSchema).query("message").withInput(messageInputSchema).withOutput(messageSchema).mutation("post").withInput(postMessageInputSchema).withOutput(messageSchema).mutation("forward").withInput(forwardMessageInputSchema).withOutput(messageSchema).mutation("addMentioned").withInput(addMentionedInputSchema).withOutput(messageSchema).mutation("edit").withInput(editMessageInputSchema).withOutput(messageSchema).mutation("delete").withInput(messageInputSchema).withOutput(messageSchema).mutation("remove").withInput(messageInputSchema).withOutput(messageSchema).mutation("react").withInput(reactInputSchema).withOutput(messageSchema).mutation("signalTyping").withInput(signalTypingInputSchema).withOutput(external_exports.object({ sent: external_exports.literal(true) })).mutation("markRead").withInput(markReadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).mutation("markUnread").withInput(markUnreadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).query("search").withInput(searchInputSchema).withOutput(searchResultSchema).build();
65231
65240
  var chatFilesTrpc = defineTrpcContract("chat").mutation("startUpload").withInput(startUploadInputSchema).withOutput(uploadTicketSchema).mutation("completeUpload").withInput(completeUploadInputSchema).withOutput(attachmentSchema).mutation("transcribeVoiceSegment").withInput(transcribeVoiceSegmentInputSchema).withOutput(voiceSegmentTextSchema).mutation("abortUpload").withInput(fileInputSchema).withOutput(external_exports.object({ aborted: external_exports.literal(true) })).query("fileLink").withInput(fileLinkInputSchema).withOutput(fileLinkSchema).query("channelFiles").withInput(channelFilesInputSchema).withOutput(channelFilesSchema).mutation("renameAttachment").withInput(renameAttachmentInputSchema).withOutput(attachmentSchema).mutation("hideUnfurl").withInput(hideUnfurlInputSchema).withOutput(messageSchema).query("unfurlImage").withInput(unfurlImageInputSchema).withOutput(fileLinkSchema).query("searchGifs").withInput(searchGifsInputSchema).withOutput(gifResultsSchema).build();
65232
- var chatFollowingTrpc = defineTrpcContract("chat").mutation("setNotify").withInput(setNotifyInputSchema).withOutput(conversationSummarySchema).mutation("setReplySide").withInput(setReplySideInputSchema).withOutput(conversationSummarySchema).mutation("hideConversation").withInput(channelInputSchema).withOutput(external_exports.object({ hidden: external_exports.literal(true) })).mutation("followThread").withInput(followThreadInputSchema).withOutput(threadFollowSchema).query("threadFollow").withInput(messageInputSchema).withOutput(threadFollowSchema).query("threads", { mirrored: threadsMirror }).withInput(threadsInputSchema).withOutput(threadsPageSchema).query("threadsUnread").withInput(workspaceInputSchema).withOutput(threadsUnreadSchema).query("notificationCount").withInput(workspaceInputSchema).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).mutation("markThreadRead").withInput(messageInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).mutation("pin").withInput(pinMessageInputSchema).withOutput(messageSchema).mutation("retryMirrorDelivery").withInput(messageInputSchema).withOutput(external_exports.object({ retried: external_exports.boolean() })).query("pins").withInput(channelInputSchema).withOutput(pinsPageSchema).query("saved").withInput(savedInputSchema).withOutput(savedPageSchema).query("savedMarks").withInput(workspaceInputSchema).withOutput(savedMarksSchema).mutation("saveMessage").withInput(saveMessageInputSchema).withOutput(savedStatusSchema).mutation("markSavedDone").withInput(markSavedDoneInputSchema).withOutput(savedStatusSchema).mutation("setReminder").withInput(setReminderInputSchema).withOutput(savedStatusSchema).query("activity").withInput(activityInputSchema).withOutput(activityPageSchema).mutation("markActivityRead").withInput(markActivityReadInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).build();
65241
+ var chatFollowingTrpc = defineTrpcContract("chat").mutation("setNotify").withInput(setNotifyInputSchema).withOutput(conversationSummarySchema).mutation("setReplySide").withInput(setReplySideInputSchema).withOutput(conversationSummarySchema).mutation("hideConversation").withInput(channelInputSchema).withOutput(external_exports.object({ hidden: external_exports.literal(true) })).mutation("followThread").withInput(followThreadInputSchema).withOutput(threadFollowSchema).query("threadFollow").withInput(messageInputSchema).withOutput(threadFollowSchema).query("threads", { mirrored: threadsMirror }).withInput(threadsInputSchema).withOutput(threadsPageSchema).query("threadsUnread").withInput(workspaceInputSchema).withOutput(threadsUnreadSchema).query("notificationCount").withInput(workspaceInputSchema).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).mutation("markThreadRead").withInput(messageInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).mutation("pin").withInput(pinMessageInputSchema).withOutput(messageSchema).mutation("retryMirrorDelivery").withInput(messageInputSchema).withOutput(external_exports.object({ retried: external_exports.boolean() })).mutation("alsoSendToSlack").withInput(messageInputSchema).withOutput(messageSchema).query("pins").withInput(channelInputSchema).withOutput(pinsPageSchema).query("saved").withInput(savedInputSchema).withOutput(savedPageSchema).query("savedMarks").withInput(workspaceInputSchema).withOutput(savedMarksSchema).mutation("saveMessage").withInput(saveMessageInputSchema).withOutput(savedStatusSchema).mutation("markSavedDone").withInput(markSavedDoneInputSchema).withOutput(savedStatusSchema).mutation("setReminder").withInput(setReminderInputSchema).withOutput(savedStatusSchema).query("activity").withInput(activityInputSchema).withOutput(activityPageSchema).mutation("markActivityRead").withInput(markActivityReadInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).build();
65233
65242
  var chatSessionTrpc = defineTrpcContract("chat").mutation("realtimeToken").withInput(workspaceInputSchema).withOutput(realtimeTokenSchema).query("drafts").withInput(workspaceInputSchema).withOutput(draftListSchema).mutation("saveDraft").withInput(saveDraftInputSchema).withOutput(draftSavedSchema).mutation("deleteDraft").withInput(deleteDraftInputSchema).withOutput(draftSavedSchema).query("sent").withInput(listSentInputSchema).withOutput(sentPageSchema).query("sidebarLayout").withInput(workspaceInputSchema).withOutput(sidebarLayoutSchema).mutation("editSidebar").withInput(editSidebarInputSchema).withOutput(sidebarLayoutSchema).query("readerPreferences").withInput(workspaceInputSchema).withOutput(readerPreferencesSchema).mutation("setReaderPreferences").withInput(setReaderPreferencesInputSchema).withOutput(readerPreferencesSchema).mutation("star").withInput(starInputSchema).withOutput(starStatusSchema).query("starred").withInput(workspaceInputSchema).withOutput(starredListSchema).mutation("scrubSecrets").withInput(scrubChatInputSchema).withOutput(chatScrubReportSchema).mutation("restoreScrubbed").withInput(messageInputSchema).withOutput(messageSchema).build();
65234
65243
  var chatScheduledTrpc = defineTrpcContract("chat").mutation("scheduleMessage").withInput(scheduleMessageInputSchema).withOutput(scheduledMessageSchema).query("scheduled").withInput(listScheduledInputSchema).withOutput(scheduledListSchema).mutation("editScheduled").withInput(editScheduledInputSchema).withOutput(scheduledMessageSchema).mutation("sendScheduledNow").withInput(scheduledInputSchema).withOutput(scheduledMessageSchema).mutation("cancelScheduled").withInput(scheduledInputSchema).withOutput(scheduledMessageSchema).build();
65235
65244
  var chatPresenceTrpc = defineTrpcContract("chat").mutation("heartbeat").withInput(workspaceInputSchema).withOutput(heartbeatSchema).query("presence").withInput(workspaceInputSchema).withOutput(presenceListSchema).mutation("setStatus").withInput(setStatusInputSchema).withOutput(personPresenceSchema).mutation("clearStatus").withInput(workspaceInputSchema).withOutput(personPresenceSchema).mutation("setAway").withInput(setAwayInputSchema).withOutput(personPresenceSchema).build();
@@ -67532,17 +67541,6 @@ var egressConnectionSchemaDefinition = external_exports.object({
67532
67541
  message: "A connection holds a secret or is the vault's, never both"
67533
67542
  });
67534
67543
  var egressConnectionSchema = egressConnectionSchemaDefinition;
67535
- var boundaryKeySchemaDefinition = external_exports.object({
67536
- connectionId: external_exports.string().min(1),
67537
- name: external_exports.string().min(1),
67538
- field: external_exports.string().min(1),
67539
- shape: external_exports.object({
67540
- kept: external_exports.string().max(8),
67541
- classes: external_exports.string().regex(/^[luds]*$/),
67542
- symbols: external_exports.string()
67543
- })
67544
- });
67545
- var BOUNDARY_KEYS_MAX = 1e3;
67546
67544
  var claudeGatewayModelsSchemaDefinition = external_exports.object({
67547
67545
  opus: external_exports.string().min(1),
67548
67546
  sonnet: external_exports.string().min(1),
@@ -67578,8 +67576,6 @@ var agentSandboxSpecSchemaDefinition = external_exports.object({
67578
67576
  /** The harness model's context window, when Laze knows it: compaction is set against it. */
67579
67577
  contextWindow: external_exports.number().int().positive().optional(),
67580
67578
  connections: external_exports.array(egressConnectionSchema).default([]),
67581
- /** Vault keys swapped at the egress boundary; only for an agent in a Laze computer. */
67582
- boundaryKeys: external_exports.array(boundaryKeySchemaDefinition).max(BOUNDARY_KEYS_MAX).optional(),
67583
67579
  /** Harness credentials that must live inside the sandbox (a user's own subscription token). */
67584
67580
  harnessEnvironment: external_exports.record(external_exports.string(), external_exports.string()).default({}),
67585
67581
  /** Files the supervisor writes under the home folder at every start, by relative path. */
@@ -68722,9 +68718,11 @@ function launchEffortOf({ agent: agent3 }) {
68722
68718
  const effort = agent3.effort ?? (!running || running.efforts.includes(AGENT_DEFAULT_EFFORT) ? AGENT_DEFAULT_EFFORT : running.defaultEffort);
68723
68719
  return effort ? { kind: "set", effort } : { kind: "none" };
68724
68720
  }
68725
- function describeEffort({ agent: agent3 }) {
68721
+ function describeEffortLine({ agent: agent3 }) {
68726
68722
  const launched = launchEffortOf({ agent: agent3 });
68727
- return launched.kind === "set" ? effortLabelOf({ effort: launched.effort }) : null;
68723
+ if (launched.kind !== "set") return null;
68724
+ const label3 = effortLabelOf({ effort: launched.effort });
68725
+ return agent3.effort ? label3 : `Default (${label3})`;
68728
68726
  }
68729
68727
  function claudeWindowOf({ model }) {
68730
68728
  const name3 = model ? `${model.name} ${model.description} ${model.id}` : "";
@@ -68746,7 +68744,7 @@ function contextLineOf({ agent: agent3 }) {
68746
68744
  function agentRunSummaryOf({ agent: agent3 }) {
68747
68745
  return {
68748
68746
  model: modelLineOf({ agent: agent3 }),
68749
- effort: describeEffort({ agent: agent3 }),
68747
+ effort: describeEffortLine({ agent: agent3 }),
68750
68748
  context: contextLineOf({ agent: agent3 })
68751
68749
  };
68752
68750
  }
@@ -71976,7 +71974,12 @@ var postAsCallerInputSchemaDefinition = external_exports.object({
71976
71974
  /** Files the caller uploaded to this conversation, carried as the composer's attachments are. */
71977
71975
  attachmentIds: external_exports.array(idSchema19).max(10).optional(),
71978
71976
  /** The messages of the agent's turn this post answers. */
71979
- answers: external_exports.array(idSchema19).max(200).optional()
71977
+ answers: external_exports.array(idSchema19).max(200).optional(),
71978
+ /**
71979
+ * In a Laze DM paired with the person's Slack DM: Laze, Slack or both for this one post. Absent
71980
+ * follows the side the person picked in that DM, as the composer does.
71981
+ */
71982
+ via: sendViaSchema.optional()
71980
71983
  });
71981
71984
  var replyAsCallerInputSchemaDefinition = external_exports.object({
71982
71985
  messageId: idSchema19,
@@ -71990,7 +71993,12 @@ var replyAsCallerInputSchemaDefinition = external_exports.object({
71990
71993
  /** Files the caller uploaded to the reply's conversation, carried as the composer's are. */
71991
71994
  attachmentIds: external_exports.array(idSchema19).max(10).optional(),
71992
71995
  /** The other messages of the agent's turn this reply answers. */
71993
- answers: external_exports.array(idSchema19).max(200).optional()
71996
+ answers: external_exports.array(idSchema19).max(200).optional(),
71997
+ /**
71998
+ * In a Laze DM paired with the person's Slack DM: Laze, Slack or both for this one post. Absent
71999
+ * follows the side the person picked in that DM, as the composer does.
72000
+ */
72001
+ via: sendViaSchema.optional()
71994
72002
  });
71995
72003
  var postedMessageSchemaDefinition = external_exports.object({
71996
72004
  messageId: idSchema19,
@@ -72097,7 +72105,11 @@ var agentTurnTokenSchemaDefinition = external_exports.object({
72097
72105
  turnToken: external_exports.string(),
72098
72106
  expiresAt: external_exports.iso.datetime()
72099
72107
  });
72100
- var { agentId: _agentId, ...releaseShape } = vaultEgressReleaseInputSchema.shape;
72108
+ var {
72109
+ agentId: _agentId,
72110
+ placeholders: _placeholders,
72111
+ ...releaseShape
72112
+ } = vaultEgressReleaseInputSchema.shape;
72101
72113
  var agentVaultReleaseInputSchemaDefinition = external_exports.object({
72102
72114
  ...releaseShape,
72103
72115
  channelId: external_exports.string().min(1).max(80).nullable().default(null)
@@ -72155,7 +72167,9 @@ var agentTurnTrpc = defineTrpcContract("agents").mutation("answerAttention").wit
72155
72167
  var agentChannelSettingsTrpc = defineTrpcContract("agents").query("monitors").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema19 })).withOutput(external_exports.array(agentMonitorSchema)).query("channelLevel").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema19, channelId: idSchema19 })).withOutput(channelLevelSchema).mutation("setChannelLevel").withInput(setChannelLevelInputSchema).withOutput(channelLevelSchema).mutation("unmuteChannel").withInput(unmuteAgentChannelInputSchema).withOutput(channelLevelSchema).mutation("cancelHeld").withInput(cancelHeldInputSchema).withOutput(cancelHeldResultSchema).mutation("useLazeModelsUntilReset").withInput(useLazeModelsUntilResetInputSchema).withOutput(lazeModelsUntilResetSchema).query("agentLoginChoices").withInput(agentLoginChoicesInputSchema).withOutput(agentLoginChoicesSchema).mutation("switchAgentLogin").withInput(switchAgentLoginInputSchema).withOutput(switchedAgentLoginSchema).build();
72156
72168
  var agentJoinTrpc = defineTrpcContract("agents").query("joinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("approveJoinRequest").withInput(approveJoinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("denyJoinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).build();
72157
72169
  var agentLoginTroubleTrpc = defineTrpcContract("agents").mutation("replaceHarnessLogin").withInput(replaceHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("startHarnessSignIn").withInput(startHarnessSignInInputSchema).withOutput(harnessSignInSchema).mutation("pollHarnessSignIn").withInput(pollHarnessSignInInputSchema).withOutput(harnessSignInPollSchema).mutation("waitForLogins").withInput(loginCardActionInputSchema).withOutput(external_exports.object({ waiting: external_exports.boolean() })).mutation("useAnotherLogin").withInput(loginCardActionInputSchema).withOutput(external_exports.object({ loginName: external_exports.string() })).build();
72158
- var agentWorkspaceDefaultTrpc = defineTrpcContract("agents").query("workspaceDefault").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(workspaceDefaultAgentSchema).mutation("setWorkspaceDefault").withInput(setWorkspaceDefaultAgentInputSchema).withOutput(workspaceDefaultAgentSchema).build();
72170
+ var talkableAgentsSchemaDefinition = external_exports.object({ agentIds: external_exports.array(idSchema19) });
72171
+ var talkableAgentsSchema = talkableAgentsSchemaDefinition;
72172
+ var agentWorkspaceDefaultTrpc = defineTrpcContract("agents").query("talkable").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(talkableAgentsSchema).query("workspaceDefault").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(workspaceDefaultAgentSchema).mutation("setWorkspaceDefault").withInput(setWorkspaceDefaultAgentInputSchema).withOutput(workspaceDefaultAgentSchema).build();
72159
72173
  var agentRuntimeChoiceTrpc = defineTrpcContract("agents").query("setup").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema19 })).withOutput(agentSetupReadingSchema).mutation("retrySetup").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema19 })).withOutput(agentSchema).query("lastRuntime").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(lastRuntimeSchema).build();
72160
72174
  var agentArchiveTrpc = defineTrpcContract("agents").query("archived").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(archivedAgentSchema)).mutation("restore").withInput(restoreAgentInputSchema).withOutput(agentSchema).mutation("copy").withInput(copyAgentInputSchema).withOutput(agentSchema).mutation("deleteArchived").withInput(restoreAgentInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("transferOffers").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentTransferOfferSchema)).mutation("acceptTransfer").withInput(agentTransferInputSchema).withOutput(agentSchema).mutation("declineTransfer").withInput(agentTransferInputSchema).withOutput(external_exports.object({ declined: external_exports.literal(true) })).mutation("cancelTransfer").withInput(agentTransferInputSchema).withOutput(external_exports.object({ cancelled: external_exports.literal(true) })).build();
72161
72175
  var agentLangwatchTrpc = defineTrpcContract("agents").query("langwatchTracing").withInput(agentLangwatchInputSchema).withOutput(agentLangwatchTracingSchema).mutation("setLangwatchTracing").withInput(setAgentLangwatchInputSchema).withOutput(agentLangwatchTracingSchema).query("langwatchAgents").withInput(agentLangwatchListInputSchema).withOutput(agentLangwatchRowsSchema).build();
@@ -76667,8 +76681,19 @@ function turnAnswersOf({ context }) {
76667
76681
  return answers.length > 0 ? { answers } : {};
76668
76682
  }
76669
76683
  var FILES_USAGE = "[--image <path|url|fileId>]... [--file <path|url|fileId>]... (at most 6)";
76670
- var POST_USAGE = `Usage: laze post <channel> <text|-> [--thread <id>] ${FILES_USAGE} [--at <time> [--tz <zone>]] [--json]`;
76671
- var REPLY_USAGE = `Usage: laze reply <message-id> <text|-> [--new-thread] [--also-channel] ${FILES_USAGE} [--at <time> [--tz <zone>]]`;
76684
+ var VIA_USAGE = "[--via laze|slack|both]";
76685
+ var POST_USAGE = `Usage: laze post <channel> <text|-> [--thread <id>] ${VIA_USAGE} ${FILES_USAGE} [--at <time> [--tz <zone>]] [--json]`;
76686
+ var REPLY_USAGE = `Usage: laze reply <message-id> <text|-> [--new-thread] [--also-channel] ${VIA_USAGE} ${FILES_USAGE} [--at <time> [--tz <zone>]]`;
76687
+ var VIAS = ["laze", "slack", "both"];
76688
+ function viaOf({ args, usage: usage2 }) {
76689
+ const via = flagText({ args, name: "via" });
76690
+ if (!via) return {};
76691
+ if (!VIAS.includes(via)) {
76692
+ throw new CliUsageError(`--via takes laze, slack or both.
76693
+ ${usage2}`);
76694
+ }
76695
+ return { via };
76696
+ }
76672
76697
  function keyedPost({
76673
76698
  client,
76674
76699
  path,
@@ -76711,6 +76736,7 @@ async function post({
76711
76736
  const leaves = leavesLazeOf({ client, channel });
76712
76737
  const body = await textToSend({ context, args, profile, client, text: typed, leaves });
76713
76738
  const thread2 = flagText({ args, name: "thread" });
76739
+ const via = viaOf({ args, usage: POST_USAGE });
76714
76740
  const files2 = await filesOf({ context, args, client, at: at8, channel: async () => channel });
76715
76741
  if (at8) {
76716
76742
  const target = { channel, ...thread2 ? { threadRootId: thread2 } : {} };
@@ -76723,6 +76749,7 @@ async function post({
76723
76749
  channel,
76724
76750
  body,
76725
76751
  ...thread2 ? { threadRootId: thread2 } : {},
76752
+ ...via,
76726
76753
  ...files2,
76727
76754
  ...turnAnswersOf({ context })
76728
76755
  }
@@ -76748,6 +76775,7 @@ async function reply({
76748
76775
  const at8 = scheduleAtOf({ args, usage: REPLY_USAGE });
76749
76776
  const { client, profile, name: name3 } = await signedIn({ context, args });
76750
76777
  const channel = flagText({ args, name: "channel" });
76778
+ const via = viaOf({ args, usage: REPLY_USAGE });
76751
76779
  const typed = await textOf({ context, args, from: 2 });
76752
76780
  const leaves = leavesLazeOf({ client, channel });
76753
76781
  const body = await textToSend({ context, args, profile, client, text: typed, leaves });
@@ -76770,6 +76798,7 @@ async function reply({
76770
76798
  ...channel ? { channel } : {},
76771
76799
  ...args.flags["new-thread"] === true ? { thread: true } : {},
76772
76800
  ...args.flags["also-channel"] === true ? { alsoInChannel: true } : {},
76801
+ ...via,
76773
76802
  ...files2,
76774
76803
  ...turnAnswersOf({ context })
76775
76804
  }
@@ -85314,6 +85343,44 @@ function vaultSessionOf({
85314
85343
  return { ...base, harness: "script", id: folder.slice(0, 200) || "script" };
85315
85344
  }
85316
85345
 
85346
+ // src/services/vault-placeholders-file.service.ts
85347
+ async function placeholdersOf({ env }) {
85348
+ const path = env.LAZE_VAULT_PLACEHOLDERS;
85349
+ if (!path) return {};
85350
+ const parsed = await readStateJson({ path });
85351
+ return parsed && typeof parsed === "object" ? parsed : {};
85352
+ }
85353
+ async function remember({
85354
+ env,
85355
+ connectionId,
85356
+ fields
85357
+ }) {
85358
+ const path = env.LAZE_VAULT_PLACEHOLDERS;
85359
+ if (!path) return;
85360
+ await withStateLock({
85361
+ path,
85362
+ work: async () => {
85363
+ const held = await placeholdersOf({ env });
85364
+ const value = { ...held, [connectionId]: { ...held[connectionId], ...fields } };
85365
+ await writeStateJson({ path, value, pretty: true });
85366
+ }
85367
+ });
85368
+ }
85369
+ async function handedOut({
85370
+ context,
85371
+ name: name3,
85372
+ connectionId,
85373
+ fields
85374
+ }) {
85375
+ await remember({ env: context.environment.inherited, connectionId, fields }).catch(
85376
+ () => void 0
85377
+ );
85378
+ context.err(
85379
+ `laze vault: ${Object.keys(fields).join(", ")} of ${name3} hold a stand-in; Laze's proxy puts the key in only on sites approved for it. A command that needs the value itself (signing, a database) needs ${name3} marked "Used on the computer only".
85380
+ `
85381
+ );
85382
+ }
85383
+
85317
85384
  // src/services/vault-commands.service.ts
85318
85385
  var USAGE3 = `Usage: laze vault run <connection> --reason "<one plain sentence>" [--wait <s>] -- <command> [args...]
85319
85386
  Runs the command with the connection's values in its environment, on a Laze agent's computer,
@@ -85493,7 +85560,8 @@ async function vaultRelease({
85493
85560
  args,
85494
85561
  connection,
85495
85562
  reason: reason2,
85496
- command
85563
+ command,
85564
+ value = false
85497
85565
  }) {
85498
85566
  const deadline = deadlineOf({ args, nowMs: context.nowMs() });
85499
85567
  const env = context.environment.inherited;
@@ -85506,7 +85574,13 @@ async function vaultRelease({
85506
85574
  };
85507
85575
  const keyPath = runKeyPathOf({ turnFile, connection });
85508
85576
  const run4 = await runKeyAt({ path: keyPath });
85509
- const body = JSON.stringify({ connection, reason: reason2, command, recipient: run4.publicKey });
85577
+ const body = JSON.stringify({
85578
+ connection,
85579
+ reason: reason2,
85580
+ command,
85581
+ recipient: run4.publicKey,
85582
+ ...value && { value: true }
85583
+ });
85510
85584
  let release2;
85511
85585
  try {
85512
85586
  const first = await releaseOf({
@@ -85549,7 +85623,7 @@ async function settled2({
85549
85623
  if (!leaseHolds({ release: release2, nowMs: context.nowMs() })) await rm11(keyPath, { force: true });
85550
85624
  if (release2.message) context.err(`${release2.message}
85551
85625
  `);
85552
- return { env: values };
85626
+ return { env: values, ...release2.boundary && { boundary: release2.boundary } };
85553
85627
  }
85554
85628
  function refusedRelease(error63) {
85555
85629
  if (!(error63 instanceof LazeApiError)) throw error63;
@@ -85633,6 +85707,10 @@ ${USAGE3}`);
85633
85707
  }
85634
85708
  const released = await vaultRelease({ context, args, connection, reason: reason2, command: args.rest });
85635
85709
  if ("exitCode" in released) return released.exitCode;
85710
+ if (released.boundary) {
85711
+ const { connectionId } = released.boundary;
85712
+ await handedOut({ context, name: connection, connectionId, fields: released.env });
85713
+ }
85636
85714
  const prepared = preparedCommand({
85637
85715
  command: args.rest,
85638
85716
  released: /* @__PURE__ */ new Map([[connection, released.env]])
@@ -85865,7 +85943,8 @@ ${BROWSER_TAB_USAGE}`
85865
85943
  args,
85866
85944
  connection,
85867
85945
  reason: reason2,
85868
- command: ["laze", "browser", "login", tab]
85946
+ command: ["laze", "browser", "login", tab],
85947
+ value: true
85869
85948
  });
85870
85949
  if ("exitCode" in released) return released.exitCode;
85871
85950
  const [problem] = unusableFieldProblems({ fields: released.env });
@@ -94168,11 +94247,11 @@ async function suggestServer({
94168
94247
  }
94169
94248
 
94170
94249
  // src/services/connector-commands.service.ts
94171
- import { readFile as readFile24 } from "node:fs/promises";
94250
+ import { readFile as readFile23 } from "node:fs/promises";
94172
94251
  import { resolve as resolve14 } from "node:path";
94173
94252
 
94174
94253
  // src/services/vault-keychain-commands.service.ts
94175
- import { readFile as readFile23 } from "node:fs/promises";
94254
+ import { readFile as readFile22 } from "node:fs/promises";
94176
94255
 
94177
94256
  // src/rules/vault-input.rules.ts
94178
94257
  function secondsOf(text3) {
@@ -94465,273 +94544,6 @@ var listDevices = async ({ context, args }) => {
94465
94544
  }
94466
94545
  };
94467
94546
 
94468
- // src/services/vault-batch.service.ts
94469
- import { readFile as readFile22, rm as rm16 } from "node:fs/promises";
94470
- async function placeholdersOf({
94471
- env
94472
- }) {
94473
- const path = env.LAZE_VAULT_PLACEHOLDERS;
94474
- if (!path || !proxyOf({ env })) return {};
94475
- try {
94476
- const parsed = JSON.parse(await readFile22(path, "utf8"));
94477
- return parsed && typeof parsed === "object" ? parsed : {};
94478
- } catch {
94479
- return {};
94480
- }
94481
- }
94482
- async function batchOf({ response }) {
94483
- const text3 = await response.text();
94484
- if (!response.ok) {
94485
- const code4 = /"code"\s*:\s*"([^"]+)"/.exec(text3)?.[1] ?? `status ${response.status}`;
94486
- throw new CliUsageError(`laze vault: the batch was refused (${code4})`);
94487
- }
94488
- return JSON.parse(text3);
94489
- }
94490
- async function doorOf({
94491
- context,
94492
- args,
94493
- keyName
94494
- }) {
94495
- const env = context.environment.inherited;
94496
- const proxy = proxyOf({ env });
94497
- if (proxy) {
94498
- const turnFile = turnFileOf({ env });
94499
- const headers = {
94500
- "proxy-authorization": proxy.authorization,
94501
- "x-laze-turn": await turnTokenOf2({ env, turnFile, command: "laze vault env" })
94502
- };
94503
- return {
94504
- keyPath: runKeyPathOf({ turnFile, connection: keyName }),
94505
- ask: async (body) => batchOf({
94506
- response: await reach({
94507
- context,
94508
- url: `${proxy.origin}/vault/release-batch`,
94509
- init: {
94510
- method: "POST",
94511
- headers: { ...headers, "content-type": "application/json" },
94512
- body: JSON.stringify(body)
94513
- }
94514
- })
94515
- }),
94516
- status: async (requestId) => releaseOf({
94517
- response: await reach({
94518
- context,
94519
- url: `${proxy.origin}/vault/release/${encodeURIComponent(requestId)}`,
94520
- init: { method: "GET", headers }
94521
- })
94522
- })
94523
- };
94524
- }
94525
- const signed2 = await signedIn({ context, args }).catch(() => null);
94526
- if (signed2?.profile.kind !== "agent" && signed2?.profile.kind !== "person") {
94527
- throw new CliUsageError(`laze vault env ${WHERE}`);
94528
- }
94529
- const { name: name3 } = signed2;
94530
- const harnessSession = await currentSessionOf({ context, args });
94531
- const client = forSession({ client: signed2.client, session: harnessSession });
94532
- const door = signed2.profile.kind === "person" ? {
94533
- ask: "/api/vault/session/release-batch",
94534
- status: "/api/vault/session/release-status",
94535
- extra: { session: await vaultSessionFor({ context, args, harnessSession }) }
94536
- } : {
94537
- ask: "/api/agents/me/vault/release-batch",
94538
- status: "/api/agents/me/vault/release-status",
94539
- extra: { channelId: flagText({ args, name: "channel" }) || null }
94540
- };
94541
- return {
94542
- keyPath: runKeyPathOf({ turnFile: void 0, connection: keyName, profile: name3 }),
94543
- ask: async (body) => {
94544
- try {
94545
- return await client.post(door.ask, { ...body, ...door.extra });
94546
- } catch (error63) {
94547
- if (!(error63 instanceof LazeApiError)) throw error63;
94548
- throw new CliUsageError(`laze vault: the batch was refused: ${refusalText(error63)}`);
94549
- }
94550
- },
94551
- status: (requestId) => patiently({
94552
- context,
94553
- call: () => client.post(door.status, { requestId, ...door.extra })
94554
- }).catch(refusedRelease)
94555
- };
94556
- }
94557
- async function resolveBatch({
94558
- context,
94559
- args,
94560
- refs
94561
- }) {
94562
- const door = await doorOf({ context, args, keyName: "env-names" });
94563
- const answer6 = await door.ask({ refs, reason: "", command: [], resolveOnly: true });
94564
- return answer6.entries;
94565
- }
94566
- var keyOf = (entry2) => entry2.connection?.name ?? entry2.ref;
94567
- async function untilAllAnswered({
94568
- context,
94569
- door,
94570
- waiting,
94571
- deadline
94572
- }) {
94573
- const answered = /* @__PURE__ */ new Map();
94574
- if (waiting.size === 0) return answered;
94575
- const [first] = waiting.values();
94576
- context.err(
94577
- `laze vault: ${[...waiting.keys()].join(", ")} wait for an answer (${first?.message ?? "a card"}); cards expire after 24 hours...
94578
- `
94579
- );
94580
- while (waiting.size > 0) {
94581
- if (context.nowMs() + POLL_MS > deadline) {
94582
- context.err(
94583
- `laze vault: ${[...waiting.keys()].join(", ")} not approved yet; ask again later.
94584
- `
94585
- );
94586
- return "capped";
94587
- }
94588
- await context.sleep(POLL_MS);
94589
- for (const [key, pending2] of waiting) {
94590
- const next = await door.status(pending2.requestId);
94591
- if (next.outcome === "ask") waiting.set(key, next);
94592
- else {
94593
- waiting.delete(key);
94594
- answered.set(key, next);
94595
- }
94596
- }
94597
- }
94598
- return answered;
94599
- }
94600
- async function releaseBatch({
94601
- context,
94602
- args,
94603
- refs,
94604
- reason: reason2,
94605
- command
94606
- }) {
94607
- const deadline = deadlineOf({ args, nowMs: context.nowMs() });
94608
- const door = await doorOf({ context, args, keyName: `env:${[...refs].toSorted().join(",")}` });
94609
- const run4 = await runKeyAt({ path: door.keyPath });
94610
- const placeholders = await placeholdersOf({ env: context.environment.inherited });
94611
- let answer6;
94612
- let settled3;
94613
- try {
94614
- answer6 = await door.ask({
94615
- refs,
94616
- reason: reason2,
94617
- command,
94618
- recipient: run4.publicKey,
94619
- ...Object.keys(placeholders).length > 0 && { placeholders: true }
94620
- });
94621
- const missing = answer6.entries.filter((entry2) => !entry2.connection);
94622
- if (missing.length > 0) {
94623
- context.err(
94624
- `laze vault: no key named ${missing.map((entry2) => entry2.ref).join(", ")} in your vault or reachable by this agent
94625
- `
94626
- );
94627
- return { exitCode: 1 };
94628
- }
94629
- const sorted = sortedReleasesOf({ entries: answer6.entries });
94630
- settled3 = sorted.settled;
94631
- const { waiting } = sorted;
94632
- const later = await untilAllAnswered({ context, door, waiting, deadline });
94633
- if (later === "capped") return { exitCode: 75 };
94634
- for (const [key, release2] of later) settled3.set(key, release2);
94635
- } catch (error63) {
94636
- if (!(error63 instanceof ServerGoneError)) throw error63;
94637
- context.err(`${error63.message}. Run the command again to keep waiting.
94638
- `);
94639
- return { exitCode: 75 };
94640
- }
94641
- const swapped = swappedOf({ context, entries: answer6.entries, placeholders });
94642
- if (!swapped) return { exitCode: 1 };
94643
- const outcome = await valuesOf({
94644
- context,
94645
- entries: answer6.entries,
94646
- settled: settled3,
94647
- run: run4,
94648
- keyPath: door.keyPath
94649
- });
94650
- if ("exitCode" in outcome) return outcome;
94651
- for (const [ref2, fields] of swapped) outcome.released.set(ref2, { fields });
94652
- return outcome;
94653
- }
94654
- function swappedOf({
94655
- context,
94656
- entries,
94657
- placeholders
94658
- }) {
94659
- const swapped = /* @__PURE__ */ new Map();
94660
- for (const entry2 of entries) {
94661
- if (!entry2.boundary || !entry2.connection) continue;
94662
- const held = placeholders[entry2.boundary.connectionId] ?? {};
94663
- const fields = Object.fromEntries(
94664
- entry2.connection.fieldNames.flatMap((field) => {
94665
- const placeholder = held[field];
94666
- return placeholder ? [[field, placeholder]] : [];
94667
- })
94668
- );
94669
- if (Object.keys(fields).length === 0) {
94670
- context.err(
94671
- `laze vault: ${entry2.connection.name} is swapped by Laze's proxy, but this computer holds no placeholder for it yet; it gets one on its next start
94672
- `
94673
- );
94674
- return null;
94675
- }
94676
- swapped.set(entry2.ref, fields);
94677
- }
94678
- return swapped;
94679
- }
94680
- function sortedReleasesOf({ entries }) {
94681
- const settled3 = /* @__PURE__ */ new Map();
94682
- const waiting = /* @__PURE__ */ new Map();
94683
- for (const entry2 of entries) {
94684
- const release2 = entry2.release;
94685
- if (!release2) continue;
94686
- if (release2.outcome === "ask") waiting.set(keyOf(entry2), release2);
94687
- else settled3.set(keyOf(entry2), release2);
94688
- }
94689
- return { settled: settled3, waiting };
94690
- }
94691
- function refusalOf({
94692
- context,
94693
- settled: settled3
94694
- }) {
94695
- const codes = [];
94696
- for (const release2 of settled3.values()) {
94697
- if (release2.outcome !== "deny") continue;
94698
- context.err(`${release2.message}
94699
- `);
94700
- codes.push(release2.exitCode || 1);
94701
- }
94702
- if (codes.length === 0) return 0;
94703
- return codes.includes(77) ? 77 : codes[0] ?? 1;
94704
- }
94705
- async function valuesOf({
94706
- context,
94707
- entries,
94708
- settled: settled3,
94709
- run: run4,
94710
- keyPath
94711
- }) {
94712
- const refused = refusalOf({ context, settled: settled3 });
94713
- if (refused !== 0) {
94714
- await rm16(keyPath, { force: true });
94715
- return { exitCode: refused };
94716
- }
94717
- const opened = /* @__PURE__ */ new Map();
94718
- let keep2 = false;
94719
- for (const [key, release2] of settled3) {
94720
- if (release2.outcome !== "allow") continue;
94721
- opened.set(key, await envOf({ release: release2, run: run4 }));
94722
- if (leaseHolds({ release: release2, nowMs: context.nowMs() })) keep2 = true;
94723
- if (release2.message) context.err(`${release2.message}
94724
- `);
94725
- }
94726
- if (!keep2) await rm16(keyPath, { force: true });
94727
- const released = /* @__PURE__ */ new Map();
94728
- for (const entry2 of entries) {
94729
- const fields = opened.get(keyOf(entry2));
94730
- if (fields) released.set(entry2.ref, { fields });
94731
- }
94732
- return { released, entries };
94733
- }
94734
-
94735
94547
  // src/services/vault-share-commands.service.ts
94736
94548
  var SHARE_USAGE2 = "Usage: laze vault share <connection> --with <email|userId> [--for 1h]";
94737
94549
  var WAITING_LINE = "It waits for the owner's approval with a passkey or Face ID, in Settings > Vault.";
@@ -94860,7 +94672,7 @@ async function secretText({ context, args }) {
94860
94672
  );
94861
94673
  }
94862
94674
  const file4 = flagText({ args, name: "from-file" });
94863
- const text3 = file4 ? await readFile23(file4, "utf8") : await context.readStdin();
94675
+ const text3 = file4 ? await readFile22(file4, "utf8") : await context.readStdin();
94864
94676
  const trimmed = text3.replace(/\r?\n$/, "");
94865
94677
  if (!trimmed.trim()) throw new CliUsageError("No value: pipe it on stdin or use --from-file.");
94866
94678
  const held = await placeholdersOf({ env: context.environment.inherited });
@@ -95105,7 +94917,7 @@ async function keyText({ context, args }) {
95105
94917
  throw new CliUsageError("A key never goes in a flag: pipe it on stdin or use --from-file.");
95106
94918
  }
95107
94919
  const file4 = flagText({ args, name: "from-file" });
95108
- const text3 = file4 ? await readFile24(resolve14(context.cwd, file4), "utf8") : await context.readStdin();
94920
+ const text3 = file4 ? await readFile23(resolve14(context.cwd, file4), "utf8") : await context.readStdin();
95109
94921
  const trimmed = text3.trim();
95110
94922
  if (!trimmed) throw new CliUsageError("No key: pipe it on stdin or use --from-file.");
95111
94923
  return trimmed;
@@ -95494,7 +95306,7 @@ async function conversationDelete({ context, args }) {
95494
95306
  }
95495
95307
 
95496
95308
  // src/services/discord-commands.service.ts
95497
- import { readFile as readFile25 } from "node:fs/promises";
95309
+ import { readFile as readFile24 } from "node:fs/promises";
95498
95310
  import { resolve as resolve15 } from "node:path";
95499
95311
 
95500
95312
  // ../../modules/discord/contract/src/discord.ts
@@ -95842,7 +95654,7 @@ async function secretsOf({ context, args }) {
95842
95654
  const fromConnection = flagText({ args, name: "from-vault" });
95843
95655
  if (fromConnection) return { fromConnection };
95844
95656
  const file4 = flagText({ args, name: "from-file" });
95845
- const text3 = file4 ? await readFile25(resolve15(context.cwd, file4), "utf8") : await context.readStdin();
95657
+ const text3 = file4 ? await readFile24(resolve15(context.cwd, file4), "utf8") : await context.readStdin();
95846
95658
  const lines2 = text3.split("\n").map((line) => line.trim()).filter(Boolean);
95847
95659
  if (lines2.length !== 2) {
95848
95660
  throw new CliUsageError(
@@ -96145,7 +95957,7 @@ async function domains({ context, args }) {
96145
95957
  }
96146
95958
 
96147
95959
  // src/services/emoji-commands.service.ts
96148
- import { readFile as readFile26 } from "node:fs/promises";
95960
+ import { readFile as readFile25 } from "node:fs/promises";
96149
95961
  import { resolve as resolve16 } from "node:path";
96150
95962
  var EMOJI_USAGE = `Usage:
96151
95963
  laze emoji list [--json] the workspace's custom emoji, aliases and who added each
@@ -96186,7 +95998,7 @@ async function addEmoji({ context, args, client }) {
96186
95998
  const file4 = wordAt4(args, 3);
96187
95999
  let bytes;
96188
96000
  try {
96189
- bytes = new Uint8Array(await readFile26(resolve16(context.cwd, file4)));
96001
+ bytes = new Uint8Array(await readFile25(resolve16(context.cwd, file4)));
96190
96002
  } catch {
96191
96003
  throw new CliUsageError(`Cannot read ${file4}.`);
96192
96004
  }
@@ -96525,7 +96337,7 @@ var ExternalChannelBannerSlot = externalUi.component("channel-banner");
96525
96337
  var ExternalSharingHooksToken = externalUi.hooks("sharing");
96526
96338
 
96527
96339
  // src/services/workspace-commands.service.ts
96528
- import { readFile as readFile27 } from "node:fs/promises";
96340
+ import { readFile as readFile26 } from "node:fs/promises";
96529
96341
  import { resolve as resolve17 } from "node:path";
96530
96342
  var ROLE_NAMES2 = {
96531
96343
  OWNER: "Owner",
@@ -96708,7 +96520,7 @@ var LOGO_USAGE = "Usage: laze workspace logo set <file.png|jpg|webp> | laze work
96708
96520
  async function readLogo({ context, file: file4 }) {
96709
96521
  let bytes;
96710
96522
  try {
96711
- bytes = new Uint8Array(await readFile27(resolve17(context.cwd, file4)));
96523
+ bytes = new Uint8Array(await readFile26(resolve17(context.cwd, file4)));
96712
96524
  } catch {
96713
96525
  throw new CliUsageError(`No file to read at ${file4}.`);
96714
96526
  }
@@ -97343,7 +97155,7 @@ async function agentFeedAccess({
97343
97155
  }
97344
97156
 
97345
97157
  // src/services/feed-commands.service.ts
97346
- import { readFile as readFile28 } from "node:fs/promises";
97158
+ import { readFile as readFile27 } from "node:fs/promises";
97347
97159
  import { resolve as resolve18 } from "node:path";
97348
97160
 
97349
97161
  // ../../modules/feed/contract/src/feed.delegate.ts
@@ -98497,7 +98309,7 @@ async function feedTurnOf({
98497
98309
  const read4 = async () => {
98498
98310
  const pinned = env.LAZE_TURN_TOKEN?.trim();
98499
98311
  if (pinned) return pinned;
98500
- if (env.LAZE_TURN_FILE) return (await readFile28(env.LAZE_TURN_FILE, "utf8")).trim();
98312
+ if (env.LAZE_TURN_FILE) return (await readFile27(env.LAZE_TURN_FILE, "utf8")).trim();
98501
98313
  return agent3 ? connectedTurnTokenOf({ client, channelId: channel }) : "";
98502
98314
  };
98503
98315
  const turn = await read4().catch(() => "");
@@ -98571,7 +98383,7 @@ async function bodyOf2({
98571
98383
  flags: flags2
98572
98384
  }) {
98573
98385
  const body = { ...flags2.fields };
98574
- const read4 = (source) => "file" in source ? readFile28(resolve18(context.cwd, source.file), "utf8") : source.text;
98386
+ const read4 = (source) => "file" in source ? readFile27(resolve18(context.cwd, source.file), "utf8") : source.text;
98575
98387
  for (const [field, source] of Object.entries(flags2.texts)) body[field] = await read4(source);
98576
98388
  if (flags2.rich) {
98577
98389
  const text3 = await read4(flags2.rich.source);
@@ -98848,7 +98660,7 @@ async function textFlag({
98848
98660
  }) {
98849
98661
  const value = flagText({ args, name: name3 });
98850
98662
  if (!value.startsWith("@")) return value;
98851
- return readFile28(resolve18(context.cwd, value.slice(1)), "utf8");
98663
+ return readFile27(resolve18(context.cwd, value.slice(1)), "utf8");
98852
98664
  }
98853
98665
  async function feedList({ context, args }) {
98854
98666
  const { client, profile } = await signedIn({ context, args });
@@ -98938,7 +98750,7 @@ async function ranksOf({
98938
98750
  }) {
98939
98751
  const file4 = flagText({ args, name: "file" });
98940
98752
  if (file4) {
98941
- const parsed = JSON.parse(await readFile28(resolve18(context.cwd, file4), "utf8"));
98753
+ const parsed = JSON.parse(await readFile27(resolve18(context.cwd, file4), "utf8"));
98942
98754
  if (Array.isArray(parsed)) return parsed;
98943
98755
  throw new CliUsageError("--file holds a list of {itemId, priority}");
98944
98756
  }
@@ -99053,7 +98865,7 @@ async function feed({ context, args }) {
99053
98865
  }
99054
98866
 
99055
98867
  // src/services/github-commands.service.ts
99056
- import { readFile as readFile29 } from "node:fs/promises";
98868
+ import { readFile as readFile28 } from "node:fs/promises";
99057
98869
 
99058
98870
  // src/rules/github-signature.rules.ts
99059
98871
  var TURN_SEPARATOR = "~";
@@ -99123,7 +98935,7 @@ var REAL_GH = "/usr/bin/gh";
99123
98935
  var NOT_SET = "laze: agent_github_not_set: this agent has no GitHub connection. Run `laze github request --repo <owner/name>` to post a card that gets it in one click, or its owner runs `laze agent set-github <agent> <connection>`.";
99124
98936
  async function turnFileToken({ env }) {
99125
98937
  if (!env.LAZE_TURN_FILE) return "";
99126
- return readFile29(env.LAZE_TURN_FILE, "utf8").then(
98938
+ return readFile28(env.LAZE_TURN_FILE, "utf8").then(
99127
98939
  (text3) => text3.trim(),
99128
98940
  () => ""
99129
98941
  );
@@ -99157,7 +98969,7 @@ async function githubGh({
99157
98969
  args: args.rest,
99158
98970
  agentName: profile.name ?? "An agent",
99159
98971
  threadUrl: threadUrlOf({ env, workspaceId: profile.workspaceId }),
99160
- readBodyFile: (path) => path === "-" ? context.readStdin() : readFile29(path, "utf8")
98972
+ readBodyFile: (path) => path === "-" ? context.readStdin() : readFile28(path, "utf8")
99161
98973
  });
99162
98974
  return context.runCommand({
99163
98975
  command: [REAL_GH, ...ghArgs],
@@ -99821,7 +99633,7 @@ async function ip({ context, args }) {
99821
99633
  }
99822
99634
 
99823
99635
  // src/services/join-commands.service.ts
99824
- import { rm as rm17 } from "node:fs/promises";
99636
+ import { rm as rm16 } from "node:fs/promises";
99825
99637
  import { hostname as hostname9 } from "node:os";
99826
99638
  import { dirname as dirname22, join as join31 } from "node:path";
99827
99639
  var DEFAULT_WAIT_SECONDS2 = 100;
@@ -99843,7 +99655,7 @@ async function keepPending({ context, pending: pending2 }) {
99843
99655
  await writeStateJson({ path: pendingPathOf({ context }), value: pending2 });
99844
99656
  }
99845
99657
  async function dropPending({ context }) {
99846
- await rm17(pendingPathOf({ context }), { force: true });
99658
+ await rm16(pendingPathOf({ context }), { force: true });
99847
99659
  }
99848
99660
  function waitSecondsOf3({ args }) {
99849
99661
  const raw = flagText({ args, name: "timeout" });
@@ -100773,7 +100585,14 @@ ${USAGE13}`);
100773
100585
  ${USAGE13}`);
100774
100586
  const env = {};
100775
100587
  for (const connection of new Set(connections)) {
100776
- const released = await vaultRelease({ context, args, connection, reason: reason2, command: args.rest });
100588
+ const released = await vaultRelease({
100589
+ context,
100590
+ args,
100591
+ connection,
100592
+ reason: reason2,
100593
+ command: args.rest,
100594
+ value: true
100595
+ });
100777
100596
  if ("exitCode" in released) return released;
100778
100597
  Object.assign(env, released.env);
100779
100598
  }
@@ -101102,18 +100921,18 @@ async function serveMcp({
101102
100921
  }
101103
100922
 
101104
100923
  // src/services/memory-commands.service.ts
101105
- import { readdir as readdir7, readFile as readFile31 } from "node:fs/promises";
100924
+ import { readdir as readdir7, readFile as readFile30 } from "node:fs/promises";
101106
100925
  import { join as join32, resolve as resolve20 } from "node:path";
101107
100926
 
101108
100927
  // src/services/mount-files.service.ts
101109
- import { mkdir as mkdir11, readFile as readFile30, rm as rm18, writeFile as writeFile8 } from "node:fs/promises";
100928
+ import { mkdir as mkdir11, readFile as readFile29, rm as rm17, writeFile as writeFile8 } from "node:fs/promises";
101110
100929
  import { dirname as dirname23, relative as relative4, resolve as resolve19 } from "node:path";
101111
100930
  async function textArgument({
101112
100931
  context,
101113
100932
  value
101114
100933
  }) {
101115
100934
  if (value === "-") return context.readStdin();
101116
- if (value.startsWith("@")) return readFile30(resolve19(context.cwd, value.slice(1)), "utf8");
100935
+ if (value.startsWith("@")) return readFile29(resolve19(context.cwd, value.slice(1)), "utf8");
101117
100936
  return value;
101118
100937
  }
101119
100938
  function turnChannel({ context, args }) {
@@ -101126,7 +100945,7 @@ async function writeMount({
101126
100945
  files: files2
101127
100946
  }) {
101128
100947
  const root = resolve19(context.cwd, flagText({ args, name: "dir", fallback: ".laze" }), folder);
101129
- await rm18(root, { recursive: true, force: true });
100948
+ await rm17(root, { recursive: true, force: true });
101130
100949
  await mkdir11(root, { recursive: true });
101131
100950
  for (const file4 of files2) {
101132
100951
  const target = resolve19(root, file4.path);
@@ -101260,7 +101079,7 @@ async function turnTokenOf5({ context }) {
101260
101079
  const pinned = env.LAZE_TURN_TOKEN?.trim();
101261
101080
  if (pinned) return pinned;
101262
101081
  if (!env.LAZE_TURN_FILE) return "";
101263
- return readFile31(env.LAZE_TURN_FILE, "utf8").then(
101082
+ return readFile30(env.LAZE_TURN_FILE, "utf8").then(
101264
101083
  (text3) => text3.trim(),
101265
101084
  () => ""
101266
101085
  );
@@ -101390,7 +101209,7 @@ async function siestaImport({
101390
101209
  dir
101391
101210
  }) {
101392
101211
  const root = resolve20(context.cwd, dir);
101393
- const log = await readFile31(join32(root, "LOG.md"));
101212
+ const log = await readFile30(join32(root, "LOG.md"));
101394
101213
  const names = (await readdir7(join32(root, "tree")).catch(() => [])).filter(
101395
101214
  (name3) => /^\d{1,6}-\d{1,6}\.md$/.test(name3)
101396
101215
  );
@@ -101398,7 +101217,7 @@ async function siestaImport({
101398
101217
  await Promise.all(
101399
101218
  names.map(async (name3) => [
101400
101219
  name3.slice(0, -3),
101401
- (await readFile31(join32(root, "tree", name3))).toString("base64")
101220
+ (await readFile30(join32(root, "tree", name3))).toString("base64")
101402
101221
  ])
101403
101222
  )
101404
101223
  );
@@ -101418,7 +101237,7 @@ async function memoryImport({ context, args }) {
101418
101237
  const dir = flagText({ args, name: "optmem" });
101419
101238
  if (!dir) throw new CliUsageError(USAGE14);
101420
101239
  const root = resolve20(context.cwd, dir);
101421
- const log = await readFile31(join32(root, "LOG.txt"));
101240
+ const log = await readFile30(join32(root, "LOG.txt"));
101422
101241
  const sizes2 = (await readdir7(join32(root, "TREE")).catch(() => [])).filter(
101423
101242
  (name3) => /^\d{1,4}$/.test(name3)
101424
101243
  );
@@ -101426,7 +101245,7 @@ async function memoryImport({ context, args }) {
101426
101245
  await Promise.all(
101427
101246
  sizes2.map(async (size) => [
101428
101247
  size,
101429
- (await readFile31(join32(root, "TREE", size))).toString("base64")
101248
+ (await readFile30(join32(root, "TREE", size))).toString("base64")
101430
101249
  ])
101431
101250
  )
101432
101251
  );
@@ -102023,7 +101842,7 @@ async function openclaw({
102023
101842
 
102024
101843
  // src/services/operator-key-commands.service.ts
102025
101844
  import { createHash as createHash10, randomBytes as randomBytes5 } from "node:crypto";
102026
- import { mkdir as mkdir12, readFile as readFile32, rm as rm19, writeFile as writeFile9 } from "node:fs/promises";
101845
+ import { mkdir as mkdir12, readFile as readFile31, rm as rm18, writeFile as writeFile9 } from "node:fs/promises";
102027
101846
  import { dirname as dirname24, join as join33 } from "node:path";
102028
101847
 
102029
101848
  // ../../modules/audit-log/contract/src/audit-log.api.ts
@@ -103962,7 +103781,7 @@ async function forgetIfOver({
103962
103781
  const key = await client.post(OPERATOR_KEY_REST_PATHS.status, { keyId });
103963
103782
  const windowOver = key.endsAt !== null && Temporal3.Instant.from(key.endsAt).epochMilliseconds <= context.nowMs();
103964
103783
  if (key.status !== "pending" && (key.status !== "approved" || windowOver || key.spentAt)) {
103965
- await rm19(keyFile({ context, keyId }), { force: true });
103784
+ await rm18(keyFile({ context, keyId }), { force: true });
103966
103785
  }
103967
103786
  return key;
103968
103787
  }
@@ -103975,7 +103794,7 @@ async function useKey({
103975
103794
  if (!keyId) throw new CliUsageError(OPERATOR_KEY_USAGE);
103976
103795
  const { client } = await signedIn({ context, args });
103977
103796
  const path = keyFile({ context, keyId });
103978
- const secret = await readFile32(path, "utf8").catch(() => null);
103797
+ const secret = await readFile31(path, "utf8").catch(() => null);
103979
103798
  if (secret === null) {
103980
103799
  throw new CliUsageError(`No operator key ${keyId} is kept on this machine.`);
103981
103800
  }
@@ -104174,7 +103993,7 @@ function watchingRelease({
104174
103993
  }
104175
103994
 
104176
103995
  // src/services/rush-guard.service.ts
104177
- import { rm as rm20 } from "node:fs/promises";
103996
+ import { rm as rm19 } from "node:fs/promises";
104178
103997
  var WATCH_MS3 = 2e3;
104179
103998
  async function guardRound(guard) {
104180
103999
  const { context, client, name: name3, lock, claudePid, session, rush, launch } = guard;
@@ -104261,10 +104080,10 @@ async function rushWakeHook({ context, args }) {
104261
104080
  return await guardRounds(guard);
104262
104081
  } finally {
104263
104082
  if ((await holderOf({ path: lock }))?.pid === context.processes.pid)
104264
- await rm20(lock, { force: true });
104083
+ await rm19(lock, { force: true });
104265
104084
  }
104266
104085
  } finally {
104267
- await rm20(path, { force: true });
104086
+ await rm19(path, { force: true });
104268
104087
  }
104269
104088
  }
104270
104089
 
@@ -104433,7 +104252,7 @@ async function schedule({ context, args }) {
104433
104252
  }
104434
104253
 
104435
104254
  // src/services/skill-commands.service.ts
104436
- import { readdir as readdir8, readFile as readFile33 } from "node:fs/promises";
104255
+ import { readdir as readdir8, readFile as readFile32 } from "node:fs/promises";
104437
104256
  import { join as join35, relative as relative5, resolve as resolve22 } from "node:path";
104438
104257
  var USAGE18 = `Usage:
104439
104258
  laze skill list [--agent <agentId>]
@@ -104456,7 +104275,7 @@ async function folderFiles({ root }) {
104456
104275
  for (const entry2 of entries) {
104457
104276
  if (!entry2.isFile()) continue;
104458
104277
  const full = join35(entry2.parentPath, entry2.name);
104459
- files2.push({ path: relative5(root, full), content: await readFile33(full, "utf8") });
104278
+ files2.push({ path: relative5(root, full), content: await readFile32(full, "utf8") });
104460
104279
  }
104461
104280
  return files2.toSorted((a, b) => a.path.localeCompare(b.path));
104462
104281
  }
@@ -104554,7 +104373,7 @@ async function skillUpdate({ context, args }) {
104554
104373
  if (!name3 || !newName && description === void 0 && !skillMdFile) {
104555
104374
  throw new CliUsageError(USAGE18);
104556
104375
  }
104557
- const skillMd = skillMdFile ? await readFile33(resolve22(context.cwd, skillMdFile), "utf8") : void 0;
104376
+ const skillMd = skillMdFile ? await readFile32(resolve22(context.cwd, skillMdFile), "utf8") : void 0;
104558
104377
  const { client } = await signedIn({ context, args });
104559
104378
  const updated = await client.post("/api/skills/update", {
104560
104379
  name: name3,
@@ -104600,7 +104419,7 @@ async function skill({ context, args }) {
104600
104419
  }
104601
104420
 
104602
104421
  // src/services/slack-commands.service.ts
104603
- import { readFile as readFile34 } from "node:fs/promises";
104422
+ import { readFile as readFile33 } from "node:fs/promises";
104604
104423
  import { resolve as resolve23 } from "node:path";
104605
104424
  var SLACK_USAGE = `Usage (a person's key; Slack stays the source, the bot joins no channel by itself):
104606
104425
  laze slack overview connected Slack workspaces, mirrors, your link
@@ -104651,7 +104470,7 @@ async function secretLines({ context, args }) {
104651
104470
  throw new CliUsageError("A secret never goes in a flag: pipe it on stdin or use --from-file.");
104652
104471
  }
104653
104472
  const file4 = flagText({ args, name: "from-file" });
104654
- const text3 = file4 ? await readFile34(resolve23(context.cwd, file4), "utf8") : await context.readStdin();
104473
+ const text3 = file4 ? await readFile33(resolve23(context.cwd, file4), "utf8") : await context.readStdin();
104655
104474
  return text3.split("\n").map((line) => line.trim()).filter(Boolean);
104656
104475
  }
104657
104476
  async function secretsOf2({
@@ -104969,7 +104788,7 @@ async function slack({
104969
104788
  }
104970
104789
 
104971
104790
  // src/services/sso-commands.service.ts
104972
- import { readFile as readFile35 } from "node:fs/promises";
104791
+ import { readFile as readFile34 } from "node:fs/promises";
104973
104792
  var SSO_USAGE = `Usage:
104974
104793
  laze sso domains claimed domains and how each signs in (admins)
104975
104794
  laze sso claim <domain> the TXT record that proves the domain
@@ -105056,7 +104875,7 @@ function refuseSecretFlags({ args }) {
105056
104875
  }
105057
104876
  async function clientSecretOf({ context, args }) {
105058
104877
  const file4 = flagText({ args, name: "from-file" });
105059
- const text3 = file4 ? await readFile35(file4, "utf8") : await context.readStdin();
104878
+ const text3 = file4 ? await readFile34(file4, "utf8") : await context.readStdin();
105060
104879
  const secret = text3.trim();
105061
104880
  if (!secret) throw new CliUsageError("No client secret: pipe it on stdin or use --from-file.");
105062
104881
  return secret;
@@ -105400,7 +105219,7 @@ async function checkInstalled({
105400
105219
  }
105401
105220
 
105402
105221
  // src/services/vault-env-commands.service.ts
105403
- import { readFile as readFile36, stat as stat12 } from "node:fs/promises";
105222
+ import { readFile as readFile35, stat as stat12 } from "node:fs/promises";
105404
105223
  import { dirname as dirname26, join as join36, resolve as resolve24 } from "node:path";
105405
105224
 
105406
105225
  // src/rules/vault-manifest.rules.ts
@@ -105488,6 +105307,243 @@ function credentialProcessJson(fields) {
105488
105307
  });
105489
105308
  }
105490
105309
 
105310
+ // src/services/vault-batch.service.ts
105311
+ import { rm as rm20 } from "node:fs/promises";
105312
+ async function batchOf({ response }) {
105313
+ const text3 = await response.text();
105314
+ if (!response.ok) {
105315
+ const code4 = /"code"\s*:\s*"([^"]+)"/.exec(text3)?.[1] ?? `status ${response.status}`;
105316
+ throw new CliUsageError(`laze vault: the batch was refused (${code4})`);
105317
+ }
105318
+ return JSON.parse(text3);
105319
+ }
105320
+ async function doorOf({
105321
+ context,
105322
+ args,
105323
+ keyName
105324
+ }) {
105325
+ const env = context.environment.inherited;
105326
+ const proxy = proxyOf({ env });
105327
+ if (proxy) {
105328
+ const turnFile = turnFileOf({ env });
105329
+ const headers = {
105330
+ "proxy-authorization": proxy.authorization,
105331
+ "x-laze-turn": await turnTokenOf2({ env, turnFile, command: "laze vault env" })
105332
+ };
105333
+ return {
105334
+ keyPath: runKeyPathOf({ turnFile, connection: keyName }),
105335
+ ask: async (body) => batchOf({
105336
+ response: await reach({
105337
+ context,
105338
+ url: `${proxy.origin}/vault/release-batch`,
105339
+ init: {
105340
+ method: "POST",
105341
+ headers: { ...headers, "content-type": "application/json" },
105342
+ body: JSON.stringify(body)
105343
+ }
105344
+ })
105345
+ }),
105346
+ status: async (requestId) => releaseOf({
105347
+ response: await reach({
105348
+ context,
105349
+ url: `${proxy.origin}/vault/release/${encodeURIComponent(requestId)}`,
105350
+ init: { method: "GET", headers }
105351
+ })
105352
+ })
105353
+ };
105354
+ }
105355
+ const signed2 = await signedIn({ context, args }).catch(() => null);
105356
+ if (signed2?.profile.kind !== "agent" && signed2?.profile.kind !== "person") {
105357
+ throw new CliUsageError(`laze vault env ${WHERE}`);
105358
+ }
105359
+ const { name: name3 } = signed2;
105360
+ const harnessSession = await currentSessionOf({ context, args });
105361
+ const client = forSession({ client: signed2.client, session: harnessSession });
105362
+ const door = signed2.profile.kind === "person" ? {
105363
+ ask: "/api/vault/session/release-batch",
105364
+ status: "/api/vault/session/release-status",
105365
+ extra: { session: await vaultSessionFor({ context, args, harnessSession }) }
105366
+ } : {
105367
+ ask: "/api/agents/me/vault/release-batch",
105368
+ status: "/api/agents/me/vault/release-status",
105369
+ extra: { channelId: flagText({ args, name: "channel" }) || null }
105370
+ };
105371
+ return {
105372
+ keyPath: runKeyPathOf({ turnFile: void 0, connection: keyName, profile: name3 }),
105373
+ ask: async (body) => {
105374
+ try {
105375
+ return await client.post(door.ask, { ...body, ...door.extra });
105376
+ } catch (error63) {
105377
+ if (!(error63 instanceof LazeApiError)) throw error63;
105378
+ throw new CliUsageError(`laze vault: the batch was refused: ${refusalText(error63)}`);
105379
+ }
105380
+ },
105381
+ status: (requestId) => patiently({
105382
+ context,
105383
+ call: () => client.post(door.status, { requestId, ...door.extra })
105384
+ }).catch(refusedRelease)
105385
+ };
105386
+ }
105387
+ async function resolveBatch({
105388
+ context,
105389
+ args,
105390
+ refs
105391
+ }) {
105392
+ const door = await doorOf({ context, args, keyName: "env-names" });
105393
+ const answer6 = await door.ask({ refs, reason: "", command: [], resolveOnly: true });
105394
+ return answer6.entries;
105395
+ }
105396
+ var keyOf = (entry2) => entry2.connection?.name ?? entry2.ref;
105397
+ async function untilAllAnswered({
105398
+ context,
105399
+ door,
105400
+ waiting,
105401
+ deadline
105402
+ }) {
105403
+ const answered = /* @__PURE__ */ new Map();
105404
+ if (waiting.size === 0) return answered;
105405
+ const [first] = waiting.values();
105406
+ context.err(
105407
+ `laze vault: ${[...waiting.keys()].join(", ")} wait for an answer (${first?.message ?? "a card"}); cards expire after 24 hours...
105408
+ `
105409
+ );
105410
+ while (waiting.size > 0) {
105411
+ if (context.nowMs() + POLL_MS > deadline) {
105412
+ context.err(
105413
+ `laze vault: ${[...waiting.keys()].join(", ")} not approved yet; ask again later.
105414
+ `
105415
+ );
105416
+ return "capped";
105417
+ }
105418
+ await context.sleep(POLL_MS);
105419
+ for (const [key, pending2] of waiting) {
105420
+ const next = await door.status(pending2.requestId);
105421
+ if (next.outcome === "ask") waiting.set(key, next);
105422
+ else {
105423
+ waiting.delete(key);
105424
+ answered.set(key, next);
105425
+ }
105426
+ }
105427
+ }
105428
+ return answered;
105429
+ }
105430
+ async function releaseBatch({
105431
+ context,
105432
+ args,
105433
+ refs,
105434
+ reason: reason2,
105435
+ command
105436
+ }) {
105437
+ const deadline = deadlineOf({ args, nowMs: context.nowMs() });
105438
+ const door = await doorOf({ context, args, keyName: `env:${[...refs].toSorted().join(",")}` });
105439
+ const run4 = await runKeyAt({ path: door.keyPath });
105440
+ let answer6;
105441
+ let settled3;
105442
+ try {
105443
+ answer6 = await door.ask({
105444
+ refs,
105445
+ reason: reason2,
105446
+ command,
105447
+ recipient: run4.publicKey
105448
+ });
105449
+ const missing = answer6.entries.filter((entry2) => !entry2.connection);
105450
+ if (missing.length > 0) {
105451
+ context.err(
105452
+ `laze vault: no key named ${missing.map((entry2) => entry2.ref).join(", ")} in your vault or reachable by this agent
105453
+ `
105454
+ );
105455
+ return { exitCode: 1 };
105456
+ }
105457
+ const sorted = sortedReleasesOf({ entries: answer6.entries });
105458
+ settled3 = sorted.settled;
105459
+ const { waiting } = sorted;
105460
+ const later = await untilAllAnswered({ context, door, waiting, deadline });
105461
+ if (later === "capped") return { exitCode: 75 };
105462
+ for (const [key, release2] of later) settled3.set(key, release2);
105463
+ } catch (error63) {
105464
+ if (!(error63 instanceof ServerGoneError)) throw error63;
105465
+ context.err(`${error63.message}. Run the command again to keep waiting.
105466
+ `);
105467
+ return { exitCode: 75 };
105468
+ }
105469
+ const unswapped = answer6.entries.find((entry2) => entry2.boundary && !entry2.release);
105470
+ if (unswapped) {
105471
+ context.err(
105472
+ `laze vault: ${unswapped.ref} is swapped by Laze's proxy, which did not hand out its stand-in; run the command again
105473
+ `
105474
+ );
105475
+ return { exitCode: 75 };
105476
+ }
105477
+ const outcome = await valuesOf({
105478
+ context,
105479
+ entries: answer6.entries,
105480
+ settled: settled3,
105481
+ run: run4,
105482
+ keyPath: door.keyPath
105483
+ });
105484
+ if ("exitCode" in outcome) return outcome;
105485
+ for (const [key, release2] of settled3) {
105486
+ if (release2.outcome !== "allow" || !release2.boundary) continue;
105487
+ const { connectionId } = release2.boundary;
105488
+ await handedOut({ context, name: key, connectionId, fields: release2.env });
105489
+ }
105490
+ return outcome;
105491
+ }
105492
+ function sortedReleasesOf({ entries }) {
105493
+ const settled3 = /* @__PURE__ */ new Map();
105494
+ const waiting = /* @__PURE__ */ new Map();
105495
+ for (const entry2 of entries) {
105496
+ const release2 = entry2.release;
105497
+ if (!release2) continue;
105498
+ if (release2.outcome === "ask") waiting.set(keyOf(entry2), release2);
105499
+ else settled3.set(keyOf(entry2), release2);
105500
+ }
105501
+ return { settled: settled3, waiting };
105502
+ }
105503
+ function refusalOf({
105504
+ context,
105505
+ settled: settled3
105506
+ }) {
105507
+ const codes = [];
105508
+ for (const release2 of settled3.values()) {
105509
+ if (release2.outcome !== "deny") continue;
105510
+ context.err(`${release2.message}
105511
+ `);
105512
+ codes.push(release2.exitCode || 1);
105513
+ }
105514
+ if (codes.length === 0) return 0;
105515
+ return codes.includes(77) ? 77 : codes[0] ?? 1;
105516
+ }
105517
+ async function valuesOf({
105518
+ context,
105519
+ entries,
105520
+ settled: settled3,
105521
+ run: run4,
105522
+ keyPath
105523
+ }) {
105524
+ const refused = refusalOf({ context, settled: settled3 });
105525
+ if (refused !== 0) {
105526
+ await rm20(keyPath, { force: true });
105527
+ return { exitCode: refused };
105528
+ }
105529
+ const opened = /* @__PURE__ */ new Map();
105530
+ let keep2 = false;
105531
+ for (const [key, release2] of settled3) {
105532
+ if (release2.outcome !== "allow") continue;
105533
+ opened.set(key, await envOf({ release: release2, run: run4 }));
105534
+ if (leaseHolds({ release: release2, nowMs: context.nowMs() })) keep2 = true;
105535
+ if (release2.message) context.err(`${release2.message}
105536
+ `);
105537
+ }
105538
+ if (!keep2) await rm20(keyPath, { force: true });
105539
+ const released = /* @__PURE__ */ new Map();
105540
+ for (const entry2 of entries) {
105541
+ const fields = opened.get(keyOf(entry2));
105542
+ if (fields) released.set(entry2.ref, { fields });
105543
+ }
105544
+ return { released, entries };
105545
+ }
105546
+
105491
105547
  // src/services/vault-env-commands.service.ts
105492
105548
  var ENV_USAGE = `Usage: laze vault env [<file>] [--env <name>] --reason "<one plain sentence>" [--wait <s>] -- <command> [args...]
105493
105549
  laze vault env [<file>] [--env <name>] --names
@@ -105557,7 +105613,7 @@ async function manifestOf({
105557
105613
  args
105558
105614
  }) {
105559
105615
  const file4 = await manifestPathOf({ context, args });
105560
- const text3 = await readFile36(file4, "utf8").catch(() => {
105616
+ const text3 = await readFile35(file4, "utf8").catch(() => {
105561
105617
  throw new CliUsageError(`laze vault: cannot read ${file4}`);
105562
105618
  });
105563
105619
  return { file: file4, lines: parseManifest({ text: text3, file: file4 }) };
@@ -105919,7 +105975,7 @@ async function vaultScrub({ context, args }) {
105919
105975
  }
105920
105976
 
105921
105977
  // src/services/whatsapp-business-commands.service.ts
105922
- import { readFile as readFile37 } from "node:fs/promises";
105978
+ import { readFile as readFile36 } from "node:fs/promises";
105923
105979
  import { resolve as resolve25 } from "node:path";
105924
105980
 
105925
105981
  // ../../modules/whatsapp-business/contract/src/whatsapp-business.prices.ts
@@ -106416,7 +106472,7 @@ async function secretsOf3({ context, args }) {
106416
106472
  const fromConnection = flagText({ args, name: "from-vault" });
106417
106473
  if (fromConnection) return { fromConnection };
106418
106474
  const file4 = flagText({ args, name: "from-file" });
106419
- const text3 = file4 ? await readFile37(resolve25(context.cwd, file4), "utf8") : await context.readStdin();
106475
+ const text3 = file4 ? await readFile36(resolve25(context.cwd, file4), "utf8") : await context.readStdin();
106420
106476
  const lines2 = text3.split("\n").map((line) => line.trim()).filter(Boolean);
106421
106477
  if (lines2.length !== 2) {
106422
106478
  throw new CliUsageError(
@@ -107132,6 +107188,8 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
107132
107188
  your reply is the post or reply: once it is where it belongs, end the turn with no recap
107133
107189
  --new-thread on reply starts a thread under a top-level message instead
107134
107190
  --also-channel on a thread reply shows it in the channel too, as "Also send to #channel" does
107191
+ in a DM paired with Slack a post goes where you picked in that DM (via Laze and Slack unless
107192
+ you changed it); --via laze|slack|both on post or reply sends this one message elsewhere
107135
107193
  --image <path|url|fileId> and --file <path|url|fileId> on post or reply attach files
107136
107194
  (repeatable, at most 6), uploaded to the conversation as the web composer does
107137
107195
  --at 2026-10-20T09:00 [--tz Europe/Amsterdam] on post or reply sends it later instead
@@ -107621,7 +107679,7 @@ import {
107621
107679
  randomBytes as randomBytes6,
107622
107680
  sign
107623
107681
  } from "node:crypto";
107624
- import { chmod, link, mkdir as mkdir13, readFile as readFile38, rm as rm21, writeFile as writeFile11 } from "node:fs/promises";
107682
+ import { chmod, link, mkdir as mkdir13, readFile as readFile37, rm as rm21, writeFile as writeFile11 } from "node:fs/promises";
107625
107683
  import { dirname as dirname27, join as join37 } from "node:path";
107626
107684
  var KEYCHAIN_SERVICE = "laze-cli-machine-key";
107627
107685
  var runProgram = ({ program, args, stdin: stdin2, timeoutMs }) => new Promise((resolve27, reject) => {
@@ -107694,7 +107752,7 @@ var MachineKeyStore = class _MachineKeyStore {
107694
107752
  async read() {
107695
107753
  let meta3;
107696
107754
  try {
107697
- meta3 = machineKeyRegistrationSchema.parse(JSON.parse(await readFile38(this.metaPath, "utf8")));
107755
+ meta3 = machineKeyRegistrationSchema.parse(JSON.parse(await readFile37(this.metaPath, "utf8")));
107698
107756
  } catch {
107699
107757
  return null;
107700
107758
  }
@@ -107709,7 +107767,7 @@ var MachineKeyStore = class _MachineKeyStore {
107709
107767
  "-w"
107710
107768
  ],
107711
107769
  timeoutMs: 1e4
107712
- }) : await readFile38(this.pemPathOf(meta3.jwk), "utf8");
107770
+ }) : await readFile37(this.pemPathOf(meta3.jwk), "utf8");
107713
107771
  return keyOf2({ meta: meta3, privateKey: createPrivateKey(pemOf(pem)) });
107714
107772
  }
107715
107773
  async make() {
@@ -107851,7 +107909,7 @@ function machineProofFetch({
107851
107909
  // src/services/processes.service.ts
107852
107910
  import { execFile as execFile3, spawn as spawn4, spawnSync } from "node:child_process";
107853
107911
  import { closeSync, mkdirSync, openSync, renameSync, statSync } from "node:fs";
107854
- import { readFile as readFile39, readlink } from "node:fs/promises";
107912
+ import { readFile as readFile38, readlink } from "node:fs/promises";
107855
107913
  import { dirname as dirname28 } from "node:path";
107856
107914
  import { promisify as promisify2 } from "node:util";
107857
107915
  var run3 = promisify2(execFile3);
@@ -107865,14 +107923,14 @@ function alive(pid) {
107865
107923
  }
107866
107924
  }
107867
107925
  async function argsOf2(pid) {
107868
- const raw = await readFile39(`/proc/${pid}/cmdline`, "utf8").catch(() => void 0);
107926
+ const raw = await readFile38(`/proc/${pid}/cmdline`, "utf8").catch(() => void 0);
107869
107927
  if (raw) return raw.split("\0").filter(Boolean);
107870
107928
  const listed = await run3("ps", ["-o", "args=", "-p", String(pid)]).catch(() => void 0);
107871
107929
  const line = listed?.stdout.trim();
107872
107930
  return line ? line.split(/\s+/) : void 0;
107873
107931
  }
107874
107932
  async function parentOf(pid) {
107875
- const stat13 = await readFile39(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
107933
+ const stat13 = await readFile38(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
107876
107934
  const fromStat = stat13 ? Number(stat13.slice(stat13.lastIndexOf(")") + 2).split(" ")[1]) : NaN;
107877
107935
  if (fromStat > 0) return fromStat;
107878
107936
  const listed = await run3("ps", ["-o", "ppid=", "-p", String(pid)]).catch(() => void 0);
@@ -107880,7 +107938,7 @@ async function parentOf(pid) {
107880
107938
  return parent > 0 ? parent : void 0;
107881
107939
  }
107882
107940
  async function startOf(pid) {
107883
- const stat13 = await readFile39(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
107941
+ const stat13 = await readFile38(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
107884
107942
  const ticks = stat13 ? stat13.slice(stat13.lastIndexOf(")") + 2).split(" ")[19] : void 0;
107885
107943
  if (ticks) return ticks;
107886
107944
  const listed = await run3("ps", ["-o", "lstart=", "-p", String(pid)]).catch(() => void 0);