probe-research 0.19.0 → 0.20.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 +22 -11
- package/package.json +1 -1
package/bin/probe-research.js
CHANGED
|
@@ -130,8 +130,10 @@ const FIX_MIN = "0.385.0";
|
|
|
130
130
|
* merged) lacks.
|
|
131
131
|
* 0.424.0 since PR12 (#4381): runs-only.md's `install --profile runs` and already-set-up.md's
|
|
132
132
|
* `install --profile` and `status --repaste-choice`; 0.423.0 was cut from the commit before it merged.
|
|
133
|
+
* 0.425.0 since PR15: past-work.md's `probe import folders|review|start|status|resume`; 0.424.0 was
|
|
134
|
+
* cut before it merged.
|
|
133
135
|
*/
|
|
134
|
-
const AGENT_MIN_CLI = "0.
|
|
136
|
+
const AGENT_MIN_CLI = "0.425.0";
|
|
135
137
|
/** `install` flags only AGENT_MIN_CLI knows (D36). */
|
|
136
138
|
const AGENT_INSTALL_FLAGS = Object.freeze(["--recommended", "--who-records", "--session-default", "--profile",
|
|
137
139
|
"--attempt"]);
|
|
@@ -207,21 +209,26 @@ function installedVersion(command = "probe") {
|
|
|
207
209
|
* its bin folder (a first download's, before the agent's shell PATH knows that folder); null.
|
|
208
210
|
*/
|
|
209
211
|
function findProbe(min) {
|
|
210
|
-
|
|
211
|
-
for (const candidate of candidates.filter(Boolean)) {
|
|
212
|
-
if (candidate !== "probe") {
|
|
213
|
-
try {
|
|
214
|
-
fs.accessSync(candidate, fs.constants.X_OK);
|
|
215
|
-
} catch {
|
|
216
|
-
continue;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
212
|
+
for (const candidate of getProbeCommands()) {
|
|
219
213
|
const found = installedVersion(candidate);
|
|
220
214
|
if (found && atLeast(found, min)) return candidate;
|
|
221
215
|
}
|
|
222
216
|
return null;
|
|
223
217
|
}
|
|
224
218
|
|
|
219
|
+
/** Every `probe` here, answering or not: the one on PATH, then the runnable ones in uv's bin folders. */
|
|
220
|
+
function getProbeCommands() {
|
|
221
|
+
const installed = getUvBinFolders(process.env).map((d) => path.join(d, "probe")).filter((candidate) => {
|
|
222
|
+
try {
|
|
223
|
+
fs.accessSync(candidate, fs.constants.X_OK);
|
|
224
|
+
return true;
|
|
225
|
+
} catch {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
return [...(has("probe") ? ["probe"] : []), ...installed];
|
|
230
|
+
}
|
|
231
|
+
|
|
225
232
|
function baseUrl() {
|
|
226
233
|
const env = process.env.PROBE_BASE_URL;
|
|
227
234
|
if (env && /^https?:\/\//.test(env)) return env.replace(/\/+$/, "");
|
|
@@ -517,8 +524,9 @@ async function main() {
|
|
|
517
524
|
process.exit(1);
|
|
518
525
|
}
|
|
519
526
|
if (signInCodeAt(args) >= 0) console.error(SIGN_IN_CODE_NOTE);
|
|
520
|
-
if (isStatusJson(forwarded) &&
|
|
527
|
+
if (isStatusJson(forwarded) && getProbeCommands().length === 0) {
|
|
521
528
|
// No Probe here: the install prompt's first read (step 1b) answers at once, with no download (D37).
|
|
529
|
+
// A `probe` that does not answer (its service restarting) is Probe here: its status runs (P1b).
|
|
522
530
|
agentRun.answer({ v: 1, setup: NONE_SETUP }, 0);
|
|
523
531
|
}
|
|
524
532
|
const agentCli = needsAgentCli(forwarded);
|
|
@@ -633,10 +641,13 @@ const BARRIER_FILE = [".local", "state", "probe", "uninstall", "barrier.json"];
|
|
|
633
641
|
|
|
634
642
|
/** `status` flags only AGENT_MIN_CLI knows: the re-paste menu's answer (D84). */
|
|
635
643
|
const AGENT_STATUS_FLAGS = Object.freeze(["--repaste-choice"]);
|
|
644
|
+
/** `import` verbs only AGENT_MIN_CLI has: bringing in past work (D49, D74). `import wandb` is older. */
|
|
645
|
+
const AGENT_IMPORT_VERBS = Object.freeze(["folders", "review", "start", "status", "resume"]);
|
|
636
646
|
|
|
637
647
|
/** `probe` arguments only AGENT_MIN_CLI runs (D36). */
|
|
638
648
|
function needsAgentCli(forwarded) {
|
|
639
649
|
if (forwarded[0] === "example") return true;
|
|
650
|
+
if (forwarded[0] === "import") return AGENT_IMPORT_VERBS.includes(forwarded[1]);
|
|
640
651
|
if (forwarded[0] === "status") return forwarded.some((word) => AGENT_STATUS_FLAGS.includes(word.split("=")[0]));
|
|
641
652
|
if (forwarded[0] !== LauncherVerb.WIZARD) return false;
|
|
642
653
|
return forwarded.includes("--pending")
|