@awebai/oats 0.22.0 → 0.22.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 +30 -47
- package/bin/oats.mjs +11 -6
- package/capabilities/oats-authoring/LICENSE +21 -0
- package/capabilities/oats-authoring/oats-package.json +11 -0
- package/capabilities/oats-authoring/oats.json +4 -4
- package/capabilities/oats-authoring/skills/integration-authoring/SKILL.md +63 -0
- package/capabilities/oats-authoring/skills/skill-craft/SKILL.md +109 -0
- package/capabilities/oats-authoring/skills/soul-craft/SKILL.md +109 -0
- package/capabilities/oats-aweb/oats.json +6 -6
- package/capabilities/oats-aweb/skills/LICENSE +21 -0
- package/capabilities/oats-aweb/skills/VENDORED.md +26 -0
- package/capabilities/oats-aweb/skills/aweb-identity/SKILL.md +201 -0
- package/capabilities/oats-aweb/skills/aweb-messaging/SKILL.md +161 -0
- package/capabilities/oats-aweb/skills/aweb-messaging/references/messaging-scenarios.md +61 -0
- package/capabilities/oats-aweb/skills/aweb-team-membership/SKILL.md +328 -0
- package/capabilities/oats-aweb/skills/aweb-team-membership/references/team-membership-reference.md +74 -0
- package/capabilities/oats-jira/oats.json +1 -1
- package/capabilities/oats-linear/oats.json +1 -1
- package/capabilities/oats-okf/agents/memory-harvest/soul.yaml +6 -0
- package/capabilities/oats-okf/bin/oats-okf.mjs +82 -51
- package/capabilities/oats-okf/oats.json +4 -1
- package/capabilities/oats-review/oats.json +1 -1
- package/docs/2026-09-03-architecture-proposal.md +642 -0
- package/docs/first-team-demo.md +87 -0
- package/docs/first-team.md +179 -0
- package/docs/integrations.md +83 -65
- package/docs/layers.md +356 -80
- package/docs/migration-from-oas.md +80 -116
- package/docs/release-notes/v0.22.1.md +106 -0
- package/lib/core.mjs +255 -363
- package/package.json +1 -1
- package/packages/record/README.md +76 -16
- package/packages/record/docs/turn-record-sot.md +1 -1
- package/packages/record/lib/store.mjs +207 -43
- package/capabilities/oats-aweb/package.json +0 -20
- package/capabilities/oats-jira/package.json +0 -25
- package/capabilities/oats-linear/README.md +0 -234
- package/capabilities/oats-linear/package.json +0 -29
- package/capabilities/oats-linear/test/oats-linear.test.mjs +0 -168
- package/capabilities/oats-okf/package.json +0 -22
- /package/capabilities/oats-okf/agents/{memory-harvest.md → memory-harvest/AGENTS.md} +0 -0
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
# OATS Linear tasks integration
|
|
2
|
-
|
|
3
|
-
Binds the OATS `tasks` layer to [Linear](https://linear.app). It ships the
|
|
4
|
-
`linear-tasks` skill, a short soul injection, a spawn briefing, and JSON-first
|
|
5
|
-
`oats linear ...` commands for issue work.
|
|
6
|
-
|
|
7
|
-
## Why GraphQL instead of a Linear CLI?
|
|
8
|
-
|
|
9
|
-
Linear's official `@linear/cli` only supports interactive issue creation and
|
|
10
|
-
branch checkout. It cannot list queues, read issues, transition workflow
|
|
11
|
-
states, label ownership, or post comments. Third-party CLIs expose different
|
|
12
|
-
and unstable command contracts. This integration therefore calls Linear's
|
|
13
|
-
official GraphQL API directly with Node's built-in `fetch`; it adds no external
|
|
14
|
-
CLI or SDK dependency.
|
|
15
|
-
|
|
16
|
-
- Endpoint: `https://api.linear.app/graphql`
|
|
17
|
-
- Authentication: personal API key in the `Authorization` header
|
|
18
|
-
- Documentation: <https://linear.app/developers/graphql>
|
|
19
|
-
|
|
20
|
-
## Setup
|
|
21
|
-
|
|
22
|
-
1. In Linear, open **Settings → Security & access → API keys** and create a
|
|
23
|
-
personal API key with access to the workspace used by your OATS agents.
|
|
24
|
-
2. Put the key in your shell or secret manager, never in `oats-config.yaml`:
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
export LINEAR_API_KEY='lin_api_...'
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Start/resume agents from an environment that receives this variable. The
|
|
31
|
-
spawn hook warns when it is absent; API commands fail once with an actionable
|
|
32
|
-
authentication error rather than attempting login.
|
|
33
|
-
3. Activate the bundled integration at the intended target:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
oats use oats.linear --global --dir /path/to/workspace
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
4. Add target settings to that binding (team is the Linear issue-prefix key;
|
|
40
|
-
project is an optional default communicated in each instance briefing):
|
|
41
|
-
|
|
42
|
-
```yaml
|
|
43
|
-
capabilities:
|
|
44
|
-
layers:
|
|
45
|
-
tasks:
|
|
46
|
-
capability: oats.linear
|
|
47
|
-
from: bundled
|
|
48
|
-
settings: { team: ENG, project: Agent Platform }
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
5. Verify resolution and API access (operational commands are available only
|
|
52
|
-
in an active context):
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
oats doctor /path/to/workspace
|
|
56
|
-
oats linear auth
|
|
57
|
-
oats linear teams
|
|
58
|
-
oats linear states --team ENG
|
|
59
|
-
oats linear projects --team ENG
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
The API key acts as the human who created it. Agents preserve the human
|
|
63
|
-
assignee, identify themselves with `agent-<instance-name>` labels, and do not
|
|
64
|
-
move issues to terminal states without explicit human authorization.
|
|
65
|
-
|
|
66
|
-
## Command surface
|
|
67
|
-
|
|
68
|
-
All successful output is JSON; errors are JSON on stderr and return non-zero.
|
|
69
|
-
Run an incomplete command for usage, or load the `linear-tasks` skill for the
|
|
70
|
-
workflow and exact examples.
|
|
71
|
-
|
|
72
|
-
```text
|
|
73
|
-
oats linear auth
|
|
74
|
-
oats linear teams
|
|
75
|
-
oats linear states --team <KEY>
|
|
76
|
-
oats linear projects --team <KEY>
|
|
77
|
-
oats linear labels --team <KEY>
|
|
78
|
-
oats linear issue list|get|create|update|comment ...
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
Agent labels are created team-locally on first use of `--agent`. Other labels
|
|
82
|
-
must already exist. `--description-file` and `--body-file` avoid shell quoting
|
|
83
|
-
problems for multiline Markdown.
|
|
84
|
-
|
|
85
|
-
## Projects, project documentation, and related issues
|
|
86
|
-
|
|
87
|
-
### Operating model
|
|
88
|
-
|
|
89
|
-
Use each Linear object for one kind of durable information:
|
|
90
|
-
|
|
91
|
-
| Linear object | What belongs there | Who manages it with this integration |
|
|
92
|
-
|---|---|---|
|
|
93
|
-
| Project | Outcome, ownership, lifecycle, target dates, and the container for related issues | Humans in the Linear UI; agents can discover it |
|
|
94
|
-
| Project overview | Intent, scope/non-goals, architecture, constraints, human gates, and success criteria | Humans in the Linear UI |
|
|
95
|
-
| Project documents | Detailed designs, decision records, runbooks, research, and other long-form project context | Humans in the Linear UI |
|
|
96
|
-
| Issue | One bounded deliverable with acceptance criteria | Agents through `oats linear issue ...` |
|
|
97
|
-
| Sub-issue | An independently verifiable part of a larger issue | Agents through `--parent` |
|
|
98
|
-
| Issue comment | Milestones, blockers, handoffs, verification, and PR/branch links | Agents through `issue comment` |
|
|
99
|
-
| Messaging | Conversation and nudges | The configured messaging layer, never the durable task record |
|
|
100
|
-
|
|
101
|
-
The project overview and documents explain the work; issues execute it. Keep
|
|
102
|
-
project-wide decisions out of an arbitrary issue description, and keep task
|
|
103
|
-
status out of chat. When a project document governs an issue, link that
|
|
104
|
-
document from the issue description or a durable comment.
|
|
105
|
-
|
|
106
|
-
### Discover projects
|
|
107
|
-
|
|
108
|
-
The wrapper currently reads project metadata but not project overview/document
|
|
109
|
-
content:
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
oats linear projects --team ENG
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
The JSON includes project IDs, names, slugs, status, and associated teams. Use
|
|
116
|
-
an exact project name or slug in issue commands. If the configured project is
|
|
117
|
-
missing or ambiguous, stop and ask the human rather than selecting a similar
|
|
118
|
-
name.
|
|
119
|
-
|
|
120
|
-
### List issues in a project
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
# Open issues in the project
|
|
124
|
-
oats linear issue list --team ENG --project "Agent Platform"
|
|
125
|
-
|
|
126
|
-
# Open issues claimed by one OATS instance
|
|
127
|
-
oats linear issue list --team ENG --project "Agent Platform" \
|
|
128
|
-
--agent my-agent-instance
|
|
129
|
-
|
|
130
|
-
# Include terminal issues when auditing history
|
|
131
|
-
oats linear issue list --team ENG --project "Agent Platform" --all
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
`issue list` excludes completed, canceled, and duplicate states unless `--all`
|
|
135
|
-
is supplied. Use `issue get` before acting; its JSON includes the issue's
|
|
136
|
-
project and parent context:
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
oats linear issue get ENG-123
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Create issues in a project
|
|
143
|
-
|
|
144
|
-
Prefer a Markdown file for acceptance criteria:
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
cat > /tmp/issue.md <<'EOF'
|
|
148
|
-
Why this work is needed.
|
|
149
|
-
|
|
150
|
-
Acceptance:
|
|
151
|
-
- [ ] Observable outcome implemented
|
|
152
|
-
- [ ] Verification evidence recorded
|
|
153
|
-
- [ ] Relevant documentation updated
|
|
154
|
-
EOF
|
|
155
|
-
|
|
156
|
-
oats linear issue create --team ENG --project "Agent Platform" \
|
|
157
|
-
--title "Implement token refresh" \
|
|
158
|
-
--description-file /tmp/issue.md \
|
|
159
|
-
--agent my-agent-instance
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
Create a sub-issue only when it is independently verifiable and the parent
|
|
163
|
-
really decomposes into multiple pieces:
|
|
164
|
-
|
|
165
|
-
```bash
|
|
166
|
-
oats linear issue create --team ENG --parent ENG-123 \
|
|
167
|
-
--title "Add refresh-token tests" \
|
|
168
|
-
--description-file /tmp/issue.md \
|
|
169
|
-
--agent my-agent-instance
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
Project membership and parentage are independent: `--project` associates an
|
|
173
|
-
issue with a project; `--parent` makes it a sub-issue. Supply both when the
|
|
174
|
-
sub-issue must explicitly carry project membership.
|
|
175
|
-
|
|
176
|
-
### Work and report within the project
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
oats linear issue update ENG-123 --agent my-agent-instance
|
|
180
|
-
oats linear issue update ENG-123 --state "In Progress"
|
|
181
|
-
oats linear issue comment ENG-123 \
|
|
182
|
-
--body "[my-agent-instance] milestone: implementation complete; tests pass"
|
|
183
|
-
oats linear issue comment ENG-123 \
|
|
184
|
-
--body "[my-agent-instance] handoff → reviewer: PR <url>; run npm test"
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
Use the team's exact workflow names from `oats linear states --team ENG`.
|
|
188
|
-
Agents normally stop at the review state. Terminal transitions require both
|
|
189
|
-
explicit human authorization and `--allow-terminal`.
|
|
190
|
-
|
|
191
|
-
### Manage project overviews and documents
|
|
192
|
-
|
|
193
|
-
The current command wrapper does **not** read or mutate project overview
|
|
194
|
-
Markdown or Linear documents. Manage them through the Linear UI:
|
|
195
|
-
|
|
196
|
-
1. Open the project returned by `oats linear projects --team <KEY>`.
|
|
197
|
-
2. Maintain project intent, scope, non-goals, ownership, gates, architecture,
|
|
198
|
-
and success criteria in its overview.
|
|
199
|
-
3. Keep detailed designs, decisions, and runbooks in project documents.
|
|
200
|
-
4. Link governing project documents from related issues.
|
|
201
|
-
5. Record implementation progress on issues; use Linear's project updates for
|
|
202
|
-
human-facing project-level summaries.
|
|
203
|
-
|
|
204
|
-
An agent that needs unavailable project-document context must ask the human for
|
|
205
|
-
its URL/content. It must not infer missing project policy from issue titles.
|
|
206
|
-
|
|
207
|
-
## Current support boundary
|
|
208
|
-
|
|
209
|
-
| Operation | Supported by `oats linear`? | Current path |
|
|
210
|
-
|---|---:|---|
|
|
211
|
-
| Discover teams, workflow states, projects, and labels | Yes | `teams`, `states`, `projects`, `labels` |
|
|
212
|
-
| List/get/create/update/comment on project issues | Yes | `issue ...` commands |
|
|
213
|
-
| Create sub-issues | Yes | `issue create --parent ...` |
|
|
214
|
-
| Create, rename, schedule, change status, or close a project | No | Linear UI; human-owned |
|
|
215
|
-
| Read or edit project overview Markdown | No | Linear UI |
|
|
216
|
-
| List, read, create, or edit project documents | No | Linear UI |
|
|
217
|
-
| Move an existing issue into/out of a project | No | Linear UI |
|
|
218
|
-
| Change an existing issue's parent | No | Linear UI |
|
|
219
|
-
| Publish Linear project status updates | No | Linear UI |
|
|
220
|
-
| Create issue-to-issue relations such as blocks/related | No | Linear UI |
|
|
221
|
-
|
|
222
|
-
Do not invent GraphQL calls or undocumented command flags to bypass this
|
|
223
|
-
boundary. A future, separately reviewed extension could add commands such as:
|
|
224
|
-
|
|
225
|
-
```text
|
|
226
|
-
oats linear project get|create|update
|
|
227
|
-
oats linear project issue-add|issue-remove
|
|
228
|
-
oats linear document list|get|create|update
|
|
229
|
-
oats linear project-update create
|
|
230
|
-
oats linear relation create
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
Before adding those operations, the deployment must decide which project and
|
|
234
|
-
document mutations agents may perform and which remain human-only.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@awebai/oats-linear",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"description": "OATS tasks provider: Linear via its GraphQL API, with JSON-first commands and label-based agent identity",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"pi-package",
|
|
7
|
-
"oats",
|
|
8
|
-
"linear",
|
|
9
|
-
"tasks"
|
|
10
|
-
],
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/awebai/oats",
|
|
14
|
-
"directory": "capabilities/oats-linear"
|
|
15
|
-
},
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"type": "module",
|
|
18
|
-
"scripts": {
|
|
19
|
-
"test": "node --test"
|
|
20
|
-
},
|
|
21
|
-
"bin": {
|
|
22
|
-
"oats-linear": "./bin/oats-linear.mjs"
|
|
23
|
-
},
|
|
24
|
-
"pi": {
|
|
25
|
-
"skills": [
|
|
26
|
-
"./skills"
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { spawn } from "node:child_process";
|
|
3
|
-
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { createServer } from "node:http";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
|
-
import { join, resolve } from "node:path";
|
|
7
|
-
import test from "node:test";
|
|
8
|
-
import { fileURLToPath } from "node:url";
|
|
9
|
-
|
|
10
|
-
const DIR = resolve(fileURLToPath(new URL("..", import.meta.url)));
|
|
11
|
-
const CLI = join(DIR, "bin", "oats-linear.mjs");
|
|
12
|
-
const HOOK = join(DIR, "bin", "oats-linear-hook.mjs");
|
|
13
|
-
|
|
14
|
-
function run(script, args = [], env = {}) {
|
|
15
|
-
return new Promise((done) => {
|
|
16
|
-
const child = spawn(process.execPath, [script, ...args], {
|
|
17
|
-
env: { ...process.env, ...env },
|
|
18
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
19
|
-
});
|
|
20
|
-
let stdout = "";
|
|
21
|
-
let stderr = "";
|
|
22
|
-
child.stdout.on("data", (chunk) => { stdout += chunk; });
|
|
23
|
-
child.stderr.on("data", (chunk) => { stderr += chunk; });
|
|
24
|
-
child.on("close", (code) => done({ code, stdout, stderr }));
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async function mockApi(responder, fn) {
|
|
29
|
-
const requests = [];
|
|
30
|
-
const server = createServer(async (request, response) => {
|
|
31
|
-
let body = "";
|
|
32
|
-
for await (const chunk of request) body += chunk;
|
|
33
|
-
const parsed = JSON.parse(body);
|
|
34
|
-
requests.push({ headers: request.headers, ...parsed });
|
|
35
|
-
const payload = await responder(parsed, requests);
|
|
36
|
-
response.writeHead(payload.status || 200, { "content-type": "application/json" });
|
|
37
|
-
response.end(JSON.stringify(payload.body || payload));
|
|
38
|
-
});
|
|
39
|
-
await new Promise((ready) => server.listen(0, "127.0.0.1", ready));
|
|
40
|
-
const url = `http://127.0.0.1:${server.address().port}/graphql`;
|
|
41
|
-
try { await fn({ url, requests }); }
|
|
42
|
-
finally { await new Promise((closed) => server.close(closed)); }
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const team = { id: "team-1", key: "ENG", name: "Engineering" };
|
|
46
|
-
const issue = {
|
|
47
|
-
id: "issue-1", identifier: "ENG-1", title: "Test issue", description: "body",
|
|
48
|
-
url: "https://linear.app/issue/ENG-1", priority: 0, priorityLabel: "No priority",
|
|
49
|
-
team, state: { id: "started-1", name: "In Progress", type: "started" },
|
|
50
|
-
project: null, parent: null, assignee: { id: "human-1", name: "Human", email: "human@example.com" },
|
|
51
|
-
labels: { nodes: [] },
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
function operation(query) { return query.match(/(?:query|mutation)\s+(\w+)/)?.[1]; }
|
|
55
|
-
|
|
56
|
-
test("missing API key fails once with setup guidance", async () => {
|
|
57
|
-
const result = await run(CLI, ["auth"], { LINEAR_API_KEY: "" });
|
|
58
|
-
assert.equal(result.code, 1);
|
|
59
|
-
assert.match(result.stderr, /LINEAR_API_KEY is not set/);
|
|
60
|
-
assert.match(result.stderr, /Security & access/);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
test("auth uses the personal-key Authorization header", async () => {
|
|
64
|
-
await mockApi(() => ({ data: {
|
|
65
|
-
viewer: { id: "user-1", name: "Human", email: "human@example.com" },
|
|
66
|
-
organization: { id: "org-1", name: "Acme", urlKey: "acme" },
|
|
67
|
-
} }), async ({ url, requests }) => {
|
|
68
|
-
const result = await run(CLI, ["auth"], { LINEAR_API_KEY: "secret-key", LINEAR_API_URL: url });
|
|
69
|
-
assert.equal(result.code, 0, result.stderr);
|
|
70
|
-
assert.equal(JSON.parse(result.stdout).authenticated, true);
|
|
71
|
-
assert.equal(requests[0].headers.authorization, "secret-key");
|
|
72
|
-
assert.equal(operation(requests[0].query), "OatsLinearAuth");
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
test("issue list builds an open agent/project filter", async () => {
|
|
77
|
-
await mockApi(({ query }) => {
|
|
78
|
-
if (operation(query) === "OatsLinearTeam") return { data: { teams: { nodes: [team] } } };
|
|
79
|
-
if (operation(query) === "OatsLinearProjects") return { data: { projects: { nodes: [
|
|
80
|
-
{ id: "project-1", name: "Agent Platform", slugId: "agent-platform", status: { id: "ps-1", name: "Started", type: "started" }, teams: { nodes: [team] } },
|
|
81
|
-
] } } };
|
|
82
|
-
if (operation(query) === "OatsLinearIssues") return { data: { issues: { nodes: [issue], pageInfo: { hasNextPage: false, endCursor: null } } } };
|
|
83
|
-
throw new Error(`unexpected operation ${operation(query)}`);
|
|
84
|
-
}, async ({ url, requests }) => {
|
|
85
|
-
const result = await run(CLI, ["issue", "list", "--team", "ENG", "--agent", "worker-1", "--project", "Agent Platform"], {
|
|
86
|
-
LINEAR_API_KEY: "key", LINEAR_API_URL: url,
|
|
87
|
-
});
|
|
88
|
-
assert.equal(result.code, 0, result.stderr);
|
|
89
|
-
const listRequest = requests.find((request) => operation(request.query) === "OatsLinearIssues");
|
|
90
|
-
assert.deepEqual(listRequest.variables.filter, {
|
|
91
|
-
team: { id: { eq: "team-1" } },
|
|
92
|
-
state: { type: { nin: ["completed", "canceled", "duplicate"] } },
|
|
93
|
-
labels: { some: { name: { eqIgnoreCase: "agent-worker-1" } } },
|
|
94
|
-
project: { id: { eq: "project-1" } },
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
test("issue create provisions the agent label and records identity", async () => {
|
|
100
|
-
await mockApi(({ query, variables }) => {
|
|
101
|
-
const op = operation(query);
|
|
102
|
-
if (op === "OatsLinearTeam") return { data: { teams: { nodes: [team] } } };
|
|
103
|
-
if (op === "OatsLinearLabels") return { data: { issueLabels: { nodes: [] } } };
|
|
104
|
-
if (op === "OatsLinearCreateLabel") return { data: { issueLabelCreate: {
|
|
105
|
-
success: true, issueLabel: { id: "label-1", name: variables.input.name, color: "#5E6AD2", team },
|
|
106
|
-
} } };
|
|
107
|
-
if (op === "OatsLinearIssueCreate") return { data: { issueCreate: { success: true, issue } } };
|
|
108
|
-
throw new Error(`unexpected operation ${op}`);
|
|
109
|
-
}, async ({ url, requests }) => {
|
|
110
|
-
const result = await run(CLI, ["issue", "create", "--team", "ENG", "--title", "Bounded work", "--description", "Acceptance", "--agent", "worker-1"], {
|
|
111
|
-
LINEAR_API_KEY: "key", LINEAR_API_URL: url,
|
|
112
|
-
});
|
|
113
|
-
assert.equal(result.code, 0, result.stderr);
|
|
114
|
-
const create = requests.find((request) => operation(request.query) === "OatsLinearIssueCreate");
|
|
115
|
-
assert.equal(create.variables.input.teamId, "team-1");
|
|
116
|
-
assert.deepEqual(create.variables.input.labelIds, ["label-1"]);
|
|
117
|
-
assert.match(create.variables.input.description, /Acceptance\n\n---\nAgent: worker-1/);
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
test("terminal transitions require explicit authorization", async () => {
|
|
122
|
-
await mockApi(({ query }) => {
|
|
123
|
-
const op = operation(query);
|
|
124
|
-
if (op === "OatsLinearIssue") return { data: { issue } };
|
|
125
|
-
if (op === "OatsLinearStates") return { data: { team: { states: { nodes: [
|
|
126
|
-
{ id: "done-1", name: "Done", type: "completed", position: 1 },
|
|
127
|
-
] } } } };
|
|
128
|
-
throw new Error(`unexpected operation ${op}`);
|
|
129
|
-
}, async ({ url, requests }) => {
|
|
130
|
-
const result = await run(CLI, ["issue", "update", "ENG-1", "--state", "Done"], {
|
|
131
|
-
LINEAR_API_KEY: "key", LINEAR_API_URL: url,
|
|
132
|
-
});
|
|
133
|
-
assert.equal(result.code, 1);
|
|
134
|
-
assert.match(result.stderr, /refusing terminal state/);
|
|
135
|
-
assert.equal(requests.some((request) => operation(request.query) === "OatsLinearIssueUpdate"), false);
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
test("comment accepts multiline markdown from a file", async () => {
|
|
140
|
-
const temp = mkdtempSync(join(tmpdir(), "oats-linear-test-"));
|
|
141
|
-
const bodyFile = join(temp, "comment.md");
|
|
142
|
-
writeFileSync(bodyFile, "[worker-1] handoff: details\n\n- tests pass\n");
|
|
143
|
-
try {
|
|
144
|
-
await mockApi(({ query }) => {
|
|
145
|
-
assert.equal(operation(query), "OatsLinearComment");
|
|
146
|
-
return { data: { commentCreate: { success: true, comment: { id: "comment-1", body: "ok", createdAt: "2026-07-10", url: "https://linear.app/c/1", user: { id: "user-1", name: "Human" } } } } };
|
|
147
|
-
}, async ({ url, requests }) => {
|
|
148
|
-
const result = await run(CLI, ["issue", "comment", "ENG-1", "--body-file", bodyFile], {
|
|
149
|
-
LINEAR_API_KEY: "key", LINEAR_API_URL: url,
|
|
150
|
-
});
|
|
151
|
-
assert.equal(result.code, 0, result.stderr);
|
|
152
|
-
assert.equal(requests[0].variables.input.body, "[worker-1] handoff: details\n\n- tests pass");
|
|
153
|
-
});
|
|
154
|
-
} finally { rmSync(temp, { recursive: true, force: true }); }
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
test("spawn hook briefs settings and warns without auth", async () => {
|
|
158
|
-
const result = await run(HOOK, ["spawn"], {
|
|
159
|
-
OATS_EVENT: "spawn", OATS_INSTANCE: "worker-1",
|
|
160
|
-
OATS_SETTINGS: JSON.stringify({ team: "ENG", project: "Agent Platform" }),
|
|
161
|
-
LINEAR_API_KEY: "",
|
|
162
|
-
});
|
|
163
|
-
assert.equal(result.code, 0, result.stderr);
|
|
164
|
-
const payload = JSON.parse(result.stdout);
|
|
165
|
-
assert.deepEqual(payload.meta, { label: "agent-worker-1", team: "ENG", project: "Agent Platform" });
|
|
166
|
-
assert.match(payload.brief, /team ENG, default project Agent Platform/);
|
|
167
|
-
assert.match(payload.warning, /LINEAR_API_KEY/);
|
|
168
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@awebai/oats-okf",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"description": "OATS knowledge provider: Open Knowledge Format (OKF) craft skill, bundle validator, and agents-md injection",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"pi-package",
|
|
7
|
-
"oats",
|
|
8
|
-
"okf"
|
|
9
|
-
],
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "https://github.com/awebai/oats",
|
|
13
|
-
"directory": "capabilities/oats-okf"
|
|
14
|
-
},
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"type": "module",
|
|
17
|
-
"pi": {
|
|
18
|
-
"skills": [
|
|
19
|
-
"./skills"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
File without changes
|