Pie in the Sky for agents: every Pie action classified and typed, its state and results documented

This commit is contained in:
Frederic Jung 2026-11-05 15:50:05 +01:00
parent b3153c020f
commit 267f9efc72
No known key found for this signature in database
5 changed files with 38 additions and 1 deletions

View file

@ -75,6 +75,15 @@ const API_DOMAINS={
// Entity ids (uid()) cannot be validated against a table: shape only. A wrong id is the game's
// to answer, honestly, with no_effect — never a refusal invented on this side of the wall.
entityId:{kind:'string'},
// Pie in the Sky (the rocket company, unlocked by a Tier 1 win in a new game or from day 0 in a sandbox).
rocketId:{table:'ROCKETS',kind:'key'},
crustId:{table:'CRUSTS',kind:'key'},
pieRdId:{table:'PIE_RD',kind:'key'},
pieTab:{kind:'enum',values:()=>PIE_TABS.slice()},
pieBidShare:{kind:'enum',values:()=>PIE_RDF_BIDS.slice()},
pieSpatId:{table:'PIE_SPAT_DEF',kind:'key'},
pieSpatChoice:{kind:'enum',values:[0,1]},
countryCode:{kind:'enum',values:()=>[...new Set(CITIES.map(c=>c.cc))].sort()},
scnId:{table:'SCN',kind:'id'},
// A traceroute target in the modal's own terms.
};

View file

@ -9,6 +9,20 @@
(may end in a question); reads 'modal' (the window's text is the report); watch (extra fingerprint paths, #name
filled from args); quote (the dry run, priced with the game's own helpers); doc. */
const API_CMD={
/* ---------- Pie in the Sky: the rocket company (Tier 1 in a new game, or a sandbox) ---------- */
pieFound:{args:[],watch:['pie'],quote:a=>({setup:piePrice(PIE_CO),monthly:PIE_CO_MO}),doc:'Found the rocket company. Needs Tier 1 (or a sandbox).'},
pieFactory:{args:[],watch:['pie'],quote:a=>({setup:piePrice(PIE_FAC)}),doc:'Build the pie factory: it bakes the satellites ("pies") that rockets carry.'},
piePad:{args:[['city','cityId']],watch:['pie'],doc:'Build a launch pad in a city. Pads near the equator lift more.'},
pieRd:{args:[['k','pieRdId']],watch:['pie'],quote:a=>({setup:piePrice(PIE_RD[a.k].cost)}),doc:'Fund rocket R&D: reuse (reusable boosters, cheaper launches) or heavy (a bigger rocket, after test flights).'},
pieLaunch:{args:[['rk','rocketId'],['cr','crustId']],watch:['pie'],doc:'Queue a launch of a rocket into a crust (an orbital shell). Insurance and lasers follow the Launch tab toggles (pieIns, pieLas).'},
pieDish:{args:[['city','cityId']],watch:['pie'],doc:'Build a pie dish (ground station) at one of your POPs. Needs landing rights in its country.'},
pieAnt:{args:[['id','entityId']],watch:['pie'],quote:a=>({setup:piePrice(PIE_ANT)}),doc:'Add an antenna to a pie dish (20 Gbps each, 16 at most).'},
pieLic:{args:[['cc','countryCode']],watch:['pie'],doc:'Buy or renew landing rights in a country, for its dishes and orbit customers.'},
pieSafe:{args:[],watch:['pie'],doc:'Toggle safe mode: pies ride out solar storms, carrying nothing meanwhile.'},
pieName:{args:[],watch:['pie'],doc:'Rename the rocket company to the next name on the list.'},
pieBid:{args:[['id','entityId'],['f','pieBidShare']],watch:['pie'],doc:'Bid in a Rural Digital Pie Fund auction, asking this share of the reserve. The lower ask wins.'},
pieExim:{args:[],watch:['pie','loans'],doc:'Take the Export-Import Pie Bank loan, with its space covenants.'},
pieSpatPick:{args:[['id','pieSpatId'],['c','pieSpatChoice']],watch:['pie'],doc:'Answer a geopolitical spat over orbit: choice 0 or 1, as its sheet offers.'},
downIx:{args:[['city','ixId']],watch:['ixp'],doc:'Step an exchange port down one size.'},
downT:{args:[['id','entityId']],watch:['transit.#id'],doc:'Step a transit port down one size (a LAG steps down together).'},
downP:{args:[['id','entityId']],watch:['pni.#id'],doc:'Step a PNI down one size. Not while an augment is on order.'},
@ -429,6 +443,15 @@ const API_CMD={
};
const API_VIEW={
pieOpen:{args:[],doc:'Open Pie Control, the rocket company\'s panel.'},
pieGovOpen:{args:[],doc:'Open Pie Control on its Gov tab.'},
pieTab:{args:[['t','pieTab']],doc:'Switch the Pie Control tab.'},
pieCity:{args:[['v','cityId']],doc:'Pick the POP the Dishes tab works on.'},
pieHi:{args:[['id','string']],doc:'Highlight one orbit flow on the Pie Control globe.'},
pieIns:{args:[],doc:'Toggle launch insurance for the next launches.'},
pieLas:{args:[],doc:'Toggle lasers (inter-satellite links) for the next launches.'},
pieGlobeNight:{args:[],doc:'Flip the Pie Control globe between day and night.'},
pieSpatOpen:{args:[['id','pieSpatId']],doc:'Open the sheet of a geopolitical spat over orbit.'},
traceMode:{args:[['m','string']],doc:'Redo the open traceroute in a routing mode: normal, fast or scenic.'},
chartToggle:{args:[['c','string'],['k','string']],doc:'Hide or show one series of a dashboard chart (a legend click); hiding every series shows them all again.'},
help:{args:[],doc:'Open the how-to-play modal.'},
@ -507,6 +530,7 @@ const API_VIEW={
};
const API_BOUND={
pieRename:{command:'pieName',note:'the typed company name'},
leaseSwap:{command:'orderDf',note:'presets the dark-fiber modal on a leased pair'},
teOpt:{command:'teDeploy',arg:'script',note:'the optimiser drafts a script'},
teSlop:{command:'teDeploy',arg:'script',note:'the AI drafts a script'},

View file

@ -52,6 +52,8 @@ const API_STATE_DOC={
scrubs:{type:'array',doc:'Scrubbing centres: city and tier.'},
scrubMode:{type:'string',doc:'always | ondemand.'},
cnLic:{type:'map',doc:'Mainland China licence: none | pending (with ready day) | ok.'},
pieV:{type:'number',doc:'Pie in the Sky version stamp: 1 in games started since it shipped (only those unlock it, on a Tier 1 win).'},
pie:{type:'map',doc:'The rocket company (Pie in the Sky), or null: company, factory, stock, pads, crusts (cohorts of pies by launch day), dishes, landing rights (lic), launch queue (q), R&D, spats, founder posts, books, and government money (gov: auctions, awards, Ex-Im).'},
ppol:{type:'string',doc:'Your published peering policy: open | selective | closed.'},
pdesk:{type:'map',doc:'This week\'s peering desk summary: sessions accepted and declined at which exchanges.'},
pdeskRep:{type:'map',doc:'Last week\'s peering desk summary, as the NOC log reported it.'},
@ -93,6 +95,7 @@ const API_STATE_DOC={
};
const API_RESULTS_DOC={
pie:{type:'map',doc:'Orbit this compute (only with a rocket company): revenue, service per orbit customer, landing dishes, flows through the sky, backhaul for cut-off POPs (bh), crust and dish load, government money (gov).'},
nt:{type:'map',doc:'Traffic per network through transit, by net id.'},
tNet:{type:'map',doc:'Traffic per network you hand to each upstream, by "net@upstream".'},
reachNT:{type:'number',doc:'Networks reachable without transit.'},

View file

@ -26,7 +26,7 @@ function apiJson(v){
carries the keys confGo/confSponsor need, which exist in no field of S; TE_RECIPES renders
each recipe's script, because the source is a function and some read the live network. The
recipes' relevance score is not exposed: judging which one fits is the agent's job. */
const API_TABLES={SALES,CITIES,NETS,CABLES,XIX,PORT,LT,NNI,VXC,RG,OPT,DF_SYS,FAB,SCRUB_TIERS,BIZ_T,LEVELS,GOALS,BROKER_GOALS,SCN,BANKS,REQS,NSH,MET,PREF,RT,PPOL,CONFS,LAG_MAX,RMAX,REGEN_MAX,START_CASH,CONF_COST,CONF_SP,CAP_COST,CAP_LV,CONF_DAYS,SUB_UPGRADES,SEA_DESIGNS,TE_COST,TE_MO,MYIX_COST,CN_LIC,SITE2_COST,MYIX_FAB,INTERNS,OPSK,CHARTERS,SEAT_N,CORE_LV,CORE_COST,CORE_REQ,CORE_LAB,INTERN_MO,PZ_TIERS,AR_TIERS,PZ_RG};
const API_TABLES={ROCKETS,CRUSTS,PIE_RD,PIE_SPAT_DEF,SALES,CITIES,NETS,CABLES,XIX,PORT,LT,NNI,VXC,RG,OPT,DF_SYS,FAB,SCRUB_TIERS,BIZ_T,LEVELS,GOALS,BROKER_GOALS,SCN,BANKS,REQS,NSH,MET,PREF,RT,PPOL,CONFS,LAG_MAX,RMAX,REGEN_MAX,START_CASH,CONF_COST,CONF_SP,CAP_COST,CAP_LV,CONF_DAYS,SUB_UPGRADES,SEA_DESIGNS,TE_COST,TE_MO,MYIX_COST,CN_LIC,SITE2_COST,MYIX_FAB,INTERNS,OPSK,CHARTERS,SEAT_N,CORE_LV,CORE_COST,CORE_REQ,CORE_LAB,INTERN_MO,PZ_TIERS,AR_TIERS,PZ_RG};
const API_MADE={
BADGES:()=>!S?[]:BADGES.map(b=>{const on=S.ach&&S.ach[b.id]!==undefined,ever=!!hof()[b.id];
return b.secret&&!on&&!ever?{id:b.id,i:'❔',t:'???',d:tr('badges.a_secret_badge'),r:b.r,secret:true}:{...b,ever};}),