@exaudeus/workrail 3.21.0 → 3.22.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/manifest.json
CHANGED
|
@@ -974,12 +974,12 @@
|
|
|
974
974
|
"bytes": 22303
|
|
975
975
|
},
|
|
976
976
|
"mcp/handlers/v2-workflow.d.ts": {
|
|
977
|
-
"sha256": "
|
|
978
|
-
"bytes":
|
|
977
|
+
"sha256": "5bada214e39f58cbbe76037e48e5fd696e2715d66b23c214d8bf3d1a8c7ee0d1",
|
|
978
|
+
"bytes": 4343
|
|
979
979
|
},
|
|
980
980
|
"mcp/handlers/v2-workflow.js": {
|
|
981
|
-
"sha256": "
|
|
982
|
-
"bytes":
|
|
981
|
+
"sha256": "73137ab66383cd5804856f086bb665414f8c302cb90dd934b24aaf12c6a96ae9",
|
|
982
|
+
"bytes": 26893
|
|
983
983
|
},
|
|
984
984
|
"mcp/handlers/v2-workspace-resolution.d.ts": {
|
|
985
985
|
"sha256": "dd4de57b4918ebe749cf8c1df70c02bf1effc50932634bae60db53c9a157e872",
|
|
@@ -18,6 +18,13 @@ interface WorkflowTagsFile {
|
|
|
18
18
|
readonly hidden?: boolean;
|
|
19
19
|
}>>;
|
|
20
20
|
}
|
|
21
|
+
export declare function buildVirtualSourceTags(tagsFile: WorkflowTagsFile, compiledWorkflowIds: readonly string[]): Array<{
|
|
22
|
+
id: string;
|
|
23
|
+
displayName: string;
|
|
24
|
+
count: number;
|
|
25
|
+
when: string[];
|
|
26
|
+
examples: string[];
|
|
27
|
+
}>;
|
|
21
28
|
export declare function buildTagSummary(tagsFile: WorkflowTagsFile, compiledWorkflowIds: readonly string[]): Array<{
|
|
22
29
|
id: string;
|
|
23
30
|
displayName: string;
|
|
@@ -25,6 +32,7 @@ export declare function buildTagSummary(tagsFile: WorkflowTagsFile, compiledWork
|
|
|
25
32
|
when: string[];
|
|
26
33
|
examples: string[];
|
|
27
34
|
}>;
|
|
35
|
+
export declare function filterByTags(tagsFile: WorkflowTagsFile, compiledWorkflowIds: readonly string[], requestedTags: readonly string[]): readonly string[];
|
|
28
36
|
export declare function computeWorkflowStaleness(stamp: number | undefined, currentVersion: number | null): StalenessSummary | undefined;
|
|
29
37
|
interface WorkflowLookupReader {
|
|
30
38
|
readonly getWorkflowById: (id: string) => Promise<Workflow | null>;
|
|
@@ -4,7 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.shouldShowStaleness = shouldShowStaleness;
|
|
7
|
+
exports.buildVirtualSourceTags = buildVirtualSourceTags;
|
|
7
8
|
exports.buildTagSummary = buildTagSummary;
|
|
9
|
+
exports.filterByTags = filterByTags;
|
|
8
10
|
exports.computeWorkflowStaleness = computeWorkflowStaleness;
|
|
9
11
|
exports.handleV2ListWorkflows = handleV2ListWorkflows;
|
|
10
12
|
exports.handleV2InspectWorkflow = handleV2InspectWorkflow;
|
|
@@ -52,9 +54,51 @@ function readWorkflowTags() {
|
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
const WORKFLOW_TAGS = readWorkflowTags();
|
|
57
|
+
const NAMESPACE_ACRONYMS = {
|
|
58
|
+
ios: 'iOS',
|
|
59
|
+
api: 'API',
|
|
60
|
+
ui: 'UI',
|
|
61
|
+
ux: 'UX',
|
|
62
|
+
mcp: 'MCP',
|
|
63
|
+
};
|
|
64
|
+
function namespaceToDisplayName(namespace) {
|
|
65
|
+
return namespace
|
|
66
|
+
.split('-')
|
|
67
|
+
.map((word) => NAMESPACE_ACRONYMS[word] ?? word.charAt(0).toUpperCase() + word.slice(1))
|
|
68
|
+
.join(' ');
|
|
69
|
+
}
|
|
70
|
+
function buildVirtualSourceTags(tagsFile, compiledWorkflowIds) {
|
|
71
|
+
const registeredIds = new Set(Object.keys(tagsFile.workflows));
|
|
72
|
+
const namespaceMap = new Map();
|
|
73
|
+
for (const id of compiledWorkflowIds) {
|
|
74
|
+
if (registeredIds.has(id))
|
|
75
|
+
continue;
|
|
76
|
+
const dotIndex = id.indexOf('.');
|
|
77
|
+
if (dotIndex === -1)
|
|
78
|
+
continue;
|
|
79
|
+
const namespace = id.slice(0, dotIndex);
|
|
80
|
+
const bucket = namespaceMap.get(namespace);
|
|
81
|
+
if (bucket) {
|
|
82
|
+
bucket.push(id);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
namespaceMap.set(namespace, [id]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return Array.from(namespaceMap.entries()).map(([namespace, ids]) => {
|
|
89
|
+
const displayName = namespaceToDisplayName(namespace);
|
|
90
|
+
return {
|
|
91
|
+
id: namespace,
|
|
92
|
+
displayName,
|
|
93
|
+
count: ids.length,
|
|
94
|
+
when: [`running ${displayName} workflows`],
|
|
95
|
+
examples: ids.slice(0, 3),
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
}
|
|
55
99
|
function buildTagSummary(tagsFile, compiledWorkflowIds) {
|
|
56
100
|
const idSet = new Set(compiledWorkflowIds);
|
|
57
|
-
|
|
101
|
+
const bundledTags = tagsFile.tags.map((tag) => {
|
|
58
102
|
const count = Object.entries(tagsFile.workflows)
|
|
59
103
|
.filter(([wid, meta]) => !meta.hidden && idSet.has(wid) && meta.tags.includes(tag.id))
|
|
60
104
|
.length;
|
|
@@ -66,12 +110,24 @@ function buildTagSummary(tagsFile, compiledWorkflowIds) {
|
|
|
66
110
|
examples: [...tag.examples],
|
|
67
111
|
};
|
|
68
112
|
});
|
|
113
|
+
return [...bundledTags, ...buildVirtualSourceTags(tagsFile, compiledWorkflowIds)];
|
|
69
114
|
}
|
|
70
115
|
function filterByTags(tagsFile, compiledWorkflowIds, requestedTags) {
|
|
71
116
|
const tagSet = new Set(requestedTags);
|
|
72
117
|
const matching = new Set(Object.entries(tagsFile.workflows)
|
|
73
118
|
.filter(([, meta]) => !meta.hidden && meta.tags.some((t) => tagSet.has(t)))
|
|
74
119
|
.map(([wid]) => wid));
|
|
120
|
+
const registeredIds = new Set(Object.keys(tagsFile.workflows));
|
|
121
|
+
for (const id of compiledWorkflowIds) {
|
|
122
|
+
if (registeredIds.has(id))
|
|
123
|
+
continue;
|
|
124
|
+
const dotIndex = id.indexOf('.');
|
|
125
|
+
if (dotIndex === -1)
|
|
126
|
+
continue;
|
|
127
|
+
const namespace = id.slice(0, dotIndex);
|
|
128
|
+
if (tagSet.has(namespace))
|
|
129
|
+
matching.add(id);
|
|
130
|
+
}
|
|
75
131
|
return compiledWorkflowIds.filter((id) => matching.has(id));
|
|
76
132
|
}
|
|
77
133
|
function computeWorkflowStaleness(stamp, currentVersion) {
|