@adhdev/daemon-core 0.9.82-rc.31 → 0.9.82-rc.310
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 +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/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 +210 -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 +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 +38320 -16024
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38009 -15817
- 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 -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 +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 +181 -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 +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 +203 -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 +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/pty-transport.ts +2 -1
- package/src/cli-adapters/raw-terminal-io.ts +252 -0
- package/src/cli-adapters/resolve-executable.ts +45 -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 +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 +5911 -595
- package/src/commands/upgrade-helper.ts +29 -0
- 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 +42 -12
- package/src/git/git-diff.ts +53 -0
- package/src/git/git-executor.ts +12 -0
- package/src/git/git-status.ts +302 -18
- package/src/git/git-types.ts +14 -62
- package/src/git/git-worktree.ts +8 -1
- package/src/index.ts +131 -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 -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 +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 +604 -145
- 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 +4 -11
- 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 +257 -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
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, MeshMissionSlimSummary } 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) ───────
|
|
@@ -261,23 +477,30 @@ export interface RepoMeshStatus {
|
|
|
261
477
|
repoIdentity: string;
|
|
262
478
|
defaultBranch?: string;
|
|
263
479
|
refreshedAt: string;
|
|
480
|
+
meshHost?: RepoMeshHostStatus;
|
|
264
481
|
nodes: RepoMeshNodeStatus[];
|
|
265
482
|
queue?: RepoMeshQueueStatus;
|
|
266
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
|
+
* Compact (the default) status calls send the slim shape — `goalPreview` +
|
|
491
|
+
* `goalTruncated` instead of the full `goal` — while verbose sends the full
|
|
492
|
+
* `goal`. Consumers must read `goal ?? goalPreview`. Each entry may also carry
|
|
493
|
+
* an optional `stats` operational rollup (durations / retries).
|
|
494
|
+
*/
|
|
495
|
+
missions?: (MeshMissionSummary | MeshMissionSlimSummary)[];
|
|
267
496
|
}
|
|
268
497
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
recoveryState?: string | null;
|
|
276
|
-
workspace?: string | null;
|
|
277
|
-
title?: string | null;
|
|
278
|
-
lastActivityAt?: string | null;
|
|
279
|
-
isCached?: boolean;
|
|
280
|
-
}
|
|
498
|
+
// RepoMeshSessionStatus shape now lives in @adhdev/mesh-shared (shared with
|
|
499
|
+
// web-core's session normalizer). Re-exported so local RepoMeshNodeStatus/
|
|
500
|
+
// RepoMeshStatus and external `@adhdev/daemon-core/repo-mesh-types` consumers
|
|
501
|
+
// keep resolving it unchanged.
|
|
502
|
+
export type { RepoMeshSessionStatus } from '@adhdev/mesh-shared';
|
|
503
|
+
import type { RepoMeshSessionStatus } from '@adhdev/mesh-shared';
|
|
281
504
|
|
|
282
505
|
export type RepoMeshPeerConnectionState = 'self' | 'connected' | 'connecting' | 'disconnected' | 'failed' | 'closed' | 'unknown';
|
|
283
506
|
export type RepoMeshPeerConnectionTransport = 'local' | 'direct' | 'relay' | 'unknown';
|
|
@@ -301,9 +524,12 @@ export interface RepoMeshNodeStatus {
|
|
|
301
524
|
repoRoot?: string;
|
|
302
525
|
daemonId?: string;
|
|
303
526
|
machineId?: string;
|
|
527
|
+
role?: RepoMeshDaemonRole;
|
|
304
528
|
machineStatus?: string;
|
|
305
529
|
isLocalWorktree?: boolean;
|
|
306
530
|
worktreeBranch?: string;
|
|
531
|
+
/** Mirrored from LocalMeshNodeEntry.systemPrompt for coordinator-prompt rendering. */
|
|
532
|
+
systemPrompt?: string;
|
|
307
533
|
health: RepoMeshNodeHealth;
|
|
308
534
|
git?: GitRepoStatus;
|
|
309
535
|
/**
|
|
@@ -317,6 +543,14 @@ export interface RepoMeshNodeStatus {
|
|
|
317
543
|
activeSessionDetails?: RepoMeshSessionStatus[];
|
|
318
544
|
providerPriority?: string[];
|
|
319
545
|
launchReady?: boolean;
|
|
546
|
+
/** True when the node is clean, ahead=0, behind>0, and safe for fast-forward consideration. */
|
|
547
|
+
autoFastForwardEligible?: boolean;
|
|
548
|
+
/** Coordinator-facing suggestion for obvious clean catch-up work. */
|
|
549
|
+
suggestedAction?: 'auto_fast_forward';
|
|
550
|
+
worktreeBootstrap?: LocalMeshNodeEntry['worktreeBootstrap'];
|
|
551
|
+
launchBlockedReason?: string;
|
|
552
|
+
launchBlockedMessage?: string;
|
|
553
|
+
recoveryHint?: string;
|
|
320
554
|
lastSeenAt?: string;
|
|
321
555
|
updatedAt?: string;
|
|
322
556
|
connection?: RepoMeshPeerConnectionStatus;
|
|
@@ -411,3 +645,13 @@ export interface RepoMeshLedgerStatus {
|
|
|
411
645
|
entries: RepoMeshLedgerEntryStatus[];
|
|
412
646
|
summary: RepoMeshLedgerSummaryStatus;
|
|
413
647
|
}
|
|
648
|
+
|
|
649
|
+
// ─── Async Job Lifecycle ─────────────────────────
|
|
650
|
+
// Shared base for all mesh async job types (refine jobs, bootstrap runs, etc.)
|
|
651
|
+
// Each concrete type adds its own status enum and domain-specific fields.
|
|
652
|
+
|
|
653
|
+
export interface MeshAsyncJobLifecycle {
|
|
654
|
+
startedAt?: string;
|
|
655
|
+
completedAt?: string;
|
|
656
|
+
error?: string;
|
|
657
|
+
}
|
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;
|
package/src/status/builders.ts
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
type NormalizeActiveChatOptions,
|
|
26
26
|
} from './normalize.js';
|
|
27
27
|
import { getMeshQueueStats } from '../mesh/mesh-work-queue.js';
|
|
28
|
+
import { getCoordinatorForSession } from '../mesh/coordinator-registry.js';
|
|
28
29
|
import { normalizeProviderStateControlValues } from '../providers/provider-patch-state.js';
|
|
29
30
|
import { normalizeProviderSummaryMetadata } from '../providers/summary-metadata.js';
|
|
30
31
|
import {
|
|
@@ -164,7 +165,7 @@ const ACP_SESSION_CAPABILITIES: SessionCapability[] = [
|
|
|
164
165
|
'set_thought_level',
|
|
165
166
|
];
|
|
166
167
|
|
|
167
|
-
function
|
|
168
|
+
function buildWorkspaceSession(
|
|
168
169
|
state: IdeProviderState,
|
|
169
170
|
cdpManagers: Map<string, DaemonCdpManager>,
|
|
170
171
|
options: SessionEntryBuildOptions,
|
|
@@ -179,7 +180,10 @@ function buildIdeWorkspaceSession(
|
|
|
179
180
|
const git = getGitSummaryForWorkspace(workspace, options);
|
|
180
181
|
const title = activeChat?.title || state.name;
|
|
181
182
|
const meshCoordinatorFor = state.settings?.meshCoordinatorFor as string | undefined;
|
|
182
|
-
const
|
|
183
|
+
const registryEntry = state.instanceId ? getCoordinatorForSession(state.instanceId) : undefined;
|
|
184
|
+
const effectiveMeshId = meshCoordinatorFor || registryEntry?.meshId;
|
|
185
|
+
const coordinator = effectiveMeshId ? { meshId: effectiveMeshId, role: 'coordinator' as const } : undefined;
|
|
186
|
+
const meshQueueStats = effectiveMeshId ? getMeshQueueStats(effectiveMeshId) : undefined;
|
|
183
187
|
return {
|
|
184
188
|
id: state.instanceId || state.type,
|
|
185
189
|
parentId: null,
|
|
@@ -203,6 +207,7 @@ function buildIdeWorkspaceSession(
|
|
|
203
207
|
errorReason: state.errorReason,
|
|
204
208
|
lastUpdated: state.lastUpdated,
|
|
205
209
|
settings: state.settings,
|
|
210
|
+
...(coordinator && { coordinator }),
|
|
206
211
|
...(meshQueueStats && { meshQueueStats }),
|
|
207
212
|
};
|
|
208
213
|
}
|
|
@@ -221,7 +226,10 @@ function buildExtensionAgentSession(
|
|
|
221
226
|
const workspace = parent.workspace || null;
|
|
222
227
|
const git = getGitSummaryForWorkspace(workspace, options);
|
|
223
228
|
const meshCoordinatorFor = ext.settings?.meshCoordinatorFor as string | undefined;
|
|
224
|
-
const
|
|
229
|
+
const registryEntry = ext.instanceId ? getCoordinatorForSession(ext.instanceId) : undefined;
|
|
230
|
+
const effectiveMeshId = meshCoordinatorFor || registryEntry?.meshId;
|
|
231
|
+
const coordinator = effectiveMeshId ? { meshId: effectiveMeshId, role: 'coordinator' as const } : undefined;
|
|
232
|
+
const meshQueueStats = effectiveMeshId ? getMeshQueueStats(effectiveMeshId) : undefined;
|
|
225
233
|
return {
|
|
226
234
|
id: ext.instanceId || `${parent.instanceId}:${ext.type}`,
|
|
227
235
|
parentId: parent.instanceId || parent.type,
|
|
@@ -245,6 +253,7 @@ function buildExtensionAgentSession(
|
|
|
245
253
|
errorReason: ext.errorReason,
|
|
246
254
|
lastUpdated: ext.lastUpdated,
|
|
247
255
|
settings: ext.settings,
|
|
256
|
+
...(coordinator && { coordinator }),
|
|
248
257
|
...(meshQueueStats && { meshQueueStats }),
|
|
249
258
|
};
|
|
250
259
|
}
|
|
@@ -287,7 +296,10 @@ function buildCliSession(state: CliProviderState, options: SessionEntryBuildOpti
|
|
|
287
296
|
const workspace = state.workspace || null;
|
|
288
297
|
const git = getGitSummaryForWorkspace(workspace, options);
|
|
289
298
|
const meshCoordinatorFor = state.settings?.meshCoordinatorFor as string | undefined;
|
|
290
|
-
const
|
|
299
|
+
const registryEntry = state.instanceId ? getCoordinatorForSession(state.instanceId) : undefined;
|
|
300
|
+
const effectiveMeshId = meshCoordinatorFor || registryEntry?.meshId;
|
|
301
|
+
const coordinator = effectiveMeshId ? { meshId: effectiveMeshId, role: 'coordinator' as const } : undefined;
|
|
302
|
+
const meshQueueStats = effectiveMeshId ? getMeshQueueStats(effectiveMeshId) : undefined;
|
|
291
303
|
return {
|
|
292
304
|
id: state.instanceId,
|
|
293
305
|
parentId: null,
|
|
@@ -314,6 +326,7 @@ function buildCliSession(state: CliProviderState, options: SessionEntryBuildOpti
|
|
|
314
326
|
mode: state.mode,
|
|
315
327
|
resume: state.resume,
|
|
316
328
|
activeChat,
|
|
329
|
+
activeInteractivePrompt: state.activeInteractivePrompt ?? null,
|
|
317
330
|
...(summaryMetadata && { summaryMetadata }),
|
|
318
331
|
...(includeSessionMetadata && {
|
|
319
332
|
capabilities: state.mode === 'terminal' ? PTY_SESSION_CAPABILITIES : CLI_CHAT_SESSION_CAPABILITIES,
|
|
@@ -327,7 +340,9 @@ function buildCliSession(state: CliProviderState, options: SessionEntryBuildOpti
|
|
|
327
340
|
errorReason: state.errorReason,
|
|
328
341
|
lastUpdated: state.lastUpdated,
|
|
329
342
|
settings: state.settings,
|
|
343
|
+
...(coordinator && { coordinator }),
|
|
330
344
|
...(meshQueueStats && { meshQueueStats }),
|
|
345
|
+
...(state.settings?.spawnedSessionVisibility === 'hidden' && { surfaceHidden: true }),
|
|
331
346
|
};
|
|
332
347
|
}
|
|
333
348
|
|
|
@@ -341,7 +356,10 @@ function buildAcpSession(state: AcpProviderState, options: SessionEntryBuildOpti
|
|
|
341
356
|
const workspace = state.workspace || null;
|
|
342
357
|
const git = getGitSummaryForWorkspace(workspace, options);
|
|
343
358
|
const meshCoordinatorFor = state.settings?.meshCoordinatorFor as string | undefined;
|
|
344
|
-
const
|
|
359
|
+
const registryEntry = state.instanceId ? getCoordinatorForSession(state.instanceId) : undefined;
|
|
360
|
+
const effectiveMeshId = meshCoordinatorFor || registryEntry?.meshId;
|
|
361
|
+
const coordinator = effectiveMeshId ? { meshId: effectiveMeshId, role: 'coordinator' as const } : undefined;
|
|
362
|
+
const meshQueueStats = effectiveMeshId ? getMeshQueueStats(effectiveMeshId) : undefined;
|
|
345
363
|
return {
|
|
346
364
|
id: state.instanceId,
|
|
347
365
|
parentId: null,
|
|
@@ -364,7 +382,9 @@ function buildAcpSession(state: AcpProviderState, options: SessionEntryBuildOpti
|
|
|
364
382
|
errorReason: state.errorReason,
|
|
365
383
|
lastUpdated: state.lastUpdated,
|
|
366
384
|
settings: state.settings,
|
|
385
|
+
...(coordinator && { coordinator }),
|
|
367
386
|
...(meshQueueStats && { meshQueueStats }),
|
|
387
|
+
...(state.settings?.spawnedSessionVisibility === 'hidden' && { surfaceHidden: true }),
|
|
368
388
|
};
|
|
369
389
|
}
|
|
370
390
|
|
|
@@ -380,7 +400,7 @@ export function buildSessionEntries(
|
|
|
380
400
|
const acpStates = allStates.filter((s): s is AcpProviderState => s.category === 'acp');
|
|
381
401
|
|
|
382
402
|
for (const state of ideStates) {
|
|
383
|
-
sessions.push(
|
|
403
|
+
sessions.push(buildWorkspaceSession(state, cdpManagers, options));
|
|
384
404
|
for (const ext of state.extensions as ExtensionProviderState[]) {
|
|
385
405
|
if (!shouldIncludeExtensionSession(ext)) continue;
|
|
386
406
|
sessions.push(buildExtensionAgentSession(state, ext, options));
|
package/src/status/normalize.ts
CHANGED
|
@@ -5,6 +5,7 @@ export type ManagedStatus =
|
|
|
5
5
|
| 'idle'
|
|
6
6
|
| 'generating'
|
|
7
7
|
| 'waiting_approval'
|
|
8
|
+
| 'waiting_choice'
|
|
8
9
|
| 'error'
|
|
9
10
|
| 'stopped'
|
|
10
11
|
| 'starting'
|
|
@@ -151,6 +152,7 @@ export function normalizeManagedStatus(
|
|
|
151
152
|
|
|
152
153
|
const normalized = String(status || 'idle').trim().toLowerCase();
|
|
153
154
|
if (normalized === 'waiting_approval') return 'waiting_approval';
|
|
155
|
+
if (normalized === 'waiting_choice') return 'waiting_choice';
|
|
154
156
|
if (WORKING_STATUSES.has(normalized)) return 'generating';
|
|
155
157
|
if (normalized === 'error') return 'error';
|
|
156
158
|
if (normalized === 'stopped') return 'stopped';
|