@meandmyagents/agent-runner 0.1.1 → 0.1.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/README.md +6 -0
- package/package.json +1 -1
- package/src/runner.js +47 -4
package/README.md
CHANGED
|
@@ -13,6 +13,12 @@ process as `MAA_API_KEY`, so one Mac can run several agent profiles without
|
|
|
13
13
|
sharing identity. The launched agent uses MCP to start, complete, and drain the
|
|
14
14
|
remaining actionable cards.
|
|
15
15
|
|
|
16
|
+
Codex is launched with `--ask-for-approval never --sandbox danger-full-access`.
|
|
17
|
+
Claude is launched with `--permission-mode bypassPermissions`. The runner prompt
|
|
18
|
+
also includes the effective workflow instructions saved in MeAndMyAgents, tells
|
|
19
|
+
the agent not to wait for human answers, and tells it to verify, commit, and push
|
|
20
|
+
code changes before calling `complete_task`.
|
|
21
|
+
|
|
16
22
|
On macOS, `--launcher codex` will also look for the bundled Codex app executable
|
|
17
23
|
at `/Applications/Codex.app/Contents/Resources/codex` when `codex` is not on
|
|
18
24
|
`PATH`. If your launcher lives somewhere else, pass it explicitly:
|
package/package.json
CHANGED
package/src/runner.js
CHANGED
|
@@ -77,17 +77,38 @@ export function buildAgentPrompt({
|
|
|
77
77
|
agentName,
|
|
78
78
|
cardId,
|
|
79
79
|
eventId,
|
|
80
|
-
|
|
80
|
+
project,
|
|
81
|
+
projectName,
|
|
82
|
+
workflow
|
|
81
83
|
}) {
|
|
84
|
+
const workflowInstructions = Array.isArray(workflow?.instructions)
|
|
85
|
+
? workflow.instructions
|
|
86
|
+
: [];
|
|
87
|
+
const defaultBranch = project?.defaultBranch || "the default branch";
|
|
88
|
+
const codebaseLines = project?.repositoryUrl
|
|
89
|
+
? [
|
|
90
|
+
`Repository: ${project.repositoryUrl}`,
|
|
91
|
+
`Default branch: ${defaultBranch}`,
|
|
92
|
+
project.localPath ? `Local checkout path: ${project.localPath}` : null,
|
|
93
|
+
`If you modify code, run verification, then commit and push to ${defaultBranch} before complete_task.`
|
|
94
|
+
].filter(Boolean)
|
|
95
|
+
: ["This project has no repository URL, so treat it as non-code work unless list_my_tasks says otherwise."];
|
|
96
|
+
|
|
82
97
|
return [
|
|
83
98
|
`You are ${agentName}. MeAndMyAgents has assigned work in ${projectName}.`,
|
|
84
99
|
`Wake event: ${eventId}. First card that woke this session: ${cardId}.`,
|
|
100
|
+
"This is an autonomous runner wake-up. Do not wait for a human answer.",
|
|
101
|
+
"If you are blocked, add a card comment explaining the blocker and stop; do not sit idle asking a question.",
|
|
85
102
|
"Use the MeAndMyAgents MCP server now.",
|
|
86
103
|
"Call whoami to confirm your identity and project access.",
|
|
104
|
+
"Follow these workflow rules from MeAndMyAgents:",
|
|
105
|
+
...workflowInstructions.map((instruction) => `- ${instruction}`),
|
|
106
|
+
"Codebase context:",
|
|
107
|
+
...codebaseLines.map((line) => `- ${line}`),
|
|
87
108
|
"Call list_my_tasks, then start_task on the next actionable card before editing files.",
|
|
88
109
|
"Work only in the task codebase.localPath and only when codebase.canModifyCode is true.",
|
|
89
110
|
"Add comments with useful progress and completion summaries.",
|
|
90
|
-
"Call complete_task when a task is ready for human testing.",
|
|
111
|
+
"Call complete_task with a useful summary when a task is ready for human testing.",
|
|
91
112
|
"Call list_my_tasks again after each completion.",
|
|
92
113
|
"Keep taking the next task until no actionable tasks remain, then stop."
|
|
93
114
|
].join("\n");
|
|
@@ -107,7 +128,7 @@ export function buildLaunchCommand({
|
|
|
107
128
|
|
|
108
129
|
return {
|
|
109
130
|
command: launcherCommand || launcher,
|
|
110
|
-
args:
|
|
131
|
+
args: buildLauncherArgs({ launcher, prompt, cwd }),
|
|
111
132
|
cwd,
|
|
112
133
|
env: {
|
|
113
134
|
MAA_API_KEY: apiKey,
|
|
@@ -116,6 +137,26 @@ export function buildLaunchCommand({
|
|
|
116
137
|
};
|
|
117
138
|
}
|
|
118
139
|
|
|
140
|
+
function buildLauncherArgs({ launcher, prompt, cwd }) {
|
|
141
|
+
if (launcher === "codex") {
|
|
142
|
+
return [
|
|
143
|
+
"--ask-for-approval",
|
|
144
|
+
"never",
|
|
145
|
+
"--sandbox",
|
|
146
|
+
"danger-full-access",
|
|
147
|
+
"--cd",
|
|
148
|
+
cwd,
|
|
149
|
+
prompt
|
|
150
|
+
];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (launcher === "claude") {
|
|
154
|
+
return ["--permission-mode", "bypassPermissions", prompt];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return [prompt];
|
|
158
|
+
}
|
|
159
|
+
|
|
119
160
|
export async function runCli(argv = process.argv.slice(2)) {
|
|
120
161
|
const options = parseRunnerArgs(argv);
|
|
121
162
|
|
|
@@ -187,7 +228,9 @@ async function launchEvent(options, event) {
|
|
|
187
228
|
agentName: event.agent?.name ?? options.launcher,
|
|
188
229
|
cardId: event.card?.id ?? "unknown-card",
|
|
189
230
|
eventId: event.id,
|
|
190
|
-
|
|
231
|
+
project: event.project,
|
|
232
|
+
projectName: event.project?.name ?? "this project",
|
|
233
|
+
workflow: event.workflow
|
|
191
234
|
});
|
|
192
235
|
const launch = buildLaunchCommand({
|
|
193
236
|
launcher: options.launcher,
|