@nyte-ai/host 0.0.18 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/THIRD-PARTY-NOTICES.md +66 -0
  2. package/dist/chunks/{canvas-preview-rp6fz0w5.js → canvas-preview-2jwbe14k.js} +5 -5
  3. package/dist/chunks/{canvas-preview-j1tnf51w.js → canvas-preview-3a6tst4d.js} +1 -1
  4. package/dist/chunks/{canvas-preview-m02v4yy6.js → canvas-preview-55s0y68g.js} +3 -2
  5. package/dist/chunks/{canvas-preview-xn10d4f8.js → canvas-preview-5ekjx6sw.js} +9 -4
  6. package/dist/chunks/{canvas-preview-g3qj3y3k.js → canvas-preview-8hr08aeh.js} +13 -3
  7. package/dist/chunks/{canvas-preview-75db60xy.js → canvas-preview-8xc0vn7v.js} +5 -4
  8. package/dist/chunks/{canvas-preview-zn2d0k9d.js → canvas-preview-af86jz8t.js} +14 -6
  9. package/dist/chunks/{canvas-preview-d9wwhbtz.js → canvas-preview-aq5j4p25.js} +1 -1
  10. package/dist/chunks/{canvas-preview-ewgspmsd.js → canvas-preview-b3r1tna2.js} +1 -1
  11. package/dist/chunks/canvas-preview-befkjea2.js +60 -0
  12. package/dist/chunks/canvas-preview-bxnqt8cd.js +103 -0
  13. package/dist/chunks/{canvas-preview-senpjwep.js → canvas-preview-crmzxxt8.js} +3 -3
  14. package/dist/chunks/{canvas-preview-ymgz0937.js → canvas-preview-drctegz4.js} +8 -4
  15. package/dist/chunks/{canvas-preview-yrfz2ak6.js → canvas-preview-e3vnkkc5.js} +6 -6
  16. package/dist/chunks/canvas-preview-ec2mt7es.js +108 -0
  17. package/dist/chunks/{canvas-preview-0nrnbt76.js → canvas-preview-eehzfefa.js} +199 -125
  18. package/dist/chunks/{canvas-preview-5hxat7hh.js → canvas-preview-geg2gckp.js} +8 -6
  19. package/dist/chunks/{canvas-preview-8xgt67ka.js → canvas-preview-gh7c9831.js} +20 -16
  20. package/dist/chunks/{canvas-preview-1ta3avah.js → canvas-preview-k2xaz0ym.js} +10 -5
  21. package/dist/chunks/canvas-preview-kp75gb63.js +141 -0
  22. package/dist/chunks/{canvas-preview-evh92ywd.js → canvas-preview-mstbvwz3.js} +26 -11
  23. package/dist/chunks/{canvas-preview-h8hshnff.js → canvas-preview-pkzqg96v.js} +1 -1
  24. package/dist/chunks/{canvas-preview-ehf3vp31.js → canvas-preview-vm9zdp2t.js} +45 -58
  25. package/dist/chunks/{canvas-preview-76fwvd6e.js → canvas-preview-w54ymtb3.js} +1 -1
  26. package/dist/chunks/canvas-preview-y5y6ghaw.js +125 -0
  27. package/dist/chunks/{canvas-preview-vax9ne4e.js → canvas-preview-y7kq0c8q.js} +22 -11
  28. package/dist/chunks/{canvas-preview-98aj5p34.js → canvas-preview-ycepb05s.js} +1 -1
  29. package/dist/src/canvas-preview.js +7 -3
  30. package/dist/src/deploy/cloudflare/worker.js +1 -1
  31. package/dist/src/deploy/vercel/server/routes/[...].js +2 -2
  32. package/dist/src/deploy/vercel/server/utils/host.js +1 -1
  33. package/dist/src/deploy/vercel/server/workflows/drive.js +3 -3
  34. package/dist/src/images/exif.d.ts +1 -0
  35. package/dist/src/images/exif.js +6 -0
  36. package/dist/src/images/node.d.ts +37 -0
  37. package/dist/src/images/node.js +12 -0
  38. package/dist/src/images/photon.d.ts +3 -0
  39. package/dist/src/images/photon.js +7 -0
  40. package/dist/src/images/worker.d.ts +1 -0
  41. package/dist/src/images/worker.js +23 -0
  42. package/dist/src/index.d.ts +0 -1
  43. package/dist/src/index.js +23 -22
  44. package/dist/src/listen-fetch.js +3 -3
  45. package/dist/src/listen.js +4 -4
  46. package/dist/src/local/command.d.ts +5 -0
  47. package/dist/src/local/command.js +6 -2
  48. package/dist/src/local/files.js +2 -2
  49. package/dist/src/local/git-watch.d.ts +1 -1
  50. package/dist/src/local/git-watch.js +1 -1
  51. package/dist/src/local/git.js +3 -3
  52. package/dist/src/local/github.js +2 -2
  53. package/dist/src/local/jobs.d.ts +1 -1
  54. package/dist/src/local/jobs.js +2 -1
  55. package/dist/src/local/provider.js +9 -9
  56. package/dist/src/local/snapshots.js +2 -2
  57. package/dist/src/local/worktrees.js +2 -2
  58. package/dist/src/mcp/connect.d.ts +0 -13
  59. package/dist/src/mcp/connect.js +1 -1
  60. package/dist/src/mcp/hub.js +2 -2
  61. package/dist/src/open.d.ts +2 -30
  62. package/dist/src/open.js +20 -18
  63. package/dist/src/serve/binding.js +1 -1
  64. package/dist/src/serve/handler.js +2 -2
  65. package/dist/src/sqlite.d.ts +2 -1
  66. package/dist/src/sqlite.js +4 -3
  67. package/dist/src/store-usage.js +4 -1
  68. package/dist/src/usage-history.d.ts +54 -0
  69. package/dist/src/usage-history.js +14 -0
  70. package/dist/src/usage-service.d.ts +2 -1
  71. package/dist/src/usage-service.js +7 -3
  72. package/dist/src/usage-worker.js +8 -4
  73. package/dist/src/usage.d.ts +150 -27
  74. package/dist/src/usage.js +12 -2
  75. package/package.json +16 -8
  76. package/src/canvas-preview.ts +4 -3
  77. package/src/images/exif.ts +69 -0
  78. package/src/images/node.ts +163 -0
  79. package/src/images/photon.ts +141 -0
  80. package/src/images/worker.ts +29 -0
  81. package/src/index.ts +19 -1
  82. package/src/local/command.ts +64 -12
  83. package/src/local/files.ts +8 -3
  84. package/src/local/git-watch.ts +16 -6
  85. package/src/local/git.ts +7 -2
  86. package/src/local/github.ts +3 -4
  87. package/src/local/jobs.ts +55 -69
  88. package/src/local/snapshots.ts +4 -2
  89. package/src/local/worktrees.ts +4 -4
  90. package/src/mcp/connect.ts +1 -14
  91. package/src/mcp/hub.ts +18 -9
  92. package/src/open.ts +16 -36
  93. package/src/serve/binding.ts +4 -3
  94. package/src/sqlite.ts +46 -9
  95. package/src/store-usage.ts +5 -2
  96. package/src/usage-history.ts +219 -0
  97. package/src/usage-service.ts +12 -3
  98. package/src/usage.ts +251 -176
  99. package/dist/chunks/canvas-preview-a3yw0j70.js +0 -72
  100. package/dist/chunks/canvas-preview-azg56359.js +0 -68
  101. package/dist/src/store-owner.d.ts +0 -15
  102. package/dist/src/store-owner.js +0 -9
  103. package/src/store-owner.ts +0 -98
