@lazehq/cli 0.1.100 → 0.1.101
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 +94 -35
- 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.101";
|
|
36964
36964
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
36965
36965
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
36966
36966
|
}
|
|
@@ -66756,6 +66756,15 @@ var agentRuntimeConfig = Config.define((c) => ({
|
|
|
66756
66756
|
"AGENT_RUNTIME_COMPUTER_HOST_PROBE_SECONDS",
|
|
66757
66757
|
positive.default(60)
|
|
66758
66758
|
),
|
|
66759
|
+
/**
|
|
66760
|
+
* Test stacks only: the loopback `host:port` of a test computer daemon, which every computer
|
|
66761
|
+
* then is (ADR 20261106-test-computer). A production process refuses to boot with it set.
|
|
66762
|
+
*/
|
|
66763
|
+
testComputerDaemon: c.env(
|
|
66764
|
+
"AGENT_RUNTIME_TEST_COMPUTER_DAEMON",
|
|
66765
|
+
external_exports.string().regex(/^127\.0\.0\.1:\d{1,5}$/).optional()
|
|
66766
|
+
),
|
|
66767
|
+
nodeEnvironment,
|
|
66759
66768
|
/** How long a wake waits for its computer's move before it fails with computer_moving. */
|
|
66760
66769
|
computerMoveWaitSeconds: c.env("AGENT_RUNTIME_COMPUTER_MOVE_WAIT_SECONDS", positive.default(600))
|
|
66761
66770
|
}));
|
|
@@ -77266,6 +77275,10 @@ without a recap; the person's DM already shows your messages elsewhere.
|
|
|
77266
77275
|
- \`laze history <channel>\` and \`laze thread <id>\` read a conversation.
|
|
77267
77276
|
- \`laze search "words"\` searches messages.
|
|
77268
77277
|
- \`laze channels list\` lists the conversations you are in.
|
|
77278
|
+
- \`laze conversation new <agent> "text"\` starts a conversation (yours starts it for your
|
|
77279
|
+
person), \`laze conversation add <id> <member>\` adds people already in the workspace to it,
|
|
77280
|
+
and \`laze channel add <channel> <member>\` does the same for a channel. \`laze invite\` is only
|
|
77281
|
+
for people new to the workspace.
|
|
77269
77282
|
- \`laze agent update --self --name "<name>"\` renames you; \`--description <text>\` and
|
|
77270
77283
|
\`--avatar <file>\` change your description and face.
|
|
77271
77284
|
- \`laze channel info <channel>\` shows its members and the apps pinned there. Read a pinned app
|
|
@@ -86126,19 +86139,23 @@ async function channelUnarchive({ context, args }) {
|
|
|
86126
86139
|
`
|
|
86127
86140
|
});
|
|
86128
86141
|
}
|
|
86129
|
-
|
|
86130
|
-
|
|
86131
|
-
|
|
86132
|
-
|
|
86133
|
-
|
|
86134
|
-
|
|
86135
|
-
|
|
86136
|
-
|
|
86137
|
-
|
|
86138
|
-
|
|
86139
|
-
|
|
86140
|
-
}
|
|
86142
|
+
function addMembers(usage) {
|
|
86143
|
+
return async ({ context, args }) => {
|
|
86144
|
+
const [, , channel, ...members3] = args.words;
|
|
86145
|
+
if (!channel || members3.length === 0) throw new CliUsageError(usage);
|
|
86146
|
+
return changeChannel({
|
|
86147
|
+
context,
|
|
86148
|
+
args,
|
|
86149
|
+
path: "/api/agents/me/channels/add",
|
|
86150
|
+
body: { channel, members: members3 },
|
|
86151
|
+
line: (detail) => membersChangedLine({ detail, members: members3, change: "added" })
|
|
86152
|
+
});
|
|
86153
|
+
};
|
|
86141
86154
|
}
|
|
86155
|
+
var channelAdd = addMembers("Usage: laze channel add <channel> <member> [<member>...]");
|
|
86156
|
+
var conversationAdd = addMembers(
|
|
86157
|
+
"Usage: laze conversation add <conversation> <member> [<member>...] people already in the workspace, by email, name or id"
|
|
86158
|
+
);
|
|
86142
86159
|
async function channelGroups({ context, args }) {
|
|
86143
86160
|
const [, , channel] = args.words;
|
|
86144
86161
|
if (!channel) throw new CliUsageError("Usage: laze channel groups <channel>");
|
|
@@ -90795,8 +90812,11 @@ function stateOf2(chat) {
|
|
|
90795
90812
|
|
|
90796
90813
|
// src/services/conversation-commands.service.ts
|
|
90797
90814
|
var CONVERSATION_USAGE = `Usage:
|
|
90798
|
-
laze conversation new <agent> <text|-> start a conversation with an agent
|
|
90799
|
-
[--about <message id>]
|
|
90815
|
+
laze conversation new <agent> <text|-> start a conversation with an agent; an agent's key
|
|
90816
|
+
[--about <message id>] starts it for its person. --about continues from a
|
|
90817
|
+
message: the first one quotes it
|
|
90818
|
+
laze conversation add <id> <member>... add people already in the workspace (by email, name
|
|
90819
|
+
or id); laze invite is only for people new to it
|
|
90800
90820
|
laze conversation list [--agent <agent>] yours (an agent: its own; --unnamed for untitled)
|
|
90801
90821
|
[--closed] only the closed ones, which the list leaves out
|
|
90802
90822
|
laze conversation rename <id> <title> name it (its agent, or a person in it)
|
|
@@ -94894,7 +94914,9 @@ function inviteQuoteText(quote4) {
|
|
|
94894
94914
|
}
|
|
94895
94915
|
|
|
94896
94916
|
// src/services/invite-commands.service.ts
|
|
94897
|
-
var INVITE_USAGE =
|
|
94917
|
+
var INVITE_USAGE = `Usage: laze invite [--to <conversation>] [--role member|guest|admin|owner] [--yes] <email>...
|
|
94918
|
+
invites people who are not in the workspace yet. Someone already in it needs no invite:
|
|
94919
|
+
laze conversation add <conversation> <member>... or laze channel add <channel> <member>...`;
|
|
94898
94920
|
var ROLES3 = {
|
|
94899
94921
|
owner: "OWNER",
|
|
94900
94922
|
admin: "ADMIN",
|
|
@@ -94919,14 +94941,58 @@ function personLines(sent) {
|
|
|
94919
94941
|
return sent.invites.flatMap((one) => one.personId ? [`${one.email} is person ${one.personId}.
|
|
94920
94942
|
`] : []).join("");
|
|
94921
94943
|
}
|
|
94922
|
-
function
|
|
94923
|
-
|
|
94924
|
-
|
|
94925
|
-
|
|
94944
|
+
function addCommandOf({ to, email: email3 }) {
|
|
94945
|
+
return to ? `laze conversation add ${to} ${email3}` : `laze conversation add <conversation> ${email3} (or laze channel add <channel> ${email3})`;
|
|
94946
|
+
}
|
|
94947
|
+
function alreadyInLine({ to, email: email3 }) {
|
|
94948
|
+
return `${email3} is already in the workspace, so there is nothing to invite or pay for. To add them, run: ${addCommandOf({ to, email: email3 })}
|
|
94949
|
+
`;
|
|
94950
|
+
}
|
|
94951
|
+
function refusedLines({
|
|
94952
|
+
refused,
|
|
94953
|
+
to
|
|
94954
|
+
}) {
|
|
94955
|
+
const why = { invalid: "not an email address", duplicate: "listed twice" };
|
|
94956
|
+
return refused.map(
|
|
94957
|
+
(one) => one.reason === "member" ? alreadyInLine({ to, email: one.email }) : `Left out ${one.email}: ${why[one.reason]}.
|
|
94958
|
+
`
|
|
94959
|
+
).join("");
|
|
94960
|
+
}
|
|
94961
|
+
async function memberEmailsOf(client) {
|
|
94962
|
+
try {
|
|
94963
|
+
const members3 = await client.get("/api/workspaces/current/members");
|
|
94964
|
+
return new Set(members3.map((member) => member.email.toLowerCase()));
|
|
94965
|
+
} catch (error63) {
|
|
94966
|
+
if (error63 instanceof LazeApiError) return /* @__PURE__ */ new Set();
|
|
94967
|
+
throw error63;
|
|
94968
|
+
}
|
|
94969
|
+
}
|
|
94970
|
+
async function askAdmins({
|
|
94971
|
+
context,
|
|
94972
|
+
client,
|
|
94973
|
+
input: input2
|
|
94974
|
+
}) {
|
|
94975
|
+
const requested = await client.post(
|
|
94976
|
+
"/api/agents/me/workspace/request-invites",
|
|
94977
|
+
input2
|
|
94978
|
+
);
|
|
94979
|
+
context.out(refusedLines({ refused: requested.refused, to: input2.to }));
|
|
94980
|
+
if (requested.requests.length === 0) return;
|
|
94981
|
+
const approvers = requested.approvers.length > 0 ? requested.approvers.join(" or ") : "an admin";
|
|
94982
|
+
context.out(
|
|
94983
|
+
`Sent ${requested.requests.length} to ${approvers} for approval. The invitations go out once approved.
|
|
94984
|
+
`
|
|
94985
|
+
);
|
|
94926
94986
|
}
|
|
94927
94987
|
async function invite3({ context, args }) {
|
|
94928
|
-
const
|
|
94988
|
+
const asked = inviteInput(args);
|
|
94929
94989
|
const { client } = await signedIn({ context, args });
|
|
94990
|
+
const members3 = await memberEmailsOf(client);
|
|
94991
|
+
const already = asked.emails.filter((email3) => members3.has(email3.toLowerCase()));
|
|
94992
|
+
for (const email3 of already) context.out(alreadyInLine({ to: asked.to, email: email3 }));
|
|
94993
|
+
const emails = asked.emails.filter((email3) => !members3.has(email3.toLowerCase()));
|
|
94994
|
+
if (emails.length === 0) return;
|
|
94995
|
+
const input2 = { ...asked, emails };
|
|
94930
94996
|
const quote4 = await client.post("/api/billing-account/invite-quote", {
|
|
94931
94997
|
adding: input2.emails.length
|
|
94932
94998
|
});
|
|
@@ -94940,18 +95006,9 @@ async function invite3({ context, args }) {
|
|
|
94940
95006
|
sent = await client.post("/api/agents/me/workspace/invite-many", input2);
|
|
94941
95007
|
} catch (error63) {
|
|
94942
95008
|
if (!(error63 instanceof LazeApiError) || error63.status !== 403) throw error63;
|
|
94943
|
-
|
|
94944
|
-
"/api/agents/me/workspace/request-invites",
|
|
94945
|
-
input2
|
|
94946
|
-
);
|
|
94947
|
-
const approvers = asked.approvers.length > 0 ? asked.approvers.join(" or ") : "an admin";
|
|
94948
|
-
context.out(
|
|
94949
|
-
`${refusedLines(asked.refused)}Sent ${asked.requests.length} to ${approvers} for approval. The invitations go out once approved.
|
|
94950
|
-
`
|
|
94951
|
-
);
|
|
94952
|
-
return;
|
|
95009
|
+
return askAdmins({ context, client, input: input2 });
|
|
94953
95010
|
}
|
|
94954
|
-
context.out(refusedLines(sent.refused));
|
|
95011
|
+
context.out(refusedLines({ refused: sent.refused, to: input2.to }));
|
|
94955
95012
|
context.out(personLines(sent));
|
|
94956
95013
|
if (!quote4.upgradeNeeded) {
|
|
94957
95014
|
context.out(`Invited ${sent.invites.length}.${sent.held ? " Some wait for seats." : ""}
|
|
@@ -101721,7 +101778,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
101721
101778
|
laze workspace leave leave this workspace
|
|
101722
101779
|
laze workspace delete --confirm <name> | cancel-deletion schedule its deletion, or take it back (Owners)
|
|
101723
101780
|
laze members the workspace's people, each with their role
|
|
101724
|
-
laze invite [--to <conversation>] [--yes] <email>... invite people to
|
|
101781
|
+
laze invite [--to <conversation>] [--yes] <email>... invite people new to the workspace; shows the price first
|
|
101725
101782
|
laze members invite <email> [--role owner|admin|member|guest] invite someone (admins)
|
|
101726
101783
|
laze members invites | revoke-invite <email|id> invitations waiting, or take one back (admins)
|
|
101727
101784
|
laze members invite-link <email|id> a fresh link for an invitation, shown once (admins)
|
|
@@ -101750,7 +101807,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
101750
101807
|
laze channel update <channel> [--name <n>] [--topic <t>] [--description <d>] [--private] [--mentioned-only on|off] rename, set its topic or Mentioned only (people)
|
|
101751
101808
|
laze channel default <channel> <agent>|--clear the agent that answers unnamed messages (channel admins)
|
|
101752
101809
|
laze channel archive|unarchive <channel> freeze a channel or bring it back (channel admins)
|
|
101753
|
-
laze channel add <channel> <member>... add
|
|
101810
|
+
laze channel add <channel> <member>... add workspace members or agents to a channel
|
|
101754
101811
|
laze channel add-group <channel> <group> add a group; its people follow it in and out (people)
|
|
101755
101812
|
laze channel remove-group <channel> <group> take a group out, with the people it brought (people)
|
|
101756
101813
|
laze channel groups <channel> list the groups in a channel
|
|
@@ -101763,7 +101820,8 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
101763
101820
|
laze emoji list | add <name> <file> [--alias <a,b>] | alias <alias> <name> | remove <name> the workspace's custom emoji
|
|
101764
101821
|
laze status set <emoji> [text] [--for 30m|1h|4h|today|week|never] your status next to your name (people)
|
|
101765
101822
|
laze status clear | away | active clear it, or set yourself away by hand until active
|
|
101766
|
-
laze conversation new <agent> <text|-> [--about <message id>] start a conversation with an agent; it names it
|
|
101823
|
+
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 people already in the workspace to a conversation (a person in it, or its agent while its person is in it)
|
|
101767
101825
|
laze conversation list [--agent <agent>] [--unnamed] your conversations with agents
|
|
101768
101826
|
laze conversation rename <id> <title> name a conversation (its agent, or a person in it)
|
|
101769
101827
|
laze conversation join|close <id> open one of an agent shared with you, or leave it
|
|
@@ -102014,6 +102072,7 @@ var COMMANDS4 = {
|
|
|
102014
102072
|
dnd,
|
|
102015
102073
|
emoji: emoji3,
|
|
102016
102074
|
"conversation new": conversationNew,
|
|
102075
|
+
"conversation add": conversationAdd,
|
|
102017
102076
|
"conversation list": conversationList,
|
|
102018
102077
|
"conversation rename": conversationRename,
|
|
102019
102078
|
"conversation join": conversationJoin,
|
package/package.json
CHANGED