shiroai 2.0.1 → 2.0.3
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/cli.js +11 -10
- package/package.json +4 -10
package/cli.js
CHANGED
|
@@ -16,8 +16,8 @@ const c = {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
// ===== CONFIG =====
|
|
19
|
-
const
|
|
20
|
-
const MODEL =
|
|
19
|
+
const API_URL = 'https://uohbyzcjmidfmjo6rzsmk3ev.agents.do-ai.run/api/v1/chat/completions';
|
|
20
|
+
const MODEL = null; // Agent handles model selection
|
|
21
21
|
const CWD = process.cwd();
|
|
22
22
|
const CONFIG_DIR = path.join(os.homedir(), '.shiroai');
|
|
23
23
|
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
@@ -259,17 +259,18 @@ function getProjectContext() {
|
|
|
259
259
|
|
|
260
260
|
initMessages();
|
|
261
261
|
|
|
262
|
-
// ===== STREAMING API
|
|
262
|
+
// ===== STREAMING API =====
|
|
263
263
|
function streamChat(msgs, tools) {
|
|
264
264
|
return new Promise((resolve, reject) => {
|
|
265
|
-
const
|
|
266
|
-
model: MODEL,
|
|
265
|
+
const payload = {
|
|
267
266
|
messages: msgs,
|
|
268
|
-
tools: tools,
|
|
269
267
|
stream: true,
|
|
270
268
|
max_tokens: 8192
|
|
271
|
-
}
|
|
272
|
-
|
|
269
|
+
};
|
|
270
|
+
if (MODEL) payload.model = MODEL;
|
|
271
|
+
if (tools && tools.length) payload.tools = tools;
|
|
272
|
+
const body = JSON.stringify(payload);
|
|
273
|
+
const url = new URL(API_URL);
|
|
273
274
|
const client = url.protocol === 'https:' ? https : http;
|
|
274
275
|
|
|
275
276
|
const req = client.request({
|
|
@@ -279,7 +280,7 @@ function streamChat(msgs, tools) {
|
|
|
279
280
|
method: 'POST',
|
|
280
281
|
headers: {
|
|
281
282
|
'Content-Type': 'application/json',
|
|
282
|
-
'
|
|
283
|
+
'Authorization': 'Bearer 3XQVeI0ISBvcRzkh7a5CQL6tfNq3owAw',
|
|
283
284
|
'Content-Length': Buffer.byteLength(body)
|
|
284
285
|
}
|
|
285
286
|
}, res => {
|
|
@@ -478,7 +479,7 @@ function showContext() {
|
|
|
478
479
|
function header() {
|
|
479
480
|
console.log(`\n${c.bold}${c.green} ✦ ShiroAI${c.r} ${c.dim}v2.0.0${c.r}`);
|
|
480
481
|
console.log(`${c.dim} ${CWD}${c.r}`);
|
|
481
|
-
console.log(`${c.dim} Agent: ${currentAgent.name} | Model: ${
|
|
482
|
+
console.log(`${c.dim} Agent: ${currentAgent.name} | Model: auto${c.r}`);
|
|
482
483
|
console.log(`${c.dim} /help for commands${c.r}\n`);
|
|
483
484
|
}
|
|
484
485
|
|
package/package.json
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shiroai",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "AI coding agent for your terminal — reads, writes, edits files, runs commands",
|
|
5
|
-
"bin": {
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
"files": [
|
|
9
|
-
"cli.js"
|
|
10
|
-
],
|
|
5
|
+
"bin": { "shiroai": "./cli.js" },
|
|
6
|
+
"files": ["cli.js"],
|
|
11
7
|
"keywords": ["ai", "cli", "coding", "agent", "terminal", "copilot", "developer-tools", "shiroai"],
|
|
12
8
|
"author": "ShiroAI",
|
|
13
9
|
"license": "MIT",
|
|
14
10
|
"homepage": "https://shiroai.dev",
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=16.0.0"
|
|
17
|
-
}
|
|
11
|
+
"engines": { "node": ">=16.0.0" }
|
|
18
12
|
}
|