@lazehq/cli 0.1.52 → 0.1.54
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 +352 -112
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -13696,8 +13696,8 @@ var require_pool_base = __commonJS({
|
|
|
13696
13696
|
}
|
|
13697
13697
|
get [kPending]() {
|
|
13698
13698
|
let ret = this[kQueued];
|
|
13699
|
-
for (const { [kPending]:
|
|
13700
|
-
ret +=
|
|
13699
|
+
for (const { [kPending]: pending2 } of this[kClients]) {
|
|
13700
|
+
ret += pending2;
|
|
13701
13701
|
}
|
|
13702
13702
|
return ret;
|
|
13703
13703
|
}
|
|
@@ -18623,19 +18623,19 @@ var require_mock_agent = __commonJS({
|
|
|
18623
18623
|
}
|
|
18624
18624
|
pendingInterceptors() {
|
|
18625
18625
|
const mockAgentClients = this[kClients];
|
|
18626
|
-
return Array.from(mockAgentClients.entries()).flatMap(([origin, dispatcher]) => dispatcher[kDispatches].map((dispatch) => ({ ...dispatch, origin }))).filter(({ pending }) =>
|
|
18626
|
+
return Array.from(mockAgentClients.entries()).flatMap(([origin, dispatcher]) => dispatcher[kDispatches].map((dispatch) => ({ ...dispatch, origin }))).filter(({ pending: pending2 }) => pending2);
|
|
18627
18627
|
}
|
|
18628
18628
|
assertNoPendingInterceptors({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
|
|
18629
|
-
const
|
|
18630
|
-
if (
|
|
18629
|
+
const pending2 = this.pendingInterceptors();
|
|
18630
|
+
if (pending2.length === 0) {
|
|
18631
18631
|
return;
|
|
18632
18632
|
}
|
|
18633
18633
|
throw new UndiciError(
|
|
18634
|
-
|
|
18634
|
+
pending2.length === 1 ? `1 interceptor is pending:
|
|
18635
18635
|
|
|
18636
|
-
${pendingInterceptorsFormatter.format(
|
|
18636
|
+
${pendingInterceptorsFormatter.format(pending2)}`.trim() : `${pending2.length} interceptors are pending:
|
|
18637
18637
|
|
|
18638
|
-
${pendingInterceptorsFormatter.format(
|
|
18638
|
+
${pendingInterceptorsFormatter.format(pending2)}`.trim()
|
|
18639
18639
|
);
|
|
18640
18640
|
}
|
|
18641
18641
|
};
|
|
@@ -35737,7 +35737,9 @@ var SWITCHES = /* @__PURE__ */ new Set([
|
|
|
35737
35737
|
"local",
|
|
35738
35738
|
"done",
|
|
35739
35739
|
"names",
|
|
35740
|
-
"shell"
|
|
35740
|
+
"shell",
|
|
35741
|
+
"self",
|
|
35742
|
+
"all"
|
|
35741
35743
|
]);
|
|
35742
35744
|
function parseArgs({ argv }) {
|
|
35743
35745
|
const words = [];
|
|
@@ -35775,7 +35777,7 @@ function flagText({
|
|
|
35775
35777
|
}
|
|
35776
35778
|
|
|
35777
35779
|
// src/rules/cli-version.rules.ts
|
|
35778
|
-
var STAMPED = "0.1.
|
|
35780
|
+
var STAMPED = "0.1.54";
|
|
35779
35781
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
35780
35782
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
35781
35783
|
}
|
|
@@ -52432,13 +52434,13 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
52432
52434
|
...params,
|
|
52433
52435
|
path: [...params.path, "propertyNames"]
|
|
52434
52436
|
});
|
|
52435
|
-
let
|
|
52436
|
-
if (!
|
|
52437
|
-
|
|
52438
|
-
pendingRecords.set(ctx,
|
|
52437
|
+
let pending2 = pendingRecords.get(ctx);
|
|
52438
|
+
if (!pending2) {
|
|
52439
|
+
pending2 = [];
|
|
52440
|
+
pendingRecords.set(ctx, pending2);
|
|
52439
52441
|
ctx.deferred.push(() => rewriteKeyNames(ctx));
|
|
52440
52442
|
}
|
|
52441
|
-
|
|
52443
|
+
pending2.push(schema);
|
|
52442
52444
|
}
|
|
52443
52445
|
json6.additionalProperties = processSchema(def.valueType, ctx, {
|
|
52444
52446
|
...params,
|
|
@@ -58242,7 +58244,9 @@ var unfurlSchemaDefinition = external_exports.object({
|
|
|
58242
58244
|
title: external_exports.string().nullable(),
|
|
58243
58245
|
description: external_exports.string().nullable(),
|
|
58244
58246
|
siteName: external_exports.string().nullable(),
|
|
58245
|
-
image: boxSchema.nullable()
|
|
58247
|
+
image: boxSchema.nullable(),
|
|
58248
|
+
/** The site has an icon, read with `unfurlImage` and part `icon`. */
|
|
58249
|
+
icon: external_exports.boolean().default(false)
|
|
58246
58250
|
});
|
|
58247
58251
|
var mirrorSourceSchema = external_exports.enum(["slack", "whatsapp_business", "laze"]);
|
|
58248
58252
|
var mirrorDeliverySchema = external_exports.enum(["waiting", "failed"]);
|
|
@@ -58694,7 +58698,9 @@ var browsableChannelSchemaDefinition = external_exports.object({
|
|
|
58694
58698
|
private: external_exports.boolean().default(false),
|
|
58695
58699
|
/** The newest message's time; null before the first message. */
|
|
58696
58700
|
lastMessageAt: external_exports.iso.datetime().nullable().default(null),
|
|
58697
|
-
createdAt: external_exports.iso.datetime().nullable().default(null)
|
|
58701
|
+
createdAt: external_exports.iso.datetime().nullable().default(null),
|
|
58702
|
+
/** Where it is mirrored from, such as Slack; null for a channel that lives only in Laze. */
|
|
58703
|
+
mirrorSource: mirrorSourceSchema.nullable().optional()
|
|
58698
58704
|
});
|
|
58699
58705
|
var browsableChannelSchema = browsableChannelSchemaDefinition;
|
|
58700
58706
|
var historyPageSchemaDefinition = external_exports.object({
|
|
@@ -58712,6 +58718,8 @@ var searchHitSchemaDefinition = external_exports.object({
|
|
|
58712
58718
|
message: messageSchemaDefinition,
|
|
58713
58719
|
channelName: external_exports.string(),
|
|
58714
58720
|
channelKind: conversationKindSchema,
|
|
58721
|
+
/** Where the channel is mirrored from, such as Slack; null for one that lives only in Laze. */
|
|
58722
|
+
channelSource: mirrorSourceSchema.nullable().optional(),
|
|
58715
58723
|
/** The attachments whose name or text matched, when the match was in a file. */
|
|
58716
58724
|
matchedAttachmentIds: external_exports.array(idSchema4)
|
|
58717
58725
|
});
|
|
@@ -58775,6 +58783,13 @@ var updateChannelInputSchemaDefinition = external_exports.object({
|
|
|
58775
58783
|
var updateChannelInputSchema = updateChannelInputSchemaDefinition;
|
|
58776
58784
|
var logChannelHintSchemaDefinition = external_exports.object({ suggested: external_exports.boolean() });
|
|
58777
58785
|
var logChannelHintSchema = logChannelHintSchemaDefinition;
|
|
58786
|
+
var externalNoticeSchemaDefinition = external_exports.object({ seen: external_exports.array(external_exports.string()) });
|
|
58787
|
+
var externalNoticeSchema = externalNoticeSchemaDefinition;
|
|
58788
|
+
var dismissExternalNoticeInputSchemaDefinition = external_exports.object({
|
|
58789
|
+
...channelInputSchemaDefinition.shape,
|
|
58790
|
+
seen: external_exports.array(external_exports.string().min(1).max(200)).max(1e3)
|
|
58791
|
+
});
|
|
58792
|
+
var dismissExternalNoticeInputSchema = dismissExternalNoticeInputSchemaDefinition;
|
|
58778
58793
|
var setDefaultAgentInputSchemaDefinition = external_exports.object({
|
|
58779
58794
|
workspaceId: workspaceIdSchema,
|
|
58780
58795
|
channelId: idSchema4,
|
|
@@ -58991,7 +59006,9 @@ var updateMirroredInputSchemaDefinition = external_exports.object({
|
|
|
58991
59006
|
layout: messageLayoutSchema.nullable().optional(),
|
|
58992
59007
|
deleted: external_exports.boolean().default(false),
|
|
58993
59008
|
/** Laze read the source's message again, which is not an edit: no edited mark. */
|
|
58994
|
-
rerendered: external_exports.boolean().default(false)
|
|
59009
|
+
rerendered: external_exports.boolean().default(false),
|
|
59010
|
+
/** The source says the message was never edited: an edited mark Laze gave it comes off. */
|
|
59011
|
+
neverEdited: external_exports.boolean().default(false)
|
|
58995
59012
|
});
|
|
58996
59013
|
var pinMirroredInputSchemaDefinition = external_exports.object({
|
|
58997
59014
|
workspaceId: workspaceIdSchema,
|
|
@@ -59249,6 +59266,25 @@ var hideUnfurlInputSchemaDefinition = external_exports.object({
|
|
|
59249
59266
|
unfurlId: idSchema4
|
|
59250
59267
|
});
|
|
59251
59268
|
var hideUnfurlInputSchema = hideUnfurlInputSchemaDefinition;
|
|
59269
|
+
var customEmojiNameSchema = external_exports.string().regex(/^[a-z0-9_+'-]{1,100}$/).describe("A custom emoji's name, as written between colons.");
|
|
59270
|
+
var customEmojiSchemaDefinition = external_exports.object({
|
|
59271
|
+
name: customEmojiNameSchema,
|
|
59272
|
+
url: external_exports.string().max(2e3).regex(/^https:\/\/[^\s()<>]+$/)
|
|
59273
|
+
});
|
|
59274
|
+
var customEmojiListSchemaDefinition = external_exports.object({ emoji: external_exports.array(customEmojiSchemaDefinition) });
|
|
59275
|
+
var customEmojiListSchema = customEmojiListSchemaDefinition;
|
|
59276
|
+
var saveCustomEmojiInputSchemaDefinition = external_exports.object({
|
|
59277
|
+
workspaceId: workspaceIdSchema,
|
|
59278
|
+
emoji: external_exports.array(customEmojiSchemaDefinition).max(1e4),
|
|
59279
|
+
/** Names the source no longer has, dropped from the workspace's set. */
|
|
59280
|
+
removed: external_exports.array(customEmojiNameSchema).max(1e4).default([])
|
|
59281
|
+
});
|
|
59282
|
+
var unfurlImageInputSchemaDefinition = external_exports.object({
|
|
59283
|
+
...hideUnfurlInputSchemaDefinition.shape,
|
|
59284
|
+
/** The preview's picture, or the site's icon. */
|
|
59285
|
+
part: external_exports.enum(["image", "icon"]).default("image")
|
|
59286
|
+
});
|
|
59287
|
+
var unfurlImageInputSchema = unfurlImageInputSchemaDefinition;
|
|
59252
59288
|
var notifyLevelSchema = external_exports.enum(["default", "all", "mentions", "nothing"]);
|
|
59253
59289
|
var setNotifyInputSchemaDefinition = external_exports.object({
|
|
59254
59290
|
workspaceId: workspaceIdSchema,
|
|
@@ -59333,7 +59369,11 @@ var notificationSummaryEntrySchemaDefinition = external_exports.object({
|
|
|
59333
59369
|
body: external_exports.string(),
|
|
59334
59370
|
/** The address in Laze that opens it, without the origin. */
|
|
59335
59371
|
path: external_exports.string(),
|
|
59336
|
-
at: external_exports.iso.datetime()
|
|
59372
|
+
at: external_exports.iso.datetime(),
|
|
59373
|
+
/** The conversation it is in, by name ("sam", "#dev") and id, with what is unread in it. */
|
|
59374
|
+
name: external_exports.string(),
|
|
59375
|
+
conversationId: external_exports.string(),
|
|
59376
|
+
count: external_exports.number().int().positive()
|
|
59337
59377
|
});
|
|
59338
59378
|
var notificationSummarySchemaDefinition = external_exports.object({
|
|
59339
59379
|
count: external_exports.number().int().nonnegative(),
|
|
@@ -59550,10 +59590,10 @@ var joinedChannelSchemaDefinition = external_exports.object({
|
|
|
59550
59590
|
kind: external_exports.enum(["public", "private"])
|
|
59551
59591
|
});
|
|
59552
59592
|
var ChatApi = moduleApi()("chat");
|
|
59553
|
-
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).query("logChannelHint").withInput(channelInputSchema).withOutput(logChannelHintSchema).mutation("dismissLogChannelHint").withInput(channelInputSchema).withOutput(external_exports.object({ dismissed: external_exports.literal(true) })).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();
|
|
59593
|
+
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).query("logChannelHint").withInput(channelInputSchema).withOutput(logChannelHintSchema).mutation("dismissLogChannelHint").withInput(channelInputSchema).withOutput(external_exports.object({ dismissed: external_exports.literal(true) })).query("externalNotice").withInput(channelInputSchema).withOutput(externalNoticeSchema).mutation("dismissExternalNotice").withInput(dismissExternalNoticeInputSchema).withOutput(externalNoticeSchema).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();
|
|
59554
59594
|
var chatChannelRolesTrpc = defineTrpcContract("chat").mutation("setChannelRole").withInput(setChannelRoleInputSchema).withOutput(conversationSchema).mutation("extendChannel").withInput(extendChannelInputSchema).withOutput(conversationSchema).build();
|
|
59555
59595
|
var chatMessagesTrpc = defineTrpcContract("chat").query("history").withInput(historyInputSchema).withOutput(historyPageSchema).query("thread").withInput(messageInputSchema).withOutput(threadSchema).mutation("post").withInput(postMessageInputSchema).withOutput(messageSchema).mutation("forward").withInput(forwardMessageInputSchema).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();
|
|
59556
|
-
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(
|
|
59596
|
+
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(unfurlImageInputSchema).withOutput(fileLinkSchema).query("customEmoji").withInput(workspaceInputSchema).withOutput(customEmojiListSchema).query("searchGifs").withInput(searchGifsInputSchema).withOutput(gifResultsSchema).build();
|
|
59557
59597
|
var chatFollowingTrpc = defineTrpcContract("chat").mutation("setNotify").withInput(setNotifyInputSchema).withOutput(conversationSummarySchema).mutation("hideConversation").withInput(channelInputSchema).withOutput(external_exports.object({ hidden: external_exports.literal(true) })).mutation("followThread").withInput(followThreadInputSchema).withOutput(threadFollowSchema).query("threadFollow").withInput(messageInputSchema).withOutput(threadFollowSchema).query("threads").withInput(threadsInputSchema).withOutput(threadsPageSchema).query("threadsUnread").withInput(workspaceInputSchema).withOutput(threadsUnreadSchema).query("notificationCount").withInput(workspaceInputSchema).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).mutation("markThreadRead").withInput(messageInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).mutation("pin").withInput(pinMessageInputSchema).withOutput(messageSchema).query("pins").withInput(channelInputSchema).withOutput(pinsPageSchema).query("saved").withInput(savedInputSchema).withOutput(savedPageSchema).query("savedMarks").withInput(workspaceInputSchema).withOutput(savedMarksSchema).mutation("saveMessage").withInput(saveMessageInputSchema).withOutput(savedStatusSchema).mutation("markSavedDone").withInput(markSavedDoneInputSchema).withOutput(savedStatusSchema).mutation("setReminder").withInput(setReminderInputSchema).withOutput(savedStatusSchema).query("activity").withInput(activityInputSchema).withOutput(activityPageSchema).mutation("markActivityRead").withInput(markActivityReadInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).build();
|
|
59558
59598
|
var chatSessionTrpc = defineTrpcContract("chat").mutation("realtimeToken").withInput(workspaceInputSchema).withOutput(realtimeTokenSchema).query("drafts").withInput(workspaceInputSchema).withOutput(draftListSchema).mutation("saveDraft").withInput(saveDraftInputSchema).withOutput(draftSavedSchema).mutation("deleteDraft").withInput(deleteDraftInputSchema).withOutput(draftSavedSchema).query("sent").withInput(listSentInputSchema).withOutput(sentPageSchema).query("sidebarLayout").withInput(workspaceInputSchema).withOutput(sidebarLayoutSchema).mutation("editSidebar").withInput(editSidebarInputSchema).withOutput(sidebarLayoutSchema).mutation("star").withInput(starInputSchema).withOutput(starStatusSchema).query("starred").withInput(workspaceInputSchema).withOutput(starredListSchema).mutation("scrubSecrets").withInput(scrubChatInputSchema).withOutput(chatScrubReportSchema).mutation("restoreScrubbed").withInput(messageInputSchema).withOutput(messageSchema).build();
|
|
59559
59599
|
var chatScheduledTrpc = defineTrpcContract("chat").mutation("scheduleMessage").withInput(scheduleMessageInputSchema).withOutput(scheduledMessageSchema).query("scheduled").withInput(listScheduledInputSchema).withOutput(scheduledListSchema).mutation("editScheduled").withInput(editScheduledInputSchema).withOutput(scheduledMessageSchema).mutation("sendScheduledNow").withInput(scheduledInputSchema).withOutput(scheduledMessageSchema).mutation("cancelScheduled").withInput(scheduledInputSchema).withOutput(scheduledMessageSchema).build();
|
|
@@ -59677,7 +59717,9 @@ var webPushPublicKeySchema = webPushPublicKeySchemaDefinition;
|
|
|
59677
59717
|
var digestItemSchemaDefinition = external_exports.object({
|
|
59678
59718
|
title: external_exports.string().min(1).max(200),
|
|
59679
59719
|
body: external_exports.string().max(400),
|
|
59680
|
-
url: external_exports.url()
|
|
59720
|
+
url: external_exports.url(),
|
|
59721
|
+
/** What is unread in it, shown as a badge on an unread line. */
|
|
59722
|
+
count: external_exports.number().int().positive().optional()
|
|
59681
59723
|
});
|
|
59682
59724
|
var DIGEST_LISTED = 10;
|
|
59683
59725
|
var emailMessageSchemaDefinition = external_exports.discriminatedUnion("template", [
|
|
@@ -60041,6 +60083,16 @@ var { publicBaseUrl } = Config.define((c) => ({
|
|
|
60041
60083
|
external_exports.string().optional().transform((value) => value?.trim() || void 0)
|
|
60042
60084
|
)
|
|
60043
60085
|
}));
|
|
60086
|
+
var { publicOriginAliases } = Config.define((c) => ({
|
|
60087
|
+
publicOriginAliases: c.env(
|
|
60088
|
+
"BASE_HOST_ALIASES",
|
|
60089
|
+
external_exports.string().optional().transform((value) => originsOf({ list: value ?? "" }))
|
|
60090
|
+
)
|
|
60091
|
+
}));
|
|
60092
|
+
function originsOf({ list: list11 }) {
|
|
60093
|
+
const origins = list11.split(",").map((entry) => entry.trim()).filter((entry) => URL.canParse(entry)).map((entry) => new URL(entry)).filter((url2) => url2.protocol === "https:" || url2.protocol === "http:").map((url2) => url2.origin);
|
|
60094
|
+
return [...new Set(origins)];
|
|
60095
|
+
}
|
|
60044
60096
|
var { appsDomain } = Config.define((c) => ({
|
|
60045
60097
|
appsDomain: c.env("APPS_DOMAIN", external_exports.string().min(1).default("rchaves.app"))
|
|
60046
60098
|
}));
|
|
@@ -61614,6 +61666,8 @@ var vaultConfig = Config.define((c) => ({
|
|
|
61614
61666
|
appAttestDev: c.env("VAULT_APP_ATTEST_DEV", environmentBooleanSchema.default(false)),
|
|
61615
61667
|
/** The origin passkeys are made on; unset accepts any localhost origin, for development. */
|
|
61616
61668
|
publicBaseUrl,
|
|
61669
|
+
/** Other origins of the deployment passkeys may be made on, each its own relying party. */
|
|
61670
|
+
publicOriginAliases,
|
|
61617
61671
|
/** A file each audit chain head is appended to as a JSON line; unset only logs the heads. */
|
|
61618
61672
|
auditHeadFile: c.env("VAULT_AUDIT_HEAD_FILE", external_exports.string().min(1).optional()),
|
|
61619
61673
|
/** vaultd's socket; set, the master key and data keys stay in vaultd, unset keeps them here. */
|
|
@@ -65050,8 +65104,9 @@ var createdAgentSchemaDefinition = external_exports.object({
|
|
|
65050
65104
|
/** The owner's direct message with the new agent. */
|
|
65051
65105
|
channelId: external_exports.string()
|
|
65052
65106
|
});
|
|
65053
|
-
var updateAgentAsCallerInputSchemaDefinition = external_exports.
|
|
65054
|
-
agent:
|
|
65107
|
+
var updateAgentAsCallerInputSchemaDefinition = external_exports.strictObject({
|
|
65108
|
+
/** Left out, the agent whose key calls: `laze agent update --self`. */
|
|
65109
|
+
agent: agentRefSchema4.optional(),
|
|
65055
65110
|
name: nameSchema.optional(),
|
|
65056
65111
|
description: descriptionSchema.optional(),
|
|
65057
65112
|
avatar: agentAvatarInputSchema.optional(),
|
|
@@ -67373,6 +67428,12 @@ var slackStatusSchemaDefinition = external_exports.object({
|
|
|
67373
67428
|
emoji: external_exports.string(),
|
|
67374
67429
|
text: external_exports.string()
|
|
67375
67430
|
});
|
|
67431
|
+
var slackCompanySchemaDefinition = external_exports.object({
|
|
67432
|
+
teamId: external_exports.string(),
|
|
67433
|
+
/** Its Slack name; its team id when Slack could not say. */
|
|
67434
|
+
name: external_exports.string(),
|
|
67435
|
+
iconUrl: external_exports.string().nullable()
|
|
67436
|
+
});
|
|
67376
67437
|
var slackProfileSchemaDefinition = external_exports.object({
|
|
67377
67438
|
id: external_exports.string(),
|
|
67378
67439
|
teamId: external_exports.string(),
|
|
@@ -67386,7 +67447,9 @@ var slackProfileSchemaDefinition = external_exports.object({
|
|
|
67386
67447
|
/** Their profile in Slack; null when the workspace's Slack address is unknown. */
|
|
67387
67448
|
url: external_exports.string().nullable(),
|
|
67388
67449
|
/** The linked Laze person, on an answer for `personIds`. */
|
|
67389
|
-
personId: external_exports.string().optional()
|
|
67450
|
+
personId: external_exports.string().optional(),
|
|
67451
|
+
/** Their company when it is not the connected Slack workspace, as in a Slack Connect channel. */
|
|
67452
|
+
company: slackCompanySchemaDefinition.nullable().optional()
|
|
67390
67453
|
});
|
|
67391
67454
|
var slackProfilesSchemaDefinition = external_exports.object({
|
|
67392
67455
|
profiles: external_exports.array(slackProfileSchemaDefinition)
|
|
@@ -67396,6 +67459,26 @@ var slackLinkedNamesSchemaDefinition = external_exports.object({
|
|
|
67396
67459
|
people: external_exports.array(external_exports.object({ personId: external_exports.string().min(1), names: external_exports.array(external_exports.string()) }))
|
|
67397
67460
|
});
|
|
67398
67461
|
var slackLinkedNamesSchema = slackLinkedNamesSchemaDefinition;
|
|
67462
|
+
var slackExternalPeopleInputSchemaDefinition = external_exports.object({
|
|
67463
|
+
workspaceId: external_exports.string().min(1),
|
|
67464
|
+
channelId: external_exports.string().min(1).max(64)
|
|
67465
|
+
});
|
|
67466
|
+
var slackExternalPeopleInputSchema = slackExternalPeopleInputSchemaDefinition;
|
|
67467
|
+
var slackExternalPersonSchemaDefinition = external_exports.object({
|
|
67468
|
+
/** As their messages' author id: `slack:<connected team>:<user id>`. */
|
|
67469
|
+
id: external_exports.string(),
|
|
67470
|
+
name: external_exports.string(),
|
|
67471
|
+
avatarUrl: external_exports.string().nullable()
|
|
67472
|
+
});
|
|
67473
|
+
var slackExternalPeopleSchemaDefinition = external_exports.object({
|
|
67474
|
+
companies: external_exports.array(
|
|
67475
|
+
external_exports.object({
|
|
67476
|
+
...slackCompanySchemaDefinition.shape,
|
|
67477
|
+
people: external_exports.array(slackExternalPersonSchemaDefinition)
|
|
67478
|
+
})
|
|
67479
|
+
)
|
|
67480
|
+
});
|
|
67481
|
+
var slackExternalPeopleSchema = slackExternalPeopleSchemaDefinition;
|
|
67399
67482
|
|
|
67400
67483
|
// ../../modules/slack/contract/src/slack-setup.ts
|
|
67401
67484
|
var workspaceIdSchema13 = external_exports.string().min(1);
|
|
@@ -67468,9 +67551,20 @@ var slackMessageEventSchemaDefinition = external_exports.object({
|
|
|
67468
67551
|
/** Slack's `channel_type`: channel, group, mpim or im; null when Slack left it out. */
|
|
67469
67552
|
channelType: external_exports.string().nullable().default(null),
|
|
67470
67553
|
/** The reactions on the message and who added each, as `conversations.history` lists them. */
|
|
67471
|
-
reactions: external_exports.array(
|
|
67554
|
+
reactions: external_exports.array(
|
|
67555
|
+
external_exports.object({
|
|
67556
|
+
name: external_exports.string().min(1),
|
|
67557
|
+
users: external_exports.array(external_exports.string()),
|
|
67558
|
+
/** The picture of a custom emoji from another organisation, as Slack lists it. */
|
|
67559
|
+
url: external_exports.string().nullable().optional()
|
|
67560
|
+
})
|
|
67561
|
+
).optional(),
|
|
67472
67562
|
/** A bot or app post's own icon, from `icons` or `bot_profile`; null when Slack sent none. */
|
|
67473
67563
|
iconUrl: external_exports.string().nullable().default(null),
|
|
67564
|
+
/** The author's own Slack workspace, Slack's `user_team`: another company's in Slack Connect. */
|
|
67565
|
+
userTeam: external_exports.string().nullable().default(null),
|
|
67566
|
+
/** The name and photo Slack sent with the message (`user_profile`); dropped once handled. */
|
|
67567
|
+
userProfile: external_exports.object({ name: external_exports.string(), avatarUrl: external_exports.string().nullable() }).nullable().default(null),
|
|
67474
67568
|
/** The ts of the last reply in the thread this message starts, as history lists it. */
|
|
67475
67569
|
latestReply: external_exports.string().nullable().default(null),
|
|
67476
67570
|
/** When the message was last edited, Slack's `edited.ts`; null when it never was. */
|
|
@@ -67481,7 +67575,12 @@ var slackMessageEventSchemaDefinition = external_exports.object({
|
|
|
67481
67575
|
sourceText: external_exports.string().optional(),
|
|
67482
67576
|
attachments: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown())).optional(),
|
|
67483
67577
|
/** For `tokens_revoked`: the Slack users whose tokens were revoked, and whether the bot's was. */
|
|
67484
|
-
revoked: external_exports.object({ userIds: external_exports.array(external_exports.string()), bot: external_exports.boolean() }).optional()
|
|
67578
|
+
revoked: external_exports.object({ userIds: external_exports.array(external_exports.string()), bot: external_exports.boolean() }).optional(),
|
|
67579
|
+
/** For `emoji_changed`: the custom emoji added (`value` a picture or `alias:x`) and removed. */
|
|
67580
|
+
emojiChange: external_exports.object({
|
|
67581
|
+
added: external_exports.array(external_exports.object({ name: external_exports.string(), value: external_exports.string() })),
|
|
67582
|
+
removed: external_exports.array(external_exports.string())
|
|
67583
|
+
}).optional()
|
|
67485
67584
|
});
|
|
67486
67585
|
var slackEventReceivedPayloadSchemaDefinition = external_exports.object({
|
|
67487
67586
|
workspaceId: external_exports.string().min(1),
|
|
@@ -67764,7 +67863,7 @@ var slackSearchAnswerSchemaDefinition = external_exports.object({
|
|
|
67764
67863
|
var slackSearchAnswerSchema = slackSearchAnswerSchemaDefinition;
|
|
67765
67864
|
var SlackApi = moduleApi()("slack");
|
|
67766
67865
|
var workspaceInput3 = external_exports.object({ workspaceId: workspaceIdSchema14 });
|
|
67767
|
-
var slackTrpc = defineTrpcContract("slack").query("overview").withInput(workspaceInput3).withOutput(slackOverviewSchema).mutation("startSetup").withInput(startSlackSetupInputSchema).withOutput(startedSlackAuthorizeSchema).mutation("beginSetup").withInput(beginSlackSetupInputSchema).withOutput(slackSetupSchema).mutation("saveAppCredentials").withInput(saveSlackAppCredentialsInputSchema).withOutput(startedSlackAuthorizeSchema).mutation("installApp").withInput(installSlackAppInputSchema).withOutput(startedSlackAuthorizeSchema).mutation("startInstall").withInput(startSlackInstallInputSchema).withOutput(startedSlackAuthorizeSchema).mutation("startLink").withInput(startSlackLinkInputSchema).withOutput(startedSlackAuthorizeSchema).query("channels").withInput(slackTeamInputSchema).withOutput(external_exports.array(slackChannelViewSchema)).mutation("setMirror").withInput(setSlackMirrorInputSchema).withOutput(slackConnectionViewSchema).mutation("updateConnection").withInput(updateSlackConnectionInputSchema).withOutput(slackConnectionViewSchema).mutation("disconnect").withInput(slackTeamInputSchema).withOutput(external_exports.object({ disconnected: external_exports.literal(true) })).mutation("unlink").withInput(slackTeamInputSchema).withOutput(slackConnectionViewSchema).query("linkPrompts").withInput(workspaceInput3).withOutput(slackLinkPromptsSchema).mutation("dismissLinkPrompt").withInput(dismissSlackLinkPromptInputSchema).withOutput(slackLinkPromptsSchema).query("people").withInput(slackPeopleInputSchema).withOutput(slackPeopleSchema).query("bookmarks").withInput(slackBookmarksInputSchema).withOutput(slackBookmarksSchema).query("profiles").withInput(slackProfilesInputSchema).withOutput(slackProfilesSchema).query("linkedNames").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(slackLinkedNamesSchema).mutation("openDirect").withInput(openSlackDirectInputSchema).withOutput(openedSlackDirectSchema).mutation("updateApp").withInput(updateSlackAppInputSchema).withOutput(external_exports.object({ updated: external_exports.literal(true) })).query("history").withInput(slackHistoryInputSchema).withOutput(slackHistoryPageSchema).query("search").withInput(slackSearchInputSchema).withOutput(slackSearchAnswerSchema).query("movePreview").withInput(slackMoveChannelInputSchema).withOutput(slackMovePreviewSchema).mutation("startMoves").withInput(startSlackMovesInputSchema).withOutput(startedSlackMovesSchema).mutation("cancelMove").withInput(slackMoveInputSchema).withOutput(slackMoveViewSchema).query("moves").withInput(workspaceInput3).withOutput(slackMovesSchema).build();
|
|
67866
|
+
var slackTrpc = defineTrpcContract("slack").query("overview").withInput(workspaceInput3).withOutput(slackOverviewSchema).mutation("startSetup").withInput(startSlackSetupInputSchema).withOutput(startedSlackAuthorizeSchema).mutation("beginSetup").withInput(beginSlackSetupInputSchema).withOutput(slackSetupSchema).mutation("saveAppCredentials").withInput(saveSlackAppCredentialsInputSchema).withOutput(startedSlackAuthorizeSchema).mutation("installApp").withInput(installSlackAppInputSchema).withOutput(startedSlackAuthorizeSchema).mutation("startInstall").withInput(startSlackInstallInputSchema).withOutput(startedSlackAuthorizeSchema).mutation("startLink").withInput(startSlackLinkInputSchema).withOutput(startedSlackAuthorizeSchema).query("channels").withInput(slackTeamInputSchema).withOutput(external_exports.array(slackChannelViewSchema)).mutation("setMirror").withInput(setSlackMirrorInputSchema).withOutput(slackConnectionViewSchema).mutation("updateConnection").withInput(updateSlackConnectionInputSchema).withOutput(slackConnectionViewSchema).mutation("disconnect").withInput(slackTeamInputSchema).withOutput(external_exports.object({ disconnected: external_exports.literal(true) })).mutation("unlink").withInput(slackTeamInputSchema).withOutput(slackConnectionViewSchema).query("linkPrompts").withInput(workspaceInput3).withOutput(slackLinkPromptsSchema).mutation("dismissLinkPrompt").withInput(dismissSlackLinkPromptInputSchema).withOutput(slackLinkPromptsSchema).query("people").withInput(slackPeopleInputSchema).withOutput(slackPeopleSchema).query("bookmarks").withInput(slackBookmarksInputSchema).withOutput(slackBookmarksSchema).query("profiles").withInput(slackProfilesInputSchema).withOutput(slackProfilesSchema).query("linkedNames").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(slackLinkedNamesSchema).query("externalPeople").withInput(slackExternalPeopleInputSchema).withOutput(slackExternalPeopleSchema).mutation("openDirect").withInput(openSlackDirectInputSchema).withOutput(openedSlackDirectSchema).mutation("updateApp").withInput(updateSlackAppInputSchema).withOutput(external_exports.object({ updated: external_exports.literal(true) })).query("history").withInput(slackHistoryInputSchema).withOutput(slackHistoryPageSchema).query("search").withInput(slackSearchInputSchema).withOutput(slackSearchAnswerSchema).query("movePreview").withInput(slackMoveChannelInputSchema).withOutput(slackMovePreviewSchema).mutation("startMoves").withInput(startSlackMovesInputSchema).withOutput(startedSlackMovesSchema).mutation("cancelMove").withInput(slackMoveInputSchema).withOutput(slackMoveViewSchema).query("moves").withInput(workspaceInput3).withOutput(slackMovesSchema).build();
|
|
67768
67867
|
|
|
67769
67868
|
// ../../modules/slack/contract/src/slack-keys.ts
|
|
67770
67869
|
var SLACK_KEY_PATHS = {
|
|
@@ -71216,6 +71315,8 @@ are waiting, if you think one was missed.
|
|
|
71216
71315
|
- \`laze history <channel>\` and \`laze thread <id>\` read a conversation.
|
|
71217
71316
|
- \`laze search "words"\` searches messages.
|
|
71218
71317
|
- \`laze channels list\` lists the conversations you are in.
|
|
71318
|
+
- \`laze agent update --self --name "<name>"\` renames you; \`--description <text>\` and
|
|
71319
|
+
\`--avatar <file>\` change your description and face.
|
|
71219
71320
|
- \`laze channel info <channel>\` shows its members and the apps pinned there. Read a pinned app
|
|
71220
71321
|
with \`laze app pull --app <app>\` (its files: page, plan, code) and
|
|
71221
71322
|
\`laze app records list <collection> --app <app>\` (its data).
|
|
@@ -72078,7 +72179,7 @@ function formatLoginActivity({ activity: activity2 }) {
|
|
|
72078
72179
|
|
|
72079
72180
|
// src/services/agent-manage-commands.service.ts
|
|
72080
72181
|
var CREATE_USAGE = "Usage: laze agent create --name <name> [--description <text>] [--harness laze-models|claude-code|codex] [--team] [--pool <pool>] [--avatar <file>]";
|
|
72081
|
-
var UPDATE_USAGE = "Usage: laze agent update <agent
|
|
72182
|
+
var UPDATE_USAGE = "Usage: laze agent update <agent>|--self [--name <name>] [--description <text>] [--avatar <file>] [--model <model>|default] [--effort <level>|default] [--max-context <tokens, such as 200k>|default]";
|
|
72082
72183
|
var ARCHIVE_USAGE = "Usage: laze agent archive <agent>";
|
|
72083
72184
|
var PAUSE_USAGE = 'Usage: laze agent pause <agent> [--reason "<why>"] | laze agent resume <agent>';
|
|
72084
72185
|
var TRANSFER_USAGE = "Usage: laze agent transfer <agent> <member: user id, email or name> | accept|decline|cancel <agent> | offers";
|
|
@@ -72223,16 +72324,17 @@ async function updateAgent({
|
|
|
72223
72324
|
context,
|
|
72224
72325
|
args
|
|
72225
72326
|
}) {
|
|
72226
|
-
const agent2 = args.words[2];
|
|
72327
|
+
const agent2 = args.flags.self === true ? void 0 : args.words[2];
|
|
72227
72328
|
const name3 = flagText({ args, name: "name" }).trim();
|
|
72228
72329
|
const description = descriptionOf({ args });
|
|
72229
72330
|
const run4 = runChangesOf({ args });
|
|
72230
72331
|
const nothing = !name3 && description === void 0 && !args.flags.avatar;
|
|
72231
|
-
|
|
72332
|
+
const both = args.flags.self !== void 0 && args.words[2] !== void 0;
|
|
72333
|
+
if (both || nothing && Object.keys(run4).length === 0) throw new CliUsageError(UPDATE_USAGE);
|
|
72232
72334
|
const { client } = await signedIn({ context, args });
|
|
72233
72335
|
const avatar = await avatarOf({ context, args, client });
|
|
72234
72336
|
const updated = await client.post("/api/agents/update", {
|
|
72235
|
-
agent: agent2,
|
|
72337
|
+
...agent2 !== void 0 && { agent: agent2 },
|
|
72236
72338
|
...name3 && { name: name3 },
|
|
72237
72339
|
...description !== void 0 && { description },
|
|
72238
72340
|
...avatar !== void 0 && { avatar },
|
|
@@ -72879,7 +72981,7 @@ var appFunctionUsesSchemaDefinition = external_exports.object({
|
|
|
72879
72981
|
connections: external_exports.array(connectionNameSchema).max(20).default([]),
|
|
72880
72982
|
hosts: external_exports.array(appOutsideHostSchema).max(20).default([])
|
|
72881
72983
|
});
|
|
72882
|
-
var appFunctionDeclarationsSchemaDefinition = external_exports.record(appFunctionNameSchema, appFunctionUsesSchemaDefinition).refine((
|
|
72984
|
+
var appFunctionDeclarationsSchemaDefinition = external_exports.record(appFunctionNameSchema, appFunctionUsesSchemaDefinition).refine((functions) => Object.keys(functions).length <= 50, "At most 50 functions");
|
|
72883
72985
|
var appFunctionDeclarationsSchema = appFunctionDeclarationsSchemaDefinition;
|
|
72884
72986
|
var appDeclaredConnectionSchemaDefinition = external_exports.object({
|
|
72885
72987
|
name: external_exports.string(),
|
|
@@ -73451,13 +73553,16 @@ var listFunctionLogsInputSchemaDefinition = external_exports.object({
|
|
|
73451
73553
|
limit: external_exports.number().int().positive().max(1e3).default(100)
|
|
73452
73554
|
});
|
|
73453
73555
|
var listFunctionLogsInputSchema = listFunctionLogsInputSchemaDefinition;
|
|
73454
|
-
var
|
|
73556
|
+
var appWorkspaceSettingsSchemaDefinition = external_exports.object({
|
|
73455
73557
|
workspaceId: external_exports.string().min(1),
|
|
73456
|
-
/** Off: pushes with functions are refused and every function answers app_functions_disabled. */
|
|
73457
|
-
functionsEnabled: external_exports.boolean(),
|
|
73458
73558
|
/** On: a Builder makes an app public at once. Off: a public publish asks an admin. */
|
|
73459
73559
|
publicAppsAllowed: external_exports.boolean()
|
|
73460
73560
|
});
|
|
73561
|
+
var appWorkspaceSettingsSchema = appWorkspaceSettingsSchemaDefinition;
|
|
73562
|
+
var appFunctionSettingsSchemaDefinition = external_exports.object({
|
|
73563
|
+
...appWorkspaceSettingsSchemaDefinition.shape,
|
|
73564
|
+
functionsEnabled: external_exports.boolean()
|
|
73565
|
+
});
|
|
73461
73566
|
var appFunctionSettingsSchema = appFunctionSettingsSchemaDefinition;
|
|
73462
73567
|
var workspaceRefSchemaDefinition = external_exports.object({ workspaceId: external_exports.string().min(1) });
|
|
73463
73568
|
var appWorkspaceRefSchema = workspaceRefSchemaDefinition;
|
|
@@ -73550,6 +73655,8 @@ var appMemberSourceSchemaDefinition = external_exports.object({
|
|
|
73550
73655
|
var appMemberSchemaDefinition = external_exports.object({
|
|
73551
73656
|
member: external_exports.object({ type: external_exports.enum(["user", "agent"]), id: external_exports.string().min(1) }),
|
|
73552
73657
|
name: external_exports.string(),
|
|
73658
|
+
/** A person's picture, uploaded or from Google; null or absent for agents and without one. */
|
|
73659
|
+
image: external_exports.string().nullable().optional(),
|
|
73553
73660
|
role: appRoleSchema,
|
|
73554
73661
|
sources: external_exports.array(appMemberSourceSchemaDefinition).min(1),
|
|
73555
73662
|
/** Whether a Builder can take this access away here: only a direct share is removable. */
|
|
@@ -74169,10 +74276,17 @@ var appBackupCheckAlertsSchemaDefinition = external_exports.object({
|
|
|
74169
74276
|
});
|
|
74170
74277
|
|
|
74171
74278
|
// ../../modules/app/contract/src/app.trpc.ts
|
|
74172
|
-
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(appPushSchema).mutation("publish").withInput(publishInputSchema).withOutput(publishOutcomeSchema).query("collections").withInput(appDataRefSchema).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(appDataRefSchema).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("
|
|
74279
|
+
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(appPushSchema).mutation("publish").withInput(publishInputSchema).withOutput(publishOutcomeSchema).query("collections").withInput(appDataRefSchema).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(appDataRefSchema).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("access").withInput(appRefSchema).withOutput(appAccessSchema).query("members").withInput(appRefSchema).withOutput(appMembersSchema).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).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();
|
|
74173
74280
|
var appConnectionsTrpc = defineTrpcContract("app").query("connections").withInput(appRefSchema).withOutput(appConnectionsSchema).mutation("allowConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).mutation("revokeConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).build();
|
|
74174
74281
|
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).mutation("setPinRole").withInput(setPinRoleInputSchema).withOutput(appAccessSchema).build();
|
|
74175
|
-
var
|
|
74282
|
+
var appSettingsTrpc = defineTrpcContract("app").query("workspaceSettings").withInput(appWorkspaceRefSchema).withOutput(appWorkspaceSettingsSchema).query("functionSettings").withInput(appWorkspaceRefSchema).withOutput(appFunctionSettingsSchema).mutation("setFunctionsEnabled").withInput(setFunctionsEnabledInputSchema).withOutput(appFunctionSettingsSchema).mutation("setPublicAppsAllowed").withInput(setPublicAppsAllowedInputSchema).withOutput(appFunctionSettingsSchema).build();
|
|
74283
|
+
var appTrpc = joinTrpcContracts(
|
|
74284
|
+
"app",
|
|
74285
|
+
appMainTrpc,
|
|
74286
|
+
appConnectionsTrpc,
|
|
74287
|
+
appPinsTrpc,
|
|
74288
|
+
appSettingsTrpc
|
|
74289
|
+
);
|
|
74176
74290
|
|
|
74177
74291
|
// ../../modules/app/contract/src/app.rest.ts
|
|
74178
74292
|
var byKey = { workspaceId: true };
|
|
@@ -74214,7 +74328,7 @@ var pinRoleByKeyInputSchemaDefinition = setPinRoleInputSchema.omit(byKey);
|
|
|
74214
74328
|
var decideAccessByKeyInputSchemaDefinition = decideAppAccessInputSchema.omit(byKey);
|
|
74215
74329
|
var renameAppByKeyInputSchemaDefinition = renameAppInputSchema.omit(byKey);
|
|
74216
74330
|
var deleteAppByKeyInputSchemaDefinition = deleteAppInputSchema.omit(byKey);
|
|
74217
|
-
var
|
|
74331
|
+
var workspaceSettingsByKeyInputSchemaDefinition = external_exports.object({});
|
|
74218
74332
|
var setFunctionsEnabledByKeyInputSchemaDefinition = setFunctionsEnabledInputSchema.omit(byKey);
|
|
74219
74333
|
var setPublicAppsAllowedByKeyInputSchemaDefinition = setPublicAppsAllowedInputSchema.omit(byKey);
|
|
74220
74334
|
var restoreDataByKeyInputSchemaDefinition = external_exports.object({
|
|
@@ -74304,7 +74418,7 @@ var appCliCommands = [
|
|
|
74304
74418
|
command: "laze app publish",
|
|
74305
74419
|
operation: "requestPublish",
|
|
74306
74420
|
arguments: ["[version]", "--visibility restricted|channel|internal|public"],
|
|
74307
|
-
summary: "Bring the app back online after unpublish, or open it to other people with --visibility; a push is live already.
|
|
74421
|
+
summary: "Bring the app back online after unpublish, or open it to other people with --visibility; a push is live already. Making it public waits for an admin only when the workspace turned off public apps"
|
|
74308
74422
|
},
|
|
74309
74423
|
{
|
|
74310
74424
|
command: "laze app make-internal",
|
|
@@ -74346,7 +74460,7 @@ var appCliCommands = [
|
|
|
74346
74460
|
command: "laze app access visibility",
|
|
74347
74461
|
operation: "setVisibility",
|
|
74348
74462
|
arguments: ["restricted|channel|internal|public"],
|
|
74349
|
-
summary: "Change who can open the app
|
|
74463
|
+
summary: "Change who can open the app, at once; making it public waits for an admin's approval only when the workspace turned off public apps"
|
|
74350
74464
|
},
|
|
74351
74465
|
{
|
|
74352
74466
|
command: "laze app access member-role",
|
|
@@ -74468,12 +74582,6 @@ var appCliCommands = [
|
|
|
74468
74582
|
arguments: ["[app]"],
|
|
74469
74583
|
summary: "Make the builder ask again before its next public publish (admins, a person's key)"
|
|
74470
74584
|
},
|
|
74471
|
-
{
|
|
74472
|
-
command: "laze app functions",
|
|
74473
|
-
operation: "setFunctionsEnabled",
|
|
74474
|
-
arguments: ["[on|off]"],
|
|
74475
|
-
summary: "Whether the workspace's apps run server functions; on and off need an admin"
|
|
74476
|
-
},
|
|
74477
74585
|
{
|
|
74478
74586
|
command: "laze app public-apps",
|
|
74479
74587
|
operation: "setPublicAppsAllowed",
|
|
@@ -75336,25 +75444,13 @@ var revokeLease = async ({ context, args, open: open3 }) => {
|
|
|
75336
75444
|
`;
|
|
75337
75445
|
print2({ context, args, value: app2, text: text2 });
|
|
75338
75446
|
};
|
|
75339
|
-
var functions = async ({ context, args, signed: signed2 }) => {
|
|
75340
|
-
const word3 = args.words[2];
|
|
75341
|
-
if (word3 !== void 0 && word3 !== "on" && word3 !== "off") {
|
|
75342
|
-
throw new CliUsageError("Usage: laze app functions [on|off]");
|
|
75343
|
-
}
|
|
75344
|
-
const client = await signed2();
|
|
75345
|
-
const settings3 = word3 === void 0 ? await client.post("/api/apps/functions", {}) : await client.post("/api/apps/functions/enabled", {
|
|
75346
|
-
enabled: word3 === "on"
|
|
75347
|
-
});
|
|
75348
|
-
const text2 = settings3.functionsEnabled ? "Server functions are on for this workspace's apps.\n" : "Server functions are off: pushes with functions are refused and every function answers app_functions_disabled.\n";
|
|
75349
|
-
print2({ context, args, value: settings3, text: text2 });
|
|
75350
|
-
};
|
|
75351
75447
|
var publicApps = async ({ context, args, signed: signed2 }) => {
|
|
75352
75448
|
const word3 = args.words[2];
|
|
75353
75449
|
if (word3 !== void 0 && word3 !== "on" && word3 !== "off") {
|
|
75354
75450
|
throw new CliUsageError("Usage: laze app public-apps [on|off]");
|
|
75355
75451
|
}
|
|
75356
75452
|
const client = await signed2();
|
|
75357
|
-
const settings3 = word3 === void 0 ? await client.post("/api/apps/
|
|
75453
|
+
const settings3 = word3 === void 0 ? await client.post("/api/apps/settings", {}) : await client.post("/api/apps/public-apps", {
|
|
75358
75454
|
allowed: word3 === "on"
|
|
75359
75455
|
});
|
|
75360
75456
|
const text2 = settings3.publicAppsAllowed ? "Public apps are allowed: a Builder makes an app public without asking an admin.\n" : "Public apps ask an admin first: making an app public waits for an Owner or Admin to approve.\n";
|
|
@@ -75439,7 +75535,6 @@ var appManageCommands = {
|
|
|
75439
75535
|
unarchive,
|
|
75440
75536
|
delete: remove,
|
|
75441
75537
|
"revoke-lease": revokeLease,
|
|
75442
|
-
functions,
|
|
75443
75538
|
"public-apps": publicApps,
|
|
75444
75539
|
backups,
|
|
75445
75540
|
restore,
|
|
@@ -75957,14 +76052,14 @@ async function jsonFlag({
|
|
|
75957
76052
|
}
|
|
75958
76053
|
async function listFiles(folder) {
|
|
75959
76054
|
const found = [];
|
|
75960
|
-
const
|
|
75961
|
-
while (
|
|
75962
|
-
const current2 =
|
|
76055
|
+
const pending2 = [folder];
|
|
76056
|
+
while (pending2.length > 0 && found.length <= MAX_FILES) {
|
|
76057
|
+
const current2 = pending2.pop() ?? folder;
|
|
75963
76058
|
for (const entry of await readdir6(current2, { withFileTypes: true })) {
|
|
75964
76059
|
const path = join19(current2, entry.name);
|
|
75965
76060
|
const rel = relative3(folder, path).split(sep3).join("/");
|
|
75966
76061
|
if (isSkippedPath({ path: rel })) continue;
|
|
75967
|
-
if (entry.isDirectory())
|
|
76062
|
+
if (entry.isDirectory()) pending2.push(path);
|
|
75968
76063
|
else if (entry.isFile()) found.push(path);
|
|
75969
76064
|
}
|
|
75970
76065
|
}
|
|
@@ -76878,7 +76973,6 @@ var APP_COMMANDS = {
|
|
|
76878
76973
|
unarchive: managed(appManageCommands.unarchive),
|
|
76879
76974
|
delete: managed(appManageCommands.delete),
|
|
76880
76975
|
"revoke-lease": managed(appManageCommands["revoke-lease"]),
|
|
76881
|
-
functions: managed(appManageCommands.functions),
|
|
76882
76976
|
"public-apps": managed(appManageCommands["public-apps"]),
|
|
76883
76977
|
backups: managed(appManageCommands.backups),
|
|
76884
76978
|
restore: managed(appManageCommands.restore),
|
|
@@ -77077,8 +77171,8 @@ function printAccount({ context, args }, account) {
|
|
|
77077
77171
|
if (args.flags.json) return printJson(context, account);
|
|
77078
77172
|
const of = (amount) => money(amount, account.currency);
|
|
77079
77173
|
const plan2 = account.plan === "team" ? `Team, ${of(account.seats.monthlyPrice)} a month for ${account.seats.people} people` : "Free, for one person";
|
|
77080
|
-
const
|
|
77081
|
-
context.out(`Plan: ${plan2}${
|
|
77174
|
+
const pending2 = account.status === "pending_payment" ? " (payment pending: run laze billing checkout)" : "";
|
|
77175
|
+
context.out(`Plan: ${plan2}${pending2}
|
|
77082
77176
|
`);
|
|
77083
77177
|
context.out(
|
|
77084
77178
|
`Credits: ${of(account.credits.includedLeft)} of ${of(account.credits.included)} included left, ${of(account.credits.prepaid)} prepaid${prepaidNoteOf(account, of)}${account.credits.paused ? " (paused: top up to resume)" : ""}
|
|
@@ -81431,7 +81525,7 @@ async function relayMcpLines({
|
|
|
81431
81525
|
lines: lines2,
|
|
81432
81526
|
watchMs = WATCH_MS2
|
|
81433
81527
|
}) {
|
|
81434
|
-
const
|
|
81528
|
+
const pending2 = lines2[Symbol.asyncIterator]();
|
|
81435
81529
|
const { profile } = await signedIn({ context, args });
|
|
81436
81530
|
const env = context.environment.inherited;
|
|
81437
81531
|
if (!profile.agentId || !env.LAZE_TURN_FILE)
|
|
@@ -81464,7 +81558,7 @@ async function relayMcpLines({
|
|
|
81464
81558
|
const timer = setInterval(() => void recheckTools({ relay: relay2, listed }), watchMs);
|
|
81465
81559
|
timer.unref?.();
|
|
81466
81560
|
try {
|
|
81467
|
-
for (let next = await
|
|
81561
|
+
for (let next = await pending2.next(); !next.done; next = await pending2.next()) {
|
|
81468
81562
|
if (next.value.trim()) await relayLine({ relay: relay2, listed, line: next.value });
|
|
81469
81563
|
}
|
|
81470
81564
|
} finally {
|
|
@@ -82631,6 +82725,8 @@ var EXTERNAL_CONNECTION_REST_PATHS = {
|
|
|
82631
82725
|
invitations: "/api/external-connections/invitations",
|
|
82632
82726
|
invite: "/api/external-connections/invite",
|
|
82633
82727
|
revoke: "/api/external-connections/revoke",
|
|
82728
|
+
resend: "/api/external-connections/resend",
|
|
82729
|
+
pending: "/api/external-connections/pending",
|
|
82634
82730
|
accept: "/api/external-connections/accept",
|
|
82635
82731
|
decline: "/api/external-connections/decline",
|
|
82636
82732
|
forward: "/api/external-connections/forward",
|
|
@@ -82703,6 +82799,8 @@ var externalConnectionSchema = connectionDefinition;
|
|
|
82703
82799
|
var sentInviteDefinition = external_exports.object({
|
|
82704
82800
|
id: external_exports.string(),
|
|
82705
82801
|
email: external_exports.string(),
|
|
82802
|
+
/** The company the inviter named for the address; null when none was given. */
|
|
82803
|
+
company: external_exports.string().nullable(),
|
|
82706
82804
|
state: externalInviteStateSchema,
|
|
82707
82805
|
invitedBy: personDefinition,
|
|
82708
82806
|
/** The channel shared once it is accepted. */
|
|
@@ -82755,11 +82853,33 @@ var inviteInputDefinition = external_exports.object({
|
|
|
82755
82853
|
workspaceId: workspaceIdSchema20,
|
|
82756
82854
|
email: external_exports.email().max(320),
|
|
82757
82855
|
/** The first channel to share, by id or name; it is shared once the invitation is accepted. */
|
|
82758
|
-
share: external_exports.string().trim().min(1).max(81).optional()
|
|
82856
|
+
share: external_exports.string().trim().min(1).max(81).optional(),
|
|
82857
|
+
/** The invited company's name, shown while the channel waits for them. */
|
|
82858
|
+
company: external_exports.string().trim().min(1).max(80).optional()
|
|
82759
82859
|
});
|
|
82760
82860
|
var externalInviteInputSchema = inviteInputDefinition;
|
|
82761
82861
|
var inviteRefDefinition = external_exports.object({ workspaceId: workspaceIdSchema20, inviteId: idSchema21 });
|
|
82762
82862
|
var externalInviteRefSchema = inviteRefDefinition;
|
|
82863
|
+
var pendingShareDefinition = external_exports.object({
|
|
82864
|
+
channelId: external_exports.string(),
|
|
82865
|
+
channelName: external_exports.string(),
|
|
82866
|
+
/** `invite` waits on an open invitation naming the channel, `share` on a connected workspace. */
|
|
82867
|
+
kind: external_exports.enum(["invite", "share"]),
|
|
82868
|
+
/** The invitation's id (Resend, Cancel revokes it) or the share's id (Cancel stops it). */
|
|
82869
|
+
id: external_exports.string(),
|
|
82870
|
+
/** Who must accept: the connected workspace, the invited company, else the address's domain. */
|
|
82871
|
+
peerName: external_exports.string(),
|
|
82872
|
+
sentAt: iso,
|
|
82873
|
+
/** When an invitation lapses; null for a share, which waits until answered or stopped. */
|
|
82874
|
+
expiresAt: iso.nullable()
|
|
82875
|
+
});
|
|
82876
|
+
var pendingSharesDefinition = external_exports.object({
|
|
82877
|
+
/** Whether the reader may share, resend and cancel: an Admin or Owner of the workspace. */
|
|
82878
|
+
manages: external_exports.boolean(),
|
|
82879
|
+
/** Channels the reader can see that wait for another workspace to accept. */
|
|
82880
|
+
pending: external_exports.array(pendingShareDefinition)
|
|
82881
|
+
});
|
|
82882
|
+
var externalPendingSharesSchema = pendingSharesDefinition;
|
|
82763
82883
|
var acceptInviteDefinition = external_exports.object({
|
|
82764
82884
|
/** The workspace to connect: one where the person is Admin or Owner. */
|
|
82765
82885
|
workspaceId: workspaceIdSchema20,
|
|
@@ -82834,7 +82954,7 @@ var directDefinition = external_exports.object({
|
|
|
82834
82954
|
});
|
|
82835
82955
|
var externalDirectSchema = directDefinition;
|
|
82836
82956
|
var ExternalConnectionApi = moduleApi()("external-connection");
|
|
82837
|
-
var externalConnectionTrpc = defineTrpcContract("externalConnection").query("overview").withInput(workspaceInput4).withOutput(externalOverviewSchema).query("roster").withInput(externalRosterInputSchema).withOutput(externalRosterSchema).query("myInvitations").withInput(workspaceInput4).withOutput(external_exports.array(externalInvitationSchema)).mutation("invite").withInput(externalInviteInputSchema).withOutput(externalSentInviteSchema).mutation("revokeInvite").withInput(externalInviteRefSchema).withOutput(externalSentInviteSchema).mutation("acceptInvite").withInput(externalAcceptInviteInputSchema).withOutput(externalConnectionSchema).mutation("declineInvite").withInput(externalInviteRefSchema).withOutput(externalInviteAnsweredSchema).mutation("forwardInvite").withInput(externalInviteRefSchema).withOutput(externalInviteAnsweredSchema).mutation("disconnect").withInput(externalConnectionInputSchema).withOutput(externalConnectionSchema).mutation("updateSettings").withInput(externalSettingsInputSchema).withOutput(externalConnectionSchema).mutation("shareChannel").withInput(externalShareInputSchema).withOutput(externalSharedChannelSchema).mutation("acceptShare").withInput(externalAcceptShareInputSchema).withOutput(externalSharedChannelSchema).mutation("declineShare").withInput(externalShareRefSchema).withOutput(externalSharedChannelSchema).mutation("stopSharing").withInput(externalShareRefSchema).withOutput(externalSharedChannelSchema).mutation("block").withInput(externalConnectionInputSchema).withOutput(externalBlockedSchema).mutation("report").withInput(externalReportInputSchema).withOutput(externalBlockedSchema).mutation("openDirect").withInput(externalOpenDirectInputSchema).withOutput(externalDirectSchema).build();
|
|
82957
|
+
var externalConnectionTrpc = defineTrpcContract("externalConnection").query("overview").withInput(workspaceInput4).withOutput(externalOverviewSchema).query("roster").withInput(externalRosterInputSchema).withOutput(externalRosterSchema).query("myInvitations").withInput(workspaceInput4).withOutput(external_exports.array(externalInvitationSchema)).mutation("invite").withInput(externalInviteInputSchema).withOutput(externalSentInviteSchema).mutation("revokeInvite").withInput(externalInviteRefSchema).withOutput(externalSentInviteSchema).mutation("resendInvite").withInput(externalInviteRefSchema).withOutput(externalSentInviteSchema).query("pendingShares").withInput(workspaceInput4).withOutput(externalPendingSharesSchema).mutation("acceptInvite").withInput(externalAcceptInviteInputSchema).withOutput(externalConnectionSchema).mutation("declineInvite").withInput(externalInviteRefSchema).withOutput(externalInviteAnsweredSchema).mutation("forwardInvite").withInput(externalInviteRefSchema).withOutput(externalInviteAnsweredSchema).mutation("disconnect").withInput(externalConnectionInputSchema).withOutput(externalConnectionSchema).mutation("updateSettings").withInput(externalSettingsInputSchema).withOutput(externalConnectionSchema).mutation("shareChannel").withInput(externalShareInputSchema).withOutput(externalSharedChannelSchema).mutation("acceptShare").withInput(externalAcceptShareInputSchema).withOutput(externalSharedChannelSchema).mutation("declineShare").withInput(externalShareRefSchema).withOutput(externalSharedChannelSchema).mutation("stopSharing").withInput(externalShareRefSchema).withOutput(externalSharedChannelSchema).mutation("block").withInput(externalConnectionInputSchema).withOutput(externalBlockedSchema).mutation("report").withInput(externalReportInputSchema).withOutput(externalBlockedSchema).mutation("openDirect").withInput(externalOpenDirectInputSchema).withOutput(externalDirectSchema).build();
|
|
82838
82958
|
|
|
82839
82959
|
// ../../modules/external-connection/contract/src/external-connection.config.ts
|
|
82840
82960
|
var externalConnectionConfig = Config.define(() => ({ publicBaseUrl }));
|
|
@@ -82854,6 +82974,12 @@ var shareRefDefinition2 = externalShareRefSchema.omit(keyed);
|
|
|
82854
82974
|
var reportDefinition = externalReportInputSchema.omit(keyed);
|
|
82855
82975
|
var directDefinition2 = externalOpenDirectInputSchema.omit(keyed);
|
|
82856
82976
|
|
|
82977
|
+
// ../../modules/external-connection/contract/src/external-connection.ui.ts
|
|
82978
|
+
var externalUi = uiTokens("external-connection");
|
|
82979
|
+
var ExternalShareDialogSlot = externalUi.component("share-dialog");
|
|
82980
|
+
var ExternalChannelBannerSlot = externalUi.component("channel-banner");
|
|
82981
|
+
var ExternalSharingHooksToken = externalUi.hooks("sharing");
|
|
82982
|
+
|
|
82857
82983
|
// src/services/workspace-commands.service.ts
|
|
82858
82984
|
import { readFile as readFile26 } from "node:fs/promises";
|
|
82859
82985
|
import { resolve as resolve9 } from "node:path";
|
|
@@ -83276,8 +83402,10 @@ var EXTERNAL_USAGE = `Usage:
|
|
|
83276
83402
|
laze external list connected workspaces, their shared channels and settings
|
|
83277
83403
|
laze external roster <channel id> the other workspace's people in a shared channel
|
|
83278
83404
|
laze external invites invitations to you, and requests forwarded to your admins
|
|
83279
|
-
laze external invite <email> [--share <#channel>] invite another company's admin (admins)
|
|
83405
|
+
laze external invite <email> [--share <#channel>] [--company <name>] invite another company's admin (admins)
|
|
83280
83406
|
laze external revoke <invitation id> take back an open invitation (admins)
|
|
83407
|
+
laze external resend <invitation id> send an open invitation again with a new link (admins)
|
|
83408
|
+
laze external pending channels waiting for another workspace to accept
|
|
83281
83409
|
laze external accept <invitation id> [--workspace <name|id>] [--secret <link secret>] connect (admins)
|
|
83282
83410
|
laze external decline <invitation id> decline an invitation (admins)
|
|
83283
83411
|
laze external forward <invitation id> hand an invitation addressed to you to your admins
|
|
@@ -83388,18 +83516,48 @@ async function invitations({ context, args }) {
|
|
|
83388
83516
|
async function invite2({ context, args }) {
|
|
83389
83517
|
const email3 = wordAt3({ args, at: 2, what: "the address to invite" });
|
|
83390
83518
|
const share3 = flagText({ args, name: "share" })?.trim();
|
|
83519
|
+
const company = flagText({ args, name: "company" })?.trim();
|
|
83391
83520
|
const { client } = await clientOf2({ context, args });
|
|
83392
83521
|
const sent = await client.post(EXTERNAL_CONNECTION_REST_PATHS.invite, {
|
|
83393
83522
|
email: email3,
|
|
83394
|
-
...share3 ? { share: share3 } : {}
|
|
83523
|
+
...share3 ? { share: share3 } : {},
|
|
83524
|
+
...company ? { company } : {}
|
|
83395
83525
|
});
|
|
83396
83526
|
if (args.flags.json) return printJson6(context, sent);
|
|
83397
83527
|
const sharing = sent.share ? `, sharing #${sent.share.name} once accepted` : "";
|
|
83528
|
+
const at = sent.company ? ` at ${sent.company}` : "";
|
|
83529
|
+
context.out(
|
|
83530
|
+
`Invited ${sent.email}${at}${sharing}. Invitation ${sent.id} expires ${utcTimeOf(sent.expiresAt)}.
|
|
83531
|
+
`
|
|
83532
|
+
);
|
|
83533
|
+
}
|
|
83534
|
+
async function resend({ context, args }) {
|
|
83535
|
+
const inviteId = wordAt3({ args, at: 2, what: "the invitation's id" });
|
|
83536
|
+
const { client } = await clientOf2({ context, args });
|
|
83537
|
+
const sent = await client.post(EXTERNAL_CONNECTION_REST_PATHS.resend, {
|
|
83538
|
+
inviteId
|
|
83539
|
+
});
|
|
83540
|
+
if (args.flags.json) return printJson6(context, sent);
|
|
83398
83541
|
context.out(
|
|
83399
|
-
`
|
|
83542
|
+
`Sent invitation ${sent.id} to ${sent.email} again with a new link. It expires ${utcTimeOf(sent.expiresAt)}.
|
|
83400
83543
|
`
|
|
83401
83544
|
);
|
|
83402
83545
|
}
|
|
83546
|
+
async function pending({ context, args }) {
|
|
83547
|
+
const { client } = await clientOf2({ context, args });
|
|
83548
|
+
const answer5 = await client.get(EXTERNAL_CONNECTION_REST_PATHS.pending);
|
|
83549
|
+
if (args.flags.json) return printJson6(context, answer5);
|
|
83550
|
+
if (answer5.pending.length === 0)
|
|
83551
|
+
return context.out("No channel is waiting on another workspace.\n");
|
|
83552
|
+
for (const each of answer5.pending) {
|
|
83553
|
+
const what = each.kind === "invite" ? "invitation" : "share";
|
|
83554
|
+
const until = each.expiresAt ? `, expires ${utcTimeOf(each.expiresAt)}` : "";
|
|
83555
|
+
context.out(
|
|
83556
|
+
`#${each.channelName} waiting for ${each.peerName} to accept the ${what}${until} ${each.id}
|
|
83557
|
+
`
|
|
83558
|
+
);
|
|
83559
|
+
}
|
|
83560
|
+
}
|
|
83403
83561
|
async function inviteRef({ context, args, path }) {
|
|
83404
83562
|
const inviteId = wordAt3({ args, at: 2, what: "the invitation's id" });
|
|
83405
83563
|
const { client } = await clientOf2({ context, args });
|
|
@@ -83556,6 +83714,8 @@ var EXTERNAL_COMMANDS = {
|
|
|
83556
83714
|
invites: invitations,
|
|
83557
83715
|
invite: invite2,
|
|
83558
83716
|
revoke,
|
|
83717
|
+
resend,
|
|
83718
|
+
pending,
|
|
83559
83719
|
accept,
|
|
83560
83720
|
decline,
|
|
83561
83721
|
forward,
|
|
@@ -83805,9 +83965,24 @@ var feedViewerStateSchemaDefinition = external_exports.object({
|
|
|
83805
83965
|
/** The person joined the item's channel after it was posted. */
|
|
83806
83966
|
beforeYouJoined: external_exports.boolean().optional(),
|
|
83807
83967
|
/** The item is the person's alone, so they may edit its title and summary. */
|
|
83808
|
-
canEdit: external_exports.boolean().optional()
|
|
83968
|
+
canEdit: external_exports.boolean().optional(),
|
|
83969
|
+
/** On a shared item: the reader's own item they shared, or someone's item shared with them. */
|
|
83970
|
+
shared: external_exports.enum(["by_you", "with_you"]).optional(),
|
|
83971
|
+
/** The reader owns the item and may add or remove people on it. */
|
|
83972
|
+
mayShare: external_exports.boolean().optional()
|
|
83809
83973
|
});
|
|
83810
83974
|
var feedViewerStateSchema = feedViewerStateSchemaDefinition;
|
|
83975
|
+
var feedAssigneeSchemaDefinition = external_exports.object({
|
|
83976
|
+
userId: external_exports.string(),
|
|
83977
|
+
name: external_exports.string(),
|
|
83978
|
+
/** Who added them; null for the owner. */
|
|
83979
|
+
sharedByName: external_exports.string().nullable()
|
|
83980
|
+
});
|
|
83981
|
+
var feedSharingSchemaDefinition = external_exports.object({
|
|
83982
|
+
ownerUserId: external_exports.string(),
|
|
83983
|
+
ownerName: external_exports.string(),
|
|
83984
|
+
assignees: external_exports.array(feedAssigneeSchemaDefinition)
|
|
83985
|
+
});
|
|
83811
83986
|
var feedItemSchemaDefinition = external_exports.object({
|
|
83812
83987
|
id: external_exports.string(),
|
|
83813
83988
|
workspaceId: external_exports.string(),
|
|
@@ -83843,6 +84018,8 @@ var feedItemSchemaDefinition = external_exports.object({
|
|
|
83843
84018
|
createdAt: external_exports.iso.datetime(),
|
|
83844
84019
|
updatedAt: external_exports.iso.datetime(),
|
|
83845
84020
|
lastReplyAt: external_exports.iso.datetime().nullable(),
|
|
84021
|
+
/** Set once the item is shared with someone besides its owner. */
|
|
84022
|
+
sharing: feedSharingSchemaDefinition.nullable().optional(),
|
|
83846
84023
|
me: feedViewerStateSchema
|
|
83847
84024
|
});
|
|
83848
84025
|
var feedItemSchema = feedItemSchemaDefinition;
|
|
@@ -84056,6 +84233,33 @@ var feedSnoozeByKeyInputSchemaDefinition = external_exports.object({
|
|
|
84056
84233
|
until: external_exports.iso.datetime({ offset: true })
|
|
84057
84234
|
});
|
|
84058
84235
|
var feedChannelItemsByKeyInputSchemaDefinition = external_exports.object({ channelId: external_exports.string().min(1) });
|
|
84236
|
+
var shareFeedItemInputSchemaDefinition = external_exports.object({
|
|
84237
|
+
...itemRef.shape,
|
|
84238
|
+
userIds: external_exports.array(external_exports.string().min(1)).min(1).max(20)
|
|
84239
|
+
});
|
|
84240
|
+
var shareFeedItemInputSchema = shareFeedItemInputSchemaDefinition;
|
|
84241
|
+
var unshareFeedItemInputSchemaDefinition = external_exports.object({
|
|
84242
|
+
...itemRef.shape,
|
|
84243
|
+
userId: external_exports.string().min(1)
|
|
84244
|
+
});
|
|
84245
|
+
var unshareFeedItemInputSchema = unshareFeedItemInputSchemaDefinition;
|
|
84246
|
+
var feedSharePersonSchemaDefinition = external_exports.object({ userId: external_exports.string(), name: external_exports.string() });
|
|
84247
|
+
var feedSharePersonSchema = feedSharePersonSchemaDefinition;
|
|
84248
|
+
var feedShareAnswerSchemaDefinition = external_exports.object({
|
|
84249
|
+
itemIds: external_exports.array(external_exports.string()),
|
|
84250
|
+
people: external_exports.array(feedSharePersonSchemaDefinition),
|
|
84251
|
+
item: feedItemSchemaDefinition.nullable()
|
|
84252
|
+
});
|
|
84253
|
+
var feedShareAnswerSchema = feedShareAnswerSchemaDefinition;
|
|
84254
|
+
var feedShareByKeyInputSchemaDefinition = external_exports.object({
|
|
84255
|
+
itemId: external_exports.string().min(1).optional(),
|
|
84256
|
+
all: external_exports.boolean().default(false),
|
|
84257
|
+
label: feedLabelSchema.optional(),
|
|
84258
|
+
group: feedGroupSchema.optional(),
|
|
84259
|
+
with: external_exports.array(external_exports.string().trim().min(1)).min(1).max(20)
|
|
84260
|
+
}).refine((input2) => Boolean(input2.itemId) !== input2.all, {
|
|
84261
|
+
message: "Name one item by its id, or --all, not both"
|
|
84262
|
+
});
|
|
84059
84263
|
var FeedApi = moduleApi()("feed");
|
|
84060
84264
|
var feedFileLinkInputSchemaDefinition = external_exports.object({
|
|
84061
84265
|
workspaceId: external_exports.string().min(1),
|
|
@@ -84067,7 +84271,7 @@ var feedFileLinkInputSchemaDefinition = external_exports.object({
|
|
|
84067
84271
|
var feedFileLinkInputSchema = feedFileLinkInputSchemaDefinition;
|
|
84068
84272
|
var feedFileLinkSchemaDefinition = external_exports.object({ url: external_exports.string(), expiresAt: external_exports.iso.datetime() });
|
|
84069
84273
|
var feedFileLinkSchema = feedFileLinkSchemaDefinition;
|
|
84070
|
-
var feedTrpc = defineTrpcContract("feed").query("channelItems").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), channelId: external_exports.string().min(1) })).withOutput(external_exports.array(feedAgentItemSchema)).query("list").withInput(listFeedInputSchema).withOutput(feedViewSchema).query("card").withInput(itemRef).withOutput(feedCardViewSchema).query("fileLink").withInput(feedFileLinkInputSchema).withOutput(feedFileLinkSchema).query("count").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).query("decisions").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(feedDecisionsSchema).mutation("act").withInput(actFeedItemInputSchema).withOutput(feedItemSchema).mutation("comment").withInput(commentFeedItemInputSchema).withOutput(feedItemSchema).mutation("done").withInput(itemRef).withOutput(feedItemSchema).mutation("stopAutoSend").withInput(itemRef).withOutput(feedItemSchema).mutation("putBack").withInput(putBackFeedItemInputSchema).withOutput(feedItemSchema).mutation("snooze").withInput(snoozeFeedItemInputSchema).withOutput(feedItemSchema).mutation("unsnooze").withInput(itemRef).withOutput(feedItemSchema).mutation("saveDraft").withInput(saveFeedDraftInputSchema).withOutput(feedItemSchema).mutation("editItem").withInput(editFeedItemInputSchema).withOutput(feedItemSchema).mutation("saveMessage").withInput(saveFeedMessageInputSchema).withOutput(feedItemSchema).mutation("answerApproval").withInput(answerFeedApprovalInputSchema).withOutput(feedItemSchema).mutation("decidePublish").withInput(decideFeedPublishInputSchema).withOutput(feedItemSchema).mutation("decideAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideServer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAppAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideComputer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentJoin").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentTransfer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).build();
|
|
84274
|
+
var feedTrpc = defineTrpcContract("feed").query("channelItems").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), channelId: external_exports.string().min(1) })).withOutput(external_exports.array(feedAgentItemSchema)).query("list").withInput(listFeedInputSchema).withOutput(feedViewSchema).query("card").withInput(itemRef).withOutput(feedCardViewSchema).query("fileLink").withInput(feedFileLinkInputSchema).withOutput(feedFileLinkSchema).query("count").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).query("decisions").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(feedDecisionsSchema).mutation("act").withInput(actFeedItemInputSchema).withOutput(feedItemSchema).mutation("comment").withInput(commentFeedItemInputSchema).withOutput(feedItemSchema).mutation("done").withInput(itemRef).withOutput(feedItemSchema).mutation("stopAutoSend").withInput(itemRef).withOutput(feedItemSchema).mutation("putBack").withInput(putBackFeedItemInputSchema).withOutput(feedItemSchema).mutation("snooze").withInput(snoozeFeedItemInputSchema).withOutput(feedItemSchema).mutation("unsnooze").withInput(itemRef).withOutput(feedItemSchema).mutation("saveDraft").withInput(saveFeedDraftInputSchema).withOutput(feedItemSchema).mutation("editItem").withInput(editFeedItemInputSchema).withOutput(feedItemSchema).mutation("saveMessage").withInput(saveFeedMessageInputSchema).withOutput(feedItemSchema).mutation("share").withInput(shareFeedItemInputSchema).withOutput(feedShareAnswerSchema).mutation("unshare").withInput(unshareFeedItemInputSchema).withOutput(feedShareAnswerSchema).query("shareCandidates").withInput(itemRef).withOutput(external_exports.array(feedSharePersonSchema)).mutation("answerApproval").withInput(answerFeedApprovalInputSchema).withOutput(feedItemSchema).mutation("decidePublish").withInput(decideFeedPublishInputSchema).withOutput(feedItemSchema).mutation("decideAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideServer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAppAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideComputer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentJoin").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentTransfer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).build();
|
|
84071
84275
|
var feedUi = uiTokens("feed");
|
|
84072
84276
|
var FeedNavSlot = feedUi.component("nav");
|
|
84073
84277
|
var FeedDecisionsSlot = feedUi.component("decisions");
|
|
@@ -84371,6 +84575,8 @@ var USAGE9 = `Usage:
|
|
|
84371
84575
|
laze feed inbox
|
|
84372
84576
|
laze feed close <id>|--loop <key> --note <text>
|
|
84373
84577
|
laze feed loops [--json]
|
|
84578
|
+
laze feed share <id>|--all [--label <word>|--group <name>] --with <person>...
|
|
84579
|
+
laze feed unshare <id>|--all --with <person>...
|
|
84374
84580
|
laze feed group-summary <group>
|
|
84375
84581
|
laze feed list [--json]
|
|
84376
84582
|
laze feed count
|
|
@@ -84503,6 +84709,38 @@ async function feedClose({ context, args }) {
|
|
|
84503
84709
|
context.out(`${closed.item.id} closed ${closed.item.title}
|
|
84504
84710
|
`);
|
|
84505
84711
|
}
|
|
84712
|
+
function shareCommand({ move: move3 }) {
|
|
84713
|
+
return async ({ context, args }) => {
|
|
84714
|
+
const itemId = args.words[2];
|
|
84715
|
+
const all = args.flags.all === true;
|
|
84716
|
+
const people2 = args.lists.with ?? [];
|
|
84717
|
+
if (people2.length === 0 || Boolean(itemId) === all) throw new CliUsageError(USAGE9);
|
|
84718
|
+
const label3 = flagText({ args, name: "label" });
|
|
84719
|
+
const group = flagText({ args, name: "group" });
|
|
84720
|
+
const { client } = await signedIn({ context, args });
|
|
84721
|
+
const answer5 = await client.post(`/api/feed/items/${move3}`, {
|
|
84722
|
+
...itemId ? { itemId } : { all: true },
|
|
84723
|
+
...optionalWords({ label: label3, group }),
|
|
84724
|
+
with: people2
|
|
84725
|
+
});
|
|
84726
|
+
if (args.flags.json) return context.out(`${JSON.stringify(answer5, null, 2)}
|
|
84727
|
+
`);
|
|
84728
|
+
context.out(shareLinesOf({ move: move3, answer: answer5 }));
|
|
84729
|
+
};
|
|
84730
|
+
}
|
|
84731
|
+
function optionalWords(words) {
|
|
84732
|
+
return Object.fromEntries(
|
|
84733
|
+
Object.entries(words).filter((entry) => Boolean(entry[1]))
|
|
84734
|
+
);
|
|
84735
|
+
}
|
|
84736
|
+
function shareLinesOf({ move: move3, answer: answer5 }) {
|
|
84737
|
+
const names = answer5.people.map((person) => person.name).join(", ") || "no one new";
|
|
84738
|
+
const count5 = answer5.itemIds.length;
|
|
84739
|
+
const items = `${count5} item${count5 === 1 ? "" : "s"}`;
|
|
84740
|
+
const head = move3 === "share" ? `Shared ${items} with ${names}` : `Took ${names} off ${items}`;
|
|
84741
|
+
return [head, ...answer5.itemIds].map((line) => `${line}
|
|
84742
|
+
`).join("");
|
|
84743
|
+
}
|
|
84506
84744
|
async function feedLoops({ context, args }) {
|
|
84507
84745
|
const { client } = await signedIn({ context, args });
|
|
84508
84746
|
const loops = await client.get("/api/feed/loops");
|
|
@@ -84659,6 +84897,8 @@ var FEED_COMMANDS = {
|
|
|
84659
84897
|
"group-summary": feedGroupSummary,
|
|
84660
84898
|
close: feedClose,
|
|
84661
84899
|
loops: feedLoops,
|
|
84900
|
+
share: shareCommand({ move: "share" }),
|
|
84901
|
+
unshare: shareCommand({ move: "unshare" }),
|
|
84662
84902
|
list: feedList,
|
|
84663
84903
|
count: feedCount,
|
|
84664
84904
|
decisions: feedDecisions,
|
|
@@ -85181,19 +85421,19 @@ async function readPending({
|
|
|
85181
85421
|
url: url2,
|
|
85182
85422
|
args
|
|
85183
85423
|
}) {
|
|
85184
|
-
const
|
|
85424
|
+
const pending2 = await readFile31(pendingPathOf({ context }), "utf8").then(
|
|
85185
85425
|
(text2) => JSON.parse(text2),
|
|
85186
85426
|
() => void 0
|
|
85187
85427
|
);
|
|
85188
|
-
if (!
|
|
85189
|
-
if (args && !asksTheSame({ pending, flags: flaggedOf({ args }) })) return void 0;
|
|
85190
|
-
return Temporal3.Instant.from(
|
|
85428
|
+
if (!pending2 || pending2.url !== url2) return void 0;
|
|
85429
|
+
if (args && !asksTheSame({ pending: pending2, flags: flaggedOf({ args }) })) return void 0;
|
|
85430
|
+
return Temporal3.Instant.from(pending2.expiresAt).epochMilliseconds > context.nowMs() ? pending2 : void 0;
|
|
85191
85431
|
}
|
|
85192
|
-
async function keepPending({ context, pending }) {
|
|
85432
|
+
async function keepPending({ context, pending: pending2 }) {
|
|
85193
85433
|
const path = pendingPathOf({ context });
|
|
85194
85434
|
await mkdir20(dirname19(path), { recursive: true, mode: 448 });
|
|
85195
85435
|
const temporary = `${path}.${process.pid}.tmp`;
|
|
85196
|
-
await writeFile20(temporary, JSON.stringify(
|
|
85436
|
+
await writeFile20(temporary, JSON.stringify(pending2), { mode: 384 });
|
|
85197
85437
|
await rename6(temporary, path);
|
|
85198
85438
|
}
|
|
85199
85439
|
async function dropPending({ context }) {
|
|
@@ -85213,9 +85453,9 @@ function flaggedOf({ args }) {
|
|
|
85213
85453
|
const forEmail = flagText({ args, name: "for" });
|
|
85214
85454
|
return { ...workspace2 ? { workspace: workspace2 } : {}, ...forEmail ? { forEmail } : {} };
|
|
85215
85455
|
}
|
|
85216
|
-
function asksTheSame({ pending, flags: flags2 }) {
|
|
85456
|
+
function asksTheSame({ pending: pending2, flags: flags2 }) {
|
|
85217
85457
|
if (!flags2.workspace && !flags2.forEmail) return true;
|
|
85218
|
-
return flags2.workspace ===
|
|
85458
|
+
return flags2.workspace === pending2.asked?.workspace && flags2.forEmail === pending2.asked?.forEmail;
|
|
85219
85459
|
}
|
|
85220
85460
|
async function askedOf({
|
|
85221
85461
|
context,
|
|
@@ -85229,27 +85469,27 @@ async function askedOf({
|
|
|
85229
85469
|
)).trim();
|
|
85230
85470
|
return answer5 ? { workspace: answer5 } : {};
|
|
85231
85471
|
}
|
|
85232
|
-
function waitingText({ pending, resumed }) {
|
|
85233
|
-
const where =
|
|
85234
|
-
`The request waits in ${
|
|
85472
|
+
function waitingText({ pending: pending2, resumed }) {
|
|
85473
|
+
const where = pending2.workspaceName ? [
|
|
85474
|
+
`The request waits in ${pending2.workspaceName}'s feed for its approvers; it also opens at ${pending2.approveUrl}`
|
|
85235
85475
|
] : [
|
|
85236
|
-
`Ask your person to open ${
|
|
85476
|
+
`Ask your person to open ${pending2.approveUrl} and approve it once.`,
|
|
85237
85477
|
"Pass --workspace <name> next time so it shows in their feed."
|
|
85238
85478
|
];
|
|
85239
|
-
const first = `${resumed ? "Still waiting" : "Asked to join Laze"}: code ${
|
|
85479
|
+
const first = `${resumed ? "Still waiting" : "Asked to join Laze"}: code ${pending2.code}.`;
|
|
85240
85480
|
return [first, ...where, ""].join("\n");
|
|
85241
85481
|
}
|
|
85242
|
-
async function stillOurs({ context, pending }) {
|
|
85243
|
-
const kept = await readPending({ context, url:
|
|
85244
|
-
return kept?.requestToken ===
|
|
85482
|
+
async function stillOurs({ context, pending: pending2 }) {
|
|
85483
|
+
const kept = await readPending({ context, url: pending2.url });
|
|
85484
|
+
return kept?.requestToken === pending2.requestToken;
|
|
85245
85485
|
}
|
|
85246
85486
|
async function pollOnce({
|
|
85247
85487
|
context,
|
|
85248
85488
|
client,
|
|
85249
|
-
pending
|
|
85489
|
+
pending: pending2
|
|
85250
85490
|
}) {
|
|
85251
85491
|
const answer5 = await client.post("/api/agents/join-requests/poll", {
|
|
85252
|
-
requestToken:
|
|
85492
|
+
requestToken: pending2.requestToken
|
|
85253
85493
|
}).catch(async (error62) => {
|
|
85254
85494
|
if (!(error62 instanceof LazeApiError)) throw error62;
|
|
85255
85495
|
if (error62.code === "agent_join_request_claimed") return { status: "taken" };
|
|
@@ -85269,15 +85509,15 @@ async function approvalOf({
|
|
|
85269
85509
|
context,
|
|
85270
85510
|
args,
|
|
85271
85511
|
client,
|
|
85272
|
-
pending
|
|
85512
|
+
pending: pending2
|
|
85273
85513
|
}) {
|
|
85274
85514
|
const deadline = context.nowMs() + waitSecondsOf3({ args }) * 1e3;
|
|
85275
|
-
const polls = Math.ceil(waitSecondsOf3({ args }) /
|
|
85515
|
+
const polls = Math.ceil(waitSecondsOf3({ args }) / pending2.intervalSeconds) + 1;
|
|
85276
85516
|
for (let poll = 0; poll < polls; poll += 1) {
|
|
85277
|
-
if (poll > 0 && !await stillOurs({ context, pending })) return { kind: "taken" };
|
|
85278
|
-
const outcome = await pollOnce({ context, client, pending });
|
|
85517
|
+
if (poll > 0 && !await stillOurs({ context, pending: pending2 })) return { kind: "taken" };
|
|
85518
|
+
const outcome = await pollOnce({ context, client, pending: pending2 });
|
|
85279
85519
|
if (outcome.kind !== "waiting" || context.nowMs() >= deadline) return outcome;
|
|
85280
|
-
await context.sleep(
|
|
85520
|
+
await context.sleep(pending2.intervalSeconds * 1e3);
|
|
85281
85521
|
}
|
|
85282
85522
|
return { kind: "waiting" };
|
|
85283
85523
|
}
|
|
@@ -85287,28 +85527,28 @@ async function joinAsAgent({ context, args }) {
|
|
|
85287
85527
|
const client = LazeClient.create({ baseUrl: url2, fetcher: context.fetcher });
|
|
85288
85528
|
const resumed = args.flags.restart ? void 0 : await readPending({ context, url: url2, args });
|
|
85289
85529
|
const asked = resumed ? {} : await askedOf({ context, args });
|
|
85290
|
-
const
|
|
85530
|
+
const pending2 = resumed ?? await client.post("/api/agents/join-requests", {
|
|
85291
85531
|
harness,
|
|
85292
85532
|
...asked,
|
|
85293
85533
|
...flagText({ args, name: "name" }) ? { name: flagText({ args, name: "name" }) } : {},
|
|
85294
85534
|
...flagText({ args, name: "note" }) ? { note: flagText({ args, name: "note" }) } : {}
|
|
85295
85535
|
}).then((started) => ({ ...started, url: url2, asked })).catch((error62) => sandboxed({ context, error: error62 }));
|
|
85296
|
-
if (!resumed) await keepPending({ context, pending });
|
|
85297
|
-
context.out(waitingText({ pending, resumed: !!resumed }));
|
|
85298
|
-
const outcome = await approvalOf({ context, args, client, pending });
|
|
85536
|
+
if (!resumed) await keepPending({ context, pending: pending2 });
|
|
85537
|
+
context.out(waitingText({ pending: pending2, resumed: !!resumed }));
|
|
85538
|
+
const outcome = await approvalOf({ context, args, client, pending: pending2 });
|
|
85299
85539
|
if (outcome.kind === "taken") {
|
|
85300
85540
|
context.out("This request already joined in another `laze join` run. Run `laze whoami`.\n");
|
|
85301
85541
|
return;
|
|
85302
85542
|
}
|
|
85303
85543
|
if (outcome.kind === "approved") {
|
|
85304
85544
|
const { linked } = outcome;
|
|
85305
|
-
const where = outcome.workspaceName ||
|
|
85545
|
+
const where = outcome.workspaceName || pending2.workspaceName || linked.agent.workspaceId;
|
|
85306
85546
|
context.out(`Joined ${where} as ${linked.agent.name}.
|
|
85307
85547
|
`);
|
|
85308
85548
|
return settleLinked({ context, args, url: url2, harness, pid, linked });
|
|
85309
85549
|
}
|
|
85310
85550
|
context.out(
|
|
85311
|
-
`Not approved yet. Run \`laze join\` again to keep waiting; the code works until ${
|
|
85551
|
+
`Not approved yet. Run \`laze join\` again to keep waiting; the code works until ${pending2.expiresAt}.
|
|
85312
85552
|
`
|
|
85313
85553
|
);
|
|
85314
85554
|
}
|
|
@@ -88232,8 +88472,8 @@ async function untilAllAnswered({
|
|
|
88232
88472
|
return "capped";
|
|
88233
88473
|
}
|
|
88234
88474
|
await context.sleep(POLL_MS);
|
|
88235
|
-
for (const [key,
|
|
88236
|
-
const next = await door.status(
|
|
88475
|
+
for (const [key, pending2] of waiting) {
|
|
88476
|
+
const next = await door.status(pending2.requestId);
|
|
88237
88477
|
if (next.outcome === "ask") waiting.set(key, next);
|
|
88238
88478
|
else {
|
|
88239
88479
|
waiting.delete(key);
|
|
@@ -88590,15 +88830,15 @@ async function vaultSaveFromMessage({
|
|
|
88590
88830
|
// src/services/vault-save-commands.service.ts
|
|
88591
88831
|
async function vaultSave({ context, args }) {
|
|
88592
88832
|
if (flagText({ args, name: "from-message" })) return vaultSaveFromMessage({ context, args });
|
|
88593
|
-
const
|
|
88833
|
+
const pending2 = args.words[2];
|
|
88594
88834
|
const name3 = flagText({ args, name: "name" });
|
|
88595
88835
|
const description = flagText({ args, name: "description" });
|
|
88596
|
-
if (!
|
|
88836
|
+
if (!pending2 || !name3 || !description) throw new CliUsageError(SAVE_USAGE);
|
|
88597
88837
|
const saved3 = await postInTurn({
|
|
88598
88838
|
context,
|
|
88599
88839
|
args,
|
|
88600
88840
|
path: "/api/vault/pending-secrets/save",
|
|
88601
|
-
body: { pending, name: name3, description }
|
|
88841
|
+
body: { pending: pending2, name: name3, description }
|
|
88602
88842
|
});
|
|
88603
88843
|
printSaved({ context, args, saved: saved3 });
|
|
88604
88844
|
}
|
|
@@ -89759,7 +89999,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
89759
89999
|
laze agent create --name <name> [--description <text>] [--harness laze-models|claude-code|codex] [--avatar <file>]
|
|
89760
90000
|
make an agent for your owner (or for you): personal, opened in their direct messages
|
|
89761
90001
|
--team makes a team agent; on Claude Code or Codex it needs --pool <pool>, a login pool to draw from
|
|
89762
|
-
laze agent update <agent
|
|
90002
|
+
laze agent update <agent>|--self [--name] [--description] [--avatar] [--model] [--effort] [--max-context] change an agent your owner owns, or yourself
|
|
89763
90003
|
laze agent archive <agent> remove an agent your owner owns; kept 30 days
|
|
89764
90004
|
laze agent archived removed agents you may restore, with the day each goes
|
|
89765
90005
|
laze agent restore|delete <agent> bring an archived agent back, or delete it for good now
|
package/package.json
CHANGED