@pellux/goodvibes-tui 1.24.2 → 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 +32 -0
- package/README.md +1 -1
- package/bin/goodvibes-daemon +24 -0
- package/docs/foundation-artifacts/operator-contract.json +18234 -12253
- 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 +149 -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 +62 -7
- package/src/daemon/handlers/credentials.ts +15 -5
- package/src/daemon/handlers/index.ts +7 -6
- 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/calendar-runtime.ts +245 -0
- package/src/input/commands/config.ts +68 -2
- package/src/input/commands/connection-status.ts +258 -0
- package/src/input/commands/local-provider-runtime.ts +9 -1
- package/src/input/commands/mail-runtime.ts +267 -0
- 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/review-runtime.ts +13 -1
- package/src/input/commands.ts +11 -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-connections.ts +102 -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 +19 -3
- package/src/input/settings-modal.ts +54 -107
- package/src/main.ts +7 -2
- package/src/panels/modals/marketplace-modal.ts +5 -0
- package/src/panels/modals/skills-modal.ts +5 -0
- package/src/renderer/settings-modal-connections.ts +63 -0
- package/src/renderer/settings-modal-helpers.ts +6 -0
- package/src/renderer/settings-modal.ts +21 -1
- package/src/runtime/bootstrap-core.ts +1 -1
- package/src/runtime/bootstrap.ts +2 -2
- package/src/runtime/context.ts +9 -0
- package/src/runtime/credential-composition.ts +54 -0
- package/src/runtime/daemon-handler-composition.ts +0 -4
- package/src/runtime/install-self-check-startup.ts +23 -0
- package/src/runtime/mail-composition.ts +65 -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 +30 -224
- package/src/shell/ui-openers.ts +7 -0
- package/src/verification/verification-ledger.ts +158 -0
- package/src/version.ts +1 -1
- package/src/daemon/handlers/calendar/caldav-client.ts +0 -662
- package/src/daemon/handlers/calendar/ics.ts +0 -556
- package/src/daemon/handlers/calendar/index.ts +0 -316
- package/src/daemon/handlers/email/config.ts +0 -164
- package/src/daemon/handlers/email/imap-connector.ts +0 -441
- package/src/daemon/handlers/email/imap-parsing.ts +0 -499
- package/src/daemon/handlers/email/index.ts +0 -43
- package/src/daemon/handlers/email/read-handlers.ts +0 -80
- package/src/daemon/handlers/email/runtime.ts +0 -140
- package/src/daemon/handlers/email/smtp-connector.ts +0 -557
- package/src/daemon/handlers/email/validation.ts +0 -147
- package/src/daemon/handlers/email/write-handlers.ts +0 -133
|
@@ -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,60 +1,47 @@
|
|
|
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';
|
|
10
|
+
import { composeMailDeps } from './mail-composition.ts';
|
|
11
|
+
import { composeCredentialServices } from './credential-composition.ts';
|
|
14
12
|
import { createDisposalScope, registerSurfaceRuntimePollers } from './disposal-wiring.ts';
|
|
15
13
|
import { WatcherRegistry } from '@pellux/goodvibes-sdk/platform/watchers';
|
|
16
14
|
import { ArtifactStore } from '@pellux/goodvibes-sdk/platform/artifacts';
|
|
17
15
|
import { createWebKnowledgeGapRepairer } from '@pellux/goodvibes-sdk/platform/knowledge';
|
|
18
|
-
import type { HomeGraphService, KnowledgeService, ProjectPlanningService } from '@pellux/goodvibes-sdk/platform/knowledge';
|
|
19
16
|
import { createKnowledgeServices } from './knowledge-services.ts';
|
|
20
17
|
import { MediaProviderRegistry, ensureBuiltinMediaProviders } from '@pellux/goodvibes-sdk/platform/media';
|
|
21
18
|
import { MultimodalService } from '@pellux/goodvibes-sdk/platform/multimodal';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { FileStateCache, FileUndoManager, MemoryConsolidationScheduler, MemoryEmbeddingProviderRegistry, MemoryRegistry, MemoryStore, ModeManager, ProjectIndex, resolveCanonicalMemoryDbPath, type CodeIndexStore, type CodeIndexReindexScheduler } from '@pellux/goodvibes-sdk/platform/state';
|
|
25
|
-
import type { StoreSnapshotScheduler } from '@pellux/goodvibes-sdk/platform/state/store-snapshots';
|
|
26
|
-
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';
|
|
27
21
|
import { buildExecPromptAnswerHandler } from '@pellux/goodvibes-sdk/platform/runtime/permissions/exec-prompt-wiring';
|
|
28
22
|
import { buildLocalhostFetchApproval } from '@pellux/goodvibes-sdk/platform/runtime/permissions/localhost-fetch-approval';
|
|
29
|
-
import { createNotificationDispatcher, wireRuntimeNotificationBridge, wireMemoryPressureNotice
|
|
23
|
+
import { createNotificationDispatcher, wireRuntimeNotificationBridge, wireMemoryPressureNotice } from './notification-dispatch.ts';
|
|
30
24
|
import { createDurabilityServices } from './durability-services.ts';
|
|
31
25
|
import { MemorySpineClient, createLocalMemoryAccess } from '@pellux/goodvibes-sdk/platform/runtime/memory-spine';
|
|
32
|
-
import { WorkspaceCheckpointManager } from '@pellux/goodvibes-sdk/platform/workspace';
|
|
33
26
|
import { createWorkspaceCheckpointing } from './workspace-checkpointing.ts';
|
|
34
27
|
import { createSessionConversationRewindPort } from './conversation-rewind-port.ts';
|
|
35
28
|
import { createDomainDispatch } from './store/index.ts';
|
|
36
|
-
import
|
|
37
|
-
import {
|
|
38
|
-
type RuntimeEventBus, DistributedRuntimeManager, RemoteRunnerRegistry, RemoteSupervisor, IntegrationHelperService,
|
|
39
|
-
IdempotencyStore, ComponentHealthMonitor, WorktreeRegistry, SandboxSessionRegistry, createShellPathService,
|
|
40
|
-
type ShellPathService, type FeatureFlagManager, createFeatureFlagManager, PolicyRuntimeState, type SessionSurface,
|
|
41
|
-
} from '@/runtime/index.ts';
|
|
29
|
+
import { DistributedRuntimeManager, IntegrationHelperService, IdempotencyStore, ComponentHealthMonitor, WorktreeRegistry, createShellPathService, createFeatureFlagManager, PolicyRuntimeState } from '@/runtime/index.ts';
|
|
42
30
|
import { createSessionStorageServices } from './session-storage-services.ts';
|
|
43
31
|
import { VoiceProviderRegistry, VoiceService, ensureBuiltinVoiceProviders } from '@pellux/goodvibes-sdk/platform/voice';
|
|
44
|
-
import { CacheRegistry, PauseController
|
|
32
|
+
import { CacheRegistry, PauseController } from '@pellux/goodvibes-sdk/platform/runtime/memory';
|
|
45
33
|
import { wireMemoryGovernance } from './memory-governance-services.ts';
|
|
46
34
|
import { wireVoiceSetup } from './voice-setup-services.ts';
|
|
47
35
|
import { WebSearchProviderRegistry, WebSearchService } from '@pellux/goodvibes-sdk/platform/web-search';
|
|
48
36
|
import { PanelManager } from '../panels/panel-manager.ts';
|
|
49
37
|
import { HookActivityTracker } from '@pellux/goodvibes-sdk/platform/hooks';
|
|
50
|
-
import { HookDispatcher, createHookWorkbench
|
|
38
|
+
import { HookDispatcher, createHookWorkbench } from '@pellux/goodvibes-sdk/platform/hooks';
|
|
51
39
|
import { PluginManager } from '@pellux/goodvibes-sdk/platform/plugins';
|
|
52
40
|
import { BookmarkManager } from '@pellux/goodvibes-sdk/platform/bookmarks';
|
|
53
41
|
import { ProfileManager } from '@pellux/goodvibes-sdk/platform/profiles';
|
|
54
|
-
import {
|
|
42
|
+
import { CrossSessionTaskRegistry, SessionChangeTracker } from '@pellux/goodvibes-sdk/platform/sessions';
|
|
55
43
|
import { ApiTokenAuditor, UserAuthManager } from '@pellux/goodvibes-sdk/platform/security';
|
|
56
44
|
import { WebhookNotifier } from '@pellux/goodvibes-sdk/platform/integrations';
|
|
57
|
-
import { McpRegistry } from '@pellux/goodvibes-sdk/platform/mcp';
|
|
58
45
|
import { createRemoteExecutionServices } from './remote-execution-composition.ts';
|
|
59
46
|
import { createAgentGraph } from './agent-graph-composition.ts';
|
|
60
47
|
import { BenchmarkStore, CacheHitTracker, FavoritesStore, ModelLimitsService, ProviderCapabilityRegistry, ProviderOptimizer, ProviderRegistry } from '@pellux/goodvibes-sdk/platform/providers';
|
|
@@ -63,187 +50,16 @@ import { AdaptivePlanner, DeterministicReplayEngine, ExecutionPlanManager, Sessi
|
|
|
63
50
|
import { deriveFeatureStates, bindFeatureSettingsBridge } from '@pellux/goodvibes-sdk/platform/runtime/state';
|
|
64
51
|
import { createChannelComposition } from './channel-composition.ts';
|
|
65
52
|
import { applyProviderOptimizerConfigMode, bindProviderOptimizerFeatureFlag } from './provider-optimizer-wiring.ts';
|
|
66
|
-
import { type ArchivableProcessRegistry } from '@pellux/goodvibes-sdk/platform/runtime/fleet';
|
|
67
53
|
import { createFleetServices } from './fleet-services.ts';
|
|
68
|
-
import { createWorkstreamServices
|
|
54
|
+
import { createWorkstreamServices } from './workstream-services.ts';
|
|
69
55
|
import { wireFleetNeedsInputPush } from './fleet-needs-input-push.ts';
|
|
70
56
|
import { codeIndexDbPath, createCodeIndexServices, createStoreRerooter, isCodeInjectionSettingEnabled } from './code-index-services.ts';
|
|
71
|
-
import type { WorkPlanStore } from '../work-plans/work-plan-store.ts';
|
|
72
|
-
import type { DaemonHandlerSurfaces } from '../daemon/handlers/index.ts';
|
|
73
57
|
import { createDaemonHandlerComposition } from './daemon-handler-composition.ts';
|
|
74
|
-
import { createClusterServices, startClusterServices
|
|
75
|
-
import type { ClusterCoordinator } from '@pellux/goodvibes-sdk/platform/cluster';
|
|
58
|
+
import { createClusterServices, startClusterServices } from './cluster-group-composition.ts';
|
|
76
59
|
import { WorkspaceTrustManager } from './trust/workspace-trust.ts';
|
|
77
60
|
import { ensureConfiguredModelIsRoutable } from './provider-fallback.ts';
|
|
78
|
-
|
|
79
|
-
export
|
|
80
|
-
readonly runtimeBus: RuntimeEventBus;
|
|
81
|
-
readonly runtimeStore: RuntimeStore;
|
|
82
|
-
readonly configManager: ConfigManager;
|
|
83
|
-
readonly localUserAuthManager?: UserAuthManager;
|
|
84
|
-
readonly featureFlags?: FeatureFlagManager;
|
|
85
|
-
readonly getConversationTitle?: () => string | undefined;
|
|
86
|
-
readonly workingDir: string;
|
|
87
|
-
readonly homeDirectory: string;
|
|
88
|
-
/** Opt-in (daemon-side only): fold host-observed external coding-agent sessions
|
|
89
|
-
* into the fleet as 'observed-external' rows. Interactive leaves it off and reads
|
|
90
|
-
* the daemon snapshot. Mirrors the SDK's own createRuntimeServices option. */
|
|
91
|
-
readonly observeExternalAgents?: boolean | undefined;
|
|
92
|
-
/** Host power seam opt-in. Fork mirrors the SDK: non-spawning unavailable-seam
|
|
93
|
-
* default (idle-power-services.ts); daemon + embedded runtime pass createHostPowerSeam(). */
|
|
94
|
-
readonly powerSeam?: Parameters<typeof wireIdlePowerAndLiveTurn>[0]['powerSeam'];
|
|
95
|
-
/** Live session id, read per crash-residue sweep so the running session is exempt — see durability-services.ts. */
|
|
96
|
-
readonly currentSessionId?: (() => string | null) | undefined;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface RuntimeServices {
|
|
100
|
-
readonly workingDirectory: string;
|
|
101
|
-
readonly homeDirectory: string;
|
|
102
|
-
/** The declare-once session-storage handle every session reader and writer threads through — see session-storage-services.ts. */
|
|
103
|
-
readonly surface: SessionSurface;
|
|
104
|
-
readonly shellPaths: ShellPathService;
|
|
105
|
-
readonly configManager: ConfigManager;
|
|
106
|
-
readonly featureFlags: FeatureFlagManager;
|
|
107
|
-
readonly runtimeBus: RuntimeEventBus;
|
|
108
|
-
readonly runtimeStore: RuntimeStore;
|
|
109
|
-
readonly runtimeDispatch: DomainDispatch;
|
|
110
|
-
readonly panelManager: PanelManager;
|
|
111
|
-
readonly keybindingsManager: KeybindingsManager;
|
|
112
|
-
readonly routeBindings: RouteBindingManager;
|
|
113
|
-
readonly surfaceRegistry: SurfaceRegistry;
|
|
114
|
-
readonly channelPlugins: ChannelPluginRegistry;
|
|
115
|
-
readonly channelDeliveryRouter: ChannelDeliveryRouter;
|
|
116
|
-
readonly watcherRegistry: WatcherRegistry;
|
|
117
|
-
readonly approvalBroker: ApprovalBroker;
|
|
118
|
-
/** Loopback-fetch approval that rides the approval broker; shared by the tool registry and orchestrator so every surface asks the same way. */
|
|
119
|
-
readonly localhostFetchApproval: ReturnType<typeof buildLocalhostFetchApproval>;
|
|
120
|
-
/** 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. */
|
|
121
|
-
readonly execPromptAnswerHandler: ReturnType<typeof buildExecPromptAnswerHandler>;
|
|
122
|
-
/** Routes curated runtime-domain events into the panel_only notification feed (the panel's live producer). */
|
|
123
|
-
readonly notificationDispatcher: NotificationDispatcher;
|
|
124
|
-
/** Durable user-origin permission rules (remembered approvals); permissions.rules.* surface. Mirrors the SDK composition. */
|
|
125
|
-
readonly userPermissionRuleStore: UserPermissionRuleStore;
|
|
126
|
-
readonly sessionBroker: SharedSessionBroker;
|
|
127
|
-
readonly deliveryManager: AutomationDeliveryManager;
|
|
128
|
-
readonly automationManager: AutomationManager;
|
|
129
|
-
readonly gatewayMethods: GatewayMethodCatalog;
|
|
130
|
-
readonly artifactStore: ArtifactStore;
|
|
131
|
-
readonly knowledgeService: KnowledgeService;
|
|
132
|
-
readonly agentKnowledgeService: KnowledgeService;
|
|
133
|
-
readonly homeGraphService: HomeGraphService;
|
|
134
|
-
readonly projectPlanningService: ProjectPlanningService;
|
|
135
|
-
readonly projectPlanningProjectId: string;
|
|
136
|
-
readonly workPlanStore: WorkPlanStore;
|
|
137
|
-
readonly memoryStore: MemoryStore;
|
|
138
|
-
readonly memoryRegistry: MemoryRegistry;
|
|
139
|
-
/** Host-vs-client memory access: local until bootstrap.ts activates it for an adopted 'external' daemon (mirrors sessionSpine). */
|
|
140
|
-
readonly memorySpine: MemorySpineClient;
|
|
141
|
-
readonly serviceRegistry: ServiceRegistry;
|
|
142
|
-
readonly secretsManager: SecretsManager;
|
|
143
|
-
readonly stepUpService: StepUpService;
|
|
144
|
-
readonly pairingTokens: PairingTokenManager; // backs pairing.tokens.* verbs + the settings device surface (mirrors the SDK composition)
|
|
145
|
-
readonly subscriptionManager: SubscriptionManager;
|
|
146
|
-
readonly localUserAuthManager: UserAuthManager;
|
|
147
|
-
readonly profileManager: ProfileManager;
|
|
148
|
-
readonly bookmarkManager: BookmarkManager;
|
|
149
|
-
readonly sessionManager: SessionManager;
|
|
150
|
-
readonly sessionOrchestration: CrossSessionTaskRegistry;
|
|
151
|
-
readonly hookDispatcher: HookDispatcher;
|
|
152
|
-
readonly hookActivityTracker: HookActivityTracker;
|
|
153
|
-
readonly hookWorkbench: HookWorkbench;
|
|
154
|
-
readonly pluginManager: PluginManager;
|
|
155
|
-
readonly workflow: WorkflowServices;
|
|
156
|
-
readonly voiceProviders: VoiceProviderRegistry;
|
|
157
|
-
readonly voiceService: VoiceService;
|
|
158
|
-
readonly webSearchProviders: WebSearchProviderRegistry;
|
|
159
|
-
readonly webSearchService: WebSearchService;
|
|
160
|
-
readonly mediaProviders: MediaProviderRegistry;
|
|
161
|
-
readonly multimodalService: MultimodalService;
|
|
162
|
-
readonly memoryEmbeddingRegistry: MemoryEmbeddingProviderRegistry;
|
|
163
|
-
readonly channelPolicy: ChannelPolicyManager;
|
|
164
|
-
readonly mcpRegistry: McpRegistry;
|
|
165
|
-
readonly tokenAuditor: ApiTokenAuditor;
|
|
166
|
-
readonly componentHealthMonitor: ComponentHealthMonitor;
|
|
167
|
-
readonly worktreeRegistry: WorktreeRegistry;
|
|
168
|
-
readonly sandboxSessionRegistry: SandboxSessionRegistry;
|
|
169
|
-
readonly webhookNotifier: WebhookNotifier;
|
|
170
|
-
/** Terminal focus tracker — fed by input/handler-feed.ts, read by the alert notifiers in core/. */
|
|
171
|
-
readonly focusTracker: FocusTracker;
|
|
172
|
-
readonly replayEngine: DeterministicReplayEngine;
|
|
173
|
-
readonly providerOptimizer: ProviderOptimizer;
|
|
174
|
-
readonly providerCapabilityRegistry: ProviderCapabilityRegistry;
|
|
175
|
-
readonly cacheHitTracker: CacheHitTracker;
|
|
176
|
-
readonly favoritesStore: FavoritesStore;
|
|
177
|
-
readonly benchmarkStore: BenchmarkStore;
|
|
178
|
-
readonly modelLimitsService: ModelLimitsService;
|
|
179
|
-
readonly providerRegistry: ProviderRegistry;
|
|
180
|
-
readonly toolLLM: ToolLLM;
|
|
181
|
-
readonly distributedRuntime: DistributedRuntimeManager;
|
|
182
|
-
readonly daemonHandlers: DaemonHandlerSurfaces;
|
|
183
|
-
/** 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. */
|
|
184
|
-
readonly clusterCoordinator: ClusterCoordinator;
|
|
185
|
-
/** LAN group membership: identity, keys, roster, and the `cluster` verbs. */
|
|
186
|
-
readonly clusterGroup: ClusterGroupComposition;
|
|
187
|
-
/** Start the group layer and then the election, in that order. Idempotent. */
|
|
188
|
-
readonly startCluster: () => Promise<void>;
|
|
189
|
-
readonly remoteRunnerRegistry: RemoteRunnerRegistry;
|
|
190
|
-
readonly remoteSupervisor: RemoteSupervisor;
|
|
191
|
-
readonly sessionMemoryStore: SessionMemoryStore;
|
|
192
|
-
readonly sessionLineageTracker: SessionLineageTracker;
|
|
193
|
-
readonly sessionChangeTracker: SessionChangeTracker;
|
|
194
|
-
readonly planManager: ExecutionPlanManager;
|
|
195
|
-
readonly adaptivePlanner: AdaptivePlanner;
|
|
196
|
-
readonly idempotencyStore: IdempotencyStore;
|
|
197
|
-
readonly overflowHandler: OverflowHandler;
|
|
198
|
-
readonly policyRuntimeState: PolicyRuntimeState;
|
|
199
|
-
readonly archetypeLoader: ArchetypeLoader;
|
|
200
|
-
readonly agentManager: AgentManager;
|
|
201
|
-
readonly agentMessageBus: AgentMessageBus;
|
|
202
|
-
readonly agentOrchestrator: AgentOrchestrator;
|
|
203
|
-
readonly contextAccountingHolder: ContextAccountingHolder; // bound at bootstrap.ts; see context-accounting-source.ts
|
|
204
|
-
readonly wrfcController: WrfcController;
|
|
205
|
-
readonly processManager: ProcessManager;
|
|
206
|
-
/** The phase/work-item orchestration engine — see runtime/workstream-services.ts. */
|
|
207
|
-
readonly orchestrationEngine: OrchestrationEngine;
|
|
208
|
-
readonly workstreamCommands: WorkstreamCommandService;
|
|
209
|
-
/** The repo source-tree code index — see runtime/code-index-services.ts. */
|
|
210
|
-
readonly codeIndexStore: CodeIndexStore;
|
|
211
|
-
readonly codeIndexReindexScheduler: CodeIndexReindexScheduler; // tool-site reindex
|
|
212
|
-
/** 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). */
|
|
213
|
-
readonly storeSnapshotScheduler: StoreSnapshotScheduler;
|
|
214
|
-
readonly appendOnlyRetentionScheduler: ReturnType<typeof createDurabilityServices>['appendOnlyRetentionScheduler']; // periodic append-only sweep; unref'd timers, stop() on teardown
|
|
215
|
-
/** Stops the recurring crash-residue sweep; idempotent, unref'd timer (hosts that tear a runtime down call it). */
|
|
216
|
-
readonly stopDurabilityHousekeeping: () => void;
|
|
217
|
-
readonly memoryConsolidationScheduler: MemoryConsolidationScheduler;
|
|
218
|
-
readonly powerManager: PowerManager;
|
|
219
|
-
/** The daemon's memory governor (default ON). Backs ops.memory.get and defends the daemon's footprint by tier. */
|
|
220
|
-
readonly memoryGovernor: MemoryGovernor;
|
|
221
|
-
/** Registry of every retained cache the governor can shrink (knowledge stores + shared session broker). */
|
|
222
|
-
readonly cacheRegistry: CacheRegistry;
|
|
223
|
-
/** Controller the governor uses to pause/resume the deferrable background jobs under pressure. */
|
|
224
|
-
readonly pauseController: PauseController;
|
|
225
|
-
readonly sessionLiveTurnControls: SessionLiveTurnControlsHolder;
|
|
226
|
-
/** 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. */
|
|
227
|
-
readonly processRegistry: ArchivableProcessRegistry;
|
|
228
|
-
readonly modeManager: ModeManager;
|
|
229
|
-
readonly fileUndoManager: FileUndoManager;
|
|
230
|
-
readonly workspaceCheckpointManager: WorkspaceCheckpointManager;
|
|
231
|
-
/** Per-workspace trust gate — restricts write/execute/delegate tools until the workspace is trusted. */
|
|
232
|
-
readonly workspaceTrustManager: WorkspaceTrustManager;
|
|
233
|
-
readonly integrationHelpers: IntegrationHelperService;
|
|
234
|
-
/** 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. */
|
|
235
|
-
rerootStores(newWorkingDir: string): Promise<void>;
|
|
236
|
-
/**
|
|
237
|
-
* Cancel the agent runs this graph is hosting, returning how many.
|
|
238
|
-
*
|
|
239
|
-
* Required by the SDK's RuntimePollerOwners: by dispose() time the fleet
|
|
240
|
-
* registry, orchestration engine, process registry and bus these runs report
|
|
241
|
-
* through are already down, so a run still described as "running" is orphaned
|
|
242
|
-
* rather than preserved.
|
|
243
|
-
*/
|
|
244
|
-
cancelHostedAgentRuns(): number;
|
|
245
|
-
dispose(): void; // Stop every poller this graph started; best-effort, total, idempotent. This surface owns its graph — see disposal-wiring.ts.
|
|
246
|
-
}
|
|
61
|
+
import type { RuntimeServicesOptions, RuntimeServices } from './runtime-services-types.ts';
|
|
62
|
+
export type { RuntimeServicesOptions, RuntimeServices } from './runtime-services-types.ts';
|
|
247
63
|
|
|
248
64
|
export function createRuntimeServices(options: RuntimeServicesOptions): RuntimeServices {
|
|
249
65
|
const disposalScope = createDisposalScope('RuntimeServices'); const workingDirectory = options.workingDir; // disposal seam: see ./disposal-wiring.ts
|
|
@@ -292,14 +108,12 @@ export function createRuntimeServices(options: RuntimeServicesOptions): RuntimeS
|
|
|
292
108
|
runtimeBus: options.runtimeBus,
|
|
293
109
|
featureFlags,
|
|
294
110
|
});
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
111
|
+
// The credential/identity seam (credential-composition.ts).
|
|
112
|
+
const { secretsManager, stepUpService, pairingTokens } = composeCredentialServices({
|
|
113
|
+
workingDirectory, homeDirectory, configManager,
|
|
114
|
+
daemonHomeDirectory: options.daemonHomeDirectory,
|
|
115
|
+
pairingTokenPath: shellPaths.resolveUserPath('control-plane', 'pairing-tokens.json'),
|
|
299
116
|
});
|
|
300
|
-
// Step-up (WebAuthn) ceremony service, shared between the ceremony gateway verbs and the relay gate's verifier.
|
|
301
|
-
const stepUpService = new StepUpService({ secrets: secretsManager });
|
|
302
|
-
const pairingTokens = new PairingTokenManager(shellPaths.resolveUserPath('control-plane', 'pairing-tokens.json'));
|
|
303
117
|
const subscriptionManager = new SubscriptionManager(shellPaths.resolveUserPath('tui', 'subscriptions.json'));
|
|
304
118
|
const serviceRegistry = new ServiceRegistry(shellPaths.resolveProjectPath('tui', 'services.json'), {
|
|
305
119
|
secretsManager,
|
|
@@ -603,25 +417,17 @@ export function createRuntimeServices(options: RuntimeServicesOptions): RuntimeS
|
|
|
603
417
|
const { voiceSetup } = wireVoiceSetup({ configManager, shellPaths, voiceProviders, admitExpensiveWork });
|
|
604
418
|
|
|
605
419
|
// Terminal-shell wrapper over the SDK registerGatewayVerbGroups (gateway-verbs.ts); checkin.*/fleet-needs-input/pairing.* register only when their deps are present. memoryGovernor lights up ops.memory.get; voiceSetup lights up voice.local.status/install.
|
|
606
|
-
|
|
420
|
+
// calendar.*/email.* are platform-served; these two let it register (mail-composition.ts).
|
|
421
|
+
const { emailServiceDeps, describeEmailConfigProblem } = composeMailDeps({ configManager, secretsManager });
|
|
422
|
+
attachWsOnlyGatewayVerbHandlers(gatewayMethods, { homeDirectory, emailServiceDeps, describeEmailConfigProblem, processRegistry, workspaceCheckpointManager, conversationRewindPort: createSessionConversationRewindPort(), sessionBroker, secretsManager, stepUpService, approvalBroker, requestApproval: (input) => approvalBroker.requestApproval(input), watcherRegistry, userPermissionRuleStore, shellPaths, configManager, runtimeStore: options.runtimeStore, channelDeliveryRouter, providerRegistry, automationManager, sessionLister: sessionBroker, sessionIntake: sessionBroker, workingDirectory, memoryRegistry, pairingTokens, sessionLiveTurnControls, powerManager, memoryGovernor, voiceSetup, relayAvailable: () => configManager.get('relay.enabled') === true, pairingWebOrigin: () => resolvePairingWebOrigin(configManager).origin, disposal: disposalScope.registry, ...wireFleetNeedsInputPush({ registry: processRegistry, runtimeBus: options.runtimeBus, sessionBroker }) });
|
|
423
|
+
// surface-scoped: continuity's recovery-file check must read the SAME paths
|
|
424
|
+
// the app writes with, not the unscoped legacy pair.
|
|
607
425
|
const integrationHelpers = new IntegrationHelperService({
|
|
608
|
-
surface,
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
426
|
+
surface, configManager, automationManager, approvalBroker, sessionBroker, distributedRuntime,
|
|
427
|
+
remoteRunnerRegistry, remoteSupervisor, panelManager, localUserAuthManager, providerRegistry,
|
|
428
|
+
serviceRegistry, subscriptionManager, secretsManager,
|
|
429
|
+
runtimeStore: options.runtimeStore, runtimeBus: options.runtimeBus,
|
|
612
430
|
getConversationTitle: options.getConversationTitle,
|
|
613
|
-
automationManager,
|
|
614
|
-
approvalBroker,
|
|
615
|
-
sessionBroker,
|
|
616
|
-
distributedRuntime,
|
|
617
|
-
remoteRunnerRegistry,
|
|
618
|
-
remoteSupervisor,
|
|
619
|
-
panelManager,
|
|
620
|
-
localUserAuthManager,
|
|
621
|
-
providerRegistry,
|
|
622
|
-
serviceRegistry,
|
|
623
|
-
subscriptionManager,
|
|
624
|
-
secretsManager,
|
|
625
431
|
});
|
|
626
432
|
// A loopback fetch that isn't allow-listed asks once through the approval
|
|
627
433
|
// broker; "allow for this project" persists and later fetches never ask. Built
|
package/src/shell/ui-openers.ts
CHANGED
|
@@ -394,6 +394,13 @@ export function wireShellUiOpeners(options: WireShellUiOpenersOptions): void {
|
|
|
394
394
|
commandContext.openSettingsModal = (target?: string) => {
|
|
395
395
|
input.modalOpened('settings');
|
|
396
396
|
input.settingsModal.open(configManager, featureFlags, subscriptionManager, serviceRegistry, mcpRegistry, secretsManager, {
|
|
397
|
+
// The Connections category asks the daemon handlers directly, through the
|
|
398
|
+
// same in-process catalog `/mail` and `/calendar` use, so the workspace
|
|
399
|
+
// reports the daemon's state rather than a local guess about it.
|
|
400
|
+
...(commandContext.workspace?.gatewayMethods
|
|
401
|
+
? { gatewayMethods: commandContext.workspace.gatewayMethods }
|
|
402
|
+
: {}),
|
|
403
|
+
requestRender: render,
|
|
397
404
|
onSettingApplied: (change) => {
|
|
398
405
|
// forced dark/light applies immediately (rebuild palettes + full
|
|
399
406
|
// repaint); auto only re-probes at startup, so it takes effect next launch.
|