create-opentray 0.24.0 → 0.26.0
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/README.md +21 -13
- package/dist/{bin-BQb2Bjcu.mjs → bin-Bz16rwKs.mjs} +249 -313
- package/dist/bin-Bz16rwKs.mjs.map +1 -0
- package/dist/bin-CrMTyTux.d.mts +751 -0
- package/dist/bin-CrMTyTux.d.mts.map +1 -0
- package/dist/bin.d.mts +2 -15
- package/dist/bin.mjs +2 -2
- package/dist/{decode-ico-BHd2POHf.mjs → decode-ico-DDEIV7iZ.mjs} +2 -2
- package/dist/{decode-ico-BHd2POHf.mjs.map → decode-ico-DDEIV7iZ.mjs.map} +1 -1
- package/dist/encode-CTEluLqt.mjs +167 -0
- package/dist/encode-CTEluLqt.mjs.map +1 -0
- package/dist/icon-codec-Bs3XehqZ.mjs +20 -0
- package/dist/icon-codec-Bs3XehqZ.mjs.map +1 -0
- package/dist/index.d.mts +1 -724
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/rolldown-runtime-DJK8HYOj.mjs +34 -0
- package/dist/shell/assets/ghostty-web.js +1 -1
- package/dist/shell/assets/index.css +1 -1
- package/dist/shell/assets/index.js +2 -9
- package/dist/shell/assets/index2.js +9 -2
- package/dist/shell/assets/input.js +1 -1
- package/dist/shell/assets/main.js +8 -8
- package/dist/shell/assets/terminal-pane.js +2 -2
- package/dist/shell/assets/terminal.js +1 -1
- package/dist/shell/assets/toolbar.js +1 -0
- package/dist/shell/index.html +1 -1
- package/dist/shell/terminal.html +1 -1
- package/dist/shell/{browse.html → toolbar.html} +3 -3
- package/dist/skill/SKILL.md +14 -11
- package/dist/skill/references/cli-reference.md +1 -1
- package/dist/skill/references/how-it-works.md +15 -9
- package/dist/webui/assets/ghostty-web.js +1 -1
- package/dist/webui/assets/index.css +1 -1
- package/dist/webui/assets/index.js +2 -9
- package/dist/webui/assets/index2.js +9 -2
- package/dist/webui/assets/input.js +1 -1
- package/dist/webui/assets/main.js +8 -8
- package/dist/webui/assets/terminal-pane.js +2 -2
- package/dist/webui/assets/terminal.js +1 -1
- package/dist/webui/assets/toolbar.js +1 -0
- package/dist/webui/index.html +1 -1
- package/dist/webui/terminal.html +1 -1
- package/dist/webui/{browse.html → toolbar.html} +3 -3
- package/package.json +6 -6
- package/skill/SKILL.md +14 -11
- package/skill/references/cli-reference.md +1 -1
- package/skill/references/how-it-works.md +15 -9
- package/dist/bin-BQb2Bjcu.mjs.map +0 -1
- package/dist/bin.d.mts.map +0 -1
- package/dist/shell/assets/browse.js +0 -1
- package/dist/webui/assets/browse.js +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as resolveFaviconUrl, B as LaunchVector, C as UiLocale, D as extractTitle, E as extractFaviconCandidates, F as parseNetstatPorts, H as resolveLaunchVector, I as parsePowerShellPorts, L as serviceUrl, M as DiscoveredService, N as createPortDiscovery, O as faviconCandidateSize, P as parseLsofPorts, R as verifyHttpService, S as writeScaffold, T as ScrapeResult, U as resolveOnPath, V as parseShebangInterpreter, _ as isDirectoryOccupied, a as parseWizardCli, b as ScaffoldOptions, c as WizardSession, d as MaterializeContext, f as MaterializeInput, g as expectedDarwinBundlePath, h as detectPackageManager, j as scrapeService, k as rankFaviconCandidates, l as WizardState, m as MaterializeResult, n as main, o as WizardEvent, p as MaterializeLogEvent, s as WizardFormValues, t as WizardCliOptions, u as createWizardSession, v as materialize, w as FaviconCandidate, x as ScaffoldResult, y as ScaffoldAppConfig, z as waitForTcpPort } from "./bin-CrMTyTux.mjs";
|
|
2
2
|
import { IncomingMessage } from "node:http";
|
|
3
|
-
import { AppIcon } from "@opentray/spec";
|
|
4
3
|
|
|
5
4
|
//#region packages/core/src/app-id.d.ts
|
|
6
5
|
/**
|
|
@@ -17,59 +16,6 @@ declare const toProjectDirectoryName: (appId: string) => string;
|
|
|
17
16
|
/** True when the appId has the shape consumers expect for stable identity. */
|
|
18
17
|
declare const isValidAppId: (appId: string) => boolean;
|
|
19
18
|
//#endregion
|
|
20
|
-
//#region packages/core/src/command-family.d.ts
|
|
21
|
-
type Family = "npm" | "go" | "rust" | "python" | "dotnet" | "custom";
|
|
22
|
-
interface FamilyFormState {
|
|
23
|
-
readonly family: Family;
|
|
24
|
-
/** npm/python 系列的 runner(如 `npx`、`yarn dlx`、`uvx`、`pipx run`)。 */
|
|
25
|
-
readonly runner: string;
|
|
26
|
-
/** runner 与包名之间的选项 token(如 `deno run -A` 的 `-A`)。 */
|
|
27
|
-
readonly runnerFlags: string;
|
|
28
|
-
/** 包名 / module 路径 / crate / 工具 ID(保持用户输入原样)。 */
|
|
29
|
-
readonly pkg: string;
|
|
30
|
-
/** 空串 = latest/省略。 */
|
|
31
|
-
readonly version: string;
|
|
32
|
-
/** 包名之后的参数(原样字符串)。 */
|
|
33
|
-
readonly args: string;
|
|
34
|
-
/** 仅 Rust:运行二进制名;空串 = 与 crate 同名。 */
|
|
35
|
-
readonly binary: string;
|
|
36
|
-
/** 仅自定义:完整自由命令。 */
|
|
37
|
-
readonly raw: string;
|
|
38
|
-
}
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region packages/core/src/launch-vector.d.ts
|
|
41
|
-
interface LaunchVector {
|
|
42
|
-
readonly command: string;
|
|
43
|
-
readonly args: readonly string[];
|
|
44
|
-
readonly cwd: string;
|
|
45
|
-
/** Optional explicit env overlay merged over the runtime environment. */
|
|
46
|
-
readonly env?: Readonly<Record<string, string>>;
|
|
47
|
-
}
|
|
48
|
-
interface ResolveLaunchVectorOptions {
|
|
49
|
-
readonly tokens: readonly string[];
|
|
50
|
-
readonly cwd: string;
|
|
51
|
-
readonly platform?: NodeJS.Platform;
|
|
52
|
-
readonly pathEnv?: string;
|
|
53
|
-
readonly accessFile?: (path: string) => Promise<void>;
|
|
54
|
-
readonly firstLine?: (path: string) => Promise<string | undefined>;
|
|
55
|
-
}
|
|
56
|
-
/** Resolve a bare command name against PATH; returns undefined when absent. */
|
|
57
|
-
declare const resolveOnPath: (command: string, options: Pick<ResolveLaunchVectorOptions, "platform" | "pathEnv" | "accessFile">) => Promise<string | undefined>;
|
|
58
|
-
/** Read a `#!/usr/bin/env <interpreter>` shebang; undefined for other files. */
|
|
59
|
-
declare const parseShebangInterpreter: (firstLine: string | undefined) => {
|
|
60
|
-
interpreter: string;
|
|
61
|
-
args: readonly string[];
|
|
62
|
-
} | undefined;
|
|
63
|
-
/**
|
|
64
|
-
* Resolve the user's command tokens to a PATH-independent vector:
|
|
65
|
-
* - absolute-ize bare executables through PATH lookup;
|
|
66
|
-
* - resolve relative script paths against cwd;
|
|
67
|
-
* - when the executable is an `env <interpreter>` shebang script, run the
|
|
68
|
-
* interpreter directly with the script as its first argument.
|
|
69
|
-
* The persisted descriptor never includes an environment map.
|
|
70
|
-
*/
|
|
71
|
-
declare const resolveLaunchVector: (options: ResolveLaunchVectorOptions) => Promise<LaunchVector>;
|
|
72
|
-
//#endregion
|
|
73
19
|
//#region packages/core/src/tokenize.d.ts
|
|
74
20
|
interface TokenizeResult {
|
|
75
21
|
readonly ok: boolean;
|
|
@@ -84,273 +30,6 @@ interface TokenizeResult {
|
|
|
84
30
|
*/
|
|
85
31
|
declare const tokenizeCommandLine: (input: string) => TokenizeResult;
|
|
86
32
|
//#endregion
|
|
87
|
-
//#region packages/core/src/port-scan.d.ts
|
|
88
|
-
interface DiscoveredService {
|
|
89
|
-
readonly port: number;
|
|
90
|
-
readonly url: string;
|
|
91
|
-
readonly firstSeenAt: number;
|
|
92
|
-
title?: string;
|
|
93
|
-
}
|
|
94
|
-
type ListenersRunner = (platform: NodeJS.Platform) => Promise<ReadonlySet<number>>;
|
|
95
|
-
/** Listener snapshot with process ownership: port -> owning PIDs. */
|
|
96
|
-
type ListenerOwners = ReadonlyMap<number, ReadonlySet<number>>;
|
|
97
|
-
/** Loopback service URL for a discovered port. */
|
|
98
|
-
declare const serviceUrl: (port: number) => string;
|
|
99
|
-
declare const parseLsofPorts: (stdout: string) => ReadonlySet<number>;
|
|
100
|
-
/** Parses `netstat -ano -p tcp` output; keeps LISTENING rows. */
|
|
101
|
-
declare const parseNetstatPorts: (stdout: string) => ReadonlySet<number>;
|
|
102
|
-
declare const parsePowerShellPorts: (stdout: string) => ReadonlySet<number>;
|
|
103
|
-
/** TCP-connect probe used by the generated app and discovery verification. */
|
|
104
|
-
declare const waitForTcpPort: (port: number, timeoutMs: number, intervalMs?: number, host?: string) => Promise<boolean>;
|
|
105
|
-
/** Verify a port answers with an HTTP response (any status counts). */
|
|
106
|
-
declare const verifyHttpService: (port: number, timeoutMs?: number) => Promise<boolean>;
|
|
107
|
-
interface PortDiscoveryOptions {
|
|
108
|
-
readonly platform?: NodeJS.Platform;
|
|
109
|
-
readonly baseline: ReadonlySet<number>;
|
|
110
|
-
readonly listListeners?: ListenersRunner;
|
|
111
|
-
readonly verifyHttp?: (port: number) => Promise<boolean>;
|
|
112
|
-
/** Resolves the PIDs whose listeners count as services (preview process tree). */
|
|
113
|
-
readonly resolveOwnerPids?: () => Promise<ReadonlySet<number>>;
|
|
114
|
-
readonly listOwners?: () => Promise<ListenerOwners>;
|
|
115
|
-
readonly intervalMs?: number;
|
|
116
|
-
}
|
|
117
|
-
interface PortDiscoverySession {
|
|
118
|
-
/** Known new services, first-seen order. */
|
|
119
|
-
services(): readonly DiscoveredService[];
|
|
120
|
-
/** One polling pass; resolves to services discovered during this pass. */
|
|
121
|
-
poll(): Promise<readonly DiscoveredService[]>;
|
|
122
|
-
stop(): void;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Diff-based port discovery. Each poll re-enumerates listeners, keeps ports
|
|
126
|
-
* absent from the baseline, and adds HTTP-verified ones in first-seen order.
|
|
127
|
-
*/
|
|
128
|
-
declare const createPortDiscovery: (options: PortDiscoveryOptions) => PortDiscoverySession;
|
|
129
|
-
//#endregion
|
|
130
|
-
//#region packages/core/src/scrape.d.ts
|
|
131
|
-
/** Variant tag: the original art, a solid-color silhouette derived from it,
|
|
132
|
-
* or an AI subject-extraction derived by the wizard's browser client. */
|
|
133
|
-
type IconVariant = "original" | "solid-black" | "solid-white" | "subject";
|
|
134
|
-
/** One scraped icon candidate, ranked and deduplicated. */
|
|
135
|
-
interface ScrapedIcon {
|
|
136
|
-
/** Index within the candidate list (stable for /api/icon-data/:port/:index). */
|
|
137
|
-
readonly index: number;
|
|
138
|
-
/** Absolute URL the bytes came from (variants inherit their source URL). */
|
|
139
|
-
readonly url: string;
|
|
140
|
-
/** Absolute temp file holding the icon bytes. */
|
|
141
|
-
readonly path: string;
|
|
142
|
-
/** True pixel clarity (largest dimension; SVG uses intrinsic or 512). */
|
|
143
|
-
readonly width: number;
|
|
144
|
-
readonly height: number;
|
|
145
|
-
/** png | svg | jpeg | webp | gif | ico (ico payloads are extracted to png). */
|
|
146
|
-
readonly format: string;
|
|
147
|
-
/** Which art this entry carries (originals feed the app-icon picker; the
|
|
148
|
-
* advanced tray picker also shows solid variants). */
|
|
149
|
-
readonly variant: IconVariant;
|
|
150
|
-
/** Index of the original candidate a variant was derived from. */
|
|
151
|
-
readonly variantOf?: number;
|
|
152
|
-
}
|
|
153
|
-
interface ScrapeResult {
|
|
154
|
-
readonly ok: boolean;
|
|
155
|
-
readonly title: string | undefined;
|
|
156
|
-
/** Absolute temp file holding the chosen (clearest) favicon bytes, when found. */
|
|
157
|
-
readonly iconPath: string | undefined;
|
|
158
|
-
readonly iconUrl?: string;
|
|
159
|
-
/** All viable candidates ranked by clarity, near-duplicates removed. */
|
|
160
|
-
readonly icons: readonly ScrapedIcon[];
|
|
161
|
-
/**
|
|
162
|
-
* Whether the page's response policy allows third-party iframe embedding
|
|
163
|
-
* (toolbar mode feasibility); undefined when the page could not be fetched.
|
|
164
|
-
*/
|
|
165
|
-
readonly frameEmbeddable?: boolean;
|
|
166
|
-
}
|
|
167
|
-
interface FaviconCandidate {
|
|
168
|
-
readonly href: string;
|
|
169
|
-
readonly rel: string;
|
|
170
|
-
readonly sizes?: string;
|
|
171
|
-
}
|
|
172
|
-
/** Extract `<title>` text from HTML. */
|
|
173
|
-
declare const extractTitle: (html: string) => string | undefined;
|
|
174
|
-
/** Extract `<link rel=... href=...>` favicon candidates from HTML head. */
|
|
175
|
-
declare const extractFaviconCandidates: (html: string) => readonly FaviconCandidate[];
|
|
176
|
-
/** Largest dimension of a `sizes` attribute value such as `32x32` or `any`. */
|
|
177
|
-
declare const faviconCandidateSize: (candidate: FaviconCandidate) => number;
|
|
178
|
-
/** Resolve a favicon href against the service origin. */
|
|
179
|
-
declare const resolveFaviconUrl: (href: string, origin: string) => string | undefined;
|
|
180
|
-
/** Order candidates: declared-size icons descending, then apple-touch-icon, then others. */
|
|
181
|
-
declare const rankFaviconCandidates: (candidates: readonly FaviconCandidate[]) => readonly FaviconCandidate[];
|
|
182
|
-
interface ScrapePage {
|
|
183
|
-
readonly ok: boolean;
|
|
184
|
-
readonly status: number;
|
|
185
|
-
readonly body: string;
|
|
186
|
-
readonly headers: Record<string, string>;
|
|
187
|
-
}
|
|
188
|
-
interface ScrapeBytes {
|
|
189
|
-
readonly ok: boolean;
|
|
190
|
-
readonly status: number;
|
|
191
|
-
readonly bytes: Buffer;
|
|
192
|
-
readonly contentType: string;
|
|
193
|
-
}
|
|
194
|
-
interface ScrapeFetch {
|
|
195
|
-
page(url: string, timeoutMs?: number): Promise<ScrapePage>;
|
|
196
|
-
bytes(url: string, timeoutMs?: number): Promise<ScrapeBytes>;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Scrape title and ALL icon candidates from an arbitrary http(s) URL.
|
|
200
|
-
* Never throws: failures return `ok: false` with whatever partial identity
|
|
201
|
-
* was found. (`scrapeService` is the loopback-port wrapper over this.)
|
|
202
|
-
*/
|
|
203
|
-
declare const scrapeUrl: (url: string, options?: {
|
|
204
|
-
fetch?: ScrapeFetch;
|
|
205
|
-
tempDir?: string;
|
|
206
|
-
}) => Promise<ScrapeResult>;
|
|
207
|
-
/**
|
|
208
|
-
* Scrape title and ALL icon candidates from a service port. Never throws:
|
|
209
|
-
* failures return `ok: false` with whatever partial identity was found.
|
|
210
|
-
*/
|
|
211
|
-
declare const scrapeService: (port: number, options?: {
|
|
212
|
-
fetch?: ScrapeFetch;
|
|
213
|
-
tempDir?: string;
|
|
214
|
-
}) => Promise<ScrapeResult>;
|
|
215
|
-
//#endregion
|
|
216
|
-
//#region ../icon/src/generate.d.ts
|
|
217
|
-
interface OpenTrayAppIconOptions {
|
|
218
|
-
readonly sourcePath: string;
|
|
219
|
-
readonly outputPath?: string;
|
|
220
|
-
readonly icnsOutputPath?: string;
|
|
221
|
-
readonly icoOutputPath?: string;
|
|
222
|
-
readonly linuxOutputDirectory?: string;
|
|
223
|
-
readonly manifestOutputPath?: string;
|
|
224
|
-
readonly cachePath?: string;
|
|
225
|
-
/** Advanced: override the module whose bytes identify the generator implementation. */
|
|
226
|
-
readonly implementationPath?: string;
|
|
227
|
-
/** Advanced: override the source file whose bytes identify the generator implementation. */
|
|
228
|
-
readonly implementationSourcePath?: string;
|
|
229
|
-
/**
|
|
230
|
-
* Pre-composed source: skip glyph re-tiling; pass pixels through verbatim.
|
|
231
|
-
*/
|
|
232
|
-
readonly composed?: boolean;
|
|
233
|
-
/**
|
|
234
|
-
* Separate macOS content source; ICNS encodes from this while ICO/Linux
|
|
235
|
-
* use sourcePath.
|
|
236
|
-
*/
|
|
237
|
-
readonly macosSourcePath?: string;
|
|
238
|
-
}
|
|
239
|
-
interface OpenTrayAppIconCacheMetadata {
|
|
240
|
-
readonly schemaVersion: number;
|
|
241
|
-
readonly sourceSha256: string;
|
|
242
|
-
readonly macosSourceSha256?: string;
|
|
243
|
-
readonly composed?: boolean;
|
|
244
|
-
readonly sourceImplementationSha256: string | null;
|
|
245
|
-
readonly implementationSha256: string;
|
|
246
|
-
readonly recipeVersion: string;
|
|
247
|
-
readonly jsquashPngVersion: string;
|
|
248
|
-
readonly jsquashResizeVersion: string;
|
|
249
|
-
readonly resvgVersion: string;
|
|
250
|
-
readonly iconEncoderVersion: string;
|
|
251
|
-
readonly figmaSquircleVersion: string;
|
|
252
|
-
readonly exifrVersion: string;
|
|
253
|
-
readonly outputPath: string;
|
|
254
|
-
readonly icnsOutputPath: string;
|
|
255
|
-
readonly icoOutputPath: string;
|
|
256
|
-
readonly linuxPngOutputPaths: readonly {
|
|
257
|
-
readonly size: number;
|
|
258
|
-
readonly path: string;
|
|
259
|
-
}[];
|
|
260
|
-
readonly manifestOutputPath: string;
|
|
261
|
-
/** Absolute file sources ready to pass to OpenTray at runtime. */
|
|
262
|
-
readonly appIcon: AppIcon;
|
|
263
|
-
}
|
|
264
|
-
/** Generate one strict cross-platform AppIcon asset set. */
|
|
265
|
-
declare function generateOpenTrayAppIcon(options: OpenTrayAppIconOptions): Promise<OpenTrayAppIconCacheMetadata>;
|
|
266
|
-
//#endregion
|
|
267
|
-
//#region ../icon/src/default-icon.d.ts
|
|
268
|
-
interface DefaultAppIconOptions {
|
|
269
|
-
readonly appName: string;
|
|
270
|
-
readonly accent?: string;
|
|
271
|
-
readonly outputDir: string;
|
|
272
|
-
/**
|
|
273
|
-
* Output file stem. The runtime uses the default (`default-app-icon`); the
|
|
274
|
-
* create pipeline passes `app-icon` so the glyph fallback lands in the
|
|
275
|
-
* scaffold's standard catalog layout — one generator, one visual standard.
|
|
276
|
-
*/
|
|
277
|
-
readonly fileStem?: string;
|
|
278
|
-
/** Cache metadata path; defaults to `<outputDir>/../.cache/default-app-icon.json`. */
|
|
279
|
-
readonly cachePath?: string;
|
|
280
|
-
}
|
|
281
|
-
interface DefaultAppIconResult {
|
|
282
|
-
readonly fullPngPath: string;
|
|
283
|
-
readonly macOSPngPath: string;
|
|
284
|
-
readonly icnsPath: string;
|
|
285
|
-
readonly icoPath: string;
|
|
286
|
-
readonly linuxPngPaths: readonly {
|
|
287
|
-
size: number;
|
|
288
|
-
path: string;
|
|
289
|
-
}[];
|
|
290
|
-
readonly manifestPath: string;
|
|
291
|
-
/** Absolute file sources ready to pass to the runtime as `appIcon`. */
|
|
292
|
-
readonly appIcon: AppIcon;
|
|
293
|
-
readonly cacheIdentity: string;
|
|
294
|
-
/**
|
|
295
|
-
* True when the name's own first glyph could not be covered by the font
|
|
296
|
-
* ladder on this host and the neutral terminal mark was used instead
|
|
297
|
-
* (e.g. CJK names on CJK-less CI runners and containers).
|
|
298
|
-
*/
|
|
299
|
-
readonly degraded: boolean;
|
|
300
|
-
}
|
|
301
|
-
/** Generate (or reuse, by full identity) the default glyph App icon catalog. */
|
|
302
|
-
declare function generateDefaultAppIcon(options: DefaultAppIconOptions): Promise<DefaultAppIconResult>;
|
|
303
|
-
//#endregion
|
|
304
|
-
//#region ../icon/src/compose.d.ts
|
|
305
|
-
type IconBackground = "black" | "white" | "transparent";
|
|
306
|
-
//#endregion
|
|
307
|
-
//#region packages/core/src/command-run.d.ts
|
|
308
|
-
interface CommandRunEvent {
|
|
309
|
-
readonly type: "stdout" | "stderr" | "exit" | "spawn-error" | "pty-ready" | "pty-unavailable";
|
|
310
|
-
/** The PTY binding's output chunk, verbatim; rendering is the frontend's job. */
|
|
311
|
-
readonly chunk?: string;
|
|
312
|
-
readonly code?: number | null;
|
|
313
|
-
readonly message?: string;
|
|
314
|
-
/**
|
|
315
|
-
* Stable machine code for pty-unavailable events so consumers can localize
|
|
316
|
-
* (and detect) the reason without parsing the human-readable message.
|
|
317
|
-
*/
|
|
318
|
-
readonly reason?: "pty_bun_terminal_missing" | "pty_node_pty_missing";
|
|
319
|
-
}
|
|
320
|
-
interface CommandRunTerminalSize {
|
|
321
|
-
readonly cols: number;
|
|
322
|
-
readonly rows: number;
|
|
323
|
-
}
|
|
324
|
-
interface CommandRunOptions {
|
|
325
|
-
readonly tokens: readonly string[];
|
|
326
|
-
readonly cwd?: string;
|
|
327
|
-
readonly env?: NodeJS.ProcessEnv;
|
|
328
|
-
readonly ringLimit?: number;
|
|
329
|
-
/** Attach through a PTY when available; defaults to true. */
|
|
330
|
-
readonly pty?: boolean;
|
|
331
|
-
readonly terminalSize?: CommandRunTerminalSize;
|
|
332
|
-
readonly onEvent: (event: CommandRunEvent) => void;
|
|
333
|
-
}
|
|
334
|
-
interface CommandRun {
|
|
335
|
-
readonly pid: number | undefined;
|
|
336
|
-
readonly pty: boolean;
|
|
337
|
-
readonly exited: Promise<{
|
|
338
|
-
code: number | null;
|
|
339
|
-
spawnError?: string;
|
|
340
|
-
}>;
|
|
341
|
-
readonly output: readonly string[];
|
|
342
|
-
/** Write terminal input bytes to the command's stdin (PTY mode only). */
|
|
343
|
-
write(data: string): void;
|
|
344
|
-
/** Resize the pseudo-terminal (PTY mode only). */
|
|
345
|
-
resize(size: CommandRunTerminalSize): void;
|
|
346
|
-
kill(): Promise<void>;
|
|
347
|
-
}
|
|
348
|
-
declare const startCommandRun: (options: CommandRunOptions) => Promise<CommandRun>;
|
|
349
|
-
//#endregion
|
|
350
|
-
//#region packages/core/src/user-messages.d.ts
|
|
351
|
-
declare const UI_LOCALES: readonly ["zh-CN", "ja", "ko", "en", "ar", "fr", "es", "de", "ru"];
|
|
352
|
-
type UiLocale = (typeof UI_LOCALES)[number];
|
|
353
|
-
//#endregion
|
|
354
33
|
//#region packages/core/src/open-app.d.ts
|
|
355
34
|
interface OpenAppInput {
|
|
356
35
|
readonly projectDir: string;
|
|
@@ -369,408 +48,6 @@ declare const openMaterializedApp: (input: OpenAppInput) => Promise<OpenAppResul
|
|
|
369
48
|
*/
|
|
370
49
|
declare const pinningHint: (platform?: NodeJS.Platform, locale?: UiLocale) => string;
|
|
371
50
|
//#endregion
|
|
372
|
-
//#region packages/core/src/scaffold.d.ts
|
|
373
|
-
interface ScaffoldAppConfig {
|
|
374
|
-
readonly schemaVersion: 1;
|
|
375
|
-
readonly appId: string;
|
|
376
|
-
readonly appName: string;
|
|
377
|
-
/** Command source; exactly one of command/url is present (v1 XOR). */
|
|
378
|
-
readonly command?: LaunchVector;
|
|
379
|
-
/** URL source: the address the generated window opens directly. */
|
|
380
|
-
readonly url?: string;
|
|
381
|
-
readonly service: {
|
|
382
|
-
readonly port: number;
|
|
383
|
-
};
|
|
384
|
-
readonly window: {
|
|
385
|
-
readonly width: number;
|
|
386
|
-
readonly height: number; /** URL applications: host the address-bar wrapper (D12). */
|
|
387
|
-
readonly toolbar?: boolean;
|
|
388
|
-
readonly titleFollowsDocument: boolean;
|
|
389
|
-
readonly iconFollowsDocument: boolean;
|
|
390
|
-
};
|
|
391
|
-
/** Tray icon asset (written by materialize); omitted → text-only tray. */
|
|
392
|
-
readonly trayIcon?: {
|
|
393
|
-
readonly path: string;
|
|
394
|
-
readonly template: boolean;
|
|
395
|
-
};
|
|
396
|
-
/** Generated-app shell (startup terminal / address-bar tabs). */
|
|
397
|
-
readonly shell?: {
|
|
398
|
-
readonly showTerminal: boolean;
|
|
399
|
-
readonly showAddressBar: boolean;
|
|
400
|
-
};
|
|
401
|
-
/** v1 developerMode: only WebView DevTools admission; default false. */
|
|
402
|
-
readonly developerMode?: boolean;
|
|
403
|
-
}
|
|
404
|
-
interface ScaffoldOptions {
|
|
405
|
-
readonly config: ScaffoldAppConfig;
|
|
406
|
-
readonly targetDir: string;
|
|
407
|
-
/** opentray/@opentray/ext-webview version range written into package.json. */
|
|
408
|
-
readonly dependencyRange: string;
|
|
409
|
-
/** Whether install will be skipped; only affects README guidance text. */
|
|
410
|
-
readonly skipInstall?: boolean;
|
|
411
|
-
/** Directory holding the prebuilt shell UI (copied to app-shell/).
|
|
412
|
-
* Defaults to the adapter-staged assets resolved from the running package
|
|
413
|
-
* layout (published create-opentray/dist/shell, or the workspace build). */
|
|
414
|
-
readonly shellAssetsDir?: string;
|
|
415
|
-
}
|
|
416
|
-
interface ScaffoldResult {
|
|
417
|
-
readonly projectDir: string;
|
|
418
|
-
readonly entryPath: string;
|
|
419
|
-
readonly configPath: string;
|
|
420
|
-
readonly appIconDir: string;
|
|
421
|
-
readonly writtenFiles: readonly string[];
|
|
422
|
-
}
|
|
423
|
-
declare const writeScaffold: (options: ScaffoldOptions) => Promise<ScaffoldResult>;
|
|
424
|
-
//#endregion
|
|
425
|
-
//#region packages/core/src/materialize.d.ts
|
|
426
|
-
type MaterializeLogEvent = {
|
|
427
|
-
readonly type: "step";
|
|
428
|
-
readonly step: string;
|
|
429
|
-
readonly message: string;
|
|
430
|
-
} | {
|
|
431
|
-
readonly type: "log";
|
|
432
|
-
readonly message: string;
|
|
433
|
-
};
|
|
434
|
-
interface MaterializeInput {
|
|
435
|
-
readonly config: ScaffoldAppConfig;
|
|
436
|
-
readonly targetDir: string;
|
|
437
|
-
readonly dependencyRange: string;
|
|
438
|
-
readonly iconSourcePath: string | undefined;
|
|
439
|
-
/** True when the tray source is a solid silhouette (darwin template). */
|
|
440
|
-
readonly trayIconIsSolid?: boolean;
|
|
441
|
-
/** Icon composition (owner round-12): background + foreground scale. */
|
|
442
|
-
readonly iconBackground?: IconBackground;
|
|
443
|
-
readonly iconScale?: number;
|
|
444
|
-
/** Nearest-neighbor sampling for pixel-art sources (v1 imageSmoothingEnabled). */
|
|
445
|
-
readonly imageSmoothingEnabled?: boolean;
|
|
446
|
-
/** Tray icon source; defaults to the app icon source when omitted. */
|
|
447
|
-
readonly trayIconSourcePath?: string;
|
|
448
|
-
/** Generated-app shell options (startup terminal / address bar). */
|
|
449
|
-
readonly shell?: {
|
|
450
|
-
showTerminal: boolean;
|
|
451
|
-
showAddressBar: boolean;
|
|
452
|
-
};
|
|
453
|
-
/** Adapter-owned prebuilt shell UI directory (copied to app-shell/). */
|
|
454
|
-
readonly shellAssetsDir?: string;
|
|
455
|
-
readonly packageManager: "npm" | "pnpm" | "bun";
|
|
456
|
-
readonly skipInstall: boolean;
|
|
457
|
-
readonly force: boolean;
|
|
458
|
-
}
|
|
459
|
-
interface MaterializeResult {
|
|
460
|
-
readonly scaffold: ScaffoldResult;
|
|
461
|
-
readonly projectDir: string;
|
|
462
|
-
}
|
|
463
|
-
interface MaterializeContext {
|
|
464
|
-
readonly log: (event: MaterializeLogEvent) => void;
|
|
465
|
-
readonly generateIcon?: typeof generateOpenTrayAppIcon;
|
|
466
|
-
/** Same seam for the glyph default catalog (wizard tests stub both). */
|
|
467
|
-
readonly generateDefaultIcon?: typeof generateDefaultAppIcon;
|
|
468
|
-
readonly runInstall?: (options: RunInstallOptions) => Promise<void>;
|
|
469
|
-
}
|
|
470
|
-
interface RunInstallOptions {
|
|
471
|
-
readonly projectDir: string;
|
|
472
|
-
readonly packageManager: "npm" | "pnpm" | "bun";
|
|
473
|
-
readonly log: (message: string) => void;
|
|
474
|
-
}
|
|
475
|
-
/** True when the directory exists and contains anything beyond ignorable files. */
|
|
476
|
-
declare const isDirectoryOccupied: (dir: string) => Promise<boolean>;
|
|
477
|
-
/** Detect package manager from lockfiles then npm_config_user_agent. */
|
|
478
|
-
declare const detectPackageManager: (files: readonly string[], userAgent: string | undefined) => "npm" | "pnpm" | "bun";
|
|
479
|
-
/** Expected stable Darwin bundle path for the generated project's identity. */
|
|
480
|
-
declare const expectedDarwinBundlePath: (config: {
|
|
481
|
-
appName: string;
|
|
482
|
-
appId: string;
|
|
483
|
-
}) => string;
|
|
484
|
-
/**
|
|
485
|
-
* Backward-compatible composition used by the wizard adapter: generation is
|
|
486
|
-
* the payload phase. There is no first-launch validation — the wizard panel's
|
|
487
|
-
* command preview is the validator (decision D1).
|
|
488
|
-
*/
|
|
489
|
-
declare const materialize: (input: MaterializeInput, context: MaterializeContext) => Promise<MaterializeResult>;
|
|
490
|
-
//#endregion
|
|
491
|
-
//#region src/wizard.d.ts
|
|
492
|
-
interface WizardEnvEntry {
|
|
493
|
-
readonly key: string;
|
|
494
|
-
readonly value: string;
|
|
495
|
-
}
|
|
496
|
-
/** App-icon composition (owner round-12): foreground over black/white/
|
|
497
|
-
* transparent background; the wizard derives the auto suggestion. */
|
|
498
|
-
type WizardIconBackground = "black" | "white" | "transparent";
|
|
499
|
-
interface WizardIconComposition {
|
|
500
|
-
readonly key: string;
|
|
501
|
-
readonly compositePath: string;
|
|
502
|
-
readonly macOSPath: string;
|
|
503
|
-
readonly background: WizardIconBackground;
|
|
504
|
-
}
|
|
505
|
-
interface WizardIconAnalysis {
|
|
506
|
-
readonly luminance: number | undefined;
|
|
507
|
-
readonly coverage: number;
|
|
508
|
-
readonly suggested: WizardIconBackground;
|
|
509
|
-
}
|
|
510
|
-
/** Command execution options (advanced): working directory, custom env, and
|
|
511
|
-
* the input mode — array mode takes argv elements verbatim (no string
|
|
512
|
-
* splitting), string mode tokenizes one command line. */
|
|
513
|
-
interface WizardCommandOptions {
|
|
514
|
-
/** Empty = the wizard's working directory. */
|
|
515
|
-
readonly cwd: string;
|
|
516
|
-
readonly env: readonly WizardEnvEntry[];
|
|
517
|
-
readonly argsMode: "string" | "array";
|
|
518
|
-
/**
|
|
519
|
-
* 系列作者状态(plan.md D11 / Codex B1):显式投影是系列/appId 推导的
|
|
520
|
-
* 服务端权威(Rust 的 crate/binary 无法从命令串恢复);null = 按命令串派生。
|
|
521
|
-
* 命令串始终是执行/持久化向量。env 预设(npm_config_yes 等)不再有隐形
|
|
522
|
-
* 注入开关——env 行是唯一可信源(R10 用户拍板)。
|
|
523
|
-
*/
|
|
524
|
-
readonly family: FamilyFormState | null;
|
|
525
|
-
}
|
|
526
|
-
type WizardState = "idle" | "running" | "discovered" | "failed" | "frozen" | "materializing" | "success";
|
|
527
|
-
interface WizardFormValues {
|
|
528
|
-
readonly appId: string;
|
|
529
|
-
readonly appName: string;
|
|
530
|
-
readonly iconPath: string;
|
|
531
|
-
/** Icon composition (owner round-12). */
|
|
532
|
-
readonly iconBackground: WizardIconBackground;
|
|
533
|
-
readonly iconScale: number;
|
|
534
|
-
/** Empty = follow the app icon choice (default). */
|
|
535
|
-
readonly trayIconPath: string;
|
|
536
|
-
readonly pm: "npm" | "pnpm" | "bun";
|
|
537
|
-
/** Wipe an existing non-empty target directory before materializing. */
|
|
538
|
-
readonly force: boolean;
|
|
539
|
-
/** Advanced: render the command PTY in the generated app (default false). */
|
|
540
|
-
readonly showStartupTerminal: boolean;
|
|
541
|
-
/** Advanced: address-bar service tabs in the generated app (default false). */
|
|
542
|
-
readonly showAddressBar: boolean;
|
|
543
|
-
/** Advanced v1 sampling intent: false keeps pixel-art edges (default true). */
|
|
544
|
-
readonly imageSmoothingEnabled: boolean;
|
|
545
|
-
/** Advanced v1 developer mode: only WebView DevTools admission (default false). */
|
|
546
|
-
readonly developerMode: boolean;
|
|
547
|
-
}
|
|
548
|
-
/** Placeholder suggestions shown in the form; empty fields resolve to these. */
|
|
549
|
-
interface WizardFormDefaults {
|
|
550
|
-
readonly appId: string;
|
|
551
|
-
readonly appName: string;
|
|
552
|
-
/** Resolved project directory the app will be generated into. */
|
|
553
|
-
readonly targetDir: string;
|
|
554
|
-
/**
|
|
555
|
-
* Effective default icon source (the clearest scraped candidate). The form
|
|
556
|
-
* value stays empty until the user picks/upload; composition must follow
|
|
557
|
-
* this default too, or the preview would never appear without a click.
|
|
558
|
-
*/
|
|
559
|
-
readonly iconPath: string;
|
|
560
|
-
}
|
|
561
|
-
type WizardEvent = {
|
|
562
|
-
readonly type: "state";
|
|
563
|
-
readonly state: WizardState;
|
|
564
|
-
readonly reason?: string;
|
|
565
|
-
} | {
|
|
566
|
-
readonly type: "log";
|
|
567
|
-
readonly stream: "stdout" | "stderr";
|
|
568
|
-
readonly chunk: string;
|
|
569
|
-
} | {
|
|
570
|
-
readonly type: "term-mode";
|
|
571
|
-
readonly interactive: boolean;
|
|
572
|
-
readonly message?: string;
|
|
573
|
-
} | {
|
|
574
|
-
readonly type: "run-status";
|
|
575
|
-
readonly running: boolean;
|
|
576
|
-
readonly code?: number | null;
|
|
577
|
-
} | {
|
|
578
|
-
readonly type: "command-display";
|
|
579
|
-
readonly command: string;
|
|
580
|
-
} | {
|
|
581
|
-
readonly type: "command-options";
|
|
582
|
-
readonly options: WizardCommandOptions;
|
|
583
|
-
readonly defaultCwd: string;
|
|
584
|
-
} | {
|
|
585
|
-
readonly type: "services";
|
|
586
|
-
readonly services: readonly DiscoveredService[];
|
|
587
|
-
readonly selectedPort: number | undefined;
|
|
588
|
-
} | {
|
|
589
|
-
readonly type: "scrape";
|
|
590
|
-
readonly port: number;
|
|
591
|
-
readonly title?: string;
|
|
592
|
-
readonly hasIcon: boolean;
|
|
593
|
-
} | {
|
|
594
|
-
readonly type: "icons";
|
|
595
|
-
readonly port: number;
|
|
596
|
-
readonly icons: readonly ScrapedIcon[];
|
|
597
|
-
/** Bumps on every scrape-side REPLACEMENT of the list (not appends):
|
|
598
|
-
* indexes restart from zero per scrape, so clients keying per-candidate
|
|
599
|
-
* work (e.g. subject extraction) need this to tell generations apart. */
|
|
600
|
-
readonly generation: number;
|
|
601
|
-
} | {
|
|
602
|
-
readonly type: "form";
|
|
603
|
-
readonly values: WizardFormValues;
|
|
604
|
-
readonly defaults: WizardFormDefaults;
|
|
605
|
-
readonly targetDirExists: boolean;
|
|
606
|
-
} | {
|
|
607
|
-
readonly type: "materialize-log";
|
|
608
|
-
readonly message: string;
|
|
609
|
-
} | {
|
|
610
|
-
readonly type: "materialize-step";
|
|
611
|
-
readonly step: string;
|
|
612
|
-
readonly message: string;
|
|
613
|
-
} | {
|
|
614
|
-
readonly type: "success";
|
|
615
|
-
readonly projectDir: string;
|
|
616
|
-
readonly bundlePath?: string;
|
|
617
|
-
readonly pinHint: string;
|
|
618
|
-
} /** Authoritative whole-session state; sent to every NEW SSE client first. */ | {
|
|
619
|
-
readonly type: "snapshot";
|
|
620
|
-
readonly state: WizardState;
|
|
621
|
-
readonly runAlive: boolean;
|
|
622
|
-
readonly command: string; /** URL 模式激活时的源地址(命令模式为 undefined)。 */
|
|
623
|
-
readonly urlSource?: string;
|
|
624
|
-
readonly commandOptions: WizardCommandOptions;
|
|
625
|
-
readonly form: WizardFormValues;
|
|
626
|
-
readonly defaults: WizardFormDefaults;
|
|
627
|
-
readonly targetDirExists: boolean;
|
|
628
|
-
readonly services: readonly DiscoveredService[];
|
|
629
|
-
readonly selectedPort?: number | undefined;
|
|
630
|
-
readonly iconCandidates: readonly ScrapedIcon[];
|
|
631
|
-
readonly iconsPort?: number | undefined; /** Scrape-generation counter carried by icons events and snapshots. */
|
|
632
|
-
readonly iconsGeneration: number;
|
|
633
|
-
readonly interactive: boolean;
|
|
634
|
-
};
|
|
635
|
-
interface WizardOptions {
|
|
636
|
-
readonly cwd: string;
|
|
637
|
-
/**
|
|
638
|
-
* USER_HOME anchor: the command-execution default cwd AND the root of the
|
|
639
|
-
* default generated-project location (~/.opentray/create/<name>).
|
|
640
|
-
*/
|
|
641
|
-
readonly homeDir?: string;
|
|
642
|
-
/** Explicit project directory (CLI positional); default: the create root. */
|
|
643
|
-
readonly targetDir?: string | undefined;
|
|
644
|
-
readonly skipInstall: boolean;
|
|
645
|
-
/** Seed the 强制覆盖 toggle (CLI --force); the form owns the live value. */
|
|
646
|
-
readonly force?: boolean | undefined;
|
|
647
|
-
readonly packageManager?: "npm" | "pnpm" | "bun";
|
|
648
|
-
readonly dependencyRange: string;
|
|
649
|
-
readonly emit: (event: WizardEvent) => void;
|
|
650
|
-
readonly spawnRun?: typeof startCommandRun;
|
|
651
|
-
readonly listListeners?: () => Promise<ReadonlySet<number>>;
|
|
652
|
-
readonly verifyHttp?: (port: number) => Promise<boolean>;
|
|
653
|
-
/** Test/embedding seam for listener ownership. */
|
|
654
|
-
readonly listPortOwners?: () => Promise<ListenerOwners>;
|
|
655
|
-
readonly scrape?: typeof scrapeService;
|
|
656
|
-
/** Test seam for the URL-mode preset scrape. */
|
|
657
|
-
readonly scrapeUrl?: typeof scrapeUrl;
|
|
658
|
-
readonly resolveVector?: typeof resolveLaunchVector;
|
|
659
|
-
/** Test/embedding seam for PATH resolution of the cargo-install guard. */
|
|
660
|
-
readonly resolveOnPath?: typeof resolveOnPath;
|
|
661
|
-
/** Test/embedding seam for the materialize pipeline. */
|
|
662
|
-
readonly materializeContext?: Partial<MaterializeContext>;
|
|
663
|
-
readonly platform?: NodeJS.Platform;
|
|
664
|
-
readonly pollIntervalMs?: number;
|
|
665
|
-
readonly scrapeIntervalMs?: number;
|
|
666
|
-
}
|
|
667
|
-
interface WizardSession {
|
|
668
|
-
readonly state: WizardState;
|
|
669
|
-
readonly services: readonly DiscoveredService[];
|
|
670
|
-
readonly selectedPort: number | undefined;
|
|
671
|
-
/** True while the preview process is alive (Run button shows Interrupt). */
|
|
672
|
-
readonly runAlive: boolean;
|
|
673
|
-
/** Latest scraped icon candidates for the selected service, ranked by clarity. */
|
|
674
|
-
readonly iconCandidates: readonly ScrapedIcon[];
|
|
675
|
-
/** Persist an uploaded image into the session temp dir; returns its path. */
|
|
676
|
-
saveIconUpload(bytes: Buffer): Promise<string>;
|
|
677
|
-
/** Candidate lookup scoped to the port it was scraped from. */
|
|
678
|
-
iconCandidate(port: number, index: number): ScrapedIcon | undefined;
|
|
679
|
-
/** Select a scraped candidate as the icon source (marks the field touched). */
|
|
680
|
-
selectIconCandidate(port: number, index: number): boolean;
|
|
681
|
-
/** Select a candidate (original or solid variant) as the TRAY icon. */
|
|
682
|
-
selectTrayIconCandidate(port: number, index: number): boolean;
|
|
683
|
-
/** Test/extension seam: replace the scraped candidate set for a port. */
|
|
684
|
-
replaceIconCandidates(port: number, icons: readonly ScrapedIcon[]): void;
|
|
685
|
-
/** Append a wizard-derived candidate (e.g. browser-side subject extraction)
|
|
686
|
-
* for the port the current candidates belong to; bytes land in the
|
|
687
|
-
* session-owned temp dir so icon routes keep serving them. Returns the
|
|
688
|
-
* appended candidate, or undefined when the port/state rejects it. */
|
|
689
|
-
addIconCandidate(port: number, candidate: {
|
|
690
|
-
readonly bytes: Buffer;
|
|
691
|
-
readonly variantOf: number;
|
|
692
|
-
readonly width: number;
|
|
693
|
-
readonly height: number;
|
|
694
|
-
readonly format: string;
|
|
695
|
-
}): Promise<ScrapedIcon | undefined>;
|
|
696
|
-
/** Compose the app icon preview/asset for the current foreground. */
|
|
697
|
-
composeIcon(options: {
|
|
698
|
-
foregroundPath: string;
|
|
699
|
-
background?: WizardIconBackground;
|
|
700
|
-
scale?: number;
|
|
701
|
-
}): Promise<WizardIconComposition>;
|
|
702
|
-
/** Register a composition for token-scoped byte serving (server seam). */
|
|
703
|
-
trackIconComposition(composition: WizardIconComposition): void;
|
|
704
|
-
/** Look up a registered composition by cache key. */
|
|
705
|
-
iconComposition(key: string): WizardIconComposition | undefined;
|
|
706
|
-
/** Wizard-owned icon source roots (containment for icon routes). */
|
|
707
|
-
iconSourceRoots(): readonly string[];
|
|
708
|
-
/** Auto-suggestion for the foreground (background + reason). */
|
|
709
|
-
analyzeIconForeground(foregroundPath: string): Promise<WizardIconAnalysis>;
|
|
710
|
-
readonly form: WizardFormValues;
|
|
711
|
-
readonly result: MaterializeResult | undefined;
|
|
712
|
-
/** Adopt the webui's locale for every user-facing string this session emits. */
|
|
713
|
-
setLocale(locale: UiLocale): void;
|
|
714
|
-
/** Whole-session state for reconnecting clients (page refresh recovery). */
|
|
715
|
-
snapshot(): WizardEvent;
|
|
716
|
-
/** String form is tokenized; array form is taken as argv verbatim (array
|
|
717
|
-
* input mode — no string splitting is ever applied to it). */
|
|
718
|
-
submitCommand(command: string | readonly string[]): Promise<void>;
|
|
719
|
-
/** URL 模式入口:地址即源(一次抓取预设,进入 discovered 可确认态);
|
|
720
|
-
* 空 url 退出 URL 模式回到 idle。 */
|
|
721
|
-
submitUrl(url: string): Promise<void>;
|
|
722
|
-
/** Active URL-mode source address; undefined in command mode. */
|
|
723
|
-
readonly urlSource: string | undefined;
|
|
724
|
-
/** Derive placeholder defaults from command text without spawning anything. */
|
|
725
|
-
prime(command: string | readonly string[]): void;
|
|
726
|
-
readonly commandOptions: WizardCommandOptions;
|
|
727
|
-
updateCommandOptions(patch: Partial<WizardCommandOptions>): void;
|
|
728
|
-
selectService(port: number): void;
|
|
729
|
-
updateForm(patch: Partial<WizardFormValues>): void;
|
|
730
|
-
terminalInput(data: string): void;
|
|
731
|
-
terminalResize(size: {
|
|
732
|
-
cols: number;
|
|
733
|
-
rows: number;
|
|
734
|
-
}): void;
|
|
735
|
-
confirm(): void;
|
|
736
|
-
/** Abort a frozen confirmation and return to the editable pre-freeze state. */
|
|
737
|
-
cancel(): void;
|
|
738
|
-
/**
|
|
739
|
-
* Share the FROZEN parameters (wizard-share-and-list-scan D3): build an
|
|
740
|
-
* export artifact from the confirmation state WITHOUT running the command
|
|
741
|
-
* or materializing anything. Works pre-create. Scraped web icons keep
|
|
742
|
-
* their http source URL plus the icon-generation flags by default;
|
|
743
|
-
* `inlineIcon` opts into embedding the bytes instead.
|
|
744
|
-
*/
|
|
745
|
-
exportFrozen(options: {
|
|
746
|
-
readonly format: "command" | "sh" | "ps1";
|
|
747
|
-
readonly acknowledgeEnv?: boolean;
|
|
748
|
-
readonly forceCopy?: boolean; /** true=内嵌字节;false=按引用分享(URL/本地路径);缺省=按来源默认。 */
|
|
749
|
-
readonly inlineIcon?: boolean;
|
|
750
|
-
}): Promise<WizardExportResult>;
|
|
751
|
-
create(): Promise<void>;
|
|
752
|
-
stop(): Promise<void>;
|
|
753
|
-
}
|
|
754
|
-
type WizardExportResult = {
|
|
755
|
-
readonly ok: true;
|
|
756
|
-
readonly kind: "command";
|
|
757
|
-
readonly command: string;
|
|
758
|
-
} | {
|
|
759
|
-
readonly ok: true;
|
|
760
|
-
readonly kind: "script";
|
|
761
|
-
readonly filename: string;
|
|
762
|
-
readonly content: string; /** 核心调用行(不含注释/脚手架),复制命令用。 */
|
|
763
|
-
readonly commandLine: string;
|
|
764
|
-
readonly requiresEnvAcknowledgement: boolean; /** How the app icon actually traveled in this artifact. */
|
|
765
|
-
readonly iconSharedAs: "url" | "embedded" | "local" | "none"; /** What the icon source CAN be shared as: url / local path / none. */
|
|
766
|
-
readonly iconReference: "url" | "local" | "none";
|
|
767
|
-
} | {
|
|
768
|
-
readonly ok: false;
|
|
769
|
-
readonly code: "state_error" | "resolve_failed" | "env_ack_required" | "export_unsafe";
|
|
770
|
-
readonly message: string;
|
|
771
|
-
};
|
|
772
|
-
declare const createWizardSession: (options: WizardOptions) => WizardSession;
|
|
773
|
-
//#endregion
|
|
774
51
|
//#region src/server.d.ts
|
|
775
52
|
interface WizardServerHandle {
|
|
776
53
|
readonly url: string;
|