@pellux/goodvibes-sdk 0.37.2 → 1.0.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/dist/contracts/artifacts/operator-contract.json +3171 -929
- package/dist/daemon.d.ts +2 -0
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +4 -0
- package/dist/events/communication.d.ts +21 -1
- package/dist/events/communication.d.ts.map +1 -1
- package/dist/events/surfaces.d.ts +25 -3
- package/dist/events/surfaces.d.ts.map +1 -1
- package/dist/events/surfaces.js +22 -1
- package/dist/events/workflows.d.ts +7 -6
- package/dist/events/workflows.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/platform/agents/archetypes.d.ts.map +1 -1
- package/dist/platform/agents/archetypes.js +7 -0
- package/dist/platform/agents/index.d.ts +1 -0
- package/dist/platform/agents/index.d.ts.map +1 -1
- package/dist/platform/agents/index.js +1 -0
- package/dist/platform/agents/message-bus-core.d.ts +7 -0
- package/dist/platform/agents/message-bus-core.d.ts.map +1 -1
- package/dist/platform/agents/message-bus-core.js +2 -1
- package/dist/platform/agents/orchestrator-runner.d.ts +50 -1
- package/dist/platform/agents/orchestrator-runner.d.ts.map +1 -1
- package/dist/platform/agents/orchestrator-runner.js +172 -7
- package/dist/platform/agents/orchestrator.d.ts +78 -6
- package/dist/platform/agents/orchestrator.d.ts.map +1 -1
- package/dist/platform/agents/orchestrator.js +95 -18
- package/dist/platform/agents/planner-decomposition-runner.d.ts +38 -0
- package/dist/platform/agents/planner-decomposition-runner.d.ts.map +1 -0
- package/dist/platform/agents/planner-decomposition-runner.js +113 -0
- package/dist/platform/agents/turn-knowledge-injection.d.ts +192 -0
- package/dist/platform/agents/turn-knowledge-injection.d.ts.map +1 -0
- package/dist/platform/agents/turn-knowledge-injection.js +269 -0
- package/dist/platform/agents/worktree.d.ts +126 -8
- package/dist/platform/agents/worktree.d.ts.map +1 -1
- package/dist/platform/agents/worktree.js +240 -19
- package/dist/platform/agents/wrfc-controller.d.ts +46 -0
- package/dist/platform/agents/wrfc-controller.d.ts.map +1 -1
- package/dist/platform/agents/wrfc-controller.js +213 -32
- package/dist/platform/agents/wrfc-gate-runtime.d.ts +9 -0
- package/dist/platform/agents/wrfc-gate-runtime.d.ts.map +1 -1
- package/dist/platform/agents/wrfc-gate-runtime.js +7 -3
- package/dist/platform/agents/wrfc-gates.d.ts +1 -1
- package/dist/platform/agents/wrfc-gates.d.ts.map +1 -1
- package/dist/platform/agents/wrfc-gates.js +7 -1
- package/dist/platform/agents/wrfc-types.d.ts +23 -3
- package/dist/platform/agents/wrfc-types.d.ts.map +1 -1
- package/dist/platform/automation/types.d.ts +9 -1
- package/dist/platform/automation/types.d.ts.map +1 -1
- package/dist/platform/calendar/calendar-api-shared.d.ts +25 -0
- package/dist/platform/calendar/calendar-api-shared.d.ts.map +1 -0
- package/dist/platform/calendar/calendar-api-shared.js +100 -0
- package/dist/platform/calendar/calendar-connector.d.ts +79 -0
- package/dist/platform/calendar/calendar-connector.d.ts.map +1 -0
- package/dist/platform/calendar/calendar-connector.js +155 -0
- package/dist/platform/calendar/google-calendar-api.d.ts +25 -0
- package/dist/platform/calendar/google-calendar-api.d.ts.map +1 -0
- package/dist/platform/calendar/google-calendar-api.js +89 -0
- package/dist/platform/calendar/http-fetch-adapter.d.ts +25 -0
- package/dist/platform/calendar/http-fetch-adapter.d.ts.map +1 -0
- package/dist/platform/calendar/http-fetch-adapter.js +25 -0
- package/dist/platform/calendar/ics-parser.d.ts +35 -0
- package/dist/platform/calendar/ics-parser.d.ts.map +1 -0
- package/dist/platform/calendar/ics-parser.js +236 -0
- package/dist/platform/calendar/index.d.ts +41 -0
- package/dist/platform/calendar/index.d.ts.map +1 -0
- package/dist/platform/calendar/index.js +49 -0
- package/dist/platform/calendar/merged-calendar-model.d.ts +67 -0
- package/dist/platform/calendar/merged-calendar-model.d.ts.map +1 -0
- package/dist/platform/calendar/merged-calendar-model.js +181 -0
- package/dist/platform/calendar/microsoft-graph-api.d.ts +25 -0
- package/dist/platform/calendar/microsoft-graph-api.d.ts.map +1 -0
- package/dist/platform/calendar/microsoft-graph-api.js +95 -0
- package/dist/platform/calendar/oauth-flow.d.ts +62 -0
- package/dist/platform/calendar/oauth-flow.d.ts.map +1 -0
- package/dist/platform/calendar/oauth-flow.js +305 -0
- package/dist/platform/calendar/oauth-providers.d.ts +43 -0
- package/dist/platform/calendar/oauth-providers.d.ts.map +1 -0
- package/dist/platform/calendar/oauth-providers.js +120 -0
- package/dist/platform/calendar/oauth-token-store.d.ts +72 -0
- package/dist/platform/calendar/oauth-token-store.d.ts.map +1 -0
- package/dist/platform/calendar/oauth-token-store.js +189 -0
- package/dist/platform/calendar/oauth-types.d.ts +274 -0
- package/dist/platform/calendar/oauth-types.d.ts.map +1 -0
- package/dist/platform/calendar/oauth-types.js +22 -0
- package/dist/platform/calendar/rrule.d.ts +39 -0
- package/dist/platform/calendar/rrule.d.ts.map +1 -0
- package/dist/platform/calendar/rrule.js +261 -0
- package/dist/platform/calendar/subscription-store.d.ts +118 -0
- package/dist/platform/calendar/subscription-store.d.ts.map +1 -0
- package/dist/platform/calendar/subscription-store.js +293 -0
- package/dist/platform/calendar/types.d.ts +170 -0
- package/dist/platform/calendar/types.d.ts.map +1 -0
- package/dist/platform/calendar/types.js +21 -0
- package/dist/platform/companion/companion-chat-attachments.d.ts +29 -0
- package/dist/platform/companion/companion-chat-attachments.d.ts.map +1 -0
- package/dist/platform/companion/companion-chat-attachments.js +121 -0
- package/dist/platform/companion/companion-chat-broker-bridge.d.ts +40 -0
- package/dist/platform/companion/companion-chat-broker-bridge.d.ts.map +1 -0
- package/dist/platform/companion/companion-chat-broker-bridge.js +14 -0
- package/dist/platform/companion/companion-chat-broker-sync.d.ts +38 -0
- package/dist/platform/companion/companion-chat-broker-sync.d.ts.map +1 -0
- package/dist/platform/companion/companion-chat-broker-sync.js +80 -0
- package/dist/platform/companion/companion-chat-gc.d.ts +63 -0
- package/dist/platform/companion/companion-chat-gc.d.ts.map +1 -0
- package/dist/platform/companion/companion-chat-gc.js +38 -0
- package/dist/platform/companion/companion-chat-manager.d.ts +67 -20
- package/dist/platform/companion/companion-chat-manager.d.ts.map +1 -1
- package/dist/platform/companion/companion-chat-manager.js +130 -144
- package/dist/platform/companion/companion-chat-persistence.d.ts +9 -1
- package/dist/platform/companion/companion-chat-persistence.d.ts.map +1 -1
- package/dist/platform/companion/companion-chat-persistence.js +10 -2
- package/dist/platform/companion/companion-chat-routes.d.ts +2 -1
- package/dist/platform/companion/companion-chat-routes.d.ts.map +1 -1
- package/dist/platform/companion/companion-chat-routes.js +37 -4
- package/dist/platform/config/credential-status.d.ts +28 -0
- package/dist/platform/config/credential-status.d.ts.map +1 -0
- package/dist/platform/config/credential-status.js +75 -0
- package/dist/platform/config/index.d.ts +25 -0
- package/dist/platform/config/index.d.ts.map +1 -1
- package/dist/platform/config/index.js +18 -0
- package/dist/platform/config/manager.d.ts +18 -0
- package/dist/platform/config/manager.d.ts.map +1 -1
- package/dist/platform/config/manager.js +36 -2
- package/dist/platform/config/migrations.d.ts +48 -0
- package/dist/platform/config/migrations.d.ts.map +1 -0
- package/dist/platform/config/migrations.js +54 -0
- package/dist/platform/config/schema-domain-core.d.ts +10 -1
- package/dist/platform/config/schema-domain-core.d.ts.map +1 -1
- package/dist/platform/config/schema-domain-core.js +46 -3
- package/dist/platform/config/schema-types.d.ts +13 -7
- package/dist/platform/config/schema-types.d.ts.map +1 -1
- package/dist/platform/config/schema.d.ts.map +1 -1
- package/dist/platform/config/schema.js +2 -0
- package/dist/platform/control-plane/approval-broker.d.ts +11 -0
- package/dist/platform/control-plane/approval-broker.d.ts.map +1 -1
- package/dist/platform/control-plane/approval-broker.js +17 -1
- package/dist/platform/control-plane/approval-hunk-apply.d.ts +77 -0
- package/dist/platform/control-plane/approval-hunk-apply.d.ts.map +1 -0
- package/dist/platform/control-plane/approval-hunk-apply.js +80 -0
- package/dist/platform/control-plane/gateway-disabled-response.d.ts +20 -0
- package/dist/platform/control-plane/gateway-disabled-response.d.ts.map +1 -0
- package/dist/platform/control-plane/gateway-disabled-response.js +24 -0
- package/dist/platform/control-plane/gateway-scope-enforcement.d.ts +68 -0
- package/dist/platform/control-plane/gateway-scope-enforcement.d.ts.map +1 -0
- package/dist/platform/control-plane/gateway-scope-enforcement.js +91 -0
- package/dist/platform/control-plane/gateway-utils.d.ts +17 -0
- package/dist/platform/control-plane/gateway-utils.d.ts.map +1 -1
- package/dist/platform/control-plane/gateway-utils.js +30 -0
- package/dist/platform/control-plane/gateway.d.ts +12 -2
- package/dist/platform/control-plane/gateway.d.ts.map +1 -1
- package/dist/platform/control-plane/gateway.js +27 -31
- package/dist/platform/control-plane/index.d.ts +6 -1
- package/dist/platform/control-plane/index.d.ts.map +1 -1
- package/dist/platform/control-plane/index.js +4 -0
- package/dist/platform/control-plane/invoke-input-validation.d.ts +56 -0
- package/dist/platform/control-plane/invoke-input-validation.d.ts.map +1 -0
- package/dist/platform/control-plane/invoke-input-validation.js +163 -0
- package/dist/platform/control-plane/method-catalog-admin.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-admin.js +12 -1
- package/dist/platform/control-plane/method-catalog-calendar.d.ts +16 -0
- package/dist/platform/control-plane/method-catalog-calendar.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-calendar.js +21 -0
- package/dist/platform/control-plane/method-catalog-channels.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-channels.js +32 -3
- package/dist/platform/control-plane/method-catalog-control-automation.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-control-automation.js +19 -34
- package/dist/platform/control-plane/method-catalog-control-companion.d.ts +15 -0
- package/dist/platform/control-plane/method-catalog-control-companion.d.ts.map +1 -0
- package/dist/platform/control-plane/method-catalog-control-companion.js +133 -0
- package/dist/platform/control-plane/method-catalog-control-core.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-control-core.js +104 -122
- package/dist/platform/control-plane/method-catalog-control.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-control.js +4 -0
- package/dist/platform/control-plane/method-catalog-email.d.ts +17 -0
- package/dist/platform/control-plane/method-catalog-email.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-email.js +21 -0
- package/dist/platform/control-plane/method-catalog-events.d.ts +28 -0
- package/dist/platform/control-plane/method-catalog-events.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-events.js +74 -1
- package/dist/platform/control-plane/method-catalog-fleet.d.ts +24 -0
- package/dist/platform/control-plane/method-catalog-fleet.d.ts.map +1 -0
- package/dist/platform/control-plane/method-catalog-fleet.js +65 -0
- package/dist/platform/control-plane/method-catalog-route-reconcile.d.ts +84 -0
- package/dist/platform/control-plane/method-catalog-route-reconcile.d.ts.map +1 -0
- package/dist/platform/control-plane/method-catalog-route-reconcile.js +103 -0
- package/dist/platform/control-plane/method-catalog-shared.d.ts +29 -0
- package/dist/platform/control-plane/method-catalog-shared.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog.d.ts +9 -0
- package/dist/platform/control-plane/method-catalog.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog.js +32 -3
- package/dist/platform/control-plane/operator-contract-schemas-admin.d.ts +8 -0
- package/dist/platform/control-plane/operator-contract-schemas-admin.d.ts.map +1 -1
- package/dist/platform/control-plane/operator-contract-schemas-admin.js +22 -1
- package/dist/platform/control-plane/operator-contract-schemas-fleet.d.ts +18 -0
- package/dist/platform/control-plane/operator-contract-schemas-fleet.d.ts.map +1 -0
- package/dist/platform/control-plane/operator-contract-schemas-fleet.js +182 -0
- package/dist/platform/control-plane/operator-contract-schemas-permissions.d.ts.map +1 -1
- package/dist/platform/control-plane/operator-contract-schemas-permissions.js +5 -0
- package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts +29 -0
- package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts.map +1 -1
- package/dist/platform/control-plane/operator-contract-schemas-runtime.js +57 -3
- package/dist/platform/control-plane/operator-contract-schemas.d.ts +1 -0
- package/dist/platform/control-plane/operator-contract-schemas.d.ts.map +1 -1
- package/dist/platform/control-plane/operator-contract-schemas.js +1 -0
- package/dist/platform/control-plane/operator-contract.d.ts.map +1 -1
- package/dist/platform/control-plane/operator-contract.js +8 -0
- package/dist/platform/control-plane/routes/checkpoints.d.ts +39 -0
- package/dist/platform/control-plane/routes/checkpoints.d.ts.map +1 -0
- package/dist/platform/control-plane/routes/checkpoints.js +166 -0
- package/dist/platform/control-plane/routes/fleet.d.ts +53 -0
- package/dist/platform/control-plane/routes/fleet.d.ts.map +1 -0
- package/dist/platform/control-plane/routes/fleet.js +153 -0
- package/dist/platform/control-plane/routes/gateway-verb-error.d.ts +30 -0
- package/dist/platform/control-plane/routes/gateway-verb-error.d.ts.map +1 -0
- package/dist/platform/control-plane/routes/gateway-verb-error.js +36 -0
- package/dist/platform/control-plane/routes/index.d.ts +0 -6
- package/dist/platform/control-plane/routes/index.d.ts.map +1 -1
- package/dist/platform/control-plane/routes/index.js +5 -5
- package/dist/platform/control-plane/routes/invocation-params.d.ts +23 -0
- package/dist/platform/control-plane/routes/invocation-params.d.ts.map +1 -0
- package/dist/platform/control-plane/routes/invocation-params.js +9 -0
- package/dist/platform/control-plane/routes/register-w3-s2.d.ts +26 -0
- package/dist/platform/control-plane/routes/register-w3-s2.d.ts.map +1 -0
- package/dist/platform/control-plane/routes/register-w3-s2.js +8 -0
- package/dist/platform/control-plane/routes/session-search.d.ts +37 -0
- package/dist/platform/control-plane/routes/session-search.d.ts.map +1 -0
- package/dist/platform/control-plane/routes/session-search.js +113 -0
- package/dist/platform/control-plane/session-broker-gc.d.ts +16 -0
- package/dist/platform/control-plane/session-broker-gc.d.ts.map +1 -1
- package/dist/platform/control-plane/session-broker-gc.js +23 -6
- package/dist/platform/control-plane/session-broker-helpers.d.ts +3 -3
- package/dist/platform/control-plane/session-broker-helpers.d.ts.map +1 -1
- package/dist/platform/control-plane/session-broker-inputs.d.ts +18 -0
- package/dist/platform/control-plane/session-broker-inputs.d.ts.map +1 -1
- package/dist/platform/control-plane/session-broker-inputs.js +34 -0
- package/dist/platform/control-plane/session-broker-sessions.d.ts +102 -3
- package/dist/platform/control-plane/session-broker-sessions.d.ts.map +1 -1
- package/dist/platform/control-plane/session-broker-sessions.js +179 -5
- package/dist/platform/control-plane/session-broker-state.d.ts +20 -1
- package/dist/platform/control-plane/session-broker-state.d.ts.map +1 -1
- package/dist/platform/control-plane/session-broker-state.js +67 -5
- package/dist/platform/control-plane/session-broker.d.ts +51 -38
- package/dist/platform/control-plane/session-broker.d.ts.map +1 -1
- package/dist/platform/control-plane/session-broker.js +183 -75
- package/dist/platform/control-plane/session-store-importer.d.ts +57 -0
- package/dist/platform/control-plane/session-store-importer.d.ts.map +1 -0
- package/dist/platform/control-plane/session-store-importer.js +227 -0
- package/dist/platform/control-plane/session-types.d.ts +142 -7
- package/dist/platform/control-plane/session-types.d.ts.map +1 -1
- package/dist/platform/core/adaptive-planner.d.ts +50 -0
- package/dist/platform/core/adaptive-planner.d.ts.map +1 -1
- package/dist/platform/core/adaptive-planner.js +49 -0
- package/dist/platform/core/execution-plan.d.ts +43 -1
- package/dist/platform/core/execution-plan.d.ts.map +1 -1
- package/dist/platform/core/execution-plan.js +46 -10
- package/dist/platform/core/index.d.ts +2 -0
- package/dist/platform/core/index.d.ts.map +1 -1
- package/dist/platform/core/index.js +2 -0
- package/dist/platform/core/orchestrator-runtime.d.ts +31 -0
- package/dist/platform/core/orchestrator-runtime.d.ts.map +1 -1
- package/dist/platform/core/orchestrator-tool-runtime.d.ts +7 -0
- package/dist/platform/core/orchestrator-tool-runtime.d.ts.map +1 -1
- package/dist/platform/core/orchestrator-tool-runtime.js +10 -0
- package/dist/platform/core/orchestrator-turn-loop.d.ts +35 -1
- package/dist/platform/core/orchestrator-turn-loop.d.ts.map +1 -1
- package/dist/platform/core/orchestrator-turn-loop.js +121 -3
- package/dist/platform/core/orchestrator.d.ts +67 -0
- package/dist/platform/core/orchestrator.d.ts.map +1 -1
- package/dist/platform/core/orchestrator.js +89 -1
- package/dist/platform/core/plan-decomposition.d.ts +196 -0
- package/dist/platform/core/plan-decomposition.d.ts.map +1 -0
- package/dist/platform/core/plan-decomposition.js +417 -0
- package/dist/platform/core/plan-proposal.d.ts +204 -0
- package/dist/platform/core/plan-proposal.d.ts.map +1 -0
- package/dist/platform/core/plan-proposal.js +296 -0
- package/dist/platform/core/wrfc-routing.d.ts +1 -0
- package/dist/platform/core/wrfc-routing.d.ts.map +1 -1
- package/dist/platform/core/wrfc-routing.js +51 -1
- package/dist/platform/daemon/boot.d.ts +63 -0
- package/dist/platform/daemon/boot.d.ts.map +1 -0
- package/dist/platform/daemon/boot.js +60 -0
- package/dist/platform/daemon/cli.js +2 -1
- package/dist/platform/daemon/control-plane.d.ts.map +1 -1
- package/dist/platform/daemon/control-plane.js +50 -1
- package/dist/platform/daemon/facade-composition.d.ts.map +1 -1
- package/dist/platform/daemon/facade-composition.js +6 -0
- package/dist/platform/daemon/facade.d.ts +18 -6
- package/dist/platform/daemon/facade.d.ts.map +1 -1
- package/dist/platform/daemon/facade.js +50 -43
- package/dist/platform/daemon/http/router-route-contexts.d.ts +1 -0
- package/dist/platform/daemon/http/router-route-contexts.d.ts.map +1 -1
- package/dist/platform/daemon/http/router-route-contexts.js +1 -0
- package/dist/platform/daemon/http/router-session-broker-adapter.d.ts +13 -0
- package/dist/platform/daemon/http/router-session-broker-adapter.d.ts.map +1 -0
- package/dist/platform/daemon/http/router-session-broker-adapter.js +27 -0
- package/dist/platform/daemon/http/router.d.ts +1 -1
- package/dist/platform/daemon/http/router.d.ts.map +1 -1
- package/dist/platform/daemon/http/router.js +7 -22
- package/dist/platform/daemon/http/runtime-route-types.d.ts +42 -4
- package/dist/platform/daemon/http/runtime-route-types.d.ts.map +1 -1
- package/dist/platform/daemon/index.d.ts +2 -0
- package/dist/platform/daemon/index.d.ts.map +1 -1
- package/dist/platform/daemon/index.js +1 -0
- package/dist/platform/daemon/service-manager.d.ts +16 -0
- package/dist/platform/daemon/service-manager.d.ts.map +1 -1
- package/dist/platform/daemon/service-manager.js +79 -15
- package/dist/platform/intelligence/tree-sitter/service.d.ts.map +1 -1
- package/dist/platform/intelligence/tree-sitter/service.js +16 -2
- package/dist/platform/knowledge/browser-history/readers.d.ts.map +1 -1
- package/dist/platform/knowledge/browser-history/readers.js +15 -5
- package/dist/platform/knowledge/knowledge-api.d.ts +26 -0
- package/dist/platform/knowledge/knowledge-api.d.ts.map +1 -1
- package/dist/platform/knowledge/knowledge-api.js +11 -0
- package/dist/platform/knowledge/project-planning/service.d.ts +14 -1
- package/dist/platform/knowledge/project-planning/service.d.ts.map +1 -1
- package/dist/platform/knowledge/project-planning/service.js +77 -0
- package/dist/platform/knowledge/project-planning/types.d.ts +32 -0
- package/dist/platform/knowledge/project-planning/types.d.ts.map +1 -1
- package/dist/platform/orchestration/bookkeeping.d.ts +12 -0
- package/dist/platform/orchestration/bookkeeping.d.ts.map +1 -0
- package/dist/platform/orchestration/bookkeeping.js +91 -0
- package/dist/platform/orchestration/budget.d.ts +22 -0
- package/dist/platform/orchestration/budget.d.ts.map +1 -0
- package/dist/platform/orchestration/budget.js +35 -0
- package/dist/platform/orchestration/cancellation.d.ts +31 -0
- package/dist/platform/orchestration/cancellation.d.ts.map +1 -0
- package/dist/platform/orchestration/cancellation.js +25 -0
- package/dist/platform/orchestration/controller-compat.d.ts +46 -0
- package/dist/platform/orchestration/controller-compat.d.ts.map +1 -0
- package/dist/platform/orchestration/controller-compat.js +27 -0
- package/dist/platform/orchestration/dirty-guard.d.ts +32 -0
- package/dist/platform/orchestration/dirty-guard.d.ts.map +1 -0
- package/dist/platform/orchestration/dirty-guard.js +147 -0
- package/dist/platform/orchestration/engine.d.ts +82 -0
- package/dist/platform/orchestration/engine.d.ts.map +1 -0
- package/dist/platform/orchestration/engine.js +623 -0
- package/dist/platform/orchestration/index.d.ts +20 -0
- package/dist/platform/orchestration/index.d.ts.map +1 -0
- package/dist/platform/orchestration/index.js +11 -0
- package/dist/platform/orchestration/persistence.d.ts +24 -0
- package/dist/platform/orchestration/persistence.d.ts.map +1 -0
- package/dist/platform/orchestration/persistence.js +179 -0
- package/dist/platform/orchestration/phase-runner.d.ts +114 -0
- package/dist/platform/orchestration/phase-runner.d.ts.map +1 -0
- package/dist/platform/orchestration/phase-runner.js +347 -0
- package/dist/platform/orchestration/proposal-workstream.d.ts +56 -0
- package/dist/platform/orchestration/proposal-workstream.d.ts.map +1 -0
- package/dist/platform/orchestration/proposal-workstream.js +76 -0
- package/dist/platform/orchestration/scheduler.d.ts +64 -0
- package/dist/platform/orchestration/scheduler.d.ts.map +1 -0
- package/dist/platform/orchestration/scheduler.js +73 -0
- package/dist/platform/orchestration/types.d.ts +535 -0
- package/dist/platform/orchestration/types.d.ts.map +1 -0
- package/dist/platform/orchestration/types.js +47 -0
- package/dist/platform/orchestration/worktree-isolation.d.ts +33 -0
- package/dist/platform/orchestration/worktree-isolation.d.ts.map +1 -0
- package/dist/platform/orchestration/worktree-isolation.js +248 -0
- package/dist/platform/presentation/glyphs.d.ts +91 -0
- package/dist/platform/presentation/glyphs.d.ts.map +1 -0
- package/dist/platform/presentation/glyphs.js +93 -0
- package/dist/platform/presentation/index.d.ts +28 -0
- package/dist/platform/presentation/index.d.ts.map +1 -0
- package/dist/platform/presentation/index.js +27 -0
- package/dist/platform/presentation/thinking-phrases.d.ts +12 -0
- package/dist/platform/presentation/thinking-phrases.d.ts.map +1 -0
- package/dist/platform/presentation/thinking-phrases.js +32 -0
- package/dist/platform/presentation/tones.d.ts +121 -0
- package/dist/platform/presentation/tones.d.ts.map +1 -0
- package/dist/platform/presentation/tones.js +145 -0
- package/dist/platform/presentation/waiting-wording.d.ts +54 -0
- package/dist/platform/presentation/waiting-wording.d.ts.map +1 -0
- package/dist/platform/presentation/waiting-wording.js +51 -0
- package/dist/platform/providers/runtime-snapshot.d.ts.map +1 -1
- package/dist/platform/providers/runtime-snapshot.js +12 -2
- package/dist/platform/runtime/bootstrap-services.d.ts +62 -2
- package/dist/platform/runtime/bootstrap-services.d.ts.map +1 -1
- package/dist/platform/runtime/bootstrap-services.js +217 -50
- package/dist/platform/runtime/daemon-version-compat.d.ts +39 -0
- package/dist/platform/runtime/daemon-version-compat.d.ts.map +1 -0
- package/dist/platform/runtime/daemon-version-compat.js +75 -0
- package/dist/platform/runtime/detached-daemon-runtime.d.ts +26 -0
- package/dist/platform/runtime/detached-daemon-runtime.d.ts.map +1 -0
- package/dist/platform/runtime/detached-daemon-runtime.js +49 -0
- package/dist/platform/runtime/emitters/communication.d.ts +11 -0
- package/dist/platform/runtime/emitters/communication.d.ts.map +1 -1
- package/dist/platform/runtime/emitters/communication.js +9 -0
- package/dist/platform/runtime/emitters/workflows.d.ts +1 -1
- package/dist/platform/runtime/emitters/workflows.d.ts.map +1 -1
- package/dist/platform/runtime/events/index.d.ts +13 -0
- package/dist/platform/runtime/events/index.d.ts.map +1 -1
- package/dist/platform/runtime/events/index.js +13 -0
- package/dist/platform/runtime/feature-flags/flags.d.ts.map +1 -1
- package/dist/platform/runtime/feature-flags/flags.js +56 -1
- package/dist/platform/runtime/fleet/adapters/agent.d.ts +56 -0
- package/dist/platform/runtime/fleet/adapters/agent.d.ts.map +1 -0
- package/dist/platform/runtime/fleet/adapters/agent.js +143 -0
- package/dist/platform/runtime/fleet/adapters/automation.d.ts +30 -0
- package/dist/platform/runtime/fleet/adapters/automation.d.ts.map +1 -0
- package/dist/platform/runtime/fleet/adapters/automation.js +41 -0
- package/dist/platform/runtime/fleet/adapters/background-process.d.ts +12 -0
- package/dist/platform/runtime/fleet/adapters/background-process.d.ts.map +1 -0
- package/dist/platform/runtime/fleet/adapters/background-process.js +46 -0
- package/dist/platform/runtime/fleet/adapters/code-index.d.ts +21 -0
- package/dist/platform/runtime/fleet/adapters/code-index.d.ts.map +1 -0
- package/dist/platform/runtime/fleet/adapters/code-index.js +44 -0
- package/dist/platform/runtime/fleet/adapters/orchestration.d.ts +69 -0
- package/dist/platform/runtime/fleet/adapters/orchestration.d.ts.map +1 -0
- package/dist/platform/runtime/fleet/adapters/orchestration.js +329 -0
- package/dist/platform/runtime/fleet/adapters/schedule.d.ts +14 -0
- package/dist/platform/runtime/fleet/adapters/schedule.d.ts.map +1 -0
- package/dist/platform/runtime/fleet/adapters/schedule.js +28 -0
- package/dist/platform/runtime/fleet/adapters/trigger.d.ts +12 -0
- package/dist/platform/runtime/fleet/adapters/trigger.d.ts.map +1 -0
- package/dist/platform/runtime/fleet/adapters/trigger.js +22 -0
- package/dist/platform/runtime/fleet/adapters/watcher.d.ts +13 -0
- package/dist/platform/runtime/fleet/adapters/watcher.d.ts.map +1 -0
- package/dist/platform/runtime/fleet/adapters/watcher.js +47 -0
- package/dist/platform/runtime/fleet/adapters/workflow.d.ts +11 -0
- package/dist/platform/runtime/fleet/adapters/workflow.d.ts.map +1 -0
- package/dist/platform/runtime/fleet/adapters/workflow.js +34 -0
- package/dist/platform/runtime/fleet/adapters/wrfc.d.ts +35 -0
- package/dist/platform/runtime/fleet/adapters/wrfc.d.ts.map +1 -0
- package/dist/platform/runtime/fleet/adapters/wrfc.js +275 -0
- package/dist/platform/runtime/fleet/index.d.ts +10 -0
- package/dist/platform/runtime/fleet/index.d.ts.map +1 -0
- package/dist/platform/runtime/fleet/index.js +6 -0
- package/dist/platform/runtime/fleet/registry.d.ts +113 -0
- package/dist/platform/runtime/fleet/registry.d.ts.map +1 -0
- package/dist/platform/runtime/fleet/registry.js +664 -0
- package/dist/platform/runtime/fleet/types.d.ts +199 -0
- package/dist/platform/runtime/fleet/types.d.ts.map +1 -0
- package/dist/platform/runtime/fleet/types.js +2 -0
- package/dist/platform/runtime/operator-client.d.ts +20 -2
- package/dist/platform/runtime/operator-client.d.ts.map +1 -1
- package/dist/platform/runtime/operator-client.js +11 -1
- package/dist/platform/runtime/provider-accounts/registry.d.ts.map +1 -1
- package/dist/platform/runtime/provider-accounts/registry.js +11 -1
- package/dist/platform/runtime/runtime-knowledge-api.d.ts +1 -1
- package/dist/platform/runtime/runtime-knowledge-api.d.ts.map +1 -1
- package/dist/platform/runtime/runtime-knowledge-api.js +1 -0
- package/dist/platform/runtime/services.d.ts +48 -0
- package/dist/platform/runtime/services.d.ts.map +1 -1
- package/dist/platform/runtime/services.js +95 -2
- package/dist/platform/runtime/session-spine/client.d.ts +234 -0
- package/dist/platform/runtime/session-spine/client.d.ts.map +1 -0
- package/dist/platform/runtime/session-spine/client.js +449 -0
- package/dist/platform/runtime/session-spine/index.d.ts +12 -0
- package/dist/platform/runtime/session-spine/index.d.ts.map +1 -0
- package/dist/platform/runtime/session-spine/index.js +11 -0
- package/dist/platform/runtime/session-spine/union-cache.d.ts +225 -0
- package/dist/platform/runtime/session-spine/union-cache.d.ts.map +1 -0
- package/dist/platform/runtime/session-spine/union-cache.js +333 -0
- package/dist/platform/runtime/shell-command-ops.d.ts +3 -1
- package/dist/platform/runtime/shell-command-ops.d.ts.map +1 -1
- package/dist/platform/runtime/transports/daemon-http-client-validators.d.ts.map +1 -1
- package/dist/platform/runtime/transports/daemon-http-client-validators.js +22 -0
- package/dist/platform/runtime/transports/daemon-http-client.d.ts.map +1 -1
- package/dist/platform/runtime/transports/daemon-http-client.js +25 -2
- package/dist/platform/runtime/transports/http-types.d.ts +9 -2
- package/dist/platform/runtime/transports/http-types.d.ts.map +1 -1
- package/dist/platform/state/canonical-memory.d.ts +95 -0
- package/dist/platform/state/canonical-memory.d.ts.map +1 -0
- package/dist/platform/state/canonical-memory.js +155 -0
- package/dist/platform/state/code-index-chunking.d.ts +49 -0
- package/dist/platform/state/code-index-chunking.d.ts.map +1 -0
- package/dist/platform/state/code-index-chunking.js +111 -0
- package/dist/platform/state/code-index-db.d.ts +53 -0
- package/dist/platform/state/code-index-db.d.ts.map +1 -0
- package/dist/platform/state/code-index-db.js +101 -0
- package/dist/platform/state/code-index-reindex.d.ts +73 -0
- package/dist/platform/state/code-index-reindex.d.ts.map +1 -0
- package/dist/platform/state/code-index-reindex.js +156 -0
- package/dist/platform/state/code-index-store.d.ts +175 -0
- package/dist/platform/state/code-index-store.d.ts.map +1 -0
- package/dist/platform/state/code-index-store.js +620 -0
- package/dist/platform/state/index.d.ts +12 -2
- package/dist/platform/state/index.d.ts.map +1 -1
- package/dist/platform/state/index.js +6 -1
- package/dist/platform/state/knowledge-injection.d.ts +23 -0
- package/dist/platform/state/knowledge-injection.d.ts.map +1 -1
- package/dist/platform/state/knowledge-injection.js +34 -19
- package/dist/platform/state/memory-recall-contract.d.ts +63 -0
- package/dist/platform/state/memory-recall-contract.d.ts.map +1 -0
- package/dist/platform/state/memory-recall-contract.js +94 -0
- package/dist/platform/state/memory-store.d.ts +2 -0
- package/dist/platform/state/memory-store.d.ts.map +1 -1
- package/dist/platform/state/memory-store.js +4 -0
- package/dist/platform/state/memory-vector-store.d.ts +1 -13
- package/dist/platform/state/memory-vector-store.d.ts.map +1 -1
- package/dist/platform/state/memory-vector-store.js +18 -39
- package/dist/platform/state/sqlite-store.d.ts +2 -0
- package/dist/platform/state/sqlite-store.d.ts.map +1 -1
- package/dist/platform/state/sqlite-store.js +4 -0
- package/dist/platform/state/sqlite-vec-loader.d.ts +25 -0
- package/dist/platform/state/sqlite-vec-loader.d.ts.map +1 -0
- package/dist/platform/state/sqlite-vec-loader.js +43 -0
- package/dist/platform/state/vibe-projection.d.ts +67 -0
- package/dist/platform/state/vibe-projection.d.ts.map +1 -0
- package/dist/platform/state/vibe-projection.js +115 -0
- package/dist/platform/tools/agent/index.d.ts.map +1 -1
- package/dist/platform/tools/agent/index.js +8 -0
- package/dist/platform/tools/agent/manager.d.ts +140 -1
- package/dist/platform/tools/agent/manager.d.ts.map +1 -1
- package/dist/platform/tools/agent/manager.js +143 -1
- package/dist/platform/tools/agent/schema.d.ts +26 -0
- package/dist/platform/tools/agent/schema.d.ts.map +1 -1
- package/dist/platform/tools/agent/schema.js +2 -2
- package/dist/platform/tools/agent/wrfc-batch-policy.d.ts +13 -0
- package/dist/platform/tools/agent/wrfc-batch-policy.d.ts.map +1 -1
- package/dist/platform/tools/agent/wrfc-batch-policy.js +60 -0
- package/dist/platform/tools/exec/runtime.d.ts +10 -0
- package/dist/platform/tools/exec/runtime.d.ts.map +1 -1
- package/dist/platform/tools/exec/runtime.js +161 -49
- package/dist/platform/tools/exec/schema.d.ts +3 -1
- package/dist/platform/tools/exec/schema.d.ts.map +1 -1
- package/dist/platform/tools/exec/schema.js +2 -1
- package/dist/platform/tools/fetch/runtime.d.ts +7 -0
- package/dist/platform/tools/fetch/runtime.d.ts.map +1 -1
- package/dist/platform/tools/fetch/runtime.js +8 -6
- package/dist/platform/tools/index.d.ts +2 -0
- package/dist/platform/tools/index.d.ts.map +1 -1
- package/dist/platform/tools/index.js +2 -0
- package/dist/platform/tools/registry.d.ts +9 -3
- package/dist/platform/tools/registry.d.ts.map +1 -1
- package/dist/platform/tools/registry.js +9 -3
- package/dist/platform/tools/state/index.d.ts +9 -0
- package/dist/platform/tools/state/index.d.ts.map +1 -1
- package/dist/platform/tools/state/index.js +60 -3
- package/dist/platform/types/foundation-contract.d.ts +1 -1
- package/dist/platform/types/foundation-contract.d.ts.map +1 -1
- package/dist/platform/types/index.d.ts +1 -1
- package/dist/platform/types/index.d.ts.map +1 -1
- package/dist/platform/types/tools.d.ts +14 -1
- package/dist/platform/types/tools.d.ts.map +1 -1
- package/dist/platform/version.js +1 -1
- package/package.json +29 -9
- package/dist/platform/control-plane/routes/automation.d.ts +0 -3
- package/dist/platform/control-plane/routes/automation.d.ts.map +0 -1
- package/dist/platform/control-plane/routes/automation.js +0 -63
- package/dist/platform/control-plane/routes/context.d.ts +0 -2
- package/dist/platform/control-plane/routes/context.d.ts.map +0 -1
- package/dist/platform/control-plane/routes/context.js +0 -1
- package/dist/platform/control-plane/routes/operator.d.ts +0 -8
- package/dist/platform/control-plane/routes/operator.d.ts.map +0 -1
- package/dist/platform/control-plane/routes/operator.js +0 -415
- package/dist/platform/control-plane/routes/remote.d.ts +0 -3
- package/dist/platform/control-plane/routes/remote.d.ts.map +0 -1
- package/dist/platform/control-plane/routes/remote.js +0 -35
- package/dist/platform/control-plane/routes/sessions.d.ts +0 -3
- package/dist/platform/control-plane/routes/sessions.d.ts.map +0 -1
- package/dist/platform/control-plane/routes/sessions.js +0 -43
- package/dist/platform/control-plane/routes/tasks.d.ts +0 -3
- package/dist/platform/control-plane/routes/tasks.d.ts.map +0 -1
- package/dist/platform/control-plane/routes/tasks.js +0 -22
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
|
+
/**
|
|
3
|
+
* Orchestration-engine fleet adapters (Wave 4, wo701) — Workstream/Phase/
|
|
4
|
+
* WorkItem -> ProcessNode, mirroring adapters/wrfc.ts's chain/subtask
|
|
5
|
+
* pattern: a workstream is a root node (no native cancel of its own, so kill
|
|
6
|
+
* is DERIVED — cascades AgentManager.cancel over every agent any item ever
|
|
7
|
+
* spawned, same shape as adaptChain/cancelAgents), a phase is a pure grouping
|
|
8
|
+
* node (no lifecycle, no usage — same "report nothing" choice adaptSubtask
|
|
9
|
+
* makes, since attributing a work-item's CUMULATIVE usage to whichever phase
|
|
10
|
+
* it currently sits in would double-count across phases), and a work-item is
|
|
11
|
+
* the WRFC-subtask analogue: it delegates interrupt/kill/steer to its
|
|
12
|
+
* current live agent when it has one.
|
|
13
|
+
*/
|
|
14
|
+
import { mergeWorkItemUsage } from '../../../orchestration/types.js';
|
|
15
|
+
import { workItemNodeId } from './agent.js';
|
|
16
|
+
/** True once a ProcessUsage carries any non-zero count worth surfacing. */
|
|
17
|
+
function hasAnyUsage(u) {
|
|
18
|
+
return u !== undefined && (u.inputTokens > 0 || u.outputTokens > 0 || u.cacheReadTokens > 0 || u.cacheWriteTokens > 0
|
|
19
|
+
|| u.llmCallCount > 0 || u.turnCount > 0 || u.toolCallCount > 0);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* True when a committed WorkItemUsage carries no real data yet (the untouched
|
|
23
|
+
* emptyWorkItemUsage placeholder — zero counts, unpriced, no cost). Such a
|
|
24
|
+
* placeholder must NOT be folded into a live overlay: merging an 'unpriced'
|
|
25
|
+
* zero into a priced overlay would honestly-but-uselessly degrade the result to
|
|
26
|
+
* 'estimated' and drop it from the priced cost rollup (aggregateWorkItemCost),
|
|
27
|
+
* re-introducing the very n/a this overlay removes. When committed is empty the
|
|
28
|
+
* overlay stands alone.
|
|
29
|
+
*/
|
|
30
|
+
function isEmptyCommittedUsage(u) {
|
|
31
|
+
return u.costUsd === null && !hasAnyUsage(u);
|
|
32
|
+
}
|
|
33
|
+
/** Convert a live overlay into WorkItemUsage shape, or undefined when it carries nothing real yet. */
|
|
34
|
+
function liveOverlayUsage(live) {
|
|
35
|
+
if (!live)
|
|
36
|
+
return undefined;
|
|
37
|
+
const u = live.usage;
|
|
38
|
+
const hasCost = live.costUsd !== undefined && live.costUsd !== null;
|
|
39
|
+
if (!hasAnyUsage(u) && !hasCost)
|
|
40
|
+
return undefined;
|
|
41
|
+
return {
|
|
42
|
+
inputTokens: u?.inputTokens ?? 0,
|
|
43
|
+
outputTokens: u?.outputTokens ?? 0,
|
|
44
|
+
cacheReadTokens: u?.cacheReadTokens ?? 0,
|
|
45
|
+
cacheWriteTokens: u?.cacheWriteTokens ?? 0,
|
|
46
|
+
reasoningTokens: u?.reasoningTokens,
|
|
47
|
+
llmCallCount: u?.llmCallCount ?? 0,
|
|
48
|
+
turnCount: u?.turnCount ?? 0,
|
|
49
|
+
toolCallCount: u?.toolCallCount ?? 0,
|
|
50
|
+
costUsd: live.costUsd ?? null,
|
|
51
|
+
costState: live.costState ?? (hasCost ? 'priced' : 'unpriced'),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The usage the fleet DISPLAYS for a work-item: its committed phase-boundary
|
|
56
|
+
* total, plus — only while it is actively 'in-phase' — the live in-flight
|
|
57
|
+
* usage of its current agent. The overlay is applied ONLY for an 'in-phase'
|
|
58
|
+
* item, which is exactly the window in which `item.usage` does NOT yet include
|
|
59
|
+
* the running phase (the engine folds that in at completion — see
|
|
60
|
+
* runItemPhase), so committed + live never double-counts and the two hand off
|
|
61
|
+
* atomically at the phase boundary. Because both operands only ever grow and
|
|
62
|
+
* merge through {@link mergeWorkItemUsage}, presence is MONOTONE: once usage
|
|
63
|
+
* has appeared for an item it never blinks back to n/a (DEBT-4 item 2).
|
|
64
|
+
*/
|
|
65
|
+
export function displayWorkItemUsage(item, live) {
|
|
66
|
+
const overlay = item.state === 'in-phase' ? liveOverlayUsage(live) : undefined;
|
|
67
|
+
if (!overlay)
|
|
68
|
+
return item.usage;
|
|
69
|
+
// First-phase window: no committed usage yet, so the live overlay is the
|
|
70
|
+
// whole truth — don't let the empty 'unpriced' placeholder degrade it.
|
|
71
|
+
if (isEmptyCommittedUsage(item.usage))
|
|
72
|
+
return overlay;
|
|
73
|
+
return mergeWorkItemUsage(item.usage, overlay);
|
|
74
|
+
}
|
|
75
|
+
/** Workstream node ids are namespaced to avoid colliding with agent/process ids. */
|
|
76
|
+
export function workstreamNodeId(workstreamId) {
|
|
77
|
+
return `workstream:${workstreamId}`;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Phase node ids are namespaced by their owning workstream — phase ids are
|
|
81
|
+
* only unique WITHIN a workstream, so two workstreams' phases must not
|
|
82
|
+
* collide in the flat node list.
|
|
83
|
+
*/
|
|
84
|
+
export function phaseNodeId(workstreamId, phaseId) {
|
|
85
|
+
return `phase:${workstreamId}:${phaseId}`;
|
|
86
|
+
}
|
|
87
|
+
export { workItemNodeId };
|
|
88
|
+
const TERMINAL_ITEM_STATES = new Set(['passed', 'failed']);
|
|
89
|
+
/** The work-item's currently-active agent, i.e. the one driving its live phase run. Undefined once terminal or between phases. */
|
|
90
|
+
export function activeWorkItemAgentId(item) {
|
|
91
|
+
return item.state === 'in-phase' ? item.agentId : undefined;
|
|
92
|
+
}
|
|
93
|
+
function workItemState(item) {
|
|
94
|
+
switch (item.state) {
|
|
95
|
+
case 'passed':
|
|
96
|
+
return 'done';
|
|
97
|
+
case 'failed':
|
|
98
|
+
return 'failed';
|
|
99
|
+
case 'pending':
|
|
100
|
+
case 'awaiting-capacity':
|
|
101
|
+
return 'queued';
|
|
102
|
+
case 'blocked-budget':
|
|
103
|
+
// Honest "stuck, not progressing" signal reusing an existing state
|
|
104
|
+
// rather than adding a new one (charter: prefer existing-contract
|
|
105
|
+
// reuse). Distinct from 'queued': a queued item WILL be claimed by
|
|
106
|
+
// free capacity; a blocked-budget item will not until its workstream's
|
|
107
|
+
// ceiling rises (or is cleared) via OrchestrationEngine.updateBudget —
|
|
108
|
+
// computeClaims (scheduler.ts) keeps it in the waiting set so that
|
|
109
|
+
// reconsideration is automatic the instant the ceiling changes, but a
|
|
110
|
+
// fixed ceiling on its own never lifts the block (usage only grows).
|
|
111
|
+
return 'stalled';
|
|
112
|
+
case 'blocked-dependency':
|
|
113
|
+
// Same "stuck, not progressing" signal as blocked-budget, for the same
|
|
114
|
+
// reason (BIG-3 item 2): the item is out of the claimable set until every
|
|
115
|
+
// dependency reaches 'passed'. Distinct from 'queued' (which WILL be
|
|
116
|
+
// claimed by free capacity) — a dependency-blocked item waits on other
|
|
117
|
+
// items, or on engine.retryItem reviving a failed dependency. blockedReason
|
|
118
|
+
// carries the honest 'waiting on: …' / 'dependency failed: …' detail.
|
|
119
|
+
return 'stalled';
|
|
120
|
+
case 'in-phase':
|
|
121
|
+
return 'executing-tool';
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function workstreamState(workstream) {
|
|
125
|
+
if (workstream.items.length === 0)
|
|
126
|
+
return 'idle';
|
|
127
|
+
if (workstream.items.some((item) => item.state === 'in-phase'))
|
|
128
|
+
return 'executing-tool';
|
|
129
|
+
if (workstream.items.some((item) => item.state === 'pending' || item.state === 'awaiting-capacity'))
|
|
130
|
+
return 'queued';
|
|
131
|
+
if (workstream.items.some((item) => item.state === 'blocked-budget' || item.state === 'blocked-dependency'))
|
|
132
|
+
return 'stalled';
|
|
133
|
+
return workstream.items.some((item) => item.state === 'failed') ? 'failed' : 'done';
|
|
134
|
+
}
|
|
135
|
+
function phaseState(workstream, phase) {
|
|
136
|
+
const occupants = workstream.items.filter((item) => item.currentPhaseId === phase.id && item.state === 'in-phase');
|
|
137
|
+
if (occupants.length > 0)
|
|
138
|
+
return 'executing-tool';
|
|
139
|
+
const everVisited = workstream.items.some((item) => (item.visits.get(phase.id) ?? 0) > 0);
|
|
140
|
+
if (!everVisited)
|
|
141
|
+
return 'idle';
|
|
142
|
+
const allTerminal = workstream.items.every((item) => TERMINAL_ITEM_STATES.has(item.state));
|
|
143
|
+
return allTerminal ? 'done' : 'idle';
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* token-count-only rollup over a workstream's per-item DISPLAY usages (cost
|
|
147
|
+
* handled separately — see aggregateWorkItemCost). Takes resolved display
|
|
148
|
+
* usages (committed + any live overlay) rather than raw items so the workstream
|
|
149
|
+
* total reflects live in-flight work, not just phase-boundary snapshots
|
|
150
|
+
* (DEBT-4 item 2).
|
|
151
|
+
*/
|
|
152
|
+
function sumWorkItemUsage(usages) {
|
|
153
|
+
if (usages.length === 0)
|
|
154
|
+
return undefined;
|
|
155
|
+
const total = {
|
|
156
|
+
inputTokens: 0,
|
|
157
|
+
outputTokens: 0,
|
|
158
|
+
cacheReadTokens: 0,
|
|
159
|
+
cacheWriteTokens: 0,
|
|
160
|
+
reasoningTokens: 0,
|
|
161
|
+
llmCallCount: 0,
|
|
162
|
+
turnCount: 0,
|
|
163
|
+
toolCallCount: 0,
|
|
164
|
+
};
|
|
165
|
+
let sawReasoning = false;
|
|
166
|
+
for (const usage of usages) {
|
|
167
|
+
total.inputTokens += usage.inputTokens;
|
|
168
|
+
total.outputTokens += usage.outputTokens;
|
|
169
|
+
total.cacheReadTokens += usage.cacheReadTokens;
|
|
170
|
+
total.cacheWriteTokens += usage.cacheWriteTokens;
|
|
171
|
+
if (usage.reasoningTokens !== undefined) {
|
|
172
|
+
sawReasoning = true;
|
|
173
|
+
total.reasoningTokens += usage.reasoningTokens;
|
|
174
|
+
}
|
|
175
|
+
total.llmCallCount += usage.llmCallCount;
|
|
176
|
+
total.turnCount += usage.turnCount;
|
|
177
|
+
total.toolCallCount += usage.toolCallCount;
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
inputTokens: total.inputTokens,
|
|
181
|
+
outputTokens: total.outputTokens,
|
|
182
|
+
cacheReadTokens: total.cacheReadTokens,
|
|
183
|
+
cacheWriteTokens: total.cacheWriteTokens,
|
|
184
|
+
reasoningTokens: sawReasoning ? total.reasoningTokens : undefined,
|
|
185
|
+
llmCallCount: total.llmCallCount,
|
|
186
|
+
turnCount: total.turnCount,
|
|
187
|
+
toolCallCount: total.toolCallCount,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/** Honest cost rollup: all-priced -> 'priced'; none -> null/'unpriced'; mixed -> summed subset, 'estimated'. Mirrors adapters/wrfc.ts aggregateCost. Operates on resolved display usages (committed + live overlay). */
|
|
191
|
+
function aggregateWorkItemCost(usages) {
|
|
192
|
+
const withUsage = usages.filter((usage) => usage.costState !== 'unpriced' || usage.inputTokens > 0 || usage.outputTokens > 0);
|
|
193
|
+
if (withUsage.length === 0)
|
|
194
|
+
return { costUsd: null, costState: 'unpriced' };
|
|
195
|
+
const priced = withUsage.filter((usage) => usage.costState === 'priced' && usage.costUsd !== null);
|
|
196
|
+
if (priced.length === 0)
|
|
197
|
+
return { costUsd: null, costState: 'unpriced' };
|
|
198
|
+
const total = priced.reduce((sum, usage) => sum + usage.costUsd, 0);
|
|
199
|
+
return { costUsd: total, costState: priced.length === withUsage.length ? 'priced' : 'estimated' };
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* WorkItem -> ProcessNode. Delegates interruptible/killable/steerable to its
|
|
203
|
+
* currently-active agent, mirroring adaptSubtask. `opts.live` supplies the
|
|
204
|
+
* currently-active agent's in-flight usage so a running phase shows real,
|
|
205
|
+
* growing numbers instead of n/a until it completes (DEBT-4 item 2); omit it
|
|
206
|
+
* (or pass undefined) for the committed-only view.
|
|
207
|
+
*/
|
|
208
|
+
export function adaptWorkItem(item, workstreamId, parentId, opts) {
|
|
209
|
+
const state = workItemState(item);
|
|
210
|
+
const killable = !TERMINAL_ITEM_STATES.has(item.state);
|
|
211
|
+
const activeAgentId = activeWorkItemAgentId(item);
|
|
212
|
+
const usage = displayWorkItemUsage(item, opts.live);
|
|
213
|
+
return {
|
|
214
|
+
id: workItemNodeId(item.id),
|
|
215
|
+
kind: 'work-item',
|
|
216
|
+
parentId,
|
|
217
|
+
label: item.title,
|
|
218
|
+
task: item.task,
|
|
219
|
+
state,
|
|
220
|
+
startedAt: item.createdAt,
|
|
221
|
+
completedAt: item.completedAt,
|
|
222
|
+
elapsedMs: Math.max(0, (item.completedAt ?? Date.now()) - item.createdAt),
|
|
223
|
+
usage: usage.inputTokens > 0 || usage.outputTokens > 0
|
|
224
|
+
? {
|
|
225
|
+
inputTokens: usage.inputTokens,
|
|
226
|
+
outputTokens: usage.outputTokens,
|
|
227
|
+
cacheReadTokens: usage.cacheReadTokens,
|
|
228
|
+
cacheWriteTokens: usage.cacheWriteTokens,
|
|
229
|
+
reasoningTokens: usage.reasoningTokens,
|
|
230
|
+
llmCallCount: usage.llmCallCount,
|
|
231
|
+
turnCount: usage.turnCount,
|
|
232
|
+
toolCallCount: usage.toolCallCount,
|
|
233
|
+
}
|
|
234
|
+
: undefined,
|
|
235
|
+
costUsd: usage.costUsd,
|
|
236
|
+
costState: usage.costState,
|
|
237
|
+
// Blocked items surface their reason (set/cleared by the engine alongside
|
|
238
|
+
// the state transition, types.ts WorkItem.blockedReason) in place of the
|
|
239
|
+
// bare phase id — the phase id alone doesn't tell an operator WHY the item
|
|
240
|
+
// stopped moving. Covers both budget blocks and dependency blocks (BIG-3
|
|
241
|
+
// item 2: 'waiting on: …' / 'dependency failed: …').
|
|
242
|
+
currentActivity: item.currentPhaseId
|
|
243
|
+
? {
|
|
244
|
+
kind: 'phase',
|
|
245
|
+
text: (item.state === 'blocked-budget' || item.state === 'blocked-dependency') && item.blockedReason
|
|
246
|
+
? item.blockedReason
|
|
247
|
+
: item.currentPhaseId,
|
|
248
|
+
at: item.createdAt,
|
|
249
|
+
}
|
|
250
|
+
: undefined,
|
|
251
|
+
capabilities: {
|
|
252
|
+
interruptible: activeAgentId !== undefined,
|
|
253
|
+
killable,
|
|
254
|
+
pausable: false,
|
|
255
|
+
resumable: false,
|
|
256
|
+
steerable: activeAgentId !== undefined && opts.steerable,
|
|
257
|
+
},
|
|
258
|
+
sessionRef: activeAgentId ? { agentId: activeAgentId } : undefined,
|
|
259
|
+
raw: { item, workstreamId },
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Phase -> ProcessNode. Deliberately reports NO usage/cost (mirrors
|
|
264
|
+
* adaptSubtask's "report nothing" choice): a work-item's usage is cumulative
|
|
265
|
+
* across every phase it has visited, so attributing it to whichever phase it
|
|
266
|
+
* currently occupies would double-count against both the phase and the
|
|
267
|
+
* workstream total. Real numbers live on the workstream (sums every item
|
|
268
|
+
* exactly once) and the work-item (its own direct total) — never on phase.
|
|
269
|
+
*/
|
|
270
|
+
export function adaptPhase(phase, workstream) {
|
|
271
|
+
const state = phaseState(workstream, phase);
|
|
272
|
+
return {
|
|
273
|
+
id: phaseNodeId(workstream.id, phase.id),
|
|
274
|
+
kind: 'phase',
|
|
275
|
+
parentId: workstreamNodeId(workstream.id),
|
|
276
|
+
label: `${phase.kind} (${phase.role})`,
|
|
277
|
+
state,
|
|
278
|
+
startedAt: workstream.createdAt,
|
|
279
|
+
completedAt: state === 'done' ? workstream.items.reduce((latest, item) => (item.completedAt !== undefined && (latest === undefined || item.completedAt > latest) ? item.completedAt : latest), undefined) : undefined,
|
|
280
|
+
elapsedMs: 0,
|
|
281
|
+
usage: undefined,
|
|
282
|
+
costUsd: null,
|
|
283
|
+
costState: 'unpriced',
|
|
284
|
+
currentActivity: undefined,
|
|
285
|
+
// Pure grouping node: no conversation loop, no native single-phase
|
|
286
|
+
// cancel (killing work belongs to the work-items running IN the phase).
|
|
287
|
+
capabilities: { interruptible: false, killable: false, pausable: false, resumable: false, steerable: false },
|
|
288
|
+
raw: phase,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Workstream -> ProcessNode. Root node (no parentId). Sums every item's DISPLAY
|
|
293
|
+
* usage/cost (committed total + any live in-flight overlay, resolved once per
|
|
294
|
+
* item) exactly once — never through an intermediate phase bucket (see
|
|
295
|
+
* adaptPhase) — so this total can never double-count and never shows n/a while
|
|
296
|
+
* an item is actively producing usage (DEBT-4 item 2). `liveByItemId` supplies
|
|
297
|
+
* the active agents' in-flight usage keyed by item id; omit it for the
|
|
298
|
+
* committed-only view.
|
|
299
|
+
*/
|
|
300
|
+
export function adaptWorkstream(workstream, now, liveByItemId) {
|
|
301
|
+
const state = workstreamState(workstream);
|
|
302
|
+
const killable = state !== 'done' && state !== 'failed';
|
|
303
|
+
const completedAt = (state === 'done' || state === 'failed')
|
|
304
|
+
? workstream.items.reduce((latest, item) => (item.completedAt !== undefined && (latest === undefined || item.completedAt > latest) ? item.completedAt : latest), undefined)
|
|
305
|
+
: undefined;
|
|
306
|
+
const displayUsages = workstream.items.map((item) => displayWorkItemUsage(item, liveByItemId?.get(item.id)));
|
|
307
|
+
const { costUsd, costState } = aggregateWorkItemCost(displayUsages);
|
|
308
|
+
return {
|
|
309
|
+
id: workstreamNodeId(workstream.id),
|
|
310
|
+
kind: 'workstream',
|
|
311
|
+
parentId: undefined,
|
|
312
|
+
label: workstream.title,
|
|
313
|
+
state,
|
|
314
|
+
startedAt: workstream.createdAt,
|
|
315
|
+
completedAt,
|
|
316
|
+
elapsedMs: Math.max(0, (completedAt ?? now) - workstream.createdAt),
|
|
317
|
+
usage: sumWorkItemUsage(displayUsages),
|
|
318
|
+
costUsd,
|
|
319
|
+
costState,
|
|
320
|
+
currentActivity: undefined,
|
|
321
|
+
// A workstream is an FSM coordinating work-items, not itself a
|
|
322
|
+
// conversation loop — steer a work-item instead (mirrors wrfc-chain).
|
|
323
|
+
// Kill is DERIVED (no native single-call cancel): cascades
|
|
324
|
+
// AgentManager.cancel over every agent any item ever spawned — see
|
|
325
|
+
// registry.ts killNode's 'workstream' case.
|
|
326
|
+
capabilities: { interruptible: false, killable, pausable: false, resumable: false, steerable: false },
|
|
327
|
+
raw: workstream,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
|
+
import type { ScheduleEntry } from '../../../tools/workflow/index.js';
|
|
3
|
+
import type { ProcessNode } from '../types.js';
|
|
4
|
+
/** Schedule node ids are namespaced: entries are keyed by user-chosen names. */
|
|
5
|
+
export declare function scheduleNodeId(name: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* ScheduleEntry → ProcessNode. A schedule between runs is honestly 'idle'
|
|
8
|
+
* (not force-fit into an active state); disabled maps to 'paused' (Wave 6,
|
|
9
|
+
* wo-F item d2 — NOT 'killed': the entry still exists and ScheduleManager.
|
|
10
|
+
* enable() can re-arm it, so collapsing it into a terminal state was
|
|
11
|
+
* dishonest). resumable mirrors the inverse of pausable.
|
|
12
|
+
*/
|
|
13
|
+
export declare function adaptSchedule(entry: ScheduleEntry): ProcessNode;
|
|
14
|
+
//# sourceMappingURL=schedule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../../../src/platform/runtime/fleet/adapters/schedule.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,WAAW,CAe/D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
|
+
/** Schedule node ids are namespaced: entries are keyed by user-chosen names. */
|
|
3
|
+
export function scheduleNodeId(name) {
|
|
4
|
+
return `schedule:${name}`;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* ScheduleEntry → ProcessNode. A schedule between runs is honestly 'idle'
|
|
8
|
+
* (not force-fit into an active state); disabled maps to 'paused' (Wave 6,
|
|
9
|
+
* wo-F item d2 — NOT 'killed': the entry still exists and ScheduleManager.
|
|
10
|
+
* enable() can re-arm it, so collapsing it into a terminal state was
|
|
11
|
+
* dishonest). resumable mirrors the inverse of pausable.
|
|
12
|
+
*/
|
|
13
|
+
export function adaptSchedule(entry) {
|
|
14
|
+
return {
|
|
15
|
+
id: scheduleNodeId(entry.name),
|
|
16
|
+
kind: 'schedule',
|
|
17
|
+
parentId: undefined,
|
|
18
|
+
label: `${entry.name} (${entry.interval})`,
|
|
19
|
+
task: entry.command,
|
|
20
|
+
state: entry.enabled ? 'idle' : 'paused',
|
|
21
|
+
startedAt: entry.lastRun,
|
|
22
|
+
elapsedMs: 0,
|
|
23
|
+
costUsd: null,
|
|
24
|
+
costState: 'unpriced',
|
|
25
|
+
capabilities: { interruptible: false, killable: true, pausable: entry.enabled, resumable: !entry.enabled, steerable: false },
|
|
26
|
+
raw: entry,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
|
+
import type { TriggerDefinition } from '../../../tools/workflow/index.js';
|
|
3
|
+
import type { ProcessNode } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* TriggerDefinition → ProcessNode. Triggers have no timestamps and no run
|
|
6
|
+
* state — enabled means armed ('idle'), disabled maps to 'paused' (Wave 6,
|
|
7
|
+
* wo-F item d2 — NOT 'killed': the definition still exists and
|
|
8
|
+
* TriggerManager.enable() can re-arm it). resumable mirrors the inverse of
|
|
9
|
+
* pausable.
|
|
10
|
+
*/
|
|
11
|
+
export declare function adaptTrigger(def: TriggerDefinition): ProcessNode;
|
|
12
|
+
//# sourceMappingURL=trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../../../src/platform/runtime/fleet/adapters/trigger.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,iBAAiB,GAAG,WAAW,CAahE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
|
+
/**
|
|
3
|
+
* TriggerDefinition → ProcessNode. Triggers have no timestamps and no run
|
|
4
|
+
* state — enabled means armed ('idle'), disabled maps to 'paused' (Wave 6,
|
|
5
|
+
* wo-F item d2 — NOT 'killed': the definition still exists and
|
|
6
|
+
* TriggerManager.enable() can re-arm it). resumable mirrors the inverse of
|
|
7
|
+
* pausable.
|
|
8
|
+
*/
|
|
9
|
+
export function adaptTrigger(def) {
|
|
10
|
+
return {
|
|
11
|
+
id: def.id,
|
|
12
|
+
kind: 'trigger',
|
|
13
|
+
parentId: undefined,
|
|
14
|
+
label: `on ${def.event} → ${def.action}`,
|
|
15
|
+
state: def.enabled ? 'idle' : 'paused',
|
|
16
|
+
elapsedMs: 0,
|
|
17
|
+
costUsd: null,
|
|
18
|
+
costState: 'unpriced',
|
|
19
|
+
capabilities: { interruptible: false, killable: true, pausable: def.enabled, resumable: !def.enabled, steerable: false },
|
|
20
|
+
raw: def,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
|
+
import type { WatcherRecord } from '../../store/domains/watchers.js';
|
|
3
|
+
import type { ProcessNode } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* WatcherRecord → ProcessNode. WatcherRegistry.list() already normalizes each
|
|
6
|
+
* record through its sourceStatusFor derivation (healthy/lagging/stale/
|
|
7
|
+
* failed), so the mapping here reads the post-derivation state:
|
|
8
|
+
* running → 'idle' (alive, armed between checks), starting → 'queued',
|
|
9
|
+
* degraded → 'stalled' (heartbeat lagging/stale is the watcher-shaped stall),
|
|
10
|
+
* failed → 'failed', stopped → 'killed'.
|
|
11
|
+
*/
|
|
12
|
+
export declare function adaptWatcher(record: WatcherRecord, now: number): ProcessNode;
|
|
13
|
+
//# sourceMappingURL=watcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../../../../src/platform/runtime/fleet/adapters/watcher.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,aAAa,CAAC;AAE7D;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,CAqC5E"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
|
+
/**
|
|
3
|
+
* WatcherRecord → ProcessNode. WatcherRegistry.list() already normalizes each
|
|
4
|
+
* record through its sourceStatusFor derivation (healthy/lagging/stale/
|
|
5
|
+
* failed), so the mapping here reads the post-derivation state:
|
|
6
|
+
* running → 'idle' (alive, armed between checks), starting → 'queued',
|
|
7
|
+
* degraded → 'stalled' (heartbeat lagging/stale is the watcher-shaped stall),
|
|
8
|
+
* failed → 'failed', stopped → 'killed'.
|
|
9
|
+
*/
|
|
10
|
+
export function adaptWatcher(record, now) {
|
|
11
|
+
let state;
|
|
12
|
+
switch (record.state) {
|
|
13
|
+
case 'running':
|
|
14
|
+
state = 'idle';
|
|
15
|
+
break;
|
|
16
|
+
case 'starting':
|
|
17
|
+
state = 'queued';
|
|
18
|
+
break;
|
|
19
|
+
case 'degraded':
|
|
20
|
+
state = 'stalled';
|
|
21
|
+
break;
|
|
22
|
+
case 'failed':
|
|
23
|
+
state = 'failed';
|
|
24
|
+
break;
|
|
25
|
+
case 'stopped':
|
|
26
|
+
state = 'killed';
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
const alive = record.state === 'running' || record.state === 'starting' || record.state === 'degraded';
|
|
30
|
+
const statusText = record.degradedReason ?? record.sourceStatus;
|
|
31
|
+
return {
|
|
32
|
+
id: record.id,
|
|
33
|
+
kind: 'watcher',
|
|
34
|
+
parentId: undefined,
|
|
35
|
+
label: record.label,
|
|
36
|
+
state,
|
|
37
|
+
startedAt: record.source.createdAt,
|
|
38
|
+
elapsedMs: alive ? Math.max(0, now - record.source.createdAt) : 0,
|
|
39
|
+
costUsd: null,
|
|
40
|
+
costState: 'unpriced',
|
|
41
|
+
currentActivity: statusText
|
|
42
|
+
? { kind: 'phase', text: statusText, at: record.lastHeartbeatAt ?? record.source.createdAt }
|
|
43
|
+
: undefined,
|
|
44
|
+
capabilities: { interruptible: false, killable: alive, pausable: false, resumable: false, steerable: false },
|
|
45
|
+
raw: record,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
|
+
import type { WorkflowInstance } from '../../../tools/workflow/index.js';
|
|
3
|
+
import type { ProcessNode } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* WorkflowInstance → ProcessNode. Workflow FSMs are a SILENT source (no bus
|
|
6
|
+
* emission); their liveness rides the registry's coalesced tick, and the
|
|
7
|
+
* manager self-evicts completed entries (1 h TTL / 50 cap) so terminal nodes
|
|
8
|
+
* eventually disappear from the snapshot.
|
|
9
|
+
*/
|
|
10
|
+
export declare function adaptWorkflow(instance: WorkflowInstance, now: number): ProcessNode;
|
|
11
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../../../src/platform/runtime/fleet/adapters/workflow.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,aAAa,CAAC;AAE7D;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,CAuBlF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
|
+
/**
|
|
3
|
+
* WorkflowInstance → ProcessNode. Workflow FSMs are a SILENT source (no bus
|
|
4
|
+
* emission); their liveness rides the registry's coalesced tick, and the
|
|
5
|
+
* manager self-evicts completed entries (1 h TTL / 50 cap) so terminal nodes
|
|
6
|
+
* eventually disappear from the snapshot.
|
|
7
|
+
*/
|
|
8
|
+
export function adaptWorkflow(instance, now) {
|
|
9
|
+
let state;
|
|
10
|
+
if (instance.cancelled)
|
|
11
|
+
state = 'killed';
|
|
12
|
+
else if (instance.completedAt !== undefined)
|
|
13
|
+
state = 'done';
|
|
14
|
+
else
|
|
15
|
+
state = 'executing-tool';
|
|
16
|
+
const active = state === 'executing-tool';
|
|
17
|
+
return {
|
|
18
|
+
id: instance.id,
|
|
19
|
+
kind: 'workflow',
|
|
20
|
+
parentId: undefined,
|
|
21
|
+
label: instance.definition,
|
|
22
|
+
task: instance.task,
|
|
23
|
+
state,
|
|
24
|
+
startedAt: instance.startedAt,
|
|
25
|
+
completedAt: instance.completedAt,
|
|
26
|
+
elapsedMs: Math.max(0, (instance.completedAt ?? now) - instance.startedAt),
|
|
27
|
+
costUsd: null,
|
|
28
|
+
costState: 'unpriced',
|
|
29
|
+
// Silent source: anchored to startedAt (no state-transition timestamp).
|
|
30
|
+
currentActivity: active ? { kind: 'phase', text: instance.currentState, at: instance.startedAt } : undefined,
|
|
31
|
+
capabilities: { interruptible: false, killable: active, pausable: false, resumable: false, steerable: false },
|
|
32
|
+
raw: instance,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
|
+
import type { WrfcChain, WrfcSubtask } from '../../../agents/wrfc-types.js';
|
|
3
|
+
import type { ProcessNode } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Reprice a WRFC owner agent node for honest DISPLAY. The owner runs no LLM turn
|
|
6
|
+
* itself; at completion its usage is backfilled from aggregateChainUsage — a
|
|
7
|
+
* mixed-model rollup of its children — so pricing it with a single owner model is
|
|
8
|
+
* wrong and leaving it "unpriced" while its children priced fine is misleading.
|
|
9
|
+
* Instead adopt the chain node's per-child-summed cost (and its model descriptor).
|
|
10
|
+
*
|
|
11
|
+
* Returns the SAME node reference when no reprice applies (owner already priced, or
|
|
12
|
+
* the chain has no priced cost), so callers can skip untouched nodes. The owner is
|
|
13
|
+
* excluded from every leaf-sum (registry aggregateCost / isWrfcOwnerAgentNode), so
|
|
14
|
+
* adopting the chain total here can never double-count.
|
|
15
|
+
*/
|
|
16
|
+
export declare function repriceWrfcOwnerNode(ownerNode: ProcessNode, chainNode: ProcessNode): ProcessNode;
|
|
17
|
+
/**
|
|
18
|
+
* The subtask's currently-active member agent, i.e. whichever role is
|
|
19
|
+
* driving its current phase. Undefined when the subtask has no phase
|
|
20
|
+
* currently in flight (pending/passed/failed) — matches subtaskState()'s
|
|
21
|
+
* own phase mapping above.
|
|
22
|
+
*/
|
|
23
|
+
export declare function activeSubtaskMemberAgentId(subtask: WrfcSubtask): string | undefined;
|
|
24
|
+
/** WrfcSubtask → ProcessNode (child of its chain node). */
|
|
25
|
+
export declare function adaptSubtask(subtask: WrfcSubtask, chain: WrfcChain, opts: {
|
|
26
|
+
steerable: boolean;
|
|
27
|
+
}): ProcessNode;
|
|
28
|
+
/**
|
|
29
|
+
* WrfcChain → ProcessNode. `memberNodes` are the already-adapted agent nodes
|
|
30
|
+
* whose ids appear in chain.allAgentIds, EXCLUDING the owner agent (see
|
|
31
|
+
* aggregateCost). Chain nodes are roots (the owner agent hangs under the
|
|
32
|
+
* chain via its wrfcId edge, not the other way around).
|
|
33
|
+
*/
|
|
34
|
+
export declare function adaptChain(chain: WrfcChain, memberNodes: readonly ProcessNode[], now: number): ProcessNode;
|
|
35
|
+
//# sourceMappingURL=wrfc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrfc.d.ts","sourceRoot":"","sources":["../../../../../src/platform/runtime/fleet/adapters/wrfc.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAA8B,MAAM,aAAa,CAAC;AAuK3E;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,GAAG,WAAW,CAShG;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAWnF;AAED,2DAA2D;AAC3D,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG,WAAW,CAwB9G;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,WAAW,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,CAiC1G"}
|