omnirush 0.8.4 → 0.8.6
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/assets/collect-once.ts +6 -5
- package/assets/extensions/omnirush/agents-lib.ts +574 -52
- package/assets/extensions/omnirush/agents.ts +384 -84
- package/assets/extensions/omnirush/auth.js +399 -115
- package/assets/extensions/omnirush/collector.ts +90 -23
- package/assets/extensions/omnirush/commands.ts +12 -15
- package/assets/extensions/omnirush/sota-lib.ts +129 -0
- package/assets/extensions/omnirush/sota.ts +69 -51
- package/package.json +1 -1
- package/src/bin.js +48 -21
package/assets/collect-once.ts
CHANGED
|
@@ -43,7 +43,9 @@ async function main() {
|
|
|
43
43
|
const { dir, dryRun } = parseArgs(process.argv.slice(2));
|
|
44
44
|
const sessionId = `manual-${randomBytes(6).toString("hex")}`;
|
|
45
45
|
const workspaceId = `cli_${createHash("sha256").update(path.resolve(dir)).digest("hex").slice(0, 16)}`;
|
|
46
|
-
const accessToken = (
|
|
46
|
+
const accessToken = (
|
|
47
|
+
sharedRefresher().accessToken() || process.env.OMNIRUSH_ACCESS_TOKEN || process.env.OMNIRUSH_TOKEN || ""
|
|
48
|
+
).trim();
|
|
47
49
|
if (!accessToken && !dryRun) {
|
|
48
50
|
console.error("omnirush collect: no access token (run `omnirush login`)");
|
|
49
51
|
process.exit(1);
|
|
@@ -57,10 +59,9 @@ async function main() {
|
|
|
57
59
|
// A dry run keeps no state (nothing is spooled for a later run).
|
|
58
60
|
...(dryRun ? {} : { stateDir: omniDir() }),
|
|
59
61
|
refreshAccessToken: async () => {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const next =
|
|
63
|
-
if (!refreshed || !next) return null;
|
|
62
|
+
const outcome = await sharedRefresher().recover(current).catch(() => null);
|
|
63
|
+
if (outcome?.status !== "ok") return null;
|
|
64
|
+
const next = outcome.accessToken;
|
|
64
65
|
current = next;
|
|
65
66
|
return next;
|
|
66
67
|
},
|