@pmate/cli 0.30.2 → 0.32.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
@@ -234,15 +234,44 @@ Notes:
234
234
  - `pmate vercel` is a thin wrapper around the installed `vercel` CLI.
235
235
  - v1 only supports `vercel.scope` in PMate config.
236
236
  - `pmate vercel deploys` requires `--project <name>`.
237
- # App-scoped access logs
237
+ # Service logs
238
238
 
239
- Developers access logs use the same authenticated API as `dev.pmate.chat`, so CLI users cannot bypass App-Service associations or `pmate:dev` authorization by reading the Indexer directly.
239
+ Service logs use the same authenticated API as `dev.pmate.chat`. Each registered Service has `app` (application/deployment) and `runtime` (PM2/Nginx) Table topics on the dedicated `log` chain.
240
240
 
241
241
  ```sh
242
- pmate service log pmate:developers-api --app pmate:developers --page 0 --json
243
- pmate service log pmate:developers-api --app pmate:developers --search http.access --since-ms 1790000000000 --json
242
+ pmate service log pmate:issues-api --topic app --page 0 --json
243
+ pmate service log pmate:issues-api --topic runtime --source nginx --level error --env prod
244
+ pmate service log pmate:issues-api --request-id <id> --follow
244
245
  ```
245
246
 
246
- Pages are zero-based. `--search` searches the last 24 hours; the ordinary list follows the Indexer's retention window (currently seven days). `--since-ms` is an epoch-millisecond lower bound. This mode does not accept `--env`, `--follow`, `--history`, or `--base-url`: environment filtering and follow are not implemented by the shared API and are never silently ignored. Without `--app`, the existing operational service-log command is unchanged.
247
+ Pages are zero-based. Lists and `--search` cover the chain's configured retention window (30 days in production). `--since-ms` adds an epoch-millisecond lower bound. `--type`, `--level`, `--source`, `--request-id` and `--env` filter on the server. The legacy `--app` argument is optional and does not select a different source.
247
248
 
248
- A current CLI session is exchanged in memory for `pmate:developers`; the active App and session file are not changed. If login is required, run `pmate login --app pmate:developers`. Access denial never falls back to anonymous log reads. Neither source nor exchanged tokens are printed.
249
+ A current CLI session is exchanged in memory for `pmate:developers`; the active App and session file are unchanged. If needed, run `pmate login --app pmate:developers`. Permission denial never falls back to anonymous Indexer reads. Credentials are never printed.
250
+
251
+ ### Package a desktop app
252
+
253
+ `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. It does not require registry login. The first build downloads pinned Electron and electron-builder versions. Current targets: macOS `arm64` and `x64`, built on macOS.
254
+
255
+ ```sh
256
+ pmate app build pmate:hello --target electron --config apps/hello/desktop.config.json --platform mac --arch arm64 --out-dir release/desktop
257
+ ```
258
+
259
+ Config (paths relative to the config file, `web.dist` relative to `web.cwd`):
260
+
261
+ ```json
262
+ {
263
+ "schemaVersion": 1,
264
+ "app": "pmate:hello",
265
+ "productName": "Going Merry",
266
+ "bundleId": "chat.pmate.goingmerry",
267
+ "version": "0.1.0",
268
+ "origin": "https://hello.pmate.chat",
269
+ "authOrigins": ["https://auth.pmate.chat"],
270
+ "icon": "desktop/icon.png",
271
+ "web": { "cwd": ".", "build": ["pnpm", "run", "build"], "dist": "dist" }
272
+ }
273
+ ```
274
+
275
+ 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.
276
+
277
+ 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. Updates require a new package. Each build prints its artifact directory and a resource/signing report; no build uploads or auto-updates occur.
package/dist/index.d.ts CHANGED
@@ -815,6 +815,19 @@ type StoreCommandArgs = ({
815
815
  filePath?: string;
816
816
  } & StoreSharedArgs);
817
817
  type AppCommandArgs = {
818
+ type: Command.App;
819
+ action: "build";
820
+ id: string;
821
+ target: "electron";
822
+ config: string;
823
+ platform: string;
824
+ arch: string;
825
+ outDir: string;
826
+ dryRun: boolean;
827
+ signed: boolean;
828
+ dir: boolean;
829
+ json: boolean;
830
+ } | {
818
831
  type: Command.App;
819
832
  action: "list";
820
833
  namespace?: string;
@@ -957,6 +970,11 @@ type ServiceCommandArgs = {
957
970
  } | {
958
971
  type: Command.Service;
959
972
  action: "log";
973
+ topic?: "app" | "runtime";
974
+ level?: string;
975
+ source?: string;
976
+ requestId?: string;
977
+ logType?: string;
960
978
  app?: string;
961
979
  sinceMs?: number;
962
980
  namespace: string;