@lazehq/cli 0.1.113 → 0.1.115
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 +311 -71
- 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.115";
|
|
36964
36964
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
36965
36965
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
36966
36966
|
}
|
|
@@ -62627,13 +62627,23 @@ var layoutFileSchemaDefinition = external_exports.object({
|
|
|
62627
62627
|
path: external_exports.string().max(600).regex(/^\/api\/[^\s]*$/),
|
|
62628
62628
|
image: external_exports.boolean()
|
|
62629
62629
|
});
|
|
62630
|
+
var QUOTED_FILE_KINDS = [
|
|
62631
|
+
"photo",
|
|
62632
|
+
"video",
|
|
62633
|
+
"voice",
|
|
62634
|
+
"audio",
|
|
62635
|
+
"document",
|
|
62636
|
+
"sticker"
|
|
62637
|
+
];
|
|
62630
62638
|
var layoutQuotedSchemaDefinition = external_exports.object({
|
|
62631
62639
|
originKey: external_exports.string().min(1).max(200),
|
|
62632
62640
|
channelId: external_exports.string().min(1).max(100).nullable(),
|
|
62633
62641
|
seq: external_exports.number().int().positive().nullable(),
|
|
62634
62642
|
imageId: external_exports.string().min(1).max(100).nullable(),
|
|
62635
62643
|
/** The Laze person who wrote the original, such as a mirror's owner: their picture shows. */
|
|
62636
|
-
by: external_exports.object({ kind: external_exports.literal("person"), id: external_exports.string().min(1).max(100) }).optional()
|
|
62644
|
+
by: external_exports.object({ kind: external_exports.literal("person"), id: external_exports.string().min(1).max(100) }).optional(),
|
|
62645
|
+
/** The original's first file, labelled when the quote has no text; its picture is `imageId`. */
|
|
62646
|
+
file: external_exports.enum(QUOTED_FILE_KINDS).optional().catch(void 0)
|
|
62637
62647
|
});
|
|
62638
62648
|
var layoutAttachmentSchemaDefinition = external_exports.object({
|
|
62639
62649
|
type: external_exports.literal("attachment"),
|
|
@@ -62998,6 +63008,19 @@ var mirrorDeliveryStateSchema = external_exports.enum([
|
|
|
62998
63008
|
"edit_kept",
|
|
62999
63009
|
"reaction_kept"
|
|
63000
63010
|
]);
|
|
63011
|
+
var MIRROR_DELIVERY_REASONS = [
|
|
63012
|
+
"offline",
|
|
63013
|
+
"not_linked",
|
|
63014
|
+
"unconfirmed",
|
|
63015
|
+
"chat_unknown",
|
|
63016
|
+
"file_unavailable",
|
|
63017
|
+
"file_too_large",
|
|
63018
|
+
"too_many_files",
|
|
63019
|
+
"secret",
|
|
63020
|
+
"late",
|
|
63021
|
+
"rejected"
|
|
63022
|
+
];
|
|
63023
|
+
var mirrorDeliveryReasonSchema = external_exports.enum(MIRROR_DELIVERY_REASONS);
|
|
63001
63024
|
var messageOriginSchemaDefinition = external_exports.object({
|
|
63002
63025
|
source: mirrorSourceSchema,
|
|
63003
63026
|
/** The message's key at the source, unique in the workspace (e.g. `slack:T1:C1:1792.0001`). */
|
|
@@ -63481,6 +63504,8 @@ var messageSchemaDefinition = external_exports.object({
|
|
|
63481
63504
|
mirrorReactionKept: external_exports.boolean().optional(),
|
|
63482
63505
|
/** Set beside a waiting delivery while the computer that sends it is waking up. */
|
|
63483
63506
|
mirrorDeliveryWaking: external_exports.boolean().optional(),
|
|
63507
|
+
/** Beside a failed delivery: why it was not sent; an unknown reason reads as none. */
|
|
63508
|
+
mirrorDeliveryReason: mirrorDeliveryReasonSchema.optional().catch(void 0),
|
|
63484
63509
|
/** A thread reply also sent to its conversation: it shows in the thread and the channel. */
|
|
63485
63510
|
alsoInChannel: external_exports.boolean().optional(),
|
|
63486
63511
|
/** A Laze DM message also posted to its paired Slack DM, the id of that conversation. */
|
|
@@ -64052,7 +64077,9 @@ var pinMirroredInputSchemaDefinition = external_exports.object({
|
|
|
64052
64077
|
var setMirrorDeliveryInputSchemaDefinition = external_exports.object({
|
|
64053
64078
|
workspaceId: workspaceIdSchema,
|
|
64054
64079
|
messageId: idSchema4,
|
|
64055
|
-
state: mirrorDeliveryStateSchema.nullable()
|
|
64080
|
+
state: mirrorDeliveryStateSchema.nullable(),
|
|
64081
|
+
/** Beside `failed`: why it was not sent. */
|
|
64082
|
+
reason: mirrorDeliveryReasonSchema.optional()
|
|
64056
64083
|
});
|
|
64057
64084
|
var reactMirroredInputSchemaDefinition = external_exports.object({
|
|
64058
64085
|
workspaceId: workspaceIdSchema,
|
|
@@ -66722,7 +66749,9 @@ var supervisorLaunchSchemaDefinition = external_exports.object({
|
|
|
66722
66749
|
/** Set by the computer daemon: this supervisor's own ports inside the workspace's computer. */
|
|
66723
66750
|
computer: external_exports.object({
|
|
66724
66751
|
port: external_exports.number().int().min(1).max(65535),
|
|
66725
|
-
apiPort: external_exports.number().int().min(1).max(65535)
|
|
66752
|
+
apiPort: external_exports.number().int().min(1).max(65535),
|
|
66753
|
+
/** The updated Claude Code's bin directory, first on the harness PATH (else the image's). */
|
|
66754
|
+
claudeCodeBin: external_exports.string().min(1).max(4096).optional()
|
|
66726
66755
|
}).optional()
|
|
66727
66756
|
});
|
|
66728
66757
|
var ATTENTION_DISMISS_NOTE_MAX = 32e3;
|
|
@@ -67391,6 +67420,8 @@ var agentAvatarInputSchema = external_exports.string().trim().max(AGENT_AVATAR_M
|
|
|
67391
67420
|
(value) => value === "" || FACE_PATTERN.test(value) || FILE_PATTERN.test(value) || isEmojiAvatar(value),
|
|
67392
67421
|
{ message: "An avatar is a face, an uploaded picture or one emoji" }
|
|
67393
67422
|
);
|
|
67423
|
+
var AGENT_AVATAR_STORED_MAX = 1e3;
|
|
67424
|
+
var agentAvatarUpdateSchema = external_exports.string().max(AGENT_AVATAR_STORED_MAX);
|
|
67394
67425
|
var agentFaceRosterSchema = external_exports.enum(AGENT_FACE_ROSTERS).default(DEFAULT_AGENT_FACE_ROSTER).catch(DEFAULT_AGENT_FACE_ROSTER);
|
|
67395
67426
|
var uploadAgentAvatarInputSchemaDefinition = external_exports.object({
|
|
67396
67427
|
workspaceId: external_exports.string().min(1),
|
|
@@ -70377,7 +70408,7 @@ var updateAgentInputSchemaDefinition = external_exports.object({
|
|
|
70377
70408
|
workspaceId: workspaceIdSchema14,
|
|
70378
70409
|
agentId: idSchema18,
|
|
70379
70410
|
name: agentNameSchema.optional(),
|
|
70380
|
-
avatar:
|
|
70411
|
+
avatar: agentAvatarUpdateSchema.optional(),
|
|
70381
70412
|
/** A Laze models agent's level; null puts it back on Default. */
|
|
70382
70413
|
modelLevel: agentModelLevelSchema.nullable().optional(),
|
|
70383
70414
|
/** Agents Laze runs only; a connected agent refuses it. Null puts back the default. */
|
|
@@ -70579,8 +70610,13 @@ var callerChannelSchemaDefinition = external_exports.object({
|
|
|
70579
70610
|
name: external_exports.string(),
|
|
70580
70611
|
kind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
|
|
70581
70612
|
unread: external_exports.number().int().nonnegative(),
|
|
70582
|
-
/** The caller's setting there, for an agent in a channel
|
|
70613
|
+
/** The caller's setting there, for an agent in a channel or shared conversation. */
|
|
70583
70614
|
level: agentChannelLevelSchema.default("mentions"),
|
|
70615
|
+
/**
|
|
70616
|
+
* The caller has a setting and a mute there: a channel, or a conversation or group DM with 3 or
|
|
70617
|
+
* more members. Absent from older servers; a 1:1 DM always reaches the agent.
|
|
70618
|
+
*/
|
|
70619
|
+
hasSetting: external_exports.boolean().optional(),
|
|
70584
70620
|
/** A message there leaves Laze: the channel mirrors Slack or holds an agent run outside. */
|
|
70585
70621
|
leavesLaze: external_exports.boolean().default(false),
|
|
70586
70622
|
/** The caller's own mute there, while it lasts; null when not muted. */
|
|
@@ -70855,6 +70891,10 @@ var lazeChangeSchemaDefinition = external_exports.object({
|
|
|
70855
70891
|
|
|
70856
70892
|
// ../../modules/agent/contract/src/agent.config.ts
|
|
70857
70893
|
var positiveInt3 = external_exports.coerce.number().int().positive();
|
|
70894
|
+
var LAZE_LEVEL_MODELS = {
|
|
70895
|
+
frontier: "claude-opus-5-5",
|
|
70896
|
+
fast: "claude-sonnet-5-5"
|
|
70897
|
+
};
|
|
70858
70898
|
var agentConfig = Config.define((c) => ({
|
|
70859
70899
|
/** Agent messages in a row, each within 10 minutes of the last, before agents stop waking. */
|
|
70860
70900
|
hopLimit: c.env("AGENT_HOP_LIMIT", positiveInt3.default(12)),
|
|
@@ -70865,7 +70905,7 @@ var agentConfig = Config.define((c) => ({
|
|
|
70865
70905
|
),
|
|
70866
70906
|
claudeGatewayFrontierModel: c.env(
|
|
70867
70907
|
"AGENT_CLAUDE_GATEWAY_FRONTIER",
|
|
70868
|
-
external_exports.string().min(1).default(
|
|
70908
|
+
external_exports.string().min(1).default(LAZE_LEVEL_MODELS.frontier)
|
|
70869
70909
|
),
|
|
70870
70910
|
claudeGatewayMiddleModel: c.env(
|
|
70871
70911
|
"AGENT_CLAUDE_GATEWAY_MIDDLE",
|
|
@@ -70874,7 +70914,7 @@ var agentConfig = Config.define((c) => ({
|
|
|
70874
70914
|
/** Laze Small: Sonnet 5.5, the small level (Haiku was too weak, Rogerio 2026-10-28). */
|
|
70875
70915
|
claudeGatewayFastModel: c.env(
|
|
70876
70916
|
"AGENT_CLAUDE_GATEWAY_FAST",
|
|
70877
|
-
external_exports.string().min(1).default(
|
|
70917
|
+
external_exports.string().min(1).default(LAZE_LEVEL_MODELS.fast)
|
|
70878
70918
|
),
|
|
70879
70919
|
/** What a staff haiku override runs (staff-model-override.feature); never a level people pick. */
|
|
70880
70920
|
claudeGatewayHaikuModel: c.env(
|
|
@@ -73680,6 +73720,21 @@ var slackMoveChannelByKeyInputSchemaDefinition = slackMoveChannelInputSchema.omi
|
|
|
73680
73720
|
var startSlackMovesByKeyInputSchemaDefinition = startSlackMovesInputSchema.omit(noWorkspace);
|
|
73681
73721
|
var slackMoveByKeyInputSchemaDefinition = slackMoveInputSchema.omit(noWorkspace);
|
|
73682
73722
|
|
|
73723
|
+
// ../../modules/slack/contract/src/slack-owner-post.ts
|
|
73724
|
+
var SLACK_OWNER_POST_PATH = "/api/slack/post";
|
|
73725
|
+
var SLACK_OWNER_POST_MAX = 8e3;
|
|
73726
|
+
var slackOwnerPostInputSchemaDefinition = external_exports.object({
|
|
73727
|
+
/** The mirrored conversation's Laze id, as `laze history` and `laze search` print it. */
|
|
73728
|
+
channelId: external_exports.string().trim().min(1).max(200),
|
|
73729
|
+
text: external_exports.string().trim().min(1).max(SLACK_OWNER_POST_MAX),
|
|
73730
|
+
/** The Laze message to reply under; null posts in the conversation. */
|
|
73731
|
+
threadRootId: external_exports.string().trim().min(1).max(200).nullable().default(null)
|
|
73732
|
+
});
|
|
73733
|
+
var slackOwnerPostedSchemaDefinition = external_exports.object({
|
|
73734
|
+
messageId: external_exports.string(),
|
|
73735
|
+
channelId: external_exports.string()
|
|
73736
|
+
});
|
|
73737
|
+
|
|
73683
73738
|
// ../../modules/slack/contract/src/slack.config.ts
|
|
73684
73739
|
var positiveInt4 = external_exports.coerce.number().int().positive();
|
|
73685
73740
|
var slackConfig = Config.define((c) => ({
|
|
@@ -73742,6 +73797,39 @@ var slackMirrorHealthDefinition = external_exports.object({
|
|
|
73742
73797
|
});
|
|
73743
73798
|
var slackMirrorHealthSchema = slackMirrorHealthDefinition;
|
|
73744
73799
|
|
|
73800
|
+
// src/rules/channel-mute.rules.ts
|
|
73801
|
+
var DURATION = /^(\d+)\s*(m|min|mins|minutes?|h|hours?|d|days?)$/i;
|
|
73802
|
+
function minutesOf({ text: text3 }) {
|
|
73803
|
+
const match = DURATION.exec(text3.trim());
|
|
73804
|
+
if (!match?.[1] || !match[2]) return null;
|
|
73805
|
+
const count10 = Number(match[1]);
|
|
73806
|
+
const unit = match[2].toLowerCase()[0];
|
|
73807
|
+
const perUnit = { d: 1440, h: 60, m: 1 };
|
|
73808
|
+
const minutes = count10 * (perUnit[unit ?? "m"] ?? 1);
|
|
73809
|
+
return minutes > 0 ? minutes : null;
|
|
73810
|
+
}
|
|
73811
|
+
function muteTextOf({ mute }) {
|
|
73812
|
+
return `muted${mute.until ? ` until ${mute.until}` : ""}: ${mute.reason}`;
|
|
73813
|
+
}
|
|
73814
|
+
function settingTextOf({ channel }) {
|
|
73815
|
+
const level2 = channel.level === "everything" ? "Everything" : "Mentions only";
|
|
73816
|
+
const isDefault = channel.isDefault ? " default agent" : "";
|
|
73817
|
+
const mute = channel.mute ? ` ${muteTextOf({ mute: channel.mute })}` : "";
|
|
73818
|
+
return `${level2}${isDefault}${mute}`;
|
|
73819
|
+
}
|
|
73820
|
+
function hasSettingIn({ channel }) {
|
|
73821
|
+
return channel.hasSetting ?? (channel.kind === "public" || channel.kind === "private");
|
|
73822
|
+
}
|
|
73823
|
+
function placeOf({ channel }) {
|
|
73824
|
+
if (channel.kind === "public" || channel.kind === "private") return `#${channel.name}`;
|
|
73825
|
+
const what = channel.kind === "chat" ? "conversation" : "group DM";
|
|
73826
|
+
return channel.name ? `${what} ${channel.name} (${channel.id})` : `${what} ${channel.id}`;
|
|
73827
|
+
}
|
|
73828
|
+
function settingRowOf({ channel }) {
|
|
73829
|
+
return `${placeOf({ channel })} ${settingTextOf({ channel })}
|
|
73830
|
+
`;
|
|
73831
|
+
}
|
|
73832
|
+
|
|
73745
73833
|
// src/rules/not-in-channel.rules.ts
|
|
73746
73834
|
function notInChannelLineOf({
|
|
73747
73835
|
posted,
|
|
@@ -73963,13 +74051,14 @@ function newestIsSubagent({
|
|
|
73963
74051
|
}
|
|
73964
74052
|
|
|
73965
74053
|
// src/rules/rush-host.rules.ts
|
|
74054
|
+
var HOST_ACTIONS = /* @__PURE__ */ new Set(["run", "adopt"]);
|
|
73966
74055
|
function rushSessionOf({
|
|
73967
74056
|
parentArgs
|
|
73968
74057
|
}) {
|
|
73969
74058
|
if (!parentArgs) return void 0;
|
|
73970
74059
|
const [program = "", verb, action, id4] = parentArgs;
|
|
73971
|
-
if (!program ||
|
|
73972
|
-
return { id: id4, program };
|
|
74060
|
+
if (!program || !id4 || verb !== "host") return void 0;
|
|
74061
|
+
return HOST_ACTIONS.has(action ?? "") ? { id: id4, program } : void 0;
|
|
73973
74062
|
}
|
|
73974
74063
|
function rushSendCommand({ program, id: id4 }) {
|
|
73975
74064
|
return ["sh", "-c", 'printf "%s\\n" "$LAZE_WAKE_TEXT" | "$0" session send "$1"', program, id4];
|
|
@@ -74409,7 +74498,7 @@ function beat({
|
|
|
74409
74498
|
...working && state?.messageId ? { messageId: state.messageId } : {}
|
|
74410
74499
|
});
|
|
74411
74500
|
}
|
|
74412
|
-
function
|
|
74501
|
+
function placeOf2(message2) {
|
|
74413
74502
|
return { channelId: message2.channelId, threadRootId: message2.threadRootId };
|
|
74414
74503
|
}
|
|
74415
74504
|
function newestPerConversation({ messages }) {
|
|
@@ -74442,7 +74531,7 @@ async function turnStarted({
|
|
|
74442
74531
|
await beat({ client, state: before, working: false }).catch(() => void 0);
|
|
74443
74532
|
}
|
|
74444
74533
|
for (const other of others) {
|
|
74445
|
-
const opened = { ...
|
|
74534
|
+
const opened = { ...placeOf2(other), messageId: other.messageId };
|
|
74446
74535
|
await beat({ client, state: opened, working: true }).catch(() => void 0);
|
|
74447
74536
|
}
|
|
74448
74537
|
const path = statePath({ context, agent: agent3 });
|
|
@@ -74663,7 +74752,7 @@ async function attachmentIdsOf({
|
|
|
74663
74752
|
function utcTimeOf(iso3) {
|
|
74664
74753
|
return `${iso3.slice(0, 10)} ${iso3.slice(11, 16)} UTC`;
|
|
74665
74754
|
}
|
|
74666
|
-
function
|
|
74755
|
+
function placeOf3(item) {
|
|
74667
74756
|
if (item.channelKind === "public" || item.channelKind === "private") {
|
|
74668
74757
|
return `in #${item.channelName}`;
|
|
74669
74758
|
}
|
|
@@ -74671,7 +74760,7 @@ function placeOf2(item) {
|
|
|
74671
74760
|
}
|
|
74672
74761
|
function activityLineOf({ item }) {
|
|
74673
74762
|
const who = item.actor.name;
|
|
74674
|
-
const where =
|
|
74763
|
+
const where = placeOf3(item);
|
|
74675
74764
|
switch (item.kind) {
|
|
74676
74765
|
case "mention":
|
|
74677
74766
|
return `${who} mentioned you ${where}`;
|
|
@@ -74728,7 +74817,7 @@ function sendAtOf({ at: at4, timeZone }) {
|
|
|
74728
74817
|
return null;
|
|
74729
74818
|
}
|
|
74730
74819
|
}
|
|
74731
|
-
function
|
|
74820
|
+
function placeOf4({ scheduled: scheduled2 }) {
|
|
74732
74821
|
const inChannel = scheduled2.channelKind === "public" || scheduled2.channelKind === "private";
|
|
74733
74822
|
const channel = inChannel ? `#${scheduled2.channelName}` : "a direct message";
|
|
74734
74823
|
if (!scheduled2.threadRootId) return channel;
|
|
@@ -74751,7 +74840,7 @@ function scheduledLine({
|
|
|
74751
74840
|
timeZone
|
|
74752
74841
|
}) {
|
|
74753
74842
|
const when = zonedTimeOf({ iso: scheduled2.sendAt, timeZone });
|
|
74754
|
-
return `Scheduled ${scheduled2.id} for ${
|
|
74843
|
+
return `Scheduled ${scheduled2.id} for ${placeOf4({ scheduled: scheduled2 })} at ${when}.
|
|
74755
74844
|
${indented(scheduled2.body)}
|
|
74756
74845
|
`;
|
|
74757
74846
|
}
|
|
@@ -74764,7 +74853,7 @@ var FAILURES = {
|
|
|
74764
74853
|
};
|
|
74765
74854
|
function entryOf(scheduled2) {
|
|
74766
74855
|
const failed2 = scheduled2.failure ? `failed: ${FAILURES[scheduled2.failure]}; give it a new time with laze scheduled edit --at, or cancel it` : scheduled2.status;
|
|
74767
|
-
const head = `${utcTimeOf(scheduled2.sendAt)} ${failed2} ${
|
|
74856
|
+
const head = `${utcTimeOf(scheduled2.sendAt)} ${failed2} ${placeOf4({ scheduled: scheduled2 })} ${scheduled2.id}`;
|
|
74768
74857
|
return `${head}
|
|
74769
74858
|
${indented(scheduled2.body)}`;
|
|
74770
74859
|
}
|
|
@@ -74872,7 +74961,7 @@ async function actOn({
|
|
|
74872
74961
|
});
|
|
74873
74962
|
if (args.flags.json) return context.out(`${JSON.stringify(done, null, 2)}
|
|
74874
74963
|
`);
|
|
74875
|
-
const place =
|
|
74964
|
+
const place = placeOf4({ scheduled: done });
|
|
74876
74965
|
context.out(
|
|
74877
74966
|
action === "send" ? `Sent ${done.id} now in ${place} as ${done.messageId ?? "a new message"}.
|
|
74878
74967
|
` : `Cancelled ${done.id} in ${place}.
|
|
@@ -74974,7 +75063,7 @@ async function listChannels({ context, args }) {
|
|
|
74974
75063
|
if (args.flags.json) return context.out(`${JSON.stringify(channels3, null, 2)}
|
|
74975
75064
|
`);
|
|
74976
75065
|
for (const channel of channels3) {
|
|
74977
|
-
const direct2 =
|
|
75066
|
+
const direct2 = !hasSettingIn({ channel });
|
|
74978
75067
|
const name3 = channelLabelIn(channel);
|
|
74979
75068
|
const unread = channel.unread > 0 ? ` ${channel.unread} unread` : "";
|
|
74980
75069
|
const muted = channel.mute ? " muted" : "";
|
|
@@ -75000,10 +75089,9 @@ async function setChannelLevel({
|
|
|
75000
75089
|
});
|
|
75001
75090
|
if (args.flags.json) return context.out(`${JSON.stringify(set2, null, 2)}
|
|
75002
75091
|
`);
|
|
75003
|
-
|
|
75004
|
-
|
|
75005
|
-
`
|
|
75006
|
-
);
|
|
75092
|
+
const label3 = set2.level === "everything" ? "Everything" : "Mentions only";
|
|
75093
|
+
context.out(`${placeOf({ channel: set2 })} is now ${label3}.
|
|
75094
|
+
`);
|
|
75007
75095
|
}
|
|
75008
75096
|
var LEADING_BLANK_LINES = /^(?:[ \t]*\r?\n)+/;
|
|
75009
75097
|
async function textOf({
|
|
@@ -78074,6 +78162,11 @@ without a recap; the person's DM already shows your messages elsewhere.
|
|
|
78074
78162
|
\`--file <path|url>\` (repeatable, at most 6) to \`laze post\` or \`laze reply\` to send files.
|
|
78075
78163
|
- \`laze history <channel>\` and \`laze thread <id>\` read a conversation.
|
|
78076
78164
|
- \`laze search "words"\` searches messages.
|
|
78165
|
+
- When you work for your person alone (their own turn, or no one else's), \`laze history\`,
|
|
78166
|
+
\`laze search\` and \`laze thread\` also read their mirrored Slack, channels and DMs, as they
|
|
78167
|
+
see it. Never ask for a Slack token. \`laze slack post <channelId> "text"\` (\`--thread <id>\`
|
|
78168
|
+
to reply) posts there as them, from their own Slack account, in a turn they started; it can
|
|
78169
|
+
wait for their OK. Post as them only a message they told you to send.
|
|
78077
78170
|
- \`laze channels list\` lists the conversations you are in.
|
|
78078
78171
|
- \`laze conversation new <agent> "text"\` starts a conversation (yours starts it for your
|
|
78079
78172
|
person), \`laze conversation add <id> <member>\` adds workspace members or agents to it,
|
|
@@ -78155,6 +78248,7 @@ guide first: https://laze.so/docs/agents/apps.md. The short version:
|
|
|
78155
78248
|
a deck and keep its data-el attributes. A deck made earlier gets this with \`laze app upgrade\`.
|
|
78156
78249
|
An app that already exists goes in with \`laze app pin <app> --channel <channel>\`, never as a
|
|
78157
78250
|
pinned message with a link. A pin opens it to everyone there, and their agents may build on it.
|
|
78251
|
+
\`--path /#section\` (or any page of the app) opens the tab on that page; pin again to move it.
|
|
78158
78252
|
- A new app is Restricted. Do not share it with only the person who asked when they asked in a
|
|
78159
78253
|
channel: pin it there. \`laze app members\` shows who can open it; check it before announcing.
|
|
78160
78254
|
- Every \`laze app push -m "<what changed>"\` is live at once. There are no drafts, branches or
|
|
@@ -81882,6 +81976,11 @@ var appTriggerFiredPayloadSchemaDefinition = external_exports.object({
|
|
|
81882
81976
|
});
|
|
81883
81977
|
|
|
81884
81978
|
// ../../modules/app/contract/src/app.pins.ts
|
|
81979
|
+
var APP_PIN_PATH_MAX = 2e3;
|
|
81980
|
+
var appPinPathSchema = external_exports.string().trim().max(APP_PIN_PATH_MAX).refine(
|
|
81981
|
+
(path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\") && !/[\s\p{Cc}]/u.test(path),
|
|
81982
|
+
{ message: "The path is a page of the app, starting with /, like /#failed-payments" }
|
|
81983
|
+
);
|
|
81885
81984
|
var APP_PINS_PER_CHANNEL_MAX = 6;
|
|
81886
81985
|
var appPinChangedPayloadSchemaDefinition = external_exports.object({
|
|
81887
81986
|
workspaceId: external_exports.string().min(1),
|
|
@@ -81919,6 +82018,8 @@ var appPinSchemaDefinition = external_exports.object({
|
|
|
81919
82018
|
canUnpin: external_exports.boolean().default(true),
|
|
81920
82019
|
/** The app's own origin, so links to it open in the panel; null for a browser tab. */
|
|
81921
82020
|
url: external_exports.string().nullable().default(null),
|
|
82021
|
+
/** The page of the app the tab opens on, relative to `url`; null opens its first page. */
|
|
82022
|
+
path: external_exports.string().nullable().default(null),
|
|
81922
82023
|
/**
|
|
81923
82024
|
* The workspace that owns the app, when it is not the reader's: an app pinned in the other
|
|
81924
82025
|
* side's copy of a shared channel. Null for the reader's own workspace's apps.
|
|
@@ -81943,7 +82044,9 @@ var pinAppInputSchemaDefinition = external_exports.object({
|
|
|
81943
82044
|
/** The conversation, by id or by channel name with or without `#`. */
|
|
81944
82045
|
channel: external_exports.string().trim().min(1).max(120),
|
|
81945
82046
|
/** What the conversation's members may do: builder unless the pinner picked edit or view only. */
|
|
81946
|
-
role: appRoleSchema.optional()
|
|
82047
|
+
role: appRoleSchema.optional(),
|
|
82048
|
+
/** The page the tab opens on; absent keeps the pin's page, `/` sets it back to the first. */
|
|
82049
|
+
path: appPinPathSchema.optional()
|
|
81947
82050
|
});
|
|
81948
82051
|
var pinAppInputSchema = pinAppInputSchemaDefinition;
|
|
81949
82052
|
var channelPinsInputSchemaDefinition = external_exports.object({
|
|
@@ -81971,7 +82074,9 @@ var pinAppByKeyInputSchemaDefinition = external_exports.object({
|
|
|
81971
82074
|
/** Absent in an agent's turn means the conversation the turn runs in. */
|
|
81972
82075
|
channel: external_exports.string().trim().min(1).max(120).optional(),
|
|
81973
82076
|
/** On a pin: what the conversation's members may do, builder unless edit or view only. */
|
|
81974
|
-
role: appRoleSchema.optional()
|
|
82077
|
+
role: appRoleSchema.optional(),
|
|
82078
|
+
/** On a pin: the page the tab opens on; absent keeps the pin's page, `/` the first page. */
|
|
82079
|
+
path: appPinPathSchema.optional()
|
|
81975
82080
|
});
|
|
81976
82081
|
var channelPinsByKeyInputSchemaDefinition = channelPinsInputSchemaDefinition.omit({
|
|
81977
82082
|
workspaceId: true
|
|
@@ -84319,7 +84424,7 @@ var appManageCommands = {
|
|
|
84319
84424
|
|
|
84320
84425
|
// src/services/app-pin-commands.service.ts
|
|
84321
84426
|
var USAGE5 = `Usage:
|
|
84322
|
-
laze app pin [app] --channel <c> [--role builder|editor|viewer | --view-only]
|
|
84427
|
+
laze app pin [app] --channel <c> [--role builder|editor|viewer | --view-only] [--path <page>]
|
|
84323
84428
|
laze app unpin [app] --channel <c>
|
|
84324
84429
|
laze app pins <channel> [--order <app,app,...>]`;
|
|
84325
84430
|
function print3({
|
|
@@ -84343,6 +84448,20 @@ function pinRoleOf(args) {
|
|
|
84343
84448
|
if (word3 === "builder" || word3 === "editor" || word3 === "viewer") return word3;
|
|
84344
84449
|
throw new CliUsageError("The pin's role is builder, editor or viewer");
|
|
84345
84450
|
}
|
|
84451
|
+
function pinPathOf(args) {
|
|
84452
|
+
const word3 = flagText({ args, name: "path" }).trim();
|
|
84453
|
+
if (!word3) return void 0;
|
|
84454
|
+
if (word3.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(word3)) {
|
|
84455
|
+
throw new CliUsageError(
|
|
84456
|
+
"--path is the page relative to the app: for https://<app>.lazeapps.com/#failed-payments use --path /#failed-payments"
|
|
84457
|
+
);
|
|
84458
|
+
}
|
|
84459
|
+
const parsed = appPinPathSchema.safeParse(word3.startsWith("/") ? word3 : `/${word3}`);
|
|
84460
|
+
if (!parsed.success) {
|
|
84461
|
+
throw new CliUsageError(parsed.error.issues[0]?.message ?? "That is not a page of the app");
|
|
84462
|
+
}
|
|
84463
|
+
return parsed.data;
|
|
84464
|
+
}
|
|
84346
84465
|
function readLineOf(pin) {
|
|
84347
84466
|
if (pin.kind === "browser") return ` read it: laze browser read ${pin.appId}
|
|
84348
84467
|
`;
|
|
@@ -84353,13 +84472,19 @@ function readLineOf(pin) {
|
|
|
84353
84472
|
return ` read it: laze app pull --app ${pin.appId} (its files), laze app records list <collection> --app ${pin.appId} (its data)
|
|
84354
84473
|
`;
|
|
84355
84474
|
}
|
|
84475
|
+
function pageLineOf({ listed, appId }) {
|
|
84476
|
+
const pin = listed.pins.find((each) => each.appId === appId && each.kind === "app");
|
|
84477
|
+
if (!pin) return "";
|
|
84478
|
+
return pin.path ? `The tab opens on ${pin.path}.
|
|
84479
|
+
` : "The tab opens on the app's first page.\n";
|
|
84480
|
+
}
|
|
84356
84481
|
function pinsText({ channel, listed }) {
|
|
84357
84482
|
if (listed.pins.length === 0) {
|
|
84358
84483
|
return `No apps are pinned to ${channel}. laze app pin --channel ${channel} pins one.
|
|
84359
84484
|
`;
|
|
84360
84485
|
}
|
|
84361
84486
|
const lines2 = listed.pins.map(
|
|
84362
|
-
(pin) => `${pin.name} ${pin.appId} pinned by ${pin.pinnedByName ?? pin.pinnedBy.id} ${pin.pinnedAt.slice(0, 10)}
|
|
84487
|
+
(pin) => `${pin.name} ${pin.appId} pinned by ${pin.pinnedByName ?? pin.pinnedBy.id} ${pin.pinnedAt.slice(0, 10)}${pin.path ? ` opens on ${pin.path}` : ""}
|
|
84363
84488
|
` + readLineOf(pin)
|
|
84364
84489
|
);
|
|
84365
84490
|
return `Pinned to ${channel}:
|
|
@@ -84374,10 +84499,12 @@ async function appPinCommand({
|
|
|
84374
84499
|
const channel = flagText({ args, name: "channel" });
|
|
84375
84500
|
const { client, appId, name: name3 } = await open7();
|
|
84376
84501
|
const role2 = verb === "pin" ? pinRoleOf(args) : void 0;
|
|
84502
|
+
const path = verb === "pin" ? pinPathOf(args) : void 0;
|
|
84377
84503
|
const listed = await client.post(`/api/apps/${verb}`, {
|
|
84378
84504
|
appId,
|
|
84379
84505
|
...channel ? { channel } : {},
|
|
84380
|
-
...role2 ? { role: role2 } : {}
|
|
84506
|
+
...role2 ? { role: role2 } : {},
|
|
84507
|
+
...path ? { path } : {}
|
|
84381
84508
|
});
|
|
84382
84509
|
const where = channel || "this conversation";
|
|
84383
84510
|
const may = PIN_MAY[role2 ?? "builder"];
|
|
@@ -84386,7 +84513,7 @@ async function appPinCommand({
|
|
|
84386
84513
|
args,
|
|
84387
84514
|
value: listed,
|
|
84388
84515
|
text: verb === "pin" ? `Pinned ${name3} to ${where}: everyone in it and their agents see the tab and ${may}.
|
|
84389
|
-
` : `Unpinned ${name3} from ${where}. The app and its data stay.
|
|
84516
|
+
` + pageLineOf({ listed, appId }) : `Unpinned ${name3} from ${where}. The app and its data stay.
|
|
84390
84517
|
`
|
|
84391
84518
|
});
|
|
84392
84519
|
}
|
|
@@ -87121,31 +87248,6 @@ function notifyLine({
|
|
|
87121
87248
|
`;
|
|
87122
87249
|
}
|
|
87123
87250
|
|
|
87124
|
-
// src/rules/channel-mute.rules.ts
|
|
87125
|
-
var DURATION = /^(\d+)\s*(m|min|mins|minutes?|h|hours?|d|days?)$/i;
|
|
87126
|
-
function minutesOf({ text: text3 }) {
|
|
87127
|
-
const match = DURATION.exec(text3.trim());
|
|
87128
|
-
if (!match?.[1] || !match[2]) return null;
|
|
87129
|
-
const count10 = Number(match[1]);
|
|
87130
|
-
const unit = match[2].toLowerCase()[0];
|
|
87131
|
-
const perUnit = { d: 1440, h: 60, m: 1 };
|
|
87132
|
-
const minutes = count10 * (perUnit[unit ?? "m"] ?? 1);
|
|
87133
|
-
return minutes > 0 ? minutes : null;
|
|
87134
|
-
}
|
|
87135
|
-
function muteTextOf({ mute }) {
|
|
87136
|
-
return `muted${mute.until ? ` until ${mute.until}` : ""}: ${mute.reason}`;
|
|
87137
|
-
}
|
|
87138
|
-
function settingTextOf({ channel }) {
|
|
87139
|
-
const level2 = channel.level === "everything" ? "Everything" : "Mentions only";
|
|
87140
|
-
const isDefault = channel.isDefault ? " default agent" : "";
|
|
87141
|
-
const mute = channel.mute ? ` ${muteTextOf({ mute: channel.mute })}` : "";
|
|
87142
|
-
return `${level2}${isDefault}${mute}`;
|
|
87143
|
-
}
|
|
87144
|
-
function settingRowOf({ channel }) {
|
|
87145
|
-
return `#${channel.name} ${settingTextOf({ channel })}
|
|
87146
|
-
`;
|
|
87147
|
-
}
|
|
87148
|
-
|
|
87149
87251
|
// src/services/channel-admin-commands.service.ts
|
|
87150
87252
|
var AGENT_HINT = "Roles, archiving and removing others are a channel admin's change: ask one.\n";
|
|
87151
87253
|
var ROLES2 = ["admin", "member"];
|
|
@@ -87576,7 +87678,6 @@ async function channelHide({ context, args }) {
|
|
|
87576
87678
|
// src/services/channel-mute-commands.service.ts
|
|
87577
87679
|
var MUTE_USAGE = 'Usage: laze channel mute <channel> --reason "<why>" [--for 30m|2h|1d]';
|
|
87578
87680
|
var UNMUTE_USAGE = "Usage: laze channel unmute <channel>";
|
|
87579
|
-
var isChannel = (channel) => channel.kind === "public" || channel.kind === "private";
|
|
87580
87681
|
async function channelMute({ context, args }) {
|
|
87581
87682
|
const channel = args.words[2];
|
|
87582
87683
|
if (!channel) throw new CliUsageError(MUTE_USAGE);
|
|
@@ -87592,8 +87693,10 @@ async function channelMute({ context, args }) {
|
|
|
87592
87693
|
if (args.flags.json) return context.out(`${JSON.stringify(muted, null, 2)}
|
|
87593
87694
|
`);
|
|
87594
87695
|
const mute = muted.mute ? ` ${muteTextOf({ mute: muted.mute })}` : "";
|
|
87595
|
-
context.out(
|
|
87596
|
-
|
|
87696
|
+
context.out(
|
|
87697
|
+
`${placeOf({ channel: muted })}${mute}. A mention, a DM or your threads still reach you.
|
|
87698
|
+
`
|
|
87699
|
+
);
|
|
87597
87700
|
}
|
|
87598
87701
|
async function channelUnmute({ context, args }) {
|
|
87599
87702
|
const channel = args.words[2];
|
|
@@ -87603,17 +87706,21 @@ async function channelUnmute({ context, args }) {
|
|
|
87603
87706
|
if (args.flags.json) return context.out(`${JSON.stringify(unmuted, null, 2)}
|
|
87604
87707
|
`);
|
|
87605
87708
|
const level2 = unmuted.level === "everything" ? "Everything" : "Mentions only";
|
|
87606
|
-
context.out(
|
|
87709
|
+
context.out(`${placeOf({ channel: unmuted })} is unmuted, on ${level2}.
|
|
87607
87710
|
`);
|
|
87608
87711
|
}
|
|
87609
87712
|
async function channelSettings({ context, args }) {
|
|
87610
87713
|
const wanted = args.words[2]?.trim();
|
|
87611
87714
|
const { client } = await signedIn({ context, args });
|
|
87612
|
-
const channels3 = (await client.get("/api/agents/me/channels")).filter(
|
|
87715
|
+
const channels3 = (await client.get("/api/agents/me/channels")).filter(
|
|
87716
|
+
(channel) => hasSettingIn({ channel })
|
|
87717
|
+
);
|
|
87613
87718
|
const name3 = wanted?.replace(/^#/, "").toLowerCase();
|
|
87614
87719
|
const shown2 = wanted ? channels3.filter((channel) => channel.id === wanted || channel.name === name3) : channels3;
|
|
87615
87720
|
if (wanted && shown2.length === 0) {
|
|
87616
|
-
throw new CliUsageError(
|
|
87721
|
+
throw new CliUsageError(
|
|
87722
|
+
`${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.`
|
|
87723
|
+
);
|
|
87617
87724
|
}
|
|
87618
87725
|
if (args.flags.json) {
|
|
87619
87726
|
const value = wanted ? shown2[0] : shown2;
|
|
@@ -90746,6 +90853,47 @@ var whatsappMirrorHealthDefinition = external_exports.object({
|
|
|
90746
90853
|
)
|
|
90747
90854
|
});
|
|
90748
90855
|
var whatsappMirrorHealthSchema = whatsappMirrorHealthDefinition;
|
|
90856
|
+
var WHATSAPP_SEND_KINDS = ["reply", "edit", "revoke", "react", "read", "agent"];
|
|
90857
|
+
var WHATSAPP_SEND_BLOCK_REASONS = [
|
|
90858
|
+
"not_linked",
|
|
90859
|
+
"chat_form",
|
|
90860
|
+
"chat_device",
|
|
90861
|
+
"chat_kind_broadcast",
|
|
90862
|
+
"chat_kind_newsletter",
|
|
90863
|
+
"chat_kind_bot",
|
|
90864
|
+
"chat_kind_other",
|
|
90865
|
+
"own_chat_only"
|
|
90866
|
+
];
|
|
90867
|
+
var whatsappSendsDefinition = external_exports.object({
|
|
90868
|
+
/** Newest first. */
|
|
90869
|
+
sends: external_exports.array(
|
|
90870
|
+
external_exports.object({
|
|
90871
|
+
/** The send's own id: for a reply it carries the Laze message id, never WhatsApp's. */
|
|
90872
|
+
id: external_exports.string(),
|
|
90873
|
+
machineId: external_exports.string(),
|
|
90874
|
+
kind: external_exports.enum(WHATSAPP_SEND_KINDS),
|
|
90875
|
+
state: external_exports.string(),
|
|
90876
|
+
/** Whether it quoted a message, and how many files it carried. */
|
|
90877
|
+
quoted: external_exports.boolean(),
|
|
90878
|
+
/** Sends to the same chat share a number, counted from 1 in this answer; never the chat. */
|
|
90879
|
+
chatIndex: external_exports.number().int().min(1),
|
|
90880
|
+
files: count8,
|
|
90881
|
+
/**
|
|
90882
|
+
* Why a failed send did not go: its stored code, or for older sends the code its outcome
|
|
90883
|
+
* line reads as; "other" when none fits, null for a send that did not fail.
|
|
90884
|
+
*/
|
|
90885
|
+
failureCode: external_exports.string().nullable(),
|
|
90886
|
+
/** For a refused or unknown failure, the error number WhatsApp's server gave, if any. */
|
|
90887
|
+
serverErrorCode: external_exports.number().int().nullable(),
|
|
90888
|
+
/** For a blocked send, the computer's allow-list rule that refused it, when it named one. */
|
|
90889
|
+
blockedBy: external_exports.enum(WHATSAPP_SEND_BLOCK_REASONS).nullable(),
|
|
90890
|
+
createdAt: at2,
|
|
90891
|
+
claimedAt: at2.nullable(),
|
|
90892
|
+
sentAt: at2.nullable()
|
|
90893
|
+
})
|
|
90894
|
+
)
|
|
90895
|
+
});
|
|
90896
|
+
var whatsappSendsSchema = whatsappSendsDefinition;
|
|
90749
90897
|
var WHATSAPP_WAKE_STEPS = [
|
|
90750
90898
|
"requested",
|
|
90751
90899
|
"vmRunning",
|
|
@@ -95582,6 +95730,31 @@ function feedFlagsOf({ args }) {
|
|
|
95582
95730
|
return { fields: { ...fields, ...snoozeOf(args) }, texts, ...rich ? { rich } : {} };
|
|
95583
95731
|
}
|
|
95584
95732
|
|
|
95733
|
+
// src/rules/feed-thread-format.rules.ts
|
|
95734
|
+
function whenOf(entry2) {
|
|
95735
|
+
return `${entry2.createdAt.slice(0, 16).replace("T", " ")} UTC`;
|
|
95736
|
+
}
|
|
95737
|
+
function lineOf4({ item, entry: entry2 }) {
|
|
95738
|
+
const own2 = item.author.kind === "agent" && entry2.author.id === item.author.id;
|
|
95739
|
+
const who = own2 ? `You (${entry2.author.name})` : entry2.author.name;
|
|
95740
|
+
const said = entry2.kind === "action" ? `pressed ${entry2.body}` : entry2.body;
|
|
95741
|
+
const [first = "", ...rest] = said.split("\n");
|
|
95742
|
+
return [` ${who}, ${whenOf(entry2)}: ${first}`, ...rest.map((line) => ` ${line}`)].join("\n");
|
|
95743
|
+
}
|
|
95744
|
+
function feedReadLinesOf(read4) {
|
|
95745
|
+
const { item } = read4;
|
|
95746
|
+
const parts = [];
|
|
95747
|
+
if (item.summary) parts.push(`Hint: ${item.summary}`);
|
|
95748
|
+
if (item.body) parts.push(`Body:
|
|
95749
|
+
${item.body}`);
|
|
95750
|
+
const entries = item.entries.toSorted((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
95751
|
+
parts.push(
|
|
95752
|
+
entries.length === 0 ? "Thread: no comments yet." : ["Thread, oldest first:", ...entries.map((entry2) => lineOf4({ item, entry: entry2 }))].join("\n")
|
|
95753
|
+
);
|
|
95754
|
+
return `${parts.join("\n")}
|
|
95755
|
+
`;
|
|
95756
|
+
}
|
|
95757
|
+
|
|
95585
95758
|
// src/services/feed-files.service.ts
|
|
95586
95759
|
async function directWith({ client, to }) {
|
|
95587
95760
|
const me = await client.get("/api/agents/me");
|
|
@@ -95851,9 +96024,11 @@ async function feedRead({ context, args }) {
|
|
|
95851
96024
|
const { client } = await signedIn({ context, args });
|
|
95852
96025
|
const read4 = await client.post("/api/feed/items/read", { itemId });
|
|
95853
96026
|
printItem({ context, args, item: read4 });
|
|
95854
|
-
if (
|
|
96027
|
+
if (args.flags.json) return;
|
|
96028
|
+
if (read4.item.draft) context.out(`Draft:
|
|
95855
96029
|
${read4.item.draft}
|
|
95856
96030
|
`);
|
|
96031
|
+
context.out(feedReadLinesOf(read4));
|
|
95857
96032
|
}
|
|
95858
96033
|
async function feedInbox({ context, args }) {
|
|
95859
96034
|
const { client } = await signedIn({ context, args });
|
|
@@ -100680,6 +100855,27 @@ var tenantEventsOutputDefinition = external_exports.object({
|
|
|
100680
100855
|
external_exports.object({ at: external_exports.iso.datetime(), aggregateType: external_exports.string(), eventType: external_exports.string() })
|
|
100681
100856
|
)
|
|
100682
100857
|
});
|
|
100858
|
+
var agentTimelineInputDefinition = external_exports.object({
|
|
100859
|
+
agentId: external_exports.string().trim().min(1).max(128),
|
|
100860
|
+
from: external_exports.iso.datetime(),
|
|
100861
|
+
to: external_exports.iso.datetime(),
|
|
100862
|
+
limit: external_exports.number().int().min(1).max(500).default(200),
|
|
100863
|
+
cursor: cursorDefinition.optional()
|
|
100864
|
+
}).strict();
|
|
100865
|
+
var agentTimelineOutputDefinition = external_exports.object({
|
|
100866
|
+
/**
|
|
100867
|
+
* Oldest first: the agent's own events and its sessions' events, with a session event's kind
|
|
100868
|
+
* (turn_started, compaction_started, stalled...) and channel id; never a payload or text.
|
|
100869
|
+
*/
|
|
100870
|
+
events: pageOf(
|
|
100871
|
+
external_exports.object({
|
|
100872
|
+
at: external_exports.iso.datetime(),
|
|
100873
|
+
eventType: external_exports.string(),
|
|
100874
|
+
sessionEvent: external_exports.string().nullable(),
|
|
100875
|
+
channelId: external_exports.string().nullable()
|
|
100876
|
+
})
|
|
100877
|
+
)
|
|
100878
|
+
});
|
|
100683
100879
|
var databaseHealthInputDefinition = external_exports.object({
|
|
100684
100880
|
limit: external_exports.number().int().min(1).max(100).default(15),
|
|
100685
100881
|
cursor: cursorDefinition.optional()
|
|
@@ -100837,9 +101033,22 @@ var tenantWhatsappOutputDefinition = external_exports.object({
|
|
|
100837
101033
|
since: external_exports.iso.datetime(),
|
|
100838
101034
|
until: external_exports.iso.datetime(),
|
|
100839
101035
|
total: count9,
|
|
100840
|
-
byKind: external_exports.array(
|
|
101036
|
+
byKind: external_exports.array(
|
|
101037
|
+
external_exports.object({
|
|
101038
|
+
kind: external_exports.enum([...WHATSAPP_INTAKE_KEY_KINDS, "other"]),
|
|
101039
|
+
count: count9,
|
|
101040
|
+
/** Events dated over a second after Laze got them, and the most ahead: a fast clock. */
|
|
101041
|
+
aheadOfLaze: external_exports.object({ count: count9, maxAheadMs: external_exports.number().int() }).optional()
|
|
101042
|
+
})
|
|
101043
|
+
),
|
|
101044
|
+
/** The workspace's chat messages and changes dated over a second after Laze stored them. */
|
|
101045
|
+
chatAheadOfLaze: external_exports.object({ count: count9, maxAheadMs: external_exports.number().int() }).optional()
|
|
100841
101046
|
})
|
|
100842
101047
|
});
|
|
101048
|
+
var whatsappSendsInputDefinition = external_exports.object({
|
|
101049
|
+
since: external_exports.iso.datetime(),
|
|
101050
|
+
limit: external_exports.number().int().min(1).max(100).default(20)
|
|
101051
|
+
}).strict();
|
|
100843
101052
|
var wakeTimelineInputDefinition = external_exports.object({
|
|
100844
101053
|
userId: external_exports.string().trim().min(1).max(64).optional(),
|
|
100845
101054
|
limit: external_exports.number().int().min(1).max(50).default(10)
|
|
@@ -100942,6 +101151,13 @@ var OPS_FUNCTIONS = {
|
|
|
100942
101151
|
input: tenantEventsInputDefinition,
|
|
100943
101152
|
output: tenantEventsOutputDefinition
|
|
100944
101153
|
}),
|
|
101154
|
+
"tenant.agent_timeline": entry({
|
|
101155
|
+
title: "One agent's events and session events over at most a day, with kinds and times",
|
|
101156
|
+
scope: "tenant",
|
|
101157
|
+
view: "table",
|
|
101158
|
+
input: agentTimelineInputDefinition,
|
|
101159
|
+
output: agentTimelineOutputDefinition
|
|
101160
|
+
}),
|
|
100945
101161
|
"db.health": entry({
|
|
100946
101162
|
title: "Postgres size, connections, waits, cache and the largest tables",
|
|
100947
101163
|
scope: "platform",
|
|
@@ -101013,6 +101229,13 @@ var OPS_FUNCTIONS = {
|
|
|
101013
101229
|
input: vaultAsksInputDefinition,
|
|
101014
101230
|
output: vaultAsksOutputDefinition
|
|
101015
101231
|
}),
|
|
101232
|
+
"tenant.whatsapp_sends": entry({
|
|
101233
|
+
title: "One workspace's last WhatsApp sends: state, failure code and times, no content",
|
|
101234
|
+
scope: "tenant",
|
|
101235
|
+
view: "table",
|
|
101236
|
+
input: whatsappSendsInputDefinition,
|
|
101237
|
+
output: whatsappSendsSchema
|
|
101238
|
+
}),
|
|
101016
101239
|
"computers.wake_timeline": entry({
|
|
101017
101240
|
title: "One workspace's last WhatsApp wakes per computer, with each step's time",
|
|
101018
101241
|
scope: "tenant",
|
|
@@ -101833,6 +102056,9 @@ var SLACK_USAGE = `Usage (a person's key; Slack stays the source, the bot joins
|
|
|
101833
102056
|
laze slack dismiss-link-prompt connect|relink no thanks: stop asking here
|
|
101834
102057
|
laze slack people [name] people in your linked Slack, to message
|
|
101835
102058
|
laze slack dm <teamId> <slackUserId> start a Slack DM as yourself
|
|
102059
|
+
laze slack post <channelId> <text> [--thread <messageId>]
|
|
102060
|
+
an agent posts in its owner's Slack mirror as the owner, in a turn the owner started;
|
|
102061
|
+
the text from stdin when none is given. Read Slack with laze history, search and thread
|
|
101836
102062
|
laze slack profiles <slack:T:U>... Slack status, title and time zone of authors
|
|
101837
102063
|
laze slack bookmarks <channelId> a mirrored Slack channel's bookmarks
|
|
101838
102064
|
laze slack link <teamId> prints the link that links your own Slack
|
|
@@ -101972,6 +102198,19 @@ var bookmarks = async ({ context, args, client }) => {
|
|
|
101972
102198
|
for (const each of answer6.bookmarks) context.out(`${each.title} ${each.link}
|
|
101973
102199
|
`);
|
|
101974
102200
|
};
|
|
102201
|
+
var post2 = async ({ context, args, client }) => {
|
|
102202
|
+
const given = args.words.slice(3).join(" ").trim();
|
|
102203
|
+
const text3 = given || (await context.readStdin()).trim();
|
|
102204
|
+
if (!text3) throw new CliUsageError(SLACK_USAGE);
|
|
102205
|
+
const posted = await client.post(SLACK_OWNER_POST_PATH, {
|
|
102206
|
+
channelId: wordAt9(args, 2),
|
|
102207
|
+
text: text3,
|
|
102208
|
+
threadRootId: flagText({ args, name: "thread" }) || null
|
|
102209
|
+
});
|
|
102210
|
+
if (json5({ context, args, data: posted })) return;
|
|
102211
|
+
context.out(`Posted as your owner: ${posted.messageId} in ${posted.channelId}
|
|
102212
|
+
`);
|
|
102213
|
+
};
|
|
101975
102214
|
var dm = async ({ context, args, client }) => {
|
|
101976
102215
|
const opened = await client.post(SLACK_KEY_PATHS.direct, {
|
|
101977
102216
|
teamId: wordAt9(args, 2),
|
|
@@ -102140,6 +102379,7 @@ var RUNS6 = {
|
|
|
102140
102379
|
profiles,
|
|
102141
102380
|
bookmarks,
|
|
102142
102381
|
dm,
|
|
102382
|
+
post: post2,
|
|
102143
102383
|
link: authorizeRun2(SLACK_KEY_PATHS.link, "Open this link to link your Slack account", teamOf),
|
|
102144
102384
|
unlink: connectionRun2(SLACK_KEY_PATHS.unlink, teamOf),
|
|
102145
102385
|
install: authorizeRun2(
|
|
@@ -102631,7 +102871,7 @@ function bareLineOf({ line, where }) {
|
|
|
102631
102871
|
if (VARIABLE.test(line)) return { kind: "field", variable: line, ref: line };
|
|
102632
102872
|
throw new CliUsageError(`${where}: not a name: ${line}`);
|
|
102633
102873
|
}
|
|
102634
|
-
function
|
|
102874
|
+
function lineOf5({ line, where }) {
|
|
102635
102875
|
const at4 = line.indexOf("=");
|
|
102636
102876
|
if (at4 === -1) return bareLineOf({ line, where });
|
|
102637
102877
|
const variable = line.slice(0, at4).trim();
|
|
@@ -102648,7 +102888,7 @@ function parseManifest({ text: text3, file: file4 }) {
|
|
|
102648
102888
|
for (const [index, raw] of text3.split(/\r?\n/).entries()) {
|
|
102649
102889
|
const line = raw.trim().replace(/^export\s+/, "");
|
|
102650
102890
|
if (!line || line.startsWith("#")) continue;
|
|
102651
|
-
lines2.push(
|
|
102891
|
+
lines2.push(lineOf5({ line, where: `${file4}:${index + 1}` }));
|
|
102652
102892
|
}
|
|
102653
102893
|
return lines2;
|
|
102654
102894
|
}
|
|
@@ -103258,7 +103498,7 @@ async function vaultSave({ context, args }) {
|
|
|
103258
103498
|
}
|
|
103259
103499
|
|
|
103260
103500
|
// src/services/vault-scrub-commands.service.ts
|
|
103261
|
-
function
|
|
103501
|
+
function lineOf6(channel) {
|
|
103262
103502
|
const where = channel.name ? `#${channel.name}` : channel.channelId;
|
|
103263
103503
|
const found = Object.entries(channel.found).map(([vendor, count10]) => `${vendor} ${count10}`).join(", ");
|
|
103264
103504
|
const kinds = [`held ${channel.held}`, ...found ? [`found: ${found}`] : []].join("; ");
|
|
@@ -103272,7 +103512,7 @@ async function vaultScrub({ context, args }) {
|
|
|
103272
103512
|
if (args.flags.json) return context.out(`${JSON.stringify(report3, null, 2)}
|
|
103273
103513
|
`);
|
|
103274
103514
|
const changed = report3.channels.filter((channel) => channel.messages > 0);
|
|
103275
|
-
for (const channel of changed) context.out(
|
|
103515
|
+
for (const channel of changed) context.out(lineOf6(channel));
|
|
103276
103516
|
const total = changed.reduce((sum, channel) => sum + channel.messages, 0);
|
|
103277
103517
|
context.out(
|
|
103278
103518
|
report3.dryRun ? `Dry run: ${total} message(s) would change. Nothing was changed.
|
|
@@ -104361,10 +104601,10 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
104361
104601
|
laze groups rename <group> <name> | delete <group> rename one, or delete it and take back what it shared (admins)
|
|
104362
104602
|
laze groups add|remove <group> --person <member>.. change who is in it (admins)
|
|
104363
104603
|
laze channels list the conversations you are in, with your setting
|
|
104364
|
-
laze channel set <channel> everything|mentions what of a channel reaches your agent
|
|
104365
|
-
laze channel mute <channel> --reason "<why>" [--for 30m|2h|1d] stop hearing a noisy channel unless named (agents)
|
|
104366
|
-
laze channel unmute <channel> hear the channel on your setting again (agents)
|
|
104367
|
-
laze channel settings [<channel>] [--json] each channel's setting and mute (agents)
|
|
104604
|
+
laze channel set <channel> everything|mentions what of a channel or shared conversation (3+ members, by id) reaches your agent
|
|
104605
|
+
laze channel mute <channel> --reason "<why>" [--for 30m|2h|1d] stop hearing a noisy channel or conversation unless named (agents)
|
|
104606
|
+
laze channel unmute <channel> hear the channel or conversation on your setting again (agents)
|
|
104607
|
+
laze channel settings [<channel>] [--json] each channel's and shared conversation's setting and mute; a 1:1 DM always reaches you (agents)
|
|
104368
104608
|
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)
|
|
104369
104609
|
laze monitor list | pause | resume | rm <name> [--json] the agent's monitors
|
|
104370
104610
|
laze channel members <channel> its people and agents, each an Admin or a Member
|
|
@@ -104448,7 +104688,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
104448
104688
|
laze app create <name> ... build an app from scratch (--template slides for a deck), push, revert
|
|
104449
104689
|
apps are also called artifacts: asked for an artifact, page, dashboard, deck or mock, build a Laze app
|
|
104450
104690
|
laze app open|screenshot [file] look at your app in a browser tab, signed in as you, view only
|
|
104451
|
-
laze app pin <app> --channel <c>
|
|
104691
|
+
laze app pin <app> --channel <c> [--path /#x] put an app in a conversation as a tab (not laze message pin)
|
|
104452
104692
|
laze app every laze app command, with its flags
|
|
104453
104693
|
laze agents list | laze agents status <name> the workspace's agents and their context
|
|
104454
104694
|
laze agents show <name> [--json] an agent's profile: kind, how it runs, intelligence
|
package/package.json
CHANGED