@harness-kernel/core 0.2.1 → 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.
Files changed (53) hide show
  1. package/dist/agent/context.d.ts +2 -3
  2. package/dist/agent/context.js +1 -1
  3. package/dist/agent/event.d.ts +3 -2
  4. package/dist/agent/event.js +6 -2
  5. package/dist/agent/hook.d.ts +3 -4
  6. package/dist/agent/hook.js +1 -1
  7. package/dist/agent/mode.d.ts +2 -3
  8. package/dist/agent/mode.js +1 -1
  9. package/dist/agent/role.js +1 -1
  10. package/dist/agent/session.d.ts +3 -4
  11. package/dist/agent/session.js +8 -2
  12. package/dist/agent/tool.d.ts +39 -3
  13. package/dist/agent/tool.js +8 -2
  14. package/dist/agent.d.ts +6 -6
  15. package/dist/{approval-D_G2w-fW.d.ts → approval-Ch0LwJFM.d.ts} +18 -13
  16. package/dist/chunk-2NQ3JL7K.js +502 -0
  17. package/dist/chunk-2NQ3JL7K.js.map +1 -0
  18. package/dist/{chunk-JIJHGB6H.js → chunk-3QOAFCCZ.js} +24 -2
  19. package/dist/chunk-3QOAFCCZ.js.map +1 -0
  20. package/dist/chunk-NCSQEUQC.js +37 -0
  21. package/dist/chunk-NCSQEUQC.js.map +1 -0
  22. package/dist/{chunk-B4Q6CPYO.js → chunk-TCHZYK5Y.js} +3 -1
  23. package/dist/{chunk-B4Q6CPYO.js.map → chunk-TCHZYK5Y.js.map} +1 -1
  24. package/dist/{chunk-QEVKKJ7N.js → chunk-UKXJIKED.js} +354 -132
  25. package/dist/chunk-UKXJIKED.js.map +1 -0
  26. package/dist/{context-BfpLqV11.d.ts → context-Bz9C_rL9.d.ts} +88 -3
  27. package/dist/errors-DHHy8V3O.d.ts +6 -0
  28. package/dist/errors-hpkW3tfR.d.ts +112 -0
  29. package/dist/{event-CKV4EeZ3.d.ts → event-DMBY-R6h.d.ts} +33 -4
  30. package/dist/{hook-CfBbhUQf.d.ts → hook-DD7uuzE3.d.ts} +2 -2
  31. package/dist/index.d.ts +21 -15
  32. package/dist/index.js +19 -6
  33. package/dist/metrics-DMN8bfY6.d.ts +23 -0
  34. package/dist/{model-provider-Ch7tzk1x.d.ts → model-provider-DGkLQJWP.d.ts} +6 -4
  35. package/dist/runner/approval.d.ts +7 -7
  36. package/dist/runner/event.d.ts +3 -2
  37. package/dist/runner/event.js +6 -2
  38. package/dist/runner/logging.d.ts +7 -3
  39. package/dist/runner/logging.js +11 -1
  40. package/dist/runner/model-provider.d.ts +6 -6
  41. package/dist/runner/storage.d.ts +181 -4
  42. package/dist/{runner-B41JEovO.d.ts → runner-CZHeMHKV.d.ts} +7 -5
  43. package/dist/runner.d.ts +9 -8
  44. package/dist/runner.js +11 -5
  45. package/package.json +2 -2
  46. package/dist/chunk-JIJHGB6H.js.map +0 -1
  47. package/dist/chunk-Q44U2CMM.js +0 -239
  48. package/dist/chunk-Q44U2CMM.js.map +0 -1
  49. package/dist/chunk-QEVKKJ7N.js.map +0 -1
  50. package/dist/events-D4xcDi53.d.ts +0 -69
  51. package/dist/storage-DCZE_hES.d.ts +0 -200
  52. package/dist/tool-errors-CygY1Nba.d.ts +0 -27
  53. package/dist/types-BPmsw-mF.d.ts +0 -80
@@ -1,6 +1,5 @@
1
1
  import { c as HarnessRoleSelector } from './role-BN6KhQxx.js';
2
- import { E as EventCursor, J as JsonObject, a as HarnessEventClass, d as HarnessEventQuery, e as HarnessEventRecord, H as HarnessEvent, b as HarnessEventEmitOptions } from './events-D4xcDi53.js';
3
- import { b as HarnessLogClass, c as HarnessLogContext } from './types-BPmsw-mF.js';
2
+ import { E as EventCursor, J as JsonObject, a as HarnessErrorCode, H as HarnessErrorCategory, d as HarnessErrorSeverity, g as HarnessEventClass, j as HarnessEventQuery, k as HarnessEventRecord, f as HarnessEvent, h as HarnessEventEmitOptions } from './errors-hpkW3tfR.js';
4
3
  import { HarnessSandboxSession } from './runner/sandbox.js';
5
4
 
6
5
  type AgentMessageRole = "system" | "user" | "assistant" | "tool" | "event" | (string & {});
@@ -51,11 +50,95 @@ interface TranscriptBranch {
51
50
  metadata?: JsonObject;
52
51
  }
53
52
 
