@bluecopa/harness 0.1.0-snapshot.35 → 0.1.0-snapshot.36

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": "@bluecopa/harness",
3
- "version": "0.1.0-snapshot.35",
3
+ "version": "0.1.0-snapshot.36",
4
4
  "description": "Provider-agnostic TypeScript agent framework",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {
@@ -286,12 +286,12 @@ export class AgentRunner {
286
286
  model: anthropic(config.model),
287
287
  schema: config.outputSchema,
288
288
  messages: toModelMessages(messages),
289
- system: [{ role: 'system' as const, content: config.systemPrompt }],
289
+ system: config.systemPrompt,
290
290
  abortSignal: config.signal,
291
291
  });
292
292
  return { messages, output: text, steps: step + 1, structuredOutput: structured.object };
293
- } catch {
294
- // Structured extraction failed fall back to text output
293
+ } catch (err) {
294
+ console.warn('[agent-runner] generateObject failed, falling back to text:', err instanceof Error ? err.message : err);
295
295
  }
296
296
  }
297
297
 
@@ -132,7 +132,7 @@ export function buildProcessProfile(
132
132
  if (decl.demos && decl.demos.length > 0) {
133
133
  profile.demoMessages = decl.demos.flatMap(demo => [
134
134
  { role: 'user' as const, content: Object.entries(demo.input).map(([k, v]) => `${k}: ${v}`).join('\n') },
135
- { role: 'assistant' as const, content: JSON.stringify(demo.output) },
135
+ { role: 'assistant' as const, content: JSON.stringify(demo.output, null, 2) },
136
136
  ]);
137
137
  }
138
138
  return profile;
package/src/arc/sig.ts CHANGED
@@ -69,12 +69,7 @@ function parseField(raw: string): SignatureField {
69
69
  export function parseSignature(sig: string): ParsedSignature {
70
70
  const arrowIdx = sig.indexOf('->');
71
71
  if (arrowIdx < 0) {
72
- // No arrow treat entire string as a single input, single output
73
- const parts = sig.split(',').map(s => s.trim()).filter(Boolean);
74
- return {
75
- inputs: parts.length > 0 ? [parseField(parts[0]!)] : [],
76
- outputs: parts.length > 1 ? [parseField(parts[1]!)] : [{ name: 'result', type: 'string', isArray: false, isOptional: false }],
77
- };
72
+ throw new Error(`Invalid signature: missing "->". Got: "${sig}"`);
78
73
  }
79
74
 
80
75
  const inputStr = sig.slice(0, arrowIdx).trim();
@@ -116,5 +111,5 @@ export function signatureToSchema(sig: ParsedSignature): z.ZodObject<Record<stri
116
111
  * Untyped signatures like 'query -> findings' are treated as cosmetic labels.
117
112
  */
118
113
  export function isTypedSignature(sig: string): boolean {
119
- return sig.includes(':');
114
+ return /\b\w+:\w+/.test(sig);
120
115
  }