@maka/maka-cli 5.13.0 → 5.14.0

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.
Files changed (133) hide show
  1. package/bundle/typescript/package.json +2 -2
  2. package/bundle/typescript/src/commands/game/sideQuest/commands/ask.js +2 -2
  3. package/bundle/typescript/src/commands/game/sideQuest/commands/ask.js.map +1 -1
  4. package/bundle/typescript/src/commands/game/sideQuest/commands/attack.js +5 -5
  5. package/bundle/typescript/src/commands/game/sideQuest/commands/attack.js.map +1 -1
  6. package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.js +1 -1
  7. package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.js.map +1 -1
  8. package/bundle/typescript/src/commands/game/sideQuest/commands/call.js +48 -37
  9. package/bundle/typescript/src/commands/game/sideQuest/commands/call.js.map +1 -1
  10. package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js +14 -14
  11. package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js.map +1 -1
  12. package/bundle/typescript/src/commands/game/sideQuest/commands/catalog.js +25 -1
  13. package/bundle/typescript/src/commands/game/sideQuest/commands/catalog.js.map +1 -1
  14. package/bundle/typescript/src/commands/game/sideQuest/commands/contacts.js +6 -2
  15. package/bundle/typescript/src/commands/game/sideQuest/commands/contacts.js.map +1 -1
  16. package/bundle/typescript/src/commands/game/sideQuest/commands/crew.d.ts +43 -0
  17. package/bundle/typescript/src/commands/game/sideQuest/commands/crew.js +259 -0
  18. package/bundle/typescript/src/commands/game/sideQuest/commands/crew.js.map +1 -0
  19. package/bundle/typescript/src/commands/game/sideQuest/commands/end-call.js +6 -1
  20. package/bundle/typescript/src/commands/game/sideQuest/commands/end-call.js.map +1 -1
  21. package/bundle/typescript/src/commands/game/sideQuest/commands/give.js +15 -2
  22. package/bundle/typescript/src/commands/game/sideQuest/commands/give.js.map +1 -1
  23. package/bundle/typescript/src/commands/game/sideQuest/commands/go.js +8 -6
  24. package/bundle/typescript/src/commands/game/sideQuest/commands/go.js.map +1 -1
  25. package/bundle/typescript/src/commands/game/sideQuest/commands/grapple.js +3 -3
  26. package/bundle/typescript/src/commands/game/sideQuest/commands/grapple.js.map +1 -1
  27. package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js +3 -3
  28. package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js.map +1 -1
  29. package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.d.ts +5 -4
  30. package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.js +45 -27
  31. package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.js.map +1 -1
  32. package/bundle/typescript/src/commands/game/sideQuest/commands/job-offer.js +12 -7
  33. package/bundle/typescript/src/commands/game/sideQuest/commands/job-offer.js.map +1 -1
  34. package/bundle/typescript/src/commands/game/sideQuest/commands/lead.d.ts +5 -4
  35. package/bundle/typescript/src/commands/game/sideQuest/commands/lead.js +31 -17
  36. package/bundle/typescript/src/commands/game/sideQuest/commands/lead.js.map +1 -1
  37. package/bundle/typescript/src/commands/game/sideQuest/commands/look.js +1 -1
  38. package/bundle/typescript/src/commands/game/sideQuest/commands/look.js.map +1 -1
  39. package/bundle/typescript/src/commands/game/sideQuest/commands/order.js +21 -10
  40. package/bundle/typescript/src/commands/game/sideQuest/commands/order.js.map +1 -1
  41. package/bundle/typescript/src/commands/game/sideQuest/commands/palm.js +1 -1
  42. package/bundle/typescript/src/commands/game/sideQuest/commands/palm.js.map +1 -1
  43. package/bundle/typescript/src/commands/game/sideQuest/commands/perform.js +1 -1
  44. package/bundle/typescript/src/commands/game/sideQuest/commands/perform.js.map +1 -1
  45. package/bundle/typescript/src/commands/game/sideQuest/commands/pick.js +1 -1
  46. package/bundle/typescript/src/commands/game/sideQuest/commands/pick.js.map +1 -1
  47. package/bundle/typescript/src/commands/game/sideQuest/commands/reboot.js +1 -1
  48. package/bundle/typescript/src/commands/game/sideQuest/commands/reboot.js.map +1 -1
  49. package/bundle/typescript/src/commands/game/sideQuest/commands/reload.js +1 -1
  50. package/bundle/typescript/src/commands/game/sideQuest/commands/reload.js.map +1 -1
  51. package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js +1 -1
  52. package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js.map +1 -1
  53. package/bundle/typescript/src/commands/game/sideQuest/commands/say.js +21 -0
  54. package/bundle/typescript/src/commands/game/sideQuest/commands/say.js.map +1 -1
  55. package/bundle/typescript/src/commands/game/sideQuest/commands/search.js +1 -1
  56. package/bundle/typescript/src/commands/game/sideQuest/commands/search.js.map +1 -1
  57. package/bundle/typescript/src/commands/game/sideQuest/commands/sheet.d.ts +2 -1
  58. package/bundle/typescript/src/commands/game/sideQuest/commands/sheet.js +81 -3
  59. package/bundle/typescript/src/commands/game/sideQuest/commands/sheet.js.map +1 -1
  60. package/bundle/typescript/src/commands/game/sideQuest/commands/source.js +1 -1
  61. package/bundle/typescript/src/commands/game/sideQuest/commands/source.js.map +1 -1
  62. package/bundle/typescript/src/commands/game/sideQuest/commands/take.js +3 -3
  63. package/bundle/typescript/src/commands/game/sideQuest/commands/take.js.map +1 -1
  64. package/bundle/typescript/src/commands/game/sideQuest/commands/talk.js +4 -1
  65. package/bundle/typescript/src/commands/game/sideQuest/commands/talk.js.map +1 -1
  66. package/bundle/typescript/src/commands/game/sideQuest/commands/use.js +2 -0
  67. package/bundle/typescript/src/commands/game/sideQuest/commands/use.js.map +1 -1
  68. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.d.ts +15 -2
  69. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js +70 -35
  70. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js.map +1 -1
  71. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.d.ts +16 -5
  72. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.js +36 -8
  73. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.js.map +1 -1
  74. package/bundle/typescript/src/commands/game/sideQuest/game.d.ts +139 -4
  75. package/bundle/typescript/src/commands/game/sideQuest/game.js +591 -85
  76. package/bundle/typescript/src/commands/game/sideQuest/game.js.map +1 -1
  77. package/bundle/typescript/src/commands/game/sideQuest/headless.d.ts +86 -0
  78. package/bundle/typescript/src/commands/game/sideQuest/headless.js +185 -0
  79. package/bundle/typescript/src/commands/game/sideQuest/headless.js.map +1 -0
  80. package/bundle/typescript/src/commands/game/sideQuest/models/npc.js +50 -4
  81. package/bundle/typescript/src/commands/game/sideQuest/models/npc.js.map +1 -1
  82. package/bundle/typescript/src/commands/game/sideQuest/models/scene.d.ts +59 -11
  83. package/bundle/typescript/src/commands/game/sideQuest/models/scene.js +242 -109
  84. package/bundle/typescript/src/commands/game/sideQuest/models/scene.js.map +1 -1
  85. package/bundle/typescript/src/commands/game/sideQuest/scenes/scene2.json +11 -11
  86. package/bundle/typescript/src/commands/game/sideQuest/types/save-file.d.ts +22 -2
  87. package/bundle/typescript/src/commands/game/sideQuest/types/seed/scene-seed.d.ts +8 -0
  88. package/bundle/typescript/src/commands/game/sideQuest/ui.js +7 -5
  89. package/bundle/typescript/src/commands/game/sideQuest/ui.js.map +1 -1
  90. package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.d.ts +6 -4
  91. package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.js +36 -24
  92. package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.js.map +1 -1
  93. package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.d.ts +7 -1
  94. package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js +59 -18
  95. package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js.map +1 -1
  96. package/bundle/typescript/src/commands/game/sideQuest/utilities/command-queue.d.ts +19 -0
  97. package/bundle/typescript/src/commands/game/sideQuest/utilities/command-queue.js +56 -0
  98. package/bundle/typescript/src/commands/game/sideQuest/utilities/command-queue.js.map +1 -0
  99. package/bundle/typescript/src/commands/game/sideQuest/utilities/crew-ledger.d.ts +21 -0
  100. package/bundle/typescript/src/commands/game/sideQuest/utilities/crew-ledger.js +25 -0
  101. package/bundle/typescript/src/commands/game/sideQuest/utilities/crew-ledger.js.map +1 -0
  102. package/bundle/typescript/src/commands/game/sideQuest/utilities/emitter.d.ts +44 -0
  103. package/bundle/typescript/src/commands/game/sideQuest/utilities/emitter.js +22 -0
  104. package/bundle/typescript/src/commands/game/sideQuest/utilities/emitter.js.map +1 -0
  105. package/bundle/typescript/src/commands/game/sideQuest/utilities/fuzzy-match.d.ts +4 -1
  106. package/bundle/typescript/src/commands/game/sideQuest/utilities/fuzzy-match.js +5 -2
  107. package/bundle/typescript/src/commands/game/sideQuest/utilities/fuzzy-match.js.map +1 -1
  108. package/bundle/typescript/src/commands/game/sideQuest/utilities/hints.d.ts +4 -0
  109. package/bundle/typescript/src/commands/game/sideQuest/utilities/hints.js +24 -7
  110. package/bundle/typescript/src/commands/game/sideQuest/utilities/hints.js.map +1 -1
  111. package/bundle/typescript/src/commands/game/sideQuest/utilities/logger.d.ts +6 -5
  112. package/bundle/typescript/src/commands/game/sideQuest/utilities/logger.js +30 -6
  113. package/bundle/typescript/src/commands/game/sideQuest/utilities/logger.js.map +1 -1
  114. package/bundle/typescript/src/commands/game/sideQuest/utilities/session-context.d.ts +28 -0
  115. package/bundle/typescript/src/commands/game/sideQuest/utilities/session-context.js +9 -0
  116. package/bundle/typescript/src/commands/game/sideQuest/utilities/session-context.js.map +1 -0
  117. package/bundle/typescript/src/commands/game/sideQuest/utilities/social.d.ts +50 -0
  118. package/bundle/typescript/src/commands/game/sideQuest/utilities/social.js +166 -0
  119. package/bundle/typescript/src/commands/game/sideQuest/utilities/social.js.map +1 -0
  120. package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js +1 -1
  121. package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js.map +1 -1
  122. package/bundle/typescript/src/commands/generate.js +7 -0
  123. package/bundle/typescript/src/commands/generate.js.map +1 -1
  124. package/bundle/typescript/src/tools/mpi/mpi.class.js +46 -3
  125. package/bundle/typescript/src/tools/mpi/mpi.class.js.map +1 -1
  126. package/bundle/typescript/src/tools/mpi/sdk-runtime.d.ts +1 -0
  127. package/bundle/typescript/src/tools/mpi/sdk-runtime.js +23 -0
  128. package/bundle/typescript/src/tools/mpi/sdk-runtime.js.map +1 -1
  129. package/bundle/typescript/src/tools/pkg/pkg.class.js +11 -1
  130. package/bundle/typescript/src/tools/pkg/pkg.class.js.map +1 -1
  131. package/bundle/typescript/src/tools/scaffold/scaffold.class.js +8 -1
  132. package/bundle/typescript/src/tools/scaffold/scaffold.class.js.map +1 -1
  133. package/package.json +2 -2
