@lazehq/cli 0.1.7 → 0.1.9
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 +430 -174
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -96,9 +96,9 @@ var require_node_gyp_build = __commonJS({
|
|
|
96
96
|
var debug = getFirst(path.join(dir, "build/Debug"), matchBuild);
|
|
97
97
|
if (debug) return debug;
|
|
98
98
|
}
|
|
99
|
-
var prebuild =
|
|
99
|
+
var prebuild = resolve15(dir);
|
|
100
100
|
if (prebuild) return prebuild;
|
|
101
|
-
var nearby =
|
|
101
|
+
var nearby = resolve15(path.dirname(process.execPath));
|
|
102
102
|
if (nearby) return nearby;
|
|
103
103
|
var target = [
|
|
104
104
|
"platform=" + platform,
|
|
@@ -114,7 +114,7 @@ var require_node_gyp_build = __commonJS({
|
|
|
114
114
|
// eslint-disable-line
|
|
115
115
|
].filter(Boolean).join(" ");
|
|
116
116
|
throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
|
|
117
|
-
function
|
|
117
|
+
function resolve15(dir2) {
|
|
118
118
|
var tuples = readdirSync(path.join(dir2, "prebuilds")).map(parseTuple);
|
|
119
119
|
var tuple2 = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];
|
|
120
120
|
if (!tuple2) return;
|
|
@@ -4541,7 +4541,7 @@ function runRedacted({
|
|
|
4541
4541
|
cwd
|
|
4542
4542
|
}) {
|
|
4543
4543
|
const values = Object.values(env);
|
|
4544
|
-
return new Promise((
|
|
4544
|
+
return new Promise((resolve15, reject) => {
|
|
4545
4545
|
const [file3, ...args] = command;
|
|
4546
4546
|
const child = spawn(file3, args, {
|
|
4547
4547
|
env: { ...baseEnv, ...env },
|
|
@@ -4562,7 +4562,7 @@ function runRedacted({
|
|
|
4562
4562
|
const drained = Promise.all([pipe2(child.stdout, stdout2), pipe2(child.stderr, stderr2)]);
|
|
4563
4563
|
child.on("error", reject);
|
|
4564
4564
|
child.on("close", (code, signal) => {
|
|
4565
|
-
void drained.then(() =>
|
|
4565
|
+
void drained.then(() => resolve15(code ?? (signal ? 128 + signalNumber(signal) : 1)));
|
|
4566
4566
|
});
|
|
4567
4567
|
});
|
|
4568
4568
|
}
|
|
@@ -8604,7 +8604,7 @@ function flagText({
|
|
|
8604
8604
|
}
|
|
8605
8605
|
|
|
8606
8606
|
// src/rules/cli-version.rules.ts
|
|
8607
|
-
var STAMPED = "0.1.
|
|
8607
|
+
var STAMPED = "0.1.9";
|
|
8608
8608
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
8609
8609
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
8610
8610
|
}
|
|
@@ -13643,7 +13643,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
|
|
|
13643
13643
|
var NONE = 0;
|
|
13644
13644
|
var ASSUMED = 1;
|
|
13645
13645
|
var PROVEN = 2;
|
|
13646
|
-
function isRecursive(inst, stack,
|
|
13646
|
+
function isRecursive(inst, stack, resolve15) {
|
|
13647
13647
|
const cached2 = recursive.get(inst);
|
|
13648
13648
|
if (cached2 !== void 0)
|
|
13649
13649
|
return cached2 ? PROVEN : NONE;
|
|
@@ -13653,7 +13653,7 @@ function isRecursive(inst, stack, resolve14) {
|
|
|
13653
13653
|
let result = NONE;
|
|
13654
13654
|
const check3 = (child) => {
|
|
13655
13655
|
if (result !== PROVEN && child?._zod) {
|
|
13656
|
-
const answer4 = isRecursive(child, stack,
|
|
13656
|
+
const answer4 = isRecursive(child, stack, resolve15);
|
|
13657
13657
|
if (answer4 > result)
|
|
13658
13658
|
result = answer4;
|
|
13659
13659
|
}
|
|
@@ -13664,7 +13664,7 @@ function isRecursive(inst, stack, resolve14) {
|
|
|
13664
13664
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
13665
13665
|
if (spread && !desc.enumerable)
|
|
13666
13666
|
continue;
|
|
13667
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
13667
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve15) : NONE;
|
|
13668
13668
|
if (child > answer4)
|
|
13669
13669
|
answer4 = child;
|
|
13670
13670
|
}
|
|
@@ -13728,7 +13728,7 @@ function isRecursive(inst, stack, resolve14) {
|
|
|
13728
13728
|
break;
|
|
13729
13729
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
13730
13730
|
case "lazy": {
|
|
13731
|
-
const inner = def._cachedInner ?? (
|
|
13731
|
+
const inner = def._cachedInner ?? (resolve15 ? inst._zod.innerType : void 0);
|
|
13732
13732
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
13733
13733
|
break;
|
|
13734
13734
|
}
|
|
@@ -30436,6 +30436,7 @@ var FEATURE_NAMES = [
|
|
|
30436
30436
|
"notification",
|
|
30437
30437
|
"onboarding",
|
|
30438
30438
|
"openclaw",
|
|
30439
|
+
"ops",
|
|
30439
30440
|
"role",
|
|
30440
30441
|
"schedule",
|
|
30441
30442
|
"skill",
|
|
@@ -31100,13 +31101,24 @@ var loginCardSchemaDefinition = external_exports.object({
|
|
|
31100
31101
|
/** What happened, once settled: "Back on Personal. Sam switched me." */
|
|
31101
31102
|
outcome: external_exports.string().max(400)
|
|
31102
31103
|
});
|
|
31104
|
+
var heldCardStateSchema = external_exports.enum(["held", "running", "cancelled"]);
|
|
31105
|
+
var heldCardSchemaDefinition = external_exports.object({
|
|
31106
|
+
type: external_exports.literal("held"),
|
|
31107
|
+
agentId: idSchema4,
|
|
31108
|
+
/** The waiting message. */
|
|
31109
|
+
messageId: idSchema4,
|
|
31110
|
+
/** Who sent it; they may cancel it, and so may the agent's owner. */
|
|
31111
|
+
senderId: idSchema4,
|
|
31112
|
+
state: heldCardStateSchema
|
|
31113
|
+
});
|
|
31103
31114
|
var messageCardSchemaDefinition = external_exports.discriminatedUnion("type", [
|
|
31104
31115
|
attentionCardSchemaDefinition,
|
|
31105
31116
|
connectCardSchemaDefinition,
|
|
31106
31117
|
appCardSchemaDefinition,
|
|
31107
31118
|
computerCardSchemaDefinition,
|
|
31108
31119
|
muteCardSchemaDefinition,
|
|
31109
|
-
loginCardSchemaDefinition
|
|
31120
|
+
loginCardSchemaDefinition,
|
|
31121
|
+
heldCardSchemaDefinition
|
|
31110
31122
|
]);
|
|
31111
31123
|
var messageRefSchemaDefinition = external_exports.object({
|
|
31112
31124
|
/** `conversation` points at a conversation with the agent, by its channel. */
|
|
@@ -31124,6 +31136,11 @@ var messageMembershipSchemaDefinition = external_exports.object({
|
|
|
31124
31136
|
/** A line under the row, such as what an added agent may read. */
|
|
31125
31137
|
note: external_exports.string().max(500).nullable().default(null)
|
|
31126
31138
|
});
|
|
31139
|
+
var messageCompactionSchemaDefinition = external_exports.object({
|
|
31140
|
+
trigger: external_exports.enum(["auto", "manual", "threshold", "overflow"]),
|
|
31141
|
+
tokensBefore: external_exports.number().int().nonnegative().nullable().default(null),
|
|
31142
|
+
tokensAfter: external_exports.number().int().nonnegative().nullable().default(null)
|
|
31143
|
+
});
|
|
31127
31144
|
var messagePinSchemaDefinition = external_exports.object({
|
|
31128
31145
|
by: chatActorSchemaDefinition,
|
|
31129
31146
|
at: external_exports.iso.datetime()
|
|
@@ -31156,6 +31173,8 @@ var messageSchemaDefinition = external_exports.object({
|
|
|
31156
31173
|
ref: messageRefSchemaDefinition.nullable().default(null),
|
|
31157
31174
|
/** A join or leave notice's change: drawn as the member's row, never unread. */
|
|
31158
31175
|
membership: messageMembershipSchemaDefinition.nullable().optional(),
|
|
31176
|
+
/** An agent's compaction: drawn as a divider across the conversation, never unread. */
|
|
31177
|
+
compaction: messageCompactionSchemaDefinition.nullable().optional(),
|
|
31159
31178
|
/** The scrubber moved a secret out of the body: shown as "A secret was moved to the vault". */
|
|
31160
31179
|
scrubbed: external_exports.boolean().optional(),
|
|
31161
31180
|
/** Set while the message is pinned to its conversation. */
|
|
@@ -31190,6 +31209,10 @@ var conversationSchemaDefinition = external_exports.object({
|
|
|
31190
31209
|
admins: external_exports.array(chatActorSchemaDefinition).default([]),
|
|
31191
31210
|
/** A temporary channel archives itself then; null for a channel that stays. */
|
|
31192
31211
|
endsAt: external_exports.iso.datetime().nullable().default(null),
|
|
31212
|
+
/** No agent answers unless named there, whatever each agent's setting. */
|
|
31213
|
+
mentionedOnly: external_exports.boolean().optional(),
|
|
31214
|
+
/** The agent that answers messages naming no agent; null when the channel has none. */
|
|
31215
|
+
defaultAgentId: external_exports.string().nullable().optional(),
|
|
31193
31216
|
lastSeq: external_exports.number().int().nonnegative(),
|
|
31194
31217
|
lastMessageAt: external_exports.iso.datetime().nullable(),
|
|
31195
31218
|
createdAt: external_exports.iso.datetime(),
|
|
@@ -31316,9 +31339,17 @@ var updateChannelInputSchemaDefinition = external_exports.object({
|
|
|
31316
31339
|
topic: external_exports.string().trim().max(CHANNEL_TOPIC_MAX).optional(),
|
|
31317
31340
|
description: external_exports.string().trim().max(CHANNEL_DESCRIPTION_MAX).optional(),
|
|
31318
31341
|
/** Makes a public channel private; the creator's or a workspace Admin's change, one way only. */
|
|
31319
|
-
visibility: external_exports.literal("private").optional()
|
|
31342
|
+
visibility: external_exports.literal("private").optional(),
|
|
31343
|
+
/** No agent answers unless named; a channel Admin's or a workspace Admin's change. */
|
|
31344
|
+
mentionedOnly: external_exports.boolean().optional()
|
|
31320
31345
|
});
|
|
31321
31346
|
var updateChannelInputSchema = updateChannelInputSchemaDefinition;
|
|
31347
|
+
var setDefaultAgentInputSchemaDefinition = external_exports.object({
|
|
31348
|
+
workspaceId: workspaceIdSchema,
|
|
31349
|
+
channelId: idSchema4,
|
|
31350
|
+
agentId: external_exports.string().min(1).max(200).nullable()
|
|
31351
|
+
});
|
|
31352
|
+
var setDefaultAgentInputSchema = setDefaultAgentInputSchemaDefinition;
|
|
31322
31353
|
var newMemberSchemaDefinition = external_exports.object({
|
|
31323
31354
|
kind: chatActorKindSchema,
|
|
31324
31355
|
id: idSchema4,
|
|
@@ -31402,7 +31433,9 @@ var openAgentDirectInputSchemaDefinition = external_exports.object({
|
|
|
31402
31433
|
name: external_exports.string().min(1).max(80),
|
|
31403
31434
|
/** Where the agent runs; left out, its other memberships decide. */
|
|
31404
31435
|
runsOutside: external_exports.boolean().optional()
|
|
31405
|
-
})
|
|
31436
|
+
}),
|
|
31437
|
+
/** The name an agent opening the DM joins under; a person keeps their own. */
|
|
31438
|
+
openerName: external_exports.string().trim().min(1).max(80).optional()
|
|
31406
31439
|
});
|
|
31407
31440
|
var agentChatMemberInputSchemaDefinition = external_exports.object({
|
|
31408
31441
|
...openAgentDirectInputSchemaDefinition.shape,
|
|
@@ -31441,6 +31474,8 @@ var postNoticeInputSchemaDefinition = external_exports.object({
|
|
|
31441
31474
|
threadRootId: idSchema4.optional(),
|
|
31442
31475
|
body: external_exports.string().trim().min(1).max(500),
|
|
31443
31476
|
ref: messageRefSchemaDefinition.optional(),
|
|
31477
|
+
/** Set on the notice a compaction leaves, so it draws as a divider. */
|
|
31478
|
+
compaction: messageCompactionSchemaDefinition.optional(),
|
|
31444
31479
|
/** One notice per key: a second post with it answers the first. */
|
|
31445
31480
|
clientKey: external_exports.string().regex(/^[A-Za-z0-9_-]{8,64}$/).optional()
|
|
31446
31481
|
});
|
|
@@ -31591,6 +31626,10 @@ var markAgentRemovedInputSchemaDefinition = external_exports.object({
|
|
|
31591
31626
|
/** When it was removed; now when absent. */
|
|
31592
31627
|
removedAt: external_exports.iso.datetime().optional()
|
|
31593
31628
|
});
|
|
31629
|
+
var signalAppPinsChangedInputSchemaDefinition = external_exports.object({
|
|
31630
|
+
workspaceId: workspaceIdSchema,
|
|
31631
|
+
channelId: idSchema4
|
|
31632
|
+
});
|
|
31594
31633
|
var signalTypingInputSchemaDefinition = external_exports.object({
|
|
31595
31634
|
workspaceId: workspaceIdSchema,
|
|
31596
31635
|
channelId: idSchema4,
|
|
@@ -31973,7 +32012,7 @@ var readableTextInputSchemaDefinition = external_exports.object({
|
|
|
31973
32012
|
bodies: external_exports.array(external_exports.string()).max(HISTORY_PAGE_MAX)
|
|
31974
32013
|
});
|
|
31975
32014
|
var ChatApi = moduleApi()("chat");
|
|
31976
|
-
var chatConversationsTrpc = defineTrpcContract("chat").query("overview").withInput(workspaceInputSchema).withOutput(chatOverviewSchema).query("unreadSummary").withInput(external_exports.object({})).withOutput(external_exports.array(workspaceUnreadSchema)).query("browse").withInput(workspaceInputSchema).withOutput(external_exports.array(browsableChannelSchema)).mutation("createChannel").withInput(createChannelInputSchema).withOutput(conversationSchema).mutation("join").withInput(channelInputSchema).withOutput(conversationSchema).mutation("leave").withInput(channelInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("updateChannel").withInput(updateChannelInputSchema).withOutput(conversationSchema).mutation("archiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("unarchiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("addMembers").withInput(addMembersInputSchema).withOutput(conversationSchema).mutation("removeMember").withInput(removeMemberInputSchema).withOutput(conversationSchema).mutation("openDirect").withInput(openDirectInputSchema).withOutput(conversationSchema).query("conversation").withInput(channelInputSchema).withOutput(conversationSchema).build();
|
|
32015
|
+
var chatConversationsTrpc = defineTrpcContract("chat").query("overview").withInput(workspaceInputSchema).withOutput(chatOverviewSchema).query("unreadSummary").withInput(external_exports.object({})).withOutput(external_exports.array(workspaceUnreadSchema)).query("browse").withInput(workspaceInputSchema).withOutput(external_exports.array(browsableChannelSchema)).mutation("createChannel").withInput(createChannelInputSchema).withOutput(conversationSchema).mutation("join").withInput(channelInputSchema).withOutput(conversationSchema).mutation("leave").withInput(channelInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("updateChannel").withInput(updateChannelInputSchema).withOutput(conversationSchema).mutation("setDefaultAgent").withInput(setDefaultAgentInputSchema).withOutput(conversationSchema).mutation("archiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("unarchiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("addMembers").withInput(addMembersInputSchema).withOutput(conversationSchema).mutation("removeMember").withInput(removeMemberInputSchema).withOutput(conversationSchema).mutation("openDirect").withInput(openDirectInputSchema).withOutput(conversationSchema).query("conversation").withInput(channelInputSchema).withOutput(conversationSchema).build();
|
|
31977
32016
|
var chatChannelRolesTrpc = defineTrpcContract("chat").mutation("setChannelRole").withInput(setChannelRoleInputSchema).withOutput(conversationSchema).mutation("extendChannel").withInput(extendChannelInputSchema).withOutput(conversationSchema).build();
|
|
31978
32017
|
var chatMessagesTrpc = defineTrpcContract("chat").query("history").withInput(historyInputSchema).withOutput(historyPageSchema).query("thread").withInput(messageInputSchema).withOutput(threadSchema).mutation("post").withInput(postMessageInputSchema).withOutput(messageSchema).mutation("addMentioned").withInput(addMentionedInputSchema).withOutput(messageSchema).mutation("edit").withInput(editMessageInputSchema).withOutput(messageSchema).mutation("delete").withInput(messageInputSchema).withOutput(messageSchema).mutation("remove").withInput(messageInputSchema).withOutput(messageSchema).mutation("react").withInput(reactInputSchema).withOutput(messageSchema).mutation("signalTyping").withInput(signalTypingInputSchema).withOutput(external_exports.object({ sent: external_exports.literal(true) })).mutation("markRead").withInput(markReadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).mutation("markUnread").withInput(markUnreadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).query("search").withInput(searchInputSchema).withOutput(searchResultSchema).build();
|
|
31979
32018
|
var chatFilesTrpc = defineTrpcContract("chat").mutation("startUpload").withInput(startUploadInputSchema).withOutput(uploadTicketSchema).mutation("completeUpload").withInput(completeUploadInputSchema).withOutput(attachmentSchema).mutation("abortUpload").withInput(fileInputSchema).withOutput(external_exports.object({ aborted: external_exports.literal(true) })).query("fileLink").withInput(fileLinkInputSchema).withOutput(fileLinkSchema).query("channelFiles").withInput(channelFilesInputSchema).withOutput(channelFilesSchema).mutation("renameAttachment").withInput(renameAttachmentInputSchema).withOutput(attachmentSchema).mutation("hideUnfurl").withInput(hideUnfurlInputSchema).withOutput(messageSchema).query("unfurlImage").withInput(hideUnfurlInputSchema).withOutput(fileLinkSchema).build();
|
|
@@ -32134,12 +32173,24 @@ var emailMessageSchemaDefinition = external_exports.discriminatedUnion("template
|
|
|
32134
32173
|
items: external_exports.array(external_exports.object({ title: external_exports.string().min(1), body: external_exports.string(), url: external_exports.url() })).min(1).max(20),
|
|
32135
32174
|
/** Items beyond the ones listed. */
|
|
32136
32175
|
more: external_exports.number().int().nonnegative()
|
|
32176
|
+
}),
|
|
32177
|
+
external_exports.object({
|
|
32178
|
+
template: external_exports.literal("feedDigest"),
|
|
32179
|
+
to: external_exports.email(),
|
|
32180
|
+
/** The feed page. */
|
|
32181
|
+
url: external_exports.url(),
|
|
32182
|
+
/** Settings, Notifications, where the digest is turned off. */
|
|
32183
|
+
settingsUrl: external_exports.url(),
|
|
32184
|
+
items: external_exports.array(external_exports.object({ title: external_exports.string().min(1), body: external_exports.string(), url: external_exports.url() })).min(1).max(20),
|
|
32185
|
+
more: external_exports.number().int().nonnegative()
|
|
32137
32186
|
})
|
|
32138
32187
|
]);
|
|
32139
32188
|
var workspaceIdSchema2 = external_exports.string().min(1);
|
|
32140
32189
|
var userIdSchema = external_exports.string().min(1).max(64);
|
|
32141
32190
|
var clockSchema = external_exports.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "a time such as 22:00");
|
|
32142
32191
|
var channelDefaultSchema = external_exports.enum(["all", "mentions", "nothing"]);
|
|
32192
|
+
var FEED_PUSH_KINDS = ["approvals", "urgent", "replies", "wakeups", "groups"];
|
|
32193
|
+
var feedPushKindSchema = external_exports.enum(FEED_PUSH_KINDS);
|
|
32143
32194
|
var notificationSettingsSchemaDefinition = external_exports.object({
|
|
32144
32195
|
channelDefault: channelDefaultSchema,
|
|
32145
32196
|
/** Words that notify like a mention, matched whole and case-blind. */
|
|
@@ -32154,7 +32205,12 @@ var notificationSettingsSchemaDefinition = external_exports.object({
|
|
|
32154
32205
|
pushEnabled: external_exports.boolean(),
|
|
32155
32206
|
emailEnabled: external_exports.boolean(),
|
|
32156
32207
|
/** Minutes away before unread mentions and direct messages are emailed. */
|
|
32157
|
-
emailDelayMinutes: external_exports.number().int().min(1).max(24 * 60)
|
|
32208
|
+
emailDelayMinutes: external_exports.number().int().min(1).max(24 * 60),
|
|
32209
|
+
/** Feed pushes the person turned off. */
|
|
32210
|
+
feedMuted: external_exports.array(feedPushKindSchema).max(FEED_PUSH_KINDS.length),
|
|
32211
|
+
/** One email a day at `digestAt` listing open feed cards, when no device takes pushes. */
|
|
32212
|
+
digestEnabled: external_exports.boolean(),
|
|
32213
|
+
digestAt: clockSchema
|
|
32158
32214
|
});
|
|
32159
32215
|
var notificationSettingsSchema = notificationSettingsSchemaDefinition;
|
|
32160
32216
|
var updateSettingsInputSchemaDefinition = external_exports.object({
|
|
@@ -32231,15 +32287,17 @@ var feedNoticeSchema = external_exports.object({
|
|
|
32231
32287
|
workspaceId: workspaceIdSchema2,
|
|
32232
32288
|
userId: userIdSchema,
|
|
32233
32289
|
kind: external_exports.literal("feed"),
|
|
32234
|
-
/** What collapses on the device: one item, or one
|
|
32290
|
+
/** What collapses on the device: one item, or one group. */
|
|
32235
32291
|
tag: external_exports.string().min(1).max(200),
|
|
32236
32292
|
title: external_exports.string().min(1).max(120),
|
|
32237
32293
|
body: external_exports.string().max(400),
|
|
32238
|
-
/** The feed page, opened on the item or the
|
|
32294
|
+
/** The feed page, opened on the item or the group. */
|
|
32239
32295
|
path: external_exports.string().startsWith("/").max(1024),
|
|
32240
32296
|
urgent: external_exports.boolean().default(false),
|
|
32241
32297
|
/** The feed event behind the push: each new event pushes, a retried one does not. */
|
|
32242
|
-
eventId: external_exports.string().min(1).max(200).optional()
|
|
32298
|
+
eventId: external_exports.string().min(1).max(200).optional(),
|
|
32299
|
+
/** Which setting turns it off; none means it always pushes. */
|
|
32300
|
+
pushKind: feedPushKindSchema.optional()
|
|
32243
32301
|
});
|
|
32244
32302
|
var notifyInputSchemaDefinition = external_exports.discriminatedUnion("kind", [
|
|
32245
32303
|
messageNoticeSchema,
|
|
@@ -32569,6 +32627,34 @@ var pauseSummaryIntentSchemaDefinition = external_exports.object({
|
|
|
32569
32627
|
userId: external_exports.string().min(1),
|
|
32570
32628
|
since: external_exports.iso.datetime()
|
|
32571
32629
|
});
|
|
32630
|
+
var feedDigestSetPayloadSchemaDefinition = external_exports.object({
|
|
32631
|
+
workspaceId: external_exports.string().min(1),
|
|
32632
|
+
userId: external_exports.string().min(1),
|
|
32633
|
+
enabled: external_exports.boolean(),
|
|
32634
|
+
/** Local HH:MM in `timeZone`. */
|
|
32635
|
+
digestAt: external_exports.string(),
|
|
32636
|
+
timeZone: external_exports.string(),
|
|
32637
|
+
changeId: external_exports.string().min(1),
|
|
32638
|
+
at: external_exports.iso.datetime()
|
|
32639
|
+
});
|
|
32640
|
+
var feedDigestDuePayloadSchemaDefinition = external_exports.object({
|
|
32641
|
+
workspaceId: external_exports.string().min(1),
|
|
32642
|
+
userId: external_exports.string().min(1),
|
|
32643
|
+
/** The digest time this email is for. */
|
|
32644
|
+
at: external_exports.iso.datetime()
|
|
32645
|
+
});
|
|
32646
|
+
var feedDigestStateSchemaDefinition = external_exports.object({
|
|
32647
|
+
workspaceId: external_exports.string(),
|
|
32648
|
+
userId: external_exports.string(),
|
|
32649
|
+
enabled: external_exports.boolean(),
|
|
32650
|
+
digestAt: external_exports.string(),
|
|
32651
|
+
timeZone: external_exports.string()
|
|
32652
|
+
});
|
|
32653
|
+
var feedDigestIntentSchemaDefinition = external_exports.object({
|
|
32654
|
+
workspaceId: external_exports.string().min(1),
|
|
32655
|
+
userId: external_exports.string().min(1),
|
|
32656
|
+
at: external_exports.iso.datetime()
|
|
32657
|
+
});
|
|
32572
32658
|
|
|
32573
32659
|
// ../../modules/notification/contract/src/notification.ui.ts
|
|
32574
32660
|
var notificationUi = uiTokens("notification");
|
|
@@ -32611,7 +32697,9 @@ var messagePostedPayloadSchemaDefinition = external_exports.object({
|
|
|
32611
32697
|
attachmentIds: external_exports.array(external_exports.string()),
|
|
32612
32698
|
createdAt: external_exports.iso.datetime(),
|
|
32613
32699
|
/** Set when a mirror brought the message in, so the mirror does not send it back out. */
|
|
32614
|
-
origin: external_exports.object({ source: mirrorSourceSchema, key: external_exports.string() }).nullable().default(null)
|
|
32700
|
+
origin: external_exports.object({ source: mirrorSourceSchema, key: external_exports.string() }).nullable().default(null),
|
|
32701
|
+
/** The key the sender posted it under, so a module that posts for someone knows its own. */
|
|
32702
|
+
clientKey: external_exports.string().optional()
|
|
32615
32703
|
});
|
|
32616
32704
|
var messageChangedPayloadSchemaDefinition = external_exports.object({
|
|
32617
32705
|
workspaceId: external_exports.string().min(1),
|
|
@@ -32711,6 +32799,12 @@ var realtimePublicationSchemaDefinition = external_exports.discriminatedUnion("t
|
|
|
32711
32799
|
threadRootId: external_exports.string().nullable(),
|
|
32712
32800
|
actor: chatActorSchema
|
|
32713
32801
|
}),
|
|
32802
|
+
/** The apps pinned to a conversation changed order: its members read the pins again. */
|
|
32803
|
+
external_exports.object({
|
|
32804
|
+
type: external_exports.literal("app_pins_changed"),
|
|
32805
|
+
workspaceId: external_exports.string(),
|
|
32806
|
+
channelId: external_exports.string()
|
|
32807
|
+
}),
|
|
32714
32808
|
external_exports.object({ type: external_exports.literal("activity_added"), workspaceId: external_exports.string() }),
|
|
32715
32809
|
/** The reader's followed threads or their read state changed, on another device too. */
|
|
32716
32810
|
external_exports.object({ type: external_exports.literal("threads_changed"), workspaceId: external_exports.string() }),
|
|
@@ -32867,7 +32961,9 @@ var lazeAgentEventSchemaDefinition = external_exports.discriminatedUnion("type",
|
|
|
32867
32961
|
/** Every Laze message the turn took in, prompted or steered: Laze marks them answered. */
|
|
32868
32962
|
messageIds: external_exports.array(external_exports.string().min(1)).optional(),
|
|
32869
32963
|
/** Set when the session sends the turn's messages again then (epoch ms): not a failure yet. */
|
|
32870
|
-
retryAt: external_exports.number().int().nonnegative().optional()
|
|
32964
|
+
retryAt: external_exports.number().int().nonnegative().optional(),
|
|
32965
|
+
/** Why a failed turn failed, as the session's error event said it. */
|
|
32966
|
+
failure: external_exports.object({ code: external_exports.string().min(1), message: external_exports.string() }).optional()
|
|
32871
32967
|
}),
|
|
32872
32968
|
external_exports.object({ type: external_exports.literal("text_delta"), messageId: external_exports.string().optional(), text: external_exports.string() }),
|
|
32873
32969
|
external_exports.object({
|
|
@@ -32898,7 +32994,9 @@ var lazeAgentEventSchemaDefinition = external_exports.discriminatedUnion("type",
|
|
|
32898
32994
|
type: external_exports.literal("compaction_ended"),
|
|
32899
32995
|
trigger: compactionTriggerSchema,
|
|
32900
32996
|
tokensBefore: external_exports.number().int().nonnegative().optional(),
|
|
32901
|
-
tokensAfter: external_exports.number().int().nonnegative().optional()
|
|
32997
|
+
tokensAfter: external_exports.number().int().nonnegative().optional(),
|
|
32998
|
+
/** From its start to its end, when the supervisor saw both. */
|
|
32999
|
+
durationMs: external_exports.number().int().nonnegative().optional()
|
|
32902
33000
|
}),
|
|
32903
33001
|
external_exports.object({
|
|
32904
33002
|
type: external_exports.literal("usage"),
|
|
@@ -33701,6 +33799,12 @@ var stopAgentTurnInputSchemaDefinition = external_exports.object({
|
|
|
33701
33799
|
channelId: idSchema6
|
|
33702
33800
|
});
|
|
33703
33801
|
var stopAgentTurnInputSchema = stopAgentTurnInputSchemaDefinition;
|
|
33802
|
+
var compactAgentSessionInputSchemaDefinition = external_exports.object({
|
|
33803
|
+
workspaceId: workspaceIdSchema3,
|
|
33804
|
+
agentId: idSchema6,
|
|
33805
|
+
channelId: idSchema6
|
|
33806
|
+
});
|
|
33807
|
+
var compactAgentSessionInputSchema = compactAgentSessionInputSchemaDefinition;
|
|
33704
33808
|
var agentAttentionRequestedPayloadSchemaDefinition = external_exports.object({
|
|
33705
33809
|
workspaceId: external_exports.string().min(1),
|
|
33706
33810
|
attentionId: external_exports.string().min(1),
|
|
@@ -33742,6 +33846,13 @@ var agentTurnStopRequestedPayloadSchemaDefinition = external_exports.object({
|
|
|
33742
33846
|
/** A session reset: the turn stops and the harness starts a fresh session in the main thread. */
|
|
33743
33847
|
freshSession: external_exports.boolean().optional()
|
|
33744
33848
|
});
|
|
33849
|
+
var agentCompactRequestedPayloadSchemaDefinition = external_exports.object({
|
|
33850
|
+
workspaceId: external_exports.string().min(1),
|
|
33851
|
+
agentId: external_exports.string().min(1),
|
|
33852
|
+
channelId: external_exports.string().min(1),
|
|
33853
|
+
compactId: external_exports.string().min(1),
|
|
33854
|
+
requestedByUserId: external_exports.string().min(1)
|
|
33855
|
+
});
|
|
33745
33856
|
var agentAttentionExpiryStateSchemaDefinition = external_exports.object({
|
|
33746
33857
|
workspaceId: external_exports.string(),
|
|
33747
33858
|
expiresAt: external_exports.number().nullable()
|
|
@@ -35080,6 +35191,7 @@ var vaultPasskeySetUpPayloadSchemaDefinition = external_exports.object({
|
|
|
35080
35191
|
|
|
35081
35192
|
// ../../modules/vault/contract/src/vault-reference-chip.ts
|
|
35082
35193
|
var VaultReferenceChipSlot = uiTokens("vault").component("referenceChip");
|
|
35194
|
+
var VaultMessageFootSlot = uiTokens("vault").component("messageFoot");
|
|
35083
35195
|
|
|
35084
35196
|
// ../../modules/vault/contract/src/vault-pending.ts
|
|
35085
35197
|
var connectionName2 = external_exports.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/);
|
|
@@ -35927,6 +36039,17 @@ var unwatchGithubAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
35927
36039
|
});
|
|
35928
36040
|
var githubCallerQuerySchemaDefinition = external_exports.object({ agent: callerAgentSchema });
|
|
35929
36041
|
|
|
36042
|
+
// ../../modules/agent/contract/src/agent-held.ts
|
|
36043
|
+
var cancelHeldInputSchemaDefinition = external_exports.object({
|
|
36044
|
+
workspaceId: external_exports.string().min(1),
|
|
36045
|
+
agentId: external_exports.string().min(1),
|
|
36046
|
+
/** The waiting message. */
|
|
36047
|
+
messageId: external_exports.string().min(1)
|
|
36048
|
+
});
|
|
36049
|
+
var cancelHeldInputSchema = cancelHeldInputSchemaDefinition;
|
|
36050
|
+
var cancelHeldResultSchemaDefinition = external_exports.object({ cancelled: external_exports.boolean() });
|
|
36051
|
+
var cancelHeldResultSchema = cancelHeldResultSchemaDefinition;
|
|
36052
|
+
|
|
35930
36053
|
// ../../modules/agent/contract/src/agent-lifecycle.ts
|
|
35931
36054
|
var workspaceIdSchema5 = external_exports.string().min(1);
|
|
35932
36055
|
var idSchema9 = external_exports.string().min(1).max(200);
|
|
@@ -36168,6 +36291,7 @@ var setAgentPoolAsCallerInputSchema = setAgentPoolInputSchemaDefinition.omit({
|
|
|
36168
36291
|
workspaceId: true
|
|
36169
36292
|
});
|
|
36170
36293
|
var agentLoginSchemaDefinition = external_exports.object({
|
|
36294
|
+
/** The login's name; empty for a pooled agent that has not run on one of its logins yet. */
|
|
36171
36295
|
name: external_exports.string(),
|
|
36172
36296
|
source: external_exports.enum(["personal", "pool"]),
|
|
36173
36297
|
poolName: external_exports.string().nullable()
|
|
@@ -36570,7 +36694,9 @@ var callerChannelSchemaDefinition = external_exports.object({
|
|
|
36570
36694
|
/** A message there leaves Laze: the channel mirrors Slack or holds an agent run outside. */
|
|
36571
36695
|
leavesLaze: external_exports.boolean().default(false),
|
|
36572
36696
|
/** The caller's own mute there, while it lasts; null when not muted. */
|
|
36573
|
-
mute: agentChannelMuteSchema.nullable().default(null)
|
|
36697
|
+
mute: agentChannelMuteSchema.nullable().default(null),
|
|
36698
|
+
/** The caller is the channel's default agent: it answers messages that name no agent. */
|
|
36699
|
+
isDefault: external_exports.boolean().default(false)
|
|
36574
36700
|
});
|
|
36575
36701
|
var setChannelLevelInputSchemaDefinition = external_exports.object({
|
|
36576
36702
|
workspaceId: workspaceIdSchema8,
|
|
@@ -36705,13 +36831,15 @@ var codexLoginRefreshInputSchemaDefinition = external_exports.object({
|
|
|
36705
36831
|
authJson: external_exports.string().min(2).max(CODEX_LOGIN_MAX_LENGTH)
|
|
36706
36832
|
});
|
|
36707
36833
|
var AgentApi = moduleApi()("agent");
|
|
36708
|
-
var agentCoreTrpc = defineTrpcContract("agents").query("list").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(external_exports.array(agentListEntrySchema)).mutation("create").withInput(createAgentInputSchema).withOutput(agentSchema).mutation("update").withInput(updateAgentInputSchema).withOutput(agentSchema).mutation("remove").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("transfer").withInput(transferAgentInputSchema).withOutput(agentSchema).mutation("resetSession").withInput(resetAgentSessionInputSchema).withOutput(agentSchema).query("faces").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(external_exports.array(agentFaceSchema)).query("presence").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(external_exports.array(agentPresenceSchema)).mutation("uploadAvatar").withInput(uploadAgentAvatarInputSchema).withOutput(uploadedAgentAvatarSchema).query("access").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(agentAccessSchema).query("permissionPrompts").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.array(agentPermissionPromptSchema)).mutation("share").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).mutation("unshare").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).query("harnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(harnessLoginsSchema).mutation("saveHarnessLogin").withInput(saveHarnessLoginInputSchema).withOutput(harnessLoginsSchema).mutation("removeHarnessLogin").withInput(removeHarnessLoginInputSchema).withOutput(harnessLoginsSchema).query("listHarnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(harnessLoginListSchema).mutation("addHarnessLogin").withInput(addHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("renameHarnessLogin").withInput(renameHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("deleteHarnessLogin").withInput(deleteHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("checkLoginUsage").withInput(checkLoginUsageInputSchema).withOutput(loginUsageCheckSchema).query("loginPools").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(loginPoolsSchema).mutation("createLoginPool").withInput(createLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("renameLoginPool").withInput(renameLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("deleteLoginPool").withInput(loginPoolRefInputSchema).withOutput(loginPoolsSchema).mutation("addPoolLogin").withInput(addPoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("removePoolLogin").withInput(removePoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("setPoolMember").withInput(setPoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("removePoolMember").withInput(removePoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("setAgentPool").withInput(setAgentPoolInputSchema).withOutput(agentSchema).mutation("openDirect").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.object({ channelId: idSchema12 })).mutation("startConversation").withInput(startConversationInputSchema).withOutput(startedConversationSchema).query("conversations").withInput(listConversationsInputSchema).withOutput(external_exports.array(conversationSummarySchema2)).mutation("joinConversation").withInput(conversationInputSchema).withOutput(conversationSummarySchema2).mutation("renameConversation").withInput(renameConversationInputSchema).withOutput(conversationSummarySchema2).mutation("leaveConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("deleteConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("mintLink").withInput(mintLinkInputSchema).withOutput(mintedLinkSchema).query("oauthRequest").withInput(oauthRequestInputSchema).withOutput(oauthRequestViewSchema).mutation("oauthApprove").withInput(approveOAuthInputSchema).withOutput(oauthRedirectSchema).mutation("oauthDeny").withInput(oauthRequestInputSchema).withOutput(oauthRedirectSchema).mutation("disconnect").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.object({ disconnected: external_exports.literal(true) })).mutation("setGithub").withInput(setAgentGithubInputSchema).withOutput(agentSchema).query("githubWatches").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.array(agentGithubWatchSchema)).mutation("watchGithub").withInput(watchGithubInputSchema).withOutput(agentGithubWatchSchema).mutation("unwatchGithub").withInput(unwatchGithubInputSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).
|
|
36709
|
-
var
|
|
36834
|
+
var agentCoreTrpc = defineTrpcContract("agents").query("list").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(external_exports.array(agentListEntrySchema)).mutation("create").withInput(createAgentInputSchema).withOutput(agentSchema).mutation("update").withInput(updateAgentInputSchema).withOutput(agentSchema).mutation("remove").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("transfer").withInput(transferAgentInputSchema).withOutput(agentSchema).mutation("resetSession").withInput(resetAgentSessionInputSchema).withOutput(agentSchema).query("faces").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(external_exports.array(agentFaceSchema)).query("presence").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(external_exports.array(agentPresenceSchema)).mutation("uploadAvatar").withInput(uploadAgentAvatarInputSchema).withOutput(uploadedAgentAvatarSchema).query("access").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(agentAccessSchema).query("permissionPrompts").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.array(agentPermissionPromptSchema)).mutation("share").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).mutation("unshare").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).query("harnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(harnessLoginsSchema).mutation("saveHarnessLogin").withInput(saveHarnessLoginInputSchema).withOutput(harnessLoginsSchema).mutation("removeHarnessLogin").withInput(removeHarnessLoginInputSchema).withOutput(harnessLoginsSchema).query("listHarnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(harnessLoginListSchema).mutation("addHarnessLogin").withInput(addHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("renameHarnessLogin").withInput(renameHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("deleteHarnessLogin").withInput(deleteHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("checkLoginUsage").withInput(checkLoginUsageInputSchema).withOutput(loginUsageCheckSchema).query("loginPools").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(loginPoolsSchema).mutation("createLoginPool").withInput(createLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("renameLoginPool").withInput(renameLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("deleteLoginPool").withInput(loginPoolRefInputSchema).withOutput(loginPoolsSchema).mutation("addPoolLogin").withInput(addPoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("removePoolLogin").withInput(removePoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("setPoolMember").withInput(setPoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("removePoolMember").withInput(removePoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("setAgentPool").withInput(setAgentPoolInputSchema).withOutput(agentSchema).mutation("openDirect").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.object({ channelId: idSchema12 })).mutation("startConversation").withInput(startConversationInputSchema).withOutput(startedConversationSchema).query("conversations").withInput(listConversationsInputSchema).withOutput(external_exports.array(conversationSummarySchema2)).mutation("joinConversation").withInput(conversationInputSchema).withOutput(conversationSummarySchema2).mutation("renameConversation").withInput(renameConversationInputSchema).withOutput(conversationSummarySchema2).mutation("leaveConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("deleteConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("mintLink").withInput(mintLinkInputSchema).withOutput(mintedLinkSchema).query("oauthRequest").withInput(oauthRequestInputSchema).withOutput(oauthRequestViewSchema).mutation("oauthApprove").withInput(approveOAuthInputSchema).withOutput(oauthRedirectSchema).mutation("oauthDeny").withInput(oauthRequestInputSchema).withOutput(oauthRedirectSchema).mutation("disconnect").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.object({ disconnected: external_exports.literal(true) })).mutation("setGithub").withInput(setAgentGithubInputSchema).withOutput(agentSchema).query("githubWatches").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.array(agentGithubWatchSchema)).mutation("watchGithub").withInput(watchGithubInputSchema).withOutput(agentGithubWatchSchema).mutation("unwatchGithub").withInput(unwatchGithubInputSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
|
|
36835
|
+
var agentTurnTrpc = defineTrpcContract("agents").mutation("answerAttention").withInput(answerAttentionInputSchema).withOutput(external_exports.object({ answered: external_exports.literal(true) })).mutation("stopTurn").withInput(stopAgentTurnInputSchema).withOutput(external_exports.object({ stopped: external_exports.literal(true) })).mutation("compactSession").withInput(compactAgentSessionInputSchema).withOutput(external_exports.object({ requested: external_exports.literal(true) })).mutation("restartComputer").withInput(restartAgentComputerInputSchema).withOutput(external_exports.object({ restarted: external_exports.boolean() })).build();
|
|
36836
|
+
var agentChannelSettingsTrpc = defineTrpcContract("agents").query("channelLevel").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12, channelId: idSchema12 })).withOutput(channelLevelSchema).mutation("setChannelLevel").withInput(setChannelLevelInputSchema).withOutput(channelLevelSchema).mutation("unmuteChannel").withInput(unmuteAgentChannelInputSchema).withOutput(channelLevelSchema).mutation("cancelHeld").withInput(cancelHeldInputSchema).withOutput(cancelHeldResultSchema).build();
|
|
36710
36837
|
var agentJoinTrpc = defineTrpcContract("agents").query("joinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("approveJoinRequest").withInput(approveJoinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("denyJoinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).build();
|
|
36711
36838
|
var agentLoginTroubleTrpc = defineTrpcContract("agents").mutation("replaceHarnessLogin").withInput(replaceHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("waitForLogins").withInput(loginCardActionInputSchema).withOutput(external_exports.object({ waiting: external_exports.boolean() })).mutation("useAnotherLogin").withInput(loginCardActionInputSchema).withOutput(external_exports.object({ loginName: external_exports.string() })).build();
|
|
36712
36839
|
var agentTrpc = joinTrpcContracts(
|
|
36713
36840
|
"agents",
|
|
36714
36841
|
agentCoreTrpc,
|
|
36842
|
+
agentTurnTrpc,
|
|
36715
36843
|
agentChannelSettingsTrpc,
|
|
36716
36844
|
agentJoinTrpc,
|
|
36717
36845
|
agentLoginTroubleTrpc
|
|
@@ -36722,6 +36850,7 @@ var AgentAttentionCardSlot = agentUi.component("attentionCard");
|
|
|
36722
36850
|
var AgentComputerCardSlot = agentUi.component("computerCard");
|
|
36723
36851
|
var AgentLoginCardSlot = agentUi.component("loginCard");
|
|
36724
36852
|
var AgentStopTurnSlot = agentUi.component("stopTurn");
|
|
36853
|
+
var AgentSessionHooksToken = agentUi.hooks("session");
|
|
36725
36854
|
var AgentCreateDialogSlot = agentUi.component("createDialog");
|
|
36726
36855
|
var AgentEditDialogSlot = agentUi.component("editDialog");
|
|
36727
36856
|
var AgentFaceSlot = agentUi.component("face");
|
|
@@ -36729,6 +36858,7 @@ var AgentAccessSlot = agentUi.component("access");
|
|
|
36729
36858
|
var AgentConnectDialogSlot = agentUi.component("connectDialog");
|
|
36730
36859
|
var AgentChannelLevelSlot = agentUi.component("channelLevel");
|
|
36731
36860
|
var AgentMuteNoticeSlot = agentUi.component("muteNotice");
|
|
36861
|
+
var AgentHeldNoticeSlot = agentUi.component("heldNotice");
|
|
36732
36862
|
|
|
36733
36863
|
// ../../modules/agent/contract/src/agent.config.ts
|
|
36734
36864
|
var positiveInt3 = external_exports.coerce.number().int().positive();
|
|
@@ -36796,12 +36926,16 @@ var agentTurnEndedPayloadSchemaDefinition = external_exports.object({
|
|
|
36796
36926
|
turnId: external_exports.string().min(1).max(200),
|
|
36797
36927
|
failed: external_exports.boolean(),
|
|
36798
36928
|
/** What the session said when the turn failed. */
|
|
36799
|
-
reason: external_exports.string().max(500).optional()
|
|
36929
|
+
reason: external_exports.string().max(500).optional(),
|
|
36930
|
+
/** The failure's kind (`model_error`, `model_key_denied`...); one kind makes one streak. */
|
|
36931
|
+
code: external_exports.string().max(80).optional()
|
|
36800
36932
|
});
|
|
36801
36933
|
var agentTurnFailuresStateSchemaDefinition = external_exports.object({
|
|
36802
36934
|
workspaceId: external_exports.string(),
|
|
36803
36935
|
failures: external_exports.number().int().nonnegative(),
|
|
36804
36936
|
reason: external_exports.string(),
|
|
36937
|
+
/** The streak's failure kind; empty for a failure that named none. */
|
|
36938
|
+
code: external_exports.string().default(""),
|
|
36805
36939
|
/** The first failed turn of the streak, which names its card. */
|
|
36806
36940
|
streakId: external_exports.string()
|
|
36807
36941
|
});
|
|
@@ -36881,16 +37015,27 @@ var agentTriggeredTurnFiledPayloadSchemaDefinition = external_exports.object({
|
|
|
36881
37015
|
error: external_exports.string().nullable(),
|
|
36882
37016
|
at: external_exports.iso.datetime()
|
|
36883
37017
|
});
|
|
37018
|
+
var agentTurnAnchorSchema = external_exports.object({
|
|
37019
|
+
messageId: external_exports.string().min(1),
|
|
37020
|
+
seq: external_exports.number().int().positive(),
|
|
37021
|
+
createdAt: external_exports.iso.datetime(),
|
|
37022
|
+
threadRootId: external_exports.string().min(1).nullable()
|
|
37023
|
+
});
|
|
36884
37024
|
var fileAgentTurnInputSchemaDefinition = external_exports.object({
|
|
36885
37025
|
workspaceId: external_exports.string().min(1),
|
|
36886
37026
|
agentId: external_exports.string().min(1),
|
|
36887
37027
|
requesterUserId: external_exports.string().min(1),
|
|
36888
37028
|
/** The conversation the turn runs in; null runs it in the requester's DM with the agent. */
|
|
36889
37029
|
channelId: external_exports.string().min(1).nullable(),
|
|
36890
|
-
notice: external_exports.string().min(1),
|
|
37030
|
+
notice: external_exports.string().min(1).optional(),
|
|
37031
|
+
anchor: agentTurnAnchorSchema.optional(),
|
|
36891
37032
|
prompt: external_exports.string().min(1),
|
|
36892
37033
|
/** The caller's id for this turn: the same key again files nothing new. */
|
|
36893
37034
|
key: external_exports.string().regex(/^[A-Za-z0-9_-]{8,64}$/)
|
|
37035
|
+
}).refine((input2) => input2.notice !== void 0 || input2.anchor !== void 0, {
|
|
37036
|
+
message: "A turn carries a notice to post or the anchor it hangs off"
|
|
37037
|
+
}).refine((input2) => input2.anchor === void 0 || input2.channelId !== null, {
|
|
37038
|
+
message: "An anchored turn names the conversation its anchor is in"
|
|
36894
37039
|
});
|
|
36895
37040
|
|
|
36896
37041
|
// ../../modules/agent/contract/src/agent-removed.ts
|
|
@@ -36901,6 +37046,24 @@ var agentRemovedPayloadSchemaDefinition = external_exports.object({
|
|
|
36901
37046
|
removedByUserId: external_exports.string().min(1)
|
|
36902
37047
|
});
|
|
36903
37048
|
|
|
37049
|
+
// ../../modules/agent/contract/src/agent-scheduled-run-missed.ts
|
|
37050
|
+
var scheduledRunMissReasonSchema = external_exports.enum([
|
|
37051
|
+
"agent_offline",
|
|
37052
|
+
"agent_removed",
|
|
37053
|
+
"conversation_gone"
|
|
37054
|
+
]);
|
|
37055
|
+
var agentScheduledRunMissedPayloadSchemaDefinition = external_exports.object({
|
|
37056
|
+
workspaceId: external_exports.string().min(1),
|
|
37057
|
+
agentId: external_exports.string().min(1),
|
|
37058
|
+
agentName: external_exports.string(),
|
|
37059
|
+
scheduleId: external_exports.string().min(1),
|
|
37060
|
+
runId: external_exports.string().min(1),
|
|
37061
|
+
name: external_exports.string(),
|
|
37062
|
+
requesterUserId: external_exports.string().min(1),
|
|
37063
|
+
reason: scheduledRunMissReasonSchema,
|
|
37064
|
+
scheduledFor: external_exports.iso.datetime()
|
|
37065
|
+
});
|
|
37066
|
+
|
|
36904
37067
|
// ../../modules/agent/contract/src/agent-history.ts
|
|
36905
37068
|
var idSchema14 = external_exports.string().min(1).max(80);
|
|
36906
37069
|
var CALLER_HISTORY_LIMIT_MAX = 100;
|
|
@@ -37535,7 +37698,7 @@ ${link.prompt}
|
|
|
37535
37698
|
|
|
37536
37699
|
// src/services/agent-commands.service.ts
|
|
37537
37700
|
import { mkdir as mkdir6, readFile as readFile5, writeFile as writeFile6 } from "node:fs/promises";
|
|
37538
|
-
import { join as
|
|
37701
|
+
import { join as join5, resolve as resolve3 } from "node:path";
|
|
37539
37702
|
|
|
37540
37703
|
// src/rules/cli-invocation.rules.ts
|
|
37541
37704
|
var NPX_CACHE = /[\\/]_npx[\\/]/;
|
|
@@ -39092,22 +39255,7 @@ function channelLabelIn(channel) {
|
|
|
39092
39255
|
}
|
|
39093
39256
|
|
|
39094
39257
|
// src/services/claude-project.service.ts
|
|
39095
|
-
import {
|
|
39096
|
-
import { homedir as homedir2 } from "node:os";
|
|
39097
|
-
import { basename, dirname as dirname4, join as join4, resolve as resolve2 } from "node:path";
|
|
39098
|
-
async function isDirectory(path) {
|
|
39099
|
-
return stat(path).then(
|
|
39100
|
-
(found) => found.isDirectory(),
|
|
39101
|
-
() => false
|
|
39102
|
-
);
|
|
39103
|
-
}
|
|
39104
|
-
async function nearestProjectOf({ start: start2, home }) {
|
|
39105
|
-
for (let folder = resolve2(start2); ; folder = dirname4(folder)) {
|
|
39106
|
-
const ownClaude = folder !== home && await isDirectory(join4(folder, ".claude"));
|
|
39107
|
-
if (ownClaude || await isDirectory(join4(folder, ".git"))) return folder;
|
|
39108
|
-
if (dirname4(folder) === folder) return resolve2(start2);
|
|
39109
|
-
}
|
|
39110
|
-
}
|
|
39258
|
+
import { basename, isAbsolute, relative, resolve as resolve2 } from "node:path";
|
|
39111
39259
|
function harnessIn({ words }) {
|
|
39112
39260
|
const names = words.slice(0, 2).map((word2) => basename(word2).replace(/\.(js|mjs|cjs)$/, ""));
|
|
39113
39261
|
if (names.includes("codex")) return "codex";
|
|
@@ -39124,24 +39272,28 @@ async function nearestHarnessOf({ context }) {
|
|
|
39124
39272
|
}
|
|
39125
39273
|
return void 0;
|
|
39126
39274
|
}
|
|
39275
|
+
function holds({ folder, inner }) {
|
|
39276
|
+
const rel = relative(resolve2(folder), resolve2(inner));
|
|
39277
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute(rel);
|
|
39278
|
+
}
|
|
39127
39279
|
async function claudeProjectOf({
|
|
39128
39280
|
context,
|
|
39129
39281
|
claudePid
|
|
39130
39282
|
}) {
|
|
39131
39283
|
const env = context.environment.inherited;
|
|
39132
|
-
const found = claudePid ? await context.processes.cwdOf(claudePid) : void 0;
|
|
39133
|
-
if (found) return found;
|
|
39134
|
-
if (env.CLAUDE_PROJECT_DIR) return resolve2(env.CLAUDE_PROJECT_DIR);
|
|
39135
39284
|
const pid = Number(env.CLAUDE_PID);
|
|
39136
|
-
const
|
|
39137
|
-
|
|
39138
|
-
|
|
39285
|
+
const candidates = [
|
|
39286
|
+
claudePid ? await context.processes.cwdOf(claudePid) : void 0,
|
|
39287
|
+
env.CLAUDE_PROJECT_DIR ? resolve2(env.CLAUDE_PROJECT_DIR) : void 0,
|
|
39288
|
+
pid > 0 ? await context.processes.cwdOf(pid) : void 0
|
|
39289
|
+
].filter((folder) => Boolean(folder));
|
|
39290
|
+
return candidates.find((folder) => holds({ folder, inner: context.cwd })) ?? resolve2(context.cwd);
|
|
39139
39291
|
}
|
|
39140
39292
|
|
|
39141
39293
|
// src/services/codex-adopt.service.ts
|
|
39142
39294
|
import { spawn as spawn2 } from "node:child_process";
|
|
39143
|
-
import { mkdir as mkdir4, readdir, readFile as readFile4, rm as rm2, stat
|
|
39144
|
-
import { dirname as
|
|
39295
|
+
import { mkdir as mkdir4, readdir, readFile as readFile4, rm as rm2, stat, writeFile as writeFile4 } from "node:fs/promises";
|
|
39296
|
+
import { dirname as dirname4, join as join4 } from "node:path";
|
|
39145
39297
|
import { createInterface } from "node:readline";
|
|
39146
39298
|
|
|
39147
39299
|
// src/rules/codex-requests.rules.ts
|
|
@@ -39200,8 +39352,8 @@ var CodexAppServer = class _CodexAppServer {
|
|
|
39200
39352
|
}
|
|
39201
39353
|
async call(method, params) {
|
|
39202
39354
|
const id = ++this.#nextId;
|
|
39203
|
-
const reply2 = await new Promise((
|
|
39204
|
-
this.#pending.set(id,
|
|
39355
|
+
const reply2 = await new Promise((resolve15) => {
|
|
39356
|
+
this.#pending.set(id, resolve15);
|
|
39205
39357
|
this.write({ id, method, params });
|
|
39206
39358
|
});
|
|
39207
39359
|
if (reply2.error !== void 0) throw new Error(`${method}: ${JSON.stringify(reply2.error)}`);
|
|
@@ -39213,12 +39365,12 @@ var CodexAppServer = class _CodexAppServer {
|
|
|
39213
39365
|
/** Starts one turn; `done` settles when it completes, keeping its last agent message. */
|
|
39214
39366
|
async startTurn({ threadId, text: text2 }) {
|
|
39215
39367
|
const result = { answer: "" };
|
|
39216
|
-
const done = new Promise((
|
|
39368
|
+
const done = new Promise((resolve15) => {
|
|
39217
39369
|
const listen = (message2) => {
|
|
39218
39370
|
absorbTurnEvent({ result, message: message2 });
|
|
39219
39371
|
if (message2.method !== "turn/completed") return;
|
|
39220
39372
|
this.#listeners.delete(listen);
|
|
39221
|
-
|
|
39373
|
+
resolve15(result);
|
|
39222
39374
|
};
|
|
39223
39375
|
this.#listeners.add(listen);
|
|
39224
39376
|
});
|
|
@@ -39261,11 +39413,11 @@ var CodexAppServer = class _CodexAppServer {
|
|
|
39261
39413
|
}
|
|
39262
39414
|
};
|
|
39263
39415
|
async function newestThreadId({ codexHome }) {
|
|
39264
|
-
const root =
|
|
39416
|
+
const root = join4(codexHome, "sessions");
|
|
39265
39417
|
const files2 = await readdir(root, { recursive: true }).catch(() => []);
|
|
39266
39418
|
const rollouts = files2.filter((file3) => /rollout-.*\.jsonl$/.test(file3));
|
|
39267
39419
|
const dated = await Promise.all(
|
|
39268
|
-
rollouts.map(async (file3) => ({ file: file3, at: (await
|
|
39420
|
+
rollouts.map(async (file3) => ({ file: file3, at: (await stat(join4(root, file3))).mtimeMs }))
|
|
39269
39421
|
);
|
|
39270
39422
|
const newest = dated.toSorted((a, b) => b.at - a.at)[0]?.file ?? "";
|
|
39271
39423
|
const id = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/.exec(newest);
|
|
@@ -39359,7 +39511,7 @@ async function startAdoptInBackground({
|
|
|
39359
39511
|
const adopt = ["adopt", "codex", "--profile", profile, ...threadFlag({ thread: thread2 })];
|
|
39360
39512
|
const argv = [...context.program, ...adopt, "--supervise"];
|
|
39361
39513
|
const pid = context.processes.spawnDetached({ argv, logPath: log });
|
|
39362
|
-
await mkdir4(
|
|
39514
|
+
await mkdir4(dirname4(path), { recursive: true, mode: 448 });
|
|
39363
39515
|
await writeFile4(path, JSON.stringify({ pid, thread: thread2, log, startedAt: context.nowMs() }));
|
|
39364
39516
|
return [
|
|
39365
39517
|
`Started \`${laze} adopt codex\` in the background (pid ${pid}). It answers each Laze message`,
|
|
@@ -39455,7 +39607,7 @@ async function adoptedThreadOf({
|
|
|
39455
39607
|
}
|
|
39456
39608
|
const forked = record3((await codex.call("thread/fork", { threadId })).thread).id;
|
|
39457
39609
|
if (typeof forked !== "string") throw new Error("thread/fork answered no thread id");
|
|
39458
|
-
await mkdir4(
|
|
39610
|
+
await mkdir4(dirname4(path), { recursive: true, mode: 448 });
|
|
39459
39611
|
await writeFile4(path, JSON.stringify({ ...forks, [threadId]: forked }));
|
|
39460
39612
|
context.out(
|
|
39461
39613
|
`Codex holds thread ${threadId} open elsewhere; answering in its new fork ${forked}.
|
|
@@ -39505,7 +39657,7 @@ async function adoptCodex({ context, args }) {
|
|
|
39505
39657
|
|
|
39506
39658
|
// src/services/mcp-channel.service.ts
|
|
39507
39659
|
import { mkdir as mkdir5, rm as rm3, writeFile as writeFile5 } from "node:fs/promises";
|
|
39508
|
-
import { dirname as
|
|
39660
|
+
import { dirname as dirname5 } from "node:path";
|
|
39509
39661
|
var LAZE_MCP_SERVER = "laze";
|
|
39510
39662
|
var DEV_CHANNELS_FLAG = "--dangerously-load-development-channels";
|
|
39511
39663
|
var ROUND_SECONDS = 50;
|
|
@@ -39588,7 +39740,7 @@ async function pushInbox({
|
|
|
39588
39740
|
signal
|
|
39589
39741
|
}) {
|
|
39590
39742
|
const marker = statePathOf({ context, kind: "channels", profile });
|
|
39591
|
-
await mkdir5(
|
|
39743
|
+
await mkdir5(dirname5(marker), { recursive: true, mode: 448 });
|
|
39592
39744
|
await writeFile5(marker, JSON.stringify({ pid: context.processes.pid }));
|
|
39593
39745
|
try {
|
|
39594
39746
|
while (!signal.aborted) {
|
|
@@ -39657,8 +39809,8 @@ async function installHooks({
|
|
|
39657
39809
|
directory,
|
|
39658
39810
|
profile
|
|
39659
39811
|
}) {
|
|
39660
|
-
const folder =
|
|
39661
|
-
const path =
|
|
39812
|
+
const folder = join5(directory, ".claude");
|
|
39813
|
+
const path = join5(folder, "settings.local.json");
|
|
39662
39814
|
const current2 = await readFile5(path, "utf8").then(
|
|
39663
39815
|
(text2) => JSON.parse(text2),
|
|
39664
39816
|
() => ({})
|
|
@@ -39750,6 +39902,16 @@ async function linkAgent({ context, args }) {
|
|
|
39750
39902
|
}).catch((error62) => sandboxed({ context, error: error62 }));
|
|
39751
39903
|
await settleLinked({ context, args, url: url2, harness, pid, linked });
|
|
39752
39904
|
}
|
|
39905
|
+
async function sessionFolderOf({
|
|
39906
|
+
context,
|
|
39907
|
+
args,
|
|
39908
|
+
claude,
|
|
39909
|
+
pid
|
|
39910
|
+
}) {
|
|
39911
|
+
const asked = flagText({ args, name: "project" });
|
|
39912
|
+
if (asked) return resolve3(context.cwd, asked);
|
|
39913
|
+
return claude ? claudeProjectOf({ context, claudePid: pid }) : context.cwd;
|
|
39914
|
+
}
|
|
39753
39915
|
async function settleLinked({
|
|
39754
39916
|
context,
|
|
39755
39917
|
args,
|
|
@@ -39760,7 +39922,7 @@ async function settleLinked({
|
|
|
39760
39922
|
}) {
|
|
39761
39923
|
const name2 = flagText({ args, name: "profile" }) || `agent-${slugOf(linked.agent.name)}`;
|
|
39762
39924
|
const claude = harness === "claude-code";
|
|
39763
|
-
const directory =
|
|
39925
|
+
const directory = await sessionFolderOf({ context, args, claude, pid });
|
|
39764
39926
|
await context.store.saveProfile({
|
|
39765
39927
|
name: name2,
|
|
39766
39928
|
bindDirectory: directory,
|
|
@@ -39863,7 +40025,7 @@ async function stopHook({ context, args }) {
|
|
|
39863
40025
|
|
|
39864
40026
|
// src/services/agent-manage-commands.service.ts
|
|
39865
40027
|
import { readFile as readFile6 } from "node:fs/promises";
|
|
39866
|
-
import { extname, resolve as
|
|
40028
|
+
import { extname, resolve as resolve4 } from "node:path";
|
|
39867
40029
|
|
|
39868
40030
|
// src/rules/login-format.rules.ts
|
|
39869
40031
|
var HARNESS_NAMES = {
|
|
@@ -39973,7 +40135,7 @@ async function avatarOf({
|
|
|
39973
40135
|
}) {
|
|
39974
40136
|
const path = flagText({ args, name: "avatar" });
|
|
39975
40137
|
if (!path) return void 0;
|
|
39976
|
-
const bytes = await readFile6(
|
|
40138
|
+
const bytes = await readFile6(resolve4(context.cwd, path)).catch(() => {
|
|
39977
40139
|
throw new CliUsageError(`laze: cannot read the avatar file ${path}.`);
|
|
39978
40140
|
});
|
|
39979
40141
|
const uploaded = await client.post("/api/agents/avatars", {
|
|
@@ -40508,7 +40670,7 @@ async function setAgentPool({
|
|
|
40508
40670
|
|
|
40509
40671
|
// src/services/app-commands.service.ts
|
|
40510
40672
|
import { mkdir as mkdir7, readdir as readdir2, readFile as readFile7, writeFile as writeFile8 } from "node:fs/promises";
|
|
40511
|
-
import { dirname as
|
|
40673
|
+
import { dirname as dirname6, join as join7, relative as relative2, resolve as resolve5, sep } from "node:path";
|
|
40512
40674
|
|
|
40513
40675
|
// ../../modules/app/contract/src/app.connections.ts
|
|
40514
40676
|
var appFunctionNameSchema = external_exports.string().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/);
|
|
@@ -41511,6 +41673,7 @@ var appTriggerFiredPayloadSchemaDefinition = external_exports.object({
|
|
|
41511
41673
|
});
|
|
41512
41674
|
|
|
41513
41675
|
// ../../modules/app/contract/src/app.pins.ts
|
|
41676
|
+
var APP_PINS_PER_CHANNEL_MAX = 6;
|
|
41514
41677
|
var appPinChangedPayloadSchemaDefinition = external_exports.object({
|
|
41515
41678
|
workspaceId: external_exports.string().min(1),
|
|
41516
41679
|
channelId: external_exports.string().min(1),
|
|
@@ -41542,7 +41705,7 @@ var appPinViewSchemaDefinition = external_exports.object({
|
|
|
41542
41705
|
var channelAppPinsSchemaDefinition = external_exports.object({
|
|
41543
41706
|
workspaceId: external_exports.string().min(1),
|
|
41544
41707
|
channelId: external_exports.string().min(1),
|
|
41545
|
-
/**
|
|
41708
|
+
/** In the conversation's shared tab order. */
|
|
41546
41709
|
pins: external_exports.array(appPinSchemaDefinition),
|
|
41547
41710
|
view: appPinViewSchemaDefinition
|
|
41548
41711
|
});
|
|
@@ -41567,6 +41730,13 @@ var setPinViewInputSchemaDefinition = external_exports.object({
|
|
|
41567
41730
|
minimised: external_exports.boolean().optional()
|
|
41568
41731
|
});
|
|
41569
41732
|
var setPinViewInputSchema = setPinViewInputSchemaDefinition;
|
|
41733
|
+
var reorderPinsInputSchemaDefinition = external_exports.object({
|
|
41734
|
+
workspaceId: external_exports.string().min(1),
|
|
41735
|
+
channel: external_exports.string().trim().min(1).max(120),
|
|
41736
|
+
/** The pinned apps in their new tab order; pins left out keep their order after these. */
|
|
41737
|
+
appIds: external_exports.array(external_exports.string().min(1)).min(1).max(APP_PINS_PER_CHANNEL_MAX)
|
|
41738
|
+
});
|
|
41739
|
+
var reorderPinsInputSchema = reorderPinsInputSchemaDefinition;
|
|
41570
41740
|
var pinAppByKeyInputSchemaDefinition = external_exports.object({
|
|
41571
41741
|
appId: external_exports.string().min(1),
|
|
41572
41742
|
/** Absent in an agent's turn means the conversation the turn runs in. */
|
|
@@ -41575,6 +41745,9 @@ var pinAppByKeyInputSchemaDefinition = external_exports.object({
|
|
|
41575
41745
|
var channelPinsByKeyInputSchemaDefinition = channelPinsInputSchemaDefinition.omit({
|
|
41576
41746
|
workspaceId: true
|
|
41577
41747
|
});
|
|
41748
|
+
var reorderPinsByKeyInputSchemaDefinition = reorderPinsInputSchemaDefinition.omit({
|
|
41749
|
+
workspaceId: true
|
|
41750
|
+
});
|
|
41578
41751
|
|
|
41579
41752
|
// ../../modules/app/contract/src/app.backup.ts
|
|
41580
41753
|
var appBackupCheckFailureSchemaDefinition = external_exports.object({
|
|
@@ -41598,7 +41771,7 @@ var appBackupCheckAlertsSchemaDefinition = external_exports.object({
|
|
|
41598
41771
|
// ../../modules/app/contract/src/app.trpc.ts
|
|
41599
41772
|
var appMainTrpc = defineTrpcContract("app").query("list").withInput(listAppsInputSchema).withOutput(external_exports.array(appSchema)).query("get").withInput(appRefSchema).withOutput(appSchema).mutation("create").withInput(createAppInputSchema).withOutput(appSchema).mutation("rename").withInput(renameAppInputSchema).withOutput(appSchema).mutation("archive").withInput(appRefSchema).withOutput(appSchema).mutation("unarchive").withInput(appRefSchema).withOutput(appSchema).mutation("delete").withInput(deleteAppInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("versions").withInput(appRefSchema).withOutput(external_exports.array(appVersionSchema)).mutation("revert").withInput(revertInputSchema).withOutput(appVersionSchema).mutation("publish").withInput(publishInputSchema).withOutput(publishOutcomeSchema).query("collections").withInput(siteRefSchema).withOutput(external_exports.array(collectionSchema)).query("records").withInput(listRecordsInputSchema).withOutput(recordPageSchema).mutation("writeRecord").withInput(writeRecordInputSchema).withOutput(appRecordSchema).mutation("deleteRecord").withInput(deleteRecordInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("views").withInput(siteRefSchema).withOutput(external_exports.array(appViewSchema)).mutation("saveView").withInput(saveViewInputSchema).withOutput(appViewSchema).mutation("deleteView").withInput(deleteViewInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("chooseCardRows").withInput(chooseCardRowsInputSchema).withOutput(appCardChoiceSchema).query("exportRecords").withInput(exportRecordsInputSchema).withOutput(recordExportSchema).mutation("importRecords").withInput(importRecordsInputSchema).withOutput(recordImportSchema).mutation("decidePublish").withInput(decidePublishInputSchema).withOutput(publishOutcomeSchema).mutation("nameVersion").withInput(nameVersionInputSchema).withOutput(appVersionSchema).mutation("makeInternal").withInput(appRefSchema).withOutput(appSchema).mutation("revokePublishLease").withInput(appRefSchema).withOutput(appSchema).mutation("signInHandoff").withInput(signInHandoffInputSchema).withOutput(signInHandoffSchema).query("functionLogs").withInput(listFunctionLogsInputSchema).withOutput(external_exports.array(appFunctionLogEntrySchema)).query("functionSettings").withInput(appWorkspaceRefSchema).withOutput(appFunctionSettingsSchema).query("access").withInput(appRefSchema).withOutput(appAccessSchema).mutation("grantAccess").withInput(grantAppAccessInputSchema).withOutput(appAccessSchema).mutation("revokeAccess").withInput(revokeAppAccessInputSchema).withOutput(appAccessSchema).mutation("setVisibility").withInput(setAppVisibilityInputSchema).withOutput(visibilityOutcomeSchema).mutation("setMemberRole").withInput(setMemberRoleInputSchema).withOutput(appAccessSchema).mutation("unpublish").withInput(appRefSchema).withOutput(appSchema).query("door").withInput(appRefSchema).withOutput(appDoorSchema).mutation("requestAccess").withInput(appRefSchema).withOutput(appDoorSchema).mutation("decideAccess").withInput(decideAppAccessInputSchema).withOutput(appAccessRequestSchema).query("users").withInput(appRefSchema).withOutput(appUsersSchema).mutation("blockUser").withInput(blockAppUserInputSchema).withOutput(appUsersSchema).mutation("deleteUser").withInput(deleteAppUserInputSchema).withOutput(deletedAppUserSchema).mutation("setFunctionsEnabled").withInput(setFunctionsEnabledInputSchema).withOutput(appFunctionSettingsSchema).query("backups").withInput(appRefSchema).withOutput(appBackupStatusSchema).mutation("restoreData").withInput(restoreAppDataInputSchema).withOutput(appRestoreSchema).query("cost").withInput(appRefSchema).withOutput(appCostSchema).mutation("setBudget").withInput(setAppBudgetInputSchema).withOutput(appCostSchema).query("triggers").withInput(appRefSchema).withOutput(appTriggersSchema).mutation("setTriggerPaused").withInput(setAppTriggerPausedInputSchema).withOutput(appTriggerSchema).mutation("removeTrigger").withInput(appTriggerRefSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
|
|
41600
41773
|
var appConnectionsTrpc = defineTrpcContract("app").query("connections").withInput(appRefSchema).withOutput(appConnectionsSchema).mutation("allowConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).mutation("revokeConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).build();
|
|
41601
|
-
var appPinsTrpc = defineTrpcContract("app").query("pins").withInput(channelPinsInputSchema).withOutput(channelAppPinsSchema).mutation("pin").withInput(pinAppInputSchema).withOutput(channelAppPinsSchema).mutation("unpin").withInput(pinAppInputSchema).withOutput(channelAppPinsSchema).mutation("setPinView").withInput(setPinViewInputSchema).withOutput(channelAppPinsSchema).build();
|
|
41774
|
+
var appPinsTrpc = defineTrpcContract("app").query("pins").withInput(channelPinsInputSchema).withOutput(channelAppPinsSchema).mutation("pin").withInput(pinAppInputSchema).withOutput(channelAppPinsSchema).mutation("unpin").withInput(pinAppInputSchema).withOutput(channelAppPinsSchema).mutation("setPinView").withInput(setPinViewInputSchema).withOutput(channelAppPinsSchema).mutation("reorderPins").withInput(reorderPinsInputSchema).withOutput(channelAppPinsSchema).build();
|
|
41602
41775
|
var appTrpc = joinTrpcContracts("app", appMainTrpc, appConnectionsTrpc, appPinsTrpc);
|
|
41603
41776
|
|
|
41604
41777
|
// ../../modules/app/contract/src/app.rest.ts
|
|
@@ -42798,7 +42971,7 @@ var appManageCommands = {
|
|
|
42798
42971
|
var USAGE3 = `Usage:
|
|
42799
42972
|
laze app pin [app] --channel <c>
|
|
42800
42973
|
laze app unpin [app] --channel <c>
|
|
42801
|
-
laze app pins <channel
|
|
42974
|
+
laze app pins <channel> [--order <app,app,...>]`;
|
|
42802
42975
|
function print3({
|
|
42803
42976
|
context,
|
|
42804
42977
|
args,
|
|
@@ -42850,7 +43023,9 @@ async function appPinsCommand({
|
|
|
42850
43023
|
const channel = args.words[2] ?? flagText({ args, name: "channel" });
|
|
42851
43024
|
if (!channel) throw new CliUsageError(USAGE3);
|
|
42852
43025
|
const client = await signed2();
|
|
42853
|
-
const
|
|
43026
|
+
const order = flagText({ args, name: "order" });
|
|
43027
|
+
const appIds = order.split(",").map((id) => id.trim()).filter(Boolean);
|
|
43028
|
+
const listed = appIds.length ? await client.post("/api/apps/pins/order", { channel, appIds }) : await client.post("/api/apps/pins", { channel });
|
|
42854
43029
|
print3({ context, args, value: listed, text: pinsText({ channel, listed }) });
|
|
42855
43030
|
}
|
|
42856
43031
|
|
|
@@ -42858,7 +43033,7 @@ async function appPinsCommand({
|
|
|
42858
43033
|
import { execFile } from "node:child_process";
|
|
42859
43034
|
import { mkdtemp, rm as rm4, writeFile as writeFile7 } from "node:fs/promises";
|
|
42860
43035
|
import { tmpdir } from "node:os";
|
|
42861
|
-
import { join as
|
|
43036
|
+
import { join as join6 } from "node:path";
|
|
42862
43037
|
import { promisify } from "node:util";
|
|
42863
43038
|
var run = promisify(execFile);
|
|
42864
43039
|
var MODULE_SYNTAX = /^\s*(import|export)\s/m;
|
|
@@ -42887,11 +43062,11 @@ async function scriptErrorsOf({
|
|
|
42887
43062
|
const unknown2 = unknownCollectionsOf({ files: files2, collections });
|
|
42888
43063
|
const scripts = files2.flatMap(scriptsOf);
|
|
42889
43064
|
if (scripts.length === 0) return unknown2;
|
|
42890
|
-
const dir = await mkdtemp(
|
|
43065
|
+
const dir = await mkdtemp(join6(tmpdir(), "laze-app-check-"));
|
|
42891
43066
|
try {
|
|
42892
43067
|
const errors = await Promise.all(
|
|
42893
43068
|
scripts.map(async (script, index) => {
|
|
42894
|
-
const file3 =
|
|
43069
|
+
const file3 = join6(dir, `${index}.${script.module ? "mjs" : "cjs"}`);
|
|
42895
43070
|
await writeFile7(file3, script.code);
|
|
42896
43071
|
try {
|
|
42897
43072
|
await run(process.execPath, ["--check", file3]);
|
|
@@ -43064,10 +43239,10 @@ function siteOf(args, fallback) {
|
|
|
43064
43239
|
return site;
|
|
43065
43240
|
}
|
|
43066
43241
|
function folderOf({ context, word: word2 }) {
|
|
43067
|
-
return
|
|
43242
|
+
return resolve5(context.cwd, word2 ?? ".");
|
|
43068
43243
|
}
|
|
43069
43244
|
async function readManifest(folder) {
|
|
43070
|
-
const text2 = await readFile7(
|
|
43245
|
+
const text2 = await readFile7(join7(folder, APP_MANIFEST_FILE), "utf8").catch(() => void 0);
|
|
43071
43246
|
if (text2 === void 0) return void 0;
|
|
43072
43247
|
const parsed = appManifestSchema.safeParse(JSON.parse(text2));
|
|
43073
43248
|
if (!parsed.success) {
|
|
@@ -43102,7 +43277,7 @@ async function jsonFlag({
|
|
|
43102
43277
|
}) {
|
|
43103
43278
|
const raw = flagText({ args, name: name2 });
|
|
43104
43279
|
if (!raw) return void 0;
|
|
43105
|
-
const text2 = raw.startsWith("@") ? await readFile7(
|
|
43280
|
+
const text2 = raw.startsWith("@") ? await readFile7(resolve5(context.cwd, raw.slice(1)), "utf8") : raw;
|
|
43106
43281
|
try {
|
|
43107
43282
|
return JSON.parse(text2);
|
|
43108
43283
|
} catch {
|
|
@@ -43115,8 +43290,8 @@ async function listFiles(folder) {
|
|
|
43115
43290
|
while (pending.length > 0 && found.length <= MAX_FILES) {
|
|
43116
43291
|
const current2 = pending.pop() ?? folder;
|
|
43117
43292
|
for (const entry of await readdir2(current2, { withFileTypes: true })) {
|
|
43118
|
-
const path =
|
|
43119
|
-
const rel =
|
|
43293
|
+
const path = join7(current2, entry.name);
|
|
43294
|
+
const rel = relative2(folder, path).split(sep).join("/");
|
|
43120
43295
|
if (isSkippedPath({ path: rel })) continue;
|
|
43121
43296
|
if (entry.isDirectory()) pending.push(path);
|
|
43122
43297
|
else if (entry.isFile()) found.push(path);
|
|
@@ -43155,12 +43330,12 @@ var appCreate = async ({ context, args }) => {
|
|
|
43155
43330
|
...channel ? { channel } : {},
|
|
43156
43331
|
...visibility ? { visibility } : {}
|
|
43157
43332
|
});
|
|
43158
|
-
const folder =
|
|
43333
|
+
const folder = resolve5(context.cwd, flagText({ args, name: "dir", fallback: app2.slug }));
|
|
43159
43334
|
await mkdir7(folder, { recursive: true });
|
|
43160
43335
|
const files2 = template ? templateFiles({ template, name: name2 }) : {};
|
|
43161
43336
|
for (const [path, content] of Object.entries(files2)) {
|
|
43162
|
-
await mkdir7(
|
|
43163
|
-
await writeFile8(
|
|
43337
|
+
await mkdir7(dirname6(join7(folder, path)), { recursive: true });
|
|
43338
|
+
await writeFile8(join7(folder, path), content);
|
|
43164
43339
|
}
|
|
43165
43340
|
const manifest = {
|
|
43166
43341
|
app: { id: app2.id, name: app2.name, slug: app2.slug },
|
|
@@ -43168,14 +43343,14 @@ var appCreate = async ({ context, args }) => {
|
|
|
43168
43343
|
views: template?.views ? [...template.views] : [],
|
|
43169
43344
|
seed: template ? { ...template.seed } : {}
|
|
43170
43345
|
};
|
|
43171
|
-
await writeFile8(
|
|
43346
|
+
await writeFile8(join7(folder, APP_MANIFEST_FILE), `${JSON.stringify(manifest, null, 2)}
|
|
43172
43347
|
`);
|
|
43173
43348
|
print5({
|
|
43174
43349
|
context,
|
|
43175
43350
|
args,
|
|
43176
43351
|
value: { app: app2, folder },
|
|
43177
|
-
text: `Created ${app2.name} (${app2.id}) in ${
|
|
43178
|
-
Next: cd ${
|
|
43352
|
+
text: `Created ${app2.name} (${app2.id}) in ${relative2(context.cwd, folder) || "."}${template ? ` from the ${templateName} template` : ""}.
|
|
43353
|
+
Next: cd ${relative2(context.cwd, folder) || "."} && laze app push -m "First version" --seed
|
|
43179
43354
|
`
|
|
43180
43355
|
});
|
|
43181
43356
|
};
|
|
@@ -43204,7 +43379,7 @@ var appPush = async ({ context, args }) => {
|
|
|
43204
43379
|
const files2 = await Promise.all(
|
|
43205
43380
|
paths.map(
|
|
43206
43381
|
async (path) => buildFileOf({
|
|
43207
|
-
path:
|
|
43382
|
+
path: relative2(folder, path).split(sep).join("/"),
|
|
43208
43383
|
bytes: await readFile7(path)
|
|
43209
43384
|
})
|
|
43210
43385
|
)
|
|
@@ -43558,16 +43733,16 @@ var appExport = async ({ context, args }) => {
|
|
|
43558
43733
|
});
|
|
43559
43734
|
const out = flagText({ args, name: "out" });
|
|
43560
43735
|
if (!out) return context.out(exported.body);
|
|
43561
|
-
const target =
|
|
43736
|
+
const target = resolve5(context.cwd, out);
|
|
43562
43737
|
await writeFile8(target, exported.body);
|
|
43563
|
-
context.out(`Wrote ${exported.rows} records to ${
|
|
43738
|
+
context.out(`Wrote ${exported.rows} records to ${relative2(context.cwd, target)}
|
|
43564
43739
|
`);
|
|
43565
43740
|
};
|
|
43566
43741
|
var appImport = async ({ context, args }) => {
|
|
43567
43742
|
const words = args.words.slice(2);
|
|
43568
43743
|
const [named, collection, file3] = words.length >= 3 ? words : [void 0, ...words];
|
|
43569
43744
|
if (!collection || !file3) throw new CliUsageError(USAGE5);
|
|
43570
|
-
const csv = await readFile7(
|
|
43745
|
+
const csv = await readFile7(resolve5(context.cwd, file3), "utf8").catch(() => {
|
|
43571
43746
|
throw new CliUsageError(`Cannot read ${file3}`);
|
|
43572
43747
|
});
|
|
43573
43748
|
const scoped = named ? { ...args, flags: { ...args.flags, app: named } } : args;
|
|
@@ -43586,7 +43761,7 @@ var appImport = async ({ context, args }) => {
|
|
|
43586
43761
|
});
|
|
43587
43762
|
const refusedOut = flagText({ args, name: "refused" });
|
|
43588
43763
|
if (refusedOut && result.refusedCsv) {
|
|
43589
|
-
await writeFile8(
|
|
43764
|
+
await writeFile8(resolve5(context.cwd, refusedOut), result.refusedCsv);
|
|
43590
43765
|
}
|
|
43591
43766
|
const fitting = result.rows - result.refused.length;
|
|
43592
43767
|
const skipped = result.refused.slice(0, 20).map((row) => ` line ${row.line}: ${row.reason}
|
|
@@ -44134,7 +44309,7 @@ async function billing({ context, args }) {
|
|
|
44134
44309
|
// src/services/browser-commands.service.ts
|
|
44135
44310
|
import { randomBytes } from "node:crypto";
|
|
44136
44311
|
import { mkdir as mkdir8, readFile as readFile8, writeFile as writeFile9 } from "node:fs/promises";
|
|
44137
|
-
import { dirname as
|
|
44312
|
+
import { dirname as dirname7, join as join8 } from "node:path";
|
|
44138
44313
|
|
|
44139
44314
|
// src/services/cdp-bridge.service.ts
|
|
44140
44315
|
import { spawn as spawn3 } from "node:child_process";
|
|
@@ -44178,7 +44353,7 @@ function tunnel({
|
|
|
44178
44353
|
host: host2,
|
|
44179
44354
|
port
|
|
44180
44355
|
}) {
|
|
44181
|
-
return new Promise((
|
|
44356
|
+
return new Promise((resolve15, reject) => {
|
|
44182
44357
|
const socket = connectTcp(proxy.port, proxy.host);
|
|
44183
44358
|
let answer4 = "";
|
|
44184
44359
|
const auth = proxy.authorization ? `Proxy-Authorization: ${proxy.authorization}\r
|
|
@@ -44195,7 +44370,7 @@ ${auth}\r
|
|
|
44195
44370
|
answer4 += chunk.toString("latin1");
|
|
44196
44371
|
if (!answer4.includes(HEADER_END)) return;
|
|
44197
44372
|
socket.off("data", onData);
|
|
44198
|
-
if (/^HTTP\/1\.[01] 200/.test(answer4)) return
|
|
44373
|
+
if (/^HTTP\/1\.[01] 200/.test(answer4)) return resolve15(socket);
|
|
44199
44374
|
socket.destroy();
|
|
44200
44375
|
reject(new Error(`proxy refused the tunnel: ${answer4.split("\r\n")[0] ?? ""}`));
|
|
44201
44376
|
};
|
|
@@ -44208,8 +44383,8 @@ async function upstreamOf({ target, proxy }) {
|
|
|
44208
44383
|
const raw = proxy ? await tunnel({ proxy, host: target.hostname, port }) : connectTcp(port, target.hostname);
|
|
44209
44384
|
if (!secure) return raw;
|
|
44210
44385
|
const tls = connectTls({ socket: raw, servername: target.hostname });
|
|
44211
|
-
await new Promise((
|
|
44212
|
-
tls.once("secureConnect", () =>
|
|
44386
|
+
await new Promise((resolve15, reject) => {
|
|
44387
|
+
tls.once("secureConnect", () => resolve15());
|
|
44213
44388
|
tls.once("error", reject);
|
|
44214
44389
|
});
|
|
44215
44390
|
return tls;
|
|
@@ -44251,8 +44426,8 @@ async function browserSocket({
|
|
|
44251
44426
|
createConnection: () => upstream,
|
|
44252
44427
|
perMessageDeflate: false
|
|
44253
44428
|
});
|
|
44254
|
-
await new Promise((
|
|
44255
|
-
socket.once("open", () =>
|
|
44429
|
+
await new Promise((resolve15, reject) => {
|
|
44430
|
+
socket.once("open", () => resolve15());
|
|
44256
44431
|
socket.once("error", reject);
|
|
44257
44432
|
});
|
|
44258
44433
|
return socket;
|
|
@@ -44265,12 +44440,12 @@ async function browserCall({
|
|
|
44265
44440
|
}) {
|
|
44266
44441
|
const socket = await browserSocket({ target, proxy });
|
|
44267
44442
|
try {
|
|
44268
|
-
return await new Promise((
|
|
44443
|
+
return await new Promise((resolve15, reject) => {
|
|
44269
44444
|
socket.on("message", (data) => {
|
|
44270
44445
|
const reply2 = JSON.parse(textOf2(data));
|
|
44271
44446
|
if (reply2.id !== 1) return;
|
|
44272
44447
|
if (reply2.error) reject(new Error(`${method}: ${JSON.stringify(reply2.error)}`));
|
|
44273
|
-
else
|
|
44448
|
+
else resolve15(reply2.result ?? {});
|
|
44274
44449
|
});
|
|
44275
44450
|
socket.once("close", () => reject(new Error(`${method}: the machine closed the socket`)));
|
|
44276
44451
|
socket.send(JSON.stringify({ id: 1, method, params }));
|
|
@@ -44409,18 +44584,18 @@ function retargetCdpBridge({
|
|
|
44409
44584
|
target,
|
|
44410
44585
|
expiresAt
|
|
44411
44586
|
}) {
|
|
44412
|
-
return new Promise((
|
|
44587
|
+
return new Promise((resolve15) => {
|
|
44413
44588
|
const call = httpRequest(
|
|
44414
44589
|
{ host: "127.0.0.1", port, path: TARGET_PATH, method: "PUT", timeout: 2e3 },
|
|
44415
44590
|
(response) => {
|
|
44416
44591
|
response.resume();
|
|
44417
|
-
|
|
44592
|
+
resolve15(response.statusCode === 204);
|
|
44418
44593
|
}
|
|
44419
44594
|
);
|
|
44420
44595
|
call.setHeader(KEY_HEADER, key);
|
|
44421
44596
|
call.setHeader("content-type", "application/json");
|
|
44422
44597
|
call.once("timeout", () => call.destroy());
|
|
44423
|
-
call.once("error", () =>
|
|
44598
|
+
call.once("error", () => resolve15(false));
|
|
44424
44599
|
call.end(JSON.stringify({ target, expiresAt }));
|
|
44425
44600
|
});
|
|
44426
44601
|
}
|
|
@@ -44469,15 +44644,15 @@ async function startCdpBridge({
|
|
|
44469
44644
|
(socket) => relayPage({ client: socket, targetId, target: url2, proxy })
|
|
44470
44645
|
);
|
|
44471
44646
|
});
|
|
44472
|
-
await new Promise((
|
|
44647
|
+
await new Promise((resolve15) => server.listen(0, "127.0.0.1", resolve15));
|
|
44473
44648
|
const port = server.address().port;
|
|
44474
44649
|
return {
|
|
44475
44650
|
port,
|
|
44476
|
-
close: () => new Promise((
|
|
44651
|
+
close: () => new Promise((resolve15) => {
|
|
44477
44652
|
for (const client of relayed) client.destroy();
|
|
44478
44653
|
pages.close();
|
|
44479
44654
|
server.closeAllConnections();
|
|
44480
|
-
server.close(() =>
|
|
44655
|
+
server.close(() => resolve15());
|
|
44481
44656
|
})
|
|
44482
44657
|
};
|
|
44483
44658
|
}
|
|
@@ -44494,7 +44669,7 @@ function launchCdpBridge({
|
|
|
44494
44669
|
stdio: ["ignore", "pipe", "ignore"],
|
|
44495
44670
|
env: { ...env, LAZE_CDP_TARGET: target, LAZE_CDP_EXPIRES_AT: expiresAt, LAZE_CDP_KEY: key }
|
|
44496
44671
|
});
|
|
44497
|
-
return new Promise((
|
|
44672
|
+
return new Promise((resolve15, reject) => {
|
|
44498
44673
|
let printed = "";
|
|
44499
44674
|
child.once("error", reject);
|
|
44500
44675
|
child.once("exit", (code) => reject(new Error(`the CDP bridge stopped (${code})`)));
|
|
@@ -44505,7 +44680,7 @@ function launchCdpBridge({
|
|
|
44505
44680
|
child.stdout.destroy();
|
|
44506
44681
|
child.removeAllListeners("exit");
|
|
44507
44682
|
child.unref();
|
|
44508
|
-
if (Number.isInteger(port) && port > 0)
|
|
44683
|
+
if (Number.isInteger(port) && port > 0) resolve15(port);
|
|
44509
44684
|
else reject(new Error("the CDP bridge printed no port"));
|
|
44510
44685
|
});
|
|
44511
44686
|
});
|
|
@@ -44608,7 +44783,7 @@ async function cdp({ context, args }) {
|
|
|
44608
44783
|
}
|
|
44609
44784
|
function bridgeStatePath({ context, machine: machine2 }) {
|
|
44610
44785
|
const safe = machine2.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
44611
|
-
return
|
|
44786
|
+
return join8(dirname7(context.environment.configPath), "bridges", `${safe}.json`);
|
|
44612
44787
|
}
|
|
44613
44788
|
async function bridgePort({
|
|
44614
44789
|
context,
|
|
@@ -44629,7 +44804,7 @@ async function bridgePort({
|
|
|
44629
44804
|
key,
|
|
44630
44805
|
...target
|
|
44631
44806
|
});
|
|
44632
|
-
await mkdir8(
|
|
44807
|
+
await mkdir8(dirname7(path), { recursive: true, mode: 448 });
|
|
44633
44808
|
await writeFile9(path, JSON.stringify({ port, key }), { mode: 384 });
|
|
44634
44809
|
return port;
|
|
44635
44810
|
}
|
|
@@ -45168,8 +45343,9 @@ function muteTextOf({ mute }) {
|
|
|
45168
45343
|
}
|
|
45169
45344
|
function settingRowOf({ channel }) {
|
|
45170
45345
|
const level = channel.level === "everything" ? "Everything" : "Mentions only";
|
|
45346
|
+
const isDefault = channel.isDefault ? " default agent" : "";
|
|
45171
45347
|
const mute = channel.mute ? ` ${muteTextOf({ mute: channel.mute })}` : "";
|
|
45172
|
-
return `#${channel.name} ${level}${mute}
|
|
45348
|
+
return `#${channel.name} ${level}${isDefault}${mute}
|
|
45173
45349
|
`;
|
|
45174
45350
|
}
|
|
45175
45351
|
|
|
@@ -45226,7 +45402,7 @@ async function channelSettings({ context, args }) {
|
|
|
45226
45402
|
|
|
45227
45403
|
// src/services/chat-actions-commands.service.ts
|
|
45228
45404
|
import { readFile as readFile9 } from "node:fs/promises";
|
|
45229
|
-
import { basename as basename2, resolve as
|
|
45405
|
+
import { basename as basename2, resolve as resolve6 } from "node:path";
|
|
45230
45406
|
var CHAT_ACTIONS_USAGE = `Usage:
|
|
45231
45407
|
laze thread <messageId> a message's thread: its root and replies
|
|
45232
45408
|
laze thread follow <messageId> [--off] follow a thread, or stop
|
|
@@ -45466,7 +45642,7 @@ async function sendParts({
|
|
|
45466
45642
|
return ticket.mode === "multipart" ? parts : [];
|
|
45467
45643
|
}
|
|
45468
45644
|
var fileUpload = async ({ context, args, client }) => {
|
|
45469
|
-
const path =
|
|
45645
|
+
const path = resolve6(context.cwd, wordAt(args, 3));
|
|
45470
45646
|
const bytes = new Uint8Array(await readFile9(path));
|
|
45471
45647
|
const ticket = await client.post(CHAT_KEY_PATHS.startUpload, {
|
|
45472
45648
|
channel: wordAt(args, 2),
|
|
@@ -45637,7 +45813,7 @@ async function chatActions({
|
|
|
45637
45813
|
|
|
45638
45814
|
// src/services/claude-wait.service.ts
|
|
45639
45815
|
import { readFile as readFile10, rm as rm5, writeFile as writeFile10, mkdir as mkdir9 } from "node:fs/promises";
|
|
45640
|
-
import { dirname as
|
|
45816
|
+
import { dirname as dirname8 } from "node:path";
|
|
45641
45817
|
var ROUND_SECONDS2 = 50;
|
|
45642
45818
|
var WATCH_MS = 2e3;
|
|
45643
45819
|
var CHANNEL_CHECK_MS = 5e3;
|
|
@@ -45655,7 +45831,7 @@ async function takeLock({
|
|
|
45655
45831
|
const holder = await holderOf({ path });
|
|
45656
45832
|
const self2 = context.processes.pid;
|
|
45657
45833
|
if (holder && holder.pid !== self2 && context.processes.alive(holder.pid)) return false;
|
|
45658
|
-
await mkdir9(
|
|
45834
|
+
await mkdir9(dirname8(path), { recursive: true, mode: 448 });
|
|
45659
45835
|
await writeFile10(path, JSON.stringify({ pid: self2, ...sessionId ? { sessionId } : {} }));
|
|
45660
45836
|
return true;
|
|
45661
45837
|
}
|
|
@@ -46103,6 +46279,12 @@ var setComplimentaryPlanInputDefinition = external_exports.object({
|
|
|
46103
46279
|
seats: external_exports.number().int().positive().max(1e4).nullable(),
|
|
46104
46280
|
reason: external_exports.string().trim().min(3).max(500)
|
|
46105
46281
|
});
|
|
46282
|
+
var grantCreditsInputDefinition = external_exports.object({
|
|
46283
|
+
workspaceId: external_exports.string().min(1),
|
|
46284
|
+
/** Whole currency units of the workspace's currency. */
|
|
46285
|
+
amount: external_exports.number().positive().max(1e4),
|
|
46286
|
+
reason: external_exports.string().trim().min(3).max(500)
|
|
46287
|
+
});
|
|
46106
46288
|
var BillingApi = moduleApi()("billing");
|
|
46107
46289
|
var billingTrpc = defineTrpcContract("billing").query("account").withInput(billingWorkspaceInputSchema).withOutput(billingAccountViewSchema).query("invoices").withInput(billingWorkspaceInputSchema).withOutput(external_exports.array(billingInvoiceSchema)).mutation("startCheckout").withInput(startCheckoutInputSchema).withOutput(billingRedirectSchema).mutation("openPortal").withInput(openPortalInputSchema).withOutput(billingRedirectSchema).mutation("setCurrency").withInput(setCurrencyInputSchema).withOutput(billingAccountViewSchema).mutation("topUp").withInput(topUpInputSchema).withOutput(billingRedirectSchema).mutation("setAutoRecharge").withInput(setAutoRechargeInputSchema).withOutput(billingAccountViewSchema).mutation("applyReferral").withInput(applyReferralInputSchema).withOutput(billingAccountViewSchema).build();
|
|
46108
46290
|
var stripeWebhookHeadersDefinition = external_exports.object({
|
|
@@ -47285,7 +47467,7 @@ async function connect({
|
|
|
47285
47467
|
|
|
47286
47468
|
// src/services/connector-commands.service.ts
|
|
47287
47469
|
import { readFile as readFile14 } from "node:fs/promises";
|
|
47288
|
-
import { resolve as
|
|
47470
|
+
import { resolve as resolve7 } from "node:path";
|
|
47289
47471
|
|
|
47290
47472
|
// src/services/vault-keychain-commands.service.ts
|
|
47291
47473
|
import { readFile as readFile13 } from "node:fs/promises";
|
|
@@ -47797,7 +47979,7 @@ async function keyText({ context, args }) {
|
|
|
47797
47979
|
throw new CliUsageError("A key never goes in a flag: pipe it on stdin or use --from-file.");
|
|
47798
47980
|
}
|
|
47799
47981
|
const file3 = flagText({ args, name: "from-file" });
|
|
47800
|
-
const text2 = file3 ? await readFile14(
|
|
47982
|
+
const text2 = file3 ? await readFile14(resolve7(context.cwd, file3), "utf8") : await context.readStdin();
|
|
47801
47983
|
const trimmed = text2.trim();
|
|
47802
47984
|
if (!trimmed) throw new CliUsageError("No key: pipe it on stdin or use --from-file.");
|
|
47803
47985
|
return trimmed;
|
|
@@ -48183,8 +48365,8 @@ var DOMAINS_USAGE = `Usage:
|
|
|
48183
48365
|
var printJson4 = (context, data) => context.out(`${JSON.stringify(data, null, 2)}
|
|
48184
48366
|
`);
|
|
48185
48367
|
function printDomain(context, row) {
|
|
48186
|
-
const
|
|
48187
|
-
context.out(`${row.domain} ${
|
|
48368
|
+
const join12 = row.autoJoin ? "auto-join on" : "auto-join off";
|
|
48369
|
+
context.out(`${row.domain} ${join12}${row.enforced ? " single sign-on enforced" : ""}
|
|
48188
48370
|
`);
|
|
48189
48371
|
}
|
|
48190
48372
|
async function list4({ context, args }) {
|
|
@@ -48217,7 +48399,7 @@ async function domains({ context, args }) {
|
|
|
48217
48399
|
|
|
48218
48400
|
// src/services/feed-commands.service.ts
|
|
48219
48401
|
import { readFile as readFile15 } from "node:fs/promises";
|
|
48220
|
-
import { resolve as
|
|
48402
|
+
import { resolve as resolve8 } from "node:path";
|
|
48221
48403
|
|
|
48222
48404
|
// src/rules/feed-input.rules.ts
|
|
48223
48405
|
var TEXT_FLAGS = { body: "body", draft: "draft", summary: "summary" };
|
|
@@ -48271,10 +48453,10 @@ function feedFlagsOf({ args }) {
|
|
|
48271
48453
|
if (args.flags.urgent) fields.urgent = true;
|
|
48272
48454
|
const showAt = flagText({ args, name: "show-at" });
|
|
48273
48455
|
if (showAt) fields.showAt = dateOf(showAt);
|
|
48274
|
-
const
|
|
48275
|
-
if (
|
|
48276
|
-
const
|
|
48277
|
-
if (
|
|
48456
|
+
const group = flagText({ args, name: "group" });
|
|
48457
|
+
if (group) fields.group = group;
|
|
48458
|
+
const labels = args.lists.label ?? [];
|
|
48459
|
+
if (labels.length > 0) fields.labels = [...labels];
|
|
48278
48460
|
const autoSendOn = flagText({ args, name: "auto-send-on" });
|
|
48279
48461
|
if (autoSendOn) fields.autoSendOn = dateOf(autoSendOn);
|
|
48280
48462
|
return { fields: { ...fields, ...snoozeOf(args) }, texts };
|
|
@@ -48287,7 +48469,7 @@ var USAGE8 = `Usage:
|
|
|
48287
48469
|
[--link <label>=<url>]... [--action <label>=<message>]... [--to <userId>]...
|
|
48288
48470
|
[--urgent] [--done-label <line>] [--show-at <ISO time>]
|
|
48289
48471
|
[--snooze-for <userId>... --until <ISO time>]
|
|
48290
|
-
[--
|
|
48472
|
+
[--group <name> [--label <word>]...] [--loop <key> [--reopen]]
|
|
48291
48473
|
[--auto-send-on <YYYY-MM-DD>]
|
|
48292
48474
|
laze feed update <id> [the post flags that change] [--title <title>]
|
|
48293
48475
|
[--auto-send-on <YYYY-MM-DD>|none]
|
|
@@ -48295,7 +48477,9 @@ var USAGE8 = `Usage:
|
|
|
48295
48477
|
laze feed reply <id> <text> [--urgent]
|
|
48296
48478
|
laze feed read <id>
|
|
48297
48479
|
laze feed inbox
|
|
48298
|
-
laze feed
|
|
48480
|
+
laze feed close <id>|--loop <key> --note <text>
|
|
48481
|
+
laze feed loops
|
|
48482
|
+
laze feed group-summary <group>
|
|
48299
48483
|
laze feed list [--json]
|
|
48300
48484
|
laze feed count
|
|
48301
48485
|
laze feed act <id> <actionId> [--draft <text|@file>]
|
|
@@ -48316,7 +48500,7 @@ async function bodyOf2({
|
|
|
48316
48500
|
}) {
|
|
48317
48501
|
const body = { ...flags2.fields };
|
|
48318
48502
|
for (const [field, source] of Object.entries(flags2.texts)) {
|
|
48319
|
-
body[field] = "file" in source ? await readFile15(
|
|
48503
|
+
body[field] = "file" in source ? await readFile15(resolve8(context.cwd, source.file), "utf8") : source.text;
|
|
48320
48504
|
}
|
|
48321
48505
|
return body;
|
|
48322
48506
|
}
|
|
@@ -48348,6 +48532,7 @@ async function feedPost({ context, args }) {
|
|
|
48348
48532
|
title,
|
|
48349
48533
|
...channel ? { channel } : {},
|
|
48350
48534
|
...loop ? { loop } : {},
|
|
48535
|
+
...loop && args.flags.reopen ? { reopen: true } : {},
|
|
48351
48536
|
to: [...args.lists.to ?? []]
|
|
48352
48537
|
});
|
|
48353
48538
|
if (args.flags.json) return printItem({ context, args, item: posted });
|
|
@@ -48398,11 +48583,39 @@ async function feedInbox({ context, args }) {
|
|
|
48398
48583
|
`);
|
|
48399
48584
|
for (const item of items) printItem({ context, args, item });
|
|
48400
48585
|
}
|
|
48401
|
-
async function
|
|
48402
|
-
const
|
|
48403
|
-
|
|
48586
|
+
async function feedClose({ context, args }) {
|
|
48587
|
+
const itemId = args.words[2];
|
|
48588
|
+
const loop = flagText({ args, name: "loop" });
|
|
48589
|
+
const note = flagText({ args, name: "note" });
|
|
48590
|
+
if (!note || Boolean(itemId) === Boolean(loop)) throw new CliUsageError(USAGE8);
|
|
48404
48591
|
const { client } = await signedIn({ context, args });
|
|
48405
|
-
const
|
|
48592
|
+
const closed = await client.post("/api/feed/items/close", {
|
|
48593
|
+
...itemId ? { itemId } : { loop },
|
|
48594
|
+
note
|
|
48595
|
+
});
|
|
48596
|
+
if (args.flags.json) return printItem({ context, args, item: closed });
|
|
48597
|
+
context.out(`${closed.item.id} closed ${closed.item.title}
|
|
48598
|
+
`);
|
|
48599
|
+
}
|
|
48600
|
+
async function feedLoops({ context, args }) {
|
|
48601
|
+
const { client } = await signedIn({ context, args });
|
|
48602
|
+
const loops = await client.get("/api/feed/loops");
|
|
48603
|
+
if (args.flags.json) return context.out(`${JSON.stringify(loops, null, 2)}
|
|
48604
|
+
`);
|
|
48605
|
+
if (loops.length === 0) return context.out("No open loops.\n");
|
|
48606
|
+
for (const loop of loops) {
|
|
48607
|
+
const people = loop.recipients.map((row) => `${row.userId}:${row.state}`).join(" ");
|
|
48608
|
+
context.out(`${loop.loop} ${loop.itemId} ${loop.lastActivityAt} ${loop.title}
|
|
48609
|
+
`);
|
|
48610
|
+
context.out(` ${people}
|
|
48611
|
+
`);
|
|
48612
|
+
}
|
|
48613
|
+
}
|
|
48614
|
+
async function feedGroupSummary({ context, args }) {
|
|
48615
|
+
const group = args.words.slice(2).join(" ").trim();
|
|
48616
|
+
if (!group) throw new CliUsageError(USAGE8);
|
|
48617
|
+
const { client } = await signedIn({ context, args });
|
|
48618
|
+
const pointer = await client.post("/api/feed/group-summary", { group });
|
|
48406
48619
|
if (args.flags.json) return context.out(`${JSON.stringify(pointer, null, 2)}
|
|
48407
48620
|
`);
|
|
48408
48621
|
const link = pointer.link.startsWith("/") ? pointer.path : pointer.link;
|
|
@@ -48438,7 +48651,7 @@ async function textFlag({
|
|
|
48438
48651
|
}) {
|
|
48439
48652
|
const value = flagText({ args, name: name2 });
|
|
48440
48653
|
if (!value.startsWith("@")) return value;
|
|
48441
|
-
return readFile15(
|
|
48654
|
+
return readFile15(resolve8(context.cwd, value.slice(1)), "utf8");
|
|
48442
48655
|
}
|
|
48443
48656
|
async function feedList({ context, args }) {
|
|
48444
48657
|
const { client } = await signedIn({ context, args });
|
|
@@ -48526,7 +48739,9 @@ var FEED_COMMANDS = {
|
|
|
48526
48739
|
reply: feedReply,
|
|
48527
48740
|
read: feedRead,
|
|
48528
48741
|
inbox: feedInbox,
|
|
48529
|
-
"
|
|
48742
|
+
"group-summary": feedGroupSummary,
|
|
48743
|
+
close: feedClose,
|
|
48744
|
+
loops: feedLoops,
|
|
48530
48745
|
list: feedList,
|
|
48531
48746
|
count: feedCount,
|
|
48532
48747
|
act: feedAct,
|
|
@@ -49037,11 +49252,11 @@ async function ip({ context, args }) {
|
|
|
49037
49252
|
|
|
49038
49253
|
// src/services/join-commands.service.ts
|
|
49039
49254
|
import { mkdir as mkdir10, readFile as readFile18, rename as rename4, rm as rm6, writeFile as writeFile11 } from "node:fs/promises";
|
|
49040
|
-
import { dirname as
|
|
49255
|
+
import { dirname as dirname9, join as join9 } from "node:path";
|
|
49041
49256
|
var DEFAULT_WAIT_SECONDS = 100;
|
|
49042
|
-
var JOIN_USAGE = "Usage: laze join [--workspace <name|id|invite link>] [--for <email>] [--name <name>] [--note <text>] [--timeout <seconds>]";
|
|
49257
|
+
var JOIN_USAGE = "Usage: laze join [--workspace <name|id|invite link>] [--for <email>] [--name <name>] [--note <text>] [--timeout <seconds>] [--project <folder>]";
|
|
49043
49258
|
function pendingPathOf({ context }) {
|
|
49044
|
-
return
|
|
49259
|
+
return join9(dirname9(context.environment.configPath), "join", "pending.json");
|
|
49045
49260
|
}
|
|
49046
49261
|
async function readPending({
|
|
49047
49262
|
context,
|
|
@@ -49058,7 +49273,7 @@ async function readPending({
|
|
|
49058
49273
|
}
|
|
49059
49274
|
async function keepPending({ context, pending }) {
|
|
49060
49275
|
const path = pendingPathOf({ context });
|
|
49061
|
-
await mkdir10(
|
|
49276
|
+
await mkdir10(dirname9(path), { recursive: true, mode: 448 });
|
|
49062
49277
|
const temporary = `${path}.${process.pid}.tmp`;
|
|
49063
49278
|
await writeFile11(temporary, JSON.stringify(pending), { mode: 384 });
|
|
49064
49279
|
await rename4(temporary, path);
|
|
@@ -49380,7 +49595,7 @@ function machineAccessCommand(name2) {
|
|
|
49380
49595
|
import { createHash } from "node:crypto";
|
|
49381
49596
|
import { mkdir as mkdir11, readFile as readFile19, rm as rm7, writeFile as writeFile12 } from "node:fs/promises";
|
|
49382
49597
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
49383
|
-
import { dirname as
|
|
49598
|
+
import { dirname as dirname10, join as join10 } from "node:path";
|
|
49384
49599
|
var USAGE9 = `Usage: laze vault run <connection> --reason "<one plain sentence>" [--wait <s>] -- <command> [args...]
|
|
49385
49600
|
Runs the command with the connection's values in its environment, on a Laze agent's computer
|
|
49386
49601
|
or on a machine it runs on.`;
|
|
@@ -49429,8 +49644,8 @@ function runKeyPathOf({
|
|
|
49429
49644
|
connection
|
|
49430
49645
|
}) {
|
|
49431
49646
|
const name2 = createHash("sha256").update(connection).digest("hex");
|
|
49432
|
-
const base = turnFile ?
|
|
49433
|
-
return
|
|
49647
|
+
const base = turnFile ? dirname10(turnFile) : join10(tmpdir2(), "laze-vault");
|
|
49648
|
+
return join10(base, "vault-run-keys", `${name2}.json`);
|
|
49434
49649
|
}
|
|
49435
49650
|
async function runKeyAt({ path }) {
|
|
49436
49651
|
const saved3 = await readFile19(path, "utf8").then(
|
|
@@ -49443,7 +49658,7 @@ async function runKeyAt({ path }) {
|
|
|
49443
49658
|
}
|
|
49444
49659
|
const fresh = await generateEcdhKeys();
|
|
49445
49660
|
const jwk = await globalThis.crypto.subtle.exportKey("jwk", fresh.privateKey);
|
|
49446
|
-
await mkdir11(
|
|
49661
|
+
await mkdir11(dirname10(path), { recursive: true, mode: 448 });
|
|
49447
49662
|
await writeFile12(path, JSON.stringify({ publicKey: fresh.publicKey, privateKey: jwk }), {
|
|
49448
49663
|
mode: 384
|
|
49449
49664
|
});
|
|
@@ -50116,13 +50331,13 @@ async function serveMcp({
|
|
|
50116
50331
|
|
|
50117
50332
|
// src/services/mount-files.service.ts
|
|
50118
50333
|
import { mkdir as mkdir12, readFile as readFile20, rm as rm8, writeFile as writeFile13 } from "node:fs/promises";
|
|
50119
|
-
import { dirname as
|
|
50334
|
+
import { dirname as dirname11, relative as relative3, resolve as resolve9 } from "node:path";
|
|
50120
50335
|
async function textArgument({
|
|
50121
50336
|
context,
|
|
50122
50337
|
value
|
|
50123
50338
|
}) {
|
|
50124
50339
|
if (value === "-") return context.readStdin();
|
|
50125
|
-
if (value.startsWith("@")) return readFile20(
|
|
50340
|
+
if (value.startsWith("@")) return readFile20(resolve9(context.cwd, value.slice(1)), "utf8");
|
|
50126
50341
|
return value;
|
|
50127
50342
|
}
|
|
50128
50343
|
function turnChannel({ context, args }) {
|
|
@@ -50134,15 +50349,15 @@ async function writeMount({
|
|
|
50134
50349
|
folder,
|
|
50135
50350
|
files: files2
|
|
50136
50351
|
}) {
|
|
50137
|
-
const root =
|
|
50352
|
+
const root = resolve9(context.cwd, flagText({ args, name: "dir", fallback: ".laze" }), folder);
|
|
50138
50353
|
await rm8(root, { recursive: true, force: true });
|
|
50139
50354
|
await mkdir12(root, { recursive: true });
|
|
50140
50355
|
for (const file3 of files2) {
|
|
50141
|
-
const target =
|
|
50142
|
-
const inside =
|
|
50356
|
+
const target = resolve9(root, file3.path);
|
|
50357
|
+
const inside = relative3(root, target);
|
|
50143
50358
|
if (!inside || inside.startsWith(".."))
|
|
50144
50359
|
throw new Error(`Refusing to write outside ${root}: ${file3.path}`);
|
|
50145
|
-
await mkdir12(
|
|
50360
|
+
await mkdir12(dirname11(target), { recursive: true });
|
|
50146
50361
|
await writeFile13(target, file3.content);
|
|
50147
50362
|
}
|
|
50148
50363
|
return root;
|
|
@@ -50837,6 +51052,15 @@ function updatePlanOf({ script }) {
|
|
|
50837
51052
|
command: [...found.command, ...prefix ? ["--prefix", prefix] : [], CLI_PACKAGE_LATEST]
|
|
50838
51053
|
};
|
|
50839
51054
|
}
|
|
51055
|
+
var RELEASE_AGE_REFUSAL = /\b(ENOVERSIONS|ETARGET)\b/;
|
|
51056
|
+
function releaseAgeRetryOf({
|
|
51057
|
+
plan: plan2,
|
|
51058
|
+
stderr: stderr2
|
|
51059
|
+
}) {
|
|
51060
|
+
if (plan2.manager !== "npm" || !RELEASE_AGE_REFUSAL.test(stderr2)) return null;
|
|
51061
|
+
const at = plan2.command.indexOf(CLI_PACKAGE_LATEST);
|
|
51062
|
+
return [...plan2.command.slice(0, at), "--min-release-age=0", ...plan2.command.slice(at)];
|
|
51063
|
+
}
|
|
50840
51064
|
|
|
50841
51065
|
// src/rules/cli-release.rules.ts
|
|
50842
51066
|
var CLI_RELEASE_HEADER = "x-laze-cli-release";
|
|
@@ -50908,7 +51132,8 @@ var USAGE14 = `Usage:
|
|
|
50908
51132
|
laze schedule list
|
|
50909
51133
|
laze schedule update <scheduleId> [--name <name>] [--prompt <text>] [--cron|--rrule|--at <when>]
|
|
50910
51134
|
[--tz <IANA zone>] [--channel <channelId>|none] [--agent <agentId>]
|
|
50911
|
-
laze schedule pause|resume|rm|runs <scheduleId
|
|
51135
|
+
laze schedule pause|resume|rm|runs <scheduleId>
|
|
51136
|
+
laze schedule run <scheduleId> (one extra run now; the next fire stays)`;
|
|
50912
51137
|
function timingOf(args) {
|
|
50913
51138
|
const cron = flagText({ args, name: "cron" });
|
|
50914
51139
|
const rrule = flagText({ args, name: "rrule" });
|
|
@@ -51011,6 +51236,16 @@ async function scheduleRuns({ context, args }) {
|
|
|
51011
51236
|
`);
|
|
51012
51237
|
}
|
|
51013
51238
|
}
|
|
51239
|
+
async function scheduleRun({ context, args }) {
|
|
51240
|
+
const scheduleId = args.words[2];
|
|
51241
|
+
if (!scheduleId) throw new CliUsageError(USAGE14);
|
|
51242
|
+
const { client } = await signedIn({ context, args });
|
|
51243
|
+
const run3 = await client.post("/api/schedules/run", { scheduleId });
|
|
51244
|
+
if (args.flags.json) return context.out(`${JSON.stringify(run3, null, 2)}
|
|
51245
|
+
`);
|
|
51246
|
+
context.out(`${run3.scheduledFor} ${run3.status}
|
|
51247
|
+
`);
|
|
51248
|
+
}
|
|
51014
51249
|
var SCHEDULE_COMMANDS = {
|
|
51015
51250
|
add: scheduleAdd,
|
|
51016
51251
|
list: scheduleList,
|
|
@@ -51018,7 +51253,8 @@ var SCHEDULE_COMMANDS = {
|
|
|
51018
51253
|
pause: byId("pause"),
|
|
51019
51254
|
resume: byId("resume"),
|
|
51020
51255
|
rm: byId("remove"),
|
|
51021
|
-
runs: scheduleRuns
|
|
51256
|
+
runs: scheduleRuns,
|
|
51257
|
+
run: scheduleRun
|
|
51022
51258
|
};
|
|
51023
51259
|
async function schedule({ context, args }) {
|
|
51024
51260
|
const name2 = args.words[1] ?? "";
|
|
@@ -51029,7 +51265,7 @@ async function schedule({ context, args }) {
|
|
|
51029
51265
|
|
|
51030
51266
|
// src/services/skill-commands.service.ts
|
|
51031
51267
|
import { readdir as readdir3, readFile as readFile21 } from "node:fs/promises";
|
|
51032
|
-
import { join as
|
|
51268
|
+
import { join as join11, relative as relative4, resolve as resolve10 } from "node:path";
|
|
51033
51269
|
var USAGE15 = `Usage:
|
|
51034
51270
|
laze skill list [--agent <agentId>]
|
|
51035
51271
|
laze skill install <catalogue-id> [--as <name>] [--agent <agentId>]
|
|
@@ -51046,8 +51282,8 @@ async function folderFiles({ root }) {
|
|
|
51046
51282
|
const files2 = [];
|
|
51047
51283
|
for (const entry of entries) {
|
|
51048
51284
|
if (!entry.isFile()) continue;
|
|
51049
|
-
const full =
|
|
51050
|
-
files2.push({ path:
|
|
51285
|
+
const full = join11(entry.parentPath, entry.name);
|
|
51286
|
+
files2.push({ path: relative4(root, full), content: await readFile21(full, "utf8") });
|
|
51051
51287
|
}
|
|
51052
51288
|
return files2.toSorted((a, b) => a.path.localeCompare(b.path));
|
|
51053
51289
|
}
|
|
@@ -51072,7 +51308,7 @@ async function skillInstall({ context, args }) {
|
|
|
51072
51308
|
if (!catalogueId === !from) throw new CliUsageError(USAGE15);
|
|
51073
51309
|
const name2 = flagText({ args, name: "as" });
|
|
51074
51310
|
const agent2 = flagText({ args, name: "agent" });
|
|
51075
|
-
const files2 = from ? await folderFiles({ root:
|
|
51311
|
+
const files2 = from ? await folderFiles({ root: resolve10(context.cwd, from) }) : void 0;
|
|
51076
51312
|
const { client } = await signedIn({ context, args });
|
|
51077
51313
|
const installed = await client.post("/api/skills/install", {
|
|
51078
51314
|
...catalogueId ? { catalogueId } : {},
|
|
@@ -51139,7 +51375,7 @@ async function skillUpdate({ context, args }) {
|
|
|
51139
51375
|
if (!name2 || !newName && description === void 0 && !skillMdFile) {
|
|
51140
51376
|
throw new CliUsageError(USAGE15);
|
|
51141
51377
|
}
|
|
51142
|
-
const skillMd = skillMdFile ? await readFile21(
|
|
51378
|
+
const skillMd = skillMdFile ? await readFile21(resolve10(context.cwd, skillMdFile), "utf8") : void 0;
|
|
51143
51379
|
const { client } = await signedIn({ context, args });
|
|
51144
51380
|
const updated = await client.post("/api/skills/update", {
|
|
51145
51381
|
name: name2,
|
|
@@ -51170,7 +51406,7 @@ async function skill({ context, args }) {
|
|
|
51170
51406
|
|
|
51171
51407
|
// src/services/slack-commands.service.ts
|
|
51172
51408
|
import { readFile as readFile22 } from "node:fs/promises";
|
|
51173
|
-
import { resolve as
|
|
51409
|
+
import { resolve as resolve11 } from "node:path";
|
|
51174
51410
|
var SLACK_USAGE = `Usage (a person's key; Slack stays the source, the bot joins no channel by itself):
|
|
51175
51411
|
laze slack overview connected Slack workspaces, mirrors, your link
|
|
51176
51412
|
laze slack link-prompts Slack workspaces you have not linked yet
|
|
@@ -51213,7 +51449,7 @@ async function secretLines({ context, args }) {
|
|
|
51213
51449
|
throw new CliUsageError("A secret never goes in a flag: pipe it on stdin or use --from-file.");
|
|
51214
51450
|
}
|
|
51215
51451
|
const file3 = flagText({ args, name: "from-file" });
|
|
51216
|
-
const text2 = file3 ? await readFile22(
|
|
51452
|
+
const text2 = file3 ? await readFile22(resolve11(context.cwd, file3), "utf8") : await context.readStdin();
|
|
51217
51453
|
return text2.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
51218
51454
|
}
|
|
51219
51455
|
async function secretsOf({
|
|
@@ -51806,8 +52042,28 @@ async function update2({
|
|
|
51806
52042
|
}
|
|
51807
52043
|
context.out(`Updating laze ${cliVersionOf()} with ${plan2.manager}: ${line}
|
|
51808
52044
|
`);
|
|
51809
|
-
|
|
51810
|
-
|
|
52045
|
+
let stderr2 = "";
|
|
52046
|
+
const tee = {
|
|
52047
|
+
write: (chunk) => {
|
|
52048
|
+
stderr2 += chunk;
|
|
52049
|
+
context.err(chunk);
|
|
52050
|
+
}
|
|
52051
|
+
};
|
|
52052
|
+
let code = await context.runCommand({ command: plan2.command, env: {}, stderr: tee });
|
|
52053
|
+
const retry = code === 0 ? null : releaseAgeRetryOf({ plan: plan2, stderr: stderr2 });
|
|
52054
|
+
if (retry) {
|
|
52055
|
+
const retryLine = retry.join(" ");
|
|
52056
|
+
context.out(
|
|
52057
|
+
`npm's min-release-age setting held back the latest release. Trying once more with the guard off for @lazehq/cli only: ${retryLine}
|
|
52058
|
+
`
|
|
52059
|
+
);
|
|
52060
|
+
code = await context.runCommand({ command: retry, env: {} });
|
|
52061
|
+
if (code !== 0) {
|
|
52062
|
+
context.err(`npm exited ${code}. Update by hand with: ${retryLine}
|
|
52063
|
+
`);
|
|
52064
|
+
return code;
|
|
52065
|
+
}
|
|
52066
|
+
} else if (code !== 0) {
|
|
51811
52067
|
context.err(`${plan2.manager} exited ${code}. Update by hand with: ${line}
|
|
51812
52068
|
`);
|
|
51813
52069
|
return code;
|
|
@@ -51873,7 +52129,7 @@ async function vaultScrub({ context, args }) {
|
|
|
51873
52129
|
|
|
51874
52130
|
// src/services/whatsapp-business-commands.service.ts
|
|
51875
52131
|
import { readFile as readFile24 } from "node:fs/promises";
|
|
51876
|
-
import { resolve as
|
|
52132
|
+
import { resolve as resolve12 } from "node:path";
|
|
51877
52133
|
|
|
51878
52134
|
// ../../modules/whatsapp-business/contract/src/whatsapp-business.prices.ts
|
|
51879
52135
|
var whatsappBusinessCategorySchema = external_exports.enum([
|
|
@@ -52292,7 +52548,7 @@ async function secretsOf2({ context, args }) {
|
|
|
52292
52548
|
const fromConnection = flagText({ args, name: "from-vault" });
|
|
52293
52549
|
if (fromConnection) return { fromConnection };
|
|
52294
52550
|
const file3 = flagText({ args, name: "from-file" });
|
|
52295
|
-
const text2 = file3 ? await readFile24(
|
|
52551
|
+
const text2 = file3 ? await readFile24(resolve12(context.cwd, file3), "utf8") : await context.readStdin();
|
|
52296
52552
|
const lines = text2.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
52297
52553
|
if (lines.length !== 2) {
|
|
52298
52554
|
throw new CliUsageError(
|
|
@@ -52494,7 +52750,7 @@ async function whatsappBusiness({
|
|
|
52494
52750
|
|
|
52495
52751
|
// src/services/whatsapp-pairing-commands.service.ts
|
|
52496
52752
|
import { writeFile as writeFile14 } from "node:fs/promises";
|
|
52497
|
-
import { resolve as
|
|
52753
|
+
import { resolve as resolve13 } from "node:path";
|
|
52498
52754
|
var WHATSAPP_PAIRING_USAGE = [
|
|
52499
52755
|
" laze whatsapp pair <machine> [--qr <file.svg>] link WhatsApp on your machine; scan the code (owner)",
|
|
52500
52756
|
" laze whatsapp pairing <pairing-id> [--qr <file.svg>] where the linking stands, with a fresh code",
|
|
@@ -52513,7 +52769,7 @@ function svgOf(dataUrl) {
|
|
|
52513
52769
|
return decodeURIComponent(body);
|
|
52514
52770
|
}
|
|
52515
52771
|
async function report({ context, args, pairing: pairing2 }) {
|
|
52516
|
-
const qrFile = pairing2.qrSvg ?
|
|
52772
|
+
const qrFile = pairing2.qrSvg ? resolve13(context.cwd, flagText({ args, name: "qr", fallback: "whatsapp-qr.svg" })) : null;
|
|
52517
52773
|
if (qrFile && pairing2.qrSvg) await writeFile14(qrFile, svgOf(pairing2.qrSvg), "utf8");
|
|
52518
52774
|
if (args.flags.json) return context.out(`${JSON.stringify({ ...pairing2, qrFile }, null, 2)}
|
|
52519
52775
|
`);
|
|
@@ -52874,7 +53130,7 @@ async function flags({ context, args }) {
|
|
|
52874
53130
|
|
|
52875
53131
|
// src/services/workspace-commands.service.ts
|
|
52876
53132
|
import { readFile as readFile25 } from "node:fs/promises";
|
|
52877
|
-
import { resolve as
|
|
53133
|
+
import { resolve as resolve14 } from "node:path";
|
|
52878
53134
|
var ROLE_NAMES2 = {
|
|
52879
53135
|
OWNER: "Owner",
|
|
52880
53136
|
ADMIN: "Admin",
|
|
@@ -53056,7 +53312,7 @@ var LOGO_USAGE = "Usage: laze workspace logo set <file.png|jpg|webp> | laze work
|
|
|
53056
53312
|
async function readLogo({ context, file: file3 }) {
|
|
53057
53313
|
let bytes;
|
|
53058
53314
|
try {
|
|
53059
|
-
bytes = new Uint8Array(await readFile25(
|
|
53315
|
+
bytes = new Uint8Array(await readFile25(resolve14(context.cwd, file3)));
|
|
53060
53316
|
} catch {
|
|
53061
53317
|
throw new CliUsageError(`No file to read at ${file3}.`);
|
|
53062
53318
|
}
|
|
@@ -53294,7 +53550,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
53294
53550
|
laze channel remove <channel> <member> take a member out of a channel (channel admins)
|
|
53295
53551
|
laze channel notify <channel> default|all|mentions|nothing|mute|unmute [--until <time>] your notifications
|
|
53296
53552
|
laze channel hide <channel> out of your sidebar until a new message lands there
|
|
53297
|
-
laze dm <person>... open a direct message with people, then laze post to it
|
|
53553
|
+
laze dm <person>... open a direct message with people (an agent may name one agent), then laze post to it
|
|
53298
53554
|
laze activity [--mentions|--threads|--reactions] [--limit <n>] your mentions, replies and reactions
|
|
53299
53555
|
laze activity read mark your Activity read (people; agents use laze inbox)
|
|
53300
53556
|
laze status set <emoji> [text] [--for 30m|1h|4h|today|week|never] your status next to your name (people)
|
|
@@ -53345,8 +53601,8 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
53345
53601
|
laze app create <name> --template crm ... build an app: create, push, preview, publish, revert
|
|
53346
53602
|
laze app every laze app command, with its flags
|
|
53347
53603
|
laze agents list | laze agents status <name> the workspace's agents and their context
|
|
53348
|
-
laze join [--workspace <name|link>] [--for <email>] [--name <name>] ask to join as an agent: a person approves once in their feed
|
|
53349
|
-
laze agent link --token <token> [--name <name>]
|
|
53604
|
+
laze join [--workspace <name|link>] [--for <email>] [--name <name>] [--project <folder>] ask to join as an agent: a person approves once in their feed
|
|
53605
|
+
laze agent link --token <token> [--name <name>] [--project <folder>] connect this Claude Code or Codex session
|
|
53350
53606
|
laze agent create --name <name> [--description <text>] [--harness laze-models|claude-code|codex] [--avatar <file>]
|
|
53351
53607
|
make an agent for your owner (or for you): personal, opened in their direct messages
|
|
53352
53608
|
--team makes a team agent; on Claude Code or Codex it needs --pool <pool>, a login pool to draw from
|
|
@@ -53639,7 +53895,7 @@ async function runCli({
|
|
|
53639
53895
|
import { execFile as execFile2, spawn as spawn4 } from "node:child_process";
|
|
53640
53896
|
import { mkdirSync, openSync } from "node:fs";
|
|
53641
53897
|
import { readFile as readFile26, readlink } from "node:fs/promises";
|
|
53642
|
-
import { dirname as
|
|
53898
|
+
import { dirname as dirname12 } from "node:path";
|
|
53643
53899
|
import { promisify as promisify2 } from "node:util";
|
|
53644
53900
|
var run2 = promisify2(execFile2);
|
|
53645
53901
|
function alive(pid) {
|
|
@@ -53659,8 +53915,8 @@ async function argsOf(pid) {
|
|
|
53659
53915
|
return line ? line.split(/\s+/) : void 0;
|
|
53660
53916
|
}
|
|
53661
53917
|
async function parentOf(pid) {
|
|
53662
|
-
const
|
|
53663
|
-
const fromStat =
|
|
53918
|
+
const stat2 = await readFile26(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
|
|
53919
|
+
const fromStat = stat2 ? Number(stat2.slice(stat2.lastIndexOf(")") + 2).split(" ")[1]) : NaN;
|
|
53664
53920
|
if (fromStat > 0) return fromStat;
|
|
53665
53921
|
const listed = await run2("ps", ["-o", "ppid=", "-p", String(pid)]).catch(() => void 0);
|
|
53666
53922
|
const parent = Number(listed?.stdout.trim());
|
|
@@ -53676,7 +53932,7 @@ async function cwdOf(pid) {
|
|
|
53676
53932
|
return line ? line.slice(1) : void 0;
|
|
53677
53933
|
}
|
|
53678
53934
|
function spawnDetached({ argv, logPath }) {
|
|
53679
|
-
mkdirSync(
|
|
53935
|
+
mkdirSync(dirname12(logPath), { recursive: true, mode: 448 });
|
|
53680
53936
|
const log = openSync(logPath, "a", 384);
|
|
53681
53937
|
const [program = "", ...rest] = argv;
|
|
53682
53938
|
const child = spawn4(program, rest, { detached: true, stdio: ["ignore", log, log] });
|
|
@@ -53737,15 +53993,15 @@ function terminalAsk() {
|
|
|
53737
53993
|
};
|
|
53738
53994
|
}
|
|
53739
53995
|
function sleep(ms, signal) {
|
|
53740
|
-
return new Promise((
|
|
53741
|
-
if (signal?.aborted) return
|
|
53996
|
+
return new Promise((resolve15) => {
|
|
53997
|
+
if (signal?.aborted) return resolve15();
|
|
53742
53998
|
const stop2 = () => {
|
|
53743
53999
|
clearTimeout(timer);
|
|
53744
|
-
|
|
54000
|
+
resolve15();
|
|
53745
54001
|
};
|
|
53746
54002
|
const timer = setTimeout(() => {
|
|
53747
54003
|
signal?.removeEventListener("abort", stop2);
|
|
53748
|
-
|
|
54004
|
+
resolve15();
|
|
53749
54005
|
}, ms);
|
|
53750
54006
|
signal?.addEventListener("abort", stop2, { once: true });
|
|
53751
54007
|
});
|