@lazehq/cli 0.1.143 → 0.1.145

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 +110 -5
  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.143";
36987
+ var STAMPED = "0.1.145";
36988
36988
  function cliVersionOf({ stamped = STAMPED } = {}) {
36989
36989
  return stamped.startsWith("__") ? "dev" : stamped;
36990
36990
  }
@@ -75886,6 +75886,22 @@ var slackConnectInvitedSchemaDefinition = external_exports.object({
75886
75886
  channelId: external_exports.string(),
75887
75887
  email: external_exports.string()
75888
75888
  });
75889
+ var SLACK_CONNECT_INVITE_NEW_CHANNEL_PATH = "/api/slack/connect-invite/new-channel";
75890
+ var slackConnectInviteNewChannelInputSchemaDefinition = external_exports.object({
75891
+ /** The new Slack channel's name; a leading `#` is dropped and letters are lowercased. */
75892
+ name: external_exports.string().trim().min(1).max(200),
75893
+ email: external_exports.email().max(320),
75894
+ /** Private by default: only the owner and the bot are in it until someone adds more. */
75895
+ isPrivate: external_exports.boolean().default(true),
75896
+ externalLimited: external_exports.boolean().default(true)
75897
+ });
75898
+ var slackConnectInvitedNewChannelSchemaDefinition = external_exports.object({
75899
+ inviteId: external_exports.string(),
75900
+ channelId: external_exports.string(),
75901
+ slackChannelId: external_exports.string(),
75902
+ name: external_exports.string(),
75903
+ email: external_exports.string()
75904
+ });
75889
75905
 
75890
75906
  // ../../modules/slack/contract/src/slack.config.ts
75891
75907
  var positiveInt4 = external_exports.coerce.number().int().positive();
@@ -80543,7 +80559,9 @@ them that link, never only where to find it ("a card in your feed").
80543
80559
  to reply) posts there as them, from their own Slack account, in a turn they started; it can
80544
80560
  wait for their OK. Post as them only a message they told you to send.
80545
80561
  \`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.
80562
+ another company, from a Slack channel they are in; they always OK it on a card first. For a new
80563
+ lead, \`laze slack connect-invite --new-channel <name> <email>\` does it all in one go: the bot
80564
+ creates the private channel, adds them and sends the invite, after one card.
80547
80565
  - \`laze channels list\` lists the conversations you are in.
80548
80566
  - \`laze conversation new <agent> "text"\` starts a conversation for your person, with you in
80549
80567
  it and your text posted as you; \`laze conversation add <id> <member>\` adds workspace members
@@ -86263,6 +86281,65 @@ async function handedOut({
86263
86281
  );
86264
86282
  }
86265
86283
 
86284
+ // src/services/vault-requester.service.ts
86285
+ var HARNESS_NAMES4 = { "claude-code": "Claude Code", codex: "Codex" };
86286
+ function usableAgents({ config: config2 }) {
86287
+ return Object.keys(config2.profiles).filter((name3) => {
86288
+ const profile = config2.profiles[name3];
86289
+ return profile?.kind === "agent" && !profile.migrated;
86290
+ });
86291
+ }
86292
+ function labelOf({ name: name3, profile }) {
86293
+ return `"${profile?.name ?? name3}" (profile ${name3})`;
86294
+ }
86295
+ function vaultRequesterOf({
86296
+ config: config2,
86297
+ named,
86298
+ namedBy,
86299
+ sessionAgent,
86300
+ harness,
86301
+ cwd
86302
+ }) {
86303
+ if (sessionAgent) {
86304
+ const other = named ? config2.profiles[named] : void 0;
86305
+ if (!named || named === sessionAgent || other?.kind !== "agent") return {};
86306
+ const session = labelOf({ name: sessionAgent, profile: config2.profiles[sessionAgent] });
86307
+ const asked = labelOf({ name: named, profile: other });
86308
+ return {
86309
+ profile: sessionAgent,
86310
+ note: `laze vault: this session is bound to the agent ${session}, so it asks as that agent, not as ${asked} from ${namedBy}.
86311
+ `
86312
+ };
86313
+ }
86314
+ if (named || harness === "other" || folderLoginOf({ config: config2, cwd })) return {};
86315
+ const fallback = config2.current ? config2.profiles[config2.current] : void 0;
86316
+ const agents2 = usableAgents({ config: config2 });
86317
+ if (fallback?.kind !== "agent" || agents2.length < 2) return {};
86318
+ const example = agents2.find((name3) => name3 !== "machine") ?? agents2[0] ?? "<profile>";
86319
+ throw new CliUsageError(
86320
+ `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.`
86321
+ );
86322
+ }
86323
+ async function vaultSignedIn({
86324
+ context,
86325
+ args
86326
+ }) {
86327
+ const config2 = await context.store.read();
86328
+ const session = await currentSessionOf({ context, args }).catch(() => void 0);
86329
+ const flag2 = flagText({ args, name: "profile" }) || void 0;
86330
+ const requester = vaultRequesterOf({
86331
+ config: config2,
86332
+ named: flag2 || context.environment.profile,
86333
+ namedBy: flag2 ? "--profile" : "LAZE_PROFILE",
86334
+ sessionAgent: await sessionAgentOf({ context, session }),
86335
+ harness: session ? session.harness : context.environment.harness,
86336
+ cwd: context.cwd
86337
+ });
86338
+ if (requester.note) context.err(requester.note);
86339
+ const asked = requester.profile ? { ...args, flags: { ...args.flags, profile: requester.profile } } : args;
86340
+ return signedIn({ context, args: asked }).catch(() => null);
86341
+ }
86342
+
86266
86343
  // src/services/vault-commands.service.ts
86267
86344
  var USAGE4 = `Usage: laze vault run <connection>... --reason "<one plain sentence>" [--wait <s>] [--real-value] -- <command> [args...]
