@adhdev/daemon-core 1.0.18-rc.20 → 1.0.18-rc.4

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.
Files changed (74) hide show
  1. package/dist/cli-adapters/provider-cli-shared.d.ts +0 -33
  2. package/dist/commands/cli-manager.d.ts +0 -9
  3. package/dist/commands/upgrade-helper.d.ts +0 -1
  4. package/dist/commands/windows-atomic-upgrade.d.ts +0 -5
  5. package/dist/config/mesh-json-config.d.ts +0 -62
  6. package/dist/index.d.ts +2 -4
  7. package/dist/index.js +3998 -6112
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +3855 -5966
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/mesh/coordinator-prompt.d.ts +0 -76
  12. package/dist/mesh/mesh-active-work.d.ts +1 -1
  13. package/dist/mesh/mesh-ledger.d.ts +1 -28
  14. package/dist/mesh/mesh-node-identity.d.ts +0 -23
  15. package/dist/mesh/mesh-refine-gates.d.ts +0 -89
  16. package/dist/mesh/mesh-remote-event-pull.d.ts +0 -3
  17. package/dist/mesh/mesh-runtime-store.d.ts +0 -11
  18. package/dist/mesh/mesh-work-queue.d.ts +1 -24
  19. package/dist/providers/chat-message-normalization.d.ts +0 -22
  20. package/dist/providers/cli-provider-instance-types.d.ts +0 -4
  21. package/dist/providers/cli-provider-instance.d.ts +0 -78
  22. package/dist/providers/contracts.d.ts +0 -17
  23. package/dist/providers/provider-schema.d.ts +0 -1
  24. package/dist/providers/sdk/v1/builders/cli/detect-status.d.ts +0 -14
  25. package/dist/providers/types/interactive-prompt.d.ts +0 -18
  26. package/dist/repo-mesh-types.d.ts +6 -38
  27. package/dist/shared-types.d.ts +2 -4
  28. package/package.json +3 -3
  29. package/src/boot/daemon-lifecycle.ts +0 -10
  30. package/src/cli-adapters/cli-state-engine.ts +1 -17
  31. package/src/cli-adapters/provider-cli-adapter.ts +6 -2
  32. package/src/cli-adapters/provider-cli-shared.ts +0 -48
  33. package/src/commands/cli-manager.ts +8 -72
  34. package/src/commands/high-family/mesh-coordinator-launch.ts +2 -17
  35. package/src/commands/high-family/mesh-events.ts +2 -13
  36. package/src/commands/med-family/mesh-crud.ts +0 -155
  37. package/src/commands/med-family/mesh-queue.ts +1 -74
  38. package/src/commands/router-refine.ts +4 -71
  39. package/src/commands/router.ts +0 -8
  40. package/src/commands/upgrade-helper.ts +15 -78
  41. package/src/commands/windows-atomic-upgrade.ts +40 -194
  42. package/src/config/mesh-json-config.ts +0 -111
  43. package/src/index.ts +1 -21
  44. package/src/mesh/coordinator-prompt.ts +11 -258
  45. package/src/mesh/mesh-active-work.ts +1 -11
  46. package/src/mesh/mesh-completion-synthesis.ts +1 -12
  47. package/src/mesh/mesh-event-classify.ts +0 -19
  48. package/src/mesh/mesh-event-forwarding.ts +6 -64
  49. package/src/mesh/mesh-events-utils.ts +0 -42
  50. package/src/mesh/mesh-ledger.ts +0 -77
  51. package/src/mesh/mesh-node-identity.ts +0 -49
  52. package/src/mesh/mesh-queue-assignment.ts +11 -210
  53. package/src/mesh/mesh-reconcile-loop.ts +3 -306
  54. package/src/mesh/mesh-refine-gates.ts +0 -300
  55. package/src/mesh/mesh-remote-event-pull.ts +47 -68
  56. package/src/mesh/mesh-runtime-store.ts +0 -21
  57. package/src/mesh/mesh-work-queue.ts +2 -85
  58. package/src/providers/chat-message-normalization.ts +0 -53
  59. package/src/providers/cli-provider-instance-types.ts +0 -53
  60. package/src/providers/cli-provider-instance.ts +15 -497
  61. package/src/providers/contracts.ts +1 -25
  62. package/src/providers/provider-schema.ts +0 -83
  63. package/src/providers/sdk/v1/builders/cli/detect-status.ts +0 -23
  64. package/src/providers/sdk/v1/builders/cli/parse-approval.ts +0 -20
  65. package/src/providers/sdk/v1/schemas/cli/provider.schema.json +0 -44
  66. package/src/providers/types/interactive-prompt.ts +0 -77
  67. package/src/repo-mesh-types.ts +12 -112
  68. package/src/shared-types.ts +1 -9
  69. package/src/status/reporter.ts +0 -1
  70. package/src/status/snapshot.ts +0 -2
  71. package/dist/mesh/mesh-disk-retention.d.ts +0 -105
  72. package/dist/providers/auto-approve-modes.d.ts +0 -14
  73. package/src/mesh/mesh-disk-retention.ts +0 -370
  74. package/src/providers/auto-approve-modes.ts +0 -103