@@ -0,0 +1,125 @@
1
+ import {
2
+ photonImages2
3
+ } from "./canvas-preview-ec2mt7es.js";
4
+
5
+ // src/images/node.ts
6
+ import { readFile } from "node:fs/promises";
7
+ import { fileURLToPath } from "node:url";
8
+ import { Worker } from "node:worker_threads";
9
+ import { Type } from "typebox";
10
+ import { Value } from "typebox/value";
11
+ var size = Type.Object({ width: Type.Number(), height: Type.Number() });
12
+ var prepareReply2 = Type.Union([
13
+ Type.Object({ id: Type.Integer(), result: Type.Null() }),
14
+ Type.Object({
15
+ id: Type.Integer(),
16
+ result: Type.Object({
17
+ data: Type.String(),
18
+ mimeType: Type.String(),
19
+ resized: Type.Optional(Type.Object({ from: size, to: size }))
20
+ })
21
+ }),
22
+ Type.Object({ id: Type.Integer(), error: Type.String() })
23
+ ]);
24
+ var IDLE_MS = 30000;
25
+ function nodeImages2(options = {}) {
26
+ const worker = options.worker ?? new URL(import.meta.url.endsWith(".ts") ? "./worker.ts" : "./worker.js", import.meta.url);
27
+ let wasm;
28
+ const loadWasm = () => wasm ??= readFile(options.wasm ?? resolvePhotonWasmPath2());
29
+ let thread;
30
+ let inProcess;
31
+ return {
32
+ async prepare(bytes, mimeType, limits) {
33
+ if (inProcess !== undefined)
34
+ return inProcess.prepare(bytes, mimeType, limits);
35
+ const module = await loadWasm();
36
+ try {
37
+ thread ??= new PhotonThread(worker, module, (ended) => {
38
+ if (thread === ended)
39
+ thread = undefined;
40
+ });
41
+ return await thread.prepare(bytes, mimeType, limits);
42
+ } catch (cause) {
43
+ if (!(cause instanceof WorkerUnavailable))
44
+ throw cause;
45
+ inProcess ??= photonImages2(module);
46
+ return inProcess.prepare(bytes, mimeType, limits);
47
+ }
48
+ }
49
+ };
50
+ }
51
+ function resolvePhotonWasmPath2() {
52
+ return fileURLToPath(import.meta.resolve("@silvia-odwyer/photon/photon_rs_bg.wasm"));
53
+ }
54
+
55
+ class WorkerUnavailable extends Error {
56
+ }
57
+
58
+ class PhotonThread {
59
+ #worker;
60
+ #pending = new Map;
61
+ #onExit;
62
+ #nextId = 0;
63
+ #idle;
64
+ #started = false;
65
+ constructor(entry, wasm, onExit) {
66
+ this.#onExit = onExit;
67
+ try {
68
+ this.#worker = new Worker(entry, { workerData: wasm });
69
+ } catch (cause) {
70
+ throw new WorkerUnavailable("The image worker cannot start", { cause });
71
+ }
72
+ this.#worker.on("message", (reply) => {
73
+ if (!Value.Check(prepareReply2, reply)) {
74
+ this.#fail(new Error("Malformed image worker reply"));
75
+ this.#worker.terminate();
76
+ return;
77
+ }
78
+ this.#started = true;
79
+ const request = this.#pending.get(reply.id);
80
+ if (request === undefined)
81
+ return;
82
+ this.#pending.delete(reply.id);
83
+ if ("error" in reply)
84
+ request.reject(new Error(reply.error));
85
+ else
86
+ request.resolve(reply.result ?? undefined);
87
+ this.#settled();
88
+ });
89
+ this.#worker.on("error", (cause) => this.#fail(cause));
90
+ this.#worker.on("exit", (code) => this.#fail(new Error(`The image worker exited with code ${String(code)}`)));
91
+ }
92
+ prepare(bytes, mimeType, limits) {
93
+ const id = this.#nextId++;
94
+ const request = Promise.withResolvers();
95
+ this.#pending.set(id, request);
96
+ clearTimeout(this.#idle);
97
+ this.#idle = undefined;
98
+ this.#worker.ref();
99
+ const copy = bytes.slice();
100
+ this.#worker.postMessage({ id, bytes: copy, mimeType, limits }, [
101
+ copy.buffer
102
+ ]);
103
+ return request.promise;
104
+ }
105
+ #settled() {
106
+ if (this.#pending.size > 0)
107
+ return;
108
+ this.#worker.unref();
109
+ this.#idle = setTimeout(() => {
110
+ this.#onExit(this);
111
+ this.#worker.terminate();
112
+ }, IDLE_MS);
113
+ this.#idle.unref();
114
+ }
115
+ #fail(cause) {
116
+ const failure = this.#started ? cause : new WorkerUnavailable("The image worker cannot start", { cause });
117
+ for (const request of this.#pending.values())
118
+ request.reject(failure);
119
+ this.#pending.clear();
120
+ clearTimeout(this.#idle);
121
+ this.#onExit(this);
122
+ }
123
+ }
124
+
125
+ export { prepareReply2, nodeImages2, resolvePhotonWasmPath2 };
@@ -9,10 +9,10 @@ import {
9
9
  } from "./canvas-preview-5mex725c.js";
