@the-vibe-company/armada 0.2.73 → 2.0.1
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 +7 -767
- package/bin/armada.cjs +46 -0
- package/package.json +23 -27
- package/dist/armada.js +0 -85419
- package/dist/plugin-fixtures/README.md +0 -60
- package/dist/plugin-fixtures/forge/response.json +0 -149
- package/dist/plugin-fixtures/model/response.json +0 -50
- package/dist/plugin-fixtures/node/host.mjs +0 -79
- package/dist/plugin-fixtures/node/workspace.json +0 -5
- package/dist/plugin-fixtures/runtime/worker.mjs +0 -13
- package/dist/plugin-fixtures/tracker/response.json +0 -415
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Plugin conformance fixtures
|
|
2
|
-
|
|
3
|
-
These synthetic recordings exercise the public plugin API without provider
|
|
4
|
-
credentials or remote services. `armada plugin test <directory>` serves them
|
|
5
|
-
on a temporary loopback HTTP endpoint, supplied through the plugin directory's
|
|
6
|
-
optional `armada-plugin.test.json`. That file contains a `PluginConfig` object;
|
|
7
|
-
`${endpoint}` expands to the loopback base URL and `${directory}` expands to
|
|
8
|
-
the temporary owned sandbox. For example:
|
|
9
|
-
|
|
10
|
-
```json
|
|
11
|
-
{
|
|
12
|
-
"tracker": { "example": { "endpoint": "${endpoint}/tracker" } },
|
|
13
|
-
"forge": { "example": { "endpoint": "${endpoint}/forge" } },
|
|
14
|
-
"model": { "example": { "endpoint": "${endpoint}/model" } },
|
|
15
|
-
"node": { "example": { "workspaceRoot": "${directory}" } }
|
|
16
|
-
}
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Each `<seam>/response.json` has a `response` served as JSON. Tracker and forge
|
|
20
|
-
recordings also define `expectedEvents`, compared with events appended by the
|
|
21
|
-
provider during its `read({ project: "plugin-conformance" })` call. Additional
|
|
22
|
-
payload fields are allowed. Tracker rows include one ticket and one report
|
|
23
|
-
comment. Forge rows include a pull request with a successful `verify` check.
|
|
24
|
-
A plugin adapter maps these provider-neutral rows to Armada event payloads;
|
|
25
|
-
these recordings do not imitate any vendor's API.
|
|
26
|
-
|
|
27
|
-
- A read at `/tracker` returns `tracker/response.json`'s `response`. The read must
|
|
28
|
-
append its recorded `ticket.seen` and `ticket.report-posted` events.
|
|
29
|
-
- Tracker writes use POST, PUT, or PATCH below `/tracker`. The request body
|
|
30
|
-
must contain the unique comment passed to `write`.
|
|
31
|
-
- A read at `/forge` returns `forge/response.json`'s `response`. The read must append
|
|
32
|
-
its recorded `pull-request.seen` event, including the successful CI state,
|
|
33
|
-
check details, and check-completion status.
|
|
34
|
-
- Forge merges use POST, PUT, or PATCH below `/forge`, sending PR number `17`
|
|
35
|
-
in the path or body and the requested head in the body. The fixture returns
|
|
36
|
-
`{ "merged": true }` and the provider must confirm that result.
|
|
37
|
-
- `POST /model/chat/completions` returns `model/response.json`'s `response`,
|
|
38
|
-
an OpenAI-compatible completion containing one `conformance_echo` tool call
|
|
39
|
-
with `{ "message": "fixture-tool-call" }`. The returned model is exercised
|
|
40
|
-
through AI SDK `generateText` with a JSON Schema tool definition.
|
|
41
|
-
|
|
42
|
-
Runtime and node checks initialize a local Git repository and ask `prepare`
|
|
43
|
-
for a real workspace inside the temporary sandbox. They copy `runtime/worker.mjs`
|
|
44
|
-
into that workspace and launch Node. The fixture emits its readiness marker,
|
|
45
|
-
acknowledges each delivered nonce, and exits normally on `exit`. It supports
|
|
46
|
-
both a provider's PTY and piped stdin/stdout; the reference test provider uses
|
|
47
|
-
pipes so it runs without a controlling terminal, including on macOS. These
|
|
48
|
-
checks exercise the worker I/O protocol without requiring the test runner to
|
|
49
|
-
own a terminal. Checks separately observe running, delivery,
|
|
50
|
-
stop, and normal process exit. Providers must put output in `observe().reply`.
|
|
51
|
-
The public node API has no workspace teardown operation; the runner stops
|
|
52
|
-
workers and removes the whole owned temporary sandbox after the checks.
|
|
53
|
-
|
|
54
|
-
Read transport may use GET or POST (including GraphQL). Native provider
|
|
55
|
-
recordings can extend the `response` bodies while retaining the independent
|
|
56
|
-
`expectedEvents`; transport shape is owned by each provider.
|
|
57
|
-
|
|
58
|
-
`node/workspace.json` defines the seed file and branch prefix shared by runtime
|
|
59
|
-
and node preparation. Preparation must preserve that file's bytes and check out
|
|
60
|
-
the requested branch; returning an empty directory fails the check.
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"response": {
|
|
3
|
-
"pullRequests": [
|
|
4
|
-
{
|
|
5
|
-
"number": 17,
|
|
6
|
-
"ticket": "CHECK-1",
|
|
7
|
-
"state": "open",
|
|
8
|
-
"ci": "success",
|
|
9
|
-
"conflicting": false,
|
|
10
|
-
"head": "0123456789abcdef0123456789abcdef01234567",
|
|
11
|
-
"checks": [
|
|
12
|
-
{
|
|
13
|
-
"name": "verify",
|
|
14
|
-
"state": "success",
|
|
15
|
-
"runId": 101,
|
|
16
|
-
"runAttempt": 1
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
"checksComplete": true
|
|
20
|
-
}
|
|
21
|
-
]
|
|
22
|
-
},
|
|
23
|
-
"expectedEvents": [
|
|
24
|
-
{
|
|
25
|
-
"kind": "pull-request.seen",
|
|
26
|
-
"payload": {
|
|
27
|
-
"number": 17,
|
|
28
|
-
"ticket": "CHECK-1",
|
|
29
|
-
"state": "open",
|
|
30
|
-
"ci": "success",
|
|
31
|
-
"conflicting": false,
|
|
32
|
-
"head": "0123456789abcdef0123456789abcdef01234567",
|
|
33
|
-
"checks": [
|
|
34
|
-
{
|
|
35
|
-
"name": "verify",
|
|
36
|
-
"state": "success",
|
|
37
|
-
"runId": 101,
|
|
38
|
-
"runAttempt": 1
|
|
39
|
-
}
|
|
40
|
-
],
|
|
41
|
-
"checksComplete": true
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"operations": {
|
|
46
|
-
"Pulls": {
|
|
47
|
-
"data": {
|
|
48
|
-
"repository": {
|
|
49
|
-
"open": {
|
|
50
|
-
"nodes": [
|
|
51
|
-
{
|
|
52
|
-
"number": 17,
|
|
53
|
-
"title": "Exercise a plugin seam",
|
|
54
|
-
"url": "https://github.com/example/fixture/pull/17",
|
|
55
|
-
"state": "OPEN",
|
|
56
|
-
"isDraft": false,
|
|
57
|
-
"mergeable": "MERGEABLE",
|
|
58
|
-
"mergeStateStatus": "CLEAN",
|
|
59
|
-
"headRefName": "feature/check-1-plugin",
|
|
60
|
-
"headRefOid": "0123456789abcdef0123456789abcdef01234567",
|
|
61
|
-
"reviewDecision": null,
|
|
62
|
-
"commits": {
|
|
63
|
-
"nodes": [
|
|
64
|
-
{
|
|
65
|
-
"commit": {
|
|
66
|
-
"oid": "0123456789abcdef0123456789abcdef01234567",
|
|
67
|
-
"checkSuites": {
|
|
68
|
-
"nodes": [
|
|
69
|
-
{
|
|
70
|
-
"status": "COMPLETED",
|
|
71
|
-
"conclusion": "SUCCESS",
|
|
72
|
-
"commit": {
|
|
73
|
-
"oid": "0123456789abcdef0123456789abcdef01234567"
|
|
74
|
-
},
|
|
75
|
-
"workflowRun": {
|
|
76
|
-
"databaseId": 101,
|
|
77
|
-
"runNumber": 1,
|
|
78
|
-
"runAttempt": 1,
|
|
79
|
-
"workflow": {
|
|
80
|
-
"id": "verify"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
],
|
|
85
|
-
"pageInfo": {
|
|
86
|
-
"hasNextPage": false,
|
|
87
|
-
"endCursor": null
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
"statusCheckRollup": {
|
|
91
|
-
"state": "SUCCESS",
|
|
92
|
-
"contexts": {
|
|
93
|
-
"nodes": [
|
|
94
|
-
{
|
|
95
|
-
"__typename": "CheckRun",
|
|
96
|
-
"name": "verify",
|
|
97
|
-
"status": "COMPLETED",
|
|
98
|
-
"conclusion": "SUCCESS",
|
|
99
|
-
"checkSuite": {
|
|
100
|
-
"status": "COMPLETED",
|
|
101
|
-
"conclusion": "SUCCESS",
|
|
102
|
-
"commit": {
|
|
103
|
-
"oid": "0123456789abcdef0123456789abcdef01234567"
|
|
104
|
-
},
|
|
105
|
-
"workflowRun": {
|
|
106
|
-
"databaseId": 101,
|
|
107
|
-
"runNumber": 1,
|
|
108
|
-
"runAttempt": 1,
|
|
109
|
-
"workflow": {
|
|
110
|
-
"id": "verify"
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
],
|
|
116
|
-
"pageInfo": {
|
|
117
|
-
"hasNextPage": false,
|
|
118
|
-
"endCursor": null
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
],
|
|
128
|
-
"pageInfo": {
|
|
129
|
-
"hasNextPage": false,
|
|
130
|
-
"endCursor": null
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
"initialEvents": [
|
|
138
|
-
{
|
|
139
|
-
"kind": "ticket.seen",
|
|
140
|
-
"payload": {
|
|
141
|
-
"id": "CHECK-1",
|
|
142
|
-
"title": "Exercise a plugin seam",
|
|
143
|
-
"status": "started",
|
|
144
|
-
"phase": "implementing",
|
|
145
|
-
"owner": "Avery"
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
]
|
|
149
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"response": {
|
|
3
|
-
"id": "msg-conformance",
|
|
4
|
-
"object": "chat.completion",
|
|
5
|
-
"created": 1893492000,
|
|
6
|
-
"model": "conformance-model",
|
|
7
|
-
"choices": [
|
|
8
|
-
{
|
|
9
|
-
"index": 0,
|
|
10
|
-
"message": {
|
|
11
|
-
"role": "assistant",
|
|
12
|
-
"content": null,
|
|
13
|
-
"tool_calls": [
|
|
14
|
-
{
|
|
15
|
-
"id": "call-conformance",
|
|
16
|
-
"type": "function",
|
|
17
|
-
"function": {
|
|
18
|
-
"name": "conformance_echo",
|
|
19
|
-
"arguments": "{\"message\":\"fixture-tool-call\"}"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
"reasoning_content": "fixture-reasoning"
|
|
24
|
-
},
|
|
25
|
-
"finish_reason": "tool_calls"
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
"usage": {
|
|
29
|
-
"input_tokens": 10,
|
|
30
|
-
"output_tokens": 8,
|
|
31
|
-
"prompt_tokens": 10,
|
|
32
|
-
"completion_tokens": 8,
|
|
33
|
-
"total_tokens": 18
|
|
34
|
-
},
|
|
35
|
-
"type": "message",
|
|
36
|
-
"role": "assistant",
|
|
37
|
-
"content": [
|
|
38
|
-
{
|
|
39
|
-
"type": "tool_use",
|
|
40
|
-
"id": "call-conformance",
|
|
41
|
-
"name": "conformance_echo",
|
|
42
|
-
"input": {
|
|
43
|
-
"message": "fixture-tool-call"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
],
|
|
47
|
-
"stop_reason": "tool_use",
|
|
48
|
-
"stop_sequence": null
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// Host-side, headless node for runtime conformance. It drives real git and child processes.
|
|
2
|
-
import { execFile, spawn } from "node:child_process";
|
|
3
|
-
import { randomUUID } from "node:crypto";
|
|
4
|
-
import { mkdir, rm } from "node:fs/promises";
|
|
5
|
-
import { join } from "node:path";
|
|
6
|
-
import { promisify } from "node:util";
|
|
7
|
-
|
|
8
|
-
const execute = promisify(execFile);
|
|
9
|
-
export function fixtureNode(directory) {
|
|
10
|
-
const workers = new Map();
|
|
11
|
-
const get = (ref) => {
|
|
12
|
-
const row = workers.get(ref.handle);
|
|
13
|
-
if (!row || JSON.stringify(row.ref) !== JSON.stringify(ref)) throw new Error("Invalid fixture worker");
|
|
14
|
-
return row;
|
|
15
|
-
};
|
|
16
|
-
return {
|
|
17
|
-
async prepare({ repository, branch, signal }) {
|
|
18
|
-
const path = join(directory, `host-node-${randomUUID()}`);
|
|
19
|
-
await mkdir(directory, { recursive: true });
|
|
20
|
-
await execute("git", ["clone", "--quiet", repository, path], { signal });
|
|
21
|
-
await execute("git", ["-C", path, "switch", "--quiet", "-c", branch], { signal });
|
|
22
|
-
return { id: randomUUID(), path, node: "fixture" };
|
|
23
|
-
},
|
|
24
|
-
async launch({ workspace, worker, command, args, env }) {
|
|
25
|
-
const ref = { ...worker, handle: randomUUID() };
|
|
26
|
-
const child = spawn(command, args, { cwd: workspace.path, env: { ...process.env, ...env }, stdio: "pipe" });
|
|
27
|
-
const row = { ref, child, state: "starting", reply: "", keys: new Map() };
|
|
28
|
-
workers.set(ref.handle, row);
|
|
29
|
-
row.done = new Promise((resolve) => {
|
|
30
|
-
child.on("close", (code) => {
|
|
31
|
-
row.state = code === 0 || row.stopping ? "stopped" : "failed";
|
|
32
|
-
resolve();
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
for (const output of [child.stdout, child.stderr])
|
|
36
|
-
output.on("data", (chunk) => {
|
|
37
|
-
row.reply = (row.reply + chunk).slice(-65536);
|
|
38
|
-
});
|
|
39
|
-
child.stdin.on("error", () => {});
|
|
40
|
-
await new Promise((resolve, reject) => {
|
|
41
|
-
child.once("spawn", resolve);
|
|
42
|
-
child.once("error", reject);
|
|
43
|
-
});
|
|
44
|
-
row.state = "running";
|
|
45
|
-
return ref;
|
|
46
|
-
},
|
|
47
|
-
async deliver(ref, message, key) {
|
|
48
|
-
const row = get(ref);
|
|
49
|
-
if (row.keys.has(key)) {
|
|
50
|
-
if (row.keys.get(key) !== message) throw new Error("Delivery key reused");
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (row.state !== "running") throw new Error("Worker ended");
|
|
54
|
-
row.keys.set(key, message);
|
|
55
|
-
await new Promise((resolve, reject) =>
|
|
56
|
-
row.child.stdin.write(`${message}\n`, (error) => (error ? reject(error) : resolve())),
|
|
57
|
-
);
|
|
58
|
-
},
|
|
59
|
-
async observe(ref) {
|
|
60
|
-
const row = get(ref);
|
|
61
|
-
return { state: row.state, reply: row.reply };
|
|
62
|
-
},
|
|
63
|
-
async stop(ref) {
|
|
64
|
-
const row = get(ref);
|
|
65
|
-
if (row.state === "stopped" || row.state === "failed") return;
|
|
66
|
-
row.stopping = true;
|
|
67
|
-
row.child.kill("SIGTERM");
|
|
68
|
-
const timer = setTimeout(() => row.child.kill("SIGKILL"), 1000);
|
|
69
|
-
try {
|
|
70
|
-
await row.done;
|
|
71
|
-
} finally {
|
|
72
|
-
clearTimeout(timer);
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
async dispose(workspace) {
|
|
76
|
-
await rm(workspace.path, { recursive: true, force: true });
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createInterface } from "node:readline";
|
|
2
|
-
|
|
3
|
-
// The I/O protocol works with a provider's PTY or a headless reference transport.
|
|
4
|
-
console.log("ARMADA_CONFORMANCE_READY");
|
|
5
|
-
const input = createInterface({ input: process.stdin, crlfDelay: Infinity });
|
|
6
|
-
input.on("line", (line) => {
|
|
7
|
-
if (line === "exit") {
|
|
8
|
-
console.log("ARMADA_CONFORMANCE_EXIT");
|
|
9
|
-
input.close();
|
|
10
|
-
process.exit(0);
|
|
11
|
-
}
|
|
12
|
-
console.log(`ARMADA_CONFORMANCE_ACK:${line}`);
|
|
13
|
-
});
|