saarthiclaw 0.2.3 → 0.4.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/CHANGELOG.md +19 -0
- package/README.md +21 -9
- package/dist/chunks/{chunk-H2FAKNUI.js → chunk-4QQKAYXY.js} +2 -2
- package/dist/chunks/{chunk-2GDAWRT7.js → chunk-5CZK76GD.js} +168 -3
- package/dist/chunks/{chunk-CGTA77EE.js → chunk-5J4EZHBC.js} +5 -5
- package/dist/chunks/{chunk-BBQ26JQA.js → chunk-5TGJUVF3.js} +5 -5
- package/dist/chunks/{chunk-KAWTUWO2.js → chunk-D3EGRS3I.js} +4 -4
- package/dist/chunks/{chunk-XNIFO3FV.js → chunk-FCUOVDGP.js} +6 -6
- package/dist/chunks/{chunk-HFMRQTXE.js → chunk-HAXIR2UL.js} +1 -1
- package/dist/chunks/{chunk-OJCC4JH2.js → chunk-IJH424FN.js} +9 -1
- package/dist/chunks/{chunk-CUC6MUW7.js → chunk-PKKPIADV.js} +4 -4
- package/dist/chunks/{chunk-R4PMMMD5.js → chunk-QVXNGO7V.js} +53 -26
- package/dist/chunks/{chunk-44LLGJXH.js → chunk-UQLWSQM7.js} +4 -4
- package/dist/chunks/{chunk-CGJ4VEUD.js → chunk-Y5KHLA3U.js} +1 -1
- package/dist/chunks/{chunk-OLL2WJVK.js → chunk-ZNW5U3O5.js} +3 -3
- package/dist/chunks/{client-O4UP5DCM.js → client-ZC4NAQXK.js} +3 -3
- package/dist/chunks/{config-PA5NJ37O.js → config-IC2NOB3E.js} +1 -1
- package/dist/chunks/{context-OL7JU4XA.js → context-QVV5J6E6.js} +5 -5
- package/dist/chunks/{doctor-OBO4MCDY.js → doctor-ZKLHHV6B.js} +11 -8
- package/dist/chunks/{errors-OJZTUG74.js → errors-EOWKXBLQ.js} +2 -2
- package/dist/chunks/{init-GCJNYE3Y.js → init-GVUB76FT.js} +99 -25
- package/dist/chunks/orchestrator-256I33EZ.js +22 -0
- package/dist/chunks/{orchestrator-IKYROOM5.js → orchestrator-7PHH2BFH.js} +10 -10
- package/dist/chunks/{orchestrator-HUHXYUUM.js → orchestrator-MJZMWRN6.js} +9 -9
- package/dist/chunks/{session-ZC5D2O77.js → session-4F3Y36PA.js} +4 -4
- package/dist/chunks/{store-JG5OKLEO.js → store-V3BGNZAC.js} +3 -3
- package/dist/chunks/{sync-LTPGXMRU.js → sync-TOXUX5TK.js} +7 -7
- package/dist/chunks/{team-AOMHCEDT.js → team-Z3LGTAVW.js} +106 -11
- package/dist/chunks/{telegram-KO7VH46G.js → telegram-Y5YBM5OM.js} +12 -12
- package/dist/chunks/{wakeup-YZNEVSVH.js → wakeup-TCMBEW2F.js} +15 -15
- package/dist/chunks/workspace-435F7NMP.js +281 -0
- package/dist/index.js +27 -21
- package/package.json +6 -1
- package/dist/chunks/orchestrator-QAFNDXD2.js +0 -22
package/dist/index.js
CHANGED
|
@@ -15,9 +15,9 @@ async function bootstrap(cmd, opts = {}) {
|
|
|
15
15
|
const g = cmd.optsWithGlobals();
|
|
16
16
|
const [{ resolveWorkspaceRoot }, { loadConfig }, prompterMod, { createSession }] = await Promise.all([
|
|
17
17
|
import("./chunks/workspace-PFJUEHAB.js"),
|
|
18
|
-
import("./chunks/config-
|
|
18
|
+
import("./chunks/config-IC2NOB3E.js"),
|
|
19
19
|
import("./chunks/prompter-AAH4A3BG.js"),
|
|
20
|
-
import("./chunks/session-
|
|
20
|
+
import("./chunks/session-4F3Y36PA.js")
|
|
21
21
|
]);
|
|
22
22
|
if (opts.needsTty && !prompterMod.isInteractiveTerminal()) {
|
|
23
23
|
throw new prompterMod.NonInteractiveError(opts.needsTty);
|
|
@@ -37,9 +37,9 @@ async function bootstrap(cmd, opts = {}) {
|
|
|
37
37
|
async function startWakeup(cmd) {
|
|
38
38
|
const session = await bootstrap(cmd, { needsTty: "`saarthiclaw wakeup`" });
|
|
39
39
|
const g = cmd.optsWithGlobals();
|
|
40
|
-
const { renderBanner, runWakeup } = await import("./chunks/wakeup-
|
|
40
|
+
const { renderBanner, runWakeup } = await import("./chunks/wakeup-TCMBEW2F.js");
|
|
41
41
|
if (g.banner !== false) console.log(renderBanner(getVersion()) + "\n");
|
|
42
|
-
const { hasAiAccess } = await import("./chunks/session-
|
|
42
|
+
const { hasAiAccess } = await import("./chunks/session-4F3Y36PA.js");
|
|
43
43
|
if (!hasAiAccess(session)) {
|
|
44
44
|
console.log(chalk.yellow("⚠ No AI key found. Run `saarthiclaw init` first, or ask your team Admin to add a Team AI key (Ask/Plan/Agent need one).\n"));
|
|
45
45
|
}
|
|
@@ -52,7 +52,7 @@ function joinWords(words) {
|
|
|
52
52
|
}
|
|
53
53
|
function buildProgram() {
|
|
54
54
|
const program = new Command();
|
|
55
|
-
program.name("saarthiclaw").description("SaarthiClaw — an AI developer assistant for your project's terminal.\nThe AI proposes, you approve.").version(getVersion(), "-v, --version", "print the version").helpOption("-h, --help", "show help").option("--cwd <path>", "workspace root (default: nearest folder with package.json or .git)").option("--model <id>", "
|
|
55
|
+
program.name("saarthiclaw").description("SaarthiClaw — an AI developer assistant for your project's terminal.\nThe AI proposes, you approve.").version(getVersion(), "-v, --version", "print the version").helpOption("-h, --help", "show help").option("--cwd <path>", "workspace root (default: nearest folder with package.json or .git)").option("--model <id>", "model id for this run (from your AI provider)").option("--allow-shell", "let the agent propose shell commands this run (each still needs approval)").option("--debug", "show stack traces and verbose errors").addOption(new Option("--no-banner", "hide the startup banner")).showHelpAfterError("(run `saarthiclaw --help` for usage)").exitOverride().allowExcessArguments(true).action(async (_opts, cmd) => {
|
|
56
56
|
if (cmd.args.length > 0) {
|
|
57
57
|
cmd.error(`error: unknown command '${cmd.args[0]}'`, { exitCode: 1, code: "commander.unknownCommand" });
|
|
58
58
|
}
|
|
@@ -66,36 +66,36 @@ function buildProgram() {
|
|
|
66
66
|
program.command("wakeup").aliases(["wake", "start"]).description("open the interactive menu (CLI: Ask / Plan / Agent, or Telegram)").action(async (_opts, cmd) => startWakeup(cmd));
|
|
67
67
|
program.command("init").description("guided one-time setup (API key, model, safety options)").action(async (_opts, cmd) => {
|
|
68
68
|
const session = await bootstrap(cmd, { needsTty: "`saarthiclaw init`" });
|
|
69
|
-
const { runInit } = await import("./chunks/init-
|
|
69
|
+
const { runInit } = await import("./chunks/init-GVUB76FT.js");
|
|
70
70
|
await runInit({ root: session.root, prompter: session.prompter, decorate: true });
|
|
71
71
|
});
|
|
72
72
|
program.command("doctor").description("check your setup (Node, config, API key, a live test call)").option("--offline", "skip the live model call").action(async (opts, cmd) => {
|
|
73
73
|
const session = await bootstrap(cmd);
|
|
74
|
-
const { runDoctor } = await import("./chunks/doctor-
|
|
74
|
+
const { runDoctor } = await import("./chunks/doctor-ZKLHHV6B.js");
|
|
75
75
|
const code = await runDoctor(session, { live: !opts.offline });
|
|
76
76
|
if (code !== 0) throw new CommanderError(code, "saarthiclaw.doctorFailed", "");
|
|
77
77
|
});
|
|
78
78
|
program.command("ask").argument("[question...]", "question about the codebase (omit for the interactive prompt)").option("--save <file.md>", "save the answer as Markdown (goes through the approval flow)").description("ask a question about this codebase (read-only)").action(async (words, opts, cmd) => {
|
|
79
79
|
const question = joinWords(words);
|
|
80
80
|
const session = await bootstrap(cmd, { needsTty: question && !opts.save ? void 0 : "`saarthiclaw ask` without a question or with --save" });
|
|
81
|
-
const ask = await import("./chunks/orchestrator-
|
|
81
|
+
const ask = await import("./chunks/orchestrator-7PHH2BFH.js");
|
|
82
82
|
if (question) await ask.runAskOnce(session, question, opts.save);
|
|
83
83
|
else await ask.runAskMode(session);
|
|
84
84
|
});
|
|
85
85
|
program.command("plan").argument("[goal...]", "what you want to achieve").description("generate a step-by-step plan, pick steps, execute them with approval").action(async (words, _opts, cmd) => {
|
|
86
86
|
const session = await bootstrap(cmd, { needsTty: "`saarthiclaw plan`" });
|
|
87
|
-
const { runPlanMode } = await import("./chunks/orchestrator-
|
|
87
|
+
const { runPlanMode } = await import("./chunks/orchestrator-256I33EZ.js");
|
|
88
88
|
await runPlanMode(session, joinWords(words));
|
|
89
89
|
});
|
|
90
90
|
program.command("agent").argument("[task...]", "task for the agent").description("let the agent stage changes; you review and approve every diff").option("--send", "team (Needs approval): send the changes to the Admin without asking; no shell commands").action(async (words, opts, cmd) => {
|
|
91
91
|
const task = joinWords(words);
|
|
92
92
|
const session = await bootstrap(cmd, { needsTty: opts.send && task ? void 0 : "`saarthiclaw agent`" });
|
|
93
|
-
const { runAgentMode } = await import("./chunks/orchestrator-
|
|
93
|
+
const { runAgentMode } = await import("./chunks/orchestrator-MJZMWRN6.js");
|
|
94
94
|
await runAgentMode(session, task, { send: opts.send });
|
|
95
95
|
});
|
|
96
96
|
program.command("telegram").description("run the Telegram remote-control bot (owner only) until Ctrl+C").action(async (_opts, cmd) => {
|
|
97
97
|
const session = await bootstrap(cmd);
|
|
98
|
-
const { runTelegramMode } = await import("./chunks/telegram-
|
|
98
|
+
const { runTelegramMode } = await import("./chunks/telegram-Y5YBM5OM.js");
|
|
99
99
|
await runTelegramMode(session);
|
|
100
100
|
});
|
|
101
101
|
program.command("history").description("show the audit trail of staged / approved / applied actions").option("--last <n>", "number of events to show", "20").action(async (opts, cmd) => {
|
|
@@ -107,44 +107,49 @@ function buildProgram() {
|
|
|
107
107
|
});
|
|
108
108
|
const team = program.command("team").description("work with a team dashboard: connect, sync approved changes, suggest, invite").action(async (_opts, cmd) => {
|
|
109
109
|
const session = await bootstrap(cmd);
|
|
110
|
-
const { teamStatus } = await import("./chunks/team-
|
|
110
|
+
const { teamStatus } = await import("./chunks/team-Z3LGTAVW.js");
|
|
111
111
|
await teamStatus(session);
|
|
112
112
|
});
|
|
113
113
|
team.command("connect").alias("join").argument("[url]", "dashboard address, e.g. http://127.0.0.1:3000").description("link this project to a dashboard with your access key (Admin or member)").action(async (url, _opts, cmd) => {
|
|
114
114
|
const session = await bootstrap(cmd, { needsTty: process.env.SAARTHICLAW_TEAM_KEY ? void 0 : "`saarthiclaw team connect` (or set SAARTHICLAW_TEAM_KEY)" });
|
|
115
|
-
const { teamConnect } = await import("./chunks/team-
|
|
115
|
+
const { teamConnect } = await import("./chunks/team-Z3LGTAVW.js");
|
|
116
116
|
await teamConnect(session, url);
|
|
117
117
|
});
|
|
118
118
|
team.command("status").description("who you are, your level, and what is waiting").action(async (_opts, cmd) => {
|
|
119
119
|
const session = await bootstrap(cmd);
|
|
120
|
-
const { teamStatus } = await import("./chunks/team-
|
|
120
|
+
const { teamStatus } = await import("./chunks/team-Z3LGTAVW.js");
|
|
121
121
|
await teamStatus(session);
|
|
122
122
|
});
|
|
123
123
|
team.command("sync").description("apply your changes the Admin approved; show rejections").option("-y, --yes", "apply approved changes without asking").option("-w, --wait", "keep waiting until the Admin has decided on everything").action(async (opts, cmd) => {
|
|
124
124
|
const session = await bootstrap(cmd);
|
|
125
125
|
const g = cmd.optsWithGlobals();
|
|
126
|
-
const { teamSync } = await import("./chunks/team-
|
|
126
|
+
const { teamSync } = await import("./chunks/team-Z3LGTAVW.js");
|
|
127
127
|
await teamSync(session, { yes: opts.yes, wait: opts.wait, allowShell: g.allowShell });
|
|
128
128
|
});
|
|
129
|
+
team.command("watch").description("keep this folder and the team website in step (approved website changes come down here; Admin/Trusted edits go up)").option("--once", "sync one time and exit").option("--prefer <side>", "when both sides changed a file: website | laptop").option("--interval <seconds>", "how often to check (default 2)").action(async (opts, cmd) => {
|
|
130
|
+
const session = await bootstrap(cmd);
|
|
131
|
+
const { teamWatch } = await import("./chunks/team-Z3LGTAVW.js");
|
|
132
|
+
await teamWatch(session, opts);
|
|
133
|
+
});
|
|
129
134
|
team.command("suggest").argument("[idea...]", "your idea for the Admin").description("send an idea to the Admin (any level, including Suggest only)").action(async (words, _opts, cmd) => {
|
|
130
135
|
const idea = joinWords(words);
|
|
131
136
|
const session = await bootstrap(cmd, { needsTty: idea ? void 0 : "`saarthiclaw team suggest` without text" });
|
|
132
|
-
const { teamSuggest } = await import("./chunks/team-
|
|
137
|
+
const { teamSuggest } = await import("./chunks/team-Z3LGTAVW.js");
|
|
133
138
|
await teamSuggest(session, idea);
|
|
134
139
|
});
|
|
135
140
|
team.command("invite").argument("[name]", "developer's name").option("--level <level>", "trusted | needs-approval | suggest-only").description("(Admin) add a developer and print their one-time access key").action(async (name, opts, cmd) => {
|
|
136
141
|
const session = await bootstrap(cmd, { needsTty: name ? void 0 : "`saarthiclaw team invite` without a name" });
|
|
137
|
-
const { teamInvite } = await import("./chunks/team-
|
|
142
|
+
const { teamInvite } = await import("./chunks/team-Z3LGTAVW.js");
|
|
138
143
|
await teamInvite(session, name ?? "", opts.level);
|
|
139
144
|
});
|
|
140
145
|
team.command("inbox").description("(Admin) suggestions you forwarded to the agent; run the agent on one").action(async (_opts, cmd) => {
|
|
141
146
|
const session = await bootstrap(cmd);
|
|
142
|
-
const { teamInbox } = await import("./chunks/team-
|
|
147
|
+
const { teamInbox } = await import("./chunks/team-Z3LGTAVW.js");
|
|
143
148
|
await teamInbox(session);
|
|
144
149
|
});
|
|
145
150
|
team.command("disconnect").alias("leave").description("unlink this project from the dashboard (back to solo mode)").action(async (_opts, cmd) => {
|
|
146
151
|
const session = await bootstrap(cmd, { needsTty: "`saarthiclaw team disconnect`" });
|
|
147
|
-
const { teamDisconnect } = await import("./chunks/team-
|
|
152
|
+
const { teamDisconnect } = await import("./chunks/team-Z3LGTAVW.js");
|
|
148
153
|
await teamDisconnect(session);
|
|
149
154
|
});
|
|
150
155
|
program.addHelpText(
|
|
@@ -152,6 +157,7 @@ function buildProgram() {
|
|
|
152
157
|
`
|
|
153
158
|
Examples:
|
|
154
159
|
$ npx saarthiclaw init one-time setup
|
|
160
|
+
$ npx saarthiclaw team watch keep this folder in step with the team website
|
|
155
161
|
$ npx saarthiclaw open the menu (same as wakeup)
|
|
156
162
|
$ npx saarthiclaw ask "where is auth handled?"
|
|
157
163
|
$ npx saarthiclaw agent "add a /health route" --allow-shell
|
|
@@ -175,7 +181,7 @@ async function main(argv = process.argv) {
|
|
|
175
181
|
});
|
|
176
182
|
}
|
|
177
183
|
process.on("unhandledRejection", async (reason) => {
|
|
178
|
-
const { reportError } = await import("./chunks/errors-
|
|
184
|
+
const { reportError } = await import("./chunks/errors-EOWKXBLQ.js");
|
|
179
185
|
reportError(reason, debug);
|
|
180
186
|
process.exit(1);
|
|
181
187
|
});
|
|
@@ -197,7 +203,7 @@ async function main(argv = process.argv) {
|
|
|
197
203
|
console.log(chalk.yellow("\nRun cancelled. Staged changes were discarded — nothing was written."));
|
|
198
204
|
return 0;
|
|
199
205
|
}
|
|
200
|
-
const { reportError } = await import("./chunks/errors-
|
|
206
|
+
const { reportError } = await import("./chunks/errors-EOWKXBLQ.js");
|
|
201
207
|
reportError(e, debug);
|
|
202
208
|
return 1;
|
|
203
209
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "saarthiclaw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "An AI developer assistant that lives in your project's terminal. Ask, Plan and Agent modes — the AI proposes, you approve every change.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"coding-assistant",
|
|
10
10
|
"developer-tools",
|
|
11
11
|
"openrouter",
|
|
12
|
+
"openai",
|
|
13
|
+
"anthropic",
|
|
14
|
+
"gemini",
|
|
15
|
+
"groq",
|
|
16
|
+
"ollama",
|
|
12
17
|
"code-review",
|
|
13
18
|
"approval",
|
|
14
19
|
"terminal",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
runPlanMode,
|
|
3
|
-
stepPrompt
|
|
4
|
-
} from "./chunk-XNIFO3FV.js";
|
|
5
|
-
import "./chunk-HFMRQTXE.js";
|
|
6
|
-
import "./chunk-44LLGJXH.js";
|
|
7
|
-
import "./chunk-CGJ4VEUD.js";
|
|
8
|
-
import "./chunk-QRAFFI5V.js";
|
|
9
|
-
import "./chunk-OLL2WJVK.js";
|
|
10
|
-
import "./chunk-OJCC4JH2.js";
|
|
11
|
-
import "./chunk-HGBZ55ND.js";
|
|
12
|
-
import "./chunk-KAWTUWO2.js";
|
|
13
|
-
import "./chunk-5WH3FNFK.js";
|
|
14
|
-
import "./chunk-H2FAKNUI.js";
|
|
15
|
-
import "./chunk-R4PMMMD5.js";
|
|
16
|
-
import "./chunk-2GDAWRT7.js";
|
|
17
|
-
import "./chunk-MMIJKDOU.js";
|
|
18
|
-
import "./chunk-IT46XDPQ.js";
|
|
19
|
-
export {
|
|
20
|
-
runPlanMode,
|
|
21
|
-
stepPrompt
|
|
22
|
-
};
|