10
10
  import {
11
11
  localGitHubAccount2
12
- } from "./canvas-preview-75db60xy.js";
12
+ } from "./canvas-preview-8xc0vn7v.js";
13
13
  import {
14
14
  localProvider2
15
- } from "./canvas-preview-yrfz2ak6.js";
15
+ } from "./canvas-preview-e3vnkkc5.js";
16
16
  import {
17
17
  importLegacyTrust2
18
18
  } from "./canvas-preview-9aqczacs.js";
@@ -21,10 +21,13 @@ import {
21
21
  } from "./canvas-preview-4e0pxa32.js";
22
22
  import {
23
23
  listen2
24
- } from "./canvas-preview-98aj5p34.js";
24
+ } from "./canvas-preview-ycepb05s.js";
25
+ import {
26
+ nodeImages2
27
+ } from "./canvas-preview-y5y6ghaw.js";
25
28
  import {
26
29
  createMcpHub2
27
- } from "./canvas-preview-8xgt67ka.js";
30
+ } from "./canvas-preview-gh7c9831.js";
28
31
  import {
29
32
  loadPluginDirectory2,
30
33
  pluginLoader2
@@ -33,17 +36,18 @@ import {
33
36
  defaultSecrets2
34
37
  } from "./canvas-preview-skzwvw4d.js";
35
38
  import {
39
+ storePath2,
36
40
  sqliteStore2
37
- } from "./canvas-preview-evh92ywd.js";
41
+ } from "./canvas-preview-mstbvwz3.js";
38
42
  import {
39
43
  package_default
40
- } from "./canvas-preview-g3qj3y3k.js";
44
+ } from "./canvas-preview-8hr08aeh.js";
41
45
 
