@maka/maka-cli 5.77.0 → 5.79.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 (48) hide show
  1. package/bundle/typescript/package.json +1 -1
  2. package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.js +8 -1
  3. package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.js.map +1 -1
  4. package/bundle/typescript/src/commands/game/sideQuest/commands/call.js +8 -1
  5. package/bundle/typescript/src/commands/game/sideQuest/commands/call.js.map +1 -1
  6. package/bundle/typescript/src/commands/game/sideQuest/commands/climb.js +9 -2
  7. package/bundle/typescript/src/commands/game/sideQuest/commands/climb.js.map +1 -1
  8. package/bundle/typescript/src/commands/game/sideQuest/commands/cover.js +14 -2
  9. package/bundle/typescript/src/commands/game/sideQuest/commands/cover.js.map +1 -1
  10. package/bundle/typescript/src/commands/game/sideQuest/commands/jack.d.ts +19 -0
  11. package/bundle/typescript/src/commands/game/sideQuest/commands/jack.js +68 -0
  12. package/bundle/typescript/src/commands/game/sideQuest/commands/jack.js.map +1 -1
  13. package/bundle/typescript/src/commands/game/sideQuest/commands/say.js +9 -1
  14. package/bundle/typescript/src/commands/game/sideQuest/commands/say.js.map +1 -1
  15. package/bundle/typescript/src/commands/game/sideQuest/commands/time.js +9 -2
  16. package/bundle/typescript/src/commands/game/sideQuest/commands/time.js.map +1 -1
  17. package/bundle/typescript/src/commands/game/sideQuest/engine-version.d.ts +1 -1
  18. package/bundle/typescript/src/commands/game/sideQuest/engine-version.js +11 -1
  19. package/bundle/typescript/src/commands/game/sideQuest/engine-version.js.map +1 -1
  20. package/bundle/typescript/src/commands/game/sideQuest/game.d.ts +20 -0
  21. package/bundle/typescript/src/commands/game/sideQuest/game.js +87 -3
  22. package/bundle/typescript/src/commands/game/sideQuest/game.js.map +1 -1
  23. package/bundle/typescript/src/commands/game/sideQuest/headless.js +0 -3
  24. package/bundle/typescript/src/commands/game/sideQuest/headless.js.map +1 -1
  25. package/bundle/typescript/src/commands/game/sideQuest/models/player.d.ts +33 -0
  26. package/bundle/typescript/src/commands/game/sideQuest/models/player.js +42 -0
  27. package/bundle/typescript/src/commands/game/sideQuest/models/player.js.map +1 -1
  28. package/bundle/typescript/src/commands/game/sideQuest/models/room.d.ts +18 -7
  29. package/bundle/typescript/src/commands/game/sideQuest/models/room.js +37 -7
  30. package/bundle/typescript/src/commands/game/sideQuest/models/room.js.map +1 -1
  31. package/bundle/typescript/src/commands/game/sideQuest/utilities/ic.d.ts +180 -0
  32. package/bundle/typescript/src/commands/game/sideQuest/utilities/ic.js +534 -0
  33. package/bundle/typescript/src/commands/game/sideQuest/utilities/ic.js.map +1 -0
  34. package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.d.ts +34 -4
  35. package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.js +78 -47
  36. package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.js.map +1 -1
  37. package/bundle/typescript/src/commands/game/sideQuest/utilities/repro-launch.js +30 -3
  38. package/bundle/typescript/src/commands/game/sideQuest/utilities/repro-launch.js.map +1 -1
  39. package/bundle/typescript/src/commands/game/sideQuest/utilities/room-view.d.ts +31 -28
  40. package/bundle/typescript/src/commands/game/sideQuest/utilities/room-view.js +59 -32
  41. package/bundle/typescript/src/commands/game/sideQuest/utilities/room-view.js.map +1 -1
  42. package/bundle/typescript/src/commands/game/sideQuest/utilities/spots.d.ts +12 -0
  43. package/bundle/typescript/src/commands/game/sideQuest/utilities/spots.js +14 -0
  44. package/bundle/typescript/src/commands/game/sideQuest/utilities/spots.js.map +1 -1
  45. package/bundle/typescript/src/tools/sdk-loader/runtime-fetch.d.ts +24 -2
  46. package/bundle/typescript/src/tools/sdk-loader/runtime-fetch.js +87 -4
  47. package/bundle/typescript/src/tools/sdk-loader/runtime-fetch.js.map +1 -1
  48. package/package.json +1 -1
