fuli-context 0.27.3 → 0.27.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web/assets/{AboutPage-C-fJv2EQ.js → AboutPage-DJxp-WMU.js} +1 -1
- package/dist/web/assets/{AboutSectionHeading-DLjnjHfb.js → AboutSectionHeading-BUu85T3-.js} +1 -1
- package/dist/web/assets/{AgentAppsPage-CBcUlh8U.js → AgentAppsPage-Di4HU1sH.js} +1 -1
- package/dist/web/assets/{AgentAvatar-Cu_TwSqc.js → AgentAvatar-N7IaseYC.js} +1 -1
- package/dist/web/assets/{AgentHand-1yBhYv72.js → AgentHand-BDCERx8p.js} +1 -1
- package/dist/web/assets/{AgentManagement-D8jHUEWK.js → AgentManagement-CJLZoyuq.js} +1 -1
- package/dist/web/assets/{AgentMentionCopy-BRxaxi6r.js → AgentMentionCopy-Cpsy2XwV.js} +1 -1
- package/dist/web/assets/{AgentName-CL8xix6s.js → AgentName-B150JTrl.js} +1 -1
- package/dist/web/assets/{AgentProfilePage-BosYAypt.js → AgentProfilePage-rckt2qEt.js} +3 -3
- package/dist/web/assets/{AgentServicesPage-BQHw7Cyx.js → AgentServicesPage-_rY596Cl.js} +1 -1
- package/dist/web/assets/{AppViewerPage-CO5-dW38.js → AppViewerPage-Kq3r1mwI.js} +1 -1
- package/dist/web/assets/{BackToTop-dl4Y4CgO.js → BackToTop-Da6u7_d8.js} +1 -1
- package/dist/web/assets/{BoardCardFieldsMenu-BBqsgCq8.js → BoardCardFieldsMenu-CyJSO3vT.js} +1 -1
- package/dist/web/assets/{BoardMoveMenu-Rys8yvXz.js → BoardMoveMenu-B_lUROwH.js} +1 -1
- package/dist/web/assets/{Breadcrumb-DXXN0moP.js → Breadcrumb-CA0zg3OI.js} +1 -1
- package/dist/web/assets/{CaptureChangePage-lNiPS4XI.js → CaptureChangePage-nnCFkG4H.js} +1 -1
- package/dist/web/assets/Collection-CL-ehAUe.js +1 -0
- package/dist/web/assets/{CopyFixPrompt-Cpve4rdS.js → CopyFixPrompt-Bp3GsUzJ.js} +1 -1
- package/dist/web/assets/{DataFormatPage-DpBIwY-n.js → DataFormatPage-COPJnuZH.js} +1 -1
- package/dist/web/assets/{DebugTurnPage-DzJ07GMF.js → DebugTurnPage-CuREiHr-.js} +1 -1
- package/dist/web/assets/{DebugTurnsPage-CNAeNt5i.js → DebugTurnsPage-i2jPDad3.js} +1 -1
- package/dist/web/assets/{DialogTitle-D0EVi01-.js → DialogTitle-aiTJ0Qmu.js} +1 -1
- package/dist/web/assets/{EmployeeRedirectPage-qlH0SVZY.js → EmployeeRedirectPage-DPSjSW-l.js} +1 -1
- package/dist/web/assets/{EmployeeScopeDialog-C4B724Jj.js → EmployeeScopeDialog-Bui2TPpl.js} +1 -1
- package/dist/web/assets/{EmployeeWorkbench-BgpxZ_1F.js → EmployeeWorkbench-DAC8kuJP.js} +1 -1
- package/dist/web/assets/FieldRoot-B2x8LUg_.js +1 -0
- package/dist/web/assets/{FlaBlockedTasks-DGw9I-j7.js → FlaBlockedTasks-Ds1c5xaw.js} +1 -1
- package/dist/web/assets/{FlaGrowth-Ct4GbCJZ.js → FlaGrowth-CJSExsDl.js} +1 -1
- package/dist/web/assets/{FlaOccupationKit-Cbx058JA.js → FlaOccupationKit-yibMGA7g.js} +1 -1
- package/dist/web/assets/{FlaTaskSheets-CoWj7Gw3.js → FlaTaskSheets-CJSjxa9s.js} +1 -1
- package/dist/web/assets/{FlasPage-BGrz_P1x.js → FlasPage-BvIsNjmr.js} +1 -1
- package/dist/web/assets/{GrowthLoading-BHxVzIoM.js → GrowthLoading-Ddj4TqCR.js} +1 -1
- package/dist/web/assets/HowtoPage-kSC2Tym0.js +1 -0
- package/dist/web/assets/{InboxPage-ByZQpihN.js → InboxPage-Qfx9kB6z.js} +3 -3
- package/dist/web/assets/{KnowledgeDeleteButton-dvslN7EO.js → KnowledgeDeleteButton-yq2NE_5V.js} +1 -1
- package/dist/web/assets/{KnowledgeHardDeleteSection-DMARNrze.js → KnowledgeHardDeleteSection-DYLuMTkw.js} +1 -1
- package/dist/web/assets/{KnowledgeItemEditPage-D7X3K-Fu.js → KnowledgeItemEditPage-C_6CCT0l.js} +1 -1
- package/dist/web/assets/{KnowledgeItemSummaryCard-Carpboje.js → KnowledgeItemSummaryCard-DaS6I6IJ.js} +1 -1
- package/dist/web/assets/{KnowledgeOrganizerPage-CdFva4xO.js → KnowledgeOrganizerPage-C0TW5FWc.js} +1 -1
- package/dist/web/assets/KnowledgePage-CpU8zlbY.js +1 -0
- package/dist/web/assets/{KnowledgePeek-C4QSXTOF.js → KnowledgePeek-C8KO5NBx.js} +1 -1
- package/dist/web/assets/{KnowledgeTurnReceiptPage-CY85DtmF.js → KnowledgeTurnReceiptPage-Bss7rO8X.js} +1 -1
- package/dist/web/assets/{KnowledgeWorkspace-Be2gUul5.css → KnowledgeWorkspace-B2YB4aaQ.css} +1 -1
- package/dist/web/assets/KnowledgeWorkspace-NBt_5LEZ.js +4 -0
- package/dist/web/assets/{MeAvatar-WSCaLEJ1.js → MeAvatar-ec_0AfqZ.js} +1 -1
- package/dist/web/assets/{MeLink-rP0IiTaj.js → MeLink-mcOCZh0y.js} +1 -1
- package/dist/web/assets/MenuSeparator-BdUe-nrq.js +1 -0
- package/dist/web/assets/ModelSettingsPage-DG4g9dZG.js +1 -0
- package/dist/web/assets/{NewSessionPanel-DNYTQ0Lw.js → NewSessionPanel-Dp9REysi.js} +1 -1
- package/dist/web/assets/{NotFoundPage-BbnR0KYy.js → NotFoundPage-mQNgXOdV.js} +1 -1
- package/dist/web/assets/NoticeRow-CVxAQhy5.js +1 -0
- package/dist/web/assets/NoticeRow-ktVO_9Es.css +1 -0
- package/dist/web/assets/{OccupationsPage-DQGGceta.js → OccupationsPage-M2bNGjfX.js} +1 -1
- package/dist/web/assets/{PageOutline-nKD_AvCJ.js → PageOutline-BIuKlaez.js} +1 -1
- package/dist/web/assets/{PageStack-BVHOFq7x.js → PageStack-CJdqrH8a.js} +1 -1
- package/dist/web/assets/{PersonalProfilePage-Cm1NxyU0.js → PersonalProfilePage-CbgimIFG.js} +1 -1
- package/dist/web/assets/PersonalProjectsPage-Dm38FUPv.js +1 -0
- package/dist/web/assets/{PinIcon-DxjWqB7x.js → PinIcon-DBS7pHXp.js} +1 -1
- package/dist/web/assets/PopperContent-DyZQrl-r.js +1 -0
- package/dist/web/assets/{Presence-DrSz_UA1.js → Presence-wz-KVyjT.js} +1 -1
- package/dist/web/assets/{ProfileAuthorChip-CN1ZYzKN.js → ProfileAuthorChip-DAY42zZ8.js} +1 -1
- package/dist/web/assets/{ProjectAgentsPage-DMnRnXDT.js → ProjectAgentsPage-BKWGB-4t.js} +1 -1
- package/dist/web/assets/{ProjectJudgmentPolicy-DBszt68M.js → ProjectJudgmentPolicy-D1UHlAih.js} +1 -1
- package/dist/web/assets/RequesterModeSelect-BpaRF_th.js +1 -0
- package/dist/web/assets/RequesterModeSelect-DH1PGLmn.css +1 -0
- package/dist/web/assets/{RoundtablesPage-QtNyNaDg.js → RoundtablesPage-9mlvO7FV.js} +1 -1
- package/dist/web/assets/RovingFocusGroup-CHDkM3pP.js +1 -0
- package/dist/web/assets/RovingFocusItem-H6anRCEm.js +1 -0
- package/dist/web/assets/{SessionMigrationPage-Chm5L6p4.js → SessionMigrationPage-DZfyUaJe.js} +1 -1
- package/dist/web/assets/{SessionRecordsPage-BHPaCRH-.js → SessionRecordsPage-CK6iztwv.js} +1 -1
- package/dist/web/assets/SettingsPage-CVM1Gw0D.js +1 -0
- package/dist/web/assets/{SettingsPage-CnqtNPWd.css → SettingsPage-DqZGF8J1.css} +1 -1
- package/dist/web/assets/{SharedJefaReportPage-DHD4As4b.js → SharedJefaReportPage-cfEk0Tzn.js} +1 -1
- package/dist/web/assets/{StatementCalendarPage-lkq1OrUT.js → StatementCalendarPage-OmZa4AdL.js} +1 -1
- package/dist/web/assets/{StatementRows-DS-_XbkC.js → StatementRows-Cdv1wlMo.js} +1 -1
- package/dist/web/assets/{TagVocabularyPage-ap97B1fd.js → TagVocabularyPage-C9pRT-Co.js} +1 -1
- package/dist/web/assets/{TaskBlockerClear-xmjIgmON.js → TaskBlockerClear-BGpJYYbz.js} +1 -1
- package/dist/web/assets/{TaskBlockerNotice-D3awZbiX.js → TaskBlockerNotice-BtOREiqc.js} +1 -1
- package/dist/web/assets/{TaskReason-Y_gLRUR4.js → TaskReason-Dys3TUp_.js} +1 -1
- package/dist/web/assets/{TeamCard-C5BOBfgK.js → TeamCard-D7FU45G4.js} +1 -1
- package/dist/web/assets/{TeamCardsWidget-jLieh7GV.js → TeamCardsWidget-hYsXSXcW.js} +1 -1
- package/dist/web/assets/{TeamIsland-C2U6j6W0.js → TeamIsland-Bw875ekj.js} +1 -1
- package/dist/web/assets/{Teleport-RJS88HRO.js → Teleport-DcReQWaw.js} +1 -1
- package/dist/web/assets/{TextField-CwecNrfC.js → TextField-BO5vPcVo.js} +1 -1
- package/dist/web/assets/TodayPage-D9HV_tMn.js +1 -0
- package/dist/web/assets/TodayPage-uBkMchn5.css +1 -0
- package/dist/web/assets/{TonborgDelegationSwitch-C9jrfVCw.js → TonborgDelegationSwitch-TCl6Nu4Q.js} +1 -1
- package/dist/web/assets/{UiChip-DLTDKZh9.js → UiChip-BDaNYy7i.js} +1 -1
- package/dist/web/assets/{UiDialog-u4ZkP4DG.js → UiDialog-CkrPgXkI.js} +1 -1
- package/dist/web/assets/{UiDisclosure-CKVkr79z.js → UiDisclosure-DHBkq9rj.js} +1 -1
- package/dist/web/assets/{UiIcon-D2DJw7hg.js → UiIcon-BBBPl7ce.js} +1 -1
- package/dist/web/assets/{UiSegmented-D6pLjXXW.js → UiSegmented-EzA-Ehx4.js} +1 -1
- package/dist/web/assets/{UiWeight-BOEi9suT.js → UiWeight-EHzBhu5a.js} +1 -1
- package/dist/web/assets/{VirtualDirectoryList-BX3eeyRo.js → VirtualDirectoryList-BJrM_eeP.js} +1 -1
- package/dist/web/assets/VisitRequestDialog-ISewTzM3.css +1 -0
- package/dist/web/assets/VisitRequestDialog-jbgJBF2e.js +1 -0
- package/dist/web/assets/VisitRequestsPage-Bkxxiaxy.js +1 -0
- package/dist/web/assets/VisitRequestsPage-DfIzoLBx.css +1 -0
- package/dist/web/assets/{VisuallyHidden-DjqI8CEj.js → VisuallyHidden-CgxInDXj.js} +1 -1
- package/dist/web/assets/VisuallyHiddenInput-CaWSS7uB.js +1 -0
- package/dist/web/assets/WidgetSlot-DENSHLjb.js +2 -0
- package/dist/web/assets/WorkbenchListPage-J-UpUosh.js +1 -0
- package/dist/web/assets/_plugin-vue_export-helper-B0wc-mt_.js +9 -0
- package/dist/web/assets/{agent-apps-CFWQ-pVX.js → agent-apps-BNje45bS.js} +1 -1
- package/dist/web/assets/agent-occupation-aAG5t3l1.js +1 -0
- package/dist/web/assets/{agent-pins-XtAvsJ8S.js → agent-pins-BCrkTGGW.js} +1 -1
- package/dist/web/assets/{agent-roster-records-DiZKG26q.js → agent-roster-records-BFUsBcZY.js} +1 -1
- package/dist/web/assets/{agent-work-summary-CvHRy3NR.js → agent-work-summary-B_VLOm6o.js} +1 -1
- package/dist/web/assets/{attach-closest-edge-De5463t-.js → attach-closest-edge-BPnS_9Lk.js} +1 -1
- package/dist/web/assets/{attention-store-CWRvv8xT.js → attention-store-qIzsiW3O.js} +1 -1
- package/dist/web/assets/{badge-CyUHAZlb.js → badge-CtWdRMi-.js} +1 -1
- package/dist/web/assets/{button-DgFpUg62.js → button-_gyKncGb.js} +1 -1
- package/dist/web/assets/{card-BG73LSt9.js → card-BYD6uklY.js} +1 -1
- package/dist/web/assets/{catalog-KaWiF7K5.js → catalog-PjA5J9yg.js} +1 -1
- package/dist/web/assets/checkbox-5re4FS0U.js +1 -0
- package/dist/web/assets/{client-eeoB__-w.js → client-LxAXnO12.js} +1 -1
- package/dist/web/assets/{client-links-store-C1T7b2HQ.js → client-links-store-CYdBPEgD.js} +1 -1
- package/dist/web/assets/combobox-BPUtDA5_.js +1 -0
- package/dist/web/assets/{console-KA3Jxkr4.js → console-D45-ZZfX.js} +1 -1
- package/dist/web/assets/{conversation-launcher-settings-QWrAaAPe.js → conversation-launcher-settings-BS2bz1uR.js} +1 -1
- package/dist/web/assets/copy-mention-D0xSzmH6.js +1 -0
- package/dist/web/assets/{dialog-CPHmFum7.js → dialog-xaUosJps.js} +1 -1
- package/dist/web/assets/{dist-CTCo5IXd.js → dist-C0lQzDOh.js} +1 -1
- package/dist/web/assets/{dist-e1tihV1g.js → dist-C1Hez3C6.js} +1 -1
- package/dist/web/assets/dropdown-menu-8tDY2fah.js +1 -0
- package/dist/web/assets/{field-8F_Pt8vb.js → field-B9eFY0rX.js} +1 -1
- package/dist/web/assets/{format-bytes-DkVJGLsS.js → format-bytes-DHztF0Wp.js} +1 -1
- package/dist/web/assets/{hover-card-Db-Mrxk6.js → hover-card-CCcSIBsB.js} +1 -1
- package/dist/web/assets/{identity-wfQfyysH.js → identity-CW-Srg08.js} +1 -1
- package/dist/web/assets/{index-CRSH-FaE.js → index-CpxVWv-F.js} +3 -3
- package/dist/web/assets/{input-DFTIPfkE.js → input-BiH7RC9P.js} +1 -1
- package/dist/web/assets/{label-BDet7nvg.js → label-BdftnoQ0.js} +1 -1
- package/dist/web/assets/label-table-CLQKbitJ.js +1 -0
- package/dist/web/assets/{model-C7J0jC4U.js → model-C7tDPa_1.js} +1 -1
- package/dist/web/assets/{model-LXhsHZ_S.js → model-Cg5zXaMF.js} +1 -1
- package/dist/web/assets/{model-BwEuimI0.js → model-DDyIT1eK.js} +1 -1
- package/dist/web/assets/{model-Bzgg7OTO.js → model-DMd25lv5.js} +1 -1
- package/dist/web/assets/{model-DFuUc43Z.js → model-DXpi8vqS.js} +1 -1
- package/dist/web/assets/{model-D3j-Q4br.js → model-DaJv8e-8.js} +1 -1
- package/dist/web/assets/{model-DGpMX2GY.js → model-Q1SCdf0F.js} +1 -1
- package/dist/web/assets/{model-WhGp0XZv.js → model-qBLcWPQW.js} +1 -1
- package/dist/web/assets/{motion-0KGuL0P9.js → motion-4AmdlpVT.js} +1 -1
- package/dist/web/assets/{motion-BhDwEDuX.js → motion-D-GVIJyc.js} +1 -1
- package/dist/web/assets/{motion-preference--VYomm-z.js → motion-preference-CXHE1-Z7.js} +1 -1
- package/dist/web/assets/{occupation-catalog-D5SQWfUI.js → occupation-catalog-CsWai-cw.js} +1 -1
- package/dist/web/assets/{occupation-kits-CrqixyUx.js → occupation-kits-CZQzDPeY.js} +1 -1
- package/dist/web/assets/{option-C9CkqCvy.js → option-B_OFUmRs.js} +1 -1
- package/dist/web/assets/{orchestration-filters-DTnWbCEm.js → orchestration-filters-DqAPmniI.js} +1 -1
- package/dist/web/assets/{overview-data-BvW9uhT4.js → overview-data-BbAd5G_f.js} +1 -1
- package/dist/web/assets/{page-refresh-GRJ3nMpT.js → page-refresh-abwcdMEQ.js} +1 -1
- package/dist/web/assets/{page-title-B9HNL7K4.js → page-title-cvuGZaZo.js} +1 -1
- package/dist/web/assets/{person-profile-Cng7edLa.js → person-profile-C8eoODdy.js} +1 -1
- package/dist/web/assets/{popover-BgaSR8Zf.js → popover-h4zQ7MDI.js} +1 -1
- package/dist/web/assets/popup-host-8S4Sf9UR.js +1 -0
- package/dist/web/assets/{preference-conflicts-WphCdbo6.js → preference-conflicts-Cu00Gk8W.js} +1 -1
- package/dist/web/assets/{profile-model-B9K6ylO1.js → profile-model-BZIzIQTS.js} +1 -1
- package/dist/web/assets/{project-board-layout-GxgeqkX4.js → project-board-layout-DxdyuEpb.js} +1 -1
- package/dist/web/assets/{project-capture-C6NQkcJw.js → project-capture-BQ0ryWdP.js} +1 -1
- package/dist/web/assets/{project-origin-DuSzjbhd.js → project-origin-CdqHLvij.js} +1 -1
- package/dist/web/assets/{quick-edit-api-BDFnInRp.js → quick-edit-api-sf5vVWXR.js} +1 -1
- package/dist/web/assets/radio-group-BdWVlNgf.js +1 -0
- package/dist/web/assets/{review-api-D31JYGWJ.js → review-api-Cbrwrt6C.js} +1 -1
- package/dist/web/assets/{review-list-Cvacm108.js → review-list-D18L_t-q.js} +1 -1
- package/dist/web/assets/{review-store-D7_Vfhh7.js → review-store-1jNUbNaJ.js} +1 -1
- package/dist/web/assets/{role-names-DebBvCND.js → role-names-CiUKQtV9.js} +1 -1
- package/dist/web/assets/{roundtable-live-DfN7Sw9Q.js → roundtable-live-BzB34cUe.js} +1 -1
- package/dist/web/assets/{runtime-dom.esm-bundler-DBdCxLeu.js → runtime-dom.esm-bundler-BwoD95K8.js} +1 -1
- package/dist/web/assets/select-D9sqPsDx.js +1 -0
- package/dist/web/assets/{session-launch-offers-BO40dDPk.js → session-launch-offers-BOZp9NmT.js} +1 -1
- package/dist/web/assets/{settings-autosave-q7Wr9G3O.js → settings-autosave-F9mwjeN-.js} +1 -1
- package/dist/web/assets/{settings-tabs-C9VDs91j.css → settings-tabs-D8608YHW.css} +1 -1
- package/dist/web/assets/settings-tabs-dWS8xFQR.js +1 -0
- package/dist/web/assets/{shared-report-j27wViAk.js → shared-report-BmpdFBj3.js} +3 -3
- package/dist/web/assets/{source-adapters-D3VpWZ6y.js → source-adapters-CZGvDHoP.js} +1 -1
- package/dist/web/assets/switch-BFhMPFpu.js +1 -0
- package/dist/web/assets/tabs-B6N6pM8p.js +1 -0
- package/dist/web/assets/{task-card-fields-CR_cHUml.js → task-card-fields-G9NoV8iz.js} +1 -1
- package/dist/web/assets/{task-labels-C6FR9pf_.js → task-labels-Y0y3oeAL.js} +1 -1
- package/dist/web/assets/{task-reason-C2NjR8__.js → task-reason-D84kviwH.js} +1 -1
- package/dist/web/assets/{team-sheets-5rb7d8An.js → team-sheets-DtMFWcPH.js} +1 -1
- package/dist/web/assets/{textarea-BW51g0FT.js → textarea-8EWEgEpw.js} +1 -1
- package/dist/web/assets/{ui-rJlFkhnh.js → ui-BxmkvkMK.js} +1 -1
- package/dist/web/assets/{useAgentRecords-BDEGuChX.js → useAgentRecords-D5CXJVEf.js} +1 -1
- package/dist/web/assets/{useAgentWorkSummary-B7fcYNAf.js → useAgentWorkSummary-D1Ep9uAl.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-CXkEmQ40.js → useApi-CROJJdhE-Cb6lwzpM.js} +1 -1
- package/dist/web/assets/{useClipboardCopy-CLyPUkax.js → useClipboardCopy-C3PFlW0X.js} +1 -1
- package/dist/web/assets/{useFocusReturn-BzZRnzjC.js → useFocusReturn-B73WeAHQ.js} +1 -1
- package/dist/web/assets/useFormControl-DwHlZ4bV.js +1 -0
- package/dist/web/assets/{useForwardExpose-BFvXozfQ.js → useForwardExpose-4rpHye8H.js} +1 -1
- package/dist/web/assets/{useForwardPropsEmits-BQIBYWrX.js → useForwardPropsEmits-DX7VZylm.js} +1 -1
- package/dist/web/assets/useForwardScopeId-BJDKoqyi.js +1 -0
- package/dist/web/assets/{useKnowledgeConfirm-B7ljY3BE.js → useKnowledgeConfirm-yhZ8Iqzc.js} +1 -1
- package/dist/web/assets/{useKnowledgeItemPeek-W54o0cXF.js → useKnowledgeItemPeek-D-zThKj5.js} +1 -1
- package/dist/web/assets/useListPages-BNB3C09x.js +1 -0
- package/dist/web/assets/{useMinimumLoadingDisplay-i0As_nIh.js → useMinimumLoadingDisplay-DzHl6chR.js} +1 -1
- package/dist/web/assets/{useNow-w9sbWus7.js → useNow-ChD63hSg.js} +1 -1
- package/dist/web/assets/{usePageTools-ChjnsxqE.js → usePageTools-D3N7UX5-.js} +1 -1
- package/dist/web/assets/usePrimitiveElement-CdgGZRug.js +1 -0
- package/dist/web/assets/{useProjectAgentRoster-Cv-2h61l.js → useProjectAgentRoster-BhjNHid8.js} +1 -1
- package/dist/web/assets/{useRoutePeek-6T3XqFw1.js → useRoutePeek-C2k0liTX.js} +1 -1
- package/dist/web/assets/{useTeamWork-rjEihEaF.js → useTeamWork-Bo2hjiA1.js} +1 -1
- package/dist/web/assets/{useTypeahead-BBlzBvAi.js → useTypeahead-DTOx7gNa.js} +1 -1
- package/dist/web/assets/{utils-DVo87S8o.js → utils-DXRJ1hJ4.js} +1 -1
- package/dist/web/assets/utils-DeBPoCtM.js +1 -0
- package/dist/web/assets/{verification-BKmnZihv.js → verification-DRKJF06P.js} +1 -1
- package/dist/web/assets/{version-BYqyCHiB.js → version-B2XiHNBv.js} +1 -1
- package/dist/web/assets/{vue-router-BJZE7CCr.js → vue-router-CbcwRkrV.js} +1 -1
- package/dist/web/assets/{NoticeRow-DD-J76Yo.css → workbench-card-Dt0820yW.css} +1 -1
- package/dist/web/index.html +76 -75
- package/docs/agent-roundtable.md +210 -1
- package/graph-provider/pyproject.toml +1 -1
- package/native/win32/fuli-win-helper.exe +0 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/packages/roundtable/src/agents/claude-code/constrained-run.js +58 -0
- package/packages/roundtable/src/agents/claude-code/wake.js +24 -9
- package/packages/roundtable/src/agents/codex/wake.js +25 -7
- package/packages/roundtable/src/agents/wake-usage.js +14 -0
- package/packages/roundtable/src/host.js +14 -2
- package/packages/roundtable/src/peer/lan-addresses.js +8 -2
- package/packages/roundtable/src/peer/peer-port.js +2 -2
- package/packages/roundtable/src/peer/peer-runtime.js +20 -2
- package/packages/roundtable/src/peer/protocol.js +25 -4
- package/packages/roundtable/src/peer/query-answer.js +39 -7
- package/packages/roundtable/src/peer/runner.js +5 -4
- package/packages/roundtable/src/roundtable/constrained-run.js +48 -0
- package/packages/roundtable/src/roundtable/group-discussion.js +1 -1
- package/packages/roundtable/src/roundtable/service.js +57 -17
- package/packages/roundtable/src/roundtable/store.js +7 -1
- package/packages/roundtable/src/roundtable/wake-attempt-store.js +21 -6
- package/packages/roundtable/src/roundtable/wake-claim-release.js +20 -12
- package/packages/roundtable/src/roundtable/wake-failure.js +7 -3
- package/packages/roundtable/src/roundtable/wake.js +32 -11
- package/skills/capturing-session-knowledge/references/coordination.md +8 -0
- package/skills/operating-fuli/SKILL.md +8 -1
- package/skills/operating-fuli/references/workflow-recipes.md +4 -0
- package/src/agent-kits/fuli-mcp-entry.js +25 -0
- package/src/agent-roundtable/tools.js +6 -3
- package/src/agent-tools/interface-catalog.js +16 -2
- package/src/agent-tools/statement-definitions.js +3 -1
- package/src/agents/claude-code/hook-contract.js +29 -0
- package/src/agents/claude-code/lifecycle-event.js +337 -0
- package/src/agents/claude-code/lifecycle-hook.js +10 -296
- package/src/agents/codex/hook-contract.js +31 -0
- package/src/agents/codex/lifecycle-event.js +350 -0
- package/src/agents/codex/lifecycle-hook.js +10 -326
- package/src/agents/lifecycle-events.js +75 -0
- package/src/agents/lifecycle-failure.js +3 -2
- package/src/agents/lifecycle-forwarder.js +268 -0
- package/src/agents/lifecycle-hook-calls.js +93 -0
- package/src/agents/source-applications.js +8 -0
- package/src/agents/token-usage-resolver.js +10 -0
- package/src/data-format/data-newer-than-package.js +65 -0
- package/src/data-format/local-stores.js +1 -1
- package/src/desktop/failed-update-recovery.js +80 -0
- package/src/desktop/macos-app-update.js +86 -22
- package/src/desktop/windows-installation-switch.js +83 -21
- package/src/desktop/windows-rollback.js +4 -4
- package/src/desktop/windows-tray-update.js +1 -1
- package/src/desktop/windows-update-command.js +4 -1
- package/src/desktop/windows-update.js +4 -4
- package/src/diagnostics/failure-records.js +2 -2
- package/src/diagnostics/safe-event.js +34 -0
- package/src/graphiti/federated-application.js +2 -1
- package/src/graphiti/local-runtimes.js +22 -2
- package/src/graphiti/project-agent-task-sessions.js +1 -8
- package/src/graphiti/roundtable-host.js +15 -2
- package/src/graphiti/runtime-config.js +3 -1
- package/src/graphiti/task-context-entry.js +6 -3
- package/src/guest-access/failed-bearer-limit.js +31 -0
- package/src/guest-access/guest-card.js +22 -0
- package/src/guest-access/guest-mcp.js +34 -0
- package/src/guest-access/guest-routes.js +144 -0
- package/src/guest-access/listener.js +152 -0
- package/src/guest-access/refusal-tally.js +37 -0
- package/src/guest-access/runtime.js +117 -0
- package/src/http/api-router.js +8 -1
- package/src/http/guest-links-api-router.js +42 -0
- package/src/http/lifecycle-hooks-api-router.js +128 -0
- package/src/http/response.js +7 -6
- package/src/http/statement-api-router.js +10 -3
- package/src/http/visitor-access-api-router.js +29 -15
- package/src/judgment/routing.js +6 -1
- package/src/knowledge-impressions/store.js +30 -6
- package/src/local-runtime/console-autostart-record.js +10 -0
- package/src/local-runtime/console-health.js +7 -2
- package/src/local-runtime/lifecycle.js +2 -3
- package/src/mcp/http-session-transport.js +384 -0
- package/src/mcp/remote-http-server.js +27 -357
- package/src/native-runtime/runtime.js +28 -3
- package/src/native-runtime/windows-processes.js +6 -6
- package/src/presence/windows-helper-pin.js +1 -1
- package/src/server/lan-access.js +43 -9
- package/src/server.js +31 -2
- package/src/setup/graph-runtime.js +10 -6
- package/src/statement/agent-tool.js +16 -8
- package/src/statement/compounding-statement.js +55 -0
- package/src/system/doctor.js +1 -1
- package/src/system/fuli-process-scan.js +81 -0
- package/src/system/system-service.js +2 -2
- package/src/text/local-paths.js +61 -11
- package/src/visit-requests/auto-envelope.js +101 -0
- package/src/visit-requests/git-names.js +10 -0
- package/src/visit-requests/http.js +105 -0
- package/src/visit-requests/peer-entry.js +18 -0
- package/src/visit-requests/records.js +140 -0
- package/src/visit-requests/runner.js +164 -0
- package/src/visit-requests/service.js +575 -0
- package/src/visit-requests/worktree.js +351 -0
- package/src/visitor-access/guest-links.js +75 -0
- package/src/visitor-access/port.js +82 -7
- package/src/visitor-access/rate-limit.js +23 -0
- package/src/visitor-access/store.js +124 -3
- package/src/whats-new/lines/0.27.4.json +13 -0
- package/dist/web/assets/FieldRoot-oxmAMICi.js +0 -1
- package/dist/web/assets/HowtoPage-Dx7xGKQi.js +0 -1
- package/dist/web/assets/KnowledgePage-CwrWmdLl.js +0 -1
- package/dist/web/assets/KnowledgeWorkspace-D8Q8usZc.js +0 -4
- package/dist/web/assets/MenuSeparator-C_h65gsb.js +0 -1
- package/dist/web/assets/ModelSettingsPage-B_Udk6b7.js +0 -1
- package/dist/web/assets/NoticeRow-CcQ1J4wZ.js +0 -1
- package/dist/web/assets/PersonalProjectsPage-CgqC4u77.js +0 -1
- package/dist/web/assets/PopperContent-BkTZlJWP.js +0 -1
- package/dist/web/assets/RovingFocusGroup-Dvddk8pN.js +0 -1
- package/dist/web/assets/RovingFocusItem-Ck-FCX8l.js +0 -1
- package/dist/web/assets/SettingsPage-C80ljt40.js +0 -1
- package/dist/web/assets/TodayPage-EJ8SWFE0.css +0 -1
- package/dist/web/assets/TodayPage-wkVzpeI1.js +0 -1
- package/dist/web/assets/VisuallyHiddenInput-Cc2Qp6aL.js +0 -1
- package/dist/web/assets/WidgetSlot-7bCPwUl2.js +0 -2
- package/dist/web/assets/WorkbenchListPage-DlE6S2WC.js +0 -1
- package/dist/web/assets/_plugin-vue_export-helper-BXUcxlz4.js +0 -9
- package/dist/web/assets/agent-occupation-BQG-rvnx.js +0 -1
- package/dist/web/assets/checkbox-DNX0E3Ym.js +0 -1
- package/dist/web/assets/combobox-BG6YUVkp.js +0 -1
- package/dist/web/assets/copy-mention-BwT-8AqP.js +0 -1
- package/dist/web/assets/dropdown-menu-BScsuHhH.js +0 -1
- package/dist/web/assets/label-table-BVh638Sy.js +0 -1
- package/dist/web/assets/popup-host-CFQVWMSj.js +0 -1
- package/dist/web/assets/radio-group-D6RUfdDr.js +0 -1
- package/dist/web/assets/select-C0ecw2Gn.js +0 -1
- package/dist/web/assets/settings-tabs-D7-3akvW.js +0 -1
- package/dist/web/assets/switch-ClI3aPV3.js +0 -1
- package/dist/web/assets/tabs-BYpn35nj.js +0 -1
- package/dist/web/assets/useDirection-hD2Ki6e_.js +0 -1
- package/dist/web/assets/useForwardScopeId-DJpBz5AW.js +0 -1
- package/dist/web/assets/usePrimitiveElement-tPtHrVAh.js +0 -1
- package/dist/web/assets/utils-Bhge2HAf.js +0 -1
- package/src/system/mcp-process-scan.js +0 -55
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
|
|
3
|
+
import { LEGACY_CLAIM_TTL_MS, recordedProcessEnded } from '../../packages/roundtable/src/roundtable/wake-claim-release.js';
|
|
4
|
+
import { withoutControls } from '../text/control-characters.js';
|
|
5
|
+
import { AUTO_ENVELOPE_RULE, postRunCheck, preRunCheck, runsOnOpenPaths, secretCheck } from './auto-envelope.js';
|
|
6
|
+
import { createVisitRecords } from './records.js';
|
|
7
|
+
|
|
8
|
+
// Requests a visitor sends to be done on this computer (seconding, 外派 C):
|
|
9
|
+
// the state machine, the budgets and what a change of a requester's mode
|
|
10
|
+
// does to its requests. Every change of state is one event row written with
|
|
11
|
+
// it (records.js). A request is refused, or planned by the lead read-only in
|
|
12
|
+
// the owner's project folder and then, by the requester's mode, waits for the
|
|
13
|
+
// owner (plan, and auto outside its envelope) or is approved by the rule (auto
|
|
14
|
+
// inside it, trusted). Only an approved request gets a worktree and branch;
|
|
15
|
+
// FULI never merges or pushes, and the owner keeps or discards the branch.
|
|
16
|
+
//
|
|
17
|
+
// received ─(ask_only / over a budget / busy)→ refused
|
|
18
|
+
// received → planning → awaiting_owner ─approve→ approved
|
|
19
|
+
// └(auto envelope / trusted)→ approved
|
|
20
|
+
// awaiting_owner ─decline→ declined | ─7 days→ expired | ─cancel→ cancelled
|
|
21
|
+
// approved → running → awaiting_review(ready | held) | failed | cancelled | unknown (lost to a restart)
|
|
22
|
+
// awaiting_review → kept (branch stays) | discarded (worktree and branch removed)
|
|
23
|
+
// | ─14 days unreviewed→ expired (worktree removed, branch kept)
|
|
24
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
25
|
+
const EXPIRY_MS = 7 * DAY_MS;
|
|
26
|
+
const REVIEW_EXPIRY_MS = 14 * DAY_MS;
|
|
27
|
+
// Per requester over the last 24 hours (open requests, results waiting for
|
|
28
|
+
// review included, at any time); per shared project and for this whole
|
|
29
|
+
// computer over the last 24 hours; and planning wakes at once.
|
|
30
|
+
export const VISIT_BUDGET = Object.freeze({ requestsPerDay: { peer: 5, guest: 3 }, wakeMsPerDay: 60 * 60 * 1000, open: 10,
|
|
31
|
+
projectPerDay: 10, computerPerDay: 20, planningAtOnce: 2 });
|
|
32
|
+
// Past this many refusals of one requester in a day they are no longer written, so a flood stays bounded.
|
|
33
|
+
const REFUSALS_KEPT_PER_DAY = 100;
|
|
34
|
+
const TITLE_CHARS = 160;
|
|
35
|
+
const WHAT_CHARS = 4000;
|
|
36
|
+
const AREAS = 10;
|
|
37
|
+
const AREA_CHARS = 200;
|
|
38
|
+
const REASON_CHARS = 200;
|
|
39
|
+
const LIST_LIMIT = 200;
|
|
40
|
+
const AWAITING_SHOWN = 5;
|
|
41
|
+
// What a requester may learn of a result's files.
|
|
42
|
+
const SHOWN_FILES = 50;
|
|
43
|
+
const SHOWN_PATH_CHARS = 200;
|
|
44
|
+
// The lead has no client FULI can run constrained here (only Codex, for now): nothing could run the request.
|
|
45
|
+
const NO_CLIENT = 'no_constrained_client';
|
|
46
|
+
const TERMINAL_WITHOUT_RESULT =new Set(['refused', 'declined', 'expired', 'cancelled', 'failed', 'unknown']);
|
|
47
|
+
// The run's client process (runExit): not_started, running (its PID
|
|
48
|
+
// recorded as it starts), ended, or unconfirmed: a stop whose end could not
|
|
49
|
+
// be confirmed (wake.js runProcess), or a restart while it ran. Its worktree
|
|
50
|
+
// stays while unconfirmed, so a process still running never writes into a
|
|
51
|
+
// folder being deleted; noted on the request's history (process_unconfirmed),
|
|
52
|
+
// and once the process is known to have ended (the roundtable's own rule for
|
|
53
|
+
// wake claims; a run an earlier FULI recorded no PID, or no identity of its
|
|
54
|
+
// PID, for, a day later) noted again (process_ended) and tidied. Asked at most
|
|
55
|
+
// this often per request. cleanup_pending: the removal of such a request's
|
|
56
|
+
// worktree failed (a file something still holds, cleanup_failed noted once);
|
|
57
|
+
// it is tried again as often, until it succeeds (cleanup_done) or a day after
|
|
58
|
+
// it first failed, when it is left as it is with its warning.
|
|
59
|
+
const PROCESS_UNCONFIRMED = 'process_unconfirmed';
|
|
60
|
+
const PROCESS_ENDED = 'process_ended';
|
|
61
|
+
const CLEANUP_PENDING = 'cleanup_pending';
|
|
62
|
+
const CLEANUP_DONE = 'cleanup_done';
|
|
63
|
+
const PROCESS_RECHECK_MS = 60 * 1000;
|
|
64
|
+
|
|
65
|
+
// store: the visitor-access store; runner: runner.js; modeOf(key): the requester's current mode.
|
|
66
|
+
// leads.confirm({ projectId, agentId }) → whether that Agent still leads the shared project, as read now.
|
|
67
|
+
// leads.constrainedClients({ agentId }) → the lead's clients FULI can run constrained here, in order (planning and run use the first).
|
|
68
|
+
// leads.describe({ projectId, agentId }) → { name, responsibility } of the lead, which the runs are given as data.
|
|
69
|
+
// inspectProcess(pids), groupAlive(pgid): as for the roundtable's wake claims (wake-claim-release.js); by default
|
|
70
|
+
// the OS is never asked, so an unconfirmed run's worktree stays.
|
|
71
|
+
export function createVisitRequests({ store, runner, modeOf, leads, platform = process.platform, now = () => new Date(),
|
|
72
|
+
idFactory = randomUUID, inspectProcess = async () => null, groupAlive = undefined }) {
|
|
73
|
+
const records = createVisitRecords(store);
|
|
74
|
+
const running = new Map();
|
|
75
|
+
const processChecked = new Map();
|
|
76
|
+
const lanes = new Map();
|
|
77
|
+
const work = new Set();
|
|
78
|
+
let closed = false;
|
|
79
|
+
const at = () => now().toISOString();
|
|
80
|
+
|
|
81
|
+
// A requester's new request. Answers { ok: true, requestId, state } or
|
|
82
|
+
// { ok: false, code } (ask_only, budget_exceeded, project_budget_exceeded,
|
|
83
|
+
// computer_budget_exceeded, planning_busy, request_invalid); the refusal is
|
|
84
|
+
// decided in one transaction before any wake and recorded as a refused row.
|
|
85
|
+
function submit({ requester, source, projectId, agentId, projectFolder = null, request }) {
|
|
86
|
+
const asked = requestText(request);
|
|
87
|
+
if (!asked) return refused('request_invalid');
|
|
88
|
+
const id = idFactory();
|
|
89
|
+
const time = now();
|
|
90
|
+
const since = new Date(time.getTime() - DAY_MS).toISOString();
|
|
91
|
+
const outcome = store.transaction(() => {
|
|
92
|
+
const mode = source === 'guest' ? 'ask_only' : modeOf(requester.key);
|
|
93
|
+
const usage = records.usage(requester.key, since);
|
|
94
|
+
const code = mode === 'ask_only' ? 'ask_only' : overBudget(usage, source) ? 'budget_exceeded'
|
|
95
|
+
: records.acceptedSince(since, { projectId }) >= VISIT_BUDGET.projectPerDay ? 'project_budget_exceeded'
|
|
96
|
+
: records.acceptedSince(since) >= VISIT_BUDGET.computerPerDay ? 'computer_budget_exceeded'
|
|
97
|
+
: records.count('planning') >= VISIT_BUDGET.planningAtOnce ? 'planning_busy' : null;
|
|
98
|
+
if (code && usage.refused >= REFUSALS_KEPT_PER_DAY) return { code };
|
|
99
|
+
records.insert({ id, requesterKey: requester.key, requesterLabel: requester.label, agentName: requester.agentName ?? null,
|
|
100
|
+
source, projectId, agentId, projectFolder, ...asked, mode, at: time.toISOString() });
|
|
101
|
+
if (code) {
|
|
102
|
+
records.move(id, { from: 'received', to: 'refused', by: 'rule', fields: { reason: code }, note: code, at: time.toISOString() });
|
|
103
|
+
return { code };
|
|
104
|
+
}
|
|
105
|
+
records.move(id, { from: 'received', to: 'planning', by: 'system', at: time.toISOString() });
|
|
106
|
+
return { code: null };
|
|
107
|
+
});
|
|
108
|
+
if (outcome.code) return refused(outcome.code);
|
|
109
|
+
background(planRequest(id));
|
|
110
|
+
return { ok: true, requestId: id, state: 'planning' };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// The read-only planning pass in the owner's project folder, then the
|
|
114
|
+
// decision the requester's mode makes. Nothing is copied before approval. A
|
|
115
|
+
// lead with no client FULI can run constrained here ends the request
|
|
116
|
+
// (failed, no_constrained_client), since nothing could run it.
|
|
117
|
+
async function planRequest(id) {
|
|
118
|
+
const { signal, finish } = track(id);
|
|
119
|
+
let planned;
|
|
120
|
+
let unrunnable = false;
|
|
121
|
+
try {
|
|
122
|
+
const request = records.get(id);
|
|
123
|
+
const [client] = await leads.constrainedClients({ agentId: request.agentId }).catch(() => []);
|
|
124
|
+
if (!client) unrunnable = true;
|
|
125
|
+
else {
|
|
126
|
+
records.update(id, { projectFolder: await runner.folder(request) }, at());
|
|
127
|
+
planned = await runner.plan(records.get(id), { signal, client, lead: await leadOf(request) });
|
|
128
|
+
}
|
|
129
|
+
} catch (error) {
|
|
130
|
+
planned = { plan: null, error: error.code ?? 'planning_failed', ms: 0 };
|
|
131
|
+
} finally { finish(); }
|
|
132
|
+
const decided = store.transaction(() => {
|
|
133
|
+
const current = records.get(id);
|
|
134
|
+
if (current?.state !== 'planning') return current;
|
|
135
|
+
if (unrunnable) {
|
|
136
|
+
return records.move(id, { from: 'planning', to: 'failed', by: 'system', fields: { error: NO_CLIENT, reason: NO_CLIENT },
|
|
137
|
+
note: NO_CLIENT, at: at() });
|
|
138
|
+
}
|
|
139
|
+
records.update(id, { plan: planned.plan, planError: planned.error, planningMs: planned.ms }, at());
|
|
140
|
+
return decide(records.get(id));
|
|
141
|
+
});
|
|
142
|
+
if (decided?.state === 'approved') scheduleRun(id);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const leadOf = (request) => leads.describe({ projectId: request.projectId, agentId: request.agentId }).catch(() => null);
|
|
146
|
+
|
|
147
|
+
// A planned request, by the requester's mode as it is now. trusted skips the
|
|
148
|
+
// owner's approval; auto needs its pre-run check (the plan can only keep a
|
|
149
|
+
// request back); anything else waits for the owner. A request without a
|
|
150
|
+
// verified project folder always waits.
|
|
151
|
+
function decide(request) {
|
|
152
|
+
const mode = modeOf(request.requesterKey);
|
|
153
|
+
const folder = request.planError !== 'no_working_directory';
|
|
154
|
+
if (mode === 'trusted' && folder) return approveByRule(request, mode, { rule: 'trusted' });
|
|
155
|
+
if (mode === 'auto') {
|
|
156
|
+
const check = preRunCheck({ plan: request.plan, budgetLeft: wakeBudgetLeft(request.requesterKey) });
|
|
157
|
+
if (check.ok && folder) return approveByRule(request, mode, { rule: AUTO_ENVELOPE_RULE, checks: check.checks });
|
|
158
|
+
return records.move(request.id, { from: 'planning', to: 'awaiting_owner', by: 'rule', rule: AUTO_ENVELOPE_RULE,
|
|
159
|
+
checks: check.checks, at: at() });
|
|
160
|
+
}
|
|
161
|
+
return records.move(request.id, { from: 'planning', to: 'awaiting_owner', by: 'system', at: at() });
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const approveByRule = (request, mode, { rule, checks = null }) => records.move(request.id, { from: 'planning', to: 'approved',
|
|
165
|
+
by: 'rule', rule, checks, fields: { modeAtDecision: mode, decidedBy: 'rule' }, at: at() });
|
|
166
|
+
|
|
167
|
+
// One run of a lead at a time on this computer; the roundtable's own claim
|
|
168
|
+
// also waits for any other wake of that lead.
|
|
169
|
+
function scheduleRun(id) {
|
|
170
|
+
const { agentId } = records.get(id);
|
|
171
|
+
const lane = (lanes.get(agentId) ?? Promise.resolve()).then(() => runRequest(id)).catch(() => {});
|
|
172
|
+
lanes.set(agentId, lane);
|
|
173
|
+
background(lane.finally(() => { if (lanes.get(agentId) === lane) lanes.delete(agentId); }));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
async function runRequest(id) {
|
|
177
|
+
if (closed) return;
|
|
178
|
+
const approved = records.get(id);
|
|
179
|
+
if (approved?.state !== 'approved') return;
|
|
180
|
+
// A rule's approval holds only while the budget does; the owner's does not need it.
|
|
181
|
+
if (approved.decidedBy === 'rule' && !wakeBudgetLeft(approved.requesterKey)) {
|
|
182
|
+
store.transaction(() => records.move(id, { from: 'approved', to: 'awaiting_owner', by: 'rule',
|
|
183
|
+
fields: { decidedBy: null, modeAtDecision: null }, note: 'budget_exceeded', at: at() }));
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
// The share's Agent must still lead the project, as read just before the run.
|
|
187
|
+
if (!await leads.confirm({ projectId: approved.projectId, agentId: approved.agentId }).catch(() => false)) {
|
|
188
|
+
store.transaction(() => records.move(id, { from: 'approved', to: 'cancelled', by: 'system', fields: { reason: 'lead_changed' },
|
|
189
|
+
note: 'lead_changed', at: at() }));
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const [client] = await leads.constrainedClients({ agentId: approved.agentId }).catch(() => []);
|
|
193
|
+
if (!client) {
|
|
194
|
+
store.transaction(() => records.move(id, { from: 'approved', to: 'failed', by: 'system', fields: { error: NO_CLIENT, reason: NO_CLIENT },
|
|
195
|
+
note: NO_CLIENT, at: at() }));
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const lead = await leadOf(approved);
|
|
199
|
+
const { signal, finish } = track(id);
|
|
200
|
+
// Where the worktree and branch will be is recorded with the move, so a
|
|
201
|
+
// restart before they exist still tidies both.
|
|
202
|
+
let request = store.transaction(() => records.move(id, { from: 'approved', to: 'running', by: 'system',
|
|
203
|
+
fields: { ...runner.planned(approved), runExit: 'not_started' }, at: at() }));
|
|
204
|
+
if (!request) { finish(); return; }
|
|
205
|
+
let result;
|
|
206
|
+
try {
|
|
207
|
+
// The worktree is made only now, after the approval.
|
|
208
|
+
records.update(id, await runner.prepare(request), at());
|
|
209
|
+
request = records.get(id);
|
|
210
|
+
result = await runner.run(request, { signal, client, lead, onSpawn: (pid) => spawned(id, pid) });
|
|
211
|
+
} catch (error) {
|
|
212
|
+
const exit = error.cleanup?.status === 'unconfirmed' ? 'unconfirmed' : 'ended';
|
|
213
|
+
const failed = store.transaction(() => {
|
|
214
|
+
// Recorded even when a cancel moved the request meanwhile: the cancel's tidy reads it.
|
|
215
|
+
records.update(id, { runExit: exit }, at());
|
|
216
|
+
const moved = records.move(id, { from: 'running', to: signal.aborted ? 'cancelled' : 'failed',
|
|
217
|
+
by: 'system', fields: { error: error.code ?? 'run_failed', runMs: error.ms ?? 0 }, at: at() });
|
|
218
|
+
if (exit === 'unconfirmed') note(id, PROCESS_UNCONFIRMED);
|
|
219
|
+
return moved;
|
|
220
|
+
});
|
|
221
|
+
finish();
|
|
222
|
+
// A request cancelled meanwhile is tidied by whoever cancelled it, once this ended.
|
|
223
|
+
return failed ? tidy(failed) : undefined;
|
|
224
|
+
}
|
|
225
|
+
store.transaction(() => {
|
|
226
|
+
records.update(id, { runExit: 'ended' }, at());
|
|
227
|
+
records.move(id, { from: 'running', to: 'awaiting_review', ...review(request, result), at: at() });
|
|
228
|
+
});
|
|
229
|
+
finish();
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// The run's client process started: its PID is recorded at once (a console
|
|
233
|
+
// lost right after still knows it), its OS identity once read.
|
|
234
|
+
function spawned(id, pid) {
|
|
235
|
+
if (!Number.isSafeInteger(pid) || pid <= 0) return;
|
|
236
|
+
records.update(id, { runPid: pid, runExit: 'running' }, at());
|
|
237
|
+
void inspectProcess([pid]).then((found) => {
|
|
238
|
+
const identity = found?.get(pid)?.identity;
|
|
239
|
+
if (identity) records.update(id, { runPidIdentity: String(identity) }, at());
|
|
240
|
+
}).catch(() => {});
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// A note on a request's history without a change of state.
|
|
244
|
+
function note(id, text) {
|
|
245
|
+
const current = records.get(id);
|
|
246
|
+
records.event(id, { from: current.state, to: current.state, by: 'system', note: text, at: at() });
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// ready, or held with the first reason: content that must not be staged,
|
|
250
|
+
// something outside the branch changed (or could not be compared in time),
|
|
251
|
+
// something that looks like a secret, files that can run code when the
|
|
252
|
+
// branch is opened (in every mode; listed for the owner), or (auto) the diff
|
|
253
|
+
// left the envelope.
|
|
254
|
+
function review(request, result) {
|
|
255
|
+
const secrets = secretCheck(`${result.summary}\n${result.addedText}`);
|
|
256
|
+
const auto = request.decidedBy === 'rule' && request.modeAtDecision === 'auto';
|
|
257
|
+
const envelope = auto && !result.hold ? postRunCheck({ files: result.files, addedText: result.addedText, platform }) : null;
|
|
258
|
+
// In every mode: files that can run code when the branch is opened, checked out or built.
|
|
259
|
+
const runsOnOpen = result.hold ? [] : runsOnOpenPaths(result.files, platform);
|
|
260
|
+
const integrity = result.intact === null ? 'integrity_unknown' : result.intact ? null : 'integrity_violation';
|
|
261
|
+
const holdReason = result.hold ?? integrity ?? (!secrets.ok ? 'secret_found' : runsOnOpen.length ? 'runs_on_open'
|
|
262
|
+
: envelope && !envelope.ok ? 'outside_envelope' : null);
|
|
263
|
+
return { by: 'rule', rule: auto ? AUTO_ENVELOPE_RULE : null,
|
|
264
|
+
checks: [{ name: 'content_safe', ok: !result.hold }, { name: 'integrity', ok: result.intact === true },
|
|
265
|
+
{ name: 'nothing_runs_on_open', ok: runsOnOpen.length === 0 }, ...(envelope ? envelope.checks : [secrets])],
|
|
266
|
+
fields: { review: holdReason ? 'held' : 'ready', holdReason, heldPaths: runsOnOpen.length ? runsOnOpen : null,
|
|
267
|
+
summary: holdReason === 'secret_found' ? null : result.summary,
|
|
268
|
+
files: result.files.map(({ path, added, removed }) => ({ path, added, removed })), diffstat: result.diffstat, runMs: result.ms } };
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// The worktree of a request that ended without a result, and its empty
|
|
272
|
+
// branch, go; not while its run's process may still be running.
|
|
273
|
+
// A removal that failed is left to the next pass (cleanup_pending), noted once.
|
|
274
|
+
async function tidy(request) {
|
|
275
|
+
if (!request?.worktreePath || !TERMINAL_WITHOUT_RESULT.has(request.state) || request.runExit === 'unconfirmed') return;
|
|
276
|
+
const retry = request.runExit === CLEANUP_PENDING;
|
|
277
|
+
const warning = await removeWorktree(request, { keepBranch: false });
|
|
278
|
+
if (warning === 'cleanup_failed' && retry) return;
|
|
279
|
+
// The next try waits the same minute as a process check.
|
|
280
|
+
if (warning === 'cleanup_failed') processChecked.set(request.id, now().getTime());
|
|
281
|
+
store.transaction(() => {
|
|
282
|
+
if (warning === 'cleanup_failed') records.update(request.id, { runExit: CLEANUP_PENDING }, at());
|
|
283
|
+
else if (retry) records.update(request.id, { runExit: 'ended' }, at());
|
|
284
|
+
if (warning) note(request.id, warning);
|
|
285
|
+
else if (retry) note(request.id, CLEANUP_DONE);
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Tidies what an unconfirmed run kept, once its process is known to have
|
|
290
|
+
// ended, and tries a failed removal again.
|
|
291
|
+
async function releaseEnded() {
|
|
292
|
+
for (const request of records.unfinishedRuns()) {
|
|
293
|
+
if (closed || now().getTime() - (processChecked.get(request.id) ?? -Infinity) < PROCESS_RECHECK_MS) continue;
|
|
294
|
+
processChecked.set(request.id, now().getTime());
|
|
295
|
+
if (request.runExit === CLEANUP_PENDING) {
|
|
296
|
+
// Past a day it is left as it is; its cleanup_failed warning stays the last word.
|
|
297
|
+
if (dayPassed(request)) store.transaction(() => records.update(request.id, { runExit: 'ended' }, at()));
|
|
298
|
+
else await tidy(request);
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
if (!await processEnded(request)) continue;
|
|
302
|
+
const ended = store.transaction(() => {
|
|
303
|
+
if (records.get(request.id)?.runExit !== 'unconfirmed') return null;
|
|
304
|
+
records.update(request.id, { runExit: 'ended' }, at());
|
|
305
|
+
note(request.id, PROCESS_ENDED);
|
|
306
|
+
return records.get(request.id);
|
|
307
|
+
});
|
|
308
|
+
await tidy(ended);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Without an identity of the PID a later process holding it cannot be told
|
|
313
|
+
// from the client, so it is left to the day's limit, as a run without a PID.
|
|
314
|
+
async function processEnded(request) {
|
|
315
|
+
const unproven = dayPassed(request);
|
|
316
|
+
if (!request.runPid) return unproven;
|
|
317
|
+
const ended = await recordedProcessEnded({ pid: request.runPid, identity: request.runPidIdentity }, { inspectProcess, groupAlive });
|
|
318
|
+
return ended === true || ((ended === 'reused' || !request.runPidIdentity) && unproven);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const dayPassed = (request) => now().getTime() - Date.parse(request.updatedAt) >= LEGACY_CLAIM_TTL_MS;
|
|
322
|
+
|
|
323
|
+
// Removes a request's worktree (and its branch unless kept). What could not
|
|
324
|
+
// be removed is never silent: it is noted on the request's history and
|
|
325
|
+
// answered (worktree_entry_kept: Git's entry for the worktree did not name
|
|
326
|
+
// it, so it and the branch stay; branch_kept: Git refused to delete the
|
|
327
|
+
// branch; cleanup_failed: the removal itself failed).
|
|
328
|
+
async function cleanUp(request, { keepBranch }) {
|
|
329
|
+
const warning = await removeWorktree(request, { keepBranch });
|
|
330
|
+
if (warning) {
|
|
331
|
+
try { store.transaction(() => note(request.id, warning)); } catch { /* the answer still carries it */ }
|
|
332
|
+
}
|
|
333
|
+
return warning;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// The removal itself; answers the warning, nothing noted.
|
|
337
|
+
async function removeWorktree(request, { keepBranch }) {
|
|
338
|
+
let left;
|
|
339
|
+
try { left = (await runner.remove(request, { keepBranch })) ?? {}; } catch { left = { failed: true }; }
|
|
340
|
+
return left.failed ? 'cleanup_failed' : left.entryKept ? 'worktree_entry_kept' : left.branchKept ? 'branch_kept' : null;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// A request's wake in flight: its abort signal, and when it ended (a cancel waits for that before tidying).
|
|
344
|
+
function track(id) {
|
|
345
|
+
const controller = new AbortController();
|
|
346
|
+
let finish;
|
|
347
|
+
const done = new Promise((resolve) => { finish = resolve; });
|
|
348
|
+
running.set(id, { controller, done });
|
|
349
|
+
return { signal: controller.signal, finish: () => { running.delete(id); finish(); } };
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// Stops a request's wake and waits until its run (a commit step included) has ended.
|
|
353
|
+
async function stopped(id) {
|
|
354
|
+
const entry = running.get(id);
|
|
355
|
+
if (!entry) return;
|
|
356
|
+
entry.controller.abort();
|
|
357
|
+
await entry.done;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
function background(promise) {
|
|
361
|
+
const tracked = promise.catch(() => {}).finally(() => work.delete(tracked));
|
|
362
|
+
work.add(tracked);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function wakeBudgetLeft(requesterKey) {
|
|
366
|
+
return records.usage(requesterKey, new Date(now().getTime() - DAY_MS).toISOString()).wakeMs < VISIT_BUDGET.wakeMsPerDay;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// ---- the owner's decisions (console, loopback only) ----
|
|
370
|
+
|
|
371
|
+
function act(id, { from, to, by = 'owner', fields = {}, note = null }) {
|
|
372
|
+
const moved = store.transaction(() => {
|
|
373
|
+
if (!records.get(id)) return { code: 'request_not_found' };
|
|
374
|
+
return records.move(id, { from, to, by, fields, note, at: at() }) ?? { code: 'state_conflict' };
|
|
375
|
+
});
|
|
376
|
+
return moved.code ? refused(moved.code) : { ok: true, request: moved };
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function approve(id) {
|
|
380
|
+
const request = records.get(id);
|
|
381
|
+
const moved = act(id, { from: 'awaiting_owner', to: 'approved',
|
|
382
|
+
fields: { decidedBy: 'owner', modeAtDecision: request ? modeOf(request.requesterKey) : null } });
|
|
383
|
+
if (moved.ok) scheduleRun(id);
|
|
384
|
+
return moved;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
async function decline(id, { reason = null } = {}) {
|
|
388
|
+
const shown = typeof reason === 'string' ? [...withoutControls(reason)].slice(0, REASON_CHARS).join('').trim() || null : null;
|
|
389
|
+
const moved = act(id, { from: 'awaiting_owner', to: 'declined', fields: { reason: shown } });
|
|
390
|
+
if (moved.ok) await tidy(moved.request);
|
|
391
|
+
return moved;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Ends a request that has not finished; a running one is stopped, and its
|
|
395
|
+
// worktree goes only once the run (its commit step included) has ended.
|
|
396
|
+
async function cancel(id) {
|
|
397
|
+
const moved = act(id, { from: records.OPEN_STATES, to: 'cancelled' });
|
|
398
|
+
if (!moved.ok) return moved;
|
|
399
|
+
await stopped(id);
|
|
400
|
+
await tidy(records.get(id));
|
|
401
|
+
return { ok: true, request: records.get(id) };
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
async function keep(id) {
|
|
405
|
+
const moved = act(id, { from: 'awaiting_review', to: 'kept' });
|
|
406
|
+
if (!moved.ok) return moved;
|
|
407
|
+
const warning = await cleanUp(moved.request, { keepBranch: true });
|
|
408
|
+
return { ...moved, ...(warning ? { warning } : {}) };
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
async function discard(id) {
|
|
412
|
+
const moved = act(id, { from: 'awaiting_review', to: 'discarded' });
|
|
413
|
+
if (!moved.ok) return moved;
|
|
414
|
+
const warning = await cleanUp(moved.request, { keepBranch: false });
|
|
415
|
+
return { ...moved, ...(warning ? { warning } : {}) };
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// ---- a requester's mode, trust and shares ----
|
|
419
|
+
|
|
420
|
+
// Inside the port's transaction that changes the mode (port.setRequesterMode):
|
|
421
|
+
// ask_only ends every request of that requester that has not finished;
|
|
422
|
+
// plan returns what a rule approved and has not started to the owner.
|
|
423
|
+
// Raising the mode approves nothing that is already waiting.
|
|
424
|
+
function modeChanged(requesterKey, mode, note = `mode_${mode}`) {
|
|
425
|
+
if (mode === 'ask_only') return endOpen(records.inStates(records.OPEN_STATES, { requesterKey }), note);
|
|
426
|
+
if (mode !== 'plan') return { cancelled: [], returned: [] };
|
|
427
|
+
const returned = records.inStates(['approved'], { requesterKey }).filter((request) => request.decidedBy === 'rule')
|
|
428
|
+
.map((request) => records.move(request.id, { from: 'approved', to: 'awaiting_owner', by: 'owner',
|
|
429
|
+
fields: { decidedBy: null, modeAtDecision: null }, note, at: at() })).filter(Boolean).map((request) => request.id);
|
|
430
|
+
return { cancelled: [], returned };
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
function endOpen(requests, note) {
|
|
434
|
+
const cancelled = requests.map((request) => records.move(request.id, { from: records.OPEN_STATES, to: 'cancelled', by: 'owner',
|
|
435
|
+
fields: { reason: note }, note, at: at() })).filter(Boolean).map((request) => request.id);
|
|
436
|
+
return { cancelled, returned: [] };
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// After that transaction committed: stop what was running, wait for it, and tidy up.
|
|
440
|
+
async function settle({ cancelled }) {
|
|
441
|
+
await Promise.all(cancelled.map(async (id) => {
|
|
442
|
+
await stopped(id);
|
|
443
|
+
await tidy(records.get(id));
|
|
444
|
+
}));
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// A paired device the owner revoked: its share is gone, so are its open requests.
|
|
448
|
+
async function requesterRevoked(requesterKey) {
|
|
449
|
+
const effects = store.transaction(() => endOpen(records.inStates(records.OPEN_STATES, { requesterKey }), 'requester_revoked'));
|
|
450
|
+
await settle(effects);
|
|
451
|
+
return effects;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// The shares this computer offers now ([{ projectId, agentId }]): open
|
|
455
|
+
// requests to a project and lead no longer shared end (share_removed).
|
|
456
|
+
async function sharesChanged(shares) {
|
|
457
|
+
const offered = new Set(shares.map((share) => `${share.projectId}\n${share.agentId}`));
|
|
458
|
+
const effects = store.transaction(() => endOpen(records.inStates(records.OPEN_STATES)
|
|
459
|
+
.filter((request) => !offered.has(`${request.projectId}\n${request.agentId}`)), 'share_removed'));
|
|
460
|
+
await settle(effects);
|
|
461
|
+
return effects;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// ---- reads ----
|
|
465
|
+
|
|
466
|
+
// What the requester may see of its own request, and only its own: state,
|
|
467
|
+
// title and the owner's one-line reason. The result (summary, branch, at
|
|
468
|
+
// most SHOWN_FILES cleaned paths, diffstat; never the patch) only once the
|
|
469
|
+
// owner kept the branch, or, for a computer the owner marked fully trusted,
|
|
470
|
+
// as soon as it is ready; a held result never shows it and reads as still
|
|
471
|
+
// waiting for the owner. Reads only: nothing is written or expired here.
|
|
472
|
+
function requesterStatus({ requesterKey, requestId }) {
|
|
473
|
+
const request = typeof requestId === 'string' ? records.get(requestId) : null;
|
|
474
|
+
if (!request || request.requesterKey !== requesterKey) return refused('request_not_found');
|
|
475
|
+
const held = request.review === 'held';
|
|
476
|
+
const trustedReady = request.state === 'awaiting_review' && !held && request.modeAtDecision === 'trusted'
|
|
477
|
+
&& request.decidedBy === 'rule';
|
|
478
|
+
// A result waiting for the owner, held or not, reads like any request waiting for the owner.
|
|
479
|
+
const shown = { ok: true, requestId: request.id,
|
|
480
|
+
state: request.state === 'awaiting_review' && !trustedReady ? 'awaiting_owner' : request.state, title: request.title,
|
|
481
|
+
...(request.reason ? { reason: request.reason } : {}) };
|
|
482
|
+
if (held || !(request.state === 'kept' || trustedReady)) return shown;
|
|
483
|
+
return { ...shown, ...(request.summary ? { summary: request.summary } : {}), ...(request.branch ? { branch: request.branch } : {}),
|
|
484
|
+
files: (request.files ?? []).slice(0, SHOWN_FILES).map((file) => [...withoutControls(file.path)].slice(0, SHOWN_PATH_CHARS).join('')),
|
|
485
|
+
...(request.diffstat ? { diffstat: request.diffstat } : {}) };
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
function list({ state = null, limit = LIST_LIMIT } = {}) {
|
|
489
|
+
expireStale();
|
|
490
|
+
const bounded = Number.isSafeInteger(limit) ? Math.min(Math.max(limit, 1), LIST_LIMIT) : LIST_LIMIT;
|
|
491
|
+
return { requests: records.list({ state, limit: bounded }),
|
|
492
|
+
awaiting: { count: records.count('awaiting_owner'), newest: records.list({ state: 'awaiting_owner', limit: AWAITING_SHOWN }) } };
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// The owner's full card: the request, its history and, once there is a
|
|
496
|
+
// result whose branch still exists, the patch.
|
|
497
|
+
async function card(id) {
|
|
498
|
+
expireStale();
|
|
499
|
+
const request = records.get(id);
|
|
500
|
+
if (!request) return refused('request_not_found');
|
|
501
|
+
const diff = ['awaiting_review', 'kept', 'expired'].includes(request.state) && request.branch && request.files
|
|
502
|
+
? await runner.patch(request).catch(() => null) : null;
|
|
503
|
+
return { ok: true, request, events: records.events(id), diff };
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// Requests that waited for the owner for 7 days end and their worktrees go;
|
|
507
|
+
// results left unreviewed for 14 days end too, their worktree removed and
|
|
508
|
+
// their branch kept, so nothing of the work is deleted silently.
|
|
509
|
+
function expireStale() {
|
|
510
|
+
if (!store.readable) return;
|
|
511
|
+
const cutoff = (ms) => new Date(now().getTime() - ms).toISOString();
|
|
512
|
+
const expired = store.transaction(() => [
|
|
513
|
+
...records.inStates(['awaiting_owner']).filter((request) => request.updatedAt < cutoff(EXPIRY_MS))
|
|
514
|
+
.map((request) => records.move(request.id, { from: 'awaiting_owner', to: 'expired', by: 'system', at: at() })),
|
|
515
|
+
...records.inStates(['awaiting_review']).filter((request) => request.updatedAt < cutoff(REVIEW_EXPIRY_MS))
|
|
516
|
+
.map((request) => records.move(request.id, { from: 'awaiting_review', to: 'expired', by: 'system', note: 'review_expired', at: at() }))
|
|
517
|
+
].filter(Boolean));
|
|
518
|
+
for (const request of expired) {
|
|
519
|
+
background(request.files ? cleanUp(request, { keepBranch: true }) : tidy(request));
|
|
520
|
+
}
|
|
521
|
+
background(releaseEnded());
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// After a restart nothing of an earlier process is still being supervised:
|
|
525
|
+
// a run that was going is unknown and its worktree goes once its client
|
|
526
|
+
// process is known to have ended (at once when it had not started), a plan
|
|
527
|
+
// that was going waits for the owner without one, and what was approved runs.
|
|
528
|
+
function resume() {
|
|
529
|
+
if (!store.readable) return;
|
|
530
|
+
const { approved, unknown } = store.transaction(() => {
|
|
531
|
+
const lost = records.inStates(['running']).map((request) => {
|
|
532
|
+
// A run an earlier FULI recorded nothing of (runExit null) may have started too.
|
|
533
|
+
const exit = request.runExit === 'not_started' ? 'ended' : 'unconfirmed';
|
|
534
|
+
const moved = records.move(request.id, { from: 'running', to: 'unknown', by: 'system',
|
|
535
|
+
fields: { error: 'restarted', runExit: exit }, at: at() });
|
|
536
|
+
if (moved && exit === 'unconfirmed') note(request.id, PROCESS_UNCONFIRMED);
|
|
537
|
+
return moved;
|
|
538
|
+
}).filter(Boolean);
|
|
539
|
+
for (const request of records.inStates(['planning'])) {
|
|
540
|
+
records.update(request.id, { planError: 'planning_interrupted' }, at());
|
|
541
|
+
records.move(request.id, { from: 'planning', to: 'awaiting_owner', by: 'system', note: 'planning_interrupted', at: at() });
|
|
542
|
+
}
|
|
543
|
+
return { unknown: lost, approved: records.inStates(['approved']) };
|
|
544
|
+
});
|
|
545
|
+
for (const request of unknown) background(tidy(request));
|
|
546
|
+
for (const request of approved) scheduleRun(request.id);
|
|
547
|
+
expireStale();
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
async function close() {
|
|
551
|
+
closed = true;
|
|
552
|
+
for (const { controller } of running.values()) controller.abort();
|
|
553
|
+
await Promise.allSettled([...work]);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
return { submit, requesterStatus, list, card, approve, decline, cancel, keep, discard, modeChanged, settle,
|
|
557
|
+
requesterRevoked, sharesChanged, resume, close };
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
function overBudget(usage, source) {
|
|
561
|
+
return usage.requests >= VISIT_BUDGET.requestsPerDay[source] || usage.open >= VISIT_BUDGET.open
|
|
562
|
+
|| usage.wakeMs >= VISIT_BUDGET.wakeMsPerDay;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
// The requester's text as it is kept: bounded, and refused when it does not
|
|
566
|
+
// fit rather than cut, so the card always shows what was actually asked.
|
|
567
|
+
function requestText(request) {
|
|
568
|
+
const { title, what, expectedAreas = [] } = request ?? {};
|
|
569
|
+
const fits = (value, max) => typeof value === 'string' && value.trim() && value.length <= max;
|
|
570
|
+
if (!fits(title, TITLE_CHARS) || !fits(what, WHAT_CHARS) || !Array.isArray(expectedAreas) || expectedAreas.length > AREAS
|
|
571
|
+
|| !expectedAreas.every((area) => fits(area, AREA_CHARS))) return null;
|
|
572
|
+
return { title: title.trim(), what: what.trim(), requesterAreas: expectedAreas.map((area) => area.trim()) };
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
const refused = (code) => ({ ok: false, code });
|