42
46
  // src/open.ts
43
47
  import { watch } from "node:fs";
44
48
  import { mkdir, readFile } from "node:fs/promises";
45
49
  import { homedir, hostname } from "node:os";
46
- import { join } from "node:path";
50
+ import { dirname, join } from "node:path";
47
51
  import process from "node:process";
48
52
  import { defaultProviderAuthContext } from "@nyte-ai/ai/auth/context";
49
53
  import { FileModelsStore, nyteProviders } from "@nyte-ai/ai";
@@ -84,8 +88,9 @@ async function openHost2(options) {
84
88
  }
85
89
  }
86
90
  async function defaultStore(home) {
87
- await mkdir(join(home, ".nyte"), { recursive: true, mode: 448 });
88
- return sqliteStore2({ path: join(home, ".nyte", "nyte.db") });
91
+ const path = storePath2(home);
92
+ await mkdir(dirname(path), { recursive: true, mode: 448 });
93
+ return sqliteStore2({ path });
89
94
  }
90
95
  async function composeOpen(options, input) {
91
96
  const { home, workspace, store, owned } = input;
@@ -115,7 +120,6 @@ async function composeOpen(options, input) {
115
120
  openaiAstraContext,
116
121
  telemetry,
117
122
  canvas,
118
- browserTools,
119
123
  claudeCode.plugin,
120
124
  acp.plugin
121
125
  ];
@@ -133,13 +137,20 @@ async function composeOpen(options, input) {
133
137
  models,
134
138
  mcp: options.mcp ?? createMcpHub2({ home }),
135
139
  github: options.github ?? (usesLocalProvider ? localGitHubAccount2({ home }) : undefined),
140
+ images: options.images ?? nodeImages2(),
136
141
  plugins: [...plugins, ...files.plugins],
137
142
  pluginSources: files.sources,
138
143
  secrets,
139
144
  home,
140
145
  description,
141
146
  ...settings.seed === null ? {} : { seed: settings.seed },
142
- ...owned === null ? {} : { poll: STORE_POLL_MS }
147
+ ...owned === null ? {} : { poll: STORE_POLL_MS },
148
+ member: {
149
+ label: options.label ?? "nyte",
150
+ pid: process.pid,
151
+ capabilities: given.some((plugin) => plugin.id === browserTools.id) ? [browserTools.id] : []
152
+ },
153
+ revoked: options.onRevoked
143
154
  });
144
155
  projectDirs = async () => (await host.workspaces.list()).flatMap((entry) => entry.trusted === true && ("path" in entry.target) ? [join(entry.target.path, ".nyte", "plugins")] : []);
145
156
  for (const row of files.failed)
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  listenFetch2
3
- } from "./canvas-preview-76fwvd6e.js";
3
+ } from "./canvas-preview-w54ymtb3.js";
4
4
 
5
5
  // src/listen.ts
6
6
  import { createServer } from "node:http";
@@ -1,3 +1,7 @@
1
+ import {
2
+ killTree2
3
+ } from "../chunks/canvas-preview-bxnqt8cd.js";
4
+
1
5
  // src/canvas-preview.ts
2
6
  import { spawn } from "node:child_process";
3
7
  import { existsSync, readdirSync } from "node:fs";
@@ -192,12 +196,12 @@ function stop(child) {
192
196
  if (child.exitCode !== null || child.signalCode !== null)
193
197
  return Promise.resolve();
194
198
  return new Promise((resolve) => {
195
- const kill = setTimeout(() => child.kill("SIGKILL"), 2000);
199
+ const kill = setTimeout(() => killTree2(child, "SIGKILL"), 2000);
196
200
  child.once("exit", () => {
197
201
  clearTimeout(kill);
198
202
  resolve();
199
203
  });
200
- child.kill();
204
+ killTree2(child, "SIGTERM");
201
205
  });
202
206
  }
203
207
  function chromiumCanvasPreview(shell, executable = findChromium) {
@@ -257,7 +261,7 @@ function chromiumCanvasPreview(shell, executable = findChromium) {
257
261
  }
258
262
  } finally {
259
263
  await stop(child);
260
- await rm(profile, { recursive: true, force: true });
264
+ await rm(profile, { recursive: true, force: true, maxRetries: 10 });
261
265
  }
262
266
  };
263
267
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "../../../chunks/canvas-preview-g3qj3y3k.js";
3
+ } from "../../../chunks/canvas-preview-8hr08aeh.js";
4
4
 
5
5
  // src/deploy/cloudflare/worker.ts
6
6
  import { asId, SdkError } from "@nyte-ai/schema";
