@webappwiz/arbor 0.0.28 → 0.0.30
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/AGENTS.md +7 -0
- package/README.md +34 -12
- package/add.test.ts +125 -0
- package/add.ts +192 -0
- package/age.ts +11 -0
- package/arbor.test.ts +145 -0
- package/arbor.ts +429 -0
- package/assets.d.ts +9 -0
- package/attachments.ts +87 -0
- package/build.ts +98 -0
- package/claim.test.ts +89 -0
- package/claim.ts +73 -0
- package/components.json +21 -0
- package/config.ts +58 -0
- package/dev/api.ts +120 -0
- package/dev/app.test.tsx +645 -0
- package/dev/app.tsx +80 -0
- package/dev/assets.ts +16 -0
- package/dev/build/main.txt +68 -0
- package/dev/build/shell.txt +21 -0
- package/dev/build/styles.txt +2263 -0
- package/dev/components/ui/badge.tsx +51 -0
- package/dev/components/ui/button.tsx +57 -0
- package/dev/components/ui/dialog.tsx +154 -0
- package/dev/components/ui/empty.tsx +100 -0
- package/dev/components/ui/input-group.tsx +155 -0
- package/dev/components/ui/input.tsx +19 -0
- package/dev/components/ui/progress.tsx +80 -0
- package/dev/components/ui/textarea.tsx +17 -0
- package/dev/components/ui/toast.tsx +227 -0
- package/dev/feed.ts +69 -0
- package/dev/files.tsx +191 -0
- package/dev/index.html +21 -0
- package/dev/lib/utils.ts +7 -0
- package/dev/main.tsx +22 -0
- package/dev/markdown.test.tsx +133 -0
- package/dev/markdown.tsx +124 -0
- package/dev/mentions.tsx +319 -0
- package/dev/shadcn.css +649 -0
- package/dev/styles.css +107 -0
- package/dev/tags.tsx +44 -0
- package/dev/tasks.tsx +151 -0
- package/dev/todos.tsx +759 -0
- package/dev.test.ts +439 -0
- package/dev.ts +386 -0
- package/e2e.test.ts +256 -0
- package/escalate.test.ts +76 -0
- package/escalate.ts +112 -0
- package/exit.test.ts +71 -0
- package/exit.ts +74 -0
- package/git.ts +294 -0
- package/index.ts +9 -0
- package/journal.ts +89 -0
- package/list.test.ts +82 -0
- package/list.ts +137 -0
- package/load-config.test.ts +121 -0
- package/load-config.ts +62 -0
- package/log.test.ts +65 -0
- package/log.ts +40 -0
- package/merge.test.ts +332 -0
- package/merge.ts +283 -0
- package/package.json +32 -15
- package/path.test.ts +35 -0
- package/path.ts +38 -0
- package/plan.test.ts +318 -0
- package/plan.ts +302 -0
- package/progress.test.ts +54 -0
- package/progress.ts +31 -0
- package/remove.test.ts +68 -0
- package/remove.ts +88 -0
- package/repository.ts +83 -0
- package/retry.test.ts +43 -0
- package/retry.ts +48 -0
- package/shell.ts +44 -0
- package/show.test.ts +91 -0
- package/show.ts +151 -0
- package/snapshot.test.ts +33 -0
- package/snapshot.ts +84 -0
- package/table.ts +20 -0
- package/testing.ts +229 -0
- package/todo.test.ts +490 -0
- package/todo.ts +834 -0
- package/wait.test.ts +61 -0
- package/wait.ts +77 -0
- package/worktree-service.test.ts +158 -0
- package/worktree-service.ts +193 -0
- package/worktree.ts +239 -0
- package/add.d.ts +0 -23
- package/age.d.ts +0 -2
- package/arbor.d.ts +0 -11
- package/attachments.d.ts +0 -36
- package/claim.d.ts +0 -11
- package/config.d.ts +0 -55
- package/config.js +0 -7
- package/dev/assets.d.ts +0 -11
- package/dev.d.ts +0 -47
- package/escalate.d.ts +0 -28
- package/exit.d.ts +0 -42
- package/git.d.ts +0 -77
- package/index.d.ts +0 -2
- package/index.js +0 -4669
- package/journal.d.ts +0 -29
- package/list.d.ts +0 -18
- package/load-config.d.ts +0 -15
- package/log.d.ts +0 -14
- package/merge.d.ts +0 -24
- package/path.d.ts +0 -13
- package/plan.d.ts +0 -83
- package/remove.d.ts +0 -19
- package/repository.d.ts +0 -25
- package/retry.d.ts +0 -17
- package/shell.d.ts +0 -17
- package/show.d.ts +0 -53
- package/snapshot.d.ts +0 -31
- package/table.d.ts +0 -5
- package/todo.d.ts +0 -230
- package/wait.d.ts +0 -22
- package/worktree-service.d.ts +0 -51
- package/worktree.d.ts +0 -95
package/worktree-service.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { type Fs, type Ps } from "webappwiz/system";
|
|
2
|
-
import type { Config } from "./config.js";
|
|
3
|
-
import type { Git, GitResult } from "./git.js";
|
|
4
|
-
import { type TaskState, Worktree } from "./worktree.js";
|
|
5
|
-
export interface AddOptions {
|
|
6
|
-
/** Branch the new worktree starts from. Defaults to the trunk. */
|
|
7
|
-
base?: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Where tasks live and everything persistent about them: the worktree
|
|
11
|
-
* directories, the records under `.git/arbor/tasks`, and the names of tasks
|
|
12
|
-
* already removed. One name, one lookup, whatever state it turns out to be in.
|
|
13
|
-
*/
|
|
14
|
-
/** What a `WorktreeService` works through; the real ones by default. */
|
|
15
|
-
export interface WorktreeServiceOptions {
|
|
16
|
-
fs?: Fs;
|
|
17
|
-
ps?: Ps;
|
|
18
|
-
}
|
|
19
|
-
export declare class WorktreeService {
|
|
20
|
-
readonly git: Git;
|
|
21
|
-
readonly config: Config;
|
|
22
|
-
private readonly tasksDir;
|
|
23
|
-
private readonly removedDir;
|
|
24
|
-
private readonly fs;
|
|
25
|
-
readonly ps: Ps;
|
|
26
|
-
constructor(git: Git, config: Config, arborDir: string, opts?: WorktreeServiceOptions);
|
|
27
|
-
init(): Promise<void>;
|
|
28
|
-
get trunk(): string;
|
|
29
|
-
/** Where a task's worktree lives: a sibling of the repo, never inside it. */
|
|
30
|
-
pathFor(task: string): string;
|
|
31
|
-
branchFor(task: string): string;
|
|
32
|
-
taskFor(branch: string): string | null;
|
|
33
|
-
recordPath(task: string): string;
|
|
34
|
-
/** Always answers; the returned worktree's status says what was found. */
|
|
35
|
-
find(task: string): Promise<Worktree>;
|
|
36
|
-
list(): Promise<Worktree[]>;
|
|
37
|
-
/** Adds the branch and the working directory. The record comes after. */
|
|
38
|
-
add(task: string, { base }?: AddOptions): Promise<GitResult>;
|
|
39
|
-
discard(worktree: Worktree): Promise<GitResult>;
|
|
40
|
-
/** Writes a task's record. A concurrent reader sees the old one or the new. */
|
|
41
|
-
saveRecord(state: TaskState): Promise<void>;
|
|
42
|
-
private readRecord;
|
|
43
|
-
private removedPath;
|
|
44
|
-
private removedAt;
|
|
45
|
-
/**
|
|
46
|
-
* Remembers a removed name so a second `remove` can say "already removed"
|
|
47
|
-
* instead of "never existed", then drops the oldest so the list of
|
|
48
|
-
* remembered names cannot grow without bound.
|
|
49
|
-
*/
|
|
50
|
-
private rememberRemoved;
|
|
51
|
-
}
|
package/worktree.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { GitResult } from "./git.js";
|
|
2
|
-
import type { WorktreeService } from "./worktree-service.js";
|
|
3
|
-
/** The status a task's own record carries. */
|
|
4
|
-
export type RecordStatus = "working" | "merging" | "escalated";
|
|
5
|
-
/** What a task's record stores about who is driving it. */
|
|
6
|
-
export interface LeaseState {
|
|
7
|
-
pid: number;
|
|
8
|
-
hostname: string;
|
|
9
|
-
heartbeatAt: string;
|
|
10
|
-
}
|
|
11
|
-
export interface Escalation {
|
|
12
|
-
reason: string;
|
|
13
|
-
at: string;
|
|
14
|
-
/**
|
|
15
|
-
* For a task handed over to be approved rather than to answer questions,
|
|
16
|
-
* the question in its plan that asks for the approval, `4`.
|
|
17
|
-
*/
|
|
18
|
-
review?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface TaskState {
|
|
21
|
-
task: string;
|
|
22
|
-
branch: string;
|
|
23
|
-
worktree: string;
|
|
24
|
-
/** The branch this task lands on. Absent in old records: trunk. */
|
|
25
|
-
base?: string;
|
|
26
|
-
status: RecordStatus;
|
|
27
|
-
lease: LeaseState | null;
|
|
28
|
-
mergeAttempts: number;
|
|
29
|
-
createdAt: string;
|
|
30
|
-
updatedAt: string;
|
|
31
|
-
escalations?: Escalation[];
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Everything a name can turn out to be. The record's own status when the
|
|
35
|
-
* task is intact, and otherwise the way in which it is not.
|
|
36
|
-
*/
|
|
37
|
-
export type WorktreeStatus = RecordStatus | "absent" | "removed" | "orphaned" | "stray" | "unrecorded" | "unknown";
|
|
38
|
-
/** What the service found on disk. */
|
|
39
|
-
export interface WorktreeSnapshot {
|
|
40
|
-
task: string;
|
|
41
|
-
branch: string;
|
|
42
|
-
path: string;
|
|
43
|
-
state: TaskState | null;
|
|
44
|
-
exists: boolean;
|
|
45
|
-
hasBranch: boolean;
|
|
46
|
-
removedAt: string | null;
|
|
47
|
-
corrupt: boolean;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* One task, whether or not it is still there. Commands ask the service for
|
|
51
|
-
* one of these and read its status rather than assembling the same handful of
|
|
52
|
-
* existence checks themselves.
|
|
53
|
-
*/
|
|
54
|
-
export declare class Worktree {
|
|
55
|
-
private readonly service;
|
|
56
|
-
private readonly snapshot;
|
|
57
|
-
constructor(service: WorktreeService, snapshot: WorktreeSnapshot);
|
|
58
|
-
get task(): string;
|
|
59
|
-
get branch(): string;
|
|
60
|
-
/** Where this task's work lands: its recorded base branch, else trunk. */
|
|
61
|
-
get base(): string;
|
|
62
|
-
get path(): string;
|
|
63
|
-
get state(): TaskState | null;
|
|
64
|
-
get lease(): LeaseState | null;
|
|
65
|
-
get leaseHeld(): boolean;
|
|
66
|
-
get leaseStatus(): "held" | "stale" | "none";
|
|
67
|
-
get leaseOurs(): boolean;
|
|
68
|
-
get leaseHeldByOther(): boolean;
|
|
69
|
-
get mergeAttempts(): number;
|
|
70
|
-
get exists(): boolean;
|
|
71
|
-
get hasBranch(): boolean;
|
|
72
|
-
get removedAt(): string | null;
|
|
73
|
-
get status(): WorktreeStatus;
|
|
74
|
-
get gone(): boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Merges changes into the record and writes it. Works on a name that has no
|
|
77
|
-
* record yet, which is how `add` writes the first one and how `claim`
|
|
78
|
-
* rebuilds one from a worktree found on disk.
|
|
79
|
-
*/
|
|
80
|
-
save(changes?: Partial<TaskState>): Promise<Worktree>;
|
|
81
|
-
take(changes?: Partial<TaskState>): Promise<Worktree>;
|
|
82
|
-
/** Re-reads from disk. `merge` needs this: the record is the truth. */
|
|
83
|
-
reload(): Promise<Worktree>;
|
|
84
|
-
/** Removes the directory, the branch, and the record; remembers the name. */
|
|
85
|
-
discard(): Promise<GitResult>;
|
|
86
|
-
commitsAhead(): Promise<number | null>;
|
|
87
|
-
diffStat(): Promise<{
|
|
88
|
-
added: number;
|
|
89
|
-
removed: number;
|
|
90
|
-
} | null>;
|
|
91
|
-
/** Committed and uncommitted paths this task touches; null without a branch. */
|
|
92
|
-
changedFiles(): Promise<string[] | null>;
|
|
93
|
-
uncommitted(): Promise<string[]>;
|
|
94
|
-
interruptedOps(): Promise<string[]>;
|
|
95
|
-
}
|