@harness-kernel/core 0.1.1 → 0.2.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 (46) hide show
  1. package/dist/agent/context.d.ts +1 -1
  2. package/dist/agent/context.js +1 -1
  3. package/dist/agent/event.js +2 -2
  4. package/dist/agent/hook.d.ts +2 -2
  5. package/dist/agent/hook.js +1 -1
  6. package/dist/agent/mode.d.ts +1 -1
  7. package/dist/agent/mode.js +1 -1
  8. package/dist/agent/role.js +1 -1
  9. package/dist/agent/session.d.ts +1 -1
  10. package/dist/agent/session.js +1 -1
  11. package/dist/agent/tool.d.ts +1 -1
  12. package/dist/agent/tool.js +1 -1
  13. package/dist/agent.d.ts +4 -4
  14. package/dist/{approval-DfvjpbFs.d.ts → approval-D_G2w-fW.d.ts} +10 -14
  15. package/dist/{chunk-4WWSQAWA.js → chunk-37PIMSLG.js} +192 -75
  16. package/dist/chunk-37PIMSLG.js.map +1 -0
  17. package/dist/{chunk-4A2P4QU5.js → chunk-B4Q6CPYO.js} +2 -1
  18. package/dist/chunk-B4Q6CPYO.js.map +1 -0
  19. package/dist/{chunk-4SYLFKIX.js → chunk-JIJHGB6H.js} +2 -2
  20. package/dist/chunk-ONYDIU4X.js +284 -0
  21. package/dist/chunk-ONYDIU4X.js.map +1 -0
  22. package/dist/{chunk-AD3BCYWU.js → chunk-ZU6ADDET.js} +1 -1
  23. package/dist/chunk-ZU6ADDET.js.map +1 -0
  24. package/dist/{context-75mlon5x.d.ts → context-BfpLqV11.d.ts} +5 -3
  25. package/dist/{hook-DMb9fw9Z.d.ts → hook-CfBbhUQf.d.ts} +1 -1
  26. package/dist/index.d.ts +13 -11
  27. package/dist/index.js +9 -5
  28. package/dist/{model-provider-BrZ2RRmS.d.ts → model-provider-Ch7tzk1x.d.ts} +6 -8
  29. package/dist/runner/approval.d.ts +5 -5
  30. package/dist/runner/event.js +2 -2
  31. package/dist/runner/model-provider.d.ts +4 -4
  32. package/dist/runner/sandbox.d.ts +1 -1
  33. package/dist/runner/sandbox.js +1 -1
  34. package/dist/runner/storage.d.ts +2 -2
  35. package/dist/runner/storage.js +5 -1
  36. package/dist/{runner-Dxo7ALtp.d.ts → runner-BzEf0lAV.d.ts} +15 -9
  37. package/dist/runner.d.ts +6 -6
  38. package/dist/runner.js +5 -5
  39. package/dist/{storage-BmOEwW-p.d.ts → storage-DCZE_hES.d.ts} +84 -2
  40. package/package.json +2 -2
  41. package/dist/chunk-4A2P4QU5.js.map +0 -1
  42. package/dist/chunk-4WWSQAWA.js.map +0 -1
  43. package/dist/chunk-AD3BCYWU.js.map +0 -1
  44. package/dist/chunk-AZVA22HW.js +0 -135
  45. package/dist/chunk-AZVA22HW.js.map +0 -1
  46. /package/dist/{chunk-4SYLFKIX.js.map → chunk-JIJHGB6H.js.map} +0 -0
@@ -1,5 +1,5 @@
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-75mlon5x.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-BfpLqV11.js';
3
3
  import '../events-D4xcDi53.js';
4
4
  import '../types-BPmsw-mF.js';
5
5
  import '../runner/sandbox.js';
@@ -2,7 +2,7 @@ import {
2
2
  ContextConsume,
3
3
  ContextScopes,
4
4
  HarnessContextProvider
5
- } from "../chunk-4A2P4QU5.js";
5
+ } from "../chunk-B4Q6CPYO.js";
6
6
  export {
7
7
  ContextConsume,
8
8
  ContextScopes,
@@ -19,11 +19,11 @@ import {
19
19
  TranscriptCursorChangedEvent,
20
20
  TurnEndEvent,
21
21
  TurnStartEvent
22
- } from "../chunk-4SYLFKIX.js";
22
+ } from "../chunk-JIJHGB6H.js";
23
23
  import "../chunk-OBKS4AJR.js";