@@ -1,11 +1,11 @@
1
1
  import"../../../../../chunks/canvas-preview-2zdyh9ny.js";
2
2
  import {
3
3
  vercelHost2
4
- } from "../../../../../chunks/canvas-preview-ewgspmsd.js";
4
+ } from "../../../../../chunks/canvas-preview-b3r1tna2.js";
5
5
  import"../../../../../chunks/canvas-preview-65xqjw7f.js";
6
6
  import {
7
7
  dispatchHead2
8
- } from "../../../../../chunks/canvas-preview-j1tnf51w.js";
8
+ } from "../../../../../chunks/canvas-preview-3a6tst4d.js";
9
9
 
10
10
  // src/deploy/vercel/server/routes/[...].ts
11
11
  import { defineHandler } from "nitro/h3";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  vercelHost2
3
- } from "../../../../../chunks/canvas-preview-ewgspmsd.js";
3
+ } from "../../../../../chunks/canvas-preview-b3r1tna2.js";
4
4
  import"../../../../../chunks/canvas-preview-2zdyh9ny.js";
5
5
  export {
6
6
  vercelHost2 as vercelHost
@@ -2,10 +2,10 @@ import {
2
2
  dispatchHead2,
3
3
  driveHead2,
4
4
  advanceHead2
5
- } from "../../../../../chunks/canvas-preview-j1tnf51w.js";
6
- import"../../../../../chunks/canvas-preview-65xqjw7f.js";
7
- import"../../../../../chunks/canvas-preview-ewgspmsd.js";
5
+ } from "../../../../../chunks/canvas-preview-3a6tst4d.js";
6
+ import"../../../../../chunks/canvas-preview-b3r1tna2.js";
8
7
  import"../../../../../chunks/canvas-preview-2zdyh9ny.js";
8
+ import"../../../../../chunks/canvas-preview-65xqjw7f.js";
9
9
  export {
10
10
  advanceHead2 as advanceHead,
11
11
  dispatchHead2 as dispatchHead,
@@ -0,0 +1 @@
1
+ export declare function exifOrientation(bytes: Uint8Array): number;
@@ -0,0 +1,6 @@
1
+ import {
2
+ exifOrientation2
3
+ } from "../../chunks/canvas-preview-befkjea2.js";
4
+ export {
5
+ exifOrientation2 as exifOrientation
6
+ };
@@ -0,0 +1,37 @@
1
+ import type { ImageLimits, ImageProcessor } from "@nyte-ai/core";
2
+ import { Type } from "typebox";
3
+ export interface NodeImagesOptions {
4
+ readonly worker?: string | URL;
5
+ readonly wasm?: string;
6
+ }
7
+ export interface PrepareRequest {
8
+ readonly id: number;
9
+ readonly bytes: Uint8Array;
10
+ readonly mimeType: string;
11
+ readonly limits: ImageLimits;
12
+ }
13
+ export declare const prepareReply: Type.TUnion<[Type.TObject<{
14
+ id: Type.TInteger;
15
+ result: Type.TNull;
16
+ }>, Type.TObject<{
17
+ id: Type.TInteger;
18
+ result: Type.TObject<{
19
+ data: Type.TString;
20
+ mimeType: Type.TString;
21
+ resized: Type.TOptional<Type.TObject<{
22
+ from: Type.TObject<{
23
+ width: Type.TNumber;
24
+ height: Type.TNumber;
25
+ }>;
26
+ to: Type.TObject<{
27
+ width: Type.TNumber;
28
+ height: Type.TNumber;
29
+ }>;
30
+ }>>;
31
+ }>;
32
+ }>, Type.TObject<{
33
+ id: Type.TInteger;
34
+ error: Type.TString;
35
+ }>]>;
36
+ export declare function nodeImages(options?: NodeImagesOptions): ImageProcessor;
37
+ export declare function resolvePhotonWasmPath(): string;
@@ -0,0 +1,12 @@
1
+ import {
2
+ prepareReply2,
3
+ nodeImages2,
4
+ resolvePhotonWasmPath2
5
+ } from "../../chunks/canvas-preview-y5y6ghaw.js";
6
+ import"../../chunks/canvas-preview-ec2mt7es.js";
7
+ import"../../chunks/canvas-preview-befkjea2.js";
8
+ export {
9
+ nodeImages2 as nodeImages,
10
+ prepareReply2 as prepareReply,
11
+ resolvePhotonWasmPath2 as resolvePhotonWasmPath
12
+ };
@@ -0,0 +1,3 @@
1
+ import type { SyncInitInput } from "@silvia-odwyer/photon/photon_rs.js";
2
+ import type { ImageProcessor } from "@nyte-ai/core";
3
+ export declare function photonImages(wasm: SyncInitInput): ImageProcessor;
@@ -0,0 +1,7 @@
1
+ import {
2
+ photonImages2
3
+ } from "../../chunks/canvas-preview-ec2mt7es.js";
4
+ import"../../chunks/canvas-preview-befkjea2.js";
5
+ export {
6
+ photonImages2 as photonImages
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import"../../chunks/canvas-preview-befkjea2.js";
2
+ import {
3
+ photonImages2
4
+ } from "../../chunks/canvas-preview-ec2mt7es.js";
5
+
6
+ // src/images/worker.ts
7
+ import { parentPort, workerData } from "node:worker_threads";
8
+ var port = parentPort;
9
+ if (port === null)
10
+ throw new Error("The image worker needs a parent thread");
11
+ var wasm = workerData;
12
+ if (!(wasm instanceof Uint8Array))
13
+ throw new Error("The image worker needs Photon's WebAssembly");
14
+ var images = photonImages2(wasm);
15
+ port.on("message", (request) => {
16
+ images.prepare(request.bytes, request.mimeType, request.limits).then((result) => port.postMessage({
17
+ id: request.id,
18
+ result: result ?? null
19
+ }), (cause) => port.postMessage({
20
+ id: request.id,
21
+ error: cause instanceof Error ? cause.message : String(cause)
22
+ }));
23
+ });
@@ -18,4 +18,3 @@ export * from "./plugins/loader.ts";
18
18
  export * from "./postgres.ts";
19
19
  export * from "./secrets.ts";
20
20
  export * from "./sqlite.ts";
21
- export { StoreOwned } from "./store-owner.ts";
package/dist/src/index.js CHANGED
@@ -11,59 +11,62 @@ import"../chunks/canvas-preview-wg80rbc2.js";
11
11
  import {
12
12
  identitySigner2
13
13
  } from "../chunks/canvas-preview-5mex725c.js";
14
- import"../chunks/canvas-preview-m02v4yy6.js";
14
+ import"../chunks/canvas-preview-55s0y68g.js";
15
15
  import"../chunks/canvas-preview-rp4x6y1h.js";
16
- import"../chunks/canvas-preview-d9wwhbtz.js";
16
+ import"../chunks/canvas-preview-aq5j4p25.js";
17
17
  import {
18
18
  listenFetch2
19
- } from "../chunks/canvas-preview-76fwvd6e.js";
19
+ } from "../chunks/canvas-preview-w54ymtb3.js";
20
20
  import {
21
21
  listen2
22
- } from "../chunks/canvas-preview-98aj5p34.js";
22
+ } from "../chunks/canvas-preview-ycepb05s.js";
23
23
  import"../chunks/canvas-preview-0nq75h9k.js";
