@happyvertical/smrt-planner 0.57.12 → 0.57.13

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.
Files changed (619) hide show
  1. package/README.md +136 -0
  2. package/agents/assistant.md +49 -0
  3. package/agents/commands.md +2 -2
  4. package/agents/cookbook.md +3 -1
  5. package/agents/shell.md +9 -7
  6. package/app/404.html +21 -21
  7. package/app/_app/immutable/assets/2.D3Ee82Nk.css +1 -0
  8. package/app/_app/immutable/assets/AppShell.Y0ysizZK.css +1 -0
  9. package/app/_app/immutable/assets/{icons.BDx21rPt.css → icons.DFiHs25V.css} +1 -1
  10. package/app/_app/immutable/chunks/3dpUaAuL.js +1 -0
  11. package/app/_app/immutable/chunks/{BxyJ_Q7v.js → B7IsOdeU.js} +1 -1
  12. package/app/_app/immutable/chunks/{8MGlmWc0.js → BErRmq61.js} +1 -1
  13. package/app/_app/immutable/chunks/BFzGVZ83.js +1 -0
  14. package/app/_app/immutable/chunks/{DU3stPaX.js → BLDa0UGj.js} +1 -1
  15. package/app/_app/immutable/chunks/BMXU0KTB.js +1 -0
  16. package/app/_app/immutable/chunks/{B88mVEob.js → B_D0zDev.js} +1 -1
  17. package/app/_app/immutable/chunks/{2dmW8nz3.js → BmSVFsOo.js} +2 -2
  18. package/app/_app/immutable/chunks/{CsaWd8kG.js → Bs5WxZDd.js} +1 -1
  19. package/app/_app/immutable/chunks/By9nPosf.js +1 -0
  20. package/app/_app/immutable/chunks/CB9iikrD.js +4 -0
  21. package/app/_app/immutable/chunks/{pEiNEXSh.js → CBxjHrPs.js} +1 -1
  22. package/app/_app/immutable/chunks/CO-Ek-HE.js +1 -0
  23. package/app/_app/immutable/chunks/{oV81RcfI.js → COQfu_Wm.js} +1 -1
  24. package/app/_app/immutable/chunks/{DDtOXC2p.js → CQ3bytDT.js} +1 -1
  25. package/app/_app/immutable/chunks/{D4791-Ex.js → CQOJdp0U.js} +1 -1
  26. package/app/_app/immutable/chunks/{CQFoqqzT.js → CT1UgNrl.js} +1 -1
  27. package/app/_app/immutable/chunks/CrMrQCWf.js +1 -0
  28. package/app/_app/immutable/chunks/{BTm4M8Ke.js → CwTLkgbW.js} +1 -1
  29. package/app/_app/immutable/chunks/{BCvXlTRf.js → CyuTEXp6.js} +1 -1
  30. package/app/_app/immutable/chunks/CzqXjCHa.js +16 -0
  31. package/app/_app/immutable/chunks/DMDdJExi.js +10 -0
  32. package/app/_app/immutable/chunks/{_CcVkMEQ.js → DPbSjNti.js} +1 -1
  33. package/app/_app/immutable/chunks/{BgtC60Dj.js → DSKWzY3b.js} +2 -2
  34. package/app/_app/immutable/chunks/{ByKA-VaR.js → DcYfN1RJ.js} +1 -1
  35. package/app/_app/immutable/chunks/KILEpkAY.js +26 -0
  36. package/app/_app/immutable/chunks/Uwmgg65i.js +1 -0
  37. package/app/_app/immutable/chunks/XcCBLn0p.js +2 -0
  38. package/app/_app/immutable/chunks/{bBI0F4nt.js → aqYPhamJ.js} +1 -1
  39. package/app/_app/immutable/chunks/{38SS-Q6Y.js → c4Y8im5f.js} +22 -22
  40. package/app/_app/immutable/chunks/{DbH3RuTE.js → gObjQOc6.js} +1 -1
  41. package/app/_app/immutable/chunks/{BQgbhyQu.js → jY83yXmZ.js} +1 -1
  42. package/app/_app/immutable/chunks/k-HWowNp.js +2 -0
  43. package/app/_app/immutable/entry/{app.C8En00Ny.js → app.BFvVYIAu.js} +2 -2
  44. package/app/_app/immutable/entry/start.CjnnBAhi.js +1 -0
  45. package/app/_app/immutable/nodes/0.BV0A9Ub7.js +7 -0
  46. package/app/_app/immutable/nodes/{1.CoV_40km.js → 1.B8lnDjjl.js} +1 -1
  47. package/app/_app/immutable/nodes/10.Dga6nV_M.js +3 -0
  48. package/app/_app/immutable/nodes/{11.Csg6XAcG.js → 11.SN8IoTqm.js} +1 -1
  49. package/app/_app/immutable/nodes/{12.CuTHLuEu.js → 12.CmhheIVU.js} +1 -1
  50. package/app/_app/immutable/nodes/{13.CNdfx5uO.js → 13.Eh2aPgMP.js} +1 -1
  51. package/app/_app/immutable/nodes/14.ReLktgLz.js +1 -0
  52. package/app/_app/immutable/nodes/2.Dc32ZcWd.js +22 -0
  53. package/app/_app/immutable/nodes/{3.DC8-sgUI.js → 3.CuIErDvM.js} +1 -1
  54. package/app/_app/immutable/nodes/{4.DcX0DIX9.js → 4.62S4SMa5.js} +1 -1
  55. package/app/_app/immutable/nodes/{5.Opk77twi.js → 5.DZx2uQQp.js} +1 -1
  56. package/app/_app/immutable/nodes/{6.Uk9tXC7t.js → 6.Dzh2j8Eu.js} +1 -1
  57. package/app/_app/immutable/nodes/7.BndE5mEj.js +1 -0
  58. package/app/_app/immutable/nodes/{8.CacSxuCP.js → 8.B79dJpLW.js} +1 -1
  59. package/app/_app/immutable/nodes/{9.z7vXbrbH.js → 9.Di1DpDGF.js} +1 -1
  60. package/app/_app/version.json +1 -1
  61. package/app/advanced-styles/index.html +24 -24
  62. package/app/ai/index.html +28 -28
  63. package/app/blueprint/index.html +22 -22
  64. package/app/cookbook/index.html +22 -22
  65. package/app/index.html +38 -40
  66. package/app/m/ads/AdDeliveryTier/index.html +27 -27
  67. package/app/m/ads/AdEvent/index.html +27 -27
  68. package/app/m/ads/AdFormat/index.html +27 -27
  69. package/app/m/ads/AdGroup/index.html +27 -27
  70. package/app/m/ads/AdVariation/index.html +27 -27
  71. package/app/m/analytics/AnalyticsDataStream/index.html +27 -27
  72. package/app/m/analytics/AnalyticsEvent/index.html +27 -27
  73. package/app/m/analytics/AnalyticsProperty/index.html +27 -27
  74. package/app/m/analytics/AnalyticsReport/index.html +27 -27
  75. package/app/m/approvals/ApprovalEvent/index.html +27 -27
  76. package/app/m/approvals/ApprovalPolicy/index.html +27 -27
  77. package/app/m/approvals/ApprovalRequest/index.html +27 -27
  78. package/app/m/assets/Asset/attachments/index.html +28 -28
  79. package/app/m/assets/Asset/index.html +27 -27
  80. package/app/m/assets/AssetAssociation/index.html +27 -27
  81. package/app/m/assets/AssetMetafield/index.html +27 -27
  82. package/app/m/assets/AssetStatus/index.html +27 -27
  83. package/app/m/assets/AssetType/index.html +27 -27
  84. package/app/m/assets/Folder/index.html +27 -27
  85. package/app/m/chat/AgentSession/index.html +27 -27
  86. package/app/m/chat/ChatMessage/index.html +27 -27
  87. package/app/m/chat/ChatParticipant/index.html +27 -27
  88. package/app/m/chat/ChatReaction/index.html +27 -27
  89. package/app/m/chat/ChatRoom/index.html +27 -27
  90. package/app/m/chat/ChatThread/index.html +27 -27
  91. package/app/m/chat/VoiceGatewayTurn/index.html +27 -27
  92. package/app/m/chat/VoiceSession/index.html +27 -27
  93. package/app/m/commerce/Agreement/index.html +27 -27
  94. package/app/m/commerce/Cart/index.html +27 -27
  95. package/app/m/commerce/Contract/index.html +27 -27
  96. package/app/m/commerce/ContractLineItem/index.html +27 -27
  97. package/app/m/commerce/Customer/index.html +27 -27
  98. package/app/m/commerce/DocumentTax/index.html +27 -27
  99. package/app/m/commerce/Estimate/index.html +27 -27
  100. package/app/m/commerce/Fulfillment/index.html +27 -27
  101. package/app/m/commerce/FulfillmentLineItem/index.html +27 -27
  102. package/app/m/commerce/HistoricalCustomerFunds/index.html +27 -27
  103. package/app/m/commerce/HistoricalCustomerFundsAllocation/index.html +27 -27
  104. package/app/m/commerce/HistoricalSalesLine/index.html +27 -27
  105. package/app/m/commerce/Invoice/index.html +27 -27
  106. package/app/m/commerce/InvoiceLineItem/index.html +27 -27
  107. package/app/m/commerce/Lease/index.html +27 -27
  108. package/app/m/commerce/LicenseSale/index.html +27 -27
  109. package/app/m/commerce/Order/index.html +27 -27
  110. package/app/m/commerce/Payment/index.html +27 -27
  111. package/app/m/commerce/PaymentAllocation/index.html +27 -27
  112. package/app/m/commerce/PaymentInstrument/index.html +27 -27
  113. package/app/m/commerce/PaymentIntent/index.html +27 -27
  114. package/app/m/commerce/Payout/index.html +27 -27
  115. package/app/m/commerce/ProductionOrder/index.html +27 -27
  116. package/app/m/commerce/PurchaseContract/index.html +27 -27
  117. package/app/m/commerce/PurchaseOrder/index.html +27 -27
  118. package/app/m/commerce/SalesContract/index.html +27 -27
  119. package/app/m/commerce/SupplierQuote/index.html +27 -27
  120. package/app/m/commerce/TaxCode/index.html +27 -27
  121. package/app/m/commerce/TaxComponent/index.html +27 -27
  122. package/app/m/commerce/TaxSettings/index.html +27 -27
  123. package/app/m/commerce/TaxSummaryReport/index.html +27 -27
  124. package/app/m/commerce/TenantPaymentAccount/index.html +27 -27
  125. package/app/m/commerce/Vendor/index.html +27 -27
  126. package/app/m/commerce/WholesaleOrder/index.html +27 -27
  127. package/app/m/content/Content/index.html +27 -27
  128. package/app/m/content/ContentContribution/index.html +27 -27
  129. package/app/m/content/ContentContributionAttachment/index.html +27 -27
  130. package/app/m/content/ContentContributionRevision/index.html +27 -27
  131. package/app/m/content/ContentContributionType/index.html +27 -27
  132. package/app/m/content/ContentContributor/index.html +27 -27
  133. package/app/m/content/ContentCorrection/index.html +27 -27
  134. package/app/m/content/ContentFeedSource/index.html +27 -27
  135. package/app/m/content/ContentGovernanceAssignment/index.html +27 -27
  136. package/app/m/content/ContentGovernancePolicy/index.html +27 -27
  137. package/app/m/content/ContentGovernanceProfile/index.html +27 -27
  138. package/app/m/content/ContentReference/index.html +27 -27
  139. package/app/m/content/ContentReview/index.html +27 -27
  140. package/app/m/content/ContentVersion/index.html +27 -27
  141. package/app/m/events/Event/index.html +27 -27
  142. package/app/m/events/EventParticipant/index.html +27 -27
  143. package/app/m/events/EventSeries/index.html +27 -27
  144. package/app/m/events/EventType/index.html +27 -27
  145. package/app/m/expenses/Expense/index.html +27 -27
  146. package/app/m/facts/Fact/index.html +27 -27
  147. package/app/m/facts/FactContent/index.html +27 -27
  148. package/app/m/facts/FactEvidence/index.html +27 -27
  149. package/app/m/facts/FactSource/index.html +27 -27
  150. package/app/m/facts/FactSubject/index.html +27 -27
  151. package/app/m/facts/FactTag/index.html +27 -27
  152. package/app/m/fields/FieldPolicy/index.html +27 -27
  153. package/app/m/fields/FieldPolicySuggestion/index.html +27 -27
  154. package/app/m/fields/FieldUsageCounter/index.html +27 -27
  155. package/app/m/images/Image/index.html +27 -27
  156. package/app/m/inventory/InventoryLocation/index.html +27 -27
  157. package/app/m/inventory/StockLevel/index.html +27 -27
  158. package/app/m/inventory/StockMovement/index.html +27 -27
  159. package/app/m/ledgers/Account/index.html +27 -27
  160. package/app/m/ledgers/Journal/index.html +27 -27
  161. package/app/m/ledgers/JournalEntry/index.html +27 -27
  162. package/app/m/ledgers/Ledger/index.html +27 -27
  163. package/app/m/manufacturing/Assembly/index.html +27 -27
  164. package/app/m/manufacturing/BillOfMaterials/index.html +27 -27
  165. package/app/m/manufacturing/BomLine/index.html +27 -27
  166. package/app/m/manufacturing/Operation/index.html +27 -27
  167. package/app/m/manufacturing/ProductionRun/index.html +27 -27
  168. package/app/m/manufacturing/ProductionRunCompletion/index.html +27 -27
  169. package/app/m/manufacturing/RoutingStep/index.html +27 -27
  170. package/app/m/marketing/Campaign/index.html +27 -27
  171. package/app/m/marketing/CampaignChannel/index.html +27 -27
  172. package/app/m/marketing/CampaignMetricSnapshot/index.html +27 -27
  173. package/app/m/messages/Account/index.html +27 -27
  174. package/app/m/messages/Attachment/index.html +27 -27
  175. package/app/m/messages/Blacklist/index.html +27 -27
  176. package/app/m/messages/Email/failed-sends/index.html +28 -28
  177. package/app/m/messages/Email/index.html +27 -27
  178. package/app/m/messages/Email/mailbox/index.html +28 -28
  179. package/app/m/messages/EmailAccount/index.html +27 -27
  180. package/app/m/messages/EmailAttachment/index.html +27 -27
  181. package/app/m/messages/EmailFolder/index.html +27 -27
  182. package/app/m/messages/Message/index.html +27 -27
  183. package/app/m/messages/MessagingEndpoint/index.html +27 -27
  184. package/app/m/messages/PersonaMessageRoute/index.html +27 -27
  185. package/app/m/messages/SlackAccount/index.html +27 -27
  186. package/app/m/messages/SlackMessage/index.html +27 -27
  187. package/app/m/messages/TelegramAccount/index.html +27 -27
  188. package/app/m/messages/Tweet/index.html +27 -27
  189. package/app/m/messages/TwitterAccount/index.html +27 -27
  190. package/app/m/messages/Whitelist/index.html +27 -27
  191. package/app/m/messages/ZulipAccount/index.html +27 -27
  192. package/app/m/places/Place/index.html +27 -27
  193. package/app/m/places/PlaceType/index.html +27 -27
  194. package/app/m/products/Category/index.html +27 -27
  195. package/app/m/products/Material/index.html +27 -27
  196. package/app/m/products/Product/index.html +27 -27
  197. package/app/m/products/Product/ingredients/index.html +28 -28
  198. package/app/m/products/ProductVariant/index.html +27 -27
  199. package/app/m/products/Sku/index.html +27 -27
  200. package/app/m/profiles/ApiKey/index.html +27 -27
  201. package/app/m/profiles/Bot/index.html +27 -27
  202. package/app/m/profiles/MagicLinkToken/index.html +27 -27
  203. package/app/m/profiles/NostrIdentity/index.html +27 -27
  204. package/app/m/profiles/OidcIdentity/index.html +27 -27
  205. package/app/m/profiles/Organization/index.html +27 -27
  206. package/app/m/profiles/Person/index.html +27 -27
  207. package/app/m/profiles/Profile/index.html +27 -27
  208. package/app/m/profiles/ProfileMetadata/index.html +27 -27
  209. package/app/m/profiles/ProfileMetafield/index.html +27 -27
  210. package/app/m/profiles/ProfileRelationship/index.html +27 -27
  211. package/app/m/profiles/ProfileRelationshipTerm/index.html +27 -27
  212. package/app/m/profiles/ProfileRelationshipType/index.html +27 -27
  213. package/app/m/profiles/ProfileType/index.html +27 -27
  214. package/app/m/projects/Comment/index.html +27 -27
  215. package/app/m/projects/Issue/index.html +27 -27
  216. package/app/m/projects/Label/index.html +27 -27
  217. package/app/m/projects/Project/index.html +27 -27
  218. package/app/m/projects/ProjectIntegration/index.html +27 -27
  219. package/app/m/projects/PullRequest/index.html +27 -27
  220. package/app/m/projects/Repository/index.html +27 -27
  221. package/app/m/properties/Property/index.html +27 -27
  222. package/app/m/properties/Zone/index.html +27 -27
  223. package/app/m/reports/RuntimeReport/index.html +27 -27
  224. package/app/m/reports/SmrtPrincipalReportRefreshTask/index.html +27 -27
  225. package/app/m/reports/SmrtReportLock/index.html +27 -27
  226. package/app/m/reports/SmrtReportRefreshTask/index.html +27 -27
  227. package/app/m/reports/SmrtReportRun/index.html +27 -27
  228. package/app/m/reports/SmrtReportSchedule/index.html +27 -27
  229. package/app/m/reports/SmrtReportWatermark/index.html +27 -27
  230. package/app/m/sales/Agreement/index.html +27 -27
  231. package/app/m/sales/AttributionException/index.html +27 -27
  232. package/app/m/sales/AttributionPolicy/index.html +27 -27
  233. package/app/m/sales/Commission/index.html +27 -27
  234. package/app/m/sales/CommissionAdjustment/index.html +27 -27
  235. package/app/m/sales/CommissionPayout/index.html +27 -27
  236. package/app/m/sales/CommissionPlan/index.html +27 -27
  237. package/app/m/sales/Earner/index.html +27 -27
  238. package/app/m/sales/EarnerSourceAttribution/index.html +27 -27
  239. package/app/m/sales/EarningEvent/index.html +27 -27
  240. package/app/m/sales/ExecutedAgreement/index.html +27 -27
  241. package/app/m/sales/Lead/index.html +27 -27
  242. package/app/m/sales/Opportunity/index.html +27 -27
  243. package/app/m/sales/OpportunityConversion/index.html +27 -27
  244. package/app/m/sales/PipelineDefinition/index.html +27 -27
  245. package/app/m/sales/PipelineStage/index.html +27 -27
  246. package/app/m/sales/Referral/index.html +27 -27
  247. package/app/m/sales/ReferralAgreement/index.html +27 -27
  248. package/app/m/sales/ReferralLink/index.html +27 -27
  249. package/app/m/sales/ReferralProgram/index.html +27 -27
  250. package/app/m/sales/ReferralTermSnapshot/index.html +27 -27
  251. package/app/m/sales/ReferralTouch/index.html +27 -27
  252. package/app/m/sales/Referrer/index.html +27 -27
  253. package/app/m/sales/SalesActivity/index.html +27 -27
  254. package/app/m/sales/SalesRepresentative/index.html +27 -27
  255. package/app/m/sites/Site/index.html +27 -27
  256. package/app/m/sites/SiteAgentBinding/index.html +27 -27
  257. package/app/m/social/OAuthState/index.html +27 -27
  258. package/app/m/social/SocialAccount/index.html +27 -27
  259. package/app/m/social/SocialPost/index.html +27 -27
  260. package/app/m/social/SocialPostAnalyticsSnapshot/index.html +27 -27
  261. package/app/m/subscriptions/BillingAdjustment/index.html +27 -27
  262. package/app/m/subscriptions/ClientCharge/index.html +27 -27
  263. package/app/m/subscriptions/CreditGrant/index.html +27 -27
  264. package/app/m/subscriptions/PricingRule/index.html +27 -27
  265. package/app/m/subscriptions/RetailCharge/index.html +27 -27
  266. package/app/m/subscriptions/SpendingPolicy/index.html +27 -27
  267. package/app/m/subscriptions/SubscriptionPlan/index.html +27 -27
  268. package/app/m/subscriptions/SubscriptionPlanVersion/index.html +27 -27
  269. package/app/m/subscriptions/TenantSubscription/index.html +27 -27
  270. package/app/m/subscriptions/TenantUsageMetric/index.html +27 -27
  271. package/app/m/support/ServiceTimeEntry/index.html +27 -27
  272. package/app/m/support/SupportAiRun/index.html +27 -27
  273. package/app/m/support/SupportAvailability/index.html +27 -27
  274. package/app/m/support/SupportCase/index.html +27 -27
  275. package/app/m/support/SupportCaseEvent/index.html +27 -27
  276. package/app/m/support/SupportChannelBinding/index.html +27 -27
  277. package/app/m/support/SupportCharge/index.html +27 -27
  278. package/app/m/support/SupportCompensation/index.html +27 -27
  279. package/app/m/support/SupportCompensationPlan/index.html +27 -27
  280. package/app/m/support/SupportEscalation/index.html +27 -27
  281. package/app/m/support/SupportInteraction/index.html +27 -27
  282. package/app/m/support/SupportPlan/index.html +27 -27
  283. package/app/m/support/SupportPolicy/index.html +27 -27
  284. package/app/m/support/SupportQualification/index.html +27 -27
  285. package/app/m/support/SupportServiceTarget/index.html +27 -27
  286. package/app/m/support/SupportSpecialist/index.html +27 -27
  287. package/app/m/support/SupportWorkLink/index.html +27 -27
  288. package/app/m/tags/Tag/index.html +27 -27
  289. package/app/m/tags/TagAlias/index.html +27 -27
  290. package/app/m/timesheets/AttendanceBreak/index.html +27 -27
  291. package/app/m/timesheets/AttendancePunch/index.html +27 -27
  292. package/app/m/timesheets/AttendanceSegment/index.html +27 -27
  293. package/app/m/timesheets/ServiceChargeSnapshot/index.html +27 -27
  294. package/app/m/timesheets/ServiceCompensationSnapshot/index.html +27 -27
  295. package/app/m/timesheets/ServiceTimeEntry/index.html +27 -27
  296. package/app/m/users/Group/index.html +27 -27
  297. package/app/m/users/GroupMember/index.html +27 -27
  298. package/app/m/users/GroupRole/index.html +27 -27
  299. package/app/m/users/Membership/index.html +27 -27
  300. package/app/m/users/MembershipOverride/index.html +27 -27
  301. package/app/m/users/Permission/index.html +27 -27
  302. package/app/m/users/Role/index.html +27 -27
  303. package/app/m/users/RolePermission/index.html +27 -27
  304. package/app/m/users/Session/index.html +27 -27
  305. package/app/m/users/Tenant/index.html +27 -27
  306. package/app/m/users/TenantIntegration/index.html +27 -27
  307. package/app/m/users/TenantPermissionOverride/index.html +27 -27
  308. package/app/m/users/User/index.html +27 -27
  309. package/app/m/video/Character/index.html +27 -27
  310. package/app/m/video/CharacterAsset/index.html +27 -27
  311. package/app/m/video/CompositeJob/index.html +27 -27
  312. package/app/m/video/Performer/index.html +27 -27
  313. package/app/m/video/PerformerAsset/index.html +27 -27
  314. package/app/m/video/Scene/index.html +27 -27
  315. package/app/m/video/SceneAsset/index.html +27 -27
  316. package/app/m/video/VideoComposition/index.html +27 -27
  317. package/app/m/video/VideoCompositionAsset/index.html +27 -27
  318. package/app/m/video/VideoSequence/index.html +27 -27
  319. package/app/m/video/VideoSequenceAsset/index.html +27 -27
  320. package/app/m/video/VideoShot/index.html +27 -27
  321. package/app/m/video/VideoShotAsset/index.html +27 -27
  322. package/app/m/video/VideoShotCharacter/index.html +27 -27
  323. package/app/m/video/VideoWorkflow/index.html +27 -27
  324. package/app/m/voice/VoiceOutput/index.html +27 -27
  325. package/app/m/voice/VoiceProfile/index.html +27 -27
  326. package/app/m/voice/VoiceSample/index.html +27 -27
  327. package/app/mcp.html +2 -2
  328. package/app/packages/ads/index.html +24 -24
  329. package/app/packages/analytics/index.html +24 -24
  330. package/app/packages/approvals/index.html +24 -24
  331. package/app/packages/assets/index.html +24 -24
  332. package/app/packages/chat/index.html +24 -24
  333. package/app/packages/comments/index.html +24 -24
  334. package/app/packages/commerce/index.html +24 -24
  335. package/app/packages/content/index.html +24 -24
  336. package/app/packages/events/index.html +24 -24
  337. package/app/packages/expenses/index.html +24 -24
  338. package/app/packages/facts/index.html +24 -24
  339. package/app/packages/fields/index.html +24 -24
  340. package/app/packages/human-resources/index.html +24 -24
  341. package/app/packages/images/index.html +24 -24
  342. package/app/packages/index.html +23 -23
  343. package/app/packages/ingestion/index.html +24 -24
  344. package/app/packages/inventory/index.html +24 -24
  345. package/app/packages/ledgers/index.html +24 -24
  346. package/app/packages/manufacturing/index.html +24 -24
  347. package/app/packages/marketing/index.html +24 -24
  348. package/app/packages/messages/index.html +24 -24
  349. package/app/packages/places/index.html +24 -24
  350. package/app/packages/preferences/index.html +24 -24
  351. package/app/packages/products/index.html +24 -24
  352. package/app/packages/profiles/index.html +24 -24
  353. package/app/packages/projects/index.html +24 -24
  354. package/app/packages/properties/index.html +24 -24
  355. package/app/packages/reports/index.html +24 -24
  356. package/app/packages/sales/index.html +24 -24
  357. package/app/packages/sites/index.html +24 -24
  358. package/app/packages/social/index.html +24 -24
  359. package/app/packages/subscriptions/index.html +24 -24
  360. package/app/packages/support/index.html +24 -24
  361. package/app/packages/tags/index.html +24 -24
  362. package/app/packages/timesheets/index.html +24 -24
  363. package/app/packages/users/index.html +24 -24
  364. package/app/packages/video/index.html +24 -24
  365. package/app/packages/voice/index.html +24 -24
  366. package/app/packages/webhooks/index.html +24 -24
  367. package/app/recipes/account-access/help/index.html +24 -24
  368. package/app/recipes/account-access/index.html +26 -26
  369. package/app/recipes/activity/help/index.html +24 -24
  370. package/app/recipes/activity/index.html +26 -26
  371. package/app/recipes/agreements/help/index.html +24 -24
  372. package/app/recipes/agreements/index.html +26 -26
  373. package/app/recipes/analytics.reports/help/index.html +24 -24
  374. package/app/recipes/analytics.reports/index.html +26 -26
  375. package/app/recipes/assets/help/index.html +24 -24
  376. package/app/recipes/assets/index.html +26 -26
  377. package/app/recipes/billing/help/index.html +24 -24
  378. package/app/recipes/billing/index.html +26 -26
  379. package/app/recipes/chat.assistant/help/index.html +24 -24
  380. package/app/recipes/chat.assistant/index.html +26 -26
  381. package/app/recipes/comments/help/index.html +24 -24
  382. package/app/recipes/comments/index.html +26 -26
  383. package/app/recipes/commerce.customers/help/index.html +24 -24
  384. package/app/recipes/commerce.customers/index.html +26 -26
  385. package/app/recipes/commerce.estimates/help/index.html +24 -24
  386. package/app/recipes/commerce.estimates/index.html +26 -26
  387. package/app/recipes/commerce.purchases/help/index.html +24 -24
  388. package/app/recipes/commerce.purchases/index.html +26 -26
  389. package/app/recipes/commerce.sales/help/index.html +24 -24
  390. package/app/recipes/commerce.sales/index.html +26 -26
  391. package/app/recipes/commerce.vendors/help/index.html +24 -24
  392. package/app/recipes/commerce.vendors/index.html +26 -26
  393. package/app/recipes/commerce.wholesale/help/index.html +24 -24
  394. package/app/recipes/commerce.wholesale/index.html +26 -26
  395. package/app/recipes/events.calendar/help/index.html +24 -24
  396. package/app/recipes/events.calendar/index.html +26 -26
  397. package/app/recipes/expenses.tracking/help/index.html +24 -24
  398. package/app/recipes/expenses.tracking/index.html +26 -26
  399. package/app/recipes/fields.form-customization/help/index.html +24 -24
  400. package/app/recipes/fields.form-customization/index.html +26 -26
  401. package/app/recipes/ingestion/help/index.html +24 -24
  402. package/app/recipes/ingestion/index.html +26 -26
  403. package/app/recipes/integrations/help/index.html +24 -24
  404. package/app/recipes/integrations/index.html +26 -26
  405. package/app/recipes/inventory.stock/help/index.html +24 -24
  406. package/app/recipes/inventory.stock/index.html +26 -26
  407. package/app/recipes/ledgers.bookkeeping/help/index.html +24 -24
  408. package/app/recipes/ledgers.bookkeeping/index.html +26 -26
  409. package/app/recipes/messages/help/index.html +24 -24
  410. package/app/recipes/messages/index.html +26 -26
  411. package/app/recipes/products/help/index.html +24 -24
  412. package/app/recipes/products/index.html +26 -26
  413. package/app/recipes/projects.tracker/help/index.html +24 -24
  414. package/app/recipes/projects.tracker/index.html +26 -26
  415. package/app/recipes/reports.materialized/help/index.html +24 -24
  416. package/app/recipes/reports.materialized/index.html +26 -26
  417. package/app/recipes/reports.runtime/help/index.html +24 -24
  418. package/app/recipes/reports.runtime/index.html +26 -26
  419. package/app/recipes/sales.pipeline/help/index.html +24 -24
  420. package/app/recipes/sales.pipeline/index.html +26 -26
  421. package/app/recipes/tags.taxonomy/help/index.html +24 -24
  422. package/app/recipes/tags.taxonomy/index.html +26 -26
  423. package/app/recipes/team-collaboration/help/index.html +24 -24
  424. package/app/recipes/team-collaboration/index.html +26 -26
  425. package/app/recipes/timesheets.time-entries/help/index.html +24 -24
  426. package/app/recipes/timesheets.time-entries/index.html +26 -26
  427. package/app/s/custom-accounts/index.html +23 -23
  428. package/app/s/custom-appointments/index.html +23 -23
  429. package/app/s/custom-billing/index.html +23 -23
  430. package/app/s/custom-bookings/index.html +23 -23
  431. package/app/s/custom-buying/index.html +23 -23
  432. package/app/s/custom-checkout/index.html +23 -23
  433. package/app/s/custom-classes/index.html +23 -23
  434. package/app/s/custom-clients/index.html +23 -23
  435. package/app/s/custom-events/index.html +23 -23
  436. package/app/s/custom-fleet/index.html +23 -23
  437. package/app/s/custom-gigs/index.html +23 -23
  438. package/app/s/custom-giving/index.html +23 -23
  439. package/app/s/custom-instruments/index.html +23 -23
  440. package/app/s/custom-jobs/index.html +23 -23
  441. package/app/s/custom-kitchen/index.html +23 -23
  442. package/app/s/custom-lessons/index.html +23 -23
  443. package/app/s/custom-material/index.html +23 -23
  444. package/app/s/custom-meetings/index.html +23 -23
  445. package/app/s/custom-members/index.html +23 -23
  446. package/app/s/custom-merch/index.html +23 -23
  447. package/app/s/custom-money/index.html +23 -23
  448. package/app/s/custom-paint/index.html +23 -23
  449. package/app/s/custom-parts/index.html +23 -23
  450. package/app/s/custom-rentals/index.html +23 -23
  451. package/app/s/custom-roastery/index.html +23 -23
  452. package/app/s/custom-schedule/index.html +23 -23
  453. package/app/s/custom-shelf/index.html +23 -23
  454. package/app/s/custom-shop/index.html +23 -23
  455. package/app/s/custom-students/index.html +23 -23
  456. package/app/s/custom-wholesale/index.html +23 -23
  457. package/app/s/custom-work/index.html +23 -23
  458. package/app/s/custom-yard/index.html +23 -23
  459. package/app/s/section-access-control/index.html +23 -23
  460. package/app/s/section-account-security/index.html +23 -23
  461. package/app/s/section-accounting/index.html +23 -23
  462. package/app/s/section-activity/index.html +23 -23
  463. package/app/s/section-agreements/index.html +23 -23
  464. package/app/s/section-analytics/index.html +23 -23
  465. package/app/s/section-assets/index.html +23 -23
  466. package/app/s/section-billing/index.html +23 -23
  467. package/app/s/section-calendar/index.html +23 -23
  468. package/app/s/section-catalog/index.html +23 -23
  469. package/app/s/section-chat.assistant/index.html +23 -23
  470. package/app/s/section-comments/index.html +23 -23
  471. package/app/s/section-fields.form-customization/index.html +23 -23
  472. package/app/s/section-ingestion/index.html +23 -23
  473. package/app/s/section-integrations/index.html +23 -23
  474. package/app/s/section-messages/index.html +23 -23
  475. package/app/s/section-more/index.html +23 -23
  476. package/app/s/section-operations/index.html +23 -23
  477. package/app/s/section-projects/index.html +23 -23
  478. package/app/s/section-purchasing/index.html +23 -23
  479. package/app/s/section-reports.materialized/index.html +23 -23
  480. package/app/s/section-reports.runtime/index.html +23 -23
  481. package/app/s/section-sales/index.html +23 -23
  482. package/app/s/section-taxonomy/index.html +23 -23
  483. package/app/s/section-team/index.html +23 -23
  484. package/app/s/section-work/index.html +23 -23
  485. package/dist/ai/instance.d.ts.map +1 -1
  486. package/dist/ai/instance.js +2 -0
  487. package/dist/assistant/change.d.ts +2 -0
  488. package/dist/assistant/change.d.ts.map +1 -1
  489. package/dist/assistant/change.js +5 -0
  490. package/dist/assistant/coaching.d.ts +7 -0
  491. package/dist/assistant/coaching.d.ts.map +1 -0
  492. package/dist/assistant/coaching.js +42 -0
  493. package/dist/assistant/prompt.d.ts.map +1 -1
  494. package/dist/assistant/prompt.js +1 -0
  495. package/dist/assistant/session.svelte.d.ts +4 -1
  496. package/dist/assistant/session.svelte.d.ts.map +1 -1
  497. package/dist/assistant/session.svelte.js +5 -1
  498. package/dist/assistant/starters.d.ts +7 -0
  499. package/dist/assistant/starters.d.ts.map +1 -0
  500. package/dist/assistant/starters.js +33 -0
  501. package/dist/assistant/transport.d.ts +37 -2
  502. package/dist/assistant/transport.d.ts.map +1 -1
  503. package/dist/assistant/transport.js +257 -56
  504. package/dist/catalog/catalog.json +38 -38
  505. package/dist/components/BrowserAssistant.svelte +20 -0
  506. package/dist/components/BrowserAssistant.svelte.d.ts.map +1 -1
  507. package/dist/components/ExportPanel.svelte +176 -118
  508. package/dist/components/ExportPanel.svelte.d.ts +8 -0
  509. package/dist/components/ExportPanel.svelte.d.ts.map +1 -1
  510. package/dist/components/HeaderIconLink.svelte +8 -0
  511. package/dist/components/HeaderIconLink.svelte.d.ts +1 -0
  512. package/dist/components/HeaderIconLink.svelte.d.ts.map +1 -1
  513. package/dist/components/ProjectControls.svelte +133 -0
  514. package/dist/components/ProjectControls.svelte.d.ts +15 -0
  515. package/dist/components/ProjectControls.svelte.d.ts.map +1 -0
  516. package/dist/components/SectionOverview.svelte +4 -5
  517. package/dist/components/SectionOverview.svelte.d.ts +1 -1
  518. package/dist/components/SectionOverview.svelte.d.ts.map +1 -1
  519. package/dist/components/SettingsPanel.svelte +37 -1
  520. package/dist/components/SettingsPanel.svelte.d.ts +7 -1
  521. package/dist/components/SettingsPanel.svelte.d.ts.map +1 -1
  522. package/dist/cookbook/file.d.ts +5 -0
  523. package/dist/cookbook/file.d.ts.map +1 -1
  524. package/dist/cookbook/file.js +9 -2
  525. package/dist/cookbook/store.svelte.d.ts +4 -1
  526. package/dist/cookbook/store.svelte.d.ts.map +1 -1
  527. package/dist/cookbook/store.svelte.js +9 -10
  528. package/dist/core/index.d.ts +1 -0
  529. package/dist/core/index.d.ts.map +1 -1
  530. package/dist/core/index.js +1 -0
  531. package/dist/core/prompt.d.ts.map +1 -1
  532. package/dist/core/prompt.js +10 -0
  533. package/dist/core/reply.d.ts +2 -0
  534. package/dist/core/reply.d.ts.map +1 -1
  535. package/dist/core/reply.js +4 -0
  536. package/dist/data/packs.d.ts.map +1 -1
  537. package/dist/data/packs.js +14 -7
  538. package/dist/data/planner-source.d.ts.map +1 -1
  539. package/dist/data/planner-source.js +4 -3
  540. package/dist/data/sample-context.d.ts +84 -0
  541. package/dist/data/sample-context.d.ts.map +1 -0
  542. package/dist/data/sample-context.js +106 -0
  543. package/dist/data/source.d.ts.map +1 -1
  544. package/dist/data/source.js +2 -0
  545. package/dist/index.d.ts +8 -1
  546. package/dist/index.d.ts.map +1 -1
  547. package/dist/index.js +3 -0
  548. package/dist/library/state.svelte.d.ts.map +1 -1
  549. package/dist/library/state.svelte.js +3 -3
  550. package/dist/overviews/definitions.d.ts +2 -2
  551. package/dist/overviews/definitions.d.ts.map +1 -1
  552. package/dist/overviews/definitions.js +19 -31
  553. package/dist/overviews/page.d.ts.map +1 -1
  554. package/dist/overviews/page.js +4 -1
  555. package/dist/overviews/registry.d.ts +1 -1
  556. package/dist/overviews/registry.js +3 -3
  557. package/dist/overviews/validate.d.ts.map +1 -1
  558. package/dist/overviews/validate.js +15 -2
  559. package/dist/planner/Planner.svelte +46 -4
  560. package/dist/planner/Planner.svelte.d.ts.map +1 -1
  561. package/dist/planner/PlannerControls.svelte +18 -2
  562. package/dist/planner/PlannerControls.svelte.d.ts +2 -0
  563. package/dist/planner/PlannerControls.svelte.d.ts.map +1 -1
  564. package/dist/planner/PlannerHostAction.svelte +61 -0
  565. package/dist/planner/PlannerHostAction.svelte.d.ts +12 -0
  566. package/dist/planner/PlannerHostAction.svelte.d.ts.map +1 -0
  567. package/dist/planner/PlannerLifecycle.svelte +75 -5
  568. package/dist/planner/PlannerLifecycle.svelte.d.ts +2 -1
  569. package/dist/planner/PlannerLifecycle.svelte.d.ts.map +1 -1
  570. package/dist/planner/bridge.d.ts +73 -0
  571. package/dist/planner/bridge.d.ts.map +1 -0
  572. package/dist/planner/bridge.js +303 -0
  573. package/dist/planner/commands/adapter.d.ts +2 -0
  574. package/dist/planner/commands/adapter.d.ts.map +1 -1
  575. package/dist/planner/commands/adapter.js +19 -0
  576. package/dist/planner/export-context.d.ts +6 -0
  577. package/dist/planner/export-context.d.ts.map +1 -0
  578. package/dist/planner/export-context.js +14 -0
  579. package/dist/planner/guide.d.ts +69 -0
  580. package/dist/planner/guide.d.ts.map +1 -0
  581. package/dist/planner/guide.js +115 -0
  582. package/dist/planner/host-reply.d.ts +22 -0
  583. package/dist/planner/host-reply.d.ts.map +1 -0
  584. package/dist/planner/host-reply.js +71 -0
  585. package/dist/planner/shell.d.ts +6 -0
  586. package/dist/planner/shell.d.ts.map +1 -1
  587. package/dist/planner/shell.js +2 -0
  588. package/dist/planner/types.d.ts +39 -1
  589. package/dist/planner/types.d.ts.map +1 -1
  590. package/dist/planner/workspace-storage.d.ts +29 -0
  591. package/dist/planner/workspace-storage.d.ts.map +1 -0
  592. package/dist/planner/workspace-storage.js +355 -0
  593. package/dist/planner/workspace.svelte.d.ts +19 -0
  594. package/dist/planner/workspace.svelte.d.ts.map +1 -0
  595. package/dist/planner/workspace.svelte.js +52 -0
  596. package/dist/smrt-version.d.ts +1 -1
  597. package/dist/smrt-version.js +1 -1
  598. package/package.json +54 -54
  599. package/app/_app/immutable/assets/2.CdEXvRg0.css +0 -1
  600. package/app/_app/immutable/assets/AppShell.BkKNrxND.css +0 -1
  601. package/app/_app/immutable/chunks/5TDxHd66.js +0 -1
  602. package/app/_app/immutable/chunks/9PL91wDk.js +0 -4
  603. package/app/_app/immutable/chunks/9iVbSlQr.js +0 -16
  604. package/app/_app/immutable/chunks/B-xSgl5J.js +0 -1
  605. package/app/_app/immutable/chunks/BDKUpjK6.js +0 -2
  606. package/app/_app/immutable/chunks/Bq35Wl4H.js +0 -2
  607. package/app/_app/immutable/chunks/Cu77BRmy.js +0 -1
  608. package/app/_app/immutable/chunks/CxZIUuYu.js +0 -1
  609. package/app/_app/immutable/chunks/CzHmSbsw.js +0 -1
  610. package/app/_app/immutable/chunks/D71UrO5c.js +0 -1
  611. package/app/_app/immutable/chunks/DF-0MxNw.js +0 -1
  612. package/app/_app/immutable/chunks/DaWOaOo5.js +0 -10
  613. package/app/_app/immutable/chunks/aDZBV4Ss.js +0 -26
  614. package/app/_app/immutable/entry/start.DQ2WMDJa.js +0 -1
  615. package/app/_app/immutable/nodes/0.CjivLsXS.js +0 -7
  616. package/app/_app/immutable/nodes/10.CRcxQ1FU.js +0 -3
  617. package/app/_app/immutable/nodes/14.CvNTiqf4.js +0 -1
  618. package/app/_app/immutable/nodes/2.D8ImYTF0.js +0 -24
  619. package/app/_app/immutable/nodes/7.Q7dzrAos.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/lib/assistant/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,iBAAiB,EAKtB,KAAK,kBAAkB,EAGxB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,sEAAsE;AACtE,MAAM,WAAW,SAAS;IACxB,OAAO,CACL,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE;YAAE,IAAI,EAAE,QAAQ,GAAG,MAA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kDxD,oFAAoF;AACpF,eAAO,MAAM,eAAe,gCAAgC,CAAC;AAE7D,sFAAsF;AACtF,eAAO,MAAM,mBAAmB,gGAC+D,CAAC;AAEhG,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAE3D,kFAAkF;AAClF,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,cAAc,EACxB,EAAE,EAAE,MAAM,GACT,iBAAiB,CAoBnB;AA8GD,iDAAiD;AACjD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAErE;AAKD;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,GACf,MAAM,CAIR;AAwCD;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,uBAAuB,GAC/B,yBAAyB,CAsuB3B"}
