rush-ai 0.2.0 → 0.3.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.
- package/README.md +175 -81
- package/dist/{chunk-ISJJIX7U.js → chunk-MG4HY2PD.js} +1 -13
- package/dist/{chunk-ISJJIX7U.js.map → chunk-MG4HY2PD.js.map} +1 -1
- package/dist/{chunk-7H2T3KCJ.js → chunk-UJLVFMWM.js} +1 -1
- package/dist/chunk-UJLVFMWM.js.map +1 -0
- package/dist/{client-2GSYT7IS.js → client-NTECGN3O.js} +2 -2
- package/dist/index.js +32 -83
- package/dist/index.js.map +1 -1
- package/dist/plugin-assets/commands/commands.test.ts +4 -12
- package/dist/{server-PVZOTJZA.js → server-MRWAFK5G.js} +167 -7
- package/dist/server-MRWAFK5G.js.map +1 -0
- package/package.json +26 -16
- package/dist/chunk-7H2T3KCJ.js.map +0 -1
- package/dist/server-PVZOTJZA.js.map +0 -1
- /package/dist/{client-2GSYT7IS.js.map → client-NTECGN3O.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
consumeSSEStream,
|
|
4
3
|
consumeSSEStreamWithReconnect
|
|
5
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MG4HY2PD.js";
|
|
6
5
|
import {
|
|
7
6
|
ApiError,
|
|
8
7
|
AuthError,
|
|
@@ -31,7 +30,7 @@ import {
|
|
|
31
30
|
setGlobalConfig,
|
|
32
31
|
setVerbosity,
|
|
33
32
|
verifyCurrentAuthSession
|
|
34
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-UJLVFMWM.js";
|
|
35
34
|
|
|
36
35
|
// src/index.ts
|
|
37
36
|
import chalk6 from "chalk";
|
|
@@ -1561,7 +1560,7 @@ function truncate3(str, max) {
|
|
|
1561
1560
|
function registerMcpCommand(program) {
|
|
1562
1561
|
const mcp = program.command("mcp").description("MCP server and platform MCP discovery");
|
|
1563
1562
|
mcp.command("serve").description("Start the MCP stdio server").action(async () => {
|
|
1564
|
-
const { startMcpServer } = await import("./server-
|
|
1563
|
+
const { startMcpServer } = await import("./server-MRWAFK5G.js");
|
|
1565
1564
|
await startMcpServer();
|
|
1566
1565
|
});
|
|
1567
1566
|
mcp.command("list").alias("ls").description("List available MCP servers on the platform").option("-c, --category <category>", "Filter by category").option("-t, --tag <tag>", "Filter by tag").option("-s, --search <query>", "Search by name or description").option("--transport <type>", "Filter by transport type (stdio|sse|http)").option(
|
|
@@ -2352,7 +2351,7 @@ async function verifyMcpConnectivity(mode) {
|
|
|
2352
2351
|
return results;
|
|
2353
2352
|
}
|
|
2354
2353
|
try {
|
|
2355
|
-
const { createClient: createClient2 } = await import("./client-
|
|
2354
|
+
const { createClient: createClient2 } = await import("./client-NTECGN3O.js");
|
|
2356
2355
|
const client = createClient2();
|
|
2357
2356
|
await client.get("/api/agents?limit=1");
|
|
2358
2357
|
results.push({
|
|
@@ -2579,9 +2578,7 @@ function registerPluginCommand(program) {
|
|
|
2579
2578
|
output.warn(
|
|
2580
2579
|
"Some checks failed. Plugin is installed but may not work correctly."
|
|
2581
2580
|
);
|
|
2582
|
-
output.dim(
|
|
2583
|
-
"Run `rush-ai plugin doctor` for detailed diagnostics."
|
|
2584
|
-
);
|
|
2581
|
+
output.dim("Run `rush-ai plugin doctor` for detailed diagnostics.");
|
|
2585
2582
|
}
|
|
2586
2583
|
}
|
|
2587
2584
|
if (format === "json") {
|
|
@@ -2872,7 +2869,7 @@ function buildCategorySummary(files) {
|
|
|
2872
2869
|
}
|
|
2873
2870
|
function registerTaskCommand(program) {
|
|
2874
2871
|
const task = program.command("task").description("Create and manage tasks");
|
|
2875
|
-
task.command("
|
|
2872
|
+
task.command("create").description("Create a task asynchronously").requiredOption("-a, --agent <name>", "Agent name to execute the task").option("-p, --prompt <text>", "Task prompt").option("--skills <skills>", "Comma-separated skills to add", commaSplit).option("--mcp <servers>", "Comma-separated MCP servers to add", commaSplit).action(
|
|
2876
2873
|
async (options) => {
|
|
2877
2874
|
requireAuth();
|
|
2878
2875
|
const format = resolveFormat(program.opts());
|
|
@@ -2883,76 +2880,25 @@ function registerTaskCommand(program) {
|
|
|
2883
2880
|
"No prompt provided. Use --prompt or pipe via stdin."
|
|
2884
2881
|
);
|
|
2885
2882
|
}
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
skills: options.skills,
|
|
2893
|
-
mcpServers: options.mcp,
|
|
2894
|
-
stream: true
|
|
2895
|
-
})
|
|
2896
|
-
});
|
|
2897
|
-
if (!response.body) {
|
|
2898
|
-
throw new RushError("No response body for streaming");
|
|
2899
|
-
}
|
|
2900
|
-
let streamError = null;
|
|
2901
|
-
await consumeSSEStream(response.body, (event) => {
|
|
2902
|
-
if (format === "json") {
|
|
2903
|
-
output.log(JSON.stringify(event));
|
|
2904
|
-
} else if (event.type === "content") {
|
|
2905
|
-
process.stdout.write(event.data);
|
|
2906
|
-
} else if (event.type === "error") {
|
|
2907
|
-
streamError = event.data;
|
|
2908
|
-
output.error(event.data);
|
|
2909
|
-
} else if (event.type === "raw") {
|
|
2910
|
-
process.stdout.write(event.data);
|
|
2911
|
-
}
|
|
2912
|
-
});
|
|
2913
|
-
if (format !== "json") {
|
|
2914
|
-
output.newline();
|
|
2915
|
-
}
|
|
2916
|
-
if (streamError) {
|
|
2917
|
-
throw new TaskFailedError(`Task failed: ${streamError}`, {
|
|
2918
|
-
stream: true
|
|
2919
|
-
});
|
|
2920
|
-
}
|
|
2921
|
-
return;
|
|
2922
|
-
}
|
|
2923
|
-
const { data } = await client.post(
|
|
2924
|
-
"/api/agent/invoke",
|
|
2925
|
-
{
|
|
2926
|
-
agent: options.agent,
|
|
2927
|
-
prompt,
|
|
2928
|
-
skills: options.skills,
|
|
2929
|
-
mcpServers: options.mcp,
|
|
2930
|
-
timeout: Number(options.timeout)
|
|
2931
|
-
}
|
|
2932
|
-
);
|
|
2933
|
-
if (data.status === "failed") {
|
|
2934
|
-
throw new TaskFailedError(
|
|
2935
|
-
`Task ${data.id} failed${data.result?.content ? `: ${data.result.content}` : ""}`,
|
|
2936
|
-
{ taskId: data.id }
|
|
2937
|
-
);
|
|
2938
|
-
}
|
|
2883
|
+
const { data } = await client.post("/api/tasks", {
|
|
2884
|
+
agent: options.agent,
|
|
2885
|
+
prompt,
|
|
2886
|
+
skills: options.skills,
|
|
2887
|
+
mcpServers: options.mcp
|
|
2888
|
+
});
|
|
2939
2889
|
if (format === "json") {
|
|
2940
2890
|
output.log(JSON.stringify(data, null, 2));
|
|
2941
2891
|
} else {
|
|
2942
|
-
output.success(`Task ${data.id}
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
if (data.result?.content) {
|
|
2948
|
-
const content = data.result.content;
|
|
2949
|
-
output.log(containsDiff(content) ? colorizeDiff(content) : content);
|
|
2950
|
-
}
|
|
2892
|
+
output.success(`Task created: ${data.id}`);
|
|
2893
|
+
output.dim(`Status: ${data.status}`);
|
|
2894
|
+
output.dim(
|
|
2895
|
+
`Run \`rush-ai task status ${data.id}\` to check progress.`
|
|
2896
|
+
);
|
|
2951
2897
|
}
|
|
2952
2898
|
}
|
|
2953
2899
|
);
|
|
2954
|
-
task.command("
|
|
2955
|
-
async (options) => {
|
|
2900
|
+
task.command("send").description("Send a message to an existing task").argument("<id>", "Task ID (project ID)").option("-p, --prompt <text>", "Message to send").option("--skills <skills>", "Comma-separated skills to add", commaSplit).option("--mcp <servers>", "Comma-separated MCP servers to add", commaSplit).action(
|
|
2901
|
+
async (id, options) => {
|
|
2956
2902
|
requireAuth();
|
|
2957
2903
|
const format = resolveFormat(program.opts());
|
|
2958
2904
|
const client = createClient();
|
|
@@ -2962,19 +2908,21 @@ function registerTaskCommand(program) {
|
|
|
2962
2908
|
"No prompt provided. Use --prompt or pipe via stdin."
|
|
2963
2909
|
);
|
|
2964
2910
|
}
|
|
2965
|
-
const { data } = await client.post(
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2911
|
+
const { data } = await client.post(
|
|
2912
|
+
`/api/tasks/${encodeURIComponent(id)}/send`,
|
|
2913
|
+
{
|
|
2914
|
+
prompt,
|
|
2915
|
+
skills: options.skills,
|
|
2916
|
+
mcpServers: options.mcp
|
|
2917
|
+
}
|
|
2918
|
+
);
|
|
2971
2919
|
if (format === "json") {
|
|
2972
2920
|
output.log(JSON.stringify(data, null, 2));
|
|
2973
2921
|
} else {
|
|
2974
|
-
output.success(`
|
|
2922
|
+
output.success(`Message sent to task: ${data.id}`);
|
|
2975
2923
|
output.dim(`Status: ${data.status}`);
|
|
2976
2924
|
output.dim(
|
|
2977
|
-
`Run \`rush-ai task
|
|
2925
|
+
`Run \`rush-ai task watch ${data.id}\` to follow progress.`
|
|
2978
2926
|
);
|
|
2979
2927
|
}
|
|
2980
2928
|
}
|
|
@@ -3201,7 +3149,8 @@ function registerTaskCommand(program) {
|
|
|
3201
3149
|
output.log(output.bold(`Tasks (${data.total} total):`));
|
|
3202
3150
|
output.newline();
|
|
3203
3151
|
const rows = data.tasks.map((t) => ({
|
|
3204
|
-
ID: t.id
|
|
3152
|
+
ID: t.id,
|
|
3153
|
+
Name: t.name ?? "",
|
|
3205
3154
|
Agent: t.agent,
|
|
3206
3155
|
Status: t.status,
|
|
3207
3156
|
Created: new Date(t.createdAt).toLocaleString()
|
|
@@ -3384,7 +3333,7 @@ function showWelcomeGuide() {
|
|
|
3384
3333
|
chalk6.dim(" Quick start:"),
|
|
3385
3334
|
` ${chalk6.cyan("rush-ai auth login")} Log in to Rush platform`,
|
|
3386
3335
|
` ${chalk6.cyan("rush-ai agent list")} Browse available agents`,
|
|
3387
|
-
` ${chalk6.cyan("rush-ai task
|
|
3336
|
+
` ${chalk6.cyan("rush-ai task create -a <agent>")} Create a task`,
|
|
3388
3337
|
""
|
|
3389
3338
|
];
|
|
3390
3339
|
try {
|