24
- import"../chunks/canvas-preview-azg56359.js";
24
+ import"../chunks/canvas-preview-bxnqt8cd.js";
25
25
  import"../chunks/canvas-preview-yjz0f7n4.js";
26
26
  import"../chunks/canvas-preview-kn7kvbfj.js";
27
27
  import {
28
28
  TEXT_LIMIT2,
29
29
  localFiles2
30
- } from "../chunks/canvas-preview-ymgz0937.js";
30
+ } from "../chunks/canvas-preview-drctegz4.js";
31
31
  import"../chunks/canvas-preview-tjhabynd.js";
32
- import"../chunks/canvas-preview-zn2d0k9d.js";
32
+ import"../chunks/canvas-preview-af86jz8t.js";
33
33
  import {
34
34
  localGit2
35
- } from "../chunks/canvas-preview-xn10d4f8.js";
35
+ } from "../chunks/canvas-preview-5ekjx6sw.js";
36
36
  import {
37
37
  localGitHubAccount2,
38
38
  localGitHub2
39
- } from "../chunks/canvas-preview-75db60xy.js";
39
+ } from "../chunks/canvas-preview-8xc0vn7v.js";
40
40
  import {
41
41
  folderIdentity2
42
42
  } from "../chunks/canvas-preview-1sq7z9jq.js";
43
43
  import {
44
44
  localExec2
45
- } from "../chunks/canvas-preview-ehf3vp31.js";
45
+ } from "../chunks/canvas-preview-vm9zdp2t.js";
46
46
  import {
47
47
  localSnapshots2
48
- } from "../chunks/canvas-preview-senpjwep.js";
48
+ } from "../chunks/canvas-preview-crmzxxt8.js";
49
49
  import {
50
50
  listWorktrees2,
51
51
  addWorktree2,
52
52
  hasBranch2,
53
53
  localWorktrees2
54
- } from "../chunks/canvas-preview-rp6fz0w5.js";
54
+ } from "../chunks/canvas-preview-2jwbe14k.js";
55
55
  import {
56
56
  localProvider2
57
- } from "../chunks/canvas-preview-yrfz2ak6.js";
57
+ } from "../chunks/canvas-preview-e3vnkkc5.js";
58
58
  import"../chunks/canvas-preview-kdqgrstc.js";
