@steipete/oracle 1.1.0 → 1.3.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/README.md +40 -7
- package/assets-oracle-icon.png +0 -0
- package/dist/.DS_Store +0 -0
- package/dist/bin/oracle-cli.js +315 -47
- package/dist/bin/oracle-mcp.js +6 -0
- package/dist/src/browser/actions/modelSelection.js +117 -29
- package/dist/src/browser/config.js +6 -0
- package/dist/src/browser/cookies.js +50 -12
- package/dist/src/browser/index.js +19 -5
- package/dist/src/browser/prompt.js +6 -5
- package/dist/src/browser/sessionRunner.js +14 -3
- package/dist/src/cli/browserConfig.js +109 -2
- package/dist/src/cli/detach.js +12 -0
- package/dist/src/cli/dryRun.js +60 -8
- package/dist/src/cli/engine.js +7 -0
- package/dist/src/cli/help.js +3 -1
- package/dist/src/cli/hiddenAliases.js +17 -0
- package/dist/src/cli/markdownRenderer.js +79 -0
- package/dist/src/cli/notifier.js +223 -0
- package/dist/src/cli/options.js +22 -0
- package/dist/src/cli/promptRequirement.js +3 -0
- package/dist/src/cli/runOptions.js +43 -0
- package/dist/src/cli/sessionCommand.js +1 -1
- package/dist/src/cli/sessionDisplay.js +94 -7
- package/dist/src/cli/sessionRunner.js +32 -2
- package/dist/src/cli/tui/index.js +457 -0
- package/dist/src/config.js +27 -0
- package/dist/src/mcp/server.js +36 -0
- package/dist/src/mcp/tools/consult.js +158 -0
- package/dist/src/mcp/tools/sessionResources.js +64 -0
- package/dist/src/mcp/tools/sessions.js +106 -0
- package/dist/src/mcp/types.js +17 -0
- package/dist/src/mcp/utils.js +24 -0
- package/dist/src/oracle/client.js +24 -6
- package/dist/src/oracle/config.js +10 -0
- package/dist/src/oracle/files.js +151 -8
- package/dist/src/oracle/format.js +2 -7
- package/dist/src/oracle/fsAdapter.js +4 -1
- package/dist/src/oracle/gemini.js +161 -0
- package/dist/src/oracle/logging.js +36 -0
- package/dist/src/oracle/oscProgress.js +7 -1
- package/dist/src/oracle/run.js +148 -64
- package/dist/src/oracle/tokenEstimate.js +34 -0
- package/dist/src/oracle.js +1 -0
- package/dist/src/sessionManager.js +50 -3
- package/dist/vendor/oracle-notifier/OracleNotifier.app/Contents/CodeResources +0 -0
- package/dist/vendor/oracle-notifier/OracleNotifier.app/Contents/Info.plist +20 -0
- package/dist/vendor/oracle-notifier/OracleNotifier.app/Contents/MacOS/OracleNotifier +0 -0
- package/dist/vendor/oracle-notifier/OracleNotifier.app/Contents/Resources/OracleIcon.icns +0 -0
- package/dist/vendor/oracle-notifier/OracleNotifier.app/Contents/_CodeSignature/CodeResources +128 -0
- package/dist/vendor/oracle-notifier/OracleNotifier.swift +45 -0
- package/dist/vendor/oracle-notifier/README.md +24 -0
- package/dist/vendor/oracle-notifier/build-notifier.sh +93 -0
- package/dist/vendor/oracle-notifier/oracle-notifier/OracleNotifier.app/Contents/CodeResources +0 -0
- package/dist/vendor/oracle-notifier/oracle-notifier/OracleNotifier.app/Contents/Info.plist +20 -0
- package/dist/vendor/oracle-notifier/oracle-notifier/OracleNotifier.app/Contents/MacOS/OracleNotifier +0 -0
- package/dist/vendor/oracle-notifier/oracle-notifier/OracleNotifier.app/Contents/Resources/OracleIcon.icns +0 -0
- package/dist/vendor/oracle-notifier/oracle-notifier/OracleNotifier.app/Contents/_CodeSignature/CodeResources +128 -0
- package/dist/vendor/oracle-notifier/oracle-notifier/OracleNotifier.swift +45 -0
- package/dist/vendor/oracle-notifier/oracle-notifier/README.md +24 -0
- package/dist/vendor/oracle-notifier/oracle-notifier/build-notifier.sh +93 -0
- package/package.json +22 -6
- package/vendor/oracle-notifier/OracleNotifier.app/Contents/CodeResources +0 -0
- package/vendor/oracle-notifier/OracleNotifier.app/Contents/Info.plist +20 -0
- package/vendor/oracle-notifier/OracleNotifier.app/Contents/MacOS/OracleNotifier +0 -0
- package/vendor/oracle-notifier/OracleNotifier.app/Contents/Resources/OracleIcon.icns +0 -0
- package/vendor/oracle-notifier/OracleNotifier.app/Contents/_CodeSignature/CodeResources +128 -0
- package/vendor/oracle-notifier/OracleNotifier.swift +45 -0
- package/vendor/oracle-notifier/build-notifier.sh +93 -0
package/README.md
CHANGED
|
@@ -20,6 +20,12 @@ Oracle gives your agents a simple, reliable way to **bundle a prompt plus the ri
|
|
|
20
20
|
|
|
21
21
|
If you omit `--engine`, Oracle prefers the API engine when `OPENAI_API_KEY` is present; otherwise it falls back to browser mode. Switch explicitly with `-e, --engine {api|browser}` when you want to override the auto choice. Everything else (prompt assembly, file handling, session logging) stays the same.
|
|
22
22
|
|
|
23
|
+
Note: Browser engine is considered experimental, requires an OpenAI Pro account and only works on macOS with Chrome.
|
|
24
|
+
Windows/Linux browser support is in progress; until then, use `--engine api` or bundle files and paste manually.
|
|
25
|
+
Your system password is needed to copy cookies. To skip Chrome/Keychain entirely, pass inline cookies via
|
|
26
|
+
`--browser-inline-cookies <json|base64>` or `--browser-inline-cookies-file <path>` (fallback files at
|
|
27
|
+
`~/.oracle/cookies.json` or `~/.oracle/cookies.base64`). API engine is stable and should be preferred.
|
|
28
|
+
|
|
23
29
|
## Quick start
|
|
24
30
|
|
|
25
31
|
```bash
|
|
@@ -35,6 +41,12 @@ npx -y @steipete/oracle -p "Review the TS data layer" --file "src/**/*.ts" --fil
|
|
|
35
41
|
# Mixed glob + single file
|
|
36
42
|
npx -y @steipete/oracle -p "Audit data layer" --file "src/**/*.ts" --file README.md
|
|
37
43
|
|
|
44
|
+
# Dry-run (no API call) with summary estimate
|
|
45
|
+
oracle --dry-run summary -p "Check release notes" --file docs/release-notes.md
|
|
46
|
+
|
|
47
|
+
# Alternate base URL (LiteLLM, Azure, self-hosted gateways)
|
|
48
|
+
OPENAI_API_KEY=sk-... oracle --base-url https://litellm.example.com/v1 -p "Summarize the risk register"
|
|
49
|
+
|
|
38
50
|
# Inspect past sessions
|
|
39
51
|
oracle status --clear --hours 168 # prune a week of cached runs
|
|
40
52
|
oracle status # list runs; grab an ID
|
|
@@ -43,8 +55,23 @@ oracle session <id> # replay a run locally
|
|
|
43
55
|
|
|
44
56
|
## How do I integrate this?
|
|
45
57
|
|
|
46
|
-
|
|
47
|
-
-
|
|
58
|
+
**CLI** (direct calls; great for CI or scripted tasks)
|
|
59
|
+
- One-liner in CI: `OPENAI_API_KEY=sk-... npx -y @steipete/oracle --prompt "Smoke-check latest PR" --file src/ docs/ --preview summary`.
|
|
60
|
+
- Package script: add `"oracle": "oracle --prompt \"Review the diff\" --file ."` to `package.json`, then run `OPENAI_API_KEY=... pnpm oracle`.
|
|
61
|
+
- Don’t want to export the key? Inline works: `OPENAI_API_KEY=sk-... oracle -p "Quick check" --file src/`.
|
|
62
|
+
|
|
63
|
+
**MCP** (tools + resources; mix-and-match with the CLI sessions)
|
|
64
|
+
- Run the bundled stdio server: `pnpm mcp` (or `oracle-mcp`) after `pnpm build`. Tools: `consult`, `sessions`; resources: `oracle-session://{id}/{metadata|log|request}`. Details in [docs/mcp.md](docs/mcp.md).
|
|
65
|
+
- mcporter config (stdio):
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"name": "oracle",
|
|
69
|
+
"type": "stdio",
|
|
70
|
+
"command": "npx",
|
|
71
|
+
"args": ["-y", "@steipete/oracle", "oracle-mcp"]
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
- You can call the MCP tools against sessions created by the CLI (shared `~/.oracle/sessions`), and vice versa.
|
|
48
75
|
|
|
49
76
|
## Highlights
|
|
50
77
|
|
|
@@ -56,20 +83,24 @@ oracle session <id> # replay a run locally
|
|
|
56
83
|
- **File safety** — Per-file token accounting and size guards; `--files-report` shows exactly what you’re sending.
|
|
57
84
|
- **Readable previews** — `--preview` / `--render-markdown` let you inspect the bundle before spending.
|
|
58
85
|
|
|
86
|
+
## Configuration
|
|
87
|
+
|
|
88
|
+
Put per-user defaults in `~/.oracle/config.json` (parsed as JSON5, so comments/trailing commas are fine). Example settings cover default engine/model, notifications, browser defaults, and prompt suffixes. See `docs/configuration.md` for a complete example and precedence.
|
|
89
|
+
|
|
59
90
|
## Flags you’ll actually use
|
|
60
91
|
|
|
61
92
|
| Flag | Purpose |
|
|
62
93
|
| --- | --- |
|
|
63
94
|
| `-p, --prompt <text>` | Required prompt. |
|
|
64
95
|
| `-f, --file <paths...>` | Attach files/dirs (supports globs and `!` excludes). |
|
|
65
|
-
| `-e, --engine <api
|
|
96
|
+
| `-e, --engine <api\|browser>` | Choose API or browser automation. Omitted: API when `OPENAI_API_KEY` is set, otherwise browser. |
|
|
66
97
|
| `-m, --model <name>` | `gpt-5-pro` (default) or `gpt-5.1`. |
|
|
98
|
+
| `--base-url <url>` | Point the API engine at any OpenAI-compatible endpoint (LiteLLM, Azure, etc.). |
|
|
99
|
+
| `--azure-endpoint <url>` | Use Azure OpenAI (switches client automatically). |
|
|
67
100
|
| `--files-report` | Print per-file token usage. |
|
|
68
|
-
| `--
|
|
69
|
-
| `--render-markdown` | Print the assembled `[SYSTEM]/[USER]/[FILE]` bundle. |
|
|
70
|
-
| `-v, --verbose` | Extra logging (also surfaces advanced flags with `--help`). |
|
|
101
|
+
| `--dry-run [summary\|json\|full]` | Inspect the request without sending (alias: `--preview`). |
|
|
71
102
|
|
|
72
|
-
|
|
103
|
+
See [docs/openai-endpoints.md](docs/openai-endpoints.md) for advanced Azure/LiteLLM configuration.
|
|
73
104
|
|
|
74
105
|
## Sessions & background runs
|
|
75
106
|
|
|
@@ -78,6 +109,8 @@ Add `--render` (alias `--render-markdown`) when attaching to pretty-print the st
|
|
|
78
109
|
|
|
79
110
|
**Recommendation:** Prefer the API engine when you have an API key (`--engine api` or just set `OPENAI_API_KEY`). The API delivers more reliable results and supports longer, uninterrupted runs than the browser engine in most cases.
|
|
80
111
|
|
|
112
|
+
**Wait vs no-wait:** gpt-5-pro API runs default to detaching (shows a reattach hint); add `--wait` to stay attached. gpt-5.1 and browser runs block by default. You can reattach anytime via `oracle session <id>`.
|
|
113
|
+
|
|
81
114
|
## Testing
|
|
82
115
|
|
|
83
116
|
```bash
|
|
Binary file
|
package/dist/.DS_Store
CHANGED
|
Binary file
|