@openpond/harness 0.1.0 → 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.
- package/CONTRACT.md +17 -7
- package/README.md +22 -3
- package/RELEASING.md +3 -6
- package/dist/evaluation-review.js +563 -0
- package/dist/harness-workspaces.js +1 -0
- package/dist/index.js +4 -0
- package/dist/refiner-detection.js +482 -0
- package/dist/refiner-support.js +105 -0
- package/dist/refiner.js +354 -0
- package/dist/types/evaluation-review.d.ts +583 -0
- package/dist/types/evaluation-review.d.ts.map +1 -0
- package/dist/types/harness-improvements.d.ts +18 -18
- package/dist/types/harness-workspaces.d.ts +26 -25
- package/dist/types/harness-workspaces.d.ts.map +1 -1
- package/dist/types/harness.d.ts +2 -2
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/refiner-detection.d.ts +37 -0
- package/dist/types/refiner-detection.d.ts.map +1 -0
- package/dist/types/refiner-support.d.ts +33 -0
- package/dist/types/refiner-support.d.ts.map +1 -0
- package/dist/types/refiner.d.ts +220 -0
- package/dist/types/refiner.d.ts.map +1 -0
- package/package.json +17 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export type HarnessRefinerMessage = {
|
|
3
|
+
role: "system" | "user" | "assistant";
|
|
4
|
+
content: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const LocalHarnessRefinerDecisionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
+
schemaVersion: z.ZodLiteral<"openpond.localHarnessRefinerDecision.v1">;
|
|
8
|
+
decision: z.ZodLiteral<"no_action">;
|
|
9
|
+
reason: z.ZodString;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
schemaVersion: z.ZodLiteral<"openpond.localHarnessRefinerDecision.v1">;
|
|
12
|
+
decision: z.ZodLiteral<"route">;
|
|
13
|
+
route: z.ZodEnum<{
|
|
14
|
+
runtime: "runtime";
|
|
15
|
+
product: "product";
|
|
16
|
+
taskset: "taskset";
|
|
17
|
+
training: "training";
|
|
18
|
+
}>;
|
|
19
|
+
summary: z.ZodString;
|
|
20
|
+
expectedOutcome: z.ZodString;
|
|
21
|
+
reason: z.ZodString;
|
|
22
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
+
schemaVersion: z.ZodLiteral<"openpond.localHarnessRefinerDecision.v1">;
|
|
24
|
+
decision: z.ZodLiteral<"propose">;
|
|
25
|
+
route: z.ZodEnum<{
|
|
26
|
+
memory: "memory";
|
|
27
|
+
prompt: "prompt";
|
|
28
|
+
skill: "skill";
|
|
29
|
+
agent: "agent";
|
|
30
|
+
}>;
|
|
31
|
+
operation: z.ZodEnum<{
|
|
32
|
+
create: "create";
|
|
33
|
+
update: "update";
|
|
34
|
+
delete: "delete";
|
|
35
|
+
}>;
|
|
36
|
+
target: z.ZodString;
|
|
37
|
+
summary: z.ZodString;
|
|
38
|
+
createContent: z.ZodNullable<z.ZodString>;
|
|
39
|
+
find: z.ZodNullable<z.ZodString>;
|
|
40
|
+
replace: z.ZodNullable<z.ZodString>;
|
|
41
|
+
expectedOutcome: z.ZodString;
|
|
42
|
+
reason: z.ZodString;
|
|
43
|
+
}, z.core.$strip>], "decision">;
|
|
44
|
+
export type LocalHarnessRefinerDecision = z.infer<typeof LocalHarnessRefinerDecisionSchema>;
|
|
45
|
+
export declare const LocalHarnessRefinerEvidenceSchema: z.ZodObject<{
|
|
46
|
+
trigger: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
47
|
+
observations: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
48
|
+
task: z.ZodObject<{
|
|
49
|
+
prompt: z.ZodNullable<z.ZodString>;
|
|
50
|
+
assistantOutput: z.ZodNullable<z.ZodString>;
|
|
51
|
+
assistantOutputLinkCount: z.ZodNumber;
|
|
52
|
+
previousAssistantOutput: z.ZodNullable<z.ZodString>;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
eventExcerpts: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
55
|
+
artifactDiagnostics: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
56
|
+
sourceFiles: z.ZodArray<z.ZodObject<{
|
|
57
|
+
path: z.ZodString;
|
|
58
|
+
kind: z.ZodEnum<{
|
|
59
|
+
memory: "memory";
|
|
60
|
+
skill: "skill";
|
|
61
|
+
agent: "agent";
|
|
62
|
+
instruction: "instruction";
|
|
63
|
+
}>;
|
|
64
|
+
content: z.ZodString;
|
|
65
|
+
loaded: z.ZodBoolean;
|
|
66
|
+
}, z.core.$strict>>;
|
|
67
|
+
sourceCatalog: z.ZodArray<z.ZodObject<{
|
|
68
|
+
path: z.ZodString;
|
|
69
|
+
kind: z.ZodEnum<{
|
|
70
|
+
memory: "memory";
|
|
71
|
+
skill: "skill";
|
|
72
|
+
agent: "agent";
|
|
73
|
+
instruction: "instruction";
|
|
74
|
+
}>;
|
|
75
|
+
loaded: z.ZodBoolean;
|
|
76
|
+
}, z.core.$strict>>;
|
|
77
|
+
}, z.core.$strict>;
|
|
78
|
+
export type LocalHarnessRefinerEvidence = z.infer<typeof LocalHarnessRefinerEvidenceSchema>;
|
|
79
|
+
export type LocalHarnessRefinerModelStream = (input: {
|
|
80
|
+
messages: HarnessRefinerMessage[];
|
|
81
|
+
signal: AbortSignal;
|
|
82
|
+
}) => AsyncIterable<{
|
|
83
|
+
text?: string;
|
|
84
|
+
}>;
|
|
85
|
+
export declare const DEFAULT_REFINER_TIMEOUT_MS = 60000;
|
|
86
|
+
export declare const DEFAULT_REFINER_MAX_OUTPUT_TOKENS = 1200;
|
|
87
|
+
export declare function authorLocalHarnessRefinementWithModel(input: {
|
|
88
|
+
evidence: LocalHarnessRefinerEvidence;
|
|
89
|
+
stream: LocalHarnessRefinerModelStream;
|
|
90
|
+
signal: AbortSignal;
|
|
91
|
+
timeoutMs?: number;
|
|
92
|
+
}): Promise<LocalHarnessRefinerDecision>;
|
|
93
|
+
export declare function refinerMessages(evidence: LocalHarnessRefinerEvidence): HarnessRefinerMessage[];
|
|
94
|
+
export declare const HostedHarnessRefinerRequestSchema: z.ZodObject<{
|
|
95
|
+
schemaVersion: z.ZodLiteral<"openpond.hostedHarnessRefinerRequest.v1">;
|
|
96
|
+
requestId: z.ZodString;
|
|
97
|
+
idempotencyKey: z.ZodString;
|
|
98
|
+
evidenceHash: z.ZodString;
|
|
99
|
+
harness: z.ZodObject<{
|
|
100
|
+
admittedRelease: z.ZodObject<{
|
|
101
|
+
id: z.ZodString;
|
|
102
|
+
contentHash: z.ZodString;
|
|
103
|
+
}, z.core.$strict>;
|
|
104
|
+
currentRelease: z.ZodObject<{
|
|
105
|
+
id: z.ZodString;
|
|
106
|
+
contentHash: z.ZodString;
|
|
107
|
+
}, z.core.$strict>;
|
|
108
|
+
overlay: z.ZodObject<{
|
|
109
|
+
id: z.ZodString;
|
|
110
|
+
revision: z.ZodNumber;
|
|
111
|
+
contentHash: z.ZodString;
|
|
112
|
+
}, z.core.$strict>;
|
|
113
|
+
workspace: z.ZodObject<{
|
|
114
|
+
id: z.ZodString;
|
|
115
|
+
revision: z.ZodNumber;
|
|
116
|
+
sourceRevision: z.ZodString;
|
|
117
|
+
channelRevision: z.ZodNumber;
|
|
118
|
+
}, z.core.$strict>;
|
|
119
|
+
capabilities: z.ZodObject<{
|
|
120
|
+
memory: z.ZodBoolean;
|
|
121
|
+
prompt: z.ZodBoolean;
|
|
122
|
+
skill: z.ZodBoolean;
|
|
123
|
+
agent: z.ZodBoolean;
|
|
124
|
+
}, z.core.$strict>;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
evidence: z.ZodObject<{
|
|
127
|
+
trigger: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
128
|
+
observations: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
129
|
+
task: z.ZodObject<{
|
|
130
|
+
prompt: z.ZodNullable<z.ZodString>;
|
|
131
|
+
assistantOutput: z.ZodNullable<z.ZodString>;
|
|
132
|
+
assistantOutputLinkCount: z.ZodNumber;
|
|
133
|
+
previousAssistantOutput: z.ZodNullable<z.ZodString>;
|
|
134
|
+
}, z.core.$strict>;
|
|
135
|
+
eventExcerpts: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
136
|
+
artifactDiagnostics: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
137
|
+
sourceFiles: z.ZodArray<z.ZodObject<{
|
|
138
|
+
path: z.ZodString;
|
|
139
|
+
kind: z.ZodEnum<{
|
|
140
|
+
memory: "memory";
|
|
141
|
+
skill: "skill";
|
|
142
|
+
agent: "agent";
|
|
143
|
+
instruction: "instruction";
|
|
144
|
+
}>;
|
|
145
|
+
content: z.ZodString;
|
|
146
|
+
loaded: z.ZodBoolean;
|
|
147
|
+
}, z.core.$strict>>;
|
|
148
|
+
sourceCatalog: z.ZodArray<z.ZodObject<{
|
|
149
|
+
path: z.ZodString;
|
|
150
|
+
kind: z.ZodEnum<{
|
|
151
|
+
memory: "memory";
|
|
152
|
+
skill: "skill";
|
|
153
|
+
agent: "agent";
|
|
154
|
+
instruction: "instruction";
|
|
155
|
+
}>;
|
|
156
|
+
loaded: z.ZodBoolean;
|
|
157
|
+
}, z.core.$strict>>;
|
|
158
|
+
}, z.core.$strict>;
|
|
159
|
+
}, z.core.$strict>;
|
|
160
|
+
export type HostedHarnessRefinerRequest = z.infer<typeof HostedHarnessRefinerRequestSchema>;
|
|
161
|
+
export declare const HostedHarnessRefinerResponseSchema: z.ZodObject<{
|
|
162
|
+
schemaVersion: z.ZodLiteral<"openpond.hostedHarnessRefinerResponse.v1">;
|
|
163
|
+
requestId: z.ZodString;
|
|
164
|
+
evidenceHash: z.ZodString;
|
|
165
|
+
admittedRelease: z.ZodObject<{
|
|
166
|
+
id: z.ZodString;
|
|
167
|
+
contentHash: z.ZodString;
|
|
168
|
+
}, z.core.$strict>;
|
|
169
|
+
currentRelease: z.ZodObject<{
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
contentHash: z.ZodString;
|
|
172
|
+
}, z.core.$strict>;
|
|
173
|
+
decision: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
174
|
+
schemaVersion: z.ZodLiteral<"openpond.localHarnessRefinerDecision.v1">;
|
|
175
|
+
decision: z.ZodLiteral<"no_action">;
|
|
176
|
+
reason: z.ZodString;
|
|
177
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
178
|
+
schemaVersion: z.ZodLiteral<"openpond.localHarnessRefinerDecision.v1">;
|
|
179
|
+
decision: z.ZodLiteral<"route">;
|
|
180
|
+
route: z.ZodEnum<{
|
|
181
|
+
runtime: "runtime";
|
|
182
|
+
product: "product";
|
|
183
|
+
taskset: "taskset";
|
|
184
|
+
training: "training";
|
|
185
|
+
}>;
|
|
186
|
+
summary: z.ZodString;
|
|
187
|
+
expectedOutcome: z.ZodString;
|
|
188
|
+
reason: z.ZodString;
|
|
189
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
190
|
+
schemaVersion: z.ZodLiteral<"openpond.localHarnessRefinerDecision.v1">;
|
|
191
|
+
decision: z.ZodLiteral<"propose">;
|
|
192
|
+
route: z.ZodEnum<{
|
|
193
|
+
memory: "memory";
|
|
194
|
+
prompt: "prompt";
|
|
195
|
+
skill: "skill";
|
|
196
|
+
agent: "agent";
|
|
197
|
+
}>;
|
|
198
|
+
operation: z.ZodEnum<{
|
|
199
|
+
create: "create";
|
|
200
|
+
update: "update";
|
|
201
|
+
delete: "delete";
|
|
202
|
+
}>;
|
|
203
|
+
target: z.ZodString;
|
|
204
|
+
summary: z.ZodString;
|
|
205
|
+
createContent: z.ZodNullable<z.ZodString>;
|
|
206
|
+
find: z.ZodNullable<z.ZodString>;
|
|
207
|
+
replace: z.ZodNullable<z.ZodString>;
|
|
208
|
+
expectedOutcome: z.ZodString;
|
|
209
|
+
reason: z.ZodString;
|
|
210
|
+
}, z.core.$strip>], "decision">;
|
|
211
|
+
serviceRevision: z.ZodString;
|
|
212
|
+
usage: z.ZodObject<{
|
|
213
|
+
promptTokens: z.ZodNumber;
|
|
214
|
+
completionTokens: z.ZodNumber;
|
|
215
|
+
totalTokens: z.ZodNumber;
|
|
216
|
+
}, z.core.$strict>;
|
|
217
|
+
}, z.core.$strict>;
|
|
218
|
+
export type HostedHarnessRefinerResponse = z.infer<typeof HostedHarnessRefinerResponseSchema>;
|
|
219
|
+
export declare const DEFAULT_HOSTED_REFINER_TIMEOUT_MS = 60000;
|
|
220
|
+
//# sourceMappingURL=refiner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refiner.d.ts","sourceRoot":"","sources":["../../../../src/refiner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAqEF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAI5C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,iCAAiC,CACzC,CAAC;AAIF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAsCnC,CAAC;AAEZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,iCAAiC,CACzC,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE;IACnD,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,MAAM,EAAE,WAAW,CAAC;CACrB,KAAK,aAAa,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEvC,eAAO,MAAM,0BAA0B,QAAS,CAAC;AACjD,eAAO,MAAM,iCAAiC,OAAQ,CAAC;AAGvD,wBAAsB,qCAAqC,CAAC,KAAK,EAAE;IACjE,QAAQ,EAAE,2BAA2B,CAAC;IACtC,MAAM,EAAE,8BAA8B,CAAC;IACvC,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAwCvC;AAsCD,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,2BAA2B,GACpC,qBAAqB,EAAE,CA4BzB;AA2GD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA+BnC,CAAC;AAEZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,iCAAiC,CACzC,CAAC;AAUF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAWpC,CAAC;AAEZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,iCAAiC,QAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpond/harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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",
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"types": "./dist/types/harness.d.ts",
|
|
23
23
|
"import": "./dist/harness.js"
|
|
24
24
|
},
|
|
25
|
+
"./evaluation-review": {
|
|
26
|
+
"types": "./dist/types/evaluation-review.d.ts",
|
|
27
|
+
"import": "./dist/evaluation-review.js"
|
|
28
|
+
},
|
|
25
29
|
"./harness-improvements": {
|
|
26
30
|
"types": "./dist/types/harness-improvements.d.ts",
|
|
27
31
|
"import": "./dist/harness-improvements.js"
|
|
@@ -34,6 +38,18 @@
|
|
|
34
38
|
"types": "./dist/types/models.d.ts",
|
|
35
39
|
"import": "./dist/models.js"
|
|
36
40
|
},
|
|
41
|
+
"./refiner": {
|
|
42
|
+
"types": "./dist/types/refiner.d.ts",
|
|
43
|
+
"import": "./dist/refiner.js"
|
|
44
|
+
},
|
|
45
|
+
"./refiner-detection": {
|
|
46
|
+
"types": "./dist/types/refiner-detection.d.ts",
|
|
47
|
+
"import": "./dist/refiner-detection.js"
|
|
48
|
+
},
|
|
49
|
+
"./refiner-support": {
|
|
50
|
+
"types": "./dist/types/refiner-support.d.ts",
|
|
51
|
+
"import": "./dist/refiner-support.js"
|
|
52
|
+
},
|
|
37
53
|
"./tools": {
|
|
38
54
|
"types": "./dist/types/tools.d.ts",
|
|
39
55
|
"import": "./dist/tools.js"
|