serve --stdio: desktop JSON-RPC profile on the MCP core, confirm tokens, --json results, sidecar builds

- cli/serve.ts: session.hello with a per-session secret, typed methods per tool, project.inspect,
  portfolio.status over many project folders, progress notifications, cancellation
- cli/lib/confirm-token.ts: single-use HMAC tokens bound to method + canonical params + expiry;
  writes are dry runs without one; no submit / release / publish method exists
- cli/lib/runner.ts: shared child runner for mcp and serve, works from a compiled binary
- --json on check, testflight / ppo status, next-build, next-version-code, analytics compare,
  prices import; inspect command; confirm() always answers no under serve
- tools/build-sidecars.ts: bun build --compile for five targets, ad-hoc re-sign on macOS, path leak check
- tests/serve.test.ts: methods, token binding / expiry / replay, shared vector, stdio and compiled smoke
This commit is contained in:
CRTkafa 2026-10-10 17:11:56 +00:00
parent c6360812b8
commit 3454a9aadb
28 changed files with 1048 additions and 42 deletions

View file

@ -11,7 +11,7 @@ import { existsSync, readdirSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import type { ShipConfig } from '../lib/config';
import type { Ctx } from '../lib/ctx';
import { log } from '../lib/log';
import { log, printJson } from '../lib/log';
import { checkFrames, type FrameIssue } from './devices';
import { defaultSizes, frameDims, SIZES } from './lib';
import type { LocalIssue, RendersCheck } from '../lib/validate-rules';
@ -64,7 +64,7 @@ export async function run(ctx: Ctx): Promise<void> {
const cap = config.shots?.capture;
const frameIssues = cap?.source === 'folder' ? checkFrameFolder(config, resolve(cap.folder ?? config.shots!.frames), scan.langs) : [];
if (ctx.args.has('json')) {
console.log(JSON.stringify({ images: scan.images.length, videos: scan.videos.length, issues, frames: frameIssues }, null, 2));
printJson({ images: scan.images.length, videos: scan.videos.length, issues, frames: frameIssues });
} else {
for (const { where, issue } of issues) console.log(`${issue.level === 'error' ? 'ERROR' : 'warn '} ${where}: ${issue.msg}`);
for (const f of frameIssues) console.log(`ERROR frames/${f.file}: ${f.msg}`);