@ottocode/server 0.1.268 → 0.1.269
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": "@ottocode/server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.269",
|
|
4
4
|
"description": "HTTP API server for ottocode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"typecheck": "tsc --noEmit"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@ottocode/database": "0.1.
|
|
65
|
-
"@ottocode/sdk": "0.1.
|
|
64
|
+
"@ottocode/database": "0.1.269",
|
|
65
|
+
"@ottocode/sdk": "0.1.269",
|
|
66
66
|
"@hono/zod-openapi": "^1.1.5",
|
|
67
67
|
"ai-sdk-ollama": "^3.8.3",
|
|
68
68
|
"drizzle-orm": "^0.44.5",
|
|
@@ -24,17 +24,21 @@ export async function createTerminal(
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
let resolvedCommand = command;
|
|
27
|
+
let resolvedArgs = args || [];
|
|
27
28
|
if (command === 'bash' || command === 'sh' || command === 'shell') {
|
|
28
29
|
resolvedCommand =
|
|
29
30
|
process.platform === 'win32'
|
|
30
31
|
? process.env.COMSPEC || 'cmd.exe'
|
|
31
32
|
: process.env.SHELL || '/bin/bash';
|
|
33
|
+
if (resolvedArgs.length === 0 && process.platform !== 'win32') {
|
|
34
|
+
resolvedArgs = process.platform === 'darwin' ? ['-il'] : ['-i'];
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
const resolvedCwd = cwd || process.cwd();
|
|
34
38
|
|
|
35
39
|
const terminal = terminalManager.create({
|
|
36
40
|
command: resolvedCommand,
|
|
37
|
-
args:
|
|
41
|
+
args: resolvedArgs,
|
|
38
42
|
purpose,
|
|
39
43
|
cwd: resolvedCwd,
|
|
40
44
|
createdBy: 'user',
|
|
@@ -15,7 +15,7 @@ export function appendRunnerReminderMessages(args: {
|
|
|
15
15
|
messages.push(
|
|
16
16
|
isOpenAIOAuth
|
|
17
17
|
? {
|
|
18
|
-
role: '
|
|
18
|
+
role: 'user',
|
|
19
19
|
content:
|
|
20
20
|
'[system-reminder] Continuing an existing session. Execute directly, use tools as needed, and call `finish` at the end. For simple questions, your answer IS the response — do not add a "Summary:" recap.',
|
|
21
21
|
}
|
|
@@ -32,7 +32,7 @@ export function appendRunnerReminderMessages(args: {
|
|
|
32
32
|
messages.push(
|
|
33
33
|
isOpenAIOAuth
|
|
34
34
|
? {
|
|
35
|
-
role: '
|
|
35
|
+
role: 'user',
|
|
36
36
|
content:
|
|
37
37
|
'[system-reminder] Your previous response stopped mid-task. Resume from where you left off and complete the actual work — not a plan-only update.',
|
|
38
38
|
}
|
|
@@ -183,3 +183,13 @@ export function appendRunnerPromptMessages(args: {
|
|
|
183
183
|
additionalSystemMessages.push(...opts.additionalPromptMessages);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
+
|
|
187
|
+
export function moveSystemMessagesToUserForOpenAIOAuth(
|
|
188
|
+
messages: Array<{ role: 'system' | 'user'; content: string }>,
|
|
189
|
+
): void {
|
|
190
|
+
for (const message of messages) {
|
|
191
|
+
if (message.role !== 'system') continue;
|
|
192
|
+
message.role = 'user';
|
|
193
|
+
message.content = `<system-message>${message.content}</system-message>`;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
@@ -14,6 +14,7 @@ import { resolveAgentConfig } from './registry.ts';
|
|
|
14
14
|
import {
|
|
15
15
|
appendRunnerPromptMessages,
|
|
16
16
|
buildRunnerPrompt,
|
|
17
|
+
moveSystemMessagesToUserForOpenAIOAuth,
|
|
17
18
|
} from './runner-setup-prompt.ts';
|
|
18
19
|
import {
|
|
19
20
|
buildAllowedTools,
|
|
@@ -134,6 +135,9 @@ export async function setupRunner(opts: RunOpts): Promise<SetupResult> {
|
|
|
134
135
|
opts,
|
|
135
136
|
additionalSystemMessages: prompt.additionalSystemMessages,
|
|
136
137
|
});
|
|
138
|
+
if (prompt.isOpenAIOAuth) {
|
|
139
|
+
moveSystemMessagesToUserForOpenAIOAuth(prompt.additionalSystemMessages);
|
|
140
|
+
}
|
|
137
141
|
|
|
138
142
|
const gated = buildAllowedTools({
|
|
139
143
|
agentName: agentCfg.name,
|