opc-agent 4.0.12 → 4.0.14
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/dist/cli.js +14 -2
- package/dist/providers/index.js +2 -2
- package/package.json +1 -1
- package/src/cli.ts +14 -2
- package/src/providers/index.ts +2 -2
package/dist/cli.js
CHANGED
|
@@ -842,9 +842,21 @@ program
|
|
|
842
842
|
await runtime.initialize();
|
|
843
843
|
await runtime.start();
|
|
844
844
|
const agent = runtime.getAgent();
|
|
845
|
+
// Auto-start Studio on port 4000
|
|
846
|
+
let studioUrl = '';
|
|
847
|
+
try {
|
|
848
|
+
const { StudioServer } = require('./studio/server');
|
|
849
|
+
const studioPort = parseInt(opts.port || '3000') === 4000 ? 4001 : 4000;
|
|
850
|
+
const studio = new StudioServer({ port: studioPort, agentDir: process.cwd() });
|
|
851
|
+
await studio.start();
|
|
852
|
+
studioUrl = `http://localhost:${studioPort}`;
|
|
853
|
+
}
|
|
854
|
+
catch { }
|
|
845
855
|
console.log(`\n${icon.rocket} Agent "${color.bold(agent?.name ?? 'unknown')}" is running.`);
|
|
846
|
-
console.log(` ${color.dim('
|
|
847
|
-
|
|
856
|
+
console.log(` ${color.dim('Chat:')} http://localhost:3000`);
|
|
857
|
+
if (studioUrl)
|
|
858
|
+
console.log(` ${color.dim('Studio:')} ${studioUrl}`);
|
|
859
|
+
console.log(` ${color.dim('API:')} POST http://localhost:3000/api/chat`);
|
|
848
860
|
console.log(`\n ${color.dim('Press Ctrl+C to stop.')}\n`);
|
|
849
861
|
});
|
|
850
862
|
// ── Serve command (OpenAI-compatible API) ────────────────────
|
package/dist/providers/index.js
CHANGED
|
@@ -342,7 +342,7 @@ class ClaudeCLIProvider {
|
|
|
342
342
|
if (options?.tools && options.tools.length > 0) {
|
|
343
343
|
prompt += buildToolPrompt(options.tools);
|
|
344
344
|
}
|
|
345
|
-
const args = ['-p'];
|
|
345
|
+
const args = ['-p', '--no-project-context'];
|
|
346
346
|
// Write system prompt to temp file to avoid shell escaping issues
|
|
347
347
|
let tmpFile;
|
|
348
348
|
if (systemPrompt) {
|
|
@@ -406,7 +406,7 @@ class ClaudeCLIProvider {
|
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
async *chatStream(messages, systemPrompt) {
|
|
409
|
-
const args = ['-p', '--output-format', 'stream-json', '--include-partial-messages'];
|
|
409
|
+
const args = ['-p', '--no-project-context', '--output-format', 'stream-json', '--include-partial-messages'];
|
|
410
410
|
if (this.model) {
|
|
411
411
|
args.push('--model', this.model);
|
|
412
412
|
}
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -939,9 +939,21 @@ program
|
|
|
939
939
|
await runtime.initialize();
|
|
940
940
|
await runtime.start();
|
|
941
941
|
const agent = runtime.getAgent();
|
|
942
|
+
|
|
943
|
+
// Auto-start Studio on port 4000
|
|
944
|
+
let studioUrl = '';
|
|
945
|
+
try {
|
|
946
|
+
const { StudioServer } = require('./studio/server');
|
|
947
|
+
const studioPort = parseInt(opts.port || '3000') === 4000 ? 4001 : 4000;
|
|
948
|
+
const studio = new StudioServer({ port: studioPort, agentDir: process.cwd() });
|
|
949
|
+
await studio.start();
|
|
950
|
+
studioUrl = `http://localhost:${studioPort}`;
|
|
951
|
+
} catch {}
|
|
952
|
+
|
|
942
953
|
console.log(`\n${icon.rocket} Agent "${color.bold(agent?.name ?? 'unknown')}" is running.`);
|
|
943
|
-
console.log(` ${color.dim('
|
|
944
|
-
console.log(` ${color.dim('
|
|
954
|
+
console.log(` ${color.dim('Chat:')} http://localhost:3000`);
|
|
955
|
+
if (studioUrl) console.log(` ${color.dim('Studio:')} ${studioUrl}`);
|
|
956
|
+
console.log(` ${color.dim('API:')} POST http://localhost:3000/api/chat`);
|
|
945
957
|
console.log(`\n ${color.dim('Press Ctrl+C to stop.')}\n`);
|
|
946
958
|
});
|
|
947
959
|
|
package/src/providers/index.ts
CHANGED
|
@@ -349,7 +349,7 @@ class ClaudeCLIProvider implements LLMProvider {
|
|
|
349
349
|
prompt += buildToolPrompt(options.tools);
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
const args = ['-p'];
|
|
352
|
+
const args = ['-p', '--no-project-context'];
|
|
353
353
|
// Write system prompt to temp file to avoid shell escaping issues
|
|
354
354
|
let tmpFile: string | undefined;
|
|
355
355
|
if (systemPrompt) {
|
|
@@ -410,7 +410,7 @@ class ClaudeCLIProvider implements LLMProvider {
|
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
async *chatStream(messages: Message[], systemPrompt?: string): AsyncIterable<string> {
|
|
413
|
-
const args = ['-p', '--output-format', 'stream-json', '--include-partial-messages'];
|
|
413
|
+
const args = ['-p', '--no-project-context', '--output-format', 'stream-json', '--include-partial-messages'];
|
|
414
414
|
if (this.model) {
|
|
415
415
|
args.push('--model', this.model);
|
|
416
416
|
}
|