@maka/maka-cli 5.189.0 → 5.190.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.190.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 3.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 3.x applications using React.",
|
|
@@ -3843,16 +3843,99 @@ ${client.name} won't be remembering anything. Dead Johnsons pay nothing -- and t
|
|
|
3843
3843
|
* caller, of which there are three.
|
|
3844
3844
|
*/
|
|
3845
3845
|
draftNextSceneInBackground(runType) {
|
|
3846
|
+
// WHOSE CALL THIS IS, CAPTURED NOW (po7qSJycJrcfWbgaA: "I haven't
|
|
3847
|
+
// been getting a call from mr. krow back after a while").
|
|
3848
|
+
//
|
|
3849
|
+
// Two ways this promise used to end in silence, and the player
|
|
3850
|
+
// cannot tell them apart from the outside -- they are just still
|
|
3851
|
+
// waiting for a call that never comes.
|
|
3852
|
+
//
|
|
3853
|
+
// 1. A THROW WAS INVISIBLE. `.catch` wrote to the debug log and
|
|
3854
|
+
// nothing reached the screen, so any unexpected failure in a
|
|
3855
|
+
// 20-40 second draft cost the player the callback with no line
|
|
3856
|
+
// and no way to ask again knowingly. The comment in
|
|
3857
|
+
// draftNextScene already promised the opposite -- "the wait
|
|
3858
|
+
// resolves as HIS callback either way, success or failure" --
|
|
3859
|
+
// and that was true of a RETURNED failure and false of a thrown
|
|
3860
|
+
// one. An empty string fell through the same hole.
|
|
3861
|
+
//
|
|
3862
|
+
// 2. THE AMBIENT SCOPE WAS GONE BY THE TIME IT RESOLVED. Log lines
|
|
3863
|
+
// scope themselves off `currentSession().dispatch` (headless.ts
|
|
3864
|
+
// ambient), and handleInputAs MUTATES that field for the length
|
|
3865
|
+
// of one command and restores it in a `finally`. This promise
|
|
3866
|
+
// outlives its command by half a minute: at best `dispatch` is
|
|
3867
|
+
// undefined by then and the ping goes to the whole table; at
|
|
3868
|
+
// worst ANOTHER player at the table is mid-command and the ping
|
|
3869
|
+
// is scoped to THEIR room -- so the runner who made the call is
|
|
3870
|
+
// the one person who does not hear it back. Capturing the
|
|
3871
|
+
// caller's name while we are still inside the dispatch, and
|
|
3872
|
+
// scoping to them, removes the dependency on state that is torn
|
|
3873
|
+
// down before the answer arrives.
|
|
3874
|
+
//
|
|
3875
|
+
// Scoped to the CALLER and not the room: this is a phone call to
|
|
3876
|
+
// one runner, and it lands on their link wherever they are standing
|
|
3877
|
+
// by the time it comes back.
|
|
3878
|
+
//
|
|
3879
|
+
// The WHO and the CHANNEL are both captured here, while the call is
|
|
3880
|
+
// still being made, rather than looked up when the answer lands.
|
|
3881
|
+
// Logger.getInstance() resolves off the same async context as the
|
|
3882
|
+
// dispatch above, and this ping is delivered from a timer as well as
|
|
3883
|
+
// from a promise -- so reaching for it later means depending on that
|
|
3884
|
+
// context surviving into whichever of the two gets there first. It
|
|
3885
|
+
// is one session and one logger for the whole call; take both now.
|
|
3886
|
+
const caller = currentSession()?.dispatch?.actorName;
|
|
3887
|
+
const logger = Logger.getInstance();
|
|
3888
|
+
let spoke = false;
|
|
3889
|
+
const ring = (text) => {
|
|
3890
|
+
spoke = true;
|
|
3891
|
+
logger.logWithColor(`${CALL_ICON} ${text}`, CALL_COLOR, caller ? { actor: caller } : undefined);
|
|
3892
|
+
};
|
|
3893
|
+
// 3. AND A PROMISE THAT NEVER SETTLES SAYS NOTHING AT ALL. The two
|
|
3894
|
+
// holes above are both about an answer that arrived and was
|
|
3895
|
+
// dropped; this is the one where none arrives. The draft awaits a
|
|
3896
|
+
// chain of AI calls and, for a crew job, a 300-second server
|
|
3897
|
+
// round trip -- and the reporter's own server log shows the kind
|
|
3898
|
+
// of thing that stalls one (a presence change stream 30 seconds
|
|
3899
|
+
// behind). Whatever hangs, the player is left waiting on a call
|
|
3900
|
+
// with no deadline, which is the report word for word.
|
|
3901
|
+
//
|
|
3902
|
+
// So the wait has an end. DELIBERATELY LONGER than the worst
|
|
3903
|
+
// legitimate draft -- the shared-session call alone is allowed
|
|
3904
|
+
// 300s (shared-run.ts, and 150s was measured too short) and the
|
|
3905
|
+
// chunked generation runs minutes on top -- because a watchdog
|
|
3906
|
+
// that fires while the job is still landing would replace a real
|
|
3907
|
+
// offer with "nothing shook loose", which is worse than the
|
|
3908
|
+
// silence it set out to fix. If the draft DOES land after this
|
|
3909
|
+
// has spoken, the job is still rung through: good news is worth
|
|
3910
|
+
// saying twice, and the player is owed the run they asked for.
|
|
3911
|
+
//
|
|
3912
|
+
// unref'd so a pending watchdog never holds the process open --
|
|
3913
|
+
// a solo CLI session must still exit on "quit".
|
|
3914
|
+
const watchdog = setTimeout(() => {
|
|
3915
|
+
if (!spoke) {
|
|
3916
|
+
ring(`${FIXER_NAME}: "Still nothing I can put your name to, chummer. Call me again in a bit."`);
|
|
3917
|
+
}
|
|
3918
|
+
}, Game.DRAFT_PATIENCE_MS);
|
|
3919
|
+
watchdog.unref?.();
|
|
3846
3920
|
void this.continueToNextScene(runType)
|
|
3847
3921
|
.then(nextJobText => {
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3922
|
+
clearTimeout(watchdog);
|
|
3923
|
+
if (nextJobText)
|
|
3924
|
+
ring(nextJobText);
|
|
3925
|
+
else if (!spoke)
|
|
3926
|
+
ring(`${FIXER_NAME}: "Nothing shook loose, chummer. Call me again in a bit."`);
|
|
3851
3927
|
})
|
|
3852
3928
|
.catch(err => {
|
|
3853
|
-
|
|
3929
|
+
clearTimeout(watchdog);
|
|
3930
|
+
logger.error(`Failed to draft the next job: ${err}`);
|
|
3931
|
+
if (!spoke)
|
|
3932
|
+
ring(`${FIXER_NAME}: "Job fell apart on my end, chummer -- don't ask. Give me another call in a bit."`);
|
|
3854
3933
|
});
|
|
3855
3934
|
}
|
|
3935
|
+
/** How long the runner waits on Krow before he rings back empty-handed.
|
|
3936
|
+
* See the watchdog in draftNextSceneInBackground for why it is this
|
|
3937
|
+
* far past the worst honest draft rather than close to the typical one. */
|
|
3938
|
+
static DRAFT_PATIENCE_MS = 6 * 60 * 1000;
|
|
3856
3939
|
/**
|
|
3857
3940
|
* Drafts and loads the next job once the current scene's win condition
|
|
3858
3941
|
* has been met. Reuses the same long-lived Player (and its inventory),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maka/maka-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.190.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"summary": "A command line tool for scaffolding Meteor 3.x applications using either React.",
|
|
6
6
|
"description": "A command line tool for scaffolding Meteor 3.x applications using React.",
|