osai-agent 4.2.15 → 4.2.17
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "osai-agent",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OS AI Agent - YOUR AI AGENT",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@cfworker/json-schema": "^4.1.1",
|
|
42
|
-
"@modelcontextprotocol/client": "^2.0.0-alpha.
|
|
42
|
+
"@modelcontextprotocol/client": "^2.0.0-alpha.3",
|
|
43
43
|
"@tavily/core": "^0.7.3",
|
|
44
44
|
"boxen": "^8.0.1",
|
|
45
45
|
"chalk": "^5.3.0",
|
package/src/commands/config.js
CHANGED
|
@@ -3,6 +3,7 @@ import inquirer from 'inquirer';
|
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { printInfo, printSuccess } from '../ui/terminal.js';
|
|
5
5
|
import { APP_VERSION } from '../utils/constants.js';
|
|
6
|
+
import { toDisplayUrl } from '../services/server-url.js';
|
|
6
7
|
|
|
7
8
|
export const detectDefaultOS = () => {
|
|
8
9
|
const p = process.platform;
|
|
@@ -16,7 +17,7 @@ export const showConfig = () => {
|
|
|
16
17
|
const os = config.get('os') || `${detectDefaultOS()} (auto-detected)`;
|
|
17
18
|
printInfo(`Version: ${APP_VERSION}`);
|
|
18
19
|
const serverUrl = config.get('server') || '';
|
|
19
|
-
const displayServer = serverUrl ? serverUrl
|
|
20
|
+
const displayServer = serverUrl ? toDisplayUrl(serverUrl) : 'not configured';
|
|
20
21
|
printInfo(`Server: ${displayServer}`);
|
|
21
22
|
printInfo(`Token: ${config.get('token') ? 'present' : 'absent'}`);
|
|
22
23
|
printInfo(`User ID: ${config.get('userId') || 'absent'}`);
|
package/src/commands/login.js
CHANGED
|
@@ -6,7 +6,7 @@ import inquirer from 'inquirer';
|
|
|
6
6
|
import ora from 'ora';
|
|
7
7
|
import { ExitPromptError } from '@inquirer/core';
|
|
8
8
|
import { printAuthHeader, printError, printSuccess, clearScreen } from '../ui/terminal.js';
|
|
9
|
-
import { DEFAULT_SERVER_URL, toHttpUrl, toWsUrl } from '../services/server-url.js';
|
|
9
|
+
import { DEFAULT_SERVER_URL, toHttpUrl, toWsUrl, toDisplayUrl } from '../services/server-url.js';
|
|
10
10
|
import { run } from './run.js';
|
|
11
11
|
|
|
12
12
|
const attemptLogin = async (email, password, serverInput, config) => {
|
|
@@ -66,7 +66,7 @@ export const login = async ({ server: serverOverride } = {}) => {
|
|
|
66
66
|
|
|
67
67
|
try {
|
|
68
68
|
const { serverInput: retryServer } = await inquirer.prompt([
|
|
69
|
-
{ type: 'input', name: 'serverInput', message: 'Server \u203A', theme: { prefix: prefixTheme }, default: serverInput }
|
|
69
|
+
{ type: 'input', name: 'serverInput', message: 'Server \u203A', theme: { prefix: prefixTheme }, default: toDisplayUrl(serverInput) }
|
|
70
70
|
]);
|
|
71
71
|
const result2 = await attemptLogin(email, password, retryServer, config);
|
|
72
72
|
if (result2 === 'success') await run({});
|
package/src/commands/register.js
CHANGED
|
@@ -4,7 +4,7 @@ import inquirer from 'inquirer';
|
|
|
4
4
|
import ora from 'ora';
|
|
5
5
|
import { ExitPromptError } from '@inquirer/core';
|
|
6
6
|
import { printAuthHeader, printError, clearScreen } from '../ui/terminal.js';
|
|
7
|
-
import { DEFAULT_SERVER_URL, toHttpUrl, toWsUrl } from '../services/server-url.js';
|
|
7
|
+
import { DEFAULT_SERVER_URL, toHttpUrl, toWsUrl, toDisplayUrl } from '../services/server-url.js';
|
|
8
8
|
import { run } from './run.js';
|
|
9
9
|
import pkg from 'node-machine-id';
|
|
10
10
|
const { machineIdSync } = pkg;
|
|
@@ -63,7 +63,7 @@ export const register = async ({ server: serverOverride } = {}) => {
|
|
|
63
63
|
|
|
64
64
|
try {
|
|
65
65
|
const { serverInput: retryServer } = await inquirer.prompt([
|
|
66
|
-
{ type: 'input', name: 'serverInput', message: 'Server \u203A', theme: { prefix: prefixTheme }, default: serverInput }
|
|
66
|
+
{ type: 'input', name: 'serverInput', message: 'Server \u203A', theme: { prefix: prefixTheme }, default: toDisplayUrl(serverInput) }
|
|
67
67
|
]);
|
|
68
68
|
const result2 = await attemptRegister(email, password, retryServer, config);
|
|
69
69
|
if (result2 === 'success') await run({});
|
|
@@ -9,3 +9,8 @@ export const toWsUrl = (serverUrl) => {
|
|
|
9
9
|
if (!serverUrl) return null;
|
|
10
10
|
return serverUrl.replace(/^https:\/\//, 'wss://').replace(/^http:\/\//, 'ws://');
|
|
11
11
|
};
|
|
12
|
+
|
|
13
|
+
export const toDisplayUrl = (serverUrl) => {
|
|
14
|
+
if (!serverUrl) return 'wss://osai-agent-server';
|
|
15
|
+
return serverUrl.replace(/\/\/[^/]+/, '//osai-agent-server');
|
|
16
|
+
};
|
package/src/ui/App.js
CHANGED
|
@@ -75,8 +75,7 @@ const requestedRenderThrottle = Number.parseInt(process.env.OSAI_UI_RENDER_THROT
|
|
|
75
75
|
const UI_RENDER_THROTTLE_MS = Number.isFinite(requestedRenderThrottle)
|
|
76
76
|
? Math.max(100, requestedRenderThrottle)
|
|
77
77
|
: 150;
|
|
78
|
-
|
|
79
|
-
// Ou désactivez les animations : OSAI_UI_ANIMATIONS=0
|
|
78
|
+
|
|
80
79
|
const INTERNAL_UI_MARKER_RE = /\[(DONE|INCOMPLETE|BLOCKED|TOOL_CALL|TOOL_RESULT)\]/gi;
|
|
81
80
|
const INTERNAL_SSE_LINE_RE = /^\s*(data|event|id|retry):\s.*$/gim;
|
|
82
81
|
const INTERNAL_TOOL_JSON_LINE_RE = /^\s*\{(?:\\")?tool(?:\\")?\s*:\s*.*$/gim;
|
package/src/ui/animation.js
CHANGED
|
@@ -7,8 +7,8 @@ const requestedInterval = Number.parseInt(process.env.OSAI_UI_ANIMATION_INTERVAL
|
|
|
7
7
|
const TICK_INTERVAL_MS = Number.isFinite(requestedInterval)
|
|
8
8
|
? Math.max(300, requestedInterval)
|
|
9
9
|
: 400;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
|
|
11
|
+
|
|
12
12
|
|
|
13
13
|
let frame = 0;
|
|
14
14
|
let timer = null;
|