@adhdev/daemon-core 0.9.82-rc.3 → 0.9.82-rc.300
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 +10 -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 +23 -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 +106 -63
- package/dist/cli-adapters/provider-cli-parse.d.ts +4 -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/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 +215 -1
- 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/git/git-commands.d.ts +10 -1
- package/dist/git/git-diff.d.ts +6 -0
- package/dist/git/git-status.d.ts +12 -0
- package/dist/git/git-types.d.ts +5 -43
- package/dist/index.d.ts +51 -12
- package/dist/index.js +38833 -15876
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38504 -15652
- 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/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 +138 -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 -37
- 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 +107 -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 +377 -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 +184 -6
- 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/chat-message-normalization.d.ts +1 -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 +59 -0
- package/dist/providers/spec/cli-adapter.d.ts +186 -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 +144 -0
- package/dist/providers/transcript-v2.d.ts +176 -0
- package/dist/providers/types/interactive-prompt.d.ts +84 -0
- package/dist/repo-mesh-types.d.ts +314 -1
- 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 +58 -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 +22 -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 +674 -1139
- 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 +3 -1
- package/src/cli-adapters/provider-cli-shared.d.ts +2 -0
- package/src/cli-adapters/provider-cli-shared.ts +68 -11
- package/src/cli-adapters/raw-terminal-io.ts +252 -0
- 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 +1813 -60
- 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 +6753 -867
- package/src/config/chat-history.ts +474 -24
- package/src/config/config.ts +12 -0
- package/src/config/mesh-config.ts +303 -3
- 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/ide-detector.ts +26 -16
- package/src/git/git-commands.ts +43 -13
- package/src/git/git-diff.ts +53 -0
- package/src/git/git-status.ts +329 -12
- package/src/git/git-summary.ts +3 -0
- package/src/git/git-types.ts +17 -54
- package/src/git/git-worktree.ts +8 -1
- package/src/index.ts +139 -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/logger.ts +2 -1
- package/src/mesh/contracts.ts +329 -0
- package/src/mesh/coordinator-prompt.ts +234 -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 +1786 -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 -897
- 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 +232 -0
- package/src/mesh/mesh-reconcile-loop.ts +466 -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 +1513 -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 +641 -166
- 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 +15 -1
- package/src/providers/approval-utils.d.ts +4 -0
- package/src/providers/approval-utils.ts +47 -5
- package/src/providers/chat-message-normalization.ts +7 -12
- package/src/providers/cli-provider-instance.ts +953 -87
- 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 +584 -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 +155 -0
- package/src/providers/spec/cli-adapter.ts +838 -0
- package/src/providers/spec/evaluator.ts +345 -0
- package/src/providers/spec/fsm-driver.ts +875 -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 +943 -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 +189 -0
- package/src/providers/transcript-v2.ts +567 -0
- package/src/providers/types/interactive-prompt.ts +536 -0
- package/src/providers/version-archive.ts +38 -20
- package/src/repo-mesh-types.ts +378 -1
- 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
package/src/repo-mesh-types.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import type { GitRepoStatus, GitCompactSummary } from './git/git-types.js';
|
|
15
|
+
import type { MeshMissionSummary } from './mesh/mesh-missions.js';
|
|
15
16
|
|
|
16
17
|
// ─── Core Mesh Types ────────────────────────────
|
|
17
18
|
|
|
@@ -23,11 +24,42 @@ export interface RepoMesh {
|
|
|
23
24
|
defaultBranch?: string;
|
|
24
25
|
policy: RepoMeshPolicy;
|
|
25
26
|
coordinator: RepoMeshCoordinatorConfig;
|
|
27
|
+
meshHost?: RepoMeshHostMetadata;
|
|
26
28
|
projectContext: ProjectContextSnapshot;
|
|
27
29
|
nodes: RepoMeshNode[];
|
|
28
30
|
status: 'active' | 'archived' | 'deleted';
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
export type RepoMeshDaemonRole = 'host' | 'member';
|
|
34
|
+
|
|
35
|
+
export interface RepoMeshHostPairingMetadata {
|
|
36
|
+
status: 'not_configured' | 'pairing' | 'paired' | 'rejected' | 'revoked';
|
|
37
|
+
tokenId?: string;
|
|
38
|
+
joinedAt?: string;
|
|
39
|
+
lastPairedAt?: string;
|
|
40
|
+
lastRejectedAt?: string;
|
|
41
|
+
expiresAt?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface RepoMeshHostMetadata {
|
|
45
|
+
/** Local daemon role for this mesh. Missing metadata defaults to host for standalone compatibility. */
|
|
46
|
+
role: RepoMeshDaemonRole;
|
|
47
|
+
/** Daemon that owns mesh truth/status/git/queue/session/ledger/coordinator ownership. */
|
|
48
|
+
hostDaemonId?: string;
|
|
49
|
+
/** Mesh node that represents the host daemon, when known. */
|
|
50
|
+
hostNodeId?: string;
|
|
51
|
+
/** Future standalone manual pairing endpoint entered by member daemons. */
|
|
52
|
+
hostAddress?: string;
|
|
53
|
+
/** Redacted pairing state only; raw join tokens must not be persisted here. */
|
|
54
|
+
pairing?: RepoMeshHostPairingMetadata;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface RepoMeshHostStatus extends RepoMeshHostMetadata {
|
|
58
|
+
canOwnCoordinator: boolean;
|
|
59
|
+
canOwnQueue: boolean;
|
|
60
|
+
defaulted: boolean;
|
|
61
|
+
}
|
|
62
|
+
|
|
31
63
|
export interface RepoMeshNode {
|
|
32
64
|
id: string;
|
|
33
65
|
daemonId: string;
|
|
@@ -42,6 +74,7 @@ export interface RepoMeshNode {
|
|
|
42
74
|
effectiveCapabilities: RepoMeshNodeCapabilities;
|
|
43
75
|
policy: RepoMeshNodePolicy;
|
|
44
76
|
health: RepoMeshNodeHealth;
|
|
77
|
+
role?: RepoMeshDaemonRole;
|
|
45
78
|
status: 'enabled' | 'disabled' | 'removed';
|
|
46
79
|
}
|
|
47
80
|
|
|
@@ -58,10 +91,26 @@ export type RepoMeshNodeHealth =
|
|
|
58
91
|
export type RepoMeshSessionCleanupMode = 'preserve' | 'stop' | 'delete_stopped' | 'stop_and_delete';
|
|
59
92
|
export type RepoMeshSpawnedSessionVisibility = 'visible' | 'hidden';
|
|
60
93
|
|
|
94
|
+
export interface RepoMeshAutoFastForwardPolicy {
|
|
95
|
+
/** Defaults to true. Set false to disable daemon-initiated idle fast-forwards. */
|
|
96
|
+
enabled: boolean;
|
|
97
|
+
/** Maximum behind count eligible for automatic fast-forward. Missing means no limit. */
|
|
98
|
+
maxBehind?: number;
|
|
99
|
+
/** Defaults to true. Require submodule status to be clean before automatic fast-forward. */
|
|
100
|
+
requireCleanSubmodules?: boolean;
|
|
101
|
+
}
|
|
102
|
+
|
|
61
103
|
export interface RepoMeshPolicy {
|
|
62
104
|
requirePreTaskCheckpoint: boolean;
|
|
63
105
|
requirePostTaskCheckpoint: boolean;
|
|
64
106
|
requireApprovalForPush: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Narrow Refinery opt-in: when validation and patch-equivalence have passed,
|
|
109
|
+
* allow Refinery to publish submodule gitlink commits to each submodule's
|
|
110
|
+
* configured remote main branch with a non-force push, then verify reachability.
|
|
111
|
+
* Defaults to false; root branch pushes/merges are not affected.
|
|
112
|
+
*/
|
|
113
|
+
allowAutoPublishSubmoduleMainCommits?: boolean;
|
|
65
114
|
requireApprovalForDestructiveGit: boolean;
|
|
66
115
|
dirtyWorkspaceBehavior: 'block' | 'warn' | 'checkpoint_then_continue';
|
|
67
116
|
maxParallelTasks: number;
|
|
@@ -72,12 +121,28 @@ export interface RepoMeshPolicy {
|
|
|
72
121
|
* watch-the-agents behavior; hidden sessions remain discoverable and manually openable.
|
|
73
122
|
*/
|
|
74
123
|
spawnedSessionVisibility?: RepoMeshSpawnedSessionVisibility;
|
|
124
|
+
/**
|
|
125
|
+
* Whether worker sessions the coordinator dispatches should auto-approve agent
|
|
126
|
+
* approval modals (tool/command prompts) without firing a user-facing approval
|
|
127
|
+
* notification. Delegated workers are coordinator-driven, so a human should not
|
|
128
|
+
* have to approve each one; defaults to true. Set to false to make delegated
|
|
129
|
+
* worker sessions stop at approval modals like an interactive session.
|
|
130
|
+
* Stamped into the worker launch settings envelope as `autoApprove`, which wins
|
|
131
|
+
* over the global per-provider-type autoApprove config via the settings merge.
|
|
132
|
+
* A node policy may override this per-node (RepoMeshNodePolicy.delegatedWorkerAutoApprove).
|
|
133
|
+
*/
|
|
134
|
+
delegatedWorkerAutoApprove?: boolean;
|
|
75
135
|
/**
|
|
76
136
|
* What to do with delegated session-host records for a node when it is removed.
|
|
77
137
|
* Defaults to 'preserve' so completed work can be reviewed later and live
|
|
78
138
|
* runtimes are never stopped/deleted unless the mesh owner opts in.
|
|
79
139
|
*/
|
|
80
140
|
sessionCleanupOnNodeRemove?: RepoMeshSessionCleanupMode;
|
|
141
|
+
/**
|
|
142
|
+
* Daemon-initiated fast-forward for idle clean nodes that are only behind
|
|
143
|
+
* their tracked upstream. Defaults to enabled.
|
|
144
|
+
*/
|
|
145
|
+
autoFastForward?: RepoMeshAutoFastForwardPolicy;
|
|
81
146
|
/**
|
|
82
147
|
* Maximum number of automatic retry recommendations for a failed task on the
|
|
83
148
|
* same node before the daemon advises the coordinator to escalate or reassign.
|
|
@@ -93,12 +158,54 @@ export interface RepoMeshRelatedRepo {
|
|
|
93
158
|
workspace: string;
|
|
94
159
|
}
|
|
95
160
|
|
|
161
|
+
/**
|
|
162
|
+
* Per-(node, provider) role + parallelism declaration.
|
|
163
|
+
*
|
|
164
|
+
* `role` is a free-form resource-pool label (recommended values:
|
|
165
|
+
* 'investigation' | 'coding' | 'orchestration') describing what this
|
|
166
|
+
* (node, provider) combination is *for*. It is a label/hint only — it is
|
|
167
|
+
* surfaced to the coordinator and dashboards but the daemon does NOT route
|
|
168
|
+
* tasks by role (task routing stays driven by taskMode + requiredTags +
|
|
169
|
+
* targetNode/targetSession). role is intentionally orthogonal to taskMode:
|
|
170
|
+
* taskMode classifies the *work* (code_change vs live_debug_readonly), role
|
|
171
|
+
* classifies the *resource pool*.
|
|
172
|
+
*
|
|
173
|
+
* `maxParallel` is the only enforced field: the queue will not assign a task
|
|
174
|
+
* to this (node, provider) once it already has `maxParallel` active
|
|
175
|
+
* (status='assigned') tasks. When the global parallel cap and this per-(node,
|
|
176
|
+
* provider) cap disagree, the stricter (lower effective) limit wins — a claim
|
|
177
|
+
* must satisfy both. Omitting `maxParallel` means this provider is bounded only
|
|
178
|
+
* by the global/taskMode caps (full backward compatibility).
|
|
179
|
+
*/
|
|
180
|
+
export interface RepoMeshProviderRole {
|
|
181
|
+
/** Provider type this entry governs (e.g. 'claude-cli', 'codex-cli'). */
|
|
182
|
+
providerType: string;
|
|
183
|
+
/** Free-form role label; recommended: 'investigation' | 'coding' | 'orchestration'. */
|
|
184
|
+
role?: string;
|
|
185
|
+
/** Max concurrent active tasks for this (node, provider). Omit = no per-provider cap. */
|
|
186
|
+
maxParallel?: number;
|
|
187
|
+
}
|
|
188
|
+
|
|
96
189
|
export interface RepoMeshNodePolicy {
|
|
97
190
|
readOnly?: boolean;
|
|
98
191
|
canPush?: boolean;
|
|
99
192
|
maxConcurrentSessions?: number;
|
|
100
193
|
/** Ordered provider preference used when mesh_launch_session omits an explicit type. */
|
|
101
194
|
providerPriority?: string[];
|
|
195
|
+
/**
|
|
196
|
+
* Per-(node, provider) role + parallelism declarations. Each entry binds a
|
|
197
|
+
* providerType on THIS node to an optional free-form role label and an
|
|
198
|
+
* optional maxParallel cap. Only maxParallel is enforced (as an additional,
|
|
199
|
+
* stricter-wins constraint on top of the global maxParallelTasks/taskMode
|
|
200
|
+
* caps); role is a label/hint surfaced to the coordinator. Missing/empty:
|
|
201
|
+
* the node behaves exactly as before (global caps only).
|
|
202
|
+
*/
|
|
203
|
+
providerRoles?: RepoMeshProviderRole[];
|
|
204
|
+
/**
|
|
205
|
+
* Per-node override for RepoMeshPolicy.delegatedWorkerAutoApprove. When set, takes
|
|
206
|
+
* precedence over the mesh-level policy for worker sessions launched onto this node.
|
|
207
|
+
*/
|
|
208
|
+
delegatedWorkerAutoApprove?: boolean;
|
|
102
209
|
/**
|
|
103
210
|
* Optional associated/external repos that must be checked alongside this node.
|
|
104
211
|
* These are explicit policy/config entries only; Repo Mesh does not auto-discover
|
|
@@ -126,14 +233,75 @@ export const DEFAULT_MESH_POLICY: RepoMeshPolicy = {
|
|
|
126
233
|
requirePreTaskCheckpoint: false,
|
|
127
234
|
requirePostTaskCheckpoint: true,
|
|
128
235
|
requireApprovalForPush: true,
|
|
236
|
+
allowAutoPublishSubmoduleMainCommits: false,
|
|
129
237
|
requireApprovalForDestructiveGit: true,
|
|
130
238
|
dirtyWorkspaceBehavior: 'warn',
|
|
131
239
|
maxParallelTasks: 2,
|
|
132
240
|
spawnedSessionVisibility: 'visible',
|
|
241
|
+
delegatedWorkerAutoApprove: true,
|
|
133
242
|
sessionCleanupOnNodeRemove: 'preserve',
|
|
243
|
+
autoFastForward: { enabled: true },
|
|
134
244
|
maxTaskRetries: 1,
|
|
135
245
|
};
|
|
136
246
|
|
|
247
|
+
/**
|
|
248
|
+
* Resolve whether a delegated worker session launched onto `nodePolicy` (within a mesh
|
|
249
|
+
* governed by `meshPolicy`) should auto-approve. Precedence: node override → mesh policy
|
|
250
|
+
* → default true. The result is stamped into the worker launch settings envelope as
|
|
251
|
+
* `autoApprove`; it wins over the global per-provider-type autoApprove config because the
|
|
252
|
+
* launch path merges the envelope as a settingsOverride on top of the provider defaults.
|
|
253
|
+
*/
|
|
254
|
+
export function resolveDelegatedWorkerAutoApprove(
|
|
255
|
+
meshPolicy?: Pick<RepoMeshPolicy, 'delegatedWorkerAutoApprove'> | null,
|
|
256
|
+
nodePolicy?: Pick<RepoMeshNodePolicy, 'delegatedWorkerAutoApprove'> | null,
|
|
257
|
+
): boolean {
|
|
258
|
+
if (typeof nodePolicy?.delegatedWorkerAutoApprove === 'boolean') {
|
|
259
|
+
return nodePolicy.delegatedWorkerAutoApprove;
|
|
260
|
+
}
|
|
261
|
+
if (typeof meshPolicy?.delegatedWorkerAutoApprove === 'boolean') {
|
|
262
|
+
return meshPolicy.delegatedWorkerAutoApprove;
|
|
263
|
+
}
|
|
264
|
+
return true;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Resolve the per-(node, provider) role declaration from a node policy.
|
|
269
|
+
* Case-insensitive, trimmed match on providerType. Returns undefined when the
|
|
270
|
+
* node has no providerRoles entry for this provider (caller then applies only
|
|
271
|
+
* the global caps). Defensive against malformed config — non-object entries and
|
|
272
|
+
* blank providerTypes are skipped rather than throwing.
|
|
273
|
+
*/
|
|
274
|
+
export function resolveProviderRole(
|
|
275
|
+
nodePolicy: Pick<RepoMeshNodePolicy, 'providerRoles'> | null | undefined,
|
|
276
|
+
providerType: string | null | undefined,
|
|
277
|
+
): RepoMeshProviderRole | undefined {
|
|
278
|
+
const wanted = typeof providerType === 'string' ? providerType.trim().toLowerCase() : '';
|
|
279
|
+
if (!wanted) return undefined;
|
|
280
|
+
const roles = nodePolicy?.providerRoles;
|
|
281
|
+
if (!Array.isArray(roles)) return undefined;
|
|
282
|
+
for (const entry of roles) {
|
|
283
|
+
if (!entry || typeof entry !== 'object') continue;
|
|
284
|
+
const type = typeof entry.providerType === 'string' ? entry.providerType.trim().toLowerCase() : '';
|
|
285
|
+
if (type && type === wanted) return entry;
|
|
286
|
+
}
|
|
287
|
+
return undefined;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Resolve the enforced per-(node, provider) maxParallel cap, or undefined when
|
|
292
|
+
* no finite, non-negative cap is declared for this provider. Used by the queue
|
|
293
|
+
* claim path as a stricter-wins constraint layered on top of the global caps.
|
|
294
|
+
*/
|
|
295
|
+
export function resolveProviderMaxParallel(
|
|
296
|
+
nodePolicy: Pick<RepoMeshNodePolicy, 'providerRoles'> | null | undefined,
|
|
297
|
+
providerType: string | null | undefined,
|
|
298
|
+
): number | undefined {
|
|
299
|
+
const role = resolveProviderRole(nodePolicy, providerType);
|
|
300
|
+
const raw = Number(role?.maxParallel);
|
|
301
|
+
if (!Number.isFinite(raw) || raw < 0) return undefined;
|
|
302
|
+
return Math.floor(raw);
|
|
303
|
+
}
|
|
304
|
+
|
|
137
305
|
// ─── Capabilities ───────────────────────────────
|
|
138
306
|
|
|
139
307
|
export interface RepoMeshNodeCapabilities {
|
|
@@ -207,7 +375,28 @@ export interface RepoMeshCoordinatorConfig {
|
|
|
207
375
|
providerType?: string;
|
|
208
376
|
/** Preferred node to run coordinator on (null = auto) */
|
|
209
377
|
preferredNodeId?: string;
|
|
210
|
-
/**
|
|
378
|
+
/**
|
|
379
|
+
* Full mesh-level override for the coordinator system prompt. When set,
|
|
380
|
+
* replaces the daemon's rendered default and any user-file override
|
|
381
|
+
* (~/.adhdev/coordinator-prompts/<cli>.md). The per-launch
|
|
382
|
+
* extraSystemPrompt still composes on top — it always lands last as
|
|
383
|
+
* Additional Context. Supports the same {{placeholders}} the daemon's
|
|
384
|
+
* default template uses ({{meshName}}, {{repo}}, {{nodes}}, …).
|
|
385
|
+
*/
|
|
386
|
+
systemPromptOverride?: string;
|
|
387
|
+
/**
|
|
388
|
+
* Mesh-level append. Composes after whichever base prompt won
|
|
389
|
+
* (override → user-file override → daemon default). Use this when you
|
|
390
|
+
* want extra rules for THIS mesh but otherwise the standard prompt is
|
|
391
|
+
* fine. Stacks with the user-file append (`<cli>.append.md`) — both
|
|
392
|
+
* apply if both are set.
|
|
393
|
+
*/
|
|
394
|
+
systemPromptAppend?: string;
|
|
395
|
+
/**
|
|
396
|
+
* @deprecated Use systemPromptAppend. Kept as a fallback alias so
|
|
397
|
+
* existing meshes.json files keep working without a migration step;
|
|
398
|
+
* the daemon prefers systemPromptAppend when both are present.
|
|
399
|
+
*/
|
|
211
400
|
systemPromptSuffix?: string;
|
|
212
401
|
}
|
|
213
402
|
|
|
@@ -229,6 +418,7 @@ export interface LocalMeshEntry {
|
|
|
229
418
|
defaultBranch?: string;
|
|
230
419
|
policy: RepoMeshPolicy;
|
|
231
420
|
coordinator: RepoMeshCoordinatorConfig;
|
|
421
|
+
meshHost?: RepoMeshHostMetadata;
|
|
232
422
|
nodes: LocalMeshNodeEntry[];
|
|
233
423
|
createdAt: string;
|
|
234
424
|
updatedAt: string;
|
|
@@ -241,16 +431,42 @@ export interface LocalMeshNodeEntry {
|
|
|
241
431
|
daemonId?: string;
|
|
242
432
|
/** Machine registry ID that owns this workspace, when known. */
|
|
243
433
|
machineId?: string;
|
|
434
|
+
/** Operator-defined capability tags used by mesh queue matching. */
|
|
435
|
+
capabilities?: string[];
|
|
244
436
|
userOverrides: Partial<RepoMeshNodeCapabilities>;
|
|
245
437
|
policy: RepoMeshNodePolicy;
|
|
438
|
+
/**
|
|
439
|
+
* Per-node instruction surfaced in the coordinator prompt so the LLM
|
|
440
|
+
* knows what each node is for (e.g. "this is the staging mirror — run
|
|
441
|
+
* only smoke tests here", or "use opus on this node, sonnet elsewhere").
|
|
442
|
+
* Empty/missing: omitted silently from the rendered prompt, no rule
|
|
443
|
+
* line about it gets added. The coordinator forwards/honors it when
|
|
444
|
+
* delegating; we don't enforce it at the daemon level.
|
|
445
|
+
*/
|
|
446
|
+
systemPrompt?: string;
|
|
246
447
|
/** For single-machine mesh: same daemon, different worktree */
|
|
247
448
|
isLocalWorktree?: boolean;
|
|
248
449
|
/** Branch this worktree tracks (set when created via clone_mesh_node) */
|
|
249
450
|
worktreeBranch?: string;
|
|
250
451
|
/** Node ID this worktree was cloned from */
|
|
251
452
|
clonedFromNodeId?: string;
|
|
453
|
+
/** Repo-local preparation result for ADHDev-created worktree nodes. */
|
|
454
|
+
worktreeBootstrap?: {
|
|
455
|
+
status: 'ready' | 'running' | 'failed' | 'not_configured' | 'disabled' | 'stale';
|
|
456
|
+
required?: boolean;
|
|
457
|
+
configSource?: string;
|
|
458
|
+
configSourceType?: string;
|
|
459
|
+
startedAt?: string;
|
|
460
|
+
completedAt?: string;
|
|
461
|
+
lastCommand?: string;
|
|
462
|
+
exitCode?: number | null;
|
|
463
|
+
error?: string;
|
|
464
|
+
commandsRun?: Array<Record<string, unknown>>;
|
|
465
|
+
staleInputs?: string[];
|
|
466
|
+
};
|
|
252
467
|
/** Optional associated/external repos configured as node metadata. */
|
|
253
468
|
relatedRepos?: RepoMeshRelatedRepo[];
|
|
469
|
+
role?: RepoMeshDaemonRole;
|
|
254
470
|
}
|
|
255
471
|
|
|
256
472
|
// ─── Mesh Status (runtime, not persisted) ───────
|
|
@@ -259,17 +475,178 @@ export interface RepoMeshStatus {
|
|
|
259
475
|
meshId: string;
|
|
260
476
|
meshName: string;
|
|
261
477
|
repoIdentity: string;
|
|
478
|
+
defaultBranch?: string;
|
|
262
479
|
refreshedAt: string;
|
|
480
|
+
meshHost?: RepoMeshHostStatus;
|
|
263
481
|
nodes: RepoMeshNodeStatus[];
|
|
482
|
+
queue?: RepoMeshQueueStatus;
|
|
483
|
+
ledger?: RepoMeshLedgerStatus;
|
|
484
|
+
/**
|
|
485
|
+
* Mission summaries for the dashboard overview. Active/paused missions plus a
|
|
486
|
+
* capped, newest-first slice of completed/abandoned history. Omitted by older
|
|
487
|
+
* daemons — the dashboard must treat this as optional and render an empty
|
|
488
|
+
* state when absent. Split on each entry's `status` for live vs. history.
|
|
489
|
+
*/
|
|
490
|
+
missions?: MeshMissionSummary[];
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// RepoMeshSessionStatus shape now lives in @adhdev/mesh-shared (shared with
|
|
494
|
+
// web-core's session normalizer). Re-exported so local RepoMeshNodeStatus/
|
|
495
|
+
// RepoMeshStatus and external `@adhdev/daemon-core/repo-mesh-types` consumers
|
|
496
|
+
// keep resolving it unchanged.
|
|
497
|
+
export type { RepoMeshSessionStatus } from '@adhdev/mesh-shared';
|
|
498
|
+
import type { RepoMeshSessionStatus } from '@adhdev/mesh-shared';
|
|
499
|
+
|
|
500
|
+
export type RepoMeshPeerConnectionState = 'self' | 'connected' | 'connecting' | 'disconnected' | 'failed' | 'closed' | 'unknown';
|
|
501
|
+
export type RepoMeshPeerConnectionTransport = 'local' | 'direct' | 'relay' | 'unknown';
|
|
502
|
+
|
|
503
|
+
export interface RepoMeshPeerConnectionStatus {
|
|
504
|
+
perspective: 'selected_coordinator';
|
|
505
|
+
source: 'mesh_peer_status' | 'not_reported';
|
|
506
|
+
state: RepoMeshPeerConnectionState;
|
|
507
|
+
transport: RepoMeshPeerConnectionTransport;
|
|
508
|
+
reported: boolean;
|
|
509
|
+
reason?: string;
|
|
510
|
+
lastStateChangeAt?: string;
|
|
511
|
+
lastConnectedAt?: string;
|
|
512
|
+
lastCommandAt?: string;
|
|
264
513
|
}
|
|
265
514
|
|
|
266
515
|
export interface RepoMeshNodeStatus {
|
|
267
516
|
nodeId: string;
|
|
268
517
|
machineLabel: string;
|
|
269
518
|
workspace: string;
|
|
519
|
+
repoRoot?: string;
|
|
520
|
+
daemonId?: string;
|
|
521
|
+
machineId?: string;
|
|
522
|
+
role?: RepoMeshDaemonRole;
|
|
523
|
+
machineStatus?: string;
|
|
524
|
+
isLocalWorktree?: boolean;
|
|
525
|
+
worktreeBranch?: string;
|
|
526
|
+
/** Mirrored from LocalMeshNodeEntry.systemPrompt for coordinator-prompt rendering. */
|
|
527
|
+
systemPrompt?: string;
|
|
270
528
|
health: RepoMeshNodeHealth;
|
|
271
529
|
git?: GitRepoStatus;
|
|
530
|
+
/**
|
|
531
|
+
* True when the selected coordinator has evidence that a peer git probe is still
|
|
532
|
+
* in flight or just timed out during initial mesh handshake, so callers should
|
|
533
|
+
* treat missing git data as pending instead of authoritative absence.
|
|
534
|
+
*/
|
|
535
|
+
gitProbePending?: boolean;
|
|
272
536
|
providers: string[];
|
|
273
537
|
activeSessions: string[];
|
|
538
|
+
activeSessionDetails?: RepoMeshSessionStatus[];
|
|
539
|
+
providerPriority?: string[];
|
|
540
|
+
launchReady?: boolean;
|
|
541
|
+
/** True when the node is clean, ahead=0, behind>0, and safe for fast-forward consideration. */
|
|
542
|
+
autoFastForwardEligible?: boolean;
|
|
543
|
+
/** Coordinator-facing suggestion for obvious clean catch-up work. */
|
|
544
|
+
suggestedAction?: 'auto_fast_forward';
|
|
545
|
+
worktreeBootstrap?: LocalMeshNodeEntry['worktreeBootstrap'];
|
|
546
|
+
launchBlockedReason?: string;
|
|
547
|
+
launchBlockedMessage?: string;
|
|
548
|
+
recoveryHint?: string;
|
|
549
|
+
lastSeenAt?: string;
|
|
550
|
+
updatedAt?: string;
|
|
551
|
+
connection?: RepoMeshPeerConnectionStatus;
|
|
552
|
+
error?: string;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
export type RepoMeshQueueTaskStatus = 'pending' | 'assigned' | 'completed' | 'failed' | 'cancelled';
|
|
556
|
+
|
|
557
|
+
export interface RepoMeshQueueTask {
|
|
558
|
+
id: string;
|
|
559
|
+
meshId: string;
|
|
560
|
+
message: string;
|
|
561
|
+
status: RepoMeshQueueTaskStatus;
|
|
562
|
+
targetNodeId?: string;
|
|
563
|
+
targetSessionId?: string;
|
|
564
|
+
assignedNodeId?: string;
|
|
565
|
+
assignedSessionId?: string;
|
|
566
|
+
cancelReason?: string;
|
|
567
|
+
cancelledAt?: string;
|
|
568
|
+
requeueReason?: string;
|
|
569
|
+
requeuedAt?: string;
|
|
570
|
+
requeueCount?: number;
|
|
571
|
+
autoLaunch?: {
|
|
572
|
+
status: 'skipped' | 'started' | 'failed' | 'completed';
|
|
573
|
+
reason?: string;
|
|
574
|
+
nodeId?: string;
|
|
575
|
+
providerType?: string;
|
|
576
|
+
sessionId?: string;
|
|
577
|
+
updatedAt: string;
|
|
578
|
+
};
|
|
579
|
+
dispatchTimestamp?: string;
|
|
580
|
+
createdAt: string;
|
|
581
|
+
updatedAt: string;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
export interface RepoMeshQueueSummary {
|
|
585
|
+
total: number;
|
|
586
|
+
active: number;
|
|
587
|
+
historical: number;
|
|
588
|
+
pending: number;
|
|
589
|
+
assigned: number;
|
|
590
|
+
completed: number;
|
|
591
|
+
failed: number;
|
|
592
|
+
cancelled: number;
|
|
593
|
+
activeCounts: {
|
|
594
|
+
pending: number;
|
|
595
|
+
assigned: number;
|
|
596
|
+
};
|
|
597
|
+
historicalCounts: {
|
|
598
|
+
completed: number;
|
|
599
|
+
failed: number;
|
|
600
|
+
cancelled: number;
|
|
601
|
+
};
|
|
602
|
+
activeAssignments: Array<{
|
|
603
|
+
id: string;
|
|
604
|
+
nodeId?: string;
|
|
605
|
+
sessionId?: string;
|
|
606
|
+
message: string;
|
|
607
|
+
}>;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
export interface RepoMeshQueueStatus {
|
|
611
|
+
tasks: RepoMeshQueueTask[];
|
|
612
|
+
summary: RepoMeshQueueSummary;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
export interface RepoMeshLedgerEntryStatus {
|
|
616
|
+
id: string;
|
|
617
|
+
meshId: string;
|
|
618
|
+
timestamp: string;
|
|
619
|
+
kind: string;
|
|
620
|
+
nodeId?: string;
|
|
621
|
+
sessionId?: string;
|
|
622
|
+
providerType?: string;
|
|
623
|
+
payload: Record<string, unknown>;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
export interface RepoMeshLedgerSummaryStatus {
|
|
627
|
+
meshId: string;
|
|
628
|
+
totalEntries: number;
|
|
629
|
+
taskDispatched: number;
|
|
630
|
+
taskCompleted: number;
|
|
631
|
+
taskFailed: number;
|
|
632
|
+
taskStalled: number;
|
|
633
|
+
sessionLaunched: number;
|
|
634
|
+
checkpointCreated: number;
|
|
635
|
+
lastActivityAt: string | null;
|
|
636
|
+
recentFailures: number;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
export interface RepoMeshLedgerStatus {
|
|
640
|
+
entries: RepoMeshLedgerEntryStatus[];
|
|
641
|
+
summary: RepoMeshLedgerSummaryStatus;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
// ─── Async Job Lifecycle ─────────────────────────
|
|
645
|
+
// Shared base for all mesh async job types (refine jobs, bootstrap runs, etc.)
|
|
646
|
+
// Each concrete type adds its own status enum and domain-specific fields.
|
|
647
|
+
|
|
648
|
+
export interface MeshAsyncJobLifecycle {
|
|
649
|
+
startedAt?: string;
|
|
650
|
+
completedAt?: string;
|
|
274
651
|
error?: string;
|
|
275
652
|
}
|
package/src/sessions/registry.ts
CHANGED
|
@@ -8,6 +8,12 @@ export interface SessionRuntimeTarget {
|
|
|
8
8
|
cdpManagerKey?: string;
|
|
9
9
|
adapterKey?: string;
|
|
10
10
|
instanceKey?: string;
|
|
11
|
+
/** Working directory for CLI/ACP sessions. Used by read_chat to resolve
|
|
12
|
+
* native history when there is no live adapter (e.g. subscription path). */
|
|
13
|
+
workspace?: string;
|
|
14
|
+
/** Wall clock at register time. native-history readers use it as a
|
|
15
|
+
* cutoff so a fresh session can't show records from a prior one. */
|
|
16
|
+
spawnedAtMs?: number;
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
export class SessionRegistry {
|
|
@@ -21,14 +21,12 @@ export interface RuntimeAttachedClient {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/** Session status union (used by SessionEntry.status, legacy recent-launch metadata, etc.) */
|
|
24
|
-
export type SessionStatus = 'idle' | 'generating' | 'waiting_approval' | 'error' | 'stopped' | 'starting' | 'panel_hidden' | 'not_monitored' | 'disconnected';
|
|
24
|
+
export type SessionStatus = 'idle' | 'generating' | 'waiting_approval' | 'waiting_choice' | 'error' | 'stopped' | 'starting' | 'panel_hidden' | 'not_monitored' | 'disconnected';
|
|
25
25
|
|
|
26
26
|
/** Inbox bucket categories for recent sessions */
|
|
27
27
|
export type RecentSessionBucket = 'needs_attention' | 'working' | 'task_complete' | 'idle';
|
|
28
28
|
|
|
29
29
|
/** Terminal backend status */
|
|
30
30
|
export interface TerminalBackendStatus {
|
|
31
|
-
backend: '
|
|
32
|
-
preference: 'auto' | 'xterm' | 'ghostty-vt';
|
|
33
|
-
ghosttyAvailable: boolean;
|
|
31
|
+
backend: 'ghostty-vt';
|
|
34
32
|
}
|
package/src/shared-types.ts
CHANGED
|
@@ -56,6 +56,7 @@ import type {
|
|
|
56
56
|
GitWorkspaceUpdate,
|
|
57
57
|
WorkspaceGitSubscriptionParams,
|
|
58
58
|
} from './git/git-types.js';
|
|
59
|
+
import type { InteractivePrompt } from './providers/types/interactive-prompt.js';
|
|
59
60
|
|
|
60
61
|
export type {
|
|
61
62
|
GitCommandName,
|
|
@@ -110,6 +111,14 @@ export interface ReadChatSyncResult {
|
|
|
110
111
|
status: string;
|
|
111
112
|
title?: string;
|
|
112
113
|
activeModal?: { message: string; buttons: string[] } | null;
|
|
114
|
+
activeInteractivePrompt?: InteractivePrompt | null;
|
|
115
|
+
/**
|
|
116
|
+
* Chat source provenance from ChatSourceMachine (A2). Carries the
|
|
117
|
+
* selected source, transition cause, lock state, and legacy
|
|
118
|
+
* fallbackReason — opaque to the daemon-core, consumed by web-core
|
|
119
|
+
* for the source debug badge and SourceTimeline (A3).
|
|
120
|
+
*/
|
|
121
|
+
messageSource?: Record<string, unknown>;
|
|
113
122
|
}
|
|
114
123
|
|
|
115
124
|
export interface ProviderSummaryItem {
|
|
@@ -365,6 +374,7 @@ export interface SessionEntry {
|
|
|
365
374
|
runtimeRecoveryState?: string | null;
|
|
366
375
|
resume?: ProviderResumeCapability;
|
|
367
376
|
activeChat: SessionActiveChatData | null;
|
|
377
|
+
activeInteractivePrompt?: InteractivePrompt | null;
|
|
368
378
|
capabilities?: SessionCapability[];
|
|
369
379
|
/** Effective message input/media support for this session. Defaults fail-closed to text-only. */
|
|
370
380
|
messageInput?: MessageInputSupport;
|
|
@@ -389,6 +399,8 @@ export interface SessionEntry {
|
|
|
389
399
|
seenCompletionMarker?: string;
|
|
390
400
|
surfaceHidden?: boolean;
|
|
391
401
|
settings?: Record<string, any>;
|
|
402
|
+
/** Set when this session is acting as a mesh coordinator for the given mesh. */
|
|
403
|
+
coordinator?: { meshId: string; role: 'coordinator' };
|
|
392
404
|
meshQueueStats?: {
|
|
393
405
|
total?: number;
|
|
394
406
|
active?: number;
|
|
@@ -516,7 +528,39 @@ export interface AvailableProviderInfo {
|
|
|
516
528
|
lastVerification?: MachineProviderCheckResult;
|
|
517
529
|
/** Provider-declared Repo Mesh coordinator/MCP behavior. */
|
|
518
530
|
meshCoordinator?: ProviderMeshCoordinatorConfig;
|
|
519
|
-
|
|
531
|
+
/**
|
|
532
|
+
* Provider trust classification — derived from the on-disk layer the
|
|
533
|
+
* manifest came from and the shape of the manifest. Dashboards use
|
|
534
|
+
* this to render a trust badge and gate activation of
|
|
535
|
+
* `external-untrusted` providers behind a confirm modal.
|
|
536
|
+
*/
|
|
537
|
+
trust?: ProviderTrust;
|
|
538
|
+
/** Daemon-side human-readable description of the trust value. */
|
|
539
|
+
trustDescription?: string;
|
|
540
|
+
/** True when activation needs a user-side confirmation step. */
|
|
541
|
+
requiresConfirmation?: boolean;
|
|
542
|
+
/** Which on-disk layer the manifest lives in. */
|
|
543
|
+
sourceLayer?: 'user' | 'upstream' | 'external';
|
|
544
|
+
/** For external providers, the source-name namespace it came from. */
|
|
545
|
+
sourceName?: string | null;
|
|
546
|
+
/** Manifest-declared version, e.g. "1.2.1". */
|
|
547
|
+
providerVersion?: string;
|
|
548
|
+
/** Underlying executable name (CLI/binary providers). */
|
|
549
|
+
binary?: string;
|
|
550
|
+
/** Lifecycle label from the manifest: "Stable", "Beta", … */
|
|
551
|
+
status?: string;
|
|
552
|
+
/** One-line provider description from the manifest. */
|
|
553
|
+
details?: string;
|
|
554
|
+
/** Manifest-declared links: homepage, docs, repo, … */
|
|
555
|
+
links?: Record<string, string>;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
export type ProviderTrust =
|
|
559
|
+
| 'user-custom'
|
|
560
|
+
| 'trusted'
|
|
561
|
+
| 'trusted-with-scripts'
|
|
562
|
+
| 'external-safe'
|
|
563
|
+
| 'external-untrusted';
|
|
520
564
|
|
|
521
565
|
export interface MachineProviderCheckResult {
|
|
522
566
|
ok: boolean;
|