@happyvertical/smrt-planner 0.0.0-stage → 0.0.2
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/LICENSE +21 -0
- package/README.md +170 -2
- package/app/404.html +80 -0
- package/app/_app/immutable/assets/0.B5zXkXe_.css +1 -0
- package/app/_app/immutable/assets/10.hpcnxvK1.css +1 -0
- package/app/_app/immutable/assets/11.D7zoXfVV.css +1 -0
- package/app/_app/immutable/assets/12.CPobm1ED.css +1 -0
- package/app/_app/immutable/assets/2.CyaWdRdI.css +1 -0
- package/app/_app/immutable/assets/3.BlPQOes8.css +1 -0
- package/app/_app/immutable/assets/8.2gQeKBp_.css +1 -0
- package/app/_app/immutable/assets/9.HOPT4xtg.css +1 -0
- package/app/_app/immutable/assets/AiSetup.Cb22AigN.css +1 -0
- package/app/_app/immutable/assets/Button.DkP0qkG9.css +1 -0
- package/app/_app/immutable/assets/ConnectTools.BgIJOOGW.css +1 -0
- package/app/_app/immutable/assets/FieldMapForm.BCU-4pO4.css +1 -0
- package/app/_app/immutable/assets/ModelPage.Dd3LcMta.css +1 -0
- package/app/_app/immutable/assets/SectionActions.CTkVuNMF.css +1 -0
- package/app/_app/immutable/assets/SectionIcons.5Udq9vN-.css +1 -0
- package/app/_app/immutable/assets/SegmentedControl.B8SrQacd.css +1 -0
- package/app/_app/immutable/assets/dist.C5nHBk_O.css +1 -0
- package/app/_app/immutable/assets/feedback.BVKAwFck.css +1 -0
- package/app/_app/immutable/assets/forms.BChZ2RWM.css +1 -0
- package/app/_app/immutable/assets/inter-latin-ext.B_-bZUTo.woff2 +0 -0
- package/app/_app/immutable/assets/inter-latin.8kRkwJBP.woff2 +0 -0
- package/app/_app/immutable/assets/jetbrains-mono-latin-ext.Bnd2h4Br.woff2 +0 -0
- package/app/_app/immutable/assets/jetbrains-mono-latin.Db4Uuiha.woff2 +0 -0
- package/app/_app/immutable/assets/ort-wasm-simd-threaded.asyncify.CxOG5pUO.wasm +0 -0
- package/app/_app/immutable/assets/percent.LH0z-ozZ.css +1 -0
- package/app/_app/immutable/assets/space-grotesk-latin-ext.wJGaI8U0.woff2 +0 -0
- package/app/_app/immutable/assets/space-grotesk-latin.DPT1xrvW.woff2 +0 -0
- package/app/_app/immutable/assets/store.CGDwHkkF.css +1 -0
- package/app/_app/immutable/assets/ui.B1A1Zl2p.css +1 -0
- package/app/_app/immutable/assets/workspace.BIMkuZDb.css +1 -0
- package/app/_app/immutable/chunks/1okeBSoq.js +1 -0
- package/app/_app/immutable/chunks/2jFBkS1C.js +1 -0
- package/app/_app/immutable/chunks/6P9zxrzU.js +1 -0
- package/app/_app/immutable/chunks/B32EWqI8.js +9 -0
- package/app/_app/immutable/chunks/B4Kevpe0.js +1 -0
- package/app/_app/immutable/chunks/BJfAXhak.js +3 -0
- package/app/_app/immutable/chunks/BKwRT_1p.js +1 -0
- package/app/_app/immutable/chunks/BQxY8kkL.js +1 -0
- package/app/_app/immutable/chunks/BS4h9ES-.js +1 -0
- package/app/_app/immutable/chunks/BWPhGFHl.js +1 -0
- package/app/_app/immutable/chunks/BYcBM-fh.js +1 -0
- package/app/_app/immutable/chunks/BegKiy2G.js +1 -0
- package/app/_app/immutable/chunks/Bjy-W4x2.js +81 -0
- package/app/_app/immutable/chunks/BnRri03M.js +1 -0
- package/app/_app/immutable/chunks/C7zBd-pD.js +1 -0
- package/app/_app/immutable/chunks/CA-A9Ngs.js +1 -0
- package/app/_app/immutable/chunks/CMhpRMKg.js +1 -0
- package/app/_app/immutable/chunks/CPRHZZeW.js +1 -0
- package/app/_app/immutable/chunks/CRQ1Pmzr.js +1 -0
- package/app/_app/immutable/chunks/CWtfVMDz.js +1 -0
- package/app/_app/immutable/chunks/CgAkqYsL.js +1 -0
- package/app/_app/immutable/chunks/Chyo8rdT.js +3 -0
- package/app/_app/immutable/chunks/Ci0DUht6.js +34 -0
- package/app/_app/immutable/chunks/CmmuWmp6.js +2 -0
- package/app/_app/immutable/chunks/CrFNLK0f.js +1 -0
- package/app/_app/immutable/chunks/CrO3W89x.js +1 -0
- package/app/_app/immutable/chunks/CsprTb3f.js +2 -0
- package/app/_app/immutable/chunks/CyUMm_Wp.js +1 -0
- package/app/_app/immutable/chunks/CygC84VT.js +2 -0
- package/app/_app/immutable/chunks/D0VgZnk1.js +1 -0
- package/app/_app/immutable/chunks/D71UrO5c.js +1 -0
- package/app/_app/immutable/chunks/D7hhQvDO.js +1 -0
- package/app/_app/immutable/chunks/DD7gpKb2.js +1 -0
- package/app/_app/immutable/chunks/DNRgqfTx.js +1 -0
- package/app/_app/immutable/chunks/DRByVC-c.js +1 -0
- package/app/_app/immutable/chunks/DVRKjN-E.js +1 -0
- package/app/_app/immutable/chunks/D_J_XtJy.js +846 -0
- package/app/_app/immutable/chunks/Dbjm4OuC.js +1 -0
- package/app/_app/immutable/chunks/Dc4q22LH.js +42 -0
- package/app/_app/immutable/chunks/Dd_uD5pT.js +1 -0
- package/app/_app/immutable/chunks/DkR8_Ws6.js +2 -0
- package/app/_app/immutable/chunks/Dp9GVO-9.js +1 -0
- package/app/_app/immutable/chunks/DqcD-WtP.js +1 -0
- package/app/_app/immutable/chunks/Dt-HX3Vu.js +1 -0
- package/app/_app/immutable/chunks/FbOxj-PF.js +69 -0
- package/app/_app/immutable/chunks/QukgIHDX.js +1 -0
- package/app/_app/immutable/chunks/WxSPP8QW.js +4 -0
- package/app/_app/immutable/chunks/Xp1g1t4n.js +3 -0
- package/app/_app/immutable/chunks/iET62IRm.js +2 -0
- package/app/_app/immutable/chunks/leQCwW2d.js +1 -0
- package/app/_app/immutable/chunks/p6bgzXiY.js +1 -0
- package/app/_app/immutable/chunks/uBIymjUX.js +1 -0
- package/app/_app/immutable/chunks/xihTtKlq.js +1 -0
- package/app/_app/immutable/entry/app.IZIJXhgq.js +2 -0
- package/app/_app/immutable/entry/start.BuaYHD1N.js +1 -0
- package/app/_app/immutable/nodes/0.m_U8WC7E.js +10 -0
- package/app/_app/immutable/nodes/1.Crw8ULhB.js +1 -0
- package/app/_app/immutable/nodes/10.1nQxyH9H.js +4 -0
- package/app/_app/immutable/nodes/11.Cw0JnQF3.js +1 -0
- package/app/_app/immutable/nodes/12.BIocA1aI.js +1 -0
- package/app/_app/immutable/nodes/2.CR5BwGnt.js +17 -0
- package/app/_app/immutable/nodes/3.1B56hgAG.js +1 -0
- package/app/_app/immutable/nodes/4.SSIC7sUh.js +1 -0
- package/app/_app/immutable/nodes/5.DgdwleDQ.js +1 -0
- package/app/_app/immutable/nodes/6.DmD9rqLU.js +1 -0
- package/app/_app/immutable/nodes/7.DdngsBmo.js +1 -0
- package/app/_app/immutable/nodes/8.D2Mszsua.js +3 -0
- package/app/_app/immutable/nodes/9.CLYsywul.js +1 -0
- package/app/_app/immutable/workers/assets/ort-wasm-simd-threaded.asyncify-CxOG5pUO.wasm +0 -0
- package/app/_app/immutable/workers/llm.worker-wfCOG_uk.js +69 -0
- package/app/_app/immutable/workers/local-speech.worker-DWbfmFUk.js +51 -0
- package/app/_app/version.json +1 -0
- package/app/ai/index.html +89 -0
- package/app/blueprint/index.html +87 -0
- package/app/cookbook/index.html +87 -0
- package/app/index.html +103 -0
- package/app/m/ads/AdDeliveryTier/index.html +96 -0
- package/app/m/ads/AdEvent/index.html +96 -0
- package/app/m/ads/AdFormat/index.html +96 -0
- package/app/m/ads/AdGroup/index.html +96 -0
- package/app/m/ads/AdVariation/index.html +96 -0
- package/app/m/analytics/AnalyticsDataStream/index.html +96 -0
- package/app/m/analytics/AnalyticsEvent/index.html +96 -0
- package/app/m/analytics/AnalyticsProperty/index.html +96 -0
- package/app/m/analytics/AnalyticsReport/index.html +96 -0
- package/app/m/approvals/ApprovalEvent/index.html +96 -0
- package/app/m/approvals/ApprovalPolicy/index.html +96 -0
- package/app/m/approvals/ApprovalRequest/index.html +96 -0
- package/app/m/assets/Asset/index.html +96 -0
- package/app/m/assets/AssetAssociation/index.html +97 -0
- package/app/m/assets/AssetMetafield/index.html +96 -0
- package/app/m/assets/AssetStatus/index.html +96 -0
- package/app/m/assets/AssetType/index.html +96 -0
- package/app/m/assets/Folder/index.html +96 -0
- package/app/m/chat/AgentSession/index.html +96 -0
- package/app/m/chat/ChatMessage/index.html +97 -0
- package/app/m/chat/ChatParticipant/index.html +97 -0
- package/app/m/chat/ChatReaction/index.html +96 -0
- package/app/m/chat/ChatRoom/index.html +96 -0
- package/app/m/chat/ChatThread/index.html +97 -0
- package/app/m/chat/VoiceGatewayTurn/index.html +96 -0
- package/app/m/chat/VoiceSession/index.html +96 -0
- package/app/m/commerce/Agreement/index.html +96 -0
- package/app/m/commerce/Cart/index.html +96 -0
- package/app/m/commerce/Contract/index.html +96 -0
- package/app/m/commerce/ContractLineItem/index.html +97 -0
- package/app/m/commerce/Customer/index.html +96 -0
- package/app/m/commerce/Estimate/index.html +96 -0
- package/app/m/commerce/Fulfillment/index.html +96 -0
- package/app/m/commerce/FulfillmentLineItem/index.html +97 -0
- package/app/m/commerce/Invoice/index.html +96 -0
- package/app/m/commerce/InvoiceLineItem/index.html +97 -0
- package/app/m/commerce/Lease/index.html +96 -0
- package/app/m/commerce/LicenseSale/index.html +96 -0
- package/app/m/commerce/Order/index.html +96 -0
- package/app/m/commerce/Payment/index.html +96 -0
- package/app/m/commerce/PaymentAllocation/index.html +97 -0
- package/app/m/commerce/PaymentInstrument/index.html +96 -0
- package/app/m/commerce/PaymentIntent/index.html +96 -0
- package/app/m/commerce/Payout/index.html +96 -0
- package/app/m/commerce/ProductionOrder/index.html +96 -0
- package/app/m/commerce/PurchaseOrder/index.html +96 -0
- package/app/m/commerce/Vendor/index.html +96 -0
- package/app/m/commerce/WholesaleOrder/index.html +96 -0
- package/app/m/content/Content/index.html +96 -0
- package/app/m/content/ContentContribution/index.html +96 -0
- package/app/m/content/ContentContributionAttachment/index.html +96 -0
- package/app/m/content/ContentContributionRevision/index.html +96 -0
- package/app/m/content/ContentContributionType/index.html +96 -0
- package/app/m/content/ContentContributor/index.html +96 -0
- package/app/m/content/ContentCorrection/index.html +96 -0
- package/app/m/content/ContentFeedSource/index.html +96 -0
- package/app/m/content/ContentGovernanceAssignment/index.html +96 -0
- package/app/m/content/ContentGovernancePolicy/index.html +96 -0
- package/app/m/content/ContentGovernanceProfile/index.html +96 -0
- package/app/m/content/ContentReference/index.html +96 -0
- package/app/m/content/ContentReview/index.html +96 -0
- package/app/m/content/ContentVersion/index.html +96 -0
- package/app/m/content/Contents/index.html +96 -0
- package/app/m/events/Event/index.html +96 -0
- package/app/m/events/EventParticipant/index.html +97 -0
- package/app/m/events/EventSeries/index.html +96 -0
- package/app/m/events/EventType/index.html +96 -0
- package/app/m/facts/Fact/index.html +96 -0
- package/app/m/facts/FactContent/index.html +96 -0
- package/app/m/facts/FactEvidence/index.html +96 -0
- package/app/m/facts/FactSource/index.html +96 -0
- package/app/m/facts/FactSubject/index.html +96 -0
- package/app/m/facts/FactTag/index.html +96 -0
- package/app/m/fields/FieldPolicy/index.html +96 -0
- package/app/m/fields/FieldPolicySuggestion/index.html +96 -0
- package/app/m/fields/FieldUsageCounter/index.html +96 -0
- package/app/m/images/Image/index.html +96 -0
- package/app/m/inventory/InventoryLocation/index.html +96 -0
- package/app/m/inventory/StockLevel/index.html +96 -0
- package/app/m/inventory/StockMovement/index.html +96 -0
- package/app/m/ledgers/Account/index.html +96 -0
- package/app/m/ledgers/Journal/index.html +96 -0
- package/app/m/ledgers/JournalEntry/index.html +97 -0
- package/app/m/manufacturing/Assembly/index.html +96 -0
- package/app/m/manufacturing/BillOfMaterials/index.html +96 -0
- package/app/m/manufacturing/BomLine/index.html +96 -0
- package/app/m/manufacturing/Operation/index.html +96 -0
- package/app/m/manufacturing/ProductionRun/index.html +96 -0
- package/app/m/manufacturing/ProductionRunCompletion/index.html +96 -0
- package/app/m/manufacturing/RoutingStep/index.html +96 -0
- package/app/m/marketing/Campaign/index.html +96 -0
- package/app/m/marketing/CampaignChannel/index.html +96 -0
- package/app/m/marketing/CampaignMetricSnapshot/index.html +96 -0
- package/app/m/messages/Account/index.html +96 -0
- package/app/m/messages/Attachment/index.html +96 -0
- package/app/m/messages/Blacklist/index.html +96 -0
- package/app/m/messages/Email/failed-sends/index.html +96 -0
- package/app/m/messages/Email/index.html +96 -0
- package/app/m/messages/Email/mailbox/index.html +96 -0
- package/app/m/messages/EmailAccount/index.html +96 -0
- package/app/m/messages/EmailFolder/index.html +96 -0
- package/app/m/messages/Message/index.html +96 -0
- package/app/m/messages/MessagingEndpoint/index.html +96 -0
- package/app/m/messages/PersonaMessageRoute/index.html +96 -0
- package/app/m/messages/SlackAccount/index.html +96 -0
- package/app/m/messages/SlackMessage/index.html +96 -0
- package/app/m/messages/TelegramAccount/index.html +96 -0
- package/app/m/messages/Tweet/index.html +96 -0
- package/app/m/messages/TwitterAccount/index.html +96 -0
- package/app/m/messages/Whitelist/index.html +96 -0
- package/app/m/messages/ZulipAccount/index.html +96 -0
- package/app/m/places/Place/index.html +96 -0
- package/app/m/places/PlaceType/index.html +96 -0
- package/app/m/preferences/UiPreferenceRecord/index.html +96 -0
- package/app/m/products/Category/index.html +96 -0
- package/app/m/products/Material/index.html +96 -0
- package/app/m/products/Product/index.html +96 -0
- package/app/m/products/Product/ingredients/index.html +96 -0
- package/app/m/products/ProductVariant/index.html +97 -0
- package/app/m/products/Sku/index.html +97 -0
- package/app/m/profiles/ApiKey/index.html +96 -0
- package/app/m/profiles/Bot/index.html +96 -0
- package/app/m/profiles/MagicLinkToken/index.html +96 -0
- package/app/m/profiles/NostrIdentity/index.html +96 -0
- package/app/m/profiles/OidcIdentity/index.html +96 -0
- package/app/m/profiles/Organization/index.html +96 -0
- package/app/m/profiles/Person/index.html +96 -0
- package/app/m/profiles/Profile/index.html +96 -0
- package/app/m/profiles/ProfileMetadata/index.html +96 -0
- package/app/m/profiles/ProfileMetafield/index.html +96 -0
- package/app/m/profiles/ProfileRelationship/index.html +96 -0
- package/app/m/profiles/ProfileRelationshipTerm/index.html +96 -0
- package/app/m/profiles/ProfileRelationshipType/index.html +96 -0
- package/app/m/profiles/ProfileType/index.html +96 -0
- package/app/m/projects/Comment/index.html +97 -0
- package/app/m/projects/Issue/index.html +96 -0
- package/app/m/projects/Label/index.html +96 -0
- package/app/m/projects/Project/index.html +96 -0
- package/app/m/projects/ProjectIntegration/index.html +96 -0
- package/app/m/projects/PullRequest/index.html +96 -0
- package/app/m/projects/Repository/index.html +96 -0
- package/app/m/properties/Property/index.html +96 -0
- package/app/m/properties/Zone/index.html +96 -0
- package/app/m/reports/RuntimeReport/index.html +96 -0
- package/app/m/reports/SmrtPrincipalReportRefreshTask/index.html +96 -0
- package/app/m/reports/SmrtReportLock/index.html +96 -0
- package/app/m/reports/SmrtReportRefreshTask/index.html +96 -0
- package/app/m/reports/SmrtReportRun/index.html +96 -0
- package/app/m/reports/SmrtReportSchedule/index.html +96 -0
- package/app/m/reports/SmrtReportWatermark/index.html +96 -0
- package/app/m/sales/AttributionException/index.html +96 -0
- package/app/m/sales/AttributionPolicy/index.html +96 -0
- package/app/m/sales/Commission/index.html +96 -0
- package/app/m/sales/CommissionAdjustment/index.html +96 -0
- package/app/m/sales/CommissionPayout/index.html +96 -0
- package/app/m/sales/CommissionPlan/index.html +96 -0
- package/app/m/sales/Earner/index.html +96 -0
- package/app/m/sales/EarnerSourceAttribution/index.html +96 -0
- package/app/m/sales/EarningEvent/index.html +96 -0
- package/app/m/sales/ExecutedAgreement/index.html +96 -0
- package/app/m/sales/Lead/index.html +96 -0
- package/app/m/sales/Opportunity/index.html +96 -0
- package/app/m/sales/OpportunityConversion/index.html +96 -0
- package/app/m/sales/PipelineDefinition/index.html +96 -0
- package/app/m/sales/PipelineStage/index.html +97 -0
- package/app/m/sales/Referral/index.html +96 -0
- package/app/m/sales/ReferralAgreement/index.html +96 -0
- package/app/m/sales/ReferralLink/index.html +96 -0
- package/app/m/sales/ReferralProgram/index.html +96 -0
- package/app/m/sales/ReferralTermSnapshot/index.html +96 -0
- package/app/m/sales/ReferralTouch/index.html +96 -0
- package/app/m/sales/Referrer/index.html +96 -0
- package/app/m/sales/SalesActivity/index.html +96 -0
- package/app/m/sales/SalesRepresentative/index.html +96 -0
- package/app/m/sites/Site/index.html +96 -0
- package/app/m/sites/SiteAgentBinding/index.html +96 -0
- package/app/m/social/OAuthState/index.html +96 -0
- package/app/m/social/SocialAccount/index.html +96 -0
- package/app/m/social/SocialPost/index.html +96 -0
- package/app/m/social/SocialPostAnalyticsSnapshot/index.html +96 -0
- package/app/m/subscriptions/BillingAdjustment/index.html +96 -0
- package/app/m/subscriptions/ClientCharge/index.html +96 -0
- package/app/m/subscriptions/CreditGrant/index.html +96 -0
- package/app/m/subscriptions/PricingRule/index.html +96 -0
- package/app/m/subscriptions/RetailCharge/index.html +96 -0
- package/app/m/subscriptions/SpendingPolicy/index.html +96 -0
- package/app/m/subscriptions/SubscriptionPlan/index.html +96 -0
- package/app/m/subscriptions/TenantSubscription/index.html +96 -0
- package/app/m/subscriptions/TenantUsageMetric/index.html +96 -0
- package/app/m/support/ServiceTimeEntry/index.html +96 -0
- package/app/m/support/SupportAiRun/index.html +96 -0
- package/app/m/support/SupportAvailability/index.html +96 -0
- package/app/m/support/SupportCase/index.html +96 -0
- package/app/m/support/SupportCaseEvent/index.html +96 -0
- package/app/m/support/SupportChannelBinding/index.html +96 -0
- package/app/m/support/SupportCharge/index.html +96 -0
- package/app/m/support/SupportCompensation/index.html +96 -0
- package/app/m/support/SupportCompensationPlan/index.html +96 -0
- package/app/m/support/SupportEscalation/index.html +96 -0
- package/app/m/support/SupportInteraction/index.html +96 -0
- package/app/m/support/SupportPlan/index.html +96 -0
- package/app/m/support/SupportPolicy/index.html +96 -0
- package/app/m/support/SupportQualification/index.html +96 -0
- package/app/m/support/SupportServiceTarget/index.html +96 -0
- package/app/m/support/SupportSpecialist/index.html +96 -0
- package/app/m/support/SupportWorkLink/index.html +96 -0
- package/app/m/tags/Tag/index.html +96 -0
- package/app/m/tags/TagAlias/index.html +96 -0
- package/app/m/timesheets/AttendanceBreak/index.html +96 -0
- package/app/m/timesheets/AttendancePunch/index.html +96 -0
- package/app/m/timesheets/ServiceChargeSnapshot/index.html +96 -0
- package/app/m/timesheets/ServiceCompensationSnapshot/index.html +96 -0
- package/app/m/timesheets/ServiceTimeEntry/index.html +96 -0
- package/app/m/users/AccessRequest/index.html +96 -0
- package/app/m/users/Group/index.html +96 -0
- package/app/m/users/GroupMember/index.html +96 -0
- package/app/m/users/GroupRole/index.html +96 -0
- package/app/m/users/Membership/index.html +97 -0
- package/app/m/users/MembershipOverride/index.html +96 -0
- package/app/m/users/Permission/index.html +96 -0
- package/app/m/users/ResourceGrant/index.html +96 -0
- package/app/m/users/Role/index.html +96 -0
- package/app/m/users/RolePermission/index.html +96 -0
- package/app/m/users/Session/index.html +96 -0
- package/app/m/users/Tenant/index.html +96 -0
- package/app/m/users/TenantIntegration/index.html +96 -0
- package/app/m/users/TenantPermissionOverride/index.html +96 -0
- package/app/m/users/User/index.html +96 -0
- package/app/m/users/UsersCliAuthRequest/index.html +96 -0
- package/app/m/users/UsersMagicLinkToken/index.html +96 -0
- package/app/m/video/Character/index.html +96 -0
- package/app/m/video/CharacterAsset/index.html +96 -0
- package/app/m/video/CompositeJob/index.html +96 -0
- package/app/m/video/Performer/index.html +96 -0
- package/app/m/video/PerformerAsset/index.html +96 -0
- package/app/m/video/Scene/index.html +96 -0
- package/app/m/video/SceneAsset/index.html +96 -0
- package/app/m/video/VideoComposition/index.html +96 -0
- package/app/m/video/VideoCompositionAsset/index.html +96 -0
- package/app/m/video/VideoSequence/index.html +96 -0
- package/app/m/video/VideoSequenceAsset/index.html +96 -0
- package/app/m/video/VideoShot/index.html +96 -0
- package/app/m/video/VideoShotAsset/index.html +96 -0
- package/app/m/video/VideoShotCharacter/index.html +96 -0
- package/app/m/video/VideoWorkflow/index.html +96 -0
- package/app/m/voice/VoiceOutput/index.html +96 -0
- package/app/m/voice/VoiceProfile/index.html +96 -0
- package/app/m/voice/VoiceSample/index.html +96 -0
- package/app/packages/ads/index.html +92 -0
- package/app/packages/analytics/index.html +92 -0
- package/app/packages/approvals/index.html +92 -0
- package/app/packages/assets/index.html +92 -0
- package/app/packages/chat/index.html +92 -0
- package/app/packages/comments/index.html +92 -0
- package/app/packages/commerce/index.html +92 -0
- package/app/packages/content/index.html +92 -0
- package/app/packages/events/index.html +92 -0
- package/app/packages/expenses/index.html +92 -0
- package/app/packages/facts/index.html +92 -0
- package/app/packages/fields/index.html +92 -0
- package/app/packages/human-resources/index.html +92 -0
- package/app/packages/images/index.html +92 -0
- package/app/packages/index.html +90 -0
- package/app/packages/inventory/index.html +92 -0
- package/app/packages/ledgers/index.html +92 -0
- package/app/packages/manufacturing/index.html +92 -0
- package/app/packages/marketing/index.html +92 -0
- package/app/packages/messages/index.html +92 -0
- package/app/packages/places/index.html +92 -0
- package/app/packages/preferences/index.html +92 -0
- package/app/packages/products/index.html +92 -0
- package/app/packages/profiles/index.html +92 -0
- package/app/packages/projects/index.html +92 -0
- package/app/packages/properties/index.html +92 -0
- package/app/packages/reports/index.html +92 -0
- package/app/packages/sales/index.html +92 -0
- package/app/packages/sites/index.html +92 -0
- package/app/packages/social/index.html +92 -0
- package/app/packages/subscriptions/index.html +92 -0
- package/app/packages/support/index.html +92 -0
- package/app/packages/tags/index.html +92 -0
- package/app/packages/timesheets/index.html +92 -0
- package/app/packages/users/index.html +92 -0
- package/app/packages/video/index.html +92 -0
- package/app/packages/voice/index.html +92 -0
- package/app/recipes/account-access/help/index.html +93 -0
- package/app/recipes/account-access/index.html +95 -0
- package/app/recipes/activity/help/index.html +93 -0
- package/app/recipes/activity/index.html +94 -0
- package/app/recipes/agreements/help/index.html +93 -0
- package/app/recipes/agreements/index.html +96 -0
- package/app/recipes/analytics.reports/help/index.html +93 -0
- package/app/recipes/analytics.reports/index.html +94 -0
- package/app/recipes/assets/help/index.html +93 -0
- package/app/recipes/assets/index.html +95 -0
- package/app/recipes/billing/help/index.html +93 -0
- package/app/recipes/billing/index.html +95 -0
- package/app/recipes/chat.assistant/help/index.html +93 -0
- package/app/recipes/chat.assistant/index.html +94 -0
- package/app/recipes/comments/help/index.html +93 -0
- package/app/recipes/comments/index.html +94 -0
- package/app/recipes/commerce.customers/help/index.html +93 -0
- package/app/recipes/commerce.customers/index.html +94 -0
- package/app/recipes/commerce.estimates/help/index.html +93 -0
- package/app/recipes/commerce.estimates/index.html +94 -0
- package/app/recipes/commerce.purchases/help/index.html +93 -0
- package/app/recipes/commerce.purchases/index.html +94 -0
- package/app/recipes/commerce.sales/help/index.html +93 -0
- package/app/recipes/commerce.sales/index.html +94 -0
- package/app/recipes/commerce.vendors/help/index.html +93 -0
- package/app/recipes/commerce.vendors/index.html +94 -0
- package/app/recipes/commerce.wholesale/help/index.html +93 -0
- package/app/recipes/commerce.wholesale/index.html +94 -0
- package/app/recipes/events.calendar/help/index.html +93 -0
- package/app/recipes/events.calendar/index.html +94 -0
- package/app/recipes/fields.form-customization/help/index.html +93 -0
- package/app/recipes/fields.form-customization/index.html +94 -0
- package/app/recipes/inventory.stock/help/index.html +93 -0
- package/app/recipes/inventory.stock/index.html +94 -0
- package/app/recipes/ledgers.bookkeeping/help/index.html +93 -0
- package/app/recipes/ledgers.bookkeeping/index.html +94 -0
- package/app/recipes/messages/help/index.html +93 -0
- package/app/recipes/messages/index.html +95 -0
- package/app/recipes/products/help/index.html +93 -0
- package/app/recipes/products/index.html +96 -0
- package/app/recipes/projects.tracker/help/index.html +93 -0
- package/app/recipes/projects.tracker/index.html +94 -0
- package/app/recipes/reports.materialized/help/index.html +93 -0
- package/app/recipes/reports.materialized/index.html +94 -0
- package/app/recipes/sales.pipeline/help/index.html +93 -0
- package/app/recipes/sales.pipeline/index.html +94 -0
- package/app/recipes/tags.taxonomy/help/index.html +93 -0
- package/app/recipes/tags.taxonomy/index.html +94 -0
- package/app/recipes/team-collaboration/help/index.html +93 -0
- package/app/recipes/team-collaboration/index.html +94 -0
- package/app/s/custom-billing/index.html +89 -0
- package/app/s/custom-buying/index.html +89 -0
- package/app/s/custom-classes/index.html +89 -0
- package/app/s/custom-jobs/index.html +89 -0
- package/app/s/custom-kitchen/index.html +89 -0
- package/app/s/custom-material/index.html +89 -0
- package/app/s/custom-members/index.html +89 -0
- package/app/s/custom-parts/index.html +89 -0
- package/app/s/custom-schedule/index.html +89 -0
- package/app/s/custom-shop/index.html +89 -0
- package/app/s/custom-wholesale/index.html +89 -0
- package/app/s/section-access-control/index.html +89 -0
- package/app/s/section-account-security/index.html +89 -0
- package/app/s/section-accounting/index.html +89 -0
- package/app/s/section-activity/index.html +89 -0
- package/app/s/section-agreements/index.html +89 -0
- package/app/s/section-analytics/index.html +89 -0
- package/app/s/section-assets/index.html +89 -0
- package/app/s/section-billing/index.html +89 -0
- package/app/s/section-calendar/index.html +89 -0
- package/app/s/section-catalog/index.html +89 -0
- package/app/s/section-chat.assistant/index.html +89 -0
- package/app/s/section-comments/index.html +89 -0
- package/app/s/section-fields.form-customization/index.html +89 -0
- package/app/s/section-messages/index.html +89 -0
- package/app/s/section-more/index.html +89 -0
- package/app/s/section-operations/index.html +89 -0
- package/app/s/section-projects/index.html +89 -0
- package/app/s/section-purchasing/index.html +89 -0
- package/app/s/section-reports.materialized/index.html +89 -0
- package/app/s/section-sales/index.html +89 -0
- package/app/s/section-taxonomy/index.html +89 -0
- package/app/s/section-team/index.html +89 -0
- package/dist/ai/echo-gate.d.ts +13 -0
- package/dist/ai/echo-gate.js +21 -0
- package/dist/ai/icons.d.ts +9 -0
- package/dist/ai/icons.js +9 -0
- package/dist/ai/instance.d.ts +3 -0
- package/dist/ai/instance.js +25 -0
- package/dist/ai/state.svelte.d.ts +130 -0
- package/dist/ai/state.svelte.js +316 -0
- package/dist/ai/status.d.ts +67 -0
- package/dist/ai/status.js +125 -0
- package/dist/assets/smrt-mark.svg +38 -0
- package/dist/assistant/change.d.ts +101 -0
- package/dist/assistant/change.js +209 -0
- package/dist/assistant/engine.d.ts +20 -0
- package/dist/assistant/engine.js +43 -0
- package/dist/assistant/llm.worker.d.ts +1 -0
- package/dist/assistant/llm.worker.js +7 -0
- package/dist/assistant/match.d.ts +59 -0
- package/dist/assistant/match.js +271 -0
- package/dist/assistant/models.d.ts +38 -0
- package/dist/assistant/models.js +57 -0
- package/dist/assistant/offers.svelte.d.ts +36 -0
- package/dist/assistant/offers.svelte.js +59 -0
- package/dist/assistant/prefs.d.ts +14 -0
- package/dist/assistant/prefs.js +32 -0
- package/dist/assistant/prompt.d.ts +23 -0
- package/dist/assistant/prompt.js +163 -0
- package/dist/assistant/session.svelte.d.ts +74 -0
- package/dist/assistant/session.svelte.js +181 -0
- package/dist/assistant/theme-undo.svelte.d.ts +38 -0
- package/dist/assistant/theme-undo.svelte.js +50 -0
- package/dist/assistant/transport.d.ts +73 -0
- package/dist/assistant/transport.js +231 -0
- package/dist/assistant/voice-host.d.ts +10 -0
- package/dist/assistant/voice-host.js +17 -0
- package/dist/assistant/voice.svelte.d.ts +107 -0
- package/dist/assistant/voice.svelte.js +261 -0
- package/dist/catalog/catalog.json +89663 -0
- package/dist/catalog/generate/build.d.ts +33 -0
- package/dist/catalog/generate/build.js +131 -0
- package/dist/catalog/generate/exclusions.d.ts +18 -0
- package/dist/catalog/generate/exclusions.js +33 -0
- package/dist/catalog/generate/extract.d.ts +90 -0
- package/dist/catalog/generate/extract.js +326 -0
- package/dist/catalog/generate/local.d.ts +8 -0
- package/dist/catalog/generate/local.js +45 -0
- package/dist/catalog/generate/recipe-demo.d.ts +11 -0
- package/dist/catalog/generate/recipe-demo.js +29 -0
- package/dist/catalog/generate/recipe-metadata.d.ts +12 -0
- package/dist/catalog/generate/recipe-metadata.js +138 -0
- package/dist/catalog/generate/registry.d.ts +14 -0
- package/dist/catalog/generate/registry.js +83 -0
- package/dist/catalog/index.d.ts +21 -0
- package/dist/catalog/index.js +53 -0
- package/dist/catalog/types.d.ts +141 -0
- package/dist/catalog/types.js +8 -0
- package/dist/components/AiSetup.svelte +528 -0
- package/dist/components/AiSetup.svelte.d.ts +8 -0
- package/dist/components/AiStatusIcons.svelte +86 -0
- package/dist/components/AiStatusIcons.svelte.d.ts +18 -0
- package/dist/components/AppSettings.svelte +100 -0
- package/dist/components/AppSettings.svelte.d.ts +10 -0
- package/dist/components/BrowserAssistant.svelte +318 -0
- package/dist/components/BrowserAssistant.svelte.d.ts +8 -0
- package/dist/components/ChildRecords.svelte +331 -0
- package/dist/components/ChildRecords.svelte.d.ts +15 -0
- package/dist/components/ConnectTools.svelte +145 -0
- package/dist/components/ConnectTools.svelte.d.ts +8 -0
- package/dist/components/CookbooksPanel.svelte +308 -0
- package/dist/components/CookbooksPanel.svelte.d.ts +3 -0
- package/dist/components/ExportPanel.svelte +217 -0
- package/dist/components/ExportPanel.svelte.d.ts +3 -0
- package/dist/components/FeatureCard.svelte +197 -0
- package/dist/components/FeatureCard.svelte.d.ts +13 -0
- package/dist/components/FeaturesPanel.svelte +155 -0
- package/dist/components/FeaturesPanel.svelte.d.ts +3 -0
- package/dist/components/FieldInput.svelte +307 -0
- package/dist/components/FieldInput.svelte.d.ts +24 -0
- package/dist/components/FieldMapForm.svelte +173 -0
- package/dist/components/FieldMapForm.svelte.d.ts +18 -0
- package/dist/components/FormWorkspace.svelte +274 -0
- package/dist/components/FormWorkspace.svelte.d.ts +19 -0
- package/dist/components/HelpView.svelte +129 -0
- package/dist/components/HelpView.svelte.d.ts +12 -0
- package/dist/components/ModelOptions.svelte +239 -0
- package/dist/components/ModelOptions.svelte.d.ts +12 -0
- package/dist/components/ModelPage.svelte +295 -0
- package/dist/components/ModelPage.svelte.d.ts +9 -0
- package/dist/components/ModelWorkspace.svelte +488 -0
- package/dist/components/ModelWorkspace.svelte.d.ts +32 -0
- package/dist/components/PlannerEditBridge.svelte +36 -0
- package/dist/components/PlannerEditBridge.svelte.d.ts +3 -0
- package/dist/components/PlannerPalette.svelte +38 -0
- package/dist/components/PlannerPalette.svelte.d.ts +18 -0
- package/dist/components/RecipeCards.svelte +145 -0
- package/dist/components/RecipeCards.svelte.d.ts +3 -0
- package/dist/components/RecipeHelp.svelte +54 -0
- package/dist/components/RecipeHelp.svelte.d.ts +9 -0
- package/dist/components/RecipeOptions.svelte +160 -0
- package/dist/components/RecipeOptions.svelte.d.ts +9 -0
- package/dist/components/RecordFeatures.svelte +240 -0
- package/dist/components/RecordFeatures.svelte.d.ts +3 -0
- package/dist/components/RelationField.svelte +175 -0
- package/dist/components/RelationField.svelte.d.ts +16 -0
- package/dist/components/SectionActions.svelte +91 -0
- package/dist/components/SectionActions.svelte.d.ts +12 -0
- package/dist/components/SectionIcons.svelte +98 -0
- package/dist/components/SectionIcons.svelte.d.ts +15 -0
- package/dist/components/SectionOverview.svelte +65 -0
- package/dist/components/SectionOverview.svelte.d.ts +14 -0
- package/dist/components/SectionPage.svelte +230 -0
- package/dist/components/SectionPage.svelte.d.ts +7 -0
- package/dist/components/SettingsPanel.svelte +60 -0
- package/dist/components/SettingsPanel.svelte.d.ts +7 -0
- package/dist/components/ThemeBridge.svelte +56 -0
- package/dist/components/ThemeBridge.svelte.d.ts +3 -0
- package/dist/components/ThemeSection.svelte +167 -0
- package/dist/components/ThemeSection.svelte.d.ts +11 -0
- package/dist/components/VariantGridForm.svelte +309 -0
- package/dist/components/VariantGridForm.svelte.d.ts +12 -0
- package/dist/components/VoiceTyping.svelte +108 -0
- package/dist/components/VoiceTyping.svelte.d.ts +7 -0
- package/dist/cookbook/assemble.d.ts +16 -0
- package/dist/cookbook/assemble.js +29 -0
- package/dist/cookbook/file.d.ts +7 -0
- package/dist/cookbook/file.js +25 -0
- package/dist/cookbook/legacy.d.ts +9 -0
- package/dist/cookbook/legacy.js +87 -0
- package/dist/cookbook/migrate.d.ts +22 -0
- package/dist/cookbook/migrate.js +106 -0
- package/dist/cookbook/parse.d.ts +16 -0
- package/dist/cookbook/parse.js +246 -0
- package/dist/cookbook/storage.d.ts +45 -0
- package/dist/cookbook/storage.js +98 -0
- package/dist/cookbook/store.svelte.d.ts +94 -0
- package/dist/cookbook/store.svelte.js +231 -0
- package/dist/cookbook/types.d.ts +76 -0
- package/dist/cookbook/types.js +11 -0
- package/dist/cookbook/validate.d.ts +14 -0
- package/dist/cookbook/validate.js +29 -0
- package/dist/core/app.d.ts +37 -0
- package/dist/core/app.js +119 -0
- package/dist/core/catalog.d.ts +19 -0
- package/dist/core/catalog.js +9 -0
- package/dist/core/headless.d.ts +52 -0
- package/dist/core/headless.js +39 -0
- package/dist/core/index.d.ts +28 -0
- package/dist/core/index.js +28 -0
- package/dist/core/prompt.d.ts +38 -0
- package/dist/core/prompt.js +95 -0
- package/dist/core/reply.d.ts +60 -0
- package/dist/core/reply.js +89 -0
- package/dist/core/request.d.ts +15 -0
- package/dist/core/request.js +55 -0
- package/dist/data/children.d.ts +20 -0
- package/dist/data/children.js +80 -0
- package/dist/data/columns.d.ts +56 -0
- package/dist/data/columns.js +150 -0
- package/dist/data/context.d.ts +8 -0
- package/dist/data/context.js +19 -0
- package/dist/data/derived.d.ts +79 -0
- package/dist/data/derived.js +139 -0
- package/dist/data/display.d.ts +23 -0
- package/dist/data/display.js +84 -0
- package/dist/data/fakes.d.ts +52 -0
- package/dist/data/fakes.js +443 -0
- package/dist/data/format.d.ts +48 -0
- package/dist/data/format.js +121 -0
- package/dist/data/labels.d.ts +45 -0
- package/dist/data/labels.js +179 -0
- package/dist/data/packs.d.ts +95 -0
- package/dist/data/packs.js +830 -0
- package/dist/data/payments.d.ts +17 -0
- package/dist/data/payments.js +60 -0
- package/dist/data/planner-source.d.ts +7 -0
- package/dist/data/planner-source.js +32 -0
- package/dist/data/source.d.ts +119 -0
- package/dist/data/source.js +432 -0
- package/dist/features/catalogue.d.ts +96 -0
- package/dist/features/catalogue.js +225 -0
- package/dist/features/demo.d.ts +36 -0
- package/dist/features/demo.js +66 -0
- package/dist/features/palette.d.ts +39 -0
- package/dist/features/palette.js +53 -0
- package/dist/fields/address.d.ts +23 -0
- package/dist/fields/address.js +39 -0
- package/dist/fields/invalid.d.ts +2 -0
- package/dist/fields/invalid.js +8 -0
- package/dist/fields/modal.d.ts +7 -0
- package/dist/fields/modal.js +14 -0
- package/dist/fields/percent.d.ts +8 -0
- package/dist/fields/percent.js +16 -0
- package/dist/fields/renderer.d.ts +17 -0
- package/dist/fields/renderer.js +43 -0
- package/dist/forms/active.d.ts +16 -0
- package/dist/forms/active.js +24 -0
- package/dist/forms/fieldMap.d.ts +44 -0
- package/dist/forms/fieldMap.js +134 -0
- package/dist/forms/shared.d.ts +41 -0
- package/dist/forms/shared.js +138 -0
- package/dist/forms/stock.d.ts +28 -0
- package/dist/forms/stock.js +104 -0
- package/dist/forms/variantGrid.d.ts +83 -0
- package/dist/forms/variantGrid.js +283 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +16 -0
- package/dist/inference/byo.svelte.d.ts +90 -0
- package/dist/inference/byo.svelte.js +295 -0
- package/dist/inference/config.d.ts +77 -0
- package/dist/inference/config.js +205 -0
- package/dist/inference/host.d.ts +40 -0
- package/dist/inference/host.js +57 -0
- package/dist/inference/openai.d.ts +59 -0
- package/dist/inference/openai.js +207 -0
- package/dist/inference/presets.d.ts +5 -0
- package/dist/inference/presets.js +46 -0
- package/dist/kitchen/client.d.ts +39 -0
- package/dist/kitchen/client.js +115 -0
- package/dist/kitchen/fragment.d.ts +30 -0
- package/dist/kitchen/fragment.js +49 -0
- package/dist/kitchen/state.svelte.d.ts +26 -0
- package/dist/kitchen/state.svelte.js +45 -0
- package/dist/library/apply.d.ts +17 -0
- package/dist/library/apply.js +32 -0
- package/dist/library/document.d.ts +12 -0
- package/dist/library/document.js +27 -0
- package/dist/library/icons.d.ts +6 -0
- package/dist/library/icons.js +26 -0
- package/dist/library/index.d.ts +8 -0
- package/dist/library/index.js +12 -0
- package/dist/library/library.json +788 -0
- package/dist/library/menu.d.ts +18 -0
- package/dist/library/menu.js +72 -0
- package/dist/library/state.svelte.d.ts +10 -0
- package/dist/library/state.svelte.js +28 -0
- package/dist/library/types.d.ts +57 -0
- package/dist/library/types.js +1 -0
- package/dist/overviews/definitions.d.ts +24 -0
- package/dist/overviews/definitions.js +97 -0
- package/dist/overviews/page.d.ts +21 -0
- package/dist/overviews/page.js +36 -0
- package/dist/overviews/registry.d.ts +44 -0
- package/dist/overviews/registry.js +191 -0
- package/dist/overviews/validate.d.ts +32 -0
- package/dist/overviews/validate.js +91 -0
- package/dist/planner/Planner.svelte +204 -0
- package/dist/planner/Planner.svelte.d.ts +4 -0
- package/dist/planner/app.svelte.d.ts +6 -0
- package/dist/planner/app.svelte.js +23 -0
- package/dist/planner/assistant.d.ts +46 -0
- package/dist/planner/assistant.js +122 -0
- package/dist/planner/commands/adapter.d.ts +121 -0
- package/dist/planner/commands/adapter.js +597 -0
- package/dist/planner/commands/catalog.d.ts +19 -0
- package/dist/planner/commands/catalog.js +54 -0
- package/dist/planner/commands/controller.svelte.d.ts +13 -0
- package/dist/planner/commands/controller.svelte.js +77 -0
- package/dist/planner/commands/index.d.ts +15 -0
- package/dist/planner/commands/index.js +15 -0
- package/dist/planner/commands/schemas.d.ts +25 -0
- package/dist/planner/commands/schemas.js +67 -0
- package/dist/planner/commands/slices.d.ts +18 -0
- package/dist/planner/commands/slices.js +49 -0
- package/dist/planner/commands/types.d.ts +80 -0
- package/dist/planner/commands/types.js +18 -0
- package/dist/planner/create.d.ts +4 -0
- package/dist/planner/create.js +22 -0
- package/dist/planner/instance.d.ts +15 -0
- package/dist/planner/instance.js +22 -0
- package/dist/planner/query.d.ts +16 -0
- package/dist/planner/query.js +28 -0
- package/dist/planner/selection.d.ts +15 -0
- package/dist/planner/selection.js +38 -0
- package/dist/planner/selection.svelte.d.ts +29 -0
- package/dist/planner/selection.svelte.js +54 -0
- package/dist/planner/tab.svelte.d.ts +11 -0
- package/dist/planner/tab.svelte.js +22 -0
- package/dist/planner/types.d.ts +41 -0
- package/dist/planner/types.js +1 -0
- package/dist/recipes/cards.d.ts +55 -0
- package/dist/recipes/cards.js +80 -0
- package/dist/recipes/features.d.ts +53 -0
- package/dist/recipes/features.js +97 -0
- package/dist/recipes/help/descriptions.json +373 -0
- package/dist/recipes/help.d.ts +121 -0
- package/dist/recipes/help.js +262 -0
- package/dist/recipes/index.d.ts +65 -0
- package/dist/recipes/index.js +95 -0
- package/dist/recipes/merge.d.ts +26 -0
- package/dist/recipes/merge.js +21 -0
- package/dist/recipes/overlay.json +409 -0
- package/dist/recipes/plan-data.d.ts +41 -0
- package/dist/recipes/plan-data.js +97 -0
- package/dist/recipes/plumbing.d.ts +70 -0
- package/dist/recipes/plumbing.js +185 -0
- package/dist/recipes/policy.d.ts +118 -0
- package/dist/recipes/policy.js +268 -0
- package/dist/recipes/resolve.d.ts +19 -0
- package/dist/recipes/resolve.js +65 -0
- package/dist/recipes/scope.d.ts +25 -0
- package/dist/recipes/scope.js +31 -0
- package/dist/recipes/sections.d.ts +49 -0
- package/dist/recipes/sections.js +84 -0
- package/dist/recipes/state.svelte.d.ts +67 -0
- package/dist/recipes/state.svelte.js +112 -0
- package/dist/recipes/types.d.ts +322 -0
- package/dist/recipes/types.js +8 -0
- package/dist/sections/entries.d.ts +30 -0
- package/dist/sections/entries.js +57 -0
- package/dist/sections/info.d.ts +16 -0
- package/dist/sections/info.js +39 -0
- package/dist/sections/path.d.ts +12 -0
- package/dist/sections/path.js +18 -0
- package/dist/settings/app-settings.d.ts +44 -0
- package/dist/settings/app-settings.js +138 -0
- package/dist/settings/currencies.d.ts +2 -0
- package/dist/settings/currencies.js +8 -0
- package/dist/theme/runtime.d.ts +14 -0
- package/dist/theme/runtime.js +27 -0
- package/dist/theme/theme.d.ts +47 -0
- package/dist/theme/theme.js +122 -0
- package/dist/upstream/CustomerSelect.svelte +60 -0
- package/dist/upstream/CustomerSelect.svelte.d.ts +17 -0
- package/dist/upstream/VendorSelect.svelte +60 -0
- package/dist/upstream/VendorSelect.svelte.d.ts +17 -0
- package/dist/upstream/overlay.d.ts +10 -0
- package/dist/upstream/overlay.js +49 -0
- package/dist/upstream/partySelect.d.ts +8 -0
- package/dist/upstream/partySelect.js +21 -0
- package/dist/upstream/partyTypes.d.ts +64 -0
- package/dist/upstream/partyTypes.js +8 -0
- package/dist/upstream/relations.d.ts +2 -0
- package/dist/upstream/relations.js +24 -0
- package/dist/upstream/selects.d.ts +26 -0
- package/dist/upstream/selects.js +20 -0
- package/dist/upstream/widgets.d.ts +20 -0
- package/dist/upstream/widgets.js +30 -0
- package/package.json +81 -3
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
import { canonical, createCookbookEngine, isEmptyCookbook, } from '@happyvertical/smrt-core/cookbook/engine';
|
|
2
|
+
import { checkSchema, toolsFor } from "./schemas.js";
|
|
3
|
+
import { PLANNER_TAB_IDS, } from "./types.js";
|
|
4
|
+
/** A plain cell. */
|
|
5
|
+
export function cell(initial) {
|
|
6
|
+
let value = initial;
|
|
7
|
+
return {
|
|
8
|
+
get: () => value,
|
|
9
|
+
set: (next) => {
|
|
10
|
+
value = next;
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
const err = (code, message, extra = {}) => ({ code, message, ...extra });
|
|
15
|
+
const fail = (error, id) => ({
|
|
16
|
+
ok: false,
|
|
17
|
+
...(id !== undefined ? { id } : {}),
|
|
18
|
+
error,
|
|
19
|
+
});
|
|
20
|
+
const isObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
21
|
+
const REPLACING = new Set(['apply_cookbook', 'import_cookbook']);
|
|
22
|
+
const message = (cause) => cause instanceof Error ? cause.message : String(cause);
|
|
23
|
+
/** The document without `overviews`: page edits are not plan changes. */
|
|
24
|
+
function signature(doc, applied) {
|
|
25
|
+
if (!isObject(doc))
|
|
26
|
+
return JSON.stringify([applied, doc ?? null]);
|
|
27
|
+
const { overviews: _overviews, ...rest } = doc;
|
|
28
|
+
return JSON.stringify([applied, rest]);
|
|
29
|
+
}
|
|
30
|
+
export function createPlannerAdapter(config) {
|
|
31
|
+
const { catalog, port, options = {}, env = {} } = config;
|
|
32
|
+
const section = env.section ?? cell(null);
|
|
33
|
+
const tab = env.tab ?? cell(null);
|
|
34
|
+
const tools = toolsFor(catalog);
|
|
35
|
+
const schemaOf = (name) => tools.find((tool) => tool.name === name)?.inputSchema;
|
|
36
|
+
const focusSchema = schemaOf('focus');
|
|
37
|
+
const undoSchema = schemaOf('undo');
|
|
38
|
+
let engine;
|
|
39
|
+
let lastKey = '';
|
|
40
|
+
/** Why the app's document could not be adopted; commands fail until it can. */
|
|
41
|
+
let syncError = null;
|
|
42
|
+
/** Undo ids the outside has seen, by the engine's own id; closed on a new epoch. */
|
|
43
|
+
let outward = new Map();
|
|
44
|
+
let inward = new Map();
|
|
45
|
+
let undoCounter = 0;
|
|
46
|
+
const listeners = new Map();
|
|
47
|
+
const resolvedApplied = () => port?.applied?.() ?? null;
|
|
48
|
+
const currentTab = () => options.navigation?.getTab() ?? tab.get();
|
|
49
|
+
function start() {
|
|
50
|
+
if (!port?.read) {
|
|
51
|
+
// Headless: the given document is the plan, and a bad one is the caller's error.
|
|
52
|
+
engine = createCookbookEngine(config.cookbook === undefined
|
|
53
|
+
? { catalog }
|
|
54
|
+
: {
|
|
55
|
+
catalog,
|
|
56
|
+
state: {
|
|
57
|
+
version: 1,
|
|
58
|
+
revision: 0,
|
|
59
|
+
applied: null,
|
|
60
|
+
cookbook: config.cookbook,
|
|
61
|
+
journal: [],
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const given = port.read();
|
|
67
|
+
lastKey = signature(given, resolvedApplied());
|
|
68
|
+
try {
|
|
69
|
+
engine = createCookbookEngine({
|
|
70
|
+
catalog,
|
|
71
|
+
state: {
|
|
72
|
+
version: 1,
|
|
73
|
+
revision: 0,
|
|
74
|
+
applied: resolvedApplied(),
|
|
75
|
+
cookbook: given,
|
|
76
|
+
journal: [],
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
catch (cause) {
|
|
81
|
+
// The app's document is not one the engine accepts: start empty, say so.
|
|
82
|
+
engine = createCookbookEngine({ catalog });
|
|
83
|
+
syncError = message(cause);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
start();
|
|
87
|
+
/** The app edited the document by hand: a new epoch, one revision on. */
|
|
88
|
+
function adoptManualEdit(doc, key) {
|
|
89
|
+
const state = engine.state();
|
|
90
|
+
try {
|
|
91
|
+
engine = createCookbookEngine({
|
|
92
|
+
catalog,
|
|
93
|
+
state: {
|
|
94
|
+
version: 1,
|
|
95
|
+
revision: state.revision + 1,
|
|
96
|
+
applied: resolvedApplied(),
|
|
97
|
+
cookbook: doc,
|
|
98
|
+
journal: state.journal,
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
syncError = null;
|
|
102
|
+
}
|
|
103
|
+
catch (cause) {
|
|
104
|
+
// Keep the engine as it was; commands answer `failed` until the document is valid.
|
|
105
|
+
syncError = message(cause);
|
|
106
|
+
}
|
|
107
|
+
outward = new Map();
|
|
108
|
+
inward = new Map();
|
|
109
|
+
lastKey = key;
|
|
110
|
+
}
|
|
111
|
+
/** Compare the app's document with the engine's; adopt a difference. Never throws. */
|
|
112
|
+
function sync() {
|
|
113
|
+
if (!port?.read)
|
|
114
|
+
return;
|
|
115
|
+
try {
|
|
116
|
+
const doc = port.read();
|
|
117
|
+
const key = signature(doc, resolvedApplied());
|
|
118
|
+
if (key === lastKey)
|
|
119
|
+
return;
|
|
120
|
+
adoptManualEdit(doc, key);
|
|
121
|
+
}
|
|
122
|
+
catch (cause) {
|
|
123
|
+
syncError = message(cause);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const syncFailureError = () => err('failed', `The app's document is not one the planner can read (${syncError}). Fix it or reset the cookbook, then try again.`);
|
|
127
|
+
const syncFailure = (id) => fail(syncFailureError(), id);
|
|
128
|
+
function undoIdOut(inner) {
|
|
129
|
+
if (!inner)
|
|
130
|
+
return undefined;
|
|
131
|
+
let id = outward.get(inner);
|
|
132
|
+
if (!id) {
|
|
133
|
+
id = `undo-${++undoCounter}`;
|
|
134
|
+
outward.set(inner, id);
|
|
135
|
+
inward.set(id, inner);
|
|
136
|
+
}
|
|
137
|
+
return id;
|
|
138
|
+
}
|
|
139
|
+
/** Forget undo ids the engine no longer holds (used or past its cap). */
|
|
140
|
+
function pruneUndoIds(live) {
|
|
141
|
+
const keep = new Set(live);
|
|
142
|
+
for (const [inner, id] of outward) {
|
|
143
|
+
if (keep.has(inner))
|
|
144
|
+
continue;
|
|
145
|
+
outward.delete(inner);
|
|
146
|
+
inward.delete(id);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const withView = (base) => ({
|
|
150
|
+
...base,
|
|
151
|
+
undo: base.undo.map((id) => undoIdOut(id)),
|
|
152
|
+
focus: { tab: currentTab(), section: section.get() },
|
|
153
|
+
});
|
|
154
|
+
function build() {
|
|
155
|
+
const base = engine.snapshot();
|
|
156
|
+
pruneUndoIds(base.undo);
|
|
157
|
+
return withView(base);
|
|
158
|
+
}
|
|
159
|
+
/** The engine's document with the app's live page customisations. */
|
|
160
|
+
function liveDocument(doc) {
|
|
161
|
+
if (!port?.read)
|
|
162
|
+
return doc;
|
|
163
|
+
try {
|
|
164
|
+
const live = port.read();
|
|
165
|
+
const overviews = isObject(live) ? live.overviews : undefined;
|
|
166
|
+
const { overviews: _stale, ...rest } = doc;
|
|
167
|
+
return canonical((isObject(overviews) && Object.keys(overviews).length
|
|
168
|
+
? { ...rest, overviews }
|
|
169
|
+
: rest));
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
return doc;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function decorate(result) {
|
|
176
|
+
if (!result.ok)
|
|
177
|
+
return result;
|
|
178
|
+
const { receipt } = result;
|
|
179
|
+
// A replay answers an earlier epoch's change: its undo id may now name another.
|
|
180
|
+
const undoId = result.replayed ? undefined : undoIdOut(receipt.undoId);
|
|
181
|
+
const { undoId: _drop, ...rest } = receipt;
|
|
182
|
+
let data = result.data;
|
|
183
|
+
if (receipt.name === 'export_cookbook' &&
|
|
184
|
+
isObject(data) &&
|
|
185
|
+
!result.replayed) {
|
|
186
|
+
const cookbook = liveDocument(data.cookbook);
|
|
187
|
+
data = {
|
|
188
|
+
...data,
|
|
189
|
+
cookbook,
|
|
190
|
+
text: `${JSON.stringify(cookbook, null, 2)}\n`,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
...result,
|
|
195
|
+
...(data !== undefined ? { data } : {}),
|
|
196
|
+
snapshot: build(),
|
|
197
|
+
receipt: { ...rest, ...(undoId ? { undoId } : {}) },
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
/** Hand the engine's document to the app after a change. */
|
|
201
|
+
function commit(commands, appliedBefore) {
|
|
202
|
+
if (!port?.write)
|
|
203
|
+
return;
|
|
204
|
+
const applied = engine.snapshot().app.cookbook;
|
|
205
|
+
const libraryApplied = commands.includes('apply_cookbook') ||
|
|
206
|
+
(applied !== null && applied !== appliedBefore);
|
|
207
|
+
port.write(engine.cookbook(), {
|
|
208
|
+
commands,
|
|
209
|
+
replaced: commands.some((name) => REPLACING.has(name)),
|
|
210
|
+
applied,
|
|
211
|
+
libraryApplied,
|
|
212
|
+
});
|
|
213
|
+
if (port.read)
|
|
214
|
+
lastKey = signature(port.read(), resolvedApplied());
|
|
215
|
+
if (libraryApplied)
|
|
216
|
+
options.onReplaced?.();
|
|
217
|
+
}
|
|
218
|
+
function deliver() {
|
|
219
|
+
if (!listeners.size)
|
|
220
|
+
return;
|
|
221
|
+
sync();
|
|
222
|
+
const current = build();
|
|
223
|
+
const full = JSON.stringify(current);
|
|
224
|
+
for (const [listener, last] of listeners) {
|
|
225
|
+
if (last === full)
|
|
226
|
+
continue;
|
|
227
|
+
listeners.set(listener, full);
|
|
228
|
+
listener(current);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
/** `id`, `expectedRevision` and stray keys, checked as the engine checks them. */
|
|
232
|
+
function checkEnvelope(raw, runOptions) {
|
|
233
|
+
for (const key of Object.keys(raw)) {
|
|
234
|
+
if (!['name', 'input', 'id', 'expectedRevision'].includes(key)) {
|
|
235
|
+
return err('invalid_input', `${key} is not part of a command.`, {
|
|
236
|
+
path: key,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
const { id } = raw;
|
|
241
|
+
if (id !== undefined &&
|
|
242
|
+
!(typeof id === 'string' && id.length > 0 && id.length <= 200)) {
|
|
243
|
+
return err('invalid_input', 'id must be a non-empty string of at most 200 characters.', { path: 'id' });
|
|
244
|
+
}
|
|
245
|
+
const expected = raw.expectedRevision ?? runOptions.expectedRevision;
|
|
246
|
+
if (expected !== undefined &&
|
|
247
|
+
!(Number.isInteger(expected) && expected >= 0)) {
|
|
248
|
+
return err('invalid_input', 'expectedRevision must be a whole number.', {
|
|
249
|
+
path: 'expectedRevision',
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
function runFocus(raw, runOptions) {
|
|
255
|
+
const bad = checkEnvelope(raw, runOptions);
|
|
256
|
+
const id = typeof raw.id === 'string' ? raw.id : undefined;
|
|
257
|
+
if (bad)
|
|
258
|
+
return fail(bad, id);
|
|
259
|
+
const expected = raw.expectedRevision ?? runOptions.expectedRevision;
|
|
260
|
+
const input = (raw.input ?? {});
|
|
261
|
+
const problem = checkSchema(focusSchema, input);
|
|
262
|
+
if (problem)
|
|
263
|
+
return fail(err('invalid_input', problem, { path: 'input' }), id);
|
|
264
|
+
const revision = engine.snapshot().revision;
|
|
265
|
+
if (expected !== undefined && expected !== revision) {
|
|
266
|
+
return fail(err('conflict', `The plan is at revision ${revision}, not ${expected}. Read the snapshot and try again.`, {
|
|
267
|
+
details: { expectedRevision: expected, currentRevision: revision },
|
|
268
|
+
}), id);
|
|
269
|
+
}
|
|
270
|
+
if (input.section !== undefined) {
|
|
271
|
+
const known = build().sections.some((s) => s.id === input.section);
|
|
272
|
+
if (!known) {
|
|
273
|
+
return fail(err('not_found', `No menu section "${input.section}".`, {
|
|
274
|
+
path: 'input.section',
|
|
275
|
+
}), id);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
let changed = false;
|
|
279
|
+
if (input.tab && PLANNER_TAB_IDS.includes(input.tab)) {
|
|
280
|
+
changed ||= currentTab() !== input.tab;
|
|
281
|
+
tab.set(input.tab);
|
|
282
|
+
options.navigation?.setTab(input.tab);
|
|
283
|
+
}
|
|
284
|
+
if (input.section !== undefined) {
|
|
285
|
+
changed ||= section.get() !== input.section;
|
|
286
|
+
section.set(input.section);
|
|
287
|
+
options.navigation?.setSection?.(input.section);
|
|
288
|
+
}
|
|
289
|
+
const result = {
|
|
290
|
+
ok: true,
|
|
291
|
+
...(id !== undefined ? { id } : {}),
|
|
292
|
+
snapshot: build(),
|
|
293
|
+
receipt: {
|
|
294
|
+
name: 'focus',
|
|
295
|
+
...(id !== undefined ? { id } : {}),
|
|
296
|
+
summary: '',
|
|
297
|
+
changed,
|
|
298
|
+
revisionBefore: revision,
|
|
299
|
+
revisionAfter: revision,
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
deliver();
|
|
303
|
+
return result;
|
|
304
|
+
}
|
|
305
|
+
/** The planner's strict import check, before the engine's. */
|
|
306
|
+
function prepareImport(raw) {
|
|
307
|
+
const input = raw.input;
|
|
308
|
+
if (!port?.prepareImport || !isObject(input))
|
|
309
|
+
return { raw };
|
|
310
|
+
const checked = port.prepareImport(input.document);
|
|
311
|
+
if (!checked.ok) {
|
|
312
|
+
return fail(err('invalid_input', checked.error, { path: 'input.document' }), raw.id);
|
|
313
|
+
}
|
|
314
|
+
return {
|
|
315
|
+
raw: { ...raw, input: { ...input, document: checked.cookbook } },
|
|
316
|
+
dropped: checked.dropped,
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Replacing a whole app needs `replace: true` unless the app holds nothing.
|
|
321
|
+
* The engine checks its own copy, which can lack page customisations the app
|
|
322
|
+
* has (they are edited outside the plan). Before such a command, if the app
|
|
323
|
+
* holds something the engine's copy does not, adopt the app's document (same
|
|
324
|
+
* revision) so the engine's own refusal, in its own order of checks, is right.
|
|
325
|
+
*/
|
|
326
|
+
function alignForReplace(names) {
|
|
327
|
+
if (!port?.read ||
|
|
328
|
+
!names.some((n) => typeof n === 'string' && REPLACING.has(n))) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
try {
|
|
332
|
+
const app = port.read();
|
|
333
|
+
if (isEmptyCookbook(engine.cookbook()) &&
|
|
334
|
+
!isEmptyCookbook(app)) {
|
|
335
|
+
const state = engine.state();
|
|
336
|
+
engine = createCookbookEngine({
|
|
337
|
+
catalog,
|
|
338
|
+
state: {
|
|
339
|
+
version: 1,
|
|
340
|
+
revision: state.revision,
|
|
341
|
+
applied: resolvedApplied(),
|
|
342
|
+
cookbook: app,
|
|
343
|
+
journal: state.journal,
|
|
344
|
+
},
|
|
345
|
+
});
|
|
346
|
+
outward = new Map();
|
|
347
|
+
inward = new Map();
|
|
348
|
+
lastKey = signature(app, resolvedApplied());
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
catch (cause) {
|
|
352
|
+
syncError = message(cause);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
function run(command, runOptions = {}) {
|
|
356
|
+
try {
|
|
357
|
+
sync();
|
|
358
|
+
if (syncError) {
|
|
359
|
+
return syncFailure(isObject(command) && typeof command.id === 'string'
|
|
360
|
+
? command.id
|
|
361
|
+
: undefined);
|
|
362
|
+
}
|
|
363
|
+
if (!isObject(command)) {
|
|
364
|
+
return decorate(engine.run(command, runOptions));
|
|
365
|
+
}
|
|
366
|
+
if (command.name === 'focus')
|
|
367
|
+
return runFocus(command, runOptions);
|
|
368
|
+
alignForReplace([command.name]);
|
|
369
|
+
if (syncError) {
|
|
370
|
+
return syncFailure(typeof command.id === 'string' ? command.id : undefined);
|
|
371
|
+
}
|
|
372
|
+
let raw = command;
|
|
373
|
+
let dropped;
|
|
374
|
+
if (command.name === 'import_cookbook') {
|
|
375
|
+
const prepared = prepareImport(command);
|
|
376
|
+
if ('ok' in prepared)
|
|
377
|
+
return prepared;
|
|
378
|
+
raw = prepared.raw;
|
|
379
|
+
dropped = prepared.dropped;
|
|
380
|
+
}
|
|
381
|
+
const appliedBefore = engine.snapshot().app.cookbook;
|
|
382
|
+
const keepTheme = themeToKeep(raw);
|
|
383
|
+
const result = keepTheme
|
|
384
|
+
? runKeepingTheme(raw, runOptions, keepTheme)
|
|
385
|
+
: decorate(engine.run(raw, runOptions));
|
|
386
|
+
if (!result.ok)
|
|
387
|
+
return result;
|
|
388
|
+
if (!result.replayed && result.receipt.changed) {
|
|
389
|
+
commit([String(raw.name)], appliedBefore);
|
|
390
|
+
}
|
|
391
|
+
let finished = result;
|
|
392
|
+
if (dropped?.length) {
|
|
393
|
+
finished = {
|
|
394
|
+
...result,
|
|
395
|
+
receipt: {
|
|
396
|
+
...result.receipt,
|
|
397
|
+
warnings: [
|
|
398
|
+
...(result.receipt.warnings ?? []),
|
|
399
|
+
...dropped.map((note) => `Not imported: ${note}`),
|
|
400
|
+
],
|
|
401
|
+
},
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
deliver();
|
|
405
|
+
return finished.ok ? { ...finished, snapshot: build() } : finished;
|
|
406
|
+
}
|
|
407
|
+
catch (cause) {
|
|
408
|
+
return fail(err('failed', message(cause)));
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Applying a library cookbook that sets no theme keeps the person's own look
|
|
413
|
+
* (as the Cookbooks tab does): the preset, brand colour and colour scheme
|
|
414
|
+
* (the font is not carried; `set_theme` has no font). Returns the patch.
|
|
415
|
+
*/
|
|
416
|
+
function themeToKeep(raw) {
|
|
417
|
+
const input = raw.input;
|
|
418
|
+
if (raw.name !== 'apply_cookbook' || !isObject(input))
|
|
419
|
+
return undefined;
|
|
420
|
+
const book = catalog.cookbooks?.find((c) => c.id === input.id);
|
|
421
|
+
if (!book || book.document.theme)
|
|
422
|
+
return undefined;
|
|
423
|
+
const theme = engine.cookbook().theme;
|
|
424
|
+
if (!theme)
|
|
425
|
+
return undefined;
|
|
426
|
+
const patch = {};
|
|
427
|
+
if (theme.preset)
|
|
428
|
+
patch.preset = theme.preset;
|
|
429
|
+
if (theme.custom?.primary)
|
|
430
|
+
patch.primary = theme.custom.primary;
|
|
431
|
+
if (theme.colorScheme)
|
|
432
|
+
patch.colorScheme = theme.colorScheme;
|
|
433
|
+
return Object.keys(patch).length ? patch : undefined;
|
|
434
|
+
}
|
|
435
|
+
function runKeepingTheme(raw, runOptions, patch) {
|
|
436
|
+
const batch = engine.batch({
|
|
437
|
+
...(raw.id !== undefined ? { id: raw.id } : {}),
|
|
438
|
+
expectedRevision: raw.expectedRevision ?? runOptions.expectedRevision,
|
|
439
|
+
commands: [raw, { name: 'set_theme', input: patch }].map(({ id: _id, expectedRevision: _rev, ...command }) => command),
|
|
440
|
+
});
|
|
441
|
+
if (!batch.ok) {
|
|
442
|
+
const cause = batch.error.details?.cause;
|
|
443
|
+
return fail(batch.error.code === 'batch_failed' && cause ? cause : batch.error, raw.id);
|
|
444
|
+
}
|
|
445
|
+
const first = batch.results[0];
|
|
446
|
+
const undoId = batch.replayed ? undefined : undoIdOut(batch.receipt.undoId);
|
|
447
|
+
return {
|
|
448
|
+
...first,
|
|
449
|
+
...(batch.id !== undefined ? { id: batch.id } : {}),
|
|
450
|
+
...(batch.replayed ? { replayed: true } : {}),
|
|
451
|
+
snapshot: build(),
|
|
452
|
+
receipt: {
|
|
453
|
+
...first.receipt,
|
|
454
|
+
...(batch.id !== undefined ? { id: batch.id } : {}),
|
|
455
|
+
revisionBefore: batch.receipt.revisionBefore,
|
|
456
|
+
revisionAfter: batch.receipt.revisionAfter,
|
|
457
|
+
changed: batch.receipt.changed,
|
|
458
|
+
...(undoId ? { undoId } : {}),
|
|
459
|
+
},
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
function batch(input) {
|
|
463
|
+
try {
|
|
464
|
+
sync();
|
|
465
|
+
if (syncError) {
|
|
466
|
+
return {
|
|
467
|
+
ok: false,
|
|
468
|
+
error: syncFailureError(),
|
|
469
|
+
snapshot: build(),
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
const commands = isObject(input) && Array.isArray(input.commands) ? input.commands : [];
|
|
473
|
+
alignForReplace(commands.map((c) => (isObject(c) ? c.name : undefined)));
|
|
474
|
+
if (syncError) {
|
|
475
|
+
return { ok: false, error: syncFailureError(), snapshot: build() };
|
|
476
|
+
}
|
|
477
|
+
const appliedBefore = engine.snapshot().app.cookbook;
|
|
478
|
+
const result = engine.batch(input);
|
|
479
|
+
if (!result.ok) {
|
|
480
|
+
return { ...result, snapshot: build() };
|
|
481
|
+
}
|
|
482
|
+
if (!result.replayed && result.receipt.changed) {
|
|
483
|
+
commit(commands.map((c) => String(c?.name)), appliedBefore);
|
|
484
|
+
}
|
|
485
|
+
const undoId = result.replayed
|
|
486
|
+
? undefined
|
|
487
|
+
: undoIdOut(result.receipt.undoId);
|
|
488
|
+
const { undoId: _drop, ...receipt } = result.receipt;
|
|
489
|
+
const current = build();
|
|
490
|
+
const out = {
|
|
491
|
+
...result,
|
|
492
|
+
snapshot: current,
|
|
493
|
+
receipt: { ...receipt, ...(undoId ? { undoId } : {}) },
|
|
494
|
+
results: result.results.map((item) => ({
|
|
495
|
+
...item,
|
|
496
|
+
snapshot: result.replayed ? current : withView(item.snapshot),
|
|
497
|
+
})),
|
|
498
|
+
};
|
|
499
|
+
deliver();
|
|
500
|
+
return out;
|
|
501
|
+
}
|
|
502
|
+
catch (cause) {
|
|
503
|
+
return {
|
|
504
|
+
ok: false,
|
|
505
|
+
error: err('failed', message(cause)),
|
|
506
|
+
snapshot: build(),
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
function untranslate(raw) {
|
|
511
|
+
if (!isObject(raw) || raw.name !== 'undo' || !isObject(raw.input))
|
|
512
|
+
return raw;
|
|
513
|
+
const id = raw.input.undoId;
|
|
514
|
+
if (typeof id !== 'string')
|
|
515
|
+
return raw;
|
|
516
|
+
return { ...raw, input: { ...raw.input, undoId: inward.get(id) ?? '' } };
|
|
517
|
+
}
|
|
518
|
+
/** The engine's refusal names its own undo id; say the one the caller sent. */
|
|
519
|
+
function reword(result, given) {
|
|
520
|
+
if (result.ok || result.error.code !== 'not_found')
|
|
521
|
+
return result;
|
|
522
|
+
const inner = inward.get(given);
|
|
523
|
+
return inner
|
|
524
|
+
? {
|
|
525
|
+
...result,
|
|
526
|
+
error: {
|
|
527
|
+
...result.error,
|
|
528
|
+
message: result.error.message.replace(`"${inner}"`, `"${given}"`),
|
|
529
|
+
},
|
|
530
|
+
}
|
|
531
|
+
: result;
|
|
532
|
+
}
|
|
533
|
+
const runWithUndo = (command, runOptions) => {
|
|
534
|
+
// An undo id from an earlier epoch (or never issued) names nothing.
|
|
535
|
+
if (isObject(command) &&
|
|
536
|
+
command.name === 'undo' &&
|
|
537
|
+
isObject(command.input)) {
|
|
538
|
+
const given = command.input.undoId;
|
|
539
|
+
if (typeof given === 'string' &&
|
|
540
|
+
checkSchema(undoSchema, command.input) === null) {
|
|
541
|
+
sync();
|
|
542
|
+
build();
|
|
543
|
+
if (!inward.has(given)) {
|
|
544
|
+
return fail(err('not_found', `Nothing to undo for "${given}".`, {
|
|
545
|
+
path: 'input.undoId',
|
|
546
|
+
}), command.id);
|
|
547
|
+
}
|
|
548
|
+
return reword(run(untranslate(command), runOptions), given);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
return run(untranslate(command), runOptions);
|
|
552
|
+
};
|
|
553
|
+
return {
|
|
554
|
+
run: runWithUndo,
|
|
555
|
+
batch,
|
|
556
|
+
snapshot() {
|
|
557
|
+
sync();
|
|
558
|
+
return build();
|
|
559
|
+
},
|
|
560
|
+
cookbook() {
|
|
561
|
+
sync();
|
|
562
|
+
return liveDocument(engine.cookbook());
|
|
563
|
+
},
|
|
564
|
+
undo() {
|
|
565
|
+
sync();
|
|
566
|
+
const last = build().undo.at(-1);
|
|
567
|
+
if (!last) {
|
|
568
|
+
return fail(err('not_found', 'Nothing to undo.'));
|
|
569
|
+
}
|
|
570
|
+
return runWithUndo({ name: 'undo', input: { undoId: last } });
|
|
571
|
+
},
|
|
572
|
+
state: () => engine.state(),
|
|
573
|
+
get tools() {
|
|
574
|
+
return tools;
|
|
575
|
+
},
|
|
576
|
+
get batchTool() {
|
|
577
|
+
return engine.batchTool;
|
|
578
|
+
},
|
|
579
|
+
observe() {
|
|
580
|
+
sync();
|
|
581
|
+
return JSON.stringify(build());
|
|
582
|
+
},
|
|
583
|
+
deliver,
|
|
584
|
+
subscribe(listener) {
|
|
585
|
+
env.watch?.start();
|
|
586
|
+
sync();
|
|
587
|
+
const current = build();
|
|
588
|
+
listeners.set(listener, JSON.stringify(current));
|
|
589
|
+
listener(current);
|
|
590
|
+
return () => {
|
|
591
|
+
listeners.delete(listener);
|
|
592
|
+
if (!listeners.size)
|
|
593
|
+
env.watch?.stop();
|
|
594
|
+
};
|
|
595
|
+
},
|
|
596
|
+
};
|
|
597
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { EngineCatalog } from '@happyvertical/smrt-core/cookbook/engine';
|
|
2
|
+
/**
|
|
3
|
+
* The planner's own data as the engine's catalog: the recipes (the published
|
|
4
|
+
* packages' plus the planner-local `forms`), every catalog model, the library
|
|
5
|
+
* cookbooks, the smrt-ui presets and the currencies. The engine bundles none of
|
|
6
|
+
* it; a host with a different catalog builds its own `EngineCatalog`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildEngineCatalog(): EngineCatalog;
|
|
9
|
+
/** The planner's engine catalog, built once. */
|
|
10
|
+
export declare function engineCatalog(): EngineCatalog;
|
|
11
|
+
/** The catalog narrowed to the given recipe and library cookbook ids. */
|
|
12
|
+
export declare function restrictCatalog(base: EngineCatalog, allowed: {
|
|
13
|
+
recipes: readonly {
|
|
14
|
+
id: string;
|
|
15
|
+
}[];
|
|
16
|
+
cookbooks: readonly {
|
|
17
|
+
id: string;
|
|
18
|
+
}[];
|
|
19
|
+
}): EngineCatalog;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { catalog } from "../../catalog/index.js";
|
|
2
|
+
import { libraryCookbooks } from "../../library/index.js";
|
|
3
|
+
import { recipes } from "../../recipes/index.js";
|
|
4
|
+
import { SETTING_TARGETS } from "../../settings/app-settings.js";
|
|
5
|
+
import { CURRENCY_CODES } from "../../settings/currencies.js";
|
|
6
|
+
import { THEME_PRESETS } from "../../theme/theme.js";
|
|
7
|
+
/**
|
|
8
|
+
* The planner's own data as the engine's catalog: the recipes (the published
|
|
9
|
+
* packages' plus the planner-local `forms`), every catalog model, the library
|
|
10
|
+
* cookbooks, the smrt-ui presets and the currencies. The engine bundles none of
|
|
11
|
+
* it; a host with a different catalog builds its own `EngineCatalog`.
|
|
12
|
+
*/
|
|
13
|
+
export function buildEngineCatalog() {
|
|
14
|
+
const models = catalog.packages.flatMap((pkg) => pkg.models.map((model) => ({
|
|
15
|
+
id: model.id,
|
|
16
|
+
name: model.name,
|
|
17
|
+
packageId: pkg.id,
|
|
18
|
+
...(model.description ? { description: model.description } : {}),
|
|
19
|
+
exposed: model.exposed,
|
|
20
|
+
fields: model.fields.map((field) => ({
|
|
21
|
+
name: field.name,
|
|
22
|
+
...(field.system ? { system: true } : {}),
|
|
23
|
+
...(field.default !== undefined ? { default: field.default } : {}),
|
|
24
|
+
})),
|
|
25
|
+
})));
|
|
26
|
+
return {
|
|
27
|
+
recipes,
|
|
28
|
+
models,
|
|
29
|
+
cookbooks: libraryCookbooks.map((cookbook) => ({
|
|
30
|
+
id: cookbook.id,
|
|
31
|
+
name: cookbook.name,
|
|
32
|
+
document: cookbook.document,
|
|
33
|
+
})),
|
|
34
|
+
themePresets: THEME_PRESETS,
|
|
35
|
+
currencies: [...CURRENCY_CODES],
|
|
36
|
+
settingTargets: SETTING_TARGETS,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
let cached;
|
|
40
|
+
/** The planner's engine catalog, built once. */
|
|
41
|
+
export function engineCatalog() {
|
|
42
|
+
cached ??= buildEngineCatalog();
|
|
43
|
+
return cached;
|
|
44
|
+
}
|
|
45
|
+
/** The catalog narrowed to the given recipe and library cookbook ids. */
|
|
46
|
+
export function restrictCatalog(base, allowed) {
|
|
47
|
+
const recipeIds = new Set(allowed.recipes.map((r) => r.id));
|
|
48
|
+
const cookbookIds = new Set(allowed.cookbooks.map((c) => c.id));
|
|
49
|
+
return {
|
|
50
|
+
...base,
|
|
51
|
+
recipes: base.recipes.filter((r) => recipeIds.has(r.id)),
|
|
52
|
+
cookbooks: (base.cookbooks ?? []).filter((c) => cookbookIds.has(c.id)),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CookbookStore } from '../../cookbook/store.svelte.ts';
|
|
2
|
+
import { type PlannerAdapter, type PlannerController, type PlannerControllerOptions, type PlannerPort } from './adapter.ts';
|
|
3
|
+
export type { PlannerController, PlannerControllerOptions, PlannerNavigation, } from './adapter.ts';
|
|
4
|
+
/** The app's stores as the engine's port: where the document is read and written. */
|
|
5
|
+
export declare function portFromStore(store: CookbookStore): PlannerPort;
|
|
6
|
+
/**
|
|
7
|
+
* The controller for the planner app over `store` (the app's is
|
|
8
|
+
* `cookbookStore`): smrt's cookbook engine behind the planner's command names,
|
|
9
|
+
* with the stores as its document and the planner tab and section as `focus`.
|
|
10
|
+
* Every UI path that changes the app is a command here, and the assistant, the
|
|
11
|
+
* palette, a host page and the MCP and CLI servers use the same ones.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createPlannerController(store?: CookbookStore, options?: PlannerControllerOptions): PlannerController & Pick<PlannerAdapter, 'cookbook' | 'undo' | 'tools'>;
|