@@ -1,8 +1,10 @@
1
1
  import { ASSISTANT_QUESTION_KIND, matchAssistantQuestionText, validateAssistantQuestionAnswer, } from '@happyvertical/smrt-chat/svelte';
2
2
  import { resolveRuntimeReportTimeRange } from '@happyvertical/smrt-reports/spec';
3
+ import { applySampleContext } from "../data/sample-context.js";
3
4
  import { createSliceController, } from "../planner/commands/index.js";
4
5
  import { sourceFollowUp, whichSourceQuestion, } from "../reports/intent.js";
5
6
  import { buildResponseSchema, describeChange, parseChange, } from "./change.js";
7
+ import { appliedCoaching } from "./coaching.js";
6
8
  import { buildMatchIndex, matchText } from "./match.js";
7
9
  import { buildSystemPrompt, REPORTS_RECIPE, } from "./prompt.js";
8
10
  const THREAD_TITLE = 'Plan your app';
@@ -27,8 +29,10 @@ const runSummary = (controller, name, input) => runCommand(controller, name, inp
27
29
  */
28
30
  function runCommands(controller, calls) {
29
31
  const lines = [];
32
+ const results = [];
30
33
  for (const call of calls) {
31
34
  const result = controller.run(call);
35
+ results.push(result);
32
36
  if (!result.ok) {
33
37
  lines.push(`The server's ${call.name} was refused: ${result.error.message}`);
34
38
  break;
@@ -36,7 +40,7 @@ function runCommands(controller, calls) {
36
40
  if (result.receipt.summary)
37
41
  lines.push(result.receipt.summary);
38
42
  }
39
- return lines.join(' ');
43
+ return { summary: lines.join(' '), results };
40
44
  }
41
45
  /** Said when a turn changed nothing and the model's sentence was not a question. */
42
46
  export const NOTHING_CHANGED = 'Nothing in the app changed.';
@@ -228,7 +232,32 @@ export function createBrowserAssistantTransport(options) {
228
232
  };
229
233
  const messages = [];
230
234
  const seen = new Map();
235
+ const seeds = new Set();
236
+ const listeners = new Set();
237
+ let busy = false;
238
+ let sent = false;
239
+ let generation = 0;
240
+ const conversation = () => structuredClone(messages);
241
+ const persist = () => {
242
+ try {
243
+ options.conversationStorage?.setItem('smrt-planner:conversation:v1', JSON.stringify({ version: 1, messages, sent, counter }));
244
+ options.conversationStorage?.setItem('smrt-planner:conversation-seed:v1', JSON.stringify([...seeds]));
245
+ }
246
+ catch {
247
+ /* A blocked or full browser store must not break a turn. */
248
+ }
249
+ };
250
+ const notify = () => {
251
+ persist();
252
+ for (const listener of listeners)
253
+ listener(conversation());
254
+ };
255
+ const cookbooksForTurn = () => typeof options.cookbooks === 'function'
256
+ ? options.cookbooks()
257
+ : (options.cookbooks ?? []);
231
258
  let controller = null;
259
+ const owns = (operation) => operation.epoch === generation && controller === operation.controller;
260
+ const active = (operation) => owns(operation) && !operation.controller.signal.aborted;
232
261
  /**
233
262
  * The report follow-up waiting for an answer: the intent so far, the
234
263
  * question asked (its options from the source descriptor), and the words
@@ -242,8 +271,10 @@ export function createBrowserAssistantTransport(options) {
242
271
  * identical question twice is never done: the sensible default is taken
243
272
  * and the reply says so.
244
273
  */
245
- async function buildReport(reports, intent, text, previous) {
274
+ async function buildReport(reports, intent, text, previous, current) {
246
275
  const defined = await reports.define(intent, text);
276
+ if (!current())
277
+ return { added: [], text: 'Stopped.' };
247
278
  if (defined.ok) {
248
279
  pending = null;
249
280
  // Reports must be on to keep the report; turning it on is a command
@@ -269,7 +300,9 @@ export function createBrowserAssistantTransport(options) {
269
300
  if (previous && sameFollowUp(previous, followUp)) {
270
301
  const pick = followUp.options.find((o) => o.value === followUp.default);
271
302
  if (pick) {
272
- const next = await buildReport(reports, mergeIntent(intent, pick.apply), text, followUp);
303
+ const next = await buildReport(reports, mergeIntent(intent, pick.apply), text, followUp, current);
304
+ if (!current())
305
+ return { added: [], text: 'Stopped.' };
273
306
  return { ...next, text: `I went with ${pick.label}. ${next.text}` };
274
307
  }
275
308
  }
@@ -284,11 +317,13 @@ export function createBrowserAssistantTransport(options) {
284
317
  return followUp.options.find((o) => o.value === value);
285
318
  }
286
319
  /** Continue a pending report with a picked option, with no model turn. */
287
- async function answerPending(reports, option, reply = '') {
320
+ async function answerPending(reports, option, reply, isCurrent) {
288
321
  const current = pending;
289
322
  if (!current)
290
323
  return { content: '' };
291
- const built = await buildReport(reports, mergeIntent(current.intent, option.apply), `${current.text} ${reply}`.trim(), current.followUp);
324
+ const built = await buildReport(reports, mergeIntent(current.intent, option.apply), `${current.text} ${reply}`.trim(), current.followUp, isCurrent);
325
+ if (!isCurrent())
326
+ return { content: 'Stopped.' };
292
327
  const content = [
293
328
  describeChange({ added: built.added, removed: [], kept: [] }, options.recipes),
294
329
  built.text,
@@ -302,7 +337,7 @@ export function createBrowserAssistantTransport(options) {
302
337
  const reportsHost = () => options.recipes.some((r) => r.id === REPORTS_RECIPE)
303
338
  ? (options.reports?.() ?? null)
304
339
  : null;
305
- const push = (role, content, clientRequestId, toolCallData) => {
340
+ const push = (role, content, clientRequestId, toolCallData, notifyChange = true) => {
306
341
  const message = {
307
342
  id: id('m'),
308
343
  threadId: thread.id,
@@ -316,6 +351,8 @@ export function createBrowserAssistantTransport(options) {
316
351
  messages.push(message);
317
352
  thread.messageCount = messages.length;
318
353
  thread.lastMessageAt = message.createdAt;
354
+ if (notifyChange)
355
+ notify();
319
356
  return message;
320
357
  };
321
358
  const planner = options.controller ??
@@ -324,11 +361,87 @@ export function createBrowserAssistantTransport(options) {
324
361
  settings: options.settings,
325
362
  theme: options.theme,
326
363
  });
327
- const index = buildMatchIndex(options.recipes, options.cookbooks ?? [], {
328
- theme: !!options.theme,
329
- });
330
- const greeting = push('assistant', GREETING);
331
- async function turn(text) {
364
+ let greeting = push('assistant', GREETING, undefined, undefined, false);
365
+ try {
366
+ const raw = options.conversationStorage?.getItem('smrt-planner:conversation:v1');
367
+ const stored = raw && raw.length <= 2_000_000 ? JSON.parse(raw) : null;
368
+ if (stored?.version === 1 &&
369
+ Array.isArray(stored.messages) &&
370
+ stored.messages.length <= 2000 &&
371
+ stored.messages.every((m) => m &&
372
+ typeof m.id === 'string' &&
373
+ ['user', 'assistant'].includes(m.role) &&
374
+ typeof m.content === 'string' &&
375
+ m.content.length <= 100_000) &&
376
+ Number.isSafeInteger(stored.counter) &&
377
+ stored.counter >= stored.messages.length &&
378
+ typeof stored.sent === 'boolean') {
379
+ messages.splice(0, messages.length, ...structuredClone(stored.messages));
380
+ counter = stored.counter;
381
+ sent = stored.sent;
382
+ greeting = messages[0] ?? push('assistant', GREETING);
383
+ const ids = JSON.parse(options.conversationStorage?.getItem('smrt-planner:conversation-seed:v1') ?? '[]');
384
+ if (Array.isArray(ids) &&
385
+ ids.length <= 2000 &&
386
+ ids.every((value) => typeof value === 'string' && value.length <= 200))
387
+ for (const value of ids)
388
+ seeds.add(value);
389
+ }
390
+ }
391
+ catch {
392
+ /* Invalid saved data carries no authority and is ignored. */
393
+ }
394
+ async function send(input, host) {
395
+ const cached = seen.get(input.clientRequestId);
396
+ if (cached)
397
+ return cached;
398
+ if (busy)
399
+ throw new Error('The assistant is still answering.');
400
+ sent = true;
401
+ busy = true;
402
+ const operation = { epoch: generation, controller: new AbortController() };
403
+ controller = operation.controller;
404
+ try {
405
+ const userMessage = push('user', input.content, input.clientRequestId);
406
+ let reply = null;
407
+ if (!host && options.hostTurn) {
408
+ try {
409
+ reply = await options.hostTurn({
410
+ userMessage: structuredClone(userMessage),
411
+ conversation: conversation(),
412
+ signal: operation.controller.signal,
413
+ });
414
+ }
415
+ catch {
416
+ reply = {
417
+ content: 'Your request could not be confirmed. Please retry the same request.',
418
+ };
419
+ }
420
+ if (!owns(operation))
421
+ return { inProgress: false };
422
+ if (operation.controller.signal.aborted)
423
+ reply = { content: 'Stopped.' };
424
+ }
425
+ reply ??= await turn(input.content, operation);
426
+ if (!owns(operation))
427
+ return { inProgress: false };
428
+ const result = {
429
+ inProgress: false,
430
+ userMessage,
431
+ assistantMessage: push('assistant', reply.content, undefined, reply.refs),
432
+ };
433
+ seen.set(input.clientRequestId, result);
434
+ return result;
435
+ }
436
+ finally {
437
+ if (owns(operation)) {
438
+ controller = null;
439
+ busy = false;
440
+ notify();
441
+ }
442
+ }
443
+ }
444
+ async function turn(text, operation) {
332
445
  // A typed answer to the pending report question resolves against its
333
446
  // options in code: no model turn, and "the date month" means the date by
334
447
  // month whatever the model would have made of it.
@@ -337,7 +450,7 @@ export function createBrowserAssistantTransport(options) {
337
450
  const option = directAnswer(pending.followUp, pending.question, text);
338
451
  // The reply's own time words ("status last month") still count.
339
452
  if (option)
340
- return answerPending(pendingReports, option, text);
453
+ return answerPending(pendingReports, option, text, () => active(operation));
341
454
  }
342
455
  const model = options.model();
343
456
  if (!model) {
@@ -348,9 +461,11 @@ export function createBrowserAssistantTransport(options) {
348
461
  'Download a model first, then I can help. The cards on the Planner page work without one.',
349
462
  };
350
463
  }
351
- controller = new AbortController();
352
464
  try {
353
- const cookbooks = options.cookbooks ?? [];
465
+ const cookbooks = cookbooksForTurn();
466
+ const index = buildMatchIndex(options.recipes, cookbooks, {
467
+ theme: !!options.theme,
468
+ });
354
469
  const prior = messages
355
470
  .filter((m) => m !== greeting)
356
471
  .slice(0, -1)
@@ -365,6 +480,14 @@ export function createBrowserAssistantTransport(options) {
365
480
  const reports = reportsHost();
366
481
  const reportSources = reports?.sources() ?? [];
367
482
  const asked = pending;
483
+ // Hosted structured replies describe this exact app revision. Local
484
+ // providers may perform their own supported tool work during message().
485
+ const hosted = typeof options.acceptCommands === 'function'
486
+ ? options.acceptCommands()
487
+ : options.acceptCommands;
488
+ const inferenceRevision = hosted
489
+ ? planner.snapshot().revision
490
+ : undefined;
368
491
  const raw = await model.message(text, {
369
492
  history: [
370
493
  {
@@ -382,8 +505,17 @@ export function createBrowserAssistantTransport(options) {
382
505
  responseSchema: buildResponseSchema(options.recipes, cookbooks, !!options.settings, !!options.theme, menu.map((section) => section.id), reportSources.map((source) => source.id)),
383
506
  temperature: 0,
384
507
  maxTokens: MAX_REPLY_TOKENS,
385
- signal: controller.signal,
508
+ signal: operation.controller.signal,
386
509
  });
510
+ // A provider may resolve after abort instead of rejecting. Never apply it.
511
+ if (!active(operation))
512
+ return { content: 'Stopped.' };
513
+ if (inferenceRevision !== undefined &&
514
+ planner.snapshot().revision !== inferenceRevision) {
515
+ return {
516
+ content: 'The app changed while I was preparing that reply. I have kept your newer changes and applied nothing from this reply. Please try again.',
517
+ };
518
+ }
387
519
  const change = parseChange(raw, options.recipes, cookbooks, {
388
520
  commands: typeof options.acceptCommands === 'function'
389
521
  ? options.acceptCommands()
@@ -399,6 +531,7 @@ export function createBrowserAssistantTransport(options) {
399
531
  change.remove = [];
400
532
  delete change.open;
401
533
  }
534
+ const beforeCommands = planner.snapshot();
402
535
  const applied = applyRecipes(planner, change);
403
536
  const settingsText = options.settings && hasKeys(change.settings)
404
537
  ? runSummary(planner, 'set_settings', change.settings)
@@ -410,9 +543,17 @@ export function createBrowserAssistantTransport(options) {
410
543
  const undo = themed?.undoId && options.themeUndos
411
544
  ? options.themeUndos.record(previousTheme, themed.undoId)
412
545
  : undefined;
413
- const commandText = (change.commands ?? []).length
546
+ const commandRun = (change.commands ?? []).length
414
547
  ? runCommands(planner, change.commands ?? [])
415
- : '';
548
+ : { summary: '', results: [] };
549
+ if (change.sampleContext &&
550
+ commandRun.results.length === change.commands?.length &&
551
+ commandRun.results.every((result) => result.ok) &&
552
+ commandRun.results.some((result) => result.ok && result.receipt.changed)) {
553
+ applySampleContext(change.sampleContext);
554
+ }
555
+ const commandText = commandRun.summary;
556
+ const coaching = appliedCoaching(beforeCommands, planner.snapshot(), commandRun.results, options.recipes);
416
557
  // A request for a report or a summary of the data (the keyword match
417
558
  // finds reports.runtime) goes to Reports or nowhere: an `open` of any
418
559
  // other section (the product catalogue, say) is dropped.
@@ -447,7 +588,9 @@ export function createBrowserAssistantTransport(options) {
447
588
  !!openText ||
448
589
  !!change.cookbook;
449
590
  if (reports && reportIntent) {
450
- const built = await buildReport(reports, reportIntent, reportWords, asked?.followUp ?? null);
591
+ const built = await buildReport(reports, reportIntent, reportWords, asked?.followUp ?? null, () => active(operation));
592
+ if (!active(operation))
593
+ return { content: 'Stopped.' };
451
594
  applied.added.push(...built.added);
452
595
  reportText = built.text;
453
596
  reportRef = built.ref;
@@ -456,7 +599,9 @@ export function createBrowserAssistantTransport(options) {
456
599
  // A second miss: never the identical question again.
457
600
  const pick = asked.followUp.options.find((o) => o.value === asked.followUp.default);
458
601
  if (pick) {
459
- const built = await buildReport(reports, mergeIntent(asked.intent, pick.apply), asked.text, asked.followUp);
602
+ const built = await buildReport(reports, mergeIntent(asked.intent, pick.apply), asked.text, asked.followUp, () => active(operation));
603
+ if (!active(operation))
604
+ return { content: 'Stopped.' };
460
605
  applied.added.push(...built.added);
461
606
  reportText = `I went with ${pick.label}. ${built.text}`;
462
607
  reportRef = built.ref;
@@ -515,7 +660,9 @@ export function createBrowserAssistantTransport(options) {
515
660
  ? cookbooks.find((c) => c.id === cookbookId)
516
661
  : undefined;
517
662
  const line = change.reply || (offered ? `Set up ${offered.name}?` : '');
518
- const reply = honestReply(line, summary, !!offer);
663
+ const reply = [honestReply(line, summary, !!offer), coaching]
664
+ .filter(Boolean)
665
+ .join(' ');
519
666
  if (reply)
520
667
  options.onReply?.(reply);
521
668
  // One ref renders as is; several in one turn (a cookbook offer, a theme
@@ -525,16 +672,43 @@ export function createBrowserAssistantTransport(options) {
525
672
  return { content: reply, refs };
526
673
  }
527
674
  catch (error) {
528
- if (controller?.signal.aborted)
675
+ if (!active(operation))
529
676
  return { content: 'Stopped.' };
530
677
  const detail = error instanceof Error ? error.message : String(error);
531
678
  return { content: `Sorry, the model could not answer: ${detail}` };
532
679
  }
533
- finally {
534
- controller = null;
535
- }
536
680
  }
537
681
  return {
682
+ conversation,
683
+ get resetRevision() {
684
+ return generation;
685
+ },
686
+ get busy() {
687
+ return busy;
688
+ },
689
+ subscribeConversation(listener) {
690
+ listeners.add(listener);
691
+ listener(conversation());
692
+ return () => listeners.delete(listener);
693
+ },
694
+ seed(input) {
695
+ if (!input ||
696
+ typeof input.id !== 'string' ||
697
+ !input.id.trim() ||
698
+ !Array.isArray(input.messages) ||
699
+ input.messages.some((message) => !message ||
700
+ !['user', 'assistant'].includes(message.role) ||
701
+ typeof message.content !== 'string') ||
702
+ seeds.has(input.id) ||
703
+ busy ||
704
+ sent)
705
+ return false;
706
+ seeds.add(input.id);
707
+ for (const message of input.messages)
708
+ push(message.role, message.content, undefined, undefined, false);
709
+ notify();
710
+ return true;
711
+ },
538
712
  async listThreads() {
539
713
  return [thread];
540
714
  },
@@ -544,19 +718,25 @@ export function createBrowserAssistantTransport(options) {
544
718
  async loadMessages() {
545
719
  return [...messages];
546
720
  },
547
- async sendMessage(input) {
548
- const cached = seen.get(input.clientRequestId);
549
- if (cached)
550
- return cached;
551
- const userMessage = push('user', input.content, input.clientRequestId);
552
- const reply = await turn(input.content);
553
- const result = {
554
- inProgress: false,
555
- userMessage,
556
- assistantMessage: push('assistant', reply.content, undefined, reply.refs),
557
- };
558
- seen.set(input.clientRequestId, result);
559
- return result;
721
+ sendMessage(input) {
722
+ return send(input, false);
723
+ },
724
+ sendHostMessage(input) {
725
+ return send(input, true);
726
+ },
727
+ reset() {
728
+ generation += 1;
729
+ controller?.abort();
730
+ controller = null;
731
+ pending = null;
732
+ messages.splice(0);
733
+ seen.clear();
734
+ seeds.clear();
735
+ sent = false;
736
+ busy = false;
737
+ counter = 0;
738
+ greeting = push('assistant', GREETING);
739
+ notify();
560
740
  },
561
741
  /**
562
742
  * The report follow-up's form, submitted: its pick merges into the
@@ -567,6 +747,8 @@ export function createBrowserAssistantTransport(options) {
567
747
  const cached = seen.get(input.clientRequestId);
568
748
  if (cached)
569
749
  return cached;
750
+ if (busy)
751
+ throw new Error('The assistant is still answering.');
570
752
  const reports = reportsHost();
571
753
  if (!pending || !reports || pending.question.id !== input.questionId) {
572
754
  throw new Error('That question is no longer open. Ask again?');
@@ -577,27 +759,45 @@ export function createBrowserAssistantTransport(options) {
577
759
  : undefined;
578
760
  if (!values || !option)
579
761
  throw new Error('Choose one of the options.');
580
- const asked = messages.find((m) => m.id === input.messageId);
581
- if (asked) {
582
- const mark = (ref) => {
583
- const item = ref;
584
- return item?.kind === ASSISTANT_QUESTION_KIND &&
585
- item.id === input.questionId
586
- ? { ...item, answer: values }
587
- : ref;
762
+ sent = true;
763
+ busy = true;
764
+ const operation = {
765
+ epoch: generation,
766
+ controller: new AbortController(),
767
+ };
768
+ controller = operation.controller;
769
+ try {
770
+ const asked = messages.find((m) => m.id === input.messageId);
771
+ if (asked) {
772
+ const mark = (ref) => {
773
+ const item = ref;
774
+ return item?.kind === ASSISTANT_QUESTION_KIND &&
775
+ item.id === input.questionId
776
+ ? { ...item, answer: values }
777
+ : ref;
778
+ };
779
+ asked.toolCallData = Array.isArray(asked.toolCallData)
780
+ ? asked.toolCallData.map(mark)
781
+ : mark(asked.toolCallData);
782
+ }
783
+ const reply = await answerPending(reports, option, '', () => active(operation));
784
+ if (!owns(operation))
785
+ return { inProgress: false };
786
+ const result = {
787
+ inProgress: false,
788
+ ...(asked ? { messages: [asked] } : {}),
789
+ assistantMessage: push('assistant', reply.content, undefined, reply.refs),
588
790
  };
589
- asked.toolCallData = Array.isArray(asked.toolCallData)
590
- ? asked.toolCallData.map(mark)
591
- : mark(asked.toolCallData);
791
+ seen.set(input.clientRequestId, result);
792
+ return result;
793
+ }
794
+ finally {
795
+ if (owns(operation)) {
796
+ controller = null;
797
+ busy = false;
798
+ notify();
799
+ }
592
800
  }
593
- const reply = await answerPending(reports, option);
594
- const result = {
595
- inProgress: false,
596
- ...(asked ? { messages: [asked] } : {}),
597
- assistantMessage: push('assistant', reply.content, undefined, reply.refs),
598
- };
599
- seen.set(input.clientRequestId, result);
600
- return result;
601
801
  },
602
802
  recordReportOutcome(specHash, outcome) {
603
803
  for (const message of messages) {
@@ -612,6 +812,7 @@ export function createBrowserAssistantTransport(options) {
612
812
  }
613
813
  }
614
814
  }
815
+ notify();
615
816
  },
616
817
  async uploadAttachment(file) {
617
818
  throw new Error(`The assistant cannot take attachments (${file.name}).`);