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
|
|
@ -1,5 +1,5 @@
|
|||
// App Store Product Page Optimization through the App Store Connect API, wired to the `shots` variants.
|
||||
// storebound apple ppo status
|
||||
// storebound apple ppo status [--json]
|
||||
// storebound apple ppo create --variant b[,c] [--name "..."] [--traffic 30] [--dry]
|
||||
// storebound apple ppo upload --variant b [--experiment "..."] [--only en-US,tr] [--src store/renders] [--dry]
|
||||
// storebound apple ppo start | stop [--experiment "..."] [--dry] [--yes]
|
||||
|
|
@ -13,7 +13,7 @@ import { existsSync } from 'node:fs';
|
|||
import { join } from 'node:path';
|
||||
import type { Ctx } from '../lib/ctx';
|
||||
import { byAppleLocale, confirm, need } from '../lib/ctx';
|
||||
import { done, log, warn } from '../lib/log';
|
||||
import { done, log, printJson, warn } from '../lib/log';
|
||||
import {
|
||||
checkCreate, createExperimentReq, defaultName, type Experiment, experimentFromApi, pickExperiment, planTreatmentLocales, planTreatments, startStopReq,
|
||||
} from '../lib/ppo';
|
||||
|
|
@ -44,6 +44,16 @@ export async function run(ctx: Ctx): Promise<void> {
|
|||
const list = await experiments(c, appId);
|
||||
const locales = config.languages.map(l => l.apple).filter((x): x is string => !!x);
|
||||
|
||||
if (sub === 'status' && a.has('json')) {
|
||||
const tests = [];
|
||||
for (const x of list) {
|
||||
const ts = [];
|
||||
if (!['COMPLETED', 'STOPPED'].includes(x.state)) for (const t of await treatments(c, x.id)) ts.push({ id: t.id, name: t.attributes.name, locales: (await treatmentLocs(c, t.id)).length });
|
||||
tests.push({ ...x, treatments: ts });
|
||||
}
|
||||
printJson({ tests });
|
||||
return;
|
||||
}
|
||||
if (sub === 'status') {
|
||||
if (!list.length) { done(TAG, 'no Product Page Optimization tests (storebound apple ppo create --variant b)'); return; }
|
||||
console.log(textTable(['test', 'state', 'traffic', 'start', 'end'], list.map(x => [x.name, x.state, x.trafficProportion !== undefined ? `${x.trafficProportion}%` : '', (x.startDate ?? '').slice(0, 10), (x.endDate ?? '').slice(0, 10)])));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue