@maka/maka-cli 5.17.17 → 5.17.18
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/bundle/typescript/package.json +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/archetypes.js +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/archetypes.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/command.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/command.js +10 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/command.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/compile.d.ts +27 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/compile.js +8 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/compile.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/crew.d.ts +12 -2
- package/bundle/typescript/src/commands/game/sideQuest/commands/crew.js +69 -79
- package/bundle/typescript/src/commands/game/sideQuest/commands/crew.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/players.d.ts +4 -6
- package/bundle/typescript/src/commands/game/sideQuest/commands/players.js +6 -9
- package/bundle/typescript/src/commands/game/sideQuest/commands/players.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/commands/register.d.ts +16 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/register.js +74 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/register.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/thread.d.ts +17 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/thread.js +165 -0
- package/bundle/typescript/src/commands/game/sideQuest/commands/thread.js.map +1 -0
- package/bundle/typescript/src/commands/game/sideQuest/engine-version.d.ts +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/engine-version.js +3 -1
- package/bundle/typescript/src/commands/game/sideQuest/engine-version.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/game.d.ts +17 -4
- package/bundle/typescript/src/commands/game/sideQuest/game.js +122 -46
- package/bundle/typescript/src/commands/game/sideQuest/game.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/player.d.ts +9 -1
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js +17 -4
- package/bundle/typescript/src/commands/game/sideQuest/models/player.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/types/save-file.d.ts +7 -0
- package/bundle/typescript/src/commands/game/sideQuest/utilities/shared-run.d.ts +5 -5
- package/bundle/typescript/src/commands/game/sideQuest/utilities/shared-run.js +9 -9
- package/bundle/typescript/src/commands/game/sideQuest/utilities/shared-run.js.map +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/social.d.ts +1 -30
- package/bundle/typescript/src/commands/game/sideQuest/utilities/social.js +4 -89
- package/bundle/typescript/src/commands/game/sideQuest/utilities/social.js.map +1 -1
- package/package.json +1 -1
- package/bundle/typescript/src/commands/game/sideQuest/utilities/crew-ledger.d.ts +0 -21
- package/bundle/typescript/src/commands/game/sideQuest/utilities/crew-ledger.js +0 -25
- package/bundle/typescript/src/commands/game/sideQuest/utilities/crew-ledger.js.map +0 -1
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import * as http from 'http';
|
|
2
2
|
import * as https from 'https';
|
|
3
|
-
import { Logger } from './logger.js';
|
|
4
3
|
import { authToken } from './cloud-saves.js';
|
|
5
|
-
import { readCrewLedger } from './crew-ledger.js';
|
|
6
|
-
import * as fs from 'fs';
|
|
7
|
-
import * as os from 'os';
|
|
8
|
-
import * as path from 'path';
|
|
9
4
|
/**
|
|
10
5
|
* THE SOCIAL LAYER, CLI side (party system Phase B): presence
|
|
11
|
-
* heartbeats while at the hub
|
|
12
|
-
* fetches (hire another player's runner as an AI-driven crew member),
|
|
13
|
-
* and the earnings ledger sync that routes a ghost's cut home. Same
|
|
6
|
+
* heartbeats while at the hub and the street's player list. Same
|
|
14
7
|
* transport school as cloud-saves.ts: own http/https (the shared HTTPS
|
|
15
8
|
* tool is 443-only), MAKA_DEV env switch, x-auth-token, short timeouts,
|
|
16
9
|
* and everything degrades to a silent no-op when logged out or offline
|
|
@@ -58,27 +51,6 @@ function parseData(raw) {
|
|
|
58
51
|
return undefined;
|
|
59
52
|
}
|
|
60
53
|
}
|
|
61
|
-
// ---- The "hireable while away" opt-in (global-config, hints.ts school) ----
|
|
62
|
-
const GLOBAL_CONFIG_PATH = path.join(os.homedir(), '.meteor', '.maka', 'global-config.json');
|
|
63
|
-
export function ghostHireable() {
|
|
64
|
-
try {
|
|
65
|
-
const cfg = JSON.parse(fs.readFileSync(GLOBAL_CONFIG_PATH, 'utf8'));
|
|
66
|
-
return cfg?.sideQuest?.ghostHireable === true;
|
|
67
|
-
}
|
|
68
|
-
catch {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
export function setGhostHireable(on) {
|
|
73
|
-
try {
|
|
74
|
-
const cfg = JSON.parse(fs.readFileSync(GLOBAL_CONFIG_PATH, 'utf8'));
|
|
75
|
-
cfg.sideQuest = { ...(cfg.sideQuest ?? {}), ghostHireable: on };
|
|
76
|
-
fs.writeFileSync(GLOBAL_CONFIG_PATH, JSON.stringify(cfg, null, 2));
|
|
77
|
-
}
|
|
78
|
-
catch {
|
|
79
|
-
/* no config yet -- the flag only means anything when logged in */
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
54
|
/** Fire-and-forget hub heartbeat. Silent on every failure mode. */
|
|
83
55
|
export async function heartbeatPresence(payload) {
|
|
84
56
|
const token = authToken();
|
|
@@ -92,8 +64,7 @@ export async function heartbeatPresence(payload) {
|
|
|
92
64
|
}
|
|
93
65
|
}
|
|
94
66
|
/** The LOUD twin: an immediate beat that says how it went, for surfaces
|
|
95
|
-
* where "why can't my friend see me" needs an answer ("crew players"
|
|
96
|
-
* the hireable toggle). */
|
|
67
|
+
* where "why can't my friend see me" needs an answer ("crew players"). */
|
|
97
68
|
export async function heartbeatPresenceNow(payload) {
|
|
98
69
|
const token = authToken();
|
|
99
70
|
if (!token)
|
|
@@ -120,62 +91,6 @@ export async function fetchPlayers() {
|
|
|
120
91
|
return undefined;
|
|
121
92
|
}
|
|
122
93
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (!token)
|
|
126
|
-
return undefined;
|
|
127
|
-
try {
|
|
128
|
-
const res = await request('GET', `/${API_BASE}/ghost/${encodeURIComponent(slug)}?owner=${encodeURIComponent(owner)}`, token);
|
|
129
|
-
if (res.statusCode !== 200)
|
|
130
|
-
return undefined;
|
|
131
|
-
return parseData(res.data)?.ghost;
|
|
132
|
-
}
|
|
133
|
-
catch {
|
|
134
|
-
return undefined;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
// ---- Ledger sync ----
|
|
138
|
-
const LEDGER_PATH = path.join(os.homedir(), '.meteor', '.maka', 'side-quest-ledger.json');
|
|
139
|
-
/** Push unsynced ghost earnings up; mark rows synced on acceptance.
|
|
140
|
-
* Fire-and-forget from homecoming/session start. */
|
|
141
|
-
export async function syncCrewLedger() {
|
|
142
|
-
const token = authToken();
|
|
143
|
-
if (!token)
|
|
144
|
-
return;
|
|
145
|
-
const all = readCrewLedger();
|
|
146
|
-
const unsynced = all.filter(e => !e.synced);
|
|
147
|
-
if (unsynced.length === 0)
|
|
148
|
-
return;
|
|
149
|
-
try {
|
|
150
|
-
const res = await request('POST', `/${API_BASE}/ledger/credit`, token, {
|
|
151
|
-
entries: unsynced.map(e => ({ owner: e.owner, slug: e.slug, amount: e.amount, job: e.job, when: e.when, hiredBy: 'a fellow runner' })),
|
|
152
|
-
});
|
|
153
|
-
if (res.statusCode !== 200)
|
|
154
|
-
return;
|
|
155
|
-
for (const e of all)
|
|
156
|
-
e.synced = e.synced || unsynced.includes(e);
|
|
157
|
-
fs.writeFileSync(LEDGER_PATH, JSON.stringify(all, null, 2));
|
|
158
|
-
Logger.getInstance().write(`Crew ledger: synced ${unsynced.length} ghost earning(s) to maka-cli.com.`);
|
|
159
|
-
}
|
|
160
|
-
catch {
|
|
161
|
-
/* stays unsynced; next homecoming retries */
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
/** Claim what YOUR runner earned riding in other players' crews.
|
|
165
|
-
* Returns the settled total + lines, or undefined when nothing/offline. */
|
|
166
|
-
export async function claimGhostEarnings(slug) {
|
|
167
|
-
const token = authToken();
|
|
168
|
-
if (!token)
|
|
169
|
-
return undefined;
|
|
170
|
-
try {
|
|
171
|
-
const res = await request('POST', `/${API_BASE}/ledger/claim`, token, { slug });
|
|
172
|
-
if (res.statusCode !== 200)
|
|
173
|
-
return undefined;
|
|
174
|
-
const data = parseData(res.data);
|
|
175
|
-
return data && data.total > 0 ? data : undefined;
|
|
176
|
-
}
|
|
177
|
-
catch {
|
|
178
|
-
return undefined;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
94
|
+
// (Ghost sheets and the earnings ledger were removed with the ghost
|
|
95
|
+
// mechanic, 2026-08-23 -- see git history for the Phase B design.)
|
|
181
96
|
//# sourceMappingURL=social.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/utilities/social.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"social.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/utilities/social.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;;;;;;GAOG;AAEH,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC;AAC5C,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,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M,OAAO,CAAC,MAAM,EAAE,IAAI,QAAQ,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAC3E,OAAO,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACnD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAcD,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;IAC1B,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,KAAK,EAAE,IAAI,QAAQ,UAAU,EAAE,KAAK,CAAC,CAAC;QAChE,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG;YAAE,OAAO,SAAS,CAAC;QAC7C,OAAO,SAAS,CAA+B,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACpE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,oEAAoE;AACpE,mEAAmE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.17.
|
|
3
|
+
"version": "5.17.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 2.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 2.x applications using React.",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GHOST EARNINGS LEDGER (the multiplayer bridge, Phase A groundwork):
|
|
3
|
-
* when another player's character rides a run as a crew ghost, their
|
|
4
|
-
* cut of the take lands HERE -- an append-only local file Phase B syncs
|
|
5
|
-
* to maka-cli.com so the owner can claim it ("your runner earned N¥
|
|
6
|
-
* riding with X"). Exists from day one so ghosts drop into the payroll
|
|
7
|
-
* without reshaping it. Same persistence school as hints.ts: direct
|
|
8
|
-
* JSON in ~/.meteor/.maka (NEVER ~/.maka -- CFG rimrafs it), failures
|
|
9
|
-
* swallowed (a ledger hiccup must never break a payday).
|
|
10
|
-
*/
|
|
11
|
-
export interface ICrewLedgerEntry {
|
|
12
|
-
slug: string;
|
|
13
|
-
owner: string;
|
|
14
|
-
amount: number;
|
|
15
|
-
job: string;
|
|
16
|
-
when: string;
|
|
17
|
-
/** Set by Phase B once the server accepts the credit. */
|
|
18
|
-
synced?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare function readCrewLedger(): ICrewLedgerEntry[];
|
|
21
|
-
export declare function appendCrewLedger(entry: ICrewLedgerEntry): void;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
import * as os from 'os';
|
|
3
|
-
import * as path from 'path';
|
|
4
|
-
const LEDGER_PATH = path.join(os.homedir(), '.meteor', '.maka', 'side-quest-ledger.json');
|
|
5
|
-
export function readCrewLedger() {
|
|
6
|
-
try {
|
|
7
|
-
const parsed = JSON.parse(fs.readFileSync(LEDGER_PATH, 'utf8'));
|
|
8
|
-
return Array.isArray(parsed) ? parsed : [];
|
|
9
|
-
}
|
|
10
|
-
catch {
|
|
11
|
-
return [];
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export function appendCrewLedger(entry) {
|
|
15
|
-
try {
|
|
16
|
-
const all = readCrewLedger();
|
|
17
|
-
all.push(entry);
|
|
18
|
-
fs.mkdirSync(path.dirname(LEDGER_PATH), { recursive: true });
|
|
19
|
-
fs.writeFileSync(LEDGER_PATH, JSON.stringify(all, null, 2));
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
/* never break a payday over bookkeeping */
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=crew-ledger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crew-ledger.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/utilities/crew-ledger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAuB7B,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,wBAAwB,CAAC,CAAC;AAE1F,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;QAChE,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAA4B,CAAC,CAAC,CAAC,EAAE,CAAC;IACnE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAuB;IACtD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;QAC7B,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChB,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7D,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC;IAAC,MAAM,CAAC;QACP,2CAA2C;IAC7C,CAAC;AACH,CAAC"}
|