@pellux/goodvibes-tui 1.25.0 → 1.26.0
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/CHANGELOG.md +15 -0
- package/README.md +1 -1
- package/docs/foundation-artifacts/operator-contract.json +6616 -2776
- package/package.json +8 -7
- package/src/cli/help.ts +10 -0
- package/src/cli/redaction.ts +68 -3
- package/src/config/goodvibes-home.ts +10 -0
- package/src/config/secret-config.ts +64 -8
- package/src/core/turn-event-wiring.ts +7 -16
- package/src/core/workstream-notification.ts +69 -0
- package/src/daemon/cli.ts +48 -4
- package/src/daemon/handlers/credentials.ts +15 -5
- package/src/daemon/send/channels.ts +200 -0
- package/src/daemon/send/command.ts +332 -0
- package/src/daemon/send/composition.ts +99 -0
- package/src/daemon/send/failure-text.ts +93 -0
- package/src/daemon/send/inert-text.ts +225 -0
- package/src/daemon/send/stdin.ts +24 -0
- package/src/input/commands/config.ts +68 -2
- package/src/input/commands/local-provider-runtime.ts +9 -1
- package/src/input/commands/operator-runtime.ts +6 -1
- package/src/input/commands/payment-card-intake.ts +200 -0
- package/src/input/commands/profile-render.ts +250 -0
- package/src/input/commands/profile-runtime.ts +362 -0
- package/src/input/commands/profile-types.ts +381 -0
- package/src/input/commands.ts +7 -0
- package/src/input/composer-editor.ts +4 -0
- package/src/input/onboarding/onboarding-wizard-apply.ts +13 -1
- package/src/input/payments-config.ts +167 -0
- package/src/input/provider-key-intake.ts +10 -2
- package/src/input/settings-modal-commit.ts +146 -0
- package/src/input/settings-modal-data.ts +30 -0
- package/src/input/settings-modal-reset.ts +6 -2
- package/src/input/settings-modal-secrets.ts +9 -2
- package/src/input/settings-modal-types.ts +17 -2
- package/src/input/settings-modal.ts +27 -107
- package/src/panels/modals/marketplace-modal.ts +5 -0
- package/src/panels/modals/skills-modal.ts +5 -0
- package/src/renderer/settings-modal-helpers.ts +4 -0
- package/src/renderer/settings-modal.ts +16 -1
- package/src/runtime/bootstrap.ts +2 -2
- package/src/runtime/install-self-check-startup.ts +23 -0
- package/src/runtime/onboarding/types.ts +6 -1
- package/src/runtime/path-shadow-startup.ts +243 -0
- package/src/runtime/path-shadow.ts +418 -0
- package/src/runtime/reachability-notice.ts +100 -0
- package/src/runtime/runtime-services-types.ts +243 -0
- package/src/runtime/services.ts +14 -205
- package/src/verification/verification-ledger.ts +104 -4
- package/src/version.ts +1 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* reachability-notice.ts — the two ways a running build can be the wrong one,
|
|
3
|
+
* stated in plain words at startup.
|
|
4
|
+
*
|
|
5
|
+
* The platform's guarantee is that clients auto-update at startup, the daemon
|
|
6
|
+
* checks hourly, and nothing ever drifts. Two things break that guarantee
|
|
7
|
+
* without breaking anything visible:
|
|
8
|
+
*
|
|
9
|
+
* 1. Another copy of this command sits EARLIER on PATH. The updater keeps
|
|
10
|
+
* maintaining the copy it installed; the shell keeps running the other
|
|
11
|
+
* one. Both installs "succeed", the version number reports itself
|
|
12
|
+
* current, and an older build answers every question.
|
|
13
|
+
* 2. This build is simply behind the latest release and, for whatever
|
|
14
|
+
* reason, did not update itself — a package-managed install, a failed
|
|
15
|
+
* swap, a check that could not reach the network.
|
|
16
|
+
*
|
|
17
|
+
* Either way the user finds out by being told a capability does not exist. A
|
|
18
|
+
* build that knows it is not the current one must say so before anything
|
|
19
|
+
* else, so this module turns those two facts into lines and the wiring in
|
|
20
|
+
* path-shadow-startup.ts prints them ahead of the session.
|
|
21
|
+
*
|
|
22
|
+
* Pure by construction: it is handed a completed scan and two version strings
|
|
23
|
+
* and decides only what to say.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { compareVersions, normalizeVersion } from './update-check.ts';
|
|
27
|
+
import { describeShadowReport, type ShadowScanResult } from './path-shadow.ts';
|
|
28
|
+
|
|
29
|
+
export type ReachabilityNoticeKind = 'shadowed' | 'not-on-path' | 'behind';
|
|
30
|
+
|
|
31
|
+
export interface ReachabilityNotice {
|
|
32
|
+
readonly kind: ReachabilityNoticeKind;
|
|
33
|
+
/** Plain lines, already in the order they should be read. */
|
|
34
|
+
readonly lines: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface ReachabilityNoticeInput {
|
|
38
|
+
/** The completed PATH scan for this command. */
|
|
39
|
+
readonly scan: ShadowScanResult;
|
|
40
|
+
/** The version this process is running. */
|
|
41
|
+
readonly runningVersion: string;
|
|
42
|
+
/** The newest released version, or undefined when it could not be determined. */
|
|
43
|
+
readonly latestVersion?: string | undefined;
|
|
44
|
+
/** The exact command that brings this install up to date. */
|
|
45
|
+
readonly updateCommand: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Builds the notices for this startup. Returns an empty list for the healthy
|
|
50
|
+
* case — one reachable copy, running the latest release — so a normal start
|
|
51
|
+
* says nothing at all.
|
|
52
|
+
*/
|
|
53
|
+
export function buildReachabilityNotices(input: ReachabilityNoticeInput): ReachabilityNotice[] {
|
|
54
|
+
const notices: ReachabilityNotice[] = [];
|
|
55
|
+
|
|
56
|
+
for (const report of input.scan.shadowed) {
|
|
57
|
+
const lines = describeShadowReport(report);
|
|
58
|
+
if (lines.length === 0) continue;
|
|
59
|
+
notices.push({
|
|
60
|
+
kind: report.installDirNotOnPath ? 'not-on-path' : 'shadowed',
|
|
61
|
+
lines: [
|
|
62
|
+
...lines,
|
|
63
|
+
report.installDirNotOnPath
|
|
64
|
+
? 'Until then, run it by its full path.'
|
|
65
|
+
: 'Until then, updating this install changes nothing you can reach by name.',
|
|
66
|
+
],
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const behind = describeVersionGap(input);
|
|
71
|
+
if (behind) notices.push(behind);
|
|
72
|
+
|
|
73
|
+
return notices;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The staleness line. Deliberately silent when the latest version is unknown:
|
|
78
|
+
* an unreachable network is not evidence of being behind, and saying so would
|
|
79
|
+
* be the same kind of false certainty this module exists to remove.
|
|
80
|
+
*/
|
|
81
|
+
function describeVersionGap(input: ReachabilityNoticeInput): ReachabilityNotice | undefined {
|
|
82
|
+
if (!input.latestVersion) return undefined;
|
|
83
|
+
const running = normalizeVersion(input.runningVersion);
|
|
84
|
+
const latest = normalizeVersion(input.latestVersion);
|
|
85
|
+
if (running.length === 0 || latest.length === 0) return undefined;
|
|
86
|
+
if (compareVersions(running, latest) >= 0) return undefined;
|
|
87
|
+
return {
|
|
88
|
+
kind: 'behind',
|
|
89
|
+
lines: [
|
|
90
|
+
`This build is v${running}. The current release is v${latest}, so what you are running is behind.`,
|
|
91
|
+
`Anything added since v${running} is genuinely absent from this build — if it says it cannot do something, that may be why.`,
|
|
92
|
+
`Update with: ${input.updateCommand}`,
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** One flat list of lines, for a surface that prints rather than groups. */
|
|
98
|
+
export function reachabilityNoticeLines(notices: readonly ReachabilityNotice[]): string[] {
|
|
99
|
+
return notices.flatMap((notice) => [...notice.lines]);
|
|
100
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* runtime-services-types.ts — the public contract createRuntimeServices() takes
|
|
3
|
+
* and returns.
|
|
4
|
+
*
|
|
5
|
+
* Split out of services.ts (the composition root that builds every one of
|
|
6
|
+
* these fields) so the construction logic can stay under the repo's
|
|
7
|
+
* architecture line-count gate without trimming 35 arbitrary lines to clear
|
|
8
|
+
* the number. This module owns ONLY the shape of the input options and the
|
|
9
|
+
* output surface — no runtime code, no wiring order, nothing that constructs
|
|
10
|
+
* anything. services.ts re-exports both types from here, so no import site
|
|
11
|
+
* anywhere else in the app had to change.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type { FocusTracker } from '../core/focus-tracker.ts';
|
|
15
|
+
import type { ConfigManager, ServiceRegistry, SubscriptionManager, ToolLLM } from '@pellux/goodvibes-sdk/platform/config';
|
|
16
|
+
import type { SecretsManager } from '../config/secrets.ts';
|
|
17
|
+
import type { AutomationDeliveryManager, AutomationManager } from '@pellux/goodvibes-sdk/platform/automation';
|
|
18
|
+
import type { ChannelDeliveryRouter, ChannelPolicyManager, ChannelPluginRegistry, RouteBindingManager, SurfaceRegistry } from '@pellux/goodvibes-sdk/platform/channels';
|
|
19
|
+
import type { ApprovalBroker, GatewayMethodCatalog, SessionLiveTurnControlsHolder, SharedSessionBroker } from '@pellux/goodvibes-sdk/platform/control-plane';
|
|
20
|
+
import type { PowerManager } from '@pellux/goodvibes-sdk/platform/power';
|
|
21
|
+
import type { wireIdlePowerAndLiveTurn } from './idle-power-services.ts';
|
|
22
|
+
import type { StepUpService } from '@pellux/goodvibes-sdk/daemon';
|
|
23
|
+
import type { PairingTokenManager } from '@pellux/goodvibes-sdk/platform/pairing';
|
|
24
|
+
import type { WatcherRegistry } from '@pellux/goodvibes-sdk/platform/watchers';
|
|
25
|
+
import type { ArtifactStore } from '@pellux/goodvibes-sdk/platform/artifacts';
|
|
26
|
+
import type { HomeGraphService, KnowledgeService, ProjectPlanningService } from '@pellux/goodvibes-sdk/platform/knowledge';
|
|
27
|
+
import type { MediaProviderRegistry } from '@pellux/goodvibes-sdk/platform/media';
|
|
28
|
+
import type { MultimodalService } from '@pellux/goodvibes-sdk/platform/multimodal';
|
|
29
|
+
import type { AgentMessageBus, AgentOrchestrator, ArchetypeLoader, WrfcController } from '@pellux/goodvibes-sdk/platform/agents';
|
|
30
|
+
import type { AgentManager, ContextAccountingHolder, OverflowHandler, ProcessManager, WorkflowServices } from '@pellux/goodvibes-sdk/platform/tools';
|
|
31
|
+
import type { FileUndoManager, MemoryConsolidationScheduler, MemoryEmbeddingProviderRegistry, MemoryRegistry, MemoryStore, ModeManager, ProjectIndex, CodeIndexStore, CodeIndexReindexScheduler } from '@pellux/goodvibes-sdk/platform/state';
|
|
32
|
+
import type { StoreSnapshotScheduler } from '@pellux/goodvibes-sdk/platform/state/store-snapshots';
|
|
33
|
+
import type { UserPermissionRuleStore } from '@pellux/goodvibes-sdk/platform/permissions';
|
|
34
|
+
import type { buildExecPromptAnswerHandler } from '@pellux/goodvibes-sdk/platform/runtime/permissions/exec-prompt-wiring';
|
|
35
|
+
import type { buildLocalhostFetchApproval } from '@pellux/goodvibes-sdk/platform/runtime/permissions/localhost-fetch-approval';
|
|
36
|
+
import type { NotificationDispatcher } from './notification-dispatch.ts';
|
|
37
|
+
import type { createDurabilityServices } from './durability-services.ts';
|
|
38
|
+
import type { MemorySpineClient } from '@pellux/goodvibes-sdk/platform/runtime/memory-spine';
|
|
39
|
+
import type { WorkspaceCheckpointManager } from '@pellux/goodvibes-sdk/platform/workspace';
|
|
40
|
+
import type { DomainDispatch, RuntimeStore } from './store/index.ts';
|
|
41
|
+
import type { RuntimeEventBus, DistributedRuntimeManager, RemoteRunnerRegistry, RemoteSupervisor, IntegrationHelperService, IdempotencyStore, ComponentHealthMonitor, WorktreeRegistry, SandboxSessionRegistry, ShellPathService, FeatureFlagManager, PolicyRuntimeState, SessionSurface } from '@/runtime/index.ts';
|
|
42
|
+
import type { VoiceProviderRegistry, VoiceService } from '@pellux/goodvibes-sdk/platform/voice';
|
|
43
|
+
import type { CacheRegistry, PauseController, MemoryGovernor } from '@pellux/goodvibes-sdk/platform/runtime/memory';
|
|
44
|
+
import type { WebSearchProviderRegistry, WebSearchService } from '@pellux/goodvibes-sdk/platform/web-search';
|
|
45
|
+
import type { PanelManager } from '../panels/panel-manager.ts';
|
|
46
|
+
import type { HookActivityTracker } from '@pellux/goodvibes-sdk/platform/hooks';
|
|
47
|
+
import type { HookDispatcher, HookWorkbench } from '@pellux/goodvibes-sdk/platform/hooks';
|
|
48
|
+
import type { PluginManager } from '@pellux/goodvibes-sdk/platform/plugins';
|
|
49
|
+
import type { BookmarkManager } from '@pellux/goodvibes-sdk/platform/bookmarks';
|
|
50
|
+
import type { ProfileManager } from '@pellux/goodvibes-sdk/platform/profiles';
|
|
51
|
+
import type { SessionManager, CrossSessionTaskRegistry, SessionChangeTracker } from '@pellux/goodvibes-sdk/platform/sessions';
|
|
52
|
+
import type { ApiTokenAuditor, UserAuthManager } from '@pellux/goodvibes-sdk/platform/security';
|
|
53
|
+
import type { WebhookNotifier } from '@pellux/goodvibes-sdk/platform/integrations';
|
|
54
|
+
import type { McpRegistry } from '@pellux/goodvibes-sdk/platform/mcp';
|
|
55
|
+
import type { BenchmarkStore, CacheHitTracker, FavoritesStore, ModelLimitsService, ProviderCapabilityRegistry, ProviderOptimizer, ProviderRegistry } from '@pellux/goodvibes-sdk/platform/providers';
|
|
56
|
+
import type { KeybindingsManager } from '../input/keybindings.ts';
|
|
57
|
+
import type { AdaptivePlanner, DeterministicReplayEngine, ExecutionPlanManager, SessionLineageTracker, SessionMemoryStore } from '@pellux/goodvibes-sdk/platform/core';
|
|
58
|
+
import type { ArchivableProcessRegistry } from '@pellux/goodvibes-sdk/platform/runtime/fleet';
|
|
59
|
+
import type { OrchestrationEngine, WorkstreamCommandService } from './workstream-services.ts';
|
|
60
|
+
import type { WorkPlanStore } from '../work-plans/work-plan-store.ts';
|
|
61
|
+
import type { DaemonHandlerSurfaces } from '../daemon/handlers/index.ts';
|
|
62
|
+
import type { ClusterGroupComposition } from './cluster-group-composition.ts';
|
|
63
|
+
import type { ClusterCoordinator } from '@pellux/goodvibes-sdk/platform/cluster';
|
|
64
|
+
import type { WorkspaceTrustManager } from './trust/workspace-trust.ts';
|
|
65
|
+
|
|
66
|
+
export interface RuntimeServicesOptions {
|
|
67
|
+
readonly runtimeBus: RuntimeEventBus;
|
|
68
|
+
readonly runtimeStore: RuntimeStore;
|
|
69
|
+
readonly configManager: ConfigManager;
|
|
70
|
+
readonly localUserAuthManager?: UserAuthManager;
|
|
71
|
+
readonly featureFlags?: FeatureFlagManager;
|
|
72
|
+
readonly getConversationTitle?: () => string | undefined;
|
|
73
|
+
readonly workingDir: string;
|
|
74
|
+
readonly homeDirectory: string;
|
|
75
|
+
/**
|
|
76
|
+
* The daemon's state root when the host was told one (`--daemon-home`,
|
|
77
|
+
* `GOODVIBES_DAEMON_HOME`); absent ⇒ `<homeDirectory>/.goodvibes/daemon`.
|
|
78
|
+
* Threaded into `SecretsManager` so the override MOVES the daemon-scoped
|
|
79
|
+
* credential store; without it a daemon told to run out of a temp tree still
|
|
80
|
+
* read the real home's daemon secrets, so an "isolated" test daemon held the
|
|
81
|
+
* owner's live credentials. One name for one thing — `resolveGoodVibesHomeOwnership`
|
|
82
|
+
* is the single reader that produces it.
|
|
83
|
+
*/
|
|
84
|
+
readonly daemonHomeDirectory?: string | undefined;
|
|
85
|
+
/** Opt-in (daemon-side only): fold host-observed external coding-agent sessions
|
|
86
|
+
* into the fleet as 'observed-external' rows. Interactive leaves it off and reads
|
|
87
|
+
* the daemon snapshot. Mirrors the SDK's own createRuntimeServices option. */
|
|
88
|
+
readonly observeExternalAgents?: boolean | undefined;
|
|
89
|
+
/** Host power seam opt-in. Fork mirrors the SDK: non-spawning unavailable-seam
|
|
90
|
+
* default (idle-power-services.ts); daemon + embedded runtime pass createHostPowerSeam(). */
|
|
91
|
+
readonly powerSeam?: Parameters<typeof wireIdlePowerAndLiveTurn>[0]['powerSeam'];
|
|
92
|
+
/** Live session id, read per crash-residue sweep so the running session is exempt — see durability-services.ts. */
|
|
93
|
+
readonly currentSessionId?: (() => string | null) | undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface RuntimeServices {
|
|
97
|
+
readonly workingDirectory: string;
|
|
98
|
+
readonly homeDirectory: string;
|
|
99
|
+
/** The declare-once session-storage handle every session reader and writer threads through — see session-storage-services.ts. */
|
|
100
|
+
readonly surface: SessionSurface;
|
|
101
|
+
readonly shellPaths: ShellPathService;
|
|
102
|
+
readonly configManager: ConfigManager;
|
|
103
|
+
readonly featureFlags: FeatureFlagManager;
|
|
104
|
+
readonly runtimeBus: RuntimeEventBus;
|
|
105
|
+
readonly runtimeStore: RuntimeStore;
|
|
106
|
+
readonly runtimeDispatch: DomainDispatch;
|
|
107
|
+
readonly panelManager: PanelManager;
|
|
108
|
+
readonly keybindingsManager: KeybindingsManager;
|
|
109
|
+
readonly routeBindings: RouteBindingManager;
|
|
110
|
+
readonly surfaceRegistry: SurfaceRegistry;
|
|
111
|
+
readonly channelPlugins: ChannelPluginRegistry;
|
|
112
|
+
readonly channelDeliveryRouter: ChannelDeliveryRouter;
|
|
113
|
+
readonly watcherRegistry: WatcherRegistry;
|
|
114
|
+
readonly approvalBroker: ApprovalBroker;
|
|
115
|
+
/** Loopback-fetch approval that rides the approval broker; shared by the tool registry and orchestrator so every surface asks the same way. */
|
|
116
|
+
readonly localhostFetchApproval: ReturnType<typeof buildLocalhostFetchApproval>;
|
|
117
|
+
/** Terminal prompt-answer handler that rides the approval broker; shared by the tool registry and orchestrator so an interactive command's prompt gets an ask/card on every surface. */
|
|
118
|
+
readonly execPromptAnswerHandler: ReturnType<typeof buildExecPromptAnswerHandler>;
|
|
119
|
+
/** Routes curated runtime-domain events into the panel_only notification feed (the panel's live producer). */
|
|
120
|
+
readonly notificationDispatcher: NotificationDispatcher;
|
|
121
|
+
/** Durable user-origin permission rules (remembered approvals); permissions.rules.* surface. Mirrors the SDK composition. */
|
|
122
|
+
readonly userPermissionRuleStore: UserPermissionRuleStore;
|
|
123
|
+
readonly sessionBroker: SharedSessionBroker;
|
|
124
|
+
readonly deliveryManager: AutomationDeliveryManager;
|
|
125
|
+
readonly automationManager: AutomationManager;
|
|
126
|
+
readonly gatewayMethods: GatewayMethodCatalog;
|
|
127
|
+
readonly artifactStore: ArtifactStore;
|
|
128
|
+
readonly knowledgeService: KnowledgeService;
|
|
129
|
+
readonly agentKnowledgeService: KnowledgeService;
|
|
130
|
+
readonly homeGraphService: HomeGraphService;
|
|
131
|
+
readonly projectPlanningService: ProjectPlanningService;
|
|
132
|
+
readonly projectPlanningProjectId: string;
|
|
133
|
+
readonly workPlanStore: WorkPlanStore;
|
|
134
|
+
readonly memoryStore: MemoryStore;
|
|
135
|
+
readonly memoryRegistry: MemoryRegistry;
|
|
136
|
+
/** Host-vs-client memory access: local until bootstrap.ts activates it for an adopted 'external' daemon (mirrors sessionSpine). */
|
|
137
|
+
readonly memorySpine: MemorySpineClient;
|
|
138
|
+
readonly serviceRegistry: ServiceRegistry;
|
|
139
|
+
readonly secretsManager: SecretsManager;
|
|
140
|
+
readonly stepUpService: StepUpService;
|
|
141
|
+
readonly pairingTokens: PairingTokenManager; // backs pairing.tokens.* verbs + the settings device surface (mirrors the SDK composition)
|
|
142
|
+
readonly subscriptionManager: SubscriptionManager;
|
|
143
|
+
readonly localUserAuthManager: UserAuthManager;
|
|
144
|
+
readonly profileManager: ProfileManager;
|
|
145
|
+
readonly bookmarkManager: BookmarkManager;
|
|
146
|
+
readonly sessionManager: SessionManager;
|
|
147
|
+
readonly sessionOrchestration: CrossSessionTaskRegistry;
|
|
148
|
+
readonly hookDispatcher: HookDispatcher;
|
|
149
|
+
readonly hookActivityTracker: HookActivityTracker;
|
|
150
|
+
readonly hookWorkbench: HookWorkbench;
|
|
151
|
+
readonly pluginManager: PluginManager;
|
|
152
|
+
readonly workflow: WorkflowServices;
|
|
153
|
+
readonly voiceProviders: VoiceProviderRegistry;
|
|
154
|
+
readonly voiceService: VoiceService;
|
|
155
|
+
readonly webSearchProviders: WebSearchProviderRegistry;
|
|
156
|
+
readonly webSearchService: WebSearchService;
|
|
157
|
+
readonly mediaProviders: MediaProviderRegistry;
|
|
158
|
+
readonly multimodalService: MultimodalService;
|
|
159
|
+
readonly memoryEmbeddingRegistry: MemoryEmbeddingProviderRegistry;
|
|
160
|
+
readonly channelPolicy: ChannelPolicyManager;
|
|
161
|
+
readonly mcpRegistry: McpRegistry;
|
|
162
|
+
readonly tokenAuditor: ApiTokenAuditor;
|
|
163
|
+
readonly componentHealthMonitor: ComponentHealthMonitor;
|
|
164
|
+
readonly worktreeRegistry: WorktreeRegistry;
|
|
165
|
+
readonly sandboxSessionRegistry: SandboxSessionRegistry;
|
|
166
|
+
readonly webhookNotifier: WebhookNotifier;
|
|
167
|
+
/** Terminal focus tracker — fed by input/handler-feed.ts, read by the alert notifiers in core/. */
|
|
168
|
+
readonly focusTracker: FocusTracker;
|
|
169
|
+
readonly replayEngine: DeterministicReplayEngine;
|
|
170
|
+
readonly providerOptimizer: ProviderOptimizer;
|
|
171
|
+
readonly providerCapabilityRegistry: ProviderCapabilityRegistry;
|
|
172
|
+
readonly cacheHitTracker: CacheHitTracker;
|
|
173
|
+
readonly favoritesStore: FavoritesStore;
|
|
174
|
+
readonly benchmarkStore: BenchmarkStore;
|
|
175
|
+
readonly modelLimitsService: ModelLimitsService;
|
|
176
|
+
readonly providerRegistry: ProviderRegistry;
|
|
177
|
+
readonly toolLLM: ToolLLM;
|
|
178
|
+
readonly distributedRuntime: DistributedRuntimeManager;
|
|
179
|
+
readonly daemonHandlers: DaemonHandlerSurfaces;
|
|
180
|
+
/** Elects the one node on this network that consumes inbound messages; hand it to the DaemonServer so its consumers share this leadership instead of holding a second election. */
|
|
181
|
+
readonly clusterCoordinator: ClusterCoordinator;
|
|
182
|
+
/** LAN group membership: identity, keys, roster, and the `cluster` verbs. */
|
|
183
|
+
readonly clusterGroup: ClusterGroupComposition;
|
|
184
|
+
/** Start the group layer and then the election, in that order. Idempotent. */
|
|
185
|
+
readonly startCluster: () => Promise<void>;
|
|
186
|
+
readonly remoteRunnerRegistry: RemoteRunnerRegistry;
|
|
187
|
+
readonly remoteSupervisor: RemoteSupervisor;
|
|
188
|
+
readonly sessionMemoryStore: SessionMemoryStore;
|
|
189
|
+
readonly sessionLineageTracker: SessionLineageTracker;
|
|
190
|
+
readonly sessionChangeTracker: SessionChangeTracker;
|
|
191
|
+
readonly planManager: ExecutionPlanManager;
|
|
192
|
+
readonly adaptivePlanner: AdaptivePlanner;
|
|
193
|
+
readonly idempotencyStore: IdempotencyStore;
|
|
194
|
+
readonly overflowHandler: OverflowHandler;
|
|
195
|
+
readonly policyRuntimeState: PolicyRuntimeState;
|
|
196
|
+
readonly archetypeLoader: ArchetypeLoader;
|
|
197
|
+
readonly agentManager: AgentManager;
|
|
198
|
+
readonly agentMessageBus: AgentMessageBus;
|
|
199
|
+
readonly agentOrchestrator: AgentOrchestrator;
|
|
200
|
+
readonly contextAccountingHolder: ContextAccountingHolder; // bound at bootstrap.ts; see context-accounting-source.ts
|
|
201
|
+
readonly wrfcController: WrfcController;
|
|
202
|
+
readonly processManager: ProcessManager;
|
|
203
|
+
/** The phase/work-item orchestration engine — see runtime/workstream-services.ts. */
|
|
204
|
+
readonly orchestrationEngine: OrchestrationEngine;
|
|
205
|
+
readonly workstreamCommands: WorkstreamCommandService;
|
|
206
|
+
/** The repo source-tree code index — see runtime/code-index-services.ts. */
|
|
207
|
+
readonly codeIndexStore: CodeIndexStore;
|
|
208
|
+
readonly codeIndexReindexScheduler: CodeIndexReindexScheduler; // tool-site reindex
|
|
209
|
+
/** Daily snapshots of every SQLite store this runtime writes, with bounded retention; unref'd timers (mirrors the SDK composition — hosts that tear down a runtime stop() it themselves). */
|
|
210
|
+
readonly storeSnapshotScheduler: StoreSnapshotScheduler;
|
|
211
|
+
readonly appendOnlyRetentionScheduler: ReturnType<typeof createDurabilityServices>['appendOnlyRetentionScheduler']; // periodic append-only sweep; unref'd timers, stop() on teardown
|
|
212
|
+
/** Stops the recurring crash-residue sweep; idempotent, unref'd timer (hosts that tear a runtime down call it). */
|
|
213
|
+
readonly stopDurabilityHousekeeping: () => void;
|
|
214
|
+
readonly memoryConsolidationScheduler: MemoryConsolidationScheduler;
|
|
215
|
+
readonly powerManager: PowerManager;
|
|
216
|
+
/** The daemon's memory governor (default ON). Backs ops.memory.get and defends the daemon's footprint by tier. */
|
|
217
|
+
readonly memoryGovernor: MemoryGovernor;
|
|
218
|
+
/** Registry of every retained cache the governor can shrink (knowledge stores + shared session broker). */
|
|
219
|
+
readonly cacheRegistry: CacheRegistry;
|
|
220
|
+
/** Controller the governor uses to pause/resume the deferrable background jobs under pressure. */
|
|
221
|
+
readonly pauseController: PauseController;
|
|
222
|
+
readonly sessionLiveTurnControls: SessionLiveTurnControlsHolder;
|
|
223
|
+
/** Unified live process registry (agents, WRFC chains, workflows, watchers, background processes) backing the Fleet panel; archive-aware — finished subtrees can be moved to the session archive view. */
|
|
224
|
+
readonly processRegistry: ArchivableProcessRegistry;
|
|
225
|
+
readonly modeManager: ModeManager;
|
|
226
|
+
readonly fileUndoManager: FileUndoManager;
|
|
227
|
+
readonly workspaceCheckpointManager: WorkspaceCheckpointManager;
|
|
228
|
+
/** Per-workspace trust gate — restricts write/execute/delegate tools until the workspace is trusted. */
|
|
229
|
+
readonly workspaceTrustManager: WorkspaceTrustManager;
|
|
230
|
+
readonly integrationHelpers: IntegrationHelperService;
|
|
231
|
+
/** Re-root path-bound stores (MemoryStore, ProjectIndex) to a new working directory, called by WorkspaceSwapManager after verification; stores needing a process restart just warn-log and keep serving the old path until the daemon restarts with the new --working-dir. */
|
|
232
|
+
rerootStores(newWorkingDir: string): Promise<void>;
|
|
233
|
+
/**
|
|
234
|
+
* Cancel the agent runs this graph is hosting, returning how many.
|
|
235
|
+
*
|
|
236
|
+
* Required by the SDK's RuntimePollerOwners: by dispose() time the fleet
|
|
237
|
+
* registry, orchestration engine, process registry and bus these runs report
|
|
238
|
+
* through are already down, so a run still described as "running" is orphaned
|
|
239
|
+
* rather than preserved.
|
|
240
|
+
*/
|
|
241
|
+
cancelHostedAgentRuns(): number;
|
|
242
|
+
dispose(): void; // Stop every poller this graph started; best-effort, total, idempotent. This surface owns its graph — see disposal-wiring.ts.
|
|
243
|
+
}
|
package/src/runtime/services.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
import { FocusTracker } from '../core/focus-tracker.ts';
|
|
3
|
-
import {
|
|
4
|
-
import { SecretsManager } from '../config/secrets.ts';
|
|
3
|
+
import { ServiceRegistry, SubscriptionManager, ToolLLM } from '@pellux/goodvibes-sdk/platform/config';
|
|
5
4
|
import { AutomationDeliveryManager, AutomationManager } from '@pellux/goodvibes-sdk/platform/automation';
|
|
6
|
-
import { ChannelDeliveryRouter, ChannelPolicyManager
|
|
7
|
-
import { ApprovalBroker, GatewayMethodCatalog,
|
|
8
|
-
import type { PowerManager } from '@pellux/goodvibes-sdk/platform/power';
|
|
5
|
+
import { ChannelDeliveryRouter, ChannelPolicyManager } from '@pellux/goodvibes-sdk/platform/channels';
|
|
6
|
+
import { ApprovalBroker, GatewayMethodCatalog, SharedSessionBroker } from '@pellux/goodvibes-sdk/platform/control-plane';
|
|
9
7
|
import { wireIdlePowerAndLiveTurn } from './idle-power-services.ts';
|
|
10
|
-
import { StepUpService } from '@pellux/goodvibes-sdk/daemon';
|
|
11
|
-
import { PairingTokenManager } from '@pellux/goodvibes-sdk/platform/pairing';
|
|
12
8
|
import { resolvePairingWebOrigin } from '../core/pairing-origin.ts';
|
|
13
9
|
import { attachWsOnlyGatewayVerbHandlers } from '@pellux/goodvibes-terminal-shell';
|
|
14
10
|
import { composeMailDeps } from './mail-composition.ts';
|
|
@@ -17,46 +13,35 @@ import { createDisposalScope, registerSurfaceRuntimePollers } from './disposal-w
|
|
|
17
13
|
import { WatcherRegistry } from '@pellux/goodvibes-sdk/platform/watchers';
|
|
18
14
|
import { ArtifactStore } from '@pellux/goodvibes-sdk/platform/artifacts';
|
|
19
15
|
import { createWebKnowledgeGapRepairer } from '@pellux/goodvibes-sdk/platform/knowledge';
|
|
20
|
-
import type { HomeGraphService, KnowledgeService, ProjectPlanningService } from '@pellux/goodvibes-sdk/platform/knowledge';
|
|
21
16
|
import { createKnowledgeServices } from './knowledge-services.ts';
|
|
22
17
|
import { MediaProviderRegistry, ensureBuiltinMediaProviders } from '@pellux/goodvibes-sdk/platform/media';
|
|
23
18
|
import { MultimodalService } from '@pellux/goodvibes-sdk/platform/multimodal';
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { FileStateCache, FileUndoManager, MemoryConsolidationScheduler, MemoryEmbeddingProviderRegistry, MemoryRegistry, MemoryStore, ModeManager, ProjectIndex, resolveCanonicalMemoryDbPath, type CodeIndexStore, type CodeIndexReindexScheduler } from '@pellux/goodvibes-sdk/platform/state';
|
|
27
|
-
import type { StoreSnapshotScheduler } from '@pellux/goodvibes-sdk/platform/state/store-snapshots';
|
|
28
|
-
import type { UserPermissionRuleStore } from '@pellux/goodvibes-sdk/platform/permissions';
|
|
19
|
+
import { OverflowHandler, ProcessManager, cancelAllAgentRuns, createWorkflowServices } from '@pellux/goodvibes-sdk/platform/tools';
|
|
20
|
+
import { FileStateCache, FileUndoManager, MemoryEmbeddingProviderRegistry, MemoryRegistry, MemoryStore, ModeManager, ProjectIndex, resolveCanonicalMemoryDbPath } from '@pellux/goodvibes-sdk/platform/state';
|
|
29
21
|
import { buildExecPromptAnswerHandler } from '@pellux/goodvibes-sdk/platform/runtime/permissions/exec-prompt-wiring';
|
|
30
22
|
import { buildLocalhostFetchApproval } from '@pellux/goodvibes-sdk/platform/runtime/permissions/localhost-fetch-approval';
|
|
31
|
-
import { createNotificationDispatcher, wireRuntimeNotificationBridge, wireMemoryPressureNotice
|
|
23
|
+
import { createNotificationDispatcher, wireRuntimeNotificationBridge, wireMemoryPressureNotice } from './notification-dispatch.ts';
|
|
32
24
|
import { createDurabilityServices } from './durability-services.ts';
|
|
33
25
|
import { MemorySpineClient, createLocalMemoryAccess } from '@pellux/goodvibes-sdk/platform/runtime/memory-spine';
|
|
34
|
-
import { WorkspaceCheckpointManager } from '@pellux/goodvibes-sdk/platform/workspace';
|
|
35
26
|
import { createWorkspaceCheckpointing } from './workspace-checkpointing.ts';
|
|
36
27
|
import { createSessionConversationRewindPort } from './conversation-rewind-port.ts';
|
|
37
28
|
import { createDomainDispatch } from './store/index.ts';
|
|
38
|
-
import
|
|
39
|
-
import {
|
|
40
|
-
type RuntimeEventBus, DistributedRuntimeManager, RemoteRunnerRegistry, RemoteSupervisor, IntegrationHelperService,
|
|
41
|
-
IdempotencyStore, ComponentHealthMonitor, WorktreeRegistry, SandboxSessionRegistry, createShellPathService,
|
|
42
|
-
type ShellPathService, type FeatureFlagManager, createFeatureFlagManager, PolicyRuntimeState, type SessionSurface,
|
|
43
|
-
} from '@/runtime/index.ts';
|
|
29
|
+
import { DistributedRuntimeManager, IntegrationHelperService, IdempotencyStore, ComponentHealthMonitor, WorktreeRegistry, createShellPathService, createFeatureFlagManager, PolicyRuntimeState } from '@/runtime/index.ts';
|
|
44
30
|
import { createSessionStorageServices } from './session-storage-services.ts';
|
|
45
31
|
import { VoiceProviderRegistry, VoiceService, ensureBuiltinVoiceProviders } from '@pellux/goodvibes-sdk/platform/voice';
|
|
46
|
-
import { CacheRegistry, PauseController
|
|
32
|
+
import { CacheRegistry, PauseController } from '@pellux/goodvibes-sdk/platform/runtime/memory';
|
|
47
33
|
import { wireMemoryGovernance } from './memory-governance-services.ts';
|
|
48
34
|
import { wireVoiceSetup } from './voice-setup-services.ts';
|
|
49
35
|
import { WebSearchProviderRegistry, WebSearchService } from '@pellux/goodvibes-sdk/platform/web-search';
|
|
50
36
|
import { PanelManager } from '../panels/panel-manager.ts';
|
|
51
37
|
import { HookActivityTracker } from '@pellux/goodvibes-sdk/platform/hooks';
|
|
52
|
-
import { HookDispatcher, createHookWorkbench
|
|
38
|
+
import { HookDispatcher, createHookWorkbench } from '@pellux/goodvibes-sdk/platform/hooks';
|
|
53
39
|
import { PluginManager } from '@pellux/goodvibes-sdk/platform/plugins';
|
|
54
40
|
import { BookmarkManager } from '@pellux/goodvibes-sdk/platform/bookmarks';
|
|
55
41
|
import { ProfileManager } from '@pellux/goodvibes-sdk/platform/profiles';
|
|
56
|
-
import {
|
|
42
|
+
import { CrossSessionTaskRegistry, SessionChangeTracker } from '@pellux/goodvibes-sdk/platform/sessions';
|
|
57
43
|
import { ApiTokenAuditor, UserAuthManager } from '@pellux/goodvibes-sdk/platform/security';
|
|
58
44
|
import { WebhookNotifier } from '@pellux/goodvibes-sdk/platform/integrations';
|
|
59
|
-
import { McpRegistry } from '@pellux/goodvibes-sdk/platform/mcp';
|
|
60
45
|
import { createRemoteExecutionServices } from './remote-execution-composition.ts';
|
|
61
46
|
import { createAgentGraph } from './agent-graph-composition.ts';
|
|
62
47
|
import { BenchmarkStore, CacheHitTracker, FavoritesStore, ModelLimitsService, ProviderCapabilityRegistry, ProviderOptimizer, ProviderRegistry } from '@pellux/goodvibes-sdk/platform/providers';
|
|
@@ -65,192 +50,16 @@ import { AdaptivePlanner, DeterministicReplayEngine, ExecutionPlanManager, Sessi
|
|
|
65
50
|
import { deriveFeatureStates, bindFeatureSettingsBridge } from '@pellux/goodvibes-sdk/platform/runtime/state';
|
|
66
51
|
import { createChannelComposition } from './channel-composition.ts';
|
|
67
52
|
import { applyProviderOptimizerConfigMode, bindProviderOptimizerFeatureFlag } from './provider-optimizer-wiring.ts';
|
|
68
|
-
import { type ArchivableProcessRegistry } from '@pellux/goodvibes-sdk/platform/runtime/fleet';
|
|
69
53
|
import { createFleetServices } from './fleet-services.ts';
|
|
70
|
-
import { createWorkstreamServices
|
|
54
|
+
import { createWorkstreamServices } from './workstream-services.ts';
|
|
71
55
|
import { wireFleetNeedsInputPush } from './fleet-needs-input-push.ts';
|
|
72
56
|
import { codeIndexDbPath, createCodeIndexServices, createStoreRerooter, isCodeInjectionSettingEnabled } from './code-index-services.ts';
|
|
73
|
-
import type { WorkPlanStore } from '../work-plans/work-plan-store.ts';
|
|
74
|
-
import type { DaemonHandlerSurfaces } from '../daemon/handlers/index.ts';
|
|
75
57
|
import { createDaemonHandlerComposition } from './daemon-handler-composition.ts';
|
|
76
|
-
import { createClusterServices, startClusterServices
|
|
77
|
-
import type { ClusterCoordinator } from '@pellux/goodvibes-sdk/platform/cluster';
|
|
58
|
+
import { createClusterServices, startClusterServices } from './cluster-group-composition.ts';
|
|
78
59
|
import { WorkspaceTrustManager } from './trust/workspace-trust.ts';
|
|
79
60
|
import { ensureConfiguredModelIsRoutable } from './provider-fallback.ts';
|
|
80
|
-
|
|
81
|
-
export
|
|
82
|
-
readonly runtimeBus: RuntimeEventBus;
|
|
83
|
-
readonly runtimeStore: RuntimeStore;
|
|
84
|
-
readonly configManager: ConfigManager;
|
|
85
|
-
readonly localUserAuthManager?: UserAuthManager;
|
|
86
|
-
readonly featureFlags?: FeatureFlagManager;
|
|
87
|
-
readonly getConversationTitle?: () => string | undefined;
|
|
88
|
-
readonly workingDir: string;
|
|
89
|
-
readonly homeDirectory: string;
|
|
90
|
-
/** Daemon state root (`--daemon-home`); absent ⇒ `<homeDirectory>/.goodvibes/daemon`.
|
|
91
|
-
* Threaded into SecretsManager so the override MOVES the credential store —
|
|
92
|
-
* without it an "isolated" daemon read the real home's secrets. One name for
|
|
93
|
-
* one thing; resolveGoodVibesHomeOwnership is the single reader. */
|
|
94
|
-
readonly daemonHomeDirectory?: string | undefined;
|
|
95
|
-
/** Opt-in (daemon-side only): fold host-observed external coding-agent sessions
|
|
96
|
-
* into the fleet as 'observed-external' rows. Interactive leaves it off and reads
|
|
97
|
-
* the daemon snapshot. Mirrors the SDK's own createRuntimeServices option. */
|
|
98
|
-
readonly observeExternalAgents?: boolean | undefined;
|
|
99
|
-
/** Host power seam opt-in. Fork mirrors the SDK: non-spawning unavailable-seam
|
|
100
|
-
* default (idle-power-services.ts); daemon + embedded runtime pass createHostPowerSeam(). */
|
|
101
|
-
readonly powerSeam?: Parameters<typeof wireIdlePowerAndLiveTurn>[0]['powerSeam'];
|
|
102
|
-
/** Live session id, read per crash-residue sweep so the running session is exempt — see durability-services.ts. */
|
|
103
|
-
readonly currentSessionId?: (() => string | null) | undefined;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export interface RuntimeServices {
|
|
107
|
-
readonly workingDirectory: string;
|
|
108
|
-
readonly homeDirectory: string;
|
|
109
|
-
/** The declare-once session-storage handle every session reader and writer threads through — see session-storage-services.ts. */
|
|
110
|
-
readonly surface: SessionSurface;
|
|
111
|
-
readonly shellPaths: ShellPathService;
|
|
112
|
-
readonly configManager: ConfigManager;
|
|
113
|
-
readonly featureFlags: FeatureFlagManager;
|
|
114
|
-
readonly runtimeBus: RuntimeEventBus;
|
|
115
|
-
readonly runtimeStore: RuntimeStore;
|
|
116
|
-
readonly runtimeDispatch: DomainDispatch;
|
|
117
|
-
readonly panelManager: PanelManager;
|
|
118
|
-
readonly keybindingsManager: KeybindingsManager;
|
|
119
|
-
readonly routeBindings: RouteBindingManager;
|
|
120
|
-
readonly surfaceRegistry: SurfaceRegistry;
|
|
121
|
-
readonly channelPlugins: ChannelPluginRegistry;
|
|
122
|
-
readonly channelDeliveryRouter: ChannelDeliveryRouter;
|
|
123
|
-
readonly watcherRegistry: WatcherRegistry;
|
|
124
|
-
readonly approvalBroker: ApprovalBroker;
|
|
125
|
-
/** Loopback-fetch approval that rides the approval broker; shared by the tool registry and orchestrator so every surface asks the same way. */
|
|
126
|
-
readonly localhostFetchApproval: ReturnType<typeof buildLocalhostFetchApproval>;
|
|
127
|
-
/** Terminal prompt-answer handler that rides the approval broker; shared by the tool registry and orchestrator so an interactive command's prompt gets an ask/card on every surface. */
|
|
128
|
-
readonly execPromptAnswerHandler: ReturnType<typeof buildExecPromptAnswerHandler>;
|
|
129
|
-
/** Routes curated runtime-domain events into the panel_only notification feed (the panel's live producer). */
|
|
130
|
-
readonly notificationDispatcher: NotificationDispatcher;
|
|
131
|
-
/** Durable user-origin permission rules (remembered approvals); permissions.rules.* surface. Mirrors the SDK composition. */
|
|
132
|
-
readonly userPermissionRuleStore: UserPermissionRuleStore;
|
|
133
|
-
readonly sessionBroker: SharedSessionBroker;
|
|
134
|
-
readonly deliveryManager: AutomationDeliveryManager;
|
|
135
|
-
readonly automationManager: AutomationManager;
|
|
136
|
-
readonly gatewayMethods: GatewayMethodCatalog;
|
|
137
|
-
readonly artifactStore: ArtifactStore;
|
|
138
|
-
readonly knowledgeService: KnowledgeService;
|
|
139
|
-
readonly agentKnowledgeService: KnowledgeService;
|
|
140
|
-
readonly homeGraphService: HomeGraphService;
|
|
141
|
-
readonly projectPlanningService: ProjectPlanningService;
|
|
142
|
-
readonly projectPlanningProjectId: string;
|
|
143
|
-
readonly workPlanStore: WorkPlanStore;
|
|
144
|
-
readonly memoryStore: MemoryStore;
|
|
145
|
-
readonly memoryRegistry: MemoryRegistry;
|
|
146
|
-
/** Host-vs-client memory access: local until bootstrap.ts activates it for an adopted 'external' daemon (mirrors sessionSpine). */
|
|
147
|
-
readonly memorySpine: MemorySpineClient;
|
|
148
|
-
readonly serviceRegistry: ServiceRegistry;
|
|
149
|
-
readonly secretsManager: SecretsManager;
|
|
150
|
-
readonly stepUpService: StepUpService;
|
|
151
|
-
readonly pairingTokens: PairingTokenManager; // backs pairing.tokens.* verbs + the settings device surface (mirrors the SDK composition)
|
|
152
|
-
readonly subscriptionManager: SubscriptionManager;
|
|
153
|
-
readonly localUserAuthManager: UserAuthManager;
|
|
154
|
-
readonly profileManager: ProfileManager;
|
|
155
|
-
readonly bookmarkManager: BookmarkManager;
|
|
156
|
-
readonly sessionManager: SessionManager;
|
|
157
|
-
readonly sessionOrchestration: CrossSessionTaskRegistry;
|
|
158
|
-
readonly hookDispatcher: HookDispatcher;
|
|
159
|
-
readonly hookActivityTracker: HookActivityTracker;
|
|
160
|
-
readonly hookWorkbench: HookWorkbench;
|
|
161
|
-
readonly pluginManager: PluginManager;
|
|
162
|
-
readonly workflow: WorkflowServices;
|
|
163
|
-
readonly voiceProviders: VoiceProviderRegistry;
|
|
164
|
-
readonly voiceService: VoiceService;
|
|
165
|
-
readonly webSearchProviders: WebSearchProviderRegistry;
|
|
166
|
-
readonly webSearchService: WebSearchService;
|
|
167
|
-
readonly mediaProviders: MediaProviderRegistry;
|
|
168
|
-
readonly multimodalService: MultimodalService;
|
|
169
|
-
readonly memoryEmbeddingRegistry: MemoryEmbeddingProviderRegistry;
|
|
170
|
-
readonly channelPolicy: ChannelPolicyManager;
|
|
171
|
-
readonly mcpRegistry: McpRegistry;
|
|
172
|
-
readonly tokenAuditor: ApiTokenAuditor;
|
|
173
|
-
readonly componentHealthMonitor: ComponentHealthMonitor;
|
|
174
|
-
readonly worktreeRegistry: WorktreeRegistry;
|
|
175
|
-
readonly sandboxSessionRegistry: SandboxSessionRegistry;
|
|
176
|
-
readonly webhookNotifier: WebhookNotifier;
|
|
177
|
-
/** Terminal focus tracker — fed by input/handler-feed.ts, read by the alert notifiers in core/. */
|
|
178
|
-
readonly focusTracker: FocusTracker;
|
|
179
|
-
readonly replayEngine: DeterministicReplayEngine;
|
|
180
|
-
readonly providerOptimizer: ProviderOptimizer;
|
|
181
|
-
readonly providerCapabilityRegistry: ProviderCapabilityRegistry;
|
|
182
|
-
readonly cacheHitTracker: CacheHitTracker;
|
|
183
|
-
readonly favoritesStore: FavoritesStore;
|
|
184
|
-
readonly benchmarkStore: BenchmarkStore;
|
|
185
|
-
readonly modelLimitsService: ModelLimitsService;
|
|
186
|
-
readonly providerRegistry: ProviderRegistry;
|
|
187
|
-
readonly toolLLM: ToolLLM;
|
|
188
|
-
readonly distributedRuntime: DistributedRuntimeManager;
|
|
189
|
-
readonly daemonHandlers: DaemonHandlerSurfaces;
|
|
190
|
-
/** Elects the one node on this network that consumes inbound messages; hand it to the DaemonServer so its consumers share this leadership instead of holding a second election. */
|
|
191
|
-
readonly clusterCoordinator: ClusterCoordinator;
|
|
192
|
-
/** LAN group membership: identity, keys, roster, and the `cluster` verbs. */
|
|
193
|
-
readonly clusterGroup: ClusterGroupComposition;
|
|
194
|
-
/** Start the group layer and then the election, in that order. Idempotent. */
|
|
195
|
-
readonly startCluster: () => Promise<void>;
|
|
196
|
-
readonly remoteRunnerRegistry: RemoteRunnerRegistry;
|
|
197
|
-
readonly remoteSupervisor: RemoteSupervisor;
|
|
198
|
-
readonly sessionMemoryStore: SessionMemoryStore;
|
|
199
|
-
readonly sessionLineageTracker: SessionLineageTracker;
|
|
200
|
-
readonly sessionChangeTracker: SessionChangeTracker;
|
|
201
|
-
readonly planManager: ExecutionPlanManager;
|
|
202
|
-
readonly adaptivePlanner: AdaptivePlanner;
|
|
203
|
-
readonly idempotencyStore: IdempotencyStore;
|
|
204
|
-
readonly overflowHandler: OverflowHandler;
|
|
205
|
-
readonly policyRuntimeState: PolicyRuntimeState;
|
|
206
|
-
readonly archetypeLoader: ArchetypeLoader;
|
|
207
|
-
readonly agentManager: AgentManager;
|
|
208
|
-
readonly agentMessageBus: AgentMessageBus;
|
|
209
|
-
readonly agentOrchestrator: AgentOrchestrator;
|
|
210
|
-
readonly contextAccountingHolder: ContextAccountingHolder; // bound at bootstrap.ts; see context-accounting-source.ts
|
|
211
|
-
readonly wrfcController: WrfcController;
|
|
212
|
-
readonly processManager: ProcessManager;
|
|
213
|
-
/** The phase/work-item orchestration engine — see runtime/workstream-services.ts. */
|
|
214
|
-
readonly orchestrationEngine: OrchestrationEngine;
|
|
215
|
-
readonly workstreamCommands: WorkstreamCommandService;
|
|
216
|
-
/** The repo source-tree code index — see runtime/code-index-services.ts. */
|
|
217
|
-
readonly codeIndexStore: CodeIndexStore;
|
|
218
|
-
readonly codeIndexReindexScheduler: CodeIndexReindexScheduler; // tool-site reindex
|
|
219
|
-
/** Daily snapshots of every SQLite store this runtime writes, with bounded retention; unref'd timers (mirrors the SDK composition — hosts that tear down a runtime stop() it themselves). */
|
|
220
|
-
readonly storeSnapshotScheduler: StoreSnapshotScheduler;
|
|
221
|
-
readonly appendOnlyRetentionScheduler: ReturnType<typeof createDurabilityServices>['appendOnlyRetentionScheduler']; // periodic append-only sweep; unref'd timers, stop() on teardown
|
|
222
|
-
/** Stops the recurring crash-residue sweep; idempotent, unref'd timer (hosts that tear a runtime down call it). */
|
|
223
|
-
readonly stopDurabilityHousekeeping: () => void;
|
|
224
|
-
readonly memoryConsolidationScheduler: MemoryConsolidationScheduler;
|
|
225
|
-
readonly powerManager: PowerManager;
|
|
226
|
-
/** The daemon's memory governor (default ON). Backs ops.memory.get and defends the daemon's footprint by tier. */
|
|
227
|
-
readonly memoryGovernor: MemoryGovernor;
|
|
228
|
-
/** Registry of every retained cache the governor can shrink (knowledge stores + shared session broker). */
|
|
229
|
-
readonly cacheRegistry: CacheRegistry;
|
|
230
|
-
/** Controller the governor uses to pause/resume the deferrable background jobs under pressure. */
|
|
231
|
-
readonly pauseController: PauseController;
|
|
232
|
-
readonly sessionLiveTurnControls: SessionLiveTurnControlsHolder;
|
|
233
|
-
/** Unified live process registry (agents, WRFC chains, workflows, watchers, background processes) backing the Fleet panel; archive-aware — finished subtrees can be moved to the session archive view. */
|
|
234
|
-
readonly processRegistry: ArchivableProcessRegistry;
|
|
235
|
-
readonly modeManager: ModeManager;
|
|
236
|
-
readonly fileUndoManager: FileUndoManager;
|
|
237
|
-
readonly workspaceCheckpointManager: WorkspaceCheckpointManager;
|
|
238
|
-
/** Per-workspace trust gate — restricts write/execute/delegate tools until the workspace is trusted. */
|
|
239
|
-
readonly workspaceTrustManager: WorkspaceTrustManager;
|
|
240
|
-
readonly integrationHelpers: IntegrationHelperService;
|
|
241
|
-
/** Re-root path-bound stores (MemoryStore, ProjectIndex) to a new working directory, called by WorkspaceSwapManager after verification; stores needing a process restart just warn-log and keep serving the old path until the daemon restarts with the new --working-dir. */
|
|
242
|
-
rerootStores(newWorkingDir: string): Promise<void>;
|
|
243
|
-
/**
|
|
244
|
-
* Cancel the agent runs this graph is hosting, returning how many.
|
|
245
|
-
*
|
|
246
|
-
* Required by the SDK's RuntimePollerOwners: by dispose() time the fleet
|
|
247
|
-
* registry, orchestration engine, process registry and bus these runs report
|
|
248
|
-
* through are already down, so a run still described as "running" is orphaned
|
|
249
|
-
* rather than preserved.
|
|
250
|
-
*/
|
|
251
|
-
cancelHostedAgentRuns(): number;
|
|
252
|
-
dispose(): void; // Stop every poller this graph started; best-effort, total, idempotent. This surface owns its graph — see disposal-wiring.ts.
|
|
253
|
-
}
|
|
61
|
+
import type { RuntimeServicesOptions, RuntimeServices } from './runtime-services-types.ts';
|
|
62
|
+
export type { RuntimeServicesOptions, RuntimeServices } from './runtime-services-types.ts';
|
|
254
63
|
|
|
255
64
|
export function createRuntimeServices(options: RuntimeServicesOptions): RuntimeServices {
|
|
256
65
|
const disposalScope = createDisposalScope('RuntimeServices'); const workingDirectory = options.workingDir; // disposal seam: see ./disposal-wiring.ts
|