59
59
  import"../chunks/canvas-preview-5z63am63.js";
60
- import"../chunks/canvas-preview-h8hshnff.js";
60
+ import"../chunks/canvas-preview-pkzqg96v.js";
61
61
  import"../chunks/canvas-preview-vaatfznm.js";
62
62
  import {
63
63
  createMcpHub2
64
- } from "../chunks/canvas-preview-8xgt67ka.js";
64
+ } from "../chunks/canvas-preview-gh7c9831.js";
65
65
  import"../chunks/canvas-preview-9aqczacs.js";
66
66
  import"../chunks/canvas-preview-4e0pxa32.js";
67
+ import"../chunks/canvas-preview-befkjea2.js";
68
+ import"../chunks/canvas-preview-ec2mt7es.js";
69
+ import"../chunks/canvas-preview-y5y6ghaw.js";
67
70
  import {
68
71
  loadPluginFiles2,
69
72
  loadPluginDirectory2,
@@ -76,19 +79,16 @@ import"../chunks/canvas-preview-69fkk9yn.js";
76
79
  import"../chunks/canvas-preview-zaaj99wd.js";
77
80
  import"../chunks/canvas-preview-0cmbkp2j.js";
78
81
  import {
79
- StoreOwned2
80
- } from "../chunks/canvas-preview-a3yw0j70.js";
81
- import {
82
+ storePath2,
82
83
  sqliteStore2
83
- } from "../chunks/canvas-preview-evh92ywd.js";
84
+ } from "../chunks/canvas-preview-mstbvwz3.js";
84
85
  import {
85
86
  openHost2
86
- } from "../chunks/canvas-preview-vax9ne4e.js";
87
+ } from "../chunks/canvas-preview-y7kq0c8q.js";
87
88
  import {
88
89
  postgresStore2
89
90
  } from "../chunks/canvas-preview-4b6sayhg.js";
90
91
  export {
91
- StoreOwned2 as StoreOwned,
92
92
  TEXT_LIMIT2 as TEXT_LIMIT,
93
93
  addWorktree2 as addWorktree,
94
94
  createMcpHub2 as createMcpHub,
@@ -116,5 +116,6 @@ export {
116
116
  postgresStore2 as postgresStore,
117
117
  sealSecret2 as sealSecret,
118
118
  seedSigner2 as seedSigner,
119
- sqliteStore2 as sqliteStore
119
+ sqliteStore2 as sqliteStore,
120
+ storePath2 as storePath
120
121
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  listenFetch2
3
- } from "../chunks/canvas-preview-76fwvd6e.js";
4
- import"../chunks/canvas-preview-d9wwhbtz.js";
5
- import"../chunks/canvas-preview-m02v4yy6.js";
3
+ } from "../chunks/canvas-preview-w54ymtb3.js";
4
+ import"../chunks/canvas-preview-aq5j4p25.js";
5
+ import"../chunks/canvas-preview-55s0y68g.js";
6
6
  import"../chunks/canvas-preview-rp4x6y1h.js";
7
7
  export {
8
8
  listenFetch2 as listenFetch
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  listen2
3
- } from "../chunks/canvas-preview-98aj5p34.js";
4
- import"../chunks/canvas-preview-76fwvd6e.js";
5
- import"../chunks/canvas-preview-d9wwhbtz.js";
6
- import"../chunks/canvas-preview-m02v4yy6.js";
3
+ } from "../chunks/canvas-preview-ycepb05s.js";
4
+ import"../chunks/canvas-preview-w54ymtb3.js";
5
+ import"../chunks/canvas-preview-aq5j4p25.js";
6
+ import"../chunks/canvas-preview-55s0y68g.js";
7
7
  import"../chunks/canvas-preview-rp4x6y1h.js";
8
8
  export {
9
9
  listen2 as listen
@@ -1,3 +1,4 @@
1
+ import type { ChildProcess, SpawnOptions } from "node:child_process";
1
2
  export type Ran = {
2
3
  readonly code: number | null;
3
4
  readonly stdout: Buffer;
@@ -12,4 +13,8 @@ export declare function run(file: string, args: readonly string[], options: {
12
13
  /** Kills the command after this long; it then ends with a null code. */
13
14
  readonly timeoutMs?: number;
14
15
  }): Promise<Ran>;
16
+ /** Spawns `file` as `spawn` does, except that on Windows a `.cmd` or `.bat` file runs through `cmd.exe` with its arguments escaped, as Node no longer starts batch files without a shell. */
17
+ export declare function spawnCommand(file: string, args: readonly string[], options: SpawnOptions): ChildProcess;
18
+ /** Ends `child` with `signal`; on Windows, which has no signals, it ends the child's whole process tree with `taskkill /T /F`, as `kill` alone would leave what a batch file or a shell started running. */
19
+ export declare function killTree(child: ChildProcess, signal: NodeJS.Signals): void;
15
20
  export declare function findExecutable(name: string, directories?: readonly string[]): Promise<string | null>;
@@ -1,8 +1,12 @@
1
1
  import {
2
2
  run2,
3
+ spawnCommand2,
4
+ killTree2,
3
5
  findExecutable2
4
- } from "../../chunks/canvas-preview-azg56359.js";
6
+ } from "../../chunks/canvas-preview-bxnqt8cd.js";
5
7
  export {
6
8
  findExecutable2 as findExecutable,
7
- run2 as run
9
+ killTree2 as killTree,
10
+ run2 as run,
11
+ spawnCommand2 as spawnCommand
8
12
  };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  TEXT_LIMIT2,
3
3
  localFiles2
4
- } from "../../chunks/canvas-preview-ymgz0937.js";
4
+ } from "../../chunks/canvas-preview-drctegz4.js";
5
5
  import"../../chunks/canvas-preview-kn7kvbfj.js";