@@ -3,8 +3,30 @@ import { ISceneSeedJson } from './types/seed/scene-seed.js';
3
3
  import { Item } from './models/item.js';
4
4
  import { Player, Inventory, Room, Scene } from './models/_index.js';
5
5
  import { ISaveFileV1, ISavedItem, SaveReason } from './types/save-file.js';
6
+ /**
7
+ * One crew slot (see THE CREW block below): the persistent record a
8
+ * live 'ally' shell is rebuilt from each run. `ghost` marks a slot held
9
+ * by another PLAYER's character (Phase B): their share routes home via
10
+ * the ledger instead of evaporating as NPC pay.
11
+ */
12
+ export interface ICrewMember {
13
+ name: string;
14
+ source: 'hired' | 'contact' | 'ghost';
15
+ archetypeName?: string;
16
+ description: string;
17
+ combat: Record<string, unknown>;
18
+ gear: ISavedItem[];
19
+ cutPct: number;
20
+ jobsRun: number;
21
+ trainedThisCycle?: boolean;
22
+ ghost?: {
23
+ slug: string;
24
+ owner: string;
25
+ };
26
+ }
6
27
  import { IDocwagonContract } from './utilities/docwagon.js';
7
28
  import { ILifestyleTier } from './utilities/commerce.js';
