@ornexus/neocortex 4.60.81 → 4.61.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/dist/release-source.json +1 -1
- package/install.ps1 +33 -1
- package/install.sh +35 -1
- package/package.json +2 -2
- package/packages/client/dist/adapters/platform-detector.d.ts +1 -1
- package/packages/client/dist/adapters/platform-detector.js +6 -0
- package/packages/client/dist/cli.js +7 -0
- package/packages/client/dist/commands/invoke.d.ts +15 -8
- package/packages/client/dist/commands/invoke.js +69 -0
- package/packages/client/dist/commands/story-checkpoint.d.ts +2 -1
- package/packages/client/dist/commands/story-checkpoint.js +34 -2
- package/packages/client/dist/commands/story-worktree.d.ts +46 -0
- package/packages/client/dist/commands/story-worktree.js +258 -0
- package/packages/client/dist/config.js +1 -0
- package/packages/client/dist/git/direct-yolo-checkpoint.d.ts +46 -0
- package/packages/client/dist/git/direct-yolo-checkpoint.js +137 -1
- package/packages/client/dist/git/git-lifecycle-store.d.ts +82 -0
- package/packages/client/dist/git/git-lifecycle-store.js +310 -4
- package/packages/client/dist/git/story-worktree-cleanup.d.ts +226 -0
- package/packages/client/dist/git/story-worktree-cleanup.js +1058 -0
- package/packages/client/dist/git/story-worktree-integration.d.ts +91 -0
- package/packages/client/dist/git/story-worktree-integration.js +603 -0
- package/packages/client/dist/git/story-worktree-manager.d.ts +205 -0
- package/packages/client/dist/git/story-worktree-manager.js +843 -0
- package/packages/client/dist/git/story-worktree-paths.d.ts +65 -0
- package/packages/client/dist/git/story-worktree-paths.js +150 -0
- package/packages/client/dist/policy/subagent-approval-policy.js +3 -1
- package/packages/client/dist/runner/headless/continuous-story-workspace.d.ts +49 -1
- package/packages/client/dist/runner/headless/continuous-story-workspace.js +175 -27
- package/packages/client/dist/runner/headless/run-yoloop.d.ts +39 -0
- package/packages/client/dist/runner/headless/run-yoloop.js +71 -0
- package/packages/client/dist/runner-cli.js +0 -0
- package/packages/shared/dist/yoloop/epic-terminal-git.js +27 -3
- package/targets-stubs/antigravity/gemini.md +1 -1
- package/targets-stubs/antigravity/neocortex.md +21 -0
- package/targets-stubs/antigravity/skill/SKILL.md +1 -1
- package/targets-stubs/claude-code/README.md +17 -0
- package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
- package/targets-stubs/claude-code/neocortex-root.md +57 -49
- package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
- package/targets-stubs/claude-code/neocortex.md +28 -25
- package/targets-stubs/codex/AGENTS.md +31 -30
- package/targets-stubs/codex/neocortex.toml +10 -0
- package/targets-stubs/cursor/agent.md +13 -2
- package/targets-stubs/deepseek-harness/SKILL.md +13 -0
- package/targets-stubs/gemini-cli/agent.md +23 -2
- package/targets-stubs/grok/SKILL.md +21 -0
- package/targets-stubs/kimi/neocortex.md +21 -0
- package/targets-stubs/openclaw/SKILL.md +21 -0
- package/targets-stubs/opencode/neocortex-root.md +19 -15
- package/targets-stubs/opencode/neocortex.md +10 -0
- package/targets-stubs/vscode/neocortex.agent.md +13 -2
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
3
|
+
* Copyright (c) 2026 OrNexus AI
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Neocortex CLI, licensed under the
|
|
6
|
+
* Functional Source License, Version 1.1 (FSL-1.1).
|
|
7
|
+
*
|
|
8
|
+
* Change Date: February 20, 2029
|
|
9
|
+
* Change License: MIT
|
|
10
|
+
*
|
|
11
|
+
* See the LICENSE file in the project root for full license text.
|
|
12
|
+
*/
|
|
13
|
+
import type { CleanupReceipt, StoryWorktreeLease } from '../../../shared/dist/yoloop/story-worktree-receipts.js';
|
|
14
|
+
import { type StoryWorktreeJournalEntry } from './git-lifecycle-store.js';
|
|
15
|
+
export declare const STORY_WORKTREE_MARKER_FILE = "nx-owner";
|
|
16
|
+
/** Same domain as shared `digestStoryWorktreeReceipt` (P225-CON-RECEIPTS). */
|
|
17
|
+
export declare const STORY_WORKTREE_RECEIPT_DIGEST_DOMAIN = "neocortex.p225.story-worktree-receipt.v1";
|
|
18
|
+
/** Receipt digest computed with the packaged canonical hash (parity-tested). */
|
|
19
|
+
export declare function digestStoryWorktreeReceiptLocal(receipt: StoryWorktreeLease | CleanupReceipt): string;
|
|
20
|
+
export type StoryWorktreeResult<T> = {
|
|
21
|
+
readonly ok: true;
|
|
22
|
+
readonly value: T;
|
|
23
|
+
readonly privatePath?: string;
|
|
24
|
+
} | {
|
|
25
|
+
readonly ok: false;
|
|
26
|
+
readonly reasonCode: string;
|
|
27
|
+
readonly conflictPaths?: readonly string[];
|
|
28
|
+
};
|
|
29
|
+
export interface StoryWorktreeManagerOptions {
|
|
30
|
+
readonly projectRoot: string;
|
|
31
|
+
/** Absolute override for the private root (tests, operators). */
|
|
32
|
+
readonly worktreeRoot?: string;
|
|
33
|
+
readonly platform?: string;
|
|
34
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
35
|
+
readonly homedir?: string;
|
|
36
|
+
readonly now?: () => Date;
|
|
37
|
+
readonly randomNonce?: () => string;
|
|
38
|
+
readonly ttlMs?: number;
|
|
39
|
+
readonly lockRetry?: {
|
|
40
|
+
readonly attempts: number;
|
|
41
|
+
readonly delayMs: number;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface StoryWorktreeCreateInput {
|
|
45
|
+
readonly epicId: string;
|
|
46
|
+
readonly storyId: string;
|
|
47
|
+
readonly dispatchId: string;
|
|
48
|
+
readonly baseSha: string;
|
|
49
|
+
readonly graphRevision: string;
|
|
50
|
+
readonly ownerId?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface StoryWorktreeAdoptInput extends StoryWorktreeCreateInput {
|
|
53
|
+
/** Absolute path of an existing secondary worktree (native harness). */
|
|
54
|
+
readonly worktreePath: string;
|
|
55
|
+
}
|
|
56
|
+
export interface StoryWorktreeLeaseValue {
|
|
57
|
+
readonly lease: StoryWorktreeLease;
|
|
58
|
+
readonly leaseDigest: string;
|
|
59
|
+
readonly worktreeId: string;
|
|
60
|
+
readonly worktreeRef: string;
|
|
61
|
+
readonly temporaryBranch: string;
|
|
62
|
+
readonly baseSha: string;
|
|
63
|
+
readonly reused: boolean;
|
|
64
|
+
readonly env: Readonly<Record<string, string>>;
|
|
65
|
+
}
|
|
66
|
+
export interface StoryWorktreeSyncValue {
|
|
67
|
+
readonly leaseId: string;
|
|
68
|
+
readonly outcome: 'synced' | 'already-synced';
|
|
69
|
+
readonly integratedSha: string;
|
|
70
|
+
readonly headSha: string;
|
|
71
|
+
}
|
|
72
|
+
export interface StoryWorktreeStatusValue {
|
|
73
|
+
readonly leaseId: string;
|
|
74
|
+
readonly epicId: string;
|
|
75
|
+
readonly storyId: string;
|
|
76
|
+
readonly worktreeId: string;
|
|
77
|
+
readonly worktreeRef: string;
|
|
78
|
+
readonly temporaryBranch: string;
|
|
79
|
+
readonly workspaceMechanism: StoryWorktreeJournalEntry['workspaceMechanism'];
|
|
80
|
+
readonly state: StoryWorktreeJournalEntry['state'];
|
|
81
|
+
readonly baseSha: string;
|
|
82
|
+
readonly syncedSha?: string;
|
|
83
|
+
readonly ownership: 'proven' | 'unproven';
|
|
84
|
+
readonly headSha?: string;
|
|
85
|
+
readonly clean?: boolean;
|
|
86
|
+
readonly integrated?: boolean;
|
|
87
|
+
readonly expiresAt: string;
|
|
88
|
+
}
|
|
89
|
+
export interface StoryWorktreeReleaseValue {
|
|
90
|
+
readonly leaseId: string;
|
|
91
|
+
readonly receipt: CleanupReceipt;
|
|
92
|
+
readonly receiptDigest: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* P225.06 private probe of one journal entry. Carries the private absolute
|
|
96
|
+
* path for the local cleanup module; it is never part of any public value.
|
|
97
|
+
*/
|
|
98
|
+
export interface StoryWorktreeProbe {
|
|
99
|
+
readonly entry: StoryWorktreeJournalEntry;
|
|
100
|
+
readonly facts: RepositoryFacts;
|
|
101
|
+
readonly ownership: 'proven' | 'unproven';
|
|
102
|
+
readonly pathExists: boolean;
|
|
103
|
+
readonly registered: boolean;
|
|
104
|
+
/** Tip of `refs/heads/<temporaryBranch>` when the branch exists. */
|
|
105
|
+
readonly branchSha?: string;
|
|
106
|
+
/** True when the temporary branch is checked out by any registered worktree. */
|
|
107
|
+
readonly branchCheckedOut: boolean;
|
|
108
|
+
readonly headSha?: string;
|
|
109
|
+
readonly clean?: boolean;
|
|
110
|
+
readonly epicHead?: string;
|
|
111
|
+
/** Worktree HEAD (or branch tip when the directory vanished) contained in `epic/<ID>`. */
|
|
112
|
+
readonly integrated?: boolean;
|
|
113
|
+
}
|
|
114
|
+
export type StoryWorktreeFailureTrigger = 'failure' | 'abandon';
|
|
115
|
+
export interface GitOutcome {
|
|
116
|
+
readonly ok: boolean;
|
|
117
|
+
readonly stdout: string;
|
|
118
|
+
}
|
|
119
|
+
export interface RepositoryFacts {
|
|
120
|
+
readonly mainRoot: string;
|
|
121
|
+
readonly commonDir: string;
|
|
122
|
+
}
|
|
123
|
+
/** Bounded Git execution shared with the P225.06 cleanup module (exit code + stdout only). */
|
|
124
|
+
export declare function runStoryWorktreeGit(cwd: string, args: readonly string[]): Promise<GitOutcome>;
|
|
125
|
+
export interface PorcelainWorktree {
|
|
126
|
+
readonly path: string;
|
|
127
|
+
readonly head?: string;
|
|
128
|
+
readonly branch?: string;
|
|
129
|
+
}
|
|
130
|
+
export declare function parseWorktreeList(output: string): PorcelainWorktree[];
|
|
131
|
+
export declare class StoryWorktreeManager {
|
|
132
|
+
private readonly options;
|
|
133
|
+
private readonly projectRoot;
|
|
134
|
+
private readonly now;
|
|
135
|
+
private readonly randomNonce;
|
|
136
|
+
private readonly platform;
|
|
137
|
+
constructor(options: StoryWorktreeManagerOptions);
|
|
138
|
+
create(input: StoryWorktreeCreateInput): Promise<StoryWorktreeResult<StoryWorktreeLeaseValue>>;
|
|
139
|
+
adopt(input: StoryWorktreeAdoptInput): Promise<StoryWorktreeResult<StoryWorktreeLeaseValue>>;
|
|
140
|
+
sync(input: {
|
|
141
|
+
readonly leaseId: string;
|
|
142
|
+
readonly integratedSha?: string;
|
|
143
|
+
readonly directive?: unknown;
|
|
144
|
+
}): Promise<StoryWorktreeResult<StoryWorktreeSyncValue>>;
|
|
145
|
+
status(input: {
|
|
146
|
+
readonly leaseId?: string;
|
|
147
|
+
readonly epicId?: string;
|
|
148
|
+
}): Promise<StoryWorktreeResult<{
|
|
149
|
+
readonly entries: readonly StoryWorktreeStatusValue[];
|
|
150
|
+
}>>;
|
|
151
|
+
release(input: {
|
|
152
|
+
readonly leaseId: string;
|
|
153
|
+
}): Promise<StoryWorktreeResult<StoryWorktreeReleaseValue>>;
|
|
154
|
+
/** P225.06: private ownership/integration probe for the cleanup module. */
|
|
155
|
+
probe(leaseId: string): Promise<StoryWorktreeResult<StoryWorktreeProbe>>;
|
|
156
|
+
/** Registered secondary worktrees of this repository (canonical private paths). */
|
|
157
|
+
registeredWorktrees(): Promise<StoryWorktreeResult<{
|
|
158
|
+
readonly facts: RepositoryFacts;
|
|
159
|
+
readonly worktrees: readonly PorcelainWorktree[];
|
|
160
|
+
}>>;
|
|
161
|
+
/** Canonical path comparison for the current platform. */
|
|
162
|
+
sameWorktreePath(left: string, right: string): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* P225.06 failure/abandon hook: bundle unintegrated work, then remove the
|
|
165
|
+
* worktree (or leave it `remove-pending`). Delegates to the cleanup module.
|
|
166
|
+
*/
|
|
167
|
+
fail(input: {
|
|
168
|
+
readonly leaseId: string;
|
|
169
|
+
readonly trigger?: StoryWorktreeFailureTrigger;
|
|
170
|
+
readonly dryRun?: boolean;
|
|
171
|
+
}): Promise<StoryWorktreeResult<import("./story-worktree-cleanup.js").StoryWorktreeCleanupValue>>;
|
|
172
|
+
abandon(input: {
|
|
173
|
+
readonly leaseId: string;
|
|
174
|
+
readonly dryRun?: boolean;
|
|
175
|
+
}): Promise<StoryWorktreeResult<import("./story-worktree-cleanup.js").StoryWorktreeCleanupValue>>;
|
|
176
|
+
private guard;
|
|
177
|
+
private identity;
|
|
178
|
+
/** P225.06: a worktree under cleanup (or with an untrusted sidecar) is never handed out again. */
|
|
179
|
+
private assertNoCleanupInProgress;
|
|
180
|
+
private ownerId;
|
|
181
|
+
private repository;
|
|
182
|
+
private assertAuthorizedBase;
|
|
183
|
+
private epicHead;
|
|
184
|
+
private worktreeGitDir;
|
|
185
|
+
private enableWindowsLongPaths;
|
|
186
|
+
private ownershipProven;
|
|
187
|
+
private ownedEntry;
|
|
188
|
+
private clean;
|
|
189
|
+
private project;
|
|
190
|
+
private leaseValue;
|
|
191
|
+
private rollbackCreate;
|
|
192
|
+
private removeOwnMarker;
|
|
193
|
+
/** `git worktree list` with every path canonicalised for comparison. */
|
|
194
|
+
private listWorktrees;
|
|
195
|
+
private samePath;
|
|
196
|
+
private markerLeaseId;
|
|
197
|
+
/**
|
|
198
|
+
* A `creating` reservation left by a crashed or lock-starved call is
|
|
199
|
+
* reclaimed only when it is provably empty (no path, no branch).
|
|
200
|
+
*/
|
|
201
|
+
private reclaimStaleReservation;
|
|
202
|
+
private readDocument;
|
|
203
|
+
/** Journal write under the lifecycle lock, retrying bounded lock contention. */
|
|
204
|
+
private mutate;
|
|
205
|
+
}
|