@lazehq/cli 0.1.6 → 0.1.7
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 +1325 -458
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -8493,11 +8493,12 @@ var ConfigStore = class _ConfigStore {
|
|
|
8493
8493
|
async saveProfile({
|
|
8494
8494
|
name: name2,
|
|
8495
8495
|
profile,
|
|
8496
|
-
bindDirectory
|
|
8496
|
+
bindDirectory,
|
|
8497
|
+
onlyThere = false
|
|
8497
8498
|
}) {
|
|
8498
8499
|
const config2 = await this.read();
|
|
8499
8500
|
await this.write({
|
|
8500
|
-
current: bindDirectory
|
|
8501
|
+
current: bindDirectory && (onlyThere || config2.current) ? config2.current : name2,
|
|
8501
8502
|
profiles: { ...config2.profiles, [name2]: profile },
|
|
8502
8503
|
bindings: bindDirectory ? { ...config2.bindings, [resolve(bindDirectory)]: name2 } : config2.bindings
|
|
8503
8504
|
});
|
|
@@ -8603,7 +8604,7 @@ function flagText({
|
|
|
8603
8604
|
}
|
|
8604
8605
|
|
|
8605
8606
|
// src/rules/cli-version.rules.ts
|
|
8606
|
-
var STAMPED = "0.1.
|
|
8607
|
+
var STAMPED = "0.1.7";
|
|
8607
8608
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
8608
8609
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
8609
8610
|
}
|
|
@@ -31071,12 +31072,41 @@ var muteCardSchemaDefinition = external_exports.object({
|
|
|
31071
31072
|
/** Who unmuted, once settled: "Ivy unmuted Scout". */
|
|
31072
31073
|
outcome: external_exports.string().max(400).default("")
|
|
31073
31074
|
});
|
|
31075
|
+
var loginCardStateSchema = external_exports.enum(["out", "signed_out", "waiting", "resolved"]);
|
|
31076
|
+
var loginCardLoginSchemaDefinition = external_exports.object({
|
|
31077
|
+
id: idSchema4,
|
|
31078
|
+
name: external_exports.string().max(120),
|
|
31079
|
+
status: external_exports.enum(["ready", "limited", "signed_out"]),
|
|
31080
|
+
/** "session limit", "weekly limit": the window that ran out, for people. */
|
|
31081
|
+
window: external_exports.string().max(40).nullable(),
|
|
31082
|
+
until: external_exports.iso.datetime().nullable()
|
|
31083
|
+
});
|
|
31084
|
+
var loginCardSchemaDefinition = external_exports.object({
|
|
31085
|
+
type: external_exports.literal("login"),
|
|
31086
|
+
agentId: idSchema4,
|
|
31087
|
+
harness: external_exports.enum(["claude-code", "codex"]),
|
|
31088
|
+
state: loginCardStateSchema,
|
|
31089
|
+
/** The plain first line: "All of my Claude logins are out of usage." */
|
|
31090
|
+
line: external_exports.string().min(1).max(400),
|
|
31091
|
+
logins: external_exports.array(loginCardLoginSchemaDefinition).max(20),
|
|
31092
|
+
/** The soonest reset, when waiting gets the agent going again; null when none is known. */
|
|
31093
|
+
resumeAt: external_exports.iso.datetime().nullable(),
|
|
31094
|
+
/** Another login has room now, so "Use another login" can move the agent at once. */
|
|
31095
|
+
canSwitch: external_exports.boolean(),
|
|
31096
|
+
/** The signed-out login "Sign in again" opens; null when none is signed out. */
|
|
31097
|
+
signInLoginId: external_exports.string().nullable(),
|
|
31098
|
+
/** The agent draws from a login pool: sign in and add go to the pool's settings. */
|
|
31099
|
+
poolId: external_exports.string().nullable(),
|
|
31100
|
+
/** What happened, once settled: "Back on Personal. Sam switched me." */
|
|
31101
|
+
outcome: external_exports.string().max(400)
|
|
31102
|
+
});
|
|
31074
31103
|
var messageCardSchemaDefinition = external_exports.discriminatedUnion("type", [
|
|
31075
31104
|
attentionCardSchemaDefinition,
|
|
31076
31105
|
connectCardSchemaDefinition,
|
|
31077
31106
|
appCardSchemaDefinition,
|
|
31078
31107
|
computerCardSchemaDefinition,
|
|
31079
|
-
muteCardSchemaDefinition
|
|
31108
|
+
muteCardSchemaDefinition,
|
|
31109
|
+
loginCardSchemaDefinition
|
|
31080
31110
|
]);
|
|
31081
31111
|
var messageRefSchemaDefinition = external_exports.object({
|
|
31082
31112
|
/** `conversation` points at a conversation with the agent, by its channel. */
|
|
@@ -31188,7 +31218,7 @@ var directoryEntrySchemaDefinition = external_exports.object({
|
|
|
31188
31218
|
id: idSchema4,
|
|
31189
31219
|
name: external_exports.string(),
|
|
31190
31220
|
email: external_exports.string().nullable(),
|
|
31191
|
-
/** An agent out of usage
|
|
31221
|
+
/** An agent out of usage until then; null for people and agents that can work. */
|
|
31192
31222
|
limitedUntil: external_exports.iso.datetime().nullable().default(null),
|
|
31193
31223
|
/** An agent removed from the workspace, when and by whom; null while it is active. */
|
|
31194
31224
|
removedAt: external_exports.iso.datetime().nullable().default(null),
|
|
@@ -31271,6 +31301,8 @@ var createChannelInputSchemaDefinition = external_exports.object({
|
|
|
31271
31301
|
topic: external_exports.string().trim().max(250).default(""),
|
|
31272
31302
|
/** People added beside the creator. */
|
|
31273
31303
|
memberUserIds: external_exports.array(idSchema4).max(100).default([]),
|
|
31304
|
+
/** An agent creator's name, kept on its membership so notices name it. */
|
|
31305
|
+
creatorName: external_exports.string().trim().min(1).max(80).optional(),
|
|
31274
31306
|
/** Makes it a temporary channel that archives itself then, 1 hour to 30 days ahead. */
|
|
31275
31307
|
endsAt: external_exports.iso.datetime().optional()
|
|
31276
31308
|
});
|
|
@@ -31372,6 +31404,11 @@ var openAgentDirectInputSchemaDefinition = external_exports.object({
|
|
|
31372
31404
|
runsOutside: external_exports.boolean().optional()
|
|
31373
31405
|
})
|
|
31374
31406
|
});
|
|
31407
|
+
var agentChatMemberInputSchemaDefinition = external_exports.object({
|
|
31408
|
+
...openAgentDirectInputSchemaDefinition.shape,
|
|
31409
|
+
ownerUserId: idSchema4,
|
|
31410
|
+
userId: idSchema4
|
|
31411
|
+
});
|
|
31375
31412
|
var historyInputSchemaDefinition = external_exports.object({
|
|
31376
31413
|
workspaceId: workspaceIdSchema,
|
|
31377
31414
|
channelId: idSchema4,
|
|
@@ -31719,6 +31756,12 @@ var threadsInputSchemaDefinition = external_exports.object({
|
|
|
31719
31756
|
var threadsInputSchema = threadsInputSchemaDefinition;
|
|
31720
31757
|
var threadsUnreadSchemaDefinition = external_exports.object({ unread: external_exports.number().int().nonnegative() });
|
|
31721
31758
|
var threadsUnreadSchema = threadsUnreadSchemaDefinition;
|
|
31759
|
+
var workspaceUnreadSchemaDefinition = external_exports.object({
|
|
31760
|
+
workspaceId: workspaceIdSchema,
|
|
31761
|
+
unread: external_exports.number().int().nonnegative(),
|
|
31762
|
+
mentions: external_exports.number().int().nonnegative()
|
|
31763
|
+
});
|
|
31764
|
+
var workspaceUnreadSchema = workspaceUnreadSchemaDefinition;
|
|
31722
31765
|
var activityKindSchema = external_exports.enum(["mention", "thread_reply", "keyword", "reaction"]);
|
|
31723
31766
|
var activityItemSchemaDefinition = external_exports.object({
|
|
31724
31767
|
id: idSchema4,
|
|
@@ -31734,7 +31777,9 @@ var activityItemSchemaDefinition = external_exports.object({
|
|
|
31734
31777
|
emoji: external_exports.string().nullable(),
|
|
31735
31778
|
preview: external_exports.string(),
|
|
31736
31779
|
createdAt: external_exports.iso.datetime(),
|
|
31737
|
-
read: external_exports.boolean()
|
|
31780
|
+
read: external_exports.boolean(),
|
|
31781
|
+
/** The reader posted in the entry's thread, or in its conversation, after the entry. */
|
|
31782
|
+
answered: external_exports.boolean().default(false)
|
|
31738
31783
|
});
|
|
31739
31784
|
var activityPageSchemaDefinition = external_exports.object({
|
|
31740
31785
|
items: external_exports.array(activityItemSchemaDefinition),
|
|
@@ -31854,7 +31899,9 @@ var sidebarLayoutSchemaDefinition = external_exports.object({
|
|
|
31854
31899
|
placements: external_exports.record(idSchema4, idSchema4),
|
|
31855
31900
|
filters: external_exports.record(external_exports.string().min(1).max(200), sidebarFilterSchemaDefinition),
|
|
31856
31901
|
/** Starred conversations in the order starred; they leave their usual section. */
|
|
31857
|
-
starred: external_exports.array(idSchema4).max(SIDEBAR_STARRED_MAX)
|
|
31902
|
+
starred: external_exports.array(idSchema4).max(SIDEBAR_STARRED_MAX),
|
|
31903
|
+
/** Section keys the person folded; built-in keys or custom section ids. */
|
|
31904
|
+
folded: external_exports.array(external_exports.string().min(1).max(200)).max(200).optional()
|
|
31858
31905
|
});
|
|
31859
31906
|
var sidebarLayoutSchema = sidebarLayoutSchemaDefinition;
|
|
31860
31907
|
var editSidebarInputSchemaDefinition = external_exports.discriminatedUnion("op", [
|
|
@@ -31893,6 +31940,12 @@ var editSidebarInputSchemaDefinition = external_exports.discriminatedUnion("op",
|
|
|
31893
31940
|
op: external_exports.literal("star"),
|
|
31894
31941
|
channelId: idSchema4,
|
|
31895
31942
|
starred: external_exports.boolean()
|
|
31943
|
+
}),
|
|
31944
|
+
external_exports.object({
|
|
31945
|
+
workspaceId: workspaceIdSchema,
|
|
31946
|
+
op: external_exports.literal("fold"),
|
|
31947
|
+
sectionKey: external_exports.string().min(1).max(200),
|
|
31948
|
+
folded: external_exports.boolean()
|
|
31896
31949
|
})
|
|
31897
31950
|
]);
|
|
31898
31951
|
var editSidebarInputSchema = editSidebarInputSchemaDefinition;
|
|
@@ -31920,7 +31973,7 @@ var readableTextInputSchemaDefinition = external_exports.object({
|
|
|
31920
31973
|
bodies: external_exports.array(external_exports.string()).max(HISTORY_PAGE_MAX)
|
|
31921
31974
|
});
|
|
31922
31975
|
var ChatApi = moduleApi()("chat");
|
|
31923
|
-
var chatConversationsTrpc = defineTrpcContract("chat").query("overview").withInput(workspaceInputSchema).withOutput(chatOverviewSchema).query("browse").withInput(workspaceInputSchema).withOutput(external_exports.array(browsableChannelSchema)).mutation("createChannel").withInput(createChannelInputSchema).withOutput(conversationSchema).mutation("join").withInput(channelInputSchema).withOutput(conversationSchema).mutation("leave").withInput(channelInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("updateChannel").withInput(updateChannelInputSchema).withOutput(conversationSchema).mutation("archiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("unarchiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("addMembers").withInput(addMembersInputSchema).withOutput(conversationSchema).mutation("removeMember").withInput(removeMemberInputSchema).withOutput(conversationSchema).mutation("openDirect").withInput(openDirectInputSchema).withOutput(conversationSchema).query("conversation").withInput(channelInputSchema).withOutput(conversationSchema).build();
|
|
31976
|
+
var chatConversationsTrpc = defineTrpcContract("chat").query("overview").withInput(workspaceInputSchema).withOutput(chatOverviewSchema).query("unreadSummary").withInput(external_exports.object({})).withOutput(external_exports.array(workspaceUnreadSchema)).query("browse").withInput(workspaceInputSchema).withOutput(external_exports.array(browsableChannelSchema)).mutation("createChannel").withInput(createChannelInputSchema).withOutput(conversationSchema).mutation("join").withInput(channelInputSchema).withOutput(conversationSchema).mutation("leave").withInput(channelInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("updateChannel").withInput(updateChannelInputSchema).withOutput(conversationSchema).mutation("archiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("unarchiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("addMembers").withInput(addMembersInputSchema).withOutput(conversationSchema).mutation("removeMember").withInput(removeMemberInputSchema).withOutput(conversationSchema).mutation("openDirect").withInput(openDirectInputSchema).withOutput(conversationSchema).query("conversation").withInput(channelInputSchema).withOutput(conversationSchema).build();
|
|
31924
31977
|
var chatChannelRolesTrpc = defineTrpcContract("chat").mutation("setChannelRole").withInput(setChannelRoleInputSchema).withOutput(conversationSchema).mutation("extendChannel").withInput(extendChannelInputSchema).withOutput(conversationSchema).build();
|
|
31925
31978
|
var chatMessagesTrpc = defineTrpcContract("chat").query("history").withInput(historyInputSchema).withOutput(historyPageSchema).query("thread").withInput(messageInputSchema).withOutput(threadSchema).mutation("post").withInput(postMessageInputSchema).withOutput(messageSchema).mutation("addMentioned").withInput(addMentionedInputSchema).withOutput(messageSchema).mutation("edit").withInput(editMessageInputSchema).withOutput(messageSchema).mutation("delete").withInput(messageInputSchema).withOutput(messageSchema).mutation("remove").withInput(messageInputSchema).withOutput(messageSchema).mutation("react").withInput(reactInputSchema).withOutput(messageSchema).mutation("signalTyping").withInput(signalTypingInputSchema).withOutput(external_exports.object({ sent: external_exports.literal(true) })).mutation("markRead").withInput(markReadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).mutation("markUnread").withInput(markUnreadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).query("search").withInput(searchInputSchema).withOutput(searchResultSchema).build();
|
|
31926
31979
|
var chatFilesTrpc = defineTrpcContract("chat").mutation("startUpload").withInput(startUploadInputSchema).withOutput(uploadTicketSchema).mutation("completeUpload").withInput(completeUploadInputSchema).withOutput(attachmentSchema).mutation("abortUpload").withInput(fileInputSchema).withOutput(external_exports.object({ aborted: external_exports.literal(true) })).query("fileLink").withInput(fileLinkInputSchema).withOutput(fileLinkSchema).query("channelFiles").withInput(channelFilesInputSchema).withOutput(channelFilesSchema).mutation("renameAttachment").withInput(renameAttachmentInputSchema).withOutput(attachmentSchema).mutation("hideUnfurl").withInput(hideUnfurlInputSchema).withOutput(messageSchema).query("unfurlImage").withInput(hideUnfurlInputSchema).withOutput(fileLinkSchema).build();
|
|
@@ -31940,6 +31993,53 @@ var chatTrpc = joinTrpcContracts(
|
|
|
31940
31993
|
chatPresenceTrpc
|
|
31941
31994
|
);
|
|
31942
31995
|
|
|
31996
|
+
// ../../modules/notification/contract/src/apns.ts
|
|
31997
|
+
var APNS_DEFAULT_BUNDLE_ID = "ai.langwatch.laze";
|
|
31998
|
+
var APNS_APPROVAL_CATEGORY = "LAZE_APPROVAL";
|
|
31999
|
+
var apnsEnvironmentSchema = external_exports.enum(["sandbox", "production"]);
|
|
32000
|
+
var apnsTokenSchema = external_exports.string().regex(/^[0-9a-fA-F]{64,200}$/, "an APNs device token is 64 to 200 hex characters").transform((token2) => token2.toLowerCase());
|
|
32001
|
+
var installIdSchema = external_exports.string().regex(/^[A-Za-z0-9_-]{8,128}$/, "an install id is 8 to 128 letters, digits, - or _");
|
|
32002
|
+
var bundleIdSchema = external_exports.string().regex(/^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)+$/, "a bundle id such as ai.langwatch.laze").max(155);
|
|
32003
|
+
var registerApnsDeviceInputSchemaDefinition = external_exports.object({
|
|
32004
|
+
workspaceId: external_exports.string().min(1),
|
|
32005
|
+
installId: installIdSchema,
|
|
32006
|
+
token: apnsTokenSchema,
|
|
32007
|
+
environment: apnsEnvironmentSchema,
|
|
32008
|
+
bundleId: bundleIdSchema
|
|
32009
|
+
}).strict();
|
|
32010
|
+
var registerApnsDeviceInputSchema = registerApnsDeviceInputSchemaDefinition;
|
|
32011
|
+
var unregisterApnsDeviceInputSchemaDefinition = external_exports.object({ workspaceId: external_exports.string().min(1), installId: installIdSchema }).strict();
|
|
32012
|
+
var unregisterApnsDeviceInputSchema = unregisterApnsDeviceInputSchemaDefinition;
|
|
32013
|
+
var apnsDeviceSchemaDefinition = external_exports.object({
|
|
32014
|
+
id: external_exports.string().min(1),
|
|
32015
|
+
tenantId: external_exports.string().min(1),
|
|
32016
|
+
userId: external_exports.string().min(1),
|
|
32017
|
+
installId: external_exports.string().min(1),
|
|
32018
|
+
token: external_exports.string().min(1),
|
|
32019
|
+
environment: apnsEnvironmentSchema,
|
|
32020
|
+
bundleId: external_exports.string().min(1),
|
|
32021
|
+
createdAt: external_exports.date(),
|
|
32022
|
+
lastSuccessAt: external_exports.date().nullable()
|
|
32023
|
+
}).strict();
|
|
32024
|
+
var apnsStatusSchemaDefinition = external_exports.object({ available: external_exports.boolean(), bundleId: external_exports.string().min(1) }).strict();
|
|
32025
|
+
var apnsStatusSchema = apnsStatusSchemaDefinition;
|
|
32026
|
+
var apnsPayloadSchemaDefinition = external_exports.object({
|
|
32027
|
+
aps: external_exports.object({
|
|
32028
|
+
alert: external_exports.object({ title: external_exports.string().min(1).max(120), body: external_exports.string().max(400) }).optional(),
|
|
32029
|
+
badge: external_exports.number().int().nonnegative().optional(),
|
|
32030
|
+
sound: external_exports.literal("default").optional(),
|
|
32031
|
+
"thread-id": external_exports.string().min(1).max(200).optional(),
|
|
32032
|
+
category: external_exports.literal(APNS_APPROVAL_CATEGORY).optional(),
|
|
32033
|
+
"interruption-level": external_exports.enum(["active", "time-sensitive"]).optional(),
|
|
32034
|
+
"content-available": external_exports.literal(1).optional()
|
|
32035
|
+
}).strict(),
|
|
32036
|
+
workspaceId: external_exports.string().min(1),
|
|
32037
|
+
link: external_exports.string().startsWith("laze://").max(2048).optional(),
|
|
32038
|
+
/** The message's place in its conversation, so a later clear can match it. */
|
|
32039
|
+
seq: external_exports.number().int().nonnegative().optional(),
|
|
32040
|
+
clear: external_exports.object({ threadId: external_exports.string().min(1).max(200), upToSeq: external_exports.number().int().nonnegative() }).strict().optional()
|
|
32041
|
+
}).strict();
|
|
32042
|
+
|
|
31943
32043
|
// ../../modules/notification/contract/src/web-push.ts
|
|
31944
32044
|
var WEB_PUSH_TITLE_MAX = 120;
|
|
31945
32045
|
var WEB_PUSH_BODY_MAX = 400;
|
|
@@ -32137,7 +32237,9 @@ var feedNoticeSchema = external_exports.object({
|
|
|
32137
32237
|
body: external_exports.string().max(400),
|
|
32138
32238
|
/** The feed page, opened on the item or the brief. */
|
|
32139
32239
|
path: external_exports.string().startsWith("/").max(1024),
|
|
32140
|
-
urgent: external_exports.boolean().default(false)
|
|
32240
|
+
urgent: external_exports.boolean().default(false),
|
|
32241
|
+
/** The feed event behind the push: each new event pushes, a retried one does not. */
|
|
32242
|
+
eventId: external_exports.string().min(1).max(200).optional()
|
|
32141
32243
|
});
|
|
32142
32244
|
var notifyInputSchemaDefinition = external_exports.discriminatedUnion("kind", [
|
|
32143
32245
|
messageNoticeSchema,
|
|
@@ -32187,7 +32289,7 @@ var notificationTrpc = defineTrpcContract("notification").query("settings").with
|
|
|
32187
32289
|
subscription: webPushSubscriptionInputSchema,
|
|
32188
32290
|
userAgent: external_exports.string().max(512).nullable().optional()
|
|
32189
32291
|
})
|
|
32190
|
-
).withOutput(external_exports.object({ subscribed: external_exports.literal(true) })).mutation("unsubscribeWebPush").withInput(external_exports.object({ workspaceId: workspaceIdSchema2, endpoint: external_exports.string().min(1).max(2048) })).withOutput(external_exports.object({ unsubscribed: external_exports.literal(true) })).build();
|
|
32292
|
+
).withOutput(external_exports.object({ subscribed: external_exports.literal(true) })).mutation("unsubscribeWebPush").withInput(external_exports.object({ workspaceId: workspaceIdSchema2, endpoint: external_exports.string().min(1).max(2048) })).withOutput(external_exports.object({ unsubscribed: external_exports.literal(true) })).query("apnsStatus").withInput(workspaceInputSchema2).withOutput(apnsStatusSchema).mutation("registerApnsDevice").withInput(registerApnsDeviceInputSchema).withOutput(external_exports.object({ registered: external_exports.literal(true) })).mutation("unregisterApnsDevice").withInput(unregisterApnsDeviceInputSchema).withOutput(external_exports.object({ unregistered: external_exports.literal(true) })).build();
|
|
32191
32293
|
|
|
32192
32294
|
// ../../packages/config/src/config.ts
|
|
32193
32295
|
var ConfigLeaf = class {
|
|
@@ -32399,6 +32501,19 @@ var notificationConfig = Config.define((c) => ({
|
|
|
32399
32501
|
publicBaseUrl,
|
|
32400
32502
|
/** A dev push service accepted beside the browsers' own, such as a local stand-in. */
|
|
32401
32503
|
webPushServiceBase: c.env("WEB_PUSH_SERVICE_BASE", external_exports.string().optional()),
|
|
32504
|
+
/** The APNs auth key's id and the Apple team; with APNS_KEY_P8 they turn iPhone push on. */
|
|
32505
|
+
apnsKeyId: c.env(
|
|
32506
|
+
"APNS_KEY_ID",
|
|
32507
|
+
external_exports.string().regex(/^[A-Z0-9]{10}$/).optional()
|
|
32508
|
+
),
|
|
32509
|
+
apnsTeamId: c.env(
|
|
32510
|
+
"APNS_TEAM_ID",
|
|
32511
|
+
external_exports.string().regex(/^[A-Z0-9]{10}$/).optional()
|
|
32512
|
+
),
|
|
32513
|
+
/** The iPhone app's bundle id, the topic of every push. */
|
|
32514
|
+
apnsBundleId: c.env("APNS_BUNDLE_ID", external_exports.string().min(3).default(APNS_DEFAULT_BUNDLE_ID)),
|
|
32515
|
+
/** host[:port] for both APNs environments instead of Apple's, such as a test stand-in. */
|
|
32516
|
+
apnsHost: c.env("APNS_HOST", external_exports.string().min(1).optional()),
|
|
32402
32517
|
/** A person seen this recently is around: pushes still go, the away email waits. */
|
|
32403
32518
|
presenceWindowSeconds: c.env(
|
|
32404
32519
|
"NOTIFICATION_PRESENCE_SECONDS",
|
|
@@ -32622,6 +32737,13 @@ var realtimePublicationSchemaDefinition = external_exports.discriminatedUnion("t
|
|
|
32622
32737
|
}),
|
|
32623
32738
|
/** The writer's own draft changed on another device or was sent; empty text means cleared. */
|
|
32624
32739
|
external_exports.object({ type: external_exports.literal("draft_changed"), workspaceId: external_exports.string(), draft: draftSchema }),
|
|
32740
|
+
/** A vault approval card was asked or settled: the approver's Approvals list reads again. */
|
|
32741
|
+
external_exports.object({
|
|
32742
|
+
type: external_exports.literal("vault_approval_changed"),
|
|
32743
|
+
workspaceId: external_exports.string(),
|
|
32744
|
+
approvalId: external_exports.string(),
|
|
32745
|
+
state: external_exports.enum(["pending", "approved_once", "approved_for_agent", "denied", "expired"])
|
|
32746
|
+
}),
|
|
32625
32747
|
/** Notification's desktop publication, relayed: a native notification and the badge. */
|
|
32626
32748
|
desktopPublicationSchema
|
|
32627
32749
|
]);
|
|
@@ -32709,7 +32831,12 @@ var harnessQuestionSchemaDefinition = external_exports.object({
|
|
|
32709
32831
|
/** Whether a typed answer is accepted besides the options. */
|
|
32710
32832
|
allowOther: external_exports.boolean().default(true)
|
|
32711
32833
|
});
|
|
32712
|
-
var attentionClosedReasonSchema = external_exports.enum([
|
|
32834
|
+
var attentionClosedReasonSchema = external_exports.enum([
|
|
32835
|
+
"cancelled",
|
|
32836
|
+
"interrupted",
|
|
32837
|
+
"turn_ended",
|
|
32838
|
+
"answered_earlier"
|
|
32839
|
+
]);
|
|
32713
32840
|
var permissionDecisionSchema2 = external_exports.enum(["allowed", "skipped"]);
|
|
32714
32841
|
var permissionSkipReasonSchema = external_exports.enum(["question", "plan", "plan_mode"]);
|
|
32715
32842
|
var lazeAgentEventSchemaDefinition = external_exports.discriminatedUnion("type", [
|
|
@@ -33141,6 +33268,12 @@ var hostFrameSchemaDefinition = external_exports.discriminatedUnion("type", [
|
|
|
33141
33268
|
channelId: external_exports.string().min(1),
|
|
33142
33269
|
frameId: external_exports.string().min(1).optional()
|
|
33143
33270
|
}),
|
|
33271
|
+
/** Stops the running turn and retires the session; the next message starts a fresh one. */
|
|
33272
|
+
external_exports.object({
|
|
33273
|
+
type: external_exports.literal("reset"),
|
|
33274
|
+
channelId: external_exports.string().min(1),
|
|
33275
|
+
frameId: external_exports.string().min(1).optional()
|
|
33276
|
+
}),
|
|
33144
33277
|
external_exports.object({
|
|
33145
33278
|
type: external_exports.literal("attention_answer"),
|
|
33146
33279
|
channelId: external_exports.string().min(1),
|
|
@@ -33368,7 +33501,16 @@ var agentRuntimeConfig = Config.define((c) => ({
|
|
|
33368
33501
|
positive.default(20)
|
|
33369
33502
|
),
|
|
33370
33503
|
/** The progress board's alerts folder; unset, a full host is only logged. */
|
|
33371
|
-
computerAlertDir: c.env("AGENT_RUNTIME_COMPUTER_ALERT_DIR", external_exports.string().min(1).optional())
|
|
33504
|
+
computerAlertDir: c.env("AGENT_RUNTIME_COMPUTER_ALERT_DIR", external_exports.string().min(1).optional()),
|
|
33505
|
+
/** Staff get a POST here once per capacity incident; unset, only the board alert. */
|
|
33506
|
+
opsWebhookUrl: c.env("AGENT_RUNTIME_OPS_WEBHOOK_URL", external_exports.url().optional()),
|
|
33507
|
+
/** How often the worker asks each host's vmd for its report. */
|
|
33508
|
+
computerHostProbeSeconds: c.env(
|
|
33509
|
+
"AGENT_RUNTIME_COMPUTER_HOST_PROBE_SECONDS",
|
|
33510
|
+
positive.default(60)
|
|
33511
|
+
),
|
|
33512
|
+
/** How long a wake waits for its computer's move before it fails with computer_moving. */
|
|
33513
|
+
computerMoveWaitSeconds: c.env("AGENT_RUNTIME_COMPUTER_MOVE_WAIT_SECONDS", positive.default(600))
|
|
33372
33514
|
}));
|
|
33373
33515
|
|
|
33374
33516
|
// ../../modules/agent-runtime/contract/src/computer-guard.ts
|
|
@@ -33394,6 +33536,127 @@ var computerNoteDefinition = external_exports.object({
|
|
|
33394
33536
|
text: external_exports.string().min(1).max(500)
|
|
33395
33537
|
});
|
|
33396
33538
|
|
|
33539
|
+
// ../../modules/agent-runtime/contract/src/computer-pool.ts
|
|
33540
|
+
var computerHostStateSchema = external_exports.enum(["active", "cordoned", "draining"]);
|
|
33541
|
+
var computerHostCapacityDefinition = external_exports.object({
|
|
33542
|
+
vcpus: external_exports.number().positive(),
|
|
33543
|
+
memoryMb: external_exports.number().int().positive(),
|
|
33544
|
+
diskGb: external_exports.number().int().positive(),
|
|
33545
|
+
overcommit: external_exports.number().positive(),
|
|
33546
|
+
diskOvercommit: external_exports.number().positive()
|
|
33547
|
+
});
|
|
33548
|
+
var hostIdSchema = external_exports.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/, "a host name is 1 to 32 of a-z, 0-9 and -");
|
|
33549
|
+
var addComputerHostInputDefinition = external_exports.object({
|
|
33550
|
+
hostId: hostIdSchema,
|
|
33551
|
+
vmdUrl: external_exports.string().regex(/^(unix:\/|http:\/\/)/, "vmd is unix:<socket> or http://host:port"),
|
|
33552
|
+
poolAddress: external_exports.string().nullable(),
|
|
33553
|
+
bridgeCidr: external_exports.string().min(1),
|
|
33554
|
+
...computerHostCapacityDefinition.shape
|
|
33555
|
+
});
|
|
33556
|
+
var computerHostViewDefinition = external_exports.object({
|
|
33557
|
+
...addComputerHostInputDefinition.shape,
|
|
33558
|
+
state: computerHostStateSchema,
|
|
33559
|
+
healthy: external_exports.boolean(),
|
|
33560
|
+
reportedAt: external_exports.string().nullable(),
|
|
33561
|
+
reservedMemoryMb: external_exports.number(),
|
|
33562
|
+
reservedCpus: external_exports.number(),
|
|
33563
|
+
reservedDiskGb: external_exports.number(),
|
|
33564
|
+
computers: external_exports.number().int(),
|
|
33565
|
+
runningMemoryMb: external_exports.number().nullable(),
|
|
33566
|
+
diskFreeGb: external_exports.number().nullable()
|
|
33567
|
+
});
|
|
33568
|
+
var computerResizeOutcomeSchema = external_exports.enum(["in_place", "moving", "stored"]);
|
|
33569
|
+
var sizeShape = {
|
|
33570
|
+
memoryMb: external_exports.number().int().positive(),
|
|
33571
|
+
cpus: external_exports.number().positive(),
|
|
33572
|
+
diskGb: external_exports.number().int().positive()
|
|
33573
|
+
};
|
|
33574
|
+
var computerPoolFactDefinition = external_exports.discriminatedUnion("kind", [
|
|
33575
|
+
external_exports.object({
|
|
33576
|
+
kind: external_exports.literal("host_registered"),
|
|
33577
|
+
hostId: external_exports.string(),
|
|
33578
|
+
vmdUrl: external_exports.string(),
|
|
33579
|
+
...computerHostCapacityDefinition.shape
|
|
33580
|
+
}),
|
|
33581
|
+
external_exports.object({
|
|
33582
|
+
kind: external_exports.literal("host_state_changed"),
|
|
33583
|
+
hostId: external_exports.string(),
|
|
33584
|
+
state: computerHostStateSchema
|
|
33585
|
+
}),
|
|
33586
|
+
external_exports.object({ kind: external_exports.literal("host_health_changed"), hostId: external_exports.string(), healthy: external_exports.boolean() }),
|
|
33587
|
+
external_exports.object({ kind: external_exports.literal("host_removed"), hostId: external_exports.string() }),
|
|
33588
|
+
external_exports.object({
|
|
33589
|
+
kind: external_exports.literal("placed"),
|
|
33590
|
+
computerId: external_exports.string(),
|
|
33591
|
+
workspaceId: external_exports.string(),
|
|
33592
|
+
hostId: external_exports.string(),
|
|
33593
|
+
reason: external_exports.enum(["new", "adopted"]),
|
|
33594
|
+
...sizeShape
|
|
33595
|
+
}),
|
|
33596
|
+
external_exports.object({
|
|
33597
|
+
kind: external_exports.literal("unplaced"),
|
|
33598
|
+
computerId: external_exports.string(),
|
|
33599
|
+
workspaceId: external_exports.string(),
|
|
33600
|
+
hostId: external_exports.string()
|
|
33601
|
+
}),
|
|
33602
|
+
external_exports.object({
|
|
33603
|
+
kind: external_exports.literal("resized"),
|
|
33604
|
+
computerId: external_exports.string(),
|
|
33605
|
+
workspaceId: external_exports.string(),
|
|
33606
|
+
hostId: external_exports.string(),
|
|
33607
|
+
...sizeShape
|
|
33608
|
+
}),
|
|
33609
|
+
external_exports.object({
|
|
33610
|
+
kind: external_exports.literal("move_started"),
|
|
33611
|
+
moveId: external_exports.string(),
|
|
33612
|
+
computerId: external_exports.string(),
|
|
33613
|
+
workspaceId: external_exports.string(),
|
|
33614
|
+
fromHostId: external_exports.string(),
|
|
33615
|
+
toHostId: external_exports.string(),
|
|
33616
|
+
...sizeShape
|
|
33617
|
+
}),
|
|
33618
|
+
external_exports.object({
|
|
33619
|
+
kind: external_exports.literal("moved"),
|
|
33620
|
+
moveId: external_exports.string(),
|
|
33621
|
+
computerId: external_exports.string(),
|
|
33622
|
+
workspaceId: external_exports.string(),
|
|
33623
|
+
fromHostId: external_exports.string(),
|
|
33624
|
+
toHostId: external_exports.string()
|
|
33625
|
+
}),
|
|
33626
|
+
external_exports.object({
|
|
33627
|
+
kind: external_exports.literal("move_failed"),
|
|
33628
|
+
moveId: external_exports.string(),
|
|
33629
|
+
computerId: external_exports.string(),
|
|
33630
|
+
workspaceId: external_exports.string(),
|
|
33631
|
+
fromHostId: external_exports.string(),
|
|
33632
|
+
toHostId: external_exports.string(),
|
|
33633
|
+
reason: external_exports.string()
|
|
33634
|
+
}),
|
|
33635
|
+
external_exports.object({
|
|
33636
|
+
kind: external_exports.literal("pool_exhausted"),
|
|
33637
|
+
incidentId: external_exports.string(),
|
|
33638
|
+
computerId: external_exports.string(),
|
|
33639
|
+
wantedMemoryMb: external_exports.number(),
|
|
33640
|
+
what: external_exports.enum(["create", "wake", "resize"])
|
|
33641
|
+
}),
|
|
33642
|
+
external_exports.object({ kind: external_exports.literal("pool_restored"), incidentId: external_exports.string(), refusals: external_exports.number() })
|
|
33643
|
+
]);
|
|
33644
|
+
var computerPoolFactRecordDefinition = external_exports.object({
|
|
33645
|
+
factId: external_exports.string().min(1),
|
|
33646
|
+
/** The stream: `host:<id>`, `computer:<id>` or `incidents`. */
|
|
33647
|
+
streamId: external_exports.string().min(1),
|
|
33648
|
+
fact: computerPoolFactDefinition,
|
|
33649
|
+
at: external_exports.iso.datetime()
|
|
33650
|
+
});
|
|
33651
|
+
var computerPoolWatchStateDefinition = external_exports.object({
|
|
33652
|
+
hostId: external_exports.string().nullable(),
|
|
33653
|
+
moveId: external_exports.string().nullable(),
|
|
33654
|
+
computerId: external_exports.string().nullable(),
|
|
33655
|
+
nextWakeAt: external_exports.number().nullable()
|
|
33656
|
+
});
|
|
33657
|
+
var computerHostProbeIntentSchemaDefinition = external_exports.object({ hostId: external_exports.string() });
|
|
33658
|
+
var computerMoveIntentSchemaDefinition = external_exports.object({ moveId: external_exports.string(), computerId: external_exports.string() });
|
|
33659
|
+
|
|
33397
33660
|
// ../../modules/agent/contract/src/agent-attention.ts
|
|
33398
33661
|
var workspaceIdSchema3 = external_exports.string().min(1);
|
|
33399
33662
|
var idSchema6 = external_exports.string().min(1).max(80);
|
|
@@ -33475,7 +33738,9 @@ var agentTurnStopRequestedPayloadSchemaDefinition = external_exports.object({
|
|
|
33475
33738
|
channelId: external_exports.string().min(1),
|
|
33476
33739
|
stopId: external_exports.string().min(1),
|
|
33477
33740
|
stoppedByUserId: external_exports.string().min(1),
|
|
33478
|
-
stoppedByName: external_exports.string().default("")
|
|
33741
|
+
stoppedByName: external_exports.string().default(""),
|
|
33742
|
+
/** A session reset: the turn stops and the harness starts a fresh session in the main thread. */
|
|
33743
|
+
freshSession: external_exports.boolean().optional()
|
|
33479
33744
|
});
|
|
33480
33745
|
var agentAttentionExpiryStateSchemaDefinition = external_exports.object({
|
|
33481
33746
|
workspaceId: external_exports.string(),
|
|
@@ -33786,6 +34051,7 @@ var vaultSealedApprovalSchemaDefinition = external_exports.object({
|
|
|
33786
34051
|
var vaultSealedApprovalSchema = vaultSealedApprovalSchemaDefinition;
|
|
33787
34052
|
var vaultUi = uiTokens("vault");
|
|
33788
34053
|
var VaultSealedApprovalSlot = vaultUi.component("sealedApproval");
|
|
34054
|
+
var VaultPasskeyStepSlot = vaultUi.component("passkeyStep");
|
|
33789
34055
|
var VaultNavSlot = vaultUi.component("nav");
|
|
33790
34056
|
var answerSealedApprovalInputSchemaDefinition = external_exports.object({
|
|
33791
34057
|
workspaceId: external_exports.string().min(1),
|
|
@@ -34148,7 +34414,9 @@ var openVaultTurnInputSchemaDefinition = external_exports.object({
|
|
|
34148
34414
|
/** The requester's messages in this conversation, oldest first: the judge's permission. */
|
|
34149
34415
|
requesterMessages: external_exports.array(external_exports.string()).default([]),
|
|
34150
34416
|
/** Everyone else's messages, oldest first: context for the judge, never permission. */
|
|
34151
|
-
otherMessages: external_exports.array(external_exports.object({ sender: external_exports.string().min(1), text: external_exports.string() })).default([])
|
|
34417
|
+
otherMessages: external_exports.array(external_exports.object({ sender: external_exports.string().min(1), text: external_exports.string() })).default([]),
|
|
34418
|
+
/** A shorter life than the deployment's turn TTL, for a token made for one command. */
|
|
34419
|
+
ttlMinutes: external_exports.number().int().positive().optional()
|
|
34152
34420
|
});
|
|
34153
34421
|
var vaultAlwaysApprovalActionSchema = external_exports.enum([
|
|
34154
34422
|
"send_external",
|
|
@@ -34263,7 +34531,11 @@ var vaultApprovalRequestSchemaDefinition = external_exports.object({
|
|
|
34263
34531
|
answeredAt: external_exports.iso.datetime().nullable(),
|
|
34264
34532
|
leaseExpiresAt: external_exports.iso.datetime().nullable(),
|
|
34265
34533
|
/** What the person who answered told the agent; empty when nothing. */
|
|
34266
|
-
resolutionNote: external_exports.string().default("")
|
|
34534
|
+
resolutionNote: external_exports.string().default(""),
|
|
34535
|
+
/** The connection's title, so an approver who cannot list it still knows what is asked. */
|
|
34536
|
+
connectionTitle: external_exports.string().nullable().default(null),
|
|
34537
|
+
/** The longest lease Allow for this agent offers; null offers only once and deny. */
|
|
34538
|
+
maxLeaseSeconds: external_exports.number().int().positive().nullable().default(null)
|
|
34267
34539
|
});
|
|
34268
34540
|
var vaultApprovalRequestSchema = vaultApprovalRequestSchemaDefinition;
|
|
34269
34541
|
var answerVaultApprovalInputSchemaDefinition = external_exports.object({
|
|
@@ -34556,7 +34828,9 @@ var vaultApprovalResolvedPayloadSchemaDefinition = external_exports.object({
|
|
|
34556
34828
|
/** The display name of who answered; empty for a timeout. */
|
|
34557
34829
|
answeredByName: external_exports.string().default(""),
|
|
34558
34830
|
/** A deny or a timeout: until when the same action is refused without a new card. */
|
|
34559
|
-
blockedUntil: external_exports.iso.datetime().nullable().default(null)
|
|
34831
|
+
blockedUntil: external_exports.iso.datetime().nullable().default(null),
|
|
34832
|
+
/** Who decides the card, so their open approvals lists refresh. */
|
|
34833
|
+
approverUserIds: external_exports.array(external_exports.string()).readonly().default([])
|
|
34560
34834
|
});
|
|
34561
34835
|
|
|
34562
34836
|
// ../../modules/vault/contract/src/vault-oauth.ts
|
|
@@ -34789,6 +35063,20 @@ var vaultConnectionSecretSetPayloadSchemaDefinition = external_exports.object({
|
|
|
34789
35063
|
byUserId: external_exports.string().min(1),
|
|
34790
35064
|
at: external_exports.iso.datetime()
|
|
34791
35065
|
});
|
|
35066
|
+
var vaultPasskeyWantedPayloadSchemaDefinition = external_exports.object({
|
|
35067
|
+
workspaceId: external_exports.string().min(1),
|
|
35068
|
+
/** The keychain's owner, whoever saved it: the person or an agent running as them. */
|
|
35069
|
+
userId: external_exports.string().min(1),
|
|
35070
|
+
/** The new connection's name, such as `posthog`. */
|
|
35071
|
+
connectionName: external_exports.string().min(1),
|
|
35072
|
+
at: external_exports.iso.datetime()
|
|
35073
|
+
});
|
|
35074
|
+
var vaultPasskeySetUpPayloadSchemaDefinition = external_exports.object({
|
|
35075
|
+
workspaceId: external_exports.string().min(1),
|
|
35076
|
+
userId: external_exports.string().min(1),
|
|
35077
|
+
deviceId: external_exports.string().min(1),
|
|
35078
|
+
at: external_exports.iso.datetime()
|
|
35079
|
+
});
|
|
34792
35080
|
|
|
34793
35081
|
// ../../modules/vault/contract/src/vault-reference-chip.ts
|
|
34794
35082
|
var VaultReferenceChipSlot = uiTokens("vault").component("referenceChip");
|
|
@@ -35316,6 +35604,7 @@ var connectorTrpc = defineTrpcContract("connector").query("listProviders").withI
|
|
|
35316
35604
|
).withOutput(mcpRegistryPageSchema).query("getGithubApp").withInput(workspaceInput2).withOutput(githubAppViewSchema).mutation("startGithubInstall").withInput(startGithubInstallInputSchema).withOutput(startedGithubInstallSchema).mutation("startCardConnect").withInput(startCardConnectInputSchema).withOutput(startedCardConnectSchema).build();
|
|
35317
35605
|
var connectorUi = uiTokens("connector");
|
|
35318
35606
|
var ConnectorNavSlot = connectorUi.component("nav");
|
|
35607
|
+
var ConnectorOpenclawConnectSlot = connectorUi.component("openclawConnect");
|
|
35319
35608
|
var ConnectorConnectCardSlot = connectorUi.component("connectCard");
|
|
35320
35609
|
|
|
35321
35610
|
// ../../modules/connector/contract/src/connector.config.ts
|
|
@@ -35638,10 +35927,82 @@ var unwatchGithubAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
35638
35927
|
});
|
|
35639
35928
|
var githubCallerQuerySchemaDefinition = external_exports.object({ agent: callerAgentSchema });
|
|
35640
35929
|
|
|
35641
|
-
// ../../modules/agent/contract/src/agent-
|
|
35930
|
+
// ../../modules/agent/contract/src/agent-lifecycle.ts
|
|
35642
35931
|
var workspaceIdSchema5 = external_exports.string().min(1);
|
|
35643
|
-
var idSchema9 = external_exports.string().min(1).max(
|
|
35932
|
+
var idSchema9 = external_exports.string().min(1).max(200);
|
|
35933
|
+
var agentRefSchema2 = external_exports.string().trim().min(1).max(80);
|
|
35934
|
+
var memberRefSchema = external_exports.string().trim().min(1).max(320);
|
|
35935
|
+
var transferAgentInputSchemaDefinition = external_exports.object({
|
|
35936
|
+
workspaceId: workspaceIdSchema5,
|
|
35937
|
+
agentId: idSchema9,
|
|
35938
|
+
/** The new owner: a member's user id, email or name. */
|
|
35939
|
+
to: memberRefSchema
|
|
35940
|
+
});
|
|
35941
|
+
var transferAgentInputSchema = transferAgentInputSchemaDefinition;
|
|
35942
|
+
var resetAgentSessionInputSchemaDefinition = external_exports.object({
|
|
35943
|
+
workspaceId: workspaceIdSchema5,
|
|
35944
|
+
agentId: idSchema9
|
|
35945
|
+
});
|
|
35946
|
+
var resetAgentSessionInputSchema = resetAgentSessionInputSchemaDefinition;
|
|
35947
|
+
var transferAgentAsCallerInputSchemaDefinition = external_exports.object({
|
|
35948
|
+
agent: agentRefSchema2,
|
|
35949
|
+
to: memberRefSchema
|
|
35950
|
+
});
|
|
35951
|
+
var resetAgentSessionAsCallerInputSchemaDefinition = external_exports.object({ agent: agentRefSchema2 });
|
|
35952
|
+
|
|
35953
|
+
// ../../modules/agent/contract/src/agent-login-trouble.ts
|
|
35954
|
+
var loginCardActionInputSchemaDefinition = external_exports.object({
|
|
35955
|
+
workspaceId: external_exports.string().min(1),
|
|
35956
|
+
channelId: external_exports.string().min(1).max(80),
|
|
35957
|
+
messageId: external_exports.string().min(1).max(80),
|
|
35958
|
+
/** The thread the card sits in; null when it is at the top of the conversation. */
|
|
35959
|
+
threadRootId: external_exports.string().min(1).max(80).nullable().default(null)
|
|
35960
|
+
});
|
|
35961
|
+
var loginCardActionInputSchema = loginCardActionInputSchemaDefinition;
|
|
35962
|
+
var resumeAfterLimitsInputSchemaDefinition = external_exports.object({
|
|
35963
|
+
workspaceId: external_exports.string().min(1),
|
|
35964
|
+
agentId: external_exports.string().min(1)
|
|
35965
|
+
});
|
|
35644
35966
|
var harnessSchema = external_exports.enum(["claude-code", "codex"]);
|
|
35967
|
+
var agentLoginSignedOutPayloadSchemaDefinition = external_exports.object({
|
|
35968
|
+
workspaceId: external_exports.string().min(1),
|
|
35969
|
+
connectionId: external_exports.string().min(1),
|
|
35970
|
+
loginName: external_exports.string().max(120),
|
|
35971
|
+
harness: harnessSchema,
|
|
35972
|
+
/** The pool the login is in; null for a person's own login. */
|
|
35973
|
+
poolId: external_exports.string().nullable(),
|
|
35974
|
+
poolName: external_exports.string().nullable(),
|
|
35975
|
+
/** Its owner, or the pool's managers. */
|
|
35976
|
+
recipientUserIds: external_exports.array(external_exports.string().min(1)),
|
|
35977
|
+
at: external_exports.iso.datetime()
|
|
35978
|
+
});
|
|
35979
|
+
var agentLoginRestoredPayloadSchemaDefinition = external_exports.object({
|
|
35980
|
+
workspaceId: external_exports.string().min(1),
|
|
35981
|
+
connectionId: external_exports.string().min(1),
|
|
35982
|
+
outcome: external_exports.enum(["signed_in", "removed"]),
|
|
35983
|
+
at: external_exports.iso.datetime()
|
|
35984
|
+
});
|
|
35985
|
+
var agentStuckOnLimitsPayloadSchemaDefinition = external_exports.object({
|
|
35986
|
+
workspaceId: external_exports.string().min(1),
|
|
35987
|
+
agentId: external_exports.string().min(1),
|
|
35988
|
+
agentName: external_exports.string().max(200),
|
|
35989
|
+
harness: harnessSchema,
|
|
35990
|
+
/** One wait: the soonest reset the agent resumes at. */
|
|
35991
|
+
until: external_exports.iso.datetime(),
|
|
35992
|
+
/** The owner and the people whose messages wait. */
|
|
35993
|
+
recipientUserIds: external_exports.array(external_exports.string().min(1)),
|
|
35994
|
+
at: external_exports.iso.datetime()
|
|
35995
|
+
});
|
|
35996
|
+
var agentLimitsClearedPayloadSchemaDefinition = external_exports.object({
|
|
35997
|
+
workspaceId: external_exports.string().min(1),
|
|
35998
|
+
agentId: external_exports.string().min(1),
|
|
35999
|
+
at: external_exports.iso.datetime()
|
|
36000
|
+
});
|
|
36001
|
+
|
|
36002
|
+
// ../../modules/agent/contract/src/agent-logins.ts
|
|
36003
|
+
var workspaceIdSchema6 = external_exports.string().min(1);
|
|
36004
|
+
var idSchema10 = external_exports.string().min(1).max(80);
|
|
36005
|
+
var harnessSchema2 = external_exports.enum(["claude-code", "codex"]);
|
|
35645
36006
|
var loginNameSchema = external_exports.string().max(200);
|
|
35646
36007
|
var secretSchema = external_exports.string().max(2e4);
|
|
35647
36008
|
var loginValueShape = {
|
|
@@ -35650,8 +36011,8 @@ var loginValueShape = {
|
|
|
35650
36011
|
};
|
|
35651
36012
|
var harnessLoginEntrySchemaDefinition = external_exports.object({
|
|
35652
36013
|
/** The vault connection id. */
|
|
35653
|
-
id:
|
|
35654
|
-
harness:
|
|
36014
|
+
id: idSchema10,
|
|
36015
|
+
harness: harnessSchema2,
|
|
35655
36016
|
name: external_exports.string(),
|
|
35656
36017
|
/** `invalid` once its provider refused the token; `out_of_usage` until `limitedUntil`. */
|
|
35657
36018
|
state: external_exports.enum(["ready", "out_of_usage", "invalid"]),
|
|
@@ -35672,39 +36033,45 @@ var harnessLoginListSchemaDefinition = external_exports.object({
|
|
|
35672
36033
|
});
|
|
35673
36034
|
var harnessLoginListSchema = harnessLoginListSchemaDefinition;
|
|
35674
36035
|
var addHarnessLoginInputSchemaDefinition = external_exports.object({
|
|
35675
|
-
workspaceId:
|
|
35676
|
-
harness:
|
|
36036
|
+
workspaceId: workspaceIdSchema6,
|
|
36037
|
+
harness: harnessSchema2,
|
|
35677
36038
|
name: loginNameSchema,
|
|
35678
36039
|
...loginValueShape
|
|
35679
36040
|
});
|
|
35680
36041
|
var addHarnessLoginInputSchema = addHarnessLoginInputSchemaDefinition;
|
|
35681
36042
|
var renameHarnessLoginInputSchemaDefinition = external_exports.object({
|
|
35682
|
-
workspaceId:
|
|
35683
|
-
loginId:
|
|
36043
|
+
workspaceId: workspaceIdSchema6,
|
|
36044
|
+
loginId: idSchema10,
|
|
35684
36045
|
name: loginNameSchema
|
|
35685
36046
|
});
|
|
35686
36047
|
var renameHarnessLoginInputSchema = renameHarnessLoginInputSchemaDefinition;
|
|
36048
|
+
var replaceHarnessLoginInputSchemaDefinition = external_exports.object({
|
|
36049
|
+
workspaceId: workspaceIdSchema6,
|
|
36050
|
+
loginId: idSchema10,
|
|
36051
|
+
secret: secretSchema
|
|
36052
|
+
});
|
|
36053
|
+
var replaceHarnessLoginInputSchema = replaceHarnessLoginInputSchemaDefinition;
|
|
35687
36054
|
var deleteHarnessLoginInputSchemaDefinition = external_exports.object({
|
|
35688
|
-
workspaceId:
|
|
35689
|
-
loginId:
|
|
36055
|
+
workspaceId: workspaceIdSchema6,
|
|
36056
|
+
loginId: idSchema10
|
|
35690
36057
|
});
|
|
35691
36058
|
var deleteHarnessLoginInputSchema = deleteHarnessLoginInputSchemaDefinition;
|
|
35692
36059
|
var loginPoolRoleSchema = external_exports.enum(["manager", "member"]);
|
|
35693
36060
|
var loginPoolSchemaDefinition = external_exports.object({
|
|
35694
|
-
id:
|
|
36061
|
+
id: idSchema10,
|
|
35695
36062
|
name: external_exports.string(),
|
|
35696
36063
|
/** The reader's role; null for an admin who is not in the pool. */
|
|
35697
36064
|
myRole: loginPoolRoleSchema.nullable(),
|
|
35698
|
-
createdByUserId:
|
|
36065
|
+
createdByUserId: idSchema10,
|
|
35699
36066
|
createdAt: external_exports.iso.datetime(),
|
|
35700
|
-
members: external_exports.array(external_exports.object({ userId:
|
|
35701
|
-
agents: external_exports.array(external_exports.object({ id:
|
|
36067
|
+
members: external_exports.array(external_exports.object({ userId: idSchema10, name: external_exports.string(), role: loginPoolRoleSchema })),
|
|
36068
|
+
agents: external_exports.array(external_exports.object({ id: idSchema10, name: external_exports.string(), harness: external_exports.string() })),
|
|
35702
36069
|
logins: external_exports.array(
|
|
35703
36070
|
external_exports.object({
|
|
35704
|
-
id:
|
|
36071
|
+
id: idSchema10,
|
|
35705
36072
|
name: external_exports.string(),
|
|
35706
|
-
harness:
|
|
35707
|
-
contributedByUserId:
|
|
36073
|
+
harness: harnessSchema2,
|
|
36074
|
+
contributedByUserId: idSchema10,
|
|
35708
36075
|
contributedByName: external_exports.string(),
|
|
35709
36076
|
/** Whether an agent runs on it now. */
|
|
35710
36077
|
inUse: external_exports.boolean(),
|
|
@@ -35721,54 +36088,54 @@ var loginPoolSchemaDefinition = external_exports.object({
|
|
|
35721
36088
|
var loginPoolsSchemaDefinition = external_exports.object({ pools: external_exports.array(loginPoolSchemaDefinition) });
|
|
35722
36089
|
var loginPoolsSchema = loginPoolsSchemaDefinition;
|
|
35723
36090
|
var createLoginPoolInputSchemaDefinition = external_exports.object({
|
|
35724
|
-
workspaceId:
|
|
36091
|
+
workspaceId: workspaceIdSchema6,
|
|
35725
36092
|
name: loginNameSchema
|
|
35726
36093
|
});
|
|
35727
36094
|
var createLoginPoolInputSchema = createLoginPoolInputSchemaDefinition;
|
|
35728
36095
|
var renameLoginPoolInputSchemaDefinition = external_exports.object({
|
|
35729
|
-
workspaceId:
|
|
36096
|
+
workspaceId: workspaceIdSchema6,
|
|
35730
36097
|
poolId: external_exports.string().min(1).max(200),
|
|
35731
36098
|
name: loginNameSchema
|
|
35732
36099
|
});
|
|
35733
36100
|
var renameLoginPoolInputSchema = renameLoginPoolInputSchemaDefinition;
|
|
35734
36101
|
var loginPoolRefInputSchemaDefinition = external_exports.object({
|
|
35735
|
-
workspaceId:
|
|
36102
|
+
workspaceId: workspaceIdSchema6,
|
|
35736
36103
|
poolId: external_exports.string().min(1).max(200)
|
|
35737
36104
|
});
|
|
35738
36105
|
var loginPoolRefInputSchema = loginPoolRefInputSchemaDefinition;
|
|
35739
36106
|
var addPoolLoginInputSchemaDefinition = external_exports.object({
|
|
35740
|
-
workspaceId:
|
|
36107
|
+
workspaceId: workspaceIdSchema6,
|
|
35741
36108
|
poolId: external_exports.string().min(1).max(200),
|
|
35742
|
-
harness:
|
|
36109
|
+
harness: harnessSchema2,
|
|
35743
36110
|
name: loginNameSchema,
|
|
35744
36111
|
...loginValueShape
|
|
35745
36112
|
});
|
|
35746
36113
|
var addPoolLoginInputSchema = addPoolLoginInputSchemaDefinition;
|
|
35747
36114
|
var removePoolLoginInputSchemaDefinition = external_exports.object({
|
|
35748
|
-
workspaceId:
|
|
36115
|
+
workspaceId: workspaceIdSchema6,
|
|
35749
36116
|
poolId: external_exports.string().min(1).max(200),
|
|
35750
|
-
loginId:
|
|
36117
|
+
loginId: idSchema10
|
|
35751
36118
|
});
|
|
35752
36119
|
var removePoolLoginInputSchema = removePoolLoginInputSchemaDefinition;
|
|
35753
36120
|
var memberRefShape = {
|
|
35754
|
-
userId:
|
|
36121
|
+
userId: idSchema10.optional(),
|
|
35755
36122
|
member: external_exports.string().trim().min(1).max(320).optional()
|
|
35756
36123
|
};
|
|
35757
36124
|
var setPoolMemberInputSchemaDefinition = external_exports.object({
|
|
35758
|
-
workspaceId:
|
|
36125
|
+
workspaceId: workspaceIdSchema6,
|
|
35759
36126
|
poolId: external_exports.string().min(1).max(200),
|
|
35760
36127
|
...memberRefShape,
|
|
35761
36128
|
role: loginPoolRoleSchema
|
|
35762
36129
|
});
|
|
35763
36130
|
var setPoolMemberInputSchema = setPoolMemberInputSchemaDefinition;
|
|
35764
36131
|
var removePoolMemberInputSchemaDefinition = external_exports.object({
|
|
35765
|
-
workspaceId:
|
|
36132
|
+
workspaceId: workspaceIdSchema6,
|
|
35766
36133
|
poolId: external_exports.string().min(1).max(200),
|
|
35767
36134
|
...memberRefShape
|
|
35768
36135
|
});
|
|
35769
36136
|
var removePoolMemberInputSchema = removePoolMemberInputSchemaDefinition;
|
|
35770
36137
|
var setAgentPoolInputSchemaDefinition = external_exports.object({
|
|
35771
|
-
workspaceId:
|
|
36138
|
+
workspaceId: workspaceIdSchema6,
|
|
35772
36139
|
/** The agent's id or, from the CLI, its name. */
|
|
35773
36140
|
agentId: external_exports.string().min(1).max(200),
|
|
35774
36141
|
poolId: external_exports.string().min(1).max(200).nullable()
|
|
@@ -35777,6 +36144,11 @@ var setAgentPoolInputSchema = setAgentPoolInputSchemaDefinition;
|
|
|
35777
36144
|
var addHarnessLoginAsCallerInputSchema = addHarnessLoginInputSchemaDefinition.omit({
|
|
35778
36145
|
workspaceId: true
|
|
35779
36146
|
});
|
|
36147
|
+
var replaceHarnessLoginAsCallerInputSchema = replaceHarnessLoginInputSchemaDefinition.omit(
|
|
36148
|
+
{
|
|
36149
|
+
workspaceId: true
|
|
36150
|
+
}
|
|
36151
|
+
);
|
|
35780
36152
|
var renameHarnessLoginAsCallerInputSchema = renameHarnessLoginInputSchemaDefinition.omit({
|
|
35781
36153
|
workspaceId: true
|
|
35782
36154
|
});
|
|
@@ -35814,7 +36186,7 @@ var removePoolMemberAsCallerInputSchema = removePoolMemberInputSchemaDefinition.
|
|
|
35814
36186
|
workspaceId: true
|
|
35815
36187
|
});
|
|
35816
36188
|
var checkLoginUsageInputSchemaDefinition = external_exports.object({
|
|
35817
|
-
workspaceId:
|
|
36189
|
+
workspaceId: workspaceIdSchema6,
|
|
35818
36190
|
/** A pool's id or name; without it, the caller's own logins. */
|
|
35819
36191
|
poolId: external_exports.string().min(1).max(200).optional()
|
|
35820
36192
|
});
|
|
@@ -35833,7 +36205,7 @@ var checkLoginUsageAsCallerInputSchema = checkLoginUsageInputSchemaDefinition.om
|
|
|
35833
36205
|
var hostedHarnessSchema = external_exports.enum(["laze-models", "claude-code", "codex"]);
|
|
35834
36206
|
var nameSchema = external_exports.string().trim().min(1).max(80);
|
|
35835
36207
|
var descriptionSchema = external_exports.string().max(2e4);
|
|
35836
|
-
var
|
|
36208
|
+
var agentRefSchema3 = external_exports.string().trim().min(1).max(80);
|
|
35837
36209
|
var createAgentAsCallerInputSchemaDefinition = external_exports.object({
|
|
35838
36210
|
name: nameSchema,
|
|
35839
36211
|
/** What the agent is for; it becomes the agent's instructions. */
|
|
@@ -35854,14 +36226,16 @@ var createdAgentSchemaDefinition = external_exports.object({
|
|
|
35854
36226
|
channelId: external_exports.string()
|
|
35855
36227
|
});
|
|
35856
36228
|
var updateAgentAsCallerInputSchemaDefinition = external_exports.object({
|
|
35857
|
-
agent:
|
|
36229
|
+
agent: agentRefSchema3,
|
|
35858
36230
|
name: nameSchema.optional(),
|
|
35859
36231
|
description: descriptionSchema.optional(),
|
|
35860
36232
|
avatar: agentAvatarInputSchema.optional(),
|
|
35861
36233
|
/** The context window of an agent Laze runs, in tokens, 100k to 1M. */
|
|
35862
|
-
contextWindow: contextWindowInputSchema.optional()
|
|
36234
|
+
contextWindow: contextWindowInputSchema.optional(),
|
|
36235
|
+
/** Pauses or resumes an agent Laze runs. */
|
|
36236
|
+
paused: external_exports.boolean().optional()
|
|
35863
36237
|
});
|
|
35864
|
-
var archiveAgentAsCallerInputSchemaDefinition = external_exports.object({ agent:
|
|
36238
|
+
var archiveAgentAsCallerInputSchemaDefinition = external_exports.object({ agent: agentRefSchema3 });
|
|
35865
36239
|
var uploadAvatarAsCallerInputSchemaDefinition = external_exports.object({
|
|
35866
36240
|
contentType: external_exports.string().min(1).max(100),
|
|
35867
36241
|
dataBase64: external_exports.string().min(1).max(Math.ceil(AGENT_AVATAR_PICK_MAX_BYTES * 4 / 3) + 8)
|
|
@@ -35870,8 +36244,8 @@ var uploadAvatarAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
35870
36244
|
// ../../modules/agent/contract/src/agent-oauth.ts
|
|
35871
36245
|
var OAUTH_CODE_TTL_SECONDS = 5 * 60;
|
|
35872
36246
|
var REMOTE_MCP_PATH = "/mcp";
|
|
35873
|
-
var
|
|
35874
|
-
var
|
|
36247
|
+
var workspaceIdSchema7 = external_exports.string().min(1);
|
|
36248
|
+
var idSchema11 = external_exports.string().min(1).max(80);
|
|
35875
36249
|
var oauthAuthorizeRequestSchemaDefinition = external_exports.object({
|
|
35876
36250
|
response_type: external_exports.string().max(40).optional(),
|
|
35877
36251
|
client_id: external_exports.string().min(1).max(4096),
|
|
@@ -35883,7 +36257,7 @@ var oauthAuthorizeRequestSchemaDefinition = external_exports.object({
|
|
|
35883
36257
|
scope: external_exports.string().max(400).optional()
|
|
35884
36258
|
});
|
|
35885
36259
|
var oauthRequestInputSchemaDefinition = external_exports.object({
|
|
35886
|
-
workspaceId:
|
|
36260
|
+
workspaceId: workspaceIdSchema7,
|
|
35887
36261
|
request: oauthAuthorizeRequestSchemaDefinition
|
|
35888
36262
|
});
|
|
35889
36263
|
var oauthRequestInputSchema = oauthRequestInputSchemaDefinition;
|
|
@@ -35892,16 +36266,16 @@ var oauthRequestViewSchemaDefinition = external_exports.object({
|
|
|
35892
36266
|
/** The host the browser returns to, such as `chatgpt.com`. */
|
|
35893
36267
|
redirectHost: external_exports.string(),
|
|
35894
36268
|
/** The person's connected agents of this client in the workspace, newest first. */
|
|
35895
|
-
reconnectable: external_exports.array(external_exports.object({ id:
|
|
36269
|
+
reconnectable: external_exports.array(external_exports.object({ id: idSchema11, name: external_exports.string() })),
|
|
35896
36270
|
defaultName: external_exports.string()
|
|
35897
36271
|
});
|
|
35898
36272
|
var oauthRequestViewSchema = oauthRequestViewSchemaDefinition;
|
|
35899
36273
|
var approveOAuthInputSchemaDefinition = external_exports.object({
|
|
35900
|
-
workspaceId:
|
|
36274
|
+
workspaceId: workspaceIdSchema7,
|
|
35901
36275
|
request: oauthAuthorizeRequestSchemaDefinition,
|
|
35902
36276
|
name: external_exports.string().trim().min(1).max(80),
|
|
35903
36277
|
/** One of the person's agents of this client to hand a new key, instead of a new agent. */
|
|
35904
|
-
reconnectAgentId:
|
|
36278
|
+
reconnectAgentId: idSchema11.optional()
|
|
35905
36279
|
});
|
|
35906
36280
|
var approveOAuthInputSchema = approveOAuthInputSchemaDefinition;
|
|
35907
36281
|
var oauthRedirectSchemaDefinition = external_exports.object({ redirectUrl: external_exports.string() });
|
|
@@ -35937,8 +36311,8 @@ var AGENT_LINK_TTL_SECONDS = 30 * 60;
|
|
|
35937
36311
|
var AGENT_JOIN_REQUEST_TTL_SECONDS = 24 * 60 * 60;
|
|
35938
36312
|
var AGENT_ONLINE_WINDOW_SECONDS = 5 * 60;
|
|
35939
36313
|
var INBOX_WAIT_MAX_SECONDS = 55;
|
|
35940
|
-
var
|
|
35941
|
-
var
|
|
36314
|
+
var workspaceIdSchema8 = external_exports.string().min(1);
|
|
36315
|
+
var idSchema12 = external_exports.string().min(1).max(80);
|
|
35942
36316
|
var agentHarnessSchema = external_exports.enum([
|
|
35943
36317
|
"claude-code",
|
|
35944
36318
|
"codex",
|
|
@@ -35968,22 +36342,22 @@ var agentContextSchemaDefinition = external_exports.object({
|
|
|
35968
36342
|
updatedAt: external_exports.iso.datetime().nullable()
|
|
35969
36343
|
});
|
|
35970
36344
|
var agentHostSchemaDefinition = external_exports.object({
|
|
35971
|
-
machineId:
|
|
36345
|
+
machineId: idSchema12,
|
|
35972
36346
|
whenOffline: external_exports.enum(["wait", "sandbox"])
|
|
35973
36347
|
});
|
|
35974
36348
|
var setAgentHostInputSchemaDefinition = external_exports.object({
|
|
35975
|
-
workspaceId:
|
|
35976
|
-
agentId:
|
|
36349
|
+
workspaceId: workspaceIdSchema8,
|
|
36350
|
+
agentId: idSchema12,
|
|
35977
36351
|
host: agentHostSchemaDefinition.nullable()
|
|
35978
36352
|
});
|
|
35979
36353
|
var agentSchemaDefinition = external_exports.object({
|
|
35980
|
-
id:
|
|
35981
|
-
workspaceId:
|
|
36354
|
+
id: idSchema12,
|
|
36355
|
+
workspaceId: workspaceIdSchema8,
|
|
35982
36356
|
name: external_exports.string(),
|
|
35983
36357
|
kind: external_exports.enum(["personal", "team"]),
|
|
35984
36358
|
hosting: agentHostingSchema,
|
|
35985
36359
|
harness: agentHarnessSchema,
|
|
35986
|
-
ownerUserId:
|
|
36360
|
+
ownerUserId: idSchema12,
|
|
35987
36361
|
status: external_exports.enum(["connected", "disconnected"]),
|
|
35988
36362
|
online: external_exports.boolean(),
|
|
35989
36363
|
lastSeenAt: external_exports.iso.datetime().nullable(),
|
|
@@ -35997,8 +36371,10 @@ var agentSchemaDefinition = external_exports.object({
|
|
|
35997
36371
|
contextWindow: external_exports.number().int().positive().nullable().default(null),
|
|
35998
36372
|
/** The GitHub identity a Laze agent works as; null when it has none. */
|
|
35999
36373
|
github: agentGithubSchema.nullable().default(null),
|
|
36000
|
-
/** Out of usage
|
|
36374
|
+
/** Out of usage (its login or its Laze models budget) until this time; null when it can work. */
|
|
36001
36375
|
limitedUntil: external_exports.iso.datetime().nullable().default(null),
|
|
36376
|
+
/** Paused by a person since this time: it does not wake until resumed; null when it runs. */
|
|
36377
|
+
pausedAt: external_exports.iso.datetime().nullable().default(null),
|
|
36002
36378
|
/** The owner's own machine the agent's turns run on; null for a Laze sandbox. */
|
|
36003
36379
|
host: agentHostSchemaDefinition.nullable().default(null),
|
|
36004
36380
|
/** The login pool a Claude Code or Codex agent draws from; null for its owner's own logins. */
|
|
@@ -36008,7 +36384,7 @@ var agentSchemaDefinition = external_exports.object({
|
|
|
36008
36384
|
});
|
|
36009
36385
|
var agentSchema = agentSchemaDefinition;
|
|
36010
36386
|
var agentChannelSchemaDefinition = external_exports.object({
|
|
36011
|
-
id:
|
|
36387
|
+
id: idSchema12,
|
|
36012
36388
|
name: external_exports.string(),
|
|
36013
36389
|
kind: external_exports.enum(["public", "private", "dm", "group", "chat"])
|
|
36014
36390
|
});
|
|
@@ -36023,22 +36399,22 @@ var agentNameSchema = external_exports.string().trim().min(1).max(80);
|
|
|
36023
36399
|
var instructionsSchema = external_exports.string().max(2e4);
|
|
36024
36400
|
var linkedAvatarSchema = external_exports.string().trim().max(16);
|
|
36025
36401
|
var createAgentInputSchemaDefinition = external_exports.object({
|
|
36026
|
-
workspaceId:
|
|
36402
|
+
workspaceId: workspaceIdSchema8,
|
|
36027
36403
|
name: agentNameSchema,
|
|
36028
36404
|
avatar: agentAvatarInputSchema.default(""),
|
|
36029
36405
|
harness: hostedHarnessSchema,
|
|
36030
36406
|
modelLevel: agentModelLevelSchema.optional(),
|
|
36031
36407
|
kind: external_exports.enum(["personal", "team"]).default("personal"),
|
|
36032
36408
|
instructions: instructionsSchema.default(""),
|
|
36033
|
-
channelIds: external_exports.array(
|
|
36409
|
+
channelIds: external_exports.array(idSchema12).max(50).default([]),
|
|
36034
36410
|
/** A Claude Code or Codex agent drawing from this login pool; a team one needs a pool. */
|
|
36035
36411
|
/** The pool's id or name. */
|
|
36036
36412
|
loginPoolId: external_exports.string().min(1).max(200).optional()
|
|
36037
36413
|
});
|
|
36038
36414
|
var createAgentInputSchema = createAgentInputSchemaDefinition;
|
|
36039
36415
|
var updateAgentInputSchemaDefinition = external_exports.object({
|
|
36040
|
-
workspaceId:
|
|
36041
|
-
agentId:
|
|
36416
|
+
workspaceId: workspaceIdSchema8,
|
|
36417
|
+
agentId: idSchema12,
|
|
36042
36418
|
name: agentNameSchema.optional(),
|
|
36043
36419
|
avatar: agentAvatarInputSchema.optional(),
|
|
36044
36420
|
modelLevel: agentModelLevelSchema.optional(),
|
|
@@ -36046,17 +36422,19 @@ var updateAgentInputSchemaDefinition = external_exports.object({
|
|
|
36046
36422
|
contextWindow: contextWindowInputSchema.optional(),
|
|
36047
36423
|
instructions: instructionsSchema.optional(),
|
|
36048
36424
|
/** The whole set: channels left out are left. */
|
|
36049
|
-
channelIds: external_exports.array(
|
|
36425
|
+
channelIds: external_exports.array(idSchema12).max(50).optional(),
|
|
36426
|
+
/** Agents Laze runs only: paused, it does not wake until resumed and its messages wait. */
|
|
36427
|
+
paused: external_exports.boolean().optional()
|
|
36050
36428
|
});
|
|
36051
36429
|
var updateAgentInputSchema = updateAgentInputSchemaDefinition;
|
|
36052
36430
|
var saveHarnessLoginInputSchemaDefinition = external_exports.object({
|
|
36053
|
-
workspaceId:
|
|
36431
|
+
workspaceId: workspaceIdSchema8,
|
|
36054
36432
|
harness: harnessLoginSchema,
|
|
36055
36433
|
secret: external_exports.string().trim().min(10).max(2e4)
|
|
36056
36434
|
});
|
|
36057
36435
|
var saveHarnessLoginInputSchema = saveHarnessLoginInputSchemaDefinition;
|
|
36058
36436
|
var removeHarnessLoginInputSchemaDefinition = external_exports.object({
|
|
36059
|
-
workspaceId:
|
|
36437
|
+
workspaceId: workspaceIdSchema8,
|
|
36060
36438
|
harness: harnessLoginSchema
|
|
36061
36439
|
});
|
|
36062
36440
|
var removeHarnessLoginInputSchema = removeHarnessLoginInputSchemaDefinition;
|
|
@@ -36066,11 +36444,13 @@ var harnessLoginsSchemaDefinition = external_exports.object({
|
|
|
36066
36444
|
});
|
|
36067
36445
|
var harnessLoginsSchema = harnessLoginsSchemaDefinition;
|
|
36068
36446
|
var mintLinkInputSchemaDefinition = external_exports.object({
|
|
36069
|
-
workspaceId:
|
|
36447
|
+
workspaceId: workspaceIdSchema8,
|
|
36070
36448
|
/** Left out, the agent names itself when it joins, else it takes its harness's name. */
|
|
36071
36449
|
name: external_exports.string().trim().max(80).optional(),
|
|
36072
36450
|
/** The channel the agent joins once linked. */
|
|
36073
|
-
channelId:
|
|
36451
|
+
channelId: idSchema12.optional(),
|
|
36452
|
+
/** One of the minting person's connected agents: redeeming gives it a new key instead. */
|
|
36453
|
+
reconnectAgentId: idSchema12.optional()
|
|
36074
36454
|
});
|
|
36075
36455
|
var mintLinkInputSchema = mintLinkInputSchemaDefinition;
|
|
36076
36456
|
var mintedLinkSchemaDefinition = external_exports.object({
|
|
@@ -36099,7 +36479,7 @@ var redeemedLinkSchemaDefinition = external_exports.object({
|
|
|
36099
36479
|
agent: agentSchemaDefinition,
|
|
36100
36480
|
/** The agent's own `lz_` key, shown once. */
|
|
36101
36481
|
apiKey: external_exports.string(),
|
|
36102
|
-
channelId:
|
|
36482
|
+
channelId: idSchema12.nullable()
|
|
36103
36483
|
});
|
|
36104
36484
|
var startJoinRequestInputSchemaDefinition = external_exports.object({
|
|
36105
36485
|
/** The name the agent picks; left out, it takes its harness's name. */
|
|
@@ -36107,7 +36487,11 @@ var startJoinRequestInputSchemaDefinition = external_exports.object({
|
|
|
36107
36487
|
harness: agentHarnessSchema.default("other"),
|
|
36108
36488
|
avatar: linkedAvatarSchema.default(""),
|
|
36109
36489
|
/** A line for the person who approves, such as what the agent is for. */
|
|
36110
|
-
note: external_exports.string().trim().max(300).default("")
|
|
36490
|
+
note: external_exports.string().trim().max(300).default(""),
|
|
36491
|
+
/** The workspace to ask: its name, id or an invite link. Its feed shows the request. */
|
|
36492
|
+
workspace: external_exports.string().trim().min(1).max(2e3).optional(),
|
|
36493
|
+
/** The person to ask; left out, the workspace's owners and admins decide. */
|
|
36494
|
+
forEmail: external_exports.string().trim().min(3).max(320).optional()
|
|
36111
36495
|
});
|
|
36112
36496
|
var startedJoinRequestSchemaDefinition = external_exports.object({
|
|
36113
36497
|
/** The code the person checks on the approval page, such as `BCDF-GHJK`. */
|
|
@@ -36117,20 +36501,27 @@ var startedJoinRequestSchemaDefinition = external_exports.object({
|
|
|
36117
36501
|
/** The page a person opens, signed in, to approve the agent once. */
|
|
36118
36502
|
approveUrl: external_exports.string(),
|
|
36119
36503
|
expiresAt: external_exports.iso.datetime(),
|
|
36120
|
-
intervalSeconds: external_exports.number().int().positive()
|
|
36504
|
+
intervalSeconds: external_exports.number().int().positive(),
|
|
36505
|
+
/** The workspace whose feed shows the request; null when only the code link asks. */
|
|
36506
|
+
workspaceName: external_exports.string().nullable().default(null)
|
|
36121
36507
|
});
|
|
36122
36508
|
var pollJoinRequestInputSchemaDefinition = external_exports.object({ requestToken: external_exports.string().min(1).max(200) });
|
|
36123
36509
|
var joinRequestAnswerSchemaDefinition = external_exports.discriminatedUnion("status", [
|
|
36124
36510
|
external_exports.object({ status: external_exports.literal("pending") }),
|
|
36125
|
-
external_exports.object({
|
|
36511
|
+
external_exports.object({
|
|
36512
|
+
status: external_exports.literal("approved"),
|
|
36513
|
+
...redeemedLinkSchemaDefinition.shape,
|
|
36514
|
+
/** The workspace the agent joined, for the line the CLI prints. */
|
|
36515
|
+
workspaceName: external_exports.string().default("")
|
|
36516
|
+
})
|
|
36126
36517
|
]);
|
|
36127
36518
|
var joinRequestInputSchemaDefinition = external_exports.object({
|
|
36128
|
-
workspaceId:
|
|
36519
|
+
workspaceId: workspaceIdSchema8,
|
|
36129
36520
|
code: external_exports.string().trim().min(1).max(20)
|
|
36130
36521
|
});
|
|
36131
36522
|
var joinRequestInputSchema = joinRequestInputSchemaDefinition;
|
|
36132
36523
|
var approveJoinRequestInputSchemaDefinition = external_exports.object({
|
|
36133
|
-
workspaceId:
|
|
36524
|
+
workspaceId: workspaceIdSchema8,
|
|
36134
36525
|
code: external_exports.string().trim().min(1).max(20),
|
|
36135
36526
|
/** The person may rename the agent as they approve it. */
|
|
36136
36527
|
name: external_exports.string().trim().max(80).optional()
|
|
@@ -36146,12 +36537,12 @@ var joinRequestViewSchemaDefinition = external_exports.object({
|
|
|
36146
36537
|
});
|
|
36147
36538
|
var joinRequestViewSchema = joinRequestViewSchemaDefinition;
|
|
36148
36539
|
var inboxMessageSchemaDefinition = external_exports.object({
|
|
36149
|
-
messageId:
|
|
36150
|
-
channelId:
|
|
36540
|
+
messageId: idSchema12,
|
|
36541
|
+
channelId: idSchema12,
|
|
36151
36542
|
channelName: external_exports.string(),
|
|
36152
36543
|
channelKind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
|
|
36153
|
-
threadRootId:
|
|
36154
|
-
author: external_exports.object({ kind: external_exports.enum(["person", "agent"]), id:
|
|
36544
|
+
threadRootId: idSchema12.nullable(),
|
|
36545
|
+
author: external_exports.object({ kind: external_exports.enum(["person", "agent"]), id: idSchema12, name: external_exports.string() }),
|
|
36155
36546
|
body: external_exports.string(),
|
|
36156
36547
|
postedAt: external_exports.iso.datetime()
|
|
36157
36548
|
});
|
|
@@ -36161,16 +36552,16 @@ var receiveInboxInputSchemaDefinition = external_exports.object({
|
|
|
36161
36552
|
});
|
|
36162
36553
|
var callerSchemaDefinition = external_exports.object({
|
|
36163
36554
|
kind: external_exports.enum(["person", "agent"]),
|
|
36164
|
-
id:
|
|
36555
|
+
id: idSchema12,
|
|
36165
36556
|
name: external_exports.string(),
|
|
36166
|
-
workspaceId:
|
|
36557
|
+
workspaceId: workspaceIdSchema8,
|
|
36167
36558
|
agent: agentSchemaDefinition.nullable(),
|
|
36168
36559
|
/** Messages waiting in the agent's inbox, not taken yet; 0 for a person. */
|
|
36169
36560
|
pendingCount: external_exports.number().int().min(0).optional()
|
|
36170
36561
|
});
|
|
36171
36562
|
var agentChannelLevelSchema = external_exports.enum(["everything", "mentions"]);
|
|
36172
36563
|
var callerChannelSchemaDefinition = external_exports.object({
|
|
36173
|
-
id:
|
|
36564
|
+
id: idSchema12,
|
|
36174
36565
|
name: external_exports.string(),
|
|
36175
36566
|
kind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
|
|
36176
36567
|
unread: external_exports.number().int().nonnegative(),
|
|
@@ -36182,9 +36573,9 @@ var callerChannelSchemaDefinition = external_exports.object({
|
|
|
36182
36573
|
mute: agentChannelMuteSchema.nullable().default(null)
|
|
36183
36574
|
});
|
|
36184
36575
|
var setChannelLevelInputSchemaDefinition = external_exports.object({
|
|
36185
|
-
workspaceId:
|
|
36186
|
-
agentId:
|
|
36187
|
-
channelId:
|
|
36576
|
+
workspaceId: workspaceIdSchema8,
|
|
36577
|
+
agentId: idSchema12,
|
|
36578
|
+
channelId: idSchema12,
|
|
36188
36579
|
level: agentChannelLevelSchema
|
|
36189
36580
|
});
|
|
36190
36581
|
var setChannelLevelInputSchema = setChannelLevelInputSchemaDefinition;
|
|
@@ -36207,12 +36598,12 @@ var postAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
36207
36598
|
/** A channel's name (with or without `#`) or id. */
|
|
36208
36599
|
channel: external_exports.string().trim().min(1).max(81),
|
|
36209
36600
|
body: external_exports.string().trim().min(1).max(4e4),
|
|
36210
|
-
threadRootId:
|
|
36601
|
+
threadRootId: idSchema12.optional(),
|
|
36211
36602
|
/** The messages of the agent's turn this post answers. */
|
|
36212
|
-
answers: external_exports.array(
|
|
36603
|
+
answers: external_exports.array(idSchema12).max(200).optional()
|
|
36213
36604
|
});
|
|
36214
36605
|
var replyAsCallerInputSchemaDefinition = external_exports.object({
|
|
36215
|
-
messageId:
|
|
36606
|
+
messageId: idSchema12,
|
|
36216
36607
|
body: external_exports.string().trim().min(1).max(4e4),
|
|
36217
36608
|
/** Needed for a message that is not in the caller's inbox. */
|
|
36218
36609
|
channel: external_exports.string().trim().min(1).max(81).optional(),
|
|
@@ -36221,12 +36612,12 @@ var replyAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
36221
36612
|
/** A thread reply also shows in the channel, as "Also send to #channel" does. */
|
|
36222
36613
|
alsoInChannel: external_exports.boolean().optional(),
|
|
36223
36614
|
/** The other messages of the agent's turn this reply answers. */
|
|
36224
|
-
answers: external_exports.array(
|
|
36615
|
+
answers: external_exports.array(idSchema12).max(200).optional()
|
|
36225
36616
|
});
|
|
36226
36617
|
var postedMessageSchemaDefinition = external_exports.object({
|
|
36227
|
-
messageId:
|
|
36228
|
-
channelId:
|
|
36229
|
-
threadRootId:
|
|
36618
|
+
messageId: idSchema12,
|
|
36619
|
+
channelId: idSchema12,
|
|
36620
|
+
threadRootId: idSchema12.nullable(),
|
|
36230
36621
|
/** Workspace members the message mentioned who are not in the channel: it did not reach them. */
|
|
36231
36622
|
notInChannel: external_exports.array(external_exports.object({ ...notInChannelSchema.shape, name: external_exports.string() })).default([])
|
|
36232
36623
|
});
|
|
@@ -36237,15 +36628,15 @@ var searchAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
36237
36628
|
});
|
|
36238
36629
|
var callerActorNameSchema = external_exports.object({
|
|
36239
36630
|
kind: external_exports.enum(["person", "agent"]),
|
|
36240
|
-
id:
|
|
36631
|
+
id: idSchema12,
|
|
36241
36632
|
name: external_exports.string()
|
|
36242
36633
|
});
|
|
36243
36634
|
var callerSearchHitSchemaDefinition = external_exports.object({
|
|
36244
|
-
messageId:
|
|
36245
|
-
channelId:
|
|
36635
|
+
messageId: idSchema12,
|
|
36636
|
+
channelId: idSchema12,
|
|
36246
36637
|
channelName: external_exports.string(),
|
|
36247
36638
|
channelKind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
|
|
36248
|
-
threadRootId:
|
|
36639
|
+
threadRootId: idSchema12.nullable(),
|
|
36249
36640
|
seq: external_exports.number().int().positive(),
|
|
36250
36641
|
/** `external` for a mirrored message from someone outside Laze. */
|
|
36251
36642
|
author: external_exports.object({
|
|
@@ -36267,7 +36658,7 @@ var callerSearchResultSchemaDefinition = external_exports.object({
|
|
|
36267
36658
|
/** Names for the mention tokens in the bodies. */
|
|
36268
36659
|
mentions: external_exports.object({
|
|
36269
36660
|
actors: external_exports.array(callerActorNameSchema),
|
|
36270
|
-
channels: external_exports.array(external_exports.object({ id:
|
|
36661
|
+
channels: external_exports.array(external_exports.object({ id: idSchema12, name: external_exports.string() }))
|
|
36271
36662
|
})
|
|
36272
36663
|
});
|
|
36273
36664
|
var agentActivityInputSchemaDefinition = external_exports.object({
|
|
@@ -36291,30 +36682,45 @@ var agentTurnHeartbeatInputSchemaDefinition = external_exports.object({
|
|
|
36291
36682
|
channelId: external_exports.string().min(1).max(80).nullable(),
|
|
36292
36683
|
threadRootId: external_exports.string().min(1).max(80).nullable().default(null),
|
|
36293
36684
|
/** Shown as the agent's working line; null reports nothing and only asks about stops. */
|
|
36294
|
-
state: external_exports.enum(["working", "idle"]).nullable().default(null)
|
|
36685
|
+
state: external_exports.enum(["working", "idle"]).nullable().default(null),
|
|
36686
|
+
/**
|
|
36687
|
+
* The inbox message the turn answers. Sent with `working`, it opens the agent's turn in that
|
|
36688
|
+
* conversation, which `idle` ends; the CLI takes its turn token from it.
|
|
36689
|
+
*/
|
|
36690
|
+
messageId: external_exports.string().min(1).max(80).nullable().default(null)
|
|
36295
36691
|
});
|
|
36296
36692
|
var agentTurnHeartbeatSchemaDefinition = external_exports.object({
|
|
36297
36693
|
stop: external_exports.boolean(),
|
|
36298
36694
|
stoppedBy: external_exports.string().nullable()
|
|
36299
36695
|
});
|
|
36696
|
+
var agentTurnTokenInputSchemaDefinition = external_exports.object({
|
|
36697
|
+
channelId: external_exports.string().min(1).max(80).nullable().default(null)
|
|
36698
|
+
});
|
|
36699
|
+
var agentTurnTokenSchemaDefinition = external_exports.object({
|
|
36700
|
+
turnToken: external_exports.string(),
|
|
36701
|
+
expiresAt: external_exports.iso.datetime()
|
|
36702
|
+
});
|
|
36300
36703
|
var CODEX_LOGIN_MAX_LENGTH = 64 * 1024;
|
|
36301
36704
|
var codexLoginRefreshInputSchemaDefinition = external_exports.object({
|
|
36302
36705
|
authJson: external_exports.string().min(2).max(CODEX_LOGIN_MAX_LENGTH)
|
|
36303
36706
|
});
|
|
36304
36707
|
var AgentApi = moduleApi()("agent");
|
|
36305
|
-
var agentCoreTrpc = defineTrpcContract("agents").query("list").withInput(external_exports.object({ workspaceId:
|
|
36306
|
-
var agentChannelSettingsTrpc = defineTrpcContract("agents").query("channelLevel").withInput(external_exports.object({ workspaceId:
|
|
36708
|
+
var agentCoreTrpc = defineTrpcContract("agents").query("list").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(external_exports.array(agentListEntrySchema)).mutation("create").withInput(createAgentInputSchema).withOutput(agentSchema).mutation("update").withInput(updateAgentInputSchema).withOutput(agentSchema).mutation("remove").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("transfer").withInput(transferAgentInputSchema).withOutput(agentSchema).mutation("resetSession").withInput(resetAgentSessionInputSchema).withOutput(agentSchema).query("faces").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(external_exports.array(agentFaceSchema)).query("presence").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(external_exports.array(agentPresenceSchema)).mutation("uploadAvatar").withInput(uploadAgentAvatarInputSchema).withOutput(uploadedAgentAvatarSchema).query("access").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(agentAccessSchema).query("permissionPrompts").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.array(agentPermissionPromptSchema)).mutation("share").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).mutation("unshare").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).query("harnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(harnessLoginsSchema).mutation("saveHarnessLogin").withInput(saveHarnessLoginInputSchema).withOutput(harnessLoginsSchema).mutation("removeHarnessLogin").withInput(removeHarnessLoginInputSchema).withOutput(harnessLoginsSchema).query("listHarnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(harnessLoginListSchema).mutation("addHarnessLogin").withInput(addHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("renameHarnessLogin").withInput(renameHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("deleteHarnessLogin").withInput(deleteHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("checkLoginUsage").withInput(checkLoginUsageInputSchema).withOutput(loginUsageCheckSchema).query("loginPools").withInput(external_exports.object({ workspaceId: workspaceIdSchema8 })).withOutput(loginPoolsSchema).mutation("createLoginPool").withInput(createLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("renameLoginPool").withInput(renameLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("deleteLoginPool").withInput(loginPoolRefInputSchema).withOutput(loginPoolsSchema).mutation("addPoolLogin").withInput(addPoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("removePoolLogin").withInput(removePoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("setPoolMember").withInput(setPoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("removePoolMember").withInput(removePoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("setAgentPool").withInput(setAgentPoolInputSchema).withOutput(agentSchema).mutation("openDirect").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.object({ channelId: idSchema12 })).mutation("startConversation").withInput(startConversationInputSchema).withOutput(startedConversationSchema).query("conversations").withInput(listConversationsInputSchema).withOutput(external_exports.array(conversationSummarySchema2)).mutation("joinConversation").withInput(conversationInputSchema).withOutput(conversationSummarySchema2).mutation("renameConversation").withInput(renameConversationInputSchema).withOutput(conversationSummarySchema2).mutation("leaveConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("deleteConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("mintLink").withInput(mintLinkInputSchema).withOutput(mintedLinkSchema).query("oauthRequest").withInput(oauthRequestInputSchema).withOutput(oauthRequestViewSchema).mutation("oauthApprove").withInput(approveOAuthInputSchema).withOutput(oauthRedirectSchema).mutation("oauthDeny").withInput(oauthRequestInputSchema).withOutput(oauthRedirectSchema).mutation("disconnect").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.object({ disconnected: external_exports.literal(true) })).mutation("setGithub").withInput(setAgentGithubInputSchema).withOutput(agentSchema).query("githubWatches").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12 })).withOutput(external_exports.array(agentGithubWatchSchema)).mutation("watchGithub").withInput(watchGithubInputSchema).withOutput(agentGithubWatchSchema).mutation("unwatchGithub").withInput(unwatchGithubInputSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("answerAttention").withInput(answerAttentionInputSchema).withOutput(external_exports.object({ answered: external_exports.literal(true) })).mutation("stopTurn").withInput(stopAgentTurnInputSchema).withOutput(external_exports.object({ stopped: external_exports.literal(true) })).mutation("restartComputer").withInput(restartAgentComputerInputSchema).withOutput(external_exports.object({ restarted: external_exports.boolean() })).build();
|
|
36709
|
+
var agentChannelSettingsTrpc = defineTrpcContract("agents").query("channelLevel").withInput(external_exports.object({ workspaceId: workspaceIdSchema8, agentId: idSchema12, channelId: idSchema12 })).withOutput(channelLevelSchema).mutation("setChannelLevel").withInput(setChannelLevelInputSchema).withOutput(channelLevelSchema).mutation("unmuteChannel").withInput(unmuteAgentChannelInputSchema).withOutput(channelLevelSchema).build();
|
|
36307
36710
|
var agentJoinTrpc = defineTrpcContract("agents").query("joinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("approveJoinRequest").withInput(approveJoinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("denyJoinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).build();
|
|
36711
|
+
var agentLoginTroubleTrpc = defineTrpcContract("agents").mutation("replaceHarnessLogin").withInput(replaceHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("waitForLogins").withInput(loginCardActionInputSchema).withOutput(external_exports.object({ waiting: external_exports.boolean() })).mutation("useAnotherLogin").withInput(loginCardActionInputSchema).withOutput(external_exports.object({ loginName: external_exports.string() })).build();
|
|
36308
36712
|
var agentTrpc = joinTrpcContracts(
|
|
36309
36713
|
"agents",
|
|
36310
36714
|
agentCoreTrpc,
|
|
36311
36715
|
agentChannelSettingsTrpc,
|
|
36312
|
-
agentJoinTrpc
|
|
36716
|
+
agentJoinTrpc,
|
|
36717
|
+
agentLoginTroubleTrpc
|
|
36313
36718
|
);
|
|
36314
36719
|
var agentUi = uiTokens("agent");
|
|
36315
36720
|
var AgentNavSlot = agentUi.component("nav");
|
|
36316
36721
|
var AgentAttentionCardSlot = agentUi.component("attentionCard");
|
|
36317
36722
|
var AgentComputerCardSlot = agentUi.component("computerCard");
|
|
36723
|
+
var AgentLoginCardSlot = agentUi.component("loginCard");
|
|
36318
36724
|
var AgentStopTurnSlot = agentUi.component("stopTurn");
|
|
36319
36725
|
var AgentCreateDialogSlot = agentUi.component("createDialog");
|
|
36320
36726
|
var AgentEditDialogSlot = agentUi.component("editDialog");
|
|
@@ -36383,22 +36789,53 @@ var agentDeliveryWakeIntentSchemaDefinition = external_exports.object({
|
|
|
36383
36789
|
agentId: external_exports.string().min(1)
|
|
36384
36790
|
});
|
|
36385
36791
|
|
|
36792
|
+
// ../../modules/agent/contract/src/agent-turn-failures.ts
|
|
36793
|
+
var agentTurnEndedPayloadSchemaDefinition = external_exports.object({
|
|
36794
|
+
workspaceId: external_exports.string().min(1),
|
|
36795
|
+
agentId: external_exports.string().min(1).max(80),
|
|
36796
|
+
turnId: external_exports.string().min(1).max(200),
|
|
36797
|
+
failed: external_exports.boolean(),
|
|
36798
|
+
/** What the session said when the turn failed. */
|
|
36799
|
+
reason: external_exports.string().max(500).optional()
|
|
36800
|
+
});
|
|
36801
|
+
var agentTurnFailuresStateSchemaDefinition = external_exports.object({
|
|
36802
|
+
workspaceId: external_exports.string(),
|
|
36803
|
+
failures: external_exports.number().int().nonnegative(),
|
|
36804
|
+
reason: external_exports.string(),
|
|
36805
|
+
/** The first failed turn of the streak, which names its card. */
|
|
36806
|
+
streakId: external_exports.string()
|
|
36807
|
+
});
|
|
36808
|
+
var agentKeepsFailingIntentSchemaDefinition = external_exports.object({
|
|
36809
|
+
workspaceId: external_exports.string().min(1),
|
|
36810
|
+
agentId: external_exports.string().min(1),
|
|
36811
|
+
reason: external_exports.string(),
|
|
36812
|
+
failures: external_exports.number().int().positive(),
|
|
36813
|
+
streakId: external_exports.string().min(1)
|
|
36814
|
+
});
|
|
36815
|
+
var agentKeepsFailingPayloadSchemaDefinition = external_exports.object({
|
|
36816
|
+
...agentKeepsFailingIntentSchemaDefinition.shape,
|
|
36817
|
+
agentName: external_exports.string().min(1),
|
|
36818
|
+
ownerUserId: external_exports.string().min(1),
|
|
36819
|
+
/** The agent's DM with its owner, where its session runs. */
|
|
36820
|
+
channelId: external_exports.string().min(1)
|
|
36821
|
+
});
|
|
36822
|
+
|
|
36386
36823
|
// ../../modules/agent/contract/src/agent-caller-access.ts
|
|
36387
|
-
var
|
|
36388
|
-
var
|
|
36389
|
-
var agentAsCallerInputSchemaDefinition = external_exports.object({ agent:
|
|
36824
|
+
var agentRefSchema4 = external_exports.string().trim().min(1).max(80);
|
|
36825
|
+
var idSchema13 = external_exports.string().min(1).max(64);
|
|
36826
|
+
var agentAsCallerInputSchemaDefinition = external_exports.object({ agent: agentRefSchema4 });
|
|
36390
36827
|
var shareAgentAsCallerInputSchemaDefinition = external_exports.object({
|
|
36391
|
-
agent:
|
|
36828
|
+
agent: agentRefSchema4,
|
|
36392
36829
|
grantee: agentGranteeSchema
|
|
36393
36830
|
});
|
|
36394
36831
|
var stopTurnAsCallerInputSchemaDefinition = external_exports.object({
|
|
36395
|
-
agent:
|
|
36396
|
-
channelId:
|
|
36832
|
+
agent: agentRefSchema4,
|
|
36833
|
+
channelId: idSchema13
|
|
36397
36834
|
});
|
|
36398
36835
|
var mintLinkAsCallerInputSchemaDefinition = external_exports.object({
|
|
36399
36836
|
/** Left out, the agent that joins with the link names itself. */
|
|
36400
36837
|
name: external_exports.string().trim().max(80).optional(),
|
|
36401
|
-
channelId:
|
|
36838
|
+
channelId: idSchema13.optional()
|
|
36402
36839
|
});
|
|
36403
36840
|
|
|
36404
36841
|
// ../../modules/agent/contract/src/agent-secret-sweep.ts
|
|
@@ -36465,25 +36902,25 @@ var agentRemovedPayloadSchemaDefinition = external_exports.object({
|
|
|
36465
36902
|
});
|
|
36466
36903
|
|
|
36467
36904
|
// ../../modules/agent/contract/src/agent-history.ts
|
|
36468
|
-
var
|
|
36905
|
+
var idSchema14 = external_exports.string().min(1).max(80);
|
|
36469
36906
|
var CALLER_HISTORY_LIMIT_MAX = 100;
|
|
36470
36907
|
var historyAsCallerInputSchemaDefinition = external_exports.object({
|
|
36471
36908
|
/** A channel the key's speaker is in, by id or name. */
|
|
36472
36909
|
channel: external_exports.string().trim().min(1).max(200),
|
|
36473
36910
|
/** Messages before this Laze message; none reads the newest page. */
|
|
36474
|
-
before:
|
|
36911
|
+
before: idSchema14.optional(),
|
|
36475
36912
|
/** Already past the cache: no cached messages, only where the live read goes on. */
|
|
36476
36913
|
olderThan: external_exports.iso.datetime().optional(),
|
|
36477
36914
|
limit: external_exports.number().int().min(1).max(CALLER_HISTORY_LIMIT_MAX).default(50)
|
|
36478
36915
|
});
|
|
36479
36916
|
var callerHistoryMessageSchemaDefinition = external_exports.object({
|
|
36480
|
-
messageId:
|
|
36481
|
-
threadRootId:
|
|
36917
|
+
messageId: idSchema14,
|
|
36918
|
+
threadRootId: idSchema14.nullable(),
|
|
36482
36919
|
seq: external_exports.number().int().positive(),
|
|
36483
36920
|
/** `external` for a mirrored message from someone outside Laze. */
|
|
36484
36921
|
author: external_exports.object({
|
|
36485
36922
|
kind: external_exports.enum(["person", "agent", "external"]),
|
|
36486
|
-
id:
|
|
36923
|
+
id: idSchema14,
|
|
36487
36924
|
name: external_exports.string()
|
|
36488
36925
|
}),
|
|
36489
36926
|
body: external_exports.string(),
|
|
@@ -36493,7 +36930,7 @@ var callerHistoryMessageSchemaDefinition = external_exports.object({
|
|
|
36493
36930
|
originKey: external_exports.string().nullable()
|
|
36494
36931
|
});
|
|
36495
36932
|
var callerHistorySchemaDefinition = external_exports.object({
|
|
36496
|
-
channelId:
|
|
36933
|
+
channelId: idSchema14,
|
|
36497
36934
|
channelName: external_exports.string(),
|
|
36498
36935
|
channelKind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
|
|
36499
36936
|
/** The outside workspace a mirrored conversation shows, such as "Slack ACME HQ". */
|
|
@@ -36507,12 +36944,12 @@ var callerHistorySchemaDefinition = external_exports.object({
|
|
|
36507
36944
|
});
|
|
36508
36945
|
|
|
36509
36946
|
// ../../modules/agent/contract/src/agent-channel-admin.ts
|
|
36510
|
-
var
|
|
36947
|
+
var idSchema15 = external_exports.string().min(1).max(80);
|
|
36511
36948
|
var channelRefSchema = external_exports.string().trim().min(1).max(200);
|
|
36512
36949
|
var channelAsCallerInputSchemaDefinition = external_exports.object({ channel: channelRefSchema });
|
|
36513
36950
|
var callerChannelMemberSchemaDefinition = external_exports.object({
|
|
36514
36951
|
kind: external_exports.enum(["person", "agent"]),
|
|
36515
|
-
id:
|
|
36952
|
+
id: idSchema15,
|
|
36516
36953
|
name: external_exports.string(),
|
|
36517
36954
|
role: external_exports.enum(["admin", "member"]),
|
|
36518
36955
|
/** Active, away or unknown for a person the speaker may see; absent for agents. */
|
|
@@ -36522,7 +36959,7 @@ var callerChannelMemberSchemaDefinition = external_exports.object({
|
|
|
36522
36959
|
doNotDisturb: doNotDisturbSchema.nullable().optional()
|
|
36523
36960
|
});
|
|
36524
36961
|
var callerChannelDetailSchemaDefinition = external_exports.object({
|
|
36525
|
-
id:
|
|
36962
|
+
id: idSchema15,
|
|
36526
36963
|
name: external_exports.string(),
|
|
36527
36964
|
kind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
|
|
36528
36965
|
topic: external_exports.string(),
|
|
@@ -36553,14 +36990,14 @@ var activityAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
36553
36990
|
limit: external_exports.number().int().min(1).max(100).default(50)
|
|
36554
36991
|
});
|
|
36555
36992
|
var callerActivityItemSchemaDefinition = external_exports.object({
|
|
36556
|
-
id:
|
|
36993
|
+
id: idSchema15,
|
|
36557
36994
|
kind: external_exports.enum(["mention", "thread_reply", "keyword", "reaction"]),
|
|
36558
|
-
channelId:
|
|
36995
|
+
channelId: idSchema15,
|
|
36559
36996
|
channelName: external_exports.string(),
|
|
36560
36997
|
channelKind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
|
|
36561
|
-
messageId:
|
|
36562
|
-
threadRootId:
|
|
36563
|
-
actor: external_exports.object({ kind: external_exports.enum(["person", "agent"]), id:
|
|
36998
|
+
messageId: idSchema15,
|
|
36999
|
+
threadRootId: idSchema15.nullable(),
|
|
37000
|
+
actor: external_exports.object({ kind: external_exports.enum(["person", "agent"]), id: idSchema15, name: external_exports.string() }),
|
|
36564
37001
|
emoji: external_exports.string().nullable(),
|
|
36565
37002
|
preview: external_exports.string(),
|
|
36566
37003
|
createdAt: external_exports.iso.datetime(),
|
|
@@ -36575,12 +37012,12 @@ var setStatusAsCallerInputSchemaDefinition = setStatusInputSchema.omit({ workspa
|
|
|
36575
37012
|
var setAwayAsCallerInputSchemaDefinition = external_exports.object({ away: external_exports.boolean() });
|
|
36576
37013
|
|
|
36577
37014
|
// ../../modules/agent/contract/src/agent-scheduled.ts
|
|
36578
|
-
var
|
|
37015
|
+
var idSchema16 = external_exports.string().min(1).max(80);
|
|
36579
37016
|
var channelRefSchema2 = external_exports.string().trim().min(1).max(200);
|
|
36580
37017
|
var scheduleAsCallerInputSchemaDefinition = external_exports.object({
|
|
36581
37018
|
channel: channelRefSchema2.optional(),
|
|
36582
|
-
threadRootId:
|
|
36583
|
-
replyTo:
|
|
37019
|
+
threadRootId: idSchema16.optional(),
|
|
37020
|
+
replyTo: idSchema16.optional(),
|
|
36584
37021
|
body: external_exports.string().trim().min(1).max(4e4),
|
|
36585
37022
|
sendAt: external_exports.iso.datetime({ offset: true }),
|
|
36586
37023
|
/** A reply that also goes to the channel at its time (`--also-channel`). */
|
|
@@ -36591,9 +37028,9 @@ var scheduleAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
36591
37028
|
var listScheduledAsCallerInputSchemaDefinition = external_exports.object({
|
|
36592
37029
|
channel: channelRefSchema2.optional()
|
|
36593
37030
|
});
|
|
36594
|
-
var scheduledAsCallerInputSchemaDefinition = external_exports.object({ scheduledId:
|
|
37031
|
+
var scheduledAsCallerInputSchemaDefinition = external_exports.object({ scheduledId: idSchema16 });
|
|
36595
37032
|
var editScheduledAsCallerInputSchemaDefinition = external_exports.object({
|
|
36596
|
-
scheduledId:
|
|
37033
|
+
scheduledId: idSchema16,
|
|
36597
37034
|
body: external_exports.string().trim().min(1).max(4e4).optional(),
|
|
36598
37035
|
sendAt: external_exports.iso.datetime({ offset: true }).optional()
|
|
36599
37036
|
}).refine((input2) => input2.body !== void 0 || input2.sendAt !== void 0, {
|
|
@@ -36602,7 +37039,7 @@ var editScheduledAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
36602
37039
|
|
|
36603
37040
|
// ../../modules/agent/contract/src/agent-channel-config.ts
|
|
36604
37041
|
var channelRefSchema3 = external_exports.string().trim().min(1).max(200);
|
|
36605
|
-
var
|
|
37042
|
+
var memberRefSchema2 = external_exports.string().trim().min(1).max(200);
|
|
36606
37043
|
var updateChannelAsCallerInputSchemaDefinition = external_exports.object({
|
|
36607
37044
|
channel: channelRefSchema3,
|
|
36608
37045
|
name: external_exports.string().trim().min(1).max(80).optional(),
|
|
@@ -36616,14 +37053,14 @@ var updateChannelAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
36616
37053
|
);
|
|
36617
37054
|
var addChannelMembersAsCallerInputSchemaDefinition = external_exports.object({
|
|
36618
37055
|
channel: channelRefSchema3,
|
|
36619
|
-
members: external_exports.array(
|
|
37056
|
+
members: external_exports.array(memberRefSchema2).min(1).max(100)
|
|
36620
37057
|
});
|
|
36621
37058
|
var removeChannelMemberAsCallerInputSchemaDefinition = external_exports.object({
|
|
36622
37059
|
channel: channelRefSchema3,
|
|
36623
|
-
member:
|
|
37060
|
+
member: memberRefSchema2
|
|
36624
37061
|
});
|
|
36625
37062
|
var openDirectAsCallerInputSchemaDefinition = external_exports.object({
|
|
36626
|
-
people: external_exports.array(
|
|
37063
|
+
people: external_exports.array(memberRefSchema2).min(1).max(GROUP_DM_MAX_MEMBERS - 1)
|
|
36627
37064
|
});
|
|
36628
37065
|
var setNotifyAsCallerInputSchemaDefinition = external_exports.object({
|
|
36629
37066
|
channel: channelRefSchema3,
|
|
@@ -36656,7 +37093,7 @@ var callerBrowsableChannelSchemaDefinition = external_exports.object({
|
|
|
36656
37093
|
// ../../modules/agent/contract/src/agent-workspace.ts
|
|
36657
37094
|
var CALLER_WORKSPACE_ROLES = ["OWNER", "ADMIN", "MEMBER", "GUEST"];
|
|
36658
37095
|
var roleSchema = external_exports.enum(CALLER_WORKSPACE_ROLES);
|
|
36659
|
-
var
|
|
37096
|
+
var memberRefSchema3 = external_exports.string().trim().min(1).max(320);
|
|
36660
37097
|
var callerMyWorkspaceSchemaDefinition = external_exports.object({
|
|
36661
37098
|
id: external_exports.string().min(1),
|
|
36662
37099
|
name: external_exports.string(),
|
|
@@ -36695,10 +37132,10 @@ var revokeInviteAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
36695
37132
|
invite: external_exports.string().trim().min(1).max(320)
|
|
36696
37133
|
});
|
|
36697
37134
|
var changeRoleAsCallerInputSchemaDefinition = external_exports.object({
|
|
36698
|
-
member:
|
|
37135
|
+
member: memberRefSchema3,
|
|
36699
37136
|
role: roleSchema
|
|
36700
37137
|
});
|
|
36701
|
-
var removeWorkspaceMemberAsCallerInputSchemaDefinition = external_exports.object({ member:
|
|
37138
|
+
var removeWorkspaceMemberAsCallerInputSchemaDefinition = external_exports.object({ member: memberRefSchema3 });
|
|
36702
37139
|
var decideRequestAsCallerInputSchemaDefinition = external_exports.object({
|
|
36703
37140
|
requestId: external_exports.string().trim().min(1).max(80),
|
|
36704
37141
|
decision: external_exports.enum(["approved", "denied"])
|
|
@@ -36844,6 +37281,25 @@ var CHAT_KEY_PATHS = {
|
|
|
36844
37281
|
starred: "/api/agents/me/chat/starred"
|
|
36845
37282
|
};
|
|
36846
37283
|
|
|
37284
|
+
// ../../modules/agent/contract/src/agent-join-events.ts
|
|
37285
|
+
var agentJoinRequestedPayloadSchemaDefinition = external_exports.object({
|
|
37286
|
+
workspaceId: external_exports.string().min(1),
|
|
37287
|
+
requestId: external_exports.string().min(1),
|
|
37288
|
+
/** The code as the person reads it, such as `BCDF-GHJK`. */
|
|
37289
|
+
code: external_exports.string().min(1),
|
|
37290
|
+
name: external_exports.string(),
|
|
37291
|
+
harness: agentHarnessSchema.catch("other"),
|
|
37292
|
+
note: external_exports.string(),
|
|
37293
|
+
deciderIds: external_exports.array(external_exports.string().min(1)),
|
|
37294
|
+
expiresAt: external_exports.iso.datetime()
|
|
37295
|
+
});
|
|
37296
|
+
var agentJoinResolvedPayloadSchemaDefinition = external_exports.object({
|
|
37297
|
+
workspaceId: external_exports.string().min(1),
|
|
37298
|
+
requestId: external_exports.string().min(1),
|
|
37299
|
+
state: external_exports.enum(["approved", "denied"]),
|
|
37300
|
+
resolvedByUserId: external_exports.string().min(1)
|
|
37301
|
+
});
|
|
37302
|
+
|
|
36847
37303
|
// src/services/laze-client.service.ts
|
|
36848
37304
|
var CLI_VERSION_HEADER = "x-laze-cli-version";
|
|
36849
37305
|
var LazeApiError = class extends Error {
|
|
@@ -37250,7 +37706,7 @@ var dismissSlackLinkPromptInputSchemaDefinition = external_exports.object({
|
|
|
37250
37706
|
var dismissSlackLinkPromptInputSchema = dismissSlackLinkPromptInputSchemaDefinition;
|
|
37251
37707
|
|
|
37252
37708
|
// ../../modules/slack/contract/src/slack-move.ts
|
|
37253
|
-
var
|
|
37709
|
+
var workspaceIdSchema9 = external_exports.string().min(1);
|
|
37254
37710
|
var teamIdSchema = external_exports.string().regex(/^[TE][A-Z0-9]{2,20}$/);
|
|
37255
37711
|
var slackChannelIdSchema = external_exports.string().regex(/^[CG][A-Z0-9]{2,20}$/);
|
|
37256
37712
|
var slackUserIdSchema = external_exports.string().regex(/^[UW][A-Z0-9]{2,20}$/);
|
|
@@ -37323,7 +37779,7 @@ var slackMovePreviewSchemaDefinition = external_exports.object({
|
|
|
37323
37779
|
});
|
|
37324
37780
|
var slackMovePreviewSchema = slackMovePreviewSchemaDefinition;
|
|
37325
37781
|
var slackMoveChannelInputSchemaDefinition = external_exports.object({
|
|
37326
|
-
workspaceId:
|
|
37782
|
+
workspaceId: workspaceIdSchema9,
|
|
37327
37783
|
teamId: teamIdSchema,
|
|
37328
37784
|
slackChannelId: slackChannelIdSchema
|
|
37329
37785
|
});
|
|
@@ -37338,7 +37794,7 @@ var slackMoveRequestSchemaDefinition = external_exports.object({
|
|
|
37338
37794
|
farewell: external_exports.string().trim().min(1).max(SLACK_FAREWELL_MAX).optional()
|
|
37339
37795
|
});
|
|
37340
37796
|
var startSlackMovesInputSchemaDefinition = external_exports.object({
|
|
37341
|
-
workspaceId:
|
|
37797
|
+
workspaceId: workspaceIdSchema9,
|
|
37342
37798
|
teamId: teamIdSchema,
|
|
37343
37799
|
channels: external_exports.array(slackMoveRequestSchemaDefinition).min(1).max(SLACK_MOVE_BATCH_MAX)
|
|
37344
37800
|
});
|
|
@@ -37353,13 +37809,13 @@ var startedSlackMovesSchemaDefinition = external_exports.object({
|
|
|
37353
37809
|
});
|
|
37354
37810
|
var startedSlackMovesSchema = startedSlackMovesSchemaDefinition;
|
|
37355
37811
|
var slackMoveInputSchemaDefinition = external_exports.object({
|
|
37356
|
-
workspaceId:
|
|
37812
|
+
workspaceId: workspaceIdSchema9,
|
|
37357
37813
|
moveId: external_exports.string().min(1).max(100)
|
|
37358
37814
|
});
|
|
37359
37815
|
var slackMoveInputSchema = slackMoveInputSchemaDefinition;
|
|
37360
37816
|
|
|
37361
37817
|
// ../../modules/slack/contract/src/slack-setup.ts
|
|
37362
|
-
var
|
|
37818
|
+
var workspaceIdSchema10 = external_exports.string().min(1);
|
|
37363
37819
|
var appKeySchema = external_exports.string().regex(/^[a-z0-9]{8,64}$/);
|
|
37364
37820
|
var returnToSchema3 = external_exports.string().startsWith("/").max(500).optional();
|
|
37365
37821
|
var slackAppCredentialFieldSchema = external_exports.enum([
|
|
@@ -37368,7 +37824,7 @@ var slackAppCredentialFieldSchema = external_exports.enum([
|
|
|
37368
37824
|
"clientSecret",
|
|
37369
37825
|
"signingSecret"
|
|
37370
37826
|
]);
|
|
37371
|
-
var beginSlackSetupInputSchemaDefinition = external_exports.object({ workspaceId:
|
|
37827
|
+
var beginSlackSetupInputSchemaDefinition = external_exports.object({ workspaceId: workspaceIdSchema10 });
|
|
37372
37828
|
var beginSlackSetupInputSchema = beginSlackSetupInputSchemaDefinition;
|
|
37373
37829
|
var slackSetupSchemaDefinition = external_exports.object({
|
|
37374
37830
|
appKey: appKeySchema,
|
|
@@ -37382,7 +37838,7 @@ var slackSetupSchemaDefinition = external_exports.object({
|
|
|
37382
37838
|
});
|
|
37383
37839
|
var slackSetupSchema = slackSetupSchemaDefinition;
|
|
37384
37840
|
var saveSlackAppCredentialsInputSchemaDefinition = external_exports.object({
|
|
37385
|
-
workspaceId:
|
|
37841
|
+
workspaceId: workspaceIdSchema10,
|
|
37386
37842
|
appKey: appKeySchema,
|
|
37387
37843
|
appId: external_exports.string().max(200),
|
|
37388
37844
|
clientId: external_exports.string().max(200),
|
|
@@ -37392,7 +37848,7 @@ var saveSlackAppCredentialsInputSchemaDefinition = external_exports.object({
|
|
|
37392
37848
|
});
|
|
37393
37849
|
var saveSlackAppCredentialsInputSchema = saveSlackAppCredentialsInputSchemaDefinition;
|
|
37394
37850
|
var installSlackAppInputSchemaDefinition = external_exports.object({
|
|
37395
|
-
workspaceId:
|
|
37851
|
+
workspaceId: workspaceIdSchema10,
|
|
37396
37852
|
appKey: appKeySchema,
|
|
37397
37853
|
returnTo: returnToSchema3
|
|
37398
37854
|
});
|
|
@@ -37491,7 +37947,7 @@ var slackCredentialsRetiredPayloadSchemaDefinition = external_exports.object({
|
|
|
37491
37947
|
var SLACK_CACHE_DAYS_MAX = 30;
|
|
37492
37948
|
var SLACK_HISTORY_PATH = "/api/slack/history";
|
|
37493
37949
|
var SLACK_READ_BUDGET_MAX = 5e3;
|
|
37494
|
-
var
|
|
37950
|
+
var workspaceIdSchema11 = external_exports.string().min(1);
|
|
37495
37951
|
var teamIdSchema2 = external_exports.string().regex(/^[TE][A-Z0-9]{2,20}$/);
|
|
37496
37952
|
var slackChannelIdSchema2 = external_exports.string().regex(/^[CG][A-Z0-9]{2,20}$/);
|
|
37497
37953
|
var slackConnectionStatusSchema = external_exports.enum(["connected", "needs_reinstall"]);
|
|
@@ -37551,13 +38007,13 @@ var slackChannelViewSchemaDefinition = external_exports.object({
|
|
|
37551
38007
|
});
|
|
37552
38008
|
var slackChannelViewSchema = slackChannelViewSchemaDefinition;
|
|
37553
38009
|
var startSlackInstallInputSchemaDefinition = external_exports.object({
|
|
37554
|
-
workspaceId:
|
|
38010
|
+
workspaceId: workspaceIdSchema11,
|
|
37555
38011
|
/** A path in Laze to land on afterwards; defaults to the Connectors page. */
|
|
37556
38012
|
returnTo: external_exports.string().startsWith("/").max(500).optional()
|
|
37557
38013
|
});
|
|
37558
38014
|
var startSlackInstallInputSchema = startSlackInstallInputSchemaDefinition;
|
|
37559
38015
|
var startSlackLinkInputSchemaDefinition = external_exports.object({
|
|
37560
|
-
workspaceId:
|
|
38016
|
+
workspaceId: workspaceIdSchema11,
|
|
37561
38017
|
teamId: teamIdSchema2,
|
|
37562
38018
|
returnTo: external_exports.string().startsWith("/").max(500).optional()
|
|
37563
38019
|
});
|
|
@@ -37565,7 +38021,7 @@ var startSlackLinkInputSchema = startSlackLinkInputSchemaDefinition;
|
|
|
37565
38021
|
var startedSlackAuthorizeSchemaDefinition = external_exports.object({ authorizeUrl: external_exports.url() });
|
|
37566
38022
|
var startedSlackAuthorizeSchema = startedSlackAuthorizeSchemaDefinition;
|
|
37567
38023
|
var startSlackSetupInputSchemaDefinition = external_exports.object({
|
|
37568
|
-
workspaceId:
|
|
38024
|
+
workspaceId: workspaceIdSchema11,
|
|
37569
38025
|
configToken: external_exports.string().trim().min(10).max(1e3),
|
|
37570
38026
|
returnTo: external_exports.string().startsWith("/").max(500).optional()
|
|
37571
38027
|
});
|
|
@@ -37584,19 +38040,19 @@ var slackEventsHeadersSchemaDefinition = external_exports.object({
|
|
|
37584
38040
|
});
|
|
37585
38041
|
var slackEventsAnswerSchemaDefinition = external_exports.object({ challenge: external_exports.string().nullable() });
|
|
37586
38042
|
var teamInputSchemaDefinition = external_exports.object({
|
|
37587
|
-
workspaceId:
|
|
38043
|
+
workspaceId: workspaceIdSchema11,
|
|
37588
38044
|
teamId: teamIdSchema2
|
|
37589
38045
|
});
|
|
37590
38046
|
var slackTeamInputSchema = teamInputSchemaDefinition;
|
|
37591
38047
|
var setSlackMirrorInputSchemaDefinition = external_exports.object({
|
|
37592
|
-
workspaceId:
|
|
38048
|
+
workspaceId: workspaceIdSchema11,
|
|
37593
38049
|
teamId: teamIdSchema2,
|
|
37594
38050
|
slackChannelId: slackChannelIdSchema2,
|
|
37595
38051
|
mirrored: external_exports.boolean()
|
|
37596
38052
|
});
|
|
37597
38053
|
var setSlackMirrorInputSchema = setSlackMirrorInputSchemaDefinition;
|
|
37598
38054
|
var updateSlackConnectionInputSchemaDefinition = external_exports.object({
|
|
37599
|
-
workspaceId:
|
|
38055
|
+
workspaceId: workspaceIdSchema11,
|
|
37600
38056
|
teamId: teamIdSchema2,
|
|
37601
38057
|
label: external_exports.string().trim().max(80).nullable().optional(),
|
|
37602
38058
|
cacheDays: external_exports.number().int().min(1).max(SLACK_CACHE_DAYS_MAX).optional(),
|
|
@@ -37604,17 +38060,17 @@ var updateSlackConnectionInputSchemaDefinition = external_exports.object({
|
|
|
37604
38060
|
});
|
|
37605
38061
|
var updateSlackConnectionInputSchema = updateSlackConnectionInputSchemaDefinition;
|
|
37606
38062
|
var updateSlackAppInputSchemaDefinition = external_exports.object({
|
|
37607
|
-
workspaceId:
|
|
38063
|
+
workspaceId: workspaceIdSchema11,
|
|
37608
38064
|
teamId: teamIdSchema2,
|
|
37609
38065
|
configToken: external_exports.string().trim().min(10).max(1e3)
|
|
37610
38066
|
});
|
|
37611
38067
|
var updateSlackAppInputSchema = updateSlackAppInputSchemaDefinition;
|
|
37612
38068
|
var slackLinkParamsSchemaDefinition = external_exports.object({
|
|
37613
|
-
workspaceId:
|
|
38069
|
+
workspaceId: workspaceIdSchema11,
|
|
37614
38070
|
teamId: teamIdSchema2
|
|
37615
38071
|
});
|
|
37616
38072
|
var slackHistoryInputSchemaDefinition = external_exports.object({
|
|
37617
|
-
workspaceId:
|
|
38073
|
+
workspaceId: workspaceIdSchema11,
|
|
37618
38074
|
/** The Laze conversation that mirrors the Slack channel. */
|
|
37619
38075
|
channelId: external_exports.string().min(1),
|
|
37620
38076
|
/** Messages before this time; the oldest message the cache shows. */
|
|
@@ -37644,7 +38100,7 @@ var slackHistoryPageSchemaDefinition = external_exports.object({
|
|
|
37644
38100
|
});
|
|
37645
38101
|
var slackHistoryPageSchema = slackHistoryPageSchemaDefinition;
|
|
37646
38102
|
var slackFileParamsSchemaDefinition = external_exports.object({
|
|
37647
|
-
workspaceId:
|
|
38103
|
+
workspaceId: workspaceIdSchema11,
|
|
37648
38104
|
/** The Laze conversation that mirrors the Slack channel. */
|
|
37649
38105
|
channelId: external_exports.string().min(1).max(200),
|
|
37650
38106
|
fileId: external_exports.string().regex(/^F[A-Z0-9]{2,30}$/)
|
|
@@ -37652,7 +38108,7 @@ var slackFileParamsSchemaDefinition = external_exports.object({
|
|
|
37652
38108
|
var SLACK_SEARCH_QUERY_MIN = 2;
|
|
37653
38109
|
var SLACK_SEARCH_QUERY_MAX = 200;
|
|
37654
38110
|
var slackSearchInputSchemaDefinition = external_exports.object({
|
|
37655
|
-
workspaceId:
|
|
38111
|
+
workspaceId: workspaceIdSchema11,
|
|
37656
38112
|
query: external_exports.string().trim().min(SLACK_SEARCH_QUERY_MIN).max(SLACK_SEARCH_QUERY_MAX)
|
|
37657
38113
|
});
|
|
37658
38114
|
var slackSearchInputSchema = slackSearchInputSchemaDefinition;
|
|
@@ -37700,7 +38156,7 @@ var slackSearchAnswerSchemaDefinition = external_exports.object({
|
|
|
37700
38156
|
});
|
|
37701
38157
|
var slackSearchAnswerSchema = slackSearchAnswerSchemaDefinition;
|
|
37702
38158
|
var SlackApi = moduleApi()("slack");
|
|
37703
|
-
var workspaceInput3 = external_exports.object({ workspaceId:
|
|
38159
|
+
var workspaceInput3 = external_exports.object({ workspaceId: workspaceIdSchema11 });
|
|
37704
38160
|
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).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();
|
|
37705
38161
|
|
|
37706
38162
|
// ../../modules/slack/contract/src/slack-keys.ts
|
|
@@ -39224,14 +39680,19 @@ function mcpAddCommandOf({ context, profile }) {
|
|
|
39224
39680
|
const serve = [...context.program, "mcp", "--profile", profile].map(quote).join(" ");
|
|
39225
39681
|
return `claude mcp add --scope local ${LAZE_MCP_SERVER} -- ${serve}`;
|
|
39226
39682
|
}
|
|
39683
|
+
var MCP_REGISTER_LIMIT_MS = 3e4;
|
|
39227
39684
|
async function registerMcp({
|
|
39228
39685
|
context,
|
|
39229
39686
|
directory,
|
|
39230
39687
|
profile
|
|
39231
39688
|
}) {
|
|
39232
39689
|
const add3 = mcpAddCommandOf({ context, profile });
|
|
39233
|
-
const script = `cd ${quote(directory)} && { claude mcp remove --scope local ${LAZE_MCP_SERVER} >/dev/null 2>&1; ${add3} >/dev/null; }`;
|
|
39234
|
-
const
|
|
39690
|
+
const script = `cd ${quote(directory)} && { claude mcp remove --scope local ${LAZE_MCP_SERVER} >/dev/null 2>&1 </dev/null; ${add3} >/dev/null 2>&1 </dev/null; }`;
|
|
39691
|
+
const run3 = context.runCommand({ command: ["sh", "-c", script], env: {} }).catch(() => 1);
|
|
39692
|
+
const done = new AbortController();
|
|
39693
|
+
const gaveUp = context.sleep(MCP_REGISTER_LIMIT_MS, done.signal).then(() => -1);
|
|
39694
|
+
const code = await Promise.race([run3, gaveUp]);
|
|
39695
|
+
done.abort();
|
|
39235
39696
|
return code === 0;
|
|
39236
39697
|
}
|
|
39237
39698
|
function claudeStepsOf({
|
|
@@ -39425,7 +39886,7 @@ function usageOf2({
|
|
|
39425
39886
|
const used = `${Math.round(usedPercent)}% used`;
|
|
39426
39887
|
return resets ? `${used}, resets ${utcTimeOf(resets)}` : used;
|
|
39427
39888
|
}
|
|
39428
|
-
var INVALID2 = "
|
|
39889
|
+
var INVALID2 = "signed out: its provider refused this token, sign in again with a new one";
|
|
39429
39890
|
var EXPIRES_SOON = " expires within hours: run claude setup-token for a token that lasts a year";
|
|
39430
39891
|
function formatLogins({ list: list10, nowMs }) {
|
|
39431
39892
|
if (list10.logins.length === 0) {
|
|
@@ -39491,6 +39952,9 @@ function refusalLine({ code, message: message2 }) {
|
|
|
39491
39952
|
var CREATE_USAGE = "Usage: laze agent create --name <name> [--description <text>] [--harness laze-models|claude-code|codex] [--team] [--pool <pool>] [--avatar <file>]";
|
|
39492
39953
|
var UPDATE_USAGE = "Usage: laze agent update <agent> [--name <name>] [--description <text>] [--avatar <file>] [--context-window <tokens, such as 400k or 1M>]";
|
|
39493
39954
|
var ARCHIVE_USAGE = "Usage: laze agent archive <agent>";
|
|
39955
|
+
var PAUSE_USAGE = "Usage: laze agent pause|resume <agent>";
|
|
39956
|
+
var TRANSFER_USAGE = "Usage: laze agent transfer <agent> <member: user id, email or name>";
|
|
39957
|
+
var RESET_USAGE = "Usage: laze agent reset-session <agent>";
|
|
39494
39958
|
var HARNESSES = /* @__PURE__ */ new Set(["laze-models", "claude-code", "codex"]);
|
|
39495
39959
|
var PICTURE_TYPES = {
|
|
39496
39960
|
".png": "image/png",
|
|
@@ -39641,9 +40105,53 @@ async function archiveAgent({
|
|
|
39641
40105
|
context.out(`Archived ${agent2}.
|
|
39642
40106
|
`);
|
|
39643
40107
|
}
|
|
40108
|
+
async function pauseAgent({
|
|
40109
|
+
context,
|
|
40110
|
+
args
|
|
40111
|
+
}) {
|
|
40112
|
+
const paused = args.words[1] === "pause";
|
|
40113
|
+
const agent2 = args.words[2];
|
|
40114
|
+
if (!agent2) throw new CliUsageError(PAUSE_USAGE);
|
|
40115
|
+
const { client } = await signedIn({ context, args });
|
|
40116
|
+
const updated = await client.post("/api/agents/update", { agent: agent2, paused });
|
|
40117
|
+
if (args.flags.json) return context.out(`${JSON.stringify(updated, null, 2)}
|
|
40118
|
+
`);
|
|
40119
|
+
context.out(
|
|
40120
|
+
paused ? `Paused ${updated.name}. Its messages wait until you run laze agent resume.
|
|
40121
|
+
` : `Resumed ${updated.name}. It answers the messages that waited.
|
|
40122
|
+
`
|
|
40123
|
+
);
|
|
40124
|
+
}
|
|
40125
|
+
async function transferAgent({
|
|
40126
|
+
context,
|
|
40127
|
+
args
|
|
40128
|
+
}) {
|
|
40129
|
+
const [, , agent2, to] = args.words;
|
|
40130
|
+
if (!agent2 || !to) throw new CliUsageError(TRANSFER_USAGE);
|
|
40131
|
+
const { client } = await signedIn({ context, args });
|
|
40132
|
+
const moved = await client.post("/api/agents/transfer", { agent: agent2, to });
|
|
40133
|
+
if (args.flags.json) return context.out(`${JSON.stringify(moved, null, 2)}
|
|
40134
|
+
`);
|
|
40135
|
+
context.out(`Transferred ${moved.name} to ${to}.
|
|
40136
|
+
`);
|
|
40137
|
+
}
|
|
40138
|
+
async function resetAgentSession({
|
|
40139
|
+
context,
|
|
40140
|
+
args
|
|
40141
|
+
}) {
|
|
40142
|
+
const agent2 = args.words[2];
|
|
40143
|
+
if (!agent2) throw new CliUsageError(RESET_USAGE);
|
|
40144
|
+
const { client } = await signedIn({ context, args });
|
|
40145
|
+
const reset = await client.post("/api/agents/reset-session", { agent: agent2 });
|
|
40146
|
+
if (args.flags.json) return context.out(`${JSON.stringify(reset, null, 2)}
|
|
40147
|
+
`);
|
|
40148
|
+
context.out(`Reset ${reset.name}'s session. Its next message starts a fresh one.
|
|
40149
|
+
`);
|
|
40150
|
+
}
|
|
39644
40151
|
var PATHS = {
|
|
39645
40152
|
logins: "/api/agents/logins",
|
|
39646
40153
|
renameLogin: "/api/agents/logins/rename",
|
|
40154
|
+
replaceLogin: "/api/agents/logins/replace",
|
|
39647
40155
|
deleteLogin: "/api/agents/logins/delete",
|
|
39648
40156
|
checkLogins: "/api/agents/logins/check",
|
|
39649
40157
|
pools: "/api/agents/pools",
|
|
@@ -39655,7 +40163,7 @@ var PATHS = {
|
|
|
39655
40163
|
removePoolMember: "/api/agents/pools/members/remove",
|
|
39656
40164
|
setAgentPool: "/api/agents/pool"
|
|
39657
40165
|
};
|
|
39658
|
-
var LOGINS_HELP = `Usage: laze agent logins list|add|rename|remove|check
|
|
40166
|
+
var LOGINS_HELP = `Usage: laze agent logins list|add|sign-in|rename|remove|check
|
|
39659
40167
|
|
|
39660
40168
|
laze agent logins list [--json] your Claude and Codex logins, with usage
|
|
39661
40169
|
laze agent logins add --harness claude-code|codex --name <name> < token
|
|
@@ -39663,6 +40171,8 @@ var LOGINS_HELP = `Usage: laze agent logins list|add|rename|remove|check
|
|
|
39663
40171
|
laze agent logins add --harness claude-code|codex --name <name> --from-vault <connection>
|
|
39664
40172
|
copies a connection already in your own keychain; the CLI never reads or prints it.
|
|
39665
40173
|
Over MCP --from-vault is the only path: agents never pass a raw token
|
|
40174
|
+
laze agent logins sign-in <login> < token signs a signed-out login in again: a new
|
|
40175
|
+
token in the same login, read from stdin only; the agents waiting on it run again
|
|
39666
40176
|
laze agent logins rename <login> <new name>
|
|
39667
40177
|
laze agent logins remove <login>
|
|
39668
40178
|
laze agent logins check [--pool <pool>] [--json] asks the providers for fresh usage, then lists
|
|
@@ -39766,6 +40276,7 @@ function printPools({ context, args }, pools, line) {
|
|
|
39766
40276
|
`);
|
|
39767
40277
|
}
|
|
39768
40278
|
var LOGIN_ADD_USAGE = "Usage: laze agent logins add --harness claude-code|codex --name <name> (< token | --from-vault <connection>)\n";
|
|
40279
|
+
var LOGIN_SIGN_IN_USAGE = "Usage: laze agent logins sign-in <login> < token\n";
|
|
39769
40280
|
var POOL_ADD_USAGE = "Usage: laze agent pools add-login <pool> --harness claude-code|codex --name <name> (< token | --from-vault <connection>)\n";
|
|
39770
40281
|
var LOGIN_ACTIONS = {
|
|
39771
40282
|
check: {
|
|
@@ -39814,6 +40325,22 @@ var LOGIN_ACTIONS = {
|
|
|
39814
40325
|
);
|
|
39815
40326
|
}
|
|
39816
40327
|
},
|
|
40328
|
+
"sign-in": {
|
|
40329
|
+
words: 1,
|
|
40330
|
+
run: async (step) => {
|
|
40331
|
+
const login2 = loginNamed({ logins: await loginsOf(step.client), wanted: step.first });
|
|
40332
|
+
if (SECRET_FLAGS.some((flag) => step.args.flags[flag] !== void 0)) {
|
|
40333
|
+
throw new CliUsageError(LOGIN_SIGN_IN_USAGE);
|
|
40334
|
+
}
|
|
40335
|
+
const secret = await secretOnStdin({ context: step.context });
|
|
40336
|
+
const list10 = await step.client.post(PATHS.replaceLogin, {
|
|
40337
|
+
loginId: login2.id,
|
|
40338
|
+
secret
|
|
40339
|
+
});
|
|
40340
|
+
printLogins(step, list10, `Signed in again on ${login2.name}. Its agents run on it again.
|
|
40341
|
+
`);
|
|
40342
|
+
}
|
|
40343
|
+
},
|
|
39817
40344
|
rename: {
|
|
39818
40345
|
words: 2,
|
|
39819
40346
|
run: async (step) => {
|
|
@@ -40983,6 +41510,72 @@ var appTriggerFiredPayloadSchemaDefinition = external_exports.object({
|
|
|
40983
41510
|
at: external_exports.iso.datetime()
|
|
40984
41511
|
});
|
|
40985
41512
|
|
|
41513
|
+
// ../../modules/app/contract/src/app.pins.ts
|
|
41514
|
+
var appPinChangedPayloadSchemaDefinition = external_exports.object({
|
|
41515
|
+
workspaceId: external_exports.string().min(1),
|
|
41516
|
+
channelId: external_exports.string().min(1),
|
|
41517
|
+
appId: external_exports.string().min(1),
|
|
41518
|
+
change: external_exports.enum(["pinned", "unpinned"]),
|
|
41519
|
+
changeId: external_exports.string().min(1),
|
|
41520
|
+
by: appActorSchema,
|
|
41521
|
+
/** True when an agent's create or publish pinned it, not a person's choice. */
|
|
41522
|
+
automatic: external_exports.boolean(),
|
|
41523
|
+
at: external_exports.iso.datetime()
|
|
41524
|
+
});
|
|
41525
|
+
var appPinSchemaDefinition = external_exports.object({
|
|
41526
|
+
appId: external_exports.string().min(1),
|
|
41527
|
+
channelId: external_exports.string().min(1),
|
|
41528
|
+
/** The app's name as the tab shows it. */
|
|
41529
|
+
name: external_exports.string(),
|
|
41530
|
+
/** The reader's role in the app; null when they cannot open it. */
|
|
41531
|
+
role: appRoleSchema.nullable(),
|
|
41532
|
+
/** Whether the app serves a published version, else its draft preview. */
|
|
41533
|
+
published: external_exports.boolean(),
|
|
41534
|
+
pinnedBy: appActorSchema,
|
|
41535
|
+
pinnedByName: external_exports.string().nullable(),
|
|
41536
|
+
pinnedAt: external_exports.iso.datetime()
|
|
41537
|
+
});
|
|
41538
|
+
var appPinViewSchemaDefinition = external_exports.object({
|
|
41539
|
+
activeAppId: external_exports.string().nullable(),
|
|
41540
|
+
minimised: external_exports.boolean()
|
|
41541
|
+
});
|
|
41542
|
+
var channelAppPinsSchemaDefinition = external_exports.object({
|
|
41543
|
+
workspaceId: external_exports.string().min(1),
|
|
41544
|
+
channelId: external_exports.string().min(1),
|
|
41545
|
+
/** Oldest pin first, the order the tabs show. */
|
|
41546
|
+
pins: external_exports.array(appPinSchemaDefinition),
|
|
41547
|
+
view: appPinViewSchemaDefinition
|
|
41548
|
+
});
|
|
41549
|
+
var channelAppPinsSchema = channelAppPinsSchemaDefinition;
|
|
41550
|
+
var pinAppInputSchemaDefinition = external_exports.object({
|
|
41551
|
+
workspaceId: external_exports.string().min(1),
|
|
41552
|
+
appId: external_exports.string().min(1),
|
|
41553
|
+
/** The conversation, by id or by channel name with or without `#`. */
|
|
41554
|
+
channel: external_exports.string().trim().min(1).max(120)
|
|
41555
|
+
});
|
|
41556
|
+
var pinAppInputSchema = pinAppInputSchemaDefinition;
|
|
41557
|
+
var channelPinsInputSchemaDefinition = external_exports.object({
|
|
41558
|
+
workspaceId: external_exports.string().min(1),
|
|
41559
|
+
channel: external_exports.string().trim().min(1).max(120)
|
|
41560
|
+
});
|
|
41561
|
+
var channelPinsInputSchema = channelPinsInputSchemaDefinition;
|
|
41562
|
+
var setPinViewInputSchemaDefinition = external_exports.object({
|
|
41563
|
+
workspaceId: external_exports.string().min(1),
|
|
41564
|
+
channel: external_exports.string().trim().min(1).max(120),
|
|
41565
|
+
/** The tab to open next time; absent keeps the one saved. */
|
|
41566
|
+
activeAppId: external_exports.string().min(1).nullable().optional(),
|
|
41567
|
+
minimised: external_exports.boolean().optional()
|
|
41568
|
+
});
|
|
41569
|
+
var setPinViewInputSchema = setPinViewInputSchemaDefinition;
|
|
41570
|
+
var pinAppByKeyInputSchemaDefinition = external_exports.object({
|
|
41571
|
+
appId: external_exports.string().min(1),
|
|
41572
|
+
/** Absent in an agent's turn means the conversation the turn runs in. */
|
|
41573
|
+
channel: external_exports.string().trim().min(1).max(120).optional()
|
|
41574
|
+
});
|
|
41575
|
+
var channelPinsByKeyInputSchemaDefinition = channelPinsInputSchemaDefinition.omit({
|
|
41576
|
+
workspaceId: true
|
|
41577
|
+
});
|
|
41578
|
+
|
|
40986
41579
|
// ../../modules/app/contract/src/app.backup.ts
|
|
40987
41580
|
var appBackupCheckFailureSchemaDefinition = external_exports.object({
|
|
40988
41581
|
appId: external_exports.string(),
|
|
@@ -41005,7 +41598,8 @@ var appBackupCheckAlertsSchemaDefinition = external_exports.object({
|
|
|
41005
41598
|
// ../../modules/app/contract/src/app.trpc.ts
|
|
41006
41599
|
var appMainTrpc = defineTrpcContract("app").query("list").withInput(listAppsInputSchema).withOutput(external_exports.array(appSchema)).query("get").withInput(appRefSchema).withOutput(appSchema).mutation("create").withInput(createAppInputSchema).withOutput(appSchema).mutation("rename").withInput(renameAppInputSchema).withOutput(appSchema).mutation("archive").withInput(appRefSchema).withOutput(appSchema).mutation("unarchive").withInput(appRefSchema).withOutput(appSchema).mutation("delete").withInput(deleteAppInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("versions").withInput(appRefSchema).withOutput(external_exports.array(appVersionSchema)).mutation("revert").withInput(revertInputSchema).withOutput(appVersionSchema).mutation("publish").withInput(publishInputSchema).withOutput(publishOutcomeSchema).query("collections").withInput(siteRefSchema).withOutput(external_exports.array(collectionSchema)).query("records").withInput(listRecordsInputSchema).withOutput(recordPageSchema).mutation("writeRecord").withInput(writeRecordInputSchema).withOutput(appRecordSchema).mutation("deleteRecord").withInput(deleteRecordInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("views").withInput(siteRefSchema).withOutput(external_exports.array(appViewSchema)).mutation("saveView").withInput(saveViewInputSchema).withOutput(appViewSchema).mutation("deleteView").withInput(deleteViewInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("chooseCardRows").withInput(chooseCardRowsInputSchema).withOutput(appCardChoiceSchema).query("exportRecords").withInput(exportRecordsInputSchema).withOutput(recordExportSchema).mutation("importRecords").withInput(importRecordsInputSchema).withOutput(recordImportSchema).mutation("decidePublish").withInput(decidePublishInputSchema).withOutput(publishOutcomeSchema).mutation("nameVersion").withInput(nameVersionInputSchema).withOutput(appVersionSchema).mutation("makeInternal").withInput(appRefSchema).withOutput(appSchema).mutation("revokePublishLease").withInput(appRefSchema).withOutput(appSchema).mutation("signInHandoff").withInput(signInHandoffInputSchema).withOutput(signInHandoffSchema).query("functionLogs").withInput(listFunctionLogsInputSchema).withOutput(external_exports.array(appFunctionLogEntrySchema)).query("functionSettings").withInput(appWorkspaceRefSchema).withOutput(appFunctionSettingsSchema).query("access").withInput(appRefSchema).withOutput(appAccessSchema).mutation("grantAccess").withInput(grantAppAccessInputSchema).withOutput(appAccessSchema).mutation("revokeAccess").withInput(revokeAppAccessInputSchema).withOutput(appAccessSchema).mutation("setVisibility").withInput(setAppVisibilityInputSchema).withOutput(visibilityOutcomeSchema).mutation("setMemberRole").withInput(setMemberRoleInputSchema).withOutput(appAccessSchema).mutation("unpublish").withInput(appRefSchema).withOutput(appSchema).query("door").withInput(appRefSchema).withOutput(appDoorSchema).mutation("requestAccess").withInput(appRefSchema).withOutput(appDoorSchema).mutation("decideAccess").withInput(decideAppAccessInputSchema).withOutput(appAccessRequestSchema).query("users").withInput(appRefSchema).withOutput(appUsersSchema).mutation("blockUser").withInput(blockAppUserInputSchema).withOutput(appUsersSchema).mutation("deleteUser").withInput(deleteAppUserInputSchema).withOutput(deletedAppUserSchema).mutation("setFunctionsEnabled").withInput(setFunctionsEnabledInputSchema).withOutput(appFunctionSettingsSchema).query("backups").withInput(appRefSchema).withOutput(appBackupStatusSchema).mutation("restoreData").withInput(restoreAppDataInputSchema).withOutput(appRestoreSchema).query("cost").withInput(appRefSchema).withOutput(appCostSchema).mutation("setBudget").withInput(setAppBudgetInputSchema).withOutput(appCostSchema).query("triggers").withInput(appRefSchema).withOutput(appTriggersSchema).mutation("setTriggerPaused").withInput(setAppTriggerPausedInputSchema).withOutput(appTriggerSchema).mutation("removeTrigger").withInput(appTriggerRefSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
|
|
41007
41600
|
var appConnectionsTrpc = defineTrpcContract("app").query("connections").withInput(appRefSchema).withOutput(appConnectionsSchema).mutation("allowConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).mutation("revokeConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).build();
|
|
41008
|
-
var
|
|
41601
|
+
var appPinsTrpc = defineTrpcContract("app").query("pins").withInput(channelPinsInputSchema).withOutput(channelAppPinsSchema).mutation("pin").withInput(pinAppInputSchema).withOutput(channelAppPinsSchema).mutation("unpin").withInput(pinAppInputSchema).withOutput(channelAppPinsSchema).mutation("setPinView").withInput(setPinViewInputSchema).withOutput(channelAppPinsSchema).build();
|
|
41602
|
+
var appTrpc = joinTrpcContracts("app", appMainTrpc, appConnectionsTrpc, appPinsTrpc);
|
|
41009
41603
|
|
|
41010
41604
|
// ../../modules/app/contract/src/app.rest.ts
|
|
41011
41605
|
var byKey = { workspaceId: true };
|
|
@@ -41224,6 +41818,24 @@ var appCliCommands = [
|
|
|
41224
41818
|
arguments: ["<connection>"],
|
|
41225
41819
|
summary: "Stop the app's server functions using the connection; their next call is refused"
|
|
41226
41820
|
},
|
|
41821
|
+
{
|
|
41822
|
+
command: "laze app pin",
|
|
41823
|
+
operation: "pinApp",
|
|
41824
|
+
arguments: ["[app]", "--channel <c>"],
|
|
41825
|
+
summary: "Pin the app as a tab of a channel or chat for everyone in it, who may then open it; an app an agent creates or publishes from a conversation is pinned there on its own"
|
|
41826
|
+
},
|
|
41827
|
+
{
|
|
41828
|
+
command: "laze app unpin",
|
|
41829
|
+
operation: "unpinApp",
|
|
41830
|
+
arguments: ["[app]", "--channel <c>"],
|
|
41831
|
+
summary: "Take the app's tab away from the conversation; the app and its data stay"
|
|
41832
|
+
},
|
|
41833
|
+
{
|
|
41834
|
+
command: "laze app pins",
|
|
41835
|
+
operation: "listChannelPins",
|
|
41836
|
+
arguments: ["<channel>"],
|
|
41837
|
+
summary: "The apps pinned to a conversation, oldest first"
|
|
41838
|
+
},
|
|
41227
41839
|
{
|
|
41228
41840
|
command: "laze app rename",
|
|
41229
41841
|
operation: "renameApp",
|
|
@@ -41395,6 +42007,7 @@ var appUi = uiTokens("app");
|
|
|
41395
42007
|
var AppNavSlot = appUi.component("nav");
|
|
41396
42008
|
var AppPanelSlot = appUi.component("panel");
|
|
41397
42009
|
var AppCardSlot = appUi.component("card");
|
|
42010
|
+
var AppPinStripSlot = appUi.component("pin-strip");
|
|
41398
42011
|
|
|
41399
42012
|
// ../../modules/app/contract/src/app.config.ts
|
|
41400
42013
|
var appConfig = Config.define((c) => ({
|
|
@@ -42181,6 +42794,66 @@ var appManageCommands = {
|
|
|
42181
42794
|
"delete-user": deleteUser
|
|
42182
42795
|
};
|
|
42183
42796
|
|
|
42797
|
+
// src/services/app-pin-commands.service.ts
|
|
42798
|
+
var USAGE3 = `Usage:
|
|
42799
|
+
laze app pin [app] --channel <c>
|
|
42800
|
+
laze app unpin [app] --channel <c>
|
|
42801
|
+
laze app pins <channel>`;
|
|
42802
|
+
function print3({
|
|
42803
|
+
context,
|
|
42804
|
+
args,
|
|
42805
|
+
value,
|
|
42806
|
+
text: text2
|
|
42807
|
+
}) {
|
|
42808
|
+
context.out(args.flags.json ? `${JSON.stringify(value, null, 2)}
|
|
42809
|
+
` : text2);
|
|
42810
|
+
}
|
|
42811
|
+
function pinsText({ channel, listed }) {
|
|
42812
|
+
if (listed.pins.length === 0) {
|
|
42813
|
+
return `No apps are pinned to ${channel}. laze app pin --channel ${channel} pins one.
|
|
42814
|
+
`;
|
|
42815
|
+
}
|
|
42816
|
+
const lines = listed.pins.map(
|
|
42817
|
+
(pin) => `${pin.name} ${pin.appId} pinned by ${pin.pinnedByName ?? pin.pinnedBy.id} ${pin.pinnedAt.slice(0, 10)}
|
|
42818
|
+
`
|
|
42819
|
+
);
|
|
42820
|
+
return `Pinned to ${channel}:
|
|
42821
|
+
${lines.join("")}`;
|
|
42822
|
+
}
|
|
42823
|
+
async function appPinCommand({
|
|
42824
|
+
context,
|
|
42825
|
+
args,
|
|
42826
|
+
verb,
|
|
42827
|
+
open: open2
|
|
42828
|
+
}) {
|
|
42829
|
+
const channel = flagText({ args, name: "channel" });
|
|
42830
|
+
const { client, appId, name: name2 } = await open2();
|
|
42831
|
+
const listed = await client.post(`/api/apps/${verb}`, {
|
|
42832
|
+
appId,
|
|
42833
|
+
...channel ? { channel } : {}
|
|
42834
|
+
});
|
|
42835
|
+
const where = channel || "this conversation";
|
|
42836
|
+
print3({
|
|
42837
|
+
context,
|
|
42838
|
+
args,
|
|
42839
|
+
value: listed,
|
|
42840
|
+
text: verb === "pin" ? `Pinned ${name2} to ${where}: everyone in it sees the tab and may open the app.
|
|
42841
|
+
` : `Unpinned ${name2} from ${where}. The app and its data stay.
|
|
42842
|
+
`
|
|
42843
|
+
});
|
|
42844
|
+
}
|
|
42845
|
+
async function appPinsCommand({
|
|
42846
|
+
context,
|
|
42847
|
+
args,
|
|
42848
|
+
signed: signed2
|
|
42849
|
+
}) {
|
|
42850
|
+
const channel = args.words[2] ?? flagText({ args, name: "channel" });
|
|
42851
|
+
if (!channel) throw new CliUsageError(USAGE3);
|
|
42852
|
+
const client = await signed2();
|
|
42853
|
+
const listed = await client.post("/api/apps/pins", { channel });
|
|
42854
|
+
print3({ context, args, value: listed, text: pinsText({ channel, listed }) });
|
|
42855
|
+
}
|
|
42856
|
+
|
|
42184
42857
|
// src/services/app-script-check.service.ts
|
|
42185
42858
|
import { execFile } from "node:child_process";
|
|
42186
42859
|
import { mkdtemp, rm as rm4, writeFile as writeFile7 } from "node:fs/promises";
|
|
@@ -42236,7 +42909,7 @@ async function scriptErrorsOf({
|
|
|
42236
42909
|
}
|
|
42237
42910
|
|
|
42238
42911
|
// src/services/app-trigger-commands.service.ts
|
|
42239
|
-
var
|
|
42912
|
+
var USAGE4 = `Usage:
|
|
42240
42913
|
laze app trigger add <collection> --on create,update,delete [--where <json>] --prompt <text>
|
|
42241
42914
|
laze app trigger list
|
|
42242
42915
|
laze app trigger pause|resume <trigger-id>
|
|
@@ -42272,7 +42945,7 @@ function triggerLine(trigger) {
|
|
|
42272
42945
|
${trigger.prompt}
|
|
42273
42946
|
`;
|
|
42274
42947
|
}
|
|
42275
|
-
function
|
|
42948
|
+
function print4({
|
|
42276
42949
|
context,
|
|
42277
42950
|
args,
|
|
42278
42951
|
value,
|
|
@@ -42290,14 +42963,14 @@ async function add({ context, args, open: open2, word: word2 }) {
|
|
|
42290
42963
|
const text2 = `Added a trigger on ${name2}:
|
|
42291
42964
|
${triggerLine(trigger)}Matching changes to published ${word2} records wake ${trigger.agentName} in ${trigger.channelName}.
|
|
42292
42965
|
`;
|
|
42293
|
-
|
|
42966
|
+
print4({ context, args, value: trigger, text: text2 });
|
|
42294
42967
|
}
|
|
42295
42968
|
async function list({ context, args, open: open2 }) {
|
|
42296
42969
|
const { client, appId, name: name2 } = await open2();
|
|
42297
42970
|
const listed = await client.post("/api/apps/triggers", { appId });
|
|
42298
42971
|
const text2 = listed.triggers.length === 0 ? `${name2} has no triggers. laze app trigger add <collection> adds one.
|
|
42299
42972
|
` : listed.triggers.map(triggerLine).join("");
|
|
42300
|
-
|
|
42973
|
+
print4({ context, args, value: listed, text: text2 });
|
|
42301
42974
|
}
|
|
42302
42975
|
async function setPaused({ context, args, open: open2, word: word2, paused }) {
|
|
42303
42976
|
const { client, appId } = await open2();
|
|
@@ -42306,12 +42979,12 @@ async function setPaused({ context, args, open: open2, word: word2, paused }) {
|
|
|
42306
42979
|
triggerId: word2,
|
|
42307
42980
|
paused
|
|
42308
42981
|
});
|
|
42309
|
-
|
|
42982
|
+
print4({ context, args, value: trigger, text: triggerLine(trigger) });
|
|
42310
42983
|
}
|
|
42311
42984
|
async function remove2({ context, args, open: open2, word: word2 }) {
|
|
42312
42985
|
const { client, appId } = await open2();
|
|
42313
42986
|
await client.post("/api/apps/triggers/remove", { appId, triggerId: word2 });
|
|
42314
|
-
|
|
42987
|
+
print4({ context, args, value: { removed: word2 }, text: `Removed trigger ${word2}.
|
|
42315
42988
|
` });
|
|
42316
42989
|
}
|
|
42317
42990
|
async function appTrigger({
|
|
@@ -42322,40 +42995,66 @@ async function appTrigger({
|
|
|
42322
42995
|
const [, , verb, word2] = args.words;
|
|
42323
42996
|
if (verb === "list") return list({ context, args, open: open2 });
|
|
42324
42997
|
const known = verb === "add" || verb === "pause" || verb === "resume" || verb === "remove";
|
|
42325
|
-
if (known && !word2) throw new CliUsageError(
|
|
42998
|
+
if (known && !word2) throw new CliUsageError(USAGE4);
|
|
42326
42999
|
if (known && word2) {
|
|
42327
43000
|
const run3 = { context, args, open: open2, word: word2 };
|
|
42328
43001
|
if (verb === "add") return add(run3);
|
|
42329
43002
|
if (verb === "remove") return remove2(run3);
|
|
42330
43003
|
return setPaused({ ...run3, paused: verb === "pause" });
|
|
42331
43004
|
}
|
|
42332
|
-
context.out(`${
|
|
43005
|
+
context.out(`${USAGE4}
|
|
42333
43006
|
`);
|
|
42334
43007
|
if (verb) throw new CliUsageError(`laze app trigger has no command ${verb}`);
|
|
42335
43008
|
}
|
|
42336
43009
|
|
|
43010
|
+
// src/services/connected-turn.service.ts
|
|
43011
|
+
async function connectedTurnTokenOf({
|
|
43012
|
+
client,
|
|
43013
|
+
channelId
|
|
43014
|
+
}) {
|
|
43015
|
+
try {
|
|
43016
|
+
const turn = await client.post("/api/agents/me/turn-token", {
|
|
43017
|
+
channelId
|
|
43018
|
+
});
|
|
43019
|
+
return turn.turnToken;
|
|
43020
|
+
} catch (error62) {
|
|
43021
|
+
if (error62 instanceof LazeApiError && (error62.code === "agent_no_open_turn" || error62.status === 404)) {
|
|
43022
|
+
return "";
|
|
43023
|
+
}
|
|
43024
|
+
throw error62;
|
|
43025
|
+
}
|
|
43026
|
+
}
|
|
43027
|
+
|
|
42337
43028
|
// src/services/app-commands.service.ts
|
|
42338
|
-
var
|
|
43029
|
+
var USAGE5 = `Usage: laze app <command>. The app comes from ${APP_MANIFEST_FILE} in the folder, or --app <id|slug>.
|
|
42339
43030
|
|
|
42340
43031
|
${appCliCommands.map((entry) => ` ${entry.command} ${entry.arguments.join(" ")}
|
|
42341
43032
|
${entry.summary}`).join("\n")}`;
|
|
42342
43033
|
var MAX_FILES = 2e3;
|
|
42343
|
-
async function turnTokenOf({
|
|
43034
|
+
async function turnTokenOf({
|
|
43035
|
+
context,
|
|
43036
|
+
args,
|
|
43037
|
+
client,
|
|
43038
|
+
agent: agent2
|
|
43039
|
+
}) {
|
|
42344
43040
|
const env = context.environment.inherited;
|
|
42345
43041
|
const pinned = env.LAZE_TURN_TOKEN?.trim();
|
|
42346
43042
|
if (pinned) return pinned;
|
|
42347
|
-
if (
|
|
42348
|
-
|
|
42349
|
-
|
|
42350
|
-
|
|
42351
|
-
|
|
43043
|
+
if (env.LAZE_TURN_FILE) {
|
|
43044
|
+
return readFile7(env.LAZE_TURN_FILE, "utf8").then(
|
|
43045
|
+
(text2) => text2.trim(),
|
|
43046
|
+
() => ""
|
|
43047
|
+
);
|
|
43048
|
+
}
|
|
43049
|
+
if (!agent2) return "";
|
|
43050
|
+
return connectedTurnTokenOf({ client, channelId: flagText({ args, name: "channel" }) || null });
|
|
42352
43051
|
}
|
|
42353
43052
|
async function appClient({
|
|
42354
43053
|
context,
|
|
42355
43054
|
args
|
|
42356
43055
|
}) {
|
|
42357
|
-
const { client } = await signedIn({ context, args });
|
|
42358
|
-
const turn = await turnTokenOf({ context });
|
|
43056
|
+
const { client, profile } = await signedIn({ context, args });
|
|
43057
|
+
const turn = await turnTokenOf({ context, args, client, agent: profile.kind === "agent" });
|
|
42359
43058
|
return turn ? client.withHeaders({ "x-laze-turn": turn }) : client;
|
|
42360
43059
|
}
|
|
42361
43060
|
function siteOf(args, fallback) {
|
|
@@ -42427,7 +43126,7 @@ async function listFiles(folder) {
|
|
|
42427
43126
|
throw new CliUsageError(`A version holds at most ${MAX_FILES} files`);
|
|
42428
43127
|
return found.toSorted();
|
|
42429
43128
|
}
|
|
42430
|
-
function
|
|
43129
|
+
function print5({
|
|
42431
43130
|
context,
|
|
42432
43131
|
args,
|
|
42433
43132
|
value,
|
|
@@ -42438,7 +43137,7 @@ function print4({
|
|
|
42438
43137
|
}
|
|
42439
43138
|
var appCreate = async ({ context, args }) => {
|
|
42440
43139
|
const name2 = args.words.slice(2).join(" ").trim();
|
|
42441
|
-
if (!name2) throw new CliUsageError(
|
|
43140
|
+
if (!name2) throw new CliUsageError(USAGE5);
|
|
42442
43141
|
const templateName = flagText({ args, name: "template" });
|
|
42443
43142
|
if (templateName && !APP_TEMPLATES.includes(templateName)) {
|
|
42444
43143
|
throw new CliUsageError(
|
|
@@ -42471,7 +43170,7 @@ var appCreate = async ({ context, args }) => {
|
|
|
42471
43170
|
};
|
|
42472
43171
|
await writeFile8(join8(folder, APP_MANIFEST_FILE), `${JSON.stringify(manifest, null, 2)}
|
|
42473
43172
|
`);
|
|
42474
|
-
|
|
43173
|
+
print5({
|
|
42475
43174
|
context,
|
|
42476
43175
|
args,
|
|
42477
43176
|
value: { app: app2, folder },
|
|
@@ -42488,7 +43187,7 @@ var appList = async ({ context, args }) => {
|
|
|
42488
43187
|
return `${app2.slug} ${app2.id} ${state} ${app2.publishedUrl}
|
|
42489
43188
|
`;
|
|
42490
43189
|
});
|
|
42491
|
-
|
|
43190
|
+
print5({ context, args, value: apps, text: lines.join("") || "No apps yet.\n" });
|
|
42492
43191
|
};
|
|
42493
43192
|
var appPush = async ({ context, args }) => {
|
|
42494
43193
|
const { message: message2, words } = messageOf({ args });
|
|
@@ -42555,7 +43254,7 @@ var appPush = async ({ context, args }) => {
|
|
|
42555
43254
|
if (args.flags.seed && manifest) {
|
|
42556
43255
|
await client.post("/api/apps/seed", { appId, records: manifest.seed });
|
|
42557
43256
|
}
|
|
42558
|
-
|
|
43257
|
+
print5({
|
|
42559
43258
|
context,
|
|
42560
43259
|
args,
|
|
42561
43260
|
value: { version: version2, app: app2 },
|
|
@@ -42571,7 +43270,7 @@ var appPreview = async ({ context, args }) => {
|
|
|
42571
43270
|
appId,
|
|
42572
43271
|
site: siteOf(args, "draft")
|
|
42573
43272
|
});
|
|
42574
|
-
|
|
43273
|
+
print5({ context, args, value: preview, text: `${preview.url}
|
|
42575
43274
|
` });
|
|
42576
43275
|
};
|
|
42577
43276
|
var appPublish = async ({ context, args }) => {
|
|
@@ -42584,7 +43283,7 @@ var appPublish = async ({ context, args }) => {
|
|
|
42584
43283
|
...version2 ? { version: version2 } : {},
|
|
42585
43284
|
...visibility ? { visibility } : {}
|
|
42586
43285
|
});
|
|
42587
|
-
|
|
43286
|
+
print5({ context, args, value: outcome, text: publishLine(outcome) });
|
|
42588
43287
|
};
|
|
42589
43288
|
function publishLine(outcome) {
|
|
42590
43289
|
const { request: request2 } = outcome;
|
|
@@ -42618,7 +43317,7 @@ var appVersions = async ({ context, args }) => {
|
|
|
42618
43317
|
const client = await appClient({ context, args });
|
|
42619
43318
|
const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
|
|
42620
43319
|
const versions = await client.post("/api/apps/versions", { appId });
|
|
42621
|
-
|
|
43320
|
+
print5({
|
|
42622
43321
|
context,
|
|
42623
43322
|
args,
|
|
42624
43323
|
value: versions,
|
|
@@ -42630,7 +43329,7 @@ var appVersions = async ({ context, args }) => {
|
|
|
42630
43329
|
};
|
|
42631
43330
|
var appRevert = async ({ context, args }) => {
|
|
42632
43331
|
const prefix = messageOf({ args }).words[2];
|
|
42633
|
-
if (!prefix) throw new CliUsageError(
|
|
43332
|
+
if (!prefix) throw new CliUsageError(USAGE5);
|
|
42634
43333
|
const client = await appClient({ context, args });
|
|
42635
43334
|
const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
|
|
42636
43335
|
const { message: message2 } = messageOf({ args });
|
|
@@ -42640,7 +43339,7 @@ var appRevert = async ({ context, args }) => {
|
|
|
42640
43339
|
...message2 ? { message: message2 } : {}
|
|
42641
43340
|
});
|
|
42642
43341
|
const app2 = await client.post("/api/apps/get", { appId });
|
|
42643
|
-
|
|
43342
|
+
print5({
|
|
42644
43343
|
context,
|
|
42645
43344
|
args,
|
|
42646
43345
|
value: version2,
|
|
@@ -42654,7 +43353,7 @@ var appMakeInternal = async ({ context, args }) => {
|
|
|
42654
43353
|
const client = await appClient({ context, args });
|
|
42655
43354
|
const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
|
|
42656
43355
|
const app2 = await client.post("/api/apps/make-internal", { appId });
|
|
42657
|
-
|
|
43356
|
+
print5({
|
|
42658
43357
|
context,
|
|
42659
43358
|
args,
|
|
42660
43359
|
value: app2,
|
|
@@ -42665,7 +43364,7 @@ var appMakeInternal = async ({ context, args }) => {
|
|
|
42665
43364
|
var appName = async ({ context, args }) => {
|
|
42666
43365
|
const [, , prefix, ...rest] = args.words;
|
|
42667
43366
|
const name2 = rest.join(" ").trim();
|
|
42668
|
-
if (!prefix || !name2) throw new CliUsageError(
|
|
43367
|
+
if (!prefix || !name2) throw new CliUsageError(USAGE5);
|
|
42669
43368
|
const client = await appClient({ context, args });
|
|
42670
43369
|
const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
|
|
42671
43370
|
const version2 = await client.post("/api/apps/versions/name", {
|
|
@@ -42673,7 +43372,7 @@ var appName = async ({ context, args }) => {
|
|
|
42673
43372
|
version: await versionOf({ client, appId, prefix }),
|
|
42674
43373
|
name: name2
|
|
42675
43374
|
});
|
|
42676
|
-
|
|
43375
|
+
print5({
|
|
42677
43376
|
context,
|
|
42678
43377
|
args,
|
|
42679
43378
|
value: version2,
|
|
@@ -42685,7 +43384,7 @@ var appDiscard = async ({ context, args }) => {
|
|
|
42685
43384
|
const client = await appClient({ context, args });
|
|
42686
43385
|
const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
|
|
42687
43386
|
const app2 = await client.post("/api/apps/discard", { appId });
|
|
42688
|
-
|
|
43387
|
+
print5({ context, args, value: app2, text: `The draft of ${app2.name} is no longer served.
|
|
42689
43388
|
` });
|
|
42690
43389
|
};
|
|
42691
43390
|
var appCollections = async ({ context, args }) => {
|
|
@@ -42694,14 +43393,14 @@ var appCollections = async ({ context, args }) => {
|
|
|
42694
43393
|
if (args.words[2] === "define") {
|
|
42695
43394
|
const name2 = args.words[3];
|
|
42696
43395
|
const fields = await jsonFlag({ context, args, name: "fields" });
|
|
42697
|
-
if (!name2 || !Array.isArray(fields)) throw new CliUsageError(
|
|
43396
|
+
if (!name2 || !Array.isArray(fields)) throw new CliUsageError(USAGE5);
|
|
42698
43397
|
const collection = await client.post("/api/apps/collections/define", {
|
|
42699
43398
|
appId,
|
|
42700
43399
|
site: siteOf(args, "draft"),
|
|
42701
43400
|
name: name2,
|
|
42702
43401
|
fields
|
|
42703
43402
|
});
|
|
42704
|
-
return
|
|
43403
|
+
return print5({
|
|
42705
43404
|
context,
|
|
42706
43405
|
args,
|
|
42707
43406
|
value: collection,
|
|
@@ -42717,7 +43416,7 @@ var appCollections = async ({ context, args }) => {
|
|
|
42717
43416
|
(collection) => `${collection.name} (v${collection.version}): ${collection.schema.fields.map((field) => `${field.name}:${field.type}${field.required ? "!" : ""}`).join(", ")}
|
|
42718
43417
|
`
|
|
42719
43418
|
);
|
|
42720
|
-
|
|
43419
|
+
print5({ context, args, value: collections, text: lines.join("") || "No collections yet.\n" });
|
|
42721
43420
|
};
|
|
42722
43421
|
var appViewRemove = async ({ context, args }) => {
|
|
42723
43422
|
const viewId = args.words[3];
|
|
@@ -42731,7 +43430,7 @@ var appViewRemove = async ({ context, args }) => {
|
|
|
42731
43430
|
site,
|
|
42732
43431
|
viewId
|
|
42733
43432
|
});
|
|
42734
|
-
|
|
43433
|
+
print5({ context, args, value: answer4, text: `Deleted view ${viewId} from the ${site}.
|
|
42735
43434
|
` });
|
|
42736
43435
|
};
|
|
42737
43436
|
var appViews = async ({ context, args }) => {
|
|
@@ -42746,7 +43445,7 @@ var appViews = async ({ context, args }) => {
|
|
|
42746
43445
|
(view) => `${view.collection} ${view.name} ${view.type}${view.groupBy ? ` by ${view.groupBy}` : ""}${view.dateField ? ` on ${view.dateField}` : ""} ${view.id}
|
|
42747
43446
|
`
|
|
42748
43447
|
);
|
|
42749
|
-
|
|
43448
|
+
print5({ context, args, value: views, text: lines.join("") || "No views yet.\n" });
|
|
42750
43449
|
};
|
|
42751
43450
|
function cardLine({ choice }) {
|
|
42752
43451
|
const { rows } = choice;
|
|
@@ -42781,7 +43480,7 @@ var appCard = async ({ context, args }) => {
|
|
|
42781
43480
|
caption: text2("caption")
|
|
42782
43481
|
}
|
|
42783
43482
|
});
|
|
42784
|
-
|
|
43483
|
+
print5({ context, args, value: choice, text: cardLine({ choice }) });
|
|
42785
43484
|
};
|
|
42786
43485
|
var appSeed = async ({ context, args }) => {
|
|
42787
43486
|
const folder = folderOf({ context, word: void 0 });
|
|
@@ -42791,9 +43490,17 @@ var appSeed = async ({ context, args }) => {
|
|
|
42791
43490
|
await client.post("/api/apps/seed", { appId, records });
|
|
42792
43491
|
context.out("The draft data was emptied and the records loaded.\n");
|
|
42793
43492
|
};
|
|
43493
|
+
function recordPageText({ records, site }) {
|
|
43494
|
+
if (records.totalItems === 0) return `No records in the ${site} data.
|
|
43495
|
+
`;
|
|
43496
|
+
const lines = records.items.map((record4) => JSON.stringify(record4)).join("\n");
|
|
43497
|
+
return `${lines}
|
|
43498
|
+
(page ${records.page} of ${records.totalPages}, ${records.totalItems} records)
|
|
43499
|
+
`;
|
|
43500
|
+
}
|
|
42794
43501
|
var appRecords = async ({ context, args }) => {
|
|
42795
43502
|
const [, , action = "list", collection] = args.words;
|
|
42796
|
-
if (!collection) throw new CliUsageError(
|
|
43503
|
+
if (!collection) throw new CliUsageError(USAGE5);
|
|
42797
43504
|
const client = await appClient({ context, args });
|
|
42798
43505
|
const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
|
|
42799
43506
|
const site = siteOf(args, "draft");
|
|
@@ -42810,12 +43517,12 @@ var appRecords = async ({ context, args }) => {
|
|
|
42810
43517
|
...recordId ? { recordId } : {}
|
|
42811
43518
|
}
|
|
42812
43519
|
);
|
|
42813
|
-
return
|
|
43520
|
+
return print5({ context, args, value: written.record, text: `${String(written.record.id)}
|
|
42814
43521
|
` });
|
|
42815
43522
|
}
|
|
42816
43523
|
if (action === "delete") {
|
|
42817
43524
|
const recordId = args.words[4];
|
|
42818
|
-
if (!recordId) throw new CliUsageError(
|
|
43525
|
+
if (!recordId) throw new CliUsageError(USAGE5);
|
|
42819
43526
|
await client.post("/api/apps/records/delete", { appId, site, collection, recordId });
|
|
42820
43527
|
return context.out(`Deleted ${recordId}
|
|
42821
43528
|
`);
|
|
@@ -42831,18 +43538,16 @@ var appRecords = async ({ context, args }) => {
|
|
|
42831
43538
|
...filter ? { filter } : {},
|
|
42832
43539
|
...sort ? { sort } : {}
|
|
42833
43540
|
});
|
|
42834
|
-
|
|
43541
|
+
print5({
|
|
42835
43542
|
context,
|
|
42836
43543
|
args,
|
|
42837
43544
|
value: records,
|
|
42838
|
-
text:
|
|
42839
|
-
(page ${records.page} of ${records.totalPages}, ${records.totalItems} records)
|
|
42840
|
-
`
|
|
43545
|
+
text: recordPageText({ records, site })
|
|
42841
43546
|
});
|
|
42842
43547
|
};
|
|
42843
43548
|
var appExport = async ({ context, args }) => {
|
|
42844
43549
|
const collection = args.words[2];
|
|
42845
|
-
if (!collection) throw new CliUsageError(
|
|
43550
|
+
if (!collection) throw new CliUsageError(USAGE5);
|
|
42846
43551
|
const client = await appClient({ context, args });
|
|
42847
43552
|
const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
|
|
42848
43553
|
const exported = await client.post("/api/apps/export", {
|
|
@@ -42861,7 +43566,7 @@ var appExport = async ({ context, args }) => {
|
|
|
42861
43566
|
var appImport = async ({ context, args }) => {
|
|
42862
43567
|
const words = args.words.slice(2);
|
|
42863
43568
|
const [named, collection, file3] = words.length >= 3 ? words : [void 0, ...words];
|
|
42864
|
-
if (!collection || !file3) throw new CliUsageError(
|
|
43569
|
+
if (!collection || !file3) throw new CliUsageError(USAGE5);
|
|
42865
43570
|
const csv = await readFile7(resolve4(context.cwd, file3), "utf8").catch(() => {
|
|
42866
43571
|
throw new CliUsageError(`Cannot read ${file3}`);
|
|
42867
43572
|
});
|
|
@@ -42889,7 +43594,7 @@ var appImport = async ({ context, args }) => {
|
|
|
42889
43594
|
const more = result.refused.length > 20 ? ` and ${result.refused.length - 20} more
|
|
42890
43595
|
` : "";
|
|
42891
43596
|
const unmapped = result.columns.filter((column) => !column.field).map((column) => column.column);
|
|
42892
|
-
|
|
43597
|
+
print5({
|
|
42893
43598
|
context,
|
|
42894
43599
|
args,
|
|
42895
43600
|
value: result,
|
|
@@ -42921,7 +43626,7 @@ var appLogs = async ({ context, args }) => {
|
|
|
42921
43626
|
errorsOnly: Boolean(args.flags.errors),
|
|
42922
43627
|
limit: Number.isInteger(limit) && limit > 0 ? Math.min(limit, 1e3) : 50
|
|
42923
43628
|
});
|
|
42924
|
-
|
|
43629
|
+
print5({
|
|
42925
43630
|
context,
|
|
42926
43631
|
args,
|
|
42927
43632
|
value: entries,
|
|
@@ -42971,7 +43676,7 @@ async function decideAsk({
|
|
|
42971
43676
|
decision,
|
|
42972
43677
|
role: role2
|
|
42973
43678
|
}) {
|
|
42974
|
-
if (!requestId) throw new CliUsageError(
|
|
43679
|
+
if (!requestId) throw new CliUsageError(USAGE5);
|
|
42975
43680
|
const answer4 = await client.post("/api/apps/access/decide", {
|
|
42976
43681
|
appId,
|
|
42977
43682
|
requestId,
|
|
@@ -43024,7 +43729,7 @@ var appAccess = async ({ context, args }) => {
|
|
|
43024
43729
|
const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
|
|
43025
43730
|
const [, , action, first, second] = args.words;
|
|
43026
43731
|
if (!action) {
|
|
43027
|
-
|
|
43732
|
+
print5({
|
|
43028
43733
|
context,
|
|
43029
43734
|
args,
|
|
43030
43735
|
...await shownAccess({ client, path: "/api/apps/access", body: { appId } })
|
|
@@ -43032,14 +43737,14 @@ var appAccess = async ({ context, args }) => {
|
|
|
43032
43737
|
return;
|
|
43033
43738
|
}
|
|
43034
43739
|
const run3 = Object.hasOwn(ACCESS_ACTIONS, action) ? ACCESS_ACTIONS[action] : void 0;
|
|
43035
|
-
if (!run3) throw new CliUsageError(
|
|
43036
|
-
|
|
43740
|
+
if (!run3) throw new CliUsageError(USAGE5);
|
|
43741
|
+
print5({ context, args, ...await run3({ client, appId, first, second }) });
|
|
43037
43742
|
};
|
|
43038
43743
|
var appUnpublish = async ({ context, args }) => {
|
|
43039
43744
|
const client = await appClient({ context, args });
|
|
43040
43745
|
const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
|
|
43041
43746
|
const app2 = await client.post("/api/apps/unpublish", { appId });
|
|
43042
|
-
|
|
43747
|
+
print5({
|
|
43043
43748
|
context,
|
|
43044
43749
|
args,
|
|
43045
43750
|
value: app2,
|
|
@@ -43084,19 +43789,19 @@ async function appOfWord({
|
|
|
43084
43789
|
var appCost = async ({ context, args }) => {
|
|
43085
43790
|
const { client, appId, name: name2 } = await appOfWord({ context, args, word: args.words[2] });
|
|
43086
43791
|
const cost = await client.post("/api/apps/cost", { appId });
|
|
43087
|
-
|
|
43792
|
+
print5({ context, args, value: cost, text: costText({ name: name2, cost }) });
|
|
43088
43793
|
};
|
|
43089
43794
|
var appBudget = async ({ context, args }) => {
|
|
43090
43795
|
const words = args.words.slice(2);
|
|
43091
43796
|
const [word2, amount] = words.length >= 2 ? words : [void 0, ...words];
|
|
43092
|
-
if (!amount) throw new CliUsageError(
|
|
43797
|
+
if (!amount) throw new CliUsageError(USAGE5);
|
|
43093
43798
|
const monthly = amount === "none" ? null : Number(amount);
|
|
43094
43799
|
if (monthly !== null && (!Number.isFinite(monthly) || monthly < 0.01)) {
|
|
43095
43800
|
throw new CliUsageError("The budget is an amount such as 5 or 12.50, or none");
|
|
43096
43801
|
}
|
|
43097
43802
|
const { client, appId, name: name2 } = await appOfWord({ context, args, word: word2 });
|
|
43098
43803
|
const cost = await client.post("/api/apps/budget", { appId, monthly });
|
|
43099
|
-
|
|
43804
|
+
print5({ context, args, value: cost, text: costText({ name: name2, cost }) });
|
|
43100
43805
|
};
|
|
43101
43806
|
function managed(command) {
|
|
43102
43807
|
return ({ context, args }) => command({
|
|
@@ -43133,6 +43838,19 @@ var APP_COMMANDS = {
|
|
|
43133
43838
|
trigger: ({ context, args }) => appTrigger({ context, args, open: () => appOfWord({ context, args, word: void 0 }) }),
|
|
43134
43839
|
connections: ({ context, args }) => appConnections({ context, args, open: () => appOfWord({ context, args, word: void 0 }) }),
|
|
43135
43840
|
connection: ({ context, args }) => appConnection({ context, args, open: () => appOfWord({ context, args, word: void 0 }) }),
|
|
43841
|
+
pin: ({ context, args }) => appPinCommand({
|
|
43842
|
+
context,
|
|
43843
|
+
args,
|
|
43844
|
+
verb: "pin",
|
|
43845
|
+
open: () => appOfWord({ context, args, word: args.words[2] })
|
|
43846
|
+
}),
|
|
43847
|
+
unpin: ({ context, args }) => appPinCommand({
|
|
43848
|
+
context,
|
|
43849
|
+
args,
|
|
43850
|
+
verb: "unpin",
|
|
43851
|
+
open: () => appOfWord({ context, args, word: args.words[2] })
|
|
43852
|
+
}),
|
|
43853
|
+
pins: ({ context, args }) => appPinsCommand({ context, args, signed: () => appClient({ context, args }) }),
|
|
43136
43854
|
rename: managed(appManageCommands.rename),
|
|
43137
43855
|
archive: managed(appManageCommands.archive),
|
|
43138
43856
|
unarchive: managed(appManageCommands.unarchive),
|
|
@@ -43150,7 +43868,7 @@ async function app({ context, args }) {
|
|
|
43150
43868
|
const name2 = args.words[1] ?? "";
|
|
43151
43869
|
const command = Object.hasOwn(APP_COMMANDS, name2) ? APP_COMMANDS[name2] : void 0;
|
|
43152
43870
|
if (!command) {
|
|
43153
|
-
context.out(`${
|
|
43871
|
+
context.out(`${USAGE5}
|
|
43154
43872
|
`);
|
|
43155
43873
|
if (name2) throw new CliUsageError(`laze app has no command ${name2}`);
|
|
43156
43874
|
return;
|
|
@@ -43182,8 +43900,14 @@ async function login({ context, args }) {
|
|
|
43182
43900
|
const given = flagText({ args, name: "token" });
|
|
43183
43901
|
const token2 = given || await deviceToken({ context, url: url2, args });
|
|
43184
43902
|
const profile = await profileOf({ context, url: url2, token: token2 });
|
|
43185
|
-
|
|
43186
|
-
context.
|
|
43903
|
+
const here = Boolean(args.flags.here);
|
|
43904
|
+
await context.store.saveProfile({
|
|
43905
|
+
name: name2,
|
|
43906
|
+
profile,
|
|
43907
|
+
...here && { bindDirectory: context.cwd, onlyThere: true }
|
|
43908
|
+
});
|
|
43909
|
+
const where = here ? `, used in ${context.cwd} and below` : "";
|
|
43910
|
+
context.out(`Signed in to ${url2} as ${profile.name} (profile "${name2}"${where}).
|
|
43187
43911
|
`);
|
|
43188
43912
|
}
|
|
43189
43913
|
async function deviceToken({
|
|
@@ -43797,7 +44521,7 @@ var PATHS2 = {
|
|
|
43797
44521
|
wake: "/api/compute/machines/wake",
|
|
43798
44522
|
delete: "/api/compute/machines/delete"
|
|
43799
44523
|
};
|
|
43800
|
-
var
|
|
44524
|
+
var USAGE6 = [
|
|
43801
44525
|
"Usage: laze browser setup <site> [--name <machine>] a machine with Chrome a person signs in on",
|
|
43802
44526
|
" laze browser setup <site> --on <machine> the same on a person's own machine (laze machine list)",
|
|
43803
44527
|
" laze browser cdp <machine> a CDP address for this turn (Playwright connectOverCDP)",
|
|
@@ -43834,12 +44558,12 @@ function statusLine(machine2) {
|
|
|
43834
44558
|
}
|
|
43835
44559
|
function machineArg({ args }) {
|
|
43836
44560
|
const machine2 = args.words[2];
|
|
43837
|
-
if (!machine2) throw new CliUsageError(
|
|
44561
|
+
if (!machine2) throw new CliUsageError(USAGE6);
|
|
43838
44562
|
return machine2;
|
|
43839
44563
|
}
|
|
43840
44564
|
async function setup({ context, args }) {
|
|
43841
44565
|
const site = args.words[2];
|
|
43842
|
-
if (!site) throw new CliUsageError(
|
|
44566
|
+
if (!site) throw new CliUsageError(USAGE6);
|
|
43843
44567
|
const name2 = flagText({ args, name: "name" }) || void 0;
|
|
43844
44568
|
const on = flagText({ args, name: "on" }) || void 0;
|
|
43845
44569
|
const client = await computeClient({ context, args });
|
|
@@ -43913,7 +44637,7 @@ async function bridge({ context }) {
|
|
|
43913
44637
|
const env = context.environment.inherited;
|
|
43914
44638
|
const target = env.LAZE_CDP_TARGET;
|
|
43915
44639
|
const expiresAt = env.LAZE_CDP_EXPIRES_AT;
|
|
43916
|
-
if (!target || !expiresAt) throw new CliUsageError(
|
|
44640
|
+
if (!target || !expiresAt) throw new CliUsageError(USAGE6);
|
|
43917
44641
|
let until = Temporal3.Instant.from(expiresAt).epochMilliseconds;
|
|
43918
44642
|
const running = await startCdpBridge({
|
|
43919
44643
|
target,
|
|
@@ -43979,7 +44703,7 @@ async function browser({ context, args }) {
|
|
|
43979
44703
|
if (command === "status") return status({ context, args });
|
|
43980
44704
|
if (command === "sleep" || command === "wake" || command === "delete")
|
|
43981
44705
|
return change({ context, args, path: PATHS2[command] });
|
|
43982
|
-
throw new CliUsageError(
|
|
44706
|
+
throw new CliUsageError(USAGE6);
|
|
43983
44707
|
}
|
|
43984
44708
|
|
|
43985
44709
|
// src/rules/channel-format.rules.ts
|
|
@@ -44106,7 +44830,7 @@ async function changing({
|
|
|
44106
44830
|
await change2();
|
|
44107
44831
|
return void 0;
|
|
44108
44832
|
} catch (error62) {
|
|
44109
|
-
const refused = error62 instanceof LazeApiError && profile.kind === "agent" &&
|
|
44833
|
+
const refused = error62 instanceof LazeApiError && profile.kind === "agent" && ["agent_restricted", "permission_denied", "channel_admin_required"].includes(error62.code);
|
|
44110
44834
|
if (!refused) throw error62;
|
|
44111
44835
|
context.err(`laze: ${error62.message} (${error62.code})
|
|
44112
44836
|
${AGENT_HINT}`);
|
|
@@ -44250,7 +44974,7 @@ async function changing2({
|
|
|
44250
44974
|
await change2();
|
|
44251
44975
|
return void 0;
|
|
44252
44976
|
} catch (error62) {
|
|
44253
|
-
const refused = error62 instanceof LazeApiError && profile.kind === "agent" &&
|
|
44977
|
+
const refused = error62 instanceof LazeApiError && profile.kind === "agent" && ["agent_restricted", "permission_denied", "channel_admin_required"].includes(error62.code);
|
|
44254
44978
|
if (!refused) throw error62;
|
|
44255
44979
|
context.err(`laze: ${error62.message} (${error62.code})
|
|
44256
44980
|
${AGENT_HINT2}`);
|
|
@@ -44540,7 +45264,7 @@ function numberFlag(args, name2) {
|
|
|
44540
45264
|
if (!Number.isInteger(value) || value < 0) throw new CliUsageError(CHAT_ACTIONS_USAGE);
|
|
44541
45265
|
return value;
|
|
44542
45266
|
}
|
|
44543
|
-
function
|
|
45267
|
+
function print6({
|
|
44544
45268
|
context,
|
|
44545
45269
|
args,
|
|
44546
45270
|
answer: answer4,
|
|
@@ -44557,7 +45281,7 @@ var lineOf2 = (message2) => {
|
|
|
44557
45281
|
var linesOf = (messages, empty) => messages.map(lineOf2).join("") || empty;
|
|
44558
45282
|
var thread = async ({ context, args, client }) => {
|
|
44559
45283
|
const answer4 = await client.post(CHAT_KEY_PATHS.thread, { messageId: wordAt(args, 1) });
|
|
44560
|
-
|
|
45284
|
+
print6({ context, args, answer: answer4, text: (it) => linesOf([it.root, ...it.replies], "") });
|
|
44561
45285
|
};
|
|
44562
45286
|
var threadFollow = async ({ context, args, client }) => {
|
|
44563
45287
|
const following = !args.flags.off;
|
|
@@ -44565,7 +45289,7 @@ var threadFollow = async ({ context, args, client }) => {
|
|
|
44565
45289
|
messageId: wordAt(args, 2),
|
|
44566
45290
|
following
|
|
44567
45291
|
});
|
|
44568
|
-
|
|
45292
|
+
print6({
|
|
44569
45293
|
context,
|
|
44570
45294
|
args,
|
|
44571
45295
|
answer: answer4,
|
|
@@ -44576,7 +45300,7 @@ var threadFollowing = async ({ context, args, client }) => {
|
|
|
44576
45300
|
const answer4 = await client.post(CHAT_KEY_PATHS.threadFollow, {
|
|
44577
45301
|
messageId: wordAt(args, 2)
|
|
44578
45302
|
});
|
|
44579
|
-
|
|
45303
|
+
print6({
|
|
44580
45304
|
context,
|
|
44581
45305
|
args,
|
|
44582
45306
|
answer: answer4,
|
|
@@ -44587,7 +45311,7 @@ var threadRead = async ({ context, args, client }) => {
|
|
|
44587
45311
|
const answer4 = await client.post(CHAT_KEY_PATHS.markThreadRead, {
|
|
44588
45312
|
messageId: wordAt(args, 2)
|
|
44589
45313
|
});
|
|
44590
|
-
|
|
45314
|
+
print6({ context, args, answer: answer4, text: () => "Marked the thread read.\n" });
|
|
44591
45315
|
};
|
|
44592
45316
|
var THREAD_VERBS = {
|
|
44593
45317
|
follow: threadFollow,
|
|
@@ -44602,14 +45326,14 @@ var threadCommand = (input2) => {
|
|
|
44602
45326
|
var threads = async ({ context, args, client }) => {
|
|
44603
45327
|
if (args.words[1] === "unread") {
|
|
44604
45328
|
const answer5 = await client.post(CHAT_KEY_PATHS.threadsUnread, {});
|
|
44605
|
-
return
|
|
45329
|
+
return print6({ context, args, answer: answer5, text: (it) => `${it.unread} unread
|
|
44606
45330
|
` });
|
|
44607
45331
|
}
|
|
44608
45332
|
const limit = numberFlag(args, "limit");
|
|
44609
45333
|
const answer4 = await client.post(CHAT_KEY_PATHS.threads, {
|
|
44610
45334
|
...limit !== void 0 && { limit }
|
|
44611
45335
|
});
|
|
44612
|
-
|
|
45336
|
+
print6({
|
|
44613
45337
|
context,
|
|
44614
45338
|
args,
|
|
44615
45339
|
answer: answer4,
|
|
@@ -44627,21 +45351,21 @@ var MESSAGE_VERBS = {
|
|
|
44627
45351
|
messageId: wordAt(args, 2),
|
|
44628
45352
|
body
|
|
44629
45353
|
});
|
|
44630
|
-
|
|
45354
|
+
print6({ context, args, answer: answer4, text: (it) => `Edited ${it.id}.
|
|
44631
45355
|
` });
|
|
44632
45356
|
},
|
|
44633
45357
|
delete: async ({ context, args, client }) => {
|
|
44634
45358
|
const answer4 = await client.post(CHAT_KEY_PATHS.delete, {
|
|
44635
45359
|
messageId: wordAt(args, 2)
|
|
44636
45360
|
});
|
|
44637
|
-
|
|
45361
|
+
print6({ context, args, answer: answer4, text: (it) => `Deleted ${it.id}.
|
|
44638
45362
|
` });
|
|
44639
45363
|
},
|
|
44640
45364
|
remove: async ({ context, args, client }) => {
|
|
44641
45365
|
const answer4 = await client.post(CHAT_KEY_PATHS.remove, {
|
|
44642
45366
|
messageId: wordAt(args, 2)
|
|
44643
45367
|
});
|
|
44644
|
-
|
|
45368
|
+
print6({ context, args, answer: answer4, text: (it) => `Removed ${it.id}.
|
|
44645
45369
|
` });
|
|
44646
45370
|
},
|
|
44647
45371
|
react: async ({ context, args, client }) => {
|
|
@@ -44649,7 +45373,7 @@ var MESSAGE_VERBS = {
|
|
|
44649
45373
|
messageId: wordAt(args, 2),
|
|
44650
45374
|
emoji: wordAt(args, 3)
|
|
44651
45375
|
});
|
|
44652
|
-
|
|
45376
|
+
print6({
|
|
44653
45377
|
context,
|
|
44654
45378
|
args,
|
|
44655
45379
|
answer: answer4,
|
|
@@ -44663,14 +45387,14 @@ var MESSAGE_VERBS = {
|
|
|
44663
45387
|
messageId: wordAt(args, 2),
|
|
44664
45388
|
pinned
|
|
44665
45389
|
});
|
|
44666
|
-
|
|
45390
|
+
print6({ context, args, answer: answer4, text: (it) => `${pinned ? "Pinned" : "Unpinned"} ${it.id}.
|
|
44667
45391
|
` });
|
|
44668
45392
|
},
|
|
44669
45393
|
restore: async ({ context, args, client }) => {
|
|
44670
45394
|
const answer4 = await client.post(CHAT_KEY_PATHS.restoreScrubbed, {
|
|
44671
45395
|
messageId: wordAt(args, 2)
|
|
44672
45396
|
});
|
|
44673
|
-
|
|
45397
|
+
print6({ context, args, answer: answer4, text: (it) => `Restored ${it.id}.
|
|
44674
45398
|
` });
|
|
44675
45399
|
}
|
|
44676
45400
|
};
|
|
@@ -44682,7 +45406,7 @@ var message = (input2) => {
|
|
|
44682
45406
|
};
|
|
44683
45407
|
var pins = async ({ context, args, client }) => {
|
|
44684
45408
|
const answer4 = await client.post(CHAT_KEY_PATHS.pins, { channel: wordAt(args, 1) });
|
|
44685
|
-
|
|
45409
|
+
print6({ context, args, answer: answer4, text: (it) => linesOf(it.messages, "No pinned messages.\n") });
|
|
44686
45410
|
};
|
|
44687
45411
|
var channelRead = async ({ context, args, client }) => {
|
|
44688
45412
|
const seq = numberFlag(args, "seq");
|
|
@@ -44690,7 +45414,7 @@ var channelRead = async ({ context, args, client }) => {
|
|
|
44690
45414
|
channel: wordAt(args, 2),
|
|
44691
45415
|
...seq !== void 0 && { seq }
|
|
44692
45416
|
});
|
|
44693
|
-
|
|
45417
|
+
print6({ context, args, answer: answer4, text: (it) => `Read up to ${it.lastReadSeq}.
|
|
44694
45418
|
` });
|
|
44695
45419
|
};
|
|
44696
45420
|
var channelUnread = async ({ context, args, client }) => {
|
|
@@ -44700,7 +45424,7 @@ var channelUnread = async ({ context, args, client }) => {
|
|
|
44700
45424
|
channel: wordAt(args, 2),
|
|
44701
45425
|
seq
|
|
44702
45426
|
});
|
|
44703
|
-
|
|
45427
|
+
print6({ context, args, answer: answer4, text: (it) => `Read up to ${it.lastReadSeq}.
|
|
44704
45428
|
` });
|
|
44705
45429
|
};
|
|
44706
45430
|
var files = async ({ context, args, client }) => {
|
|
@@ -44711,7 +45435,7 @@ var files = async ({ context, args, client }) => {
|
|
|
44711
45435
|
...before && { before },
|
|
44712
45436
|
...limit !== void 0 && { limit }
|
|
44713
45437
|
});
|
|
44714
|
-
|
|
45438
|
+
print6({
|
|
44715
45439
|
context,
|
|
44716
45440
|
args,
|
|
44717
45441
|
answer: answer4,
|
|
@@ -44757,7 +45481,7 @@ var fileUpload = async ({ context, args, client }) => {
|
|
|
44757
45481
|
attachmentId,
|
|
44758
45482
|
parts
|
|
44759
45483
|
});
|
|
44760
|
-
|
|
45484
|
+
print6({ context, args, answer: answer4, text: (it) => `Uploaded ${it.fileName} as ${it.id}.
|
|
44761
45485
|
` });
|
|
44762
45486
|
} catch (cause) {
|
|
44763
45487
|
await client.post(CHAT_KEY_PATHS.abortUpload, { attachmentId }).catch(() => void 0);
|
|
@@ -44772,7 +45496,7 @@ var FILE_VERBS = {
|
|
|
44772
45496
|
...variant && { variant },
|
|
44773
45497
|
download: Boolean(args.flags.download)
|
|
44774
45498
|
});
|
|
44775
|
-
|
|
45499
|
+
print6({ context, args, answer: answer4, text: (it) => `${it.url}
|
|
44776
45500
|
` });
|
|
44777
45501
|
},
|
|
44778
45502
|
rename: async ({ context, args, client }) => {
|
|
@@ -44782,7 +45506,7 @@ var FILE_VERBS = {
|
|
|
44782
45506
|
attachmentId: wordAt(args, 2),
|
|
44783
45507
|
fileName
|
|
44784
45508
|
});
|
|
44785
|
-
|
|
45509
|
+
print6({ context, args, answer: answer4, text: (it) => `Renamed ${it.id} to ${it.fileName}.
|
|
44786
45510
|
` });
|
|
44787
45511
|
},
|
|
44788
45512
|
upload: fileUpload
|
|
@@ -44798,7 +45522,7 @@ var savedStatusText = (it) => `${it.saved ? "saved" : "not saved"}${it.doneAt ?
|
|
|
44798
45522
|
var SAVED_VERBS = {
|
|
44799
45523
|
marks: async ({ context, args, client }) => {
|
|
44800
45524
|
const answer4 = await client.post(CHAT_KEY_PATHS.savedMarks, {});
|
|
44801
|
-
|
|
45525
|
+
print6({
|
|
44802
45526
|
context,
|
|
44803
45527
|
args,
|
|
44804
45528
|
answer: answer4,
|
|
@@ -44811,7 +45535,7 @@ var SAVED_VERBS = {
|
|
|
44811
45535
|
messageId: wordAt(args, 2),
|
|
44812
45536
|
done: !args.flags.undo
|
|
44813
45537
|
});
|
|
44814
|
-
|
|
45538
|
+
print6({ context, args, answer: answer4, text: savedStatusText });
|
|
44815
45539
|
},
|
|
44816
45540
|
remind: async ({ context, args, client }) => {
|
|
44817
45541
|
const when = wordAt(args, 3);
|
|
@@ -44819,7 +45543,7 @@ var SAVED_VERBS = {
|
|
|
44819
45543
|
messageId: wordAt(args, 2),
|
|
44820
45544
|
remindAt: when === "off" ? null : when
|
|
44821
45545
|
});
|
|
44822
|
-
|
|
45546
|
+
print6({ context, args, answer: answer4, text: savedStatusText });
|
|
44823
45547
|
}
|
|
44824
45548
|
};
|
|
44825
45549
|
var saved2 = async (input2) => {
|
|
@@ -44835,7 +45559,7 @@ var saved2 = async (input2) => {
|
|
|
44835
45559
|
state: args.flags.done ? "done" : "open",
|
|
44836
45560
|
...limit !== void 0 && { limit }
|
|
44837
45561
|
});
|
|
44838
|
-
|
|
45562
|
+
print6({
|
|
44839
45563
|
context,
|
|
44840
45564
|
args,
|
|
44841
45565
|
answer: answer4,
|
|
@@ -44848,14 +45572,14 @@ var save = async ({ context, args, client }) => {
|
|
|
44848
45572
|
messageId: wordAt(args, 1),
|
|
44849
45573
|
saved: !args.flags.off
|
|
44850
45574
|
});
|
|
44851
|
-
|
|
45575
|
+
print6({ context, args, answer: answer4, text: savedStatusText });
|
|
44852
45576
|
};
|
|
44853
45577
|
var starTo = (starred) => async ({ context, args, client }) => {
|
|
44854
45578
|
const answer4 = await client.post(CHAT_KEY_PATHS.star, {
|
|
44855
45579
|
channel: wordAt(args, 2),
|
|
44856
45580
|
starred
|
|
44857
45581
|
});
|
|
44858
|
-
|
|
45582
|
+
print6({
|
|
44859
45583
|
context,
|
|
44860
45584
|
args,
|
|
44861
45585
|
answer: answer4,
|
|
@@ -44868,7 +45592,7 @@ var STAR_VERBS = {
|
|
|
44868
45592
|
remove: starTo(false),
|
|
44869
45593
|
list: async ({ context, args, client }) => {
|
|
44870
45594
|
const answer4 = await client.post(CHAT_KEY_PATHS.starred, {});
|
|
44871
|
-
|
|
45595
|
+
print6({
|
|
44872
45596
|
context,
|
|
44873
45597
|
args,
|
|
44874
45598
|
answer: answer4,
|
|
@@ -45205,6 +45929,8 @@ var accountChangedDefinition = external_exports.object({
|
|
|
45205
45929
|
currency: currencySchema,
|
|
45206
45930
|
seats: external_exports.number().int().nonnegative(),
|
|
45207
45931
|
extraSeats: external_exports.number().int().nonnegative().optional(),
|
|
45932
|
+
/** People a complimentary Team holds; absent or null when the plan sets the limit. */
|
|
45933
|
+
seatCap: external_exports.number().int().positive().nullable().optional(),
|
|
45208
45934
|
at: external_exports.iso.datetime()
|
|
45209
45935
|
});
|
|
45210
45936
|
var usageRecordedDefinition = external_exports.object({
|
|
@@ -45254,6 +45980,8 @@ var billingAccountViewDefinition = external_exports.object({
|
|
|
45254
45980
|
/** What the plan costs a month for these people; 0 on Free. */
|
|
45255
45981
|
monthlyPrice: external_exports.number().nonnegative()
|
|
45256
45982
|
}),
|
|
45983
|
+
/** Team given free of charge by Laze staff, for this many people; null when paid or Free. */
|
|
45984
|
+
complimentary: external_exports.object({ seats: external_exports.number().int().positive() }).nullable().default(null),
|
|
45257
45985
|
credits: external_exports.object({
|
|
45258
45986
|
/** Included this period by the plan. */
|
|
45259
45987
|
included: external_exports.number(),
|
|
@@ -45370,6 +46098,11 @@ var setAutoRechargeByKeyInputDefinition = setAutoRechargeInputDefinition.omit({
|
|
|
45370
46098
|
workspaceId: true
|
|
45371
46099
|
});
|
|
45372
46100
|
var applyReferralByKeyInputDefinition = applyReferralInputDefinition.omit({ workspaceId: true });
|
|
46101
|
+
var setComplimentaryPlanInputDefinition = external_exports.object({
|
|
46102
|
+
workspaceId: external_exports.string().min(1),
|
|
46103
|
+
seats: external_exports.number().int().positive().max(1e4).nullable(),
|
|
46104
|
+
reason: external_exports.string().trim().min(3).max(500)
|
|
46105
|
+
});
|
|
45373
46106
|
var BillingApi = moduleApi()("billing");
|
|
45374
46107
|
var billingTrpc = defineTrpcContract("billing").query("account").withInput(billingWorkspaceInputSchema).withOutput(billingAccountViewSchema).query("invoices").withInput(billingWorkspaceInputSchema).withOutput(external_exports.array(billingInvoiceSchema)).mutation("startCheckout").withInput(startCheckoutInputSchema).withOutput(billingRedirectSchema).mutation("openPortal").withInput(openPortalInputSchema).withOutput(billingRedirectSchema).mutation("setCurrency").withInput(setCurrencyInputSchema).withOutput(billingAccountViewSchema).mutation("topUp").withInput(topUpInputSchema).withOutput(billingRedirectSchema).mutation("setAutoRecharge").withInput(setAutoRechargeInputSchema).withOutput(billingAccountViewSchema).mutation("applyReferral").withInput(applyReferralInputSchema).withOutput(billingAccountViewSchema).build();
|
|
45375
46108
|
var stripeWebhookHeadersDefinition = external_exports.object({
|
|
@@ -45687,7 +46420,7 @@ var dedicatedIpKeyReleasedDefinition = external_exports.object({
|
|
|
45687
46420
|
});
|
|
45688
46421
|
|
|
45689
46422
|
// ../../modules/compute/contract/src/own-machine-ssh.ts
|
|
45690
|
-
var
|
|
46423
|
+
var workspaceIdSchema12 = external_exports.string().min(1).max(64);
|
|
45691
46424
|
var machineRefText = external_exports.string().min(1).max(64);
|
|
45692
46425
|
var sshHostKeySchema = external_exports.string().regex(/^SHA256:[A-Za-z0-9+/]{43}$/);
|
|
45693
46426
|
function sshTargetText({ target }) {
|
|
@@ -45709,7 +46442,7 @@ var machineSshDefinition = external_exports.object({
|
|
|
45709
46442
|
});
|
|
45710
46443
|
var machineSshSchema = machineSshDefinition;
|
|
45711
46444
|
var connectSshDefinition = external_exports.object({
|
|
45712
|
-
workspaceId:
|
|
46445
|
+
workspaceId: workspaceIdSchema12,
|
|
45713
46446
|
/** Checked by `checkMachineName`, so a refusal reads as a sentence. */
|
|
45714
46447
|
name: external_exports.string().max(200),
|
|
45715
46448
|
/** `user@host[:port]`, checked by `parseSshTarget`. */
|
|
@@ -45718,7 +46451,7 @@ var connectSshDefinition = external_exports.object({
|
|
|
45718
46451
|
var connectSshMachineInputSchema = connectSshDefinition;
|
|
45719
46452
|
var restConnectSshDefinition = connectSshDefinition.omit({ workspaceId: true });
|
|
45720
46453
|
var trustHostKeyDefinition = external_exports.object({
|
|
45721
|
-
workspaceId:
|
|
46454
|
+
workspaceId: workspaceIdSchema12,
|
|
45722
46455
|
machine: machineRefText,
|
|
45723
46456
|
hostKey: sshHostKeySchema
|
|
45724
46457
|
});
|
|
@@ -45726,7 +46459,7 @@ var trustHostKeyInputSchema = trustHostKeyDefinition;
|
|
|
45726
46459
|
var restTrustHostKeyDefinition = trustHostKeyDefinition.omit({ workspaceId: true });
|
|
45727
46460
|
|
|
45728
46461
|
// ../../modules/compute/contract/src/own-machine-whatsapp.ts
|
|
45729
|
-
var
|
|
46462
|
+
var workspaceIdSchema13 = external_exports.string().min(1).max(64);
|
|
45730
46463
|
var machineRefText2 = external_exports.string().min(1).max(64);
|
|
45731
46464
|
var WHATSAPP_TEXT_MAX = 4096;
|
|
45732
46465
|
var WHATSAPP_LIMIT_MAX = 200;
|
|
@@ -45763,25 +46496,25 @@ var messagesResultDefinition = external_exports.object({
|
|
|
45763
46496
|
var limitSchema = external_exports.number().int().min(1).max(WHATSAPP_LIMIT_MAX);
|
|
45764
46497
|
var chatRefSchema = external_exports.string().trim().min(1).max(200);
|
|
45765
46498
|
var chatsInputDefinition = external_exports.object({
|
|
45766
|
-
workspaceId:
|
|
46499
|
+
workspaceId: workspaceIdSchema13,
|
|
45767
46500
|
machine: machineRefText2,
|
|
45768
46501
|
limit: limitSchema.optional()
|
|
45769
46502
|
});
|
|
45770
46503
|
var readInputDefinition = external_exports.object({
|
|
45771
|
-
workspaceId:
|
|
46504
|
+
workspaceId: workspaceIdSchema13,
|
|
45772
46505
|
machine: machineRefText2,
|
|
45773
46506
|
/** A chat id, a phone number or a contact or group name. */
|
|
45774
46507
|
chat: chatRefSchema,
|
|
45775
46508
|
limit: limitSchema.optional()
|
|
45776
46509
|
});
|
|
45777
46510
|
var sendInputDefinition = external_exports.object({
|
|
45778
|
-
workspaceId:
|
|
46511
|
+
workspaceId: workspaceIdSchema13,
|
|
45779
46512
|
machine: machineRefText2,
|
|
45780
46513
|
chat: chatRefSchema,
|
|
45781
46514
|
text: external_exports.string().trim().min(1).max(WHATSAPP_TEXT_MAX)
|
|
45782
46515
|
});
|
|
45783
46516
|
var sendStatusInputDefinition = external_exports.object({
|
|
45784
|
-
workspaceId:
|
|
46517
|
+
workspaceId: workspaceIdSchema13,
|
|
45785
46518
|
sendId: external_exports.string().min(1).max(64),
|
|
45786
46519
|
/** Wait up to this long for the owner's answer; 0 answers at once. */
|
|
45787
46520
|
waitSeconds: external_exports.number().int().min(0).max(WHATSAPP_STATUS_WAIT_MAX_SECONDS).default(0)
|
|
@@ -45819,7 +46552,7 @@ var whatsappPairingDefinition = external_exports.object({
|
|
|
45819
46552
|
});
|
|
45820
46553
|
var whatsappPairingSchema = whatsappPairingDefinition;
|
|
45821
46554
|
var pairingRefDefinition = external_exports.object({
|
|
45822
|
-
workspaceId:
|
|
46555
|
+
workspaceId: workspaceIdSchema13,
|
|
45823
46556
|
pairingId: external_exports.string().min(1).max(64)
|
|
45824
46557
|
});
|
|
45825
46558
|
var whatsappPairingRefSchema = pairingRefDefinition;
|
|
@@ -45840,7 +46573,7 @@ var COMPUTE_WHATSAPP_REST_PATHS = {
|
|
|
45840
46573
|
};
|
|
45841
46574
|
|
|
45842
46575
|
// ../../modules/compute/contract/src/own-machine.ts
|
|
45843
|
-
var
|
|
46576
|
+
var workspaceIdSchema14 = external_exports.string().min(1).max(64);
|
|
45844
46577
|
var machineRefText3 = external_exports.string().min(1).max(64);
|
|
45845
46578
|
var machineBrowserDefinition = external_exports.object({
|
|
45846
46579
|
ready: external_exports.boolean(),
|
|
@@ -45873,7 +46606,7 @@ var machineHealthDefinition = external_exports.object({
|
|
|
45873
46606
|
});
|
|
45874
46607
|
var machineHealthSchema = machineHealthDefinition;
|
|
45875
46608
|
var connectOwnDefinition = external_exports.object({
|
|
45876
|
-
workspaceId:
|
|
46609
|
+
workspaceId: workspaceIdSchema14,
|
|
45877
46610
|
/** Checked by `checkMachineName`, so a refusal reads as a sentence. */
|
|
45878
46611
|
name: external_exports.string().max(200)
|
|
45879
46612
|
});
|
|
@@ -45881,7 +46614,7 @@ var connectOwnMachineInputSchema = connectOwnDefinition;
|
|
|
45881
46614
|
var MACHINE_EXEC_MAX_SECONDS = 240;
|
|
45882
46615
|
var MACHINE_EXEC_OUTPUT_BYTES = 1024 * 1024;
|
|
45883
46616
|
var execDefinition = external_exports.object({
|
|
45884
|
-
workspaceId:
|
|
46617
|
+
workspaceId: workspaceIdSchema14,
|
|
45885
46618
|
machine: machineRefText3,
|
|
45886
46619
|
command: external_exports.string().min(1).max(64 * 1024),
|
|
45887
46620
|
timeoutSeconds: external_exports.number().int().min(1).max(MACHINE_EXEC_MAX_SECONDS).optional(),
|
|
@@ -45953,14 +46686,14 @@ function gigabytes(bytes) {
|
|
|
45953
46686
|
}
|
|
45954
46687
|
var hostWhenOfflineSchema = external_exports.enum(["wait", "sandbox"]);
|
|
45955
46688
|
var hostAgentDefinition = external_exports.object({
|
|
45956
|
-
workspaceId:
|
|
46689
|
+
workspaceId: workspaceIdSchema14,
|
|
45957
46690
|
machine: machineRefText3,
|
|
45958
46691
|
agentId: external_exports.string().min(1).max(64),
|
|
45959
46692
|
whenOffline: hostWhenOfflineSchema.default("wait")
|
|
45960
46693
|
});
|
|
45961
46694
|
var hostAgentInputSchema = hostAgentDefinition;
|
|
45962
46695
|
var unhostAgentDefinition = external_exports.object({
|
|
45963
|
-
workspaceId:
|
|
46696
|
+
workspaceId: workspaceIdSchema14,
|
|
45964
46697
|
agentId: external_exports.string().min(1).max(64)
|
|
45965
46698
|
});
|
|
45966
46699
|
var unhostAgentInputSchema = unhostAgentDefinition;
|
|
@@ -45979,8 +46712,8 @@ var agentHostGrantDefinition = external_exports.object({
|
|
|
45979
46712
|
});
|
|
45980
46713
|
|
|
45981
46714
|
// ../../modules/compute/contract/src/compute.ts
|
|
45982
|
-
var
|
|
45983
|
-
var
|
|
46715
|
+
var idSchema17 = external_exports.string().min(1).max(64);
|
|
46716
|
+
var workspaceIdSchema15 = external_exports.string().min(1).max(64);
|
|
45984
46717
|
var machineStateSchema = external_exports.enum([
|
|
45985
46718
|
"starting",
|
|
45986
46719
|
"ready",
|
|
@@ -46001,24 +46734,24 @@ var machinePriceDefinition = external_exports.object({
|
|
|
46001
46734
|
asleepMonthUsd: external_exports.number()
|
|
46002
46735
|
});
|
|
46003
46736
|
var machineGranteeKindSchema = external_exports.enum(["member", "agent"]);
|
|
46004
|
-
var machineGranteeDefinition = external_exports.object({ kind: machineGranteeKindSchema, id:
|
|
46737
|
+
var machineGranteeDefinition = external_exports.object({ kind: machineGranteeKindSchema, id: idSchema17 });
|
|
46005
46738
|
var machineGrantDefinition = external_exports.object({
|
|
46006
46739
|
kind: machineGranteeKindSchema,
|
|
46007
|
-
id:
|
|
46008
|
-
grantedByUserId:
|
|
46740
|
+
id: idSchema17,
|
|
46741
|
+
grantedByUserId: idSchema17,
|
|
46009
46742
|
grantedAt: external_exports.iso.datetime()
|
|
46010
46743
|
});
|
|
46011
46744
|
var machineDefinition = external_exports.object({
|
|
46012
|
-
id:
|
|
46013
|
-
workspaceId:
|
|
46745
|
+
id: idSchema17,
|
|
46746
|
+
workspaceId: workspaceIdSchema15,
|
|
46014
46747
|
name: external_exports.string(),
|
|
46015
46748
|
type: machineTypeSchema,
|
|
46016
46749
|
zone: external_exports.string(),
|
|
46017
46750
|
state: machineStateSchema,
|
|
46018
|
-
ownerUserId:
|
|
46019
|
-
requesterUserId:
|
|
46020
|
-
renterAgentId:
|
|
46021
|
-
channelId:
|
|
46751
|
+
ownerUserId: idSchema17,
|
|
46752
|
+
requesterUserId: idSchema17,
|
|
46753
|
+
renterAgentId: idSchema17.nullable(),
|
|
46754
|
+
channelId: idSchema17.nullable(),
|
|
46022
46755
|
ipAddress: external_exports.string().nullable(),
|
|
46023
46756
|
sites: external_exports.array(machineSiteDefinition),
|
|
46024
46757
|
/** Members and agents the owner shared the machine with, beyond the owner's own agents. */
|
|
@@ -46050,7 +46783,7 @@ var machineDefinition = external_exports.object({
|
|
|
46050
46783
|
/** The owner's agents set to run on this own machine. */
|
|
46051
46784
|
hostedAgents: external_exports.array(
|
|
46052
46785
|
external_exports.object({
|
|
46053
|
-
id:
|
|
46786
|
+
id: idSchema17,
|
|
46054
46787
|
name: external_exports.string(),
|
|
46055
46788
|
whenOffline: external_exports.enum(["wait", "sandbox"])
|
|
46056
46789
|
})
|
|
@@ -46061,23 +46794,23 @@ var machineDefinition = external_exports.object({
|
|
|
46061
46794
|
var machineSchema = machineDefinition;
|
|
46062
46795
|
var computeStatusDefinition = external_exports.object({ available: external_exports.boolean() });
|
|
46063
46796
|
var computeStatusSchema = computeStatusDefinition;
|
|
46064
|
-
var workspaceInputDefinition2 = external_exports.object({ workspaceId:
|
|
46797
|
+
var workspaceInputDefinition2 = external_exports.object({ workspaceId: workspaceIdSchema15 });
|
|
46065
46798
|
var computeWorkspaceInputSchema = workspaceInputDefinition2;
|
|
46066
46799
|
var machineRefDefinition = external_exports.object({
|
|
46067
|
-
workspaceId:
|
|
46800
|
+
workspaceId: workspaceIdSchema15,
|
|
46068
46801
|
machine: external_exports.string().min(1).max(64)
|
|
46069
46802
|
});
|
|
46070
46803
|
var machineRefSchema = machineRefDefinition;
|
|
46071
46804
|
var MACHINE_NAME_MAX = 40;
|
|
46072
46805
|
var machineNameSchema = external_exports.string().min(2).max(MACHINE_NAME_MAX).regex(/^[a-z0-9][a-z0-9-]*$/, "lowercase letters, digits and dashes");
|
|
46073
46806
|
var renameDefinition = external_exports.object({
|
|
46074
|
-
workspaceId:
|
|
46807
|
+
workspaceId: workspaceIdSchema15,
|
|
46075
46808
|
machine: external_exports.string().min(1).max(64),
|
|
46076
46809
|
name: external_exports.string().max(200)
|
|
46077
46810
|
});
|
|
46078
46811
|
var renameMachineInputSchema = renameDefinition;
|
|
46079
46812
|
var setupBrowserDefinition = external_exports.object({
|
|
46080
|
-
workspaceId:
|
|
46813
|
+
workspaceId: workspaceIdSchema15,
|
|
46081
46814
|
/** The site the person signs in to, as a host or a URL. */
|
|
46082
46815
|
site: external_exports.string().min(1).max(500),
|
|
46083
46816
|
name: machineNameSchema.optional(),
|
|
@@ -46086,29 +46819,29 @@ var setupBrowserDefinition = external_exports.object({
|
|
|
46086
46819
|
});
|
|
46087
46820
|
var setupBrowserInputSchema = setupBrowserDefinition;
|
|
46088
46821
|
var grantDefinition = external_exports.object({
|
|
46089
|
-
workspaceId:
|
|
46822
|
+
workspaceId: workspaceIdSchema15,
|
|
46090
46823
|
machine: external_exports.string().min(1).max(64),
|
|
46091
46824
|
grantee: machineGranteeDefinition
|
|
46092
46825
|
});
|
|
46093
46826
|
var machineGrantInputSchema = grantDefinition;
|
|
46094
46827
|
var setBudgetDefinition = external_exports.object({
|
|
46095
|
-
workspaceId:
|
|
46828
|
+
workspaceId: workspaceIdSchema15,
|
|
46096
46829
|
machine: external_exports.string().min(1).max(64),
|
|
46097
46830
|
budgetUsd: external_exports.number().min(0).max(1e4),
|
|
46098
46831
|
period: machineBudgetPeriodSchema
|
|
46099
46832
|
});
|
|
46100
46833
|
var setMachineBudgetInputSchema = setBudgetDefinition;
|
|
46101
46834
|
var openScreenDefinition = external_exports.object({
|
|
46102
|
-
workspaceId:
|
|
46835
|
+
workspaceId: workspaceIdSchema15,
|
|
46103
46836
|
machine: external_exports.string().min(1).max(64),
|
|
46104
46837
|
site: external_exports.string().min(1).max(500).optional()
|
|
46105
46838
|
});
|
|
46106
46839
|
var openScreenInputSchema = openScreenDefinition;
|
|
46107
|
-
var screenRefDefinition = external_exports.object({ workspaceId:
|
|
46840
|
+
var screenRefDefinition = external_exports.object({ workspaceId: workspaceIdSchema15, sessionId: idSchema17 });
|
|
46108
46841
|
var screenRefSchema = screenRefDefinition;
|
|
46109
46842
|
var screenSessionDefinition = external_exports.object({
|
|
46110
|
-
sessionId:
|
|
46111
|
-
machineId:
|
|
46843
|
+
sessionId: idSchema17,
|
|
46844
|
+
machineId: idSchema17,
|
|
46112
46845
|
machineName: external_exports.string(),
|
|
46113
46846
|
site: external_exports.string().nullable(),
|
|
46114
46847
|
expiresAt: external_exports.iso.datetime(),
|
|
@@ -46142,11 +46875,9 @@ var ownMachineSshConnectDefinition = external_exports.object({
|
|
|
46142
46875
|
publicKey: external_exports.string()
|
|
46143
46876
|
});
|
|
46144
46877
|
var ownMachineSshConnectSchema = ownMachineSshConnectDefinition;
|
|
46145
|
-
var reconcileDefinition = external_exports.object({ workspaceId:
|
|
46878
|
+
var reconcileDefinition = external_exports.object({ workspaceId: workspaceIdSchema15, machineId: idSchema17 });
|
|
46146
46879
|
var ComputeApi = moduleApi()("compute");
|
|
46147
46880
|
var computeTrpc = defineTrpcContract("compute").query("status").withInput(computeWorkspaceInputSchema).withOutput(computeStatusSchema).query("computer").withInput(computeWorkspaceInputSchema).withOutput(computerStatusSchema).mutation("setComputerSize").withInput(setComputerSizeInputSchema).withOutput(computerSizeAnswerSchema).mutation("requestComputerSize").withInput(setComputerSizeInputSchema).withOutput(computerRequestSchema).mutation("cancelComputerRequest").withInput(computerRequestRefSchema).withOutput(computerRequestSchema).query("computers").withInput(computeWorkspaceInputSchema).withOutput(computerListSchema).query("dedicatedIp").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpStatusSchema).mutation("setDedicatedIp").withInput(setDedicatedIpInputSchema).withOutput(dedicatedIpAnswerSchema).mutation("turnOffDedicatedIp").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpAnswerSchema).mutation("setDedicatedIpDomains").withInput(setDedicatedIpDomainsInputSchema).withOutput(dedicatedIpAnswerSchema).query("dedicatedIps").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpListSchema).query("dedicatedIpCountries").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpCountriesSchema).query("dedicatedIpOffer").withInput(dedicatedIpOfferInputSchema).withOutput(dedicatedIpOfferSchema).query("list").withInput(computeWorkspaceInputSchema).withOutput(external_exports.array(machineSchema)).query("get").withInput(machineRefSchema).withOutput(machineSchema).mutation("setupBrowser").withInput(setupBrowserInputSchema).withOutput(machineSchema).mutation("sleep").withInput(machineRefSchema).withOutput(machineSchema).mutation("wake").withInput(machineRefSchema).withOutput(machineSchema).mutation("delete").withInput(machineRefSchema).withOutput(machineSchema).mutation("rename").withInput(renameMachineInputSchema).withOutput(machineSchema).mutation("grant").withInput(machineGrantInputSchema).withOutput(machineSchema).mutation("revokeGrant").withInput(machineGrantInputSchema).withOutput(machineSchema).mutation("setBudget").withInput(setMachineBudgetInputSchema).withOutput(machineSchema).mutation("openScreen").withInput(openScreenInputSchema).withOutput(screenSessionSchema).mutation("finishScreen").withInput(screenRefSchema).withOutput(machineSchema).mutation("connectOwn").withInput(connectOwnMachineInputSchema).withOutput(ownMachineConnectSchema).mutation("newConnectCommand").withInput(machineRefSchema).withOutput(ownMachineConnectSchema).mutation("connectSsh").withInput(connectSshMachineInputSchema).withOutput(ownMachineSshConnectSchema).mutation("trustHostKey").withInput(trustHostKeyInputSchema).withOutput(machineSchema).mutation("checkHealth").withInput(machineRefSchema).withOutput(machineSchema).mutation("hostAgent").withInput(hostAgentInputSchema).withOutput(machineSchema).mutation("unhostAgent").withInput(unhostAgentInputSchema).withOutput(external_exports.object({ agentId: external_exports.string() })).mutation("pairWhatsapp").withInput(machineRefSchema).withOutput(whatsappPairingSchema).query("whatsappPairing").withInput(whatsappPairingRefSchema).withOutput(whatsappPairingSchema).mutation("cancelWhatsappPairing").withInput(whatsappPairingRefSchema).withOutput(whatsappPairingSchema).mutation("unpairWhatsapp").withInput(machineRefSchema).withOutput(machineSchema).build();
|
|
46148
|
-
var computeUi = uiTokens("compute");
|
|
46149
|
-
var ComputeNavSlot = computeUi.component("nav");
|
|
46150
46881
|
var restMachineInputDefinition = external_exports.object({ machine: external_exports.string().min(1).max(64) });
|
|
46151
46882
|
var restRenameInputDefinition = external_exports.object({
|
|
46152
46883
|
machine: external_exports.string().min(1).max(64),
|
|
@@ -47424,16 +48155,16 @@ function dndLine({ pausedUntil }) {
|
|
|
47424
48155
|
}
|
|
47425
48156
|
|
|
47426
48157
|
// src/services/dnd-commands.service.ts
|
|
47427
|
-
var
|
|
48158
|
+
var USAGE7 = "Usage: laze dnd 30m|1h|2h|until <HH:mm|ISO time> [--tz <zone>], laze dnd off";
|
|
47428
48159
|
async function dnd({ context, args }) {
|
|
47429
48160
|
const timeZone = flagText({ args, name: "tz" }) || Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
47430
48161
|
let input2;
|
|
47431
48162
|
try {
|
|
47432
48163
|
input2 = dndInputOf({ words: args.words.slice(1), now: nowInstant(), timeZone });
|
|
47433
48164
|
} catch {
|
|
47434
|
-
throw new CliUsageError(
|
|
48165
|
+
throw new CliUsageError(USAGE7);
|
|
47435
48166
|
}
|
|
47436
|
-
if (!input2) throw new CliUsageError(
|
|
48167
|
+
if (!input2) throw new CliUsageError(USAGE7);
|
|
47437
48168
|
const { client } = await signedIn({ context, args });
|
|
47438
48169
|
const settings2 = await client.post(
|
|
47439
48170
|
"/api/agents/me/notifications/snooze",
|
|
@@ -47544,18 +48275,22 @@ function feedFlagsOf({ args }) {
|
|
|
47544
48275
|
if (brief) fields.brief = dateOf(brief);
|
|
47545
48276
|
const briefClass = flagText({ args, name: "class" });
|
|
47546
48277
|
if (briefClass) fields.briefClass = briefClass;
|
|
48278
|
+
const autoSendOn = flagText({ args, name: "auto-send-on" });
|
|
48279
|
+
if (autoSendOn) fields.autoSendOn = dateOf(autoSendOn);
|
|
47547
48280
|
return { fields: { ...fields, ...snoozeOf(args) }, texts };
|
|
47548
48281
|
}
|
|
47549
48282
|
|
|
47550
48283
|
// src/services/feed-commands.service.ts
|
|
47551
|
-
var
|
|
48284
|
+
var USAGE8 = `Usage:
|
|
47552
48285
|
laze feed post <title> [--channel <channel>] [--tag <tag>] [--summary <line>]
|
|
47553
48286
|
[--body <text|@file>] [--draft <text|@file>] [--draft-header "To: ...\\nRe: ..."]
|
|
47554
48287
|
[--link <label>=<url>]... [--action <label>=<message>]... [--to <userId>]...
|
|
47555
48288
|
[--urgent] [--done-label <line>] [--show-at <ISO time>]
|
|
47556
48289
|
[--snooze-for <userId>... --until <ISO time>]
|
|
47557
48290
|
[--brief <YYYY-MM-DD> [--class money|promise|decide|nudge|risk|fyi]] [--loop <key>]
|
|
48291
|
+
[--auto-send-on <YYYY-MM-DD>]
|
|
47558
48292
|
laze feed update <id> [the post flags that change] [--title <title>]
|
|
48293
|
+
[--auto-send-on <YYYY-MM-DD>|none]
|
|
47559
48294
|
[--show-at <ISO time>|none] [--snooze-for <userId>... --until <ISO time>|none] [--reopen]
|
|
47560
48295
|
laze feed reply <id> <text> [--urgent]
|
|
47561
48296
|
laze feed read <id>
|
|
@@ -47592,7 +48327,9 @@ function printItem({
|
|
|
47592
48327
|
}) {
|
|
47593
48328
|
if (args.flags.json) return context.out(`${JSON.stringify(item, null, 2)}
|
|
47594
48329
|
`);
|
|
47595
|
-
const
|
|
48330
|
+
const shownAt = item.item.showAt ? ` (shows ${item.item.showAt})` : "";
|
|
48331
|
+
const countdown = item.item.autoSendOn ? ` (auto-sends on ${item.item.autoSendOn})` : "";
|
|
48332
|
+
const shown = `${shownAt}${countdown}`;
|
|
47596
48333
|
context.out(`${item.item.id} ${item.item.tag} ${item.item.title}${shown}
|
|
47597
48334
|
`);
|
|
47598
48335
|
for (const message2 of item.messages) context.out(` > ${message2}
|
|
@@ -47600,7 +48337,7 @@ function printItem({
|
|
|
47600
48337
|
}
|
|
47601
48338
|
async function feedPost({ context, args }) {
|
|
47602
48339
|
const title = args.words.slice(2).join(" ").trim();
|
|
47603
|
-
if (!title) throw new CliUsageError(
|
|
48340
|
+
if (!title) throw new CliUsageError(USAGE8);
|
|
47604
48341
|
const flags2 = flagsOf(args);
|
|
47605
48342
|
const { client } = await signedIn({ context, args });
|
|
47606
48343
|
const channel = flagText({ args, name: "channel" });
|
|
@@ -47619,7 +48356,7 @@ async function feedPost({ context, args }) {
|
|
|
47619
48356
|
}
|
|
47620
48357
|
async function feedUpdate({ context, args }) {
|
|
47621
48358
|
const itemId = args.words[2];
|
|
47622
|
-
if (!itemId) throw new CliUsageError(
|
|
48359
|
+
if (!itemId) throw new CliUsageError(USAGE8);
|
|
47623
48360
|
const flags2 = flagsOf(args);
|
|
47624
48361
|
const { client } = await signedIn({ context, args });
|
|
47625
48362
|
const body = await bodyOf2({ context, flags: flags2 });
|
|
@@ -47635,7 +48372,7 @@ async function feedUpdate({ context, args }) {
|
|
|
47635
48372
|
async function feedReply({ context, args }) {
|
|
47636
48373
|
const itemId = args.words[2];
|
|
47637
48374
|
const text2 = args.words.slice(3).join(" ").trim();
|
|
47638
|
-
if (!itemId || !text2) throw new CliUsageError(
|
|
48375
|
+
if (!itemId || !text2) throw new CliUsageError(USAGE8);
|
|
47639
48376
|
const { client } = await signedIn({ context, args });
|
|
47640
48377
|
const replied = await client.post("/api/feed/items/reply", {
|
|
47641
48378
|
itemId,
|
|
@@ -47646,7 +48383,7 @@ async function feedReply({ context, args }) {
|
|
|
47646
48383
|
}
|
|
47647
48384
|
async function feedRead({ context, args }) {
|
|
47648
48385
|
const itemId = args.words[2];
|
|
47649
|
-
if (!itemId) throw new CliUsageError(
|
|
48386
|
+
if (!itemId) throw new CliUsageError(USAGE8);
|
|
47650
48387
|
const { client } = await signedIn({ context, args });
|
|
47651
48388
|
const read3 = await client.post("/api/feed/items/read", { itemId });
|
|
47652
48389
|
printItem({ context, args, item: read3 });
|
|
@@ -47663,7 +48400,7 @@ async function feedInbox({ context, args }) {
|
|
|
47663
48400
|
}
|
|
47664
48401
|
async function feedBriefSummary({ context, args }) {
|
|
47665
48402
|
const date5 = args.words[2];
|
|
47666
|
-
if (!date5) throw new CliUsageError(
|
|
48403
|
+
if (!date5) throw new CliUsageError(USAGE8);
|
|
47667
48404
|
const { client } = await signedIn({ context, args });
|
|
47668
48405
|
const pointer = await client.post("/api/feed/brief-summary", { date: date5 });
|
|
47669
48406
|
if (args.flags.json) return context.out(`${JSON.stringify(pointer, null, 2)}
|
|
@@ -47733,7 +48470,7 @@ async function feedCount({ context, args }) {
|
|
|
47733
48470
|
}
|
|
47734
48471
|
async function feedAct({ context, args }) {
|
|
47735
48472
|
const [itemId, actionId] = [args.words[2], args.words[3]];
|
|
47736
|
-
if (!itemId || !actionId) throw new CliUsageError(
|
|
48473
|
+
if (!itemId || !actionId) throw new CliUsageError(USAGE8);
|
|
47737
48474
|
const draft = await textFlag({ context, args, name: "draft" });
|
|
47738
48475
|
const { client } = await signedIn({ context, args });
|
|
47739
48476
|
const item = await client.post("/api/feed/mine/act", {
|
|
@@ -47746,7 +48483,7 @@ async function feedAct({ context, args }) {
|
|
|
47746
48483
|
async function feedComment({ context, args }) {
|
|
47747
48484
|
const itemId = args.words[2];
|
|
47748
48485
|
const text2 = args.words.slice(3).join(" ").trim();
|
|
47749
|
-
if (!itemId || !text2) throw new CliUsageError(
|
|
48486
|
+
if (!itemId || !text2) throw new CliUsageError(USAGE8);
|
|
47750
48487
|
const draft = await textFlag({ context, args, name: "draft" });
|
|
47751
48488
|
const { client } = await signedIn({ context, args });
|
|
47752
48489
|
const item = await client.post("/api/feed/mine/comment", {
|
|
@@ -47759,7 +48496,7 @@ async function feedComment({ context, args }) {
|
|
|
47759
48496
|
function moveItem(path) {
|
|
47760
48497
|
return async ({ context, args }) => {
|
|
47761
48498
|
const itemId = args.words[2];
|
|
47762
|
-
if (!itemId) throw new CliUsageError(
|
|
48499
|
+
if (!itemId) throw new CliUsageError(USAGE8);
|
|
47763
48500
|
const { client } = await signedIn({ context, args });
|
|
47764
48501
|
const item = await client.post(`/api/feed/mine/${path}`, { itemId });
|
|
47765
48502
|
printMoved({ context, args, item });
|
|
@@ -47768,14 +48505,14 @@ function moveItem(path) {
|
|
|
47768
48505
|
async function feedSnooze({ context, args }) {
|
|
47769
48506
|
const itemId = args.words[2];
|
|
47770
48507
|
const until = flagText({ args, name: "until" });
|
|
47771
|
-
if (!itemId || !until) throw new CliUsageError(
|
|
48508
|
+
if (!itemId || !until) throw new CliUsageError(USAGE8);
|
|
47772
48509
|
const { client } = await signedIn({ context, args });
|
|
47773
48510
|
const item = await client.post("/api/feed/mine/snooze", { itemId, until });
|
|
47774
48511
|
printMoved({ context, args, item });
|
|
47775
48512
|
}
|
|
47776
48513
|
async function feedChannel({ context, args }) {
|
|
47777
48514
|
const channelId = args.words[2];
|
|
47778
|
-
if (!channelId) throw new CliUsageError(
|
|
48515
|
+
if (!channelId) throw new CliUsageError(USAGE8);
|
|
47779
48516
|
const { client } = await signedIn({ context, args });
|
|
47780
48517
|
const items = await client.post("/api/feed/channel", { channelId });
|
|
47781
48518
|
if (args.flags.json) return context.out(`${JSON.stringify(items, null, 2)}
|
|
@@ -47803,7 +48540,7 @@ var FEED_COMMANDS = {
|
|
|
47803
48540
|
async function feed({ context, args }) {
|
|
47804
48541
|
const name2 = args.words[1] ?? "";
|
|
47805
48542
|
const command = Object.hasOwn(FEED_COMMANDS, name2) ? FEED_COMMANDS[name2] : void 0;
|
|
47806
|
-
if (!command) throw new CliUsageError(
|
|
48543
|
+
if (!command) throw new CliUsageError(USAGE8);
|
|
47807
48544
|
await command({ context, args });
|
|
47808
48545
|
}
|
|
47809
48546
|
|
|
@@ -48302,18 +49039,21 @@ async function ip({ context, args }) {
|
|
|
48302
49039
|
import { mkdir as mkdir10, readFile as readFile18, rename as rename4, rm as rm6, writeFile as writeFile11 } from "node:fs/promises";
|
|
48303
49040
|
import { dirname as dirname10, join as join10 } from "node:path";
|
|
48304
49041
|
var DEFAULT_WAIT_SECONDS = 100;
|
|
49042
|
+
var JOIN_USAGE = "Usage: laze join [--workspace <name|id|invite link>] [--for <email>] [--name <name>] [--note <text>] [--timeout <seconds>]";
|
|
48305
49043
|
function pendingPathOf({ context }) {
|
|
48306
49044
|
return join10(dirname10(context.environment.configPath), "join", "pending.json");
|
|
48307
49045
|
}
|
|
48308
49046
|
async function readPending({
|
|
48309
49047
|
context,
|
|
48310
|
-
url: url2
|
|
49048
|
+
url: url2,
|
|
49049
|
+
args
|
|
48311
49050
|
}) {
|
|
48312
49051
|
const pending = await readFile18(pendingPathOf({ context }), "utf8").then(
|
|
48313
49052
|
(text2) => JSON.parse(text2),
|
|
48314
49053
|
() => void 0
|
|
48315
49054
|
);
|
|
48316
49055
|
if (!pending || pending.url !== url2) return void 0;
|
|
49056
|
+
if (args && !asksTheSame({ pending, flags: flaggedOf({ args }) })) return void 0;
|
|
48317
49057
|
return Temporal3.Instant.from(pending.expiresAt).epochMilliseconds > context.nowMs() ? pending : void 0;
|
|
48318
49058
|
}
|
|
48319
49059
|
async function keepPending({ context, pending }) {
|
|
@@ -48331,51 +49071,108 @@ function waitSecondsOf2({ args }) {
|
|
|
48331
49071
|
if (!raw) return DEFAULT_WAIT_SECONDS;
|
|
48332
49072
|
const seconds = Number(raw);
|
|
48333
49073
|
if (!Number.isFinite(seconds) || seconds < 0) {
|
|
49074
|
+
throw new CliUsageError(JOIN_USAGE);
|
|
49075
|
+
}
|
|
49076
|
+
return seconds;
|
|
49077
|
+
}
|
|
49078
|
+
function flaggedOf({ args }) {
|
|
49079
|
+
const workspace2 = flagText({ args, name: "workspace" });
|
|
49080
|
+
const forEmail = flagText({ args, name: "for" });
|
|
49081
|
+
return { ...workspace2 ? { workspace: workspace2 } : {}, ...forEmail ? { forEmail } : {} };
|
|
49082
|
+
}
|
|
49083
|
+
function asksTheSame({ pending, flags: flags2 }) {
|
|
49084
|
+
if (!flags2.workspace && !flags2.forEmail) return true;
|
|
49085
|
+
return flags2.workspace === pending.asked?.workspace && flags2.forEmail === pending.asked?.forEmail;
|
|
49086
|
+
}
|
|
49087
|
+
async function askedOf({
|
|
49088
|
+
context,
|
|
49089
|
+
args
|
|
49090
|
+
}) {
|
|
49091
|
+
const flagged = flaggedOf({ args });
|
|
49092
|
+
if (flagged.workspace || flagged.forEmail) return flagged;
|
|
49093
|
+
if (!context.ask) return {};
|
|
49094
|
+
const answer4 = (await context.ask(
|
|
49095
|
+
"Which Laze workspace should approve you? Its name or an invite link (empty for a code link): "
|
|
49096
|
+
)).trim();
|
|
49097
|
+
return answer4 ? { workspace: answer4 } : {};
|
|
49098
|
+
}
|
|
49099
|
+
function waitingText({ pending, resumed }) {
|
|
49100
|
+
const where = pending.workspaceName ? [
|
|
49101
|
+
`The request waits in ${pending.workspaceName}'s feed for its approvers; it also opens at ${pending.approveUrl}`
|
|
49102
|
+
] : [
|
|
49103
|
+
`Ask your person to open ${pending.approveUrl} and approve it once.`,
|
|
49104
|
+
"Pass --workspace <name> next time so it shows in their feed."
|
|
49105
|
+
];
|
|
49106
|
+
const first = `${resumed ? "Still waiting" : "Asked to join Laze"}: code ${pending.code}.`;
|
|
49107
|
+
return [first, ...where, ""].join("\n");
|
|
49108
|
+
}
|
|
49109
|
+
async function stillOurs({ context, pending }) {
|
|
49110
|
+
const kept = await readPending({ context, url: pending.url });
|
|
49111
|
+
return kept?.requestToken === pending.requestToken;
|
|
49112
|
+
}
|
|
49113
|
+
async function pollOnce({
|
|
49114
|
+
context,
|
|
49115
|
+
client,
|
|
49116
|
+
pending
|
|
49117
|
+
}) {
|
|
49118
|
+
const answer4 = await client.post("/api/agents/join-requests/poll", {
|
|
49119
|
+
requestToken: pending.requestToken
|
|
49120
|
+
}).catch(async (error62) => {
|
|
49121
|
+
if (!(error62 instanceof LazeApiError)) throw error62;
|
|
49122
|
+
if (error62.code === "agent_join_request_claimed") return { status: "taken" };
|
|
49123
|
+
if (error62.code !== "agent_join_request_invalid") throw error62;
|
|
49124
|
+
await dropPending({ context });
|
|
48334
49125
|
throw new CliUsageError(
|
|
48335
|
-
"
|
|
49126
|
+
"The request was denied or ran out. Run `laze join` again for a new code."
|
|
48336
49127
|
);
|
|
49128
|
+
});
|
|
49129
|
+
if (answer4.status === "taken") return { kind: "taken" };
|
|
49130
|
+
if (answer4.status === "pending") return { kind: "waiting" };
|
|
49131
|
+
await dropPending({ context });
|
|
49132
|
+
const { status: _status, workspaceName, ...linked } = answer4;
|
|
49133
|
+
return { kind: "approved", linked, workspaceName };
|
|
49134
|
+
}
|
|
49135
|
+
async function approvalOf({
|
|
49136
|
+
context,
|
|
49137
|
+
args,
|
|
49138
|
+
client,
|
|
49139
|
+
pending
|
|
49140
|
+
}) {
|
|
49141
|
+
const deadline = context.nowMs() + waitSecondsOf2({ args }) * 1e3;
|
|
49142
|
+
const polls = Math.ceil(waitSecondsOf2({ args }) / pending.intervalSeconds) + 1;
|
|
49143
|
+
for (let poll = 0; poll < polls; poll += 1) {
|
|
49144
|
+
if (poll > 0 && !await stillOurs({ context, pending })) return { kind: "taken" };
|
|
49145
|
+
const outcome = await pollOnce({ context, client, pending });
|
|
49146
|
+
if (outcome.kind !== "waiting" || context.nowMs() >= deadline) return outcome;
|
|
49147
|
+
await context.sleep(pending.intervalSeconds * 1e3);
|
|
48337
49148
|
}
|
|
48338
|
-
return
|
|
49149
|
+
return { kind: "waiting" };
|
|
48339
49150
|
}
|
|
48340
49151
|
async function joinAsAgent({ context, args }) {
|
|
48341
49152
|
const url2 = serverUrlOf({ context, args });
|
|
48342
49153
|
const { harness, pid } = await harnessOf2({ context, args });
|
|
48343
49154
|
const client = LazeClient.create({ baseUrl: url2, fetcher: context.fetcher });
|
|
48344
|
-
const resumed = args.flags.restart ? void 0 : await readPending({ context, url: url2 });
|
|
49155
|
+
const resumed = args.flags.restart ? void 0 : await readPending({ context, url: url2, args });
|
|
49156
|
+
const asked = resumed ? {} : await askedOf({ context, args });
|
|
48345
49157
|
const pending = resumed ?? await client.post("/api/agents/join-requests", {
|
|
48346
49158
|
harness,
|
|
49159
|
+
...asked,
|
|
48347
49160
|
...flagText({ args, name: "name" }) ? { name: flagText({ args, name: "name" }) } : {},
|
|
48348
49161
|
...flagText({ args, name: "note" }) ? { note: flagText({ args, name: "note" }) } : {}
|
|
48349
|
-
}).then((started) => ({ ...started, url: url2 })).catch((error62) => sandboxed({ context, error: error62 }));
|
|
49162
|
+
}).then((started) => ({ ...started, url: url2, asked })).catch((error62) => sandboxed({ context, error: error62 }));
|
|
48350
49163
|
if (!resumed) await keepPending({ context, pending });
|
|
48351
|
-
context.out(
|
|
48352
|
-
|
|
48353
|
-
|
|
48354
|
-
|
|
48355
|
-
|
|
48356
|
-
|
|
48357
|
-
)
|
|
48358
|
-
|
|
48359
|
-
|
|
48360
|
-
|
|
48361
|
-
|
|
48362
|
-
|
|
48363
|
-
}).catch(async (error62) => {
|
|
48364
|
-
if (error62 instanceof LazeApiError && error62.code === "agent_join_request_invalid") {
|
|
48365
|
-
await dropPending({ context });
|
|
48366
|
-
throw new CliUsageError(
|
|
48367
|
-
"The request was denied or ran out. Run `laze join` again for a new code."
|
|
48368
|
-
);
|
|
48369
|
-
}
|
|
48370
|
-
throw error62;
|
|
48371
|
-
});
|
|
48372
|
-
if (answer4.status === "approved") {
|
|
48373
|
-
await dropPending({ context });
|
|
48374
|
-
const { status: _status, ...linked } = answer4;
|
|
48375
|
-
return settleLinked({ context, args, url: url2, harness, pid, linked });
|
|
48376
|
-
}
|
|
48377
|
-
if (context.nowMs() >= deadline) break;
|
|
48378
|
-
await context.sleep(pending.intervalSeconds * 1e3);
|
|
49164
|
+
context.out(waitingText({ pending, resumed: !!resumed }));
|
|
49165
|
+
const outcome = await approvalOf({ context, args, client, pending });
|
|
49166
|
+
if (outcome.kind === "taken") {
|
|
49167
|
+
context.out("This request already joined in another `laze join` run. Run `laze whoami`.\n");
|
|
49168
|
+
return;
|
|
49169
|
+
}
|
|
49170
|
+
if (outcome.kind === "approved") {
|
|
49171
|
+
const { linked } = outcome;
|
|
49172
|
+
const where = outcome.workspaceName || pending.workspaceName || linked.agent.workspaceId;
|
|
49173
|
+
context.out(`Joined ${where} as ${linked.agent.name}.
|
|
49174
|
+
`);
|
|
49175
|
+
return settleLinked({ context, args, url: url2, harness, pid, linked });
|
|
48379
49176
|
}
|
|
48380
49177
|
context.out(
|
|
48381
49178
|
`Not approved yet. Run \`laze join\` again to keep waiting; the code works until ${pending.expiresAt}.
|
|
@@ -48584,7 +49381,7 @@ import { createHash } from "node:crypto";
|
|
|
48584
49381
|
import { mkdir as mkdir11, readFile as readFile19, rm as rm7, writeFile as writeFile12 } from "node:fs/promises";
|
|
48585
49382
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
48586
49383
|
import { dirname as dirname11, join as join11 } from "node:path";
|
|
48587
|
-
var
|
|
49384
|
+
var USAGE9 = `Usage: laze vault run <connection> --reason "<one plain sentence>" [--wait <s>] -- <command> [args...]
|
|
48588
49385
|
Runs the command with the connection's values in its environment, on a Laze agent's computer
|
|
48589
49386
|
or on a machine it runs on.`;
|
|
48590
49387
|
var POLL_MS = 3e3;
|
|
@@ -48727,7 +49524,7 @@ function deadlineOf({ args, nowMs }) {
|
|
|
48727
49524
|
const wait = flagText({ args, name: "wait" }) || (args.flags.wait === true ? args.words[3] : "");
|
|
48728
49525
|
if (!wait) return Infinity;
|
|
48729
49526
|
if (!(Number(wait) >= 0)) throw new CliUsageError(`--wait takes a number of seconds
|
|
48730
|
-
${
|
|
49527
|
+
${USAGE9}`);
|
|
48731
49528
|
return nowMs + Number(wait) * 1e3;
|
|
48732
49529
|
}
|
|
48733
49530
|
async function untilAnswered({
|
|
@@ -48809,16 +49606,16 @@ async function vaultRun({
|
|
|
48809
49606
|
}) {
|
|
48810
49607
|
const connection = args.words[2];
|
|
48811
49608
|
const reason = flagText({ args, name: "reason" });
|
|
48812
|
-
if (!connection || args.rest.length === 0) throw new CliUsageError(
|
|
49609
|
+
if (!connection || args.rest.length === 0) throw new CliUsageError(USAGE9);
|
|
48813
49610
|
if (!reason) throw new CliUsageError(`Say why with --reason "<one plain sentence>"
|
|
48814
|
-
${
|
|
49611
|
+
${USAGE9}`);
|
|
48815
49612
|
const released = await vaultRelease({ context, args, connection, reason, command: args.rest });
|
|
48816
49613
|
if ("exitCode" in released) return released.exitCode;
|
|
48817
49614
|
return context.runCommand({ command: args.rest, env: released.env });
|
|
48818
49615
|
}
|
|
48819
49616
|
|
|
48820
49617
|
// src/services/machine-commands.service.ts
|
|
48821
|
-
var
|
|
49618
|
+
var USAGE10 = [
|
|
48822
49619
|
"Usage: laze machine connect <name> the command to run on your own machine (people)",
|
|
48823
49620
|
" laze machine connect <name> --again a new command for a machine you connected; the old code stops working",
|
|
48824
49621
|
" laze machine connect <name> --ssh <user>@<host>[:port] a machine that cannot run the connector, over SSH (people)",
|
|
@@ -48864,7 +49661,7 @@ function listLine(machine2) {
|
|
|
48864
49661
|
var EXEC_ENV_MAX = 32;
|
|
48865
49662
|
function machineArg2({ args }) {
|
|
48866
49663
|
const machine2 = args.words[2];
|
|
48867
|
-
if (!machine2) throw new CliUsageError(
|
|
49664
|
+
if (!machine2) throw new CliUsageError(USAGE10);
|
|
48868
49665
|
return machine2;
|
|
48869
49666
|
}
|
|
48870
49667
|
async function connect2({ context, args }) {
|
|
@@ -48890,7 +49687,7 @@ async function connectSsh({
|
|
|
48890
49687
|
}) {
|
|
48891
49688
|
const ssh = flagText({ args, name: "ssh" });
|
|
48892
49689
|
if (!ssh) throw new CliUsageError(`--ssh takes <user>@<host>[:port]
|
|
48893
|
-
${
|
|
49690
|
+
${USAGE10}`);
|
|
48894
49691
|
const client = await computeClient({ context, args });
|
|
48895
49692
|
const made = await client.post(COMPUTE_REST_PATHS.connectSsh, {
|
|
48896
49693
|
name: name2,
|
|
@@ -48966,11 +49763,11 @@ async function exec({
|
|
|
48966
49763
|
}) {
|
|
48967
49764
|
const machine2 = machineArg2({ args });
|
|
48968
49765
|
const command = commandText({ rest: args.rest });
|
|
48969
|
-
if (!command.trim()) throw new CliUsageError(
|
|
49766
|
+
if (!command.trim()) throw new CliUsageError(USAGE10);
|
|
48970
49767
|
const timeout = flagText({ args, name: "timeout" });
|
|
48971
49768
|
if (timeout && !(Number(timeout) >= 1))
|
|
48972
49769
|
throw new CliUsageError(`--timeout takes a number of seconds
|
|
48973
|
-
${
|
|
49770
|
+
${USAGE10}`);
|
|
48974
49771
|
const released = await vaultEnv({ context, args });
|
|
48975
49772
|
if ("exitCode" in released) return released.exitCode;
|
|
48976
49773
|
const client = await computeClient({ context, args });
|
|
@@ -48998,11 +49795,11 @@ async function vaultEnv({
|
|
|
48998
49795
|
const connections = args.lists.vault ?? [];
|
|
48999
49796
|
if (args.flags.vault === true)
|
|
49000
49797
|
throw new CliUsageError(`--vault takes a connection name
|
|
49001
|
-
${
|
|
49798
|
+
${USAGE10}`);
|
|
49002
49799
|
if (connections.length === 0) return {};
|
|
49003
49800
|
const reason = flagText({ args, name: "reason" });
|
|
49004
49801
|
if (!reason) throw new CliUsageError(`Say why with --reason "<one plain sentence>"
|
|
49005
|
-
${
|
|
49802
|
+
${USAGE10}`);
|
|
49006
49803
|
const env = {};
|
|
49007
49804
|
for (const connection of new Set(connections)) {
|
|
49008
49805
|
const released = await vaultRelease({ context, args, connection, reason, command: args.rest });
|
|
@@ -49022,11 +49819,11 @@ ${USAGE9}`);
|
|
|
49022
49819
|
async function host({ context, args }) {
|
|
49023
49820
|
const machineName = args.words[2];
|
|
49024
49821
|
const agent2 = args.words[3];
|
|
49025
|
-
if (!machineName || !agent2) throw new CliUsageError(
|
|
49822
|
+
if (!machineName || !agent2) throw new CliUsageError(USAGE10);
|
|
49026
49823
|
const whenOffline = flagText({ args, name: "when-offline", fallback: "wait" });
|
|
49027
49824
|
if (whenOffline !== "wait" && whenOffline !== "computer" && whenOffline !== "sandbox")
|
|
49028
49825
|
throw new CliUsageError(`--when-offline takes wait or computer
|
|
49029
|
-
${
|
|
49826
|
+
${USAGE10}`);
|
|
49030
49827
|
const client = await computeClient({ context, args });
|
|
49031
49828
|
const machine2 = await client.post(COMPUTE_REST_PATHS.host, {
|
|
49032
49829
|
machine: machineName,
|
|
@@ -49043,7 +49840,7 @@ ${USAGE9}`);
|
|
|
49043
49840
|
}
|
|
49044
49841
|
async function unhost({ context, args }) {
|
|
49045
49842
|
const agent2 = args.words[2];
|
|
49046
|
-
if (!agent2) throw new CliUsageError(
|
|
49843
|
+
if (!agent2) throw new CliUsageError(USAGE10);
|
|
49047
49844
|
const client = await computeClient({ context, args });
|
|
49048
49845
|
const done = await client.post(COMPUTE_REST_PATHS.unhost, { agent: agent2 });
|
|
49049
49846
|
if (args.flags.json) return context.out(`${JSON.stringify(done, null, 2)}
|
|
@@ -49080,7 +49877,7 @@ async function machine({ context, args }) {
|
|
|
49080
49877
|
if (command === "unhost") return unhost({ context, args });
|
|
49081
49878
|
const access = machineAccessCommand(command);
|
|
49082
49879
|
if (access) return access({ context, args });
|
|
49083
|
-
throw new CliUsageError(
|
|
49880
|
+
throw new CliUsageError(USAGE10);
|
|
49084
49881
|
}
|
|
49085
49882
|
|
|
49086
49883
|
// src/services/mcp-server.service.ts
|
|
@@ -49352,7 +50149,7 @@ async function writeMount({
|
|
|
49352
50149
|
}
|
|
49353
50150
|
|
|
49354
50151
|
// src/services/memory-commands.service.ts
|
|
49355
|
-
var
|
|
50152
|
+
var USAGE11 = `Usage:
|
|
49356
50153
|
laze memory get SOUL.md|AGENTS.md|MEMORY.md [--channel <channel>]
|
|
49357
50154
|
laze memory set <file> <text|@file|-> [--channel <channel>] [--base <version>]
|
|
49358
50155
|
laze memory append MEMORY.md <text|@file|-> [--channel <channel>]
|
|
@@ -49364,7 +50161,7 @@ MEMORY.md is the file of the turn's channel (LAZE_CHANNEL), or of --channel when
|
|
|
49364
50161
|
var FILES = /* @__PURE__ */ new Set(["SOUL.md", "AGENTS.md", "MEMORY.md"]);
|
|
49365
50162
|
function fileRef({ context, args }) {
|
|
49366
50163
|
const file3 = args.words[2] ?? "";
|
|
49367
|
-
if (!FILES.has(file3)) throw new CliUsageError(
|
|
50164
|
+
if (!FILES.has(file3)) throw new CliUsageError(USAGE11);
|
|
49368
50165
|
const channel = turnChannel({ context, args });
|
|
49369
50166
|
return { file: file3, ...channel ? { channel } : {} };
|
|
49370
50167
|
}
|
|
@@ -49403,7 +50200,7 @@ async function memoryHistory({ context, args }) {
|
|
|
49403
50200
|
async function memorySet({ context, args }) {
|
|
49404
50201
|
const ref = fileRef({ context, args });
|
|
49405
50202
|
const value = args.words.slice(3).join(" ");
|
|
49406
|
-
if (!value) throw new CliUsageError(
|
|
50203
|
+
if (!value) throw new CliUsageError(USAGE11);
|
|
49407
50204
|
const content = await textArgument({ context, value });
|
|
49408
50205
|
const base = args.flags.base;
|
|
49409
50206
|
const { client } = await signedIn({ context, args });
|
|
@@ -49419,7 +50216,7 @@ async function memorySet({ context, args }) {
|
|
|
49419
50216
|
async function memoryAppend({ context, args }) {
|
|
49420
50217
|
const ref = fileRef({ context, args });
|
|
49421
50218
|
const value = args.words.slice(3).join(" ");
|
|
49422
|
-
if (!value) throw new CliUsageError(
|
|
50219
|
+
if (!value) throw new CliUsageError(USAGE11);
|
|
49423
50220
|
const text2 = await textArgument({ context, value });
|
|
49424
50221
|
const { client } = await signedIn({ context, args });
|
|
49425
50222
|
const saved3 = await client.post("/api/memory/append", { ...ref, text: text2 });
|
|
@@ -49429,7 +50226,7 @@ async function memoryAppend({ context, args }) {
|
|
|
49429
50226
|
}
|
|
49430
50227
|
async function memorySearch({ context, args }) {
|
|
49431
50228
|
const query = args.words.slice(2).join(" ").trim();
|
|
49432
|
-
if (!query) throw new CliUsageError(
|
|
50229
|
+
if (!query) throw new CliUsageError(USAGE11);
|
|
49433
50230
|
const { client } = await signedIn({ context, args });
|
|
49434
50231
|
const hits = await client.post("/api/memory/search", { query });
|
|
49435
50232
|
if (args.flags.json) return context.out(`${JSON.stringify(hits, null, 2)}
|
|
@@ -49463,13 +50260,13 @@ var MEMORY_COMMANDS = {
|
|
|
49463
50260
|
async function memory({ context, args }) {
|
|
49464
50261
|
const name2 = args.words[1] ?? "";
|
|
49465
50262
|
const command = Object.hasOwn(MEMORY_COMMANDS, name2) ? MEMORY_COMMANDS[name2] : void 0;
|
|
49466
|
-
if (!command) throw new CliUsageError(
|
|
50263
|
+
if (!command) throw new CliUsageError(USAGE11);
|
|
49467
50264
|
await command({ context, args });
|
|
49468
50265
|
}
|
|
49469
50266
|
|
|
49470
50267
|
// src/services/models-commands.service.ts
|
|
49471
50268
|
var WINDOWS = ["day", "week", "month"];
|
|
49472
|
-
var
|
|
50269
|
+
var USAGE12 = `Usage:
|
|
49473
50270
|
laze models policy whether Laze models are on, the default budget and the cap
|
|
49474
50271
|
laze models set-policy [on|off] [--default-day <usd|none>] [--cap-day <usd|none>] ... (admins)
|
|
49475
50272
|
--default-week, --default-month, --cap-week and --cap-month set the other windows
|
|
@@ -49494,7 +50291,7 @@ function limitsFrom({
|
|
|
49494
50291
|
const value = text2 === "none" ? null : Number(text2);
|
|
49495
50292
|
if (value !== null && (!Number.isFinite(value) || value < 0))
|
|
49496
50293
|
throw new CliUsageError(`--${prefix}${window2} takes an amount in USD or none.
|
|
49497
|
-
${
|
|
50294
|
+
${USAGE12}`);
|
|
49498
50295
|
next[window2] = value;
|
|
49499
50296
|
changed = true;
|
|
49500
50297
|
}
|
|
@@ -49519,12 +50316,12 @@ async function showPolicy({ context, args }) {
|
|
|
49519
50316
|
}
|
|
49520
50317
|
async function setPolicy({ context, args }) {
|
|
49521
50318
|
const state = args.words[2];
|
|
49522
|
-
if (state !== void 0 && state !== "on" && state !== "off") throw new CliUsageError(
|
|
50319
|
+
if (state !== void 0 && state !== "on" && state !== "off") throw new CliUsageError(USAGE12);
|
|
49523
50320
|
const { client } = await signedIn({ context, args });
|
|
49524
50321
|
const current2 = await client.get("/api/models/policy");
|
|
49525
50322
|
const defaultBudget = limitsFrom({ args, prefix: "default-", current: current2.defaultBudget });
|
|
49526
50323
|
const cap = limitsFrom({ args, prefix: "cap-", current: current2.cap });
|
|
49527
|
-
if (!state && !defaultBudget && !cap) throw new CliUsageError(
|
|
50324
|
+
if (!state && !defaultBudget && !cap) throw new CliUsageError(USAGE12);
|
|
49528
50325
|
const updated = await client.post("/api/models/policy", {
|
|
49529
50326
|
...state ? { lazeModels: state === "on" } : {},
|
|
49530
50327
|
...defaultBudget ? { defaultBudget } : {},
|
|
@@ -49565,11 +50362,11 @@ async function agentNamed({ client, name: name2 }) {
|
|
|
49565
50362
|
}
|
|
49566
50363
|
async function setBudget({ context, args }) {
|
|
49567
50364
|
const name2 = args.words[2];
|
|
49568
|
-
if (!name2) throw new CliUsageError(
|
|
50365
|
+
if (!name2) throw new CliUsageError(USAGE12);
|
|
49569
50366
|
const { client } = await signedIn({ context, args });
|
|
49570
50367
|
const agent2 = await agentNamed({ client, name: name2 });
|
|
49571
50368
|
const next = limitsFrom({ args, prefix: "", current: agent2.budget });
|
|
49572
|
-
if (!next) throw new CliUsageError(
|
|
50369
|
+
if (!next) throw new CliUsageError(USAGE12);
|
|
49573
50370
|
const updated = await client.post("/api/models/agents/budget", {
|
|
49574
50371
|
agentId: agent2.agentId,
|
|
49575
50372
|
budget: next
|
|
@@ -49602,19 +50399,19 @@ var MODEL_COMMANDS = {
|
|
|
49602
50399
|
async function models({ context, args }) {
|
|
49603
50400
|
const name2 = args.words[1] ?? "policy";
|
|
49604
50401
|
const command = Object.hasOwn(MODEL_COMMANDS, name2) ? MODEL_COMMANDS[name2] : void 0;
|
|
49605
|
-
if (!command) throw new CliUsageError(
|
|
50402
|
+
if (!command) throw new CliUsageError(USAGE12);
|
|
49606
50403
|
await command({ context, args });
|
|
49607
50404
|
}
|
|
49608
50405
|
|
|
49609
50406
|
// src/services/notification-commands.service.ts
|
|
49610
|
-
var
|
|
50407
|
+
var USAGE13 = `Usage:
|
|
49611
50408
|
laze notifications [show] your notification settings (people)
|
|
49612
50409
|
laze notifications set [--channels all|mentions|nothing] [--keywords a,b] [--dnd on|off]
|
|
49613
50410
|
[--dnd-from 22:00] [--dnd-to 08:00] [--tz <IANA zone>] [--push on|off] [--email on|off]
|
|
49614
50411
|
[--email-after <minutes>]
|
|
49615
50412
|
laze notifications snooze <minutes>|off pause notifications for a while, or end it`;
|
|
49616
50413
|
var onOff = (value) => value ? "on" : "off";
|
|
49617
|
-
function
|
|
50414
|
+
function print7({ context, args, settings: settings2 }) {
|
|
49618
50415
|
if (args.flags.json) return context.out(`${JSON.stringify(settings2, null, 2)}
|
|
49619
50416
|
`);
|
|
49620
50417
|
const keywords = settings2.keywords.length ? settings2.keywords.join(", ") : "none";
|
|
@@ -49636,14 +50433,14 @@ function switchOf({ args, name: name2 }) {
|
|
|
49636
50433
|
if (!text2) return void 0;
|
|
49637
50434
|
if (text2 !== "on" && text2 !== "off")
|
|
49638
50435
|
throw new CliUsageError(`--${name2} takes on or off.
|
|
49639
|
-
${
|
|
50436
|
+
${USAGE13}`);
|
|
49640
50437
|
return text2 === "on";
|
|
49641
50438
|
}
|
|
49642
50439
|
function changesOf(args) {
|
|
49643
50440
|
const channels2 = flagText({ args, name: "channels" });
|
|
49644
50441
|
if (channels2 && !["all", "mentions", "nothing"].includes(channels2))
|
|
49645
50442
|
throw new CliUsageError(`--channels takes all, mentions or nothing.
|
|
49646
|
-
${
|
|
50443
|
+
${USAGE13}`);
|
|
49647
50444
|
const keywords = typeof args.flags.keywords === "string" ? args.flags.keywords : void 0;
|
|
49648
50445
|
const emailAfter = flagText({ args, name: "email-after" });
|
|
49649
50446
|
const changes = {
|
|
@@ -49661,13 +50458,13 @@ ${USAGE12}`);
|
|
|
49661
50458
|
}
|
|
49662
50459
|
async function showSettings({ context, args }) {
|
|
49663
50460
|
const { client } = await signedIn({ context, args });
|
|
49664
|
-
|
|
50461
|
+
print7({ context, args, settings: await client.get("/api/agents/me/notifications") });
|
|
49665
50462
|
}
|
|
49666
50463
|
async function setSettings({ context, args }) {
|
|
49667
50464
|
const changes = changesOf(args);
|
|
49668
|
-
if (Object.keys(changes).length === 0) throw new CliUsageError(
|
|
50465
|
+
if (Object.keys(changes).length === 0) throw new CliUsageError(USAGE13);
|
|
49669
50466
|
const { client } = await signedIn({ context, args });
|
|
49670
|
-
|
|
50467
|
+
print7({
|
|
49671
50468
|
context,
|
|
49672
50469
|
args,
|
|
49673
50470
|
settings: await client.post("/api/agents/me/notifications", changes)
|
|
@@ -49676,9 +50473,9 @@ async function setSettings({ context, args }) {
|
|
|
49676
50473
|
async function snoozeFor({ context, args }) {
|
|
49677
50474
|
const word2 = args.words[2];
|
|
49678
50475
|
const minutes = word2 === "off" ? 0 : Number(word2);
|
|
49679
|
-
if (!word2 || !Number.isInteger(minutes) || minutes < 0) throw new CliUsageError(
|
|
50476
|
+
if (!word2 || !Number.isInteger(minutes) || minutes < 0) throw new CliUsageError(USAGE13);
|
|
49680
50477
|
const { client } = await signedIn({ context, args });
|
|
49681
|
-
|
|
50478
|
+
print7({
|
|
49682
50479
|
context,
|
|
49683
50480
|
args,
|
|
49684
50481
|
settings: await client.post("/api/agents/me/notifications/snooze", {
|
|
@@ -49694,12 +50491,12 @@ var NOTIFICATION_COMMANDS = {
|
|
|
49694
50491
|
async function notifications({ context, args }) {
|
|
49695
50492
|
const name2 = args.words[1] ?? "show";
|
|
49696
50493
|
const command = Object.hasOwn(NOTIFICATION_COMMANDS, name2) ? NOTIFICATION_COMMANDS[name2] : void 0;
|
|
49697
|
-
if (!command) throw new CliUsageError(
|
|
50494
|
+
if (!command) throw new CliUsageError(USAGE13);
|
|
49698
50495
|
await command({ context, args });
|
|
49699
50496
|
}
|
|
49700
50497
|
|
|
49701
50498
|
// ../../modules/openclaw/contract/src/openclaw.ts
|
|
49702
|
-
var
|
|
50499
|
+
var workspaceIdSchema16 = external_exports.string().min(1);
|
|
49703
50500
|
var connectionIdSchema = external_exports.string().min(1).max(80);
|
|
49704
50501
|
var openclawAgentIdSchema = external_exports.string().min(1).max(120);
|
|
49705
50502
|
var openclawConnectionStatusSchema = external_exports.enum([
|
|
@@ -49708,12 +50505,25 @@ var openclawConnectionStatusSchema = external_exports.enum([
|
|
|
49708
50505
|
"unreachable",
|
|
49709
50506
|
"refused"
|
|
49710
50507
|
]);
|
|
50508
|
+
var openclawCronViewSchemaDefinition = external_exports.object({
|
|
50509
|
+
id: external_exports.string(),
|
|
50510
|
+
name: external_exports.string(),
|
|
50511
|
+
enabled: external_exports.boolean(),
|
|
50512
|
+
/** When it runs, such as "cron 45 7 * * 1-5 (Europe/Amsterdam)", "every 7 days" or "once". */
|
|
50513
|
+
schedule: external_exports.string(),
|
|
50514
|
+
nextRunAt: external_exports.iso.datetime().nullable(),
|
|
50515
|
+
lastRunAt: external_exports.iso.datetime().nullable(),
|
|
50516
|
+
/** How the last run ended in OpenClaw's words, such as "ok" or "error". */
|
|
50517
|
+
lastStatus: external_exports.string().nullable()
|
|
50518
|
+
});
|
|
49711
50519
|
var openclawAgentViewSchemaDefinition = external_exports.object({
|
|
49712
50520
|
openclawAgentId: external_exports.string(),
|
|
49713
50521
|
name: external_exports.string(),
|
|
49714
50522
|
emoji: external_exports.string(),
|
|
49715
50523
|
enabled: external_exports.boolean(),
|
|
49716
|
-
lazeAgentId: external_exports.string().nullable()
|
|
50524
|
+
lazeAgentId: external_exports.string().nullable(),
|
|
50525
|
+
/** Its scheduled jobs in OpenClaw; they run there and Laze shows them. */
|
|
50526
|
+
crons: external_exports.array(openclawCronViewSchemaDefinition)
|
|
49717
50527
|
});
|
|
49718
50528
|
var openclawConnectionViewSchemaDefinition = external_exports.object({
|
|
49719
50529
|
id: external_exports.string(),
|
|
@@ -49739,14 +50549,14 @@ var openclawOverviewSchemaDefinition = external_exports.object({
|
|
|
49739
50549
|
});
|
|
49740
50550
|
var openclawOverviewSchema = openclawOverviewSchemaDefinition;
|
|
49741
50551
|
var connectOpenclawInputSchemaDefinition = external_exports.object({
|
|
49742
|
-
workspaceId:
|
|
50552
|
+
workspaceId: workspaceIdSchema16,
|
|
49743
50553
|
gatewayUrl: external_exports.string().trim().min(1).max(500),
|
|
49744
50554
|
token: external_exports.string().trim().min(1).max(500),
|
|
49745
50555
|
label: external_exports.string().trim().min(1).max(80).optional()
|
|
49746
50556
|
});
|
|
49747
50557
|
var connectOpenclawInputSchema = connectOpenclawInputSchemaDefinition;
|
|
49748
50558
|
var openclawConnectionRefSchemaDefinition = external_exports.object({
|
|
49749
|
-
workspaceId:
|
|
50559
|
+
workspaceId: workspaceIdSchema16,
|
|
49750
50560
|
connectionId: connectionIdSchema
|
|
49751
50561
|
});
|
|
49752
50562
|
var openclawConnectionRefSchema = openclawConnectionRefSchemaDefinition;
|
|
@@ -49761,8 +50571,19 @@ var setOpenclawFeedInputSchemaDefinition = external_exports.object({
|
|
|
49761
50571
|
enabled: external_exports.boolean()
|
|
49762
50572
|
});
|
|
49763
50573
|
var setOpenclawFeedInputSchema = setOpenclawFeedInputSchemaDefinition;
|
|
50574
|
+
var openclawAgentRefSchemaDefinition = external_exports.object({
|
|
50575
|
+
...openclawConnectionRefSchemaDefinition.shape,
|
|
50576
|
+
openclawAgentId: openclawAgentIdSchema
|
|
50577
|
+
});
|
|
50578
|
+
var openclawAgentRefSchema = openclawAgentRefSchemaDefinition;
|
|
50579
|
+
var openclawAgentKeySchemaDefinition = external_exports.object({
|
|
50580
|
+
agentId: external_exports.string(),
|
|
50581
|
+
agentName: external_exports.string(),
|
|
50582
|
+
token: external_exports.string()
|
|
50583
|
+
});
|
|
50584
|
+
var openclawAgentKeySchema = openclawAgentKeySchemaDefinition;
|
|
49764
50585
|
var OpenclawApi = moduleApi()("openclaw");
|
|
49765
|
-
var openclawTrpc = defineTrpcContract("openclaw").query("overview").withInput(external_exports.object({ workspaceId:
|
|
50586
|
+
var openclawTrpc = defineTrpcContract("openclaw").query("overview").withInput(external_exports.object({ workspaceId: workspaceIdSchema16 })).withOutput(openclawOverviewSchema).mutation("connect").withInput(connectOpenclawInputSchema).withOutput(openclawConnectionViewSchema).mutation("setAgent").withInput(setOpenclawAgentInputSchema).withOutput(openclawConnectionViewSchema).mutation("setFeed").withInput(setOpenclawFeedInputSchema).withOutput(openclawConnectionViewSchema).mutation("agentKey").withInput(openclawAgentRefSchema).withOutput(openclawAgentKeySchema).mutation("disconnect").withInput(openclawConnectionRefSchema).withOutput(external_exports.object({ disconnected: external_exports.literal(true) })).build();
|
|
49766
50587
|
|
|
49767
50588
|
// ../../modules/openclaw/contract/src/openclaw.config.ts
|
|
49768
50589
|
var positiveInt5 = external_exports.coerce.number().int().positive();
|
|
@@ -49798,6 +50619,7 @@ var OPENCLAW_KEY_PATHS = {
|
|
|
49798
50619
|
connect: "/api/openclaw/connect",
|
|
49799
50620
|
setAgent: "/api/openclaw/agent",
|
|
49800
50621
|
setFeed: "/api/openclaw/feed",
|
|
50622
|
+
agentKey: "/api/openclaw/agent-key",
|
|
49801
50623
|
disconnect: "/api/openclaw/disconnect"
|
|
49802
50624
|
};
|
|
49803
50625
|
var { gatewayUrl, token, label } = connectOpenclawInputSchema.shape;
|
|
@@ -49816,6 +50638,7 @@ var setOpenclawAgentByKeyInputSchemaDefinition = setOpenclawAgentInputSchema.omi
|
|
|
49816
50638
|
var setOpenclawFeedByKeyInputSchemaDefinition = setOpenclawFeedInputSchema.omit({
|
|
49817
50639
|
workspaceId: true
|
|
49818
50640
|
});
|
|
50641
|
+
var openclawAgentByKeyInputSchemaDefinition = openclawAgentRefSchema.omit({ workspaceId: true });
|
|
49819
50642
|
|
|
49820
50643
|
// src/services/openclaw-commands.service.ts
|
|
49821
50644
|
var OPENCLAW_USAGE = `Usage (a person's key; a gateway belongs to the person who connects it):
|
|
@@ -49824,6 +50647,8 @@ var OPENCLAW_USAGE = `Usage (a person's key; a gateway belongs to the person who
|
|
|
49824
50647
|
--from-vault names a connection in your own keychain that holds the token; over MCP it is
|
|
49825
50648
|
the only way, so the token never rides in the call
|
|
49826
50649
|
laze openclaw agent <connectionId> <openclawAgentId> on|off make one of its agents a Laze agent
|
|
50650
|
+
laze openclaw agent-key <connectionId> <openclawAgentId> a Laze CLI key for an agent that is on,
|
|
50651
|
+
printed once as the login line to run on its machine; its previous key stops working
|
|
49827
50652
|
laze openclaw feed <connectionId> on|off bring its feed into your feed
|
|
49828
50653
|
laze openclaw disconnect <connectionId> remove it, its Laze agents and its credentials`;
|
|
49829
50654
|
function wordAt4(args, index) {
|
|
@@ -49836,6 +50661,13 @@ function switchAt(args, index) {
|
|
|
49836
50661
|
if (word2 !== "on" && word2 !== "off") throw new CliUsageError(OPENCLAW_USAGE);
|
|
49837
50662
|
return word2 === "on";
|
|
49838
50663
|
}
|
|
50664
|
+
function scheduleLine(cron) {
|
|
50665
|
+
let next = "off";
|
|
50666
|
+
if (cron.enabled) next = cron.nextRunAt ? `next ${cron.nextRunAt}` : "";
|
|
50667
|
+
const last = cron.lastRunAt ? `last ${cron.lastRunAt} ${cron.lastStatus ?? ""}`.trim() : "";
|
|
50668
|
+
return ` schedule ${cron.name} ${cron.schedule} ${next} ${last}
|
|
50669
|
+
`;
|
|
50670
|
+
}
|
|
49839
50671
|
function printConnection2({
|
|
49840
50672
|
context,
|
|
49841
50673
|
connection
|
|
@@ -49856,6 +50688,7 @@ function printConnection2({
|
|
|
49856
50688
|
const state = agent2.lazeAgentId ? `on as ${agent2.lazeAgentId}` : "off";
|
|
49857
50689
|
context.out(` ${agent2.openclawAgentId} ${agent2.name} ${state}
|
|
49858
50690
|
`);
|
|
50691
|
+
for (const cron of agent2.crons) context.out(scheduleLine(cron));
|
|
49859
50692
|
}
|
|
49860
50693
|
}
|
|
49861
50694
|
function answer2({
|
|
@@ -49900,6 +50733,24 @@ var agent = async ({ context, args, client }) => {
|
|
|
49900
50733
|
});
|
|
49901
50734
|
answer2({ context, args, connection });
|
|
49902
50735
|
};
|
|
50736
|
+
function profileNameOf(agentName) {
|
|
50737
|
+
return agentName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "agent";
|
|
50738
|
+
}
|
|
50739
|
+
var agentKey = async ({ context, args, client, url: url2 }) => {
|
|
50740
|
+
const key = await client.post(OPENCLAW_KEY_PATHS.agentKey, {
|
|
50741
|
+
connectionId: wordAt4(args, 2),
|
|
50742
|
+
openclawAgentId: wordAt4(args, 3)
|
|
50743
|
+
});
|
|
50744
|
+
if (args.flags.json) return context.out(`${JSON.stringify(key)}
|
|
50745
|
+
`);
|
|
50746
|
+
context.out(
|
|
50747
|
+
`A new Laze key for ${key.agentName} (${key.agentId}), shown once; its previous key stopped working.
|
|
50748
|
+
In the agent's own folder on its machine run:
|
|
50749
|
+
npm i -g ${url2}/api/agents/cli/laze-cli.tgz
|
|
50750
|
+
laze login --token ${key.token} --url ${url2} --profile ${profileNameOf(key.agentName)} --here
|
|
50751
|
+
`
|
|
50752
|
+
);
|
|
50753
|
+
};
|
|
49903
50754
|
var feed2 = async ({ context, args, client }) => {
|
|
49904
50755
|
const connection = await client.post(OPENCLAW_KEY_PATHS.setFeed, {
|
|
49905
50756
|
connectionId: wordAt4(args, 2),
|
|
@@ -49913,7 +50764,14 @@ var disconnect = async ({ context, args, client }) => {
|
|
|
49913
50764
|
context.out(`Disconnected ${connectionId}.
|
|
49914
50765
|
`);
|
|
49915
50766
|
};
|
|
49916
|
-
var RUNS3 = {
|
|
50767
|
+
var RUNS3 = {
|
|
50768
|
+
list: list8,
|
|
50769
|
+
connect: connect3,
|
|
50770
|
+
agent,
|
|
50771
|
+
"agent-key": agentKey,
|
|
50772
|
+
feed: feed2,
|
|
50773
|
+
disconnect
|
|
50774
|
+
};
|
|
49917
50775
|
async function openclaw({
|
|
49918
50776
|
context,
|
|
49919
50777
|
args
|
|
@@ -49921,8 +50779,8 @@ async function openclaw({
|
|
|
49921
50779
|
const verb = args.words[1] ?? "list";
|
|
49922
50780
|
const run3 = Object.hasOwn(RUNS3, verb) ? RUNS3[verb] : void 0;
|
|
49923
50781
|
if (!run3) throw new CliUsageError(OPENCLAW_USAGE);
|
|
49924
|
-
const { client } = await signedIn({ context, args });
|
|
49925
|
-
await run3({ context, args, client });
|
|
50782
|
+
const { client, profile } = await signedIn({ context, args });
|
|
50783
|
+
await run3({ context, args, client, url: profile.url });
|
|
49926
50784
|
}
|
|
49927
50785
|
|
|
49928
50786
|
// src/services/ops-commands.service.ts
|
|
@@ -50044,7 +50902,7 @@ function watchingRelease({
|
|
|
50044
50902
|
}
|
|
50045
50903
|
|
|
50046
50904
|
// src/services/schedule-commands.service.ts
|
|
50047
|
-
var
|
|
50905
|
+
var USAGE14 = `Usage:
|
|
50048
50906
|
laze schedule add <name> --prompt <text> (--cron "<m h dom mon dow>" | --rrule "<RRULE>" | --at <local time>)
|
|
50049
50907
|
[--tz <IANA zone>] [--channel <channelId>] [--agent <agentId>]
|
|
50050
50908
|
laze schedule list
|
|
@@ -50058,7 +50916,7 @@ function timingOf(args) {
|
|
|
50058
50916
|
const given = [cron, rrule, at].filter(Boolean);
|
|
50059
50917
|
if (given.length !== 1)
|
|
50060
50918
|
throw new CliUsageError(`Give exactly one of --cron, --rrule or --at.
|
|
50061
|
-
${
|
|
50919
|
+
${USAGE14}`);
|
|
50062
50920
|
if (cron) return { kind: "cron", cron };
|
|
50063
50921
|
if (rrule) return { kind: "rrule", rrule };
|
|
50064
50922
|
return { kind: "once", at };
|
|
@@ -50073,7 +50931,7 @@ function printSchedule({ context, schedule: schedule2 }) {
|
|
|
50073
50931
|
async function scheduleAdd({ context, args }) {
|
|
50074
50932
|
const name2 = args.words.slice(2).join(" ").trim();
|
|
50075
50933
|
const prompt = flagText({ args, name: "prompt" });
|
|
50076
|
-
if (!name2 || !prompt) throw new CliUsageError(
|
|
50934
|
+
if (!name2 || !prompt) throw new CliUsageError(USAGE14);
|
|
50077
50935
|
const timing = timingOf(args);
|
|
50078
50936
|
const { client } = await signedIn({ context, args });
|
|
50079
50937
|
const channelId = flagText({ args, name: "channel" });
|
|
@@ -50110,7 +50968,7 @@ function changesOf2(args) {
|
|
|
50110
50968
|
async function scheduleUpdate({ context, args }) {
|
|
50111
50969
|
const scheduleId = args.words[2];
|
|
50112
50970
|
const changes = changesOf2(args);
|
|
50113
|
-
if (!scheduleId || Object.keys(changes).length === 0) throw new CliUsageError(
|
|
50971
|
+
if (!scheduleId || Object.keys(changes).length === 0) throw new CliUsageError(USAGE14);
|
|
50114
50972
|
const { client } = await signedIn({ context, args });
|
|
50115
50973
|
const schedule2 = await client.post("/api/schedules/update", { scheduleId, ...changes });
|
|
50116
50974
|
if (args.flags.json) return context.out(`${JSON.stringify(schedule2, null, 2)}
|
|
@@ -50127,7 +50985,7 @@ async function scheduleList({ context, args }) {
|
|
|
50127
50985
|
function byId(path) {
|
|
50128
50986
|
return async ({ context, args }) => {
|
|
50129
50987
|
const scheduleId = args.words[2];
|
|
50130
|
-
if (!scheduleId) throw new CliUsageError(
|
|
50988
|
+
if (!scheduleId) throw new CliUsageError(USAGE14);
|
|
50131
50989
|
const { client } = await signedIn({ context, args });
|
|
50132
50990
|
const answer4 = await client.post(`/api/schedules/${path}`, {
|
|
50133
50991
|
scheduleId
|
|
@@ -50141,7 +50999,7 @@ function byId(path) {
|
|
|
50141
50999
|
}
|
|
50142
51000
|
async function scheduleRuns({ context, args }) {
|
|
50143
51001
|
const scheduleId = args.words[2];
|
|
50144
|
-
if (!scheduleId) throw new CliUsageError(
|
|
51002
|
+
if (!scheduleId) throw new CliUsageError(USAGE14);
|
|
50145
51003
|
const { client } = await signedIn({ context, args });
|
|
50146
51004
|
const runs = await client.post("/api/schedules/runs", { scheduleId });
|
|
50147
51005
|
if (args.flags.json) return context.out(`${JSON.stringify(runs, null, 2)}
|
|
@@ -50165,14 +51023,14 @@ var SCHEDULE_COMMANDS = {
|
|
|
50165
51023
|
async function schedule({ context, args }) {
|
|
50166
51024
|
const name2 = args.words[1] ?? "";
|
|
50167
51025
|
const command = Object.hasOwn(SCHEDULE_COMMANDS, name2) ? SCHEDULE_COMMANDS[name2] : void 0;
|
|
50168
|
-
if (!command) throw new CliUsageError(
|
|
51026
|
+
if (!command) throw new CliUsageError(USAGE14);
|
|
50169
51027
|
await command({ context, args });
|
|
50170
51028
|
}
|
|
50171
51029
|
|
|
50172
51030
|
// src/services/skill-commands.service.ts
|
|
50173
51031
|
import { readdir as readdir3, readFile as readFile21 } from "node:fs/promises";
|
|
50174
51032
|
import { join as join12, relative as relative3, resolve as resolve9 } from "node:path";
|
|
50175
|
-
var
|
|
51033
|
+
var USAGE15 = `Usage:
|
|
50176
51034
|
laze skill list [--agent <agentId>]
|
|
50177
51035
|
laze skill install <catalogue-id> [--as <name>] [--agent <agentId>]
|
|
50178
51036
|
laze skill install --from <folder> [--as <name>] [--agent <agentId>] a folder with a SKILL.md
|
|
@@ -50211,7 +51069,7 @@ async function skillList({ context, args }) {
|
|
|
50211
51069
|
async function skillInstall({ context, args }) {
|
|
50212
51070
|
const catalogueId = args.words[2];
|
|
50213
51071
|
const from = flagText({ args, name: "from" });
|
|
50214
|
-
if (!catalogueId === !from) throw new CliUsageError(
|
|
51072
|
+
if (!catalogueId === !from) throw new CliUsageError(USAGE15);
|
|
50215
51073
|
const name2 = flagText({ args, name: "as" });
|
|
50216
51074
|
const agent2 = flagText({ args, name: "agent" });
|
|
50217
51075
|
const files2 = from ? await folderFiles({ root: resolve9(context.cwd, from) }) : void 0;
|
|
@@ -50229,7 +51087,7 @@ async function skillInstall({ context, args }) {
|
|
|
50229
51087
|
}
|
|
50230
51088
|
async function skillShow({ context, args }) {
|
|
50231
51089
|
const name2 = args.words[2];
|
|
50232
|
-
if (!name2) throw new CliUsageError(
|
|
51090
|
+
if (!name2) throw new CliUsageError(USAGE15);
|
|
50233
51091
|
const agent2 = flagText({ args, name: "agent" });
|
|
50234
51092
|
const { client } = await signedIn({ context, args });
|
|
50235
51093
|
const skill2 = await client.post("/api/skills/show", {
|
|
@@ -50262,7 +51120,7 @@ function agentFlag(args) {
|
|
|
50262
51120
|
}
|
|
50263
51121
|
async function skillRemove({ context, args }) {
|
|
50264
51122
|
const name2 = args.words[2];
|
|
50265
|
-
if (!name2) throw new CliUsageError(
|
|
51123
|
+
if (!name2) throw new CliUsageError(USAGE15);
|
|
50266
51124
|
const { client } = await signedIn({ context, args });
|
|
50267
51125
|
const removed = await client.post("/api/skills/remove", {
|
|
50268
51126
|
name: name2,
|
|
@@ -50279,7 +51137,7 @@ async function skillUpdate({ context, args }) {
|
|
|
50279
51137
|
const description = typeof args.flags.description === "string" ? args.flags.description : void 0;
|
|
50280
51138
|
const skillMdFile = flagText({ args, name: "skill-md" });
|
|
50281
51139
|
if (!name2 || !newName && description === void 0 && !skillMdFile) {
|
|
50282
|
-
throw new CliUsageError(
|
|
51140
|
+
throw new CliUsageError(USAGE15);
|
|
50283
51141
|
}
|
|
50284
51142
|
const skillMd = skillMdFile ? await readFile21(resolve9(context.cwd, skillMdFile), "utf8") : void 0;
|
|
50285
51143
|
const { client } = await signedIn({ context, args });
|
|
@@ -50306,7 +51164,7 @@ var SKILL_COMMANDS = {
|
|
|
50306
51164
|
async function skill({ context, args }) {
|
|
50307
51165
|
const name2 = args.words[1] ?? "";
|
|
50308
51166
|
const command = Object.hasOwn(SKILL_COMMANDS, name2) ? SKILL_COMMANDS[name2] : void 0;
|
|
50309
|
-
if (!command) throw new CliUsageError(
|
|
51167
|
+
if (!command) throw new CliUsageError(USAGE15);
|
|
50310
51168
|
await command({ context, args });
|
|
50311
51169
|
}
|
|
50312
51170
|
|
|
@@ -50740,7 +51598,7 @@ async function enforce({ context, args }) {
|
|
|
50740
51598
|
} catch (error62) {
|
|
50741
51599
|
if (!(error62 instanceof LazeApiError) || error62.code !== "sign_in_not_tested") throw error62;
|
|
50742
51600
|
const base = profile.url.replace(/\/+$/, "");
|
|
50743
|
-
const settings2 = `${base}/workspaces/${encodeURIComponent(profile.workspaceId)}/settings/sign-in`;
|
|
51601
|
+
const settings2 = `${base}/workspaces/${encodeURIComponent(profile.workspaceId)}/settings/workspace?part=sign-in`;
|
|
50744
51602
|
context.err(
|
|
50745
51603
|
`laze: sign in through ${domain2}'s provider once in a browser first, so enforcing cannot lock you out: ${settings2}
|
|
50746
51604
|
`
|
|
@@ -50868,11 +51726,11 @@ function statusLine2({ presence: presence2 }) {
|
|
|
50868
51726
|
}
|
|
50869
51727
|
|
|
50870
51728
|
// src/services/status-commands.service.ts
|
|
50871
|
-
var
|
|
51729
|
+
var USAGE16 = "Usage: laze status set <emoji> [text] [--for 30m|1h|4h|today|week|never] [--tz <zone>], laze status clear|away|active";
|
|
50872
51730
|
function clearAfterOf({ args }) {
|
|
50873
51731
|
const wanted = flagText({ args, name: "for", fallback: "never" });
|
|
50874
51732
|
const known = STATUS_CLEAR_AFTER.find((candidate) => candidate === wanted);
|
|
50875
|
-
if (!known) throw new CliUsageError(
|
|
51733
|
+
if (!known) throw new CliUsageError(USAGE16);
|
|
50876
51734
|
return known;
|
|
50877
51735
|
}
|
|
50878
51736
|
function answer3({
|
|
@@ -50886,7 +51744,7 @@ function answer3({
|
|
|
50886
51744
|
}
|
|
50887
51745
|
async function statusSet({ context, args }) {
|
|
50888
51746
|
const [, , emoji3, ...words] = args.words;
|
|
50889
|
-
if (!emoji3) throw new CliUsageError(
|
|
51747
|
+
if (!emoji3) throw new CliUsageError(USAGE16);
|
|
50890
51748
|
const clearAfter = clearAfterOf({ args });
|
|
50891
51749
|
const timeZone = flagText({ args, name: "tz" }) || Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
50892
51750
|
const { client } = await signedIn({ context, args });
|
|
@@ -50910,7 +51768,7 @@ async function statusAway({ context, args }) {
|
|
|
50910
51768
|
answer3({ context, args, presence: presence2 });
|
|
50911
51769
|
}
|
|
50912
51770
|
async function statusUsage() {
|
|
50913
|
-
throw new CliUsageError(
|
|
51771
|
+
throw new CliUsageError(USAGE16);
|
|
50914
51772
|
}
|
|
50915
51773
|
|
|
50916
51774
|
// src/services/update-commands.service.ts
|
|
@@ -50959,14 +51817,14 @@ async function update2({
|
|
|
50959
51817
|
}
|
|
50960
51818
|
|
|
50961
51819
|
// src/services/vault-save-commands.service.ts
|
|
50962
|
-
var
|
|
51820
|
+
var USAGE17 = `Usage: laze vault save <pending> --name <name> --description "<what it is for>"
|
|
50963
51821
|
Names a key Laze held from a message you received, in the sender's vault.`;
|
|
50964
51822
|
var KEPT_IN_LAZE = "The key never left Laze: the chat, its history and your session hold only a reference, so there is nothing to rotate. Tell the person that.";
|
|
50965
51823
|
async function vaultSave({ context, args }) {
|
|
50966
51824
|
const pending = args.words[2];
|
|
50967
51825
|
const name2 = flagText({ args, name: "name" });
|
|
50968
51826
|
const description = flagText({ args, name: "description" });
|
|
50969
|
-
if (!pending || !name2 || !description) throw new CliUsageError(
|
|
51827
|
+
if (!pending || !name2 || !description) throw new CliUsageError(USAGE17);
|
|
50970
51828
|
const env = context.environment.inherited;
|
|
50971
51829
|
const turn = await turnTokenOf4({
|
|
50972
51830
|
env,
|
|
@@ -51062,8 +51920,8 @@ var WHATSAPP_BUSINESS_REST_PATHS = {
|
|
|
51062
51920
|
var WHATSAPP_BUSINESS_TEXT_MAX = 4096;
|
|
51063
51921
|
var WHATSAPP_BUSINESS_LIMIT_MAX = 200;
|
|
51064
51922
|
var WHATSAPP_BUSINESS_STATUS_WAIT_MAX_SECONDS = 50;
|
|
51065
|
-
var
|
|
51066
|
-
var workspaceInput4 = external_exports.object({ workspaceId:
|
|
51923
|
+
var workspaceIdSchema17 = external_exports.string().min(1).max(64);
|
|
51924
|
+
var workspaceInput4 = external_exports.object({ workspaceId: workspaceIdSchema17 });
|
|
51067
51925
|
var digits = (what) => external_exports.string().trim().regex(/^\d{5,30}$/, `${what} is the number Meta shows, digits only`);
|
|
51068
51926
|
var appSecretSchema = external_exports.string().trim().regex(/^[a-f0-9]{32}$/i, "The app secret is 32 letters and digits from App settings > Basic");
|
|
51069
51927
|
var accessTokenSchema = external_exports.string().trim().min(20, "The access token is the long permanent system user token").max(2e3).regex(/^\S+$/, "The access token is one line with no spaces");
|
|
@@ -51097,7 +51955,7 @@ var statusDefinition = external_exports.object({
|
|
|
51097
51955
|
});
|
|
51098
51956
|
var whatsappBusinessStatusSchema = statusDefinition;
|
|
51099
51957
|
var connectDefinition = external_exports.object({
|
|
51100
|
-
workspaceId:
|
|
51958
|
+
workspaceId: workspaceIdSchema17,
|
|
51101
51959
|
appId: digits("The app id"),
|
|
51102
51960
|
wabaId: digits("The WhatsApp Business Account id"),
|
|
51103
51961
|
phoneNumberId: digits("The phone number id"),
|
|
@@ -51120,7 +51978,7 @@ var webhookDefinition = external_exports.object({
|
|
|
51120
51978
|
});
|
|
51121
51979
|
var whatsappBusinessWebhookSchema = webhookDefinition;
|
|
51122
51980
|
var settingsDefinition = external_exports.object({
|
|
51123
|
-
workspaceId:
|
|
51981
|
+
workspaceId: workspaceIdSchema17,
|
|
51124
51982
|
/** The agent that answers; null for none. Left out keeps the current one. */
|
|
51125
51983
|
agentId: external_exports.string().min(1).max(64).nullable().optional(),
|
|
51126
51984
|
replyMode: whatsappBusinessReplyModeSchema.optional()
|
|
@@ -51140,7 +51998,7 @@ var whatsappBusinessConversationSchema = conversationDefinition;
|
|
|
51140
51998
|
var limitSchema2 = external_exports.number().int().min(1).max(WHATSAPP_BUSINESS_LIMIT_MAX);
|
|
51141
51999
|
var contactRefSchema = external_exports.string().trim().min(1).max(64);
|
|
51142
52000
|
var conversationsInputDefinition = external_exports.object({
|
|
51143
|
-
workspaceId:
|
|
52001
|
+
workspaceId: workspaceIdSchema17,
|
|
51144
52002
|
limit: limitSchema2.optional()
|
|
51145
52003
|
});
|
|
51146
52004
|
var whatsappBusinessConversationsInputSchema = conversationsInputDefinition;
|
|
@@ -51166,7 +52024,7 @@ var messageDefinition = external_exports.object({
|
|
|
51166
52024
|
template: external_exports.string().nullable()
|
|
51167
52025
|
});
|
|
51168
52026
|
var readInputDefinition2 = external_exports.object({
|
|
51169
|
-
workspaceId:
|
|
52027
|
+
workspaceId: workspaceIdSchema17,
|
|
51170
52028
|
contact: contactRefSchema,
|
|
51171
52029
|
limit: limitSchema2.optional()
|
|
51172
52030
|
});
|
|
@@ -51175,12 +52033,12 @@ var readDefinition = external_exports.object({
|
|
|
51175
52033
|
messages: external_exports.array(messageDefinition)
|
|
51176
52034
|
});
|
|
51177
52035
|
var sendInputDefinition2 = external_exports.object({
|
|
51178
|
-
workspaceId:
|
|
52036
|
+
workspaceId: workspaceIdSchema17,
|
|
51179
52037
|
to: contactRefSchema,
|
|
51180
52038
|
text: external_exports.string().trim().min(1).max(WHATSAPP_BUSINESS_TEXT_MAX)
|
|
51181
52039
|
});
|
|
51182
52040
|
var sendTemplateInputDefinition = external_exports.object({
|
|
51183
|
-
workspaceId:
|
|
52041
|
+
workspaceId: workspaceIdSchema17,
|
|
51184
52042
|
to: contactRefSchema,
|
|
51185
52043
|
template: external_exports.string().trim().min(1).max(512),
|
|
51186
52044
|
/** The template's language code; the only approved one when left out. */
|
|
@@ -51207,7 +52065,7 @@ function whatsappBusinessSendSettled({
|
|
|
51207
52065
|
return state !== "waiting" && state !== "sending";
|
|
51208
52066
|
}
|
|
51209
52067
|
var sendStatusInputDefinition2 = external_exports.object({
|
|
51210
|
-
workspaceId:
|
|
52068
|
+
workspaceId: workspaceIdSchema17,
|
|
51211
52069
|
sendId: external_exports.string().min(1).max(64),
|
|
51212
52070
|
waitSeconds: external_exports.number().int().min(0).max(WHATSAPP_BUSINESS_STATUS_WAIT_MAX_SECONDS).default(0)
|
|
51213
52071
|
});
|
|
@@ -51257,7 +52115,7 @@ var restSendStatusDefinition2 = sendStatusInputDefinition2.omit({ workspaceId: t
|
|
|
51257
52115
|
var restSettingsDefinition = settingsDefinition.omit({ workspaceId: true });
|
|
51258
52116
|
var restEmptyDefinition = external_exports.object({});
|
|
51259
52117
|
var WhatsappBusinessApi = moduleApi()("whatsapp-business");
|
|
51260
|
-
var whatsappBusinessTrpc = defineTrpcContract("whatsappBusiness").query("status").withInput(workspaceInput4).withOutput(whatsappBusinessStatusSchema).mutation("connect").withInput(connectWhatsappBusinessInputSchema).withOutput(whatsappBusinessWebhookSchema).mutation("check").withInput(workspaceInput4).withOutput(whatsappBusinessStatusSchema).mutation("verifyToken").withInput(workspaceInput4).withOutput(whatsappBusinessWebhookSchema).mutation("settings").withInput(updateWhatsappBusinessSettingsInputSchema).withOutput(whatsappBusinessStatusSchema).mutation("disconnect").withInput(workspaceInput4).withOutput(whatsappBusinessStatusSchema).query("conversations").withInput(whatsappBusinessConversationsInputSchema).withOutput(external_exports.array(whatsappBusinessConversationSchema)).query("templates").withInput(workspaceInput4).withOutput(external_exports.array(whatsappBusinessTemplateSchema)).query("prices").withInput(external_exports.object({ ...pricesInputDefinition.shape, workspaceId:
|
|
52118
|
+
var whatsappBusinessTrpc = defineTrpcContract("whatsappBusiness").query("status").withInput(workspaceInput4).withOutput(whatsappBusinessStatusSchema).mutation("connect").withInput(connectWhatsappBusinessInputSchema).withOutput(whatsappBusinessWebhookSchema).mutation("check").withInput(workspaceInput4).withOutput(whatsappBusinessStatusSchema).mutation("verifyToken").withInput(workspaceInput4).withOutput(whatsappBusinessWebhookSchema).mutation("settings").withInput(updateWhatsappBusinessSettingsInputSchema).withOutput(whatsappBusinessStatusSchema).mutation("disconnect").withInput(workspaceInput4).withOutput(whatsappBusinessStatusSchema).query("conversations").withInput(whatsappBusinessConversationsInputSchema).withOutput(external_exports.array(whatsappBusinessConversationSchema)).query("templates").withInput(workspaceInput4).withOutput(external_exports.array(whatsappBusinessTemplateSchema)).query("prices").withInput(external_exports.object({ ...pricesInputDefinition.shape, workspaceId: workspaceIdSchema17 })).withOutput(whatsappBusinessPricesSchema).build();
|
|
51261
52119
|
|
|
51262
52120
|
// ../../modules/whatsapp-business/contract/src/whatsapp-business.config.ts
|
|
51263
52121
|
var whatsappBusinessConfig = Config.define((c) => ({
|
|
@@ -51721,7 +52579,7 @@ var PATHS3 = {
|
|
|
51721
52579
|
var STATUS_WAIT_SECONDS2 = 50;
|
|
51722
52580
|
var STATUS_CALLS2 = 2;
|
|
51723
52581
|
var SETTLED = /* @__PURE__ */ new Set(["sent", "denied", "expired", "failed"]);
|
|
51724
|
-
var
|
|
52582
|
+
var USAGE18 = [
|
|
51725
52583
|
"Usage: laze whatsapp chats <machine> [--limit <n>] the chats on the machine, newest first",
|
|
51726
52584
|
" laze whatsapp read <machine> <chat> [--limit <n>] a chat's last messages, oldest first",
|
|
51727
52585
|
' laze whatsapp send <machine> <chat> "<text>" send as the owner; an agent waits for their approval',
|
|
@@ -51731,14 +52589,14 @@ var USAGE17 = [
|
|
|
51731
52589
|
].join("\n");
|
|
51732
52590
|
function word({ args, at }) {
|
|
51733
52591
|
const value = args.words[at];
|
|
51734
|
-
if (!value) throw new CliUsageError(
|
|
52592
|
+
if (!value) throw new CliUsageError(USAGE18);
|
|
51735
52593
|
return value;
|
|
51736
52594
|
}
|
|
51737
52595
|
function limitOf5({ args }) {
|
|
51738
52596
|
const text2 = flagText({ args, name: "limit" });
|
|
51739
52597
|
if (!text2) return {};
|
|
51740
52598
|
const limit = Number(text2);
|
|
51741
|
-
if (!Number.isInteger(limit) || limit < 1) throw new CliUsageError(
|
|
52599
|
+
if (!Number.isInteger(limit) || limit < 1) throw new CliUsageError(USAGE18);
|
|
51742
52600
|
return { limit };
|
|
51743
52601
|
}
|
|
51744
52602
|
async function chats({ context, args }) {
|
|
@@ -51800,7 +52658,7 @@ Still waiting. Run \`laze whatsapp status ${send3.id}\` later to see the answer.
|
|
|
51800
52658
|
}
|
|
51801
52659
|
async function send2({ context, args }) {
|
|
51802
52660
|
const text2 = args.words.slice(4).join(" ") || args.rest.join(" ");
|
|
51803
|
-
if (!text2) throw new CliUsageError(
|
|
52661
|
+
if (!text2) throw new CliUsageError(USAGE18);
|
|
51804
52662
|
const client = await computeClient({ context, args });
|
|
51805
52663
|
const asked = await client.post(PATHS3.send, {
|
|
51806
52664
|
machine: word({ args, at: 2 }),
|
|
@@ -51830,11 +52688,11 @@ async function whatsapp({
|
|
|
51830
52688
|
if (command === "status") return status6({ context, args });
|
|
51831
52689
|
const linking = whatsappPairingCommand(command);
|
|
51832
52690
|
if (linking) return linking({ context, args });
|
|
51833
|
-
throw new CliUsageError(
|
|
52691
|
+
throw new CliUsageError(USAGE18);
|
|
51834
52692
|
}
|
|
51835
52693
|
|
|
51836
52694
|
// src/services/wiki-commands.service.ts
|
|
51837
|
-
var
|
|
52695
|
+
var USAGE19 = `Usage:
|
|
51838
52696
|
laze wiki list
|
|
51839
52697
|
laze wiki get <path>
|
|
51840
52698
|
laze wiki put <path> <markdown|@file|-> [--title <title>] [--channel <channel>] [--base <version>]
|
|
@@ -51854,7 +52712,7 @@ async function wikiList({ context, args }) {
|
|
|
51854
52712
|
}
|
|
51855
52713
|
async function wikiGet({ context, args }) {
|
|
51856
52714
|
const path = args.words[2];
|
|
51857
|
-
if (!path) throw new CliUsageError(
|
|
52715
|
+
if (!path) throw new CliUsageError(USAGE19);
|
|
51858
52716
|
const { client } = await signedIn({ context, args });
|
|
51859
52717
|
const page = await client.post("/api/wiki/get", { path });
|
|
51860
52718
|
if (args.flags.json) return context.out(`${JSON.stringify(page, null, 2)}
|
|
@@ -51871,7 +52729,7 @@ Linked from: ${page.backlinks.map((link) => link.path).join(", ")}
|
|
|
51871
52729
|
async function wikiPut({ context, args }) {
|
|
51872
52730
|
const path = args.words[2];
|
|
51873
52731
|
const value = args.words.slice(3).join(" ");
|
|
51874
|
-
if (!path || !value) throw new CliUsageError(
|
|
52732
|
+
if (!path || !value) throw new CliUsageError(USAGE19);
|
|
51875
52733
|
const body = await textArgument({ context, value });
|
|
51876
52734
|
const title = flagText({ args, name: "title" });
|
|
51877
52735
|
const channel = flagText({ args, name: "channel" });
|
|
@@ -51891,7 +52749,7 @@ async function wikiPut({ context, args }) {
|
|
|
51891
52749
|
}
|
|
51892
52750
|
async function wikiSearch({ context, args }) {
|
|
51893
52751
|
const query = args.words.slice(2).join(" ").trim();
|
|
51894
|
-
if (!query) throw new CliUsageError(
|
|
52752
|
+
if (!query) throw new CliUsageError(USAGE19);
|
|
51895
52753
|
const { client } = await signedIn({ context, args });
|
|
51896
52754
|
const hits = await client.post("/api/wiki/search", { query });
|
|
51897
52755
|
if (args.flags.json) return context.out(`${JSON.stringify(hits, null, 2)}
|
|
@@ -51901,7 +52759,7 @@ async function wikiSearch({ context, args }) {
|
|
|
51901
52759
|
}
|
|
51902
52760
|
async function wikiHistory({ context, args }) {
|
|
51903
52761
|
const path = args.words[2];
|
|
51904
|
-
if (!path) throw new CliUsageError(
|
|
52762
|
+
if (!path) throw new CliUsageError(USAGE19);
|
|
51905
52763
|
const { client } = await signedIn({ context, args });
|
|
51906
52764
|
const revisions = await client.post("/api/wiki/history", { path });
|
|
51907
52765
|
if (args.flags.json) return context.out(`${JSON.stringify(revisions, null, 2)}
|
|
@@ -51915,7 +52773,7 @@ async function wikiHistory({ context, args }) {
|
|
|
51915
52773
|
}
|
|
51916
52774
|
async function wikiMove({ context, args }) {
|
|
51917
52775
|
const [, , path, to] = args.words;
|
|
51918
|
-
if (!path || !to) throw new CliUsageError(
|
|
52776
|
+
if (!path || !to) throw new CliUsageError(USAGE19);
|
|
51919
52777
|
const { client } = await signedIn({ context, args });
|
|
51920
52778
|
const page = await client.post("/api/wiki/move", { path, to });
|
|
51921
52779
|
if (args.flags.json) return context.out(`${JSON.stringify(page, null, 2)}
|
|
@@ -51925,7 +52783,7 @@ async function wikiMove({ context, args }) {
|
|
|
51925
52783
|
}
|
|
51926
52784
|
async function wikiRemove({ context, args }) {
|
|
51927
52785
|
const path = args.words[2];
|
|
51928
|
-
if (!path) throw new CliUsageError(
|
|
52786
|
+
if (!path) throw new CliUsageError(USAGE19);
|
|
51929
52787
|
const { client } = await signedIn({ context, args });
|
|
51930
52788
|
const removed = await client.post("/api/wiki/remove", { path });
|
|
51931
52789
|
if (args.flags.json) return context.out(`${JSON.stringify(removed)}
|
|
@@ -51945,7 +52803,7 @@ var WIKI_COMMANDS = {
|
|
|
51945
52803
|
async function wiki({ context, args }) {
|
|
51946
52804
|
const name2 = args.words[1] ?? "";
|
|
51947
52805
|
const command = Object.hasOwn(WIKI_COMMANDS, name2) ? WIKI_COMMANDS[name2] : void 0;
|
|
51948
|
-
if (!command) throw new CliUsageError(
|
|
52806
|
+
if (!command) throw new CliUsageError(USAGE19);
|
|
51949
52807
|
await command({ context, args });
|
|
51950
52808
|
}
|
|
51951
52809
|
|
|
@@ -52029,14 +52887,14 @@ function roleOf2(word2) {
|
|
|
52029
52887
|
return CALLER_WORKSPACE_ROLES.find((role2) => role2 === upper);
|
|
52030
52888
|
}
|
|
52031
52889
|
var anOf = (role2) => role2 === "ADMIN" || role2 === "OWNER" ? "an" : "a";
|
|
52032
|
-
function
|
|
52890
|
+
function print8({ context, args, answer: answer4, text: text2 }) {
|
|
52033
52891
|
context.out(args.flags.json ? `${JSON.stringify(answer4, null, 2)}
|
|
52034
52892
|
` : text2(answer4));
|
|
52035
52893
|
}
|
|
52036
52894
|
async function current({ context, args }) {
|
|
52037
52895
|
const { client } = await signedIn({ context, args });
|
|
52038
52896
|
const answer4 = await client.get("/api/workspaces/current");
|
|
52039
|
-
|
|
52897
|
+
print8({
|
|
52040
52898
|
context,
|
|
52041
52899
|
args,
|
|
52042
52900
|
answer: answer4,
|
|
@@ -52051,7 +52909,7 @@ ${deleting}`;
|
|
|
52051
52909
|
async function mine2({ context, args }) {
|
|
52052
52910
|
const { client } = await signedIn({ context, args });
|
|
52053
52911
|
const answer4 = await client.post("/api/agents/me/workspace/mine", {});
|
|
52054
|
-
|
|
52912
|
+
print8({
|
|
52055
52913
|
context,
|
|
52056
52914
|
args,
|
|
52057
52915
|
answer: answer4,
|
|
@@ -52064,7 +52922,7 @@ async function rename6({ context, args }) {
|
|
|
52064
52922
|
if (!name2) throw new CliUsageError("Usage: laze workspace rename <name>");
|
|
52065
52923
|
const { client } = await signedIn({ context, args });
|
|
52066
52924
|
const answer4 = await client.post("/api/agents/me/workspace/rename", { name: name2 });
|
|
52067
|
-
|
|
52925
|
+
print8({ context, args, answer: answer4, text: (it) => `Renamed the workspace to ${it.name}.
|
|
52068
52926
|
` });
|
|
52069
52927
|
}
|
|
52070
52928
|
async function create2({ context, args }) {
|
|
@@ -52072,7 +52930,7 @@ async function create2({ context, args }) {
|
|
|
52072
52930
|
if (!name2) throw new CliUsageError("Usage: laze workspace create <name>");
|
|
52073
52931
|
const { client } = await signedIn({ context, args });
|
|
52074
52932
|
const answer4 = await client.post("/api/agents/me/workspace/create", { name: name2 });
|
|
52075
|
-
|
|
52933
|
+
print8({
|
|
52076
52934
|
context,
|
|
52077
52935
|
args,
|
|
52078
52936
|
answer: answer4,
|
|
@@ -52083,7 +52941,7 @@ async function create2({ context, args }) {
|
|
|
52083
52941
|
async function leave({ context, args }) {
|
|
52084
52942
|
const { client } = await signedIn({ context, args });
|
|
52085
52943
|
const answer4 = await client.post("/api/agents/me/workspace/leave", {});
|
|
52086
|
-
|
|
52944
|
+
print8({ context, args, answer: answer4, text: () => "You left the workspace.\n" });
|
|
52087
52945
|
}
|
|
52088
52946
|
async function scheduleDeletion({ context, args }) {
|
|
52089
52947
|
const confirmName = flagText({ args, name: "confirm" });
|
|
@@ -52096,7 +52954,7 @@ async function scheduleDeletion({ context, args }) {
|
|
|
52096
52954
|
const answer4 = await client.post("/api/agents/me/workspace/delete", {
|
|
52097
52955
|
confirmName
|
|
52098
52956
|
});
|
|
52099
|
-
|
|
52957
|
+
print8({
|
|
52100
52958
|
context,
|
|
52101
52959
|
args,
|
|
52102
52960
|
answer: answer4,
|
|
@@ -52110,7 +52968,7 @@ async function cancelDeletion({ context, args }) {
|
|
|
52110
52968
|
"/api/agents/me/workspace/cancel-deletion",
|
|
52111
52969
|
{}
|
|
52112
52970
|
);
|
|
52113
|
-
|
|
52971
|
+
print8({
|
|
52114
52972
|
context,
|
|
52115
52973
|
args,
|
|
52116
52974
|
answer: answer4,
|
|
@@ -52143,7 +53001,7 @@ async function listWorkspaces({ context, args }) {
|
|
|
52143
53001
|
preferred: name2
|
|
52144
53002
|
}) ?? null
|
|
52145
53003
|
}));
|
|
52146
|
-
|
|
53004
|
+
print8({
|
|
52147
53005
|
context,
|
|
52148
53006
|
args,
|
|
52149
53007
|
answer: answer4,
|
|
@@ -52178,7 +53036,7 @@ async function switchTo({ context, args }) {
|
|
|
52178
53036
|
);
|
|
52179
53037
|
}
|
|
52180
53038
|
await context.store.write({ ...config2, current: chosen });
|
|
52181
|
-
|
|
53039
|
+
print8({
|
|
52182
53040
|
context,
|
|
52183
53041
|
args,
|
|
52184
53042
|
answer: { id: target.id, name: target.name, profile: chosen },
|
|
@@ -52217,13 +53075,13 @@ async function logo({ context, args }) {
|
|
|
52217
53075
|
const body = await readLogo({ context, file: file3 });
|
|
52218
53076
|
const { client } = await signedIn({ context, args });
|
|
52219
53077
|
const answer4 = await client.post("/api/agents/me/workspace/logo", body);
|
|
52220
|
-
return
|
|
53078
|
+
return print8({ context, args, answer: answer4, text: (it) => `Set the logo of ${it.name}.
|
|
52221
53079
|
` });
|
|
52222
53080
|
}
|
|
52223
53081
|
if (action === "remove") {
|
|
52224
53082
|
const { client } = await signedIn({ context, args });
|
|
52225
53083
|
const answer4 = await client.post("/api/agents/me/workspace/logo/remove", {});
|
|
52226
|
-
return
|
|
53084
|
+
return print8({
|
|
52227
53085
|
context,
|
|
52228
53086
|
args,
|
|
52229
53087
|
answer: answer4,
|
|
@@ -52257,7 +53115,7 @@ async function workspace({ context, args }) {
|
|
|
52257
53115
|
async function list9({ context, args }) {
|
|
52258
53116
|
const { client } = await signedIn({ context, args });
|
|
52259
53117
|
const answer4 = await client.get("/api/workspaces/current/members");
|
|
52260
|
-
|
|
53118
|
+
print8({
|
|
52261
53119
|
context,
|
|
52262
53120
|
args,
|
|
52263
53121
|
answer: answer4,
|
|
@@ -52276,7 +53134,7 @@ async function invite({ context, args }) {
|
|
|
52276
53134
|
email: email3,
|
|
52277
53135
|
role: role2
|
|
52278
53136
|
});
|
|
52279
|
-
|
|
53137
|
+
print8({
|
|
52280
53138
|
context,
|
|
52281
53139
|
args,
|
|
52282
53140
|
answer: answer4,
|
|
@@ -52288,7 +53146,7 @@ async function invite({ context, args }) {
|
|
|
52288
53146
|
async function invites({ context, args }) {
|
|
52289
53147
|
const { client } = await signedIn({ context, args });
|
|
52290
53148
|
const answer4 = await client.post("/api/agents/me/workspace/invites", {});
|
|
52291
|
-
|
|
53149
|
+
print8({
|
|
52292
53150
|
context,
|
|
52293
53151
|
args,
|
|
52294
53152
|
answer: answer4,
|
|
@@ -52307,7 +53165,7 @@ async function revokeInvite({ context, args }) {
|
|
|
52307
53165
|
"/api/agents/me/workspace/revoke-invite",
|
|
52308
53166
|
{ invite: wanted }
|
|
52309
53167
|
);
|
|
52310
|
-
|
|
53168
|
+
print8({ context, args, answer: answer4, text: (it) => `Revoked the invitation for ${it.email}.
|
|
52311
53169
|
` });
|
|
52312
53170
|
}
|
|
52313
53171
|
async function role({ context, args }) {
|
|
@@ -52321,7 +53179,7 @@ async function role({ context, args }) {
|
|
|
52321
53179
|
member,
|
|
52322
53180
|
role: picked
|
|
52323
53181
|
});
|
|
52324
|
-
|
|
53182
|
+
print8({
|
|
52325
53183
|
context,
|
|
52326
53184
|
args,
|
|
52327
53185
|
answer: answer4,
|
|
@@ -52336,13 +53194,13 @@ async function remove4({ context, args }) {
|
|
|
52336
53194
|
const answer4 = await client.post("/api/agents/me/workspace/remove", {
|
|
52337
53195
|
member
|
|
52338
53196
|
});
|
|
52339
|
-
|
|
53197
|
+
print8({ context, args, answer: answer4, text: (it) => `Removed ${it.name} from the workspace.
|
|
52340
53198
|
` });
|
|
52341
53199
|
}
|
|
52342
53200
|
async function requests({ context, args }) {
|
|
52343
53201
|
const { client } = await signedIn({ context, args });
|
|
52344
53202
|
const answer4 = await client.post("/api/agents/me/workspace/requests", {});
|
|
52345
|
-
|
|
53203
|
+
print8({
|
|
52346
53204
|
context,
|
|
52347
53205
|
args,
|
|
52348
53206
|
answer: answer4,
|
|
@@ -52362,7 +53220,7 @@ function deciding(decision) {
|
|
|
52362
53220
|
requestId,
|
|
52363
53221
|
decision
|
|
52364
53222
|
});
|
|
52365
|
-
|
|
53223
|
+
print8({
|
|
52366
53224
|
context,
|
|
52367
53225
|
args,
|
|
52368
53226
|
answer: answer4,
|
|
@@ -52397,7 +53255,8 @@ async function members2({ context, args }) {
|
|
|
52397
53255
|
// src/services/laze-cli.service.ts
|
|
52398
53256
|
var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
52399
53257
|
|
|
52400
|
-
laze login [--url <server>] [--token lz_...] sign in (opens a browser code)
|
|
53258
|
+
laze login [--url <server>] [--token lz_...] [--profile <name> --here] sign in (opens a browser code);
|
|
53259
|
+
--here uses the profile only in this folder and below, so agents sharing a machine keep their own
|
|
52401
53260
|
laze --version the version of this CLI
|
|
52402
53261
|
laze update [--dry-run] install the latest release (npm, pnpm, bun or yarn)
|
|
52403
53262
|
laze logout revoke this profile's key and forget it
|
|
@@ -52486,13 +53345,16 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
52486
53345
|
laze app create <name> --template crm ... build an app: create, push, preview, publish, revert
|
|
52487
53346
|
laze app every laze app command, with its flags
|
|
52488
53347
|
laze agents list | laze agents status <name> the workspace's agents and their context
|
|
52489
|
-
laze join [--
|
|
53348
|
+
laze join [--workspace <name|link>] [--for <email>] [--name <name>] ask to join as an agent: a person approves once in their feed
|
|
52490
53349
|
laze agent link --token <token> [--name <name>] connect this Claude Code or Codex session
|
|
52491
53350
|
laze agent create --name <name> [--description <text>] [--harness laze-models|claude-code|codex] [--avatar <file>]
|
|
52492
53351
|
make an agent for your owner (or for you): personal, opened in their direct messages
|
|
52493
53352
|
--team makes a team agent; on Claude Code or Codex it needs --pool <pool>, a login pool to draw from
|
|
52494
53353
|
laze agent update <agent> [--name] [--description] [--avatar] [--context-window] change an agent your owner owns
|
|
52495
53354
|
laze agent archive <agent> remove an agent your owner owns
|
|
53355
|
+
laze agent pause|resume <agent> pause an agent Laze runs, or resume it
|
|
53356
|
+
laze agent transfer <agent> <member> hand a team agent to another member (id, email or name)
|
|
53357
|
+
laze agent reset-session <agent> stop its turn; its next message starts a fresh session
|
|
52496
53358
|
laze agent logins list|add|rename|remove|check your Claude and Codex logins; a token is read from stdin only
|
|
52497
53359
|
laze agent pools list|create|rename|delete|add-login|remove-login|grant|revoke shared login pools
|
|
52498
53360
|
laze agent set-pool <agent> <pool|none> the pool a Claude Code or Codex agent draws its logins from
|
|
@@ -52520,7 +53382,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
52520
53382
|
laze slack overview|link-prompts|link|unlink|channels|mirror|update|moves|move ... Slack as yourself
|
|
52521
53383
|
admins set Slack up too: install|setup|begin-setup|credentials|install-app|update-app|disconnect
|
|
52522
53384
|
laze connect providers|start|search|mcp|mcp-key|github|card|card-key connect services as yourself
|
|
52523
|
-
laze openclaw list|connect|agent|feed|disconnect your OpenClaw gateways and their agents
|
|
53385
|
+
laze openclaw list|connect|agent|agent-key|feed|disconnect your OpenClaw gateways and their agents
|
|
52524
53386
|
laze browser setup|cdp|screen|status <machine> a machine with Chrome a person signs in on, for agents
|
|
52525
53387
|
Sites without an API need a person's login: offer a browser machine, never ask for a password
|
|
52526
53388
|
laze browser setup <site> --on <machine> the browser on a person's own machine instead, at no Laze compute cost
|
|
@@ -52673,6 +53535,7 @@ var COMMANDS3 = {
|
|
|
52673
53535
|
"openclaw list": openclaw,
|
|
52674
53536
|
"openclaw connect": openclaw,
|
|
52675
53537
|
"openclaw agent": openclaw,
|
|
53538
|
+
"openclaw agent-key": openclaw,
|
|
52676
53539
|
"openclaw feed": openclaw,
|
|
52677
53540
|
"openclaw disconnect": openclaw,
|
|
52678
53541
|
"vault scrub": vaultScrub,
|
|
@@ -52689,6 +53552,10 @@ var COMMANDS3 = {
|
|
|
52689
53552
|
"agent create": createAgent,
|
|
52690
53553
|
"agent update": updateAgent,
|
|
52691
53554
|
"agent archive": archiveAgent,
|
|
53555
|
+
"agent pause": pauseAgent,
|
|
53556
|
+
"agent resume": pauseAgent,
|
|
53557
|
+
"agent transfer": transferAgent,
|
|
53558
|
+
"agent reset-session": resetAgentSession,
|
|
52692
53559
|
"agent logins": agentLogins,
|
|
52693
53560
|
"agent pools": agentPools,
|
|
52694
53561
|
"agent set-pool": setAgentPool,
|