53
+ type HarnessLogLevel = "debug" | "info" | "warn" | "error";
54
+ type HarnessLoggingLevel = "silent" | HarnessLogLevel;
55
+ type HarnessLogCategory = "session" | "run" | "turn" | "context" | "model" | "tool" | "approval" | "snapshot" | "transcript" | "storage" | "agent";
56
+ type HarnessLogSourceKind = "runtime" | "model_provider" | "tool" | "hook" | "context_provider" | "mode" | "user" | "custom";
57
+ interface HarnessLogSource {
58
+ kind: HarnessLogSourceKind;
59
+ id?: string;
60
+ type?: string;
61
+ name?: string;
62
+ label?: string;
63
+ }
64
+ interface HarnessLogError {
65
+ code?: HarnessErrorCode;
66
+ category?: HarnessErrorCategory;
67
+ severity?: HarnessErrorSeverity;
68
+ recoverable?: boolean;
69
+ name?: string;
70
+ message: string;
71
+ stack?: string;
72
+ }
73
+ interface HarnessLogRecord {
74
+ id: string;
75
+ at: string;
76
+ level: HarnessLogLevel;
77
+ category: HarnessLogCategory;
78
+ type: string;
79
+ message: string;
80
+ sessionId?: string;
81
+ runId?: string;
82
+ turnId?: string;
83
+ modeId?: string;
84
+ branchId?: string;
85
+ source: HarnessLogSource;
86
+ correlationId?: string;
87
+ causationId?: string;
88
+ spanId?: string;
89
+ parentSpanId?: string;
90
+ durationMs?: number;
91
+ fields?: Record<string, unknown>;
92
+ error?: HarnessLogError;
93
+ }
94
+ declare abstract class HarnessLog<TFields = Record<string, unknown>> {
95
+ abstract level: HarnessLogLevel;
96
+ abstract category: HarnessLogCategory;
97
+ abstract message(fields: TFields): string;
98
+ levelFor?(fields: TFields): HarnessLogLevel;
99
+ redact?(fields: TFields): TFields;
100
+ }
101
+ type HarnessLogClass<TFields = Record<string, unknown>> = new () => HarnessLog<TFields>;
102
+ declare abstract class HarnessLogSink {
103
+ abstract write(record: HarnessLogRecord): void | Promise<void>;
104
+ flush?(): void | Promise<void>;
105
+ close?(): void | Promise<void>;
106
+ }
107
+ interface HarnessLoggingConfig {
108
+ level?: HarnessLoggingLevel;
109
+ sinks?: HarnessLogSink[];
110
+ format?: "pretty" | "json";
111
+ modelDeltas?: "none" | "summary" | "full" | boolean;
112
+ events?: boolean;
113
+ redact?: {
114
+ keys?: string[];
115
+ replacement?: string;
116
+ };
117
+ }
118
+ interface HarnessRedactionConfig {
119
+ keys?: string[];
120
+ replacement?: string;
121
+ }
122
+ interface HarnessLogContext {
123
+ sessionId?: string;
124
+ runId?: string;
125
+ turnId?: string;
126
+ modeId?: string;
127
+ branchId?: string;
128
+ source?: HarnessLogSource;
129
+ correlationId?: string;
130
+ causationId?: string;
131
+ spanId?: string;
132
+ parentSpanId?: string;
133
+ durationMs?: number;
134
+ }
135
+
54
136
  type HarnessContextProviderClass<TProvider extends HarnessContextProvider = HarnessContextProvider> = abstract new (...args: any[]) => TProvider;
55
137
  type HarnessContextProviderSelector<TOptions extends JsonObject = JsonObject> = HarnessContextProvider<TOptions> | HarnessContextProviderClass<HarnessContextProvider<TOptions>>;
56
138
  interface ContextProviderBinding<TOptions extends JsonObject = JsonObject> {
57
139
  provider: HarnessContextProviderSelector<TOptions>;
58
140
  options?: TOptions;
141
+ required?: boolean;
59
142
  }
60
143
  type ContextProviderReference<TOptions extends JsonObject = JsonObject> = HarnessContextProviderSelector<TOptions> | ContextProviderBinding<TOptions>;
