omnirush 0.8.6 → 0.9.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/assets/CHANGELOG.md +85 -0
- package/assets/extensions/omnirush/agents-lib.ts +134 -13
- package/assets/extensions/omnirush/agents.ts +51 -107
- package/assets/extensions/omnirush/bgshell-lib.ts +400 -0
- package/assets/extensions/omnirush/bgshell.ts +392 -0
- package/assets/extensions/omnirush/collector.ts +72 -11
- package/assets/extensions/omnirush/commands.ts +2 -0
- package/assets/extensions/omnirush/deliveries.ts +145 -0
- package/assets/extensions/omnirush/guard/UPSTREAM +2 -0
- package/assets/extensions/omnirush/guard/git-command-policy.ts +885 -0
- package/assets/extensions/omnirush/guard-lib.ts +230 -0
- package/assets/extensions/omnirush/guard.ts +340 -0
- package/assets/extensions/omnirush/index.ts +12 -0
- package/assets/extensions/omnirush/pi-engine.ts +65 -1
- package/assets/extensions/omnirush/sota.ts +52 -4
- package/assets/extensions/omnirush/status-lib.ts +3 -0
- package/assets/extensions/omnirush/subagents-lib.ts +623 -0
- package/assets/extensions/omnirush/subagents.ts +305 -0
- package/assets/extensions/omnirush/swarm-lib.ts +142 -0
- package/assets/extensions/omnirush/swarm.ts +95 -0
- package/assets/extensions/omnirush/voice/capture.ts +502 -0
- package/assets/extensions/omnirush/voice/core/UPSTREAM +16 -0
- package/assets/extensions/omnirush/voice/core/file-source.ts +70 -0
- package/assets/extensions/omnirush/voice/core/index.ts +21 -0
- package/assets/extensions/omnirush/voice/core/keyterms.ts +117 -0
- package/assets/extensions/omnirush/voice/core/resample.ts +63 -0
- package/assets/extensions/omnirush/voice/core/segmenter.ts +231 -0
- package/assets/extensions/omnirush/voice/core/session.ts +403 -0
- package/assets/extensions/omnirush/voice/core/text.ts +81 -0
- package/assets/extensions/omnirush/voice/core/transcriber.ts +135 -0
- package/assets/extensions/omnirush/voice/core/types.ts +102 -0
- package/assets/extensions/omnirush/voice/core/wav.ts +95 -0
- package/assets/extensions/omnirush/voice/keys.ts +435 -0
- package/assets/extensions/omnirush/voice/kitty.ts +64 -0
- package/assets/extensions/omnirush/voice/pvrecorder-worker.cjs +43 -0
- package/assets/extensions/omnirush/voice/settings.ts +67 -0
- package/assets/extensions/omnirush/voice.ts +838 -0
- package/assets/extensions/omnirush/yolo-lib.ts +80 -0
- package/assets/extensions/omnirush/yolo.ts +85 -0
- package/package.json +7 -3
- package/scripts/brand-engine.js +526 -0
- package/scripts/build-all-packages.py +29 -1
- package/scripts/smoke-packages.py +32 -1
- package/src/bin.js +205 -33
- package/src/compat.js +272 -0
- package/src/lib.js +64 -0
- package/scripts/patch-pi-branding.js +0 -251
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Approval mode state (guarded by default, yolo on request), shared by
|
|
2
|
+
// /yolo, /mode, the guarded-mode gate, /status and spawn_agents.
|
|
3
|
+
//
|
|
4
|
+
// The launcher resolves yolo for the run (--yolo / --no-yolo, OMNIRUSH_YOLO,
|
|
5
|
+
// then "yolo" in <state dir>/settings.json), adds the core's --approve so the
|
|
6
|
+
// project folder is trusted, and hands the result over in OMNIRUSH_YOLO
|
|
7
|
+
// ("1"/"0"), OMNIRUSH_YOLO_SOURCE and OMNIRUSH_YOLO_TRUSTED. /yolo on|off
|
|
8
|
+
// changes process.env for the rest of the session (sub-agents inherit it)
|
|
9
|
+
// and saves the setting for the next runs.
|
|
10
|
+
|
|
11
|
+
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
12
|
+
import path from "node:path";
|
|
13
|
+
|
|
14
|
+
export const YOLO_BANNER = "yolo mode: no prompts, project trusted";
|
|
15
|
+
/** Footer status key: shows "guarded" or "yolo". */
|
|
16
|
+
export const MODE_STATUS_KEY = "omnirush-mode";
|
|
17
|
+
export const SETTINGS_FILE = "settings.json";
|
|
18
|
+
|
|
19
|
+
export function yoloActive(env: NodeJS.ProcessEnv = process.env): boolean {
|
|
20
|
+
return (env.OMNIRUSH_YOLO || "").trim() === "1";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type ApprovalMode = "guarded" | "yolo";
|
|
24
|
+
|
|
25
|
+
export function currentMode(env: NodeJS.ProcessEnv = process.env): ApprovalMode {
|
|
26
|
+
return yoloActive(env) ? "yolo" : "guarded";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Switch the running session (sub-agents started from now on inherit it). */
|
|
30
|
+
export function setSessionYolo(on: boolean, env: NodeJS.ProcessEnv = process.env): void {
|
|
31
|
+
env.OMNIRUSH_YOLO = on ? "1" : "0";
|
|
32
|
+
env.OMNIRUSH_YOLO_SOURCE = "session";
|
|
33
|
+
if (on) env.OMNIRUSH_YOLO_TRUSTED = "1";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The banner for this run (an explicit --no-approve keeps the project untrusted). */
|
|
37
|
+
export function yoloBanner(env: NodeJS.ProcessEnv = process.env): string {
|
|
38
|
+
return (env.OMNIRUSH_YOLO_TRUSTED || "").trim() === "0"
|
|
39
|
+
? "yolo mode: no prompts (project not trusted: --no-approve)"
|
|
40
|
+
: YOLO_BANNER;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function readAll(dir: string): Record<string, any> {
|
|
44
|
+
try {
|
|
45
|
+
const parsed = JSON.parse(readFileSync(path.join(dir, SETTINGS_FILE), "utf8"));
|
|
46
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
|
|
47
|
+
} catch {
|
|
48
|
+
return {};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function loadYoloSetting(dir: string): boolean {
|
|
53
|
+
return readAll(dir).yolo === true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Keeps the file's other keys; atomic (temp file + rename), 0600. */
|
|
57
|
+
export function saveYoloSetting(dir: string, on: boolean): void {
|
|
58
|
+
const all = readAll(dir);
|
|
59
|
+
all.yolo = on;
|
|
60
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
61
|
+
const file = path.join(dir, SETTINGS_FILE);
|
|
62
|
+
const tmp = `${file}.${process.pid}.tmp`;
|
|
63
|
+
writeFileSync(tmp, `${JSON.stringify(all, null, 2)}\n`, { mode: 0o600 });
|
|
64
|
+
renameSync(tmp, file);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const SOURCE_LABEL: Record<string, string> = {
|
|
68
|
+
flag: "--yolo",
|
|
69
|
+
env: "OMNIRUSH_YOLO",
|
|
70
|
+
setting: "saved with /yolo on",
|
|
71
|
+
session: "/yolo in this session",
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** The /status line. */
|
|
75
|
+
export function formatModeStatus(env: NodeJS.ProcessEnv = process.env): string {
|
|
76
|
+
if (!yoloActive(env)) return "mode: guarded — git writes, destructive commands and sudo ask first";
|
|
77
|
+
const label = SOURCE_LABEL[(env.OMNIRUSH_YOLO_SOURCE || "").trim()];
|
|
78
|
+
const trusted = (env.OMNIRUSH_YOLO_TRUSTED || "").trim() !== "0";
|
|
79
|
+
return `mode: yolo — no prompts, ${trusted ? "project trusted" : "project not trusted (--no-approve)"}${label ? ` (${label})` : ""}`;
|
|
80
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Yolo mode: no prompts, project trusted.
|
|
3
|
+
*
|
|
4
|
+
* omnirush --yolo | OMNIRUSH_YOLO=1 | /yolo on (saved for the next runs)
|
|
5
|
+
*
|
|
6
|
+
* The only confirmation an omnirush session shows is the core's "Trust
|
|
7
|
+
* project folder?" prompt (the core itself has no tool-permission prompts,
|
|
8
|
+
* and the omnirush extensions show no confirmation dialogs: finished
|
|
9
|
+
* background commands and sub-agents are delivered and stopped without
|
|
10
|
+
* asking). Yolo mode answers it:
|
|
11
|
+
* - at launch the launcher passes the core's --approve (trusted for the
|
|
12
|
+
* run, every folder the session switches to included);
|
|
13
|
+
* - after /yolo on in a running session, the project_trust handler below
|
|
14
|
+
* trusts any folder the session switches to (not remembered);
|
|
15
|
+
* - sub-agents get --approve too (agents-lib.ts), since a headless child
|
|
16
|
+
* would otherwise ignore the project's settings.
|
|
17
|
+
* Default behaviour (yolo off) is unchanged: the handler stays undecided.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { omniDir } from "./auth";
|
|
21
|
+
import {
|
|
22
|
+
MODE_STATUS_KEY,
|
|
23
|
+
currentMode,
|
|
24
|
+
formatModeStatus,
|
|
25
|
+
saveYoloSetting,
|
|
26
|
+
setSessionYolo,
|
|
27
|
+
yoloActive,
|
|
28
|
+
yoloBanner,
|
|
29
|
+
} from "./yolo-lib";
|
|
30
|
+
|
|
31
|
+
function showFooter(ctx: any): void {
|
|
32
|
+
try {
|
|
33
|
+
ctx?.ui?.setStatus?.(MODE_STATUS_KEY, currentMode());
|
|
34
|
+
} catch {
|
|
35
|
+
/* no UI */
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default function (pi: any) {
|
|
40
|
+
pi.on("project_trust", () => (yoloActive() ? { trusted: "yes", remember: false } : { trusted: "undecided" }));
|
|
41
|
+
|
|
42
|
+
pi.on("session_start", (_event: any, ctx: any) => {
|
|
43
|
+
if (!yoloActive()) return;
|
|
44
|
+
showFooter(ctx);
|
|
45
|
+
if (ctx?.hasUI) ctx.ui?.notify?.(yoloBanner(), "warning");
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
pi.registerCommand("yolo", {
|
|
49
|
+
description: "Yolo mode: no prompts, project trusted — /yolo [on|off|status]",
|
|
50
|
+
getArgumentCompletions: (prefix: string) => {
|
|
51
|
+
const typed = prefix.trim();
|
|
52
|
+
const items = ["on", "off", "status"]
|
|
53
|
+
.filter((value) => value.startsWith(typed) && value !== typed)
|
|
54
|
+
.map((value) => ({ value, label: value }));
|
|
55
|
+
return items.length ? items : null;
|
|
56
|
+
},
|
|
57
|
+
handler: async (args: string, ctx: any) => {
|
|
58
|
+
const sub = String(args ?? "").trim().toLowerCase();
|
|
59
|
+
const notify = (text: string, level: "info" | "warning" | "error" = "info") => ctx?.ui?.notify?.(text, level);
|
|
60
|
+
if (sub === "" || sub === "status") {
|
|
61
|
+
notify(`${formatModeStatus()}\n/yolo on|off saves it for the next runs; --yolo or OMNIRUSH_YOLO=1 for one run.`);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (sub !== "on" && sub !== "off") {
|
|
65
|
+
notify("Usage: /yolo [on|off|status]", "error");
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const on = sub === "on";
|
|
69
|
+
try {
|
|
70
|
+
saveYoloSetting(omniDir(), on);
|
|
71
|
+
} catch (error: any) {
|
|
72
|
+
notify(`/yolo: could not save the setting (${error?.message ?? error})`, "error");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
setSessionYolo(on);
|
|
76
|
+
showFooter(ctx);
|
|
77
|
+
notify(
|
|
78
|
+
on
|
|
79
|
+
? `${yoloBanner()} (saved). Folders this session switches to and sub-agents are trusted now; this folder's project settings load from the next start if they were not trusted.`
|
|
80
|
+
: "yolo mode off (saved): guarded mode — git writes, destructive commands and sudo ask first; the project trust prompt is back from the next start.",
|
|
81
|
+
on ? "warning" : "info",
|
|
82
|
+
);
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnirush",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Omnirush \u2014 free daily tokens for the most powerful coding model on earth.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"test:bun": "if [ -x .runtime/bin/bun ]; then .runtime/bin/bun test --timeout 300000 test/; else bun test --timeout 300000 test/; fi",
|
|
16
16
|
"build:mcp": "node scripts/build-mcp-bundle.js",
|
|
17
17
|
"build:capture-vendor": "node scripts/build-capture-vendor.js",
|
|
18
|
-
"postinstall": "node scripts/
|
|
18
|
+
"postinstall": "node scripts/brand-engine.js && node scripts/postinstall.js"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@earendil-works/pi-coding-agent": "0.86.1"
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"url": "git+https://github.com/omnirush-ai/omnirush-cli.git"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
28
|
+
"omnirush",
|
|
28
29
|
"ai",
|
|
29
30
|
"coding-agent",
|
|
30
31
|
"cli"
|
|
@@ -40,5 +41,8 @@
|
|
|
40
41
|
"esbuild": "^0.28.2",
|
|
41
42
|
"minimatch": "^10.2.6",
|
|
42
43
|
"zod": "^4.6.5"
|
|
44
|
+
},
|
|
45
|
+
"optionalDependencies": {
|
|
46
|
+
"@picovoice/pvrecorder-node": "1.2.9"
|
|
43
47
|
}
|
|
44
|
-
}
|
|
48
|
+
}
|