taktiko 0.3.1 → 0.3.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.
- package/dist/cli.js +16 -19
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7405,6 +7405,11 @@ function appendAttachmentPaths(text, attachments) {
|
|
|
7405
7405
|
[Attached files \u2014 read them from these local paths:]
|
|
7406
7406
|
${lines.join("\n")}`;
|
|
7407
7407
|
}
|
|
7408
|
+
function foldSystemPrompt(query, systemPrompt, isResume) {
|
|
7409
|
+
return systemPrompt && !isResume ? `${systemPrompt}
|
|
7410
|
+
|
|
7411
|
+
${query}` : query;
|
|
7412
|
+
}
|
|
7408
7413
|
var hasFlag = (args, ...flags) => flags.some((f) => args.includes(f));
|
|
7409
7414
|
async function spawnLines(ctx, command, args, opts) {
|
|
7410
7415
|
const child = ctx.spawn(command, args, {
|
|
@@ -7461,7 +7466,6 @@ function parseJsonLine(line) {
|
|
|
7461
7466
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
7462
7467
|
import { dirname, join, resolve } from "path";
|
|
7463
7468
|
var MCP_SERVER_NAME = "taktiko";
|
|
7464
|
-
var ASK_TOOL_FQN = `mcp__${MCP_SERVER_NAME}__AskUserQuestion`;
|
|
7465
7469
|
var ASK_TOOL_TIMEOUT_MS = Number(process.env.TAKTIKO_ASK_TOOL_TIMEOUT_MS) || 60 * 6e4;
|
|
7466
7470
|
function isAskUserTool(name) {
|
|
7467
7471
|
return /(?:^|__|\.)(AskUserQuestion|ask_user)$/.test(name);
|
|
@@ -7645,9 +7649,7 @@ var codexAdapter = async (ctx) => {
|
|
|
7645
7649
|
}
|
|
7646
7650
|
const ask = buildAskUserMcp(a.env);
|
|
7647
7651
|
if (ask) args.push(...codexMcpFlags(ask));
|
|
7648
|
-
const base = a.systemPrompt
|
|
7649
|
-
|
|
7650
|
-
${job.query}` : job.query;
|
|
7652
|
+
const base = foldSystemPrompt(job.query, a.systemPrompt, !!resume);
|
|
7651
7653
|
args.push(appendAttachmentPaths(base, job.attachments));
|
|
7652
7654
|
let sessionId = resume;
|
|
7653
7655
|
const messages = [];
|
|
@@ -7695,9 +7697,7 @@ var genericAdapter = async (ctx) => {
|
|
|
7695
7697
|
const a = job.agent;
|
|
7696
7698
|
const args = [...a.args];
|
|
7697
7699
|
if (job.resumeSessionId) args.push("--resume", job.resumeSessionId);
|
|
7698
|
-
const base = a.systemPrompt
|
|
7699
|
-
|
|
7700
|
-
${job.query}` : job.query;
|
|
7700
|
+
const base = foldSystemPrompt(job.query, a.systemPrompt, !!job.resumeSessionId);
|
|
7701
7701
|
args.push(appendAttachmentPaths(base, job.attachments));
|
|
7702
7702
|
let out = "";
|
|
7703
7703
|
const { code, stderr } = await spawnLines(ctx, a.command, args, {
|
|
@@ -7730,9 +7730,7 @@ var kimiAdapter = async (ctx) => {
|
|
|
7730
7730
|
env.TAKTIKO_ASK_TOOL_NAME = "ask_user";
|
|
7731
7731
|
if (!env.MCP_TOOL_TIMEOUT) env.MCP_TOOL_TIMEOUT = String(ASK_TOOL_TIMEOUT_MS);
|
|
7732
7732
|
}
|
|
7733
|
-
const base = a.systemPrompt
|
|
7734
|
-
|
|
7735
|
-
${job.query}` : job.query;
|
|
7733
|
+
const base = foldSystemPrompt(job.query, a.systemPrompt, !!resume);
|
|
7736
7734
|
const prompt = appendAttachmentPaths(base, job.attachments);
|
|
7737
7735
|
if (!hasFlag(args, "-p", "--prompt")) args.push("-p", prompt);
|
|
7738
7736
|
let sessionId = resume;
|
|
@@ -8349,7 +8347,7 @@ var TerminalSession = class {
|
|
|
8349
8347
|
for (const l of this.outputListeners) l(payload);
|
|
8350
8348
|
});
|
|
8351
8349
|
this.pty = spawn2(opts.shell, opts.args ?? [], {
|
|
8352
|
-
name:
|
|
8350
|
+
name: "xterm-256color",
|
|
8353
8351
|
cols: this.cols,
|
|
8354
8352
|
rows: this.rows,
|
|
8355
8353
|
cwd: this.cwd,
|
|
@@ -8417,7 +8415,7 @@ var TerminalRegistry = class {
|
|
|
8417
8415
|
const session = new TerminalSession({
|
|
8418
8416
|
...opts,
|
|
8419
8417
|
shell: opts.shell?.trim() || defaultShell(),
|
|
8420
|
-
args:
|
|
8418
|
+
args: platform() === "win32" ? [] : ["-l"],
|
|
8421
8419
|
// login shell on POSIX
|
|
8422
8420
|
cwd
|
|
8423
8421
|
});
|
|
@@ -8926,7 +8924,7 @@ function runMcpTools() {
|
|
|
8926
8924
|
reply(id, {
|
|
8927
8925
|
protocolVersion: params?.protocolVersion || "2025-06-18",
|
|
8928
8926
|
capabilities: { tools: {} },
|
|
8929
|
-
serverInfo: { name: "taktiko", version: "0.3.
|
|
8927
|
+
serverInfo: { name: "taktiko", version: "0.3.2" }
|
|
8930
8928
|
});
|
|
8931
8929
|
return;
|
|
8932
8930
|
}
|
|
@@ -9021,9 +9019,9 @@ function processInfo() {
|
|
|
9021
9019
|
}
|
|
9022
9020
|
try {
|
|
9023
9021
|
const st = statSync(PID_FILE);
|
|
9024
|
-
return { pid,
|
|
9022
|
+
return { pid, uptimeMs: Date.now() - st.mtimeMs };
|
|
9025
9023
|
} catch {
|
|
9026
|
-
return { pid,
|
|
9024
|
+
return { pid, uptimeMs: null };
|
|
9027
9025
|
}
|
|
9028
9026
|
}
|
|
9029
9027
|
function rotateLogIfLarge() {
|
|
@@ -9385,8 +9383,7 @@ async function handleRpc(ws, frame) {
|
|
|
9385
9383
|
shell: p2.shell ? String(p2.shell) : void 0,
|
|
9386
9384
|
env: {
|
|
9387
9385
|
...passedEnv,
|
|
9388
|
-
TAKTIKO_ACTIVITY_URL: `${daemonServerUrl}/api/terminal-activity
|
|
9389
|
-
TAKTIKO_HOOK_CLI: process.argv[1] ?? "taktiko"
|
|
9386
|
+
TAKTIKO_ACTIVITY_URL: `${daemonServerUrl}/api/terminal-activity`
|
|
9390
9387
|
},
|
|
9391
9388
|
cols: typeof p2.cols === "number" ? p2.cols : void 0,
|
|
9392
9389
|
rows: typeof p2.rows === "number" ? p2.rows : void 0
|
|
@@ -10040,7 +10037,7 @@ function runDaemon(cfg) {
|
|
|
10040
10037
|
connect();
|
|
10041
10038
|
}
|
|
10042
10039
|
var program = new Command();
|
|
10043
|
-
program.name("taktiko").description("Taktiko daemon \u2014 runs your local agent CLIs").version("0.3.
|
|
10040
|
+
program.name("taktiko").description("Taktiko daemon \u2014 runs your local agent CLIs").version("0.3.2", "-v, --version", "output the version number");
|
|
10044
10041
|
program.command("hooks <provider> <event>").description("internal: report agent activity for the current Taktiko terminal (called by agent hooks)").action(async (provider, event) => {
|
|
10045
10042
|
await reportHookActivity(provider, event);
|
|
10046
10043
|
process.exit(0);
|
|
@@ -10125,7 +10122,7 @@ program.command("restart").description("restart the daemon (cycles the installed
|
|
|
10125
10122
|
});
|
|
10126
10123
|
program.command("update").description("update taktiko to the latest published version (npm i -g), then restart the daemon").option("--check", "only report whether a newer version exists; don't install").option("--force", "reinstall the latest even if already up to date").action(async (opts) => {
|
|
10127
10124
|
const npm = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
10128
|
-
const current = "0.3.
|
|
10125
|
+
const current = "0.3.2";
|
|
10129
10126
|
let latest;
|
|
10130
10127
|
try {
|
|
10131
10128
|
latest = execFileSync2(npm, ["view", "taktiko", "version"], { encoding: "utf8" }).trim();
|