instar 1.0.13 → 1.1.1

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.
Files changed (70) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +52 -2
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/init.d.ts +17 -0
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +156 -64
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/server.d.ts.map +1 -1
  9. package/dist/commands/server.js +68 -4
  10. package/dist/commands/server.js.map +1 -1
  11. package/dist/commands/setup.d.ts +3 -1
  12. package/dist/commands/setup.d.ts.map +1 -1
  13. package/dist/commands/setup.js +67 -28
  14. package/dist/commands/setup.js.map +1 -1
  15. package/dist/commands/worktree.d.ts +17 -4
  16. package/dist/commands/worktree.d.ts.map +1 -1
  17. package/dist/commands/worktree.js +28 -4
  18. package/dist/commands/worktree.js.map +1 -1
  19. package/dist/core/AgentWorktreeDetector.d.ts +63 -0
  20. package/dist/core/AgentWorktreeDetector.d.ts.map +1 -0
  21. package/dist/core/AgentWorktreeDetector.js +329 -0
  22. package/dist/core/AgentWorktreeDetector.js.map +1 -0
  23. package/dist/core/InstarWorktreeManager.d.ts +99 -0
  24. package/dist/core/InstarWorktreeManager.d.ts.map +1 -0
  25. package/dist/core/InstarWorktreeManager.js +447 -0
  26. package/dist/core/InstarWorktreeManager.js.map +1 -0
  27. package/dist/core/MachineIdentity.d.ts.map +1 -1
  28. package/dist/core/MachineIdentity.js +2 -0
  29. package/dist/core/MachineIdentity.js.map +1 -1
  30. package/dist/core/PostUpdateMigrator.d.ts +25 -0
  31. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  32. package/dist/core/PostUpdateMigrator.js +258 -0
  33. package/dist/core/PostUpdateMigrator.js.map +1 -1
  34. package/dist/memory/NativeModuleHealer.d.ts +15 -0
  35. package/dist/memory/NativeModuleHealer.d.ts.map +1 -1
  36. package/dist/memory/NativeModuleHealer.js +22 -0
  37. package/dist/memory/NativeModuleHealer.js.map +1 -1
  38. package/dist/monitoring/NativeHealDegradationBridge.d.ts +32 -0
  39. package/dist/monitoring/NativeHealDegradationBridge.d.ts.map +1 -0
  40. package/dist/monitoring/NativeHealDegradationBridge.js +61 -0
  41. package/dist/monitoring/NativeHealDegradationBridge.js.map +1 -0
  42. package/dist/monitoring/PromptGate.d.ts +12 -0
  43. package/dist/monitoring/PromptGate.d.ts.map +1 -1
  44. package/dist/monitoring/PromptGate.js +44 -0
  45. package/dist/monitoring/PromptGate.js.map +1 -1
  46. package/dist/scaffold/templates.d.ts.map +1 -1
  47. package/dist/scaffold/templates.js +17 -0
  48. package/dist/scaffold/templates.js.map +1 -1
  49. package/dist/server/AgentServer.d.ts.map +1 -1
  50. package/dist/server/AgentServer.js +6 -0
  51. package/dist/server/AgentServer.js.map +1 -1
  52. package/package.json +1 -1
  53. package/scripts/lint-no-direct-destructive.js +7 -0
  54. package/scripts/resolve-release-tier.mjs +192 -0
  55. package/src/data/builtin-manifest.json +57 -49
  56. package/src/scaffold/templates.ts +17 -0
  57. package/src/templates/scripts/instar-watchdog.sh +169 -6
  58. package/src/templates/scripts/instar-worktree-create.sh +79 -0
  59. package/upgrades/1.1.0.md +320 -0
  60. package/upgrades/1.1.1.md +58 -0
  61. package/upgrades/side-effects/agent-worktree-convention-layer-1-2-5.md +280 -0
  62. package/upgrades/side-effects/agent-worktree-convention-layer-3-4.md +285 -0
  63. package/upgrades/side-effects/feat-fix-parent-framework-intercept.md +59 -0
  64. package/upgrades/side-effects/feat-install-claude-gating.md +67 -0
  65. package/upgrades/side-effects/feat-install-framework-flag.md +65 -0
  66. package/upgrades/side-effects/feat-portability-shadow-capabilities.md +63 -0
  67. package/upgrades/side-effects/feat-setup-framework-flag.md +65 -0
  68. package/upgrades/side-effects/lockdown-layer-2.md +123 -0
  69. package/upgrades/side-effects/native-heal-degradation-bridge.md +206 -0
  70. package/upgrades/side-effects/watchdog-bind-failure-probe.md +174 -0
