@burdenoff/microfe-healthybowl 2026.904.21 → 2026.904.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/assistant/AssistantChatArea.js +7 -9
- package/dist/components/assistant/AssistantChatArea.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoot.js +56 -57
- package/dist/healthybowl/HealthyBowlRoot.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoutes.js +36 -48
- package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
- package/dist/healthybowl/components/CreateFarmTaskButton.js.map +1 -1
- package/dist/healthybowl/components/PageLayout.js +10 -11
- package/dist/healthybowl/components/PageLayout.js.map +1 -1
- package/dist/healthybowl/context/HealthyBowlContext.js +7 -7
- package/dist/healthybowl/context/HealthyBowlContext.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlCompliance.js +141 -157
- package/dist/healthybowl/hooks/useHealthyBowlCompliance.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlData.js +0 -18
- package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlDistribution.js +37 -52
- package/dist/healthybowl/hooks/useHealthyBowlDistribution.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js +78 -135
- package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js.map +1 -1
- package/dist/healthybowl/hooks/useIrrigationAutomation.js +1 -1
- package/dist/healthybowl/hooks/useIrrigationAutomation.js.map +1 -1
- package/dist/healthybowl/hooks/useSuccessionPlanning.js +1 -1
- package/dist/healthybowl/hooks/useSuccessionPlanning.js.map +1 -1
- package/dist/healthybowl/hooks/useWeatherIntelligence.js +1 -1
- package/dist/healthybowl/hooks/useWeatherIntelligence.js.map +1 -1
- package/dist/healthybowl/offline/OfflineStatusPill.js +21 -40
- package/dist/healthybowl/offline/OfflineStatusPill.js.map +1 -1
- package/dist/healthybowl/offline/OfflineSyncProvider.js +130 -153
- package/dist/healthybowl/offline/OfflineSyncProvider.js.map +1 -1
- package/dist/healthybowl/offline/graphql.js.map +1 -1
- package/dist/healthybowl/offline/store.js +1 -1
- package/dist/healthybowl/offline/syncEngine.js +1 -2
- package/dist/healthybowl/offline/syncEngine.js.map +1 -1
- package/dist/healthybowl/offline/types.js.map +1 -1
- package/dist/healthybowl/pages/GettingStartedPage.js +0 -1
- package/dist/healthybowl/pages/GettingStartedPage.js.map +1 -1
- package/dist/healthybowl/pages/analytics/InsightsPage.js +2 -2
- package/dist/healthybowl/pages/analytics/InsightsPage.js.map +1 -1
- package/dist/healthybowl/pages/analytics/ReportsPage.js +99 -136
- package/dist/healthybowl/pages/analytics/ReportsPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/ComplianceOverviewPage.js +162 -204
- package/dist/healthybowl/pages/compliance/ComplianceOverviewPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/IcsGroupDetailPage.js +178 -196
- package/dist/healthybowl/pages/compliance/IcsGroupDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/IcsGrowerDetailPage.js +141 -142
- package/dist/healthybowl/pages/compliance/IcsGrowerDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropFieldsPage.js +0 -2
- package/dist/healthybowl/pages/crops/CropFieldsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropHarvestPage.js +272 -316
- package/dist/healthybowl/pages/crops/CropHarvestPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropPlanningPage.js +0 -6
- package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +846 -871
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/HarvestDetailsPage.js +334 -376
- package/dist/healthybowl/pages/crops/HarvestDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js +188 -415
- package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/distribution/labels.js +2 -10
- package/dist/healthybowl/pages/distribution/labels.js.map +1 -1
- package/dist/healthybowl/pages/farm/FarmProfilePage.js +0 -1
- package/dist/healthybowl/pages/farm/FarmProfilePage.js.map +1 -1
- package/dist/healthybowl/pages/field-capture/CaptureObservationForm.js +8 -8
- package/dist/healthybowl/pages/fields/FieldMapPage.js +0 -2
- package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/FinancialReportsPage.js +107 -92
- package/dist/healthybowl/pages/financial/FinancialReportsPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +188 -228
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js +191 -261
- package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js +14 -14
- package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js.map +1 -1
- package/dist/healthybowl/pages/irrigation/IrrigationPage.js +307 -338
- package/dist/healthybowl/pages/irrigation/IrrigationPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js +102 -126
- package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalDepthPage.js +215 -257
- package/dist/healthybowl/pages/livestock/AnimalDepthPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/GrazingPage.js +0 -1
- package/dist/healthybowl/pages/livestock/GrazingPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/HerdDepthPage.js +0 -4
- package/dist/healthybowl/pages/livestock/HerdDepthPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/grazing/RecordGrazingMoveModal.js +9 -8
- package/dist/healthybowl/pages/livestock/grazing/RecordGrazingMoveModal.js.map +1 -1
- package/dist/healthybowl/pages/network/ExpertsPage.js +419 -520
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js +130 -129
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js +237 -285
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js.map +1 -1
- package/dist/healthybowl/utils/plantingCapacity.js +10 -10
- package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
- package/dist/node_modules/fast-equals/dist/es/index.js +86 -74
- package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -1
- package/dist/services/assistantApi.js +30 -59
- package/dist/services/assistantApi.js.map +1 -1
- package/dist/utils/pageContext.js +1 -15
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
- package/dist/healthybowl/hooks/useAgronomyDecisions.js +0 -79
- package/dist/healthybowl/hooks/useAgronomyDecisions.js.map +0 -1
- package/dist/healthybowl/hooks/useAnalyticsReports.js +0 -173
- package/dist/healthybowl/hooks/useAnalyticsReports.js.map +0 -1
- package/dist/healthybowl/hooks/useComplianceExports.js +0 -74
- package/dist/healthybowl/hooks/useComplianceExports.js.map +0 -1
- package/dist/healthybowl/hooks/useConsultationPayments.js +0 -59
- package/dist/healthybowl/hooks/useConsultationPayments.js.map +0 -1
- package/dist/healthybowl/hooks/usePlantingEstimate.js +0 -88
- package/dist/healthybowl/hooks/usePlantingEstimate.js.map +0 -1
- package/dist/healthybowl/offline/HeaderOfflinePill.js +0 -28
- package/dist/healthybowl/offline/HeaderOfflinePill.js.map +0 -1
- package/dist/healthybowl/offline/captureCache.js +0 -30
- package/dist/healthybowl/offline/captureCache.js.map +0 -1
- package/dist/healthybowl/offline/headerSlot.js +0 -24
- package/dist/healthybowl/offline/headerSlot.js.map +0 -1
- package/dist/healthybowl/pages/ai/AiDecisionsPage.js +0 -287
- package/dist/healthybowl/pages/ai/AiDecisionsPage.js.map +0 -1
- package/dist/healthybowl/pages/compliance/ResidueTestsPage.js +0 -291
- package/dist/healthybowl/pages/compliance/ResidueTestsPage.js.map +0 -1
- package/dist/healthybowl/pages/compliance/SubstanceRulesPage.js +0 -300
- package/dist/healthybowl/pages/compliance/SubstanceRulesPage.js.map +0 -1
- package/dist/healthybowl/pages/compliance/substanceRuleForm.js +0 -135
- package/dist/healthybowl/pages/compliance/substanceRuleForm.js.map +0 -1
- package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js +0 -49
- package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js.map +0 -1
- package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js +0 -48
- package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js.map +0 -1
- package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js +0 -54
- package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js.map +0 -1
- package/dist/healthybowl/pages/livestock/PedigreeTree.js +0 -154
- package/dist/healthybowl/pages/livestock/PedigreeTree.js.map +0 -1
- package/dist/healthybowl/pages/livestock/eidTagInput.js +0 -39
- package/dist/healthybowl/pages/livestock/eidTagInput.js.map +0 -1
- package/dist/healthybowl/pages/livestock/pedigreeLayout.js +0 -68
- package/dist/healthybowl/pages/livestock/pedigreeLayout.js.map +0 -1
- package/dist/healthybowl/pages/weather/alertDelivery.js +0 -105
- package/dist/healthybowl/pages/weather/alertDelivery.js.map +0 -1
- package/dist/healthybowl/utils/icsInspection.js +0 -18
- package/dist/healthybowl/utils/icsInspection.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/fast-equals/dist/es/index.mjs"],"sourcesContent":["const { getOwnPropertyNames, getOwnPropertySymbols } = Object;\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst { hasOwnProperty } = Object.prototype;\n/**\n * Combine two comparators into a single comparators.\n */\nfunction combineComparators(comparatorA, comparatorB) {\n return function isEqual(a, b, state) {\n return comparatorA(a, b, state) && comparatorB(a, b, state);\n };\n}\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular state, allowing\n * for circular references to be safely included in the comparison without creating\n * stack overflows.\n */\nfunction createIsCircular(areItemsEqual) {\n return function isCircular(a, b, state) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, state);\n }\n const { cache } = state;\n const cachedA = cache.get(a);\n const cachedB = cache.get(b);\n if (cachedA && cachedB) {\n return cachedA === b && cachedB === a;\n }\n cache.set(a, b);\n cache.set(b, a);\n const result = areItemsEqual(a, b, state);\n cache.delete(a);\n cache.delete(b);\n return result;\n };\n}\n/**\n * Get the `@@toStringTag` of the value, if it exists.\n */\nfunction getShortTag(value) {\n return value != null ? value[Symbol.toStringTag] : undefined;\n}\n/**\n * Get the properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nfunction getStrictProperties(object) {\n return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));\n}\n/**\n * Whether the object contains the property passed as an own property.\n */\nconst hasOwn = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nObject.hasOwn || ((object, property) => hasOwnProperty.call(object, property));\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nfunction sameValueZeroEqual(a, b) {\n return a === b || (!a && !b && a !== a && b !== b);\n}\n\nconst PREACT_VNODE = '__v';\nconst PREACT_OWNER = '__o';\nconst REACT_OWNER = '_owner';\nconst { getOwnPropertyDescriptor, keys } = Object;\n/**\n * Whether the array buffers are equal in value.\n */\nfunction areArrayBuffersEqual(a, b) {\n return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));\n}\n/**\n * Whether the arrays are equal in value.\n */\nfunction areArraysEqual(a, b, state) {\n let index = a.length;\n if (b.length !== index) {\n return false;\n }\n while (index-- > 0) {\n if (!state.equals(a[index], b[index], index, index, a, b, state)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the dataviews are equal in value.\n */\nfunction areDataViewsEqual(a, b) {\n return (a.byteLength === b.byteLength\n && areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)));\n}\n/**\n * Whether the dates passed are equal in value.\n */\nfunction areDatesEqual(a, b) {\n return sameValueZeroEqual(a.getTime(), b.getTime());\n}\n/**\n * Whether the errors passed are equal in value.\n */\nfunction areErrorsEqual(a, b) {\n return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;\n}\n/**\n * Whether the functions passed are equal in value.\n */\nfunction areFunctionsEqual(a, b) {\n return a === b;\n}\n/**\n * Whether the `Map`s are equal in value.\n */\nfunction areMapsEqual(a, b, state) {\n const size = a.size;\n if (size !== b.size) {\n return false;\n }\n if (!size) {\n return true;\n }\n const matchedIndices = new Array(size);\n const aIterable = a.entries();\n let aResult;\n let bResult;\n let index = 0;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n const bIterable = b.entries();\n let hasMatch = false;\n let matchIndex = 0;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n if (matchedIndices[matchIndex]) {\n matchIndex++;\n continue;\n }\n const aEntry = aResult.value;\n const bEntry = bResult.value;\n if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)\n && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n matchIndex++;\n }\n if (!hasMatch) {\n return false;\n }\n index++;\n }\n return true;\n}\n/**\n * Whether the numbers are equal in value.\n */\nconst areNumbersEqual = sameValueZeroEqual;\n/**\n * Whether the objects are equal in value.\n */\nfunction areObjectsEqual(a, b, state) {\n const properties = keys(a);\n let index = properties.length;\n if (keys(b).length !== index) {\n return false;\n }\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n if (!isPropertyEqual(a, b, state, properties[index])) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the objects are equal in value with strict property checking.\n */\nfunction areObjectsEqualStrict(a, b, state) {\n const properties = getStrictProperties(a);\n let index = properties.length;\n if (getStrictProperties(b).length !== index) {\n return false;\n }\n let property;\n let descriptorA;\n let descriptorB;\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index];\n if (!isPropertyEqual(a, b, state, property)) {\n return false;\n }\n descriptorA = getOwnPropertyDescriptor(a, property);\n descriptorB = getOwnPropertyDescriptor(b, property);\n if ((descriptorA || descriptorB)\n && (!descriptorA\n || !descriptorB\n || descriptorA.configurable !== descriptorB.configurable\n || descriptorA.enumerable !== descriptorB.enumerable\n || descriptorA.writable !== descriptorB.writable)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the primitive wrappers passed are equal in value.\n */\nfunction arePrimitiveWrappersEqual(a, b) {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n/**\n * Whether the regexps passed are equal in value.\n */\nfunction areRegExpsEqual(a, b) {\n return a.source === b.source && a.flags === b.flags;\n}\n/**\n * Whether the `Set`s are equal in value.\n */\nfunction areSetsEqual(a, b, state) {\n const size = a.size;\n if (size !== b.size) {\n return false;\n }\n if (!size) {\n return true;\n }\n const matchedIndices = new Array(size);\n const aIterable = a.values();\n let aResult;\n let bResult;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n const bIterable = b.values();\n let hasMatch = false;\n let matchIndex = 0;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n if (!matchedIndices[matchIndex]\n && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n matchIndex++;\n }\n if (!hasMatch) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the TypedArray instances are equal in value.\n */\nfunction areTypedArraysEqual(a, b) {\n let index = a.byteLength;\n if (b.byteLength !== index || a.byteOffset !== b.byteOffset) {\n return false;\n }\n while (index-- > 0) {\n if (a[index] !== b[index]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the URL instances are equal in value.\n */\nfunction areUrlsEqual(a, b) {\n return (a.hostname === b.hostname\n && a.pathname === b.pathname\n && a.protocol === b.protocol\n && a.port === b.port\n && a.hash === b.hash\n && a.username === b.username\n && a.password === b.password);\n}\nfunction isPropertyEqual(a, b, state, property) {\n if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)\n && (a.$$typeof || b.$$typeof)) {\n return true;\n }\n return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);\n}\n\nconst ARRAY_BUFFER_TAG = '[object ArrayBuffer]';\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATA_VIEW_TAG = '[object DataView]';\nconst DATE_TAG = '[object Date]';\nconst ERROR_TAG = '[object Error]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\nconst TYPED_ARRAY_TAGS = {\n '[object Int8Array]': true,\n '[object Uint8Array]': true,\n '[object Uint8ClampedArray]': true,\n '[object Int16Array]': true,\n '[object Uint16Array]': true,\n '[object Int32Array]': true,\n '[object Uint32Array]': true,\n '[object Float16Array]': true,\n '[object Float32Array]': true,\n '[object Float64Array]': true,\n '[object BigInt64Array]': true,\n '[object BigUint64Array]': true,\n};\nconst URL_TAG = '[object URL]';\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst toString = Object.prototype.toString;\n/**\n * Create a comparator method based on the type-specific equality comparators passed.\n */\nfunction createEqualityComparator({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }) {\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n return function comparator(a, b, state) {\n // If the items are strictly equal, no need to do a value comparison.\n if (a === b) {\n return true;\n }\n // If either of the items are nullish and fail the strictly equal check\n // above, then they must be unequal.\n if (a == null || b == null) {\n return false;\n }\n const type = typeof a;\n if (type !== typeof b) {\n return false;\n }\n if (type !== 'object') {\n if (type === 'number') {\n return areNumbersEqual(a, b, state);\n }\n if (type === 'function') {\n return areFunctionsEqual(a, b, state);\n }\n // If a primitive value that is not strictly equal, it must be unequal.\n return false;\n }\n const constructor = a.constructor;\n // Checks are listed in order of commonality of use-case:\n // 1. Common complex object types (plain object, array)\n // 2. Common data values (date, regexp)\n // 3. Less-common complex object types (map, set)\n // 4. Less-common data values (promise, primitive wrappers)\n // Inherently this is both subjective and assumptive, however\n // when reviewing comparable libraries in the wild this order\n // appears to be generally consistent.\n // Constructors should match, otherwise there is potential for false positives\n // between class and subclass or custom object and POJO.\n if (constructor !== b.constructor) {\n return false;\n }\n // `isPlainObject` only checks against the object's own realm. Cross-realm\n // comparisons are rare, and will be handled in the ultimate fallback, so\n // we can avoid capturing the string tag.\n if (constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing\n // the string tag or doing an `instanceof` check.\n if (Array.isArray(a)) {\n return areArraysEqual(a, b, state);\n }\n // Try to fast-path equality checks for other complex object types in the\n // same realm to avoid capturing the string tag. Strict equality is used\n // instead of `instanceof` because it is more performant for the common\n // use-case. If someone is subclassing a native class, it will be handled\n // with the string tag comparison.\n if (constructor === Date) {\n return areDatesEqual(a, b, state);\n }\n if (constructor === RegExp) {\n return areRegExpsEqual(a, b, state);\n }\n if (constructor === Map) {\n return areMapsEqual(a, b, state);\n }\n if (constructor === Set) {\n return areSetsEqual(a, b, state);\n }\n // Since this is a custom object, capture the string tag to determing its type.\n // This is reasonably performant in modern environments like v8 and SpiderMonkey.\n const tag = toString.call(a);\n if (tag === DATE_TAG) {\n return areDatesEqual(a, b, state);\n }\n // For RegExp, the properties are not enumerable, and therefore will give false positives if\n // tested like a standard object.\n if (tag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, state);\n }\n if (tag === MAP_TAG) {\n return areMapsEqual(a, b, state);\n }\n if (tag === SET_TAG) {\n return areSetsEqual(a, b, state);\n }\n if (tag === OBJECT_TAG) {\n // The exception for value comparison is custom `Promise`-like class instances. These should\n // be treated the same as standard `Promise` objects, which means strict equality, and if\n // it reaches this point then that strict equality comparison has already failed.\n return typeof a.then !== 'function' && typeof b.then !== 'function' && areObjectsEqual(a, b, state);\n }\n // If a URL tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === URL_TAG) {\n return areUrlsEqual(a, b, state);\n }\n // If an error tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === ERROR_TAG) {\n return areErrorsEqual(a, b, state);\n }\n // If an arguments tag, it should be treated as a standard object.\n if (tag === ARGUMENTS_TAG) {\n return areObjectsEqual(a, b, state);\n }\n if (TYPED_ARRAY_TAGS[tag]) {\n return areTypedArraysEqual(a, b, state);\n }\n if (tag === ARRAY_BUFFER_TAG) {\n return areArrayBuffersEqual(a, b, state);\n }\n if (tag === DATA_VIEW_TAG) {\n return areDataViewsEqual(a, b, state);\n }\n // As the penultimate fallback, check if the values passed are primitive wrappers. This\n // is very rare in modern JS, which is why it is deprioritized compared to all other object\n // types.\n if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {\n return arePrimitiveWrappersEqual(a, b, state);\n }\n if (unknownTagComparators) {\n let unknownTagComparator = unknownTagComparators[tag];\n if (!unknownTagComparator) {\n const shortTag = getShortTag(a);\n if (shortTag) {\n unknownTagComparator = unknownTagComparators[shortTag];\n }\n }\n // If the custom config has an unknown tag comparator that matches the captured tag or the\n // @@toStringTag, it is the source of truth for whether the values are equal.\n if (unknownTagComparator) {\n return unknownTagComparator(a, b, state);\n }\n }\n // If not matching any tags that require a specific type of comparison, then we hard-code false because\n // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:\n // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only\n // comparison that can be made.\n // - For types that can be introspected, but rarely have requirements to be compared\n // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common\n // use-cases (may be included in a future release, if requested enough).\n // - For types that can be introspected but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return false;\n };\n}\n/**\n * Create the configuration object used for building comparators.\n */\nfunction createEqualityComparatorConfig({ circular, createCustomConfig, strict, }) {\n let config = {\n areArrayBuffersEqual,\n areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,\n areDataViewsEqual,\n areDatesEqual: areDatesEqual,\n areErrorsEqual: areErrorsEqual,\n areFunctionsEqual: areFunctionsEqual,\n areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,\n areNumbersEqual: areNumbersEqual,\n areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,\n areRegExpsEqual: areRegExpsEqual,\n areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,\n areTypedArraysEqual: strict\n ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict)\n : areTypedArraysEqual,\n areUrlsEqual: areUrlsEqual,\n unknownTagComparators: undefined,\n };\n if (createCustomConfig) {\n config = Object.assign({}, config, createCustomConfig(config));\n }\n if (circular) {\n const areArraysEqual = createIsCircular(config.areArraysEqual);\n const areMapsEqual = createIsCircular(config.areMapsEqual);\n const areObjectsEqual = createIsCircular(config.areObjectsEqual);\n const areSetsEqual = createIsCircular(config.areSetsEqual);\n config = Object.assign({}, config, {\n areArraysEqual,\n areMapsEqual,\n areObjectsEqual,\n areSetsEqual,\n });\n }\n return config;\n}\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nfunction createInternalEqualityComparator(compare) {\n return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {\n return compare(a, b, state);\n };\n}\n/**\n * Create the `isEqual` function used by the consuming application.\n */\nfunction createIsEqual({ circular, comparator, createState, equals, strict }) {\n if (createState) {\n return function isEqual(a, b) {\n const { cache = circular ? new WeakMap() : undefined, meta } = createState();\n return comparator(a, b, {\n cache,\n equals,\n meta,\n strict,\n });\n };\n }\n if (circular) {\n return function isEqual(a, b) {\n return comparator(a, b, {\n cache: new WeakMap(),\n equals,\n meta: undefined,\n strict,\n });\n };\n }\n const state = {\n cache: undefined,\n equals,\n meta: undefined,\n strict,\n };\n return function isEqual(a, b) {\n return comparator(a, b, state);\n };\n}\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nconst deepEqual = createCustomEqual();\n/**\n * Whether the items passed are deeply-equal in value based on strict comparison.\n */\nconst strictDeepEqual = createCustomEqual({ strict: true });\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nconst circularDeepEqual = createCustomEqual({ circular: true });\n/**\n * Whether the items passed are deeply-equal in value, including circular references,\n * based on strict comparison.\n */\nconst strictCircularDeepEqual = createCustomEqual({\n circular: true,\n strict: true,\n});\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nconst shallowEqual = createCustomEqual({\n createInternalComparator: () => sameValueZeroEqual,\n});\n/**\n * Whether the items passed are shallowly-equal in value based on strict comparison\n */\nconst strictShallowEqual = createCustomEqual({\n strict: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nconst circularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n/**\n * Whether the items passed are shallowly-equal in value, including circular references,\n * based on strict comparison.\n */\nconst strictCircularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n strict: true,\n});\n/**\n * Create a custom equality comparison method.\n *\n * This can be done to create very targeted comparisons in extreme hot-path scenarios\n * where the standard methods are not performant enough, but can also be used to provide\n * support for legacy environments that do not support expected features like\n * `RegExp.prototype.flags` out of the box.\n */\nfunction createCustomEqual(options = {}) {\n const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false, } = options;\n const config = createEqualityComparatorConfig(options);\n const comparator = createEqualityComparator(config);\n const equals = createCustomInternalComparator\n ? createCustomInternalComparator(comparator)\n : createInternalEqualityComparator(comparator);\n return createIsEqual({ circular, comparator, createState, equals, strict });\n}\n\nexport { circularDeepEqual, circularShallowEqual, createCustomEqual, deepEqual, sameValueZeroEqual, shallowEqual, strictCircularDeepEqual, strictCircularShallowEqual, strictDeepEqual, strictShallowEqual };\n//# sourceMappingURL=index.mjs.map\n"],"x_google_ignoreList":[0],"mappings":";AAAA,IAAM,EAAE,wBAAqB,6BAA0B,QAEjD,EAAE,sBAAmB,OAAO;AAIlC,SAAS,EAAmB,GAAa,GAAa;CAClD,OAAO,SAAiB,GAAG,GAAG,GAAO;EACjC,OAAO,EAAY,GAAG,GAAG,CAAK,KAAK,EAAY,GAAG,GAAG,CAAK;CAC9D;AACJ;AAMA,SAAS,EAAiB,GAAe;CACrC,OAAO,SAAoB,GAAG,GAAG,GAAO;EACpC,IAAI,CAAC,KAAK,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
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/fast-equals/dist/es/index.mjs"],"sourcesContent":["const { getOwnPropertyNames, getOwnPropertySymbols } = Object;\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst { hasOwnProperty } = Object.prototype;\n/**\n * Combine two comparators into a single comparators.\n */\nfunction combineComparators(comparatorA, comparatorB) {\n return function isEqual(a, b, state) {\n return comparatorA(a, b, state) && comparatorB(a, b, state);\n };\n}\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular state, allowing\n * for circular references to be safely included in the comparison without creating\n * stack overflows.\n */\nfunction createIsCircular(areItemsEqual) {\n return function isCircular(a, b, state) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, state);\n }\n const { cache } = state;\n const cachedA = cache.get(a);\n const cachedB = cache.get(b);\n if (cachedA && cachedB) {\n return cachedA === b && cachedB === a;\n }\n cache.set(a, b);\n cache.set(b, a);\n const result = areItemsEqual(a, b, state);\n cache.delete(a);\n cache.delete(b);\n return result;\n };\n}\n/**\n * Get the `@@toStringTag` of the value, if it exists.\n */\nfunction getShortTag(value) {\n return value != null ? value[Symbol.toStringTag] : undefined;\n}\n/**\n * Get the properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nfunction getStrictProperties(object) {\n return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));\n}\n/**\n * Whether the object contains the property passed as an own property.\n */\nconst hasOwn = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nObject.hasOwn || ((object, property) => hasOwnProperty.call(object, property));\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nfunction sameValueZeroEqual(a, b) {\n return a === b || (!a && !b && a !== a && b !== b);\n}\n\nconst PREACT_VNODE = '__v';\nconst PREACT_OWNER = '__o';\nconst REACT_OWNER = '_owner';\n// `Float16Array` is recent enough that it cannot be referenced unguarded, and capturing its\n// availability once keeps that detail out of the comparison itself.\nconst HAS_FLOAT_16_ARRAY = typeof Float16Array !== 'undefined';\nconst { getOwnPropertyDescriptor, keys } = Object;\n/**\n * Whether the array buffers are equal in value.\n */\nfunction areArrayBuffersEqual(a, b) {\n return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));\n}\n/**\n * Whether the arrays are equal in value.\n */\nfunction areArraysEqual(a, b, state) {\n let index = a.length;\n if (b.length !== index) {\n return false;\n }\n while (index-- > 0) {\n if (!state.equals(a[index], b[index], index, index, a, b, state)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the dataviews are equal in value.\n */\nfunction areDataViewsEqual(a, b) {\n return (a.byteLength === b.byteLength\n && areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)));\n}\n/**\n * Whether the dates passed are equal in value.\n */\nfunction areDatesEqual(a, b) {\n return sameValueZeroEqual(a.getTime(), b.getTime());\n}\n/**\n * Whether the errors passed are equal in value.\n */\nfunction areErrorsEqual(a, b, state) {\n return (a.name === b.name\n && a.message === b.message\n && a.stack === b.stack\n && state.equals(a.cause, b.cause, 'cause', 'cause', a, b, state));\n}\n/**\n * Whether the functions passed are equal in value.\n */\nfunction areFunctionsEqual(a, b) {\n return a === b;\n}\n/**\n * Whether the `Map`s are equal in value.\n */\nfunction areMapsEqual(a, b, state) {\n const size = a.size;\n if (size !== b.size) {\n return false;\n }\n if (!size) {\n return true;\n }\n const matchedIndices = new Array(size);\n const aIterable = a.entries();\n let aResult;\n let bResult;\n let index = 0;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n const bIterable = b.entries();\n let hasMatch = false;\n let matchIndex = 0;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n if (matchedIndices[matchIndex]) {\n matchIndex++;\n continue;\n }\n const aEntry = aResult.value;\n const bEntry = bResult.value;\n if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)\n && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n matchIndex++;\n }\n if (!hasMatch) {\n return false;\n }\n index++;\n }\n return true;\n}\n/**\n * Whether the numbers are equal in value.\n */\nconst areNumbersEqual = sameValueZeroEqual;\n/**\n * Whether the objects are equal in value.\n */\nfunction areObjectsEqual(a, b, state) {\n const properties = keys(a);\n let index = properties.length;\n if (keys(b).length !== index) {\n return false;\n }\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n if (!isPropertyEqual(a, b, state, properties[index])) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the objects are equal in value with strict property checking.\n */\nfunction areObjectsEqualStrict(a, b, state) {\n const properties = getStrictProperties(a);\n let index = properties.length;\n if (getStrictProperties(b).length !== index) {\n return false;\n }\n let property;\n let descriptorA;\n let descriptorB;\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index];\n if (!isPropertyEqual(a, b, state, property)) {\n return false;\n }\n descriptorA = getOwnPropertyDescriptor(a, property);\n descriptorB = getOwnPropertyDescriptor(b, property);\n if ((descriptorA || descriptorB)\n && (!descriptorA\n || !descriptorB\n || descriptorA.configurable !== descriptorB.configurable\n || descriptorA.enumerable !== descriptorB.enumerable\n || descriptorA.writable !== descriptorB.writable)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the primitive wrappers passed are equal in value.\n */\nfunction arePrimitiveWrappersEqual(a, b) {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n/**\n * Whether the regexps passed are equal in value.\n */\nfunction areRegExpsEqual(a, b) {\n return a.source === b.source && a.flags === b.flags;\n}\n/**\n * Whether the `Set`s are equal in value.\n */\nfunction areSetsEqual(a, b, state) {\n const size = a.size;\n if (size !== b.size) {\n return false;\n }\n if (!size) {\n return true;\n }\n const matchedIndices = new Array(size);\n const aIterable = a.values();\n let aResult;\n let bResult;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n const bIterable = b.values();\n let hasMatch = false;\n let matchIndex = 0;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n if (!matchedIndices[matchIndex]\n && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n matchIndex++;\n }\n if (!hasMatch) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the TypedArray instances are equal in value.\n */\nfunction areTypedArraysEqual(a, b) {\n let index = a.length;\n if (b.length !== index || a.byteOffset !== b.byteOffset) {\n return false;\n }\n // Only float-backed views can hold `NaN`, and the additional check needed to treat it as equal\n // to itself measurably slows the loop, so integer views keep the plain comparison. This is\n // hoisted out of the loop so the cost is paid once per call rather than once per element.\n if (a instanceof Float64Array || a instanceof Float32Array || (HAS_FLOAT_16_ARRAY && a instanceof Float16Array)) {\n while (index-- > 0) {\n // `NaN` is the only value not equal to itself, and it is treated as equal here to match\n // the SameValueZero semantics used for every other numeric comparison in the library.\n if (a[index] !== b[index] && (a[index] === a[index] || b[index] === b[index])) {\n return false;\n }\n }\n return true;\n }\n while (index-- > 0) {\n if (a[index] !== b[index]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the URL instances are equal in value.\n */\nfunction areUrlsEqual(a, b) {\n // `href` is the normalized serialization of every component, so matching hrefs are equal without\n // any further work. Only a difference in query parameter ordering can survive a mismatch here.\n if (a.href === b.href) {\n return true;\n }\n return (a.protocol === b.protocol\n && a.username === b.username\n && a.password === b.password\n // `host` covers both the hostname and the port.\n && a.host === b.host\n && a.pathname === b.pathname\n && a.hash === b.hash\n && areSearchParamsEqual(a.searchParams, b.searchParams));\n}\n/**\n * Whether the search params passed are equal in value.\n *\n * @note\n * Order is not significant, matching how the other unordered collections in the library are\n * compared. Repeated keys are, so this is a comparison of multisets rather than of sets:\n * `a=1&a=2` is equal to `a=2&a=1`, but not to `a=1&a=1`.\n */\nfunction areSearchParamsEqual(a, b) {\n const serializedA = a.toString();\n const serializedB = b.toString();\n // Identical serializations are equal under any ordering, and this is by far the common case, so\n // it is worth checking before sorting anything.\n return serializedA === serializedB || sortSearchParams(serializedA) === sortSearchParams(serializedB);\n}\n/**\n * Reorder a serialized query string so that params holding the same pairs compare as equal\n * regardless of the order they appear in.\n *\n * @note\n * The serializer percent-encodes `&` and `=` wherever they appear inside a name or a value, so\n * splitting on `&` recovers exactly the pairs and nothing else.\n */\nfunction sortSearchParams(serialized) {\n return serialized.split('&').sort().join('&');\n}\nfunction isPropertyEqual(a, b, state, property) {\n if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)\n && (a.$$typeof || b.$$typeof)) {\n return true;\n }\n return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);\n}\n\nconst ARRAY_BUFFER_TAG = '[object ArrayBuffer]';\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATA_VIEW_TAG = '[object DataView]';\nconst DATE_TAG = '[object Date]';\nconst ERROR_TAG = '[object Error]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\nconst TYPED_ARRAY_TAGS = {\n '[object Int8Array]': true,\n '[object Uint8Array]': true,\n '[object Uint8ClampedArray]': true,\n '[object Int16Array]': true,\n '[object Uint16Array]': true,\n '[object Int32Array]': true,\n '[object Uint32Array]': true,\n '[object Float16Array]': true,\n '[object Float32Array]': true,\n '[object Float64Array]': true,\n '[object BigInt64Array]': true,\n '[object BigUint64Array]': true,\n};\nconst URL_TAG = '[object URL]';\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst toString = Object.prototype.toString;\n/**\n * Create a comparator method based on the type-specific equality comparators passed.\n */\nfunction createEqualityComparator({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }) {\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n return function comparator(a, b, state) {\n // If the items are strictly equal, no need to do a value comparison.\n if (a === b) {\n return true;\n }\n // If either of the items are nullish and fail the strictly equal check\n // above, then they must be unequal.\n if (a == null || b == null) {\n return false;\n }\n const type = typeof a;\n if (type !== typeof b) {\n return false;\n }\n if (type !== 'object') {\n if (type === 'number') {\n return areNumbersEqual(a, b, state);\n }\n if (type === 'function') {\n return areFunctionsEqual(a, b, state);\n }\n // If a primitive value that is not strictly equal, it must be unequal.\n return false;\n }\n const constructor = a.constructor;\n // Checks are listed in order of commonality of use-case:\n // 1. Common complex object types (plain object, array)\n // 2. Common data values (date, regexp)\n // 3. Less-common complex object types (map, set)\n // 4. Less-common data values (promise, primitive wrappers)\n // Inherently this is both subjective and assumptive, however\n // when reviewing comparable libraries in the wild this order\n // appears to be generally consistent.\n // Constructors should match, otherwise there is potential for false positives\n // between class and subclass or custom object and POJO.\n if (constructor !== b.constructor) {\n return false;\n }\n // `isPlainObject` only checks against the object's own realm. Cross-realm\n // comparisons are rare, and will be handled in the ultimate fallback, so\n // we can avoid capturing the string tag.\n if (constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing\n // the string tag or doing an `instanceof` check.\n if (Array.isArray(a)) {\n return areArraysEqual(a, b, state);\n }\n // Try to fast-path equality checks for other complex object types in the\n // same realm to avoid capturing the string tag. Strict equality is used\n // instead of `instanceof` because it is more performant for the common\n // use-case. If someone is subclassing a native class, it will be handled\n // with the string tag comparison.\n if (constructor === Date) {\n return areDatesEqual(a, b, state);\n }\n if (constructor === RegExp) {\n return areRegExpsEqual(a, b, state);\n }\n if (constructor === Map) {\n return areMapsEqual(a, b, state);\n }\n if (constructor === Set) {\n return areSetsEqual(a, b, state);\n }\n // Since this is a custom object, capture the string tag to determing its type.\n // This is reasonably performant in modern environments like v8 and SpiderMonkey.\n const tag = toString.call(a);\n if (tag === DATE_TAG) {\n return areDatesEqual(a, b, state);\n }\n // For RegExp, the properties are not enumerable, and therefore will give false positives if\n // tested like a standard object.\n if (tag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, state);\n }\n if (tag === MAP_TAG) {\n return areMapsEqual(a, b, state);\n }\n if (tag === SET_TAG) {\n return areSetsEqual(a, b, state);\n }\n if (tag === OBJECT_TAG) {\n // The exception for value comparison is custom `Promise`-like class instances. These should\n // be treated the same as standard `Promise` objects, which means strict equality, and if\n // it reaches this point then that strict equality comparison has already failed.\n return typeof a.then !== 'function' && typeof b.then !== 'function' && areObjectsEqual(a, b, state);\n }\n // If a URL tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === URL_TAG) {\n return areUrlsEqual(a, b, state);\n }\n // If an error tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === ERROR_TAG) {\n return areErrorsEqual(a, b, state);\n }\n // If an arguments tag, it should be treated as a standard object.\n if (tag === ARGUMENTS_TAG) {\n return areObjectsEqual(a, b, state);\n }\n if (TYPED_ARRAY_TAGS[tag]) {\n return areTypedArraysEqual(a, b, state);\n }\n if (tag === ARRAY_BUFFER_TAG) {\n return areArrayBuffersEqual(a, b, state);\n }\n if (tag === DATA_VIEW_TAG) {\n return areDataViewsEqual(a, b, state);\n }\n // As the penultimate fallback, check if the values passed are primitive wrappers. This\n // is very rare in modern JS, which is why it is deprioritized compared to all other object\n // types.\n if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {\n return arePrimitiveWrappersEqual(a, b, state);\n }\n if (unknownTagComparators) {\n let unknownTagComparator = unknownTagComparators[tag];\n if (!unknownTagComparator) {\n const shortTag = getShortTag(a);\n if (shortTag) {\n unknownTagComparator = unknownTagComparators[shortTag];\n }\n }\n // If the custom config has an unknown tag comparator that matches the captured tag or the\n // @@toStringTag, it is the source of truth for whether the values are equal.\n if (unknownTagComparator) {\n return unknownTagComparator(a, b, state);\n }\n }\n // If not matching any tags that require a specific type of comparison, then we hard-code false because\n // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:\n // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only\n // comparison that can be made.\n // - For types that can be introspected, but rarely have requirements to be compared\n // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common\n // use-cases (may be included in a future release, if requested enough).\n // - For types that can be introspected but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return false;\n };\n}\n/**\n * Create the configuration object used for building comparators.\n */\nfunction createEqualityComparatorConfig({ circular, createCustomConfig, strict, }) {\n let config = {\n areArrayBuffersEqual,\n areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,\n areDataViewsEqual,\n areDatesEqual: areDatesEqual,\n // `Error` subclasses routinely carry their own enumerable properties (`status`, `code`, ...),\n // which the error comparator alone does not see, so it is composed with the object comparator.\n // `name` / `message` / `stack` are own but not enumerable, which is why errors need a\n // comparator of their own rather than being treated as plain objects in the first place.\n areErrorsEqual: strict\n ? combineComparators(areErrorsEqual, areObjectsEqualStrict)\n : combineComparators(areErrorsEqual, areObjectsEqual),\n areFunctionsEqual: areFunctionsEqual,\n areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,\n areNumbersEqual: areNumbersEqual,\n areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,\n areRegExpsEqual: areRegExpsEqual,\n areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,\n areTypedArraysEqual: strict\n ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict)\n : areTypedArraysEqual,\n areUrlsEqual: areUrlsEqual,\n unknownTagComparators: undefined,\n };\n if (createCustomConfig) {\n config = Object.assign({}, config, createCustomConfig(config));\n }\n if (circular) {\n const areArraysEqual = createIsCircular(config.areArraysEqual);\n // Errors are included because comparing `cause` and own properties by value means an error\n // that references itself would otherwise recurse without bound.\n const areErrorsEqual = createIsCircular(config.areErrorsEqual);\n const areMapsEqual = createIsCircular(config.areMapsEqual);\n const areObjectsEqual = createIsCircular(config.areObjectsEqual);\n const areSetsEqual = createIsCircular(config.areSetsEqual);\n config = Object.assign({}, config, {\n areArraysEqual,\n areErrorsEqual,\n areMapsEqual,\n areObjectsEqual,\n areSetsEqual,\n });\n }\n return config;\n}\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nfunction createInternalEqualityComparator(compare) {\n return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {\n return compare(a, b, state);\n };\n}\n/**\n * Create the `isEqual` function used by the consuming application.\n */\nfunction createIsEqual({ circular, comparator, createState, equals, strict }) {\n if (createState) {\n return function isEqual(a, b) {\n const { cache = circular ? new WeakMap() : undefined, meta } = createState();\n return comparator(a, b, {\n cache,\n equals,\n meta,\n strict,\n });\n };\n }\n if (circular) {\n return function isEqual(a, b) {\n return comparator(a, b, {\n cache: new WeakMap(),\n equals,\n meta: undefined,\n strict,\n });\n };\n }\n const state = {\n cache: undefined,\n equals,\n meta: undefined,\n strict,\n };\n return function isEqual(a, b) {\n return comparator(a, b, state);\n };\n}\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nconst deepEqual = createCustomEqual();\n/**\n * Whether the items passed are deeply-equal in value based on strict comparison.\n */\nconst strictDeepEqual = createCustomEqual({ strict: true });\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nconst circularDeepEqual = createCustomEqual({ circular: true });\n/**\n * Whether the items passed are deeply-equal in value, including circular references,\n * based on strict comparison.\n */\nconst strictCircularDeepEqual = createCustomEqual({\n circular: true,\n strict: true,\n});\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nconst shallowEqual = createCustomEqual({\n createInternalComparator: () => sameValueZeroEqual,\n});\n/**\n * Whether the items passed are shallowly-equal in value based on strict comparison\n */\nconst strictShallowEqual = createCustomEqual({\n strict: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nconst circularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n/**\n * Whether the items passed are shallowly-equal in value, including circular references,\n * based on strict comparison.\n */\nconst strictCircularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n strict: true,\n});\n/**\n * Create a custom equality comparison method.\n *\n * This can be done to create very targeted comparisons in extreme hot-path scenarios\n * where the standard methods are not performant enough, but can also be used to provide\n * support for legacy environments that do not support expected features like\n * `RegExp.prototype.flags` out of the box.\n */\nfunction createCustomEqual(options = {}) {\n const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false, } = options;\n const config = createEqualityComparatorConfig(options);\n const comparator = createEqualityComparator(config);\n const equals = createCustomInternalComparator\n ? createCustomInternalComparator(comparator)\n : createInternalEqualityComparator(comparator);\n return createIsEqual({ circular, comparator, createState, equals, strict });\n}\n\nexport { circularDeepEqual, circularShallowEqual, createCustomEqual, deepEqual, sameValueZeroEqual, shallowEqual, strictCircularDeepEqual, strictCircularShallowEqual,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AAI,KAAA,GAAW,YAAS,EAAY;EAC3E,OAAO,EAAW,GAAG,GAAG;GACpB;GACA;GACA;GACA;EACJ,CAAC;CACL;CAEJ,IAAI,GACA,OAAO,SAAiB,GAAG,GAAG;EAC1B,OAAO,EAAW,GAAG,GAAG;GACpB,uBAAO,IAAI,QAAQ;GACnB;GACA,MAAM,KAAA;GACN;EACJ,CAAC;CACL;CAEJ,IAAM,IAAQ;EACV,OAAO,KAAA;EACP;EACA,MAAM,KAAA;EACN;CACJ;CACA,OAAO,SAAiB,GAAG,GAAG;EAC1B,OAAO,EAAW,GAAG,GAAG,CAAK;CACjC;AACJ;AAKA,IAAM,IAAY,EAAkB;AAIZ,EAAkB,EAAE,QAAQ,GAAK,CAAC,GAIhC,EAAkB,EAAE,UAAU,GAAK,CAAC,GAK9B,EAAkB;CAC9C,UAAU;CACV,QAAQ;AACZ,CAAC,GAIoB,EAAkB,EACnC,gCAAgC,EACpC,CAAC,GAI0B,EAAkB;CACzC,QAAQ;CACR,gCAAgC;AACpC,CAAC,GAI4B,EAAkB;CAC3C,UAAU;CACV,gCAAgC;AACpC,CAAC,GAKkC,EAAkB;CACjD,UAAU;CACV,gCAAgC;CAChC,QAAQ;AACZ,CAAC;AASD,SAAS,EAAkB,IAAU,CAAC,GAAG;CACrC,IAAM,EAAE,cAAW,IAAO,0BAA0B,GAAgC,gBAAa,YAAS,OAAW,GAE/G,IAAa,EADJ,EAA+B,CACG,CAAC;CAIlD,OAAO,EAAc;EAAE;EAAU;EAAY;EAAa,QAH3C,IACT,EAA+B,CAAU,IACzC,EAAiC,CAAU;EACiB;CAAO,CAAC;AAC9E"}
|
|
@@ -1,79 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createAssistantSandbox as t, createAssistantSession as n, extendAssistantSandboxTTL as r, findExistingSandbox as i, getAssistantArtifacts as a, getAssistantMessages as o, getAssistantSession as s, sendAssistantPromptAsync as c, sendHeartbeat as l, waitForAssistantServiceReady as u, waitForSandboxRunning as d } from "@burdenoff/fe-libs/shared/assistant";
|
|
1
|
+
import { createAssistantSandbox as e, createAssistantSession as t, extendAssistantSandboxTTL as n, findExistingSandbox as r, getAssistantArtifacts as i, getAssistantMessages as a, getAssistantSession as o, sendAssistantPromptAsync as s, sendHeartbeat as c, waitForAssistantServiceReady as l, waitForSandboxRunning as u } from "@burdenoff/fe-libs/shared/assistant";
|
|
3
2
|
//#region src/services/assistantApi.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
3
|
+
var d = "healthybowl", f = 600;
|
|
4
|
+
function p() {
|
|
6
5
|
return !1;
|
|
7
6
|
}
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
return
|
|
7
|
+
var m = (e) => e ?? {};
|
|
8
|
+
function h(e, t, n, i) {
|
|
9
|
+
return r(t, n, p(), m(i));
|
|
11
10
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
11
|
+
function g(t, n, r, i) {
|
|
12
|
+
return e(d, n, r, p(), f, m(i));
|
|
14
13
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
14
|
+
function _(e, t, n, r, i = 3e5, a) {
|
|
15
|
+
return u(t, n, m(r), i);
|
|
17
16
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
17
|
+
function v(e, t, n, r, i = 9e4, a) {
|
|
18
|
+
return l(t, n, m(r), i);
|
|
20
19
|
}
|
|
21
|
-
function
|
|
22
|
-
return n
|
|
20
|
+
function y(e, n, r, i, a) {
|
|
21
|
+
return t(n, r, i, m(a));
|
|
23
22
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
23
|
+
function b(e, t, n, r, i) {
|
|
24
|
+
return o(t, n, r, m(i));
|
|
26
25
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
26
|
+
function x(e, t, n, r, i, a, o, c, l) {
|
|
27
|
+
return s(t, n, r, i, a, o, m(c), l?.length ? { parts: l } : void 0).then(() => void 0);
|
|
29
28
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
32
|
-
limit:
|
|
29
|
+
function S(e, t, n, r, i, o = 50, s) {
|
|
30
|
+
return a(t, n, r, m(i), {
|
|
31
|
+
limit: o,
|
|
33
32
|
sinceMs: s
|
|
34
33
|
});
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (!i || !a) {
|
|
39
|
-
console.warn("[assistant] skipping AI-credit charge — turn is missing messageId or model", {
|
|
40
|
-
sessionId: r,
|
|
41
|
-
hasMessageId: !!i,
|
|
42
|
-
hasModel: !!a
|
|
43
|
-
});
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
try {
|
|
47
|
-
await e({
|
|
48
|
-
gateway: "workspace",
|
|
49
|
-
query: w,
|
|
50
|
-
variables: { input: {
|
|
51
|
-
context: { workspaceId: n },
|
|
52
|
-
sessionId: r,
|
|
53
|
-
messageId: i,
|
|
54
|
-
model: a,
|
|
55
|
-
inputTokens: o.input,
|
|
56
|
-
outputTokens: o.output
|
|
57
|
-
} }
|
|
58
|
-
});
|
|
59
|
-
} catch (e) {
|
|
60
|
-
console.warn("[assistant] AI-credit charge failed (non-fatal)", {
|
|
61
|
-
sessionId: r,
|
|
62
|
-
messageId: i,
|
|
63
|
-
error: e instanceof Error ? e.message : String(e)
|
|
64
|
-
});
|
|
65
|
-
}
|
|
35
|
+
function C(e, t, n, r, i) {
|
|
36
|
+
return Promise.resolve();
|
|
66
37
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
38
|
+
function w(e, t, n, r, a) {
|
|
39
|
+
return i(t, n, r, m(a)).then((e) => e);
|
|
69
40
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
41
|
+
function T(e, t, n, r, i) {
|
|
42
|
+
return c(t, n, r, m(i));
|
|
72
43
|
}
|
|
73
|
-
function
|
|
74
|
-
return
|
|
44
|
+
function E(e, t, r, i = 600, a) {
|
|
45
|
+
return n(t, r, i, m(a));
|
|
75
46
|
}
|
|
76
47
|
//#endregion
|
|
77
|
-
export {
|
|
48
|
+
export { d as PRODUCT, g as createAssistantSandbox, y as createAssistantSession, E as extendAssistantSandboxTTL, h as findExistingSandbox, w as getAssistantArtifacts, S as getAssistantMessages, b as getAssistantSession, C as reportAssistantAiTokenUsage, x as sendAssistantPromptAsync, T as sendHeartbeat, v as waitForAssistantServiceReady, _ as waitForSandboxReady };
|
|
78
49
|
|
|
79
50
|
//# sourceMappingURL=assistantApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistantApi.js","names":[],"sources":["../../src/services/assistantApi.ts"],"sourcesContent":["/**\n * AI Assistant API — thin adapter over @burdenoff/fe-libs/shared/assistant.\n *\n * The legacy slide-in panel (AssistantChatArea / AssistantMessageItem /\n * useAssistantHeartbeat) calls these with the historical (apollo-first)\n * signatures. The real implementation now lives once in fe-libs; this file only\n * maps the old signatures onto it, retiring ~726 lines of duplicated logic. The\n * `apollo` argument is vestigial (the shared layer uses graphqlFetch) and is\n * ignored; the product id + prod-runtime + TTL the shared functions need are\n * supplied here.\n *\n * HealthyBowl-specific AI credits (BOFF-7126): the shared `checkAiCredits` /\n * `reportAiTokenUsage` mutations live in the VibeControls subgraph and hardcode\n * `vibecontrols.ai.credits` + `productId: 'vibecontrols'`, so delegating to them\n * would bill VibeControls for HealthyBowl chat. Both therefore stay off the shared\n * path — but they now differ from each other:\n *\n * · `reportAssistantAiTokenUsage` CHARGES, against HealthyBowl's own\n * `reportHealthyBowlAiTokenUsage` mutation. Until this landed the assistant\n * was the only genuinely uncapped model spend in the product, and that failure\n * mode has already cost ~11 days of silent fleet-wide outage (BOFF-6284, a\n * vendor account with no credits left).\n * · `checkAssistantAiCredits` REMAINS a no-op, deliberately. Credits price at\n * roughly one credit per input token while the Free tier is seeded at 500, so\n * one assistant turn is many times the whole monthly budget. Gating on that\n * today would block every turn after the first. Meter first; re-size the\n * limits against real usage; only then add a gate.\n *\n * Also HealthyBowl-specific: `sendAssistantPromptAsync` takes an optional\n * multimodal `parts` array (Workstream 4) and forwards it to the shared\n * transport, which carries it in the JSON-scalar proxy body alongside the\n * unchanged `prompt`.\n */\n\nimport {\n findExistingSandbox as sharedFindExisting,\n createAssistantSandbox as sharedCreate,\n waitForSandboxRunning as sharedWaitRunning,\n waitForAssistantServiceReady as sharedWaitService,\n createAssistantSession as sharedCreateSession,\n getAssistantSession as sharedGetSession,\n sendAssistantPromptAsync as sharedSendAsync,\n getAssistantMessages as sharedGetMessages,\n extendAssistantSandboxTTL as sharedExtendTtl,\n sendHeartbeat as sharedHeartbeat,\n getAssistantArtifacts as sharedGetArtifacts,\n downloadAssistantArtifact as sharedDownloadArtifact,\n} from '@burdenoff/fe-libs/shared/assistant';\nimport type {\n AssistantRawMessage as SharedRawMessage,\n AssistantSandboxAuthContext as SharedAuthContext,\n AssistantSessionInfo as SharedSessionInfo,\n DownloadedAssistantArtifact,\n} from '@burdenoff/fe-libs/shared/assistant';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\nimport type { AssistantArtifact as LocalAssistantArtifact, AssistantMode } from '@/types/assistant';\nimport type { AssistantPromptPart } from '@/utils/assistantAttachments';\nimport type { PageContext } from '@/utils/pageContext';\n\n// Re-export the shared types under the names the panel already imports.\nexport type AssistantRawMessage = SharedRawMessage;\nexport type AssistantSandboxAuthContext = SharedAuthContext;\nexport type AssistantSessionInfo = SharedSessionInfo;\n\n// Vestigial Apollo arg — accepted for signature compatibility, ignored.\ntype ApolloClientLike = unknown;\n\n/**\n * Which product this assistant belongs to.\n *\n * ★ Exported because it now answers TWO questions that must never disagree:\n * `AI_ASSISTANT_PRODUCT` for the sandbox (which docs corpus the agent reads) and\n * the translation namespace for the shared assistant UI (`healthybowl.assistant.*`).\n * Two separate literals would drift, and the i18n half would fail silently —\n * every string quietly falling back to English while the tests stayed green.\n */\nexport const PRODUCT = 'healthybowl';\n// Matches the original panel behavior: create at 600s, kept warm while open by\n// useAssistantHeartbeat's +600s extend.\nconst DEFAULT_TTL_SECONDS = 600;\n\n// Build-time env parity with the original `assistantApi.ts` image-tag selection\n// (VITE_APP_ENV === 'prod' → prod image tag). Drives getImageTagForMode.\nfunction isProdRuntime(): boolean {\n return import.meta.env.VITE_APP_ENV === 'prod';\n}\n\nconst ctx = (a?: SharedAuthContext): SharedAuthContext => a ?? {};\n\nexport function findExistingSandbox(\n _apollo: ApolloClientLike,\n workspaceId: string,\n mode: AssistantMode,\n authContext?: SharedAuthContext\n): Promise<string | null> {\n return sharedFindExisting(workspaceId, mode, isProdRuntime(), ctx(authContext));\n}\n\nexport function createAssistantSandbox(\n _apollo: ApolloClientLike,\n mode: AssistantMode,\n workspaceId: string,\n authContext?: SharedAuthContext\n): Promise<string> {\n return sharedCreate(PRODUCT, mode, workspaceId, isProdRuntime(), DEFAULT_TTL_SECONDS, ctx(authContext));\n}\n\nexport function waitForSandboxReady(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n authContext?: SharedAuthContext,\n maxWaitMs = 300_000,\n _onProgress?: (message: string) => void\n): Promise<void> {\n return sharedWaitRunning(sandboxId, workspaceId, ctx(authContext), maxWaitMs);\n}\n\nexport function waitForAssistantServiceReady(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n authContext?: SharedAuthContext,\n maxWaitMs = 90_000,\n _onProgress?: (message: string) => void\n): Promise<void> {\n return sharedWaitService(sandboxId, workspaceId, ctx(authContext), maxWaitMs);\n}\n\nexport function createAssistantSession(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n mode: AssistantMode,\n authContext?: SharedAuthContext\n): Promise<{ sessionId: string }> {\n return sharedCreateSession(sandboxId, workspaceId, mode, ctx(authContext));\n}\n\nexport function getAssistantSession(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n sessionId: string,\n authContext?: SharedAuthContext\n): Promise<SharedSessionInfo> {\n return sharedGetSession(sandboxId, workspaceId, sessionId, ctx(authContext));\n}\n\nexport function sendAssistantPromptAsync(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n sessionId: string,\n prompt: string,\n mode: AssistantMode,\n pageContext?: PageContext,\n authContext?: SharedAuthContext,\n /**\n * Optional multimodal turn (Workstream 4). `prompt` is still ALWAYS sent, so a\n * bridge that predates `parts` answers from the text exactly as before, and a\n * text-only turn produces a byte-identical body.\n *\n * The local `AssistantPromptPart` is a structural mirror of the fe-libs type\n * (kept local so the pure attachment utils need no transport import); passing\n * it here is what proves the two stay in step at compile time.\n */\n parts?: AssistantPromptPart[]\n): Promise<void> {\n return sharedSendAsync(\n sandboxId,\n workspaceId,\n sessionId,\n prompt,\n mode,\n pageContext as Record<string, unknown> | undefined,\n ctx(authContext),\n parts?.length ? { parts } : undefined\n ).then(() => undefined);\n}\n\n/**\n * Messages for a session.\n *\n * ★ `sinceMs` is a DELTA cursor: the agent returns only messages created at or\n * after it (`>=`, deliberately, so an in-progress reply whose parts are still\n * growing keeps coming back). Without it every poll re-downloaded all `limit`\n * messages plus the injected page context — up to twice a second, for the whole\n * length of a turn. `assistantPollSchedule.ts` names this as the fix.\n *\n * Pass it ONLY for polling within a turn. The pre-prompt call that establishes\n * the floor must stay a full fetch, or there is nothing to compute a floor from.\n *\n * Degrades on its own: the shared client drops `&since=` if the backend reports\n * the capability unsupported, and `0` is falsy on both sides — so a brand-new\n * session with no prior messages naturally asks for everything.\n */\nexport function getAssistantMessages(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n sessionId: string,\n authContext?: SharedAuthContext,\n limit = 50,\n sinceMs?: number\n): Promise<SharedRawMessage[]> {\n return sharedGetMessages(sandboxId, workspaceId, sessionId, ctx(authContext), { limit, sinceMs });\n}\n\n/**\n * Deliberate no-op for HealthyBowl (see file header): always report budget\n * available; never gate an HB chat on VibeControls' credit quota.\n */\nexport function checkAssistantAiCredits(\n _apollo: ApolloClientLike,\n _workspaceId: string,\n _authContext?: SharedAuthContext\n): Promise<boolean> {\n return Promise.resolve(true);\n}\n\nconst REPORT_HB_AI_TOKEN_USAGE = `mutation ReportHealthyBowlAiTokenUsage($input: ReportHealthyBowlAiTokenUsageInput!) {\n reportHealthyBowlAiTokenUsage(input: $input)\n}`;\n\n/**\n * Charge a completed assistant turn against `healthybowl.ai.credits` (BOFF-7126).\n *\n * Calls HealthyBowl's OWN mutation rather than the shared one: fe-libs' transport\n * hardcodes the VibeControls field names, which bill the wrong product.\n *\n * `messageId` and `model` are required by the server — the first is half the\n * idempotency hash (without it every turn in a conversation shares one hash and\n * only the first is ever charged), the second selects the per-token prices. Both\n * come from the same `info` block the token counts do. A turn missing either is\n * skipped rather than sent, because the server would reject it anyway.\n *\n * Best-effort by contract, matching the server: the farmer already has their\n * answer, so a metering failure must never surface. Resolves either way.\n */\nexport async function reportAssistantAiTokenUsage(\n _apollo: ApolloClientLike,\n workspaceId: string,\n sessionId: string,\n messageId: string | undefined,\n model: string | undefined,\n tokens: { input: number; output: number },\n _authContext?: SharedAuthContext\n): Promise<void> {\n if (!messageId || !model) {\n // Visible on purpose. This meter exists because assistant spend was invisible; a silently\n // skipped charge would recreate exactly that blind spot, one turn at a time.\n console.warn('[assistant] skipping AI-credit charge — turn is missing messageId or model', {\n sessionId,\n hasMessageId: Boolean(messageId),\n hasModel: Boolean(model),\n });\n return;\n }\n try {\n await graphqlFetch({\n gateway: 'workspace',\n query: REPORT_HB_AI_TOKEN_USAGE,\n variables: {\n input: {\n context: { workspaceId },\n sessionId,\n messageId,\n model,\n inputTokens: tokens.input,\n outputTokens: tokens.output,\n },\n },\n });\n } catch (error) {\n // Swallowed on purpose — see the contract above. The server-side charge is idempotent, so a\n // dropped report is a missing datapoint, never a double charge. Logged rather than silent:\n // a metering regression that produces no signal is indistinguishable from no usage.\n console.warn('[assistant] AI-credit charge failed (non-fatal)', {\n sessionId,\n messageId,\n error: error instanceof Error ? error.message : String(error),\n });\n }\n}\n\nexport function getAssistantArtifacts(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n sessionId: string,\n authContext?: SharedAuthContext\n): Promise<LocalAssistantArtifact[]> {\n // The shared surface widens `type` to `string`; at runtime the agent only ever\n // returns 'file' | 'directory', so the array is structurally the local type.\n return sharedGetArtifacts(sandboxId, workspaceId, sessionId, ctx(authContext)).then(\n (artifacts) => artifacts as unknown as LocalAssistantArtifact[]\n );\n}\n\nexport function downloadAssistantArtifact(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n sessionId: string,\n artifactPath: string,\n authContext?: SharedAuthContext\n): Promise<DownloadedAssistantArtifact> {\n return sharedDownloadArtifact(sandboxId, workspaceId, sessionId, artifactPath, ctx(authContext));\n}\n\nexport function sendHeartbeat(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n sessionId: string,\n authContext?: SharedAuthContext\n): Promise<void> {\n return sharedHeartbeat(sandboxId, workspaceId, sessionId, ctx(authContext));\n}\n\nexport function extendAssistantSandboxTTL(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n additionalSeconds = 600,\n authContext?: SharedAuthContext\n): Promise<void> {\n return sharedExtendTtl(sandboxId, workspaceId, additionalSeconds, ctx(authContext));\n}\n"],"mappings":";;;AA4EA,IAAa,IAAU,eAGjB,IAAsB;AAI5B,SAAS,IAAyB;CAChC,OAAO;AACT;AAEA,IAAM,KAAO,MAA6C,KAAK,CAAC;AAEhE,SAAgB,EACd,GACA,GACA,GACA,GACwB;CACxB,OAAO,EAAmB,GAAa,GAAM,EAAc,GAAG,EAAI,CAAW,CAAC;AAChF;AAEA,SAAgB,EACd,GACA,GACA,GACA,GACiB;CACjB,OAAO,EAAa,GAAS,GAAM,GAAa,EAAc,GAAG,GAAqB,EAAI,CAAW,CAAC;AACxG;AAEA,SAAgB,EACd,GACA,GACA,GACA,GACA,IAAY,KACZ,GACe;CACf,OAAO,EAAkB,GAAW,GAAa,EAAI,CAAW,GAAG,CAAS;AAC9E;AAEA,SAAgB,EACd,GACA,GACA,GACA,GACA,IAAY,KACZ,GACe;CACf,OAAO,EA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;AACF;AAaA,SAAgB,EACd,GACA,GACA,GACA,GACA,GACe;CACf,OAAO,EAAgB,GAAW,GAAa,GAAW,EAAI,CAAW,CAAC;AAC5E;AAEA,SAAgB,EACd,GACA,GACA,GACA,IAAoB,KACpB,GACe;CACf,OAAO,EAAgB,GAAW,GAAa,GAAmB,EAAI,CAAW,CAAC;AACpF"}
|
|
1
|
+
{"version":3,"file":"assistantApi.js","names":[],"sources":["../../src/services/assistantApi.ts"],"sourcesContent":["/**\n * AI Assistant API — thin adapter over @burdenoff/fe-libs/shared/assistant.\n *\n * The legacy slide-in panel (AssistantChatArea / AssistantMessageItem /\n * useAssistantHeartbeat) calls these with the historical (apollo-first)\n * signatures. The real implementation now lives once in fe-libs; this file only\n * maps the old signatures onto it, retiring ~726 lines of duplicated logic. The\n * `apollo` argument is vestigial (the shared layer uses graphqlFetch) and is\n * ignored; the product id + prod-runtime + TTL the shared functions need are\n * supplied here.\n *\n * HealthyBowl-specific: `checkAssistantAiCredits` / `reportAssistantAiTokenUsage`\n * remain **deliberate no-ops** — the wspace checkAiCredits / reportAiTokenUsage\n * mutations live in the VibeControls subgraph and bill the `vibecontrols`\n * product, so an HB chat must NOT gate on (or charge against) VibeControls'\n * credit quota. The coarse createSandbox `@usage(sandboxes-created)` limit still\n * applies downstream. These two functions therefore do NOT delegate to the\n * shared credit calls.\n *\n * Also HealthyBowl-specific: `sendAssistantPromptAsync` takes an optional\n * multimodal `parts` array (Workstream 4) and forwards it to the shared\n * transport, which carries it in the JSON-scalar proxy body alongside the\n * unchanged `prompt`.\n */\n\nimport {\n findExistingSandbox as sharedFindExisting,\n createAssistantSandbox as sharedCreate,\n waitForSandboxRunning as sharedWaitRunning,\n waitForAssistantServiceReady as sharedWaitService,\n createAssistantSession as sharedCreateSession,\n getAssistantSession as sharedGetSession,\n sendAssistantPromptAsync as sharedSendAsync,\n getAssistantMessages as sharedGetMessages,\n extendAssistantSandboxTTL as sharedExtendTtl,\n sendHeartbeat as sharedHeartbeat,\n getAssistantArtifacts as sharedGetArtifacts,\n downloadAssistantArtifact as sharedDownloadArtifact,\n} from '@burdenoff/fe-libs/shared/assistant';\nimport type {\n AssistantRawMessage as SharedRawMessage,\n AssistantSandboxAuthContext as SharedAuthContext,\n AssistantSessionInfo as SharedSessionInfo,\n DownloadedAssistantArtifact,\n} from '@burdenoff/fe-libs/shared/assistant';\nimport type { AssistantArtifact as LocalAssistantArtifact, AssistantMode } from '@/types/assistant';\nimport type { AssistantPromptPart } from '@/utils/assistantAttachments';\nimport type { PageContext } from '@/utils/pageContext';\n\n// Re-export the shared types under the names the panel already imports.\nexport type AssistantRawMessage = SharedRawMessage;\nexport type AssistantSandboxAuthContext = SharedAuthContext;\nexport type AssistantSessionInfo = SharedSessionInfo;\n\n// Vestigial Apollo arg — accepted for signature compatibility, ignored.\ntype ApolloClientLike = unknown;\n\n/**\n * Which product this assistant belongs to.\n *\n * ★ Exported because it now answers TWO questions that must never disagree:\n * `AI_ASSISTANT_PRODUCT` for the sandbox (which docs corpus the agent reads) and\n * the translation namespace for the shared assistant UI (`healthybowl.assistant.*`).\n * Two separate literals would drift, and the i18n half would fail silently —\n * every string quietly falling back to English while the tests stayed green.\n */\nexport const PRODUCT = 'healthybowl';\n// Matches the original panel behavior: create at 600s, kept warm while open by\n// useAssistantHeartbeat's +600s extend.\nconst DEFAULT_TTL_SECONDS = 600;\n\n// Build-time env parity with the original `assistantApi.ts` image-tag selection\n// (VITE_APP_ENV === 'prod' → prod image tag). Drives getImageTagForMode.\nfunction isProdRuntime(): boolean {\n return import.meta.env.VITE_APP_ENV === 'prod';\n}\n\nconst ctx = (a?: SharedAuthContext): SharedAuthContext => a ?? {};\n\nexport function findExistingSandbox(\n _apollo: ApolloClientLike,\n workspaceId: string,\n mode: AssistantMode,\n authContext?: SharedAuthContext\n): Promise<string | null> {\n return sharedFindExisting(workspaceId, mode, isProdRuntime(), ctx(authContext));\n}\n\nexport function createAssistantSandbox(\n _apollo: ApolloClientLike,\n mode: AssistantMode,\n workspaceId: string,\n authContext?: SharedAuthContext\n): Promise<string> {\n return sharedCreate(PRODUCT, mode, workspaceId, isProdRuntime(), DEFAULT_TTL_SECONDS, ctx(authContext));\n}\n\nexport function waitForSandboxReady(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n authContext?: SharedAuthContext,\n maxWaitMs = 300_000,\n _onProgress?: (message: string) => void\n): Promise<void> {\n return sharedWaitRunning(sandboxId, workspaceId, ctx(authContext), maxWaitMs);\n}\n\nexport function waitForAssistantServiceReady(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n authContext?: SharedAuthContext,\n maxWaitMs = 90_000,\n _onProgress?: (message: string) => void\n): Promise<void> {\n return sharedWaitService(sandboxId, workspaceId, ctx(authContext), maxWaitMs);\n}\n\nexport function createAssistantSession(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n mode: AssistantMode,\n authContext?: SharedAuthContext\n): Promise<{ sessionId: string }> {\n return sharedCreateSession(sandboxId, workspaceId, mode, ctx(authContext));\n}\n\nexport function getAssistantSession(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n sessionId: string,\n authContext?: SharedAuthContext\n): Promise<SharedSessionInfo> {\n return sharedGetSession(sandboxId, workspaceId, sessionId, ctx(authContext));\n}\n\nexport function sendAssistantPromptAsync(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n sessionId: string,\n prompt: string,\n mode: AssistantMode,\n pageContext?: PageContext,\n authContext?: SharedAuthContext,\n /**\n * Optional multimodal turn (Workstream 4). `prompt` is still ALWAYS sent, so a\n * bridge that predates `parts` answers from the text exactly as before, and a\n * text-only turn produces a byte-identical body.\n *\n * The local `AssistantPromptPart` is a structural mirror of the fe-libs type\n * (kept local so the pure attachment utils need no transport import); passing\n * it here is what proves the two stay in step at compile time.\n */\n parts?: AssistantPromptPart[]\n): Promise<void> {\n return sharedSendAsync(\n sandboxId,\n workspaceId,\n sessionId,\n prompt,\n mode,\n pageContext as Record<string, unknown> | undefined,\n ctx(authContext),\n parts?.length ? { parts } : undefined\n ).then(() => undefined);\n}\n\n/**\n * Messages for a session.\n *\n * ★ `sinceMs` is a DELTA cursor: the agent returns only messages created at or\n * after it (`>=`, deliberately, so an in-progress reply whose parts are still\n * growing keeps coming back). Without it every poll re-downloaded all `limit`\n * messages plus the injected page context — up to twice a second, for the whole\n * length of a turn. `assistantPollSchedule.ts` names this as the fix.\n *\n * Pass it ONLY for polling within a turn. The pre-prompt call that establishes\n * the floor must stay a full fetch, or there is nothing to compute a floor from.\n *\n * Degrades on its own: the shared client drops `&since=` if the backend reports\n * the capability unsupported, and `0` is falsy on both sides — so a brand-new\n * session with no prior messages naturally asks for everything.\n */\nexport function getAssistantMessages(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n sessionId: string,\n authContext?: SharedAuthContext,\n limit = 50,\n sinceMs?: number\n): Promise<SharedRawMessage[]> {\n return sharedGetMessages(sandboxId, workspaceId, sessionId, ctx(authContext), { limit, sinceMs });\n}\n\n/**\n * Deliberate no-op for HealthyBowl (see file header): always report budget\n * available; never gate an HB chat on VibeControls' credit quota.\n */\nexport function checkAssistantAiCredits(\n _apollo: ApolloClientLike,\n _workspaceId: string,\n _authContext?: SharedAuthContext\n): Promise<boolean> {\n return Promise.resolve(true);\n}\n\n/**\n * Deliberate no-op for HealthyBowl (see file header): per-token charging routes\n * to the VibeControls AI-credit quota, which HB does not bill against.\n */\nexport function reportAssistantAiTokenUsage(\n _apollo: ApolloClientLike,\n _workspaceId: string,\n _sessionId: string,\n _tokens: { input: number; output: number },\n _authContext?: SharedAuthContext\n): Promise<void> {\n return Promise.resolve();\n}\n\nexport function getAssistantArtifacts(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n sessionId: string,\n authContext?: SharedAuthContext\n): Promise<LocalAssistantArtifact[]> {\n // The shared surface widens `type` to `string`; at runtime the agent only ever\n // returns 'file' | 'directory', so the array is structurally the local type.\n return sharedGetArtifacts(sandboxId, workspaceId, sessionId, ctx(authContext)).then(\n (artifacts) => artifacts as unknown as LocalAssistantArtifact[]\n );\n}\n\nexport function downloadAssistantArtifact(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n sessionId: string,\n artifactPath: string,\n authContext?: SharedAuthContext\n): Promise<DownloadedAssistantArtifact> {\n return sharedDownloadArtifact(sandboxId, workspaceId, sessionId, artifactPath, ctx(authContext));\n}\n\nexport function sendHeartbeat(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n sessionId: string,\n authContext?: SharedAuthContext\n): Promise<void> {\n return sharedHeartbeat(sandboxId, workspaceId, sessionId, ctx(authContext));\n}\n\nexport function extendAssistantSandboxTTL(\n _apollo: ApolloClientLike,\n sandboxId: string,\n workspaceId: string,\n additionalSeconds = 600,\n authContext?: SharedAuthContext\n): Promise<void> {\n return sharedExtendTtl(sandboxId, workspaceId, additionalSeconds, ctx(authContext));\n}\n"],"mappings":";;AAkEA,IAAa,IAAU,eAGjB,IAAsB;AAI5B,SAAS,IAAyB;CAChC,OAAO;AACT;AAEA,IAAM,KAAO,MAA6C,KAAK,CAAC;AAEhE,SAAgB,EACd,GACA,GACA,GACA,GACwB;CACxB,OAAO,EAAmB,GAAa,GAAM,EAAc,GAAG,EAAI,CAAW,CAAC;AAChF;AAEA,SAAgB,EACd,GACA,GACA,GACA,GACiB;CACjB,OAAO,EAAa,GAAS,GAAM,GAAa,EAAc,GAAG,GAAqB,EAAI,CAAW,CAAC;AACxG;AAEA,SAAgB,EACd,GACA,GACA,GACA,GACA,IAAY,KACZ,GACe;CACf,OAAO,EAAkB,GAAW,GAAa,EAAI,CAAW,GAAG,CAAS;AAC9E;AAEA,SAAgB,EACd,GACA,GACA,GACA,GACA,IAAY,KACZ,GACe;CACf,OAAO,EAAkB,GAAW,GAAa,EAAI,CAAW,GAAG,CAAS;AAC9E;AAEA,SAAgB,EACd,GACA,GACA,GACA,GACA,GACgC;CAChC,OAAO,EAAoB,GAAW,GAAa,GAAM,EAAI,CAAW,CAAC;AAC3E;AAEA,SAAgB,EACd,GACA,GACA,GACA,GACA,GAC4B;CAC5B,OAAO,EAAiB,GAAW,GAAa,GAAW,EAAI,CAAW,CAAC;AAC7E;AAEA,SAAgB,EACd,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GAUA,GACe;CACf,OAAO,EACL,GACA,GACA,GACA,GACA,GACA,GACA,EAAI,CAAW,GACf,GAAO,SAAS,EAAE,SAAM,IAAI,KAAA,CAC9B,EAAE,WAAW,KAAA,CAAS;AACxB;AAkBA,SAAgB,EACd,GACA,GACA,GACA,GACA,GACA,IAAQ,IACR,GAC6B;CAC7B,OAAO,EAAkB,GAAW,GAAa,GAAW,EAAI,CAAW,GAAG;EAAE;EAAO;CAAQ,CAAC;AAClG;AAkBA,SAAgB,EACd,GACA,GACA,GACA,GACA,GACe;CACf,OAAO,QAAQ,QAAQ;AACzB;AAEA,SAAgB,EACd,GACA,GACA,GACA,GACA,GACmC;CAGnC,OAAO,EAAmB,GAAW,GAAa,GAAW,EAAI,CAAW,CAAC,EAAE,MAC5E,MAAc,CACjB;AACF;AAaA,SAAgB,EACd,GACA,GACA,GACA,GACA,GACe;CACf,OAAO,EAAgB,GAAW,GAAa,GAAW,EAAI,CAAW,CAAC;AAC5E;AAEA,SAAgB,EACd,GACA,GACA,GACA,IAAoB,KACpB,GACe;CACf,OAAO,EAAgB,GAAW,GAAa,GAAmB,EAAI,CAAW,CAAC;AACpF"}
|
|
@@ -4,24 +4,10 @@ var e = [
|
|
|
4
4
|
[/\/crops\/planning\/([^/]+)\/?$/, "HEALTHYBOWL_PLAN"],
|
|
5
5
|
[/\/crops\/harvest\/([^/]+)\/?$/, "HEALTHYBOWL_HARVEST"],
|
|
6
6
|
[/\/crops\/(?!fields\/?$|planning\/?$|harvest\/?$)([^/]+)\/?$/, "HEALTHYBOWL_CROP"],
|
|
7
|
-
[/\/satellite\/([^/]+)\/?$/, "HEALTHYBOWL_FIELD"],
|
|
8
|
-
[/\/garden\/plantings\/([^/]+)\/?$/, "HEALTHYBOWL_GARDEN_PLANTING"],
|
|
9
7
|
[/\/livestock\/animals\/([^/]+)\/?$/, "HEALTHYBOWL_ANIMAL"],
|
|
10
|
-
[/\/livestock\/records\/([^/]+)\/?$/, "HEALTHYBOWL_ANIMAL"],
|
|
11
|
-
[/\/compliance\/ics\/growers\/([^/]+)\/?$/, "HEALTHYBOWL_ICS_GROWER"],
|
|
12
|
-
[/\/compliance\/ics\/(?!growers\/?$)([^/]+)\/?$/, "HEALTHYBOWL_ICS_GROUP"],
|
|
13
|
-
[/\/compliance\/certifications\/([^/]+)\/?$/, "HEALTHYBOWL_CERTIFICATION"],
|
|
14
|
-
[/\/distribution\/csa\/([^/]+)\/?$/, "HEALTHYBOWL_CSA_PLAN"],
|
|
15
|
-
[/\/distribution\/routes\/([^/]+)\/?$/, "HEALTHYBOWL_DELIVERY_ROUTE"],
|
|
16
|
-
[/\/storage\/lots\/([^/]+)\/?$/, "HEALTHYBOWL_STORAGE_LOT"],
|
|
17
|
-
[/\/coop\/lots\/([^/]+)\/?$/, "HEALTHYBOWL_COOP_LOT"],
|
|
18
|
-
[/\/coop\/members\/([^/]+)\/?$/, "HEALTHYBOWL_COOP_MEMBERSHIP"],
|
|
19
8
|
[/\/marketplace\/(?!cart\/?$|wishlist\/?$|orders\/?$)([^/]+)\/?$/, "HEALTHYBOWL_MARKETPLACE_PRODUCT"],
|
|
20
|
-
[/\/inputs-insurance\/claims\/([^/]+)\/?$/, "HEALTHYBOWL_INSURANCE_CLAIM"],
|
|
21
9
|
[/\/government-schemes\/schemes\/([^/]+)\/?$/, "HEALTHYBOWL_SCHEME"],
|
|
22
|
-
[/\/
|
|
23
|
-
[/\/consultant\/clients\/([^/]+)\/?$/, "HEALTHYBOWL_CLIENT_WORKSPACE"],
|
|
24
|
-
[/\/field-capture\/conflicts\/([^/]+)\/?$/, "HEALTHYBOWL_CAPTURE_CONFLICT"]
|
|
10
|
+
[/\/consultant\/clients\/([^/]+)\/?$/, "HEALTHYBOWL_CLIENT_WORKSPACE"]
|
|
25
11
|
];
|
|
26
12
|
function t(t) {
|
|
27
13
|
for (let [n, r] of e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageContext.js","names":[],"sources":["../../src/utils/pageContext.ts"],"sourcesContent":["/**\n * Page context gathering — captures the user's current browser context to send\n * alongside every assistant prompt so the agent is aware of where the user is.\n *\n * Only keys the ai-assistant agent's context-loader allow-lists are emitted\n * (currentUrl / currentPage / entityType / entityId / …); anything else is\n * dropped server-side. entityType/entityId are resolved from the HealthyBowl\n * route by matching the pathname SUFFIX, because the MFE mounts under a\n * host-controlled base path (…/healthybowl/…) rather than a fixed prefix.\n */\n\nexport interface PageContext {\n currentUrl: string;\n currentPage: string;\n platform: string;\n entityType?: string;\n entityId?: string;\n viewportSize: string;\n version: string;\n timestamp: string;\n}\n\n// HealthyBowl detail routes → entityType. Matched on the pathname SUFFIX, so the\n// host base path / workspace segment is irrelevant. Order: most specific first.\n// The single-segment matchers (crops/:id, marketplace/:id) negative-lookahead\n// their STATIC sibling list-routes (crops/{fields,planning,harvest} and\n// marketplace/{cart,wishlist,orders} — see HealthyBowlRoutes.tsx) so a list page\n// like /crops/fields isn't mis-tagged as a crop with a fabricated entityId\n// \"fields\". Keep the exclusions in sync if new static sub-routes are added under\n// those parents
|
|
1
|
+
{"version":3,"file":"pageContext.js","names":[],"sources":["../../src/utils/pageContext.ts"],"sourcesContent":["/**\n * Page context gathering — captures the user's current browser context to send\n * alongside every assistant prompt so the agent is aware of where the user is.\n *\n * Only keys the ai-assistant agent's context-loader allow-lists are emitted\n * (currentUrl / currentPage / entityType / entityId / …); anything else is\n * dropped server-side. entityType/entityId are resolved from the HealthyBowl\n * route by matching the pathname SUFFIX, because the MFE mounts under a\n * host-controlled base path (…/healthybowl/…) rather than a fixed prefix.\n */\n\nexport interface PageContext {\n currentUrl: string;\n currentPage: string;\n platform: string;\n entityType?: string;\n entityId?: string;\n viewportSize: string;\n version: string;\n timestamp: string;\n}\n\n// HealthyBowl detail routes → entityType. Matched on the pathname SUFFIX, so the\n// host base path / workspace segment is irrelevant. Order: most specific first.\n// The single-segment matchers (crops/:id, marketplace/:id) negative-lookahead\n// their STATIC sibling list-routes (crops/{fields,planning,harvest} and\n// marketplace/{cart,wishlist,orders} — see HealthyBowlRoutes.tsx) so a list page\n// like /crops/fields isn't mis-tagged as a crop with a fabricated entityId\n// \"fields\". Keep the exclusions in sync if new static sub-routes are added under\n// those parents. (The 2-segment detail routes are unambiguous and need no guard.)\nconst HB_ENTITY_ROUTES: ReadonlyArray<readonly [RegExp, string]> = [\n [/\\/crops\\/fields\\/([^/]+)\\/?$/, 'HEALTHYBOWL_FIELD'],\n [/\\/crops\\/planning\\/([^/]+)\\/?$/, 'HEALTHYBOWL_PLAN'],\n [/\\/crops\\/harvest\\/([^/]+)\\/?$/, 'HEALTHYBOWL_HARVEST'],\n [/\\/crops\\/(?!fields\\/?$|planning\\/?$|harvest\\/?$)([^/]+)\\/?$/, 'HEALTHYBOWL_CROP'],\n [/\\/livestock\\/animals\\/([^/]+)\\/?$/, 'HEALTHYBOWL_ANIMAL'],\n [/\\/marketplace\\/(?!cart\\/?$|wishlist\\/?$|orders\\/?$)([^/]+)\\/?$/, 'HEALTHYBOWL_MARKETPLACE_PRODUCT'],\n [/\\/government-schemes\\/schemes\\/([^/]+)\\/?$/, 'HEALTHYBOWL_SCHEME'],\n [/\\/consultant\\/clients\\/([^/]+)\\/?$/, 'HEALTHYBOWL_CLIENT_WORKSPACE'],\n];\n\nexport function resolveHealthyBowlEntity(pathname: string): {\n entityType?: string;\n entityId?: string;\n} {\n for (const [pattern, entityType] of HB_ENTITY_ROUTES) {\n const match = pathname.match(pattern);\n if (match) return { entityType, entityId: match[1] };\n }\n return {};\n}\n\n// Friendly display labels for the top HealthyBowl sections. Anything not listed\n// falls back to a title-cased version of the first path segment.\nconst PAGE_LABELS: Readonly<Record<string, string>> = {\n home: 'Dashboard',\n crops: 'Crops',\n livestock: 'Livestock',\n marketplace: 'Marketplace',\n inventory: 'Inventory',\n weather: 'Weather',\n tasks: 'Farm Tasks',\n analytics: 'Analytics',\n consultant: 'Advisory',\n 'government-schemes': 'Government Schemes',\n 'market-prices': 'Market Prices',\n contracts: 'Contracts',\n};\n\n/**\n * A short, human-friendly label for the page the user is currently on — used by\n * the assistant header subtitle (\"Context: <page>\") and the empty state. Derived\n * from the same route parsing as `gatherPageContext`.\n */\nexport function describeCurrentPage(): string {\n const { currentPage } = gatherPageContext();\n const firstSegment = currentPage.split('/')[0] ?? '';\n if (!firstSegment || firstSegment === 'home') return PAGE_LABELS.home;\n return (\n PAGE_LABELS[firstSegment] ??\n firstSegment\n .split('-')\n .map((word) => (word ? word.charAt(0).toUpperCase() + word.slice(1) : word))\n .join(' ')\n );\n}\n\nexport function gatherPageContext(): PageContext {\n const pathname = window.location.pathname;\n const pathSegments = pathname.split('/').filter(Boolean);\n // Human-readable page label: the portion of the path after the `healthybowl`\n // mount segment, falling back to the trailing segments.\n const hbIndex = pathSegments.indexOf('healthybowl');\n const currentPage =\n (hbIndex >= 0 ? pathSegments.slice(hbIndex + 1, hbIndex + 4) : pathSegments.slice(-3)).join('/') || 'home';\n\n return {\n currentUrl: window.location.href,\n currentPage,\n platform: 'healthybowl',\n ...resolveHealthyBowlEntity(pathname),\n viewportSize: `${window.innerWidth}x${window.innerHeight}`,\n version: import.meta.env.VITE_APP_VERSION ?? '2026.627.1',\n timestamp: new Date().toISOString(),\n };\n}\n"],"mappings":";AA8BA,IAAM,IAA6D;CACjE,CAAC,gCAAgC,mBAAmB;CACpD,CAAC,kCAAkC,kBAAkB;CACrD,CAAC,iCAAiC,qBAAqB;CACvD,CAAC,+DAA+D,kBAAkB;CAClF,CAAC,qCAAqC,oBAAoB;CAC1D,CAAC,kEAAkE,iCAAiC;CACpG,CAAC,8CAA8C,oBAAoB;CACnE,CAAC,sCAAsC,8BAA8B;AACvE;AAEA,SAAgB,EAAyB,GAGvC;CACA,KAAK,IAAM,CAAC,GAAS,MAAe,GAAkB;EACpD,IAAM,IAAQ,EAAS,MAAM,CAAO;EACpC,IAAI,GAAO,OAAO;GAAE;GAAY,UAAU,EAAM;EAAG;CACrD;CACA,OAAO,CAAC;AACV;AAIA,IAAM,IAAgD;CACpD,MAAM;CACN,OAAO;CACP,WAAW;CACX,aAAa;CACb,WAAW;CACX,SAAS;CACT,OAAO;CACP,WAAW;CACX,YAAY;CACZ,sBAAsB;CACtB,iBAAiB;CACjB,WAAW;AACb;AAOA,SAAgB,IAA8B;CAC5C,IAAM,EAAE,mBAAgB,EAAkB,GACpC,IAAe,EAAY,MAAM,GAAG,EAAE,MAAM;CAElD,OADI,CAAC,KAAgB,MAAiB,SAAe,EAAY,OAE/D,EAAY,MACZ,EACG,MAAM,GAAG,EACT,KAAK,MAAU,KAAO,EAAK,OAAO,CAAC,EAAE,YAAY,IAAI,EAAK,MAAM,CAAC,CAAS,EAC1E,KAAK,GAAG;AAEf;AAEA,SAAgB,IAAiC;CAC/C,IAAM,IAAW,OAAO,SAAS,UAC3B,IAAe,EAAS,MAAM,GAAG,EAAE,OAAO,OAAO,GAGjD,IAAU,EAAa,QAAQ,aAAa,GAC5C,KACH,KAAW,IAAI,EAAa,MAAM,IAAU,GAAG,IAAU,CAAC,IAAI,EAAa,MAAM,EAAE,GAAG,KAAK,GAAG,KAAK;CAEtG,OAAO;EACL,YAAY,OAAO,SAAS;EAC5B;EACA,UAAU;EACV,GAAG,EAAyB,CAAQ;EACpC,cAAc,GAAG,OAAO,WAAW,GAAG,OAAO;EAC7C,SAA6C;EAC7C,4BAAW,IAAI,KAAK,GAAE,YAAY;CACpC;AACF"}
|
package/package.json
CHANGED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { useHealthyBowl as e } from "../context/HealthyBowlContext.js";
|
|
2
|
-
import { useCallback as t, useMemo as n } from "react";
|
|
3
|
-
import { gql as r } from "@apollo/client";
|
|
4
|
-
import { useMutation as i, useQuery as a } from "@apollo/client/react";
|
|
5
|
-
//#region src/healthybowl/hooks/useAgronomyDecisions.ts
|
|
6
|
-
var o = "\n id\n decisionType\n status\n source\n subjectId\n subjectType\n fieldId\n plantScanId\n title\n rationale\n confidence\n inputs\n railChecks {\n rail\n outcome\n detail\n }\n blockedReason\n recommendedMm\n modelProvider\n modelName\n decidedBy\n decidedAt\n createdAt\n updatedAt\n", s = r`
|
|
7
|
-
query GetHealthyBowlAgronomyDecisions(
|
|
8
|
-
$context: ContextInput!
|
|
9
|
-
$filter: AgronomyDecisionFilterInput
|
|
10
|
-
) {
|
|
11
|
-
getHealthyBowlAgronomyDecisions(context: $context, filter: $filter) {
|
|
12
|
-
${o}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
`, c = r`
|
|
16
|
-
mutation ProposeHealthyBowlAgronomyDecisions($input: ProposeAgronomyDecisionsInput!) {
|
|
17
|
-
proposeHealthyBowlAgronomyDecisions(input: $input) {
|
|
18
|
-
skipped
|
|
19
|
-
skippedReason
|
|
20
|
-
decisions {
|
|
21
|
-
${o}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
`, l = r`
|
|
26
|
-
mutation DecideHealthyBowlAgronomyDecision($input: DecideAgronomyDecisionInput!) {
|
|
27
|
-
decideHealthyBowlAgronomyDecision(input: $input) {
|
|
28
|
-
${o}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
|
-
function u() {
|
|
33
|
-
let { workspaceId: r } = e(), o = n(() => ({ workspaceId: r }), [r]), { data: u, loading: d, error: f, refetch: p } = a(s, {
|
|
34
|
-
variables: {
|
|
35
|
-
context: o,
|
|
36
|
-
filter: {}
|
|
37
|
-
},
|
|
38
|
-
skip: !r,
|
|
39
|
-
fetchPolicy: "cache-and-network"
|
|
40
|
-
}), [m, { loading: h }] = i(c), [g, { loading: _ }] = i(l), v = t(async (e) => {
|
|
41
|
-
let t = await m({ variables: { input: {
|
|
42
|
-
context: o,
|
|
43
|
-
decisionType: e
|
|
44
|
-
} } });
|
|
45
|
-
return await p(), t.data?.proposeHealthyBowlAgronomyDecisions ?? {
|
|
46
|
-
decisions: [],
|
|
47
|
-
skipped: 0,
|
|
48
|
-
skippedReason: null
|
|
49
|
-
};
|
|
50
|
-
}, [
|
|
51
|
-
m,
|
|
52
|
-
p,
|
|
53
|
-
o
|
|
54
|
-
]), y = t(async (e, t) => {
|
|
55
|
-
await g({ variables: { input: {
|
|
56
|
-
context: o,
|
|
57
|
-
id: e,
|
|
58
|
-
verdict: t
|
|
59
|
-
} } }), await p();
|
|
60
|
-
}, [
|
|
61
|
-
g,
|
|
62
|
-
p,
|
|
63
|
-
o
|
|
64
|
-
]);
|
|
65
|
-
return {
|
|
66
|
-
decisions: u?.getHealthyBowlAgronomyDecisions ?? [],
|
|
67
|
-
loading: d,
|
|
68
|
-
error: f,
|
|
69
|
-
refetch: p,
|
|
70
|
-
propose: v,
|
|
71
|
-
proposing: h,
|
|
72
|
-
decide: y,
|
|
73
|
-
deciding: _
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
//#endregion
|
|
77
|
-
export { u as useAgronomyDecisions };
|
|
78
|
-
|
|
79
|
-
//# sourceMappingURL=useAgronomyDecisions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAgronomyDecisions.js","names":[],"sources":["../../../src/healthybowl/hooks/useAgronomyDecisions.ts"],"sourcesContent":["/**\n * AI agronomic decision data hook (BOFF-3629 · HB-UC-18/19).\n *\n * Mirrors the raw-gql pattern used by `useDiseaseWarning` / `useIrrigationAutomation`: the\n * committed codegen snapshot predates the `agronomy-decision` subgraph, so these are hand-written\n * `gql` documents executed against the live gateway. Every op carries the workspace `context`.\n *\n * The backend ignores the workspace inside `context` and scopes on the `x-workspace-id` header —\n * it is threaded through anyway because the argument is non-null in the schema and every other HB\n * operation passes it the same way.\n *\n * @module healthybowl\n */\nimport { useCallback, useMemo } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\nimport { useHealthyBowl } from '../context/HealthyBowlContext';\n\n/** One compliance rail and what it concluded (UC-19). */\nexport interface AgronomyRailCheck {\n /** PROHIBITED_SUBSTANCE | MEDICATION_WITHDRAWAL. */\n rail: string;\n /** PASS | BLOCKED | NOT_APPLICABLE. */\n outcome: string;\n detail: string;\n}\n\n/** A decision the engine proposed, with the evidence and rails behind it. */\nexport interface AgronomyDecision {\n id: string;\n /** IRRIGATION | TREATMENT. */\n decisionType: string;\n /** PROPOSED | ACCEPTED | REJECTED | BLOCKED. */\n status: string;\n /** MODEL | HEURISTIC — whether a model actually produced this wording. */\n source: string;\n subjectId: string;\n subjectType: string;\n fieldId?: string | null;\n plantScanId?: string | null;\n title: string;\n rationale: string;\n /** 0..1, or null when nothing honest could be reported. */\n confidence?: number | null;\n /** The real records this rests on — probe code, reading timestamp, scan id. */\n inputs?: Record<string, unknown> | null;\n railChecks: AgronomyRailCheck[];\n blockedReason?: string | null;\n recommendedMm?: number | null;\n modelProvider?: string | null;\n modelName?: string | null;\n decidedBy?: string | null;\n decidedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface AgronomySweepResult {\n decisions: AgronomyDecision[];\n skipped: number;\n skippedReason?: string | null;\n}\n\nconst DECISION_FIELDS = `\n id\n decisionType\n status\n source\n subjectId\n subjectType\n fieldId\n plantScanId\n title\n rationale\n confidence\n inputs\n railChecks {\n rail\n outcome\n detail\n }\n blockedReason\n recommendedMm\n modelProvider\n modelName\n decidedBy\n decidedAt\n createdAt\n updatedAt\n`;\n\nconst GET_AGRONOMY_DECISIONS = gql`\n query GetHealthyBowlAgronomyDecisions(\n $context: ContextInput!\n $filter: AgronomyDecisionFilterInput\n ) {\n getHealthyBowlAgronomyDecisions(context: $context, filter: $filter) {\n ${DECISION_FIELDS}\n }\n }\n`;\n\nconst PROPOSE_AGRONOMY_DECISIONS = gql`\n mutation ProposeHealthyBowlAgronomyDecisions($input: ProposeAgronomyDecisionsInput!) {\n proposeHealthyBowlAgronomyDecisions(input: $input) {\n skipped\n skippedReason\n decisions {\n ${DECISION_FIELDS}\n }\n }\n }\n`;\n\nconst DECIDE_AGRONOMY_DECISION = gql`\n mutation DecideHealthyBowlAgronomyDecision($input: DecideAgronomyDecisionInput!) {\n decideHealthyBowlAgronomyDecision(input: $input) {\n ${DECISION_FIELDS}\n }\n }\n`;\n\nexport function useAgronomyDecisions() {\n const { workspaceId } = useHealthyBowl();\n // Memoised so the callbacks below have a stable dependency. A fresh object each render would\n // make every consumer's `propose`/`decide` identity change on every render.\n const context = useMemo(() => ({ workspaceId }), [workspaceId]);\n\n const { data, loading, error, refetch } = useQuery<{\n getHealthyBowlAgronomyDecisions: AgronomyDecision[];\n }>(GET_AGRONOMY_DECISIONS, {\n variables: { context, filter: {} },\n skip: !workspaceId,\n fetchPolicy: 'cache-and-network',\n });\n\n const [proposeMutation, { loading: proposing }] = useMutation<{\n proposeHealthyBowlAgronomyDecisions: AgronomySweepResult;\n }>(PROPOSE_AGRONOMY_DECISIONS);\n\n const [decideMutation, { loading: deciding }] = useMutation<{\n decideHealthyBowlAgronomyDecision: AgronomyDecision;\n }>(DECIDE_AGRONOMY_DECISION);\n\n /** Run a sweep. Returns the result so the caller can surface `skippedReason`. */\n const propose = useCallback(\n async (decisionType: 'IRRIGATION' | 'TREATMENT'): Promise<AgronomySweepResult> => {\n const result = await proposeMutation({\n variables: { input: { context, decisionType } },\n });\n await refetch();\n return (\n result.data?.proposeHealthyBowlAgronomyDecisions ?? {\n decisions: [],\n skipped: 0,\n skippedReason: null,\n }\n );\n },\n [proposeMutation, refetch, context]\n );\n\n const decide = useCallback(\n async (id: string, verdict: 'ACCEPTED' | 'REJECTED') => {\n await decideMutation({ variables: { input: { context, id, verdict } } });\n await refetch();\n },\n [decideMutation, refetch, context]\n );\n\n return {\n decisions: data?.getHealthyBowlAgronomyDecisions ?? [],\n loading,\n error,\n refetch,\n propose,\n proposing,\n decide,\n deciding,\n };\n}\n"],"mappings":";;;;;AA+DA,IAAM,IAAkB,gUA4BlB,IAAyB,CAAG;;;;;;QAM1B,EAAgB;;;GAKlB,IAA6B,CAAG;;;;;;UAM5B,EAAgB;;;;GAMpB,IAA2B,CAAG;;;QAG5B,EAAgB;;;;AAKxB,SAAgB,IAAuB;CACrC,IAAM,EAAE,mBAAgB,EAAe,GAGjC,IAAU,SAAe,EAAE,eAAY,IAAI,CAAC,CAAW,CAAC,GAExD,EAAE,SAAM,YAAS,UAAO,eAAY,EAEvC,GAAwB;EACzB,WAAW;GAAE;GAAS,QAAQ,CAAC;EAAE;EACjC,MAAM,CAAC;EACP,aAAa;CACf,CAAC,GAEK,CAAC,GAAiB,EAAE,SAAS,OAAe,EAE/C,CAA0B,GAEvB,CAAC,GAAgB,EAAE,SAAS,OAAc,EAE7C,CAAwB,GAGrB,IAAU,EACd,OAAO,MAA2E;EAChF,IAAM,IAAS,MAAM,EAAgB,EACnC,WAAW,EAAE,OAAO;GAAE;GAAS;EAAa,EAAE,EAChD,CAAC;EAED,OADA,MAAM,EAAQ,GAEZ,EAAO,MAAM,uCAAuC;GAClD,WAAW,CAAC;GACZ,SAAS;GACT,eAAe;EACjB;CAEJ,GACA;EAAC;EAAiB;EAAS;CAAO,CACpC,GAEM,IAAS,EACb,OAAO,GAAY,MAAqC;EAEtD,AADA,MAAM,EAAe,EAAE,WAAW,EAAE,OAAO;GAAE;GAAS;GAAI;EAAQ,EAAE,EAAE,CAAC,GACvE,MAAM,EAAQ;CAChB,GACA;EAAC;EAAgB;EAAS;CAAO,CACnC;CAEA,OAAO;EACL,WAAW,GAAM,mCAAmC,CAAC;EACrD;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|