@happyvertical/smrt-planner 0.57.12 → 0.57.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +136 -0
- package/agents/assistant.md +49 -0
- package/agents/commands.md +2 -2
- package/agents/cookbook.md +3 -1
- package/agents/shell.md +9 -7
- package/app/404.html +21 -21
- package/app/_app/immutable/assets/2.D3Ee82Nk.css +1 -0
- package/app/_app/immutable/assets/AppShell.Y0ysizZK.css +1 -0
- package/app/_app/immutable/assets/{icons.BDx21rPt.css → icons.DFiHs25V.css} +1 -1
- package/app/_app/immutable/chunks/4U_CvE-d.js +16 -0
- package/app/_app/immutable/chunks/{BxyJ_Q7v.js → B7IsOdeU.js} +1 -1
- package/app/_app/immutable/chunks/BLDKU4g5.js +1 -0
- package/app/_app/immutable/chunks/{_CcVkMEQ.js → BOSl48rY.js} +1 -1
- package/app/_app/immutable/chunks/{DbH3RuTE.js → Ba61AwfI.js} +1 -1
- package/app/_app/immutable/chunks/{DU3stPaX.js → BfEjkvw8.js} +1 -1
- package/app/_app/immutable/chunks/Bl9jYcfy.js +1 -0
- package/app/_app/immutable/chunks/{CsaWd8kG.js → Bs5WxZDd.js} +1 -1
- package/app/_app/immutable/chunks/BttZBU_f.js +10 -0
- package/app/_app/immutable/chunks/By9nPosf.js +1 -0
- package/app/_app/immutable/chunks/{2dmW8nz3.js → C8mMXUIO.js} +2 -2
- package/app/_app/immutable/chunks/{BQgbhyQu.js → C9ckpR0C.js} +1 -1
- package/app/_app/immutable/chunks/{D4791-Ex.js → CB4gakCD.js} +1 -1
- package/app/_app/immutable/chunks/CO-Ek-HE.js +1 -0
- package/app/_app/immutable/chunks/{BCvXlTRf.js → CvjuXdyt.js} +1 -1
- package/app/_app/immutable/chunks/CxSE8nQW.js +1 -0
- package/app/_app/immutable/chunks/D-dgX3hb.js +2 -0
- package/app/_app/immutable/chunks/{bBI0F4nt.js → DDsrLsCW.js} +1 -1
- package/app/_app/immutable/chunks/{DDtOXC2p.js → DHw6VlGb.js} +1 -1
- package/app/_app/immutable/chunks/{BgtC60Dj.js → DQ1TECJo.js} +2 -2
- package/app/_app/immutable/chunks/{pEiNEXSh.js → DSHP6NMq.js} +1 -1
- package/app/_app/immutable/chunks/DYDheSdi.js +26 -0
- package/app/_app/immutable/chunks/Df-zyycv.js +2 -0
- package/app/_app/immutable/chunks/DkMzaPtY.js +4 -0
- package/app/_app/immutable/chunks/DmA8eomi.js +1 -0
- package/app/_app/immutable/chunks/{8MGlmWc0.js → DwlKnCAn.js} +1 -1
- package/app/_app/immutable/chunks/{B88mVEob.js → Mn4opCWg.js} +1 -1
- package/app/_app/immutable/chunks/{38SS-Q6Y.js → PiW3Dgjp.js} +22 -22
- package/app/_app/immutable/chunks/{ByKA-VaR.js → VIYltq2Y.js} +1 -1
- package/app/_app/immutable/chunks/{CQFoqqzT.js → fNkgk5Jb.js} +1 -1
- package/app/_app/immutable/chunks/{BTm4M8Ke.js → mdO5QRA9.js} +1 -1
- package/app/_app/immutable/chunks/{5TDxHd66.js → yTc1j36D.js} +1 -1
- package/app/_app/immutable/chunks/{oV81RcfI.js → yeJddwqn.js} +1 -1
- package/app/_app/immutable/entry/{app.C8En00Ny.js → app.N1QTpsMZ.js} +2 -2
- package/app/_app/immutable/entry/start.Dr_ALXsl.js +1 -0
- package/app/_app/immutable/nodes/0.inFgEPC5.js +7 -0
- package/app/_app/immutable/nodes/{1.CoV_40km.js → 1.BPYf0yDv.js} +1 -1
- package/app/_app/immutable/nodes/10.DScVn_7s.js +3 -0
- package/app/_app/immutable/nodes/{11.Csg6XAcG.js → 11.SWB4V_R-.js} +1 -1
- package/app/_app/immutable/nodes/{12.CuTHLuEu.js → 12.jNsVHfvB.js} +1 -1
- package/app/_app/immutable/nodes/{13.CNdfx5uO.js → 13.BAX1DbJ6.js} +1 -1
- package/app/_app/immutable/nodes/14.DFK_8SUc.js +1 -0
- package/app/_app/immutable/nodes/2.C-g07Oom.js +22 -0
- package/app/_app/immutable/nodes/{3.DC8-sgUI.js → 3.BYAVGln5.js} +1 -1
- package/app/_app/immutable/nodes/{4.DcX0DIX9.js → 4.xN8AMdJR.js} +1 -1
- package/app/_app/immutable/nodes/{5.Opk77twi.js → 5.BnO1oGgB.js} +1 -1
- package/app/_app/immutable/nodes/{6.Uk9tXC7t.js → 6.D3aEKeoZ.js} +1 -1
- package/app/_app/immutable/nodes/7.BZMihT_i.js +1 -0
- package/app/_app/immutable/nodes/{8.CacSxuCP.js → 8.DWwsczQn.js} +1 -1
- package/app/_app/immutable/nodes/{9.z7vXbrbH.js → 9.hCdhh_c2.js} +1 -1
- package/app/_app/version.json +1 -1
- package/app/advanced-styles/index.html +24 -24
- package/app/ai/index.html +28 -28
- package/app/blueprint/index.html +22 -22
- package/app/cookbook/index.html +22 -22
- package/app/index.html +38 -40
- package/app/m/ads/AdDeliveryTier/index.html +27 -27
- package/app/m/ads/AdEvent/index.html +27 -27
- package/app/m/ads/AdFormat/index.html +27 -27
- package/app/m/ads/AdGroup/index.html +27 -27
- package/app/m/ads/AdVariation/index.html +27 -27
- package/app/m/analytics/AnalyticsDataStream/index.html +27 -27
- package/app/m/analytics/AnalyticsEvent/index.html +27 -27
- package/app/m/analytics/AnalyticsProperty/index.html +27 -27
- package/app/m/analytics/AnalyticsReport/index.html +27 -27
- package/app/m/approvals/ApprovalEvent/index.html +27 -27
- package/app/m/approvals/ApprovalPolicy/index.html +27 -27
- package/app/m/approvals/ApprovalRequest/index.html +27 -27
- package/app/m/assets/Asset/attachments/index.html +28 -28
- package/app/m/assets/Asset/index.html +27 -27
- package/app/m/assets/AssetAssociation/index.html +27 -27
- package/app/m/assets/AssetMetafield/index.html +27 -27
- package/app/m/assets/AssetStatus/index.html +27 -27
- package/app/m/assets/AssetType/index.html +27 -27
- package/app/m/assets/Folder/index.html +27 -27
- package/app/m/chat/AgentSession/index.html +27 -27
- package/app/m/chat/ChatMessage/index.html +27 -27
- package/app/m/chat/ChatParticipant/index.html +27 -27
- package/app/m/chat/ChatReaction/index.html +27 -27
- package/app/m/chat/ChatRoom/index.html +27 -27
- package/app/m/chat/ChatThread/index.html +27 -27
- package/app/m/chat/VoiceGatewayTurn/index.html +27 -27
- package/app/m/chat/VoiceSession/index.html +27 -27
- package/app/m/commerce/Agreement/index.html +27 -27
- package/app/m/commerce/Cart/index.html +27 -27
- package/app/m/commerce/Contract/index.html +27 -27
- package/app/m/commerce/ContractLineItem/index.html +27 -27
- package/app/m/commerce/Customer/index.html +27 -27
- package/app/m/commerce/DocumentTax/index.html +27 -27
- package/app/m/commerce/Estimate/index.html +27 -27
- package/app/m/commerce/Fulfillment/index.html +27 -27
- package/app/m/commerce/FulfillmentLineItem/index.html +27 -27
- package/app/m/commerce/HistoricalCustomerFunds/index.html +27 -27
- package/app/m/commerce/HistoricalCustomerFundsAllocation/index.html +27 -27
- package/app/m/commerce/HistoricalSalesLine/index.html +27 -27
- package/app/m/commerce/Invoice/index.html +27 -27
- package/app/m/commerce/InvoiceLineItem/index.html +27 -27
- package/app/m/commerce/Lease/index.html +27 -27
- package/app/m/commerce/LicenseSale/index.html +27 -27
- package/app/m/commerce/Order/index.html +27 -27
- package/app/m/commerce/Payment/index.html +27 -27
- package/app/m/commerce/PaymentAllocation/index.html +27 -27
- package/app/m/commerce/PaymentInstrument/index.html +27 -27
- package/app/m/commerce/PaymentIntent/index.html +27 -27
- package/app/m/commerce/Payout/index.html +27 -27
- package/app/m/commerce/ProductionOrder/index.html +27 -27
- package/app/m/commerce/PurchaseContract/index.html +27 -27
- package/app/m/commerce/PurchaseOrder/index.html +27 -27
- package/app/m/commerce/SalesContract/index.html +27 -27
- package/app/m/commerce/SupplierQuote/index.html +27 -27
- package/app/m/commerce/TaxCode/index.html +27 -27
- package/app/m/commerce/TaxComponent/index.html +27 -27
- package/app/m/commerce/TaxSettings/index.html +27 -27
- package/app/m/commerce/TaxSummaryReport/index.html +27 -27
- package/app/m/commerce/TenantPaymentAccount/index.html +27 -27
- package/app/m/commerce/Vendor/index.html +27 -27
- package/app/m/commerce/WholesaleOrder/index.html +27 -27
- package/app/m/content/Content/index.html +27 -27
- package/app/m/content/ContentContribution/index.html +27 -27
- package/app/m/content/ContentContributionAttachment/index.html +27 -27
- package/app/m/content/ContentContributionRevision/index.html +27 -27
- package/app/m/content/ContentContributionType/index.html +27 -27
- package/app/m/content/ContentContributor/index.html +27 -27
- package/app/m/content/ContentCorrection/index.html +27 -27
- package/app/m/content/ContentFeedSource/index.html +27 -27
- package/app/m/content/ContentGovernanceAssignment/index.html +27 -27
- package/app/m/content/ContentGovernancePolicy/index.html +27 -27
- package/app/m/content/ContentGovernanceProfile/index.html +27 -27
- package/app/m/content/ContentReference/index.html +27 -27
- package/app/m/content/ContentReview/index.html +27 -27
- package/app/m/content/ContentVersion/index.html +27 -27
- package/app/m/events/Event/index.html +27 -27
- package/app/m/events/EventParticipant/index.html +27 -27
- package/app/m/events/EventSeries/index.html +27 -27
- package/app/m/events/EventType/index.html +27 -27
- package/app/m/expenses/Expense/index.html +27 -27
- package/app/m/facts/Fact/index.html +27 -27
- package/app/m/facts/FactContent/index.html +27 -27
- package/app/m/facts/FactEvidence/index.html +27 -27
- package/app/m/facts/FactSource/index.html +27 -27
- package/app/m/facts/FactSubject/index.html +27 -27
- package/app/m/facts/FactTag/index.html +27 -27
- package/app/m/fields/FieldPolicy/index.html +27 -27
- package/app/m/fields/FieldPolicySuggestion/index.html +27 -27
- package/app/m/fields/FieldUsageCounter/index.html +27 -27
- package/app/m/images/Image/index.html +27 -27
- package/app/m/inventory/InventoryLocation/index.html +27 -27
- package/app/m/inventory/StockLevel/index.html +27 -27
- package/app/m/inventory/StockMovement/index.html +27 -27
- package/app/m/ledgers/Account/index.html +27 -27
- package/app/m/ledgers/Journal/index.html +27 -27
- package/app/m/ledgers/JournalEntry/index.html +27 -27
- package/app/m/ledgers/Ledger/index.html +27 -27
- package/app/m/manufacturing/Assembly/index.html +27 -27
- package/app/m/manufacturing/BillOfMaterials/index.html +27 -27
- package/app/m/manufacturing/BomLine/index.html +27 -27
- package/app/m/manufacturing/Operation/index.html +27 -27
- package/app/m/manufacturing/ProductionRun/index.html +27 -27
- package/app/m/manufacturing/ProductionRunCompletion/index.html +27 -27
- package/app/m/manufacturing/RoutingStep/index.html +27 -27
- package/app/m/marketing/Campaign/index.html +27 -27
- package/app/m/marketing/CampaignChannel/index.html +27 -27
- package/app/m/marketing/CampaignMetricSnapshot/index.html +27 -27
- package/app/m/messages/Account/index.html +27 -27
- package/app/m/messages/Attachment/index.html +27 -27
- package/app/m/messages/Blacklist/index.html +27 -27
- package/app/m/messages/Email/failed-sends/index.html +28 -28
- package/app/m/messages/Email/index.html +27 -27
- package/app/m/messages/Email/mailbox/index.html +28 -28
- package/app/m/messages/EmailAccount/index.html +27 -27
- package/app/m/messages/EmailAttachment/index.html +27 -27
- package/app/m/messages/EmailFolder/index.html +27 -27
- package/app/m/messages/Message/index.html +27 -27
- package/app/m/messages/MessagingEndpoint/index.html +27 -27
- package/app/m/messages/PersonaMessageRoute/index.html +27 -27
- package/app/m/messages/SlackAccount/index.html +27 -27
- package/app/m/messages/SlackMessage/index.html +27 -27
- package/app/m/messages/TelegramAccount/index.html +27 -27
- package/app/m/messages/Tweet/index.html +27 -27
- package/app/m/messages/TwitterAccount/index.html +27 -27
- package/app/m/messages/Whitelist/index.html +27 -27
- package/app/m/messages/ZulipAccount/index.html +27 -27
- package/app/m/places/Place/index.html +27 -27
- package/app/m/places/PlaceType/index.html +27 -27
- package/app/m/products/Category/index.html +27 -27
- package/app/m/products/Material/index.html +27 -27
- package/app/m/products/Product/index.html +27 -27
- package/app/m/products/Product/ingredients/index.html +28 -28
- package/app/m/products/ProductVariant/index.html +27 -27
- package/app/m/products/Sku/index.html +27 -27
- package/app/m/profiles/ApiKey/index.html +27 -27
- package/app/m/profiles/Bot/index.html +27 -27
- package/app/m/profiles/MagicLinkToken/index.html +27 -27
- package/app/m/profiles/NostrIdentity/index.html +27 -27
- package/app/m/profiles/OidcIdentity/index.html +27 -27
- package/app/m/profiles/Organization/index.html +27 -27
- package/app/m/profiles/Person/index.html +27 -27
- package/app/m/profiles/Profile/index.html +27 -27
- package/app/m/profiles/ProfileMetadata/index.html +27 -27
- package/app/m/profiles/ProfileMetafield/index.html +27 -27
- package/app/m/profiles/ProfileRelationship/index.html +27 -27
- package/app/m/profiles/ProfileRelationshipTerm/index.html +27 -27
- package/app/m/profiles/ProfileRelationshipType/index.html +27 -27
- package/app/m/profiles/ProfileType/index.html +27 -27
- package/app/m/projects/Comment/index.html +27 -27
- package/app/m/projects/Issue/index.html +27 -27
- package/app/m/projects/Label/index.html +27 -27
- package/app/m/projects/Project/index.html +27 -27
- package/app/m/projects/ProjectIntegration/index.html +27 -27
- package/app/m/projects/PullRequest/index.html +27 -27
- package/app/m/projects/Repository/index.html +27 -27
- package/app/m/properties/Property/index.html +27 -27
- package/app/m/properties/Zone/index.html +27 -27
- package/app/m/reports/RuntimeReport/index.html +27 -27
- package/app/m/reports/SmrtPrincipalReportRefreshTask/index.html +27 -27
- package/app/m/reports/SmrtReportLock/index.html +27 -27
- package/app/m/reports/SmrtReportRefreshTask/index.html +27 -27
- package/app/m/reports/SmrtReportRun/index.html +27 -27
- package/app/m/reports/SmrtReportSchedule/index.html +27 -27
- package/app/m/reports/SmrtReportWatermark/index.html +27 -27
- package/app/m/sales/Agreement/index.html +27 -27
- package/app/m/sales/AttributionException/index.html +27 -27
- package/app/m/sales/AttributionPolicy/index.html +27 -27
- package/app/m/sales/Commission/index.html +27 -27
- package/app/m/sales/CommissionAdjustment/index.html +27 -27
- package/app/m/sales/CommissionPayout/index.html +27 -27
- package/app/m/sales/CommissionPlan/index.html +27 -27
- package/app/m/sales/Earner/index.html +27 -27
- package/app/m/sales/EarnerSourceAttribution/index.html +27 -27
- package/app/m/sales/EarningEvent/index.html +27 -27
- package/app/m/sales/ExecutedAgreement/index.html +27 -27
- package/app/m/sales/Lead/index.html +27 -27
- package/app/m/sales/Opportunity/index.html +27 -27
- package/app/m/sales/OpportunityConversion/index.html +27 -27
- package/app/m/sales/PipelineDefinition/index.html +27 -27
- package/app/m/sales/PipelineStage/index.html +27 -27
- package/app/m/sales/Referral/index.html +27 -27
- package/app/m/sales/ReferralAgreement/index.html +27 -27
- package/app/m/sales/ReferralLink/index.html +27 -27
- package/app/m/sales/ReferralProgram/index.html +27 -27
- package/app/m/sales/ReferralTermSnapshot/index.html +27 -27
- package/app/m/sales/ReferralTouch/index.html +27 -27
- package/app/m/sales/Referrer/index.html +27 -27
- package/app/m/sales/SalesActivity/index.html +27 -27
- package/app/m/sales/SalesRepresentative/index.html +27 -27
- package/app/m/sites/Site/index.html +27 -27
- package/app/m/sites/SiteAgentBinding/index.html +27 -27
- package/app/m/social/OAuthState/index.html +27 -27
- package/app/m/social/SocialAccount/index.html +27 -27
- package/app/m/social/SocialPost/index.html +27 -27
- package/app/m/social/SocialPostAnalyticsSnapshot/index.html +27 -27
- package/app/m/subscriptions/BillingAdjustment/index.html +27 -27
- package/app/m/subscriptions/ClientCharge/index.html +27 -27
- package/app/m/subscriptions/CreditGrant/index.html +27 -27
- package/app/m/subscriptions/PricingRule/index.html +27 -27
- package/app/m/subscriptions/RetailCharge/index.html +27 -27
- package/app/m/subscriptions/SpendingPolicy/index.html +27 -27
- package/app/m/subscriptions/SubscriptionPlan/index.html +27 -27
- package/app/m/subscriptions/SubscriptionPlanVersion/index.html +27 -27
- package/app/m/subscriptions/TenantSubscription/index.html +27 -27
- package/app/m/subscriptions/TenantUsageMetric/index.html +27 -27
- package/app/m/support/ServiceTimeEntry/index.html +27 -27
- package/app/m/support/SupportAiRun/index.html +27 -27
- package/app/m/support/SupportAvailability/index.html +27 -27
- package/app/m/support/SupportCase/index.html +27 -27
- package/app/m/support/SupportCaseEvent/index.html +27 -27
- package/app/m/support/SupportChannelBinding/index.html +27 -27
- package/app/m/support/SupportCharge/index.html +27 -27
- package/app/m/support/SupportCompensation/index.html +27 -27
- package/app/m/support/SupportCompensationPlan/index.html +27 -27
- package/app/m/support/SupportEscalation/index.html +27 -27
- package/app/m/support/SupportInteraction/index.html +27 -27
- package/app/m/support/SupportPlan/index.html +27 -27
- package/app/m/support/SupportPolicy/index.html +27 -27
- package/app/m/support/SupportQualification/index.html +27 -27
- package/app/m/support/SupportServiceTarget/index.html +27 -27
- package/app/m/support/SupportSpecialist/index.html +27 -27
- package/app/m/support/SupportWorkLink/index.html +27 -27
- package/app/m/tags/Tag/index.html +27 -27
- package/app/m/tags/TagAlias/index.html +27 -27
- package/app/m/timesheets/AttendanceBreak/index.html +27 -27
- package/app/m/timesheets/AttendancePunch/index.html +27 -27
- package/app/m/timesheets/AttendanceSegment/index.html +27 -27
- package/app/m/timesheets/ServiceChargeSnapshot/index.html +27 -27
- package/app/m/timesheets/ServiceCompensationSnapshot/index.html +27 -27
- package/app/m/timesheets/ServiceTimeEntry/index.html +27 -27
- package/app/m/users/Group/index.html +27 -27
- package/app/m/users/GroupMember/index.html +27 -27
- package/app/m/users/GroupRole/index.html +27 -27
- package/app/m/users/Membership/index.html +27 -27
- package/app/m/users/MembershipOverride/index.html +27 -27
- package/app/m/users/Permission/index.html +27 -27
- package/app/m/users/Role/index.html +27 -27
- package/app/m/users/RolePermission/index.html +27 -27
- package/app/m/users/Session/index.html +27 -27
- package/app/m/users/Tenant/index.html +27 -27
- package/app/m/users/TenantIntegration/index.html +27 -27
- package/app/m/users/TenantPermissionOverride/index.html +27 -27
- package/app/m/users/User/index.html +27 -27
- package/app/m/video/Character/index.html +27 -27
- package/app/m/video/CharacterAsset/index.html +27 -27
- package/app/m/video/CompositeJob/index.html +27 -27
- package/app/m/video/Performer/index.html +27 -27
- package/app/m/video/PerformerAsset/index.html +27 -27
- package/app/m/video/Scene/index.html +27 -27
- package/app/m/video/SceneAsset/index.html +27 -27
- package/app/m/video/VideoComposition/index.html +27 -27
- package/app/m/video/VideoCompositionAsset/index.html +27 -27
- package/app/m/video/VideoSequence/index.html +27 -27
- package/app/m/video/VideoSequenceAsset/index.html +27 -27
- package/app/m/video/VideoShot/index.html +27 -27
- package/app/m/video/VideoShotAsset/index.html +27 -27
- package/app/m/video/VideoShotCharacter/index.html +27 -27
- package/app/m/video/VideoWorkflow/index.html +27 -27
- package/app/m/voice/VoiceOutput/index.html +27 -27
- package/app/m/voice/VoiceProfile/index.html +27 -27
- package/app/m/voice/VoiceSample/index.html +27 -27
- package/app/mcp.html +2 -2
- package/app/packages/ads/index.html +24 -24
- package/app/packages/analytics/index.html +24 -24
- package/app/packages/approvals/index.html +24 -24
- package/app/packages/assets/index.html +24 -24
- package/app/packages/chat/index.html +24 -24
- package/app/packages/comments/index.html +24 -24
- package/app/packages/commerce/index.html +24 -24
- package/app/packages/content/index.html +24 -24
- package/app/packages/events/index.html +24 -24
- package/app/packages/expenses/index.html +24 -24
- package/app/packages/facts/index.html +24 -24
- package/app/packages/fields/index.html +24 -24
- package/app/packages/human-resources/index.html +24 -24
- package/app/packages/images/index.html +24 -24
- package/app/packages/index.html +23 -23
- package/app/packages/ingestion/index.html +24 -24
- package/app/packages/inventory/index.html +24 -24
- package/app/packages/ledgers/index.html +24 -24
- package/app/packages/manufacturing/index.html +24 -24
- package/app/packages/marketing/index.html +24 -24
- package/app/packages/messages/index.html +24 -24
- package/app/packages/places/index.html +24 -24
- package/app/packages/preferences/index.html +24 -24
- package/app/packages/products/index.html +24 -24
- package/app/packages/profiles/index.html +24 -24
- package/app/packages/projects/index.html +24 -24
- package/app/packages/properties/index.html +24 -24
- package/app/packages/reports/index.html +24 -24
- package/app/packages/sales/index.html +24 -24
- package/app/packages/sites/index.html +24 -24
- package/app/packages/social/index.html +24 -24
- package/app/packages/subscriptions/index.html +24 -24
- package/app/packages/support/index.html +24 -24
- package/app/packages/tags/index.html +24 -24
- package/app/packages/timesheets/index.html +24 -24
- package/app/packages/users/index.html +24 -24
- package/app/packages/video/index.html +24 -24
- package/app/packages/voice/index.html +24 -24
- package/app/packages/webhooks/index.html +24 -24
- package/app/recipes/account-access/help/index.html +24 -24
- package/app/recipes/account-access/index.html +26 -26
- package/app/recipes/activity/help/index.html +24 -24
- package/app/recipes/activity/index.html +26 -26
- package/app/recipes/agreements/help/index.html +24 -24
- package/app/recipes/agreements/index.html +26 -26
- package/app/recipes/analytics.reports/help/index.html +24 -24
- package/app/recipes/analytics.reports/index.html +26 -26
- package/app/recipes/assets/help/index.html +24 -24
- package/app/recipes/assets/index.html +26 -26
- package/app/recipes/billing/help/index.html +24 -24
- package/app/recipes/billing/index.html +26 -26
- package/app/recipes/chat.assistant/help/index.html +24 -24
- package/app/recipes/chat.assistant/index.html +26 -26
- package/app/recipes/comments/help/index.html +24 -24
- package/app/recipes/comments/index.html +26 -26
- package/app/recipes/commerce.customers/help/index.html +24 -24
- package/app/recipes/commerce.customers/index.html +26 -26
- package/app/recipes/commerce.estimates/help/index.html +24 -24
- package/app/recipes/commerce.estimates/index.html +26 -26
- package/app/recipes/commerce.purchases/help/index.html +24 -24
- package/app/recipes/commerce.purchases/index.html +26 -26
- package/app/recipes/commerce.sales/help/index.html +24 -24
- package/app/recipes/commerce.sales/index.html +26 -26
- package/app/recipes/commerce.vendors/help/index.html +24 -24
- package/app/recipes/commerce.vendors/index.html +26 -26
- package/app/recipes/commerce.wholesale/help/index.html +24 -24
- package/app/recipes/commerce.wholesale/index.html +26 -26
- package/app/recipes/events.calendar/help/index.html +24 -24
- package/app/recipes/events.calendar/index.html +26 -26
- package/app/recipes/expenses.tracking/help/index.html +24 -24
- package/app/recipes/expenses.tracking/index.html +26 -26
- package/app/recipes/fields.form-customization/help/index.html +24 -24
- package/app/recipes/fields.form-customization/index.html +26 -26
- package/app/recipes/ingestion/help/index.html +24 -24
- package/app/recipes/ingestion/index.html +26 -26
- package/app/recipes/integrations/help/index.html +24 -24
- package/app/recipes/integrations/index.html +26 -26
- package/app/recipes/inventory.stock/help/index.html +24 -24
- package/app/recipes/inventory.stock/index.html +26 -26
- package/app/recipes/ledgers.bookkeeping/help/index.html +24 -24
- package/app/recipes/ledgers.bookkeeping/index.html +26 -26
- package/app/recipes/messages/help/index.html +24 -24
- package/app/recipes/messages/index.html +26 -26
- package/app/recipes/products/help/index.html +24 -24
- package/app/recipes/products/index.html +26 -26
- package/app/recipes/projects.tracker/help/index.html +24 -24
- package/app/recipes/projects.tracker/index.html +26 -26
- package/app/recipes/reports.materialized/help/index.html +24 -24
- package/app/recipes/reports.materialized/index.html +26 -26
- package/app/recipes/reports.runtime/help/index.html +24 -24
- package/app/recipes/reports.runtime/index.html +26 -26
- package/app/recipes/sales.pipeline/help/index.html +24 -24
- package/app/recipes/sales.pipeline/index.html +26 -26
- package/app/recipes/tags.taxonomy/help/index.html +24 -24
- package/app/recipes/tags.taxonomy/index.html +26 -26
- package/app/recipes/team-collaboration/help/index.html +24 -24
- package/app/recipes/team-collaboration/index.html +26 -26
- package/app/recipes/timesheets.time-entries/help/index.html +24 -24
- package/app/recipes/timesheets.time-entries/index.html +26 -26
- package/app/s/custom-accounts/index.html +23 -23
- package/app/s/custom-appointments/index.html +23 -23
- package/app/s/custom-billing/index.html +23 -23
- package/app/s/custom-bookings/index.html +23 -23
- package/app/s/custom-buying/index.html +23 -23
- package/app/s/custom-checkout/index.html +23 -23
- package/app/s/custom-classes/index.html +23 -23
- package/app/s/custom-clients/index.html +23 -23
- package/app/s/custom-events/index.html +23 -23
- package/app/s/custom-fleet/index.html +23 -23
- package/app/s/custom-gigs/index.html +23 -23
- package/app/s/custom-giving/index.html +23 -23
- package/app/s/custom-instruments/index.html +23 -23
- package/app/s/custom-jobs/index.html +23 -23
- package/app/s/custom-kitchen/index.html +23 -23
- package/app/s/custom-lessons/index.html +23 -23
- package/app/s/custom-material/index.html +23 -23
- package/app/s/custom-meetings/index.html +23 -23
- package/app/s/custom-members/index.html +23 -23
- package/app/s/custom-merch/index.html +23 -23
- package/app/s/custom-money/index.html +23 -23
- package/app/s/custom-paint/index.html +23 -23
- package/app/s/custom-parts/index.html +23 -23
- package/app/s/custom-rentals/index.html +23 -23
- package/app/s/custom-roastery/index.html +23 -23
- package/app/s/custom-schedule/index.html +23 -23
- package/app/s/custom-shelf/index.html +23 -23
- package/app/s/custom-shop/index.html +23 -23
- package/app/s/custom-students/index.html +23 -23
- package/app/s/custom-wholesale/index.html +23 -23
- package/app/s/custom-work/index.html +23 -23
- package/app/s/custom-yard/index.html +23 -23
- package/app/s/section-access-control/index.html +23 -23
- package/app/s/section-account-security/index.html +23 -23
- package/app/s/section-accounting/index.html +23 -23
- package/app/s/section-activity/index.html +23 -23
- package/app/s/section-agreements/index.html +23 -23
- package/app/s/section-analytics/index.html +23 -23
- package/app/s/section-assets/index.html +23 -23
- package/app/s/section-billing/index.html +23 -23
- package/app/s/section-calendar/index.html +23 -23
- package/app/s/section-catalog/index.html +23 -23
- package/app/s/section-chat.assistant/index.html +23 -23
- package/app/s/section-comments/index.html +23 -23
- package/app/s/section-fields.form-customization/index.html +23 -23
- package/app/s/section-ingestion/index.html +23 -23
- package/app/s/section-integrations/index.html +23 -23
- package/app/s/section-messages/index.html +23 -23
- package/app/s/section-more/index.html +23 -23
- package/app/s/section-operations/index.html +23 -23
- package/app/s/section-projects/index.html +23 -23
- package/app/s/section-purchasing/index.html +23 -23
- package/app/s/section-reports.materialized/index.html +23 -23
- package/app/s/section-reports.runtime/index.html +23 -23
- package/app/s/section-sales/index.html +23 -23
- package/app/s/section-taxonomy/index.html +23 -23
- package/app/s/section-team/index.html +23 -23
- package/app/s/section-work/index.html +23 -23
- package/dist/ai/instance.d.ts.map +1 -1
- package/dist/ai/instance.js +2 -0
- package/dist/assistant/change.d.ts +2 -0
- package/dist/assistant/change.d.ts.map +1 -1
- package/dist/assistant/change.js +5 -0
- package/dist/assistant/coaching.d.ts +7 -0
- package/dist/assistant/coaching.d.ts.map +1 -0
- package/dist/assistant/coaching.js +42 -0
- package/dist/assistant/prompt.d.ts.map +1 -1
- package/dist/assistant/prompt.js +1 -0
- package/dist/assistant/session.svelte.d.ts +4 -1
- package/dist/assistant/session.svelte.d.ts.map +1 -1
- package/dist/assistant/session.svelte.js +5 -1
- package/dist/assistant/starters.d.ts +7 -0
- package/dist/assistant/starters.d.ts.map +1 -0
- package/dist/assistant/starters.js +33 -0
- package/dist/assistant/transport.d.ts +37 -2
- package/dist/assistant/transport.d.ts.map +1 -1
- package/dist/assistant/transport.js +257 -56
- package/dist/catalog/catalog.json +38 -38
- package/dist/components/BrowserAssistant.svelte +20 -0
- package/dist/components/BrowserAssistant.svelte.d.ts.map +1 -1
- package/dist/components/ExportPanel.svelte +176 -118
- package/dist/components/ExportPanel.svelte.d.ts +8 -0
- package/dist/components/ExportPanel.svelte.d.ts.map +1 -1
- package/dist/components/HeaderIconLink.svelte +8 -0
- package/dist/components/HeaderIconLink.svelte.d.ts +1 -0
- package/dist/components/HeaderIconLink.svelte.d.ts.map +1 -1
- package/dist/components/ProjectControls.svelte +133 -0
- package/dist/components/ProjectControls.svelte.d.ts +15 -0
- package/dist/components/ProjectControls.svelte.d.ts.map +1 -0
- package/dist/components/SectionOverview.svelte +4 -5
- package/dist/components/SectionOverview.svelte.d.ts +1 -1
- package/dist/components/SectionOverview.svelte.d.ts.map +1 -1
- package/dist/components/SettingsPanel.svelte +37 -1
- package/dist/components/SettingsPanel.svelte.d.ts +7 -1
- package/dist/components/SettingsPanel.svelte.d.ts.map +1 -1
- package/dist/cookbook/file.d.ts +5 -0
- package/dist/cookbook/file.d.ts.map +1 -1
- package/dist/cookbook/file.js +9 -2
- package/dist/cookbook/store.svelte.d.ts +4 -1
- package/dist/cookbook/store.svelte.d.ts.map +1 -1
- package/dist/cookbook/store.svelte.js +9 -10
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/prompt.d.ts.map +1 -1
- package/dist/core/prompt.js +10 -0
- package/dist/core/reply.d.ts +2 -0
- package/dist/core/reply.d.ts.map +1 -1
- package/dist/core/reply.js +4 -0
- package/dist/data/packs.d.ts.map +1 -1
- package/dist/data/packs.js +14 -7
- package/dist/data/planner-source.d.ts.map +1 -1
- package/dist/data/planner-source.js +4 -3
- package/dist/data/sample-context.d.ts +84 -0
- package/dist/data/sample-context.d.ts.map +1 -0
- package/dist/data/sample-context.js +106 -0
- package/dist/data/source.d.ts.map +1 -1
- package/dist/data/source.js +2 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/library/state.svelte.d.ts.map +1 -1
- package/dist/library/state.svelte.js +3 -3
- package/dist/overviews/definitions.d.ts +2 -2
- package/dist/overviews/definitions.d.ts.map +1 -1
- package/dist/overviews/definitions.js +19 -31
- package/dist/overviews/page.d.ts.map +1 -1
- package/dist/overviews/page.js +4 -1
- package/dist/overviews/registry.d.ts +1 -1
- package/dist/overviews/registry.js +3 -3
- package/dist/overviews/validate.d.ts.map +1 -1
- package/dist/overviews/validate.js +15 -2
- package/dist/planner/Planner.svelte +46 -4
- package/dist/planner/Planner.svelte.d.ts.map +1 -1
- package/dist/planner/PlannerControls.svelte +18 -2
- package/dist/planner/PlannerControls.svelte.d.ts +2 -0
- package/dist/planner/PlannerControls.svelte.d.ts.map +1 -1
- package/dist/planner/PlannerHostAction.svelte +61 -0
- package/dist/planner/PlannerHostAction.svelte.d.ts +12 -0
- package/dist/planner/PlannerHostAction.svelte.d.ts.map +1 -0
- package/dist/planner/PlannerLifecycle.svelte +75 -5
- package/dist/planner/PlannerLifecycle.svelte.d.ts +2 -1
- package/dist/planner/PlannerLifecycle.svelte.d.ts.map +1 -1
- package/dist/planner/bridge.d.ts +73 -0
- package/dist/planner/bridge.d.ts.map +1 -0
- package/dist/planner/bridge.js +303 -0
- package/dist/planner/commands/adapter.d.ts +2 -0
- package/dist/planner/commands/adapter.d.ts.map +1 -1
- package/dist/planner/commands/adapter.js +19 -0
- package/dist/planner/export-context.d.ts +6 -0
- package/dist/planner/export-context.d.ts.map +1 -0
- package/dist/planner/export-context.js +14 -0
- package/dist/planner/guide.d.ts +69 -0
- package/dist/planner/guide.d.ts.map +1 -0
- package/dist/planner/guide.js +115 -0
- package/dist/planner/host-reply.d.ts +22 -0
- package/dist/planner/host-reply.d.ts.map +1 -0
- package/dist/planner/host-reply.js +71 -0
- package/dist/planner/shell.d.ts +6 -0
- package/dist/planner/shell.d.ts.map +1 -1
- package/dist/planner/shell.js +2 -0
- package/dist/planner/types.d.ts +39 -1
- package/dist/planner/types.d.ts.map +1 -1
- package/dist/planner/workspace-storage.d.ts +29 -0
- package/dist/planner/workspace-storage.d.ts.map +1 -0
- package/dist/planner/workspace-storage.js +355 -0
- package/dist/planner/workspace.svelte.d.ts +19 -0
- package/dist/planner/workspace.svelte.d.ts.map +1 -0
- package/dist/planner/workspace.svelte.js +52 -0
- package/dist/smrt-version.d.ts +1 -1
- package/dist/smrt-version.js +1 -1
- package/package.json +54 -54
- package/app/_app/immutable/assets/2.CdEXvRg0.css +0 -1
- package/app/_app/immutable/assets/AppShell.BkKNrxND.css +0 -1
- package/app/_app/immutable/chunks/9PL91wDk.js +0 -4
- package/app/_app/immutable/chunks/9iVbSlQr.js +0 -16
- package/app/_app/immutable/chunks/B-xSgl5J.js +0 -1
- package/app/_app/immutable/chunks/BDKUpjK6.js +0 -2
- package/app/_app/immutable/chunks/Bq35Wl4H.js +0 -2
- package/app/_app/immutable/chunks/Cu77BRmy.js +0 -1
- package/app/_app/immutable/chunks/CxZIUuYu.js +0 -1
- package/app/_app/immutable/chunks/CzHmSbsw.js +0 -1
- package/app/_app/immutable/chunks/D71UrO5c.js +0 -1
- package/app/_app/immutable/chunks/DF-0MxNw.js +0 -1
- package/app/_app/immutable/chunks/DaWOaOo5.js +0 -10
- package/app/_app/immutable/chunks/aDZBV4Ss.js +0 -26
- package/app/_app/immutable/entry/start.DQ2WMDJa.js +0 -1
- package/app/_app/immutable/nodes/0.CjivLsXS.js +0 -7
- package/app/_app/immutable/nodes/10.CRcxQ1FU.js +0 -3
- package/app/_app/immutable/nodes/14.CvNTiqf4.js +0 -1
- package/app/_app/immutable/nodes/2.D8ImYTF0.js +0 -24
- package/app/_app/immutable/nodes/7.Q7dzrAos.js +0 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
tryUseAdminShell,
|
|
4
|
+
tryUseShellTargets,
|
|
5
|
+
} from '@happyvertical/smrt-svelte/workspace';
|
|
6
|
+
import { onMount, tick } from 'svelte';
|
|
3
7
|
import { aiState } from '../ai/instance.js';
|
|
4
|
-
import { browserStorage } from '../cookbook/storage.js';
|
|
5
8
|
import { cookbookStore } from '../cookbook/store.svelte.js';
|
|
6
9
|
import { provideDataSource, tryUseDataSource } from '../data/context.js';
|
|
7
10
|
import { createPlannerDataSource } from '../data/planner-source.js';
|
|
@@ -10,8 +13,10 @@ import { libraryState } from '../library/state.svelte.js';
|
|
|
10
13
|
import { recipeState } from '../recipes/state.svelte.js';
|
|
11
14
|
import { type LinkMode, setBasePath } from './app.svelte.js';
|
|
12
15
|
import { createPlannerAssistant } from './assistant.js';
|
|
16
|
+
import { createPlannerGuide } from './guide.js';
|
|
13
17
|
import { plannerController, plannerRuntime } from './instance.js';
|
|
14
18
|
import type { PlannerProps } from './types.js';
|
|
19
|
+
import { workspaceStorage } from './workspace-storage.js';
|
|
15
20
|
|
|
16
21
|
let {
|
|
17
22
|
controller = plannerController,
|
|
@@ -19,15 +24,29 @@ let {
|
|
|
19
24
|
inference,
|
|
20
25
|
persistence = 'self',
|
|
21
26
|
onready,
|
|
27
|
+
initialConversation,
|
|
28
|
+
cookbookOffers = true,
|
|
29
|
+
conversationalAction,
|
|
30
|
+
nativeAssistant = false,
|
|
22
31
|
links = 'path',
|
|
23
32
|
}: Pick<
|
|
24
33
|
PlannerProps,
|
|
25
|
-
|
|
34
|
+
| 'controller'
|
|
35
|
+
| 'basePath'
|
|
36
|
+
| 'inference'
|
|
37
|
+
| 'persistence'
|
|
38
|
+
| 'onready'
|
|
39
|
+
| 'initialConversation'
|
|
40
|
+
| 'cookbookOffers'
|
|
41
|
+
| 'conversationalAction'
|
|
26
42
|
> & {
|
|
43
|
+
nativeAssistant?: boolean;
|
|
27
44
|
/** `'hash'` in the complete `Planner`, whose pages are fragment routes. */
|
|
28
45
|
links?: LinkMode;
|
|
29
46
|
} = $props();
|
|
30
47
|
|
|
48
|
+
const shell = tryUseAdminShell();
|
|
49
|
+
const targets = tryUseShellTargets();
|
|
31
50
|
const dataSource =
|
|
32
51
|
tryUseDataSource() ?? provideDataSource(createPlannerDataSource());
|
|
33
52
|
|
|
@@ -38,11 +57,19 @@ $effect.pre(() => {
|
|
|
38
57
|
});
|
|
39
58
|
|
|
40
59
|
onMount(() => {
|
|
60
|
+
let mounted = true;
|
|
61
|
+
const guide = nativeAssistant
|
|
62
|
+
? createPlannerGuide({
|
|
63
|
+
targets,
|
|
64
|
+
isMounted: () => mounted,
|
|
65
|
+
revealMenu: () => shell?.expandPanel('left'),
|
|
66
|
+
})
|
|
67
|
+
: undefined;
|
|
41
68
|
const previous = plannerRuntime.onReplaced;
|
|
42
69
|
plannerRuntime.onReplaced = () => dataSource.reset?.();
|
|
43
70
|
if (persistence === 'self' && !cookbookStore.loaded) {
|
|
44
71
|
libraryState.load();
|
|
45
|
-
cookbookStore.hydrate('',
|
|
72
|
+
cookbookStore.hydrate('', workspaceStorage());
|
|
46
73
|
}
|
|
47
74
|
const assistant = inference
|
|
48
75
|
? createPlannerAssistant(controller, inference)
|
|
@@ -57,9 +84,52 @@ onMount(() => {
|
|
|
57
84
|
recipeState.ids.length > 0 || recipeState.features.length > 0,
|
|
58
85
|
);
|
|
59
86
|
}
|
|
60
|
-
|
|
87
|
+
// Guide lifetime observes the private epoch even without an inference UI.
|
|
88
|
+
// Only an enabled assistant grants public conversation/export capabilities.
|
|
89
|
+
const privateNative = nativeAssistant ? aiState.session.transport : undefined;
|
|
90
|
+
const native = inference ? privateNative : undefined;
|
|
91
|
+
let nativeEpoch = privateNative?.resetRevision;
|
|
92
|
+
const stopGuideReset = privateNative?.subscribeConversation(() => {
|
|
93
|
+
if (privateNative.resetRevision !== nativeEpoch) {
|
|
94
|
+
nativeEpoch = privateNative.resetRevision;
|
|
95
|
+
guide?.dismiss();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
const previousOffers = aiState.session.cookbookOffers;
|
|
99
|
+
const previousHostTurn = aiState.session.hostTurn;
|
|
100
|
+
if (native) {
|
|
101
|
+
aiState.session.cookbookOffers = cookbookOffers;
|
|
102
|
+
aiState.session.hostTurn = conversationalAction;
|
|
103
|
+
if (initialConversation) native.seed(initialConversation);
|
|
104
|
+
}
|
|
105
|
+
onready?.({
|
|
106
|
+
controller,
|
|
107
|
+
...(guide ? { guide } : {}),
|
|
108
|
+
workspaceStorage: workspaceStorage(),
|
|
109
|
+
...(assistant ? { assistant } : {}),
|
|
110
|
+
...(native
|
|
111
|
+
? {
|
|
112
|
+
nativeAssistant: native,
|
|
113
|
+
openAssistant: async () => {
|
|
114
|
+
await tick();
|
|
115
|
+
return (
|
|
116
|
+
mounted &&
|
|
117
|
+
aiState.assistantReady &&
|
|
118
|
+
(shell?.openDockTool('assistant') ?? false)
|
|
119
|
+
);
|
|
120
|
+
},
|
|
121
|
+
}
|
|
122
|
+
: {}),
|
|
123
|
+
});
|
|
61
124
|
return () => {
|
|
125
|
+
mounted = false;
|
|
126
|
+
guide?.dismiss();
|
|
127
|
+
stopGuideReset?.();
|
|
62
128
|
plannerRuntime.onReplaced = previous;
|
|
129
|
+
if (native) {
|
|
130
|
+
aiState.session.cookbookOffers = previousOffers;
|
|
131
|
+
aiState.session.hostTurn = previousHostTurn;
|
|
132
|
+
}
|
|
63
133
|
};
|
|
64
134
|
});
|
|
65
135
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type LinkMode } from './app.svelte.ts';
|
|
2
2
|
import type { PlannerProps } from './types.ts';
|
|
3
|
-
type $$ComponentProps = Pick<PlannerProps, 'controller' | 'basePath' | 'inference' | 'persistence' | 'onready'> & {
|
|
3
|
+
type $$ComponentProps = Pick<PlannerProps, 'controller' | 'basePath' | 'inference' | 'persistence' | 'onready' | 'initialConversation' | 'cookbookOffers' | 'conversationalAction'> & {
|
|
4
|
+
nativeAssistant?: boolean;
|
|
4
5
|
/** `'hash'` in the complete `Planner`, whose pages are fragment routes. */
|
|
5
6
|
links?: LinkMode;
|
|
6
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlannerLifecycle.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/planner/PlannerLifecycle.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlannerLifecycle.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/planner/PlannerLifecycle.svelte.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,QAAQ,EAAe,MAAM,iBAAiB,CAAC;AAI7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG9C,KAAK,gBAAgB,GAAI,IAAI,CAC5B,YAAY,EACV,YAAY,GACZ,UAAU,GACV,WAAW,GACX,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,gBAAgB,GAChB,sBAAsB,CACzB,GAAG;IACF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2EAA2E;IAC3E,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB,CAAC;AAkIF,QAAA,MAAM,gBAAgB,sDAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type PromptCatalog } from '../core/catalog.ts';
|
|
2
|
+
import type { BatchResult, CommandName, PlannerController, PlanSnapshot } from './commands/index.ts';
|
|
3
|
+
import { type CommandTool } from './commands/schemas.ts';
|
|
4
|
+
import type { PlannerGuideControl, PlannerGuideHandle, PlannerGuideResult } from './guide.ts';
|
|
5
|
+
export interface PlannerBridgeSnapshot {
|
|
6
|
+
generation: string;
|
|
7
|
+
snapshot: PlanSnapshot;
|
|
8
|
+
}
|
|
9
|
+
export interface PlannerBridgeContext extends PlannerBridgeSnapshot {
|
|
10
|
+
catalog: PromptCatalog;
|
|
11
|
+
tools: readonly CommandTool[];
|
|
12
|
+
}
|
|
13
|
+
export interface PlannerBridgeRequest {
|
|
14
|
+
id: string;
|
|
15
|
+
generation: string;
|
|
16
|
+
expectedRevision: number;
|
|
17
|
+
}
|
|
18
|
+
export interface PlannerBridgeExecute extends PlannerBridgeRequest {
|
|
19
|
+
commands: readonly {
|
|
20
|
+
name: string;
|
|
21
|
+
input: unknown;
|
|
22
|
+
}[];
|
|
23
|
+
}
|
|
24
|
+
export interface PlannerBridgeApplyReply extends PlannerBridgeRequest {
|
|
25
|
+
reply: unknown;
|
|
26
|
+
}
|
|
27
|
+
export type PlannerBridgeResult = PlannerBridgeSnapshot & {
|
|
28
|
+
ok: boolean;
|
|
29
|
+
source: string;
|
|
30
|
+
id?: string;
|
|
31
|
+
result?: BatchResult;
|
|
32
|
+
content?: string;
|
|
33
|
+
spokenContent?: string;
|
|
34
|
+
sampleContextApplied?: boolean;
|
|
35
|
+
error?: {
|
|
36
|
+
code: string;
|
|
37
|
+
message: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export interface PlannerCommandPortClient {
|
|
41
|
+
snapshot(): Promise<PlannerBridgeSnapshot>;
|
|
42
|
+
context(): Promise<PlannerBridgeContext>;
|
|
43
|
+
subscribe(listener: (state: PlannerBridgeSnapshot) => void): () => void;
|
|
44
|
+
execute(input: PlannerBridgeExecute): Promise<PlannerBridgeResult>;
|
|
45
|
+
applyReply(input: PlannerBridgeApplyReply): Promise<PlannerBridgeResult>;
|
|
46
|
+
guide(input: {
|
|
47
|
+
generation: string;
|
|
48
|
+
kind: 'arrival' | 'addition' | 'control';
|
|
49
|
+
control?: PlannerGuideControl;
|
|
50
|
+
requestId?: string;
|
|
51
|
+
}): Promise<PlannerGuideResult>;
|
|
52
|
+
dismissGuide(input: {
|
|
53
|
+
generation: string;
|
|
54
|
+
}): Promise<{
|
|
55
|
+
ok: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
dispose(): void;
|
|
58
|
+
}
|
|
59
|
+
/** Bind a dedicated, already-authorized port to the actual mounted controller. */
|
|
60
|
+
export declare function bindPlannerCommandPort(options: {
|
|
61
|
+
port: MessagePort;
|
|
62
|
+
controller: PlannerController;
|
|
63
|
+
allowedCommands: readonly CommandName[];
|
|
64
|
+
/** Host-assigned provenance; never accepted from a model/request. */
|
|
65
|
+
source: string;
|
|
66
|
+
guide?: PlannerGuideHandle;
|
|
67
|
+
}): {
|
|
68
|
+
invalidate(): void;
|
|
69
|
+
dispose(): void;
|
|
70
|
+
};
|
|
71
|
+
/** Client for a dedicated port; the host owns exact origin/source handshake checks. */
|
|
72
|
+
export declare function connectPlannerCommandPort(port: MessagePort): PlannerCommandPortClient;
|
|
73
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/lib/planner/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,YAAY,EACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAUpB,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;CACxB;AACD,MAAM,WAAW,oBAAqB,SAAQ,qBAAqB;IACjE,OAAO,EAAE,aAAa,CAAC;IACvB,KAAK,EAAE,SAAS,WAAW,EAAE,CA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GAAG,SAAS,CAAC;QACzC,OAAO,CAAC,EAAE,mBAAmB,CAAC;QAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAChC,YAAY,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACtE,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,kFAAkF;AAClF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE;IAC9C,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,eAAe,EAAE,SAAS,WAAW,EAAE,CAAC;IACxC,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC5B,GAAG;IAAE,UAAU,IAAI,IAAI,CAAC;IAAC,OAAO,IAAI,IAAI,CAAA;CAAE,CAqQ1C;AAED,uFAAuF;AACvF,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,WAAW,GAChB,wBAAwB,CA4F1B"}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { defaultCatalog } from "../core/catalog.js";
|
|
2
|
+
import { COMMAND_NAMES, commandTools, } from "./commands/schemas.js";
|
|
3
|
+
import { applyPlannerHostReply } from "./host-reply.js";
|
|
4
|
+
const PROTOCOL = 'smrt-planner-commands';
|
|
5
|
+
const VERSION = 1;
|
|
6
|
+
const MAX_BYTES = 32768;
|
|
7
|
+
const MAX_COMMANDS = 16;
|
|
8
|
+
const MAX_RECEIPTS = 256;
|
|
9
|
+
const object = (value) => !!value && typeof value === 'object' && !Array.isArray(value);
|
|
10
|
+
/** Bind a dedicated, already-authorized port to the actual mounted controller. */
|
|
11
|
+
export function bindPlannerCommandPort(options) {
|
|
12
|
+
const { port, controller, source } = options;
|
|
13
|
+
if (!source ||
|
|
14
|
+
source.length > 128 ||
|
|
15
|
+
options.allowedCommands.some((name) => !COMMAND_NAMES.includes(name)))
|
|
16
|
+
throw new Error('Invalid Planner command port policy.');
|
|
17
|
+
const allowed = new Set(options.allowedCommands);
|
|
18
|
+
let generation = crypto.randomUUID();
|
|
19
|
+
let disposed = false;
|
|
20
|
+
const receipts = new Map();
|
|
21
|
+
const state = () => ({
|
|
22
|
+
generation,
|
|
23
|
+
snapshot: controller.snapshot(),
|
|
24
|
+
});
|
|
25
|
+
const send = (message) => {
|
|
26
|
+
if (!disposed)
|
|
27
|
+
port.postMessage({
|
|
28
|
+
protocol: PROTOCOL,
|
|
29
|
+
version: VERSION,
|
|
30
|
+
...message,
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const fail = (code, message, id) => ({
|
|
34
|
+
...state(),
|
|
35
|
+
ok: false,
|
|
36
|
+
source,
|
|
37
|
+
...(id ? { id } : {}),
|
|
38
|
+
error: { code, message },
|
|
39
|
+
content: message,
|
|
40
|
+
});
|
|
41
|
+
function execute(raw, mode) {
|
|
42
|
+
if (!object(raw) ||
|
|
43
|
+
Object.keys(raw).some((key) => ![
|
|
44
|
+
'id',
|
|
45
|
+
'generation',
|
|
46
|
+
'expectedRevision',
|
|
47
|
+
mode === 'execute' ? 'commands' : 'reply',
|
|
48
|
+
].includes(key)) ||
|
|
49
|
+
typeof raw.id !== 'string' ||
|
|
50
|
+
!raw.id ||
|
|
51
|
+
raw.id.length > 128 ||
|
|
52
|
+
typeof raw.generation !== 'string' ||
|
|
53
|
+
!Number.isSafeInteger(raw.expectedRevision) ||
|
|
54
|
+
Number(raw.expectedRevision) < 0)
|
|
55
|
+
return fail('invalid_input', 'Invalid Planner command envelope.');
|
|
56
|
+
const id = raw.id;
|
|
57
|
+
if (raw.generation !== generation)
|
|
58
|
+
return fail('stale_generation', 'This request belongs to an earlier Planner workspace.', id);
|
|
59
|
+
const fingerprint = JSON.stringify({ mode, ...raw });
|
|
60
|
+
const cached = receipts.get(id);
|
|
61
|
+
if (cached)
|
|
62
|
+
return cached.fingerprint === fingerprint
|
|
63
|
+
? structuredClone(cached.value)
|
|
64
|
+
: fail('conflict', 'This request id was already used for different input.', id);
|
|
65
|
+
if (receipts.size >= MAX_RECEIPTS)
|
|
66
|
+
return fail('limit_reached', 'This command connection has reached its receipt limit. Reconnect before continuing.', id);
|
|
67
|
+
const before = controller.snapshot();
|
|
68
|
+
let value;
|
|
69
|
+
const commandId = `${generation}:${id}`;
|
|
70
|
+
if (mode === 'applyReply') {
|
|
71
|
+
const applied = applyPlannerHostReply({
|
|
72
|
+
controller,
|
|
73
|
+
allowedCommands: [...allowed],
|
|
74
|
+
id: commandId,
|
|
75
|
+
expectedRevision: raw.expectedRevision,
|
|
76
|
+
reply: raw.reply,
|
|
77
|
+
});
|
|
78
|
+
value = { ...state(), source, id, ...applied };
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
const commands = raw.commands;
|
|
82
|
+
if (!Array.isArray(commands) ||
|
|
83
|
+
commands.length === 0 ||
|
|
84
|
+
commands.length > MAX_COMMANDS ||
|
|
85
|
+
commands.some((command) => !object(command) ||
|
|
86
|
+
Object.keys(command).some((key) => !['name', 'input'].includes(key)) ||
|
|
87
|
+
typeof command.name !== 'string' ||
|
|
88
|
+
!allowed.has(command.name)))
|
|
89
|
+
return fail('forbidden', 'The request contains a command this host does not allow.', id);
|
|
90
|
+
const result = controller.batch({
|
|
91
|
+
id: commandId,
|
|
92
|
+
expectedRevision: raw.expectedRevision,
|
|
93
|
+
commands,
|
|
94
|
+
});
|
|
95
|
+
value = {
|
|
96
|
+
...state(),
|
|
97
|
+
source,
|
|
98
|
+
id,
|
|
99
|
+
ok: result.ok,
|
|
100
|
+
result,
|
|
101
|
+
...(!result.ok
|
|
102
|
+
? { error: result.error, content: result.error.message }
|
|
103
|
+
: {}),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
receipts.set(id, { fingerprint, value: structuredClone(value), before });
|
|
107
|
+
return value;
|
|
108
|
+
}
|
|
109
|
+
const listener = async (event) => {
|
|
110
|
+
const raw = event.data;
|
|
111
|
+
if (disposed ||
|
|
112
|
+
!object(raw) ||
|
|
113
|
+
raw.protocol !== PROTOCOL ||
|
|
114
|
+
!Number.isSafeInteger(raw.requestId))
|
|
115
|
+
return;
|
|
116
|
+
let value;
|
|
117
|
+
const requestGeneration = generation;
|
|
118
|
+
try {
|
|
119
|
+
if (new TextEncoder().encode(JSON.stringify(raw)).length > MAX_BYTES)
|
|
120
|
+
value = fail('invalid_input', 'Planner command message is too large.');
|
|
121
|
+
else if (raw.version !== VERSION)
|
|
122
|
+
value = fail('unsupported_version', 'Unsupported Planner command protocol.');
|
|
123
|
+
else if (raw.type === 'snapshot')
|
|
124
|
+
value = state();
|
|
125
|
+
else if (raw.type === 'context')
|
|
126
|
+
value = { ...state(), catalog: defaultCatalog, tools: commandTools };
|
|
127
|
+
else if (raw.type === 'guide') {
|
|
128
|
+
const input = raw.input;
|
|
129
|
+
if (!object(input) ||
|
|
130
|
+
Object.keys(input).some((key) => !['generation', 'kind', 'requestId', 'control'].includes(key)) ||
|
|
131
|
+
input.generation !== generation ||
|
|
132
|
+
!['arrival', 'addition', 'control'].includes(String(input.kind)) ||
|
|
133
|
+
(input.kind === 'control' &&
|
|
134
|
+
!['build', 'export', 'chef', 'edit'].includes(String(input.control))) ||
|
|
135
|
+
(input.kind !== 'control' && input.control !== undefined) ||
|
|
136
|
+
!options.guide)
|
|
137
|
+
value = {
|
|
138
|
+
ok: false,
|
|
139
|
+
reason: 'Guidance is unavailable for this workspace.',
|
|
140
|
+
};
|
|
141
|
+
else if (input.kind === 'control')
|
|
142
|
+
value = await options.guide.highlight({
|
|
143
|
+
kind: 'control',
|
|
144
|
+
control: input.control,
|
|
145
|
+
});
|
|
146
|
+
else if (input.kind === 'arrival')
|
|
147
|
+
value = await options.guide.highlight({ kind: 'arrival' });
|
|
148
|
+
else {
|
|
149
|
+
const receipt = typeof input.requestId === 'string'
|
|
150
|
+
? receipts.get(input.requestId)
|
|
151
|
+
: undefined;
|
|
152
|
+
if (!receipt?.value.ok ||
|
|
153
|
+
!receipt.value.result?.ok ||
|
|
154
|
+
receipt.guided ||
|
|
155
|
+
receipt.value.snapshot.revision !== controller.snapshot().revision)
|
|
156
|
+
value = {
|
|
157
|
+
ok: false,
|
|
158
|
+
reason: 'No current unshown successful addition receipt is available.',
|
|
159
|
+
};
|
|
160
|
+
else {
|
|
161
|
+
value = await options.guide.highlight({
|
|
162
|
+
kind: 'addition',
|
|
163
|
+
before: receipt.before,
|
|
164
|
+
result: receipt.value.result,
|
|
165
|
+
});
|
|
166
|
+
if (value.ok)
|
|
167
|
+
receipt.guided = true;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
else if (raw.type === 'dismissGuide') {
|
|
172
|
+
if (object(raw.input) && raw.input.generation === generation) {
|
|
173
|
+
options.guide?.dismiss();
|
|
174
|
+
value = { ok: true };
|
|
175
|
+
}
|
|
176
|
+
else
|
|
177
|
+
value = { ok: false };
|
|
178
|
+
}
|
|
179
|
+
else if (raw.type === 'execute' || raw.type === 'applyReply')
|
|
180
|
+
value = execute(raw.input, raw.type);
|
|
181
|
+
else
|
|
182
|
+
value = fail('invalid_input', 'Unknown Planner command operation.');
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
value = fail('invalid_input', 'The Planner command could not be processed.');
|
|
186
|
+
}
|
|
187
|
+
if (raw.type === 'guide' && requestGeneration !== generation)
|
|
188
|
+
value = {
|
|
189
|
+
ok: false,
|
|
190
|
+
reason: 'The workspace changed before guidance was ready.',
|
|
191
|
+
};
|
|
192
|
+
send({ type: 'response', requestId: raw.requestId, value });
|
|
193
|
+
};
|
|
194
|
+
port.addEventListener('message', listener);
|
|
195
|
+
port.start();
|
|
196
|
+
const unsubscribe = controller.subscribe((snapshot) => send({ type: 'state', value: { generation, snapshot } }));
|
|
197
|
+
return {
|
|
198
|
+
invalidate() {
|
|
199
|
+
if (disposed)
|
|
200
|
+
return;
|
|
201
|
+
generation = crypto.randomUUID();
|
|
202
|
+
receipts.clear();
|
|
203
|
+
options.guide?.dismiss();
|
|
204
|
+
send({ type: 'state', value: state() });
|
|
205
|
+
},
|
|
206
|
+
dispose() {
|
|
207
|
+
if (disposed)
|
|
208
|
+
return;
|
|
209
|
+
disposed = true;
|
|
210
|
+
options.guide?.dismiss();
|
|
211
|
+
unsubscribe();
|
|
212
|
+
port.removeEventListener('message', listener);
|
|
213
|
+
port.close();
|
|
214
|
+
receipts.clear();
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/** Client for a dedicated port; the host owns exact origin/source handshake checks. */
|
|
219
|
+
export function connectPlannerCommandPort(port) {
|
|
220
|
+
let next = 0;
|
|
221
|
+
let disposed = false;
|
|
222
|
+
let current;
|
|
223
|
+
const listeners = new Set();
|
|
224
|
+
const pending = new Map();
|
|
225
|
+
const listener = (event) => {
|
|
226
|
+
const message = event.data;
|
|
227
|
+
if (disposed ||
|
|
228
|
+
!object(message) ||
|
|
229
|
+
message.protocol !== PROTOCOL ||
|
|
230
|
+
message.version !== VERSION)
|
|
231
|
+
return;
|
|
232
|
+
if (message.type === 'response' && typeof message.requestId === 'number') {
|
|
233
|
+
const call = pending.get(message.requestId);
|
|
234
|
+
if (!call)
|
|
235
|
+
return;
|
|
236
|
+
clearTimeout(call.timer);
|
|
237
|
+
pending.delete(message.requestId);
|
|
238
|
+
call.resolve(message.value);
|
|
239
|
+
}
|
|
240
|
+
else if (message.type === 'state' && object(message.value)) {
|
|
241
|
+
current = message.value;
|
|
242
|
+
for (const subscriber of listeners)
|
|
243
|
+
subscriber(structuredClone(current));
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
port.addEventListener('message', listener);
|
|
247
|
+
port.start();
|
|
248
|
+
const request = (type, input) => {
|
|
249
|
+
if (disposed)
|
|
250
|
+
return Promise.reject(new Error('Planner command connection is disposed.'));
|
|
251
|
+
if (pending.size >= 32)
|
|
252
|
+
return Promise.reject(new Error('Too many pending Planner commands.'));
|
|
253
|
+
return new Promise((resolve, reject) => {
|
|
254
|
+
const requestId = ++next;
|
|
255
|
+
const timer = setTimeout(() => {
|
|
256
|
+
pending.delete(requestId);
|
|
257
|
+
reject(new Error('Planner command connection timed out.'));
|
|
258
|
+
}, 10000);
|
|
259
|
+
pending.set(requestId, { resolve, reject, timer });
|
|
260
|
+
try {
|
|
261
|
+
port.postMessage({
|
|
262
|
+
protocol: PROTOCOL,
|
|
263
|
+
version: VERSION,
|
|
264
|
+
requestId,
|
|
265
|
+
type,
|
|
266
|
+
...(input === undefined ? {} : { input }),
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
clearTimeout(timer);
|
|
271
|
+
pending.delete(requestId);
|
|
272
|
+
reject(error);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
return {
|
|
277
|
+
snapshot: () => request('snapshot'),
|
|
278
|
+
context: () => request('context'),
|
|
279
|
+
execute: (input) => request('execute', input),
|
|
280
|
+
applyReply: (input) => request('applyReply', input),
|
|
281
|
+
guide: (input) => request('guide', input),
|
|
282
|
+
dismissGuide: (input) => request('dismissGuide', input),
|
|
283
|
+
subscribe(subscriber) {
|
|
284
|
+
listeners.add(subscriber);
|
|
285
|
+
if (current)
|
|
286
|
+
subscriber(structuredClone(current));
|
|
287
|
+
return () => listeners.delete(subscriber);
|
|
288
|
+
},
|
|
289
|
+
dispose() {
|
|
290
|
+
if (disposed)
|
|
291
|
+
return;
|
|
292
|
+
disposed = true;
|
|
293
|
+
port.removeEventListener('message', listener);
|
|
294
|
+
port.close();
|
|
295
|
+
listeners.clear();
|
|
296
|
+
for (const call of pending.values()) {
|
|
297
|
+
clearTimeout(call.timer);
|
|
298
|
+
call.reject(new Error('Planner command connection is disposed.'));
|
|
299
|
+
}
|
|
300
|
+
pending.clear();
|
|
301
|
+
},
|
|
302
|
+
};
|
|
303
|
+
}
|
|
@@ -70,6 +70,8 @@ export interface AdapterEnv {
|
|
|
70
70
|
* all drive the app through this one seam.
|
|
71
71
|
*/
|
|
72
72
|
export interface PlannerController {
|
|
73
|
+
/** Forget project command history after an explicit workspace reset. */
|
|
74
|
+
resetWorkspace?(): void;
|
|
73
75
|
/**
|
|
74
76
|
* Run one command. Never throws: a bad command, unknown id or refused edit
|
|
75
77
|
* comes back as `{ ok: false, error }` and leaves the app unchanged.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/lib/planner/commands/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,aAAa,EAElB,KAAK,WAAW,EAEjB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAe,QAAQ,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,aAAa,EAElB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,YAAY,CAAC;AAmBpB,iEAAiE;AACjE,MAAM,WAAW,iBAAiB;IAChC,MAAM,IAAI,YAAY,GAAG,IAAI,CAAC;IAC9B,MAAM,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAAC;IAChC,oEAAoE;IACpE,UAAU,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,wBAAwB;IACvC,uEAAuE;IACvE,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,yDAAyD;AACzD,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,IAAI,CAAC,IAAI,OAAO,CAAC;IACjB,+EAA+E;IAC/E,OAAO,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,CAAC,CAAC;IAChD;;;OAGG;IACH,OAAO,IAAI,MAAM,CAAC;IAClB,gFAAgF;IAChF,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,aAAa,CAAC;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,wBAAwB,CAAC;IACnC,GAAG,CAAC,EAAE,UAAU,CAAC;CAClB;AA4BD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,qBAAqB,GAC5B,cAAc,CAuqBhB"}
|
|
@@ -565,6 +565,25 @@ export function createPlannerAdapter(config) {
|
|
|
565
565
|
return run(untranslate(command), runOptions);
|
|
566
566
|
};
|
|
567
567
|
return {
|
|
568
|
+
resetWorkspace() {
|
|
569
|
+
sync();
|
|
570
|
+
const revision = engine.state().revision + 1;
|
|
571
|
+
engine = createCookbookEngine({
|
|
572
|
+
catalog,
|
|
573
|
+
state: {
|
|
574
|
+
version: 1,
|
|
575
|
+
revision,
|
|
576
|
+
applied: resolvedApplied(),
|
|
577
|
+
cookbook: (port?.read?.() ?? engine.cookbook()),
|
|
578
|
+
journal: [],
|
|
579
|
+
},
|
|
580
|
+
});
|
|
581
|
+
outward.clear();
|
|
582
|
+
inward.clear();
|
|
583
|
+
syncError = null;
|
|
584
|
+
lastKey = signature(port?.read?.() ?? engine.cookbook(), resolvedApplied());
|
|
585
|
+
deliver();
|
|
586
|
+
},
|
|
568
587
|
run: runWithUndo,
|
|
569
588
|
batch,
|
|
570
589
|
snapshot() {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BrowserAssistantTransport } from '../assistant/transport.ts';
|
|
2
|
+
import type { PlannerController } from './commands/index.ts';
|
|
3
|
+
import type { PlannerExportContext } from './types.ts';
|
|
4
|
+
/** Synchronous capture: no user edit or model completion can interleave it. */
|
|
5
|
+
export declare function capturePlannerExport(controller: PlannerController, nativeAssistant?: BrowserAssistantTransport): PlannerExportContext;
|
|
6
|
+
//# sourceMappingURL=export-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-context.d.ts","sourceRoot":"","sources":["../../src/lib/planner/export-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAc,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,iBAAiB,EAC7B,eAAe,CAAC,EAAE,yBAAyB,GAC1C,oBAAoB,CAatB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Synchronous capture: no user edit or model completion can interleave it. */
|
|
2
|
+
export function capturePlannerExport(controller, nativeAssistant) {
|
|
3
|
+
if (nativeAssistant?.busy) {
|
|
4
|
+
throw new Error('Wait for the assistant to finish, or stop it, then try again.');
|
|
5
|
+
}
|
|
6
|
+
const result = controller.run({ name: 'export_cookbook', input: {} });
|
|
7
|
+
if (!result.ok)
|
|
8
|
+
throw new Error(result.error.message);
|
|
9
|
+
return structuredClone({
|
|
10
|
+
export: result.data,
|
|
11
|
+
revision: result.snapshot.revision,
|
|
12
|
+
conversation: nativeAssistant?.conversation() ?? [],
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { ShellTargets } from '@happyvertical/smrt-svelte/workspace';
|
|
2
|
+
import type { BatchResult, PlanSnapshot } from './commands/index.ts';
|
|
3
|
+
export type PlannerGuideControl = 'build' | 'export' | 'chef' | 'edit';
|
|
4
|
+
export declare const PLANNER_GUIDE_CONTROLS: {
|
|
5
|
+
build: {
|
|
6
|
+
targetId: string;
|
|
7
|
+
label: string;
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
export: {
|
|
11
|
+
targetId: string;
|
|
12
|
+
label: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
chef: {
|
|
16
|
+
targetId: string;
|
|
17
|
+
label: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
edit: {
|
|
21
|
+
targetId: string;
|
|
22
|
+
label: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export interface PlannerGuideResult {
|
|
27
|
+
ok: boolean;
|
|
28
|
+
targetId?: string;
|
|
29
|
+
label?: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
reason?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface PlannerGuideHandle {
|
|
34
|
+
highlight(input: {
|
|
35
|
+
kind: 'arrival';
|
|
36
|
+
} | {
|
|
37
|
+
kind: 'control';
|
|
38
|
+
control: PlannerGuideControl;
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'addition';
|
|
41
|
+
before: PlanSnapshot;
|
|
42
|
+
result: BatchResult;
|
|
43
|
+
}): Promise<PlannerGuideResult>;
|
|
44
|
+
dismiss(): void;
|
|
45
|
+
}
|
|
46
|
+
/** Semantic target choice is based on actual before/after execution, never catalog order. */
|
|
47
|
+
export declare function additionGuideTarget(before: PlanSnapshot, result: BatchResult): {
|
|
48
|
+
section: {
|
|
49
|
+
id: string;
|
|
50
|
+
label: string;
|
|
51
|
+
hidden: boolean;
|
|
52
|
+
items: {
|
|
53
|
+
id: string;
|
|
54
|
+
label: string;
|
|
55
|
+
hidden: boolean;
|
|
56
|
+
}[];
|
|
57
|
+
};
|
|
58
|
+
item: {
|
|
59
|
+
id: string;
|
|
60
|
+
label: string;
|
|
61
|
+
hidden: boolean;
|
|
62
|
+
};
|
|
63
|
+
} | undefined;
|
|
64
|
+
export declare function createPlannerGuide(options: {
|
|
65
|
+
targets?: ShellTargets;
|
|
66
|
+
isMounted: () => boolean;
|
|
67
|
+
revealMenu?: () => void;
|
|
68
|
+
}): PlannerGuideHandle;
|
|
69
|
+
//# sourceMappingURL=guide.d.ts.map
|