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:
parent
c6360812b8
commit
3454a9aadb
28 changed files with 1048 additions and 42 deletions
|
|
@ -4,6 +4,7 @@
|
|||
// ./gradlew bundleRelease -PversionCode=$(storebound play next-version-code)
|
||||
import type { Ctx } from '../lib/ctx';
|
||||
import { need } from '../lib/ctx';
|
||||
import { printJson } from '../lib/log';
|
||||
import { nextVersionCode } from '../lib/release';
|
||||
import { playClient } from './client';
|
||||
|
||||
|
|
@ -16,8 +17,11 @@ export async function run(ctx: Ctx): Promise<void> {
|
|||
const apks = (await play.call<{ apks?: { versionCode: number }[] }>('GET', `${play.API}/edits/${e.id}/apks`).catch(() => ({ apks: [] }))).apks ?? [];
|
||||
const tracks = (await play.call<{ tracks?: { releases?: { versionCodes?: string[] }[] }[] }>('GET', `${play.API}/edits/${e.id}/tracks`)).tracks ?? [];
|
||||
const codes = [...bundles.map(b => b.versionCode), ...apks.map(a => a.versionCode), ...tracks.flatMap(t => (t.releases ?? []).flatMap(r => r.versionCodes ?? []))];
|
||||
console.error(`[play] ${codes.length} version codes seen; next versionCode:`);
|
||||
console.log(nextVersionCode(codes));
|
||||
if (ctx.args.has('json')) printJson({ next: nextVersionCode(codes), seen: codes.length });
|
||||
else {
|
||||
console.error(`[play] ${codes.length} version codes seen; next versionCode:`);
|
||||
console.log(nextVersionCode(codes));
|
||||
}
|
||||
} finally {
|
||||
await play.call('DELETE', `${play.API}/edits/${e.id}`).catch(() => {});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// storebound play status [--json]
|
||||
import type { Ctx } from '../lib/ctx';
|
||||
import { need } from '../lib/ctx';
|
||||
import { printJson } from '../lib/log';
|
||||
import { playClient } from './client';
|
||||
import { listOneTimeProducts } from './products';
|
||||
|
||||
|
|
@ -16,7 +17,7 @@ export async function run(ctx: Ctx): Promise<void> {
|
|||
const listings = (await play.call<{ listings?: { language: string }[] }>('GET', `${play.API}/edits/${e.id}/listings`)).listings ?? [];
|
||||
const details = await play.call<Record<string, string>>('GET', `${play.API}/edits/${e.id}/details`);
|
||||
const products = await listOneTimeProducts(play);
|
||||
if (ctx.args.has('json')) { console.log(JSON.stringify({ details, tracks, listings, products }, null, 2)); return; }
|
||||
if (ctx.args.has('json')) { printJson({ details, tracks, listings, products }); return; }
|
||||
console.log(`${play.packageName}\n details: ${details.defaultLanguage} · ${details.contactEmail ?? '-'} · ${details.contactWebsite ?? '-'}`);
|
||||
console.log(` listings (${listings.length}): ${listings.map(l => l.language).join(', ') || '-'}`);
|
||||
for (const t of tracks) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue