opencandle 0.11.0 → 0.12.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/README.md +25 -28
- package/dist/analysts/contracts.js +0 -1
- package/dist/analysts/orchestrator.d.ts +2 -0
- package/dist/analysts/orchestrator.js +19 -1
- package/dist/cli-main.js +13 -7
- package/dist/cli-options.d.ts +4 -0
- package/dist/cli-options.js +33 -0
- package/dist/cli.js +8 -3
- package/dist/config.js +0 -1
- package/dist/doctor/cli-command.js +2 -1
- package/dist/doctor/render.js +0 -1
- package/dist/doctor/report.js +41 -12
- package/dist/gui/server/ask-user-bridge.d.ts +19 -0
- package/dist/gui/server/ask-user-bridge.js +55 -0
- package/dist/gui/server/automation-heartbeat.d.ts +25 -0
- package/dist/gui/server/automation-heartbeat.js +61 -0
- package/dist/gui/server/background-quotes.d.ts +39 -0
- package/dist/gui/server/background-quotes.js +71 -0
- package/dist/gui/server/chat-event-adapter.d.ts +16 -0
- package/dist/gui/server/chat-event-adapter.js +263 -0
- package/dist/gui/server/gui-session-manager.d.ts +2 -0
- package/dist/gui/server/gui-session-manager.js +4 -0
- package/dist/gui/server/http-routes.d.ts +69 -0
- package/dist/gui/server/http-routes.js +1008 -0
- package/dist/gui/server/invoke-tool.d.ts +47 -0
- package/dist/gui/server/invoke-tool.js +373 -0
- package/dist/gui/server/live-chat-event-adapter.d.ts +19 -0
- package/dist/gui/server/live-chat-event-adapter.js +206 -0
- package/dist/gui/server/local-session-coordinator.d.ts +26 -0
- package/dist/gui/server/local-session-coordinator.js +53 -0
- package/dist/gui/server/market-state-api.d.ts +138 -0
- package/dist/gui/server/market-state-api.js +355 -0
- package/dist/gui/server/model-setup.d.ts +64 -0
- package/dist/gui/server/model-setup.js +150 -0
- package/dist/gui/server/private-api-access.d.ts +6 -0
- package/dist/gui/server/private-api-access.js +53 -0
- package/dist/gui/server/projector.d.ts +49 -0
- package/dist/gui/server/projector.js +296 -0
- package/dist/gui/server/prompt-observation.d.ts +8 -0
- package/dist/gui/server/prompt-observation.js +43 -0
- package/dist/gui/server/quote-snapshot-store.d.ts +14 -0
- package/dist/gui/server/quote-snapshot-store.js +49 -0
- package/dist/gui/server/server.d.ts +1 -0
- package/dist/gui/server/server.js +259 -0
- package/dist/gui/server/session-actions.d.ts +60 -0
- package/dist/gui/server/session-actions.js +218 -0
- package/dist/gui/server/session-entry-wait.d.ts +27 -0
- package/dist/gui/server/session-entry-wait.js +129 -0
- package/dist/gui/server/session-list.d.ts +2 -0
- package/dist/gui/server/session-list.js +11 -0
- package/dist/gui/server/shutdown.d.ts +10 -0
- package/dist/gui/server/shutdown.js +29 -0
- package/dist/gui/server/tool-invoke-ack.d.ts +17 -0
- package/dist/gui/server/tool-invoke-ack.js +26 -0
- package/dist/gui/server/tool-metadata.d.ts +93 -0
- package/dist/gui/server/tool-metadata.js +148 -0
- package/dist/gui/server/websocket.d.ts +9 -0
- package/dist/gui/server/websocket.js +124 -0
- package/dist/gui/server/writer-lock.d.ts +1 -0
- package/dist/gui/server/writer-lock.js +1 -0
- package/dist/gui/server/ws-hub.d.ts +50 -0
- package/dist/gui/server/ws-hub.js +284 -0
- package/dist/gui/shared/chat-events.d.ts +174 -0
- package/dist/gui/shared/chat-events.js +13 -0
- package/dist/gui/shared/event-reducer.d.ts +3 -0
- package/dist/gui/shared/event-reducer.js +187 -0
- package/dist/index.js +0 -1
- package/dist/infra/cache.d.ts +6 -0
- package/dist/infra/cache.js +16 -7
- package/dist/infra/freshness.d.ts +21 -0
- package/dist/infra/freshness.js +118 -0
- package/dist/infra/http-client.js +1 -2
- package/dist/infra/index.js +0 -1
- package/dist/infra/market-calendar.d.ts +14 -0
- package/dist/infra/market-calendar.js +136 -0
- package/dist/infra/native-dependencies.js +0 -1
- package/dist/infra/node-version.js +0 -1
- package/dist/infra/open-url.js +0 -1
- package/dist/infra/opencandle-paths.js +0 -1
- package/dist/infra/rate-limiter.js +1 -1
- package/dist/market-state/alert-conditions.js +0 -1
- package/dist/market-state/alert-runner.d.ts +1 -0
- package/dist/market-state/alert-runner.js +5 -4
- package/dist/market-state/daily-report.js +0 -1
- package/dist/market-state/local-automation-service.js +0 -1
- package/dist/market-state/notification-delivery.js +0 -1
- package/dist/market-state/resolve-for-mutation.js +0 -1
- package/dist/market-state/resolve.js +0 -1
- package/dist/market-state/service.d.ts +26 -21
- package/dist/market-state/service.js +175 -36
- package/dist/market-state/summaries.d.ts +8 -0
- package/dist/market-state/summaries.js +58 -0
- package/dist/memory/index.js +0 -1
- package/dist/memory/manager.js +0 -1
- package/dist/memory/preference-extractor.js +0 -1
- package/dist/memory/retrieval.js +0 -1
- package/dist/memory/sqlite.js +60 -11
- package/dist/memory/storage.js +0 -1
- package/dist/memory/tool-defaults.js +0 -1
- package/dist/memory/types.js +0 -1
- package/dist/monitor.js +0 -1
- package/dist/onboarding/connect.js +0 -1
- package/dist/onboarding/credential-interceptor.js +0 -1
- package/dist/onboarding/degradation-accumulator.js +0 -1
- package/dist/onboarding/prompt-user.d.ts +1 -1
- package/dist/onboarding/prompt-user.js +0 -1
- package/dist/onboarding/provider-status.js +0 -1
- package/dist/onboarding/providers.d.ts +25 -1
- package/dist/onboarding/providers.js +26 -1
- package/dist/onboarding/state.js +0 -1
- package/dist/onboarding/tool-helpers.js +0 -1
- package/dist/onboarding/tool-tags.js +0 -1
- package/dist/onboarding/validate-model-key.d.ts +17 -0
- package/dist/onboarding/validate-model-key.js +54 -0
- package/dist/onboarding/validation.js +0 -1
- package/dist/pi/opencandle-extension.js +46 -7
- package/dist/pi/session-action-dedupe.js +0 -1
- package/dist/pi/session-storage.js +0 -1
- package/dist/pi/session-writer-lock.js +0 -1
- package/dist/pi/session.js +0 -1
- package/dist/pi/setup.d.ts +2 -0
- package/dist/pi/setup.js +10 -3
- package/dist/pi/tool-adapter.js +0 -1
- package/dist/pi/tui-session-coordinator.js +0 -1
- package/dist/prompts/context-builder.js +1 -2
- package/dist/prompts/disclaimer.js +0 -1
- package/dist/prompts/policy-cards.js +0 -1
- package/dist/prompts/sections.js +0 -1
- package/dist/prompts/symbol-preflight.js +0 -1
- package/dist/prompts/workflow-prompts.js +0 -1
- package/dist/providers/alpha-vantage.js +8 -3
- package/dist/providers/coingecko.js +1 -1
- package/dist/providers/errors.js +0 -1
- package/dist/providers/exa-search.js +11 -10
- package/dist/providers/external-tool-command.js +0 -1
- package/dist/providers/external-tool-error.js +0 -1
- package/dist/providers/fear-greed.js +0 -1
- package/dist/providers/finnhub.js +0 -1
- package/dist/providers/fred.js +0 -1
- package/dist/providers/index.js +0 -1
- package/dist/providers/polymarket.d.ts +2 -0
- package/dist/providers/polymarket.js +162 -0
- package/dist/providers/provider-credential-error.js +0 -1
- package/dist/providers/reddit-cli.js +0 -1
- package/dist/providers/reddit.js +0 -1
- package/dist/providers/sec-edgar.js +0 -1
- package/dist/providers/tradingview.js +1 -2
- package/dist/providers/twitter-cli.js +0 -1
- package/dist/providers/twitter.js +0 -1
- package/dist/providers/web-search.js +15 -12
- package/dist/providers/with-fallback.js +0 -1
- package/dist/providers/wrap-provider.js +5 -4
- package/dist/providers/yahoo-finance.d.ts +3 -0
- package/dist/providers/yahoo-finance.js +272 -13
- package/dist/routing/classify-intent.js +0 -1
- package/dist/routing/defaults.js +0 -1
- package/dist/routing/entity-extractor.js +18 -3
- package/dist/routing/fund-symbols.js +0 -1
- package/dist/routing/horizon.js +0 -1
- package/dist/routing/index.js +0 -1
- package/dist/routing/legacy-rule-router.js +0 -1
- package/dist/routing/planning.js +0 -1
- package/dist/routing/route-manifest.js +1 -2
- package/dist/routing/router-llm-client.d.ts +2 -2
- package/dist/routing/router-llm-client.js +18 -4
- package/dist/routing/router-prompt.js +0 -1
- package/dist/routing/router-types.js +0 -1
- package/dist/routing/router.d.ts +1 -1
- package/dist/routing/router.js +274 -6
- package/dist/routing/slot-resolver.d.ts +1 -0
- package/dist/routing/slot-resolver.js +1 -2
- package/dist/routing/symbol-disambiguator.js +0 -1
- package/dist/routing/turn-context.js +0 -1
- package/dist/routing/types.js +0 -1
- package/dist/runtime/answer-contracts.js +0 -1
- package/dist/runtime/artifact-contracts.js +0 -1
- package/dist/runtime/evidence.d.ts +1 -0
- package/dist/runtime/evidence.js +0 -1
- package/dist/runtime/numeric-claims.d.ts +23 -0
- package/dist/runtime/numeric-claims.js +99 -0
- package/dist/runtime/planning-evidence.js +1 -77
- package/dist/runtime/prompt-step.d.ts +10 -1
- package/dist/runtime/prompt-step.js +116 -3
- package/dist/runtime/provider-tracker.js +0 -1
- package/dist/runtime/run-context.js +0 -1
- package/dist/runtime/session-coordinator.d.ts +11 -1
- package/dist/runtime/session-coordinator.js +352 -50
- package/dist/runtime/session-title.js +0 -1
- package/dist/runtime/tool-defaults-wrapper.js +0 -1
- package/dist/runtime/validation.d.ts +3 -1
- package/dist/runtime/validation.js +0 -1
- package/dist/runtime/workflow-events.d.ts +1 -1
- package/dist/runtime/workflow-events.js +0 -1
- package/dist/runtime/workflow-runner.d.ts +1 -0
- package/dist/runtime/workflow-runner.js +8 -3
- package/dist/runtime/workflow-types.d.ts +3 -0
- package/dist/runtime/workflow-types.js +0 -1
- package/dist/sentiment/adapters/finnhub.js +0 -1
- package/dist/sentiment/adapters/reddit.js +0 -1
- package/dist/sentiment/adapters/twitter.js +0 -1
- package/dist/sentiment/adapters/web.js +0 -1
- package/dist/sentiment/index.js +4 -2
- package/dist/sentiment/insights.js +0 -1
- package/dist/sentiment/keywords.js +0 -1
- package/dist/sentiment/pipeline.js +0 -1
- package/dist/sentiment/scorer.js +0 -1
- package/dist/sentiment/store.js +0 -1
- package/dist/sentiment/trends.js +0 -1
- package/dist/sentiment/types.js +0 -1
- package/dist/system-prompt.js +0 -1
- package/dist/tool-kit.js +0 -1
- package/dist/tools/fundamentals/company-overview.d.ts +1 -1
- package/dist/tools/fundamentals/company-overview.js +2 -1
- package/dist/tools/fundamentals/comps.d.ts +1 -0
- package/dist/tools/fundamentals/comps.js +25 -12
- package/dist/tools/fundamentals/dcf.js +183 -113
- package/dist/tools/fundamentals/earnings.d.ts +1 -1
- package/dist/tools/fundamentals/earnings.js +2 -1
- package/dist/tools/fundamentals/financials.js +2 -1
- package/dist/tools/fundamentals/sec-filings.js +0 -1
- package/dist/tools/index.d.ts +117 -2
- package/dist/tools/index.js +3 -1
- package/dist/tools/interaction/ask-user.js +11 -1
- package/dist/tools/macro/event-probabilities.d.ts +8 -0
- package/dist/tools/macro/event-probabilities.js +120 -0
- package/dist/tools/macro/fear-greed.d.ts +1 -1
- package/dist/tools/macro/fear-greed.js +0 -1
- package/dist/tools/macro/fred-data.d.ts +1 -1
- package/dist/tools/macro/fred-data.js +2 -1
- package/dist/tools/market/crypto-history.js +0 -1
- package/dist/tools/market/crypto-price.d.ts +4 -1
- package/dist/tools/market/crypto-price.js +10 -2
- package/dist/tools/market/screen-stocks.js +14 -4
- package/dist/tools/market/search-ticker.js +1 -2
- package/dist/tools/market/stock-history.js +0 -1
- package/dist/tools/market/stock-quote.d.ts +4 -1
- package/dist/tools/market/stock-quote.js +9 -5
- package/dist/tools/options/greeks.js +0 -1
- package/dist/tools/options/option-chain.d.ts +4 -1
- package/dist/tools/options/option-chain.js +12 -2
- package/dist/tools/portfolio/alerts.d.ts +2 -1
- package/dist/tools/portfolio/alerts.js +228 -2
- package/dist/tools/portfolio/correlation.js +23 -5
- package/dist/tools/portfolio/daily-report.js +0 -1
- package/dist/tools/portfolio/holdings-overlap.js +0 -1
- package/dist/tools/portfolio/notifications.js +0 -1
- package/dist/tools/portfolio/risk-analysis.d.ts +1 -1
- package/dist/tools/portfolio/risk-analysis.js +1 -2
- package/dist/tools/portfolio/tracker.d.ts +3 -1
- package/dist/tools/portfolio/tracker.js +57 -10
- package/dist/tools/portfolio/watchlist.d.ts +3 -6
- package/dist/tools/portfolio/watchlist.js +101 -110
- package/dist/tools/sentiment/insight-format.js +0 -1
- package/dist/tools/sentiment/query-match.js +0 -1
- package/dist/tools/sentiment/reddit-sentiment.js +0 -1
- package/dist/tools/sentiment/sentiment-summary.js +8 -4
- package/dist/tools/sentiment/sentiment-trend.d.ts +5 -1
- package/dist/tools/sentiment/sentiment-trend.js +6 -2
- package/dist/tools/sentiment/twitter-sentiment.js +0 -1
- package/dist/tools/sentiment/untrusted-text.js +0 -1
- package/dist/tools/sentiment/web-search.d.ts +1 -1
- package/dist/tools/sentiment/web-search.js +0 -1
- package/dist/tools/sentiment/web-sentiment.js +0 -1
- package/dist/tools/technical/backtest.js +0 -1
- package/dist/tools/technical/indicators.js +1 -2
- package/dist/types/fundamentals.d.ts +1 -0
- package/dist/types/fundamentals.js +0 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +0 -1
- package/dist/types/macro.js +0 -1
- package/dist/types/market.d.ts +8 -0
- package/dist/types/market.js +0 -1
- package/dist/types/options.d.ts +1 -0
- package/dist/types/options.js +0 -1
- package/dist/types/portfolio.js +0 -1
- package/dist/types/prediction-markets.d.ts +13 -0
- package/dist/types/prediction-markets.js +1 -0
- package/dist/types/sentiment.js +0 -1
- package/dist/workflows/compare-assets.js +0 -1
- package/dist/workflows/index.js +0 -1
- package/dist/workflows/options-screener.js +0 -1
- package/dist/workflows/portfolio-builder.js +0 -1
- package/gui/web/dist/assets/CatalogOverlay-CAc7e3Pf.js +1 -0
- package/gui/web/dist/assets/index-BOEKd9wT.css +2 -0
- package/gui/web/dist/assets/index-C-H05cQ2.js +65 -0
- package/gui/web/dist/index.html +2 -2
- package/package.json +16 -22
- package/dist/analysts/contracts.js.map +0 -1
- package/dist/analysts/orchestrator.js.map +0 -1
- package/dist/cli-main.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/doctor/cli-command.js.map +0 -1
- package/dist/doctor/render.js.map +0 -1
- package/dist/doctor/report.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/infra/cache.js.map +0 -1
- package/dist/infra/http-client.js.map +0 -1
- package/dist/infra/index.js.map +0 -1
- package/dist/infra/native-dependencies.js.map +0 -1
- package/dist/infra/node-version.js.map +0 -1
- package/dist/infra/open-url.js.map +0 -1
- package/dist/infra/opencandle-paths.js.map +0 -1
- package/dist/infra/rate-limiter.js.map +0 -1
- package/dist/market-state/alert-conditions.js.map +0 -1
- package/dist/market-state/alert-runner.js.map +0 -1
- package/dist/market-state/daily-report.js.map +0 -1
- package/dist/market-state/local-automation-service.js.map +0 -1
- package/dist/market-state/notification-delivery.js.map +0 -1
- package/dist/market-state/resolve-for-mutation.js.map +0 -1
- package/dist/market-state/resolve.js.map +0 -1
- package/dist/market-state/service.js.map +0 -1
- package/dist/memory/index.js.map +0 -1
- package/dist/memory/manager.js.map +0 -1
- package/dist/memory/preference-extractor.js.map +0 -1
- package/dist/memory/retrieval.js.map +0 -1
- package/dist/memory/sqlite.js.map +0 -1
- package/dist/memory/storage.js.map +0 -1
- package/dist/memory/tool-defaults.js.map +0 -1
- package/dist/memory/types.js.map +0 -1
- package/dist/monitor.js.map +0 -1
- package/dist/onboarding/connect.js.map +0 -1
- package/dist/onboarding/credential-interceptor.js.map +0 -1
- package/dist/onboarding/degradation-accumulator.js.map +0 -1
- package/dist/onboarding/prompt-user.js.map +0 -1
- package/dist/onboarding/provider-status.js.map +0 -1
- package/dist/onboarding/providers.js.map +0 -1
- package/dist/onboarding/state.js.map +0 -1
- package/dist/onboarding/tool-helpers.js.map +0 -1
- package/dist/onboarding/tool-tags.js.map +0 -1
- package/dist/onboarding/validation.js.map +0 -1
- package/dist/pi/opencandle-extension.js.map +0 -1
- package/dist/pi/session-action-dedupe.js.map +0 -1
- package/dist/pi/session-storage.js.map +0 -1
- package/dist/pi/session-writer-lock.js.map +0 -1
- package/dist/pi/session.js.map +0 -1
- package/dist/pi/setup.js.map +0 -1
- package/dist/pi/tool-adapter.js.map +0 -1
- package/dist/pi/tui-session-coordinator.js.map +0 -1
- package/dist/prompts/context-builder.js.map +0 -1
- package/dist/prompts/disclaimer.js.map +0 -1
- package/dist/prompts/policy-cards.js.map +0 -1
- package/dist/prompts/sections.js.map +0 -1
- package/dist/prompts/symbol-preflight.js.map +0 -1
- package/dist/prompts/workflow-prompts.js.map +0 -1
- package/dist/providers/alpha-vantage.js.map +0 -1
- package/dist/providers/coingecko.js.map +0 -1
- package/dist/providers/errors.js.map +0 -1
- package/dist/providers/exa-search.js.map +0 -1
- package/dist/providers/external-tool-command.js.map +0 -1
- package/dist/providers/external-tool-error.js.map +0 -1
- package/dist/providers/fear-greed.js.map +0 -1
- package/dist/providers/finnhub.js.map +0 -1
- package/dist/providers/fred.js.map +0 -1
- package/dist/providers/index.js.map +0 -1
- package/dist/providers/provider-credential-error.js.map +0 -1
- package/dist/providers/reddit-cli.js.map +0 -1
- package/dist/providers/reddit.js.map +0 -1
- package/dist/providers/sec-edgar.js.map +0 -1
- package/dist/providers/tradingview.js.map +0 -1
- package/dist/providers/twitter-cli.js.map +0 -1
- package/dist/providers/twitter.js.map +0 -1
- package/dist/providers/web-search.js.map +0 -1
- package/dist/providers/with-fallback.js.map +0 -1
- package/dist/providers/wrap-provider.js.map +0 -1
- package/dist/providers/yahoo-finance.js.map +0 -1
- package/dist/routing/classify-intent.js.map +0 -1
- package/dist/routing/defaults.js.map +0 -1
- package/dist/routing/entity-extractor.js.map +0 -1
- package/dist/routing/fund-symbols.js.map +0 -1
- package/dist/routing/horizon.js.map +0 -1
- package/dist/routing/index.js.map +0 -1
- package/dist/routing/legacy-rule-router.js.map +0 -1
- package/dist/routing/planning.js.map +0 -1
- package/dist/routing/route-manifest.js.map +0 -1
- package/dist/routing/router-llm-client.js.map +0 -1
- package/dist/routing/router-prompt.js.map +0 -1
- package/dist/routing/router-types.js.map +0 -1
- package/dist/routing/router.js.map +0 -1
- package/dist/routing/slot-resolver.js.map +0 -1
- package/dist/routing/symbol-disambiguator.js.map +0 -1
- package/dist/routing/turn-context.js.map +0 -1
- package/dist/routing/types.js.map +0 -1
- package/dist/runtime/answer-contracts.js.map +0 -1
- package/dist/runtime/artifact-contracts.js.map +0 -1
- package/dist/runtime/evidence.js.map +0 -1
- package/dist/runtime/planning-evidence.js.map +0 -1
- package/dist/runtime/prompt-step.js.map +0 -1
- package/dist/runtime/provider-tracker.js.map +0 -1
- package/dist/runtime/run-context.js.map +0 -1
- package/dist/runtime/session-coordinator.js.map +0 -1
- package/dist/runtime/session-title.js.map +0 -1
- package/dist/runtime/tool-defaults-wrapper.js.map +0 -1
- package/dist/runtime/validation.js.map +0 -1
- package/dist/runtime/workflow-events.js.map +0 -1
- package/dist/runtime/workflow-runner.js.map +0 -1
- package/dist/runtime/workflow-types.js.map +0 -1
- package/dist/sentiment/adapters/finnhub.js.map +0 -1
- package/dist/sentiment/adapters/reddit.js.map +0 -1
- package/dist/sentiment/adapters/twitter.js.map +0 -1
- package/dist/sentiment/adapters/web.js.map +0 -1
- package/dist/sentiment/index.js.map +0 -1
- package/dist/sentiment/insights.js.map +0 -1
- package/dist/sentiment/keywords.js.map +0 -1
- package/dist/sentiment/pipeline.js.map +0 -1
- package/dist/sentiment/scorer.js.map +0 -1
- package/dist/sentiment/store.js.map +0 -1
- package/dist/sentiment/trends.js.map +0 -1
- package/dist/sentiment/types.js.map +0 -1
- package/dist/system-prompt.js.map +0 -1
- package/dist/tool-kit.js.map +0 -1
- package/dist/tools/fundamentals/company-overview.js.map +0 -1
- package/dist/tools/fundamentals/comps.js.map +0 -1
- package/dist/tools/fundamentals/dcf.js.map +0 -1
- package/dist/tools/fundamentals/earnings.js.map +0 -1
- package/dist/tools/fundamentals/financials.js.map +0 -1
- package/dist/tools/fundamentals/sec-filings.js.map +0 -1
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/interaction/ask-user.js.map +0 -1
- package/dist/tools/macro/fear-greed.js.map +0 -1
- package/dist/tools/macro/fred-data.js.map +0 -1
- package/dist/tools/market/crypto-history.js.map +0 -1
- package/dist/tools/market/crypto-price.js.map +0 -1
- package/dist/tools/market/screen-stocks.js.map +0 -1
- package/dist/tools/market/search-ticker.js.map +0 -1
- package/dist/tools/market/stock-history.js.map +0 -1
- package/dist/tools/market/stock-quote.js.map +0 -1
- package/dist/tools/options/greeks.js.map +0 -1
- package/dist/tools/options/option-chain.js.map +0 -1
- package/dist/tools/portfolio/alerts.js.map +0 -1
- package/dist/tools/portfolio/correlation.js.map +0 -1
- package/dist/tools/portfolio/daily-report.js.map +0 -1
- package/dist/tools/portfolio/holdings-overlap.js.map +0 -1
- package/dist/tools/portfolio/notifications.js.map +0 -1
- package/dist/tools/portfolio/risk-analysis.js.map +0 -1
- package/dist/tools/portfolio/tracker.js.map +0 -1
- package/dist/tools/portfolio/watchlist.js.map +0 -1
- package/dist/tools/sentiment/insight-format.js.map +0 -1
- package/dist/tools/sentiment/query-match.js.map +0 -1
- package/dist/tools/sentiment/reddit-sentiment.js.map +0 -1
- package/dist/tools/sentiment/sentiment-summary.js.map +0 -1
- package/dist/tools/sentiment/sentiment-trend.js.map +0 -1
- package/dist/tools/sentiment/twitter-sentiment.js.map +0 -1
- package/dist/tools/sentiment/untrusted-text.js.map +0 -1
- package/dist/tools/sentiment/web-search.js.map +0 -1
- package/dist/tools/sentiment/web-sentiment.js.map +0 -1
- package/dist/tools/technical/backtest.js.map +0 -1
- package/dist/tools/technical/indicators.js.map +0 -1
- package/dist/types/fundamentals.js.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/macro.js.map +0 -1
- package/dist/types/market.js.map +0 -1
- package/dist/types/options.js.map +0 -1
- package/dist/types/portfolio.js.map +0 -1
- package/dist/types/sentiment.js.map +0 -1
- package/dist/workflows/compare-assets.js.map +0 -1
- package/dist/workflows/index.js.map +0 -1
- package/dist/workflows/options-screener.js.map +0 -1
- package/dist/workflows/portfolio-builder.js.map +0 -1
- package/gui/server/ask-user-bridge.ts +0 -89
- package/gui/server/automation-heartbeat.ts +0 -97
- package/gui/server/background-quotes.ts +0 -127
- package/gui/server/chat-event-adapter.ts +0 -210
- package/gui/server/chat-run-session.ts +0 -16
- package/gui/server/gui-session-manager.ts +0 -5
- package/gui/server/http-routes.ts +0 -953
- package/gui/server/invoke-tool.ts +0 -489
- package/gui/server/live-chat-event-adapter.ts +0 -208
- package/gui/server/local-session-coordinator.ts +0 -97
- package/gui/server/market-state-api.ts +0 -273
- package/gui/server/model-setup.ts +0 -254
- package/gui/server/package.json +0 -5
- package/gui/server/private-api-access.ts +0 -62
- package/gui/server/projector.ts +0 -263
- package/gui/server/prompt-observation.ts +0 -58
- package/gui/server/quote-snapshot-store.ts +0 -50
- package/gui/server/server.ts +0 -289
- package/gui/server/session-actions.ts +0 -331
- package/gui/server/session-entry-wait.ts +0 -160
- package/gui/server/shutdown.ts +0 -47
- package/gui/server/tool-invoke-ack.ts +0 -49
- package/gui/server/tool-metadata.ts +0 -167
- package/gui/server/websocket.ts +0 -138
- package/gui/server/writer-lock.ts +0 -1
- package/gui/server/ws-hub.ts +0 -391
- package/gui/shared/chat-events.ts +0 -156
- package/gui/shared/event-reducer.ts +0 -219
- package/gui/web/dist/assets/CatalogOverlay-ChRTKNlf.js +0 -1
- package/gui/web/dist/assets/index-BzyqyVnd.css +0 -2
- package/gui/web/dist/assets/index-DvMjkOP9.js +0 -65
- package/src/analysts/contracts.ts +0 -176
- package/src/analysts/orchestrator.ts +0 -224
- package/src/cli-main.ts +0 -510
- package/src/cli.ts +0 -17
- package/src/config.ts +0 -272
- package/src/doctor/cli-command.ts +0 -83
- package/src/doctor/render.ts +0 -37
- package/src/doctor/report.ts +0 -638
- package/src/index.ts +0 -5
- package/src/infra/cache.ts +0 -114
- package/src/infra/http-client.ts +0 -134
- package/src/infra/index.ts +0 -14
- package/src/infra/native-dependencies.ts +0 -84
- package/src/infra/node-version.ts +0 -23
- package/src/infra/open-url.ts +0 -28
- package/src/infra/opencandle-paths.ts +0 -53
- package/src/infra/rate-limiter.ts +0 -76
- package/src/market-state/alert-conditions.ts +0 -82
- package/src/market-state/alert-runner.ts +0 -863
- package/src/market-state/daily-report.ts +0 -237
- package/src/market-state/local-automation-service.ts +0 -162
- package/src/market-state/notification-delivery.ts +0 -158
- package/src/market-state/resolve-for-mutation.ts +0 -24
- package/src/market-state/resolve.ts +0 -112
- package/src/market-state/service.ts +0 -2208
- package/src/memory/index.ts +0 -10
- package/src/memory/manager.ts +0 -190
- package/src/memory/preference-extractor.ts +0 -106
- package/src/memory/retrieval.ts +0 -71
- package/src/memory/sqlite.ts +0 -577
- package/src/memory/storage.ts +0 -195
- package/src/memory/tool-defaults.ts +0 -108
- package/src/memory/types.ts +0 -71
- package/src/monitor.ts +0 -123
- package/src/onboarding/connect.ts +0 -177
- package/src/onboarding/credential-interceptor.ts +0 -122
- package/src/onboarding/degradation-accumulator.ts +0 -77
- package/src/onboarding/prompt-user.ts +0 -85
- package/src/onboarding/provider-status.ts +0 -382
- package/src/onboarding/providers.ts +0 -414
- package/src/onboarding/state.ts +0 -216
- package/src/onboarding/tool-helpers.ts +0 -104
- package/src/onboarding/tool-tags.ts +0 -244
- package/src/onboarding/validation.ts +0 -152
- package/src/pi/opencandle-extension.ts +0 -1244
- package/src/pi/session-action-dedupe.ts +0 -155
- package/src/pi/session-storage.ts +0 -5
- package/src/pi/session-writer-lock.ts +0 -426
- package/src/pi/session.ts +0 -84
- package/src/pi/setup.ts +0 -399
- package/src/pi/tool-adapter.ts +0 -49
- package/src/pi/tui-session-coordinator.ts +0 -351
- package/src/prompts/context-builder.ts +0 -326
- package/src/prompts/disclaimer.ts +0 -9
- package/src/prompts/policy-cards.ts +0 -228
- package/src/prompts/sections.ts +0 -46
- package/src/prompts/symbol-preflight.ts +0 -80
- package/src/prompts/workflow-prompts.ts +0 -504
- package/src/providers/alpha-vantage.ts +0 -334
- package/src/providers/coingecko.ts +0 -93
- package/src/providers/errors.ts +0 -9
- package/src/providers/exa-search.ts +0 -375
- package/src/providers/external-tool-command.ts +0 -164
- package/src/providers/external-tool-error.ts +0 -20
- package/src/providers/fear-greed.ts +0 -45
- package/src/providers/finnhub.ts +0 -125
- package/src/providers/fred.ts +0 -83
- package/src/providers/index.ts +0 -17
- package/src/providers/provider-credential-error.ts +0 -23
- package/src/providers/reddit-cli.ts +0 -286
- package/src/providers/reddit.ts +0 -106
- package/src/providers/sec-edgar.ts +0 -326
- package/src/providers/tradingview.ts +0 -399
- package/src/providers/twitter-cli.ts +0 -202
- package/src/providers/twitter.ts +0 -102
- package/src/providers/web-search.ts +0 -303
- package/src/providers/with-fallback.ts +0 -42
- package/src/providers/wrap-provider.ts +0 -103
- package/src/providers/yahoo-finance.ts +0 -672
- package/src/routing/classify-intent.ts +0 -380
- package/src/routing/defaults.ts +0 -29
- package/src/routing/entity-extractor.ts +0 -540
- package/src/routing/fund-symbols.ts +0 -58
- package/src/routing/horizon.ts +0 -7
- package/src/routing/index.ts +0 -70
- package/src/routing/legacy-rule-router.ts +0 -13
- package/src/routing/planning.ts +0 -829
- package/src/routing/route-manifest.ts +0 -308
- package/src/routing/router-llm-client.ts +0 -52
- package/src/routing/router-prompt.ts +0 -159
- package/src/routing/router-types.ts +0 -84
- package/src/routing/router.ts +0 -997
- package/src/routing/slot-resolver.ts +0 -213
- package/src/routing/symbol-disambiguator.ts +0 -72
- package/src/routing/turn-context.ts +0 -108
- package/src/routing/types.ts +0 -77
- package/src/runtime/answer-contracts.ts +0 -693
- package/src/runtime/artifact-contracts.ts +0 -77
- package/src/runtime/evidence.ts +0 -77
- package/src/runtime/planning-evidence.ts +0 -682
- package/src/runtime/prompt-step.ts +0 -60
- package/src/runtime/provider-tracker.ts +0 -40
- package/src/runtime/run-context.ts +0 -32
- package/src/runtime/session-coordinator.ts +0 -632
- package/src/runtime/session-title.ts +0 -60
- package/src/runtime/tool-defaults-wrapper.ts +0 -43
- package/src/runtime/validation.ts +0 -211
- package/src/runtime/workflow-events.ts +0 -75
- package/src/runtime/workflow-runner.ts +0 -182
- package/src/runtime/workflow-types.ts +0 -102
- package/src/sentiment/adapters/finnhub.ts +0 -49
- package/src/sentiment/adapters/reddit.ts +0 -65
- package/src/sentiment/adapters/twitter.ts +0 -36
- package/src/sentiment/adapters/web.ts +0 -44
- package/src/sentiment/index.ts +0 -49
- package/src/sentiment/insights.ts +0 -269
- package/src/sentiment/keywords.ts +0 -31
- package/src/sentiment/pipeline.ts +0 -91
- package/src/sentiment/scorer.ts +0 -89
- package/src/sentiment/store.ts +0 -260
- package/src/sentiment/trends.ts +0 -96
- package/src/sentiment/types.ts +0 -112
- package/src/system-prompt.ts +0 -115
- package/src/tool-kit.ts +0 -69
- package/src/tools/AGENTS.md +0 -36
- package/src/tools/fundamentals/company-overview.ts +0 -64
- package/src/tools/fundamentals/comps.ts +0 -169
- package/src/tools/fundamentals/dcf.ts +0 -367
- package/src/tools/fundamentals/earnings.ts +0 -57
- package/src/tools/fundamentals/financials.ts +0 -63
- package/src/tools/fundamentals/sec-filings.ts +0 -105
- package/src/tools/index.ts +0 -101
- package/src/tools/interaction/ask-user.ts +0 -93
- package/src/tools/macro/fear-greed.ts +0 -41
- package/src/tools/macro/fred-data.ts +0 -92
- package/src/tools/market/crypto-history.ts +0 -72
- package/src/tools/market/crypto-price.ts +0 -53
- package/src/tools/market/screen-stocks.ts +0 -279
- package/src/tools/market/search-ticker.ts +0 -254
- package/src/tools/market/stock-history.ts +0 -104
- package/src/tools/market/stock-quote.ts +0 -67
- package/src/tools/options/greeks.ts +0 -81
- package/src/tools/options/option-chain.ts +0 -120
- package/src/tools/portfolio/alerts.ts +0 -457
- package/src/tools/portfolio/correlation.ts +0 -189
- package/src/tools/portfolio/daily-report.ts +0 -107
- package/src/tools/portfolio/holdings-overlap.ts +0 -139
- package/src/tools/portfolio/notifications.ts +0 -45
- package/src/tools/portfolio/risk-analysis.ts +0 -173
- package/src/tools/portfolio/tracker.ts +0 -308
- package/src/tools/portfolio/watchlist.ts +0 -288
- package/src/tools/sentiment/insight-format.ts +0 -50
- package/src/tools/sentiment/query-match.ts +0 -117
- package/src/tools/sentiment/reddit-sentiment.ts +0 -403
- package/src/tools/sentiment/sentiment-summary.ts +0 -383
- package/src/tools/sentiment/sentiment-trend.ts +0 -75
- package/src/tools/sentiment/twitter-sentiment.ts +0 -287
- package/src/tools/sentiment/untrusted-text.ts +0 -21
- package/src/tools/sentiment/web-search.ts +0 -186
- package/src/tools/sentiment/web-sentiment.ts +0 -96
- package/src/tools/technical/backtest.ts +0 -336
- package/src/tools/technical/indicators.ts +0 -281
- package/src/types/fundamentals.ts +0 -46
- package/src/types/index.ts +0 -25
- package/src/types/macro.ts +0 -27
- package/src/types/market.ts +0 -44
- package/src/types/options.ts +0 -52
- package/src/types/portfolio.ts +0 -83
- package/src/types/sentiment.ts +0 -129
- package/src/workflows/compare-assets.ts +0 -89
- package/src/workflows/index.ts +0 -3
- package/src/workflows/options-screener.ts +0 -125
- package/src/workflows/portfolio-builder.ts +0 -63
package/dist/routing/router.js
CHANGED
|
@@ -2,6 +2,7 @@ import { extractEntities, isAmbiguousConceptUsage, isCurrencyCodeUsage, } from "
|
|
|
2
2
|
import { classifyWithLegacyRules } from "./legacy-rule-router.js";
|
|
3
3
|
import { computeMissingRequiredSlots, isDispatchableWorkflow, isRouteKind, isToolBundleName, legacyRouteForRouteKind, routeKindFromLegacyRoute, selectToolBundles, workflowRequiredSlots, } from "./route-manifest.js";
|
|
4
4
|
import { buildRouterPrompt } from "./router-prompt.js";
|
|
5
|
+
import { mapDteHintToTarget } from "./slot-resolver.js";
|
|
5
6
|
import { disambiguateSymbols } from "./symbol-disambiguator.js";
|
|
6
7
|
const VALID_ROUTES = ["workflow", "fallback"];
|
|
7
8
|
const VALID_WORKFLOWS = [
|
|
@@ -26,7 +27,7 @@ export async function route(input, client) {
|
|
|
26
27
|
let firstError;
|
|
27
28
|
try {
|
|
28
29
|
const raw = await client.complete(prompt);
|
|
29
|
-
return postProcessRouterOutput(input.text, validateRouterOutput(raw));
|
|
30
|
+
return postProcessRouterOutput(input.text, validateRouterOutput(raw), input);
|
|
30
31
|
}
|
|
31
32
|
catch (err) {
|
|
32
33
|
firstError = err instanceof Error ? err.message : String(err);
|
|
@@ -35,11 +36,11 @@ export async function route(input, client) {
|
|
|
35
36
|
try {
|
|
36
37
|
const retryPrompt = `${prompt}\n\n(Your previous response failed validation: ${firstError}. Return a valid JSON object conforming to RouterOutput. Nothing else.)`;
|
|
37
38
|
const raw = await client.complete(retryPrompt);
|
|
38
|
-
return postProcessRouterOutput(input.text, validateRouterOutput(raw));
|
|
39
|
+
return postProcessRouterOutput(input.text, validateRouterOutput(raw), input);
|
|
39
40
|
}
|
|
40
41
|
catch {
|
|
41
42
|
// Persistent failure — return a minimal fallback with regex-extracted symbols.
|
|
42
|
-
return postProcessRouterOutput(input.text, minimalFallback(input.text));
|
|
43
|
+
return postProcessRouterOutput(input.text, minimalFallback(input.text), input);
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
export function validateRouterOutput(raw) {
|
|
@@ -153,15 +154,17 @@ function validateEntities(raw) {
|
|
|
153
154
|
out.compareMetrics = compareMetrics;
|
|
154
155
|
return out;
|
|
155
156
|
}
|
|
156
|
-
export function postProcessRouterOutput(text, output) {
|
|
157
|
+
export function postProcessRouterOutput(text, output, inputContext) {
|
|
157
158
|
const extracted = extractEntities(text);
|
|
158
159
|
const deterministic = classifyWithLegacyRules(text);
|
|
159
160
|
let diagnostics = [...output.diagnostics];
|
|
161
|
+
const symbolsAfterAmbiguousFilter = output.entities.symbols.filter((symbol) => !isAmbiguousConceptUsage(text, symbol));
|
|
162
|
+
const droppedAmbiguousSymbols = output.entities.symbols.filter((symbol) => !symbolsAfterAmbiguousFilter.includes(symbol));
|
|
160
163
|
let next = {
|
|
161
164
|
...output,
|
|
162
165
|
entities: {
|
|
163
166
|
...output.entities,
|
|
164
|
-
symbols:
|
|
167
|
+
symbols: symbolsAfterAmbiguousFilter,
|
|
165
168
|
budget: output.entities.budget ?? extracted.budget,
|
|
166
169
|
maxPremium: output.entities.maxPremium ?? extracted.maxPremium,
|
|
167
170
|
timeHorizon: output.entities.timeHorizon ?? extracted.timeHorizon,
|
|
@@ -179,6 +182,148 @@ export function postProcessRouterOutput(text, output) {
|
|
|
179
182
|
},
|
|
180
183
|
diagnostics,
|
|
181
184
|
};
|
|
185
|
+
if (next.workflow === "compare_assets") {
|
|
186
|
+
const restorableExtractedSymbols = extracted.symbols.filter((symbol) => disambiguateSymbols([symbol], text).kept.length > 0);
|
|
187
|
+
const orderedSymbols = orderSymbolsByText(text, mergeSymbols(next.entities.symbols, restorableExtractedSymbols));
|
|
188
|
+
if (!sameStringArray(orderedSymbols, next.entities.symbols)) {
|
|
189
|
+
diagnostics.push({
|
|
190
|
+
code: "compare_symbols_canonicalized",
|
|
191
|
+
message: "compare symbols restored from deterministic extraction and ordered by user text",
|
|
192
|
+
});
|
|
193
|
+
next = {
|
|
194
|
+
...next,
|
|
195
|
+
entities: {
|
|
196
|
+
...next.entities,
|
|
197
|
+
symbols: orderedSymbols,
|
|
198
|
+
},
|
|
199
|
+
slots: syncSymbolListSlot(next.slots, orderedSymbols),
|
|
200
|
+
diagnostics,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
// Prior-turn symbols merged into the slot (by the model or by the sync
|
|
204
|
+
// above) must not claim user provenance: the user typed only what is in
|
|
205
|
+
// this turn's text, and the Assumptions block renders slot sources.
|
|
206
|
+
// preference/memory/default sources legitimately reference out-of-text
|
|
207
|
+
// symbols and are left alone.
|
|
208
|
+
if (symbolsSlotClaimsPriorTurnUserProvenance(next.slots, text, inputContext?.priorTurns)) {
|
|
209
|
+
diagnostics.push({
|
|
210
|
+
code: "symbols_slot_provenance_prior_context",
|
|
211
|
+
message: "compare symbols slot includes symbols absent from the user text; source downgraded from user to prior_context",
|
|
212
|
+
});
|
|
213
|
+
next = {
|
|
214
|
+
...next,
|
|
215
|
+
slots: {
|
|
216
|
+
...next.slots,
|
|
217
|
+
symbols: {
|
|
218
|
+
...next.slots.symbols,
|
|
219
|
+
source: "prior_context",
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
diagnostics,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// The DTE horizon is a named historical loss class; when the model drops
|
|
227
|
+
// the slot on an options dispatch, the deterministic extraction preserves
|
|
228
|
+
// the user's stated range (mirrors the profile risk-slot fill below).
|
|
229
|
+
const dteHint = next.entities.dteHint ?? extracted.dteHint;
|
|
230
|
+
if (next.workflow === "options_screener" && !next.slots.dte_target && dteHint) {
|
|
231
|
+
const dteTarget = mapDteHintToTarget(dteHint);
|
|
232
|
+
if (dteTarget) {
|
|
233
|
+
diagnostics.push({
|
|
234
|
+
code: "dte_slot_filled_from_extraction",
|
|
235
|
+
message: "dte_target slot filled from deterministic horizon extraction",
|
|
236
|
+
});
|
|
237
|
+
next = {
|
|
238
|
+
...next,
|
|
239
|
+
slots: {
|
|
240
|
+
...next.slots,
|
|
241
|
+
dte_target: {
|
|
242
|
+
value: dteTarget,
|
|
243
|
+
source: "user",
|
|
244
|
+
confidence: "high",
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
diagnostics,
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
// Model-vocabulary synonyms for the canonical asset_scope value
|
|
252
|
+
// ("etf_only" for "etf_focused") drift saved preferences and slot
|
|
253
|
+
// consumers onto private vocabularies; canonicalize before the echo
|
|
254
|
+
// suppression below so restatements still match the profile.
|
|
255
|
+
next = canonicalizeAssetScopeVocabulary(next);
|
|
256
|
+
// A preference update that restates the saved profile value is an echo,
|
|
257
|
+
// not a change; writing it pollutes preference provenance (the
|
|
258
|
+
// preference-ECHO contract, fixture 029).
|
|
259
|
+
const echoedUpdates = next.preference_updates.filter((update) => readProfileString(inputContext?.profileSnapshot, update.key) === update.value);
|
|
260
|
+
if (echoedUpdates.length > 0) {
|
|
261
|
+
diagnostics.push({
|
|
262
|
+
code: "preference_echo_suppressed",
|
|
263
|
+
message: `dropped preference update(s) restating the saved profile: ${echoedUpdates
|
|
264
|
+
.map((update) => update.key)
|
|
265
|
+
.join(", ")}`,
|
|
266
|
+
});
|
|
267
|
+
next = {
|
|
268
|
+
...next,
|
|
269
|
+
preference_updates: next.preference_updates.filter((update) => !echoedUpdates.includes(update)),
|
|
270
|
+
diagnostics,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
const profileRiskProfile = readProfileString(inputContext?.profileSnapshot, "risk_profile");
|
|
274
|
+
if (next.workflow === "portfolio_builder" &&
|
|
275
|
+
profileRiskProfile &&
|
|
276
|
+
!next.slots.risk_profile &&
|
|
277
|
+
!next.entities.riskProfile) {
|
|
278
|
+
diagnostics.push({
|
|
279
|
+
code: "profile_risk_slot_filled",
|
|
280
|
+
message: "risk_profile slot filled from investor profile snapshot",
|
|
281
|
+
});
|
|
282
|
+
next = {
|
|
283
|
+
...next,
|
|
284
|
+
slots: {
|
|
285
|
+
...next.slots,
|
|
286
|
+
risk_profile: {
|
|
287
|
+
value: profileRiskProfile,
|
|
288
|
+
source: "preference",
|
|
289
|
+
confidence: "high",
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
diagnostics,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
if (next.routeKind === "pass_through" &&
|
|
296
|
+
extracted.riskProfile &&
|
|
297
|
+
isConversationalRiskPreferenceUpdate(text, inputContext)) {
|
|
298
|
+
diagnostics.push({
|
|
299
|
+
code: "conversational_risk_preference_recovered",
|
|
300
|
+
message: "risk preference update recovered from profile/prior-turn context",
|
|
301
|
+
});
|
|
302
|
+
next = {
|
|
303
|
+
...next,
|
|
304
|
+
routeKind: "agent_task",
|
|
305
|
+
route: "fallback",
|
|
306
|
+
entities: {
|
|
307
|
+
...next.entities,
|
|
308
|
+
riskProfile: extracted.riskProfile,
|
|
309
|
+
},
|
|
310
|
+
slots: {
|
|
311
|
+
...next.slots,
|
|
312
|
+
risk_profile: {
|
|
313
|
+
value: extracted.riskProfile,
|
|
314
|
+
source: "user",
|
|
315
|
+
confidence: "high",
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
preference_updates: ensurePreferenceUpdate(next.preference_updates, {
|
|
319
|
+
key: "risk_profile",
|
|
320
|
+
value: extracted.riskProfile,
|
|
321
|
+
confidence: "high",
|
|
322
|
+
source: "inferred",
|
|
323
|
+
}),
|
|
324
|
+
diagnostics,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
182
327
|
if (next.workflow === "options_screener" &&
|
|
183
328
|
isExistingPositionOptionRequest(text, extracted) &&
|
|
184
329
|
extracted.heldSymbol) {
|
|
@@ -456,6 +601,24 @@ export function postProcessRouterOutput(text, output) {
|
|
|
456
601
|
diagnostics,
|
|
457
602
|
};
|
|
458
603
|
}
|
|
604
|
+
if (next.workflow === "compare_assets" &&
|
|
605
|
+
(disambiguated.dropped.length > 0 || droppedAmbiguousSymbols.length > 0) &&
|
|
606
|
+
next.entities.symbols.length < 2 &&
|
|
607
|
+
isExplicitMacroDataRequest(text)) {
|
|
608
|
+
diagnostics.push({
|
|
609
|
+
code: "compare_route_corrected_to_macro_task",
|
|
610
|
+
message: "macro/source acronyms were not explicit tickers",
|
|
611
|
+
});
|
|
612
|
+
next = {
|
|
613
|
+
...next,
|
|
614
|
+
routeKind: "agent_task",
|
|
615
|
+
route: "fallback",
|
|
616
|
+
workflow: "general_finance_qa",
|
|
617
|
+
missing_required: [],
|
|
618
|
+
slots: removeSymbolSlots(next.slots),
|
|
619
|
+
diagnostics,
|
|
620
|
+
};
|
|
621
|
+
}
|
|
459
622
|
const missingRequired = computeMissingRequiredSlots(next.workflow, next.entities, next.slots, next.missing_required);
|
|
460
623
|
if (missingRequired.length > 0 && next.routeKind !== "pass_through") {
|
|
461
624
|
if (next.routeKind !== "clarification") {
|
|
@@ -698,6 +861,112 @@ function canonicalizeSymbolSlots(workflow, slots) {
|
|
|
698
861
|
}
|
|
699
862
|
return next;
|
|
700
863
|
}
|
|
864
|
+
function syncSymbolListSlot(slots, symbols) {
|
|
865
|
+
if (!slots.symbols || symbols.length === 0)
|
|
866
|
+
return slots;
|
|
867
|
+
return {
|
|
868
|
+
...slots,
|
|
869
|
+
symbols: {
|
|
870
|
+
...slots.symbols,
|
|
871
|
+
value: symbols,
|
|
872
|
+
},
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
const ASSET_SCOPE_SYNONYMS = {
|
|
876
|
+
etf_only: "etf_focused",
|
|
877
|
+
etfs_only: "etf_focused",
|
|
878
|
+
only_etfs: "etf_focused",
|
|
879
|
+
etf: "etf_focused",
|
|
880
|
+
etfs: "etf_focused",
|
|
881
|
+
};
|
|
882
|
+
function canonicalAssetScope(value) {
|
|
883
|
+
if (typeof value !== "string")
|
|
884
|
+
return undefined;
|
|
885
|
+
return ASSET_SCOPE_SYNONYMS[value.toLowerCase()];
|
|
886
|
+
}
|
|
887
|
+
function canonicalizeAssetScopeVocabulary(output) {
|
|
888
|
+
let next = output;
|
|
889
|
+
const slotCanonical = canonicalAssetScope(next.slots.asset_scope?.value);
|
|
890
|
+
if (slotCanonical) {
|
|
891
|
+
next = {
|
|
892
|
+
...next,
|
|
893
|
+
slots: {
|
|
894
|
+
...next.slots,
|
|
895
|
+
asset_scope: { ...next.slots.asset_scope, value: slotCanonical },
|
|
896
|
+
},
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
const entityCanonical = canonicalAssetScope(next.entities.assetScope);
|
|
900
|
+
if (entityCanonical) {
|
|
901
|
+
next = {
|
|
902
|
+
...next,
|
|
903
|
+
entities: { ...next.entities, assetScope: entityCanonical },
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
if (next.preference_updates.some((update) => update.key === "asset_scope" && canonicalAssetScope(update.value))) {
|
|
907
|
+
next = {
|
|
908
|
+
...next,
|
|
909
|
+
preference_updates: next.preference_updates.map((update) => update.key === "asset_scope"
|
|
910
|
+
? { ...update, value: canonicalAssetScope(update.value) ?? update.value }
|
|
911
|
+
: update),
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
return next;
|
|
915
|
+
}
|
|
916
|
+
function symbolsSlotClaimsPriorTurnUserProvenance(slots, text, priorTurns) {
|
|
917
|
+
const slot = slots.symbols;
|
|
918
|
+
if (slot?.source !== "user" || !Array.isArray(slot.value))
|
|
919
|
+
return false;
|
|
920
|
+
if (!priorTurns || priorTurns.length === 0)
|
|
921
|
+
return false;
|
|
922
|
+
const priorText = priorTurns.map((turn) => turn.text).join("\n");
|
|
923
|
+
// A symbol absent from this turn's text but present in prior turns is a
|
|
924
|
+
// carryover, not a user-typed value. Symbols absent from both (e.g. tickers
|
|
925
|
+
// resolved from company names in the current text) are left alone.
|
|
926
|
+
return slot.value.some((symbol) => typeof symbol === "string" &&
|
|
927
|
+
symbolPosition(text, symbol) === Number.MAX_SAFE_INTEGER &&
|
|
928
|
+
symbolPosition(priorText, symbol) !== Number.MAX_SAFE_INTEGER);
|
|
929
|
+
}
|
|
930
|
+
function removeSymbolSlots(slots) {
|
|
931
|
+
const next = { ...slots };
|
|
932
|
+
delete next.symbol;
|
|
933
|
+
delete next.symbols;
|
|
934
|
+
return next;
|
|
935
|
+
}
|
|
936
|
+
function orderSymbolsByText(text, symbols) {
|
|
937
|
+
return [...symbols].sort((a, b) => symbolPosition(text, a) - symbolPosition(text, b));
|
|
938
|
+
}
|
|
939
|
+
function symbolPosition(text, symbol) {
|
|
940
|
+
const escaped = escapeRegExp(symbol);
|
|
941
|
+
const match = new RegExp(`\\$?${escaped}\\b`, "i").exec(text);
|
|
942
|
+
return match?.index ?? Number.MAX_SAFE_INTEGER;
|
|
943
|
+
}
|
|
944
|
+
function sameStringArray(left, right) {
|
|
945
|
+
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
946
|
+
}
|
|
947
|
+
function readProfileString(profileSnapshot, key) {
|
|
948
|
+
const value = profileSnapshot?.[key];
|
|
949
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
950
|
+
}
|
|
951
|
+
function isConversationalRiskPreferenceUpdate(text, inputContext) {
|
|
952
|
+
if (!/\b(?:now|lately|getting|becoming|thinking|feel|feeling|prefer|preference)\b/i.test(text)) {
|
|
953
|
+
return false;
|
|
954
|
+
}
|
|
955
|
+
// Finance context must come from the conversation itself — a saved
|
|
956
|
+
// risk_profile alone must not convert non-finance chat ("more aggressive
|
|
957
|
+
// on the tennis court lately") into a routed preference write.
|
|
958
|
+
const priorText = inputContext?.priorTurns.map((turn) => turn.text).join(" ") ?? "";
|
|
959
|
+
return /\b(?:profile|risk|portfolio|position|invest|sizing)\b/i.test(`${text} ${priorText}`);
|
|
960
|
+
}
|
|
961
|
+
function ensurePreferenceUpdate(updates, update) {
|
|
962
|
+
if (updates.some((item) => item.key === update.key && item.value === update.value)) {
|
|
963
|
+
return updates;
|
|
964
|
+
}
|
|
965
|
+
return [...updates, update];
|
|
966
|
+
}
|
|
967
|
+
function escapeRegExp(value) {
|
|
968
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
969
|
+
}
|
|
701
970
|
function validatePreferenceUpdates(raw) {
|
|
702
971
|
if (raw === undefined || raw === null)
|
|
703
972
|
return [];
|
|
@@ -822,4 +1091,3 @@ function minimalFallback(text) {
|
|
|
822
1091
|
reasoning: "router validation failed; emitted minimal fallback",
|
|
823
1092
|
};
|
|
824
1093
|
}
|
|
825
|
-
//# sourceMappingURL=router.js.map
|
|
@@ -10,6 +10,7 @@ interface Preferences {
|
|
|
10
10
|
moneynessPreference?: string;
|
|
11
11
|
liquidityMinimum?: string;
|
|
12
12
|
}
|
|
13
|
+
export declare function mapDteHintToTarget(dteHint: string | undefined): string | undefined;
|
|
13
14
|
export declare function resolvePortfolioSlots(entities: ExtractedEntities, preferences?: Preferences): SlotResolution<PortfolioSlots>;
|
|
14
15
|
export declare function resolveOptionsScreenerSlots(entities: ExtractedEntities, preferences?: Preferences): SlotResolution<OptionsScreenerSlots>;
|
|
15
16
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OPTIONS_SCREENER_DEFAULTS, PORTFOLIO_DEFAULTS } from "./defaults.js";
|
|
2
|
-
function mapDteHintToTarget(dteHint) {
|
|
2
|
+
export function mapDteHintToTarget(dteHint) {
|
|
3
3
|
const normalized = dteHint?.toLowerCase().trim();
|
|
4
4
|
if (!normalized)
|
|
5
5
|
return undefined;
|
|
@@ -155,4 +155,3 @@ export function resolveOptionsScreenerSlots(entities, preferences = {}) {
|
|
|
155
155
|
missingRequired,
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
//# sourceMappingURL=slot-resolver.js.map
|
package/dist/routing/types.js
CHANGED
package/dist/runtime/evidence.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { EvidenceRecord } from "./evidence.js";
|
|
2
|
+
/**
|
|
3
|
+
* Observe-only numeric-claim extraction for synthesis validation (I3).
|
|
4
|
+
*
|
|
5
|
+
* These heuristics bind numbers in analyst prose to tool-result metrics so
|
|
6
|
+
* checkNumberMatch has claims to verify. They are deliberately conservative:
|
|
7
|
+
* every false mismatch poisons the false-positive-rate data that gates the
|
|
8
|
+
* answer-receipts direction (I8 phase 1), so a missed claim is cheaper than
|
|
9
|
+
* a wrong one.
|
|
10
|
+
*/
|
|
11
|
+
/** Flatten numeric values from a tool-evidence digest preview into labeled tool results. */
|
|
12
|
+
export declare function collectToolNumbers(record: EvidenceRecord, toolResults: Map<string, number>): void;
|
|
13
|
+
/**
|
|
14
|
+
* Extract numeric claims from step text for metrics present in toolResults.
|
|
15
|
+
*
|
|
16
|
+
* Binding rules (each guards against a live-observed false-positive class):
|
|
17
|
+
* - the metric term must appear as a whole word ("opening" is not `open`)
|
|
18
|
+
* - the number must follow within a short window (no cross-sentence binding)
|
|
19
|
+
* - thousands separators parse as one number ("129,935,067" is not 129)
|
|
20
|
+
* - a prose value that rounds to the tool result is normalized onto it
|
|
21
|
+
* ("197.14" claims the tool's 197.13999938964844, not a mismatch)
|
|
22
|
+
*/
|
|
23
|
+
export declare function extractNumericClaims(text: string, toolResults: Map<string, number>): EvidenceRecord[];
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Observe-only numeric-claim extraction for synthesis validation (I3).
|
|
3
|
+
*
|
|
4
|
+
* These heuristics bind numbers in analyst prose to tool-result metrics so
|
|
5
|
+
* checkNumberMatch has claims to verify. They are deliberately conservative:
|
|
6
|
+
* every false mismatch poisons the false-positive-rate data that gates the
|
|
7
|
+
* answer-receipts direction (I8 phase 1), so a missed claim is cheaper than
|
|
8
|
+
* a wrong one.
|
|
9
|
+
*/
|
|
10
|
+
/** Flatten numeric values from a tool-evidence digest preview into labeled tool results. */
|
|
11
|
+
export function collectToolNumbers(record, toolResults) {
|
|
12
|
+
if (!isPlainObject(record.value))
|
|
13
|
+
return;
|
|
14
|
+
const tool = typeof record.value.tool === "string" ? record.value.tool : undefined;
|
|
15
|
+
const digest = isPlainObject(record.value.resultDigest) ? record.value.resultDigest : undefined;
|
|
16
|
+
const preview = typeof digest?.preview === "string" ? digest.preview : undefined;
|
|
17
|
+
if (!tool || !preview)
|
|
18
|
+
return;
|
|
19
|
+
const parsed = parseMaybeJson(preview);
|
|
20
|
+
if (!parsed)
|
|
21
|
+
return;
|
|
22
|
+
for (const [path, value] of flattenNumericValues(parsed)) {
|
|
23
|
+
toolResults.set(`${tool}.${path}`, value);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Extract numeric claims from step text for metrics present in toolResults.
|
|
28
|
+
*
|
|
29
|
+
* Binding rules (each guards against a live-observed false-positive class):
|
|
30
|
+
* - the metric term must appear as a whole word ("opening" is not `open`)
|
|
31
|
+
* - the number must follow within a short window (no cross-sentence binding)
|
|
32
|
+
* - thousands separators parse as one number ("129,935,067" is not 129)
|
|
33
|
+
* - a prose value that rounds to the tool result is normalized onto it
|
|
34
|
+
* ("197.14" claims the tool's 197.13999938964844, not a mismatch)
|
|
35
|
+
*/
|
|
36
|
+
export function extractNumericClaims(text, toolResults) {
|
|
37
|
+
const records = [];
|
|
38
|
+
for (const [label, expected] of toolResults) {
|
|
39
|
+
const metric = label.split(".").at(-1);
|
|
40
|
+
if (!metric)
|
|
41
|
+
continue;
|
|
42
|
+
const pattern = new RegExp(`\\b${escapeRegex(metric)}\\b[^\\d-]{0,30}(-?\\d{1,3}(?:,\\d{3})+(?:\\.\\d+)?|-?\\d+(?:\\.\\d+)?)`, "i");
|
|
43
|
+
const match = text.match(pattern);
|
|
44
|
+
if (!match)
|
|
45
|
+
continue;
|
|
46
|
+
const value = Number(match[1].replace(/,/g, ""));
|
|
47
|
+
if (!Number.isFinite(value))
|
|
48
|
+
continue;
|
|
49
|
+
records.push({
|
|
50
|
+
label,
|
|
51
|
+
value: isRoundingOf(value, expected) ? expected : value,
|
|
52
|
+
provenance: { source: "computed" },
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return records;
|
|
56
|
+
}
|
|
57
|
+
/** True when `claim` is `expected` rounded to the claim's own precision. */
|
|
58
|
+
function isRoundingOf(claim, expected) {
|
|
59
|
+
if (claim === expected)
|
|
60
|
+
return true;
|
|
61
|
+
const decimals = countDecimals(claim);
|
|
62
|
+
const factor = 10 ** decimals;
|
|
63
|
+
return Math.round(expected * factor) / factor === claim;
|
|
64
|
+
}
|
|
65
|
+
function countDecimals(value) {
|
|
66
|
+
const text = String(value);
|
|
67
|
+
const dot = text.indexOf(".");
|
|
68
|
+
return dot === -1 ? 0 : text.length - dot - 1;
|
|
69
|
+
}
|
|
70
|
+
function flattenNumericValues(value, prefix = "") {
|
|
71
|
+
const values = [];
|
|
72
|
+
for (const [key, item] of Object.entries(value)) {
|
|
73
|
+
const path = prefix ? `${prefix}.${key}` : key;
|
|
74
|
+
if (typeof item === "number" && Number.isFinite(item)) {
|
|
75
|
+
values.push([path, item]);
|
|
76
|
+
}
|
|
77
|
+
else if (isPlainObject(item)) {
|
|
78
|
+
values.push(...flattenNumericValues(item, path));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return values;
|
|
82
|
+
}
|
|
83
|
+
function escapeRegex(value) {
|
|
84
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
85
|
+
}
|
|
86
|
+
function parseMaybeJson(raw) {
|
|
87
|
+
if (typeof raw !== "string")
|
|
88
|
+
return undefined;
|
|
89
|
+
try {
|
|
90
|
+
const parsed = JSON.parse(raw);
|
|
91
|
+
return isPlainObject(parsed) ? parsed : undefined;
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function isPlainObject(value) {
|
|
98
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
99
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { classifyMarketStatus, KNOWN_US_MARKET_HOLIDAYS, lastTradingDay, localDateTimeParts, } from "../infra/market-calendar.js";
|
|
1
2
|
import { parseToolTag } from "../onboarding/tool-tags.js";
|
|
2
3
|
export const EVIDENCE_PLAN_REGISTRY = {
|
|
3
4
|
market_status: {
|
|
@@ -30,18 +31,6 @@ export const EVIDENCE_PLAN_REGISTRY = {
|
|
|
30
31
|
placeholder_stateful_tracking_update: placeholderPlan("placeholder_stateful_tracking_update", ["stateful_tracking_update"], []),
|
|
31
32
|
placeholder_general_fallback: placeholderPlan("placeholder_general_fallback", ["general_fallback"], []),
|
|
32
33
|
};
|
|
33
|
-
const KNOWN_US_MARKET_HOLIDAYS = {
|
|
34
|
-
"2026-01-01": "New Year's Day",
|
|
35
|
-
"2026-01-19": "Martin Luther King Jr. Day",
|
|
36
|
-
"2026-02-16": "Washington's Birthday",
|
|
37
|
-
"2026-04-03": "Good Friday",
|
|
38
|
-
"2026-05-25": "Memorial Day",
|
|
39
|
-
"2026-06-19": "Juneteenth",
|
|
40
|
-
"2026-07-03": "Independence Day observed",
|
|
41
|
-
"2026-09-07": "Labor Day",
|
|
42
|
-
"2026-11-26": "Thanksgiving Day",
|
|
43
|
-
"2026-12-25": "Christmas Day",
|
|
44
|
-
};
|
|
45
34
|
function placeholderPlan(id, taskFamilies, capabilityGapIds) {
|
|
46
35
|
return {
|
|
47
36
|
id,
|
|
@@ -389,19 +378,6 @@ function temporalReferencesFor(text) {
|
|
|
389
378
|
refs.push("holiday");
|
|
390
379
|
return refs;
|
|
391
380
|
}
|
|
392
|
-
function classifyMarketStatus(local, isWeekend, isMarketHoliday, temporalReferences) {
|
|
393
|
-
if (isWeekend)
|
|
394
|
-
return "closed_weekend";
|
|
395
|
-
if (isMarketHoliday)
|
|
396
|
-
return "closed_holiday";
|
|
397
|
-
if (local.minutesSinceMidnight < 9 * 60 + 30)
|
|
398
|
-
return "pre_market";
|
|
399
|
-
if (local.minutesSinceMidnight < 16 * 60)
|
|
400
|
-
return "open";
|
|
401
|
-
if (temporalReferences.includes("after_close"))
|
|
402
|
-
return "after_close";
|
|
403
|
-
return "closed_after_hours";
|
|
404
|
-
}
|
|
405
381
|
function quoteAsOfCaveat(marketStatus) {
|
|
406
382
|
if (marketStatus === "open")
|
|
407
383
|
return "Quote evidence may be intraday or delayed depending on provider.";
|
|
@@ -409,58 +385,6 @@ function quoteAsOfCaveat(marketStatus) {
|
|
|
409
385
|
return "Quote evidence may reflect the previous regular session until premarket data is fetched.";
|
|
410
386
|
return "Quote evidence should distinguish the current calendar date from the most recent trading session.";
|
|
411
387
|
}
|
|
412
|
-
function localDateTimeParts(date, timezone) {
|
|
413
|
-
const formatter = new Intl.DateTimeFormat("en-US", {
|
|
414
|
-
timeZone: timezone,
|
|
415
|
-
year: "numeric",
|
|
416
|
-
month: "2-digit",
|
|
417
|
-
day: "2-digit",
|
|
418
|
-
hour: "2-digit",
|
|
419
|
-
minute: "2-digit",
|
|
420
|
-
hour12: false,
|
|
421
|
-
weekday: "short",
|
|
422
|
-
});
|
|
423
|
-
const parts = formatter.formatToParts(date).reduce((acc, part) => {
|
|
424
|
-
acc[part.type] = part.value;
|
|
425
|
-
return acc;
|
|
426
|
-
}, {});
|
|
427
|
-
const hour = Number(parts.hour);
|
|
428
|
-
const minute = Number(parts.minute);
|
|
429
|
-
return {
|
|
430
|
-
date: `${parts.year}-${parts.month}-${parts.day}`,
|
|
431
|
-
time: `${parts.hour}:${parts.minute}`,
|
|
432
|
-
weekday: parts.weekday ?? "",
|
|
433
|
-
minutesSinceMidnight: hour * 60 + minute,
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
function lastTradingDay(localDate) {
|
|
437
|
-
let cursor = dateFromKey(localDate);
|
|
438
|
-
do {
|
|
439
|
-
cursor = addDays(cursor, -1);
|
|
440
|
-
} while (isWeekendOrKnownHoliday(dateKey(cursor)));
|
|
441
|
-
return dateKey(cursor);
|
|
442
|
-
}
|
|
443
|
-
function isWeekendOrKnownHoliday(key) {
|
|
444
|
-
const date = dateFromKey(key);
|
|
445
|
-
const day = date.getUTCDay();
|
|
446
|
-
return day === 0 || day === 6 || KNOWN_US_MARKET_HOLIDAYS[key] !== undefined;
|
|
447
|
-
}
|
|
448
|
-
function dateFromKey(key) {
|
|
449
|
-
const [year, month, day] = key.split("-").map(Number);
|
|
450
|
-
return new Date(Date.UTC(year, month - 1, day));
|
|
451
|
-
}
|
|
452
|
-
function addDays(date, days) {
|
|
453
|
-
const next = new Date(date);
|
|
454
|
-
next.setUTCDate(next.getUTCDate() + days);
|
|
455
|
-
return next;
|
|
456
|
-
}
|
|
457
|
-
function dateKey(date) {
|
|
458
|
-
const year = date.getUTCFullYear();
|
|
459
|
-
const month = String(date.getUTCMonth() + 1).padStart(2, "0");
|
|
460
|
-
const day = String(date.getUTCDate()).padStart(2, "0");
|
|
461
|
-
return `${year}-${month}-${day}`;
|
|
462
|
-
}
|
|
463
388
|
function isRecord(value) {
|
|
464
389
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
465
390
|
}
|
|
466
|
-
//# sourceMappingURL=planning-evidence.js.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { SessionEntry } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { EvidenceRecord } from "./evidence.js";
|
|
1
3
|
import type { StepOutput, WorkflowStep } from "./workflow-types.js";
|
|
2
4
|
/**
|
|
3
5
|
* A workflow step definition that carries its prompt text.
|
|
@@ -25,7 +27,14 @@ export declare function promptStep(stepType: string, description: string, prompt
|
|
|
25
27
|
* Create a StepOutput for a prompt-based step (no structured evidence yet).
|
|
26
28
|
* Evidence will be captured separately via tool call hooks.
|
|
27
29
|
*/
|
|
28
|
-
export declare function promptStepOutput(stepIndex: number, stepType: string
|
|
30
|
+
export declare function promptStepOutput(stepIndex: number, stepType: string, options?: {
|
|
31
|
+
evidence?: EvidenceRecord[];
|
|
32
|
+
rawText?: string;
|
|
33
|
+
}): StepOutput;
|
|
34
|
+
/** Capture compact evidence records from session entries produced by one step. */
|
|
35
|
+
export declare function captureToolEvidence(entries: SessionEntry[]): EvidenceRecord[];
|
|
36
|
+
/** Extract assistant text emitted during a step, preserving final response order. */
|
|
37
|
+
export declare function extractAssistantText(entries: SessionEntry[]): string;
|
|
29
38
|
/**
|
|
30
39
|
* Extract just the WorkflowStep metadata from PromptStep definitions
|
|
31
40
|
* (dropping the prompt field) for passing to WorkflowRunner.
|