@ai-sdk/harness 1.0.65 → 1.0.67

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/index.d.ts CHANGED
@@ -820,10 +820,10 @@ type HarnessV1PromptTurnOptions = {
820
820
  readonly tools?: ReadonlyArray<HarnessV1ToolSpec>;
821
821
  /**
822
822
  * Free-form instructions for the session. The framework supplies the same
823
- * value on every turn; the adapter is responsible for applying it once, by
824
- * prepending it to the first user message of a fresh (non-resumed) session.
825
- * On a resumed session the adapter must not re-apply it the original first
826
- * message already carried it and lives in the runtime's persisted history.
823
+ * value on every turn. Adapters should append it to the runtime's native
824
+ * system or developer prompt when supported. Otherwise, they should prepend
825
+ * it to the first user message of a fresh session and rely on the runtime's
826
+ * persisted history when resuming.
827
827
  */
828
828
  readonly instructions?: string;
829
829
  /**
@@ -853,6 +853,12 @@ type HarnessV1ContinueTurnOptions = {
853
853
  * may ignore them; an adapter that re-drives the turn (rerun) needs them.
854
854
  */
855
855
  readonly tools?: ReadonlyArray<HarnessV1ToolSpec>;
856
+ /**
857
+ * Free-form session instructions. An adapter that re-drives the runtime may
858
+ * need these to reconstruct its native system or developer prompt. An
859
+ * adapter that attaches to a live turn may ignore them.
860
+ */
861
+ readonly instructions?: string;
856
862
  /**
857
863
  * Signal that aborts the continued turn. The adapter must cancel any
858
864
  * underlying work and resolve `done` (with an error if appropriate).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/harness",
3
- "version": "1.0.65",
3
+ "version": "1.0.67",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -45,8 +45,8 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@ai-sdk/provider": "4.0.7",
48
- "@ai-sdk/provider-utils": "5.0.26",
49
- "ai": "7.0.59"
48
+ "@ai-sdk/provider-utils": "5.0.27",
49
+ "ai": "7.0.61"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "ws": "^8.21.0",
@@ -65,7 +65,7 @@
65
65
  "typescript": "5.8.3",
66
66
  "ws": "^8.21.0",
67
67
  "zod": "3.25.76",
68
- "@ai-sdk/otel": "1.0.59",
68
+ "@ai-sdk/otel": "1.0.61",
69
69
  "@vercel/ai-tsconfig": "0.0.0"
70
70
  },
71
71
  "engines": {
@@ -132,9 +132,9 @@ export type HarnessAgentSettings<
132
132
  readonly skills?: ReadonlyArray<HarnessAgentSkill>;
133
133
 
134
134
  /**
135
- * Instructions for the underlying agent runtime. Adapters prepend this to
136
- * the first user message of a fresh session, once — it is not re-applied on
137
- * later turns or when resuming a previously ended session.
135
+ * Instructions for the underlying agent runtime. Adapters append this to a
136
+ * native system or developer prompt when supported. Otherwise, they prepend
137
+ * it to the first user message of a fresh session.
138
138
  */
139
139
  readonly instructions?: string;
140
140
 
@@ -72,7 +72,7 @@ export function runPrompt<
72
72
  /**
73
73
  * Turn entry point. `'prompt'` (default) starts a new turn from `prompt`;
74
74
  * `'continue'` continues the in-flight turn via `doContinueTurn` and ignores
75
- * `prompt`/`instructions`.
75
+ * `prompt`.
76
76
  */
77
77
  mode?: 'prompt' | 'continue';
78
78
  /** Required for `mode: 'prompt'`; absent for `mode: 'continue'`. */
@@ -173,6 +173,7 @@ export function runPrompt<
173
173
  ? emit =>
174
174
  input.session.doContinueTurn({
175
175
  tools: input.toolSpecs,
176
+ instructions: input.instructions,
176
177
  abortSignal: input.abortSignal,
177
178
  emit,
178
179
  })
@@ -112,10 +112,10 @@ export type HarnessV1PromptTurnOptions = {
112
112
 
113
113
  /**
114
114
  * Free-form instructions for the session. The framework supplies the same
115
- * value on every turn; the adapter is responsible for applying it once, by
116
- * prepending it to the first user message of a fresh (non-resumed) session.
117
- * On a resumed session the adapter must not re-apply it the original first
118
- * message already carried it and lives in the runtime's persisted history.
115
+ * value on every turn. Adapters should append it to the runtime's native
116
+ * system or developer prompt when supported. Otherwise, they should prepend
117
+ * it to the first user message of a fresh session and rely on the runtime's
118
+ * persisted history when resuming.
119
119
  */
120
120
  readonly instructions?: string;
121
121
 
@@ -149,6 +149,13 @@ export type HarnessV1ContinueTurnOptions = {
149
149
  */
150
150
  readonly tools?: ReadonlyArray<HarnessV1ToolSpec>;
151
151
 
152
+ /**
153
+ * Free-form session instructions. An adapter that re-drives the runtime may
154
+ * need these to reconstruct its native system or developer prompt. An
155
+ * adapter that attaches to a live turn may ignore them.
156
+ */
157
+ readonly instructions?: string;
158
+
152
159
  /**
153
160
  * Signal that aborts the continued turn. The adapter must cancel any
154
161
  * underlying work and resolve `done` (with an error if appropriate).