@@ -270,39 +270,6 @@ export interface CliProviderModule {
270
270
  _resolvedScriptsSource?: string | null;
271
271
  _versionWarning?: string | null;
272
272
  }
273
- /**
274
- * PURE-PTY TRANSCRIPT CLASS predicate (kimi and kin).
275
- *
276
- * A provider is "pure-PTY full-buffer" when it reconstructs its ENTIRE transcript
277
- * from the rendered PTY buffer on every read and has NO alternate transcript
278
- * source:
279
- * - transcriptAuthority !== 'provider' (the daemon PTY parser owns the transcript,
280
- * not a provider-side canonical source)
281
- * - NO nativeHistory (no on-disk / native-source history to fall back to)
282
- * - tui.transcriptPty.scope === 'buffer' (the parser walks the full rendered buffer)
283
- *
284
- * This class is invisible to two provider-authority-keyed code paths that other
285
- * providers rely on for mesh completion semantics:
286
- * 1. CliStateEngine.onTurnStarted only promotes to 'generating' for
287
- * transcriptAuthority==='provider' providers — so a pure-PTY session that
288
- * submits a prompt while already idle collapses idle→idle, the
289
- * generating→idle edge never occurs, and agent:generating_completed is never
290
- * emitted (the coordinator ledger leaves the task 'assigned' forever).
291
- * 2. checkMeshWorkerStall's native-transcript completion reconcile is gated on
292
- * the native-source shape, so a finished pure-PTY worker's static idle is
293
- * misread as monitor:no_progress (a false task_stalled).
294
- *
295
- * The runtime capability, NOT any single spec field value, is authoritative: a
296
- * given kimi manifest checkout may declare nativeHistory/transcriptAuthority, but
297
- * the live-loaded pure-PTY session has none. Callers that only hold a
298
- * CliProviderModule (the engine) share this exact predicate with the adapter
299
- * (parsesFullPtyTranscriptFromBuffer) so the two never drift.
300
- */
301
- export declare function isPurePtyTranscriptProvider(provider: {
302
- transcriptAuthority?: 'provider' | 'daemon';
303
- nativeHistory?: unknown;
304
- tui?: Record<string, unknown>;
305
- } | null | undefined): boolean;
306
273
  /**
307
274
  * Stateful, transcript-oriented terminal cell accumulator.
308
275
  *
@@ -131,15 +131,6 @@ export declare function expandModelLaunchArgs(template: string[] | undefined, mo
131
131
  * thinking request without a template is a no-op). BRAIN-ROUTING thinking axis.
132
132
  */
133
133
  export declare function expandThinkingLaunchArgs(template: string[] | undefined, level: string | undefined, levelMap: Partial<Record<string, string>> | undefined): string[] | undefined;
134
- /**
135
- * Apply a selected launch-args auto-approve mode without mutating provider metadata.
136
- * removeArgs only targets provider-owned base spawn.args; launchArgs are prepended to
137
- * per-launch args beside model/thinking args, making conflict removal order-independent.
138
- */
139
- export declare function applyAutoApproveModeLaunchArgs(provider: ProviderModule | undefined, cliArgs: string[] | undefined, settings: Record<string, unknown> | undefined): {
140
- provider: ProviderModule | undefined;
141
- cliArgs: string[] | undefined;
142
- };
143
134
  export declare function supportsExplicitSessionResume(resume?: ProviderResumeCapability): boolean;
144
135
  export declare function resolveCliSessionBinding(provider: ProviderModule | undefined, normalizedType: string, cliArgs?: string[], requestedResumeSessionId?: string): CliSessionBinding;
