@bluecopa/harness 0.1.0-snapshot.55 → 0.1.0-snapshot.57

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.55",
3
+ "version": "0.1.0-snapshot.57",
4
4
  "description": "Provider-agnostic TypeScript agent framework",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {
@@ -91,6 +91,7 @@ const PROCESS_SYSTEM_PROMPT = [
91
91
  'You are a focused execution thread within a larger agent system.',
92
92
  'Complete the assigned task using the available tools.',
93
93
  'Be efficient — accomplish the objective with minimal steps.',
94
+ 'If your context includes the user\'s original message or attachment metadata, use that information directly.',
94
95
  'When done, provide a brief summary of what you accomplished.',
95
96
  ].join(' ');
96
97
 
@@ -642,6 +643,8 @@ export interface CreateProcessConfig {
642
643
  outputSchema?: import('zod').ZodObject<any>;
643
644
  /** Few-shot demo messages prepended before context episodes. */
644
645
  demoMessages?: AgentMessage[];
646
+ /** Seed context messages injected into every process (user message, attachments, etc.). */
647
+ processSeedContext?: string | AgentMessage[];
645
648
 
646
649
  /** Tool choice for process LLM calls. Default: 'auto'. */
647
650
  toolChoice?: ToolChoiceConfig;
@@ -713,6 +716,7 @@ export function createProcess(
713
716
  const seed = [
714
717
  ...(config.demoMessages ?? []),
715
718
  ...(await seedPromise),
719
+ ...normalizeSeedContext(config.processSeedContext),
716
720
  ];
717
721
 
718
722
  // Build system prompt: base + optional skill instructions
@@ -963,6 +967,14 @@ async function buildSeedMessages(
963
967
  return messages;
964
968
  }
965
969
 
970
+ function normalizeSeedContext(ctx: string | AgentMessage[] | undefined): AgentMessage[] {
971
+ if (!ctx) return [];
972
+ if (typeof ctx === 'string') {
973
+ return [{ role: 'system', content: ctx }];
974
+ }
975
+ return ctx;
976
+ }
977
+
966
978
  function timeoutPromise(ms: number): Promise<never> {
967
979
  return new Promise((_, reject) =>
968
980
  setTimeout(() => reject(new Error(`Process timed out after ${ms}ms`)), ms)
@@ -82,9 +82,9 @@ Dispatch at most 3 threads per turn. If more are needed, dispatch the first batc
82
82
 
83
83
  ## Context passing
84
84
 
85
- Use contextEpisodeIds to pass completed episode context to dependent threads:
86
- - Phase 1: research/read threads (parallel) → get episodeIds
87
- - Phase 2: implementation thread with contextEpisodeIds from Phase 1
85
+ Threads automatically receive the user's current message and any attachment metadata as seed context. You do NOT need to copy-paste URLs, file contents, or pasted data into the action text — threads can read this directly from their context.
86
+
87
+ Use contextEpisodeIds to chain dependent threads: research threads first (parallel), then implementation threads with their episodeIds.
88
88
 
89
89
  ## Completion
90
90
 
@@ -637,6 +637,7 @@ export class ArcLoop {
637
637
  maxToolResultLength: this.config.maxToolResultLength,
638
638
  contextFacts: this.config.contextFacts,
639
639
  maxContextTokens: this.config.maxContextTokens,
640
+ processSeedContext: this.config.processSeedContext,
640
641
  skillPromptPromise,
641
642
  skillRefPromise,
642
643
  parentSignal,
@@ -89,6 +89,7 @@ export function buildOrchestratorPrompt(
89
89
  'Dispatch at most 3 threads per turn. If more are needed, batch them.',
90
90
  '',
91
91
  '## Context passing',
92
+ 'Threads automatically receive the user\'s current message and attachments as seed context. Focus action text on WHAT to produce — threads already know what the user asked and what files are available.',
92
93
  'Use contextEpisodeIds to chain dependent threads: research threads first (parallel), then implementation threads with their episodeIds.',
93
94
  ];
94
95
 
package/src/arc/types.ts CHANGED
@@ -104,6 +104,13 @@ export interface ArcLoopConfig {
104
104
  contextFacts?: string[];
105
105
  /** Max context tokens for worker threads. When set, stubs old tool results to keep within budget. */
106
106
  maxContextTokens?: number;
107
+ /**
108
+ * Seed context injected into every process as a system message.
109
+ * Use this to pass the user's original request, attachment metadata,
110
+ * or other context that threads need but the orchestrator may not include
111
+ * in the Thread action text.
112
+ */
113
+ processSeedContext?: string | import('../agent/types').AgentMessage[];
107
114
 
108
115
  // Processes
109
116
  /** Per-process timeout in ms (default: 120_000) */