@ai-sdk/harness 1.0.93 → 1.0.95
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 +23 -0
- package/dist/agent/index.d.ts +22 -19
- package/dist/agent/index.js +138 -10
- package/dist/agent/index.js.map +1 -1
- package/dist/index.d.ts +48 -14
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/index.d.ts +7 -1
- package/dist/utils/index.js +42 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +5 -5
- package/src/agent/harness-agent-session.ts +8 -0
- package/src/agent/harness-agent-settings.ts +7 -6
- package/src/agent/harness-agent.ts +7 -1
- package/src/agent/internal/run-prompt.ts +48 -5
- package/src/agent/internal/strip-work-dir.ts +102 -0
- package/src/agent/internal/translate-stream-part.ts +5 -0
- package/src/agent/internal/turn-telemetry.ts +34 -8
- package/src/utils/bridge-token.ts +18 -0
- package/src/utils/index.ts +1 -0
- package/src/v1/harness-v1-bridge-protocol.ts +6 -0
- package/src/v1/harness-v1-lifecycle-state.ts +7 -0
- package/src/v1/harness-v1-session.ts +0 -14
- package/src/v1/harness-v1-stream-part.ts +31 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
JSONValue,
|
|
3
3
|
LanguageModelV4FinishReason,
|
|
4
|
+
LanguageModelV4StreamPart,
|
|
4
5
|
LanguageModelV4ToolApprovalRequest,
|
|
5
6
|
LanguageModelV4ToolCall,
|
|
6
7
|
LanguageModelV4ToolResult,
|
|
@@ -58,7 +59,7 @@ export type HarnessV1StreamPart =
|
|
|
58
59
|
}
|
|
59
60
|
| { type: 'reasoning-end'; id: string; harnessMetadata?: HarnessV1Metadata }
|
|
60
61
|
|
|
61
|
-
// Tool calls, approvals, results — reuse V4 primitives.
|
|
62
|
+
// Tool inputs, calls, approvals, results — reuse V4 primitives.
|
|
62
63
|
//
|
|
63
64
|
// `nativeName` lets adapters surface the runtime's native name for a builtin
|
|
64
65
|
// when it differs from the wire `toolName` (e.g. `toolName: 'bash'`,
|
|
@@ -73,6 +74,9 @@ export type HarnessV1StreamPart =
|
|
|
73
74
|
// built-in `Bash`, Codex's `shell`) vs. needs host dispatch is signalled by
|
|
74
75
|
// the standard `providerExecuted` field on `LanguageModelV4ToolCall` —
|
|
75
76
|
// `true` for runtime-executed builtins, false/undefined for host tools.
|
|
77
|
+
| Extract<LanguageModelV4StreamPart, { type: 'tool-input-start' }>
|
|
78
|
+
| Extract<LanguageModelV4StreamPart, { type: 'tool-input-delta' }>
|
|
79
|
+
| Extract<LanguageModelV4StreamPart, { type: 'tool-input-end' }>
|
|
76
80
|
| (LanguageModelV4ToolCall & {
|
|
77
81
|
nativeName?: string;
|
|
78
82
|
/**
|
|
@@ -268,6 +272,29 @@ export const harnessV1ReasoningEndPartSchema = z.object({
|
|
|
268
272
|
harnessMetadata: harnessV1MetadataSchema.optional(),
|
|
269
273
|
});
|
|
270
274
|
|
|
275
|
+
export const harnessV1ToolInputStartPartSchema = z.object({
|
|
276
|
+
type: z.literal('tool-input-start'),
|
|
277
|
+
id: z.string(),
|
|
278
|
+
toolName: z.string(),
|
|
279
|
+
providerMetadata: harnessV1ProviderMetadataSchema.optional(),
|
|
280
|
+
providerExecuted: z.boolean().optional(),
|
|
281
|
+
dynamic: z.boolean().optional(),
|
|
282
|
+
title: z.string().optional(),
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
export const harnessV1ToolInputDeltaPartSchema = z.object({
|
|
286
|
+
type: z.literal('tool-input-delta'),
|
|
287
|
+
id: z.string(),
|
|
288
|
+
delta: z.string(),
|
|
289
|
+
providerMetadata: harnessV1ProviderMetadataSchema.optional(),
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
export const harnessV1ToolInputEndPartSchema = z.object({
|
|
293
|
+
type: z.literal('tool-input-end'),
|
|
294
|
+
id: z.string(),
|
|
295
|
+
providerMetadata: harnessV1ProviderMetadataSchema.optional(),
|
|
296
|
+
});
|
|
297
|
+
|
|
271
298
|
export const harnessV1ToolCallPartSchema = z.object({
|
|
272
299
|
type: z.literal('tool-call'),
|
|
273
300
|
toolCallId: z.string(),
|
|
@@ -352,6 +379,9 @@ export const harnessV1StreamPartSchema = z.discriminatedUnion('type', [
|
|
|
352
379
|
harnessV1ReasoningStartPartSchema,
|
|
353
380
|
harnessV1ReasoningDeltaPartSchema,
|
|
354
381
|
harnessV1ReasoningEndPartSchema,
|
|
382
|
+
harnessV1ToolInputStartPartSchema,
|
|
383
|
+
harnessV1ToolInputDeltaPartSchema,
|
|
384
|
+
harnessV1ToolInputEndPartSchema,
|
|
355
385
|
harnessV1ToolCallPartSchema,
|
|
356
386
|
harnessV1ToolApprovalRequestPartSchema,
|
|
357
387
|
harnessV1ToolResultPartSchema,
|