@lazehq/cli 0.1.46 → 0.1.48

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 +171 -16
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -35718,7 +35718,7 @@ function flagText({
35718
35718
  }
35719
35719
 
35720
35720
  // src/rules/cli-version.rules.ts
35721
- var STAMPED = "0.1.46";
35721
+ var STAMPED = "0.1.48";
35722
35722
  function cliVersionOf({ stamped = STAMPED } = {}) {
35723
35723
  return stamped.startsWith("__") ? "dev" : stamped;
35724
35724
  }
@@ -58515,6 +58515,12 @@ var messageSchemaDefinition = external_exports.object({
58515
58515
  notInChannel: external_exports.array(notInChannelSchemaDefinition).optional()
58516
58516
  });
58517
58517
  var messageSchema = messageSchemaDefinition;
58518
+ var departedPersonSchemaDefinition = external_exports.object({
58519
+ id: idSchema4,
58520
+ name: external_exports.string(),
58521
+ /** When they left; null when chat learnt of it later, from the chat-departed-names task. */
58522
+ departedAt: external_exports.iso.datetime().nullable()
58523
+ });
58518
58524
  var conversationSchemaDefinition = external_exports.object({
58519
58525
  id: idSchema4,
58520
58526
  workspaceId: workspaceIdSchema,
@@ -58543,7 +58549,12 @@ var conversationSchemaDefinition = external_exports.object({
58543
58549
  /** Set when the conversation mirrors one outside Laze. */
58544
58550
  mirror: conversationMirrorSchemaDefinition.nullable(),
58545
58551
  /** For a `chat`, the agent it is with; null for every other kind. */
58546
- agentId: idSchema4.nullish()
58552
+ agentId: idSchema4.nullish(),
58553
+ /**
58554
+ * Direct messages only: the people who left the workspace while in it, no longer members.
58555
+ * Spec: modules/chat/specs/departed-person-direct.feature. Absent means no one.
58556
+ */
58557
+ departed: external_exports.array(departedPersonSchemaDefinition).optional()
58547
58558
  });
58548
58559
  var conversationSchema = conversationSchemaDefinition;
58549
58560
  var conversationSummarySchemaDefinition = external_exports.object({
@@ -58981,7 +58992,9 @@ var signalActivityInputSchemaDefinition = external_exports.object({
58981
58992
  contextTokens: external_exports.number().int().nonnegative().nullable().default(null),
58982
58993
  contextWindow: external_exports.number().int().positive().nullable().default(null),
58983
58994
  /** With `queued`: the conversation the agent is busy in, named only to people who see it. */
58984
- elsewhere: idSchema4.nullable().default(null)
58995
+ elsewhere: idSchema4.nullable().default(null),
58996
+ /** With `thinking`: no turn has taken the message yet ("Waiting for <agent> to pick this up"). */
58997
+ waiting: external_exports.boolean().default(false)
58985
58998
  });
58986
58999
  var setAgentLimitInputSchemaDefinition = external_exports.object({
58987
59000
  workspaceId: workspaceIdSchema,
@@ -60406,7 +60419,9 @@ var realtimePublicationSchemaDefinition = external_exports.discriminatedUnion("t
60406
60419
  text: external_exports.string(),
60407
60420
  contextTokens: external_exports.number().int().nonnegative().nullable(),
60408
60421
  contextWindow: external_exports.number().int().positive().nullable(),
60409
- elsewhere: external_exports.string().nullable().optional()
60422
+ elsewhere: external_exports.string().nullable().optional(),
60423
+ /** With `thinking`: no turn has taken the message yet; apps that miss it read thinking. */
60424
+ waiting: external_exports.boolean().optional()
60410
60425
  }),
60411
60426
  external_exports.object({
60412
60427
  type: external_exports.literal("typing"),
@@ -61851,6 +61866,15 @@ var vaultAlertRaisedPayloadSchemaDefinition = external_exports.object({
61851
61866
  // ../../modules/vault/contract/src/vault-reference-chip.ts
61852
61867
  var VaultReferenceChipSlot = uiTokens("vault").component("referenceChip");
61853
61868
  var VaultMessageFootSlot = uiTokens("vault").component("messageFoot");
61869
+ var REFERENCE = /\{\{vault:([A-Za-z0-9_][A-Za-z0-9_./:-]*)\}\}/g;
61870
+ function vaultReferenceNames({ text: text2 }) {
61871
+ return [...new Set([...text2.matchAll(REFERENCE)].map((match) => match[1] ?? ""))].filter(
61872
+ (name3) => name3 !== ""
61873
+ );
61874
+ }
61875
+ function vaultReferenceConnectionName({ name: name3 }) {
61876
+ return name3.split(".")[0] ?? name3;
61877
+ }
61854
61878
 
61855
61879
  // ../../modules/vault/contract/src/vault-pending.ts
61856
61880
  var connectionName2 = external_exports.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/);
@@ -62149,6 +62173,72 @@ var vaultAwsSessionSchemaDefinition = external_exports.object({
62149
62173
  expiration: external_exports.iso.datetime({ offset: true })
62150
62174
  });
62151
62175
 
62176
+ // ../../modules/vault/contract/src/vault-placeholders.ts
62177
+ var PLACEHOLDER = /\{\{\s*vault:[^}]*\}\}/;
62178
+ function unusableFieldProblems({
62179
+ fields
62180
+ }) {
62181
+ return Object.entries(fields).flatMap(([field, value]) => {
62182
+ if (PLACEHOLDER.test(value)) return [`${field} holds a vault placeholder, not a value`];
62183
+ return [];
62184
+ });
62185
+ }
62186
+ function referenceParts(name3) {
62187
+ const dot = name3.indexOf(".");
62188
+ if (dot === -1) return { connection: name3, field: null };
62189
+ return { connection: name3.slice(0, dot), field: name3.slice(dot + 1) };
62190
+ }
62191
+ function commandReferenceNames({ command }) {
62192
+ return [...new Set(command.flatMap((word3) => vaultReferenceNames({ text: word3 })))];
62193
+ }
62194
+ function referenceValue({
62195
+ name: name3,
62196
+ released
62197
+ }) {
62198
+ const { connection, field } = referenceParts(name3);
62199
+ const fields = released.get(connection);
62200
+ if (!fields) {
62201
+ return {
62202
+ refusal: `{{vault:${name3}}} names ${connection}, which this run does not release`
62203
+ };
62204
+ }
62205
+ const names = Object.keys(fields).toSorted();
62206
+ if (field !== null) {
62207
+ const value = fields[field];
62208
+ if (value === void 0) {
62209
+ return { refusal: `${connection} has no field ${field}; its fields are ${names.join(", ")}` };
62210
+ }
62211
+ return { value };
62212
+ }
62213
+ const only = names.length === 1 ? fields[names[0] ?? ""] : void 0;
62214
+ if (only === void 0) {
62215
+ return {
62216
+ refusal: `{{vault:${connection}}} holds ${names.length} values (${names.join(", ")}); write {{vault:${connection}.FIELD}} or read $FIELD from the environment`
62217
+ };
62218
+ }
62219
+ return { value: only };
62220
+ }
62221
+ function fillCommandReferences({
62222
+ command,
62223
+ released
62224
+ }) {
62225
+ const values = /* @__PURE__ */ new Map();
62226
+ for (const name3 of commandReferenceNames({ command })) {
62227
+ const filled = referenceValue({ name: name3, released });
62228
+ if ("refusal" in filled) return filled;
62229
+ values.set(name3, filled.value);
62230
+ }
62231
+ if (values.size === 0) return { command: [...command] };
62232
+ return {
62233
+ command: command.map(
62234
+ (word3) => word3.replace(
62235
+ /\{\{vault:([A-Za-z0-9_][A-Za-z0-9_./:-]*)\}\}/g,
62236
+ (whole, name3) => values.get(name3) ?? whole
62237
+ )
62238
+ )
62239
+ };
62240
+ }
62241
+
62152
62242
  // ../../modules/agent/contract/src/agent-access.ts
62153
62243
  var idSchema5 = external_exports.string().min(1).max(80);
62154
62244
  var agentGranteeSchemaDefinition = external_exports.discriminatedUnion("kind", [
@@ -63570,7 +63660,9 @@ var agentFaceSchemaDefinition = external_exports.object({
63570
63660
  /** A short-lived link to its picture; null for a sloth. */
63571
63661
  imageUrl: external_exports.string().nullable(),
63572
63662
  /** Deleted for good: its old messages show a grey sloth. */
63573
- gone: external_exports.boolean().default(false)
63663
+ gone: external_exports.boolean().default(false),
63664
+ /** How it runs and whose it is, "Laze models · Ada": tells agents sharing a name apart. */
63665
+ detail: external_exports.string().default("")
63574
63666
  });
63575
63667
  var agentFaceSchema = agentFaceSchemaDefinition;
63576
63668
  var agentPresenceSchemaDefinition = external_exports.object({
@@ -76079,7 +76171,7 @@ var appUnpublish = async ({ context, args }) => {
76079
76171
  context,
76080
76172
  args,
76081
76173
  value: app2,
76082
- text: `${app2.name} is not published. Its records stay; laze app publish brings it back.
76174
+ text: `${app2.name} is offline. Its data and versions stay; laze app publish brings it back.
76083
76175
  `
76084
76176
  });
76085
76177
  };
@@ -80905,9 +80997,47 @@ async function vaultRun({
80905
80997
  if (!connection || args.rest.length === 0) throw new CliUsageError(USAGE8);
80906
80998
  if (!reason) throw new CliUsageError(`Say why with --reason "<one plain sentence>"
80907
80999
  ${USAGE8}`);
81000
+ const foreign = commandReferenceNames({ command: args.rest }).find(
81001
+ (name3) => vaultReferenceConnectionName({ name: name3 }) !== connection
81002
+ );
81003
+ if (foreign !== void 0) {
81004
+ const named = vaultReferenceConnectionName({ name: foreign });
81005
+ context.err(
81006
+ `laze vault: the command names {{vault:${foreign}}}, but this run releases only ${connection}, not ${named}. Nothing was asked and the command did not run.
81007
+ `
81008
+ );
81009
+ return 1;
81010
+ }
80908
81011
  const released = await vaultRelease({ context, args, connection, reason, command: args.rest });
80909
81012
  if ("exitCode" in released) return released.exitCode;
80910
- return context.runCommand({ command: args.rest, env: released.env });
81013
+ const prepared = preparedCommand({
81014
+ command: args.rest,
81015
+ released: /* @__PURE__ */ new Map([[connection, released.env]])
81016
+ });
81017
+ if ("refusal" in prepared) {
81018
+ context.err(`${prepared.refusal}
81019
+ `);
81020
+ return 1;
81021
+ }
81022
+ return context.runCommand({ command: prepared.command, env: released.env });
81023
+ }
81024
+ function preparedCommand({
81025
+ command,
81026
+ released
81027
+ }) {
81028
+ for (const [name3, fields] of released) {
81029
+ const [problem] = unusableFieldProblems({ fields });
81030
+ if (problem !== void 0) {
81031
+ return {
81032
+ refusal: `laze vault: ${name3}: ${problem}, so the command did not run. Ask its owner to save the real value on the vault page.`
81033
+ };
81034
+ }
81035
+ }
81036
+ const filled = fillCommandReferences({ command, released });
81037
+ if ("refusal" in filled) {
81038
+ return { refusal: `laze vault: ${filled.refusal}. The command did not run.` };
81039
+ }
81040
+ return filled;
80911
81041
  }
80912
81042
 
80913
81043
  // src/services/vault-share-commands.service.ts
@@ -86140,7 +86270,7 @@ import { dirname as dirname22, join as join24, resolve as resolve15 } from "node
86140
86270
  // src/rules/vault-manifest.rules.ts
86141
86271
  var VARIABLE = /^[A-Za-z_][A-Za-z0-9_]*$/;
86142
86272
  var CONNECTION = /^[a-z0-9][a-z0-9-]{0,62}$/;
86143
- var REFERENCE = /^\{\{vault:([A-Za-z0-9][A-Za-z0-9_/-]{0,127})\}\}$/;
86273
+ var REFERENCE2 = /^\{\{vault:([A-Za-z0-9][A-Za-z0-9_/-]{0,127})\}\}$/;
86144
86274
  function refOf(name3) {
86145
86275
  return name3.split("/").at(-1) ?? name3;
86146
86276
  }
@@ -86165,7 +86295,7 @@ function lineOf4({ line, where }) {
86165
86295
  if (!VARIABLE.test(variable)) {
86166
86296
  throw new CliUsageError(`${where}: not a variable name: ${variable}`);
86167
86297
  }
86168
- const reference = REFERENCE.exec(value);
86298
+ const reference = REFERENCE2.exec(value);
86169
86299
  if (reference?.[1]) return { kind: "reference", variable, ref: refOf(reference[1]) };
86170
86300
  return { kind: "plain", variable, value: unquoted(value) };
86171
86301
  }
@@ -86523,6 +86653,23 @@ function wrappedCommandOf(args) {
86523
86653
  if (!encoded) return ["(shell)"];
86524
86654
  return [Buffer.from(encoded, "base64").toString("utf8").slice(0, 2e3)];
86525
86655
  }
86656
+ async function releasedKeys({
86657
+ context,
86658
+ args,
86659
+ refs,
86660
+ reason,
86661
+ command
86662
+ }) {
86663
+ const byConnection = /* @__PURE__ */ new Map();
86664
+ if (refs.length === 0) return { released: /* @__PURE__ */ new Map(), byConnection };
86665
+ const outcome = await releaseBatch({ context, args, refs, reason, command: [...command] });
86666
+ if ("exitCode" in outcome) return outcome;
86667
+ for (const entry of outcome.entries) {
86668
+ const fields = outcome.released.get(entry.ref)?.fields;
86669
+ if (entry.connection && fields) byConnection.set(entry.connection.name, fields);
86670
+ }
86671
+ return { released: outcome.released, byConnection };
86672
+ }
86526
86673
  async function vaultEnv2({
86527
86674
  context,
86528
86675
  args: given
@@ -86549,12 +86696,20 @@ ${ENV_USAGE}`);
86549
86696
  const badReason = refusedReason({ context, reason });
86550
86697
  if (badReason !== null) return badReason;
86551
86698
  const refs = refsOf(lines2);
86552
- let released = /* @__PURE__ */ new Map();
86553
- if (refs.length > 0) {
86554
- const command = shell ? wrappedCommandOf(args) : args.rest;
86555
- const outcome = await releaseBatch({ context, args, refs, reason, command });
86556
- if ("exitCode" in outcome) return outcome.exitCode;
86557
- released = outcome.released;
86699
+ const outcome = await releasedKeys({
86700
+ context,
86701
+ args,
86702
+ refs,
86703
+ reason,
86704
+ command: shell ? wrappedCommandOf(args) : args.rest
86705
+ });
86706
+ if ("exitCode" in outcome) return outcome.exitCode;
86707
+ const { released, byConnection } = outcome;
86708
+ const prepared = preparedCommand({ command: shell ? [] : args.rest, released: byConnection });
86709
+ if ("refusal" in prepared) {
86710
+ context.err(`${prepared.refusal}
86711
+ `);
86712
+ return 1;
86558
86713
  }
86559
86714
  const env = environmentOf({ lines: lines2, released });
86560
86715
  if (shell) {
@@ -86563,7 +86718,7 @@ ${ENV_USAGE}`);
86563
86718
  return 0;
86564
86719
  }
86565
86720
  const redact = [...released.values()].flatMap(({ fields }) => Object.values(fields));
86566
- return context.runCommand({ command: args.rest, env, redact });
86721
+ return context.runCommand({ command: prepared.command, env, redact });
86567
86722
  }
86568
86723
  async function vaultAws({
86569
86724
  context,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazehq/cli",
3
- "version": "0.1.46",
3
+ "version": "0.1.48",
4
4
  "description": "The Laze command line: sign in, read and post in chat, and connect your own Claude Code or Codex session as an agent.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",