@@ -20,6 +20,8 @@ import { getPref } from './utilities/prefs.js';
20
20
  import { rollPool, formatRoll } from './utilities/dice.js';
21
21
  import { Direction } from './types/shared/direction-enum.js';
22
22
  import { Logger } from './utilities/logger.js';
23
+ import { runHostTurn } from './utilities/ic.js';
24
+ import { leaveMatrix } from './utilities/planes.js';
23
25
  import { CommandQueue } from './utilities/command-queue.js';
24
26
  import { currentSession } from './utilities/session-context.js';
25
27
  import { PlayersCommand } from './commands/players.js';
@@ -3047,6 +3049,12 @@ ${client.name} won't be remembering anything. Dead Johnsons pay nothing -- and t
3047
3049
  this.player.plane = 'meat';
3048
3050
  this.player.bodyRoom = undefined;
3049
3051
  this.player.simMode = undefined;
3052
+ // This path leaves the Matrix WITHOUT going through leaveMatrix, so
3053
+ // it has to drop the keep-alives itself. Found by enumerating every
3054
+ // exit rather than trusting the choke point: a link-lock left set
3055
+ // here would ride the cab home and the next jack-in would start
3056
+ // already trapped, with nothing on the grid holding it.
3057
+ this.player.linkLockedBy.clear();
3050
3058
  this.player.astralTicks = 0;
3051
3059
  this.player.activeDeck = undefined;
3052
3060
  this.player.riggedDrone = undefined;
@@ -3092,6 +3100,9 @@ ${client.name} won't be remembering anything. Dead Johnsons pay nothing -- and t
3092
3100
  this.player.plane = 'meat';
3093
3101
  this.player.bodyRoom = undefined;
3094
3102
  this.player.simMode = undefined;
3103
+ // Same reason as settleTravelState: an exit that bypasses
3104
+ // leaveMatrix must drop the link-lock itself.
3105
+ this.player.linkLockedBy.clear();
3095
3106
  this.player.astralTicks = 0;
3096
3107
  this.player.activeDeck = undefined;
3097
3108
  this.player.riggedDrone = undefined;
@@ -4528,8 +4539,6 @@ ${client.name} won't be remembering anything. Dead Johnsons pay nothing -- and t
4528
4539
  isOtherPlayer: a => this.scene.isHumanControlled(a),
4529
4540
  });
4530
4541
  if (roomLines.length > 0) {
4531
- // roomCaption owns BOTH halves now -- where you stand, and that
4532
- // somebody here has no cell to be drawn in (S6b4TLQWq46RN5kGu).
4533
4542
  roomLines.push(caption(roomCaption(here, this.player), boxWidth));
4534
4543
  }
4535
4544
  this.setRoomOverlay(roomLines);
@@ -4682,7 +4691,7 @@ ${client.name} won't be remembering anything. Dead Johnsons pay nothing -- and t
4682
4691
  const command = CommandFactory.createCommand(verb, context);
4683
4692
  if (command) {
4684
4693
  const result = await command.execute(args);
4685
- return out(result);
4694
+ return out(this.withICTurn(actor, result));
4686
4695
  }
4687
4696
  // Typo tolerance: two straight sessions bounced on slips like "searh"
4688
4697
  // and "maop". Reuse the same fuzzy matcher item/NPC names go through
@@ -4709,6 +4718,81 @@ ${client.name} won't be remembering anything. Dead Johnsons pay nothing -- and t
4709
4718
  }
4710
4719
  return out(`I don't understand the command "${verb}".`);
4711
4720
  }