6
- import"../../chunks/canvas-preview-azg56359.js";
7
6
  import"../../chunks/canvas-preview-yjz0f7n4.js";
7
+ import"../../chunks/canvas-preview-bxnqt8cd.js";
8
8
  import"../../chunks/canvas-preview-0nq75h9k.js";
9
9
  import"../../chunks/canvas-preview-mgcx2b2p.js";
10
10
  export {
@@ -11,5 +11,5 @@ export type Repository = {
11
11
  export type GitWatcher = {
12
12
  subscribe(listener: (status: GitStatus) => void, fail: FeedSink<GitStatus>["fail"]): Disposer;
13
13
  };
14
- /** Returns the status watch `localGit` shares among its watchers: the first subscriber starts it and the last one stops it, and each gets the status at once, then again whenever a change could move it. A recursive `fs.watch` on the workspace hears worktree paths that `.gitignore` and `.git/info/exclude` do not ignore, and, in the git directory and the common directory, only HEAD, the index, branch and remote refs, `packed-refs`, `config` and the merge, cherry-pick, revert and rebase state, so object writes, logs and Nyte's snapshot refs read nothing; the `.git` entry itself appearing or going drops the remembered repository and starts over. Only where `fs.watch` is unavailable does it poll, every 2 s. */
14
+ /** Returns the status watch `localGit` shares among its watchers: the first subscriber starts it and the last one stops it, and each gets the status at once, then again whenever a change could move it. A recursive `fs.watch` on the workspace hears worktree paths that `.gitignore` and `.git/info/exclude` do not ignore, and, in the git directory and the common directory, only HEAD, the index, branch and remote refs, `packed-refs`, `config` and the merge, cherry-pick, revert and rebase state, so object writes, logs and Nyte's snapshot refs read nothing; the `.git` entry itself appearing or going (not a change inside it, which Windows also reports on the folder) drops the remembered repository and starts over. Only where `fs.watch` is unavailable does it poll, every 2 s. */
15
15
  export declare function createWatcher(cwd: string, read: () => Promise<GitStatus>, repository: () => Promise<Repository | null>, forget: () => void): GitWatcher;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createWatcher2
3
- } from "../../chunks/canvas-preview-zn2d0k9d.js";
3
+ } from "../../chunks/canvas-preview-af86jz8t.js";
4
4
  import"../../chunks/canvas-preview-mgcx2b2p.js";
5
5
  export {
6
6
  createWatcher2 as createWatcher
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  localGit2
3
- } from "../../chunks/canvas-preview-xn10d4f8.js";
3
+ } from "../../chunks/canvas-preview-5ekjx6sw.js";
4
4
  import"../../chunks/canvas-preview-tjhabynd.js";
5
5
  import"../../chunks/canvas-preview-kn7kvbfj.js";
6
- import"../../chunks/canvas-preview-azg56359.js";
7
6
  import"../../chunks/canvas-preview-yjz0f7n4.js";
8
- import"../../chunks/canvas-preview-zn2d0k9d.js";
7
+ import"../../chunks/canvas-preview-af86jz8t.js";
8
+ import"../../chunks/canvas-preview-bxnqt8cd.js";
9
9
  import"../../chunks/canvas-preview-0nq75h9k.js";
10
10
  import"../../chunks/canvas-preview-mgcx2b2p.js";
11
11
  export {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  localGitHubAccount2,
3
3
  localGitHub2
4
- } from "../../chunks/canvas-preview-75db60xy.js";
5
- import"../../chunks/canvas-preview-azg56359.js";
4
+ } from "../../chunks/canvas-preview-8xc0vn7v.js";
5
+ import"../../chunks/canvas-preview-bxnqt8cd.js";
6
6
  export {
7
7
  localGitHub2 as localGitHub,
8
8
  localGitHubAccount2 as localGitHubAccount