@zenbujs/core 0.0.9 → 0.0.13
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/advice-config-BiYhyeTz.d.mts +41 -0
- package/dist/advice.d.mts +2 -36
- package/dist/advice.mjs +2 -2
- package/dist/{base-window-BxBZ2md_.mjs → base-window-4P-fVvC_.mjs} +37 -26
- package/dist/{build-config-Dzg2frpk.d.mts → build-config-GF0XzR_Y.d.mts} +42 -18
- package/dist/{build-config-pWdmLnrk.mjs → build-config-HMMqpXI1.mjs} +0 -8
- package/dist/{build-electron-Dsbb1EMl.mjs → build-electron-Di_FE62r.mjs} +10 -6
- package/dist/{build-source-d1J3shV8.mjs → build-source-BIaWpaxE.mjs} +2 -2
- package/dist/cli/bin.mjs +7 -7
- package/dist/cli/build.d.mts +1 -1
- package/dist/cli/build.mjs +1 -1
- package/dist/cli/resolve-config.mjs +6 -1
- package/dist/{cli-kL6mPgBE.mjs → cli-5jFDJWM4.mjs} +4 -4
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +2 -2
- package/dist/{db-Bc292RYo.mjs → db-MkOccvBS.mjs} +2 -2
- package/dist/db.d.mts +3 -2
- package/dist/db.mjs +2 -10
- package/dist/{dev-B2emj0HZ.mjs → dev-BSDyzO4j.mjs} +3 -9
- package/dist/env-bootstrap.d.mts +1 -1
- package/dist/events.d.mts +0 -9
- package/dist/{host-version-BIrF8tX7.mjs → host-version-Cog_odmD.mjs} +4 -3
- package/dist/{index-CVF768Xs.d.mts → index-C0mXKol5.d.mts} +188 -143
- package/dist/{index-DeDxePAa.d.mts → index-FaexRVl_.d.mts} +13 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +2 -2
- package/dist/launcher.mjs +64 -6
- package/dist/link-Bt3LB_NW.mjs +586 -0
- package/dist/{load-config-C4Oe2qZO.mjs → load-config-C2XloBaQ.mjs} +68 -5
- package/dist/node-loader.mjs +1 -1
- package/dist/{publish-source-Dq2c0iOw.mjs → publish-source-v93eB9kA.mjs} +6 -2
- package/dist/react.d.mts +6 -6
- package/dist/react.mjs +4 -4
- package/dist/registry-generated.d.mts +19 -14
- package/dist/registry-saQDMUhT.d.mts +13 -0
- package/dist/registry.d.mts +1 -1
- package/dist/{reloader-B22UiNA2.mjs → reloader-CFzxYa67.mjs} +3 -3
- package/dist/{renderer-host-DD16MXhI.mjs → renderer-host-Cw38dSDe.mjs} +35 -24
- package/dist/{rpc-C4_NQmpT.mjs → rpc-Dg9zwZ33.mjs} +4 -4
- package/dist/rpc.d.mts +1 -1
- package/dist/rpc.mjs +1 -1
- package/dist/runtime-DYUONc3S.mjs +861 -0
- package/dist/{runtime-BQWntcOb.d.mts → runtime-fnPDZFYM.d.mts} +100 -3
- package/dist/runtime.d.mts +2 -2
- package/dist/runtime.mjs +2 -578
- package/dist/{schema-CjrMVk36.d.mts → schema-brYpUjYO.d.mts} +13 -25
- package/dist/schema.d.mts +2 -2
- package/dist/schema.mjs +9 -2
- package/dist/{server-CZLMF8Dj.mjs → server-BJ2ZC2z2.mjs} +2 -2
- package/dist/services/default.d.mts +1 -5
- package/dist/services/default.mjs +12 -16
- package/dist/services/index.d.mts +1 -1
- package/dist/services/index.mjs +7 -7
- package/dist/setup-gate.d.mts +1 -1
- package/dist/setup-gate.mjs +20 -12
- package/dist/{transport-F2hv_OEm.mjs → transport-Bqlv9pmJ.mjs} +1 -1
- package/dist/updater-Bs1Jtem6.mjs +480 -0
- package/dist/{vite-plugins-tt6KAtyE.mjs → vite-plugins-Df-cfldF.mjs} +2 -49
- package/dist/vite.d.mts +0 -5
- package/dist/vite.mjs +1 -1
- package/dist/{window-YFKvAM0l.mjs → window-DgB70qeZ.mjs} +113 -22
- package/dist/{write-DgIRjo23.mjs → write-7IfKa_nq.mjs} +1 -1
- package/dist/zenbu-bg-parse-CIyPkJOY.mjs +46 -0
- package/package.json +6 -5
- package/dist/advice-config-DXSIo0sg.mjs +0 -154
- package/dist/link-glX89NV5.mjs +0 -673
- package/dist/registry-CMp8FYgS.d.mts +0 -47
- package/dist/updater-BtB_Ki1r.mjs +0 -1011
- /package/dist/{config-BK78JDRI.mjs → config-DfciRzDu.mjs} +0 -0
- /package/dist/{env-bootstrap-rTs8KR3-.d.mts → env-bootstrap-UBug-4Kw.d.mts} +0 -0
- /package/dist/{index-C-ALz_SH.d.mts → index-CSMHYi3u.d.mts} +0 -0
- /package/dist/{index-ClXLQ1fw.d.mts → index-DJOHDG5e.d.mts} +0 -0
- /package/dist/{log-6rzaCV0I.mjs → log-BkRqDwwB.mjs} +0 -0
- /package/dist/{mirror-sync-pYU6f3-c.mjs → mirror-sync-snqh9kEp.mjs} +0 -0
- /package/dist/{monorepo-Dct-kkbQ.mjs → monorepo-CBzK3l2i.mjs} +0 -0
- /package/dist/{node-BhfLKYCi.mjs → node-BuHlEsE4.mjs} +0 -0
- /package/dist/{schema-Ca7SxXgS.mjs → schema-C6k0SroY.mjs} +0 -0
- /package/dist/{setup-gate-BQq0QgZH.d.mts → setup-gate-DkysEZQO.d.mts} +0 -0
- /package/dist/{src-Cven45mq.mjs → src-BpZAt9zL.mjs} +0 -0
- /package/dist/{trace-BaVg0rnY.mjs → trace-BVcQSD59.mjs} +0 -0
- /package/dist/{transform-BzrwkEdf.mjs → transform-czrcGnVV.mjs} +0 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { n as ContentScriptSpec, t as AdviceSpec } from "./advice-config-BiYhyeTz.mjs";
|
|
2
|
+
import { a as Service, n as CleanupReason } from "./runtime-fnPDZFYM.mjs";
|
|
3
|
+
import { c as EffectFieldNode, d as KyjuError, l as FieldNode, r as createRouter, t as Db } from "./index-FaexRVl_.mjs";
|
|
4
|
+
import { n as ResolvedEvents, t as ResolvedDbRoot } from "./registry-saQDMUhT.mjs";
|
|
4
5
|
import http from "node:http";
|
|
5
6
|
import { WebSocket, WebSocketServer } from "ws";
|
|
6
7
|
import { ViteDevServer } from "vite";
|
|
7
8
|
import * as Effect from "effect/Effect";
|
|
8
|
-
import { BaseWindow,
|
|
9
|
+
import { BaseWindow, BaseWindowConstructorOptions, WebContentsViewConstructorOptions } from "electron";
|
|
10
|
+
import electronContextMenu from "electron-context-menu";
|
|
11
|
+
import { FetchResult, ReadCommitResult, StatusRow } from "isomorphic-git";
|
|
9
12
|
import * as _$stream from "stream";
|
|
10
13
|
|
|
11
14
|
//#region src/services/server.d.ts
|
|
@@ -14,6 +17,9 @@ declare const ServerService_base: (abstract new () => {
|
|
|
14
17
|
ctx: {};
|
|
15
18
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
16
19
|
evaluate(): void | Promise<void>;
|
|
20
|
+
advise(spec: AdviceSpec): () => void;
|
|
21
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
22
|
+
__getPluginDir(method: string): string;
|
|
17
23
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
18
24
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
19
25
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -34,6 +40,9 @@ declare const ServerService_base: (abstract new () => {
|
|
|
34
40
|
} ? InstanceType<T> : unknown : never : never };
|
|
35
41
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
36
42
|
evaluate(): void | Promise<void>;
|
|
43
|
+
advise(spec: AdviceSpec): () => void;
|
|
44
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
45
|
+
__getPluginDir(method: string): string;
|
|
37
46
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
38
47
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
39
48
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -74,6 +83,9 @@ declare const ReloaderService_base: (abstract new () => {
|
|
|
74
83
|
ctx: {};
|
|
75
84
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
76
85
|
evaluate(): void | Promise<void>;
|
|
86
|
+
advise(spec: AdviceSpec): () => void;
|
|
87
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
88
|
+
__getPluginDir(method: string): string;
|
|
77
89
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
78
90
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
79
91
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -94,6 +106,9 @@ declare const ReloaderService_base: (abstract new () => {
|
|
|
94
106
|
} ? InstanceType<T> : unknown : never : never };
|
|
95
107
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
96
108
|
evaluate(): void | Promise<void>;
|
|
109
|
+
advise(spec: AdviceSpec): () => void;
|
|
110
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
111
|
+
__getPluginDir(method: string): string;
|
|
97
112
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
98
113
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
99
114
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -130,6 +145,9 @@ declare const HttpService_base: (abstract new () => {
|
|
|
130
145
|
};
|
|
131
146
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
132
147
|
evaluate(): void | Promise<void>;
|
|
148
|
+
advise(spec: AdviceSpec): () => void;
|
|
149
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
150
|
+
__getPluginDir(method: string): string;
|
|
133
151
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
134
152
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
135
153
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -150,6 +168,9 @@ declare const HttpService_base: (abstract new () => {
|
|
|
150
168
|
} ? InstanceType<T> : unknown : never : never };
|
|
151
169
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
152
170
|
evaluate(): void | Promise<void>;
|
|
171
|
+
advise(spec: AdviceSpec): () => void;
|
|
172
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
173
|
+
__getPluginDir(method: string): string;
|
|
153
174
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
154
175
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
155
176
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -184,31 +205,29 @@ declare class HttpService extends HttpService_base {
|
|
|
184
205
|
type EffectSectionProxy<S> = { [K in keyof S]: EffectFieldNode<S[K]> };
|
|
185
206
|
type SectionProxy<S> = { [K in keyof S]: FieldNode<S[K]> };
|
|
186
207
|
type Root = ResolvedDbRoot;
|
|
187
|
-
type Plugin$1 = Root extends {
|
|
188
|
-
plugin: infer P;
|
|
189
|
-
} ? P : never;
|
|
190
208
|
type SectionedEffectClient = {
|
|
191
209
|
readRoot(): Root;
|
|
192
210
|
update(fn: (root: Root) => void | Root): Effect.Effect<void, KyjuError>;
|
|
193
211
|
createBlob(data: Uint8Array, hot?: boolean): Effect.Effect<string, KyjuError>;
|
|
194
212
|
deleteBlob(blobId: string): Effect.Effect<void, KyjuError>;
|
|
195
213
|
getBlobData(blobId: string): Effect.Effect<Uint8Array | null, KyjuError>;
|
|
196
|
-
|
|
197
|
-
};
|
|
214
|
+
} & { [K in keyof Root]: EffectSectionProxy<Root[K]> };
|
|
198
215
|
type SectionedClient = {
|
|
199
216
|
readRoot(): Root;
|
|
200
217
|
update(fn: (root: Root) => void | Root): Promise<void>;
|
|
201
218
|
createBlob(data: Uint8Array, hot?: boolean): Promise<string>;
|
|
202
219
|
deleteBlob(blobId: string): Promise<void>;
|
|
203
220
|
getBlobData(blobId: string): Promise<Uint8Array | null>;
|
|
204
|
-
|
|
205
|
-
};
|
|
221
|
+
} & { [K in keyof Root]: SectionProxy<Root[K]> };
|
|
206
222
|
declare const DbService_base: (abstract new () => {
|
|
207
223
|
ctx: {
|
|
208
224
|
http: HttpService;
|
|
209
225
|
};
|
|
210
226
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
211
227
|
evaluate(): void | Promise<void>;
|
|
228
|
+
advise(spec: AdviceSpec): () => void;
|
|
229
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
230
|
+
__getPluginDir(method: string): string;
|
|
212
231
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
213
232
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
214
233
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -229,6 +248,9 @@ declare const DbService_base: (abstract new () => {
|
|
|
229
248
|
} ? InstanceType<T> : unknown : never : never };
|
|
230
249
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
231
250
|
evaluate(): void | Promise<void>;
|
|
251
|
+
advise(spec: AdviceSpec): () => void;
|
|
252
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
253
|
+
__getPluginDir(method: string): string;
|
|
232
254
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
233
255
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
234
256
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -275,17 +297,50 @@ declare class DbService extends DbService_base {
|
|
|
275
297
|
}
|
|
276
298
|
//#endregion
|
|
277
299
|
//#region src/services/view-registry.d.ts
|
|
300
|
+
/**
|
|
301
|
+
* View metadata surfaced to the renderer (icon picker, sidebar slot,
|
|
302
|
+
* bottom-panel slot, human label). Optional everywhere; views without
|
|
303
|
+
* metadata simply don't appear in the corresponding chrome.
|
|
304
|
+
*/
|
|
305
|
+
interface ViewMeta {
|
|
306
|
+
kind?: string;
|
|
307
|
+
sidebar?: boolean;
|
|
308
|
+
bottomPanel?: boolean;
|
|
309
|
+
label?: string;
|
|
310
|
+
}
|
|
278
311
|
interface ViewEntry {
|
|
279
312
|
type: string;
|
|
280
313
|
url: string;
|
|
281
314
|
port: number;
|
|
282
315
|
ownsServer: boolean;
|
|
283
|
-
meta?:
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
316
|
+
meta?: ViewMeta;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Spec for a fresh view registration. The registry spins up a Vite dev
|
|
320
|
+
* server rooted at `root` and exposes the resulting URL under `type`.
|
|
321
|
+
*
|
|
322
|
+
* - `type`: stable id used by `<View type="...">` in the renderer.
|
|
323
|
+
* - `root`: absolute path of the view's `index.html` directory.
|
|
324
|
+
* - `configFile`: explicit Vite config path, or `false` to skip auto-discovery.
|
|
325
|
+
* - `meta`: optional renderer-facing metadata.
|
|
326
|
+
*/
|
|
327
|
+
interface RegisterViewSpec {
|
|
328
|
+
type: string;
|
|
329
|
+
root: string;
|
|
330
|
+
configFile?: string | false;
|
|
331
|
+
meta?: ViewMeta;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Spec for re-exposing an existing reloader under a different view type
|
|
335
|
+
* with a path prefix. Mostly used by core to alias the host renderer
|
|
336
|
+
* (`"app"`) and by plugins that bundle multiple sub-views inside one
|
|
337
|
+
* Vite server.
|
|
338
|
+
*/
|
|
339
|
+
interface RegisterAliasSpec {
|
|
340
|
+
type: string;
|
|
341
|
+
reloaderId: string;
|
|
342
|
+
pathPrefix: string;
|
|
343
|
+
meta?: ViewMeta;
|
|
289
344
|
}
|
|
290
345
|
declare const ViewRegistryService_base: (abstract new () => {
|
|
291
346
|
ctx: {
|
|
@@ -294,6 +349,9 @@ declare const ViewRegistryService_base: (abstract new () => {
|
|
|
294
349
|
};
|
|
295
350
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
296
351
|
evaluate(): void | Promise<void>;
|
|
352
|
+
advise(spec: AdviceSpec): () => void;
|
|
353
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
354
|
+
__getPluginDir(method: string): string;
|
|
297
355
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
298
356
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
299
357
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -314,6 +372,9 @@ declare const ViewRegistryService_base: (abstract new () => {
|
|
|
314
372
|
} ? InstanceType<T> : unknown : never : never };
|
|
315
373
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
316
374
|
evaluate(): void | Promise<void>;
|
|
375
|
+
advise(spec: AdviceSpec): () => void;
|
|
376
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
377
|
+
__getPluginDir(method: string): string;
|
|
317
378
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
318
379
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
319
380
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -334,18 +395,8 @@ declare const ViewRegistryService_base: (abstract new () => {
|
|
|
334
395
|
declare class ViewRegistryService extends ViewRegistryService_base {
|
|
335
396
|
private views;
|
|
336
397
|
private manifestIcons;
|
|
337
|
-
register(
|
|
338
|
-
|
|
339
|
-
sidebar?: boolean;
|
|
340
|
-
bottomPanel?: boolean;
|
|
341
|
-
label?: string;
|
|
342
|
-
}): Promise<ViewEntry>;
|
|
343
|
-
registerAlias(type: string, reloaderId: string, pathPrefix: string, meta?: {
|
|
344
|
-
kind?: string;
|
|
345
|
-
sidebar?: boolean;
|
|
346
|
-
bottomPanel?: boolean;
|
|
347
|
-
label?: string;
|
|
348
|
-
}): ViewEntry;
|
|
398
|
+
register(spec: RegisterViewSpec): Promise<ViewEntry>;
|
|
399
|
+
registerAlias(spec: RegisterAliasSpec): ViewEntry;
|
|
349
400
|
unregister(type: string): Promise<void>;
|
|
350
401
|
get(type: string): ViewEntry | undefined;
|
|
351
402
|
evaluate(): void;
|
|
@@ -361,6 +412,9 @@ declare const RendererHostService_base: (abstract new () => {
|
|
|
361
412
|
};
|
|
362
413
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
363
414
|
evaluate(): void | Promise<void>;
|
|
415
|
+
advise(spec: AdviceSpec): () => void;
|
|
416
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
417
|
+
__getPluginDir(method: string): string;
|
|
364
418
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
365
419
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
366
420
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -381,6 +435,9 @@ declare const RendererHostService_base: (abstract new () => {
|
|
|
381
435
|
} ? InstanceType<T> : unknown : never : never };
|
|
382
436
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
383
437
|
evaluate(): void | Promise<void>;
|
|
438
|
+
advise(spec: AdviceSpec): () => void;
|
|
439
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
440
|
+
__getPluginDir(method: string): string;
|
|
384
441
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
385
442
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
386
443
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -406,18 +463,15 @@ declare class RendererHostService extends RendererHostService_base {
|
|
|
406
463
|
//#endregion
|
|
407
464
|
//#region src/services/base-window.d.ts
|
|
408
465
|
declare const MAIN_WINDOW_ID = "main";
|
|
409
|
-
type WindowBounds = {
|
|
410
|
-
x: number;
|
|
411
|
-
y: number;
|
|
412
|
-
width: number;
|
|
413
|
-
height: number;
|
|
414
|
-
};
|
|
415
466
|
declare const BaseWindowService_base: (abstract new () => {
|
|
416
467
|
ctx: {
|
|
417
468
|
db: DbService;
|
|
418
469
|
};
|
|
419
470
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
420
471
|
evaluate(): void | Promise<void>;
|
|
472
|
+
advise(spec: AdviceSpec): () => void;
|
|
473
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
474
|
+
__getPluginDir(method: string): string;
|
|
421
475
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
422
476
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
423
477
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -438,6 +492,9 @@ declare const BaseWindowService_base: (abstract new () => {
|
|
|
438
492
|
} ? InstanceType<T> : unknown : never : never };
|
|
439
493
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
440
494
|
evaluate(): void | Promise<void>;
|
|
495
|
+
advise(spec: AdviceSpec): () => void;
|
|
496
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
497
|
+
__getPluginDir(method: string): string;
|
|
441
498
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
442
499
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
443
500
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -461,9 +518,9 @@ declare class BaseWindowService extends BaseWindowService_base {
|
|
|
461
518
|
private set bootWindows(value);
|
|
462
519
|
private getZenWidth;
|
|
463
520
|
getWindowId(win: BaseWindow): string | undefined;
|
|
464
|
-
createWindow(opts?:
|
|
521
|
+
createWindow(opts?: {
|
|
465
522
|
windowId?: string;
|
|
466
|
-
|
|
523
|
+
baseWindow?: BaseWindowConstructorOptions;
|
|
467
524
|
}): {
|
|
468
525
|
win: BaseWindow;
|
|
469
526
|
windowId: string;
|
|
@@ -479,6 +536,9 @@ declare const RpcService_base: (abstract new () => {
|
|
|
479
536
|
};
|
|
480
537
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
481
538
|
evaluate(): void | Promise<void>;
|
|
539
|
+
advise(spec: AdviceSpec): () => void;
|
|
540
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
541
|
+
__getPluginDir(method: string): string;
|
|
482
542
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
483
543
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
484
544
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -499,6 +559,9 @@ declare const RpcService_base: (abstract new () => {
|
|
|
499
559
|
} ? InstanceType<T> : unknown : never : never };
|
|
500
560
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
501
561
|
evaluate(): void | Promise<void>;
|
|
562
|
+
advise(spec: AdviceSpec): () => void;
|
|
563
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
564
|
+
__getPluginDir(method: string): string;
|
|
502
565
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
503
566
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
504
567
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -532,6 +595,9 @@ declare const WindowService_base: (abstract new () => {
|
|
|
532
595
|
};
|
|
533
596
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
534
597
|
evaluate(): void | Promise<void>;
|
|
598
|
+
advise(spec: AdviceSpec): () => void;
|
|
599
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
600
|
+
__getPluginDir(method: string): string;
|
|
535
601
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
536
602
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
537
603
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -552,6 +618,9 @@ declare const WindowService_base: (abstract new () => {
|
|
|
552
618
|
} ? InstanceType<T> : unknown : never : never };
|
|
553
619
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
554
620
|
evaluate(): void | Promise<void>;
|
|
621
|
+
advise(spec: AdviceSpec): () => void;
|
|
622
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
623
|
+
__getPluginDir(method: string): string;
|
|
555
624
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
556
625
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
557
626
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -572,14 +641,22 @@ declare const WindowService_base: (abstract new () => {
|
|
|
572
641
|
declare class WindowService extends WindowService_base {
|
|
573
642
|
private mounted;
|
|
574
643
|
evaluate(): void;
|
|
644
|
+
/**
|
|
645
|
+
* Walk every mounted WebContentsView and return the one currently
|
|
646
|
+
* focused, so application-menu actions (reload, devtools) hit the view
|
|
647
|
+
* the user is actually looking at instead of the wrong window.
|
|
648
|
+
*/
|
|
649
|
+
private focusedMountedWebContents;
|
|
650
|
+
private installAppMenu;
|
|
575
651
|
openView(args: {
|
|
576
652
|
type: string;
|
|
577
653
|
windowId?: string;
|
|
578
654
|
query?: Record<string, string | number | boolean | null | undefined>;
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
655
|
+
baseWindow?: BaseWindowConstructorOptions;
|
|
656
|
+
webContentsView?: WebContentsViewConstructorOptions;
|
|
657
|
+
backgroundColor?: string;
|
|
658
|
+
contextMenu?: false | Parameters<typeof electronContextMenu>[0];
|
|
659
|
+
devtoolsShortcut?: boolean;
|
|
583
660
|
}): Promise<{
|
|
584
661
|
windowId: string;
|
|
585
662
|
}>;
|
|
@@ -624,73 +701,24 @@ type PackageManagerSpec = {
|
|
|
624
701
|
};
|
|
625
702
|
//#endregion
|
|
626
703
|
//#region src/services/updater.d.ts
|
|
627
|
-
|
|
628
|
-
phase: "idle";
|
|
629
|
-
} | {
|
|
630
|
-
phase: "checking";
|
|
631
|
-
} | {
|
|
632
|
-
phase: "fetching";
|
|
633
|
-
loaded?: number;
|
|
634
|
-
total?: number;
|
|
635
|
-
ratio?: number;
|
|
636
|
-
} | {
|
|
637
|
-
phase: "resolving";
|
|
638
|
-
depthConsidered: number;
|
|
639
|
-
} | {
|
|
640
|
-
phase: "installing";
|
|
641
|
-
pm: string;
|
|
642
|
-
line?: string;
|
|
643
|
-
loaded?: number;
|
|
644
|
-
total?: number;
|
|
645
|
-
ratio?: number;
|
|
646
|
-
} | {
|
|
647
|
-
phase: "applied";
|
|
648
|
-
sha: string;
|
|
649
|
-
reranInstall: boolean;
|
|
650
|
-
} | {
|
|
651
|
-
phase: "up-to-date";
|
|
652
|
-
sha: string;
|
|
653
|
-
} | {
|
|
654
|
-
phase: "incompatible";
|
|
655
|
-
remoteHead: string;
|
|
656
|
-
reason: string;
|
|
657
|
-
} | {
|
|
658
|
-
phase: "dirty-tree";
|
|
704
|
+
interface AppContext {
|
|
659
705
|
appsDir: string;
|
|
660
|
-
|
|
661
|
-
phase: "error";
|
|
662
|
-
message: string;
|
|
663
|
-
};
|
|
664
|
-
interface UpdaterInfo {
|
|
665
|
-
mode: "bundle" | "dev";
|
|
666
|
-
appsDir: string | null;
|
|
667
|
-
hostVersion: string | null;
|
|
668
|
-
currentSha: string | null;
|
|
706
|
+
resourcesPath: string;
|
|
669
707
|
mirror: {
|
|
670
708
|
url: string;
|
|
671
709
|
branch: string;
|
|
672
|
-
}
|
|
673
|
-
packageManager: PackageManagerSpec
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
status: "ok" | "dev-mode" | "error" | "no-mirror" | "no-host-version";
|
|
677
|
-
currentSha: string | null;
|
|
678
|
-
targetSha: string | null;
|
|
679
|
-
tipSha: string | null;
|
|
680
|
-
hasUpdate: boolean;
|
|
681
|
-
incompatibleHead: boolean;
|
|
682
|
-
error?: string;
|
|
683
|
-
}
|
|
684
|
-
interface UpdaterUpdateResult {
|
|
685
|
-
status: "applied" | "up-to-date" | "incompatible" | "dirty-tree" | "dev-mode" | "no-mirror" | "no-host-version" | "in-progress" | "error";
|
|
686
|
-
appliedSha?: string;
|
|
687
|
-
reranInstall?: boolean;
|
|
688
|
-
error?: string;
|
|
710
|
+
};
|
|
711
|
+
packageManager: PackageManagerSpec;
|
|
712
|
+
hostVersion: string;
|
|
713
|
+
appName: string;
|
|
689
714
|
}
|
|
690
715
|
declare const UpdaterService_base: (abstract new () => {
|
|
691
716
|
ctx: {};
|
|
692
717
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
693
718
|
evaluate(): void | Promise<void>;
|
|
719
|
+
advise(spec: AdviceSpec): () => void;
|
|
720
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
721
|
+
__getPluginDir(method: string): string;
|
|
694
722
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
695
723
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
696
724
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -711,6 +739,9 @@ declare const UpdaterService_base: (abstract new () => {
|
|
|
711
739
|
} ? InstanceType<T> : unknown : never : never };
|
|
712
740
|
__setupCleanups: Map<string, (reason: CleanupReason) => void | Promise<void>>;
|
|
713
741
|
evaluate(): void | Promise<void>;
|
|
742
|
+
advise(spec: AdviceSpec): () => void;
|
|
743
|
+
injectContentScript(spec: ContentScriptSpec): () => void;
|
|
744
|
+
__getPluginDir(method: string): string;
|
|
714
745
|
setup(key: string, fn: () => void | ((reason: CleanupReason) => void | Promise<void>)): void;
|
|
715
746
|
trace<T>(_name: string, fn: () => T | Promise<T>, _meta?: Record<string, unknown>): Promise<T>;
|
|
716
747
|
traceSync<T>(_name: string, fn: () => T, _meta?: Record<string, unknown>): T;
|
|
@@ -729,55 +760,69 @@ declare const UpdaterService_base: (abstract new () => {
|
|
|
729
760
|
};
|
|
730
761
|
};
|
|
731
762
|
declare class UpdaterService extends UpdaterService_base {
|
|
732
|
-
status: UpdaterPhase;
|
|
733
|
-
private listeners;
|
|
734
|
-
private inflight;
|
|
735
|
-
private pollDisposers;
|
|
736
763
|
evaluate(): void;
|
|
737
764
|
/**
|
|
738
|
-
*
|
|
739
|
-
*
|
|
740
|
-
*
|
|
765
|
+
* Snapshot of the running .app's mirror + toolchain. Returns `null`
|
|
766
|
+
* in dev (no bundle) or when `app-config.json` / `host.json` are
|
|
767
|
+
* missing. No side effects.
|
|
741
768
|
*/
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
+
getAppContext(): Promise<AppContext | null>;
|
|
770
|
+
fetch(opts: {
|
|
771
|
+
dir: string;
|
|
772
|
+
url: string;
|
|
773
|
+
ref?: string;
|
|
774
|
+
remote?: string;
|
|
775
|
+
depth?: number;
|
|
776
|
+
singleBranch?: boolean;
|
|
777
|
+
tags?: boolean;
|
|
778
|
+
}): Promise<FetchResult>;
|
|
779
|
+
clone(opts: {
|
|
780
|
+
dir: string;
|
|
781
|
+
url: string;
|
|
782
|
+
ref?: string;
|
|
783
|
+
depth?: number;
|
|
784
|
+
singleBranch?: boolean;
|
|
785
|
+
}): Promise<void>;
|
|
786
|
+
checkout(opts: {
|
|
787
|
+
dir: string;
|
|
788
|
+
ref: string;
|
|
789
|
+
force?: boolean;
|
|
790
|
+
}): Promise<void>;
|
|
791
|
+
resolveRef(opts: {
|
|
792
|
+
dir: string;
|
|
793
|
+
ref: string;
|
|
794
|
+
}): Promise<string>;
|
|
795
|
+
statusMatrix(opts: {
|
|
796
|
+
dir: string;
|
|
797
|
+
filepaths?: string[];
|
|
798
|
+
}): Promise<StatusRow[]>;
|
|
799
|
+
log(opts: {
|
|
800
|
+
dir: string;
|
|
801
|
+
ref?: string;
|
|
802
|
+
depth?: number;
|
|
803
|
+
}): Promise<ReadCommitResult[]>;
|
|
769
804
|
/**
|
|
770
|
-
*
|
|
771
|
-
*
|
|
772
|
-
*
|
|
805
|
+
* Run `<pm> install` in `dir` using the bundled toolchain at
|
|
806
|
+
* `resourcesPath`. Always runs; no signature gating. Compose with
|
|
807
|
+
* `getDepsSignature` / `readDepsSignature` / `writeDepsSignature`
|
|
808
|
+
* if you want a skip-when-clean gate.
|
|
773
809
|
*/
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
810
|
+
install(opts: {
|
|
811
|
+
dir: string;
|
|
812
|
+
pm: PackageManagerSpec;
|
|
813
|
+
resourcesPath: string;
|
|
814
|
+
}): Promise<void>;
|
|
815
|
+
getDepsSignature(opts: {
|
|
816
|
+
dir: string;
|
|
817
|
+
pm: PackageManagerSpec;
|
|
818
|
+
}): Promise<string>;
|
|
819
|
+
readDepsSignature(opts: {
|
|
820
|
+
dir: string;
|
|
821
|
+
}): Promise<string | null>;
|
|
822
|
+
writeDepsSignature(opts: {
|
|
823
|
+
dir: string;
|
|
824
|
+
sig: string;
|
|
825
|
+
}): Promise<void>;
|
|
781
826
|
}
|
|
782
827
|
//#endregion
|
|
783
828
|
export { MAIN_WINDOW_ID as a, DbService as c, ServerService as d, BaseWindowService as i, HttpService as l, WindowService as n, RendererHostService as o, RpcService as r, ViewRegistryService as s, UpdaterService as t, ReloaderService as u };
|
|
@@ -38,6 +38,18 @@ type InferRoot<T extends SchemaShape> = { [K in keyof T]: T[K] extends BlobRef ?
|
|
|
38
38
|
debugName: string;
|
|
39
39
|
} : T[K] extends Field<infer S, infer D> ? S extends BlobRef ? InferFieldType<S> : [D] extends [true] ? InferFieldType<S> : InferFieldType<S> | undefined : T[K] extends zod.ZodType<infer O> ? O : never };
|
|
40
40
|
type InferSchema<S extends Schema> = S extends Schema<infer TShape> ? TShape : never;
|
|
41
|
+
/**
|
|
42
|
+
* Resolve a `createSchema(...)` value to its live root type in one step:
|
|
43
|
+
*
|
|
44
|
+
* const schema = createSchema({ count: z.number().default(0) })
|
|
45
|
+
* type Root = InferSchemaRoot<typeof schema> // { count: number }
|
|
46
|
+
*
|
|
47
|
+
* Equivalent to `InferRoot<InferSchema<typeof schema>>`. Provided so plugin
|
|
48
|
+
* schemas can be one-liners with no auxiliary type aliases — `zen link`
|
|
49
|
+
* uses this to derive each section's root from the schema module's
|
|
50
|
+
* default export.
|
|
51
|
+
*/
|
|
52
|
+
type InferSchemaRoot<S> = S extends Schema<infer TShape> ? InferRoot<TShape> : never;
|
|
41
53
|
type Schema<TShape extends SchemaShape = SchemaShape> = {
|
|
42
54
|
shape: TShape;
|
|
43
55
|
};
|
|
@@ -439,4 +451,4 @@ type Db<TShape extends SchemaShape = SchemaShape> = {
|
|
|
439
451
|
effectClient: EffectClientProxy<TShape>;
|
|
440
452
|
};
|
|
441
453
|
//#endregion
|
|
442
|
-
export { createSchema as S, InferSchema as _, dbStringify as a,
|
|
454
|
+
export { createSchema as C, collection as S, InferSchema as _, dbStringify as a, SchemaShape as b, EffectFieldNode as c, KyjuError as d, CollectionRefBrand as f, InferRoot as g, InferCollectionItem as h, dbParse as i, FieldNode as l, Field as m, connectReplica as n, ClientProxy as o, CollectionRefValue as p, createRouter as r, CollectionNode as s, Db as t, CollectionState as u, InferSchemaRoot as v, blob as x, Schema as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as bootstrapEnv } from "./env-bootstrap-
|
|
3
|
-
import { t as setupGate } from "./setup-gate-
|
|
4
|
-
import { n as SchemaRoot, o as schema, t as CoreSchema } from "./schema-
|
|
1
|
+
import { a as Service, g as runtime, n as CleanupReason, s as ServiceRuntime } from "./runtime-fnPDZFYM.mjs";
|
|
2
|
+
import { t as bootstrapEnv } from "./env-bootstrap-UBug-4Kw.mjs";
|
|
3
|
+
import { t as setupGate } from "./setup-gate-DkysEZQO.mjs";
|
|
4
|
+
import { n as SchemaRoot, o as schema, t as CoreSchema } from "./schema-brYpUjYO.mjs";
|
|
5
5
|
export { CleanupReason, CoreSchema, SchemaRoot as CoreSchemaRoot, Service, ServiceRuntime, bootstrapEnv, schema as coreSchema, runtime, setupGate };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bootstrapEnv } from "./env-bootstrap.mjs";
|
|
2
2
|
import { setupGate } from "./setup-gate.mjs";
|
|
3
|
-
import { Service, ServiceRuntime
|
|
4
|
-
import
|
|
3
|
+
import { f as runtime, n as Service, r as ServiceRuntime } from "./runtime-DYUONc3S.mjs";
|
|
4
|
+
import schema from "./schema.mjs";
|
|
5
5
|
export { Service, ServiceRuntime, bootstrapEnv, schema as coreSchema, runtime, setupGate };
|