trekoon 0.3.6 → 0.3.8
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/skills/trekoon/SKILL.md +198 -73
- package/.agents/skills/trekoon/reference/execution-with-team.md +9 -11
- package/.agents/skills/trekoon/reference/execution.md +26 -9
- package/.agents/skills/trekoon/reference/planning.md +48 -0
- package/README.md +39 -14
- package/docs/quickstart.md +21 -0
- package/package.json +1 -1
- package/src/board/assets/app.js +19 -25
- package/src/board/assets/components/Notice.js +18 -4
- package/src/board/assets/state/actions.js +6 -6
- package/src/board/assets/state/api.js +155 -31
- package/src/board/assets/state/store.js +38 -6
- package/src/board/assets/state/utils.js +123 -30
- package/src/board/routes.ts +397 -54
- package/src/board/server.ts +57 -4
- package/src/board/snapshot.ts +205 -173
- package/src/commands/board.ts +1 -1
- package/src/commands/events.ts +17 -11
- package/src/commands/quickstart.ts +10 -0
- package/src/commands/subtask.ts +2 -2
- package/src/domain/mutation-service.ts +452 -54
- package/src/domain/tracker-domain.ts +185 -7
- package/src/storage/migrations.ts +123 -0
- package/src/storage/path.ts +12 -1
- package/src/storage/schema.ts +18 -1
- package/src/storage/worktree-recovery.ts +12 -6
- package/src/sync/branch-db.ts +12 -1
- package/src/sync/event-writes.ts +47 -7
- package/src/sync/git-context.ts +10 -6
- package/src/sync/service.ts +759 -151
package/src/sync/git-context.ts
CHANGED
|
@@ -3,6 +3,10 @@ import { type Database } from "bun:sqlite";
|
|
|
3
3
|
import { resolveStoragePaths } from "../storage/path";
|
|
4
4
|
import { type GitContextSnapshot } from "./types";
|
|
5
5
|
|
|
6
|
+
export interface ResolvedGitContext extends GitContextSnapshot {
|
|
7
|
+
readonly persistedAt: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
function runGit(args: readonly string[], cwd: string): string | null {
|
|
7
11
|
const command = Bun.spawnSync({
|
|
8
12
|
cmd: ["git", ...args],
|
|
@@ -19,7 +23,7 @@ function runGit(args: readonly string[], cwd: string): string | null {
|
|
|
19
23
|
return output.length > 0 ? output : null;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
export function resolveGitContext(cwd: string):
|
|
26
|
+
export function resolveGitContext(cwd: string, persistedAt: number = Date.now()): ResolvedGitContext {
|
|
23
27
|
const storagePaths = resolveStoragePaths(cwd);
|
|
24
28
|
const branchName: string | null = runGit(["branch", "--show-current"], cwd);
|
|
25
29
|
const headSha: string | null = runGit(["rev-parse", "HEAD"], cwd);
|
|
@@ -28,11 +32,11 @@ export function resolveGitContext(cwd: string): GitContextSnapshot {
|
|
|
28
32
|
worktreePath: storagePaths.worktreeRoot,
|
|
29
33
|
branchName,
|
|
30
34
|
headSha,
|
|
35
|
+
persistedAt,
|
|
31
36
|
};
|
|
32
37
|
}
|
|
33
38
|
|
|
34
|
-
export function persistGitContext(db: Database, git: GitContextSnapshot): void {
|
|
35
|
-
const now: number = Date.now();
|
|
39
|
+
export function persistGitContext(db: Database, git: GitContextSnapshot, persistedAt: number = Date.now()): void {
|
|
36
40
|
|
|
37
41
|
db.query(
|
|
38
42
|
`
|
|
@@ -51,8 +55,8 @@ export function persistGitContext(db: Database, git: GitContextSnapshot): void {
|
|
|
51
55
|
@worktreePath,
|
|
52
56
|
@branchName,
|
|
53
57
|
@headSha,
|
|
54
|
-
@
|
|
55
|
-
@
|
|
58
|
+
@persistedAt,
|
|
59
|
+
@persistedAt,
|
|
56
60
|
1
|
|
57
61
|
)
|
|
58
62
|
ON CONFLICT(id) DO UPDATE SET
|
|
@@ -67,6 +71,6 @@ export function persistGitContext(db: Database, git: GitContextSnapshot): void {
|
|
|
67
71
|
"@worktreePath": git.worktreePath,
|
|
68
72
|
"@branchName": git.branchName,
|
|
69
73
|
"@headSha": git.headSha,
|
|
70
|
-
"@
|
|
74
|
+
"@persistedAt": persistedAt,
|
|
71
75
|
});
|
|
72
76
|
}
|