palmier 0.6.2 → 0.6.4
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 +0 -30
- package/dist/agents/agent.js +9 -3
- package/dist/agents/{openhands.d.ts → cline.d.ts} +2 -2
- package/dist/agents/cline.js +32 -0
- package/dist/agents/kiro.d.ts +9 -0
- package/dist/agents/{openhands.js → kiro.js} +10 -10
- package/dist/agents/qoder.d.ts +9 -0
- package/dist/agents/qoder.js +35 -0
- package/dist/commands/plan-generation.md +2 -2
- package/dist/commands/run.js +18 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/agents/agent.ts +9 -3
- package/src/agents/{openhands.ts → cline.ts} +8 -9
- package/src/agents/kiro.ts +38 -0
- package/src/agents/qoder.ts +38 -0
- package/src/commands/plan-generation.md +2 -2
- package/src/commands/run.ts +20 -1
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -113,36 +113,6 @@ The daemon automatically recovers existing tasks by reinstalling their system ti
|
|
|
113
113
|
|
|
114
114
|
Agents are re-detected on every daemon start. Run `palmier restart` after installing or removing a CLI.
|
|
115
115
|
|
|
116
|
-
### Verifying the Service
|
|
117
|
-
|
|
118
|
-
After `palmier init`, verify the host is running:
|
|
119
|
-
|
|
120
|
-
**Linux:**
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
# Check service status
|
|
124
|
-
systemctl --user status palmier.service
|
|
125
|
-
|
|
126
|
-
# View recent logs
|
|
127
|
-
journalctl --user -u palmier.service -n 50 --no-pager
|
|
128
|
-
|
|
129
|
-
# Follow logs in real time
|
|
130
|
-
journalctl --user -u palmier.service -f
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
**Windows (PowerShell):**
|
|
134
|
-
|
|
135
|
-
```powershell
|
|
136
|
-
# Check if the daemon is running
|
|
137
|
-
Get-Process -Name node -ErrorAction SilentlyContinue | Where-Object { $_.CommandLine -like '*palmier*serve*' }
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
**Restarting the daemon (both platforms):**
|
|
141
|
-
|
|
142
|
-
```bash
|
|
143
|
-
palmier restart
|
|
144
|
-
```
|
|
145
|
-
|
|
146
116
|
## CLI Reference
|
|
147
117
|
|
|
148
118
|
| Command | Description |
|
package/dist/agents/agent.js
CHANGED
|
@@ -10,8 +10,10 @@ import { GooseAgent } from "./goose.js";
|
|
|
10
10
|
import { OpenCodeAgent } from "./opencode.js";
|
|
11
11
|
import { DeepAgents } from "./deepagents.js";
|
|
12
12
|
import { Aider } from "./aider.js";
|
|
13
|
-
import { OpenHands } from "./openhands.js";
|
|
14
13
|
import { Cursor } from "./cursor.js";
|
|
14
|
+
import { Kiro } from "./kiro.js";
|
|
15
|
+
import { Cline } from "./cline.js";
|
|
16
|
+
import { Qoder } from "./qoder.js";
|
|
15
17
|
const agentRegistry = {
|
|
16
18
|
claude: new ClaudeAgent(),
|
|
17
19
|
gemini: new GeminiAgent(),
|
|
@@ -25,8 +27,10 @@ const agentRegistry = {
|
|
|
25
27
|
opencode: new OpenCodeAgent(),
|
|
26
28
|
deepagents: new DeepAgents(),
|
|
27
29
|
aider: new Aider(),
|
|
28
|
-
openhands: new OpenHands(),
|
|
29
30
|
cursor: new Cursor(),
|
|
31
|
+
kiro: new Kiro(),
|
|
32
|
+
cline: new Cline(),
|
|
33
|
+
qoder: new Qoder(),
|
|
30
34
|
};
|
|
31
35
|
const agentLabels = {
|
|
32
36
|
claude: "Claude Code",
|
|
@@ -41,8 +45,10 @@ const agentLabels = {
|
|
|
41
45
|
opencode: "OpenCode",
|
|
42
46
|
deepagents: "Deep Agents CLI",
|
|
43
47
|
aider: "Aider",
|
|
44
|
-
openhands: "OpenHands",
|
|
45
48
|
cursor: "Cursor CLI",
|
|
49
|
+
kiro: "Kiro",
|
|
50
|
+
cline: "Cline",
|
|
51
|
+
qoder: "Qoder",
|
|
46
52
|
};
|
|
47
53
|
export async function detectAgents() {
|
|
48
54
|
const detected = [];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ParsedTask, RequiredPermission } from "../types.js";
|
|
2
2
|
import type { AgentTool, CommandLine } from "./agent.js";
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class Cline implements AgentTool {
|
|
4
4
|
supportsPermissions: boolean;
|
|
5
5
|
getPlanGenerationCommandLine(prompt: string): CommandLine;
|
|
6
6
|
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
|
|
7
7
|
init(): Promise<boolean>;
|
|
8
8
|
}
|
|
9
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=cline.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
import { getAgentInstructions } from "./shared-prompt.js";
|
|
3
|
+
import { SHELL } from "../platform/index.js";
|
|
4
|
+
export class Cline {
|
|
5
|
+
supportsPermissions = false;
|
|
6
|
+
getPlanGenerationCommandLine(prompt) {
|
|
7
|
+
return {
|
|
8
|
+
command: "cline ",
|
|
9
|
+
args: ["--yolo", "-p", prompt],
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
|
|
13
|
+
const yolo = extraPermissions === "yolo";
|
|
14
|
+
const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
|
|
15
|
+
const args = [];
|
|
16
|
+
if (yolo) {
|
|
17
|
+
args.push("--yolo");
|
|
18
|
+
}
|
|
19
|
+
args.push(prompt);
|
|
20
|
+
return { command: "cline ", args };
|
|
21
|
+
}
|
|
22
|
+
async init() {
|
|
23
|
+
try {
|
|
24
|
+
execSync("cline --version", { stdio: "ignore", shell: SHELL });
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=cline.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ParsedTask, RequiredPermission } from "../types.js";
|
|
2
|
+
import type { AgentTool, CommandLine } from "./agent.js";
|
|
3
|
+
export declare class Kiro implements AgentTool {
|
|
4
|
+
supportsPermissions: boolean;
|
|
5
|
+
getPlanGenerationCommandLine(prompt: string): CommandLine;
|
|
6
|
+
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
|
|
7
|
+
init(): Promise<boolean>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=kiro.d.ts.map
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { execSync } from "child_process";
|
|
2
2
|
import { getAgentInstructions } from "./shared-prompt.js";
|
|
3
3
|
import { SHELL } from "../platform/index.js";
|
|
4
|
-
export class
|
|
4
|
+
export class Kiro {
|
|
5
5
|
supportsPermissions = false;
|
|
6
6
|
getPlanGenerationCommandLine(prompt) {
|
|
7
7
|
return {
|
|
8
|
-
command: "
|
|
9
|
-
args: ["--
|
|
8
|
+
command: "kiro-cli",
|
|
9
|
+
args: ["--no-interactive", prompt],
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
|
|
13
13
|
const yolo = extraPermissions === "yolo";
|
|
14
14
|
const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
|
|
15
|
-
const args = [
|
|
15
|
+
const args = [];
|
|
16
16
|
if (yolo) {
|
|
17
|
-
args.push("--
|
|
17
|
+
args.push("--trust-all-tools");
|
|
18
18
|
}
|
|
19
19
|
if (followupPrompt) {
|
|
20
|
-
args.push("--resume"
|
|
20
|
+
args.push("--resume");
|
|
21
21
|
} // continue mode for followups
|
|
22
|
-
args.push("-
|
|
23
|
-
return { command: "
|
|
22
|
+
args.push("--no-interactive", prompt);
|
|
23
|
+
return { command: "kiro-cli", args };
|
|
24
24
|
}
|
|
25
25
|
async init() {
|
|
26
26
|
try {
|
|
27
|
-
execSync("
|
|
27
|
+
execSync("kiro-cli --version", { stdio: "ignore", shell: SHELL });
|
|
28
28
|
}
|
|
29
29
|
catch {
|
|
30
30
|
return false;
|
|
@@ -32,4 +32,4 @@ export class OpenHands {
|
|
|
32
32
|
return true;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
//# sourceMappingURL=
|
|
35
|
+
//# sourceMappingURL=kiro.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ParsedTask, RequiredPermission } from "../types.js";
|
|
2
|
+
import type { AgentTool, CommandLine } from "./agent.js";
|
|
3
|
+
export declare class Qoder implements AgentTool {
|
|
4
|
+
supportsPermissions: boolean;
|
|
5
|
+
getPlanGenerationCommandLine(prompt: string): CommandLine;
|
|
6
|
+
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
|
|
7
|
+
init(): Promise<boolean>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=qoder.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
import { getAgentInstructions } from "./shared-prompt.js";
|
|
3
|
+
import { SHELL } from "../platform/index.js";
|
|
4
|
+
export class Qoder {
|
|
5
|
+
supportsPermissions = false;
|
|
6
|
+
getPlanGenerationCommandLine(prompt) {
|
|
7
|
+
return {
|
|
8
|
+
command: "qodercli",
|
|
9
|
+
args: ["-p", prompt],
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
getTaskRunCommandLine(task, followupPrompt, extraPermissions) {
|
|
13
|
+
const yolo = extraPermissions === "yolo";
|
|
14
|
+
const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
|
|
15
|
+
const args = [];
|
|
16
|
+
if (yolo) {
|
|
17
|
+
args.push("--yolo");
|
|
18
|
+
}
|
|
19
|
+
if (followupPrompt) {
|
|
20
|
+
args.push("-c");
|
|
21
|
+
} // continue mode for followups
|
|
22
|
+
args.push("-p", prompt);
|
|
23
|
+
return { command: "qodercli", args };
|
|
24
|
+
}
|
|
25
|
+
async init() {
|
|
26
|
+
try {
|
|
27
|
+
execSync("qodercli --version", { stdio: "ignore", shell: SHELL });
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=qoder.js.map
|
|
@@ -14,8 +14,8 @@ task_name: <concise label, 3-6 words>
|
|
|
14
14
|
|
|
15
15
|
- Write a numbered sequence of concrete, actionable steps.
|
|
16
16
|
- If the task produces formatted output (report, email, summary, etc.), specify the structure, sections, and tone.
|
|
17
|
-
- When a step requires user input, simply state what information is needed from the user. Do not specify how to obtain it — the agent has its own tool for requesting user input.
|
|
18
|
-
-
|
|
17
|
+
- When a step requires user input, simply state what information is needed from the user. Do **not** specify how to obtain it — the agent has its own tool for requesting user input.
|
|
18
|
+
- Preserve relative time expressions (e.g., "today", "yesterday", "last week") exactly as written — do **not** resolve them to specific dates. The plan may be executed on a different day than it was generated.
|
|
19
19
|
|
|
20
20
|
## Task Description
|
|
21
21
|
|
package/dist/commands/run.js
CHANGED
|
@@ -342,7 +342,12 @@ async function runCommandTriggeredMode(ctx) {
|
|
|
342
342
|
invocationsFailed++;
|
|
343
343
|
});
|
|
344
344
|
});
|
|
345
|
-
|
|
345
|
+
let stderrBuf = "";
|
|
346
|
+
child.stderr?.on("data", (d) => {
|
|
347
|
+
const chunk = d.toString();
|
|
348
|
+
stderrBuf += chunk;
|
|
349
|
+
process.stderr.write(d);
|
|
350
|
+
});
|
|
346
351
|
// Wait for command to exit
|
|
347
352
|
const exitCode = await new Promise((resolve) => {
|
|
348
353
|
child.on("close", (code) => {
|
|
@@ -352,6 +357,7 @@ async function runCommandTriggeredMode(ctx) {
|
|
|
352
357
|
});
|
|
353
358
|
child.on("error", (err) => {
|
|
354
359
|
console.error(`[command-triggered] Command error:`, err);
|
|
360
|
+
stderrBuf += err.message;
|
|
355
361
|
commandExited = true;
|
|
356
362
|
rl.close();
|
|
357
363
|
resolve(1);
|
|
@@ -365,6 +371,17 @@ async function runCommandTriggeredMode(ctx) {
|
|
|
365
371
|
});
|
|
366
372
|
}
|
|
367
373
|
const endTime = Date.now();
|
|
374
|
+
if (exitCode !== 0) {
|
|
375
|
+
const errorDetail = stderrBuf.trim() || `Command exited with code ${exitCode}`;
|
|
376
|
+
appendRunMessage(ctx.taskDir, ctx.runId, {
|
|
377
|
+
role: "status",
|
|
378
|
+
time: endTime,
|
|
379
|
+
content: errorDetail,
|
|
380
|
+
type: "error",
|
|
381
|
+
});
|
|
382
|
+
await publishHostEvent(ctx.nc, ctx.config.hostId, ctx.taskId, { event_type: "result-updated", run_id: ctx.runId });
|
|
383
|
+
return { outcome: "failed", endTime };
|
|
384
|
+
}
|
|
368
385
|
return { outcome: "finished", endTime };
|
|
369
386
|
}
|
|
370
387
|
async function publishTaskEvent(nc, config, taskDir, taskId, eventType, taskName, runId) {
|
package/dist/types.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export interface ConversationMessage {
|
|
|
62
62
|
role: "assistant" | "user" | "status";
|
|
63
63
|
time: number;
|
|
64
64
|
content: string;
|
|
65
|
-
type?: "input" | "permission" | "confirmation" | "monitoring" | "started" | "finished" | "failed" | "aborted" | "stopped";
|
|
65
|
+
type?: "input" | "permission" | "confirmation" | "monitoring" | "started" | "finished" | "failed" | "aborted" | "stopped" | "error";
|
|
66
66
|
attachments?: string[];
|
|
67
67
|
}
|
|
68
68
|
export interface RpcMessage {
|
package/package.json
CHANGED
package/src/agents/agent.ts
CHANGED
|
@@ -11,8 +11,10 @@ import { GooseAgent } from "./goose.js";
|
|
|
11
11
|
import { OpenCodeAgent } from "./opencode.js";
|
|
12
12
|
import { DeepAgents } from "./deepagents.js";
|
|
13
13
|
import { Aider } from "./aider.js";
|
|
14
|
-
import { OpenHands } from "./openhands.js";
|
|
15
14
|
import { Cursor } from "./cursor.js";
|
|
15
|
+
import { Kiro } from "./kiro.js";
|
|
16
|
+
import { Cline } from "./cline.js";
|
|
17
|
+
import { Qoder } from "./qoder.js";
|
|
16
18
|
|
|
17
19
|
export interface CommandLine {
|
|
18
20
|
command: string;
|
|
@@ -59,8 +61,10 @@ const agentRegistry: Record<string, AgentTool> = {
|
|
|
59
61
|
opencode: new OpenCodeAgent(),
|
|
60
62
|
deepagents: new DeepAgents(),
|
|
61
63
|
aider: new Aider(),
|
|
62
|
-
openhands: new OpenHands(),
|
|
63
64
|
cursor: new Cursor(),
|
|
65
|
+
kiro: new Kiro(),
|
|
66
|
+
cline: new Cline(),
|
|
67
|
+
qoder: new Qoder(),
|
|
64
68
|
};
|
|
65
69
|
|
|
66
70
|
const agentLabels: Record<string, string> = {
|
|
@@ -76,8 +80,10 @@ const agentLabels: Record<string, string> = {
|
|
|
76
80
|
opencode: "OpenCode",
|
|
77
81
|
deepagents: "Deep Agents CLI",
|
|
78
82
|
aider: "Aider",
|
|
79
|
-
openhands: "OpenHands",
|
|
80
83
|
cursor: "Cursor CLI",
|
|
84
|
+
kiro: "Kiro",
|
|
85
|
+
cline: "Cline",
|
|
86
|
+
qoder: "Qoder",
|
|
81
87
|
};
|
|
82
88
|
|
|
83
89
|
export interface DetectedAgent {
|
|
@@ -4,32 +4,31 @@ import type { AgentTool, CommandLine } from "./agent.js";
|
|
|
4
4
|
import { getAgentInstructions } from "./shared-prompt.js";
|
|
5
5
|
import { SHELL } from "../platform/index.js";
|
|
6
6
|
|
|
7
|
-
export class
|
|
7
|
+
export class Cline implements AgentTool {
|
|
8
8
|
supportsPermissions = false;
|
|
9
9
|
getPlanGenerationCommandLine(prompt: string): CommandLine {
|
|
10
10
|
return {
|
|
11
|
-
command: "
|
|
12
|
-
args: ["--
|
|
11
|
+
command: "cline ",
|
|
12
|
+
args: ["--yolo", "-p", prompt],
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
17
17
|
const yolo = extraPermissions === "yolo";
|
|
18
18
|
const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
|
|
19
|
-
const args = [
|
|
19
|
+
const args = [];
|
|
20
20
|
|
|
21
21
|
if (yolo) {
|
|
22
|
-
args.push("--
|
|
22
|
+
args.push("--yolo");
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
args.push("-t", prompt);
|
|
24
|
+
args.push(prompt);
|
|
26
25
|
|
|
27
|
-
return { command: "
|
|
26
|
+
return { command: "cline ", args};
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
async init(): Promise<boolean> {
|
|
31
30
|
try {
|
|
32
|
-
execSync("
|
|
31
|
+
execSync("cline --version", { stdio: "ignore", shell: SHELL });
|
|
33
32
|
} catch {
|
|
34
33
|
return false;
|
|
35
34
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ParsedTask, RequiredPermission } from "../types.js";
|
|
2
|
+
import { execSync } from "child_process";
|
|
3
|
+
import type { AgentTool, CommandLine } from "./agent.js";
|
|
4
|
+
import { getAgentInstructions } from "./shared-prompt.js";
|
|
5
|
+
import { SHELL } from "../platform/index.js";
|
|
6
|
+
|
|
7
|
+
export class Kiro implements AgentTool {
|
|
8
|
+
supportsPermissions = false;
|
|
9
|
+
getPlanGenerationCommandLine(prompt: string): CommandLine {
|
|
10
|
+
return {
|
|
11
|
+
command: "kiro-cli",
|
|
12
|
+
args: ["--no-interactive", prompt],
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
17
|
+
const yolo = extraPermissions === "yolo";
|
|
18
|
+
const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
|
|
19
|
+
const args = [];
|
|
20
|
+
|
|
21
|
+
if (yolo) {
|
|
22
|
+
args.push("--trust-all-tools");
|
|
23
|
+
}
|
|
24
|
+
if (followupPrompt) {args.push("--resume");} // continue mode for followups
|
|
25
|
+
args.push("--no-interactive", prompt);
|
|
26
|
+
|
|
27
|
+
return { command: "kiro-cli", args};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async init(): Promise<boolean> {
|
|
31
|
+
try {
|
|
32
|
+
execSync("kiro-cli --version", { stdio: "ignore", shell: SHELL });
|
|
33
|
+
} catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ParsedTask, RequiredPermission } from "../types.js";
|
|
2
|
+
import { execSync } from "child_process";
|
|
3
|
+
import type { AgentTool, CommandLine } from "./agent.js";
|
|
4
|
+
import { getAgentInstructions } from "./shared-prompt.js";
|
|
5
|
+
import { SHELL } from "../platform/index.js";
|
|
6
|
+
|
|
7
|
+
export class Qoder implements AgentTool {
|
|
8
|
+
supportsPermissions = false;
|
|
9
|
+
getPlanGenerationCommandLine(prompt: string): CommandLine {
|
|
10
|
+
return {
|
|
11
|
+
command: "qodercli",
|
|
12
|
+
args: ["-p", prompt],
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
17
|
+
const yolo = extraPermissions === "yolo";
|
|
18
|
+
const prompt = followupPrompt ?? (getAgentInstructions(task.frontmatter.id, yolo || !this.supportsPermissions) + "\n\n" + (task.body || task.frontmatter.user_prompt));
|
|
19
|
+
const args = [];
|
|
20
|
+
|
|
21
|
+
if (yolo) {
|
|
22
|
+
args.push("--yolo");
|
|
23
|
+
}
|
|
24
|
+
if (followupPrompt) {args.push("-c");} // continue mode for followups
|
|
25
|
+
args.push("-p", prompt);
|
|
26
|
+
|
|
27
|
+
return { command: "qodercli", args};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async init(): Promise<boolean> {
|
|
31
|
+
try {
|
|
32
|
+
execSync("qodercli --version", { stdio: "ignore", shell: SHELL });
|
|
33
|
+
} catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -14,8 +14,8 @@ task_name: <concise label, 3-6 words>
|
|
|
14
14
|
|
|
15
15
|
- Write a numbered sequence of concrete, actionable steps.
|
|
16
16
|
- If the task produces formatted output (report, email, summary, etc.), specify the structure, sections, and tone.
|
|
17
|
-
- When a step requires user input, simply state what information is needed from the user. Do not specify how to obtain it — the agent has its own tool for requesting user input.
|
|
18
|
-
-
|
|
17
|
+
- When a step requires user input, simply state what information is needed from the user. Do **not** specify how to obtain it — the agent has its own tool for requesting user input.
|
|
18
|
+
- Preserve relative time expressions (e.g., "today", "yesterday", "last week") exactly as written — do **not** resolve them to specific dates. The plan may be executed on a different day than it was generated.
|
|
19
19
|
|
|
20
20
|
## Task Description
|
|
21
21
|
|
package/src/commands/run.ts
CHANGED
|
@@ -411,7 +411,12 @@ async function runCommandTriggeredMode(
|
|
|
411
411
|
});
|
|
412
412
|
});
|
|
413
413
|
|
|
414
|
-
|
|
414
|
+
let stderrBuf = "";
|
|
415
|
+
child.stderr?.on("data", (d: Buffer) => {
|
|
416
|
+
const chunk = d.toString();
|
|
417
|
+
stderrBuf += chunk;
|
|
418
|
+
process.stderr.write(d);
|
|
419
|
+
});
|
|
415
420
|
|
|
416
421
|
// Wait for command to exit
|
|
417
422
|
const exitCode = await new Promise<number | null>((resolve) => {
|
|
@@ -422,6 +427,7 @@ async function runCommandTriggeredMode(
|
|
|
422
427
|
});
|
|
423
428
|
child.on("error", (err: Error) => {
|
|
424
429
|
console.error(`[command-triggered] Command error:`, err);
|
|
430
|
+
stderrBuf += err.message;
|
|
425
431
|
commandExited = true;
|
|
426
432
|
rl.close();
|
|
427
433
|
resolve(1);
|
|
@@ -437,6 +443,19 @@ async function runCommandTriggeredMode(
|
|
|
437
443
|
}
|
|
438
444
|
|
|
439
445
|
const endTime = Date.now();
|
|
446
|
+
|
|
447
|
+
if (exitCode !== 0) {
|
|
448
|
+
const errorDetail = stderrBuf.trim() || `Command exited with code ${exitCode}`;
|
|
449
|
+
appendRunMessage(ctx.taskDir, ctx.runId, {
|
|
450
|
+
role: "status",
|
|
451
|
+
time: endTime,
|
|
452
|
+
content: errorDetail,
|
|
453
|
+
type: "error",
|
|
454
|
+
});
|
|
455
|
+
await publishHostEvent(ctx.nc, ctx.config.hostId, ctx.taskId, { event_type: "result-updated", run_id: ctx.runId });
|
|
456
|
+
return { outcome: "failed", endTime };
|
|
457
|
+
}
|
|
458
|
+
|
|
440
459
|
return { outcome: "finished", endTime };
|
|
441
460
|
}
|
|
442
461
|
|
package/src/types.ts
CHANGED
|
@@ -73,7 +73,7 @@ export interface ConversationMessage {
|
|
|
73
73
|
role: "assistant" | "user" | "status";
|
|
74
74
|
time: number;
|
|
75
75
|
content: string;
|
|
76
|
-
type?: "input" | "permission" | "confirmation" | "monitoring" | "started" | "finished" | "failed" | "aborted" | "stopped";
|
|
76
|
+
type?: "input" | "permission" | "confirmation" | "monitoring" | "started" | "finished" | "failed" | "aborted" | "stopped" | "error";
|
|
77
77
|
attachments?: string[];
|
|
78
78
|
}
|
|
79
79
|
|