@lazehq/cli 0.1.94 → 0.1.96

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.
Files changed (2) hide show
  1. package/dist/laze.mjs +456 -125
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -37069,10 +37069,13 @@ function chooseProfile({
37069
37069
  config: config2,
37070
37070
  flag: flag2,
37071
37071
  environment,
37072
+ session,
37072
37073
  cwd
37073
37074
  }) {
37075
+ const heard = session ? config2.sessions?.[session] : void 0;
37076
+ const sessionBound = heard && config2.profiles[heard] ? heard : void 0;
37074
37077
  const bound = boundProfileOf({ bindings: config2.bindings, cwd });
37075
- const name3 = flag2 || environment || bound || config2.current;
37078
+ const name3 = flag2 || environment || sessionBound || bound || config2.current;
37076
37079
  const profile = name3 ? config2.profiles[name3] : void 0;
37077
37080
  return name3 && profile ? { name: name3, profile } : { name: void 0, profile: void 0 };
37078
37081
  }
@@ -37171,7 +37174,7 @@ function flagText({
37171
37174
  }
37172
37175
 
37173
37176
  // src/rules/cli-version.rules.ts
37174
- var STAMPED = "0.1.94";
37177
+ var STAMPED = "0.1.96";
37175
37178
  function cliVersionOf({ stamped = STAMPED } = {}) {
37176
37179
  return stamped.startsWith("__") ? "dev" : stamped;
37177
37180
  }
@@ -59504,6 +59507,9 @@ var { isSaas } = Config.define((c) => ({
59504
59507
  var { nodeEnvironment } = Config.define((c) => ({
59505
59508
  nodeEnvironment: c.env("NODE_ENV", external_exports.string().optional())
59506
59509
  }));
59510
+ var { apiSlot } = Config.define((c) => ({
59511
+ apiSlot: c.env("LAZE_API_SLOT", external_exports.enum(["a", "b"]).default("a"))
59512
+ }));
59507
59513
  var { rawSocketPort } = Config.define((c) => ({
59508
59514
  rawSocketPort: c.env("VOICE_WS_PORT", external_exports.coerce.number().int().min(0).max(65535).default(3300))
59509
59515
  }));
@@ -60180,12 +60186,14 @@ var VAULT_GMAIL_SEND_PATHS = [
60180
60186
  "/upload/gmail/v1/users/*/drafts/send"
60181
60187
  ];
60182
60188
  var VAULT_MAX_LEASE_SECONDS = 2 * 86400;
60189
+ var VAULT_LONGEST_LEASE_SECONDS = 7 * 86400;
60183
60190
  var VAULT_LEASE_CHOICES = [
60184
60191
  15 * 60,
60185
60192
  3600,
60186
60193
  8 * 3600,
60187
60194
  86400,
60188
- VAULT_MAX_LEASE_SECONDS
60195
+ VAULT_MAX_LEASE_SECONDS,
60196
+ VAULT_LONGEST_LEASE_SECONDS
60189
60197
  ];
60190
60198
  var vaultConnectionSchemaDefinition = external_exports.object({
60191
60199
  id: external_exports.string().min(1),
@@ -60233,7 +60241,7 @@ var createVaultConnectionInputSchemaDefinition = external_exports.object({
60233
60241
  sensitivity: vaultSensitivitySchema.optional(),
60234
60242
  rules: external_exports.string().max(2e3).default(""),
60235
60243
  approverUserIds: external_exports.array(external_exports.string().min(1)).default([]),
60236
- maxLeaseSeconds: external_exports.number().int().positive().max(VAULT_MAX_LEASE_SECONDS).nullable().default(null),
60244
+ maxLeaseSeconds: external_exports.number().int().positive().max(VAULT_LONGEST_LEASE_SECONDS).nullable().default(null),
60237
60245
  everyUseAsks: external_exports.boolean().default(false),
60238
60246
  secret: vaultSecretBundleSchema,
60239
60247
  egress: vaultEgressTargetSchema.nullable().default(null)
@@ -60246,7 +60254,7 @@ var updateVaultConnectionInputSchemaDefinition = external_exports.object({
60246
60254
  sensitivity: vaultSensitivitySchema.optional(),
60247
60255
  rules: external_exports.string().max(2e3).optional(),
60248
60256
  approverUserIds: external_exports.array(external_exports.string().min(1)).optional(),
60249
- maxLeaseSeconds: external_exports.number().int().positive().max(VAULT_MAX_LEASE_SECONDS).nullable().optional(),
60257
+ maxLeaseSeconds: external_exports.number().int().positive().max(VAULT_LONGEST_LEASE_SECONDS).nullable().optional(),
60250
60258
  everyUseAsks: external_exports.boolean().optional(),
60251
60259
  /** On from anywhere; off only from the page, with a fresh device proof. */
60252
60260
  deviceApproval: external_exports.boolean().optional(),
@@ -60640,6 +60648,17 @@ var vaultMostAskedSchemaDefinition = external_exports.object({
60640
60648
  });
60641
60649
  var vaultMostAskedSchema = vaultMostAskedSchemaDefinition;
60642
60650
  var vaultUseOriginSchema = external_exports.enum(["computer", "connected"]);
60651
+ var vaultUseJudgeSchemaDefinition = external_exports.object({
60652
+ /** Let it through, asked a person, held it back, or could not check (off or no answer). */
60653
+ verdict: external_exports.enum(["allowed", "asked", "refused", "unchecked"]),
60654
+ /** The chance, 0 to 1, it gave the use fitting the key's rules; null when it gave none. */
60655
+ confidence: external_exports.number().min(0).max(1).nullable(),
60656
+ /** One plain line of why, from a fixed set: never model text, a message or a value. */
60657
+ line: external_exports.string(),
60658
+ /** The line as a code, for clients that translate it. */
60659
+ reason: external_exports.enum(["fits", "unsure", "unbacked", "not_asked", "against_rules", "off", "no_answer"]).optional()
60660
+ });
60661
+ var vaultUseJudgeSchema = vaultUseJudgeSchemaDefinition;
60643
60662
  var vaultConnectionUseSchemaDefinition = external_exports.object({
60644
60663
  at: external_exports.iso.datetime(),
60645
60664
  action: external_exports.string(),
@@ -60667,7 +60686,9 @@ var vaultConnectionUseSchemaDefinition = external_exports.object({
60667
60686
  to: vaultSensitivitySchema.nullable(),
60668
60687
  direction: external_exports.enum(["raised", "lowered"]).nullable(),
60669
60688
  method: external_exports.string().nullable()
60670
- }).nullable().optional()
60689
+ }).nullable().optional(),
60690
+ /** When the automatic check decided the use: its verdict, confidence and why. */
60691
+ judge: vaultUseJudgeSchema.nullable().optional()
60671
60692
  });
60672
60693
  var vaultConnectionUseSchema = vaultConnectionUseSchemaDefinition;
60673
60694
  var vaultKeyActivitySchemaDefinition = external_exports.object({
@@ -60743,7 +60764,7 @@ var vaultLevelLimitSchemaDefinition = external_exports.object({
60743
60764
  subject: vaultLimitSubjectSchema,
60744
60765
  most: vaultSensitivitySchema,
60745
60766
  /** The longest lease an approval may grant on this subject's connections; null is no cap. */
60746
- maxLeaseSeconds: external_exports.number().int().positive().max(VAULT_MAX_LEASE_SECONDS).nullable(),
60767
+ maxLeaseSeconds: external_exports.number().int().positive().max(VAULT_LONGEST_LEASE_SECONDS).nullable(),
60747
60768
  /** Turned off by an admin: no one adds one and agents cannot use the ones there are. */
60748
60769
  blocked: external_exports.boolean().default(false),
60749
60770
  /** New connections a member adds wait for an admin's approval before agents use them. */
@@ -60756,7 +60777,7 @@ var setVaultLevelLimitInputSchemaDefinition = external_exports.object({
60756
60777
  workspaceId: external_exports.string().min(1),
60757
60778
  subject: vaultLimitSubjectSchema,
60758
60779
  most: vaultSensitivitySchema.exclude(["auto"]).nullable(),
60759
- maxLeaseSeconds: external_exports.number().int().min(60).max(VAULT_MAX_LEASE_SECONDS).nullable().optional(),
60780
+ maxLeaseSeconds: external_exports.number().int().min(60).max(VAULT_LONGEST_LEASE_SECONDS).nullable().optional(),
60760
60781
  /** Turns the connector off or on again; left out it stays as it is. */
60761
60782
  blocked: external_exports.boolean().optional(),
60762
60783
  /** Asks an admin to approve new connections, or stops asking; left out it stays. */
@@ -62982,6 +63003,7 @@ var reachableConversationSchemaDefinition = external_exports.object({
62982
63003
  /** Whether any of the asked readers may read it; members are listed either way. */
62983
63004
  readable: external_exports.boolean()
62984
63005
  });
63006
+ var replySideSchema = external_exports.enum(["laze", "slack"]);
62985
63007
  var conversationSummarySchemaDefinition = external_exports.object({
62986
63008
  ...conversationSchemaDefinition.shape,
62987
63009
  lastReadSeq: external_exports.number().int().nonnegative(),
@@ -62993,7 +63015,14 @@ var conversationSummarySchemaDefinition = external_exports.object({
62993
63015
  /** A timed mute ends on its own then; null or absent while muted means until unmuted. */
62994
63016
  mutedUntil: external_exports.iso.datetime().nullable().optional(),
62995
63017
  /** No message for SIDEBAR_ACTIVE_DAYS days, by the server's clock; absent means active. */
62996
- inactive: external_exports.boolean().optional()
63018
+ inactive: external_exports.boolean().optional(),
63019
+ /**
63020
+ * When the reader last read or wrote here, from any device or a mirror; orders Recent on every
63021
+ * client. Absent when they never did.
63022
+ */
63023
+ activeAt: external_exports.iso.datetime().optional(),
63024
+ /** In a Laze DM paired with a Slack DM: the side the reader picked; absent follows the other. */
63025
+ replySide: replySideSchema.optional()
62997
63026
  });
62998
63027
  var conversationSummarySchema = conversationSummarySchemaDefinition;
62999
63028
  var directoryEntrySchemaDefinition = external_exports.object({
@@ -63726,6 +63755,13 @@ var setNotifyInputSchemaDefinition = external_exports.object({
63726
63755
  mutedUntil: external_exports.iso.datetime().nullable().optional()
63727
63756
  });
63728
63757
  var setNotifyInputSchema = setNotifyInputSchemaDefinition;
63758
+ var setReplySideInputSchemaDefinition = external_exports.object({
63759
+ workspaceId: workspaceIdSchema,
63760
+ channelId: idSchema4,
63761
+ /** Null forgets the pick, so replies follow the side the other person last wrote from. */
63762
+ side: replySideSchema.nullable()
63763
+ });
63764
+ var setReplySideInputSchema = setReplySideInputSchemaDefinition;
63729
63765
  var followThreadInputSchemaDefinition = external_exports.object({
63730
63766
  workspaceId: workspaceIdSchema,
63731
63767
  messageId: idSchema4,
@@ -64121,7 +64157,7 @@ var chatConversationsTrpc = defineTrpcContract("chat").query("overview", { mirro
64121
64157
  var chatChannelRolesTrpc = defineTrpcContract("chat").mutation("setChannelRole").withInput(setChannelRoleInputSchema).withOutput(conversationSchema).mutation("extendChannel").withInput(extendChannelInputSchema).withOutput(conversationSchema).build();
64122
64158
  var chatMessagesTrpc = defineTrpcContract("chat").query("history", { mirrored: historyMirror }).withInput(historyInputSchema).withOutput(historyPageSchema).query("thread").withInput(messageInputSchema).withOutput(threadSchema).query("message").withInput(messageInputSchema).withOutput(messageSchema).mutation("post").withInput(postMessageInputSchema).withOutput(messageSchema).mutation("forward").withInput(forwardMessageInputSchema).withOutput(messageSchema).mutation("addMentioned").withInput(addMentionedInputSchema).withOutput(messageSchema).mutation("edit").withInput(editMessageInputSchema).withOutput(messageSchema).mutation("delete").withInput(messageInputSchema).withOutput(messageSchema).mutation("remove").withInput(messageInputSchema).withOutput(messageSchema).mutation("react").withInput(reactInputSchema).withOutput(messageSchema).mutation("signalTyping").withInput(signalTypingInputSchema).withOutput(external_exports.object({ sent: external_exports.literal(true) })).mutation("markRead").withInput(markReadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).mutation("markUnread").withInput(markUnreadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).query("search").withInput(searchInputSchema).withOutput(searchResultSchema).build();
64123
64159
  var chatFilesTrpc = defineTrpcContract("chat").mutation("startUpload").withInput(startUploadInputSchema).withOutput(uploadTicketSchema).mutation("completeUpload").withInput(completeUploadInputSchema).withOutput(attachmentSchema).mutation("transcribeVoiceSegment").withInput(transcribeVoiceSegmentInputSchema).withOutput(voiceSegmentTextSchema).mutation("abortUpload").withInput(fileInputSchema).withOutput(external_exports.object({ aborted: external_exports.literal(true) })).query("fileLink").withInput(fileLinkInputSchema).withOutput(fileLinkSchema).query("channelFiles").withInput(channelFilesInputSchema).withOutput(channelFilesSchema).mutation("renameAttachment").withInput(renameAttachmentInputSchema).withOutput(attachmentSchema).mutation("hideUnfurl").withInput(hideUnfurlInputSchema).withOutput(messageSchema).query("unfurlImage").withInput(unfurlImageInputSchema).withOutput(fileLinkSchema).query("searchGifs").withInput(searchGifsInputSchema).withOutput(gifResultsSchema).build();
64124
- var chatFollowingTrpc = defineTrpcContract("chat").mutation("setNotify").withInput(setNotifyInputSchema).withOutput(conversationSummarySchema).mutation("hideConversation").withInput(channelInputSchema).withOutput(external_exports.object({ hidden: external_exports.literal(true) })).mutation("followThread").withInput(followThreadInputSchema).withOutput(threadFollowSchema).query("threadFollow").withInput(messageInputSchema).withOutput(threadFollowSchema).query("threads", { mirrored: threadsMirror }).withInput(threadsInputSchema).withOutput(threadsPageSchema).query("threadsUnread").withInput(workspaceInputSchema).withOutput(threadsUnreadSchema).query("notificationCount").withInput(workspaceInputSchema).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).mutation("markThreadRead").withInput(messageInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).mutation("pin").withInput(pinMessageInputSchema).withOutput(messageSchema).mutation("retryMirrorDelivery").withInput(messageInputSchema).withOutput(external_exports.object({ retried: external_exports.boolean() })).query("pins").withInput(channelInputSchema).withOutput(pinsPageSchema).query("saved").withInput(savedInputSchema).withOutput(savedPageSchema).query("savedMarks").withInput(workspaceInputSchema).withOutput(savedMarksSchema).mutation("saveMessage").withInput(saveMessageInputSchema).withOutput(savedStatusSchema).mutation("markSavedDone").withInput(markSavedDoneInputSchema).withOutput(savedStatusSchema).mutation("setReminder").withInput(setReminderInputSchema).withOutput(savedStatusSchema).query("activity").withInput(activityInputSchema).withOutput(activityPageSchema).mutation("markActivityRead").withInput(markActivityReadInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).build();
64160
+ var chatFollowingTrpc = defineTrpcContract("chat").mutation("setNotify").withInput(setNotifyInputSchema).withOutput(conversationSummarySchema).mutation("setReplySide").withInput(setReplySideInputSchema).withOutput(conversationSummarySchema).mutation("hideConversation").withInput(channelInputSchema).withOutput(external_exports.object({ hidden: external_exports.literal(true) })).mutation("followThread").withInput(followThreadInputSchema).withOutput(threadFollowSchema).query("threadFollow").withInput(messageInputSchema).withOutput(threadFollowSchema).query("threads", { mirrored: threadsMirror }).withInput(threadsInputSchema).withOutput(threadsPageSchema).query("threadsUnread").withInput(workspaceInputSchema).withOutput(threadsUnreadSchema).query("notificationCount").withInput(workspaceInputSchema).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).mutation("markThreadRead").withInput(messageInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).mutation("pin").withInput(pinMessageInputSchema).withOutput(messageSchema).mutation("retryMirrorDelivery").withInput(messageInputSchema).withOutput(external_exports.object({ retried: external_exports.boolean() })).query("pins").withInput(channelInputSchema).withOutput(pinsPageSchema).query("saved").withInput(savedInputSchema).withOutput(savedPageSchema).query("savedMarks").withInput(workspaceInputSchema).withOutput(savedMarksSchema).mutation("saveMessage").withInput(saveMessageInputSchema).withOutput(savedStatusSchema).mutation("markSavedDone").withInput(markSavedDoneInputSchema).withOutput(savedStatusSchema).mutation("setReminder").withInput(setReminderInputSchema).withOutput(savedStatusSchema).query("activity").withInput(activityInputSchema).withOutput(activityPageSchema).mutation("markActivityRead").withInput(markActivityReadInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).build();
64125
64161
  var chatSessionTrpc = defineTrpcContract("chat").mutation("realtimeToken").withInput(workspaceInputSchema).withOutput(realtimeTokenSchema).query("drafts").withInput(workspaceInputSchema).withOutput(draftListSchema).mutation("saveDraft").withInput(saveDraftInputSchema).withOutput(draftSavedSchema).mutation("deleteDraft").withInput(deleteDraftInputSchema).withOutput(draftSavedSchema).query("sent").withInput(listSentInputSchema).withOutput(sentPageSchema).query("sidebarLayout").withInput(workspaceInputSchema).withOutput(sidebarLayoutSchema).mutation("editSidebar").withInput(editSidebarInputSchema).withOutput(sidebarLayoutSchema).query("readerPreferences").withInput(workspaceInputSchema).withOutput(readerPreferencesSchema).mutation("setReaderPreferences").withInput(setReaderPreferencesInputSchema).withOutput(readerPreferencesSchema).mutation("star").withInput(starInputSchema).withOutput(starStatusSchema).query("starred").withInput(workspaceInputSchema).withOutput(starredListSchema).mutation("scrubSecrets").withInput(scrubChatInputSchema).withOutput(chatScrubReportSchema).mutation("restoreScrubbed").withInput(messageInputSchema).withOutput(messageSchema).build();
64126
64162
  var chatScheduledTrpc = defineTrpcContract("chat").mutation("scheduleMessage").withInput(scheduleMessageInputSchema).withOutput(scheduledMessageSchema).query("scheduled").withInput(listScheduledInputSchema).withOutput(scheduledListSchema).mutation("editScheduled").withInput(editScheduledInputSchema).withOutput(scheduledMessageSchema).mutation("sendScheduledNow").withInput(scheduledInputSchema).withOutput(scheduledMessageSchema).mutation("cancelScheduled").withInput(scheduledInputSchema).withOutput(scheduledMessageSchema).build();
64127
64163
  var chatPresenceTrpc = defineTrpcContract("chat").mutation("heartbeat").withInput(workspaceInputSchema).withOutput(heartbeatSchema).query("presence").withInput(workspaceInputSchema).withOutput(presenceListSchema).mutation("setStatus").withInput(setStatusInputSchema).withOutput(personPresenceSchema).mutation("clearStatus").withInput(workspaceInputSchema).withOutput(personPresenceSchema).mutation("setAway").withInput(setAwayInputSchema).withOutput(personPresenceSchema).build();
@@ -64317,6 +64353,27 @@ var emailMessageSchemaDefinition = external_exports.discriminatedUnion("template
64317
64353
  lines: external_exports.array(external_exports.string()).min(1),
64318
64354
  action: external_exports.string().min(1)
64319
64355
  }),
64356
+ /**
64357
+ * Optional product mail with one picture over the words and one button, such as an apology
64358
+ * after an incident; sent only where `optionalEmailReach` allows, with its off link.
64359
+ */
64360
+ external_exports.object({
64361
+ template: external_exports.literal("announcement"),
64362
+ to: external_exports.email(),
64363
+ locale: localeSchema,
64364
+ url: external_exports.url(),
64365
+ subject: external_exports.string().min(1).max(200),
64366
+ heading: external_exports.string().min(1).max(200),
64367
+ lines: external_exports.array(external_exports.string().min(1).max(600)).min(1).max(4),
64368
+ action: external_exports.string().min(1).max(80),
64369
+ image: external_exports.object({
64370
+ url: external_exports.url(),
64371
+ alt: external_exports.string().max(200),
64372
+ width: external_exports.number().int().positive().max(600),
64373
+ height: external_exports.number().int().positive().max(600)
64374
+ }),
64375
+ unsubscribeUrl: external_exports.url()
64376
+ }),
64320
64377
  /** A Laze app a person waited for is out; `url` is its store page. */
64321
64378
  external_exports.object({
64322
64379
  template: external_exports.literal("appAvailable"),
@@ -64688,12 +64745,18 @@ var pauseSummaryIntentSchemaDefinition = external_exports.object({
64688
64745
  userId: external_exports.string().min(1),
64689
64746
  since: external_exports.iso.datetime()
64690
64747
  });
64748
+ var heldPushTextSchema = external_exports.union([
64749
+ external_exports.object({ sealed: external_exports.string().min(1), version: external_exports.number().int().positive() }).strict(),
64750
+ external_exports.object({ unavailable: external_exports.literal(true) }).strict()
64751
+ ]);
64752
+ var sealedNameSchema = heldPushTextSchema;
64691
64753
  var noticeHeldPayloadSchemaDefinition = external_exports.object({
64692
64754
  workspaceId: external_exports.string().min(1),
64693
64755
  userId: external_exports.string().min(1),
64694
64756
  noticeId: external_exports.string().min(1),
64695
64757
  fromKey: external_exports.string().min(1),
64696
64758
  fromName: external_exports.string(),
64759
+ fromNameSealed: sealedNameSchema.optional(),
64697
64760
  at: external_exports.iso.datetime()
64698
64761
  });
64699
64762
  var burstSummaryStateSchemaDefinition = external_exports.object({
@@ -64701,6 +64764,7 @@ var burstSummaryStateSchemaDefinition = external_exports.object({
64701
64764
  userId: external_exports.string(),
64702
64765
  fromKey: external_exports.string(),
64703
64766
  fromName: external_exports.string(),
64767
+ fromNameSealed: sealedNameSchema.optional(),
64704
64768
  /** When the first held notice of this burst came, in epoch milliseconds. */
64705
64769
  since: external_exports.number().nullable(),
64706
64770
  /** When the latest held notice came. */
@@ -64711,12 +64775,9 @@ var burstSummaryIntentSchemaDefinition = external_exports.object({
64711
64775
  userId: external_exports.string().min(1),
64712
64776
  fromKey: external_exports.string().min(1),
64713
64777
  fromName: external_exports.string(),
64778
+ fromNameSealed: sealedNameSchema.optional(),
64714
64779
  since: external_exports.iso.datetime()
64715
64780
  });
64716
- var heldPushTextSchema = external_exports.union([
64717
- external_exports.object({ sealed: external_exports.string().min(1), version: external_exports.number().int().positive() }).strict(),
64718
- external_exports.object({ unavailable: external_exports.literal(true) }).strict()
64719
- ]);
64720
64781
  var heldFeedPushSchema = external_exports.object({
64721
64782
  itemId: external_exports.string().min(1),
64722
64783
  idempotencyKey: external_exports.string().min(1),
@@ -64729,6 +64790,7 @@ var heldFeedPushSchema = external_exports.object({
64729
64790
  var heldBurstPushSchema = external_exports.object({
64730
64791
  fromKey: external_exports.string().min(1),
64731
64792
  fromName: external_exports.string(),
64793
+ fromNameSealed: sealedNameSchema.optional(),
64732
64794
  since: external_exports.iso.datetime()
64733
64795
  });
64734
64796
  var heldPhonePushShape = {
@@ -64742,7 +64804,9 @@ var heldPhonePushShape = {
64742
64804
  feed: heldFeedPushSchema.optional(),
64743
64805
  burst: heldBurstPushSchema.optional(),
64744
64806
  /** A message alert's sender, so a held alert still shows their picture. */
64745
- sender: apnsSenderSchema.optional()
64807
+ sender: apnsSenderSchema.optional(),
64808
+ /** The sender's name sealed; sealed mode leaves `sender.name` empty. */
64809
+ senderNameSealed: sealedNameSchema.optional()
64746
64810
  };
64747
64811
  var phonePushHeldPayloadSchemaDefinition = external_exports.object({
64748
64812
  workspaceId: external_exports.string().min(1),
@@ -66284,6 +66348,7 @@ var computerHostViewDefinition = external_exports.object({
66284
66348
  diskFreeGb: external_exports.number().nullable()
66285
66349
  });
66286
66350
  var computerResizeOutcomeSchema = external_exports.enum(["in_place", "moving", "stored"]);
66351
+ var computerRoomDefinition = external_exports.object({ placed: external_exports.boolean(), fits: external_exports.boolean() });
66287
66352
  var sizeShape = {
66288
66353
  memoryMb: external_exports.number().int().positive(),
66289
66354
  cpus: external_exports.number().positive(),
@@ -66314,6 +66379,12 @@ var computerPoolFactDefinition = external_exports.discriminatedUnion("kind", [
66314
66379
  state: computerHostStateSchema
66315
66380
  }),
66316
66381
  external_exports.object({ kind: external_exports.literal("host_health_changed"), hostId: external_exports.string(), healthy: external_exports.boolean() }),
66382
+ external_exports.object({
66383
+ kind: external_exports.literal("host_overcommit_changed"),
66384
+ hostId: external_exports.string(),
66385
+ overcommit: external_exports.number(),
66386
+ diskOvercommit: external_exports.number()
66387
+ }),
66317
66388
  external_exports.object({ kind: external_exports.literal("host_removed"), hostId: external_exports.string() }),
66318
66389
  external_exports.object({
66319
66390
  kind: external_exports.literal("placed"),
@@ -66382,13 +66453,38 @@ var computerPoolFactDefinition = external_exports.discriminatedUnion("kind", [
66382
66453
  memoryMb: external_exports.number().int().nonnegative(),
66383
66454
  cpus: external_exports.number().nonnegative(),
66384
66455
  diskGb: external_exports.number().int().nonnegative(),
66385
- numbers: capacityNumbersDefinition
66456
+ numbers: capacityNumbersDefinition,
66457
+ /** Distinct computers refused a create in the incident; absent on older facts. */
66458
+ waiting: external_exports.number().int().nonnegative().optional()
66386
66459
  }),
66387
66460
  external_exports.object({
66388
66461
  kind: external_exports.literal("capacity_card_settled"),
66389
66462
  incidentId: external_exports.string(),
66390
66463
  workspaceId: external_exports.string(),
66391
- refusals: external_exports.number()
66464
+ refusals: external_exports.number(),
66465
+ waiting: external_exports.number().int().nonnegative().optional()
66466
+ }),
66467
+ /** Room is running low before the limit: one urgent card per episode. */
66468
+ external_exports.object({
66469
+ kind: external_exports.literal("capacity_low_raised"),
66470
+ episodeId: external_exports.string(),
66471
+ workspaceId: external_exports.string(),
66472
+ recipientUserIds: external_exports.array(external_exports.string()),
66473
+ /** New Small computers that fit on the best host. */
66474
+ smallFits: external_exports.number().int().nonnegative(),
66475
+ /** Hosts whose report shows little real disk free or much memory held, in percent. */
66476
+ tightHosts: external_exports.array(
66477
+ external_exports.object({
66478
+ hostId: external_exports.string(),
66479
+ diskFreePercent: external_exports.number().nullable(),
66480
+ memoryUsedPercent: external_exports.number().nullable()
66481
+ })
66482
+ )
66483
+ }),
66484
+ external_exports.object({
66485
+ kind: external_exports.literal("capacity_low_settled"),
66486
+ episodeId: external_exports.string(),
66487
+ workspaceId: external_exports.string()
66392
66488
  })
66393
66489
  ]);
66394
66490
  var computerPoolFactRecordDefinition = external_exports.object({
@@ -67497,6 +67593,19 @@ var mcpServerApprovalChangedPayloadSchemaDefinition = external_exports.object({
67497
67593
  changeId: external_exports.string().min(1),
67498
67594
  at: external_exports.iso.datetime()
67499
67595
  });
67596
+ var connectionLinkedPayloadSchemaDefinition = external_exports.object({
67597
+ workspaceId: external_exports.string().min(1),
67598
+ connectionId: external_exports.string().min(1),
67599
+ userId: external_exports.string().min(1),
67600
+ /** The provider's id (`gmail`, `github`), `mcp` for a remote MCP server, or `github_app`. */
67601
+ service: external_exports.string().min(1).max(80),
67602
+ /** The connection's sensitivity tier; null when the path sets none. */
67603
+ sensitivity: external_exports.string().max(40).nullable(),
67604
+ /** `renewed`: a sign-in that refreshed a connection the person already had. */
67605
+ renewed: external_exports.boolean(),
67606
+ changeId: external_exports.string().min(1),
67607
+ at: external_exports.iso.datetime()
67608
+ });
67500
67609
  var ConnectorApi = moduleApi()("connector");
67501
67610
  var workspaceInput2 = external_exports.object({ workspaceId: external_exports.string().min(1) });
67502
67611
  var connectionInput2 = external_exports.object({
@@ -69535,6 +69644,8 @@ var AgentNameSlot = agentUi.component("name");
69535
69644
  var AgentFaceSlot = agentUi.component("face");
69536
69645
  var AgentAccessSlot = agentUi.component("access");
69537
69646
  var AgentConnectDialogSlot = agentUi.component("connectDialog");
69647
+ var AgentConnectWaitSlot = agentUi.component("connectWait");
69648
+ var AgentConnectWaitRowSlot = agentUi.component("connectWaitRow");
69538
69649
  var AgentMigrateDialogSlot = agentUi.component("migrateDialog");
69539
69650
  var AgentChannelLevelSlot = agentUi.component("channelLevel");
69540
69651
  var AgentMuteNoticeSlot = agentUi.component("muteNotice");
@@ -69811,6 +69922,32 @@ var agentScheduledRunMissedPayloadSchemaDefinition = external_exports.object({
69811
69922
  scheduledFor: external_exports.iso.datetime()
69812
69923
  });
69813
69924
 
69925
+ // ../../modules/agent/contract/src/agent-adoption.ts
69926
+ var agentAdoptionHarnessSchema = external_exports.enum(["laze-models", "claude-code", "codex", "other"]);
69927
+ var agentCreatedPayloadSchemaDefinition = external_exports.object({
69928
+ workspaceId: external_exports.string().min(1),
69929
+ agentId: external_exports.string().min(1),
69930
+ byUserId: external_exports.string().min(1).nullable(),
69931
+ harness: agentAdoptionHarnessSchema,
69932
+ hosting: external_exports.enum(["laze", "connected"]),
69933
+ kind: external_exports.enum(["personal", "team"]),
69934
+ at: external_exports.iso.datetime()
69935
+ });
69936
+ var agentConnectedPayloadSchemaDefinition = external_exports.object({
69937
+ workspaceId: external_exports.string().min(1),
69938
+ agentId: external_exports.string().min(1),
69939
+ byUserId: external_exports.string().min(1).nullable(),
69940
+ harness: agentAdoptionHarnessSchema,
69941
+ at: external_exports.iso.datetime()
69942
+ });
69943
+ var agentPersonMessageReceivedPayloadSchemaDefinition = external_exports.object({
69944
+ workspaceId: external_exports.string().min(1),
69945
+ agentId: external_exports.string().min(1),
69946
+ /** The person whose message it was. */
69947
+ userId: external_exports.string().min(1),
69948
+ at: external_exports.iso.datetime()
69949
+ });
69950
+
69814
69951
  // ../../modules/agent/contract/src/agent-history.ts
69815
69952
  var idSchema19 = external_exports.string().min(1).max(80);
69816
69953
  var CALLER_HISTORY_LIMIT_MAX = 100;
@@ -70380,6 +70517,29 @@ function revokedKeyLineOf({ profile }) {
70380
70517
  return `${profile}: this agent's key was revoked: run \`laze agent link\` again or remove it with \`laze logout --profile ${profile}\``;
70381
70518
  }
70382
70519
 
70520
+ // src/rules/session-headers.rules.ts
70521
+ import { relative, sep } from "node:path";
70522
+ function sessionKeyOf({ session }) {
70523
+ return `${session.harness}:${session.sessionId}`;
70524
+ }
70525
+ function sessionHeadersOf({
70526
+ session
70527
+ }) {
70528
+ if (!session) return {};
70529
+ return {
70530
+ [AGENT_SESSION_HEADER]: sessionKeyOf({ session }),
70531
+ [AGENT_SESSION_FOLDER_HEADER]: encodeURIComponent(session.folder),
70532
+ [AGENT_SESSION_HOST_HEADER]: encodeURIComponent(session.host)
70533
+ };
70534
+ }
70535
+ function displayFolderOf({ folder, home }) {
70536
+ if (!home) return folder;
70537
+ const below = relative(home, folder);
70538
+ if (below === "") return "~";
70539
+ if (below.startsWith("..") || below.startsWith(sep)) return folder;
70540
+ return `~/${below.split(sep).join("/")}`;
70541
+ }
70542
+
70383
70543
  // src/services/laze-client.service.ts
70384
70544
  var CLI_VERSION_HEADER = "x-laze-cli-version";
70385
70545
  var LazeApiError = class extends Error {
@@ -70657,6 +70817,15 @@ async function turnTokenOf({ context }) {
70657
70817
  () => ""
70658
70818
  );
70659
70819
  }
70820
+ function harnessSessionKeyOf({ context }) {
70821
+ const { harness, inherited } = context.environment;
70822
+ const ids = {
70823
+ "claude-code": inherited.CLAUDE_CODE_SESSION_ID,
70824
+ codex: inherited.CODEX_THREAD_ID
70825
+ };
70826
+ const sessionId = ids[harness];
70827
+ return sessionId ? sessionKeyOf({ session: { harness, sessionId } }) : void 0;
70828
+ }
70660
70829
  async function signedIn({
70661
70830
  context,
70662
70831
  args
@@ -70666,6 +70835,7 @@ async function signedIn({
70666
70835
  config: config2,
70667
70836
  flag: flagText({ args, name: "profile" }) || void 0,
70668
70837
  environment: context.environment.profile,
70838
+ session: harnessSessionKeyOf({ context }),
70669
70839
  cwd: context.cwd
70670
70840
  });
70671
70841
  if (!chosen.profile)
@@ -71173,29 +71343,6 @@ function selfClauseOf({ self: self2 }) {
71173
71343
  return self2 ? `, where you are ${self2}` : "";
71174
71344
  }
71175
71345
 
71176
- // src/rules/session-headers.rules.ts
71177
- import { relative, sep } from "node:path";
71178
- function sessionKeyOf({ session }) {
71179
- return `${session.harness}:${session.sessionId}`;
71180
- }
71181
- function sessionHeadersOf({
71182
- session
71183
- }) {
71184
- if (!session) return {};
71185
- return {
71186
- [AGENT_SESSION_HEADER]: sessionKeyOf({ session }),
71187
- [AGENT_SESSION_FOLDER_HEADER]: encodeURIComponent(session.folder),
71188
- [AGENT_SESSION_HOST_HEADER]: encodeURIComponent(session.host)
71189
- };
71190
- }
71191
- function displayFolderOf({ folder, home }) {
71192
- if (!home) return folder;
71193
- const below = relative(home, folder);
71194
- if (below === "") return "~";
71195
- if (below.startsWith("..") || below.startsWith(sep)) return folder;
71196
- return `~/${below.split(sep).join("/")}`;
71197
- }
71198
-
71199
71346
  // src/rules/transcript.rules.ts
71200
71347
  function record2(value) {
71201
71348
  return typeof value === "object" && value !== null ? value : {};
@@ -71754,6 +71901,17 @@ var slackBotCleanupOutcomePayloadSchemaDefinition = external_exports.object({
71754
71901
  slackChannelId: external_exports.string().min(1),
71755
71902
  outcome: external_exports.enum(["left", "kept", "failed"])
71756
71903
  });
71904
+ var slackLinkedPayloadSchemaDefinition = external_exports.object({
71905
+ workspaceId: external_exports.string().min(1),
71906
+ /** The Laze person who finished the flow. */
71907
+ userId: external_exports.string().min(1),
71908
+ /** Opaque and unique to this link, derived from the finished authorization. */
71909
+ linkId: external_exports.string().min(1),
71910
+ /** `installed`: the bot; `linked`: a person's own account; `moved`: onto another app. */
71911
+ outcome: external_exports.enum(["installed", "linked", "moved"]),
71912
+ changeId: external_exports.string().min(1),
71913
+ at: external_exports.iso.datetime()
71914
+ });
71757
71915
 
71758
71916
  // ../../modules/slack/contract/src/slack.ts
71759
71917
  var SLACK_CACHE_DAYS_MAX = 30;
@@ -76467,7 +76625,9 @@ guide first: https://laze.so/docs/agents/apps.md. The short version:
76467
76625
  an attachment means exactly that: do it, do not ask.
76468
76626
  - Slides, a deck or a talk: start from \`laze app create <name> --template slides\`. Each slide
76469
76627
  is a file in slides/, listed in order in slides/deck.json; the deck presents full screen and
76470
- exports PDF and HTML on its own.
76628
+ exports PDF and HTML on its own. People who can change the app also edit the deck on its page
76629
+ (reorder, move, resize, retype), each change a live version: \`laze app pull\` before you change
76630
+ a deck and keep its data-el attributes. A deck made earlier gets this with \`laze app upgrade\`.
76471
76631
  An app that already exists goes in with \`laze app pin <app> --channel <channel>\`, never as a
76472
76632
  pinned message with a link. A pin opens it to everyone there, and their agents may build on it.
76473
76633
  - A new app is Restricted. Do not share it with only the person who asked when they asked in a
@@ -79051,6 +79211,11 @@ var listAppsInputSchemaDefinition = external_exports.object({
79051
79211
  archived: external_exports.boolean().optional()
79052
79212
  });
79053
79213
  var listAppsInputSchema = listAppsInputSchemaDefinition;
79214
+ var findAppInputSchemaDefinition = external_exports.object({
79215
+ workspaceId: external_exports.string().min(1),
79216
+ /** The app's id or its slug; archived apps are found too. */
79217
+ app: external_exports.string().min(1)
79218
+ });
79054
79219
  var renameAppInputSchemaDefinition = external_exports.object({
79055
79220
  ...appRefSchemaDefinition.shape,
79056
79221
  name: external_exports.string().trim().min(1).max(80)
@@ -79727,6 +79892,22 @@ var appFaultClaimsSchemaDefinition = external_exports.object({
79727
79892
  page: external_exports.string().max(600)
79728
79893
  });
79729
79894
 
79895
+ // ../../modules/app/contract/src/app.self-edit.ts
79896
+ var selfEditAppInputSchemaDefinition = external_exports.object({ token: external_exports.string().min(1).max(15e5) });
79897
+ var selfEditedAppSchemaDefinition = external_exports.object({ version: external_exports.string().min(1), live: external_exports.boolean() });
79898
+ var appEditClaimsSchemaDefinition = external_exports.object({
79899
+ iss: external_exports.literal("laze-apps"),
79900
+ aud: external_exports.array(external_exports.string()).refine((aud) => aud.includes("laze-app-edit")),
79901
+ exp: external_exports.number().int(),
79902
+ wid: external_exports.string().min(1),
79903
+ app: external_exports.string().min(1),
79904
+ vid: external_exports.string().min(1),
79905
+ base: external_exports.string().min(1).max(64),
79906
+ files: external_exports.array(external_exports.object({ path: external_exports.string().min(1).max(300), content: external_exports.string().max(6e5) })).max(20).nullable().transform((files2) => files2 ?? []),
79907
+ remove: external_exports.array(external_exports.string().min(1).max(300)).max(20).nullable().optional().transform((paths) => paths ?? []),
79908
+ msg: external_exports.string().min(1).max(500)
79909
+ });
79910
+
79730
79911
  // ../../modules/app/contract/src/app.quota.ts
79731
79912
  var APP_QUOTA_LIMITS = [
79732
79913
  "app_database_bytes",
@@ -80281,6 +80462,11 @@ var appTemplateManifestSchemaDefinition = external_exports.object({
80281
80462
  entry: external_exports.string().min(1).max(200),
80282
80463
  /** One or two sentences an agent reads first: how to change an app made from it. */
80283
80464
  guide: external_exports.string().trim().max(500).optional(),
80465
+ /**
80466
+ * Files the template owns and the app's author leaves as they are (a deck's engine): updating
80467
+ * an app to a newer template version writes only these.
80468
+ */
80469
+ engine: external_exports.array(external_exports.string().min(1).max(200)).max(20).optional(),
80284
80470
  collections: templateCollectionsSchema,
80285
80471
  views: external_exports.array(appViewSpecSchema).default([]),
80286
80472
  seed: external_exports.record(collectionNameSchema, external_exports.array(appRecordSchema)).default({})
@@ -80305,6 +80491,17 @@ var somethingToWrite = {
80305
80491
  var writeAppFilesInputSchemaDefinition = external_exports.object({ workspaceId: external_exports.string().min(1), ...writeAppFilesShape }).refine(somethingToWrite.check, { message: somethingToWrite.message });
80306
80492
  var writeAppFilesByKeyInputSchemaDefinition = external_exports.object(writeAppFilesShape).refine(somethingToWrite.check, { message: somethingToWrite.message });
80307
80493
  var appTemplatesByKeyQuerySchemaDefinition = external_exports.object({});
80494
+ var upgradeAppTemplateByKeyInputSchemaDefinition = external_exports.object({ appId: external_exports.string().min(1) });
80495
+ var appTemplateUpgradeSchemaDefinition = external_exports.object({
80496
+ upgraded: external_exports.boolean(),
80497
+ /** The new live version; null when nothing changed. */
80498
+ version: external_exports.string().nullable(),
80499
+ templateName: appTemplateNameSchema,
80500
+ templateVersion: external_exports.number().int().positive(),
80501
+ /** The files written over the live version. */
80502
+ files: external_exports.array(external_exports.string())
80503
+ });
80504
+ var appTemplateUpgradeSchema = appTemplateUpgradeSchemaDefinition;
80308
80505
 
80309
80506
  // ../../modules/app/contract/src/app.trpc.ts
80310
80507
  var APP_LIST_PATH = "app.list";
@@ -80319,7 +80516,7 @@ var appsCopy = {
80319
80516
  var appMainTrpc = defineTrpcContract("app").query("list", { mirrored: appsCopy }).withInput(listAppsInputSchema).withOutput(external_exports.array(appSchema)).query("get").withInput(appRefSchema).withOutput(appSchema).mutation("create").withInput(createAppInputSchema).withOutput(appSchema).mutation("rename").withInput(renameAppInputSchema).withOutput(appSchema).mutation("archive").withInput(appRefSchema).withOutput(appSchema).mutation("unarchive").withInput(appRefSchema).withOutput(appSchema).mutation("delete").withInput(deleteAppInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("versions").withInput(appRefSchema).withOutput(external_exports.array(appVersionSchema)).mutation("revert").withInput(revertInputSchema).withOutput(appPushSchema).mutation("publish").withInput(publishInputSchema).withOutput(publishOutcomeSchema).query("collections").withInput(appDataRefSchema).withOutput(external_exports.array(collectionSchema)).query("records").withInput(listRecordsInputSchema).withOutput(recordPageSchema).mutation("writeRecord").withInput(writeRecordInputSchema).withOutput(appRecordSchema).mutation("deleteRecord").withInput(deleteRecordInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("views").withInput(appDataRefSchema).withOutput(external_exports.array(appViewSchema)).mutation("saveView").withInput(saveViewInputSchema).withOutput(appViewSchema).mutation("deleteView").withInput(deleteViewInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("chooseCardRows").withInput(chooseCardRowsInputSchema).withOutput(appCardChoiceSchema).query("exportRecords").withInput(exportRecordsInputSchema).withOutput(recordExportSchema).mutation("importRecords").withInput(importRecordsInputSchema).withOutput(recordImportSchema).mutation("decidePublish").withInput(decidePublishInputSchema).withOutput(publishOutcomeSchema).mutation("nameVersion").withInput(nameVersionInputSchema).withOutput(appVersionSchema).mutation("makeInternal").withInput(appRefSchema).withOutput(appSchema).mutation("revokePublishLease").withInput(appRefSchema).withOutput(appSchema).mutation("signInHandoff").withInput(signInHandoffInputSchema).withOutput(signInHandoffSchema).query("functionLogs").withInput(listFunctionLogsInputSchema).withOutput(external_exports.array(appFunctionLogEntrySchema)).query("access").withInput(appRefSchema).withOutput(appAccessSchema).query("members").withInput(appRefSchema).withOutput(appMembersSchema).mutation("grantAccess").withInput(grantAppAccessInputSchema).withOutput(appAccessSchema).mutation("revokeAccess").withInput(revokeAppAccessInputSchema).withOutput(appAccessSchema).mutation("setVisibility").withInput(setAppVisibilityInputSchema).withOutput(visibilityOutcomeSchema).mutation("setMemberRole").withInput(setMemberRoleInputSchema).withOutput(appAccessSchema).mutation("unpublish").withInput(appRefSchema).withOutput(appSchema).query("door").withInput(appRefSchema).withOutput(appDoorSchema).mutation("requestAccess").withInput(appRefSchema).withOutput(appDoorSchema).mutation("decideAccess").withInput(decideAppAccessInputSchema).withOutput(appAccessRequestSchema).query("users").withInput(appRefSchema).withOutput(appUsersSchema).mutation("blockUser").withInput(blockAppUserInputSchema).withOutput(appUsersSchema).mutation("deleteUser").withInput(deleteAppUserInputSchema).withOutput(deletedAppUserSchema).query("backups").withInput(appRefSchema).withOutput(appBackupStatusSchema).mutation("restoreData").withInput(restoreAppDataInputSchema).withOutput(appRestoreSchema).query("cost").withInput(appRefSchema).withOutput(appCostSchema).mutation("setBudget").withInput(setAppBudgetInputSchema).withOutput(appCostSchema).query("triggers").withInput(appRefSchema).withOutput(appTriggersSchema).mutation("setTriggerPaused").withInput(setAppTriggerPausedInputSchema).withOutput(appTriggerSchema).mutation("removeTrigger").withInput(appTriggerRefSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
80320
80517
  var appConnectionsTrpc = defineTrpcContract("app").query("connections").withInput(appRefSchema).withOutput(appConnectionsSchema).mutation("allowConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).mutation("revokeConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).build();
80321
80518
  var appPinsTrpc = defineTrpcContract("app").query("pins").withInput(channelPinsInputSchema).withOutput(channelAppPinsSchema).mutation("pin").withInput(pinAppInputSchema).withOutput(channelAppPinsSchema).mutation("unpin").withInput(pinAppInputSchema).withOutput(channelAppPinsSchema).mutation("setPinView").withInput(setPinViewInputSchema).withOutput(channelAppPinsSchema).mutation("reorderPins").withInput(reorderPinsInputSchema).withOutput(channelAppPinsSchema).mutation("setPinRole").withInput(setPinRoleInputSchema).withOutput(appAccessSchema).build();
80322
- var appSettingsTrpc = defineTrpcContract("app").query("workspaceSettings").withInput(appWorkspaceRefSchema).withOutput(appWorkspaceSettingsSchema).query("functionSettings").withInput(appWorkspaceRefSchema).withOutput(appFunctionSettingsSchema).mutation("setFunctionsEnabled").withInput(setFunctionsEnabledInputSchema).withOutput(appFunctionSettingsSchema).mutation("setPublicAppsAllowed").withInput(setPublicAppsAllowedInputSchema).withOutput(appFunctionSettingsSchema).query("workspaceApps").withInput(listWorkspaceAppsInputSchema).withOutput(external_exports.array(workspaceAppSchema)).mutation("setOwner").withInput(setAppOwnerInputSchema).withOutput(workspaceAppSchema).mutation("unpublishAsAdmin").withInput(appRefSchema).withOutput(external_exports.object({ unpublished: external_exports.literal(true) })).query("templates").withInput(appWorkspaceRefSchema).withOutput(external_exports.array(appTemplateSchema)).build();
80519
+ var appSettingsTrpc = defineTrpcContract("app").query("workspaceSettings").withInput(appWorkspaceRefSchema).withOutput(appWorkspaceSettingsSchema).query("functionSettings").withInput(appWorkspaceRefSchema).withOutput(appFunctionSettingsSchema).mutation("setFunctionsEnabled").withInput(setFunctionsEnabledInputSchema).withOutput(appFunctionSettingsSchema).mutation("setPublicAppsAllowed").withInput(setPublicAppsAllowedInputSchema).withOutput(appFunctionSettingsSchema).query("workspaceApps").withInput(listWorkspaceAppsInputSchema).withOutput(external_exports.array(workspaceAppSchema)).mutation("setOwner").withInput(setAppOwnerInputSchema).withOutput(workspaceAppSchema).mutation("unpublishAsAdmin").withInput(appRefSchema).withOutput(external_exports.object({ unpublished: external_exports.literal(true) })).query("templates").withInput(appWorkspaceRefSchema).withOutput(external_exports.array(appTemplateSchema)).mutation("upgradeTemplate").withInput(appRefSchema).withOutput(appTemplateUpgradeSchema).build();
80323
80520
  var appTrpc = joinTrpcContracts(
80324
80521
  "app",
80325
80522
  appMainTrpc,
@@ -80336,6 +80533,7 @@ var createAppByKeyInputSchemaDefinition = external_exports.object({
80336
80533
  channel: external_exports.string().min(1).optional()
80337
80534
  });
80338
80535
  var appByKeySchemaDefinition = external_exports.object({ appId: external_exports.string().min(1) });
80536
+ var appFindByKeySchemaDefinition = external_exports.object({ app: external_exports.string().min(1) });
80339
80537
  var appDataByKeySchemaDefinition = external_exports.object({
80340
80538
  ...appByKeySchemaDefinition.shape,
80341
80539
  site: legacySiteSchema
@@ -80424,6 +80622,12 @@ var appCliCommands = [
80424
80622
  arguments: [],
80425
80623
  summary: "List the templates an app can start from, with their versions"
80426
80624
  },
80625
+ {
80626
+ command: "laze app upgrade",
80627
+ operation: "upgradeTemplate",
80628
+ arguments: ["[app]"],
80629
+ summary: "Bring an app made from a template (a deck) to the template's current version: the template's engine files (deck.js) are written over the live app as a new version, every slide and style stays. Run laze app pull afterwards"
80630
+ },
80427
80631
  {
80428
80632
  command: "laze app list",
80429
80633
  operation: "listApps",
@@ -81618,17 +81822,23 @@ async function readManifest(folder) {
81618
81822
  }
81619
81823
  return parsed.data;
81620
81824
  }
81621
- async function appIdOf({
81825
+ async function appIdOf(input2) {
81826
+ return (await appNamed(input2)).appId;
81827
+ }
81828
+ async function appNamed({
81622
81829
  client,
81623
81830
  args,
81624
81831
  folder
81625
81832
  }) {
81626
81833
  const named = flagText({ args, name: "app" });
81627
81834
  if (named) {
81628
- const matches = (app2) => app2.id === named || app2.slug === named;
81629
- const found = (await client.get("/api/apps")).find(matches) ?? (await client.get("/api/apps?archived=true")).find(matches);
81630
- if (!found) throw new CliUsageError(`No app called ${named} in this workspace`);
81631
- return found.id;
81835
+ const found = await client.post("/api/apps/find", { app: named }).catch((error63) => {
81836
+ if (error63 instanceof LazeApiError && error63.code === "app_not_found") {
81837
+ throw new CliUsageError(`No app called ${named} in this workspace`);
81838
+ }
81839
+ throw error63;
81840
+ });
81841
+ return { appId: found.id, name: found.name };
81632
81842
  }
81633
81843
  const manifest = await readManifest(folder);
81634
81844
  if (!manifest) {
@@ -81636,7 +81846,7 @@ async function appIdOf({
81636
81846
  `No ${APP_MANIFEST_FILE} here: run this in the app's folder or pass --app <id|slug>`
81637
81847
  );
81638
81848
  }
81639
- return manifest.app.id;
81849
+ return { appId: manifest.app.id, name: manifest.app.name };
81640
81850
  }
81641
81851
  async function jsonFlag({
81642
81852
  context,
@@ -82613,20 +82823,26 @@ async function appOfWord({
82613
82823
  }) {
82614
82824
  const scoped = word3 ? { ...args, flags: { ...args.flags, app: word3 } } : args;
82615
82825
  const client = await appClient({ context, args: scoped });
82616
- const appId = await appIdOf({
82826
+ const named = await appNamed({
82617
82827
  client,
82618
82828
  args: scoped,
82619
82829
  folder: folderOf({ context, word: void 0 })
82620
82830
  });
82621
- const apps = await client.get("/api/apps");
82622
- const listed = apps.find((found) => found.id === appId) ?? (await client.get("/api/apps?archived=true")).find((found) => found.id === appId);
82623
- return { client, appId, name: listed?.name ?? appId };
82831
+ return { client, ...named };
82624
82832
  }
82625
82833
  var appCost = async ({ context, args }) => {
82626
82834
  const { client, appId, name: name3 } = await appOfWord({ context, args, word: args.words[2] });
82627
82835
  const cost = await client.post("/api/apps/cost", { appId });
82628
82836
  print5({ context, args, value: cost, text: costText({ name: name3, cost }) });
82629
82837
  };
82838
+ var appUpgrade = async ({ context, args }) => {
82839
+ const { client, appId, name: name3 } = await appOfWord({ context, args, word: args.words[2] });
82840
+ const done = await client.post("/api/apps/template/upgrade", { appId });
82841
+ const text3 = done.upgraded ? `${name3} now runs the ${done.templateName} template version ${done.templateVersion}: wrote ${done.files.join(", ")} as live version ${done.version?.slice(0, 7) ?? ""}. Run laze app pull before your next push so your folder has it.
82842
+ ` : `${name3} is already on the ${done.templateName} template version ${done.templateVersion}; nothing changed.
82843
+ `;
82844
+ print5({ context, args, value: done, text: text3 });
82845
+ };
82630
82846
  var appBudget = async ({ context, args }) => {
82631
82847
  const words = args.words.slice(2);
82632
82848
  const [word3, amount] = words.length >= 2 ? words : [void 0, ...words];
@@ -82650,6 +82866,7 @@ function managed(command) {
82650
82866
  var APP_COMMANDS = {
82651
82867
  create: appCreate,
82652
82868
  templates: appTemplates,
82869
+ upgrade: appUpgrade,
82653
82870
  list: appList,
82654
82871
  push: appPush,
82655
82872
  write: appWrite,
@@ -85985,6 +86202,8 @@ var computeConfig = Config.define((c) => ({
85985
86202
  "LAZE_COMPUTE_MACHINE_IMAGE",
85986
86203
  external_exports.string().min(1).default("rg.fr-par.scw.cloud/laze-prod/laze-browser-machine:latest")
85987
86204
  ),
86205
+ /** `b` on the spare api (ADR-206): its link sweeps run only while it holds machine links. */
86206
+ apiSlot,
85988
86207
  /** Who sells dedicated IPs, on once its keys are set; `memory` locally, `none` for off. */
85989
86208
  ipVendor: c.env(
85990
86209
  "LAZE_IP_VENDOR",
@@ -86002,6 +86221,44 @@ var computeConfig = Config.define((c) => ({
86002
86221
  whatsappMirrorObserve: c.env("WHATSAPP_MIRROR_OBSERVE", external_exports.enum(["on", "off"]).default("off"))
86003
86222
  }));
86004
86223
 
86224
+ // ../../modules/compute/contract/src/computer-waitlist.ts
86225
+ var workspaceIdSchema19 = external_exports.string().min(1).max(64);
86226
+ var computerRoomInputDefinition = external_exports.object({ workspaceId: workspaceIdSchema19 });
86227
+ var computerRoomInputSchema = computerRoomInputDefinition;
86228
+ var computerRoomDefinition2 = external_exports.object({
86229
+ room: external_exports.enum(["ok", "full"]),
86230
+ /** The caller waits on the list in this workspace. */
86231
+ waitlisted: external_exports.boolean()
86232
+ });
86233
+ var computerRoomAnswerSchema = computerRoomDefinition2;
86234
+ var computerWaitlistReasonSchema = external_exports.enum(["first_run", "invitee"]);
86235
+ var joinComputerWaitlistDefinition = external_exports.object({
86236
+ workspaceId: workspaceIdSchema19,
86237
+ /** The app page the claim email and notice link back to; a relative path such as /w/... */
86238
+ returnPath: external_exports.string().min(1).max(2048),
86239
+ reason: computerWaitlistReasonSchema
86240
+ });
86241
+ var joinComputerWaitlistInputSchema = joinComputerWaitlistDefinition;
86242
+ var computerWaitlistJoinedDefinition = external_exports.object({
86243
+ waitlisted: external_exports.literal(true),
86244
+ position: external_exports.number().int().positive()
86245
+ });
86246
+ var computerWaitlistJoinedSchema = computerWaitlistJoinedDefinition;
86247
+ var computeWaitlistTrpc = defineTrpcContract("compute").query("computerRoom").withInput(computerRoomInputSchema).withOutput(computerRoomAnswerSchema).mutation("joinComputerWaitlist").withInput(joinComputerWaitlistInputSchema).withOutput(computerWaitlistJoinedSchema).build();
86248
+ var computeWaitlistSweepStateDefinition = external_exports.object({ lastSweepAt: external_exports.number().nullable() });
86249
+ var computeWaitlistSweepIntentDefinition = external_exports.object({ scheduledFor: external_exports.number() });
86250
+ var computerWaitlistChangedDefinition = external_exports.object({
86251
+ workspaceId: external_exports.string().min(1),
86252
+ userId: external_exports.string().min(1),
86253
+ entryId: external_exports.string().min(1),
86254
+ change: external_exports.enum(["joined", "claimed"]),
86255
+ reason: computerWaitlistReasonSchema,
86256
+ /** How long the person waited, in milliseconds; null on joining. */
86257
+ waitedMs: external_exports.number().int().nonnegative().nullable(),
86258
+ changeId: external_exports.string().min(1),
86259
+ at: external_exports.iso.datetime()
86260
+ });
86261
+
86005
86262
  // ../../modules/billing/contract/src/billing.config.ts
86006
86263
  var priceId = external_exports.string().min(1).optional();
86007
86264
  var billingConfig = Config.define((c) => ({
@@ -86145,7 +86402,8 @@ var accountChangedDefinition = external_exports.object({
86145
86402
  "recharged",
86146
86403
  "recharge_failed",
86147
86404
  "auto_recharge",
86148
- "referral"
86405
+ "referral",
86406
+ "promotion"
86149
86407
  ]),
86150
86408
  plan: storedPlanSchema,
86151
86409
  status: external_exports.string(),
@@ -86154,6 +86412,8 @@ var accountChangedDefinition = external_exports.object({
86154
86412
  extraSeats: external_exports.number().int().nonnegative().optional(),
86155
86413
  /** People a complimentary Team holds; absent or null when the plan sets the limit. */
86156
86414
  seatCap: external_exports.number().int().positive().nullable().optional(),
86415
+ /** The promotion the workspace applied (`tlc-2026-11`); absent or null when none. */
86416
+ promotionId: external_exports.string().nullable().optional(),
86157
86417
  at: external_exports.iso.datetime()
86158
86418
  });
86159
86419
  var usageRecordedDefinition = external_exports.object({
@@ -86179,9 +86439,58 @@ var referralRewardedDefinition = external_exports.object({
86179
86439
  outcome: external_exports.enum(["discount", "banked", "credits"]),
86180
86440
  at: external_exports.iso.datetime()
86181
86441
  });
86442
+ var checkoutChangedDefinition = external_exports.object({
86443
+ workspaceId: external_exports.string().min(1),
86444
+ /** The Stripe Checkout session id. */
86445
+ checkoutId: external_exports.string().min(1),
86446
+ kind: external_exports.enum(["team", "credits"]),
86447
+ /** `abandoned` is Stripe expiring the session unpaid, 24 hours after it opened. */
86448
+ stage: external_exports.enum(["started", "completed", "abandoned"]),
86449
+ /** The promotion whose coupon the Checkout carries (`tlc-2026-11`); null when none. */
86450
+ promotionId: external_exports.string().nullable(),
86451
+ /** The person who opened the Checkout, when known. */
86452
+ byUserId: external_exports.string().nullable(),
86453
+ at: external_exports.iso.datetime()
86454
+ });
86182
86455
  var creditCheckStateDefinition = external_exports.object({ nextWakeAt: external_exports.number().nullable() });
86183
86456
  var creditCheckIntentDefinition = external_exports.object({ workspaceId: external_exports.string().min(1) });
86184
86457
 
86458
+ // ../../modules/billing/contract/src/billing.promotions.ts
86459
+ var promotionStateSchema = external_exports.enum(["waiting", "running", "used", "lapsed"]);
86460
+ var promotionViewDefinition = external_exports.object({
86461
+ id: external_exports.string(),
86462
+ code: external_exports.string(),
86463
+ percentOff: external_exports.number(),
86464
+ months: external_exports.number().int().positive(),
86465
+ redeemBy: external_exports.iso.datetime(),
86466
+ upgradeBy: external_exports.iso.datetime(),
86467
+ appliedAt: external_exports.iso.datetime(),
86468
+ state: promotionStateSchema,
86469
+ /** When the discount stops, once Team started with it. */
86470
+ discountEndsAt: external_exports.iso.datetime().nullable()
86471
+ });
86472
+ var promotionViewSchema = promotionViewDefinition;
86473
+ var promotionRefusalSchema = external_exports.enum([
86474
+ "unknown",
86475
+ "ended",
86476
+ "already_applied",
86477
+ "subscribed",
86478
+ "referral_applied"
86479
+ ]);
86480
+ var applyPromotionInputDefinition = external_exports.object({
86481
+ workspaceId: external_exports.string().min(1),
86482
+ code: external_exports.string().trim().min(1).max(64)
86483
+ });
86484
+ var applyPromotionInputSchema = applyPromotionInputDefinition;
86485
+ var claimPromotionInputDefinition = external_exports.object({ code: external_exports.string().trim().min(1).max(64) });
86486
+ var claimPromotionInputSchema = claimPromotionInputDefinition;
86487
+ var claimPromotionOutputDefinition = external_exports.object({
86488
+ outcome: external_exports.enum(["kept", "applied", "refused"]),
86489
+ reason: promotionRefusalSchema.nullable(),
86490
+ workspaceId: external_exports.string().nullable()
86491
+ });
86492
+ var claimPromotionOutputSchema = claimPromotionOutputDefinition;
86493
+
86185
86494
  // ../../modules/billing/contract/src/billing.ts
86186
86495
  var workspaceInputDefinition2 = external_exports.object({ workspaceId: external_exports.string().min(1) });
86187
86496
  var billingWorkspaceInputSchema = workspaceInputDefinition2;
@@ -86265,6 +86574,8 @@ var billingAccountViewDefinition = external_exports.object({
86265
86574
  /** Rewards earned in the last 365 days, against `REFERRAL_CARD_TERMS.yearlyRewardLimit`. */
86266
86575
  rewardsThisYear: external_exports.number().int().nonnegative().default(0)
86267
86576
  }),
86577
+ /** The promotion code this workspace applied, if any. */
86578
+ promotion: promotionViewSchema.nullable().default(null),
86268
86579
  portalAvailable: external_exports.boolean(),
86269
86580
  /** A Team payment that failed or waits for the buyer's bank, until an invoice is paid. */
86270
86581
  paymentIssue: external_exports.object({
@@ -86380,7 +86691,9 @@ var inviteQuoteDefinition = external_exports.object({
86380
86691
  /** The most people the plan holds; null when it holds everyone. */
86381
86692
  seatCap: external_exports.number().int().positive().nullable(),
86382
86693
  /** How many of the added people the cap leaves waiting. */
86383
- overCap: external_exports.number().int().nonnegative()
86694
+ overCap: external_exports.number().int().nonnegative(),
86695
+ /** A promotion that will discount the Team this invite starts; null when none applies. */
86696
+ promotion: promotionViewSchema.nullable().default(null)
86384
86697
  });
86385
86698
  var inviteQuoteSchema = inviteQuoteDefinition;
86386
86699
  var setCurrencyInputDefinition = external_exports.object({
@@ -86463,7 +86776,7 @@ var grantCreditsInputDefinition = external_exports.object({
86463
86776
  reason: external_exports.string().trim().min(3).max(500)
86464
86777
  });
86465
86778
  var BillingApi = moduleApi()("billing");
86466
- 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).query("inviteQuote").withInput(inviteQuoteInputSchema).withOutput(inviteQuoteSchema).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).query("referralCard").withInput(billingWorkspaceInputSchema).withOutput(referralCardSchema).mutation("dismissReferralCard").withInput(billingWorkspaceInputSchema).withOutput(referralCardSchema).mutation("claimReferral").withInput(claimReferralInputSchema).withOutput(claimReferralOutputSchema).query("billingDetails").withInput(billingWorkspaceInputSchema).withOutput(billingDetailsSchema).mutation("setBillingDetails").withInput(setBillingDetailsInputSchema).withOutput(billingDetailsSchema).mutation("cancelPlan").withInput(billingWorkspaceInputSchema).withOutput(billingAccountViewSchema).mutation("keepPlan").withInput(billingWorkspaceInputSchema).withOutput(billingAccountViewSchema).build();
86779
+ 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).query("inviteQuote").withInput(inviteQuoteInputSchema).withOutput(inviteQuoteSchema).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).query("referralCard").withInput(billingWorkspaceInputSchema).withOutput(referralCardSchema).mutation("dismissReferralCard").withInput(billingWorkspaceInputSchema).withOutput(referralCardSchema).mutation("claimReferral").withInput(claimReferralInputSchema).withOutput(claimReferralOutputSchema).mutation("applyPromotion").withInput(applyPromotionInputSchema).withOutput(billingAccountViewSchema).mutation("claimPromotion").withInput(claimPromotionInputSchema).withOutput(claimPromotionOutputSchema).query("billingDetails").withInput(billingWorkspaceInputSchema).withOutput(billingDetailsSchema).mutation("setBillingDetails").withInput(setBillingDetailsInputSchema).withOutput(billingDetailsSchema).mutation("cancelPlan").withInput(billingWorkspaceInputSchema).withOutput(billingAccountViewSchema).mutation("keepPlan").withInput(billingWorkspaceInputSchema).withOutput(billingAccountViewSchema).build();
86467
86780
  var stripeWebhookHeadersDefinition = external_exports.object({
86468
86781
  "stripe-signature": external_exports.string().max(1e3).default("")
86469
86782
  });
@@ -86958,7 +87271,7 @@ var dedicatedIpKeyReleasedDefinition = external_exports.object({
86958
87271
  });
86959
87272
 
86960
87273
  // ../../modules/compute/contract/src/own-machine-ssh.ts
86961
- var workspaceIdSchema19 = external_exports.string().min(1).max(64);
87274
+ var workspaceIdSchema20 = external_exports.string().min(1).max(64);
86962
87275
  var machineRefText = external_exports.string().min(1).max(64);
86963
87276
  var sshHostKeySchema = external_exports.string().regex(/^SHA256:[A-Za-z0-9+/]{43}$/);
86964
87277
  function sshTargetText({ target }) {
@@ -86980,7 +87293,7 @@ var machineSshDefinition = external_exports.object({
86980
87293
  });
86981
87294
  var machineSshSchema = machineSshDefinition;
86982
87295
  var connectSshDefinition = external_exports.object({
86983
- workspaceId: workspaceIdSchema19,
87296
+ workspaceId: workspaceIdSchema20,
86984
87297
  /** Checked by `checkMachineName`, so a refusal reads as a sentence. */
86985
87298
  name: external_exports.string().max(200),
86986
87299
  /** `user@host[:port]`, checked by `parseSshTarget`. */
@@ -86989,7 +87302,7 @@ var connectSshDefinition = external_exports.object({
86989
87302
  var connectSshMachineInputSchema = connectSshDefinition;
86990
87303
  var restConnectSshDefinition = connectSshDefinition.omit({ workspaceId: true });
86991
87304
  var trustHostKeyDefinition = external_exports.object({
86992
- workspaceId: workspaceIdSchema19,
87305
+ workspaceId: workspaceIdSchema20,
86993
87306
  machine: machineRefText,
86994
87307
  hostKey: sshHostKeySchema
86995
87308
  });
@@ -87076,7 +87389,7 @@ var setAgentAccessDefinition = external_exports.object({
87076
87389
  var setWhatsappAgentAccessInputSchema = setAgentAccessDefinition;
87077
87390
 
87078
87391
  // ../../modules/compute/contract/src/own-machine-whatsapp.ts
87079
- var workspaceIdSchema20 = external_exports.string().min(1).max(64);
87392
+ var workspaceIdSchema21 = external_exports.string().min(1).max(64);
87080
87393
  var machineRefText2 = external_exports.string().min(1).max(64);
87081
87394
  var WHATSAPP_TEXT_MAX = 4096;
87082
87395
  var WHATSAPP_LIMIT_MAX = 200;
@@ -87128,7 +87441,7 @@ var messagesResultDefinition = external_exports.object({
87128
87441
  messages: external_exports.array(whatsappMessageDefinition)
87129
87442
  });
87130
87443
  var chatPeopleInputDefinition = external_exports.object({
87131
- workspaceId: workspaceIdSchema20,
87444
+ workspaceId: workspaceIdSchema21,
87132
87445
  channelId: external_exports.string().min(1).max(64)
87133
87446
  });
87134
87447
  var whatsappChatPeopleInputSchema = chatPeopleInputDefinition;
@@ -87145,13 +87458,13 @@ var readAskFields = {
87145
87458
  waitSeconds: external_exports.number().int().min(0).max(WHATSAPP_READ_WAIT_MAX_SECONDS).optional()
87146
87459
  };
87147
87460
  var chatsInputDefinition = external_exports.object({
87148
- workspaceId: workspaceIdSchema20,
87461
+ workspaceId: workspaceIdSchema21,
87149
87462
  machine: whatsappMachineRef,
87150
87463
  limit: limitSchema.optional(),
87151
87464
  ...readAskFields
87152
87465
  });
87153
87466
  var readInputDefinition = external_exports.object({
87154
- workspaceId: workspaceIdSchema20,
87467
+ workspaceId: workspaceIdSchema21,
87155
87468
  machine: whatsappMachineRef,
87156
87469
  /** A chat id, a phone number or a contact or group name. */
87157
87470
  chat: chatRefSchema,
@@ -87159,7 +87472,7 @@ var readInputDefinition = external_exports.object({
87159
87472
  ...readAskFields
87160
87473
  });
87161
87474
  var fileInputDefinition = external_exports.object({
87162
- workspaceId: workspaceIdSchema20,
87475
+ workspaceId: workspaceIdSchema21,
87163
87476
  machine: whatsappMachineRef,
87164
87477
  /** The chat as a read names it: its id, a phone number or the exact contact or group name. */
87165
87478
  chat: chatRefSchema,
@@ -87181,13 +87494,13 @@ var whatsappFileDefinition = external_exports.object({
87181
87494
  transcript: external_exports.string().optional()
87182
87495
  });
87183
87496
  var sendInputDefinition = external_exports.object({
87184
- workspaceId: workspaceIdSchema20,
87497
+ workspaceId: workspaceIdSchema21,
87185
87498
  machine: whatsappMachineRef,
87186
87499
  chat: chatRefSchema,
87187
87500
  text: external_exports.string().trim().min(1).max(WHATSAPP_TEXT_MAX)
87188
87501
  });
87189
87502
  var sendStatusInputDefinition = external_exports.object({
87190
- workspaceId: workspaceIdSchema20,
87503
+ workspaceId: workspaceIdSchema21,
87191
87504
  sendId: external_exports.string().min(1).max(64),
87192
87505
  /** Wait up to this long for the owner's answer; 0 answers at once. */
87193
87506
  waitSeconds: external_exports.number().int().min(0).max(WHATSAPP_STATUS_WAIT_MAX_SECONDS).default(0)
@@ -87226,7 +87539,7 @@ var whatsappPairingDefinition = external_exports.object({
87226
87539
  error: external_exports.string().nullable()
87227
87540
  });
87228
87541
  var pairInputDefinition = external_exports.object({
87229
- workspaceId: workspaceIdSchema20,
87542
+ workspaceId: workspaceIdSchema21,
87230
87543
  machine: machineRefText2,
87231
87544
  /** The person's number with country code; absent, only a QR code is made. */
87232
87545
  phone: external_exports.string().trim().min(7).max(24).regex(/^\+?[0-9 ()-]+$/).optional()
@@ -87260,7 +87573,7 @@ var mirrorSettingsDefinition = external_exports.object({
87260
87573
  });
87261
87574
  var whatsappMirrorSettingsSchema = mirrorSettingsDefinition;
87262
87575
  var setMirrorSettingsDefinition = external_exports.object({
87263
- workspaceId: workspaceIdSchema20,
87576
+ workspaceId: workspaceIdSchema21,
87264
87577
  machine: machineRefText2,
87265
87578
  mirrorOn: external_exports.boolean().optional(),
87266
87579
  onlineMode: whatsappOnlineModeSchema.optional(),
@@ -87279,7 +87592,7 @@ var whatsappComputerDefinition = external_exports.object({
87279
87592
  nextVisitAt: external_exports.string().nullable()
87280
87593
  });
87281
87594
  var whatsappComputerSchema = whatsappComputerDefinition;
87282
- var whatsappComputerInputDefinition = external_exports.object({ workspaceId: workspaceIdSchema20 });
87595
+ var whatsappComputerInputDefinition = external_exports.object({ workspaceId: workspaceIdSchema21 });
87283
87596
  var whatsappComputerInputSchema = whatsappComputerInputDefinition;
87284
87597
  var whatsappChangeDefinition = external_exports.object({
87285
87598
  chat: external_exports.string().min(1).max(200),
@@ -87291,6 +87604,8 @@ var whatsappChangeDefinition = external_exports.object({
87291
87604
  sender: external_exports.string().max(500),
87292
87605
  text: external_exports.string(),
87293
87606
  deleted: external_exports.boolean(),
87607
+ /** Numbered again above Laze's floor: a message Laze holds already takes nothing from it. */
87608
+ replay: external_exports.boolean().optional(),
87294
87609
  /** The change's place in the store's change feed; absent from older connectors. */
87295
87610
  seq: external_exports.number().int().min(1).optional(),
87296
87611
  /** Fetched with a "media" request while the store is open; absent from older connectors. */
@@ -87313,7 +87628,7 @@ var whatsappReadDefinition = external_exports.object({
87313
87628
  });
87314
87629
  var whatsappPairingSchema = whatsappPairingDefinition;
87315
87630
  var pairingRefDefinition = external_exports.object({
87316
- workspaceId: workspaceIdSchema20,
87631
+ workspaceId: workspaceIdSchema21,
87317
87632
  pairingId: external_exports.string().min(1).max(64)
87318
87633
  });
87319
87634
  var whatsappPairingRefSchema = pairingRefDefinition;
@@ -87335,7 +87650,7 @@ var COMPUTE_WHATSAPP_REST_PATHS = {
87335
87650
  };
87336
87651
 
87337
87652
  // ../../modules/compute/contract/src/own-machine.ts
87338
- var workspaceIdSchema21 = external_exports.string().min(1).max(64);
87653
+ var workspaceIdSchema22 = external_exports.string().min(1).max(64);
87339
87654
  var machineRefText3 = external_exports.string().min(1).max(64);
87340
87655
  var machineBrowserDefinition = external_exports.object({
87341
87656
  ready: external_exports.boolean(),
@@ -87370,7 +87685,7 @@ var machineHealthDefinition = external_exports.object({
87370
87685
  });
87371
87686
  var machineHealthSchema = machineHealthDefinition;
87372
87687
  var connectOwnDefinition = external_exports.object({
87373
- workspaceId: workspaceIdSchema21,
87688
+ workspaceId: workspaceIdSchema22,
87374
87689
  /** Checked by `checkMachineName`, so a refusal reads as a sentence. */
87375
87690
  name: external_exports.string().max(200)
87376
87691
  });
@@ -87378,7 +87693,7 @@ var connectOwnMachineInputSchema = connectOwnDefinition;
87378
87693
  var MACHINE_EXEC_MAX_SECONDS = 240;
87379
87694
  var MACHINE_EXEC_OUTPUT_BYTES = 1024 * 1024;
87380
87695
  var execDefinition = external_exports.object({
87381
- workspaceId: workspaceIdSchema21,
87696
+ workspaceId: workspaceIdSchema22,
87382
87697
  machine: machineRefText3,
87383
87698
  command: external_exports.string().min(1).max(64 * 1024),
87384
87699
  timeoutSeconds: external_exports.number().int().min(1).max(MACHINE_EXEC_MAX_SECONDS).optional(),
@@ -87450,14 +87765,14 @@ function gigabytes(bytes) {
87450
87765
  }
87451
87766
  var hostWhenOfflineSchema = external_exports.enum(["wait", "sandbox"]);
87452
87767
  var hostAgentDefinition = external_exports.object({
87453
- workspaceId: workspaceIdSchema21,
87768
+ workspaceId: workspaceIdSchema22,
87454
87769
  machine: machineRefText3,
87455
87770
  agentId: external_exports.string().min(1).max(64),
87456
87771
  whenOffline: hostWhenOfflineSchema.default("wait")
87457
87772
  });
87458
87773
  var hostAgentInputSchema = hostAgentDefinition;
87459
87774
  var unhostAgentDefinition = external_exports.object({
87460
- workspaceId: workspaceIdSchema21,
87775
+ workspaceId: workspaceIdSchema22,
87461
87776
  agentId: external_exports.string().min(1).max(64)
87462
87777
  });
87463
87778
  var unhostAgentInputSchema = unhostAgentDefinition;
@@ -87477,7 +87792,7 @@ var agentHostGrantDefinition = external_exports.object({
87477
87792
 
87478
87793
  // ../../modules/compute/contract/src/compute.ts
87479
87794
  var idSchema23 = external_exports.string().min(1).max(64);
87480
- var workspaceIdSchema22 = external_exports.string().min(1).max(64);
87795
+ var workspaceIdSchema23 = external_exports.string().min(1).max(64);
87481
87796
  var machineStateSchema = external_exports.enum([
87482
87797
  "starting",
87483
87798
  "ready",
@@ -87507,7 +87822,7 @@ var machineGrantDefinition = external_exports.object({
87507
87822
  });
87508
87823
  var machineDefinition = external_exports.object({
87509
87824
  id: idSchema23,
87510
- workspaceId: workspaceIdSchema22,
87825
+ workspaceId: workspaceIdSchema23,
87511
87826
  name: external_exports.string(),
87512
87827
  type: machineTypeSchema,
87513
87828
  zone: external_exports.string(),
@@ -87558,23 +87873,23 @@ var machineDefinition = external_exports.object({
87558
87873
  var machineSchema = machineDefinition;
87559
87874
  var computeStatusDefinition = external_exports.object({ available: external_exports.boolean() });
87560
87875
  var computeStatusSchema = computeStatusDefinition;
87561
- var workspaceInputDefinition3 = external_exports.object({ workspaceId: workspaceIdSchema22 });
87876
+ var workspaceInputDefinition3 = external_exports.object({ workspaceId: workspaceIdSchema23 });
87562
87877
  var computeWorkspaceInputSchema = workspaceInputDefinition3;
87563
87878
  var machineRefDefinition = external_exports.object({
87564
- workspaceId: workspaceIdSchema22,
87879
+ workspaceId: workspaceIdSchema23,
87565
87880
  machine: external_exports.string().min(1).max(64)
87566
87881
  });
87567
87882
  var machineRefSchema = machineRefDefinition;
87568
87883
  var MACHINE_NAME_MAX = 40;
87569
87884
  var machineNameSchema = external_exports.string().min(2).max(MACHINE_NAME_MAX).regex(/^[a-z0-9][a-z0-9-]*$/, "lowercase letters, digits and dashes");
87570
87885
  var renameDefinition = external_exports.object({
87571
- workspaceId: workspaceIdSchema22,
87886
+ workspaceId: workspaceIdSchema23,
87572
87887
  machine: external_exports.string().min(1).max(64),
87573
87888
  name: external_exports.string().max(200)
87574
87889
  });
87575
87890
  var renameMachineInputSchema = renameDefinition;
87576
87891
  var setupBrowserDefinition = external_exports.object({
87577
- workspaceId: workspaceIdSchema22,
87892
+ workspaceId: workspaceIdSchema23,
87578
87893
  /** The site the person signs in to, as a host or a URL. */
87579
87894
  site: external_exports.string().min(1).max(500),
87580
87895
  name: machineNameSchema.optional(),
@@ -87583,27 +87898,27 @@ var setupBrowserDefinition = external_exports.object({
87583
87898
  });
87584
87899
  var setupBrowserInputSchema = setupBrowserDefinition;
87585
87900
  var grantDefinition = external_exports.object({
87586
- workspaceId: workspaceIdSchema22,
87901
+ workspaceId: workspaceIdSchema23,
87587
87902
  machine: external_exports.string().min(1).max(64),
87588
87903
  grantee: machineGranteeDefinition
87589
87904
  });
87590
87905
  var machineGrantInputSchema = grantDefinition;
87591
87906
  var setBudgetDefinition = external_exports.object({
87592
- workspaceId: workspaceIdSchema22,
87907
+ workspaceId: workspaceIdSchema23,
87593
87908
  machine: external_exports.string().min(1).max(64),
87594
87909
  budgetUsd: external_exports.number().min(0).max(1e4),
87595
87910
  period: machineBudgetPeriodSchema
87596
87911
  });
87597
87912
  var setMachineBudgetInputSchema = setBudgetDefinition;
87598
87913
  var openScreenDefinition = external_exports.object({
87599
- workspaceId: workspaceIdSchema22,
87914
+ workspaceId: workspaceIdSchema23,
87600
87915
  machine: external_exports.string().min(1).max(64),
87601
87916
  site: external_exports.string().min(1).max(500).optional()
87602
87917
  });
87603
87918
  var openScreenInputSchema = openScreenDefinition;
87604
87919
  var loginTerminalHarnessSchema = external_exports.enum(["claude-code", "codex"]);
87605
87920
  var openLoginTerminalDefinition = external_exports.object({
87606
- workspaceId: workspaceIdSchema22,
87921
+ workspaceId: workspaceIdSchema23,
87607
87922
  harness: loginTerminalHarnessSchema
87608
87923
  });
87609
87924
  var openLoginTerminalInputSchema = openLoginTerminalDefinition;
@@ -87626,7 +87941,7 @@ var loginTerminalDefinition = external_exports.discriminatedUnion("status", [
87626
87941
  var loginTerminalSchema = loginTerminalDefinition;
87627
87942
  var warmComputerDefinition = external_exports.object({ status: external_exports.enum(["starting", "ready"]) });
87628
87943
  var warmComputerSchema = warmComputerDefinition;
87629
- var screenRefDefinition = external_exports.object({ workspaceId: workspaceIdSchema22, sessionId: idSchema23 });
87944
+ var screenRefDefinition = external_exports.object({ workspaceId: workspaceIdSchema23, sessionId: idSchema23 });
87630
87945
  var screenRefSchema = screenRefDefinition;
87631
87946
  var screenSessionDefinition = external_exports.object({
87632
87947
  sessionId: idSchema23,
@@ -87664,11 +87979,16 @@ var ownMachineSshConnectDefinition = external_exports.object({
87664
87979
  publicKey: external_exports.string()
87665
87980
  });
87666
87981
  var ownMachineSshConnectSchema = ownMachineSshConnectDefinition;
87667
- var reconcileDefinition = external_exports.object({ workspaceId: workspaceIdSchema22, machineId: idSchema23 });
87982
+ var reconcileDefinition = external_exports.object({ workspaceId: workspaceIdSchema23, machineId: idSchema23 });
87668
87983
  var ComputeApi = moduleApi()("compute");
87669
87984
  var computeCoreTrpc = defineTrpcContract("compute").query("status").withInput(computeWorkspaceInputSchema).withOutput(computeStatusSchema).query("browserTabs").withInput(browserTabListInputSchema).withOutput(browserTabListSchema).query("browserTab").withInput(browserTabInputSchema).withOutput(browserTabSchema).mutation("openBrowserTab").withInput(openBrowserTabInputSchema).withOutput(browserTabSchema).mutation("browserTabScreen").withInput(browserTabInputSchema).withOutput(browserTabScreenSchema).mutation("sizeBrowserTabScreen").withInput(browserTabScreenSizeInputSchema).withOutput(browserTabScreenSizeSchema).mutation("gotoBrowserTab").withInput(browserTabGotoInputSchema).withOutput(browserTabPageSchema).mutation("doneOnBrowserTab").withInput(browserTabInputSchema).withOutput(browserTabSchema).mutation("shareBrowserTab").withInput(browserTabShareInputSchema).withOutput(browserTabSchema).mutation("closeBrowserTab").withInput(browserTabInputSchema).withOutput(external_exports.object({ closed: external_exports.literal(true) })).query("computer").withInput(computeWorkspaceInputSchema).withOutput(computerStatusSchema).mutation("setComputerSize").withInput(setComputerSizeInputSchema).withOutput(computerSizeAnswerSchema).mutation("requestComputerSize").withInput(setComputerSizeInputSchema).withOutput(computerRequestSchema).mutation("cancelComputerRequest").withInput(computerRequestRefSchema).withOutput(computerRequestSchema).mutation("restartComputer").withInput(restartComputerInputSchema).withOutput(computerRestartAnswerSchema).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("openLoginTerminal").withInput(openLoginTerminalInputSchema).withOutput(loginTerminalSchema).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(whatsappPairInputSchema).withOutput(whatsappPairingSchema).query("whatsappMirror").withInput(machineRefSchema).withOutput(whatsappMirrorSettingsSchema).mutation("setWhatsappMirror").withInput(setWhatsappMirrorInputSchema).withOutput(whatsappMirrorSettingsSchema).query("whatsappPairing").withInput(whatsappPairingRefSchema).withOutput(whatsappPairingSchema).mutation("cancelWhatsappPairing").withInput(whatsappPairingRefSchema).withOutput(whatsappPairingSchema).mutation("unpairWhatsapp").withInput(machineRefSchema).withOutput(machineSchema).build();
87670
87985
  var computeFleetTrpc = defineTrpcContract("compute").query("whatsappComputer").withInput(whatsappComputerInputSchema).withOutput(whatsappComputerSchema).mutation("prepareWhatsappComputer").withInput(whatsappComputerInputSchema).withOutput(whatsappComputerSchema).mutation("warmComputer").withInput(computeWorkspaceInputSchema).withOutput(warmComputerSchema).query("myComputers").withInput(computeWorkspaceInputSchema).withOutput(myComputersSchema).query("personComputer").withInput(personComputerInputSchema).withOutput(computerUseSchema2).mutation("createComputer").withInput(createComputerInputSchema).withOutput(computerStatusSchema).mutation("deleteComputer").withInput(deleteComputerInputSchema).withOutput(deleteComputerAnswerSchema).mutation("setComputerCreators").withInput(setComputerCreatorsInputSchema).withOutput(computerStatusSchema).mutation("setAgentComputer").withInput(setAgentComputerInputSchema).withOutput(agentComputerAnswerSchema).query("whatsappAgents").withInput(machineRefSchema).withOutput(whatsappAgentsSchema).mutation("setWhatsappAgent").withInput(setWhatsappAgentInputSchema).withOutput(whatsappAgentsSchema).mutation("setWhatsappAgentLease").withInput(setWhatsappAgentLeaseInputSchema).withOutput(whatsappAgentsSchema).mutation("setWhatsappEveryAgent").withInput(setWhatsappEveryAgentInputSchema).withOutput(whatsappAgentsSchema).mutation("setWhatsappAgentAccess").withInput(setWhatsappAgentAccessInputSchema).withOutput(whatsappAgentsSchema).mutation("checkWhatsappNow").withInput(machineRefSchema).withOutput(whatsappMirrorSettingsSchema).query("whatsappChatPeople").withInput(whatsappChatPeopleInputSchema).withOutput(whatsappChatPeopleSchema).build();
87671
- var computeTrpc = joinTrpcContracts("compute", computeCoreTrpc, computeFleetTrpc);
87986
+ var computeTrpc = joinTrpcContracts(
87987
+ "compute",
87988
+ computeCoreTrpc,
87989
+ computeFleetTrpc,
87990
+ computeWaitlistTrpc
87991
+ );
87672
87992
  var restMachineInputDefinition = external_exports.object({ machine: external_exports.string().min(1).max(64) });
87673
87993
  var restRenameInputDefinition = external_exports.object({
87674
87994
  machine: external_exports.string().min(1).max(64),
@@ -87750,7 +88070,7 @@ var COMPUTER_COPY_REST_PATHS = {
87750
88070
  pending: "/api/compute/copies/pending",
87751
88071
  settle: "/api/compute/copies/settle"
87752
88072
  };
87753
- var workspaceIdSchema23 = external_exports.string().min(1).max(64);
88073
+ var workspaceIdSchema24 = external_exports.string().min(1).max(64);
87754
88074
  var copyIdSchema = external_exports.string().min(1).max(64);
87755
88075
  var copyTargetSchema = external_exports.string().trim().min(1).max(500).default(".");
87756
88076
  var computerCopyStateSchema = external_exports.enum(["uploading", "pending", "done", "failed"]);
@@ -87769,7 +88089,7 @@ var computerCopyDefinition = external_exports.object({
87769
88089
  createdAt: external_exports.iso.datetime()
87770
88090
  });
87771
88091
  var startComputerCopyInputDefinition = external_exports.object({
87772
- workspaceId: workspaceIdSchema23,
88092
+ workspaceId: workspaceIdSchema24,
87773
88093
  /** The agent's id or name. */
87774
88094
  agent: external_exports.string().trim().min(1).max(200),
87775
88095
  name: external_exports.string().trim().min(1).max(200),
@@ -87797,7 +88117,7 @@ var startedComputerCopyDefinition = external_exports.object({
87797
88117
  upload: copyUploadDefinition
87798
88118
  });
87799
88119
  var completeComputerCopyInputDefinition = external_exports.object({
87800
- workspaceId: workspaceIdSchema23,
88120
+ workspaceId: workspaceIdSchema24,
87801
88121
  copyId: copyIdSchema,
87802
88122
  parts: external_exports.array(external_exports.object({ partNumber: external_exports.number().int().positive(), etag: external_exports.string().min(1).max(200) })).max(1e4).default([])
87803
88123
  });
@@ -87816,7 +88136,7 @@ var pendingComputerCopiesDefinition = external_exports.object({
87816
88136
  copies: external_exports.array(pendingComputerCopyDefinition)
87817
88137
  });
87818
88138
  var settleComputerCopyInputDefinition = external_exports.object({
87819
- workspaceId: workspaceIdSchema23,
88139
+ workspaceId: workspaceIdSchema24,
87820
88140
  copyId: copyIdSchema,
87821
88141
  outcome: external_exports.enum(["done", "failed"]),
87822
88142
  files: external_exports.number().int().nonnegative().optional(),
@@ -89467,8 +89787,8 @@ import { readFile as readFile23 } from "node:fs/promises";
89467
89787
  import { resolve as resolve14 } from "node:path";
89468
89788
 
89469
89789
  // ../../modules/discord/contract/src/discord.ts
89470
- var workspaceIdSchema24 = external_exports.string().min(1).max(64);
89471
- var workspaceInput4 = external_exports.object({ workspaceId: workspaceIdSchema24 });
89790
+ var workspaceIdSchema25 = external_exports.string().min(1).max(64);
89791
+ var workspaceInput4 = external_exports.object({ workspaceId: workspaceIdSchema25 });
89472
89792
  var discordIdSchema = external_exports.string().regex(/^\d{5,25}$/);
89473
89793
  var DISCORD_PERMISSIONS = {
89474
89794
  ADMINISTRATOR: 1n << 3n,
@@ -89550,10 +89870,10 @@ var discordChannelViewDefinition = external_exports.object({
89550
89870
  url: external_exports.url()
89551
89871
  });
89552
89872
  var discordChannelViewSchema = discordChannelViewDefinition;
89553
- var guildInputDefinition = external_exports.object({ workspaceId: workspaceIdSchema24, guildId: discordIdSchema });
89873
+ var guildInputDefinition = external_exports.object({ workspaceId: workspaceIdSchema25, guildId: discordIdSchema });
89554
89874
  var discordGuildInputSchema = guildInputDefinition;
89555
89875
  var saveDiscordAppDefinition = external_exports.object({
89556
- workspaceId: workspaceIdSchema24,
89876
+ workspaceId: workspaceIdSchema25,
89557
89877
  setupKey: external_exports.string().min(1).max(64),
89558
89878
  applicationId: external_exports.string().trim().max(40),
89559
89879
  clientSecret: external_exports.string().trim().max(200),
@@ -89563,7 +89883,7 @@ var saveDiscordAppInputSchema = saveDiscordAppDefinition;
89563
89883
  var startedAuthorizeDefinition = external_exports.object({ authorizeUrl: external_exports.url() });
89564
89884
  var startedDiscordAuthorizeSchema = startedAuthorizeDefinition;
89565
89885
  var pickDefinition = external_exports.object({
89566
- workspaceId: workspaceIdSchema24,
89886
+ workspaceId: workspaceIdSchema25,
89567
89887
  guildId: discordIdSchema,
89568
89888
  channelId: discordIdSchema,
89569
89889
  picked: external_exports.boolean(),
@@ -89571,7 +89891,7 @@ var pickDefinition = external_exports.object({
89571
89891
  });
89572
89892
  var discordPickInputSchema = pickDefinition;
89573
89893
  var updateConnectionDefinition = external_exports.object({
89574
- workspaceId: workspaceIdSchema24,
89894
+ workspaceId: workspaceIdSchema25,
89575
89895
  guildId: discordIdSchema,
89576
89896
  label: external_exports.string().trim().max(80).nullable().optional(),
89577
89897
  cacheDays: external_exports.number().int().min(1).max(30).optional()
@@ -89584,16 +89904,16 @@ var oauthCallbackDefinition = external_exports.object({
89584
89904
  permissions: external_exports.string().max(40).optional(),
89585
89905
  error: external_exports.string().max(200).optional()
89586
89906
  });
89587
- var linkParamsDefinition = external_exports.object({ workspaceId: workspaceIdSchema24, guildId: discordIdSchema });
89907
+ var linkParamsDefinition = external_exports.object({ workspaceId: workspaceIdSchema25, guildId: discordIdSchema });
89588
89908
  var historyInputDefinition = external_exports.object({
89589
- workspaceId: workspaceIdSchema24,
89909
+ workspaceId: workspaceIdSchema25,
89590
89910
  /** The Laze conversation that mirrors the Discord channel. */
89591
89911
  channelId: external_exports.string().min(1).max(200),
89592
89912
  before: external_exports.iso.datetime()
89593
89913
  });
89594
89914
  var discordHistoryInputSchema = historyInputDefinition;
89595
89915
  var channelPeopleInputDefinition = external_exports.object({
89596
- workspaceId: workspaceIdSchema24,
89916
+ workspaceId: workspaceIdSchema25,
89597
89917
  channelId: external_exports.string().min(1).max(200)
89598
89918
  });
89599
89919
  var discordChannelPeopleInputSchema = channelPeopleInputDefinition;
@@ -89624,7 +89944,7 @@ var historyPageDefinition = external_exports.object({
89624
89944
  });
89625
89945
  var discordHistoryPageSchema = historyPageDefinition;
89626
89946
  var fileParamsDefinition = external_exports.object({
89627
- workspaceId: workspaceIdSchema24,
89947
+ workspaceId: workspaceIdSchema25,
89628
89948
  channelId: external_exports.string().min(1).max(200),
89629
89949
  messageId: discordIdSchema,
89630
89950
  attachmentId: discordIdSchema
@@ -89761,6 +90081,17 @@ var webhookProbeRequestedDefinition = external_exports.object({
89761
90081
  workspaceId: external_exports.string().min(1),
89762
90082
  runId: external_exports.string().min(1)
89763
90083
  });
90084
+ var discordLinkedDefinition = external_exports.object({
90085
+ workspaceId: external_exports.string().min(1),
90086
+ /** The Laze person who finished the flow. */
90087
+ userId: external_exports.string().min(1),
90088
+ /** Opaque and unique to this link, derived from the finished authorization. */
90089
+ linkId: external_exports.string().min(1),
90090
+ /** `installed`: the bot added to a server; `linked`: a person's own Discord account. */
90091
+ outcome: external_exports.enum(["installed", "linked"]),
90092
+ changeId: external_exports.string().min(1),
90093
+ at: external_exports.iso.datetime()
90094
+ });
89764
90095
 
89765
90096
  // src/services/discord-commands.service.ts
89766
90097
  var DISCORD_USAGE = `Usage (a person's key; Discord stays the source, each person picks their own channels):
@@ -90210,10 +90541,10 @@ var EXTERNAL_CONNECTION_REST_PATHS = {
90210
90541
  block: "/api/external-connections/block",
90211
90542
  report: "/api/external-connections/report"
90212
90543
  };
90213
- var workspaceIdSchema25 = external_exports.string().min(1).max(64);
90544
+ var workspaceIdSchema26 = external_exports.string().min(1).max(64);
90214
90545
  var idSchema24 = external_exports.string().min(1).max(64);
90215
90546
  var iso2 = external_exports.iso.datetime();
90216
- var workspaceInput5 = external_exports.object({ workspaceId: workspaceIdSchema25 });
90547
+ var workspaceInput5 = external_exports.object({ workspaceId: workspaceIdSchema26 });
90217
90548
  var connectionReference = external_exports.string().trim().min(1).max(120);
90218
90549
  var externalConnectionStateSchema = external_exports.enum(["active", "ended"]);
90219
90550
  var externalInviteStateSchema = external_exports.enum([
@@ -90317,10 +90648,10 @@ var rosterDefinition = external_exports.object({
90317
90648
  members: external_exports.array(rosterMemberDefinition)
90318
90649
  });
90319
90650
  var externalRosterSchema = rosterDefinition;
90320
- var rosterInputDefinition = external_exports.object({ workspaceId: workspaceIdSchema25, channelId: idSchema24 });
90651
+ var rosterInputDefinition = external_exports.object({ workspaceId: workspaceIdSchema26, channelId: idSchema24 });
90321
90652
  var externalRosterInputSchema = rosterInputDefinition;
90322
90653
  var rosterCountsInputDefinition = external_exports.object({
90323
- workspaceId: workspaceIdSchema25,
90654
+ workspaceId: workspaceIdSchema26,
90324
90655
  channelIds: external_exports.array(idSchema24).max(200)
90325
90656
  });
90326
90657
  var externalRosterCountsInputSchema = rosterCountsInputDefinition;
@@ -90329,7 +90660,7 @@ var rosterCountsDefinition = external_exports.object({
90329
90660
  });
90330
90661
  var externalRosterCountsSchema = rosterCountsDefinition;
90331
90662
  var inviteInputDefinition = external_exports.object({
90332
- workspaceId: workspaceIdSchema25,
90663
+ workspaceId: workspaceIdSchema26,
90333
90664
  email: external_exports.email().max(320),
90334
90665
  /** The first channel to share, by id or name; it is shared once the invitation is accepted. */
90335
90666
  share: external_exports.string().trim().min(1).max(81).optional(),
@@ -90337,7 +90668,7 @@ var inviteInputDefinition = external_exports.object({
90337
90668
  company: external_exports.string().trim().min(1).max(80).optional()
90338
90669
  });
90339
90670
  var externalInviteInputSchema = inviteInputDefinition;
90340
- var inviteRefDefinition = external_exports.object({ workspaceId: workspaceIdSchema25, inviteId: idSchema24 });
90671
+ var inviteRefDefinition = external_exports.object({ workspaceId: workspaceIdSchema26, inviteId: idSchema24 });
90341
90672
  var externalInviteRefSchema = inviteRefDefinition;
90342
90673
  var pendingShareDefinition = external_exports.object({
90343
90674
  channelId: external_exports.string(),
@@ -90361,7 +90692,7 @@ var pendingSharesDefinition = external_exports.object({
90361
90692
  var externalPendingSharesSchema = pendingSharesDefinition;
90362
90693
  var acceptInviteDefinition = external_exports.object({
90363
90694
  /** The workspace to connect: one where the person is Admin or Owner. */
90364
- workspaceId: workspaceIdSchema25,
90695
+ workspaceId: workspaceIdSchema26,
90365
90696
  inviteId: idSchema24,
90366
90697
  /** The emailed link's secret; without it the invitation must be addressed to the person. */
90367
90698
  secret: external_exports.string().trim().max(200).optional()
@@ -90370,26 +90701,26 @@ var externalAcceptInviteInputSchema = acceptInviteDefinition;
90370
90701
  var answeredDefinition = external_exports.object({ id: external_exports.string(), state: externalInviteStateSchema });
90371
90702
  var externalInviteAnsweredSchema = answeredDefinition;
90372
90703
  var connectionInputDefinition = external_exports.object({
90373
- workspaceId: workspaceIdSchema25,
90704
+ workspaceId: workspaceIdSchema26,
90374
90705
  connection: connectionReference
90375
90706
  });
90376
90707
  var externalConnectionInputSchema = connectionInputDefinition;
90377
90708
  var settingsInputDefinition = external_exports.object({
90378
- workspaceId: workspaceIdSchema25,
90709
+ workspaceId: workspaceIdSchema26,
90379
90710
  connection: connectionReference,
90380
90711
  agentsAllowed: external_exports.boolean().optional(),
90381
90712
  directAllowed: external_exports.boolean().optional()
90382
90713
  });
90383
90714
  var externalSettingsInputSchema = settingsInputDefinition;
90384
90715
  var shareInputDefinition = external_exports.object({
90385
- workspaceId: workspaceIdSchema25,
90716
+ workspaceId: workspaceIdSchema26,
90386
90717
  connection: connectionReference,
90387
90718
  /** The channel as its id or name, `#` optional. */
90388
90719
  channel: external_exports.string().trim().min(1).max(81)
90389
90720
  });
90390
90721
  var externalShareInputSchema = shareInputDefinition;
90391
90722
  var acceptShareDefinition = external_exports.object({
90392
- workspaceId: workspaceIdSchema25,
90723
+ workspaceId: workspaceIdSchema26,
90393
90724
  shareId: idSchema24,
90394
90725
  /** Its name here; the host's name when left out. */
90395
90726
  name: external_exports.string().trim().min(1).max(80).optional(),
@@ -90397,13 +90728,13 @@ var acceptShareDefinition = external_exports.object({
90397
90728
  });
90398
90729
  var externalAcceptShareInputSchema = acceptShareDefinition;
90399
90730
  var shareRefDefinition = external_exports.object({
90400
- workspaceId: workspaceIdSchema25,
90731
+ workspaceId: workspaceIdSchema26,
90401
90732
  /** The share's id, or this workspace's channel as its id or name. */
90402
90733
  share: external_exports.string().trim().min(1).max(81)
90403
90734
  });
90404
90735
  var externalShareRefSchema = shareRefDefinition;
90405
90736
  var reportInputDefinition = external_exports.object({
90406
- workspaceId: workspaceIdSchema25,
90737
+ workspaceId: workspaceIdSchema26,
90407
90738
  connection: connectionReference,
90408
90739
  note: external_exports.string().trim().min(1).max(2e3)
90409
90740
  });
@@ -90414,7 +90745,7 @@ var blockedDefinition = external_exports.object({
90414
90745
  });
90415
90746
  var externalBlockedSchema = blockedDefinition;
90416
90747
  var openDirectDefinition = external_exports.object({
90417
- workspaceId: workspaceIdSchema25,
90748
+ workspaceId: workspaceIdSchema26,
90418
90749
  /** The external person: their roster id (`laze:<id>`) or their name in a shared channel. */
90419
90750
  person: external_exports.string().trim().min(1).max(120),
90420
90751
  /** Their workspace, as a connection reference; needed only when a name is in two. */
@@ -99292,8 +99623,8 @@ var WHATSAPP_BUSINESS_REST_PATHS = {
99292
99623
  var WHATSAPP_BUSINESS_TEXT_MAX = 4096;
99293
99624
  var WHATSAPP_BUSINESS_LIMIT_MAX = 200;
99294
99625
  var WHATSAPP_BUSINESS_STATUS_WAIT_MAX_SECONDS = 50;
99295
- var workspaceIdSchema26 = external_exports.string().min(1).max(64);
99296
- var workspaceInput6 = external_exports.object({ workspaceId: workspaceIdSchema26 });
99626
+ var workspaceIdSchema27 = external_exports.string().min(1).max(64);
99627
+ var workspaceInput6 = external_exports.object({ workspaceId: workspaceIdSchema27 });
99297
99628
  var digits = (what) => external_exports.string().trim().regex(/^\d{5,30}$/, `${what} is the number Meta shows, digits only`);
99298
99629
  var appSecretSchema = external_exports.string().trim().regex(/^[a-f0-9]{32}$/i, "The app secret is 32 letters and digits from App settings > Basic");
99299
99630
  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");
@@ -99327,7 +99658,7 @@ var statusDefinition = external_exports.object({
99327
99658
  });
99328
99659
  var whatsappBusinessStatusSchema = statusDefinition;
99329
99660
  var connectDefinition2 = external_exports.object({
99330
- workspaceId: workspaceIdSchema26,
99661
+ workspaceId: workspaceIdSchema27,
99331
99662
  appId: digits("The app id"),
99332
99663
  wabaId: digits("The WhatsApp Business Account id"),
99333
99664
  phoneNumberId: digits("The phone number id"),
@@ -99350,7 +99681,7 @@ var webhookDefinition = external_exports.object({
99350
99681
  });
99351
99682
  var whatsappBusinessWebhookSchema = webhookDefinition;
99352
99683
  var settingsDefinition3 = external_exports.object({
99353
- workspaceId: workspaceIdSchema26,
99684
+ workspaceId: workspaceIdSchema27,
99354
99685
  /** The agent that answers; null for none. Left out keeps the current one. */
99355
99686
  agentId: external_exports.string().min(1).max(64).nullable().optional(),
99356
99687
  replyMode: whatsappBusinessReplyModeSchema.optional()
@@ -99370,7 +99701,7 @@ var whatsappBusinessConversationSchema = conversationDefinition;
99370
99701
  var limitSchema2 = external_exports.number().int().min(1).max(WHATSAPP_BUSINESS_LIMIT_MAX);
99371
99702
  var contactRefSchema = external_exports.string().trim().min(1).max(64);
99372
99703
  var conversationsInputDefinition = external_exports.object({
99373
- workspaceId: workspaceIdSchema26,
99704
+ workspaceId: workspaceIdSchema27,
99374
99705
  limit: limitSchema2.optional()
99375
99706
  });
99376
99707
  var whatsappBusinessConversationsInputSchema = conversationsInputDefinition;
@@ -99396,7 +99727,7 @@ var messageDefinition3 = external_exports.object({
99396
99727
  template: external_exports.string().nullable()
99397
99728
  });
99398
99729
  var readInputDefinition2 = external_exports.object({
99399
- workspaceId: workspaceIdSchema26,
99730
+ workspaceId: workspaceIdSchema27,
99400
99731
  contact: contactRefSchema,
99401
99732
  limit: limitSchema2.optional()
99402
99733
  });
@@ -99405,12 +99736,12 @@ var readDefinition2 = external_exports.object({
99405
99736
  messages: external_exports.array(messageDefinition3)
99406
99737
  });
99407
99738
  var sendInputDefinition2 = external_exports.object({
99408
- workspaceId: workspaceIdSchema26,
99739
+ workspaceId: workspaceIdSchema27,
99409
99740
  to: contactRefSchema,
99410
99741
  text: external_exports.string().trim().min(1).max(WHATSAPP_BUSINESS_TEXT_MAX)
99411
99742
  });
99412
99743
  var sendTemplateInputDefinition = external_exports.object({
99413
- workspaceId: workspaceIdSchema26,
99744
+ workspaceId: workspaceIdSchema27,
99414
99745
  to: contactRefSchema,
99415
99746
  template: external_exports.string().trim().min(1).max(512),
99416
99747
  /** The template's language code; the only approved one when left out. */
@@ -99437,7 +99768,7 @@ function whatsappBusinessSendSettled({
99437
99768
  return state !== "waiting" && state !== "sending";
99438
99769
  }
99439
99770
  var sendStatusInputDefinition2 = external_exports.object({
99440
- workspaceId: workspaceIdSchema26,
99771
+ workspaceId: workspaceIdSchema27,
99441
99772
  sendId: external_exports.string().min(1).max(64),
99442
99773
  waitSeconds: external_exports.number().int().min(0).max(WHATSAPP_BUSINESS_STATUS_WAIT_MAX_SECONDS).default(0)
99443
99774
  });
@@ -99487,7 +99818,7 @@ var restSendStatusDefinition2 = sendStatusInputDefinition2.omit({ workspaceId: t
99487
99818
  var restSettingsDefinition = settingsDefinition3.omit({ workspaceId: true });
99488
99819
  var restEmptyDefinition = external_exports.object({});
99489
99820
  var WhatsappBusinessApi = moduleApi()("whatsapp-business");
99490
- var whatsappBusinessTrpc = defineTrpcContract("whatsappBusiness").query("status").withInput(workspaceInput6).withOutput(whatsappBusinessStatusSchema).mutation("connect").withInput(connectWhatsappBusinessInputSchema).withOutput(whatsappBusinessWebhookSchema).mutation("check").withInput(workspaceInput6).withOutput(whatsappBusinessStatusSchema).mutation("verifyToken").withInput(workspaceInput6).withOutput(whatsappBusinessWebhookSchema).mutation("settings").withInput(updateWhatsappBusinessSettingsInputSchema).withOutput(whatsappBusinessStatusSchema).mutation("disconnect").withInput(workspaceInput6).withOutput(whatsappBusinessStatusSchema).query("conversations").withInput(whatsappBusinessConversationsInputSchema).withOutput(external_exports.array(whatsappBusinessConversationSchema)).query("templates").withInput(workspaceInput6).withOutput(external_exports.array(whatsappBusinessTemplateSchema)).query("prices").withInput(external_exports.object({ ...pricesInputDefinition.shape, workspaceId: workspaceIdSchema26 })).withOutput(whatsappBusinessPricesSchema).build();
99821
+ var whatsappBusinessTrpc = defineTrpcContract("whatsappBusiness").query("status").withInput(workspaceInput6).withOutput(whatsappBusinessStatusSchema).mutation("connect").withInput(connectWhatsappBusinessInputSchema).withOutput(whatsappBusinessWebhookSchema).mutation("check").withInput(workspaceInput6).withOutput(whatsappBusinessStatusSchema).mutation("verifyToken").withInput(workspaceInput6).withOutput(whatsappBusinessWebhookSchema).mutation("settings").withInput(updateWhatsappBusinessSettingsInputSchema).withOutput(whatsappBusinessStatusSchema).mutation("disconnect").withInput(workspaceInput6).withOutput(whatsappBusinessStatusSchema).query("conversations").withInput(whatsappBusinessConversationsInputSchema).withOutput(external_exports.array(whatsappBusinessConversationSchema)).query("templates").withInput(workspaceInput6).withOutput(external_exports.array(whatsappBusinessTemplateSchema)).query("prices").withInput(external_exports.object({ ...pricesInputDefinition.shape, workspaceId: workspaceIdSchema27 })).withOutput(whatsappBusinessPricesSchema).build();
99491
99822
 
99492
99823
  // ../../modules/whatsapp-business/contract/src/whatsapp-business.config.ts
99493
99824
  var whatsappBusinessConfig = Config.define((c) => ({