24
24
  import {
25
25
  HarnessEvent
26
- } from "../chunk-4A2P4QU5.js";
26
+ } from "../chunk-B4Q6CPYO.js";
27
27
  export {
28
28
  ContextReadyEvent,
29
29
  ErrorEvent,
@@ -1,6 +1,6 @@
1
1
  export { H as HarnessEvent, a as HarnessEventClass } from '../events-D4xcDi53.js';
2
- export { H as HarnessHook, a as HarnessHookEventClass } from '../hook-DMb9fw9Z.js';
3
- import '../context-75mlon5x.js';
2
+ export { H as HarnessHook, a as HarnessHookEventClass } from '../hook-CfBbhUQf.js';
3
+ import '../context-BfpLqV11.js';
4
4
  import '../role-BN6KhQxx.js';
5
5
  import '../types-BPmsw-mF.js';
6
6
  import '../runner/sandbox.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HarnessHook
3
- } from "../chunk-4A2P4QU5.js";
3
+ } from "../chunk-B4Q6CPYO.js";
4
4
  export {
5
5
  HarnessHook
6
6
  };
@@ -1,4 +1,4 @@
1
- export { m as AgentModeDefinition, H as ContextProviderReference, Q as HarnessMode, R as HarnessModeClass, S as HarnessModeSelector, T as HarnessModeSummary, a3 as ToolApprovalMode } from '../context-75mlon5x.js';
1
+ export { m as AgentModeDefinition, H as ContextProviderReference, Q as HarnessMode, R as HarnessModeClass, S as HarnessModeSelector, T as HarnessModeSummary, a3 as ToolApprovalMode } from '../context-BfpLqV11.js';
2
2
  import '../role-BN6KhQxx.js';
3
3
  import '../events-D4xcDi53.js';
4
4
  import '../types-BPmsw-mF.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HarnessMode
3
- } from "../chunk-4A2P4QU5.js";
3
+ } from "../chunk-B4Q6CPYO.js";
4
4
  export {
5
5
  HarnessMode
6
6
  };
@@ -10,7 +10,7 @@ import {
10
10
  systemRole,
11
11
  toolRole,
12
12
  userRole
13
- } from "../chunk-4A2P4QU5.js";
13
+ } from "../chunk-B4Q6CPYO.js";
14
14
  export {
15
15
  AssistantRole,
16
16
  HarnessRole,
@@ -1,5 +1,5 @@
1
1
  export { E as EventCursor, d as HarnessEventQuery, e as HarnessEventRecord } from '../events-D4xcDi53.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, T as HarnessModeSummary, U as HarnessSnapshot, V as HarnessSnapshotCreator, W as HarnessSnapshotInput, X as HarnessSnapshotSession, Y as HarnessSnapshotSummary, a0 as HarnessTranscriptSession, aa as TranscriptBranch, ab as TranscriptCursor, ac as TranscriptQuery, ad as TranscriptSeekTarget } from '../context-75mlon5x.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, T as HarnessModeSummary, U as HarnessSnapshot, V as HarnessSnapshotCreator, W as HarnessSnapshotInput, X as HarnessSnapshotSession, Y as HarnessSnapshotSummary, a0 as HarnessTranscriptSession, aa as TranscriptBranch, ab as TranscriptCursor, ac as TranscriptQuery, ad as TranscriptSeekTarget } from '../context-BfpLqV11.js';
3
3
  export { c as HarnessRoleSelector, N as NativeRoles, R as RoleTargets } from '../role-BN6KhQxx.js';
4
4
  export { T as ToolErrorCode, a as ToolErrorPayload, b as ToolInvalidField } from '../tool-errors-CygY1Nba.js';
5
5
  import '../types-BPmsw-mF.js';
@@ -3,7 +3,7 @@ import {
3
3
  ContextScopes,
4
4
  NativeRoles,
5
5
  RoleTargets
6
- } from "../chunk-4A2P4QU5.js";
6
+ } from "../chunk-B4Q6CPYO.js";
7
7
  export {
8
8
  ContextConsume,
9
9
  ContextScopes,
@@ -1,4 +1,4 @@
1
- export { v as AgentToolDefinition, w as AgentToolResult, y as AgentToolSource, Z as HarnessTool, _ as HarnessToolClass, $ as HarnessToolSelector, a5 as ToolApprovalResolver, a6 as ToolCatalogEntry, a7 as ToolPermission, a8 as ToolRef, a9 as ToolRisk } from '../context-75mlon5x.js';
1
+ export { v as AgentToolDefinition, w as AgentToolResult, y as AgentToolSource, Z as HarnessTool, _ as HarnessToolClass, $ as HarnessToolSelector, a5 as ToolApprovalResolver, a6 as ToolCatalogEntry, a7 as ToolPermission, a8 as ToolRef, a9 as ToolRisk } from '../context-BfpLqV11.js';
2
2
  import '../role-BN6KhQxx.js';
3
3
  import '../events-D4xcDi53.js';
4
4
  import '../types-BPmsw-mF.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HarnessTool
3
- } from "../chunk-4A2P4QU5.js";
3
+ } from "../chunk-B4Q6CPYO.js";
4
4
  export {
5
5
  HarnessTool
6
6
  };
