@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.
@@ -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;
@@ -58,6 +58,7 @@ export declare class CliStateEngine {
58
58
  currentStatus: CliSessionStatus['status'];
59
59
  isWaitingForResponse: boolean;
60
60
  currentTurnScope: TurnParseScope | null;
61
+ currentTurnTaskId: string | null;
61
62
  activeModal: {
62
63
  message: string;
63
64
  buttons: string[];
@@ -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;
@@ -4,6 +4,7 @@ export interface TurnParseScope {
4
4
  startedAt: number;
5
5
  bufferStart: number;
6
6
  rawBufferStart: number;
7
+ taskId?: string;
7
8
  }
8
9
  export declare function normalizeCliParsedMessages(parsedMessages: any[], _options: {
9
10
  scope?: TurnParseScope | null;
@@ -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> [baseBranch]
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
  /**
@@ -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';