@pellux/goodvibes-tui 1.27.1 → 2.0.2
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 +127 -2
- package/README.md +7 -9
- package/bin/goodvibes +2 -2
- package/bin/launcher-support.js +8 -4
- package/docs/README.md +11 -2
- package/docs/foundation-artifacts/operator-contract.json +6403 -2347
- package/package.json +14 -25
- package/scripts/postinstall.js +35 -35
- package/src/audio/spoken-turn-model-routing.ts +1 -1
- package/src/cli/bundle-command.ts +5 -5
- package/src/cli/completions/generate.ts +1 -1
- package/src/cli/doctor.ts +3 -3
- package/src/cli/entrypoint.ts +12 -7
- package/src/cli/help.ts +4 -5
- package/src/cli/hooks-command.ts +1 -1
- package/src/cli/index.ts +1 -4
- package/src/cli/launch-auto-update.ts +59 -7
- package/src/cli/management-commands.ts +6 -6
- package/src/cli/management-utils.ts +5 -5
- package/src/cli/management.ts +7 -7
- package/src/cli/network-posture.ts +1 -1
- package/src/cli/package-verification.ts +7 -6
- package/src/cli/plugin-bundles-command.ts +1 -1
- package/src/cli/plugin-command.ts +2 -2
- package/src/cli/service-command.ts +2 -2
- package/src/cli/service-posture.ts +4 -4
- package/src/cli/status.ts +9 -8
- package/src/cli/surface-command.ts +4 -4
- package/src/cli/tui-startup.ts +3 -3
- package/src/cli-flags.ts +3 -3
- package/src/config/goodvibes-home-audit.ts +0 -2
- package/src/config/secret-config.ts +37 -5
- package/src/config/tui-extension-settings.ts +1 -1
- package/src/core/approval-alert.ts +2 -2
- package/src/core/budget-breach-notifier.ts +3 -3
- package/src/core/conversation-compaction-render.ts +1 -1
- package/src/core/conversation-line-cache.ts +1 -1
- package/src/core/conversation-render-context.ts +1 -1
- package/src/core/conversation-rendering.ts +2 -2
- package/src/core/conversation.ts +10 -10
- package/src/core/long-task-notifier.ts +2 -2
- package/src/core/memory-diagnostics-gateway.ts +1 -1
- package/src/core/scriptable-statusline.ts +1 -1
- package/src/core/session-auto-titler.ts +1 -1
- package/src/core/session-resume-core.ts +2 -2
- package/src/core/stream-event-wiring.ts +24 -44
- package/src/core/terminal-notifier.ts +3 -3
- package/src/core/turn-cancellation.ts +1 -1
- package/src/core/turn-event-wiring.ts +5 -5
- package/src/input/command-registry.ts +6 -6
- package/src/input/commands/channel-pairing.ts +1 -1
- package/src/input/commands/cluster-runtime.ts +1 -1
- package/src/input/commands/codebase-runtime.ts +1 -1
- package/src/input/commands/devices-runtime.ts +1 -1
- package/src/input/commands/hosted-runtime.ts +330 -0
- package/src/input/commands/local-setup-review.ts +1 -1
- package/src/input/commands/local-setup-transfer.ts +2 -2
- package/src/input/commands/local-setup.ts +3 -3
- package/src/input/commands/managed-runtime.ts +2 -2
- package/src/input/commands/operator-rpc.ts +24 -110
- package/src/input/commands/payment-card-intake.ts +1 -1
- package/src/input/commands/permissions-provenance.ts +2 -2
- package/src/input/commands/plugin-runtime.ts +1 -1
- package/src/input/commands/provider.ts +1 -1
- package/src/input/commands/relay-runtime.ts +18 -9
- package/src/input/commands/rewind-runtime.ts +1 -1
- package/src/input/commands/runtime-services.ts +1 -1
- package/src/input/commands/services-runtime.ts +1 -1
- package/src/input/commands/session-workflow.ts +1 -1
- package/src/input/commands/settings-sync-runtime.ts +2 -2
- package/src/input/commands/share-runtime.ts +1 -1
- package/src/input/commands/tasks-runtime.ts +145 -55
- package/src/input/commands/update-runtime.ts +31 -28
- package/src/input/commands/work-plan-runtime.ts +2 -2
- package/src/input/commands/workstream-attempts.ts +1 -1
- package/src/input/commands/workstream-runtime.ts +2 -2
- package/src/input/commands.ts +2 -0
- package/src/input/feature-unit-layout.ts +1 -1
- package/src/input/feed-context-factory.ts +3 -3
- package/src/input/handler-content-actions.ts +2 -2
- package/src/input/handler-feed-routes.ts +1 -1
- package/src/input/handler-feed.ts +3 -3
- package/src/input/handler-modal-token-routes.ts +1 -1
- package/src/input/handler-onboarding-daemon-adopt.ts +3 -2
- package/src/input/handler-onboarding.ts +1 -1
- package/src/input/handler-types.ts +2 -2
- package/src/input/handler-ui-state.ts +1 -1
- package/src/input/handler.ts +4 -4
- package/src/input/input-history.ts +1 -1
- package/src/input/onboarding/onboarding-feature-units.ts +2 -2
- package/src/input/onboarding/onboarding-runtime-status.ts +15 -1
- package/src/input/onboarding/onboarding-wizard-apply.ts +17 -8
- package/src/input/onboarding/onboarding-wizard-cloudflare-step.ts +5 -3
- package/src/input/onboarding/onboarding-wizard-external-surfaces.ts +1 -1
- package/src/input/onboarding/onboarding-wizard-types.ts +1 -1
- package/src/input/payments-config.ts +6 -6
- package/src/input/search.ts +1 -1
- package/src/input/session-picker-modal.ts +46 -0
- package/src/input/settings-modal-activation.ts +1 -1
- package/src/input/settings-modal-behavior.ts +4 -4
- package/src/input/settings-modal-commit.ts +11 -0
- package/src/input/settings-modal-data.ts +9 -122
- package/src/input/settings-modal-mutations.ts +33 -0
- package/src/input/settings-modal-secrets.ts +34 -0
- package/src/input/settings-modal-subscriptions.ts +1 -1
- package/src/input/settings-modal-types.ts +15 -1
- package/src/input/settings-modal.ts +28 -3
- package/src/input/worktree-setup-config.ts +1 -1
- package/src/main.ts +11 -9
- package/src/panels/agent-inspector-shared.ts +2 -2
- package/src/panels/base-panel.ts +2 -2
- package/src/panels/builtin/operations.ts +6 -8
- package/src/panels/builtin/session.ts +17 -0
- package/src/panels/builtin/shared.ts +5 -5
- package/src/panels/builtin-modals.ts +3 -3
- package/src/panels/confirm-state.ts +1 -1
- package/src/panels/cost-tracker-panel.ts +4 -4
- package/src/panels/diff-panel.ts +2 -2
- package/src/panels/diff-review-panel.ts +2 -2
- package/src/panels/expandable-list-panel.ts +2 -2
- package/src/panels/fleet-acts.ts +1 -1
- package/src/panels/fleet-observed-render.ts +1 -1
- package/src/panels/fleet-panel-format.ts +1 -1
- package/src/panels/fleet-panel.ts +1 -1
- package/src/panels/fleet-spawn.ts +1 -1
- package/src/panels/fleet-steer.ts +1 -1
- package/src/panels/fleet-transcript.ts +1 -1
- package/src/panels/git-panel.ts +1 -1
- package/src/panels/hosted-session-feed.ts +352 -0
- package/src/panels/hosted-session-panel.ts +221 -0
- package/src/panels/local-auth-panel.ts +3 -3
- package/src/panels/modals/devices-modal.ts +1 -1
- package/src/panels/modals/local-auth-modal.ts +1 -1
- package/src/panels/modals/pairing-modal.ts +1 -1
- package/src/panels/modals/services-modal.ts +1 -1
- package/src/panels/modals/settings-sync-modal.ts +1 -1
- package/src/panels/modals/subscription-modal.ts +1 -1
- package/src/panels/modals/work-plan-modal.ts +1 -1
- package/src/panels/notifications-panel.ts +1 -1
- package/src/panels/panel-confirm-overlay.ts +1 -1
- package/src/panels/plugins-panel.ts +2 -2
- package/src/panels/polish-core.ts +2 -2
- package/src/panels/polish-tables.ts +1 -1
- package/src/panels/polish.ts +2 -2
- package/src/panels/scrollable-list-panel.ts +3 -3
- package/src/panels/skills-panel.ts +3 -3
- package/src/panels/token-budget-panel.ts +5 -5
- package/src/panels/types.ts +1 -2
- package/src/permissions/prompt.ts +1 -1
- package/src/renderer/autocomplete-overlay.ts +1 -1
- package/src/renderer/block-actions-overlay.ts +1 -1
- package/src/renderer/bookmark-modal.ts +1 -1
- package/src/renderer/buffer.ts +1 -1
- package/src/renderer/code-block.ts +1 -1
- package/src/renderer/composer-fragments.ts +1 -1
- package/src/renderer/compositor.ts +2 -2
- package/src/renderer/config-modal.ts +1 -1
- package/src/renderer/context-inspector.ts +1 -1
- package/src/renderer/conversation-layout.ts +2 -2
- package/src/renderer/conversation-overlays.ts +1 -1
- package/src/renderer/conversation-surface.ts +2 -2
- package/src/renderer/diff-view.ts +1 -1
- package/src/renderer/diff.ts +1 -1
- package/src/renderer/file-picker-overlay.ts +1 -1
- package/src/renderer/fleet-tab-strip.ts +1 -1
- package/src/renderer/fullscreen-primitives.ts +2 -2
- package/src/renderer/fullscreen-workspace.ts +1 -1
- package/src/renderer/header-line.ts +1 -1
- package/src/renderer/help-overlay.ts +1 -1
- package/src/renderer/history-search-overlay.ts +2 -2
- package/src/renderer/layout.ts +5 -8
- package/src/renderer/markdown-inline.ts +1 -1
- package/src/renderer/markdown-table.ts +1 -1
- package/src/renderer/markdown.ts +1 -1
- package/src/renderer/mcp-workspace.ts +1 -1
- package/src/renderer/modal-factory.ts +2 -2
- package/src/renderer/model-workspace.ts +2 -2
- package/src/renderer/onboarding/onboarding-wizard.ts +1 -1
- package/src/renderer/overlay-box.ts +1 -1
- package/src/renderer/panel-composite.ts +1 -1
- package/src/renderer/panel-workspace-bar.ts +1 -1
- package/src/renderer/process-indicator.ts +1 -1
- package/src/renderer/profile-picker-modal.ts +1 -1
- package/src/renderer/search-overlay.ts +2 -2
- package/src/renderer/selection-modal-overlay.ts +1 -1
- package/src/renderer/session-picker-modal.ts +124 -3
- package/src/renderer/settings-modal-helpers.ts +2 -0
- package/src/renderer/settings-modal.ts +2 -2
- package/src/renderer/shell-surface.ts +2 -2
- package/src/renderer/system-message.ts +1 -1
- package/src/renderer/tab-strip.ts +1 -1
- package/src/renderer/theme-mode-config.ts +21 -33
- package/src/renderer/theme.ts +11 -12
- package/src/renderer/thinking.ts +1 -1
- package/src/renderer/tool-call.ts +2 -2
- package/src/renderer/tool-result-expanded-lines.ts +1 -1
- package/src/renderer/turn-injection.ts +7 -8
- package/src/renderer/ui-factory.ts +3 -3
- package/src/runtime/bootstrap-command-context.ts +4 -4
- package/src/runtime/bootstrap-command-parts.ts +5 -5
- package/src/runtime/bootstrap-core.ts +30 -30
- package/src/runtime/bootstrap-shell.ts +4 -4
- package/src/runtime/bootstrap.ts +128 -157
- package/src/runtime/client/approval-updates.ts +82 -0
- package/src/runtime/client/build-floors.ts +167 -0
- package/src/runtime/client/daemon-attach-handshake.ts +115 -0
- package/src/runtime/client/fleet-union.ts +147 -0
- package/src/runtime/client/host-service-status.ts +71 -0
- package/src/runtime/client/hosted-exit.ts +86 -0
- package/src/runtime/client/hosted-roster.ts +110 -0
- package/src/runtime/client/hosted-session-stream.ts +178 -0
- package/src/runtime/client/hosted-sessions.ts +187 -0
- package/src/runtime/client/operator-endpoint.ts +213 -0
- package/src/runtime/client/spine-adoption.ts +99 -0
- package/src/runtime/cloudflare-control-plane.ts +1 -1
- package/src/runtime/context-accounting-source.ts +1 -1
- package/src/runtime/context.ts +2 -2
- package/src/runtime/conversation-rewind-port.ts +42 -14
- package/src/runtime/daemon-attach-notices.ts +55 -19
- package/src/runtime/diagnostics/panels/ops.ts +1 -1
- package/src/runtime/disposal-wiring.ts +4 -24
- package/src/runtime/index.ts +119 -105
- package/src/runtime/install-self-check-startup.ts +2 -2
- package/src/runtime/interaction-seams.ts +1 -1
- package/src/runtime/knowledge-services.ts +8 -2
- package/src/runtime/legacy-daemon-migration.ts +4 -3
- package/src/runtime/legacy-daemon-reconcile.ts +3 -2
- package/src/runtime/memory-spine-transport.ts +37 -267
- package/src/runtime/notification-dispatch.ts +2 -2
- package/src/runtime/onboarding/apply.ts +2 -2
- package/src/runtime/onboarding/derivation.ts +2 -2
- package/src/runtime/onboarding/markers.ts +2 -2
- package/src/runtime/onboarding/progress.ts +2 -2
- package/src/runtime/onboarding/snapshot.ts +1 -1
- package/src/runtime/onboarding/state.ts +2 -2
- package/src/runtime/onboarding/types.ts +2 -2
- package/src/runtime/orchestrator-core-services.ts +1 -1
- package/src/runtime/path-shadow-startup.ts +28 -221
- package/src/runtime/power-keepawake-remote.ts +3 -2
- package/src/runtime/process-lifecycle.ts +2 -2
- package/src/runtime/provider-fallback.ts +10 -66
- package/src/runtime/recovery-autosave.ts +1 -1
- package/src/runtime/recovery-offer-wiring.ts +39 -23
- package/src/runtime/recovery-prompt.ts +31 -17
- package/src/runtime/relay-reachability-bridge.ts +53 -42
- package/src/runtime/release-artifacts.ts +2 -1
- package/src/runtime/runtime-services-types.ts +82 -35
- package/src/runtime/services.ts +305 -300
- package/src/runtime/session-resume-liveness-confirm.ts +1 -1
- package/src/runtime/ui-services.ts +7 -6
- package/src/runtime/update-check.ts +23 -43
- package/src/runtime/workspace-checkpointing.ts +1 -1
- package/src/runtime/wrfc-persistence.ts +2 -2
- package/src/shell/ui-openers.ts +30 -7
- package/src/utils/clipboard.ts +1 -1
- package/src/verification/verification-ledger.ts +10 -8
- package/src/version.ts +1 -1
- package/bin/goodvibes-daemon +0 -90
- package/src/cli/config-overrides.ts +0 -267
- package/src/cli/endpoints.ts +0 -109
- package/src/cli/parser.ts +0 -395
- package/src/cli/redaction.ts +0 -170
- package/src/cli/types.ts +0 -84
- package/src/cluster/commands.ts +0 -382
- package/src/cluster/remote-daemon-target.ts +0 -225
- package/src/cluster/render.ts +0 -268
- package/src/config/atomic-write.ts +0 -70
- package/src/config/credential-availability.ts +0 -122
- package/src/config/goodvibes-home.ts +0 -149
- package/src/config/index.ts +0 -88
- package/src/config/provider-model.ts +0 -23
- package/src/config/read-versioned.ts +0 -228
- package/src/core/alert-gating.ts +0 -67
- package/src/core/consolidation-receipt.ts +0 -41
- package/src/core/focus-tracker.ts +0 -41
- package/src/core/history.ts +0 -45
- package/src/core/memory-status.ts +0 -118
- package/src/core/orchestrator.ts +0 -7
- package/src/core/pairing-devices.ts +0 -49
- package/src/core/pairing-handoff.ts +0 -101
- package/src/core/pairing-offers.ts +0 -83
- package/src/core/pairing-origin.ts +0 -78
- package/src/core/rewind-turn-anchors.ts +0 -311
- package/src/core/session-recovery.ts +0 -210
- package/src/core/stable-host.ts +0 -171
- package/src/core/transcript-journal.ts +0 -503
- package/src/daemon/cli.ts +0 -693
- package/src/daemon/fatal-boot-report.ts +0 -111
- package/src/daemon/handlers/context.ts +0 -29
- package/src/daemon/handlers/contracts.ts +0 -77
- package/src/daemon/handlers/credentials.ts +0 -139
- package/src/daemon/handlers/drafts/draft-store.ts +0 -427
- package/src/daemon/handlers/drafts/index.ts +0 -17
- package/src/daemon/handlers/drafts/register.ts +0 -331
- package/src/daemon/handlers/errors.ts +0 -18
- package/src/daemon/handlers/inbox/cursor-store.ts +0 -457
- package/src/daemon/handlers/inbox/index.ts +0 -284
- package/src/daemon/handlers/inbox/mapping.ts +0 -192
- package/src/daemon/handlers/inbox/poller.ts +0 -212
- package/src/daemon/handlers/inbox/provider-adapter.ts +0 -156
- package/src/daemon/handlers/inbox/providers/discord.ts +0 -252
- package/src/daemon/handlers/inbox/providers/email.ts +0 -152
- package/src/daemon/handlers/inbox/providers/imap-client.ts +0 -300
- package/src/daemon/handlers/inbox/providers/route-util.ts +0 -24
- package/src/daemon/handlers/inbox/providers/slack.ts +0 -263
- package/src/daemon/handlers/index.ts +0 -117
- package/src/daemon/handlers/register.ts +0 -168
- package/src/daemon/handlers/remote/backends/cloud-terminal.ts +0 -142
- package/src/daemon/handlers/remote/backends/docker.ts +0 -79
- package/src/daemon/handlers/remote/backends/index.ts +0 -40
- package/src/daemon/handlers/remote/backends/local-process.ts +0 -113
- package/src/daemon/handlers/remote/backends/process-runner.ts +0 -127
- package/src/daemon/handlers/remote/backends/ssh.ts +0 -125
- package/src/daemon/handlers/remote/backends/types.ts +0 -97
- package/src/daemon/handlers/remote/dispatcher.ts +0 -181
- package/src/daemon/handlers/remote/index.ts +0 -119
- package/src/daemon/handlers/remote/peer-registry.ts +0 -357
- package/src/daemon/handlers/remote/service.ts +0 -191
- package/src/daemon/handlers/routing/inbox-bridge.ts +0 -71
- package/src/daemon/handlers/routing/index.ts +0 -261
- package/src/daemon/handlers/routing/route-store.ts +0 -319
- package/src/daemon/handlers/routing/routing-resolver.ts +0 -75
- package/src/daemon/handlers/sqlite-store.ts +0 -278
- package/src/daemon/handlers/triage/index.ts +0 -57
- package/src/daemon/handlers/triage/integration.ts +0 -213
- package/src/daemon/handlers/triage/pipeline.ts +0 -274
- package/src/daemon/handlers/triage/scorer.ts +0 -287
- package/src/daemon/handlers/triage/tagger/discord.ts +0 -187
- package/src/daemon/handlers/triage/tagger/imap.ts +0 -384
- package/src/daemon/handlers/triage/tagger/index.ts +0 -184
- package/src/daemon/handlers/triage/tagger/shared.ts +0 -70
- package/src/daemon/handlers/triage/tagger/slack.ts +0 -69
- package/src/daemon/handlers/triage/types.ts +0 -50
- package/src/daemon/lifecycle.ts +0 -41
- package/src/daemon/provision-wake-model.ts +0 -81
- package/src/daemon/safe-serve.ts +0 -61
- package/src/daemon/send/channels.ts +0 -200
- package/src/daemon/send/command.ts +0 -332
- package/src/daemon/send/composition.ts +0 -99
- package/src/daemon/send/failure-text.ts +0 -93
- package/src/daemon/send/inert-text.ts +0 -225
- package/src/daemon/send/stdin.ts +0 -24
- package/src/daemon/service-commands.ts +0 -329
- package/src/export/cost-utils.ts +0 -319
- package/src/input/selection.ts +0 -135
- package/src/plugins/loader.ts +0 -15
- package/src/renderer/bottom-bar.ts +0 -58
- package/src/renderer/conversation-tree.ts +0 -228
- package/src/runtime/agent-graph-composition.ts +0 -78
- package/src/runtime/channel-composition.ts +0 -46
- package/src/runtime/cluster-composition.ts +0 -124
- package/src/runtime/cluster-group-composition.ts +0 -284
- package/src/runtime/code-index-services.ts +0 -167
- package/src/runtime/daemon-handler-composition.ts +0 -76
- package/src/runtime/device-posture-composition.ts +0 -110
- package/src/runtime/durability-housekeeping.ts +0 -183
- package/src/runtime/durability-services.ts +0 -155
- package/src/runtime/embedded-service-factories.ts +0 -74
- package/src/runtime/feature-settings.ts +0 -154
- package/src/runtime/fleet-needs-input-push.ts +0 -70
- package/src/runtime/fleet-services.ts +0 -41
- package/src/runtime/idle-power-services.ts +0 -85
- package/src/runtime/mail-composition.ts +0 -65
- package/src/runtime/memory-fold.ts +0 -55
- package/src/runtime/operator-token-cleanup.ts +0 -109
- package/src/runtime/path-shadow.ts +0 -418
- package/src/runtime/perf/panel-health-monitor.ts +0 -18
- package/src/runtime/provider-optimizer-wiring.ts +0 -55
- package/src/runtime/reachability-notice.ts +0 -100
- package/src/runtime/remote-execution-composition.ts +0 -62
- package/src/runtime/session-liveness-marker.ts +0 -257
- package/src/runtime/session-pointer-surface.ts +0 -22
- package/src/runtime/session-storage-services.ts +0 -41
- package/src/runtime/surface-feature-flags.ts +0 -96
- package/src/runtime/terminal-output-guard.ts +0 -235
- package/src/runtime/trust/workspace-registration.ts +0 -192
- package/src/runtime/trust/workspace-trust.ts +0 -229
- package/src/runtime/ui/index.ts +0 -39
- package/src/runtime/ui/model-picker/data-provider.ts +0 -182
- package/src/runtime/ui/model-picker/health-enrichment.ts +0 -231
- package/src/runtime/ui/model-picker/index.ts +0 -59
- package/src/runtime/ui/model-picker/types.ts +0 -153
- package/src/runtime/ui/provider-health/data-provider.ts +0 -244
- package/src/runtime/ui/provider-health/fallback-visualizer.ts +0 -71
- package/src/runtime/ui/provider-health/index.ts +0 -46
- package/src/runtime/ui/provider-health/types.ts +0 -146
- package/src/runtime/ui-events.ts +0 -1
- package/src/runtime/ui-read-model-helpers.ts +0 -1
- package/src/runtime/ui-read-models-observability-maintenance.ts +0 -1
- package/src/runtime/ui-read-models-observability-options.ts +0 -1
- package/src/runtime/ui-read-models-observability-remote.ts +0 -1
- package/src/runtime/ui-read-models-observability-security.ts +0 -1
- package/src/runtime/ui-read-models-observability-system.ts +0 -1
- package/src/runtime/ui-read-models-observability.ts +0 -1
- package/src/runtime/ui-service-queries.ts +0 -1
- package/src/runtime/voice-setup-services.ts +0 -98
- package/src/runtime/workstream-attempts-validation.ts +0 -77
- package/src/runtime/workstream-draft-edits.ts +0 -95
- package/src/runtime/workstream-draft-store.ts +0 -274
- package/src/runtime/workstream-draft-types.ts +0 -42
- package/src/runtime/workstream-services.ts +0 -373
- package/src/tools/index.ts +0 -1
- package/src/types/grid.ts +0 -48
- package/src/types/sql-js.d.ts +0 -15
- package/src/work-plans/work-plan-store.ts +0 -702
|
@@ -1,373 +0,0 @@
|
|
|
1
|
-
// ---------------------------------------------------------------------------
|
|
2
|
-
// workstream-services.ts — phase/work-item orchestration engine
|
|
3
|
-
//
|
|
4
|
-
// Constructs the TUI's OrchestrationEngine instance (@pellux/goodvibes-sdk/
|
|
5
|
-
// platform/orchestration, landed on SDK main as) and a thin
|
|
6
|
-
// command-facing facade around it. Extracted into its own module rather than
|
|
7
|
-
// built inline in services.ts: services.ts sits at the architecture check's
|
|
8
|
-
// 800-line cap (scripts/check-architecture.ts), so any new service gets its
|
|
9
|
-
// own construction module and a single wiring call there (mirrors
|
|
10
|
-
// createWorkflowServices's one-function-bundle shape).
|
|
11
|
-
//
|
|
12
|
-
// Why a facade, not the bare engine: createOrchestrationEngine() is a pure
|
|
13
|
-
// construction call with no auto-start and NO concept of a not-yet-launched
|
|
14
|
-
// "proposal" a human can review/edit before anything is spent — its only
|
|
15
|
-
// creation entry point, createWorkstream(), immediately materializes a real,
|
|
16
|
-
// ticking-eligible Workstream. The /workstream command module
|
|
17
|
-
// (input/commands/workstream-runtime.ts) needs a create -> propose -> approve
|
|
18
|
-
// -> launch flow (Pillar-3 doctrine: render the plan in the transcript before
|
|
19
|
-
// spending anything, mirroring /plan's approve step). REALITY-WINS DIVERGENCE
|
|
20
|
-
// from the design brief: the brief recommended an ENGINE-owned draft; the
|
|
21
|
-
// real engine (verified against the linked SDK build) exposes no pre-creation
|
|
22
|
-
// draft concept at all, so WorkstreamDraft below is TUI-owned state, held on
|
|
23
|
-
// this module's facade instance (constructed once, threaded onto
|
|
24
|
-
// CommandContext) — never a module-level ambient global. Durability is
|
|
25
|
-
// likewise TUI-owned: rather than leaving the brief's restart requirement
|
|
26
|
-
// unmet, the facade journals every draft to disk through
|
|
27
|
-
// workstream-draft-store.ts (a drafts/ subdirectory ALONGSIDE the engine's own
|
|
28
|
-
// workstream snapshots) and reloads them at construction, so a create / reshape
|
|
29
|
-
// / approve done before a restart is still here to launch afterward. The engine
|
|
30
|
-
// gains no draft concept; the TUI persists its OWN facade state. A journal
|
|
31
|
-
// write that fails degrades to in-memory-only for that one draft — never a
|
|
32
|
-
// crash — and the store never resurrects a launched draft (its snapshot is
|
|
33
|
-
// removed the moment the engine takes ownership).
|
|
34
|
-
// ---------------------------------------------------------------------------
|
|
35
|
-
|
|
36
|
-
import {
|
|
37
|
-
createOrchestrationEngine,
|
|
38
|
-
fromChainSpec,
|
|
39
|
-
fromPlanProposal,
|
|
40
|
-
type CreateWorkstreamInput,
|
|
41
|
-
type OrchestrationEngine,
|
|
42
|
-
type WorkstreamIsolation,
|
|
43
|
-
} from '@pellux/goodvibes-sdk/platform/orchestration';
|
|
44
|
-
export type { OrchestrationEngine } from '@pellux/goodvibes-sdk/platform/orchestration';
|
|
45
|
-
import {
|
|
46
|
-
AdaptivePlanner,
|
|
47
|
-
decomposeGoal,
|
|
48
|
-
type DecompositionServiceConfig,
|
|
49
|
-
type DecomposeGoalResult,
|
|
50
|
-
type PlannerInputs,
|
|
51
|
-
type PlanProposal,
|
|
52
|
-
} from '@pellux/goodvibes-sdk/platform/core';
|
|
53
|
-
import { createAgentManagerDecompositionRunner } from '@pellux/goodvibes-sdk/platform/agents';
|
|
54
|
-
import type { ConfigManager } from '@pellux/goodvibes-sdk/platform/config';
|
|
55
|
-
import type { AgentManager } from '@pellux/goodvibes-sdk/platform/tools';
|
|
56
|
-
import type { RuntimeEventBus } from '@/runtime/index.ts';
|
|
57
|
-
import { calcSessionCost, isModelPriced } from '../export/cost-utils.ts';
|
|
58
|
-
import { editItemBrief, moveItemInSpec, removeItemFromSpec } from './workstream-draft-edits.ts';
|
|
59
|
-
import { createWorkstreamDraftStore, formatWorkstreamDraftReclaim } from './workstream-draft-store.ts';
|
|
60
|
-
import { logger } from '@pellux/goodvibes-sdk/platform/utils';
|
|
61
|
-
|
|
62
|
-
export interface WorkstreamServicesDeps {
|
|
63
|
-
readonly agentManager: Pick<AgentManager, 'spawn' | 'getStatus' | 'cancel' | 'registerCancellationSignal' | 'releaseCancellationSignal'>;
|
|
64
|
-
readonly configManager: Pick<ConfigManager, 'get' | 'getCategory'>;
|
|
65
|
-
readonly adaptivePlanner: AdaptivePlanner;
|
|
66
|
-
readonly runtimeBus: RuntimeEventBus;
|
|
67
|
-
readonly projectRoot: string;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// WorkstreamDraft + WorkstreamDraftProvenance live in workstream-draft-types.ts
|
|
71
|
-
// (so the durable store can persist them without an import cycle) and are
|
|
72
|
-
// re-exported here so every existing importer keeps its import site unchanged.
|
|
73
|
-
export type { WorkstreamDraft, WorkstreamDraftProvenance } from './workstream-draft-types.ts';
|
|
74
|
-
import type { WorkstreamDraft, WorkstreamDraftProvenance } from './workstream-draft-types.ts';
|
|
75
|
-
|
|
76
|
-
/** `ctx.session.workstreamEngine`'s real shape: the live engine plus the draft-proposal bookkeeping the engine itself has no concept of. */
|
|
77
|
-
export interface WorkstreamCommandService {
|
|
78
|
-
readonly engine: OrchestrationEngine;
|
|
79
|
-
/** Spawn a bounded read-only planning agent to decompose the goal (with automatic heuristic fallback), then hold the draft. Async because the planning agent is real. `isolation` omitted ⇒ the engine's own default ('shared'); see CreateWorkstreamInput.isolation (SDK). */
|
|
80
|
-
proposeDraft(task: string, isolation?: WorkstreamIsolation): Promise<WorkstreamDraft>;
|
|
81
|
-
getDraft(id: string): WorkstreamDraft | undefined;
|
|
82
|
-
listDrafts(): WorkstreamDraft[];
|
|
83
|
-
/** Re-derive a held draft's spec + decomposition from a new task string. Clears any prior approval — an edit must be re-approved. `isolation` omitted ⇒ keeps the draft's current choice (an edit that only changes the task text must not silently reset isolation back to shared). */
|
|
84
|
-
editDraft(id: string, task: string, isolation?: WorkstreamIsolation): Promise<WorkstreamDraft | undefined>;
|
|
85
|
-
/**
|
|
86
|
-
* Plan-review-gate item edits over a held draft's launchable spec (see
|
|
87
|
-
* workstream-draft-edits.ts). Each returns the updated draft on success,
|
|
88
|
-
* `{ error }` with an honest user-facing reason on a bad reference/argument,
|
|
89
|
-
* or `undefined` when no draft with that id is held. Every successful edit
|
|
90
|
-
* clears approval — a reshaped plan must be re-approved before launch.
|
|
91
|
-
*/
|
|
92
|
-
editItem(id: string, itemRef: string, brief: string): WorkstreamDraft | { error: string } | undefined;
|
|
93
|
-
removeItem(id: string, itemRef: string): WorkstreamDraft | { error: string } | undefined;
|
|
94
|
-
moveItem(id: string, itemRef: string, toPosition: number): WorkstreamDraft | { error: string } | undefined;
|
|
95
|
-
approveDraft(id: string): WorkstreamDraft | undefined;
|
|
96
|
-
removeDraft(id: string): boolean;
|
|
97
|
-
/** Materialize an approved draft into a real, running Workstream (engine.createWorkstream + start), then drop the draft. Null when the draft is missing or not approved. */
|
|
98
|
-
launchDraft(id: string): { workstreamId: string } | null;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export interface WorkstreamServices {
|
|
102
|
-
readonly orchestrationEngine: OrchestrationEngine;
|
|
103
|
-
readonly workstreamCommands: WorkstreamCommandService;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Placeholder planner inputs until a richer risk/latency signal is wired in.
|
|
108
|
-
* `/workstream create` is inherently a multi-step authoring surface, so
|
|
109
|
-
* isMultiStep is always true; the rest are neutral defaults that let
|
|
110
|
-
* AdaptivePlanner's real scoring run rather than short-circuiting it.
|
|
111
|
-
*/
|
|
112
|
-
function buildPlannerInputs(task: string): PlannerInputs {
|
|
113
|
-
return {
|
|
114
|
-
riskScore: 0.3,
|
|
115
|
-
latencyBudgetMs: Number.POSITIVE_INFINITY,
|
|
116
|
-
isMultiStep: true,
|
|
117
|
-
remoteAvailable: false,
|
|
118
|
-
backgroundEligible: false,
|
|
119
|
-
taskDescription: task,
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Read the planner decomposition config (mode + bounds) from the config
|
|
125
|
-
* manager, defensively defaulting anything missing or invalid. Real config
|
|
126
|
-
* always supplies the DEFAULT_CONFIG values; these fallbacks matter only for a
|
|
127
|
-
* partially-stubbed config manager, and guarantee finite positive bounds so a
|
|
128
|
-
* planning-agent poll can never loop forever on a NaN deadline.
|
|
129
|
-
*/
|
|
130
|
-
function readDecompositionConfig(configManager: Pick<ConfigManager, 'get'>): DecompositionServiceConfig {
|
|
131
|
-
const num = (value: unknown, fallback: number): number =>
|
|
132
|
-
typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : fallback;
|
|
133
|
-
return {
|
|
134
|
-
mode: configManager.get('planner.decomposition') === 'heuristic' ? 'heuristic' : 'agent',
|
|
135
|
-
bounds: {
|
|
136
|
-
maxTurns: num(configManager.get('planner.maxTurns'), 6),
|
|
137
|
-
tokenCeiling: num(configManager.get('planner.tokenCeiling'), 120_000),
|
|
138
|
-
wallTimeoutMs: num(configManager.get('planner.wallTimeoutMs'), 60_000),
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/** Honest cost estimator: prices the planning agent's tokens only when the
|
|
144
|
-
* session's default model is one we actually have pricing for; otherwise the
|
|
145
|
-
* render falls back to a raw token count. Never throws. */
|
|
146
|
-
function makeCostEstimator(configManager: Pick<ConfigManager, 'get'>): (usage: { inputTokens: number; outputTokens: number; cacheReadTokens?: number | undefined; cacheWriteTokens?: number | undefined }) => number | undefined {
|
|
147
|
-
return (usage) => {
|
|
148
|
-
try {
|
|
149
|
-
const model = configManager.get('provider.model') as unknown as string | undefined;
|
|
150
|
-
if (!model || !isModelPriced(model)) return undefined;
|
|
151
|
-
return calcSessionCost(usage.inputTokens, usage.outputTokens, usage.cacheReadTokens ?? 0, usage.cacheWriteTokens ?? 0, model);
|
|
152
|
-
} catch {
|
|
153
|
-
return undefined;
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function toProvenance(result: DecomposeGoalResult): WorkstreamDraftProvenance {
|
|
159
|
-
const p = result.proposal;
|
|
160
|
-
const kind: WorkstreamDraftProvenance['kind'] =
|
|
161
|
-
result.outcome.kind === 'agent' ? 'agent'
|
|
162
|
-
: result.outcome.kind === 'heuristic-configured' ? 'heuristic-configured'
|
|
163
|
-
: result.outcome.kind === 'gate-declined' ? 'gate-declined'
|
|
164
|
-
: 'fallback';
|
|
165
|
-
return {
|
|
166
|
-
kind,
|
|
167
|
-
itemCount: p.workItems.length,
|
|
168
|
-
...(p.agentCostUsd !== undefined ? { agentCostUsd: p.agentCostUsd } : {}),
|
|
169
|
-
...(p.agentUsage ? { agentTokens: p.agentUsage.totalTokens } : {}),
|
|
170
|
-
...(p.elapsedMs !== undefined ? { elapsedMs: p.elapsedMs } : {}),
|
|
171
|
-
...(p.fallbackReason ? { fallbackReason: p.fallbackReason } : {}),
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function createWorkstreamCommandService(
|
|
176
|
-
engine: OrchestrationEngine,
|
|
177
|
-
adaptivePlanner: AdaptivePlanner,
|
|
178
|
-
configManager: Pick<ConfigManager, 'get' | 'getCategory'>,
|
|
179
|
-
agentManager: Pick<AgentManager, 'spawn' | 'getStatus' | 'cancel'>,
|
|
180
|
-
projectRoot: string,
|
|
181
|
-
): WorkstreamCommandService {
|
|
182
|
-
const drafts = new Map<string, WorkstreamDraft>();
|
|
183
|
-
|
|
184
|
-
// TUI-side draft journal (workstream-draft-store.ts). Load every persisted
|
|
185
|
-
// proposal at construction so a create/reshape/approve done before a restart
|
|
186
|
-
// is still here to launch afterward — the plan-review gate survives restart,
|
|
187
|
-
// exactly as the live-workstream snapshots do via resumeAllFromDisk().
|
|
188
|
-
// Reclaiming an abandoned draft deletes a plan the user once wrote, so it is
|
|
189
|
-
// never done silently: the store reaps at load and on a throttled save, and
|
|
190
|
-
// every reap that actually removed something reports a content-free count
|
|
191
|
-
// here. Without this hook the store recorded the reclaim on itself and
|
|
192
|
-
// nothing ever read it, which is deletion the user has no way to notice.
|
|
193
|
-
const store = createWorkstreamDraftStore(projectRoot, {
|
|
194
|
-
onReclaim: (summary) => {
|
|
195
|
-
logger.info(formatWorkstreamDraftReclaim(summary), {
|
|
196
|
-
projectRoot,
|
|
197
|
-
expired: summary.expired,
|
|
198
|
-
overCap: summary.overCap,
|
|
199
|
-
unreadable: summary.unreadable,
|
|
200
|
-
});
|
|
201
|
-
},
|
|
202
|
-
});
|
|
203
|
-
for (const persisted of store.loadAll()) drafts.set(persisted.id, persisted);
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Run the SDK decomposition service: it spawns a bounded, read-only planning
|
|
207
|
-
* agent (which surfaces in the fleet like any agent — kill/steer reach it,
|
|
208
|
-
* and a kill lands as a 'cancelled' fallback) and validates its structured
|
|
209
|
-
* output, or falls back to the heuristic single-item path on any failure.
|
|
210
|
-
* The returned proposal is engine-agnostic; the launchable `spec` is still
|
|
211
|
-
* derived by `buildSpec` (see below).
|
|
212
|
-
*/
|
|
213
|
-
async function decompose(task: string): Promise<DecomposeGoalResult> {
|
|
214
|
-
const runner = createAgentManagerDecompositionRunner({ agentManager });
|
|
215
|
-
return decomposeGoal(
|
|
216
|
-
{ goal: task, workingDir: projectRoot, constraints: {} },
|
|
217
|
-
adaptivePlanner,
|
|
218
|
-
buildPlannerInputs(task),
|
|
219
|
-
readDecompositionConfig(configManager),
|
|
220
|
-
runner,
|
|
221
|
-
{ estimateCostUsd: makeCostEstimator(configManager) },
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Derive the launchable CreateWorkstreamInput from the decomposition
|
|
227
|
-
* proposal (BIG-3 — the final stage of the WRFC→orchestration migration).
|
|
228
|
-
*
|
|
229
|
-
* THE BOUNDARY, stated honestly (and in the /workstream help + draft render):
|
|
230
|
-
* - A genuinely MULTI-ITEM proposal (the planning agent decomposed the goal
|
|
231
|
-
* into >1 work item) is assembled by the SDK's fromPlanProposal into the
|
|
232
|
-
* REAL multi-item workstream: one engineer→review-phased item per proposal
|
|
233
|
-
* item, inter-item dependencies preserved as scheduling constraints, and
|
|
234
|
-
* workstream-level provenance carried. This is the plan the engine runs —
|
|
235
|
-
* no flattening.
|
|
236
|
-
* - A SINGLE-ITEM proposal (the heuristic single-item path, a gate-decline,
|
|
237
|
-
* or an agent that honestly returned one item) keeps the fromChainSpec
|
|
238
|
-
* COMPAT path: byte-for-byte the same engineer→review chain
|
|
239
|
-
* WrfcController.createChain would start. A single item carries no
|
|
240
|
-
* dependencies and no multi-item structure, so the proposal mapping would
|
|
241
|
-
* add nothing — the compat path is the honest, unchanged choice.
|
|
242
|
-
*
|
|
243
|
-
* Earlier waves always took the compat path because no planning-agent-spawn
|
|
244
|
-
* pipeline existed to produce a real multi-item decomposition; BIG-2 landed
|
|
245
|
-
* that pipeline, so `result.proposal` can now be a real multi-item plan and
|
|
246
|
-
* this maps it faithfully. The rendered draft shows THIS spec, so the
|
|
247
|
-
* proposal preview and the launch are always the same plan.
|
|
248
|
-
*/
|
|
249
|
-
function buildSpec(task: string, proposal: PlanProposal): CreateWorkstreamInput {
|
|
250
|
-
if (proposal.workItems.length > 1) {
|
|
251
|
-
return fromPlanProposal(proposal, configManager);
|
|
252
|
-
}
|
|
253
|
-
return fromChainSpec({ id: `item-${crypto.randomUUID().slice(0, 8)}`, task }, configManager);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Apply a pure item edit (workstream-draft-edits.ts) to a held draft's spec.
|
|
258
|
-
* Threads the three outcomes straight through: `undefined` (no such draft) so
|
|
259
|
-
* the command layer can print its not-found message, `{ error }`
|
|
260
|
-
* (a bad reference/argument) verbatim, or the mutated draft. A successful edit
|
|
261
|
-
* clears approval — a reshaped plan must be re-approved before it can launch.
|
|
262
|
-
*/
|
|
263
|
-
function applyItemEdit(
|
|
264
|
-
id: string,
|
|
265
|
-
edit: (spec: CreateWorkstreamInput) => import('./workstream-draft-edits.ts').DraftEditResult,
|
|
266
|
-
): WorkstreamDraft | { error: string } | undefined {
|
|
267
|
-
const draft = drafts.get(id);
|
|
268
|
-
if (!draft) return undefined;
|
|
269
|
-
const result = edit(draft.spec);
|
|
270
|
-
if ('error' in result) return { error: result.error };
|
|
271
|
-
draft.spec = result.spec;
|
|
272
|
-
draft.approved = false;
|
|
273
|
-
store.save(draft);
|
|
274
|
-
return draft;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
return {
|
|
278
|
-
engine,
|
|
279
|
-
async proposeDraft(task: string, isolation?: WorkstreamIsolation): Promise<WorkstreamDraft> {
|
|
280
|
-
const result = await decompose(task);
|
|
281
|
-
const spec = buildSpec(task, result.proposal);
|
|
282
|
-
const draft: WorkstreamDraft = {
|
|
283
|
-
id: `wsd_${crypto.randomUUID().slice(0, 8)}`,
|
|
284
|
-
task,
|
|
285
|
-
spec: isolation ? { ...spec, isolation } : spec,
|
|
286
|
-
gate: result.gate,
|
|
287
|
-
proposal: result.proposal,
|
|
288
|
-
provenance: toProvenance(result),
|
|
289
|
-
approved: false,
|
|
290
|
-
createdAt: Date.now(),
|
|
291
|
-
};
|
|
292
|
-
drafts.set(draft.id, draft);
|
|
293
|
-
store.save(draft);
|
|
294
|
-
return draft;
|
|
295
|
-
},
|
|
296
|
-
getDraft: (id) => drafts.get(id),
|
|
297
|
-
listDrafts: () => Array.from(drafts.values()).sort((a, b) => a.createdAt - b.createdAt),
|
|
298
|
-
async editDraft(id, task, isolation) {
|
|
299
|
-
const draft = drafts.get(id);
|
|
300
|
-
if (!draft) return undefined;
|
|
301
|
-
const result = await decompose(task);
|
|
302
|
-
const nextIsolation = isolation ?? draft.spec.isolation;
|
|
303
|
-
draft.task = task;
|
|
304
|
-
draft.spec = { ...buildSpec(task, result.proposal), isolation: nextIsolation };
|
|
305
|
-
draft.proposal = result.proposal;
|
|
306
|
-
draft.provenance = toProvenance(result);
|
|
307
|
-
draft.approved = false;
|
|
308
|
-
store.save(draft);
|
|
309
|
-
return draft;
|
|
310
|
-
},
|
|
311
|
-
editItem: (id, itemRef, brief) => applyItemEdit(id, (spec) => editItemBrief(spec, itemRef, brief)),
|
|
312
|
-
removeItem: (id, itemRef) => applyItemEdit(id, (spec) => removeItemFromSpec(spec, itemRef)),
|
|
313
|
-
moveItem: (id, itemRef, toPosition) => applyItemEdit(id, (spec) => moveItemInSpec(spec, itemRef, toPosition)),
|
|
314
|
-
approveDraft(id) {
|
|
315
|
-
const draft = drafts.get(id);
|
|
316
|
-
if (!draft) return undefined;
|
|
317
|
-
draft.approved = true;
|
|
318
|
-
store.save(draft); // approval must survive restart too — a resumed approved draft launches straight away
|
|
319
|
-
return draft;
|
|
320
|
-
},
|
|
321
|
-
removeDraft(id) {
|
|
322
|
-
store.remove(id);
|
|
323
|
-
return drafts.delete(id);
|
|
324
|
-
},
|
|
325
|
-
launchDraft(id) {
|
|
326
|
-
const draft = drafts.get(id);
|
|
327
|
-
if (!draft || !draft.approved) return null;
|
|
328
|
-
const workstream = engine.createWorkstream(draft.spec);
|
|
329
|
-
engine.start(workstream.id);
|
|
330
|
-
drafts.delete(id);
|
|
331
|
-
store.remove(id); // launched: the engine now owns it (its own journal), so drop the draft snapshot
|
|
332
|
-
return { workstreamId: workstream.id };
|
|
333
|
-
},
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Constructs the TUI's OrchestrationEngine instance and its command-facing
|
|
339
|
-
* facade. `persist` and `createWorktree` are left at the engine's own
|
|
340
|
-
* defaults: journal-backed snapshots under .goodvibes/orchestration/ (so
|
|
341
|
-
* resumeAllFromDisk below has something to resume) and a plain
|
|
342
|
-
* AgentWorktree(projectRoot) for the (default) `shared`-isolation path.
|
|
343
|
-
* A draft's `isolation: 'worktree'` (see /workstream create --isolation
|
|
344
|
-
* worktree, input/commands/workstream-runtime.ts) opts a single workstream
|
|
345
|
-
* into the SDK's per-item git-worktree isolation (WorktreeIsolationManager,
|
|
346
|
-
* engine-side) instead — the engine, not this facade, owns that lifecycle.
|
|
347
|
-
*/
|
|
348
|
-
export function createWorkstreamServices(deps: WorkstreamServicesDeps): WorkstreamServices {
|
|
349
|
-
const orchestrationEngine = createOrchestrationEngine({
|
|
350
|
-
agentManager: deps.agentManager,
|
|
351
|
-
configManager: deps.configManager,
|
|
352
|
-
runtimeBus: deps.runtimeBus,
|
|
353
|
-
projectRoot: deps.projectRoot,
|
|
354
|
-
priceUsage: (model, usage) => {
|
|
355
|
-
const modelId = model ?? 'unknown';
|
|
356
|
-
if (!isModelPriced(modelId)) return null;
|
|
357
|
-
return calcSessionCost(usage.inputTokens, usage.outputTokens, usage.cacheReadTokens, usage.cacheWriteTokens, modelId);
|
|
358
|
-
},
|
|
359
|
-
});
|
|
360
|
-
// Honest resume: a prior process's still-in-flight workstreams pick back up
|
|
361
|
-
// (and reappear in the fleet tree) instead of silently vanishing on
|
|
362
|
-
// restart. Never throws — persistence.ts guards every read/parse and
|
|
363
|
-
// quarantines an unrecognized snapshot rather than propagating.
|
|
364
|
-
orchestrationEngine.resumeAllFromDisk();
|
|
365
|
-
const workstreamCommands = createWorkstreamCommandService(
|
|
366
|
-
orchestrationEngine,
|
|
367
|
-
deps.adaptivePlanner,
|
|
368
|
-
deps.configManager,
|
|
369
|
-
deps.agentManager,
|
|
370
|
-
deps.projectRoot,
|
|
371
|
-
);
|
|
372
|
-
return { orchestrationEngine, workstreamCommands };
|
|
373
|
-
}
|
package/src/tools/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { registerAllTools } from '@pellux/goodvibes-sdk/platform/tools';
|
package/src/types/grid.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cell - The atomic unit of the terminal surface grid.
|
|
3
|
-
*/
|
|
4
|
-
export interface Cell {
|
|
5
|
-
char: string;
|
|
6
|
-
fg: string;
|
|
7
|
-
bg: string;
|
|
8
|
-
bold: boolean;
|
|
9
|
-
dim: boolean;
|
|
10
|
-
underline: boolean;
|
|
11
|
-
italic: boolean;
|
|
12
|
-
strikethrough: boolean;
|
|
13
|
-
link?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Line - A single horizontal row of Cells.
|
|
18
|
-
*/
|
|
19
|
-
export type Line = Cell[];
|
|
20
|
-
|
|
21
|
-
export const createEmptyCell = (): Cell => ({
|
|
22
|
-
char: ' ',
|
|
23
|
-
fg: '',
|
|
24
|
-
bg: '',
|
|
25
|
-
bold: false,
|
|
26
|
-
dim: false,
|
|
27
|
-
underline: false,
|
|
28
|
-
italic: false,
|
|
29
|
-
strikethrough: false,
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export const createEmptyLine = (width: number): Line =>
|
|
33
|
-
Array.from({ length: width }, createEmptyCell);
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* createStyledCell - Create a Cell with all defaults, applying only the provided overrides.
|
|
37
|
-
*/
|
|
38
|
-
export const createStyledCell = (char: string, overrides: Partial<Omit<Cell, 'char'>> = {}): Cell => ({
|
|
39
|
-
char,
|
|
40
|
-
fg: overrides.fg ?? '',
|
|
41
|
-
bg: overrides.bg ?? '',
|
|
42
|
-
bold: overrides.bold ?? false,
|
|
43
|
-
dim: overrides.dim ?? false,
|
|
44
|
-
underline: overrides.underline ?? false,
|
|
45
|
-
italic: overrides.italic ?? false,
|
|
46
|
-
strikethrough: overrides.strikethrough ?? false,
|
|
47
|
-
link: overrides.link,
|
|
48
|
-
});
|
package/src/types/sql-js.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare module 'sql.js' {
|
|
2
|
-
interface Database {
|
|
3
|
-
run(sql: string, params?: (string | number | Uint8Array | null)[]): void;
|
|
4
|
-
exec(sql: string, params?: (string | number)[]): Array<{ columns: string[]; values: unknown[][] }>;
|
|
5
|
-
export(): Uint8Array;
|
|
6
|
-
close(): void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface SqlJsStatic {
|
|
10
|
-
Database: new (data?: Uint8Array | Buffer) => Database;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function initSqlJs(): Promise<SqlJsStatic>;
|
|
14
|
-
export default initSqlJs;
|
|
15
|
-
}
|