@particle-academy/prism-harness 0.9.2 → 0.10.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 +11 -3
- package/dist/runtime.d.ts +3 -1
- package/dist/runtime.js +7 -1
- package/dist/stores/file-owner-lock.js +3 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -58,9 +58,17 @@ creates no session, thread or index entry and makes no model/provider request
|
|
|
58
58
|
or logical state change. Reads may physically purge expired entries, exactly as
|
|
59
59
|
an ordinary store read does. Explicit state writes during resolution refuse.
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
names
|
|
63
|
-
|
|
61
|
+
The mode list is the ceiling for named and legacy sessions. Caller-supplied
|
|
62
|
+
names narrow it; omitting names uses the mode's full list, and an empty list
|
|
63
|
+
offers no tools. A requested `*` selects the mode's ceiling. Other names outside
|
|
64
|
+
the ceiling fail before the model is called.
|
|
65
|
+
|
|
66
|
+
Legacy callers that intentionally need the previous replacement behavior can
|
|
67
|
+
set `AgentRuntimeOptions.allowLegacyToolListWidening` to `true`. This permits
|
|
68
|
+
widening only in the legacy namespace; the configured authorizer still filters
|
|
69
|
+
the offer and tool calls. Named agents always retain their ceiling. Remove an
|
|
70
|
+
old explicit `narrowRequestedTools: false`: it now raises a migration error.
|
|
71
|
+
Explicit `true` remains supported, and conflicts with the widening opt-out.
|
|
64
72
|
Named agents inherit no legacy authority. Builtins require explicit registration and
|
|
65
73
|
mode selection. Named-agent duplicates are refused; use
|
|
66
74
|
tools.forAgent('support').replace(replacement, 'app.support', 'app.support.v2')
|
package/dist/runtime.d.ts
CHANGED
|
@@ -110,8 +110,10 @@ export interface PendingApproval {
|
|
|
110
110
|
arguments: JsonObject;
|
|
111
111
|
}
|
|
112
112
|
export interface AgentRuntimeOptions {
|
|
113
|
-
/**
|
|
113
|
+
/** Explicit true retains strict behavior. Explicit false now requires migration to the widening opt-out. */
|
|
114
114
|
narrowRequestedTools?: boolean;
|
|
115
|
+
/** Permit caller names to replace a LEGACY session's mode list. Named agents remain strict; authorizers still apply. */
|
|
116
|
+
allowLegacyToolListWidening?: boolean;
|
|
115
117
|
config?: RuntimeConfig;
|
|
116
118
|
agents?: Record<string, RuntimeConfig>;
|
|
117
119
|
client: LlmClient;
|
package/dist/runtime.js
CHANGED
|
@@ -39,7 +39,13 @@ export class AgentRuntime {
|
|
|
39
39
|
constructor(options) {
|
|
40
40
|
if (options.narrowRequestedTools !== undefined && typeof options.narrowRequestedTools !== 'boolean')
|
|
41
41
|
throw new TypeError('narrowRequestedTools must be a boolean');
|
|
42
|
-
|
|
42
|
+
if (options.allowLegacyToolListWidening !== undefined && typeof options.allowLegacyToolListWidening !== 'boolean')
|
|
43
|
+
throw new TypeError('allowLegacyToolListWidening must be a boolean');
|
|
44
|
+
if (options.narrowRequestedTools === false)
|
|
45
|
+
throw new TypeError('narrowRequestedTools: false is no longer supported. Remove it; use allowLegacyToolListWidening: true only to explicitly permit legacy tool-list widening.');
|
|
46
|
+
if (options.narrowRequestedTools === true && options.allowLegacyToolListWidening === true)
|
|
47
|
+
throw new TypeError('narrowRequestedTools: true conflicts with allowLegacyToolListWidening: true.');
|
|
48
|
+
this.#narrowRequestedTools = options.allowLegacyToolListWidening !== true;
|
|
43
49
|
this.#client = options.client;
|
|
44
50
|
this.#modes = options.modes;
|
|
45
51
|
this.#tools = options.tools;
|
|
@@ -126,6 +126,9 @@ async function inspect(lockPath, local) {
|
|
|
126
126
|
return 'held';
|
|
127
127
|
if (!owner.released && !lockPidIsDead(owner.pid))
|
|
128
128
|
return 'held';
|
|
129
|
+
// A proven stale owner's temporary file may still be open on Windows.
|
|
130
|
+
// Cleanup errors use inspection's held handling and the existing wait budget.
|
|
131
|
+
await cleanFileLockOwner(lockPath, owner, temporary);
|
|
129
132
|
}
|
|
130
133
|
catch (error) {
|
|
131
134
|
if (code(error) === 'ENOENT')
|
|
@@ -134,7 +137,6 @@ async function inspect(lockPath, local) {
|
|
|
134
137
|
return 'held';
|
|
135
138
|
throw error;
|
|
136
139
|
}
|
|
137
|
-
await cleanFileLockOwner(lockPath, owner, temporary);
|
|
138
140
|
return 'retry';
|
|
139
141
|
}
|
|
140
142
|
async function release(progress) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-academy/prism-harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Durable agent sessions for TypeScript — threads, session state and store drivers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^26.3.0",
|
|
27
27
|
"typescript": "^5.9.3",
|
|
28
|
-
"
|
|
28
|
+
"vite": "^8.3.5",
|
|
29
|
+
"vitest": "^4.1.12"
|
|
29
30
|
},
|
|
30
31
|
"repository": {
|
|
31
32
|
"type": "git",
|