osai-agent 4.2.14 → 4.2.16
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 +1 -1
- package/src/agent/prompt.js +5 -1
- package/src/commands/config.js +2 -1
- package/src/commands/login.js +2 -2
- package/src/commands/register.js +2 -2
- package/src/services/server-url.js +5 -0
- package/src/ui/App.js +1 -2
- package/src/ui/animation.js +2 -2
package/package.json
CHANGED
package/src/agent/prompt.js
CHANGED
|
@@ -232,7 +232,11 @@ AFTER [TOOL_RESULT]: analyze the output, then emit [DONE], [INCOMPLETE], or [BLO
|
|
|
232
232
|
|
|
233
233
|
[DONE] — Task complete. 1-3 sentence summary.
|
|
234
234
|
[INCOMPLETE] — Need another step. Describe it, ask permission, STOP.
|
|
235
|
-
[BLOCKED] — Cannot proceed. Explain why
|
|
235
|
+
[BLOCKED] — Cannot proceed. Explain why.
|
|
236
|
+
|
|
237
|
+
**CRITICAL**: You MUST end EVERY response with [DONE], [INCOMPLETE], or [BLOCKED].
|
|
238
|
+
This includes greetings, simple answers, and any text-only response.
|
|
239
|
+
Never stop mid-response without a completion signal.`;
|
|
236
240
|
|
|
237
241
|
if (customInstructions) {
|
|
238
242
|
return `${basePrompt}\n\n## CUSTOM INSTRUCTIONS\n\n${customInstructions}`;
|
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;
|