@adhdev/daemon-core 0.9.76-rc.6 → 0.9.76-rc.60
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-adapters/provider-cli-adapter.d.ts +2 -1
- package/dist/cli-adapters/provider-cli-runtime.d.ts +1 -0
- package/dist/commands/cli-manager.d.ts +17 -4
- package/dist/commands/mesh-coordinator.d.ts +2 -0
- package/dist/commands/router.d.ts +11 -0
- package/dist/config/mesh-config.d.ts +3 -0
- package/dist/git/git-types.d.ts +1 -1
- package/dist/git/git-worktree.d.ts +64 -0
- package/dist/git/index.d.ts +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1525 -446
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1550 -477
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/coordinator-prompt.d.ts +1 -0
- package/dist/mesh/mesh-events.d.ts +9 -0
- package/dist/providers/chat-message-normalization.d.ts +11 -0
- package/dist/providers/cli-provider-instance.d.ts +3 -0
- package/dist/providers/provider-instance-manager.d.ts +1 -0
- package/dist/providers/provider-instance.d.ts +2 -0
- package/dist/repo-mesh-types.d.ts +27 -0
- package/dist/session-host/runtime-support.d.ts +2 -1
- package/dist/shared-types.d.ts +4 -0
- package/dist/types.d.ts +9 -0
- package/package.json +4 -5
- package/src/cli-adapters/provider-cli-adapter.ts +28 -7
- package/src/cli-adapters/provider-cli-runtime.ts +3 -2
- package/src/commands/chat-commands.ts +126 -11
- package/src/commands/cli-manager.ts +78 -5
- package/src/commands/handler.ts +13 -4
- package/src/commands/mesh-coordinator.ts +148 -5
- package/src/commands/router.d.ts +1 -0
- package/src/commands/router.ts +553 -34
- package/src/config/mesh-config.ts +23 -2
- package/src/git/git-commands.ts +5 -1
- package/src/git/git-types.ts +1 -0
- package/src/git/git-worktree.ts +214 -0
- package/src/git/index.ts +14 -0
- package/src/index.ts +3 -0
- package/src/mesh/coordinator-prompt.ts +29 -14
- package/src/mesh/mesh-events.ts +109 -43
- package/src/providers/chat-message-normalization.ts +80 -0
- package/src/providers/cli-provider-instance.d.ts +2 -0
- package/src/providers/cli-provider-instance.ts +93 -8
- package/src/providers/provider-instance-manager.ts +20 -1
- package/src/providers/provider-instance.ts +2 -0
- package/src/providers/read-chat-contract.ts +8 -0
- package/src/repo-mesh-types.ts +30 -0
- package/src/session-host/runtime-support.ts +55 -7
- package/src/shared-types.ts +4 -0
- package/src/status/builders.ts +17 -12
- package/src/status/reporter.ts +6 -0
- package/src/types.ts +9 -0
|
@@ -21,6 +21,7 @@ export { normalizeCliProviderForRuntime, type CliApprovalInput, type CliChatMess
|
|
|
21
21
|
export declare function appendBoundedText(current: string, chunk: string, maxChars: number): string;
|
|
22
22
|
export declare class ProviderCliAdapter implements CliAdapter {
|
|
23
23
|
private extraArgs;
|
|
24
|
+
private extraEnv;
|
|
24
25
|
readonly cliType: string;
|
|
25
26
|
readonly cliName: string;
|
|
26
27
|
workingDir: string;
|
|
@@ -126,7 +127,7 @@ export declare class ProviderCliAdapter implements CliAdapter {
|
|
|
126
127
|
private readonly submitStrategy;
|
|
127
128
|
private readonly requirePromptEchoBeforeSubmit;
|
|
128
129
|
private static readonly SCRIPT_STATUS_DEBOUNCE_MS;
|
|
129
|
-
constructor(provider: CliProviderModule, workingDir: string, extraArgs?: string[], transportFactory?: PtyTransportFactory);
|
|
130
|
+
constructor(provider: CliProviderModule, workingDir: string, extraArgs?: string[], extraEnv?: Record<string, string>, transportFactory?: PtyTransportFactory);
|
|
130
131
|
/** Inject CLI scripts after construction (e.g. when resolved by ProviderLoader) */
|
|
131
132
|
setCliScripts(scripts: CliScripts): void;
|
|
132
133
|
/** Refresh provider scripts/config used by this adapter without restarting the PTY runtime. */
|
|
@@ -15,6 +15,7 @@ export declare function resolveCliSpawnPlan(options: {
|
|
|
15
15
|
runtimeSettings: Record<string, any>;
|
|
16
16
|
workingDir: string;
|
|
17
17
|
extraArgs: string[];
|
|
18
|
+
extraEnv?: Record<string, string>;
|
|
18
19
|
}): CliSpawnPlan;
|
|
19
20
|
export declare function buildCliLoginShellRetry(plan: Pick<CliSpawnPlan, 'binaryPath' | 'allArgs'>): {
|
|
20
21
|
shellCmd: string;
|
|
@@ -58,6 +58,22 @@ type CliSessionBinding = {
|
|
|
58
58
|
providerSessionId?: string;
|
|
59
59
|
launchMode: CliLaunchMode;
|
|
60
60
|
};
|
|
61
|
+
type CliStartOptions = {
|
|
62
|
+
resumeSessionId?: string;
|
|
63
|
+
settingsOverride?: Record<string, any>;
|
|
64
|
+
extraEnv?: Record<string, string>;
|
|
65
|
+
};
|
|
66
|
+
export interface CoordinatorDelegatedCliLaunchOptionsInput {
|
|
67
|
+
cliType: string;
|
|
68
|
+
workspace: string;
|
|
69
|
+
cliArgs?: string[];
|
|
70
|
+
env?: Record<string, string>;
|
|
71
|
+
}
|
|
72
|
+
export interface CoordinatorDelegatedCliLaunchOptions {
|
|
73
|
+
cliArgs: string[];
|
|
74
|
+
env: Record<string, string>;
|
|
75
|
+
}
|
|
76
|
+
export declare function buildCoordinatorDelegatedCliLaunchOptions(input: CoordinatorDelegatedCliLaunchOptionsInput): CoordinatorDelegatedCliLaunchOptions;
|
|
61
77
|
export declare function supportsExplicitSessionResume(resume?: ProviderResumeCapability): boolean;
|
|
62
78
|
export declare function resolveCliSessionBinding(provider: ProviderModule | undefined, normalizedType: string, cliArgs?: string[], requestedResumeSessionId?: string): CliSessionBinding;
|
|
63
79
|
export declare class DaemonCliManager {
|
|
@@ -73,10 +89,7 @@ export declare class DaemonCliManager {
|
|
|
73
89
|
private createAdapter;
|
|
74
90
|
private startCliExitMonitor;
|
|
75
91
|
private registerCliInstance;
|
|
76
|
-
startSession(cliType: string, workingDir: string, cliArgs?: string[], initialModel?: string, options?: {
|
|
77
|
-
resumeSessionId?: string;
|
|
78
|
-
settingsOverride?: Record<string, any>;
|
|
79
|
-
}): Promise<{
|
|
92
|
+
startSession(cliType: string, workingDir: string, cliArgs?: string[], initialModel?: string, options?: CliStartOptions): Promise<{
|
|
80
93
|
runtimeSessionId: string;
|
|
81
94
|
providerSessionId?: string;
|
|
82
95
|
}>;
|
|
@@ -23,10 +23,12 @@ export type MeshCoordinatorSetup = {
|
|
|
23
23
|
};
|
|
24
24
|
export interface ResolveMeshCoordinatorSetupOptions {
|
|
25
25
|
provider?: ProviderModule | null;
|
|
26
|
+
cliType?: string;
|
|
26
27
|
meshId: string;
|
|
27
28
|
workspace: string;
|
|
28
29
|
adhdevMcpCommand?: string;
|
|
29
30
|
adhdevMcpEntryPath?: string;
|
|
30
31
|
nodeExecutable?: string;
|
|
31
32
|
}
|
|
33
|
+
export declare function createHermesManualMeshCoordinatorSetup(meshId: string, workspace: string): MeshCoordinatorSetup;
|
|
32
34
|
export declare function resolveMeshCoordinatorSetup(options: ResolveMeshCoordinatorSetupOptions): MeshCoordinatorSetup;
|
|
@@ -21,6 +21,9 @@ export interface SessionHostControlPlane {
|
|
|
21
21
|
}): Promise<any>;
|
|
22
22
|
listSessions(): Promise<any[]>;
|
|
23
23
|
stopSession(sessionId: string): Promise<any>;
|
|
24
|
+
deleteSession(sessionId: string, opts?: {
|
|
25
|
+
force?: boolean;
|
|
26
|
+
}): Promise<any>;
|
|
24
27
|
resumeSession(sessionId: string): Promise<any>;
|
|
25
28
|
restartSession(sessionId: string): Promise<any>;
|
|
26
29
|
sendSignal(sessionId: string, signal: string): Promise<any>;
|
|
@@ -81,6 +84,14 @@ export declare class DaemonCommandRouter {
|
|
|
81
84
|
* the mesh doesn't exist in the local meshes.json file. */
|
|
82
85
|
private inlineMeshCache;
|
|
83
86
|
constructor(deps: CommandRouterDeps);
|
|
87
|
+
private getCachedInlineMesh;
|
|
88
|
+
private getMeshForCommand;
|
|
89
|
+
private updateInlineMeshNode;
|
|
90
|
+
private removeInlineMeshNode;
|
|
91
|
+
private normalizeMeshSessionCleanupMode;
|
|
92
|
+
private sessionMatchesMeshNode;
|
|
93
|
+
private isCompletedHostedSession;
|
|
94
|
+
private cleanupMeshSessions;
|
|
84
95
|
private traceSessionHostAction;
|
|
85
96
|
/**
|
|
86
97
|
* Unified command routing.
|
|
@@ -35,9 +35,12 @@ export declare function deleteMesh(meshId: string): boolean;
|
|
|
35
35
|
export interface AddNodeOptions {
|
|
36
36
|
workspace: string;
|
|
37
37
|
repoRoot?: string;
|
|
38
|
+
daemonId?: string;
|
|
38
39
|
userOverrides?: Partial<RepoMeshNodeCapabilities>;
|
|
39
40
|
policy?: RepoMeshNodePolicy;
|
|
40
41
|
isLocalWorktree?: boolean;
|
|
42
|
+
worktreeBranch?: string;
|
|
43
|
+
clonedFromNodeId?: string;
|
|
41
44
|
}
|
|
42
45
|
export declare function addNode(meshId: string, opts: AddNodeOptions): LocalMeshNodeEntry | undefined;
|
|
43
46
|
export declare function removeNode(meshId: string, nodeId: string): boolean;
|
package/dist/git/git-types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* transports, and web-core. Git state is daemon-owned product truth; do not
|
|
6
6
|
* infer these values from agent transcripts in frontend code.
|
|
7
7
|
*/
|
|
8
|
-
export type GitFailureReason = 'not_git_repo' | 'git_not_installed' | 'timeout' | 'path_outside_repo' | 'dirty_index_required' | 'conflict' | 'invalid_args' | 'git_command_failed';
|
|
8
|
+
export type GitFailureReason = 'not_git_repo' | 'git_not_installed' | 'timeout' | 'path_outside_repo' | 'dirty_index_required' | 'conflict' | 'invalid_args' | 'nothing_to_commit' | 'git_command_failed';
|
|
9
9
|
export interface GitRepoIdentity {
|
|
10
10
|
workspace: string;
|
|
11
11
|
repoRoot: string | null;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Worktree — Create/remove/list worktrees for Repo Mesh node cloning
|
|
3
|
+
*
|
|
4
|
+
* Used by the `clone_mesh_node` daemon command to create isolated
|
|
5
|
+
* worktree-based nodes for parallel branch work within a mesh.
|
|
6
|
+
*
|
|
7
|
+
* Worktrees are placed outside the source repo to avoid .gitignore
|
|
8
|
+
* pollution and submodule conflicts:
|
|
9
|
+
* <repoParent>/.adhdev-worktrees/<meshName>/<branch>/
|
|
10
|
+
*/
|
|
11
|
+
export interface WorktreeCreateOptions {
|
|
12
|
+
/** Absolute path to the source repo's git root */
|
|
13
|
+
repoRoot: string;
|
|
14
|
+
/** Branch name for the new worktree */
|
|
15
|
+
branch: string;
|
|
16
|
+
/** Starting point for the branch (default: HEAD) */
|
|
17
|
+
baseBranch?: string;
|
|
18
|
+
/** Mesh name, used for organizing worktree directories */
|
|
19
|
+
meshName: string;
|
|
20
|
+
/** Override the auto-resolved target directory */
|
|
21
|
+
targetDir?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface WorktreeCreateResult {
|
|
24
|
+
success: true;
|
|
25
|
+
worktreePath: string;
|
|
26
|
+
branch: string;
|
|
27
|
+
}
|
|
28
|
+
export interface WorktreeEntry {
|
|
29
|
+
path: string;
|
|
30
|
+
head: string;
|
|
31
|
+
branch: string | null;
|
|
32
|
+
bare: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface WorktreeRemoveResult {
|
|
35
|
+
success: true;
|
|
36
|
+
removedPath: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Resolve the target directory for a new worktree.
|
|
40
|
+
* Places worktrees at: <repoParent>/.adhdev-worktrees/<meshName>/<branch>/
|
|
41
|
+
*/
|
|
42
|
+
export declare function resolveWorktreePath(repoRoot: string, meshName: string, branch: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Create a new git worktree with a fresh branch.
|
|
45
|
+
*
|
|
46
|
+
* Runs: git worktree add <targetDir> -b <branch> [baseBranch]
|
|
47
|
+
*/
|
|
48
|
+
export declare function createWorktree(opts: WorktreeCreateOptions): Promise<WorktreeCreateResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Remove a git worktree and clean up the directory.
|
|
51
|
+
*
|
|
52
|
+
* Runs: git worktree remove <worktreePath> --force
|
|
53
|
+
*/
|
|
54
|
+
export declare function removeWorktree(repoRoot: string, worktreePath: string): Promise<WorktreeRemoveResult>;
|
|
55
|
+
/**
|
|
56
|
+
* List all worktrees for a repository.
|
|
57
|
+
*
|
|
58
|
+
* Runs: git worktree list --porcelain
|
|
59
|
+
*/
|
|
60
|
+
export declare function listWorktrees(repoRoot: string): Promise<WorktreeEntry[]>;
|
|
61
|
+
/**
|
|
62
|
+
* Parse `git worktree list --porcelain` output into structured entries.
|
|
63
|
+
*/
|
|
64
|
+
export declare function parseWorktreeListOutput(output: string): WorktreeEntry[];
|
package/dist/git/index.d.ts
CHANGED
|
@@ -14,3 +14,5 @@ export { createDefaultGitCommandServices, handleGitCommand, isGitCommandName } f
|
|
|
14
14
|
export type { GitCommandResult, GitCommandServices, GitFileDiff, GitLogEntry, GitLogResult, } from './git-commands.js';
|
|
15
15
|
export { TurnSnapshotTracker } from './turn-snapshot-tracker.js';
|
|
16
16
|
export type { TurnCompletedCallback } from './turn-snapshot-tracker.js';
|
|
17
|
+
export { createWorktree, listWorktrees, parseWorktreeListOutput, removeWorktree, resolveWorktreePath, } from './git-worktree.js';
|
|
18
|
+
export type { WorktreeCreateOptions, WorktreeCreateResult, WorktreeEntry, WorktreeRemoveResult, } from './git-worktree.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export type { ChatBubbleState, ChatMessage, ExtensionInfo, CommandResult as CoreCommandResult, ProviderConfig, DaemonEvent, StatusResponse, SystemInfo, DetectedIde, ProviderInfo, AgentEntry, } from './types.js';
|
|
7
7
|
export type { SessionEntry, CompactSessionEntry, CompactDaemonEntry, CloudDaemonSummaryEntry, DashboardBootstrapDaemonEntry, VersionUpdateReason, CloudStatusReportPayload, DaemonStatusEventPayload, DashboardStatusEventPayload, SessionTransport, SessionKind, SessionCapability, AgentSessionStream, ReadChatCursor, ReadChatSyncResult, TransportTopic, SessionChatTailSubscriptionParams, SessionRuntimeOutputSubscriptionParams, MachineRuntimeSubscriptionParams, SessionHostDiagnosticsSubscriptionParams, SessionModalSubscriptionParams, DaemonMetadataSubscriptionParams, WorkspaceGitSubscriptionParams, SessionChatTailUpdate, MachineRuntimeUpdate, SessionHostDiagnosticsUpdate, SessionModalUpdate, DaemonMetadataUpdate, TopicUpdateEnvelope, SubscribeRequest, UnsubscribeRequest, StandaloneWsStatusPayload, AvailableProviderInfo, AcpConfigOption, AcpMode, ProviderControlSchema, StatusReportPayload, MachineInfo, SessionHostDiagnosticsSnapshot, SessionHostRecord, SessionHostWriteOwner, SessionHostAttachedClient, SessionHostLogEntry, SessionHostRequestTrace, SessionHostRuntimeTransition, DetectedIdeInfo, WorkspaceEntry, ProviderSummaryItem, ProviderSummaryMetadata, ProviderState, ProviderStatus, ProviderErrorReason, SessionActiveChatData, ActiveChatData, IdeProviderState, CliProviderState, AcpProviderState, ExtensionProviderState, } from './shared-types.js';
|
|
8
|
-
export type { RepoMesh, RepoMeshNode, RepoMeshNodeHealth, RepoMeshPolicy, RepoMeshNodePolicy, RepoMeshNodeCapabilities, DetectedCommand, ProjectContextSnapshot, ProjectContextSource, RepoMeshCoordinatorConfig, LocalMeshConfig, LocalMeshEntry, LocalMeshNodeEntry, RepoMeshStatus, RepoMeshNodeStatus, } from './repo-mesh-types.js';
|
|
8
|
+
export type { RepoMesh, RepoMeshNode, RepoMeshNodeHealth, RepoMeshPolicy, RepoMeshNodePolicy, RepoMeshRelatedRepo, RepoMeshNodeCapabilities, DetectedCommand, ProjectContextSnapshot, ProjectContextSource, RepoMeshCoordinatorConfig, LocalMeshConfig, LocalMeshEntry, LocalMeshNodeEntry, RepoMeshStatus, RepoMeshNodeStatus, } from './repo-mesh-types.js';
|
|
9
9
|
export { DEFAULT_MESH_POLICY } from './repo-mesh-types.js';
|
|
10
10
|
export * from './git/index.js';
|
|
11
11
|
import type { RuntimeWriteOwner as _RuntimeWriteOwner } from './shared-types-extra.js';
|
|
@@ -90,7 +90,7 @@ export type { ProviderModule, CdpTargetFilter, ProviderResumeCapability, InputEn
|
|
|
90
90
|
export type { ProviderSourceConfigSnapshot, ProviderSourceConfigUpdate } from './config/provider-source-config.js';
|
|
91
91
|
export { parseProviderSourceConfigUpdate } from './config/provider-source-config.js';
|
|
92
92
|
export { normalizeInputEnvelope, normalizeMessageParts, flattenMessageParts } from './providers/io-contracts.js';
|
|
93
|
-
export { BUILTIN_CHAT_MESSAGE_KINDS, isBuiltinChatMessageKind, normalizeChatMessageKind, resolveChatMessageKind, buildChatMessage, buildSystemChatMessage, buildRuntimeSystemChatMessage, buildAssistantChatMessage, buildThoughtChatMessage, buildToolChatMessage, buildTerminalChatMessage, buildUserChatMessage, normalizeChatMessage, normalizeChatMessages, } from './providers/chat-message-normalization.js';
|
|
93
|
+
export { BUILTIN_CHAT_MESSAGE_KINDS, isBuiltinChatMessageKind, normalizeChatMessageKind, resolveChatMessageKind, buildChatMessage, buildSystemChatMessage, buildRuntimeSystemChatMessage, buildAssistantChatMessage, buildThoughtChatMessage, buildToolChatMessage, buildTerminalChatMessage, buildUserChatMessage, normalizeChatMessage, normalizeChatMessages, isUserFacingChatMessage, filterUserFacingChatMessages, } from './providers/chat-message-normalization.js';
|
|
94
94
|
export type { BuiltinChatMessageKind, ChatMessageKind } from './providers/chat-message-normalization.js';
|
|
95
95
|
export { VersionArchive, detectAllVersions } from './providers/version-archive.js';
|
|
96
96
|
export type { ProviderVersionInfo, VersionHistory } from './providers/version-archive.js';
|