@ottocode/server 0.1.190 → 0.1.192
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.192",
|
|
4
4
|
"description": "HTTP API server for ottocode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"typecheck": "tsc --noEmit"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@ottocode/sdk": "0.1.
|
|
33
|
-
"@ottocode/database": "0.1.
|
|
32
|
+
"@ottocode/sdk": "0.1.192",
|
|
33
|
+
"@ottocode/database": "0.1.192",
|
|
34
34
|
"drizzle-orm": "^0.44.5",
|
|
35
35
|
"hono": "^4.9.9",
|
|
36
36
|
"zod": "^4.1.8"
|
|
@@ -12,6 +12,7 @@ export function registerDefaultsRoute(app: Hono) {
|
|
|
12
12
|
provider?: string;
|
|
13
13
|
model?: string;
|
|
14
14
|
toolApproval?: 'auto' | 'dangerous' | 'all';
|
|
15
|
+
guidedMode?: boolean;
|
|
15
16
|
scope?: 'global' | 'local';
|
|
16
17
|
}>();
|
|
17
18
|
|
|
@@ -21,12 +22,14 @@ export function registerDefaultsRoute(app: Hono) {
|
|
|
21
22
|
provider: string;
|
|
22
23
|
model: string;
|
|
23
24
|
toolApproval: 'auto' | 'dangerous' | 'all';
|
|
25
|
+
guidedMode: boolean;
|
|
24
26
|
}> = {};
|
|
25
27
|
|
|
26
28
|
if (body.agent) updates.agent = body.agent;
|
|
27
29
|
if (body.provider) updates.provider = body.provider;
|
|
28
30
|
if (body.model) updates.model = body.model;
|
|
29
31
|
if (body.toolApproval) updates.toolApproval = body.toolApproval;
|
|
32
|
+
if (body.guidedMode !== undefined) updates.guidedMode = body.guidedMode;
|
|
30
33
|
|
|
31
34
|
await setConfig(scope, updates, projectRoot);
|
|
32
35
|
|
|
@@ -105,6 +105,7 @@ export async function setupRunner(opts: RunOpts): Promise<SetupResult> {
|
|
|
105
105
|
projectRoot: cfg.projectRoot,
|
|
106
106
|
agentPrompt,
|
|
107
107
|
oneShot: opts.oneShot,
|
|
108
|
+
guidedMode: cfg.defaults.guidedMode,
|
|
108
109
|
spoofPrompt: undefined,
|
|
109
110
|
includeProjectTree: isFirstMessage,
|
|
110
111
|
userContext: opts.userContext,
|
|
@@ -121,12 +121,16 @@ export async function getProjectTree(projectRoot: string): Promise<string> {
|
|
|
121
121
|
|
|
122
122
|
export async function findInstructionFiles(
|
|
123
123
|
projectRoot: string,
|
|
124
|
+
options?: { guidedMode?: boolean },
|
|
124
125
|
): Promise<string[]> {
|
|
125
126
|
const { existsSync } = await import('node:fs');
|
|
126
127
|
const { join } = await import('node:path');
|
|
127
128
|
const foundPaths: string[] = [];
|
|
128
129
|
|
|
129
130
|
const localFiles = ['AGENTS.md', 'CLAUDE.md', 'CONTEXT.md'];
|
|
131
|
+
if (options?.guidedMode) {
|
|
132
|
+
localFiles.push('GUIDED.md');
|
|
133
|
+
}
|
|
130
134
|
for (const filename of localFiles) {
|
|
131
135
|
let currentDir = projectRoot;
|
|
132
136
|
for (let i = 0; i < 5; i++) {
|
|
@@ -158,8 +162,9 @@ export async function findInstructionFiles(
|
|
|
158
162
|
|
|
159
163
|
export async function loadInstructionFiles(
|
|
160
164
|
projectRoot: string,
|
|
165
|
+
options?: { guidedMode?: boolean },
|
|
161
166
|
): Promise<string> {
|
|
162
|
-
const paths = await findInstructionFiles(projectRoot);
|
|
167
|
+
const paths = await findInstructionFiles(projectRoot, options);
|
|
163
168
|
if (paths.length === 0) return '';
|
|
164
169
|
|
|
165
170
|
const contents: string[] = [];
|
|
@@ -181,7 +186,7 @@ export async function loadInstructionFiles(
|
|
|
181
186
|
|
|
182
187
|
export async function composeEnvironmentAndInstructions(
|
|
183
188
|
projectRoot: string,
|
|
184
|
-
options?: { includeProjectTree?: boolean },
|
|
189
|
+
options?: { includeProjectTree?: boolean; guidedMode?: boolean },
|
|
185
190
|
): Promise<string> {
|
|
186
191
|
const parts: string[] = [];
|
|
187
192
|
|
|
@@ -195,7 +200,9 @@ export async function composeEnvironmentAndInstructions(
|
|
|
195
200
|
}
|
|
196
201
|
}
|
|
197
202
|
|
|
198
|
-
const customInstructions = await loadInstructionFiles(projectRoot
|
|
203
|
+
const customInstructions = await loadInstructionFiles(projectRoot, {
|
|
204
|
+
guidedMode: options?.guidedMode,
|
|
205
|
+
});
|
|
199
206
|
if (customInstructions) {
|
|
200
207
|
parts.push(customInstructions);
|
|
201
208
|
}
|
|
@@ -8,6 +8,10 @@ import ONESHOT_PROMPT from '@ottocode/sdk/prompts/modes/oneshot.txt' with {
|
|
|
8
8
|
type: 'text',
|
|
9
9
|
};
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
11
|
+
import GUIDED_PROMPT from '@ottocode/sdk/prompts/modes/guided.txt' with {
|
|
12
|
+
type: 'text',
|
|
13
|
+
};
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
11
15
|
import ANTHROPIC_SPOOF_PROMPT from '@ottocode/sdk/prompts/providers/anthropicSpoof.txt' with {
|
|
12
16
|
type: 'text',
|
|
13
17
|
};
|
|
@@ -25,6 +29,7 @@ export async function composeSystemPrompt(options: {
|
|
|
25
29
|
projectRoot: string;
|
|
26
30
|
agentPrompt: string;
|
|
27
31
|
oneShot?: boolean;
|
|
32
|
+
guidedMode?: boolean;
|
|
28
33
|
spoofPrompt?: string;
|
|
29
34
|
includeEnvironment?: boolean;
|
|
30
35
|
includeProjectTree?: boolean;
|
|
@@ -79,10 +84,21 @@ export async function composeSystemPrompt(options: {
|
|
|
79
84
|
components.push('mode:oneshot');
|
|
80
85
|
}
|
|
81
86
|
|
|
87
|
+
if (options.guidedMode) {
|
|
88
|
+
const guidedBlock = (GUIDED_PROMPT || '').trim();
|
|
89
|
+
if (guidedBlock) {
|
|
90
|
+
parts.push(guidedBlock);
|
|
91
|
+
components.push('mode:guided');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
82
95
|
if (options.includeEnvironment !== false) {
|
|
83
96
|
const envAndInstructions = await composeEnvironmentAndInstructions(
|
|
84
97
|
options.projectRoot,
|
|
85
|
-
{
|
|
98
|
+
{
|
|
99
|
+
includeProjectTree: options.includeProjectTree,
|
|
100
|
+
guidedMode: options.guidedMode,
|
|
101
|
+
},
|
|
86
102
|
);
|
|
87
103
|
if (envAndInstructions) {
|
|
88
104
|
parts.push(envAndInstructions);
|