@particle-academy/prism-harness 0.5.0 → 0.6.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/README.md +15 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
Durable agent sessions — threads, session state and store drivers. The
|
|
4
4
|
TypeScript port of [`particle-academy/prism-harness`](https://github.com/Particle-Academy/prism-harness).
|
|
5
5
|
|
|
6
|
-
Zero runtime dependencies. Node
|
|
6
|
+
Zero runtime dependencies. Node 22+.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
```
|
|
9
|
+
npm install @particle-academy/prism-harness
|
|
10
|
+
```
|
|
9
11
|
|
|
10
12
|
```ts
|
|
11
13
|
import { FileSessionStore, MemorySessionStore, PrismHarness } from '@particle-academy/prism-harness';
|
|
@@ -107,6 +109,8 @@ as `request.providerOptions`, on every step of every run in that mode. Pass them
|
|
|
107
109
|
to your provider call (with `prism-ts`, `withProviderOptions()`):
|
|
108
110
|
|
|
109
111
|
```ts
|
|
112
|
+
import { ModeRegistry } from '@particle-academy/prism-harness';
|
|
113
|
+
|
|
110
114
|
new ModeRegistry({
|
|
111
115
|
modes: { overseer: { system_prompt: '...', provider_options: { thinking: { type: 'adaptive' } } } },
|
|
112
116
|
});
|
|
@@ -166,6 +170,8 @@ the text, so a thread that contains a structured answer reads like any other.
|
|
|
166
170
|
**A document that misses the schema is refused, not repaired.**
|
|
167
171
|
|
|
168
172
|
```ts
|
|
173
|
+
import { HarnessError } from '@particle-academy/prism-harness';
|
|
174
|
+
|
|
169
175
|
try {
|
|
170
176
|
const plan = (await runtime.sendStructured(session, brief, schema)).structured;
|
|
171
177
|
} catch (error) {
|
|
@@ -201,7 +207,11 @@ in the other for the same stated reason.
|
|
|
201
207
|
A mode names the tools a person must approve:
|
|
202
208
|
|
|
203
209
|
```ts
|
|
204
|
-
|
|
210
|
+
new ModeRegistry({
|
|
211
|
+
modes: {
|
|
212
|
+
guarded: { system_prompt: '...', tools: ['read', 'delete'], requires_approval: ['delete'] },
|
|
213
|
+
},
|
|
214
|
+
});
|
|
205
215
|
```
|
|
206
216
|
|
|
207
217
|
A step that calls one stops with `finishReason: 'awaiting_approval'`. The calls
|
|
@@ -209,6 +219,8 @@ that need nobody have already run. Record a decision for every pending approval,
|
|
|
209
219
|
then resume with an empty prompt:
|
|
210
220
|
|
|
211
221
|
```ts
|
|
222
|
+
import { recordApproval } from '@particle-academy/prism-harness';
|
|
223
|
+
|
|
212
224
|
const response = await runtime.send(session, 'Clean up the failed run');
|
|
213
225
|
|
|
214
226
|
if (response.finishReason === 'awaiting_approval') {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-academy/prism-harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Durable agent sessions for TypeScript — threads, session state and store drivers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": ">=22"
|
|
9
9
|
},
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|