@pmate/cli 0.37.2 → 0.38.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 CHANGED
@@ -270,31 +270,36 @@ Meili's Host may pass `--actor-profile-id` with `PMATE_LOG_DELEGATE_TOKEN` in th
270
270
 
271
271
  Packaged installers are automatically uploaded to Aliyun OSS (`parrot-static`), using the same credentials as Android APK releases. The completion output and build report include public download URLs, SHA-256 checksums, and a `release.json` URL. Configure `oss.public.region` and `aliyun.ak/sk` in your PMate configuration. Conflicting published versions require an app version bump. `--dir` produces local unpacked output only; `--dry-run` does not upload.
272
272
 
273
- `pmate app build <ns:app> --target electron --config <file>` builds the configured web app, embeds its static output in an Electron ASAR, and produces a macOS DMG and ZIP. Packaged releases require a CLI login with admin permission in the app namespace; `--dir` and `--dry-run` stay local. The first build downloads pinned Electron and electron-builder versions. Current targets: macOS and Windows, `arm64` and `x64`; macOS packages require a macOS build host.
273
+ `pmate app build <ns:app> --target electron --config <file>` packages a native shell that loads its configured HTTPS origin directly, without building or embedding web resources, and produces macOS DMG/ZIP or Windows NSIS/ZIP artifacts. Packaged releases require a CLI login with admin permission in the app namespace; `--dir` and `--dry-run` stay local. The first build downloads pinned Electron and electron-builder versions. Current targets: macOS and Windows, `arm64` and `x64`; macOS packages require a macOS build host.
274
274
 
275
275
  ```sh
276
276
  pmate app build pmate:hello --target electron --config apps/hello/desktop.config.json --platform mac --arch arm64 --out-dir release/desktop
277
277
  ```
278
278
 
279
- Config (paths relative to the config file, `web.dist` relative to `web.cwd`):
279
+ Config schema 2 (`icon` is relative to the config file; migrate schema 1 by removing `web` and changing `schemaVersion` to 2):
280
280
 
281
281
  ```json
282
282
  {
283
- "schemaVersion": 1,
283
+ "schemaVersion": 2,
284
284
  "app": "pmate:hello",
285
285
  "productName": "Going Merry",
286
286
  "bundleId": "chat.pmate.goingmerry",
287
287
  "version": "0.1.0",
288
288
  "origin": "https://hello.pmate.chat",
289
289
  "authOrigins": ["https://auth.pmate.chat"],
290
- "icon": "desktop/icon.png",
291
- "web": { "cwd": ".", "build": ["pnpm", "run", "build"], "dist": "dist" }
290
+ "icon": "desktop/icon.png"
292
291
  }
293
292
  ```
294
293
 
295
294
  Use `--dry-run` to inspect the plan, `--dir` for an unpacked `.app`, or `--signed` to require a configured macOS signing identity. Default builds are ad-hoc signed for local use; they are not notarized distribution releases. Signed builds use electron-builder's standard signing/notarization environment variables; verify notarization separately before distributing.
296
295
 
297
- The shell serves the bundled renderer under its existing exact HTTPS origin, preserving authentication callbacks and API CORS. Other origins remain normal network requests. Static resources are hashed and checked at launch; missing assets return 404. The renderer is sandboxed with Node disabled and no privileged preload bridge. Sign-in, chat and inference still require internet. The native application menu includes **检查更新…**. It queries apps-api, compares stable versions, and opens the official installer download after confirmation. Installation remains manual. Each build prints its artifact directory and a resource/signing report; packaged releases upload installers and register the version; `--dir` stays local.
296
+ The shell loads the deployed HTTPS website. Packaging requires only the desktop configuration, icon and native runtime dependencies: no frontend package manager, source tree or `dist` is needed. Web UI, business logic and compatible frontend bridge SDK changes ship through web deployment; the next open or user refresh receives them. Do not reload an active conversation or call automatically. Rebuild installers only when installed preload/main-process bridge code, native capabilities/permissions, or the Electron runtime must change. The first migration from an embedded renderer needs one new installer.
297
+
298
+ `@pmate/bridge` provides `getDesktopBridge()`, runtime `appVersion`, `electronVersion`, `bridgeVersion`, `contentSource`, and callable capability detection. npm SDK versions are independent of the installed host protocol. Missing host capabilities must be shown as unsupported or requiring a shell upgrade; never infer them from the Electron engine version. Preload APIs are exposed only to the configured origin's main frame; auth windows do not receive native APIs. IPC validates the sender and frame, with Node disabled, sandbox and context isolation enabled. The local offline page offers retry without clearing the existing user-data partition. Website CSP and cache policy apply to remote pages.
299
+
300
+ Verify changes with `pnpm exec vitest run src/tests/electron*.test.ts` and `pnpm typecheck`. With `PMATE_TEST_ELECTRON_PATH` pointing to an Electron executable, run `node scripts/test-electron-online-runtime.cjs` for real HTTPS loading, web revision changes without a rebuild, IPC isolation, offline retry and data persistence. Set `PMATE_TEST_LIVE_ORIGIN=https://merry.pmate.chat` to include production SPA loading. Run `node scripts/test-electron-calls-runtime.cjs` for the isolated incoming-call flow. Certificate bypass is restricted to the local test process; production code keeps certificate validation enabled.
301
+
302
+ The native application menu includes **检查更新…**, which checks installed shell releases through apps-api and opens the verified installer after confirmation. Installation remains manual. Each build prints its artifact directory and signing report; packaged releases upload installers and register the version; `--dir` stays local.
298
303
 
299
304
  ### 日志统计默认口径
300
305
 
@@ -330,6 +335,6 @@ pmate service ios build td:time-duck-ios --scheme TimeDuck --team D9D59BE76S
330
335
 
331
336
  Register an `ios` service with `repository` and `dir`. `--cwd` overrides the repository root; `--project` / `--workspace` paths are relative to the app directory. Exactly one discovered project/workspace is required unless explicitly selected. Always provide `--scheme`; `--team` overrides the project's signing team. `--json` returns version, Build, archive and log paths after upload.
332
337
 
333
- The first invocation requires `--last-build <highest-used-build>` (0 only for a new app). The next Build is one greater than the maximum of the project value, imported value and locally reserved sequence. A previous date-based Build therefore continues as that integer plus one. Import the current Apple maximum again after uploads outside this CLI or on another machine; this command does not query Apple build history. Do not lower or delete the sequence to reuse a number.
338
+ The first invocation for each marketing version requires `--last-build <highest-used-build-for-this-version>` (0 only for a new version). The next Build is one greater than the maximum of the project value, imported value and locally reserved sequence for that version. Reservations, including failed builds, are kept separately per version. To migrate published date-based numbers, first increase MARKETING_VERSION and set CURRENT_PROJECT_VERSION to 0, then import 0 for the new version to start at Build 1. Import the current Apple maximum again after uploads outside this CLI or on another machine; this command does not query Apple build history. Do not lower or delete the sequence to reuse a number. Burgess performs the Apple history check and version migration automatically.
334
339
 
335
340
  Sequences, retained archives, derived data and logs live in `~/.pmate/ios-builds/`. Project/source version files are not changed. A bundle-level exclusive lock prevents simultaneous builds on the same machine; it does not coordinate different machines. Build/upload failures keep the reserved number and logs; retry consumes the next number. After an interrupted process, remove a leftover `.lock` file only after confirming no build is still running. Builds require automatic signing; resolve Apple account/certificate/profile errors in Xcode. Extension or App targets with fixed plist versions must produce matching archive metadata or the upload is stopped.