@ai-sdk/harness 1.0.65 → 1.0.66

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @ai-sdk/harness
2
2
 
3
+ ## 1.0.66
4
+
5
+ ### Patch Changes
6
+
7
+ - 9ee30bf: fix(harness): pass instructions appended to system / developer prompt instead of using the workaround of first user prompt
8
+ - Updated dependencies [79c52ef]
9
+ - ai@7.0.60
10
+
3
11
  ## 1.0.65
4
12
 
5
13
  ### Patch Changes
@@ -694,10 +694,10 @@ type HarnessV1PromptTurnOptions = {
694
694
  readonly tools?: ReadonlyArray<HarnessV1ToolSpec>;
695
695
  /**
696
696
  * Free-form instructions for the session. The framework supplies the same
697
- * value on every turn; the adapter is responsible for applying it once, by
698
- * prepending it to the first user message of a fresh (non-resumed) session.
699
- * On a resumed session the adapter must not re-apply it the original first
700
- * message already carried it and lives in the runtime's persisted history.
697
+ * value on every turn. Adapters should append it to the runtime's native
698
+ * system or developer prompt when supported. Otherwise, they should prepend
699
+ * it to the first user message of a fresh session and rely on the runtime's
700
+ * persisted history when resuming.
701
701
  */
702
702
  readonly instructions?: string;
703
703
  /**
@@ -727,6 +727,12 @@ type HarnessV1ContinueTurnOptions = {
727
727
  * may ignore them; an adapter that re-drives the turn (rerun) needs them.
728
728
  */
729
729
  readonly tools?: ReadonlyArray<HarnessV1ToolSpec>;
730
+ /**
731
+ * Free-form session instructions. An adapter that re-drives the runtime may
732
+ * need these to reconstruct its native system or developer prompt. An
733
+ * adapter that attaches to a live turn may ignore them.
734
+ */
735
+ readonly instructions?: string;
730
736
  /**
731
737
  * Signal that aborts the continued turn. The adapter must cancel any
732
738
  * underlying work and resolve `done` (with an error if appropriate).
@@ -1180,9 +1186,9 @@ type HarnessAgentSettings<THarness extends HarnessAgentAdapter<any> = HarnessAge
1180
1186
  */
1181
1187
  readonly skills?: ReadonlyArray<HarnessAgentSkill>;
1182
1188
  /**
1183
- * Instructions for the underlying agent runtime. Adapters prepend this to
1184
- * the first user message of a fresh session, once — it is not re-applied on
1185
- * later turns or when resuming a previously ended session.
1189
+ * Instructions for the underlying agent runtime. Adapters append this to a
1190
+ * native system or developer prompt when supported. Otherwise, they prepend
1191
+ * it to the first user message of a fresh session.
1186
1192
  */
1187
1193
  readonly instructions?: string;
1188
1194
  /**
@@ -1414,6 +1414,7 @@ function runPrompt(input) {
1414
1414
  bridge = await toHarnessStream({
1415
1415
  invoke: input.mode === "continue" ? (emit) => input.session.doContinueTurn({
1416
1416
  tools: input.toolSpecs,
1417
+ instructions: input.instructions,
1417
1418
  abortSignal: input.abortSignal,
1418
1419
  emit
1419
1420
  }) : (emit) => {