orion-super-agent-dev 0.1.38 → 0.1.40
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/launcherName.d.mts +2 -0
- package/bin/launcherName.mjs +26 -0
- package/bin/orion.js +25 -4
- package/bin/usage.cjs +25 -0
- package/out/brains/darwin-arm64/orion-brain +0 -0
- package/out/brains/darwin-x64/orion-brain +0 -0
- package/out/brains/linux-arm64/orion-brain +0 -0
- package/out/brains/linux-x64/orion-brain +0 -0
- package/out/brains/win32-x64/orion-brain.exe +0 -0
- package/out/main.js +8074 -3729
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// The name the reader started this app by — `orion`, `orion-dev` or `orion-stage` — read off
|
|
2
|
+
// `process.argv[1]`. Plain ESM on node's own modules alone, so bin/orion.js can answer --help by
|
|
3
|
+
// the right name before the app bundle loads, and the app (services/resumeHint.ts) names the same
|
|
4
|
+
// launcher in the command that reopens a chat. One rule, two readers.
|
|
5
|
+
import { basename } from "node:path";
|
|
6
|
+
|
|
7
|
+
// The script an installed package runs: `node_modules/orion-super-agent[-<tier>]/bin/orion.js`
|
|
8
|
+
// (the per-tier npm names — scripts/publish-tui.sh). On macOS and Linux npm links the launcher as
|
|
9
|
+
// a symlink named per tier, and that name is what argv[1] holds; on Windows npm writes a `.cmd`
|
|
10
|
+
// shim that runs node on this script, so argv[1] is the script's path and the package directory
|
|
11
|
+
// is what names the tier.
|
|
12
|
+
const INSTALLED_SCRIPT = /[\\/]node_modules[\\/]orion-super-agent(-[a-z]+)?[\\/]bin[\\/]orion\.[cm]?js$/i;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The installed launcher's name, or null for a script run by hand (a checkout's
|
|
16
|
+
* `node tui/bin/orion.js`), which has no installed name.
|
|
17
|
+
* @param {string | undefined} argv1 `process.argv[1]`
|
|
18
|
+
* @returns {string | null}
|
|
19
|
+
*/
|
|
20
|
+
export function launcherName(argv1) {
|
|
21
|
+
if (!argv1) return null;
|
|
22
|
+
const name = basename(argv1);
|
|
23
|
+
if (!/\.[cm]?js$/i.test(name)) return name;
|
|
24
|
+
const installed = INSTALLED_SCRIPT.exec(argv1);
|
|
25
|
+
return installed ? `orion${installed[1] ?? ""}` : null;
|
|
26
|
+
}
|
package/bin/orion.js
CHANGED
|
@@ -1,11 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Orion terminal client entry point. Loads the compiled app (out/main.js).
|
|
3
3
|
// During development run `npm run dev` (tsx) instead.
|
|
4
|
+
//
|
|
5
|
+
// The invoked name, not a hardcoded one: this same shim ships as `orion`, `orion-dev`, and
|
|
6
|
+
// `orion-stage` (one bin file, per-tier package.json bin keys), and an error signed by the
|
|
7
|
+
// wrong tier's name would send the user debugging the wrong install.
|
|
8
|
+
import { basename } from "node:path";
|
|
9
|
+
import { createRequire } from "node:module";
|
|
10
|
+
import { launcherName } from "./launcherName.mjs";
|
|
11
|
+
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
// The installed name — `orion-dev`, also behind Windows' `.cmd` shim, which runs node on this
|
|
14
|
+
// script — else the script's own name for a run by hand.
|
|
15
|
+
const self = launcherName(process.argv[1]) ?? basename(process.argv[1] || "orion");
|
|
16
|
+
const argv = process.argv.slice(2);
|
|
17
|
+
|
|
18
|
+
// --help and --version are answered here, before the app bundle loads: neither needs a
|
|
19
|
+
// backend, a config or a terminal, and a reader asking for them should never see the app.
|
|
20
|
+
if (argv.includes("--version") || argv.includes("-v")) {
|
|
21
|
+
console.log(require("../package.json").version);
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
25
|
+
console.log(require("./usage.cjs").usageFor(self));
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
|
|
4
29
|
import("../out/main.js").catch((err) => {
|
|
5
|
-
// The invoked name, not a hardcoded one: this same shim ships as `orion`, `orion-dev`, and
|
|
6
|
-
// `orion-stage` (one bin file, per-tier package.json bin keys), and an error signed by the
|
|
7
|
-
// wrong tier's name would send the user debugging the wrong install.
|
|
8
|
-
const self = require("path").basename(process.argv[1] || "orion");
|
|
9
30
|
console.error(self + ": failed to start —", err && err.stack ? err.stack : err);
|
|
10
31
|
process.exit(1);
|
|
11
32
|
});
|
package/bin/usage.cjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// The launcher's --help text. CommonJS so bin/orion.js can print it before the app bundle
|
|
2
|
+
// loads, and the tests can read the same words.
|
|
3
|
+
|
|
4
|
+
/** @param {string} name the invoked command name (orion / orion-dev / orion-stage) */
|
|
5
|
+
function usageFor(name) {
|
|
6
|
+
return [
|
|
7
|
+
`Usage: ${name} [options] [prompt]`,
|
|
8
|
+
"",
|
|
9
|
+
"Start Orion in the current directory. A prompt is sent as the first message.",
|
|
10
|
+
"",
|
|
11
|
+
"Options:",
|
|
12
|
+
" -c, --continue Reopen the most recent saved chat",
|
|
13
|
+
" --resume <id> Reopen a saved chat by id (printed when you quit; /resume lists them)",
|
|
14
|
+
" -p, --prompt <text> Send <text> as the first message (same as a bare prompt)",
|
|
15
|
+
" --fully-automatic Turbo: every permission card answered for you — unattended runs only",
|
|
16
|
+
" --headless --goal <goal> [--max-turns <n>] [--workspace <dir>] [--model <id>]",
|
|
17
|
+
" Run one goal to completion with no UI; one JSON result line",
|
|
18
|
+
" -h, --help Show this help",
|
|
19
|
+
" -v, --version Show the version",
|
|
20
|
+
"",
|
|
21
|
+
"Inside the app: / lists commands, @ mentions a file, ! runs a shell command, ? shows the keys.",
|
|
22
|
+
].join("\n");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = { usageFor };
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|