@corenel/harness 0.16.0 → 0.18.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/dist/prompts/library/defaults.generated.d.ts.map +1 -1
- package/dist/prompts/library/defaults.generated.js +9 -5
- package/dist/prompts/library/defaults.generated.js.map +1 -1
- package/dist/sidecar/host.d.ts +40 -5
- package/dist/sidecar/host.d.ts.map +1 -1
- package/dist/sidecar/host.js +132 -2
- package/dist/sidecar/host.js.map +1 -1
- package/dist/sidecar/memberGate.d.ts.map +1 -1
- package/dist/sidecar/memberGate.js +5 -0
- package/dist/sidecar/memberGate.js.map +1 -1
- package/dist/sidecar/server.d.ts +38 -2
- package/dist/sidecar/server.d.ts.map +1 -1
- package/dist/sidecar/server.js +193 -2
- package/dist/sidecar/server.js.map +1 -1
- package/dist/skills.d.ts +3 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +25 -8
- package/dist/skills.js.map +1 -1
- package/dist/tools/urlGuard.d.ts +11 -2
- package/dist/tools/urlGuard.d.ts.map +1 -1
- package/dist/tools/urlGuard.js +70 -15
- package/dist/tools/urlGuard.js.map +1 -1
- package/dist/workflows/results/resultFile.d.ts +23 -0
- package/dist/workflows/results/resultFile.d.ts.map +1 -0
- package/dist/workflows/results/resultFile.js +70 -0
- package/dist/workflows/results/resultFile.js.map +1 -0
- package/dist/workflows/results/resultStore.d.ts +37 -0
- package/dist/workflows/results/resultStore.d.ts.map +1 -0
- package/dist/workflows/results/resultStore.js +191 -0
- package/dist/workflows/results/resultStore.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/* Results as files: save, list, read, delete under results/ in the workspace.
|
|
2
|
+
* Every path in or out is checked to be results/**.md, so a crafted link can
|
|
3
|
+
* never read or delete anything else. Saving never throws: a run's outcome must
|
|
4
|
+
* not depend on whether its result could be written. */
|
|
5
|
+
import { isProtectedPath, protectedPathReason } from '@corenel/protocol';
|
|
6
|
+
import { RESULTS_DIR, formatResult, parseResult, resultPath } from './resultFile.js';
|
|
7
|
+
/** At most this many files are read for one listing. */
|
|
8
|
+
const MAX_SCAN = 500;
|
|
9
|
+
function normalize(path) {
|
|
10
|
+
return path.replace(/\\/g, '/').replace(/^\/+/, '');
|
|
11
|
+
}
|
|
12
|
+
export function isResultPath(path) {
|
|
13
|
+
const n = normalize(path);
|
|
14
|
+
return n.startsWith(`${RESULTS_DIR}/`) && n.endsWith('.md') && !n.split('/').some((seg) => seg === '..' || seg === '.' || seg === '');
|
|
15
|
+
}
|
|
16
|
+
export async function saveResult(files, meta, output, ranAt = new Date(meta.ran)) {
|
|
17
|
+
if (!files)
|
|
18
|
+
return { error: 'no workspace is open' };
|
|
19
|
+
if (!files.writable)
|
|
20
|
+
return { error: 'the workspace is read-only' };
|
|
21
|
+
const when = Number.isNaN(ranAt.getTime()) ? new Date() : ranAt;
|
|
22
|
+
const base = resultPath(meta.workflow, meta.slug, when);
|
|
23
|
+
// cleanName already makes one safe segment; this keeps the write honest if
|
|
24
|
+
// that ever changes: nothing outside results/**.md is ever written.
|
|
25
|
+
if (!isResultPath(base))
|
|
26
|
+
return { error: `not a results path: ${base}` };
|
|
27
|
+
if (isProtectedPath(base))
|
|
28
|
+
return { error: protectedPathReason(base) };
|
|
29
|
+
let path = null;
|
|
30
|
+
// The name this save holds in `reserved`; released in finally, even on a throw.
|
|
31
|
+
let claimed = null;
|
|
32
|
+
try {
|
|
33
|
+
// stat-then-write is not atomic, so each candidate is CLAIMED in this tab
|
|
34
|
+
// before the await that checks the disk: two saves finishing together (a
|
|
35
|
+
// deploy and a job) can never both pick the same free name.
|
|
36
|
+
for (let n = 1; path === null; n++) {
|
|
37
|
+
if (n > 99)
|
|
38
|
+
return { error: 'too many results in one minute' };
|
|
39
|
+
const candidate = n === 1 ? base : base.replace(/\.md$/, ` (${n}).md`);
|
|
40
|
+
if (reserved.has(candidate))
|
|
41
|
+
continue;
|
|
42
|
+
reserved.add(candidate);
|
|
43
|
+
claimed = candidate;
|
|
44
|
+
if (await files.stat(candidate)) {
|
|
45
|
+
reserved.delete(candidate);
|
|
46
|
+
claimed = null;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
path = candidate;
|
|
50
|
+
}
|
|
51
|
+
await files.write(path, formatResult(meta, output));
|
|
52
|
+
return { path };
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
return { error: String(e?.message || e) };
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
if (claimed !== null)
|
|
59
|
+
reserved.delete(claimed);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** Paths a save in this tab has claimed but not finished writing. */
|
|
63
|
+
const reserved = new Set();
|
|
64
|
+
/** Put an already-formatted result `text` at `path` (results/**.md) or the
|
|
65
|
+
* next free ` (n)` name, never overwriting anything: a name holding exactly
|
|
66
|
+
* `text` already is the same result (an earlier copy) and is reported as
|
|
67
|
+
* `same` with nothing written. Claims names in the SAME in-tab reservation as
|
|
68
|
+
* saveResult, so a save and a placement finishing together never pick one
|
|
69
|
+
* name, and writes with `create`, which refuses an existing file, so a file
|
|
70
|
+
* another tab wrote between the check and the write is not replaced either.
|
|
71
|
+
* Never throws. */
|
|
72
|
+
export async function placeResultText(files, path, text) {
|
|
73
|
+
if (!files.writable)
|
|
74
|
+
return { error: 'the workspace is read-only' };
|
|
75
|
+
const base = normalize(path);
|
|
76
|
+
if (!isResultPath(base))
|
|
77
|
+
return { error: `not a results path: ${base}` };
|
|
78
|
+
const sameAt = async (candidate) => {
|
|
79
|
+
try {
|
|
80
|
+
return (await files.read(candidate)) === text;
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
for (let n = 1; n <= 99; n++) {
|
|
87
|
+
const candidate = n === 1 ? base : base.replace(/\.md$/, ` (${n}).md`);
|
|
88
|
+
if (isProtectedPath(candidate))
|
|
89
|
+
return { error: protectedPathReason(candidate) };
|
|
90
|
+
if (reserved.has(candidate))
|
|
91
|
+
continue;
|
|
92
|
+
reserved.add(candidate);
|
|
93
|
+
try {
|
|
94
|
+
if (await files.stat(candidate)) {
|
|
95
|
+
if (await sameAt(candidate))
|
|
96
|
+
return { path: candidate, same: true };
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
await files.create(candidate, text);
|
|
101
|
+
return { path: candidate, same: false };
|
|
102
|
+
}
|
|
103
|
+
catch (e) {
|
|
104
|
+
// Taken since the check (another tab): treat it as any existing name.
|
|
105
|
+
// Anything else is a real failure and nothing was written.
|
|
106
|
+
let now;
|
|
107
|
+
try {
|
|
108
|
+
now = await files.stat(candidate);
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
now = null;
|
|
112
|
+
}
|
|
113
|
+
if (!now)
|
|
114
|
+
return { error: String(e?.message || e) };
|
|
115
|
+
if (await sameAt(candidate))
|
|
116
|
+
return { path: candidate, same: true };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch (e) {
|
|
120
|
+
return { error: String(e?.message || e) };
|
|
121
|
+
}
|
|
122
|
+
finally {
|
|
123
|
+
reserved.delete(candidate);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return { error: 'too many results with that name' };
|
|
127
|
+
}
|
|
128
|
+
function flatten(nodes, out) {
|
|
129
|
+
for (const n of nodes) {
|
|
130
|
+
if (n.kind === 'file')
|
|
131
|
+
out.push(n);
|
|
132
|
+
else if (n.children)
|
|
133
|
+
flatten(n.children, out);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// "2026-10-10 0930 (2).md" -> "202610100930002", for newest-first sorting.
|
|
137
|
+
const STAMP = /(\d{4})-(\d{2})-(\d{2}) (\d{2})(\d{2})(?: \((\d+)\))?\.md$/;
|
|
138
|
+
function sortKey(n) {
|
|
139
|
+
const m = STAMP.exec(n.name);
|
|
140
|
+
if (m)
|
|
141
|
+
return `${m[1]}${m[2]}${m[3]}${m[4]}${m[5]}${(m[6] ?? '1').padStart(3, '0')}`;
|
|
142
|
+
return n.mtime ? `${new Date(n.mtime).toISOString().replace(/\D/g, '').slice(0, 12)}000` : '';
|
|
143
|
+
}
|
|
144
|
+
async function readEntry(files, path, mtime) {
|
|
145
|
+
try {
|
|
146
|
+
const { meta, output } = parseResult(await files.read(path));
|
|
147
|
+
const parsed = meta ? Date.parse(meta.ran) : NaN;
|
|
148
|
+
return { path, meta, output, ranAt: Number.isNaN(parsed) ? (mtime ?? 0) : parsed };
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
export async function listResults(files, opts = {}) {
|
|
155
|
+
if (!files)
|
|
156
|
+
return [];
|
|
157
|
+
let nodes;
|
|
158
|
+
try {
|
|
159
|
+
nodes = await files.list(RESULTS_DIR);
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
const all = [];
|
|
165
|
+
flatten(nodes, all);
|
|
166
|
+
const md = all.filter((n) => isResultPath(n.path)).sort((a, b) => sortKey(b).localeCompare(sortKey(a)));
|
|
167
|
+
const limit = opts.limit ?? 50;
|
|
168
|
+
const out = [];
|
|
169
|
+
for (const n of md.slice(0, MAX_SCAN)) {
|
|
170
|
+
if (out.length >= limit)
|
|
171
|
+
break;
|
|
172
|
+
const e = await readEntry(files, n.path, n.mtime);
|
|
173
|
+
if (!e)
|
|
174
|
+
continue;
|
|
175
|
+
if (opts.slug && e.meta?.slug !== opts.slug)
|
|
176
|
+
continue;
|
|
177
|
+
out.push(e);
|
|
178
|
+
}
|
|
179
|
+
return out;
|
|
180
|
+
}
|
|
181
|
+
export async function readResult(files, path) {
|
|
182
|
+
if (!files || !isResultPath(path))
|
|
183
|
+
return null;
|
|
184
|
+
return readEntry(files, normalize(path));
|
|
185
|
+
}
|
|
186
|
+
export async function deleteResult(files, path) {
|
|
187
|
+
if (!isResultPath(path))
|
|
188
|
+
throw new Error(`not a result: ${path}`);
|
|
189
|
+
await files.remove(normalize(path));
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=resultStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resultStore.js","sourceRoot":"","sources":["../../../workflows/results/resultStore.ts"],"names":[],"mappings":"AAAA;;;wDAGwD;AACxD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAKnG,wDAAwD;AACxD,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1B,OAAO,CAAC,CAAC,UAAU,CAAC,GAAG,WAAW,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,EAAE,CAAC,CAAC;AACxI,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,KAAyB,EAAE,IAAgB,EAAE,MAAc,EAAE,QAAc,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IAC5H,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IACrD,IAAI,CAAC,KAAK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
1
1
|
{
|
|
2
2
|
"name": "@corenel/harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"license": "Elastic-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Corenel — host-agnostic agent harness (kernel). The app resolves it via the `corenel` path alias (bypasses these exports entirely); vitest aliases it to source too. Everything else — node consumers like @corenel/cli, @corenel/term, @corenel/sidecar — resolves it through this workspace package via the exports map below, which points at dist/ unconditionally (not just at publish) so in-repo and published resolution are identical: a bundle that treats @corenel/harness as external (see packages/term/build.mjs) must see the SAME module instance node sees when it later resolves this package at runtime, and plain node cannot execute the raw .ts sources at all. Run `pnpm build` here (or let a dependent's prebuild do it) before relying on this package outside the app/vitest. NOTE: @xyflow/react and dagre are NOT dependencies here at all — this package has no .tsx files and imports neither. `react` IS a real (small) runtime dependency: `todos.ts` uses `useSyncExternalStore`. It is declared below as an OPTIONAL peer, not a hard dependency, so node-only consumers (cli/term/sidecar) aren't forced to install react; node consumers hoist it today only because something else in the tree happens to pull it in. Do not add @xyflow/react or dagre as dependencies/peers without testing a packed install end to end — an earlier attempt at that (before this package had any .tsx files) failed npm's peer resolution with ERESOLVE.",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"openai": "^4.77.0",
|
|
35
35
|
"yaml": "^2.8.3",
|
|
36
|
-
"@corenel/protocol": "0.
|
|
36
|
+
"@corenel/protocol": "0.16.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "^18.0.0 || ^19.0.0"
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
+
"@prompd/core": "0.6.0",
|
|
47
48
|
"@types/ws": "^8.5.13"
|
|
48
49
|
},
|
|
49
50
|
"publishConfig": {
|