@openpond/harness 0.2.6 → 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.
@@ -0,0 +1,198 @@
1
+ import { z } from "zod";
2
+ import { type ImmutableReleaseRef } from "./common.js";
3
+ import { type AgentSnapshot, type HarnessRelease } from "./harness.js";
4
+ export declare const MAX_HARNESS_SOURCE_PACKAGE_BYTES: number;
5
+ export declare const HarnessSourcePackageSchema: z.ZodObject<{
6
+ schemaVersion: z.ZodLiteral<"openpond.harnessSourcePackage.v1">;
7
+ agentSnapshot: z.ZodObject<{
8
+ schemaVersion: z.ZodLiteral<"openpond.agentSnapshot.v2">;
9
+ id: z.ZodString;
10
+ sourceRelease: z.ZodNullable<z.ZodObject<{
11
+ id: z.ZodString;
12
+ contentHash: z.ZodString;
13
+ }, z.core.$strict>>;
14
+ instructions: z.ZodArray<z.ZodObject<{
15
+ id: z.ZodString;
16
+ path: z.ZodString;
17
+ contentHash: z.ZodString;
18
+ sizeBytes: z.ZodNumber;
19
+ mediaType: z.ZodString;
20
+ visibility: z.ZodEnum<{
21
+ policy: "policy";
22
+ verifier: "verifier";
23
+ host_private: "host_private";
24
+ }>;
25
+ }, z.core.$strict>>;
26
+ skills: z.ZodArray<z.ZodObject<{
27
+ id: z.ZodString;
28
+ path: z.ZodString;
29
+ contentHash: z.ZodString;
30
+ sizeBytes: z.ZodNumber;
31
+ mediaType: z.ZodString;
32
+ visibility: z.ZodEnum<{
33
+ policy: "policy";
34
+ verifier: "verifier";
35
+ host_private: "host_private";
36
+ }>;
37
+ }, z.core.$strict>>;
38
+ agents: z.ZodArray<z.ZodObject<{
39
+ id: z.ZodString;
40
+ path: z.ZodString;
41
+ contentHash: z.ZodString;
42
+ sizeBytes: z.ZodNumber;
43
+ mediaType: z.ZodString;
44
+ visibility: z.ZodEnum<{
45
+ policy: "policy";
46
+ verifier: "verifier";
47
+ host_private: "host_private";
48
+ }>;
49
+ }, z.core.$strict>>;
50
+ toolDeclarations: z.ZodArray<z.ZodObject<{
51
+ name: z.ZodString;
52
+ description: z.ZodString;
53
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
54
+ inputSchemaHash: z.ZodString;
55
+ sideEffect: z.ZodEnum<{
56
+ read: "read";
57
+ write: "write";
58
+ }>;
59
+ timeoutMs: z.ZodNumber;
60
+ }, z.core.$strict>>;
61
+ capabilityRequirements: z.ZodArray<z.ZodObject<{
62
+ id: z.ZodString;
63
+ required: z.ZodBoolean;
64
+ scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
65
+ portability: z.ZodEnum<{
66
+ portable: "portable";
67
+ host_adapter: "host_adapter";
68
+ local_only: "local_only";
69
+ hosted_only: "hosted_only";
70
+ }>;
71
+ }, z.core.$strict>>;
72
+ dependencyLock: z.ZodObject<{
73
+ id: z.ZodString;
74
+ path: z.ZodString;
75
+ contentHash: z.ZodString;
76
+ sizeBytes: z.ZodNumber;
77
+ mediaType: z.ZodString;
78
+ visibility: z.ZodEnum<{
79
+ policy: "policy";
80
+ verifier: "verifier";
81
+ host_private: "host_private";
82
+ }>;
83
+ }, z.core.$strict>;
84
+ portability: z.ZodObject<{
85
+ portable: z.ZodBoolean;
86
+ blockers: z.ZodArray<z.ZodString>;
87
+ localOnlyAssetRefs: z.ZodArray<z.ZodString>;
88
+ hostPrivateAssetRefs: z.ZodArray<z.ZodString>;
89
+ }, z.core.$strict>;
90
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
91
+ contentHash: z.ZodString;
92
+ }, z.core.$strict>;
93
+ harnessRelease: z.ZodObject<{
94
+ schemaVersion: z.ZodLiteral<"openpond.harnessRelease.v2">;
95
+ id: z.ZodString;
96
+ agentSnapshot: z.ZodObject<{
97
+ id: z.ZodString;
98
+ contentHash: z.ZodString;
99
+ }, z.core.$strict>;
100
+ program: z.ZodObject<{
101
+ id: z.ZodString;
102
+ path: z.ZodString;
103
+ contentHash: z.ZodString;
104
+ sizeBytes: z.ZodNumber;
105
+ mediaType: z.ZodString;
106
+ visibility: z.ZodEnum<{
107
+ policy: "policy";
108
+ verifier: "verifier";
109
+ host_private: "host_private";
110
+ }>;
111
+ }, z.core.$strict>;
112
+ tools: z.ZodArray<z.ZodObject<{
113
+ name: z.ZodString;
114
+ description: z.ZodString;
115
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
116
+ inputSchemaHash: z.ZodString;
117
+ sideEffect: z.ZodEnum<{
118
+ read: "read";
119
+ write: "write";
120
+ }>;
121
+ timeoutMs: z.ZodNumber;
122
+ }, z.core.$strict>>;
123
+ lifecycle: z.ZodObject<{
124
+ create: z.ZodLiteral<true>;
125
+ reset: z.ZodLiteral<true>;
126
+ step: z.ZodLiteral<true>;
127
+ collect: z.ZodLiteral<true>;
128
+ destroy: z.ZodLiteral<true>;
129
+ resetScope: z.ZodEnum<{
130
+ task: "task";
131
+ attempt: "attempt";
132
+ }>;
133
+ }, z.core.$strict>;
134
+ graderInterface: z.ZodObject<{
135
+ visibleEvidence: z.ZodArray<z.ZodString>;
136
+ privilegedEvidence: z.ZodArray<z.ZodString>;
137
+ privateVerifierIsolation: z.ZodBoolean;
138
+ }, z.core.$strict>;
139
+ files: z.ZodArray<z.ZodObject<{
140
+ id: z.ZodString;
141
+ path: z.ZodString;
142
+ contentHash: z.ZodString;
143
+ sizeBytes: z.ZodNumber;
144
+ mediaType: z.ZodString;
145
+ visibility: z.ZodEnum<{
146
+ policy: "policy";
147
+ verifier: "verifier";
148
+ host_private: "host_private";
149
+ }>;
150
+ }, z.core.$strict>>;
151
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
152
+ contentHash: z.ZodString;
153
+ }, z.core.$strict>;
154
+ files: z.ZodArray<z.ZodObject<{
155
+ path: z.ZodString;
156
+ base64: z.ZodString;
157
+ }, z.core.$strict>>;
158
+ contentHash: z.ZodString;
159
+ }, z.core.$strict>;
160
+ export type HarnessSourcePackage = z.infer<typeof HarnessSourcePackageSchema>;
161
+ export declare const HarnessSourceSelectionSchema: z.ZodObject<{
162
+ schemaVersion: z.ZodLiteral<"openpond.harnessSourceSelection.v1">;
163
+ mode: z.ZodEnum<{
164
+ taskset_owned: "taskset_owned";
165
+ selected_release: "selected_release";
166
+ }>;
167
+ harnessRelease: z.ZodObject<{
168
+ id: z.ZodString;
169
+ contentHash: z.ZodString;
170
+ }, z.core.$strict>;
171
+ sourcePackageHash: z.ZodNullable<z.ZodString>;
172
+ }, z.core.$strict>;
173
+ export type HarnessSourceSelection = z.infer<typeof HarnessSourceSelectionSchema>;
174
+ /** Resolve the source selected by a captured bundle; missing source cannot be
175
+ * interpreted as Taskset-owned execution when the bundle selected a release. */
176
+ export declare function resolveHarnessSourceSelection(input: {
177
+ selection: unknown;
178
+ sourcePackage?: unknown;
179
+ expectedRelease: ImmutableReleaseRef;
180
+ }): {
181
+ selection: HarnessSourceSelection;
182
+ sourcePackage: HarnessSourcePackage | null;
183
+ };
184
+ /** Capture the full released source. Runtime admission separately authorizes
185
+ * export and capabilities; a source package never makes private files visible
186
+ * to a policy merely by transporting them. */
187
+ export declare function createHarnessSourcePackage(input: {
188
+ agentSnapshot: AgentSnapshot;
189
+ harnessRelease: HarnessRelease;
190
+ files: ReadonlyMap<string, Uint8Array>;
191
+ }): HarnessSourcePackage;
192
+ /** Validate both release objects, their complete asset closure and exact bytes.
193
+ * Rehashing the outer package cannot bless a substituted instruction or file. */
194
+ export declare function validateHarnessSourcePackage(value: unknown, expected?: ImmutableReleaseRef): HarnessSourcePackage;
195
+ /** Return an owned byte snapshot, including visibility in the release inventory.
196
+ * A runtime must select policy assets explicitly rather than expose this map. */
197
+ export declare function harnessSourcePackageFiles(value: unknown, expected?: ImmutableReleaseRef): ReadonlyMap<string, Uint8Array>;
198
+ //# sourceMappingURL=source-package.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-package.d.ts","sourceRoot":"","sources":["../../../../src/source-package.ts"],"names":[],"mappings":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,CA8CjH;AAED;iFACiF;AACjF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,mBAAmB,GAAG,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAGzH"}
@@ -0,0 +1,114 @@
1
+ import { type ImmutableReleaseRef } from "./common.js";
2
+ export declare const HARNESS_SOURCE_READ_TOOL_NAME = "harness_read_file";
3
+ export declare const HARNESS_SOURCE_READ_TOOL: {
4
+ type: "function";
5
+ function: {
6
+ name: string;
7
+ description: string;
8
+ parameters: {
9
+ type: string;
10
+ properties: {
11
+ path: {
12
+ type: string;
13
+ };
14
+ offset: {
15
+ type: string;
16
+ minimum: number;
17
+ };
18
+ length: {
19
+ type: string;
20
+ minimum: number;
21
+ maximum: number;
22
+ };
23
+ };
24
+ required: string[];
25
+ additionalProperties: boolean;
26
+ };
27
+ };
28
+ };
29
+ type RuntimeTool = {
30
+ name: string;
31
+ inputSchema: Record<string, unknown>;
32
+ definition: Record<string, unknown>;
33
+ };
34
+ /** Compile released instructions and Skills into an admitted context. Resource
35
+ * reads use the captured package, never the current workspace or channel. */
36
+ export declare function createHarnessSourceRuntime(input: {
37
+ sourcePackage: unknown;
38
+ expectedRelease: ImmutableReleaseRef;
39
+ baseSystemPrompt: string;
40
+ runtimeId: string;
41
+ tools: RuntimeTool[];
42
+ capabilities?: Array<{
43
+ id: string;
44
+ scopes: string[];
45
+ }>;
46
+ dependencies?: Record<string, string>;
47
+ maxContextCharacters: number;
48
+ }): {
49
+ systemPrompt: string;
50
+ tools: {
51
+ type: "function";
52
+ function: {
53
+ name: string;
54
+ description: string;
55
+ parameters: {
56
+ type: string;
57
+ properties: {
58
+ path: {
59
+ type: string;
60
+ };
61
+ offset: {
62
+ type: string;
63
+ minimum: number;
64
+ };
65
+ length: {
66
+ type: string;
67
+ minimum: number;
68
+ maximum: number;
69
+ };
70
+ };
71
+ required: string[];
72
+ additionalProperties: boolean;
73
+ };
74
+ };
75
+ }[];
76
+ receipt: {
77
+ contentHash: string;
78
+ schemaVersion: "openpond.harnessSourceRuntimeReceipt.v1";
79
+ runtimeId: string;
80
+ harnessRelease: {
81
+ id: string;
82
+ contentHash: string;
83
+ };
84
+ sourcePackageHash: string;
85
+ systemPromptHash: string;
86
+ instructionAssets: {
87
+ path: string;
88
+ contentHash: string;
89
+ }[];
90
+ skillAssets: {
91
+ path: string;
92
+ contentHash: string;
93
+ }[];
94
+ readableAssets: {
95
+ path: string;
96
+ contentHash: string;
97
+ }[];
98
+ toolContractHash: string;
99
+ omittedCapabilities: string[];
100
+ };
101
+ readFile(value: unknown): {
102
+ path: string;
103
+ contentHash: string;
104
+ mediaType: string;
105
+ sizeBytes: number;
106
+ offset: number;
107
+ nextOffset: number;
108
+ eof: boolean;
109
+ encoding: "base64" | "utf8";
110
+ content: string;
111
+ };
112
+ };
113
+ export {};
114
+ //# sourceMappingURL=source-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-runtime.d.ts","sourceRoot":"","sources":["../../../../src/source-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGpE,eAAO,MAAM,6BAA6B,sBAAsB,CAAC;AAOjE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;CAYpC,CAAC;AAEF,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC;AAE/G;6EAC6E;AAC7E,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,mBAAmB,CAAC;IACrC,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,oBAAoB,EAAE,MAAM,CAAC;CAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAkEmB,OAAO;;;;;;;;;;;EAgB1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpond/harness",
3
- "version": "0.2.6",
3
+ "version": "0.3.0",
4
4
  "description": "Portable immutable Harness releases, workspaces, improvements, traces, tools, and model identities for OpenPond",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -58,6 +58,10 @@
58
58
  "types": "./dist/types/tools.d.ts",
59
59
  "import": "./dist/tools.js"
60
60
  },
61
+ "./runtime-source": {
62
+ "types": "./dist/types/runtime-source.d.ts",
63
+ "import": "./dist/runtime-source.js"
64
+ },
61
65
  "./package.json": "./package.json"
62
66
  },
63
67
  "publishConfig": {
@@ -90,6 +94,7 @@
90
94
  },
91
95
  "devDependencies": {
92
96
  "@types/node": "24.13.3",
97
+ "esbuild": "0.28.1",
93
98
  "tsx": "4.23.1",
94
99
  "typescript": "^5.9.3",
95
100
  "vitest": "4.1.10"