@adelie/server 0.6.4 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-GO6G445C.js";
9
9
  import {
10
10
  TICKET_SLUG_PATTERN
11
- } from "./chunk-4WQFVLLR.js";
11
+ } from "./chunk-ADMC5ULO.js";
12
12
  import {
13
13
  MachinesRepo
14
14
  } from "./chunk-HMTT2PX4.js";
@@ -67,7 +67,7 @@ import zlib4 from "zlib";
67
67
  import fs54 from "fs";
68
68
  import fsp4 from "fs/promises";
69
69
  import path61 from "path";
70
- import { Hono as Hono56 } from "hono";
70
+ import { Hono as Hono57 } from "hono";
71
71
  import { bodyLimit as bodyLimit2 } from "hono/body-limit";
72
72
 
73
73
  // src/services/attachment-limits.ts
@@ -3820,15 +3820,15 @@ function bindTerminalStream(ws, session, url, log) {
3820
3820
  }
3821
3821
 
3822
3822
  // src/hmr/platform.ts
3823
- import { Hono as Hono55 } from "hono";
3823
+ import { Hono as Hono56 } from "hono";
3824
3824
 
3825
3825
  // src/platform.ts
3826
- import { Component as Component77, Module as Module23, moduleDefOf as moduleDefOf2, Use as Use81 } from "@adelie/core/kernel";
3826
+ import { Component as Component78, Module as Module23, moduleDefOf as moduleDefOf2, Use as Use82 } from "@adelie/core/kernel";
3827
3827
  import { DEFAULT_PROJECT_ID as DEFAULT_PROJECT_ID3, DEFAULT_PROJECT_NAME as DEFAULT_PROJECT_NAME2 } from "@adelie/core";
3828
3828
 
3829
3829
  // src/ifaces.json
