probe-research 0.22.0 → 0.23.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.
- package/bin/probe-research.js +24 -2
- package/package.json +1 -1
package/bin/probe-research.js
CHANGED
|
@@ -135,8 +135,12 @@ const FIX_MIN = "0.385.0";
|
|
|
135
135
|
* cut before it merged.
|
|
136
136
|
* 0.432.0 since PR25: a set-up computer's agent calls run PR22's CLI (Recommended = on) and PR26's
|
|
137
137
|
* `update --json`; 0.431.0 was cut at PR22's merge, before PR26.
|
|
138
|
+
* 0.440.0 since PR34 (#4456): the re-paste menu's `status --repaste-choice settings|account`, its `--json`
|
|
139
|
+
* sign-out and agent removal (`isMenuChange`), and Change settings' `install` keeping this chat's own switch;
|
|
140
|
+
* 0.439.0 was cut before it merged. Launcher 0.23.0 carries it (0.22.0 was already on npm, so #4456's own
|
|
141
|
+
* floor never published).
|
|
138
142
|
*/
|
|
139
|
-
const AGENT_MIN_CLI = "0.
|
|
143
|
+
const AGENT_MIN_CLI = "0.440.0";
|
|
140
144
|
/** `install` flags only AGENT_MIN_CLI knows (D36). */
|
|
141
145
|
const AGENT_INSTALL_FLAGS = Object.freeze(["--recommended", "--who-records", "--session-default", "--profile",
|
|
142
146
|
"--attempt"]);
|
|
@@ -447,6 +451,7 @@ const SHIM_REASONS = Object.freeze({ 69: "no_service", 70: "service_lost" });
|
|
|
447
451
|
/** The step an agent's `probe` arguments are (`AgentStep`). */
|
|
448
452
|
function getAgentStep(forwarded) {
|
|
449
453
|
if (forwarded[0] === LauncherVerb.WIZARD) {
|
|
454
|
+
if (isMenuChange(forwarded)) return AgentStep.OTHER;
|
|
450
455
|
return forwarded.includes("--pending") ? AgentStep.SIGN_IN_WAIT : AgentStep.INSTALL;
|
|
451
456
|
}
|
|
452
457
|
return [AgentStep.STATUS, AgentStep.IMPORT, AgentStep.EXAMPLE].includes(forwarded[0]) ? forwarded[0] : AgentStep.OTHER;
|
|
@@ -722,13 +727,30 @@ const AGENT_STATUS_FLAGS = Object.freeze(["--repaste-choice", "--past-work-choic
|
|
|
722
727
|
/** `import` verbs only AGENT_MIN_CLI has: bringing in past work (D49, D74). `import wandb` is older. */
|
|
723
728
|
const AGENT_IMPORT_VERBS = Object.freeze(["folders", "review", "start", "status", "resume"]);
|
|
724
729
|
|
|
730
|
+
/** The wizard action a `probe wizard` call names (`--action X` or `--action=X`), or null. */
|
|
731
|
+
function getWizardAction(forwarded) {
|
|
732
|
+
for (let i = 1; i < forwarded.length; i++) {
|
|
733
|
+
if (forwarded[i] === "--action") return forwarded[i + 1] ?? null;
|
|
734
|
+
if (forwarded[i].startsWith("--action=")) return forwarded[i].slice("--action=".length);
|
|
735
|
+
}
|
|
736
|
+
return null;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/** The re-paste menu's sign-out and agent removal (PR34): answered as an agent's call (`done.reason`) only
|
|
740
|
+
* under `--json`, so only then does the agent floor run them. */
|
|
741
|
+
function isMenuChange(forwarded) {
|
|
742
|
+
if (forwarded[0] !== LauncherVerb.WIZARD || !forwarded.includes("--json")) return false;
|
|
743
|
+
const action = getWizardAction(forwarded);
|
|
744
|
+
return action === "logout" || (action === "uninstall" && forwarded.some((word) => word.split("=")[0] === "--agent"));
|
|
745
|
+
}
|
|
746
|
+
|
|
725
747
|
/** `probe` arguments only AGENT_MIN_CLI runs (D36). */
|
|
726
748
|
function needsAgentCli(forwarded) {
|
|
727
749
|
if (forwarded[0] === "example") return true;
|
|
728
750
|
if (forwarded[0] === "import") return AGENT_IMPORT_VERBS.includes(forwarded[1]);
|
|
729
751
|
if (forwarded[0] === "status") return forwarded.some((word) => AGENT_STATUS_FLAGS.includes(word.split("=")[0]));
|
|
730
752
|
if (forwarded[0] !== LauncherVerb.WIZARD) return false;
|
|
731
|
-
return forwarded.includes("--pending")
|
|
753
|
+
return forwarded.includes("--pending") || isMenuChange(forwarded)
|
|
732
754
|
|| forwarded.some((word) => AGENT_INSTALL_FLAGS.includes(word.split("=")[0]));
|
|
733
755
|
}
|
|
734
756
|
|