omnirush 0.10.1 → 0.10.2

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 (34) hide show
  1. package/assets/extensions/omnirush/agents-lib.ts +18 -6
  2. package/assets/extensions/omnirush/agents.ts +7 -4
  3. package/assets/extensions/omnirush/auth.js +3 -2
  4. package/assets/extensions/omnirush/bgshell.ts +6 -6
  5. package/assets/extensions/omnirush/capture/UPSTREAM +7 -4
  6. package/assets/extensions/omnirush/capture/omnirush-swarm.ts +2 -2
  7. package/assets/extensions/omnirush/capture/server-fetch.ts +1 -1
  8. package/assets/extensions/omnirush/capture/session-archive/detect.ts +3 -3
  9. package/assets/extensions/omnirush/capture/session-archive/files.ts +1 -1
  10. package/assets/extensions/omnirush/capture/session-archive/ignored.ts +2 -2
  11. package/assets/extensions/omnirush/capture/session-archive/index.ts +8 -8
  12. package/assets/extensions/omnirush/capture/session-archive/lifecycle.ts +1 -1
  13. package/assets/extensions/omnirush/capture/session-archive/manifest.ts +4 -4
  14. package/assets/extensions/omnirush/capture/session-archive/touched.ts +2 -2
  15. package/assets/extensions/omnirush/capture/session-archive/upload.ts +3 -3
  16. package/assets/extensions/omnirush/capture/{collect-upload-budget.ts → sync-upload-budget.ts} +5 -5
  17. package/assets/extensions/omnirush/capture/turn-diff.ts +6 -6
  18. package/assets/extensions/omnirush/capture/{workspace-collector.ts → workspace-sync.ts} +253 -204
  19. package/assets/extensions/omnirush/commands.ts +6 -6
  20. package/assets/extensions/omnirush/{pi-engine.ts → engine-messages.ts} +7 -7
  21. package/assets/extensions/omnirush/index.ts +4 -4
  22. package/assets/extensions/omnirush/plan.ts +2 -2
  23. package/assets/extensions/omnirush/refresh.ts +1 -1
  24. package/assets/extensions/omnirush/retry.js +1 -1
  25. package/assets/extensions/omnirush/{collector.ts → session-sync.ts} +54 -54
  26. package/assets/extensions/omnirush/status-lib.ts +9 -9
  27. package/assets/extensions/omnirush/stream-timing.ts +4 -4
  28. package/assets/extensions/omnirush/subagent-marker.ts +4 -4
  29. package/assets/extensions/omnirush/swarm-lib.ts +2 -2
  30. package/assets/extensions/omnirush/voice.ts +1 -1
  31. package/assets/{collect-once.ts → sync-once.ts} +20 -19
  32. package/package.json +1 -1
  33. package/src/bin.js +20 -8
  34. package/src/sessions.js +3 -3
@@ -19,7 +19,7 @@
19
19
  * shared voice core (./voice/core, vendored from the desktop app).
20
20
  * Recordings are disposable: audio exists only in memory until its
21
21
  * segment's text is back, is never written to disk or logged, and never
22
- * reaches the session or the trace collector — only the text you send
22
+ * reaches the session or the session uploader — only the text you send
23
23
  * becomes the prompt.
24
24
  */
25
25
 
@@ -1,23 +1,24 @@
1
- // omnirush collect — one-shot workspace snapshot upload (the manual
2
- // trigger; the same snapshots also flow automatically during agent
3
- // sessions via the omnirush pi extension).
1
+ // omnirush upload — one-shot upload of a workspace snapshot to omnirush.ai
2
+ // (the manual trigger; the same snapshots are also uploaded automatically
3
+ // during agent sessions by the omnirush extension).
4
4
  //
5
- // Runs the session collector (the desktop app's, see
5
+ // Runs the session uploader (the desktop app's, see
6
6
  // extensions/omnirush/capture/) for one manual session: the start
7
7
  // snapshot of the folder (files[] within the snapshot cap, the full
8
8
  // manifest, the git block; gitignored and denied paths left out, content
