@lazehq/cli 0.1.142 → 0.1.144

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 +122 -14
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -36984,7 +36984,7 @@ function shadowedLinkLineOf({ shadow }) {
36984
36984
  }
36985
36985
 
36986
36986
  // src/rules/cli-version.rules.ts
36987
- var STAMPED = "0.1.142";
36987
+ var STAMPED = "0.1.144";
36988
36988
  function cliVersionOf({ stamped = STAMPED } = {}) {
36989
36989
  return stamped.startsWith("__") ? "dev" : stamped;
36990
36990
  }
@@ -37563,7 +37563,8 @@ var SWITCHES = /* @__PURE__ */ new Set([
37563
37563
  "ask",
37564
37564
  "real-value",
37565
37565
  "default",
37566
- "set-default"
37566
+ "set-default",
37567
+ "full-access"
37567
37568
  ]);
37568
37569
  function parseArgs({ argv }) {
37569
37570
  const words = [];
@@ -61593,6 +61594,8 @@ var vaultApprovalResolvedPayloadSchemaDefinition = external_exports.object({
61593
61594
  blockedUntil: external_exports.iso.datetime().nullable().default(null),
61594
61595
  /** An expired card closed because the agent's turn that asked ended; nothing is blocked. */
61595
61596
  endedWithTurn: external_exports.boolean().optional(),
61597
+ /** Closed because the key's level now lets the use through; `endedWithTurn` is set too. */
61598
+ keyNowAllows: external_exports.boolean().optional(),
61596
61599
  /** A task card: its Allow covered the rest of the agent's turn. */
61597
61600
  coversTask: external_exports.boolean().optional(),
61598
61601
  /** Settled by another card's Allow for this agent, whose lease now covers this ask too. */
@@ -62602,7 +62605,8 @@ function unusableFieldProblems({
62602
62605
  fields
62603
62606
  }) {
62604
62607
  return Object.entries(fields).flatMap(([field, value]) => {
62605
- if (PLACEHOLDER.test(value)) return [`${field} holds a vault placeholder, not a value`];
62608
+ if (PLACEHOLDER.test(value))
62609
+ return [`${field} holds a reference to a vault key, not the key itself`];
62606
62610
  return [];
62607
62611
  });
62608
62612
  }
@@ -66667,6 +66671,7 @@ var ChatExternalPersonCardSlot = chatUi.extension("external-person-card");
66667
66671
  var ChatNewChannelDialogSlot = chatUi.component("new-channel-dialog");
66668
66672
  var ChatPeoplePickerSlot = chatUi.component("people-picker");
66669
66673
  var ChatActorFaceSlot = chatUi.component("actor-face");
66674
+ var ChatMembersDialogSlot = chatUi.component("members-dialog");
66670
66675
  var ChatAddPeopleDialogSlot = chatUi.component("add-people-dialog");
66671
66676
  var ChatHandoffComposerSlot = chatUi.component("handoff-composer");
66672
66677
  var ChatConversationsWithSlot = chatUi.component("conversations-with");
@@ -67922,7 +67927,9 @@ var agentSandboxSpecSchemaDefinition = external_exports.object({
67922
67927
  /** The agent's turns go to LangWatch: the harness exports OpenTelemetry at this level. */
67923
67928
  telemetry: external_exports.object({ content: external_exports.enum(["full", "metadata"]) }).optional(),
67924
67929
  /** The agent's profile; absent reads as `standard`. */
67925
- profile: sandboxProfileSchema.optional()
67930
+ profile: sandboxProfileSchema.optional(),
67931
+ /** Claude Code in a workspace with the staff flag claude_code_mode: it asks for Code Mode. */
67932
+ codeMode: external_exports.boolean().optional()
67926
67933
  });
67927
67934
  var deliveredFileSchemaDefinition = external_exports.object({
67928
67935
  /** Relative to the agent's work folder, e.g. `attachments/<messageId>/report.pdf`. */
@@ -68166,6 +68173,8 @@ var supervisorLaunchSchemaDefinition = external_exports.object({
68166
68173
  machine: supervisorMachineSchemaDefinition.optional(),
68167
68174
  /** On a machine, by relay connection id: the placeholder a local caller must present. */
68168
68175
  relayPlaceholders: external_exports.record(external_exports.string().regex(/^[A-Za-z0-9_-]+$/), external_exports.string().min(1)).default({}),
68176
+ /** The workspace asks for Claude Code's Code Mode (staff flag claude_code_mode). */
68177
+ codeMode: external_exports.boolean().optional(),
68169
68178
  /** Set by the computer daemon: this supervisor's own ports inside the workspace's computer. */
68170
68179
  computer: external_exports.object({
68171
68180
  port: external_exports.number().int().min(1).max(65535),
@@ -68173,7 +68182,9 @@ var supervisorLaunchSchemaDefinition = external_exports.object({
68173
68182
  /** The updated Claude Code's bin directory, first on the harness PATH (else the image's). */
68174
68183
  claudeCodeBin: external_exports.string().min(1).max(4096).optional(),
68175
68184
  /** The updated Codex CLI's bin directory, first on the harness PATH (else the image's). */
68176
- codexBin: external_exports.string().min(1).max(4096).optional()
68185
+ codexBin: external_exports.string().min(1).max(4096).optional(),
68186
+ /** The launch asked for Code Mode and the Claude Code on the harness PATH is patched. */
68187
+ codeMode: external_exports.boolean().optional()
68177
68188
  }).optional()
68178
68189
  });
68179
68190
  var ATTENTION_DISMISS_NOTE_MAX = 32e3;
@@ -68400,7 +68411,9 @@ var computerDaemonUseSchemaDefinition = computerUseSchema.omit({ state: true, la
68400
68411
  /** The Claude Code agents run (the update in use, else the image's) and the last check. */
68401
68412
  claudeCode: external_exports.object({
68402
68413
  version: external_exports.string().max(40).nullable(),
68403
- checkedAt: external_exports.string().max(40).nullable()
68414
+ checkedAt: external_exports.string().max(40).nullable(),
68415
+ /** A release the Code Mode patch or its REPL check refused since the daemon started. */
68416
+ codeModeRefused: external_exports.string().max(40).optional()
68404
68417
  }).optional(),
68405
68418
  /** The Codex CLI agents run (the update in use, else the image's) and the last check. */
68406
68419
  codex: external_exports.object({
@@ -72800,7 +72813,7 @@ var AgentRunsOnPickerSlot = agentUi.component("runsOnPicker");
72800
72813
  var AgentEditDialogSlot = agentUi.component("editDialog");
72801
72814
  var AgentNameSlot = agentUi.component("name");
72802
72815
  var AgentFaceSlot = agentUi.component("face");
72803
- var AgentAccessSlot = agentUi.component("access");
72816
+ var AgentChatMembersHooksToken = agentUi.hooks("chatMembers");
72804
72817
  var AgentConnectDialogSlot = agentUi.component("connectDialog");
72805
72818
  var AgentConnectWaitSlot = agentUi.component("connectWait");
72806
72819
  var AgentConnectWaitRowSlot = agentUi.component("connectWaitRow");
@@ -75595,6 +75608,8 @@ var slackConnectionViewSchemaDefinition = external_exports.object({
75595
75608
  viewerLinkState: slackLinkStateSchema.nullable().default(null),
75596
75609
  /** The scope Slack said the viewer's link lacks, for `missing_scope`. */
75597
75610
  viewerMissingScope: external_exports.string().nullable().default(null),
75611
+ /** Bot scopes Laze asks that this install lacks; installing the app again grants them. */
75612
+ missingBotScopes: external_exports.array(external_exports.string()).default([]),
75598
75613
  linkedPeople: external_exports.number().int().nonnegative()
75599
75614
  });
75600
75615
  var slackConnectionViewSchema = slackConnectionViewSchemaDefinition;
@@ -75856,6 +75871,22 @@ var slackOwnerPostedSchemaDefinition = external_exports.object({
75856
75871
  channelId: external_exports.string()
75857
75872
  });
75858
75873
 
75874
+ // ../../modules/slack/contract/src/slack-connect-invite.ts
75875
+ var SLACK_CONNECT_INVITE_PATH = "/api/slack/connect-invite";
75876
+ var slackConnectInviteInputSchemaDefinition = external_exports.object({
75877
+ /** The mirrored conversation's Laze id, or the Slack channel id it mirrors. */
75878
+ channelId: external_exports.string().trim().min(1).max(200),
75879
+ /** Who to invite: Slack sends them an email with a link to join. */
75880
+ email: external_exports.email().max(320),
75881
+ /** True lets them only post; false lets them also invite others and manage the channel. */
75882
+ externalLimited: external_exports.boolean().default(true)
75883
+ });
75884
+ var slackConnectInvitedSchemaDefinition = external_exports.object({
75885
+ inviteId: external_exports.string(),
75886
+ channelId: external_exports.string(),
75887
+ email: external_exports.string()
75888
+ });
75889
+
75859
75890
  // ../../modules/slack/contract/src/slack.config.ts
75860
75891
  var positiveInt4 = external_exports.coerce.number().int().positive();
75861
75892
  var slackConfig = Config.define((c) => ({
@@ -75943,7 +75974,7 @@ function hasSettingIn({ channel }) {
75943
75974
  }
75944
75975
  function placeOf({ channel }) {
75945
75976
  if (channel.kind === "public" || channel.kind === "private") return `#${channel.name}`;
75946
- const what = channel.kind === "chat" ? "conversation" : "group DM";
75977
+ const what = { chat: "conversation", group: "group DM", dm: "agent chat" }[channel.kind];
75947
75978
  return channel.name ? `${what} ${channel.name} (${channel.id})` : `${what} ${channel.id}`;
75948
75979
  }
75949
75980
  function settingRowOf({ channel }) {
@@ -80511,6 +80542,8 @@ them that link, never only where to find it ("a card in your feed").
80511
80542
  see it. Never ask for a Slack token. \`laze slack post <channelId> "text"\` (\`--thread <id>\`
80512
80543
  to reply) posts there as them, from their own Slack account, in a turn they started; it can
80513
80544
  wait for their OK. Post as them only a message they told you to send.
80545
+ \`laze slack connect-invite <channelId> <email>\` sends a Slack Connect invite to someone at
80546
+ another company, from a Slack channel they are in; they always OK it on a card first.
80514
80547
  - \`laze channels list\` lists the conversations you are in.
80515
80548
  - \`laze conversation new <agent> "text"\` starts a conversation for your person, with you in
80516
80549
  it and your text posted as you; \`laze conversation add <id> <member>\` adds workspace members
@@ -86230,6 +86263,65 @@ async function handedOut({
86230
86263
  );
86231
86264
  }
86232
86265
 
86266
+ // src/services/vault-requester.service.ts
86267
+ var HARNESS_NAMES4 = { "claude-code": "Claude Code", codex: "Codex" };
86268
+ function usableAgents({ config: config2 }) {
86269
+ return Object.keys(config2.profiles).filter((name3) => {
86270
+ const profile = config2.profiles[name3];
86271
+ return profile?.kind === "agent" && !profile.migrated;
86272
+ });
86273
+ }
86274
+ function labelOf({ name: name3, profile }) {
86275
+ return `"${profile?.name ?? name3}" (profile ${name3})`;
86276
+ }
86277
+ function vaultRequesterOf({
86278
+ config: config2,
86279
+ named,
86280
+ namedBy,
86281
+ sessionAgent,
86282
+ harness,
86283
+ cwd
86284
+ }) {
86285
+ if (sessionAgent) {
86286
+ const other = named ? config2.profiles[named] : void 0;
86287
+ if (!named || named === sessionAgent || other?.kind !== "agent") return {};
86288
+ const session = labelOf({ name: sessionAgent, profile: config2.profiles[sessionAgent] });
86289
+ const asked = labelOf({ name: named, profile: other });
86290
+ return {
86291
+ profile: sessionAgent,
86292
+ note: `laze vault: this session is bound to the agent ${session}, so it asks as that agent, not as ${asked} from ${namedBy}.
86293
+ `
86294
+ };
86295
+ }
86296
+ if (named || harness === "other" || folderLoginOf({ config: config2, cwd })) return {};
86297
+ const fallback = config2.current ? config2.profiles[config2.current] : void 0;
86298
+ const agents2 = usableAgents({ config: config2 });
86299
+ if (fallback?.kind !== "agent" || agents2.length < 2) return {};
86300
+ const example = agents2.find((name3) => name3 !== "machine") ?? agents2[0] ?? "<profile>";
86301
+ throw new CliUsageError(
86302
+ `laze vault: Laze can't tell which agent is asking: this ${HARNESS_NAMES4[harness]} session is not bound to a Laze agent and this machine holds ${agents2.length}. Nothing was asked and the command did not run. Bind the session once with \`laze agent bind --profile <profile>\` (for example \`laze agent bind --profile ${example}\`), or pass \`--profile <profile>\` on the command.`
86303
+ );
86304
+ }
86305
+ async function vaultSignedIn({
86306
+ context,
86307
+ args
86308
+ }) {
86309
+ const config2 = await context.store.read();
86310
+ const session = await currentSessionOf({ context, args }).catch(() => void 0);
86311
+ const flag2 = flagText({ args, name: "profile" }) || void 0;
86312
+ const requester = vaultRequesterOf({
86313
+ config: config2,
86314
+ named: flag2 || context.environment.profile,
86315
+ namedBy: flag2 ? "--profile" : "LAZE_PROFILE",
86316
+ sessionAgent: await sessionAgentOf({ context, session }),
86317
+ harness: session ? session.harness : context.environment.harness,
86318
+ cwd: context.cwd
86319
+ });
86320
+ if (requester.note) context.err(requester.note);
86321
+ const asked = requester.profile ? { ...args, flags: { ...args.flags, profile: requester.profile } } : args;
86322
+ return signedIn({ context, args: asked }).catch(() => null);
86323
+ }
86324
+
86233
86325
  // src/services/vault-commands.service.ts
86234
86326
  var USAGE4 = `Usage: laze vault run <connection>... --reason "<one plain sentence>" [--wait <s>] [--real-value] -- <command> [args...]
86235
86327
  Name every key the command needs in one run: they ask on one card. Runs nested in each other
@@ -86520,7 +86612,7 @@ async function keyRelease({
86520
86612
  command,
86521
86613
  deadline
86522
86614
  }) {
86523
- const signed2 = await signedIn({ context, args }).catch(() => null);
86615
+ const signed2 = await vaultSignedIn({ context, args });
86524
86616
  if (signed2?.profile.kind !== "agent" && signed2?.profile.kind !== "person") {
86525
86617
  throw new CliUsageError(`laze vault run ${WHERE}`);
86526
86618
  }
@@ -86603,7 +86695,7 @@ function preparedCommand({
86603
86695
  const [problem] = unusableFieldProblems({ fields });
86604
86696
  if (problem !== void 0) {
86605
86697
  return {
86606
- refusal: `laze vault: ${name3}: ${problem}, so the command did not run. Ask its owner to save the real value on the vault page.`
86698
+ refusal: `laze vault: ${name3}: ${problem}, so the command did not run. Ask its owner to paste the key itself on the vault page.`
86607
86699
  };
86608
86700
  }
86609
86701
  }
@@ -90636,7 +90728,7 @@ async function channelSettings({ context, args }) {
90636
90728
  const shown2 = wanted ? channels3.filter((channel) => channel.id === wanted || channel.name === name3) : channels3;
90637
90729
  if (wanted && shown2.length === 0) {
90638
90730
  throw new CliUsageError(
90639
- `${wanted} has no setting for you: you are not in it, or it is a 1:1 DM, which always reaches you. laze channel settings lists your channels and shared conversations.`
90731
+ `${wanted} has no setting for you: you are not in it, or it is a 1:1 DM or your own chat, which always reach you. laze channel settings lists your channels, shared conversations and agent chats.`
90640
90732
  );
90641
90733
  }
90642
90734
  if (args.flags.json) {
@@ -105875,6 +105967,10 @@ var SLACK_USAGE = `Usage (a person's key; Slack stays the source, the bot joins
105875
105967
  laze slack post <channelId> <text> [--thread <messageId>]
105876
105968
  an agent posts in its owner's Slack mirror as the owner, in a turn the owner started;
105877
105969
  the text from stdin when none is given. Read Slack with laze history, search and thread
105970
+ laze slack connect-invite <channelId> <email> [--full-access]
105971
+ an agent has the Laze bot invite someone from another company to its owner's Slack
105972
+ channel (Slack Connect), in a turn the owner started, once the owner allows it;
105973
+ --full-access lets them also invite others and manage the channel
105878
105974
  laze slack profiles <slack:T:U>... Slack status, title and time zone of authors
105879
105975
  laze slack bookmarks <channelId> a mirrored Slack channel's bookmarks
105880
105976
  laze slack link <teamId> prints the link that links your own Slack
@@ -106027,6 +106123,17 @@ var post2 = async ({ context, args, client }) => {
106027
106123
  context.out(`Posted as your owner: ${posted.messageId} in ${posted.channelId}
106028
106124
  `);
106029
106125
  };
106126
+ var connectInvite = async ({ context, args, client }) => {
106127
+ const email3 = wordAt9(args, 3);
106128
+ const invited = await client.post(SLACK_CONNECT_INVITE_PATH, {
106129
+ channelId: wordAt9(args, 2),
106130
+ email: email3,
106131
+ externalLimited: args.flags["full-access"] !== true
106132
+ });
106133
+ if (json5({ context, args, data: invited })) return;
106134
+ context.out(`Slack Connect invite sent to ${invited.email} (${invited.inviteId})
106135
+ `);
106136
+ };
106030
106137
  var dm = async ({ context, args, client }) => {
106031
106138
  const opened = await client.post(SLACK_KEY_PATHS.direct, {
106032
106139
  teamId: wordAt9(args, 2),
@@ -106196,6 +106303,7 @@ var RUNS6 = {
106196
106303
  bookmarks,
106197
106304
  dm,
106198
106305
  post: post2,
106306
+ "connect-invite": connectInvite,
106199
106307
  link: authorizeRun2(SLACK_KEY_PATHS.link, "Open this link to link your Slack account", teamOf),
106200
106308
  unlink: connectionRun2(SLACK_KEY_PATHS.unlink, teamOf),
106201
106309
  install: authorizeRun2(
@@ -106846,7 +106954,7 @@ async function doorOf({
106846
106954
  })
106847
106955
  };
106848
106956
  }
106849
- const signed2 = await signedIn({ context, args }).catch(() => null);
106957
+ const signed2 = await vaultSignedIn({ context, args });
106850
106958
  if (signed2?.profile.kind !== "agent" && signed2?.profile.kind !== "person") {
106851
106959
  throw new CliUsageError(`laze vault env ${WHERE}`);
106852
106960
  }
@@ -109003,10 +109111,10 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
109003
109111
  laze groups rename <group> <name> | delete <group> rename one, or delete it and take back what it shared (admins)
109004
109112
  laze groups add|remove <group> --person <member>.. change who is in it (admins)
109005
109113
  laze channels list the conversations you are in, with your setting
109006
- laze channel set <channel> everything|mentions what of a channel or shared conversation (3+ members, by id) reaches your agent
109114
+ laze channel set <channel> everything|mentions what of a channel, shared conversation or agent chat (3+ members, by id) reaches your agent
109007
109115
  laze channel mute <channel> --reason "<why>" [--for 30m|2h|1d] stop hearing a noisy channel or conversation unless named (agents)
109008
109116
  laze channel unmute <channel> hear the channel or conversation on your setting again (agents)
109009
- laze channel settings [<channel>] [--json] each channel's and shared conversation's setting and mute; a 1:1 DM always reaches you (agents)
109117
+ laze channel settings [<channel>] [--json] the setting and mute in each channel, shared conversation and agent chat; a 1:1 DM and your own chat always reach you (agents)
109010
109118
  laze monitor add <name> --channel '#x-*' --prompt '<what to do>' [--from anyone|people|slack] [--not-from bots] [--thread roots-only] [--matches '<re>'] a turn on each new matching message (agents)
109011
109119
  laze monitor list | pause | resume | rm <name> [--json] the agent's monitors
109012
109120
  laze channel members <channel> its people and agents, each an Admin or a Member
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazehq/cli",
3
- "version": "0.1.142",
3
+ "version": "0.1.144",
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",