@adhdev/daemon-core 0.9.82-rc.32 → 0.9.82-rc.320
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/boot/daemon-lifecycle.d.ts +8 -0
- package/dist/boot/process-hardening.d.ts +50 -0
- package/dist/build-info.d.ts +37 -0
- package/dist/chat/source-machine.d.ts +166 -0
- package/dist/chat/source-resolver.d.ts +104 -0
- package/dist/chat/subscription-updates.d.ts +1 -0
- package/dist/cli-adapter-types.d.ts +46 -2
- package/dist/cli-adapters/cli-script-runner.d.ts +117 -0
- package/dist/cli-adapters/cli-state-engine.d.ts +198 -0
- package/dist/cli-adapters/provider-cli-adapter.d.ts +115 -64
- package/dist/cli-adapters/provider-cli-parse.d.ts +4 -0
- package/dist/cli-adapters/provider-cli-runtime.d.ts +34 -0
- package/dist/cli-adapters/provider-cli-shared.d.ts +38 -0
- package/dist/cli-adapters/raw-terminal-io.d.ts +37 -0
- package/dist/cli-adapters/resolve-executable.d.ts +14 -0
- package/dist/cli-adapters/terminal-backends/ghostty-vt-backend.d.ts +6 -3
- package/dist/cli-adapters/terminal-backends/types.d.ts +10 -2
- package/dist/cli-adapters/terminal-screen.d.ts +4 -11
- package/dist/commands/cli-manager.d.ts +2 -1
- package/dist/commands/handler.d.ts +110 -0
- package/dist/commands/mesh-coordinator.d.ts +85 -1
- package/dist/commands/router.d.ts +229 -1
- package/dist/commands/upgrade-helper.d.ts +12 -0
- package/dist/config/chat-history.d.ts +9 -0
- package/dist/config/config.d.ts +5 -0
- package/dist/config/mesh-config.d.ts +72 -1
- package/dist/detection/ide-detector.d.ts +13 -0
- package/dist/detection/win32-ide-version.d.ts +37 -0
- package/dist/git/git-commands.d.ts +9 -1
- package/dist/git/git-diff.d.ts +6 -0
- package/dist/git/git-executor.d.ts +11 -0
- package/dist/git/git-status.d.ts +9 -0
- package/dist/git/git-types.d.ts +2 -50
- package/dist/index.d.ts +51 -12
- package/dist/index.js +36031 -12365
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40382 -16833
- package/dist/index.mjs.map +1 -1
- package/dist/installer.d.ts +1 -4
- package/dist/ipc/local-ipc-server.d.ts +91 -0
- package/dist/launch.d.ts +1 -1
- package/dist/logging/async-batch-writer.d.ts +10 -0
- package/dist/logging/log-redactor.d.ts +24 -0
- package/dist/logging/log-tail-reader.d.ts +46 -0
- package/dist/mesh/contracts.d.ts +164 -0
- package/dist/mesh/coordinator-prompt.d.ts +36 -0
- package/dist/mesh/coordinator-registry.d.ts +59 -0
- package/dist/mesh/mesh-active-work.d.ts +108 -0
- package/dist/mesh/mesh-delivery-policy.d.ts +131 -0
- package/dist/mesh/mesh-events-coordinator.d.ts +169 -0
- package/dist/mesh/mesh-events-pending.d.ts +45 -0
- package/dist/mesh/mesh-events-stale.d.ts +40 -0
- package/dist/mesh/mesh-events-utils.d.ts +47 -0
- package/dist/mesh/mesh-events.d.ts +6 -49
- package/dist/mesh/mesh-fast-forward.d.ts +81 -0
- package/dist/mesh/mesh-host-ownership.d.ts +9 -0
- package/dist/mesh/mesh-init.d.ts +86 -0
- package/dist/mesh/mesh-ledger-reconciliation.d.ts +23 -3
- package/dist/mesh/mesh-ledger.d.ts +77 -1
- package/dist/mesh/mesh-missions.d.ts +116 -0
- package/dist/mesh/mesh-reconcile-loop.d.ts +7 -0
- package/dist/mesh/mesh-refine-batch.d.ts +68 -0
- package/dist/mesh/mesh-refine-status.d.ts +62 -0
- package/dist/mesh/mesh-review-inbox.d.ts +90 -0
- package/dist/mesh/mesh-routing.d.ts +70 -0
- package/dist/mesh/mesh-runtime-store.d.ts +401 -0
- package/dist/mesh/mesh-task-stats.d.ts +49 -0
- package/dist/mesh/mesh-unresolved-forward-outbox.d.ts +30 -0
- package/dist/mesh/mesh-work-queue.d.ts +226 -5
- package/dist/mesh/preview-freshness.d.ts +18 -0
- package/dist/mesh/refine-config.d.ts +215 -0
- package/dist/mesh/worktree-bootstrap-config.d.ts +135 -0
- package/dist/providers/acp-provider-instance.d.ts +2 -0
- package/dist/providers/approval-utils.d.ts +13 -0
- package/dist/providers/cli-provider-instance.d.ts +61 -3
- package/dist/providers/contracts.d.ts +130 -6
- package/dist/providers/external-sources.d.ts +71 -0
- package/dist/providers/native-history/antigravity-cli-transcript.d.ts +100 -0
- package/dist/providers/native-history/claude-cli-transcript.d.ts +70 -0
- package/dist/providers/native-history/codex-cli-transcript.d.ts +73 -0
- package/dist/providers/native-history/dispatcher.d.ts +27 -0
- package/dist/providers/native-history/hermes-cli-transcript.d.ts +30 -0
- package/dist/providers/native-history/index.d.ts +13 -0
- package/dist/providers/provider-instance-manager.d.ts +13 -0
- package/dist/providers/provider-instance.d.ts +13 -1
- package/dist/providers/provider-loader.d.ts +26 -4
- package/dist/providers/provider-trust.d.ts +31 -0
- package/dist/providers/read-chat-contract.d.ts +29 -0
- package/dist/providers/sdk/v1/builders/acp/detect-status.d.ts +68 -0
- package/dist/providers/sdk/v1/builders/cli/detect-status.d.ts +85 -0
- package/dist/providers/sdk/v1/builders/cli/parse-approval-squash.d.ts +59 -0
- package/dist/providers/sdk/v1/builders/cli/parse-approval.d.ts +65 -0
- package/dist/providers/sdk/v1/builders/cli/parse-session.d.ts +91 -0
- package/dist/providers/sdk/v1/builders/cli/visible-region.d.ts +42 -0
- package/dist/providers/sdk/v1/fixture-tooling/format.d.ts +126 -0
- package/dist/providers/sdk/v1/fixture-tooling/index.d.ts +8 -0
- package/dist/providers/sdk/v1/fixture-tooling/replay.d.ts +38 -0
- package/dist/providers/sdk/v1/index.d.ts +30 -0
- package/dist/providers/sdk/v1/sandbox/README-design.d.ts +193 -0
- package/dist/providers/sdk/v1/sandbox/require-whitelist.d.ts +74 -0
- package/dist/providers/sdk/v1/sandbox/script-runner.d.ts +98 -0
- package/dist/providers/sdk/v1/types/cli/index.d.ts +277 -0
- package/dist/providers/sdk/v1/types/common/index.d.ts +203 -0
- package/dist/providers/sdk/v1/validators/index.d.ts +5 -0
- package/dist/providers/sdk/v1/validators/manifest.d.ts +40 -0
- package/dist/providers/sdk/v1/validators/taint.d.ts +52 -0
- package/dist/providers/spec/adapter.d.ts +69 -0
- package/dist/providers/spec/cli-adapter.d.ts +217 -0
- package/dist/providers/spec/evaluator.d.ts +23 -0
- package/dist/providers/spec/fsm-driver.d.ts +278 -0
- package/dist/providers/spec/fsm-evaluator.d.ts +72 -0
- package/dist/providers/spec/fsm-loader.d.ts +14 -0
- package/dist/providers/spec/fsm-types.d.ts +128 -0
- package/dist/providers/spec/native-history-executor.d.ts +41 -0
- package/dist/providers/spec/pre-launch-trust.d.ts +16 -0
- package/dist/providers/spec/route.d.ts +4 -0
- package/dist/providers/spec/types.d.ts +180 -0
- package/dist/providers/transcript-v2.d.ts +176 -0
- package/dist/providers/types/interactive-prompt.d.ts +84 -0
- package/dist/providers/working-dir.d.ts +17 -0
- package/dist/repo-mesh-types.d.ts +365 -13
- package/dist/sessions/registry.d.ts +6 -0
- package/dist/shared-types-extra.d.ts +2 -4
- package/dist/shared-types.d.ts +42 -1
- package/dist/status/normalize.d.ts +1 -1
- package/dist/status/normalize.js +1 -0
- package/dist/status/normalize.js.map +1 -1
- package/dist/status/normalize.mjs +1 -0
- package/dist/status/normalize.mjs.map +1 -1
- package/dist/status/reporter.d.ts +2 -0
- package/dist/status/snapshot.d.ts +1 -0
- package/dist/types.d.ts +5 -0
- package/package.json +7 -3
- package/src/agent-stream/poller.ts +2 -3
- package/src/boot/daemon-lifecycle.ts +55 -12
- package/src/boot/process-hardening.ts +89 -0
- package/src/build-info.ts +73 -0
- package/src/chat/source-machine.ts +534 -0
- package/src/chat/source-resolver.ts +0 -0
- package/src/chat/subscription-updates.ts +20 -1
- package/src/cli-adapter-types.d.ts +1 -0
- package/src/cli-adapter-types.ts +47 -2
- package/src/cli-adapters/cli-script-runner.ts +421 -0
- package/src/cli-adapters/cli-state-engine.ts +1215 -0
- package/src/cli-adapters/provider-cli-adapter.d.ts +1 -1
- package/src/cli-adapters/provider-cli-adapter.ts +710 -1140
- package/src/cli-adapters/provider-cli-parse.d.ts +1 -0
- package/src/cli-adapters/provider-cli-parse.ts +13 -0
- package/src/cli-adapters/provider-cli-runtime.ts +56 -7
- package/src/cli-adapters/provider-cli-shared.d.ts +2 -0
- package/src/cli-adapters/provider-cli-shared.ts +85 -11
- package/src/cli-adapters/pty-transport.ts +2 -1
- package/src/cli-adapters/raw-terminal-io.ts +252 -0
- package/src/cli-adapters/resolve-executable.ts +90 -0
- package/src/cli-adapters/session-host-transport.ts +2 -1
- package/src/cli-adapters/terminal-backends/ghostty-vt-backend.ts +53 -29
- package/src/cli-adapters/terminal-backends/types.ts +10 -3
- package/src/cli-adapters/terminal-screen.ts +16 -81
- package/src/commands/chat-commands.ts +1822 -61
- package/src/commands/cli-manager.ts +286 -14
- package/src/commands/handler.ts +809 -2
- package/src/commands/mesh-coordinator.ts +332 -122
- package/src/commands/router.ts +6370 -704
- package/src/commands/stream-commands.ts +8 -0
- package/src/commands/upgrade-helper.ts +81 -30
- package/src/config/chat-history.ts +483 -24
- package/src/config/config.ts +12 -0
- package/src/config/mesh-config.ts +391 -4
- package/src/config/recent-activity.ts +8 -2
- package/src/daemon/dev-auto-implement.ts +3 -2
- package/src/daemon/dev-cli-debug.ts +10 -1
- package/src/detection/cli-detector.ts +28 -9
- package/src/detection/ide-detector.ts +55 -16
- package/src/detection/win32-ide-version.ts +106 -0
- package/src/git/git-commands.ts +42 -12
- package/src/git/git-diff.ts +53 -0
- package/src/git/git-executor.ts +12 -0
- package/src/git/git-status.ts +408 -43
- package/src/git/git-types.ts +14 -62
- package/src/git/git-worktree.ts +8 -1
- package/src/index.ts +151 -11
- package/src/installer.d.ts +1 -1
- package/src/installer.ts +8 -6
- package/src/ipc/local-ipc-server.ts +278 -0
- package/src/launch.d.ts +1 -1
- package/src/launch.ts +37 -28
- package/src/logging/async-batch-writer.ts +55 -0
- package/src/logging/log-redactor.ts +100 -0
- package/src/logging/log-tail-reader.ts +220 -0
- package/src/logging/logger.ts +2 -1
- package/src/mesh/contracts.ts +329 -0
- package/src/mesh/coordinator-prompt.ts +235 -31
- package/src/mesh/coordinator-registry.ts +121 -0
- package/src/mesh/mesh-active-work.ts +469 -0
- package/src/mesh/mesh-delivery-policy.ts +315 -0
- package/src/mesh/mesh-events-coordinator.ts +2102 -0
- package/src/mesh/mesh-events-pending.ts +508 -0
- package/src/mesh/mesh-events-stale.ts +290 -0
- package/src/mesh/mesh-events-utils.ts +254 -0
- package/src/mesh/mesh-events.ts +30 -1035
- package/src/mesh/mesh-fast-forward.ts +839 -0
- package/src/mesh/mesh-host-ownership.ts +73 -0
- package/src/mesh/mesh-init.ts +260 -0
- package/src/mesh/mesh-ledger-reconciliation.ts +12 -5
- package/src/mesh/mesh-ledger.ts +589 -102
- package/src/mesh/mesh-missions.ts +248 -0
- package/src/mesh/mesh-reconcile-loop.ts +496 -0
- package/src/mesh/mesh-refine-batch.ts +197 -0
- package/src/mesh/mesh-refine-status.ts +231 -0
- package/src/mesh/mesh-review-inbox.ts +307 -0
- package/src/mesh/mesh-routing.ts +291 -0
- package/src/mesh/mesh-runtime-store.ts +1578 -0
- package/src/mesh/mesh-task-stats.ts +154 -0
- package/src/mesh/mesh-unresolved-forward-outbox.ts +185 -0
- package/src/mesh/mesh-work-queue.ts +780 -139
- package/src/mesh/preview-freshness.ts +118 -0
- package/src/mesh/refine-config.ts +403 -0
- package/src/mesh/worktree-bootstrap-config.ts +326 -0
- package/src/providers/acp-provider-instance.ts +19 -4
- package/src/providers/approval-utils.d.ts +4 -0
- package/src/providers/approval-utils.ts +47 -5
- package/src/providers/chat-message-normalization.ts +4 -11
- package/src/providers/cli-provider-instance.ts +958 -91
- package/src/providers/contracts.d.ts +55 -0
- package/src/providers/contracts.ts +141 -6
- package/src/providers/extension-provider-instance.ts +5 -1
- package/src/providers/external-sources.ts +218 -0
- package/src/providers/ide-provider-instance.ts +25 -6
- package/src/providers/native-history/antigravity-cli-transcript.ts +643 -0
- package/src/providers/native-history/claude-cli-transcript.ts +396 -0
- package/src/providers/native-history/codex-cli-transcript.ts +479 -0
- package/src/providers/native-history/dispatcher.ts +340 -0
- package/src/providers/native-history/hermes-cli-transcript.ts +230 -0
- package/src/providers/native-history/index.ts +30 -0
- package/src/providers/provider-instance-manager.ts +30 -0
- package/src/providers/provider-instance.ts +10 -1
- package/src/providers/provider-loader.ts +662 -50
- package/src/providers/provider-schema.ts +87 -14
- package/src/providers/provider-trust.ts +114 -0
- package/src/providers/read-chat-contract.ts +76 -16
- package/src/providers/sdk/README.md +49 -0
- package/src/providers/sdk/v1/builders/acp/detect-status.ts +144 -0
- package/src/providers/sdk/v1/builders/cli/detect-status.ts +262 -0
- package/src/providers/sdk/v1/builders/cli/parse-approval-squash.ts +158 -0
- package/src/providers/sdk/v1/builders/cli/parse-approval.ts +250 -0
- package/src/providers/sdk/v1/builders/cli/parse-session.ts +276 -0
- package/src/providers/sdk/v1/builders/cli/visible-region.ts +143 -0
- package/src/providers/sdk/v1/fixture-tooling/format.ts +130 -0
- package/src/providers/sdk/v1/fixture-tooling/index.ts +22 -0
- package/src/providers/sdk/v1/fixture-tooling/replay.ts +352 -0
- package/src/providers/sdk/v1/index.ts +152 -0
- package/src/providers/sdk/v1/sandbox/README-design.ts +195 -0
- package/src/providers/sdk/v1/sandbox/require-whitelist.ts +472 -0
- package/src/providers/sdk/v1/sandbox/script-runner.ts +150 -0
- package/src/providers/sdk/v1/schemas/cli/provider.schema.json +504 -0
- package/src/providers/sdk/v1/schemas/primitives/acp-session-protocol-v1.json +131 -0
- package/src/providers/sdk/v1/schemas/primitives/native-history-codex-rollout-v1.json +66 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-approval-squash-v1.json +91 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-assistant-block-v1.json +91 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-cue-ordering-v1.json +47 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-dispatch-order-v1.json +32 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-footer-chrome-v1.json +42 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-index-finder-v1.json +27 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-modal-v1.json +125 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-prompt-marker-v1.json +45 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-session-id-extraction-v1.json +46 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-settled-prompt-v1.json +71 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-spinner-v1.json +83 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-transcript-pty-v1.json +83 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-visible-region-v1.json +57 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-welcome-screen-v1.json +35 -0
- package/src/providers/sdk/v1/types/cli/index.ts +365 -0
- package/src/providers/sdk/v1/types/common/index.ts +229 -0
- package/src/providers/sdk/v1/validators/index.ts +19 -0
- package/src/providers/sdk/v1/validators/manifest.ts +110 -0
- package/src/providers/sdk/v1/validators/taint.ts +309 -0
- package/src/providers/spec/adapter.ts +168 -0
- package/src/providers/spec/cli-adapter.ts +986 -0
- package/src/providers/spec/evaluator.ts +345 -0
- package/src/providers/spec/fsm-driver.ts +909 -0
- package/src/providers/spec/fsm-evaluator.ts +255 -0
- package/src/providers/spec/fsm-loader.ts +112 -0
- package/src/providers/spec/fsm-types.ts +222 -0
- package/src/providers/spec/native-history-executor.ts +1136 -0
- package/src/providers/spec/pre-launch-trust.ts +104 -0
- package/src/providers/spec/route.ts +51 -0
- package/src/providers/spec/types.ts +226 -0
- package/src/providers/transcript-v2.ts +567 -0
- package/src/providers/types/interactive-prompt.ts +536 -0
- package/src/providers/version-archive.ts +64 -24
- package/src/providers/working-dir.ts +23 -0
- package/src/repo-mesh-types.ts +494 -13
- package/src/sessions/registry.ts +6 -0
- package/src/shared-types-extra.ts +2 -4
- package/src/shared-types.ts +45 -1
- package/src/status/builders.ts +26 -6
- package/src/status/normalize.ts +2 -0
- package/src/status/reporter.ts +15 -0
- package/src/status/snapshot.ts +84 -25
- package/src/system/host-memory.ts +29 -12
- package/src/types.ts +5 -0
- package/dist/cli-adapters/terminal-backends/xterm-backend.d.ts +0 -17
- package/dist/mesh/mesh-sync.d.ts +0 -53
- package/src/cli-adapters/terminal-backends/ghostty-vt-backend.d.ts +0 -16
- package/src/cli-adapters/terminal-backends/xterm-backend.ts +0 -97
- package/src/mesh/mesh-sync.ts +0 -111
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* IMPORTANT: This file must remain runtime-free (types only).
|
|
12
12
|
*/
|
|
13
13
|
import type { GitRepoStatus, GitCompactSummary } from './git/git-types.js';
|
|
14
|
+
import type { MeshMissionSummary, MeshMissionSlimSummary } from './mesh/mesh-missions.js';
|
|
14
15
|
export interface RepoMesh {
|
|
15
16
|
id: string;
|
|
16
17
|
name: string;
|
|
@@ -19,10 +20,37 @@ export interface RepoMesh {
|
|
|
19
20
|
defaultBranch?: string;
|
|
20
21
|
policy: RepoMeshPolicy;
|
|
21
22
|
coordinator: RepoMeshCoordinatorConfig;
|
|
23
|
+
meshHost?: RepoMeshHostMetadata;
|
|
22
24
|
projectContext: ProjectContextSnapshot;
|
|
23
25
|
nodes: RepoMeshNode[];
|
|
24
26
|
status: 'active' | 'archived' | 'deleted';
|
|
25
27
|
}
|
|
28
|
+
export type RepoMeshDaemonRole = 'host' | 'member';
|
|
29
|
+
export interface RepoMeshHostPairingMetadata {
|
|
30
|
+
status: 'not_configured' | 'pairing' | 'paired' | 'rejected' | 'revoked';
|
|
31
|
+
tokenId?: string;
|
|
32
|
+
joinedAt?: string;
|
|
33
|
+
lastPairedAt?: string;
|
|
34
|
+
lastRejectedAt?: string;
|
|
35
|
+
expiresAt?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface RepoMeshHostMetadata {
|
|
38
|
+
/** Local daemon role for this mesh. Missing metadata defaults to host for standalone compatibility. */
|
|
39
|
+
role: RepoMeshDaemonRole;
|
|
40
|
+
/** Daemon that owns mesh truth/status/git/queue/session/ledger/coordinator ownership. */
|
|
41
|
+
hostDaemonId?: string;
|
|
42
|
+
/** Mesh node that represents the host daemon, when known. */
|
|
43
|
+
hostNodeId?: string;
|
|
44
|
+
/** Future standalone manual pairing endpoint entered by member daemons. */
|
|
45
|
+
hostAddress?: string;
|
|
46
|
+
/** Redacted pairing state only; raw join tokens must not be persisted here. */
|
|
47
|
+
pairing?: RepoMeshHostPairingMetadata;
|
|
48
|
+
}
|
|
49
|
+
export interface RepoMeshHostStatus extends RepoMeshHostMetadata {
|
|
50
|
+
canOwnCoordinator: boolean;
|
|
51
|
+
canOwnQueue: boolean;
|
|
52
|
+
defaulted: boolean;
|
|
53
|
+
}
|
|
26
54
|
export interface RepoMeshNode {
|
|
27
55
|
id: string;
|
|
28
56
|
daemonId: string;
|
|
@@ -37,31 +65,205 @@ export interface RepoMeshNode {
|
|
|
37
65
|
effectiveCapabilities: RepoMeshNodeCapabilities;
|
|
38
66
|
policy: RepoMeshNodePolicy;
|
|
39
67
|
health: RepoMeshNodeHealth;
|
|
68
|
+
role?: RepoMeshDaemonRole;
|
|
40
69
|
status: 'enabled' | 'disabled' | 'removed';
|
|
41
70
|
}
|
|
42
71
|
export type RepoMeshNodeHealth = 'online' | 'offline' | 'degraded' | 'dirty' | 'wrong_branch' | 'unknown';
|
|
43
72
|
export type RepoMeshSessionCleanupMode = 'preserve' | 'stop' | 'delete_stopped' | 'stop_and_delete';
|
|
44
73
|
export type RepoMeshSpawnedSessionVisibility = 'visible' | 'hidden';
|
|
74
|
+
/**
|
|
75
|
+
* Mesh-wide tie-break strategy for distributing untargeted queue work across
|
|
76
|
+
* eligible nodes. This ONLY governs the final tie-break stage of the scheduler
|
|
77
|
+
* pipeline (TAG hard-filter → MAX-ALLOC capacity gate → PRIORITY soft score →
|
|
78
|
+
* TIE-BREAK); eligibility/capacity/priority are evaluated identically for every
|
|
79
|
+
* strategy.
|
|
80
|
+
*
|
|
81
|
+
* - 'first_eligible' (DEFAULT): preserve today's behavior exactly. Nodes are
|
|
82
|
+
* visited in config/array order and the first that can launch wins. No
|
|
83
|
+
* load-spreading. This is the strict no-change default — a mesh that never
|
|
84
|
+
* sets schedulingStrategy behaves identically to before this feature.
|
|
85
|
+
* - 'least_loaded': prefer the eligible node with the fewest active assignments,
|
|
86
|
+
* so untargeted work spreads instead of piling onto whichever node asks first.
|
|
87
|
+
* - 'round_robin': among nodes tied at the least load, rotate the winner using a
|
|
88
|
+
* per-mesh cursor so distribution stays fair across passes.
|
|
89
|
+
* - 'priority_only': rank purely by schedulingPriority (then config order),
|
|
90
|
+
* ignoring load — always send to the highest-priority eligible node.
|
|
91
|
+
*
|
|
92
|
+
* Distribution is explicit opt-in: a strategy other than 'first_eligible' must be
|
|
93
|
+
* configured for any load-spreading to occur.
|
|
94
|
+
*/
|
|
95
|
+
export type RepoMeshSchedulingStrategy = 'first_eligible' | 'least_loaded' | 'round_robin' | 'priority_only';
|
|
96
|
+
export declare const MESH_SCHEDULING_STRATEGIES: RepoMeshSchedulingStrategy[];
|
|
97
|
+
export declare const DEFAULT_MESH_SCHEDULING_STRATEGY: RepoMeshSchedulingStrategy;
|
|
98
|
+
/**
|
|
99
|
+
* Normalize an unknown scheduling-strategy value to a valid strategy, defaulting
|
|
100
|
+
* to 'first_eligible' (strict no-change) for anything missing/blank/unrecognized.
|
|
101
|
+
*/
|
|
102
|
+
export declare function normalizeMeshSchedulingStrategy(value: unknown): RepoMeshSchedulingStrategy;
|
|
103
|
+
/**
|
|
104
|
+
* Resolve a node's soft scheduling priority — a single scalar used as the PRIORITY
|
|
105
|
+
* stage rank key (higher = preferred). It is NOT an eligibility gate (the MAX-ALLOC
|
|
106
|
+
* capacity gate alone decides whether a node can take work). Missing/blank/NaN
|
|
107
|
+
* resolves to 0 so unconfigured nodes all share the same neutral priority.
|
|
108
|
+
*/
|
|
109
|
+
export declare function resolveNodeSchedulingPriority(nodePolicy: Pick<RepoMeshNodePolicy, 'schedulingPriority'> | null | undefined): number;
|
|
110
|
+
/**
|
|
111
|
+
* Synthetic capability tag advertised by every mesh node describing how it can land
|
|
112
|
+
* its work onto the base branch:
|
|
113
|
+
* - converge=refine: a local worktree node (on any machine — refine_mesh_node
|
|
114
|
+
* forwards to the owning daemon) can run the Refinery merge → push → cleanup.
|
|
115
|
+
* - converge=fast_forward: a non-worktree node (the machine itself) can only
|
|
116
|
+
* fast-forward/push an already-converged branch.
|
|
117
|
+
* Emitted by buildMeshNodeCapabilityTags and matched through the ordinary
|
|
118
|
+
* required-tags filter.
|
|
119
|
+
*/
|
|
120
|
+
export declare const MESH_CONVERGE_REFINE_TAG = "converge=refine";
|
|
121
|
+
export declare const MESH_CONVERGE_FAST_FORWARD_TAG = "converge=fast_forward";
|
|
122
|
+
/**
|
|
123
|
+
* Standard mesh resource-pool roles. These are the dashboard-provided defaults for
|
|
124
|
+
* the role=<x> routing tag (advertised by node policy.providerRoles and matched
|
|
125
|
+
* through nodeSatisfiesRequiredTags). A mesh is free to declare additional custom
|
|
126
|
+
* role strings in policy.taskAffinity; the dashboard role dropdown exposes the union
|
|
127
|
+
* of these four standards plus any config-declared roles. Roles are lowercased
|
|
128
|
+
* everywhere (the role=<x> tag is lowercased in roleCapabilityTags).
|
|
129
|
+
*/
|
|
130
|
+
export declare const STANDARD_MESH_ROLES: readonly ["investigator", "coder", "validator", "converger"];
|
|
131
|
+
export type StandardMeshRole = typeof STANDARD_MESH_ROLES[number];
|
|
132
|
+
/**
|
|
133
|
+
* Default taskMode → role mapping (all five task modes). A task enqueued with a
|
|
134
|
+
* given taskMode auto-routes to a node advertising the mapped role=<x> tag, unless
|
|
135
|
+
* the mesh overrides the mapping in policy.taskAffinity.byTaskMode. Keyed by the
|
|
136
|
+
* MeshTaskMode string literals (the canonical union lives in mesh-work-queue.ts;
|
|
137
|
+
* this map is keyed by string to avoid a types ↔ queue import cycle). Kept in sync
|
|
138
|
+
* with MeshTaskMode by the exhaustive lookup in resolveTaskAffinityRole.
|
|
139
|
+
*/
|
|
140
|
+
export declare const DEFAULT_TASKMODE_ROLE_MAP: Readonly<Record<string, StandardMeshRole>>;
|
|
141
|
+
/**
|
|
142
|
+
* Declarative task_mode → role affinity policy. When set, enqueueTask auto-injects a
|
|
143
|
+
* `role=<role>` required tag (see resolveTaskAffinityRequiredTags) so the task
|
|
144
|
+
* hard-filters onto nodes advertising that role — but only when the caller did NOT
|
|
145
|
+
* already pin the task with an explicit target_node_id or its own required_tags.
|
|
146
|
+
*
|
|
147
|
+
* - `enabled`: master switch. Defaults to true so the built-in DEFAULT_TASKMODE_ROLE_MAP
|
|
148
|
+
* takes effect even when a mesh declares no taskAffinity block at all. Set false to
|
|
149
|
+
* fully disable affinity routing (today's pre-affinity behavior).
|
|
150
|
+
* - `byTaskMode`: per-taskMode override of the default mapping. A role string here may
|
|
151
|
+
* be any of STANDARD_MESH_ROLES or a custom role declared by the operator. An empty
|
|
152
|
+
* string disables affinity for that one task mode.
|
|
153
|
+
* - `customRoles`: extra (non-standard) role strings to surface in the dashboard role
|
|
154
|
+
* dropdown. Routing itself does not require a role to be pre-declared here — any role
|
|
155
|
+
* referenced in byTaskMode is injected regardless; customRoles only widens the UI list.
|
|
156
|
+
*/
|
|
157
|
+
export interface RepoMeshTaskAffinityPolicy {
|
|
158
|
+
enabled?: boolean;
|
|
159
|
+
byTaskMode?: Record<string, string>;
|
|
160
|
+
customRoles?: string[];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Resolve the affinity role for a task mode against a mesh's taskAffinity policy.
|
|
164
|
+
* Returns the lowercased role string to inject as `role=<role>`, or null when no
|
|
165
|
+
* affinity applies (affinity disabled, an explicit empty override, or an unknown mode).
|
|
166
|
+
*
|
|
167
|
+
* Precedence: policy.byTaskMode[mode] (operator override) → DEFAULT_TASKMODE_ROLE_MAP[mode].
|
|
168
|
+
* A blank override string explicitly opts that mode out of affinity routing.
|
|
169
|
+
*/
|
|
170
|
+
export declare function resolveTaskAffinityRole(taskMode: string | undefined, policy: RepoMeshTaskAffinityPolicy | null | undefined): string | null;
|
|
171
|
+
/**
|
|
172
|
+
* Union of the standard roles plus any operator-declared roles (byTaskMode values +
|
|
173
|
+
* customRoles), lowercased and deduped, preserving standard-first ordering. Used by
|
|
174
|
+
* the dashboard role dropdown so operators can pick a standard or a config-declared
|
|
175
|
+
* custom role. Pure/UI-facing — does not gate routing.
|
|
176
|
+
*/
|
|
177
|
+
export declare function resolveMeshRoleOptions(policy: RepoMeshTaskAffinityPolicy | null | undefined): string[];
|
|
178
|
+
/**
|
|
179
|
+
* Resolve whether the load-balancing scheduler should auto-inject a
|
|
180
|
+
* `converge=refine` required tag onto code_change tasks so they hard-filter onto
|
|
181
|
+
* refine-capable (worktree) nodes only. Strict opt-in: defaults to false, so a mesh
|
|
182
|
+
* that does not set it behaves exactly as before (code_change routes to any eligible
|
|
183
|
+
* node, including a non-worktree machine node when no worktree exists).
|
|
184
|
+
*/
|
|
185
|
+
export declare function resolveAutoConvergeCodeChange(policy: Pick<RepoMeshPolicy, 'autoConvergeCodeChange'> | null | undefined): boolean;
|
|
186
|
+
export interface RepoMeshAutoFastForwardPolicy {
|
|
187
|
+
/** Defaults to true. Set false to disable daemon-initiated idle fast-forwards. */
|
|
188
|
+
enabled: boolean;
|
|
189
|
+
/** Maximum behind count eligible for automatic fast-forward. Missing means no limit. */
|
|
190
|
+
maxBehind?: number;
|
|
191
|
+
/** Defaults to true. Require submodule status to be clean before automatic fast-forward. */
|
|
192
|
+
requireCleanSubmodules?: boolean;
|
|
193
|
+
}
|
|
45
194
|
export interface RepoMeshPolicy {
|
|
46
195
|
requirePreTaskCheckpoint: boolean;
|
|
47
196
|
requirePostTaskCheckpoint: boolean;
|
|
48
197
|
requireApprovalForPush: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Narrow Refinery opt-in: when validation and patch-equivalence have passed,
|
|
200
|
+
* allow Refinery to publish submodule gitlink commits to each submodule's
|
|
201
|
+
* configured remote main branch with a non-force push, then verify reachability.
|
|
202
|
+
* Defaults to false; root branch pushes/merges are not affected.
|
|
203
|
+
*/
|
|
204
|
+
allowAutoPublishSubmoduleMainCommits?: boolean;
|
|
49
205
|
requireApprovalForDestructiveGit: boolean;
|
|
50
206
|
dirtyWorkspaceBehavior: 'block' | 'warn' | 'checkpoint_then_continue';
|
|
51
207
|
maxParallelTasks: number;
|
|
52
208
|
allowedProviders?: string[];
|
|
209
|
+
/**
|
|
210
|
+
* Mesh-wide tie-break strategy for distributing untargeted queue work across
|
|
211
|
+
* eligible nodes. Defaults to 'first_eligible' (today's exact behavior — no
|
|
212
|
+
* load-spreading). Set to 'least_loaded' / 'round_robin' / 'priority_only' to
|
|
213
|
+
* opt into distribution. Only governs the final tie-break stage; eligibility,
|
|
214
|
+
* capacity, and priority are evaluated identically regardless of strategy.
|
|
215
|
+
*/
|
|
216
|
+
schedulingStrategy?: RepoMeshSchedulingStrategy;
|
|
217
|
+
/**
|
|
218
|
+
* Convergence routing opt-in: when true, the scheduler auto-injects a
|
|
219
|
+
* `converge=refine` required tag onto every code_change task at enqueue time, so
|
|
220
|
+
* code_change work hard-filters onto refine-capable worktree nodes (on any
|
|
221
|
+
* machine — refine_mesh_node forwards to the owning daemon) and never lands on a
|
|
222
|
+
* non-worktree machine node. Explicit target_node_id routing and any
|
|
223
|
+
* caller-supplied required_tags are preserved (the tag is merged, not replaced).
|
|
224
|
+
* Defaults to false: code_change routing is unchanged unless opted in.
|
|
225
|
+
*/
|
|
226
|
+
autoConvergeCodeChange?: boolean;
|
|
227
|
+
/**
|
|
228
|
+
* Declarative task_mode → role affinity routing. When present (and not disabled),
|
|
229
|
+
* enqueueTask auto-injects a `role=<role>` required tag for the task's taskMode so
|
|
230
|
+
* the work hard-filters onto nodes advertising that role. Explicit target_node_id
|
|
231
|
+
* routing and any caller-supplied required_tags are preserved (auto-injection only
|
|
232
|
+
* applies when the caller pinned neither). When the mapped role has no advertising
|
|
233
|
+
* node in the mesh, the task is NOT blocked — the role tag is skipped so the work
|
|
234
|
+
* falls back to ordinary least_loaded eligibility (soft affinity). Defaults to the
|
|
235
|
+
* built-in DEFAULT_TASKMODE_ROLE_MAP even when this block is omitted; set
|
|
236
|
+
* `{ enabled: false }` to fully restore pre-affinity routing.
|
|
237
|
+
*/
|
|
238
|
+
taskAffinity?: RepoMeshTaskAffinityPolicy;
|
|
53
239
|
/**
|
|
54
240
|
* Whether sessions spawned by mesh/coordinator policy should auto-open as visible
|
|
55
241
|
* dashboard tabs or start hidden. Defaults to 'visible' to preserve existing
|
|
56
242
|
* watch-the-agents behavior; hidden sessions remain discoverable and manually openable.
|
|
57
243
|
*/
|
|
58
244
|
spawnedSessionVisibility?: RepoMeshSpawnedSessionVisibility;
|
|
245
|
+
/**
|
|
246
|
+
* Whether worker sessions the coordinator dispatches should auto-approve agent
|
|
247
|
+
* approval modals (tool/command prompts) without firing a user-facing approval
|
|
248
|
+
* notification. Delegated workers are coordinator-driven, so a human should not
|
|
249
|
+
* have to approve each one; defaults to true. Set to false to make delegated
|
|
250
|
+
* worker sessions stop at approval modals like an interactive session.
|
|
251
|
+
* Stamped into the worker launch settings envelope as `autoApprove`, which wins
|
|
252
|
+
* over the global per-provider-type autoApprove config via the settings merge.
|
|
253
|
+
* A node policy may override this per-node (RepoMeshNodePolicy.delegatedWorkerAutoApprove).
|
|
254
|
+
*/
|
|
255
|
+
delegatedWorkerAutoApprove?: boolean;
|
|
59
256
|
/**
|
|
60
257
|
* What to do with delegated session-host records for a node when it is removed.
|
|
61
258
|
* Defaults to 'preserve' so completed work can be reviewed later and live
|
|
62
259
|
* runtimes are never stopped/deleted unless the mesh owner opts in.
|
|
63
260
|
*/
|
|
64
261
|
sessionCleanupOnNodeRemove?: RepoMeshSessionCleanupMode;
|
|
262
|
+
/**
|
|
263
|
+
* Daemon-initiated fast-forward for idle clean nodes that are only behind
|
|
264
|
+
* their tracked upstream. Defaults to enabled.
|
|
265
|
+
*/
|
|
266
|
+
autoFastForward?: RepoMeshAutoFastForwardPolicy;
|
|
65
267
|
/**
|
|
66
268
|
* Maximum number of automatic retry recommendations for a failed task on the
|
|
67
269
|
* same node before the daemon advises the coordinator to escalate or reassign.
|
|
@@ -75,12 +277,67 @@ export interface RepoMeshRelatedRepo {
|
|
|
75
277
|
/** Absolute checkout/workspace path for git freshness probes. */
|
|
76
278
|
workspace: string;
|
|
77
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* Per-(node, provider) role + parallelism declaration.
|
|
282
|
+
*
|
|
283
|
+
* `role` is a free-form resource-pool label (recommended values:
|
|
284
|
+
* 'investigation' | 'coding' | 'orchestration') describing what this
|
|
285
|
+
* (node, provider) combination is *for*. As of the load-balancing scheduler it
|
|
286
|
+
* is ALSO routable: each declared role is advertised as a synthetic `role=<x>`
|
|
287
|
+
* capability tag (see buildMeshNodeCapabilityTags), so a task enqueued with
|
|
288
|
+
* requiredTags: ["role=validation"] is hard-filtered to nodes/providers that
|
|
289
|
+
* declare that role — through the same nodeSatisfiesRequiredTags path as any
|
|
290
|
+
* other tag. There is intentionally no separate "advertisedRoles" field: the
|
|
291
|
+
* label and the routing tag are one mechanism. A task that does not require a
|
|
292
|
+
* `role=` tag ignores roles entirely (opt-in, fully backward compatible).
|
|
293
|
+
*
|
|
294
|
+
* role is intentionally orthogonal to taskMode: taskMode classifies the *work*
|
|
295
|
+
* (code_change vs live_debug_readonly), role classifies the *resource pool*.
|
|
296
|
+
*
|
|
297
|
+
* `maxParallel` is the only enforced field: the queue will not assign a task
|
|
298
|
+
* to this (node, provider) once it already has `maxParallel` active
|
|
299
|
+
* (status='assigned') tasks. When the global parallel cap and this per-(node,
|
|
300
|
+
* provider) cap disagree, the stricter (lower effective) limit wins — a claim
|
|
301
|
+
* must satisfy both. Omitting `maxParallel` means this provider is bounded only
|
|
302
|
+
* by the global/taskMode caps (full backward compatibility).
|
|
303
|
+
*/
|
|
304
|
+
export interface RepoMeshProviderRole {
|
|
305
|
+
/** Provider type this entry governs (e.g. 'claude-cli', 'codex-cli'). */
|
|
306
|
+
providerType: string;
|
|
307
|
+
/** Free-form role label; recommended: 'investigation' | 'coding' | 'orchestration'. */
|
|
308
|
+
role?: string;
|
|
309
|
+
/** Max concurrent active tasks for this (node, provider). Omit = no per-provider cap. */
|
|
310
|
+
maxParallel?: number;
|
|
311
|
+
}
|
|
78
312
|
export interface RepoMeshNodePolicy {
|
|
79
313
|
readOnly?: boolean;
|
|
80
314
|
canPush?: boolean;
|
|
81
315
|
maxConcurrentSessions?: number;
|
|
316
|
+
/**
|
|
317
|
+
* Soft scheduling priority used as the PRIORITY rank key (higher = preferred)
|
|
318
|
+
* when the mesh schedulingStrategy spreads work across nodes. Defaults to 0.
|
|
319
|
+
* This is NOT an eligibility gate — a node with a high priority that is at its
|
|
320
|
+
* capacity (MAX-ALLOC gate) is still skipped; priority only orders nodes that
|
|
321
|
+
* can actually take work. Ignored entirely under 'first_eligible'.
|
|
322
|
+
*/
|
|
323
|
+
schedulingPriority?: number;
|
|
82
324
|
/** Ordered provider preference used when mesh_launch_session omits an explicit type. */
|
|
83
325
|
providerPriority?: string[];
|
|
326
|
+
/**
|
|
327
|
+
* Per-(node, provider) role + parallelism declarations. Each entry binds a
|
|
328
|
+
* providerType on THIS node to an optional free-form role label and an
|
|
329
|
+
* optional maxParallel cap. maxParallel is enforced (as an additional,
|
|
330
|
+
* stricter-wins constraint on top of the global maxParallelTasks/taskMode
|
|
331
|
+
* caps); role is advertised as a routable `role=<x>` capability tag so tasks
|
|
332
|
+
* can hard-filter by required role. Missing/empty: the node behaves exactly
|
|
333
|
+
* as before (global caps only, no role tags).
|
|
334
|
+
*/
|
|
335
|
+
providerRoles?: RepoMeshProviderRole[];
|
|
336
|
+
/**
|
|
337
|
+
* Per-node override for RepoMeshPolicy.delegatedWorkerAutoApprove. When set, takes
|
|
338
|
+
* precedence over the mesh-level policy for worker sessions launched onto this node.
|
|
339
|
+
*/
|
|
340
|
+
delegatedWorkerAutoApprove?: boolean;
|
|
84
341
|
/**
|
|
85
342
|
* Optional associated/external repos that must be checked alongside this node.
|
|
86
343
|
* These are explicit policy/config entries only; Repo Mesh does not auto-discover
|
|
@@ -104,6 +361,28 @@ export interface RepoMeshNodePolicy {
|
|
|
104
361
|
initSubmodulesOnClone?: boolean;
|
|
105
362
|
}
|
|
106
363
|
export declare const DEFAULT_MESH_POLICY: RepoMeshPolicy;
|
|
364
|
+
/**
|
|
365
|
+
* Resolve whether a delegated worker session launched onto `nodePolicy` (within a mesh
|
|
366
|
+
* governed by `meshPolicy`) should auto-approve. Precedence: node override → mesh policy
|
|
367
|
+
* → default true. The result is stamped into the worker launch settings envelope as
|
|
368
|
+
* `autoApprove`; it wins over the global per-provider-type autoApprove config because the
|
|
369
|
+
* launch path merges the envelope as a settingsOverride on top of the provider defaults.
|
|
370
|
+
*/
|
|
371
|
+
export declare function resolveDelegatedWorkerAutoApprove(meshPolicy?: Pick<RepoMeshPolicy, 'delegatedWorkerAutoApprove'> | null, nodePolicy?: Pick<RepoMeshNodePolicy, 'delegatedWorkerAutoApprove'> | null): boolean;
|
|
372
|
+
/**
|
|
373
|
+
* Resolve the per-(node, provider) role declaration from a node policy.
|
|
374
|
+
* Case-insensitive, trimmed match on providerType. Returns undefined when the
|
|
375
|
+
* node has no providerRoles entry for this provider (caller then applies only
|
|
376
|
+
* the global caps). Defensive against malformed config — non-object entries and
|
|
377
|
+
* blank providerTypes are skipped rather than throwing.
|
|
378
|
+
*/
|
|
379
|
+
export declare function resolveProviderRole(nodePolicy: Pick<RepoMeshNodePolicy, 'providerRoles'> | null | undefined, providerType: string | null | undefined): RepoMeshProviderRole | undefined;
|
|
380
|
+
/**
|
|
381
|
+
* Resolve the enforced per-(node, provider) maxParallel cap, or undefined when
|
|
382
|
+
* no finite, non-negative cap is declared for this provider. Used by the queue
|
|
383
|
+
* claim path as a stricter-wins constraint layered on top of the global caps.
|
|
384
|
+
*/
|
|
385
|
+
export declare function resolveProviderMaxParallel(nodePolicy: Pick<RepoMeshNodePolicy, 'providerRoles'> | null | undefined, providerType: string | null | undefined): number | undefined;
|
|
107
386
|
export interface RepoMeshNodeCapabilities {
|
|
108
387
|
platform?: string;
|
|
109
388
|
packageManagers?: string[];
|
|
@@ -167,7 +446,28 @@ export interface RepoMeshCoordinatorConfig {
|
|
|
167
446
|
providerType?: string;
|
|
168
447
|
/** Preferred node to run coordinator on (null = auto) */
|
|
169
448
|
preferredNodeId?: string;
|
|
170
|
-
/**
|
|
449
|
+
/**
|
|
450
|
+
* Full mesh-level override for the coordinator system prompt. When set,
|
|
451
|
+
* replaces the daemon's rendered default and any user-file override
|
|
452
|
+
* (~/.adhdev/coordinator-prompts/<cli>.md). The per-launch
|
|
453
|
+
* extraSystemPrompt still composes on top — it always lands last as
|
|
454
|
+
* Additional Context. Supports the same {{placeholders}} the daemon's
|
|
455
|
+
* default template uses ({{meshName}}, {{repo}}, {{nodes}}, …).
|
|
456
|
+
*/
|
|
457
|
+
systemPromptOverride?: string;
|
|
458
|
+
/**
|
|
459
|
+
* Mesh-level append. Composes after whichever base prompt won
|
|
460
|
+
* (override → user-file override → daemon default). Use this when you
|
|
461
|
+
* want extra rules for THIS mesh but otherwise the standard prompt is
|
|
462
|
+
* fine. Stacks with the user-file append (`<cli>.append.md`) — both
|
|
463
|
+
* apply if both are set.
|
|
464
|
+
*/
|
|
465
|
+
systemPromptAppend?: string;
|
|
466
|
+
/**
|
|
467
|
+
* @deprecated Use systemPromptAppend. Kept as a fallback alias so
|
|
468
|
+
* existing meshes.json files keep working without a migration step;
|
|
469
|
+
* the daemon prefers systemPromptAppend when both are present.
|
|
470
|
+
*/
|
|
171
471
|
systemPromptSuffix?: string;
|
|
172
472
|
}
|
|
173
473
|
/**
|
|
@@ -185,6 +485,7 @@ export interface LocalMeshEntry {
|
|
|
185
485
|
defaultBranch?: string;
|
|
186
486
|
policy: RepoMeshPolicy;
|
|
187
487
|
coordinator: RepoMeshCoordinatorConfig;
|
|
488
|
+
meshHost?: RepoMeshHostMetadata;
|
|
188
489
|
nodes: LocalMeshNodeEntry[];
|
|
189
490
|
createdAt: string;
|
|
190
491
|
updatedAt: string;
|
|
@@ -196,16 +497,42 @@ export interface LocalMeshNodeEntry {
|
|
|
196
497
|
daemonId?: string;
|
|
197
498
|
/** Machine registry ID that owns this workspace, when known. */
|
|
198
499
|
machineId?: string;
|
|
500
|
+
/** Operator-defined capability tags used by mesh queue matching. */
|
|
501
|
+
capabilities?: string[];
|
|
199
502
|
userOverrides: Partial<RepoMeshNodeCapabilities>;
|
|
200
503
|
policy: RepoMeshNodePolicy;
|
|
504
|
+
/**
|
|
505
|
+
* Per-node instruction surfaced in the coordinator prompt so the LLM
|
|
506
|
+
* knows what each node is for (e.g. "this is the staging mirror — run
|
|
507
|
+
* only smoke tests here", or "use opus on this node, sonnet elsewhere").
|
|
508
|
+
* Empty/missing: omitted silently from the rendered prompt, no rule
|
|
509
|
+
* line about it gets added. The coordinator forwards/honors it when
|
|
510
|
+
* delegating; we don't enforce it at the daemon level.
|
|
511
|
+
*/
|
|
512
|
+
systemPrompt?: string;
|
|
201
513
|
/** For single-machine mesh: same daemon, different worktree */
|
|
202
514
|
isLocalWorktree?: boolean;
|
|
203
515
|
/** Branch this worktree tracks (set when created via clone_mesh_node) */
|
|
204
516
|
worktreeBranch?: string;
|
|
205
517
|
/** Node ID this worktree was cloned from */
|
|
206
518
|
clonedFromNodeId?: string;
|
|
519
|
+
/** Repo-local preparation result for ADHDev-created worktree nodes. */
|
|
520
|
+
worktreeBootstrap?: {
|
|
521
|
+
status: 'ready' | 'running' | 'failed' | 'not_configured' | 'disabled' | 'stale';
|
|
522
|
+
required?: boolean;
|
|
523
|
+
configSource?: string;
|
|
524
|
+
configSourceType?: string;
|
|
525
|
+
startedAt?: string;
|
|
526
|
+
completedAt?: string;
|
|
527
|
+
lastCommand?: string;
|
|
528
|
+
exitCode?: number | null;
|
|
529
|
+
error?: string;
|
|
530
|
+
commandsRun?: Array<Record<string, unknown>>;
|
|
531
|
+
staleInputs?: string[];
|
|
532
|
+
};
|
|
207
533
|
/** Optional associated/external repos configured as node metadata. */
|
|
208
534
|
relatedRepos?: RepoMeshRelatedRepo[];
|
|
535
|
+
role?: RepoMeshDaemonRole;
|
|
209
536
|
}
|
|
210
537
|
export interface RepoMeshStatus {
|
|
211
538
|
meshId: string;
|
|
@@ -213,22 +540,25 @@ export interface RepoMeshStatus {
|
|
|
213
540
|
repoIdentity: string;
|
|
214
541
|
defaultBranch?: string;
|
|
215
542
|
refreshedAt: string;
|
|
543
|
+
meshHost?: RepoMeshHostStatus;
|
|
216
544
|
nodes: RepoMeshNodeStatus[];
|
|
217
545
|
queue?: RepoMeshQueueStatus;
|
|
218
546
|
ledger?: RepoMeshLedgerStatus;
|
|
547
|
+
/**
|
|
548
|
+
* Mission summaries for the dashboard overview. Active/paused missions plus a
|
|
549
|
+
* capped, newest-first slice of completed/abandoned history. Omitted by older
|
|
550
|
+
* daemons — the dashboard must treat this as optional and render an empty
|
|
551
|
+
* state when absent. Split on each entry's `status` for live vs. history.
|
|
552
|
+
*
|
|
553
|
+
* Compact (the default) status calls send the slim shape — `goalPreview` +
|
|
554
|
+
* `goalTruncated` instead of the full `goal` — while verbose sends the full
|
|
555
|
+
* `goal`. Consumers must read `goal ?? goalPreview`. Each entry may also carry
|
|
556
|
+
* an optional `stats` operational rollup (durations / retries).
|
|
557
|
+
*/
|
|
558
|
+
missions?: (MeshMissionSummary | MeshMissionSlimSummary)[];
|
|
219
559
|
}
|
|
220
|
-
export
|
|
221
|
-
|
|
222
|
-
providerType?: string;
|
|
223
|
-
state?: string;
|
|
224
|
-
lifecycle?: 'starting' | 'running' | 'stopping' | 'stopped' | 'failed' | 'interrupted';
|
|
225
|
-
surfaceKind?: 'live_runtime' | 'recovery_snapshot' | 'inactive_record';
|
|
226
|
-
recoveryState?: string | null;
|
|
227
|
-
workspace?: string | null;
|
|
228
|
-
title?: string | null;
|
|
229
|
-
lastActivityAt?: string | null;
|
|
230
|
-
isCached?: boolean;
|
|
231
|
-
}
|
|
560
|
+
export type { RepoMeshSessionStatus } from '@adhdev/mesh-shared';
|
|
561
|
+
import type { RepoMeshSessionStatus } from '@adhdev/mesh-shared';
|
|
232
562
|
export type RepoMeshPeerConnectionState = 'self' | 'connected' | 'connecting' | 'disconnected' | 'failed' | 'closed' | 'unknown';
|
|
233
563
|
export type RepoMeshPeerConnectionTransport = 'local' | 'direct' | 'relay' | 'unknown';
|
|
234
564
|
export interface RepoMeshPeerConnectionStatus {
|
|
@@ -238,6 +568,12 @@ export interface RepoMeshPeerConnectionStatus {
|
|
|
238
568
|
transport: RepoMeshPeerConnectionTransport;
|
|
239
569
|
reported: boolean;
|
|
240
570
|
reason?: string;
|
|
571
|
+
/**
|
|
572
|
+
* Round-trip time in ms for the selected candidate pair, as sampled by the
|
|
573
|
+
* coordinator daemon when connected. Optional — older daemons and not_reported
|
|
574
|
+
* fallbacks omit it; the dashboard must treat it as best-effort telemetry.
|
|
575
|
+
*/
|
|
576
|
+
rttMs?: number;
|
|
241
577
|
lastStateChangeAt?: string;
|
|
242
578
|
lastConnectedAt?: string;
|
|
243
579
|
lastCommandAt?: string;
|
|
@@ -249,9 +585,12 @@ export interface RepoMeshNodeStatus {
|
|
|
249
585
|
repoRoot?: string;
|
|
250
586
|
daemonId?: string;
|
|
251
587
|
machineId?: string;
|
|
588
|
+
role?: RepoMeshDaemonRole;
|
|
252
589
|
machineStatus?: string;
|
|
253
590
|
isLocalWorktree?: boolean;
|
|
254
591
|
worktreeBranch?: string;
|
|
592
|
+
/** Mirrored from LocalMeshNodeEntry.systemPrompt for coordinator-prompt rendering. */
|
|
593
|
+
systemPrompt?: string;
|
|
255
594
|
health: RepoMeshNodeHealth;
|
|
256
595
|
git?: GitRepoStatus;
|
|
257
596
|
/**
|
|
@@ -265,6 +604,14 @@ export interface RepoMeshNodeStatus {
|
|
|
265
604
|
activeSessionDetails?: RepoMeshSessionStatus[];
|
|
266
605
|
providerPriority?: string[];
|
|
267
606
|
launchReady?: boolean;
|
|
607
|
+
/** True when the node is clean, ahead=0, behind>0, and safe for fast-forward consideration. */
|
|
608
|
+
autoFastForwardEligible?: boolean;
|
|
609
|
+
/** Coordinator-facing suggestion for obvious clean catch-up work. */
|
|
610
|
+
suggestedAction?: 'auto_fast_forward';
|
|
611
|
+
worktreeBootstrap?: LocalMeshNodeEntry['worktreeBootstrap'];
|
|
612
|
+
launchBlockedReason?: string;
|
|
613
|
+
launchBlockedMessage?: string;
|
|
614
|
+
recoveryHint?: string;
|
|
268
615
|
lastSeenAt?: string;
|
|
269
616
|
updatedAt?: string;
|
|
270
617
|
connection?: RepoMeshPeerConnectionStatus;
|
|
@@ -352,3 +699,8 @@ export interface RepoMeshLedgerStatus {
|
|
|
352
699
|
entries: RepoMeshLedgerEntryStatus[];
|
|
353
700
|
summary: RepoMeshLedgerSummaryStatus;
|
|
354
701
|
}
|
|
702
|
+
export interface MeshAsyncJobLifecycle {
|
|
703
|
+
startedAt?: string;
|
|
704
|
+
completedAt?: string;
|
|
705
|
+
error?: string;
|
|
706
|
+
}
|
|
@@ -7,6 +7,12 @@ export interface SessionRuntimeTarget {
|
|
|
7
7
|
cdpManagerKey?: string;
|
|
8
8
|
adapterKey?: string;
|
|
9
9
|
instanceKey?: string;
|
|
10
|
+
/** Working directory for CLI/ACP sessions. Used by read_chat to resolve
|
|
11
|
+
* native history when there is no live adapter (e.g. subscription path). */
|
|
12
|
+
workspace?: string;
|
|
13
|
+
/** Wall clock at register time. native-history readers use it as a
|
|
14
|
+
* cutoff so a fresh session can't show records from a prior one. */
|
|
15
|
+
spawnedAtMs?: number;
|
|
10
16
|
}
|
|
11
17
|
export declare class SessionRegistry {
|
|
12
18
|
private readonly bySessionId;
|
|
@@ -18,12 +18,10 @@ export interface RuntimeAttachedClient {
|
|
|
18
18
|
readOnly: boolean;
|
|
19
19
|
}
|
|
20
20
|
/** Session status union (used by SessionEntry.status, legacy recent-launch metadata, etc.) */
|
|
21
|
-
export type SessionStatus = 'idle' | 'generating' | 'waiting_approval' | 'error' | 'stopped' | 'starting' | 'panel_hidden' | 'not_monitored' | 'disconnected';
|
|
21
|
+
export type SessionStatus = 'idle' | 'generating' | 'waiting_approval' | 'waiting_choice' | 'error' | 'stopped' | 'starting' | 'panel_hidden' | 'not_monitored' | 'disconnected';
|
|
22
22
|
/** Inbox bucket categories for recent sessions */
|
|
23
23
|
export type RecentSessionBucket = 'needs_attention' | 'working' | 'task_complete' | 'idle';
|
|
24
24
|
/** Terminal backend status */
|
|
25
25
|
export interface TerminalBackendStatus {
|
|
26
|
-
backend: '
|
|
27
|
-
preference: 'auto' | 'xterm' | 'ghostty-vt';
|
|
28
|
-
ghosttyAvailable: boolean;
|
|
26
|
+
backend: 'ghostty-vt';
|
|
29
27
|
}
|
package/dist/shared-types.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import type { ActiveChatData as _ActiveChatData, ProviderErrorReason as _Provide
|
|
|
14
14
|
import type { WorkspaceEntry } from './config/workspaces.js';
|
|
15
15
|
import type { ProviderMeshCoordinatorConfig, ProviderResumeCapability } from './providers/contracts.js';
|
|
16
16
|
import type { GitCompactSummary, GitWorkspaceUpdate, WorkspaceGitSubscriptionParams } from './git/git-types.js';
|
|
17
|
+
import type { InteractivePrompt } from './providers/types/interactive-prompt.js';
|
|
17
18
|
export type { GitCommandName, GitCompactSummary, GitDiffSummary, GitFailureReason, GitFileChange, GitFileChangeStatus, GitRepoIdentity, GitRepoStatus, GitSnapshot, GitSnapshotCompareSummary, GitSnapshotReason, GitWorkspaceUpdate, WorkspaceGitSubscriptionParams, } from './git/git-types.js';
|
|
18
19
|
export interface SessionActiveChatData extends Omit<_ActiveChatData, 'messages'> {
|
|
19
20
|
messages?: _ActiveChatData['messages'];
|
|
@@ -49,6 +50,14 @@ export interface ReadChatSyncResult {
|
|
|
49
50
|
message: string;
|
|
50
51
|
buttons: string[];
|
|
51
52
|
} | null;
|
|
53
|
+
activeInteractivePrompt?: InteractivePrompt | null;
|
|
54
|
+
/**
|
|
55
|
+
* Chat source provenance from ChatSourceMachine (A2). Carries the
|
|
56
|
+
* selected source, transition cause, lock state, and legacy
|
|
57
|
+
* fallbackReason — opaque to the daemon-core, consumed by web-core
|
|
58
|
+
* for the source debug badge and SourceTimeline (A3).
|
|
59
|
+
*/
|
|
60
|
+
messageSource?: Record<string, unknown>;
|
|
52
61
|
}
|
|
53
62
|
export interface ProviderSummaryItem {
|
|
54
63
|
id: string;
|
|
@@ -268,6 +277,7 @@ export interface SessionEntry {
|
|
|
268
277
|
runtimeRecoveryState?: string | null;
|
|
269
278
|
resume?: ProviderResumeCapability;
|
|
270
279
|
activeChat: SessionActiveChatData | null;
|
|
280
|
+
activeInteractivePrompt?: InteractivePrompt | null;
|
|
271
281
|
capabilities?: SessionCapability[];
|
|
272
282
|
/** Effective message input/media support for this session. Defaults fail-closed to text-only. */
|
|
273
283
|
messageInput?: MessageInputSupport;
|
|
@@ -292,6 +302,11 @@ export interface SessionEntry {
|
|
|
292
302
|
seenCompletionMarker?: string;
|
|
293
303
|
surfaceHidden?: boolean;
|
|
294
304
|
settings?: Record<string, any>;
|
|
305
|
+
/** Set when this session is acting as a mesh coordinator for the given mesh. */
|
|
306
|
+
coordinator?: {
|
|
307
|
+
meshId: string;
|
|
308
|
+
role: 'coordinator';
|
|
309
|
+
};
|
|
295
310
|
meshQueueStats?: {
|
|
296
311
|
total?: number;
|
|
297
312
|
active?: number;
|
|
@@ -410,7 +425,33 @@ export interface AvailableProviderInfo {
|
|
|
410
425
|
lastVerification?: MachineProviderCheckResult;
|
|
411
426
|
/** Provider-declared Repo Mesh coordinator/MCP behavior. */
|
|
412
427
|
meshCoordinator?: ProviderMeshCoordinatorConfig;
|
|
413
|
-
|
|
428
|
+
/**
|
|
429
|
+
* Provider trust classification — derived from the on-disk layer the
|
|
430
|
+
* manifest came from and the shape of the manifest. Dashboards use
|
|
431
|
+
* this to render a trust badge and gate activation of
|
|
432
|
+
* `external-untrusted` providers behind a confirm modal.
|
|
433
|
+
*/
|
|
434
|
+
trust?: ProviderTrust;
|
|
435
|
+
/** Daemon-side human-readable description of the trust value. */
|
|
436
|
+
trustDescription?: string;
|
|
437
|
+
/** True when activation needs a user-side confirmation step. */
|
|
438
|
+
requiresConfirmation?: boolean;
|
|
439
|
+
/** Which on-disk layer the manifest lives in. */
|
|
440
|
+
sourceLayer?: 'user' | 'upstream' | 'external';
|
|
441
|
+
/** For external providers, the source-name namespace it came from. */
|
|
442
|
+
sourceName?: string | null;
|
|
443
|
+
/** Manifest-declared version, e.g. "1.2.1". */
|
|
444
|
+
providerVersion?: string;
|
|
445
|
+
/** Underlying executable name (CLI/binary providers). */
|
|
446
|
+
binary?: string;
|
|
447
|
+
/** Lifecycle label from the manifest: "Stable", "Beta", … */
|
|
448
|
+
status?: string;
|
|
449
|
+
/** One-line provider description from the manifest. */
|
|
450
|
+
details?: string;
|
|
451
|
+
/** Manifest-declared links: homepage, docs, repo, … */
|
|
452
|
+
links?: Record<string, string>;
|
|
453
|
+
}
|
|
454
|
+
export type ProviderTrust = 'user-custom' | 'trusted' | 'trusted-with-scripts' | 'external-safe' | 'external-untrusted';
|
|
414
455
|
export interface MachineProviderCheckResult {
|
|
415
456
|
ok: boolean;
|
|
416
457
|
stage?: 'detection' | 'runnable' | 'verification';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ActiveChatData } from '../providers/provider-instance.js';
|
|
2
2
|
import type { SessionActiveChatData } from '../shared-types.js';
|
|
3
|
-
export type ManagedStatus = 'idle' | 'generating' | 'waiting_approval' | 'error' | 'stopped' | 'starting' | 'panel_hidden' | 'not_monitored' | 'disconnected';
|
|
3
|
+
export type ManagedStatus = 'idle' | 'generating' | 'waiting_approval' | 'waiting_choice' | 'error' | 'stopped' | 'starting' | 'panel_hidden' | 'not_monitored' | 'disconnected';
|
|
4
4
|
export interface NormalizeActiveChatOptions {
|
|
5
5
|
includeMessages?: boolean;
|
|
6
6
|
includeInputContent?: boolean;
|
package/dist/status/normalize.js
CHANGED
|
@@ -119,6 +119,7 @@ function normalizeManagedStatus(status, opts) {
|
|
|
119
119
|
if (hasApprovalButtons(opts?.activeModal)) return "waiting_approval";
|
|
120
120
|
const normalized = String(status || "idle").trim().toLowerCase();
|
|
121
121
|
if (normalized === "waiting_approval") return "waiting_approval";
|
|
122
|
+
if (normalized === "waiting_choice") return "waiting_choice";
|
|
122
123
|
if (WORKING_STATUSES.has(normalized)) return "generating";
|
|
123
124
|
if (normalized === "error") return "error";
|
|
124
125
|
if (normalized === "stopped") return "stopped";
|