@ai-sdk/harness 1.0.132 → 1.0.134
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 +24 -0
- package/dist/agent/index.d.ts +1581 -1432
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +4419 -4997
- package/dist/agent/index.js.map +1 -1
- package/dist/bridge/index.d.ts +141 -139
- package/dist/bridge/index.d.ts.map +1 -0
- package/dist/bridge/index.js +579 -650
- package/dist/bridge/index.js.map +1 -1
- package/dist/index.d.ts +1498 -1355
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +703 -645
- package/dist/index.js.map +1 -1
- package/dist/utils/index.d.ts +551 -521
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +1910 -2457
- package/dist/utils/index.js.map +1 -1
- package/package.json +9 -9
- package/src/agent/harness-agent-session.ts +46 -14
- package/src/agent/internal/run-prompt.ts +93 -62
- package/src/bridge/index.ts +1 -1
- package/src/errors/harness-history-unavailable-error.ts +41 -0
- package/src/index.ts +1 -0
- package/src/utils/credential-forwarding.ts +15 -1
- package/src/utils/index.ts +1 -1
- package/src/v1/harness-v1-message.ts +150 -0
- package/src/v1/harness-v1-session.ts +38 -0
- package/src/v1/index.ts +17 -0
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
HarnessV1TurnSettings,
|
|
12
12
|
} from './harness-v1-lifecycle-state';
|
|
13
13
|
import type { HarnessV1StreamPart } from './harness-v1-stream-part';
|
|
14
|
+
import type { HarnessV1Message } from './harness-v1-message';
|
|
14
15
|
import type { HarnessV1BuiltinToolFiltering } from './harness-v1-tool-filtering';
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -90,6 +91,15 @@ export type HarnessV1StartOptions = {
|
|
|
90
91
|
readonly sessionWorkDir: string;
|
|
91
92
|
};
|
|
92
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Result of `HarnessV1Session.doReadHistory`.
|
|
96
|
+
*/
|
|
97
|
+
export type HarnessV1ReadHistoryResult = {
|
|
98
|
+
readonly messages: ReadonlyArray<HarnessV1Message>;
|
|
99
|
+
/** Opaque position; pass back as `since` to read only what follows. */
|
|
100
|
+
readonly cursor: string;
|
|
101
|
+
};
|
|
102
|
+
|
|
93
103
|
/**
|
|
94
104
|
* Options passed to `HarnessV1Session.doPromptTurn`.
|
|
95
105
|
*/
|
|
@@ -192,6 +202,34 @@ export type HarnessV1Session = {
|
|
|
192
202
|
*/
|
|
193
203
|
doCompact(customInstructions?: string): PromiseLike<void>;
|
|
194
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Read the conversation history the runtime itself persisted, normalized
|
|
207
|
+
* to `HarnessV1Message`.
|
|
208
|
+
*
|
|
209
|
+
* The session's history can grow outside the harness contract: the same
|
|
210
|
+
* runtime conversation may be continued interactively (`claude --resume`),
|
|
211
|
+
* by another process, or before this session attached. Hosts that render a
|
|
212
|
+
* continuous record of the conversation — not just the turns they drove —
|
|
213
|
+
* need to read that history back, and the runtime's own store is the only
|
|
214
|
+
* source that has it. The adapter owns its runtime's persistence format,
|
|
215
|
+
* so the read belongs here rather than in every host.
|
|
216
|
+
*
|
|
217
|
+
* `since` is the `cursor` from a previous read; the result then contains
|
|
218
|
+
* only messages recorded after it. The cursor is adapter-owned and opaque
|
|
219
|
+
* to the host.
|
|
220
|
+
*
|
|
221
|
+
* Optional capability: adapters that cannot read their runtime's store
|
|
222
|
+
* omit the method entirely, and the agent surfaces that as
|
|
223
|
+
* `HarnessCapabilityUnsupportedError`. An adapter that implements it but
|
|
224
|
+
* cannot reach the store from the current environment (e.g. it lives
|
|
225
|
+
* inside a remote sandbox) throws `HarnessHistoryUnavailableError`. A
|
|
226
|
+
* conversation with no recorded messages yet is not an error — it resolves
|
|
227
|
+
* to an empty `messages` array.
|
|
228
|
+
*/
|
|
229
|
+
doReadHistory?(options: {
|
|
230
|
+
readonly since?: string;
|
|
231
|
+
}): PromiseLike<HarnessV1ReadHistoryResult>;
|
|
232
|
+
|
|
195
233
|
/**
|
|
196
234
|
* Continue the in-flight turn **without a new user prompt**, returning the
|
|
197
235
|
* same control surface as `doPromptTurn`. Used to keep consuming a turn that
|
package/src/v1/index.ts
CHANGED
|
@@ -13,9 +13,26 @@ export type {
|
|
|
13
13
|
export type {
|
|
14
14
|
HarnessV1ContinueTurnOptions,
|
|
15
15
|
HarnessV1PromptTurnOptions,
|
|
16
|
+
HarnessV1ReadHistoryResult,
|
|
16
17
|
HarnessV1Session,
|
|
17
18
|
HarnessV1StartOptions,
|
|
18
19
|
} from './harness-v1-session';
|
|
20
|
+
export type {
|
|
21
|
+
HarnessV1AssistantMessage,
|
|
22
|
+
HarnessV1CustomPart,
|
|
23
|
+
HarnessV1FilePart,
|
|
24
|
+
HarnessV1Message,
|
|
25
|
+
HarnessV1MessagePart,
|
|
26
|
+
HarnessV1ReasoningFilePart,
|
|
27
|
+
HarnessV1ReasoningPart,
|
|
28
|
+
HarnessV1TextPart,
|
|
29
|
+
HarnessV1ToolApprovalResponsePart,
|
|
30
|
+
HarnessV1ToolCallPart,
|
|
31
|
+
HarnessV1ToolMessage,
|
|
32
|
+
HarnessV1ToolResultOutput,
|
|
33
|
+
HarnessV1ToolResultPart,
|
|
34
|
+
HarnessV1UserMessage,
|
|
35
|
+
} from './harness-v1-message';
|
|
19
36
|
export type { HarnessV1Observability } from './harness-v1-observability';
|
|
20
37
|
export type { HarnessV1PromptControl } from './harness-v1-prompt-control';
|
|
21
38
|
export type { HarnessV1CallWarning } from './harness-v1-call-warning';
|