@workbench-ai/workbench 0.0.83 → 0.0.84
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/index.js +30 -17
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -2990,17 +2990,30 @@ function versionHasAncestor(snapshot, versionId, ancestorId) {
|
|
|
2990
2990
|
return false;
|
|
2991
2991
|
}
|
|
2992
2992
|
function displayRef(id) {
|
|
2993
|
+
return displayRefWithMinLength(id, 8);
|
|
2994
|
+
}
|
|
2995
|
+
function displayRefWithMinLength(id, minLength) {
|
|
2993
2996
|
const version = /^v_([0-9a-f]{8,})$/iu.exec(id);
|
|
2994
2997
|
if (version?.[1]) {
|
|
2995
|
-
return version[1].slice(0,
|
|
2998
|
+
return version[1].slice(0, minLength);
|
|
2996
2999
|
}
|
|
2997
3000
|
const separator = id.indexOf("_");
|
|
2998
3001
|
if (separator > 0 && separator < id.length - 1) {
|
|
2999
3002
|
const prefix = id.slice(0, separator);
|
|
3000
3003
|
const suffix = id.slice(separator + 1);
|
|
3001
|
-
return `${prefix}_${suffix.slice(0,
|
|
3004
|
+
return `${prefix}_${suffix.slice(0, minLength)}`;
|
|
3002
3005
|
}
|
|
3003
|
-
return id.length >
|
|
3006
|
+
return id.length > minLength ? id.slice(0, minLength) : id;
|
|
3007
|
+
}
|
|
3008
|
+
function displayRefsForIds(ids) {
|
|
3009
|
+
const uniqueIds = [...new Set(ids)];
|
|
3010
|
+
for (let length = 8; length <= 32; length += 1) {
|
|
3011
|
+
const refs = uniqueIds.map((id) => displayRefWithMinLength(id, length));
|
|
3012
|
+
if (new Set(refs).size === refs.length) {
|
|
3013
|
+
return new Map(uniqueIds.map((id, index) => [id, refs[index]]));
|
|
3014
|
+
}
|
|
3015
|
+
}
|
|
3016
|
+
return new Map(uniqueIds.map((id) => [id, id]));
|
|
3004
3017
|
}
|
|
3005
3018
|
function shortenCommandRefs(command) {
|
|
3006
3019
|
return command.replace(/\b(?:v_[0-9a-f]{8,}|(?:run|job|trace|artifact)_[a-z0-9_-]+)/giu, (match) => displayRef(match));
|
|
@@ -3167,8 +3180,16 @@ function evidencePathSegment(value) {
|
|
|
3167
3180
|
return value.replace(/[^A-Za-z0-9._-]+/gu, "-") || "_";
|
|
3168
3181
|
}
|
|
3169
3182
|
function formatRunOrJobEvidence(jobs, details, files) {
|
|
3170
|
-
const
|
|
3171
|
-
|
|
3183
|
+
const jobRefs = displayRefsForIds([
|
|
3184
|
+
...jobs.map((job) => job.id),
|
|
3185
|
+
...details.flatMap((detail) => detail.executions.flatMap((execution) => execution.jobIds)),
|
|
3186
|
+
]);
|
|
3187
|
+
const runRefs = displayRefsForIds([
|
|
3188
|
+
...jobs.map((job) => job.runId),
|
|
3189
|
+
...details.map((detail) => detail.runId),
|
|
3190
|
+
]);
|
|
3191
|
+
const jobLines = jobs.length > 0 ? ["Jobs:", ...jobs.map((job) => formatJobEvidenceSummary(job, jobRefs))] : [];
|
|
3192
|
+
const detailLines = details.map((detail) => formatTraceDetail(detail, { jobRefs, runRefs })).filter(Boolean);
|
|
3172
3193
|
const fileLines = files.length > 0 ? ["Files:", ...files.map((file) => file.path)] : [];
|
|
3173
3194
|
return [...jobLines, ...detailLines, ...fileLines].join("\n") || "No evidence.";
|
|
3174
3195
|
}
|
|
@@ -3183,9 +3204,9 @@ function jobEvidenceSummary(job) {
|
|
|
3183
3204
|
...(job.error ? { error: job.error } : {}),
|
|
3184
3205
|
};
|
|
3185
3206
|
}
|
|
3186
|
-
function formatJobEvidenceSummary(job) {
|
|
3207
|
+
function formatJobEvidenceSummary(job, refs = new Map()) {
|
|
3187
3208
|
return [
|
|
3188
|
-
displayRef(job.id),
|
|
3209
|
+
refs.get(job.id) ?? displayRef(job.id),
|
|
3189
3210
|
`case=${job.caseId}`,
|
|
3190
3211
|
`sample=${job.sample}`,
|
|
3191
3212
|
job.status,
|
|
@@ -3304,17 +3325,9 @@ function findShowFile(files, requestedPath, objectRef) {
|
|
|
3304
3325
|
if (candidates.length === 1) {
|
|
3305
3326
|
return candidates[0];
|
|
3306
3327
|
}
|
|
3307
|
-
const equivalentCandidate = singleEquivalentShowFile(candidates);
|
|
3308
|
-
if (equivalentCandidate) {
|
|
3309
|
-
return equivalentCandidate;
|
|
3310
|
-
}
|
|
3311
3328
|
if (candidates.length === 0 && suffixCandidates.length === 1) {
|
|
3312
3329
|
return suffixCandidates[0];
|
|
3313
3330
|
}
|
|
3314
|
-
const equivalentSuffixCandidate = singleEquivalentShowFile(suffixCandidates);
|
|
3315
|
-
if (equivalentSuffixCandidate) {
|
|
3316
|
-
return equivalentSuffixCandidate;
|
|
3317
|
-
}
|
|
3318
3331
|
throw ambiguousShowPath(objectRef, requestedPath, candidates.length > 0 ? candidates : suffixCandidates);
|
|
3319
3332
|
}
|
|
3320
3333
|
function singleEquivalentShowFile(files) {
|
|
@@ -3672,11 +3685,11 @@ function traceSummary(trace) {
|
|
|
3672
3685
|
files: trace.files.map(fileSummary),
|
|
3673
3686
|
};
|
|
3674
3687
|
}
|
|
3675
|
-
function formatTraceDetail(detail) {
|
|
3688
|
+
function formatTraceDetail(detail, refs = {}) {
|
|
3676
3689
|
return detail.executions.map((execution) => {
|
|
3677
3690
|
const sessionLabels = execution.sessions.map((session) => session.label).join(",");
|
|
3678
3691
|
return [
|
|
3679
|
-
`${execution.id}\trun=${displayRef(detail.runId)}\tjobs=${execution.jobIds.map(displayRef).join(",")}\tstatus=${execution.status}`,
|
|
3692
|
+
`${execution.id}\trun=${refs.runRefs?.get(detail.runId) ?? displayRef(detail.runId)}\tjobs=${execution.jobIds.map((id) => refs.jobRefs?.get(id) ?? displayRef(id)).join(",")}\tstatus=${execution.status}`,
|
|
3680
3693
|
`events=${execution.trace.events.length}`,
|
|
3681
3694
|
`spans=${execution.trace.spans.length}`,
|
|
3682
3695
|
`summaries=${execution.trace.summaries.length}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workbench-ai/workbench",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.84",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/workbench-ai/workbench.git",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"skills": "1.5.11",
|
|
24
24
|
"yaml": "^2.8.2",
|
|
25
|
-
"@workbench-ai/workbench-
|
|
26
|
-
"@workbench-ai/workbench-
|
|
27
|
-
"@workbench-ai/workbench-protocol": "0.0.
|
|
28
|
-
"@workbench-ai/workbench-
|
|
25
|
+
"@workbench-ai/workbench-built-in-adapters": "0.0.84",
|
|
26
|
+
"@workbench-ai/workbench-contract": "0.0.84",
|
|
27
|
+
"@workbench-ai/workbench-protocol": "0.0.84",
|
|
28
|
+
"@workbench-ai/workbench-core": "0.0.84"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@tailwindcss/postcss": "^4.2.2",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react-dom": "^19.2.0",
|
|
37
37
|
"typescript": "^5.9.2",
|
|
38
38
|
"vitest": "^3.2.4",
|
|
39
|
-
"@workbench-ai/workbench-ui": "0.0.
|
|
39
|
+
"@workbench-ai/workbench-ui": "0.0.84"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "rm -rf dist && tsc -p tsconfig.json && chmod 755 dist/workbench.js && node ./scripts/build-dev-open-assets.mjs",
|