@pellux/goodvibes-agent 0.1.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/.goodvibes/GOODVIBES.md +35 -0
- package/.goodvibes/agents/reviewer.md +48 -0
- package/.goodvibes/skills/add-provider/SKILL.md +199 -0
- package/CHANGELOG.md +25 -0
- package/README.md +74 -0
- package/bin/goodvibes-agent.ts +2 -0
- package/docs/README.md +23 -0
- package/docs/deployment-and-services.md +57 -0
- package/docs/getting-started.md +53 -0
- package/docs/release-and-publishing.md +46 -0
- package/package.json +134 -0
- package/scripts/check-bun.sh +20 -0
- package/src/audio/player.ts +156 -0
- package/src/audio/spoken-turn-controller.ts +203 -0
- package/src/audio/spoken-turn-model-routing.ts +117 -0
- package/src/audio/spoken-turn-wiring.ts +44 -0
- package/src/audio/text-chunker.ts +110 -0
- package/src/cli/bundle-command.ts +227 -0
- package/src/cli/completion.ts +90 -0
- package/src/cli/config-overrides.ts +159 -0
- package/src/cli/endpoints.ts +63 -0
- package/src/cli/entrypoint.ts +172 -0
- package/src/cli/help.ts +299 -0
- package/src/cli/index.ts +11 -0
- package/src/cli/management-commands.ts +426 -0
- package/src/cli/management.ts +744 -0
- package/src/cli/network-posture.ts +46 -0
- package/src/cli/package-verification.ts +123 -0
- package/src/cli/parser.ts +369 -0
- package/src/cli/provider-auth-routes.ts +22 -0
- package/src/cli/provider-classification.ts +107 -0
- package/src/cli/redaction.ts +105 -0
- package/src/cli/service-command.ts +26 -0
- package/src/cli/service-posture.ts +482 -0
- package/src/cli/status.ts +383 -0
- package/src/cli/surface-command.ts +247 -0
- package/src/cli/tui-startup.ts +32 -0
- package/src/cli/types.ts +69 -0
- package/src/cli-flags.ts +21 -0
- package/src/config/goodvibes-home-audit.ts +465 -0
- package/src/config/index.ts +57 -0
- package/src/config/provider-model.ts +23 -0
- package/src/config/secret-config.ts +119 -0
- package/src/config/secrets.ts +71 -0
- package/src/config/surface.ts +1 -0
- package/src/core/composer-state.ts +61 -0
- package/src/core/conversation-rendering.ts +359 -0
- package/src/core/conversation.ts +551 -0
- package/src/core/history.ts +45 -0
- package/src/core/orchestrator.ts +7 -0
- package/src/core/system-message-router.ts +171 -0
- package/src/daemon/cli.ts +55 -0
- package/src/daemon/safe-serve.ts +61 -0
- package/src/input/agent-workspace.ts +428 -0
- package/src/input/autocomplete.ts +96 -0
- package/src/input/bookmark-modal.ts +115 -0
- package/src/input/command-args-hint.ts +36 -0
- package/src/input/command-registry.ts +329 -0
- package/src/input/commands/agent-externalized-tui.ts +73 -0
- package/src/input/commands/agent-workspace-runtime.ts +17 -0
- package/src/input/commands/branch-runtime.ts +72 -0
- package/src/input/commands/cloudflare-runtime.ts +370 -0
- package/src/input/commands/config.ts +18 -0
- package/src/input/commands/control-room-runtime.ts +255 -0
- package/src/input/commands/conversation-runtime.ts +207 -0
- package/src/input/commands/discovery-runtime.ts +52 -0
- package/src/input/commands/eval.ts +204 -0
- package/src/input/commands/experience-runtime.ts +278 -0
- package/src/input/commands/guidance-runtime.ts +106 -0
- package/src/input/commands/health-runtime.ts +434 -0
- package/src/input/commands/hooks-runtime.ts +148 -0
- package/src/input/commands/incident-runtime.ts +95 -0
- package/src/input/commands/integration-runtime.ts +394 -0
- package/src/input/commands/intelligence-runtime.ts +223 -0
- package/src/input/commands/knowledge.ts +531 -0
- package/src/input/commands/local-auth-runtime.ts +105 -0
- package/src/input/commands/local-provider-runtime.ts +170 -0
- package/src/input/commands/local-runtime.ts +392 -0
- package/src/input/commands/local-setup-review.ts +199 -0
- package/src/input/commands/local-setup-transfer.ts +135 -0
- package/src/input/commands/local-setup.ts +282 -0
- package/src/input/commands/managed-runtime.ts +209 -0
- package/src/input/commands/marketplace-runtime.ts +290 -0
- package/src/input/commands/mcp-runtime.ts +432 -0
- package/src/input/commands/memory-product-runtime.ts +111 -0
- package/src/input/commands/memory.ts +151 -0
- package/src/input/commands/notify-runtime.ts +83 -0
- package/src/input/commands/onboarding-runtime.ts +14 -0
- package/src/input/commands/operator-panel-runtime.ts +146 -0
- package/src/input/commands/operator-runtime.ts +392 -0
- package/src/input/commands/planning-runtime.ts +205 -0
- package/src/input/commands/platform-access-runtime.ts +422 -0
- package/src/input/commands/platform-services-runtime.ts +246 -0
- package/src/input/commands/policy-dispatch.ts +339 -0
- package/src/input/commands/policy.ts +17 -0
- package/src/input/commands/product-runtime.ts +351 -0
- package/src/input/commands/profile-sync-runtime.ts +99 -0
- package/src/input/commands/provider-accounts-runtime.ts +113 -0
- package/src/input/commands/provider.ts +363 -0
- package/src/input/commands/qrcode-runtime.ts +20 -0
- package/src/input/commands/quit-shared.ts +162 -0
- package/src/input/commands/recall-bundle.ts +132 -0
- package/src/input/commands/recall-capture.ts +152 -0
- package/src/input/commands/recall-query.ts +229 -0
- package/src/input/commands/recall-review.ts +98 -0
- package/src/input/commands/recall-shared.ts +22 -0
- package/src/input/commands/remote-runtime-pool.ts +106 -0
- package/src/input/commands/remote-runtime-setup.ts +199 -0
- package/src/input/commands/remote-runtime.ts +431 -0
- package/src/input/commands/replay-runtime.ts +18 -0
- package/src/input/commands/runtime-services.ts +291 -0
- package/src/input/commands/schedule-runtime.ts +91 -0
- package/src/input/commands/services-runtime.ts +209 -0
- package/src/input/commands/session-content.ts +408 -0
- package/src/input/commands/session-workflow.ts +464 -0
- package/src/input/commands/session.ts +375 -0
- package/src/input/commands/settings-sync-runtime.ts +174 -0
- package/src/input/commands/share-runtime.ts +119 -0
- package/src/input/commands/shell-core.ts +307 -0
- package/src/input/commands/skills-runtime.ts +221 -0
- package/src/input/commands/subscription-runtime.ts +434 -0
- package/src/input/commands/tasks-runtime.ts +230 -0
- package/src/input/commands/teamwork-runtime.ts +339 -0
- package/src/input/commands/teleport-runtime.ts +57 -0
- package/src/input/commands/tts-runtime.ts +29 -0
- package/src/input/commands/work-plan-runtime.ts +169 -0
- package/src/input/commands.ts +131 -0
- package/src/input/feed-context-factory.ts +254 -0
- package/src/input/file-picker.ts +192 -0
- package/src/input/handler-command-route.ts +180 -0
- package/src/input/handler-content-actions.ts +497 -0
- package/src/input/handler-feed-routes.ts +648 -0
- package/src/input/handler-feed.ts +452 -0
- package/src/input/handler-interactions.ts +281 -0
- package/src/input/handler-modal-routes.ts +418 -0
- package/src/input/handler-modal-stack.ts +263 -0
- package/src/input/handler-modal-token-routes.ts +329 -0
- package/src/input/handler-onboarding-cloudflare.ts +391 -0
- package/src/input/handler-onboarding.ts +620 -0
- package/src/input/handler-picker-routes.ts +472 -0
- package/src/input/handler-prompt-buffer.ts +320 -0
- package/src/input/handler-shortcuts.ts +213 -0
- package/src/input/handler-ui-state.ts +372 -0
- package/src/input/handler.ts +729 -0
- package/src/input/input-history.ts +297 -0
- package/src/input/keybindings.ts +292 -0
- package/src/input/mcp-workspace.ts +554 -0
- package/src/input/model-picker-provider-filter.ts +28 -0
- package/src/input/model-picker-types.ts +137 -0
- package/src/input/model-picker.ts +797 -0
- package/src/input/onboarding/handler-onboarding-routes.ts +125 -0
- package/src/input/onboarding/onboarding-runtime-status.ts +87 -0
- package/src/input/onboarding/onboarding-wizard-apply.ts +277 -0
- package/src/input/onboarding/onboarding-wizard-cloudflare-step.ts +494 -0
- package/src/input/onboarding/onboarding-wizard-cloudflare.ts +204 -0
- package/src/input/onboarding/onboarding-wizard-constants.ts +158 -0
- package/src/input/onboarding/onboarding-wizard-external-surface-extra-specs.ts +130 -0
- package/src/input/onboarding/onboarding-wizard-external-surfaces.ts +762 -0
- package/src/input/onboarding/onboarding-wizard-helpers.ts +167 -0
- package/src/input/onboarding/onboarding-wizard-rules.ts +256 -0
- package/src/input/onboarding/onboarding-wizard-state.ts +365 -0
- package/src/input/onboarding/onboarding-wizard-steps.ts +798 -0
- package/src/input/onboarding/onboarding-wizard-types.ts +195 -0
- package/src/input/onboarding/onboarding-wizard.ts +711 -0
- package/src/input/panel-integration-actions.ts +78 -0
- package/src/input/profile-picker-modal.ts +222 -0
- package/src/input/search.ts +100 -0
- package/src/input/selection-modal.ts +163 -0
- package/src/input/selection.ts +135 -0
- package/src/input/session-picker-modal.ts +136 -0
- package/src/input/settings-modal-behavior.ts +37 -0
- package/src/input/settings-modal-secrets.ts +41 -0
- package/src/input/settings-modal-subscriptions.ts +95 -0
- package/src/input/settings-modal-types.ts +91 -0
- package/src/input/settings-modal.ts +793 -0
- package/src/input/submission-intent.ts +17 -0
- package/src/input/submission-router.ts +59 -0
- package/src/input/tts-settings-actions.ts +100 -0
- package/src/main.ts +792 -0
- package/src/mcp/runtime-reload.ts +81 -0
- package/src/panels/agent-inspector-panel.ts +521 -0
- package/src/panels/agent-inspector-shared.ts +94 -0
- package/src/panels/agent-logs-panel.ts +559 -0
- package/src/panels/agent-logs-shared.ts +129 -0
- package/src/panels/approval-panel.ts +150 -0
- package/src/panels/automation-control-panel.ts +212 -0
- package/src/panels/base-panel.ts +254 -0
- package/src/panels/builtin/agent.ts +117 -0
- package/src/panels/builtin/development.ts +31 -0
- package/src/panels/builtin/knowledge.ts +26 -0
- package/src/panels/builtin/operations.ts +349 -0
- package/src/panels/builtin/session.ts +129 -0
- package/src/panels/builtin/shared.ts +274 -0
- package/src/panels/builtin-panels.ts +23 -0
- package/src/panels/cockpit-panel.ts +183 -0
- package/src/panels/communication-panel.ts +153 -0
- package/src/panels/confirm-state.ts +61 -0
- package/src/panels/context-visualizer-panel.ts +204 -0
- package/src/panels/control-plane-panel.ts +211 -0
- package/src/panels/cost-tracker-panel.ts +444 -0
- package/src/panels/debug-panel.ts +432 -0
- package/src/panels/diff-panel.ts +520 -0
- package/src/panels/docs-panel.ts +283 -0
- package/src/panels/eval-panel.ts +399 -0
- package/src/panels/file-explorer-panel.ts +584 -0
- package/src/panels/file-preview-panel.ts +434 -0
- package/src/panels/forensics-panel.ts +364 -0
- package/src/panels/git-panel.ts +638 -0
- package/src/panels/hooks-panel.ts +239 -0
- package/src/panels/incident-review-panel.ts +197 -0
- package/src/panels/index.ts +46 -0
- package/src/panels/intelligence-panel.ts +176 -0
- package/src/panels/knowledge-panel.ts +345 -0
- package/src/panels/local-auth-panel.ts +130 -0
- package/src/panels/marketplace-panel.ts +212 -0
- package/src/panels/memory-panel.ts +225 -0
- package/src/panels/ops-control-panel.ts +150 -0
- package/src/panels/ops-strategy-panel.ts +235 -0
- package/src/panels/orchestration-panel.ts +273 -0
- package/src/panels/panel-list-panel.ts +509 -0
- package/src/panels/panel-manager.ts +570 -0
- package/src/panels/panel-picker.ts +106 -0
- package/src/panels/plan-dashboard-panel.ts +274 -0
- package/src/panels/plugins-panel.ts +178 -0
- package/src/panels/policy-panel.ts +308 -0
- package/src/panels/polish.ts +717 -0
- package/src/panels/project-planning-panel.ts +711 -0
- package/src/panels/provider-account-snapshot.ts +259 -0
- package/src/panels/provider-accounts-panel.ts +218 -0
- package/src/panels/provider-health-domains.ts +215 -0
- package/src/panels/provider-health-panel.ts +727 -0
- package/src/panels/provider-health-tracker.ts +115 -0
- package/src/panels/provider-stats-panel.ts +366 -0
- package/src/panels/qr-panel.ts +182 -0
- package/src/panels/remote-panel.ts +449 -0
- package/src/panels/routes-panel.ts +178 -0
- package/src/panels/sandbox-panel.ts +283 -0
- package/src/panels/schedule-panel.ts +329 -0
- package/src/panels/scrollable-list-panel.ts +491 -0
- package/src/panels/search-focus.ts +32 -0
- package/src/panels/security-panel.ts +295 -0
- package/src/panels/services-panel.ts +231 -0
- package/src/panels/session-browser-panel.ts +400 -0
- package/src/panels/session-maintenance.ts +125 -0
- package/src/panels/settings-sync-panel.ts +120 -0
- package/src/panels/skills-panel.ts +431 -0
- package/src/panels/subscription-panel.ts +263 -0
- package/src/panels/symbol-outline-panel.ts +486 -0
- package/src/panels/system-messages-panel.ts +230 -0
- package/src/panels/tasks-panel.ts +399 -0
- package/src/panels/thinking-panel.ts +304 -0
- package/src/panels/token-budget-panel.ts +475 -0
- package/src/panels/tool-inspector-panel.ts +429 -0
- package/src/panels/types.ts +54 -0
- package/src/panels/watchers-panel.ts +193 -0
- package/src/panels/work-plan-panel.ts +175 -0
- package/src/panels/worktree-panel.ts +182 -0
- package/src/panels/wrfc-panel.ts +609 -0
- package/src/permissions/prompt.ts +165 -0
- package/src/planning/project-planning-coordinator.ts +543 -0
- package/src/plugins/loader.ts +15 -0
- package/src/renderer/agent-detail-modal.ts +331 -0
- package/src/renderer/agent-workspace.ts +238 -0
- package/src/renderer/ansi-sanitize.ts +76 -0
- package/src/renderer/autocomplete-overlay.ts +154 -0
- package/src/renderer/block-actions.ts +76 -0
- package/src/renderer/bookmark-modal.ts +101 -0
- package/src/renderer/bottom-bar.ts +58 -0
- package/src/renderer/buffer.ts +113 -0
- package/src/renderer/code-block.ts +373 -0
- package/src/renderer/compositor.ts +283 -0
- package/src/renderer/context-inspector.ts +219 -0
- package/src/renderer/conversation-layout.ts +67 -0
- package/src/renderer/conversation-overlays.ts +140 -0
- package/src/renderer/conversation-surface.ts +260 -0
- package/src/renderer/diff-view.ts +132 -0
- package/src/renderer/diff.ts +130 -0
- package/src/renderer/file-picker-overlay.ts +101 -0
- package/src/renderer/file-tree.ts +153 -0
- package/src/renderer/fullscreen-primitives.ts +130 -0
- package/src/renderer/fullscreen-workspace.ts +199 -0
- package/src/renderer/git-status.ts +89 -0
- package/src/renderer/help-overlay.ts +267 -0
- package/src/renderer/history-search-overlay.ts +73 -0
- package/src/renderer/layout-engine.ts +97 -0
- package/src/renderer/layout.ts +32 -0
- package/src/renderer/live-tail-modal.ts +156 -0
- package/src/renderer/markdown.ts +635 -0
- package/src/renderer/mcp-workspace.ts +237 -0
- package/src/renderer/modal-factory.ts +467 -0
- package/src/renderer/modal-utils.ts +24 -0
- package/src/renderer/model-picker-overlay.ts +473 -0
- package/src/renderer/model-workspace.ts +488 -0
- package/src/renderer/onboarding/onboarding-wizard.ts +615 -0
- package/src/renderer/overlay-box.ts +146 -0
- package/src/renderer/overlay-viewport.ts +104 -0
- package/src/renderer/panel-composite.ts +158 -0
- package/src/renderer/panel-picker-overlay.ts +202 -0
- package/src/renderer/panel-tab-bar.ts +69 -0
- package/src/renderer/panel-workspace-bar.ts +42 -0
- package/src/renderer/process-indicator.ts +96 -0
- package/src/renderer/process-modal.ts +656 -0
- package/src/renderer/process-summary.ts +67 -0
- package/src/renderer/profile-picker-modal.ts +129 -0
- package/src/renderer/progress.ts +98 -0
- package/src/renderer/qr-renderer.ts +120 -0
- package/src/renderer/search-overlay.ts +54 -0
- package/src/renderer/selection-modal-overlay.ts +214 -0
- package/src/renderer/semantic-diff.ts +369 -0
- package/src/renderer/session-picker-modal.ts +127 -0
- package/src/renderer/settings-modal-helpers.ts +193 -0
- package/src/renderer/settings-modal.ts +537 -0
- package/src/renderer/shell-surface.ts +88 -0
- package/src/renderer/status-glyphs.ts +21 -0
- package/src/renderer/status-token.ts +67 -0
- package/src/renderer/surface-layout.ts +101 -0
- package/src/renderer/syntax-highlighter.ts +542 -0
- package/src/renderer/system-message.ts +83 -0
- package/src/renderer/tab-strip.ts +108 -0
- package/src/renderer/text-layout.ts +31 -0
- package/src/renderer/thinking.ts +17 -0
- package/src/renderer/tool-call.ts +234 -0
- package/src/renderer/ui-factory.ts +524 -0
- package/src/renderer/ui-primitives.ts +96 -0
- package/src/runtime/bootstrap-command-context.ts +278 -0
- package/src/runtime/bootstrap-command-parts.ts +386 -0
- package/src/runtime/bootstrap-core.ts +540 -0
- package/src/runtime/bootstrap-hook-bridge.ts +112 -0
- package/src/runtime/bootstrap-shell.ts +283 -0
- package/src/runtime/bootstrap.ts +575 -0
- package/src/runtime/cloudflare-control-plane.ts +349 -0
- package/src/runtime/context.ts +142 -0
- package/src/runtime/diagnostics/panels/index.ts +24 -0
- package/src/runtime/diagnostics/panels/ops.ts +156 -0
- package/src/runtime/diagnostics/panels/panel-resources.ts +118 -0
- package/src/runtime/diagnostics/panels/policy.ts +177 -0
- package/src/runtime/index.ts +662 -0
- package/src/runtime/onboarding/apply.ts +642 -0
- package/src/runtime/onboarding/derivation.ts +534 -0
- package/src/runtime/onboarding/index.ts +7 -0
- package/src/runtime/onboarding/markers.ts +148 -0
- package/src/runtime/onboarding/snapshot.ts +406 -0
- package/src/runtime/onboarding/state.ts +141 -0
- package/src/runtime/onboarding/types.ts +404 -0
- package/src/runtime/onboarding/verify.ts +171 -0
- package/src/runtime/operator-token-cleanup.ts +27 -0
- package/src/runtime/perf/panel-contracts.ts +32 -0
- package/src/runtime/perf/panel-health-monitor.ts +18 -0
- package/src/runtime/sandbox-public-gaps.ts +358 -0
- package/src/runtime/services.ts +670 -0
- package/src/runtime/store/domains/domain-read-matrix.ts +15 -0
- package/src/runtime/store/domains/index.ts +222 -0
- package/src/runtime/store/domains/panels.ts +117 -0
- package/src/runtime/store/domains/ui-perf.ts +103 -0
- package/src/runtime/store/index.ts +305 -0
- package/src/runtime/store/selectors/index.ts +359 -0
- package/src/runtime/store/state.ts +145 -0
- package/src/runtime/surface-feature-flags.ts +65 -0
- package/src/runtime/terminal-output-guard.ts +228 -0
- package/src/runtime/ui/index.ts +39 -0
- package/src/runtime/ui/model-picker/data-provider.ts +182 -0
- package/src/runtime/ui/model-picker/health-enrichment.ts +228 -0
- package/src/runtime/ui/model-picker/index.ts +59 -0
- package/src/runtime/ui/model-picker/types.ts +149 -0
- package/src/runtime/ui/provider-health/data-provider.ts +244 -0
- package/src/runtime/ui/provider-health/fallback-visualizer.ts +71 -0
- package/src/runtime/ui/provider-health/index.ts +46 -0
- package/src/runtime/ui/provider-health/types.ts +146 -0
- package/src/runtime/ui-events.ts +1 -0
- package/src/runtime/ui-read-model-helpers.ts +1 -0
- package/src/runtime/ui-read-models-observability-maintenance.ts +1 -0
- package/src/runtime/ui-read-models-observability-options.ts +1 -0
- package/src/runtime/ui-read-models-observability-remote.ts +1 -0
- package/src/runtime/ui-read-models-observability-security.ts +1 -0
- package/src/runtime/ui-read-models-observability-system.ts +1 -0
- package/src/runtime/ui-read-models-observability.ts +1 -0
- package/src/runtime/ui-read-models.ts +61 -0
- package/src/runtime/ui-service-queries.ts +1 -0
- package/src/runtime/ui-services.ts +190 -0
- package/src/scripts/process-messages.ts +42 -0
- package/src/shell/blocking-input.ts +98 -0
- package/src/shell/service-settings-sync.ts +273 -0
- package/src/shell/ui-openers.ts +352 -0
- package/src/tools/index.ts +1 -0
- package/src/tools/wrfc-agent-guard.ts +49 -0
- package/src/types/grid.ts +48 -0
- package/src/types/sql-js.d.ts +15 -0
- package/src/utils/clipboard.ts +22 -0
- package/src/utils/splash-lines.ts +46 -0
- package/src/utils/terminal-width.ts +185 -0
- package/src/verification/live-verifier.ts +430 -0
- package/src/verification/verification-ledger.ts +242 -0
- package/src/version.ts +17 -0
- package/src/widget/index.ts +2 -0
- package/src/widget/types.ts +9 -0
- package/src/widget/widget.ts +8 -0
- package/src/work-plans/work-plan-store.ts +374 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,662 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime module barrel for GoodVibes Agent.
|
|
3
|
+
*
|
|
4
|
+
* SDK 0.33 intentionally removed private deep imports and the runtime root
|
|
5
|
+
* god-barrel. This file keeps the near-fork Agent app on public SDK seams
|
|
6
|
+
* while preserving the local import surface used by the shell.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
bootstrap,
|
|
11
|
+
operations,
|
|
12
|
+
security,
|
|
13
|
+
shell,
|
|
14
|
+
transport,
|
|
15
|
+
} from '@pellux/goodvibes-sdk/platform/runtime';
|
|
16
|
+
import {
|
|
17
|
+
createFeatureFlagManager as createSdkFeatureFlagManager,
|
|
18
|
+
FEATURE_FLAG_MAP,
|
|
19
|
+
} from '@pellux/goodvibes-sdk/platform/runtime/state';
|
|
20
|
+
import { existsSync, statSync } from 'node:fs';
|
|
21
|
+
import { join, resolve } from 'node:path';
|
|
22
|
+
import type {
|
|
23
|
+
bootstrap as Bootstrap,
|
|
24
|
+
operations as Operations,
|
|
25
|
+
security as Security,
|
|
26
|
+
shell as Shell,
|
|
27
|
+
transport as Transport,
|
|
28
|
+
} from '@pellux/goodvibes-sdk/platform/runtime';
|
|
29
|
+
import type { FeatureFlagManager, FlagConfig } from '@pellux/goodvibes-sdk/platform/runtime/state';
|
|
30
|
+
|
|
31
|
+
// Local runtime entry points.
|
|
32
|
+
export { bootstrapRuntime } from './bootstrap.ts';
|
|
33
|
+
export type { RuntimeContext, BootstrapOptions } from './context.ts';
|
|
34
|
+
export type { BootstrapContext } from './bootstrap.ts';
|
|
35
|
+
export { createUiRuntimeServices } from './ui-services.ts';
|
|
36
|
+
export type { UiRuntimeServices } from './ui-services.ts';
|
|
37
|
+
|
|
38
|
+
export function createFeatureFlagManager(): FeatureFlagManager {
|
|
39
|
+
const manager = createSdkFeatureFlagManager();
|
|
40
|
+
const originalLoadFromConfig = manager.loadFromConfig.bind(manager);
|
|
41
|
+
|
|
42
|
+
manager.loadFromConfig = (config: FlagConfig): void => {
|
|
43
|
+
originalLoadFromConfig({
|
|
44
|
+
flags: Object.fromEntries(
|
|
45
|
+
Object.entries(config.flags).filter(([id]) => FEATURE_FLAG_MAP.has(id)),
|
|
46
|
+
) as FlagConfig['flags'],
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return manager;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Public SDK runtime seams.
|
|
54
|
+
export * from '@pellux/goodvibes-sdk/platform/runtime/state';
|
|
55
|
+
export * from '@pellux/goodvibes-sdk/platform/runtime/store';
|
|
56
|
+
export * from '@pellux/goodvibes-sdk/platform/runtime/ui';
|
|
57
|
+
export * from '@pellux/goodvibes-sdk/platform/runtime/observability';
|
|
58
|
+
export * from '@pellux/goodvibes-sdk/platform/runtime/settings';
|
|
59
|
+
export * from '@pellux/goodvibes-sdk/platform/runtime/sandbox';
|
|
60
|
+
export * from './sandbox-public-gaps.ts';
|
|
61
|
+
export {
|
|
62
|
+
CONTROL_PLANE_CLIENT_KINDS,
|
|
63
|
+
CONTROL_PLANE_TRANSPORT_KINDS,
|
|
64
|
+
ROUTE_SURFACE_KINDS,
|
|
65
|
+
SURFACE_KINDS,
|
|
66
|
+
registeredEventTypes,
|
|
67
|
+
validateKnownEvent as validateEvent,
|
|
68
|
+
} from '@pellux/goodvibes-sdk/events';
|
|
69
|
+
export type {
|
|
70
|
+
AgentEvent,
|
|
71
|
+
CommunicationEvent,
|
|
72
|
+
CompactionEvent,
|
|
73
|
+
DeliveryEvent,
|
|
74
|
+
McpEvent,
|
|
75
|
+
OpsEvent,
|
|
76
|
+
OpsInterventionReason,
|
|
77
|
+
OrchestrationEvent,
|
|
78
|
+
PermissionEvent,
|
|
79
|
+
PlannerEvent,
|
|
80
|
+
PluginEvent,
|
|
81
|
+
ProviderEvent,
|
|
82
|
+
RouteEvent,
|
|
83
|
+
SessionEvent,
|
|
84
|
+
TaskEvent,
|
|
85
|
+
ToolEvent,
|
|
86
|
+
TransportEvent,
|
|
87
|
+
TurnEvent,
|
|
88
|
+
WorkflowEvent,
|
|
89
|
+
} from '@pellux/goodvibes-sdk/events';
|
|
90
|
+
|
|
91
|
+
// Bootstrap compatibility aliases.
|
|
92
|
+
export const scheduleBackgroundMcpDiscovery = bootstrap.scheduleBackgroundMcpDiscovery;
|
|
93
|
+
export const startBackgroundProviderDiscovery = bootstrap.startBackgroundProviderDiscovery;
|
|
94
|
+
export const startBackgroundProviderRegistration = bootstrap.startBackgroundProviderDiscovery;
|
|
95
|
+
export const loadRuntimeSystemPrompt = bootstrap.loadRuntimeSystemPrompt;
|
|
96
|
+
export const loadBootstrapSystemPrompt = bootstrap.loadRuntimeSystemPrompt;
|
|
97
|
+
export const restoreRuntimeModel = bootstrap.restoreRuntimeModel;
|
|
98
|
+
export const restoreSavedModel = bootstrap.restoreRuntimeModel;
|
|
99
|
+
export const synchronizeConfiguredServices = bootstrap.synchronizeConfiguredServices;
|
|
100
|
+
export const syncConfiguredServices = bootstrap.synchronizeConfiguredServices;
|
|
101
|
+
export const registerBootstrapRuntimeEvents = bootstrap.registerBootstrapRuntimeEvents;
|
|
102
|
+
export const registerHostRuntimeEvents = bootstrap.registerHostRuntimeEvents;
|
|
103
|
+
function agentExternalHostStatus(
|
|
104
|
+
config: Bootstrap.HostServicesConfig,
|
|
105
|
+
service: 'daemon' | 'httpListener',
|
|
106
|
+
): Bootstrap.HostServiceStatus {
|
|
107
|
+
const hostKey = service === 'daemon' ? 'controlPlane.host' : 'httpListener.host';
|
|
108
|
+
const portKey = service === 'daemon' ? 'controlPlane.port' : 'httpListener.port';
|
|
109
|
+
const host = String(config.get(hostKey) ?? '127.0.0.1');
|
|
110
|
+
const port = Number(config.get(portKey) ?? (service === 'daemon' ? 3421 : 3422));
|
|
111
|
+
return {
|
|
112
|
+
mode: service === 'daemon' ? 'external' : 'disabled',
|
|
113
|
+
host,
|
|
114
|
+
port,
|
|
115
|
+
baseUrl: `http://${host}:${port}`,
|
|
116
|
+
reason: service === 'daemon'
|
|
117
|
+
? 'GoodVibes Agent connects to an externally managed GoodVibes daemon and does not start or restart it.'
|
|
118
|
+
: 'GoodVibes Agent does not own the HTTP listener lifecycle.',
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const startHostServices: typeof bootstrap.startHostServices = async (config) => ({
|
|
123
|
+
daemonServer: null,
|
|
124
|
+
httpListener: null,
|
|
125
|
+
daemonStatus: agentExternalHostStatus(config, 'daemon'),
|
|
126
|
+
httpListenerStatus: agentExternalHostStatus(config, 'httpListener'),
|
|
127
|
+
listRecentControlPlaneEvents: () => [],
|
|
128
|
+
async stop(): Promise<void> {},
|
|
129
|
+
});
|
|
130
|
+
export const startExternalServices = startHostServices;
|
|
131
|
+
export const registerBootstrapHookBridge = bootstrap.registerBootstrapHookBridge;
|
|
132
|
+
export const createDeferredStartupCoordinator = bootstrap.createDeferredStartupCoordinator;
|
|
133
|
+
export const shutdownRuntime = bootstrap.shutdownRuntime;
|
|
134
|
+
export const saveSession = bootstrap.saveSession;
|
|
135
|
+
export const fireSessionStart = bootstrap.fireSessionStart;
|
|
136
|
+
export const createDirectTransportServices = bootstrap.createDirectTransportServices;
|
|
137
|
+
export const createOperatorClientServices = bootstrap.createOperatorClientServices;
|
|
138
|
+
export const createPeerClientDependencies = bootstrap.createPeerClientDependencies;
|
|
139
|
+
export const createRuntimeFoundationClients = bootstrap.createRuntimeFoundationClients;
|
|
140
|
+
export const createOperatorClient = bootstrap.createOperatorClient;
|
|
141
|
+
export const createPeerClient = bootstrap.createPeerClient;
|
|
142
|
+
export const createRuntimeProviderApi = bootstrap.createRuntimeProviderApi;
|
|
143
|
+
export const createRuntimeKnowledgeApi = bootstrap.createRuntimeKnowledgeApi;
|
|
144
|
+
export const createRuntimeHookApi = bootstrap.createRuntimeHookApi;
|
|
145
|
+
export const createRuntimeMcpApi = bootstrap.createRuntimeMcpApi;
|
|
146
|
+
export const createRuntimeOpsApi = bootstrap.createRuntimeOpsApi;
|
|
147
|
+
|
|
148
|
+
export type BackgroundRuntimeTaskHandle = Bootstrap.BackgroundRuntimeTaskHandle;
|
|
149
|
+
export type BackgroundMcpDiscoveryOptions = Bootstrap.BackgroundMcpDiscoveryOptions;
|
|
150
|
+
export type BackgroundProviderDiscoveryOptions = Bootstrap.BackgroundProviderDiscoveryOptions;
|
|
151
|
+
export type HostSystemMessageSink = Bootstrap.HostSystemMessageSink;
|
|
152
|
+
export type RuntimeSelectionState = Bootstrap.RuntimeSelectionState;
|
|
153
|
+
export type RuntimeModelSelectionState = Bootstrap.RuntimeModelSelectionState;
|
|
154
|
+
export type BootstrapRuntimeEventBridgeOptions = Bootstrap.BootstrapRuntimeEventBridgeOptions;
|
|
155
|
+
export type HostRuntimeEventBridgeOptions = Bootstrap.HostRuntimeEventBridgeOptions;
|
|
156
|
+
export type HostRuntimeMessageRouter = Bootstrap.HostRuntimeMessageRouter;
|
|
157
|
+
export type HostServiceMode = Bootstrap.HostServiceMode;
|
|
158
|
+
export type HostServicesConfig = Bootstrap.HostServicesConfig;
|
|
159
|
+
export type HostServicesHandle = Bootstrap.HostServicesHandle;
|
|
160
|
+
export type ExternalServicesHandle = Bootstrap.HostServicesHandle;
|
|
161
|
+
export type HostServiceStatus = Bootstrap.HostServiceStatus;
|
|
162
|
+
export type HookBridgeRegistrationOptions = Bootstrap.HookBridgeRegistrationOptions;
|
|
163
|
+
export type DeferredStartupCoordinator = Bootstrap.DeferredStartupCoordinator;
|
|
164
|
+
export type DeferredStartupTask = Bootstrap.DeferredStartupTask;
|
|
165
|
+
export type DirectTransportServicesOptions = Bootstrap.DirectTransportServicesOptions;
|
|
166
|
+
export type DirectTransportServices = Bootstrap.DirectTransportServices;
|
|
167
|
+
export type OperatorClientServicesOptions = Bootstrap.OperatorClientServicesOptions;
|
|
168
|
+
export type OperatorClientServices = Bootstrap.OperatorClientServices;
|
|
169
|
+
export type OperatorClientReadModels = Bootstrap.OperatorClientReadModels;
|
|
170
|
+
export type RuntimeFoundationClients = Bootstrap.RuntimeFoundationClients;
|
|
171
|
+
export type RuntimeFoundationClientsOptions = Bootstrap.RuntimeFoundationClientsOptions;
|
|
172
|
+
export type OperatorClient = Bootstrap.OperatorClient;
|
|
173
|
+
export type PeerClient = Bootstrap.PeerClient;
|
|
174
|
+
export type OpsApi = Bootstrap.OpsApi;
|
|
175
|
+
|
|
176
|
+
// Transport compatibility aliases.
|
|
177
|
+
export const createDirectTransport = transport.createDirectTransport;
|
|
178
|
+
export const createDirectTransportFromServices = transport.createDirectTransportFromServices;
|
|
179
|
+
export const createRuntimeDirectTransport = transport.createRuntimeDirectTransport;
|
|
180
|
+
export const createDirectClientTransport = transport.createDirectClientTransport;
|
|
181
|
+
export const createHttpTransport = transport.createHttpTransport;
|
|
182
|
+
export const createClientTransport = transport.createClientTransport;
|
|
183
|
+
export const buildUrl = transport.buildUrl;
|
|
184
|
+
export const createTransportPaths = transport.createTransportPaths;
|
|
185
|
+
export const normalizeBaseUrl = transport.normalizeBaseUrl;
|
|
186
|
+
export const createFetch = transport.createFetch;
|
|
187
|
+
export const createHttpJsonTransport = transport.createHttpJsonTransport;
|
|
188
|
+
export const createJsonInit = transport.createJsonInit;
|
|
189
|
+
export const createJsonRequestInit = transport.createJsonRequestInit;
|
|
190
|
+
export const readJsonBody = transport.readJsonBody;
|
|
191
|
+
export const requestJsonRaw = transport.requestJsonRaw;
|
|
192
|
+
export const requestJson = transport.requestJsonRaw;
|
|
193
|
+
export const createRealtimeTransport = transport.createRealtimeTransport;
|
|
194
|
+
export const invokeContractRoute = transport.invokeContractRoute;
|
|
195
|
+
export const openContractRouteStream = transport.openContractRouteStream;
|
|
196
|
+
export const requireContractRoute = transport.requireContractRoute;
|
|
197
|
+
export const isAbortError = transport.isAbortError;
|
|
198
|
+
export const openServerSentEventStream = transport.openServerSentEventStream;
|
|
199
|
+
export const createOperatorRemoteClient = transport.createOperatorRemoteClient;
|
|
200
|
+
export const createPeerRemoteClient = transport.createPeerRemoteClient;
|
|
201
|
+
export const buildEventSourceUrl = transport.buildEventSourceUrl;
|
|
202
|
+
export const buildWebSocketUrl = transport.buildWebSocketUrl;
|
|
203
|
+
export const createEventSourceConnector = transport.createEventSourceConnector;
|
|
204
|
+
export const createRemoteDomainEvents = transport.createRemoteDomainEvents;
|
|
205
|
+
export const createRemoteRuntimeEvents = transport.createRemoteRuntimeEvents;
|
|
206
|
+
export const createRemoteUiRuntimeEvents = transport.createRemoteUiRuntimeEvents;
|
|
207
|
+
export const createWebSocketConnector = transport.createWebSocketConnector;
|
|
208
|
+
export const applyOutboundTlsToFetchInit = transport.applyOutboundTlsToFetchInit;
|
|
209
|
+
export const createNetworkFetch = transport.createNetworkFetch;
|
|
210
|
+
export const GlobalNetworkTransportInstaller = transport.GlobalNetworkTransportInstaller;
|
|
211
|
+
export const inspectOutboundTls = transport.inspectOutboundTls;
|
|
212
|
+
|
|
213
|
+
export type DirectTransport = Transport.DirectTransport;
|
|
214
|
+
export type DirectClientTransport<TOperator = unknown, TPeer = unknown> = Transport.DirectClientTransport<TOperator, TPeer>;
|
|
215
|
+
export type HttpTransport = Transport.HttpTransport;
|
|
216
|
+
export type HttpTransportOptions = Transport.HttpTransportOptions;
|
|
217
|
+
export type HttpTransportSnapshot = Transport.HttpTransportSnapshot;
|
|
218
|
+
export type ClientTransport<TKind extends string = string, TOperator = unknown, TPeer = unknown> = Transport.ClientTransport<TKind, TOperator, TPeer>;
|
|
219
|
+
export type TransportPaths = Transport.TransportPaths;
|
|
220
|
+
export type RealtimeTransport = Transport.RealtimeTransport;
|
|
221
|
+
export type RealtimeTransportOptions = Transport.RealtimeTransportOptions;
|
|
222
|
+
export type RealtimeTransportSnapshot = Transport.RealtimeTransportSnapshot;
|
|
223
|
+
export type HttpJsonRequestOptions = Transport.HttpJsonRequestOptions;
|
|
224
|
+
export type HttpJsonTransport = Transport.HttpJsonTransport;
|
|
225
|
+
export type HttpJsonTransportOptions = Transport.HttpJsonTransportOptions;
|
|
226
|
+
export type JsonObject = Transport.JsonObject;
|
|
227
|
+
export type JsonValue = Transport.JsonValue;
|
|
228
|
+
export type ResolvedContractRequest = Transport.ResolvedContractRequest;
|
|
229
|
+
export type TransportJsonError = Transport.TransportJsonError;
|
|
230
|
+
export type ContractInvokeOptions = Transport.ContractInvokeOptions;
|
|
231
|
+
export type ContractRouteDefinition = Transport.ContractRouteDefinition;
|
|
232
|
+
export type ContractRouteLike = Transport.ContractRouteLike;
|
|
233
|
+
export type ContractStreamOptions = Transport.ContractStreamOptions;
|
|
234
|
+
export type ServerSentEventHandlers = Transport.ServerSentEventHandlers;
|
|
235
|
+
export type ServerSentEventOptions = Transport.ServerSentEventOptions;
|
|
236
|
+
export type OperatorRemoteClient = Transport.OperatorRemoteClient;
|
|
237
|
+
export type OperatorRemoteClientInvokeOptions = Transport.OperatorRemoteClientInvokeOptions;
|
|
238
|
+
export type OperatorRemoteClientStreamOptions = Transport.OperatorRemoteClientStreamOptions;
|
|
239
|
+
export type PeerRemoteClient = Transport.PeerRemoteClient;
|
|
240
|
+
export type PeerRemoteClientInvokeOptions = Transport.PeerRemoteClientInvokeOptions;
|
|
241
|
+
export type DomainEventConnector<TDomain extends string = string, TEvent extends { readonly type: string } = { readonly type: string }> = Transport.DomainEventConnector<TDomain, TEvent>;
|
|
242
|
+
export type RemoteDomainEventsOptions = Transport.RemoteDomainEventsOptions;
|
|
243
|
+
export type RemoteDomainEvents<TDomain extends string = string, TEvent extends { readonly type: string } = { readonly type: string }> = Transport.RemoteDomainEvents<TDomain, TEvent>;
|
|
244
|
+
export type RemoteRuntimeEventsOptions = Transport.RemoteRuntimeEventsOptions;
|
|
245
|
+
export type RemoteRuntimeEvents = Transport.RemoteRuntimeEvents;
|
|
246
|
+
export type SerializedRuntimeEnvelope = Transport.SerializedRuntimeEnvelope;
|
|
247
|
+
|
|
248
|
+
// Operations compatibility aliases.
|
|
249
|
+
export const AcpTaskAdapter = operations.AcpTaskAdapter;
|
|
250
|
+
export const OpsControlPlane = operations.OpsControlPlane;
|
|
251
|
+
export const OpsIllegalActionError = operations.OpsIllegalActionError;
|
|
252
|
+
export const OpsTargetNotFoundError = operations.OpsTargetNotFoundError;
|
|
253
|
+
export const ToolContractVerifier = operations.ToolContractVerifier;
|
|
254
|
+
export const McpLifecycleManager = operations.McpLifecycleManager;
|
|
255
|
+
export const McpPermissionManager = operations.McpPermissionManager;
|
|
256
|
+
export const McpSchemaFreshnessTracker = operations.McpSchemaFreshnessTracker;
|
|
257
|
+
export const buildMcpAttackPathReview = operations.buildMcpAttackPathReview;
|
|
258
|
+
export const createMcpLifecycleManager = operations.createMcpLifecycleManager;
|
|
259
|
+
export const DEFAULT_RECONNECT_CONFIG = operations.DEFAULT_RECONNECT_CONFIG;
|
|
260
|
+
export const ALL_CAPABILITIES = operations.ALL_CAPABILITIES;
|
|
261
|
+
export const PLUGIN_CAPABILITIES = operations.PLUGIN_CAPABILITIES;
|
|
262
|
+
export const HIGH_RISK_CAPABILITIES = operations.HIGH_RISK_CAPABILITIES;
|
|
263
|
+
export const PluginLifecycleManager = operations.PluginLifecycleManager;
|
|
264
|
+
export const PluginQuarantineEngine = operations.PluginQuarantineEngine;
|
|
265
|
+
export const PluginTrustStore = operations.PluginTrustStore;
|
|
266
|
+
export const SAFE_CAPABILITIES = operations.SAFE_CAPABILITIES;
|
|
267
|
+
export const filterCapabilitiesByTrust = operations.filterCapabilitiesByTrust;
|
|
268
|
+
export const hasCapability = operations.hasCapability;
|
|
269
|
+
export const isHighRiskCapability = operations.isHighRiskCapability;
|
|
270
|
+
export const isPluginOperational = operations.isPluginOperational;
|
|
271
|
+
export const isPluginReloadable = operations.isPluginReloadable;
|
|
272
|
+
export const isPluginTerminal = operations.isPluginTerminal;
|
|
273
|
+
export const resolveCapabilityManifest = operations.resolveCapabilityManifest;
|
|
274
|
+
export const validateManifestV2 = operations.validateManifestV2;
|
|
275
|
+
export const validatePluginSignature = operations.validatePluginSignature;
|
|
276
|
+
export const LOW_QUALITY_THRESHOLD = operations.LOW_QUALITY_THRESHOLD;
|
|
277
|
+
export const computeQualityScore = operations.computeQualityScore;
|
|
278
|
+
export const createCompactionManager = operations.createCompactionManager;
|
|
279
|
+
export const describeScore = operations.describeScore;
|
|
280
|
+
export const escalateStrategy = operations.escalateStrategy;
|
|
281
|
+
export const isTerminalCompactionState = operations.isTerminalCompactionState;
|
|
282
|
+
export const reachableFromCompactionState = operations.reachableFromCompactionState;
|
|
283
|
+
export const compactionFailurePlaybook = operations.compactionFailurePlaybook;
|
|
284
|
+
export const exportRecoveryPlaybook = operations.exportRecoveryPlaybook;
|
|
285
|
+
export const permissionDeadlockPlaybook = operations.permissionDeadlockPlaybook;
|
|
286
|
+
export const pluginDegradationPlaybook = operations.pluginDegradationPlaybook;
|
|
287
|
+
export const reconnectFailurePlaybook = operations.reconnectFailurePlaybook;
|
|
288
|
+
export const sessionUnrecoverablePlaybook = operations.sessionUnrecoverablePlaybook;
|
|
289
|
+
export const stuckTurnPlaybook = operations.stuckTurnPlaybook;
|
|
290
|
+
export const createSessionUnrecoverablePlaybook = operations.createSessionUnrecoverablePlaybook;
|
|
291
|
+
export const createStuckTurnPlaybook = operations.createStuckTurnPlaybook;
|
|
292
|
+
export const evaluateOrchestrationSpawn = operations.evaluateOrchestrationSpawn;
|
|
293
|
+
export const TRANSPORT_COMPATIBILITY_MATRIX = operations.TRANSPORT_COMPATIBILITY_MATRIX;
|
|
294
|
+
export const applyTransition = operations.applyTransition;
|
|
295
|
+
export const canTransition = operations.canTransition;
|
|
296
|
+
export const isOperational = operations.isOperational;
|
|
297
|
+
export const isReloadable = operations.isReloadable;
|
|
298
|
+
export const isTerminal = operations.isTerminal;
|
|
299
|
+
export const reachableFrom = operations.reachableFrom;
|
|
300
|
+
export const evaluateSessionMaintenance = operations.evaluateSessionMaintenance;
|
|
301
|
+
export const formatSessionMaintenanceLines = operations.formatSessionMaintenanceLines;
|
|
302
|
+
export const getGuidanceMode = operations.getGuidanceMode;
|
|
303
|
+
export const DEFAULT_RETENTION_CONFIG = operations.DEFAULT_RETENTION_CONFIG;
|
|
304
|
+
export const RetentionPolicy = operations.RetentionPolicy;
|
|
305
|
+
export const SnapshotPruner = operations.SnapshotPruner;
|
|
306
|
+
export const buildPersistedSessionContext = operations.buildPersistedSessionContext;
|
|
307
|
+
export const buildLocalReturnContextSummary = operations.buildLocalReturnContextSummary;
|
|
308
|
+
export const formatReturnContextForDisplay = operations.formatReturnContextForDisplay;
|
|
309
|
+
export const getReturnContextMode = operations.getReturnContextMode;
|
|
310
|
+
export const maybeAssistReturnContextSummary = operations.maybeAssistReturnContextSummary;
|
|
311
|
+
export const persistConversation = operations.persistConversation;
|
|
312
|
+
export const generateUserSessionId = operations.generateUserSessionId;
|
|
313
|
+
export const loadLastConversation = operations.loadLastConversation;
|
|
314
|
+
export const loadRecoveryConversation = operations.loadRecoveryConversation;
|
|
315
|
+
export const writeRecoveryFile = operations.writeRecoveryFile;
|
|
316
|
+
export const deleteRecoveryFile = operations.deleteRecoveryFile;
|
|
317
|
+
export const checkRecoveryFile = operations.checkRecoveryFile;
|
|
318
|
+
export const getRecoveryFilePath = operations.getRecoveryFilePath;
|
|
319
|
+
export const getLastSessionPointerPath = operations.getLastSessionPointerPath;
|
|
320
|
+
export const writeLastSessionPointer = operations.writeLastSessionPointer;
|
|
321
|
+
export const readLastSessionPointer = operations.readLastSessionPointer;
|
|
322
|
+
export const exportRemoteArtifactForAgent = operations.exportRemoteArtifactForAgent;
|
|
323
|
+
export const importRemoteArtifact = operations.importRemoteArtifact;
|
|
324
|
+
export const RemoteRunnerRegistry = operations.RemoteRunnerRegistry;
|
|
325
|
+
export const RemoteSupervisor = operations.RemoteSupervisor;
|
|
326
|
+
export const DistributedRuntimeManager = operations.DistributedRuntimeManager;
|
|
327
|
+
export const getDistributedNodeHostContract = operations.getDistributedNodeHostContract;
|
|
328
|
+
export const CURRENT_PROTOCOL_VERSION = operations.CURRENT_PROTOCOL_VERSION;
|
|
329
|
+
export const VersionMismatchError = operations.VersionMismatchError;
|
|
330
|
+
export const negotiateProtocolVersion = operations.negotiateProtocolVersion;
|
|
331
|
+
export const createTaskManager = operations.createTaskManager;
|
|
332
|
+
export const PhasedToolExecutor = operations.PhasedToolExecutor;
|
|
333
|
+
export const budgetPhase = operations.budgetPhase;
|
|
334
|
+
export const permissionPhase = operations.permissionPhase;
|
|
335
|
+
|
|
336
|
+
export type RemoteSessionBundle = Operations.RemoteSessionBundle;
|
|
337
|
+
export type ContractVerifierOptions = Operations.ContractVerifierOptions;
|
|
338
|
+
export type McpAttackPathFinding = Operations.McpAttackPathFinding;
|
|
339
|
+
export type McpAttackPathFindingKind = Operations.McpAttackPathFindingKind;
|
|
340
|
+
export type McpAttackPathReview = Operations.McpAttackPathReview;
|
|
341
|
+
export type McpCapabilityClass = Operations.McpCapabilityClass;
|
|
342
|
+
export type McpCoherenceAssessment = Operations.McpCoherenceAssessment;
|
|
343
|
+
export type McpCoherenceVerdict = Operations.McpCoherenceVerdict;
|
|
344
|
+
export type McpDecisionRecord = Operations.McpDecisionRecord;
|
|
345
|
+
export type McpEventHandler = Operations.McpEventHandler;
|
|
346
|
+
export type McpLifecycleManagerOptions = Operations.McpLifecycleManagerOptions;
|
|
347
|
+
export type McpPermission = Operations.McpPermission;
|
|
348
|
+
export type McpReconnectConfig = Operations.McpReconnectConfig;
|
|
349
|
+
export type McpRiskLevel = Operations.McpRiskLevel;
|
|
350
|
+
export type McpSchemaRecord = Operations.McpSchemaRecord;
|
|
351
|
+
export type McpSecuritySnapshot = Operations.McpSecuritySnapshot;
|
|
352
|
+
export type McpServerEntry = Operations.McpServerEntry;
|
|
353
|
+
export type McpServerPermissions = Operations.McpServerPermissions;
|
|
354
|
+
export type McpServerRole = Operations.McpServerRole;
|
|
355
|
+
export type McpServerState = Operations.McpServerState;
|
|
356
|
+
export type McpToolPermission = Operations.McpToolPermission;
|
|
357
|
+
export type McpTrustLevel = Operations.McpTrustLevel;
|
|
358
|
+
export type McpTrustMode = Operations.McpTrustMode;
|
|
359
|
+
export type McpTrustProfile = Operations.McpTrustProfile;
|
|
360
|
+
export type QuarantineReason = Operations.QuarantineReason;
|
|
361
|
+
export type QuarantineRecord = Operations.QuarantineRecord;
|
|
362
|
+
export type SchemaFreshness = Operations.SchemaFreshness;
|
|
363
|
+
export type PluginCapability = Operations.PluginCapability;
|
|
364
|
+
export type PluginCapabilityManifest = Operations.PluginCapabilityManifest;
|
|
365
|
+
export type PluginManifestV2 = Operations.PluginManifestV2;
|
|
366
|
+
export type PluginTrustTier = Operations.PluginTrustTier;
|
|
367
|
+
export type CompactionQualityScore = Operations.CompactionQualityScore;
|
|
368
|
+
export type CompactionStrategy = Operations.CompactionStrategy;
|
|
369
|
+
export type StrategyInput = Operations.StrategyInput;
|
|
370
|
+
export type StrategyOutput = Operations.StrategyOutput;
|
|
371
|
+
export type DistributedRuntimeSnapshotStore = Operations.DistributedRuntimeSnapshotStore;
|
|
372
|
+
export type RemoteRunnerRegistry = Operations.RemoteRunnerRegistry;
|
|
373
|
+
export type RemoteSupervisor = Operations.RemoteSupervisor;
|
|
374
|
+
export type DistributedRuntimeManager = Operations.DistributedRuntimeManager;
|
|
375
|
+
export type OpsControlPlane = Operations.OpsControlPlane;
|
|
376
|
+
export type RuntimeTransitionResult = Operations.RuntimeTransitionResult;
|
|
377
|
+
export type RetentionClass = Operations.RetentionClass;
|
|
378
|
+
export type RetentionClassConfig = Operations.RetentionClassConfig;
|
|
379
|
+
export type RetentionConfig = Operations.RetentionConfig;
|
|
380
|
+
export type CheckpointRecord = Operations.CheckpointRecord;
|
|
381
|
+
export type PruneOptions = Operations.PruneOptions;
|
|
382
|
+
export type PruneResult = Operations.PruneResult;
|
|
383
|
+
export type PerClassPruneResult = Operations.PerClassPruneResult;
|
|
384
|
+
export type Pruner = Operations.Pruner;
|
|
385
|
+
export type RetentionStats = Operations.RetentionStats;
|
|
386
|
+
export type SessionReturnContextSummary = Operations.SessionReturnContextSummary;
|
|
387
|
+
export type SessionSnapshot = Operations.SessionSnapshot;
|
|
388
|
+
export type RemoteSupervisorSnapshot = Operations.RemoteSupervisorSnapshot;
|
|
389
|
+
export type DistributedPeerKind = Operations.DistributedPeerKind;
|
|
390
|
+
export type DistributedPairRequestStatus = Operations.DistributedPairRequestStatus;
|
|
391
|
+
export type DistributedPeerStatus = Operations.DistributedPeerStatus;
|
|
392
|
+
export type DistributedWorkPriority = Operations.DistributedWorkPriority;
|
|
393
|
+
export type DistributedWorkStatus = Operations.DistributedWorkStatus;
|
|
394
|
+
export type DistributedWorkType = Operations.DistributedWorkType;
|
|
395
|
+
export type DistributedSessionBridge = Operations.DistributedSessionBridge;
|
|
396
|
+
export type DistributedApprovalBridge = Operations.DistributedApprovalBridge;
|
|
397
|
+
export type DistributedAutomationBridge = Operations.DistributedAutomationBridge;
|
|
398
|
+
export type DistributedRuntimePairRequest = Operations.DistributedRuntimePairRequest;
|
|
399
|
+
export type DistributedPeerTokenRecord = Operations.DistributedPeerTokenRecord;
|
|
400
|
+
export type DistributedPeerRecord = Operations.DistributedPeerRecord;
|
|
401
|
+
export type DistributedPendingWork = Operations.DistributedPendingWork;
|
|
402
|
+
export type DistributedRuntimeAuditRecord = Operations.DistributedRuntimeAuditRecord;
|
|
403
|
+
export type DistributedPeerAuth = Operations.DistributedPeerAuth;
|
|
404
|
+
export type DistributedNodeHostContract = Operations.DistributedNodeHostContract;
|
|
405
|
+
export type TaskManager = Operations.TaskManager;
|
|
406
|
+
export type TaskHooks = Operations.TaskHooks;
|
|
407
|
+
export type ToolRuntimeContext = Operations.ToolRuntimeContext;
|
|
408
|
+
export type RuntimeStoreAccess = Operations.RuntimeStoreAccess;
|
|
409
|
+
export type ToolExecutionPhase = Operations.ToolExecutionPhase;
|
|
410
|
+
export type PhaseResult = Operations.PhaseResult;
|
|
411
|
+
export type ToolExecutionRecord = Operations.ToolExecutionRecord;
|
|
412
|
+
|
|
413
|
+
// Runtime shell compatibility aliases.
|
|
414
|
+
export const createShellPathService = shell.createShellPathService;
|
|
415
|
+
export const createShellPlanRuntime = shell.createShellPlanRuntime;
|
|
416
|
+
export const createShellRemoteCommandService = shell.createShellRemoteCommandService;
|
|
417
|
+
export const createBootstrapCommandShellServices = shell.createBootstrapCommandShellServices;
|
|
418
|
+
export const resolveSurfaceDirectory = shell.resolveSurfaceDirectory;
|
|
419
|
+
export const classifySystemMessageKind = shell.classifySystemMessageKind;
|
|
420
|
+
export const classifySystemMessagePriority = shell.classifySystemMessagePriority;
|
|
421
|
+
export const defaultSystemMessageTarget = shell.defaultSystemMessageTarget;
|
|
422
|
+
export const resolveSystemMessageDelivery = shell.resolveSystemMessageDelivery;
|
|
423
|
+
export const buildProviderAccountSnapshot = shell.buildProviderAccountSnapshot;
|
|
424
|
+
export const loadEcosystemCatalog = shell.loadEcosystemCatalog;
|
|
425
|
+
export const searchEcosystemCatalog = shell.searchEcosystemCatalog;
|
|
426
|
+
export const exportEcosystemCatalogBundle = shell.exportEcosystemCatalogBundle;
|
|
427
|
+
export const importEcosystemCatalogBundle = shell.importEcosystemCatalogBundle;
|
|
428
|
+
export const inspectEcosystemCatalogBundle = shell.inspectEcosystemCatalogBundle;
|
|
429
|
+
export const inspectInstalledEcosystemEntry = shell.inspectInstalledEcosystemEntry;
|
|
430
|
+
export const installEcosystemCatalogEntry = shell.installEcosystemCatalogEntry;
|
|
431
|
+
export const listEcosystemInstallBackups = shell.listEcosystemInstallBackups;
|
|
432
|
+
export const listInstalledEcosystemEntries = shell.listInstalledEcosystemEntries;
|
|
433
|
+
export const removeEcosystemCatalogEntry = shell.removeEcosystemCatalogEntry;
|
|
434
|
+
export const reviewEcosystemCatalogEntry = shell.reviewEcosystemCatalogEntry;
|
|
435
|
+
export const rollbackInstalledEcosystemEntry = shell.rollbackInstalledEcosystemEntry;
|
|
436
|
+
export const uninstallEcosystemCatalogEntry = shell.uninstallEcosystemCatalogEntry;
|
|
437
|
+
export const updateInstalledEcosystemEntry = shell.updateInstalledEcosystemEntry;
|
|
438
|
+
export const upsertEcosystemCatalogEntry = shell.upsertEcosystemCatalogEntry;
|
|
439
|
+
export const summarizeWorktreeOwnership = shell.summarizeWorktreeOwnership;
|
|
440
|
+
export const WorktreeRegistry = shell.WorktreeRegistry;
|
|
441
|
+
export const listPersistedWorktreeMeta = shell.listPersistedWorktreeMeta;
|
|
442
|
+
export const getPersistedWorktreeMeta = shell.getPersistedWorktreeMeta;
|
|
443
|
+
export const reviewWorktreeAttachments = shell.reviewWorktreeAttachments;
|
|
444
|
+
|
|
445
|
+
export type MutableRuntimeState = Shell.MutableRuntimeState;
|
|
446
|
+
export type ProviderAccountRecord = Shell.ProviderAccountRecord;
|
|
447
|
+
export type ProviderAccountSnapshot = Shell.ProviderAccountSnapshot;
|
|
448
|
+
export type ProviderAuthFreshness = Shell.ProviderAuthFreshness;
|
|
449
|
+
export type ProviderAuthRoute = Shell.ProviderAuthRoute;
|
|
450
|
+
export type ShellPathService = Shell.ShellPathService;
|
|
451
|
+
export type BootstrapCommandShellServices = Shell.BootstrapCommandShellServices;
|
|
452
|
+
export type CommandExtensionShellServices = Shell.CommandExtensionShellServices;
|
|
453
|
+
export type CommandOpsShellServices = Shell.CommandOpsShellServices;
|
|
454
|
+
export type CommandPlatformShellServices = Shell.CommandPlatformShellServices;
|
|
455
|
+
export type CommandWorkspaceShellServices = Shell.CommandWorkspaceShellServices;
|
|
456
|
+
export type RemoteCommandService = Shell.RemoteCommandService;
|
|
457
|
+
export type PlanRuntimeService = Shell.PlanRuntimeService;
|
|
458
|
+
export type WorktreeRegistry = Shell.WorktreeRegistry;
|
|
459
|
+
export type WorktreeStatusRecord = Shell.WorktreeStatusRecord;
|
|
460
|
+
export type ManagedWorktreeMeta = Shell.ManagedWorktreeMeta;
|
|
461
|
+
export type ShellAgentManagerService = Shell.ShellAgentManagerService;
|
|
462
|
+
export type ShellAcpManagerService = Shell.ShellAcpManagerService;
|
|
463
|
+
export type ShellAutomationManagerService = Shell.ShellAutomationManagerService;
|
|
464
|
+
export type ShellAutomationManagerRuntimeService = Shell.ShellAutomationManagerRuntimeService;
|
|
465
|
+
export type ShellModeManagerService = Shell.ShellModeManagerService;
|
|
466
|
+
export type ShellPlanManagerService = Shell.ShellPlanManagerService;
|
|
467
|
+
export type ShellSessionOrchestrationService = Shell.ShellSessionOrchestrationService;
|
|
468
|
+
export type SystemMessageKind = Shell.SystemMessageKind;
|
|
469
|
+
export type SystemMessageTarget = Shell.SystemMessageTarget;
|
|
470
|
+
export type EcosystemCatalogPathOptions = Shell.EcosystemCatalogPathOptions;
|
|
471
|
+
export type EcosystemCatalogBundle = Shell.EcosystemCatalogBundle;
|
|
472
|
+
export type EcosystemCatalogEntry = Shell.EcosystemCatalogEntry;
|
|
473
|
+
export type EcosystemEntryKind = Shell.EcosystemEntryKind;
|
|
474
|
+
|
|
475
|
+
// Runtime security compatibility aliases.
|
|
476
|
+
export const buildAuthInspectionSnapshot = security.buildAuthInspectionSnapshot;
|
|
477
|
+
export const inspectProviderAuth = security.inspectProviderAuth;
|
|
478
|
+
export const DivergenceDashboard = security.DivergenceDashboard;
|
|
479
|
+
export const DivergenceGateError = security.DivergenceGateError;
|
|
480
|
+
export const LayeredPolicyEvaluator = security.LayeredPolicyEvaluator;
|
|
481
|
+
export const PermissionSimulator = security.PermissionSimulator;
|
|
482
|
+
export const PolicyRegistry = security.PolicyRegistry;
|
|
483
|
+
export const PolicyRuntimeState = security.PolicyRuntimeState;
|
|
484
|
+
export const buildDefaultPolicySimulationScenarios = security.buildDefaultPolicySimulationScenarios;
|
|
485
|
+
export const buildPermissionRuleSuggestions = security.buildPermissionRuleSuggestions;
|
|
486
|
+
export const buildPolicyPreflightReview = security.buildPolicyPreflightReview;
|
|
487
|
+
export const createPermissionEvaluator = security.createPermissionEvaluator;
|
|
488
|
+
export const createPermissionSimulator = security.createPermissionSimulator;
|
|
489
|
+
export const createUnsignedBundle = security.createUnsignedBundle;
|
|
490
|
+
export const lintPolicyConfig = security.lintPolicyConfig;
|
|
491
|
+
export const loadPolicyBundle = security.loadPolicyBundle;
|
|
492
|
+
export const runPolicySimulationScenarios = security.runPolicySimulationScenarios;
|
|
493
|
+
export const buildDenialExplanation = security.buildDenialExplanation;
|
|
494
|
+
export const canonicalize = security.canonicalize;
|
|
495
|
+
export const classifyCommand = security.classifyCommand;
|
|
496
|
+
export const classifySegment = security.classifySegment;
|
|
497
|
+
export const collectCommandNodes = security.collectCommandNodes;
|
|
498
|
+
export const evaluateCommandAST = security.evaluateCommandAST;
|
|
499
|
+
export const evaluateSegmentNode = security.evaluateSegmentNode;
|
|
500
|
+
export const higherPriority = security.higherPriority;
|
|
501
|
+
export const parseAST = security.parseAST;
|
|
502
|
+
export const parseCommandAST = security.parseCommandAST;
|
|
503
|
+
export const tokenize = security.tokenize;
|
|
504
|
+
export const PolicySignatureError = security.PolicySignatureError;
|
|
505
|
+
export const canonicalise = security.canonicalise;
|
|
506
|
+
export const runSafetyChecks = security.runSafetyChecks;
|
|
507
|
+
export const signBundle = security.signBundle;
|
|
508
|
+
export const verifyBundle = security.verifyBundle;
|
|
509
|
+
export const MAX_INPUT_LENGTH = security.MAX_INPUT_LENGTH;
|
|
510
|
+
export const MAX_TOKEN_COUNT = security.MAX_TOKEN_COUNT;
|
|
511
|
+
|
|
512
|
+
export type AuthInspectionSnapshot = Security.AuthInspectionSnapshot;
|
|
513
|
+
export type ProviderAuthInspection = Security.ProviderAuthInspection;
|
|
514
|
+
export type DivergenceDashboardSnapshot = Security.DivergenceDashboardSnapshot;
|
|
515
|
+
export type DivergenceStats = Security.DivergenceStats;
|
|
516
|
+
export type PermissionsConfig = Security.PermissionsConfig;
|
|
517
|
+
export type PolicyBundlePayload = Security.PolicyBundlePayload;
|
|
518
|
+
export type PolicyBundleVersion = Security.PolicyBundleVersion;
|
|
519
|
+
export type PolicyDiffResult = Security.PolicyDiffResult;
|
|
520
|
+
export type PolicyLintFinding = Security.PolicyLintFinding;
|
|
521
|
+
export type PolicyPreflightReview = Security.PolicyPreflightReview;
|
|
522
|
+
export type PolicyRule = Security.PolicyRule;
|
|
523
|
+
export type PolicyRegistry = Security.PolicyRegistry;
|
|
524
|
+
export type PolicyRuntimeState = Security.PolicyRuntimeState;
|
|
525
|
+
export type PolicySimulationSummary = Security.PolicySimulationSummary;
|
|
526
|
+
export type PermissionAuditEntry = Security.PermissionAuditEntry;
|
|
527
|
+
export type CommandClassification = Security.CommandClassification;
|
|
528
|
+
export type CommandNode = Security.CommandNode;
|
|
529
|
+
export type CommandSegment = Security.CommandSegment;
|
|
530
|
+
export type CommandToken = Security.CommandToken;
|
|
531
|
+
export type PipeNode = Security.PipeNode;
|
|
532
|
+
export type SequenceNode = Security.SequenceNode;
|
|
533
|
+
export type SubshellNode = Security.SubshellNode;
|
|
534
|
+
export type BundleProvenance = Security.BundleProvenance;
|
|
535
|
+
export type DecisionReason = Security.DecisionReason;
|
|
536
|
+
export type DivergenceReport = Security.DivergenceReport;
|
|
537
|
+
export type EnforceGateResult = Security.EnforceGateResult;
|
|
538
|
+
export type SignedPolicyBundle = Security.SignedPolicyBundle;
|
|
539
|
+
|
|
540
|
+
export interface InspectableDomain {
|
|
541
|
+
readonly name: string;
|
|
542
|
+
getState(): Record<string, unknown>;
|
|
543
|
+
getRevision(): number;
|
|
544
|
+
getLastUpdatedAt(): number;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export type InboundTlsMode = 'off' | 'proxy' | 'direct';
|
|
548
|
+
export type InboundServerSurface = 'controlPlane' | 'httpListener';
|
|
549
|
+
|
|
550
|
+
export interface InboundTlsSnapshot {
|
|
551
|
+
readonly surface: InboundServerSurface;
|
|
552
|
+
readonly host: string;
|
|
553
|
+
readonly port: number;
|
|
554
|
+
readonly mode: InboundTlsMode;
|
|
555
|
+
readonly scheme: 'http' | 'https';
|
|
556
|
+
readonly trustProxy: boolean;
|
|
557
|
+
readonly certFile?: string | undefined;
|
|
558
|
+
readonly keyFile?: string | undefined;
|
|
559
|
+
readonly usingDefaultPaths: boolean;
|
|
560
|
+
readonly ready: boolean;
|
|
561
|
+
readonly errors: readonly string[];
|
|
562
|
+
readonly keyPermissions?: {
|
|
563
|
+
readonly available: boolean;
|
|
564
|
+
readonly safe?: boolean | undefined;
|
|
565
|
+
readonly mode?: string | undefined;
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
interface InboundTlsConfigReader {
|
|
570
|
+
get(path: string): unknown;
|
|
571
|
+
getControlPlaneConfigDir(): string;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
function readString(value: unknown): string {
|
|
575
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
function readNumber(value: unknown, fallback: number): number {
|
|
579
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : fallback;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
function readBoolean(value: unknown): boolean {
|
|
583
|
+
return value === true;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
function resolveGoodVibesRoot(configManager: Pick<InboundTlsConfigReader, 'getControlPlaneConfigDir'>): string {
|
|
587
|
+
return resolve(configManager.getControlPlaneConfigDir());
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
function resolvePathFromGoodVibesRoot(value: string | null | undefined, configManager: Pick<InboundTlsConfigReader, 'getControlPlaneConfigDir'>): string | null {
|
|
591
|
+
const trimmed = typeof value === 'string' ? value.trim() : '';
|
|
592
|
+
if (!trimmed) return null;
|
|
593
|
+
if (trimmed.startsWith('/')) return trimmed;
|
|
594
|
+
return resolve(resolveGoodVibesRoot(configManager), trimmed);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
function getDefaultInboundCertPaths(configManager: Pick<InboundTlsConfigReader, 'getControlPlaneConfigDir'>): { readonly certFile: string; readonly keyFile: string } {
|
|
598
|
+
const certDir = join(resolveGoodVibesRoot(configManager), 'certs');
|
|
599
|
+
return {
|
|
600
|
+
certFile: join(certDir, 'fullchain.pem'),
|
|
601
|
+
keyFile: join(certDir, 'privkey.pem'),
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
function inspectPrivateKeyPermissions(path: string): { readonly available: boolean; readonly safe?: boolean | undefined; readonly mode?: string | undefined } {
|
|
606
|
+
try {
|
|
607
|
+
const stats = statSync(path);
|
|
608
|
+
if (process.platform === 'win32') return { available: true };
|
|
609
|
+
const mode = stats.mode & 0o777;
|
|
610
|
+
return {
|
|
611
|
+
available: true,
|
|
612
|
+
safe: (mode & 0o077) === 0,
|
|
613
|
+
mode: mode.toString(8).padStart(4, '0'),
|
|
614
|
+
};
|
|
615
|
+
} catch {
|
|
616
|
+
return { available: false };
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
export function extractForwardedClientIp(req: Request, trustProxy: boolean): string | undefined {
|
|
621
|
+
if (!trustProxy) return undefined;
|
|
622
|
+
const forwardedFor = req.headers.get('x-forwarded-for');
|
|
623
|
+
const firstForwarded = forwardedFor?.split(',')[0]?.trim();
|
|
624
|
+
if (firstForwarded) return firstForwarded;
|
|
625
|
+
return req.headers.get('x-real-ip')?.trim() || undefined;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
export function inspectInboundTls(configManager: InboundTlsConfigReader, surface: InboundServerSurface): InboundTlsSnapshot {
|
|
629
|
+
const prefix = surface === 'controlPlane' ? 'controlPlane' : 'httpListener';
|
|
630
|
+
const defaultPort = surface === 'controlPlane' ? 3421 : 3422;
|
|
631
|
+
const mode = (readString(configManager.get(`${prefix}.tls.mode`)) || 'off') as InboundTlsMode;
|
|
632
|
+
const trustProxy = readBoolean(configManager.get(`${prefix}.trustProxy`));
|
|
633
|
+
const host = readString(configManager.get(`${prefix}.host`)) || '127.0.0.1';
|
|
634
|
+
const port = readNumber(configManager.get(`${prefix}.port`), defaultPort);
|
|
635
|
+
const defaults = getDefaultInboundCertPaths(configManager);
|
|
636
|
+
const explicitCert = resolvePathFromGoodVibesRoot(readString(configManager.get(`${prefix}.tls.certFile`)), configManager);
|
|
637
|
+
const explicitKey = resolvePathFromGoodVibesRoot(readString(configManager.get(`${prefix}.tls.keyFile`)), configManager);
|
|
638
|
+
const certFile = explicitCert ?? defaults.certFile;
|
|
639
|
+
const keyFile = explicitKey ?? defaults.keyFile;
|
|
640
|
+
const usingDefaultPaths = explicitCert === null && explicitKey === null;
|
|
641
|
+
const errors: string[] = [];
|
|
642
|
+
|
|
643
|
+
if (mode === 'direct') {
|
|
644
|
+
if (!existsSync(certFile)) errors.push(`Certificate file not found: ${certFile}`);
|
|
645
|
+
if (!existsSync(keyFile)) errors.push(`Private key file not found: ${keyFile}`);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
const keyPermissions = mode === 'direct' ? inspectPrivateKeyPermissions(keyFile) : undefined;
|
|
649
|
+
return {
|
|
650
|
+
surface,
|
|
651
|
+
host,
|
|
652
|
+
port,
|
|
653
|
+
mode,
|
|
654
|
+
scheme: mode === 'off' ? 'http' : 'https',
|
|
655
|
+
trustProxy,
|
|
656
|
+
...(mode === 'direct' ? { certFile, keyFile } : {}),
|
|
657
|
+
usingDefaultPaths,
|
|
658
|
+
ready: mode === 'off' || mode === 'proxy' || errors.length === 0,
|
|
659
|
+
errors,
|
|
660
|
+
...(keyPermissions ? { keyPermissions } : {}),
|
|
661
|
+
};
|
|
662
|
+
}
|