@iinm/plain-agent 1.7.15 → 1.7.17
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 +131 -57
- package/package.json +1 -1
- package/src/cliFormatter.mjs +45 -2
- package/src/cliInteractive.mjs +116 -2
- package/src/cliInterruptTransform.mjs +22 -5
- package/src/cliMuteTransform.mjs +26 -0
- package/src/config.d.ts +2 -0
- package/src/config.mjs +3 -0
- package/src/main.mjs +3 -1
- package/src/mcp.mjs +5 -2
- package/src/voiceInput.mjs +671 -0
package/src/main.mjs
CHANGED
|
@@ -123,7 +123,7 @@ if (cliArgs.subcommand.type === "install-claude-code-plugins") {
|
|
|
123
123
|
}),
|
|
124
124
|
);
|
|
125
125
|
|
|
126
|
-
for (const { serverName, tools, cleanup } of mcpResults) {
|
|
126
|
+
for (const { serverName, tools, stderrLogPath, cleanup } of mcpResults) {
|
|
127
127
|
mcpTools.push(...tools);
|
|
128
128
|
mcpCleanups.push(cleanup);
|
|
129
129
|
if (!isBatchMode) {
|
|
@@ -133,6 +133,7 @@ if (cliArgs.subcommand.type === "install-claude-code-plugins") {
|
|
|
133
133
|
`✅ Successfully connected to MCP server: ${serverName}`,
|
|
134
134
|
),
|
|
135
135
|
);
|
|
136
|
+
console.log(` ⤷ stderr log: ${stderrLogPath}`);
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
}
|
|
@@ -256,6 +257,7 @@ if (cliArgs.subcommand.type === "install-claude-code-plugins") {
|
|
|
256
257
|
...sessionOptions,
|
|
257
258
|
notifyCmd: appConfig.notifyCmd || AGENT_NOTIFY_CMD_DEFAULT,
|
|
258
259
|
claudeCodePlugins: resolvePluginPaths(appConfig.claudeCodePlugins ?? []),
|
|
260
|
+
voiceInput: appConfig.voiceInput,
|
|
259
261
|
});
|
|
260
262
|
}
|
|
261
263
|
})().catch((err) => {
|
package/src/mcp.mjs
CHANGED
|
@@ -15,6 +15,7 @@ const OUTPUT_MAX_LENGTH = 1024 * 8;
|
|
|
15
15
|
/**
|
|
16
16
|
* @typedef {Object} SetupMCPServrResult
|
|
17
17
|
* @property {Tool[]} tools
|
|
18
|
+
* @property {string} stderrLogPath
|
|
18
19
|
* @property {() => Promise<void>} cleanup
|
|
19
20
|
*/
|
|
20
21
|
|
|
@@ -26,7 +27,7 @@ const OUTPUT_MAX_LENGTH = 1024 * 8;
|
|
|
26
27
|
export async function setupMCPServer(serverName, serverConfig) {
|
|
27
28
|
const { options, ...params } = serverConfig;
|
|
28
29
|
|
|
29
|
-
const { client, cleanup } = await startMCPServer({
|
|
30
|
+
const { client, stderrLogPath, cleanup } = await startMCPServer({
|
|
30
31
|
serverName,
|
|
31
32
|
params,
|
|
32
33
|
});
|
|
@@ -41,6 +42,7 @@ export async function setupMCPServer(serverName, serverConfig) {
|
|
|
41
42
|
|
|
42
43
|
return {
|
|
43
44
|
tools,
|
|
45
|
+
stderrLogPath,
|
|
44
46
|
cleanup: async () => {
|
|
45
47
|
cleanup();
|
|
46
48
|
await client.close();
|
|
@@ -56,7 +58,7 @@ export async function setupMCPServer(serverName, serverConfig) {
|
|
|
56
58
|
|
|
57
59
|
/**
|
|
58
60
|
* @param {MCPClientOptions} options - The options for the client.
|
|
59
|
-
* @returns {Promise<{client: Client; cleanup: () => void}>} - The MCP client and cleanup function.
|
|
61
|
+
* @returns {Promise<{client: Client; stderrLogPath: string; cleanup: () => void}>} - The MCP client, stderr log path, and cleanup function.
|
|
60
62
|
*/
|
|
61
63
|
async function startMCPServer(options) {
|
|
62
64
|
const mcpClient = await import("@modelcontextprotocol/client");
|
|
@@ -88,6 +90,7 @@ async function startMCPServer(options) {
|
|
|
88
90
|
|
|
89
91
|
return {
|
|
90
92
|
client,
|
|
93
|
+
stderrLogPath: logPath,
|
|
91
94
|
cleanup: () => {
|
|
92
95
|
stderrLogFile.close();
|
|
93
96
|
},
|