29
+ import { CommandQueue } from './utilities/command-queue.js';
8
30
  import { NPC } from './models/npc.js';
9
31
  import { AutoFight } from './utilities/auto-fight.js';
10
32
  import { IMainGameConfig } from './ui.js';
@@ -39,6 +61,7 @@ export default class Game {
39
61
  gigs: number;
40
62
  asked: boolean;
41
63
  role?: string;
64
+ note?: string;
42
65
  }>;
43
66
  pendingProcurements: {
44
67
  contact: string;
@@ -46,16 +69,57 @@ export default class Game {
46
69
  price: number;
47
70
  }[];
48
71
  docwagon?: IDocwagonContract;
72
+ crew: ICrewMember[];
73
+ commandRefusals: Record<string, number>;
49
74
  enlistedAlly?: {
50
75
  name: string;
51
76
  description: string;
52
77
  combat: Record<string, unknown>;
53
78
  };
54
- commandRefusals: Record<string, number>;
79
+ /** Leadership fields the table: anyone runs with a partner, a leader
80
+ * runs a team. Ceiling 5 -- the size of the future multiplayer table. */
81
+ get crewCap(): number;
82
+ /** The crew-change rule (player ruling): any roster change voids the
83
+ * standing quote. Returns the line to show, or ''. */
84
+ scrapPendingRunForCrewChange(): string;
55
85
  performedThisCycle: boolean;
56
- /** The recruited contact joins at the jobsite curb ("takes their own
57
- * ride and meets you there" -- the companion convention). */
58
- spawnEnlistedAlly(): string[];
86
+ crewForHire: ICrewMember[];
87
+ private _presenceTimer?;
88
+ private static readonly PRESENCE_TICK_MS;
89
+ private beatPresence;
90
+ startPresenceHeartbeat(): void;
91
+ /** Ghost earnings home delivery: what YOUR runner made riding in
92
+ * other players' crews since last time. Fire-and-forget from hub
93
+ * arrival beats; pays onto the job credstick when anything landed. */
94
+ collectGhostEarnings(): Promise<void>;
95
+ private static readonly HIRE_NAMES;
96
+ /** Deal 2-3 fresh candidates. Names dodge the live cast and roster. */
97
+ rollHireCandidates(): void;
98
+ /** The crew joins at the jobsite curb ("took their own ride" -- the
99
+ * companion convention): one 'ally' shell per member, carrying and
100
+ * wearing their own gear. */
101
+ spawnCrew(): string[];
102
+ /**
103
+ * Homecoming settlement for the crew (returnToHub, BEFORE the fold --
104
+ * dismissCompanion sends shell cargo to the PLAYER, and crew gear is
105
+ * THEIRS): write each survivor's inventory+equipment back into the
106
+ * roster (loot they picked up stays with them), heal them (the cot
107
+ * convention), and bury the fallen -- crew death is PERMANENT, like
108
+ * everything else on this street. Returns homecoming lines.
109
+ */
110
+ settleCrewAfterRun(): string[];
111
+ /**
112
+ * The team's split, taken at every pay moment (canon: the crew shares
113
+ * the take; in multiplayer each player literally receives their
114
+ * share). Total cut capped at 60% -- the wheelman never out-earns the
115
+ * one holding the job. Ghost members' shares land on the local ledger
116
+ * for Phase B to sync home. Returns the player's share + the itemized
117
+ * line (empty crew: full amount, no line).
118
+ */
119
+ applyCrewCut(gross: number): {
120
+ share: number;
121
+ line: string;
122
+ };
59
123
  /** Bills a DocWagon fee: cred first, shortfall onto the rent tab (the
60
124
  * street's one universal collections agency). Returns the line. */
61
125
  private billDocwagon;
@@ -260,6 +324,32 @@ export default class Game {
260
324
  clearPendingRun(): void;
261
325
  get pendingRun(): ISceneSeedJson | undefined;
262
326
  get pendingRunTier(): number | undefined;
327
+ currentClient?: {
328
+ name: string;
329
+ met: boolean;
330
+ advancePaid: number;
331
+ reported: boolean;
332
+ dead?: boolean;
333
+ };
334
+ forfeitArmed: boolean;
335
+ /**
336
+ * The meet and the wrap-up, triggered by the player's first/next real
337
+ * interaction with the client (talk-to, a connected call, a give).
338
+ * Returns the beat's text (advance/remainder lines) or null when this
339
+ * NPC isn't the client / nothing new happens. Canon p.28-29: half up
340
+ * front at the meet, the remainder on delivering proof. Completing the
341
+ * objective BEFORE ever meeting them collapses both beats into one.
342
+ */
343
+ onClientInteraction(npcName: string): string | null;
344
+ /**
345
+ * The client's verdict, filed at homecoming (returnToHub): whatever
346
+ * happened, their name joins the roster -- clean work opens a
347
+ * relationship (role 'Johnson', repeat clients deepen like gigs), a
348
+ * forfeited remainder or a walked-out job files a note the roster
349
+ * shows (p.368 already charged the walkout's notoriety at the curb).
350
+ * Clears currentClient; returns the homecoming line.
351
+ */
352
+ settleClientReputation(wrappedRun: boolean): string;
263
353
  /**
264
354
  * The cab that answers "call taxi" varies per job (player request: not
265
355
  * always a van) -- picked once when the pending run lands, so the
@@ -297,6 +387,13 @@ export default class Game {
297
387
  get metaBox(): blessed.Widgets.BoxElement;
298
388
  get inputBox(): blessed.Widgets.TextboxElement;
299
389
  init(options: IMainGameConfig, screen: blessed.Widgets.Screen): Promise<string>;
390
+ /** The blessed half of startup -- widgets only. Headless sessions
391
+ * (Phase C) never call this; everything below survives without it
392
+ * (updateStatus/refreshLogLabel/close are all screen-guarded). */
393
+ initUi(screen: blessed.Widgets.Screen): void;
394
+ /** The engine half of startup: scene synthesis, command registration,
395
+ * hub seeding, resume overlay -- no widget contact. */
396
+ initEngine(options: IMainGameConfig): Promise<string>;
300
397
  /**
301
398
  * Everything a save restores beyond the seed synthesis: the player,
302
399
  * the hub world overlay, and the Game-level ledgers. Ordering inside
@@ -387,6 +484,13 @@ export default class Game {
387
484
  */
388
485
  launchPendingRun(): Promise<string>;
389
486
  close(): Promise<void>;
487
+ stopPresenceHeartbeat(): void;
488
+ /**
489
+ * Full per-session teardown (Phase C): everything init/play armed that
490
+ * outlives a turn -- for the hosting server's idle eviction and
491
+ * session close. Solo play never calls this (process exit does it).
492
+ */
493
+ dispose(): Promise<void>;
390
494
  private initInputBox;
391
495
  private initLogBox;
392
496
  /**
@@ -433,6 +537,12 @@ export default class Game {
433
537
  * and once on load/job transition.
434
538
  */
435
539
  updateStatus(): void;
540
+ /**
541
+ * The HUD as data: every status line for `player`, pure state reads --
542
+ * no widgets. updateStatus paints it for the local player; a shared-run
543
+ * server ships it per player as status events (Phase C).
544
+ */
545
+ statusLinesFor(player: Player): string[];
436
546
  updateEquipment(_playerEquipment: PlayerEquipment): void;
437
547
  updateExits(_room: Room): void;
438
548
  updateInventory(_playerInventory: Inventory, _currencyName?: string): void;
@@ -445,7 +555,32 @@ export default class Game {
445
555
  * correction call overwrites it with the corrected verb.
446
556
  */
447
557
  lastResolvedVerb: string;
558
+ /**
559
+ * Serializes every inbound command (see utilities/command-queue.ts):
560
+ * the engine's await points assume one command in flight, and a second
561
+ * human on a DDP connection must wait its turn, not interleave.
562
+ */
563
+ readonly commandQueue: CommandQueue;
564
+ /**
565
+ * Shared-run hook (Phase C): fires when a NON-primary human player
566
+ * dies in this scene, so the server can burn their save. The primary
567
+ * player's death keeps the solo path (Scene.endGame -> close(),
568
+ * permadeath).
569
+ */
570
+ onPlayerDeath?: (player: Player) => void;
448
571
  handleInput(input: string): Promise<string | null>;
572
+ /**
573
+ * Runs `input` AS the named human player -- the symmetric-multiplayer
574
+ * command entry: every human gets the same full privileged context the
575
+ * solo player always had. Queued; internal re-entries (typo
576
+ * correction, say.ts's speech-accept) run inline via the queue's
577
+ * re-entrancy guard.
578
+ */
579
+ handleInputAs(actorName: string, input: string): Promise<{
580
+ text: string | null;
581
+ verb: string;
582
+ }>;
583
+ private runInputAs;
449
584
  /**
450
585
  * The help taxonomy: every entry is [primary, ...aliases], grouped the
451
586
  * way a player thinks, not the order commands were registered. The