engineering-memory 1.11.4 → 1.11.6
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/dispatcher/sections.mjs +2 -0
- package/package.json +29 -29
- package/runtime/dist/src/config.js +2 -0
- package/runtime/dist/src/git/git-inspector.js +41 -2
- package/runtime/dist/src/git/verification-gate.js +40 -1
- package/runtime/dist/src/index.js +15 -1
- package/runtime/dist/src/mcp/onboarding-tools.js +39 -1
- package/runtime/dist/src/mcp/server.js +2 -0
- package/runtime/dist/src/mcp/tool-definitions.js +13 -10
- package/runtime/dist/src/mcp/worktree-tools.js +455 -0
- package/runtime/dist/src/project/project-intake.js +9 -2
- package/runtime/dist/src/runtime/api-client.js +4 -0
- package/runtime/dist/src/runtime/branch-preferences.js +53 -0
- package/runtime/dist/src/runtime/bridge-service.js +398 -13
- package/runtime/dist/src/runtime/task-branch-store.js +1 -1
- package/runtime/dist/src/runtime/worktree-policy.js +37 -0
- package/runtime/dist/src/runtime/worktree-pool.js +905 -0
- package/runtime/dist/src/utilities/local-mutex.js +37 -0
- package/skill/SKILL.md +1 -1
- package/skill/references/lifecycle.md +52 -4
- package/skill/references/project-onboarding.md +4 -0
- package/skill/references/questionnaires.md +21 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { readJson, writeJson } from '../utilities/files.js';
|
|
3
|
+
import { BridgeRecoveryError } from './recovery-error.js';
|
|
4
|
+
export function validWorktreePolicy(value) {
|
|
5
|
+
const p = value;
|
|
6
|
+
return Boolean(p &&
|
|
7
|
+
Number.isSafeInteger(p.version) &&
|
|
8
|
+
p.version >= 1 &&
|
|
9
|
+
Number.isSafeInteger(p.maxWorktrees) &&
|
|
10
|
+
p.maxWorktrees >= 1 &&
|
|
11
|
+
p.maxWorktrees <= 500 &&
|
|
12
|
+
Number.isSafeInteger(p.heartbeatSeconds) &&
|
|
13
|
+
p.heartbeatSeconds >= 5 &&
|
|
14
|
+
p.heartbeatSeconds <= 300 &&
|
|
15
|
+
Number.isSafeInteger(p.inactivitySeconds) &&
|
|
16
|
+
p.inactivitySeconds >= 60 &&
|
|
17
|
+
p.inactivitySeconds <= 86400 &&
|
|
18
|
+
p.inactivitySeconds >= p.heartbeatSeconds * 2);
|
|
19
|
+
}
|
|
20
|
+
export class WorktreePolicyCache {
|
|
21
|
+
stateRoot;
|
|
22
|
+
constructor(stateRoot) {
|
|
23
|
+
this.stateRoot = stateRoot;
|
|
24
|
+
}
|
|
25
|
+
async save(policy) {
|
|
26
|
+
if (!validWorktreePolicy(policy))
|
|
27
|
+
throw new BridgeRecoveryError('The backend returned an invalid worktree policy.', 'worktree.policy');
|
|
28
|
+
await writeJson(join(this.stateRoot, 'worktree-policy.json'), policy, this.stateRoot);
|
|
29
|
+
}
|
|
30
|
+
async read() {
|
|
31
|
+
const value = await readJson(join(this.stateRoot, 'worktree-policy.json'), this.stateRoot);
|
|
32
|
+
if (!validWorktreePolicy(value))
|
|
33
|
+
throw new BridgeRecoveryError('No valid cached worktree policy exists. Read worktree.policy while connected before allocating a worktree.', 'worktree.policy');
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=worktree-policy.js.map
|