@lazehq/cli 0.1.133 → 0.1.135

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 +373 -251
  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: readFile39, mkdir: mkdir14 } = __require("node:fs/promises");
19489
+ var { writeFile: writeFile12, readFile: readFile40, 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 readFile39(resolve27(path), "utf8");
19706
+ const data = await readFile40(resolve27(path), "utf8");
19707
19707
  const parsed = JSON.parse(data);
19708
19708
  if (Array.isArray(parsed)) {
19709
19709
  this.#snapshots.clear();
@@ -20951,17 +20951,17 @@ var require_dns = __commonJS({
20951
20951
  const timestamp = Date.now();
20952
20952
  const records = { records: { 4: null, 6: null } };
20953
20953
  let minTTL = this.#maxTTL;
20954
- for (const record4 of addresses) {
20955
- record4.timestamp = timestamp;
20956
- if (typeof record4.ttl === "number") {
20957
- record4.ttl = Math.min(record4.ttl, this.#maxTTL);
20958
- minTTL = Math.min(minTTL, record4.ttl);
20954
+ for (const record5 of addresses) {
20955
+ record5.timestamp = timestamp;
20956
+ if (typeof record5.ttl === "number") {
20957
+ record5.ttl = Math.min(record5.ttl, this.#maxTTL);
20958
+ minTTL = Math.min(minTTL, record5.ttl);
20959
20959
  } else {
20960
- record4.ttl = this.#maxTTL;
20960
+ record5.ttl = this.#maxTTL;
20961
20961
  }
20962
- const familyRecords = records.records[record4.family] ?? { ips: [] };
20963
- familyRecords.ips.push(record4);
20964
- records.records[record4.family] = familyRecords;
20962
+ const familyRecords = records.records[record5.family] ?? { ips: [] };
20963
+ familyRecords.ips.push(record5);
20964
+ records.records[record5.family] = familyRecords;
20965
20965
  }
20966
20966
  this.storage.set(origin.hostname, records, { ttl: minTTL });
20967
20967
  }
@@ -31632,7 +31632,7 @@ ${captureLines}` : capture.stack;
31632
31632
  });
31633
31633
 
31634
31634
  // src/main.ts
31635
- import { homedir as homedir5 } from "node:os";
31635
+ import { homedir as homedir6 } from "node:os";
31636
31636
  import { stderr, stdin, stdout } from "node:process";
31637
31637
  import { createInterface as createInterface4 } from "node:readline/promises";
31638
31638
 
@@ -32569,10 +32569,10 @@ var JSONL_STRUCTURAL_KEYS = /* @__PURE__ */ new Set([
32569
32569
  "originator",
32570
32570
  "cli_version"
32571
32571
  ]);
32572
- function recordSlotsOf(record4, into) {
32573
- for (const [key, item] of Object.entries(record4)) {
32572
+ function recordSlotsOf(record5, into) {
32573
+ for (const [key, item] of Object.entries(record5)) {
32574
32574
  if (typeof item !== "string") slotsOf(item, into);
32575
- else if (!JSONL_STRUCTURAL_KEYS.has(key)) into.push({ holder: record4, key });
32575
+ else if (!JSONL_STRUCTURAL_KEYS.has(key)) into.push({ holder: record5, key });
32576
32576
  }
32577
32577
  }
32578
32578
  function slotsOf(value, into) {
@@ -34718,10 +34718,10 @@ var queryTimeZoneIntlFormat = /* @__PURE__ */ memoize((upperNormId) => new RawDa
34718
34718
  second: "numeric"
34719
34719
  }));
34720
34720
  function queryTimeZone(rawTimeZoneId) {
34721
- const record4 = resolveTimeZoneRecord(rawTimeZoneId);
34722
- return queryTimeZoneRecord(record4.id, record4);
34721
+ const record5 = resolveTimeZoneRecord(rawTimeZoneId);
34722
+ return queryTimeZoneRecord(record5.id, record5);
34723
34723
  }
34724
- var queryTimeZoneRecord = /* @__PURE__ */ memoize((normTimeZoneId, record4) => "named" === record4.kind ? new IntlTimeZone(normTimeZoneId, record4.m, record4.format) : new FixedTimeZone(normTimeZoneId, record4.m, "fixed" === record4.kind ? record4.X : 0));
34724
+ var queryTimeZoneRecord = /* @__PURE__ */ memoize((normTimeZoneId, record5) => "named" === record5.kind ? new IntlTimeZone(normTimeZoneId, record5.m, record5.format) : new FixedTimeZone(normTimeZoneId, record5.m, "fixed" === record5.kind ? record5.X : 0));
34725
34725
  var FixedTimeZone = class {
34726
34726
  constructor(id8, compareKey, offsetNano) {
34727
34727
  this.id = id8, this.m = compareKey, this.X = offsetNano;
@@ -36960,7 +36960,7 @@ function shadowedLinkLineOf({ shadow }) {
36960
36960
  }
36961
36961
 
36962
36962
  // src/rules/cli-version.rules.ts
36963
- var STAMPED = "0.1.133";
36963
+ var STAMPED = "0.1.135";
36964
36964
  function cliVersionOf({ stamped = STAMPED } = {}) {
36965
36965
  return stamped.startsWith("__") ? "dev" : stamped;
36966
36966
  }
@@ -37534,7 +37534,8 @@ var SWITCHES = /* @__PURE__ */ new Set([
37534
37534
  "all",
37535
37535
  "resend",
37536
37536
  "replace",
37537
- "ask"
37537
+ "ask",
37538
+ "real-value"
37538
37539
  ]);
37539
37540
  function parseArgs({ argv }) {
37540
37541
  const words = [];
@@ -54234,8 +54235,8 @@ function rewriteKeyNames(ctx) {
54234
54235
  bySchema.set(entry2.schema, entry2);
54235
54236
  }
54236
54237
  const rewrites = /* @__PURE__ */ new Map();
54237
- for (const record4 of pendingRecords.get(ctx) ?? []) {
54238
- const seen = ctx.seen.get(record4);
54238
+ for (const record5 of pendingRecords.get(ctx) ?? []) {
54239
+ const seen = ctx.seen.get(record5);
54239
54240
  const names = (seen?.def ?? seen?.schema)?.propertyNames;
54240
54241
  if (!names || names === true || rewrites.has(names))
54241
54242
  continue;
@@ -60218,7 +60219,9 @@ var vaultValueShapeSchemaDefinition = external_exports.object({
60218
60219
  var vaultValueShapeSchema = vaultValueShapeSchemaDefinition;
60219
60220
  var vaultBoundaryHandoutSchemaDefinition = external_exports.object({
60220
60221
  connectionId: external_exports.string(),
60221
- shapes: external_exports.record(external_exports.string(), vaultValueShapeSchema).optional()
60222
+ shapes: external_exports.record(external_exports.string(), vaultValueShapeSchema).optional(),
60223
+ /** The fields that hold a placeholder on the computer; the release's other fields are values. */
60224
+ fields: external_exports.array(external_exports.string()).optional()
60222
60225
  });
60223
60226
  var vaultBoundaryHandoutSchema = vaultBoundaryHandoutSchemaDefinition;
60224
60227
  var vaultEgressHostSchemaDefinition = external_exports.object({
@@ -61049,12 +61052,16 @@ var vaultEgressReleaseInputSchemaDefinition = external_exports.object({
61049
61052
  /** The run's P-256 public key, base64url; a sealed connection is released only to it. */
61050
61053
  recipient: external_exports.string().max(200).optional(),
61051
61054
  /** Set by a computer's egress proxy: a key it swaps comes back as shapes, not values. */
61052
- placeholders: external_exports.boolean().default(false)
61055
+ placeholders: external_exports.boolean().default(false),
61056
+ /** `laze vault run --value` on a computer: the real value in place of the stand-in, if judged. */
61057
+ realValue: external_exports.boolean().default(false)
61053
61058
  });
61054
61059
  var vaultEgressReleaseInputSchema = vaultEgressReleaseInputSchemaDefinition;
61060
+ var vaultRunHandoutSchema = external_exports.enum(["placeholders", "real_value", "value"]);
61055
61061
  var vaultEgressStatusInputSchemaDefinition = external_exports.object({
61056
61062
  agentId: external_exports.string().min(1),
61057
- requestId: external_exports.string().min(1)
61063
+ requestId: external_exports.string().min(1),
61064
+ handout: vaultRunHandoutSchema.default("value")
61058
61065
  });
61059
61066
  var vaultApprovalStateSchema = external_exports.enum([
61060
61067
  "pending",
@@ -62507,7 +62514,7 @@ var vaultSessionSchemaDefinition = external_exports.object({
62507
62514
  });
62508
62515
  var vaultSessionSchema = vaultSessionSchemaDefinition;
62509
62516
  var vaultSessionReleaseInputSchemaDefinition = external_exports.object({
62510
- ...vaultEgressReleaseInputSchema.omit({ agentId: true, placeholders: true }).shape,
62517
+ ...vaultEgressReleaseInputSchema.omit({ agentId: true, placeholders: true, realValue: true }).shape,
62511
62518
  session: vaultSessionSchema
62512
62519
  });
62513
62520
  var vaultSessionStatusInputSchemaDefinition = external_exports.object({
@@ -65696,7 +65703,9 @@ var approvalNoticeSchema = external_exports.object({
65696
65703
  /** The chat message holding the card, or the feed when there is none. */
65697
65704
  path: external_exports.string().startsWith("/").max(1024),
65698
65705
  /** The person's Notifications count, from chat: the iPhone's icon badge shows it. */
65699
- badge: external_exports.number().int().nonnegative().optional()
65706
+ badge: external_exports.number().int().nonnegative().optional(),
65707
+ /** The connector it asks for, as a picture: its logo, or the vault ring for a plain key. */
65708
+ avatar: noticeAvatarSchemaDefinition.optional()
65700
65709
  });
65701
65710
  var feedNoticeSchema = external_exports.object({
65702
65711
  workspaceId: workspaceIdSchema2,
@@ -70745,6 +70754,8 @@ var harnessLoginEntrySchemaDefinition = external_exports.object({
70745
70754
  checkedAt: external_exports.iso.datetime().nullable(),
70746
70755
  /** The agents running on this login now. */
70747
70756
  agentsOnIt: external_exports.number().int().nonnegative(),
70757
+ /** Their names, so two logins in use say which agents each one serves. */
70758
+ agentNames: external_exports.array(external_exports.string()).optional(),
70748
70759
  /** `computer`: signed in on the person's own Laze computer, which keeps the token. */
70749
70760
  source: external_exports.enum(["keychain", "computer"]).optional()
70750
70761
  });
@@ -72115,6 +72126,7 @@ var agentTurnTokenSchemaDefinition = external_exports.object({
72115
72126
  var {
72116
72127
  agentId: _agentId,
72117
72128
  placeholders: _placeholders,
72129
+ realValue: _realValue,
72118
72130
  ...releaseShape
72119
72131
  } = vaultEgressReleaseInputSchema.shape;
72120
72132
  var agentVaultReleaseInputSchemaDefinition = external_exports.object({
@@ -73126,7 +73138,7 @@ var AGENT_MCP_TOOLS = [
73126
73138
  name: "support_read_thread",
73127
73139
  operationId: "supportAgentThread",
73128
73140
  readOnly: true,
73129
- description: "Laze Support only: read the support thread your turn names, as plain text."
73141
+ description: "Laze Support only: read the support thread your turn names: its text, voice notes' words, and its newest pictures to look at."
73130
73142
  },
73131
73143
  {
73132
73144
  name: "support_answer",
@@ -73648,9 +73660,9 @@ function apiErrorOf({ status: status11, text: text3 }) {
73648
73660
  return errorOf({ status: status11, body });
73649
73661
  }
73650
73662
  function errorOf({ status: status11, body }) {
73651
- const record4 = typeof body === "object" && body !== null ? body : {};
73652
- const nested = typeof record4.error === "object" && record4.error !== null ? record4.error : record4;
73653
- const fallback = typeof record4.error === "string" ? record4.error : `http_${status11}`;
73663
+ const record5 = typeof body === "object" && body !== null ? body : {};
73664
+ const nested = typeof record5.error === "object" && record5.error !== null ? record5.error : record5;
73665
+ const fallback = typeof record5.error === "string" ? record5.error : `http_${status11}`;
73654
73666
  const code4 = typeof nested.code === "string" ? nested.code : fallback;
73655
73667
  const message2 = typeof nested.message === "string" ? nested.message : `Laze answered ${status11}`;
73656
73668
  const meta3 = typeof nested.meta === "object" && nested.meta !== null ? nested.meta : void 0;
@@ -74154,8 +74166,8 @@ async function copyAgent({
74154
74166
  }
74155
74167
 
74156
74168
  // src/services/agent-commands.service.ts
74157
- import { mkdir as mkdir6, readFile as readFile12, writeFile as writeFile3 } from "node:fs/promises";
74158
- import { join as join22, resolve as resolve4 } from "node:path";
74169
+ import { mkdir as mkdir6, readFile as readFile13, writeFile as writeFile3 } from "node:fs/promises";
74170
+ import { join as join23, resolve as resolve4 } from "node:path";
74159
74171
 
74160
74172
  // src/rules/link-format.rules.ts
74161
74173
  function linkOf({ url: url2, base }) {
@@ -74337,8 +74349,23 @@ function parse3(line) {
74337
74349
  return void 0;
74338
74350
  }
74339
74351
  }
74352
+ var STANDARD_WINDOW = 2e5;
74353
+ var LONG_WINDOW = 1e6;
74340
74354
  function contextWindowOf({ model }) {
74341
- return /\[1m\]|-1m\b/i.test(model) ? 1e6 : 2e5;
74355
+ return /\[1m\]|-1m\b/i.test(model) ? LONG_WINDOW : STANDARD_WINDOW;
74356
+ }
74357
+ function windowOf({
74358
+ run: run4,
74359
+ model,
74360
+ largest,
74361
+ tokens
74362
+ }) {
74363
+ const named = run4.model ?? model;
74364
+ if (named === void 0 && largest <= STANDARD_WINDOW) return void 0;
74365
+ let window2 = named === void 0 ? STANDARD_WINDOW : contextWindowOf({ model: named });
74366
+ if (largest > STANDARD_WINDOW) window2 = LONG_WINDOW;
74367
+ if (run4.compactWindow) window2 = Math.min(window2, run4.compactWindow);
74368
+ return tokens !== void 0 && tokens > window2 ? void 0 : window2;
74342
74369
  }
74343
74370
  function compactionOf({
74344
74371
  entry: entry2,
@@ -74364,9 +74391,13 @@ function usageOf({ entry: entry2 }) {
74364
74391
  ...typeof message2.model === "string" ? { model: message2.model } : {}
74365
74392
  };
74366
74393
  }
74367
- function readTranscript({ lines: lines2 }) {
74394
+ function readTranscript({
74395
+ lines: lines2,
74396
+ run: run4 = {}
74397
+ }) {
74368
74398
  let contextTokens;
74369
- let contextWindow;
74399
+ let model;
74400
+ let largest = 0;
74370
74401
  const compactions = [];
74371
74402
  for (const line of lines2) {
74372
74403
  const entry2 = parse3(line);
@@ -74374,14 +74405,17 @@ function readTranscript({ lines: lines2 }) {
74374
74405
  if (entry2.type === "system" && entry2.subtype === "compact_boundary") {
74375
74406
  const compaction = compactionOf({ entry: entry2, index: compactions.length });
74376
74407
  compactions.push(compaction);
74408
+ largest = Math.max(largest, compaction.tokensBefore ?? 0);
74377
74409
  contextTokens = compaction.tokensAfter ?? contextTokens;
74378
74410
  continue;
74379
74411
  }
74380
74412
  const usage2 = entry2.type === "assistant" ? usageOf({ entry: entry2 }) : void 0;
74381
74413
  if (!usage2) continue;
74382
74414
  contextTokens = usage2.tokens;
74383
- if (usage2.model) contextWindow = contextWindowOf({ model: usage2.model });
74415
+ largest = Math.max(largest, usage2.tokens);
74416
+ if (usage2.model) model = usage2.model;
74384
74417
  }
74418
+ const contextWindow = windowOf({ run: run4, model, largest, tokens: contextTokens });
74385
74419
  return { contextTokens, contextWindow, compactions };
74386
74420
  }
74387
74421
 
@@ -76949,8 +76983,54 @@ function channelLabelIn(channel) {
76949
76983
  return `#${channel.name}`;
76950
76984
  }
76951
76985
 
76986
+ // src/services/claude-run.service.ts
76987
+ import { readFile as readFile9 } from "node:fs/promises";
76988
+ import { homedir as homedir3 } from "node:os";
76989
+ import { join as join12 } from "node:path";
76990
+ function record3(value) {
76991
+ return typeof value === "object" && value !== null ? value : {};
76992
+ }
76993
+ async function settingsOf({ path }) {
76994
+ try {
76995
+ return record3(JSON.parse(await readFile9(path, "utf8")));
76996
+ } catch {
76997
+ return {};
76998
+ }
76999
+ }
77000
+ function windowOf2(value) {
77001
+ const tokens = Number(value);
77002
+ return Number.isInteger(tokens) && tokens > 0 ? tokens : void 0;
77003
+ }
77004
+ function modelFlagOf(args) {
77005
+ const at8 = args?.indexOf("--model") ?? -1;
77006
+ if (at8 >= 0) return args?.[at8 + 1];
77007
+ return args?.find((arg) => arg.startsWith("--model="))?.slice("--model=".length);
77008
+ }
77009
+ async function claudeRunOf({
77010
+ context,
77011
+ folder,
77012
+ claudePid
77013
+ }) {
77014
+ const env = context.environment.inherited;
77015
+ const user = env.CLAUDE_CONFIG_DIR || join12(env.HOME || homedir3(), ".claude");
77016
+ const files2 = await Promise.all(
77017
+ [
77018
+ join12(folder, ".claude", "settings.local.json"),
77019
+ join12(folder, ".claude", "settings.json"),
77020
+ join12(user, "settings.json")
77021
+ ].map((path) => settingsOf({ path }))
77022
+ );
77023
+ const args = claudePid > 0 ? await context.processes.argsOf(claudePid) : void 0;
77024
+ const model = env.ANTHROPIC_MODEL || modelFlagOf(args) || files2.map((file4) => file4.model).find((value) => typeof value === "string");
77025
+ const compactWindow = windowOf2(env.CLAUDE_CODE_AUTO_COMPACT_WINDOW) ?? files2.map((file4) => windowOf2(record3(file4.env).CLAUDE_CODE_AUTO_COMPACT_WINDOW)).find(Boolean);
77026
+ return {
77027
+ ...model ? { model } : {},
77028
+ ...compactWindow ? { compactWindow } : {}
77029
+ };
77030
+ }
77031
+
76952
77032
  // src/services/claude-wait.service.ts
76953
- import { readFile as readFile9, rm as rm6 } from "node:fs/promises";
77033
+ import { readFile as readFile10, rm as rm6 } from "node:fs/promises";
76954
77034
 
76955
77035
  // src/rules/listener-retry.rules.ts
76956
77036
  var FIRST_MS = 1e3;
@@ -76989,7 +77069,7 @@ var ListenerBackoff = class {
76989
77069
  // src/services/connect-service.service.ts
76990
77070
  import { createHash as createHash3 } from "node:crypto";
76991
77071
  import { mkdir as mkdir3, rm as rm5, writeFile } from "node:fs/promises";
76992
- import { dirname as dirname14, join as join17 } from "node:path";
77072
+ import { dirname as dirname14, join as join18 } from "node:path";
76993
77073
 
76994
77074
  // src/rules/connect-service.rules.ts
76995
77075
  function systemdWordOf(word3) {
@@ -77098,24 +77178,24 @@ function rolloutEventOf({
77098
77178
 
77099
77179
  // src/services/connect-delivery.service.ts
77100
77180
  import { rm as rm4, stat as stat5 } from "node:fs/promises";
77101
- import { homedir as homedir3, hostname as hostname6 } from "node:os";
77102
- import { dirname as dirname13, join as join16 } from "node:path";
77181
+ import { homedir as homedir4, hostname as hostname6 } from "node:os";
77182
+ import { dirname as dirname13, join as join17 } from "node:path";
77103
77183
 
77104
77184
  // src/services/codex-turn-watch.service.ts
77105
77185
  import { open as open4, readdir as readdir4 } from "node:fs/promises";
77106
- import { basename as basename5, join as join12 } from "node:path";
77186
+ import { basename as basename5, join as join13 } from "node:path";
77107
77187
  var READ_MS = 1500;
77108
77188
  var KEEP_WORKING_MS = 3e4;
77109
77189
  async function codexRolloutPathOf({
77110
77190
  codexHome,
77111
77191
  threadId
77112
77192
  }) {
77113
- const root = join12(codexHome, "sessions");
77193
+ const root = join13(codexHome, "sessions");
77114
77194
  const files2 = await readdir4(root, { recursive: true }).catch(() => []);
77115
77195
  const file4 = files2.find(
77116
77196
  (name3) => basename5(name3).startsWith("rollout-") && name3.endsWith(`-${threadId}.jsonl`)
77117
77197
  );
77118
- return file4 ? join12(root, file4) : void 0;
77198
+ return file4 ? join13(root, file4) : void 0;
77119
77199
  }
77120
77200
  function rolloutPathOf({ delivery }) {
77121
77201
  return codexRolloutPathOf({ codexHome: delivery.codexHome, threadId: delivery.threadId });
@@ -77204,7 +77284,7 @@ var CodexTurnWatch = class _CodexTurnWatch {
77204
77284
  };
77205
77285
 
77206
77286
  // src/services/mcp-relay.service.ts
77207
- import { dirname as dirname10, join as join13 } from "node:path";
77287
+ import { dirname as dirname10, join as join14 } from "node:path";
77208
77288
 
77209
77289
  // ../../node_modules/.pnpm/ws@8.21.3_bufferutil@4.1.0/node_modules/ws/wrapper.mjs
77210
77290
  var import_stream = __toESM(require_stream(), 1);
@@ -77540,7 +77620,7 @@ var STOPS = /* @__PURE__ */ new Map([
77540
77620
  [CONNECTOR_RELAY_CLOSE.replaced.code, "another relay for this server took over"]
77541
77621
  ]);
77542
77622
  function mcpRelaysPathOf({ context }) {
77543
- return join13(dirname10(context.environment.configPath), "connect", "mcp-relays.json");
77623
+ return join14(dirname10(context.environment.configPath), "connect", "mcp-relays.json");
77544
77624
  }
77545
77625
  async function readMcpRelays({ context }) {
77546
77626
  return await readStateJson({ path: mcpRelaysPathOf({ context }) }) ?? {};
@@ -77700,7 +77780,7 @@ var McpRelayLoops = class _McpRelayLoops {
77700
77780
  };
77701
77781
 
77702
77782
  // src/services/openclaw-relay.service.ts
77703
- import { dirname as dirname11, join as join14 } from "node:path";
77783
+ import { dirname as dirname11, join as join15 } from "node:path";
77704
77784
 
77705
77785
  // ../../modules/openclaw/contract/src/openclaw.ts
77706
77786
  var workspaceIdSchema18 = external_exports.string().min(1);
@@ -77921,7 +78001,7 @@ var STOPS2 = /* @__PURE__ */ new Map([
77921
78001
  [OPENCLAW_RELAY_CLOSE.replaced.code, "another relay for this gateway took over"]
77922
78002
  ]);
77923
78003
  function relaysPathOf({ context }) {
77924
- return join14(dirname11(context.environment.configPath), "connect", "openclaw-relays.json");
78004
+ return join15(dirname11(context.environment.configPath), "connect", "openclaw-relays.json");
77925
78005
  }
77926
78006
  async function readRelays({ context }) {
77927
78007
  return await readStateJson({ path: relaysPathOf({ context }) }) ?? {};
@@ -78114,7 +78194,7 @@ var RelayLoops = class _RelayLoops {
78114
78194
  };
78115
78195
 
78116
78196
  // src/services/rush-host.service.ts
78117
- import { dirname as dirname12, join as join15 } from "node:path";
78197
+ import { dirname as dirname12, join as join16 } from "node:path";
78118
78198
  async function rushAboveOf({
78119
78199
  context,
78120
78200
  from = context.processes.pid
@@ -78128,7 +78208,7 @@ async function rushAboveOf({
78128
78208
  return void 0;
78129
78209
  }
78130
78210
  function guardPathOf({ context, claudePid }) {
78131
- return join15(dirname12(context.environment.configPath), "rush-guards", `${claudePid}.json`);
78211
+ return join16(dirname12(context.environment.configPath), "rush-guards", `${claudePid}.json`);
78132
78212
  }
78133
78213
  async function startRushGuard({
78134
78214
  context,
@@ -78141,7 +78221,7 @@ async function startRushGuard({
78141
78221
  if (holder && context.processes.alive(holder.pid)) return;
78142
78222
  const flags2 = ["--profile", profile, "--claude-pid", String(claudePid), "--rush-id", rush.id];
78143
78223
  const argv = [...context.program, "hook", "rush-wake", ...flags2, "--rush-program", rush.program];
78144
- const logPath = join15(dirname12(context.environment.configPath), "rush-guards", "guard.log");
78224
+ const logPath = join16(dirname12(context.environment.configPath), "rush-guards", "guard.log");
78145
78225
  context.processes.spawnDetached({ argv: ["sh", "-c", '"$@" &', "sh", ...argv], logPath });
78146
78226
  }
78147
78227
  async function claimRushGuard({
@@ -78365,10 +78445,10 @@ async function watchRushDelivery({
78365
78445
 
78366
78446
  // src/services/connect-delivery.service.ts
78367
78447
  function connectFolderOf({ context }) {
78368
- return join16(dirname13(context.environment.configPath), "connect");
78448
+ return join17(dirname13(context.environment.configPath), "connect");
78369
78449
  }
78370
78450
  function runStatePathOf({ context }) {
78371
- return join16(connectFolderOf({ context }), "run.json");
78451
+ return join17(connectFolderOf({ context }), "run.json");
78372
78452
  }
78373
78453
  async function readJson({ path }) {
78374
78454
  return readStateJson({ path });
@@ -78425,7 +78505,7 @@ async function takeRound({
78425
78505
  const session = {
78426
78506
  harness: "codex",
78427
78507
  sessionId: delivery.threadId,
78428
- folder: displayFolderOf({ folder: delivery.cwd, home: homedir3() }),
78508
+ folder: displayFolderOf({ folder: delivery.cwd, home: homedir4() }),
78429
78509
  host: hostname6()
78430
78510
  };
78431
78511
  try {
@@ -78666,17 +78746,17 @@ var CONNECT_SERVICE_USAGE = `laze connect install|status|stop|uninstall|run: the
78666
78746
  \`laze openclaw connect --local\` and \`laze kanban connect\`, whose relays it also runs.
78667
78747
  `;
78668
78748
  function installedPathOf({ context }) {
78669
- return join17(connectFolderOf({ context }), "service.json");
78749
+ return join18(connectFolderOf({ context }), "service.json");
78670
78750
  }
78671
78751
  function logPathOf({ context }) {
78672
- return join17(connectFolderOf({ context }), "connect.log");
78752
+ return join18(connectFolderOf({ context }), "connect.log");
78673
78753
  }
78674
78754
  function homeOf({ context }) {
78675
78755
  return context.environment.inherited.HOME ?? dirname14(dirname14(context.environment.configPath));
78676
78756
  }
78677
78757
  function serviceNameOf({ context }) {
78678
78758
  const { configPath } = context.environment;
78679
- if (configPath === join17(homeOf({ context }), ".laze", "config.json")) return "laze-connect";
78759
+ if (configPath === join18(homeOf({ context }), ".laze", "config.json")) return "laze-connect";
78680
78760
  return `laze-connect-${createHash3("sha256").update(configPath).digest("hex").slice(0, 8)}`;
78681
78761
  }
78682
78762
  function serviceEnvOf({ context }) {
@@ -78699,8 +78779,8 @@ async function run({ context, command }) {
78699
78779
  async function installSystemd({ context }) {
78700
78780
  const name3 = serviceNameOf({ context });
78701
78781
  const env = context.environment.inherited;
78702
- const base = env.XDG_CONFIG_HOME || join17(homeOf({ context }), ".config");
78703
- const file4 = join17(base, "systemd", "user", `${name3}.service`);
78782
+ const base = env.XDG_CONFIG_HOME || join18(homeOf({ context }), ".config");
78783
+ const file4 = join18(base, "systemd", "user", `${name3}.service`);
78704
78784
  await mkdir3(dirname14(file4), { recursive: true });
78705
78785
  await writeFile(
78706
78786
  file4,
@@ -78715,7 +78795,7 @@ async function installSystemd({ context }) {
78715
78795
  async function installLaunchd({ context }) {
78716
78796
  const name3 = serviceNameOf({ context });
78717
78797
  const label3 = `ai.laze.${name3}`;
78718
- const file4 = join17(homeOf({ context }), "Library", "LaunchAgents", `${label3}.plist`);
78798
+ const file4 = join18(homeOf({ context }), "Library", "LaunchAgents", `${label3}.plist`);
78719
78799
  const log = logPathOf({ context });
78720
78800
  await mkdir3(dirname14(file4), { recursive: true });
78721
78801
  await writeFile(
@@ -79163,7 +79243,7 @@ async function waitForMessages({ context, args }) {
79163
79243
  if (rush) await healRushDelivery({ context });
79164
79244
  const lock = statePathOf({ context, kind: "waiters", profile: name3 });
79165
79245
  if (!await takeLock({ context, path: lock, sessionId: input2.session_id, claudePid })) return 0;
79166
- const seen = () => input2.transcript_path ? readFile9(input2.transcript_path, "utf8") : Promise.resolve("");
79246
+ const seen = () => input2.transcript_path ? readFile10(input2.transcript_path, "utf8") : Promise.resolve("");
79167
79247
  const deadline = context.nowMs() + (WAIT_HOOK_TIMEOUT_SECONDS - 60) * 1e3;
79168
79248
  try {
79169
79249
  const backoff = new ListenerBackoff();
@@ -79214,7 +79294,7 @@ async function refusedOnce({
79214
79294
  }) {
79215
79295
  const profile = error63 instanceof ProfileRefusedError ? error63.profile : String(args.flags.profile ?? "default");
79216
79296
  const path = statePathOf({ context, kind: "told", profile: `refused-${profile}` });
79217
- const told = await readFile9(path, "utf8").then(
79297
+ const told = await readFile10(path, "utf8").then(
79218
79298
  () => true,
79219
79299
  () => false
79220
79300
  );
@@ -79280,7 +79360,7 @@ import { rm as rm8 } from "node:fs/promises";
79280
79360
  // src/services/codex-adopt.service.ts
79281
79361
  import { spawn as spawn2 } from "node:child_process";
79282
79362
  import { readdir as readdir5, rm as rm7, stat as stat6 } from "node:fs/promises";
79283
- import { join as join18 } from "node:path";
79363
+ import { join as join19 } from "node:path";
79284
79364
  import { createInterface } from "node:readline";
79285
79365
 
79286
79366
  // src/rules/codex-requests.rules.ts
@@ -79303,19 +79383,19 @@ function codexRequestReplyOf({ method }) {
79303
79383
  }
79304
79384
 
79305
79385
  // src/services/codex-adopt.service.ts
79306
- function record3(value) {
79386
+ function record4(value) {
79307
79387
  return typeof value === "object" && value !== null ? value : {};
79308
79388
  }
79309
79389
  function absorbTurnEvent({ result: result2, message: message2 }) {
79310
- const params = record3(message2.params);
79390
+ const params = record4(message2.params);
79311
79391
  if (message2.method === "item/completed") {
79312
- const item = record3(params.item);
79392
+ const item = record4(params.item);
79313
79393
  if (item.type === "agentMessage" && typeof item.text === "string") result2.answer = item.text;
79314
79394
  return;
79315
79395
  }
79316
79396
  if (message2.method !== "thread/tokenUsage/updated") return;
79317
- const usage2 = record3(params.tokenUsage);
79318
- const total = record3(usage2.last).totalTokens;
79397
+ const usage2 = record4(params.tokenUsage);
79398
+ const total = record4(usage2.last).totalTokens;
79319
79399
  if (typeof total === "number") result2.contextTokens = total;
79320
79400
  const window2 = usage2.modelContextWindow;
79321
79401
  if (typeof window2 === "number" && window2 > 0) result2.contextWindow = window2;
@@ -79344,7 +79424,7 @@ var CodexAppServer = class _CodexAppServer {
79344
79424
  this.write({ id: id8, method, params });
79345
79425
  });
79346
79426
  if (reply2.error !== void 0) throw new Error(`${method}: ${JSON.stringify(reply2.error)}`);
79347
- return record3(reply2.result);
79427
+ return record4(reply2.result);
79348
79428
  }
79349
79429
  notify(method) {
79350
79430
  this.write({ method });
@@ -79365,7 +79445,7 @@ var CodexAppServer = class _CodexAppServer {
79365
79445
  threadId,
79366
79446
  input: [{ type: "text", text: text3, text_elements: [] }]
79367
79447
  });
79368
- const turnId = record3(started.turn).id;
79448
+ const turnId = record4(started.turn).id;
79369
79449
  return { turnId: typeof turnId === "string" ? turnId : null, done };
79370
79450
  }
79371
79451
  stop() {
@@ -79378,7 +79458,7 @@ var CodexAppServer = class _CodexAppServer {
79378
79458
  receive(line) {
79379
79459
  let message2;
79380
79460
  try {
79381
- message2 = record3(JSON.parse(line));
79461
+ message2 = record4(JSON.parse(line));
79382
79462
  } catch {
79383
79463
  return;
79384
79464
  }
@@ -79400,11 +79480,11 @@ var CodexAppServer = class _CodexAppServer {
79400
79480
  }
79401
79481
  };
79402
79482
  async function newestThreadId({ codexHome }) {
79403
- const root = join18(codexHome, "sessions");
79483
+ const root = join19(codexHome, "sessions");
79404
79484
  const files2 = await readdir5(root, { recursive: true }).catch(() => []);
79405
79485
  const rollouts = files2.filter((file4) => /rollout-.*\.jsonl$/.test(file4));
79406
79486
  const dated = await Promise.all(
79407
- rollouts.map(async (file4) => ({ file: file4, at: (await stat6(join18(root, file4))).mtimeMs }))
79487
+ rollouts.map(async (file4) => ({ file: file4, at: (await stat6(join19(root, file4))).mtimeMs }))
79408
79488
  );
79409
79489
  const newest = dated.toSorted((a, b) => b.at - a.at)[0]?.file ?? "";
79410
79490
  const id8 = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/.exec(newest);
@@ -79541,29 +79621,29 @@ async function supervise({
79541
79621
  return 0;
79542
79622
  }
79543
79623
  async function adoptStatus({ context, profile }) {
79544
- const record4 = await recordOf({ path: statePathOf({ context, kind: "adopt", profile }) });
79545
- if (!record4 || !context.processes.alive(record4.pid)) {
79624
+ const record5 = await recordOf({ path: statePathOf({ context, kind: "adopt", profile }) });
79625
+ if (!record5 || !context.processes.alive(record5.pid)) {
79546
79626
  context.out(`laze adopt codex does not run in the background for profile "${profile}".
79547
79627
  `);
79548
79628
  return;
79549
79629
  }
79550
- const thread2 = record4.thread ?? "the newest thread";
79630
+ const thread2 = record5.thread ?? "the newest thread";
79551
79631
  context.out(
79552
- `laze adopt codex runs in the background for profile "${profile}" (pid ${record4.pid}), thread ${thread2}.
79553
- Log: ${record4.log}
79632
+ `laze adopt codex runs in the background for profile "${profile}" (pid ${record5.pid}), thread ${thread2}.
79633
+ Log: ${record5.log}
79554
79634
  `
79555
79635
  );
79556
79636
  }
79557
79637
  async function adoptStop({ context, profile }) {
79558
79638
  const path = statePathOf({ context, kind: "adopt", profile });
79559
- const record4 = await recordOf({ path });
79639
+ const record5 = await recordOf({ path });
79560
79640
  await rm7(path, { force: true });
79561
- if (!record4 || !context.processes.stop(record4.pid)) {
79641
+ if (!record5 || !context.processes.stop(record5.pid)) {
79562
79642
  context.out(`laze adopt codex was not running in the background for profile "${profile}".
79563
79643
  `);
79564
79644
  return;
79565
79645
  }
79566
- context.out(`Stopped laze adopt codex (pid ${record4.pid}) for profile "${profile}".
79646
+ context.out(`Stopped laze adopt codex (pid ${record5.pid}) for profile "${profile}".
79567
79647
  `);
79568
79648
  }
79569
79649
  var HELD_THREAD = /active writer/;
@@ -79592,7 +79672,7 @@ async function adoptedThreadOf({
79592
79672
  `);
79593
79673
  return known;
79594
79674
  }
79595
- const forked = record3((await codex.call("thread/fork", { threadId })).thread).id;
79675
+ const forked = record4((await codex.call("thread/fork", { threadId })).thread).id;
79596
79676
  if (typeof forked !== "string") throw new Error("thread/fork answered no thread id");
79597
79677
  await writeStateJson({ path, value: { ...forks, [threadId]: forked } });
79598
79678
  context.out(
@@ -79722,16 +79802,16 @@ async function linkCodexSession({
79722
79802
  }
79723
79803
 
79724
79804
  // src/services/laze-plugin.service.ts
79725
- import { mkdir as mkdir4, readFile as readFile10, rm as rm9, writeFile as writeFile2 } from "node:fs/promises";
79726
- import { homedir as homedir4 } from "node:os";
79727
- import { dirname as dirname15, join as join20 } from "node:path";
79805
+ import { mkdir as mkdir4, readFile as readFile11, rm as rm9, writeFile as writeFile2 } from "node:fs/promises";
79806
+ import { homedir as homedir5 } from "node:os";
79807
+ import { dirname as dirname15, join as join21 } from "node:path";
79728
79808
 
79729
79809
  // src/rules/laze-plugin.rules.ts
79730
79810
  import { createHash as createHash4 } from "node:crypto";
79731
- import { join as join19 } from "node:path";
79811
+ import { join as join20 } from "node:path";
79732
79812
  var LAZE_PLUGIN = "laze";
79733
79813
  function pluginNameOf({ configPath, home }) {
79734
- if (configPath === join19(home, ".laze", "config.json")) return LAZE_PLUGIN;
79814
+ if (configPath === join20(home, ".laze", "config.json")) return LAZE_PLUGIN;
79735
79815
  return `${LAZE_PLUGIN}-${createHash4("sha256").update(configPath).digest("hex").slice(0, 8)}`;
79736
79816
  }
79737
79817
  var NPX_CLI = ["npx", "-y", "@lazehq/cli@latest"];
@@ -80012,7 +80092,7 @@ function lazePluginFiles({
80012
80092
  var REGISTER_LIMIT_MS = 6e4;
80013
80093
  var quote2 = (value) => `'${value.replaceAll("'", "'\\''")}'`;
80014
80094
  function homeOf2({ context }) {
80015
- return context.environment.inherited.HOME || homedir4();
80095
+ return context.environment.inherited.HOME || homedir5();
80016
80096
  }
80017
80097
  function pluginNameHere({ context }) {
80018
80098
  return pluginNameOf({ configPath: context.environment.configPath, home: homeOf2({ context }) });
@@ -80022,11 +80102,11 @@ function installedNameOf({ context }) {
80022
80102
  return `${name3}@${name3}`;
80023
80103
  }
80024
80104
  function pluginFolderOf({ context }) {
80025
- return join20(dirname15(context.environment.configPath), "plugins");
80105
+ return join21(dirname15(context.environment.configPath), "plugins");
80026
80106
  }
80027
80107
  async function pluginIsCurrent({ context }) {
80028
- const manifest = join20(pluginFolderOf({ context }), LAZE_PLUGIN, ".claude-plugin", "plugin.json");
80029
- const written = await readFile10(manifest, "utf8").then((text3) => JSON.parse(text3).version).catch(() => void 0);
80108
+ const manifest = join21(pluginFolderOf({ context }), LAZE_PLUGIN, ".claude-plugin", "plugin.json");
80109
+ const written = await readFile11(manifest, "utf8").then((text3) => JSON.parse(text3).version).catch(() => void 0);
80030
80110
  return written === cliVersionOf();
80031
80111
  }
80032
80112
  async function writeLazePlugin({ context }) {
@@ -80038,7 +80118,7 @@ async function writeLazePlugin({ context }) {
80038
80118
  configPath: context.environment.configPath
80039
80119
  });
80040
80120
  for (const [path, text3] of Object.entries(files2)) {
80041
- const target = join20(folder, path);
80121
+ const target = join21(folder, path);
80042
80122
  await mkdir4(dirname15(target), { recursive: true });
80043
80123
  await writeFile2(target, text3);
80044
80124
  }
@@ -80069,7 +80149,7 @@ async function registerWithClaude({ context, folder }) {
80069
80149
  return claudeScript({ context, script });
80070
80150
  }
80071
80151
  function claudeDirOf({ context }) {
80072
- return context.environment.inherited.CLAUDE_CONFIG_DIR || join20(homeOf2({ context }), ".claude");
80152
+ return context.environment.inherited.CLAUDE_CONFIG_DIR || join21(homeOf2({ context }), ".claude");
80073
80153
  }
80074
80154
  function unregisterAs({ context, name: name3 }) {
80075
80155
  const script = [
@@ -80080,8 +80160,8 @@ function unregisterAs({ context, name: name3 }) {
80080
80160
  }
80081
80161
  async function dropOwnLeftover({ context, folder }) {
80082
80162
  if (pluginNameHere({ context }) === LAZE_PLUGIN) return;
80083
- const known = await readFile10(
80084
- join20(claudeDirOf({ context }), "plugins", "known_marketplaces.json"),
80163
+ const known = await readFile11(
80164
+ join21(claudeDirOf({ context }), "plugins", "known_marketplaces.json"),
80085
80165
  "utf8"
80086
80166
  ).then((text3) => JSON.parse(text3)).catch(() => void 0);
80087
80167
  if (known?.[LAZE_PLUGIN]?.source?.path !== folder) return;
@@ -80089,17 +80169,17 @@ async function dropOwnLeftover({ context, folder }) {
80089
80169
  }
80090
80170
  var RUN_FILES = ["hooks/hooks.json", "monitors/monitors.json"];
80091
80171
  async function cachedPluginOf({ context }) {
80092
- const path = join20(claudeDirOf({ context }), "plugins", "installed_plugins.json");
80093
- const listed = await readFile10(path, "utf8").then((text3) => JSON.parse(text3)).catch(() => void 0);
80172
+ const path = join21(claudeDirOf({ context }), "plugins", "installed_plugins.json");
80173
+ const listed = await readFile11(path, "utf8").then((text3) => JSON.parse(text3)).catch(() => void 0);
80094
80174
  return listed?.plugins?.[installedNameOf({ context })]?.[0]?.installPath;
80095
80175
  }
80096
80176
  async function refreshStaleCache({ context, folder }) {
80097
80177
  const cached2 = await cachedPluginOf({ context });
80098
80178
  if (!cached2) return true;
80099
- const read4 = (path) => readFile10(path, "utf8").catch(() => "");
80179
+ const read4 = (path) => readFile11(path, "utf8").catch(() => "");
80100
80180
  for (const file4 of RUN_FILES) {
80101
- const ours = await read4(join20(folder, LAZE_PLUGIN, file4));
80102
- if (ours === await read4(join20(cached2, file4))) continue;
80181
+ const ours = await read4(join21(folder, LAZE_PLUGIN, file4));
80182
+ if (ours === await read4(join21(cached2, file4))) continue;
80103
80183
  const plugin2 = installedNameOf({ context });
80104
80184
  const script = [
80105
80185
  `claude plugin uninstall ${plugin2} --scope user ${QUIET}`,
@@ -80110,10 +80190,10 @@ async function refreshStaleCache({ context, folder }) {
80110
80190
  return true;
80111
80191
  }
80112
80192
  function registeredMarkOf({ context }) {
80113
- return join20(pluginFolderOf({ context }), "registered");
80193
+ return join21(pluginFolderOf({ context }), "registered");
80114
80194
  }
80115
80195
  async function pluginRegistered({ context }) {
80116
- return readFile10(registeredMarkOf({ context }), "utf8").then(
80196
+ return readFile11(registeredMarkOf({ context }), "utf8").then(
80117
80197
  () => true,
80118
80198
  () => false
80119
80199
  );
@@ -80128,7 +80208,7 @@ async function installLazePlugin({ context }) {
80128
80208
  async function plugin({ context, args }) {
80129
80209
  const action = args.words[1] ?? "install";
80130
80210
  if (action === "path") {
80131
- context.out(`${join20(pluginFolderOf({ context }), LAZE_PLUGIN)}
80211
+ context.out(`${join21(pluginFolderOf({ context }), LAZE_PLUGIN)}
80132
80212
  `);
80133
80213
  return 0;
80134
80214
  }
@@ -80339,7 +80419,7 @@ async function pushInbox({
80339
80419
  }
80340
80420
 
80341
80421
  // src/services/plugin-tip.service.ts
80342
- import { readFile as readFile11 } from "node:fs/promises";
80422
+ import { readFile as readFile12 } from "node:fs/promises";
80343
80423
  var RELOAD_TIP = "Laze: the Laze plugin is installed in Claude Code, and this session has not loaded it yet. Tell the user once, in one plain line, that it is optional: typing /reload-plugins makes Laze messages arrive right away; until then they still arrive through the hooks.";
80344
80424
  var LINK_RELOAD_TIP = "Tell the user once, in one plain line, that it is optional: typing /reload-plugins makes Laze messages arrive right away; until then they still arrive through the hooks.";
80345
80425
  function monitorsRunHere({ context }) {
@@ -80381,7 +80461,7 @@ async function reloadTipOnce({
80381
80461
  }) {
80382
80462
  if (!session || !monitorsRunHere({ context })) return void 0;
80383
80463
  if (!await pluginRegistered({ context })) return void 0;
80384
- const told = await readFile11(toldPathOf({ context, session }), "utf8").then(
80464
+ const told = await readFile12(toldPathOf({ context, session }), "utf8").then(
80385
80465
  () => true,
80386
80466
  () => false
80387
80467
  );
@@ -80394,7 +80474,7 @@ async function reloadTipOnce({
80394
80474
  import { Buffer as Buffer3 } from "node:buffer";
80395
80475
  import { createHash as createHash5 } from "node:crypto";
80396
80476
  import { mkdir as mkdir5, open as open5 } from "node:fs/promises";
80397
- import { dirname as dirname16, join as join21 } from "node:path";
80477
+ import { dirname as dirname16, join as join22 } from "node:path";
80398
80478
 
80399
80479
  // src/rules/session-scrub.rules.ts
80400
80480
  import { Buffer as Buffer2 } from "node:buffer";
@@ -80454,7 +80534,7 @@ function paddedTo({ text: text3, bytes }) {
80454
80534
  // src/services/session-scrub.service.ts
80455
80535
  function offsetPathOf({ context, transcript }) {
80456
80536
  const key = createHash5("sha256").update(transcript).digest("hex").slice(0, 24);
80457
- return join21(dirname16(context.environment.configPath), "session-scrub", `${key}.json`);
80537
+ return join22(dirname16(context.environment.configPath), "session-scrub", `${key}.json`);
80458
80538
  }
80459
80539
  async function offsetOf({ path }) {
80460
80540
  const saved3 = await readStateJson({ path });
@@ -80633,7 +80713,7 @@ async function harnessOf2({ context, args }) {
80633
80713
  const nearest = await nearestHarnessOf({ context });
80634
80714
  return nearest ?? { harness: context.environment.harness, pid: void 0 };
80635
80715
  }
80636
- function settingsOf({ path, text: text3 }) {
80716
+ function settingsOf2({ path, text: text3 }) {
80637
80717
  try {
80638
80718
  return JSON.parse(text3);
80639
80719
  } catch {
@@ -80641,10 +80721,10 @@ function settingsOf({ path, text: text3 }) {
80641
80721
  }
80642
80722
  }
80643
80723
  async function installHooks({ context, directory }) {
80644
- const folder = join22(directory, ".claude");
80645
- const path = join22(folder, "settings.local.json");
80646
- const text3 = await readFile12(path, "utf8").catch(() => "{}");
80647
- const current3 = settingsOf({ path, text: text3 });
80724
+ const folder = join23(directory, ".claude");
80725
+ const path = join23(folder, "settings.local.json");
80726
+ const text3 = await readFile13(path, "utf8").catch(() => "{}");
80727
+ const current3 = settingsOf2({ path, text: text3 });
80648
80728
  const command = (hook) => hookCommand({ program: context.program, hook });
80649
80729
  const settings3 = withLazeHooks({
80650
80730
  settings: current3,
@@ -80874,12 +80954,16 @@ async function bindInLaze({
80874
80954
  }
80875
80955
  }
80876
80956
  async function reportTranscript({
80957
+ context: cli,
80877
80958
  client,
80878
- input: input2
80959
+ input: input2,
80960
+ claudePid
80879
80961
  }) {
80880
80962
  if (!input2.transcript_path || !input2.session_id) return;
80881
- const lines2 = (await readFile12(input2.transcript_path, "utf8")).split("\n");
80882
- const context = readTranscript({ lines: lines2 });
80963
+ const lines2 = (await readFile13(input2.transcript_path, "utf8")).split("\n");
80964
+ const { folder } = await claudeFoldersOf({ context: cli, claudePid });
80965
+ const run4 = await claudeRunOf({ context: cli, folder: input2.cwd ?? folder, claudePid });
80966
+ const context = readTranscript({ lines: lines2, run: run4 });
80883
80967
  await client.post("/api/agents/me/activity", {
80884
80968
  sessionId: input2.session_id,
80885
80969
  ...context.contextTokens !== void 0 ? { contextTokens: context.contextTokens } : {},
@@ -80904,7 +80988,7 @@ async function handOver({ context, args }) {
80904
80988
  const named = await pluginHookArgs({ context, args, session, claudePid });
80905
80989
  if (!named) return;
80906
80990
  const { client, name: agent3 } = await signedIn({ context, args: named });
80907
- await reportTranscript({ client, input: input2 }).catch(
80991
+ await reportTranscript({ context, client, input: input2, claudePid }).catch(
80908
80992
  (error63) => reportFailed({ context, error: error63 })
80909
80993
  );
80910
80994
  if (input2.transcript_path) {
@@ -80922,7 +81006,7 @@ async function handOver({ context, args }) {
80922
81006
  const kept = await dueFromSpool({
80923
81007
  context,
80924
81008
  profile: agent3,
80925
- seen: () => input2.transcript_path ? readFile12(input2.transcript_path, "utf8") : Promise.resolve(""),
81009
+ seen: () => input2.transcript_path ? readFile13(input2.transcript_path, "utf8") : Promise.resolve(""),
80926
81010
  pushedToo: false,
80927
81011
  settledOnly: true
80928
81012
  });
@@ -80954,14 +81038,14 @@ async function handOver({ context, args }) {
80954
81038
  async function addSessionStartWaiter({ context, args }) {
80955
81039
  const directory = context.environment.inherited.CLAUDE_PROJECT_DIR;
80956
81040
  if (!directory || args.flags.plugin) return;
80957
- const path = join22(directory, ".claude", "settings.local.json");
80958
- const settings3 = await readFile12(path, "utf8").then((text3) => JSON.parse(text3)).catch(() => void 0);
81041
+ const path = join23(directory, ".claude", "settings.local.json");
81042
+ const settings3 = await readFile13(path, "utf8").then((text3) => JSON.parse(text3)).catch(() => void 0);
80959
81043
  if (!settings3 || !lacksSessionStartWaiter({ settings: settings3 })) return;
80960
81044
  await installHooks({ context, directory });
80961
81045
  }
80962
81046
  async function refreshPlugin({ context }) {
80963
81047
  if (await pluginIsCurrent({ context })) return;
80964
- const logPath = join22(pluginFolderOf({ context }), "install.log");
81048
+ const logPath = join23(pluginFolderOf({ context }), "install.log");
80965
81049
  context.processes.spawnDetached({ argv: [...context.program, "plugin", "install"], logPath });
80966
81050
  }
80967
81051
  async function stopHook({ context, args }) {
@@ -80987,7 +81071,7 @@ async function stopHook({ context, args }) {
80987
81071
  }
80988
81072
 
80989
81073
  // src/services/agent-manage-commands.service.ts
80990
- import { readFile as readFile13 } from "node:fs/promises";
81074
+ import { readFile as readFile14 } from "node:fs/promises";
80991
81075
  import { extname, resolve as resolve5 } from "node:path";
80992
81076
 
80993
81077
  // src/rules/login-format.rules.ts
@@ -81120,7 +81204,7 @@ async function avatarOf({
81120
81204
  return emoji4;
81121
81205
  }
81122
81206
  if (!path) return void 0;
81123
- const bytes = await readFile13(resolve5(context.cwd, path)).catch(() => {
81207
+ const bytes = await readFile14(resolve5(context.cwd, path)).catch(() => {
81124
81208
  throw new CliUsageError(`laze: cannot read the avatar file ${path}.`);
81125
81209
  });
81126
81210
  const uploaded = await client.post("/api/agents/avatars", {
@@ -81836,8 +81920,8 @@ async function setAgentRunsOn({
81836
81920
  }
81837
81921
 
81838
81922
  // src/services/agent-migrate-commands.service.ts
81839
- import { readFile as readFile14, stat as stat7 } from "node:fs/promises";
81840
- import { basename as basename6, join as join23, resolve as resolve6 } from "node:path";
81923
+ import { readFile as readFile15, stat as stat7 } from "node:fs/promises";
81924
+ import { basename as basename6, join as join24, resolve as resolve6 } from "node:path";
81841
81925
 
81842
81926
  // src/rules/migration-upload.rules.ts
81843
81927
  import { createHash as createHash6 } from "node:crypto";
@@ -81900,8 +81984,8 @@ function packed({ lines: lines2, maxBytes }) {
81900
81984
  function isCompactBoundary(line) {
81901
81985
  if (!line.includes('"compact_boundary"')) return false;
81902
81986
  try {
81903
- const record4 = JSON.parse(line);
81904
- return record4.type === "system" && record4.subtype === "compact_boundary";
81987
+ const record5 = JSON.parse(line);
81988
+ return record5.type === "system" && record5.subtype === "compact_boundary";
81905
81989
  } catch {
81906
81990
  return false;
81907
81991
  }
@@ -82074,7 +82158,7 @@ async function transcriptOf({ context, args, ticket }) {
82074
82158
  if (ticket.source === "codex") {
82075
82159
  const codexHome = context.environment.codexHome;
82076
82160
  const path2 = await codexRolloutPathOf({ codexHome, threadId: sessionId });
82077
- return { sessionId, path: path2, where: join23(codexHome, "sessions") };
82161
+ return { sessionId, path: path2, where: join24(codexHome, "sessions") };
82078
82162
  }
82079
82163
  const { root, path } = await claudeTranscriptOf({ context, sessionId });
82080
82164
  return { sessionId, path, where: root };
@@ -82126,7 +82210,7 @@ async function uploadTranscript({ context, args, client }) {
82126
82210
  `The transcript of session ${found.sessionId} was not found under ${found.where}; nothing was uploaded.`
82127
82211
  );
82128
82212
  }
82129
- const raw = await readFile14(found.path, "utf8");
82213
+ const raw = await readFile15(found.path, "utf8");
82130
82214
  if (!raw.trim()) throw new CliUsageError(`${found.path} is empty; nothing was uploaded.`);
82131
82215
  const redacted = await redactTranscript({ text: raw });
82132
82216
  const { parts, truncated } = transcriptPartsOf({
@@ -82449,8 +82533,8 @@ async function listAgentSessions({
82449
82533
  }
82450
82534
 
82451
82535
  // src/services/app-commands.service.ts
82452
- import { mkdir as mkdir8, readdir as readdir6, readFile as readFile17, writeFile as writeFile6 } from "node:fs/promises";
82453
- import { dirname as dirname18, join as join28, relative as relative3, resolve as resolve9, sep as sep3 } from "node:path";
82536
+ import { mkdir as mkdir8, readdir as readdir6, readFile as readFile18, writeFile as writeFile6 } from "node:fs/promises";
82537
+ import { dirname as dirname18, join as join29, relative as relative3, resolve as resolve9, sep as sep3 } from "node:path";
82454
82538
 
82455
82539
  // ../../modules/app/contract/src/app.connections.ts
82456
82540
  var appFunctionNameSchema = external_exports.string().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/);
@@ -85256,7 +85340,7 @@ async function appAsset(input2) {
85256
85340
  // src/services/browser-tab-commands.service.ts
85257
85341
  import { mkdir as mkdir7, writeFile as writeFile4 } from "node:fs/promises";
85258
85342
  import { tmpdir as tmpdir2 } from "node:os";
85259
- import { join as join25, resolve as resolve8 } from "node:path";
85343
+ import { join as join26, resolve as resolve8 } from "node:path";
85260
85344
 
85261
85345
  // src/rules/browser-login.rules.ts
85262
85346
  var PASSWORD_NAME = /pass|pwd/i;
@@ -85321,9 +85405,9 @@ async function patiently({
85321
85405
 
85322
85406
  // src/services/vault-commands.service.ts
85323
85407
  import { createHash as createHash8 } from "node:crypto";
85324
- import { readFile as readFile15, rm as rm11 } from "node:fs/promises";
85408
+ import { readFile as readFile16, rm as rm11 } from "node:fs/promises";
85325
85409
  import { hostname as hostname7, tmpdir } from "node:os";
85326
- import { dirname as dirname17, join as join24 } from "node:path";
85410
+ import { dirname as dirname17, join as join25 } from "node:path";
85327
85411
 
85328
85412
  // src/rules/vault-session.rules.ts
85329
85413
  function vaultSessionOf({
@@ -85383,16 +85467,18 @@ async function handedOut({
85383
85467
  () => void 0
85384
85468
  );
85385
85469
  context.err(
85386
- `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".
85470
+ `laze vault: ${Object.keys(fields).join(", ")} of ${name3} ${Object.keys(fields).length === 1 ? "holds" : "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, SSH, a database) can ask for it with laze vault run --real-value.
85387
85471
  `
85388
85472
  );
85389
85473
  }
85390
85474
 
85391
85475
  // src/services/vault-commands.service.ts
85392
- var USAGE3 = `Usage: laze vault run <connection> --reason "<one plain sentence>" [--wait <s>] -- <command> [args...]
85476
+ var USAGE3 = `Usage: laze vault run <connection> --reason "<one plain sentence>" [--wait <s>] [--real-value] -- <command> [args...]
85393
85477
  Runs the command with the connection's values in its environment, on a Laze agent's computer,
85394
85478
  on a machine it runs on, where a connected agent runs, or signed in as yourself, where it asks
85395
85479
  as the calling Claude Code, Codex, Kanban or terminal session.
85480
+ --real-value on a Laze computer: the key's real value, not the stand-in, for a command that
85481
+ signs or connects with it itself (SSH, a database, AWS); the vault judges each ask
85396
85482
  --channel <id> the conversation whose turn it runs in, when the agent answers in several
85397
85483
  --as <name> the session's name on the card when signed in as yourself (or LAZE_SESSION_NAME)`;
85398
85484
  var POLL_MS = 3e3;
@@ -85426,7 +85512,7 @@ async function turnTokenOf2({
85426
85512
  if (pinned) return pinned;
85427
85513
  if (!turnFile) throw new CliUsageError(`${command} works only during an agent's turn`);
85428
85514
  try {
85429
- return (await readFile15(turnFile, "utf8")).trim();
85515
+ return (await readFile16(turnFile, "utf8")).trim();
85430
85516
  } catch {
85431
85517
  throw new CliUsageError(`${command} works only during an agent's turn`);
85432
85518
  }
@@ -85437,8 +85523,8 @@ function runKeyPathOf({
85437
85523
  profile = ""
85438
85524
  }) {
85439
85525
  const name3 = createHash8("sha256").update(connection).digest("hex");
85440
- const base = turnFile ? dirname17(turnFile) : join24(tmpdir(), "laze-vault", profile);
85441
- return join24(base, "vault-run-keys", `${name3}.json`);
85526
+ const base = turnFile ? dirname17(turnFile) : join25(tmpdir(), "laze-vault", profile);
85527
+ return join25(base, "vault-run-keys", `${name3}.json`);
85442
85528
  }
85443
85529
  async function runKeyAt({ path }) {
85444
85530
  const saved3 = await readStateJson({
@@ -85562,13 +85648,22 @@ function leaseHolds({
85562
85648
  const ends = release2.sealed?.leaseEndsAt;
85563
85649
  return ends !== void 0 && Temporal3.Instant.from(ends).epochMilliseconds > nowMs2;
85564
85650
  }
85651
+ function standInFieldsOf({
85652
+ env,
85653
+ boundary
85654
+ }) {
85655
+ const named = boundary.fields;
85656
+ if (!named) return { ...env };
85657
+ return Object.fromEntries(Object.entries(env).filter(([field]) => named.includes(field)));
85658
+ }
85565
85659
  async function vaultRelease({
85566
85660
  context,
85567
85661
  args,
85568
85662
  connection,
85569
85663
  reason: reason2,
85570
85664
  command,
85571
- value = false
85665
+ value = false,
85666
+ realValue = false
85572
85667
  }) {
85573
85668
  const deadline = deadlineOf({ args, nowMs: context.nowMs() });
85574
85669
  const env = context.environment.inherited;
@@ -85586,7 +85681,8 @@ async function vaultRelease({
85586
85681
  reason: reason2,
85587
85682
  command,
85588
85683
  recipient: run4.publicKey,
85589
- ...value && { value: true }
85684
+ ...value && { value: true },
85685
+ ...realValue && { realValue: true }
85590
85686
  });
85591
85687
  let release2;
85592
85688
  try {
@@ -85712,11 +85808,20 @@ ${USAGE3}`);
85712
85808
  );
85713
85809
  return 1;
85714
85810
  }
85715
- const released = await vaultRelease({ context, args, connection, reason: reason2, command: args.rest });
85811
+ const realValue = args.flags["real-value"] === true;
85812
+ const released = await vaultRelease({
85813
+ context,
85814
+ args,
85815
+ connection,
85816
+ reason: reason2,
85817
+ command: args.rest,
85818
+ realValue
85819
+ });
85716
85820
  if ("exitCode" in released) return released.exitCode;
85717
85821
  if (released.boundary) {
85718
85822
  const { connectionId } = released.boundary;
85719
- await handedOut({ context, name: connection, connectionId, fields: released.env });
85823
+ const fields = standInFieldsOf({ env: released.env, boundary: released.boundary });
85824
+ await handedOut({ context, name: connection, connectionId, fields });
85720
85825
  }
85721
85826
  const prepared = preparedCommand({
85722
85827
  command: args.rest,
@@ -86021,9 +86126,9 @@ async function savedScreenshot({
86021
86126
  nowMs: nowMs2,
86022
86127
  what
86023
86128
  }) {
86024
- const folder = join25(tmpdir2(), "laze-browser");
86129
+ const folder = join26(tmpdir2(), "laze-browser");
86025
86130
  await mkdir7(folder, { recursive: true, mode: 448 });
86026
- const path = join25(folder, `${tabId.replace(/[^a-zA-Z0-9_-]/g, "_")}-${what}-${nowMs2}.jpg`);
86131
+ const path = join26(folder, `${tabId.replace(/[^a-zA-Z0-9_-]/g, "_")}-${what}-${nowMs2}.jpg`);
86027
86132
  await writeFile4(path, Buffer.from(data, "base64"), { mode: 384 });
86028
86133
  return path;
86029
86134
  }
@@ -86501,7 +86606,7 @@ async function appPinsCommand({
86501
86606
  import { execFile } from "node:child_process";
86502
86607
  import { mkdtemp, rm as rm12, writeFile as writeFile5 } from "node:fs/promises";
86503
86608
  import { tmpdir as tmpdir3 } from "node:os";
86504
- import { join as join26 } from "node:path";
86609
+ import { join as join27 } from "node:path";
86505
86610
  import { promisify } from "node:util";
86506
86611
  var run2 = promisify(execFile);
86507
86612
  var MODULE_SYNTAX = /^\s*(import|export)\s/m;
@@ -86530,11 +86635,11 @@ async function scriptErrorsOf({
86530
86635
  const unknown2 = unknownCollectionsOf({ files: files2, collections });
86531
86636
  const scripts = files2.flatMap(scriptsOf);
86532
86637
  if (scripts.length === 0) return unknown2;
86533
- const dir = await mkdtemp(join26(tmpdir3(), "laze-app-check-"));
86638
+ const dir = await mkdtemp(join27(tmpdir3(), "laze-app-check-"));
86534
86639
  try {
86535
86640
  const errors = await Promise.all(
86536
86641
  scripts.map(async (script, index) => {
86537
- const file4 = join26(dir, `${index}.${script.module ? "mjs" : "cjs"}`);
86642
+ const file4 = join27(dir, `${index}.${script.module ? "mjs" : "cjs"}`);
86538
86643
  await writeFile5(file4, script.code);
86539
86644
  try {
86540
86645
  await run2(process.execPath, ["--check", file4]);
@@ -86552,9 +86657,9 @@ async function scriptErrorsOf({
86552
86657
  }
86553
86658
 
86554
86659
  // src/services/app-serve.service.ts
86555
- import { readFile as readFile16, stat as stat9 } from "node:fs/promises";
86660
+ import { readFile as readFile17, stat as stat9 } from "node:fs/promises";
86556
86661
  import { createServer } from "node:http";
86557
- import { extname as extname2, join as join27, normalize, sep as sep2 } from "node:path";
86662
+ import { extname as extname2, join as join28, normalize, sep as sep2 } from "node:path";
86558
86663
  var TYPES2 = {
86559
86664
  ".html": "text/html; charset=utf-8",
86560
86665
  ".js": "text/javascript; charset=utf-8",
@@ -86605,13 +86710,13 @@ async function staticFile({
86605
86710
  if (clean.startsWith("..") || hidden) {
86606
86711
  return json2({ response, status: 404, value: { code: "not_found", message: "Not found" } });
86607
86712
  }
86608
- const candidates = [join27(folder, clean), join27(folder, clean, "index.html")];
86609
- if (!extname2(clean)) candidates.push(join27(folder, "index.html"));
86713
+ const candidates = [join28(folder, clean), join28(folder, clean, "index.html")];
86714
+ if (!extname2(clean)) candidates.push(join28(folder, "index.html"));
86610
86715
  for (const target of candidates) {
86611
86716
  const info = await stat9(target).catch(() => void 0);
86612
86717
  if (!info?.isFile()) continue;
86613
86718
  const type = TYPES2[extname2(target).toLowerCase()] ?? "application/octet-stream";
86614
- const body = await readFile16(target);
86719
+ const body = await readFile17(target);
86615
86720
  if (extname2(target) === ".html") {
86616
86721
  return send2({ response, status: 200, type, body: withServeThemeScript(body.toString()) });
86617
86722
  }
@@ -86861,7 +86966,7 @@ async function turnTokenOf3({
86861
86966
  const pinned = env.LAZE_TURN_TOKEN?.trim();
86862
86967
  if (pinned) return pinned;
86863
86968
  if (env.LAZE_TURN_FILE) {
86864
- return readFile17(env.LAZE_TURN_FILE, "utf8").then(
86969
+ return readFile18(env.LAZE_TURN_FILE, "utf8").then(
86865
86970
  (text3) => text3.trim(),
86866
86971
  () => ""
86867
86972
  );
@@ -86895,7 +87000,7 @@ function folderOf({ context, word: word3 }) {
86895
87000
  return resolve9(context.cwd, word3 ?? ".");
86896
87001
  }
86897
87002
  async function readManifest(folder) {
86898
- const text3 = await readFile17(join28(folder, APP_MANIFEST_FILE), "utf8").catch(() => void 0);
87003
+ const text3 = await readFile18(join29(folder, APP_MANIFEST_FILE), "utf8").catch(() => void 0);
86899
87004
  if (text3 === void 0) return void 0;
86900
87005
  const parsed = appManifestSchema.safeParse(JSON.parse(text3));
86901
87006
  if (!parsed.success) {
@@ -86936,7 +87041,7 @@ async function jsonFlag({
86936
87041
  }) {
86937
87042
  const raw = flagText({ args, name: name3 });
86938
87043
  if (!raw) return void 0;
86939
- const text3 = raw.startsWith("@") ? await readFile17(resolve9(context.cwd, raw.slice(1)), "utf8") : raw;
87044
+ const text3 = raw.startsWith("@") ? await readFile18(resolve9(context.cwd, raw.slice(1)), "utf8") : raw;
86940
87045
  try {
86941
87046
  return JSON.parse(text3);
86942
87047
  } catch {
@@ -86949,7 +87054,7 @@ async function listFiles(folder) {
86949
87054
  while (pending2.length > 0 && found.length <= MAX_FILES) {
86950
87055
  const current3 = pending2.pop() ?? folder;
86951
87056
  for (const entry2 of await readdir6(current3, { withFileTypes: true })) {
86952
- const path = join28(current3, entry2.name);
87057
+ const path = join29(current3, entry2.name);
86953
87058
  const rel = relative3(folder, path).split(sep3).join("/");
86954
87059
  if (isSkippedPath({ path: rel })) continue;
86955
87060
  if (entry2.isDirectory()) pending2.push(path);
@@ -86988,7 +87093,7 @@ var appCreate = async ({ context, args }) => {
86988
87093
  await mkdir8(folder, { recursive: true });
86989
87094
  const start2 = template ? await templateStart({ client, appId: app2.id, template }) : null;
86990
87095
  for (const file4 of start2?.files ?? []) {
86991
- const target = join28(folder, ...file4.path.split("/"));
87096
+ const target = join29(folder, ...file4.path.split("/"));
86992
87097
  await mkdir8(dirname18(target), { recursive: true });
86993
87098
  await writeFile6(
86994
87099
  target,
@@ -87001,7 +87106,7 @@ var appCreate = async ({ context, args }) => {
87001
87106
  views: [...start2?.template.views ?? []],
87002
87107
  seed: { ...start2?.template.seed }
87003
87108
  };
87004
- await writeFile6(join28(folder, APP_MANIFEST_FILE), `${JSON.stringify(manifest, null, 2)}
87109
+ await writeFile6(join29(folder, APP_MANIFEST_FILE), `${JSON.stringify(manifest, null, 2)}
87005
87110
  `);
87006
87111
  const where = relative3(context.cwd, folder) || ".";
87007
87112
  const created = start2 ? `Created ${app2.name} (${app2.id}) from the ${template} template in ${where}; its first version is live at ${app2.publishedUrl}.
@@ -87072,7 +87177,7 @@ var appPush = async ({ context, args }) => {
87072
87177
  paths.map(
87073
87178
  async (path) => buildFileOf({
87074
87179
  path: relative3(folder, path).split(sep3).join("/"),
87075
- bytes: await readFile17(path)
87180
+ bytes: await readFile18(path)
87076
87181
  })
87077
87182
  )
87078
87183
  );
@@ -87142,7 +87247,7 @@ var appWrite = async ({ context, args }) => {
87142
87247
  const path = resolve9(context.cwd, word3);
87143
87248
  const { bytes: _bytes, ...file4 } = buildFileOf({
87144
87249
  path: relative3(folder, path).split(sep3).join("/"),
87145
- bytes: await readFile17(path)
87250
+ bytes: await readFile18(path)
87146
87251
  });
87147
87252
  return file4;
87148
87253
  })
@@ -87270,7 +87375,7 @@ var appPull = async ({ context, args }) => {
87270
87375
  );
87271
87376
  }
87272
87377
  for (const file4 of pulled.files) {
87273
- const target = join28(folder, ...file4.path.split("/"));
87378
+ const target = join29(folder, ...file4.path.split("/"));
87274
87379
  await mkdir8(dirname18(target), { recursive: true });
87275
87380
  await writeFile6(
87276
87381
  target,
@@ -87289,7 +87394,7 @@ var appPull = async ({ context, args }) => {
87289
87394
  ])
87290
87395
  )
87291
87396
  };
87292
- await writeFile6(join28(folder, APP_MANIFEST_FILE), `${JSON.stringify(manifest, null, 2)}
87397
+ await writeFile6(join29(folder, APP_MANIFEST_FILE), `${JSON.stringify(manifest, null, 2)}
87293
87398
  `);
87294
87399
  const names = pulled.collections.map((collection) => collection.name);
87295
87400
  const where = relative3(context.cwd, folder) || ".";
@@ -87534,7 +87639,7 @@ var appRefresh = async ({ context, args }) => {
87534
87639
  };
87535
87640
  function recordPageText({ records }) {
87536
87641
  if (records.totalItems === 0) return "No records yet.\n";
87537
- const lines2 = records.items.map((record4) => JSON.stringify(record4)).join("\n");
87642
+ const lines2 = records.items.map((record5) => JSON.stringify(record5)).join("\n");
87538
87643
  return `${lines2}
87539
87644
  (page ${records.page} of ${records.totalPages}, ${records.totalItems} records)
87540
87645
  `;
@@ -87605,7 +87710,7 @@ var appImport = async ({ context, args }) => {
87605
87710
  const words = args.words.slice(2);
87606
87711
  const [named, collection, file4] = words.length >= 3 ? words : [void 0, ...words];
87607
87712
  if (!collection || !file4) throw new CliUsageError(USAGE7);
87608
- const csv = await readFile17(resolve9(context.cwd, file4), "utf8").catch(() => {
87713
+ const csv = await readFile18(resolve9(context.cwd, file4), "utf8").catch(() => {
87609
87714
  throw new CliUsageError(`Cannot read ${file4}`);
87610
87715
  });
87611
87716
  const scoped = named ? { ...args, flags: { ...args.flags, app: named } } : args;
@@ -88557,8 +88662,8 @@ async function billing({ context, args }) {
88557
88662
 
88558
88663
  // src/services/browser-commands.service.ts
88559
88664
  import { randomBytes as randomBytes3 } from "node:crypto";
88560
- import { readFile as readFile18 } from "node:fs/promises";
88561
- import { dirname as dirname19, join as join29 } from "node:path";
88665
+ import { readFile as readFile19 } from "node:fs/promises";
88666
+ import { dirname as dirname19, join as join30 } from "node:path";
88562
88667
 
88563
88668
  // src/services/cdp-bridge.service.ts
88564
88669
  import { spawn as spawn3 } from "node:child_process";
@@ -88978,7 +89083,7 @@ async function turnTokenOf4({
88978
89083
  const pinned = env.LAZE_TURN_TOKEN?.trim();
88979
89084
  if (pinned) return pinned;
88980
89085
  if (env.LAZE_TURN_FILE) {
88981
- return readFile18(env.LAZE_TURN_FILE, "utf8").then(
89086
+ return readFile19(env.LAZE_TURN_FILE, "utf8").then(
88982
89087
  (text3) => text3.trim(),
88983
89088
  () => ""
88984
89089
  );
@@ -89068,7 +89173,7 @@ async function answering({
89068
89173
  }
89069
89174
  function bridgeStatePath({ context, machine: machine2 }) {
89070
89175
  const safe = machine2.replace(/[^a-zA-Z0-9_-]/g, "_");
89071
- return join29(dirname19(context.environment.configPath), "bridges", `${safe}.json`);
89176
+ return join30(dirname19(context.environment.configPath), "bridges", `${safe}.json`);
89072
89177
  }
89073
89178
  async function bridgePort({
89074
89179
  context,
@@ -89781,7 +89886,7 @@ async function channelSettings({ context, args }) {
89781
89886
  }
89782
89887
 
89783
89888
  // src/services/chat-actions-commands.service.ts
89784
- import { readFile as readFile19 } from "node:fs/promises";
89889
+ import { readFile as readFile20 } from "node:fs/promises";
89785
89890
  import { basename as basename9, resolve as resolve11 } from "node:path";
89786
89891
 
89787
89892
  // src/rules/app-link.rules.ts
@@ -90228,7 +90333,7 @@ var files = async ({ context, args, client }) => {
90228
90333
  };
90229
90334
  var fileUpload = async ({ context, args, client }) => {
90230
90335
  const path = resolve11(context.cwd, wordAt(args, 3));
90231
- const bytes = new Uint8Array(await readFile19(path));
90336
+ const bytes = new Uint8Array(await readFile20(path));
90232
90337
  const answer6 = await uploadFile({
90233
90338
  context,
90234
90339
  client,
@@ -93821,11 +93926,11 @@ async function computer({ context, args }) {
93821
93926
  }
93822
93927
 
93823
93928
  // src/services/connect-commands.service.ts
93824
- import { readFile as readFile21 } from "node:fs/promises";
93929
+ import { readFile as readFile22 } from "node:fs/promises";
93825
93930
 
93826
93931
  // src/services/mcp-gateway.service.ts
93827
- import { mkdir as mkdir10, readFile as readFile20, writeFile as writeFile7 } from "node:fs/promises";
93828
- import { basename as basename11, join as join30, resolve as resolve13 } from "node:path";
93932
+ import { mkdir as mkdir10, readFile as readFile21, writeFile as writeFile7 } from "node:fs/promises";
93933
+ import { basename as basename11, join as join31, resolve as resolve13 } from "node:path";
93829
93934
  import { createInterface as createInterface2 } from "node:readline";
93830
93935
 
93831
93936
  // src/services/mcp-support.service.ts
@@ -93892,7 +93997,7 @@ async function answerSupportLine({
93892
93997
  const scoped = client.withHeaders({ "x-laze-turn": turn });
93893
93998
  try {
93894
93999
  const answer6 = call.body === void 0 ? await scoped.get(call.path) : await scoped.post(call.path, call.body);
93895
- return rpc(id8, { result: { content: [{ type: "text", text: JSON.stringify(answer6) }] } });
94000
+ return rpc(id8, { result: { content: contentOf(answer6) } });
93896
94001
  } catch (error63) {
93897
94002
  if (!(error63 instanceof LazeApiError)) throw error63;
93898
94003
  const text3 = `${error63.code}: ${error63.message}`;
@@ -93915,6 +94020,20 @@ function routeOf({
93915
94020
  }
93916
94021
  return null;
93917
94022
  }
94023
+ function contentOf(answer6) {
94024
+ const { images, ...rest } = recordOf3(answer6);
94025
+ const pictures = Array.isArray(images) ? images.map(recordOf3) : [];
94026
+ if (pictures.length === 0) return [{ type: "text", text: JSON.stringify(answer6) }];
94027
+ return [
94028
+ { type: "text", text: JSON.stringify(rest) },
94029
+ ...pictures.flatMap(
94030
+ ({ attachmentId, messageId, data, contentType }) => typeof data === "string" && typeof contentType === "string" ? [
94031
+ { type: "text", text: `Picture ${String(attachmentId)} on line ${String(messageId)}:` },
94032
+ { type: "image", data, mimeType: contentType }
94033
+ ] : []
94034
+ )
94035
+ ];
94036
+ }
93918
94037
  function rpc(id8, body) {
93919
94038
  return JSON.stringify({ jsonrpc: "2.0", id: id8, ...body });
93920
94039
  }
@@ -93961,7 +94080,7 @@ async function relayMcpLines({
93961
94080
  const github3 = env.LAZE_GITHUB_CONNECTION;
93962
94081
  const url2 = `${profile.url.replace(/\/+$/, "")}/api/connectors/mcp/${encodeURIComponent(profile.agentId)}${github3 ? `?github=${encodeURIComponent(github3)}` : ""}`;
93963
94082
  const turnFile = env.LAZE_TURN_FILE;
93964
- const readTurn = () => readFile20(turnFile, "utf8").then(
94083
+ const readTurn = () => readFile21(turnFile, "utf8").then(
93965
94084
  (text3) => text3.trim(),
93966
94085
  () => ""
93967
94086
  );
@@ -94004,8 +94123,8 @@ function safeName(name3, fallback) {
94004
94123
  return last && last !== "." && last !== ".." ? last : fallback;
94005
94124
  }
94006
94125
  async function saveMailFile({ root, file: file4 }) {
94007
- const dir = join30(root, safeName(file4.messageId, "message"));
94008
- const path = join30(dir, safeName(file4.fileName, "attachment"));
94126
+ const dir = join31(root, safeName(file4.messageId, "message"));
94127
+ const path = join31(dir, safeName(file4.fileName, "attachment"));
94009
94128
  await mkdir10(dir, { recursive: true });
94010
94129
  await writeFile7(path, Buffer.from(file4.base64, "base64"));
94011
94130
  return path;
@@ -94131,7 +94250,7 @@ async function turnOf({ context }) {
94131
94250
  const pinned = env.LAZE_TURN_TOKEN?.trim();
94132
94251
  if (pinned) return pinned;
94133
94252
  const file4 = env.LAZE_TURN_FILE;
94134
- const turn = file4 ? await readFile21(file4, "utf8").then(
94253
+ const turn = file4 ? await readFile22(file4, "utf8").then(
94135
94254
  (text3) => text3.trim(),
94136
94255
  () => ""
94137
94256
  ) : "";
@@ -94255,11 +94374,11 @@ async function suggestServer({
94255
94374
  }
94256
94375
 
94257
94376
  // src/services/connector-commands.service.ts
94258
- import { readFile as readFile23 } from "node:fs/promises";
94377
+ import { readFile as readFile24 } from "node:fs/promises";
94259
94378
  import { resolve as resolve14 } from "node:path";
94260
94379
 
94261
94380
  // src/services/vault-keychain-commands.service.ts
94262
- import { readFile as readFile22 } from "node:fs/promises";
94381
+ import { readFile as readFile23 } from "node:fs/promises";
94263
94382
 
94264
94383
  // src/rules/vault-input.rules.ts
94265
94384
  function secondsOf(text3) {
@@ -94680,7 +94799,7 @@ async function secretText({ context, args }) {
94680
94799
  );
94681
94800
  }
94682
94801
  const file4 = flagText({ args, name: "from-file" });
94683
- const text3 = file4 ? await readFile22(file4, "utf8") : await context.readStdin();
94802
+ const text3 = file4 ? await readFile23(file4, "utf8") : await context.readStdin();
94684
94803
  const trimmed = text3.replace(/\r?\n$/, "");
94685
94804
  if (!trimmed.trim()) throw new CliUsageError("No value: pipe it on stdin or use --from-file.");
94686
94805
  const held = await placeholdersOf({ env: context.environment.inherited });
@@ -94701,7 +94820,7 @@ async function keychainOf2({ client, args }) {
94701
94820
  const me = await client.get("/api/agents/me");
94702
94821
  return { kind: "personal", ownerUserId: me.id };
94703
94822
  }
94704
- function settingsOf2(args) {
94823
+ function settingsOf3(args) {
94705
94824
  const lease = flagText({ args, name: "lease" }) || flagText({ args, name: "max-lease" });
94706
94825
  const approvers = args.lists.approver;
94707
94826
  const everyUseAsks = yesNoOf({ args, name: "every-use-asks" });
@@ -94745,7 +94864,7 @@ var add4 = async ({ context, args }) => {
94745
94864
  name: name3,
94746
94865
  keychain: await keychainOf2({ client, args }),
94747
94866
  sensitivity: levelOf2(args) ?? "checked",
94748
- ...settingsOf2(args),
94867
+ ...settingsOf3(args),
94749
94868
  secret
94750
94869
  });
94751
94870
  if (args.flags.json) return printJson4({ context, data: created });
@@ -94755,7 +94874,7 @@ var add4 = async ({ context, args }) => {
94755
94874
  );
94756
94875
  };
94757
94876
  var update = async ({ context, args }) => {
94758
- const settings3 = { ...settingsOf2(args), ...deviceApprovalOf(args) };
94877
+ const settings3 = { ...settingsOf3(args), ...deviceApprovalOf(args) };
94759
94878
  const { client, profile } = await signedIn({ context, args });
94760
94879
  if (Object.keys(settings3).length === 0) throw new CliUsageError(VAULT_USAGE);
94761
94880
  const word3 = args.words[2];
@@ -94925,7 +95044,7 @@ async function keyText({ context, args }) {
94925
95044
  throw new CliUsageError("A key never goes in a flag: pipe it on stdin or use --from-file.");
94926
95045
  }
94927
95046
  const file4 = flagText({ args, name: "from-file" });
94928
- const text3 = file4 ? await readFile23(resolve14(context.cwd, file4), "utf8") : await context.readStdin();
95047
+ const text3 = file4 ? await readFile24(resolve14(context.cwd, file4), "utf8") : await context.readStdin();
94929
95048
  const trimmed = text3.trim();
94930
95049
  if (!trimmed) throw new CliUsageError("No key: pipe it on stdin or use --from-file.");
94931
95050
  return trimmed;
@@ -95314,7 +95433,7 @@ async function conversationDelete({ context, args }) {
95314
95433
  }
95315
95434
 
95316
95435
  // src/services/discord-commands.service.ts
95317
- import { readFile as readFile24 } from "node:fs/promises";
95436
+ import { readFile as readFile25 } from "node:fs/promises";
95318
95437
  import { resolve as resolve15 } from "node:path";
95319
95438
 
95320
95439
  // ../../modules/discord/contract/src/discord.ts
@@ -95662,7 +95781,7 @@ async function secretsOf({ context, args }) {
95662
95781
  const fromConnection = flagText({ args, name: "from-vault" });
95663
95782
  if (fromConnection) return { fromConnection };
95664
95783
  const file4 = flagText({ args, name: "from-file" });
95665
- const text3 = file4 ? await readFile24(resolve15(context.cwd, file4), "utf8") : await context.readStdin();
95784
+ const text3 = file4 ? await readFile25(resolve15(context.cwd, file4), "utf8") : await context.readStdin();
95666
95785
  const lines2 = text3.split("\n").map((line) => line.trim()).filter(Boolean);
95667
95786
  if (lines2.length !== 2) {
95668
95787
  throw new CliUsageError(
@@ -95932,8 +96051,8 @@ var DOMAINS_USAGE = `Usage:
95932
96051
  var printJson5 = (context, data) => context.out(`${JSON.stringify(data, null, 2)}
95933
96052
  `);
95934
96053
  function printDomain(context, row) {
95935
- const join38 = row.autoJoin ? "auto-join on" : "auto-join off";
95936
- context.out(`${row.domain} ${join38}${row.enforced ? " single sign-on enforced" : ""}
96054
+ const join39 = row.autoJoin ? "auto-join on" : "auto-join off";
96055
+ context.out(`${row.domain} ${join39}${row.enforced ? " single sign-on enforced" : ""}
95937
96056
  `);
95938
96057
  }
95939
96058
  async function list5({ context, args }) {
@@ -95965,7 +96084,7 @@ async function domains({ context, args }) {
95965
96084
  }
95966
96085
 
95967
96086
  // src/services/emoji-commands.service.ts
95968
- import { readFile as readFile25 } from "node:fs/promises";
96087
+ import { readFile as readFile26 } from "node:fs/promises";
95969
96088
  import { resolve as resolve16 } from "node:path";
95970
96089
  var EMOJI_USAGE = `Usage:
95971
96090
  laze emoji list [--json] the workspace's custom emoji, aliases and who added each
@@ -96006,7 +96125,7 @@ async function addEmoji({ context, args, client }) {
96006
96125
  const file4 = wordAt4(args, 3);
96007
96126
  let bytes;
96008
96127
  try {
96009
- bytes = new Uint8Array(await readFile25(resolve16(context.cwd, file4)));
96128
+ bytes = new Uint8Array(await readFile26(resolve16(context.cwd, file4)));
96010
96129
  } catch {
96011
96130
  throw new CliUsageError(`Cannot read ${file4}.`);
96012
96131
  }
@@ -96345,7 +96464,7 @@ var ExternalChannelBannerSlot = externalUi.component("channel-banner");
96345
96464
  var ExternalSharingHooksToken = externalUi.hooks("sharing");
96346
96465
 
96347
96466
  // src/services/workspace-commands.service.ts
96348
- import { readFile as readFile26 } from "node:fs/promises";
96467
+ import { readFile as readFile27 } from "node:fs/promises";
96349
96468
  import { resolve as resolve17 } from "node:path";
96350
96469
  var ROLE_NAMES2 = {
96351
96470
  OWNER: "Owner",
@@ -96528,7 +96647,7 @@ var LOGO_USAGE = "Usage: laze workspace logo set <file.png|jpg|webp> | laze work
96528
96647
  async function readLogo({ context, file: file4 }) {
96529
96648
  let bytes;
96530
96649
  try {
96531
- bytes = new Uint8Array(await readFile26(resolve17(context.cwd, file4)));
96650
+ bytes = new Uint8Array(await readFile27(resolve17(context.cwd, file4)));
96532
96651
  } catch {
96533
96652
  throw new CliUsageError(`No file to read at ${file4}.`);
96534
96653
  }
@@ -97163,7 +97282,7 @@ async function agentFeedAccess({
97163
97282
  }
97164
97283
 
97165
97284
  // src/services/feed-commands.service.ts
97166
- import { readFile as readFile27 } from "node:fs/promises";
97285
+ import { readFile as readFile28 } from "node:fs/promises";
97167
97286
  import { resolve as resolve18 } from "node:path";
97168
97287
 
97169
97288
  // ../../modules/feed/contract/src/feed.delegate.ts
@@ -97460,6 +97579,8 @@ var feedApprovalSchemaDefinition = external_exports.object({
97460
97579
  /** The app, for an `app_publish` or `app_access` card. */
97461
97580
  appId: external_exports.string().nullable(),
97462
97581
  subject: external_exports.string(),
97582
+ /** A vault card's connector ("Gmail") when its key is one, so the card shows that logo. */
97583
+ service: external_exports.string().nullable().optional(),
97463
97584
  action: external_exports.string(),
97464
97585
  agentId: external_exports.string(),
97465
97586
  reason: external_exports.string(),
@@ -98317,7 +98438,7 @@ async function feedTurnOf({
98317
98438
  const read4 = async () => {
98318
98439
  const pinned = env.LAZE_TURN_TOKEN?.trim();
98319
98440
  if (pinned) return pinned;
98320
- if (env.LAZE_TURN_FILE) return (await readFile27(env.LAZE_TURN_FILE, "utf8")).trim();
98441
+ if (env.LAZE_TURN_FILE) return (await readFile28(env.LAZE_TURN_FILE, "utf8")).trim();
98321
98442
  return agent3 ? connectedTurnTokenOf({ client, channelId: channel }) : "";
98322
98443
  };
98323
98444
  const turn = await read4().catch(() => "");
@@ -98391,7 +98512,7 @@ async function bodyOf2({
98391
98512
  flags: flags2
98392
98513
  }) {
98393
98514
  const body = { ...flags2.fields };
98394
- const read4 = (source) => "file" in source ? readFile27(resolve18(context.cwd, source.file), "utf8") : source.text;
98515
+ const read4 = (source) => "file" in source ? readFile28(resolve18(context.cwd, source.file), "utf8") : source.text;
98395
98516
  for (const [field, source] of Object.entries(flags2.texts)) body[field] = await read4(source);
98396
98517
  if (flags2.rich) {
98397
98518
  const text3 = await read4(flags2.rich.source);
@@ -98668,7 +98789,7 @@ async function textFlag({
98668
98789
  }) {
98669
98790
  const value = flagText({ args, name: name3 });
98670
98791
  if (!value.startsWith("@")) return value;
98671
- return readFile27(resolve18(context.cwd, value.slice(1)), "utf8");
98792
+ return readFile28(resolve18(context.cwd, value.slice(1)), "utf8");
98672
98793
  }
98673
98794
  async function feedList({ context, args }) {
98674
98795
  const { client, profile } = await signedIn({ context, args });
@@ -98758,7 +98879,7 @@ async function ranksOf({
98758
98879
  }) {
98759
98880
  const file4 = flagText({ args, name: "file" });
98760
98881
  if (file4) {
98761
- const parsed = JSON.parse(await readFile27(resolve18(context.cwd, file4), "utf8"));
98882
+ const parsed = JSON.parse(await readFile28(resolve18(context.cwd, file4), "utf8"));
98762
98883
  if (Array.isArray(parsed)) return parsed;
98763
98884
  throw new CliUsageError("--file holds a list of {itemId, priority}");
98764
98885
  }
@@ -98873,7 +98994,7 @@ async function feed({ context, args }) {
98873
98994
  }
98874
98995
 
98875
98996
  // src/services/github-commands.service.ts
98876
- import { readFile as readFile28 } from "node:fs/promises";
98997
+ import { readFile as readFile29 } from "node:fs/promises";
98877
98998
 
98878
98999
  // src/rules/github-signature.rules.ts
98879
99000
  var TURN_SEPARATOR = "~";
@@ -98943,7 +99064,7 @@ var REAL_GH = "/usr/bin/gh";
98943
99064
  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>`.";
98944
99065
  async function turnFileToken({ env }) {
98945
99066
  if (!env.LAZE_TURN_FILE) return "";
98946
- return readFile28(env.LAZE_TURN_FILE, "utf8").then(
99067
+ return readFile29(env.LAZE_TURN_FILE, "utf8").then(
98947
99068
  (text3) => text3.trim(),
98948
99069
  () => ""
98949
99070
  );
@@ -98977,7 +99098,7 @@ async function githubGh({
98977
99098
  args: args.rest,
98978
99099
  agentName: profile.name ?? "An agent",
98979
99100
  threadUrl: threadUrlOf({ env, workspaceId: profile.workspaceId }),
98980
- readBodyFile: (path) => path === "-" ? context.readStdin() : readFile28(path, "utf8")
99101
+ readBodyFile: (path) => path === "-" ? context.readStdin() : readFile29(path, "utf8")
98981
99102
  });
98982
99103
  return context.runCommand({
98983
99104
  command: [REAL_GH, ...ghArgs],
@@ -99643,11 +99764,11 @@ async function ip({ context, args }) {
99643
99764
  // src/services/join-commands.service.ts
99644
99765
  import { rm as rm16 } from "node:fs/promises";
99645
99766
  import { hostname as hostname9 } from "node:os";
99646
- import { dirname as dirname22, join as join31 } from "node:path";
99767
+ import { dirname as dirname22, join as join32 } from "node:path";
99647
99768
  var DEFAULT_WAIT_SECONDS2 = 100;
99648
99769
  var JOIN_USAGE = "Usage: laze join [--workspace <name|id|invite link>] [--for <email>] [--name <name>] [--note <text>] [--timeout <seconds>] [--project <folder>]";
99649
99770
  function pendingPathOf({ context }) {
99650
- return join31(dirname22(context.environment.configPath), "join", "pending.json");
99771
+ return join32(dirname22(context.environment.configPath), "join", "pending.json");
99651
99772
  }
99652
99773
  async function readPending({
99653
99774
  context,
@@ -100064,7 +100185,7 @@ var PERSONAL_WORDS = {
100064
100185
  };
100065
100186
  var printJson9 = (context, data) => context.out(`${JSON.stringify(data, null, 2)}
100066
100187
  `);
100067
- function contentOf({ value, flag: flag2 }) {
100188
+ function contentOf2({ value, flag: flag2 }) {
100068
100189
  if (value === "full" || value === "metadata") return value;
100069
100190
  throw new CliUsageError(`${flag2} takes full or metadata.
100070
100191
  ${LANGWATCH_USAGE}`);
@@ -100184,7 +100305,7 @@ ${LANGWATCH_USAGE}`);
100184
100305
  }
100185
100306
  async function turnOn2({ context, args }) {
100186
100307
  const content = args.flags.content;
100187
- const level2 = content === void 0 ? void 0 : contentOf({ value: flagText({ args, name: "content" }), flag: "--content" });
100308
+ const level2 = content === void 0 ? void 0 : contentOf2({ value: flagText({ args, name: "content" }), flag: "--content" });
100188
100309
  const { client } = await signedIn({ context, args });
100189
100310
  const integration = await client.post(
100190
100311
  LANGWATCH_REST_PATHS.enable,
@@ -100209,7 +100330,7 @@ ${LANGWATCH_USAGE}`);
100209
100330
  }
100210
100331
  async function level({ context, args }) {
100211
100332
  const personalLevel = personalOf({ args });
100212
- const team = args.words[2] === void 0 && personalLevel !== void 0 ? void 0 : contentOf({ value: args.words[2], flag: "level" });
100333
+ const team = args.words[2] === void 0 && personalLevel !== void 0 ? void 0 : contentOf2({ value: args.words[2], flag: "level" });
100213
100334
  const { client } = await signedIn({ context, args });
100214
100335
  const integration = await client.post(LANGWATCH_REST_PATHS.level, {
100215
100336
  ...team ? { level: team } : {},
@@ -100929,18 +101050,18 @@ async function serveMcp({
100929
101050
  }
100930
101051
 
100931
101052
  // src/services/memory-commands.service.ts
100932
- import { readdir as readdir7, readFile as readFile30 } from "node:fs/promises";
100933
- import { join as join32, resolve as resolve20 } from "node:path";
101053
+ import { readdir as readdir7, readFile as readFile31 } from "node:fs/promises";
101054
+ import { join as join33, resolve as resolve20 } from "node:path";
100934
101055
 
100935
101056
  // src/services/mount-files.service.ts
100936
- import { mkdir as mkdir11, readFile as readFile29, rm as rm17, writeFile as writeFile8 } from "node:fs/promises";
101057
+ import { mkdir as mkdir11, readFile as readFile30, rm as rm17, writeFile as writeFile8 } from "node:fs/promises";
100937
101058
  import { dirname as dirname23, relative as relative4, resolve as resolve19 } from "node:path";
100938
101059
  async function textArgument({
100939
101060
  context,
100940
101061
  value
100941
101062
  }) {
100942
101063
  if (value === "-") return context.readStdin();
100943
- if (value.startsWith("@")) return readFile29(resolve19(context.cwd, value.slice(1)), "utf8");
101064
+ if (value.startsWith("@")) return readFile30(resolve19(context.cwd, value.slice(1)), "utf8");
100944
101065
  return value;
100945
101066
  }
100946
101067
  function turnChannel({ context, args }) {
@@ -101087,7 +101208,7 @@ async function turnTokenOf5({ context }) {
101087
101208
  const pinned = env.LAZE_TURN_TOKEN?.trim();
101088
101209
  if (pinned) return pinned;
101089
101210
  if (!env.LAZE_TURN_FILE) return "";
101090
- return readFile30(env.LAZE_TURN_FILE, "utf8").then(
101211
+ return readFile31(env.LAZE_TURN_FILE, "utf8").then(
101091
101212
  (text3) => text3.trim(),
101092
101213
  () => ""
101093
101214
  );
@@ -101217,15 +101338,15 @@ async function siestaImport({
101217
101338
  dir
101218
101339
  }) {
101219
101340
  const root = resolve20(context.cwd, dir);
101220
- const log = await readFile30(join32(root, "LOG.md"));
101221
- const names = (await readdir7(join32(root, "tree")).catch(() => [])).filter(
101341
+ const log = await readFile31(join33(root, "LOG.md"));
101342
+ const names = (await readdir7(join33(root, "tree")).catch(() => [])).filter(
101222
101343
  (name3) => /^\d{1,6}-\d{1,6}\.md$/.test(name3)
101223
101344
  );
101224
101345
  const tree = Object.fromEntries(
101225
101346
  await Promise.all(
101226
101347
  names.map(async (name3) => [
101227
101348
  name3.slice(0, -3),
101228
- (await readFile30(join32(root, "tree", name3))).toString("base64")
101349
+ (await readFile31(join33(root, "tree", name3))).toString("base64")
101229
101350
  ])
101230
101351
  )
101231
101352
  );
@@ -101245,15 +101366,15 @@ async function memoryImport({ context, args }) {
101245
101366
  const dir = flagText({ args, name: "optmem" });
101246
101367
  if (!dir) throw new CliUsageError(USAGE14);
101247
101368
  const root = resolve20(context.cwd, dir);
101248
- const log = await readFile30(join32(root, "LOG.txt"));
101249
- const sizes2 = (await readdir7(join32(root, "TREE")).catch(() => [])).filter(
101369
+ const log = await readFile31(join33(root, "LOG.txt"));
101370
+ const sizes2 = (await readdir7(join33(root, "TREE")).catch(() => [])).filter(
101250
101371
  (name3) => /^\d{1,4}$/.test(name3)
101251
101372
  );
101252
101373
  const tree = Object.fromEntries(
101253
101374
  await Promise.all(
101254
101375
  sizes2.map(async (size) => [
101255
101376
  size,
101256
- (await readFile30(join32(root, "TREE", size))).toString("base64")
101377
+ (await readFile31(join33(root, "TREE", size))).toString("base64")
101257
101378
  ])
101258
101379
  )
101259
101380
  );
@@ -101850,8 +101971,8 @@ async function openclaw({
101850
101971
 
101851
101972
  // src/services/operator-key-commands.service.ts
101852
101973
  import { createHash as createHash10, randomBytes as randomBytes5 } from "node:crypto";
101853
- import { mkdir as mkdir12, readFile as readFile31, rm as rm18, writeFile as writeFile9 } from "node:fs/promises";
101854
- import { dirname as dirname24, join as join33 } from "node:path";
101974
+ import { mkdir as mkdir12, readFile as readFile32, rm as rm18, writeFile as writeFile9 } from "node:fs/promises";
101975
+ import { dirname as dirname24, join as join34 } from "node:path";
101855
101976
 
101856
101977
  // ../../modules/audit-log/contract/src/audit-log.api.ts
101857
101978
  var auditEntrySchemaDefinition = external_exports.object({
@@ -103691,7 +103812,7 @@ Ops function leases (ADR-214), instead of reading the database:
103691
103812
  call one function of an approved lease; a cut
103692
103813
  list says so and names the cursor of the next page`;
103693
103814
  var POLL_MS3 = 5e3;
103694
- var keyFile = ({ context, keyId }) => join33(dirname24(context.environment.configPath), "operator-keys", keyId.replaceAll("/", "_"));
103815
+ var keyFile = ({ context, keyId }) => join34(dirname24(context.environment.configPath), "operator-keys", keyId.replaceAll("/", "_"));
103695
103816
  async function saveSecret({
103696
103817
  context,
103697
103818
  keyId,
@@ -103802,7 +103923,7 @@ async function useKey({
103802
103923
  if (!keyId) throw new CliUsageError(OPERATOR_KEY_USAGE);
103803
103924
  const { client } = await signedIn({ context, args });
103804
103925
  const path = keyFile({ context, keyId });
103805
- const secret = await readFile31(path, "utf8").catch(() => null);
103926
+ const secret = await readFile32(path, "utf8").catch(() => null);
103806
103927
  if (secret === null) {
103807
103928
  throw new CliUsageError(`No operator key ${keyId} is kept on this machine.`);
103808
103929
  }
@@ -103939,7 +104060,7 @@ ${OPS_USAGE}`);
103939
104060
 
103940
104061
  // src/services/release-watch.service.ts
103941
104062
  import { realpath as realpath2 } from "node:fs/promises";
103942
- import { dirname as dirname25, join as join34 } from "node:path";
104063
+ import { dirname as dirname25, join as join35 } from "node:path";
103943
104064
  var RETRY_AFTER_MS = 6 * 60 * 60 * 1e3;
103944
104065
  async function scriptOf(context) {
103945
104066
  const script = context.program.at(-1) ?? "";
@@ -103957,14 +104078,14 @@ async function startedUpdate({
103957
104078
  const plan2 = updatePlanOf({ script: await scriptOf(context) });
103958
104079
  if (plan2.kind !== "install") return null;
103959
104080
  const folder = dirname25(context.environment.configPath);
103960
- const stamp = join34(folder, "auto-update.json");
104081
+ const stamp = join35(folder, "auto-update.json");
103961
104082
  const last = await readStateJson({ path: stamp }) ?? null;
103962
104083
  const now = context.nowMs();
103963
104084
  if (last?.server === server && now - last.atMs < RETRY_AFTER_MS) return null;
103964
104085
  await writeStateJson({ path: stamp, value: { server, atMs: now } });
103965
104086
  context.processes.spawnDetached({
103966
104087
  argv: [...context.program, "update"],
103967
- logPath: join34(folder, "auto-update.log")
104088
+ logPath: join35(folder, "auto-update.log")
103968
104089
  });
103969
104090
  return { manager: plan2.manager };
103970
104091
  }
@@ -104260,8 +104381,8 @@ async function schedule({ context, args }) {
104260
104381
  }
104261
104382
 
104262
104383
  // src/services/skill-commands.service.ts
104263
- import { readdir as readdir8, readFile as readFile32 } from "node:fs/promises";
104264
- import { join as join35, relative as relative5, resolve as resolve22 } from "node:path";
104384
+ import { readdir as readdir8, readFile as readFile33 } from "node:fs/promises";
104385
+ import { join as join36, relative as relative5, resolve as resolve22 } from "node:path";
104265
104386
  var USAGE18 = `Usage:
104266
104387
  laze skill list [--agent <agentId>]
104267
104388
  laze skill install <catalogue-id> [--as <name>] [--agent <agentId>]
@@ -104282,8 +104403,8 @@ async function folderFiles({ root }) {
104282
104403
  const files2 = [];
104283
104404
  for (const entry2 of entries) {
104284
104405
  if (!entry2.isFile()) continue;
104285
- const full = join35(entry2.parentPath, entry2.name);
104286
- files2.push({ path: relative5(root, full), content: await readFile32(full, "utf8") });
104406
+ const full = join36(entry2.parentPath, entry2.name);
104407
+ files2.push({ path: relative5(root, full), content: await readFile33(full, "utf8") });
104287
104408
  }
104288
104409
  return files2.toSorted((a, b) => a.path.localeCompare(b.path));
104289
104410
  }
@@ -104381,7 +104502,7 @@ async function skillUpdate({ context, args }) {
104381
104502
  if (!name3 || !newName && description === void 0 && !skillMdFile) {
104382
104503
  throw new CliUsageError(USAGE18);
104383
104504
  }
104384
- const skillMd = skillMdFile ? await readFile32(resolve22(context.cwd, skillMdFile), "utf8") : void 0;
104505
+ const skillMd = skillMdFile ? await readFile33(resolve22(context.cwd, skillMdFile), "utf8") : void 0;
104385
104506
  const { client } = await signedIn({ context, args });
104386
104507
  const updated = await client.post("/api/skills/update", {
104387
104508
  name: name3,
@@ -104427,7 +104548,7 @@ async function skill({ context, args }) {
104427
104548
  }
104428
104549
 
104429
104550
  // src/services/slack-commands.service.ts
104430
- import { readFile as readFile33 } from "node:fs/promises";
104551
+ import { readFile as readFile34 } from "node:fs/promises";
104431
104552
  import { resolve as resolve23 } from "node:path";
104432
104553
  var SLACK_USAGE = `Usage (a person's key; Slack stays the source, the bot joins no channel by itself):
104433
104554
  laze slack overview connected Slack workspaces, mirrors, your link
@@ -104478,7 +104599,7 @@ async function secretLines({ context, args }) {
104478
104599
  throw new CliUsageError("A secret never goes in a flag: pipe it on stdin or use --from-file.");
104479
104600
  }
104480
104601
  const file4 = flagText({ args, name: "from-file" });
104481
- const text3 = file4 ? await readFile33(resolve23(context.cwd, file4), "utf8") : await context.readStdin();
104602
+ const text3 = file4 ? await readFile34(resolve23(context.cwd, file4), "utf8") : await context.readStdin();
104482
104603
  return text3.split("\n").map((line) => line.trim()).filter(Boolean);
104483
104604
  }
104484
104605
  async function secretsOf2({
@@ -104796,7 +104917,7 @@ async function slack({
104796
104917
  }
104797
104918
 
104798
104919
  // src/services/sso-commands.service.ts
104799
- import { readFile as readFile34 } from "node:fs/promises";
104920
+ import { readFile as readFile35 } from "node:fs/promises";
104800
104921
  var SSO_USAGE = `Usage:
104801
104922
  laze sso domains claimed domains and how each signs in (admins)
104802
104923
  laze sso claim <domain> the TXT record that proves the domain
@@ -104883,7 +105004,7 @@ function refuseSecretFlags({ args }) {
104883
105004
  }
104884
105005
  async function clientSecretOf({ context, args }) {
104885
105006
  const file4 = flagText({ args, name: "from-file" });
104886
- const text3 = file4 ? await readFile34(file4, "utf8") : await context.readStdin();
105007
+ const text3 = file4 ? await readFile35(file4, "utf8") : await context.readStdin();
104887
105008
  const secret = text3.trim();
104888
105009
  if (!secret) throw new CliUsageError("No client secret: pipe it on stdin or use --from-file.");
104889
105010
  return secret;
@@ -105227,8 +105348,8 @@ async function checkInstalled({
105227
105348
  }
105228
105349
 
105229
105350
  // src/services/vault-env-commands.service.ts
105230
- import { readFile as readFile35, stat as stat12 } from "node:fs/promises";
105231
- import { dirname as dirname26, join as join36, resolve as resolve24 } from "node:path";
105351
+ import { readFile as readFile36, stat as stat12 } from "node:fs/promises";
105352
+ import { dirname as dirname26, join as join37, resolve as resolve24 } from "node:path";
105232
105353
 
105233
105354
  // src/rules/vault-manifest.rules.ts
105234
105355
  var VARIABLE = /^[A-Za-z_][A-Za-z0-9_]*$/;
@@ -105493,7 +105614,8 @@ async function releaseBatch({
105493
105614
  for (const [key, release2] of settled3) {
105494
105615
  if (release2.outcome !== "allow" || !release2.boundary) continue;
105495
105616
  const { connectionId } = release2.boundary;
105496
- await handedOut({ context, name: key, connectionId, fields: release2.env });
105617
+ const fields = standInFieldsOf({ env: release2.env, boundary: release2.boundary });
105618
+ await handedOut({ context, name: key, connectionId, fields });
105497
105619
  }
105498
105620
  return outcome;
105499
105621
  }
@@ -105610,7 +105732,7 @@ async function manifestPathOf({
105610
105732
  const environment = flagText({ args, name: "env" });
105611
105733
  const file4 = environment ? `.env.${environment}.vault` : ".env.vault";
105612
105734
  for (let dir = resolve24(context.cwd); ; dir = dirname26(dir)) {
105613
- if (await isFile(join36(dir, file4))) return join36(dir, file4);
105735
+ if (await isFile(join37(dir, file4))) return join37(dir, file4);
105614
105736
  if (dirname26(dir) === dir) break;
105615
105737
  }
105616
105738
  throw new CliUsageError(`laze vault: no ${file4} here or in a parent folder
@@ -105621,7 +105743,7 @@ async function manifestOf({
105621
105743
  args
105622
105744
  }) {
105623
105745
  const file4 = await manifestPathOf({ context, args });
105624
- const text3 = await readFile35(file4, "utf8").catch(() => {
105746
+ const text3 = await readFile36(file4, "utf8").catch(() => {
105625
105747
  throw new CliUsageError(`laze vault: cannot read ${file4}`);
105626
105748
  });
105627
105749
  return { file: file4, lines: parseManifest({ text: text3, file: file4 }) };
@@ -105983,7 +106105,7 @@ async function vaultScrub({ context, args }) {
105983
106105
  }
105984
106106
 
105985
106107
  // src/services/whatsapp-business-commands.service.ts
105986
- import { readFile as readFile36 } from "node:fs/promises";
106108
+ import { readFile as readFile37 } from "node:fs/promises";
105987
106109
  import { resolve as resolve25 } from "node:path";
105988
106110
 
105989
106111
  // ../../modules/whatsapp-business/contract/src/whatsapp-business.prices.ts
@@ -106480,7 +106602,7 @@ async function secretsOf3({ context, args }) {
106480
106602
  const fromConnection = flagText({ args, name: "from-vault" });
106481
106603
  if (fromConnection) return { fromConnection };
106482
106604
  const file4 = flagText({ args, name: "from-file" });
106483
- const text3 = file4 ? await readFile36(resolve25(context.cwd, file4), "utf8") : await context.readStdin();
106605
+ const text3 = file4 ? await readFile37(resolve25(context.cwd, file4), "utf8") : await context.readStdin();
106484
106606
  const lines2 = text3.split("\n").map((line) => line.trim()).filter(Boolean);
106485
106607
  if (lines2.length !== 2) {
106486
106608
  throw new CliUsageError(
@@ -107687,8 +107809,8 @@ import {
107687
107809
  randomBytes as randomBytes6,
107688
107810
  sign
107689
107811
  } from "node:crypto";
107690
- import { chmod, link, mkdir as mkdir13, readFile as readFile37, rm as rm21, writeFile as writeFile11 } from "node:fs/promises";
107691
- import { dirname as dirname27, join as join37 } from "node:path";
107812
+ import { chmod, link, mkdir as mkdir13, readFile as readFile38, rm as rm21, writeFile as writeFile11 } from "node:fs/promises";
107813
+ import { dirname as dirname27, join as join38 } from "node:path";
107692
107814
  var KEYCHAIN_SERVICE = "laze-cli-machine-key";
107693
107815
  var runProgram = ({ program, args, stdin: stdin2, timeoutMs }) => new Promise((resolve27, reject) => {
107694
107816
  const child = execFile2(
@@ -107728,11 +107850,11 @@ var MachineKeyStore = class _MachineKeyStore {
107728
107850
  });
107729
107851
  }
107730
107852
  get metaPath() {
107731
- return join37(dirname27(this.options.configPath), "machine-key.json");
107853
+ return join38(dirname27(this.options.configPath), "machine-key.json");
107732
107854
  }
107733
107855
  /** Named by the key, so two CLIs making a key at once never overwrite each other's. */
107734
107856
  pemPathOf(jwk) {
107735
- return join37(dirname27(this.options.configPath), `machine-key-${shortOf(jwk)}.pem`);
107857
+ return join38(dirname27(this.options.configPath), `machine-key-${shortOf(jwk)}.pem`);
107736
107858
  }
107737
107859
  /** The Keychain item's account: one per config file and key. */
107738
107860
  accountOf(jwk) {
@@ -107760,7 +107882,7 @@ var MachineKeyStore = class _MachineKeyStore {
107760
107882
  async read() {
107761
107883
  let meta3;
107762
107884
  try {
107763
- meta3 = machineKeyRegistrationSchema.parse(JSON.parse(await readFile37(this.metaPath, "utf8")));
107885
+ meta3 = machineKeyRegistrationSchema.parse(JSON.parse(await readFile38(this.metaPath, "utf8")));
107764
107886
  } catch {
107765
107887
  return null;
107766
107888
  }
@@ -107775,7 +107897,7 @@ var MachineKeyStore = class _MachineKeyStore {
107775
107897
  "-w"
107776
107898
  ],
107777
107899
  timeoutMs: 1e4
107778
- }) : await readFile37(this.pemPathOf(meta3.jwk), "utf8");
107900
+ }) : await readFile38(this.pemPathOf(meta3.jwk), "utf8");
107779
107901
  return keyOf2({ meta: meta3, privateKey: createPrivateKey(pemOf(pem)) });
107780
107902
  }
107781
107903
  async make() {
@@ -107917,7 +108039,7 @@ function machineProofFetch({
107917
108039
  // src/services/processes.service.ts
107918
108040
  import { execFile as execFile3, spawn as spawn4, spawnSync } from "node:child_process";
107919
108041
  import { closeSync, mkdirSync, openSync, renameSync, statSync } from "node:fs";
107920
- import { readFile as readFile38, readlink } from "node:fs/promises";
108042
+ import { readFile as readFile39, readlink } from "node:fs/promises";
107921
108043
  import { dirname as dirname28 } from "node:path";
107922
108044
  import { promisify as promisify2 } from "node:util";
107923
108045
  var run3 = promisify2(execFile3);
@@ -107931,14 +108053,14 @@ function alive(pid) {
107931
108053
  }
107932
108054
  }
107933
108055
  async function argsOf2(pid) {
107934
- const raw = await readFile38(`/proc/${pid}/cmdline`, "utf8").catch(() => void 0);
108056
+ const raw = await readFile39(`/proc/${pid}/cmdline`, "utf8").catch(() => void 0);
107935
108057
  if (raw) return raw.split("\0").filter(Boolean);
107936
108058
  const listed = await run3("ps", ["-o", "args=", "-p", String(pid)]).catch(() => void 0);
107937
108059
  const line = listed?.stdout.trim();
107938
108060
  return line ? line.split(/\s+/) : void 0;
107939
108061
  }
107940
108062
  async function parentOf(pid) {
107941
- const stat13 = await readFile38(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
108063
+ const stat13 = await readFile39(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
107942
108064
  const fromStat = stat13 ? Number(stat13.slice(stat13.lastIndexOf(")") + 2).split(" ")[1]) : NaN;
107943
108065
  if (fromStat > 0) return fromStat;
107944
108066
  const listed = await run3("ps", ["-o", "ppid=", "-p", String(pid)]).catch(() => void 0);
@@ -107946,7 +108068,7 @@ async function parentOf(pid) {
107946
108068
  return parent > 0 ? parent : void 0;
107947
108069
  }
107948
108070
  async function startOf(pid) {
107949
- const stat13 = await readFile38(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
108071
+ const stat13 = await readFile39(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
107950
108072
  const ticks = stat13 ? stat13.slice(stat13.lastIndexOf(")") + 2).split(" ")[19] : void 0;
107951
108073
  if (ticks) return ticks;
107952
108074
  const listed = await run3("ps", ["-o", "lstart=", "-p", String(pid)]).catch(() => void 0);
@@ -108136,7 +108258,7 @@ if (true) {
108136
108258
  err: (text3) => void process.stderr.write(text3),
108137
108259
  readStdin,
108138
108260
  stdoutIsTerminal: process.stdout.isTTY === true,
108139
- lazeInstalls: () => scanLazeInstalls({ env: environment.inherited, home: homedir5() }),
108261
+ lazeInstalls: () => scanLazeInstalls({ env: environment.inherited, home: homedir6() }),
108140
108262
  ...ask ? { ask } : {},
108141
108263
  sleep,
108142
108264
  nowMs: nowMs2,