145
136
  export declare class DaemonCliManager {
@@ -29,7 +29,6 @@ export declare function resolveCurrentGlobalInstallSurface(options: {
29
29
  currentCliPath?: string;
30
30
  nodeExecutable?: string;
31
31
  platform?: NodeJS.Platform;
32
- homeDir?: string;
33
32
  }): CurrentGlobalInstallSurface;
34
33
  export declare function buildPinnedGlobalInstallCommand(options: {
35
34
  packageName: string;
@@ -1,5 +1,4 @@
1
1
  import { type ChildProcess } from 'child_process';
2
- export declare const DEFAULT_HEALTH_TIMEOUT_MS = 120000;
3
2
  export declare const ADHDEV_OWNED_MARKERS: readonly ["session-host-daemon", "node_modules/adhdev", "node_modules/@adhdev/daemon-standalone"];
4
3
  export interface WindowsInstallerLayout {
5
4
  homeDir: string;
@@ -47,10 +46,6 @@ export declare function createDefaultWindowsAtomicHooks(options: {
47
46
  cwd: string;
48
47
  env: NodeJS.ProcessEnv;
49
48
  log: (message: string) => void;
50
- /** Loopback IPC port to probe for health/version. Defaults to the daemon's local IPC port. */
51
- healthPort?: number;
52
- /** How long to poll for the replacement daemon to report the target version. */
53
- healthTimeoutMs?: number;
54
49
  }): WindowsAtomicUpgradeHooks;
55
50
  export declare function boundedCleanupInactivePrefixes(layout: WindowsInstallerLayout, activePrefix: string, log: (message: string) => void): void;
56
51
  export declare function cleanupInactivePrefixesWithGuard(options: {
@@ -19,18 +19,6 @@
19
19
  * machine-local policy directly. The repo file shapes the coordinator prompt and
20
20
  * operating notes, nothing else.
21
21
  *
22
- * `providerDefaults` IS NOT POLICY EITHER. It is a repo-shared DECLARATIVE
23
- * "requested auto-approve mode" per providerType — the answer to "WHEN a delegated
24
- * worker of type X is auto-approved, WHICH mode should it use by default". It has
25
- * NO say over WHETHER auto-approve is enabled: the ENABLE decision (and the
26
- * dangerous-mode opt-in) remains 100% machine-local (meshes.json /
27
- * RepoMeshPolicy). A repo can declare `providerDefaults` freely; a machine that
28
- * has delegatedWorkerAutoApprove=false still gets no auto-approve, and a dangerous
29
- * requested mode is still downgraded to PTY parsing unless the machine opts in.
30
- * The requested mode ID is validated at runtime against the provider spec — an
31
- * unknown mode ID is IGNORED (fall back to the provider's own default), never
32
- * silently coerced into a dangerous mode.
33
- *
34
22
  * The coordinator/operatingNotes merge is **in-memory only**: the on-disk
35
23
  * machine-local `meshes.json` is never mutated by this module.
36
24
  *
@@ -60,18 +48,6 @@ export interface RepoMeshDeclarativeLimits {
60
48
  /** Advisory only in v1 — recorded but never enforced. */
61
49
  maxNotes?: number;
62
50
  }
63
- /**
64
- * Repo-shared declarative per-provider defaults. NOT policy — see the file header.
65
- * `autoApproveModes` maps a providerType (e.g. "claude-cli") to the auto-approve
66
- * mode ID that a delegated worker of that type should REQUEST when it is
67
- * auto-approved. The map only influences WHICH mode is used, never WHETHER
68
- * auto-approve is enabled (that stays machine-local). Mode IDs are validated
69
- * against the live provider spec at resolve time; an unknown ID is ignored.
70
- */
71
- export interface RepoMeshDeclarativeProviderDefaults {
72
- /** providerType → requested auto-approve mode ID. */
73
- autoApproveModes?: Record<string, string>;
74
- }
75
51
  /**
76
52
  * Parsed + normalized `.adhdev/mesh.json` shape. Every field is optional except
77
53
  * version so a repo can declare only the zone(s) it cares about. Policy is NOT a
@@ -82,8 +58,6 @@ export interface RepoMeshDeclarativeConfig {
82
58
  coordinator?: RepoMeshDeclarativeCoordinatorConfig;
83
59
  operatingNotes?: CoordinatorOperatingNote[];
84
60
  limits?: RepoMeshDeclarativeLimits;
85
- /** Repo-shared per-provider defaults (requested auto-approve mode). NOT policy. */
86
- providerDefaults?: RepoMeshDeclarativeProviderDefaults;
87
61
  }
88
62
  export interface RepoMeshJsonConfigLoadResult {
89
63
  config?: RepoMeshDeclarativeConfig;
@@ -159,18 +133,6 @@ export declare const MESH_JSON_CONFIG_SCHEMA: {
159
133
  };
160
134
  };
161
135
  };
162
- readonly providerDefaults: {
163
- readonly type: "object";
164
- readonly additionalProperties: false;
165
- readonly properties: {
166
- readonly autoApproveModes: {
167
- readonly type: "object";
168
- readonly additionalProperties: {
169
- readonly type: "string";
170
- };
171
- };
172
- };
173
- };
174
136
  };
175
137
  };
176
138
  /**
@@ -231,31 +193,7 @@ export declare function applyRepoMeshConfig<T extends Pick<LocalMeshEntry, 'coor
231
193
  * exported — it is machine-local only and has no place in mesh.json. Operating
232
194
  * notes are intentionally NOT exported either: those are runtime ledger lessons,
233
195
  * and a repo should declare baseline notes deliberately.
234
- *
235
- * `providerDefaults` is NOT auto-exported from the machine-local mesh (there is no
236
- * machine-local source for it — it is a repo-authored declaration). To help an
237
- * operator hand-author it, the scaffold carries a commented example shape:
238
- *
239
- * "providerDefaults": {
240
- * "autoApproveModes": {
241
- * "claude-cli": "accept-edits", // requested mode WHEN auto-approve is on
242
- * "codex-cli": "auto" // (enable/dangerous opt-in stays machine-local)
243
- * }
244
- * }
245
- *
246
- * The example is surfaced via the scaffold's `_providerDefaultsExample` hint (JSON
247
- * has no comments) rather than a live `providerDefaults` value, so serializing the
248
- * scaffold never writes an unwanted requested-mode map into the repo file.
249
196
  */
250
197
  export declare function buildMeshJsonConfigScaffold(mesh: Pick<LocalMeshEntry, 'coordinator'>): RepoMeshDeclarativeConfig;
251
- /**
252
- * A copy-paste example of the `providerDefaults` zone for operators hand-authoring
253
- * a repo `.adhdev/mesh.json`. Returned by the export/write commands as a separate
254
- * hint field (never merged into the serialized scaffold) so the repo file stays
255
- * clean. The mode IDs shown are illustrative — a repo should use IDs that exist in
256
- * its own providers' specs; an unknown ID is ignored at resolve time and the
257
- * provider's own default is used.
258
- */
259
- export declare const MESH_JSON_PROVIDER_DEFAULTS_EXAMPLE: RepoMeshDeclarativeProviderDefaults;
260
198
  /** Serialize a scaffold to the canonical 2-space JSON draft text. */
261
199
  export declare function serializeMeshJsonConfigScaffold(config: RepoMeshDeclarativeConfig): string;
package/dist/index.d.ts CHANGED
@@ -8,9 +8,7 @@ export type { SessionEntry, CompactSessionEntry, CompactDaemonEntry, CloudDaemon
8
8
  export type { InteractivePrompt, InteractiveQuestion, InteractiveOption, InteractivePromptResponse, InteractiveAnswer, } from './providers/types/interactive-prompt.js';
9
9
  export { normalizeInteractivePrompt, normalizeInteractivePromptResponse, buildClaudeInteractiveToolResult, interactivePromptFromClaudeAskUserQuestion, detectClaudeAskUserQuestionPromptFromJson, } from './providers/types/interactive-prompt.js';
10
10
  export type { RepoMesh, RepoMeshDaemonRole, RepoMeshHostMetadata, RepoMeshHostPairingMetadata, RepoMeshHostStatus, RepoMeshNode, RepoMeshNodeHealth, RepoMeshPolicy, RepoMeshMagiSessionCleanupMode, RepoMeshNodePolicy, RepoMeshRelatedRepo, RepoMeshNodeCapabilities, DetectedCommand, ProjectContextSnapshot, ProjectContextSource, RepoMeshCoordinatorConfig, LocalMeshConfig, LocalMeshEntry, LocalMeshNodeEntry, RepoMeshStatus, RepoMeshNodeStatus, RepoMeshPeerConnectionStatus, RepoMeshPeerConnectionState, RepoMeshPeerConnectionTransport, RepoMeshSessionStatus, RepoMeshQueueTask, RepoMeshQueueTaskStatus, RepoMeshQueueSummary, RepoMeshQueueStatus, RepoMeshLedgerEntryStatus, RepoMeshLedgerSummaryStatus, RepoMeshLedgerStatus, MeshAsyncJobLifecycle, RepoMeshSchedulingStrategy, RepoMeshSchedulingStatus, RepoMeshNodeSchedulingStatus, RepoMeshNodeProviderSchedulingStatus, } from './repo-mesh-types.js';
11
- export { DEFAULT_MESH_POLICY, resolveDelegatedWorkerAutoApprove, delegatedWorkerAutoApproveSettings, resolveDelegatedWorkerDangerousModeAllow, resolveAllowSendKeysDestructive, resolveMagiSessionCleanupMode, magiAutoLaunchedSessionCleanupDecision, MESH_SCHEDULING_STRATEGIES, DEFAULT_MESH_SCHEDULING_STRATEGY, normalizeMeshSchedulingStrategy, resolveNodeSchedulingPriority, resolveProviderMaxParallel, mergeAndNormalizePolicy, normalizeAutoFastForwardPolicy, resolveMaxParallelTasks, MESH_MAX_PARALLEL_TASKS_MIN, MESH_MAX_PARALLEL_TASKS_MAX, MESH_CONVERGE_REFINE_TAG, MESH_CONVERGE_FAST_FORWARD_TAG, resolveAutoConvergeCodeChange, } from './repo-mesh-types.js';
12
- export { loadRepoMeshJsonConfig, normalizeRepoMeshDeclarativeConfig, buildMeshJsonConfigScaffold, serializeMeshJsonConfigScaffold, MESH_JSON_CONFIG_LOCATIONS, MESH_JSON_CONFIG_SCHEMA, MESH_JSON_PROVIDER_DEFAULTS_EXAMPLE, } from './config/mesh-json-config.js';
13
- export type { RepoMeshDeclarativeConfig, RepoMeshDeclarativeCoordinatorConfig, RepoMeshDeclarativeLimits, RepoMeshDeclarativeProviderDefaults, RepoMeshJsonConfigLoadResult, } from './config/mesh-json-config.js';
11
+ export { DEFAULT_MESH_POLICY, resolveDelegatedWorkerAutoApprove, resolveAllowSendKeysDestructive, resolveMagiSessionCleanupMode, magiAutoLaunchedSessionCleanupDecision, MESH_SCHEDULING_STRATEGIES, DEFAULT_MESH_SCHEDULING_STRATEGY, normalizeMeshSchedulingStrategy, resolveNodeSchedulingPriority, resolveProviderMaxParallel, mergeAndNormalizePolicy, normalizeAutoFastForwardPolicy, resolveMaxParallelTasks, MESH_MAX_PARALLEL_TASKS_MIN, MESH_MAX_PARALLEL_TASKS_MAX, MESH_CONVERGE_REFINE_TAG, MESH_CONVERGE_FAST_FORWARD_TAG, resolveAutoConvergeCodeChange, } from './repo-mesh-types.js';
14
12
  export * from './git/index.js';
15
13
  import type { RuntimeWriteOwner as _RuntimeWriteOwner } from './shared-types-extra.js';
16
14
  import type { RuntimeAttachedClient as _RuntimeAttachedClient } from './shared-types-extra.js';
@@ -139,7 +137,7 @@ export { ProviderInstanceManager } from './providers/provider-instance-manager.j
139
137
  export { IdeProviderInstance } from './providers/ide-provider-instance.js';
140
138
  export { CliProviderInstance } from './providers/cli-provider-instance.js';
141
139
  export { AcpProviderInstance } from './providers/acp-provider-instance.js';
142
- export type { ProviderModule, AutoApproveMode, AutoApproveModesConfig, AutoApproveModeRisk, AutoApproveModeStrategy, CdpTargetFilter, ProviderResumeCapability, InputEnvelope, InputPart, MessagePart, ReadChatTurnStatus, ControlListResult, ControlSetResult, ControlInvokeResult } from './providers/contracts.js';
140
+ export type { ProviderModule, CdpTargetFilter, ProviderResumeCapability, InputEnvelope, InputPart, MessagePart, ReadChatTurnStatus, ControlListResult, ControlSetResult, ControlInvokeResult } from './providers/contracts.js';
143
141
  export type { ProviderSourceConfigSnapshot, ProviderSourceConfigUpdate } from './config/provider-source-config.js';
144
142
  export { parseProviderSourceConfigUpdate } from './config/provider-source-config.js';
145
143
  export { normalizeInputEnvelope, normalizeMessageParts, flattenMessageParts } from './providers/io-contracts.js';