@lazehq/cli 0.1.109 → 0.1.111

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 +532 -137
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -31077,15 +31077,15 @@ ${value}`;
31077
31077
  pos = 0;
31078
31078
  }
31079
31079
  }
31080
- discardLeadingBytes(count7) {
31081
- while (count7 > 0 && this.lineChunkIndex < this.chunks.length) {
31080
+ discardLeadingBytes(count8) {
31081
+ while (count8 > 0 && this.lineChunkIndex < this.chunks.length) {
31082
31082
  const chunk = this.chunks[this.lineChunkIndex];
31083
31083
  const remaining = chunk.length - this.linePos;
31084
- if (count7 < remaining) {
31085
- this.linePos += count7;
31086
- count7 = 0;
31084
+ if (count8 < remaining) {
31085
+ this.linePos += count8;
31086
+ count8 = 0;
31087
31087
  } else {
31088
- count7 -= remaining;
31088
+ count8 -= remaining;
31089
31089
  this.lineChunkIndex++;
31090
31090
  this.linePos = 0;
31091
31091
  }
@@ -31656,7 +31656,7 @@ function isLazeId(token2) {
31656
31656
  if (value >> 152n !== 0n) return false;
31657
31657
  const seconds = value >> 104n & 0xffffffffn;
31658
31658
  const echo = value >> 136n & 0xffffn;
31659
- if (echo !== (seconds & 0xffffn)) return false;
31659
+ if (echo !== 0n && echo !== (seconds & 0xffffn)) return false;
31660
31660
  return seconds >= FIRST_SECOND && seconds <= LAST_SECOND;
31661
31661
  }
31662
31662
  function isLazeIdText(text3) {
@@ -31834,8 +31834,8 @@ function shannonEntropyBits(value) {
31834
31834
  const counts = /* @__PURE__ */ new Map();
31835
31835
  for (const char of sample) counts.set(char, (counts.get(char) ?? 0) + 1);
31836
31836
  let entropy = 0;
31837
- for (const count7 of counts.values()) {
31838
- const p = count7 / sample.length;
31837
+ for (const count8 of counts.values()) {
31838
+ const p = count8 / sample.length;
31839
31839
  entropy -= p * Math.log2(p);
31840
31840
  }
31841
31841
  return entropy;
@@ -36960,7 +36960,7 @@ function shadowedLinkLineOf({ shadow }) {
36960
36960
  }
36961
36961
 
36962
36962
  // src/rules/cli-version.rules.ts
36963
- var STAMPED = "0.1.109";
36963
+ var STAMPED = "0.1.111";
36964
36964
  function cliVersionOf({ stamped = STAMPED } = {}) {
36965
36965
  return stamped.startsWith("__") ? "dev" : stamped;
36966
36966
  }
@@ -38725,14 +38725,14 @@ function codePointLength(str) {
38725
38725
  const units = str.length;
38726
38726
  if (!highSurrogate.test(str))
38727
38727
  return units;
38728
- let count7 = units;
38728
+ let count8 = units;
38729
38729
  for (let i = 0; i < units - 1; i++) {
38730
38730
  if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
38731
- count7--;
38731
+ count8--;
38732
38732
  i++;
38733
38733
  }
38734
38734
  }
38735
- return count7;
38735
+ return count8;
38736
38736
  }
38737
38737
  function getLengthableOrigin(input2) {
38738
38738
  if (Array.isArray(input2))
@@ -43087,8 +43087,8 @@ function az_default() {
43087
43087
  }
43088
43088
 
43089
43089
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/be.js
43090
- function getBelarusianPlural(count7, one, few, many) {
43091
- const absCount = Math.abs(count7);
43090
+ function getBelarusianPlural(count8, one, few, many) {
43091
+ const absCount = Math.abs(count8);
43092
43092
  const lastDigit = absCount % 10;
43093
43093
  const lastTwoDigits = absCount % 100;
43094
43094
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -45735,8 +45735,8 @@ function hu_default() {
45735
45735
  }
45736
45736
 
45737
45737
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hy.js
45738
- function getArmenianPlural(count7, one, many) {
45739
- return Math.abs(count7) === 1 ? one : many;
45738
+ function getArmenianPlural(count8, one, many) {
45739
+ return Math.abs(count8) === 1 ? one : many;
45740
45740
  }
45741
45741
  function withDefiniteArticle(word3) {
45742
45742
  if (!word3)
@@ -48474,8 +48474,8 @@ function ro_default() {
48474
48474
  }
48475
48475
 
48476
48476
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ru.js
48477
- function getRussianPlural(count7, one, few, many) {
48478
- const absCount = Math.abs(count7);
48477
+ function getRussianPlural(count8, one, few, many) {
48478
+ const absCount = Math.abs(count8);
48479
48479
  const lastDigit = absCount % 10;
48480
48480
  const lastTwoDigits = absCount % 100;
48481
48481
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -60701,7 +60701,9 @@ var openVaultTurnInputSchemaDefinition = external_exports.object({
60701
60701
  /** A session outside Laze, which has no agent record: how its cards name it. */
60702
60702
  label: external_exports.string().max(300).nullish(),
60703
60703
  /** The support agent's turns: the agent_turn door refuses them, signed with the turn. */
60704
- profile: external_exports.literal("support").optional()
60704
+ profile: external_exports.literal("support").optional(),
60705
+ /** What the agent is for (its name and instructions, trimmed), for the judge only. */
60706
+ role: external_exports.string().max(1e3).optional()
60705
60707
  }),
60706
60708
  requesterUserId: external_exports.string().min(1),
60707
60709
  requesterGroupIds: external_exports.array(external_exports.string().min(1)).default([]),
@@ -61184,6 +61186,11 @@ var vaultConfig = Config.define((c) => ({
61184
61186
  /** Where the judge posts /v1/decisions: OpenAI's EU host, or the LangWatch AI gateway. */
61185
61187
  judgeBaseUrl: c.env("VAULT_JUDGE_BASE_URL", external_exports.url().default("https://eu.api.openai.com")),
61186
61188
  judgeModel: c.env("VAULT_JUDGE_MODEL", external_exports.string().min(1).default("gpt-6-luna")),
61189
+ /** Shadow judge calls on Always-ask uses per hour and api process; unset 60, 0 for none. */
61190
+ judgeShadowPerHour: c.env(
61191
+ "VAULT_JUDGE_SHADOW_PER_HOUR",
61192
+ external_exports.coerce.number().int().min(0).max(1e4).optional()
61193
+ ),
61187
61194
  /** How long one judge answer is reused for the same question. */
61188
61195
  judgeCacheMinutes: c.env("VAULT_JUDGE_CACHE_MINUTES", positiveInt.default(10)),
61189
61196
  /** The judge's price per input token in nano-USD, metered on the workspace's usage. */
@@ -61800,15 +61807,15 @@ function clustersIn({
61800
61807
  const out = [];
61801
61808
  let current3 = null;
61802
61809
  for (let index = segment.start; index <= segment.end; index += 1) {
61803
- const count7 = flagged[index] ?? 0;
61804
- if (count7 === 0) continue;
61810
+ const count8 = flagged[index] ?? 0;
61811
+ if (count8 === 0) continue;
61805
61812
  if (current3 && index - current3.end - 1 <= REDACTED_BLOCK_MAX_GAP) {
61806
61813
  current3.end = index;
61807
- current3.values += count7;
61814
+ current3.values += count8;
61808
61815
  continue;
61809
61816
  }
61810
61817
  if (current3) out.push(current3);
61811
- current3 = { start: index, end: index, values: count7 };
61818
+ current3 = { start: index, end: index, values: count8 };
61812
61819
  }
61813
61820
  if (current3) out.push(current3);
61814
61821
  return out;
@@ -61848,7 +61855,7 @@ function redactedBlocksAt({
61848
61855
  }
61849
61856
  const blocks = redactedBlocks({ lines: lines2, flagged });
61850
61857
  const inside = (line) => blocks.some((block2) => line >= block2.start && line <= block2.end);
61851
- const values = flagged.reduce((sum, count7, line) => inside(line) ? sum + count7 : sum, 0);
61858
+ const values = flagged.reduce((sum, count8, line) => inside(line) ? sum + count8 : sum, 0);
61852
61859
  return { values, insideAt: (offset) => inside(lineAt(offset)) };
61853
61860
  }
61854
61861
 
@@ -62294,6 +62301,38 @@ function fillCommandReferences({
62294
62301
  };
62295
62302
  }
62296
62303
 
62304
+ // ../../modules/vault/contract/src/vault-judge-measure.ts
62305
+ var count2 = external_exports.number().int().nonnegative();
62306
+ var rate = external_exports.number().min(0).max(1).nullable();
62307
+ var idText = external_exports.string().max(128);
62308
+ var answerCountsSchema = external_exports.object({ approved: count2, denied: count2, unanswered: count2 });
62309
+ var atThresholdSchema = external_exports.object({
62310
+ thresholdPercent: count2,
62311
+ /** The judge would allow and the person denied; the rate is over denied cards. */
62312
+ falseAllows: count2,
62313
+ falseAllowRate: rate,
62314
+ /** The judge would ask or refuse and the person approved; the rate is over approved cards. */
62315
+ needlessAsks: count2,
62316
+ needlessAskRate: rate
62317
+ });
62318
+ var keyMeasureSchema = external_exports.object({
62319
+ workspaceId: idText,
62320
+ connectionId: idText,
62321
+ thresholdPercent: count2,
62322
+ judged: count2,
62323
+ approved: count2,
62324
+ denied: count2,
62325
+ falseAllows: count2,
62326
+ needlessAsks: count2
62327
+ });
62328
+ var vaultJudgeMeasureSchemaDefinition = external_exports.object({
62329
+ modes: external_exports.object({ live: answerCountsSchema, shadow: answerCountsSchema }),
62330
+ thresholds: external_exports.array(atThresholdSchema),
62331
+ /** Every key with a judged card in the range, most judged first. */
62332
+ keys: external_exports.array(keyMeasureSchema)
62333
+ });
62334
+ var vaultJudgeMeasureSchema = vaultJudgeMeasureSchemaDefinition;
62335
+
62297
62336
  // ../../modules/chat/contract/src/chat.close.ts
62298
62337
  var conversationOpenDaysSchemaDefinition = external_exports.union([external_exports.literal(7), external_exports.literal(14), external_exports.literal(30), external_exports.literal(90)]).nullable();
62299
62338
  var conversationOpenDaysSchema = conversationOpenDaysSchemaDefinition;
@@ -63197,8 +63236,13 @@ var budgetCardSchemaDefinition = external_exports.object({
63197
63236
  window: external_exports.enum(["day", "week", "month"]),
63198
63237
  /** The plain first line: "Scout is paused on its daily budget." */
63199
63238
  line: external_exports.string().min(1).max(400),
63239
+ /** Provider cost in USD, as the gateway enforces it. */
63200
63240
  limitUsd: external_exports.number().nonnegative(),
63201
63241
  spentUsd: external_exports.number().nonnegative(),
63242
+ /** What Laze charges, in `currency`; absent on cards from before charged budgets. */
63243
+ chargedLimit: external_exports.number().nonnegative().optional(),
63244
+ chargedSpent: external_exports.number().nonnegative().optional(),
63245
+ currency: external_exports.enum(["usd", "eur"]).optional(),
63202
63246
  /** When the window resets and the agent answers again. */
63203
63247
  resumeAt: external_exports.iso.datetime(),
63204
63248
  /** The people who may raise the budget: the owner and the admins when it paused. */
@@ -63209,6 +63253,7 @@ var budgetCardSchemaDefinition = external_exports.object({
63209
63253
  /** What happened, once resumed: "Ada raised the daily budget to 10.00 USD." */
63210
63254
  outcome: external_exports.string().max(400)
63211
63255
  });
63256
+ var creditsCardSchemaDefinition = external_exports.object({ type: external_exports.literal("credits") });
63212
63257
  var feedCardSchemaDefinition = external_exports.object({
63213
63258
  type: external_exports.literal("feed"),
63214
63259
  itemId: idSchema4,
@@ -63267,6 +63312,7 @@ var messageCardSchemaDefinition = external_exports.discriminatedUnion("type", [
63267
63312
  heldCardSchemaDefinition,
63268
63313
  hopLimitCardSchemaDefinition,
63269
63314
  budgetCardSchemaDefinition,
63315
+ creditsCardSchemaDefinition,
63270
63316
  feedCardSchemaDefinition,
63271
63317
  failureCardSchemaDefinition,
63272
63318
  welcomeCardSchemaDefinition,
@@ -63852,6 +63898,8 @@ var postNoticeInputSchemaDefinition = external_exports.object({
63852
63898
  details: external_exports.string().trim().min(1).max(NOTICE_DETAILS_MAX).optional(),
63853
63899
  /** Try again under the notice, for the message the agent did not answer. */
63854
63900
  retry: failureRetrySchemaDefinition.optional(),
63901
+ /** An agent's notice that work waits for a top-up: drawn as the credits card. */
63902
+ credits: external_exports.literal(true).optional(),
63855
63903
  /** One notice per key: a second post with it answers the first. */
63856
63904
  clientKey: external_exports.string().regex(/^[A-Za-z0-9_-]{8,64}$/).optional()
63857
63905
  });
@@ -67683,10 +67731,20 @@ var raiseBudgetInputSchemaDefinition = external_exports.object({
67683
67731
  workspaceId: external_exports.string().min(1),
67684
67732
  /** The pause card the person pressed Raise budget on. */
67685
67733
  messageId: external_exports.string().min(1),
67686
- /** The paused window's new limit in USD. */
67687
- limitUsd: external_exports.number().positive().max(1e5)
67734
+ /** The paused window's new limit in provider USD, as clients before charged budgets send. */
67735
+ limitUsd: external_exports.number().positive().max(1e5).optional(),
67736
+ /** The paused window's new limit in what Laze charges, in the workspace currency. */
67737
+ chargedLimit: external_exports.number().positive().max(1e5).optional()
67688
67738
  });
67689
67739
  var raiseBudgetInputSchema = raiseBudgetInputSchemaDefinition;
67740
+ var raisedBudgetSchemaDefinition = external_exports.object({
67741
+ /** The paused window's new provider limit in USD. */
67742
+ limitUsd: external_exports.number(),
67743
+ /** The same limit in what Laze charges; absent from a server without charged budgets. */
67744
+ chargedLimit: external_exports.number().optional(),
67745
+ currency: external_exports.enum(["usd", "eur"]).optional()
67746
+ });
67747
+ var raisedBudgetSchema = raisedBudgetSchemaDefinition;
67690
67748
 
67691
67749
  // ../../modules/agent/contract/src/agent-catch-up.ts
67692
67750
  var CATCH_UP_QUESTION_MAX = 4e3;
@@ -69553,6 +69611,58 @@ var harnessSignInPollSchemaDefinition = external_exports.discriminatedUnion("sta
69553
69611
  external_exports.object({ status: external_exports.literal("approved"), flow: external_exports.string() })
69554
69612
  ]);
69555
69613
  var harnessSignInPollSchema = harnessSignInPollSchemaDefinition;
69614
+ var loginStateSchema = external_exports.enum(["ready", "out_of_usage", "invalid"]);
69615
+ var isoSchema = external_exports.iso.datetime();
69616
+ var loginStatesSchemaDefinition = external_exports.object({
69617
+ /** Logins signed in on a person's own Laze computer; Laze holds only the fact. */
69618
+ computerLogins: external_exports.array(
69619
+ external_exports.object({ userId: external_exports.string(), harness: harnessSchema2, savedAt: isoSchema })
69620
+ ),
69621
+ /** Logins in people's personal keychains in the vault. */
69622
+ personalLogins: external_exports.array(
69623
+ external_exports.object({
69624
+ id: external_exports.string(),
69625
+ ownerUserId: external_exports.string(),
69626
+ harness: harnessSchema2,
69627
+ state: loginStateSchema,
69628
+ /** The vault's own state: `needs_reconnect`, or still waiting for an admin's approval. */
69629
+ vaultStatus: external_exports.enum(["active", "needs_reconnect"]),
69630
+ waitingApproval: external_exports.boolean(),
69631
+ limitedUntil: isoSchema.nullable(),
69632
+ checkedAt: isoSchema.nullable(),
69633
+ createdAt: isoSchema,
69634
+ updatedAt: isoSchema
69635
+ })
69636
+ ),
69637
+ pools: external_exports.array(
69638
+ external_exports.object({
69639
+ id: external_exports.string(),
69640
+ createdAt: isoSchema,
69641
+ members: external_exports.number().int().nonnegative(),
69642
+ logins: external_exports.array(
69643
+ external_exports.object({
69644
+ id: external_exports.string(),
69645
+ harness: harnessSchema2,
69646
+ state: loginStateSchema,
69647
+ contributedByUserId: external_exports.string(),
69648
+ limitedUntil: isoSchema.nullable(),
69649
+ createdAt: isoSchema
69650
+ })
69651
+ )
69652
+ })
69653
+ ),
69654
+ /** Each Laze-hosted agent and the login its next turn runs on; connected agents are left out. */
69655
+ agents: external_exports.array(
69656
+ external_exports.object({
69657
+ id: external_exports.string(),
69658
+ harness: external_exports.string(),
69659
+ source: external_exports.enum(["keychain", "computer", "pool", "laze_models", "none"]),
69660
+ loginPoolId: external_exports.string().nullable(),
69661
+ activeLoginId: external_exports.string().nullable()
69662
+ })
69663
+ )
69664
+ });
69665
+ var loginStatesSchema = loginStatesSchemaDefinition;
69556
69666
 
69557
69667
  // ../../modules/agent/contract/src/agent-migration.ts
69558
69668
  var workspaceIdSchema10 = external_exports.string().min(1);
@@ -70545,7 +70655,7 @@ var agentsCopy = {
70545
70655
  paintOnly: true,
70546
70656
  storable: agentsForDisk
70547
70657
  };
70548
- var agentCoreTrpc = defineTrpcContract("agents").query("list", { mirrored: agentsCopy }).withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentListEntrySchema)).mutation("create").withInput(createAgentInputSchema).withOutput(agentSchema).mutation("update").withInput(updateAgentInputSchema).withOutput(agentSchema).mutation("remove").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("transfer").withInput(transferAgentInputSchema).withOutput(agentSchema).mutation("resetSession").withInput(resetAgentSessionInputSchema).withOutput(agentSchema).query("faces").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentFaceSchema)).query("presence").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentPresenceSchema)).mutation("uploadAvatar").withInput(uploadAgentAvatarInputSchema).withOutput(uploadedAgentAvatarSchema).query("access").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(agentAccessSchema).query("loginActivity").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(loginActivitySchema).mutation("raiseBudget").withInput(raiseBudgetInputSchema).withOutput(external_exports.object({ limitUsd: external_exports.number() })).query("permissionPrompts").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.array(agentPermissionPromptSchema)).mutation("share").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).mutation("unshare").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).query("harnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(harnessLoginsSchema).mutation("saveHarnessLogin").withInput(saveHarnessLoginInputSchema).withOutput(harnessLoginsSchema).mutation("removeHarnessLogin").withInput(removeHarnessLoginInputSchema).withOutput(harnessLoginsSchema).query("listHarnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(harnessLoginListSchema).mutation("addHarnessLogin").withInput(addHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("renameHarnessLogin").withInput(renameHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("deleteHarnessLogin").withInput(deleteHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("checkLoginUsage").withInput(checkLoginUsageInputSchema).withOutput(loginUsageCheckSchema).query("loginPools").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(loginPoolsSchema).mutation("createLoginPool").withInput(createLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("renameLoginPool").withInput(renameLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("deleteLoginPool").withInput(loginPoolRefInputSchema).withOutput(loginPoolsSchema).mutation("addPoolLogin").withInput(addPoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("removePoolLogin").withInput(removePoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("setPoolMember").withInput(setPoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("removePoolMember").withInput(removePoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("setAgentPool").withInput(setAgentPoolInputSchema).withOutput(agentSchema).mutation("openDirect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.object({ channelId: idSchema18 })).mutation("startConversation").withInput(startConversationInputSchema).withOutput(startedConversationSchema).query("conversations").withInput(listConversationsInputSchema).withOutput(external_exports.array(conversationSummarySchema2)).mutation("joinConversation").withInput(conversationInputSchema).withOutput(conversationSummarySchema2).mutation("renameConversation").withInput(renameConversationInputSchema).withOutput(conversationSummarySchema2).mutation("leaveConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("deleteConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("mintLink").withInput(mintLinkInputSchema).withOutput(mintedLinkSchema).query("linkRedemption").withInput(linkRedemptionInputSchema).withOutput(linkRedemptionSchema).query("oauthRequest").withInput(oauthRequestInputSchema).withOutput(oauthRequestViewSchema).mutation("oauthApprove").withInput(approveOAuthInputSchema).withOutput(oauthRedirectSchema).mutation("oauthDeny").withInput(oauthRequestInputSchema).withOutput(oauthRedirectSchema).mutation("disconnect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.object({ disconnected: external_exports.literal(true) })).mutation("setGithub").withInput(setAgentGithubInputSchema).withOutput(agentSchema).query("githubWatches").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.array(agentGithubWatchSchema)).mutation("watchGithub").withInput(watchGithubInputSchema).withOutput(agentGithubWatchSchema).mutation("unwatchGithub").withInput(unwatchGithubInputSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
70658
+ var agentCoreTrpc = defineTrpcContract("agents").query("list", { mirrored: agentsCopy }).withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentListEntrySchema)).mutation("create").withInput(createAgentInputSchema).withOutput(agentSchema).mutation("update").withInput(updateAgentInputSchema).withOutput(agentSchema).mutation("remove").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("transfer").withInput(transferAgentInputSchema).withOutput(agentSchema).mutation("resetSession").withInput(resetAgentSessionInputSchema).withOutput(agentSchema).query("faces").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentFaceSchema)).query("presence").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentPresenceSchema)).mutation("uploadAvatar").withInput(uploadAgentAvatarInputSchema).withOutput(uploadedAgentAvatarSchema).query("access").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(agentAccessSchema).query("loginActivity").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(loginActivitySchema).mutation("raiseBudget").withInput(raiseBudgetInputSchema).withOutput(raisedBudgetSchema).query("permissionPrompts").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.array(agentPermissionPromptSchema)).mutation("share").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).mutation("unshare").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).query("harnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(harnessLoginsSchema).mutation("saveHarnessLogin").withInput(saveHarnessLoginInputSchema).withOutput(harnessLoginsSchema).mutation("removeHarnessLogin").withInput(removeHarnessLoginInputSchema).withOutput(harnessLoginsSchema).query("listHarnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(harnessLoginListSchema).mutation("addHarnessLogin").withInput(addHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("renameHarnessLogin").withInput(renameHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("deleteHarnessLogin").withInput(deleteHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("checkLoginUsage").withInput(checkLoginUsageInputSchema).withOutput(loginUsageCheckSchema).query("loginPools").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(loginPoolsSchema).mutation("createLoginPool").withInput(createLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("renameLoginPool").withInput(renameLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("deleteLoginPool").withInput(loginPoolRefInputSchema).withOutput(loginPoolsSchema).mutation("addPoolLogin").withInput(addPoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("removePoolLogin").withInput(removePoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("setPoolMember").withInput(setPoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("removePoolMember").withInput(removePoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("setAgentPool").withInput(setAgentPoolInputSchema).withOutput(agentSchema).mutation("openDirect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.object({ channelId: idSchema18 })).mutation("startConversation").withInput(startConversationInputSchema).withOutput(startedConversationSchema).query("conversations").withInput(listConversationsInputSchema).withOutput(external_exports.array(conversationSummarySchema2)).mutation("joinConversation").withInput(conversationInputSchema).withOutput(conversationSummarySchema2).mutation("renameConversation").withInput(renameConversationInputSchema).withOutput(conversationSummarySchema2).mutation("leaveConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("deleteConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("mintLink").withInput(mintLinkInputSchema).withOutput(mintedLinkSchema).query("linkRedemption").withInput(linkRedemptionInputSchema).withOutput(linkRedemptionSchema).query("oauthRequest").withInput(oauthRequestInputSchema).withOutput(oauthRequestViewSchema).mutation("oauthApprove").withInput(approveOAuthInputSchema).withOutput(oauthRedirectSchema).mutation("oauthDeny").withInput(oauthRequestInputSchema).withOutput(oauthRedirectSchema).mutation("disconnect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.object({ disconnected: external_exports.literal(true) })).mutation("setGithub").withInput(setAgentGithubInputSchema).withOutput(agentSchema).query("githubWatches").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.array(agentGithubWatchSchema)).mutation("watchGithub").withInput(watchGithubInputSchema).withOutput(agentGithubWatchSchema).mutation("unwatchGithub").withInput(unwatchGithubInputSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
70549
70659
  var agentTurnTrpc = defineTrpcContract("agents").mutation("answerAttention").withInput(answerAttentionInputSchema).withOutput(external_exports.object({ answered: external_exports.literal(true) })).query("attentionDetail").withInput(attentionDetailInputSchema).withOutput(attentionDetailSchema).mutation("stopTurn").withInput(stopAgentTurnInputSchema).withOutput(external_exports.object({ stopped: external_exports.literal(true) })).query("mayStopTurn").withInput(stopAgentTurnInputSchema).withOutput(external_exports.object({ allowed: external_exports.boolean() })).mutation("retryTurn").withInput(retryAgentTurnInputSchema).withOutput(external_exports.object({ retried: external_exports.literal(true) })).query("retryState").withInput(retryAgentTurnInputSchema).withOutput(agentRetryStateSchema).query("liveSteps").withInput(liveStepsInputSchema).withOutput(liveStepsSchema).query("workingNow").withInput(agentWorkingInputSchema).withOutput(agentWorkingSchema).mutation("compactSession").withInput(compactAgentSessionInputSchema).withOutput(external_exports.object({ requested: external_exports.literal(true) })).mutation("catchUp").withInput(startCatchUpInputSchema).withOutput(catchUpRunSchema).mutation("catchUpAsk").withInput(askCatchUpInputSchema).withOutput(catchUpRunSchema).query("catchUpRun").withInput(catchUpRunInputSchema).withOutput(catchUpRunSchema).mutation("catchUpStop").withInput(catchUpRunInputSchema).withOutput(catchUpRunSchema).mutation("restartComputer").withInput(restartAgentComputerInputSchema).withOutput(external_exports.object({ restarted: external_exports.boolean() })).build();
70550
70660
  var agentChannelSettingsTrpc = defineTrpcContract("agents").query("monitors").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.array(agentMonitorSchema)).query("channelLevel").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18, channelId: idSchema18 })).withOutput(channelLevelSchema).mutation("setChannelLevel").withInput(setChannelLevelInputSchema).withOutput(channelLevelSchema).mutation("unmuteChannel").withInput(unmuteAgentChannelInputSchema).withOutput(channelLevelSchema).mutation("cancelHeld").withInput(cancelHeldInputSchema).withOutput(cancelHeldResultSchema).mutation("useLazeModelsUntilReset").withInput(useLazeModelsUntilResetInputSchema).withOutput(lazeModelsUntilResetSchema).build();
70551
70661
  var agentJoinTrpc = defineTrpcContract("agents").query("joinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("approveJoinRequest").withInput(approveJoinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("denyJoinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).build();
@@ -72545,10 +72655,10 @@ function whereOf(message2) {
72545
72655
  }
72546
72656
  function catchUpLinesOf(message2) {
72547
72657
  if (!message2.catchUp) return [];
72548
- const { count: count7, older } = message2.catchUp;
72658
+ const { count: count8, older } = message2.catchUp;
72549
72659
  const where = whereOf(message2);
72550
72660
  const lines2 = [
72551
- `${count7} ${count7 === 1 ? "message" : "messages"} in ${where} while you were away.`
72661
+ `${count8} ${count8 === 1 ? "message" : "messages"} in ${where} while you were away.`
72552
72662
  ];
72553
72663
  if (older === 0) return lines2;
72554
72664
  const channel = message2.channelKind === "public" || message2.channelKind === "private";
@@ -72571,9 +72681,9 @@ function hookContextOf({
72571
72681
  messages,
72572
72682
  self: self2
72573
72683
  }) {
72574
- const count7 = messages.length === 1 ? "A message" : `${messages.length} messages`;
72684
+ const count8 = messages.length === 1 ? "A message" : `${messages.length} messages`;
72575
72685
  return [
72576
- `${count7} reached you in Laze${selfClauseOf({ self: self2 })}:`,
72686
+ `${count8} reached you in Laze${selfClauseOf({ self: self2 })}:`,
72577
72687
  "",
72578
72688
  ...messages.map((message2) => formatInboxMessage({ message: message2 })),
72579
72689
  "",
@@ -72588,7 +72698,7 @@ function selfClauseOf({ self: self2 }) {
72588
72698
  function record2(value) {
72589
72699
  return typeof value === "object" && value !== null ? value : {};
72590
72700
  }
72591
- function count2(value) {
72701
+ function count3(value) {
72592
72702
  return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
72593
72703
  }
72594
72704
  function parse3(line) {
@@ -72609,17 +72719,17 @@ function compactionOf({
72609
72719
  return {
72610
72720
  key: typeof entry2.uuid === "string" ? entry2.uuid : String(index),
72611
72721
  trigger: meta3.trigger === "manual" ? "manual" : "auto",
72612
- tokensBefore: count2(meta3.preTokens),
72613
- tokensAfter: count2(meta3.postTokens),
72722
+ tokensBefore: count3(meta3.preTokens),
72723
+ tokensAfter: count3(meta3.postTokens),
72614
72724
  at: typeof entry2.timestamp === "string" ? entry2.timestamp : "1970-01-01T00:00:00.000Z"
72615
72725
  };
72616
72726
  }
72617
72727
  function usageOf({ entry: entry2 }) {
72618
72728
  const message2 = record2(entry2.message);
72619
72729
  const usage = record2(message2.usage);
72620
- const input2 = count2(usage.input_tokens);
72730
+ const input2 = count3(usage.input_tokens);
72621
72731
  if (input2 === void 0) return void 0;
72622
- const cached2 = (count2(usage.cache_read_input_tokens) ?? 0) + (count2(usage.cache_creation_input_tokens) ?? 0);
72732
+ const cached2 = (count3(usage.cache_read_input_tokens) ?? 0) + (count3(usage.cache_creation_input_tokens) ?? 0);
72623
72733
  return {
72624
72734
  tokens: input2 + cached2,
72625
72735
  ...typeof message2.model === "string" ? { model: message2.model } : {}
@@ -73610,7 +73720,7 @@ function slackHitLines({
73610
73720
  ...link2 ? [` ${link2}`] : []
73611
73721
  ];
73612
73722
  }
73613
- var count3 = (n) => `${n} message${n === 1 ? "" : "s"}`;
73723
+ var count4 = (n) => `${n} message${n === 1 ? "" : "s"}`;
73614
73724
  function slackSectionLines({
73615
73725
  slack: slack2,
73616
73726
  laze,
@@ -73623,7 +73733,7 @@ function slackSectionLines({
73623
73733
  });
73624
73734
  if (slack2.teams.some((team) => team.state === "searched")) {
73625
73735
  const found = slack2.hits.length;
73626
- lines2.push(found === 0 ? "From Slack: nothing more." : `From Slack: ${count3(found)}`);
73736
+ lines2.push(found === 0 ? "From Slack: nothing more." : `From Slack: ${count4(found)}`);
73627
73737
  }
73628
73738
  for (const hit of slack2.hits) lines2.push(...slackHitLines({ hit, laze, url: url2, workspaceId }), "");
73629
73739
  return lines2;
@@ -73634,7 +73744,7 @@ function formatSearch({
73634
73744
  workspaceId
73635
73745
  }) {
73636
73746
  const { laze, slack: slack2, query } = output2;
73637
- const lines2 = laze.hits.length === 0 ? [`No Laze messages match "${query}".`] : [`Laze: ${count3(laze.hits.length)} for "${query}"`];
73747
+ const lines2 = laze.hits.length === 0 ? [`No Laze messages match "${query}".`] : [`Laze: ${count4(laze.hits.length)} for "${query}"`];
73638
73748
  for (const hit of laze.hits) {
73639
73749
  lines2.push(...lazeHitLines({ hit, laze, url: url2, workspaceId }), "");
73640
73750
  }
@@ -80744,6 +80854,8 @@ var signInHandoffSchemaDefinition = external_exports.object({
80744
80854
  expiresAt: external_exports.iso.datetime()
80745
80855
  });
80746
80856
  var signInHandoffSchema = signInHandoffSchemaDefinition;
80857
+ var appOpenedSchemaDefinition = external_exports.object({ appId: external_exports.string() });
80858
+ var appOpenedSchema = appOpenedSchemaDefinition;
80747
80859
  var appViewerSchemaDefinition = external_exports.object({
80748
80860
  userId: external_exports.string().min(1),
80749
80861
  name: external_exports.string(),
@@ -81477,9 +81589,9 @@ function formatAppMoney({
81477
81589
  maximumFractionDigits: tiny ? 4 : 2
81478
81590
  }).format(amount);
81479
81591
  }
81480
- var count4 = new Intl.NumberFormat("en-US");
81592
+ var count5 = new Intl.NumberFormat("en-US");
81481
81593
  function plural2({ value, one, many }) {
81482
- return `${count4.format(value)} ${value === 1 ? one : many}`;
81594
+ return `${count5.format(value)} ${value === 1 ? one : many}`;
81483
81595
  }
81484
81596
  function appCostQuantityText(line) {
81485
81597
  const { quantity } = line;
@@ -82182,7 +82294,7 @@ var appsCopy = {
82182
82294
  paintOnly: true,
82183
82295
  storable: appsForDisk
82184
82296
  };
82185
- 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).query("openChoices").withInput(appRefSchema).withOutput(appOpenChoicesSchema).mutation("askToOpen").withInput(appRefSchema).withOutput(appAskedSchema).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();
82297
+ 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).mutation("recordOpen").withInput(appRefSchema).withOutput(appOpenedSchema).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).query("openChoices").withInput(appRefSchema).withOutput(appOpenChoicesSchema).mutation("askToOpen").withInput(appRefSchema).withOutput(appAskedSchema).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();
82186
82298
  var appExternalTrpc = defineTrpcContract("app").mutation("externalSignInHandoff").withInput(externalSignInHandoffInputSchema).withOutput(signInHandoffSchema).mutation("setExternalRole").withInput(setExternalRoleInputSchema).withOutput(appAccessSchema).build();
82187
82299
  var appConnectionsTrpc = defineTrpcContract("app").query("connections").withInput(appRefSchema).withOutput(appConnectionsSchema).mutation("allowConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).mutation("revokeConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).build();
82188
82300
  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();
@@ -82325,8 +82437,8 @@ var appCliCommands = [
82325
82437
  {
82326
82438
  command: "laze app asset add",
82327
82439
  operation: "startAssetUpload",
82328
- arguments: ["<file>", "--type <content type>"],
82329
- summary: "Upload a video, audio, image, PDF, font or captions file (up to 2 GB) as an asset of the app, outside the 10 MB version limit, and print its address /_laze/assets/<sha256>.<ext> to use in the app's files, for example <video src> with full quality and seeking. Name every asset in a file of the app: one no version names is deleted after 7 days"
82440
+ arguments: ["<file>", "--type <content type>", "--any-level"],
82441
+ summary: "Upload a video, audio, image, PDF, font or captions file (up to 2 GB) as an asset of the app, outside the 10 MB version limit, and print its address /_laze/assets/<sha256>.<ext> to use in the app's files, for example <video src> with full quality and seeking. Name every asset in a file of the app: one no version names is deleted after 7 days. An H.264 video above level 5.2 is refused, because iPhones and Macs do not play it"
82330
82442
  },
82331
82443
  {
82332
82444
  command: "laze app asset list",
@@ -82828,6 +82940,31 @@ function typeOf({ file: file4, args }) {
82828
82940
  }
82829
82941
  return type;
82830
82942
  }
82943
+ var MAX_H264_LEVEL = 52;
82944
+ async function h264LevelOf(path) {
82945
+ const file4 = await open5(path, "r");
82946
+ try {
82947
+ const { size } = await file4.stat();
82948
+ const head = Buffer.alloc(16);
82949
+ for (let at2 = 0; at2 + 8 <= size; ) {
82950
+ await file4.read(head, 0, 16, at2);
82951
+ let length = head.readUInt32BE(0);
82952
+ if (length === 1) length = Number(head.readBigUInt64BE(8));
82953
+ if (length === 0) length = size - at2;
82954
+ if (length < 8) return null;
82955
+ if (head.toString("latin1", 4, 8) === "moov") {
82956
+ const moov = Buffer.alloc(Math.min(length, 64 * 1024 * 1024));
82957
+ await file4.read(moov, 0, moov.byteLength, at2);
82958
+ const box = moov.indexOf("avcC", 0, "latin1");
82959
+ return box === -1 || box + 8 > moov.byteLength ? null : moov[box + 7] ?? null;
82960
+ }
82961
+ at2 += length;
82962
+ }
82963
+ return null;
82964
+ } finally {
82965
+ await file4.close();
82966
+ }
82967
+ }
82831
82968
  async function sha256Of2(path) {
82832
82969
  const hash2 = createHash5("sha256");
82833
82970
  for await (const chunk of createReadStream2(path)) hash2.update(chunk);
@@ -82898,6 +83035,14 @@ async function add({ context, args, open: openApp }) {
82898
83035
  );
82899
83036
  }
82900
83037
  const contentType = typeOf({ file: file4, args });
83038
+ if (contentType === "video/mp4" || contentType === "video/quicktime") {
83039
+ const level2 = await h264LevelOf(path);
83040
+ if (level2 !== null && level2 > MAX_H264_LEVEL && !args.flags["any-level"]) {
83041
+ throw new CliUsageError(
83042
+ `${basename7(file4)} is H.264 level ${(level2 / 10).toFixed(1)}, which iPhones and Macs do not play (they stop at 5.2). Re-encode it with fewer reference frames, for example: ffmpeg -i ${basename7(file4)} -c:v libx264 -profile:v high -level:v 5.1 -refs 4 -crf 20 -c:a copy -movflags +faststart out.mp4. Pass --any-level to upload it anyway`
83043
+ );
83044
+ }
83045
+ }
82901
83046
  const { client, appId, name: name3 } = await openApp();
82902
83047
  const sha256 = await sha256Of2(path);
82903
83048
  const started = await client.post("/api/apps/assets/start", {
@@ -84753,7 +84898,7 @@ var appWrite = async ({ context, args }) => {
84753
84898
  });
84754
84899
  };
84755
84900
  function seedLine(seeded) {
84756
- const created = Object.entries(seeded.created).map(([name3, count7]) => `${count7} in ${name3}`);
84901
+ const created = Object.entries(seeded.created).map(([name3, count8]) => `${count8} in ${name3}`);
84757
84902
  const parts = [
84758
84903
  created.length ? `Loaded starter records: ${created.join(", ")}.` : "",
84759
84904
  seeded.skipped.length ? `Left ${seeded.skipped.join(", ")} as it was: it already holds records.` : ""
@@ -85078,8 +85223,8 @@ function cardLine({ choice }) {
85078
85223
  var appCard = async ({ context, args }) => {
85079
85224
  const client = await appClient({ context, args });
85080
85225
  const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
85081
- const count7 = Number(flagText({ args, name: "rows", fallback: "5" }));
85082
- if (!Number.isInteger(count7) || count7 < 1 || count7 > 10) {
85226
+ const count8 = Number(flagText({ args, name: "rows", fallback: "5" }));
85227
+ if (!Number.isInteger(count8) || count8 < 1 || count8 > 10) {
85083
85228
  throw new CliUsageError("--rows is a whole number from 1 to 10");
85084
85229
  }
85085
85230
  const text3 = (name3) => flagText({ args, name: name3 }) || null;
@@ -85092,7 +85237,7 @@ var appCard = async ({ context, args }) => {
85092
85237
  collection: text3("collection"),
85093
85238
  filter: flagText({ args, name: "where" }) || flagText({ args, name: "filter" }),
85094
85239
  sort: flagText({ args, name: "sort" }),
85095
- rows: count7,
85240
+ rows: count8,
85096
85241
  caption: text3("caption")
85097
85242
  }
85098
85243
  });
@@ -85480,21 +85625,21 @@ var appUnpublish = async ({ context, args }) => {
85480
85625
  });
85481
85626
  };
85482
85627
  function costText({ name: name3, cost }) {
85483
- const money3 = (amount) => formatAppMoney({ amount, currency: cost.currency });
85628
+ const money4 = (amount) => formatAppMoney({ amount, currency: cost.currency });
85484
85629
  const month = Temporal3.PlainDate.from(`${cost.month}-01`).toLocaleString("en-GB", {
85485
85630
  month: "long",
85486
85631
  year: "numeric"
85487
85632
  });
85488
85633
  const rows = cost.lines.map((line) => {
85489
85634
  const used = appCostQuantityText(line);
85490
- return ` ${APP_COST_PART_LABELS[line.part].padEnd(16)} ${money3(line.amount).padStart(12)}${used ? ` ${used}` : ""}
85635
+ return ` ${APP_COST_PART_LABELS[line.part].padEnd(16)} ${money4(line.amount).padStart(12)}${used ? ` ${used}` : ""}
85491
85636
  `;
