@lazehq/cli 0.1.122 → 0.1.124

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 +131 -10
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -36960,7 +36960,7 @@ function shadowedLinkLineOf({ shadow }) {
36960
36960
  }
36961
36961
 
36962
36962
  // src/rules/cli-version.rules.ts
36963
- var STAMPED = "0.1.122";
36963
+ var STAMPED = "0.1.124";
36964
36964
  function cliVersionOf({ stamped = STAMPED } = {}) {
36965
36965
  return stamped.startsWith("__") ? "dev" : stamped;
36966
36966
  }
@@ -60317,6 +60317,12 @@ function connectionNameForField(field) {
60317
60317
  const name3 = field.toLowerCase().replaceAll(/[^a-z0-9]+/g, "-").replaceAll(/^-+|-+$/g, "").slice(0, 63).replace(/-+$/, "");
60318
60318
  return name3 === "" ? "secret" : name3;
60319
60319
  }
60320
+ function typedVaultName(raw) {
60321
+ return raw.toLowerCase().replaceAll(/[\s_]+/g, "-").replaceAll(/[^a-z0-9-]/g, "").replaceAll(/-{2,}/g, "-").replace(/^-+/, "").slice(0, 63);
60322
+ }
60323
+ function finishedVaultName(raw) {
60324
+ return typedVaultName(raw).replace(/-+$/, "");
60325
+ }
60320
60326
  var VaultSecretOfferSlot = uiTokens("vault").component("secretOffer");
60321
60327
 
60322
60328
  // ../../modules/vault/contract/src/vault-reason.ts
@@ -62470,6 +62476,31 @@ var vaultOpsConnectionsSchemaDefinition = external_exports.object({
62470
62476
  events: external_exports.array(vaultOpsConnectionEventSchema)
62471
62477
  });
62472
62478
 
62479
+ // ../../modules/vault/contract/src/vault-offer.ts
62480
+ var VAULT_OFFER_MAX_VALUE = 16384;
62481
+ var offerName = external_exports.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/);
62482
+ var offerField = external_exports.string().regex(/^[A-Z_][A-Z0-9_]{0,99}$/);
62483
+ var offerVaultSecretInputSchemaDefinition = external_exports.object({
62484
+ workspaceId: external_exports.string().min(1),
62485
+ agentId: external_exports.string().min(1),
62486
+ name: offerName,
62487
+ field: offerField,
62488
+ value: external_exports.string().min(1).max(VAULT_OFFER_MAX_VALUE),
62489
+ reason: external_exports.string().trim().min(1).max(500),
62490
+ /** The level it is saved at: Always ask unless the agent proposes another for the owner. */
62491
+ sensitivity: vaultSensitivitySchema.default("ask"),
62492
+ /** A teammate the owner may share it with once saved; the share still waits for a passkey. */
62493
+ shareWithUserId: external_exports.string().min(1).nullable().default(null)
62494
+ });
62495
+ var offerVaultSecretInputSchema = offerVaultSecretInputSchemaDefinition;
62496
+ var vaultSecretOfferedSchemaDefinition = external_exports.object({
62497
+ requestId: external_exports.string().min(1),
62498
+ name: offerName,
62499
+ ownerUserId: external_exports.string().min(1),
62500
+ ownerName: external_exports.string(),
62501
+ state: external_exports.enum(["pending", "denied", "expired"])
62502
+ });
62503
+
62473
62504
  // ../../modules/chat/contract/src/chat.close.ts
62474
62505
  var conversationOpenDaysSchemaDefinition = external_exports.union([external_exports.literal(7), external_exports.literal(14), external_exports.literal(30), external_exports.literal(90)]).nullable();
62475
62506
  var conversationOpenDaysSchema = conversationOpenDaysSchemaDefinition;
@@ -65408,6 +65439,8 @@ var feedNoticeSchema = external_exports.object({
65408
65439
  eventId: external_exports.string().min(1).max(200).optional(),
65409
65440
  /** Which setting turns it off; none means it always pushes. */
65410
65441
  pushKind: feedPushKindSchema.optional(),
65442
+ /** Worth a phone push only now: a person active in a Laze window gets none, not a later one. */
65443
+ dropWhileActive: external_exports.boolean().optional(),
65411
65444
  /** The person's Notifications count, from chat: the iPhone's icon badge shows it. */
65412
65445
  badge: external_exports.number().int().nonnegative().optional()
65413
65446
  });
@@ -71809,6 +71842,12 @@ var agentVaultReleaseStatusInputSchemaDefinition = external_exports.object({
71809
71842
  requestId: external_exports.string().min(1).max(64),
71810
71843
  channelId: external_exports.string().min(1).max(80).nullable().default(null)
71811
71844
  });