@@ -0,0 +1,329 @@
1
+ // safe-git-allow: detector reads worktree list against a pre-validated
2
+ // instar repo via execFileSync. SafeGitExecutor.readSync would invoke
3
+ // the source-tree guard which refuses operations targeting the instar
4
+ // source tree — exactly the path the detector is here to inspect. The
5
+ // call is bounded (read-only verb, fixed args, 2s timeout, validated
6
+ // repo path) so direct execFileSync is the right level here.
7
+ /**
8
+ * AgentWorktreeDetector — Layer 4 of the agent worktree convention.
9
+ *
10
+ * Runs once per agent startup as part of the lifeline health-check surface.
11
+ * Inspects the canonical instar repo's worktree list and emits an
12
+ * AttentionItem (or, when no Telegram adapter is configured, appends to a
13
+ * dedicated JSONL fallback) for every worktree that lives outside an
14
+ * agent's `<agent_home>/.worktrees/` area.
15
+ *
16
+ * Signal-only by design. Never blocks, never moves, never deletes. The
17
+ * operator decides what to do with each surfaced item — `git worktree
18
+ * move` to the safe location or accept the residual.
19
+ *
20
+ * Spec: docs/specs/AGENT-WORKTREE-CONVENTION-SPEC.md §"Layer 4 — Lifeline
21
+ * detector (in v1, signal only)".
22
+ *
23
+ * Signal vs authority: the detector's only decision rule is path-based
24
+ * (`worktree_path` starts with `realpath(<agent_home>/.worktrees)` for
25
+ * some registered agent). The audit ledger from Layer 1 is **not**
26
+ * consumed as an allowlist — the rule lives here and only here, so future
27
+ * maintainers can't drift it into ledger-membership.
28
+ */
29
+ import { execFileSync } from 'node:child_process';
30
+ import fs from 'node:fs';
31
+ import os from 'node:os';
32
+ import path from 'node:path';
33
+ import { resolveInstarRepo, worktreeDedupeKey } from './InstarWorktreeManager.js';
34
+ import { loadRegistry } from './AgentRegistry.js';
35
+ // ── Helpers ──────────────────────────────────────────────────────────────
36
+ const DEFAULT_GIT_TIMEOUT_MS = 2000;
37
+ const DEDUPE_WINDOW_MS = 24 * 60 * 60 * 1000;
38
+ const AUDIT_DIR_NAME = 'audit';
39
+ const FALLBACK_BASENAME = 'worktree-detector.jsonl';
40
+ function realpathOrInput(p) {
41
+ try {
42
+ return fs.realpathSync(p);
43
+ }
44
+ catch {
45
+ // @silent-fallback-ok — git's worktree list reports stale entries; we
46
+ // return the raw path so the caller's filter (existsSync below) can
47
+ // classify them as stale and skip them.
48
+ return p;
49
+ }
50
+ }
51
+ function parseWorktreeListPorcelain(output) {
52
+ // Format:
53
+ // worktree /abs/path
54
+ // HEAD <sha> | branch <ref>
55
+ // [bare]
56
+ // <blank>
57
+ // Each record ends with a blank line; the last record may not.
58
+ const entries = [];
59
+ const lines = output.split('\n');
60
+ let current = null;
61
+ for (const line of lines) {
62
+ if (line.startsWith('worktree ')) {
63
+ if (current)
64
+ entries.push(current);
65
+ current = { path: line.slice('worktree '.length).trim(), bare: false };
66
+ }
67
+ else if (line.trim() === 'bare' && current) {
68
+ current.bare = true;
69
+ }
70
+ else if (line.trim() === '' && current) {
71
+ entries.push(current);
72
+ current = null;
73
+ }
74
+ }
75
+ if (current)
76
+ entries.push(current);
77
+ return entries;
78
+ }
79
+ function isUnderAnySafeRoot(worktreeReal, safeRoots) {
80
+ for (const root of safeRoots) {
81
+ const rootWithSep = root.endsWith(path.sep) ? root : root + path.sep;
82
+ if (worktreeReal === root || worktreeReal.startsWith(rootWithSep))
83
+ return true;
84
+ }
85
+ return false;
86
+ }
87
+ function appendFallback(fallbackPath, line) {
88
+ const dir = path.dirname(fallbackPath);
89
+ fs.mkdirSync(dir, { recursive: true });
90
+ const flags = fs.constants.O_APPEND | fs.constants.O_CREAT | fs.constants.O_WRONLY |
91
+ fs.constants.O_NOFOLLOW;
92
+ let fd;
93
+ try {
94
+ fd = fs.openSync(fallbackPath, flags, 0o600);
95
+ }
96
+ catch (err) {
97
+ const e = err;
98
+ if (e.code === 'ELOOP') {
99
+ throw new Error(`detector fallback: ${fallbackPath} is a symlink — refused`);
100
+ }
101
+ throw err;
102
+ }
103
+ try {
104
+ const st = fs.fstatSync(fd);
105
+ const euid = process.geteuid?.() ?? -1;
106
+ if (euid !== -1 && st.uid !== euid) {
107
+ throw new Error(`detector fallback: ${fallbackPath} owner uid ${st.uid} != euid ${euid}`);
108
+ }
109
+ if ((st.mode & 0o077) !== 0) {
110
+ throw new Error(`detector fallback: ${fallbackPath} mode 0${(st.mode & 0o777).toString(8)} grants group/other access`);
111
+ }
112
+ fs.writeSync(fd, JSON.stringify(line) + '\n');
113
+ }
114
+ finally {
115
+ fs.closeSync(fd);
116
+ }
117
+ }
118
+ function readRecentDedupeKeys(fallbackPath) {
119
+ if (!fs.existsSync(fallbackPath))
120
+ return new Set();
121
+ const keys = new Set();
122
+ const cutoff = Date.now() - DEDUPE_WINDOW_MS;
123
+ let content;
124
+ try {
125
+ content = fs.readFileSync(fallbackPath, 'utf-8');
126
+ }
127
+ catch {
128
+ // @silent-fallback-ok — unreadable fallback file means we lose dedupe
129
+ // for this run, which is acceptable (worst case: a duplicate JSONL
130
+ // line for an outage event). Returning empty Set is the safe fallback.
131
+ return keys;
132
+ }
133
+ for (const line of content.split('\n')) {
134
+ if (!line.trim())
135
+ continue;
136
+ try {
137
+ const parsed = JSON.parse(line);
138
+ if (!parsed.dedupeKey || !parsed.ts)
139
+ continue;
140
+ const ts = Date.parse(parsed.ts);
141
+ if (Number.isNaN(ts) || ts < cutoff)
142
+ continue;
143
+ keys.add(parsed.dedupeKey);
144
+ }
145
+ catch {
146
+ // @silent-fallback-ok — tolerate torn last line per spec; skip it.
147
+ }
148
+ }
149
+ return keys;
150
+ }
151
+ // ── Detector entrypoint ──────────────────────────────────────────────────
152
+ export async function runDetection(opts) {
153
+ const result = {
154
+ enumerated: 0,
155
+ skipped: 0,
156
+ emitted: 0,
157
+ deduped: 0,
158
+ timedOut: false,
159
+ };
160
+ let output;
161
+ try {
162
+ // safe-git-allow: detector reads worktree list against a pre-validated
163
+ // instar repo; SafeGitExecutor.readSync would also work but adds the
164
+ // source-tree check (which would refuse the very repo we're inspecting).
165
+ // The repo path is validated by the caller via resolveInstarRepo.
166
+ output = execFileSync('git', ['-C', opts.instarRepo, 'worktree', 'list', '--porcelain'], {
167
+ encoding: 'utf-8',
168
+ stdio: ['ignore', 'pipe', 'pipe'],
169
+ timeout: opts.gitTimeoutMs ?? DEFAULT_GIT_TIMEOUT_MS,
170
+ }).trim();
171
+ }
172
+ catch (err) {
173
+ const e = err;
174
+ if (e.signal === 'SIGTERM' || e.code === 'ETIMEDOUT') {
175
+ result.timedOut = true;
176
+ // Surface a single attention item so the timeout is observable.
177
+ await emitOrFallback({
178
+ id: 'worktree-detector-timeout',
179
+ title: 'Worktree detector skipped',
180
+ summary: `git worktree list against ${opts.instarRepo} did not return within ${opts.gitTimeoutMs ?? DEFAULT_GIT_TIMEOUT_MS}ms`,
181
+ category: 'worktree-misplaced',
182
+ priority: 'LOW',
183
+ sourceContext: opts.instarRepo,
184
+ }, opts, result, true);
185
+ return result;
186
+ }
187
+ throw err;
188
+ }
189
+ const entries = parseWorktreeListPorcelain(output);
190
+ result.enumerated = entries.length;
191
+ const instarRepoReal = realpathOrInput(opts.instarRepo);
192
+ const safeRootsReal = opts.safeRoots.map((r) => realpathOrInput(r));
193
+ for (const entry of entries) {
194
+ const entryReal = realpathOrInput(entry.path);
195
+ // Skip the main checkout entry.
196
+ if (entryReal === instarRepoReal) {
197
+ result.skipped++;
198
+ continue;
199
+ }
200
+ // Skip bare entries.
201
+ if (entry.bare) {
202
+ result.skipped++;
203
+ continue;
204
+ }
205
+ // Skip stale (no longer on disk).
206
+ if (!fs.existsSync(entry.path)) {
207
+ result.skipped++;
208
+ continue;
209
+ }
210
+ // Properly-placed under some agent home — skip.
211
+ if (isUnderAnySafeRoot(entryReal, safeRootsReal)) {
212
+ result.skipped++;
213
+ continue;
214
+ }
215
+ const dedupeKey = worktreeDedupeKey(entryReal);
216
+ await emitOrFallback({
217
+ id: dedupeKey,
218
+ title: 'Worktree placed outside agent home',
219
+ summary: `${entryReal} is not inside any registered agent's .worktrees/ — sandbox-revoke risk.`,
220
+ description: 'Per docs/specs/AGENT-WORKTREE-CONVENTION-SPEC.md, worktrees of the shared instar repo should live at <agent_home>/.worktrees/<slug>/. ' +
221
+ 'Use `instar worktree create <branch>` for new worktrees, or `git worktree move <old> <new>` to relocate this one. ' +
222
+ 'The detector does not move or delete anything.',
223
+ category: 'worktree-misplaced',
224
+ priority: 'LOW',
225
+ sourceContext: entryReal,
226
+ }, opts, result, false);
227
+ }
228
+ return result;
229
+ }
230
+ async function emitOrFallback(item, opts, result, skipDedupe) {
231
+ if (opts.emitAttention) {
232
+ // AttentionQueue owns dedupe via item.id collision.
233
+ await opts.emitAttention(item);
234
+ result.emitted++;
235
+ return;
236
+ }
237
+ const fallbackPath = opts.fallbackPath ?? path.join(opts.stateDir, AUDIT_DIR_NAME, FALLBACK_BASENAME);
238
+ if (!skipDedupe) {
239
+ const recent = readRecentDedupeKeys(fallbackPath);
240
+ if (recent.has(item.id)) {
241
+ result.deduped++;
242
+ return;
243
+ }
244
+ }
245
+ appendFallback(fallbackPath, {
246
+ ts: new Date().toISOString(),
247
+ dedupeKey: item.id,
248
+ category: item.category,
249
+ priority: item.priority,
250
+ title: item.title,
251
+ summary: item.summary,
252
+ description: item.description,
253
+ sourceContext: item.sourceContext,
254
+ });
255
+ result.emitted++;
256
+ }
257
+ // ── Public helper: enumerate safe roots from the registry ────────────────
258
+ export function enumerateSafeRoots() {
259
+ const roots = [];
260
+ const instarHome = path.join(os.homedir(), '.instar');
261
+ for (const entry of loadRegistry().entries) {
262
+ // Only agents that live under ~/.instar/agents/<name>/ qualify — those
263
+ // are the ones the convention applies to. Project-bound agents have
264
+ // worktrees in the project dir, which the lifeline detector doesn't
265
+ // police.
266
+ const candidate = path.join(instarHome, 'agents', entry.name, '.worktrees');
267
+ try {
268
+ const real = fs.realpathSync(candidate);
269
+ roots.push(real);
270
+ }
271
+ catch {
272
+ // @silent-fallback-ok — agent's .worktrees/ doesn't exist yet (no
273
+ // `instar worktree create` calls or no Layer 3 migrator run).
274
+ // Skip — there's nothing under it to be a "safe root" for.
275
+ }
276
+ }
277
+ return roots;
278
+ }
279
+ /**
280
+ * Per spec: the detector uses a deterministic source (config or default
281
+ * chain), NOT `INSTAR_REPO` env var, because env vars can differ between
282
+ * lifeline boot and interactive sessions and the detector wants
283
+ * consistent results across both.
284
+ */
285
+ export function resolveDetectorInstarRepo(opts = {}) {
286
+ // Read worktree.repoPath from config (deterministic operator-supplied path).
287
+ const resolved = opts.configPath ?? path.join(os.homedir(), '.instar', 'config.json');
288
+ let configRepoPath = null;
289
+ if (fs.existsSync(resolved)) {
290
+ try {
291
+ const raw = JSON.parse(fs.readFileSync(resolved, 'utf-8'));
292
+ const wt = raw.worktree;
293
+ if (wt && typeof wt.repoPath === 'string' && wt.repoPath.trim()) {
294
+ configRepoPath = wt.repoPath.trim();
295
+ }
296
+ }
297
+ catch {
298
+ // @silent-fallback-ok — config malformed; fall through to default chain.
299
+ }
300
+ }
301
+ const candidateChain = [];
302
+ if (configRepoPath)
303
+ candidateChain.push(configRepoPath);
304
+ if (opts.fallbackChain) {
305
+ candidateChain.push(...opts.fallbackChain);
306
+ }
307
+ else {
308
+ const home = opts.homeDir ?? os.homedir();
309
+ candidateChain.push(path.join(home, 'Documents', 'Projects', 'instar'));
310
+ candidateChain.push(path.join(home, 'instar'));
311
+ }
312
+ // Reuse the same integrity validation Layer 1 uses for INSTAR_REPO so
313
+ // the detector and the CLI never disagree about what "the instar repo"
314
+ // is. Skip the env-var path by passing an empty `env`.
315
+ try {
316
+ const repo = resolveInstarRepo({
317
+ env: {},
318
+ fallbackChain: candidateChain,
319
+ configPath: resolved,
320
+ });
321
+ return repo.repoPath;
322
+ }
323
+ catch {
324
+ // @silent-fallback-ok — no validated instar repo reachable; detector
325
+ // simply doesn't run this tick. Caller decides whether to log/skip.
326
+ return null;
327
+ }
328
+ }
329
+ //# sourceMappingURL=AgentWorktreeDetector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentWorktreeDetector.js","sourceRoot":"","sources":["../../src/core/AgentWorktreeDetector.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,w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C,IAAI,cAAc;QAAE,cAAc,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACxD,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;IAC7C,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QAC1C,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;QACxE,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,sEAAsE;IACtE,uEAAuE;IACvE,uDAAuD;IACvD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,iBAAiB,CAAC;YAC7B,GAAG,EAAE,EAAE;YACP,aAAa,EAAE,cAAc;YAC7B,UAAU,EAAE,QAAQ;SACrB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,qEAAqE;QACrE,sEAAsE;QACtE,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * InstarWorktreeManager — Layer 1 of the Agent Worktree Convention.
3
+ *
4
+ * Creates git worktrees of the shared instar repository inside the agent's
5
+ * own home directory (`~/.instar/agents/<agent>/.worktrees/`). This is the
6
+ * only location the macOS sandbox cannot revoke mid-session.
7
+ *
8
+ * Spec: docs/specs/AGENT-WORKTREE-CONVENTION-SPEC.md (status: approved).
9
+ *
10
+ * The CLI subcommand `instar worktree create <branch>` is a thin shim over
11
+ * this manager. All validation, resolution, and audit-trail logic lives
12
+ * here so it can be unit-tested without spawning a CLI process.
13
+ */
14
+ /** Default allowlist of remote-origin URLs for the canonical instar repo.
15
+ * Operators can extend via `worktree.repoUrlAllowlist` in `.instar/config.json`. */
16
+ export declare const DEFAULT_INSTAR_REPO_URL_ALLOWLIST: ReadonlyArray<string>;
17
+ export interface ResolveAgentHomeOptions {
18
+ /** Override `process.env`. */
19
+ env?: NodeJS.ProcessEnv;
20
+ /** Override `process.cwd()`. */
21
+ cwd?: string;
22
+ /** Override the instar home root (defaults to `~/.instar`). */
23
+ instarHome?: string;
24
+ /** Override registry lookup (for tests). Returns the set of registered agent names. */
25
+ registryLookup?: () => Set<string>;
26
+ }
27
+ export interface ResolvedAgentHome {
28
+ /** Absolute, real (symlink-resolved) path to the agent home directory. */
29
+ agentHome: string;
30
+ /** Agent name extracted from the trailing path segment. */
31
+ agentName: string;
32
+ }
33
+ export interface ResolveInstarRepoOptions {
34
+ env?: NodeJS.ProcessEnv;
35
+ /** Path to user config (defaults to `~/.instar/config.json`). */
36
+ configPath?: string;
37
+ /** Override the URL allowlist entirely (skipping the default + config merge). */
38
+ urlAllowlist?: ReadonlyArray<string>;
39
+ /** Override the fallback chain order (for tests). */
40
+ fallbackChain?: ReadonlyArray<string>;
41
+ /** Override the home directory used for default fallbacks. */
42
+ homeDir?: string;
43
+ }
44
+ export interface ResolvedInstarRepo {
45
+ /** Absolute, real path to a validated instar repo. */
46
+ repoPath: string;
47
+ /** Allowlisted remote.origin.url for the resolved repo. */
48
+ remoteUrl: string;
49
+ }
50
+ export interface CreateWorktreeOptions {
51
+ /** Branch name to check out / create. */
52
+ branch: string;
53
+ /** Optional override for the worktree directory slug. Defaults to branch with `/` → `-`. */
54
+ slug?: string;
55
+ /** Default true (current bash-helper behavior). Pass false to skip the node_modules symlink. */
56
+ shareNodeModules?: boolean;
57
+ /** Override agent-home resolution (mainly for tests). */
58
+ resolveAgentHomeOpts?: ResolveAgentHomeOptions;
59
+ /** Override instar-repo resolution (mainly for tests). */
60
+ resolveInstarRepoOpts?: ResolveInstarRepoOptions;
61
+ /** Override the base for new branches. If omitted, resolves to origin/HEAD. */
62
+ baseBranch?: string;
63
+ /** Audit-mirror state directory (defaults to `<agent_home>/.instar`). */
64
+ stateDir?: string;
65
+ }
66
+ export interface CreateWorktreeResult {
67
+ worktreePath: string;
68
+ branch: string;
69
+ slug: string;
70
+ agentHome: string;
71
+ agentName: string;
72
+ instarRepo: string;
73
+ instarRepoSha: string;
74
+ shareNodeModules: boolean;
75
+ /** True if a new branch was created; false if an existing branch was checked out. */
76
+ createdBranch: boolean;
77
+ }
78
+ export declare function resolveAgentHome(opts?: ResolveAgentHomeOptions): ResolvedAgentHome;
79
+ export declare function resolveInstarRepo(opts?: ResolveInstarRepoOptions): ResolvedInstarRepo;
80
+ export declare function defaultSlugFor(branch: string): string;
81
+ export declare function validateSlug(slug: string, existingSlugsLower: ReadonlySet<string>): void;
82
+ export declare function validateBranchName(branch: string, repoPath: string): void;
83
+ export declare function createWorktree(opts: CreateWorktreeOptions): Promise<CreateWorktreeResult>;
84
+ export interface LedgerEntry {
85
+ ts: string;
86
+ agent: string;
87
+ branch: string;
88
+ slug: string;
89
+ worktreePath: string;
90
+ instarRepo: string;
91
+ instarRepoSha: string;
92
+ shareNodeModules: boolean;
93
+ }
94
+ export declare function appendLedgerEntry(worktreesDir: string, stateDir: string, entry: LedgerEntry): void;
95
+ /** Stable hash for a worktree path — used by the (deferred) Layer 4 detector
96
+ * as the AttentionQueue dedupe key. Exposed here so detector code and tests
97
+ * cannot drift. */
98
+ export declare function worktreeDedupeKey(worktreePath: string): string;
99
+ //# sourceMappingURL=InstarWorktreeManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InstarWorktreeManager.d.ts","sourceRoot":"","sources":["../../src/core/InstarWorktreeManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAWH;qFACqF;AACrF,eAAO,MAAM,iCAAiC,EAAE,aAAa,CAAC,MAAM,CAGnE,CAAC;AAUF,MAAM,WAAW,uBAAuB;IACtC,8BAA8B;IAC9B,GAAG,CAAC,EAAE,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