85492
85637
  });
85493
85638
  const { budget: budget2 } = cost;
85494
- const budgetLine = budget2.monthly === null ? "No budget. laze app budget <amount> sets one.\n" : `Budget ${money3(budget2.monthly)} a month, ${Math.round(cost.total / budget2.monthly * 100).toString()}% used.
85639
+ const budgetLine = budget2.monthly === null ? "No budget. laze app budget <amount> sets one.\n" : `Budget ${money4(budget2.monthly)} a month, ${Math.round(cost.total / budget2.monthly * 100).toString()}% used.
85495
85640
  `;
85496
85641
  const paused = budget2.paused ? "Paused: server functions and agent work on this app stop until the budget is raised or the month ends. Pages and records keep working.\n" : "";
85497
- return `${name3} cost ${money3(cost.total)} so far in ${month}, at Laze list prices:
85642
+ return `${name3} cost ${money4(cost.total)} so far in ${month}, at Laze list prices:
85498
85643
  ${rows.join("")}${budgetLine}${paused}`;
85499
85644
  }
85500
85645
  async function appOfWord({
@@ -85877,6 +86022,16 @@ function prepaidNoteOf(account, of) {
85877
86022
  ].filter((note) => note !== null);
85878
86023
  return notes.length > 0 ? ` (${notes.join(", ")})` : "";
85879
86024
  }
86025
+ function rechargeLineOf({
86026
+ recharge,
86027
+ of
86028
+ }) {
86029
+ if (!recharge.enabled) return "off";
86030
+ if (recharge.amount === null || recharge.monthlyLimit === null) {
86031
+ return "on, starts with the first payment (a top-up or a paid Team invoice)";
86032
+ }
86033
+ return `on, ${of(recharge.amount)} when credits run low, up to ${of(recharge.monthlyLimit)} a month (${of(recharge.rechargedThisMonth)} so far)`;
86034
+ }
85880
86035
  function printAccount({ context, args }, account) {
85881
86036
  if (args.flags.json) return printJson(context, account);
85882
86037
  const of = (amount) => money(amount, account.currency);
@@ -85895,8 +86050,7 @@ function printAccount({ context, args }, account) {
85895
86050
  `
85896
86051
  );
85897
86052
  const recharge = account.autoRecharge;
85898
- const rechargeLine = recharge.enabled ? `on, ${recharge.amount === null ? "after the first top-up" : of(recharge.amount)} when under ${of(recharge.rechargeBelow)}, limit ${recharge.monthlyLimit === null ? "set by the first top-up" : of(recharge.monthlyLimit)} a month (${of(recharge.rechargedThisMonth)} so far)` : "off";
85899
- context.out(`Auto-recharge: ${rechargeLine}
86053
+ context.out(`Auto-recharge: ${rechargeLineOf({ recharge, of })}
85900
86054
  `);
85901
86055
  if (recharge.lastFailure) context.out(`Last recharge failed: ${recharge.lastFailure.message}
85902
86056
  `);
@@ -86718,9 +86872,9 @@ function presenceColumns(member) {
86718
86872
  return [member.presence, `${status11.emoji} ${status11.text}`.trim() + until, ...dndColumn(member)];
86719
86873
  }
86720
86874
  function formatMembers({ detail }) {
86721
- const count7 = `${detail.members.length} ${detail.members.length === 1 ? "member" : "members"}`;
86875
+ const count8 = `${detail.members.length} ${detail.members.length === 1 ? "member" : "members"}`;
86722
86876
  const ends = detail.endsAt ? `, ends ${utcTimeOf(detail.endsAt)}` : "";
86723
- const head = `${channelLabelOf(detail)} (${detail.id}), ${count7}${ends}`;
86877
+ const head = `${channelLabelOf(detail)} (${detail.id}), ${count8}${ends}`;
86724
86878
  const rows = detail.members.map(
86725
86879
  (member) => [ROLE[member.role], member.name, member.kind, member.id, ...presenceColumns(member)].join(" ")
86726
86880
  );
@@ -86759,13 +86913,13 @@ function formatBrowsable({
86759
86913
  }) {
86760
86914
  if (channels3.length === 0) return "No channels to browse.\n";
86761
86915
  const rows = channels3.map((channel) => {
86762
- const count7 = `${channel.memberCount} ${channel.memberCount === 1 ? "member" : "members"}`;
86916
+ const count8 = `${channel.memberCount} ${channel.memberCount === 1 ? "member" : "members"}`;
86763
86917
  const marks = [
86764
86918
  channel.joined ? "joined" : "not joined",
86765
86919
  ...channel.private ? ["private"] : [],
86766
86920
  ...channel.archived ? ["archived"] : []
86767
86921
  ].join(", ");
86768
- return `#${channel.name} ${channel.id} ${count7} ${marks} ${channel.topic}`;
86922
+ return `#${channel.name} ${channel.id} ${count8} ${marks} ${channel.topic}`;
86769
86923
  });
86770
86924
  return `${rows.join("\n")}
86771
86925
  `;
@@ -86814,10 +86968,10 @@ var DURATION = /^(\d+)\s*(m|min|mins|minutes?|h|hours?|d|days?)$/i;
86814
86968
  function minutesOf({ text: text3 }) {
86815
86969
  const match = DURATION.exec(text3.trim());
86816
86970
  if (!match?.[1] || !match[2]) return null;
86817
- const count7 = Number(match[1]);
86971
+ const count8 = Number(match[1]);
86818
86972
  const unit = match[2].toLowerCase()[0];
86819
86973
  const perUnit = { d: 1440, h: 60, m: 1 };
86820
- const minutes = count7 * (perUnit[unit ?? "m"] ?? 1);
86974
+ const minutes = count8 * (perUnit[unit ?? "m"] ?? 1);
86821
86975
  return minutes > 0 ? minutes : null;
86822
86976
  }
86823
86977
  function muteTextOf({ mute }) {
@@ -88323,6 +88477,7 @@ var computerWaitlistChangedDefinition = external_exports.object({
88323
88477
 
88324
88478
  // ../../modules/billing/contract/src/billing.config.ts
88325
88479
  var priceId = external_exports.string().min(1).optional();
88480
+ var MAC_QA_WORKSPACE_ID = "workspace_0004i5nUrgRHO0Mz9PXEeGpqnPFDM";
88326
88481
  var billingConfig = Config.define((c) => ({
88327
88482
  publicBaseUrl,
88328
88483
  /** The first alias (`laze.so` on prod) is the short origin referral links are shared on. */
@@ -88348,8 +88503,7 @@ var billingConfig = Config.define((c) => ({
88348
88503
  automaticTax: c.env("STRIPE_AUTOMATIC_TAX", environmentBooleanSchema.default(true)),
88349
88504
  /** The coupon for a referral: `REFERRAL_TERMS` off, repeating for its months. */
88350
88505
  referralCouponId: c.env("STRIPE_COUPON_REFERRAL", external_exports.string().min(1).optional()),
88351
- /** List price over cost per usage category; never shown on the site. */
88352
- modelMarkup: c.env("LAZE_MARKUP_MODEL", external_exports.coerce.number().min(1).max(10).default(1.055)),
88506
+ /** List price over cost for machines and connectors; model calls follow `MODEL_FEE_TERMS`. */
88353
88507
  machineMarkup: c.env("LAZE_MARKUP_MACHINE", external_exports.coerce.number().min(1).max(10).default(2)),
88354
88508
  connectorMarkup: c.env("LAZE_MARKUP_CONNECTOR", external_exports.coerce.number().min(1).max(10).default(2)),
88355
88509
  /** The ECB daily reference rates EUR usage is priced at. */
@@ -88357,6 +88511,16 @@ var billingConfig = Config.define((c) => ({
88357
88511
  "LAZE_ECB_RATES_URL",
88358
88512
  external_exports.url().default("https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml")
88359
88513
  ),
88514
+ /**
88515
+ * QA workspaces billing-qa-credit-state may put in a credit state, comma separated ids; unset,
88516
+ * the prod Mac QA workspace. Spec: modules/billing/specs/qa-credit-state.feature.
88517
+ */
88518
+ qaWorkspaceIds: c.env(
88519
+ "LAZE_BILLING_QA_WORKSPACES",
88520
+ external_exports.string().default(MAC_QA_WORKSPACE_ID).transform(
88521
+ (value) => value.split(",").map((id4) => id4.trim()).filter(Boolean)
88522
+ )
88523
+ ),
88360
88524
  /** USD per euro until the first ECB rate is stored. */
88361
88525
  defaultUsdPerEur: c.env(
88362
88526
  "LAZE_DEFAULT_USD_PER_EUR",
@@ -88443,8 +88607,12 @@ var CREDIT_TERMS = {
88443
88607
  /** Auto-recharge tops up when the prepaid balance drops under this. */
88444
88608
  rechargeBelow: 5,
88445
88609
  autoRechargeByDefault: true,
88610
+ /** What each auto-recharge adds once a paid Team invoice turns it on without a top-up. */
88611
+ defaultRecharge: 10,
88446
88612
  /** A top-up raises the monthly auto-recharge limit to this many times its amount. */
88447
- limitPerTopUp: 2
88613
+ limitPerTopUp: 2,
88614
+ /** The monthly limit an admin can raise to in one tap once the limit holds recharges back. */
88615
+ suggestedMonthlyLimit: 100
88448
88616
  };
88449
88617
 
88450
88618
  // ../../modules/billing/contract/src/billing.events.ts
@@ -88491,6 +88659,10 @@ var usagePausedDefinition = external_exports.object({
88491
88659
  paused: external_exports.boolean(),
88492
88660
  /** `no_plan`, `canceled` and `budget` are from before prepaid credits. */
88493
88661
  reason: external_exports.enum(["credits", "no_plan", "canceled", "budget"]).nullable(),
88662
+ /** On a pause for credits: true when only the monthly limit kept auto-recharge from charging. */
88663
+ autoRechargeHeldByLimit: external_exports.boolean().optional(),
88664
+ /** Absent on facts from before it was recorded: the workspace's billing currency then. */
88665
+ currency: currencySchema.optional(),
88494
88666
  at: external_exports.iso.datetime()
88495
88667
  });
88496
88668
  var referralRewardedDefinition = external_exports.object({
@@ -88514,6 +88686,30 @@ var checkoutChangedDefinition = external_exports.object({
88514
88686
  byUserId: external_exports.string().nullable(),
88515
88687
  at: external_exports.iso.datetime()
88516
88688
  });
88689
+ var creditsLowDefinition = external_exports.object({
88690
+ workspaceId: external_exports.string().min(1),
88691
+ /** The usage entry that crossed the low mark; one fact per entry. */
88692
+ entryId: external_exports.string().min(1),
88693
+ plan: storedPlanSchema,
88694
+ /**
88695
+ * Whether auto-recharge tops the credits up before work pauses. Absent on facts from before
88696
+ * it was recorded: read it with `autoRechargeCoversLow`.
88697
+ */
88698
+ autoRechargeCovers: external_exports.boolean().optional(),
88699
+ /** True when the monthly limit is reached or the next recharge is the last under it. */
88700
+ autoRechargeHeldByLimit: external_exports.boolean().optional(),
88701
+ /** Absent on facts from before it was recorded: the workspace's billing currency then. */
88702
+ currency: currencySchema.optional(),
88703
+ at: external_exports.iso.datetime()
88704
+ });
88705
+ var autoRechargeStartedDefinition = external_exports.object({
88706
+ workspaceId: external_exports.string().min(1),
88707
+ /** What each recharge adds and the monthly limit, in the workspace currency. */
88708
+ amount: external_exports.number().positive(),
88709
+ monthlyLimit: external_exports.number().positive(),
88710
+ currency: currencySchema,
88711
+ at: external_exports.iso.datetime()
88712
+ });
88517
88713
  var creditCheckStateDefinition = external_exports.object({ nextWakeAt: external_exports.number().nullable() });
88518
88714
  var creditCheckIntentDefinition = external_exports.object({ workspaceId: external_exports.string().min(1) });
88519
88715
 
@@ -88604,17 +88800,24 @@ var billingAccountViewDefinition = external_exports.object({
88604
88800
  /** The one-off welcome credit given before 2026-10-21; 0 when it got none. */
88605
88801
  welcome: external_exports.number().default(0),
88606
88802
  paused: external_exports.boolean(),
88607
- pauseReason: pauseReasonSchema.nullable()
88803
+ pauseReason: pauseReasonSchema.nullable(),
88804
+ /** At or under the low mark and not paused yet. */
88805
+ low: external_exports.boolean().default(false)
88608
88806
  }),
88609
88807
  autoRecharge: external_exports.object({
88610
88808
  enabled: external_exports.boolean(),
88611
- /** What each recharge adds; null until the first top-up sets it. */
88809
+ /** What each recharge adds; null until the first top-up or paid Team invoice sets it. */
88612
88810
  amount: external_exports.number().nullable(),
88613
88811
  rechargeBelow: external_exports.number(),
88812
+ /** The monthly limit, double the amount unless set; null while the amount is. */
88614
88813
  monthlyLimit: external_exports.number().nullable(),
88615
88814
  rechargedThisMonth: external_exports.number(),
88616
88815
  cardSaved: external_exports.boolean(),
88617
- lastFailure: external_exports.object({ at: external_exports.iso.datetime(), message: external_exports.string() }).nullable()
88816
+ lastFailure: external_exports.object({ at: external_exports.iso.datetime(), message: external_exports.string() }).nullable(),
88817
+ /** The monthly limit holds the next recharge back; only when it could otherwise charge. */
88818
+ limitReached: external_exports.boolean().default(false),
88819
+ /** The next recharge is the last one under the monthly limit. */
88820
+ limitNear: external_exports.boolean().default(false)
88618
88821
  }),
88619
88822
  usage: external_exports.object({
88620
88823
  used: external_exports.number(),
@@ -88837,12 +89040,39 @@ var grantCreditsInputDefinition = external_exports.object({
88837
89040
  amount: external_exports.number().positive().max(1e4),
88838
89041
  reason: external_exports.string().trim().min(3).max(500)
88839
89042
  });
89043
+ var creditPausedAccountSchemaDefinition = external_exports.object({
89044
+ workspaceId: external_exports.string(),
89045
+ plan: planSchema,
89046
+ status: subscriptionStatusSchema,
89047
+ people: external_exports.number().int().nonnegative(),
89048
+ cardSaved: external_exports.boolean(),
89049
+ autoRechargeEnabled: external_exports.boolean(),
89050
+ rechargeFailedAt: external_exports.iso.datetime().nullable(),
89051
+ /** When the account last changed, which for most is the moment the pause began. */
89052
+ updatedAt: external_exports.iso.datetime()
89053
+ });
89054
+ var creditPausedAccountSchema = creditPausedAccountSchemaDefinition;
89055
+ var modelChargeBasisDefinition = external_exports.object({
89056
+ currency: currencySchema,
89057
+ /** The model fee on top of provider cost, by the people Team bills (`modelFeePercentOf`). */
89058
+ feePercent: external_exports.number().nonnegative(),
89059
+ /** USD per unit of the currency: 1 for USD, the stored ECB rate (or the default) for EUR. */
89060
+ usdPerUnit: external_exports.number().positive(),
89061
+ /** The ECB day of the rate; null for USD and for the configured default. */
89062
+ rateDay: external_exports.string().nullable()
89063
+ });
88840
89064
  var BillingApi = moduleApi()("billing");
88841
89065
  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();
88842
89066
  var stripeWebhookHeadersDefinition = external_exports.object({
88843
89067
  "stripe-signature": external_exports.string().max(1e3).default("")
88844
89068
  });
88845
89069
 
89070
+ // ../../modules/billing/contract/src/billing.ui.ts
89071
+ var billingUi = uiTokens("billing");
89072
+ var CreditsBannerSlot = billingUi.component("creditsBanner");
89073
+ var CreditsCardSlot = billingUi.component("creditsCard");
89074
+ var CreditsComposerLineSlot = billingUi.component("creditsComposerLine");
89075
+
88846
89076
  // ../../modules/compute/contract/src/free-guards.ts
88847
89077
  var computeGuardEventKindSchema = external_exports.enum([
88848
89078
  "hours_warning",
@@ -90325,7 +90555,7 @@ var whatsappObservedPayloadDefinition = external_exports.object({
90325
90555
  });
90326
90556
 
90327
90557
  // ../../modules/compute/contract/src/whatsapp-ops.ts
90328
- var count5 = external_exports.number().int().nonnegative();
90558
+ var count6 = external_exports.number().int().nonnegative();
90329
90559
  var at = external_exports.iso.datetime();
90330
90560
  var whatsappMirrorHealthDefinition = external_exports.object({
90331
90561
  mirrors: external_exports.array(
@@ -90341,18 +90571,18 @@ var whatsappMirrorHealthDefinition = external_exports.object({
90341
90571
  nextVisitAt: at.nullable(),
90342
90572
  touchedAt: at.nullable(),
90343
90573
  createdAt: at,
90344
- skipped: external_exports.object({ count: count5, from: external_exports.number().int().nullable(), at: at.nullable() }),
90574
+ skipped: external_exports.object({ count: count6, from: external_exports.number().int().nullable(), at: at.nullable() }),
90345
90575
  /** The last pull that met files; null when none did. */
90346
90576
  files: external_exports.object({
90347
90577
  at,
90348
- attached: count5,
90349
- unavailable: count5,
90350
- retrying: count5,
90351
- dropped: count5,
90578
+ attached: count6,
90579
+ unavailable: count6,
90580
+ retrying: count6,
90581
+ dropped: count6,
90352
90582
  failureCode: external_exports.string().nullable()
90353
90583
  }).nullable(),
90354
90584
  /** Intake holds (ADR-216 §11) by kind and code, with when the oldest was made. */
90355
- holds: external_exports.array(external_exports.object({ kind: external_exports.string(), code: external_exports.string(), count: count5, oldestAt: at }))
90585
+ holds: external_exports.array(external_exports.object({ kind: external_exports.string(), code: external_exports.string(), count: count6, oldestAt: at }))
90356
90586
  })
90357
90587
  )
90358
90588
  });
@@ -90394,11 +90624,11 @@ var whatsappWakeTimelineDefinition = external_exports.object({
90394
90624
  external_exports.object({
90395
90625
  step: external_exports.enum(WHATSAPP_WAKE_STEPS),
90396
90626
  at,
90397
- sincePreviousMs: count5,
90398
- sinceRequestMs: count5
90627
+ sincePreviousMs: count6,
90628
+ sinceRequestMs: count6
90399
90629
  })
90400
90630
  ),
90401
- totalMs: count5.nullable()
90631
+ totalMs: count6.nullable()
90402
90632
  })
90403
90633
  )
90404
90634
  })
@@ -90535,9 +90765,9 @@ function creatorsOf(args) {
90535
90765
  return { everyone: args.flags.everyone === true, userIds };
90536
90766
  }
90537
90767
  function lineOf3(computer2) {
90538
- const money3 = `${computer2.monthlyCharge} ${computer2.currency.toUpperCase()} a month`;
90768
+ const money4 = `${computer2.monthlyCharge} ${computer2.currency.toUpperCase()} a month`;
90539
90769
  const agents = `${computer2.agents.length} agent(s)`;
90540
- return ` ${computer2.computerId} ${computer2.name} ${computer2.kind} ${computer2.size} ${money3} ${agents} ${computer2.state}`;
90770
+ return ` ${computer2.computerId} ${computer2.name} ${computer2.kind} ${computer2.size} ${money4} ${agents} ${computer2.state}`;
90541
90771
  }
90542
90772
  async function mine({ context, args }) {
90543
90773
  const client = await computeClient({ context, args });
@@ -90769,9 +90999,9 @@ async function list3({ context, args }) {
90769
90999
  const client = await computeClient({ context, args });
90770
91000
  const answer6 = await client.get(COMPUTER_REST_PATHS.all);
90771
91001
  if (args.flags.json) return printJson3(context, answer6);
90772
- const money3 = (amount) => `${amount} ${answer6.currency.toUpperCase()}`;
91002
+ const money4 = (amount) => `${amount} ${answer6.currency.toUpperCase()}`;
90773
91003
  const lines2 = answer6.computers.map(
90774
- (one) => ` ${one.name ?? one.ownerName} ${one.size} ${money3(one.monthlyCharge)} a month ${one.agents} agent(s) ${one.state}`
91004
+ (one) => ` ${one.name ?? one.ownerName} ${one.size} ${money4(one.monthlyCharge)} a month ${one.agents} agent(s) ${one.state}`
90775
91005
  );
90776
91006
  context.out(
90777
91007
  `Everyone's computers (${answer6.includedSize} included per person):
@@ -94989,8 +95219,8 @@ function draftFilesMissingText(names) {
94989
95219
  }
94990
95220
 
94991
95221
  // ../../modules/feed/contract/src/feed.decisions.ts
94992
- function decisionsLineOf(count7) {
94993
- return `${count7} ${count7 === 1 ? "decision" : "decisions"} waiting on you`;
95222
+ function decisionsLineOf(count8) {
95223
+ return `${count8} ${count8 === 1 ? "decision" : "decisions"} waiting on you`;
94994
95224
  }
94995
95225
 
94996
95226
  // src/rules/feed-input.rules.ts
@@ -95492,8 +95722,8 @@ function optionalWords(words) {
95492
95722
  }
95493
95723
  function shareLinesOf({ move: move3, answer: answer6 }) {
95494
95724
  const names = answer6.people.map((person) => person.name).join(", ") || "no one new";
95495
- const count7 = answer6.itemIds.length;
95496
- const items = `${count7} item${count7 === 1 ? "" : "s"}`;
95725
+ const count8 = answer6.itemIds.length;
95726
+ const items = `${count8} item${count8 === 1 ? "" : "s"}`;
95497
95727
  const head = move3 === "share" ? `Shared ${items} with ${names}` : `Took ${names} off ${items}`;
95498
95728
  return [head, ...answer6.itemIds].map((line) => `${line}
95499
95729
  `).join("");
@@ -96124,13 +96354,13 @@ function formatHistory(output2) {
96124
96354
  const lines2 = linesOf3(output2);
96125
96355
  if (lines2.length === 0) return `${where}${from}: no messages.
96126
96356
  `;
96127
- const count7 = lines2.length === 1 ? "1 message" : `${lines2.length} messages`;
96357
+ const count8 = lines2.length === 1 ? "1 message" : `${lines2.length} messages`;
96128
96358
  const blocks = lines2.map(blockOf2).join("\n\n");
96129
96359
  const cursor = olderCursorOf(output2);
96130
96360
  const older = cursor ? `
96131
96361
 
96132
96362
  Older: laze history ${output2.channel} --before ${cursor}` : "";
96133
- return `${where}${from}: ${count7}, oldest first
96363
+ return `${where}${from}: ${count8}, oldest first
96134
96364
 
96135
96365
  ${blocks}${older}
96136
96366
  `;
@@ -96483,9 +96713,9 @@ async function list9({ context, args }) {
96483
96713
  const answer6 = await client.get(DEDICATED_IP_REST_PATHS.all);
96484
96714
  if (args.flags.json) return printJson7(context, answer6);
96485
96715
  if (answer6.ips.length === 0) return context.out("No one has a dedicated IP.\n");
96486
- const money3 = (amount) => `${amount} ${answer6.currency.toUpperCase()}`;
96716
+ const money4 = (amount) => `${amount} ${answer6.currency.toUpperCase()}`;
96487
96717
  const lines2 = answer6.ips.map(
96488
- (one) => ` ${one.ownerName} ${one.country.name} ${one.state === "on" ? "on" : "being bought"} ${money3(one.monthlyPrice)} a month`
96718
+ (one) => ` ${one.ownerName} ${one.country.name} ${one.state === "on" ? "on" : "being bought"} ${money4(one.monthlyPrice)} a month`
96489
96719
  );
96490
96720
  context.out(`Dedicated IPs:
96491
96721
  ${lines2.join("\n")}
@@ -97341,10 +97571,10 @@ ${USAGE13}`);
97341
97571
  if ("exitCode" in released) return released;
97342
97572
  Object.assign(env, released.env);
97343
97573
  }
97344
- const count7 = Object.keys(env).length;
97345
- if (count7 > EXEC_ENV_MAX) {
97574
+ const count8 = Object.keys(env).length;
97575
+ if (count8 > EXEC_ENV_MAX) {
97346
97576
  context.err(
97347
- `laze: these connections hold ${count7} variables; at most ${EXEC_ENV_MAX} go with a command. Send fewer connections, or run the command with \`laze vault run\` where you run.
97577
+ `laze: these connections hold ${count8} variables; at most ${EXEC_ENV_MAX} go with a command. Send fewer connections, or run the command with \`laze vault run\` where you run.
97348
97578
  `
97349
97579
  );
97350
97580
  return { exitCode: 1 };
@@ -97499,7 +97729,7 @@ function secretRefusal({
97499
97729
  rules = MCP_SECRET_COMMANDS
97500
97730
  }) {
97501
97731
  const { words, flags: flags2 } = parseArgs({ argv });
97502
- const command = [3, 2, 1].map((count7) => words.slice(0, count7).join(" ")).find((name3) => Object.hasOwn(rules, name3));
97732
+ const command = [3, 2, 1].map((count8) => words.slice(0, count8).join(" ")).find((name3) => Object.hasOwn(rules, name3));
97503
97733
  const rule = command === void 0 ? void 0 : rules[command];
97504
97734
  if (!command || !rule) return void 0;
97505
97735
  const vaultFlag = rule.vaultFlag ?? "from-vault";
@@ -98028,11 +98258,12 @@ async function memory({ context, args }) {
98028
98258
  var WINDOWS = ["day", "week", "month"];
98029
98259
  var USAGE15 = `Usage:
98030
98260
  laze models policy whether Laze models are on, the default budget and the cap
98031
- laze models set-policy [on|off] [--default-level small|frontier|none] [--default-day <usd|none>] [--cap-day <usd|none>] ... (admins)
98261
+ laze models set-policy [on|off] [--default-level small|frontier|none] [--default-day <amount|none>] [--cap-day <amount|none>] ... (admins)
98032
98262
  --default-level sets what agents on Default run (none: Laze Frontier, Laze's default)
98033
98263
  --default-week, --default-month, --cap-week and --cap-month set the other windows
98034
98264
  laze models agents each Laze-model agent's budget and spend
98035
- laze models budget <agent> [--day <usd|none>] [--week <usd|none>] [--month <usd|none>]
98265
+ laze models budget <agent> [--day <amount|none>] [--week <amount|none>] [--month <amount|none>]
98266
+ amounts are what Laze charges, in the workspace currency
98036
98267
  the agent's owner or an admin, up to the cap; never an agent's own key
98037
98268
  laze models spend the workspace's spend per window, agent and channel`;
98038
98269
  var LEVEL_LINES = {
@@ -98049,10 +98280,34 @@ function levelFrom({ args }) {
98049
98280
  throw new CliUsageError(`--default-level takes small, frontier or none.
98050
98281
  ${USAGE15}`);
98051
98282
  }
98052
- var usd = (value) => `${Number(value.toFixed(2))} USD`;
98053
- var limitsLine = (limits) => WINDOWS.map(
98054
- (window2) => `${window2} ${limits[window2] === null ? "none" : usd(limits[window2])}`
98283
+ var money3 = (value, currency2) => `${Number(value.toFixed(2))} ${currency2.toUpperCase()}`;
98284
+ var limitsLine = (limits, currency2) => WINDOWS.map(
98285
+ (window2) => `${window2} ${limits[window2] === null ? "none" : money3(limits[window2], currency2)}`
98055
98286
  ).join(", ");
98287
+ function policyLimitsOf(policy) {
98288
+ const { currency: currency2, chargedDefaultBudget, chargedCap } = policy;
98289
+ if (currency2 && chargedDefaultBudget && chargedCap) {
98290
+ return { currency: currency2, charged: true, defaultBudget: chargedDefaultBudget, cap: chargedCap };
98291
+ }
98292
+ return {
98293
+ currency: "usd",
98294
+ charged: false,
98295
+ defaultBudget: policy.defaultBudget,
98296
+ cap: policy.cap
98297
+ };
98298
+ }
98299
+ function agentLimitsOf(agent3) {
98300
+ if (agent3.currency && agent3.chargedBudget) {
98301
+ const spent = (line) => line.charged ?? line.usd;
98302
+ return { currency: agent3.currency, charged: true, budget: agent3.chargedBudget, spent };
98303
+ }
98304
+ return {
98305
+ currency: "usd",
98306
+ charged: false,
98307
+ budget: agent3.budget,
98308
+ spent: (line) => line.usd
98309
+ };
98310
+ }
98056
98311
  function limitsFrom({
98057
98312
  args,
98058
98313
  prefix,
@@ -98065,7 +98320,7 @@ function limitsFrom({
98065
98320
  if (!text3) continue;
98066
98321
  const value = text3 === "none" ? null : Number(text3);
98067
98322
  if (value !== null && (!Number.isFinite(value) || value < 0))
98068
- throw new CliUsageError(`--${prefix}${window2} takes an amount in USD or none.
98323
+ throw new CliUsageError(`--${prefix}${window2} takes an amount or none.
98069
98324
  ${USAGE15}`);
98070
98325
  next[window2] = value;
98071
98326
  changed = true;
@@ -98079,9 +98334,10 @@ function printPolicy(context, policy) {
98079
98334
  `);
98080
98335
  context.out(`Default level: ${LEVEL_LINES[policy.defaultLevel ?? "none"]}
98081
98336
  `);
98082
- context.out(`Default budget per agent: ${limitsLine(policy.defaultBudget)}
98337
+ const limits = policyLimitsOf(policy);
98338
+ context.out(`Default budget per agent: ${limitsLine(limits.defaultBudget, limits.currency)}
98083
98339
  `);
98084
- context.out(`Cap per agent: ${limitsLine(policy.cap)}
98340
+ context.out(`Cap per agent: ${limitsLine(limits.cap, limits.currency)}
98085
98341
  `);
98086
98342
  }
98087
98343
  async function showPolicy({ context, args }) {
@@ -98095,17 +98351,18 @@ async function setPolicy({ context, args }) {
98095
98351
  const state = args.words[2];
98096
98352
  if (state !== void 0 && state !== "on" && state !== "off") throw new CliUsageError(USAGE15);
98097
98353
  const { client } = await signedIn({ context, args });
98098
- const current3 = await client.get("/api/models/policy");
98354
+ const current3 = policyLimitsOf(await client.get("/api/models/policy"));
98099
98355
  const defaultBudget = limitsFrom({ args, prefix: "default-", current: current3.defaultBudget });
98100
98356
  const cap = limitsFrom({ args, prefix: "cap-", current: current3.cap });
98357
+ const names = current3.charged ? { defaultBudget: "chargedDefaultBudget", cap: "chargedCap" } : { defaultBudget: "defaultBudget", cap: "cap" };
98101
98358
  const defaultLevel = levelFrom({ args });
98102
98359
  if (!state && !defaultBudget && !cap && defaultLevel === void 0)
98103
98360
  throw new CliUsageError(USAGE15);
98104
98361
  const updated = await client.post("/api/models/policy", {
98105
98362
  ...state ? { lazeModels: state === "on" } : {},
98106
98363
  ...defaultLevel !== void 0 ? { defaultLevel } : {},
98107
- ...defaultBudget ? { defaultBudget } : {},
98108
- ...cap ? { cap } : {}
98364
+ ...defaultBudget ? { [names.defaultBudget]: defaultBudget } : {},
98365
+ ...cap ? { [names.cap]: cap } : {}
98109
98366
  });
98110
98367
  if (args.flags.json) return context.out(`${JSON.stringify(updated, null, 2)}
98111
98368
  `);
@@ -98115,9 +98372,10 @@ function printAgent(context, agent3) {
98115
98372
  const paused = agent3.pausedOn ? ` paused: ${agent3.pausedOn} budget reached` : "";
98116
98373
  context.out(`${agent3.agentName} ${agent3.agentId} ${agent3.status}${paused}
98117
98374
  `);
98118
- context.out(` budget: ${limitsLine(agent3.budget)}
98375
+ const limits = agentLimitsOf(agent3);
98376
+ context.out(` budget: ${limitsLine(limits.budget, limits.currency)}
98119
98377
  `);
98120
- const spent = agent3.spend.map((line) => `${line.window} ${usd(line.usd)}`).join(", ");
98378
+ const spent = agent3.spend.map((line) => `${line.window} ${money3(limits.spent(line), limits.currency)}`).join(", ");
98121
98379
  if (spent) context.out(` spent: ${spent}
98122
98380
  `);
98123
98381
  }
@@ -98145,11 +98403,12 @@ async function setBudget({ context, args }) {
98145
98403
  if (!name3) throw new CliUsageError(USAGE15);
98146
98404
  const { client } = await signedIn({ context, args });
98147
98405
  const agent3 = await agentNamed({ client, name: name3 });
98148
- const next = limitsFrom({ args, prefix: "", current: agent3.budget });
98406
+ const limits = agentLimitsOf(agent3);
98407
+ const next = limitsFrom({ args, prefix: "", current: limits.budget });
98149
98408
  if (!next) throw new CliUsageError(USAGE15);
98150
98409
  const updated = await client.post("/api/models/agents/budget", {
98151
98410
  agentId: agent3.agentId,
98152
- budget: next
98411
+ ...limits.charged ? { chargedBudget: next } : { budget: next }
98153
98412
  });
98154
98413
  if (args.flags.json) return context.out(`${JSON.stringify(updated, null, 2)}
98155
98414
  `);
@@ -98161,11 +98420,14 @@ async function showSpend({ context, args }) {
98161
98420
  if (args.flags.json) return context.out(`${JSON.stringify(summaries, null, 2)}
98162
98421
  `);
98163
98422
  for (const summary of summaries) {
98164
- context.out(`${summary.window} ${usd(summary.usd)}
98423
+ const charged = summary.currency !== void 0 && summary.charged !== void 0;
98424
+ const currency2 = charged ? summary.currency ?? "usd" : "usd";
98425
+ const amount = (line) => money3(charged ? line.charged ?? line.usd : line.usd, currency2);
98426
+ context.out(`${summary.window} ${amount(summary)}
98165
98427
  `);
98166
- for (const line of summary.byAgent) context.out(` agent ${line.id} ${usd(line.usd)}
98428
+ for (const line of summary.byAgent) context.out(` agent ${line.id} ${amount(line)}
98167
98429
  `);
98168
- for (const line of summary.byChannel) context.out(` channel ${line.id} ${usd(line.usd)}
98430
+ for (const line of summary.byChannel) context.out(` channel ${line.id} ${amount(line)}
98169
98431
  `);
98170
98432
  }
98171
98433
  }
@@ -98218,11 +98480,11 @@ async function monitorAdd({ context, args }) {
98218
98480
  });
98219
98481
  if (args.flags.json) return context.out(`${JSON.stringify(added, null, 2)}
98220
98482
  `);
98221
- const count7 = added.watching.length;
98483
+ const count8 = added.watching.length;
98222
98484
  context.out(
98223
98485
  `${added.monitor.id} ${added.monitor.name}
98224
98486
  ${added.watching.join(" ")}
98225
- Watching ${count7} ${count7 === 1 ? "channel" : "channels"}
98487
+ Watching ${count8} ${count8 === 1 ? "channel" : "channels"}
98226
98488
  `
98227
98489
  );
98228
98490
  }
@@ -100008,18 +100270,70 @@ var funnelInputDefinition = external_exports.object({
100008
100270
  to: external_exports.iso.datetime(),
100009
100271
  bucketMinutes: external_exports.union([external_exports.literal(10), external_exports.literal(60), external_exports.literal(1440)]).default(60)
100010
100272
  }).strict();
100011
- var count6 = external_exports.number().int().nonnegative();
100273
+ var count7 = external_exports.number().int().nonnegative();
100012
100274
  var funnelCountsDefinition = external_exports.object({
100013
- signUps: count6,
100014
- workspaces: count6,
100015
- activatedTeams: count6,
100016
- payingTeams: count6
100275
+ signUps: count7,
100276
+ workspaces: count7,
100277
+ activatedTeams: count7,
100278
+ payingTeams: count7
100017
100279
  });
100018
100280
  var funnelOutputDefinition = external_exports.object({
100019
100281
  bucketMinutes: external_exports.number().int(),
100020
100282
  buckets: external_exports.array(external_exports.object({ at: external_exports.iso.datetime(), ...funnelCountsDefinition.shape })),
100021
100283
  totals: funnelCountsDefinition
100022
100284
  });
100285
+ var cohortInputDefinition = external_exports.object({
100286
+ from: external_exports.iso.datetime(),
100287
+ to: external_exports.iso.datetime(),
100288
+ limit: external_exports.number().int().min(1).max(100).default(25),
100289
+ cursor: cursorDefinition.optional()
100290
+ }).strict();
100291
+ var cohortOutputDefinition = external_exports.object({
100292
+ /** Read up to this time: every count runs from the workspace's creation to here. */
100293
+ until: external_exports.iso.datetime(),
100294
+ workspaces: pageOf(
100295
+ external_exports.object({
100296
+ workspaceId: external_exports.string(),
100297
+ createdAt: external_exports.iso.datetime(),
100298
+ /** The creator's first page and campaign tag, as their sign-up kept them. */
100299
+ landingPath: external_exports.string().nullable(),
100300
+ campaign: external_exports.string().nullable(),
100301
+ promotionId: external_exports.string().nullable(),
100302
+ plan: external_exports.string(),
100303
+ paying: external_exports.boolean(),
100304
+ members: count7,
100305
+ agents: external_exports.object({
100306
+ laze: count7,
100307
+ connected: count7,
100308
+ firstLazeAgentAt: external_exports.iso.datetime().nullable()
100309
+ }),
100310
+ turns: count7,
100311
+ appsCreated: count7,
100312
+ connectionsLinked: count7,
100313
+ creatorLastMessageAt: external_exports.iso.datetime().nullable(),
100314
+ /** Live messages per UTC day; days with none are left out. */
100315
+ days: external_exports.array(
100316
+ external_exports.object({
100317
+ day: external_exports.string(),
100318
+ byPeople: count7,
100319
+ byAgents: count7,
100320
+ people: count7
100321
+ })
100322
+ ),
100323
+ /** The once-only sends nurturing kept (first_agent_made, first_agent_nudge, ...). */
100324
+ lifecycle: external_exports.array(external_exports.object({ event: external_exports.string(), at: external_exports.iso.datetime() })),
100325
+ /** Mail sent to the creator since the workspace was made: template, state, times. */
100326
+ sentToCreator: external_exports.array(
100327
+ external_exports.object({
100328
+ template: external_exports.string(),
100329
+ state: external_exports.string(),
100330
+ sentAt: external_exports.iso.datetime(),
100331
+ updatedAt: external_exports.iso.datetime()
100332
+ })
100333
+ )
100334
+ })
100335
+ )
100336
+ });
100023
100337
  var noInputDefinition = external_exports.object({}).strict();
100024
100338
  var capacityOutputDefinition = external_exports.object({
100025
100339
  /** The pool now; null where the process runs no pool. */
@@ -100027,25 +100341,25 @@ var capacityOutputDefinition = external_exports.object({
100027
100341
  /** The last day of host load, oldest first. */
100028
100342
  history: external_exports.array(hostLoadPointSchema)
100029
100343
  });
100030
- var tally = external_exports.array(external_exports.object({ key: external_exports.string(), count: count6 }));
100344
+ var tally = external_exports.array(external_exports.object({ key: external_exports.string(), count: count7 }));
100031
100345
  var snapshotOutputDefinition = external_exports.object({
100032
100346
  workspaceId: external_exports.string(),
100033
100347
  createdAt: external_exports.iso.datetime(),
100034
100348
  plan: external_exports.string(),
100035
100349
  status: external_exports.string(),
100036
- seats: external_exports.object({ people: count6, limit: external_exports.number().int().nullable() }),
100350
+ seats: external_exports.object({ people: count7, limit: external_exports.number().int().nullable() }),
100037
100351
  membersByRole: tally,
100038
100352
  invitesByStatus: tally,
100039
100353
  agentsByKind: tally,
100040
100354
  agentsByHosting: tally,
100041
- agentsConnected: count6,
100355
+ agentsConnected: count7,
100042
100356
  flagsOn: external_exports.array(external_exports.string()),
100043
- complimentaryComputers: count6
100357
+ complimentaryComputers: count7
100044
100358
  });
100045
100359
  var eventsInputDefinition = external_exports.object({ from: external_exports.iso.datetime(), to: external_exports.iso.datetime() }).strict();
100046
100360
  var eventCountsDefinition = external_exports.object({
100047
- total: count6,
100048
- byType: external_exports.array(external_exports.object({ eventType: external_exports.string(), count: count6 }))
100361
+ total: count7,
100362
+ byType: external_exports.array(external_exports.object({ eventType: external_exports.string(), count: count7 }))
100049
100363
  });
100050
100364
  var tenantEventsInputDefinition = external_exports.object({
100051
100365
  from: external_exports.iso.datetime(),
@@ -100074,9 +100388,9 @@ var databaseHealthDefinition = external_exports.object({
100074
100388
  deadlocks: external_exports.number().nonnegative(),
100075
100389
  tempBytes: external_exports.number().nonnegative(),
100076
100390
  connections: external_exports.object({
100077
- total: count6,
100078
- byState: external_exports.array(external_exports.object({ state: external_exports.string(), count: count6 })),
100079
- waitingOnLocks: count6,
100391
+ total: count7,
100392
+ byState: external_exports.array(external_exports.object({ state: external_exports.string(), count: count7 })),
100393
+ waitingOnLocks: count7,
100080
100394
  longestActiveSeconds: external_exports.number().nonnegative(),
100081
100395
  longestIdleInTransactionSeconds: external_exports.number().nonnegative()
100082
100396
  }),
@@ -100107,7 +100421,7 @@ var tenantAgentsDefinition = external_exports.object({
100107
100421
  createdAt: external_exports.iso.datetime(),
100108
100422
  modelLevel: external_exports.string().nullable(),
100109
100423
  model: external_exports.string().nullable(),
100110
- channels: count6,
100424
+ channels: count7,
100111
100425
  limitedUntil: external_exports.iso.datetime().nullable(),
100112
100426
  limitedBy: external_exports.string().nullable(),
100113
100427
  pausedAt: external_exports.iso.datetime().nullable(),
@@ -100116,14 +100430,48 @@ var tenantAgentsDefinition = external_exports.object({
100116
100430
  })
100117
100431
  )
100118
100432
  });
100433
+ var tenantPeopleDefinition = external_exports.object({
100434
+ workspace: external_exports.object({
100435
+ id: external_exports.string(),
100436
+ name: external_exports.string(),
100437
+ createdByUserId: external_exports.string(),
100438
+ createdAt: external_exports.iso.datetime()
100439
+ }),
100440
+ members: external_exports.array(
100441
+ external_exports.object({
100442
+ userId: external_exports.string(),
100443
+ name: external_exports.string(),
100444
+ email: external_exports.string(),
100445
+ role: external_exports.string(),
100446
+ joinedAt: external_exports.iso.datetime()
100447
+ })
100448
+ ),
100449
+ /** Invitations not accepted yet, and who sent each. */
100450
+ invites: external_exports.array(
100451
+ external_exports.object({
100452
+ inviteId: external_exports.string(),
100453
+ email: external_exports.string(),
100454
+ role: external_exports.string(),
100455
+ status: external_exports.string(),
100456
+ invitedByUserId: external_exports.string(),
100457
+ createdAt: external_exports.iso.datetime(),
100458
+ expiresAt: external_exports.iso.datetime()
100459
+ })
100460
+ )
100461
+ });
100462
+ var creditPausedInputDefinition = external_exports.object({
100463
+ limit: external_exports.number().int().min(1).max(200).default(50),
100464
+ cursor: cursorDefinition.optional()
100465
+ }).strict();
100466
+ var creditPausedOutputDefinition = external_exports.object({ accounts: pageOf(creditPausedAccountSchema) });
100119
100467
  var tenantBillingDefinition = external_exports.object({
100120
100468
  plan: external_exports.string(),
100121
100469
  status: external_exports.string(),
100122
100470
  currency: external_exports.string(),
100123
100471
  cancelAtPeriodEnd: external_exports.boolean(),
100124
100472
  period: external_exports.object({ start: external_exports.iso.datetime(), end: external_exports.iso.datetime() }).nullable(),
100125
- seats: external_exports.object({ people: count6, limit: count6.nullable(), monthlyPrice: external_exports.number() }),
100126
- complimentarySeats: count6.nullable(),
100473
+ seats: external_exports.object({ people: count7, limit: count7.nullable(), monthlyPrice: external_exports.number() }),
100474
+ complimentarySeats: count7.nullable(),
100127
100475
  credits: external_exports.object({
100128
100476
  included: external_exports.number(),
100129
100477
  includedLeft: external_exports.number(),
@@ -100162,14 +100510,14 @@ var tenantVaultDefinition = external_exports.object({
100162
100510
  external_exports.object({
100163
100511
  subject: external_exports.string(),
100164
100512
  most: external_exports.string(),
100165
- maxLeaseSeconds: count6.nullable(),
100513
+ maxLeaseSeconds: count7.nullable(),
100166
100514
  blocked: external_exports.boolean(),
100167
100515
  approveNew: external_exports.boolean(),
100168
100516
  updatedAt: external_exports.iso.datetime()
100169
100517
  })
100170
100518
  ),
100171
100519
  /** Connections waiting for an admin, counted by kind; never a name, label or field. */
100172
- waitingByKind: external_exports.array(external_exports.object({ key: external_exports.string(), count: count6 }))
100520
+ waitingByKind: external_exports.array(external_exports.object({ key: external_exports.string(), count: count7 }))
100173
100521
  });
100174
100522
  var WHATSAPP_INTAKE_KEY_KINDS = ["msg", "edit", "del", "react", "read"];
100175
100523
  var tenantWhatsappInputDefinition = external_exports.object({
@@ -100182,8 +100530,8 @@ var tenantWhatsappOutputDefinition = external_exports.object({
100182
100530
  intake: external_exports.object({
100183
100531
  since: external_exports.iso.datetime(),
100184
100532
  until: external_exports.iso.datetime(),
100185
- total: count6,
100186
- byKind: external_exports.array(external_exports.object({ kind: external_exports.enum([...WHATSAPP_INTAKE_KEY_KINDS, "other"]), count: count6 }))
100533
+ total: count7,
100534
+ byKind: external_exports.array(external_exports.object({ kind: external_exports.enum([...WHATSAPP_INTAKE_KEY_KINDS, "other"]), count: count7 }))
100187
100535
  })
100188
100536
  });
100189
100537
  var wakeTimelineInputDefinition = external_exports.object({
@@ -100200,6 +100548,17 @@ var keyFetchesOutputDefinition = external_exports.object({
100200
100548
  starts: vaultKeyFetchesSchema.shape.starts,
100201
100549
  hours: pageOf(vaultKeyFetchesSchema.shape.hours.element)
100202
100550
  });
100551
+ var judgeMeasureInputDefinition = external_exports.object({
100552
+ from: external_exports.iso.datetime(),
100553
+ to: external_exports.iso.datetime(),
100554
+ limit: external_exports.number().int().min(1).max(500).default(100),
100555
+ cursor: cursorDefinition.optional()
100556
+ }).strict();
100557
+ var judgeMeasureOutputDefinition = external_exports.object({
100558
+ modes: vaultJudgeMeasureSchema.shape.modes,
100559
+ thresholds: vaultJudgeMeasureSchema.shape.thresholds,
100560
+ keys: pageOf(vaultJudgeMeasureSchema.shape.keys.element)
100561
+ });
100203
100562
  var entry = (value) => value;
100204
100563
  var OPS_FUNCTIONS = {
100205
100564
  "workspaces.find": entry({
@@ -100216,6 +100575,13 @@ var OPS_FUNCTIONS = {
100216
100575
  input: funnelInputDefinition,
100217
100576
  output: funnelOutputDefinition
100218
100577
  }),
100578
+ "signups.cohort": entry({
100579
+ title: "Each workspace made in a range: source, promotion, agents, messages per day and lifecycle mail",
100580
+ scope: "platform",
100581
+ view: "table",
100582
+ input: cohortInputDefinition,
100583
+ output: cohortOutputDefinition
100584
+ }),
100219
100585
  "computers.capacity": entry({
100220
100586
  title: "Computer pool capacity and host load",
100221
100587
  scope: "platform",
@@ -100258,6 +100624,21 @@ var OPS_FUNCTIONS = {
100258
100624
  input: noInputDefinition,
100259
100625
  output: tenantAgentsDefinition
100260
100626
  }),
100627
+ "tenant.logins": entry({
100628
+ title: "One workspace's Claude Code and Codex logins, pools and what each agent runs on",
100629
+ scope: "tenant",
100630
+ view: "table",
100631
+ input: noInputDefinition,
100632
+ output: loginStatesSchema
100633
+ }),
100634
+ "tenant.people": entry({
100635
+ title: "One workspace's people: members' names, emails and join times, and pending invites",
100636
+ scope: "tenant",
100637
+ view: "table",
100638
+ input: noInputDefinition,
100639
+ output: tenantPeopleDefinition,
100640
+ personal: true
100641
+ }),
100261
100642
  "tenant.billing": entry({
100262
100643
  title: "One workspace's plan, credits, auto-recharge, spend by agent and invoices",
100263
100644
  scope: "tenant",
@@ -100265,6 +100646,13 @@ var OPS_FUNCTIONS = {
100265
100646
  input: noInputDefinition,
100266
100647
  output: tenantBillingDefinition
100267
100648
  }),
100649
+ "billing.credit_paused": entry({
100650
+ title: "Workspaces whose Laze-hosted work is paused for credits now, with card and plan",
100651
+ scope: "platform",
100652
+ view: "table",
100653
+ input: creditPausedInputDefinition,
100654
+ output: creditPausedOutputDefinition
100655
+ }),
100268
100656
  "tenant.vault": entry({
100269
100657
  title: "One workspace's vault setup: judge, level limits and connections waiting",
100270
100658
  scope: "tenant",
@@ -100293,6 +100681,13 @@ var OPS_FUNCTIONS = {
100293
100681
  input: keyFetchesInputDefinition,
100294
100682
  output: keyFetchesOutputDefinition
100295
100683
  }),
100684
+ "vault.judge_measure": entry({
100685
+ title: "The vault judge's verdicts against people's answers, with false allows and blocks",
100686
+ scope: "platform",
100687
+ view: "table",
100688
+ input: judgeMeasureInputDefinition,
100689
+ output: judgeMeasureOutputDefinition
100690
+ }),
100296
100691
  "tenant.snapshot": entry({
100297
100692
  title: "One workspace's plan, members, agents and flags, as counts",
100298
100693
  scope: "tenant",
@@ -102504,7 +102899,7 @@ async function vaultSave({ context, args }) {
102504
102899
  // src/services/vault-scrub-commands.service.ts
102505
102900
  function lineOf5(channel) {
102506
102901
  const where = channel.name ? `#${channel.name}` : channel.channelId;
102507
- const found = Object.entries(channel.found).map(([vendor, count7]) => `${vendor} ${count7}`).join(", ");
102902
+ const found = Object.entries(channel.found).map(([vendor, count8]) => `${vendor} ${count8}`).join(", ");
102508
102903
  const kinds = [`held ${channel.held}`, ...found ? [`found: ${found}`] : []].join("; ");
102509
102904
  return `${where} scanned ${channel.scanned} changed ${channel.messages} ${kinds}
102510
102905
  `;
@@ -103494,8 +103889,8 @@ async function roles({ context, args }) {
103494
103889
  const catalogue = await client.get("/api/roles");
103495
103890
  if (args.flags.json) return printJson11(context, catalogue);
103496
103891
  for (const role2 of catalogue) {
103497
- const count7 = `${role2.permissions.length} permissions`;
103498
- context.out(`${role2.label} ${count7} ${role2.description}
103892
+ const count8 = `${role2.permissions.length} permissions`;
103893
+ context.out(`${role2.label} ${count8} ${role2.description}
103499
103894
  `);
103500
103895
  context.out(` ${role2.permissions.join(", ")}
103501
103896
  `);