@adhdev/daemon-core 0.9.82-rc.160 → 0.9.82-rc.162
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 +14 -1
- package/dist/commands/mesh-coordinator.d.ts +72 -1
- package/dist/config/chat-history.d.ts +2 -0
- package/dist/config/mesh-config.d.ts +3 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +4924 -1411
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4976 -1476
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/coordinator-prompt.d.ts +30 -0
- package/dist/mesh/coordinator-registry.d.ts +35 -1
- package/dist/providers/cli-provider-instance.d.ts +1 -1
- package/dist/providers/contracts.d.ts +48 -0
- package/dist/providers/native-history/antigravity-cli-transcript.d.ts +1 -1
- package/dist/providers/native-history/claude-cli-transcript.d.ts +1 -1
- package/dist/providers/native-history/codex-cli-transcript.d.ts +1 -1
- package/dist/providers/native-history/dispatcher.d.ts +24 -0
- package/dist/providers/native-history/hermes-cli-transcript.d.ts +30 -0
- package/dist/providers/native-history/index.d.ts +2 -0
- package/dist/providers/spec/adapter.d.ts +56 -0
- package/dist/providers/spec/cli-adapter.d.ts +76 -0
- package/dist/providers/spec/driver.d.ts +148 -0
- package/dist/providers/spec/evaluator.d.ts +47 -0
- package/dist/providers/spec/loader.d.ts +14 -0
- package/dist/providers/spec/native-history-executor.d.ts +39 -0
- package/dist/providers/spec/route.d.ts +4 -0
- package/dist/providers/spec/schema.gen.d.ts +507 -0
- package/dist/providers/spec/types.d.ts +211 -0
- package/dist/repo-mesh-types.d.ts +33 -1
- package/dist/sessions/registry.d.ts +3 -0
- package/package.json +2 -1
- package/src/cli-adapter-types.ts +15 -1
- package/src/commands/chat-commands.ts +150 -12
- package/src/commands/cli-manager.ts +11 -0
- package/src/commands/mesh-coordinator.ts +235 -1
- package/src/commands/router.ts +238 -50
- package/src/config/chat-history.ts +11 -3
- package/src/config/mesh-config.ts +16 -1
- package/src/index.ts +19 -0
- package/src/mesh/coordinator-prompt.ts +164 -8
- package/src/mesh/coordinator-registry.ts +50 -4
- package/src/providers/cli-provider-instance.ts +8 -3
- package/src/providers/contracts.ts +53 -0
- package/src/providers/native-history/antigravity-cli-transcript.ts +2 -2
- package/src/providers/native-history/claude-cli-transcript.ts +1 -1
- package/src/providers/native-history/codex-cli-transcript.ts +1 -1
- package/src/providers/native-history/dispatcher.ts +227 -0
- package/src/providers/native-history/hermes-cli-transcript.ts +230 -0
- package/src/providers/native-history/index.ts +7 -0
- package/src/providers/provider-loader.ts +126 -3
- package/src/providers/sdk/v1/schemas/cli/provider.schema.json +13 -0
- package/src/providers/spec/adapter.ts +168 -0
- package/src/providers/spec/cli-adapter.ts +318 -0
- package/src/providers/spec/driver.ts +498 -0
- package/src/providers/spec/evaluator.ts +268 -0
- package/src/providers/spec/loader.ts +130 -0
- package/src/providers/spec/native-history-executor.ts +612 -0
- package/src/providers/spec/route.ts +51 -0
- package/src/providers/spec/schema.gen.ts +507 -0
- package/src/providers/spec/schema.json +210 -0
- package/src/providers/spec/types.ts +230 -0
- package/src/repo-mesh-types.ts +33 -1
- package/src/sessions/registry.ts +3 -0
|
@@ -11,6 +11,9 @@ export interface CliAdapterStatus {
|
|
|
11
11
|
message: string;
|
|
12
12
|
buttons: string[];
|
|
13
13
|
} | null;
|
|
14
|
+
providerSessionId?: string;
|
|
15
|
+
errorMessage?: string;
|
|
16
|
+
errorReason?: string;
|
|
14
17
|
}
|
|
15
18
|
export interface AcpAdapterHandle {
|
|
16
19
|
onEvent(event: string, data?: unknown): void;
|
|
@@ -38,7 +41,9 @@ export interface CliAdapter {
|
|
|
38
41
|
force?: boolean;
|
|
39
42
|
}): Promise<void>;
|
|
40
43
|
forceSendMessage?(text: string): Promise<void>;
|
|
41
|
-
getStatus(
|
|
44
|
+
getStatus(options?: {
|
|
45
|
+
allowParse?: boolean;
|
|
46
|
+
}): CliAdapterStatus;
|
|
42
47
|
getScriptParsedStatus?(): unknown;
|
|
43
48
|
getDebugSnapshot?(): unknown;
|
|
44
49
|
invokeScript?(scriptName: string, args?: Record<string, unknown>): Promise<unknown>;
|
|
@@ -60,4 +65,12 @@ export interface CliAdapter {
|
|
|
60
65
|
setOnPtyData?(callback: (data: string) => void): void;
|
|
61
66
|
writeRaw?(data: string): void;
|
|
62
67
|
resize?(cols: number, rows: number): void;
|
|
68
|
+
getRuntimeMetadata?(): unknown;
|
|
69
|
+
updateRuntimeMeta?(meta: Record<string, unknown>): void;
|
|
70
|
+
refreshProviderDefinition?(provider: unknown): void;
|
|
71
|
+
}
|
|
72
|
+
export interface CliAdapterStatusOptional {
|
|
73
|
+
providerSessionId?: string;
|
|
74
|
+
errorMessage?: string;
|
|
75
|
+
errorReason?: string;
|
|
63
76
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MeshCoordinatorMcpConfigFormat, MeshCoordinatorSystemPromptInjection, ProviderModule } from '../providers/contracts.js';
|
|
2
2
|
export interface MeshCoordinatorMcpServerLaunch {
|
|
3
3
|
command: string;
|
|
4
4
|
args: string[];
|
|
@@ -42,3 +42,74 @@ export interface ResolveMeshCoordinatorSetupOptions {
|
|
|
42
42
|
}
|
|
43
43
|
export declare function createHermesManualMeshCoordinatorSetup(meshId: string, workspace: string): MeshCoordinatorSetup;
|
|
44
44
|
export declare function resolveMeshCoordinatorSetup(options: ResolveMeshCoordinatorSetupOptions): MeshCoordinatorSetup;
|
|
45
|
+
/**
|
|
46
|
+
* Apply a provider's declared system-prompt injection rule, mutating `cliArgs`
|
|
47
|
+
* and `launchEnv` in place and writing any required workspace context file.
|
|
48
|
+
*
|
|
49
|
+
* Replaces the previous hard-coded `if (cliType === 'claude-cli') ... else if
|
|
50
|
+
* (cliType === 'hermes-cli') ...` branches in router.ts. Adding a new CLI is
|
|
51
|
+
* now provider.v1.json data, not a router edit.
|
|
52
|
+
*
|
|
53
|
+
* Failures are non-fatal: log and continue with whatever was applied so the
|
|
54
|
+
* coordinator session still launches, just without the prompt for that
|
|
55
|
+
* provider. A missing/unknown rule means "skip injection" — safe by default
|
|
56
|
+
* (the previous fallback unconditionally pushed --append-system-prompt onto
|
|
57
|
+
* every non-Claude CLI, which crashed agy on launch).
|
|
58
|
+
*/
|
|
59
|
+
export interface CoordinatorInjectionEffect {
|
|
60
|
+
/** Absolute path the daemon wrote a wrapper-blocked file to. Only set for
|
|
61
|
+
* context_file injection. R48 schedules a strip after launch so workers
|
|
62
|
+
* don't see the wrapper on disk; R47's unregister cleanup uses it as a
|
|
63
|
+
* fallback if the timer never fires (process crash, etc). */
|
|
64
|
+
contextFilePath?: string;
|
|
65
|
+
}
|
|
66
|
+
export declare function applyMeshCoordinatorSystemPromptInjection(systemPrompt: string, injection: MeshCoordinatorSystemPromptInjection | undefined, ctx: {
|
|
67
|
+
cliArgs: string[];
|
|
68
|
+
launchEnv: Record<string, string>;
|
|
69
|
+
workspace: string;
|
|
70
|
+
cliType: string;
|
|
71
|
+
}): CoordinatorInjectionEffect;
|
|
72
|
+
/**
|
|
73
|
+
* Strip the daemon's wrapper block from a context_file we previously wrote.
|
|
74
|
+
*
|
|
75
|
+
* Used in two places:
|
|
76
|
+
* 1. R48 inject-then-remove: ~5s after spawn, after agy/gemini have read
|
|
77
|
+
* the file into their in-memory system-prompt cache. Removing it from
|
|
78
|
+
* disk at that point doesn't affect the running coordinator but keeps
|
|
79
|
+
* worker sessions (or fresh non-coordinator launches) in the same
|
|
80
|
+
* workspace from picking up our wrapper.
|
|
81
|
+
* 2. R47 unregister fallback: if the timer never fires (process crash,
|
|
82
|
+
* kill -9), coordinator-registry.unregisterMeshCoordinator runs the
|
|
83
|
+
* same logic when its entry is dropped.
|
|
84
|
+
*
|
|
85
|
+
* Idempotent: missing file is fine, missing sentinels are fine, returns
|
|
86
|
+
* silently. Leaves user-authored content outside the sentinels intact.
|
|
87
|
+
* Deletes the file outright if our wrapper was the only content.
|
|
88
|
+
*/
|
|
89
|
+
export declare function stripCoordinatorWrapperFile(filePath: string): void;
|
|
90
|
+
export interface PtyExecResult {
|
|
91
|
+
exitCode: number | null;
|
|
92
|
+
signal: number | null;
|
|
93
|
+
output: string;
|
|
94
|
+
timedOut: boolean;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Run a one-shot CLI command under a real PTY and collect its output.
|
|
98
|
+
*
|
|
99
|
+
* Some provider mcp-registration commands (`agy mcp add`, future bubbletea
|
|
100
|
+
* TUIs) refuse to run without `/dev/tty`. Daemon-side `execFileSync` runs
|
|
101
|
+
* pipe-only, so those commands fail with errors like
|
|
102
|
+
* `bubbletea: error opening TTY: open /dev/tty: device not configured`
|
|
103
|
+
* and silently skip the registration, leaving the launched session
|
|
104
|
+
* without the adhdev-mesh MCP tools — which is exactly what we saw with
|
|
105
|
+
* agy coordinators.
|
|
106
|
+
*
|
|
107
|
+
* Wrapping the registration through node-pty gives the child a real PTY,
|
|
108
|
+
* so the bubbletea check passes. We close stdin immediately and just
|
|
109
|
+
* collect stdout until the process exits or the timeout fires.
|
|
110
|
+
*/
|
|
111
|
+
export declare function execUnderPty(command: string, args: string[], options?: {
|
|
112
|
+
cwd?: string;
|
|
113
|
+
env?: Record<string, string>;
|
|
114
|
+
timeoutMs?: number;
|
|
115
|
+
}): Promise<PtyExecResult>;
|
|
@@ -111,6 +111,8 @@ export declare function readProviderChatHistory(agentType: string, options?: {
|
|
|
111
111
|
historyBehavior?: ProviderHistoryBehavior;
|
|
112
112
|
scripts?: ProviderNativeHistoryScripts;
|
|
113
113
|
excludeInProgressTurn?: boolean;
|
|
114
|
+
sessionStartedAtMs?: number;
|
|
115
|
+
envOverrides?: Record<string, string>;
|
|
114
116
|
}): {
|
|
115
117
|
messages: HistoryMessage[];
|
|
116
118
|
hasMore: boolean;
|
|
@@ -115,4 +115,7 @@ export declare function updateNode(meshId: string, nodeId: string, opts: {
|
|
|
115
115
|
userOverrides?: Partial<RepoMeshNodeCapabilities>;
|
|
116
116
|
policy?: RepoMeshNodePolicy;
|
|
117
117
|
worktreeBootstrap?: LocalMeshNodeEntry['worktreeBootstrap'];
|
|
118
|
+
/** Per-node instruction surfaced in the coordinator prompt. Pass an
|
|
119
|
+
* empty string or undefined to clear it. */
|
|
120
|
+
systemPrompt?: string;
|
|
118
121
|
}): LocalMeshNodeEntry | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -135,4 +135,15 @@ export type { ExtensionInfo as InstallerExtensionInfo } from './installer.js';
|
|
|
135
135
|
export { initDaemonComponents, startDaemonDevSupport, shutdownDaemonComponents } from './boot/daemon-lifecycle.js';
|
|
136
136
|
export type { DaemonInitConfig, DaemonComponents, DaemonDevSupportOptions } from './boot/daemon-lifecycle.js';
|
|
137
137
|
export { startLocalIpcServer, buildIpcStatusHttpResponse, type LocalIpcServerOptions, type LocalIpcServerHandle, type IpcCommandContext, type IpcCommandResult, type IpcStatusPayload, } from './ipc/local-ipc-server.js';
|
|
138
|
+
export { evaluate as evaluateSpec, evaluate } from './providers/spec/evaluator.js';
|
|
139
|
+
export { loadSpec, resolveSpecPath } from './providers/spec/loader.js';
|
|
140
|
+
export { createNativeHistoryDispatcher } from './providers/native-history/index.js';
|
|
141
|
+
export type { ReaderId } from './providers/native-history/index.js';
|
|
142
|
+
export { readClaudeCliSession, readCodexCliSession, readAntigravityCliSession, readHermesCliSession, } from './providers/native-history/index.js';
|
|
143
|
+
export type { CliSpec, SpecState, ControlAction, Control, NotificationRule, DelegateTrigger, Section, } from './providers/spec/types.js';
|
|
144
|
+
export type { SpecEvaluation, TraceEntry } from './providers/spec/evaluator.js';
|
|
145
|
+
export { SpecDriver } from './providers/spec/driver.js';
|
|
146
|
+
export type { DashboardEvent, DashboardCommand, SpecDriverOpts } from './providers/spec/driver.js';
|
|
147
|
+
export { TerminalAdapter } from './providers/spec/adapter.js';
|
|
148
|
+
export type { TerminalAdapterOpts, TerminalAdapterHandlers } from './providers/spec/adapter.js';
|
|
138
149
|
export { validateCliProviderManifest, formatManifestValidationIssues, type ManifestValidationIssue, type ManifestValidationResult, V1_CONTRACT_VERSION, V1_PRIMITIVE_CATALOG, V1_ALL_PRIMITIVES, } from './providers/sdk/v1/index.js';
|