palmier 0.9.6 → 0.9.8
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 +28 -13
- package/dist/agents/agent.d.ts +0 -1
- package/dist/agents/agent.js +0 -1
- package/dist/agents/aider.d.ts +0 -1
- package/dist/agents/aider.js +0 -1
- package/dist/agents/claude.d.ts +0 -1
- package/dist/agents/claude.js +0 -1
- package/dist/agents/cline.d.ts +0 -1
- package/dist/agents/cline.js +0 -1
- package/dist/agents/codex.d.ts +0 -1
- package/dist/agents/codex.js +0 -1
- package/dist/agents/copilot.d.ts +0 -1
- package/dist/agents/copilot.js +0 -1
- package/dist/agents/cursor.d.ts +0 -1
- package/dist/agents/cursor.js +0 -1
- package/dist/agents/deepagents.d.ts +0 -1
- package/dist/agents/deepagents.js +0 -1
- package/dist/agents/droid.d.ts +0 -1
- package/dist/agents/droid.js +0 -1
- package/dist/agents/gemini.d.ts +0 -1
- package/dist/agents/gemini.js +0 -1
- package/dist/agents/goose.d.ts +0 -1
- package/dist/agents/goose.js +0 -1
- package/dist/agents/hermes.d.ts +0 -1
- package/dist/agents/hermes.js +0 -1
- package/dist/agents/kimi.d.ts +0 -1
- package/dist/agents/kimi.js +0 -1
- package/dist/agents/kiro.d.ts +0 -1
- package/dist/agents/kiro.js +0 -1
- package/dist/agents/openclaw.d.ts +0 -1
- package/dist/agents/openclaw.js +0 -1
- package/dist/agents/opencode.d.ts +0 -1
- package/dist/agents/opencode.js +0 -1
- package/dist/agents/qoder.d.ts +0 -1
- package/dist/agents/qoder.js +0 -1
- package/dist/agents/qwen.d.ts +0 -1
- package/dist/agents/qwen.js +0 -1
- package/dist/agents/shared-prompt.d.ts +0 -1
- package/dist/agents/shared-prompt.js +0 -1
- package/dist/client-store.d.ts +0 -1
- package/dist/client-store.js +0 -1
- package/dist/commands/clients.d.ts +0 -1
- package/dist/commands/clients.js +0 -1
- package/dist/commands/info.d.ts +0 -1
- package/dist/commands/info.js +0 -1
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.js +1 -2
- package/dist/commands/pair.d.ts +0 -1
- package/dist/commands/pair.js +0 -1
- package/dist/commands/restart.d.ts +0 -1
- package/dist/commands/restart.js +0 -1
- package/dist/commands/run.d.ts +0 -1
- package/dist/commands/run.js +19 -3
- package/dist/commands/serve.d.ts +0 -1
- package/dist/commands/serve.js +0 -1
- package/dist/commands/uninstall.d.ts +0 -1
- package/dist/commands/uninstall.js +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/event-queues.d.ts +0 -1
- package/dist/event-queues.js +0 -1
- package/dist/events.d.ts +0 -1
- package/dist/events.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/linked-device.d.ts +0 -1
- package/dist/linked-device.js +0 -1
- package/dist/mcp-handler.d.ts +0 -1
- package/dist/mcp-handler.js +0 -1
- package/dist/mcp-tools.d.ts +0 -1
- package/dist/mcp-tools.js +0 -1
- package/dist/nats-client.d.ts +0 -1
- package/dist/nats-client.js +0 -1
- package/dist/network.d.ts +0 -1
- package/dist/network.js +0 -1
- package/dist/notification-store.d.ts +0 -1
- package/dist/notification-store.js +0 -1
- package/dist/pending-requests.d.ts +0 -1
- package/dist/pending-requests.js +0 -1
- package/dist/platform/index.d.ts +0 -1
- package/dist/platform/index.js +0 -1
- package/dist/platform/linux.d.ts +0 -1
- package/dist/platform/linux.js +0 -1
- package/dist/platform/macos.d.ts +0 -1
- package/dist/platform/macos.js +0 -1
- package/dist/platform/platform.d.ts +0 -1
- package/dist/platform/platform.js +0 -1
- package/dist/platform/windows.d.ts +0 -1
- package/dist/platform/windows.js +0 -1
- package/dist/pwa/assets/{index-MLEFUP3r.js → index-DWvRAUiy.js} +31 -31
- package/dist/pwa/assets/{web-B1sKCc7e.js → web-C4iZbqTC.js} +1 -1
- package/dist/pwa/assets/{web-ETD-8ZHd.js → web-CBFqJGX6.js} +1 -1
- package/dist/pwa/assets/{web-B4xEa6WO.js → web-DL4uXOpS.js} +1 -1
- package/dist/pwa/index.html +2 -2
- package/dist/rpc-handler.d.ts +0 -1
- package/dist/rpc-handler.js +0 -1
- package/dist/sms-store.d.ts +0 -1
- package/dist/sms-store.js +0 -1
- package/dist/spawn-command.d.ts +0 -1
- package/dist/spawn-command.js +0 -1
- package/dist/task.d.ts +0 -1
- package/dist/task.js +0 -1
- package/dist/transports/http-transport.d.ts +0 -1
- package/dist/transports/http-transport.js +0 -1
- package/dist/transports/nats-transport.d.ts +0 -1
- package/dist/transports/nats-transport.js +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.js +0 -1
- package/dist/update-checker.d.ts +0 -1
- package/dist/update-checker.js +0 -1
- package/package.json +11 -1
- package/.github/workflows/ci.yml +0 -16
- package/.github/workflows/publish.yml +0 -37
- package/CLAUDE.md +0 -22
- package/dist/pwa/apple-touch-icon.png +0 -0
- package/dist/pwa/manifest.webmanifest +0 -1
- package/dist/pwa/pwa-192x192.png +0 -0
- package/dist/pwa/pwa-512x512.png +0 -0
- package/dist/pwa/registerSW.js +0 -1
- package/dist/pwa/service-worker.js +0 -2
- package/palmier-server/.github/workflows/ci.yml +0 -21
- package/palmier-server/.github/workflows/deploy.yml +0 -38
- package/palmier-server/CLAUDE.md +0 -17
- package/palmier-server/PRODUCTION.md +0 -358
- package/palmier-server/README.md +0 -231
- package/palmier-server/nats.conf +0 -19
- package/palmier-server/package.json +0 -15
- package/palmier-server/pnpm-lock.yaml +0 -7639
- package/palmier-server/pnpm-workspace.yaml +0 -3
- package/palmier-server/pwa/index.html +0 -16
- package/palmier-server/pwa/logo/logo_20260421.png +0 -0
- package/palmier-server/pwa/package.json +0 -34
- package/palmier-server/pwa/public/apple-touch-icon.png +0 -0
- package/palmier-server/pwa/public/favicon.ico +0 -0
- package/palmier-server/pwa/public/pwa-192x192.png +0 -0
- package/palmier-server/pwa/public/pwa-512x512.png +0 -0
- package/palmier-server/pwa/src/App.css +0 -3012
- package/palmier-server/pwa/src/App.tsx +0 -59
- package/palmier-server/pwa/src/agentLabels.ts +0 -11
- package/palmier-server/pwa/src/api.ts +0 -67
- package/palmier-server/pwa/src/components/CapabilityToggles.tsx +0 -170
- package/palmier-server/pwa/src/components/ConnectionStatusIcon.tsx +0 -113
- package/palmier-server/pwa/src/components/HostMenu.tsx +0 -429
- package/palmier-server/pwa/src/components/PermissionsDialog.tsx +0 -34
- package/palmier-server/pwa/src/components/PullToRefreshIndicator.tsx +0 -46
- package/palmier-server/pwa/src/components/RunDetailView.tsx +0 -343
- package/palmier-server/pwa/src/components/SessionComposer.tsx +0 -157
- package/palmier-server/pwa/src/components/SessionsView.tsx +0 -326
- package/palmier-server/pwa/src/components/SwipeToDeleteRow.tsx +0 -170
- package/palmier-server/pwa/src/components/TabBar.tsx +0 -40
- package/palmier-server/pwa/src/components/TaskCard.tsx +0 -255
- package/palmier-server/pwa/src/components/TaskForm.tsx +0 -766
- package/palmier-server/pwa/src/components/TasksView.tsx +0 -179
- package/palmier-server/pwa/src/constants.ts +0 -2
- package/palmier-server/pwa/src/contexts/HostConnectionContext.tsx +0 -432
- package/palmier-server/pwa/src/contexts/HostStoreContext.tsx +0 -124
- package/palmier-server/pwa/src/draftGuard.ts +0 -24
- package/palmier-server/pwa/src/formatTime.ts +0 -44
- package/palmier-server/pwa/src/hooks/useBackClose.ts +0 -75
- package/palmier-server/pwa/src/hooks/useMediaQuery.ts +0 -17
- package/palmier-server/pwa/src/hooks/usePullToRefresh.ts +0 -102
- package/palmier-server/pwa/src/hooks/usePushSubscription.ts +0 -77
- package/palmier-server/pwa/src/main.tsx +0 -14
- package/palmier-server/pwa/src/native/Device.ts +0 -49
- package/palmier-server/pwa/src/pages/Dashboard.tsx +0 -542
- package/palmier-server/pwa/src/pages/PairHost.tsx +0 -232
- package/palmier-server/pwa/src/pages/PairSetup.tsx +0 -134
- package/palmier-server/pwa/src/service-worker.ts +0 -142
- package/palmier-server/pwa/src/types.ts +0 -75
- package/palmier-server/pwa/src/vite-env.d.ts +0 -11
- package/palmier-server/pwa/tsconfig.json +0 -21
- package/palmier-server/pwa/tsconfig.node.json +0 -19
- package/palmier-server/pwa/vite.config.ts +0 -47
- package/palmier-server/server/.env.example +0 -20
- package/palmier-server/server/package.json +0 -36
- package/palmier-server/server/src/db.ts +0 -44
- package/palmier-server/server/src/fcm.ts +0 -74
- package/palmier-server/server/src/index.ts +0 -688
- package/palmier-server/server/src/nats-jwt.ts +0 -299
- package/palmier-server/server/src/nats-setup.ts +0 -48
- package/palmier-server/server/src/nats.ts +0 -33
- package/palmier-server/server/src/notify.ts +0 -34
- package/palmier-server/server/src/push.ts +0 -68
- package/palmier-server/server/src/routes/device.ts +0 -224
- package/palmier-server/server/src/routes/fcm.ts +0 -64
- package/palmier-server/server/src/routes/hosts.ts +0 -56
- package/palmier-server/server/src/routes/push.ts +0 -101
- package/palmier-server/server/tsconfig.json +0 -20
- package/palmier-server/spec.md +0 -533
- package/src/agents/agent-instructions.md +0 -28
- package/src/agents/agent.ts +0 -114
- package/src/agents/aider.ts +0 -35
- package/src/agents/claude.ts +0 -39
- package/src/agents/cline.ts +0 -35
- package/src/agents/codex.ts +0 -40
- package/src/agents/copilot.ts +0 -37
- package/src/agents/cursor.ts +0 -36
- package/src/agents/deepagents.ts +0 -36
- package/src/agents/droid.ts +0 -35
- package/src/agents/gemini.ts +0 -43
- package/src/agents/goose.ts +0 -33
- package/src/agents/hermes.ts +0 -36
- package/src/agents/kimi.ts +0 -35
- package/src/agents/kiro.ts +0 -36
- package/src/agents/openclaw.ts +0 -29
- package/src/agents/opencode.ts +0 -36
- package/src/agents/qoder.ts +0 -36
- package/src/agents/qwen.ts +0 -32
- package/src/agents/shared-prompt.ts +0 -30
- package/src/client-store.ts +0 -68
- package/src/commands/clients.ts +0 -29
- package/src/commands/info.ts +0 -29
- package/src/commands/init.ts +0 -165
- package/src/commands/pair.ts +0 -137
- package/src/commands/restart.ts +0 -6
- package/src/commands/run.ts +0 -608
- package/src/commands/serve.ts +0 -211
- package/src/commands/uninstall.ts +0 -9
- package/src/config.ts +0 -36
- package/src/cross-spawn.d.ts +0 -5
- package/src/event-queues.ts +0 -41
- package/src/events.ts +0 -29
- package/src/index.ts +0 -111
- package/src/linked-device.ts +0 -52
- package/src/mcp-handler.ts +0 -200
- package/src/mcp-tools.ts +0 -839
- package/src/nats-client.ts +0 -19
- package/src/network.ts +0 -96
- package/src/notification-store.ts +0 -30
- package/src/pending-requests.ts +0 -73
- package/src/platform/index.ts +0 -20
- package/src/platform/linux.ts +0 -296
- package/src/platform/macos.ts +0 -329
- package/src/platform/platform.ts +0 -31
- package/src/platform/windows.ts +0 -299
- package/src/rpc-handler.ts +0 -691
- package/src/sms-store.ts +0 -28
- package/src/spawn-command.ts +0 -123
- package/src/task.ts +0 -343
- package/src/transports/http-transport.ts +0 -478
- package/src/transports/nats-transport.ts +0 -76
- package/src/types.ts +0 -89
- package/src/update-checker.ts +0 -40
- package/test/agent-instructions.test.ts +0 -209
- package/test/agent-output-parsing.test.ts +0 -74
- package/test/linux-cron.test.ts +0 -41
- package/test/macos-plist.test.ts +0 -112
- package/test/notification-store.test.ts +0 -57
- package/test/pairing.test.ts +0 -35
- package/test/result-state.test.ts +0 -110
- package/test/task-parsing.test.ts +0 -82
- package/test/taskrun-messages.test.ts +0 -224
- package/test/tsconfig.json +0 -9
- package/test/windows-xml.test.ts +0 -89
- package/tsconfig.json +0 -19
package/src/agents/agent.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import type { ParsedTask, RequiredPermission } from "../types.js";
|
|
2
|
-
import { ClaudeAgent } from "./claude.js";
|
|
3
|
-
import { GeminiAgent } from "./gemini.js";
|
|
4
|
-
import { CodexAgent } from "./codex.js";
|
|
5
|
-
import { DroidAgent } from "./droid.js";
|
|
6
|
-
import { OpenClawAgent } from "./openclaw.js";
|
|
7
|
-
import { CopilotAgent } from "./copilot.js";
|
|
8
|
-
import { QwenAgent } from "./qwen.js";
|
|
9
|
-
import { KimiAgent } from "./kimi.js";
|
|
10
|
-
import { GooseAgent } from "./goose.js";
|
|
11
|
-
import { OpenCodeAgent } from "./opencode.js";
|
|
12
|
-
import { DeepAgents } from "./deepagents.js";
|
|
13
|
-
import { Aider } from "./aider.js";
|
|
14
|
-
import { Cursor } from "./cursor.js";
|
|
15
|
-
import { Kiro } from "./kiro.js";
|
|
16
|
-
import { Cline } from "./cline.js";
|
|
17
|
-
import { Qoder } from "./qoder.js";
|
|
18
|
-
import { Hermes } from "./hermes.js";
|
|
19
|
-
|
|
20
|
-
export interface CommandLine {
|
|
21
|
-
command: string;
|
|
22
|
-
args: string[];
|
|
23
|
-
/** If provided, the string is written to the process's stdin and then the pipe is closed. */
|
|
24
|
-
stdin?: string;
|
|
25
|
-
/** Additional environment variables to set for the spawned process. */
|
|
26
|
-
env?: Record<string, string>;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface AgentTool {
|
|
30
|
-
/** Return the command and args for a short, non-interactive prompt (e.g. generating a task name). */
|
|
31
|
-
getPromptCommandLine(prompt: string): CommandLine;
|
|
32
|
-
|
|
33
|
-
/** Return the command and args used to run a task. If followupPrompt is provided, use it instead of the task's prompt,
|
|
34
|
-
* and treat it as a continuation of the original run (reuse the same session, etc).
|
|
35
|
-
* extraPermissions: pass an array of RequiredPermission for transient permissions granted for this run only,
|
|
36
|
-
* or pass `"yolo"` to enable yolo mode (auto-approve all tools, skip permission instructions). */
|
|
37
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine;
|
|
38
|
-
|
|
39
|
-
/** Whether this agent supports permission overrides (e.g. --allowedTools).
|
|
40
|
-
* If false, the permissions section is omitted from agent instructions. */
|
|
41
|
-
supportsPermissions: boolean;
|
|
42
|
-
|
|
43
|
-
/** Whether this agent supports yolo mode (auto-approve all tools). */
|
|
44
|
-
supportsYolo: boolean;
|
|
45
|
-
|
|
46
|
-
/** Detect whether the agent CLI is available and perform any agent-specific
|
|
47
|
-
* initialization. Returns true if the agent was detected and initialized successfully. */
|
|
48
|
-
init(): Promise<boolean>;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const agentRegistry: Record<string, AgentTool> = {
|
|
52
|
-
claude: new ClaudeAgent(),
|
|
53
|
-
gemini: new GeminiAgent(),
|
|
54
|
-
codex: new CodexAgent(),
|
|
55
|
-
openclaw: new OpenClawAgent(),
|
|
56
|
-
copilot: new CopilotAgent(),
|
|
57
|
-
qwen: new QwenAgent(),
|
|
58
|
-
kimi: new KimiAgent(),
|
|
59
|
-
droid: new DroidAgent(),
|
|
60
|
-
goose: new GooseAgent(),
|
|
61
|
-
opencode: new OpenCodeAgent(),
|
|
62
|
-
deepagents: new DeepAgents(),
|
|
63
|
-
aider: new Aider(),
|
|
64
|
-
cursor: new Cursor(),
|
|
65
|
-
kiro: new Kiro(),
|
|
66
|
-
cline: new Cline(),
|
|
67
|
-
qoder: new Qoder(),
|
|
68
|
-
hermes: new Hermes(),
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const agentLabels: Record<string, string> = {
|
|
72
|
-
claude: "Claude Code",
|
|
73
|
-
gemini: "Gemini CLI",
|
|
74
|
-
codex: "Codex CLI",
|
|
75
|
-
droid: "Droid CLI",
|
|
76
|
-
openclaw: "OpenClaw",
|
|
77
|
-
copilot: "Copilot CLI",
|
|
78
|
-
qwen: "Qwen Code",
|
|
79
|
-
kimi: "Kimi Code",
|
|
80
|
-
goose: "Goose CLI",
|
|
81
|
-
opencode: "OpenCode",
|
|
82
|
-
deepagents: "Deep Agents CLI",
|
|
83
|
-
aider: "Aider",
|
|
84
|
-
cursor: "Cursor CLI",
|
|
85
|
-
kiro: "Kiro CLI",
|
|
86
|
-
cline: "Cline CLI",
|
|
87
|
-
qoder: "Qoder CLI",
|
|
88
|
-
hermes: "Hermes Agent",
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export interface DetectedAgent {
|
|
92
|
-
key: string;
|
|
93
|
-
label: string;
|
|
94
|
-
supportsPermissions: boolean;
|
|
95
|
-
supportsYolo: boolean;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export async function detectAgents(): Promise<DetectedAgent[]> {
|
|
99
|
-
const detected: DetectedAgent[] = [];
|
|
100
|
-
for (const [key, agent] of Object.entries(agentRegistry)) {
|
|
101
|
-
const label = agentLabels[key] ?? key;
|
|
102
|
-
const ok = await agent.init();
|
|
103
|
-
if (ok) detected.push({ key, label, supportsPermissions: agent.supportsPermissions, supportsYolo: agent.supportsYolo });
|
|
104
|
-
}
|
|
105
|
-
return detected;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function getAgent(name: string): AgentTool {
|
|
109
|
-
const agent = agentRegistry[name];
|
|
110
|
-
if (!agent) {
|
|
111
|
-
throw new Error(`Unknown agent: "${name}". Available agents: ${Object.keys(agentRegistry).join(", ")}`);
|
|
112
|
-
}
|
|
113
|
-
return agent;
|
|
114
|
-
}
|
package/src/agents/aider.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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 Aider implements AgentTool {
|
|
8
|
-
supportsPermissions = false;
|
|
9
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "aider", args: ["--message", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = [];
|
|
18
|
-
|
|
19
|
-
if (yolo) {
|
|
20
|
-
args.push("--yes-always");
|
|
21
|
-
}
|
|
22
|
-
args.push("--message", prompt);
|
|
23
|
-
|
|
24
|
-
return { command: "aider", args};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async init(): Promise<boolean> {
|
|
28
|
-
try {
|
|
29
|
-
execSync("aider --version", { stdio: "ignore", shell: SHELL });
|
|
30
|
-
} catch {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
}
|
package/src/agents/claude.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
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 ClaudeAgent implements AgentTool {
|
|
8
|
-
supportsPermissions = true;
|
|
9
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "claude", args: ["-p", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = ["--permission-mode", yolo ? "bypassPermissions" : "acceptEdits", "-p"];
|
|
18
|
-
|
|
19
|
-
if (!yolo) {
|
|
20
|
-
args.push("--allowedTools", "WebFetch");
|
|
21
|
-
const allPerms = [...(task.frontmatter.permissions ?? []), ...(extraPermissions ?? [])];
|
|
22
|
-
for (const p of allPerms) {
|
|
23
|
-
args.push("--allowedTools", p.name);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (followupPrompt) {args.push("-c");}
|
|
28
|
-
return { command: "claude", args, stdin: prompt };
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
async init(): Promise<boolean> {
|
|
32
|
-
try {
|
|
33
|
-
execSync("claude --version", { stdio: "ignore", shell: SHELL });
|
|
34
|
-
} catch {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
}
|
package/src/agents/cline.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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 Cline implements AgentTool {
|
|
8
|
-
supportsPermissions = false;
|
|
9
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "cline ", args: ["--yolo", "-p", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = [];
|
|
18
|
-
|
|
19
|
-
if (yolo) {
|
|
20
|
-
args.push("--yolo");
|
|
21
|
-
}
|
|
22
|
-
args.push(prompt);
|
|
23
|
-
|
|
24
|
-
return { command: "cline ", args};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async init(): Promise<boolean> {
|
|
28
|
-
try {
|
|
29
|
-
execSync("cline --version", { stdio: "ignore", shell: SHELL });
|
|
30
|
-
} catch {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
}
|
package/src/agents/codex.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
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 CodexAgent implements AgentTool {
|
|
8
|
-
supportsPermissions = true;
|
|
9
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "codex", args: ["exec", "--skip-git-repo-check", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = ["exec", "--skip-git-repo-check", "--sandbox", yolo ? "danger-full-access" : "workspace-write"];
|
|
18
|
-
|
|
19
|
-
if (!yolo) {
|
|
20
|
-
const allPerms = [...(task.frontmatter.permissions ?? []), ...(extraPermissions ?? [])];
|
|
21
|
-
for (const p of allPerms) {
|
|
22
|
-
args.push("--config");
|
|
23
|
-
args.push(`apps.${p.name}.default_tools_approval_mode="approve"`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (followupPrompt) {args.push("resume", "--last");}
|
|
27
|
-
args.push("-");
|
|
28
|
-
|
|
29
|
-
return { command: "codex", args, stdin: prompt };
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async init(): Promise<boolean> {
|
|
33
|
-
try {
|
|
34
|
-
execSync("codex --version", { stdio: "ignore", shell: SHELL });
|
|
35
|
-
} catch {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
}
|
package/src/agents/copilot.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
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 CopilotAgent implements AgentTool {
|
|
8
|
-
supportsPermissions = false;
|
|
9
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "copilot", args: ["-p", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = ["-p", prompt];
|
|
18
|
-
|
|
19
|
-
if (yolo) {
|
|
20
|
-
args.push("--yolo");
|
|
21
|
-
} else {
|
|
22
|
-
const allPerms = [...(task.frontmatter.permissions ?? []), ...(extraPermissions ?? [])];
|
|
23
|
-
args.push(`--allow-tool=${["web_fetch", ...allPerms.map((p) => p.name)].join(",")}`);
|
|
24
|
-
}
|
|
25
|
-
if (followupPrompt) { args.push("--continue"); }
|
|
26
|
-
return { command: "copilot", args};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async init(): Promise<boolean> {
|
|
30
|
-
try {
|
|
31
|
-
execSync("copilot -v", { stdio: "ignore", shell: SHELL });
|
|
32
|
-
} catch {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
}
|
package/src/agents/cursor.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
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 Cursor implements AgentTool {
|
|
8
|
-
supportsPermissions = false;
|
|
9
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "cursor", args: ["-p", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = [];
|
|
18
|
-
|
|
19
|
-
if (yolo) {
|
|
20
|
-
args.push("--force");
|
|
21
|
-
}
|
|
22
|
-
if (followupPrompt) {args.push("--continue");}
|
|
23
|
-
args.push("-p", prompt);
|
|
24
|
-
|
|
25
|
-
return { command: "cursor", args};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async init(): Promise<boolean> {
|
|
29
|
-
try {
|
|
30
|
-
execSync("cursor --version", { stdio: "ignore", shell: SHELL });
|
|
31
|
-
} catch {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
}
|
package/src/agents/deepagents.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
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 DeepAgents implements AgentTool {
|
|
8
|
-
supportsPermissions = false;
|
|
9
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "deepagents", args: ["--non-interactive", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = [];
|
|
18
|
-
|
|
19
|
-
if (yolo) {
|
|
20
|
-
args.push("--auto-approve");
|
|
21
|
-
}
|
|
22
|
-
if (followupPrompt) {args.push("--resume");}
|
|
23
|
-
args.push("--non-interactive", prompt);
|
|
24
|
-
|
|
25
|
-
return { command: "deepagents", args};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async init(): Promise<boolean> {
|
|
29
|
-
try {
|
|
30
|
-
execSync("deepagents --version", { stdio: "ignore", shell: SHELL });
|
|
31
|
-
} catch {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
}
|
package/src/agents/droid.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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 DroidAgent implements AgentTool {
|
|
8
|
-
supportsPermissions = false;
|
|
9
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "droid", args: ["exec", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = ["exec", "--session-id", task.frontmatter.id];
|
|
18
|
-
|
|
19
|
-
if (yolo) {
|
|
20
|
-
args.push("--skip-permissions-unsafe");
|
|
21
|
-
}
|
|
22
|
-
args.push(prompt);
|
|
23
|
-
|
|
24
|
-
return { command: "droid", args};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async init(): Promise<boolean> {
|
|
28
|
-
try {
|
|
29
|
-
execSync("droid --version", { stdio: "ignore", shell: SHELL });
|
|
30
|
-
} catch {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
}
|
package/src/agents/gemini.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
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 GeminiAgent implements AgentTool {
|
|
8
|
-
supportsPermissions = true;
|
|
9
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "gemini", args: ["--prompt", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = ["--approval-mode", yolo ? "yolo" : "auto_edit"];
|
|
18
|
-
|
|
19
|
-
if (!yolo) {
|
|
20
|
-
const tools = ["run_shell_command", "web_fetch"];
|
|
21
|
-
const allPerms = [...(task.frontmatter.permissions ?? []), ...(extraPermissions ?? [])];
|
|
22
|
-
for (const p of allPerms) {
|
|
23
|
-
tools.push(p.name);
|
|
24
|
-
}
|
|
25
|
-
args.push("--allowed-tools", tools.join(","));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (followupPrompt) {args.push("--resume");}
|
|
29
|
-
// Read prompt from stdin to avoid command-line length limits.
|
|
30
|
-
args.push("--prompt", "-");
|
|
31
|
-
|
|
32
|
-
return { command: "gemini", args, stdin: prompt };
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async init(): Promise<boolean> {
|
|
36
|
-
try {
|
|
37
|
-
execSync("gemini --version", { stdio: "ignore", shell: SHELL });
|
|
38
|
-
} catch {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
}
|
package/src/agents/goose.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
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 GooseAgent implements AgentTool {
|
|
8
|
-
supportsPermissions = false;
|
|
9
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "goose", args: ["run", "--text", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = ["run"];
|
|
18
|
-
|
|
19
|
-
if (followupPrompt) {args.push("--resume");}
|
|
20
|
-
args.push("--text", prompt);
|
|
21
|
-
|
|
22
|
-
return { command: "goose", args, ...(yolo ? { env: { GOOSE_MODE: "auto" } } : {}) };
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async init(): Promise<boolean> {
|
|
26
|
-
try {
|
|
27
|
-
execSync("goose --version", { stdio: "ignore", shell: SHELL });
|
|
28
|
-
} catch {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
}
|
package/src/agents/hermes.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
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 Hermes implements AgentTool {
|
|
8
|
-
supportsPermissions = false;
|
|
9
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "hermes", args: ["chat", "-q", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = ["chat"];
|
|
18
|
-
|
|
19
|
-
if (yolo) {
|
|
20
|
-
args.push("--trust-all-tools");
|
|
21
|
-
}
|
|
22
|
-
if (followupPrompt) {args.push("--continue");}
|
|
23
|
-
args.push("-q", prompt);
|
|
24
|
-
|
|
25
|
-
return { command: "hermes", args};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async init(): Promise<boolean> {
|
|
29
|
-
try {
|
|
30
|
-
execSync("hermes --version", { stdio: "ignore", shell: SHELL });
|
|
31
|
-
} catch {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
}
|
package/src/agents/kimi.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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 KimiAgent implements AgentTool {
|
|
8
|
-
supportsPermissions = false;
|
|
9
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "kimi", args: ["-p", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = [];
|
|
18
|
-
|
|
19
|
-
if (yolo) {
|
|
20
|
-
args.push("--yolo");
|
|
21
|
-
}
|
|
22
|
-
if (followupPrompt) { args.push("--continue"); }
|
|
23
|
-
args.push("-p", prompt);
|
|
24
|
-
return { command: "kimi", args };
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async init(): Promise<boolean> {
|
|
28
|
-
try {
|
|
29
|
-
execSync("kimi --version", { stdio: "ignore", shell: SHELL });
|
|
30
|
-
} catch {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
}
|
package/src/agents/kiro.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
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
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "kiro-cli", args: ["--no-interactive", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = [];
|
|
18
|
-
|
|
19
|
-
if (yolo) {
|
|
20
|
-
args.push("--trust-all-tools");
|
|
21
|
-
}
|
|
22
|
-
if (followupPrompt) {args.push("--resume");}
|
|
23
|
-
args.push("--no-interactive", prompt);
|
|
24
|
-
|
|
25
|
-
return { command: "kiro-cli", args};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async init(): Promise<boolean> {
|
|
29
|
-
try {
|
|
30
|
-
execSync("kiro-cli --version", { stdio: "ignore", shell: SHELL });
|
|
31
|
-
} catch {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
}
|
package/src/agents/openclaw.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
|
|
6
|
-
export class OpenClawAgent implements AgentTool {
|
|
7
|
-
supportsPermissions = false;
|
|
8
|
-
supportsYolo = false;
|
|
9
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
10
|
-
return { command: "openclaw", args: ["agent", "--local", "--agent", "main", "--message", prompt] };
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
14
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, true);
|
|
15
|
-
// OpenClaw does not support stdin as prompt.
|
|
16
|
-
const args = ["agent", "--local", "--session-id", task.frontmatter.id, "--message", prompt];
|
|
17
|
-
|
|
18
|
-
return { command: "openclaw", args };
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async init(): Promise<boolean> {
|
|
22
|
-
try {
|
|
23
|
-
execSync("openclaw --version", { stdio: "ignore" });
|
|
24
|
-
} catch {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
}
|
package/src/agents/opencode.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
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 OpenCodeAgent implements AgentTool {
|
|
8
|
-
supportsPermissions = false;
|
|
9
|
-
supportsYolo = true;
|
|
10
|
-
getPromptCommandLine(prompt: string): CommandLine {
|
|
11
|
-
return { command: "opencode", args: ["run", prompt] };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getTaskRunCommandLine(task: ParsedTask, followupPrompt?: string, extraPermissions?: RequiredPermission[] | "yolo"): CommandLine {
|
|
15
|
-
const yolo = extraPermissions === "yolo";
|
|
16
|
-
const prompt = followupPrompt ?? getAgentInstructions(task, yolo || !this.supportsPermissions);
|
|
17
|
-
const args = ["run"];
|
|
18
|
-
|
|
19
|
-
if (yolo) {
|
|
20
|
-
args.push("--dangerously-skip-permissions");
|
|
21
|
-
}
|
|
22
|
-
if (followupPrompt) {args.push("--continue");}
|
|
23
|
-
args.push(prompt);
|
|
24
|
-
|
|
25
|
-
return { command: "opencode", args};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async init(): Promise<boolean> {
|
|
29
|
-
try {
|
|
30
|
-
execSync("opencode --version", { stdio: "ignore", shell: SHELL });
|
|
31
|
-
} catch {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
}
|