@opentag/runner 0.1.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/README.md +56 -0
- package/dist/codex.d.ts +9 -0
- package/dist/codex.d.ts.map +1 -0
- package/dist/command.d.ts +14 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/echo.d.ts +3 -0
- package/dist/echo.d.ts.map +1 -0
- package/dist/executor.d.ts +27 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/git.d.ts +29 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +241 -0
- package/dist/index.js.map +1 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# @opentag/runner
|
|
2
|
+
|
|
3
|
+
Executor contracts and built-in runner adapters for OpenTag.
|
|
4
|
+
|
|
5
|
+
Use this package when building a local daemon, hosted runner, or custom executor that consumes OpenTag runs.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @opentag/runner
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Exports
|
|
14
|
+
|
|
15
|
+
- `ExecutorAdapter`: interface every executor implements.
|
|
16
|
+
- `createEchoExecutor`: smoke-test executor that echoes the normalized command.
|
|
17
|
+
- `createCodexExecutor`: executor that runs `codex exec` in a mapped local checkout.
|
|
18
|
+
- Git helpers such as `createRunBranch`, `changedFiles`, and `branchNameForRun`.
|
|
19
|
+
- Command helpers such as `nodeCommandRunner` and `assertCommandSucceeded`.
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import type { ExecutorAdapter } from "@opentag/runner";
|
|
25
|
+
|
|
26
|
+
export const executor: ExecutorAdapter = {
|
|
27
|
+
id: "my-agent",
|
|
28
|
+
displayName: "My Agent",
|
|
29
|
+
async canRun() {
|
|
30
|
+
return { ready: true };
|
|
31
|
+
},
|
|
32
|
+
async run(input, sink) {
|
|
33
|
+
await sink.emit({
|
|
34
|
+
type: "executor.started",
|
|
35
|
+
message: `Running ${input.command.rawText}`,
|
|
36
|
+
at: new Date().toISOString()
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
conclusion: "success",
|
|
41
|
+
summary: "Handled by my-agent"
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
async cancel() {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Safety Notes
|
|
51
|
+
|
|
52
|
+
`createCodexExecutor` refuses to run when the target checkout has uncommitted changes. It creates an isolated `opentag/<runId>` branch before running Codex.
|
|
53
|
+
|
|
54
|
+
## Stability
|
|
55
|
+
|
|
56
|
+
`ExecutorAdapter` is public API. Add optional fields rather than changing required method signatures.
|
package/dist/codex.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CommandRunner } from "./command.js";
|
|
2
|
+
import type { ExecutorAdapter } from "./executor.js";
|
|
3
|
+
export type CodexExecutorOptions = {
|
|
4
|
+
runner?: CommandRunner;
|
|
5
|
+
codexCommand?: string;
|
|
6
|
+
model?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function createCodexExecutor(options?: CodexExecutorOptions): ExecutorAdapter;
|
|
9
|
+
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../src/codex.ts"],"names":[],"mappings":"AACA,OAAO,EAA6C,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA0BF,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB,GAAG,eAAe,CA2FvF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type CommandResult = {
|
|
2
|
+
exitCode: number;
|
|
3
|
+
stdout: string;
|
|
4
|
+
stderr: string;
|
|
5
|
+
};
|
|
6
|
+
export type CommandRunner = {
|
|
7
|
+
run(command: string, args: string[], options?: {
|
|
8
|
+
cwd?: string;
|
|
9
|
+
input?: string;
|
|
10
|
+
}): Promise<CommandResult>;
|
|
11
|
+
};
|
|
12
|
+
export declare const nodeCommandRunner: CommandRunner;
|
|
13
|
+
export declare function assertCommandSucceeded(result: CommandResult, label: string): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC1G,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,aA2B/B,CAAC;AAEF,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIhG"}
|
package/dist/echo.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echo.d.ts","sourceRoot":"","sources":["../src/echo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMrD,wBAAgB,kBAAkB,IAAI,eAAe,CAkCpD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ContextPointer, OpenTagCommand, OpenTagRunResult } from "@opentag/core";
|
|
2
|
+
export type ExecutorEvent = {
|
|
3
|
+
type: "executor.started" | "executor.progress" | "executor.completed" | "executor.failed";
|
|
4
|
+
message: string;
|
|
5
|
+
at: string;
|
|
6
|
+
};
|
|
7
|
+
export type ExecutorEventSink = {
|
|
8
|
+
emit(event: ExecutorEvent): Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
export type ExecutorRunInput = {
|
|
11
|
+
runId: string;
|
|
12
|
+
workspacePath: string;
|
|
13
|
+
command: OpenTagCommand;
|
|
14
|
+
context: ContextPointer[];
|
|
15
|
+
};
|
|
16
|
+
export type ExecutorReadiness = {
|
|
17
|
+
ready: boolean;
|
|
18
|
+
reason?: string;
|
|
19
|
+
};
|
|
20
|
+
export type ExecutorAdapter = {
|
|
21
|
+
id: string;
|
|
22
|
+
displayName: string;
|
|
23
|
+
canRun(input: ExecutorRunInput): Promise<ExecutorReadiness>;
|
|
24
|
+
run(input: ExecutorRunInput, sink: ExecutorEventSink): Promise<OpenTagRunResult>;
|
|
25
|
+
cancel(runId: string): Promise<void>;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,kBAAkB,GAAG,mBAAmB,GAAG,oBAAoB,GAAG,iBAAiB,CAAC;IAC1F,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC5D,GAAG,CAAC,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACjF,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC,CAAC"}
|
package/dist/git.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CommandRunner } from "./command.js";
|
|
2
|
+
export type GitStatusEntry = {
|
|
3
|
+
status: string;
|
|
4
|
+
path: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function branchNameForRun(runId: string): string;
|
|
7
|
+
export declare function parseStatusEntries(statusOutput: string): GitStatusEntry[];
|
|
8
|
+
export declare function isInternalArtifactPath(path: string): boolean;
|
|
9
|
+
export declare function parseChangedFiles(statusOutput: string): string[];
|
|
10
|
+
export declare function createRunBranch(input: {
|
|
11
|
+
runner: CommandRunner;
|
|
12
|
+
workspacePath: string;
|
|
13
|
+
branchName: string;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
export declare function changedFiles(input: {
|
|
16
|
+
runner: CommandRunner;
|
|
17
|
+
workspacePath: string;
|
|
18
|
+
}): Promise<string[]>;
|
|
19
|
+
export declare function cleanupInternalArtifacts(input: {
|
|
20
|
+
runner: CommandRunner;
|
|
21
|
+
workspacePath: string;
|
|
22
|
+
}): Promise<string[]>;
|
|
23
|
+
export declare function pushBranch(input: {
|
|
24
|
+
runner: CommandRunner;
|
|
25
|
+
workspacePath: string;
|
|
26
|
+
remote: string;
|
|
27
|
+
branchName: string;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAIF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc,EAAE,CAUzE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAIhE;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE;IAC3C,MAAM,EAAE,aAAa,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhB;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAI7G;AAED,wBAAsB,wBAAwB,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBzH;AAED,wBAAsB,UAAU,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,aAAa,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// src/command.ts
|
|
2
|
+
import { spawn } from "child_process";
|
|
3
|
+
var nodeCommandRunner = {
|
|
4
|
+
run(command, args, options = {}) {
|
|
5
|
+
return new Promise((resolve, reject) => {
|
|
6
|
+
const child = spawn(command, args, {
|
|
7
|
+
cwd: options.cwd,
|
|
8
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
9
|
+
});
|
|
10
|
+
const stdout = [];
|
|
11
|
+
const stderr = [];
|
|
12
|
+
child.stdout.on("data", (chunk) => stdout.push(chunk));
|
|
13
|
+
child.stderr.on("data", (chunk) => stderr.push(chunk));
|
|
14
|
+
child.on("error", reject);
|
|
15
|
+
child.on("close", (exitCode) => {
|
|
16
|
+
resolve({
|
|
17
|
+
exitCode: exitCode ?? 1,
|
|
18
|
+
stdout: Buffer.concat(stdout).toString("utf8"),
|
|
19
|
+
stderr: Buffer.concat(stderr).toString("utf8")
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
if (options.input) {
|
|
23
|
+
child.stdin.write(options.input);
|
|
24
|
+
}
|
|
25
|
+
child.stdin.end();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
async function assertCommandSucceeded(result, label) {
|
|
30
|
+
if (result.exitCode !== 0) {
|
|
31
|
+
throw new Error(`${label} failed with exit code ${result.exitCode}: ${result.stderr || result.stdout}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// src/git.ts
|
|
36
|
+
var INTERNAL_ARTIFACT_ROOTS = [".omx", ".codex", ".claude"];
|
|
37
|
+
function branchNameForRun(runId) {
|
|
38
|
+
const safeRunId = runId.replace(/[^a-zA-Z0-9._-]/g, "-");
|
|
39
|
+
return `opentag/${safeRunId}`;
|
|
40
|
+
}
|
|
41
|
+
function parseStatusEntries(statusOutput) {
|
|
42
|
+
return statusOutput.split("\n").map((line) => line.replace(/\r$/, "")).filter(Boolean).map((line) => ({
|
|
43
|
+
status: line.slice(0, 2),
|
|
44
|
+
path: line.slice(3).trim()
|
|
45
|
+
})).filter((entry) => entry.path.length > 0);
|
|
46
|
+
}
|
|
47
|
+
function isInternalArtifactPath(path) {
|
|
48
|
+
return INTERNAL_ARTIFACT_ROOTS.some((root) => path === root || path.startsWith(`${root}/`));
|
|
49
|
+
}
|
|
50
|
+
function parseChangedFiles(statusOutput) {
|
|
51
|
+
return parseStatusEntries(statusOutput).map((entry) => entry.path).filter((path) => !isInternalArtifactPath(path));
|
|
52
|
+
}
|
|
53
|
+
async function createRunBranch(input) {
|
|
54
|
+
const result = await input.runner.run("git", ["checkout", "-B", input.branchName], { cwd: input.workspacePath });
|
|
55
|
+
await assertCommandSucceeded(result, "create run branch");
|
|
56
|
+
}
|
|
57
|
+
async function changedFiles(input) {
|
|
58
|
+
const result = await input.runner.run("git", ["status", "--porcelain"], { cwd: input.workspacePath });
|
|
59
|
+
await assertCommandSucceeded(result, "read changed files");
|
|
60
|
+
return parseChangedFiles(result.stdout);
|
|
61
|
+
}
|
|
62
|
+
async function cleanupInternalArtifacts(input) {
|
|
63
|
+
const statusResult = await input.runner.run("git", ["status", "--porcelain"], { cwd: input.workspacePath });
|
|
64
|
+
await assertCommandSucceeded(statusResult, "scan internal artifacts");
|
|
65
|
+
const untrackedRoots = Array.from(
|
|
66
|
+
new Set(
|
|
67
|
+
parseStatusEntries(statusResult.stdout).filter((entry) => entry.status === "??" && isInternalArtifactPath(entry.path)).map((entry) => entry.path.split("/", 1)[0] ?? entry.path)
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
if (untrackedRoots.length === 0) return [];
|
|
71
|
+
const cleanResult = await input.runner.run("git", ["clean", "-fd", "--", ...untrackedRoots], {
|
|
72
|
+
cwd: input.workspacePath
|
|
73
|
+
});
|
|
74
|
+
await assertCommandSucceeded(cleanResult, "clean internal artifacts");
|
|
75
|
+
return untrackedRoots;
|
|
76
|
+
}
|
|
77
|
+
async function pushBranch(input) {
|
|
78
|
+
const result = await input.runner.run("git", ["push", "-u", input.remote, input.branchName], { cwd: input.workspacePath });
|
|
79
|
+
await assertCommandSucceeded(result, "push run branch");
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// src/codex.ts
|
|
83
|
+
function contextLines(context) {
|
|
84
|
+
if (!context.length) return "No additional context pointers were provided.";
|
|
85
|
+
return context.map((pointer) => `- ${pointer.kind}: ${pointer.uri}`).join("\n");
|
|
86
|
+
}
|
|
87
|
+
function buildPrompt(input) {
|
|
88
|
+
return [
|
|
89
|
+
"You are executing an OpenTag run in a local checkout.",
|
|
90
|
+
`Run ID: ${input.runId}`,
|
|
91
|
+
"",
|
|
92
|
+
"User request:",
|
|
93
|
+
input.rawText,
|
|
94
|
+
"",
|
|
95
|
+
"Context pointers:",
|
|
96
|
+
contextLines(input.context),
|
|
97
|
+
"",
|
|
98
|
+
"Work autonomously but keep the change narrow. Run relevant verification if you modify files. End with a concise summary."
|
|
99
|
+
].join("\n");
|
|
100
|
+
}
|
|
101
|
+
function createCodexExecutor(options = {}) {
|
|
102
|
+
const runner = options.runner ?? nodeCommandRunner;
|
|
103
|
+
const codexCommand = options.codexCommand ?? "codex";
|
|
104
|
+
return {
|
|
105
|
+
id: "codex",
|
|
106
|
+
displayName: "Codex Executor",
|
|
107
|
+
async canRun(input) {
|
|
108
|
+
const codexVersion = await runner.run(codexCommand, ["--version"], { cwd: input.workspacePath });
|
|
109
|
+
if (codexVersion.exitCode !== 0) {
|
|
110
|
+
return { ready: false, reason: `Codex CLI is not available: ${codexVersion.stderr || codexVersion.stdout}` };
|
|
111
|
+
}
|
|
112
|
+
const gitStatus = await runner.run("git", ["status", "--porcelain"], { cwd: input.workspacePath });
|
|
113
|
+
if (gitStatus.exitCode !== 0) {
|
|
114
|
+
return { ready: false, reason: `Workspace is not a git checkout: ${gitStatus.stderr || gitStatus.stdout}` };
|
|
115
|
+
}
|
|
116
|
+
if (gitStatus.stdout.trim().length > 0) {
|
|
117
|
+
return { ready: false, reason: "Workspace has uncommitted changes; refusing to run Codex executor." };
|
|
118
|
+
}
|
|
119
|
+
return { ready: true };
|
|
120
|
+
},
|
|
121
|
+
async run(input, sink) {
|
|
122
|
+
const branchName = branchNameForRun(input.runId);
|
|
123
|
+
await sink.emit({
|
|
124
|
+
type: "executor.started",
|
|
125
|
+
message: `Creating isolated branch ${branchName}`,
|
|
126
|
+
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
127
|
+
});
|
|
128
|
+
await createRunBranch({ runner, workspacePath: input.workspacePath, branchName });
|
|
129
|
+
await sink.emit({
|
|
130
|
+
type: "executor.progress",
|
|
131
|
+
message: "Starting codex exec",
|
|
132
|
+
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
133
|
+
});
|
|
134
|
+
const args = [
|
|
135
|
+
"exec",
|
|
136
|
+
"--cd",
|
|
137
|
+
input.workspacePath,
|
|
138
|
+
"--full-auto",
|
|
139
|
+
"--ephemeral",
|
|
140
|
+
...options.model ? ["--model", options.model] : [],
|
|
141
|
+
"-"
|
|
142
|
+
];
|
|
143
|
+
const codexResult = await runner.run(codexCommand, args, {
|
|
144
|
+
cwd: input.workspacePath,
|
|
145
|
+
input: buildPrompt({
|
|
146
|
+
runId: input.runId,
|
|
147
|
+
rawText: input.command.rawText,
|
|
148
|
+
context: input.context
|
|
149
|
+
})
|
|
150
|
+
});
|
|
151
|
+
await assertCommandSucceeded(codexResult, "codex exec");
|
|
152
|
+
const cleanedArtifacts = await cleanupInternalArtifacts({ runner, workspacePath: input.workspacePath });
|
|
153
|
+
if (cleanedArtifacts.length > 0) {
|
|
154
|
+
await sink.emit({
|
|
155
|
+
type: "executor.progress",
|
|
156
|
+
message: `Cleaned internal artifacts: ${cleanedArtifacts.join(", ")}`,
|
|
157
|
+
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
const files = await changedFiles({ runner, workspacePath: input.workspacePath });
|
|
161
|
+
await sink.emit({
|
|
162
|
+
type: "executor.completed",
|
|
163
|
+
message: `Codex executor completed with ${files.length} changed file(s)`,
|
|
164
|
+
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
165
|
+
});
|
|
166
|
+
const output = codexResult.stdout.trim() || codexResult.stderr.trim() || "Codex completed without textual output.";
|
|
167
|
+
return {
|
|
168
|
+
conclusion: "success",
|
|
169
|
+
summary: output.slice(-4e3),
|
|
170
|
+
changedFiles: files,
|
|
171
|
+
artifacts: [{ title: "Run branch", uri: branchName }],
|
|
172
|
+
verification: [
|
|
173
|
+
{
|
|
174
|
+
command: "codex exec",
|
|
175
|
+
outcome: "passed",
|
|
176
|
+
excerpt: output.slice(-1e3)
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
nextAction: files.length > 0 ? "Review the local branch and create a pull request." : "No file changes were detected."
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
async cancel() {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// src/echo.ts
|
|
189
|
+
function nowIso() {
|
|
190
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
191
|
+
}
|
|
192
|
+
function createEchoExecutor() {
|
|
193
|
+
return {
|
|
194
|
+
id: "echo",
|
|
195
|
+
displayName: "Echo Executor",
|
|
196
|
+
async canRun() {
|
|
197
|
+
return { ready: true };
|
|
198
|
+
},
|
|
199
|
+
async run(input, sink) {
|
|
200
|
+
await sink.emit({
|
|
201
|
+
type: "executor.started",
|
|
202
|
+
message: `Echo executor started for ${input.runId}`,
|
|
203
|
+
at: nowIso()
|
|
204
|
+
});
|
|
205
|
+
await sink.emit({
|
|
206
|
+
type: "executor.completed",
|
|
207
|
+
message: `Echo executor completed for ${input.runId}`,
|
|
208
|
+
at: nowIso()
|
|
209
|
+
});
|
|
210
|
+
return {
|
|
211
|
+
conclusion: "success",
|
|
212
|
+
summary: `Echoed OpenTag command: ${input.command.rawText}`,
|
|
213
|
+
verification: [
|
|
214
|
+
{
|
|
215
|
+
command: "echo",
|
|
216
|
+
outcome: "passed",
|
|
217
|
+
excerpt: input.command.rawText
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
};
|
|
221
|
+
},
|
|
222
|
+
async cancel() {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
export {
|
|
228
|
+
assertCommandSucceeded,
|
|
229
|
+
branchNameForRun,
|
|
230
|
+
changedFiles,
|
|
231
|
+
cleanupInternalArtifacts,
|
|
232
|
+
createCodexExecutor,
|
|
233
|
+
createEchoExecutor,
|
|
234
|
+
createRunBranch,
|
|
235
|
+
isInternalArtifactPath,
|
|
236
|
+
nodeCommandRunner,
|
|
237
|
+
parseChangedFiles,
|
|
238
|
+
parseStatusEntries,
|
|
239
|
+
pushBranch
|
|
240
|
+
};
|
|
241
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/command.ts","../src/git.ts","../src/codex.ts","../src/echo.ts"],"sourcesContent":["import { spawn } from \"node:child_process\";\n\nexport type CommandResult = {\n exitCode: number;\n stdout: string;\n stderr: string;\n};\n\nexport type CommandRunner = {\n run(command: string, args: string[], options?: { cwd?: string; input?: string }): Promise<CommandResult>;\n};\n\nexport const nodeCommandRunner: CommandRunner = {\n run(command, args, options = {}) {\n return new Promise((resolve, reject) => {\n const child = spawn(command, args, {\n cwd: options.cwd,\n stdio: [\"pipe\", \"pipe\", \"pipe\"]\n });\n const stdout: Buffer[] = [];\n const stderr: Buffer[] = [];\n\n child.stdout.on(\"data\", (chunk: Buffer) => stdout.push(chunk));\n child.stderr.on(\"data\", (chunk: Buffer) => stderr.push(chunk));\n child.on(\"error\", reject);\n child.on(\"close\", (exitCode) => {\n resolve({\n exitCode: exitCode ?? 1,\n stdout: Buffer.concat(stdout).toString(\"utf8\"),\n stderr: Buffer.concat(stderr).toString(\"utf8\")\n });\n });\n\n if (options.input) {\n child.stdin.write(options.input);\n }\n child.stdin.end();\n });\n }\n};\n\nexport async function assertCommandSucceeded(result: CommandResult, label: string): Promise<void> {\n if (result.exitCode !== 0) {\n throw new Error(`${label} failed with exit code ${result.exitCode}: ${result.stderr || result.stdout}`);\n }\n}\n","import type { CommandRunner } from \"./command.js\";\nimport { assertCommandSucceeded } from \"./command.js\";\n\nexport type GitStatusEntry = {\n status: string;\n path: string;\n};\n\nconst INTERNAL_ARTIFACT_ROOTS = [\".omx\", \".codex\", \".claude\"];\n\nexport function branchNameForRun(runId: string): string {\n const safeRunId = runId.replace(/[^a-zA-Z0-9._-]/g, \"-\");\n return `opentag/${safeRunId}`;\n}\n\nexport function parseStatusEntries(statusOutput: string): GitStatusEntry[] {\n return statusOutput\n .split(\"\\n\")\n .map((line) => line.replace(/\\r$/, \"\"))\n .filter(Boolean)\n .map((line) => ({\n status: line.slice(0, 2),\n path: line.slice(3).trim()\n }))\n .filter((entry) => entry.path.length > 0);\n}\n\nexport function isInternalArtifactPath(path: string): boolean {\n return INTERNAL_ARTIFACT_ROOTS.some((root) => path === root || path.startsWith(`${root}/`));\n}\n\nexport function parseChangedFiles(statusOutput: string): string[] {\n return parseStatusEntries(statusOutput)\n .map((entry) => entry.path)\n .filter((path) => !isInternalArtifactPath(path));\n}\n\nexport async function createRunBranch(input: {\n runner: CommandRunner;\n workspacePath: string;\n branchName: string;\n}): Promise<void> {\n const result = await input.runner.run(\"git\", [\"checkout\", \"-B\", input.branchName], { cwd: input.workspacePath });\n await assertCommandSucceeded(result, \"create run branch\");\n}\n\nexport async function changedFiles(input: { runner: CommandRunner; workspacePath: string }): Promise<string[]> {\n const result = await input.runner.run(\"git\", [\"status\", \"--porcelain\"], { cwd: input.workspacePath });\n await assertCommandSucceeded(result, \"read changed files\");\n return parseChangedFiles(result.stdout);\n}\n\nexport async function cleanupInternalArtifacts(input: { runner: CommandRunner; workspacePath: string }): Promise<string[]> {\n const statusResult = await input.runner.run(\"git\", [\"status\", \"--porcelain\"], { cwd: input.workspacePath });\n await assertCommandSucceeded(statusResult, \"scan internal artifacts\");\n const untrackedRoots = Array.from(\n new Set(\n parseStatusEntries(statusResult.stdout)\n .filter((entry) => entry.status === \"??\" && isInternalArtifactPath(entry.path))\n .map((entry) => entry.path.split(\"/\", 1)[0] ?? entry.path)\n )\n );\n if (untrackedRoots.length === 0) return [];\n\n const cleanResult = await input.runner.run(\"git\", [\"clean\", \"-fd\", \"--\", ...untrackedRoots], {\n cwd: input.workspacePath\n });\n await assertCommandSucceeded(cleanResult, \"clean internal artifacts\");\n return untrackedRoots;\n}\n\nexport async function pushBranch(input: {\n runner: CommandRunner;\n workspacePath: string;\n remote: string;\n branchName: string;\n}): Promise<void> {\n const result = await input.runner.run(\"git\", [\"push\", \"-u\", input.remote, input.branchName], { cwd: input.workspacePath });\n await assertCommandSucceeded(result, \"push run branch\");\n}\n","import type { ContextPointer } from \"@opentag/core\";\nimport { assertCommandSucceeded, nodeCommandRunner, type CommandRunner } from \"./command.js\";\nimport type { ExecutorAdapter } from \"./executor.js\";\nimport { branchNameForRun, changedFiles, cleanupInternalArtifacts, createRunBranch } from \"./git.js\";\n\nexport type CodexExecutorOptions = {\n runner?: CommandRunner;\n codexCommand?: string;\n model?: string;\n};\n\nfunction contextLines(context: ContextPointer[]): string {\n if (!context.length) return \"No additional context pointers were provided.\";\n return context.map((pointer) => `- ${pointer.kind}: ${pointer.uri}`).join(\"\\n\");\n}\n\nfunction buildPrompt(input: {\n runId: string;\n rawText: string;\n context: ContextPointer[];\n}): string {\n return [\n \"You are executing an OpenTag run in a local checkout.\",\n `Run ID: ${input.runId}`,\n \"\",\n \"User request:\",\n input.rawText,\n \"\",\n \"Context pointers:\",\n contextLines(input.context),\n \"\",\n \"Work autonomously but keep the change narrow. Run relevant verification if you modify files. End with a concise summary.\"\n ].join(\"\\n\");\n}\n\nexport function createCodexExecutor(options: CodexExecutorOptions = {}): ExecutorAdapter {\n const runner = options.runner ?? nodeCommandRunner;\n const codexCommand = options.codexCommand ?? \"codex\";\n\n return {\n id: \"codex\",\n displayName: \"Codex Executor\",\n async canRun(input) {\n const codexVersion = await runner.run(codexCommand, [\"--version\"], { cwd: input.workspacePath });\n if (codexVersion.exitCode !== 0) {\n return { ready: false, reason: `Codex CLI is not available: ${codexVersion.stderr || codexVersion.stdout}` };\n }\n const gitStatus = await runner.run(\"git\", [\"status\", \"--porcelain\"], { cwd: input.workspacePath });\n if (gitStatus.exitCode !== 0) {\n return { ready: false, reason: `Workspace is not a git checkout: ${gitStatus.stderr || gitStatus.stdout}` };\n }\n if (gitStatus.stdout.trim().length > 0) {\n return { ready: false, reason: \"Workspace has uncommitted changes; refusing to run Codex executor.\" };\n }\n return { ready: true };\n },\n async run(input, sink) {\n const branchName = branchNameForRun(input.runId);\n await sink.emit({\n type: \"executor.started\",\n message: `Creating isolated branch ${branchName}`,\n at: new Date().toISOString()\n });\n await createRunBranch({ runner, workspacePath: input.workspacePath, branchName });\n\n await sink.emit({\n type: \"executor.progress\",\n message: \"Starting codex exec\",\n at: new Date().toISOString()\n });\n\n const args = [\n \"exec\",\n \"--cd\",\n input.workspacePath,\n \"--full-auto\",\n \"--ephemeral\",\n ...(options.model ? [\"--model\", options.model] : []),\n \"-\"\n ];\n const codexResult = await runner.run(codexCommand, args, {\n cwd: input.workspacePath,\n input: buildPrompt({\n runId: input.runId,\n rawText: input.command.rawText,\n context: input.context\n })\n });\n await assertCommandSucceeded(codexResult, \"codex exec\");\n\n const cleanedArtifacts = await cleanupInternalArtifacts({ runner, workspacePath: input.workspacePath });\n if (cleanedArtifacts.length > 0) {\n await sink.emit({\n type: \"executor.progress\",\n message: `Cleaned internal artifacts: ${cleanedArtifacts.join(\", \")}`,\n at: new Date().toISOString()\n });\n }\n\n const files = await changedFiles({ runner, workspacePath: input.workspacePath });\n await sink.emit({\n type: \"executor.completed\",\n message: `Codex executor completed with ${files.length} changed file(s)`,\n at: new Date().toISOString()\n });\n\n const output = codexResult.stdout.trim() || codexResult.stderr.trim() || \"Codex completed without textual output.\";\n return {\n conclusion: \"success\",\n summary: output.slice(-4000),\n changedFiles: files,\n artifacts: [{ title: \"Run branch\", uri: branchName }],\n verification: [\n {\n command: \"codex exec\",\n outcome: \"passed\",\n excerpt: output.slice(-1000)\n }\n ],\n nextAction: files.length > 0 ? \"Review the local branch and create a pull request.\" : \"No file changes were detected.\"\n };\n },\n async cancel() {\n return;\n }\n };\n}\n","import type { ExecutorAdapter } from \"./executor.js\";\n\nfunction nowIso(): string {\n return new Date().toISOString();\n}\n\nexport function createEchoExecutor(): ExecutorAdapter {\n return {\n id: \"echo\",\n displayName: \"Echo Executor\",\n async canRun() {\n return { ready: true };\n },\n async run(input, sink) {\n await sink.emit({\n type: \"executor.started\",\n message: `Echo executor started for ${input.runId}`,\n at: nowIso()\n });\n await sink.emit({\n type: \"executor.completed\",\n message: `Echo executor completed for ${input.runId}`,\n at: nowIso()\n });\n return {\n conclusion: \"success\",\n summary: `Echoed OpenTag command: ${input.command.rawText}`,\n verification: [\n {\n command: \"echo\",\n outcome: \"passed\",\n excerpt: input.command.rawText\n }\n ]\n };\n },\n async cancel() {\n return;\n }\n };\n}\n"],"mappings":";AAAA,SAAS,aAAa;AAYf,IAAM,oBAAmC;AAAA,EAC9C,IAAI,SAAS,MAAM,UAAU,CAAC,GAAG;AAC/B,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,YAAM,QAAQ,MAAM,SAAS,MAAM;AAAA,QACjC,KAAK,QAAQ;AAAA,QACb,OAAO,CAAC,QAAQ,QAAQ,MAAM;AAAA,MAChC,CAAC;AACD,YAAM,SAAmB,CAAC;AAC1B,YAAM,SAAmB,CAAC;AAE1B,YAAM,OAAO,GAAG,QAAQ,CAAC,UAAkB,OAAO,KAAK,KAAK,CAAC;AAC7D,YAAM,OAAO,GAAG,QAAQ,CAAC,UAAkB,OAAO,KAAK,KAAK,CAAC;AAC7D,YAAM,GAAG,SAAS,MAAM;AACxB,YAAM,GAAG,SAAS,CAAC,aAAa;AAC9B,gBAAQ;AAAA,UACN,UAAU,YAAY;AAAA,UACtB,QAAQ,OAAO,OAAO,MAAM,EAAE,SAAS,MAAM;AAAA,UAC7C,QAAQ,OAAO,OAAO,MAAM,EAAE,SAAS,MAAM;AAAA,QAC/C,CAAC;AAAA,MACH,CAAC;AAED,UAAI,QAAQ,OAAO;AACjB,cAAM,MAAM,MAAM,QAAQ,KAAK;AAAA,MACjC;AACA,YAAM,MAAM,IAAI;AAAA,IAClB,CAAC;AAAA,EACH;AACF;AAEA,eAAsB,uBAAuB,QAAuB,OAA8B;AAChG,MAAI,OAAO,aAAa,GAAG;AACzB,UAAM,IAAI,MAAM,GAAG,KAAK,0BAA0B,OAAO,QAAQ,KAAK,OAAO,UAAU,OAAO,MAAM,EAAE;AAAA,EACxG;AACF;;;ACrCA,IAAM,0BAA0B,CAAC,QAAQ,UAAU,SAAS;AAErD,SAAS,iBAAiB,O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AAAA,IACb,MAAM,SAAS;AACb,aAAO,EAAE,OAAO,KAAK;AAAA,IACvB;AAAA,IACA,MAAM,IAAI,OAAO,MAAM;AACrB,YAAM,KAAK,KAAK;AAAA,QACd,MAAM;AAAA,QACN,SAAS,6BAA6B,MAAM,KAAK;AAAA,QACjD,IAAI,OAAO;AAAA,MACb,CAAC;AACD,YAAM,KAAK,KAAK;AAAA,QACd,MAAM;AAAA,QACN,SAAS,+BAA+B,MAAM,KAAK;AAAA,QACnD,IAAI,OAAO;AAAA,MACb,CAAC;AACD,aAAO;AAAA,QACL,YAAY;AAAA,QACZ,SAAS,2BAA2B,MAAM,QAAQ,OAAO;AAAA,QACzD,cAAc;AAAA,UACZ;AAAA,YACE,SAAS;AAAA,YACT,SAAS;AAAA,YACT,SAAS,MAAM,QAAQ;AAAA,UACzB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,MAAM,SAAS;AACb;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opentag/runner",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Executor contracts and built-in runner adapters for OpenTag.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"development": "./src/index.ts",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"opentag",
|
|
24
|
+
"runner",
|
|
25
|
+
"executor",
|
|
26
|
+
"codex",
|
|
27
|
+
"agents"
|
|
28
|
+
],
|
|
29
|
+
"license": "Apache-2.0",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@opentag/core": "0.1.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"tsup": "^8.3.5",
|
|
35
|
+
"typescript": "^5.7.2"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsup && tsc -b tsconfig.json --emitDeclarationOnly --force",
|
|
39
|
+
"lint": "tsc --noEmit"
|
|
40
|
+
}
|
|
41
|
+
}
|