61
144
  interface ContextProviderSummary {
@@ -139,6 +222,7 @@ declare abstract class HarnessContextProvider<TOptions extends JsonObject = Json
139
222
  label?: string;
140
223
  priority?: number;
141
224
  role?: HarnessRoleSelector;
225
+ required?: boolean;
142
226
  get type(): string;
143
227
  with(options: TOptions): ContextProviderBinding<TOptions>;
144
228
  abstract render(session: AgentReadSession, options?: TOptions): ContextProviderOutput | Promise<ContextProviderOutput>;
@@ -159,6 +243,7 @@ declare abstract class HarnessMode {
159
243
  tools?: AgentToolSource[];
160
244
  maxTurns?: number;
161
245
  toolApproval?: ToolApprovalMode;
246
+ contextFailure?: "fail" | "warn-and-skip";
162
247
  get type(): string;
163
248
  getPrompt?(session: AgentReadSession): string | Promise<string>;
164
249
  onEnter?(session: AgentActionSession, input?: unknown): void | Promise<void>;
@@ -393,4 +478,4 @@ interface ToolApprovalRequest {
393
478
  approvalTimeoutMs?: number;
394
479
  }
395
480
 
396
- export { type HarnessToolSelector as $, type AgentActionSession as A, type ContextContributionInput as B, ContextConsume as C, type ContextEntry as D, type ContextEntryFilter as E, type ContextProviderBinding as F, type ContextProviderOutput as G, type ContextProviderReference as H, type ContextProviderRenderResult as I, type ContextProviderSummary as J, type ContextRegistrationOptions as K, ContextScopes as L, type ContextSnapshot as M, HarnessContextProvider as N, type HarnessContextProviderClass as O, type HarnessContextProviderSelector as P, HarnessMode as Q, type HarnessModeClass as R, type HarnessModeSelector as S, type HarnessModeSummary as T, type HarnessSnapshot as U, type HarnessSnapshotCreator as V, type HarnessSnapshotInput as W, type HarnessSnapshotSession as X, type HarnessSnapshotSummary as Y, HarnessTool as Z, type HarnessToolClass as _, type AgentContextProvider as a, type HarnessTranscriptSession as a0, type RunInfo as a1, type ToolApprovalDecision as a2, type ToolApprovalMode as a3, type ToolApprovalRequest as a4, type ToolApprovalResolver as a5, type ToolCatalogEntry as a6, type ToolPermission as a7, type ToolRef as a8, type ToolRisk as a9, type TranscriptBranch as aa, type TranscriptCursor as ab, type TranscriptQuery as ac, type TranscriptSeekTarget as ad, type TurnInfo as ae, type AgentContextReader as b, type AgentContextSession as c, type AgentEventReader as d, type AgentEventSession as e, type AgentHistorySession as f, type AgentLogSession as g, type AgentMessage as h, type AgentMessageEnqueueOptions as i, type AgentMessageInput as j, type AgentMessageRole as k, type AgentMessageSession as l, type AgentModeDefinition as m, type AgentModeReader as n, type AgentModeSession as o, type AgentReadSession as p, type AgentRuntimeLogger as q, type AgentSharedState as r, type AgentSharedStateDefinition as s, type AgentStateReader as t, type AgentStateSession as u, type AgentToolDefinition as v, type AgentToolResult as w, type AgentToolSession as x, type AgentToolSource as y, type ContextContribution as z };
481
+ export { type HarnessLoggingLevel as $, type AgentActionSession as A, type ContextContributionInput as B, ContextConsume as C, type ContextEntry as D, type ContextEntryFilter as E, type ContextProviderBinding as F, type ContextProviderOutput as G, type ContextProviderReference as H, type ContextProviderRenderResult as I, type ContextProviderSummary as J, type ContextRegistrationOptions as K, ContextScopes as L, type ContextSnapshot as M, HarnessContextProvider as N, type HarnessContextProviderClass as O, type HarnessContextProviderSelector as P, HarnessLog as Q, type HarnessLogCategory as R, type HarnessLogClass as S, type HarnessLogContext as T, type HarnessLogError as U, type HarnessLogLevel as V, type HarnessLogRecord as W, HarnessLogSink as X, type HarnessLogSource as Y, type HarnessLogSourceKind as Z, type HarnessLoggingConfig as _, type AgentContextProvider as a, HarnessMode as a0, type HarnessModeClass as a1, type HarnessModeSelector as a2, type HarnessModeSummary as a3, type HarnessRedactionConfig as a4, type HarnessSnapshot as a5, type HarnessSnapshotCreator as a6, type HarnessSnapshotInput as a7, type HarnessSnapshotSession as a8, type HarnessSnapshotSummary as a9, HarnessTool as aa, type HarnessToolClass as ab, type HarnessToolSelector as ac, type HarnessTranscriptSession as ad, type RunInfo as ae, type ToolApprovalDecision as af, type ToolApprovalMode as ag, type ToolApprovalRequest as ah, type ToolApprovalResolver as ai, type ToolCatalogEntry as aj, type ToolPermission as ak, type ToolRef as al, type ToolRisk as am, type TranscriptBranch as an, type TranscriptCursor as ao, type TranscriptQuery as ap, type TranscriptSeekTarget as aq, type TurnInfo as ar, type AgentContextReader as b, type AgentContextSession as c, type AgentEventReader as d, type AgentEventSession as e, type AgentHistorySession as f, type AgentLogSession as g, type AgentMessage as h, type AgentMessageEnqueueOptions as i, type AgentMessageInput as j, type AgentMessageRole as k, type AgentMessageSession as l, type AgentModeDefinition as m, type AgentModeReader as n, type AgentModeSession as o, type AgentReadSession as p, type AgentRuntimeLogger as q, type AgentSharedState as r, type AgentSharedStateDefinition as s, type AgentStateReader as t, type AgentStateSession as u, type AgentToolDefinition as v, type AgentToolResult as w, type AgentToolSession as x, type AgentToolSource as y, type ContextContribution as z };
@@ -0,0 +1,6 @@
1
+ import { b as HarnessErrorContext, c as HarnessErrorPolicy, e as HarnessErrorShape } from './errors-hpkW3tfR.js';
2
+
3
+ declare function normalizeHarnessError(error: unknown, context?: HarnessErrorContext, policy?: HarnessErrorPolicy): HarnessErrorShape;
4
+ declare function sanitizeHarnessError(error: HarnessErrorShape, policy?: HarnessErrorPolicy): HarnessErrorShape;
5
+
6
+ export { normalizeHarnessError as n, sanitizeHarnessError as s };
@@ -0,0 +1,112 @@
1
+ type JsonObject = Record<string, unknown>;
2
+
3
+ interface HarnessEventMetadata extends JsonObject {
4
+ label?: string;
5
+ }
6
+ interface HarnessEventSource {
7
+ kind: "runtime" | "model_provider" | "tool" | "hook" | "context_provider" | "mode" | "user" | "custom";
8
+ id?: string;
9
+ name?: string;
10
+ }
11
+ interface HarnessEventRecord<TPayload = unknown> {
12
+ id: string;
13
+ seq: number;
14
+ branchId: string;
15
+ type: string;
16
+ eventClassId: string;
17
+ at: string;
18
+ source: HarnessEventSource;
19
+ payload: TPayload;
20
+ runId: string;
21
+ turnId?: string;
22
+ modeId?: string;
23
+ correlationId?: string;
24
+ causationId?: string;
25
+ hidden: true;
26
+ metadata?: HarnessEventMetadata;
27
+ }
28
+ declare abstract class HarnessEvent<TPayload = unknown> {
29
+ readonly record: HarnessEventRecord<TPayload>;
30
+ static type?: string;
31
+ static schema?: unknown;
32
+ constructor(record: HarnessEventRecord<TPayload>);
33
+ get id(): string;
34
+ get type(): string;
35
+ get payload(): TPayload;
36
+ get at(): string;
37
+ }
38
+ type HarnessEventClass<TPayload = unknown, TEvent extends HarnessEvent<TPayload> = HarnessEvent<TPayload>> = {
39
+ readonly type?: string;
40
+ readonly schema?: unknown;
41
+ new (record: HarnessEventRecord<any>): TEvent;
42
+ };
43
+ interface HarnessEventEmitOptions {
44
+ source?: HarnessEventSource;
45
+ correlationId?: string;
46
+ causationId?: string;
47
+ metadata?: HarnessEventMetadata;
48
+ hiddenTranscript?: boolean;
49
+ skipHooks?: boolean;
50
+ }
51
+ interface HarnessEventQuery<TPayload = unknown> {
52
+ event?: HarnessEventClass<TPayload>;
53
+ type?: string;
54
+ sourceKind?: HarnessEventSource["kind"];
55
+ limit?: number;
56
+ since?: string;
57
+ until?: string;
58
+ includeInactive?: boolean;
59
+ }
60
+ interface EventCursor {
61
+ id: string;
62
+ branchId: string;
63
+ headEventId?: string;
64
+ seq: number;
65
+ updatedAt: string;
66
+ }
67
+ type RunnerEventListener = (event: HarnessEventRecord) => void | Promise<void>;
68
+
69
+ type HarnessErrorCategory = "run" | "model" | "tool" | "context" | "storage" | "sandbox" | "approval" | "runtime";
70
+ type HarnessErrorSeverity = "warn" | "error" | "fatal";
71
+ type HarnessErrorCode = "run.failed" | "run.aborted" | "model.failed" | "model.rate_limited" | "model.timeout" | "tool.failed" | "tool.args.invalid_schema" | "tool.approval.denied" | "context.provider.failed" | "storage.write_failed" | "sandbox.exec.failed" | "runtime.failed";
72
+ interface HarnessErrorShape {
73
+ code: HarnessErrorCode;
74
+ message: string;
75
+ publicMessage?: string;
76
+ category: HarnessErrorCategory;
77
+ severity: HarnessErrorSeverity;
78
+ recoverable: boolean;
79
+ source?: HarnessEventSource;
80
+ name?: string;
81
+ stack?: string;
82
+ cause?: unknown;
83
+ details?: unknown;
84
+ }
85
+ interface HarnessRetryPolicy {
86
+ attempts?: number;
87
+ backoffMs?: number;
88
+ maxBackoffMs?: number;
89
+ }
90
+ interface HarnessErrorPolicy {
91
+ exposeInternalErrors?: boolean;
92
+ includeStackInStatus?: boolean;
93
+ closeSessionOnFatal?: boolean;
94
+ contextFailure?: "fail" | "warn-and-skip";
95
+ retry?: {
96
+ model?: HarnessRetryPolicy;
97
+ storage?: HarnessRetryPolicy;
98
+ };
99
+ classify?(error: unknown, context: HarnessErrorContext): Partial<HarnessErrorShape> | undefined;
100
+ }
101
+ interface HarnessErrorContext {
102
+ code?: HarnessErrorCode;
103
+ category?: HarnessErrorCategory;
104
+ severity?: HarnessErrorSeverity;
105
+ recoverable?: boolean;
106
+ source?: HarnessEventSource;
107
+ message?: string;
108
+ publicMessage?: string;
109
+ details?: unknown;
110
+ }
111
+
112
+ export { type EventCursor as E, type HarnessErrorCategory as H, type JsonObject as J, type RunnerEventListener as R, type HarnessErrorCode as a, type HarnessErrorContext as b, type HarnessErrorPolicy as c, type HarnessErrorSeverity as d, type HarnessErrorShape as e, HarnessEvent as f, type HarnessEventClass as g, type HarnessEventEmitOptions as h, type HarnessEventMetadata as i, type HarnessEventQuery as j, type HarnessEventRecord as k, type HarnessEventSource as l, type HarnessRetryPolicy as m };
@@ -1,5 +1,6 @@
1
- import { H as HarnessEvent } from './events-D4xcDi53.js';
2
- import { ObjectSchema, StringSchema, NumberSchema, OptionalSchema, LiteralSchema, UnknownSchema, EnumSchema } from './schema.js';
1
+ import { f as HarnessEvent, e as HarnessErrorShape, a as HarnessErrorCode } from './errors-hpkW3tfR.js';
2
+ import { R as RunMetrics } from './metrics-DMN8bfY6.js';
3
+ import { ObjectSchema, StringSchema, NumberSchema, UnknownSchema, OptionalSchema, LiteralSchema, EnumSchema } from './schema.js';
3
4
 
4
5
  declare class RunStartEvent extends HarnessEvent<{
5
6
  agentKey: string;
@@ -107,14 +108,42 @@ declare class RunEndEvent extends HarnessEvent<{
107
108
  finalAnswer: StringSchema;
108
109
  }>;
109
110
  }
111
+ declare class RunFailedEvent extends HarnessEvent<{
112
+ error: HarnessErrorShape;
113
+ metrics: RunMetrics;
114
+ finalAnswer?: string;
115
+ }> {
116
+ static type: string;
117
+ static schema: ObjectSchema<{
118
+ error: UnknownSchema;
119
+ metrics: UnknownSchema;
120
+ finalAnswer: OptionalSchema<unknown, string | undefined>;
121
+ }>;
122
+ }
123
+ declare class RunAbortedEvent extends HarnessEvent<{
124
+ error: HarnessErrorShape;
125
+ metrics: RunMetrics;
126
+ finalAnswer?: string;
127
+ }> {
128
+ static type: string;
129
+ static schema: ObjectSchema<{
130
+ error: UnknownSchema;
131
+ metrics: UnknownSchema;
132
+ finalAnswer: OptionalSchema<unknown, string | undefined>;
133
+ }>;
134
+ }
110
135
  declare class ErrorEvent extends HarnessEvent<{
136
+ error: HarnessErrorShape;
111
137
  message: string;
138
+ code?: HarnessErrorCode;
112
139
  recoverable?: boolean;
113
140
  details?: unknown;
114
141
  }> {
115
142
  static type: string;
116
143
  static schema: ObjectSchema<{
144
+ error: UnknownSchema;
117
145
  message: StringSchema;
146
+ code: OptionalSchema<unknown, string | undefined>;
118
147
  recoverable: OptionalSchema<unknown, boolean | undefined>;
119
148
  details: OptionalSchema<unknown, unknown>;
120
149
  }>;
@@ -225,6 +254,6 @@ declare class TranscriptCursorChangedEvent extends HarnessEvent<{
225
254
  cursor: UnknownSchema;
226
255
  }>;
227
256
  }
228
- declare const runtimeEventClasses: (typeof RunStartEvent | typeof TurnStartEvent | typeof ContextReadyEvent | typeof ModelBeforeEvent | typeof ModelAfterEvent | typeof ToolStartEvent | typeof ToolEndEvent | typeof TurnEndEvent | typeof RunEndEvent | typeof MessageStartEvent | typeof MessageDeltaEvent | typeof MessageEndEvent | typeof ModeChangedEvent | typeof SnapshotCreatedEvent | typeof TranscriptCursorChangedEvent)[];
257
+ declare const runtimeEventClasses: (typeof RunStartEvent | typeof TurnStartEvent | typeof ContextReadyEvent | typeof ModelBeforeEvent | typeof ModelAfterEvent | typeof ToolStartEvent | typeof ToolEndEvent | typeof TurnEndEvent | typeof RunEndEvent | typeof RunFailedEvent | typeof MessageStartEvent | typeof MessageDeltaEvent | typeof MessageEndEvent | typeof ModeChangedEvent | typeof SnapshotCreatedEvent | typeof TranscriptCursorChangedEvent)[];
229
258
 
230
- export { ContextReadyEvent as C, ErrorEvent as E, MessageDeltaEvent as M, RunEndEvent as R, SnapshotCreatedEvent as S, ToolApprovalRequestedEvent as T, MessageEndEvent as a, MessageStartEvent as b, ModeChangedEvent as c, ModelAfterEvent as d, ModelBeforeEvent as e, RunStartEvent as f, SnapshotDeletedEvent as g, SnapshotRestoredEvent as h, ToolApprovalResolvedEvent as i, ToolEndEvent as j, ToolStartEvent as k, TranscriptCursorChangedEvent as l, TurnEndEvent as m, TurnStartEvent as n, runtimeEventClasses as r };
259
+ export { ContextReadyEvent as C, ErrorEvent as E, MessageDeltaEvent as M, RunAbortedEvent as R, SnapshotCreatedEvent as S, ToolApprovalRequestedEvent as T, MessageEndEvent as a, MessageStartEvent as b, ModeChangedEvent as c, ModelAfterEvent as d, ModelBeforeEvent as e, RunEndEvent as f, RunFailedEvent as g, RunStartEvent as h, SnapshotDeletedEvent as i, SnapshotRestoredEvent as j, ToolApprovalResolvedEvent as k, ToolEndEvent as l, ToolStartEvent as m, TranscriptCursorChangedEvent as n, TurnEndEvent as o, TurnStartEvent as p, runtimeEventClasses as r };
@@ -1,5 +1,5 @@
1
- import { H as HarnessEvent, a as HarnessEventClass } from './events-D4xcDi53.js';
2
- import { A as AgentActionSession } from './context-BfpLqV11.js';
1
+ import { f as HarnessEvent, g as HarnessEventClass } from './errors-hpkW3tfR.js';
2
+ import { A as AgentActionSession } from './context-Bz9C_rL9.js';
3
3
 
4
4
  interface HarnessHookSummary {
5
5
  type: string;
package/dist/index.d.ts CHANGED
@@ -1,22 +1,23 @@
1
- import { R as RunnerEventListener, J as JsonObject, d as HarnessEventQuery, e as HarnessEventRecord, b as HarnessEventEmitOptions } from './events-D4xcDi53.js';
2
- export { E as EventCursor, H as HarnessEvent, a as HarnessEventClass, c as HarnessEventMetadata, f as HarnessEventSource } from './events-D4xcDi53.js';
3
- import { a as HarnessAgentManifest } from './approval-D_G2w-fW.js';
4
- export { H as HarnessAgentInput, b as HarnessAppConfig, c as HarnessErrorShape, d as HarnessEventSummary, e as HarnessRunStream, f as HarnessSession, g as HarnessSessionEventListener, h as HarnessSessionListener, i as HarnessSessionPhase, j as HarnessSessionStatus, k as HarnessSessionStore, l as HarnessSessionStoreEvent, m as HarnessSessionStoreListener, n as HarnessStorageConfig, o as HarnessStreamEvent, p as HarnessUserInput, S as SendOptions, q as SendResult, r as StreamOptions, T as ToolApprovalHandle, W as WaitForEventOptions } from './approval-D_G2w-fW.js';
5
- import { ac as TranscriptQuery, h as AgentMessage, ab as TranscriptCursor, ad as TranscriptSeekTarget, r as AgentSharedState, W as HarnessSnapshotInput, U as HarnessSnapshot, Y as HarnessSnapshotSummary, M as ContextSnapshot, E as ContextEntryFilter, D as ContextEntry, S as HarnessModeSelector } from './context-BfpLqV11.js';
6
- export { A as AgentActionSession, a as AgentContextProvider, b as AgentContextReader, c as AgentContextSession, d as AgentEventReader, e as AgentEventSession, f as AgentHistorySession, g as AgentLogSession, i as AgentMessageEnqueueOptions, j as AgentMessageInput, k as AgentMessageRole, l as AgentMessageSession, m as AgentModeDefinition, n as AgentModeReader, o as AgentModeSession, p as AgentReadSession, q as AgentRuntimeLogger, s as AgentSharedStateDefinition, t as AgentStateReader, u as AgentStateSession, v as AgentToolDefinition, w as AgentToolResult, x as AgentToolSession, y as AgentToolSource, C as ContextConsume, z as ContextContribution, B as ContextContributionInput, F as ContextProviderBinding, G as ContextProviderOutput, H as ContextProviderReference, I as ContextProviderRenderResult, J as ContextProviderSummary, K as ContextRegistrationOptions, L as ContextScopes, N as HarnessContextProvider, O as HarnessContextProviderClass, P as HarnessContextProviderSelector, Q as HarnessMode, R as HarnessModeClass, T as HarnessModeSummary, V as HarnessSnapshotCreator, X as HarnessSnapshotSession, Z as HarnessTool, _ as HarnessToolClass, $ as HarnessToolSelector, a0 as HarnessTranscriptSession, a1 as RunInfo, a2 as ToolApprovalDecision, a3 as ToolApprovalMode, a4 as ToolApprovalRequest, a5 as ToolApprovalResolver, a6 as ToolCatalogEntry, a7 as ToolPermission, a8 as ToolRef, a9 as ToolRisk, aa as TranscriptBranch, ae as TurnInfo } from './context-BfpLqV11.js';
1
+ import { R as RunnerEventListener, J as JsonObject, j as HarnessEventQuery, k as HarnessEventRecord, h as HarnessEventEmitOptions } from './errors-hpkW3tfR.js';
2
+ export { E as EventCursor, H as HarnessErrorCategory, a as HarnessErrorCode, b as HarnessErrorContext, c as HarnessErrorPolicy, d as HarnessErrorSeverity, e as HarnessErrorShape, f as HarnessEvent, g as HarnessEventClass, i as HarnessEventMetadata, l as HarnessEventSource, m as HarnessRetryPolicy } from './errors-hpkW3tfR.js';
3
+ import { a as HarnessAgentManifest } from './approval-Ch0LwJFM.js';
4
+ export { H as HarnessAgentInput, b as HarnessAppConfig, c as HarnessEventSummary, d as HarnessRunStream, e as HarnessSession, f as HarnessSessionEventListener, g as HarnessSessionListener, h as HarnessSessionPhase, i as HarnessSessionStatus, j as HarnessSessionStore, k as HarnessSessionStoreEvent, l as HarnessSessionStoreListener, m as HarnessStorageConfig, n as HarnessStreamEvent, o as HarnessUserInput, S as SendOptions, p as SendResult, q as StreamOptions, T as ToolApprovalHandle, W as WaitForEventOptions } from './approval-Ch0LwJFM.js';
5
+ import { ap as TranscriptQuery, h as AgentMessage, ao as TranscriptCursor, aq as TranscriptSeekTarget, r as AgentSharedState, a7 as HarnessSnapshotInput, a5 as HarnessSnapshot, a9 as HarnessSnapshotSummary, M as ContextSnapshot, E as ContextEntryFilter, D as ContextEntry, a2 as HarnessModeSelector } from './context-Bz9C_rL9.js';
6
+ export { A as AgentActionSession, a as AgentContextProvider, b as AgentContextReader, c as AgentContextSession, d as AgentEventReader, e as AgentEventSession, f as AgentHistorySession, g as AgentLogSession, i as AgentMessageEnqueueOptions, j as AgentMessageInput, k as AgentMessageRole, l as AgentMessageSession, m as AgentModeDefinition, n as AgentModeReader, o as AgentModeSession, p as AgentReadSession, q as AgentRuntimeLogger, s as AgentSharedStateDefinition, t as AgentStateReader, u as AgentStateSession, v as AgentToolDefinition, w as AgentToolResult, x as AgentToolSession, y as AgentToolSource, C as ContextConsume, z as ContextContribution, B as ContextContributionInput, F as ContextProviderBinding, G as ContextProviderOutput, H as ContextProviderReference, I as ContextProviderRenderResult, J as ContextProviderSummary, K as ContextRegistrationOptions, L as ContextScopes, N as HarnessContextProvider, O as HarnessContextProviderClass, P as HarnessContextProviderSelector, a0 as HarnessMode, a1 as HarnessModeClass, a3 as HarnessModeSummary, a6 as HarnessSnapshotCreator, a8 as HarnessSnapshotSession, aa as HarnessTool, ab as HarnessToolClass, ac as HarnessToolSelector, ad as HarnessTranscriptSession, ae as RunInfo, af as ToolApprovalDecision, ag as ToolApprovalMode, ah as ToolApprovalRequest, ai as ToolApprovalResolver, aj as ToolCatalogEntry, ak as ToolPermission, al as ToolRef, am as ToolRisk, an as TranscriptBranch, ar as TurnInfo } from './context-Bz9C_rL9.js';
7
7
  export { A as AssistantRole, H as HarnessRole, a as HarnessRoleClass, b as HarnessRoleDefinition, c as HarnessRoleSelector, d as HarnessRoleSummary, N as NativeRoles, R as RoleTargets, S as SystemRole, T as ToolRole, U as UserRole, e as assistantRole, s as systemRole, t as toolRole, u as userRole } from './role-BN6KhQxx.js';
8
- export { H as HarnessHook, a as HarnessHookEventClass, b as HarnessHookSummary } from './hook-CfBbhUQf.js';
9
- import { h as RunMetrics } from './storage-DCZE_hES.js';
10
- export { C as CreateStoredRunInput, a as CreateStoredSessionInput, H as HarnessRunStorage, b as HarnessRunStore, c as HarnessSessionStorage, d as HarnessSessionSummary, M as MemoryRunStorage, e as MemoryRunStore, f as MemorySessionStorage, N as NoopRunStorage, g as NoopRunStore, O as OpenRunStoreInput, R as RunCursorState, S as SessionListQuery, i as SessionListResult, j as StoredRunSummary, T as ToolCallMetric, k as TouchStoredSessionInput } from './storage-DCZE_hES.js';
11
- import { N as NormalizedAgentDefinition, c as AgentSessionRunnerOptions, b as AgentRunnerRunOptions, a as AgentRunResult, e as ModelProviderInfo } from './model-provider-Ch7tzk1x.js';
12
- export { A as AgentDefinition, H as HarnessModelProvider, d as HarnessModelProviderRegistry, M as ModelInfo, f as ModelProviderPreparedContext, g as ModelProviderRunInput, h as ModelProviderRunResult, R as ResolvedModelProvider, m as modelProviderId, p as parseModelRef } from './model-provider-Ch7tzk1x.js';
13
- 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 RunEndEvent, f as RunStartEvent, S as SnapshotCreatedEvent, g as SnapshotDeletedEvent, h as SnapshotRestoredEvent, T as ToolApprovalRequestedEvent, i as ToolApprovalResolvedEvent, j as ToolEndEvent, k as ToolStartEvent, l as TranscriptCursorChangedEvent, m as TurnEndEvent, n as TurnStartEvent, r as runtimeEventClasses } from './event-CKV4EeZ3.js';
8
+ export { H as HarnessHook, a as HarnessHookEventClass, b as HarnessHookSummary } from './hook-DD7uuzE3.js';
9
+ import { R as RunMetrics } from './metrics-DMN8bfY6.js';
10
+ export { T as ToolCallMetric } from './metrics-DMN8bfY6.js';
11
+ import { N as NormalizedAgentDefinition, c as AgentSessionRunnerOptions, b as AgentRunnerRunOptions, a as AgentRunResult, e as ModelProviderInfo } from './model-provider-DGkLQJWP.js';
12
+ export { A as AgentDefinition, H as HarnessModelProvider, d as HarnessModelProviderRegistry, M as ModelInfo, f as ModelProviderPreparedContext, g as ModelProviderRunInput, h as ModelProviderRunResult, R as ResolvedModelProvider, m as modelProviderId, p as parseModelRef } from './model-provider-DGkLQJWP.js';
13
+ 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, r as runtimeEventClasses } from './event-DMBY-R6h.js';
14
+ export { n as normalizeHarnessError, s as sanitizeHarnessError } from './errors-DHHy8V3O.js';
14
15
  export { defineAgent } from './agent.js';
15
16
  export { HarnessSandbox, HarnessSandboxOpenInput, HarnessSandboxSession, NoopSandbox, NoopSandboxSession, SandboxExecInput, SandboxExecResult } from './runner/sandbox.js';
16
- export { C as CreateHarnessSessionInternalOptions, H as HarnessSessionImpl, a as HarnessSessionStoreImpl, c as createHarnessSession, b as createHarnessSessionStore } from './runner-B41JEovO.js';
17
+ export { CreateStoredRunInput, CreateStoredSessionInput, HarnessRunStorage, HarnessRunStore, HarnessSessionStorage, HarnessSessionSummary, MemoryRunStorage, MemoryRunStore, MemorySessionStorage, NoopRunStorage, NoopRunStore, OpenRunStoreInput, RunCursorState, SessionListQuery, SessionListResult, StoredRunSummary, TouchStoredSessionInput } from './runner/storage.js';
18
+ export { C as CreateHarnessSessionInternalOptions, H as HarnessSessionImpl, a as HarnessSessionStoreImpl, c as createHarnessSession, b as createHarnessSessionStore } from './runner-CZHeMHKV.js';
17
19
  export { ArraySchema, BooleanSchema, DefaultSchema, EnumSchema, InferInput, InferOutput, JsonSchema, LiteralSchema, NormalizedSchema, NumberSchema, ObjectSchema, OptionalSchema, RecordSchema, SafeParseResult, Schema, SchemaError, SchemaIssue, SchemaIssueCode, SchemaSource, StringSchema, UnknownSchema, formatSchemaPath, normalizeSchema, s, schemaIssuesFromError } from './schema.js';
18
- export { T as ToolErrorCode, a as ToolErrorPayload, b as ToolInvalidField, c as createToolErrorPayload } from './tool-errors-CygY1Nba.js';
19
- import './types-BPmsw-mF.js';
20
+ export { ToolErrorCode, ToolErrorPayload, ToolInvalidField, createToolErrorPayload, createToolErrorResult } from './agent/tool.js';
20
21
 
21
22
  declare class AgentSessionRunner {
22
23
  private readonly options;
@@ -53,6 +54,8 @@ declare class AgentSessionRunner {
53
54
  private turnHandoffRequested;
54
55
  private restoredFromRun;
55
56
  constructor(options: AgentSessionRunnerOptions);
57
+ private normalizeError;
58
+ private publicError;
56
59
  private logSource;
57
60
  private logContext;
58
61
  private log;
@@ -71,6 +74,8 @@ declare class AgentSessionRunner {
71
74
  private beginNewRun;
72
75
  run(message: string, options?: AgentRunnerRunOptions): Promise<AgentRunResult>;
73
76
  prompt(message: string, options?: AgentRunnerRunOptions): Promise<AgentRunResult>;
77
+ private finalizeMetrics;
78
+ private tryFailureWrite;
74
79
  hydrate(): Promise<void>;
75
80
  close(): Promise<void>;
76
81
  getTranscript(options?: TranscriptQuery): AgentMessage[];
@@ -142,6 +147,7 @@ declare class AgentSessionRunner {
142
147
  private clearDynamicContext;
143
148
  private buildContextSnapshot;
144
149
  private loadContextProvider;
150
+ private handleContextProviderFailure;
145
151
  private normalizeContextContribution;
146
152
  private normalizeContextOutput;
147
153
  private resolveRole;
package/dist/index.js CHANGED
@@ -4,15 +4,17 @@ import {
4
4
  HarnessSessionPhase,
5
5
  HarnessSessionStoreImpl,
6
6
  createHarnessSession,
7
- createHarnessSessionStore,
8
- createToolErrorPayload
9
- } from "./chunk-QEVKKJ7N.js";
7
+ createHarnessSessionStore
8
+ } from "./chunk-UKXJIKED.js";
10
9
  import {
11
10
  HarnessModelProviderRegistry,
12
11
  modelProviderId,
13
12
  parseModelRef
14
13
  } from "./chunk-Q73WH5D7.js";
15
- import "./chunk-Q44U2CMM.js";
14
+ import {
15
+ normalizeHarnessError,
16
+ sanitizeHarnessError
17
+ } from "./chunk-2NQ3JL7K.js";
16
18
  import {
17
19
  HarnessSandbox,
18
20
  HarnessSandboxSession,
@@ -32,6 +34,10 @@ import {
32
34
  import {
33
35
  defineAgent
34
36
  } from "./chunk-RRWJUHJG.js";
37
+ import {
38
+ createToolErrorPayload,
39
+ createToolErrorResult
40
+ } from "./chunk-NCSQEUQC.js";
35
41
  import {
36
42
  ContextReadyEvent,
37
43
  ErrorEvent,
@@ -41,7 +47,9 @@ import {
41
47
  ModeChangedEvent,
42
48
  ModelAfterEvent,
43
49
  ModelBeforeEvent,
50
+ RunAbortedEvent,
44
51
  RunEndEvent,
52
+ RunFailedEvent,
45
53
  RunStartEvent,
46
54
  SnapshotCreatedEvent,
47
55
  SnapshotDeletedEvent,
@@ -54,7 +62,7 @@ import {
54
62
  TurnEndEvent,
55
63
  TurnStartEvent,
56
64
  runtimeEventClasses
57
- } from "./chunk-JIJHGB6H.js";
65
+ } from "./chunk-3QOAFCCZ.js";
58
66
  import {
59
67
  ArraySchema,
60
68
  BooleanSchema,
@@ -93,7 +101,7 @@ import {
93
101
  systemRole,
94
102
  toolRole,
95
103
  userRole
96
- } from "./chunk-B4Q6CPYO.js";
104
+ } from "./chunk-TCHZYK5Y.js";
97
105
  export {
98
106
  AgentSessionRunner,
99
107
  ArraySchema,
@@ -140,7 +148,9 @@ export {
140
148
  OptionalSchema,
141
149
  RecordSchema,
142
150
  RoleTargets,
151
+ RunAbortedEvent,
143
152
  RunEndEvent,
153
+ RunFailedEvent,
144
154
  RunStartEvent,
145
155
  Schema,
146
156
  SchemaError,
@@ -163,13 +173,16 @@ export {
163
173
  createHarnessSession,
164
174
  createHarnessSessionStore,
165
175
  createToolErrorPayload,
176
+ createToolErrorResult,
166
177
  defineAgent,
167
178
  formatSchemaPath,
168
179
  modelProviderId,
180
+ normalizeHarnessError,
169
181
  normalizeSchema,
170
182
  parseModelRef,
171
183
  runtimeEventClasses,
172
184
  s,
185
+ sanitizeHarnessError,
173
186
  schemaIssuesFromError,
174
187
  systemRole,
175
188
  toolRole,
@@ -0,0 +1,23 @@
1
+ import { e as HarnessErrorShape } from './errors-hpkW3tfR.js';
2
+
3
+ interface ToolCallMetric {
4
+ name: string;
5
+ count: number;
6
+ errorCount: number;
7
+ totalDurationMs: number;
8
+ }
9
+ interface RunMetrics {
10
+ startedAt: string;
11
+ completedAt?: string;
12
+ durationMs: number;
13
+ turnCount: number;
14
+ messageCount: number;
15
+ eventCount: number;
16
+ toolCallCount: number;
17
+ finalMode?: string;
18
+ tools: Record<string, ToolCallMetric>;
19
+ errors: HarnessErrorShape[];
20
+ usage?: unknown;
21
+ }
22
+
23
+ export type { RunMetrics as R, ToolCallMetric as T };
@@ -1,9 +1,10 @@
1
- import { H as HarnessEvent, a as HarnessEventClass, b as HarnessEventEmitOptions, e as HarnessEventRecord, J as JsonObject } from './events-D4xcDi53.js';
2
- import { h as AgentMessage, v as AgentToolDefinition, w as AgentToolResult, M as ContextSnapshot, S as HarnessModeSelector, Q as HarnessMode, s as AgentSharedStateDefinition, a4 as ToolApprovalRequest, a2 as ToolApprovalDecision, q as AgentRuntimeLogger } from './context-BfpLqV11.js';
1
+ import { f as HarnessEvent, g as HarnessEventClass, h as HarnessEventEmitOptions, k as HarnessEventRecord, J as JsonObject, c as HarnessErrorPolicy } from './errors-hpkW3tfR.js';
2
+ import { h as AgentMessage, v as AgentToolDefinition, w as AgentToolResult, M as ContextSnapshot, a2 as HarnessModeSelector, a0 as HarnessMode, s as AgentSharedStateDefinition, ah as ToolApprovalRequest, af as ToolApprovalDecision, q as AgentRuntimeLogger } from './context-Bz9C_rL9.js';
3
3
  import { b as HarnessRoleDefinition, c as HarnessRoleSelector } from './role-BN6KhQxx.js';
4
4
  import { HarnessSandbox } from './runner/sandbox.js';
5
- import { h as RunMetrics, c as HarnessSessionStorage, H as HarnessRunStorage } from './storage-DCZE_hES.js';
6
- import { H as HarnessHook } from './hook-CfBbhUQf.js';
5
+ import { HarnessSessionStorage, HarnessRunStorage } from './runner/storage.js';
6
+ import { H as HarnessHook } from './hook-DD7uuzE3.js';
7
+ import { R as RunMetrics } from './metrics-DMN8bfY6.js';
7
8
 
8
9
  interface ModelProviderRunInput {
9
10
  runId: string;
@@ -114,6 +115,7 @@ interface AgentSessionRunnerOptions {
114
115
  resources?: JsonObject;
115
116
  approveTool?(request: ToolApprovalRequest): boolean | ToolApprovalDecision | Promise<boolean | ToolApprovalDecision>;
116
117
  logger?: AgentRuntimeLogger;
118
+ errorPolicy?: HarnessErrorPolicy;
117
119
  }
118
120
  interface AgentRunResult {
119
121
  runId: string;
@@ -1,9 +1,9 @@
1
- export { T as ToolApprovalHandle } from '../approval-D_G2w-fW.js';
2
- export { a2 as ToolApprovalDecision, a3 as ToolApprovalMode, a4 as ToolApprovalRequest } from '../context-BfpLqV11.js';
3
- import '../model-provider-Ch7tzk1x.js';
4
- import '../events-D4xcDi53.js';
1
+ export { T as ToolApprovalHandle } from '../approval-Ch0LwJFM.js';
2
+ export { af as ToolApprovalDecision, ag as ToolApprovalMode, ah as ToolApprovalRequest } from '../context-Bz9C_rL9.js';
3
+ import '../model-provider-DGkLQJWP.js';
4
+ import '../errors-hpkW3tfR.js';
5
5
  import '../role-BN6KhQxx.js';
6
6
  import './sandbox.js';
7
- import '../storage-DCZE_hES.js';
8
- import '../hook-CfBbhUQf.js';
9
- import '../types-BPmsw-mF.js';
7
+ import './storage.js';
8
+ import '../metrics-DMN8bfY6.js';
9
+ import '../hook-DD7uuzE3.js';
@@ -1,3 +1,4 @@
1
- export { H as HarnessEvent, a as HarnessEventClass, b as HarnessEventEmitOptions, d as HarnessEventQuery, e as HarnessEventRecord, f as HarnessEventSource } from '../events-D4xcDi53.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 RunEndEvent, f as RunStartEvent, S as SnapshotCreatedEvent, g as SnapshotDeletedEvent, h as SnapshotRestoredEvent, T as ToolApprovalRequestedEvent, i as ToolApprovalResolvedEvent, j as ToolEndEvent, k as ToolStartEvent, l as TranscriptCursorChangedEvent, m as TurnEndEvent, n as TurnStartEvent } from '../event-CKV4EeZ3.js';
1
+ export { f as HarnessEvent, g as HarnessEventClass, h as HarnessEventEmitOptions, 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';
@@ -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-JIJHGB6H.js";
24
+ } from "../chunk-3QOAFCCZ.js";
23
25
  import "../chunk-OBKS4AJR.js";
24
26
  import {
25
27
  HarnessEvent
26
- } from "../chunk-B4Q6CPYO.js";
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,
@@ -1,6 +1,10 @@
1
- import { g as HarnessLogSink, k as HarnessLoggingLevel, f as HarnessLogRecord, e as HarnessLogLevel } from '../types-BPmsw-mF.js';
2
- export { H as HarnessLog, a as HarnessLogCategory, b as HarnessLogClass, c as HarnessLogContext, d as HarnessLogError, h as HarnessLogSource, i as HarnessLogSourceKind, j as HarnessLoggingConfig, l as HarnessRedactionConfig } from '../types-BPmsw-mF.js';
3
- export { T as ToolErrorCode, a as ToolErrorPayload, b as ToolInvalidField } from '../tool-errors-CygY1Nba.js';
1
+ import { X as HarnessLogSink, $ as HarnessLoggingLevel, W as HarnessLogRecord, V as HarnessLogLevel } from '../context-Bz9C_rL9.js';
2
+ export { Q as HarnessLog, R as HarnessLogCategory, S as HarnessLogClass, T as HarnessLogContext, U as HarnessLogError, Y as HarnessLogSource, Z as HarnessLogSourceKind, _ as HarnessLoggingConfig, a4 as HarnessRedactionConfig } from '../context-Bz9C_rL9.js';
3
+ export { H as HarnessErrorCategory, a as HarnessErrorCode, b as HarnessErrorContext, c as HarnessErrorPolicy, d as HarnessErrorSeverity, e as HarnessErrorShape, m as HarnessRetryPolicy } from '../errors-hpkW3tfR.js';
4
+ export { n as normalizeHarnessError, s as sanitizeHarnessError } from '../errors-DHHy8V3O.js';
5
+ export { ToolErrorCode, ToolErrorPayload, ToolInvalidField, createToolErrorPayload, createToolErrorResult } from '../agent/tool.js';
6
+ import '../role-BN6KhQxx.js';
7
+ import './sandbox.js';
4
8
 
5
9
  interface ConsoleLogSinkOptions {
6
10
  format?: "pretty" | "json";
@@ -3,13 +3,23 @@ import {
3
3
  HarnessLog,
4
4
  HarnessLogSink,
5
5
  MemoryLogSink,
6
+ normalizeHarnessError,
7
+ sanitizeHarnessError,
6
8
  shouldWriteLog
7
- } from "../chunk-Q44U2CMM.js";
9
+ } from "../chunk-2NQ3JL7K.js";
10
+ import {
11
+ createToolErrorPayload,
12
+ createToolErrorResult
13
+ } from "../chunk-NCSQEUQC.js";
8
14
  export {
9
15
  ConsoleLogSink,
10
16
  HarnessLog,
11
17
  HarnessLogSink,
12
18
  MemoryLogSink,
19
+ createToolErrorPayload,
20
+ createToolErrorResult,
21
+ normalizeHarnessError,
22
+ sanitizeHarnessError,
13
23
  shouldWriteLog
14
24
  };
15
25
  //# sourceMappingURL=logging.js.map