86268
86345
  Name every key the command needs in one run: they ask on one card. Runs nested in each other
@@ -86553,7 +86630,7 @@ async function keyRelease({
86553
86630
  command,
86554
86631
  deadline
86555
86632
  }) {
86556
- const signed2 = await signedIn({ context, args }).catch(() => null);
86633
+ const signed2 = await vaultSignedIn({ context, args });
86557
86634
  if (signed2?.profile.kind !== "agent" && signed2?.profile.kind !== "person") {
86558
86635
  throw new CliUsageError(`laze vault run ${WHERE}`);
86559
86636
  }
@@ -105912,6 +105989,9 @@ var SLACK_USAGE = `Usage (a person's key; Slack stays the source, the bot joins
105912
105989
  an agent has the Laze bot invite someone from another company to its owner's Slack
105913
105990
  channel (Slack Connect), in a turn the owner started, once the owner allows it;
105914
105991
  --full-access lets them also invite others and manage the channel
105992
+ laze slack connect-invite --new-channel <name> <email> [--public] [--full-access]
105993
+ the same in one go for a new channel: the Laze bot creates it (private unless --public),
105994
+ adds the owner and sends the invite; the owner allows it all on one card first
105915
105995
  laze slack profiles <slack:T:U>... Slack status, title and time zone of authors
105916
105996
  laze slack bookmarks <channelId> a mirrored Slack channel's bookmarks
105917
105997
  laze slack link <teamId> prints the link that links your own Slack
@@ -106064,7 +106144,11 @@ var post2 = async ({ context, args, client }) => {
106064
106144
  context.out(`Posted as your owner: ${posted.messageId} in ${posted.channelId}
106065
106145
  `);
106066
106146
  };
106067
- var connectInvite = async ({ context, args, client }) => {
106147
+ var connectInvite = async (input2) => {
106148
+ const { context, args, client } = input2;
106149
+ if (args.flags["new-channel"] === true) throw new CliUsageError(SLACK_USAGE);
106150
+ const newChannel = flagText({ args, name: "new-channel" });
106151
+ if (newChannel) return connectInviteNewChannel({ ...input2, name: newChannel });
106068
106152
  const email3 = wordAt9(args, 3);
106069
106153
  const invited = await client.post(SLACK_CONNECT_INVITE_PATH, {
106070
106154
  channelId: wordAt9(args, 2),
@@ -106075,6 +106159,27 @@ var connectInvite = async ({ context, args, client }) => {
106075
106159
  context.out(`Slack Connect invite sent to ${invited.email} (${invited.inviteId})
106076
106160
  `);
106077
106161
  };
106162
+ var connectInviteNewChannel = async ({
106163
+ context,
106164
+ args,
106165
+ client,
106166
+ name: name3
106167
+ }) => {
106168
+ const invited = await client.post(
106169
+ SLACK_CONNECT_INVITE_NEW_CHANNEL_PATH,
106170
+ {
106171
+ name: name3,
106172
+ email: wordAt9(args, 2),
106173
+ isPrivate: args.flags.public !== true,
106174
+ externalLimited: args.flags["full-access"] !== true
106175
+ }
106176
+ );
106177
+ if (json5({ context, args, data: invited })) return;
106178
+ context.out(
106179
+ `Created #${invited.name} (${invited.channelId}, Slack ${invited.slackChannelId}) and sent a Slack Connect invite to ${invited.email} (${invited.inviteId})
106180
+ `
106181
+ );
106182
+ };
106078
106183
  var dm = async ({ context, args, client }) => {
106079
106184
  const opened = await client.post(SLACK_KEY_PATHS.direct, {
106080
106185
  teamId: wordAt9(args, 2),
@@ -106895,7 +107000,7 @@ async function doorOf({
106895
107000
  })
106896
107001
  };
106897
107002
  }
106898
- const signed2 = await signedIn({ context, args }).catch(() => null);
107003
+ const signed2 = await vaultSignedIn({ context, args });
106899
107004
  if (signed2?.profile.kind !== "agent" && signed2?.profile.kind !== "person") {
106900
107005
  throw new CliUsageError(`laze vault env ${WHERE}`);
106901
107006
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazehq/cli",
3
- "version": "0.1.143",
3
+ "version": "0.1.145",
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",