@lazehq/cli 0.1.60 → 0.1.62

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 +830 -876
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -6721,14 +6721,14 @@ var require_connect = __commonJS({
6721
6721
  const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions);
6722
6722
  timeout = timeout == null ? 1e4 : timeout;
6723
6723
  allowH2 = allowH2 != null ? allowH2 : true;
6724
- return function connect7({ hostname: hostname6, host: host2, protocol, port, servername, localAddress, httpSocket }, callback) {
6724
+ return function connect7({ hostname: hostname7, host: host2, protocol, port, servername, localAddress, httpSocket }, callback) {
6725
6725
  let socket;
6726
6726
  if (protocol === "https:") {
6727
6727
  if (!tls) {
6728
6728
  tls = __require("node:tls");
6729
6729
  }
6730
6730
  servername = servername || options.servername || util.getServerName(host2) || null;
6731
- const sessionKey = servername || hostname6;
6731
+ const sessionKey = servername || hostname7;
6732
6732
  assert2(sessionKey);
6733
6733
  const session = customSession || sessionCache.get(sessionKey) || null;
6734
6734
  port = port || 443;
@@ -6743,7 +6743,7 @@ var require_connect = __commonJS({
6743
6743
  socket: httpSocket,
6744
6744
  // upgrade socket connection
6745
6745
  port,
6746
- host: hostname6
6746
+ host: hostname7
6747
6747
  });
6748
6748
  socket.on("session", function(session2) {
6749
6749
  sessionCache.set(sessionKey, session2);
@@ -6757,16 +6757,16 @@ var require_connect = __commonJS({
6757
6757
  ...options,
6758
6758
  localAddress,
6759
6759
  port,
6760
- host: hostname6
6760
+ host: hostname7
6761
6761
  };
6762
- const family = net.isIP(hostname6);
6763
- if (family !== 0 && servername && servername !== hostname6) {
6762
+ const family = net.isIP(hostname7);
6763
+ if (family !== 0 && servername && servername !== hostname7) {
6764
6764
  connectOptions.host = servername;
6765
6765
  connectOptions.lookup = (_hostname, lookupOptions, cb) => {
6766
6766
  if (lookupOptions.all) {
6767
- cb(null, [{ address: hostname6, family }]);
6767
+ cb(null, [{ address: hostname7, family }]);
6768
6768
  } else {
6769
- cb(null, hostname6, family);
6769
+ cb(null, hostname7, family);
6770
6770
  }
6771
6771
  };
6772
6772
  }
@@ -6779,7 +6779,7 @@ var require_connect = __commonJS({
6779
6779
  const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay;
6780
6780
  socket.setKeepAlive(true, keepAliveInitialDelay);
6781
6781
  }
6782
- const clearConnectTimeout = util.setupConnectTimeout(new WeakRef(socket), { timeout, hostname: hostname6, port });
6782
+ const clearConnectTimeout = util.setupConnectTimeout(new WeakRef(socket), { timeout, hostname: hostname7, port });
6783
6783
  socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() {
6784
6784
  queueMicrotask(clearConnectTimeout);
6785
6785
  if (callback) {
@@ -6792,7 +6792,7 @@ var require_connect = __commonJS({
6792
6792
  if (callback) {
6793
6793
  const cb = callback;
6794
6794
  callback = null;
6795
- cb(maybeNormalizeConnectError(err, this, { timeout, hostname: hostname6, port }));
6795
+ cb(maybeNormalizeConnectError(err, this, { timeout, hostname: hostname7, port }));
6796
6796
  }
6797
6797
  });
6798
6798
  return socket;
@@ -13344,20 +13344,20 @@ var require_client = __commonJS({
13344
13344
  function connect7(client) {
13345
13345
  assert2(!client[kConnecting]);
13346
13346
  assert2(!client[kHTTPContext]);
13347
- let { host: host2, hostname: hostname6, protocol, port } = client[kUrl];
13348
- if (hostname6[0] === "[") {
13349
- const idx = hostname6.indexOf("]");
13347
+ let { host: host2, hostname: hostname7, protocol, port } = client[kUrl];
13348
+ if (hostname7[0] === "[") {
13349
+ const idx = hostname7.indexOf("]");
13350
13350
  assert2(idx !== -1);
13351
- const ip2 = hostname6.substring(1, idx);
13351
+ const ip2 = hostname7.substring(1, idx);
13352
13352
  assert2(net.isIPv6(ip2));
13353
- hostname6 = ip2;
13353
+ hostname7 = ip2;
13354
13354
  }
13355
13355
  client[kConnecting] = true;
13356
13356
  if (channels3.beforeConnect.hasSubscribers) {
13357
13357
  channels3.beforeConnect.publish({
13358
13358
  connectParams: {
13359
13359
  host: host2,
13360
- hostname: hostname6,
13360
+ hostname: hostname7,
13361
13361
  protocol,
13362
13362
  port,
13363
13363
  version: client[kHTTPContext]?.version,
@@ -13370,14 +13370,14 @@ var require_client = __commonJS({
13370
13370
  try {
13371
13371
  client[kConnector]({
13372
13372
  host: host2,
13373
- hostname: hostname6,
13373
+ hostname: hostname7,
13374
13374
  protocol,
13375
13375
  port,
13376
13376
  servername: client[kServerName],
13377
13377
  localAddress: client[kLocalAddress]
13378
13378
  }, (err, socket) => {
13379
13379
  if (err) {
13380
- handleConnectError(client, err, { host: host2, hostname: hostname6, protocol, port });
13380
+ handleConnectError(client, err, { host: host2, hostname: hostname7, protocol, port });
13381
13381
  client[kResume]();
13382
13382
  return;
13383
13383
  }
@@ -13391,7 +13391,7 @@ var require_client = __commonJS({
13391
13391
  client[kHTTPContext] = socket.alpnProtocol === "h2" ? connectH2(client, socket) : connectH1(client, socket);
13392
13392
  } catch (err2) {
13393
13393
  socket.destroy().on("error", noop2);
13394
- handleConnectError(client, err2, { host: host2, hostname: hostname6, protocol, port });
13394
+ handleConnectError(client, err2, { host: host2, hostname: hostname7, protocol, port });
13395
13395
  client[kResume]();
13396
13396
  return;
13397
13397
  }
@@ -13404,7 +13404,7 @@ var require_client = __commonJS({
13404
13404
  channels3.connected.publish({
13405
13405
  connectParams: {
13406
13406
  host: host2,
13407
- hostname: hostname6,
13407
+ hostname: hostname7,
13408
13408
  protocol,
13409
13409
  port,
13410
13410
  version: client[kHTTPContext]?.version,
@@ -13419,11 +13419,11 @@ var require_client = __commonJS({
13419
13419
  client[kResume]();
13420
13420
  });
13421
13421
  } catch (err) {
13422
- handleConnectError(client, err, { host: host2, hostname: hostname6, protocol, port });
13422
+ handleConnectError(client, err, { host: host2, hostname: hostname7, protocol, port });
13423
13423
  client[kResume]();
13424
13424
  }
13425
13425
  }
13426
- function handleConnectError(client, err, { host: host2, hostname: hostname6, protocol, port }) {
13426
+ function handleConnectError(client, err, { host: host2, hostname: hostname7, protocol, port }) {
13427
13427
  if (client.destroyed) {
13428
13428
  return;
13429
13429
  }
@@ -13432,7 +13432,7 @@ var require_client = __commonJS({
13432
13432
  channels3.connectError.publish({
13433
13433
  connectParams: {
13434
13434
  host: host2,
13435
- hostname: hostname6,
13435
+ hostname: hostname7,
13436
13436
  protocol,
13437
13437
  port,
13438
13438
  version: client[kHTTPContext]?.version,
@@ -15487,10 +15487,10 @@ var require_env_http_proxy_agent = __commonJS({
15487
15487
  ]);
15488
15488
  }
15489
15489
  #getProxyAgentForUrl(url2) {
15490
- let { protocol, host: hostname6, port } = url2;
15491
- hostname6 = hostname6.replace(/:\d*$/, "").replace(/^\[(.+)\]$/, "$1").toLowerCase();
15490
+ let { protocol, host: hostname7, port } = url2;
15491
+ hostname7 = hostname7.replace(/:\d*$/, "").replace(/^\[(.+)\]$/, "$1").toLowerCase();
15492
15492
  port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0;
15493
- if (!this.#shouldProxy(hostname6, port)) {
15493
+ if (!this.#shouldProxy(hostname7, port)) {
15494
15494
  return this[kNoProxyAgent];
15495
15495
  }
15496
15496
  if (protocol === "https:") {
@@ -15498,7 +15498,7 @@ var require_env_http_proxy_agent = __commonJS({
15498
15498
  }
15499
15499
  return this[kHttpProxyAgent];
15500
15500
  }
15501
- #shouldProxy(hostname6, port) {
15501
+ #shouldProxy(hostname7, port) {
15502
15502
  if (this.#noProxyChanged) {
15503
15503
  this.#parseNoProxy();
15504
15504
  }
@@ -15513,10 +15513,10 @@ var require_env_http_proxy_agent = __commonJS({
15513
15513
  if (entry.port && entry.port !== port) {
15514
15514
  continue;
15515
15515
  }
15516
- if (hostname6 === entry.hostname) {
15516
+ if (hostname7 === entry.hostname) {
15517
15517
  return false;
15518
15518
  }
15519
- if (hostname6.slice(-(entry.hostname.length + 1)) === `.${entry.hostname}`) {
15519
+ if (hostname7.slice(-(entry.hostname.length + 1)) === `.${entry.hostname}`) {
15520
15520
  return false;
15521
15521
  }
15522
15522
  }
@@ -15531,21 +15531,21 @@ var require_env_http_proxy_agent = __commonJS({
15531
15531
  if (!entry) {
15532
15532
  continue;
15533
15533
  }
15534
- let hostname6, port;
15534
+ let hostname7, port;
15535
15535
  const ipv6WithPort = entry.match(/^\[(.+)\]:(\d+)$/);
15536
15536
  if (ipv6WithPort) {
15537
- hostname6 = ipv6WithPort[1];
15537
+ hostname7 = ipv6WithPort[1];
15538
15538
  port = Number.parseInt(ipv6WithPort[2], 10);
15539
15539
  } else {
15540
15540
  const unbracketed = entry.replace(/^\[(.+)\]$/, "$1");
15541
15541
  const colonCount = (unbracketed.match(/:/g) || []).length;
15542
15542
  const parsed = colonCount === 1 && unbracketed.match(/^(.+):(\d+)$/);
15543
- hostname6 = parsed ? parsed[1] : unbracketed;
15543
+ hostname7 = parsed ? parsed[1] : unbracketed;
15544
15544
  port = parsed ? Number.parseInt(parsed[2], 10) : 0;
15545
15545
  }
15546
15546
  noProxyEntries.push({
15547
15547
  // strip leading dot or asterisk with dot
15548
- hostname: hostname6.replace(/^\*?\./, "").toLowerCase(),
15548
+ hostname: hostname7.replace(/^\*?\./, "").toLowerCase(),
15549
15549
  port
15550
15550
  });
15551
15551
  }
@@ -20012,14 +20012,14 @@ var require_dns = __commonJS({
20012
20012
  get size() {
20013
20013
  return this.#records.size;
20014
20014
  }
20015
- get(hostname6) {
20016
- return this.#records.get(hostname6) ?? null;
20015
+ get(hostname7) {
20016
+ return this.#records.get(hostname7) ?? null;
20017
20017
  }
20018
- set(hostname6, records) {
20019
- this.#records.set(hostname6, records);
20018
+ set(hostname7, records) {
20019
+ this.#records.set(hostname7, records);
20020
20020
  }
20021
- delete(hostname6) {
20022
- this.#records.delete(hostname6);
20021
+ delete(hostname7) {
20022
+ this.#records.delete(hostname7);
20023
20023
  }
20024
20024
  // Delegate to storage decide can we do more lookups or not
20025
20025
  full() {
@@ -35647,7 +35647,7 @@ function differenceInCalendarDays(later, earlier, options) {
35647
35647
  // src/config.ts
35648
35648
  import { homedir } from "node:os";
35649
35649
  import { join } from "node:path";
35650
- var DEFAULT_LAZE_URL = "https://laze.langwatch.ai";
35650
+ var DEFAULT_LAZE_URL = "https://laze.so";
35651
35651
  function harnessOf({
35652
35652
  env
35653
35653
  }) {
@@ -35883,7 +35883,7 @@ function flagText({
35883
35883
  }
35884
35884
 
35885
35885
  // src/rules/cli-version.rules.ts
35886
- var STAMPED = "0.1.60";
35886
+ var STAMPED = "0.1.62";
35887
35887
  function cliVersionOf({ stamped = STAMPED } = {}) {
35888
35888
  return stamped.startsWith("__") ? "dev" : stamped;
35889
35889
  }
@@ -38717,9 +38717,9 @@ var asciiTabOrNewline = /[\t\n\r]/g;
38717
38717
  function stripTabAndNewline(value) {
38718
38718
  return value.replace(asciiTabOrNewline, "");
38719
38719
  }
38720
- function urlHostnameOk(url2, hostname6) {
38721
- hostname6.lastIndex = 0;
38722
- return hostname6.test(url2.hostname);
38720
+ function urlHostnameOk(url2, hostname7) {
38721
+ hostname7.lastIndex = 0;
38722
+ return hostname7.test(url2.hostname);
38723
38723
  }
38724
38724
  function urlProtocolOk(url2, protocol) {
38725
38725
  protocol.lastIndex = 0;
@@ -57737,6 +57737,7 @@ var FEATURE_NAMES = [
57737
57737
  "compute",
57738
57738
  "connector",
57739
57739
  "discord",
57740
+ "download",
57740
57741
  "entitlement",
57741
57742
  "external-connection",
57742
57743
  "feature-flag",
@@ -58092,6 +58093,216 @@ var apiKeyMachineAlertSettledPayloadSchemaDefinition = external_exports.object({
58092
58093
  at: external_exports.iso.datetime()
58093
58094
  });
58094
58095
 
58096
+ // ../../packages/config/src/config.ts
58097
+ var ConfigLeaf = class {
58098
+ constructor(env, schema) {
58099
+ this.env = env;
58100
+ this.schema = schema;
58101
+ }
58102
+ env;
58103
+ schema;
58104
+ };
58105
+ var definer = {
58106
+ env: (env, schema) => new ConfigLeaf(env, schema)
58107
+ };
58108
+ var Config = {
58109
+ define(build) {
58110
+ return build(definer);
58111
+ }
58112
+ };
58113
+
58114
+ // ../../packages/config/src/env-schemas.ts
58115
+ var nodeEnvironmentSchema = external_exports.enum(["development", "test", "production"]);
58116
+ var environmentBooleanSchema = external_exports.union([external_exports.boolean(), external_exports.literal("true"), external_exports.literal("false"), external_exports.literal("1"), external_exports.literal("0")]).transform((value) => value === true || value === "true" || value === "1");
58117
+ var environmentExactOnSchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform((value) => value === true || value === "on");
58118
+ var environmentNotExactOffSchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform((value) => value !== false && value !== "off");
58119
+ var environmentOneOrTrueSchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform(
58120
+ (value) => value === true || typeof value === "string" && (value === "1" || value.toLowerCase() === "true")
58121
+ );
58122
+ var environmentPresenceSchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform((value) => value === true || typeof value === "string" && value.length > 0);
58123
+ var environmentExactOneSchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform((value) => value === true || value === "1");
58124
+ var environmentNotExactOneSchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform((value) => value !== "1");
58125
+ var environmentLegacyTruthySchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform(
58126
+ (value) => value === true || typeof value === "string" && /^(1|true|yes)$/i.test(value)
58127
+ );
58128
+
58129
+ // ../../packages/config/src/deployment-facts.ts
58130
+ var positiveInteger = external_exports.coerce.number().int().positive();
58131
+ var optionalSetting = external_exports.preprocess(
58132
+ (value) => value === "" ? void 0 : value,
58133
+ external_exports.string().min(1).optional()
58134
+ );
58135
+ var { logSettings } = Config.define((c) => ({
58136
+ logSettings: {
58137
+ LOG_LEVEL: c.env("LOG_LEVEL", optionalSetting),
58138
+ LOG_CONSOLE_LEVEL: c.env("LOG_CONSOLE_LEVEL", optionalSetting),
58139
+ LOG_OTEL_LEVEL: c.env("LOG_OTEL_LEVEL", optionalSetting),
58140
+ LOG_FORMAT: c.env("LOG_FORMAT", external_exports.enum(["pretty", "json"]).optional()),
58141
+ PINO_LOG_LEVEL: c.env("PINO_LOG_LEVEL", optionalSetting),
58142
+ _LOG_LEVEL: c.env("_LOG_LEVEL", optionalSetting),
58143
+ PINO_CONSOLE_LEVEL: c.env("PINO_CONSOLE_LEVEL", optionalSetting),
58144
+ PINO_OTEL_LEVEL: c.env("PINO_OTEL_LEVEL", optionalSetting)
58145
+ }
58146
+ }));
58147
+ var { isSaas } = Config.define((c) => ({
58148
+ isSaas: c.env("IS_SAAS", environmentOneOrTrueSchema)
58149
+ }));
58150
+ var { nodeEnvironment } = Config.define((c) => ({
58151
+ nodeEnvironment: c.env("NODE_ENV", external_exports.string().optional())
58152
+ }));
58153
+ var { rawSocketPort } = Config.define((c) => ({
58154
+ rawSocketPort: c.env("VOICE_WS_PORT", external_exports.coerce.number().int().min(0).max(65535).default(3300))
58155
+ }));
58156
+ var { outboundProxy } = Config.define((c) => ({
58157
+ outboundProxy: {
58158
+ HTTPS_PROXY: c.env("HTTPS_PROXY", external_exports.string().optional()),
58159
+ https_proxy: c.env("https_proxy", external_exports.string().optional()),
58160
+ HTTP_PROXY: c.env("HTTP_PROXY", external_exports.string().optional()),
58161
+ http_proxy: c.env("http_proxy", external_exports.string().optional()),
58162
+ NO_PROXY: c.env("NO_PROXY", external_exports.string().optional()),
58163
+ no_proxy: c.env("no_proxy", external_exports.string().optional())
58164
+ }
58165
+ }));
58166
+ var { blockLocalHttpCalls, allowedProxyHosts } = Config.define((c) => ({
58167
+ blockLocalHttpCalls: c.env("BLOCK_LOCAL_HTTP_CALLS", environmentOneOrTrueSchema),
58168
+ /** An unset allowlist is EMPTY, never a wildcard. */
58169
+ allowedProxyHosts: c.env(
58170
+ "ALLOWED_PROXY_HOSTS",
58171
+ external_exports.string().optional().transform(
58172
+ (value) => (value ?? "").split(",").map((host2) => host2.trim()).filter((host2) => host2.length > 0)
58173
+ )
58174
+ )
58175
+ }));
58176
+ var { telemetryExporterEndpoint } = Config.define((c) => ({
58177
+ telemetryExporterEndpoint: c.env(
58178
+ "OTEL_EXPORTER_OTLP_ENDPOINT",
58179
+ external_exports.preprocess((value) => value === "" ? void 0 : value, external_exports.string().min(1).optional())
58180
+ )
58181
+ }));
58182
+ var { publicBaseUrl } = Config.define((c) => ({
58183
+ publicBaseUrl: c.env(
58184
+ "BASE_HOST",
58185
+ external_exports.string().optional().transform((value) => value?.trim() || void 0)
58186
+ )
58187
+ }));
58188
+ var { publicOriginAliases } = Config.define((c) => ({
58189
+ publicOriginAliases: c.env(
58190
+ "BASE_HOST_ALIASES",
58191
+ external_exports.string().optional().transform((value) => originsOf({ list: value ?? "" }))
58192
+ )
58193
+ }));
58194
+ function originsOf({ list: list11 }) {
58195
+ const origins = list11.split(",").map((entry) => entry.trim()).filter((entry) => URL.canParse(entry)).map((entry) => new URL(entry)).filter((url2) => url2.protocol === "https:" || url2.protocol === "http:").map((url2) => url2.origin);
58196
+ return [...new Set(origins)];
58197
+ }
58198
+ var { appsDomain } = Config.define((c) => ({
58199
+ appsDomain: c.env("APPS_DOMAIN", external_exports.string().min(1).default("lazeapps.com"))
58200
+ }));
58201
+ var optionalNonBlank = external_exports.preprocess(
58202
+ (value) => value === "" ? void 0 : value,
58203
+ external_exports.string().min(1).optional()
58204
+ );
58205
+ var { grafana } = Config.define((c) => ({
58206
+ grafana: {
58207
+ baseUrl: c.env("GRAFANA_BASE_URL", optionalNonBlank),
58208
+ tempoDatasourceUid: c.env("GRAFANA_TEMPO_DATASOURCE_UID", optionalNonBlank),
58209
+ lokiDatasourceUid: c.env("GRAFANA_LOKI_DATASOURCE_UID", optionalNonBlank)
58210
+ }
58211
+ }));
58212
+ var { serviceVersion, otelResourceAttributes } = Config.define((c) => ({
58213
+ serviceVersion: c.env("SERVICE_VERSION", optionalNonBlank),
58214
+ otelResourceAttributes: c.env("OTEL_RESOURCE_ATTRIBUTES", optionalNonBlank)
58215
+ }));
58216
+ var { lazeDefaultModel } = Config.define((c) => ({
58217
+ lazeDefaultModel: c.env(
58218
+ "LAZE_DEFAULT_MODEL",
58219
+ external_exports.string().optional().transform((value) => value?.trim() || void 0)
58220
+ )
58221
+ }));
58222
+ var { gatewayPublicUrl, gatewayInternalUrl, gatewayLegacyUrl } = Config.define((c) => ({
58223
+ gatewayPublicUrl: c.env("LW_GATEWAY_PUBLIC_URL", external_exports.string().optional()),
58224
+ gatewayInternalUrl: c.env("LW_GATEWAY_INTERNAL_URL", external_exports.string().optional()),
58225
+ gatewayLegacyUrl: c.env("LW_GATEWAY_BASE_URL", external_exports.string().optional())
58226
+ }));
58227
+ var publicProviderField = external_exports.string().min(1).optional();
58228
+ var signInProviders = Config.define((c) => ({
58229
+ authProvider: c.env("AUTH_PROVIDER", publicProviderField),
58230
+ /** The NextAuth-era name for `AUTH_PROVIDER`: deprecated, still applied. */
58231
+ legacyProvider: c.env("NEXTAUTH_PROVIDER", publicProviderField),
58232
+ googleClientId: c.env("GOOGLE_CLIENT_ID", publicProviderField),
58233
+ githubClientId: c.env("GITHUB_CLIENT_ID", publicProviderField),
58234
+ gitlabClientId: c.env("GITLAB_CLIENT_ID", publicProviderField),
58235
+ azureAdClientId: c.env("AZURE_AD_CLIENT_ID", publicProviderField),
58236
+ azureAdTenantId: c.env("AZURE_AD_TENANT_ID", publicProviderField),
58237
+ auth0ClientId: c.env("AUTH0_CLIENT_ID", publicProviderField),
58238
+ auth0Issuer: c.env("AUTH0_ISSUER", publicProviderField),
58239
+ oktaClientId: c.env("OKTA_CLIENT_ID", publicProviderField),
58240
+ oktaIssuer: c.env("OKTA_ISSUER", publicProviderField),
58241
+ cognitoClientId: c.env("COGNITO_CLIENT_ID", publicProviderField),
58242
+ cognitoIssuer: c.env("COGNITO_ISSUER", publicProviderField),
58243
+ oneLoginClientId: c.env("ONELOGIN_CLIENT_ID", publicProviderField),
58244
+ oneLoginIssuer: c.env("ONELOGIN_ISSUER", publicProviderField),
58245
+ oidcClientId: c.env("OIDC_CLIENT_ID", publicProviderField),
58246
+ oidcIssuer: c.env("OIDC_ISSUER", publicProviderField)
58247
+ }));
58248
+ var { adminEmails } = Config.define((c) => ({
58249
+ adminEmails: c.env(
58250
+ "ADMIN_EMAILS",
58251
+ external_exports.string().optional().transform(
58252
+ (raw) => (raw ?? "").split(",").map((email3) => email3.trim()).filter((email3) => email3.length > 0)
58253
+ )
58254
+ )
58255
+ }));
58256
+ var { signUpMode, signUpAllowedDomains } = Config.define((c) => ({
58257
+ /** `open` admits anybody who reaches the installation; `invite_only` admits invited addresses. */
58258
+ signUpMode: c.env(
58259
+ "SIGN_UP_MODE",
58260
+ external_exports.preprocess(
58261
+ (value) => value === "" ? void 0 : value,
58262
+ external_exports.enum(["open", "invite_only"]).default("open")
58263
+ )
58264
+ ),
58265
+ /** Lowercased domains without a leading `@`; empty admits any domain. */
58266
+ signUpAllowedDomains: c.env(
58267
+ "SIGN_UP_ALLOWED_DOMAINS",
58268
+ external_exports.string().optional().transform(
58269
+ (raw) => (raw ?? "").split(",").map((domain2) => domain2.trim().toLowerCase().replace(/^@/, "")).filter((domain2) => domain2.length > 0)
58270
+ )
58271
+ )
58272
+ }));
58273
+ var { passkeysEnabled, mfaEnrollmentOpen, localPasswords } = Config.define((c) => ({
58274
+ passkeysEnabled: c.env("PASSKEYS_ENABLED", environmentNotExactOffSchema),
58275
+ mfaEnrollmentOpen: c.env("MFA_ENROLLMENT_OPEN", environmentExactOnSchema),
58276
+ localPasswords: c.env("LOCAL_PASSWORDS_ENABLED", environmentExactOnSchema)
58277
+ }));
58278
+ var { trustedIdpOrigins, idpSimulatorUrl } = Config.define((c) => ({
58279
+ trustedIdpOrigins: c.env("SSO_TRUSTED_IDP_ORIGINS", external_exports.string().optional()),
58280
+ idpSimulatorUrl: c.env("LAZE_IDPSIM_URL", external_exports.string().optional())
58281
+ }));
58282
+ var { posthogKey, posthogHost } = Config.define((c) => ({
58283
+ posthogKey: c.env("POSTHOG_KEY", external_exports.string().optional()),
58284
+ posthogHost: c.env("POSTHOG_HOST", external_exports.string().optional())
58285
+ }));
58286
+ var { foldCacheTtlSeconds } = Config.define((c) => ({
58287
+ foldCacheTtlSeconds: c.env("LAZE_FOLD_CACHE_TTL_SECONDS", positiveInteger.default(300))
58288
+ }));
58289
+ var { slackApiBase, slackWebhookBase } = Config.define((c) => ({
58290
+ slackApiBase: c.env("SLACK_API_BASE", external_exports.string().url().default("https://slack.com/api")),
58291
+ slackWebhookBase: c.env(
58292
+ "SLACK_WEBHOOK_BASE",
58293
+ external_exports.string().url().default("https://hooks.slack.com")
58294
+ )
58295
+ }));
58296
+ var { allowInsecureLocalUrls } = Config.define((c) => ({
58297
+ allowInsecureLocalUrls: c.env(
58298
+ "WEBHOOKS_UNSAFE_ALLOW_LOCAL_URLS",
58299
+ external_exports.union([external_exports.boolean(), external_exports.literal("1"), external_exports.literal("0"), external_exports.literal("")]).optional().transform((value) => value === true || value === "1")
58300
+ )
58301
+ }));
58302
+
58303
+ // ../../modules/api-key/contract/src/api-key.config.ts
58304
+ var apiKeyConfig = Config.define(() => ({ publicBaseUrl }));
58305
+
58095
58306
  // ../../modules/chat/contract/src/chat.emoji.ts
58096
58307
  var CUSTOM_EMOJI_MAX_BYTES = 256 * 1024;
58097
58308
  var CUSTOM_EMOJI_UPLOAD_MAX_BYTES = 5 * 1024 * 1024;
@@ -58296,6 +58507,41 @@ var messageLayoutSchemaDefinition = external_exports.object({
58296
58507
  });
58297
58508
  var messageLayoutSchema = messageLayoutSchemaDefinition;
58298
58509
 
58510
+ // ../../modules/chat/contract/src/chat.possible-secrets.ts
58511
+ var possibleSecretInputSchemaDefinition = external_exports.object({
58512
+ workspaceId: external_exports.string().min(1),
58513
+ messageId: external_exports.string().min(1),
58514
+ /** The `{{vault:<name>}}` the message shows: `possible-<vendor>-<8 hex>`. */
58515
+ name: external_exports.string().regex(/^possible-[a-z0-9-]+-[0-9a-f]{8}$/)
58516
+ });
58517
+ var possibleSecretInputSchema = possibleSecretInputSchemaDefinition;
58518
+ var possibleSecretSchemaDefinition = external_exports.object({
58519
+ name: external_exports.string(),
58520
+ messageId: external_exports.string(),
58521
+ channelId: external_exports.string(),
58522
+ /** The kind the detector took it for, as people say it: "OpenAI key", "Secret key". */
58523
+ kindLabel: external_exports.string(),
58524
+ /** The variable name a save suggests, such as OPENAI_API_KEY. */
58525
+ field: external_exports.string(),
58526
+ poster: external_exports.object({
58527
+ kind: external_exports.enum(["person", "agent", "external"]),
58528
+ id: external_exports.string(),
58529
+ /** The name the source gave, for a mirrored message; null for a Laze author. */
58530
+ sourceName: external_exports.string().nullable()
58531
+ }),
58532
+ /** Where it was posted, in words: "#ops, mirrored from Slack (ACME)". */
58533
+ where: external_exports.string(),
58534
+ /** slack, discord, whatsapp_business or laze when a mirror brought the message in. */
58535
+ source: external_exports.string().nullable(),
58536
+ unmasked: external_exports.boolean(),
58537
+ /** The reader may say it is not a secret: the poster, or anyone for a mirrored message. */
58538
+ mayUnmask: external_exports.boolean()
58539
+ });
58540
+ var possibleSecretSchema = possibleSecretSchemaDefinition;
58541
+ var possibleSecretValueSchemaDefinition = external_exports.object({ value: external_exports.string() });
58542
+ var possibleSecretValueSchema = possibleSecretValueSchemaDefinition;
58543
+ var chatPossibleSecretsTrpc = defineTrpcContract("chat").query("possibleSecret").withInput(possibleSecretInputSchema).withOutput(possibleSecretSchema).mutation("revealPossibleSecret").withInput(possibleSecretInputSchema).withOutput(possibleSecretValueSchema).mutation("unmaskPossibleSecret").withInput(possibleSecretInputSchema).withOutput(external_exports.object({ unmasked: external_exports.boolean() })).build();
58544
+
58299
58545
  // ../../modules/chat/contract/src/chat.presence.ts
58300
58546
  var STATUS_TEXT_MAX = 100;
58301
58547
  var idSchema = external_exports.string().min(1).max(64);
@@ -59298,7 +59544,7 @@ var postMirroredInputSchemaDefinition = external_exports.object({
59298
59544
  channelId: idSchema4,
59299
59545
  /** The Laze person behind the outside account when linked; else the outside author. */
59300
59546
  author: messageAuthorSchemaDefinition,
59301
- /** Whose vault holds a key in the text: the linked author, else whoever mirrored the channel. */
59547
+ /** The Laze person the mirror acts for: the linked author, else whoever mirrored the channel. */
59302
59548
  keyOwnerUserId: idSchema4,
59303
59549
  origin: messageOriginSchemaDefinition,
59304
59550
  body: external_exports.string().max(MESSAGE_BODY_MAX),
@@ -59314,7 +59560,7 @@ var postMirroredInputSchemaDefinition = external_exports.object({
59314
59560
  var updateMirroredInputSchemaDefinition = external_exports.object({
59315
59561
  workspaceId: workspaceIdSchema,
59316
59562
  messageId: idSchema4,
59317
- /** Whose vault holds a key in the new text: the linked author, else whoever mirrored it. */
59563
+ /** The Laze person the mirror acts for: the linked author, else whoever mirrored it. */
59318
59564
  keyOwnerUserId: idSchema4,
59319
59565
  body: external_exports.string().max(MESSAGE_BODY_MAX).optional(),
59320
59566
  /** The source's blocks and attachments now; null drops them; left out keeps them. */
@@ -59908,7 +60154,7 @@ var joinedChannelSchemaDefinition = external_exports.object({
59908
60154
  var ChatApi = moduleApi()("chat");
59909
60155
  var chatConversationsTrpc = defineTrpcContract("chat").query("overview").withInput(workspaceInputSchema).withOutput(chatOverviewSchema).query("unreadSummary").withInput(external_exports.object({})).withOutput(external_exports.array(workspaceUnreadSchema)).query("browse").withInput(workspaceInputSchema).withOutput(external_exports.array(browsableChannelSchema)).mutation("createChannel").withInput(createChannelInputSchema).withOutput(conversationSchema).mutation("join").withInput(channelInputSchema).withOutput(conversationSchema).mutation("leave").withInput(channelInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("updateChannel").withInput(updateChannelInputSchema).withOutput(conversationSchema).mutation("setDefaultAgent").withInput(setDefaultAgentInputSchema).withOutput(conversationSchema).query("logChannelHint").withInput(channelInputSchema).withOutput(logChannelHintSchema).mutation("dismissLogChannelHint").withInput(channelInputSchema).withOutput(external_exports.object({ dismissed: external_exports.literal(true) })).query("externalNotice").withInput(channelInputSchema).withOutput(externalNoticeSchema).mutation("dismissExternalNotice").withInput(dismissExternalNoticeInputSchema).withOutput(externalNoticeSchema).mutation("archiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("unarchiveChannel").withInput(channelInputSchema).withOutput(conversationSchema).mutation("addMembers").withInput(addMembersInputSchema).withOutput(conversationSchema).mutation("removeMember").withInput(removeMemberInputSchema).withOutput(conversationSchema).mutation("openDirect").withInput(openDirectInputSchema).withOutput(conversationSchema).query("conversation").withInput(channelInputSchema).withOutput(conversationSchema).build();
59910
60156
  var chatChannelRolesTrpc = defineTrpcContract("chat").mutation("setChannelRole").withInput(setChannelRoleInputSchema).withOutput(conversationSchema).mutation("extendChannel").withInput(extendChannelInputSchema).withOutput(conversationSchema).build();
59911
- var chatMessagesTrpc = defineTrpcContract("chat").query("history").withInput(historyInputSchema).withOutput(historyPageSchema).query("thread").withInput(messageInputSchema).withOutput(threadSchema).mutation("post").withInput(postMessageInputSchema).withOutput(messageSchema).mutation("forward").withInput(forwardMessageInputSchema).withOutput(messageSchema).mutation("addMentioned").withInput(addMentionedInputSchema).withOutput(messageSchema).mutation("edit").withInput(editMessageInputSchema).withOutput(messageSchema).mutation("delete").withInput(messageInputSchema).withOutput(messageSchema).mutation("remove").withInput(messageInputSchema).withOutput(messageSchema).mutation("react").withInput(reactInputSchema).withOutput(messageSchema).mutation("signalTyping").withInput(signalTypingInputSchema).withOutput(external_exports.object({ sent: external_exports.literal(true) })).mutation("markRead").withInput(markReadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).mutation("markUnread").withInput(markUnreadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).query("search").withInput(searchInputSchema).withOutput(searchResultSchema).build();
60157
+ var chatMessagesTrpc = defineTrpcContract("chat").query("history").withInput(historyInputSchema).withOutput(historyPageSchema).query("thread").withInput(messageInputSchema).withOutput(threadSchema).query("message").withInput(messageInputSchema).withOutput(messageSchema).mutation("post").withInput(postMessageInputSchema).withOutput(messageSchema).mutation("forward").withInput(forwardMessageInputSchema).withOutput(messageSchema).mutation("addMentioned").withInput(addMentionedInputSchema).withOutput(messageSchema).mutation("edit").withInput(editMessageInputSchema).withOutput(messageSchema).mutation("delete").withInput(messageInputSchema).withOutput(messageSchema).mutation("remove").withInput(messageInputSchema).withOutput(messageSchema).mutation("react").withInput(reactInputSchema).withOutput(messageSchema).mutation("signalTyping").withInput(signalTypingInputSchema).withOutput(external_exports.object({ sent: external_exports.literal(true) })).mutation("markRead").withInput(markReadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).mutation("markUnread").withInput(markUnreadInputSchema).withOutput(external_exports.object({ lastReadSeq: external_exports.number().int().nonnegative() })).query("search").withInput(searchInputSchema).withOutput(searchResultSchema).build();
59912
60158
  var chatFilesTrpc = defineTrpcContract("chat").mutation("startUpload").withInput(startUploadInputSchema).withOutput(uploadTicketSchema).mutation("completeUpload").withInput(completeUploadInputSchema).withOutput(attachmentSchema).mutation("abortUpload").withInput(fileInputSchema).withOutput(external_exports.object({ aborted: external_exports.literal(true) })).query("fileLink").withInput(fileLinkInputSchema).withOutput(fileLinkSchema).query("channelFiles").withInput(channelFilesInputSchema).withOutput(channelFilesSchema).mutation("renameAttachment").withInput(renameAttachmentInputSchema).withOutput(attachmentSchema).mutation("hideUnfurl").withInput(hideUnfurlInputSchema).withOutput(messageSchema).query("unfurlImage").withInput(unfurlImageInputSchema).withOutput(fileLinkSchema).query("searchGifs").withInput(searchGifsInputSchema).withOutput(gifResultsSchema).build();
59913
60159
  var chatFollowingTrpc = defineTrpcContract("chat").mutation("setNotify").withInput(setNotifyInputSchema).withOutput(conversationSummarySchema).mutation("hideConversation").withInput(channelInputSchema).withOutput(external_exports.object({ hidden: external_exports.literal(true) })).mutation("followThread").withInput(followThreadInputSchema).withOutput(threadFollowSchema).query("threadFollow").withInput(messageInputSchema).withOutput(threadFollowSchema).query("threads").withInput(threadsInputSchema).withOutput(threadsPageSchema).query("threadsUnread").withInput(workspaceInputSchema).withOutput(threadsUnreadSchema).query("notificationCount").withInput(workspaceInputSchema).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).mutation("markThreadRead").withInput(messageInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).mutation("pin").withInput(pinMessageInputSchema).withOutput(messageSchema).query("pins").withInput(channelInputSchema).withOutput(pinsPageSchema).query("saved").withInput(savedInputSchema).withOutput(savedPageSchema).query("savedMarks").withInput(workspaceInputSchema).withOutput(savedMarksSchema).mutation("saveMessage").withInput(saveMessageInputSchema).withOutput(savedStatusSchema).mutation("markSavedDone").withInput(markSavedDoneInputSchema).withOutput(savedStatusSchema).mutation("setReminder").withInput(setReminderInputSchema).withOutput(savedStatusSchema).query("activity").withInput(activityInputSchema).withOutput(activityPageSchema).mutation("markActivityRead").withInput(markActivityReadInputSchema).withOutput(external_exports.object({ read: external_exports.literal(true) })).build();
59914
60160
  var chatSessionTrpc = defineTrpcContract("chat").mutation("realtimeToken").withInput(workspaceInputSchema).withOutput(realtimeTokenSchema).query("drafts").withInput(workspaceInputSchema).withOutput(draftListSchema).mutation("saveDraft").withInput(saveDraftInputSchema).withOutput(draftSavedSchema).mutation("deleteDraft").withInput(deleteDraftInputSchema).withOutput(draftSavedSchema).query("sent").withInput(listSentInputSchema).withOutput(sentPageSchema).query("sidebarLayout").withInput(workspaceInputSchema).withOutput(sidebarLayoutSchema).mutation("editSidebar").withInput(editSidebarInputSchema).withOutput(sidebarLayoutSchema).mutation("star").withInput(starInputSchema).withOutput(starStatusSchema).query("starred").withInput(workspaceInputSchema).withOutput(starredListSchema).mutation("scrubSecrets").withInput(scrubChatInputSchema).withOutput(chatScrubReportSchema).mutation("restoreScrubbed").withInput(messageInputSchema).withOutput(messageSchema).build();
@@ -59924,7 +60170,8 @@ var chatTrpc = joinTrpcContracts(
59924
60170
  chatFollowingTrpc,
59925
60171
  chatSessionTrpc,
59926
60172
  chatScheduledTrpc,
59927
- chatPresenceTrpc
60173
+ chatPresenceTrpc,
60174
+ chatPossibleSecretsTrpc
59928
60175
  );
59929
60176
 
59930
60177
  // ../../modules/notification/contract/src/apns.ts
@@ -59972,7 +60219,17 @@ var apnsPayloadSchemaDefinition = external_exports.object({
59972
60219
  link: external_exports.string().startsWith("laze://").max(2048).optional(),
59973
60220
  /** The message's place in its conversation, so a later clear can match it. */
59974
60221
  seq: external_exports.number().int().nonnegative().optional(),
59975
- clear: external_exports.object({ threadId: external_exports.string().min(1).max(200), upToSeq: external_exports.number().int().nonnegative() }).strict().optional()
60222
+ clear: external_exports.object({ threadId: external_exports.string().min(1).max(200), upToSeq: external_exports.number().int().nonnegative() }).strict().optional(),
60223
+ /** Absent on an alert; "read" on the silent push a read sends. */
60224
+ type: external_exports.literal("read").optional(),
60225
+ /** The conversation an alert tells of, or a read push covers. */
60226
+ conversationId: external_exports.string().min(1).max(200).optional(),
60227
+ /** The thread's root message, when the alert or the read is in a thread. */
60228
+ threadRootId: external_exports.string().min(1).max(200).optional(),
60229
+ /** A read push: everything in the conversation (or thread) up to this seq is read. */
60230
+ readUpToSeq: external_exports.number().int().nonnegative().optional(),
60231
+ /** A read push: the person's Notifications total, the number alert pushes carry. */
60232
+ badge: external_exports.number().int().nonnegative().optional()
59976
60233
  }).strict();
59977
60234
 
59978
60235
  // ../../modules/notification/contract/src/web-push.ts
@@ -60060,6 +60317,13 @@ var emailMessageSchemaDefinition = external_exports.discriminatedUnion("template
60060
60317
  lines: external_exports.array(external_exports.string()).min(1),
60061
60318
  action: external_exports.string().min(1)
60062
60319
  }),
60320
+ /** A Laze app a person waited for is out; `url` is its store page. */
60321
+ external_exports.object({
60322
+ template: external_exports.literal("appAvailable"),
60323
+ to: external_exports.email(),
60324
+ url: external_exports.url(),
60325
+ platformName: external_exports.string().min(1).max(40)
60326
+ }),
60063
60327
  /** An app's own end user signs in: sent from the app's name, replies go to `replyTo`. */
60064
60328
  external_exports.object({
60065
60329
  template: external_exports.literal("appUserCode"),
@@ -60308,213 +60572,6 @@ var notificationTrpc = defineTrpcContract("notification").query("settings").with
60308
60572
  })
60309
60573
  ).withOutput(external_exports.object({ subscribed: external_exports.literal(true) })).mutation("unsubscribeWebPush").withInput(external_exports.object({ workspaceId: workspaceIdSchema2, endpoint: external_exports.string().min(1).max(2048) })).withOutput(external_exports.object({ unsubscribed: external_exports.literal(true) })).query("apnsStatus").withInput(workspaceInputSchema2).withOutput(apnsStatusSchema).mutation("registerApnsDevice").withInput(registerApnsDeviceInputSchema).withOutput(external_exports.object({ registered: external_exports.literal(true) })).mutation("unregisterApnsDevice").withInput(unregisterApnsDeviceInputSchema).withOutput(external_exports.object({ unregistered: external_exports.literal(true) })).build();
60310
60574
 
60311
- // ../../packages/config/src/config.ts
60312
- var ConfigLeaf = class {
60313
- constructor(env, schema) {
60314
- this.env = env;
60315
- this.schema = schema;
60316
- }
60317
- env;
60318
- schema;
60319
- };
60320
- var definer = {
60321
- env: (env, schema) => new ConfigLeaf(env, schema)
60322
- };
60323
- var Config = {
60324
- define(build) {
60325
- return build(definer);
60326
- }
60327
- };
60328
-
60329
- // ../../packages/config/src/env-schemas.ts
60330
- var nodeEnvironmentSchema = external_exports.enum(["development", "test", "production"]);
60331
- var environmentBooleanSchema = external_exports.union([external_exports.boolean(), external_exports.literal("true"), external_exports.literal("false"), external_exports.literal("1"), external_exports.literal("0")]).transform((value) => value === true || value === "true" || value === "1");
60332
- var environmentExactOnSchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform((value) => value === true || value === "on");
60333
- var environmentNotExactOffSchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform((value) => value !== false && value !== "off");
60334
- var environmentOneOrTrueSchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform(
60335
- (value) => value === true || typeof value === "string" && (value === "1" || value.toLowerCase() === "true")
60336
- );
60337
- var environmentPresenceSchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform((value) => value === true || typeof value === "string" && value.length > 0);
60338
- var environmentExactOneSchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform((value) => value === true || value === "1");
60339
- var environmentNotExactOneSchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform((value) => value !== "1");
60340
- var environmentLegacyTruthySchema = external_exports.union([external_exports.string(), external_exports.boolean()]).optional().transform(
60341
- (value) => value === true || typeof value === "string" && /^(1|true|yes)$/i.test(value)
60342
- );
60343
-
60344
- // ../../packages/config/src/deployment-facts.ts
60345
- var positiveInteger = external_exports.coerce.number().int().positive();
60346
- var optionalSetting = external_exports.preprocess(
60347
- (value) => value === "" ? void 0 : value,
60348
- external_exports.string().min(1).optional()
60349
- );
60350
- var { logSettings } = Config.define((c) => ({
60351
- logSettings: {
60352
- LOG_LEVEL: c.env("LOG_LEVEL", optionalSetting),
60353
- LOG_CONSOLE_LEVEL: c.env("LOG_CONSOLE_LEVEL", optionalSetting),
60354
- LOG_OTEL_LEVEL: c.env("LOG_OTEL_LEVEL", optionalSetting),
60355
- LOG_FORMAT: c.env("LOG_FORMAT", external_exports.enum(["pretty", "json"]).optional()),
60356
- PINO_LOG_LEVEL: c.env("PINO_LOG_LEVEL", optionalSetting),
60357
- _LOG_LEVEL: c.env("_LOG_LEVEL", optionalSetting),
60358
- PINO_CONSOLE_LEVEL: c.env("PINO_CONSOLE_LEVEL", optionalSetting),
60359
- PINO_OTEL_LEVEL: c.env("PINO_OTEL_LEVEL", optionalSetting)
60360
- }
60361
- }));
60362
- var { isSaas } = Config.define((c) => ({
60363
- isSaas: c.env("IS_SAAS", environmentOneOrTrueSchema)
60364
- }));
60365
- var { nodeEnvironment } = Config.define((c) => ({
60366
- nodeEnvironment: c.env("NODE_ENV", external_exports.string().optional())
60367
- }));
60368
- var { rawSocketPort } = Config.define((c) => ({
60369
- rawSocketPort: c.env("VOICE_WS_PORT", external_exports.coerce.number().int().min(0).max(65535).default(3300))
60370
- }));
60371
- var { outboundProxy } = Config.define((c) => ({
60372
- outboundProxy: {
60373
- HTTPS_PROXY: c.env("HTTPS_PROXY", external_exports.string().optional()),
60374
- https_proxy: c.env("https_proxy", external_exports.string().optional()),
60375
- HTTP_PROXY: c.env("HTTP_PROXY", external_exports.string().optional()),
60376
- http_proxy: c.env("http_proxy", external_exports.string().optional()),
60377
- NO_PROXY: c.env("NO_PROXY", external_exports.string().optional()),
60378
- no_proxy: c.env("no_proxy", external_exports.string().optional())
60379
- }
60380
- }));
60381
- var { blockLocalHttpCalls, allowedProxyHosts } = Config.define((c) => ({
60382
- blockLocalHttpCalls: c.env("BLOCK_LOCAL_HTTP_CALLS", environmentOneOrTrueSchema),
60383
- /** An unset allowlist is EMPTY, never a wildcard. */
60384
- allowedProxyHosts: c.env(
60385
- "ALLOWED_PROXY_HOSTS",
60386
- external_exports.string().optional().transform(
60387
- (value) => (value ?? "").split(",").map((host2) => host2.trim()).filter((host2) => host2.length > 0)
60388
- )
60389
- )
60390
- }));
60391
- var { telemetryExporterEndpoint } = Config.define((c) => ({
60392
- telemetryExporterEndpoint: c.env(
60393
- "OTEL_EXPORTER_OTLP_ENDPOINT",
60394
- external_exports.preprocess((value) => value === "" ? void 0 : value, external_exports.string().min(1).optional())
60395
- )
60396
- }));
60397
- var { publicBaseUrl } = Config.define((c) => ({
60398
- publicBaseUrl: c.env(
60399
- "BASE_HOST",
60400
- external_exports.string().optional().transform((value) => value?.trim() || void 0)
60401
- )
60402
- }));
60403
- var { publicOriginAliases } = Config.define((c) => ({
60404
- publicOriginAliases: c.env(
60405
- "BASE_HOST_ALIASES",
60406
- external_exports.string().optional().transform((value) => originsOf({ list: value ?? "" }))
60407
- )
60408
- }));
60409
- function originsOf({ list: list11 }) {
60410
- const origins = list11.split(",").map((entry) => entry.trim()).filter((entry) => URL.canParse(entry)).map((entry) => new URL(entry)).filter((url2) => url2.protocol === "https:" || url2.protocol === "http:").map((url2) => url2.origin);
60411
- return [...new Set(origins)];
60412
- }
60413
- var { appsDomain } = Config.define((c) => ({
60414
- appsDomain: c.env("APPS_DOMAIN", external_exports.string().min(1).default("lazeapps.com"))
60415
- }));
60416
- var optionalNonBlank = external_exports.preprocess(
60417
- (value) => value === "" ? void 0 : value,
60418
- external_exports.string().min(1).optional()
60419
- );
60420
- var { grafana } = Config.define((c) => ({
60421
- grafana: {
60422
- baseUrl: c.env("GRAFANA_BASE_URL", optionalNonBlank),
60423
- tempoDatasourceUid: c.env("GRAFANA_TEMPO_DATASOURCE_UID", optionalNonBlank),
60424
- lokiDatasourceUid: c.env("GRAFANA_LOKI_DATASOURCE_UID", optionalNonBlank)
60425
- }
60426
- }));
60427
- var { serviceVersion, otelResourceAttributes } = Config.define((c) => ({
60428
- serviceVersion: c.env("SERVICE_VERSION", optionalNonBlank),
60429
- otelResourceAttributes: c.env("OTEL_RESOURCE_ATTRIBUTES", optionalNonBlank)
60430
- }));
60431
- var { lazeDefaultModel } = Config.define((c) => ({
60432
- lazeDefaultModel: c.env(
60433
- "LAZE_DEFAULT_MODEL",
60434
- external_exports.string().optional().transform((value) => value?.trim() || void 0)
60435
- )
60436
- }));
60437
- var { gatewayPublicUrl, gatewayInternalUrl, gatewayLegacyUrl } = Config.define((c) => ({
60438
- gatewayPublicUrl: c.env("LW_GATEWAY_PUBLIC_URL", external_exports.string().optional()),
60439
- gatewayInternalUrl: c.env("LW_GATEWAY_INTERNAL_URL", external_exports.string().optional()),
60440
- gatewayLegacyUrl: c.env("LW_GATEWAY_BASE_URL", external_exports.string().optional())
60441
- }));
60442
- var publicProviderField = external_exports.string().min(1).optional();
60443
- var signInProviders = Config.define((c) => ({
60444
- authProvider: c.env("AUTH_PROVIDER", publicProviderField),
60445
- /** The NextAuth-era name for `AUTH_PROVIDER`: deprecated, still applied. */
60446
- legacyProvider: c.env("NEXTAUTH_PROVIDER", publicProviderField),
60447
- googleClientId: c.env("GOOGLE_CLIENT_ID", publicProviderField),
60448
- githubClientId: c.env("GITHUB_CLIENT_ID", publicProviderField),
60449
- gitlabClientId: c.env("GITLAB_CLIENT_ID", publicProviderField),
60450
- azureAdClientId: c.env("AZURE_AD_CLIENT_ID", publicProviderField),
60451
- azureAdTenantId: c.env("AZURE_AD_TENANT_ID", publicProviderField),
60452
- auth0ClientId: c.env("AUTH0_CLIENT_ID", publicProviderField),
60453
- auth0Issuer: c.env("AUTH0_ISSUER", publicProviderField),
60454
- oktaClientId: c.env("OKTA_CLIENT_ID", publicProviderField),
60455
- oktaIssuer: c.env("OKTA_ISSUER", publicProviderField),
60456
- cognitoClientId: c.env("COGNITO_CLIENT_ID", publicProviderField),
60457
- cognitoIssuer: c.env("COGNITO_ISSUER", publicProviderField),
60458
- oneLoginClientId: c.env("ONELOGIN_CLIENT_ID", publicProviderField),
60459
- oneLoginIssuer: c.env("ONELOGIN_ISSUER", publicProviderField),
60460
- oidcClientId: c.env("OIDC_CLIENT_ID", publicProviderField),
60461
- oidcIssuer: c.env("OIDC_ISSUER", publicProviderField)
60462
- }));
60463
- var { adminEmails } = Config.define((c) => ({
60464
- adminEmails: c.env(
60465
- "ADMIN_EMAILS",
60466
- external_exports.string().optional().transform(
60467
- (raw) => (raw ?? "").split(",").map((email3) => email3.trim()).filter((email3) => email3.length > 0)
60468
- )
60469
- )
60470
- }));
60471
- var { signUpMode, signUpAllowedDomains } = Config.define((c) => ({
60472
- /** `open` admits anybody who reaches the installation; `invite_only` admits invited addresses. */
60473
- signUpMode: c.env(
60474
- "SIGN_UP_MODE",
60475
- external_exports.preprocess(
60476
- (value) => value === "" ? void 0 : value,
60477
- external_exports.enum(["open", "invite_only"]).default("open")
60478
- )
60479
- ),
60480
- /** Lowercased domains without a leading `@`; empty admits any domain. */
60481
- signUpAllowedDomains: c.env(
60482
- "SIGN_UP_ALLOWED_DOMAINS",
60483
- external_exports.string().optional().transform(
60484
- (raw) => (raw ?? "").split(",").map((domain2) => domain2.trim().toLowerCase().replace(/^@/, "")).filter((domain2) => domain2.length > 0)
60485
- )
60486
- )
60487
- }));
60488
- var { passkeysEnabled, mfaEnrollmentOpen, localPasswords } = Config.define((c) => ({
60489
- passkeysEnabled: c.env("PASSKEYS_ENABLED", environmentNotExactOffSchema),
60490
- mfaEnrollmentOpen: c.env("MFA_ENROLLMENT_OPEN", environmentExactOnSchema),
60491
- localPasswords: c.env("LOCAL_PASSWORDS_ENABLED", environmentExactOnSchema)
60492
- }));
60493
- var { trustedIdpOrigins, idpSimulatorUrl } = Config.define((c) => ({
60494
- trustedIdpOrigins: c.env("SSO_TRUSTED_IDP_ORIGINS", external_exports.string().optional()),
60495
- idpSimulatorUrl: c.env("LAZE_IDPSIM_URL", external_exports.string().optional())
60496
- }));
60497
- var { posthogKey, posthogHost } = Config.define((c) => ({
60498
- posthogKey: c.env("POSTHOG_KEY", external_exports.string().optional()),
60499
- posthogHost: c.env("POSTHOG_HOST", external_exports.string().optional())
60500
- }));
60501
- var { foldCacheTtlSeconds } = Config.define((c) => ({
60502
- foldCacheTtlSeconds: c.env("LAZE_FOLD_CACHE_TTL_SECONDS", positiveInteger.default(300))
60503
- }));
60504
- var { slackApiBase, slackWebhookBase } = Config.define((c) => ({
60505
- slackApiBase: c.env("SLACK_API_BASE", external_exports.string().url().default("https://slack.com/api")),
60506
- slackWebhookBase: c.env(
60507
- "SLACK_WEBHOOK_BASE",
60508
- external_exports.string().url().default("https://hooks.slack.com")
60509
- )
60510
- }));
60511
- var { allowInsecureLocalUrls } = Config.define((c) => ({
60512
- allowInsecureLocalUrls: c.env(
60513
- "WEBHOOKS_UNSAFE_ALLOW_LOCAL_URLS",
60514
- external_exports.union([external_exports.boolean(), external_exports.literal("1"), external_exports.literal("0"), external_exports.literal("")]).optional().transform((value) => value === true || value === "1")
60515
- )
60516
- }));
60517
-
60518
60575
  // ../../modules/notification/contract/src/notification.config.ts
60519
60576
  var notificationConfig = Config.define((c) => ({
60520
60577
  emailProvider: c.env("EMAIL_PROVIDER", external_exports.enum(["scaleway-tem", "smtp"]).default("smtp")),
@@ -60991,6 +61048,7 @@ var ChatPlaceHooksToken = chatUi.hooks("place");
60991
61048
  var ChatPresenceHooksToken = chatUi.hooks("presence");
60992
61049
  var ChatStatusDialogSlot = chatUi.component("status-dialog");
60993
61050
  var ChatExternalPersonCardSlot = chatUi.extension("external-person-card");
61051
+ var ChatNewChannelDialogSlot = chatUi.component("new-channel-dialog");
60994
61052
 
60995
61053
  // ../../modules/chat/contract/src/chat.text.ts
60996
61054
  function withoutMarkdownMarks(text2) {
@@ -61166,6 +61224,7 @@ var vaultSealedApprovalSchema = vaultSealedApprovalSchemaDefinition;
61166
61224
  var vaultUi = uiTokens("vault");
61167
61225
  var VaultSealedApprovalSlot = vaultUi.component("sealedApproval");
61168
61226
  var VaultShareApprovalSlot = vaultUi.component("shareApproval");
61227
+ var VaultMachineKeyApprovalSlot = vaultUi.component("machineKeyApproval");
61169
61228
  var VaultPasskeyStepSlot = vaultUi.component("passkeyStep");
61170
61229
  var VaultNavSlot = vaultUi.component("nav");
61171
61230
  var answerSealedApprovalInputSchemaDefinition = external_exports.object({
@@ -61551,6 +61610,29 @@ var approveVaultShareInputSchemaDefinition = external_exports.object({
61551
61610
  reauthToken: external_exports.string().min(1)
61552
61611
  });
61553
61612
  var approveVaultShareInputSchema = approveVaultShareInputSchemaDefinition;
61613
+ var approveVaultMachineKeyInputSchemaDefinition = external_exports.object({
61614
+ workspaceId: external_exports.string().min(1),
61615
+ apiKeyId: external_exports.string().min(1),
61616
+ reauthToken: external_exports.string().min(1)
61617
+ });
61618
+ var approveVaultMachineKeyInputSchema = approveVaultMachineKeyInputSchemaDefinition;
61619
+ var approvedVaultMachineKeySchemaDefinition = external_exports.object({
61620
+ /** When the key needs the owner's passkey again. */
61621
+ recheckDueAt: external_exports.string().nullable()
61622
+ });
61623
+ var approvedVaultMachineKeySchema = approvedVaultMachineKeySchemaDefinition;
61624
+ var vaultReadLockSchemaDefinition = external_exports.object({
61625
+ locked: external_exports.boolean(),
61626
+ /** The CLI key whose burst locked them, as it named itself; null when not locked. */
61627
+ clientName: external_exports.string().nullable(),
61628
+ lockedAt: external_exports.iso.datetime().nullable()
61629
+ });
61630
+ var vaultReadLockSchema = vaultReadLockSchemaDefinition;
61631
+ var unlockVaultReadsInputSchemaDefinition = external_exports.object({
61632
+ workspaceId: external_exports.string().min(1),
61633
+ reauthToken: external_exports.string().min(1)
61634
+ });
61635
+ var unlockVaultReadsInputSchema = unlockVaultReadsInputSchemaDefinition;
61554
61636
  var revokeVaultGrantInputSchemaDefinition = external_exports.object({
61555
61637
  workspaceId: external_exports.string().min(1),
61556
61638
  grantId: external_exports.string().min(1),
@@ -61594,7 +61676,9 @@ var openVaultTurnInputSchemaDefinition = external_exports.object({
61594
61676
  kind: vaultAgentKindSchema,
61595
61677
  ownerUserId: external_exports.string().min(1),
61596
61678
  /** The login pool the agent draws its harness login from; only that pool's logins reach. */
61597
- loginPoolId: external_exports.string().min(1).nullable().default(null)
61679
+ loginPoolId: external_exports.string().min(1).nullable().default(null),
61680
+ /** A session outside Laze, which has no agent record: how its cards name it. */
61681
+ label: external_exports.string().max(300).nullish()
61598
61682
  }),
61599
61683
  requesterUserId: external_exports.string().min(1),
61600
61684
  requesterGroupIds: external_exports.array(external_exports.string().min(1)).default([]),
@@ -61740,7 +61824,9 @@ var vaultApprovalRequestSchemaDefinition = external_exports.object({
61740
61824
  /** The longest lease Allow for this agent offers; null offers only once and deny. */
61741
61825
  maxLeaseSeconds: external_exports.number().int().positive().nullable().default(null),
61742
61826
  /** Allow covers the rest of the agent's turn ("Allow for this task"), not one command. */
61743
- coversTask: external_exports.boolean().optional()
61827
+ coversTask: external_exports.boolean().optional(),
61828
+ /** Who asks when it is a session outside Laze, not an agent: "Claude Code session on pat-mac". */
61829
+ agentLabel: external_exports.string().nullable().optional()
61744
61830
  });
61745
61831
  var vaultApprovalRequestSchema = vaultApprovalRequestSchemaDefinition;
61746
61832
  var answerVaultApprovalInputSchemaDefinition = external_exports.object({
@@ -61958,7 +62044,7 @@ var vaultTrpc = defineTrpcContract("vault").mutation("createConnection").withInp
61958
62044
  reason: external_exports.string().trim().min(1).max(200),
61959
62045
  reauthToken: external_exports.string().min(1).max(200).optional()
61960
62046
  })
61961
- ).withOutput(external_exports.object({ fields: external_exports.record(external_exports.string(), external_exports.string()) })).mutation("beginReauth").withInput(workspaceInput).withOutput(vaultReauthChallengeSchema).mutation("confirmReauth").withInput(confirmVaultReauthInputSchema).withOutput(vaultReauthProofSchema).mutation("grantConnection").withInput(grantVaultConnectionInputSchema).withOutput(vaultGrantSchema).mutation("lendToChannel").withInput(lendVaultConnectionInputSchema).withOutput(vaultGrantSchema).mutation("revokeGrant").withInput(revokeVaultGrantInputSchema).withOutput(external_exports.object({ revoked: external_exports.literal(true) })).query("listGrants").withInput(connectionInput).withOutput(external_exports.array(vaultGrantSchema)).mutation("shareConnection").withInput(shareVaultConnectionInputSchema).withOutput(vaultGrantSchema).mutation("approveShare").withInput(approveVaultShareInputSchema).withOutput(vaultGrantSchema).mutation("sealConnection").withInput(sealVaultConnectionInputSchema).withOutput(vaultConnectionSchema).query("listApprovals").withInput(external_exports.object({ ...workspaceInput.shape, state: vaultApprovalListStateSchema.optional() })).withOutput(external_exports.array(vaultApprovalRequestSchema)).mutation("answerApproval").withInput(answerVaultApprovalInputSchema).withOutput(vaultApprovalRequestSchema).query("listAudit").withInput(vaultAuditReadInputSchema).withOutput(vaultAuditPageSchema).query("listActivity").withInput(vaultAuditReadInputSchema).withOutput(external_exports.array(vaultAuditEntrySchema)).query("listLeases").withInput(workspaceInput).withOutput(external_exports.array(vaultLeaseSchema)).mutation("endLease").withInput(endVaultLeaseInputSchema).withOutput(external_exports.object({ ended: external_exports.literal(true) })).query("mostAsked").withInput(vaultMostAskedInputSchema).withOutput(vaultMostAskedSchema).query("judgeStatus").withInput(workspaceInput).withOutput(vaultJudgeStatusSchema).query("listLevelLimits").withInput(workspaceInput).withOutput(external_exports.array(vaultLevelLimitSchema)).mutation("setLevelLimit").withInput(setVaultLevelLimitInputSchema).withOutput(external_exports.array(vaultLevelLimitSchema)).query("listDevices").withInput(workspaceInput).withOutput(external_exports.array(vaultDeviceSchema)).mutation("beginDeviceEnrolment").withInput(workspaceInput).withOutput(vaultDeviceEnrolmentSchema).mutation("finishDeviceEnrolment").withInput(finishVaultDeviceEnrolmentInputSchema).withOutput(vaultDeviceSchema).mutation("beginDeviceApproval").withInput(external_exports.object({ ...workspaceInput.shape, deviceId: external_exports.string().min(1) })).withOutput(external_exports.object({ challenge: external_exports.string(), sealed: external_exports.array(vaultSealedMaterialSchema) })).mutation("approveDevice").withInput(approveVaultDeviceInputSchema).withOutput(vaultDeviceSchema).mutation("removeDevice").withInput(external_exports.object({ ...workspaceInput.shape, deviceId: external_exports.string().min(1) })).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("createSealedConnection").withInput(createSealedConnectionInputSchema).withOutput(vaultConnectionSchema).mutation("resealConnection").withInput(resealConnectionInputSchema).withOutput(vaultConnectionSchema).mutation("openSealedConnection").withInput(
62047
+ ).withOutput(external_exports.object({ fields: external_exports.record(external_exports.string(), external_exports.string()) })).mutation("beginReauth").withInput(workspaceInput).withOutput(vaultReauthChallengeSchema).mutation("confirmReauth").withInput(confirmVaultReauthInputSchema).withOutput(vaultReauthProofSchema).mutation("grantConnection").withInput(grantVaultConnectionInputSchema).withOutput(vaultGrantSchema).mutation("lendToChannel").withInput(lendVaultConnectionInputSchema).withOutput(vaultGrantSchema).mutation("revokeGrant").withInput(revokeVaultGrantInputSchema).withOutput(external_exports.object({ revoked: external_exports.literal(true) })).query("listGrants").withInput(connectionInput).withOutput(external_exports.array(vaultGrantSchema)).mutation("shareConnection").withInput(shareVaultConnectionInputSchema).withOutput(vaultGrantSchema).mutation("approveShare").withInput(approveVaultShareInputSchema).withOutput(vaultGrantSchema).mutation("approveMachineKey").withInput(approveVaultMachineKeyInputSchema).withOutput(approvedVaultMachineKeySchema).query("readLock").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(vaultReadLockSchema).mutation("unlockReads").withInput(unlockVaultReadsInputSchema).withOutput(vaultReadLockSchema).mutation("sealConnection").withInput(sealVaultConnectionInputSchema).withOutput(vaultConnectionSchema).query("listApprovals").withInput(external_exports.object({ ...workspaceInput.shape, state: vaultApprovalListStateSchema.optional() })).withOutput(external_exports.array(vaultApprovalRequestSchema)).mutation("answerApproval").withInput(answerVaultApprovalInputSchema).withOutput(vaultApprovalRequestSchema).query("listAudit").withInput(vaultAuditReadInputSchema).withOutput(vaultAuditPageSchema).query("listActivity").withInput(vaultAuditReadInputSchema).withOutput(external_exports.array(vaultAuditEntrySchema)).query("listLeases").withInput(workspaceInput).withOutput(external_exports.array(vaultLeaseSchema)).mutation("endLease").withInput(endVaultLeaseInputSchema).withOutput(external_exports.object({ ended: external_exports.literal(true) })).query("mostAsked").withInput(vaultMostAskedInputSchema).withOutput(vaultMostAskedSchema).query("judgeStatus").withInput(workspaceInput).withOutput(vaultJudgeStatusSchema).query("listLevelLimits").withInput(workspaceInput).withOutput(external_exports.array(vaultLevelLimitSchema)).mutation("setLevelLimit").withInput(setVaultLevelLimitInputSchema).withOutput(external_exports.array(vaultLevelLimitSchema)).query("listDevices").withInput(workspaceInput).withOutput(external_exports.array(vaultDeviceSchema)).mutation("beginDeviceEnrolment").withInput(workspaceInput).withOutput(vaultDeviceEnrolmentSchema).mutation("finishDeviceEnrolment").withInput(finishVaultDeviceEnrolmentInputSchema).withOutput(vaultDeviceSchema).mutation("beginDeviceApproval").withInput(external_exports.object({ ...workspaceInput.shape, deviceId: external_exports.string().min(1) })).withOutput(external_exports.object({ challenge: external_exports.string(), sealed: external_exports.array(vaultSealedMaterialSchema) })).mutation("approveDevice").withInput(approveVaultDeviceInputSchema).withOutput(vaultDeviceSchema).mutation("removeDevice").withInput(external_exports.object({ ...workspaceInput.shape, deviceId: external_exports.string().min(1) })).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("createSealedConnection").withInput(createSealedConnectionInputSchema).withOutput(vaultConnectionSchema).mutation("resealConnection").withInput(resealConnectionInputSchema).withOutput(vaultConnectionSchema).mutation("openSealedConnection").withInput(
61962
62048
  external_exports.object({
61963
62049
  ...connectionInput.shape,
61964
62050
  reason: external_exports.string().trim().min(1).max(200),
@@ -61969,12 +62055,12 @@ var vaultTrpc = defineTrpcContract("vault").mutation("createConnection").withInp
61969
62055
  // ../../modules/vault/contract/src/vault.config.ts
61970
62056
  var positiveInt = external_exports.coerce.number().int().positive();
61971
62057
  var vaultConfig = Config.define((c) => ({
61972
- approvalTimeoutMinutes: c.env("VAULT_APPROVAL_TIMEOUT_MINUTES", positiveInt.default(720)),
62058
+ approvalTimeoutMinutes: c.env("VAULT_APPROVAL_TIMEOUT_MINUTES", positiveInt.default(1440)),
61973
62059
  /** How long an approve-once answer waits for the same ask to come back for it. */
61974
62060
  approveOnceWindowMinutes: c.env("VAULT_APPROVE_ONCE_WINDOW_MINUTES", positiveInt.default(10)),
61975
62061
  /** The lease cap when an admin set none on the connection. */
61976
62062
  defaultMaxLeaseHours: c.env("VAULT_DEFAULT_MAX_LEASE_HOURS", positiveInt.default(48)),
61977
- turnTtlMinutes: c.env("VAULT_TURN_TTL_MINUTES", positiveInt.default(720)),
62063
+ turnTtlMinutes: c.env("VAULT_TURN_TTL_MINUTES", positiveInt.default(1440)),
61978
62064
  /** The judge runs only when this is on and its key is set; off, Checked asks a person. */
61979
62065
  judgeEnabled: c.env("VAULT_JUDGE_ENABLED", environmentBooleanSchema.default(false)),
61980
62066
  judgeTimeoutMs: c.env("VAULT_JUDGE_TIMEOUT_MS", positiveInt.default(2e4)),
@@ -62083,7 +62169,9 @@ var vaultApprovalRequestedPayloadSchemaDefinition = external_exports.object({
62083
62169
  /** Allow covers the rest of the agent's turn ("Allow for this task"), not one command. */
62084
62170
  coversTask: external_exports.boolean().optional(),
62085
62171
  /** What a task card's Allow covers when it is wider than one turn: "this session of ...". */
62086
- taskScope: external_exports.string().nullable().optional()
62172
+ taskScope: external_exports.string().nullable().optional(),
62173
+ /** Who asks when it is a session outside Laze, not an agent: "Claude Code session on pat-mac". */
62174
+ agentLabel: external_exports.string().nullable().optional()
62087
62175
  });
62088
62176
  var vaultApprovalResolvedPayloadSchemaDefinition = external_exports.object({
62089
62177
  workspaceId: external_exports.string().min(1),
@@ -62389,28 +62477,26 @@ var vaultAlertRaisedPayloadSchemaDefinition = external_exports.object({
62389
62477
  at: external_exports.iso.datetime()
62390
62478
  });
62391
62479
 
62392
- // ../../modules/vault/contract/src/vault-reference-chip.ts
62393
- var VaultReferenceChipSlot = uiTokens("vault").component("referenceChip");
62394
- var VaultMessageFootSlot = uiTokens("vault").component("messageFoot");
62395
- var REFERENCE = /\{\{vault:([A-Za-z0-9_][A-Za-z0-9_./:-]*)\}\}/g;
62396
- function vaultReferenceNames({ text: text2 }) {
62397
- return [...new Set([...text2.matchAll(REFERENCE)].map((match) => match[1] ?? ""))].filter(
62398
- (name3) => name3 !== ""
62399
- );
62400
- }
62401
- function vaultReferenceConnectionName({ name: name3 }) {
62402
- return name3.split(".")[0] ?? name3;
62403
- }
62404
-
62405
62480
  // ../../modules/vault/contract/src/vault-pending.ts
62406
62481
  var connectionName2 = external_exports.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/);
62482
+ var VAULT_HOLD_MAX_TEXTS = 64;
62407
62483
  var holdPastedSecretsInputSchemaDefinition = external_exports.object({
62408
62484
  workspaceId: external_exports.string().min(1),
62409
62485
  senderUserId: external_exports.string().min(1),
62410
62486
  channelId: external_exports.string().min(1),
62411
62487
  /** The message the text belongs to; only its own delivery opens what it held. */
62412
62488
  messageId: external_exports.string().min(1),
62413
- texts: external_exports.array(external_exports.string().max(VAULT_SCRUB_MAX_TEXT)).min(1).max(64)
62489
+ texts: external_exports.array(external_exports.string().max(VAULT_SCRUB_MAX_TEXT)).min(1).max(VAULT_HOLD_MAX_TEXTS),
62490
+ /**
62491
+ * `pending`: new keys go to the sender's vault. `possible`: the text is someone else's (a
62492
+ * mirror brought it in), so new keys are saved nowhere and come back as possible secrets.
62493
+ */
62494
+ found: external_exports.enum(["pending", "possible"]).default("pending"),
62495
+ /**
62496
+ * Seals each run of many flagged values (a stack trace, a log) as one redacted block, returned
62497
+ * in `possible` and saved in no vault. Chat messages ask for it; other texts hold per value.
62498
+ */
62499
+ blocks: external_exports.boolean().default(false)
62414
62500
  });
62415
62501
  var vaultPendingSecretSchemaDefinition = external_exports.object({
62416
62502
  pendingId: external_exports.string().min(1),
@@ -62421,12 +62507,23 @@ var vaultPendingSecretSchemaDefinition = external_exports.object({
62421
62507
  /** The connection's one field, such as `OPENAI_API_KEY`. */
62422
62508
  field: external_exports.string().min(1)
62423
62509
  });
62510
+ var vaultPossibleSecretSchemaDefinition = external_exports.object({
62511
+ name: connectionName2,
62512
+ value: external_exports.string().min(1),
62513
+ vendor: external_exports.string().min(1),
62514
+ field: external_exports.string().min(1)
62515
+ });
62424
62516
  var vaultHeldSecretsSchemaDefinition = external_exports.object({
62425
62517
  texts: external_exports.array(external_exports.string()),
62426
62518
  changed: external_exports.boolean(),
62427
62519
  /** Values the vault already held, now references. */
62428
62520
  held: external_exports.number().int().nonnegative(),
62429
- pending: external_exports.array(vaultPendingSecretSchemaDefinition)
62521
+ pending: external_exports.array(vaultPendingSecretSchemaDefinition),
62522
+ /**
62523
+ * With `found: "possible"`: each flagged value once, as its `{{vault:NAME}}` in `texts`. With
62524
+ * `blocks`: each redacted block too, in either mode.
62525
+ */
62526
+ possible: external_exports.array(vaultPossibleSecretSchemaDefinition).optional()
62430
62527
  });
62431
62528
  var vaultRevealRecipientSchemaDefinition = external_exports.discriminatedUnion("kind", [
62432
62529
  external_exports.object({ kind: external_exports.literal("laze_agent"), agentId: external_exports.string().min(1) }),
@@ -62491,6 +62588,114 @@ var vaultPendingSecretReleasedPayloadSchemaDefinition = external_exports.object(
62491
62588
  text: external_exports.string().min(1).max(VAULT_SCRUB_MAX_TEXT),
62492
62589
  at: external_exports.iso.datetime()
62493
62590
  });
62591
+ var vaultPendingKeepReasonSchema = external_exports.enum(["named", "used", "shared", "sealed"]);
62592
+
62593
+ // ../../modules/vault/contract/src/vault-redacted-block.ts
62594
+ var REDACTED_BLOCK_MIN_VALUES = 3;
62595
+ var REDACTED_BLOCK_MIN_LINES = 2;
62596
+ var REDACTED_BLOCK_MAX_GAP = 3;
62597
+ var FENCE = /^\s*(?:>\s?)*(`{3,}|~{3,})/;
62598
+ var BLANK = /^\s*(?:>\s*)*$/;
62599
+ function segmentsOf({ lines: lines2 }) {
62600
+ const out = [];
62601
+ let open4 = null;
62602
+ let fence = null;
62603
+ const close = (end) => {
62604
+ if (open4 && end >= open4.start) out.push({ start: open4.start, end, fenced: open4.fenced });
62605
+ open4 = null;
62606
+ };
62607
+ lines2.forEach((line, index) => {
62608
+ const marker = FENCE.exec(line)?.[1];
62609
+ if (fence !== null) {
62610
+ if (marker && marker[0] === fence[0] && marker.length >= fence.length) {
62611
+ close(index - 1);
62612
+ fence = null;
62613
+ } else if (!open4) open4 = { start: index, fenced: true };
62614
+ return;
62615
+ }
62616
+ if (marker) {
62617
+ close(index - 1);
62618
+ fence = marker;
62619
+ return;
62620
+ }
62621
+ if (BLANK.test(line)) close(index - 1);
62622
+ else if (!open4) open4 = { start: index, fenced: false };
62623
+ });
62624
+ close(lines2.length - 1);
62625
+ return out;
62626
+ }
62627
+ function clustersIn({
62628
+ segment,
62629
+ flagged
62630
+ }) {
62631
+ const out = [];
62632
+ let current2 = null;
62633
+ for (let index = segment.start; index <= segment.end; index += 1) {
62634
+ const count5 = flagged[index] ?? 0;
62635
+ if (count5 === 0) continue;
62636
+ if (current2 && index - current2.end - 1 <= REDACTED_BLOCK_MAX_GAP) {
62637
+ current2.end = index;
62638
+ current2.values += count5;
62639
+ continue;
62640
+ }
62641
+ if (current2) out.push(current2);
62642
+ current2 = { start: index, end: index, values: count5 };
62643
+ }
62644
+ if (current2) out.push(current2);
62645
+ return out;
62646
+ }
62647
+ function redactedBlocks({
62648
+ lines: lines2,
62649
+ flagged
62650
+ }) {
62651
+ const out = [];
62652
+ for (const segment of segmentsOf({ lines: lines2 })) {
62653
+ for (const cluster of clustersIn({ segment, flagged })) {
62654
+ const span = cluster.end - cluster.start + 1;
62655
+ if (cluster.values < REDACTED_BLOCK_MIN_VALUES || span < REDACTED_BLOCK_MIN_LINES) continue;
62656
+ const whole = segment.fenced && cluster.start === segment.start && cluster.end === segment.end;
62657
+ const closed = whole && FENCE.test(lines2[segment.end + 1] ?? "");
62658
+ out.push(closed ? { ...cluster, start: cluster.start - 1, end: cluster.end + 1 } : cluster);
62659
+ }
62660
+ }
62661
+ return out;
62662
+ }
62663
+ function redactedBlocksAt({
62664
+ text: text2,
62665
+ offsets
62666
+ }) {
62667
+ const lines2 = text2.split("\n");
62668
+ const starts = [];
62669
+ let at = 0;
62670
+ for (const line of lines2) {
62671
+ starts.push(at);
62672
+ at += line.length + 1;
62673
+ }
62674
+ const lineAt = (offset) => starts.findLastIndex((start2) => start2 <= offset);
62675
+ const flagged = lines2.map(() => 0);
62676
+ for (const offset of offsets) {
62677
+ const line = lineAt(offset);
62678
+ flagged[line] = (flagged[line] ?? 0) + 1;
62679
+ }
62680
+ const blocks = redactedBlocks({ lines: lines2, flagged });
62681
+ const inside = (line) => blocks.some((block2) => line >= block2.start && line <= block2.end);
62682
+ const values = flagged.reduce((sum, count5, line) => inside(line) ? sum + count5 : sum, 0);
62683
+ return { values, insideAt: (offset) => inside(lineAt(offset)) };
62684
+ }
62685
+
62686
+ // ../../modules/vault/contract/src/vault-reference-chip.ts
62687
+ var VaultReferenceChipSlot = uiTokens("vault").component("referenceChip");
62688
+ var VaultSaveFoundSecretSlot = uiTokens("vault").component("saveFoundSecret");
62689
+ var VaultMessageFootSlot = uiTokens("vault").component("messageFoot");
62690
+ var REFERENCE = /\{\{vault:([A-Za-z0-9_][A-Za-z0-9_./:-]*)\}\}/g;
62691
+ function vaultReferenceNames({ text: text2 }) {
62692
+ return [...new Set([...text2.matchAll(REFERENCE)].map((match) => match[1] ?? ""))].filter(
62693
+ (name3) => name3 !== ""
62694
+ );
62695
+ }
62696
+ function vaultReferenceConnectionName({ name: name3 }) {
62697
+ return name3.split(".")[0] ?? name3;
62698
+ }
62494
62699
 
62495
62700
  // ../../modules/vault/contract/src/vault-apps.ts
62496
62701
  var vaultAppConnectionSchemaDefinition = external_exports.object({
@@ -62631,6 +62836,13 @@ var vaultLockdownSchemaDefinition = external_exports.object({
62631
62836
  }).nullable(),
62632
62837
  override: vaultLockdownOverrideSchemaDefinition.nullable()
62633
62838
  });
62839
+ var vaultAlertsSettleRequestedPayloadSchemaDefinition = external_exports.object({
62840
+ workspaceId: external_exports.string().min(1),
62841
+ kind: external_exports.string().regex(/^[a-z_]{1,64}$/),
62842
+ label: external_exports.string().min(1).max(80),
62843
+ requestId: external_exports.string().min(1),
62844
+ at: external_exports.iso.datetime()
62845
+ });
62634
62846
  var vaultWatchReportReceivedPayloadSchemaDefinition = external_exports.object({
62635
62847
  /** The alert workspace (VAULT_ALERT_WORKSPACE_ID), where a stopped watchdog's card lands. */
62636
62848
  workspaceId: external_exports.string().min(1),
@@ -62699,6 +62911,32 @@ var vaultAwsSessionSchemaDefinition = external_exports.object({
62699
62911
  expiration: external_exports.iso.datetime({ offset: true })
62700
62912
  });
62701
62913
 
62914
+ // ../../modules/vault/contract/src/vault-session.ts
62915
+ var vaultSessionSchemaDefinition = external_exports.object({
62916
+ /** `claude-code`, `codex`, `kanban`, `terminal` or `script`. */
62917
+ harness: external_exports.enum(["claude-code", "codex", "kanban", "terminal", "script"]),
62918
+ /** The harness's session id, the card id, or the terminal; one lease per id. */
62919
+ id: external_exports.string().trim().min(1).max(200),
62920
+ /** What the person calls it: `--as`, LAZE_SESSION_NAME, or the Kanban card. */
62921
+ name: external_exports.string().trim().max(120).default(""),
62922
+ host: external_exports.string().trim().max(200).default(""),
62923
+ /** The folder the session works in, `~/proj` under the home folder. */
62924
+ folder: external_exports.string().trim().max(500).default("")
62925
+ });
62926
+ var vaultSessionSchema = vaultSessionSchemaDefinition;
62927
+ var vaultSessionReleaseInputSchemaDefinition = external_exports.object({
62928
+ ...vaultEgressReleaseInputSchema.omit({ agentId: true }).shape,
62929
+ session: vaultSessionSchema
62930
+ });
62931
+ var vaultSessionStatusInputSchemaDefinition = external_exports.object({
62932
+ requestId: external_exports.string().min(1).max(64),
62933
+ session: vaultSessionSchema
62934
+ });
62935
+ var vaultSessionBatchInputSchemaDefinition = external_exports.object({
62936
+ ...vaultBatchReleaseInputSchema.omit({ agentId: true }).shape,
62937
+ session: vaultSessionSchema
62938
+ });
62939
+
62702
62940
  // ../../modules/vault/contract/src/vault-placeholders.ts
62703
62941
  var PLACEHOLDER = /\{\{\s*vault:[^}]*\}\}/;
62704
62942
  function unusableFieldProblems({
@@ -64123,7 +64361,9 @@ var startConversationInputSchemaDefinition = external_exports.object({
64123
64361
  agentId: idSchema7,
64124
64362
  /** The first message: a conversation is only made once there is something to say. */
64125
64363
  body: firstMessageSchema,
64126
- clientKey: clientKeySchema
64364
+ clientKey: clientKeySchema,
64365
+ /** A message the starter may read: the first message quotes it, as a forward does. */
64366
+ contextMessageId: idSchema7.optional()
64127
64367
  });
64128
64368
  var startConversationInputSchema = startConversationInputSchemaDefinition;
64129
64369
  var startedConversationSchemaDefinition = external_exports.object({
@@ -64150,7 +64390,8 @@ var listConversationsInputSchema = listConversationsInputSchemaDefinition;
64150
64390
  var conversationSummarySchema2 = chatSummarySchema;
64151
64391
  var startConversationAsCallerInputSchemaDefinition = external_exports.object({
64152
64392
  agent: agentRefSchema2,
64153
- text: firstMessageSchema
64393
+ text: firstMessageSchema,
64394
+ about: idSchema7.optional().describe("The id of a message to continue from: the first message quotes it.")
64154
64395
  });
64155
64396
  var listConversationsAsCallerInputSchemaDefinition = external_exports.object({
64156
64397
  agent: agentRefSchema2.optional(),
@@ -65913,6 +66154,8 @@ var remoteHttpRequestSchemaDefinition = external_exports.object({
65913
66154
  authorization: external_exports.string().optional(),
65914
66155
  contentType: external_exports.string().optional(),
65915
66156
  body: external_exports.string(),
66157
+ /** The host the request came to (`X-Forwarded-Host`, else `Host`): the origin it names. */
66158
+ host: external_exports.string().optional(),
65916
66159
  /** This api process on loopback, where the MCP tools call the REST operations. */
65917
66160
  loopbackOrigin: external_exports.string(),
65918
66161
  /** The MCP-Protocol-Version, Mcp-Method and Mcp-Name headers, which 2026-07-28 checks. */
@@ -66315,6 +66558,16 @@ var inboxWaitingSchemaDefinition = external_exports.object({
66315
66558
  oldestPostedAt: external_exports.iso.datetime().nullable(),
66316
66559
  session: agentSessionSchemaDefinition.nullable()
66317
66560
  });
66561
+ var inboxPreviewSchemaDefinition = external_exports.object({
66562
+ messageId: idSchema17,
66563
+ channelId: idSchema17,
66564
+ channelName: external_exports.string(),
66565
+ channelKind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
66566
+ author: external_exports.object({ kind: external_exports.enum(["person", "agent"]), id: idSchema17, name: external_exports.string() }),
66567
+ /** At most 200 characters of the message. */
66568
+ preview: external_exports.string().max(200),
66569
+ postedAt: external_exports.iso.datetime()
66570
+ });
66318
66571
  var callerSchemaDefinition = external_exports.object({
66319
66572
  kind: external_exports.enum(["person", "agent"]),
66320
66573
  id: idSchema17,
@@ -66323,6 +66576,8 @@ var callerSchemaDefinition = external_exports.object({
66323
66576
  agent: agentSchemaDefinition.nullable(),
66324
66577
  /** Messages waiting in the agent's inbox, not taken yet; 0 for a person. */
66325
66578
  pendingCount: external_exports.number().int().min(0).optional(),
66579
+ /** The newest of them, at most 3, still waiting for read_inbox; absent when none wait. */
66580
+ pendingNewest: external_exports.array(inboxPreviewSchemaDefinition).max(3).optional(),
66326
66581
  /** The person's language, or the agent owner's (BCP 47; en-US until they pick one). */
66327
66582
  language: external_exports.string().optional(),
66328
66583
  /** The person's time zone, or the agent owner's (IANA; UTC while Laze does not know it). */
@@ -66603,6 +66858,16 @@ var agentConfig = Config.define((c) => ({
66603
66858
  attentionTimeoutMinutes: c.env("AGENT_ATTENTION_TIMEOUT_MINUTES", positiveInt3.default(30)),
66604
66859
  /** Where a GitHub signature links back; the origin the connect command fetches the CLI from. */
66605
66860
  publicBaseUrl,
66861
+ /** Other origins this Laze answers on; MCP and OAuth describe the one a request used. */
66862
+ publicOriginAliases,
66863
+ /**
66864
+ * The origin people and agents are told to connect to (MCP server URL, setup prompt, link
66865
+ * command): `BASE_HOST` or one of its aliases, else ignored for `BASE_HOST`. docs/ops/domains.md
66866
+ */
66867
+ connectOrigin: c.env(
66868
+ "AGENT_CONNECT_ORIGIN",
66869
+ external_exports.string().optional().transform((value) => value?.trim() || void 0)
66870
+ ),
66606
66871
  /** The packed Laze CLI tarballs and their `laze-cli.json` manifest, from scripts/pack-cli.mjs. */
66607
66872
  cliPackageDirectory: c.env(
66608
66873
  "AGENT_CLI_PACKAGE_DIR",
@@ -66615,6 +66880,12 @@ var agentConfig = Config.define((c) => ({
66615
66880
  )
66616
66881
  }));
66617
66882
 
66883
+ // ../../modules/agent/contract/src/agent-browser-config.ts
66884
+ var agentBrowserConfigDefinition = external_exports.strictObject({
66885
+ /** The origin the connect dialog names (`AGENT_CONNECT_ORIGIN`); null shows the page's own. */
66886
+ connectOrigin: external_exports.string().nullable()
66887
+ });
66888
+
66618
66889
  // ../../modules/agent/contract/src/agent-delivery.ts
66619
66890
  var agentDeliveryDuePayloadSchemaDefinition = external_exports.object({
66620
66891
  workspaceId: external_exports.string().min(1),
@@ -67509,7 +67780,7 @@ async function namingFirst({ client, args }) {
67509
67780
  throw new CliUsageError(namingFirstTextOf({ channelIds: unnamed.map((chat) => chat.id) }));
67510
67781
  }
67511
67782
  function serverUrlOf({ context, args }) {
67512
- return flagText({ args, name: "url" }) || context.environment.url || "https://laze.langwatch.ai";
67783
+ return flagText({ args, name: "url" }) || context.environment.url || DEFAULT_LAZE_URL;
67513
67784
  }
67514
67785
 
67515
67786
  // src/services/agent-access-commands.service.ts
@@ -69752,12 +70023,15 @@ async function actOn({
69752
70023
  // src/services/secret-offer.service.ts
69753
70024
  function secretsIn(text2) {
69754
70025
  const seen = /* @__PURE__ */ new Set();
69755
- return draftSecretsIn({ text: text2 }).flatMap((secret) => {
69756
- if (seen.has(secret.value)) return [];
70026
+ const found = draftSecretsIn({ text: text2 });
70027
+ const blocks = redactedBlocksAt({ text: text2, offsets: found.map((secret) => secret.start) });
70028
+ const secrets = found.flatMap((secret) => {
70029
+ if (seen.has(secret.value) || blocks.insideAt(secret.start)) return [];
69757
70030
  seen.add(secret.value);
69758
70031
  const field = secret.suggestedName;
69759
70032
  return [{ value: secret.value, field, suggested: connectionNameForField(field) }];
69760
70033
  });
70034
+ return { secrets, blockValues: blocks.values };
69761
70035
  }
69762
70036
  function keychainOf(args) {
69763
70037
  const keychain2 = flagText({ args, name: "keychain", fallback: "personal" });
@@ -69802,7 +70076,13 @@ async function textToSend({
69802
70076
  leaves
69803
70077
  }) {
69804
70078
  if (profile.kind !== "person" || args.flags["as-is"]) return text2;
69805
- const secrets = secretsIn(text2);
70079
+ const { secrets, blockValues } = secretsIn(text2);
70080
+ if (blockValues > 0) {
70081
+ context.err(
70082
+ `This looks like a log or stack trace: ${blockValues} flagged values go as one redacted block, saved in no vault.
70083
+ `
70084
+ );
70085
+ }
69806
70086
  if (secrets.length === 0) return text2;
69807
70087
  const keychain2 = keychainOf(args);
69808
70088
  if (!args.flags.save && !await leaves()) return text2;
@@ -70432,8 +70712,8 @@ var openclawConfig = Config.define((c) => ({
70432
70712
  reconnectMaxSeconds: c.env("OPENCLAW_RECONNECT_MAX_SECONDS", positiveInt5.default(60)),
70433
70713
  /** How long one inbox read waits for an agent's next message. */
70434
70714
  inboxWaitSeconds: c.env("OPENCLAW_INBOX_WAIT_SECONDS", positiveInt5.max(55).default(25)),
70435
- /** A run that shows no progress for this long is given up and said so in the conversation. */
70436
- runTimeoutMinutes: c.env("OPENCLAW_RUN_TIMEOUT_MINUTES", positiveInt5.default(30)),
70715
+ /** A run that shows no progress for this long is aborted and said so in the conversation. */
70716
+ runTimeoutMinutes: c.env("OPENCLAW_RUN_TIMEOUT_MINUTES", positiveInt5.default(15)),
70437
70717
  /** The hard limit of one run, progress or not; OpenClaw gets it as the run's `timeoutMs`. */
70438
70718
  runMaxHours: c.env("OPENCLAW_RUN_MAX_HOURS", positiveInt5.default(6)),
70439
70719
  /** Where the progress board ops card for a gateway that stopped answering is written. */
@@ -72270,10 +72550,14 @@ are waiting, if you think one was missed.
72270
72550
  ## Apps
72271
72551
 
72272
72552
  Asked for an app (a tracker, a CRM, a dashboard, a page that explains something), read the full
72273
- guide first: https://laze.langwatch.ai/docs/agents/apps.md. The short version:
72274
-
72275
- - Create it where it was asked for, from the closest template:
72276
- \`laze app create "<Name>" --template tracker|crm|dashboard|form --channel <channel>\`.
72553
+ guide first: https://laze.so/docs/agents/apps.md. The short version:
72554
+
72555
+ - Create it where it was asked for, from the closest template (\`laze app templates\` lists
72556
+ them): \`laze app create "<Name>" --template <template> --channel <channel>\`. The template is
72557
+ the first live version, copied into a folder that is yours to change.
72558
+ - Slides, a deck or a talk: start from \`laze app create <name> --template slides\`. Each slide
72559
+ is a file in slides/, listed in order in slides/deck.json; the deck presents full screen and
72560
+ exports PDF and HTML on its own.
72277
72561
  An app that already exists goes in with \`laze app pin <app> --channel <channel>\`, never as a
72278
72562
  pinned message with a link. A pin opens it to everyone there, and their agents may build on it.
72279
72563
  - A new app is Restricted. Do not share it with only the person who asked when they asked in a
@@ -72332,7 +72616,7 @@ function lazePluginFiles({
72332
72616
  const json7 = (value) => `${JSON.stringify(value, null, 2)}
72333
72617
  `;
72334
72618
  const description = "Laze messages reach this session, and the laze tools to answer them";
72335
- const author = { name: "Laze", url: "https://laze.langwatch.ai" };
72619
+ const author = { name: "Laze", url: "https://laze.so" };
72336
72620
  return {
72337
72621
  ".claude-plugin/marketplace.json": json7({
72338
72622
  name: LAZE_PLUGIN,
@@ -72345,7 +72629,7 @@ function lazePluginFiles({
72345
72629
  version: version2,
72346
72630
  description,
72347
72631
  author,
72348
- homepage: "https://laze.langwatch.ai/docs/agents/connect",
72632
+ homepage: "https://laze.so/docs/agents/connect",
72349
72633
  keywords: ["laze", "chat", "agents"],
72350
72634
  extensions: { "ai.laze": { delivery: "ai.laze/delivery.json" } }
72351
72635
  }),
@@ -74334,6 +74618,7 @@ var appConnectionAnswerSchemaDefinition = external_exports.object({
74334
74618
 
74335
74619
  // ../../modules/app/contract/src/app.api.ts
74336
74620
  var appSlugSchema = external_exports.string().min(2).max(24).regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, "lower case letters and digits, joined by single hyphens");
74621
+ var appTemplateNameSchema = external_exports.string().min(2).max(40).regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, "lower case letters and digits, joined by single hyphens");
74337
74622
  var APP_VISIBILITIES = ["restricted", "channel", "internal", "public"];
74338
74623
  var appVisibilitySchema = external_exports.enum(APP_VISIBILITIES);
74339
74624
  var APP_ROLES = ["viewer", "editor", "builder"];
@@ -74400,6 +74685,10 @@ var appSchemaDefinition = external_exports.object({
74400
74685
  role: appRoleSchema.nullable().optional(),
74401
74686
  /** The agent that built it, a Builder by standing; null or absent when a person did. */
74402
74687
  creatorAgentId: external_exports.string().nullable().optional(),
74688
+ /** The template the app started from; null or absent for an app built from nothing. */
74689
+ templateName: external_exports.string().nullable().optional(),
74690
+ /** That template's version when the app was made, so a later version can be offered. */
74691
+ templateVersion: external_exports.number().int().positive().nullable().optional(),
74403
74692
  createdAt: external_exports.iso.datetime(),
74404
74693
  updatedAt: external_exports.iso.datetime()
74405
74694
  });
@@ -74499,7 +74788,9 @@ var createAppInputSchemaDefinition = external_exports.object({
74499
74788
  /** Restricted unless chosen: owner, admins, shares and the conversations it is pinned to. */
74500
74789
  visibility: appVisibilitySchema.default("restricted"),
74501
74790
  /** The agent a person hands the new app to, which becomes its creator and a Builder. */
74502
- creatorAgentId: external_exports.string().min(1).optional()
74791
+ creatorAgentId: external_exports.string().min(1).optional(),
74792
+ /** Starts the app from this template: its files are the first live version. */
74793
+ template: appTemplateNameSchema.optional()
74503
74794
  });
74504
74795
  var createAppInputSchema = createAppInputSchemaDefinition;
74505
74796
  var listAppsInputSchemaDefinition = external_exports.object({
@@ -75124,7 +75415,7 @@ var appFaultClaimsSchemaDefinition = external_exports.object({
75124
75415
  ver: external_exports.string().min(1).max(64),
75125
75416
  vid: external_exports.string().min(1),
75126
75417
  vname: external_exports.string().max(200),
75127
- kind: external_exports.enum(["error", "rejection", "banner", "api"]),
75418
+ kind: external_exports.enum(["error", "rejection", "banner", "api", "resource", "csp"]),
75128
75419
  msg: external_exports.string().min(1).max(1e3),
75129
75420
  stack: external_exports.string().max(4e3).optional(),
75130
75421
  req: external_exports.object({
@@ -75133,6 +75424,14 @@ var appFaultClaimsSchemaDefinition = external_exports.object({
75133
75424
  status: external_exports.number().int(),
75134
75425
  code: external_exports.string().max(160).optional()
75135
75426
  }).optional(),
75427
+ /** Files the page could not load, with the policy directive that blocked each, if one did. */
75428
+ res: external_exports.array(
75429
+ external_exports.object({
75430
+ el: external_exports.string().max(80),
75431
+ url: external_exports.string().max(600),
75432
+ dir: external_exports.string().max(80).optional()
75433
+ })
75434
+ ).max(10).optional(),
75136
75435
  act: external_exports.string().max(400),
75137
75436
  page: external_exports.string().max(600)
75138
75437
  });
@@ -75584,11 +75883,55 @@ var appBackupCheckAlertsSchemaDefinition = external_exports.object({
75584
75883
  adminUserIds: external_exports.array(external_exports.string())
75585
75884
  });
75586
75885
 
75886
+ // ../../modules/app/contract/src/app.templates.ts
75887
+ var APP_TEMPLATE_SOURCES = ["laze"];
75888
+ var templateCollectionsSchema = external_exports.record(
75889
+ collectionNameSchema,
75890
+ external_exports.object({
75891
+ fields: external_exports.array(collectionFieldSchema).min(1),
75892
+ rules: collectionRulesSchema.optional()
75893
+ })
75894
+ ).default({});
75895
+ var appTemplateManifestSchemaDefinition = external_exports.object({
75896
+ name: appTemplateNameSchema,
75897
+ title: external_exports.string().trim().min(1).max(60),
75898
+ description: external_exports.string().trim().min(1).max(300),
75899
+ /** Grows when the template changes; an app records the version it copied. */
75900
+ version: external_exports.number().int().positive(),
75901
+ /** The page the app opens on, a path in the folder. */
75902
+ entry: external_exports.string().min(1).max(200),
75903
+ /** One or two sentences an agent reads first: how to change an app made from it. */
75904
+ guide: external_exports.string().trim().max(500).optional(),
75905
+ collections: templateCollectionsSchema,
75906
+ views: external_exports.array(appViewSpecSchema).default([]),
75907
+ seed: external_exports.record(collectionNameSchema, external_exports.array(appRecordSchema)).default({})
75908
+ });
75909
+ var appTemplateSchemaDefinition = external_exports.object({
75910
+ ...appTemplateManifestSchemaDefinition.shape,
75911
+ source: external_exports.enum(APP_TEMPLATE_SOURCES)
75912
+ });
75913
+ var appTemplateSchema = appTemplateSchemaDefinition;
75914
+ var writeAppFilesShape = {
75915
+ appId: external_exports.string().min(1),
75916
+ files: external_exports.array(appFileSchema).max(200).default([]),
75917
+ /** Paths to remove from the version. */
75918
+ remove: external_exports.array(appFileSchema.shape.path).max(200).default([]),
75919
+ /** What changed, for a person; empty or throwaway messages are refused. */
75920
+ message: external_exports.string().trim().max(500)
75921
+ };
75922
+ var somethingToWrite = {
75923
+ check: (input2) => input2.files.length + input2.remove.length > 0,
75924
+ message: "Give a file to write or a path to remove"
75925
+ };
75926
+ var writeAppFilesInputSchemaDefinition = external_exports.object({ workspaceId: external_exports.string().min(1), ...writeAppFilesShape }).refine(somethingToWrite.check, { message: somethingToWrite.message });
75927
+ var writeAppFilesByKeyInputSchemaDefinition = external_exports.object(writeAppFilesShape).refine(somethingToWrite.check, { message: somethingToWrite.message });
75928
+ var appTemplatesByKeyQuerySchemaDefinition = external_exports.object({});
75929
+
75587
75930
  // ../../modules/app/contract/src/app.trpc.ts
75588
75931
  var appMainTrpc = defineTrpcContract("app").query("list").withInput(listAppsInputSchema).withOutput(external_exports.array(appSchema)).query("get").withInput(appRefSchema).withOutput(appSchema).mutation("create").withInput(createAppInputSchema).withOutput(appSchema).mutation("rename").withInput(renameAppInputSchema).withOutput(appSchema).mutation("archive").withInput(appRefSchema).withOutput(appSchema).mutation("unarchive").withInput(appRefSchema).withOutput(appSchema).mutation("delete").withInput(deleteAppInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("versions").withInput(appRefSchema).withOutput(external_exports.array(appVersionSchema)).mutation("revert").withInput(revertInputSchema).withOutput(appPushSchema).mutation("publish").withInput(publishInputSchema).withOutput(publishOutcomeSchema).query("collections").withInput(appDataRefSchema).withOutput(external_exports.array(collectionSchema)).query("records").withInput(listRecordsInputSchema).withOutput(recordPageSchema).mutation("writeRecord").withInput(writeRecordInputSchema).withOutput(appRecordSchema).mutation("deleteRecord").withInput(deleteRecordInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("views").withInput(appDataRefSchema).withOutput(external_exports.array(appViewSchema)).mutation("saveView").withInput(saveViewInputSchema).withOutput(appViewSchema).mutation("deleteView").withInput(deleteViewInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("chooseCardRows").withInput(chooseCardRowsInputSchema).withOutput(appCardChoiceSchema).query("exportRecords").withInput(exportRecordsInputSchema).withOutput(recordExportSchema).mutation("importRecords").withInput(importRecordsInputSchema).withOutput(recordImportSchema).mutation("decidePublish").withInput(decidePublishInputSchema).withOutput(publishOutcomeSchema).mutation("nameVersion").withInput(nameVersionInputSchema).withOutput(appVersionSchema).mutation("makeInternal").withInput(appRefSchema).withOutput(appSchema).mutation("revokePublishLease").withInput(appRefSchema).withOutput(appSchema).mutation("signInHandoff").withInput(signInHandoffInputSchema).withOutput(signInHandoffSchema).query("functionLogs").withInput(listFunctionLogsInputSchema).withOutput(external_exports.array(appFunctionLogEntrySchema)).query("access").withInput(appRefSchema).withOutput(appAccessSchema).query("members").withInput(appRefSchema).withOutput(appMembersSchema).mutation("grantAccess").withInput(grantAppAccessInputSchema).withOutput(appAccessSchema).mutation("revokeAccess").withInput(revokeAppAccessInputSchema).withOutput(appAccessSchema).mutation("setVisibility").withInput(setAppVisibilityInputSchema).withOutput(visibilityOutcomeSchema).mutation("setMemberRole").withInput(setMemberRoleInputSchema).withOutput(appAccessSchema).mutation("unpublish").withInput(appRefSchema).withOutput(appSchema).query("door").withInput(appRefSchema).withOutput(appDoorSchema).mutation("requestAccess").withInput(appRefSchema).withOutput(appDoorSchema).mutation("decideAccess").withInput(decideAppAccessInputSchema).withOutput(appAccessRequestSchema).query("users").withInput(appRefSchema).withOutput(appUsersSchema).mutation("blockUser").withInput(blockAppUserInputSchema).withOutput(appUsersSchema).mutation("deleteUser").withInput(deleteAppUserInputSchema).withOutput(deletedAppUserSchema).query("backups").withInput(appRefSchema).withOutput(appBackupStatusSchema).mutation("restoreData").withInput(restoreAppDataInputSchema).withOutput(appRestoreSchema).query("cost").withInput(appRefSchema).withOutput(appCostSchema).mutation("setBudget").withInput(setAppBudgetInputSchema).withOutput(appCostSchema).query("triggers").withInput(appRefSchema).withOutput(appTriggersSchema).mutation("setTriggerPaused").withInput(setAppTriggerPausedInputSchema).withOutput(appTriggerSchema).mutation("removeTrigger").withInput(appTriggerRefSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
75589
75932
  var appConnectionsTrpc = defineTrpcContract("app").query("connections").withInput(appRefSchema).withOutput(appConnectionsSchema).mutation("allowConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).mutation("revokeConnection").withInput(appConnectionRefSchema).withOutput(appConnectionsSchema).build();
75590
75933
  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();
75591
- var appSettingsTrpc = defineTrpcContract("app").query("workspaceSettings").withInput(appWorkspaceRefSchema).withOutput(appWorkspaceSettingsSchema).query("functionSettings").withInput(appWorkspaceRefSchema).withOutput(appFunctionSettingsSchema).mutation("setFunctionsEnabled").withInput(setFunctionsEnabledInputSchema).withOutput(appFunctionSettingsSchema).mutation("setPublicAppsAllowed").withInput(setPublicAppsAllowedInputSchema).withOutput(appFunctionSettingsSchema).build();
75934
+ var appSettingsTrpc = defineTrpcContract("app").query("workspaceSettings").withInput(appWorkspaceRefSchema).withOutput(appWorkspaceSettingsSchema).query("functionSettings").withInput(appWorkspaceRefSchema).withOutput(appFunctionSettingsSchema).mutation("setFunctionsEnabled").withInput(setFunctionsEnabledInputSchema).withOutput(appFunctionSettingsSchema).mutation("setPublicAppsAllowed").withInput(setPublicAppsAllowedInputSchema).withOutput(appFunctionSettingsSchema).query("templates").withInput(appWorkspaceRefSchema).withOutput(external_exports.array(appTemplateSchema)).build();
75592
75935
  var appTrpc = joinTrpcContracts(
75593
75936
  "app",
75594
75937
  appMainTrpc,
@@ -75654,7 +75997,6 @@ var deleteAppUserByKeyInputSchemaDefinition = deleteAppUserInputSchema.omit(byKe
75654
75997
  var appListByKeyQuerySchemaDefinition = external_exports.object({ archived: external_exports.enum(["true"]).optional() });
75655
75998
 
75656
75999
  // ../../modules/app/contract/src/app.cli.ts
75657
- var APP_TEMPLATES = ["tracker", "crm", "dashboard", "form"];
75658
76000
  var APP_MANIFEST_FILE = "laze.app.json";
75659
76001
  var appManifestSchemaDefinition = external_exports.object({
75660
76002
  app: external_exports.object({ id: external_exports.string().min(1), name: external_exports.string(), slug: appSlugSchema }),
@@ -75684,8 +76026,14 @@ var appCliCommands = [
75684
76026
  {
75685
76027
  command: "laze app create",
75686
76028
  operation: "createApp",
75687
- arguments: ["<name>", "--template tracker|crm|dashboard|form", "--dir <dir>", "--channel <c>"],
75688
- summary: "Create an app and scaffold a starter template into a folder linked to it"
76029
+ arguments: ["<name>", "--template <template>", "--dir <dir>", "--channel <c>"],
76030
+ summary: "Create an app in a folder linked to it. --template starts it from a template (laze app templates lists them; decks start from slides): its files are the first live version and land in the folder to change"
76031
+ },
76032
+ {
76033
+ command: "laze app templates",
76034
+ operation: "listTemplates",
76035
+ arguments: [],
76036
+ summary: "List the templates an app can start from, with their versions"
75689
76037
  },
75690
76038
  {
75691
76039
  command: "laze app list",
@@ -75699,6 +76047,12 @@ var appCliCommands = [
75699
76047
  arguments: ["[dir]", "-m <what changed>", "--seed"],
75700
76048
  summary: `Record the folder as a new version: it is the live app at once, with laze.app.json's collections applied to the live data (records keep their values). -m says what changed in plain words ("update" or "wip" is refused). Going live waits only when an admin must approve it, and the push asks. Server functions in functions/<name>.js ship with it`
75701
76049
  },
76050
+ {
76051
+ command: "laze app write",
76052
+ operation: "writeFiles",
76053
+ arguments: ["<file>...", "-m <what changed>", "--remove <path,...>"],
76054
+ summary: "Write some files of the app's folder over the live version and keep every other file, or remove paths: a new live version like a push, for changing one slide or page without pushing the whole folder"
76055
+ },
75702
76056
  {
75703
76057
  command: "laze app logs",
75704
76058
  operation: "listFunctionLogs",
@@ -76108,530 +76462,6 @@ function unknownCollectionsOf({
76108
76462
  );
76109
76463
  }
76110
76464
 
76111
- // src/templates/crm.template.ts
76112
- var APP_JS = String.raw`(function () {
76113
- var h = Laze.h;
76114
- var contacts = Laze.records("contacts");
76115
- var STAGES = ["lead", "qualified", "proposal", "won", "lost"];
76116
- var TONE = { lead: "", qualified: "info", proposal: "primary", won: "success", lost: "danger" };
76117
- var view = "board";
76118
- var adding = false;
76119
- var rows = [];
76120
-
76121
- function badge(stage) {
76122
- return h("span", { class: "lz-badge" + (TONE[stage] ? " lz-badge-" + TONE[stage] : "") }, stage);
76123
- }
76124
-
76125
- function stagePicker(contact) {
76126
- return h("select", {
76127
- class: "lz-select", "aria-label": "Stage of " + contact.name,
76128
- onchange: function (event) { contacts.update(contact.id, { stage: event.target.value }).then(load, Laze.fail); },
76129
- }, STAGES.map(function (stage) {
76130
- return h("option", { value: stage, selected: stage === contact.stage }, stage);
76131
- }));
76132
- }
76133
-
76134
- function board() {
76135
- return h("div", { class: "lz-board" }, STAGES.map(function (stage) {
76136
- var inStage = rows.filter(function (row) { return row.stage === stage; });
76137
- var total = inStage.reduce(function (sum, row) { return sum + Number(row.value || 0); }, 0);
76138
- return h("section", { class: "lz-column", "aria-label": stage },
76139
- h("div", { class: "lz-column-head" }, badge(stage), h("span", { class: "lz-muted" }, Laze.money(total))),
76140
- inStage.length ? inStage.map(function (row) {
76141
- return h("article", { class: "lz-tile" },
76142
- h("strong", {}, row.name),
76143
- h("span", { class: "lz-muted" }, row.company || "No company"),
76144
- h("span", {}, Laze.money(row.value)));
76145
- }) : h("p", { class: "lz-muted" }, "No one here yet"));
76146
- }));
76147
- }
76148
-
76149
- function table() {
76150
- return h("div", { class: "lz-card lz-table-wrap" }, h("table", { class: "lz-table" },
76151
- h("thead", {}, h("tr", {}, ["Name", "Company", "Email", "Stage", "Value"].map(function (label) {
76152
- return h("th", { class: label === "Value" ? "lz-num" : "" }, label);
76153
- }))),
76154
- h("tbody", {}, rows.map(function (row) {
76155
- return h("tr", {},
76156
- h("td", {}, h("strong", {}, row.name)),
76157
- h("td", {}, row.company || ""),
76158
- h("td", { class: "lz-muted" }, row.email || ""),
76159
- h("td", {}, stagePicker(row)),
76160
- h("td", { class: "lz-num" }, Laze.money(row.value)));
76161
- }))));
76162
- }
76163
-
76164
- function addForm() {
76165
- var form = h("form", { class: "lz-card lz-card-body lz-form", onsubmit: function (event) {
76166
- event.preventDefault();
76167
- var data = Object.fromEntries(new FormData(form).entries());
76168
- data.value = Number(data.value || 0);
76169
- contacts.create(data).then(function () { form.reset(); adding = false; load(); }, Laze.fail);
76170
- } },
76171
- h("label", { class: "lz-field" }, "Name", h("input", { class: "lz-input", name: "name", required: true })),
76172
- h("label", { class: "lz-field" }, "Company", h("input", { class: "lz-input", name: "company" })),
76173
- h("label", { class: "lz-field" }, "Email", h("input", { class: "lz-input", name: "email", type: "email" })),
76174
- h("label", { class: "lz-field" }, "Value", h("input", { class: "lz-input", name: "value", type: "number", min: "0" })),
76175
- h("button", { class: "lz-btn lz-btn-primary", type: "submit" }, "Add contact"),
76176
- rows.length ? h("button", { class: "lz-btn lz-btn-ghost", type: "button", onclick: function () { adding = false; render(); } }, "Cancel") : null);
76177
- return form;
76178
- }
76179
-
76180
- function render() {
76181
- var open = rows.filter(function (row) { return row.stage !== "won" && row.stage !== "lost"; });
76182
- var pipeline = open.reduce(function (sum, row) { return sum + Number(row.value || 0); }, 0);
76183
- Laze.mount(h("div", { class: "lz-page" },
76184
- h("header", { class: "lz-header" },
76185
- h("div", {}, h("h1", { class: "lz-title" }, document.title),
76186
- h("p", { class: "lz-lede" }, open.length + " open deals worth " + Laze.money(pipeline) + ".")),
76187
- h("div", { class: "lz-row" },
76188
- h("div", { class: "lz-tabs", role: "group", "aria-label": "View" }, ["board", "table"].map(function (name) {
76189
- return h("button", { class: "lz-tab", "aria-pressed": String(view === name), onclick: function () { view = name; render(); } },
76190
- name === "board" ? "Pipeline" : "Table");
76191
- })),
76192
- adding ? null : h("button", { class: "lz-btn lz-btn-primary", onclick: function () { adding = true; render(); } }, "New contact"))),
76193
- adding || !rows.length ? addForm() : null,
76194
- view === "board" ? board() : table()));
76195
- }
76196
-
76197
- function load() {
76198
- return contacts.list({ sort: "-value" }).then(function (items) { rows = items; render(); }, Laze.fail);
76199
- }
76200
-
76201
- load();
76202
- Laze.subscribe("contacts", load);
76203
- })();
76204
- `;
76205
- var CRM_TEMPLATE = {
76206
- title: "CRM",
76207
- summary: "Contacts on a pipeline board and a table, with stages and deal values",
76208
- appJs: APP_JS,
76209
- collections: {
76210
- contacts: {
76211
- fields: [
76212
- { name: "name", type: "text", required: true },
76213
- { name: "company", type: "text" },
76214
- { name: "email", type: "text" },
76215
- {
76216
- name: "stage",
76217
- type: "select",
76218
- options: ["lead", "qualified", "proposal", "won", "lost"],
76219
- default: "lead"
76220
- },
76221
- { name: "value", type: "number", default: 0 },
76222
- { name: "notes", type: "text" }
76223
- ]
76224
- }
76225
- },
76226
- seed: {
76227
- contacts: [
76228
- {
76229
- name: "Ada Park",
76230
- company: "ACME Corp",
76231
- email: "ada@acme.example",
76232
- stage: "proposal",
76233
- value: 18e3
76234
- },
76235
- {
76236
- name: "Ben Ito",
76237
- company: "ACME Labs",
76238
- email: "ben@acme.example",
76239
- stage: "qualified",
76240
- value: 9500
76241
- },
76242
- {
76243
- name: "Cleo Ruiz",
76244
- company: "ACME Retail",
76245
- email: "cleo@acme.example",
76246
- stage: "lead",
76247
- value: 4e3
76248
- },
76249
- {
76250
- name: "Dev Shah",
76251
- company: "ACME Freight",
76252
- email: "dev@acme.example",
76253
- stage: "won",
76254
- value: 22e3
76255
- }
76256
- ]
76257
- }
76258
- };
76259
-
76260
- // src/templates/dashboard.template.ts
76261
- var APP_JS2 = String.raw`(function () {
76262
- // One stat tile and one chart per metric name, newest period last. "better" on a metric's
76263
- // newest row says whether a rise is good ("up") or bad ("down"), which colours its change.
76264
- var h = Laze.h;
76265
- var metrics = Laze.records("metrics");
76266
-
76267
- function number(value) { return Number(value) || 0; }
76268
- function shown(row) { return number(row.value).toLocaleString() + (row.unit ? " " + row.unit : ""); }
76269
-
76270
- function seriesOf(rows) {
76271
- var names = [];
76272
- rows.forEach(function (row) { if (names.indexOf(row.name) < 0) names.push(row.name); });
76273
- return names.map(function (name) {
76274
- var series = rows.filter(function (row) { return row.name === name; })
76275
- .sort(function (a, b) { return String(a.period).localeCompare(String(b.period)); });
76276
- return { name: name, series: series, last: series[series.length - 1], before: series[series.length - 2] };
76277
- });
76278
- }
76279
-
76280
- function tile(entry) {
76281
- var change = entry.before ? number(entry.last.value) - number(entry.before.value) : null;
76282
- var good = change === null || change === 0 ? null : (change > 0) === (entry.last.better !== "down");
76283
- return h("div", { class: "lz-card lz-card-body" },
76284
- h("p", { class: "lz-card-title" }, entry.name),
76285
- h("div", { class: "lz-stat-value" }, shown(entry.last)),
76286
- change === null ? h("span", { class: "lz-muted" }, Laze.day(entry.last.period)) :
76287
- h("span", { class: "lz-badge" + (good === null ? "" : good ? " lz-badge-success" : " lz-badge-danger") },
76288
- (change > 0 ? "+" : "") + change.toLocaleString() + " vs " + Laze.day(entry.before.period)));
76289
- }
76290
-
76291
- function chart(entry) {
76292
- var peak = Math.max.apply(null, entry.series.map(function (row) { return number(row.value); })) || 1;
76293
- return h("section", { class: "lz-card lz-card-body" },
76294
- h("p", { class: "lz-card-title" }, entry.name + " by period"),
76295
- h("div", { class: "lz-chart", role: "img", "aria-label": entry.name + " by period" }, entry.series.map(function (row) {
76296
- return h("div", { class: "lz-chart-col" },
76297
- h("div", { class: "lz-chart-track" },
76298
- h("div", { class: "lz-chart-bar", title: shown(row), style: "height:" + Math.max(1, Math.round((number(row.value) / peak) * 100)) + "%" },
76299
- h("span", { class: "lz-chart-value" }, number(row.value).toLocaleString()))),
76300
- h("span", { class: "lz-chart-label" }, Laze.day(row.period)));
76301
- })));
76302
- }
76303
-
76304
- function render(rows) {
76305
- var all = seriesOf(rows);
76306
- Laze.mount(h("div", { class: "lz-page" },
76307
- h("header", { class: "lz-header" }, h("div", {}, h("h1", { class: "lz-title" }, document.title),
76308
- h("p", { class: "lz-lede" }, all.length ? "Updated " + Laze.day(rows.reduce(function (latest, row) {
76309
- return String(row.period) > String(latest) ? row.period : latest;
76310
- }, "")) + "." : "The numbers an agent keeps current for this channel."))),
76311
- all.length ? [
76312
- h("section", { class: "lz-stats" }, all.map(tile)),
76313
- h("div", { class: "lz-grid" }, all.map(chart)),
76314
- ] : h("div", { class: "lz-card lz-empty" }, "No numbers yet. Records in metrics show here, one tile and one chart per name.")));
76315
- }
76316
-
76317
- function load() { return metrics.list({ sort: "period" }).then(render, Laze.fail); }
76318
- load();
76319
- Laze.subscribe("metrics", load);
76320
- })();
76321
- `;
76322
- var DASHBOARD_TEMPLATE = {
76323
- title: "Dashboard",
76324
- summary: "A stat tile and a bar chart per metric, its change coloured by whether up is good",
76325
- appJs: APP_JS2,
76326
- collections: {
76327
- metrics: {
76328
- fields: [
76329
- { name: "name", type: "text", required: true },
76330
- { name: "value", type: "number", required: true },
76331
- { name: "unit", type: "text" },
76332
- { name: "period", type: "date", required: true },
76333
- { name: "better", type: "select", options: ["up", "down"], default: "up" }
76334
- ]
76335
- }
76336
- },
76337
- seed: {
76338
- metrics: [
76339
- { name: "Signups", value: 120, period: "2026-07-01" },
76340
- { name: "Signups", value: 164, period: "2026-08-01" },
76341
- { name: "Signups", value: 151, period: "2026-09-01" },
76342
- { name: "Signups", value: 203, period: "2026-10-01" },
76343
- { name: "Open tickets", value: 38, period: "2026-07-01", better: "down" },
76344
- { name: "Open tickets", value: 35, period: "2026-08-01", better: "down" },
76345
- { name: "Open tickets", value: 31, period: "2026-09-01", better: "down" },
76346
- { name: "Open tickets", value: 24, period: "2026-10-01", better: "down" }
76347
- ]
76348
- }
76349
- };
76350
-
76351
- // src/templates/form.template.ts
76352
- var APP_JS3 = String.raw`(function () {
76353
- var h = Laze.h;
76354
- var responses = Laze.records("responses");
76355
- var sent = false;
76356
-
76357
- function render(rows) {
76358
- var form = h("form", { class: "lz-card lz-card-body", onsubmit: function (event) {
76359
- event.preventDefault();
76360
- var data = Object.fromEntries(new FormData(form).entries());
76361
- data.rating = Number(data.rating || 0);
76362
- responses.create(data).then(function () { sent = true; load(); }, Laze.fail);
76363
- } },
76364
- h("div", { class: "lz-form" },
76365
- h("label", { class: "lz-field" }, "Your name", h("input", { class: "lz-input", name: "name", required: true })),
76366
- h("label", { class: "lz-field" }, "Email", h("input", { class: "lz-input", name: "email", type: "email" })),
76367
- h("label", { class: "lz-field" }, "Rating", h("select", { class: "lz-select", name: "rating" },
76368
- [5, 4, 3, 2, 1].map(function (n) { return h("option", { value: n }, n + " of 5"); })))),
76369
- h("label", { class: "lz-field", style: "margin-top:10px" }, "Message",
76370
- h("textarea", { class: "lz-textarea", name: "message", rows: 4 })),
76371
- h("div", { class: "lz-row", style: "margin-top:12px" },
76372
- h("button", { class: "lz-btn lz-btn-primary", type: "submit" }, "Send"),
76373
- sent ? h("span", { class: "lz-badge lz-badge-success" }, "Thanks, it is in.") : null));
76374
- Laze.mount(h("div", { class: "lz-page" },
76375
- h("header", { class: "lz-header" }, h("div", {}, h("h1", { class: "lz-title" }, document.title),
76376
- h("p", { class: "lz-lede" }, "Tell us how it went. Answers land in this app's responses.")),
76377
- rows && rows.length ? h("div", { class: "lz-row" },
76378
- h("span", { class: "lz-badge lz-badge-primary" }, rows.length + (rows.length === 1 ? " answer" : " answers")),
76379
- h("span", { class: "lz-badge" }, "Average " + (rows.reduce(function (sum, row) { return sum + (Number(row.rating) || 0); }, 0) / rows.length).toFixed(1) + " of 5")) : null),
76380
- form,
76381
- rows && rows.length ? h("section", { class: "lz-card lz-table-wrap" }, h("table", { class: "lz-table" },
76382
- h("thead", {}, h("tr", {}, h("th", {}, "Name"), h("th", {}, "Rating"), h("th", {}, "Message"))),
76383
- h("tbody", {}, rows.map(function (row) {
76384
- return h("tr", {}, h("td", {}, row.name), h("td", { "data-label": "Rating" }, row.rating + " of 5"), h("td", { class: "lz-muted", "data-label": "Message" }, row.message || ""));
76385
- })))) : rows ? h("p", { class: "lz-card lz-empty" }, "No answers yet.") : null));
76386
- }
76387
-
76388
- function load() {
76389
- return responses.list().then(render, function () { render(null); });
76390
- }
76391
- load();
76392
- })();
76393
- `;
76394
- var FORM_TEMPLATE = {
76395
- title: "Form",
76396
- summary: "A feedback form with a rating, and the answers below it",
76397
- appJs: APP_JS3,
76398
- collections: {
76399
- responses: {
76400
- fields: [
76401
- { name: "name", type: "text", required: true },
76402
- { name: "email", type: "text" },
76403
- { name: "rating", type: "number", default: 5 },
76404
- { name: "message", type: "text" }
76405
- ]
76406
- }
76407
- },
76408
- seed: {
76409
- responses: [
76410
- { name: "Ada", email: "ada@acme.example", rating: 5, message: "Fast and clear." },
76411
- {
76412
- name: "Ben",
76413
- email: "ben@acme.example",
76414
- rating: 4,
76415
- message: "Good, the export could be quicker."
76416
- }
76417
- ]
76418
- }
76419
- };
76420
-
76421
- // src/templates/shared.template.ts
76422
- function indexHtml({ title }) {
76423
- return String.raw`<!doctype html>
76424
- <html lang="en">
76425
- <head>
76426
- <meta charset="utf-8" />
76427
- <meta name="viewport" content="width=device-width, initial-scale=1" />
76428
- <title>${title}</title>
76429
- <link rel="stylesheet" href="/_laze/theme.css" />
76430
- <link rel="stylesheet" href="/_laze/kit.css" />
76431
- </head>
76432
- <body>
76433
- <main id="app"><p class="lz-page lz-muted">Loading...</p></main>
76434
- <script src="/_laze/laze.js"></script>
76435
- <script src="/app.js"></script>
76436
- </body>
76437
- </html>
76438
- `;
76439
- }
76440
-
76441
- // src/templates/tracker.template.ts
76442
- var APP_JS4 = String.raw`(function () {
76443
- // The page reads its fields from the app's schema, so renaming or adding fields in
76444
- // laze.app.json needs no change here. The status field is the select named "status"
76445
- // (or the first select); its last option counts as done.
76446
- var h = Laze.h;
76447
- var name = "items";
76448
- var fields = [];
76449
- var status = null;
76450
- var shown = "open";
76451
- var adding = false;
76452
- var rows = [];
76453
- var EMPTY = { open: "Nothing open.", done: "Nothing done yet.", all: "No items yet." };
76454
- var TONES = ["", "info", "warning", "success"];
76455
-
76456
- function label(text) { return text.charAt(0).toUpperCase() + text.slice(1).replace(/_/g, " "); }
76457
- function options() { return status ? status.options || [] : []; }
76458
- function isDone(row) { return status ? row[status.name] === options()[options().length - 1] : false; }
76459
- function next(value) { var all = options(); return all[(all.indexOf(value) + 1) % all.length]; }
76460
- function tone(value) {
76461
- var all = options();
76462
- if (value === all[all.length - 1]) return "success";
76463
- return TONES[Math.min(all.indexOf(value), TONES.length - 2)] || "";
76464
- }
76465
-
76466
- function input(field) {
76467
- var props = { class: "lz-input", name: field.name };
76468
- if (field.required) props.required = true;
76469
- if (field.type === "select") {
76470
- return h("select", { class: "lz-input", name: field.name },
76471
- (field.options || []).map(function (option) {
76472
- return h("option", option === field.default ? { value: option, selected: true } : { value: option }, option);
76473
- }));
76474
- }
76475
- if (field.type === "number") props.type = "number";
76476
- if (field.type === "date") props.type = "date";
76477
- if (field.type === "bool") { props.type = "checkbox"; props.class = ""; }
76478
- return h("input", props);
76479
- }
76480
-
76481
- function cell(field, row) {
76482
- var value = row[field.name];
76483
- if (value === undefined || value === null || value === "") return "";
76484
- if (field.type === "date") return Laze.day(value);
76485
- if (field.type === "bool") return value ? "Yes" : "No";
76486
- if (field.type === "json") return JSON.stringify(value);
76487
- return String(value);
76488
- }
76489
-
76490
- function render() {
76491
- var first = fields[0];
76492
- var others = fields.filter(function (field) { return field !== first && field !== status && field.type !== "file"; });
76493
- var visible = rows.filter(function (row) {
76494
- return shown === "all" || (shown === "open" ? !isDone(row) : isDone(row));
76495
- });
76496
- var form = h("form", { class: "lz-card lz-card-body lz-form", onsubmit: function (event) {
76497
- event.preventDefault();
76498
- var data = {};
76499
- fields.forEach(function (field) {
76500
- var element = form.elements[field.name];
76501
- if (!element) return;
76502
- if (field.type === "bool") data[field.name] = element.checked;
76503
- else if (element.value === "") return;
76504
- else data[field.name] = field.type === "number" ? Number(element.value) : element.value;
76505
- });
76506
- Laze.records(name).create(data).then(function () { form.reset(); adding = false; load(); }, Laze.fail);
76507
- } },
76508
- fields.filter(function (field) { return field.type !== "file" && field.type !== "json"; }).map(function (field) {
76509
- return h("label", { class: "lz-field" }, label(field.name), input(field));
76510
- }),
76511
- h("button", { class: "lz-btn lz-btn-primary", type: "submit" }, "Add"),
76512
- rows.length ? h("button", { class: "lz-btn lz-btn-ghost", type: "button", onclick: function () { adding = false; render(); } }, "Cancel") : null);
76513
- var open = rows.filter(function (row) { return !isDone(row); }).length;
76514
- Laze.mount(h("div", { class: "lz-page" },
76515
- h("header", { class: "lz-header" },
76516
- h("div", {}, h("h1", { class: "lz-title" }, document.title),
76517
- h("p", { class: "lz-lede" }, open + (open === 1 ? " open item." : " open items."))),
76518
- h("div", { class: "lz-row" },
76519
- status ? h("div", { class: "lz-tabs", role: "group", "aria-label": "Show" }, ["open", "done", "all"].map(function (tab) {
76520
- return h("button", { class: "lz-tab", "aria-pressed": String(shown === tab), onclick: function () { shown = tab; render(); } }, label(tab));
76521
- })) : null,
76522
- adding ? null : h("button", { class: "lz-btn lz-btn-primary", onclick: function () { adding = true; render(); } }, "New item"))),
76523
- adding || !rows.length ? form : null,
76524
- h("div", { class: "lz-card lz-table-wrap" }, visible.length ? h("table", { class: "lz-table" },
76525
- h("thead", {}, h("tr", {},
76526
- h("th", {}, label(first.name)),
76527
- others.map(function (field) { return h("th", {}, label(field.name)); }),
76528
- status ? h("th", {}, label(status.name)) : null)),
76529
- h("tbody", {}, visible.map(function (row) {
76530
- return h("tr", {},
76531
- h("td", {}, h("strong", {}, cell(first, row))),
76532
- others.map(function (field) { return h("td", { class: "lz-muted", "data-label": label(field.name) }, cell(field, row)); }),
76533
- status ? h("td", {}, h("button", { class: "lz-btn lz-btn-ghost", title: "Move to " + next(row[status.name]),
76534
- onclick: function () {
76535
- var change = {};
76536
- change[status.name] = next(row[status.name]);
76537
- Laze.records(name).update(row.id, change).then(load, Laze.fail);
76538
- } },
76539
- h("span", { class: "lz-badge" + (tone(row[status.name]) ? " lz-badge-" + tone(row[status.name]) : "") }, row[status.name] || ""))) : null);
76540
- }))) : h("p", { class: "lz-empty" }, status ? EMPTY[shown] : EMPTY.all))));
76541
- }
76542
-
76543
- function load() {
76544
- return Laze.records(name).list({ sort: "-created" }).then(function (list) { rows = list; render(); }, Laze.fail);
76545
- }
76546
-
76547
- Laze.collections().then(function (all) {
76548
- var collection = all.filter(function (c) { return c.name === name; })[0] || all[0];
76549
- if (!collection) return Laze.fail(new Error("This app has no collection yet"));
76550
- name = collection.name;
76551
- fields = collection.schema.fields;
76552
- var selects = fields.filter(function (field) { return field.type === "select"; });
76553
- status = selects.filter(function (field) { return field.name === "status"; })[0] || selects[0] || null;
76554
- load();
76555
- Laze.subscribe(name, load);
76556
- }, Laze.fail);
76557
- })();
76558
- `;
76559
- var SUMMARY_FUNCTION = `// A server function: the app's origin answers /_laze/fn/summary by running this file.
76560
- // env.LAZE reads and writes this app's records as the person who asked; there is no other network.
76561
- export default {
76562
- async fetch(request, env) {
76563
- const page = await env.LAZE.records("items").list({ filter: "status != 'done'", perPage: 500 });
76564
- const today = new Date().toISOString().slice(0, 10);
76565
- const byStatus = {};
76566
- const byOwner = {};
76567
- let overdue = 0;
76568
- for (const item of page.items) {
76569
- byStatus[item.status] = (byStatus[item.status] || 0) + 1;
76570
- const owner = item.owner || "Unassigned";
76571
- byOwner[owner] = (byOwner[owner] || 0) + 1;
76572
- if (item.due && item.due.slice(0, 10) < today) overdue += 1;
76573
- }
76574
- console.log("summarised", page.totalItems, "open items");
76575
- return Response.json({ open: page.totalItems, overdue, byStatus, byOwner });
76576
- },
76577
- };
76578
- `;
76579
- var TRACKER_TEMPLATE = {
76580
- title: "Tracker",
76581
- summary: "A list of items with a status you click forward; the page follows the fields in laze.app.json",
76582
- appJs: APP_JS4,
76583
- functions: { summary: SUMMARY_FUNCTION },
76584
- collections: {
76585
- items: {
76586
- fields: [
76587
- { name: "title", type: "text", required: true },
76588
- { name: "owner", type: "text" },
76589
- { name: "due", type: "date" },
76590
- { name: "status", type: "select", options: ["todo", "doing", "done"], default: "todo" }
76591
- ]
76592
- }
76593
- },
76594
- views: [
76595
- {
76596
- name: "Board by status",
76597
- collection: "items",
76598
- type: "board",
76599
- groupBy: "status",
76600
- fields: ["owner", "due"]
76601
- }
76602
- ],
76603
- seed: {
76604
- items: [
76605
- { title: "Send the October invoices", owner: "Ada", status: "doing", due: "2026-10-20" },
76606
- { title: "Renew the ACME contract", owner: "Ben", status: "todo", due: "2026-10-28" },
76607
- { title: "Book the offsite venue", owner: "Cleo", status: "done", due: "2026-10-10" }
76608
- ]
76609
- }
76610
- };
76611
-
76612
- // src/templates/app-templates.ts
76613
- var STARTER_TEMPLATES = {
76614
- tracker: TRACKER_TEMPLATE,
76615
- crm: CRM_TEMPLATE,
76616
- dashboard: DASHBOARD_TEMPLATE,
76617
- form: FORM_TEMPLATE
76618
- };
76619
- function templateFiles({
76620
- template,
76621
- name: name3
76622
- }) {
76623
- return {
76624
- "index.html": indexHtml({ title: name3.replaceAll("&", "&amp;").replaceAll("<", "&lt;") }),
76625
- "app.js": template.appJs,
76626
- ...Object.fromEntries(
76627
- Object.entries(template.functions ?? {}).map(([fn, source]) => [
76628
- `functions/${fn}.js`,
76629
- source
76630
- ])
76631
- )
76632
- };
76633
- }
76634
-
76635
76465
  // src/services/app-connection-commands.service.ts
76636
76466
  var USAGE2 = `Usage:
76637
76467
  laze app connections
@@ -77394,13 +77224,7 @@ function print5({
77394
77224
  var appCreate = async ({ context, args }) => {
77395
77225
  const name3 = args.words.slice(2).join(" ").trim();
77396
77226
  if (!name3) throw new CliUsageError(USAGE5);
77397
- const templateName = flagText({ args, name: "template" });
77398
- if (templateName && !APP_TEMPLATES.includes(templateName)) {
77399
- throw new CliUsageError(
77400
- `No template called ${templateName}: pick one of ${APP_TEMPLATES.join(", ")}`
77401
- );
77402
- }
77403
- const template = templateName ? STARTER_TEMPLATES[templateName] : void 0;
77227
+ const template = flagText({ args, name: "template" });
77404
77228
  const client = await appClient({ context, args });
77405
77229
  const channel = flagText({ args, name: "channel" });
77406
77230
  const slug = flagText({ args, name: "slug" });
@@ -77409,32 +77233,67 @@ var appCreate = async ({ context, args }) => {
77409
77233
  name: name3,
77410
77234
  ...slug ? { slug } : {},
77411
77235
  ...channel ? { channel } : {},
77412
- ...visibility ? { visibility } : {}
77236
+ ...visibility ? { visibility } : {},
77237
+ ...template ? { template } : {}
77413
77238
  });
77414
77239
  const folder = resolve6(context.cwd, flagText({ args, name: "dir", fallback: app2.slug }));
77415
77240
  await mkdir16(folder, { recursive: true });
77416
- const files2 = template ? templateFiles({ template, name: name3 }) : {};
77417
- for (const [path, content] of Object.entries(files2)) {
77418
- await mkdir16(dirname16(join20(folder, path)), { recursive: true });
77419
- await writeFile16(join20(folder, path), content);
77241
+ const start2 = template ? await templateStart({ client, appId: app2.id, template }) : null;
77242
+ for (const file3 of start2?.files ?? []) {
77243
+ const target = join20(folder, ...file3.path.split("/"));
77244
+ await mkdir16(dirname16(target), { recursive: true });
77245
+ await writeFile16(
77246
+ target,
77247
+ file3.encoding === "base64" ? Buffer.from(file3.content, "base64") : file3.content
77248
+ );
77420
77249
  }
77421
77250
  const manifest = {
77422
77251
  app: { id: app2.id, name: app2.name, slug: app2.slug },
77423
- collections: template ? { ...template.collections } : {},
77424
- views: template?.views ? [...template.views] : [],
77425
- seed: template ? { ...template.seed } : {}
77252
+ collections: { ...start2?.template.collections },
77253
+ views: [...start2?.template.views ?? []],
77254
+ seed: { ...start2?.template.seed }
77426
77255
  };
77427
77256
  await writeFile16(join20(folder, APP_MANIFEST_FILE), `${JSON.stringify(manifest, null, 2)}
77428
77257
  `);
77258
+ const where = relative3(context.cwd, folder) || ".";
77429
77259
  print5({
77430
77260
  context,
77431
77261
  args,
77432
77262
  value: { app: app2, folder },
77433
- text: `Created ${app2.name} (${app2.id}) in ${relative3(context.cwd, folder) || "."}${template ? ` from the ${templateName} template` : ""}.
77434
- Next: cd ${relative3(context.cwd, folder) || "."} && laze app push -m "First version" --seed
77263
+ text: start2 ? `Created ${app2.name} (${app2.id}) from the ${template} template in ${where}; its first version is live at ${app2.publishedUrl}.
77264
+ Next: change the files in ${where} (start with README.md when there is one), then laze app push -m "<what changed>"
77265
+ ` : `Created ${app2.name} (${app2.id}) in ${where}.
77266
+ Next: cd ${where} && laze app push -m "First version" --seed
77435
77267
  `
77436
77268
  });
77437
77269
  };
77270
+ async function templateStart({
77271
+ client,
77272
+ appId,
77273
+ template
77274
+ }) {
77275
+ const [pulled, templates2] = await Promise.all([
77276
+ client.post("/api/apps/pull", { appId }),
77277
+ client.get("/api/apps/templates")
77278
+ ]);
77279
+ const found = templates2.find((entry) => entry.name === template);
77280
+ if (!found) throw new CliUsageError(`No template called ${template}`);
77281
+ return { files: pulled.files, template: found };
77282
+ }
77283
+ var appTemplates = async ({ context, args }) => {
77284
+ const client = await appClient({ context, args });
77285
+ const templates2 = await client.get("/api/apps/templates");
77286
+ const lines2 = templates2.map(
77287
+ (template) => `${template.name} v${template.version} ${template.description}
77288
+ `
77289
+ );
77290
+ print5({
77291
+ context,
77292
+ args,
77293
+ value: templates2,
77294
+ text: lines2.join("") + 'Start one with laze app create "<name>" --template <template>; its files are yours to change.\n'
77295
+ });
77296
+ };
77438
77297
  var appList = async ({ context, args }) => {
77439
77298
  const client = await appClient({ context, args });
77440
77299
  const apps = await client.get("/api/apps");
@@ -77521,6 +77380,45 @@ var appPush = async ({ context, args }) => {
77521
77380
  ` + (seeded ? seedLine(seeded) : "") + publishLine(publish)
77522
77381
  });
77523
77382
  };
77383
+ var appWrite = async ({ context, args }) => {
77384
+ const { message: message2, words } = messageOf({ args });
77385
+ const verdict = versionMessageVerdict(message2);
77386
+ if (verdict !== "ok") {
77387
+ throw new CliUsageError(
77388
+ `laze: a write needs -m "<what changed, in plain words>", such as -m "Agenda names the three goals" (${verdict})`
77389
+ );
77390
+ }
77391
+ const folder = folderOf({ context, word: void 0 });
77392
+ const remove7 = (flagText({ args, name: "remove" }) ?? "").split(",").map((path) => path.trim()).filter(Boolean);
77393
+ const files2 = await Promise.all(
77394
+ words.slice(2).map(async (word3) => {
77395
+ const path = resolve6(context.cwd, word3);
77396
+ const { bytes: _bytes, ...file3 } = buildFileOf({
77397
+ path: relative3(folder, path).split(sep3).join("/"),
77398
+ bytes: await readFile18(path)
77399
+ });
77400
+ return file3;
77401
+ })
77402
+ );
77403
+ if (files2.length + remove7.length === 0) {
77404
+ throw new CliUsageError("laze app write needs a file to write or --remove <path,...>");
77405
+ }
77406
+ const client = await appClient({ context, args });
77407
+ const appId = await appIdOf({ client, args, folder });
77408
+ const { publish, ...version2 } = await client.post("/api/apps/files/write", {
77409
+ appId,
77410
+ files: files2,
77411
+ remove: remove7,
77412
+ message: message2
77413
+ });
77414
+ print5({
77415
+ context,
77416
+ args,
77417
+ value: { version: version2, app: publish.app, publish },
77418
+ text: `Wrote ${version2.version.slice(0, 7)} "${version2.message}" (${files2.length} written, ${remove7.length} removed)
77419
+ ` + publishLine(publish)
77420
+ });
77421
+ };
77524
77422
  function seedLine(seeded) {
77525
77423
  const created = Object.entries(seeded.created).map(([name3, count5]) => `${count5} in ${name3}`);
77526
77424
  const parts = [
@@ -78278,8 +78176,10 @@ function managed(command) {
78278
78176
  }
78279
78177
  var APP_COMMANDS = {
78280
78178
  create: appCreate,
78179
+ templates: appTemplates,
78281
78180
  list: appList,
78282
78181
  push: appPush,
78182
+ write: appWrite,
78283
78183
  url: appUrl,
78284
78184
  preview: appUrl,
78285
78185
  serve: appServe,
@@ -78833,12 +78733,41 @@ function loginValuesOf({
78833
78733
  // src/services/vault-commands.service.ts
78834
78734
  import { createHash as createHash4 } from "node:crypto";
78835
78735
  import { mkdir as mkdir17, readFile as readFile19, rm as rm9, writeFile as writeFile17 } from "node:fs/promises";
78836
- import { tmpdir as tmpdir2 } from "node:os";
78736
+ import { hostname as hostname6, tmpdir as tmpdir2 } from "node:os";
78837
78737
  import { dirname as dirname17, join as join21 } from "node:path";
78738
+
78739
+ // src/rules/vault-session.rules.ts
78740
+ function vaultSessionOf({
78741
+ harnessSession,
78742
+ inherited,
78743
+ cwd,
78744
+ host: host2,
78745
+ named,
78746
+ shellPid,
78747
+ terminal
78748
+ }) {
78749
+ const card2 = inherited.KANBAN_CARD_ID?.trim() ?? "";
78750
+ const name3 = (named || inherited.LAZE_SESSION_NAME || (card2 ? `card ${card2}` : "")).trim();
78751
+ const folder = displayFolderOf({
78752
+ folder: inherited.CLAUDE_PROJECT_DIR || cwd,
78753
+ home: inherited.HOME
78754
+ });
78755
+ const base = { name: name3.slice(0, 120), host: host2.slice(0, 200), folder: folder.slice(0, 500) };
78756
+ if (harnessSession && harnessSession.harness !== "other") {
78757
+ return { ...base, harness: harnessSession.harness, id: harnessSession.sessionId.slice(0, 200) };
78758
+ }
78759
+ if (card2) return { ...base, harness: "kanban", id: card2.slice(0, 200) };
78760
+ if (terminal && shellPid) return { ...base, harness: "terminal", id: `shell ${shellPid}` };
78761
+ return { ...base, harness: "script", id: folder.slice(0, 200) || "script" };
78762
+ }
78763
+
78764
+ // src/services/vault-commands.service.ts
78838
78765
  var USAGE6 = `Usage: laze vault run <connection> --reason "<one plain sentence>" [--wait <s>] -- <command> [args...]
78839
78766
  Runs the command with the connection's values in its environment, on a Laze agent's computer,
78840
- on a machine it runs on, or where a connected agent runs, with its own key.
78841
- --channel <id> the conversation whose turn it runs in, when the agent answers in several`;
78767
+ on a machine it runs on, where a connected agent runs, or signed in as yourself, where it asks
78768
+ as the calling Claude Code, Codex, Kanban or terminal session.
78769
+ --channel <id> the conversation whose turn it runs in, when the agent answers in several
78770
+ --as <name> the session's name on the card when signed in as yourself (or LAZE_SESSION_NAME)`;
78842
78771
  var POLL_MS = 3e3;
78843
78772
  var RESTART_WAIT_MS = 12e4;
78844
78773
  var RESTART_BACKOFF_MS = [1e3, 2e3, 4e3, 8e3, 1e4];
@@ -78993,7 +78922,7 @@ async function untilAnswered({
78993
78922
  return "capped";
78994
78923
  }
78995
78924
  if (release2 === first) {
78996
- context.err(`${release2.message}. Waiting for an answer (cards expire after 12 hours)...
78925
+ context.err(`${release2.message}. Waiting for an answer (cards expire after 24 hours)...
78997
78926
  `);
78998
78927
  }
78999
78928
  await context.sleep(POLL_MS);
@@ -79079,6 +79008,22 @@ function refusedRelease(error62) {
79079
79008
  message: `laze vault: the release was refused: ${error62.message} (${error62.code})`
79080
79009
  };
79081
79010
  }
79011
+ var WHERE = "works only on a Laze agent's computer, on a machine it runs on, or signed in with `laze login` (as yourself or as a connected agent)";
79012
+ async function vaultSessionFor({
79013
+ context,
79014
+ args,
79015
+ harnessSession
79016
+ }) {
79017
+ return vaultSessionOf({
79018
+ harnessSession,
79019
+ inherited: context.environment.inherited,
79020
+ cwd: context.cwd,
79021
+ host: hostname6(),
79022
+ named: flagText({ args, name: "as" }),
79023
+ shellPid: await context.processes.parentOf(context.processes.pid),
79024
+ terminal: context.stdoutIsTerminal === true
79025
+ });
79026
+ }
79082
79027
  async function keyRelease({
79083
79028
  context,
79084
79029
  args,
@@ -79087,27 +79032,27 @@ async function keyRelease({
79087
79032
  command,
79088
79033
  deadline
79089
79034
  }) {
79090
- const where = new CliUsageError(
79091
- "laze vault run works only on a Laze agent's computer, on a machine it runs on, or signed in as a connected agent"
79092
- );
79093
79035
  const signed2 = await signedIn({ context, args }).catch(() => null);
79094
- if (signed2?.profile.kind !== "agent") throw where;
79036
+ if (signed2?.profile.kind !== "agent" && signed2?.profile.kind !== "person") {
79037
+ throw new CliUsageError(`laze vault run ${WHERE}`);
79038
+ }
79095
79039
  const { name: name3 } = signed2;
79096
- const client = forSession({
79097
- client: signed2.client,
79098
- session: await currentSessionOf({ context, args })
79099
- });
79100
- const channelId = flagText({ args, name: "channel" }) || null;
79040
+ const harnessSession = await currentSessionOf({ context, args });
79041
+ const client = forSession({ client: signed2.client, session: harnessSession });
79101
79042
  const keyPath = runKeyPathOf({ turnFile: void 0, connection, profile: name3 });
79102
79043
  const run4 = await runKeyAt({ path: keyPath });
79103
- const first = await client.post("/api/agents/me/vault/release", {
79104
- connection,
79105
- reason,
79106
- command,
79107
- recipient: run4.publicKey,
79108
- channelId
79109
- }).catch(refusedRelease);
79110
- const next = (requestId) => client.post("/api/agents/me/vault/release-status", { requestId, channelId }).catch(refusedRelease);
79044
+ const body = { connection, reason, command, recipient: run4.publicKey };
79045
+ const door = signed2.profile.kind === "person" ? {
79046
+ ask: "/api/vault/session/release",
79047
+ status: "/api/vault/session/release-status",
79048
+ extra: { session: await vaultSessionFor({ context, args, harnessSession }) }
79049
+ } : {
79050
+ ask: "/api/agents/me/vault/release",
79051
+ status: "/api/agents/me/vault/release-status",
79052
+ extra: { channelId: flagText({ args, name: "channel" }) || null }
79053
+ };
79054
+ const first = await client.post(door.ask, { ...body, ...door.extra }).catch(refusedRelease);
79055
+ const next = (requestId) => client.post(door.status, { requestId, ...door.extra }).catch(refusedRelease);
79111
79056
  const release2 = await untilAnswered({ context, first, next, deadline });
79112
79057
  return settled({ context, release: release2, run: run4, keyPath });
79113
79058
  }
@@ -81487,6 +81432,8 @@ var computeConfig = Config.define((c) => ({
81487
81432
  var priceId = external_exports.string().min(1).optional();
81488
81433
  var billingConfig = Config.define((c) => ({
81489
81434
  publicBaseUrl,
81435
+ /** The first alias (`laze.so` on prod) is the short origin referral links are shared on. */
81436
+ publicOriginAliases,
81490
81437
  /** Stripe's API, or the payment simulator in tests and local stacks. */
81491
81438
  stripeApiBase: c.env("STRIPE_API_BASE", external_exports.url().default("https://api.stripe.com")),
81492
81439
  /** Team's graduated per-person price (`TEAM_PRICING`), one quantity per person. */
@@ -84181,6 +84128,7 @@ function conversationLineOf(chat) {
84181
84128
  // src/services/conversation-commands.service.ts
84182
84129
  var CONVERSATION_USAGE = `Usage:
84183
84130
  laze conversation new <agent> <text|-> start a conversation with an agent (people)
84131
+ [--about <message id>] continue from a message: the first one quotes it
84184
84132
  laze conversation list [--agent <agent>] yours (an agent: its own; --unnamed for untitled)
84185
84133
  laze conversation rename <id> <title> name it (its agent, or a person in it)
84186
84134
  laze conversation join <id> open one of an agent shared with you
@@ -84201,9 +84149,11 @@ async function conversationNew({ context, args }) {
84201
84149
  text: typed,
84202
84150
  leaves: async () => false
84203
84151
  });
84152
+ const about = flagText({ args, name: "about" });
84204
84153
  const started = await client.post("/api/agents/me/conversations", {
84205
84154
  agent: agent3,
84206
- text: text2
84155
+ text: text2,
84156
+ ...about ? { about } : {}
84207
84157
  });
84208
84158
  if (args.flags.json) return context.out(`${JSON.stringify(started, null, 2)}
84209
84159
  `);
@@ -90939,7 +90889,6 @@ function credentialProcessJson(fields) {
90939
90889
 
90940
90890
  // src/services/vault-batch.service.ts
90941
90891
  import { rm as rm14 } from "node:fs/promises";
90942
- var WHERE = "laze vault env works only on a Laze agent's computer, on a machine it runs on, or signed in as a connected agent";
90943
90892
  async function batchOf({ response }) {
90944
90893
  const text2 = await response.text();
90945
90894
  if (!response.ok) {
@@ -90984,21 +90933,26 @@ async function doorOf({
90984
90933
  };
90985
90934
  }
90986
90935
  const signed2 = await signedIn({ context, args }).catch(() => null);
90987
- if (signed2?.profile.kind !== "agent") throw new CliUsageError(WHERE);
90936
+ if (signed2?.profile.kind !== "agent" && signed2?.profile.kind !== "person") {
90937
+ throw new CliUsageError(`laze vault env ${WHERE}`);
90938
+ }
90988
90939
  const { name: name3 } = signed2;
90989
- const client = forSession({
90990
- client: signed2.client,
90991
- session: await currentSessionOf({ context, args })
90992
- });
90993
- const channelId = flagText({ args, name: "channel" }) || null;
90940
+ const harnessSession = await currentSessionOf({ context, args });
90941
+ const client = forSession({ client: signed2.client, session: harnessSession });
90942
+ const door = signed2.profile.kind === "person" ? {
90943
+ ask: "/api/vault/session/release-batch",
90944
+ status: "/api/vault/session/release-status",
90945
+ extra: { session: await vaultSessionFor({ context, args, harnessSession }) }
90946
+ } : {
90947
+ ask: "/api/agents/me/vault/release-batch",
90948
+ status: "/api/agents/me/vault/release-status",
90949
+ extra: { channelId: flagText({ args, name: "channel" }) || null }
90950
+ };
90994
90951
  return {
90995
90952
  keyPath: runKeyPathOf({ turnFile: void 0, connection: keyName, profile: name3 }),
90996
90953
  ask: async (body) => {
90997
90954
  try {
90998
- return await client.post("/api/agents/me/vault/release-batch", {
90999
- ...body,
91000
- channelId
91001
- });
90955
+ return await client.post(door.ask, { ...body, ...door.extra });
91002
90956
  } catch (error62) {
91003
90957
  if (!(error62 instanceof LazeApiError)) throw error62;
91004
90958
  throw new CliUsageError(
@@ -91006,7 +90960,7 @@ async function doorOf({
91006
90960
  );
91007
90961
  }
91008
90962
  },
91009
- status: (requestId) => client.post("/api/agents/me/vault/release-status", { requestId, channelId }).catch(refusedRelease)
90963
+ status: (requestId) => client.post(door.status, { requestId, ...door.extra }).catch(refusedRelease)
91010
90964
  };
91011
90965
  }
91012
90966
  async function resolveBatch({
@@ -91029,7 +90983,7 @@ async function untilAllAnswered({
91029
90983
  if (waiting.size === 0) return answered;
91030
90984
  const [first] = waiting.values();
91031
90985
  context.err(
91032
- `laze vault: ${[...waiting.keys()].join(", ")} wait for an answer (${first?.message ?? "a card"}); cards expire after 12 hours...
90986
+ `laze vault: ${[...waiting.keys()].join(", ")} wait for an answer (${first?.message ?? "a card"}); cards expire after 24 hours...
91033
90987
  `
91034
90988
  );
91035
90989
  while (waiting.size > 0) {
@@ -92599,7 +92553,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
92599
92553
  laze emoji list | add <name> <file> [--alias <a,b>] | alias <alias> <name> | remove <name> the workspace's custom emoji
92600
92554
  laze status set <emoji> [text] [--for 30m|1h|4h|today|week|never] your status next to your name (people)
92601
92555
  laze status clear | away | active clear it, or set yourself away by hand until active
92602
- laze conversation new <agent> <text|-> start a conversation with an agent; it names it
92556
+ laze conversation new <agent> <text|-> [--about <message id>] start a conversation with an agent; it names it
92603
92557
  laze conversation list [--agent <agent>] [--unnamed] your conversations with agents
92604
92558
  laze conversation rename <id> <title> name a conversation (its agent, or a person in it)
92605
92559
  laze conversation join|close <id> open one of an agent shared with you, or leave it
@@ -92643,7 +92597,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
92643
92597
  laze memory get|set|append|history <file>, search, pull SOUL.md, AGENTS.md, a channel's MEMORY.md
92644
92598
  laze wiki list|get|put|search|history|mv|rm the workspace wiki
92645
92599
  laze skill list|install|show|pull|rm|update|pin|unpin your agent's skills and the catalogue
92646
- laze app create <name> --template crm ... build an app: create, push (live at once), versions, revert
92600
+ laze app create <name> --template slides ... build an app from a template (laze app templates), push, revert
92647
92601
  laze app every laze app command, with its flags
92648
92602
  laze agents list | laze agents status <name> the workspace's agents and their context
92649
92603
  laze agents show <name> [--json] an agent's profile: kind, how it runs, intelligence
@@ -92685,7 +92639,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
92685
92639
  laze agent faces every agent's sloth seed or picture
92686
92640
  laze adopt codex [--thread <id>] answer Laze messages in a Codex thread
92687
92641
  laze adopt codex --status | --stop the background adopt that laze agent link started
92688
- laze vault run <name> --reason "<why>" -- <cmd> run a command with a vault connection (agents)
92642
+ laze vault run <name> --reason "<why>" -- <cmd> run a command with a vault connection
92689
92643
  laze vault env [<file>] --reason "<why>" -- <cmd> run a command with every key .env.vault names (agents)
92690
92644
  laze vault env --names | --shell what .env.vault resolves to; export lines for a shell hook
92691
92645
  laze vault aws <connection> [--reason "<why>"] AWS credential_process JSON from a short-lived STS session