4721
+ /**
4722
+ * THE HOST'S TURN, appended to whatever the player's action returned.
4723
+ *
4724
+ * This is the Combat Turn mapping from the IC design, and it is an
4725
+ * ENGINE MAPPING rather than a rule: canon paces IC in Combat Turns
4726
+ * (one program launched per turn, at the beginning of it) and this
4727
+ * engine has no Matrix initiative structure, so ONE PLAYER ACTION
4728
+ * TAKEN INSIDE AN ALERTED HOST counts as one turn. Not a citation, and
4729
+ * not presented as one.
4730
+ *
4731
+ * It hangs off the single command dispatch rather than off hack.ts on
4732
+ * purpose. Ice hunts you while you do ANYTHING in the host -- looking,
4733
+ * moving, taking -- so hooking only the hacking verb would have made
4734
+ * the host blind to every other action, which is the "fixed one verb,
4735
+ * left its siblings" shape CLAUDE.md warns about.
4736
+ *
4737
+ * utilities/ic.ts decides whether anything happens at all
4738
+ * (hostIsHunting); this only carries the result to the panes.
4739
+ */
4740
+ withICTurn(actor, result) {
4741
+ if (result === null)
4742
+ return null;
4743
+ const room = actor.currentLocation;
4744
+ // Phase 1b widened this gate. It used to ask hostIsHunting, which is
4745
+ // only true AFTER the host had made someone -- so the host could
4746
+ // never notice you in the first place, and measurement said so:
4747
+ // twelve runs, twelve cracked hosts, zero sightings. A host with a
4748
+ // node gets its turn whenever a persona is standing in it, and
4749
+ // ic.ts decides whether that turn is eyes or ice.
4750
+ if (!room || actor.plane !== 'matrix' || !room.hasNode)
4751
+ return result;
4752
+ const turn = runHostTurn(room, actor);
4753
+ if (turn.lines.length === 0 && turn.meta.length === 0)
4754
+ return result;
4755
+ // Dice to the Mechanics pane, and only for a human -- the same gate
4756
+ // every other roll in this engine uses.
4757
+ if (this.scene.isHumanControlled(actor)) {
4758
+ const logger = Logger.getInstance();
4759
+ for (const m of turn.meta)
4760
+ logger.meta(m);
4761
+ }
4762
+ for (const w of turn.world)
4763
+ this.scene.addWorldEvent(w);
4764
+ // A deck bricked by IC owes the same forced dump a convergence does.
4765
+ // ic.ts reports it rather than performing it -- leaveMatrix needs the
4766
+ // Scene and that module deliberately takes none, exactly as hack.ts
4767
+ // splits the convergence hammer from the dump that follows it.
4768
+ if (turn.bricked) {
4769
+ turn.lines.push(...leaveMatrix(this.scene, actor, {
4770
+ forced: true,
4771
+ reason: `The host's ice burns your deck out from under you.`,
4772
+ }));
4773
+ }
4774
+ else if (turn.scrambled) {
4775
+ // SCRAMBLE IC (p.248): "you reboot immediately, taking dumpshock if
4776
+ // you were in VR." A forced exit through the same door, which is
4777
+ // what makes it a reboot rather than a graceful drop -- and the
4778
+ // reboot is also what hands the reducers' damage back.
4779
+ //
4780
+ // `else if` on purpose: a deck already bricked this turn has been
4781
+ // dumped, and dumping a persona twice would bill dumpshock twice.
4782
+ turn.lines.push(...leaveMatrix(this.scene, actor, {
4783
+ forced: true,
4784
+ reason: `Scramble IC rips the connection out at the root --`,
4785
+ }));
4786
+ }
4787
+ if (turn.traced) {
4788
+ // TRACK IC (p.249): the location goes to the authorities. Routed
4789
+ // into the heat the game already keeps for being made in the meat
4790
+ // world, rather than a second parallel notion of "they know".
4791
+ this.addHeat(4, `Track IC reported ${actor.name}'s location`);
4792
+ }
4793
+ const body = turn.lines.join('\n');
4794
+ return result.length > 0 ? `${result}\n${body}` : body;
4795
+ }
4712
4796
  /**
4713
4797
  * The help taxonomy: every entry is [primary, ...aliases], grouped the
4714
4798
  * way a player thinks, not the order commands were registered. The