@hmharness/kernel 0.9.1 → 0.9.2
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/dist/session.js +17 -1
- package/dist/types.d.ts +5 -1
- package/package.json +1 -1
package/dist/session.js
CHANGED
|
@@ -307,7 +307,23 @@ export async function findSessionFile(home, prefix) {
|
|
|
307
307
|
return null;
|
|
308
308
|
const { list } = await collectCandidates(home, 'created');
|
|
309
309
|
const hit = list.find((c) => c.id === prefix) ?? list.find((c) => c.id.startsWith(prefix));
|
|
310
|
-
|
|
310
|
+
if (hit)
|
|
311
|
+
return hit.file;
|
|
312
|
+
// READ fallback: archived and trashed sessions stay readable (view/label/
|
|
313
|
+
// resume-by-id) — only the LISTINGS hide them (W4: trash is recoverable,
|
|
314
|
+
// audit files are never destroyed). Active wins when the same id exists
|
|
315
|
+
// in both places.
|
|
316
|
+
for (const sub of ['archive', 'trash']) {
|
|
317
|
+
const dir = join(home, 'sessions', sub);
|
|
318
|
+
const entries = await safeReaddir(dir);
|
|
319
|
+
const exact = entries.find((f) => f === prefix + '.jsonl');
|
|
320
|
+
if (exact)
|
|
321
|
+
return join(dir, exact);
|
|
322
|
+
const pfx = entries.find((f) => f.startsWith(prefix) && f.endsWith('.jsonl'));
|
|
323
|
+
if (pfx)
|
|
324
|
+
return join(dir, pfx);
|
|
325
|
+
}
|
|
326
|
+
return null;
|
|
311
327
|
}
|
|
312
328
|
/** Find the newest session file under home/sessions matching an id prefix. */
|
|
313
329
|
export async function latestSession(home, prefix = '') {
|
package/dist/types.d.ts
CHANGED
|
@@ -132,6 +132,10 @@ export interface HmhConfig {
|
|
|
132
132
|
evolve?: string;
|
|
133
133
|
/** bench runner (default: chat) */
|
|
134
134
|
bench?: string;
|
|
135
|
+
/** LLM-as-judge session scoring (J1; default: chat). Point it at a
|
|
136
|
+
* DIFFERENT model family than the actor so preference pairs are not
|
|
137
|
+
* self-graded. */
|
|
138
|
+
judge?: string;
|
|
135
139
|
};
|
|
136
140
|
}
|
|
137
141
|
/** Resolve a purpose to a concrete provider config (routing > legacy fields).
|
|
@@ -143,7 +147,7 @@ export interface HmhConfig {
|
|
|
143
147
|
* screenshot and replied "I can't view the image" with HTTP 200; the UI
|
|
144
148
|
* regression tool then reported a FAIL about the app instead of a provider
|
|
145
149
|
* failure (false negative, mis-attributed to the product). */
|
|
146
|
-
export declare function resolveProvider(cfg: HmhConfig, purpose: 'chat' | 'vision' | 'evolve' | 'bench'): ProviderConfig;
|
|
150
|
+
export declare function resolveProvider(cfg: HmhConfig, purpose: 'chat' | 'vision' | 'evolve' | 'bench' | 'judge'): ProviderConfig;
|
|
147
151
|
/**
|
|
148
152
|
* Ordered vision candidates: routing.vision provider, the legacy `vision`
|
|
149
153
|
* block, then `visionFallbacks`; de-duplicated by endpoint+model and with
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmharness/kernel",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "hmharness kernel: tool registry, provider adapters, the agent loop, session log, config. Zero runtime dependencies (Node >=22 native fetch).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|