@roll-agent/core 0.1.1 → 0.1.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/agent.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/agent.ts"],"names":[],"mappings":";AAYA,wBAWG"}
|
|
@@ -1,14 +1,27 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
1
9
|
import { defineCommand } from "citty";
|
|
10
|
+
const commandExtension = import.meta.url.endsWith(".ts") ? "ts" : "js";
|
|
11
|
+
function loadAgentCommand(fileName) {
|
|
12
|
+
const specifier = new URL(`./${fileName}.${commandExtension}`, import.meta.url).href;
|
|
13
|
+
return import(__rewriteRelativeImportExtension(specifier)).then((m) => m.default);
|
|
14
|
+
}
|
|
2
15
|
export default defineCommand({
|
|
3
16
|
meta: { description: "管理 Agent(stdio 按需生命周期)" },
|
|
4
17
|
subCommands: {
|
|
5
|
-
add: () =>
|
|
6
|
-
remove: () =>
|
|
7
|
-
list: () =>
|
|
8
|
-
start: () =>
|
|
9
|
-
stop: () =>
|
|
10
|
-
info: () =>
|
|
11
|
-
health: () =>
|
|
18
|
+
add: () => loadAgentCommand("agent-add"),
|
|
19
|
+
remove: () => loadAgentCommand("agent-remove"),
|
|
20
|
+
list: () => loadAgentCommand("agent-list"),
|
|
21
|
+
start: () => loadAgentCommand("agent-start"),
|
|
22
|
+
stop: () => loadAgentCommand("agent-stop"),
|
|
23
|
+
info: () => loadAgentCommand("agent-info"),
|
|
24
|
+
health: () => loadAgentCommand("agent-health"),
|
|
12
25
|
},
|
|
13
26
|
});
|
|
14
27
|
//# sourceMappingURL=agent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/cli/commands/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/cli/commands/agent.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAEvE,SAAS,gBAAgB,CAAC,QAAgB;IACxC,MAAM,SAAS,GAAG,IAAI,GAAG,CACvB,KAAK,QAAQ,IAAI,gBAAgB,EAAE,EACnC,MAAM,CAAC,IAAI,CAAC,GAAG,CAChB,CAAC,IAAI,CAAC;IACP,OAAO,MAAM,kCAAC,SAAS,EAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAClD,CAAC;AAED,eAAe,aAAa,CAAC;IAC3B,IAAI,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE;IAC/C,WAAW,EAAE;QACX,GAAG,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC;QACxC,MAAM,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,cAAc,CAAC;QAC9C,IAAI,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,YAAY,CAAC;QAC1C,KAAK,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,aAAa,CAAC;QAC5C,IAAI,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,YAAY,CAAC;QAC1C,IAAI,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,YAAY,CAAC;QAC1C,MAAM,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,cAAc,CAAC;KAC/C;CACF,CAAC,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
1
9
|
import { defineCommand, runMain } from "citty";
|
|
2
10
|
import chalk from "chalk";
|
|
3
11
|
import { checkForUpdate, getCurrentVersion } from "./utils/update-checker.js";
|
|
4
12
|
const CLI_VERSION = getCurrentVersion();
|
|
13
|
+
const commandExtension = import.meta.url.endsWith(".ts") ? "ts" : "js";
|
|
14
|
+
function loadMainCommand(commandName) {
|
|
15
|
+
const specifier = new URL(`./commands/${commandName}.${commandExtension}`, import.meta.url).href;
|
|
16
|
+
return import(__rewriteRelativeImportExtension(specifier)).then((m) => m.default);
|
|
17
|
+
}
|
|
5
18
|
const main = defineCommand({
|
|
6
19
|
meta: {
|
|
7
20
|
name: "roll",
|
|
@@ -9,12 +22,12 @@ const main = defineCommand({
|
|
|
9
22
|
description: "花卷 Agent — 轻量级 Agent 编排系统",
|
|
10
23
|
},
|
|
11
24
|
subCommands: {
|
|
12
|
-
agent: () =>
|
|
13
|
-
run: () =>
|
|
14
|
-
ask: () =>
|
|
15
|
-
config: () =>
|
|
16
|
-
doctor: () =>
|
|
17
|
-
update: () =>
|
|
25
|
+
agent: () => loadMainCommand("agent"),
|
|
26
|
+
run: () => loadMainCommand("run"),
|
|
27
|
+
ask: () => loadMainCommand("ask"),
|
|
28
|
+
config: () => loadMainCommand("config"),
|
|
29
|
+
doctor: () => loadMainCommand("doctor"),
|
|
30
|
+
update: () => loadMainCommand("update"),
|
|
18
31
|
},
|
|
19
32
|
});
|
|
20
33
|
// 启动提示只读缓存,保证不阻塞 CLI 退出。
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9E,MAAM,WAAW,GAAG,iBAAiB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9E,MAAM,WAAW,GAAG,iBAAiB,EAAE,CAAC;AACxC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAEvE,SAAS,eAAe,CAAC,WAAmB;IAC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,yBAAyB,IAAI,CAAC,OAAO,UAAU,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CACpJ,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;SACD,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roll-agent/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/steveoon/roll-agent"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/steveoon/roll-agent",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/steveoon/roll-agent/issues"
|
|
12
|
+
},
|
|
5
13
|
"exports": {
|
|
6
14
|
".": {
|
|
7
15
|
"types": "./dist/cli/index.d.ts",
|