71845
+ var {
71846
+ workspaceId: _offerWorkspaceId,
71847
+ agentId: _offerAgentId,
71848
+ ...offerShape
71849
+ } = offerVaultSecretInputSchema.shape;
71850
+ var agentVaultOfferInputSchemaDefinition = external_exports.object(offerShape);
71812
71851
  var CODEX_LOGIN_MAX_LENGTH = 64 * 1024;
71813
71852
  var codexLoginRefreshInputSchemaDefinition = external_exports.object({
71814
71853
  authJson: external_exports.string().min(2).max(CODEX_LOGIN_MAX_LENGTH)
@@ -76175,7 +76214,7 @@ async function saveOne({
76175
76214
  }) {
76176
76215
  const ask = context.ask;
76177
76216
  for (; ; ) {
76178
- const typed = ask ? (await ask(`Name for ${secret.field} [${secret.suggested}]: `)).trim() : "";
76217
+ const typed = ask ? finishedVaultName(await ask(`Name for ${secret.field} [${secret.suggested}]: `)) : "";
76179
76218
  const name3 = typed || secret.suggested;
76180
76219
  const body = { name: name3, suggested: !typed, field: secret.field, value: secret.value, keychain: keychain2 };
76181
76220
  let saved3 = await client.post("/api/vault/pasted-secrets", body);
@@ -79323,10 +79362,12 @@ The \`laze\` command line is how you act there. Run \`laze --help\` for every co
79323
79362
  ## Work through subagents
79324
79363
 
79325
79364
  You are a long-lived agent: keep this session's context sharp. You are the brain: plan, decide
79326
- and talk to people here. Hand heavy work to subagents: reading many files, searching code or
79327
- chat history, scanning logs, coding and anything with long tool output. In Claude Code use the
79328
- Agent (Task) tool; in Codex start a subagent when it offers one. Ask each for a short summary
79329
- with the paths, ids and numbers you need. Never dump a big file, a log or a long command output
79365
+ and talk to people here. Hand the work itself to subagents: writing and rewriting drafts,
79366
+ review and check rounds, reading many files, searching code or chat history, scanning logs,
79367
+ coding and anything with long tool output. A subagent starts knowing nothing, so brief it with
79368
+ the ask, the rules and the files it needs. In Claude Code use the Agent (Task) tool; in Codex
79369
+ start a subagent when it offers one. Ask each for a short summary with the paths, ids and
79370
+ numbers you need. Never dump a big file, a log or a long command output
79330
79371
  into this session: read only the lines you need (\`grep\`, \`head\`, \`tail\`, \`wc\`).
79331
79372
 
79332
79373
  ## Messages that reach you
@@ -93722,7 +93763,10 @@ var listDevices = async ({ context, args }) => {
93722
93763
  // src/services/vault-share-commands.service.ts
93723
93764
  var SHARE_USAGE2 = "Usage: laze vault share <connection> --with <email|userId> [--for 1h]";
93724
93765
  var WAITING_LINE = "It waits for the owner's approval with a passkey or Face ID, in Settings > Vault.";
93725
- async function personOf({ client, who }) {
93766
+ async function personOf({
93767
+ client,
93768
+ who
93769
+ }) {
93726
93770
  const members3 = await client.get("/api/workspaces/current/members");
93727
93771
  const wanted = who.toLowerCase();
93728
93772
  const found = members3.find(
@@ -93888,7 +93932,7 @@ var list4 = async ({ context, args }) => {
93888
93932
  for (const row of rows) printConnection({ context, row });
93889
93933
  };
93890
93934
  var add4 = async ({ context, args }) => {
93891
- const name3 = args.words[2];
93935
+ const name3 = finishedVaultName(args.words[2] ?? "");
93892
93936
  const label3 = flagText({ args, name: "label" });
93893
93937
  if (!name3 || !label3) throw new CliUsageError(VAULT_USAGE);
93894
93938
  const secret = bundleOf({
@@ -99828,6 +99872,7 @@ var MCP_REFUSED_COMMANDS = /* @__PURE__ */ new Set([
99828
99872
  "vault replace",
99829
99873
  "vault compare",
99830
99874
  "vault save-from-message",
99875
+ "vault offer",
99831
99876
  "connect mcp-key",
99832
99877
  "connect card-key",
99833
99878
  "langwatch set-key"
@@ -99839,6 +99884,7 @@ var MCP_SECRET_COMMANDS = {
99839
99884
  "vault add": { instead: "vault save" },
99840
99885
  "vault replace": {},
99841
99886
  "vault compare": {},
99887
+ "vault offer": {},
99842
99888
  "langwatch set-key": {},
99843
99889
  "keys create": { vaultFlag: "to-vault" },
99844
99890
  "scim create-token": { vaultFlag: "to-vault" },
@@ -101886,6 +101932,16 @@ var sessionSpanDefinition = external_exports.object({
101886
101932
  path: external_exports.string().nullable()
101887
101933
  });
101888
101934
  var sessionSpanSchema = sessionSpanDefinition;
101935
+ var tracedServiceSchema = external_exports.string().regex(/^[a-z][a-z0-9.-]{0,63}$/, "a service name: lower case letters, digits, dots and dashes");
101936
+ var serviceTraceDefinition = external_exports.object({
101937
+ at: at6,
101938
+ durationMs: external_exports.number().nonnegative(),
101939
+ traceId: external_exports.string(),
101940
+ /** The trace's root span name and service, as Tempo summarises it; null when no root arrived. */
101941
+ rootName: external_exports.string().nullable(),
101942
+ rootService: external_exports.string().nullable()
101943
+ });
101944
+ var serviceTraceSchema = serviceTraceDefinition;
101889
101945
 
101890
101946
  // ../../modules/rum/contract/src/rum.api.ts
101891
101947
  var RumApi = moduleApi()("rum");
@@ -102459,6 +102515,14 @@ var sessionSpansInputDefinition = external_exports.object({
102459
102515
  cursor: cursorDefinition.optional()
102460
102516
  }).strict();
102461
102517
  var sessionSpansOutputDefinition = external_exports.object({ spans: pageOf(sessionSpanSchema) });
102518
+ var serviceTracesInputDefinition = external_exports.object({
102519
+ from: external_exports.iso.datetime(),
102520
+ to: external_exports.iso.datetime(),
102521
+ service: tracedServiceSchema,
102522
+ limit: external_exports.number().int().min(1).max(500).default(100),
102523
+ cursor: cursorDefinition.optional()
102524
+ }).strict();
102525
+ var serviceTracesOutputDefinition = external_exports.object({ traces: pageOf(serviceTraceSchema) });
102462
102526
  var entry = (value) => value;
102463
102527
  var OPS_FUNCTIONS = {
102464
102528
  "workspaces.find": entry({
@@ -102680,6 +102744,13 @@ var OPS_FUNCTIONS = {
102680
102744
  input: sessionSpansInputDefinition,
102681
102745
  output: sessionSpansOutputDefinition
102682
102746
  }),
102747
+ "traces.service_traces": entry({
102748
+ title: "The traces one service sent over a range: trace ids, root span names and times",
102749
+ scope: "platform",
102750
+ view: "table",
102751
+ input: serviceTracesInputDefinition,
102752
+ output: serviceTracesOutputDefinition
102753
+ }),
102683
102754
  "tenant.snapshot": entry({
102684
102755
  title: "One workspace's plan, members, agents and flags, as counts",
102685
102756
  scope: "tenant",
@@ -104840,6 +104911,53 @@ ${EXEC_PROVIDER_USAGE}`);
104840
104911
  return 0;
104841
104912
  }
104842
104913
 
104914
+ // src/services/vault-offer-commands.service.ts
104915
+ var OFFER_USAGE = `Usage: laze vault offer <name> --field <FIELD> --reason "<why>" [--level allow|auto|always-ask] [--share-with <email|userId>] < value-file
104916
+ Offers a key you made (a token, a webhook secret) to your owner's vault, the value on stdin.
104917
+ Your owner gets a card; only their Allow saves it, at Always ask unless you propose a level.
104918
+ --share-with proposes a share for a key at Allow or Auto; it still waits for their passkey.
104919
+ The value is never printed back. MCP cannot send stdin.`;
104920
+ var NO_VALUE_FLAG = "laze vault offer reads the value from stdin only; a --value flag would leave it in your shell history.";
104921
+ async function vaultOffer({ context, args }) {
104922
+ if (args.flags.value !== void 0) throw new CliUsageError(NO_VALUE_FLAG);
104923
+ const name3 = (args.words[2] ?? "").trim();
104924
+ const field = flagText({ args, name: "field" });
104925
+ const reason2 = flagText({ args, name: "reason" });
104926
+ if (!name3 || !field || !reason2) throw new CliUsageError(OFFER_USAGE);
104927
+ const sensitivity2 = levelOf2(args);
104928
+ const shareWith2 = flagText({ args, name: "share-with" });
104929
+ const value = (await context.readStdin()).trim();
104930
+ if (!value) throw new CliUsageError(OFFER_USAGE);
104931
+ const { client, profile } = await signedIn({ context, args });
104932
+ if (profile.kind !== "agent") {
104933
+ throw new CliUsageError(
104934
+ "laze vault offer is for agents; a person adds a key with laze vault add."
104935
+ );
104936
+ }
104937
+ const shareWithUserId = shareWith2 ? await personOf({ client, who: shareWith2 }) : null;
104938
+ const offered = await client.post("/api/agents/me/vault/offer", {
104939
+ name: name3,
104940
+ field,
104941
+ value,
104942
+ reason: reason2,
104943
+ ...sensitivity2 && { sensitivity: sensitivity2 },
104944
+ shareWithUserId
104945
+ });
104946
+ if (args.flags.json) return context.out(`${JSON.stringify(offered, null, 2)}
104947
+ `);
104948
+ context.out(`${offerLineOf(offered)}
104949
+ `);
104950
+ }
104951
+ function offerLineOf(offered) {
104952
+ const owner = offered.ownerName || "your owner";
104953
+ if (offered.state === "denied") {
104954
+ return `${owner} said no to ${offered.name} a moment ago, or already holds it. Nothing was saved.`;
104955
+ }
104956
+ if (offered.state === "expired")
104957
+ return `The card for ${offered.name} expired. Nothing was saved.`;
104958
+ return `Offered ${offered.name} to ${owner}; it waits for their Allow on the card. Delete your copy of the value now and don't repeat it in chat. Once saved, laze vault list shows it and laze vault run ${offered.name} -- <cmd> uses it.`;
104959
+ }
104960
+
104843
104961
  // src/services/vault-save-message-commands.service.ts
104844
104962
  var SAVE_USAGE = `Usage: laze vault save <pending> --name <name> --description "<what it is for>"
104845
104963
  Names a key Laze held from a message you received, in the sender's vault.
@@ -104882,7 +105000,7 @@ async function vaultSaveFromMessage({
104882
105000
  args
104883
105001
  }) {
104884
105002
  const messageId = flagText({ args, name: "from-message" });
104885
- const name3 = flagText({ args, name: "name" });
105003
+ const name3 = finishedVaultName(flagText({ args, name: "name" }));
104886
105004
  const description = flagText({ args, name: "description" });
104887
105005
  if (!messageId || !name3 || !description) throw new CliUsageError(SAVE_USAGE);
104888
105006
  const value = (await context.readStdin()).trim();
@@ -104900,7 +105018,7 @@ async function vaultSaveFromMessage({
104900
105018
  async function vaultSave({ context, args }) {
104901
105019
  if (flagText({ args, name: "from-message" })) return vaultSaveFromMessage({ context, args });
104902
105020
  const pending2 = args.words[2];
104903
- const name3 = flagText({ args, name: "name" });
105021
+ const name3 = finishedVaultName(flagText({ args, name: "name" }));
104904
105022
  const description = flagText({ args, name: "description" });
104905
105023
  if (!pending2 || !name3 || !description) throw new CliUsageError(SAVE_USAGE);
104906
105024
  const saved3 = await postInTurn({
@@ -106250,6 +106368,8 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
106250
106368
  laze vault save <pending> --name <name> --description "<text>" name a key Laze held from a message (agents)
106251
106369
  laze vault save --from-message <id> --name <name> --description "<text>" save a key a person sent,
106252
106370
  read from stdin, to their own vault; the message keeps {{vault:<name>}} (agents, no vault access)
106371
+ laze vault offer <name> --field <FIELD> --reason "<why>" < value offer your owner a key you made,
106372
+ the value on stdin; saved only when they allow the card (agents, no vault access)
106253
106373
  laze vault scrub [--dry-run] move secrets found in messages to the vault now (admins)
106254
106374
  laze vault list|add|update|replace|compare|rm|revoke|uses your keychains with your own key
106255
106375
  a value comes from stdin or --from-file, never a flag; no command prints a value
@@ -106440,6 +106560,7 @@ var COMMANDS5 = {
106440
106560
  "vault aws": vaultAws,
106441
106561
  "vault exec-provider": vaultExecProvider,
106442
106562
  "vault save": vaultSave,
106563
+ "vault offer": vaultOffer,
106443
106564
  "vault save-from-message": vaultSaveFromMessage,
106444
106565
  connect,
106445
106566
  slack,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazehq/cli",
3
- "version": "0.1.122",
3
+ "version": "0.1.124",
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",