@adhdev/daemon-core 0.9.82-rc.400 → 0.9.82-rc.402
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/cli-adapter-types.d.ts +2 -1
- package/dist/cli-adapters/cli-state-engine.d.ts +1 -0
- package/dist/cli-adapters/provider-cli-adapter.d.ts +3 -1
- package/dist/cli-adapters/provider-cli-parse.d.ts +1 -0
- package/dist/git/git-worktree.d.ts +49 -1
- package/dist/git/index.d.ts +1 -1
- package/dist/index.js +382 -207
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +379 -204
- package/dist/index.mjs.map +1 -1
- package/dist/providers/cli-provider-instance.d.ts +10 -0
- package/package.json +2 -2
- package/src/cli-adapter-types.d.ts +2 -1
- package/src/cli-adapter-types.ts +2 -2
- package/src/cli-adapters/cli-state-engine.ts +15 -0
- package/src/cli-adapters/provider-cli-adapter.ts +32 -11
- package/src/cli-adapters/provider-cli-parse.d.ts +1 -0
- package/src/cli-adapters/provider-cli-parse.ts +6 -0
- package/src/commands/cli-manager.ts +16 -2
- package/src/commands/med-family/mesh-crud.ts +9 -0
- package/src/git/git-worktree.ts +185 -3
- package/src/git/index.ts +1 -0
- package/src/mesh/mesh-event-forwarding.ts +13 -2
- package/src/mesh/mesh-queue-assignment.ts +12 -0
- package/src/mesh/mesh-reconcile-loop.ts +4 -0
- package/src/mesh/mesh-runtime-store.ts +20 -2
- package/src/mesh/mesh-work-queue.ts +23 -0
- package/src/providers/cli-provider-instance.ts +52 -8
|
@@ -85,8 +85,9 @@ export interface CliAdapter {
|
|
|
85
85
|
spawn(): Promise<void>;
|
|
86
86
|
sendMessage(text: string, options?: {
|
|
87
87
|
force?: boolean;
|
|
88
|
+
meshTaskId?: string;
|
|
88
89
|
}): Promise<void>;
|
|
89
|
-
forceSendMessage?(text: string): Promise<void>;
|
|
90
|
+
forceSendMessage?(text: string, meshTaskId?: string): Promise<void>;
|
|
90
91
|
getStatus(options?: {
|
|
91
92
|
allowParse?: boolean;
|
|
92
93
|
}): CliAdapterStatus;
|
|
@@ -187,8 +187,9 @@ export declare class ProviderCliAdapter implements CliAdapter {
|
|
|
187
187
|
private waitForEchoAndSubmit;
|
|
188
188
|
sendMessage(text: string, options?: {
|
|
189
189
|
force?: boolean;
|
|
190
|
+
meshTaskId?: string;
|
|
190
191
|
}): Promise<void>;
|
|
191
|
-
forceSendMessage(text: string): Promise<void>;
|
|
192
|
+
forceSendMessage(text: string, meshTaskId?: string): Promise<void>;
|
|
192
193
|
private waitForForceSubmitSettle;
|
|
193
194
|
private enqueuePendingOutboundMessage;
|
|
194
195
|
private shouldQueuePendingOutboundMessage;
|
|
@@ -229,6 +230,7 @@ export declare class ProviderCliAdapter implements CliAdapter {
|
|
|
229
230
|
} | null);
|
|
230
231
|
get currentTurnScope(): TurnParseScope | null;
|
|
231
232
|
set currentTurnScope(v: TurnParseScope | null);
|
|
233
|
+
get currentTurnTaskId(): string | null;
|
|
232
234
|
get responseEpoch(): number;
|
|
233
235
|
set responseEpoch(v: number);
|
|
234
236
|
get submitRetryUsed(): boolean;
|
|
@@ -19,11 +19,54 @@ export interface WorktreeCreateOptions {
|
|
|
19
19
|
meshName: string;
|
|
20
20
|
/** Override the auto-resolved target directory */
|
|
21
21
|
targetDir?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Remote to fetch+compare the base branch against before branching.
|
|
24
|
+
* Default: 'origin'.
|
|
25
|
+
*/
|
|
26
|
+
remote?: string;
|
|
27
|
+
/**
|
|
28
|
+
* When true (default) and `baseBranch` is given, fetch the base branch from
|
|
29
|
+
* `remote` and, if the local base branch is strictly behind the remote
|
|
30
|
+
* (no divergence), branch the worktree from the remote-tracking ref instead
|
|
31
|
+
* of the stale local ref. The decision is always surfaced via `baseSync`.
|
|
32
|
+
* Set false to preserve the legacy "branch from local ref, never fetch"
|
|
33
|
+
* behavior.
|
|
34
|
+
*/
|
|
35
|
+
syncBaseFromRemote?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* How the worktree's start point was resolved relative to the remote base.
|
|
39
|
+
* Surfaced so the coordinator can detect a stale base node before dispatching
|
|
40
|
+
* work onto a worktree built on a behind/diverged base.
|
|
41
|
+
*/
|
|
42
|
+
export interface WorktreeBaseSync {
|
|
43
|
+
/** The base branch name requested (e.g. 'main'). */
|
|
44
|
+
branch: string;
|
|
45
|
+
/** The remote compared against (e.g. 'origin'). */
|
|
46
|
+
remote: string;
|
|
47
|
+
/** The actual ref/commit-ish used as the worktree branch start point. */
|
|
48
|
+
startRef: string;
|
|
49
|
+
/** Whether `git fetch <remote> <branch>` succeeded. */
|
|
50
|
+
fetched: boolean;
|
|
51
|
+
/** Local base-branch SHA before clone, if the local ref exists. */
|
|
52
|
+
localSha?: string;
|
|
53
|
+
/** Remote-tracking base-branch SHA after fetch, if it exists. */
|
|
54
|
+
remoteSha?: string;
|
|
55
|
+
/** Commits the local base ref is behind the remote (0 when up-to-date/ahead). */
|
|
56
|
+
behindBy: number;
|
|
57
|
+
/** Commits the local base ref is ahead of the remote. */
|
|
58
|
+
aheadBy: number;
|
|
59
|
+
/** What was done with the base ref. */
|
|
60
|
+
action: 'up_to_date' | 'local_behind_used_remote' | 'local_ahead_used_local' | 'diverged_used_local' | 'no_remote_ref_used_local' | 'no_local_ref_used_remote';
|
|
61
|
+
/** Human-readable warning when the base was stale/diverged. */
|
|
62
|
+
warning?: string;
|
|
22
63
|
}
|
|
23
64
|
export interface WorktreeCreateResult {
|
|
24
65
|
success: true;
|
|
25
66
|
worktreePath: string;
|
|
26
67
|
branch: string;
|
|
68
|
+
/** Present when `baseBranch` was given and base sync resolution ran. */
|
|
69
|
+
baseSync?: WorktreeBaseSync;
|
|
27
70
|
}
|
|
28
71
|
export interface WorktreeEntry {
|
|
29
72
|
path: string;
|
|
@@ -56,7 +99,12 @@ export declare function resolveWorktreePath(repoRoot: string, meshName: string,
|
|
|
56
99
|
/**
|
|
57
100
|
* Create a new git worktree with a fresh branch.
|
|
58
101
|
*
|
|
59
|
-
* Runs: git worktree add <targetDir> -b <branch> [
|
|
102
|
+
* Runs: git worktree add <targetDir> -b <branch> [startRef]
|
|
103
|
+
*
|
|
104
|
+
* When `baseBranch` is given and `syncBaseFromRemote` is not disabled, the
|
|
105
|
+
* start point is resolved against the remote first (see
|
|
106
|
+
* resolveWorktreeBaseStartPoint) so a stale local base does not produce a stale
|
|
107
|
+
* worktree. The resolution is returned as `baseSync`.
|
|
60
108
|
*/
|
|
61
109
|
export declare function createWorktree(opts: WorktreeCreateOptions): Promise<WorktreeCreateResult>;
|
|
62
110
|
/**
|
package/dist/git/index.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ export type { GitCommandResult, GitCommandServices, GitFileDiff, GitLogEntry, Gi
|
|
|
17
17
|
export { TurnSnapshotTracker } from './turn-snapshot-tracker.js';
|
|
18
18
|
export type { TurnCompletedCallback } from './turn-snapshot-tracker.js';
|
|
19
19
|
export { createWorktree, listWorktrees, parseWorktreeListOutput, removeWorktree, resolveWorktreePath, } from './git-worktree.js';
|
|
20
|
-
export type { WorktreeCreateOptions, WorktreeCreateResult, WorktreeEntry, WorktreeRemoveResult, } from './git-worktree.js';
|
|
20
|
+
export type { WorktreeBaseSync, WorktreeCreateOptions, WorktreeCreateResult, WorktreeEntry, WorktreeRemoveResult, } from './git-worktree.js';
|