shipmyagent 1.0.32 → 1.0.37
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/bin/cli.js +44 -8
- package/bin/cli.js.map +1 -1
- package/bin/commands/alias.d.ts.map +1 -0
- package/bin/commands/alias.js +67 -0
- package/bin/commands/alias.js.map +1 -0
- package/bin/commands/init.d.ts.map +1 -1
- package/bin/commands/init.js +33 -8
- package/bin/commands/init.js.map +1 -1
- package/bin/commands/start.d.ts.map +1 -1
- package/bin/commands/start.js +119 -62
- package/bin/commands/start.js.map +1 -1
- package/bin/integrations/feishu.d.ts.map +1 -1
- package/bin/integrations/feishu.js +3 -4
- package/bin/integrations/feishu.js.map +1 -1
- package/bin/integrations/telegram.d.ts.map +1 -1
- package/bin/integrations/telegram.js +113 -15
- package/bin/integrations/telegram.js.map +1 -1
- package/bin/runtime/agent.d.ts.map +1 -1
- package/bin/runtime/agent.js +210 -61
- package/bin/runtime/agent.js.map +1 -1
- package/bin/runtime/mcp-manager.d.ts.map +1 -0
- package/bin/runtime/mcp-manager.js +270 -0
- package/bin/runtime/mcp-manager.js.map +1 -0
- package/bin/runtime/mcp-types.d.ts.map +1 -0
- package/bin/runtime/mcp-types.js +5 -0
- package/bin/runtime/mcp-types.js.map +1 -0
- package/bin/runtime/permission.d.ts.map +1 -1
- package/bin/runtime/permission.js +21 -0
- package/bin/runtime/permission.js.map +1 -1
- package/bin/runtime/ship-prompts.d.ts.map +1 -1
- package/bin/runtime/ship-prompts.js +18 -38
- package/bin/runtime/ship-prompts.js.map +1 -1
- package/bin/runtime/task-executor.d.ts.map +1 -1
- package/bin/runtime/task-executor.js +18 -0
- package/bin/runtime/task-executor.js.map +1 -1
- package/bin/schemas/mcp.schema.d.ts.map +1 -0
- package/bin/schemas/mcp.schema.js +64 -0
- package/bin/schemas/mcp.schema.js.map +1 -0
- package/bin/schemas/ship.schema.d.ts.map +1 -0
- package/bin/schemas/ship.schema.js +144 -0
- package/bin/schemas/ship.schema.js.map +1 -0
- package/bin/utils.d.ts.map +1 -1
- package/bin/utils.js +13 -1
- package/bin/utils.js.map +1 -1
- package/package.json +2 -1
- package/src/runtime/prompts.txt +36 -0
package/bin/cli.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Command } from "commander";
|
|
3
3
|
import { initCommand } from "./commands/init.js";
|
|
4
4
|
import { startCommand } from "./commands/start.js";
|
|
5
|
+
import { aliasCommand } from "./commands/alias.js";
|
|
5
6
|
import { readFileSync } from "fs";
|
|
6
7
|
import { join, dirname, basename } from "path";
|
|
7
8
|
import { fileURLToPath } from "url";
|
|
@@ -11,24 +12,59 @@ const __dirname = dirname(__filename);
|
|
|
11
12
|
// 动态读取版本号
|
|
12
13
|
const packageJson = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf-8"));
|
|
13
14
|
const program = new Command();
|
|
15
|
+
const parsePort = (value) => {
|
|
16
|
+
const num = Number.parseInt(value, 10);
|
|
17
|
+
if (!Number.isFinite(num) || Number.isNaN(num) || !Number.isInteger(num) || num <= 0 || num > 65535) {
|
|
18
|
+
throw new Error(`Invalid port: ${value}`);
|
|
19
|
+
}
|
|
20
|
+
return num;
|
|
21
|
+
};
|
|
22
|
+
const parseBoolean = (value) => {
|
|
23
|
+
if (value === undefined)
|
|
24
|
+
return true;
|
|
25
|
+
const s = String(value).trim().toLowerCase();
|
|
26
|
+
if (["true", "1", "yes", "y", "on"].includes(s))
|
|
27
|
+
return true;
|
|
28
|
+
if (["false", "0", "no", "n", "off"].includes(s))
|
|
29
|
+
return false;
|
|
30
|
+
throw new Error(`Invalid boolean: ${value}`);
|
|
31
|
+
};
|
|
14
32
|
program
|
|
15
33
|
.name(basename(process.argv[1] || "shipmyagent"))
|
|
16
34
|
.description("把一个代码仓库,启动成一个可对话、可调度、可审计的 Agent Runtime")
|
|
17
|
-
.version(packageJson.version);
|
|
35
|
+
.version(packageJson.version, "-v, --version");
|
|
36
|
+
// Avoid -h (reserved for host), use --help only.
|
|
37
|
+
program.helpOption("--help", "display help for command");
|
|
18
38
|
// Init command
|
|
19
|
-
program
|
|
39
|
+
const init = program
|
|
20
40
|
.command("init [path]")
|
|
21
41
|
.description("初始化 ShipMyAgent 项目")
|
|
42
|
+
.helpOption("--help", "display help for command")
|
|
22
43
|
.action(initCommand);
|
|
23
44
|
// Start command
|
|
24
|
-
program
|
|
45
|
+
const start = program
|
|
25
46
|
.command("start [path]")
|
|
26
47
|
.description("启动 Agent Runtime")
|
|
27
|
-
.option("-p, --port <port>", "
|
|
28
|
-
.option("-h, --host <host>", "
|
|
29
|
-
.option("--interactive-web", "启动交互式 Web
|
|
30
|
-
.option("--interactive-port <port>", "交互式 Web
|
|
48
|
+
.option("-p, --port <port>", "服务端口(可在 ship.json 的 start.port 配置)", parsePort)
|
|
49
|
+
.option("-h, --host <host>", "服务主机(可在 ship.json 的 start.host 配置)")
|
|
50
|
+
.option("--interactive-web [enabled]", "启动交互式 Web 界面(可在 ship.json 的 start.interactiveWeb 配置)", parseBoolean)
|
|
51
|
+
.option("--interactive-port <port>", "交互式 Web 界面端口(可在 ship.json 的 start.interactivePort 配置)", parsePort)
|
|
52
|
+
.helpOption("--help", "display help for command")
|
|
31
53
|
.action(startCommand);
|
|
32
|
-
|
|
54
|
+
const alias = program
|
|
55
|
+
.command("alias")
|
|
56
|
+
.description("在 .zshrc / .bashrc 中写入 `alias sma=\"shipmyagent\"`")
|
|
57
|
+
.option("--shell <shell>", "指定写入的 shell: zsh | bash | both", "both")
|
|
58
|
+
.option("--dry-run", "只打印将要修改的文件,不实际写入", false)
|
|
59
|
+
.option("--print", "仅打印 alias 内容(用于 eval)", false)
|
|
60
|
+
.helpOption("--help", "display help for command")
|
|
61
|
+
.action(aliasCommand);
|
|
62
|
+
// Default: `shipmyagent` / `shipmyagent .` / `shipmyagent [start-options]` => `shipmyagent start [path]`
|
|
63
|
+
const firstArg = process.argv[2];
|
|
64
|
+
if (!firstArg ||
|
|
65
|
+
(![init.name(), start.name(), alias.name(), "help"].includes(firstArg) &&
|
|
66
|
+
!["--help", "-v", "--version"].includes(firstArg))) {
|
|
67
|
+
process.argv.splice(2, 0, "start");
|
|
68
|
+
}
|
|
33
69
|
program.parse();
|
|
34
70
|
//# sourceMappingURL=cli.js.map
|
package/bin/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,uBAAuB;AACvB,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,UAAU;AACV,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC5B,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAC1D,CAAC;AAEF,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC;KAChD,WAAW,CACV,yCAAyC,CAC1C;KACA,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO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AAO,CAAC,IAAI,CAAC,CA+C5E"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import os from "os";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import fs from "fs-extra";
|
|
4
|
+
function upsertAliasBlock(content, aliasLine) {
|
|
5
|
+
const start = "# >>> shipmyagent alias >>>";
|
|
6
|
+
const end = "# <<< shipmyagent alias <<<";
|
|
7
|
+
const block = `${start}\n${aliasLine}\n${end}\n`;
|
|
8
|
+
const startIdx = content.indexOf(start);
|
|
9
|
+
const endIdx = content.indexOf(end);
|
|
10
|
+
if (startIdx !== -1 && endIdx !== -1 && endIdx > startIdx) {
|
|
11
|
+
const before = content.slice(0, startIdx).replace(/\s*$/, "");
|
|
12
|
+
const after = content.slice(endIdx + end.length).replace(/^\s*\n?/, "\n");
|
|
13
|
+
const next = `${before}\n\n${block}${after}`.replace(/\n{4,}/g, "\n\n\n");
|
|
14
|
+
return { next, changed: next !== content };
|
|
15
|
+
}
|
|
16
|
+
const aliasRegex = /^\s*alias\s+sma\s*=/m;
|
|
17
|
+
if (aliasRegex.test(content)) {
|
|
18
|
+
return { next: content, changed: false };
|
|
19
|
+
}
|
|
20
|
+
const trimmed = content.replace(/\s*$/, "");
|
|
21
|
+
const prefix = trimmed.length > 0 ? `${trimmed}\n\n` : "";
|
|
22
|
+
const next = `${prefix}${block}`;
|
|
23
|
+
return { next, changed: true };
|
|
24
|
+
}
|
|
25
|
+
export async function aliasCommand(options = {}) {
|
|
26
|
+
const aliasLine = `alias sma="shipmyagent"`;
|
|
27
|
+
if (options.print) {
|
|
28
|
+
console.log(aliasLine);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const shell = String(options.shell || "both").toLowerCase();
|
|
32
|
+
const targets = shell === "zsh" ? ["zsh"] : shell === "bash" ? ["bash"] : ["zsh", "bash"];
|
|
33
|
+
const home = os.homedir();
|
|
34
|
+
const rcFiles = targets.map((s) => path.join(home, s === "zsh" ? ".zshrc" : ".bashrc"));
|
|
35
|
+
const changedFiles = [];
|
|
36
|
+
const skippedFiles = [];
|
|
37
|
+
for (const rcPath of rcFiles) {
|
|
38
|
+
const exists = await fs.pathExists(rcPath);
|
|
39
|
+
const current = exists ? await fs.readFile(rcPath, "utf-8") : "";
|
|
40
|
+
const { next, changed } = upsertAliasBlock(current, aliasLine);
|
|
41
|
+
if (!changed) {
|
|
42
|
+
skippedFiles.push(rcPath);
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (!options.dryRun) {
|
|
46
|
+
await fs.outputFile(rcPath, next, "utf-8");
|
|
47
|
+
}
|
|
48
|
+
changedFiles.push(rcPath);
|
|
49
|
+
}
|
|
50
|
+
if (options.dryRun) {
|
|
51
|
+
console.log("🔎 dry-run: will update");
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
console.log("✅ alias written");
|
|
55
|
+
}
|
|
56
|
+
for (const p of changedFiles)
|
|
57
|
+
console.log(`- ${p}`);
|
|
58
|
+
for (const p of skippedFiles)
|
|
59
|
+
console.log(`- (skip) ${p}`);
|
|
60
|
+
console.log("\n要在当前终端会话生效,请手动刷新:");
|
|
61
|
+
if (targets.includes("zsh"))
|
|
62
|
+
console.log(`- source ${path.join(home, ".zshrc")}`);
|
|
63
|
+
if (targets.includes("bash"))
|
|
64
|
+
console.log(`- source ${path.join(home, ".bashrc")}`);
|
|
65
|
+
console.log('- 或重新打开一个终端');
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=alias.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alias.js","sourceRoot":"","sources":["../../src/commands/alias.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,UAAU,CAAC;AAQ1B,SAAS,gBAAgB,CAAC,OAAe,EAAE,SAAiB;IAC1D,MAAM,KAAK,GAAG,6BAA6B,CAAC;IAC5C,MAAM,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
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AA0BA,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,WAAW,CAAC,GAAG,GAAE,MAAY,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmP7F"}
|
package/bin/commands/init.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import prompts from 'prompts';
|
|
3
3
|
import fs from 'fs-extra';
|
|
4
|
-
import { getAgentMdPath, getShipJsonPath, getShipDirPath, getTasksDirPath, getRunsDirPath, getQueueDirPath, getRoutesDirPath, getApprovalsDirPath, getLogsDirPath, getCacheDirPath, getChatsDirPath, ensureDir, saveJson, DEFAULT_SHIP_JSON, MODEL_CONFIGS, } from '../utils.js';
|
|
4
|
+
import { getAgentMdPath, getShipJsonPath, getShipDirPath, getTasksDirPath, getRunsDirPath, getQueueDirPath, getRoutesDirPath, getApprovalsDirPath, getLogsDirPath, getCacheDirPath, getChatsDirPath, getShipSchemaPath, getMcpDirPath, ensureDir, saveJson, DEFAULT_SHIP_JSON, MODEL_CONFIGS, } from '../utils.js';
|
|
5
|
+
import { SHIP_JSON_SCHEMA } from '../schemas/ship.schema.js';
|
|
6
|
+
import { MCP_JSON_SCHEMA } from '../schemas/mcp.schema.js';
|
|
5
7
|
export async function initCommand(cwd = '.', options = {}) {
|
|
6
8
|
const projectRoot = path.resolve(cwd);
|
|
7
9
|
const LLM_API_KEY = '${LLM_API_KEY}';
|
|
@@ -108,8 +110,15 @@ Help users understand and work with their codebase by exploring, analyzing, and
|
|
|
108
110
|
temperature: 0.7,
|
|
109
111
|
};
|
|
110
112
|
const shipConfig = {
|
|
113
|
+
$schema: DEFAULT_SHIP_JSON.$schema,
|
|
111
114
|
name: response.name || path.basename(projectRoot),
|
|
112
115
|
version: '1.0.0',
|
|
116
|
+
start: {
|
|
117
|
+
port: 3000,
|
|
118
|
+
host: '0.0.0.0',
|
|
119
|
+
interactiveWeb: false,
|
|
120
|
+
interactivePort: 3001,
|
|
121
|
+
},
|
|
113
122
|
llm: llmConfig,
|
|
114
123
|
permissions: DEFAULT_SHIP_JSON.permissions,
|
|
115
124
|
integrations: {
|
|
@@ -145,11 +154,17 @@ Help users understand and work with their codebase by exploring, analyzing, and
|
|
|
145
154
|
getLogsDirPath(projectRoot),
|
|
146
155
|
getCacheDirPath(projectRoot),
|
|
147
156
|
getChatsDirPath(projectRoot),
|
|
157
|
+
getMcpDirPath(projectRoot),
|
|
148
158
|
];
|
|
149
159
|
for (const dir of dirs) {
|
|
150
160
|
await ensureDir(dir);
|
|
151
161
|
}
|
|
152
162
|
console.log(`✅ Created .ship/ directory structure`);
|
|
163
|
+
// Write JSON schema for ship.json (for editor validation via "$schema")
|
|
164
|
+
const shipSchemaPath = getShipSchemaPath(projectRoot);
|
|
165
|
+
await ensureDir(path.dirname(shipSchemaPath));
|
|
166
|
+
await saveJson(shipSchemaPath, SHIP_JSON_SCHEMA);
|
|
167
|
+
console.log(`✅ Created ship.schema.json`);
|
|
153
168
|
// Create sample task file
|
|
154
169
|
const sampleTaskPath = path.join(getTasksDirPath(projectRoot), 'sample-task.md');
|
|
155
170
|
const notify = response.integration && response.integration !== 'none' ? response.integration : undefined;
|
|
@@ -168,6 +183,13 @@ Please scan the repository for TODO comments and generate a report.
|
|
|
168
183
|
: sampleTaskContent;
|
|
169
184
|
await fs.writeFile(sampleTaskPath, finalSampleTaskContent);
|
|
170
185
|
console.log(`✅ Created sample task file`);
|
|
186
|
+
// Create default mcp.json file in .ship/mcp/ directory
|
|
187
|
+
const mcpDirPath = getMcpDirPath(projectRoot);
|
|
188
|
+
const mcpSchemaPath = path.join(mcpDirPath, 'mcp.schema.json');
|
|
189
|
+
const mcpJsonPath = path.join(mcpDirPath, 'mcp.json');
|
|
190
|
+
await saveJson(mcpSchemaPath, MCP_JSON_SCHEMA);
|
|
191
|
+
await saveJson(mcpJsonPath, { $schema: './mcp.schema.json', servers: {} });
|
|
192
|
+
console.log(`✅ Created .ship/mcp/mcp.json (MCP configuration)`);
|
|
171
193
|
console.log('\n🎉 Initialization complete!\n');
|
|
172
194
|
console.log(`📦 Current model: ${llmConfig.provider} / ${llmConfig.model}`);
|
|
173
195
|
console.log(`🌐 API URL: ${llmConfig.baseUrl}\n`);
|
|
@@ -190,22 +212,25 @@ Please scan the repository for TODO comments and generate a report.
|
|
|
190
212
|
console.log('Next steps:');
|
|
191
213
|
console.log(' 1. Edit Agent.md to customize agent behavior');
|
|
192
214
|
console.log(' 2. Edit ship.json to modify LLM configuration (baseUrl, apiKey, temperature, etc.)');
|
|
215
|
+
console.log(' 3. (Optional) Edit .ship/mcp/mcp.json to configure MCP servers for extended capabilities');
|
|
193
216
|
if (response.integration === 'feishu') {
|
|
194
|
-
console.log('
|
|
195
|
-
console.log('
|
|
217
|
+
console.log(' 4. Configure Feishu App ID and App Secret');
|
|
218
|
+
console.log(' 5. Run "shipmyagent start" to start the agent\n');
|
|
196
219
|
}
|
|
197
220
|
else if (response.integration === 'telegram') {
|
|
198
|
-
console.log('
|
|
199
|
-
console.log('
|
|
221
|
+
console.log(' 4. Configure Telegram Bot Token and Chat ID (optional)');
|
|
222
|
+
console.log(' 5. Run "shipmyagent start" to start the agent\n');
|
|
200
223
|
}
|
|
201
224
|
else if (response.integration === 'qq') {
|
|
202
|
-
console.log('
|
|
203
|
-
console.log('
|
|
225
|
+
console.log(' 4. Configure QQ App ID and App Secret');
|
|
226
|
+
console.log(' 5. Run "shipmyagent start" to start the agent\n');
|
|
204
227
|
}
|
|
205
228
|
else {
|
|
206
|
-
console.log('
|
|
229
|
+
console.log(' 4. Run "shipmyagent start" to start the agent\n');
|
|
207
230
|
}
|
|
208
231
|
console.log('💡 Tip: API Key is recommended to use environment variables (e.g. ${ANTHROPIC_API_KEY} or ${OPENAI_API_KEY})\n');
|
|
232
|
+
console.log('🔌 MCP Support: Configure MCP servers in .ship/mcp/mcp.json to connect to databases, APIs, and more');
|
|
233
|
+
console.log(' Learn more: https://modelcontextprotocol.io\n');
|
|
209
234
|
console.log('To switch models or modify configuration, edit the llm field in ship.json directly.\n');
|
|
210
235
|
}
|
|
211
236
|
//# sourceMappingURL=init.js.map
|
package/bin/commands/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,eAAe,EACf,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,aAAa,GAEd,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,aAAa,GAEd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAM3D,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAc,GAAG,EAAE,UAAuB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Root":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAwBA,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACnC;AAED,wBAAsB,YAAY,CAChC,GAAG,EAAE,MAAM,YAAM,EACjB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,IAAI,CAAC,CA4Tf"}
|
package/bin/commands/start.js
CHANGED
|
@@ -1,30 +1,54 @@
|
|
|
1
|
-
import path from
|
|
2
|
-
import fs from
|
|
3
|
-
import { createLogger } from
|
|
4
|
-
import { createPermissionEngine } from
|
|
5
|
-
import { createTaskScheduler } from
|
|
6
|
-
import { createTaskExecutor } from
|
|
7
|
-
import { createToolExecutor } from
|
|
8
|
-
import { createAgentRuntime } from
|
|
9
|
-
import { RunManager } from
|
|
10
|
-
import { RunWorker } from
|
|
11
|
-
import { createServer } from
|
|
12
|
-
import { createInteractiveServer } from
|
|
13
|
-
import { createTelegramBot } from
|
|
14
|
-
import { createFeishuBot } from
|
|
15
|
-
import { createQQBot } from
|
|
16
|
-
import { getAgentMdPath, getShipJsonPath, loadShipConfig,
|
|
17
|
-
import { DEFAULT_SHIP_PROMPTS } from
|
|
18
|
-
import { fileURLToPath } from
|
|
19
|
-
export async function startCommand(cwd =
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import { createLogger } from "../runtime/logger.js";
|
|
4
|
+
import { createPermissionEngine } from "../runtime/permission.js";
|
|
5
|
+
import { createTaskScheduler } from "../runtime/scheduler.js";
|
|
6
|
+
import { createTaskExecutor } from "../runtime/task-executor.js";
|
|
7
|
+
import { createToolExecutor } from "../runtime/tools.js";
|
|
8
|
+
import { createAgentRuntime } from "../runtime/agent.js";
|
|
9
|
+
import { RunManager } from "../runtime/run-manager.js";
|
|
10
|
+
import { RunWorker } from "../runtime/run-worker.js";
|
|
11
|
+
import { createServer } from "../server/index.js";
|
|
12
|
+
import { createInteractiveServer } from "../server/interactive.js";
|
|
13
|
+
import { createTelegramBot } from "../integrations/telegram.js";
|
|
14
|
+
import { createFeishuBot } from "../integrations/feishu.js";
|
|
15
|
+
import { createQQBot } from "../integrations/qq.js";
|
|
16
|
+
import { getAgentMdPath, getShipJsonPath, loadShipConfig, } from "../utils.js";
|
|
17
|
+
import { DEFAULT_SHIP_PROMPTS } from "../runtime/ship-prompts.js";
|
|
18
|
+
import { fileURLToPath } from "url";
|
|
19
|
+
export async function startCommand(cwd = ".", options) {
|
|
20
20
|
const projectRoot = path.resolve(cwd);
|
|
21
|
-
const isPlaceholder = (value) => value ===
|
|
22
|
-
|
|
21
|
+
const isPlaceholder = (value) => value === "${}";
|
|
22
|
+
const parsePort = (value, label) => {
|
|
23
|
+
if (value === undefined || value === null || value === "")
|
|
24
|
+
return undefined;
|
|
25
|
+
const num = typeof value === "number" ? value : Number.parseInt(String(value), 10);
|
|
26
|
+
if (!Number.isFinite(num) || Number.isNaN(num)) {
|
|
27
|
+
throw new Error(`${label} must be a number`);
|
|
28
|
+
}
|
|
29
|
+
if (!Number.isInteger(num) || num <= 0 || num > 65535) {
|
|
30
|
+
throw new Error(`${label} must be an integer between 1 and 65535`);
|
|
31
|
+
}
|
|
32
|
+
return num;
|
|
33
|
+
};
|
|
34
|
+
const parseBoolean = (value) => {
|
|
35
|
+
if (value === undefined || value === null || value === "")
|
|
36
|
+
return undefined;
|
|
37
|
+
if (typeof value === "boolean")
|
|
38
|
+
return value;
|
|
39
|
+
const s = String(value).trim().toLowerCase();
|
|
40
|
+
if (["true", "1", "yes", "y", "on"].includes(s))
|
|
41
|
+
return true;
|
|
42
|
+
if (["false", "0", "no", "n", "off"].includes(s))
|
|
43
|
+
return false;
|
|
44
|
+
return undefined;
|
|
45
|
+
};
|
|
46
|
+
let version = "unknown";
|
|
23
47
|
try {
|
|
24
48
|
const __filename = fileURLToPath(import.meta.url);
|
|
25
49
|
const __dirname = path.dirname(__filename);
|
|
26
|
-
const pkg = await fs.readJson(path.join(__dirname,
|
|
27
|
-
if (pkg && typeof pkg.version ===
|
|
50
|
+
const pkg = await fs.readJson(path.join(__dirname, "../../package.json"));
|
|
51
|
+
if (pkg && typeof pkg.version === "string")
|
|
28
52
|
version = pkg.version;
|
|
29
53
|
}
|
|
30
54
|
catch {
|
|
@@ -46,33 +70,51 @@ export async function startCommand(cwd = '.', options) {
|
|
|
46
70
|
shipConfig = loadShipConfig(projectRoot);
|
|
47
71
|
}
|
|
48
72
|
catch (error) {
|
|
49
|
-
console.error(
|
|
73
|
+
console.error("❌ Failed to read ship.json:", error);
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
// Resolve startup options: CLI flags override ship.json, then built-in defaults.
|
|
77
|
+
let port;
|
|
78
|
+
let interactivePort;
|
|
79
|
+
try {
|
|
80
|
+
port = parsePort(options.port, "port") ?? shipConfig.start?.port ?? 3000;
|
|
81
|
+
interactivePort =
|
|
82
|
+
parsePort(options.interactivePort, "interactivePort") ??
|
|
83
|
+
shipConfig.start?.interactivePort;
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
console.error("❌ Invalid start options:", error);
|
|
50
87
|
process.exit(1);
|
|
51
88
|
}
|
|
89
|
+
const host = (options.host ?? shipConfig.start?.host ?? "0.0.0.0").trim();
|
|
90
|
+
const interactiveWeb = parseBoolean(options.interactiveWeb) ??
|
|
91
|
+
shipConfig.start?.interactiveWeb ??
|
|
92
|
+
false;
|
|
52
93
|
// Create logger
|
|
53
|
-
const logger = createLogger(projectRoot,
|
|
54
|
-
logger.info(
|
|
94
|
+
const logger = createLogger(projectRoot, "info");
|
|
95
|
+
logger.info("=== ShipMyAgent Starting ===");
|
|
55
96
|
logger.info(`Project: ${projectRoot}`);
|
|
56
97
|
logger.info(`Model: ${shipConfig.llm?.provider} / ${shipConfig.llm?.model}`);
|
|
57
98
|
// Create permission engine
|
|
58
99
|
const permissionEngine = createPermissionEngine(projectRoot);
|
|
59
|
-
logger.info(
|
|
100
|
+
logger.info("Permission engine initialized");
|
|
60
101
|
// Create tool executor
|
|
61
102
|
const toolExecutor = createToolExecutor({
|
|
62
103
|
projectRoot,
|
|
63
104
|
permissionEngine,
|
|
64
105
|
logger,
|
|
65
106
|
});
|
|
66
|
-
logger.info(
|
|
107
|
+
logger.info("Tool executor initialized");
|
|
67
108
|
// Create Agent Runtime
|
|
68
|
-
const userAgentMd = fs
|
|
109
|
+
const userAgentMd = fs
|
|
110
|
+
.readFileSync(getAgentMdPath(projectRoot), "utf-8")
|
|
111
|
+
.trim();
|
|
69
112
|
const agentMd = [
|
|
70
|
-
userAgentMd ||
|
|
113
|
+
userAgentMd || "You are a helpful project assistant.",
|
|
71
114
|
`---\n\n${DEFAULT_SHIP_PROMPTS}`,
|
|
72
|
-
`---\n\n${DEFAULT_SHELL_GUIDE}`,
|
|
73
115
|
]
|
|
74
116
|
.filter(Boolean)
|
|
75
|
-
.join(
|
|
117
|
+
.join("\n\n");
|
|
76
118
|
const agentContext = {
|
|
77
119
|
projectRoot,
|
|
78
120
|
config: shipConfig,
|
|
@@ -80,21 +122,24 @@ export async function startCommand(cwd = '.', options) {
|
|
|
80
122
|
};
|
|
81
123
|
const agentRuntime = createAgentRuntime(agentContext);
|
|
82
124
|
await agentRuntime.initialize();
|
|
83
|
-
logger.info(
|
|
125
|
+
logger.info("Agent Runtime initialized");
|
|
84
126
|
// Create task executor
|
|
85
127
|
const taskExecutor = createTaskExecutor(toolExecutor, logger, agentRuntime, projectRoot);
|
|
86
|
-
logger.info(
|
|
128
|
+
logger.info("Task executor initialized");
|
|
87
129
|
// Create Run manager/worker (Tasks v2)
|
|
88
130
|
const runManager = new RunManager(projectRoot);
|
|
89
|
-
const runWorker = new RunWorker(projectRoot, logger, taskExecutor, {
|
|
131
|
+
const runWorker = new RunWorker(projectRoot, logger, taskExecutor, {
|
|
132
|
+
maxConcurrent: 1,
|
|
133
|
+
pollIntervalMs: 1000,
|
|
134
|
+
});
|
|
90
135
|
runWorker.start();
|
|
91
|
-
logger.info(
|
|
136
|
+
logger.info("Run worker started");
|
|
92
137
|
// Create task scheduler
|
|
93
138
|
const taskScheduler = createTaskScheduler(projectRoot, logger, async (task) => {
|
|
94
139
|
const run = await runManager.createAndEnqueueTaskRun(task);
|
|
95
140
|
logger.info(`Enqueued scheduled run: ${run.runId} (${task.id})`);
|
|
96
141
|
});
|
|
97
|
-
logger.info(
|
|
142
|
+
logger.info("Task scheduler initialized");
|
|
98
143
|
// Create server context
|
|
99
144
|
const serverContext = {
|
|
100
145
|
projectRoot,
|
|
@@ -109,23 +154,29 @@ export async function startCommand(cwd = '.', options) {
|
|
|
109
154
|
// Create Telegram Bot (if enabled)
|
|
110
155
|
let telegramBot = null;
|
|
111
156
|
if (shipConfig.integrations?.telegram?.enabled) {
|
|
112
|
-
logger.info(
|
|
157
|
+
logger.info("Telegram integration enabled");
|
|
113
158
|
telegramBot = createTelegramBot(projectRoot, shipConfig.integrations.telegram, logger);
|
|
114
159
|
}
|
|
115
160
|
// Create Feishu Bot (if enabled)
|
|
116
161
|
let feishuBot = null;
|
|
117
162
|
if (shipConfig.integrations?.feishu?.enabled) {
|
|
118
|
-
logger.info(
|
|
163
|
+
logger.info("Feishu integration enabled");
|
|
119
164
|
// Read Feishu configuration from environment variables or config
|
|
120
165
|
const feishuConfig = {
|
|
121
166
|
enabled: true,
|
|
122
|
-
appId: (shipConfig.integrations.feishu.appId &&
|
|
167
|
+
appId: (shipConfig.integrations.feishu.appId &&
|
|
168
|
+
!isPlaceholder(shipConfig.integrations.feishu.appId)
|
|
123
169
|
? shipConfig.integrations.feishu.appId
|
|
124
|
-
: undefined) ||
|
|
125
|
-
|
|
170
|
+
: undefined) ||
|
|
171
|
+
process.env.FEISHU_APP_ID ||
|
|
172
|
+
"",
|
|
173
|
+
appSecret: (shipConfig.integrations.feishu.appSecret &&
|
|
174
|
+
!isPlaceholder(shipConfig.integrations.feishu.appSecret)
|
|
126
175
|
? shipConfig.integrations.feishu.appSecret
|
|
127
|
-
: undefined) ||
|
|
128
|
-
|
|
176
|
+
: undefined) ||
|
|
177
|
+
process.env.FEISHU_APP_SECRET ||
|
|
178
|
+
"",
|
|
179
|
+
domain: shipConfig.integrations.feishu.domain || "https://open.feishu.cn",
|
|
129
180
|
adminUserIds: Array.isArray(shipConfig.integrations.feishu.adminUserIds)
|
|
130
181
|
? shipConfig.integrations.feishu.adminUserIds
|
|
131
182
|
: undefined,
|
|
@@ -135,27 +186,33 @@ export async function startCommand(cwd = '.', options) {
|
|
|
135
186
|
// Create QQ Bot (if enabled)
|
|
136
187
|
let qqBot = null;
|
|
137
188
|
if (shipConfig.integrations?.qq?.enabled) {
|
|
138
|
-
logger.info(
|
|
189
|
+
logger.info("QQ integration enabled");
|
|
139
190
|
const qqConfig = {
|
|
140
191
|
enabled: true,
|
|
141
|
-
appId: (shipConfig.integrations.qq.appId &&
|
|
192
|
+
appId: (shipConfig.integrations.qq.appId &&
|
|
193
|
+
!isPlaceholder(shipConfig.integrations.qq.appId)
|
|
142
194
|
? shipConfig.integrations.qq.appId
|
|
143
|
-
: undefined) ||
|
|
144
|
-
|
|
195
|
+
: undefined) ||
|
|
196
|
+
process.env.QQ_APP_ID ||
|
|
197
|
+
"",
|
|
198
|
+
appSecret: (shipConfig.integrations.qq.appSecret &&
|
|
199
|
+
!isPlaceholder(shipConfig.integrations.qq.appSecret)
|
|
145
200
|
? shipConfig.integrations.qq.appSecret
|
|
146
|
-
: undefined) ||
|
|
147
|
-
|
|
201
|
+
: undefined) ||
|
|
202
|
+
process.env.QQ_APP_SECRET ||
|
|
203
|
+
"",
|
|
204
|
+
sandbox: typeof shipConfig.integrations.qq.sandbox === "boolean"
|
|
148
205
|
? shipConfig.integrations.qq.sandbox
|
|
149
|
-
: (process.env.QQ_SANDBOX ||
|
|
206
|
+
: (process.env.QQ_SANDBOX || "").toLowerCase() === "true",
|
|
150
207
|
};
|
|
151
208
|
qqBot = await createQQBot(projectRoot, qqConfig, logger);
|
|
152
209
|
}
|
|
153
210
|
// 创建交互式 Web 服务器(如果已启用)
|
|
154
211
|
let interactiveServer = null;
|
|
155
|
-
if (
|
|
156
|
-
logger.info(
|
|
212
|
+
if (interactiveWeb) {
|
|
213
|
+
logger.info("交互式 Web 界面已启用");
|
|
157
214
|
interactiveServer = createInteractiveServer({
|
|
158
|
-
agentApiUrl: `http://${
|
|
215
|
+
agentApiUrl: `http://${host === "0.0.0.0" || host === "::" ? "127.0.0.1" : host}:${port}`,
|
|
159
216
|
});
|
|
160
217
|
}
|
|
161
218
|
// 处理进程信号
|
|
@@ -186,21 +243,21 @@ export async function startCommand(cwd = '.', options) {
|
|
|
186
243
|
await server.stop();
|
|
187
244
|
// Save logs
|
|
188
245
|
await logger.saveAllLogs();
|
|
189
|
-
logger.info(
|
|
246
|
+
logger.info("👋 ShipMyAgent stopped");
|
|
190
247
|
process.exit(0);
|
|
191
248
|
};
|
|
192
|
-
process.on(
|
|
193
|
-
process.on(
|
|
249
|
+
process.on("SIGINT", () => shutdown("SIGINT"));
|
|
250
|
+
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
194
251
|
// Start server
|
|
195
252
|
await server.start({
|
|
196
|
-
port
|
|
197
|
-
host
|
|
253
|
+
port,
|
|
254
|
+
host,
|
|
198
255
|
});
|
|
199
256
|
// 启动交互式 Web 服务器(如果已启用)
|
|
200
257
|
if (interactiveServer) {
|
|
201
258
|
await interactiveServer.start({
|
|
202
|
-
port:
|
|
203
|
-
host
|
|
259
|
+
port: interactivePort ?? 3001,
|
|
260
|
+
host,
|
|
204
261
|
});
|
|
205
262
|
}
|
|
206
263
|
// 启动 Telegram Bot
|
|
@@ -215,6 +272,6 @@ export async function startCommand(cwd = '.', options) {
|
|
|
215
272
|
if (qqBot) {
|
|
216
273
|
await qqBot.start();
|
|
217
274
|
}
|
|
218
|
-
logger.info(
|
|
275
|
+
logger.info("=== ShipMyAgent Started ===");
|
|
219
276
|
}
|
|
220
277
|
//# sourceMappingURL=start.js.map
|