claude-ws 0.4.7 → 0.4.8
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": "claude-ws",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "AI-powered workspace for solo CEOs and indie builders — manage your entire business with AI agents, not just code. Kanban board, code editor, Git integration, claw agent hub, local-first SQLite.",
|
|
6
6
|
"keywords": [
|
|
@@ -20,6 +20,7 @@ export interface AttemptCreationInput {
|
|
|
20
20
|
output_schema?: string;
|
|
21
21
|
timeout?: number;
|
|
22
22
|
model?: string;
|
|
23
|
+
provider?: 'claude-cli' | 'claude-sdk';
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
/** Transport-agnostic result — routes map this to their framework's response */
|
|
@@ -43,6 +44,7 @@ export interface AgentStartParams {
|
|
|
43
44
|
projectPath: string;
|
|
44
45
|
prompt: string;
|
|
45
46
|
model?: string;
|
|
47
|
+
provider?: 'claude-cli' | 'claude-sdk';
|
|
46
48
|
sessionOptions?: Record<string, any>;
|
|
47
49
|
outputFormat?: string;
|
|
48
50
|
outputSchema?: string;
|
|
@@ -77,7 +79,7 @@ export function createAttemptOrchestrator(deps: OrchestratorDeps) {
|
|
|
77
79
|
*/
|
|
78
80
|
async createAndRun(input: AttemptCreationInput): Promise<AttemptResult> {
|
|
79
81
|
try {
|
|
80
|
-
const { request_method = 'queue', output_format, output_schema, timeout = 300000, model } = input;
|
|
82
|
+
const { request_method = 'queue', output_format, output_schema, timeout = 300000, model, provider } = input;
|
|
81
83
|
|
|
82
84
|
// Validate
|
|
83
85
|
this.validate(input);
|
|
@@ -117,6 +119,7 @@ export function createAttemptOrchestrator(deps: OrchestratorDeps) {
|
|
|
117
119
|
projectPath: project.path,
|
|
118
120
|
prompt: finalPrompt,
|
|
119
121
|
model: model || undefined,
|
|
122
|
+
provider: provider || undefined,
|
|
120
123
|
sessionOptions: Object.keys(sessionOptions).length > 0 ? sessionOptions : undefined,
|
|
121
124
|
outputFormat: output_format || undefined,
|
|
122
125
|
outputSchema: output_schema || undefined,
|
package/src/lib/agent-manager.ts
CHANGED
|
@@ -212,17 +212,19 @@ class AgentManager extends EventEmitter {
|
|
|
212
212
|
fullPrompt += buildOutputFormatPrompt(outputFormat, outputSchema, attemptId);
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
+
// Resolve provider first, then model based on provider type
|
|
216
|
+
const provider = requestedProvider ? getProvider(requestedProvider) : getActiveProvider();
|
|
217
|
+
const effectiveModel = provider.id === 'claude-cli'
|
|
218
|
+
? (model?.trim() || FALLBACK_MODEL_ID)
|
|
219
|
+
: (model?.trim() || resolveDefaultModelFromEnv());
|
|
220
|
+
|
|
215
221
|
// Build model identity and project context for system prompt
|
|
216
|
-
const effectiveModel = model?.trim() || resolveDefaultModelFromEnv();
|
|
217
222
|
const modelDisplayName = modelIdToDisplayName(effectiveModel);
|
|
218
223
|
const modelIdentity = modelDisplayName !== effectiveModel
|
|
219
224
|
? `You are powered by the model named ${modelDisplayName}. The exact model ID is ${effectiveModel}.`
|
|
220
225
|
: `You are powered by the model ${effectiveModel}.`;
|
|
221
226
|
const projectContext = `Your current working directory is ${projectPath}. All file operations should use paths relative to or within this directory.`;
|
|
222
227
|
|
|
223
|
-
// Use per-request provider if specified, otherwise fall back to env-based default
|
|
224
|
-
const provider = requestedProvider ? getProvider(requestedProvider) : getActiveProvider();
|
|
225
|
-
|
|
226
228
|
// Wire up provider events for this attempt
|
|
227
229
|
wireProviderEvents(this.buildWiringContext(), provider, attemptId, outputFormat, projectPath);
|
|
228
230
|
|
|
@@ -47,8 +47,10 @@ export function spawnCLIProcess(opts: SpawnCLIOptions): ChildProcess {
|
|
|
47
47
|
|
|
48
48
|
log.info({ claudePath, argsCount: args.length, attemptId }, 'Spawning CLI process');
|
|
49
49
|
|
|
50
|
-
// Strip SDK-specific env vars so CLI uses its own auth, not the custom endpoint
|
|
51
|
-
const { ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL,
|
|
50
|
+
// Strip SDK-specific env vars so CLI uses its own auth and model config, not the custom endpoint
|
|
51
|
+
const { ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL, ANTHROPIC_MODEL,
|
|
52
|
+
ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL,
|
|
53
|
+
...cleanEnv } = process.env;
|
|
52
54
|
|
|
53
55
|
return spawn(claudePath, args, {
|
|
54
56
|
cwd: normalizedProjectPath,
|