@phamvuhoang/otto-core 0.3.0 → 0.4.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/dist/cli-help.d.ts +22 -3
- package/dist/cli-help.d.ts.map +1 -1
- package/dist/cli-help.js +9 -7
- package/dist/cli-help.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/linear-api.d.ts +161 -0
- package/dist/linear-api.d.ts.map +1 -0
- package/dist/linear-api.js +296 -0
- package/dist/linear-api.js.map +1 -0
- package/dist/linear-auth.d.ts +44 -0
- package/dist/linear-auth.d.ts.map +1 -0
- package/dist/linear-auth.js +145 -0
- package/dist/linear-auth.js.map +1 -0
- package/dist/linear-cli.d.ts +37 -0
- package/dist/linear-cli.d.ts.map +1 -0
- package/dist/linear-cli.js +180 -0
- package/dist/linear-cli.js.map +1 -0
- package/dist/linear-main.d.ts +5 -0
- package/dist/linear-main.d.ts.map +1 -0
- package/dist/linear-main.js +27 -0
- package/dist/linear-main.js.map +1 -0
- package/dist/preflight.d.ts +3 -0
- package/dist/preflight.d.ts.map +1 -1
- package/dist/preflight.js +13 -1
- package/dist/preflight.js.map +1 -1
- package/dist/run-bin.d.ts +21 -1
- package/dist/run-bin.d.ts.map +1 -1
- package/dist/run-bin.js +18 -6
- package/dist/run-bin.js.map +1 -1
- package/dist/stages.d.ts +10 -0
- package/dist/stages.d.ts.map +1 -1
- package/dist/stages.js +10 -0
- package/dist/stages.js.map +1 -1
- package/dist/watch.d.ts +37 -2
- package/dist/watch.d.ts.map +1 -1
- package/dist/watch.js +39 -4
- package/dist/watch.js.map +1 -1
- package/package.json +1 -1
- package/templates/linear-completion.md +17 -0
- package/templates/linearafk-issue.md +31 -0
- package/templates/linearafk.md +29 -0
- package/templates/linearprompt.md +39 -0
package/dist/watch.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { execFileSync } from "node:child_process";
|
|
2
2
|
import { acquire } from "./keepalive.js";
|
|
3
|
+
import { createLinearClient, resolveLinearAuth, LinearApiError, } from "./linear-api.js";
|
|
3
4
|
import { runLoop } from "./loop.js";
|
|
4
5
|
import { notifyComplete, notifyError } from "./notify.js";
|
|
5
6
|
import { sleep } from "./pacing.js";
|
|
@@ -36,8 +37,41 @@ export function pollOpenIssues(label, cwd) {
|
|
|
36
37
|
return { ok: false, auth, detail };
|
|
37
38
|
}
|
|
38
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Poll open Linear issues carrying `label` (count only, no comments). Never
|
|
42
|
+
* throws — mirrors {@link pollOpenIssues}. A missing credential or a Linear
|
|
43
|
+
* `auth`-kind error is reported as `auth: true` so the daemon can print a
|
|
44
|
+
* re-login hint distinctly from a transient request/network failure.
|
|
45
|
+
*/
|
|
46
|
+
export async function pollLinearIssues(deps) {
|
|
47
|
+
const auth = (deps.resolveAuth ?? (() => resolveLinearAuth()))();
|
|
48
|
+
if (!auth) {
|
|
49
|
+
return {
|
|
50
|
+
ok: false,
|
|
51
|
+
auth: true,
|
|
52
|
+
detail: "no Linear API key — run 'otto-linear-auth login'",
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const client = (deps.makeClient ??
|
|
57
|
+
((t) => createLinearClient({ token: t })))(auth.token);
|
|
58
|
+
const issues = await client.listIssues({
|
|
59
|
+
label: deps.label,
|
|
60
|
+
team: deps.team,
|
|
61
|
+
limit: deps.limit ?? 50,
|
|
62
|
+
});
|
|
63
|
+
return { ok: true, count: issues.length };
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
if (err instanceof LinearApiError) {
|
|
67
|
+
return { ok: false, auth: err.kind === "auth", detail: err.message };
|
|
68
|
+
}
|
|
69
|
+
return { ok: false, auth: false, detail: err.message };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const GH_PROVIDER = { name: "gh", authCmd: "gh auth login" };
|
|
39
73
|
export async function runWatch(opts) {
|
|
40
|
-
const { stages, iterations, workspaceDir, packageDir, watchIntervalSec, watchLabel, budgetUsd, cooldownMs, maxRetries, reviewLenses, notify = false, bin = "otto-ghafk", pollIssues = pollOpenIssues, } = opts;
|
|
74
|
+
const { stages, iterations, workspaceDir, packageDir, watchIntervalSec, watchLabel, budgetUsd, cooldownMs, maxRetries, reviewLenses, notify = false, bin = "otto-ghafk", pollIssues = pollOpenIssues, provider = GH_PROVIDER, } = opts;
|
|
41
75
|
const releaser = acquire({ reason: `${bin} watch` });
|
|
42
76
|
let released = false;
|
|
43
77
|
const releaseOnce = () => {
|
|
@@ -73,14 +107,15 @@ export async function runWatch(opts) {
|
|
|
73
107
|
notifyComplete(0, false);
|
|
74
108
|
return;
|
|
75
109
|
}
|
|
76
|
-
const poll = pollIssues(watchLabel, workspaceDir);
|
|
110
|
+
const poll = await pollIssues(watchLabel, workspaceDir);
|
|
77
111
|
if (!poll.ok) {
|
|
78
112
|
// Broken poll — say *why*, distinctly from an idle queue, and keep
|
|
79
113
|
// polling (auth may get fixed / a transient failure may clear).
|
|
80
114
|
wasIdle = false;
|
|
115
|
+
const suffix = poll.detail ? ` — ${poll.detail}` : "";
|
|
81
116
|
const why = poll.auth
|
|
82
|
-
?
|
|
83
|
-
:
|
|
117
|
+
? `${provider.name} not authenticated — run '${provider.authCmd}' (label ${watchLabel})${suffix}`
|
|
118
|
+
: `${provider.name} issue poll failed (label ${watchLabel})${suffix}`;
|
|
84
119
|
process.stderr.write(`${dim(why)}\n`);
|
|
85
120
|
}
|
|
86
121
|
else if (poll.count > 0) {
|
package/dist/watch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../src/watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAiB,MAAM,gBAAgB,CAAC;AACxD,OAA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AS,EAAE,SAAS;oBACpB,UAAU;oBACV,UAAU;oBACV,YAAY;oBACZ,WAAW,EAAE,IAAI;oBACjB,MAAM,EAAE,WAAW,CAAC,MAAM;oBAC1B,GAAG;oBACH,UAAU,EAAE,IAAI,CAAC,UAAU;iBAC5B,CAAC,CAAC;gBACH,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;gBAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,GAAG,CAAC,gCAAgC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CACxE,CAAC;YACJ,CAAC;iBAAM,IAAI,CAAC,OAAO,EAAE,CAAC;gBACpB,wEAAwE;gBACxE,uEAAuE;gBACvE,OAAO,GAAG,IAAI,CAAC;gBACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,GAAG,CAAC,2BAA2B,UAAU,yBAAyB,gBAAgB,GAAG,CAAC,IAAI,CAC9F,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC,gBAAgB,GAAG,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAClC,WAAW,EAAE,CAAC;IAChB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# COMPLETION (Linear)
|
|
2
|
+
|
|
3
|
+
Apply the FINISHING guidance above using the bundled `otto-linear` helper for
|
|
4
|
+
every Linear write — never raw GraphQL, and never `gh`:
|
|
5
|
+
|
|
6
|
+
- **Comment** with branch/PR status or what was done: write the body to a file,
|
|
7
|
+
then `otto-linear comment <ref> --body-file <path>`.
|
|
8
|
+
- **PR-based repo (this repo's convention):** comment branch/PR info on the
|
|
9
|
+
Linear issue and leave it OPEN — a human moves it to done when the PR merges.
|
|
10
|
+
Do NOT move the issue yourself.
|
|
11
|
+
- **Commit-to-branch repo (no PR):** once the work has landed, move the issue to
|
|
12
|
+
a completed state with `otto-linear done <ref>`. It resolves the target via
|
|
13
|
+
`OTTO_LINEAR_DONE_STATE` (by name), else the team's first `completed`-type
|
|
14
|
+
state. If it cannot resolve one and exits non-zero, comment instead and leave
|
|
15
|
+
the issue for a human to move.
|
|
16
|
+
|
|
17
|
+
When unsure which convention applies, comment and leave the issue OPEN.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<commits>
|
|
2
|
+
|
|
3
|
+
!?`git log -n 5 --format="%H%n%ad%n%B---" --date=short|||No commits found`
|
|
4
|
+
|
|
5
|
+
</commits>
|
|
6
|
+
|
|
7
|
+
<learnings>
|
|
8
|
+
|
|
9
|
+
!?`cat ./.otto/LEARNINGS.md|||_No learnings recorded yet._`
|
|
10
|
+
|
|
11
|
+
</learnings>
|
|
12
|
+
|
|
13
|
+
<issue>
|
|
14
|
+
|
|
15
|
+
Working on Linear issue {{ INPUTS }}.
|
|
16
|
+
|
|
17
|
+
Full issue detail (body + comments) spilled to: @spill?:issue.json=`otto-linear view "$OTTO_ISSUE"|||{}`
|
|
18
|
+
|
|
19
|
+
`Read` that file to get the full body and comments before acting on the issue.
|
|
20
|
+
|
|
21
|
+
</issue>
|
|
22
|
+
|
|
23
|
+
# THE TASK
|
|
24
|
+
|
|
25
|
+
Work **only** on Linear issue {{ INPUTS }} (shown above). Do not list, triage, or pick from any other open issues — this run is scoped to a single issue.
|
|
26
|
+
|
|
27
|
+
If Linear issue {{ INPUTS }} is already complete (done, or there is no work left to do), output <promise>NO MORE TASKS</promise>.
|
|
28
|
+
|
|
29
|
+
@include:ghprompt-workflow.md
|
|
30
|
+
|
|
31
|
+
@include:linear-completion.md
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{{ RESUME }}
|
|
2
|
+
|
|
3
|
+
<commits>
|
|
4
|
+
|
|
5
|
+
!?`git log -n 5 --format="%H%n%ad%n%B---" --date=short|||No commits found`
|
|
6
|
+
|
|
7
|
+
</commits>
|
|
8
|
+
|
|
9
|
+
<learnings>
|
|
10
|
+
|
|
11
|
+
!?`cat ./.otto/LEARNINGS.md|||_No learnings recorded yet._`
|
|
12
|
+
|
|
13
|
+
</learnings>
|
|
14
|
+
|
|
15
|
+
<issues-summary>
|
|
16
|
+
|
|
17
|
+
`otto-linear list --limit 50`
|
|
18
|
+
|
|
19
|
+
</issues-summary>
|
|
20
|
+
|
|
21
|
+
<issues-full-file>
|
|
22
|
+
|
|
23
|
+
Full issue bodies + comments spilled to: @spill?:issues.json=`otto-linear dump --limit 50|||[]`
|
|
24
|
+
|
|
25
|
+
Read that file with `Read` (use `offset`/`limit` if it is large) to get bodies and comments before picking a task. The `<issues-summary>` block above is the lean index for triage.
|
|
26
|
+
|
|
27
|
+
</issues-full-file>
|
|
28
|
+
|
|
29
|
+
@include:linearprompt.md
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# ISSUES
|
|
2
|
+
|
|
3
|
+
Two views of open Linear issues are provided at the start of context:
|
|
4
|
+
|
|
5
|
+
- `<issues-summary>` — the `otto-linear list` command for the lean index
|
|
6
|
+
(identifier, title, state, url). Run it to triage and pick a task.
|
|
7
|
+
- `<issues-full-file>` — path to a spilled JSON file containing full issue
|
|
8
|
+
detail (bodies + comments). `Read` that file (with `offset`/`limit` if it is
|
|
9
|
+
large) once you have picked an issue you want to act on.
|
|
10
|
+
|
|
11
|
+
Issue selection is already filtered to open Linear issues carrying the `otto`
|
|
12
|
+
label (override via `OTTO_LINEAR_LABEL`, narrow to a team via `OTTO_LINEAR_TEAM`).
|
|
13
|
+
|
|
14
|
+
You've also been passed a file containing the last few commits. Review these to
|
|
15
|
+
understand what work has been done.
|
|
16
|
+
|
|
17
|
+
If all AFK tasks are complete, output <promise>NO MORE TASKS</promise>.
|
|
18
|
+
|
|
19
|
+
# TASK SELECTION
|
|
20
|
+
|
|
21
|
+
Pick the next task. Prioritize tasks in this order:
|
|
22
|
+
|
|
23
|
+
1. Critical bugfixes
|
|
24
|
+
2. Development infrastructure
|
|
25
|
+
|
|
26
|
+
Getting development infrastructure like tests and types and dev scripts ready is an important precursor to building features.
|
|
27
|
+
|
|
28
|
+
3. Tracer bullets for new features
|
|
29
|
+
|
|
30
|
+
Tracer bullets are small slices of functionality that go through all layers of the system, allowing you to test and validate your approach early. This helps in identifying potential issues and ensures that the overall architecture is sound before investing significant time in development.
|
|
31
|
+
|
|
32
|
+
TL;DR - build a tiny, end-to-end slice of the feature first, then expand it out.
|
|
33
|
+
|
|
34
|
+
4. Polish and quick wins
|
|
35
|
+
5. Refactors
|
|
36
|
+
|
|
37
|
+
@include:ghprompt-workflow.md
|
|
38
|
+
|
|
39
|
+
@include:linear-completion.md
|