@pellux/goodvibes-daemon 1.28.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 +383 -0
- package/LICENSE +21 -0
- package/README.md +125 -0
- package/bin/goodvibes-daemon +100 -0
- package/bin/launcher-support.js +226 -0
- package/package.json +96 -0
- package/scripts/check-bun.sh +20 -0
- package/scripts/postinstall.js +244 -0
- package/src/cli/command-catalog.ts +828 -0
- package/src/cli/completion.ts +299 -0
- package/src/cli/help.ts +167 -0
- package/src/cli/index.ts +21 -0
- package/src/cli/parser.ts +55 -0
- package/src/cli/surface-catalog.ts +26 -0
- package/src/cli/types.ts +63 -0
- package/src/cluster/daemon-ws-call.ts +235 -0
- package/src/cluster/raw-reply-route.ts +111 -0
- package/src/config/checkpoint-settings.ts +113 -0
- package/src/config/run-daemon-config-migration.ts +47 -0
- package/src/config/secret-config.ts +175 -0
- package/src/config/secrets.ts +71 -0
- package/src/config/surface.ts +24 -0
- package/src/core/pairing-banner.ts +82 -0
- package/src/daemon/cli.ts +878 -0
- package/src/daemon/config-command.ts +281 -0
- package/src/daemon/handlers/context.ts +29 -0
- package/src/daemon/handlers/contracts.ts +43 -0
- package/src/daemon/handlers/credentials.ts +139 -0
- package/src/daemon/handlers/drafts/draft-store.ts +427 -0
- package/src/daemon/handlers/drafts/index.ts +17 -0
- package/src/daemon/handlers/drafts/register.ts +331 -0
- package/src/daemon/handlers/errors.ts +18 -0
- package/src/daemon/handlers/inbox/aggregator.ts +375 -0
- package/src/daemon/handlers/inbox/cursor-store.ts +512 -0
- package/src/daemon/handlers/inbox/index.ts +221 -0
- package/src/daemon/handlers/inbox/mapping.ts +192 -0
- package/src/daemon/handlers/inbox/poller.ts +239 -0
- package/src/daemon/handlers/inbox/provider-adapter.ts +171 -0
- package/src/daemon/handlers/inbox/providers/discord.ts +276 -0
- package/src/daemon/handlers/inbox/providers/email.ts +176 -0
- package/src/daemon/handlers/inbox/providers/imap-client.ts +300 -0
- package/src/daemon/handlers/inbox/providers/route-util.ts +24 -0
- package/src/daemon/handlers/inbox/providers/slack.ts +287 -0
- package/src/daemon/handlers/index.ts +117 -0
- package/src/daemon/handlers/register.ts +180 -0
- package/src/daemon/handlers/remote/backends/cloud-terminal.ts +143 -0
- package/src/daemon/handlers/remote/backends/docker.ts +79 -0
- package/src/daemon/handlers/remote/backends/index.ts +40 -0
- package/src/daemon/handlers/remote/backends/local-process.ts +113 -0
- package/src/daemon/handlers/remote/backends/process-runner.ts +127 -0
- package/src/daemon/handlers/remote/backends/ssh.ts +126 -0
- package/src/daemon/handlers/remote/backends/types.ts +97 -0
- package/src/daemon/handlers/remote/dispatcher.ts +181 -0
- package/src/daemon/handlers/remote/index.ts +120 -0
- package/src/daemon/handlers/remote/peer-registry.ts +357 -0
- package/src/daemon/handlers/remote/service.ts +191 -0
- package/src/daemon/handlers/routing/inbox-bridge.ts +71 -0
- package/src/daemon/handlers/routing/index.ts +261 -0
- package/src/daemon/handlers/routing/route-store.ts +319 -0
- package/src/daemon/handlers/routing/routing-resolver.ts +75 -0
- package/src/daemon/handlers/sqlite-store.ts +303 -0
- package/src/daemon/handlers/triage/index.ts +57 -0
- package/src/daemon/handlers/triage/integration.ts +213 -0
- package/src/daemon/handlers/triage/pipeline.ts +274 -0
- package/src/daemon/handlers/triage/scorer.ts +287 -0
- package/src/daemon/handlers/triage/tagger/discord.ts +187 -0
- package/src/daemon/handlers/triage/tagger/imap.ts +384 -0
- package/src/daemon/handlers/triage/tagger/index.ts +184 -0
- package/src/daemon/handlers/triage/tagger/shared.ts +70 -0
- package/src/daemon/handlers/triage/tagger/slack.ts +69 -0
- package/src/daemon/handlers/triage/types.ts +50 -0
- package/src/daemon/lifecycle.ts +41 -0
- package/src/daemon/local-daemon-state.ts +233 -0
- package/src/daemon/pair-command.ts +301 -0
- package/src/daemon/provision-wake-model.ts +81 -0
- package/src/daemon/send/channels.ts +200 -0
- package/src/daemon/send/command.ts +333 -0
- package/src/daemon/send/composition.ts +100 -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/daemon/service-commands.ts +530 -0
- package/src/daemon/sessions-command.ts +209 -0
- package/src/daemon/status-command.ts +481 -0
- package/src/daemon/webui-command.ts +339 -0
- package/src/runtime/boot-tasks.ts +110 -0
- package/src/runtime/cluster-composition.ts +124 -0
- package/src/runtime/cluster-group-composition.ts +284 -0
- package/src/runtime/conversation-rewind-port.ts +171 -0
- package/src/runtime/credential-composition.ts +54 -0
- package/src/runtime/daemon-handler-composition.ts +76 -0
- package/src/runtime/device-posture-composition.ts +115 -0
- package/src/runtime/disposal-wiring.ts +101 -0
- package/src/runtime/fleet-needs-input-push.ts +61 -0
- package/src/runtime/fleet-services.ts +41 -0
- package/src/runtime/hosted-session-composition.ts +128 -0
- package/src/runtime/index.ts +100 -0
- package/src/runtime/knowledge-services.ts +101 -0
- package/src/runtime/legacy-daemon-migration.ts +605 -0
- package/src/runtime/legacy-daemon-reconcile.ts +448 -0
- package/src/runtime/mail-composition.ts +65 -0
- package/src/runtime/notification-dispatch.ts +86 -0
- package/src/runtime/plugin-composition.ts +111 -0
- package/src/runtime/runtime-services-types.ts +268 -0
- package/src/runtime/services.ts +756 -0
- package/src/runtime/trigger-services.ts +62 -0
- package/src/runtime/trust/checkpoint-eligibility.ts +138 -0
- package/src/runtime/trust/trust-gated-approvals.ts +169 -0
- package/src/runtime/update-check.ts +61 -0
- package/src/runtime/workspace-checkpointing.ts +116 -0
- package/src/testing/daemon-fixture.ts +276 -0
- package/src/testing/hosted-session-failures.ts +92 -0
- package/src/version.ts +26 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* plugin-composition.ts — what a plugin dropped into the plugin directory gets
|
|
3
|
+
* to register when the host loading it is the daemon.
|
|
4
|
+
*
|
|
5
|
+
* A plugin registers into whatever registries the host hands its loader. Two
|
|
6
|
+
* hosts load a plugin today — the terminal app and this daemon — and neither
|
|
7
|
+
* holds every registry a plugin might want. The design (see
|
|
8
|
+
* goodvibes-tui/docs/decisions/2026-07-30-plugin-registrations-split-verb-side-and-surface-side.md)
|
|
9
|
+
* is: one plugin package, loaded by both hosts, each loading the registrations
|
|
10
|
+
* it can serve and ignoring the rest.
|
|
11
|
+
*
|
|
12
|
+
* This is the daemon's half of that. It serves the three verb-side kinds:
|
|
13
|
+
*
|
|
14
|
+
* - `registerGatewayMethod` → the catalog this process actually answers from,
|
|
15
|
+
* because unlike a pure client it runs a DaemonServer.
|
|
16
|
+
* - `registerChannelPlugin` → the registry that receives inbound channel
|
|
17
|
+
* traffic and elects a single reader across the cluster.
|
|
18
|
+
* - `registerDeliveryStrategy` → the router replies leave through.
|
|
19
|
+
*
|
|
20
|
+
* plus the provider-shaped registries the daemon really has (providers, memory
|
|
21
|
+
* embeddings, voice, media, web search), which are neither host's exclusively.
|
|
22
|
+
*
|
|
23
|
+
* The two surface-side kinds are the ones this host cannot serve. The SDK's
|
|
24
|
+
* PluginLoaderDeps has no optional members and its API guards nothing, so a
|
|
25
|
+
* host that passes nothing for a registry does not decline that kind — it
|
|
26
|
+
* throws a TypeError inside the plugin's own init, which the loader catches by
|
|
27
|
+
* dropping THE WHOLE PLUGIN, including the halves this host could have run.
|
|
28
|
+
* "Ignores the rest" therefore has to be a real registry that accepts the
|
|
29
|
+
* registration and goes nowhere.
|
|
30
|
+
*
|
|
31
|
+
* What it must not be is silent. Accepting a registration that reaches nothing,
|
|
32
|
+
* with a cheerful success line, is exactly the failure this module exists to
|
|
33
|
+
* prevent. Both stand-ins below say what they took and that nothing here will
|
|
34
|
+
* run it, naming the plugin, so the same plugin loaded by a surface is visibly
|
|
35
|
+
* where that half happens.
|
|
36
|
+
*/
|
|
37
|
+
import { logger } from '@pellux/goodvibes-sdk/platform/utils';
|
|
38
|
+
import { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
|
|
39
|
+
import type { Tool } from '@pellux/goodvibes-sdk/platform/types';
|
|
40
|
+
import type { CommandRegistryLike, HostSlashCommand } from '@pellux/goodvibes-sdk/platform/runtime/ui';
|
|
41
|
+
import type { PluginLoaderDeps } from '@pellux/goodvibes-sdk/platform/plugins';
|
|
42
|
+
import type { RuntimeServices } from './runtime-services-types.ts';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* A slash-command registry for a process with no prompt to type into.
|
|
46
|
+
*
|
|
47
|
+
* Slash commands are read from a composer and rendered on a screen. The daemon
|
|
48
|
+
* has neither, and the decision doc classifies them surface-side, so this
|
|
49
|
+
* accepts them and says so rather than crashing the load of a plugin whose
|
|
50
|
+
* other half this host does run.
|
|
51
|
+
*/
|
|
52
|
+
export function createUnservedCommandRegistry(): CommandRegistryLike {
|
|
53
|
+
return {
|
|
54
|
+
register(command: HostSlashCommand): void {
|
|
55
|
+
logger.info('[plugins] slash command registered against the daemon; it runs where there is a prompt to type it into', {
|
|
56
|
+
command: command.name,
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
unregister(): void {
|
|
60
|
+
// Nothing was ever held, so nothing is released.
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* A tool registry the daemon holds but does not execute from.
|
|
67
|
+
*
|
|
68
|
+
* The runs this daemon hosts build their tools through the agent orchestrator's
|
|
69
|
+
* own registry, not this one, so a plugin tool registered here is cataloged and
|
|
70
|
+
* unhandled. That is the recorded classification — `registerTool` is on the
|
|
71
|
+
* surface-side list — and it was written when the daemon hosted no runs of its
|
|
72
|
+
* own; the round that moves session hosting daemon-side is the one that
|
|
73
|
+
* re-examines it. Until then, a registration here is honest rather than quiet.
|
|
74
|
+
*/
|
|
75
|
+
export class UnservedToolRegistry extends ToolRegistry {
|
|
76
|
+
override register(tool: Tool): void {
|
|
77
|
+
logger.info('[plugins] tool registered against the daemon; the runs here build their tools elsewhere', {
|
|
78
|
+
tool: tool.definition.name,
|
|
79
|
+
});
|
|
80
|
+
super.register(tool);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Build the loader dependencies for this host.
|
|
86
|
+
*
|
|
87
|
+
* The delivery router is deliberately the manager's own — the one replies leave
|
|
88
|
+
* through — so a registered strategy is a strategy that sends. Handing over a
|
|
89
|
+
* second router built from the same arguments is how a registration succeeds
|
|
90
|
+
* and reaches nothing, which is the shape this whole seam is about.
|
|
91
|
+
*/
|
|
92
|
+
export function createDaemonPluginLoaderDeps(services: RuntimeServices): PluginLoaderDeps {
|
|
93
|
+
return {
|
|
94
|
+
runtimeBus: services.runtimeBus,
|
|
95
|
+
// Verb-side: served here.
|
|
96
|
+
gatewayMethods: services.gatewayMethods,
|
|
97
|
+
channelRegistry: services.channelPlugins,
|
|
98
|
+
channelDeliveryRouter: services.deliveryManager.getDeliveryRouter(),
|
|
99
|
+
// Provider-shaped: real registries, neither host's exclusively.
|
|
100
|
+
providerRegistry: services.providerRegistry,
|
|
101
|
+
memoryEmbeddingRegistry: services.memoryEmbeddingRegistry,
|
|
102
|
+
voiceProviderRegistry: services.voiceProviders,
|
|
103
|
+
mediaProviderRegistry: services.mediaProviders,
|
|
104
|
+
webSearchProviderRegistry: services.webSearchProviders,
|
|
105
|
+
// Surface-side: accepted and named, never silently swallowed.
|
|
106
|
+
commandRegistry: createUnservedCommandRegistry(),
|
|
107
|
+
toolRegistry: new UnservedToolRegistry(),
|
|
108
|
+
getPluginConfig: (name: string) => services.pluginManager.getPluginConfig(name),
|
|
109
|
+
isEnabled: (name: string) => services.pluginManager.isEnabled(name),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -0,0 +1,268 @@
|
|
|
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 { ConfigManager, ServiceRegistry, SubscriptionManager, ToolLLM } from '@pellux/goodvibes-sdk/platform/config';
|
|
15
|
+
import type { SecretsManager } from '../config/secrets.ts';
|
|
16
|
+
import type { AutomationDeliveryManager, AutomationManager } from '@pellux/goodvibes-sdk/platform/automation';
|
|
17
|
+
import type { ChannelDeliveryRouter, ChannelPolicyManager, ChannelPluginRegistry, RouteBindingManager, SurfaceRegistry } from '@pellux/goodvibes-sdk/platform/channels';
|
|
18
|
+
import type { ApprovalBroker, GatewayMethodCatalog, SessionLiveTurnControlsHolder, SharedSessionBroker } from '@pellux/goodvibes-sdk/platform/control-plane';
|
|
19
|
+
import type { PowerManager } from '@pellux/goodvibes-sdk/platform/power';
|
|
20
|
+
|
|
21
|
+
import type { StepUpService } from '@pellux/goodvibes-sdk/daemon';
|
|
22
|
+
import type { PairingTokenManager } from '@pellux/goodvibes-sdk/platform/pairing';
|
|
23
|
+
import type { WatcherRegistry } from '@pellux/goodvibes-sdk/platform/watchers';
|
|
24
|
+
import type { ArtifactStore } from '@pellux/goodvibes-sdk/platform/artifacts';
|
|
25
|
+
import type { HomeGraphService, KnowledgeService, ProjectPlanningService } from '@pellux/goodvibes-sdk/platform/knowledge';
|
|
26
|
+
import type { MediaProviderRegistry } from '@pellux/goodvibes-sdk/platform/media';
|
|
27
|
+
import type { MultimodalService } from '@pellux/goodvibes-sdk/platform/multimodal';
|
|
28
|
+
import type { AgentMessageBus, AgentOrchestrator, ArchetypeLoader, WrfcController } from '@pellux/goodvibes-sdk/platform/agents';
|
|
29
|
+
import type { AgentManager, ContextAccountingHolder, OverflowHandler, ProcessManager, WorkflowServices } from '@pellux/goodvibes-sdk/platform/tools';
|
|
30
|
+
import type { FileUndoManager, MemoryConsolidationScheduler, MemoryEmbeddingProviderRegistry, MemoryRegistry, MemoryStore, ModeManager, ProjectIndex, CodeIndexStore, CodeIndexReindexScheduler } from '@pellux/goodvibes-sdk/platform/state';
|
|
31
|
+
import type { StoreSnapshotScheduler } from '@pellux/goodvibes-sdk/platform/state/store-snapshots';
|
|
32
|
+
import type { PermissionManager, UserPermissionRuleStore } from '@pellux/goodvibes-sdk/platform/permissions';
|
|
33
|
+
import type { buildExecPromptAnswerHandler } from '@pellux/goodvibes-sdk/platform/runtime/permissions/exec-prompt-wiring';
|
|
34
|
+
import type { buildLocalhostFetchApproval } from '@pellux/goodvibes-sdk/platform/runtime/permissions/localhost-fetch-approval';
|
|
35
|
+
import type { operations } from '@pellux/goodvibes-sdk/platform/runtime';
|
|
36
|
+
import type { MemorySpineClient } from '@pellux/goodvibes-sdk/platform/runtime/memory-spine';
|
|
37
|
+
import type { WorkspaceCheckpointManager } from '@pellux/goodvibes-sdk/platform/workspace';
|
|
38
|
+
import type { DomainDispatch, RuntimeStore } from '@pellux/goodvibes-sdk/platform/runtime/store';
|
|
39
|
+
import type { DevicePostureRuntime } from '@pellux/goodvibes-sdk/platform/devices';
|
|
40
|
+
import type { RuntimeEventBus, DistributedRuntimeManager, RemoteRunnerRegistry, RemoteSupervisor, IntegrationHelperService, PanelManagerLike, KeybindingsManagerLike, IdempotencyStore, ComponentHealthMonitor, WorktreeRegistry, SandboxSessionRegistry, ShellPathService, FeatureFlagManager, PolicyRuntimeState, SessionSurface } from '@/runtime/index.ts';
|
|
41
|
+
import type { VoiceProviderRegistry, VoiceService } from '@pellux/goodvibes-sdk/platform/voice';
|
|
42
|
+
import type { CacheRegistry, PauseController, MemoryGovernor } from '@pellux/goodvibes-sdk/platform/runtime/memory';
|
|
43
|
+
import type { WebSearchProviderRegistry, WebSearchService } from '@pellux/goodvibes-sdk/platform/web-search';
|
|
44
|
+
import type { HookActivityTracker } from '@pellux/goodvibes-sdk/platform/hooks';
|
|
45
|
+
import type { HookDispatcher, HookWorkbench } from '@pellux/goodvibes-sdk/platform/hooks';
|
|
46
|
+
import type { PluginManager } from '@pellux/goodvibes-sdk/platform/plugins';
|
|
47
|
+
import type { BookmarkManager } from '@pellux/goodvibes-sdk/platform/bookmarks';
|
|
48
|
+
import type { ProfileManager } from '@pellux/goodvibes-sdk/platform/profiles';
|
|
49
|
+
import type { SessionManager, CrossSessionTaskRegistry, SessionChangeTracker } from '@pellux/goodvibes-sdk/platform/sessions';
|
|
50
|
+
import type { ApiTokenAuditor, UserAuthManager } from '@pellux/goodvibes-sdk/platform/security';
|
|
51
|
+
import type { WebhookNotifier } from '@pellux/goodvibes-sdk/platform/integrations';
|
|
52
|
+
import type { McpRegistry } from '@pellux/goodvibes-sdk/platform/mcp';
|
|
53
|
+
import type { BenchmarkStore, CacheHitTracker, FavoritesStore, ModelLimitsService, ProviderCapabilityRegistry, ProviderOptimizer, ProviderRegistry } from '@pellux/goodvibes-sdk/platform/providers';
|
|
54
|
+
import type { AdaptivePlanner, DeterministicReplayEngine, ExecutionPlanManager, SessionLineageTracker, SessionMemoryStore } from '@pellux/goodvibes-sdk/platform/core';
|
|
55
|
+
import type { ArchivableProcessRegistry } from '@pellux/goodvibes-sdk/platform/runtime/fleet';
|
|
56
|
+
import type { OrchestrationEngine, WorkstreamCommandService } from '@pellux/goodvibes-sdk/platform/orchestration';
|
|
57
|
+
import type { WorkPlanStore } from '@pellux/goodvibes-sdk/platform/workflow';
|
|
58
|
+
import type { DaemonHandlerSurfaces } from '../daemon/handlers/index.ts';
|
|
59
|
+
import type { ClusterGroupComposition } from './cluster-group-composition.ts';
|
|
60
|
+
import type { ClusterCoordinator } from '@pellux/goodvibes-sdk/platform/cluster';
|
|
61
|
+
|
|
62
|
+
import type { TriggerManager } from '@pellux/goodvibes-sdk/platform/triggers';
|
|
63
|
+
|
|
64
|
+
export interface RuntimeServicesOptions {
|
|
65
|
+
readonly runtimeBus: RuntimeEventBus;
|
|
66
|
+
readonly runtimeStore: RuntimeStore;
|
|
67
|
+
readonly configManager: ConfigManager;
|
|
68
|
+
readonly localUserAuthManager?: UserAuthManager;
|
|
69
|
+
readonly featureFlags?: FeatureFlagManager;
|
|
70
|
+
readonly getConversationTitle?: () => string | undefined;
|
|
71
|
+
readonly workingDir: string;
|
|
72
|
+
readonly homeDirectory: string;
|
|
73
|
+
/**
|
|
74
|
+
* The daemon's state root when the host was told one (`--daemon-home`,
|
|
75
|
+
* `GOODVIBES_DAEMON_HOME`); absent ⇒ `<homeDirectory>/.goodvibes/daemon`.
|
|
76
|
+
* Threaded into `SecretsManager` so the override MOVES the daemon-scoped
|
|
77
|
+
* credential store; without it a daemon told to run out of a temp tree still
|
|
78
|
+
* read the real home's daemon secrets, so an "isolated" test daemon held the
|
|
79
|
+
* owner's live credentials. One name for one thing — `resolveGoodVibesHomeOwnership`
|
|
80
|
+
* is the single reader that produces it.
|
|
81
|
+
*/
|
|
82
|
+
readonly daemonHomeDirectory?: string | undefined;
|
|
83
|
+
/** Opt-in (daemon-side only): fold host-observed external coding-agent sessions
|
|
84
|
+
* into the fleet as 'observed-external' rows. Interactive leaves it off and reads
|
|
85
|
+
* the daemon snapshot. Mirrors the SDK's own createRuntimeServices option. */
|
|
86
|
+
readonly observeExternalAgents?: boolean | undefined;
|
|
87
|
+
/** Host power seam opt-in. Left out, the SDK's idle-power wiring falls back to
|
|
88
|
+
* the non-spawning unavailable seam; the daemon entrypoint passes the real
|
|
89
|
+
* host seam, which is what starts systemd-inhibit and the sleep-edge watcher. */
|
|
90
|
+
readonly powerSeam?: operations.IdlePowerServicesDeps['powerSeam'];
|
|
91
|
+
/** Live session id, read per crash-residue sweep so the running session is exempt. */
|
|
92
|
+
readonly currentSessionId?: (() => string | null) | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* Wake-word boot provisioning opt-in. Same shape as `powerSeam`: the real
|
|
95
|
+
* entrypoint (`daemon/cli.ts`) asks for it, the one-shot CLI commands do
|
|
96
|
+
* not, and a test composing this graph gets neither a network fetch nor an
|
|
97
|
+
* hourly sweep it did not ask for.
|
|
98
|
+
*/
|
|
99
|
+
readonly provisionWakeModelsAtBoot?: boolean | undefined;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface RuntimeServices {
|
|
103
|
+
readonly workingDirectory: string;
|
|
104
|
+
readonly homeDirectory: string;
|
|
105
|
+
/** The declare-once session-storage handle every session reader and writer threads through. */
|
|
106
|
+
readonly surface: SessionSurface;
|
|
107
|
+
readonly shellPaths: ShellPathService;
|
|
108
|
+
readonly configManager: ConfigManager;
|
|
109
|
+
readonly featureFlags: FeatureFlagManager;
|
|
110
|
+
readonly runtimeBus: RuntimeEventBus;
|
|
111
|
+
readonly runtimeStore: RuntimeStore;
|
|
112
|
+
readonly runtimeDispatch: DomainDispatch;
|
|
113
|
+
/** No-op stand-ins: the facade's contract names them, and the daemon has no screen. */
|
|
114
|
+
readonly panelManager: PanelManagerLike;
|
|
115
|
+
readonly keybindingsManager: KeybindingsManagerLike;
|
|
116
|
+
readonly routeBindings: RouteBindingManager;
|
|
117
|
+
readonly surfaceRegistry: SurfaceRegistry;
|
|
118
|
+
readonly channelPlugins: ChannelPluginRegistry;
|
|
119
|
+
readonly channelDeliveryRouter: ChannelDeliveryRouter;
|
|
120
|
+
readonly watcherRegistry: WatcherRegistry;
|
|
121
|
+
readonly approvalBroker: ApprovalBroker;
|
|
122
|
+
/** Loopback-fetch approval that rides the approval broker; shared by the tool registry and orchestrator so every surface asks the same way. */
|
|
123
|
+
readonly localhostFetchApproval: ReturnType<typeof buildLocalhostFetchApproval>;
|
|
124
|
+
/** 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. */
|
|
125
|
+
readonly execPromptAnswerHandler: ReturnType<typeof buildExecPromptAnswerHandler>;
|
|
126
|
+
/** Durable user-origin permission rules (remembered approvals); permissions.rules.* surface. Mirrors the SDK composition. */
|
|
127
|
+
readonly userPermissionRuleStore: UserPermissionRuleStore;
|
|
128
|
+
readonly sessionBroker: SharedSessionBroker;
|
|
129
|
+
readonly deliveryManager: AutomationDeliveryManager;
|
|
130
|
+
readonly automationManager: AutomationManager;
|
|
131
|
+
readonly gatewayMethods: GatewayMethodCatalog;
|
|
132
|
+
readonly artifactStore: ArtifactStore;
|
|
133
|
+
readonly knowledgeService: KnowledgeService;
|
|
134
|
+
readonly agentKnowledgeService: KnowledgeService;
|
|
135
|
+
readonly homeGraphService: HomeGraphService;
|
|
136
|
+
readonly projectPlanningService: ProjectPlanningService;
|
|
137
|
+
readonly projectPlanningProjectId: string;
|
|
138
|
+
readonly workPlanStore: WorkPlanStore;
|
|
139
|
+
readonly memoryStore: MemoryStore;
|
|
140
|
+
readonly memoryRegistry: MemoryRegistry;
|
|
141
|
+
/** Host-vs-client memory access: local until bootstrap.ts activates it for an adopted 'external' daemon (mirrors sessionSpine). */
|
|
142
|
+
readonly memorySpine: MemorySpineClient;
|
|
143
|
+
readonly serviceRegistry: ServiceRegistry;
|
|
144
|
+
readonly secretsManager: SecretsManager;
|
|
145
|
+
readonly stepUpService: StepUpService;
|
|
146
|
+
readonly pairingTokens: PairingTokenManager; // backs pairing.tokens.* verbs + the settings device surface (mirrors the SDK composition)
|
|
147
|
+
readonly subscriptionManager: SubscriptionManager;
|
|
148
|
+
readonly localUserAuthManager: UserAuthManager;
|
|
149
|
+
readonly profileManager: ProfileManager;
|
|
150
|
+
readonly bookmarkManager: BookmarkManager;
|
|
151
|
+
readonly sessionManager: SessionManager;
|
|
152
|
+
readonly sessionOrchestration: CrossSessionTaskRegistry;
|
|
153
|
+
readonly hookDispatcher: HookDispatcher;
|
|
154
|
+
readonly hookActivityTracker: HookActivityTracker;
|
|
155
|
+
readonly hookWorkbench: HookWorkbench;
|
|
156
|
+
readonly pluginManager: PluginManager;
|
|
157
|
+
readonly workflow: WorkflowServices;
|
|
158
|
+
/** Stream watchers, on-exit process triggers and condition checks, supervised as one — see trigger-services.ts. */
|
|
159
|
+
readonly triggerManager: TriggerManager;
|
|
160
|
+
readonly voiceProviders: VoiceProviderRegistry;
|
|
161
|
+
readonly voiceService: VoiceService;
|
|
162
|
+
readonly webSearchProviders: WebSearchProviderRegistry;
|
|
163
|
+
readonly webSearchService: WebSearchService;
|
|
164
|
+
readonly mediaProviders: MediaProviderRegistry;
|
|
165
|
+
readonly multimodalService: MultimodalService;
|
|
166
|
+
readonly memoryEmbeddingRegistry: MemoryEmbeddingProviderRegistry;
|
|
167
|
+
readonly channelPolicy: ChannelPolicyManager;
|
|
168
|
+
readonly mcpRegistry: McpRegistry;
|
|
169
|
+
readonly tokenAuditor: ApiTokenAuditor;
|
|
170
|
+
readonly componentHealthMonitor: ComponentHealthMonitor;
|
|
171
|
+
readonly worktreeRegistry: WorktreeRegistry;
|
|
172
|
+
readonly sandboxSessionRegistry: SandboxSessionRegistry;
|
|
173
|
+
readonly webhookNotifier: WebhookNotifier;
|
|
174
|
+
readonly replayEngine: DeterministicReplayEngine;
|
|
175
|
+
readonly providerOptimizer: ProviderOptimizer;
|
|
176
|
+
readonly providerCapabilityRegistry: ProviderCapabilityRegistry;
|
|
177
|
+
readonly cacheHitTracker: CacheHitTracker;
|
|
178
|
+
readonly favoritesStore: FavoritesStore;
|
|
179
|
+
readonly benchmarkStore: BenchmarkStore;
|
|
180
|
+
readonly modelLimitsService: ModelLimitsService;
|
|
181
|
+
readonly providerRegistry: ProviderRegistry;
|
|
182
|
+
readonly toolLLM: ToolLLM;
|
|
183
|
+
readonly distributedRuntime: DistributedRuntimeManager;
|
|
184
|
+
/**
|
|
185
|
+
* The paired-phone feature for this host: the grants ledger, the capture
|
|
186
|
+
* store, the housekeeping sweeps, and the capability service every `device.*`
|
|
187
|
+
* setting governs. Bound to the `devices.*` verbs at composition; the `phone`
|
|
188
|
+
* tool is registered on it in the bootstrap tail.
|
|
189
|
+
*/
|
|
190
|
+
readonly devicePosture: DevicePostureRuntime;
|
|
191
|
+
readonly daemonHandlers: DaemonHandlerSurfaces;
|
|
192
|
+
/** 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. */
|
|
193
|
+
readonly clusterCoordinator: ClusterCoordinator;
|
|
194
|
+
/** LAN group membership: identity, keys, roster, and the `cluster` verbs. */
|
|
195
|
+
readonly clusterGroup: ClusterGroupComposition;
|
|
196
|
+
/** Start the group layer and then the election, in that order. Idempotent. */
|
|
197
|
+
readonly startCluster: () => Promise<void>;
|
|
198
|
+
readonly remoteRunnerRegistry: RemoteRunnerRegistry;
|
|
199
|
+
readonly remoteSupervisor: RemoteSupervisor;
|
|
200
|
+
readonly sessionMemoryStore: SessionMemoryStore;
|
|
201
|
+
readonly sessionLineageTracker: SessionLineageTracker;
|
|
202
|
+
readonly sessionChangeTracker: SessionChangeTracker;
|
|
203
|
+
readonly planManager: ExecutionPlanManager;
|
|
204
|
+
readonly adaptivePlanner: AdaptivePlanner;
|
|
205
|
+
readonly idempotencyStore: IdempotencyStore;
|
|
206
|
+
readonly overflowHandler: OverflowHandler;
|
|
207
|
+
readonly policyRuntimeState: PolicyRuntimeState;
|
|
208
|
+
readonly archetypeLoader: ArchetypeLoader;
|
|
209
|
+
readonly agentManager: AgentManager;
|
|
210
|
+
readonly agentMessageBus: AgentMessageBus;
|
|
211
|
+
readonly agentOrchestrator: AgentOrchestrator;
|
|
212
|
+
readonly contextAccountingHolder: ContextAccountingHolder; // bound at bootstrap.ts; see context-accounting-source.ts
|
|
213
|
+
readonly wrfcController: WrfcController;
|
|
214
|
+
readonly processManager: ProcessManager;
|
|
215
|
+
/** The phase/work-item orchestration engine — the SDK's platform/orchestration. */
|
|
216
|
+
readonly orchestrationEngine: OrchestrationEngine;
|
|
217
|
+
readonly workstreamCommands: WorkstreamCommandService;
|
|
218
|
+
/** The repo source-tree code index. */
|
|
219
|
+
readonly codeIndexStore: CodeIndexStore;
|
|
220
|
+
readonly codeIndexReindexScheduler: CodeIndexReindexScheduler; // tool-site reindex
|
|
221
|
+
/** 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). */
|
|
222
|
+
readonly storeSnapshotScheduler: StoreSnapshotScheduler;
|
|
223
|
+
readonly appendOnlyRetentionScheduler: operations.DurabilityServices['appendOnlyRetentionScheduler']; // periodic append-only sweep; unref'd timers, stop() on teardown
|
|
224
|
+
/** Stops the recurring crash-residue sweep; idempotent, unref'd timer (hosts that tear a runtime down call it). */
|
|
225
|
+
readonly stopDurabilityHousekeeping: () => void;
|
|
226
|
+
/** Stops the wake-word recovery sweep and a pending boot provision; a no-op unless `provisionWakeModelsAtBoot` was set. */
|
|
227
|
+
readonly stopWakeHousekeeping: () => void;
|
|
228
|
+
readonly memoryConsolidationScheduler: MemoryConsolidationScheduler;
|
|
229
|
+
readonly powerManager: PowerManager;
|
|
230
|
+
/** The daemon's memory governor (default ON). Backs ops.memory.get and defends the daemon's footprint by tier. */
|
|
231
|
+
readonly memoryGovernor: MemoryGovernor;
|
|
232
|
+
/** Registry of every retained cache the governor can shrink (knowledge stores + shared session broker). */
|
|
233
|
+
readonly cacheRegistry: CacheRegistry;
|
|
234
|
+
/** Controller the governor uses to pause/resume the deferrable background jobs under pressure. */
|
|
235
|
+
readonly pauseController: PauseController;
|
|
236
|
+
readonly sessionLiveTurnControls: SessionLiveTurnControlsHolder;
|
|
237
|
+
/** 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. */
|
|
238
|
+
readonly processRegistry: ArchivableProcessRegistry;
|
|
239
|
+
readonly modeManager: ModeManager;
|
|
240
|
+
readonly fileUndoManager: FileUndoManager;
|
|
241
|
+
readonly workspaceCheckpointManager: WorkspaceCheckpointManager;
|
|
242
|
+
/** Whether checkpoints are currently permitted for this workspace; re-reads the registration store on every call. */
|
|
243
|
+
readonly checkpointsCurrentlyAllowed: () => boolean;
|
|
244
|
+
/** Surface-scoped continuity reads (recovery-file presence, last-session pointer). */
|
|
245
|
+
readonly integrationHelpers: IntegrationHelperService;
|
|
246
|
+
/** Per-workspace trust gate — restricts write/execute/delegate tools until the workspace is trusted. */
|
|
247
|
+
readonly workspaceTrustManager: operations.WorkspaceTrustManager;
|
|
248
|
+
/**
|
|
249
|
+
* The permission manager the runs this daemon hosts ask through. Its ask seam
|
|
250
|
+
* is the workspace trust gate over the approval broker, so an undecided
|
|
251
|
+
* workspace has the trust question raised as an approval record rather than
|
|
252
|
+
* being treated as trusted (which is what a missing manager means to the
|
|
253
|
+
* background permission gate) or refused without a word.
|
|
254
|
+
*/
|
|
255
|
+
readonly permissionManager: PermissionManager;
|
|
256
|
+
/** 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. */
|
|
257
|
+
rerootStores(newWorkingDir: string): Promise<void>;
|
|
258
|
+
/**
|
|
259
|
+
* Cancel the agent runs this graph is hosting, returning how many.
|
|
260
|
+
*
|
|
261
|
+
* Required by the SDK's RuntimePollerOwners: by dispose() time the fleet
|
|
262
|
+
* registry, orchestration engine, process registry and bus these runs report
|
|
263
|
+
* through are already down, so a run still described as "running" is orphaned
|
|
264
|
+
* rather than preserved.
|
|
265
|
+
*/
|
|
266
|
+
cancelHostedAgentRuns(): number;
|
|
267
|
+
dispose(): void; // Stop every poller this graph started; best-effort, total, idempotent. This surface owns its graph — the SDK's disposal scope drives it.
|
|
268
|
+
}
|