3830
3830
  var ifaces_default = {
3831
- hash: "da800d0f70f06b038ed764c260405cd423239cc7af5675c546d05d6d1e7fdd72",
3831
+ hash: "32218c4077f2f226d2f9af68eb3a56e7c6915680f7d46ab6fde2c94c5ee502c1",
3832
3832
  ifaces: {
3833
3833
  "@adelie/server#Access": {
3834
3834
  name: "Access",
@@ -5231,6 +5231,11 @@ var ifaces_default = {
5231
5231
  methods: {},
5232
5232
  slots: {}
5233
5233
  },
5234
+ "@adelie/server#AsrRoutes": {
5235
+ name: "AsrRoutes",
5236
+ methods: {},
5237
+ slots: {}
5238
+ },
5234
5239
  "@adelie/server#Auth": {
5235
5240
  name: "Auth",
5236
5241
  methods: {
@@ -16085,6 +16090,26 @@ var ifaces_default = {
16085
16090
  returns: {
16086
16091
  void: true
16087
16092
  }
16093
+ },
16094
+ getAsrSettings: {
16095
+ params: [],
16096
+ returns: {
16097
+ data: {
16098
+ $ref: "@adelie/server#AsrSettings"
16099
+ }
16100
+ }
16101
+ },
16102
+ setAsrSettings: {
16103
+ params: [
16104
+ {
16105
+ data: {
16106
+ $ref: "@adelie/server#AsrSettings"
16107
+ }
16108
+ }
16109
+ ],
16110
+ returns: {
16111
+ void: true
16112
+ }
16088
16113
  }
16089
16114
  },
16090
16115
  slots: {}
@@ -17840,6 +17865,26 @@ var ifaces_default = {
17840
17865
  returns: {
17841
17866
  void: true
17842
17867
  }
17868
+ },
17869
+ getAsrSettings: {
17870
+ params: [],
17871
+ returns: {
17872
+ data: {
17873
+ $ref: "@adelie/server#AsrSettings"
17874
+ }
17875
+ }
17876
+ },
17877
+ setAsrSettings: {
17878
+ params: [
17879
+ {
17880
+ data: {
17881
+ $ref: "@adelie/server#AsrSettings"
17882
+ }
17883
+ }
17884
+ ],
17885
+ returns: {
17886
+ void: true
17887
+ }
17843
17888
  }
17844
17889
  },
17845
17890
  slots: {}
@@ -23245,6 +23290,11 @@ var ifaces_default = {
23245
23290
  legacySectionPresent: "boolean"
23246
23291
  },
23247
23292
  "@adelie/server#ApprovalMode": "'allow-all'|'deny-all'|'read-only'|'always-ask'",
23293
+ "@adelie/server#AsrSettings": {
23294
+ baseUrl: "string",
23295
+ model: "string",
23296
+ apiKey: "string"
23297
+ },
23248
23298
  "@adelie/server#AuthSessionRow": {
23249
23299
  tokenHash: "string",
23250
23300
  userId: "string",
@@ -27870,6 +27920,7 @@ var ifaces_default = {
27870
27920
  "InstallRoutes",
27871
27921
  "VersionRoutes",
27872
27922
  "FeedbackRoutes",
27923
+ "AsrRoutes",
27873
27924
  "HmrRoutes",
27874
27925
  "DesktopRoutes",
27875
27926
  "DesktopUpdateRoutes",
@@ -27900,6 +27951,30 @@ var ifaces_default = {
27900
27951
  contributes: {},
27901
27952
  children: []
27902
27953
  },
27954
+ AsrRoutes: {
27955
+ name: "AsrRoutes",
27956
+ kind: "component",
27957
+ requires: {
27958
+ settings: {
27959
+ iface: "@adelie/server#Settings",
27960
+ from: "SettingsModule"
27961
+ }
27962
+ },
27963
+ provides: {
27964
+ AsrRoutes: "@adelie/server#AsrRoutes"
27965
+ },
27966
+ contributes: {
27967
+ "HttpModule.routes": [
27968
+ {
27969
+ id: "asr",
27970
+ prefix: "/api/asr",
27971
+ auth: "user",
27972
+ order: 55
27973
+ }
27974
+ ]
27975
+ },
27976
+ children: []
27977
+ },
27903
27978
  AuthRoutes: {
27904
27979
  name: "AuthRoutes",
27905
27980
  kind: "component",
@@ -39568,15 +39643,15 @@ function createQQScanTransport(base = QQ_SCAN_BASE) {
39568
39643
  return {
39569
39644
  async createBindTask(key2) {
39570
39645
  const data = await post("/lite/create_bind_task", { key: key2 });
39571
- const taskId = data?.task_id;
39572
- if (typeof taskId !== "string" || taskId === "") {
39646
+ const taskId2 = data?.task_id;
39647
+ if (typeof taskId2 !== "string" || taskId2 === "") {
39573
39648
  throw new Error("QQ scan request failed: no task id was returned");
39574
39649
  }
39575
- return taskId;
39650
+ return taskId2;
39576
39651
  },
39577
- async pollBindResult(taskId) {
39652
+ async pollBindResult(taskId2) {
39578
39653
  const data = await post("/lite/poll_bind_result", {
39579
- task_id: taskId
39654
+ task_id: taskId2
39580
39655
  });
39581
39656
  const first = Array.isArray(data) ? data[0] : data;
39582
39657
  return { status: statusOf(first?.status), bots: botsOf(data) };
@@ -39586,8 +39661,8 @@ function createQQScanTransport(base = QQ_SCAN_BASE) {
39586
39661
  function newQQScanKey() {
39587
39662
  return randomBytes3(QQ_SCAN_KEY_BYTES).toString("base64");
39588
39663
  }
39589
- function qqScanQrUrl(taskId, source = "") {
39590
- return `${QQ_SCAN_QR_PAGE}?task_id=${encodeURIComponent(taskId)}&source=${encodeURIComponent(source)}&_wv=2`;
39664
+ function qqScanQrUrl(taskId2, source = "") {
39665
+ return `${QQ_SCAN_QR_PAGE}?task_id=${encodeURIComponent(taskId2)}&source=${encodeURIComponent(source)}&_wv=2`;
39591
39666
  }
39592
39667
  function decryptQQBotSecret(keyBase64, encryptedBase64) {
39593
39668
  const key2 = Buffer.from(keyBase64, "base64");
@@ -39630,41 +39705,41 @@ var QQScanService = class {
39630
39705
  async start(sessionId) {
39631
39706
  this.sweep();
39632
39707
  const key2 = newQQScanKey();
39633
- const taskId = await this.transport.createBindTask(key2);
39708
+ const taskId2 = await this.transport.createBindTask(key2);
39634
39709
  this.evictOwn(sessionId);
39635
- this.tasks.set(taskId, { key: key2, sessionId, createdAt: this.now(), claimed: false });
39710
+ this.tasks.set(taskId2, { key: key2, sessionId, createdAt: this.now(), claimed: false });
39636
39711
  this.armSweep();
39637
- return { taskId, qrUrl: qqScanQrUrl(taskId), pollMs: QQ_SCAN_POLL_MS };
39712
+ return { taskId: taskId2, qrUrl: qqScanQrUrl(taskId2), pollMs: QQ_SCAN_POLL_MS };
39638
39713
  }
39639
39714
  /**
39640
39715
  * Polls one task. Returns null when the task id is not one this Session started (an
39641
39716
  * unknown id, another Session's, one already consumed, or one another poll is resolving
39642
39717
  * right now) — the caller answers 404, which is also what a replay gets.
39643
39718
  */
39644
- async poll(sessionId, taskId) {
39645
- const task = this.tasks.get(taskId);
39719
+ async poll(sessionId, taskId2) {
39720
+ const task = this.tasks.get(taskId2);
39646
39721
  if (task === void 0 || task.sessionId !== sessionId || task.claimed) return null;
39647
39722
  task.claimed = true;
39648
39723
  if (this.now() - task.createdAt > QQ_SCAN_TASK_TTL_MS) {
39649
- this.tasks.delete(taskId);
39724
+ this.tasks.delete(taskId2);
39650
39725
  return { status: "expired" };
39651
39726
  }
39652
39727
  let result;
39653
39728
  try {
39654
- result = await this.transport.pollBindResult(taskId);
39729
+ result = await this.transport.pollBindResult(taskId2);
39655
39730
  } catch (err) {
39656
39731
  task.claimed = false;
39657
39732
  throw err;
39658
39733
  }
39659
39734
  if (result.status === "expired") {
39660
- this.tasks.delete(taskId);
39735
+ this.tasks.delete(taskId2);
39661
39736
  return { status: "expired" };
39662
39737
  }
39663
39738
  if (result.status !== "completed") {
39664
39739
  task.claimed = false;
39665
39740
  return { status: result.status };
39666
39741
  }
39667
- this.tasks.delete(taskId);
39742
+ this.tasks.delete(taskId2);
39668
39743
  const bot = result.bots[0];
39669
39744
  if (bot === void 0) {
39670
39745
  throw new Error("QQ reported the scan complete but returned no bot");
@@ -39673,13 +39748,13 @@ var QQScanService = class {
39673
39748
  return { status: "completed", bot: { appId: bot.appId, appSecret } };
39674
39749
  }
39675
39750
  /** Drops a task the user walked away from (the editor's cancel, and its unmount). */
39676
- cancel(sessionId, taskId) {
39677
- if (this.tasks.get(taskId)?.sessionId === sessionId) this.tasks.delete(taskId);
39751
+ cancel(sessionId, taskId2) {
39752
+ if (this.tasks.get(taskId2)?.sessionId === sessionId) this.tasks.delete(taskId2);
39678
39753
  }
39679
39754
  /** Session-delete cascade and bind removal: forget anything this Session had in flight. */
39680
39755
  cancelSession(sessionId) {
39681
- for (const [taskId, task] of this.tasks) {
39682
- if (task.sessionId === sessionId) this.tasks.delete(taskId);
39756
+ for (const [taskId2, task] of this.tasks) {
39757
+ if (task.sessionId === sessionId) this.tasks.delete(taskId2);
39683
39758
  }
39684
39759
  }
39685
39760
  /**
@@ -39691,20 +39766,20 @@ var QQScanService = class {
39691
39766
  const own = [...this.tasks].filter(([, task]) => task.sessionId === sessionId);
39692
39767
  if (own.length < QQ_SCAN_MAX_TASKS_PER_SESSION) return;
39693
39768
  own.sort((a, b) => a[1].createdAt - b[1].createdAt);
39694
- for (const [taskId] of own.slice(0, own.length - QQ_SCAN_MAX_TASKS_PER_SESSION + 1)) {
39695
- this.tasks.delete(taskId);
39769
+ for (const [taskId2] of own.slice(0, own.length - QQ_SCAN_MAX_TASKS_PER_SESSION + 1)) {
39770
+ this.tasks.delete(taskId2);
39696
39771
  }
39697
39772
  }
39698
39773
  /** Drops expired tasks, then the oldest ones if the table is still over its backstop. */
39699
39774
  sweep() {
39700
39775
  const cutoff = this.now() - QQ_SCAN_TASK_TTL_MS;
39701
- for (const [taskId, task] of this.tasks) {
39702
- if (task.createdAt <= cutoff) this.tasks.delete(taskId);
39776
+ for (const [taskId2, task] of this.tasks) {
39777
+ if (task.createdAt <= cutoff) this.tasks.delete(taskId2);
39703
39778
  }
39704
39779
  if (this.tasks.size < QQ_SCAN_MAX_TASKS) return;
39705
39780
  const byAge = [...this.tasks].sort((a, b) => a[1].createdAt - b[1].createdAt);
39706
- for (const [taskId] of byAge.slice(0, this.tasks.size - QQ_SCAN_MAX_TASKS + 1)) {
39707
- this.tasks.delete(taskId);
39781
+ for (const [taskId2] of byAge.slice(0, this.tasks.size - QQ_SCAN_MAX_TASKS + 1)) {
39782
+ this.tasks.delete(taskId2);
39708
39783
  }
39709
39784
  }
39710
39785
  /**
@@ -42459,8 +42534,8 @@ var WeChatScanService = class {
42459
42534
  this.sweep();
42460
42535
  const { qrcode, qrUrl } = await this.transport.createQrCode();
42461
42536
  this.evictOwn(sessionId);
42462
- const taskId = randomBytes5(16).toString("hex");
42463
- this.tasks.set(taskId, {
42537
+ const taskId2 = randomBytes5(16).toString("hex");
42538
+ this.tasks.set(taskId2, {
42464
42539
  qrcode,
42465
42540
  sessionId,
42466
42541
  createdAt: this.now(),
@@ -42468,7 +42543,7 @@ var WeChatScanService = class {
42468
42543
  baseUrl: WECHAT_API_BASE
42469
42544
  });
42470
42545
  this.armSweep();
42471
- return { taskId, qrUrl, pollMs: WECHAT_SCAN_POLL_MS };
42546
+ return { taskId: taskId2, qrUrl, pollMs: WECHAT_SCAN_POLL_MS };
42472
42547
  }
42473
42548
  /**
42474
42549
  * Records the pairing code the person read off their phone. It rides the NEXT poll rather
@@ -42478,8 +42553,8 @@ var WeChatScanService = class {
42478
42553
  * Returns false for a task this Session did not start, which the caller answers with the
42479
42554
  * same 404 an unknown poll gets.
42480
42555
  */
42481
- submitVerifyCode(sessionId, taskId, verifyCode) {
42482
- const task = this.tasks.get(taskId);
42556
+ submitVerifyCode(sessionId, taskId2, verifyCode) {
42557
+ const task = this.tasks.get(taskId2);
42483
42558
  if (task === void 0 || task.sessionId !== sessionId) return false;
42484
42559
  task.verifyCode = verifyCode;
42485
42560
  return true;
@@ -42489,11 +42564,11 @@ var WeChatScanService = class {
42489
42564
  * unknown id, another Session's, or one already resolved — which the caller answers 404,
42490
42565
  * and which is also what a replay gets.
42491
42566
  */
42492
- async poll(sessionId, taskId) {
42493
- const task = this.tasks.get(taskId);
42567
+ async poll(sessionId, taskId2) {
42568
+ const task = this.tasks.get(taskId2);
42494
42569
  if (task === void 0 || task.sessionId !== sessionId) return null;
42495
42570
  if (this.now() - task.createdAt > WECHAT_SCAN_TASK_TTL_MS) {
42496
- this.tasks.delete(taskId);
42571
+ this.tasks.delete(taskId2);
42497
42572
  return { status: "expired" };
42498
42573
  }
42499
42574
  if (task.polling) return { status: "pending" };
@@ -42516,24 +42591,24 @@ var WeChatScanService = class {
42516
42591
  task.verifyCode = void 0;
42517
42592
  }
42518
42593
  if (result.status === "expired" || result.status === "blocked" || result.status === "already_bound") {
42519
- this.tasks.delete(taskId);
42594
+ this.tasks.delete(taskId2);
42520
42595
  return { status: result.status };
42521
42596
  }
42522
42597
  if (result.status !== "completed") return { status: result.status };
42523
- this.tasks.delete(taskId);
42598
+ this.tasks.delete(taskId2);
42524
42599
  if (result.bot === void 0) {
42525
42600
  throw new Error("WeChat reported the scan confirmed but returned no credentials");
42526
42601
  }
42527
42602
  return { status: "completed", bot: result.bot };
42528
42603
  }
42529
42604
  /** Drops a task the user walked away from (the editor's cancel, and its unmount). */
42530
- cancel(sessionId, taskId) {
42531
- if (this.tasks.get(taskId)?.sessionId === sessionId) this.tasks.delete(taskId);
42605
+ cancel(sessionId, taskId2) {
42606
+ if (this.tasks.get(taskId2)?.sessionId === sessionId) this.tasks.delete(taskId2);
42532
42607
  }
42533
42608
  /** Session-delete cascade and bind removal: forget anything this Session had in flight. */
42534
42609
  cancelSession(sessionId) {
42535
- for (const [taskId, task] of this.tasks) {
42536
- if (task.sessionId === sessionId) this.tasks.delete(taskId);
42610
+ for (const [taskId2, task] of this.tasks) {
42611
+ if (task.sessionId === sessionId) this.tasks.delete(taskId2);
42537
42612
  }
42538
42613
  }
42539
42614
  /** Drops this Session's oldest tasks until one more fits under its own ceiling. */
@@ -42541,20 +42616,20 @@ var WeChatScanService = class {
42541
42616
  const own = [...this.tasks].filter(([, task]) => task.sessionId === sessionId);
42542
42617
  if (own.length < WECHAT_SCAN_MAX_TASKS_PER_SESSION) return;
42543
42618
  own.sort((a, b) => a[1].createdAt - b[1].createdAt);
42544
- for (const [taskId] of own.slice(0, own.length - WECHAT_SCAN_MAX_TASKS_PER_SESSION + 1)) {
42545
- this.tasks.delete(taskId);
42619
+ for (const [taskId2] of own.slice(0, own.length - WECHAT_SCAN_MAX_TASKS_PER_SESSION + 1)) {
42620
+ this.tasks.delete(taskId2);
42546
42621
  }
42547
42622
  }
42548
42623
  /** Drops expired tasks, then the oldest ones if the table is still over its backstop. */
42549
42624
  sweep() {
42550
42625
  const cutoff = this.now() - WECHAT_SCAN_TASK_TTL_MS;
42551
- for (const [taskId, task] of this.tasks) {
42552
- if (task.createdAt <= cutoff) this.tasks.delete(taskId);
42626
+ for (const [taskId2, task] of this.tasks) {
42627
+ if (task.createdAt <= cutoff) this.tasks.delete(taskId2);
42553
42628
  }
42554
42629
  if (this.tasks.size < WECHAT_SCAN_MAX_TASKS) return;
42555
42630
  const byAge = [...this.tasks].sort((a, b) => a[1].createdAt - b[1].createdAt);
42556
- for (const [taskId] of byAge.slice(0, this.tasks.size - WECHAT_SCAN_MAX_TASKS + 1)) {
42557
- this.tasks.delete(taskId);
42631
+ for (const [taskId2] of byAge.slice(0, this.tasks.size - WECHAT_SCAN_MAX_TASKS + 1)) {
42632
+ this.tasks.delete(taskId2);
42558
42633
  }
42559
42634
  }
42560
42635
  /**
@@ -43044,10 +43119,10 @@ function sessionMessagingRoutes(deps) {
43044
43119
  const row = resolveSession(c);
43045
43120
  deps.access.requireProjectOwner(c.var.user.userId, row.projectId);
43046
43121
  const body = await readJson(c);
43047
- const taskId = requireString(body, "taskId", { minLen: 1, maxLen: 500 });
43122
+ const taskId2 = requireString(body, "taskId", { minLen: 1, maxLen: 500 });
43048
43123
  let result;
43049
43124
  try {
43050
- result = await deps.qqScan.poll(row.sessionId, taskId);
43125
+ result = await deps.qqScan.poll(row.sessionId, taskId2);
43051
43126
  } catch (err) {
43052
43127
  throw new HttpError(502, "qq_scan_failed", err instanceof Error ? err.message : String(err));
43053
43128
  }
@@ -43151,10 +43226,10 @@ function sessionMessagingRoutes(deps) {
43151
43226
  const row = resolveSession(c);
43152
43227
  deps.access.requireProjectOwner(c.var.user.userId, row.projectId);
43153
43228
  const body = await readJson(c);
43154
- const taskId = requireString(body, "taskId", { minLen: 1, maxLen: 500 });
43229
+ const taskId2 = requireString(body, "taskId", { minLen: 1, maxLen: 500 });
43155
43230
  let result;
43156
43231
  try {
43157
- result = await deps.wechatScan.poll(row.sessionId, taskId);
43232
+ result = await deps.wechatScan.poll(row.sessionId, taskId2);
43158
43233
  } catch (err) {
43159
43234
  throw new HttpError(
43160
43235
  502,
@@ -43189,10 +43264,10 @@ function sessionMessagingRoutes(deps) {
43189
43264
  const row = resolveSession(c);
43190
43265
  deps.access.requireProjectOwner(c.var.user.userId, row.projectId);
43191
43266
  const body = await readJson(c);
43192
- const taskId = requireString(body, "taskId", { minLen: 1, maxLen: 500 });
43267
+ const taskId2 = requireString(body, "taskId", { minLen: 1, maxLen: 500 });
43193
43268
  const verifyCode = requireString(body, "verifyCode", { minLen: 1, maxLen: 32 }).trim();
43194
43269
  if (verifyCode === "") throw badRequest("verifyCode must not be blank.");
43195
- if (!deps.wechatScan.submitVerifyCode(row.sessionId, taskId, verifyCode)) {
43270
+ if (!deps.wechatScan.submitVerifyCode(row.sessionId, taskId2, verifyCode)) {
43196
43271
  throw new HttpError(
43197
43272
  404,
43198
43273
  "wechat_scan_task_unknown",
@@ -45384,6 +45459,301 @@ __decorateElement(_init73, 5, "routes", _routes_dec3, FeedbackRoutes);
45384
45459
  FeedbackRoutes = __decorateElement(_init73, 0, "FeedbackRoutes", _FeedbackRoutes_decorators, FeedbackRoutes);
45385
45460
  __runInitializers(_init73, 1, FeedbackRoutes);
45386
45461
 
45462
+ // src/services/asr.ts
45463
+ import { setTimeout as sleep2 } from "timers/promises";
45464
+ import { WebSocket as WebSocket2 } from "undici";
45465
+ var DEFAULT_ASR_BASE_URL = "https://tokendance.space";
45466
+ var DEFAULT_ASR_MODEL = "qwen-audio-3.1-asr-flash-streaming";
45467
+ var ASR_WS_PATH = "/gateway/alibaba/api-ws/v1/inference";
45468
+ var BAILIAN_WS_PATH = "/api-ws/v1/inference";
45469
+ var ASR_SAMPLE_RATE = 16e3;
45470
+ var ASR_MAX_SECONDS = 60;
45471
+ var ASR_MAX_BYTES = ASR_SAMPLE_RATE * 2 * ASR_MAX_SECONDS;
45472
+ var CHUNK_BYTES = ASR_SAMPLE_RATE * 0.2;
45473
+ var CHUNK_PAUSE_MS = 10;
45474
+ var HANDSHAKE_TIMEOUT_MS = 15e3;
45475
+ var PROBE_TIMEOUT_MS2 = 8e3;
45476
+ var OVERALL_SLACK_MS = 3e4;
45477
+ var AsrError = class extends Error {
45478
+ constructor(code2, message4, status) {
45479
+ super(message4);
45480
+ this.code = code2;
45481
+ this.status = status;
45482
+ this.name = "AsrError";
45483
+ }
45484
+ code;
45485
+ status;
45486
+ };
45487
+ function asrWebSocketUrl(baseUrl) {
45488
+ const site = baseUrl.trim() === "" ? DEFAULT_ASR_BASE_URL : baseUrl.trim();
45489
+ let url;
45490
+ try {
45491
+ url = new URL(site);
45492
+ } catch {
45493
+ throw new Error(`ASR base URL is not a URL: ${site}`);
45494
+ }
45495
+ const bailian = url.hostname === "aliyuncs.com" || url.hostname.endsWith(".aliyuncs.com");
45496
+ const scheme = url.protocol === "http:" ? "ws:" : "wss:";
45497
+ return `${scheme}//${url.host}${bailian ? BAILIAN_WS_PATH : ASR_WS_PATH}`;
45498
+ }
45499
+ function asrModel(model) {
45500
+ return model.trim() === "" ? DEFAULT_ASR_MODEL : model.trim();
45501
+ }
45502
+ function parseAsrEvent(raw) {
45503
+ let parsed;
45504
+ try {
45505
+ parsed = JSON.parse(raw);
45506
+ } catch {
45507
+ return null;
45508
+ }
45509
+ const header = asRecord(asRecord(parsed)?.header);
45510
+ if (header === null) return null;
45511
+ const event = header.event;
45512
+ if (event === "task-started") return { kind: "started" };
45513
+ if (event === "task-finished") return { kind: "finished" };
45514
+ if (event === "task-failed") {
45515
+ return {
45516
+ kind: "failed",
45517
+ code: typeof header.error_code === "string" ? header.error_code : "asr_failed",
45518
+ message: typeof header.error_message === "string" ? header.error_message : ""
45519
+ };
45520
+ }
45521
+ if (event === "result-generated") {
45522
+ const sentence = asRecord(asRecord(asRecord(parsed)?.payload)?.output)?.sentence;
45523
+ if (!isRecord2(sentence)) return null;
45524
+ const id = sentence.sentence_id;
45525
+ return {
45526
+ kind: "sentence",
45527
+ id: typeof id === "string" || typeof id === "number" ? String(id) : null,
45528
+ text: typeof sentence.text === "string" ? sentence.text : "",
45529
+ final: sentence.sentence_end === true
45530
+ };
45531
+ }
45532
+ return null;
45533
+ }
45534
+ function transcriptOf(events) {
45535
+ const transcript = new Transcript();
45536
+ for (const event of events) {
45537
+ if (event.kind === "sentence") transcript.add(event);
45538
+ }
45539
+ return transcript.value;
45540
+ }
45541
+ var Transcript = class {
45542
+ sentences = [];
45543
+ at = /* @__PURE__ */ new Map();
45544
+ add(sentence) {
45545
+ if (sentence.id === null) {
45546
+ if (sentence.final) this.sentences.push({ text: sentence.text });
45547
+ return;
45548
+ }
45549
+ const index = this.at.get(sentence.id);
45550
+ if (index === void 0) {
45551
+ this.at.set(sentence.id, this.sentences.length);
45552
+ this.sentences.push({ text: sentence.text });
45553
+ return;
45554
+ }
45555
+ this.sentences[index].text = sentence.text;
45556
+ }
45557
+ get value() {
45558
+ return this.sentences.map((s) => s.text).join("");
45559
+ }
45560
+ };
45561
+ async function transcribe(req) {
45562
+ const socket = new WebSocket2(asrWebSocketUrl(req.baseUrl), {
45563
+ headers: { Authorization: `Bearer ${req.apiKey}` }
45564
+ });
45565
+ const frames = new FrameStream(socket);
45566
+ const deadline = Date.now() + OVERALL_SLACK_MS + durationMs(req.pcm.length, req.sampleRate);
45567
+ try {
45568
+ try {
45569
+ await frames.opened(HANDSHAKE_TIMEOUT_MS);
45570
+ } catch (err) {
45571
+ throw err instanceof AsrError ? await explainHandshake(err, req) : err;
45572
+ }
45573
+ const task = taskId();
45574
+ socket.send(
45575
+ JSON.stringify({
45576
+ header: { action: "run-task", task_id: task, streaming: "duplex" },
45577
+ payload: {
45578
+ task_group: "audio",
45579
+ task: "asr",
45580
+ function: "recognition",
45581
+ model: asrModel(req.model),
45582
+ parameters: { format: "pcm", sample_rate: req.sampleRate },
45583
+ input: {}
45584
+ }
45585
+ })
45586
+ );
45587
+ await untilStarted(frames, deadline);
45588
+ for (let offset = 0; offset < req.pcm.length; offset += CHUNK_BYTES) {
45589
+ socket.send(req.pcm.subarray(offset, offset + CHUNK_BYTES));
45590
+ if (offset + CHUNK_BYTES < req.pcm.length) await sleep2(CHUNK_PAUSE_MS);
45591
+ }
45592
+ socket.send(
45593
+ JSON.stringify({
45594
+ header: { action: "finish-task", task_id: task, streaming: "duplex" },
45595
+ payload: { input: {} }
45596
+ })
45597
+ );
45598
+ const sentences = [];
45599
+ for (; ; ) {
45600
+ const event = await frames.next(deadline);
45601
+ if (event.kind === "finished") return transcriptOf(sentences);
45602
+ if (event.kind === "failed") throw upstreamFailure(event.message.trim() || event.code);
45603
+ if (event.kind === "sentence") sentences.push(event);
45604
+ }
45605
+ } finally {
45606
+ frames.dispose();
45607
+ }
45608
+ }
45609
+ var PROBE_BYTES = ASR_SAMPLE_RATE;
45610
+ async function probeAsr(req) {
45611
+ try {
45612
+ await transcribe({ ...req, pcm: new Uint8Array(PROBE_BYTES), sampleRate: ASR_SAMPLE_RATE });
45613
+ return { ok: true, message: "" };
45614
+ } catch (err) {
45615
+ if (err instanceof AsrError) return { ok: false, message: err.message };
45616
+ throw err;
45617
+ }
45618
+ }
45619
+ async function explainHandshake(err, req) {
45620
+ if (err.code !== "asr_unreachable") return err;
45621
+ let status;
45622
+ try {
45623
+ const res = await fetch(asrWebSocketUrl(req.baseUrl).replace(/^ws/, "http"), {
45624
+ headers: { Authorization: `Bearer ${req.apiKey}` },
45625
+ signal: AbortSignal.timeout(PROBE_TIMEOUT_MS2)
45626
+ });
45627
+ status = res.status;
45628
+ await res.text();
45629
+ } catch {
45630
+ return err;
45631
+ }
45632
+ if (status === 401 || status === 403) {
45633
+ return new AsrError(
45634
+ "asr_credential_refused",
45635
+ `The speech service refused the credential (HTTP ${status}).`,
45636
+ 502
45637
+ );
45638
+ }
45639
+ return new AsrError(
45640
+ "asr_unreachable",
45641
+ `The speech service answered HTTP ${status} instead of upgrading the connection.`,
45642
+ 502
45643
+ );
45644
+ }
45645
+ async function untilStarted(frames, deadline) {
45646
+ for (; ; ) {
45647
+ const event = await frames.next(deadline);
45648
+ if (event.kind === "started") return;
45649
+ if (event.kind === "failed") throw upstreamFailure(event.message.trim() || event.code);
45650
+ }
45651
+ }
45652
+ function upstreamFailure(message4) {
45653
+ return new AsrError("asr_upstream", message4.trim(), 502);
45654
+ }
45655
+ function durationMs(bytes, sampleRate) {
45656
+ return Math.round(bytes / (sampleRate * 2) * 1e3);
45657
+ }
45658
+ function asRecord(value) {
45659
+ return isRecord2(value) ? value : null;
45660
+ }
45661
+ function isRecord2(value) {
45662
+ return typeof value === "object" && value !== null && !Array.isArray(value);
45663
+ }
45664
+ function taskId() {
45665
+ return `asr-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
45666
+ }
45667
+ var FrameStream = class {
45668
+ constructor(socket) {
45669
+ this.socket = socket;
45670
+ socket.addEventListener("open", () => {
45671
+ this.isOpen = true;
45672
+ for (const waiter of this.openWaiters.splice(0)) {
45673
+ clearTimeout(waiter.timer);
45674
+ waiter.resolve();
45675
+ }
45676
+ });
45677
+ socket.addEventListener("message", (event) => {
45678
+ const data = event.data;
45679
+ if (typeof data !== "string") return;
45680
+ const parsed = parseAsrEvent(data);
45681
+ if (parsed !== null) this.push(parsed);
45682
+ });
45683
+ socket.addEventListener("error", () => {
45684
+ this.fail(new AsrError("asr_unreachable", "Could not reach the speech service.", 502));
45685
+ });
45686
+ socket.addEventListener("close", () => {
45687
+ this.fail(new AsrError("asr_unreachable", "The speech service closed the connection.", 502));
45688
+ });
45689
+ }
45690
+ socket;
45691
+ buffered = [];
45692
+ waiting = null;
45693
+ openWaiters = [];
45694
+ isOpen = false;
45695
+ failure = null;
45696
+ /** Resolves once the socket is open; rejects with `asr_unreachable` if it never is. */
45697
+ opened(timeoutMs) {
45698
+ if (this.failure !== null) return Promise.reject(this.failure);
45699
+ if (this.isOpen) return Promise.resolve();
45700
+ return new Promise((resolve, reject) => {
45701
+ const timer = setTimeout(() => {
45702
+ const err = new AsrError(
45703
+ "asr_unreachable",
45704
+ "Could not reach the speech service in time.",
45705
+ 502
45706
+ );
45707
+ this.fail(err);
45708
+ }, timeoutMs);
45709
+ timer.unref();
45710
+ this.openWaiters.push({ resolve, reject, timer });
45711
+ });
45712
+ }
45713
+ /** The next frame, or a rejection once the socket has failed or `deadline` has passed. */
45714
+ next(deadline) {
45715
+ const buffered = this.buffered.shift();
45716
+ if (buffered !== void 0) return Promise.resolve(buffered);
45717
+ if (this.failure !== null) return Promise.reject(this.failure);
45718
+ return new Promise((resolve, reject) => {
45719
+ const timer = setTimeout(
45720
+ () => {
45721
+ if (this.waiting !== resolve) return;
45722
+ this.waiting = null;
45723
+ reject(new AsrError("asr_timeout", "The speech service did not answer in time.", 504));
45724
+ },
45725
+ Math.max(1, deadline - Date.now())
45726
+ );
45727
+ timer.unref();
45728
+ this.waiting = (event) => {
45729
+ clearTimeout(timer);
45730
+ resolve(event);
45731
+ };
45732
+ });
45733
+ }
45734
+ dispose() {
45735
+ this.waiting = null;
45736
+ for (const waiter of this.openWaiters.splice(0)) clearTimeout(waiter.timer);
45737
+ if (this.socket.readyState < 2) this.socket.close();
45738
+ }
45739
+ push(event) {
45740
+ const waiting = this.waiting;
45741
+ if (waiting === null) {
45742
+ this.buffered.push(event);
45743
+ return;
45744
+ }
45745
+ this.waiting = null;
45746
+ waiting(event);
45747
+ }
45748
+ fail(err) {
45749
+ if (this.failure === null) this.failure = err;
45750
+ for (const waiter of this.openWaiters.splice(0)) {
45751
+ clearTimeout(waiter.timer);
45752
+ waiter.reject(this.failure);
45753
+ }
45754
+ }
45755
+ };
45756
+
45387
45757
  // src/db/repos/server-settings.ts
45388
45758
  import { Component as Component18, Use as Use18 } from "@adelie/core/kernel";
45389
45759
  var PROXY_FOR_APP_KEY = "proxy_for_app";
@@ -45394,6 +45764,9 @@ var ATTACHMENT_MAX_MB_KEY = "attachment_max_mb";
45394
45764
  var ATTACHMENT_TOTAL_MB_KEY = "attachment_total_mb";
45395
45765
  var COMPANY_MODE_KEY = "companyMode";
45396
45766
  var AGENT_API_KEY = "agentApiEnabled";
45767
+ var ASR_BASE_URL_KEY = "asrBaseUrl";
45768
+ var ASR_MODEL_KEY = "asrModel";
45769
+ var ASR_API_KEY = "asrApiKey";
45397
45770
  var _db_dec2, _ServerSettingsRepo_decorators, _init74;
45398
45771
  _ServerSettingsRepo_decorators = [Component18()], _db_dec2 = [Use18()];
45399
45772
  var ServerSettingsRepo = class {
@@ -45519,6 +45892,35 @@ var ServerSettingsRepo = class {
45519
45892
  setAgentApiEnabled(value) {
45520
45893
  this.set(AGENT_API_KEY, JSON.stringify(value));
45521
45894
  }
45895
+ /**
45896
+ * Speech input settings. The site and the model read as the built-in defaults when their rows
45897
+ * are absent or unreadable — the page must show what a recording would actually use, and a
45898
+ * blank field that silently meant "the default" would not. The key has no default: an unset
45899
+ * one reads as "", and the transcribe route turns that into its own refusal.
45900
+ */
45901
+ getAsrSettings() {
45902
+ return {
45903
+ baseUrl: this.getString(ASR_BASE_URL_KEY, DEFAULT_ASR_BASE_URL),
45904
+ model: this.getString(ASR_MODEL_KEY, DEFAULT_ASR_MODEL),
45905
+ apiKey: this.getString(ASR_API_KEY, "")
45906
+ };
45907
+ }
45908
+ setAsrSettings(value) {
45909
+ this.set(ASR_BASE_URL_KEY, JSON.stringify(value.baseUrl));
45910
+ this.set(ASR_MODEL_KEY, JSON.stringify(value.model));
45911
+ this.set(ASR_API_KEY, JSON.stringify(value.apiKey));
45912
+ }
45913
+ /** A stored JSON string, or `fallback` when the row is absent, unreadable, blank or not a string. */
45914
+ getString(key2, fallback) {
45915
+ const raw = this.get(key2);
45916
+ if (raw === null) return fallback;
45917
+ try {
45918
+ const value = JSON.parse(raw);
45919
+ return typeof value === "string" && value.trim() !== "" ? value : fallback;
45920
+ } catch {
45921
+ return fallback;
45922
+ }
45923
+ }
45522
45924
  };
45523
45925
  _init74 = __decoratorStart(null);
45524
45926
  __decorateElement(_init74, 5, "db", _db_dec2, ServerSettingsRepo);
@@ -48916,7 +49318,7 @@ async function clearSingletonFiles(profileDir) {
48916
49318
  }
48917
49319
 
48918
49320
  // src/server-browser/cdp.ts
48919
- import { WebSocket as WebSocket2 } from "ws";
49321
+ import { WebSocket as WebSocket3 } from "ws";
48920
49322
  var CDP_CALL_TIMEOUT_MS = 3e4;
48921
49323
  var CdpError = class extends Error {
48922
49324
  constructor(kind, message4) {
@@ -49044,7 +49446,7 @@ var CdpConnection = class {
49044
49446
  };
49045
49447
  function connectCdp(endpoint, timeoutMs = CDP_CALL_TIMEOUT_MS) {
49046
49448
  return new Promise((resolve, reject) => {
49047
- const ws = new WebSocket2(endpoint, {
49449
+ const ws = new WebSocket3(endpoint, {
49048
49450
  // Screencast frames and screenshots are the largest things crossing this socket.
49049
49451
  maxPayload: 256 * 1024 * 1024,
49050
49452
  handshakeTimeout: 15e3
@@ -50210,7 +50612,7 @@ var MAX_DISPLAY_NAME_LENGTH = 256;
50210
50612
  var MAX_ENDPOINT_LENGTH = 2048;
50211
50613
  var DEFAULT_RETRY_AFTER_MS = 1e3;
50212
50614
  var MAX_RETRY_AFTER_MS = 6e4;
50213
- function asRecord(value) {
50615
+ function asRecord2(value) {
50214
50616
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
50215
50617
  }
50216
50618
  async function readJsonBounded(response) {
@@ -50256,7 +50658,7 @@ function platformPrice(value, label) {
50256
50658
  return value;
50257
50659
  }
50258
50660
  function platformPricing(value, label) {
50259
- const pricing = asRecord(value);
50661
+ const pricing = asRecord2(value);
50260
50662
  if (pricing.unit !== "usd_per_mtok") {
50261
50663
  throw new Error(`The platform returned an unsupported ${label} pricing unit.`);
50262
50664
  }
@@ -50286,12 +50688,12 @@ function platformPromotion(model, billed) {
50286
50688
  return { listPricing, discount };
50287
50689
  }
50288
50690
  function platformCatalog(value, requireEnvelope) {
50289
- const body = asRecord(value);
50691
+ const body = asRecord2(value);
50290
50692
  if (requireEnvelope && body.schemaVersion !== 1) {
50291
50693
  throw new Error("The platform returned an unsupported model catalog.");
50292
50694
  }
50293
50695
  if (requireEnvelope) requiredString(body.catalogVersion, 128, "catalog version");
50294
- const endpoints = asRecord(body.endpoints);
50696
+ const endpoints = asRecord2(body.endpoints);
50295
50697
  const endpointByName = {
50296
50698
  openai: platformEndpoint(endpoints.openai),
50297
50699
  google: platformEndpoint(endpoints.google)
@@ -50301,7 +50703,7 @@ function platformCatalog(value, requireEnvelope) {
50301
50703
  }
50302
50704
  const seen = /* @__PURE__ */ new Set();
50303
50705
  const models = body.models.map((value2) => {
50304
- const model = asRecord(value2);
50706
+ const model = asRecord2(value2);
50305
50707
  const modelId = requiredString(model.modelId, MAX_MODEL_ID_LENGTH, "model id");
50306
50708
  if (seen.has(modelId)) throw new Error("The platform returned duplicate model ids.");
50307
50709
  seen.add(modelId);
@@ -50323,7 +50725,7 @@ function platformCatalog(value, requireEnvelope) {
50323
50725
  }
50324
50726
  const billed = platformPricing(model.pricing, "effective");
50325
50727
  const promotion = platformPromotion(model, billed);
50326
- const route = asRecord(model.recommendedRoute);
50728
+ const route = asRecord2(model.recommendedRoute);
50327
50729
  const provider = model.provider;
50328
50730
  const googleRoute = provider === "google" && route.protocol === "google-generative-language" && route.endpoint === "google";
50329
50731
  const deepSeekRoute = provider === "deepseek" && route.protocol === "deepseek-responses" && route.endpoint === "openai";
@@ -50345,17 +50747,17 @@ function platformCatalog(value, requireEnvelope) {
50345
50747
  return { models };
50346
50748
  }
50347
50749
  function platformConnection(value) {
50348
- const body = asRecord(value);
50349
- const client = asRecord(body.client);
50750
+ const body = asRecord2(value);
50751
+ const client = asRecord2(body.client);
50350
50752
  if (client.id !== PLATFORM_CLIENT_ID) throw new Error("The platform returned another client.");
50351
- const connection = asRecord(body.connection);
50753
+ const connection = asRecord2(body.connection);
50352
50754
  return {
50353
50755
  apiKey: requiredString(connection.apiKey, MAX_API_KEY_LENGTH, "API key"),
50354
50756
  catalog: platformCatalog(connection, false)
50355
50757
  };
50356
50758
  }
50357
50759
  function retryAfterMs(value) {
50358
- const seconds = asRecord(value).retryAfterSeconds;
50760
+ const seconds = asRecord2(value).retryAfterSeconds;
50359
50761
  if (typeof seconds !== "number" || !Number.isFinite(seconds) || seconds <= 0) {
50360
50762
  return DEFAULT_RETRY_AFTER_MS;
50361
50763
  }
@@ -50421,7 +50823,7 @@ var PlatformAuthService = class {
50421
50823
  }
50422
50824
  let body;
50423
50825
  try {
50424
- body = asRecord(await readJsonBounded(response));
50826
+ body = asRecord2(await readJsonBounded(response));
50425
50827
  } catch {
50426
50828
  throw new HttpError(502, "platform_start_failed", "Penguin Go returned an invalid response.");
50427
50829
  }
@@ -50560,7 +50962,7 @@ var PlatformAuthService = class {
50560
50962
  return;
50561
50963
  }
50562
50964
  if (!this.isPending(flow)) return;
50563
- const status = asRecord(body).status;
50965
+ const status = asRecord2(body).status;
50564
50966
  if (status === "pending") return;
50565
50967
  if (status === "claimed") {
50566
50968
  try {
@@ -50685,7 +51087,7 @@ var MAX_RETRY_AFTER_MS2 = 6e4;
50685
51087
  var REFRESH_SKEW_MS = 5 * 60 * 1e3;
50686
51088
  var MAX_CONSECUTIVE_REFRESH_FAILURES = 3;
50687
51089
  var REFRESH_FAILURE_BACKOFF_MS = 3e4;
50688
- function asRecord2(value) {
51090
+ function asRecord3(value) {
50689
51091
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
50690
51092
  }
50691
51093
  async function readJsonBounded2(response) {
@@ -50736,15 +51138,15 @@ function optionalIsoDate(value, label) {
50736
51138
  return new Date(ms).toISOString();
50737
51139
  }
50738
51140
  function modelscopeCredential(value, fallbackRefreshToken) {
50739
- const body = asRecord2(value);
51141
+ const body = asRecord3(value);
50740
51142
  if (body.status !== "completed") throw new Error("The bridge returned another status.");
50741
51143
  return modelscopeToken(body.token, fallbackRefreshToken);
50742
51144
  }
50743
51145
  function modelscopeRefreshCredential(value, fallbackRefreshToken) {
50744
- return modelscopeToken(asRecord2(value).token, fallbackRefreshToken);
51146
+ return modelscopeToken(asRecord3(value).token, fallbackRefreshToken);
50745
51147
  }
50746
51148
  function modelscopeToken(value, fallbackRefreshToken) {
50747
- const token = asRecord2(value);
51149
+ const token = asRecord3(value);
50748
51150
  const refreshToken = optionalTokenString(token.refreshToken, MAX_REFRESH_TOKEN_LENGTH, "refresh token") ?? fallbackRefreshToken;
50749
51151
  const expiresAt = optionalIsoDate(token.expiresAt, "access token expiry");
50750
51152
  return {
@@ -50754,7 +51156,7 @@ function modelscopeToken(value, fallbackRefreshToken) {
50754
51156
  };
50755
51157
  }
50756
51158
  function retryAfterMs2(value) {
50757
- const seconds = asRecord2(value).retryAfterSeconds;
51159
+ const seconds = asRecord3(value).retryAfterSeconds;
50758
51160
  if (typeof seconds !== "number" || !Number.isFinite(seconds) || seconds <= 0) {
50759
51161
  return DEFAULT_RETRY_AFTER_MS2;
50760
51162
  }
@@ -50860,7 +51262,7 @@ var ModelScopeAuthService = class {
50860
51262
  let body;
50861
51263
  let authorizeUrl;
50862
51264
  try {
50863
- body = asRecord2(await readJsonBounded2(response));
51265
+ body = asRecord3(await readJsonBounded2(response));
50864
51266
  authorizeUrl = authorizeEndpoint(body.authorizeUrl);
50865
51267
  } catch {
50866
51268
  throw new HttpError(
@@ -51026,7 +51428,7 @@ var ModelScopeAuthService = class {
51026
51428
  return;
51027
51429
  }
51028
51430
  if (!this.isPending(flow)) return;
51029
- const status = asRecord2(body).status;
51431
+ const status = asRecord3(body).status;
51030
51432
  if (status === "pending") return;
51031
51433
  if (status === "completed") {
51032
51434
  try {
@@ -51628,7 +52030,7 @@ function compactionThresholdFor(configured, contextWindow) {
51628
52030
  import fs17 from "fs/promises";
51629
52031
  var TRACE_LINE_INDEX_MAX_FILES = 32;
51630
52032
  var NEWLINE = 10;
51631
- function isRecord2(buf, from, to) {
52033
+ function isRecord3(buf, from, to) {
51632
52034
  const text2 = buf.toString("utf8", from, to).trim();
51633
52035
  if (text2 === "") return false;
51634
52036
  try {
@@ -51745,14 +52147,14 @@ var TraceLineIndex = class {
51745
52147
  for (; ; ) {
51746
52148
  const nl = buf.indexOf(NEWLINE, pos);
51747
52149
  if (nl < 0) break;
51748
- if (isRecord2(buf, pos, nl)) {
52150
+ if (isRecord3(buf, pos, nl)) {
51749
52151
  entry.starts.push(readFrom + pos);
51750
52152
  entry.ends.push(readFrom + nl + 1);
51751
52153
  }
51752
52154
  pos = nl + 1;
51753
52155
  }
51754
52156
  entry.scanned = readFrom + pos;
51755
- if (pos < buf.length && isRecord2(buf, pos, buf.length)) {
52157
+ if (pos < buf.length && isRecord3(buf, pos, buf.length)) {
51756
52158
  entry.starts.push(readFrom + pos);
51757
52159
  entry.ends.push(readFrom + buf.length);
51758
52160
  entry.provisionalTail = true;
@@ -55393,7 +55795,7 @@ import {
55393
55795
  } from "@adelie/core";
55394
55796
  import { Component as Component47, Use as Use47 } from "@adelie/core/kernel";
55395
55797
  var COMPACTION_MODES = ["summarize", "discard"];
55396
- function asRecord3(v) {
55798
+ function asRecord4(v) {
55397
55799
  return v !== null && typeof v === "object" && !Array.isArray(v) ? v : {};
55398
55800
  }
55399
55801
  var _paths_dec9, _AgentConfigService_decorators, _init108;
@@ -55427,8 +55829,8 @@ var AgentConfigService = class {
55427
55829
  async readCardMeta(projectId, agentId) {
55428
55830
  try {
55429
55831
  const raw = await fs23.readFile(systemConfigPath(this.root, projectId, agentId), "utf8");
55430
- const parsed = asRecord3(parseYaml(raw));
55431
- const tools = asRecord3(parsed.tools);
55832
+ const parsed = asRecord4(parseYaml(raw));
55833
+ const tools = asRecord4(parsed.tools);
55432
55834
  const countOf = (v) => Array.isArray(v) ? v.length : 0;
55433
55835
  return {
55434
55836
  ...typeof parsed.name === "string" ? { name: parsed.name } : {},
@@ -55448,15 +55850,15 @@ var AgentConfigService = class {
55448
55850
  await this.requireExists(projectId, agentId);
55449
55851
  const yamlPath = systemConfigPath(this.root, projectId, agentId);
55450
55852
  const systemConfigYaml = await fs23.readFile(yamlPath, "utf8");
55451
- const parsed = asRecord3(parseYaml(systemConfigYaml));
55452
- const model = asRecord3(parsed.model);
55453
- const compaction = asRecord3(parsed.compaction);
55454
- const memory = asRecord3(parsed.memory);
55455
- const vault = asRecord3(parsed.vault);
55456
- const skills = asRecord3(parsed.skills);
55457
- const schedules = asRecord3(parsed.schedules);
55458
- const hooks = asRecord3(parsed.hooks);
55459
- const tools = asRecord3(parsed.tools);
55853
+ const parsed = asRecord4(parseYaml(systemConfigYaml));
55854
+ const model = asRecord4(parsed.model);
55855
+ const compaction = asRecord4(parsed.compaction);
55856
+ const memory = asRecord4(parsed.memory);
55857
+ const vault = asRecord4(parsed.vault);
55858
+ const skills = asRecord4(parsed.skills);
55859
+ const schedules = asRecord4(parsed.schedules);
55860
+ const hooks = asRecord4(parsed.hooks);
55861
+ const tools = asRecord4(parsed.tools);
55460
55862
  let agentsMd = "";
55461
55863
  try {
55462
55864
  agentsMd = await fs23.readFile(agentsMdPath(this.root, projectId, agentId), "utf8");
@@ -55584,7 +55986,7 @@ var AgentConfigService = class {
55584
55986
  optionalNumber(cfg, "maxTurns", { integer: true, positiveOrMinusOne: true })
55585
55987
  );
55586
55988
  if (cfg.model !== void 0) {
55587
- const model = asRecord3(cfg.model);
55989
+ const model = asRecord4(cfg.model);
55588
55990
  setIfProvided(
55589
55991
  ["model", "max_tokens"],
55590
55992
  optionalNumber(model, "maxTokens", { integer: true, positiveOrMinusOne: true })
@@ -55599,7 +56001,7 @@ var AgentConfigService = class {
55599
56001
  );
55600
56002
  }
55601
56003
  if (cfg.compaction !== void 0) {
55602
- const compaction = asRecord3(cfg.compaction);
56004
+ const compaction = asRecord4(cfg.compaction);
55603
56005
  setIfProvided(
55604
56006
  ["compaction", "max_context_length"],
55605
56007
  optionalNumber(compaction, "maxContextLength", { integer: true, positiveOrMinusOne: true })
@@ -55612,28 +56014,28 @@ var AgentConfigService = class {
55612
56014
  setIfProvided(["compaction", "prompt"], optionalString(compaction, "prompt"));
55613
56015
  }
55614
56016
  if (cfg.memory !== void 0) {
55615
- const memory = asRecord3(cfg.memory);
56017
+ const memory = asRecord4(cfg.memory);
55616
56018
  setIfProvided(["memory", "enabled"], optionalBoolean(memory, "enabled"));
55617
56019
  setIfProvided(["memory", "prompt"], optionalString(memory, "prompt"));
55618
56020
  setIfProvided(["memory", "workspace_prompt"], optionalString(memory, "workspacePrompt"));
55619
56021
  }
55620
56022
  if (cfg.vault !== void 0) {
55621
- const vault = asRecord3(cfg.vault);
56023
+ const vault = asRecord4(cfg.vault);
55622
56024
  setIfProvided(["vault", "enabled"], optionalBoolean(vault, "enabled"));
55623
56025
  setIfProvided(["vault", "prompt"], optionalString(vault, "prompt"));
55624
56026
  }
55625
56027
  if (cfg.skills !== void 0) {
55626
- const skills = asRecord3(cfg.skills);
56028
+ const skills = asRecord4(cfg.skills);
55627
56029
  setIfProvided(["skills", "enabled"], optionalBoolean(skills, "enabled"));
55628
56030
  setIfProvided(["skills", "prompt"], optionalString(skills, "prompt"));
55629
56031
  }
55630
56032
  if (cfg.schedules !== void 0) {
55631
- const schedules = asRecord3(cfg.schedules);
56033
+ const schedules = asRecord4(cfg.schedules);
55632
56034
  setIfProvided(["schedules", "enabled"], optionalBoolean(schedules, "enabled"));
55633
56035
  setIfProvided(["schedules", "prompt"], optionalString(schedules, "prompt"));
55634
56036
  }
55635
56037
  if (cfg.hooks !== void 0) {
55636
- setIfProvided(["hooks", "enabled"], optionalBoolean(asRecord3(cfg.hooks), "enabled"));
56038
+ setIfProvided(["hooks", "enabled"], optionalBoolean(asRecord4(cfg.hooks), "enabled"));
55637
56039
  }
55638
56040
  if (cfg.toolsBuiltin !== void 0) {
55639
56041
  doc.setIn(["tools", "builtin"], validateToolsBuiltin(cfg.toolsBuiltin));
@@ -55720,7 +56122,7 @@ __runInitializers(_init108, 1, AgentConfigService);
55720
56122
  function validateToolsBuiltin(value) {
55721
56123
  if (!Array.isArray(value)) throw badRequest("toolsBuiltin must be an array.");
55722
56124
  return value.map((item, i) => {
55723
- const t = asRecord3(item);
56125
+ const t = asRecord4(item);
55724
56126
  if (typeof t.name !== "string" || t.name.length === 0) {
55725
56127
  throw badRequest(`toolsBuiltin[${i}].name must be a non-empty string.`);
55726
56128
  }
@@ -55751,7 +56153,7 @@ function validateMcpServers(value) {
55751
56153
  if (!Array.isArray(value)) throw badRequest("mcpServers must be an array.");
55752
56154
  const seen = /* @__PURE__ */ new Set();
55753
56155
  return value.map((item, i) => {
55754
- const s = asRecord3(item);
56156
+ const s = asRecord4(item);
55755
56157
  if (typeof s.name !== "string" || s.name.length === 0) {
55756
56158
  throw badRequest(`mcpServers[${i}].name must be a non-empty string.`);
55757
56159
  }
@@ -58422,7 +58824,7 @@ import { createHash as createHash6 } from "crypto";
58422
58824
  import { providerInfo as providerInfo3 } from "@adelie/core/model-catalog";
58423
58825
  var BALANCE_TIMEOUT_MS = 5e3;
58424
58826
  var BALANCE_CACHE_MS = 6e4;
58425
- function isRecord3(value) {
58827
+ function isRecord4(value) {
58426
58828
  return typeof value === "object" && value !== null && !Array.isArray(value);
58427
58829
  }
58428
58830
  var DECIMAL = /^-?\d+(\.\d+)?$/;
@@ -58434,18 +58836,18 @@ function microToDecimal(micro) {
58434
58836
  return `${sign}${units}.${fraction}`;
58435
58837
  }
58436
58838
  function readTokenDance(body) {
58437
- const holder = isRecord3(body) && isRecord3(body.data) ? body.data : body;
58438
- const wallet = isRecord3(holder) ? holder.balance : void 0;
58439
- const raw = isRecord3(wallet) ? wallet.balance : void 0;
58839
+ const holder = isRecord4(body) && isRecord4(body.data) ? body.data : body;
58840
+ const wallet = isRecord4(holder) ? holder.balance : void 0;
58841
+ const raw = isRecord4(wallet) ? wallet.balance : void 0;
58440
58842
  const micro = typeof raw === "number" ? raw : typeof raw === "string" && DECIMAL.test(raw) ? Number(raw) : NaN;
58441
58843
  if (!Number.isFinite(micro)) return void 0;
58442
58844
  return { amount: microToDecimal(micro), currency: "CNY" };
58443
58845
  }
58444
58846
  function readDeepSeek(body) {
58445
- if (!isRecord3(body) || !Array.isArray(body.balance_infos)) return void 0;
58847
+ if (!isRecord4(body) || !Array.isArray(body.balance_infos)) return void 0;
58446
58848
  const amounts = [];
58447
58849
  for (const info of body.balance_infos) {
58448
- if (!isRecord3(info)) continue;
58850
+ if (!isRecord4(info)) continue;
58449
58851
  const currency = info.currency;
58450
58852
  const total = typeof info.total_balance === "number" ? String(info.total_balance) : info.total_balance;
58451
58853
  if (typeof currency !== "string" || !/^[A-Z]{3}$/.test(currency)) continue;
@@ -61515,7 +61917,7 @@ import { parse as parseYaml3, stringify as stringifyYaml } from "yaml";
61515
61917
  import { benchmarksDir } from "@adelie/core";
61516
61918
  import { Component as Component54, Use as Use54 } from "@adelie/core/kernel";
61517
61919
  var STATEMENT_TITLE_READ_BYTES = 64 * 1024;
61518
- function asRecord4(v) {
61920
+ function asRecord5(v) {
61519
61921
  return v !== null && typeof v === "object" && !Array.isArray(v) ? v : {};
61520
61922
  }
61521
61923
  function numberOr(v) {
@@ -61563,22 +61965,22 @@ async function readStatementTitle(readme, fallback) {
61563
61965
  }
61564
61966
  }
61565
61967
  function toRun(v) {
61566
- const r = asRecord4(v);
61968
+ const r = asRecord5(v);
61567
61969
  const score = scoreOr(r.score);
61568
61970
  const cost = nullableCostOr(r.cost);
61569
- const durationMs = nonNegativeIntegerOr(r.duration_ms);
61971
+ const durationMs2 = nonNegativeIntegerOr(r.duration_ms);
61570
61972
  const sessionId = stringOr(r.session_id);
61571
- if (score === void 0 || cost === void 0 || durationMs === void 0 || !sessionId)
61973
+ if (score === void 0 || cost === void 0 || durationMs2 === void 0 || !sessionId)
61572
61974
  return null;
61573
- return { score, cost, durationMs, sessionId };
61975
+ return { score, cost, durationMs: durationMs2, sessionId };
61574
61976
  }
61575
61977
  function toCase(v) {
61576
- const cr = asRecord4(v);
61978
+ const cr = asRecord5(v);
61577
61979
  const caseId = stringOr(cr.case);
61578
61980
  const score = scoreOr(cr.score);
61579
61981
  const cost = nullableCostOr(cr.cost);
61580
- const durationMs = nonNegativeIntegerOr(cr.duration_ms);
61581
- if (!caseId || score === void 0 || cost === void 0 || durationMs === void 0 || "max_score" in cr || !Array.isArray(cr.runs) || cr.runs.length === 0) {
61982
+ const durationMs2 = nonNegativeIntegerOr(cr.duration_ms);
61983
+ if (!caseId || score === void 0 || cost === void 0 || durationMs2 === void 0 || "max_score" in cr || !Array.isArray(cr.runs) || cr.runs.length === 0) {
61582
61984
  return null;
61583
61985
  }
61584
61986
  const parsedRuns = cr.runs.map(toRun);
@@ -61588,24 +61990,24 @@ function toCase(v) {
61588
61990
  case: caseId,
61589
61991
  score,
61590
61992
  cost,
61591
- durationMs,
61993
+ durationMs: durationMs2,
61592
61994
  runs
61593
61995
  };
61594
61996
  }
61595
61997
  function toEvaluation(v) {
61596
- const r = asRecord4(v);
61998
+ const r = asRecord5(v);
61597
61999
  const time = r.time instanceof Date ? r.time.toISOString() : r.time;
61598
62000
  const agentId = agentIdOr(r.agent_id);
61599
62001
  const score = scoreOr(r.score);
61600
62002
  const cost = nullableCostOr(r.cost);
61601
- const durationMs = nonNegativeIntegerOr(r.duration_ms);
62003
+ const durationMs2 = nonNegativeIntegerOr(r.duration_ms);
61602
62004
  const summary = stringOr(r.summary);
61603
62005
  const summaryTitle = stringOr(r.summary_title);
61604
62006
  const modelId = stringOr(r.model_id);
61605
62007
  const provider = stringOr(r.provider);
61606
62008
  const thinkingLevel = stringOr(r.thinking_level);
61607
62009
  const version = nonNegativeIntegerOr(r.version);
61608
- if (typeof time !== "string" || time === "" || score === void 0 || cost === void 0 || durationMs === void 0 || !modelId || !provider || !thinkingLevel || version === void 0 || version < 1 || !Array.isArray(r.cases) || r.cases.length === 0) {
62010
+ if (typeof time !== "string" || time === "" || score === void 0 || cost === void 0 || durationMs2 === void 0 || !modelId || !provider || !thinkingLevel || version === void 0 || version < 1 || !Array.isArray(r.cases) || r.cases.length === 0) {
61609
62011
  return null;
61610
62012
  }
61611
62013
  const parsedCases = r.cases.map(toCase);
@@ -61622,7 +62024,7 @@ function toEvaluation(v) {
61622
62024
  score,
61623
62025
  version,
61624
62026
  cost,
61625
- durationMs,
62027
+ durationMs: durationMs2,
61626
62028
  cases
61627
62029
  };
61628
62030
  }
@@ -61823,7 +62225,7 @@ ${item.statement.trim()}
61823
62225
  let runs;
61824
62226
  let status = "published";
61825
62227
  try {
61826
- const config = asRecord4(
62228
+ const config = asRecord5(
61827
62229
  parseToml3(await fs33.readFile(path35.join(benchDir, "benchmark_config.toml"), "utf8"))
61828
62230
  );
61829
62231
  if (typeof config.title === "string" && config.title !== "") title = config.title;
@@ -61840,7 +62242,7 @@ ${item.statement.trim()}
61840
62242
  }
61841
62243
  let evaluations = [];
61842
62244
  try {
61843
- const scoreboard = asRecord4(
62245
+ const scoreboard = asRecord5(
61844
62246
  parseYaml3(await fs33.readFile(path35.join(benchDir, "scoreboard.yaml"), "utf8"))
61845
62247
  );
61846
62248
  if (Array.isArray(scoreboard.evaluations)) {
@@ -64642,7 +65044,7 @@ async function syncPluginsToMachine(opts) {
64642
65044
 
64643
65045
  // src/machines/server-control.ts
64644
65046
  var START_TIMEOUT_MS = 3e4;
64645
- var sleep2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
65047
+ var sleep3 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
64646
65048
  async function startRemoteServer(target, port, layout, exec) {
64647
65049
  const started = await exec(target, startServerCommand(port, layout));
64648
65050
  if (started.code !== 0) {
@@ -64652,7 +65054,7 @@ async function startRemoteServer(target, port, layout, exec) {
64652
65054
  let exited = false;
64653
65055
  const deadline = Date.now() + START_TIMEOUT_MS;
64654
65056
  while (Date.now() < deadline) {
64655
- await sleep2(1500);
65057
+ await sleep3(1500);
64656
65058
  const probed = await probeServerState(target, layout, exec);
64657
65059
  if (probed.state.kind === "running") return { ok: true };
64658
65060
  if (pid !== null && (await exec(target, isAliveCommand(pid))).stdout.includes("gone")) {
@@ -72270,7 +72672,7 @@ OrgRoutes = __decorateElement(_init121, 0, "OrgRoutes", _OrgRoutes_decorators, O
72270
72672
  __runInitializers(_init121, 1, OrgRoutes);
72271
72673
 
72272
72674
  // src/machines/terminal-relay.ts
72273
- import { WebSocket as WebSocket3 } from "ws";
72675
+ import { WebSocket as WebSocket4 } from "ws";
72274
72676
  import { Component as Component59, Interface as Interface27, Use as Use61 } from "@adelie/core/kernel";
72275
72677
  var SEP = "@";
72276
72678
  function parseRemoteTerminalRef(id) {
@@ -72330,7 +72732,7 @@ async function relayTerminalStream(ws, ref, url, deps, log) {
72330
72732
  if (closing) return;
72331
72733
  if (target === null) return ws.close(1013, "machine not connected");
72332
72734
  const path63 = `/api/terminals/${encodeURIComponent(ref.remote.terminalId)}/stream${url.search}`;
72333
- const socket = new WebSocket3(`ws://127.0.0.1:${target.port}${path63}`, {
72735
+ const socket = new WebSocket4(`ws://127.0.0.1:${target.port}${path63}`, {
72334
72736
  agent: target.agent,
72335
72737
  headers: { host: `localhost:${target.port}`, cookie: target.cookie },
72336
72738
  perMessageDeflate: false
@@ -73251,8 +73653,153 @@ __decorateElement(_init131, 5, "storageRoutes", _storageRoutes_dec, AdminRoutes)
73251
73653
  AdminRoutes = __decorateElement(_init131, 0, "AdminRoutes", _AdminRoutes_decorators, AdminRoutes);
73252
73654
  __runInitializers(_init131, 1, AdminRoutes);
73253
73655
 
73254
- // src/http/routes/me.ts
73656
+ // src/http/routes/asr.ts
73255
73657
  import { Hono as Hono38 } from "hono";
73658
+ import { Bind as Bind22, Component as Component63, Use as Use65 } from "@adelie/core/kernel";
73659
+ var ACCEPTED_SAMPLE_RATES = [8e3, ASR_SAMPLE_RATE];
73660
+ function asrRoutes(deps) {
73661
+ const app = new Hono38();
73662
+ const config = () => {
73663
+ const stored = deps.settings.getAsrSettings();
73664
+ return { baseUrl: stored.baseUrl, model: stored.model, hasKey: stored.apiKey !== "" };
73665
+ };
73666
+ const requireAdmin4 = async (c, next) => {
73667
+ if (!c.var.user.isAdmin) {
73668
+ throw new HttpError(403, "admin_required", "Only an admin can perform this operation.");
73669
+ }
73670
+ await next();
73671
+ };
73672
+ app.get("/config", requireAdmin4, (c) => c.json({ config: config() }));
73673
+ const resolve = (body) => {
73674
+ const stored = deps.settings.getAsrSettings();
73675
+ const baseUrl = body.baseUrl === void 0 ? stored.baseUrl : body.baseUrl === null ? DEFAULT_ASR_BASE_URL : parseBaseUrl(body.baseUrl);
73676
+ const model = body.model === void 0 ? stored.model : body.model === null ? DEFAULT_ASR_MODEL : parseModel2(body.model);
73677
+ const apiKey = body.apiKey === void 0 ? stored.apiKey : typeof body.apiKey === "string" && body.apiKey.trim() === "" ? stored.apiKey : parseApiKey(body.apiKey);
73678
+ return { baseUrl, model, apiKey };
73679
+ };
73680
+ app.put("/config", requireAdmin4, async (c) => {
73681
+ deps.settings.setAsrSettings(resolve(await readJson(c)));
73682
+ return c.json({ config: config() });
73683
+ });
73684
+ app.post("/test", requireAdmin4, async (c) => {
73685
+ const { baseUrl, model, apiKey } = resolve(await readJson(c));
73686
+ if (apiKey === "") {
73687
+ throw new HttpError(
73688
+ 400,
73689
+ "asr_not_configured",
73690
+ "No speech model is configured: set one under Settings > Server > Speech input."
73691
+ );
73692
+ }
73693
+ const probe2 = await probeAsr({ baseUrl, model, apiKey });
73694
+ return c.json({ ...probe2, endpoint: asrWebSocketUrl(baseUrl) });
73695
+ });
73696
+ app.post("/transcribe", async (c) => {
73697
+ const stored = deps.settings.getAsrSettings();
73698
+ if (stored.apiKey === "") {
73699
+ throw new HttpError(
73700
+ 400,
73701
+ "asr_not_configured",
73702
+ "No speech model is configured: set one under Settings > Server > Speech input."
73703
+ );
73704
+ }
73705
+ const body = await readJson(c);
73706
+ const sampleRate = parseSampleRate(body.sampleRate);
73707
+ const pcm = parseAudio(body.dataBase64);
73708
+ try {
73709
+ const text2 = await transcribe({
73710
+ baseUrl: stored.baseUrl,
73711
+ model: stored.model,
73712
+ apiKey: stored.apiKey,
73713
+ pcm,
73714
+ sampleRate
73715
+ });
73716
+ return c.json({ text: text2 });
73717
+ } catch (err) {
73718
+ if (err instanceof AsrError) throw new HttpError(err.status, err.code, err.message);
73719
+ throw err;
73720
+ }
73721
+ });
73722
+ return app;
73723
+ }
73724
+ function parseAudio(value) {
73725
+ if (typeof value !== "string" || value === "") {
73726
+ throw new HttpError(400, "asr_empty_audio", "The recording is empty.");
73727
+ }
73728
+ const pcm = new Uint8Array(Buffer.from(value, "base64"));
73729
+ if (pcm.length === 0) {
73730
+ throw new HttpError(400, "asr_empty_audio", "The recording is empty.");
73731
+ }
73732
+ if (pcm.length > ASR_MAX_BYTES) {
73733
+ throw new HttpError(413, "asr_too_long", "The recording is too long to transcribe.");
73734
+ }
73735
+ if (pcm.length % 2 !== 0) {
73736
+ throw new HttpError(400, "asr_bad_audio", "The recording is not 16-bit PCM.");
73737
+ }
73738
+ return pcm;
73739
+ }
73740
+ function parseBaseUrl(value) {
73741
+ if (typeof value === "string") {
73742
+ try {
73743
+ const url = new URL(value.trim());
73744
+ if (url.protocol === "http:" || url.protocol === "https:") return value.trim();
73745
+ } catch {
73746
+ }
73747
+ }
73748
+ throw new HttpError(
73749
+ 400,
73750
+ "invalid_asr_base_url",
73751
+ "baseUrl must be an absolute http(s) URL, e.g. https://tokendance.space."
73752
+ );
73753
+ }
73754
+ function parseModel2(value) {
73755
+ if (typeof value === "string" && value.trim() !== "") return value.trim();
73756
+ throw new HttpError(400, "invalid_asr_model", "model must be a non-empty model id.");
73757
+ }
73758
+ function parseApiKey(value) {
73759
+ if (typeof value === "string" && value.trim() !== "") return value.trim();
73760
+ throw new HttpError(400, "invalid_asr_api_key", "apiKey must be a non-empty string.");
73761
+ }
73762
+ function parseSampleRate(value) {
73763
+ if (value === void 0 || value === null) return ASR_SAMPLE_RATE;
73764
+ if (typeof value !== "number" || !ACCEPTED_SAMPLE_RATES.includes(value)) {
73765
+ throw new HttpError(
73766
+ 400,
73767
+ "asr_bad_sample_rate",
73768
+ `sampleRate must be one of ${ACCEPTED_SAMPLE_RATES.join(", ")}.`
73769
+ );
73770
+ }
73771
+ return value;
73772
+ }
73773
+ var _routes_dec15, _settings_dec9, _AsrRoutes_decorators, _init132;
73774
+ _AsrRoutes_decorators = [Component63({
73775
+ contributes: {
73776
+ "HttpModule.routes": [
73777
+ {
73778
+ id: "asr",
73779
+ prefix: "/api/asr",
73780
+ auth: "user",
73781
+ order: 55
73782
+ }
73783
+ ]
73784
+ }
73785
+ })], _settings_dec9 = [Use65()], _routes_dec15 = [Bind22("asr")];
73786
+ var AsrRoutes = class {
73787
+ constructor() {
73788
+ __publicField(this, "settings", __runInitializers(_init132, 8, this)), __runInitializers(_init132, 11, this);
73789
+ __publicField(this, "routes", __runInitializers(_init132, 12, this)), __runInitializers(_init132, 15, this);
73790
+ }
73791
+ setup() {
73792
+ this.routes = asrRoutes({ settings: this.settings });
73793
+ }
73794
+ };
73795
+ _init132 = __decoratorStart(null);
73796
+ __decorateElement(_init132, 5, "settings", _settings_dec9, AsrRoutes);
73797
+ __decorateElement(_init132, 5, "routes", _routes_dec15, AsrRoutes);
73798
+ AsrRoutes = __decorateElement(_init132, 0, "AsrRoutes", _AsrRoutes_decorators, AsrRoutes);
73799
+ __runInitializers(_init132, 1, AsrRoutes);
73800
+
73801
+ // src/http/routes/me.ts
73802
+ import { Hono as Hono39 } from "hono";
73256
73803
  import { setCookie as setCookie2 } from "hono/cookie";
73257
73804
 
73258
73805
  // src/services/draft-shortcuts.ts
@@ -73346,7 +73893,7 @@ function validateKeybindings(value) {
73346
73893
  }
73347
73894
 
73348
73895
  // src/http/routes/me.ts
73349
- import { Bind as Bind22, Component as Component63, Use as Use65 } from "@adelie/core/kernel";
73896
+ import { Bind as Bind23, Component as Component64, Use as Use66 } from "@adelie/core/kernel";
73350
73897
  var DISPLAY_NAME_MIN = 1;
73351
73898
  var DISPLAY_NAME_MAX = 32;
73352
73899
  var AVATAR_MAX_CHARS = 131072;
@@ -73388,7 +73935,7 @@ function parseAvatar(raw) {
73388
73935
  return raw;
73389
73936
  }
73390
73937
  function meRoutes(deps) {
73391
- const app = new Hono38();
73938
+ const app = new Hono39();
73392
73939
  app.get("/", (c) => {
73393
73940
  const target = resolvePreviewTarget(
73394
73941
  c.req.url,
@@ -73484,8 +74031,8 @@ function meRoutes(deps) {
73484
74031
  });
73485
74032
  return app;
73486
74033
  }
73487
- var _routes_dec15, _users_dec3, _settings_dec9, _prefs_dec, _auth_dec7, _desktop_dec12, _config_dec13, _MeRoutes_decorators, _init132;
73488
- _MeRoutes_decorators = [Component63({
74034
+ var _routes_dec16, _users_dec3, _settings_dec10, _prefs_dec, _auth_dec7, _desktop_dec12, _config_dec13, _MeRoutes_decorators, _init133;
74035
+ _MeRoutes_decorators = [Component64({
73489
74036
  contributes: {
73490
74037
  "HttpModule.routes": [
73491
74038
  {
@@ -73496,16 +74043,16 @@ _MeRoutes_decorators = [Component63({
73496
74043
  }
73497
74044
  ]
73498
74045
  }
73499
- })], _config_dec13 = [Use65()], _desktop_dec12 = [Use65()], _auth_dec7 = [Use65()], _prefs_dec = [Use65()], _settings_dec9 = [Use65()], _users_dec3 = [Use65()], _routes_dec15 = [Bind22("MeRoutes.routes")];
74046
+ })], _config_dec13 = [Use66()], _desktop_dec12 = [Use66()], _auth_dec7 = [Use66()], _prefs_dec = [Use66()], _settings_dec10 = [Use66()], _users_dec3 = [Use66()], _routes_dec16 = [Bind23("MeRoutes.routes")];
73500
74047
  var MeRoutes = class {
73501
74048
  constructor() {
73502
- __publicField(this, "config", __runInitializers(_init132, 8, this)), __runInitializers(_init132, 11, this);
73503
- __publicField(this, "desktop", __runInitializers(_init132, 12, this)), __runInitializers(_init132, 15, this);
73504
- __publicField(this, "auth", __runInitializers(_init132, 16, this)), __runInitializers(_init132, 19, this);
73505
- __publicField(this, "prefs", __runInitializers(_init132, 20, this)), __runInitializers(_init132, 23, this);
73506
- __publicField(this, "settings", __runInitializers(_init132, 24, this)), __runInitializers(_init132, 27, this);
73507
- __publicField(this, "users", __runInitializers(_init132, 28, this)), __runInitializers(_init132, 31, this);
73508
- __publicField(this, "routes", __runInitializers(_init132, 32, this)), __runInitializers(_init132, 35, this);
74049
+ __publicField(this, "config", __runInitializers(_init133, 8, this)), __runInitializers(_init133, 11, this);
74050
+ __publicField(this, "desktop", __runInitializers(_init133, 12, this)), __runInitializers(_init133, 15, this);
74051
+ __publicField(this, "auth", __runInitializers(_init133, 16, this)), __runInitializers(_init133, 19, this);
74052
+ __publicField(this, "prefs", __runInitializers(_init133, 20, this)), __runInitializers(_init133, 23, this);
74053
+ __publicField(this, "settings", __runInitializers(_init133, 24, this)), __runInitializers(_init133, 27, this);
74054
+ __publicField(this, "users", __runInitializers(_init133, 28, this)), __runInitializers(_init133, 31, this);
74055
+ __publicField(this, "routes", __runInitializers(_init133, 32, this)), __runInitializers(_init133, 35, this);
73509
74056
  }
73510
74057
  setup() {
73511
74058
  this.routes = meRoutes({
@@ -73518,20 +74065,20 @@ var MeRoutes = class {
73518
74065
  });
73519
74066
  }
73520
74067
  };
73521
- _init132 = __decoratorStart(null);
73522
- __decorateElement(_init132, 5, "config", _config_dec13, MeRoutes);
73523
- __decorateElement(_init132, 5, "desktop", _desktop_dec12, MeRoutes);
73524
- __decorateElement(_init132, 5, "auth", _auth_dec7, MeRoutes);
73525
- __decorateElement(_init132, 5, "prefs", _prefs_dec, MeRoutes);
73526
- __decorateElement(_init132, 5, "settings", _settings_dec9, MeRoutes);
73527
- __decorateElement(_init132, 5, "users", _users_dec3, MeRoutes);
73528
- __decorateElement(_init132, 5, "routes", _routes_dec15, MeRoutes);
73529
- MeRoutes = __decorateElement(_init132, 0, "MeRoutes", _MeRoutes_decorators, MeRoutes);
73530
- __runInitializers(_init132, 1, MeRoutes);
74068
+ _init133 = __decoratorStart(null);
74069
+ __decorateElement(_init133, 5, "config", _config_dec13, MeRoutes);
74070
+ __decorateElement(_init133, 5, "desktop", _desktop_dec12, MeRoutes);
74071
+ __decorateElement(_init133, 5, "auth", _auth_dec7, MeRoutes);
74072
+ __decorateElement(_init133, 5, "prefs", _prefs_dec, MeRoutes);
74073
+ __decorateElement(_init133, 5, "settings", _settings_dec10, MeRoutes);
74074
+ __decorateElement(_init133, 5, "users", _users_dec3, MeRoutes);
74075
+ __decorateElement(_init133, 5, "routes", _routes_dec16, MeRoutes);
74076
+ MeRoutes = __decorateElement(_init133, 0, "MeRoutes", _MeRoutes_decorators, MeRoutes);
74077
+ __runInitializers(_init133, 1, MeRoutes);
73531
74078
 
73532
74079
  // src/http/routes/user-vault.ts
73533
- import { Hono as Hono39 } from "hono";
73534
- import { Bind as Bind23, Component as Component64, Use as Use66 } from "@adelie/core/kernel";
74080
+ import { Hono as Hono40 } from "hono";
74081
+ import { Bind as Bind24, Component as Component65, Use as Use67 } from "@adelie/core/kernel";
73535
74082
  function isPlainObject(v) {
73536
74083
  return v !== null && typeof v === "object" && !Array.isArray(v);
73537
74084
  }
@@ -73554,7 +74101,7 @@ function parseVaultImport(body) {
73554
74101
  return body;
73555
74102
  }
73556
74103
  function userVaultRoutes(deps) {
73557
- const app = new Hono39();
74104
+ const app = new Hono40();
73558
74105
  app.get("/", async (c) => {
73559
74106
  return c.json(await deps.userVault.getVault(c.var.user.userId));
73560
74107
  });
@@ -73568,8 +74115,8 @@ function userVaultRoutes(deps) {
73568
74115
  });
73569
74116
  return app;
73570
74117
  }
73571
- var _routes_dec16, _userVault_dec2, _UserVaultRoutes_decorators, _init133;
73572
- _UserVaultRoutes_decorators = [Component64({
74118
+ var _routes_dec17, _userVault_dec2, _UserVaultRoutes_decorators, _init134;
74119
+ _UserVaultRoutes_decorators = [Component65({
73573
74120
  contributes: {
73574
74121
  "HttpModule.routes": [
73575
74122
  {
@@ -73580,28 +74127,28 @@ _UserVaultRoutes_decorators = [Component64({
73580
74127
  }
73581
74128
  ]
73582
74129
  }
73583
- })], _userVault_dec2 = [Use66()], _routes_dec16 = [Bind23("UserVaultRoutes.routes")];
74130
+ })], _userVault_dec2 = [Use67()], _routes_dec17 = [Bind24("UserVaultRoutes.routes")];
73584
74131
  var UserVaultRoutes = class {
73585
74132
  constructor() {
73586
- __publicField(this, "userVault", __runInitializers(_init133, 8, this)), __runInitializers(_init133, 11, this);
73587
- __publicField(this, "routes", __runInitializers(_init133, 12, this)), __runInitializers(_init133, 15, this);
74133
+ __publicField(this, "userVault", __runInitializers(_init134, 8, this)), __runInitializers(_init134, 11, this);
74134
+ __publicField(this, "routes", __runInitializers(_init134, 12, this)), __runInitializers(_init134, 15, this);
73588
74135
  }
73589
74136
  setup() {
73590
74137
  this.routes = userVaultRoutes({ userVault: this.userVault });
73591
74138
  }
73592
74139
  };
73593
- _init133 = __decoratorStart(null);
73594
- __decorateElement(_init133, 5, "userVault", _userVault_dec2, UserVaultRoutes);
73595
- __decorateElement(_init133, 5, "routes", _routes_dec16, UserVaultRoutes);
73596
- UserVaultRoutes = __decorateElement(_init133, 0, "UserVaultRoutes", _UserVaultRoutes_decorators, UserVaultRoutes);
73597
- __runInitializers(_init133, 1, UserVaultRoutes);
74140
+ _init134 = __decoratorStart(null);
74141
+ __decorateElement(_init134, 5, "userVault", _userVault_dec2, UserVaultRoutes);
74142
+ __decorateElement(_init134, 5, "routes", _routes_dec17, UserVaultRoutes);
74143
+ UserVaultRoutes = __decorateElement(_init134, 0, "UserVaultRoutes", _UserVaultRoutes_decorators, UserVaultRoutes);
74144
+ __runInitializers(_init134, 1, UserVaultRoutes);
73598
74145
 
73599
74146
  // src/http/routes/auth.ts
73600
- import { Hono as Hono40 } from "hono";
74147
+ import { Hono as Hono41 } from "hono";
73601
74148
  import { deleteCookie, getCookie as getCookie3, setCookie as setCookie3 } from "hono/cookie";
73602
- import { Bind as Bind24, Component as Component65, Use as Use67 } from "@adelie/core/kernel";
74149
+ import { Bind as Bind25, Component as Component66, Use as Use68 } from "@adelie/core/kernel";
73603
74150
  function authRoutes(deps) {
73604
- const app = new Hono40();
74151
+ const app = new Hono41();
73605
74152
  app.post("/login", async (c) => {
73606
74153
  const body = await readJson(c);
73607
74154
  const userId = requireString(body, "userId", { label: "userId" });
@@ -73639,18 +74186,18 @@ function authRoutes(deps) {
73639
74186
  });
73640
74187
  return app;
73641
74188
  }
73642
- var _routes_dec17, _desktop_dec13, _config_dec14, _auth_dec8, _AuthRoutes_decorators, _init134;
73643
- _AuthRoutes_decorators = [Component65({
74189
+ var _routes_dec18, _desktop_dec13, _config_dec14, _auth_dec8, _AuthRoutes_decorators, _init135;
74190
+ _AuthRoutes_decorators = [Component66({
73644
74191
  contributes: {
73645
74192
  "HttpModule.routes": [{ id: "AuthRoutes.routes", prefix: "/api/auth", auth: "none", order: 5 }]
73646
74193
  }
73647
- })], _auth_dec8 = [Use67()], _config_dec14 = [Use67()], _desktop_dec13 = [Use67()], _routes_dec17 = [Bind24("AuthRoutes.routes")];
74194
+ })], _auth_dec8 = [Use68()], _config_dec14 = [Use68()], _desktop_dec13 = [Use68()], _routes_dec18 = [Bind25("AuthRoutes.routes")];
73648
74195
  var AuthRoutes = class {
73649
74196
  constructor() {
73650
- __publicField(this, "auth", __runInitializers(_init134, 8, this)), __runInitializers(_init134, 11, this);
73651
- __publicField(this, "config", __runInitializers(_init134, 12, this)), __runInitializers(_init134, 15, this);
73652
- __publicField(this, "desktop", __runInitializers(_init134, 16, this)), __runInitializers(_init134, 19, this);
73653
- __publicField(this, "routes", __runInitializers(_init134, 20, this)), __runInitializers(_init134, 23, this);
74197
+ __publicField(this, "auth", __runInitializers(_init135, 8, this)), __runInitializers(_init135, 11, this);
74198
+ __publicField(this, "config", __runInitializers(_init135, 12, this)), __runInitializers(_init135, 15, this);
74199
+ __publicField(this, "desktop", __runInitializers(_init135, 16, this)), __runInitializers(_init135, 19, this);
74200
+ __publicField(this, "routes", __runInitializers(_init135, 20, this)), __runInitializers(_init135, 23, this);
73654
74201
  }
73655
74202
  setup() {
73656
74203
  this.routes = authRoutes({
@@ -73660,26 +74207,26 @@ var AuthRoutes = class {
73660
74207
  });
73661
74208
  }
73662
74209
  };
73663
- _init134 = __decoratorStart(null);
73664
- __decorateElement(_init134, 5, "auth", _auth_dec8, AuthRoutes);
73665
- __decorateElement(_init134, 5, "config", _config_dec14, AuthRoutes);
73666
- __decorateElement(_init134, 5, "desktop", _desktop_dec13, AuthRoutes);
73667
- __decorateElement(_init134, 5, "routes", _routes_dec17, AuthRoutes);
73668
- AuthRoutes = __decorateElement(_init134, 0, "AuthRoutes", _AuthRoutes_decorators, AuthRoutes);
73669
- __runInitializers(_init134, 1, AuthRoutes);
74210
+ _init135 = __decoratorStart(null);
74211
+ __decorateElement(_init135, 5, "auth", _auth_dec8, AuthRoutes);
74212
+ __decorateElement(_init135, 5, "config", _config_dec14, AuthRoutes);
74213
+ __decorateElement(_init135, 5, "desktop", _desktop_dec13, AuthRoutes);
74214
+ __decorateElement(_init135, 5, "routes", _routes_dec18, AuthRoutes);
74215
+ AuthRoutes = __decorateElement(_init135, 0, "AuthRoutes", _AuthRoutes_decorators, AuthRoutes);
74216
+ __runInitializers(_init135, 1, AuthRoutes);
73670
74217
 
73671
74218
  // src/http/routes/install.ts
73672
- import { Hono as Hono41 } from "hono";
73673
- import { Bind as Bind25, Component as Component66, Use as Use68 } from "@adelie/core/kernel";
74219
+ import { Hono as Hono42 } from "hono";
74220
+ import { Bind as Bind26, Component as Component67, Use as Use69 } from "@adelie/core/kernel";
73674
74221
  function installRoutes(deps) {
73675
- const app = new Hono41();
74222
+ const app = new Hono42();
73676
74223
  app.get("/", (c) => {
73677
74224
  return c.json({ installId: ensureInstallId(deps.config.root) });
73678
74225
  });
73679
74226
  return app;
73680
74227
  }
73681
- var _routes_dec18, _config_dec15, _InstallRoutes_decorators, _init135;
73682
- _InstallRoutes_decorators = [Component66({
74228
+ var _routes_dec19, _config_dec15, _InstallRoutes_decorators, _init136;
74229
+ _InstallRoutes_decorators = [Component67({
73683
74230
  contributes: {
73684
74231
  "HttpModule.routes": [
73685
74232
  {
@@ -73690,28 +74237,28 @@ _InstallRoutes_decorators = [Component66({
73690
74237
  }
73691
74238
  ]
73692
74239
  }
73693
- })], _config_dec15 = [Use68()], _routes_dec18 = [Bind25("InstallRoutes.routes")];
74240
+ })], _config_dec15 = [Use69()], _routes_dec19 = [Bind26("InstallRoutes.routes")];
73694
74241
  var InstallRoutes = class {
73695
74242
  constructor() {
73696
- __publicField(this, "config", __runInitializers(_init135, 8, this)), __runInitializers(_init135, 11, this);
73697
- __publicField(this, "routes", __runInitializers(_init135, 12, this)), __runInitializers(_init135, 15, this);
74243
+ __publicField(this, "config", __runInitializers(_init136, 8, this)), __runInitializers(_init136, 11, this);
74244
+ __publicField(this, "routes", __runInitializers(_init136, 12, this)), __runInitializers(_init136, 15, this);
73698
74245
  }
73699
74246
  setup() {
73700
74247
  this.routes = installRoutes({ config: this.config });
73701
74248
  }
73702
74249
  };
73703
- _init135 = __decoratorStart(null);
73704
- __decorateElement(_init135, 5, "config", _config_dec15, InstallRoutes);
73705
- __decorateElement(_init135, 5, "routes", _routes_dec18, InstallRoutes);
73706
- InstallRoutes = __decorateElement(_init135, 0, "InstallRoutes", _InstallRoutes_decorators, InstallRoutes);
73707
- __runInitializers(_init135, 1, InstallRoutes);
74250
+ _init136 = __decoratorStart(null);
74251
+ __decorateElement(_init136, 5, "config", _config_dec15, InstallRoutes);
74252
+ __decorateElement(_init136, 5, "routes", _routes_dec19, InstallRoutes);
74253
+ InstallRoutes = __decorateElement(_init136, 0, "InstallRoutes", _InstallRoutes_decorators, InstallRoutes);
74254
+ __runInitializers(_init136, 1, InstallRoutes);
73708
74255
 
73709
74256
  // src/http/routes/themes.ts
73710
74257
  import { mkdir as mkdir2, readdir, readFile, rm as rm3, writeFile } from "fs/promises";
73711
74258
  import { join as join2 } from "path";
73712
- import { Hono as Hono42 } from "hono";
74259
+ import { Hono as Hono43 } from "hono";
73713
74260
  import { externalThemesCss, MAX_THEME_FILE_BYTES as MAX_THEME_FILE_BYTES2, readExternalTheme } from "@adelie/core";
73714
- import { Bind as Bind26, Component as Component67, Use as Use69 } from "@adelie/core/kernel";
74261
+ import { Bind as Bind27, Component as Component68, Use as Use70 } from "@adelie/core/kernel";
73715
74262
 
73716
74263
  // src/services/theme-download.ts
73717
74264
  import { MAX_THEME_FILE_BYTES } from "@adelie/core";
@@ -74283,7 +74830,7 @@ async function readImportedThemes(root) {
74283
74830
  return { dir, themes, rejected };
74284
74831
  }
74285
74832
  function themeStylesheetRoutes(deps) {
74286
- const routes = new Hono42();
74833
+ const routes = new Hono43();
74287
74834
  routes.get("/", async (c) => {
74288
74835
  const { themes } = await readImportedThemes(deps.root);
74289
74836
  return c.body(externalThemesCss(themes.map((entry) => entry.theme)), 200, {
@@ -74338,7 +74885,7 @@ async function installTheme(root, text2, overwrite) {
74338
74885
  return { file, theme };
74339
74886
  }
74340
74887
  function themesRoutes(deps) {
74341
- const routes = new Hono42();
74888
+ const routes = new Hono43();
74342
74889
  const registry = createThemeRegistry();
74343
74890
  routes.get("/", async (c) => {
74344
74891
  const { dir, themes, rejected } = await readImportedThemes(deps.root);
@@ -74425,57 +74972,57 @@ function themesRoutes(deps) {
74425
74972
  });
74426
74973
  return routes;
74427
74974
  }
74428
- var _routes_dec19, _config_dec16, _ThemesRoutes_decorators, _init136;
74429
- _ThemesRoutes_decorators = [Component67({
74975
+ var _routes_dec20, _config_dec16, _ThemesRoutes_decorators, _init137;
74976
+ _ThemesRoutes_decorators = [Component68({
74430
74977
  contributes: {
74431
74978
  "HttpModule.routes": [
74432
74979
  { id: "ThemesRoutes.routes", prefix: "/api/themes", auth: "user", order: 66 }
74433
74980
  ]
74434
74981
  }
74435
- })], _config_dec16 = [Use69()], _routes_dec19 = [Bind26("ThemesRoutes.routes")];
74982
+ })], _config_dec16 = [Use70()], _routes_dec20 = [Bind27("ThemesRoutes.routes")];
74436
74983
  var ThemesRoutes = class {
74437
74984
  constructor() {
74438
- __publicField(this, "config", __runInitializers(_init136, 8, this)), __runInitializers(_init136, 11, this);
74439
- __publicField(this, "routes", __runInitializers(_init136, 12, this)), __runInitializers(_init136, 15, this);
74985
+ __publicField(this, "config", __runInitializers(_init137, 8, this)), __runInitializers(_init137, 11, this);
74986
+ __publicField(this, "routes", __runInitializers(_init137, 12, this)), __runInitializers(_init137, 15, this);
74440
74987
  }
74441
74988
  setup() {
74442
74989
  this.routes = themesRoutes({ root: this.config.root });
74443
74990
  }
74444
74991
  };
74445
- _init136 = __decoratorStart(null);
74446
- __decorateElement(_init136, 5, "config", _config_dec16, ThemesRoutes);
74447
- __decorateElement(_init136, 5, "routes", _routes_dec19, ThemesRoutes);
74448
- ThemesRoutes = __decorateElement(_init136, 0, "ThemesRoutes", _ThemesRoutes_decorators, ThemesRoutes);
74449
- __runInitializers(_init136, 1, ThemesRoutes);
74450
- var _routes_dec20, _config_dec17, _ThemeStylesheetRoutes_decorators, _init137;
74451
- _ThemeStylesheetRoutes_decorators = [Component67({
74992
+ _init137 = __decoratorStart(null);
74993
+ __decorateElement(_init137, 5, "config", _config_dec16, ThemesRoutes);
74994
+ __decorateElement(_init137, 5, "routes", _routes_dec20, ThemesRoutes);
74995
+ ThemesRoutes = __decorateElement(_init137, 0, "ThemesRoutes", _ThemesRoutes_decorators, ThemesRoutes);
74996
+ __runInitializers(_init137, 1, ThemesRoutes);
74997
+ var _routes_dec21, _config_dec17, _ThemeStylesheetRoutes_decorators, _init138;
74998
+ _ThemeStylesheetRoutes_decorators = [Component68({
74452
74999
  contributes: {
74453
75000
  "HttpModule.routes": [
74454
75001
  { id: "ThemeStylesheetRoutes.routes", prefix: "/api/themes.css", auth: "none", order: 5 }
74455
75002
  ]
74456
75003
  }
74457
- })], _config_dec17 = [Use69()], _routes_dec20 = [Bind26("ThemeStylesheetRoutes.routes")];
75004
+ })], _config_dec17 = [Use70()], _routes_dec21 = [Bind27("ThemeStylesheetRoutes.routes")];
74458
75005
  var ThemeStylesheetRoutes = class {
74459
75006
  constructor() {
74460
- __publicField(this, "config", __runInitializers(_init137, 8, this)), __runInitializers(_init137, 11, this);
74461
- __publicField(this, "routes", __runInitializers(_init137, 12, this)), __runInitializers(_init137, 15, this);
75007
+ __publicField(this, "config", __runInitializers(_init138, 8, this)), __runInitializers(_init138, 11, this);
75008
+ __publicField(this, "routes", __runInitializers(_init138, 12, this)), __runInitializers(_init138, 15, this);
74462
75009
  }
74463
75010
  setup() {
74464
75011
  this.routes = themeStylesheetRoutes({ root: this.config.root });
74465
75012
  }
74466
75013
  };
74467
- _init137 = __decoratorStart(null);
74468
- __decorateElement(_init137, 5, "config", _config_dec17, ThemeStylesheetRoutes);
74469
- __decorateElement(_init137, 5, "routes", _routes_dec20, ThemeStylesheetRoutes);
74470
- ThemeStylesheetRoutes = __decorateElement(_init137, 0, "ThemeStylesheetRoutes", _ThemeStylesheetRoutes_decorators, ThemeStylesheetRoutes);
74471
- __runInitializers(_init137, 1, ThemeStylesheetRoutes);
75014
+ _init138 = __decoratorStart(null);
75015
+ __decorateElement(_init138, 5, "config", _config_dec17, ThemeStylesheetRoutes);
75016
+ __decorateElement(_init138, 5, "routes", _routes_dec21, ThemeStylesheetRoutes);
75017
+ ThemeStylesheetRoutes = __decorateElement(_init138, 0, "ThemeStylesheetRoutes", _ThemeStylesheetRoutes_decorators, ThemeStylesheetRoutes);
75018
+ __runInitializers(_init138, 1, ThemeStylesheetRoutes);
74472
75019
 
74473
75020
  // src/hmr/routes.ts
74474
- import { Hono as Hono43 } from "hono";
74475
- import { Bind as Bind27, Component as Component68, Use as Use70 } from "@adelie/core/kernel";
75021
+ import { Hono as Hono44 } from "hono";
75022
+ import { Bind as Bind28, Component as Component69, Use as Use71 } from "@adelie/core/kernel";
74476
75023
  var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["127.0.0.1", "::1", "localhost"]);
74477
75024
  function hmrRoutes(deps) {
74478
- const routes = new Hono43();
75025
+ const routes = new Hono44();
74479
75026
  routes.use("*", async (c, next) => {
74480
75027
  if (!LOOPBACK_HOSTS.has(deps.config.host.toLowerCase())) {
74481
75028
  const proto = deps.config.trustProxy ? c.req.header("x-forwarded-proto") ?? new URL(c.req.url).protocol.replace(":", "") : new URL(c.req.url).protocol.replace(":", "");
@@ -74511,8 +75058,8 @@ function hmrRoutes(deps) {
74511
75058
  );
74512
75059
  return routes;
74513
75060
  }
74514
- var _routes_dec21, _channels_dec10, _config_dec18, _auth_dec9, _control_dec, _HmrRoutes_decorators, _init138;
74515
- _HmrRoutes_decorators = [Component68({
75061
+ var _routes_dec22, _channels_dec10, _config_dec18, _auth_dec9, _control_dec, _HmrRoutes_decorators, _init139;
75062
+ _HmrRoutes_decorators = [Component69({
74516
75063
  contributes: {
74517
75064
  "HttpModule.routes": [
74518
75065
  // Manifest data is literal (gen-ifaces reads it off the source): the same prefix packages/hmr exports as HMR_ROUTE_PREFIX.
@@ -74521,14 +75068,14 @@ _HmrRoutes_decorators = [Component68({
74521
75068
  { id: "HmrRoutes.routes", prefix: "/api/hmr", auth: "none", order: 5 }
74522
75069
  ]
74523
75070
  }
74524
- })], _control_dec = [Use70()], _auth_dec9 = [Use70()], _config_dec18 = [Use70()], _channels_dec10 = [Use70()], _routes_dec21 = [Bind27("HmrRoutes.routes")];
75071
+ })], _control_dec = [Use71()], _auth_dec9 = [Use71()], _config_dec18 = [Use71()], _channels_dec10 = [Use71()], _routes_dec22 = [Bind28("HmrRoutes.routes")];
74525
75072
  var HmrRoutes = class {
74526
75073
  constructor() {
74527
- __publicField(this, "control", __runInitializers(_init138, 8, this)), __runInitializers(_init138, 11, this);
74528
- __publicField(this, "auth", __runInitializers(_init138, 12, this)), __runInitializers(_init138, 15, this);
74529
- __publicField(this, "config", __runInitializers(_init138, 16, this)), __runInitializers(_init138, 19, this);
74530
- __publicField(this, "channels", __runInitializers(_init138, 20, this)), __runInitializers(_init138, 23, this);
74531
- __publicField(this, "routes", __runInitializers(_init138, 24, this)), __runInitializers(_init138, 27, this);
75074
+ __publicField(this, "control", __runInitializers(_init139, 8, this)), __runInitializers(_init139, 11, this);
75075
+ __publicField(this, "auth", __runInitializers(_init139, 12, this)), __runInitializers(_init139, 15, this);
75076
+ __publicField(this, "config", __runInitializers(_init139, 16, this)), __runInitializers(_init139, 19, this);
75077
+ __publicField(this, "channels", __runInitializers(_init139, 20, this)), __runInitializers(_init139, 23, this);
75078
+ __publicField(this, "routes", __runInitializers(_init139, 24, this)), __runInitializers(_init139, 27, this);
74532
75079
  }
74533
75080
  setup() {
74534
75081
  this.routes = hmrRoutes({
@@ -74540,19 +75087,19 @@ var HmrRoutes = class {
74540
75087
  });
74541
75088
  }
74542
75089
  };
74543
- _init138 = __decoratorStart(null);
74544
- __decorateElement(_init138, 5, "control", _control_dec, HmrRoutes);
74545
- __decorateElement(_init138, 5, "auth", _auth_dec9, HmrRoutes);
74546
- __decorateElement(_init138, 5, "config", _config_dec18, HmrRoutes);
74547
- __decorateElement(_init138, 5, "channels", _channels_dec10, HmrRoutes);
74548
- __decorateElement(_init138, 5, "routes", _routes_dec21, HmrRoutes);
74549
- HmrRoutes = __decorateElement(_init138, 0, "HmrRoutes", _HmrRoutes_decorators, HmrRoutes);
74550
- __runInitializers(_init138, 1, HmrRoutes);
75090
+ _init139 = __decoratorStart(null);
75091
+ __decorateElement(_init139, 5, "control", _control_dec, HmrRoutes);
75092
+ __decorateElement(_init139, 5, "auth", _auth_dec9, HmrRoutes);
75093
+ __decorateElement(_init139, 5, "config", _config_dec18, HmrRoutes);
75094
+ __decorateElement(_init139, 5, "channels", _channels_dec10, HmrRoutes);
75095
+ __decorateElement(_init139, 5, "routes", _routes_dec22, HmrRoutes);
75096
+ HmrRoutes = __decorateElement(_init139, 0, "HmrRoutes", _HmrRoutes_decorators, HmrRoutes);
75097
+ __runInitializers(_init139, 1, HmrRoutes);
74551
75098
 
74552
75099
  // src/http/routes/plugins.ts
74553
75100
  import path49 from "path";
74554
75101
  import { strToU8, unzipSync as unzipSync4, zipSync as zipSync3 } from "fflate";
74555
- import { Hono as Hono45 } from "hono";
75102
+ import { Hono as Hono46 } from "hono";
74556
75103
  import {
74557
75104
  PLUGIN_NAME_PATTERN as PLUGIN_NAME_PATTERN4,
74558
75105
  installPlugin as installPlugin2,
@@ -74566,13 +75113,13 @@ import {
74566
75113
  userPluginRoots,
74567
75114
  userPluginsDir
74568
75115
  } from "@adelie/core";
74569
- import { Bind as Bind28, Component as Component69, Use as Use71 } from "@adelie/core/kernel";
75116
+ import { Bind as Bind29, Component as Component70, Use as Use72 } from "@adelie/core/kernel";
74570
75117
 
74571
75118
  // src/http/routes/hooks.ts
74572
75119
  import fs41 from "fs/promises";
74573
75120
  import path44 from "path";
74574
75121
  import { unzipSync as unzipSync3, strFromU8 as strFromU83, zipSync as zipSync2 } from "fflate";
74575
- import { Hono as Hono44 } from "hono";
75122
+ import { Hono as Hono45 } from "hono";
74576
75123
  import {
74577
75124
  PLUGIN_NAME_PATTERN as PLUGIN_NAME_PATTERN3,
74578
75125
  hooksDir,
@@ -74728,7 +75275,7 @@ async function collectHookArchive(dir, name) {
74728
75275
  return out;
74729
75276
  }
74730
75277
  function agentHooksRoutes(deps) {
74731
- const app = new Hono44();
75278
+ const app = new Hono45();
74732
75279
  const installedItems = async (projectId, agentId) => (await listInstalledHooks2(deps.config.root, projectId, agentId)).map(toHookItem);
74733
75280
  const requireInstalled = async (projectId, agentId, name) => {
74734
75281
  const dir = path44.join(hooksDir(deps.config.root, projectId, agentId), name);
@@ -75408,13 +75955,13 @@ async function readPackageTable(file) {
75408
75955
  };
75409
75956
  }
75410
75957
  const table = JSON.parse(text2);
75411
- const isRecord5 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
75412
- if (!isRecord5(table.ifaces) || !isRecord5(table.types) || !isRecord5(table.modules)) {
75958
+ const isRecord6 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
75959
+ if (!isRecord6(table.ifaces) || !isRecord6(table.types) || !isRecord6(table.modules)) {
75413
75960
  throw new Error(`${tableFile}: expected { ifaces, types, modules } (gen-ifaces output)`);
75414
75961
  }
75415
75962
  const names = (v) => Array.isArray(v) && v.every((n) => typeof n === "string");
75416
75963
  const plugin = table.plugin ?? {};
75417
- if (!isRecord5(plugin) || !names(plugin.modules ?? []) || !names(plugin.replaces ?? [])) {
75964
+ if (!isRecord6(plugin) || !names(plugin.modules ?? []) || !names(plugin.replaces ?? [])) {
75418
75965
  throw new Error(
75419
75966
  `${tableFile}#plugin: expected { modules: [<name>, \u2026], replaces: [<name>, \u2026] }`
75420
75967
  );
@@ -76080,7 +76627,7 @@ async function importPlugin2(deps, parsed, overwrite) {
76080
76627
  };
76081
76628
  }
76082
76629
  function pluginLibraryRoutes(deps) {
76083
- const app = new Hono45();
76630
+ const app = new Hono46();
76084
76631
  app.get("/", (c) => c.json(libraryResponse(deps.config.root)));
76085
76632
  app.get(
76086
76633
  "/directory",
@@ -76174,7 +76721,7 @@ function pluginLibraryRoutes(deps) {
76174
76721
  return app;
76175
76722
  }
76176
76723
  function agentPluginsRoutes(deps) {
76177
- const app = new Hono45();
76724
+ const app = new Hono46();
76178
76725
  app.post("/", async (c) => {
76179
76726
  const projectId = requireValidId(c, "projectId");
76180
76727
  const agentId = requireValidId(c, "agentId");
@@ -76201,8 +76748,8 @@ function agentPluginsRoutes(deps) {
76201
76748
  });
76202
76749
  return app;
76203
76750
  }
76204
- var _hookRoutes_dec, _pluginRoutes_dec, _libraryRoutes_dec, _manager_dec4, _agentConfig_dec7, _access_dec8, _config_dec19, _PluginRoutes_decorators, _init139;
76205
- _PluginRoutes_decorators = [Component69({
76751
+ var _hookRoutes_dec, _pluginRoutes_dec, _libraryRoutes_dec, _manager_dec4, _agentConfig_dec7, _access_dec8, _config_dec19, _PluginRoutes_decorators, _init140;
76752
+ _PluginRoutes_decorators = [Component70({
76206
76753
  contributes: {
76207
76754
  "HttpModule.routes": [
76208
76755
  { id: "PluginRoutes.library", prefix: "/api/plugins", auth: "user", order: 70 },
@@ -76220,16 +76767,16 @@ _PluginRoutes_decorators = [Component69({
76220
76767
  }
76221
76768
  ]
76222
76769
  }
76223
- })], _config_dec19 = [Use71()], _access_dec8 = [Use71()], _agentConfig_dec7 = [Use71()], _manager_dec4 = [Use71()], _libraryRoutes_dec = [Bind28("PluginRoutes.library")], _pluginRoutes_dec = [Bind28("PluginRoutes.agent-plugins")], _hookRoutes_dec = [Bind28("PluginRoutes.agent-hooks")];
76770
+ })], _config_dec19 = [Use72()], _access_dec8 = [Use72()], _agentConfig_dec7 = [Use72()], _manager_dec4 = [Use72()], _libraryRoutes_dec = [Bind29("PluginRoutes.library")], _pluginRoutes_dec = [Bind29("PluginRoutes.agent-plugins")], _hookRoutes_dec = [Bind29("PluginRoutes.agent-hooks")];
76224
76771
  var PluginRoutes = class {
76225
76772
  constructor() {
76226
- __publicField(this, "config", __runInitializers(_init139, 8, this)), __runInitializers(_init139, 11, this);
76227
- __publicField(this, "access", __runInitializers(_init139, 12, this)), __runInitializers(_init139, 15, this);
76228
- __publicField(this, "agentConfig", __runInitializers(_init139, 16, this)), __runInitializers(_init139, 19, this);
76229
- __publicField(this, "manager", __runInitializers(_init139, 20, this)), __runInitializers(_init139, 23, this);
76230
- __publicField(this, "libraryRoutes", __runInitializers(_init139, 24, this)), __runInitializers(_init139, 27, this);
76231
- __publicField(this, "pluginRoutes", __runInitializers(_init139, 28, this)), __runInitializers(_init139, 31, this);
76232
- __publicField(this, "hookRoutes", __runInitializers(_init139, 32, this)), __runInitializers(_init139, 35, this);
76773
+ __publicField(this, "config", __runInitializers(_init140, 8, this)), __runInitializers(_init140, 11, this);
76774
+ __publicField(this, "access", __runInitializers(_init140, 12, this)), __runInitializers(_init140, 15, this);
76775
+ __publicField(this, "agentConfig", __runInitializers(_init140, 16, this)), __runInitializers(_init140, 19, this);
76776
+ __publicField(this, "manager", __runInitializers(_init140, 20, this)), __runInitializers(_init140, 23, this);
76777
+ __publicField(this, "libraryRoutes", __runInitializers(_init140, 24, this)), __runInitializers(_init140, 27, this);
76778
+ __publicField(this, "pluginRoutes", __runInitializers(_init140, 28, this)), __runInitializers(_init140, 31, this);
76779
+ __publicField(this, "hookRoutes", __runInitializers(_init140, 32, this)), __runInitializers(_init140, 35, this);
76233
76780
  }
76234
76781
  setup() {
76235
76782
  const deps = {
@@ -76243,18 +76790,18 @@ var PluginRoutes = class {
76243
76790
  this.hookRoutes = agentHooksRoutes(deps);
76244
76791
  }
76245
76792
  };
76246
- _init139 = __decoratorStart(null);
76247
- __decorateElement(_init139, 5, "config", _config_dec19, PluginRoutes);
76248
- __decorateElement(_init139, 5, "access", _access_dec8, PluginRoutes);
76249
- __decorateElement(_init139, 5, "agentConfig", _agentConfig_dec7, PluginRoutes);
76250
- __decorateElement(_init139, 5, "manager", _manager_dec4, PluginRoutes);
76251
- __decorateElement(_init139, 5, "libraryRoutes", _libraryRoutes_dec, PluginRoutes);
76252
- __decorateElement(_init139, 5, "pluginRoutes", _pluginRoutes_dec, PluginRoutes);
76253
- __decorateElement(_init139, 5, "hookRoutes", _hookRoutes_dec, PluginRoutes);
76254
- PluginRoutes = __decorateElement(_init139, 0, "PluginRoutes", _PluginRoutes_decorators, PluginRoutes);
76255
- __runInitializers(_init139, 1, PluginRoutes);
76793
+ _init140 = __decoratorStart(null);
76794
+ __decorateElement(_init140, 5, "config", _config_dec19, PluginRoutes);
76795
+ __decorateElement(_init140, 5, "access", _access_dec8, PluginRoutes);
76796
+ __decorateElement(_init140, 5, "agentConfig", _agentConfig_dec7, PluginRoutes);
76797
+ __decorateElement(_init140, 5, "manager", _manager_dec4, PluginRoutes);
76798
+ __decorateElement(_init140, 5, "libraryRoutes", _libraryRoutes_dec, PluginRoutes);
76799
+ __decorateElement(_init140, 5, "pluginRoutes", _pluginRoutes_dec, PluginRoutes);
76800
+ __decorateElement(_init140, 5, "hookRoutes", _hookRoutes_dec, PluginRoutes);
76801
+ PluginRoutes = __decorateElement(_init140, 0, "PluginRoutes", _PluginRoutes_decorators, PluginRoutes);
76802
+ __runInitializers(_init140, 1, PluginRoutes);
76256
76803
  function pluginRegistryRoutes(bases, root, published = null) {
76257
- const app = new Hono45();
76804
+ const app = new Hono46();
76258
76805
  const builtin = builtinPluginRegistry({
76259
76806
  bases,
76260
76807
  // The shelf is what this build ships: read per call, because a push moves both the
@@ -76297,8 +76844,8 @@ function pluginRegistryRoutes(bases, root, published = null) {
76297
76844
  });
76298
76845
  return app;
76299
76846
  }
76300
- var _routes_dec22, _hmr_dec4, _config_dec20, _PluginRegistryRoutes_decorators, _init140;
76301
- _PluginRegistryRoutes_decorators = [Component69({
76847
+ var _routes_dec23, _hmr_dec4, _config_dec20, _PluginRegistryRoutes_decorators, _init141;
76848
+ _PluginRegistryRoutes_decorators = [Component70({
76302
76849
  contributes: {
76303
76850
  "HttpModule.routes": [
76304
76851
  {
@@ -76309,14 +76856,14 @@ _PluginRegistryRoutes_decorators = [Component69({
76309
76856
  }
76310
76857
  ]
76311
76858
  }
76312
- })], _config_dec20 = [Use71()], _hmr_dec4 = [Use71()], _routes_dec22 = [Bind28("PluginRegistryRoutes.routes")];
76859
+ })], _config_dec20 = [Use72()], _hmr_dec4 = [Use72()], _routes_dec23 = [Bind29("PluginRegistryRoutes.routes")];
76313
76860
  var PluginRegistryRoutes = class {
76314
76861
  constructor() {
76315
- __publicField(this, "config", __runInitializers(_init140, 8, this)), __runInitializers(_init140, 11, this);
76316
- __publicField(this, "hmr", __runInitializers(_init140, 12, this)), __runInitializers(_init140, 15, this);
76862
+ __publicField(this, "config", __runInitializers(_init141, 8, this)), __runInitializers(_init141, 11, this);
76863
+ __publicField(this, "hmr", __runInitializers(_init141, 12, this)), __runInitializers(_init141, 15, this);
76317
76864
  /** Environment to read ADELIE_PLUGIN_MARKET from; a test wires its own. */
76318
76865
  __publicField(this, "env", process.env);
76319
- __publicField(this, "routes", __runInitializers(_init140, 16, this)), __runInitializers(_init140, 19, this);
76866
+ __publicField(this, "routes", __runInitializers(_init141, 16, this)), __runInitializers(_init141, 19, this);
76320
76867
  }
76321
76868
  setup() {
76322
76869
  this.routes = pluginRegistryRoutes(
@@ -76326,19 +76873,19 @@ var PluginRegistryRoutes = class {
76326
76873
  );
76327
76874
  }
76328
76875
  };
76329
- _init140 = __decoratorStart(null);
76330
- __decorateElement(_init140, 5, "config", _config_dec20, PluginRegistryRoutes);
76331
- __decorateElement(_init140, 5, "hmr", _hmr_dec4, PluginRegistryRoutes);
76332
- __decorateElement(_init140, 5, "routes", _routes_dec22, PluginRegistryRoutes);
76333
- PluginRegistryRoutes = __decorateElement(_init140, 0, "PluginRegistryRoutes", _PluginRegistryRoutes_decorators, PluginRegistryRoutes);
76334
- __runInitializers(_init140, 1, PluginRegistryRoutes);
76876
+ _init141 = __decoratorStart(null);
76877
+ __decorateElement(_init141, 5, "config", _config_dec20, PluginRegistryRoutes);
76878
+ __decorateElement(_init141, 5, "hmr", _hmr_dec4, PluginRegistryRoutes);
76879
+ __decorateElement(_init141, 5, "routes", _routes_dec23, PluginRegistryRoutes);
76880
+ PluginRegistryRoutes = __decorateElement(_init141, 0, "PluginRegistryRoutes", _PluginRegistryRoutes_decorators, PluginRegistryRoutes);
76881
+ __runInitializers(_init141, 1, PluginRegistryRoutes);
76335
76882
 
76336
76883
  // src/http/routes/plugins-installed.ts
76337
- import { Hono as Hono46 } from "hono";
76338
- import { Bind as Bind29, Component as Component70, Use as Use72 } from "@adelie/core/kernel";
76884
+ import { Hono as Hono47 } from "hono";
76885
+ import { Bind as Bind30, Component as Component71, Use as Use73 } from "@adelie/core/kernel";
76339
76886
  import { effectivePluginTable as effectivePluginTable3, PLUGIN_MACHINE_ID } from "@adelie/core";
76340
76887
  function installedPluginRoutes(deps) {
76341
- const app = new Hono46();
76888
+ const app = new Hono47();
76342
76889
  const scope = (c) => {
76343
76890
  const projectId = requireValidId(c, "projectId");
76344
76891
  deps.access.requireProjectAccess(c.var.user.userId, projectId);
@@ -76525,8 +77072,8 @@ function installedPluginRoutes(deps) {
76525
77072
  });
76526
77073
  return app;
76527
77074
  }
76528
- var _routes_dec23, _db_dec17, _machines_dec4, _access_dec9, _projectConfig_dec14, _reassembly_dec2, _hmr_dec5, _config_dec21, _InstalledPluginRoutes_decorators, _init141;
76529
- _InstalledPluginRoutes_decorators = [Component70({
77075
+ var _routes_dec24, _db_dec17, _machines_dec4, _access_dec9, _projectConfig_dec14, _reassembly_dec2, _hmr_dec5, _config_dec21, _InstalledPluginRoutes_decorators, _init142;
77076
+ _InstalledPluginRoutes_decorators = [Component71({
76530
77077
  contributes: {
76531
77078
  "HttpModule.routes": [
76532
77079
  {
@@ -76538,17 +77085,17 @@ _InstalledPluginRoutes_decorators = [Component70({
76538
77085
  }
76539
77086
  ]
76540
77087
  }
76541
- })], _config_dec21 = [Use72()], _hmr_dec5 = [Use72()], _reassembly_dec2 = [Use72()], _projectConfig_dec14 = [Use72()], _access_dec9 = [Use72()], _machines_dec4 = [Use72()], _db_dec17 = [Use72()], _routes_dec23 = [Bind29("InstalledPluginRoutes.routes")];
77088
+ })], _config_dec21 = [Use73()], _hmr_dec5 = [Use73()], _reassembly_dec2 = [Use73()], _projectConfig_dec14 = [Use73()], _access_dec9 = [Use73()], _machines_dec4 = [Use73()], _db_dec17 = [Use73()], _routes_dec24 = [Bind30("InstalledPluginRoutes.routes")];
76542
77089
  var InstalledPluginRoutes = class {
76543
77090
  constructor() {
76544
- __publicField(this, "config", __runInitializers(_init141, 8, this)), __runInitializers(_init141, 11, this);
76545
- __publicField(this, "hmr", __runInitializers(_init141, 12, this)), __runInitializers(_init141, 15, this);
76546
- __publicField(this, "reassembly", __runInitializers(_init141, 16, this)), __runInitializers(_init141, 19, this);
76547
- __publicField(this, "projectConfig", __runInitializers(_init141, 20, this)), __runInitializers(_init141, 23, this);
76548
- __publicField(this, "access", __runInitializers(_init141, 24, this)), __runInitializers(_init141, 27, this);
76549
- __publicField(this, "machines", __runInitializers(_init141, 28, this)), __runInitializers(_init141, 31, this);
76550
- __publicField(this, "db", __runInitializers(_init141, 32, this)), __runInitializers(_init141, 35, this);
76551
- __publicField(this, "routes", __runInitializers(_init141, 36, this)), __runInitializers(_init141, 39, this);
77091
+ __publicField(this, "config", __runInitializers(_init142, 8, this)), __runInitializers(_init142, 11, this);
77092
+ __publicField(this, "hmr", __runInitializers(_init142, 12, this)), __runInitializers(_init142, 15, this);
77093
+ __publicField(this, "reassembly", __runInitializers(_init142, 16, this)), __runInitializers(_init142, 19, this);
77094
+ __publicField(this, "projectConfig", __runInitializers(_init142, 20, this)), __runInitializers(_init142, 23, this);
77095
+ __publicField(this, "access", __runInitializers(_init142, 24, this)), __runInitializers(_init142, 27, this);
77096
+ __publicField(this, "machines", __runInitializers(_init142, 28, this)), __runInitializers(_init142, 31, this);
77097
+ __publicField(this, "db", __runInitializers(_init142, 32, this)), __runInitializers(_init142, 35, this);
77098
+ __publicField(this, "routes", __runInitializers(_init142, 36, this)), __runInitializers(_init142, 39, this);
76552
77099
  }
76553
77100
  setup() {
76554
77101
  const hmr = this.hmr;
@@ -76570,24 +77117,24 @@ var InstalledPluginRoutes = class {
76570
77117
  });
76571
77118
  }
76572
77119
  };
76573
- _init141 = __decoratorStart(null);
76574
- __decorateElement(_init141, 5, "config", _config_dec21, InstalledPluginRoutes);
76575
- __decorateElement(_init141, 5, "hmr", _hmr_dec5, InstalledPluginRoutes);
76576
- __decorateElement(_init141, 5, "reassembly", _reassembly_dec2, InstalledPluginRoutes);
76577
- __decorateElement(_init141, 5, "projectConfig", _projectConfig_dec14, InstalledPluginRoutes);
76578
- __decorateElement(_init141, 5, "access", _access_dec9, InstalledPluginRoutes);
76579
- __decorateElement(_init141, 5, "machines", _machines_dec4, InstalledPluginRoutes);
76580
- __decorateElement(_init141, 5, "db", _db_dec17, InstalledPluginRoutes);
76581
- __decorateElement(_init141, 5, "routes", _routes_dec23, InstalledPluginRoutes);
76582
- InstalledPluginRoutes = __decorateElement(_init141, 0, "InstalledPluginRoutes", _InstalledPluginRoutes_decorators, InstalledPluginRoutes);
76583
- __runInitializers(_init141, 1, InstalledPluginRoutes);
77120
+ _init142 = __decoratorStart(null);
77121
+ __decorateElement(_init142, 5, "config", _config_dec21, InstalledPluginRoutes);
77122
+ __decorateElement(_init142, 5, "hmr", _hmr_dec5, InstalledPluginRoutes);
77123
+ __decorateElement(_init142, 5, "reassembly", _reassembly_dec2, InstalledPluginRoutes);
77124
+ __decorateElement(_init142, 5, "projectConfig", _projectConfig_dec14, InstalledPluginRoutes);
77125
+ __decorateElement(_init142, 5, "access", _access_dec9, InstalledPluginRoutes);
77126
+ __decorateElement(_init142, 5, "machines", _machines_dec4, InstalledPluginRoutes);
77127
+ __decorateElement(_init142, 5, "db", _db_dec17, InstalledPluginRoutes);
77128
+ __decorateElement(_init142, 5, "routes", _routes_dec24, InstalledPluginRoutes);
77129
+ InstalledPluginRoutes = __decorateElement(_init142, 0, "InstalledPluginRoutes", _InstalledPluginRoutes_decorators, InstalledPluginRoutes);
77130
+ __runInitializers(_init142, 1, InstalledPluginRoutes);
76584
77131
 
76585
77132
  // src/http/routes/suggest-id.ts
76586
- import { Hono as Hono47 } from "hono";
76587
- import { Bind as Bind30, Component as Component71, Use as Use73 } from "@adelie/core/kernel";
77133
+ import { Hono as Hono48 } from "hono";
77134
+ import { Bind as Bind31, Component as Component72, Use as Use74 } from "@adelie/core/kernel";
76588
77135
  var KINDS = ["project", "agent", "benchmark", "org", "channel"];
76589
77136
  function suggestIdRoutes(deps) {
76590
- const app = new Hono47();
77137
+ const app = new Hono48();
76591
77138
  app.post("/", async (c) => {
76592
77139
  const projectId = requireValidId(c, "projectId");
76593
77140
  const user = c.var.user;
@@ -76625,8 +77172,8 @@ function suggestIdRoutes(deps) {
76625
77172
  });
76626
77173
  return app;
76627
77174
  }
76628
- var _routes_dec24, _log_dec5, _errors_dec8, _settings_dec10, _orgService_dec3, _benchmarks_dec2, _agents_dec4, _projectConfig_dec15, _projects_dec8, _access_dec10, _SuggestIdRoutes_decorators, _init142;
76629
- _SuggestIdRoutes_decorators = [Component71({
77175
+ var _routes_dec25, _log_dec5, _errors_dec8, _settings_dec11, _orgService_dec3, _benchmarks_dec2, _agents_dec4, _projectConfig_dec15, _projects_dec8, _access_dec10, _SuggestIdRoutes_decorators, _init143;
77176
+ _SuggestIdRoutes_decorators = [Component72({
76630
77177
  contributes: {
76631
77178
  "HttpModule.routes": [
76632
77179
  {
@@ -76637,19 +77184,19 @@ _SuggestIdRoutes_decorators = [Component71({
76637
77184
  }
76638
77185
  ]
76639
77186
  }
76640
- })], _access_dec10 = [Use73()], _projects_dec8 = [Use73()], _projectConfig_dec15 = [Use73()], _agents_dec4 = [Use73()], _benchmarks_dec2 = [Use73()], _orgService_dec3 = [Use73()], _settings_dec10 = [Use73()], _errors_dec8 = [Use73()], _log_dec5 = [Use73()], _routes_dec24 = [Bind30("SuggestIdRoutes.routes")];
77187
+ })], _access_dec10 = [Use74()], _projects_dec8 = [Use74()], _projectConfig_dec15 = [Use74()], _agents_dec4 = [Use74()], _benchmarks_dec2 = [Use74()], _orgService_dec3 = [Use74()], _settings_dec11 = [Use74()], _errors_dec8 = [Use74()], _log_dec5 = [Use74()], _routes_dec25 = [Bind31("SuggestIdRoutes.routes")];
76641
77188
  var SuggestIdRoutes = class {
76642
77189
  constructor() {
76643
- __publicField(this, "access", __runInitializers(_init142, 8, this)), __runInitializers(_init142, 11, this);
76644
- __publicField(this, "projects", __runInitializers(_init142, 12, this)), __runInitializers(_init142, 15, this);
76645
- __publicField(this, "projectConfig", __runInitializers(_init142, 16, this)), __runInitializers(_init142, 19, this);
76646
- __publicField(this, "agents", __runInitializers(_init142, 20, this)), __runInitializers(_init142, 23, this);
76647
- __publicField(this, "benchmarks", __runInitializers(_init142, 24, this)), __runInitializers(_init142, 27, this);
76648
- __publicField(this, "orgService", __runInitializers(_init142, 28, this)), __runInitializers(_init142, 31, this);
76649
- __publicField(this, "settings", __runInitializers(_init142, 32, this)), __runInitializers(_init142, 35, this);
76650
- __publicField(this, "errors", __runInitializers(_init142, 36, this)), __runInitializers(_init142, 39, this);
76651
- __publicField(this, "log", __runInitializers(_init142, 40, this)), __runInitializers(_init142, 43, this);
76652
- __publicField(this, "routes", __runInitializers(_init142, 44, this)), __runInitializers(_init142, 47, this);
77190
+ __publicField(this, "access", __runInitializers(_init143, 8, this)), __runInitializers(_init143, 11, this);
77191
+ __publicField(this, "projects", __runInitializers(_init143, 12, this)), __runInitializers(_init143, 15, this);
77192
+ __publicField(this, "projectConfig", __runInitializers(_init143, 16, this)), __runInitializers(_init143, 19, this);
77193
+ __publicField(this, "agents", __runInitializers(_init143, 20, this)), __runInitializers(_init143, 23, this);
77194
+ __publicField(this, "benchmarks", __runInitializers(_init143, 24, this)), __runInitializers(_init143, 27, this);
77195
+ __publicField(this, "orgService", __runInitializers(_init143, 28, this)), __runInitializers(_init143, 31, this);
77196
+ __publicField(this, "settings", __runInitializers(_init143, 32, this)), __runInitializers(_init143, 35, this);
77197
+ __publicField(this, "errors", __runInitializers(_init143, 36, this)), __runInitializers(_init143, 39, this);
77198
+ __publicField(this, "log", __runInitializers(_init143, 40, this)), __runInitializers(_init143, 43, this);
77199
+ __publicField(this, "routes", __runInitializers(_init143, 44, this)), __runInitializers(_init143, 47, this);
76653
77200
  }
76654
77201
  setup() {
76655
77202
  this.routes = suggestIdRoutes({
@@ -76673,184 +77220,184 @@ var SuggestIdRoutes = class {
76673
77220
  });
76674
77221
  }
76675
77222
  };
76676
- _init142 = __decoratorStart(null);
76677
- __decorateElement(_init142, 5, "access", _access_dec10, SuggestIdRoutes);
76678
- __decorateElement(_init142, 5, "projects", _projects_dec8, SuggestIdRoutes);
76679
- __decorateElement(_init142, 5, "projectConfig", _projectConfig_dec15, SuggestIdRoutes);
76680
- __decorateElement(_init142, 5, "agents", _agents_dec4, SuggestIdRoutes);
76681
- __decorateElement(_init142, 5, "benchmarks", _benchmarks_dec2, SuggestIdRoutes);
76682
- __decorateElement(_init142, 5, "orgService", _orgService_dec3, SuggestIdRoutes);
76683
- __decorateElement(_init142, 5, "settings", _settings_dec10, SuggestIdRoutes);
76684
- __decorateElement(_init142, 5, "errors", _errors_dec8, SuggestIdRoutes);
76685
- __decorateElement(_init142, 5, "log", _log_dec5, SuggestIdRoutes);
76686
- __decorateElement(_init142, 5, "routes", _routes_dec24, SuggestIdRoutes);
76687
- SuggestIdRoutes = __decorateElement(_init142, 0, "SuggestIdRoutes", _SuggestIdRoutes_decorators, SuggestIdRoutes);
76688
- __runInitializers(_init142, 1, SuggestIdRoutes);
77223
+ _init143 = __decoratorStart(null);
77224
+ __decorateElement(_init143, 5, "access", _access_dec10, SuggestIdRoutes);
77225
+ __decorateElement(_init143, 5, "projects", _projects_dec8, SuggestIdRoutes);
77226
+ __decorateElement(_init143, 5, "projectConfig", _projectConfig_dec15, SuggestIdRoutes);
77227
+ __decorateElement(_init143, 5, "agents", _agents_dec4, SuggestIdRoutes);
77228
+ __decorateElement(_init143, 5, "benchmarks", _benchmarks_dec2, SuggestIdRoutes);
77229
+ __decorateElement(_init143, 5, "orgService", _orgService_dec3, SuggestIdRoutes);
77230
+ __decorateElement(_init143, 5, "settings", _settings_dec11, SuggestIdRoutes);
77231
+ __decorateElement(_init143, 5, "errors", _errors_dec8, SuggestIdRoutes);
77232
+ __decorateElement(_init143, 5, "log", _log_dec5, SuggestIdRoutes);
77233
+ __decorateElement(_init143, 5, "routes", _routes_dec25, SuggestIdRoutes);
77234
+ SuggestIdRoutes = __decorateElement(_init143, 0, "SuggestIdRoutes", _SuggestIdRoutes_decorators, SuggestIdRoutes);
77235
+ __runInitializers(_init143, 1, SuggestIdRoutes);
76689
77236
 
76690
77237
  // src/mechanisms/identity.ts
76691
77238
  import { Interface as Interface28 } from "@adelie/core/kernel";
76692
- var _Users_decorators, _init143;
77239
+ var _Users_decorators, _init144;
76693
77240
  _Users_decorators = [Interface28()];
76694
77241
  var Users = class {
76695
77242
  };
76696
- _init143 = __decoratorStart(null);
76697
- Users = __decorateElement(_init143, 0, "Users", _Users_decorators, Users);
76698
- __runInitializers(_init143, 1, Users);
76699
- var _AuthSessions_decorators, _init144;
77243
+ _init144 = __decoratorStart(null);
77244
+ Users = __decorateElement(_init144, 0, "Users", _Users_decorators, Users);
77245
+ __runInitializers(_init144, 1, Users);
77246
+ var _AuthSessions_decorators, _init145;
76700
77247
  _AuthSessions_decorators = [Interface28()];
76701
77248
  var AuthSessions = class {
76702
77249
  };
76703
- _init144 = __decoratorStart(null);
76704
- AuthSessions = __decorateElement(_init144, 0, "AuthSessions", _AuthSessions_decorators, AuthSessions);
76705
- __runInitializers(_init144, 1, AuthSessions);
76706
- var _Auth_decorators, _init145;
77250
+ _init145 = __decoratorStart(null);
77251
+ AuthSessions = __decorateElement(_init145, 0, "AuthSessions", _AuthSessions_decorators, AuthSessions);
77252
+ __runInitializers(_init145, 1, AuthSessions);
77253
+ var _Auth_decorators, _init146;
76707
77254
  _Auth_decorators = [Interface28()];
76708
77255
  var Auth = class {
76709
77256
  };
76710
- _init145 = __decoratorStart(null);
76711
- Auth = __decorateElement(_init145, 0, "Auth", _Auth_decorators, Auth);
76712
- __runInitializers(_init145, 1, Auth);
76713
- var _Admin_decorators, _init146;
77257
+ _init146 = __decoratorStart(null);
77258
+ Auth = __decorateElement(_init146, 0, "Auth", _Auth_decorators, Auth);
77259
+ __runInitializers(_init146, 1, Auth);
77260
+ var _Admin_decorators, _init147;
76714
77261
  _Admin_decorators = [Interface28()];
76715
77262
  var Admin = class {
76716
77263
  };
76717
- _init146 = __decoratorStart(null);
76718
- Admin = __decorateElement(_init146, 0, "Admin", _Admin_decorators, Admin);
76719
- __runInitializers(_init146, 1, Admin);
77264
+ _init147 = __decoratorStart(null);
77265
+ Admin = __decorateElement(_init147, 0, "Admin", _Admin_decorators, Admin);
77266
+ __runInitializers(_init147, 1, Admin);
76720
77267
 
76721
77268
  // src/mechanisms/projects.ts
76722
77269
  import { Interface as Interface29 } from "@adelie/core/kernel";
76723
- var _Projects_decorators, _init147;
77270
+ var _Projects_decorators, _init148;
76724
77271
  _Projects_decorators = [Interface29()];
76725
77272
  var Projects = class {
76726
77273
  };
76727
- _init147 = __decoratorStart(null);
76728
- Projects = __decorateElement(_init147, 0, "Projects", _Projects_decorators, Projects);
76729
- __runInitializers(_init147, 1, Projects);
76730
- var _Members_decorators, _init148;
77274
+ _init148 = __decoratorStart(null);
77275
+ Projects = __decorateElement(_init148, 0, "Projects", _Projects_decorators, Projects);
77276
+ __runInitializers(_init148, 1, Projects);
77277
+ var _Members_decorators, _init149;
76731
77278
  _Members_decorators = [Interface29()];
76732
77279
  var Members = class {
76733
77280
  };
76734
- _init148 = __decoratorStart(null);
76735
- Members = __decorateElement(_init148, 0, "Members", _Members_decorators, Members);
76736
- __runInitializers(_init148, 1, Members);
76737
- var _AgentIndex_decorators, _init149;
77281
+ _init149 = __decoratorStart(null);
77282
+ Members = __decorateElement(_init149, 0, "Members", _Members_decorators, Members);
77283
+ __runInitializers(_init149, 1, Members);
77284
+ var _AgentIndex_decorators, _init150;
76738
77285
  _AgentIndex_decorators = [Interface29()];
76739
77286
  var AgentIndex = class {
76740
77287
  };
76741
- _init149 = __decoratorStart(null);
76742
- AgentIndex = __decorateElement(_init149, 0, "AgentIndex", _AgentIndex_decorators, AgentIndex);
76743
- __runInitializers(_init149, 1, AgentIndex);
76744
- var _Access_decorators, _init150;
77288
+ _init150 = __decoratorStart(null);
77289
+ AgentIndex = __decorateElement(_init150, 0, "AgentIndex", _AgentIndex_decorators, AgentIndex);
77290
+ __runInitializers(_init150, 1, AgentIndex);
77291
+ var _Access_decorators, _init151;
76745
77292
  _Access_decorators = [Interface29()];
76746
77293
  var Access = class {
76747
77294
  };
76748
- _init150 = __decoratorStart(null);
76749
- Access = __decorateElement(_init150, 0, "Access", _Access_decorators, Access);
76750
- __runInitializers(_init150, 1, Access);
76751
- var _ProjectLifecycle_decorators, _init151;
77295
+ _init151 = __decoratorStart(null);
77296
+ Access = __decorateElement(_init151, 0, "Access", _Access_decorators, Access);
77297
+ __runInitializers(_init151, 1, Access);
77298
+ var _ProjectLifecycle_decorators, _init152;
76752
77299
  _ProjectLifecycle_decorators = [Interface29()];
76753
77300
  var ProjectLifecycle = class {
76754
77301
  };
76755
- _init151 = __decoratorStart(null);
76756
- ProjectLifecycle = __decorateElement(_init151, 0, "ProjectLifecycle", _ProjectLifecycle_decorators, ProjectLifecycle);
76757
- __runInitializers(_init151, 1, ProjectLifecycle);
76758
- var _ProjectConfigStore_decorators, _init152;
77302
+ _init152 = __decoratorStart(null);
77303
+ ProjectLifecycle = __decorateElement(_init152, 0, "ProjectLifecycle", _ProjectLifecycle_decorators, ProjectLifecycle);
77304
+ __runInitializers(_init152, 1, ProjectLifecycle);
77305
+ var _ProjectConfigStore_decorators, _init153;
76759
77306
  _ProjectConfigStore_decorators = [Interface29()];
76760
77307
  var ProjectConfigStore = class {
76761
77308
  };
76762
- _init152 = __decoratorStart(null);
76763
- ProjectConfigStore = __decorateElement(_init152, 0, "ProjectConfigStore", _ProjectConfigStore_decorators, ProjectConfigStore);
76764
- __runInitializers(_init152, 1, ProjectConfigStore);
76765
- var _ModelPromotions_decorators, _init153;
77309
+ _init153 = __decoratorStart(null);
77310
+ ProjectConfigStore = __decorateElement(_init153, 0, "ProjectConfigStore", _ProjectConfigStore_decorators, ProjectConfigStore);
77311
+ __runInitializers(_init153, 1, ProjectConfigStore);
77312
+ var _ModelPromotions_decorators, _init154;
76766
77313
  _ModelPromotions_decorators = [Interface29()];
76767
77314
  var ModelPromotions = class {
76768
77315
  };
76769
- _init153 = __decoratorStart(null);
76770
- ModelPromotions = __decorateElement(_init153, 0, "ModelPromotions", _ModelPromotions_decorators, ModelPromotions);
76771
- __runInitializers(_init153, 1, ModelPromotions);
76772
- var _ModelProviderAuthTokens_decorators, _init154;
77316
+ _init154 = __decoratorStart(null);
77317
+ ModelPromotions = __decorateElement(_init154, 0, "ModelPromotions", _ModelPromotions_decorators, ModelPromotions);
77318
+ __runInitializers(_init154, 1, ModelPromotions);
77319
+ var _ModelProviderAuthTokens_decorators, _init155;
76773
77320
  _ModelProviderAuthTokens_decorators = [Interface29()];
76774
77321
  var ModelProviderAuthTokens = class {
76775
77322
  };
76776
- _init154 = __decoratorStart(null);
76777
- ModelProviderAuthTokens = __decorateElement(_init154, 0, "ModelProviderAuthTokens", _ModelProviderAuthTokens_decorators, ModelProviderAuthTokens);
76778
- __runInitializers(_init154, 1, ModelProviderAuthTokens);
76779
- var _ModelOAuth_decorators, _init155;
77323
+ _init155 = __decoratorStart(null);
77324
+ ModelProviderAuthTokens = __decorateElement(_init155, 0, "ModelProviderAuthTokens", _ModelProviderAuthTokens_decorators, ModelProviderAuthTokens);
77325
+ __runInitializers(_init155, 1, ModelProviderAuthTokens);
77326
+ var _ModelOAuth_decorators, _init156;
76780
77327
  _ModelOAuth_decorators = [Interface29()];
76781
77328
  var ModelOAuth = class {
76782
77329
  };
76783
- _init155 = __decoratorStart(null);
76784
- ModelOAuth = __decorateElement(_init155, 0, "ModelOAuth", _ModelOAuth_decorators, ModelOAuth);
76785
- __runInitializers(_init155, 1, ModelOAuth);
76786
- var _ProjectEvents_decorators, _init156;
77330
+ _init156 = __decoratorStart(null);
77331
+ ModelOAuth = __decorateElement(_init156, 0, "ModelOAuth", _ModelOAuth_decorators, ModelOAuth);
77332
+ __runInitializers(_init156, 1, ModelOAuth);
77333
+ var _ProjectEvents_decorators, _init157;
76787
77334
  _ProjectEvents_decorators = [Interface29()];
76788
77335
  var ProjectEvents = class {
76789
77336
  };
76790
- _init156 = __decoratorStart(null);
76791
- ProjectEvents = __decorateElement(_init156, 0, "ProjectEvents", _ProjectEvents_decorators, ProjectEvents);
76792
- __runInitializers(_init156, 1, ProjectEvents);
77337
+ _init157 = __decoratorStart(null);
77338
+ ProjectEvents = __decorateElement(_init157, 0, "ProjectEvents", _ProjectEvents_decorators, ProjectEvents);
77339
+ __runInitializers(_init157, 1, ProjectEvents);
76793
77340
 
76794
77341
  // src/mechanisms/sessions.ts
76795
77342
  import { Interface as Interface30 } from "@adelie/core/kernel";
76796
- var _SessionIndex_decorators, _init157;
77343
+ var _SessionIndex_decorators, _init158;
76797
77344
  _SessionIndex_decorators = [Interface30()];
76798
77345
  var SessionIndex = class {
76799
77346
  };
76800
- _init157 = __decoratorStart(null);
76801
- SessionIndex = __decorateElement(_init157, 0, "SessionIndex", _SessionIndex_decorators, SessionIndex);
76802
- __runInitializers(_init157, 1, SessionIndex);
76803
- var _SessionOrigins_decorators, _init158;
77347
+ _init158 = __decoratorStart(null);
77348
+ SessionIndex = __decorateElement(_init158, 0, "SessionIndex", _SessionIndex_decorators, SessionIndex);
77349
+ __runInitializers(_init158, 1, SessionIndex);
77350
+ var _SessionOrigins_decorators, _init159;
76804
77351
  _SessionOrigins_decorators = [Interface30()];
76805
77352
  var SessionOrigins = class {
76806
77353
  };
76807
- _init158 = __decoratorStart(null);
76808
- SessionOrigins = __decorateElement(_init158, 0, "SessionOrigins", _SessionOrigins_decorators, SessionOrigins);
76809
- __runInitializers(_init158, 1, SessionOrigins);
76810
- var _Schedules_decorators, _init159;
77354
+ _init159 = __decoratorStart(null);
77355
+ SessionOrigins = __decorateElement(_init159, 0, "SessionOrigins", _SessionOrigins_decorators, SessionOrigins);
77356
+ __runInitializers(_init159, 1, SessionOrigins);
77357
+ var _Schedules_decorators, _init160;
76811
77358
  _Schedules_decorators = [Interface30()];
76812
77359
  var Schedules = class {
76813
77360
  };
76814
- _init159 = __decoratorStart(null);
76815
- Schedules = __decorateElement(_init159, 0, "Schedules", _Schedules_decorators, Schedules);
76816
- __runInitializers(_init159, 1, Schedules);
76817
- var _Scheduling_decorators, _init160;
77361
+ _init160 = __decoratorStart(null);
77362
+ Schedules = __decorateElement(_init160, 0, "Schedules", _Schedules_decorators, Schedules);
77363
+ __runInitializers(_init160, 1, Schedules);
77364
+ var _Scheduling_decorators, _init161;
76818
77365
  _Scheduling_decorators = [Interface30()];
76819
77366
  var Scheduling = class {
76820
77367
  };
76821
- _init160 = __decoratorStart(null);
76822
- Scheduling = __decorateElement(_init160, 0, "Scheduling", _Scheduling_decorators, Scheduling);
76823
- __runInitializers(_init160, 1, Scheduling);
77368
+ _init161 = __decoratorStart(null);
77369
+ Scheduling = __decorateElement(_init161, 0, "Scheduling", _Scheduling_decorators, Scheduling);
77370
+ __runInitializers(_init161, 1, Scheduling);
76824
77371
 
76825
77372
  // src/mechanisms/workflows.ts
76826
77373
  import { Interface as Interface31 } from "@adelie/core/kernel";
76827
- var _WorkflowMain_decorators, _init161;
77374
+ var _WorkflowMain_decorators, _init162;
76828
77375
  _WorkflowMain_decorators = [Interface31()];
76829
77376
  var WorkflowMain = class {
76830
77377
  };
76831
- _init161 = __decoratorStart(null);
76832
- WorkflowMain = __decorateElement(_init161, 0, "WorkflowMain", _WorkflowMain_decorators, WorkflowMain);
76833
- __runInitializers(_init161, 1, WorkflowMain);
76834
- var _WorkflowHost_decorators, _init162;
77378
+ _init162 = __decoratorStart(null);
77379
+ WorkflowMain = __decorateElement(_init162, 0, "WorkflowMain", _WorkflowMain_decorators, WorkflowMain);
77380
+ __runInitializers(_init162, 1, WorkflowMain);
77381
+ var _WorkflowHost_decorators, _init163;
76835
77382
  _WorkflowHost_decorators = [Interface31()];
76836
77383
  var WorkflowHost = class {
76837
77384
  };
76838
- _init162 = __decoratorStart(null);
76839
- WorkflowHost = __decorateElement(_init162, 0, "WorkflowHost", _WorkflowHost_decorators, WorkflowHost);
76840
- __runInitializers(_init162, 1, WorkflowHost);
76841
- var _Workflows_decorators, _init163;
77385
+ _init163 = __decoratorStart(null);
77386
+ WorkflowHost = __decorateElement(_init163, 0, "WorkflowHost", _WorkflowHost_decorators, WorkflowHost);
77387
+ __runInitializers(_init163, 1, WorkflowHost);
77388
+ var _Workflows_decorators, _init164;
76842
77389
  _Workflows_decorators = [Interface31()];
76843
77390
  var Workflows = class {
76844
77391
  };
76845
- _init163 = __decoratorStart(null);
76846
- Workflows = __decorateElement(_init163, 0, "Workflows", _Workflows_decorators, Workflows);
76847
- __runInitializers(_init163, 1, Workflows);
77392
+ _init164 = __decoratorStart(null);
77393
+ Workflows = __decorateElement(_init164, 0, "Workflows", _Workflows_decorators, Workflows);
77394
+ __runInitializers(_init164, 1, Workflows);
76848
77395
 
76849
77396
  // src/workflows/service.ts
76850
77397
  import fs47 from "fs";
76851
77398
  import path53 from "path";
76852
77399
  import { pathToFileURL as pathToFileURL4 } from "url";
76853
- import { bootModules, Component as Component72, parseManifest as parseManifest2, Use as Use74 } from "@adelie/core/kernel";
77400
+ import { bootModules, Component as Component73, parseManifest as parseManifest2, Use as Use75 } from "@adelie/core/kernel";
76854
77401
  import { userText as userText7 } from "@adelie/core";
76855
77402
 
76856
77403
  // src/workflows/compile.ts
@@ -77377,21 +77924,21 @@ async function loadDefs(manifests, entry) {
77377
77924
  }
77378
77925
  return root;
77379
77926
  }
77380
- var _sessions_dec6, _runner_dec4, _sessionIndex_dec, _agents_dec5, _hmr_dec6, _projects_dec9, _members_dec5, _channels_dec11, _log_dec6, _clock_dec13, _paths_dec17, _WorkflowService_decorators, _init164;
77381
- _WorkflowService_decorators = [Component72()], _paths_dec17 = [Use74()], _clock_dec13 = [Use74()], _log_dec6 = [Use74()], _channels_dec11 = [Use74()], _members_dec5 = [Use74()], _projects_dec9 = [Use74()], _hmr_dec6 = [Use74()], _agents_dec5 = [Use74()], _sessionIndex_dec = [Use74()], _runner_dec4 = [Use74()], _sessions_dec6 = [Use74()];
77927
+ var _sessions_dec6, _runner_dec4, _sessionIndex_dec, _agents_dec5, _hmr_dec6, _projects_dec9, _members_dec5, _channels_dec11, _log_dec6, _clock_dec13, _paths_dec17, _WorkflowService_decorators, _init165;
77928
+ _WorkflowService_decorators = [Component73()], _paths_dec17 = [Use75()], _clock_dec13 = [Use75()], _log_dec6 = [Use75()], _channels_dec11 = [Use75()], _members_dec5 = [Use75()], _projects_dec9 = [Use75()], _hmr_dec6 = [Use75()], _agents_dec5 = [Use75()], _sessionIndex_dec = [Use75()], _runner_dec4 = [Use75()], _sessions_dec6 = [Use75()];
77382
77929
  var WorkflowService = class {
77383
77930
  constructor() {
77384
- __publicField(this, "paths", __runInitializers(_init164, 8, this)), __runInitializers(_init164, 11, this);
77385
- __publicField(this, "clock", __runInitializers(_init164, 12, this)), __runInitializers(_init164, 15, this);
77386
- __publicField(this, "log", __runInitializers(_init164, 16, this)), __runInitializers(_init164, 19, this);
77387
- __publicField(this, "channels", __runInitializers(_init164, 20, this)), __runInitializers(_init164, 23, this);
77388
- __publicField(this, "members", __runInitializers(_init164, 24, this)), __runInitializers(_init164, 27, this);
77389
- __publicField(this, "projects", __runInitializers(_init164, 28, this)), __runInitializers(_init164, 31, this);
77390
- __publicField(this, "hmr", __runInitializers(_init164, 32, this)), __runInitializers(_init164, 35, this);
77391
- __publicField(this, "agents", __runInitializers(_init164, 36, this)), __runInitializers(_init164, 39, this);
77392
- __publicField(this, "sessionIndex", __runInitializers(_init164, 40, this)), __runInitializers(_init164, 43, this);
77393
- __publicField(this, "runner", __runInitializers(_init164, 44, this)), __runInitializers(_init164, 47, this);
77394
- __publicField(this, "sessions", __runInitializers(_init164, 48, this)), __runInitializers(_init164, 51, this);
77931
+ __publicField(this, "paths", __runInitializers(_init165, 8, this)), __runInitializers(_init165, 11, this);
77932
+ __publicField(this, "clock", __runInitializers(_init165, 12, this)), __runInitializers(_init165, 15, this);
77933
+ __publicField(this, "log", __runInitializers(_init165, 16, this)), __runInitializers(_init165, 19, this);
77934
+ __publicField(this, "channels", __runInitializers(_init165, 20, this)), __runInitializers(_init165, 23, this);
77935
+ __publicField(this, "members", __runInitializers(_init165, 24, this)), __runInitializers(_init165, 27, this);
77936
+ __publicField(this, "projects", __runInitializers(_init165, 28, this)), __runInitializers(_init165, 31, this);
77937
+ __publicField(this, "hmr", __runInitializers(_init165, 32, this)), __runInitializers(_init165, 35, this);
77938
+ __publicField(this, "agents", __runInitializers(_init165, 36, this)), __runInitializers(_init165, 39, this);
77939
+ __publicField(this, "sessionIndex", __runInitializers(_init165, 40, this)), __runInitializers(_init165, 43, this);
77940
+ __publicField(this, "runner", __runInitializers(_init165, 44, this)), __runInitializers(_init165, 47, this);
77941
+ __publicField(this, "sessions", __runInitializers(_init165, 48, this)), __runInitializers(_init165, 51, this);
77395
77942
  __publicField(this, "loaded", /* @__PURE__ */ new Map());
77396
77943
  __publicField(this, "watchers", /* @__PURE__ */ new Map());
77397
77944
  __publicField(this, "pending", /* @__PURE__ */ new Map());
@@ -77804,20 +78351,20 @@ var WorkflowService = class {
77804
78351
  );
77805
78352
  }
77806
78353
  };
77807
- _init164 = __decoratorStart(null);
77808
- __decorateElement(_init164, 5, "paths", _paths_dec17, WorkflowService);
77809
- __decorateElement(_init164, 5, "clock", _clock_dec13, WorkflowService);
77810
- __decorateElement(_init164, 5, "log", _log_dec6, WorkflowService);
77811
- __decorateElement(_init164, 5, "channels", _channels_dec11, WorkflowService);
77812
- __decorateElement(_init164, 5, "members", _members_dec5, WorkflowService);
77813
- __decorateElement(_init164, 5, "projects", _projects_dec9, WorkflowService);
77814
- __decorateElement(_init164, 5, "hmr", _hmr_dec6, WorkflowService);
77815
- __decorateElement(_init164, 5, "agents", _agents_dec5, WorkflowService);
77816
- __decorateElement(_init164, 5, "sessionIndex", _sessionIndex_dec, WorkflowService);
77817
- __decorateElement(_init164, 5, "runner", _runner_dec4, WorkflowService);
77818
- __decorateElement(_init164, 5, "sessions", _sessions_dec6, WorkflowService);
77819
- WorkflowService = __decorateElement(_init164, 0, "WorkflowService", _WorkflowService_decorators, WorkflowService);
77820
- __runInitializers(_init164, 1, WorkflowService);
78354
+ _init165 = __decoratorStart(null);
78355
+ __decorateElement(_init165, 5, "paths", _paths_dec17, WorkflowService);
78356
+ __decorateElement(_init165, 5, "clock", _clock_dec13, WorkflowService);
78357
+ __decorateElement(_init165, 5, "log", _log_dec6, WorkflowService);
78358
+ __decorateElement(_init165, 5, "channels", _channels_dec11, WorkflowService);
78359
+ __decorateElement(_init165, 5, "members", _members_dec5, WorkflowService);
78360
+ __decorateElement(_init165, 5, "projects", _projects_dec9, WorkflowService);
78361
+ __decorateElement(_init165, 5, "hmr", _hmr_dec6, WorkflowService);
78362
+ __decorateElement(_init165, 5, "agents", _agents_dec5, WorkflowService);
78363
+ __decorateElement(_init165, 5, "sessionIndex", _sessionIndex_dec, WorkflowService);
78364
+ __decorateElement(_init165, 5, "runner", _runner_dec4, WorkflowService);
78365
+ __decorateElement(_init165, 5, "sessions", _sessions_dec6, WorkflowService);
78366
+ WorkflowService = __decorateElement(_init165, 0, "WorkflowService", _WorkflowService_decorators, WorkflowService);
78367
+ __runInitializers(_init165, 1, WorkflowService);
77821
78368
  var WorkflowNotFound = class extends Error {
77822
78369
  };
77823
78370
  function uiBase(projectId, agentId, workflowId) {
@@ -77844,8 +78391,8 @@ function hostDecl() {
77844
78391
  // src/workflows/routes.ts
77845
78392
  import fs48 from "fs/promises";
77846
78393
  import path54 from "path";
77847
- import { Hono as Hono48 } from "hono";
77848
- import { Bind as Bind31, Component as Component73, Use as Use75 } from "@adelie/core/kernel";
78394
+ import { Hono as Hono49 } from "hono";
78395
+ import { Bind as Bind32, Component as Component74, Use as Use76 } from "@adelie/core/kernel";
77849
78396
  var MIME = {
77850
78397
  ".html": "text/html; charset=utf-8",
77851
78398
  ".htm": "text/html; charset=utf-8",
@@ -77973,7 +78520,7 @@ function streamOf(chunks) {
77973
78520
  });
77974
78521
  }
77975
78522
  function workflowRoutes(deps) {
77976
- const app = new Hono48();
78523
+ const app = new Hono49();
77977
78524
  const scope = (c) => {
77978
78525
  const projectId = requireValidId(c, "projectId");
77979
78526
  const agentId = requireValidId(c, "agentId");
@@ -78047,8 +78594,8 @@ function workflowRoutes(deps) {
78047
78594
  });
78048
78595
  return app;
78049
78596
  }
78050
- var _routes_dec25, _workflows_dec, _access_dec11, _WorkflowRoutes_decorators, _init165;
78051
- _WorkflowRoutes_decorators = [Component73({
78597
+ var _routes_dec26, _workflows_dec, _access_dec11, _WorkflowRoutes_decorators, _init166;
78598
+ _WorkflowRoutes_decorators = [Component74({
78052
78599
  contributes: {
78053
78600
  "HttpModule.routes": [
78054
78601
  {
@@ -78059,177 +78606,177 @@ _WorkflowRoutes_decorators = [Component73({
78059
78606
  }
78060
78607
  ]
78061
78608
  }
78062
- })], _access_dec11 = [Use75()], _workflows_dec = [Use75()], _routes_dec25 = [Bind31("WorkflowsModule.routes")];
78609
+ })], _access_dec11 = [Use76()], _workflows_dec = [Use76()], _routes_dec26 = [Bind32("WorkflowsModule.routes")];
78063
78610
  var WorkflowRoutes = class {
78064
78611
  constructor() {
78065
- __publicField(this, "access", __runInitializers(_init165, 8, this)), __runInitializers(_init165, 11, this);
78066
- __publicField(this, "workflows", __runInitializers(_init165, 12, this)), __runInitializers(_init165, 15, this);
78067
- __publicField(this, "routes", __runInitializers(_init165, 16, this)), __runInitializers(_init165, 19, this);
78612
+ __publicField(this, "access", __runInitializers(_init166, 8, this)), __runInitializers(_init166, 11, this);
78613
+ __publicField(this, "workflows", __runInitializers(_init166, 12, this)), __runInitializers(_init166, 15, this);
78614
+ __publicField(this, "routes", __runInitializers(_init166, 16, this)), __runInitializers(_init166, 19, this);
78068
78615
  }
78069
78616
  setup() {
78070
78617
  this.routes = workflowRoutes({ access: this.access, workflows: this.workflows });
78071
78618
  }
78072
78619
  };
78073
- _init165 = __decoratorStart(null);
78074
- __decorateElement(_init165, 5, "access", _access_dec11, WorkflowRoutes);
78075
- __decorateElement(_init165, 5, "workflows", _workflows_dec, WorkflowRoutes);
78076
- __decorateElement(_init165, 5, "routes", _routes_dec25, WorkflowRoutes);
78077
- WorkflowRoutes = __decorateElement(_init165, 0, "WorkflowRoutes", _WorkflowRoutes_decorators, WorkflowRoutes);
78078
- __runInitializers(_init165, 1, WorkflowRoutes);
78620
+ _init166 = __decoratorStart(null);
78621
+ __decorateElement(_init166, 5, "access", _access_dec11, WorkflowRoutes);
78622
+ __decorateElement(_init166, 5, "workflows", _workflows_dec, WorkflowRoutes);
78623
+ __decorateElement(_init166, 5, "routes", _routes_dec26, WorkflowRoutes);
78624
+ WorkflowRoutes = __decorateElement(_init166, 0, "WorkflowRoutes", _WorkflowRoutes_decorators, WorkflowRoutes);
78625
+ __runInitializers(_init166, 1, WorkflowRoutes);
78079
78626
 
78080
78627
  // src/mechanisms/observability.ts
78081
78628
  import { Interface as Interface32 } from "@adelie/core/kernel";
78082
- var _ErrorLog_decorators, _init166;
78629
+ var _ErrorLog_decorators, _init167;
78083
78630
  _ErrorLog_decorators = [Interface32()];
78084
78631
  var ErrorLog = class {
78085
78632
  };
78086
- _init166 = __decoratorStart(null);
78087
- ErrorLog = __decorateElement(_init166, 0, "ErrorLog", _ErrorLog_decorators, ErrorLog);
78088
- __runInitializers(_init166, 1, ErrorLog);
78089
- var _Errors_decorators, _init167;
78633
+ _init167 = __decoratorStart(null);
78634
+ ErrorLog = __decorateElement(_init167, 0, "ErrorLog", _ErrorLog_decorators, ErrorLog);
78635
+ __runInitializers(_init167, 1, ErrorLog);
78636
+ var _Errors_decorators, _init168;
78090
78637
  _Errors_decorators = [Interface32()];
78091
78638
  var Errors = class {
78092
78639
  };
78093
- _init167 = __decoratorStart(null);
78094
- Errors = __decorateElement(_init167, 0, "Errors", _Errors_decorators, Errors);
78095
- __runInitializers(_init167, 1, Errors);
78096
- var _UsageStore_decorators, _init168;
78640
+ _init168 = __decoratorStart(null);
78641
+ Errors = __decorateElement(_init168, 0, "Errors", _Errors_decorators, Errors);
78642
+ __runInitializers(_init168, 1, Errors);
78643
+ var _UsageStore_decorators, _init169;
78097
78644
  _UsageStore_decorators = [Interface32()];
78098
78645
  var UsageStore = class {
78099
78646
  };
78100
- _init168 = __decoratorStart(null);
78101
- UsageStore = __decorateElement(_init168, 0, "UsageStore", _UsageStore_decorators, UsageStore);
78102
- __runInitializers(_init168, 1, UsageStore);
78103
- var _UsageRecording_decorators, _init169;
78647
+ _init169 = __decoratorStart(null);
78648
+ UsageStore = __decorateElement(_init169, 0, "UsageStore", _UsageStore_decorators, UsageStore);
78649
+ __runInitializers(_init169, 1, UsageStore);
78650
+ var _UsageRecording_decorators, _init170;
78104
78651
  _UsageRecording_decorators = [Interface32()];
78105
78652
  var UsageRecording = class {
78106
78653
  };
78107
- _init169 = __decoratorStart(null);
78108
- UsageRecording = __decorateElement(_init169, 0, "UsageRecording", _UsageRecording_decorators, UsageRecording);
78109
- __runInitializers(_init169, 1, UsageRecording);
78110
- var _UsageQueries_decorators, _init170;
78654
+ _init170 = __decoratorStart(null);
78655
+ UsageRecording = __decorateElement(_init170, 0, "UsageRecording", _UsageRecording_decorators, UsageRecording);
78656
+ __runInitializers(_init170, 1, UsageRecording);
78657
+ var _UsageQueries_decorators, _init171;
78111
78658
  _UsageQueries_decorators = [Interface32()];
78112
78659
  var UsageQueries = class {
78113
78660
  };
78114
- _init170 = __decoratorStart(null);
78115
- UsageQueries = __decorateElement(_init170, 0, "UsageQueries", _UsageQueries_decorators, UsageQueries);
78116
- __runInitializers(_init170, 1, UsageQueries);
78661
+ _init171 = __decoratorStart(null);
78662
+ UsageQueries = __decorateElement(_init171, 0, "UsageQueries", _UsageQueries_decorators, UsageQueries);
78663
+ __runInitializers(_init171, 1, UsageQueries);
78117
78664
 
78118
78665
  // src/mechanisms/traces.ts
78119
78666
  import { Interface as Interface33 } from "@adelie/core/kernel";
78120
- var _TraceIndexStore_decorators, _init171;
78667
+ var _TraceIndexStore_decorators, _init172;
78121
78668
  _TraceIndexStore_decorators = [Interface33()];
78122
78669
  var TraceIndexStore = class {
78123
78670
  };
78124
- _init171 = __decoratorStart(null);
78125
- TraceIndexStore = __decorateElement(_init171, 0, "TraceIndexStore", _TraceIndexStore_decorators, TraceIndexStore);
78126
- __runInitializers(_init171, 1, TraceIndexStore);
78127
- var _TraceIndex_decorators, _init172;
78671
+ _init172 = __decoratorStart(null);
78672
+ TraceIndexStore = __decorateElement(_init172, 0, "TraceIndexStore", _TraceIndexStore_decorators, TraceIndexStore);
78673
+ __runInitializers(_init172, 1, TraceIndexStore);
78674
+ var _TraceIndex_decorators, _init173;
78128
78675
  _TraceIndex_decorators = [Interface33()];
78129
78676
  var TraceIndex = class {
78130
78677
  };
78131
- _init172 = __decoratorStart(null);
78132
- TraceIndex = __decorateElement(_init172, 0, "TraceIndex", _TraceIndex_decorators, TraceIndex);
78133
- __runInitializers(_init172, 1, TraceIndex);
78134
- var _Traces_decorators, _init173;
78678
+ _init173 = __decoratorStart(null);
78679
+ TraceIndex = __decorateElement(_init173, 0, "TraceIndex", _TraceIndex_decorators, TraceIndex);
78680
+ __runInitializers(_init173, 1, TraceIndex);
78681
+ var _Traces_decorators, _init174;
78135
78682
  _Traces_decorators = [Interface33()];
78136
78683
  var Traces = class {
78137
78684
  };
78138
- _init173 = __decoratorStart(null);
78139
- Traces = __decorateElement(_init173, 0, "Traces", _Traces_decorators, Traces);
78140
- __runInitializers(_init173, 1, Traces);
78685
+ _init174 = __decoratorStart(null);
78686
+ Traces = __decorateElement(_init174, 0, "Traces", _Traces_decorators, Traces);
78687
+ __runInitializers(_init174, 1, Traces);
78141
78688
 
78142
78689
  // src/mechanisms/agents.ts
78143
78690
  import { Interface as Interface34 } from "@adelie/core/kernel";
78144
- var _AgentConfig_decorators, _init174;
78691
+ var _AgentConfig_decorators, _init175;
78145
78692
  _AgentConfig_decorators = [Interface34()];
78146
78693
  var AgentConfig = class {
78147
78694
  };
78148
- _init174 = __decoratorStart(null);
78149
- AgentConfig = __decorateElement(_init174, 0, "AgentConfig", _AgentConfig_decorators, AgentConfig);
78150
- __runInitializers(_init174, 1, AgentConfig);
78151
- var _Snapshots_decorators, _init175;
78695
+ _init175 = __decoratorStart(null);
78696
+ AgentConfig = __decorateElement(_init175, 0, "AgentConfig", _AgentConfig_decorators, AgentConfig);
78697
+ __runInitializers(_init175, 1, AgentConfig);
78698
+ var _Snapshots_decorators, _init176;
78152
78699
  _Snapshots_decorators = [Interface34()];
78153
78700
  var Snapshots = class {
78154
78701
  };
78155
- _init175 = __decoratorStart(null);
78156
- Snapshots = __decorateElement(_init175, 0, "Snapshots", _Snapshots_decorators, Snapshots);
78157
- __runInitializers(_init175, 1, Snapshots);
78158
- var _Memory_decorators, _init176;
78702
+ _init176 = __decoratorStart(null);
78703
+ Snapshots = __decorateElement(_init176, 0, "Snapshots", _Snapshots_decorators, Snapshots);
78704
+ __runInitializers(_init176, 1, Snapshots);
78705
+ var _Memory_decorators, _init177;
78159
78706
  _Memory_decorators = [Interface34()];
78160
78707
  var Memory = class {
78161
78708
  };
78162
- _init176 = __decoratorStart(null);
78163
- Memory = __decorateElement(_init176, 0, "Memory", _Memory_decorators, Memory);
78164
- __runInitializers(_init176, 1, Memory);
78165
- var _Benchmarks_decorators, _init177;
78709
+ _init177 = __decoratorStart(null);
78710
+ Memory = __decorateElement(_init177, 0, "Memory", _Memory_decorators, Memory);
78711
+ __runInitializers(_init177, 1, Memory);
78712
+ var _Benchmarks_decorators, _init178;
78166
78713
  _Benchmarks_decorators = [Interface34()];
78167
78714
  var Benchmarks = class {
78168
78715
  };
78169
- _init177 = __decoratorStart(null);
78170
- Benchmarks = __decorateElement(_init177, 0, "Benchmarks", _Benchmarks_decorators, Benchmarks);
78171
- __runInitializers(_init177, 1, Benchmarks);
78172
- var _AgentLifecycle_decorators, _init178;
78716
+ _init178 = __decoratorStart(null);
78717
+ Benchmarks = __decorateElement(_init178, 0, "Benchmarks", _Benchmarks_decorators, Benchmarks);
78718
+ __runInitializers(_init178, 1, Benchmarks);
78719
+ var _AgentLifecycle_decorators, _init179;
78173
78720
  _AgentLifecycle_decorators = [Interface34()];
78174
78721
  var AgentLifecycle = class {
78175
78722
  };
78176
- _init178 = __decoratorStart(null);
78177
- AgentLifecycle = __decorateElement(_init178, 0, "AgentLifecycle", _AgentLifecycle_decorators, AgentLifecycle);
78178
- __runInitializers(_init178, 1, AgentLifecycle);
78723
+ _init179 = __decoratorStart(null);
78724
+ AgentLifecycle = __decorateElement(_init179, 0, "AgentLifecycle", _AgentLifecycle_decorators, AgentLifecycle);
78725
+ __runInitializers(_init179, 1, AgentLifecycle);
78179
78726
 
78180
78727
  // src/mechanisms/vault.ts
78181
78728
  import { Interface as Interface35 } from "@adelie/core/kernel";
78182
- var _UserVault_decorators, _init179;
78729
+ var _UserVault_decorators, _init180;
78183
78730
  _UserVault_decorators = [Interface35()];
78184
78731
  var UserVault = class {
78185
78732
  };
78186
- _init179 = __decoratorStart(null);
78187
- UserVault = __decorateElement(_init179, 0, "UserVault", _UserVault_decorators, UserVault);
78188
- __runInitializers(_init179, 1, UserVault);
78733
+ _init180 = __decoratorStart(null);
78734
+ UserVault = __decorateElement(_init180, 0, "UserVault", _UserVault_decorators, UserVault);
78735
+ __runInitializers(_init180, 1, UserVault);
78189
78736
 
78190
78737
  // src/mechanisms/workspace.ts
78191
78738
  import { Interface as Interface36 } from "@adelie/core/kernel";
78192
- var _WorkspaceFiles_decorators, _init180;
78739
+ var _WorkspaceFiles_decorators, _init181;
78193
78740
  _WorkspaceFiles_decorators = [Interface36()];
78194
78741
  var WorkspaceFiles = class {
78195
78742
  };
78196
- _init180 = __decoratorStart(null);
78197
- WorkspaceFiles = __decorateElement(_init180, 0, "WorkspaceFiles", _WorkspaceFiles_decorators, WorkspaceFiles);
78198
- __runInitializers(_init180, 1, WorkspaceFiles);
78199
- var _FileReveal_decorators, _init181;
78743
+ _init181 = __decoratorStart(null);
78744
+ WorkspaceFiles = __decorateElement(_init181, 0, "WorkspaceFiles", _WorkspaceFiles_decorators, WorkspaceFiles);
78745
+ __runInitializers(_init181, 1, WorkspaceFiles);
78746
+ var _FileReveal_decorators, _init182;
78200
78747
  _FileReveal_decorators = [Interface36()];
78201
78748
  var FileReveal = class {
78202
78749
  };
78203
- _init181 = __decoratorStart(null);
78204
- FileReveal = __decorateElement(_init181, 0, "FileReveal", _FileReveal_decorators, FileReveal);
78205
- __runInitializers(_init181, 1, FileReveal);
78750
+ _init182 = __decoratorStart(null);
78751
+ FileReveal = __decorateElement(_init182, 0, "FileReveal", _FileReveal_decorators, FileReveal);
78752
+ __runInitializers(_init182, 1, FileReveal);
78206
78753
 
78207
78754
  // src/mechanisms/settings.ts
78208
78755
  import { Interface as Interface37 } from "@adelie/core/kernel";
78209
- var _Settings_decorators, _init182;
78756
+ var _Settings_decorators, _init183;
78210
78757
  _Settings_decorators = [Interface37()];
78211
78758
  var Settings = class {
78212
78759
  };
78213
- _init182 = __decoratorStart(null);
78214
- Settings = __decorateElement(_init182, 0, "Settings", _Settings_decorators, Settings);
78215
- __runInitializers(_init182, 1, Settings);
78216
- var _UiPrefsStore_decorators, _init183;
78760
+ _init183 = __decoratorStart(null);
78761
+ Settings = __decorateElement(_init183, 0, "Settings", _Settings_decorators, Settings);
78762
+ __runInitializers(_init183, 1, Settings);
78763
+ var _UiPrefsStore_decorators, _init184;
78217
78764
  _UiPrefsStore_decorators = [Interface37()];
78218
78765
  var UiPrefsStore = class {
78219
78766
  };
78220
- _init183 = __decoratorStart(null);
78221
- UiPrefsStore = __decorateElement(_init183, 0, "UiPrefsStore", _UiPrefsStore_decorators, UiPrefsStore);
78222
- __runInitializers(_init183, 1, UiPrefsStore);
78767
+ _init184 = __decoratorStart(null);
78768
+ UiPrefsStore = __decorateElement(_init184, 0, "UiPrefsStore", _UiPrefsStore_decorators, UiPrefsStore);
78769
+ __runInitializers(_init184, 1, UiPrefsStore);
78223
78770
 
78224
78771
  // src/mechanisms/messaging.ts
78225
78772
  import { Interface as Interface38 } from "@adelie/core/kernel";
78226
- var _MessagingBindings_decorators, _init184;
78773
+ var _MessagingBindings_decorators, _init185;
78227
78774
  _MessagingBindings_decorators = [Interface38()];
78228
78775
  var MessagingBindings = class {
78229
78776
  };
78230
- _init184 = __decoratorStart(null);
78231
- MessagingBindings = __decorateElement(_init184, 0, "MessagingBindings", _MessagingBindings_decorators, MessagingBindings);
78232
- __runInitializers(_init184, 1, MessagingBindings);
78777
+ _init185 = __decoratorStart(null);
78778
+ MessagingBindings = __decorateElement(_init185, 0, "MessagingBindings", _MessagingBindings_decorators, MessagingBindings);
78779
+ __runInitializers(_init185, 1, MessagingBindings);
78233
78780
 
78234
78781
  // src/mechanisms/organization.ts
78235
78782
  import { Interface as Interface39 } from "@adelie/core/kernel";
@@ -78237,11 +78784,11 @@ var OrgCache = class extends Interface39() {
78237
78784
  };
78238
78785
 
78239
78786
  // src/http/routes/preview.ts
78240
- import { Hono as Hono49 } from "hono";
78241
- import { Interface as Interface40, Bind as Bind32, Module as Module18, Provide as Provide18, Use as Use76 } from "@adelie/core/kernel";
78787
+ import { Hono as Hono50 } from "hono";
78788
+ import { Interface as Interface40, Bind as Bind33, Module as Module18, Provide as Provide18, Use as Use77 } from "@adelie/core/kernel";
78242
78789
  var DIRECTORY_INDEX = "index.html";
78243
78790
  function previewRoutes(deps) {
78244
- const app = new Hono49();
78791
+ const app = new Hono50();
78245
78792
  app.get("/:token/*", async (c) => {
78246
78793
  const token = c.req.param("token");
78247
78794
  const payload = token ? deps.previewTokens.verify(token) : null;
@@ -78285,7 +78832,7 @@ function previewRoutes(deps) {
78285
78832
  }
78286
78833
  var PreviewTokens = class extends Interface40() {
78287
78834
  };
78288
- var _previewRoutes_dec, _previewTokens_dec2, _sessionsRepo_dec5, _workspaceFiles_dec4, _PreviewModule_decorators, _init185;
78835
+ var _previewRoutes_dec, _previewTokens_dec2, _sessionsRepo_dec5, _workspaceFiles_dec4, _PreviewModule_decorators, _init186;
78289
78836
  _PreviewModule_decorators = [Module18({
78290
78837
  contributes: {
78291
78838
  "HttpModule.routes": [
@@ -78297,13 +78844,13 @@ _PreviewModule_decorators = [Module18({
78297
78844
  }
78298
78845
  ]
78299
78846
  }
78300
- })], _workspaceFiles_dec4 = [Use76()], _sessionsRepo_dec5 = [Use76()], _previewTokens_dec2 = [Provide18()], _previewRoutes_dec = [Bind32("workspace.preview")];
78847
+ })], _workspaceFiles_dec4 = [Use77()], _sessionsRepo_dec5 = [Use77()], _previewTokens_dec2 = [Provide18()], _previewRoutes_dec = [Bind33("workspace.preview")];
78301
78848
  var PreviewModule = class {
78302
78849
  constructor() {
78303
- __publicField(this, "workspaceFiles", __runInitializers(_init185, 8, this)), __runInitializers(_init185, 11, this);
78304
- __publicField(this, "sessionsRepo", __runInitializers(_init185, 12, this)), __runInitializers(_init185, 15, this);
78305
- __publicField(this, "previewTokens", __runInitializers(_init185, 16, this)), __runInitializers(_init185, 19, this);
78306
- __publicField(this, "previewRoutes", __runInitializers(_init185, 20, this)), __runInitializers(_init185, 23, this);
78850
+ __publicField(this, "workspaceFiles", __runInitializers(_init186, 8, this)), __runInitializers(_init186, 11, this);
78851
+ __publicField(this, "sessionsRepo", __runInitializers(_init186, 12, this)), __runInitializers(_init186, 15, this);
78852
+ __publicField(this, "previewTokens", __runInitializers(_init186, 16, this)), __runInitializers(_init186, 19, this);
78853
+ __publicField(this, "previewRoutes", __runInitializers(_init186, 20, this)), __runInitializers(_init186, 23, this);
78307
78854
  }
78308
78855
  setup() {
78309
78856
  const previewTokens = createPreviewTokenSigner();
@@ -78315,17 +78862,17 @@ var PreviewModule = class {
78315
78862
  });
78316
78863
  }
78317
78864
  };
78318
- _init185 = __decoratorStart(null);
78319
- __decorateElement(_init185, 5, "workspaceFiles", _workspaceFiles_dec4, PreviewModule);
78320
- __decorateElement(_init185, 5, "sessionsRepo", _sessionsRepo_dec5, PreviewModule);
78321
- __decorateElement(_init185, 5, "previewTokens", _previewTokens_dec2, PreviewModule);
78322
- __decorateElement(_init185, 5, "previewRoutes", _previewRoutes_dec, PreviewModule);
78323
- PreviewModule = __decorateElement(_init185, 0, "PreviewModule", _PreviewModule_decorators, PreviewModule);
78324
- __runInitializers(_init185, 1, PreviewModule);
78865
+ _init186 = __decoratorStart(null);
78866
+ __decorateElement(_init186, 5, "workspaceFiles", _workspaceFiles_dec4, PreviewModule);
78867
+ __decorateElement(_init186, 5, "sessionsRepo", _sessionsRepo_dec5, PreviewModule);
78868
+ __decorateElement(_init186, 5, "previewTokens", _previewTokens_dec2, PreviewModule);
78869
+ __decorateElement(_init186, 5, "previewRoutes", _previewRoutes_dec, PreviewModule);
78870
+ PreviewModule = __decorateElement(_init186, 0, "PreviewModule", _PreviewModule_decorators, PreviewModule);
78871
+ __runInitializers(_init186, 1, PreviewModule);
78325
78872
 
78326
78873
  // src/http/app.ts
78327
- import { Interface as Interface41, Module as Module19, Provide as Provide19, Use as Use77 } from "@adelie/core/kernel";
78328
- import { Hono as Hono50 } from "hono";
78874
+ import { Interface as Interface41, Module as Module19, Provide as Provide19, Use as Use78 } from "@adelie/core/kernel";
78875
+ import { Hono as Hono51 } from "hono";
78329
78876
  import { bodyLimit } from "hono/body-limit";
78330
78877
 
78331
78878
  // src/hmr/hono-seam.ts
@@ -78342,29 +78889,29 @@ function seamHttp(app) {
78342
78889
  }
78343
78890
 
78344
78891
  // src/http/app.ts
78345
- var _Http_decorators, _init186;
78892
+ var _Http_decorators, _init187;
78346
78893
  _Http_decorators = [Interface41()];
78347
78894
  var Http = class {
78348
78895
  };
78349
- _init186 = __decoratorStart(null);
78350
- Http = __decorateElement(_init186, 0, "Http", _Http_decorators, Http);
78351
- __runInitializers(_init186, 1, Http);
78352
- var _http_dec3, _access_dec12, _settings_dec11, _errors_dec9, _auth_dec10, _log_dec7, _config_dec22, _HttpModule_decorators, _init187;
78353
- _HttpModule_decorators = [Module19()], _config_dec22 = [Use77()], _log_dec7 = [Use77()], _auth_dec10 = [Use77()], _errors_dec9 = [Use77()], _settings_dec11 = [Use77()], _access_dec12 = [Use77()], _http_dec3 = [Provide19()];
78896
+ _init187 = __decoratorStart(null);
78897
+ Http = __decorateElement(_init187, 0, "Http", _Http_decorators, Http);
78898
+ __runInitializers(_init187, 1, Http);
78899
+ var _http_dec3, _access_dec12, _settings_dec12, _errors_dec9, _auth_dec10, _log_dec7, _config_dec22, _HttpModule_decorators, _init188;
78900
+ _HttpModule_decorators = [Module19()], _config_dec22 = [Use78()], _log_dec7 = [Use78()], _auth_dec10 = [Use78()], _errors_dec9 = [Use78()], _settings_dec12 = [Use78()], _access_dec12 = [Use78()], _http_dec3 = [Provide19()];
78354
78901
  var HttpModule = class {
78355
78902
  constructor() {
78356
- __publicField(this, "config", __runInitializers(_init187, 8, this)), __runInitializers(_init187, 11, this);
78357
- __publicField(this, "log", __runInitializers(_init187, 12, this)), __runInitializers(_init187, 15, this);
78358
- __publicField(this, "auth", __runInitializers(_init187, 16, this)), __runInitializers(_init187, 19, this);
78359
- __publicField(this, "errors", __runInitializers(_init187, 20, this)), __runInitializers(_init187, 23, this);
78360
- __publicField(this, "settings", __runInitializers(_init187, 24, this)), __runInitializers(_init187, 27, this);
78361
- __publicField(this, "access", __runInitializers(_init187, 28, this)), __runInitializers(_init187, 31, this);
78362
- __publicField(this, "http", __runInitializers(_init187, 32, this)), __runInitializers(_init187, 35, this);
78903
+ __publicField(this, "config", __runInitializers(_init188, 8, this)), __runInitializers(_init188, 11, this);
78904
+ __publicField(this, "log", __runInitializers(_init188, 12, this)), __runInitializers(_init188, 15, this);
78905
+ __publicField(this, "auth", __runInitializers(_init188, 16, this)), __runInitializers(_init188, 19, this);
78906
+ __publicField(this, "errors", __runInitializers(_init188, 20, this)), __runInitializers(_init188, 23, this);
78907
+ __publicField(this, "settings", __runInitializers(_init188, 24, this)), __runInitializers(_init188, 27, this);
78908
+ __publicField(this, "access", __runInitializers(_init188, 28, this)), __runInitializers(_init188, 31, this);
78909
+ __publicField(this, "http", __runInitializers(_init188, 32, this)), __runInitializers(_init188, 35, this);
78363
78910
  }
78364
78911
  setup({ contributions }) {
78365
78912
  const errors = this.errors;
78366
78913
  const access2 = this.access;
78367
- const app = new Hono50();
78914
+ const app = new Hono51();
78368
78915
  app.onError((err, c) => {
78369
78916
  const projectId = attributedProjectId(c, { access: access2 });
78370
78917
  const normalized = normalizeError(err);
@@ -78421,33 +78968,33 @@ var HttpModule = class {
78421
78968
  this.http = { fetch: (request) => Promise.resolve(app.fetch(request)) };
78422
78969
  }
78423
78970
  };
78424
- _init187 = __decoratorStart(null);
78425
- __decorateElement(_init187, 5, "config", _config_dec22, HttpModule);
78426
- __decorateElement(_init187, 5, "log", _log_dec7, HttpModule);
78427
- __decorateElement(_init187, 5, "auth", _auth_dec10, HttpModule);
78428
- __decorateElement(_init187, 5, "errors", _errors_dec9, HttpModule);
78429
- __decorateElement(_init187, 5, "settings", _settings_dec11, HttpModule);
78430
- __decorateElement(_init187, 5, "access", _access_dec12, HttpModule);
78431
- __decorateElement(_init187, 5, "http", _http_dec3, HttpModule);
78432
- HttpModule = __decorateElement(_init187, 0, "HttpModule", _HttpModule_decorators, HttpModule);
78433
- __runInitializers(_init187, 1, HttpModule);
78971
+ _init188 = __decoratorStart(null);
78972
+ __decorateElement(_init188, 5, "config", _config_dec22, HttpModule);
78973
+ __decorateElement(_init188, 5, "log", _log_dec7, HttpModule);
78974
+ __decorateElement(_init188, 5, "auth", _auth_dec10, HttpModule);
78975
+ __decorateElement(_init188, 5, "errors", _errors_dec9, HttpModule);
78976
+ __decorateElement(_init188, 5, "settings", _settings_dec12, HttpModule);
78977
+ __decorateElement(_init188, 5, "access", _access_dec12, HttpModule);
78978
+ __decorateElement(_init188, 5, "http", _http_dec3, HttpModule);
78979
+ HttpModule = __decorateElement(_init188, 0, "HttpModule", _HttpModule_decorators, HttpModule);
78980
+ __runInitializers(_init188, 1, HttpModule);
78434
78981
 
78435
78982
  // src/http/routes/contributions.ts
78436
- import { Hono as Hono51 } from "hono";
78437
- import { Interface as Interface42, Bind as Bind33, Module as Module20, Provide as Provide20 } from "@adelie/core/kernel";
78983
+ import { Hono as Hono52 } from "hono";
78984
+ import { Interface as Interface42, Bind as Bind34, Module as Module20, Provide as Provide20 } from "@adelie/core/kernel";
78438
78985
  function contributionsRoutes(deps) {
78439
- const routes = new Hono51();
78986
+ const routes = new Hono52();
78440
78987
  routes.get("/", (c) => c.json(deps.web.contributions()));
78441
78988
  return routes;
78442
78989
  }
78443
- var _WebShell_decorators, _init188;
78990
+ var _WebShell_decorators, _init189;
78444
78991
  _WebShell_decorators = [Interface42()];
78445
78992
  var WebShell = class {
78446
78993
  };
78447
- _init188 = __decoratorStart(null);
78448
- WebShell = __decorateElement(_init188, 0, "WebShell", _WebShell_decorators, WebShell);
78449
- __runInitializers(_init188, 1, WebShell);
78450
- var _contributionsRoutes_dec, _web_dec, _WebModule_decorators, _init189;
78994
+ _init189 = __decoratorStart(null);
78995
+ WebShell = __decorateElement(_init189, 0, "WebShell", _WebShell_decorators, WebShell);
78996
+ __runInitializers(_init189, 1, WebShell);
78997
+ var _contributionsRoutes_dec, _web_dec, _WebModule_decorators, _init190;
78451
78998
  _WebModule_decorators = [Module20({
78452
78999
  contributes: {
78453
79000
  "HttpModule.routes": [
@@ -78459,11 +79006,11 @@ _WebModule_decorators = [Module20({
78459
79006
  }
78460
79007
  ]
78461
79008
  }
78462
- })], _web_dec = [Provide20()], _contributionsRoutes_dec = [Bind33("web.contributions")];
79009
+ })], _web_dec = [Provide20()], _contributionsRoutes_dec = [Bind34("web.contributions")];
78463
79010
  var WebModule = class {
78464
79011
  constructor() {
78465
- __publicField(this, "web", __runInitializers(_init189, 8, this)), __runInitializers(_init189, 11, this);
78466
- __publicField(this, "contributionsRoutes", __runInitializers(_init189, 12, this)), __runInitializers(_init189, 15, this);
79012
+ __publicField(this, "web", __runInitializers(_init190, 8, this)), __runInitializers(_init190, 11, this);
79013
+ __publicField(this, "contributionsRoutes", __runInitializers(_init190, 12, this)), __runInitializers(_init190, 15, this);
78467
79014
  }
78468
79015
  setup({ contributions }) {
78469
79016
  const collect = (slot) => (contributions[slot] ?? []).map(
@@ -78481,14 +79028,14 @@ var WebModule = class {
78481
79028
  this.contributionsRoutes = contributionsRoutes({ web });
78482
79029
  }
78483
79030
  };
78484
- _init189 = __decoratorStart(null);
78485
- __decorateElement(_init189, 5, "web", _web_dec, WebModule);
78486
- __decorateElement(_init189, 5, "contributionsRoutes", _contributionsRoutes_dec, WebModule);
78487
- WebModule = __decorateElement(_init189, 0, "WebModule", _WebModule_decorators, WebModule);
78488
- __runInitializers(_init189, 1, WebModule);
79031
+ _init190 = __decoratorStart(null);
79032
+ __decorateElement(_init190, 5, "web", _web_dec, WebModule);
79033
+ __decorateElement(_init190, 5, "contributionsRoutes", _contributionsRoutes_dec, WebModule);
79034
+ WebModule = __decorateElement(_init190, 0, "WebModule", _WebModule_decorators, WebModule);
79035
+ __runInitializers(_init190, 1, WebModule);
78489
79036
 
78490
79037
  // src/builtin-browser/module.ts
78491
- import { Bind as Bind34, Component as Component74, Interface as Interface43, Module as Module21, Use as Use78 } from "@adelie/core/kernel";
79038
+ import { Bind as Bind35, Component as Component75, Interface as Interface43, Module as Module21, Use as Use79 } from "@adelie/core/kernel";
78492
79039
 
78493
79040
  // src/services/desktop-update-port.ts
78494
79041
  import { randomUUID as randomUUID8 } from "crypto";
@@ -78641,7 +79188,7 @@ function wireShellUpdatePort(desktop, port) {
78641
79188
  }
78642
79189
 
78643
79190
  // src/builtin-browser/routes.ts
78644
- import { Hono as Hono52 } from "hono";
79191
+ import { Hono as Hono53 } from "hono";
78645
79192
 
78646
79193
  // src/builtin-browser/service.ts
78647
79194
  import os10 from "os";
@@ -78661,7 +79208,7 @@ var DEFAULT_SHELL_LINK_TIMING = {
78661
79208
  helloRetryMs: 1e4,
78662
79209
  defaultTimeoutMs: 3e4
78663
79210
  };
78664
- var isRecord4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
79211
+ var isRecord5 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
78665
79212
  var MAX_DATA_FAVICON_CHARS = 4 * 1024;
78666
79213
  var MAX_FAVICON_URL_CHARS = 2 * 1024;
78667
79214
  function faviconOf(value) {
@@ -78673,7 +79220,7 @@ function crashReasonOf(value) {
78673
79220
  return typeof value === "string" && /^[a-z][a-z-]{0,39}$/.test(value) ? value : void 0;
78674
79221
  }
78675
79222
  function parseTab(value) {
78676
- if (!isRecord4(value)) return null;
79223
+ if (!isRecord5(value)) return null;
78677
79224
  const { id, url, title, loading: loading2, canGoBack, canGoForward } = value;
78678
79225
  if (typeof id !== "number" || !Number.isSafeInteger(id)) return null;
78679
79226
  if (typeof url !== "string" || typeof title !== "string") return null;
@@ -78698,7 +79245,7 @@ function parseTabMetrics(value) {
78698
79245
  if (!Array.isArray(value) || value.length > MAX_MEASURED_TABS) return null;
78699
79246
  const tabs = [];
78700
79247
  for (const entry of value) {
78701
- if (!isRecord4(entry)) return null;
79248
+ if (!isRecord5(entry)) return null;
78702
79249
  const { tabId, memoryKB, cpuPercent } = entry;
78703
79250
  if (typeof tabId !== "number" || !Number.isSafeInteger(tabId)) return null;
78704
79251
  if (!isAmount(memoryKB) || !isAmount(cpuPercent)) return null;
@@ -78707,7 +79254,7 @@ function parseTabMetrics(value) {
78707
79254
  return tabs;
78708
79255
  }
78709
79256
  function parseBrowserEvent(data) {
78710
- if (!isRecord4(data) || data.type !== "desktop-browser-event" || !isRecord4(data.event)) {
79257
+ if (!isRecord5(data) || data.type !== "desktop-browser-event" || !isRecord5(data.event)) {
78711
79258
  return null;
78712
79259
  }
78713
79260
  const event = data.event;
@@ -78732,7 +79279,7 @@ function parseBrowserEvent(data) {
78732
79279
  kind: "cdp-event",
78733
79280
  tabId: event.tabId,
78734
79281
  method: event.method,
78735
- params: isRecord4(event.params) ? event.params : {}
79282
+ params: isRecord5(event.params) ? event.params : {}
78736
79283
  };
78737
79284
  case "tab-crashed": {
78738
79285
  const reason = crashReasonOf(event.reason) ?? "crashed";
@@ -78750,7 +79297,7 @@ function parseBrowserEvent(data) {
78750
79297
  }
78751
79298
  }
78752
79299
  function parseBrowserReply(data) {
78753
- if (!isRecord4(data) || data.type !== "desktop-browser-reply") return null;
79300
+ if (!isRecord5(data) || data.type !== "desktop-browser-reply") return null;
78754
79301
  if (typeof data.id !== "string" || typeof data.ok !== "boolean") return null;
78755
79302
  return {
78756
79303
  type: "desktop-browser-reply",
@@ -82607,7 +83154,7 @@ function sessionIdOf(body) {
82607
83154
  }
82608
83155
  var STORAGES = /* @__PURE__ */ new Set(["cookies", "cache", "storage"]);
82609
83156
  function builtinBrowserRoutes(browser) {
82610
- const app = new Hono52();
83157
+ const app = new Hono53();
82611
83158
  app.onError((err, c) => {
82612
83159
  if (err instanceof BrowserUnavailableError) {
82613
83160
  return c.json({ error: { code: err.code, message: err.message, reason: err.reason } }, 503);
@@ -82830,25 +83377,25 @@ function builtinBrowserRoutes(browser) {
82830
83377
  }
82831
83378
 
82832
83379
  // src/builtin-browser/module.ts
82833
- var _BuiltinBrowserPort_decorators, _init190;
83380
+ var _BuiltinBrowserPort_decorators, _init191;
82834
83381
  _BuiltinBrowserPort_decorators = [Interface43()];
82835
83382
  var BuiltinBrowserPort = class {
82836
83383
  };
82837
- _init190 = __decoratorStart(null);
82838
- BuiltinBrowserPort = __decorateElement(_init190, 0, "BuiltinBrowserPort", _BuiltinBrowserPort_decorators, BuiltinBrowserPort);
82839
- __runInitializers(_init190, 1, BuiltinBrowserPort);
82840
- var _ProcessShellPort_decorators, _init191;
82841
- _ProcessShellPort_decorators = [Component74()];
83384
+ _init191 = __decoratorStart(null);
83385
+ BuiltinBrowserPort = __decorateElement(_init191, 0, "BuiltinBrowserPort", _BuiltinBrowserPort_decorators, BuiltinBrowserPort);
83386
+ __runInitializers(_init191, 1, BuiltinBrowserPort);
83387
+ var _ProcessShellPort_decorators, _init192;
83388
+ _ProcessShellPort_decorators = [Component75()];
82842
83389
  var ProcessShellPort = class {
82843
83390
  current() {
82844
83391
  return shellPortOf(process);
82845
83392
  }
82846
83393
  };
82847
- _init191 = __decoratorStart(null);
82848
- ProcessShellPort = __decorateElement(_init191, 0, "ProcessShellPort", _ProcessShellPort_decorators, ProcessShellPort);
82849
- __runInitializers(_init191, 1, ProcessShellPort);
82850
- var _routes_dec26, _log_dec8, _paths_dec18, _users_dec4, _channels_dec12, _desktop_dec14, _port_dec, _BuiltinBrowserRoutes_decorators, _init192;
82851
- _BuiltinBrowserRoutes_decorators = [Component74({
83394
+ _init192 = __decoratorStart(null);
83395
+ ProcessShellPort = __decorateElement(_init192, 0, "ProcessShellPort", _ProcessShellPort_decorators, ProcessShellPort);
83396
+ __runInitializers(_init192, 1, ProcessShellPort);
83397
+ var _routes_dec27, _log_dec8, _paths_dec18, _users_dec4, _channels_dec12, _desktop_dec14, _port_dec, _BuiltinBrowserRoutes_decorators, _init193;
83398
+ _BuiltinBrowserRoutes_decorators = [Component75({
82852
83399
  contributes: {
82853
83400
  "HttpModule.routes": [
82854
83401
  {
@@ -82859,16 +83406,16 @@ _BuiltinBrowserRoutes_decorators = [Component74({
82859
83406
  }
82860
83407
  ]
82861
83408
  }
82862
- })], _port_dec = [Use78()], _desktop_dec14 = [Use78()], _channels_dec12 = [Use78()], _users_dec4 = [Use78()], _paths_dec18 = [Use78()], _log_dec8 = [Use78()], _routes_dec26 = [Bind34("BuiltinBrowserRoutes.routes")];
83409
+ })], _port_dec = [Use79()], _desktop_dec14 = [Use79()], _channels_dec12 = [Use79()], _users_dec4 = [Use79()], _paths_dec18 = [Use79()], _log_dec8 = [Use79()], _routes_dec27 = [Bind35("BuiltinBrowserRoutes.routes")];
82863
83410
  var BuiltinBrowserRoutes = class {
82864
83411
  constructor() {
82865
- __publicField(this, "port", __runInitializers(_init192, 8, this)), __runInitializers(_init192, 11, this);
82866
- __publicField(this, "desktop", __runInitializers(_init192, 12, this)), __runInitializers(_init192, 15, this);
82867
- __publicField(this, "channels", __runInitializers(_init192, 16, this)), __runInitializers(_init192, 19, this);
82868
- __publicField(this, "users", __runInitializers(_init192, 20, this)), __runInitializers(_init192, 23, this);
82869
- __publicField(this, "paths", __runInitializers(_init192, 24, this)), __runInitializers(_init192, 27, this);
82870
- __publicField(this, "log", __runInitializers(_init192, 28, this)), __runInitializers(_init192, 31, this);
82871
- __publicField(this, "routes", __runInitializers(_init192, 32, this)), __runInitializers(_init192, 35, this);
83412
+ __publicField(this, "port", __runInitializers(_init193, 8, this)), __runInitializers(_init193, 11, this);
83413
+ __publicField(this, "desktop", __runInitializers(_init193, 12, this)), __runInitializers(_init193, 15, this);
83414
+ __publicField(this, "channels", __runInitializers(_init193, 16, this)), __runInitializers(_init193, 19, this);
83415
+ __publicField(this, "users", __runInitializers(_init193, 20, this)), __runInitializers(_init193, 23, this);
83416
+ __publicField(this, "paths", __runInitializers(_init193, 24, this)), __runInitializers(_init193, 27, this);
83417
+ __publicField(this, "log", __runInitializers(_init193, 28, this)), __runInitializers(_init193, 31, this);
83418
+ __publicField(this, "routes", __runInitializers(_init193, 32, this)), __runInitializers(_init193, 35, this);
82872
83419
  }
82873
83420
  setup({ effect }) {
82874
83421
  const users = this.users;
@@ -82896,32 +83443,32 @@ var BuiltinBrowserRoutes = class {
82896
83443
  effect(() => browser.dispose());
82897
83444
  }
82898
83445
  };
82899
- _init192 = __decoratorStart(null);
82900
- __decorateElement(_init192, 5, "port", _port_dec, BuiltinBrowserRoutes);
82901
- __decorateElement(_init192, 5, "desktop", _desktop_dec14, BuiltinBrowserRoutes);
82902
- __decorateElement(_init192, 5, "channels", _channels_dec12, BuiltinBrowserRoutes);
82903
- __decorateElement(_init192, 5, "users", _users_dec4, BuiltinBrowserRoutes);
82904
- __decorateElement(_init192, 5, "paths", _paths_dec18, BuiltinBrowserRoutes);
82905
- __decorateElement(_init192, 5, "log", _log_dec8, BuiltinBrowserRoutes);
82906
- __decorateElement(_init192, 5, "routes", _routes_dec26, BuiltinBrowserRoutes);
82907
- BuiltinBrowserRoutes = __decorateElement(_init192, 0, "BuiltinBrowserRoutes", _BuiltinBrowserRoutes_decorators, BuiltinBrowserRoutes);
82908
- __runInitializers(_init192, 1, BuiltinBrowserRoutes);
82909
- var _BuiltinBrowserModule_decorators, _init193;
83446
+ _init193 = __decoratorStart(null);
83447
+ __decorateElement(_init193, 5, "port", _port_dec, BuiltinBrowserRoutes);
83448
+ __decorateElement(_init193, 5, "desktop", _desktop_dec14, BuiltinBrowserRoutes);
83449
+ __decorateElement(_init193, 5, "channels", _channels_dec12, BuiltinBrowserRoutes);
83450
+ __decorateElement(_init193, 5, "users", _users_dec4, BuiltinBrowserRoutes);
83451
+ __decorateElement(_init193, 5, "paths", _paths_dec18, BuiltinBrowserRoutes);
83452
+ __decorateElement(_init193, 5, "log", _log_dec8, BuiltinBrowserRoutes);
83453
+ __decorateElement(_init193, 5, "routes", _routes_dec27, BuiltinBrowserRoutes);
83454
+ BuiltinBrowserRoutes = __decorateElement(_init193, 0, "BuiltinBrowserRoutes", _BuiltinBrowserRoutes_decorators, BuiltinBrowserRoutes);
83455
+ __runInitializers(_init193, 1, BuiltinBrowserRoutes);
83456
+ var _BuiltinBrowserModule_decorators, _init194;
82910
83457
  _BuiltinBrowserModule_decorators = [Module21({
82911
83458
  children: [ProcessShellPort, BuiltinBrowserRoutes],
82912
83459
  exports: []
82913
83460
  })];
82914
83461
  var BuiltinBrowserModule = class {
82915
83462
  };
82916
- _init193 = __decoratorStart(null);
82917
- BuiltinBrowserModule = __decorateElement(_init193, 0, "BuiltinBrowserModule", _BuiltinBrowserModule_decorators, BuiltinBrowserModule);
82918
- __runInitializers(_init193, 1, BuiltinBrowserModule);
83463
+ _init194 = __decoratorStart(null);
83464
+ BuiltinBrowserModule = __decorateElement(_init194, 0, "BuiltinBrowserModule", _BuiltinBrowserModule_decorators, BuiltinBrowserModule);
83465
+ __runInitializers(_init194, 1, BuiltinBrowserModule);
82919
83466
 
82920
83467
  // src/amsp/module.ts
82921
- import { Bind as Bind35, Component as Component76, Module as Module22, Use as Use80 } from "@adelie/core/kernel";
83468
+ import { Bind as Bind36, Component as Component77, Module as Module22, Use as Use81 } from "@adelie/core/kernel";
82922
83469
 
82923
83470
  // src/db/repos/agent-api.ts
82924
- import { Component as Component75, Use as Use79 } from "@adelie/core/kernel";
83471
+ import { Component as Component76, Use as Use80 } from "@adelie/core/kernel";
82925
83472
  function settingsOf(r) {
82926
83473
  return {
82927
83474
  projectId: r.project_id,
@@ -82944,11 +83491,11 @@ function keyOf(r) {
82944
83491
  lastUsedAt: r.last_used_at ?? null
82945
83492
  };
82946
83493
  }
82947
- var _db_dec18, _AgentApiRepo_decorators, _init194;
82948
- _AgentApiRepo_decorators = [Component75()], _db_dec18 = [Use79()];
83494
+ var _db_dec18, _AgentApiRepo_decorators, _init195;
83495
+ _AgentApiRepo_decorators = [Component76()], _db_dec18 = [Use80()];
82949
83496
  var AgentApiRepo = class {
82950
83497
  constructor() {
82951
- __publicField(this, "db", __runInitializers(_init194, 8, this)), __runInitializers(_init194, 11, this);
83498
+ __publicField(this, "db", __runInitializers(_init195, 8, this)), __runInitializers(_init195, 11, this);
82952
83499
  }
82953
83500
  get(projectId, agentId) {
82954
83501
  const r = this.db.prepare("SELECT * FROM agent_api WHERE project_id = ? AND agent_id = ?").get(projectId, agentId);
@@ -83028,23 +83575,23 @@ var AgentApiRepo = class {
83028
83575
  this.db.prepare("DELETE FROM agent_api WHERE project_id = ?").run(projectId);
83029
83576
  }
83030
83577
  };
83031
- _init194 = __decoratorStart(null);
83032
- __decorateElement(_init194, 5, "db", _db_dec18, AgentApiRepo);
83033
- AgentApiRepo = __decorateElement(_init194, 0, "AgentApiRepo", _AgentApiRepo_decorators, AgentApiRepo);
83034
- __runInitializers(_init194, 1, AgentApiRepo);
83578
+ _init195 = __decoratorStart(null);
83579
+ __decorateElement(_init195, 5, "db", _db_dec18, AgentApiRepo);
83580
+ AgentApiRepo = __decorateElement(_init195, 0, "AgentApiRepo", _AgentApiRepo_decorators, AgentApiRepo);
83581
+ __runInitializers(_init195, 1, AgentApiRepo);
83035
83582
 
83036
83583
  // src/mechanisms/agent-api.ts
83037
83584
  import { Interface as Interface44 } from "@adelie/core/kernel";
83038
- var _AgentApi_decorators, _init195;
83585
+ var _AgentApi_decorators, _init196;
83039
83586
  _AgentApi_decorators = [Interface44()];
83040
83587
  var AgentApi = class {
83041
83588
  };
83042
- _init195 = __decoratorStart(null);
83043
- AgentApi = __decorateElement(_init195, 0, "AgentApi", _AgentApi_decorators, AgentApi);
83044
- __runInitializers(_init195, 1, AgentApi);
83589
+ _init196 = __decoratorStart(null);
83590
+ AgentApi = __decorateElement(_init196, 0, "AgentApi", _AgentApi_decorators, AgentApi);
83591
+ __runInitializers(_init196, 1, AgentApi);
83045
83592
 
83046
83593
  // src/amsp/routes.ts
83047
- import { Hono as Hono53 } from "hono";
83594
+ import { Hono as Hono54 } from "hono";
83048
83595
 
83049
83596
  // src/amsp/gate.ts
83050
83597
  import { isValidId as isValidId9 } from "@adelie/core";
@@ -83758,7 +84305,7 @@ async function runStream(c, deps) {
83758
84305
 
83759
84306
  // src/amsp/routes.ts
83760
84307
  function amspRoutes(deps) {
83761
- const app = new Hono53();
84308
+ const app = new Hono54();
83762
84309
  app.use("*", amspCors);
83763
84310
  app.use("*", amspGate(AMSP_PREFIX, deps));
83764
84311
  app.get("/agents/:projectId/:agentId", async (c) => {
@@ -83815,9 +84362,9 @@ function amspRoutes(deps) {
83815
84362
  }
83816
84363
 
83817
84364
  // src/amsp/try-route.ts
83818
- import { Hono as Hono54 } from "hono";
84365
+ import { Hono as Hono55 } from "hono";
83819
84366
  function agentApiTryRoutes(deps) {
83820
- const app = new Hono54();
84367
+ const app = new Hono55();
83821
84368
  app.post("/", async (c) => {
83822
84369
  requireHuman(c);
83823
84370
  const projectId = requireValidId(c, "projectId");
@@ -83832,8 +84379,8 @@ function agentApiTryRoutes(deps) {
83832
84379
  }
83833
84380
 
83834
84381
  // src/amsp/module.ts
83835
- var _tryRoutes_dec, _routes_dec27, _access_dec13, _clock_dec14, _errors_dec10, _log_dec9, _agentConfig_dec8, _channels_dec13, _sessionService_dec3, _manager_dec5, _sessions_dec7, _agentApi_dec4, _settings_dec12, _AmspRoutes_decorators, _init196;
83836
- _AmspRoutes_decorators = [Component76({
84382
+ var _tryRoutes_dec, _routes_dec28, _access_dec13, _clock_dec14, _errors_dec10, _log_dec9, _agentConfig_dec8, _channels_dec13, _sessionService_dec3, _manager_dec5, _sessions_dec7, _agentApi_dec4, _settings_dec13, _AmspRoutes_decorators, _init197;
84383
+ _AmspRoutes_decorators = [Component77({
83837
84384
  contributes: {
83838
84385
  "HttpModule.routes": [
83839
84386
  { id: "AmspRoutes.routes", prefix: "/api/amsp/v1", auth: "none", order: 5 },
@@ -83845,22 +84392,22 @@ _AmspRoutes_decorators = [Component76({
83845
84392
  }
83846
84393
  ]
83847
84394
  }
83848
- })], _settings_dec12 = [Use80()], _agentApi_dec4 = [Use80()], _sessions_dec7 = [Use80()], _manager_dec5 = [Use80()], _sessionService_dec3 = [Use80()], _channels_dec13 = [Use80()], _agentConfig_dec8 = [Use80()], _log_dec9 = [Use80()], _errors_dec10 = [Use80()], _clock_dec14 = [Use80()], _access_dec13 = [Use80()], _routes_dec27 = [Bind35("AmspRoutes.routes")], _tryRoutes_dec = [Bind35("AmspRoutes.try")];
84395
+ })], _settings_dec13 = [Use81()], _agentApi_dec4 = [Use81()], _sessions_dec7 = [Use81()], _manager_dec5 = [Use81()], _sessionService_dec3 = [Use81()], _channels_dec13 = [Use81()], _agentConfig_dec8 = [Use81()], _log_dec9 = [Use81()], _errors_dec10 = [Use81()], _clock_dec14 = [Use81()], _access_dec13 = [Use81()], _routes_dec28 = [Bind36("AmspRoutes.routes")], _tryRoutes_dec = [Bind36("AmspRoutes.try")];
83849
84396
  var AmspRoutes = class {
83850
84397
  constructor() {
83851
- __publicField(this, "settings", __runInitializers(_init196, 8, this)), __runInitializers(_init196, 11, this);
83852
- __publicField(this, "agentApi", __runInitializers(_init196, 12, this)), __runInitializers(_init196, 15, this);
83853
- __publicField(this, "sessions", __runInitializers(_init196, 16, this)), __runInitializers(_init196, 19, this);
83854
- __publicField(this, "manager", __runInitializers(_init196, 20, this)), __runInitializers(_init196, 23, this);
83855
- __publicField(this, "sessionService", __runInitializers(_init196, 24, this)), __runInitializers(_init196, 27, this);
83856
- __publicField(this, "channels", __runInitializers(_init196, 28, this)), __runInitializers(_init196, 31, this);
83857
- __publicField(this, "agentConfig", __runInitializers(_init196, 32, this)), __runInitializers(_init196, 35, this);
83858
- __publicField(this, "log", __runInitializers(_init196, 36, this)), __runInitializers(_init196, 39, this);
83859
- __publicField(this, "errors", __runInitializers(_init196, 40, this)), __runInitializers(_init196, 43, this);
83860
- __publicField(this, "clock", __runInitializers(_init196, 44, this)), __runInitializers(_init196, 47, this);
83861
- __publicField(this, "access", __runInitializers(_init196, 48, this)), __runInitializers(_init196, 51, this);
83862
- __publicField(this, "routes", __runInitializers(_init196, 52, this)), __runInitializers(_init196, 55, this);
83863
- __publicField(this, "tryRoutes", __runInitializers(_init196, 56, this)), __runInitializers(_init196, 59, this);
84398
+ __publicField(this, "settings", __runInitializers(_init197, 8, this)), __runInitializers(_init197, 11, this);
84399
+ __publicField(this, "agentApi", __runInitializers(_init197, 12, this)), __runInitializers(_init197, 15, this);
84400
+ __publicField(this, "sessions", __runInitializers(_init197, 16, this)), __runInitializers(_init197, 19, this);
84401
+ __publicField(this, "manager", __runInitializers(_init197, 20, this)), __runInitializers(_init197, 23, this);
84402
+ __publicField(this, "sessionService", __runInitializers(_init197, 24, this)), __runInitializers(_init197, 27, this);
84403
+ __publicField(this, "channels", __runInitializers(_init197, 28, this)), __runInitializers(_init197, 31, this);
84404
+ __publicField(this, "agentConfig", __runInitializers(_init197, 32, this)), __runInitializers(_init197, 35, this);
84405
+ __publicField(this, "log", __runInitializers(_init197, 36, this)), __runInitializers(_init197, 39, this);
84406
+ __publicField(this, "errors", __runInitializers(_init197, 40, this)), __runInitializers(_init197, 43, this);
84407
+ __publicField(this, "clock", __runInitializers(_init197, 44, this)), __runInitializers(_init197, 47, this);
84408
+ __publicField(this, "access", __runInitializers(_init197, 48, this)), __runInitializers(_init197, 51, this);
84409
+ __publicField(this, "routes", __runInitializers(_init197, 52, this)), __runInitializers(_init197, 55, this);
84410
+ __publicField(this, "tryRoutes", __runInitializers(_init197, 56, this)), __runInitializers(_init197, 59, this);
83864
84411
  }
83865
84412
  setup() {
83866
84413
  const clock = this.clock;
@@ -83880,46 +84427,46 @@ var AmspRoutes = class {
83880
84427
  this.tryRoutes = agentApiTryRoutes({ ...deps, access: this.access });
83881
84428
  }
83882
84429
  };
83883
- _init196 = __decoratorStart(null);
83884
- __decorateElement(_init196, 5, "settings", _settings_dec12, AmspRoutes);
83885
- __decorateElement(_init196, 5, "agentApi", _agentApi_dec4, AmspRoutes);
83886
- __decorateElement(_init196, 5, "sessions", _sessions_dec7, AmspRoutes);
83887
- __decorateElement(_init196, 5, "manager", _manager_dec5, AmspRoutes);
83888
- __decorateElement(_init196, 5, "sessionService", _sessionService_dec3, AmspRoutes);
83889
- __decorateElement(_init196, 5, "channels", _channels_dec13, AmspRoutes);
83890
- __decorateElement(_init196, 5, "agentConfig", _agentConfig_dec8, AmspRoutes);
83891
- __decorateElement(_init196, 5, "log", _log_dec9, AmspRoutes);
83892
- __decorateElement(_init196, 5, "errors", _errors_dec10, AmspRoutes);
83893
- __decorateElement(_init196, 5, "clock", _clock_dec14, AmspRoutes);
83894
- __decorateElement(_init196, 5, "access", _access_dec13, AmspRoutes);
83895
- __decorateElement(_init196, 5, "routes", _routes_dec27, AmspRoutes);
83896
- __decorateElement(_init196, 5, "tryRoutes", _tryRoutes_dec, AmspRoutes);
83897
- AmspRoutes = __decorateElement(_init196, 0, "AmspRoutes", _AmspRoutes_decorators, AmspRoutes);
83898
- __runInitializers(_init196, 1, AmspRoutes);
83899
- var _AgentApiModule_decorators, _init197;
84430
+ _init197 = __decoratorStart(null);
84431
+ __decorateElement(_init197, 5, "settings", _settings_dec13, AmspRoutes);
84432
+ __decorateElement(_init197, 5, "agentApi", _agentApi_dec4, AmspRoutes);
84433
+ __decorateElement(_init197, 5, "sessions", _sessions_dec7, AmspRoutes);
84434
+ __decorateElement(_init197, 5, "manager", _manager_dec5, AmspRoutes);
84435
+ __decorateElement(_init197, 5, "sessionService", _sessionService_dec3, AmspRoutes);
84436
+ __decorateElement(_init197, 5, "channels", _channels_dec13, AmspRoutes);
84437
+ __decorateElement(_init197, 5, "agentConfig", _agentConfig_dec8, AmspRoutes);
84438
+ __decorateElement(_init197, 5, "log", _log_dec9, AmspRoutes);
84439
+ __decorateElement(_init197, 5, "errors", _errors_dec10, AmspRoutes);
84440
+ __decorateElement(_init197, 5, "clock", _clock_dec14, AmspRoutes);
84441
+ __decorateElement(_init197, 5, "access", _access_dec13, AmspRoutes);
84442
+ __decorateElement(_init197, 5, "routes", _routes_dec28, AmspRoutes);
84443
+ __decorateElement(_init197, 5, "tryRoutes", _tryRoutes_dec, AmspRoutes);
84444
+ AmspRoutes = __decorateElement(_init197, 0, "AmspRoutes", _AmspRoutes_decorators, AmspRoutes);
84445
+ __runInitializers(_init197, 1, AmspRoutes);
84446
+ var _AgentApiModule_decorators, _init198;
83900
84447
  _AgentApiModule_decorators = [Module22({
83901
84448
  children: [AgentApiRepo, AmspRoutes],
83902
84449
  exports: [AgentApi]
83903
84450
  })];
83904
84451
  var AgentApiModule = class {
83905
84452
  };
83906
- _init197 = __decoratorStart(null);
83907
- AgentApiModule = __decorateElement(_init197, 0, "AgentApiModule", _AgentApiModule_decorators, AgentApiModule);
83908
- __runInitializers(_init197, 1, AgentApiModule);
84453
+ _init198 = __decoratorStart(null);
84454
+ AgentApiModule = __decorateElement(_init198, 0, "AgentApiModule", _AgentApiModule_decorators, AgentApiModule);
84455
+ __runInitializers(_init198, 1, AgentApiModule);
83909
84456
 
83910
84457
  // src/platform.ts
83911
- var _agents_dec6, _usage_dec7, _projectConfig_dec16, _errors_dec11, _machines_dec5, _sessionService_dec4, _orgScheduler_dec2, _scheduler_dec2, _Startup_decorators, _init198;
83912
- _Startup_decorators = [Component77()], _scheduler_dec2 = [Use81()], _orgScheduler_dec2 = [Use81()], _sessionService_dec4 = [Use81()], _machines_dec5 = [Use81()], _errors_dec11 = [Use81()], _projectConfig_dec16 = [Use81()], _usage_dec7 = [Use81()], _agents_dec6 = [Use81()];
84458
+ var _agents_dec6, _usage_dec7, _projectConfig_dec16, _errors_dec11, _machines_dec5, _sessionService_dec4, _orgScheduler_dec2, _scheduler_dec2, _Startup_decorators, _init199;
84459
+ _Startup_decorators = [Component78()], _scheduler_dec2 = [Use82()], _orgScheduler_dec2 = [Use82()], _sessionService_dec4 = [Use82()], _machines_dec5 = [Use82()], _errors_dec11 = [Use82()], _projectConfig_dec16 = [Use82()], _usage_dec7 = [Use82()], _agents_dec6 = [Use82()];
83913
84460
  var Startup = class {
83914
84461
  constructor() {
83915
- __publicField(this, "scheduler", __runInitializers(_init198, 8, this)), __runInitializers(_init198, 11, this);
83916
- __publicField(this, "orgScheduler", __runInitializers(_init198, 12, this)), __runInitializers(_init198, 15, this);
83917
- __publicField(this, "sessionService", __runInitializers(_init198, 16, this)), __runInitializers(_init198, 19, this);
83918
- __publicField(this, "machines", __runInitializers(_init198, 20, this)), __runInitializers(_init198, 23, this);
83919
- __publicField(this, "errors", __runInitializers(_init198, 24, this)), __runInitializers(_init198, 27, this);
83920
- __publicField(this, "projectConfig", __runInitializers(_init198, 28, this)), __runInitializers(_init198, 31, this);
83921
- __publicField(this, "usage", __runInitializers(_init198, 32, this)), __runInitializers(_init198, 35, this);
83922
- __publicField(this, "agents", __runInitializers(_init198, 36, this)), __runInitializers(_init198, 39, this);
84462
+ __publicField(this, "scheduler", __runInitializers(_init199, 8, this)), __runInitializers(_init199, 11, this);
84463
+ __publicField(this, "orgScheduler", __runInitializers(_init199, 12, this)), __runInitializers(_init199, 15, this);
84464
+ __publicField(this, "sessionService", __runInitializers(_init199, 16, this)), __runInitializers(_init199, 19, this);
84465
+ __publicField(this, "machines", __runInitializers(_init199, 20, this)), __runInitializers(_init199, 23, this);
84466
+ __publicField(this, "errors", __runInitializers(_init199, 24, this)), __runInitializers(_init199, 27, this);
84467
+ __publicField(this, "projectConfig", __runInitializers(_init199, 28, this)), __runInitializers(_init199, 31, this);
84468
+ __publicField(this, "usage", __runInitializers(_init199, 32, this)), __runInitializers(_init199, 35, this);
84469
+ __publicField(this, "agents", __runInitializers(_init199, 36, this)), __runInitializers(_init199, 39, this);
83923
84470
  }
83924
84471
  async setup() {
83925
84472
  await this.projectConfig.ensureDisplayName(DEFAULT_PROJECT_ID3, DEFAULT_PROJECT_NAME2);
@@ -83941,18 +84488,18 @@ var Startup = class {
83941
84488
  });
83942
84489
  }
83943
84490
  };
83944
- _init198 = __decoratorStart(null);
83945
- __decorateElement(_init198, 5, "scheduler", _scheduler_dec2, Startup);
83946
- __decorateElement(_init198, 5, "orgScheduler", _orgScheduler_dec2, Startup);
83947
- __decorateElement(_init198, 5, "sessionService", _sessionService_dec4, Startup);
83948
- __decorateElement(_init198, 5, "machines", _machines_dec5, Startup);
83949
- __decorateElement(_init198, 5, "errors", _errors_dec11, Startup);
83950
- __decorateElement(_init198, 5, "projectConfig", _projectConfig_dec16, Startup);
83951
- __decorateElement(_init198, 5, "usage", _usage_dec7, Startup);
83952
- __decorateElement(_init198, 5, "agents", _agents_dec6, Startup);
83953
- Startup = __decorateElement(_init198, 0, "Startup", _Startup_decorators, Startup);
83954
- __runInitializers(_init198, 1, Startup);
83955
- var _RuntimeModule_decorators, _init199;
84491
+ _init199 = __decoratorStart(null);
84492
+ __decorateElement(_init199, 5, "scheduler", _scheduler_dec2, Startup);
84493
+ __decorateElement(_init199, 5, "orgScheduler", _orgScheduler_dec2, Startup);
84494
+ __decorateElement(_init199, 5, "sessionService", _sessionService_dec4, Startup);
84495
+ __decorateElement(_init199, 5, "machines", _machines_dec5, Startup);
84496
+ __decorateElement(_init199, 5, "errors", _errors_dec11, Startup);
84497
+ __decorateElement(_init199, 5, "projectConfig", _projectConfig_dec16, Startup);
84498
+ __decorateElement(_init199, 5, "usage", _usage_dec7, Startup);
84499
+ __decorateElement(_init199, 5, "agents", _agents_dec6, Startup);
84500
+ Startup = __decorateElement(_init199, 0, "Startup", _Startup_decorators, Startup);
84501
+ __runInitializers(_init199, 1, Startup);
84502
+ var _RuntimeModule_decorators, _init200;
83956
84503
  _RuntimeModule_decorators = [Module23({
83957
84504
  children: [
83958
84505
  RuntimeConfig,
@@ -83989,10 +84536,10 @@ _RuntimeModule_decorators = [Module23({
83989
84536
  })];
83990
84537
  var RuntimeModule = class {
83991
84538
  };
83992
- _init199 = __decoratorStart(null);
83993
- RuntimeModule = __decorateElement(_init199, 0, "RuntimeModule", _RuntimeModule_decorators, RuntimeModule);
83994
- __runInitializers(_init199, 1, RuntimeModule);
83995
- var _IdentityModule_decorators, _init200;
84539
+ _init200 = __decoratorStart(null);
84540
+ RuntimeModule = __decorateElement(_init200, 0, "RuntimeModule", _RuntimeModule_decorators, RuntimeModule);
84541
+ __runInitializers(_init200, 1, RuntimeModule);
84542
+ var _IdentityModule_decorators, _init201;
83996
84543
  _IdentityModule_decorators = [Module23({
83997
84544
  children: [
83998
84545
  UsersRepo,
@@ -84010,10 +84557,10 @@ _IdentityModule_decorators = [Module23({
84010
84557
  })];
84011
84558
  var IdentityModule = class {
84012
84559
  };
84013
- _init200 = __decoratorStart(null);
84014
- IdentityModule = __decorateElement(_init200, 0, "IdentityModule", _IdentityModule_decorators, IdentityModule);
84015
- __runInitializers(_init200, 1, IdentityModule);
84016
- var _ProjectsModule_decorators, _init201;
84560
+ _init201 = __decoratorStart(null);
84561
+ IdentityModule = __decorateElement(_init201, 0, "IdentityModule", _IdentityModule_decorators, IdentityModule);
84562
+ __runInitializers(_init201, 1, IdentityModule);
84563
+ var _ProjectsModule_decorators, _init202;
84017
84564
  _ProjectsModule_decorators = [Module23({
84018
84565
  children: [
84019
84566
  ProjectsRepo,
@@ -84048,10 +84595,10 @@ _ProjectsModule_decorators = [Module23({
84048
84595
  })];
84049
84596
  var ProjectsModule = class {
84050
84597
  };
84051
- _init201 = __decoratorStart(null);
84052
- ProjectsModule = __decorateElement(_init201, 0, "ProjectsModule", _ProjectsModule_decorators, ProjectsModule);
84053
- __runInitializers(_init201, 1, ProjectsModule);
84054
- var _SessionRuntimeModule_decorators, _init202;
84598
+ _init202 = __decoratorStart(null);
84599
+ ProjectsModule = __decorateElement(_init202, 0, "ProjectsModule", _ProjectsModule_decorators, ProjectsModule);
84600
+ __runInitializers(_init202, 1, ProjectsModule);
84601
+ var _SessionRuntimeModule_decorators, _init203;
84055
84602
  _SessionRuntimeModule_decorators = [Module23({
84056
84603
  children: [
84057
84604
  SessionsRepo,
@@ -84083,60 +84630,60 @@ _SessionRuntimeModule_decorators = [Module23({
84083
84630
  })];
84084
84631
  var SessionRuntimeModule = class {
84085
84632
  };
84086
- _init202 = __decoratorStart(null);
84087
- SessionRuntimeModule = __decorateElement(_init202, 0, "SessionRuntimeModule", _SessionRuntimeModule_decorators, SessionRuntimeModule);
84088
- __runInitializers(_init202, 1, SessionRuntimeModule);
84089
- var _SettingsModule_decorators, _init203;
84633
+ _init203 = __decoratorStart(null);
84634
+ SessionRuntimeModule = __decorateElement(_init203, 0, "SessionRuntimeModule", _SessionRuntimeModule_decorators, SessionRuntimeModule);
84635
+ __runInitializers(_init203, 1, SessionRuntimeModule);
84636
+ var _SettingsModule_decorators, _init204;
84090
84637
  _SettingsModule_decorators = [Module23({
84091
84638
  children: [ServerSettingsRepo, UiPrefsRepo],
84092
84639
  exports: [Settings, UiPrefsStore]
84093
84640
  })];
84094
84641
  var SettingsModule = class {
84095
84642
  };
84096
- _init203 = __decoratorStart(null);
84097
- SettingsModule = __decorateElement(_init203, 0, "SettingsModule", _SettingsModule_decorators, SettingsModule);
84098
- __runInitializers(_init203, 1, SettingsModule);
84099
- var _PluginConfigModule_decorators, _init204;
84643
+ _init204 = __decoratorStart(null);
84644
+ SettingsModule = __decorateElement(_init204, 0, "SettingsModule", _SettingsModule_decorators, SettingsModule);
84645
+ __runInitializers(_init204, 1, SettingsModule);
84646
+ var _PluginConfigModule_decorators, _init205;
84100
84647
  _PluginConfigModule_decorators = [Module23({
84101
84648
  children: [PluginConfigProvider, PluginConfigPage],
84102
84649
  exports: [PluginConfig, PluginConfigAdmin]
84103
84650
  })];
84104
84651
  var PluginConfigModule = class {
84105
84652
  };
84106
- _init204 = __decoratorStart(null);
84107
- PluginConfigModule = __decorateElement(_init204, 0, "PluginConfigModule", _PluginConfigModule_decorators, PluginConfigModule);
84108
- __runInitializers(_init204, 1, PluginConfigModule);
84109
- var _SandboxSettingsModule_decorators, _init205;
84653
+ _init205 = __decoratorStart(null);
84654
+ PluginConfigModule = __decorateElement(_init205, 0, "PluginConfigModule", _PluginConfigModule_decorators, PluginConfigModule);
84655
+ __runInitializers(_init205, 1, PluginConfigModule);
84656
+ var _SandboxSettingsModule_decorators, _init206;
84110
84657
  _SandboxSettingsModule_decorators = [Module23({
84111
84658
  children: [SandboxSettings, SandboxSettingsStatus],
84112
84659
  exports: []
84113
84660
  })];
84114
84661
  var SandboxSettingsModule = class {
84115
84662
  };
84116
- _init205 = __decoratorStart(null);
84117
- SandboxSettingsModule = __decorateElement(_init205, 0, "SandboxSettingsModule", _SandboxSettingsModule_decorators, SandboxSettingsModule);
84118
- __runInitializers(_init205, 1, SandboxSettingsModule);
84119
- var _ObservabilityModule_decorators, _init206;
84663
+ _init206 = __decoratorStart(null);
84664
+ SandboxSettingsModule = __decorateElement(_init206, 0, "SandboxSettingsModule", _SandboxSettingsModule_decorators, SandboxSettingsModule);
84665
+ __runInitializers(_init206, 1, SandboxSettingsModule);
84666
+ var _ObservabilityModule_decorators, _init207;
84120
84667
  _ObservabilityModule_decorators = [Module23({
84121
84668
  children: [ErrorsRepo, ErrorRecorder, UsageRepo, UsageRecorder, UsageService, StorageService],
84122
84669
  exports: [ErrorLog, Errors, UsageStore, UsageRecording, UsageQueries, StorageAdmin]
84123
84670
  })];
84124
84671
  var ObservabilityModule = class {
84125
84672
  };
84126
- _init206 = __decoratorStart(null);
84127
- ObservabilityModule = __decorateElement(_init206, 0, "ObservabilityModule", _ObservabilityModule_decorators, ObservabilityModule);
84128
- __runInitializers(_init206, 1, ObservabilityModule);
84129
- var _TracesModule_decorators, _init207;
84673
+ _init207 = __decoratorStart(null);
84674
+ ObservabilityModule = __decorateElement(_init207, 0, "ObservabilityModule", _ObservabilityModule_decorators, ObservabilityModule);
84675
+ __runInitializers(_init207, 1, ObservabilityModule);
84676
+ var _TracesModule_decorators, _init208;
84130
84677
  _TracesModule_decorators = [Module23({
84131
84678
  children: [TraceIndexRepo, TraceIndexService, TraceService],
84132
84679
  exports: [TraceIndexStore, TraceIndex, Traces]
84133
84680
  })];
84134
84681
  var TracesModule = class {
84135
84682
  };
84136
- _init207 = __decoratorStart(null);
84137
- TracesModule = __decorateElement(_init207, 0, "TracesModule", _TracesModule_decorators, TracesModule);
84138
- __runInitializers(_init207, 1, TracesModule);
84139
- var _AgentsModule_decorators, _init208;
84683
+ _init208 = __decoratorStart(null);
84684
+ TracesModule = __decorateElement(_init208, 0, "TracesModule", _TracesModule_decorators, TracesModule);
84685
+ __runInitializers(_init208, 1, TracesModule);
84686
+ var _AgentsModule_decorators, _init209;
84140
84687
  _AgentsModule_decorators = [Module23({
84141
84688
  children: [
84142
84689
  AgentConfigService,
@@ -84151,20 +84698,20 @@ _AgentsModule_decorators = [Module23({
84151
84698
  })];
84152
84699
  var AgentsModule = class {
84153
84700
  };
84154
- _init208 = __decoratorStart(null);
84155
- AgentsModule = __decorateElement(_init208, 0, "AgentsModule", _AgentsModule_decorators, AgentsModule);
84156
- __runInitializers(_init208, 1, AgentsModule);
84157
- var _WorkspaceModule_decorators, _init209;
84701
+ _init209 = __decoratorStart(null);
84702
+ AgentsModule = __decorateElement(_init209, 0, "AgentsModule", _AgentsModule_decorators, AgentsModule);
84703
+ __runInitializers(_init209, 1, AgentsModule);
84704
+ var _WorkspaceModule_decorators, _init210;
84158
84705
  _WorkspaceModule_decorators = [Module23({
84159
84706
  children: [WorkspaceFilesService, RevealService, PreviewModule],
84160
84707
  exports: [WorkspaceFiles, FileReveal, PreviewTokens]
84161
84708
  })];
84162
84709
  var WorkspaceModule = class {
84163
84710
  };
84164
- _init209 = __decoratorStart(null);
84165
- WorkspaceModule = __decorateElement(_init209, 0, "WorkspaceModule", _WorkspaceModule_decorators, WorkspaceModule);
84166
- __runInitializers(_init209, 1, WorkspaceModule);
84167
- var _MessagingHubModule_decorators, _init210;
84711
+ _init210 = __decoratorStart(null);
84712
+ WorkspaceModule = __decorateElement(_init210, 0, "WorkspaceModule", _WorkspaceModule_decorators, WorkspaceModule);
84713
+ __runInitializers(_init210, 1, WorkspaceModule);
84714
+ var _MessagingHubModule_decorators, _init211;
84168
84715
  _MessagingHubModule_decorators = [Module23({
84169
84716
  children: [
84170
84717
  FeishuSdkProvider,
@@ -84181,20 +84728,20 @@ _MessagingHubModule_decorators = [Module23({
84181
84728
  })];
84182
84729
  var MessagingHubModule = class {
84183
84730
  };
84184
- _init210 = __decoratorStart(null);
84185
- MessagingHubModule = __decorateElement(_init210, 0, "MessagingHubModule", _MessagingHubModule_decorators, MessagingHubModule);
84186
- __runInitializers(_init210, 1, MessagingHubModule);
84187
- var _CompanyModule_decorators, _init211;
84731
+ _init211 = __decoratorStart(null);
84732
+ MessagingHubModule = __decorateElement(_init211, 0, "MessagingHubModule", _MessagingHubModule_decorators, MessagingHubModule);
84733
+ __runInitializers(_init211, 1, MessagingHubModule);
84734
+ var _CompanyModule_decorators, _init212;
84188
84735
  _CompanyModule_decorators = [Module23({
84189
84736
  children: [OrgCacheRepo, OrganizationModule, OrgRoutes],
84190
84737
  exports: [OrgCache, OrgService, OrgScheduler]
84191
84738
  })];
84192
84739
  var CompanyModule = class {
84193
84740
  };
84194
- _init211 = __decoratorStart(null);
84195
- CompanyModule = __decorateElement(_init211, 0, "CompanyModule", _CompanyModule_decorators, CompanyModule);
84196
- __runInitializers(_init211, 1, CompanyModule);
84197
- var _ApiModule_decorators, _init212;
84741
+ _init212 = __decoratorStart(null);
84742
+ CompanyModule = __decorateElement(_init212, 0, "CompanyModule", _CompanyModule_decorators, CompanyModule);
84743
+ __runInitializers(_init212, 1, CompanyModule);
84744
+ var _ApiModule_decorators, _init213;
84198
84745
  _ApiModule_decorators = [Module23({
84199
84746
  children: [
84200
84747
  GlobalFetch,
@@ -84206,6 +84753,7 @@ _ApiModule_decorators = [Module23({
84206
84753
  InstallRoutes,
84207
84754
  VersionRoutes,
84208
84755
  FeedbackRoutes,
84756
+ AsrRoutes,
84209
84757
  HmrRoutes,
84210
84758
  DesktopRoutes,
84211
84759
  DesktopUpdateRoutes,
@@ -84224,30 +84772,30 @@ _ApiModule_decorators = [Module23({
84224
84772
  })];
84225
84773
  var ApiModule = class {
84226
84774
  };
84227
- _init212 = __decoratorStart(null);
84228
- ApiModule = __decorateElement(_init212, 0, "ApiModule", _ApiModule_decorators, ApiModule);
84229
- __runInitializers(_init212, 1, ApiModule);
84230
- var _WorkflowsModule_decorators, _init213;
84775
+ _init213 = __decoratorStart(null);
84776
+ ApiModule = __decorateElement(_init213, 0, "ApiModule", _ApiModule_decorators, ApiModule);
84777
+ __runInitializers(_init213, 1, ApiModule);
84778
+ var _WorkflowsModule_decorators, _init214;
84231
84779
  _WorkflowsModule_decorators = [Module23({
84232
84780
  children: [WorkflowService, WorkflowRoutes],
84233
84781
  exports: [Workflows]
84234
84782
  })];
84235
84783
  var WorkflowsModule = class {
84236
84784
  };
84237
- _init213 = __decoratorStart(null);
84238
- WorkflowsModule = __decorateElement(_init213, 0, "WorkflowsModule", _WorkflowsModule_decorators, WorkflowsModule);
84239
- __runInitializers(_init213, 1, WorkflowsModule);
84240
- var _ServerBrowserModule_decorators, _init214;
84785
+ _init214 = __decoratorStart(null);
84786
+ WorkflowsModule = __decorateElement(_init214, 0, "WorkflowsModule", _WorkflowsModule_decorators, WorkflowsModule);
84787
+ __runInitializers(_init214, 1, WorkflowsModule);
84788
+ var _ServerBrowserModule_decorators, _init215;
84241
84789
  _ServerBrowserModule_decorators = [Module23({
84242
84790
  children: [ServerBrowserService, ServerBrowserRoutes],
84243
84791
  exports: [ServerBrowser]
84244
84792
  })];
84245
84793
  var ServerBrowserModule = class {
84246
84794
  };
84247
- _init214 = __decoratorStart(null);
84248
- ServerBrowserModule = __decorateElement(_init214, 0, "ServerBrowserModule", _ServerBrowserModule_decorators, ServerBrowserModule);
84249
- __runInitializers(_init214, 1, ServerBrowserModule);
84250
- var _PlatformModule_decorators, _init215;
84795
+ _init215 = __decoratorStart(null);
84796
+ ServerBrowserModule = __decorateElement(_init215, 0, "ServerBrowserModule", _ServerBrowserModule_decorators, ServerBrowserModule);
84797
+ __runInitializers(_init215, 1, ServerBrowserModule);
84798
+ var _PlatformModule_decorators, _init216;
84251
84799
  _PlatformModule_decorators = [Module23({
84252
84800
  children: [
84253
84801
  RuntimeModule,
@@ -84277,9 +84825,9 @@ _PlatformModule_decorators = [Module23({
84277
84825
  })];
84278
84826
  var PlatformModule = class {
84279
84827
  };
84280
- _init215 = __decoratorStart(null);
84281
- PlatformModule = __decorateElement(_init215, 0, "PlatformModule", _PlatformModule_decorators, PlatformModule);
84282
- __runInitializers(_init215, 1, PlatformModule);
84828
+ _init216 = __decoratorStart(null);
84829
+ PlatformModule = __decorateElement(_init216, 0, "PlatformModule", _PlatformModule_decorators, PlatformModule);
84830
+ __runInitializers(_init216, 1, PlatformModule);
84283
84831
  function platformDef(caps, adoptable, plugins = [], replace = /* @__PURE__ */ new Map(), reassemble = async (change) => {
84284
84832
  await change?.write();
84285
84833
  return false;
@@ -84570,7 +85118,7 @@ function bareTree(plugins, replace = /* @__PURE__ */ new Map()) {
84570
85118
  };
84571
85119
  }
84572
85120
  function bareApp(terminals, identity) {
84573
- const app = new Hono55();
85121
+ const app = new Hono56();
84574
85122
  app.notFound(() => declined());
84575
85123
  app.route("/", terminalRoutes(terminals, identity));
84576
85124
  return app;
@@ -84720,7 +85268,7 @@ function createApp(boot3) {
84720
85268
  control: boot3.control,
84721
85269
  channels: boot3.channels
84722
85270
  };
84723
- const app = new Hono56();
85271
+ const app = new Hono57();
84724
85272
  app.onError((err, c) => {
84725
85273
  const projectId = attributedProjectId(c, { access: access2() });
84726
85274
  const normalized = normalizeError(err);