@harness-kernel/core 0.2.0 → 0.3.0
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/agent/context.d.ts +2 -3
- package/dist/agent/context.js +1 -1
- package/dist/agent/event.d.ts +3 -2
- package/dist/agent/event.js +6 -2
- package/dist/agent/hook.d.ts +3 -4
- package/dist/agent/hook.js +1 -1
- package/dist/agent/mode.d.ts +2 -3
- package/dist/agent/mode.js +1 -1
- package/dist/agent/role.js +1 -1
- package/dist/agent/session.d.ts +3 -4
- package/dist/agent/session.js +8 -2
- package/dist/agent/tool.d.ts +39 -3
- package/dist/agent/tool.js +8 -2
- package/dist/agent.d.ts +6 -6
- package/dist/{approval-D_G2w-fW.d.ts → approval-Ch0LwJFM.d.ts} +18 -13
- package/dist/chunk-2NQ3JL7K.js +502 -0
- package/dist/chunk-2NQ3JL7K.js.map +1 -0
- package/dist/{chunk-JIJHGB6H.js → chunk-3QOAFCCZ.js} +24 -2
- package/dist/chunk-3QOAFCCZ.js.map +1 -0
- package/dist/chunk-NCSQEUQC.js +37 -0
- package/dist/chunk-NCSQEUQC.js.map +1 -0
- package/dist/{chunk-B4Q6CPYO.js → chunk-TCHZYK5Y.js} +3 -1
- package/dist/{chunk-B4Q6CPYO.js.map → chunk-TCHZYK5Y.js.map} +1 -1
- package/dist/{chunk-37PIMSLG.js → chunk-UKXJIKED.js} +365 -136
- package/dist/chunk-UKXJIKED.js.map +1 -0
- package/dist/{context-BfpLqV11.d.ts → context-Bz9C_rL9.d.ts} +88 -3
- package/dist/errors-DHHy8V3O.d.ts +6 -0
- package/dist/errors-hpkW3tfR.d.ts +112 -0
- package/dist/{event-CKV4EeZ3.d.ts → event-DMBY-R6h.d.ts} +33 -4
- package/dist/{hook-CfBbhUQf.d.ts → hook-DD7uuzE3.d.ts} +2 -2
- package/dist/index.d.ts +21 -15
- package/dist/index.js +19 -6
- package/dist/metrics-DMN8bfY6.d.ts +23 -0
- package/dist/{model-provider-Ch7tzk1x.d.ts → model-provider-DGkLQJWP.d.ts} +6 -4
- package/dist/runner/approval.d.ts +7 -7
- package/dist/runner/event.d.ts +3 -2
- package/dist/runner/event.js +6 -2
- package/dist/runner/logging.d.ts +7 -3
- package/dist/runner/logging.js +11 -1
- package/dist/runner/model-provider.d.ts +6 -6
- package/dist/runner/storage.d.ts +181 -4
- package/dist/{runner-BzEf0lAV.d.ts → runner-CZHeMHKV.d.ts} +8 -5
- package/dist/runner.d.ts +9 -8
- package/dist/runner.js +11 -5
- package/package.json +2 -2
- package/dist/chunk-37PIMSLG.js.map +0 -1
- package/dist/chunk-JIJHGB6H.js.map +0 -1
- package/dist/chunk-Q44U2CMM.js +0 -239
- package/dist/chunk-Q44U2CMM.js.map +0 -1
- package/dist/events-D4xcDi53.d.ts +0 -69
- package/dist/storage-DCZE_hES.d.ts +0 -200
- package/dist/tool-errors-CygY1Nba.d.ts +0 -27
- package/dist/types-BPmsw-mF.d.ts +0 -80
package/dist/agent/context.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { c as HarnessRoleSelector } from '../role-BN6KhQxx.js';
|
|
2
|
-
export { a as AgentContextProvider, b as AgentContextReader, c as AgentContextSession, C as ContextConsume, z as ContextContribution, B as ContextContributionInput, D as ContextEntry, E as ContextEntryFilter, F as ContextProviderBinding, G as ContextProviderOutput, H as ContextProviderReference, I as ContextProviderRenderResult, J as ContextProviderSummary, K as ContextRegistrationOptions, L as ContextScopes, M as ContextSnapshot, N as HarnessContextProvider, O as HarnessContextProviderClass, P as HarnessContextProviderSelector } from '../context-
|
|
3
|
-
import '../
|
|
4
|
-
import '../types-BPmsw-mF.js';
|
|
2
|
+
export { a as AgentContextProvider, b as AgentContextReader, c as AgentContextSession, C as ContextConsume, z as ContextContribution, B as ContextContributionInput, D as ContextEntry, E as ContextEntryFilter, F as ContextProviderBinding, G as ContextProviderOutput, H as ContextProviderReference, I as ContextProviderRenderResult, J as ContextProviderSummary, K as ContextRegistrationOptions, L as ContextScopes, M as ContextSnapshot, N as HarnessContextProvider, O as HarnessContextProviderClass, P as HarnessContextProviderSelector } from '../context-Bz9C_rL9.js';
|
|
3
|
+
import '../errors-hpkW3tfR.js';
|
|
5
4
|
import '../runner/sandbox.js';
|
package/dist/agent/context.js
CHANGED
package/dist/agent/event.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { C as ContextReadyEvent, E as ErrorEvent, M as MessageDeltaEvent, a as MessageEndEvent, b as MessageStartEvent, c as ModeChangedEvent, d as ModelAfterEvent, e as ModelBeforeEvent, R as
|
|
1
|
+
export { f as HarnessEvent, g as HarnessEventClass, h as HarnessEventEmitOptions, i as HarnessEventMetadata, j as HarnessEventQuery, k as HarnessEventRecord, l as HarnessEventSource } from '../errors-hpkW3tfR.js';
|
|
2
|
+
export { C as ContextReadyEvent, E as ErrorEvent, M as MessageDeltaEvent, a as MessageEndEvent, b as MessageStartEvent, c as ModeChangedEvent, d as ModelAfterEvent, e as ModelBeforeEvent, R as RunAbortedEvent, f as RunEndEvent, g as RunFailedEvent, h as RunStartEvent, S as SnapshotCreatedEvent, i as SnapshotDeletedEvent, j as SnapshotRestoredEvent, T as ToolApprovalRequestedEvent, k as ToolApprovalResolvedEvent, l as ToolEndEvent, m as ToolStartEvent, n as TranscriptCursorChangedEvent, o as TurnEndEvent, p as TurnStartEvent } from '../event-DMBY-R6h.js';
|
|
3
|
+
import '../metrics-DMN8bfY6.js';
|
|
3
4
|
import '../schema.js';
|
package/dist/agent/event.js
CHANGED
|
@@ -7,7 +7,9 @@ import {
|
|
|
7
7
|
ModeChangedEvent,
|
|
8
8
|
ModelAfterEvent,
|
|
9
9
|
ModelBeforeEvent,
|
|
10
|
+
RunAbortedEvent,
|
|
10
11
|
RunEndEvent,
|
|
12
|
+
RunFailedEvent,
|
|
11
13
|
RunStartEvent,
|
|
12
14
|
SnapshotCreatedEvent,
|
|
13
15
|
SnapshotDeletedEvent,
|
|
@@ -19,11 +21,11 @@ import {
|
|
|
19
21
|
TranscriptCursorChangedEvent,
|
|
20
22
|
TurnEndEvent,
|
|
21
23
|
TurnStartEvent
|
|
22
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-3QOAFCCZ.js";
|
|
23
25
|
import "../chunk-OBKS4AJR.js";
|
|
24
26
|
import {
|
|
25
27
|
HarnessEvent
|
|
26
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-TCHZYK5Y.js";
|
|
27
29
|
export {
|
|
28
30
|
ContextReadyEvent,
|
|
29
31
|
ErrorEvent,
|
|
@@ -34,7 +36,9 @@ export {
|
|
|
34
36
|
ModeChangedEvent,
|
|
35
37
|
ModelAfterEvent,
|
|
36
38
|
ModelBeforeEvent,
|
|
39
|
+
RunAbortedEvent,
|
|
37
40
|
RunEndEvent,
|
|
41
|
+
RunFailedEvent,
|
|
38
42
|
RunStartEvent,
|
|
39
43
|
SnapshotCreatedEvent,
|
|
40
44
|
SnapshotDeletedEvent,
|
package/dist/agent/hook.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { H as HarnessHook, a as HarnessHookEventClass } from '../hook-
|
|
3
|
-
import '../context-
|
|
1
|
+
export { f as HarnessEvent, g as HarnessEventClass } from '../errors-hpkW3tfR.js';
|
|
2
|
+
export { H as HarnessHook, a as HarnessHookEventClass } from '../hook-DD7uuzE3.js';
|
|
3
|
+
import '../context-Bz9C_rL9.js';
|
|
4
4
|
import '../role-BN6KhQxx.js';
|
|
5
|
-
import '../types-BPmsw-mF.js';
|
|
6
5
|
import '../runner/sandbox.js';
|
package/dist/agent/hook.js
CHANGED
package/dist/agent/mode.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { m as AgentModeDefinition, H as ContextProviderReference,
|
|
1
|
+
export { m as AgentModeDefinition, H as ContextProviderReference, a0 as HarnessMode, a1 as HarnessModeClass, a2 as HarnessModeSelector, a3 as HarnessModeSummary, ag as ToolApprovalMode } from '../context-Bz9C_rL9.js';
|
|
2
2
|
import '../role-BN6KhQxx.js';
|
|
3
|
-
import '../
|
|
4
|
-
import '../types-BPmsw-mF.js';
|
|
3
|
+
import '../errors-hpkW3tfR.js';
|
|
5
4
|
import '../runner/sandbox.js';
|
package/dist/agent/mode.js
CHANGED
package/dist/agent/role.js
CHANGED
package/dist/agent/session.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { E as EventCursor,
|
|
2
|
-
export { A as AgentActionSession, b as AgentContextReader, c as AgentContextSession, d as AgentEventReader, e as AgentEventSession, f as AgentHistorySession, g as AgentLogSession, h as AgentMessage, i as AgentMessageEnqueueOptions, j as AgentMessageInput, l as AgentMessageSession, n as AgentModeReader, o as AgentModeSession, p as AgentReadSession, t as AgentStateReader, u as AgentStateSession, w as AgentToolResult, x as AgentToolSession, C as ContextConsume, D as ContextEntry, E as ContextEntryFilter, K as ContextRegistrationOptions, L as ContextScopes,
|
|
1
|
+
export { E as EventCursor, e as HarnessErrorShape, j as HarnessEventQuery, k as HarnessEventRecord } from '../errors-hpkW3tfR.js';
|
|
2
|
+
export { A as AgentActionSession, b as AgentContextReader, c as AgentContextSession, d as AgentEventReader, e as AgentEventSession, f as AgentHistorySession, g as AgentLogSession, h as AgentMessage, i as AgentMessageEnqueueOptions, j as AgentMessageInput, l as AgentMessageSession, n as AgentModeReader, o as AgentModeSession, p as AgentReadSession, t as AgentStateReader, u as AgentStateSession, w as AgentToolResult, x as AgentToolSession, C as ContextConsume, D as ContextEntry, E as ContextEntryFilter, K as ContextRegistrationOptions, L as ContextScopes, a3 as HarnessModeSummary, a5 as HarnessSnapshot, a6 as HarnessSnapshotCreator, a7 as HarnessSnapshotInput, a8 as HarnessSnapshotSession, a9 as HarnessSnapshotSummary, ad as HarnessTranscriptSession, an as TranscriptBranch, ao as TranscriptCursor, ap as TranscriptQuery, aq as TranscriptSeekTarget } from '../context-Bz9C_rL9.js';
|
|
3
3
|
export { c as HarnessRoleSelector, N as NativeRoles, R as RoleTargets } from '../role-BN6KhQxx.js';
|
|
4
|
-
export {
|
|
5
|
-
import '../types-BPmsw-mF.js';
|
|
4
|
+
export { ToolErrorCode, ToolErrorPayload, ToolInvalidField, createToolErrorPayload, createToolErrorResult } from './tool.js';
|
|
6
5
|
import '../runner/sandbox.js';
|
package/dist/agent/session.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createToolErrorPayload,
|
|
3
|
+
createToolErrorResult
|
|
4
|
+
} from "../chunk-NCSQEUQC.js";
|
|
1
5
|
import {
|
|
2
6
|
ContextConsume,
|
|
3
7
|
ContextScopes,
|
|
4
8
|
NativeRoles,
|
|
5
9
|
RoleTargets
|
|
6
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-TCHZYK5Y.js";
|
|
7
11
|
export {
|
|
8
12
|
ContextConsume,
|
|
9
13
|
ContextScopes,
|
|
10
14
|
NativeRoles,
|
|
11
|
-
RoleTargets
|
|
15
|
+
RoleTargets,
|
|
16
|
+
createToolErrorPayload,
|
|
17
|
+
createToolErrorResult
|
|
12
18
|
};
|
|
13
19
|
//# sourceMappingURL=session.js.map
|
package/dist/agent/tool.d.ts
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
import { w as AgentToolResult } from '../context-Bz9C_rL9.js';
|
|
2
|
+
export { v as AgentToolDefinition, y as AgentToolSource, aa as HarnessTool, ab as HarnessToolClass, ac as HarnessToolSelector, ai as ToolApprovalResolver, aj as ToolCatalogEntry, ak as ToolPermission, al as ToolRef, am as ToolRisk } from '../context-Bz9C_rL9.js';
|
|
3
|
+
import { a as HarnessErrorCode } from '../errors-hpkW3tfR.js';
|
|
2
4
|
import '../role-BN6KhQxx.js';
|
|
3
|
-
import '../events-D4xcDi53.js';
|
|
4
|
-
import '../types-BPmsw-mF.js';
|
|
5
5
|
import '../runner/sandbox.js';
|
|
6
|
+
|
|
7
|
+
type ToolErrorCode = Extract<HarnessErrorCode, "tool.args.invalid_schema" | "tool.approval.denied" | "sandbox.exec.failed" | "tool.failed">;
|
|
8
|
+
interface ToolInvalidField {
|
|
9
|
+
path: string;
|
|
10
|
+
code?: string;
|
|
11
|
+
expected?: string;
|
|
12
|
+
received?: string;
|
|
13
|
+
message: string;
|
|
14
|
+
}
|
|
15
|
+
interface ToolErrorPayload {
|
|
16
|
+
ok: false;
|
|
17
|
+
error: {
|
|
18
|
+
code: ToolErrorCode;
|
|
19
|
+
message: string;
|
|
20
|
+
toolName: string;
|
|
21
|
+
invalidFields?: ToolInvalidField[];
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
declare function createToolErrorPayload(input: {
|
|
26
|
+
code: ToolErrorCode;
|
|
27
|
+
message: string;
|
|
28
|
+
toolName: string;
|
|
29
|
+
invalidFields?: ToolInvalidField[];
|
|
30
|
+
metadata?: Record<string, unknown>;
|
|
31
|
+
}): ToolErrorPayload;
|
|
32
|
+
declare function createToolErrorResult(input: {
|
|
33
|
+
code: ToolErrorCode;
|
|
34
|
+
message: string;
|
|
35
|
+
toolName: string;
|
|
36
|
+
content?: string;
|
|
37
|
+
invalidFields?: ToolInvalidField[];
|
|
38
|
+
metadata?: Record<string, unknown>;
|
|
39
|
+
}): AgentToolResult<ToolErrorPayload>;
|
|
40
|
+
|
|
41
|
+
export { AgentToolResult, type ToolErrorCode, type ToolErrorPayload, type ToolInvalidField, createToolErrorPayload, createToolErrorResult };
|
package/dist/agent/tool.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createToolErrorPayload,
|
|
3
|
+
createToolErrorResult
|
|
4
|
+
} from "../chunk-NCSQEUQC.js";
|
|
1
5
|
import {
|
|
2
6
|
HarnessTool
|
|
3
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-TCHZYK5Y.js";
|
|
4
8
|
export {
|
|
5
|
-
HarnessTool
|
|
9
|
+
HarnessTool,
|
|
10
|
+
createToolErrorPayload,
|
|
11
|
+
createToolErrorResult
|
|
6
12
|
};
|
|
7
13
|
//# sourceMappingURL=tool.js.map
|
package/dist/agent.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as AgentDefinition } from './model-provider-
|
|
2
|
-
export { J as JsonObject } from './
|
|
3
|
-
export { r as AgentSharedState, s as AgentSharedStateDefinition } from './context-
|
|
1
|
+
import { A as AgentDefinition } from './model-provider-DGkLQJWP.js';
|
|
2
|
+
export { J as JsonObject } from './errors-hpkW3tfR.js';
|
|
3
|
+
export { r as AgentSharedState, s as AgentSharedStateDefinition } from './context-Bz9C_rL9.js';
|
|
4
4
|
import './role-BN6KhQxx.js';
|
|
5
5
|
import './runner/sandbox.js';
|
|
6
|
-
import './storage
|
|
7
|
-
import './
|
|
8
|
-
import './
|
|
6
|
+
import './runner/storage.js';
|
|
7
|
+
import './metrics-DMN8bfY6.js';
|
|
8
|
+
import './hook-DD7uuzE3.js';
|
|
9
9
|
|
|
10
10
|
declare function defineAgent(definition: AgentDefinition): AgentDefinition;
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as AgentDefinition, H as HarnessModelProvider, e as ModelProviderInfo } from './model-provider-
|
|
2
|
-
import {
|
|
3
|
-
import { e as HarnessEventRecord,
|
|
4
|
-
import { T as HarnessModeSummary, J as ContextProviderSummary, a6 as ToolCatalogEntry, h as AgentMessage, a9 as ToolRisk, a7 as ToolPermission, w as AgentToolResult, S as HarnessModeSelector, r as AgentSharedState, a0 as HarnessTranscriptSession, X as HarnessSnapshotSession, M as ContextSnapshot } from './context-BfpLqV11.js';
|
|
1
|
+
import { A as AgentDefinition, H as HarnessModelProvider, e as ModelProviderInfo } from './model-provider-DGkLQJWP.js';
|
|
2
|
+
import { a3 as HarnessModeSummary, J as ContextProviderSummary, aj as ToolCatalogEntry, _ as HarnessLoggingConfig, h as AgentMessage, am as ToolRisk, ak as ToolPermission, w as AgentToolResult, a2 as HarnessModeSelector, r as AgentSharedState, ad as HarnessTranscriptSession, a8 as HarnessSnapshotSession, M as ContextSnapshot } from './context-Bz9C_rL9.js';
|
|
3
|
+
import { c as HarnessErrorPolicy, e as HarnessErrorShape, k as HarnessEventRecord, g as HarnessEventClass, j as HarnessEventQuery, f as HarnessEvent } from './errors-hpkW3tfR.js';
|
|
5
4
|
import { d as HarnessRoleSummary, c as HarnessRoleSelector } from './role-BN6KhQxx.js';
|
|
6
|
-
import {
|
|
7
|
-
import { b as HarnessHookSummary } from './hook-
|
|
5
|
+
import { R as RunMetrics } from './metrics-DMN8bfY6.js';
|
|
6
|
+
import { b as HarnessHookSummary } from './hook-DD7uuzE3.js';
|
|
8
7
|
import { HarnessSandbox } from './runner/sandbox.js';
|
|
8
|
+
import { HarnessSessionStorage, SessionListQuery, SessionListResult } from './runner/storage.js';
|
|
9
9
|
|
|
10
10
|
interface HarnessEventSummary {
|
|
11
11
|
type: string;
|
|
@@ -39,6 +39,7 @@ interface HarnessAppConfig {
|
|
|
39
39
|
sandbox?: HarnessSandbox;
|
|
40
40
|
resources?: Record<string, unknown>;
|
|
41
41
|
logging?: HarnessLoggingConfig;
|
|
42
|
+
errorPolicy?: HarnessErrorPolicy;
|
|
42
43
|
}
|
|
43
44
|
interface HarnessUserInput {
|
|
44
45
|
id?: string;
|
|
@@ -83,12 +84,6 @@ interface ToolApprovalHandle {
|
|
|
83
84
|
approve(): Promise<void>;
|
|
84
85
|
deny(reason?: string): Promise<void>;
|
|
85
86
|
}
|
|
86
|
-
interface HarnessErrorShape {
|
|
87
|
-
name?: string;
|
|
88
|
-
message: string;
|
|
89
|
-
stack?: string;
|
|
90
|
-
cause?: unknown;
|
|
91
|
-
}
|
|
92
87
|
type HarnessStreamEvent = {
|
|
93
88
|
type: "run.started";
|
|
94
89
|
sessionId: string;
|
|
@@ -134,6 +129,16 @@ type HarnessStreamEvent = {
|
|
|
134
129
|
} | {
|
|
135
130
|
type: "run.completed";
|
|
136
131
|
result: SendResult;
|
|
132
|
+
} | {
|
|
133
|
+
type: "run.failed";
|
|
134
|
+
runId: string;
|
|
135
|
+
error: HarnessErrorShape;
|
|
136
|
+
metrics: RunMetrics;
|
|
137
|
+
} | {
|
|
138
|
+
type: "run.aborted";
|
|
139
|
+
runId: string;
|
|
140
|
+
error: HarnessErrorShape;
|
|
141
|
+
metrics: RunMetrics;
|
|
137
142
|
} | {
|
|
138
143
|
type: "error";
|
|
139
144
|
error: HarnessErrorShape;
|
|
@@ -240,4 +245,4 @@ interface HarnessSessionStore {
|
|
|
240
245
|
close(): Promise<void>;
|
|
241
246
|
}
|
|
242
247
|
|
|
243
|
-
export { type HarnessAgentInput as H, type SendOptions as S, type ToolApprovalHandle as T, type WaitForEventOptions as W, type HarnessAgentManifest as a, type HarnessAppConfig as b, type
|
|
248
|
+
export { type HarnessAgentInput as H, type SendOptions as S, type ToolApprovalHandle as T, type WaitForEventOptions as W, type HarnessAgentManifest as a, type HarnessAppConfig as b, type HarnessEventSummary as c, type HarnessRunStream as d, type HarnessSession as e, type HarnessSessionEventListener as f, type HarnessSessionListener as g, HarnessSessionPhase as h, type HarnessSessionStatus as i, type HarnessSessionStore as j, type HarnessSessionStoreEvent as k, type HarnessSessionStoreListener as l, type HarnessStorageConfig as m, type HarnessStreamEvent as n, type HarnessUserInput as o, type SendResult as p, type StreamOptions as q };
|