@lazehq/cli 0.1.101 → 0.1.103
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.
- package/dist/laze.mjs +74 -18
- 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.
|
|
36963
|
+
var STAMPED = "0.1.103";
|
|
36964
36964
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
36965
36965
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
36966
36966
|
}
|
|
@@ -77276,7 +77276,7 @@ without a recap; the person's DM already shows your messages elsewhere.
|
|
|
77276
77276
|
- \`laze search "words"\` searches messages.
|
|
77277
77277
|
- \`laze channels list\` lists the conversations you are in.
|
|
77278
77278
|
- \`laze conversation new <agent> "text"\` starts a conversation (yours starts it for your
|
|
77279
|
-
person), \`laze conversation add <id> <member>\` adds
|
|
77279
|
+
person), \`laze conversation add <id> <member>\` adds workspace members or agents to it,
|
|
77280
77280
|
and \`laze channel add <channel> <member>\` does the same for a channel. \`laze invite\` is only
|
|
77281
77281
|
for people new to the workspace.
|
|
77282
77282
|
- \`laze agent update --self --name "<name>"\` renames you; \`--description <text>\` and
|
|
@@ -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
|
-
|
|
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) {
|
|
@@ -86154,7 +86155,7 @@ function addMembers(usage) {
|
|
|
86154
86155
|
}
|
|
86155
86156
|
var channelAdd = addMembers("Usage: laze channel add <channel> <member> [<member>...]");
|
|
86156
86157
|
var conversationAdd = addMembers(
|
|
86157
|
-
"Usage: laze conversation add <conversation> <member> [<member>...]
|
|
86158
|
+
"Usage: laze conversation add <conversation> <member> [<member>...] workspace members or agents, by email, name or id"
|
|
86158
86159
|
);
|
|
86159
86160
|
async function channelGroups({ context, args }) {
|
|
86160
86161
|
const [, , channel] = args.words;
|
|
@@ -86197,16 +86198,22 @@ var channelRemoveGroup = groupChange({
|
|
|
86197
86198
|
verb: "remove-group",
|
|
86198
86199
|
line: (group) => `Took @${group} out, with the people it brought.`
|
|
86199
86200
|
});
|
|
86200
|
-
|
|
86201
|
-
|
|
86202
|
-
|
|
86203
|
-
|
|
86204
|
-
|
|
86205
|
-
|
|
86206
|
-
|
|
86207
|
-
|
|
86208
|
-
|
|
86209
|
-
|
|
86201
|
+
var channelRemove = removeMember("Usage: laze channel remove <channel> <member>");
|
|
86202
|
+
var conversationRemove = removeMember(
|
|
86203
|
+
"Usage: laze conversation remove <conversation> <member>"
|
|
86204
|
+
);
|
|
86205
|
+
function removeMember(usage) {
|
|
86206
|
+
return async ({ context, args }) => {
|
|
86207
|
+
const [, , channel, member] = args.words;
|
|
86208
|
+
if (!channel || !member) throw new CliUsageError(usage);
|
|
86209
|
+
return changeChannel({
|
|
86210
|
+
context,
|
|
86211
|
+
args,
|
|
86212
|
+
path: "/api/agents/me/channels/remove",
|
|
86213
|
+
body: { channel, member },
|
|
86214
|
+
line: (detail) => membersChangedLine({ detail, members: [member], change: "removed" })
|
|
86215
|
+
});
|
|
86216
|
+
};
|
|
86210
86217
|
}
|
|
86211
86218
|
async function openDirect({ context, args }) {
|
|
86212
86219
|
const people2 = args.words.slice(1);
|
|
@@ -86312,6 +86319,30 @@ async function channelSettings({ context, args }) {
|
|
|
86312
86319
|
import { readFile as readFile19 } from "node:fs/promises";
|
|
86313
86320
|
import { basename as basename8, isAbsolute as isAbsolute2, relative as relative4, resolve as resolve11 } from "node:path";
|
|
86314
86321
|
|
|
86322
|
+
// src/rules/app-link.rules.ts
|
|
86323
|
+
var MARKDOWN_LINK = /^\[[^\]]*\]\((\S+)\)$/;
|
|
86324
|
+
var APP_PAGE = /^\/workspaces\/[^/]+\/apps\/([^/?#]+)\/?$/;
|
|
86325
|
+
function onlyUrlOf(body) {
|
|
86326
|
+
const text3 = body.trim().replace(/^<(.+)>$/, "$1");
|
|
86327
|
+
const linked = MARKDOWN_LINK.exec(text3)?.[1] ?? text3;
|
|
86328
|
+
return /^https?:\/\/\S+$/.test(linked) ? linked : null;
|
|
86329
|
+
}
|
|
86330
|
+
function appOfLinkOnly(body) {
|
|
86331
|
+
const url2 = onlyUrlOf(body);
|
|
86332
|
+
if (!url2) return null;
|
|
86333
|
+
let parsed;
|
|
86334
|
+
try {
|
|
86335
|
+
parsed = new URL(url2);
|
|
86336
|
+
} catch {
|
|
86337
|
+
return null;
|
|
86338
|
+
}
|
|
86339
|
+
const page = APP_PAGE.exec(parsed.pathname)?.[1];
|
|
86340
|
+
if (page) return decodeURIComponent(page);
|
|
86341
|
+
const [label3 = ""] = parsed.hostname.split(".");
|
|
86342
|
+
const [app2, workspace2] = label3.split("--");
|
|
86343
|
+
return app2 && workspace2 ? app2 : null;
|
|
86344
|
+
}
|
|
86345
|
+
|
|
86315
86346
|
// src/services/file-download.service.ts
|
|
86316
86347
|
import { createWriteStream } from "node:fs";
|
|
86317
86348
|
import { mkdir as mkdir8, rename as rename3, rm as rm13, stat as stat10, truncate } from "node:fs/promises";
|
|
@@ -86495,7 +86526,9 @@ var CHAT_ACTIONS_USAGE = `Usage:
|
|
|
86495
86526
|
laze message delete <messageId> delete your own message
|
|
86496
86527
|
laze message remove <messageId> remove anyone's message (admins)
|
|
86497
86528
|
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
|
|
86529
|
+
laze message pin <messageId> [--off] pin it in its conversation, or unpin it; a message
|
|
86530
|
+
that is only an app link says to run laze app pin
|
|
86531
|
+
[--message] pin that message anyway
|
|
86499
86532
|
laze message restore <messageId> put a scrubbed secret back in your message (people)
|
|
86500
86533
|
laze pins <channel> a conversation's pinned messages
|
|
86501
86534
|
laze channel read <channel> [--seq <n>] mark it read, up to a message or to the newest
|
|
@@ -86643,6 +86676,9 @@ var MESSAGE_VERBS = {
|
|
|
86643
86676
|
},
|
|
86644
86677
|
pin: async ({ context, args, client }) => {
|
|
86645
86678
|
const pinned = !args.flags.off;
|
|
86679
|
+
if (pinned && !args.flags.message) {
|
|
86680
|
+
await refuseAppLinkPin({ client, messageId: wordAt(args, 2) });
|
|
86681
|
+
}
|
|
86646
86682
|
const answer6 = await client.post(CHAT_KEY_PATHS.pin, {
|
|
86647
86683
|
messageId: wordAt(args, 2),
|
|
86648
86684
|
pinned
|
|
@@ -86658,6 +86694,21 @@ var MESSAGE_VERBS = {
|
|
|
86658
86694
|
` });
|
|
86659
86695
|
}
|
|
86660
86696
|
};
|
|
86697
|
+
async function refuseAppLinkPin({
|
|
86698
|
+
client,
|
|
86699
|
+
messageId
|
|
86700
|
+
}) {
|
|
86701
|
+
const thread2 = await client.post(CHAT_KEY_PATHS.thread, { messageId }).catch(() => null);
|
|
86702
|
+
const found = thread2 && [thread2.root, ...thread2.replies].find((one) => one.id === messageId);
|
|
86703
|
+
const wanted = found ? appOfLinkOnly(found.body) : null;
|
|
86704
|
+
if (!found || !wanted) return;
|
|
86705
|
+
const app2 = await client.post("/api/apps/find", { app: wanted }).catch(() => null);
|
|
86706
|
+
if (!app2) return;
|
|
86707
|
+
throw new CliUsageError(
|
|
86708
|
+
`${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}
|
|
86709
|
+
To pin the message itself, run: laze message pin ${messageId} --message`
|
|
86710
|
+
);
|
|
86711
|
+
}
|
|
86661
86712
|
var message = (input2) => {
|
|
86662
86713
|
const verb = input2.args.words[1] ?? "";
|
|
86663
86714
|
const run4 = Object.hasOwn(MESSAGE_VERBS, verb) ? MESSAGE_VERBS[verb] : void 0;
|
|
@@ -90815,8 +90866,9 @@ var CONVERSATION_USAGE = `Usage:
|
|
|
90815
90866
|
laze conversation new <agent> <text|-> start a conversation with an agent; an agent's key
|
|
90816
90867
|
[--about <message id>] starts it for its person. --about continues from a
|
|
90817
90868
|
message: the first one quotes it
|
|
90818
|
-
laze conversation add <id> <member>... add
|
|
90819
|
-
|
|
90869
|
+
laze conversation add <id> <member>... add workspace members or agents (by email, name or
|
|
90870
|
+
id); laze invite is only for people new to it
|
|
90871
|
+
laze conversation remove <id> <member> take a member out (whoever started it, or an Admin)
|
|
90820
90872
|
laze conversation list [--agent <agent>] yours (an agent: its own; --unnamed for untitled)
|
|
90821
90873
|
[--closed] only the closed ones, which the list leaves out
|
|
90822
90874
|
laze conversation rename <id> <title> name it (its agent, or a person in it)
|
|
@@ -101821,7 +101873,8 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
101821
101873
|
laze status set <emoji> [text] [--for 30m|1h|4h|today|week|never] your status next to your name (people)
|
|
101822
101874
|
laze status clear | away | active clear it, or set yourself away by hand until active
|
|
101823
101875
|
laze conversation new <agent> <text|-> [--about <message id>] start a conversation with an agent; it names it (an agent's key starts it for its person)
|
|
101824
|
-
laze conversation add <id> <member>... add
|
|
101876
|
+
laze conversation add <id> <member>... add workspace members or agents to a conversation, as to a channel
|
|
101877
|
+
laze conversation remove <id> <member> take a member out of a conversation (whoever started it, or an Admin)
|
|
101825
101878
|
laze conversation list [--agent <agent>] [--unnamed] your conversations with agents
|
|
101826
101879
|
laze conversation rename <id> <title> name a conversation (its agent, or a person in it)
|
|
101827
101880
|
laze conversation join|close <id> open one of an agent shared with you, or leave it
|
|
@@ -101853,6 +101906,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
101853
101906
|
laze thread <id> --wait-reply [--timeout <s>] wait until a person replies in the thread
|
|
101854
101907
|
laze threads [unread] the threads you follow (people)
|
|
101855
101908
|
laze message edit|delete|remove|react|pin|restore <id> change a message; laze pins <channel>
|
|
101909
|
+
message pin pins a message; an app goes in as a tab with laze app pin <app> --channel <c>
|
|
101856
101910
|
laze channel read|unread <channel> [--seq <n>] move your read marker
|
|
101857
101911
|
laze files <channel> | file link|download|rename|upload a conversation's files, and uploading one
|
|
101858
101912
|
laze saved [marks|done|remind] | laze save <id> your saved messages (people)
|
|
@@ -101876,6 +101930,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
101876
101930
|
laze app create <name> ... build an app from scratch (--template slides for a deck), push, revert
|
|
101877
101931
|
apps are also called artifacts: asked for an artifact, page, dashboard, deck or mock, build a Laze app
|
|
101878
101932
|
laze app open|screenshot [file] look at your app in a browser tab, signed in as you, view only
|
|
101933
|
+
laze app pin <app> --channel <c> put an app in a conversation as a tab (not laze message pin)
|
|
101879
101934
|
laze app every laze app command, with its flags
|
|
101880
101935
|
laze agents list | laze agents status <name> the workspace's agents and their context
|
|
101881
101936
|
laze agents show <name> [--json] an agent's profile: kind, how it runs, intelligence
|
|
@@ -102073,6 +102128,7 @@ var COMMANDS4 = {
|
|
|
102073
102128
|
emoji: emoji3,
|
|
102074
102129
|
"conversation new": conversationNew,
|
|
102075
102130
|
"conversation add": conversationAdd,
|
|
102131
|
+
"conversation remove": conversationRemove,
|
|
102076
102132
|
"conversation list": conversationList,
|
|
102077
102133
|
"conversation rename": conversationRename,
|
|
102078
102134
|
"conversation join": conversationJoin,
|
package/package.json
CHANGED