@telora/daemon-core 0.2.5
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/dist/activity-tracker.d.ts +69 -0
- package/dist/activity-tracker.d.ts.map +1 -0
- package/dist/activity-tracker.js +155 -0
- package/dist/activity-tracker.js.map +1 -0
- package/dist/api-client.d.ts +94 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +145 -0
- package/dist/api-client.js.map +1 -0
- package/dist/config.d.ts +117 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +348 -0
- package/dist/config.js.map +1 -0
- package/dist/engine.d.ts +120 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +18 -0
- package/dist/engine.js.map +1 -0
- package/dist/escalation-types.d.ts +31 -0
- package/dist/escalation-types.d.ts.map +1 -0
- package/dist/escalation-types.js +24 -0
- package/dist/escalation-types.js.map +1 -0
- package/dist/event-logger.d.ts +13 -0
- package/dist/event-logger.d.ts.map +1 -0
- package/dist/event-logger.js +82 -0
- package/dist/event-logger.js.map +1 -0
- package/dist/git.d.ts +39 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +72 -0
- package/dist/git.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/lifecycle.d.ts +104 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +192 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/log-manager.d.ts +83 -0
- package/dist/log-manager.d.ts.map +1 -0
- package/dist/log-manager.js +217 -0
- package/dist/log-manager.js.map +1 -0
- package/dist/otel-env.d.ts +29 -0
- package/dist/otel-env.d.ts.map +1 -0
- package/dist/otel-env.js +44 -0
- package/dist/otel-env.js.map +1 -0
- package/dist/resilience.d.ts +127 -0
- package/dist/resilience.d.ts.map +1 -0
- package/dist/resilience.js +300 -0
- package/dist/resilience.js.map +1 -0
- package/dist/resource-governor.d.ts +83 -0
- package/dist/resource-governor.d.ts.map +1 -0
- package/dist/resource-governor.js +184 -0
- package/dist/resource-governor.js.map +1 -0
- package/dist/spawn.d.ts +72 -0
- package/dist/spawn.d.ts.map +1 -0
- package/dist/spawn.js +82 -0
- package/dist/spawn.js.map +1 -0
- package/dist/stream-json.d.ts +885 -0
- package/dist/stream-json.d.ts.map +1 -0
- package/dist/stream-json.js +298 -0
- package/dist/stream-json.js.map +1 -0
- package/dist/token-usage.d.ts +67 -0
- package/dist/token-usage.d.ts.map +1 -0
- package/dist/token-usage.js +150 -0
- package/dist/token-usage.js.map +1 -0
- package/dist/transforms.d.ts +64 -0
- package/dist/transforms.d.ts.map +1 -0
- package/dist/transforms.js +78 -0
- package/dist/transforms.js.map +1 -0
- package/dist/unified-config.d.ts +62 -0
- package/dist/unified-config.d.ts.map +1 -0
- package/dist/unified-config.js +155 -0
- package/dist/unified-config.js.map +1 -0
- package/dist/workflow-types.d.ts +202 -0
- package/dist/workflow-types.d.ts.map +1 -0
- package/dist/workflow-types.js +15 -0
- package/dist/workflow-types.js.map +1 -0
- package/dist/worktree.d.ts +92 -0
- package/dist/worktree.d.ts.map +1 -0
- package/dist/worktree.js +221 -0
- package/dist/worktree.js.map +1 -0
- package/package.json +57 -0
package/dist/worktree.js
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared worktree operations for daemon and factory.
|
|
3
|
+
*
|
|
4
|
+
* Provides the common building blocks that both engines use for worktree
|
|
5
|
+
* lifecycle management: pruning, WIP commits, removal, existence checks,
|
|
6
|
+
* and creation. Engine-specific extensions (daemon's safety guards,
|
|
7
|
+
* merge-before-remove, orphan cleanup; factory's branch naming) live in
|
|
8
|
+
* their respective packages.
|
|
9
|
+
*/
|
|
10
|
+
import { existsSync, mkdirSync, rmSync } from 'node:fs';
|
|
11
|
+
import { join } from 'node:path';
|
|
12
|
+
import { runGit, branchExists } from './git.js';
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Prune
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
/**
|
|
17
|
+
* Prune stale worktree bookkeeping entries.
|
|
18
|
+
*
|
|
19
|
+
* Calls `git worktree prune` to clean up internal git state for worktrees
|
|
20
|
+
* whose directories no longer exist on disk. Both daemon and factory call
|
|
21
|
+
* this identically during startup and before worktree creation.
|
|
22
|
+
*/
|
|
23
|
+
export function pruneWorktrees(repoPath) {
|
|
24
|
+
const result = runGit(['worktree', 'prune'], repoPath);
|
|
25
|
+
if (result.success) {
|
|
26
|
+
console.log('[worktree] Pruned stale worktree entries');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// WIP commit
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
/**
|
|
33
|
+
* Commit all uncommitted changes in a worktree as a WIP safety commit.
|
|
34
|
+
*
|
|
35
|
+
* Stages everything (`git add -A`), commits with a WIP-prefixed message,
|
|
36
|
+
* and returns the resulting commit SHA. Returns `null` if the worktree
|
|
37
|
+
* does not exist, has no uncommitted changes, or if any git operation fails.
|
|
38
|
+
*
|
|
39
|
+
* @param worktreePath Absolute path to the worktree.
|
|
40
|
+
* @param label Human-readable context for the commit message
|
|
41
|
+
* (e.g. delivery name, blueprint name, instance ID).
|
|
42
|
+
* @returns Commit SHA if a WIP commit was created, `null` otherwise.
|
|
43
|
+
*/
|
|
44
|
+
export function commitWip(worktreePath, label) {
|
|
45
|
+
if (!existsSync(worktreePath)) {
|
|
46
|
+
console.warn(`[worktree] commitWip: worktree does not exist: ${worktreePath}`);
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
// Check for uncommitted changes (staged + unstaged + untracked)
|
|
50
|
+
const statusResult = runGit(['status', '--porcelain'], worktreePath);
|
|
51
|
+
if (!statusResult.success) {
|
|
52
|
+
console.warn(`[worktree] commitWip: git status failed: ${statusResult.error}`);
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
if (statusResult.output.length === 0) {
|
|
56
|
+
// Clean tree -- nothing to commit
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
// Stage everything
|
|
60
|
+
const addResult = runGit(['add', '-A'], worktreePath);
|
|
61
|
+
if (!addResult.success) {
|
|
62
|
+
console.warn(`[worktree] commitWip: failed to stage changes: ${addResult.error}`);
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
// Commit with WIP prefix
|
|
66
|
+
const commitResult = runGit(['commit', '-m', `WIP: ${label}`], worktreePath);
|
|
67
|
+
if (!commitResult.success) {
|
|
68
|
+
// May legitimately fail if staging resolved to no diff (e.g. only ignored files)
|
|
69
|
+
console.warn(`[worktree] commitWip: commit failed (may be empty): ${commitResult.error}`);
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
// Return the new HEAD sha
|
|
73
|
+
const hashResult = runGit(['rev-parse', 'HEAD'], worktreePath);
|
|
74
|
+
const sha = hashResult.success ? hashResult.output : null;
|
|
75
|
+
if (sha) {
|
|
76
|
+
console.log(`[worktree] WIP commit created: ${sha.slice(0, 8)} for "${label}"`);
|
|
77
|
+
}
|
|
78
|
+
return sha;
|
|
79
|
+
}
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
// Remove (base)
|
|
82
|
+
// ---------------------------------------------------------------------------
|
|
83
|
+
/**
|
|
84
|
+
* Remove a worktree directory and clean up git bookkeeping.
|
|
85
|
+
*
|
|
86
|
+
* This is the base removal operation shared by both engines. It handles:
|
|
87
|
+
* - Already-removed worktrees (just prune git state)
|
|
88
|
+
* - `git worktree remove --force` as the primary removal path
|
|
89
|
+
* - Fallback to `rmSync` if git removal fails
|
|
90
|
+
* - Final `git worktree prune` to clean up bookkeeping
|
|
91
|
+
*
|
|
92
|
+
* Engine-specific safety guards (daemon's unmerged-commit checks,
|
|
93
|
+
* merge-before-remove) are layered on top of this function.
|
|
94
|
+
*
|
|
95
|
+
* @param repoPath Absolute path to the main git repository.
|
|
96
|
+
* @param worktreePath Absolute path to the worktree to remove.
|
|
97
|
+
* @returns `true` if the worktree was removed (or already gone),
|
|
98
|
+
* `false` if removal failed.
|
|
99
|
+
*/
|
|
100
|
+
export function removeWorktreeBase(repoPath, worktreePath) {
|
|
101
|
+
try {
|
|
102
|
+
if (!existsSync(worktreePath)) {
|
|
103
|
+
console.log(`[worktree] Worktree already removed: ${worktreePath}`);
|
|
104
|
+
runGit(['worktree', 'prune'], repoPath);
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
// Attempt git-managed removal
|
|
108
|
+
const result = runGit(['worktree', 'remove', '--force', worktreePath], repoPath);
|
|
109
|
+
if (result.success) {
|
|
110
|
+
console.log(`[worktree] Removed worktree: ${worktreePath}`);
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
// Fallback: manual directory deletion
|
|
114
|
+
console.warn(`[worktree] git worktree remove failed: ${result.error}. ` +
|
|
115
|
+
`Falling back to manual cleanup.`);
|
|
116
|
+
if (existsSync(worktreePath)) {
|
|
117
|
+
rmSync(worktreePath, { recursive: true, force: true });
|
|
118
|
+
console.log(`[worktree] Manually removed worktree directory: ${worktreePath}`);
|
|
119
|
+
}
|
|
120
|
+
// Prune so git stops tracking the now-deleted directory
|
|
121
|
+
runGit(['worktree', 'prune'], repoPath);
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
console.error(`[worktree] Error removing worktree ${worktreePath}: `, err instanceof Error ? err.message : String(err));
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// ---------------------------------------------------------------------------
|
|
130
|
+
// Existence check
|
|
131
|
+
// ---------------------------------------------------------------------------
|
|
132
|
+
/**
|
|
133
|
+
* Check if a worktree is currently checked out for a given branch.
|
|
134
|
+
*
|
|
135
|
+
* Parses `git worktree list --porcelain` output and checks for a matching
|
|
136
|
+
* `branch refs/heads/{branchName}` entry.
|
|
137
|
+
*
|
|
138
|
+
* @param branchName Branch name to search for (e.g. `agent/dev/my-feature`).
|
|
139
|
+
* @param repoPath Absolute path to the main git repository.
|
|
140
|
+
* @returns `true` if a worktree is attached to the branch.
|
|
141
|
+
*/
|
|
142
|
+
export function worktreeExistsForBranch(branchName, repoPath) {
|
|
143
|
+
const result = runGit(['worktree', 'list', '--porcelain'], repoPath);
|
|
144
|
+
if (!result.success) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
return result.output.includes(`branch refs/heads/${branchName}`);
|
|
148
|
+
}
|
|
149
|
+
// ---------------------------------------------------------------------------
|
|
150
|
+
// Create (base)
|
|
151
|
+
// ---------------------------------------------------------------------------
|
|
152
|
+
/**
|
|
153
|
+
* Create a worktree with an isolated branch.
|
|
154
|
+
*
|
|
155
|
+
* This is the shared worktree creation logic used by both engines:
|
|
156
|
+
* 1. Ensure the parent `worktreeDir` exists
|
|
157
|
+
* 2. Remove any existing directory at the target path (clean start)
|
|
158
|
+
* 3. Prune stale worktree entries
|
|
159
|
+
* 4. Remove any lingering worktree registration for the branch
|
|
160
|
+
* 5. Create the worktree using the existing branch or a new branch
|
|
161
|
+
*
|
|
162
|
+
* The `baseBranch` parameter controls what the new branch forks from:
|
|
163
|
+
* - Daemon passes the integration branch
|
|
164
|
+
* - Factory omits it (forks from HEAD of the default branch)
|
|
165
|
+
*
|
|
166
|
+
* @param repoPath Absolute path to the main git repository.
|
|
167
|
+
* @param worktreeDir Parent directory for worktrees
|
|
168
|
+
* (e.g. `.telora/worktrees/` or `.telora/factory-worktrees/`).
|
|
169
|
+
* @param branchName Full branch name (e.g. `agent/dev/feat-abc12345`
|
|
170
|
+
* or `factory/my-blueprint-a1b2c3d4`).
|
|
171
|
+
* @param baseBranch Branch to fork from when creating a new branch.
|
|
172
|
+
* If omitted, `git worktree add -b` forks from HEAD.
|
|
173
|
+
* @returns The worktree path and whether a new branch was created.
|
|
174
|
+
* @throws If the worktree cannot be created.
|
|
175
|
+
*/
|
|
176
|
+
export function createWorktreeBase(repoPath, worktreeDir, branchName, baseBranch) {
|
|
177
|
+
// Ensure the parent worktree directory exists
|
|
178
|
+
if (!existsSync(worktreeDir)) {
|
|
179
|
+
mkdirSync(worktreeDir, { recursive: true });
|
|
180
|
+
console.log(`[worktree] Created worktree directory: ${worktreeDir}`);
|
|
181
|
+
}
|
|
182
|
+
// Derive a filesystem-safe subdirectory name from the branch
|
|
183
|
+
const safeName = branchName.replace(/\//g, '-');
|
|
184
|
+
const worktreePath = join(worktreeDir, safeName);
|
|
185
|
+
// If the target directory already exists, remove it to start clean
|
|
186
|
+
if (existsSync(worktreePath)) {
|
|
187
|
+
console.log(`[worktree] Removing existing worktree directory: ${worktreePath}`);
|
|
188
|
+
rmSync(worktreePath, { recursive: true, force: true });
|
|
189
|
+
}
|
|
190
|
+
// Prune stale worktree entries
|
|
191
|
+
runGit(['worktree', 'prune'], repoPath);
|
|
192
|
+
// If git still tracks a worktree for this branch after pruning, remove it
|
|
193
|
+
if (worktreeExistsForBranch(branchName, repoPath)) {
|
|
194
|
+
console.log(`[worktree] Removing stale worktree entry for branch: ${branchName}`);
|
|
195
|
+
runGit(['worktree', 'remove', '--force', branchName], repoPath);
|
|
196
|
+
}
|
|
197
|
+
// Determine if the branch already exists
|
|
198
|
+
const branchAlreadyExists = branchExists(branchName, repoPath);
|
|
199
|
+
if (branchAlreadyExists) {
|
|
200
|
+
// Use existing branch
|
|
201
|
+
console.log(`[worktree] Creating worktree from existing branch: ${branchName}`);
|
|
202
|
+
const result = runGit(['worktree', 'add', worktreePath, branchName], repoPath);
|
|
203
|
+
if (!result.success) {
|
|
204
|
+
throw new Error(`Failed to create worktree from existing branch: ${result.error}`);
|
|
205
|
+
}
|
|
206
|
+
return { worktreePath, created: false };
|
|
207
|
+
}
|
|
208
|
+
// Create new branch (optionally forked from baseBranch)
|
|
209
|
+
const args = ['worktree', 'add', '-b', branchName, worktreePath];
|
|
210
|
+
if (baseBranch) {
|
|
211
|
+
args.push(baseBranch);
|
|
212
|
+
}
|
|
213
|
+
console.log(`[worktree] Creating worktree with new branch: ${branchName}` +
|
|
214
|
+
(baseBranch ? ` from ${baseBranch}` : ''));
|
|
215
|
+
const result = runGit(args, repoPath);
|
|
216
|
+
if (!result.success) {
|
|
217
|
+
throw new Error(`Failed to create worktree with new branch: ${result.error}`);
|
|
218
|
+
}
|
|
219
|
+
return { worktreePath, created: true };
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=worktree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree.js","sourceRoot":"","sources":["../src/worktree.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAchD,8EAA8E;AAC9E,QAAQ;AACR,8EAA8E;AAE9E;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;IACvD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC;AAED,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,SAAS,CAAC,YAAoB,EAAE,KAAa;IAC3D,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,IAAI,CAAC,kDAAkD,YAAY,EAAE,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gEAAgE;IAChE,MAAM,YAAY,G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C,UAAU,CAAC,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAC1C,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,8CAA8C,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACzC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@telora/daemon-core",
|
|
3
|
+
"version": "0.2.5",
|
|
4
|
+
"description": "Shared core infrastructure for Telora daemon and factory - resilience, API client, config, git operations",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "tsc --watch",
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"clean": "rm -rf dist",
|
|
22
|
+
"lint": "eslint .",
|
|
23
|
+
"test": "npx tsx --test src/__tests__/*.test.ts",
|
|
24
|
+
"typecheck": "tsc --noEmit"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"zod": "^4.3.6"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^22.12.0",
|
|
31
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
32
|
+
"eslint-plugin-import-x": "^4.16.1",
|
|
33
|
+
"tsx": "^4.19.2",
|
|
34
|
+
"typescript": "^5.7.3"
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=20"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"telora",
|
|
41
|
+
"daemon-core",
|
|
42
|
+
"resilience",
|
|
43
|
+
"api-client",
|
|
44
|
+
"infrastructure"
|
|
45
|
+
],
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/syntelyos/telora.git",
|
|
49
|
+
"directory": "packages/daemon-core"
|
|
50
|
+
},
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"author": "Syntelyos",
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public",
|
|
55
|
+
"registry": "https://registry.npmjs.org/"
|
|
56
|
+
}
|
|
57
|
+
}
|