@nickmeriano/task 0.8.0 → 0.10.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 +137 -22
- package/dist/asks.test.d.ts +17 -0
- package/dist/asks.test.d.ts.map +1 -0
- package/dist/asks.test.js +278 -0
- package/dist/asks.test.js.map +1 -0
- package/dist/check.d.ts +3 -2
- package/dist/check.d.ts.map +1 -1
- package/dist/check.js +99 -60
- package/dist/check.js.map +1 -1
- package/dist/check.test.js +99 -60
- package/dist/check.test.js.map +1 -1
- package/dist/claim-io.d.ts +73 -0
- package/dist/claim-io.d.ts.map +1 -0
- package/dist/claim-io.js +344 -0
- package/dist/claim-io.js.map +1 -0
- package/dist/claim.d.ts +108 -23
- package/dist/claim.d.ts.map +1 -1
- package/dist/claim.js +320 -86
- package/dist/claim.js.map +1 -1
- package/dist/claim.test.d.ts +10 -2
- package/dist/claim.test.d.ts.map +1 -1
- package/dist/claim.test.js +282 -96
- package/dist/claim.test.js.map +1 -1
- package/dist/cli.js +346 -68
- package/dist/cli.js.map +1 -1
- package/dist/file-store.d.ts +70 -24
- package/dist/file-store.d.ts.map +1 -1
- package/dist/file-store.js +319 -141
- package/dist/file-store.js.map +1 -1
- package/dist/git-serve.d.ts +183 -0
- package/dist/git-serve.d.ts.map +1 -0
- package/dist/git-serve.js +503 -0
- package/dist/git-serve.js.map +1 -0
- package/dist/git-serve.test.d.ts +16 -0
- package/dist/git-serve.test.d.ts.map +1 -0
- package/dist/git-serve.test.js +183 -0
- package/dist/git-serve.test.js.map +1 -0
- package/dist/git.d.ts +65 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +114 -0
- package/dist/git.js.map +1 -0
- package/dist/id.d.ts +39 -0
- package/dist/id.d.ts.map +1 -0
- package/dist/id.js +67 -0
- package/dist/id.js.map +1 -0
- package/dist/inbox.d.ts +41 -0
- package/dist/inbox.d.ts.map +1 -0
- package/dist/inbox.js +56 -0
- package/dist/inbox.js.map +1 -0
- package/dist/overview.d.ts +9 -0
- package/dist/overview.d.ts.map +1 -1
- package/dist/overview.js +19 -11
- package/dist/overview.js.map +1 -1
- package/dist/overview.test.js +6 -5
- package/dist/overview.test.js.map +1 -1
- package/dist/promote.test.d.ts +3 -2
- package/dist/promote.test.d.ts.map +1 -1
- package/dist/promote.test.js +29 -31
- package/dist/promote.test.js.map +1 -1
- package/dist/publish.d.ts +2 -17
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +4 -49
- package/dist/publish.js.map +1 -1
- package/dist/search.d.ts +3 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +15 -2
- package/dist/search.js.map +1 -1
- package/dist/search.test.js +9 -9
- package/dist/search.test.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +218 -21
- package/dist/server.js.map +1 -1
- package/dist/store.d.ts +28 -14
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js.map +1 -1
- package/dist/store.test.js +88 -75
- package/dist/store.test.js.map +1 -1
- package/dist/ticket-doc.d.ts +26 -10
- package/dist/ticket-doc.d.ts.map +1 -1
- package/dist/ticket-doc.js +71 -27
- package/dist/ticket-doc.js.map +1 -1
- package/dist/types.d.ts +51 -17
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/skill/SKILL.md +96 -24
- package/src/asks.test.ts +355 -0
- package/src/check.test.ts +129 -72
- package/src/check.ts +101 -58
- package/src/claim-io.ts +401 -0
- package/src/claim.test.ts +372 -101
- package/src/claim.ts +418 -99
- package/src/cli.ts +370 -67
- package/src/file-store.ts +357 -145
- package/src/git-serve.test.ts +240 -0
- package/src/git-serve.ts +595 -0
- package/src/git.ts +141 -0
- package/src/id.ts +68 -0
- package/src/inbox.ts +77 -0
- package/src/overview.test.ts +6 -5
- package/src/overview.ts +25 -10
- package/src/promote.test.ts +40 -28
- package/src/publish.ts +6 -53
- package/src/search.test.ts +11 -11
- package/src/search.ts +17 -3
- package/src/server.ts +221 -19
- package/src/store.test.ts +95 -77
- package/src/store.ts +28 -13
- package/src/ticket-doc.ts +93 -30
- package/src/types.ts +52 -17
- package/ui/dist/assets/index-BjsorZOU.js +229 -0
- package/ui/dist/assets/index-CoKCUYic.css +1 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-BJmOsOdR.js +0 -229
- package/ui/dist/assets/index-BoqQlqSU.css +0 -1
package/dist/claim.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* (the implement-task skill, a human).
|
|
11
11
|
*/
|
|
12
12
|
import { type Store } from "./store.ts";
|
|
13
|
-
import type { ProjectConfig, Task } from "./types.ts";
|
|
13
|
+
import type { ProjectConfig, Status, Task } from "./types.ts";
|
|
14
14
|
/**
|
|
15
15
|
* The branch namespace claims live under when the board doesn't configure
|
|
16
16
|
* one. Deliberately vendor-neutral: repos whose workers are Claude Code cloud
|
|
@@ -22,17 +22,14 @@ import type { ProjectConfig, Task } from "./types.ts";
|
|
|
22
22
|
*/
|
|
23
23
|
export declare const DEFAULT_CLAIM_PREFIX = "task/claim/";
|
|
24
24
|
/**
|
|
25
|
-
* The board's
|
|
26
|
-
* `claims.branchPrefix`, falling back to the pre-0.8 top-level `claimPrefix`
|
|
27
|
-
* (still read for one release so a version bump can't strand in-flight
|
|
28
|
-
* claims; `task check` nags, `--fix` migrates). Exported for `task check`,
|
|
29
|
-
* which wants the raw value to lint without the throw below.
|
|
30
|
-
*/
|
|
31
|
-
export declare function configuredBranchPrefix(config: ProjectConfig): string | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* The board's claim namespace: configured branch prefix (a trailing slash is
|
|
25
|
+
* The board's claim namespace: `claims.branchPrefix` (a trailing slash is
|
|
34
26
|
* implied) or the default. Validated here because it becomes a git ref and an
|
|
35
27
|
* ls-remote glob — a malformed value must fail the claim, not corrupt it.
|
|
28
|
+
*
|
|
29
|
+
* The pre-0.8 top-level `claimPrefix` spelling is not honored — no consumers,
|
|
30
|
+
* no compat (TAS-41) — but silently *defaulting* over it would be worse than
|
|
31
|
+
* a shim: the board's committed lock convention would change under every
|
|
32
|
+
* worker at once. So its presence refuses, loudly, by name.
|
|
36
33
|
*/
|
|
37
34
|
export declare function claimNamespace(config: ProjectConfig): string;
|
|
38
35
|
/**
|
|
@@ -42,8 +39,8 @@ export declare function claimNamespace(config: ProjectConfig): string;
|
|
|
42
39
|
* Absent, unparseable or nonsensical values all mean "no cap".
|
|
43
40
|
*/
|
|
44
41
|
export declare function openClaimCap(root: string): number | undefined;
|
|
45
|
-
/** { prefix: "TAS" },
|
|
46
|
-
export declare function claimBranch(config: ProjectConfig,
|
|
42
|
+
/** { prefix: "TAS" }, "x7k4m" → "task/claim/tas-x7k4m" (or under the configured namespace). */
|
|
43
|
+
export declare function claimBranch(config: ProjectConfig, key: string): string;
|
|
47
44
|
/**
|
|
48
45
|
* Why a claim was refused: "claimed" (someone holds the branch — exit 1, pick
|
|
49
46
|
* the next ticket) vs "invalid" (the ticket or the tree isn't claimable —
|
|
@@ -59,6 +56,13 @@ export interface ClaimResult {
|
|
|
59
56
|
task: Task;
|
|
60
57
|
branch: string;
|
|
61
58
|
base: string;
|
|
59
|
+
/**
|
|
60
|
+
* Where the checkout was before the claim switched it — a branch name
|
|
61
|
+
* usually, a bare sha when HEAD was detached. The CLI uses it to warn a
|
|
62
|
+
* branch-pinned session that a plain claim just moved it off its assigned
|
|
63
|
+
* branch (the `--lock-only` case).
|
|
64
|
+
*/
|
|
65
|
+
previous: string;
|
|
62
66
|
}
|
|
63
67
|
export interface ClaimOptions {
|
|
64
68
|
/** Claim past the root board's `claims.maxOpenCount` cap. */
|
|
@@ -73,7 +77,37 @@ export interface ClaimOptions {
|
|
|
73
77
|
* someone pre-created without a claim commit can't be hijacked by a plain
|
|
74
78
|
* fast-forward. Leaves the winner checked out on the claim branch.
|
|
75
79
|
*/
|
|
76
|
-
export declare function claim(store: Store,
|
|
80
|
+
export declare function claim(store: Store, key: string, options?: ClaimOptions): ClaimResult;
|
|
81
|
+
export interface LockOnlyClaimResult {
|
|
82
|
+
task: Task;
|
|
83
|
+
branch: string;
|
|
84
|
+
base: string;
|
|
85
|
+
/** The checkout's branch at claim time, recorded in the flip commit's `delivered_by:` trailer. */
|
|
86
|
+
deliveredBy: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* `task claim <id> --lock-only`: mint the claim branch on origin without
|
|
90
|
+
* touching the checkout. For sessions pinned to a provisioned branch (a
|
|
91
|
+
* Claude web session, a CI job) the three roles plain `claim` bundles — the
|
|
92
|
+
* lock, the workspace, and the delivery branch — don't coincide: the session
|
|
93
|
+
* can't switch branches without breaking its harness contract, and working
|
|
94
|
+
* outside the lock is how two workers end up on the same ticket.
|
|
95
|
+
*
|
|
96
|
+
* So this takes just the lock: the `in_progress` flip commit is built against
|
|
97
|
+
* origin's default-branch tree in a temporary index (read-tree → hash-object →
|
|
98
|
+
* update-index → write-tree → commit-tree) and pushed with the same
|
|
99
|
+
* must-not-exist lease plain `claim` uses — the compare-and-swap is identical,
|
|
100
|
+
* only the checkout stays where it is (dirty or pinned, doesn't matter). The
|
|
101
|
+
* flip commit carries a `delivered_by: <branch>` trailer naming the checkout's
|
|
102
|
+
* branch, so a lock-only claim is legible state — anyone reading the claim
|
|
103
|
+
* branch sees where the work will actually land. Exit-code contract and
|
|
104
|
+
* `--release` behave exactly like plain claim.
|
|
105
|
+
*
|
|
106
|
+
* Validation reads the *base tree*, not the checkout: the commit is built on
|
|
107
|
+
* origin's default branch, and the pinned checkout's copy of the ticket may be
|
|
108
|
+
* stale or diverged — a promote that hasn't merged yet isn't claimable yet.
|
|
109
|
+
*/
|
|
110
|
+
export declare function claimLockOnly(store: Store, key: string, options?: ClaimOptions): LockOnlyClaimResult;
|
|
77
111
|
export interface ReleaseResult {
|
|
78
112
|
branch: string;
|
|
79
113
|
/** Whether a branch was actually there to delete, per side. */
|
|
@@ -85,11 +119,61 @@ export interface ReleaseResult {
|
|
|
85
119
|
* flip only ever existed as a commit on that branch, so deleting it *is* the
|
|
86
120
|
* revert — the default branch never saw in_progress.
|
|
87
121
|
*/
|
|
88
|
-
export declare function release(store: Store,
|
|
122
|
+
export declare function release(store: Store, key: string): ReleaseResult;
|
|
123
|
+
export interface SweptBranch {
|
|
124
|
+
branch: string;
|
|
125
|
+
/** Display id of the ticket the branch locks — for "missing", the id the branch name claims. */
|
|
126
|
+
ticket: string;
|
|
127
|
+
reason: "done" | "canceled" | "missing";
|
|
128
|
+
}
|
|
129
|
+
export interface SweepResult {
|
|
130
|
+
swept: SweptBranch[];
|
|
131
|
+
kept: {
|
|
132
|
+
branch: string;
|
|
133
|
+
ticket: string;
|
|
134
|
+
status: Status;
|
|
135
|
+
}[];
|
|
136
|
+
/**
|
|
137
|
+
* Branches under the claim namespace whose name the claim protocol could
|
|
138
|
+
* not have minted — no board's `<prefix>-`, or a segment that isn't a valid
|
|
139
|
+
* ticket key (pre-migration numeric claims like `tas-31`, hand-made
|
|
140
|
+
* branches). Deliberately never deleted: sweep's jurisdiction is exactly
|
|
141
|
+
* the branches `task claim` creates, and a name outside the scheme may be
|
|
142
|
+
* an open PR's head or someone's parked work. Reported so a human can
|
|
143
|
+
* clean them up knowingly.
|
|
144
|
+
*/
|
|
145
|
+
skipped: string[];
|
|
146
|
+
failed: {
|
|
147
|
+
branch: string;
|
|
148
|
+
error: string;
|
|
149
|
+
}[];
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* `task sweep`: for every claim branch on origin whose ticket is done,
|
|
153
|
+
* canceled, or missing on the current checkout, delete the branch — with the
|
|
154
|
+
* same deletion verification as `--release`, so a survivor is a failure, never
|
|
155
|
+
* a silent lie. This is the liveness half of the lock: environments that can't
|
|
156
|
+
* delete remote branches leave stale claims behind (`--release` there fails
|
|
157
|
+
* loudly rather than lying), and sweep, run from a runner that *can* delete
|
|
158
|
+
* (CI on push-to-main or cron, a laptop cron), heals them.
|
|
159
|
+
*
|
|
160
|
+
* Deliberately pure git and zero judgment — no vendor awareness, no agent in
|
|
161
|
+
* the loop — and scoped to exactly the branches the claim protocol mints:
|
|
162
|
+
* `<namespace><prefix>-<key>` with a valid ticket key. A branch under the
|
|
163
|
+
* namespace that doesn't fit the scheme (a pre-migration numeric claim, a
|
|
164
|
+
* hand-made branch) is *skipped and reported*, never deleted — it may be an
|
|
165
|
+
* open PR's head, and deleting what claiming didn't create isn't janitorial
|
|
166
|
+
* work, it's a judgment call. Within the scheme, the ticket's status on this
|
|
167
|
+
* checkout decides: done/canceled/missing → delete, anything live → keep.
|
|
168
|
+
* Boards are discovered repo-wide, the way `task serve` finds them, so one
|
|
169
|
+
* sweep covers every board's namespace.
|
|
170
|
+
*/
|
|
171
|
+
export declare function sweep(cwd: string): SweepResult;
|
|
89
172
|
/**
|
|
90
|
-
* The dispatcher's queue view: `todo` in position order, minus
|
|
91
|
-
*
|
|
92
|
-
*
|
|
173
|
+
* The dispatcher's queue view: `todo` in position order, minus blocked, minus
|
|
174
|
+
* tickets whose claim branch already exists on origin (one ls-remote for the
|
|
175
|
+
* whole namespace). The top entry is next up. Open asks don't exclude a
|
|
176
|
+
* ticket — see assertClaimable.
|
|
93
177
|
*/
|
|
94
178
|
export declare function claimableTasks(store: Store): Task[];
|
|
95
179
|
export interface PromoteResult {
|
|
@@ -100,13 +184,14 @@ export interface PromoteResult {
|
|
|
100
184
|
/**
|
|
101
185
|
* `task promote` — the human "build this" call, as a verb: `backlog` → `todo`.
|
|
102
186
|
* No quality gate: planning happens at claim time (the worker's plan tick),
|
|
103
|
-
* so a one-line backlog ticket is promotable.
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* `update` does; committing is
|
|
187
|
+
* so a one-line backlog ticket is promotable. Blockers are claim-time facts
|
|
188
|
+
* that `claim`/`--claimable` already enforce live, so promoting a blocked
|
|
189
|
+
* ticket is legitimate sequencing ("build this once NIC-11 lands") — reported
|
|
190
|
+
* as a hold, never refused. Open asks aren't a hold at all: they don't gate
|
|
191
|
+
* claiming, only done. Writes the ticket like `update` does; committing is
|
|
192
|
+
* the caller's job.
|
|
108
193
|
*/
|
|
109
|
-
export declare function promote(store: Store,
|
|
194
|
+
export declare function promote(store: Store, key: string): PromoteResult;
|
|
110
195
|
/**
|
|
111
196
|
* The boards `claim --next` and `list --claimable` select over, in priority
|
|
112
197
|
* order. Resolution: an explicit `--board` list > the root board's top-level
|
package/dist/claim.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../src/claim.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../src/claim.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAaH,OAAO,EAML,KAAK,KAAK,EACX,MAAM,YAAY,CAAA;AAGnB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAE7D;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,gBAAgB,CAAA;AAKjD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAgB5D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO7D;AAED,+FAA+F;AAC/F,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAA;gBACxB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS;CAIzD;AAWD,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,GAAG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