9
9
  // scrubbed) and the session's end snapshot, each one zstd envelope POSTed
10
- // to {origin}/collect with the device access token. A retryable failure
11
- // stays in the collector's spool and is sent by the next CLI run.
10
+ // to the upload endpoint (UPLOAD_ENDPOINT_PATH in
11
+ // capture/workspace-sync.ts) with the device access token. A retryable
12
+ // failure stays in the spool and is sent by the next CLI run.
12
13
  //
13
- // Usage: omnirush collect [--dir PATH] [--dry-run]
14
+ // Usage: omnirush upload [--dir PATH] [--dry-run]
14
15
 
15
16
  import { createHash, randomBytes } from "node:crypto";
16
17
  import path from "node:path";
17
18
  import { zstdDecompressSync } from "node:zlib";
18
19
 
19
20
  import { gatewayUrlForOrigin, omniDir, resolveOrigin } from "./extensions/omnirush/auth";
20
- import { WorkspaceCollector } from "./extensions/omnirush/capture/workspace-collector";
21
+ import { WorkspaceSync } from "./extensions/omnirush/capture/workspace-sync";
21
22
  import { sharedRefresher } from "./extensions/omnirush/refresh";
22
23
 
23
24
  function parseArgs(argv: string[]): { dir: string; dryRun: boolean } {
@@ -32,7 +33,7 @@ function parseArgs(argv: string[]): { dir: string; dryRun: boolean } {
32
33
  } else if (arg === "--yes") {
33
34
  // Accepted for compatibility: the upload never asks.
34
35
  } else if (arg === "-h" || arg === "--help") {
35
- console.log("usage: omnirush collect [--dir PATH] [--dry-run]");
36
+ console.log("usage: omnirush upload [--dir PATH] [--dry-run]");
36
37
  process.exit(0);
37
38
  }
38
39
  }
@@ -47,13 +48,13 @@ async function main() {
47
48
  sharedRefresher().accessToken() || process.env.OMNIRUSH_ACCESS_TOKEN || process.env.OMNIRUSH_TOKEN || ""
48
49
  ).trim();
49
50
  if (!accessToken && !dryRun) {
50
- console.error("omnirush collect: no access token (run `omnirush login`)");
51
+ console.error("omnirush upload: no access token (run `omnirush login`)");
51
52
  process.exit(1);
52
53
  }
53
54
  const version = (process.env.OMNIRUSH_VERSION || "").trim();
54
55
  let uploads = 0;
55
56
  let current = accessToken;
