@lazehq/cli 0.1.110 → 0.1.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/laze.mjs +393 -47
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -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) {
|
|
@@ -36960,7 +36960,7 @@ function shadowedLinkLineOf({ shadow }) {
|
|
|
36960
36960
|
}
|
|
36961
36961
|
|
|
36962
36962
|
// src/rules/cli-version.rules.ts
|
|
36963
|
-
var STAMPED = "0.1.
|
|
36963
|
+
var STAMPED = "0.1.112";
|
|
36964
36964
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
36965
36965
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
36966
36966
|
}
|
|
@@ -57370,6 +57370,11 @@ var AUTHZ_RESOURCES = {
|
|
|
57370
57370
|
ownerKeys: {
|
|
57371
57371
|
actions: ["use"],
|
|
57372
57372
|
scopes: ["workspace"]
|
|
57373
|
+
},
|
|
57374
|
+
/** `manage`: change a running plan, auto-recharge, billing details and codes. */
|
|
57375
|
+
billing: {
|
|
57376
|
+
actions: ["manage"],
|
|
57377
|
+
scopes: ["workspace"]
|
|
57373
57378
|
}
|
|
57374
57379
|
};
|
|
57375
57380
|
var AUTHZ_RESOURCE_NAMES = Object.keys(AUTHZ_RESOURCES);
|
|
@@ -63236,8 +63241,13 @@ var budgetCardSchemaDefinition = external_exports.object({
|
|
|
63236
63241
|
window: external_exports.enum(["day", "week", "month"]),
|
|
63237
63242
|
/** The plain first line: "Scout is paused on its daily budget." */
|
|
63238
63243
|
line: external_exports.string().min(1).max(400),
|
|
63244
|
+
/** Provider cost in USD, as the gateway enforces it. */
|
|
63239
63245
|
limitUsd: external_exports.number().nonnegative(),
|
|
63240
63246
|
spentUsd: external_exports.number().nonnegative(),
|
|
63247
|
+
/** What Laze charges, in `currency`; absent on cards from before charged budgets. */
|
|
63248
|
+
chargedLimit: external_exports.number().nonnegative().optional(),
|
|
63249
|
+
chargedSpent: external_exports.number().nonnegative().optional(),
|
|
63250
|
+
currency: external_exports.enum(["usd", "eur"]).optional(),
|
|
63241
63251
|
/** When the window resets and the agent answers again. */
|
|
63242
63252
|
resumeAt: external_exports.iso.datetime(),
|
|
63243
63253
|
/** The people who may raise the budget: the owner and the admins when it paused. */
|
|
@@ -63248,6 +63258,7 @@ var budgetCardSchemaDefinition = external_exports.object({
|
|
|
63248
63258
|
/** What happened, once resumed: "Ada raised the daily budget to 10.00 USD." */
|
|
63249
63259
|
outcome: external_exports.string().max(400)
|
|
63250
63260
|
});
|
|
63261
|
+
var creditsCardSchemaDefinition = external_exports.object({ type: external_exports.literal("credits") });
|
|
63251
63262
|
var feedCardSchemaDefinition = external_exports.object({
|
|
63252
63263
|
type: external_exports.literal("feed"),
|
|
63253
63264
|
itemId: idSchema4,
|
|
@@ -63306,6 +63317,7 @@ var messageCardSchemaDefinition = external_exports.discriminatedUnion("type", [
|
|
|
63306
63317
|
heldCardSchemaDefinition,
|
|
63307
63318
|
hopLimitCardSchemaDefinition,
|
|
63308
63319
|
budgetCardSchemaDefinition,
|
|
63320
|
+
creditsCardSchemaDefinition,
|
|
63309
63321
|
feedCardSchemaDefinition,
|
|
63310
63322
|
failureCardSchemaDefinition,
|
|
63311
63323
|
welcomeCardSchemaDefinition,
|
|
@@ -63891,6 +63903,8 @@ var postNoticeInputSchemaDefinition = external_exports.object({
|
|
|
63891
63903
|
details: external_exports.string().trim().min(1).max(NOTICE_DETAILS_MAX).optional(),
|
|
63892
63904
|
/** Try again under the notice, for the message the agent did not answer. */
|
|
63893
63905
|
retry: failureRetrySchemaDefinition.optional(),
|
|
63906
|
+
/** An agent's notice that work waits for a top-up: drawn as the credits card. */
|
|
63907
|
+
credits: external_exports.literal(true).optional(),
|
|
63894
63908
|
/** One notice per key: a second post with it answers the first. */
|
|
63895
63909
|
clientKey: external_exports.string().regex(/^[A-Za-z0-9_-]{8,64}$/).optional()
|
|
63896
63910
|
});
|
|
@@ -67722,10 +67736,20 @@ var raiseBudgetInputSchemaDefinition = external_exports.object({
|
|
|
67722
67736
|
workspaceId: external_exports.string().min(1),
|
|
67723
67737
|
/** The pause card the person pressed Raise budget on. */
|
|
67724
67738
|
messageId: external_exports.string().min(1),
|
|
67725
|
-
/** The paused window's new limit in USD. */
|
|
67726
|
-
limitUsd: external_exports.number().positive().max(1e5)
|
|
67739
|
+
/** The paused window's new limit in provider USD, as clients before charged budgets send. */
|
|
67740
|
+
limitUsd: external_exports.number().positive().max(1e5).optional(),
|
|
67741
|
+
/** The paused window's new limit in what Laze charges, in the workspace currency. */
|
|
67742
|
+
chargedLimit: external_exports.number().positive().max(1e5).optional()
|
|
67727
67743
|
});
|
|
67728
67744
|
var raiseBudgetInputSchema = raiseBudgetInputSchemaDefinition;
|
|
67745
|
+
var raisedBudgetSchemaDefinition = external_exports.object({
|
|
67746
|
+
/** The paused window's new provider limit in USD. */
|
|
67747
|
+
limitUsd: external_exports.number(),
|
|
67748
|
+
/** The same limit in what Laze charges; absent from a server without charged budgets. */
|
|
67749
|
+
chargedLimit: external_exports.number().optional(),
|
|
67750
|
+
currency: external_exports.enum(["usd", "eur"]).optional()
|
|
67751
|
+
});
|
|
67752
|
+
var raisedBudgetSchema = raisedBudgetSchemaDefinition;
|
|
67729
67753
|
|
|
67730
67754
|
// ../../modules/agent/contract/src/agent-catch-up.ts
|
|
67731
67755
|
var CATCH_UP_QUESTION_MAX = 4e3;
|
|
@@ -69592,6 +69616,58 @@ var harnessSignInPollSchemaDefinition = external_exports.discriminatedUnion("sta
|
|
|
69592
69616
|
external_exports.object({ status: external_exports.literal("approved"), flow: external_exports.string() })
|
|
69593
69617
|
]);
|
|
69594
69618
|
var harnessSignInPollSchema = harnessSignInPollSchemaDefinition;
|
|
69619
|
+
var loginStateSchema = external_exports.enum(["ready", "out_of_usage", "invalid"]);
|
|
69620
|
+
var isoSchema = external_exports.iso.datetime();
|
|
69621
|
+
var loginStatesSchemaDefinition = external_exports.object({
|
|
69622
|
+
/** Logins signed in on a person's own Laze computer; Laze holds only the fact. */
|
|
69623
|
+
computerLogins: external_exports.array(
|
|
69624
|
+
external_exports.object({ userId: external_exports.string(), harness: harnessSchema2, savedAt: isoSchema })
|
|
69625
|
+
),
|
|
69626
|
+
/** Logins in people's personal keychains in the vault. */
|
|
69627
|
+
personalLogins: external_exports.array(
|
|
69628
|
+
external_exports.object({
|
|
69629
|
+
id: external_exports.string(),
|
|
69630
|
+
ownerUserId: external_exports.string(),
|
|
69631
|
+
harness: harnessSchema2,
|
|
69632
|
+
state: loginStateSchema,
|
|
69633
|
+
/** The vault's own state: `needs_reconnect`, or still waiting for an admin's approval. */
|
|
69634
|
+
vaultStatus: external_exports.enum(["active", "needs_reconnect"]),
|
|
69635
|
+
waitingApproval: external_exports.boolean(),
|
|
69636
|
+
limitedUntil: isoSchema.nullable(),
|
|
69637
|
+
checkedAt: isoSchema.nullable(),
|
|
69638
|
+
createdAt: isoSchema,
|
|
69639
|
+
updatedAt: isoSchema
|
|
69640
|
+
})
|
|
69641
|
+
),
|
|
69642
|
+
pools: external_exports.array(
|
|
69643
|
+
external_exports.object({
|
|
69644
|
+
id: external_exports.string(),
|
|
69645
|
+
createdAt: isoSchema,
|
|
69646
|
+
members: external_exports.number().int().nonnegative(),
|
|
69647
|
+
logins: external_exports.array(
|
|
69648
|
+
external_exports.object({
|
|
69649
|
+
id: external_exports.string(),
|
|
69650
|
+
harness: harnessSchema2,
|
|
69651
|
+
state: loginStateSchema,
|
|
69652
|
+
contributedByUserId: external_exports.string(),
|
|
69653
|
+
limitedUntil: isoSchema.nullable(),
|
|
69654
|
+
createdAt: isoSchema
|
|
69655
|
+
})
|
|
69656
|
+
)
|
|
69657
|
+
})
|
|
69658
|
+
),
|
|
69659
|
+
/** Each Laze-hosted agent and the login its next turn runs on; connected agents are left out. */
|
|
69660
|
+
agents: external_exports.array(
|
|
69661
|
+
external_exports.object({
|
|
69662
|
+
id: external_exports.string(),
|
|
69663
|
+
harness: external_exports.string(),
|
|
69664
|
+
source: external_exports.enum(["keychain", "computer", "pool", "laze_models", "none"]),
|
|
69665
|
+
loginPoolId: external_exports.string().nullable(),
|
|
69666
|
+
activeLoginId: external_exports.string().nullable()
|
|
69667
|
+
})
|
|
69668
|
+
)
|
|
69669
|
+
});
|
|
69670
|
+
var loginStatesSchema = loginStatesSchemaDefinition;
|
|
69595
69671
|
|
|
69596
69672
|
// ../../modules/agent/contract/src/agent-migration.ts
|
|
69597
69673
|
var workspaceIdSchema10 = external_exports.string().min(1);
|
|
@@ -70584,7 +70660,7 @@ var agentsCopy = {
|
|
|
70584
70660
|
paintOnly: true,
|
|
70585
70661
|
storable: agentsForDisk
|
|
70586
70662
|
};
|
|
70587
|
-
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(
|
|
70663
|
+
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();
|
|
70588
70664
|
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();
|
|
70589
70665
|
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();
|
|
70590
70666
|
var agentJoinTrpc = defineTrpcContract("agents").query("joinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("approveJoinRequest").withInput(approveJoinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("denyJoinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).build();
|
|
@@ -71223,7 +71299,9 @@ var callerWorkspaceMemberSchemaDefinition = external_exports.object({
|
|
|
71223
71299
|
role: roleSchema,
|
|
71224
71300
|
joinedAt: external_exports.iso.datetime(),
|
|
71225
71301
|
/** Other names they go by in the workspace; absent or empty without any. */
|
|
71226
|
-
aliases: external_exports.array(external_exports.string()).optional()
|
|
71302
|
+
aliases: external_exports.array(external_exports.string()).optional(),
|
|
71303
|
+
/** Holds the Billing role beside their role; absent is false. */
|
|
71304
|
+
billing: external_exports.boolean().optional()
|
|
71227
71305
|
});
|
|
71228
71306
|
var callerWorkspaceInviteSchemaDefinition = external_exports.object({
|
|
71229
71307
|
id: external_exports.string().min(1),
|
|
@@ -71290,6 +71368,10 @@ var changeRoleAsCallerInputSchemaDefinition = external_exports.object({
|
|
|
71290
71368
|
member: memberRefSchema3,
|
|
71291
71369
|
role: roleSchema
|
|
71292
71370
|
});
|
|
71371
|
+
var setBillingAsCallerInputSchemaDefinition = external_exports.object({
|
|
71372
|
+
member: memberRefSchema3,
|
|
71373
|
+
billing: external_exports.boolean()
|
|
71374
|
+
});
|
|
71293
71375
|
var groupRefSchema = external_exports.string().trim().min(1).max(80);
|
|
71294
71376
|
var callerGroupSchemaDefinition = external_exports.object({
|
|
71295
71377
|
id: external_exports.string().min(1),
|
|
@@ -80783,6 +80865,8 @@ var signInHandoffSchemaDefinition = external_exports.object({
|
|
|
80783
80865
|
expiresAt: external_exports.iso.datetime()
|
|
80784
80866
|
});
|
|
80785
80867
|
var signInHandoffSchema = signInHandoffSchemaDefinition;
|
|
80868
|
+
var appOpenedSchemaDefinition = external_exports.object({ appId: external_exports.string() });
|
|
80869
|
+
var appOpenedSchema = appOpenedSchemaDefinition;
|
|
80786
80870
|
var appViewerSchemaDefinition = external_exports.object({
|
|
80787
80871
|
userId: external_exports.string().min(1),
|
|
80788
80872
|
name: external_exports.string(),
|
|
@@ -82221,7 +82305,7 @@ var appsCopy = {
|
|
|
82221
82305
|
paintOnly: true,
|
|
82222
82306
|
storable: appsForDisk
|
|
82223
82307
|
};
|
|
82224
|
-
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();
|
|
82308
|
+
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();
|
|
82225
82309
|
var appExternalTrpc = defineTrpcContract("app").mutation("externalSignInHandoff").withInput(externalSignInHandoffInputSchema).withOutput(signInHandoffSchema).mutation("setExternalRole").withInput(setExternalRoleInputSchema).withOutput(appAccessSchema).build();
|
|
82226
82310
|
var appConnectionsTrpc = defineTrpcContract("app").query("connections").withInput(appRefSchema).withOutput(appConnectionsSchema).mutation("allowConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).mutation("revokeConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).build();
|
|
82227
82311
|
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();
|
|
@@ -85552,21 +85636,21 @@ var appUnpublish = async ({ context, args }) => {
|
|
|
85552
85636
|
});
|
|
85553
85637
|
};
|
|
85554
85638
|
function costText({ name: name3, cost }) {
|
|
85555
|
-
const
|
|
85639
|
+
const money4 = (amount) => formatAppMoney({ amount, currency: cost.currency });
|
|
85556
85640
|
const month = Temporal3.PlainDate.from(`${cost.month}-01`).toLocaleString("en-GB", {
|
|
85557
85641
|
month: "long",
|
|
85558
85642
|
year: "numeric"
|
|
85559
85643
|
});
|
|
85560
85644
|
const rows = cost.lines.map((line) => {
|
|
85561
85645
|
const used = appCostQuantityText(line);
|
|
85562
|
-
return ` ${APP_COST_PART_LABELS[line.part].padEnd(16)} ${
|
|
85646
|
+
return ` ${APP_COST_PART_LABELS[line.part].padEnd(16)} ${money4(line.amount).padStart(12)}${used ? ` ${used}` : ""}
|
|
85563
85647
|
`;
|
|
85564
85648
|
});
|
|
85565
85649
|
const { budget: budget2 } = cost;
|
|
85566
|
-
const budgetLine = budget2.monthly === null ? "No budget. laze app budget <amount> sets one.\n" : `Budget ${
|
|
85650
|
+
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.
|
|
85567
85651
|
`;
|
|
85568
85652
|
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" : "";
|
|
85569
|
-
return `${name3} cost ${
|
|
85653
|
+
return `${name3} cost ${money4(cost.total)} so far in ${month}, at Laze list prices:
|
|
85570
85654
|
${rows.join("")}${budgetLine}${paused}`;
|
|
85571
85655
|
}
|
|
85572
85656
|
async function appOfWord({
|
|
@@ -85949,6 +86033,16 @@ function prepaidNoteOf(account, of) {
|
|
|
85949
86033
|
].filter((note) => note !== null);
|
|
85950
86034
|
return notes.length > 0 ? ` (${notes.join(", ")})` : "";
|
|
85951
86035
|
}
|
|
86036
|
+
function rechargeLineOf({
|
|
86037
|
+
recharge,
|
|
86038
|
+
of
|
|
86039
|
+
}) {
|
|
86040
|
+
if (!recharge.enabled) return "off";
|
|
86041
|
+
if (recharge.amount === null || recharge.monthlyLimit === null) {
|
|
86042
|
+
return "on, starts with the first payment (a top-up or a paid Team invoice)";
|
|
86043
|
+
}
|
|
86044
|
+
return `on, ${of(recharge.amount)} when credits run low, up to ${of(recharge.monthlyLimit)} a month (${of(recharge.rechargedThisMonth)} so far)`;
|
|
86045
|
+
}
|
|
85952
86046
|
function printAccount({ context, args }, account) {
|
|
85953
86047
|
if (args.flags.json) return printJson(context, account);
|
|
85954
86048
|
const of = (amount) => money(amount, account.currency);
|
|
@@ -85967,8 +86061,7 @@ function printAccount({ context, args }, account) {
|
|
|
85967
86061
|
`
|
|
85968
86062
|
);
|
|
85969
86063
|
const recharge = account.autoRecharge;
|
|
85970
|
-
|
|
85971
|
-
context.out(`Auto-recharge: ${rechargeLine}
|
|
86064
|
+
context.out(`Auto-recharge: ${rechargeLineOf({ recharge, of })}
|
|
85972
86065
|
`);
|
|
85973
86066
|
if (recharge.lastFailure) context.out(`Last recharge failed: ${recharge.lastFailure.message}
|
|
85974
86067
|
`);
|
|
@@ -88395,6 +88488,7 @@ var computerWaitlistChangedDefinition = external_exports.object({
|
|
|
88395
88488
|
|
|
88396
88489
|
// ../../modules/billing/contract/src/billing.config.ts
|
|
88397
88490
|
var priceId = external_exports.string().min(1).optional();
|
|
88491
|
+
var MAC_QA_WORKSPACE_ID = "workspace_0004i5nUrgRHO0Mz9PXEeGpqnPFDM";
|
|
88398
88492
|
var billingConfig = Config.define((c) => ({
|
|
88399
88493
|
publicBaseUrl,
|
|
88400
88494
|
/** The first alias (`laze.so` on prod) is the short origin referral links are shared on. */
|
|
@@ -88420,8 +88514,7 @@ var billingConfig = Config.define((c) => ({
|
|
|
88420
88514
|
automaticTax: c.env("STRIPE_AUTOMATIC_TAX", environmentBooleanSchema.default(true)),
|
|
88421
88515
|
/** The coupon for a referral: `REFERRAL_TERMS` off, repeating for its months. */
|
|
88422
88516
|
referralCouponId: c.env("STRIPE_COUPON_REFERRAL", external_exports.string().min(1).optional()),
|
|
88423
|
-
/** List price over cost
|
|
88424
|
-
modelMarkup: c.env("LAZE_MARKUP_MODEL", external_exports.coerce.number().min(1).max(10).default(1.055)),
|
|
88517
|
+
/** List price over cost for machines and connectors; model calls follow `MODEL_FEE_TERMS`. */
|
|
88425
88518
|
machineMarkup: c.env("LAZE_MARKUP_MACHINE", external_exports.coerce.number().min(1).max(10).default(2)),
|
|
88426
88519
|
connectorMarkup: c.env("LAZE_MARKUP_CONNECTOR", external_exports.coerce.number().min(1).max(10).default(2)),
|
|
88427
88520
|
/** The ECB daily reference rates EUR usage is priced at. */
|
|
@@ -88429,6 +88522,16 @@ var billingConfig = Config.define((c) => ({
|
|
|
88429
88522
|
"LAZE_ECB_RATES_URL",
|
|
88430
88523
|
external_exports.url().default("https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml")
|
|
88431
88524
|
),
|
|
88525
|
+
/**
|
|
88526
|
+
* QA workspaces billing-qa-credit-state may put in a credit state, comma separated ids; unset,
|
|
88527
|
+
* the prod Mac QA workspace. Spec: modules/billing/specs/qa-credit-state.feature.
|
|
88528
|
+
*/
|
|
88529
|
+
qaWorkspaceIds: c.env(
|
|
88530
|
+
"LAZE_BILLING_QA_WORKSPACES",
|
|
88531
|
+
external_exports.string().default(MAC_QA_WORKSPACE_ID).transform(
|
|
88532
|
+
(value) => value.split(",").map((id4) => id4.trim()).filter(Boolean)
|
|
88533
|
+
)
|
|
88534
|
+
),
|
|
88432
88535
|
/** USD per euro until the first ECB rate is stored. */
|
|
88433
88536
|
defaultUsdPerEur: c.env(
|
|
88434
88537
|
"LAZE_DEFAULT_USD_PER_EUR",
|
|
@@ -88515,8 +88618,12 @@ var CREDIT_TERMS = {
|
|
|
88515
88618
|
/** Auto-recharge tops up when the prepaid balance drops under this. */
|
|
88516
88619
|
rechargeBelow: 5,
|
|
88517
88620
|
autoRechargeByDefault: true,
|
|
88621
|
+
/** What each auto-recharge adds once a paid Team invoice turns it on without a top-up. */
|
|
88622
|
+
defaultRecharge: 10,
|
|
88518
88623
|
/** A top-up raises the monthly auto-recharge limit to this many times its amount. */
|
|
88519
|
-
limitPerTopUp: 2
|
|
88624
|
+
limitPerTopUp: 2,
|
|
88625
|
+
/** The monthly limit an admin can raise to in one tap once the limit holds recharges back. */
|
|
88626
|
+
suggestedMonthlyLimit: 100
|
|
88520
88627
|
};
|
|
88521
88628
|
|
|
88522
88629
|
// ../../modules/billing/contract/src/billing.events.ts
|
|
@@ -88563,6 +88670,10 @@ var usagePausedDefinition = external_exports.object({
|
|
|
88563
88670
|
paused: external_exports.boolean(),
|
|
88564
88671
|
/** `no_plan`, `canceled` and `budget` are from before prepaid credits. */
|
|
88565
88672
|
reason: external_exports.enum(["credits", "no_plan", "canceled", "budget"]).nullable(),
|
|
88673
|
+
/** On a pause for credits: true when only the monthly limit kept auto-recharge from charging. */
|
|
88674
|
+
autoRechargeHeldByLimit: external_exports.boolean().optional(),
|
|
88675
|
+
/** Absent on facts from before it was recorded: the workspace's billing currency then. */
|
|
88676
|
+
currency: currencySchema.optional(),
|
|
88566
88677
|
at: external_exports.iso.datetime()
|
|
88567
88678
|
});
|
|
88568
88679
|
var referralRewardedDefinition = external_exports.object({
|
|
@@ -88586,6 +88697,30 @@ var checkoutChangedDefinition = external_exports.object({
|
|
|
88586
88697
|
byUserId: external_exports.string().nullable(),
|
|
88587
88698
|
at: external_exports.iso.datetime()
|
|
88588
88699
|
});
|
|
88700
|
+
var creditsLowDefinition = external_exports.object({
|
|
88701
|
+
workspaceId: external_exports.string().min(1),
|
|
88702
|
+
/** The usage entry that crossed the low mark; one fact per entry. */
|
|
88703
|
+
entryId: external_exports.string().min(1),
|
|
88704
|
+
plan: storedPlanSchema,
|
|
88705
|
+
/**
|
|
88706
|
+
* Whether auto-recharge tops the credits up before work pauses. Absent on facts from before
|
|
88707
|
+
* it was recorded: read it with `autoRechargeCoversLow`.
|
|
88708
|
+
*/
|
|
88709
|
+
autoRechargeCovers: external_exports.boolean().optional(),
|
|
88710
|
+
/** True when the monthly limit is reached or the next recharge is the last under it. */
|
|
88711
|
+
autoRechargeHeldByLimit: external_exports.boolean().optional(),
|
|
88712
|
+
/** Absent on facts from before it was recorded: the workspace's billing currency then. */
|
|
88713
|
+
currency: currencySchema.optional(),
|
|
88714
|
+
at: external_exports.iso.datetime()
|
|
88715
|
+
});
|
|
88716
|
+
var autoRechargeStartedDefinition = external_exports.object({
|
|
88717
|
+
workspaceId: external_exports.string().min(1),
|
|
88718
|
+
/** What each recharge adds and the monthly limit, in the workspace currency. */
|
|
88719
|
+
amount: external_exports.number().positive(),
|
|
88720
|
+
monthlyLimit: external_exports.number().positive(),
|
|
88721
|
+
currency: currencySchema,
|
|
88722
|
+
at: external_exports.iso.datetime()
|
|
88723
|
+
});
|
|
88589
88724
|
var creditCheckStateDefinition = external_exports.object({ nextWakeAt: external_exports.number().nullable() });
|
|
88590
88725
|
var creditCheckIntentDefinition = external_exports.object({ workspaceId: external_exports.string().min(1) });
|
|
88591
88726
|
|
|
@@ -88676,17 +88811,24 @@ var billingAccountViewDefinition = external_exports.object({
|
|
|
88676
88811
|
/** The one-off welcome credit given before 2026-10-21; 0 when it got none. */
|
|
88677
88812
|
welcome: external_exports.number().default(0),
|
|
88678
88813
|
paused: external_exports.boolean(),
|
|
88679
|
-
pauseReason: pauseReasonSchema.nullable()
|
|
88814
|
+
pauseReason: pauseReasonSchema.nullable(),
|
|
88815
|
+
/** At or under the low mark and not paused yet. */
|
|
88816
|
+
low: external_exports.boolean().default(false)
|
|
88680
88817
|
}),
|
|
88681
88818
|
autoRecharge: external_exports.object({
|
|
88682
88819
|
enabled: external_exports.boolean(),
|
|
88683
|
-
/** What each recharge adds; null until the first top-up sets it. */
|
|
88820
|
+
/** What each recharge adds; null until the first top-up or paid Team invoice sets it. */
|
|
88684
88821
|
amount: external_exports.number().nullable(),
|
|
88685
88822
|
rechargeBelow: external_exports.number(),
|
|
88823
|
+
/** The monthly limit, double the amount unless set; null while the amount is. */
|
|
88686
88824
|
monthlyLimit: external_exports.number().nullable(),
|
|
88687
88825
|
rechargedThisMonth: external_exports.number(),
|
|
88688
88826
|
cardSaved: external_exports.boolean(),
|
|
88689
|
-
lastFailure: external_exports.object({ at: external_exports.iso.datetime(), message: external_exports.string() }).nullable()
|
|
88827
|
+
lastFailure: external_exports.object({ at: external_exports.iso.datetime(), message: external_exports.string() }).nullable(),
|
|
88828
|
+
/** The monthly limit holds the next recharge back; only when it could otherwise charge. */
|
|
88829
|
+
limitReached: external_exports.boolean().default(false),
|
|
88830
|
+
/** The next recharge is the last one under the monthly limit. */
|
|
88831
|
+
limitNear: external_exports.boolean().default(false)
|
|
88690
88832
|
}),
|
|
88691
88833
|
usage: external_exports.object({
|
|
88692
88834
|
used: external_exports.number(),
|
|
@@ -88909,12 +89051,39 @@ var grantCreditsInputDefinition = external_exports.object({
|
|
|
88909
89051
|
amount: external_exports.number().positive().max(1e4),
|
|
88910
89052
|
reason: external_exports.string().trim().min(3).max(500)
|
|
88911
89053
|
});
|
|
89054
|
+
var creditPausedAccountSchemaDefinition = external_exports.object({
|
|
89055
|
+
workspaceId: external_exports.string(),
|
|
89056
|
+
plan: planSchema,
|
|
89057
|
+
status: subscriptionStatusSchema,
|
|
89058
|
+
people: external_exports.number().int().nonnegative(),
|
|
89059
|
+
cardSaved: external_exports.boolean(),
|
|
89060
|
+
autoRechargeEnabled: external_exports.boolean(),
|
|
89061
|
+
rechargeFailedAt: external_exports.iso.datetime().nullable(),
|
|
89062
|
+
/** When the account last changed, which for most is the moment the pause began. */
|
|
89063
|
+
updatedAt: external_exports.iso.datetime()
|
|
89064
|
+
});
|
|
89065
|
+
var creditPausedAccountSchema = creditPausedAccountSchemaDefinition;
|
|
89066
|
+
var modelChargeBasisDefinition = external_exports.object({
|
|
89067
|
+
currency: currencySchema,
|
|
89068
|
+
/** The model fee on top of provider cost, by the people Team bills (`modelFeePercentOf`). */
|
|
89069
|
+
feePercent: external_exports.number().nonnegative(),
|
|
89070
|
+
/** USD per unit of the currency: 1 for USD, the stored ECB rate (or the default) for EUR. */
|
|
89071
|
+
usdPerUnit: external_exports.number().positive(),
|
|
89072
|
+
/** The ECB day of the rate; null for USD and for the configured default. */
|
|
89073
|
+
rateDay: external_exports.string().nullable()
|
|
89074
|
+
});
|
|
88912
89075
|
var BillingApi = moduleApi()("billing");
|
|
88913
89076
|
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();
|
|
88914
89077
|
var stripeWebhookHeadersDefinition = external_exports.object({
|
|
88915
89078
|
"stripe-signature": external_exports.string().max(1e3).default("")
|
|
88916
89079
|
});
|
|
88917
89080
|
|
|
89081
|
+
// ../../modules/billing/contract/src/billing.ui.ts
|
|
89082
|
+
var billingUi = uiTokens("billing");
|
|
89083
|
+
var CreditsBannerSlot = billingUi.component("creditsBanner");
|
|
89084
|
+
var CreditsCardSlot = billingUi.component("creditsCard");
|
|
89085
|
+
var CreditsComposerLineSlot = billingUi.component("creditsComposerLine");
|
|
89086
|
+
|
|
88918
89087
|
// ../../modules/compute/contract/src/free-guards.ts
|
|
88919
89088
|
var computeGuardEventKindSchema = external_exports.enum([
|
|
88920
89089
|
"hours_warning",
|
|
@@ -90607,9 +90776,9 @@ function creatorsOf(args) {
|
|
|
90607
90776
|
return { everyone: args.flags.everyone === true, userIds };
|
|
90608
90777
|
}
|
|
90609
90778
|
function lineOf3(computer2) {
|
|
90610
|
-
const
|
|
90779
|
+
const money4 = `${computer2.monthlyCharge} ${computer2.currency.toUpperCase()} a month`;
|
|
90611
90780
|
const agents = `${computer2.agents.length} agent(s)`;
|
|
90612
|
-
return ` ${computer2.computerId} ${computer2.name} ${computer2.kind} ${computer2.size} ${
|
|
90781
|
+
return ` ${computer2.computerId} ${computer2.name} ${computer2.kind} ${computer2.size} ${money4} ${agents} ${computer2.state}`;
|
|
90613
90782
|
}
|
|
90614
90783
|
async function mine({ context, args }) {
|
|
90615
90784
|
const client = await computeClient({ context, args });
|
|
@@ -90841,9 +91010,9 @@ async function list3({ context, args }) {
|
|
|
90841
91010
|
const client = await computeClient({ context, args });
|
|
90842
91011
|
const answer6 = await client.get(COMPUTER_REST_PATHS.all);
|
|
90843
91012
|
if (args.flags.json) return printJson3(context, answer6);
|
|
90844
|
-
const
|
|
91013
|
+
const money4 = (amount) => `${amount} ${answer6.currency.toUpperCase()}`;
|
|
90845
91014
|
const lines2 = answer6.computers.map(
|
|
90846
|
-
(one) => ` ${one.name ?? one.ownerName} ${one.size} ${
|
|
91015
|
+
(one) => ` ${one.name ?? one.ownerName} ${one.size} ${money4(one.monthlyCharge)} a month ${one.agents} agent(s) ${one.state}`
|
|
90847
91016
|
);
|
|
90848
91017
|
context.out(
|
|
90849
91018
|
`Everyone's computers (${answer6.includedSize} included per person):
|
|
@@ -93625,7 +93794,8 @@ async function list6({ context, args }) {
|
|
|
93625
93794
|
answer: answer6,
|
|
93626
93795
|
text: (members3) => members3.map((it) => {
|
|
93627
93796
|
const aka2 = it.aliases?.length ? ` aka ${it.aliases.join(", ")}` : "";
|
|
93628
|
-
|
|
93797
|
+
const role2 = it.billing ? `${ROLE_NAMES2[it.role]}, Billing` : ROLE_NAMES2[it.role];
|
|
93798
|
+
return `${role2} ${it.name} ${it.email} ${it.userId}${aka2}
|
|
93629
93799
|
`;
|
|
93630
93800
|
}).join("")
|
|
93631
93801
|
});
|
|
@@ -93726,6 +93896,25 @@ async function role({ context, args }) {
|
|
|
93726
93896
|
`
|
|
93727
93897
|
});
|
|
93728
93898
|
}
|
|
93899
|
+
async function billing2({ context, args }) {
|
|
93900
|
+
const [, , member, word3] = args.words;
|
|
93901
|
+
if (!member || word3 !== "on" && word3 !== "off")
|
|
93902
|
+
throw new CliUsageError("Usage: laze members billing <member> on|off");
|
|
93903
|
+
const on = word3 === "on";
|
|
93904
|
+
const { client } = await signedIn({ context, args });
|
|
93905
|
+
const answer6 = await client.post("/api/agents/me/workspace/billing-role", {
|
|
93906
|
+
member,
|
|
93907
|
+
billing: on
|
|
93908
|
+
});
|
|
93909
|
+
print7({
|
|
93910
|
+
context,
|
|
93911
|
+
args,
|
|
93912
|
+
answer: answer6,
|
|
93913
|
+
text: (it) => it.billing ? `${it.name} now holds the Billing role and can change the plan.
|
|
93914
|
+
` : `${it.name} no longer holds the Billing role.
|
|
93915
|
+
`
|
|
93916
|
+
});
|
|
93917
|
+
}
|
|
93729
93918
|
async function remove5({ context, args }) {
|
|
93730
93919
|
const member = args.words[2];
|
|
93731
93920
|
if (!member) throw new CliUsageError("Usage: laze members remove <member>");
|
|
@@ -93775,6 +93964,7 @@ var MEMBERS_COMMANDS = {
|
|
|
93775
93964
|
"revoke-invite": revokeInvite,
|
|
93776
93965
|
"invite-link": inviteLink,
|
|
93777
93966
|
role,
|
|
93967
|
+
billing: billing2,
|
|
93778
93968
|
aka,
|
|
93779
93969
|
remove: remove5,
|
|
93780
93970
|
requests,
|
|
@@ -93787,7 +93977,7 @@ async function members2({ context, args }) {
|
|
|
93787
93977
|
const command = MEMBERS_COMMANDS[sub];
|
|
93788
93978
|
if (!command) {
|
|
93789
93979
|
throw new CliUsageError(
|
|
93790
|
-
"Usage: laze members [invite | invites | revoke-invite | invite-link | role | aka | remove | requests | approve | deny]"
|
|
93980
|
+
"Usage: laze members [invite | invites | revoke-invite | invite-link | role | billing | aka | remove | requests | approve | deny]"
|
|
93791
93981
|
);
|
|
93792
93982
|
}
|
|
93793
93983
|
return command({ context, args });
|
|
@@ -96555,9 +96745,9 @@ async function list9({ context, args }) {
|
|
|
96555
96745
|
const answer6 = await client.get(DEDICATED_IP_REST_PATHS.all);
|
|
96556
96746
|
if (args.flags.json) return printJson7(context, answer6);
|
|
96557
96747
|
if (answer6.ips.length === 0) return context.out("No one has a dedicated IP.\n");
|
|
96558
|
-
const
|
|
96748
|
+
const money4 = (amount) => `${amount} ${answer6.currency.toUpperCase()}`;
|
|
96559
96749
|
const lines2 = answer6.ips.map(
|
|
96560
|
-
(one) => ` ${one.ownerName} ${one.country.name} ${one.state === "on" ? "on" : "being bought"} ${
|
|
96750
|
+
(one) => ` ${one.ownerName} ${one.country.name} ${one.state === "on" ? "on" : "being bought"} ${money4(one.monthlyPrice)} a month`
|
|
96561
96751
|
);
|
|
96562
96752
|
context.out(`Dedicated IPs:
|
|
96563
96753
|
${lines2.join("\n")}
|
|
@@ -98100,11 +98290,12 @@ async function memory({ context, args }) {
|
|
|
98100
98290
|
var WINDOWS = ["day", "week", "month"];
|
|
98101
98291
|
var USAGE15 = `Usage:
|
|
98102
98292
|
laze models policy whether Laze models are on, the default budget and the cap
|
|
98103
|
-
laze models set-policy [on|off] [--default-level small|frontier|none] [--default-day <
|
|
98293
|
+
laze models set-policy [on|off] [--default-level small|frontier|none] [--default-day <amount|none>] [--cap-day <amount|none>] ... (admins)
|
|
98104
98294
|
--default-level sets what agents on Default run (none: Laze Frontier, Laze's default)
|
|
98105
98295
|
--default-week, --default-month, --cap-week and --cap-month set the other windows
|
|
98106
98296
|
laze models agents each Laze-model agent's budget and spend
|
|
98107
|
-
laze models budget <agent> [--day <
|
|
98297
|
+
laze models budget <agent> [--day <amount|none>] [--week <amount|none>] [--month <amount|none>]
|
|
98298
|
+
amounts are what Laze charges, in the workspace currency
|
|
98108
98299
|
the agent's owner or an admin, up to the cap; never an agent's own key
|
|
98109
98300
|
laze models spend the workspace's spend per window, agent and channel`;
|
|
98110
98301
|
var LEVEL_LINES = {
|
|
@@ -98121,10 +98312,34 @@ function levelFrom({ args }) {
|
|
|
98121
98312
|
throw new CliUsageError(`--default-level takes small, frontier or none.
|
|
98122
98313
|
${USAGE15}`);
|
|
98123
98314
|
}
|
|
98124
|
-
var
|
|
98125
|
-
var limitsLine = (limits) => WINDOWS.map(
|
|
98126
|
-
(window2) => `${window2} ${limits[window2] === null ? "none" :
|
|
98315
|
+
var money3 = (value, currency2) => `${Number(value.toFixed(2))} ${currency2.toUpperCase()}`;
|
|
98316
|
+
var limitsLine = (limits, currency2) => WINDOWS.map(
|
|
98317
|
+
(window2) => `${window2} ${limits[window2] === null ? "none" : money3(limits[window2], currency2)}`
|
|
98127
98318
|
).join(", ");
|
|
98319
|
+
function policyLimitsOf(policy) {
|
|
98320
|
+
const { currency: currency2, chargedDefaultBudget, chargedCap } = policy;
|
|
98321
|
+
if (currency2 && chargedDefaultBudget && chargedCap) {
|
|
98322
|
+
return { currency: currency2, charged: true, defaultBudget: chargedDefaultBudget, cap: chargedCap };
|
|
98323
|
+
}
|
|
98324
|
+
return {
|
|
98325
|
+
currency: "usd",
|
|
98326
|
+
charged: false,
|
|
98327
|
+
defaultBudget: policy.defaultBudget,
|
|
98328
|
+
cap: policy.cap
|
|
98329
|
+
};
|
|
98330
|
+
}
|
|
98331
|
+
function agentLimitsOf(agent3) {
|
|
98332
|
+
if (agent3.currency && agent3.chargedBudget) {
|
|
98333
|
+
const spent = (line) => line.charged ?? line.usd;
|
|
98334
|
+
return { currency: agent3.currency, charged: true, budget: agent3.chargedBudget, spent };
|
|
98335
|
+
}
|
|
98336
|
+
return {
|
|
98337
|
+
currency: "usd",
|
|
98338
|
+
charged: false,
|
|
98339
|
+
budget: agent3.budget,
|
|
98340
|
+
spent: (line) => line.usd
|
|
98341
|
+
};
|
|
98342
|
+
}
|
|
98128
98343
|
function limitsFrom({
|
|
98129
98344
|
args,
|
|
98130
98345
|
prefix,
|
|
@@ -98137,7 +98352,7 @@ function limitsFrom({
|
|
|
98137
98352
|
if (!text3) continue;
|
|
98138
98353
|
const value = text3 === "none" ? null : Number(text3);
|
|
98139
98354
|
if (value !== null && (!Number.isFinite(value) || value < 0))
|
|
98140
|
-
throw new CliUsageError(`--${prefix}${window2} takes an amount
|
|
98355
|
+
throw new CliUsageError(`--${prefix}${window2} takes an amount or none.
|
|
98141
98356
|
${USAGE15}`);
|
|
98142
98357
|
next[window2] = value;
|
|
98143
98358
|
changed = true;
|
|
@@ -98151,9 +98366,10 @@ function printPolicy(context, policy) {
|
|
|
98151
98366
|
`);
|
|
98152
98367
|
context.out(`Default level: ${LEVEL_LINES[policy.defaultLevel ?? "none"]}
|
|
98153
98368
|
`);
|
|
98154
|
-
|
|
98369
|
+
const limits = policyLimitsOf(policy);
|
|
98370
|
+
context.out(`Default budget per agent: ${limitsLine(limits.defaultBudget, limits.currency)}
|
|
98155
98371
|
`);
|
|
98156
|
-
context.out(`Cap per agent: ${limitsLine(
|
|
98372
|
+
context.out(`Cap per agent: ${limitsLine(limits.cap, limits.currency)}
|
|
98157
98373
|
`);
|
|
98158
98374
|
}
|
|
98159
98375
|
async function showPolicy({ context, args }) {
|
|
@@ -98167,17 +98383,18 @@ async function setPolicy({ context, args }) {
|
|
|
98167
98383
|
const state = args.words[2];
|
|
98168
98384
|
if (state !== void 0 && state !== "on" && state !== "off") throw new CliUsageError(USAGE15);
|
|
98169
98385
|
const { client } = await signedIn({ context, args });
|
|
98170
|
-
const current3 = await client.get("/api/models/policy");
|
|
98386
|
+
const current3 = policyLimitsOf(await client.get("/api/models/policy"));
|
|
98171
98387
|
const defaultBudget = limitsFrom({ args, prefix: "default-", current: current3.defaultBudget });
|
|
98172
98388
|
const cap = limitsFrom({ args, prefix: "cap-", current: current3.cap });
|
|
98389
|
+
const names = current3.charged ? { defaultBudget: "chargedDefaultBudget", cap: "chargedCap" } : { defaultBudget: "defaultBudget", cap: "cap" };
|
|
98173
98390
|
const defaultLevel = levelFrom({ args });
|
|
98174
98391
|
if (!state && !defaultBudget && !cap && defaultLevel === void 0)
|
|
98175
98392
|
throw new CliUsageError(USAGE15);
|
|
98176
98393
|
const updated = await client.post("/api/models/policy", {
|
|
98177
98394
|
...state ? { lazeModels: state === "on" } : {},
|
|
98178
98395
|
...defaultLevel !== void 0 ? { defaultLevel } : {},
|
|
98179
|
-
...defaultBudget ? { defaultBudget } : {},
|
|
98180
|
-
...cap ? { cap } : {}
|
|
98396
|
+
...defaultBudget ? { [names.defaultBudget]: defaultBudget } : {},
|
|
98397
|
+
...cap ? { [names.cap]: cap } : {}
|
|
98181
98398
|
});
|
|
98182
98399
|
if (args.flags.json) return context.out(`${JSON.stringify(updated, null, 2)}
|
|
98183
98400
|
`);
|
|
@@ -98187,9 +98404,10 @@ function printAgent(context, agent3) {
|
|
|
98187
98404
|
const paused = agent3.pausedOn ? ` paused: ${agent3.pausedOn} budget reached` : "";
|
|
98188
98405
|
context.out(`${agent3.agentName} ${agent3.agentId} ${agent3.status}${paused}
|
|
98189
98406
|
`);
|
|
98190
|
-
|
|
98407
|
+
const limits = agentLimitsOf(agent3);
|
|
98408
|
+
context.out(` budget: ${limitsLine(limits.budget, limits.currency)}
|
|
98191
98409
|
`);
|
|
98192
|
-
const spent = agent3.spend.map((line) => `${line.window} ${
|
|
98410
|
+
const spent = agent3.spend.map((line) => `${line.window} ${money3(limits.spent(line), limits.currency)}`).join(", ");
|
|
98193
98411
|
if (spent) context.out(` spent: ${spent}
|
|
98194
98412
|
`);
|
|
98195
98413
|
}
|
|
@@ -98217,11 +98435,12 @@ async function setBudget({ context, args }) {
|
|
|
98217
98435
|
if (!name3) throw new CliUsageError(USAGE15);
|
|
98218
98436
|
const { client } = await signedIn({ context, args });
|
|
98219
98437
|
const agent3 = await agentNamed({ client, name: name3 });
|
|
98220
|
-
const
|
|
98438
|
+
const limits = agentLimitsOf(agent3);
|
|
98439
|
+
const next = limitsFrom({ args, prefix: "", current: limits.budget });
|
|
98221
98440
|
if (!next) throw new CliUsageError(USAGE15);
|
|
98222
98441
|
const updated = await client.post("/api/models/agents/budget", {
|
|
98223
98442
|
agentId: agent3.agentId,
|
|
98224
|
-
budget: next
|
|
98443
|
+
...limits.charged ? { chargedBudget: next } : { budget: next }
|
|
98225
98444
|
});
|
|
98226
98445
|
if (args.flags.json) return context.out(`${JSON.stringify(updated, null, 2)}
|
|
98227
98446
|
`);
|
|
@@ -98233,11 +98452,14 @@ async function showSpend({ context, args }) {
|
|
|
98233
98452
|
if (args.flags.json) return context.out(`${JSON.stringify(summaries, null, 2)}
|
|
98234
98453
|
`);
|
|
98235
98454
|
for (const summary of summaries) {
|
|
98236
|
-
|
|
98455
|
+
const charged = summary.currency !== void 0 && summary.charged !== void 0;
|
|
98456
|
+
const currency2 = charged ? summary.currency ?? "usd" : "usd";
|
|
98457
|
+
const amount = (line) => money3(charged ? line.charged ?? line.usd : line.usd, currency2);
|
|
98458
|
+
context.out(`${summary.window} ${amount(summary)}
|
|
98237
98459
|
`);
|
|
98238
|
-
for (const line of summary.byAgent) context.out(` agent ${line.id} ${
|
|
98460
|
+
for (const line of summary.byAgent) context.out(` agent ${line.id} ${amount(line)}
|
|
98239
98461
|
`);
|
|
98240
|
-
for (const line of summary.byChannel) context.out(` channel ${line.id} ${
|
|
98462
|
+
for (const line of summary.byChannel) context.out(` channel ${line.id} ${amount(line)}
|
|
98241
98463
|
`);
|
|
98242
98464
|
}
|
|
98243
98465
|
}
|
|
@@ -99039,7 +99261,9 @@ var workspaceMemberSchemaDefinition = external_exports.object({
|
|
|
99039
99261
|
/** Their picture, an uploaded or Google one; null or absent without one. */
|
|
99040
99262
|
image: external_exports.string().nullable().optional(),
|
|
99041
99263
|
/** Other names they go by in this workspace ("Also known as"); absent or empty without any. */
|
|
99042
|
-
aliases: external_exports.array(external_exports.string()).optional()
|
|
99264
|
+
aliases: external_exports.array(external_exports.string()).optional(),
|
|
99265
|
+
/** Holds the Billing role beside their role: changes the running plan; absent is false. */
|
|
99266
|
+
billing: external_exports.boolean().optional()
|
|
99043
99267
|
});
|
|
99044
99268
|
var workspaceMemberSchema = workspaceMemberSchemaDefinition;
|
|
99045
99269
|
var ALIASES_MAX_COUNT = 5;
|
|
@@ -99198,6 +99422,12 @@ var changeRoleInputSchemaDefinition = external_exports.object({
|
|
|
99198
99422
|
role: workspaceRoleSchema
|
|
99199
99423
|
});
|
|
99200
99424
|
var changeRoleInputSchema = changeRoleInputSchemaDefinition;
|
|
99425
|
+
var setBillingInputSchemaDefinition = external_exports.object({
|
|
99426
|
+
workspaceId: external_exports.string().min(1),
|
|
99427
|
+
userId: external_exports.string().min(1),
|
|
99428
|
+
billing: external_exports.boolean()
|
|
99429
|
+
});
|
|
99430
|
+
var setBillingInputSchema = setBillingInputSchemaDefinition;
|
|
99201
99431
|
var removeMemberInputSchemaDefinition2 = external_exports.object({
|
|
99202
99432
|
workspaceId: external_exports.string().min(1),
|
|
99203
99433
|
userId: external_exports.string().min(1)
|
|
@@ -99220,7 +99450,7 @@ var settingsCopy = {
|
|
|
99220
99450
|
paintOnly: true,
|
|
99221
99451
|
storable: (copy2) => copy2
|
|
99222
99452
|
};
|
|
99223
|
-
var workspaceTrpc = defineTrpcContract("workspace").mutation("create").withInput(createWorkspaceInputSchema).withOutput(workspaceCreatedSchema).query("get", { mirrored: settingsCopy }).withInput(workspaceIdInputSchema).withOutput(workspaceSchema).query("mine").withInput(external_exports.object({})).withOutput(external_exports.array(myWorkspaceSchema)).query("members").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceMemberSchema)).query("myMembership").withInput(workspaceIdInputSchema).withOutput(workspaceMemberSchema.nullable()).mutation("setMyAliases").withInput(setAliasesInputSchema).withOutput(workspaceMemberSchema).mutation("changeRole").withInput(changeRoleInputSchema).withOutput(workspaceMemberSchema).mutation("removeMember").withInput(removeMemberInputSchema2).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("leave").withInput(workspaceIdInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("invite").withInput(inviteMemberInputSchema).withOutput(workspaceInviteSchema).mutation("inviteMany").withInput(inviteManyInputSchema).withOutput(inviteManyResultSchema).mutation("requestInvites").withInput(inviteManyInputSchema).withOutput(requestInvitesResultSchema).query("invites").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceInviteSchema)).query("invitees").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceInviteeSchema)).mutation("revokeInvite").withInput(revokeInviteInputSchema).withOutput(external_exports.object({ revoked: external_exports.literal(true) })).mutation("copyInviteLink").withInput(revokeInviteInputSchema).withOutput(copiedInviteLinkSchema).query("previewInvite").withInput(inviteLinkInputSchema).withOutput(invitePreviewSchema).mutation("acceptInvite").withInput(inviteLinkInputSchema).withOutput(acceptedInviteSchema).mutation("rename").withInput(renameWorkspaceInputSchema).withOutput(workspaceSchema).mutation("setLogo").withInput(setWorkspaceLogoInputSchema).withOutput(workspaceSchema).mutation("removeLogo").withInput(workspaceIdInputSchema).withOutput(workspaceSchema).mutation("delete").withInput(deleteWorkspaceInputSchema).withOutput(workspaceSchema).mutation("cancelDeletion").withInput(workspaceIdInputSchema).withOutput(workspaceSchema).mutation("requestInvite").withInput(requestInviteInputSchema).withOutput(accessRequestSchema).query("accessRequests").withInput(workspaceIdInputSchema).withOutput(external_exports.array(accessRequestSchema)).mutation("decideAccessRequest").withInput(decideAccessRequestInputSchema).withOutput(accessRequestSchema).mutation("withdrawJoinRequest").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), requestId: external_exports.string().min(1) })).withOutput(accessRequestSchema).query("groups").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceGroupSchema)).mutation("createGroup").withInput(createGroupInputSchema).withOutput(workspaceGroupSchema).mutation("renameGroup").withInput(renameGroupInputSchema).withOutput(workspaceGroupSchema).mutation("deleteGroup").withInput(groupInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("changeGroupMembers").withInput(changeGroupMembersInputSchema).withOutput(workspaceGroupSchema).build();
|
|
99453
|
+
var workspaceTrpc = defineTrpcContract("workspace").mutation("create").withInput(createWorkspaceInputSchema).withOutput(workspaceCreatedSchema).query("get", { mirrored: settingsCopy }).withInput(workspaceIdInputSchema).withOutput(workspaceSchema).query("mine").withInput(external_exports.object({})).withOutput(external_exports.array(myWorkspaceSchema)).query("members").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceMemberSchema)).query("myMembership").withInput(workspaceIdInputSchema).withOutput(workspaceMemberSchema.nullable()).mutation("setMyAliases").withInput(setAliasesInputSchema).withOutput(workspaceMemberSchema).mutation("changeRole").withInput(changeRoleInputSchema).withOutput(workspaceMemberSchema).mutation("setBilling").withInput(setBillingInputSchema).withOutput(workspaceMemberSchema).mutation("removeMember").withInput(removeMemberInputSchema2).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("leave").withInput(workspaceIdInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("invite").withInput(inviteMemberInputSchema).withOutput(workspaceInviteSchema).mutation("inviteMany").withInput(inviteManyInputSchema).withOutput(inviteManyResultSchema).mutation("requestInvites").withInput(inviteManyInputSchema).withOutput(requestInvitesResultSchema).query("invites").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceInviteSchema)).query("invitees").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceInviteeSchema)).mutation("revokeInvite").withInput(revokeInviteInputSchema).withOutput(external_exports.object({ revoked: external_exports.literal(true) })).mutation("copyInviteLink").withInput(revokeInviteInputSchema).withOutput(copiedInviteLinkSchema).query("previewInvite").withInput(inviteLinkInputSchema).withOutput(invitePreviewSchema).mutation("acceptInvite").withInput(inviteLinkInputSchema).withOutput(acceptedInviteSchema).mutation("rename").withInput(renameWorkspaceInputSchema).withOutput(workspaceSchema).mutation("setLogo").withInput(setWorkspaceLogoInputSchema).withOutput(workspaceSchema).mutation("removeLogo").withInput(workspaceIdInputSchema).withOutput(workspaceSchema).mutation("delete").withInput(deleteWorkspaceInputSchema).withOutput(workspaceSchema).mutation("cancelDeletion").withInput(workspaceIdInputSchema).withOutput(workspaceSchema).mutation("requestInvite").withInput(requestInviteInputSchema).withOutput(accessRequestSchema).query("accessRequests").withInput(workspaceIdInputSchema).withOutput(external_exports.array(accessRequestSchema)).mutation("decideAccessRequest").withInput(decideAccessRequestInputSchema).withOutput(accessRequestSchema).mutation("withdrawJoinRequest").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), requestId: external_exports.string().min(1) })).withOutput(accessRequestSchema).query("groups").withInput(workspaceIdInputSchema).withOutput(external_exports.array(workspaceGroupSchema)).mutation("createGroup").withInput(createGroupInputSchema).withOutput(workspaceGroupSchema).mutation("renameGroup").withInput(renameGroupInputSchema).withOutput(workspaceGroupSchema).mutation("deleteGroup").withInput(groupInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("changeGroupMembers").withInput(changeGroupMembersInputSchema).withOutput(workspaceGroupSchema).build();
|
|
99224
99454
|
|
|
99225
99455
|
// ../../modules/workspace/contract/src/workspace.config.ts
|
|
99226
99456
|
var workspaceConfig = Config.define((c) => ({
|
|
@@ -100092,6 +100322,58 @@ var funnelOutputDefinition = external_exports.object({
|
|
|
100092
100322
|
buckets: external_exports.array(external_exports.object({ at: external_exports.iso.datetime(), ...funnelCountsDefinition.shape })),
|
|
100093
100323
|
totals: funnelCountsDefinition
|
|
100094
100324
|
});
|
|
100325
|
+
var cohortInputDefinition = external_exports.object({
|
|
100326
|
+
from: external_exports.iso.datetime(),
|
|
100327
|
+
to: external_exports.iso.datetime(),
|
|
100328
|
+
limit: external_exports.number().int().min(1).max(100).default(25),
|
|
100329
|
+
cursor: cursorDefinition.optional()
|
|
100330
|
+
}).strict();
|
|
100331
|
+
var cohortOutputDefinition = external_exports.object({
|
|
100332
|
+
/** Read up to this time: every count runs from the workspace's creation to here. */
|
|
100333
|
+
until: external_exports.iso.datetime(),
|
|
100334
|
+
workspaces: pageOf(
|
|
100335
|
+
external_exports.object({
|
|
100336
|
+
workspaceId: external_exports.string(),
|
|
100337
|
+
createdAt: external_exports.iso.datetime(),
|
|
100338
|
+
/** The creator's first page and campaign tag, as their sign-up kept them. */
|
|
100339
|
+
landingPath: external_exports.string().nullable(),
|
|
100340
|
+
campaign: external_exports.string().nullable(),
|
|
100341
|
+
promotionId: external_exports.string().nullable(),
|
|
100342
|
+
plan: external_exports.string(),
|
|
100343
|
+
paying: external_exports.boolean(),
|
|
100344
|
+
members: count7,
|
|
100345
|
+
agents: external_exports.object({
|
|
100346
|
+
laze: count7,
|
|
100347
|
+
connected: count7,
|
|
100348
|
+
firstLazeAgentAt: external_exports.iso.datetime().nullable()
|
|
100349
|
+
}),
|
|
100350
|
+
turns: count7,
|
|
100351
|
+
appsCreated: count7,
|
|
100352
|
+
connectionsLinked: count7,
|
|
100353
|
+
creatorLastMessageAt: external_exports.iso.datetime().nullable(),
|
|
100354
|
+
/** Live messages per UTC day; days with none are left out. */
|
|
100355
|
+
days: external_exports.array(
|
|
100356
|
+
external_exports.object({
|
|
100357
|
+
day: external_exports.string(),
|
|
100358
|
+
byPeople: count7,
|
|
100359
|
+
byAgents: count7,
|
|
100360
|
+
people: count7
|
|
100361
|
+
})
|
|
100362
|
+
),
|
|
100363
|
+
/** The once-only sends nurturing kept (first_agent_made, first_agent_nudge, ...). */
|
|
100364
|
+
lifecycle: external_exports.array(external_exports.object({ event: external_exports.string(), at: external_exports.iso.datetime() })),
|
|
100365
|
+
/** Mail sent to the creator since the workspace was made: template, state, times. */
|
|
100366
|
+
sentToCreator: external_exports.array(
|
|
100367
|
+
external_exports.object({
|
|
100368
|
+
template: external_exports.string(),
|
|
100369
|
+
state: external_exports.string(),
|
|
100370
|
+
sentAt: external_exports.iso.datetime(),
|
|
100371
|
+
updatedAt: external_exports.iso.datetime()
|
|
100372
|
+
})
|
|
100373
|
+
)
|
|
100374
|
+
})
|
|
100375
|
+
)
|
|
100376
|
+
});
|
|
100095
100377
|
var noInputDefinition = external_exports.object({}).strict();
|
|
100096
100378
|
var capacityOutputDefinition = external_exports.object({
|
|
100097
100379
|
/** The pool now; null where the process runs no pool. */
|
|
@@ -100188,6 +100470,40 @@ var tenantAgentsDefinition = external_exports.object({
|
|
|
100188
100470
|
})
|
|
100189
100471
|
)
|
|
100190
100472
|
});
|
|
100473
|
+
var tenantPeopleDefinition = external_exports.object({
|
|
100474
|
+
workspace: external_exports.object({
|
|
100475
|
+
id: external_exports.string(),
|
|
100476
|
+
name: external_exports.string(),
|
|
100477
|
+
createdByUserId: external_exports.string(),
|
|
100478
|
+
createdAt: external_exports.iso.datetime()
|
|
100479
|
+
}),
|
|
100480
|
+
members: external_exports.array(
|
|
100481
|
+
external_exports.object({
|
|
100482
|
+
userId: external_exports.string(),
|
|
100483
|
+
name: external_exports.string(),
|
|
100484
|
+
email: external_exports.string(),
|
|
100485
|
+
role: external_exports.string(),
|
|
100486
|
+
joinedAt: external_exports.iso.datetime()
|
|
100487
|
+
})
|
|
100488
|
+
),
|
|
100489
|
+
/** Invitations not accepted yet, and who sent each. */
|
|
100490
|
+
invites: external_exports.array(
|
|
100491
|
+
external_exports.object({
|
|
100492
|
+
inviteId: external_exports.string(),
|
|
100493
|
+
email: external_exports.string(),
|
|
100494
|
+
role: external_exports.string(),
|
|
100495
|
+
status: external_exports.string(),
|
|
100496
|
+
invitedByUserId: external_exports.string(),
|
|
100497
|
+
createdAt: external_exports.iso.datetime(),
|
|
100498
|
+
expiresAt: external_exports.iso.datetime()
|
|
100499
|
+
})
|
|
100500
|
+
)
|
|
100501
|
+
});
|
|
100502
|
+
var creditPausedInputDefinition = external_exports.object({
|
|
100503
|
+
limit: external_exports.number().int().min(1).max(200).default(50),
|
|
100504
|
+
cursor: cursorDefinition.optional()
|
|
100505
|
+
}).strict();
|
|
100506
|
+
var creditPausedOutputDefinition = external_exports.object({ accounts: pageOf(creditPausedAccountSchema) });
|
|
100191
100507
|
var tenantBillingDefinition = external_exports.object({
|
|
100192
100508
|
plan: external_exports.string(),
|
|
100193
100509
|
status: external_exports.string(),
|
|
@@ -100299,6 +100615,13 @@ var OPS_FUNCTIONS = {
|
|
|
100299
100615
|
input: funnelInputDefinition,
|
|
100300
100616
|
output: funnelOutputDefinition
|
|
100301
100617
|
}),
|
|
100618
|
+
"signups.cohort": entry({
|
|
100619
|
+
title: "Each workspace made in a range: source, promotion, agents, messages per day and lifecycle mail",
|
|
100620
|
+
scope: "platform",
|
|
100621
|
+
view: "table",
|
|
100622
|
+
input: cohortInputDefinition,
|
|
100623
|
+
output: cohortOutputDefinition
|
|
100624
|
+
}),
|
|
100302
100625
|
"computers.capacity": entry({
|
|
100303
100626
|
title: "Computer pool capacity and host load",
|
|
100304
100627
|
scope: "platform",
|
|
@@ -100341,6 +100664,21 @@ var OPS_FUNCTIONS = {
|
|
|
100341
100664
|
input: noInputDefinition,
|
|
100342
100665
|
output: tenantAgentsDefinition
|
|
100343
100666
|
}),
|
|
100667
|
+
"tenant.logins": entry({
|
|
100668
|
+
title: "One workspace's Claude Code and Codex logins, pools and what each agent runs on",
|
|
100669
|
+
scope: "tenant",
|
|
100670
|
+
view: "table",
|
|
100671
|
+
input: noInputDefinition,
|
|
100672
|
+
output: loginStatesSchema
|
|
100673
|
+
}),
|
|
100674
|
+
"tenant.people": entry({
|
|
100675
|
+
title: "One workspace's people: members' names, emails and join times, and pending invites",
|
|
100676
|
+
scope: "tenant",
|
|
100677
|
+
view: "table",
|
|
100678
|
+
input: noInputDefinition,
|
|
100679
|
+
output: tenantPeopleDefinition,
|
|
100680
|
+
personal: true
|
|
100681
|
+
}),
|
|
100344
100682
|
"tenant.billing": entry({
|
|
100345
100683
|
title: "One workspace's plan, credits, auto-recharge, spend by agent and invoices",
|
|
100346
100684
|
scope: "tenant",
|
|
@@ -100348,6 +100686,13 @@ var OPS_FUNCTIONS = {
|
|
|
100348
100686
|
input: noInputDefinition,
|
|
100349
100687
|
output: tenantBillingDefinition
|
|
100350
100688
|
}),
|
|
100689
|
+
"billing.credit_paused": entry({
|
|
100690
|
+
title: "Workspaces whose Laze-hosted work is paused for credits now, with card and plan",
|
|
100691
|
+
scope: "platform",
|
|
100692
|
+
view: "table",
|
|
100693
|
+
input: creditPausedInputDefinition,
|
|
100694
|
+
output: creditPausedOutputDefinition
|
|
100695
|
+
}),
|
|
100351
100696
|
"tenant.vault": entry({
|
|
100352
100697
|
title: "One workspace's vault setup: judge, level limits and connections waiting",
|
|
100353
100698
|
scope: "tenant",
|
|
@@ -103687,6 +104032,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
|
|
|
103687
104032
|
laze members invite-link <email|id> a fresh link for an invitation, shown once (admins)
|
|
103688
104033
|
laze members aka [<name>...] [--clear] the other names you go by, such as a nickname
|
|
103689
104034
|
laze members role <member> owner|admin|member|guest change a member's role (admins)
|
|
104035
|
+
laze members billing <member> on|off give or take away the Billing role (admins)
|
|
103690
104036
|
laze members remove <member> take someone out of the workspace (admins)
|
|
103691
104037
|
laze members requests | approve <id> | deny <id> access requests waiting for an admin
|
|
103692
104038
|
laze groups [list] the workspace's groups and who is in each
|
package/package.json
CHANGED