@numairbaseer/scifcode 0.1.4 → 0.1.5
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 +3 -18
- package/package.json +2 -2
- package/src/cli.js +1 -87
package/README.md
CHANGED
|
@@ -52,27 +52,13 @@ scifcode
|
|
|
52
52
|
scifcode -p "Review the current diff for correctness and missing tests."
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
scifcode doctor
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
`doctor` creates or updates Scifcode's provider config, checks whether the runtime can be resolved, and verifies that an API key is present.
|
|
62
|
-
|
|
63
|
-
## Initialize config explicitly
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
scifcode init
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
`init` creates or updates:
|
|
55
|
+
Scifcode automatically creates or updates:
|
|
70
56
|
|
|
71
57
|
```text
|
|
72
58
|
~/.config/scifcode/scifcode.json
|
|
73
59
|
```
|
|
74
60
|
|
|
75
|
-
|
|
61
|
+
This happens before the runtime launches, so no separate initialization command is required.
|
|
76
62
|
|
|
77
63
|
## Environment variables
|
|
78
64
|
|
|
@@ -108,7 +94,6 @@ export SCIFCODE_API_KEY="endpoint_or_modal_bearer_token"
|
|
|
108
94
|
Then retry:
|
|
109
95
|
|
|
110
96
|
```bash
|
|
111
|
-
scifcode doctor
|
|
112
97
|
scifcode
|
|
113
98
|
```
|
|
114
99
|
|
|
@@ -123,7 +108,7 @@ Scifcode writes to:
|
|
|
123
108
|
If this file contains invalid JSON, fix it or move it aside and rerun:
|
|
124
109
|
|
|
125
110
|
```bash
|
|
126
|
-
scifcode
|
|
111
|
+
scifcode
|
|
127
112
|
```
|
|
128
113
|
|
|
129
114
|
### Modal A100 endpoint
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@numairbaseer/scifcode",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Scifcode: a coding CLI agent powered by Poolside Laguna.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"prepack": "npm test && npm run lint"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@numairbaseer/scifcode-runtime": "0.1.
|
|
31
|
+
"@numairbaseer/scifcode-runtime": "0.1.5"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=22.19.0"
|
package/src/cli.js
CHANGED
|
@@ -3,14 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { ensureScifcodeConfig } from "./ensure-scifcode-config.js";
|
|
5
5
|
import { loadScifcodeEnv } from "./env-config.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
API_KEY_ENV_NAME,
|
|
9
|
-
DEFAULT_BASE_URL,
|
|
10
|
-
DEFAULT_MODEL,
|
|
11
|
-
DEFAULT_PROVIDER_NAME,
|
|
12
|
-
LEGACY_API_KEY_ENV_NAME
|
|
13
|
-
} from "./constants.js";
|
|
6
|
+
import { runRuntime } from "./run-runtime.js";
|
|
14
7
|
|
|
15
8
|
export function printHelp(stdout = console.log) {
|
|
16
9
|
stdout(`Scifcode - coding CLI agent powered by Poolside Laguna
|
|
@@ -18,8 +11,6 @@ export function printHelp(stdout = console.log) {
|
|
|
18
11
|
Usage:
|
|
19
12
|
scifcode Start interactive coding agent
|
|
20
13
|
scifcode -p "prompt" Run one-shot prompt
|
|
21
|
-
scifcode init Initialize local Scifcode runtime config
|
|
22
|
-
scifcode doctor Check installation and configuration
|
|
23
14
|
|
|
24
15
|
Required environment:
|
|
25
16
|
SCIFCODE_API_KEY API key or bearer token for the configured endpoint
|
|
@@ -54,24 +45,6 @@ function createConsoleWriters(stdout, stderr) {
|
|
|
54
45
|
};
|
|
55
46
|
}
|
|
56
47
|
|
|
57
|
-
function printInitResult(result, log) {
|
|
58
|
-
log("Scifcode config initialized.");
|
|
59
|
-
log(`Scifcode config path: ${result.configPath}`);
|
|
60
|
-
log(`Provider: ${result.providerName}`);
|
|
61
|
-
log(`Base URL: ${result.baseUrl}`);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function printDoctorHeader(configResult, hasApiKey, runtimeResolved, env, log) {
|
|
65
|
-
log("Scifcode doctor");
|
|
66
|
-
log(`${API_KEY_ENV_NAME} configured: ${hasApiKey ? "yes" : "no"}`);
|
|
67
|
-
log(`Base URL: ${configResult.baseUrl}`);
|
|
68
|
-
log(`Scifcode runtime resolved: ${runtimeResolved ? "yes" : "no"}`);
|
|
69
|
-
log(`Scifcode config path: ${configResult.configPath}`);
|
|
70
|
-
log(`Scifcode provider configured: yes`);
|
|
71
|
-
log(`Provider: ${configResult.providerName}`);
|
|
72
|
-
log(`Default model: ${DEFAULT_MODEL}`);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
48
|
export function main(options = {}) {
|
|
76
49
|
const args = options.args || process.argv.slice(2);
|
|
77
50
|
const command = args[0];
|
|
@@ -87,7 +60,6 @@ export function main(options = {}) {
|
|
|
87
60
|
const exit = options.exit || process.exit;
|
|
88
61
|
const ensureScifcodeConfigFn =
|
|
89
62
|
options.ensureScifcodeConfigFn || ensureScifcodeConfig;
|
|
90
|
-
const resolveRuntimeBinFn = options.resolveRuntimeBinFn || resolveRuntimeBin;
|
|
91
63
|
const runRuntimeFn = options.runRuntimeFn || runRuntime;
|
|
92
64
|
const writers = createConsoleWriters(
|
|
93
65
|
options.stdout || console.log,
|
|
@@ -106,64 +78,6 @@ export function main(options = {}) {
|
|
|
106
78
|
return;
|
|
107
79
|
}
|
|
108
80
|
|
|
109
|
-
if (command === "init") {
|
|
110
|
-
try {
|
|
111
|
-
const result = ensureScifcodeConfigFn({ env });
|
|
112
|
-
printInitResult(result, writers.log);
|
|
113
|
-
exit(0);
|
|
114
|
-
} catch (error) {
|
|
115
|
-
writers.error(error.message);
|
|
116
|
-
exit(1);
|
|
117
|
-
}
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (command === "doctor") {
|
|
122
|
-
let configResult;
|
|
123
|
-
let runtimeResolved = false;
|
|
124
|
-
let runtimeError = null;
|
|
125
|
-
|
|
126
|
-
try {
|
|
127
|
-
configResult = ensureScifcodeConfigFn({ env });
|
|
128
|
-
} catch (error) {
|
|
129
|
-
writers.error("Scifcode doctor");
|
|
130
|
-
writers.error("Scifcode config: error");
|
|
131
|
-
writers.error(error.message);
|
|
132
|
-
exit(1);
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
try {
|
|
137
|
-
resolveRuntimeBinFn({ env });
|
|
138
|
-
runtimeResolved = true;
|
|
139
|
-
} catch (error) {
|
|
140
|
-
runtimeError = error;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const hasApiKey = Boolean(env[API_KEY_ENV_NAME] || env[LEGACY_API_KEY_ENV_NAME]);
|
|
144
|
-
printDoctorHeader(configResult, hasApiKey, runtimeResolved, env, writers.log);
|
|
145
|
-
|
|
146
|
-
if (!runtimeResolved) {
|
|
147
|
-
writers.log("Status: Scifcode runtime resolution failed");
|
|
148
|
-
writers.error(runtimeError.message);
|
|
149
|
-
exit(1);
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (!hasApiKey) {
|
|
154
|
-
writers.log(`Status: missing ${API_KEY_ENV_NAME}`);
|
|
155
|
-
writers.log("");
|
|
156
|
-
writers.log("Set it with:");
|
|
157
|
-
writers.log(` export ${API_KEY_ENV_NAME}="endpoint_or_modal_bearer_token"`);
|
|
158
|
-
exit(1);
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
writers.log("Status: ok");
|
|
163
|
-
exit(0);
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
81
|
try {
|
|
168
82
|
ensureScifcodeConfigFn({ env });
|
|
169
83
|
} catch (error) {
|