@openora/mcp 0.4.1-canary.43 → 0.4.1-canary.430
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 +33 -15
- package/dist/.tsbuildinfo +1 -1
- package/dist/dep-graph-cli.d.ts +3 -0
- package/dist/dep-graph-cli.d.ts.map +1 -0
- package/dist/dep-graph-cli.js +11 -0
- package/dist/dep-graph-cli.js.map +1 -0
- package/dist/dep-graph.d.ts +33 -0
- package/dist/dep-graph.d.ts.map +1 -0
- package/dist/dep-graph.js +131 -0
- package/dist/dep-graph.js.map +1 -0
- package/dist/intent.d.ts +3 -0
- package/dist/intent.d.ts.map +1 -0
- package/dist/intent.js +18 -0
- package/dist/intent.js.map +1 -0
- package/dist/main.js +363 -104
- package/dist/main.js.map +1 -1
- package/dist/source.d.ts +26 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +139 -0
- package/dist/source.js.map +1 -0
- package/docs/catalog.json +6099 -283
- package/docs/dep-graph.json +1 -0
- package/package.json +13 -10
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { join, posix } from 'node:path';
|
|
4
|
+
const WORKSPACE_ROOTS = ['apps', 'packages'];
|
|
5
|
+
const CONFIG = '.dependency-cruiser.cjs';
|
|
6
|
+
function cruise(cwd, targets) {
|
|
7
|
+
const out = execFileSync('pnpm', ['exec', 'depcruise', ...targets, '--config', CONFIG, '--output-type', 'json'], { cwd, maxBuffer: 512 * 1024 * 1024 });
|
|
8
|
+
return JSON.parse(out.toString()).modules;
|
|
9
|
+
}
|
|
10
|
+
// A consumer repo keeps one config per workspace; the platform repo keeps one at the root.
|
|
11
|
+
function cruiseRuns(root) {
|
|
12
|
+
const workspaces = WORKSPACE_ROOTS.filter((r) => existsSync(join(root, r))).flatMap((r) => readdirSync(join(root, r))
|
|
13
|
+
.map((name) => `${r}/${name}`)
|
|
14
|
+
.filter((dir) => existsSync(join(root, dir, CONFIG))));
|
|
15
|
+
if (workspaces.length > 0) {
|
|
16
|
+
return workspaces.map((dir) => ({
|
|
17
|
+
dir,
|
|
18
|
+
targets: [existsSync(join(root, dir, 'src')) ? 'src' : '.'],
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
if (!existsSync(join(root, CONFIG))) {
|
|
22
|
+
throw new Error(`No ${CONFIG} at ${root} or in any of ${WORKSPACE_ROOTS.join('/')}/*`);
|
|
23
|
+
}
|
|
24
|
+
return [{ dir: '.', targets: WORKSPACE_ROOTS.filter((r) => existsSync(join(root, r))) }];
|
|
25
|
+
}
|
|
26
|
+
// `exports` point at dist; the graph speaks source, so map each entry back to its src file.
|
|
27
|
+
function publishedEntryPoints(root) {
|
|
28
|
+
const entries = {};
|
|
29
|
+
const packagesDir = join(root, 'packages');
|
|
30
|
+
if (!existsSync(packagesDir)) {
|
|
31
|
+
return entries;
|
|
32
|
+
}
|
|
33
|
+
for (const name of readdirSync(packagesDir)) {
|
|
34
|
+
const manifestPath = join(packagesDir, name, 'package.json');
|
|
35
|
+
if (!existsSync(manifestPath)) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
39
|
+
if (!manifest.name?.startsWith('@openora/') || manifest.private) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
for (const [key, target] of Object.entries(manifest.exports ?? {})) {
|
|
43
|
+
const importPath = typeof target === 'string' ? target : target?.import;
|
|
44
|
+
const dist = importPath?.match(/^\.\/dist\/(.+)\.js$/)?.[1];
|
|
45
|
+
if (!dist) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const source = ['ts', 'tsx']
|
|
49
|
+
.map((ext) => `packages/${name}/src/${dist}.${ext}`)
|
|
50
|
+
.find((file) => existsSync(join(root, file)));
|
|
51
|
+
if (source) {
|
|
52
|
+
entries[source] = manifest.name + key.slice(1);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return entries;
|
|
57
|
+
}
|
|
58
|
+
export function buildDepGraph(root) {
|
|
59
|
+
const dependents = {};
|
|
60
|
+
const platform = {};
|
|
61
|
+
for (const { dir, targets } of cruiseRuns(root)) {
|
|
62
|
+
const toRepoPath = (source) => posix.normalize(`${dir}/${source}`);
|
|
63
|
+
// Linked or installed @openora/* resolve outside the repo; the graph covers the repo's own files.
|
|
64
|
+
const isInternal = (d, path) => !d.coreModule &&
|
|
65
|
+
!d.couldNotResolve &&
|
|
66
|
+
!path.includes('node_modules/') &&
|
|
67
|
+
!toRepoPath(path).startsWith('../');
|
|
68
|
+
for (const module of cruise(join(root, dir), targets)) {
|
|
69
|
+
if (!isInternal(module, module.source)) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const file = toRepoPath(module.source);
|
|
73
|
+
for (const dependency of module.dependencies) {
|
|
74
|
+
if (isInternal(dependency, dependency.resolved)) {
|
|
75
|
+
(dependents[toRepoPath(dependency.resolved)] ??= new Set()).add(file);
|
|
76
|
+
}
|
|
77
|
+
else if (dependency.module.startsWith('@openora/')) {
|
|
78
|
+
(platform[file] ??= new Set()).add(dependency.module);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const sorted = (map) => Object.fromEntries(Object.entries(map)
|
|
84
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
85
|
+
.map(([file, values]) => [file, [...values].sort()]));
|
|
86
|
+
return {
|
|
87
|
+
generatedAt: new Date().toISOString(),
|
|
88
|
+
commit: process.env['CI_COMMIT_SHA'] ?? process.env['GITHUB_SHA'] ?? null,
|
|
89
|
+
dependents: sorted(dependents),
|
|
90
|
+
platform: sorted(platform),
|
|
91
|
+
entryPoints: publishedEntryPoints(root),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** Transitive importers of `file`, up to `maxDepth` hops, nearest first. */
|
|
95
|
+
export function importersOf(graph, file, maxDepth) {
|
|
96
|
+
const depth = new Map([[file, 0]]);
|
|
97
|
+
const queue = [file];
|
|
98
|
+
for (let current = queue.shift(); current !== undefined; current = queue.shift()) {
|
|
99
|
+
const level = depth.get(current) ?? 0;
|
|
100
|
+
if (level >= maxDepth) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
for (const importer of graph.dependents[current] ?? []) {
|
|
104
|
+
if (!depth.has(importer)) {
|
|
105
|
+
depth.set(importer, level + 1);
|
|
106
|
+
queue.push(importer);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
depth.delete(file);
|
|
111
|
+
return [...depth.keys()];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* What a change to `file` can break. With a consumer graph, a platform file is followed through
|
|
115
|
+
* the public entry points it reaches into the consumer files that import them - the cross-repo
|
|
116
|
+
* half that no single-repo graph shows.
|
|
117
|
+
*/
|
|
118
|
+
export function impactOf(graph, file, maxDepth, consumer) {
|
|
119
|
+
const importers = importersOf(graph, file, maxDepth);
|
|
120
|
+
// Nearest first: a change reaches its own entry point before the barrels that re-export it.
|
|
121
|
+
const specifiers = [...new Set([file, ...importers].flatMap((f) => graph.entryPoints[f] ?? []))];
|
|
122
|
+
const rank = (specs) => Math.min(...specs.map((s) => specifiers.indexOf(s)).filter((i) => i >= 0));
|
|
123
|
+
const consumerFiles = consumer
|
|
124
|
+
? Object.entries(consumer.platform)
|
|
125
|
+
.filter(([, specs]) => specs.some((s) => specifiers.includes(s)))
|
|
126
|
+
.sort(([a, x], [b, y]) => rank(x) - rank(y) || a.localeCompare(b))
|
|
127
|
+
.map(([f]) => f)
|
|
128
|
+
: [];
|
|
129
|
+
return { file, importers, specifiers, consumerFiles };
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=dep-graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;aAChE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;aACjE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACpB,CAAC,CAAC,EAAE,CAAC;IACP,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;AACxD,CAAC"}
|
package/dist/intent.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../src/intent.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhF,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAoBtD"}
|
package/dist/intent.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function classifyIntent(ask) {
|
|
2
|
+
const a = ` ${ask.toLowerCase()} `;
|
|
3
|
+
const has = (re) => re.test(a);
|
|
4
|
+
if (has(/\b(payment|psp|stripe|adyen|kyc|onfido|sms|email|notification|vendor|adapter|gateway)\b/)) {
|
|
5
|
+
return 'adapter';
|
|
6
|
+
}
|
|
7
|
+
if (has(/\b(page|screen|dashboard|view|frontend|admin panel|backoffice page|player page)\b/)) {
|
|
8
|
+
return 'ui-page';
|
|
9
|
+
}
|
|
10
|
+
if (has(/\b(endpoint|route|procedure|api method|rpc)\b/)) {
|
|
11
|
+
return 'route';
|
|
12
|
+
}
|
|
13
|
+
if (has(/\b(feature|module|tournament|leaderboard|jackpot|loyalty|bonus|cashback|mission|reward)\b/)) {
|
|
14
|
+
return 'feature';
|
|
15
|
+
}
|
|
16
|
+
return 'unsure';
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=intent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent.js","sourceRoot":"","sources":["../src/intent.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC;IACnC,MAAM,GAAG,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvC,IACE,GAAG,CAAC,yFAAyF,CAAC,EAC9F,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,GAAG,CAAC,mFAAmF,CAAC,EAAE,CAAC;QAC7F,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,GAAG,CAAC,+CAA+C,CAAC,EAAE,CAAC;QACzD,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IACE,GAAG,CAAC,2FAA2F,CAAC,EAChG,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|