@lazehq/cli 0.1.101 → 0.1.102

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 +50 -3
  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.101";
36963
+ var STAMPED = "0.1.102";
36964
36964
  function cliVersionOf({ stamped = STAMPED } = {}) {
36965
36965
  return stamped.startsWith("__") ? "dev" : stamped;
36966
36966
  }
@@ -85703,7 +85703,8 @@ import { randomBytes as randomBytes4 } from "node:crypto";
85703
85703
 
85704
85704
  // src/rules/channel-format.rules.ts
85705
85705
  function channelLabelOf(detail) {
85706
- return detail.kind === "public" || detail.kind === "private" ? `#${detail.name}` : "(direct)";
85706
+ if (detail.kind === "public" || detail.kind === "private") return `#${detail.name}`;
85707
+ return detail.kind === "chat" ? "the conversation" : "(direct)";
85707
85708
  }
85708
85709
  var ROLE = { admin: "Admin", member: "Member" };
85709
85710
  function dndColumn(member) {
@@ -86312,6 +86313,30 @@ async function channelSettings({ context, args }) {
86312
86313
  import { readFile as readFile19 } from "node:fs/promises";
86313
86314
  import { basename as basename8, isAbsolute as isAbsolute2, relative as relative4, resolve as resolve11 } from "node:path";
86314
86315
 
86316
+ // src/rules/app-link.rules.ts
86317
+ var MARKDOWN_LINK = /^\[[^\]]*\]\((\S+)\)$/;
86318
+ var APP_PAGE = /^\/workspaces\/[^/]+\/apps\/([^/?#]+)\/?$/;
86319
+ function onlyUrlOf(body) {
86320
+ const text3 = body.trim().replace(/^<(.+)>$/, "$1");
86321
+ const linked = MARKDOWN_LINK.exec(text3)?.[1] ?? text3;
86322
+ return /^https?:\/\/\S+$/.test(linked) ? linked : null;
86323
+ }
86324
+ function appOfLinkOnly(body) {
86325
+ const url2 = onlyUrlOf(body);
86326
+ if (!url2) return null;
86327
+ let parsed;
86328
+ try {
86329
+ parsed = new URL(url2);
86330
+ } catch {
86331
+ return null;
86332
+ }
86333
+ const page = APP_PAGE.exec(parsed.pathname)?.[1];
86334
+ if (page) return decodeURIComponent(page);
86335
+ const [label3 = ""] = parsed.hostname.split(".");
86336
+ const [app2, workspace2] = label3.split("--");
86337
+ return app2 && workspace2 ? app2 : null;
86338
+ }
86339
+
86315
86340
  // src/services/file-download.service.ts
86316
86341
  import { createWriteStream } from "node:fs";
86317
86342
  import { mkdir as mkdir8, rename as rename3, rm as rm13, stat as stat10, truncate } from "node:fs/promises";
@@ -86495,7 +86520,9 @@ var CHAT_ACTIONS_USAGE = `Usage:
86495
86520
  laze message delete <messageId> delete your own message
86496
86521
  laze message remove <messageId> remove anyone's message (admins)
86497
86522
  laze message react <messageId> <emoji> add a reaction, or take yours back
86498
- laze message pin <messageId> [--off] pin it in its conversation, or unpin it
86523
+ laze message pin <messageId> [--off] pin it in its conversation, or unpin it; a message
86524
+ that is only an app link says to run laze app pin
86525
+ [--message] pin that message anyway
86499
86526
  laze message restore <messageId> put a scrubbed secret back in your message (people)
86500
86527
  laze pins <channel> a conversation's pinned messages
86501
86528
  laze channel read <channel> [--seq <n>] mark it read, up to a message or to the newest
@@ -86643,6 +86670,9 @@ var MESSAGE_VERBS = {
86643
86670
  },
86644
86671
  pin: async ({ context, args, client }) => {
86645
86672
  const pinned = !args.flags.off;
86673
+ if (pinned && !args.flags.message) {
86674
+ await refuseAppLinkPin({ client, messageId: wordAt(args, 2) });
86675
+ }
86646
86676
  const answer6 = await client.post(CHAT_KEY_PATHS.pin, {
86647
86677
  messageId: wordAt(args, 2),
86648
86678
  pinned
@@ -86658,6 +86688,21 @@ var MESSAGE_VERBS = {
86658
86688
  ` });
86659
86689
  }
86660
86690
  };
86691
+ async function refuseAppLinkPin({
86692
+ client,
86693
+ messageId
86694
+ }) {
86695
+ const thread2 = await client.post(CHAT_KEY_PATHS.thread, { messageId }).catch(() => null);
86696
+ const found = thread2 && [thread2.root, ...thread2.replies].find((one) => one.id === messageId);
86697
+ const wanted = found ? appOfLinkOnly(found.body) : null;
86698
+ if (!found || !wanted) return;
86699
+ const app2 = await client.post("/api/apps/find", { app: wanted }).catch(() => null);
86700
+ if (!app2) return;
86701
+ throw new CliUsageError(
86702
+ `${messageId} is only a link to the app ${app2.name}, so it was not pinned. To put the app in the conversation as a tab, run: laze app pin ${app2.slug} --channel ${found.channelId}
86703
+ To pin the message itself, run: laze message pin ${messageId} --message`
86704
+ );
86705
+ }
86661
86706
  var message = (input2) => {
86662
86707
  const verb = input2.args.words[1] ?? "";
86663
86708
  const run4 = Object.hasOwn(MESSAGE_VERBS, verb) ? MESSAGE_VERBS[verb] : void 0;
@@ -101853,6 +101898,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
101853
101898
  laze thread <id> --wait-reply [--timeout <s>] wait until a person replies in the thread
101854
101899
  laze threads [unread] the threads you follow (people)
101855
101900
  laze message edit|delete|remove|react|pin|restore <id> change a message; laze pins <channel>
101901
+ message pin pins a message; an app goes in as a tab with laze app pin <app> --channel <c>
101856
101902
  laze channel read|unread <channel> [--seq <n>] move your read marker
101857
101903
  laze files <channel> | file link|download|rename|upload a conversation's files, and uploading one
101858
101904
  laze saved [marks|done|remind] | laze save <id> your saved messages (people)
@@ -101876,6 +101922,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
101876
101922
  laze app create <name> ... build an app from scratch (--template slides for a deck), push, revert
101877
101923
  apps are also called artifacts: asked for an artifact, page, dashboard, deck or mock, build a Laze app
101878
101924
  laze app open|screenshot [file] look at your app in a browser tab, signed in as you, view only
101925
+ laze app pin <app> --channel <c> put an app in a conversation as a tab (not laze message pin)
101879
101926
  laze app every laze app command, with its flags
101880
101927
  laze agents list | laze agents status <name> the workspace's agents and their context
101881
101928
  laze agents show <name> [--json] an agent's profile: kind, how it runs, intelligence
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazehq/cli",
3
- "version": "0.1.101",
3
+ "version": "0.1.102",
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",