package/dist/agent.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { A as AgentDefinition } from './model-provider-BrZ2RRmS.js';
1
+ import { A as AgentDefinition } from './model-provider-Ch7tzk1x.js';
2
2
  export { J as JsonObject } from './events-D4xcDi53.js';
3
- export { r as AgentSharedState, s as AgentSharedStateDefinition } from './context-75mlon5x.js';
3
+ export { r as AgentSharedState, s as AgentSharedStateDefinition } from './context-BfpLqV11.js';
4
4
  import './role-BN6KhQxx.js';
5
5
  import './runner/sandbox.js';
6
- import './storage-BmOEwW-p.js';
7
- import './hook-DMb9fw9Z.js';
6
+ import './storage-DCZE_hES.js';
7
+ import './hook-CfBbhUQf.js';
8
8
  import './types-BPmsw-mF.js';
9
9
 
10
10
  declare function defineAgent(definition: AgentDefinition): AgentDefinition;
@@ -1,10 +1,10 @@
1
- import { A as AgentDefinition, H as HarnessModelProvider, e as ModelProviderInfo } from './model-provider-BrZ2RRmS.js';
1
+ import { A as AgentDefinition, H as HarnessModelProvider, e as ModelProviderInfo } from './model-provider-Ch7tzk1x.js';
2
2
  import { j as HarnessLoggingConfig } from './types-BPmsw-mF.js';
3
3
  import { e as HarnessEventRecord, a as HarnessEventClass, d as HarnessEventQuery, H as HarnessEvent } from './events-D4xcDi53.js';
4
- import { T as HarnessModeSummary, J as ContextProviderSummary, a6 as ToolCatalogEntry, S as HarnessModeSelector, a3 as ToolApprovalMode, h as AgentMessage, a9 as ToolRisk, a7 as ToolPermission, w as AgentToolResult, r as AgentSharedState, a0 as HarnessTranscriptSession, X as HarnessSnapshotSession, M as ContextSnapshot } from './context-75mlon5x.js';
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';
5
5
  import { d as HarnessRoleSummary, c as HarnessRoleSelector } from './role-BN6KhQxx.js';
6
- import { H as HarnessRunStorage, d as RunMetrics } from './storage-BmOEwW-p.js';
7
- import { b as HarnessHookSummary } from './hook-DMb9fw9Z.js';
6
+ import { c as HarnessSessionStorage, h as RunMetrics, S as SessionListQuery, i as SessionListResult } from './storage-DCZE_hES.js';
7
+ import { b as HarnessHookSummary } from './hook-CfBbhUQf.js';
8
8
  import { HarnessSandbox } from './runner/sandbox.js';
9
9
 
10
10
  interface HarnessEventSummary {
@@ -30,21 +30,15 @@ interface HarnessAgentManifest {
30
30
  type HarnessAgentInput = {
31
31
  definition: AgentDefinition;
32
32
  };
33
- type HarnessStorageConfig = HarnessRunStorage;
33
+ type HarnessStorageConfig = HarnessSessionStorage;
34
34
  interface HarnessAppConfig {
35
35
  agent: HarnessAgentInput;
36
36
  providers: HarnessModelProvider[];
37
37
  defaultModel: string;
38
- workDir?: string;
39
38
  storage?: HarnessStorageConfig;
40
39
  sandbox?: HarnessSandbox;
41
- initialMode?: HarnessModeSelector | string;
42
- toolApproval?: ToolApprovalMode;
43
- maxTurns?: number;
44
- services?: Record<string, unknown>;
40
+ resources?: Record<string, unknown>;
45
41
  logging?: HarnessLoggingConfig;
46
- sessionTtlMs?: number;
47
- toolApprovalTimeoutMs?: number;
48
42
  }
49
43
  interface HarnessUserInput {
50
44
  id?: string;
@@ -231,9 +225,11 @@ type HarnessSessionStoreListener = (event: HarnessSessionStoreEvent) => void | P
231
225
  interface HarnessSessionStore {
232
226
  getOrCreate(sessionId?: string, overrides?: Partial<HarnessAppConfig>): Promise<HarnessSession>;
233
227
  get(sessionId: string): HarnessSession | undefined;
234
- list(): HarnessSessionStatus[];
228
+ list(query?: SessionListQuery): Promise<SessionListResult>;
229
+ close(sessionId: string): Promise<boolean>;
235
230
  delete(sessionId: string): Promise<boolean>;
236
- clear(): Promise<void>;
231
+ clearActive(): Promise<void>;
232
+ closeAll(): Promise<void>;
237
233
  send(sessionId: string | undefined, input: string | HarnessUserInput, options?: SendOptions): Promise<SendResult>;
238
234
  stream(sessionId: string | undefined, input: string | HarnessUserInput, options?: StreamOptions): Promise<HarnessRunStream>;
239
235
  getPendingApprovals(sessionId?: string): ToolApprovalHandle[];