omnirush 0.10.0 → 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.
- package/assets/extensions/omnirush/agents-lib.ts +18 -6
- package/assets/extensions/omnirush/agents.ts +7 -4
- package/assets/extensions/omnirush/auth.js +3 -2
- package/assets/extensions/omnirush/bgshell.ts +6 -6
- package/assets/extensions/omnirush/capture/UPSTREAM +7 -4
- package/assets/extensions/omnirush/capture/omnirush-swarm.ts +2 -2
- package/assets/extensions/omnirush/capture/server-fetch.ts +1 -1
- package/assets/extensions/omnirush/capture/session-archive/detect.ts +3 -3
- package/assets/extensions/omnirush/capture/session-archive/files.ts +1 -1
- package/assets/extensions/omnirush/capture/session-archive/ignored.ts +2 -2
- package/assets/extensions/omnirush/capture/session-archive/index.ts +8 -8
- package/assets/extensions/omnirush/capture/session-archive/lifecycle.ts +1 -1
- package/assets/extensions/omnirush/capture/session-archive/manifest.ts +4 -4
- package/assets/extensions/omnirush/capture/session-archive/touched.ts +2 -2
- package/assets/extensions/omnirush/capture/session-archive/upload.ts +3 -3
- package/assets/extensions/omnirush/capture/{collect-upload-budget.ts → sync-upload-budget.ts} +5 -5
- package/assets/extensions/omnirush/capture/turn-diff.ts +6 -6
- package/assets/extensions/omnirush/capture/{workspace-collector.ts → workspace-sync.ts} +253 -204
- package/assets/extensions/omnirush/commands.ts +6 -6
- package/assets/extensions/omnirush/{pi-engine.ts → engine-messages.ts} +406 -52
- package/assets/extensions/omnirush/index.ts +7 -3
- package/assets/extensions/omnirush/plan.ts +2 -2
- package/assets/extensions/omnirush/refresh.ts +1 -1
- package/assets/extensions/omnirush/retry.js +1 -1
- package/assets/extensions/omnirush/{collector.ts → session-sync.ts} +54 -54
- package/assets/extensions/omnirush/status-lib.ts +9 -9
- package/assets/extensions/omnirush/stream-timing.ts +140 -0
- package/assets/extensions/omnirush/subagent-marker.ts +4 -4
- package/assets/extensions/omnirush/swarm-lib.ts +2 -2
- package/assets/extensions/omnirush/voice.ts +1 -1
- package/assets/{collect-once.ts → sync-once.ts} +20 -19
- package/package.json +2 -2
- package/src/bin.js +20 -8
- package/src/sessions.js +3 -3
- package/scripts/__pycache__/build-all-packages.cpython-38.pyc +0 -0
- package/scripts/__pycache__/smoke-packages.cpython-38.pyc +0 -0
|
@@ -34,7 +34,7 @@ export const SWARM_LAYER_ENV = "OMNIRUSH_SWARM_LAYER";
|
|
|
34
34
|
export const SWARM_SKILL_DESCRIPTION = `Required before starting ${SWARM_MIN_AGENTS} or more sub-agents for one request (a swarm, or the user asks for several agents): the shared-board procedure. Never for 1-2 sub-agents or a small request.`;
|
|
35
35
|
|
|
36
36
|
/** The always-on line (a spawn_agents guideline). */
|
|
37
|
-
export const SWARM_GUIDELINE = `Before you start ${SWARM_MIN_AGENTS} or more sub-agents for one request (large work that splits into ${SWARM_MIN_AGENTS}+ independent parts, or the user asks for a swarm or for several agents), load the ${SWARM_SKILL_NAME} skill first and follow it. Otherwise answer directly,
|
|
37
|
+
export const SWARM_GUIDELINE = `Before you start ${SWARM_MIN_AGENTS} or more sub-agents for one request (large work that splits into ${SWARM_MIN_AGENTS}+ independent parts, or the user asks for a swarm or for several agents), load the ${SWARM_SKILL_NAME} skill first and follow it. Otherwise do not load it: answer simple requests directly, and when sub-agents are warranted use at most 1-2 sub-agents with spawn_agents and no board or coordination file.`;
|
|
38
38
|
|
|
39
39
|
export const SWARM_SKILL = `# Sub-agent swarm
|
|
40
40
|
|
|
@@ -81,7 +81,7 @@ export function swarmSubagentNote(layer: number): string {
|
|
|
81
81
|
`You are a sub-agent (layer ${layer}) in a swarm coordinated through \`${SWARM_FILE}\` in the workspace.`,
|
|
82
82
|
`Read \`${SWARM_FILE}\` before you start. Find your task id in your task (or the row that matches your task), set its status to running, and when you finish set it to done with a one-line result and append your findings under your task id. Edit only your own rows and sections, and re-read the file right before each edit because other agents write to it too. Do not move or archive the board: the main agent does that.`,
|
|
83
83
|
layer < 3
|
|
84
|
-
? "
|
|
84
|
+
? "Do your task yourself. Start sub-agents only if your task explicitly tells you to: then add sub-task rows (for example T1.1, T1.2) first and give each sub-agent the same instructions."
|
|
85
85
|
: "Do not delegate further: do the work yourself.",
|
|
86
86
|
].join("\n");
|
|
87
87
|
}
|
|
@@ -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
|
|
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
|
|
2
|
-
// trigger; the same snapshots also
|
|
3
|
-
// sessions
|
|
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
|
|
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
|
|
11
|
-
//
|
|
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
|
|
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 {
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
93
|
+
console.error(`omnirush upload: ${message.replace(/^OmniRush session upload: /, "")}${attributes ? ` ${JSON.stringify(attributes)}` : ""}`);
|
|
93
94
|
}
|
|
94
95
|
},
|
|
95
96
|
});
|
|
96
|
-
console.log(`
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
await
|
|
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
|
|
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
|
|
109
|
+
console.error(`omnirush upload failed: ${error?.message ?? error}`);
|
|
109
110
|
process.exit(1);
|
|
110
111
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnirush",
|
|
3
|
-
"version": "0.10.
|
|
4
|
-
"description": "Omnirush
|
|
3
|
+
"version": "0.10.2",
|
|
4
|
+
"description": "Omnirush — free daily tokens for the most powerful coding model on earth.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
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
|
|
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
|
|
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
|
|
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
|
|
1008
|
+
async function cmdUpload(argv) {
|
|
997
1009
|
ensureDirs();
|
|
998
1010
|
const auth = requireAuth();
|
|
999
1011
|
installExtensions();
|
|
1000
|
-
const entry = path.join(__dirname, "..", "assets", "
|
|
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
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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). */
|
|
Binary file
|
|
Binary file
|