@punica/editor 1.9.0 → 1.9.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punica/editor",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Punica Editor",
5
5
  "private": false,
6
6
  "type": "module",
@@ -290,6 +290,52 @@ declare module 'punica' {
290
290
  reply(requestId: string, response: unknown): void;
291
291
  }
292
292
 
293
+ /**
294
+ * What the machine has, as the host measured it.
295
+ *
296
+ * Exists because "will this fit" is a question the user cannot answer and
297
+ * the substrate must not guess: a 18 GB model download onto a disk with
298
+ * 4 GB free is a failure that takes twenty minutes to arrive. Numbers are
299
+ * reported, never interpreted — whether a given model fits is a product
300
+ * judgement and belongs in whatever extension is offering the download.
301
+ */
302
+ export interface HostSystemInfo {
303
+ /** Node's `os.platform()` value; matched against, not displayed. */
304
+ platform: 'darwin' | 'win32' | 'linux' | string;
305
+ /** Node's `os.arch()` value (`arm64`, `x64`, ...). */
306
+ arch: string;
307
+ cpuCount: number;
308
+ totalMemoryBytes: number;
309
+ /**
310
+ * Memory not in use right now. Far less useful than it looks on a
311
+ * machine with a unified/compressed memory manager, where most of RAM
312
+ * reads as "used" by the page cache; size a workload against
313
+ * `totalMemoryBytes` and treat this as a hint.
314
+ */
315
+ freeMemoryBytes: number;
316
+ /**
317
+ * Free bytes on the filesystem holding the requested path. ABSENT
318
+ * rather than zero when the host cannot measure it — zero would read as
319
+ * "full disk" and block downloads that would have worked.
320
+ */
321
+ freeDiskBytes?: number;
322
+ /** The path `freeDiskBytes` was measured for. */
323
+ diskPath?: string;
324
+ }
325
+
326
+ /**
327
+ * Read-only machine facts. Optional: a browser host has no honest answer
328
+ * for any of these, and inventing one is worse than the surface being
329
+ * absent, which callers can feature-detect.
330
+ */
331
+ export interface HostSystemApi {
332
+ /**
333
+ * @param opts.path Which filesystem to measure free space on. The host
334
+ * picks its own default (typically the user's home) when omitted.
335
+ */
336
+ info(opts?: { path?: string }): Promise<HostSystemInfo>;
337
+ }
338
+
293
339
  /**
294
340
  * Host-injected surface for the host's persistent data directory — the
295
341
  * place for large artifacts that must NOT pollute the workspace. Provided
@@ -320,6 +366,13 @@ declare module 'punica' {
320
366
  * a local listener (browser) omit it; the facade throws on use.
321
367
  */
322
368
  mcpServer?: HostMcpServerApi;
369
+ /**
370
+ * Optional machine-facts surface (Electron). Absent on hosts that
371
+ * cannot measure the machine (browser); callers feature-detect with
372
+ * `runtime.host.system` rather than catching an error, because "we do
373
+ * not know how much disk you have" is a state the UI can render.
374
+ */
375
+ system?: HostSystemApi;
323
376
  }
324
377
  }
325
378
  }