@danceiny/gotry 0.0.1-rc.16 → 0.0.1-rc.18
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 +161 -116
- package/README.zh-CN.md +173 -144
- package/bin/gotry-booking-copilot.js +53 -0
- package/bin/gotry-bootstrap.js +113 -66
- package/bin/gotry-inner.js +436 -70
- package/bin/gotry-runtime-resolution.d.ts +27 -0
- package/bin/gotry-runtime-resolution.js +50 -0
- package/bin/gotry.js +1 -1
- package/cordis.gotry-patch.yml +5 -1
- package/dist/capabilities/agent-reach-deep.js +1 -1
- package/dist/capabilities/agent-reach.js +1 -1
- package/dist/capabilities/anything.js +1 -1
- package/dist/capabilities/artifacts.js +1 -1
- package/dist/capabilities/effect.js +1 -1
- package/dist/capabilities/fact-log.js +1 -1
- package/dist/capabilities/flyai.js +20 -6
- package/dist/capabilities/hbcli.js +1 -1
- package/dist/capabilities/incident-log.js +1 -1
- package/dist/capabilities/model-override.js +18 -0
- package/dist/capabilities/opensky.js +1 -1
- package/dist/capabilities/resilience.js +1 -1
- package/dist/capabilities/session/action-cache.js +1 -1
- package/dist/capabilities/session/adapters/ctrip-flight.js +1 -1
- package/dist/capabilities/session/adapters/meituan-local.js +1 -1
- package/dist/capabilities/session/benchmark.js +1 -1
- package/dist/capabilities/session/extension-bridge.js +19 -6
- package/dist/capabilities/session/extension-channel.js +3 -3
- package/dist/capabilities/session/extension-distribution.js +234 -0
- package/dist/capabilities/session/extract.js +1 -1
- package/dist/capabilities/session/golden-score.js +92 -0
- package/dist/capabilities/session/health-watch.js +1 -1
- package/dist/capabilities/session/read-guard.js +1 -1
- package/dist/capabilities/session/static-flight-golden.js +137 -0
- package/dist/capabilities/session/transport.js +1 -1
- package/dist/capabilities/session/wizard.js +21 -251
- package/dist/capabilities/session-consent.js +1 -1
- package/dist/capabilities/session-login.js +11 -5
- package/dist/capabilities/session-search.js +46 -4
- package/dist/capabilities/weather.js +168 -46
- package/dist/data/session-golden-20.json +25 -0
- package/dist/data/sf-golden-manifest.json +102 -0
- package/dist/data/sf-static-routes.json +91 -0
- package/dist/scripts/action-cache-tests.js +1 -1
- package/dist/scripts/agent-planning-budget-e2e.js +227 -0
- package/dist/scripts/agent-planning-budget-tests.js +173 -0
- package/dist/scripts/agent-reach-deep-tests.js +1 -1
- package/dist/scripts/agent-reach-tests.js +1 -1
- package/dist/scripts/agent-reach-wrapper-tests.js +1 -1
- package/dist/scripts/anything-tests.js +1 -1
- package/dist/scripts/async-collect.js +1 -1
- package/dist/scripts/benchmark-environment-bridge-e2e.js +981 -0
- package/dist/scripts/benchmark-environment-bridge-tests.js +2544 -0
- package/dist/scripts/booking-copilot-availability-ledger-binding-tests.js +335 -0
- package/dist/scripts/booking-copilot-availability-policy-v2-tests.js +1355 -0
- package/dist/scripts/booking-copilot-bin-proof-tests.js +89 -0
- package/dist/scripts/booking-copilot-crossrepo-fixture-server.js +113 -0
- package/dist/scripts/booking-copilot-dsh-core-proof-tests.js +356 -0
- package/dist/scripts/booking-copilot-dsh-planner-proof-tests.js +557 -0
- package/dist/scripts/booking-copilot-dsh-plugin-proof-tests.js +140 -0
- package/dist/scripts/booking-copilot-event-sequence-concurrency-proof-tests.js +202 -0
- package/dist/scripts/booking-copilot-gap-code-contract-proof-tests.js +102 -0
- package/dist/scripts/booking-copilot-operation-ledger-concurrency-proof-tests.js +374 -0
- package/dist/scripts/booking-copilot-receipt-ledger-concurrency-proof-tests.js +447 -0
- package/dist/scripts/booking-copilot-runtime-proof-tests.js +205 -0
- package/dist/scripts/booking-copilot-server-proof-tests.js +317 -0
- package/dist/scripts/booking-copilot-startup-proof-tests.js +283 -0
- package/dist/scripts/booking-copilot-v2-runtime-proof-tests.js +3935 -0
- package/dist/scripts/booking-saga-tests.js +1 -1
- package/dist/scripts/booking-surface-contract-proof-tests.js +393 -0
- package/dist/scripts/booking-surface-v2-contract-proof-tests.js +1174 -0
- package/dist/scripts/bootstrap-tests.js +45 -39
- package/dist/scripts/build-changelog.js +1 -1
- package/dist/scripts/changelog-tests.js +1 -1
- package/dist/scripts/companion-tests.js +1 -1
- package/dist/scripts/diff-test.js +1 -1
- package/dist/scripts/dsh-runtime-closure-tests.js +225 -0
- package/dist/scripts/dsh-runtime-closure.js +150 -0
- package/dist/scripts/effect-tests.js +1 -1
- package/dist/scripts/engine-run.js +1 -1
- package/dist/scripts/engine-tests.js +1 -1
- package/dist/scripts/evaluation-cadence-tests.js +347 -0
- package/dist/scripts/evaluation-contract-tests.js +574 -0
- package/dist/scripts/extension-distribution-cli.js +35 -0
- package/dist/scripts/extension-distribution-tests.js +341 -0
- package/dist/scripts/extension-tests.js +128 -23
- package/dist/scripts/fact-gate-tests.js +1 -1
- package/dist/scripts/flyai-tests.js +1 -1
- package/dist/scripts/hbcli-e2e-tests.js +1 -1
- package/dist/scripts/hbcli-tests.js +1 -1
- package/dist/scripts/health-watch-cli.js +1 -1
- package/dist/scripts/i18n-tests.js +1 -1
- package/dist/scripts/incident-tests.js +1 -1
- package/dist/scripts/journey-tests.js +1 -1
- package/dist/scripts/ledger-tests.js +1 -1
- package/dist/scripts/ledger-workflow-crash.js +1 -1
- package/dist/scripts/memory-capture-tests.js +1 -1
- package/dist/scripts/memory-decay-tests.js +1 -1
- package/dist/scripts/memory-metrics.js +1 -1
- package/dist/scripts/memory-value-report.js +1 -1
- package/dist/scripts/model-override-e2e.js +176 -0
- package/dist/scripts/nightly-evidence-tests.js +1 -1
- package/dist/scripts/nightly-evidence.js +1 -1
- package/dist/scripts/nudge-digest.js +1 -1
- package/dist/scripts/onboarding-tests.js +21 -53
- package/dist/scripts/opensky-check.js +1 -1
- package/dist/scripts/opensky-tests.js +1 -1
- package/dist/scripts/pnpm-dsh-closure-proof.js +20 -0
- package/dist/scripts/price-drift-tests.js +1 -1
- package/dist/scripts/price-drift-watch.js +1 -1
- package/dist/scripts/probe-poi-tests.js +1 -1
- package/dist/scripts/product-metrics.js +1 -1
- package/dist/scripts/publish-preverify.js +40 -4
- package/dist/scripts/realtime-pricing-tests.js +1 -1
- package/dist/scripts/replay-async.js +1 -1
- package/dist/scripts/replay-real.js +1 -1
- package/dist/scripts/replay.js +1 -1
- package/dist/scripts/session-attach-diagnose.js +1 -1
- package/dist/scripts/session-attach-poc.js +1 -1
- package/dist/scripts/session-benchmark.js +1 -1
- package/dist/scripts/session-extract-tests.js +1 -1
- package/dist/scripts/session-login.js +1 -1
- package/dist/scripts/session-tests.js +70 -20
- package/dist/scripts/sf-live-benchmark.js +338 -0
- package/dist/scripts/sf-live-cli-tests.js +21 -0
- package/dist/scripts/sf-soft-score-tests.js +108 -0
- package/dist/scripts/sf-summary.js +93 -0
- package/dist/scripts/skeleton-check.js +1 -1
- package/dist/scripts/skeleton-integration-test.js +1 -1
- package/dist/scripts/skills-contract-tests.js +1 -1
- package/dist/scripts/smoke-session-gate-tests.js +29 -0
- package/dist/scripts/smoke.js +79 -33
- package/dist/scripts/state-cli-tests.js +1 -1
- package/dist/scripts/state-cli.js +1 -1
- package/dist/scripts/static-golden-tests.js +299 -0
- package/dist/scripts/time-eval-tests.js +1 -1
- package/dist/scripts/travel-timeline-tests.js +1 -1
- package/dist/scripts/unified-tests.js +1 -1
- package/dist/scripts/weather-tests.js +694 -44
- package/dist/scripts/z3-race-tests.js +1 -1
- package/dist/src/artifact-gate.js +1 -1
- package/dist/src/benchmark-agent-conformance.js +370 -0
- package/dist/src/benchmark-environment-bridge.js +384 -0
- package/dist/src/benchmark-headless-child-diagnostics.js +173 -0
- package/dist/src/benchmark-tool-isolation.js +124 -0
- package/dist/src/bookable-facts.js +1 -1
- package/dist/src/booking-saga.js +1 -1
- package/dist/src/booking-surface/availability-policy-v2.js +830 -0
- package/dist/src/booking-surface/canonical-schema.js +113 -0
- package/dist/src/booking-surface/contracts-v2.js +89 -0
- package/dist/src/booking-surface/contracts.js +46 -0
- package/dist/src/booking-surface/dsh-planner.js +453 -0
- package/dist/src/booking-surface/dsh-plugin.js +93 -0
- package/dist/src/booking-surface/error-codes.js +94 -0
- package/dist/src/booking-surface/index.js +15 -0
- package/dist/src/booking-surface/profile.js +68 -0
- package/dist/src/booking-surface/runtime-v2.js +1771 -0
- package/dist/src/booking-surface/runtime.js +351 -0
- package/dist/src/booking-surface/server-v2.js +334 -0
- package/dist/src/booking-surface/server.js +302 -0
- package/dist/src/booking-surface/startup.js +159 -0
- package/dist/src/booking-surface/validation-v2.js +319 -0
- package/dist/src/booking-surface/validation.js +809 -0
- package/dist/src/bridge.js +1 -1
- package/dist/src/companions.js +1 -1
- package/dist/src/contracts.js +1 -1
- package/dist/src/dsh-llm.js +1 -1
- package/dist/src/engine.js +1 -1
- package/dist/src/evaluation-cadence.js +234 -0
- package/dist/src/evaluation-contracts.js +906 -0
- package/dist/src/i18n.js +1 -1
- package/dist/src/index.js +50 -19
- package/dist/src/journey.js +1 -1
- package/dist/src/loop.js +1 -1
- package/dist/src/memory-capture.js +1 -1
- package/dist/src/memory-decay.js +1 -1
- package/dist/src/memory-utility.js +1 -1
- package/dist/src/mock-llm.js +1 -1
- package/dist/src/model.js +1 -1
- package/dist/src/realtime-pricing.js +1 -1
- package/dist/src/slot-spec.js +1 -1
- package/dist/src/state-ledger.js +2 -1
- package/dist/src/time-anchor.js +1 -1
- package/dist/src/tool-budget.js +136 -0
- package/dist/src/tool-packet.js +1 -1
- package/dist/src/travel-slots.js +1 -1
- package/dist/src/travel-timeline.js +1 -1
- package/dist/src/unified.js +1 -1
- package/dist/src/wish-pool.js +1 -1
- package/dist/src/z3-shared.js +1 -1
- package/extension/README.md +31 -7
- package/package.json +286 -11
- package/schemas/booking.surface.v1.schema.json +927 -0
- package/schemas/booking.surface.v2.schema.json +61 -0
- package/ts/capabilities/flyai.ts +16 -3
- package/ts/capabilities/session/extension-bridge.ts +37 -14
- package/ts/capabilities/session/extension-channel.ts +6 -3
- package/ts/capabilities/session/extension-distribution.ts +264 -0
- package/ts/capabilities/session/golden-score.ts +139 -0
- package/ts/capabilities/session/health-watch.ts +1 -1
- package/ts/capabilities/session/static-flight-golden.ts +209 -0
- package/ts/capabilities/session/wizard.ts +34 -176
- package/ts/capabilities/session-login.ts +15 -5
- package/ts/capabilities/session-search.ts +40 -3
- package/ts/capabilities/weather.ts +141 -52
- package/ts/package.json +3 -3
- package/ts/src/benchmark-agent-conformance.ts +448 -0
- package/ts/src/benchmark-environment-bridge.ts +348 -0
- package/ts/src/benchmark-headless-child-diagnostics.ts +184 -0
- package/ts/src/benchmark-tool-isolation.ts +166 -0
- package/ts/src/booking-surface/availability-policy-v2.ts +523 -0
- package/ts/src/booking-surface/canonical-schema.js +113 -0
- package/ts/src/booking-surface/contracts-v2.ts +118 -0
- package/ts/src/booking-surface/contracts.ts +380 -0
- package/ts/src/booking-surface/dsh-planner.ts +452 -0
- package/ts/src/booking-surface/dsh-plugin.js +93 -0
- package/ts/src/booking-surface/error-codes.ts +101 -0
- package/ts/src/booking-surface/index.ts +12 -0
- package/ts/src/booking-surface/profile.ts +42 -0
- package/ts/src/booking-surface/runtime-v2.ts +1466 -0
- package/ts/src/booking-surface/runtime.ts +483 -0
- package/ts/src/booking-surface/server-v2.ts +247 -0
- package/ts/src/booking-surface/server.ts +324 -0
- package/ts/src/booking-surface/startup.ts +196 -0
- package/ts/src/booking-surface/validation-v2.ts +205 -0
- package/ts/src/booking-surface/validation.ts +453 -0
- package/ts/src/index.ts +64 -11
- package/ts/src/state-ledger.ts +1 -0
- package/ts/src/tool-budget.ts +165 -0
- package/dist/scripts/wizard-bootstrap.js +0 -32
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime projection of the canonical booking.surface.v1 JSON Schema.
|
|
3
|
+
*
|
|
4
|
+
* dsh tools need self-contained JSON Schemas, while the canonical document is
|
|
5
|
+
* organized with local $refs. This helper derives each action branch directly
|
|
6
|
+
* from those canonical bytes and recursively inlines local references. No
|
|
7
|
+
* model-facing action schema is maintained by hand.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { readFileSync } from 'node:fs'
|
|
11
|
+
|
|
12
|
+
const schemaUrl = new URL('../../../schemas/booking.surface.v1.schema.json', import.meta.url)
|
|
13
|
+
export const canonicalBookingSurfaceSchemaV1 = JSON.parse(readFileSync(schemaUrl, 'utf8'))
|
|
14
|
+
const schemaV2Url = new URL('../../../schemas/booking.surface.v2.schema.json', import.meta.url)
|
|
15
|
+
export const canonicalBookingSurfaceSchemaV2 = JSON.parse(readFileSync(schemaV2Url, 'utf8'))
|
|
16
|
+
|
|
17
|
+
function clone(value) {
|
|
18
|
+
return JSON.parse(JSON.stringify(value))
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function definitionFromRef(ref, schema) {
|
|
22
|
+
const prefix = '#/$defs/'
|
|
23
|
+
if (typeof ref !== 'string') {
|
|
24
|
+
throw new Error(`booking_schema_external_ref_forbidden:${String(ref)}`)
|
|
25
|
+
}
|
|
26
|
+
const externalV1 = 'https://gotry.dev/schemas/booking.surface.v1.schema.json#/$defs/'
|
|
27
|
+
const definitionSchema = ref.startsWith(prefix) ? schema : ref.startsWith(externalV1) ? canonicalBookingSurfaceSchemaV1 : undefined
|
|
28
|
+
if (!definitionSchema) throw new Error(`booking_schema_external_ref_forbidden:${String(ref)}`)
|
|
29
|
+
const name = ref.startsWith(prefix) ? ref.slice(prefix.length) : ref.slice(externalV1.length)
|
|
30
|
+
const definition = definitionSchema.$defs?.[name]
|
|
31
|
+
if (!definition) throw new Error(`booking_schema_missing_definition:${name}`)
|
|
32
|
+
return definition
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function inlineLocalRefs(value, schema, stack = []) {
|
|
36
|
+
if (Array.isArray(value)) return value.map((item) => inlineLocalRefs(item, schema, stack))
|
|
37
|
+
if (typeof value !== 'object' || value === null) return value
|
|
38
|
+
if (typeof value.$ref === 'string') {
|
|
39
|
+
if (stack.includes(value.$ref)) throw new Error(`booking_schema_recursive_ref:${value.$ref}`)
|
|
40
|
+
const { $ref, ...siblings } = value
|
|
41
|
+
const definitionSchema = typeof $ref === 'string' && $ref.startsWith('https://gotry.dev/schemas/booking.surface.v1.schema.json#/$defs/') ? canonicalBookingSurfaceSchemaV1 : schema
|
|
42
|
+
return {
|
|
43
|
+
...inlineLocalRefs(definitionFromRef($ref, schema), definitionSchema, [...stack, $ref]),
|
|
44
|
+
...inlineLocalRefs(siblings, schema, stack),
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, inlineLocalRefs(item, schema, stack)]))
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function canonicalActionSchemaForKind(kind, schema, definitionName) {
|
|
51
|
+
const action = schema.$defs?.[definitionName]
|
|
52
|
+
if (!action) throw new Error('booking_schema_action_union_missing')
|
|
53
|
+
if (Array.isArray(action.allOf)) {
|
|
54
|
+
const branch = action.allOf.find((candidate) => candidate?.if?.properties?.kind?.const === kind)
|
|
55
|
+
const input = branch?.then?.properties?.input
|
|
56
|
+
if (!input) throw new Error(`booking_schema_action_kind_missing:${kind}`)
|
|
57
|
+
return clone(inlineLocalRefs({
|
|
58
|
+
type: action.type,
|
|
59
|
+
required: action.required,
|
|
60
|
+
properties: { ...action.properties, kind: { type: 'string', const: kind }, input },
|
|
61
|
+
additionalProperties: action.additionalProperties,
|
|
62
|
+
}, schema))
|
|
63
|
+
}
|
|
64
|
+
if (!Array.isArray(action.oneOf)) throw new Error('booking_schema_action_union_missing')
|
|
65
|
+
const branch = action.oneOf.find((candidate) => candidate?.allOf?.some((part) => part?.properties?.kind?.const === kind))
|
|
66
|
+
const base = schema.$defs?.ActionBase
|
|
67
|
+
const input = branch?.allOf?.find((part) => part?.properties?.input)?.properties?.input
|
|
68
|
+
if (!base || !input) throw new Error(`booking_schema_action_kind_missing:${kind}`)
|
|
69
|
+
return clone(inlineLocalRefs({
|
|
70
|
+
...base,
|
|
71
|
+
properties: { ...base.properties, kind: { type: 'string', const: kind }, input },
|
|
72
|
+
}, schema))
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function canonicalBookingActionSchemaForKind(kind) {
|
|
76
|
+
return canonicalActionSchemaForKind(kind, canonicalBookingSurfaceSchemaV1, 'BookingReadActionV1')
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function canonicalBookingActionSchemaForKindV2(kind) {
|
|
80
|
+
return canonicalActionSchemaForKind(kind, canonicalBookingSurfaceSchemaV2, 'Action')
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const DSH_JSON_SCHEMA_KEYS = new Set([
|
|
84
|
+
'type', 'oneOf', 'properties', 'required', 'additionalProperties', 'items',
|
|
85
|
+
'enum', 'const', 'description', 'title', 'default', 'examples',
|
|
86
|
+
])
|
|
87
|
+
|
|
88
|
+
function projectDshSchema(value) {
|
|
89
|
+
if (Array.isArray(value)) return value.map(projectDshSchema)
|
|
90
|
+
if (typeof value !== 'object' || value === null) return value
|
|
91
|
+
return Object.fromEntries(Object.entries(value)
|
|
92
|
+
.filter(([key]) => DSH_JSON_SCHEMA_KEYS.has(key))
|
|
93
|
+
.map(([key, item]) => {
|
|
94
|
+
if (key === 'properties') {
|
|
95
|
+
return [key, Object.fromEntries(Object.entries(item).map(([name, property]) => [name, projectDshSchema(property)]))]
|
|
96
|
+
}
|
|
97
|
+
return [key, projectDshSchema(item)]
|
|
98
|
+
}))
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* dsh-tools intentionally supports a smaller enforced JSON-Schema vocabulary.
|
|
103
|
+
* Keep the canonical shape/type/enum/closure guarantees at the model seam;
|
|
104
|
+
* the full canonical AJV validator remains the runtime authority for numeric,
|
|
105
|
+
* pattern, size and uniqueness constraints before an operation can be issued.
|
|
106
|
+
*/
|
|
107
|
+
export function dshBookingActionSchemaForKind(kind) {
|
|
108
|
+
return projectDshSchema(canonicalBookingActionSchemaForKind(kind))
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function dshBookingActionSchemaForKindV2(kind) {
|
|
112
|
+
return projectDshSchema(canonicalBookingActionSchemaForKindV2(kind))
|
|
113
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export const BOOKING_SURFACE_SCHEMA_VERSION_V2 = 'booking.surface.v2';
|
|
2
|
+
export const BOOKING_COPILOT_V2_INGRESS_MODES = [
|
|
3
|
+
'bff-bound-turn-only',
|
|
4
|
+
'bff-ingress-binding'
|
|
5
|
+
];
|
|
6
|
+
export const BOOKING_COPILOT_V2_ACCEPTED_TURN_KINDS = [
|
|
7
|
+
'user.turn',
|
|
8
|
+
'action.receipt.continuation'
|
|
9
|
+
];
|
|
10
|
+
export const BOOKING_COPILOT_V2_INGRESS_TURN_KIND = 'user.turn.ingress';
|
|
11
|
+
export const BOOKING_COPILOT_MAX_OPERATIONS_V2 = 20;
|
|
12
|
+
export const BOOKING_SURFACE_SCHEMA_V2_SHA256 = '45df62db1b19d30a4fd22ddc94eb550e8ff32d8a225558b5ff13ba303588fc03';
|
|
13
|
+
export const BOOKING_READ_ACTION_KINDS_V2 = [
|
|
14
|
+
'search.patch',
|
|
15
|
+
'search.run',
|
|
16
|
+
'results.view.patch',
|
|
17
|
+
'hotel.focus',
|
|
18
|
+
'hotel.select',
|
|
19
|
+
'offers.query',
|
|
20
|
+
'offers.view.patch',
|
|
21
|
+
'offers.compare',
|
|
22
|
+
'offer.select',
|
|
23
|
+
'offer.check',
|
|
24
|
+
'checkout.prepare',
|
|
25
|
+
'order.observe'
|
|
26
|
+
];
|
|
27
|
+
export const BOOKING_SURFACE_ALLOWED_ACTIONS_V2 = {
|
|
28
|
+
tenant: BOOKING_READ_ACTION_KINDS_V2,
|
|
29
|
+
customer_portal: BOOKING_READ_ACTION_KINDS_V2,
|
|
30
|
+
storefront: [
|
|
31
|
+
'search.patch',
|
|
32
|
+
'search.run',
|
|
33
|
+
'results.view.patch',
|
|
34
|
+
'hotel.focus'
|
|
35
|
+
],
|
|
36
|
+
payment_link: [
|
|
37
|
+
'search.patch',
|
|
38
|
+
'search.run',
|
|
39
|
+
'results.view.patch',
|
|
40
|
+
'hotel.focus',
|
|
41
|
+
'hotel.select'
|
|
42
|
+
]
|
|
43
|
+
};
|
|
44
|
+
export function bookingSurfaceAllowedActionsV2(surface) {
|
|
45
|
+
return [
|
|
46
|
+
...BOOKING_SURFACE_ALLOWED_ACTIONS_V2[surface]
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
export const BOOKING_V2_BLOCKER_CODES = [
|
|
50
|
+
'no_hotels_matched',
|
|
51
|
+
'hotel_not_visible',
|
|
52
|
+
'hotel_rates_failed',
|
|
53
|
+
'criterion_must_not_met',
|
|
54
|
+
'offer_target_not_reached',
|
|
55
|
+
'offer_unavailable'
|
|
56
|
+
];
|
|
57
|
+
export const BOOKING_V2_GAP_CODES = [
|
|
58
|
+
'byos_mapped_risk',
|
|
59
|
+
'check_avail_failed',
|
|
60
|
+
'check_avail_unverified',
|
|
61
|
+
'component_executor_unavailable',
|
|
62
|
+
'hotel_not_visible',
|
|
63
|
+
'hotel_rates_failed',
|
|
64
|
+
'offer_facts_changed',
|
|
65
|
+
'offer_not_loaded',
|
|
66
|
+
'offer_unavailable',
|
|
67
|
+
'order_not_found',
|
|
68
|
+
'order_outcome_not_observed',
|
|
69
|
+
'order_state_unknown',
|
|
70
|
+
'order_status_unavailable',
|
|
71
|
+
'requested_offers_not_loaded',
|
|
72
|
+
'search_failed',
|
|
73
|
+
'search_form_invalid',
|
|
74
|
+
'search_session_expired',
|
|
75
|
+
'search_terminal_timeout',
|
|
76
|
+
'stale_revision',
|
|
77
|
+
'surface_adapter_failed',
|
|
78
|
+
'undo_token_not_found',
|
|
79
|
+
'unhandled',
|
|
80
|
+
'unsupported',
|
|
81
|
+
'verified_offer_required',
|
|
82
|
+
'workspace_changed_during_action',
|
|
83
|
+
'criterion_must_not_met',
|
|
84
|
+
'no_hotels_matched',
|
|
85
|
+
'offer_target_not_reached'
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
//# sourceURL=ts/src/booking-surface/contracts-v2.ts
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const BOOKING_SURFACE_SCHEMA_VERSION = 'booking.surface.v1';
|
|
2
|
+
export const BOOKING_SURFACE_SCHEMA_SHA256 = 'd9c2194ec839bd1168e70e8a201581addc005039d9b299660e20650bbb65df81';
|
|
3
|
+
export const BOOKING_SURFACE_VERSION_HEADER = 'x-booking-surface-version';
|
|
4
|
+
export const BOOKING_SURFACE_SCHEMA_SHA256_HEADER = 'x-booking-surface-schema-sha256';
|
|
5
|
+
export const BOOKING_SURFACES = [
|
|
6
|
+
'tenant',
|
|
7
|
+
'customer_portal',
|
|
8
|
+
'storefront',
|
|
9
|
+
'payment_link'
|
|
10
|
+
];
|
|
11
|
+
export const BOOKING_READ_ACTION_KINDS = [
|
|
12
|
+
'search.patch',
|
|
13
|
+
'search.run',
|
|
14
|
+
'results.view.patch',
|
|
15
|
+
'hotel.focus',
|
|
16
|
+
'hotel.select',
|
|
17
|
+
'offers.query',
|
|
18
|
+
'offers.view.patch',
|
|
19
|
+
'offers.compare',
|
|
20
|
+
'offer.select',
|
|
21
|
+
'offer.check',
|
|
22
|
+
'checkout.prepare',
|
|
23
|
+
'order.observe'
|
|
24
|
+
];
|
|
25
|
+
export const BOOKING_RECEIPT_STATUSES = [
|
|
26
|
+
'applied',
|
|
27
|
+
'needs_input',
|
|
28
|
+
'partial',
|
|
29
|
+
'no_match',
|
|
30
|
+
'unavailable',
|
|
31
|
+
'changed',
|
|
32
|
+
'stale',
|
|
33
|
+
'unsupported',
|
|
34
|
+
'failed'
|
|
35
|
+
];
|
|
36
|
+
export const BOOKING_SURFACE_EVENT_KINDS = [
|
|
37
|
+
'status',
|
|
38
|
+
'question',
|
|
39
|
+
'operation',
|
|
40
|
+
'explanation',
|
|
41
|
+
'terminal',
|
|
42
|
+
'error'
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
//# sourceURL=ts/src/booking-surface/contracts.ts
|