@zhixuan92/multi-model-agent-core 4.0.0 → 4.0.1
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.
|
@@ -5,6 +5,8 @@ export declare class SkillNotFoundError extends Error {
|
|
|
5
5
|
readonly code: "skill_not_found";
|
|
6
6
|
constructor(skillName: string, checkedPath: string);
|
|
7
7
|
}
|
|
8
|
+
export declare function skillsRootCandidates(here: string): string[];
|
|
9
|
+
export declare function pickSkillsRoot(here: string, exists?: (p: string) => boolean): string;
|
|
8
10
|
/**
|
|
9
11
|
* Return the absolute path to the skills root directory. Production: the
|
|
10
12
|
* bundled `packages/server/src/skills/` (or its dist mirror). Tests pass
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/tool-surface/discover.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,eAAO,MAAM,gBAAgB,+LAYnB,CAAC;AAEX,uFAAuF;AACvF,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,EAAG,iBAAiB,CAAU;gBAC/B,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;CAOnD;
|
|
1
|
+
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/tool-surface/discover.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,eAAO,MAAM,gBAAgB,+LAYnB,CAAC;AAEX,uFAAuF;AACvF,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,EAAG,iBAAiB,CAAU;gBAC/B,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;CAOnD;AAYD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAgB3D;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAuB,GAC7C,MAAM,CAMR;AAID;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQtF;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAM9F"}
|
|
@@ -28,25 +28,40 @@ export class SkillNotFoundError extends Error {
|
|
|
28
28
|
}
|
|
29
29
|
// Discover.ts lives in `packages/core/src/tool-surface/` (or its dist mirror).
|
|
30
30
|
// Skills are bundled by the server package at `packages/server/src/skills/`
|
|
31
|
-
// (
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
// (copied to `packages/server/dist/skills/` at build time, then shipped on
|
|
32
|
+
// the `@zhixuan92/multi-model-agent` npm package as `dist/skills/`).
|
|
33
|
+
// Probe candidates for both monorepo dev layouts and the two npm-installed
|
|
34
|
+
// layouts (hoisted siblings, or core nested under server).
|
|
35
|
+
//
|
|
36
|
+
// Exported (and parameterized on `here` + `exists`) so the candidate logic
|
|
37
|
+
// can be unit-tested against fixtures that mimic each layout — the v4.0.1
|
|
38
|
+
// regression was a missing prod candidate.
|
|
39
|
+
export function skillsRootCandidates(here) {
|
|
40
|
+
return [
|
|
41
|
+
// Dev source: packages/core/src/tool-surface -> packages/server/src/skills
|
|
37
42
|
path.resolve(here, '..', '..', '..', 'server', 'src', 'skills'),
|
|
43
|
+
// Dev built: packages/core/dist/tool-surface -> packages/server/dist/skills
|
|
38
44
|
path.resolve(here, '..', '..', '..', 'server', 'dist', 'skills'),
|
|
39
|
-
//
|
|
40
|
-
//
|
|
45
|
+
// npm install (hoisted): node_modules/@zhixuan92/multi-model-agent-core/dist/tool-surface
|
|
46
|
+
// -> node_modules/@zhixuan92/multi-model-agent/dist/skills
|
|
47
|
+
path.resolve(here, '..', '..', '..', 'multi-model-agent', 'dist', 'skills'),
|
|
48
|
+
// npm install (core nested under server):
|
|
49
|
+
// .../multi-model-agent/node_modules/@zhixuan92/multi-model-agent-core/dist/tool-surface
|
|
50
|
+
// -> .../multi-model-agent/dist/skills
|
|
51
|
+
path.resolve(here, '..', '..', '..', '..', '..', 'dist', 'skills'),
|
|
52
|
+
// Last-resort fallback for any caller that bundles skills inside core.
|
|
41
53
|
path.resolve(here, '..', 'skills'),
|
|
42
54
|
];
|
|
55
|
+
}
|
|
56
|
+
export function pickSkillsRoot(here, exists = fs.existsSync) {
|
|
57
|
+
const candidates = skillsRootCandidates(here);
|
|
43
58
|
for (const c of candidates) {
|
|
44
|
-
if (
|
|
59
|
+
if (exists(c))
|
|
45
60
|
return c;
|
|
46
61
|
}
|
|
47
62
|
return candidates[0];
|
|
48
63
|
}
|
|
49
|
-
const DEFAULT_SKILLS_ROOT =
|
|
64
|
+
const DEFAULT_SKILLS_ROOT = pickSkillsRoot(path.dirname(fileURLToPath(import.meta.url)));
|
|
50
65
|
/**
|
|
51
66
|
* Return the absolute path to the skills root directory. Production: the
|
|
52
67
|
* bundled `packages/server/src/skills/` (or its dist mirror). Tests pass
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/tool-surface/discover.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,+DAA+D;AAC/D,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,CAAC,MAAM,gBAAgB,GA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O,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAEzF;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,UAAmB;IAC/C,OAAO,UAAU,IAAI,mBAAmB,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB,EAAE,UAAmB;IACrE,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IAC9E,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QAClE,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAAC,OAAgB;IAC3D,MAAM,CAAC,GAAG,OAAO,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAClC,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC;QAChD,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC;KAC1C,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhixuan92/multi-model-agent-core",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Core library for multi-model-agent: provider runners (Claude, Codex, OpenAI-compatible), routing logic, config schema, and tool/sandbox primitives.",
|