@danceiny/gotry 0.0.1-rc.8 → 0.2.0-rc.27
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 +172 -217
- package/README.zh-CN.md +222 -0
- package/bin/gotry-backend.js +53 -0
- package/bin/gotry-booking-copilot.js +53 -0
- package/bin/gotry-bootstrap.js +1744 -0
- package/bin/gotry-inner.js +733 -83
- package/bin/gotry-process-liveness.d.ts +27 -0
- package/bin/gotry-process-liveness.js +97 -0
- package/bin/gotry-runtime-resolution.d.ts +27 -0
- package/bin/gotry-runtime-resolution.js +49 -0
- package/bin/gotry.js +1 -1
- package/client/client.js +203 -0
- package/cordis.gotry-patch.yml +80 -49
- package/data/airline-airports.json +39 -0
- package/data/stations-12306-verify.json +524 -0
- package/dist/capabilities/agent-reach-deep.js +45 -122
- package/dist/capabilities/agent-reach.js +101 -146
- package/dist/capabilities/anything.js +135 -94
- package/dist/capabilities/artifacts.js +370 -0
- package/dist/capabilities/channel-health.js +131 -0
- package/dist/capabilities/channel-registry.js +256 -0
- package/dist/capabilities/doctor.js +546 -0
- package/dist/capabilities/effect.js +394 -0
- package/dist/capabilities/external-event.js +149 -0
- package/dist/capabilities/fact-log.js +55 -0
- package/dist/capabilities/flyai-config.js +337 -0
- package/dist/capabilities/flyai.js +968 -0
- package/dist/capabilities/fx-contract.js +293 -0
- package/dist/capabilities/geo-atlas.js +246 -0
- package/dist/capabilities/ground-transfer.js +509 -0
- package/dist/capabilities/hbcli.js +260 -123
- package/dist/capabilities/hotelbyte-transaction.js +194 -0
- package/dist/capabilities/incident-log.js +131 -61
- package/dist/capabilities/itinerary-artifact.js +190 -0
- package/dist/capabilities/itinerary-deck-artifact.js +194 -0
- package/dist/capabilities/itinerary-deck-export.js +339 -0
- package/dist/capabilities/lavish-local.js +924 -0
- package/dist/capabilities/model-override.js +38 -0
- package/dist/capabilities/opensky.js +54 -43
- package/dist/capabilities/resilience.js +191 -0
- package/dist/capabilities/session/action-cache.js +126 -0
- package/dist/capabilities/session/adapters/ctrip-flight.js +141 -0
- package/dist/capabilities/session/adapters/ctrip-hotel.js +222 -0
- package/dist/capabilities/session/adapters/dida-portal.js +274 -0
- package/dist/capabilities/session/adapters/meituan-local.js +54 -0
- package/dist/capabilities/session/adapters/rail-12306.js +342 -0
- package/dist/capabilities/session/benchmark.js +189 -0
- package/dist/capabilities/session/bridge-ledger.js +224 -0
- package/dist/capabilities/session/extension-bridge.js +636 -0
- package/dist/capabilities/session/extension-channel.js +109 -0
- package/dist/capabilities/session/extension-distribution.js +230 -0
- package/dist/capabilities/session/extract.js +50 -0
- package/dist/capabilities/session/golden-score.js +114 -0
- package/dist/capabilities/session/health-watch.js +215 -0
- package/dist/capabilities/session/read-guard.js +107 -0
- package/dist/capabilities/session/static-flight-golden.js +150 -0
- package/dist/capabilities/session/transport.js +109 -0
- package/dist/capabilities/session/wizard.js +117 -0
- package/dist/capabilities/session-consent.js +178 -0
- package/dist/capabilities/session-login.js +170 -0
- package/dist/capabilities/session-search.js +686 -0
- package/dist/capabilities/spawn-bounded.js +203 -0
- package/dist/capabilities/sponsor-plugin.js +341 -0
- package/dist/capabilities/visa-policy.js +140 -0
- package/dist/capabilities/weather.js +243 -138
- package/dist/data/session-golden-20.json +25 -0
- package/dist/data/sf-golden-manifest.json +103 -0
- package/dist/data/sf-static-routes.json +91 -0
- package/dist/scripts/action-cache-tests.js +72 -0
- package/dist/scripts/agent-planning-turn-deadline-e2e.js +242 -0
- package/dist/scripts/agent-planning-turn-deadline-tests.js +185 -0
- package/dist/scripts/agent-reach-deep-tests.js +30 -40
- package/dist/scripts/agent-reach-error-tests.js +354 -0
- package/dist/scripts/agent-reach-tests.js +26 -18
- package/dist/scripts/agent-reach-wrapper-tests.js +50 -50
- package/dist/scripts/anything-tests.js +116 -60
- package/dist/scripts/artifact-client-contract-tests.js +220 -0
- package/dist/scripts/artifacts-capability-tests.js +727 -0
- package/dist/scripts/async-collect.js +68 -10
- package/dist/scripts/benchmark-environment-bridge-e2e.js +741 -0
- package/dist/scripts/benchmark-environment-bridge-tests.js +1452 -0
- package/dist/scripts/booking-copilot-availability-ledger-binding-tests.js +126 -0
- package/dist/scripts/booking-copilot-availability-policy-tests.js +265 -0
- package/dist/scripts/booking-copilot-bin-proof-tests.js +66 -0
- package/dist/scripts/booking-copilot-cleanup-proof-helper.js +76 -0
- package/dist/scripts/booking-copilot-crossrepo-fixture-server.js +144 -0
- package/dist/scripts/booking-copilot-dsh-core-proof-tests.js +424 -0
- package/dist/scripts/booking-copilot-dsh-planner-proof-tests.js +2839 -0
- package/dist/scripts/booking-copilot-dsh-plugin-proof-tests.js +309 -0
- package/dist/scripts/booking-copilot-dsh-readiness-proof.js +238 -0
- package/dist/scripts/booking-copilot-dsh-warmer-proof.js +123 -0
- package/dist/scripts/booking-copilot-event-sequence-concurrency-proof-tests.js +156 -0
- package/dist/scripts/booking-copilot-gap-code-contract-proof-tests.js +70 -0
- package/dist/scripts/booking-copilot-intent-proof-tests.js +422 -0
- package/dist/scripts/booking-copilot-operation-ledger-concurrency-proof-tests.js +184 -0
- package/dist/scripts/booking-copilot-planner-live-probe.js +95 -0
- package/dist/scripts/booking-copilot-proof-runtime.js +42 -0
- package/dist/scripts/booking-copilot-receipt-ledger-concurrency-proof-tests.js +210 -0
- package/dist/scripts/booking-copilot-runtime-proof-tests.js +2349 -0
- package/dist/scripts/booking-copilot-server-proof-tests.js +784 -0
- package/dist/scripts/booking-copilot-startup-proof-tests.js +94 -0
- package/dist/scripts/booking-executor-tests.js +80 -0
- package/dist/scripts/booking-recovery-chain-tests.js +182 -0
- package/dist/scripts/booking-saga-tests.js +125 -0
- package/dist/scripts/booking-surface-contract-proof-tests.js +212 -0
- package/dist/scripts/bootstrap-tests.js +1479 -0
- package/dist/scripts/bridge-events-tests.js +239 -0
- package/dist/scripts/bridge-ledger-tests.js +428 -0
- package/dist/scripts/build-changelog.js +238 -0
- package/dist/scripts/build-metrics-report.js +331 -0
- package/dist/scripts/changelog-tests.js +118 -0
- package/dist/scripts/channel-probe-tests.js +103 -0
- package/dist/scripts/channel-probe.js +169 -0
- package/dist/scripts/channel-registry-tests.js +208 -0
- package/dist/scripts/companion-tests.js +67 -0
- package/dist/scripts/dida-cookie-probe.js +87 -0
- package/dist/scripts/dida-runner-stop-tests.js +311 -0
- package/dist/scripts/dida-sw-probe.js +114 -0
- package/dist/scripts/diff-test.js +17 -12
- package/dist/scripts/doctor-tests.js +564 -0
- package/dist/scripts/dsh-artifact-e2e.js +279 -0
- package/dist/scripts/dsh-artifact-web-e2e.js +675 -0
- package/dist/scripts/dsh-http-proxy-sse-proof.js +90 -0
- package/dist/scripts/dsh-runtime-closure-tests.js +182 -0
- package/dist/scripts/dsh-runtime-closure.js +162 -0
- package/dist/scripts/dsh-session-v3-migration-proof.js +109 -0
- package/dist/scripts/dsh-subprocess-local-proof.js +150 -0
- package/dist/scripts/dsh-target-closure-proof.js +178 -0
- package/dist/scripts/effect-tests.js +539 -0
- package/dist/scripts/engine-run.js +1 -3
- package/dist/scripts/engine-tests.js +16 -10
- package/dist/scripts/evaluation-cadence-tests.js +174 -0
- package/dist/scripts/evaluation-contract-tests.js +268 -0
- package/dist/scripts/extension-distribution-cli.js +39 -0
- package/dist/scripts/extension-distribution-tests.js +443 -0
- package/dist/scripts/extension-tests.js +988 -0
- package/dist/scripts/external-event-tests.js +350 -0
- package/dist/scripts/fact-gate-tests.js +869 -0
- package/dist/scripts/fixtures/extension-bridge-unref-child.mjs +21 -0
- package/dist/scripts/flight-hotel-anchor-363-registered-e2e.js +169 -0
- package/dist/scripts/flight-malformed-tests.js +159 -0
- package/dist/scripts/flyai-setup-tests.js +228 -0
- package/dist/scripts/flyai-setup-tool-tests.js +54 -0
- package/dist/scripts/flyai-tests.js +692 -0
- package/dist/scripts/flyai-tool-registration-contract-tests.js +91 -0
- package/dist/scripts/fx-contract-tests.js +201 -0
- package/dist/scripts/g5-guard-tests.js +131 -0
- package/dist/scripts/g5-guard.js +189 -0
- package/dist/scripts/gen-lunar-anchors.js +106 -0
- package/dist/scripts/geo-atlas-tests.js +283 -0
- package/dist/scripts/gotry-backend-kernel-tests.js +206 -0
- package/dist/scripts/gotry-try-demo-tests.js +79 -0
- package/dist/scripts/gotry-try-demo.js +49 -0
- package/dist/scripts/ground-transfer-tests.js +956 -0
- package/dist/scripts/hbcli-e2e-tests.js +159 -0
- package/dist/scripts/hbcli-live-optin-tests.js +96 -0
- package/dist/scripts/hbcli-release-contract-tests.js +122 -0
- package/dist/scripts/hbcli-tests.js +121 -69
- package/dist/scripts/health-watch-cli.js +73 -0
- package/dist/scripts/hotel-date-gate-tests.js +496 -0
- package/dist/scripts/hotelbyte-reconcile-tests.js +141 -0
- package/dist/scripts/hotelbyte-spawn-e2e-tests.js +373 -0
- package/dist/scripts/i18n-tests.js +41 -0
- package/dist/scripts/incident-tests.js +281 -87
- package/dist/scripts/issue-194-job-id-guard-tests.js +106 -0
- package/dist/scripts/issue-233-cancel-refund-commission-tests.js +392 -0
- package/dist/scripts/issue-271-liveness-tests.js +569 -0
- package/dist/scripts/issue-289-model-retry-real-tests.js +296 -0
- package/dist/scripts/issue-289-model-retry-tests.js +441 -0
- package/dist/scripts/issue-289-web-retry-e2e.js +630 -0
- package/dist/scripts/issue-338-home-city-e2e.js +577 -0
- package/dist/scripts/issue343-real-entry-e2e.js +160 -0
- package/dist/scripts/issue436-persisted-routing-e2e.js +247 -0
- package/dist/scripts/itinerary-artifact-tests.js +368 -0
- package/dist/scripts/itinerary-deck-artifact-tests.js +416 -0
- package/dist/scripts/itinerary-deck-export-tests.js +552 -0
- package/dist/scripts/itinerary-deck-tests.js +435 -0
- package/dist/scripts/itinerary-html-tests.js +426 -0
- package/dist/scripts/journey-tests.js +22 -27
- package/dist/scripts/kernel-manifest-evidence.js +109 -0
- package/dist/scripts/kernel-manifest-gate.js +126 -0
- package/dist/scripts/kernel-manifest-tests.js +212 -0
- package/dist/scripts/kernel-manifest-trace-entry.js +7 -0
- package/dist/scripts/kernel-manifest-trace-hook.mjs +28 -0
- package/dist/scripts/kernel-manifest.js +369 -0
- package/dist/scripts/lavish-local-tests.js +1226 -0
- package/dist/scripts/lavish-product-tools-tests.js +537 -0
- package/dist/scripts/ledger-repair-apply-tests.js +316 -0
- package/dist/scripts/ledger-repair-plan-tests.js +375 -0
- package/dist/scripts/ledger-tests.js +480 -0
- package/dist/scripts/ledger-workflow-crash.js +32 -0
- package/dist/scripts/managed-dsh-cleanup-diagnostic-proof.js +184 -0
- package/dist/scripts/managed-dsh-close-failure-proof.js +172 -0
- package/dist/scripts/managed-dsh-run-port-proof.js +153 -0
- package/dist/scripts/managed-dsh-terminal-proof.js +252 -0
- package/dist/scripts/map-tools-vendor-package-proof.js +365 -0
- package/dist/scripts/memory-capture-tests.js +242 -61
- package/dist/scripts/memory-decay-tests.js +49 -0
- package/dist/scripts/memory-lifecycle-tests.js +657 -0
- package/dist/scripts/memory-lifecycle.js +196 -0
- package/dist/scripts/memory-metrics.js +29 -31
- package/dist/scripts/memory-value-report.js +631 -0
- package/dist/scripts/memory-value-tests.js +328 -0
- package/dist/scripts/metrics-report-tests.js +151 -0
- package/dist/scripts/model-override-e2e.js +137 -0
- package/dist/scripts/nightly-evidence-tests.js +161 -0
- package/dist/scripts/nightly-evidence.js +286 -0
- package/dist/scripts/nudge-digest.js +43 -42
- package/dist/scripts/observability-tests.js +381 -0
- package/dist/scripts/onboarding-tests.js +161 -0
- package/dist/scripts/opensky-check.js +18 -13
- package/dist/scripts/opensky-tests.js +28 -28
- package/dist/scripts/persona-surface-guard-tests.js +49 -0
- package/dist/scripts/pnpm-dsh-closure-proof.js +17 -0
- package/dist/scripts/policy-anchor-359-registered-e2e.js +214 -0
- package/dist/scripts/price-drift-tests.js +340 -0
- package/dist/scripts/price-drift-watch.js +447 -0
- package/dist/scripts/probe-poi-tests.js +53 -45
- package/dist/scripts/product-metrics.js +483 -0
- package/dist/scripts/publish-preverify.js +110 -0
- package/dist/scripts/realtime-pricing-tests.js +76 -0
- package/dist/scripts/recall-tests.js +513 -0
- package/dist/scripts/replay-async.js +20 -18
- package/dist/scripts/replay-real.js +18 -18
- package/dist/scripts/replay.js +52 -82
- package/dist/scripts/session-attach-diagnose.js +31 -0
- package/dist/scripts/session-attach-poc.js +62 -0
- package/dist/scripts/session-benchmark.js +180 -0
- package/dist/scripts/session-dida-live-e2e.js +199 -0
- package/dist/scripts/session-extract-tests.js +60 -0
- package/dist/scripts/session-link-tests.js +478 -0
- package/dist/scripts/session-login.js +29 -0
- package/dist/scripts/session-tests.js +862 -0
- package/dist/scripts/session-zones-tests.js +358 -0
- package/dist/scripts/sf-live-benchmark.js +367 -0
- package/dist/scripts/sf-live-challenge-stop-tests.js +453 -0
- package/dist/scripts/sf-live-cli-tests.js +92 -0
- package/dist/scripts/sf-live-options.js +46 -0
- package/dist/scripts/sf-manifest-tests.js +30 -0
- package/dist/scripts/sf-manifest.js +33 -0
- package/dist/scripts/sf-soft-score-tests.js +67 -0
- package/dist/scripts/sf-summary-tests.js +324 -0
- package/dist/scripts/sf-summary.js +525 -0
- package/dist/scripts/share-tests.js +432 -0
- package/dist/scripts/skeleton-check.js +16 -14
- package/dist/scripts/skeleton-integration-test.js +28 -11
- package/dist/scripts/skills-contract-tests.js +51 -46
- package/dist/scripts/smoke-session-gate-tests.js +21 -0
- package/dist/scripts/smoke.js +703 -219
- package/dist/scripts/spawn-bounded-abort-tests.js +241 -0
- package/dist/scripts/sponsor-reuse-tests.js +262 -0
- package/dist/scripts/state-cli-tests.js +261 -0
- package/dist/scripts/state-cli.js +585 -0
- package/dist/scripts/state-repair-cli.js +66 -0
- package/dist/scripts/state-repair-tests.js +140 -0
- package/dist/scripts/static-golden-tests.js +165 -0
- package/dist/scripts/time-eval-tests.js +210 -192
- package/dist/scripts/travel-timeline-tests.js +59 -0
- package/dist/scripts/turn-handoff-collect-tests.js +169 -0
- package/dist/scripts/turn-handoff-collect.js +161 -0
- package/dist/scripts/turn-policy-tests.js +55 -0
- package/dist/scripts/typed-contract-canary.js +176 -0
- package/dist/scripts/tz-resolver-sanity.js +50 -0
- package/dist/scripts/tz-resolver-tests.js +584 -0
- package/dist/scripts/unified-tests.js +23 -19
- package/dist/scripts/visa-policy-tests.js +62 -0
- package/dist/scripts/weather-tests.js +276 -41
- package/dist/scripts/wish-channel-gate-tests.js +54 -0
- package/dist/scripts/write-gate-tests.js +522 -0
- package/dist/scripts/z3-lifecycle-fault-tests.js +188 -0
- package/dist/scripts/z3-lifecycle-tests.js +170 -0
- package/dist/scripts/z3-race-repeat-tests.js +39 -0
- package/dist/scripts/z3-race-tests.js +41 -0
- package/dist/src/artifact-gate.js +829 -0
- package/dist/src/backend/kernel.js +91 -0
- package/dist/src/backend/modules/booking-copilot.js +92 -0
- package/dist/src/backend/modules/booking-executor.js +124 -0
- package/dist/src/backend/modules/session-search.js +551 -0
- package/dist/src/benchmark-agent-conformance.js +578 -0
- package/dist/src/benchmark-environment-bridge.js +515 -0
- package/dist/src/benchmark-headless-child-diagnostics.js +166 -0
- package/dist/src/benchmark-tool-isolation.js +151 -0
- package/dist/src/bookable-facts.js +533 -0
- package/dist/src/booking-saga.js +97 -0
- package/dist/src/booking-surface/availability-policy.js +697 -0
- package/dist/src/booking-surface/booking-intent.js +43 -0
- package/dist/src/booking-surface/cancel-refund-commission.js +379 -0
- package/dist/src/booking-surface/canonical-schema.js +116 -0
- package/dist/src/booking-surface/contracts.js +75 -0
- package/dist/src/booking-surface/dsh-planner.js +1854 -0
- package/dist/src/booking-surface/dsh-plugin.js +378 -0
- package/dist/src/booking-surface/dsh-worker.js +98 -0
- package/dist/src/booking-surface/error-codes.js +231 -0
- package/dist/src/booking-surface/index.js +9 -0
- package/dist/src/booking-surface/managed-dsh-cleanup-diagnostic.js +97 -0
- package/dist/src/booking-surface/managed-dsh-run-port.js +244 -0
- package/dist/src/booking-surface/profile.js +24 -0
- package/dist/src/booking-surface/recovery-chain.js +367 -0
- package/dist/src/booking-surface/runtime.js +1968 -0
- package/dist/src/booking-surface/server.js +674 -0
- package/dist/src/booking-surface/startup.js +168 -0
- package/dist/src/booking-surface/validation.js +261 -0
- package/dist/src/bridge.js +20 -13
- package/dist/src/companions.js +86 -0
- package/dist/src/contracts.js +21 -43
- package/dist/src/dsh-llm.js +97 -111
- package/dist/src/engine.js +276 -193
- package/dist/src/evaluation-cadence.js +97 -0
- package/dist/src/evaluation-contracts.js +283 -0
- package/dist/src/flight-pack-adapter.js +54 -0
- package/dist/src/flight-pack-contract.js +2 -0
- package/dist/src/flyai-setup-tool.js +70 -0
- package/dist/src/gotry-backend.js +125 -0
- package/dist/src/hotel-date-gate.js +118 -0
- package/dist/src/i18n.js +88 -0
- package/dist/src/index.js +2305 -731
- package/dist/src/itinerary-deck.js +139 -0
- package/dist/src/itinerary-doc-shared.js +661 -0
- package/dist/src/itinerary-html.js +131 -0
- package/dist/src/journey.js +155 -108
- package/dist/src/lavish-tools.js +400 -0
- package/dist/src/ledger-repair-apply.js +538 -0
- package/dist/src/ledger-repair-plan.js +463 -0
- package/dist/src/loop.js +358 -162
- package/dist/src/memory-capture.js +180 -32
- package/dist/src/memory-decay.js +47 -0
- package/dist/src/memory-lifecycle.js +1310 -0
- package/dist/src/memory-utility.js +27 -40
- package/dist/src/mock-llm.js +36 -61
- package/dist/src/model.js +81 -36
- package/dist/src/realtime-pricing.js +103 -0
- package/dist/src/recall/card.js +74 -0
- package/dist/src/recall/evaluator.js +140 -0
- package/dist/src/recall/integration.js +17 -0
- package/dist/src/recall/tick.js +166 -0
- package/dist/src/session-link/plan-it-action.js +48 -0
- package/dist/src/session-link/session-link.js +248 -0
- package/dist/src/session-zones.js +507 -0
- package/dist/src/share/adapters.js +51 -0
- package/dist/src/share/share-consent.js +76 -0
- package/dist/src/share/share-deck.js +58 -0
- package/dist/src/share/share-token.js +146 -0
- package/dist/src/slot-spec.js +84 -106
- package/dist/src/state-ledger.js +767 -0
- package/dist/src/state-repair.js +299 -0
- package/dist/src/subagent-job-id-guard.js +58 -0
- package/dist/src/time-anchor.js +231 -33
- package/dist/src/tool-packet.js +20 -8
- package/dist/src/travel-slots.js +58 -35
- package/dist/src/travel-timeline.js +59 -0
- package/dist/src/turn-deadline.js +287 -0
- package/dist/src/turn-policy.js +118 -0
- package/dist/src/tz-resolver.js +143 -0
- package/dist/src/unified.js +538 -360
- package/dist/src/wish-pool.js +42 -12
- package/dist/src/write-gate.js +495 -0
- package/dist/src/z3-shared.js +284 -0
- package/extension/README.md +21 -0
- package/extension/README.zh-CN.md +21 -0
- package/extension/background.js +463 -0
- package/extension/content-bridge.js +270 -0
- package/extension/content-main.js +111 -0
- package/extension/manifest.json +60 -0
- package/package.json +407 -14
- package/schemas/booking.intent.schema.json +193 -0
- package/schemas/booking.surface.schema.json +2622 -0
- package/ts/capabilities/agent-reach-deep.ts +114 -0
- package/ts/capabilities/agent-reach.ts +198 -0
- package/ts/capabilities/anything.ts +255 -0
- package/ts/capabilities/artifacts.ts +428 -0
- package/ts/capabilities/fact-log.ts +54 -0
- package/ts/capabilities/flyai-config.ts +388 -0
- package/ts/capabilities/flyai.ts +1274 -0
- package/ts/capabilities/hbcli.ts +253 -71
- package/ts/capabilities/incident-log.ts +88 -59
- package/ts/capabilities/itinerary-artifact.ts +214 -0
- package/ts/capabilities/itinerary-deck-artifact.ts +218 -0
- package/ts/capabilities/itinerary-deck-export.ts +378 -0
- package/ts/capabilities/opensky.ts +121 -0
- package/ts/capabilities/session/action-cache.ts +148 -0
- package/ts/capabilities/session/adapters/ctrip-flight.ts +181 -0
- package/ts/capabilities/session/adapters/ctrip-hotel.ts +238 -0
- package/ts/capabilities/session/adapters/dida-portal.ts +338 -0
- package/ts/capabilities/session/adapters/meituan-local.ts +70 -0
- package/ts/capabilities/session/adapters/rail-12306.ts +392 -0
- package/ts/capabilities/session/benchmark.ts +276 -0
- package/ts/capabilities/session/bridge-ledger.ts +333 -0
- package/ts/capabilities/session/extension-bridge.ts +794 -0
- package/ts/capabilities/session/extension-channel.ts +144 -0
- package/ts/capabilities/session/extension-distribution.ts +266 -0
- package/ts/capabilities/session/extract.ts +54 -0
- package/ts/capabilities/session/golden-score.ts +139 -0
- package/ts/capabilities/session/health-watch.ts +264 -0
- package/ts/capabilities/session/read-guard.ts +141 -0
- package/ts/capabilities/session/static-flight-golden.ts +209 -0
- package/ts/capabilities/session/transport.ts +146 -0
- package/ts/capabilities/session/wizard.ts +140 -0
- package/ts/capabilities/session-consent.ts +211 -0
- package/ts/capabilities/session-login.ts +208 -0
- package/ts/capabilities/session-search.ts +893 -0
- package/ts/capabilities/weather.ts +330 -0
- package/ts/dsh-runtime/vendor/README.md +68 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/LICENSE +21 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/README.en.md +405 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/README.md +404 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/client/client.js +1584 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/cordis.patch.yml +5 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/icon.svg +5 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/clients/amap.js +595 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/clients/nominatim.js +63 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/clients/osrm.js +58 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/clients/photon.js +55 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/config-file.js +87 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/config-route.js +131 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/config.js +16 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/geo.js +232 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/index.js +120 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/settings-ns.js +40 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/staticmap-route.js +115 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/tools/geocode.js +127 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/tools/poi.js +84 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/tools/routes.js +267 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/clients/amap.d.ts +90 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/clients/nominatim.d.ts +17 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/clients/osrm.d.ts +15 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/clients/photon.d.ts +22 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/config-file.d.ts +33 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/config-route.d.ts +23 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/config.d.ts +23 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/geo.d.ts +61 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/index.d.ts +18 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/settings-ns.d.ts +14 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/staticmap-route.d.ts +31 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/tools/geocode.d.ts +11 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/tools/poi.d.ts +9 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/tools/routes.d.ts +75 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types/types.d.ts +68 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/lib/types.js +16 -0
- package/ts/dsh-runtime/vendor/dsh-map-tools/package.json +97 -0
- package/ts/package.json +296 -3
- package/ts/scripts/async-collect.ts +91 -0
- package/ts/scripts/map-tools-vendor-package-proof.ts +404 -0
- package/ts/scripts/skeleton-check.ts +1 -1
- package/ts/scripts/skeleton-integration-test.ts +23 -1
- package/ts/scripts/state-cli.ts +568 -0
- package/ts/scripts/turn-handoff-collect.ts +178 -0
- package/ts/src/artifact-gate.ts +991 -0
- package/ts/src/benchmark-agent-conformance.ts +619 -0
- package/ts/src/benchmark-environment-bridge.ts +538 -0
- package/ts/src/benchmark-headless-child-diagnostics.ts +184 -0
- package/ts/src/benchmark-tool-isolation.ts +166 -0
- package/ts/src/bookable-facts.ts +837 -0
- package/ts/src/booking-saga.ts +133 -0
- package/ts/src/booking-surface/availability-policy.ts +522 -0
- package/ts/src/booking-surface/booking-intent.ts +86 -0
- package/ts/src/booking-surface/cancel-refund-commission.ts +488 -0
- package/ts/src/booking-surface/canonical-schema.js +116 -0
- package/ts/src/booking-surface/contracts.ts +475 -0
- package/ts/src/booking-surface/dsh-planner.ts +1949 -0
- package/ts/src/booking-surface/dsh-plugin.js +378 -0
- package/ts/src/booking-surface/dsh-worker.ts +110 -0
- package/ts/src/booking-surface/error-codes.ts +241 -0
- package/ts/src/booking-surface/index.ts +9 -0
- package/ts/src/booking-surface/managed-dsh-cleanup-diagnostic.ts +151 -0
- package/ts/src/booking-surface/managed-dsh-run-port.ts +273 -0
- package/ts/src/booking-surface/profile.ts +42 -0
- package/ts/src/booking-surface/recovery-chain.ts +409 -0
- package/ts/src/booking-surface/runtime.ts +1793 -0
- package/ts/src/booking-surface/server.ts +733 -0
- package/ts/src/booking-surface/startup.ts +201 -0
- package/ts/src/booking-surface/validation.ts +217 -0
- package/ts/src/companions.ts +113 -0
- package/ts/src/contracts.ts +13 -3
- package/ts/src/dsh-llm.ts +44 -11
- package/ts/src/flyai-setup-tool.ts +77 -0
- package/ts/src/index.ts +2107 -224
- package/ts/src/itinerary-deck.ts +189 -0
- package/ts/src/itinerary-doc-shared.ts +741 -0
- package/ts/src/itinerary-html.ts +171 -0
- package/ts/src/loop.ts +278 -40
- package/ts/src/memory-capture.ts +283 -0
- package/ts/src/memory-decay.ts +55 -0
- package/ts/src/memory-utility.ts +70 -0
- package/ts/src/mock-llm.ts +4 -8
- package/ts/src/model.ts +88 -2
- package/ts/src/recall/card.ts +106 -0
- package/ts/src/recall/evaluator.ts +170 -0
- package/ts/src/recall/integration.ts +35 -0
- package/ts/src/recall/tick.ts +213 -0
- package/ts/src/session-link/plan-it-action.ts +78 -0
- package/ts/src/session-link/session-link.ts +275 -0
- package/ts/src/share/adapters.ts +93 -0
- package/ts/src/share/share-consent.ts +105 -0
- package/ts/src/share/share-deck.ts +85 -0
- package/ts/src/share/share-token.ts +166 -0
- package/ts/src/slot-spec.ts +172 -0
- package/ts/src/state-ledger.ts +912 -0
- package/ts/src/subagent-job-id-guard.ts +72 -0
- package/ts/src/time-anchor.ts +338 -0
- package/ts/src/tool-packet.ts +32 -0
- package/ts/src/travel-slots.ts +219 -0
- package/ts/src/travel-timeline.ts +83 -0
- package/ts/src/turn-deadline.ts +366 -0
- package/ts/src/turn-policy.ts +154 -0
- package/ts/src/unified.ts +360 -89
- package/ts/src/wish-pool.ts +79 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic, model-free GoTry server for the Hotel-BE/Hotel-FE proof.
|
|
3
|
+
*
|
|
4
|
+
* The proof starts this process as a real GoTry HTTP/SSE server. The planner
|
|
5
|
+
* is intentionally in-process and typed: it selects a hotel on the payment
|
|
6
|
+
* link surface, starts a search on every other accepted surface, and only
|
|
7
|
+
* emits a terminal event after the corresponding receipt continuation.
|
|
8
|
+
*/
|
|
9
|
+
import { mkdtempSync, rmSync } from 'node:fs';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { tmpdir } from 'node:os';
|
|
12
|
+
import { ensureLedger } from '../src/state-ledger.js';
|
|
13
|
+
import { BOOKING_SURFACE_ALLOWED_ACTIONS, BOOKING_SURFACE_SCHEMA_SHA256, BOOKING_SURFACE_SCHEMA_VERSION, } from '../src/booking-surface/contracts.js';
|
|
14
|
+
import { BookingCopilotTaskRuntime } from '../src/booking-surface/runtime.js';
|
|
15
|
+
import { startBookingCopilotServer } from '../src/booking-surface/server.js';
|
|
16
|
+
const API_KEY = 'test-only-cross-repo-key';
|
|
17
|
+
const stateRoot = mkdtempSync(join(tmpdir(), 'gotry-booking-copilot-crossrepo-'));
|
|
18
|
+
const ledger = ensureLedger(stateRoot);
|
|
19
|
+
let sequence = 0;
|
|
20
|
+
const principal = { subject: 'fixture-crossrepo-bff', scope: 'booking:read' };
|
|
21
|
+
const ingressMode = 'bff-ingress-binding';
|
|
22
|
+
const ingressBinding = {
|
|
23
|
+
bind(input) {
|
|
24
|
+
const surface = input.surfaceHint;
|
|
25
|
+
return {
|
|
26
|
+
taskId: `fixture-task-${input.requestKey}`,
|
|
27
|
+
turnId: `fixture-turn-${input.requestKey}`,
|
|
28
|
+
contextRef: `ctx-fixture-${input.requestKey}`,
|
|
29
|
+
surface,
|
|
30
|
+
allowedActions: [...BOOKING_SURFACE_ALLOWED_ACTIONS[surface]],
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
const plannerFactory = (initialTask) => {
|
|
35
|
+
let receiptObserved = initialTask.lastReceipt !== undefined;
|
|
36
|
+
return {
|
|
37
|
+
async next({ turn, task }) {
|
|
38
|
+
if (turn.kind === 'action.receipt.continuation') {
|
|
39
|
+
receiptObserved = true;
|
|
40
|
+
return [{
|
|
41
|
+
kind: 'terminal',
|
|
42
|
+
terminal: {
|
|
43
|
+
status: 'completed',
|
|
44
|
+
summary: 'Fixture receipt observed.',
|
|
45
|
+
factRefs: [],
|
|
46
|
+
},
|
|
47
|
+
}];
|
|
48
|
+
}
|
|
49
|
+
// After the receipt-driven approval question, the next browser ingress
|
|
50
|
+
// carries the exact selected option. Let the planner issue the same
|
|
51
|
+
// typed read operation; the runtime owns the approval ref injection.
|
|
52
|
+
if (turn.kind === 'user.turn' && turn.request.approval) {
|
|
53
|
+
return [{ kind: 'operation', action: {
|
|
54
|
+
schemaVersion: BOOKING_SURFACE_SCHEMA_VERSION,
|
|
55
|
+
kind: 'search.run',
|
|
56
|
+
actionId: 'cross-repo-action-2',
|
|
57
|
+
contextRef: task.contextRef,
|
|
58
|
+
expectedRevision: task.revision,
|
|
59
|
+
reason: 'Run the approved relaxed search.',
|
|
60
|
+
factRefs: [],
|
|
61
|
+
input: {},
|
|
62
|
+
}, intent: { schemaVersion: 'booking.intent.v1', target: 'search.results' } }];
|
|
63
|
+
}
|
|
64
|
+
if (receiptObserved) {
|
|
65
|
+
return [{
|
|
66
|
+
kind: 'terminal',
|
|
67
|
+
terminal: {
|
|
68
|
+
status: 'completed',
|
|
69
|
+
summary: 'Fixture task already has a receipt.',
|
|
70
|
+
factRefs: [],
|
|
71
|
+
},
|
|
72
|
+
}];
|
|
73
|
+
}
|
|
74
|
+
const action = task.surface === 'payment_link'
|
|
75
|
+
? {
|
|
76
|
+
schemaVersion: BOOKING_SURFACE_SCHEMA_VERSION,
|
|
77
|
+
kind: 'hotel.select',
|
|
78
|
+
actionId: 'cross-repo-action-1',
|
|
79
|
+
contextRef: task.contextRef,
|
|
80
|
+
expectedRevision: task.revision,
|
|
81
|
+
reason: 'Select the requested hotel.',
|
|
82
|
+
factRefs: [],
|
|
83
|
+
input: { hotelRef: 'hotel-proof-1' },
|
|
84
|
+
}
|
|
85
|
+
: {
|
|
86
|
+
schemaVersion: BOOKING_SURFACE_SCHEMA_VERSION,
|
|
87
|
+
kind: 'search.run',
|
|
88
|
+
actionId: 'cross-repo-action-1',
|
|
89
|
+
contextRef: task.contextRef,
|
|
90
|
+
expectedRevision: task.revision,
|
|
91
|
+
reason: 'Run the requested search.',
|
|
92
|
+
factRefs: [],
|
|
93
|
+
input: {},
|
|
94
|
+
};
|
|
95
|
+
const intent = action.kind === 'hotel.select'
|
|
96
|
+
? { schemaVersion: 'booking.intent.v1', target: 'hotel.selected' }
|
|
97
|
+
: { schemaVersion: 'booking.intent.v1', target: 'search.results' };
|
|
98
|
+
return [{ kind: 'operation', action, intent }];
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
async function main() {
|
|
103
|
+
const runtime = new BookingCopilotTaskRuntime(ledger, {
|
|
104
|
+
idFactory: (prefix) => `${prefix}-cross-repo-${++sequence}`,
|
|
105
|
+
now: () => '2026-08-31T00:00:00.000Z',
|
|
106
|
+
});
|
|
107
|
+
const handle = await startBookingCopilotServer({
|
|
108
|
+
apiKey: API_KEY,
|
|
109
|
+
runtime,
|
|
110
|
+
plannerFactory,
|
|
111
|
+
ingressBinding,
|
|
112
|
+
principal,
|
|
113
|
+
ingressMode,
|
|
114
|
+
host: '127.0.0.1',
|
|
115
|
+
port: 0,
|
|
116
|
+
});
|
|
117
|
+
process.stdout.write(`BOOKING_COPILOT_FIXTURE_STARTUP=${JSON.stringify({
|
|
118
|
+
url: `http://127.0.0.1:${handle.port}`,
|
|
119
|
+
version: BOOKING_SURFACE_SCHEMA_VERSION,
|
|
120
|
+
sha256: BOOKING_SURFACE_SCHEMA_SHA256,
|
|
121
|
+
})}\n`);
|
|
122
|
+
await new Promise((resolve) => {
|
|
123
|
+
const stop = () => resolve();
|
|
124
|
+
process.once('SIGTERM', stop);
|
|
125
|
+
process.once('SIGINT', stop);
|
|
126
|
+
});
|
|
127
|
+
await handle.close();
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
await main();
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
process.stderr.write(`booking-copilot-crossrepo-fixture failed: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
134
|
+
process.exitCode = 1;
|
|
135
|
+
}
|
|
136
|
+
finally {
|
|
137
|
+
try {
|
|
138
|
+
ledger.close();
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
process.stderr.write(`booking-copilot-crossrepo-fixture ledger close failed: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
142
|
+
}
|
|
143
|
+
rmSync(stateRoot, { recursive: true, force: true });
|
|
144
|
+
}
|
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Real DeepSeek Harness subprocess proof for the embedded booking planner.
|
|
3
|
+
*
|
|
4
|
+
* A local OpenAI-compatible SSE fixture is the model transport; everything
|
|
5
|
+
* between it and BookingPlannerDecision is the published dsh core, its SDK
|
|
6
|
+
* stdio server, the GoTry plugin, tool execution, session events and adapter.
|
|
7
|
+
*/
|
|
8
|
+
import assert from 'node:assert/strict';
|
|
9
|
+
import { execFileSync, spawnSync } from 'node:child_process';
|
|
10
|
+
import { createServer } from 'node:http';
|
|
11
|
+
import { mkdtempSync, rmSync } from 'node:fs';
|
|
12
|
+
import { tmpdir } from 'node:os';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
import { createDshEmbeddedBookingPlanner, createRealRunPort, resolveRealRunPortConfig, DSH_EMBEDDED_BOOKING_TOOL_NAMES, } from '../src/booking-surface/dsh-planner.js';
|
|
16
|
+
import { bookingDigest } from '../src/booking-surface/runtime.js';
|
|
17
|
+
import { throwWithCleanupFailures } from './booking-copilot-cleanup-proof-helper.js';
|
|
18
|
+
const action = {
|
|
19
|
+
schemaVersion: 'booking.surface',
|
|
20
|
+
kind: 'search.run',
|
|
21
|
+
actionId: 'action-real-dsh-1',
|
|
22
|
+
contextRef: 'ctx-real-dsh-1',
|
|
23
|
+
expectedRevision: 0,
|
|
24
|
+
reason: 'Run the authoritative workspace search.',
|
|
25
|
+
factRefs: [],
|
|
26
|
+
input: {},
|
|
27
|
+
};
|
|
28
|
+
function completedCheckpoint(completed, sourceTurnId) {
|
|
29
|
+
const base = {
|
|
30
|
+
actionId: completed.actionId,
|
|
31
|
+
kind: completed.kind,
|
|
32
|
+
contextRef: completed.contextRef,
|
|
33
|
+
expectedRevision: completed.expectedRevision,
|
|
34
|
+
factRefs: [...completed.factRefs],
|
|
35
|
+
input: structuredClone(completed.input),
|
|
36
|
+
reasonDigest: bookingDigest(completed.reason),
|
|
37
|
+
inputDigest: bookingDigest(completed.input),
|
|
38
|
+
eventId: `operation-${completed.actionId}`,
|
|
39
|
+
sequence: 1,
|
|
40
|
+
emittedAt: '2026-08-30T12:00:00.000Z',
|
|
41
|
+
sourceTurnId,
|
|
42
|
+
};
|
|
43
|
+
return { ...base, actionDigest: bookingDigest(base) };
|
|
44
|
+
}
|
|
45
|
+
function sse(res, chunks) {
|
|
46
|
+
res.writeHead(200, {
|
|
47
|
+
'content-type': 'text/event-stream; charset=utf-8',
|
|
48
|
+
'cache-control': 'no-cache',
|
|
49
|
+
});
|
|
50
|
+
for (const chunk of chunks)
|
|
51
|
+
res.write(`data: ${JSON.stringify(chunk)}\n\n`);
|
|
52
|
+
res.end('data: [DONE]\n\n');
|
|
53
|
+
}
|
|
54
|
+
/** 0.2.0-rc.2 起 provider 线型是 Messages 流(message_start、content_block 前缀事件、
|
|
55
|
+
* message_stop),不再是 OpenAI chat.completion.chunk;合成响应按新线型发。 */
|
|
56
|
+
function messagesToolCallEvents(id, name, input) {
|
|
57
|
+
return [
|
|
58
|
+
{ type: 'message_start', message: { usage: { input_tokens: 10 } } },
|
|
59
|
+
{ type: 'content_block_start', index: 0, content_block: { type: 'tool_use', id, name, input: {} } },
|
|
60
|
+
{ type: 'content_block_delta', index: 0, delta: { type: 'input_json_delta', partial_json: JSON.stringify(input) } },
|
|
61
|
+
{ type: 'content_block_stop', index: 0 },
|
|
62
|
+
{ type: 'message_delta', delta: { stop_reason: 'tool_use' }, usage: { output_tokens: 5 } },
|
|
63
|
+
{ type: 'message_stop' },
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
function messagesTextEvents(text) {
|
|
67
|
+
return [
|
|
68
|
+
{ type: 'message_start', message: { usage: { input_tokens: 20 } } },
|
|
69
|
+
{ type: 'content_block_start', index: 0, content_block: { type: 'text', text } },
|
|
70
|
+
{ type: 'content_block_stop', index: 0 },
|
|
71
|
+
{ type: 'message_delta', delta: { stop_reason: 'end_turn' }, usage: { output_tokens: 4 } },
|
|
72
|
+
{ type: 'message_stop' },
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
function objectKeys(value) {
|
|
76
|
+
if (Array.isArray(value))
|
|
77
|
+
return value.flatMap(objectKeys);
|
|
78
|
+
if (typeof value !== 'object' || value === null)
|
|
79
|
+
return [];
|
|
80
|
+
return Object.entries(value).flatMap(([key, child]) => [key, ...objectKeys(child)]);
|
|
81
|
+
}
|
|
82
|
+
const requests = [];
|
|
83
|
+
let modelCall = 0;
|
|
84
|
+
let continuationServed = false;
|
|
85
|
+
let observeStalledRequest;
|
|
86
|
+
const stalledRequestObserved = new Promise((resolve) => { observeStalledRequest = resolve; });
|
|
87
|
+
const modelServer = createServer((req, res) => {
|
|
88
|
+
const parts = [];
|
|
89
|
+
req.on('data', (part) => parts.push(part));
|
|
90
|
+
req.on('end', () => {
|
|
91
|
+
const body = JSON.parse(Buffer.concat(parts).toString('utf8'));
|
|
92
|
+
requests.push({ headers: req.headers, body });
|
|
93
|
+
modelCall += 1;
|
|
94
|
+
if (JSON.stringify(body).includes('STALL_PROVIDER_PROOF')) {
|
|
95
|
+
res.writeHead(200, { 'content-type': 'text/event-stream; charset=utf-8', 'cache-control': 'no-cache' });
|
|
96
|
+
observeStalledRequest();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
// Script by request content, not call order: the prose-only retry budget
|
|
100
|
+
// issues additional runs whose scripted response must stay prose, not the
|
|
101
|
+
// continuation terminal.
|
|
102
|
+
if (!continuationServed && JSON.stringify(body).includes('action.receipt.continuation')) {
|
|
103
|
+
continuationServed = true;
|
|
104
|
+
sse(res, messagesToolCallEvents('call-booking-continuation', 'booking_search_hotels', { kind: 'terminal' }));
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (modelCall === 1) {
|
|
108
|
+
// The first probabilistic miss omits the mandatory semantic goal. The
|
|
109
|
+
// model-facing schema must reject this before the parent process ever
|
|
110
|
+
// sees a superficially valid action.
|
|
111
|
+
sse(res, messagesToolCallEvents('call-booking-1', 'booking_search_hotels', { kind: 'search.patch', input: { patch: { destination: { query: 'Dubai' } } } }));
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (modelCall === 2) {
|
|
115
|
+
// This repairs the required intent but still violates the full canonical
|
|
116
|
+
// SearchCriteriaPatch.minProperties rule that the provider-compatible
|
|
117
|
+
// advertised dialect cannot express.
|
|
118
|
+
sse(res, messagesToolCallEvents('call-booking-repair', 'booking_search_hotels', { kind: 'search.patch', input: { patch: {} }, intent: { target: 'search.results' } }));
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (modelCall === 3) {
|
|
122
|
+
sse(res, messagesToolCallEvents('call-booking-repair-canonical', 'booking_run_search', { kind: 'search.run', input: {}, intent: { target: 'search.results' } }));
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
sse(res, messagesTextEvents('Typed decision emitted.'));
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
await new Promise((resolve, reject) => {
|
|
129
|
+
modelServer.once('error', reject);
|
|
130
|
+
modelServer.listen(0, '127.0.0.1', () => resolve());
|
|
131
|
+
});
|
|
132
|
+
const address = modelServer.address();
|
|
133
|
+
assert.ok(typeof address === 'object' && address);
|
|
134
|
+
const stateRoot = mkdtempSync(join(tmpdir(), 'gotry-booking-dsh-core-'));
|
|
135
|
+
const workspace = {
|
|
136
|
+
schemaVersion: 'booking.surface',
|
|
137
|
+
contextRef: action.contextRef,
|
|
138
|
+
surface: 'tenant',
|
|
139
|
+
revision: 0,
|
|
140
|
+
locale: 'zh-CN',
|
|
141
|
+
currency: 'AED',
|
|
142
|
+
searchDraft: {},
|
|
143
|
+
results: { status: 'idle' },
|
|
144
|
+
visibleHotels: [],
|
|
145
|
+
loadedOffers: [],
|
|
146
|
+
shortlistedOfferRefs: [],
|
|
147
|
+
capabilities: { surface: 'tenant', allowedActions: ['search.patch', 'search.run'] },
|
|
148
|
+
};
|
|
149
|
+
const turn = {
|
|
150
|
+
schemaVersion: 'booking.surface',
|
|
151
|
+
kind: 'user.turn',
|
|
152
|
+
taskId: 'task-real-dsh-1',
|
|
153
|
+
turnId: 'real-dsh-turn-1',
|
|
154
|
+
workspace,
|
|
155
|
+
request: { text: '执行当前酒店搜索' },
|
|
156
|
+
};
|
|
157
|
+
const availability = { initialized: true, recoveryStarted: false, availabilityPhase: 'need_offers', activeHotelOrdinal: 0, hotelRefs: [], hotels: {}, attempts: [], queryReservations: [] };
|
|
158
|
+
const task = {
|
|
159
|
+
schemaVersion: 'booking.surface',
|
|
160
|
+
taskId: 'task-real-dsh-1',
|
|
161
|
+
contextRef: action.contextRef,
|
|
162
|
+
surface: 'tenant',
|
|
163
|
+
revision: 0,
|
|
164
|
+
allowedActions: ['search.patch', 'search.run'],
|
|
165
|
+
userTurnCount: 1,
|
|
166
|
+
lastTurnId: 'real-dsh-turn-1',
|
|
167
|
+
operationCount: 0,
|
|
168
|
+
phase: 'planning',
|
|
169
|
+
lastSequence: 0,
|
|
170
|
+
availability,
|
|
171
|
+
workspaceSnapshot: workspace,
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* Returns the direct dsh child pids, or null when the host forbids process
|
|
175
|
+
* enumeration (for example hardened sandbox policies that block `ps`).
|
|
176
|
+
* The liveness assertions degrade to a logged skip instead of failing the
|
|
177
|
+
* whole proof on a machine that cannot run `ps`.
|
|
178
|
+
*/
|
|
179
|
+
function directDshChildPids() {
|
|
180
|
+
try {
|
|
181
|
+
const rows = execFileSync('ps', ['-axo', 'pid=,ppid=,command='], { encoding: 'utf8' });
|
|
182
|
+
return new Set(rows.split('\n').flatMap((line) => {
|
|
183
|
+
const match = /^\s*(\d+)\s+(\d+)\s+(.+)$/.exec(line);
|
|
184
|
+
if (!match || Number(match[2]) !== process.pid || /\bps\s+-axo\b/.test(match[3]))
|
|
185
|
+
return [];
|
|
186
|
+
return [Number(match[1])];
|
|
187
|
+
}));
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
if (error.code === 'EPERM') {
|
|
191
|
+
console.log('[core-proof] host forbids `ps`; skipping child-pid liveness assertions (teardown budget still enforced)');
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
throw error;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function processExists(pid) {
|
|
198
|
+
try {
|
|
199
|
+
process.kill(pid, 0);
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function runCleanupNegativeControl() {
|
|
207
|
+
const nodeBinary = process.execPath;
|
|
208
|
+
const tsxCli = fileURLToPath(new URL('../node_modules/tsx/dist/cli.mjs', import.meta.url));
|
|
209
|
+
const helper = fileURLToPath(new URL('./booking-copilot-cleanup-proof-helper.js', import.meta.url));
|
|
210
|
+
const child = spawnSync(nodeBinary, [tsxCli, helper, '--negative-control'], { encoding: 'utf8', timeout: 5_000 });
|
|
211
|
+
assert.equal(child.error, undefined, `cleanup negative control spawned with ${nodeBinary}`);
|
|
212
|
+
assert.equal(child.signal, null, 'cleanup negative control exits before its bound');
|
|
213
|
+
assert.equal(child.status, 0, `cleanup negative control passed: ${child.stderr}`);
|
|
214
|
+
assert.deepEqual(JSON.parse(child.stdout), {
|
|
215
|
+
legacy: { caught: 'proof planner cleanup failure', cleanupOrder: ['legacy-planner'] },
|
|
216
|
+
repaired: {
|
|
217
|
+
body: 'proof body failure',
|
|
218
|
+
cleanup: ['proof planner cleanup failure', 'proof port cleanup failure'],
|
|
219
|
+
cleanupOrder: ['planner', 'port', 'server', 'state-retained'],
|
|
220
|
+
},
|
|
221
|
+
}, 'bounded child proof contrasts legacy masking with retained body and cleanup errors while running every cleanup');
|
|
222
|
+
}
|
|
223
|
+
let planner;
|
|
224
|
+
let stalledPlanner;
|
|
225
|
+
let stalledPort;
|
|
226
|
+
let bodyFailed = false;
|
|
227
|
+
let bodyError;
|
|
228
|
+
const plannerMetrics = [];
|
|
229
|
+
// Planner route resolution: a deployment that forgot DEEPSEEK_MODEL must not
|
|
230
|
+
// look like one that set it. The known default route is explicit and reported
|
|
231
|
+
// as `default`, an operator-selected model is reported as `env`/`option`, and a
|
|
232
|
+
// non-default provider has to name its model instead of inheriting a vendor one.
|
|
233
|
+
{
|
|
234
|
+
const baseEnv = { PATH: process.env.PATH, DEEPSEEK_API_KEY: 'fixture-model-key' };
|
|
235
|
+
const defaultRoute = resolveRealRunPortConfig({ env: baseEnv });
|
|
236
|
+
assert.equal(defaultRoute.model, 'deepseek-v4-flash', 'missing DEEPSEEK_MODEL resolves to the known default route');
|
|
237
|
+
assert.equal(defaultRoute.modelSource, 'default', 'the known default route reports modelSource=default');
|
|
238
|
+
assert.equal(defaultRoute.reasoningEffort, 'off', 'the known default route disables long reasoning');
|
|
239
|
+
assert.equal(defaultRoute.maxTokens, 4_096, 'the known default route keeps the 4k budget');
|
|
240
|
+
const envRoute = resolveRealRunPortConfig({ env: { ...baseEnv, DEEPSEEK_MODEL: 'gateway-selected-model', DEEPSEEK_MAX_TOKENS: '16384' } });
|
|
241
|
+
assert.equal(envRoute.model, 'gateway-selected-model', 'DEEPSEEK_MODEL selects the route');
|
|
242
|
+
assert.equal(envRoute.modelSource, 'env', 'an operator-selected model reports modelSource=env');
|
|
243
|
+
assert.equal(envRoute.reasoningEffort, undefined, 'a custom route keeps its provider reasoning default');
|
|
244
|
+
assert.equal(envRoute.maxTokens, 16_384, 'DEEPSEEK_MAX_TOKENS is honored');
|
|
245
|
+
const optionRoute = resolveRealRunPortConfig({ env: baseEnv, model: 'option-model' });
|
|
246
|
+
assert.equal(optionRoute.model, 'option-model', 'an explicit option selects the route');
|
|
247
|
+
assert.equal(optionRoute.modelSource, 'option', 'an explicit option reports modelSource=option');
|
|
248
|
+
assert.throws(() => resolveRealRunPortConfig({ env: baseEnv, provider: 'other-provider' }), /booking_planner_model_required_for_nondefault_provider/, 'a non-default provider must name its model instead of inheriting one');
|
|
249
|
+
assert.throws(() => resolveRealRunPortConfig({ env: { PATH: process.env.PATH } }), /booking_planner_model_key_required/, 'a missing planner key still fails closed');
|
|
250
|
+
}
|
|
251
|
+
try {
|
|
252
|
+
runCleanupNegativeControl();
|
|
253
|
+
planner = await createDshEmbeddedBookingPlanner({
|
|
254
|
+
stateRoot,
|
|
255
|
+
env: {
|
|
256
|
+
PATH: process.env.PATH,
|
|
257
|
+
DEEPSEEK_API_KEY: 'fixture-model-key',
|
|
258
|
+
DEEPSEEK_BASE_URL: `http://127.0.0.1:${address.port}/v1`,
|
|
259
|
+
GOTRY_BOOKING_COPILOT_API_KEY: 'must-not-enter-dsh',
|
|
260
|
+
HOTELBYTE_TOKEN: 'must-not-enter-dsh',
|
|
261
|
+
},
|
|
262
|
+
maxTokens: 512,
|
|
263
|
+
onMetric: (metric) => plannerMetrics.push(metric),
|
|
264
|
+
});
|
|
265
|
+
const session = planner.plannerFactory(task);
|
|
266
|
+
const decisions = await session.next({ turn, task });
|
|
267
|
+
assert.equal(decisions.length, 1);
|
|
268
|
+
assert.equal(decisions[0]?.kind, 'operation');
|
|
269
|
+
if (decisions[0]?.kind !== 'operation')
|
|
270
|
+
throw new Error('real dsh did not materialize a booking operation');
|
|
271
|
+
assert.equal(decisions[0].action.kind, 'search.run');
|
|
272
|
+
assert.deepEqual(decisions[0].action.input, {});
|
|
273
|
+
assert.match(decisions[0].action.actionId, /^planner-[a-f0-9]{24}$/);
|
|
274
|
+
assert.notEqual(decisions[0].action.actionId, action.actionId);
|
|
275
|
+
assert.equal(requests.length, 3, 'two in-run schema repairs conclude without a redundant post-tool model request');
|
|
276
|
+
assert.deepEqual(plannerMetrics[0], {
|
|
277
|
+
outcome: 'operation',
|
|
278
|
+
decisionSource: 'model',
|
|
279
|
+
elapsedMs: plannerMetrics[0]?.elapsedMs,
|
|
280
|
+
harnessRunCount: 1,
|
|
281
|
+
modelStepCount: 3,
|
|
282
|
+
schemaRejectedCallCount: 2,
|
|
283
|
+
firstPassValid: false,
|
|
284
|
+
schemaRepairedValid: true,
|
|
285
|
+
proseNudgeRecovered: false,
|
|
286
|
+
repairedValid: true,
|
|
287
|
+
bootMs: plannerMetrics[0]?.bootMs,
|
|
288
|
+
bootMode: plannerMetrics[0]?.bootMode,
|
|
289
|
+
actionKind: 'search.run',
|
|
290
|
+
}, 'safe planner metric distinguishes same-turn repair from first-pass validity');
|
|
291
|
+
assert.ok(Number.isSafeInteger(plannerMetrics[0]?.elapsedMs) && plannerMetrics[0].elapsedMs >= 0);
|
|
292
|
+
// This planner creates its own runtime, so the turn pays the handshake: the
|
|
293
|
+
// measurement must attribute that cost to the turn instead of hiding it in
|
|
294
|
+
// the provider window it shares.
|
|
295
|
+
assert.equal(plannerMetrics[0]?.bootMode, 'started', 'a turn that owns a fresh runtime reports its own boot');
|
|
296
|
+
assert.ok(Number.isSafeInteger(plannerMetrics[0]?.bootMs) && plannerMetrics[0].bootMs > 0, 'the turn records the measured initialize cost');
|
|
297
|
+
// 0.2.0-rc.2 Messages 线型:system 不在 messages 里,是请求体顶层 system 字段。
|
|
298
|
+
const firstSystem = requests[0].body.system;
|
|
299
|
+
assert.ok(typeof firstSystem === 'string' && firstSystem.length > 0, 'first model request carries a system message produced by dsh system-prompt');
|
|
300
|
+
const firstSystemContent = firstSystem;
|
|
301
|
+
assert.ok(firstSystemContent.includes("You are GoTry's embedded booking planner"), 'first SYSTEM message carries the GoTry personaPrefix (not the generic-default fallback)');
|
|
302
|
+
assert.ok(firstSystemContent.includes('Shape-only example'), 'first SYSTEM message marks the envelope example as shape-only');
|
|
303
|
+
assert.ok(firstSystemContent.includes('{"kind":"search.patch","input":{"patch":'), 'first SYSTEM message carries the shallow semantic proposal example');
|
|
304
|
+
assert.ok(firstSystemContent.includes('"intent":{"target":"search.results"}'), 'first SYSTEM message demonstrates the mandatory semantic goal');
|
|
305
|
+
for (const runtimeField of ['actionId', 'contextRef', 'expectedRevision', 'sourceFactRef', 'factRefs']) {
|
|
306
|
+
assert.ok(!JSON.stringify(requests[0].body.tools).includes(`"${runtimeField}"`), `model-facing tools omit runtime-owned ${runtimeField}`);
|
|
307
|
+
}
|
|
308
|
+
assert.equal(requests[0].body.model, requests[1].body.model, 'required-intent repair stays in one model session');
|
|
309
|
+
assert.equal(requests[1].body.model, requests[2].body.model, 'canonical semantic repair stays in the same model session');
|
|
310
|
+
const requiredIntentRepairMessages = JSON.stringify(requests[1].body.messages);
|
|
311
|
+
assert.match(requiredIntentRepairMessages, /required property 'intent'|must have required property.*intent/, 'first repair identifies the missing semantic intent');
|
|
312
|
+
assert.ok(requiredIntentRepairMessages.includes('call-booking-1'), 'first repair references the rejected call id');
|
|
313
|
+
const canonicalRepairMessages = JSON.stringify(requests[2].body.messages);
|
|
314
|
+
assert.match(canonicalRepairMessages, /invalid arguments: decision_schema_violation/, 'second repair contains the execute-time canonical ToolArgsError');
|
|
315
|
+
assert.match(canonicalRepairMessages, /fewer than 1 properties/, 'second repair carries the precise canonical constraint that failed');
|
|
316
|
+
assert.ok(canonicalRepairMessages.includes('call-booking-repair'), 'second repair references the canonical-schema rejected call id');
|
|
317
|
+
const toolNames = requests[0].body.tools.map((tool) => tool.function?.name ?? tool.name).sort();
|
|
318
|
+
assert.deepEqual(toolNames, [...DSH_EMBEDDED_BOOKING_TOOL_NAMES].sort(), 'real model request exposes exactly the embedded tool set');
|
|
319
|
+
assert.ok(!toolNames.some((name) => /gotry_book|payment|holder|guest/i.test(name)), 'real model request exposes no booking write or PII tool');
|
|
320
|
+
assert.equal(requests[0].body.model, 'deepseek-v4-flash', 'the default planner model matches the sdk-minimal catalog');
|
|
321
|
+
assert.deepEqual(requests[0].body.thinking, { type: 'disabled' }, 'known default route disables long reasoning for constrained criteria extraction');
|
|
322
|
+
const executableKeys = requests[0].body.tools.flatMap((tool) => objectKeys(tool.function?.parameters ?? tool.input_schema));
|
|
323
|
+
assert.ok(!executableKeys.some((key) => /^(book|payment|holder|guest|portalToken|supplierCost)$/i.test(key)), 'tool inputs expose no write or PII field');
|
|
324
|
+
// 0.2.0-rc.2 认证头随线型变化(authorization Bearer 或 x-api-key);断言凭据到达,不锁单一头部。
|
|
325
|
+
assert.ok(requests[0].headers.authorization === 'Bearer fixture-model-key' || requests[0].headers['x-api-key'] === 'fixture-model-key', 'provider credential reaches the provider via the standard auth header');
|
|
326
|
+
assert.ok(!JSON.stringify(requests).includes('must-not-enter-dsh'), 'BFF and portal credentials never enter the dsh model transport');
|
|
327
|
+
const proseDecisions = await session.next({ turn, task });
|
|
328
|
+
assert.equal(proseDecisions[0]?.kind, 'error', 'assistant prose without a tool call never becomes a decision');
|
|
329
|
+
const continuation = {
|
|
330
|
+
schemaVersion: 'booking.surface', kind: 'action.receipt.continuation', taskId: task.taskId, workspace,
|
|
331
|
+
receipt: { schemaVersion: 'booking.surface', kind: 'action.receipt', actionId: decisions[0].action.actionId, contextRef: workspace.contextRef, status: 'applied', revision: 1,
|
|
332
|
+
observation: { kind: 'search.state', resultCount: 1 }, resultContract: { outcome: 'complete', hardCriteriaMet: true, factRefs: [], gapCodes: [], blockers: [], relaxationsApplied: [] } },
|
|
333
|
+
};
|
|
334
|
+
const continuationWorkspace = { ...workspace, revision: 1, results: { status: 'ready', resultCount: 1 } };
|
|
335
|
+
const boundContinuation = { ...continuation, workspace: continuationWorkspace };
|
|
336
|
+
const continuationDecisions = await session.next({ turn: boundContinuation, task: { ...task, revision: 1, workspaceSnapshot: continuationWorkspace, lastCompletedAction: completedCheckpoint(decisions[0].action, task.lastTurnId), lastReceipt: continuation.kind === 'action.receipt.continuation' ? continuation.receipt : undefined } });
|
|
337
|
+
assert.deepEqual(continuationDecisions, [{ kind: 'terminal', terminal: { status: 'completed', summary: 'search_results_ready', factRefs: [] } }], 'real dsh materializes terminal status and summary from the authoritative receipt');
|
|
338
|
+
// Real SDK/subprocess timeout proof: the user-visible decision deadline is
|
|
339
|
+
// independent from child teardown, and handle shutdown reaps the actual dsh
|
|
340
|
+
// process instead of merely incrementing a fake close counter.
|
|
341
|
+
const childrenBefore = directDshChildPids();
|
|
342
|
+
const stalledTask = {
|
|
343
|
+
...task,
|
|
344
|
+
taskId: 'task-real-dsh-stalled',
|
|
345
|
+
contextRef: 'ctx-real-dsh-stalled',
|
|
346
|
+
lastTurnId: 'real-dsh-stalled-turn',
|
|
347
|
+
workspaceSnapshot: { ...workspace, contextRef: 'ctx-real-dsh-stalled' },
|
|
348
|
+
};
|
|
349
|
+
const stalledTurn = {
|
|
350
|
+
schemaVersion: 'booking.surface',
|
|
351
|
+
kind: 'user.turn',
|
|
352
|
+
taskId: stalledTask.taskId,
|
|
353
|
+
turnId: stalledTask.lastTurnId,
|
|
354
|
+
workspace: stalledTask.workspaceSnapshot,
|
|
355
|
+
request: { text: 'STALL_PROVIDER_PROOF' },
|
|
356
|
+
};
|
|
357
|
+
// This case measures a provider stall, after the SAME task-owned port has
|
|
358
|
+
// completed real SDK initialize. Cold-start timeout is covered separately
|
|
359
|
+
// by booking-copilot-dsh-readiness-proof.ts without relaxing this deadline.
|
|
360
|
+
const priorWarmup = process.env.GOTRY_BOOKING_COPILOT_WARMUP;
|
|
361
|
+
process.env.GOTRY_BOOKING_COPILOT_WARMUP = '0';
|
|
362
|
+
try {
|
|
363
|
+
stalledPort = await createRealRunPort({
|
|
364
|
+
stateRoot,
|
|
365
|
+
env: {
|
|
366
|
+
PATH: process.env.PATH,
|
|
367
|
+
DEEPSEEK_API_KEY: 'fixture-model-key',
|
|
368
|
+
DEEPSEEK_BASE_URL: `http://127.0.0.1:${address.port}/v1`,
|
|
369
|
+
},
|
|
370
|
+
maxTokens: 512,
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
finally {
|
|
374
|
+
if (priorWarmup === undefined)
|
|
375
|
+
delete process.env.GOTRY_BOOKING_COPILOT_WARMUP;
|
|
376
|
+
else
|
|
377
|
+
process.env.GOTRY_BOOKING_COPILOT_WARMUP = priorWarmup;
|
|
378
|
+
}
|
|
379
|
+
await stalledPort.warmup();
|
|
380
|
+
const readyStalledPort = stalledPort;
|
|
381
|
+
stalledPlanner = await createDshEmbeddedBookingPlanner({
|
|
382
|
+
runPortFactory: () => readyStalledPort,
|
|
383
|
+
turnTimeoutMs: 1_500,
|
|
384
|
+
});
|
|
385
|
+
const stalledStartedAt = Date.now();
|
|
386
|
+
const stalledDecisionPromise = stalledPlanner.plannerFactory(stalledTask).next({ turn: stalledTurn, task: stalledTask });
|
|
387
|
+
await Promise.race([
|
|
388
|
+
stalledRequestObserved,
|
|
389
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error('real stalled provider was not reached')), 5_000)),
|
|
390
|
+
]);
|
|
391
|
+
const stalledChildren = childrenBefore === null ? [] : [...directDshChildPids()].filter((pid) => !childrenBefore.has(pid));
|
|
392
|
+
if (childrenBefore !== null) {
|
|
393
|
+
assert.ok(stalledChildren.length >= 1, 'real timeout proof observes the task-owned dsh child before the deadline');
|
|
394
|
+
}
|
|
395
|
+
const stalledDecisions = await stalledDecisionPromise;
|
|
396
|
+
const stalledResponseMs = Date.now() - stalledStartedAt;
|
|
397
|
+
assert.equal(stalledDecisions[0]?.kind, 'error');
|
|
398
|
+
assert.equal(stalledDecisions[0]?.kind === 'error' ? stalledDecisions[0].error.code : '', 'PLANNER_PROVIDER_TIMEOUT');
|
|
399
|
+
assert.ok(stalledResponseMs < 3_000, `real stalled provider returns the typed deadline without awaiting teardown (${stalledResponseMs}ms)`);
|
|
400
|
+
const cleanupStartedAt = Date.now();
|
|
401
|
+
await stalledPlanner.close();
|
|
402
|
+
stalledPlanner = undefined;
|
|
403
|
+
assert.ok(Date.now() - cleanupStartedAt < 3_000, 'real stalled dsh cleanup stays inside the per-turn teardown budget');
|
|
404
|
+
if (childrenBefore !== null) {
|
|
405
|
+
assert.ok(stalledChildren.every((pid) => !processExists(pid)), 'real stalled dsh child is reaped after planner shutdown');
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
catch (error) {
|
|
409
|
+
bodyFailed = true;
|
|
410
|
+
bodyError = error;
|
|
411
|
+
}
|
|
412
|
+
await throwWithCleanupFailures(bodyFailed, bodyError, [
|
|
413
|
+
async () => { await stalledPlanner?.close(); },
|
|
414
|
+
async () => { await stalledPort?.close(); },
|
|
415
|
+
async () => { await planner?.close(); },
|
|
416
|
+
async () => {
|
|
417
|
+
modelServer.closeAllConnections();
|
|
418
|
+
await new Promise((resolve, reject) => modelServer.close((error) => error ? reject(error) : resolve()));
|
|
419
|
+
},
|
|
420
|
+
], {
|
|
421
|
+
onSuccess: () => { rmSync(stateRoot, { recursive: true, force: true }); },
|
|
422
|
+
onFailure: () => { console.error(`BOOKING COPILOT CLEANUP: retained isolated state at ${stateRoot}`); },
|
|
423
|
+
});
|
|
424
|
+
console.log('BOOKING COPILOT DSH CORE PROOF: real subprocess/sdk/plugin/tool-call/concluded-turn/session event/idle OK');
|