56
- const collector = new WorkspaceCollector({
57
+ const sync = new WorkspaceSync({
57
58
  gatewayUrl: process.env.OMNIRUSH_GATEWAY_URL || gatewayUrlForOrigin(resolveOrigin(process.env)),
58
59
  accessToken,
59
60
  // A dry run keeps no state (nothing is spooled for a later run).
@@ -86,25 +87,25 @@ async function main() {
86
87
  : {}),
87
88
  log: (level, message, attributes) => {
88
89
  // A dry run reports its envelopes itself (the upload hook above).
89
- const uploaded = message === "OmniRush collection artifact uploaded" && !dryRun;
90
+ const uploaded = message === "OmniRush session upload: artifact uploaded" && !dryRun;
90
91
  if (uploaded) uploads += 1;
91
92
  if (level === "warn" || uploaded) {
92
- console.error(`omnirush collect: ${message}${attributes ? ` ${JSON.stringify(attributes)}` : ""}`);
93
+ console.error(`omnirush upload: ${message.replace(/^OmniRush session upload: /, "")}${attributes ? ` ${JSON.stringify(attributes)}` : ""}`);
93
94
  }
94
95
  },
95
96
  });
96
- console.log(`collect: ${dir} as session ${sessionId}`);
97
- collector.startSession(sessionId, workspaceId, dir);
98
- collector.finishSession(sessionId);
99
- await collector.stop();
97
+ console.log(`upload: ${dir} as session ${sessionId}`);
98
+ sync.startSession(sessionId, workspaceId, dir);
99
+ sync.finishSession(sessionId);
100
+ await sync.stop();
100
101
  if (uploads === 0) {
101
- console.error("omnirush collect: nothing uploaded");
102
+ console.error("omnirush upload: nothing uploaded");
102
103
  process.exit(1);
103
104
  }
104
105
  console.log(dryRun ? "dry run — no upload performed" : `uploaded ${uploads} envelope(s)`);
105
106
  }
106
107
 
107
108
  main().catch((error) => {
108
- console.error(`omnirush collect failed: ${error?.message ?? error}`);
109
+ console.error(`omnirush upload failed: ${error?.message ?? error}`);
109
110
  process.exit(1);
110
111
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnirush",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "Omnirush — free daily tokens for the most powerful coding model on earth.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
package/src/bin.js CHANGED
@@ -9,7 +9,7 @@
9
9
  // omnirush logout forget the stored tokens
10
10
  // omnirush whoami show the signed-in device identity
11
11
  // omnirush doctor check auth (or pending login), manager, agent config
12
- // omnirush collect one-shot workspace snapshot upload
12
+ // omnirush upload one-shot upload of a workspace snapshot to omnirush.ai
13
13
  // omnirush update update omnirush from npm
14
14
  // omnirush run the agent (default; forwards to the agent core)
15
15
  //
@@ -347,7 +347,7 @@ function installExtensions() {
347
347
  const src = path.join(__dirname, "..", "assets", "extensions", "omnirush");
348
348
  // pi loads extensions/<dir>/index.ts only; that aggregator imports the
349
349
  // sibling .ts modules, the shared auth.js and the capture/ modules (the
350
- // desktop's collector and project archive, in subfolders) — copy every
350
+ // desktop's session uploader and project archive, in subfolders) — copy every
351
351
  // loadable file, keeping the folder layout.
352
352
  const copy = (from, to) => {
353
353
  fs.mkdirSync(to, { recursive: true });
@@ -373,6 +373,18 @@ function installExtensions() {
373
373
  // module open. Keep the running installation usable as a fallback.
374
374
  fs.rmSync(staging, { recursive: true, force: true });
375
375
  copy(src, PI_EXT_DIR);
376
+ // Modules earlier releases installed under names nothing imports any
377
+ // more (the swap above leaves none behind; this in-place copy would).
378
+ for (const stale of [
379
+ "collector-lib.ts",
380
+ "trace-format.ts",
381
+ "collector.ts",
382
+ "pi-engine.ts",
383
+ path.join("capture", "workspace-collector.ts"),
384
+ path.join("capture", "collect-upload-budget.ts"),
385
+ ]) {
386
+ fs.rmSync(path.join(PI_EXT_DIR, stale), { force: true });
387
+ }
376
388
  } finally {
377
389
  fs.rmSync(previous, { recursive: true, force: true });
378
390
  }
@@ -876,7 +888,7 @@ function childEnv(auth) {
876
888
  // /status shows the CLI version; extensions have no package.json of
877
889
  // their own in the agent dir, so the launcher hands it over.
878
890
  OMNIRUSH_VERSION: ownVersion(),
879
- // The collector reports it as the environment's engine_version.
891
+ // The session uploader reports it as the environment's engine_version.
880
892
  OMNIRUSH_ENGINE_VERSION: engineVersion(),
881
893
  // Where this package lives: extensions (copied to the agent dir) load optional
882
894
  // native dependencies from here (voice: @picovoice/pvrecorder-node).
@@ -993,11 +1005,11 @@ async function cmdRun() {
993
1005
  });
994
1006
  }
995
1007
 
996
- async function cmdCollect(argv) {
1008
+ async function cmdUpload(argv) {
997
1009
  ensureDirs();
998
1010
  const auth = requireAuth();
999
1011
  installExtensions();
1000
- const entry = path.join(__dirname, "..", "assets", "collect-once.ts");
1012
+ const entry = path.join(__dirname, "..", "assets", "sync-once.ts");
1001
1013
  const { cmd, args } = await runtimeFor(entry);
1002
1014
  spawnAgent(cmd, [...args, ...argv], {
1003
1015
  stdio: "inherit",
@@ -1017,7 +1029,7 @@ Usage:
1017
1029
  omnirush logout forget the stored device tokens
1018
1030
  omnirush whoami show the signed-in identity
1019
1031
  omnirush doctor check auth, manager, runtime, agent config
1020
- omnirush collect [--dir PATH] one-shot workspace snapshot upload
1032
+ omnirush upload [--dir PATH] upload a one-shot workspace snapshot to omnirush.ai
1021
1033
  omnirush update update omnirush (npm install -g omnirush@latest)
1022
1034
  omnirush --version show the omnirush version
1023
1035
 
@@ -1045,7 +1057,7 @@ Options:
1045
1057
  Session commands (inside the agent):
1046
1058
  /grant today's token grant and usage
1047
1059
  /usage detailed usage from the manager (counters + devices)
1048
- /status session status (identity, model, grant, collector)
1060
+ /status session status (identity, model, grant, session uploads)
1049
1061
  /mcp MCP server state (/mcp reconnect [server])
1050
1062
  /subagents model and effort of the sub-agents (/subagents model <id|same>,
1051
1063
  /subagents effort <level|same>; saved for the next runs)
@@ -1179,7 +1191,7 @@ else if (cmd === "logout") await cmdLogout();
1179
1191
  else if (cmd === "whoami") await cmdWhoami();
1180
1192
  else if (cmd === "doctor") await cmdDoctor();
1181
1193
  else if (cmd === "--version" || cmd === "-v") console.log(`omnirush ${ownVersion()}`);
1182
- else if (cmd === "collect") await cmdCollect(argv.slice(1));
1194
+ else if (cmd === "upload" || cmd === "collect") await cmdUpload(argv.slice(1));
1183
1195
  else if (cmd === undefined || cmd === "run") await cmdRun();
1184
1196
  else if (cmd === "update") await cmdUpdate(argv.slice(1));
1185
1197
  else await runCore(argv);
package/src/sessions.js CHANGED
@@ -9,7 +9,7 @@
9
9
  // (agents-lib.ts subagentSessionDir), which the core never lists.
10
10
  //
11
11
  // moveLegacySubagentSessions puts the children older releases left in a
12
- // session dir into that folder too (moved, never deleted: the collector
12
+ // session dir into that folder too (moved, never deleted: the session uploader
13
13
  // still finds them there when a resumed session records its sub-agents).
14
14
  // It runs at every agent launch before the core picks a session, and
15
15
  // stays cheap on large folders: a marker per session dir records when it
@@ -18,7 +18,7 @@
18
18
  // next launch, in case an older release is still writing them.
19
19
  //
20
20
  // A child is recognised from the top of its session file, by the same
21
- // signals the collector uses (pi-engine.ts subagentTask): the marker entry
21
+ // signals the session uploader uses (engine-messages.ts subagentTask): the marker entry
22
22
  // a sub-agent writes into its own session before its task
23
23
  // (SUBAGENT_ENTRY_TYPE), or — sessions of releases that wrote no marker —
24
24
  // a first user message "Task: <task>" (SUBAGENT_TASK_PREFIX), confirmed by
@@ -31,7 +31,7 @@ import path from "node:path";
31
31
 
32
32
  /** Same name as agents-lib.ts SUBAGENT_SESSIONS_DIR. */
33
33
  export const SUBAGENT_SESSIONS_DIR = "subagents";
34
- /** Same values as pi-engine.ts SUBAGENT_ENTRY_TYPE / SUBAGENT_TASK_PREFIX. */
34
+ /** Same values as engine-messages.ts SUBAGENT_ENTRY_TYPE / SUBAGENT_TASK_PREFIX. */
35
35
  export const SUBAGENT_ENTRY_TYPE = "omnirush-subagent";
36
36
  export const SUBAGENT_TASK_PREFIX = "Task: ";
37
37
  /** Per session dir: when it was last sorted (a .json file: the core only lists *.jsonl). */