ai-jue-adapter-hermes 0.2.2 → 0.3.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/confirm.d.ts +3 -4
- package/dist/confirm.js +16 -9
- package/dist/confirm.js.map +1 -1
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -20
- package/dist/index.js.map +1 -1
- package/dist/read.d.ts +3 -5
- package/dist/read.js +2 -2
- package/dist/read.js.map +1 -1
- package/dist/write.d.ts +2 -12
- package/dist/write.js +3 -3
- package/dist/write.js.map +1 -1
- package/package.json +10 -3
package/dist/confirm.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ArtifactResult, Confirmation } from "ai-jue-core";
|
|
1
|
+
import type { ArtifactResult, Confirmation, ConfirmContext as CoreConfirmContext } from "ai-jue-core";
|
|
2
2
|
import { type HermesArtifactKind } from "./capabilities/layout";
|
|
3
|
-
export interface ConfirmContext {
|
|
4
|
-
projectRoot: string;
|
|
3
|
+
export interface ConfirmContext extends CoreConfirmContext {
|
|
5
4
|
artifactKind?: HermesArtifactKind;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
@@ -12,7 +11,7 @@ export interface ConfirmContext {
|
|
|
12
11
|
* (D:\devuser\.hermes\bin\tirith, 9.8MB), which exposes
|
|
13
12
|
* `config validate` for the on-disk config tree.
|
|
14
13
|
*
|
|
15
|
-
* We invoke `tirith config validate <
|
|
14
|
+
* We invoke `tirith config validate <artifactRoot>` against the
|
|
16
15
|
* freshly-written workspace (Atomically swap the real cwr fixture
|
|
17
16
|
* into a temp HOME, run validate, swap back — preserves the operator's
|
|
18
17
|
* real Hermes state in the rare case the user has one on the same
|
package/dist/confirm.js
CHANGED
|
@@ -18,7 +18,7 @@ const TARGET = "hermes";
|
|
|
18
18
|
* (D:\devuser\.hermes\bin\tirith, 9.8MB), which exposes
|
|
19
19
|
* `config validate` for the on-disk config tree.
|
|
20
20
|
*
|
|
21
|
-
* We invoke `tirith config validate <
|
|
21
|
+
* We invoke `tirith config validate <artifactRoot>` against the
|
|
22
22
|
* freshly-written workspace (Atomically swap the real cwr fixture
|
|
23
23
|
* into a temp HOME, run validate, swap back — preserves the operator's
|
|
24
24
|
* real Hermes state in the rare case the user has one on the same
|
|
@@ -30,9 +30,9 @@ const TARGET = "hermes";
|
|
|
30
30
|
* confirmation without executing generated Python.
|
|
31
31
|
*/
|
|
32
32
|
async function confirm(_results, context) {
|
|
33
|
-
if ((context.artifactKind ?? (0, layout_1.detectArtifactKind)(context.
|
|
34
|
-
const manifest = path_1.default.join(context.
|
|
35
|
-
const initializer = path_1.default.join(context.
|
|
33
|
+
if ((context.artifactKind ?? (0, layout_1.detectArtifactKind)(context.artifactRoot)) === "skill-plugin") {
|
|
34
|
+
const manifest = path_1.default.join(context.artifactRoot, "plugin.yaml");
|
|
35
|
+
const initializer = path_1.default.join(context.artifactRoot, "__init__.py");
|
|
36
36
|
if (!(0, fs_1.existsSync)(manifest) || !(0, fs_1.existsSync)(initializer)) {
|
|
37
37
|
return {
|
|
38
38
|
target: TARGET,
|
|
@@ -48,7 +48,7 @@ async function confirm(_results, context) {
|
|
|
48
48
|
evidence: "skill-plugin __init__.py does not register skills",
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
const skillsRoot = path_1.default.join(context.
|
|
51
|
+
const skillsRoot = path_1.default.join(context.artifactRoot, "skills");
|
|
52
52
|
if ((0, fs_1.existsSync)(skillsRoot)) {
|
|
53
53
|
for (const entry of (0, fs_1.readdirSync)(skillsRoot, { withFileTypes: true })) {
|
|
54
54
|
if (!entry.isDirectory())
|
|
@@ -68,8 +68,8 @@ async function confirm(_results, context) {
|
|
|
68
68
|
evidence: "Hermes skill-plugin structure validated: plugin.yaml, register_skill initializer, and skill roots",
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
if (!(0, fs_1.existsSync)(context.
|
|
72
|
-
return { target: TARGET, status: "failed", evidence: "
|
|
71
|
+
if (!(0, fs_1.existsSync)(context.artifactRoot)) {
|
|
72
|
+
return { target: TARGET, status: "failed", evidence: "artifactRoot does not exist" };
|
|
73
73
|
}
|
|
74
74
|
// Stage the workspace under a fresh HOME so `tirith config validate`
|
|
75
75
|
// doesn't pick up the operator's real Hermes state.
|
|
@@ -80,7 +80,7 @@ async function confirm(_results, context) {
|
|
|
80
80
|
// did) makes Node treat the whole string as a literal executable
|
|
81
81
|
// name and always throw ENOENT, since execFileSync never invokes a
|
|
82
82
|
// shell to tokenize it.
|
|
83
|
-
const result = (0, child_process_1.execFileSync)("tirith", ["config", "validate", context.
|
|
83
|
+
const result = (0, child_process_1.execFileSync)("tirith", ["config", "validate", context.artifactRoot], {
|
|
84
84
|
encoding: "utf8",
|
|
85
85
|
env: { ...process.env, HOME: tempHome, HERMES_HOME: tempHome },
|
|
86
86
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -96,10 +96,17 @@ async function confirm(_results, context) {
|
|
|
96
96
|
return {
|
|
97
97
|
target: TARGET,
|
|
98
98
|
status: "confirmed",
|
|
99
|
-
evidence: `tirith config validate ran cleanly against ${context.
|
|
99
|
+
evidence: `tirith config validate ran cleanly against ${context.artifactRoot}: ${result.slice(0, 200)}`,
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
catch (error) {
|
|
103
|
+
if (error && typeof error === "object" && error.code === "ENOENT") {
|
|
104
|
+
return {
|
|
105
|
+
target: TARGET,
|
|
106
|
+
status: "unconfirmed",
|
|
107
|
+
evidence: "tirith is not available on PATH; workspace validation was not run",
|
|
108
|
+
};
|
|
109
|
+
}
|
|
103
110
|
const stderr = error && typeof error === "object" && "stderr" in error
|
|
104
111
|
? String(error.stderr)
|
|
105
112
|
: "";
|
package/dist/confirm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm.js","sourceRoot":"","sources":["../src/confirm.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"confirm.js","sour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,WAAW,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE;SACvJ,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,IAAA,WAAM,EAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
export { read } from "./read";
|
|
2
|
-
export type { ReadContext } from "./read";
|
|
3
|
-
export { write } from "./write";
|
|
4
|
-
export type { WriteContext } from "./write";
|
|
5
|
-
export { confirm } from "./confirm";
|
|
6
|
-
export type { ConfirmContext } from "./confirm";
|
|
7
|
-
export { detectArtifactKind } from "./capabilities/layout";
|
|
8
|
-
/**
|
|
9
|
-
* `jue apply`'s Hermes entry point: thin wrapper, parallel to Claude
|
|
10
|
-
* and Codex. Kept for the legacy `jue apply --all` path while the
|
|
11
|
-
* canonical JUE-103 contract is the `Adapter` default export below.
|
|
12
|
-
*/
|
|
13
|
-
export declare function generate(config: any, outputDir: string): Promise<void>;
|
|
14
1
|
declare const _default: import("ai-jue-core").ExtensionDefinition;
|
|
15
2
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.detectArtifactKind = exports.confirm = exports.write = exports.read = void 0;
|
|
4
|
-
exports.generate = generate;
|
|
5
3
|
const ai_jue_core_1 = require("ai-jue-core");
|
|
6
4
|
const confirm_1 = require("./confirm");
|
|
7
5
|
const read_1 = require("./read");
|
|
8
6
|
const write_1 = require("./write");
|
|
9
|
-
var read_2 = require("./read");
|
|
10
|
-
Object.defineProperty(exports, "read", { enumerable: true, get: function () { return read_2.read; } });
|
|
11
|
-
var write_2 = require("./write");
|
|
12
|
-
Object.defineProperty(exports, "write", { enumerable: true, get: function () { return write_2.write; } });
|
|
13
|
-
var confirm_2 = require("./confirm");
|
|
14
|
-
Object.defineProperty(exports, "confirm", { enumerable: true, get: function () { return confirm_2.confirm; } });
|
|
15
|
-
var layout_1 = require("./capabilities/layout");
|
|
16
|
-
Object.defineProperty(exports, "detectArtifactKind", { enumerable: true, get: function () { return layout_1.detectArtifactKind; } });
|
|
17
|
-
/**
|
|
18
|
-
* `jue apply`'s Hermes entry point: thin wrapper, parallel to Claude
|
|
19
|
-
* and Codex. Kept for the legacy `jue apply --all` path while the
|
|
20
|
-
* canonical JUE-103 contract is the `Adapter` default export below.
|
|
21
|
-
*/
|
|
22
|
-
async function generate(config, outputDir) {
|
|
23
|
-
const canonical = (0, ai_jue_core_1.toCanonicalDocument)(config);
|
|
24
|
-
const changes = await (0, write_1.write)(canonical, { projectRoot: outputDir });
|
|
25
|
-
(0, ai_jue_core_1.applyChangesOrThrow)(outputDir, changes);
|
|
26
|
-
}
|
|
27
7
|
const hermesAdapter = {
|
|
28
8
|
id: "hermes",
|
|
29
9
|
capabilities: {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,6CAA8C;AAE9C,uCAAoC;AACpC,iCAA8B;AAC9B,mCAAgC;AAEhC,MAAM,aAAa,GAAY;IAC7B,EAAE,EAAE,QAAQ;IACZ,YAAY,EAAE;QACZ,uEAAuE;QACvE,qEAAqE;QACrE,KAAK,EAAE,aAAa;QACpB,mEAAmE;QACnE,gEAAgE;QAChE,oEAAoE;QACpE,QAAQ,EAAE,UAAU;QACpB,+DAA+D;QAC/D,sCAAsC;QACtC,MAAM,EAAE,WAAW;QACnB,kEAAkE;QAClE,8CAA8C;QAC9C,MAAM,EAAE,UAAU;QAClB,+DAA+D;QAC/D,6DAA6D;QAC7D,kCAAkC;QAClC,KAAK,EAAE,aAAa;QACpB,6DAA6D;QAC7D,+DAA+D;QAC/D,GAAG,EAAE,WAAW;KACjB;IACD,IAAI,EAAJ,WAAI;IACJ,KAAK,EAAL,aAAK;IACL,OAAO,EAAP,iBAAO;CACR,CAAC;AAEF,kBAAe,IAAA,6BAAe,EAAC,EAAE,QAAQ,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC"}
|
package/dist/read.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type { CanonicalDocument } from "ai-jue-core";
|
|
2
|
-
export
|
|
3
|
-
projectRoot: string;
|
|
4
|
-
}
|
|
1
|
+
import type { CanonicalDocument, ReadContext as CoreReadContext } from "ai-jue-core";
|
|
2
|
+
export type ReadContext = CoreReadContext;
|
|
5
3
|
/**
|
|
6
4
|
* Hermes Adapter's read: thin composition over a small subset of the
|
|
7
5
|
* real `cwr:/d/devuser/.hermes` surface — per the JUE-303 honest-stance
|
|
@@ -14,4 +12,4 @@ export interface ReadContext {
|
|
|
14
12
|
* - `skills` ← `skills/<cat>/<name>/SKILL.md` (3-level shape)
|
|
15
13
|
* - `cron` ← `cron/jobs.json` (full-file pass-through)
|
|
16
14
|
*/
|
|
17
|
-
export declare function read({
|
|
15
|
+
export declare function read({ artifactRoot }: ReadContext): Promise<CanonicalDocument>;
|
package/dist/read.js
CHANGED
|
@@ -18,7 +18,7 @@ const skills_1 = require("./capabilities/skills");
|
|
|
18
18
|
* - `skills` ← `skills/<cat>/<name>/SKILL.md` (3-level shape)
|
|
19
19
|
* - `cron` ← `cron/jobs.json` (full-file pass-through)
|
|
20
20
|
*/
|
|
21
|
-
async function read({
|
|
21
|
+
async function read({ artifactRoot }) {
|
|
22
22
|
const canonical = (0, ai_jue_core_1.readCapabilities)({
|
|
23
23
|
context: (0, context_1.context)(),
|
|
24
24
|
hooks: { read: () => undefined, write: () => [] },
|
|
@@ -27,7 +27,7 @@ async function read({ projectRoot }) {
|
|
|
27
27
|
mcp: (0, mcp_1.mcp)(),
|
|
28
28
|
skills: (0, skills_1.skills)(),
|
|
29
29
|
cron: (0, cron_1.cron)(),
|
|
30
|
-
},
|
|
30
|
+
}, artifactRoot);
|
|
31
31
|
return (0, ai_jue_core_1.toCanonicalDocument)(canonical);
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=read.js.map
|
package/dist/read.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":";;AAqBA,oBAcC;AAnCD,6CAAoE;AAEpE,oDAAiD;AACjD,8CAA2C;AAC3C,4CAAyC;AACzC,kDAA+C;AAI/C;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,IAAI,CAAC,EAAE,YAAY,EAAe;IACtD,MAAM,SAAS,GAAG,IAAA,8BAAgB,EAChC;QACE,OAAO,EAAE,IAAA,iBAAO,GAAE;QAClB,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;QACjD,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;QACpD,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;QAClD,GAAG,EAAE,IAAA,SAAG,GAAE;QACV,MAAM,EAAE,IAAA,eAAM,GAAE;QAChB,IAAI,EAAE,IAAA,WAAI,GAAE;KACb,EACD,YAAY,CACb,CAAC;IACF,OAAO,IAAA,iCAAmB,EAAC,SAA+C,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/write.d.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import type { ArtifactChange, CanonicalDocument } from "ai-jue-core";
|
|
2
|
-
export
|
|
3
|
-
projectRoot: string;
|
|
4
|
-
/** Defaults to `"workspace"`. `skill-plugin` emits a thin installable skill pack. */
|
|
5
|
-
artifactKind?: string;
|
|
6
|
-
toolsConfig?: Record<string, unknown>;
|
|
7
|
-
pluginManifest?: {
|
|
8
|
-
name: string;
|
|
9
|
-
version: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
1
|
+
import type { ArtifactChange, CanonicalDocument, WriteContext as CoreWriteContext } from "ai-jue-core";
|
|
2
|
+
export type WriteContext = CoreWriteContext;
|
|
13
3
|
/**
|
|
14
4
|
* Hermes Adapter write (RFC-0002):
|
|
15
5
|
* - workspace: MEMORY.md / skills/<cat>/<name> / config.yaml mcp / cron
|
package/dist/write.js
CHANGED
|
@@ -16,7 +16,7 @@ const TARGET = "hermes";
|
|
|
16
16
|
async function write(canonical, writeContext) {
|
|
17
17
|
const kind = writeContext.artifactKind ?? "workspace";
|
|
18
18
|
if (kind === "skill-plugin" || kind === "plugin") {
|
|
19
|
-
return (0, skill_plugin_1.writeSkillPlugin)(canonical, writeContext.
|
|
19
|
+
return (0, skill_plugin_1.writeSkillPlugin)(canonical, writeContext.artifactRoot, writeContext.pluginManifest);
|
|
20
20
|
}
|
|
21
21
|
if (kind === "compatible-bundle") {
|
|
22
22
|
throw new Error('Hermes does not use OpenClaw-style "compatible-bundle". ' +
|
|
@@ -33,9 +33,9 @@ async function write(canonical, writeContext) {
|
|
|
33
33
|
mcp: (0, mcp_1.mcp)(),
|
|
34
34
|
skills: (0, skills_1.skills)(),
|
|
35
35
|
cron: (0, cron_1.cron)(),
|
|
36
|
-
}, canonical, writeContext.
|
|
36
|
+
}, canonical, writeContext.artifactRoot, TARGET);
|
|
37
37
|
if (canonical.context?.global) {
|
|
38
|
-
result.push(...(0, context_1.context)().write(writeContext.
|
|
38
|
+
result.push(...(0, context_1.context)().write(writeContext.artifactRoot, { global: canonical.context.global ?? "" }, TARGET));
|
|
39
39
|
}
|
|
40
40
|
return result;
|
|
41
41
|
}
|
package/dist/write.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.js","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"write.js","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":";;AAqBA,sBA+CC;AApED,6CAAgD;AAMhD,oDAAiD;AACjD,8CAA2C;AAC3C,4CAAyC;AACzC,8DAA+D;AAC/D,kDAA+C;AAI/C,MAAM,MAAM,GAAG,QAAQ,CAAC;AAExB;;;;GAIG;AACI,KAAK,UAAU,KAAK,CACzB,SAA4B,EAC5B,YAA0B;IAE1B,MAAM,IAAI,GAAG,YAAY,CAAC,YAAY,IAAI,WAAW,CAAC;IAEtD,IAAI,IAAI,KAAK,cAAc,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACjD,OAAO,IAAA,+BAAgB,EAAC,SAAS,EAAE,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;IAC7F,CAAC;IACD,IAAI,IAAI,KAAK,mBAAmB,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,0DAA0D;YACxD,iEAAiE;YACjE,wDAAwD,CAC3D,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CACb,kDAAkD,IAAI,wCAAwC,CAC/F,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,IAAA,+BAAiB,EAC9B;QACE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;QACjD,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;QACpD,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;QAClD,GAAG,EAAE,IAAA,SAAG,GAAE;QACV,MAAM,EAAE,IAAA,eAAM,GAAE;QAChB,IAAI,EAAE,IAAA,WAAI,GAAE;KACb,EACD,SAA+C,EAC/C,YAAY,CAAC,YAAY,EACzB,MAAM,CACP,CAAC;IAEF,IAAI,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,CACT,GAAG,IAAA,iBAAO,GAAE,CAAC,KAAK,CAChB,YAAY,CAAC,YAAY,EACzB,EAAE,MAAM,EAAG,SAAS,CAAC,OAA+B,CAAC,MAAM,IAAI,EAAE,EAAE,EACnE,MAAM,CACP,CACF,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-jue-adapter-hermes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Adapter for generating Hermes configurations.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
7
14
|
"scripts": {
|
|
8
15
|
"build": "tsc"
|
|
9
16
|
},
|
|
10
17
|
"dependencies": {
|
|
11
|
-
"ai-jue-core": "*",
|
|
12
18
|
"js-yaml": "^4.3.1"
|
|
13
19
|
},
|
|
14
20
|
"peerDependencies": {
|
|
15
|
-
"ai-jue-core": "
|
|
21
|
+
"ai-jue-core": "^2.0.0"
|
|
16
22
|
},
|
|
17
23
|
"devDependencies": {
|
|
18
24
|
"@types/js-yaml": "^4.0.9",
|
|
25
|
+
"ai-jue-core": "^2.0.0",
|
|
19
26
|
"typescript": "^5.0.0"
|
|
20
27
|
},
|
|
21
28
|
"author": "AI-Jue Team <contact@ai-jue.dev>",
|