@warren-dean/code-kit 0.22.1 → 0.23.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +16 -0
- package/README.md +5 -4
- package/bin/code-kit.mjs +103 -77
- package/hooks/guard-bash.mjs +62 -17
- package/hooks/lib/checks.mjs +3 -1
- package/hooks/lib/config.mjs +13 -2
- package/hooks/lib/instructions.mjs +2 -1
- package/hooks/lib/next.mjs +26 -27
- package/hooks/lib/registry.mjs +70 -3
- package/hooks/lib/report.mjs +76 -7
- package/hooks/lib/rules.mjs +12 -4
- package/hooks/lib/verify.mjs +27 -8
- package/hooks/lib/worktrees.mjs +286 -0
- package/hooks/mod/decisions.mjs +27 -1
- package/hooks/mod/register.mjs +61 -10
- package/hooks/mod/register.test.ts +117 -2
- package/hooks/mod/view.mjs +10 -0
- package/hooks/session.mjs +20 -3
- package/package.json +1 -1
package/hooks/session.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// SessionStart and SessionEnd (docs/specs/23-the-team.md): a session starting is recorded as a member
|
|
3
|
-
// of the team, the lead session when no other live session leads (SESS-2)
|
|
4
|
-
//
|
|
3
|
+
// of the team, the lead session when no other live session leads (SESS-2), and the worktrees done with
|
|
4
|
+
// are pruned (docs/specs/20-lean-lead.md, LEAN-8); as it ends, it leads nothing more, and the lanes its
|
|
5
|
+
// agents had claimed are free again (SCHED-1). Its task stays, stale (SESS-4).
|
|
6
|
+
import { spawn } from 'node:child_process';
|
|
5
7
|
import { readFileSync } from 'node:fs';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
6
9
|
import { loadConfig } from './lib/config.mjs';
|
|
7
10
|
import { releaseSession } from './lib/laneclaims.mjs';
|
|
8
11
|
import { endSession, startSession } from './lib/sessions.mjs';
|
|
@@ -17,7 +20,21 @@ try {
|
|
|
17
20
|
const project = projectDir();
|
|
18
21
|
const { config } = loadConfig(project);
|
|
19
22
|
const session = input.session_id ?? null;
|
|
20
|
-
if (config && session && process.argv[2] === 'start')
|
|
23
|
+
if (config && session && process.argv[2] === 'start') {
|
|
24
|
+
startSession(project, session);
|
|
25
|
+
// LEAN-8: the worktrees left done with since the last session go, in the background: a project with
|
|
26
|
+
// many of them never holds up a session's start.
|
|
27
|
+
spawn(
|
|
28
|
+
process.execPath,
|
|
29
|
+
[
|
|
30
|
+
fileURLToPath(new URL('../bin/code-kit.mjs', import.meta.url)),
|
|
31
|
+
'worktrees',
|
|
32
|
+
'prune',
|
|
33
|
+
'--quiet',
|
|
34
|
+
],
|
|
35
|
+
{ cwd: project, detached: true, stdio: 'ignore' },
|
|
36
|
+
).unref();
|
|
37
|
+
}
|
|
21
38
|
if (config && session && process.argv[2] === 'end') {
|
|
22
39
|
endSession(project, session);
|
|
23
40
|
releaseSession(project, session);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warren-dean/code-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "Keeps AI coding agents inside your project's rules: lanes, layer rules, protected paths and proof before finish, enforced by Claude Code hooks and in CI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Warren Langeveldt",
|