@steipete/oracle 1.0.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/LICENSE +21 -0
- package/README.md +85 -0
- package/dist/bin/oracle-cli.js +458 -0
- package/dist/bin/oracle.js +683 -0
- package/dist/scripts/browser-tools.js +536 -0
- package/dist/scripts/check.js +21 -0
- package/dist/scripts/chrome/browser-tools.js +295 -0
- package/dist/scripts/run-cli.js +14 -0
- package/dist/src/browser/actions/assistantResponse.js +471 -0
- package/dist/src/browser/actions/attachments.js +82 -0
- package/dist/src/browser/actions/modelSelection.js +190 -0
- package/dist/src/browser/actions/navigation.js +75 -0
- package/dist/src/browser/actions/promptComposer.js +167 -0
- package/dist/src/browser/chromeLifecycle.js +104 -0
- package/dist/src/browser/config.js +33 -0
- package/dist/src/browser/constants.js +40 -0
- package/dist/src/browser/cookies.js +210 -0
- package/dist/src/browser/domDebug.js +36 -0
- package/dist/src/browser/index.js +319 -0
- package/dist/src/browser/pageActions.js +5 -0
- package/dist/src/browser/prompt.js +56 -0
- package/dist/src/browser/promptSummary.js +20 -0
- package/dist/src/browser/sessionRunner.js +77 -0
- package/dist/src/browser/types.js +1 -0
- package/dist/src/browser/utils.js +62 -0
- package/dist/src/browserMode.js +1 -0
- package/dist/src/cli/browserConfig.js +44 -0
- package/dist/src/cli/dryRun.js +59 -0
- package/dist/src/cli/engine.js +17 -0
- package/dist/src/cli/errorUtils.js +9 -0
- package/dist/src/cli/help.js +68 -0
- package/dist/src/cli/options.js +103 -0
- package/dist/src/cli/promptRequirement.js +14 -0
- package/dist/src/cli/rootAlias.js +16 -0
- package/dist/src/cli/sessionCommand.js +48 -0
- package/dist/src/cli/sessionDisplay.js +222 -0
- package/dist/src/cli/sessionRunner.js +94 -0
- package/dist/src/heartbeat.js +43 -0
- package/dist/src/oracle/client.js +48 -0
- package/dist/src/oracle/config.js +29 -0
- package/dist/src/oracle/errors.js +101 -0
- package/dist/src/oracle/files.js +220 -0
- package/dist/src/oracle/format.js +33 -0
- package/dist/src/oracle/fsAdapter.js +7 -0
- package/dist/src/oracle/request.js +48 -0
- package/dist/src/oracle/run.js +411 -0
- package/dist/src/oracle/tokenStats.js +39 -0
- package/dist/src/oracle/types.js +1 -0
- package/dist/src/oracle.js +9 -0
- package/dist/src/sessionManager.js +205 -0
- package/dist/src/version.js +39 -0
- package/package.json +69 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
let cachedVersion = null;
|
|
5
|
+
export function getCliVersion() {
|
|
6
|
+
if (cachedVersion) {
|
|
7
|
+
return cachedVersion;
|
|
8
|
+
}
|
|
9
|
+
cachedVersion = readVersionFromPackage();
|
|
10
|
+
return cachedVersion;
|
|
11
|
+
}
|
|
12
|
+
function readVersionFromPackage() {
|
|
13
|
+
const modulePath = fileURLToPath(import.meta.url);
|
|
14
|
+
let currentDir = path.dirname(modulePath);
|
|
15
|
+
const filesystemRoot = path.parse(currentDir).root;
|
|
16
|
+
// biome-ignore lint/nursery/noUnnecessaryConditions: deliberate sentinel loop to walk up directories
|
|
17
|
+
while (true) {
|
|
18
|
+
const candidate = path.join(currentDir, 'package.json');
|
|
19
|
+
try {
|
|
20
|
+
const raw = readFileSync(candidate, 'utf8');
|
|
21
|
+
const parsed = JSON.parse(raw);
|
|
22
|
+
const version = typeof parsed.version === 'string' && parsed.version.trim().length > 0
|
|
23
|
+
? parsed.version.trim()
|
|
24
|
+
: '0.0.0';
|
|
25
|
+
return version;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
const code = error instanceof Error && 'code' in error ? error.code : undefined;
|
|
29
|
+
if (code && code !== 'ENOENT') {
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (currentDir === filesystemRoot) {
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
currentDir = path.dirname(currentDir);
|
|
37
|
+
}
|
|
38
|
+
return '0.0.0';
|
|
39
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@steipete/oracle",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CLI wrapper around OpenAI Responses API with GPT-5 Pro and GPT-5.1 high reasoning modes.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/bin/oracle-cli.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"oracle": "./dist/bin/oracle-cli.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc -p tsconfig.build.json",
|
|
12
|
+
"start": "pnpm run build && node ./dist/scripts/run-cli.js",
|
|
13
|
+
"oracle": "pnpm start",
|
|
14
|
+
"typecheck": "tsc --noEmit",
|
|
15
|
+
"lint": "pnpm run typecheck && biome lint .",
|
|
16
|
+
"test": "vitest run",
|
|
17
|
+
"test:coverage": "vitest run --coverage",
|
|
18
|
+
"prepare": "pnpm run build"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/**/*",
|
|
22
|
+
"README.md",
|
|
23
|
+
"LICENSE"
|
|
24
|
+
],
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/steipete/oracle.git"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [],
|
|
30
|
+
"author": "",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/steipete/oracle/issues"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/steipete/oracle#readme",
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"chalk": "^5.6.2",
|
|
38
|
+
"chrome-cookies-secure": "^3.0.0",
|
|
39
|
+
"chrome-launcher": "^1.2.1",
|
|
40
|
+
"chrome-remote-interface": "^0.33.3",
|
|
41
|
+
"commander": "^14.0.2",
|
|
42
|
+
"dotenv": "^17.2.3",
|
|
43
|
+
"fast-glob": "^3.3.3",
|
|
44
|
+
"gpt-tokenizer": "^3.4.0",
|
|
45
|
+
"keytar": "^7.9.0",
|
|
46
|
+
"kleur": "^4.1.5",
|
|
47
|
+
"openai": "^6.9.0",
|
|
48
|
+
"sqlite3": "^5.1.7"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@biomejs/biome": "^2.3.5",
|
|
52
|
+
"@types/chrome-remote-interface": "^0.31.14",
|
|
53
|
+
"@types/node": "^24.10.1",
|
|
54
|
+
"@vitest/coverage-v8": "4.0.9",
|
|
55
|
+
"bun-types": "^1.3.2",
|
|
56
|
+
"devtools-protocol": "^0.0.1543509",
|
|
57
|
+
"puppeteer-core": "^23.10.4",
|
|
58
|
+
"tsx": "^4.20.0",
|
|
59
|
+
"typescript": "^5.9.3",
|
|
60
|
+
"vitest": "^4.0.9"
|
|
61
|
+
},
|
|
62
|
+
"pnpm": {
|
|
63
|
+
"onlyBuiltDependencies": [
|
|
64
|
+
"chrome-cookies-secure",
|
|
65
|
+
"keytar",
|
|
66
|
+
"sqlite3"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|