decocms 2.309.0 → 2.310.0
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/client/assets/{AlertCircle-DfpOj9uk.js → AlertCircle-Cty0PLzG.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-CGsSFJZH.js → ArrowNarrowLeft-GsAWuH-U.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DtiNC8xj.js → ArrowUpRight-Ck_tkMu3.js} +1 -1
- package/dist/client/assets/{Check-DXPBjwC9.js → Check-3abToiit.js} +1 -1
- package/dist/client/assets/{CheckCircle-DenvulPR.js → CheckCircle-gN0xOzFk.js} +1 -1
- package/dist/client/assets/{ChevronDown-BzUdsdeu.js → ChevronDown-Du1srzFH.js} +1 -1
- package/dist/client/assets/{ChevronRight-8RBDSI4c.js → ChevronRight-CZd3BLjH.js} +1 -1
- package/dist/client/assets/{ChevronUp-CkOPdM7g.js → ChevronUp-CgHHKXV-.js} +1 -1
- package/dist/client/assets/{Container-B2b9FJMR.js → Container-DV6TDqni.js} +1 -1
- package/dist/client/assets/{DotsVertical-CCxgBVsk.js → DotsVertical-D7_daHaX.js} +1 -1
- package/dist/client/assets/{LinkExternal01-C_eUHFUm.js → LinkExternal01-CLwRaqiP.js} +1 -1
- package/dist/client/assets/{Lock01-SmEMRGOb.js → Lock01-DW1KfF8p.js} +1 -1
- package/dist/client/assets/{Palette-qMNBtXtx.js → Palette-DgoZ3R-C.js} +1 -1
- package/dist/client/assets/{Play-DmVY8R1A.js → Play-ZbM8yAk4.js} +1 -1
- package/dist/client/assets/{Plus-B19lTgl_.js → Plus-xUHEWwhK.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-DDZo1WKt.js → RefreshCcw01-DOURBTJB.js} +1 -1
- package/dist/client/assets/{SearchMd-BvQQOrkm.js → SearchMd-D05lbITN.js} +1 -1
- package/dist/client/assets/{Settings02-CYadYmOF.js → Settings02-YbowrI3C.js} +1 -1
- package/dist/client/assets/{Shield01-GS3q0eea.js → Shield01-C9nMXmPC.js} +1 -1
- package/dist/client/assets/{Star01-BM8AlGEC.js → Star01-Dcuqy8Xk.js} +1 -1
- package/dist/client/assets/{Sun-B2OKfrtR.js → Sun-s1inzqGI.js} +1 -1
- package/dist/client/assets/{Tool01-CIMPkAjR.js → Tool01-BxwtRzVa.js} +1 -1
- package/dist/client/assets/{Trash01-4PBXkXRo.js → Trash01-Bgq8zueU.js} +1 -1
- package/dist/client/assets/{User01-nh8Rby1P.js → User01-C3dKJDdx.js} +1 -1
- package/dist/client/assets/{Users03-CItFKGX1.js → Users03-DBewd1K5.js} +1 -1
- package/dist/client/assets/{X-CGShNfee.js → X-BANQifhl.js} +1 -1
- package/dist/client/assets/{XCircle-CTrtJtfR.js → XCircle-BOat1iVu.js} +1 -1
- package/dist/client/assets/{XClose-BnCJyyB-.js → XClose-B0qkWAhQ.js} +1 -1
- package/dist/client/assets/{Zap-D7WiwjAV.js → Zap-Cq3RtLSB.js} +1 -1
- package/dist/client/assets/{ZapSquare-DhbSIk6a.js → ZapSquare-BajF09ms.js} +1 -1
- package/dist/client/assets/{accordion-CgT_Vu18.js → accordion-Bm-v7xME.js} +1 -1
- package/dist/client/assets/{agent-icon-GBX3RKid.js → agent-icon-SBMo6sYE.js} +1 -1
- package/dist/client/assets/{agents-list--TECSTo0.js → agents-list-GJhbrN0t.js} +1 -1
- package/dist/client/assets/ai-providers-CGGe3rZi.js +1 -0
- package/dist/client/assets/{alert-dialog-CZ6BxFHK.js → alert-dialog-Bht5ffLL.js} +1 -1
- package/dist/client/assets/{auth-catchall-CzFa67HB.js → auth-catchall-BywQWWLa.js} +1 -1
- package/dist/client/assets/{automation-list-row-DC7TfwMb.js → automation-list-row-Bf0t7EtN.js} +1 -1
- package/dist/client/assets/{automations-DPy2yPJ7.js → automations-TTGgZ4_x.js} +1 -1
- package/dist/client/assets/{avatar-BbisflHp.js → avatar-C0tjLWvd.js} +1 -1
- package/dist/client/assets/{badge-B32WzuEH.js → badge-CETVYtBV.js} +1 -1
- package/dist/client/assets/{brand-context-CNm1jHaQ.js → brand-context-BYQ1b567.js} +1 -1
- package/dist/client/assets/{card-DdVfFEw2.js → card-CGYKd1RQ.js} +1 -1
- package/dist/client/assets/{chat-context-BnJMVusJ.js → chat-context-CNhlOw91.js} +1 -1
- package/dist/client/assets/{checkbox-BJiR6nKO.js → checkbox-GOJe-fLe.js} +1 -1
- package/dist/client/assets/{collection-detail-tyzI1jcV.js → collection-detail-D2LL1NRS.js} +1 -1
- package/dist/client/assets/{collection-display-button-Tq0uOlxA.js → collection-display-button-D33z-MiQ.js} +1 -1
- package/dist/client/assets/{collection-search-BBFkmets.js → collection-search-DKsJLeUf.js} +1 -1
- package/dist/client/assets/{collection-search-D62A0L7U.js → collection-search-pRmMMUTu.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CjFwfKJr.js → collection-table-wrapper-DkvuPVRT.js} +1 -1
- package/dist/client/assets/{collection-tabs--b599n6J.js → collection-tabs-Dm7Azh1U.js} +1 -1
- package/dist/client/assets/{collections-C5AWnYf0.js → collections-CRk11Z8a.js} +1 -1
- package/dist/client/assets/{command-DK-j4arJ.js → command-BUpWRvBK.js} +1 -1
- package/dist/client/assets/{connection-card--P5ycKzL.js → connection-card-D9OhH-Fq.js} +1 -1
- package/dist/client/assets/{connection-detail-CUNWcOPp.js → connection-detail-CQU5Tvmh.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BeJI6IBg.js → connection-form-helpers-D1bN8HX-.js} +1 -1
- package/dist/client/assets/{connections-DWQtsigZ.js → connections-CgifR5uL.js} +1 -1
- package/dist/client/assets/{constants-CnfWGYKH.js → constants-BCHiURE4.js} +1 -1
- package/dist/client/assets/{constants-sHQufsXI.js → constants-Cp5N7awu.js} +1 -1
- package/dist/client/assets/{dialog-BZytMGON.js → dialog-C67OG62k.js} +1 -1
- package/dist/client/assets/{domain-settings-bUM7Hn2b.js → domain-settings-tkR1Nxgx.js} +1 -1
- package/dist/client/assets/{drawer-D-6kJz55.js → drawer-dxlczq_i.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BpdWPWdq.js → dropdown-menu-CW5XsoI8.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-CZeZv3Kn.js → dynamic-plugin-layout-tEvbHH60.js} +1 -1
- package/dist/client/assets/{empty-state-BQISF-I3.js → empty-state-Ci5HFdKD.js} +1 -1
- package/dist/client/assets/{empty-state-DuLPP0P_.js → empty-state-CmG4puLG.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Bj_pawjK.js → extract-connection-data-hFQpz6Ey.js} +1 -1
- package/dist/client/assets/{features-92AWt8WI.js → features-BVz7FR1H.js} +1 -1
- package/dist/client/assets/{form-Bi1l8-LL.js → form-DPfW-AID.js} +1 -1
- package/dist/client/assets/{general-CJgzv-Wx.js → general-CU3b0SfV.js} +1 -1
- package/dist/client/assets/{index-YDo551Ci.js → index-BFPJC5eE.js} +1 -1
- package/dist/client/assets/{index-gC4su7X_.js → index-C9J0IAed.js} +1 -1
- package/dist/client/assets/{index-Dr1V1Dds.js → index-CKp44BR_.js} +1 -1
- package/dist/client/assets/{index-BheN5Hjz.js → index-CMBuSnHj.js} +1 -1
- package/dist/client/assets/{index-CzZgNQPp.js → index-COeQARzy.js} +1 -1
- package/dist/client/assets/{index-R0jE9KSj.js → index-Cg8Nu4CY.js} +3 -3
- package/dist/client/assets/{index-C39RwBnQ.js → index-ClSJa_a-.js} +1 -1
- package/dist/client/assets/{index-BydJ2WUR.js → index-DGiQyM9G.js} +1 -1
- package/dist/client/assets/index-DP8Jy3jt.js +1 -0
- package/dist/client/assets/{index--ghksYAo.js → index-DS-a6wyz.js} +1 -1
- package/dist/client/assets/{index-C03HvIgQ.js → index-Ddo0iMq6.js} +1 -1
- package/dist/client/assets/{index-DSzBgSpo.js → index-HbxcCsnZ.js} +1 -1
- package/dist/client/assets/{index-CE54Jnz-.js → index-QuRKY5U6.js} +1 -1
- package/dist/client/assets/{index-Cbpr6CGx.js → index-akTmUiSO.js} +1 -1
- package/dist/client/assets/{index-BFIwa8W4.js → index-e7eEqZQD.js} +2 -2
- package/dist/client/assets/{index-BgSyGi69.js → index-hiuu-64i.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-NmUU_rOy.js → infiniteQueryObserver-CHiY1NnZ.js} +1 -1
- package/dist/client/assets/{input-C66FZPPf.js → input-B8x8lV8_.js} +1 -1
- package/dist/client/assets/{integration-icon-fPkSifk0.js → integration-icon-Bfmqyrf_.js} +1 -1
- package/dist/client/assets/{label-BMe1SNEP.js → label-BU7N79Fq.js} +1 -1
- package/dist/client/assets/{layout-DbOAzt16.js → layout-Dnq67rSm.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-BP1iZHjy.js → lean-canvas-recruit-modal-C70LSjWJ.js} +1 -1
- package/dist/client/assets/{login-CRXuvxd9.js → login-_Q9L7mst.js} +1 -1
- package/dist/client/assets/{members-BwleeoVp.js → members-D-VFZlys.js} +1 -1
- package/dist/client/assets/{monaco-editor-C457mqYB.js → monaco-editor-BXyi5viY.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DKl9Ubde.js → monitoring-stats-row-CEoUxcHm.js} +1 -1
- package/dist/client/assets/{oauth-callback-1dC9VVpc.js → oauth-callback-B5dtt4y6.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BGY5Uat_.js → oauth-callback-ai-provider-Cc_nFPdq.js} +1 -1
- package/dist/client/assets/{onboarding-C1bM-up9.js → onboarding-uWZePAti.js} +1 -1
- package/dist/client/assets/{org-layout-Cll4mSr3.js → org-layout-BK5cWTcx.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-qjkMXyOy.js → org-plugin-layout-C0ezKAgt.js} +1 -1
- package/dist/client/assets/{pair-Bl_sqsCX.js → pair-BTwp6bTc.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DCQUcDfK.js → plugin-empty-state-CjfGiA5F.js} +1 -1
- package/dist/client/assets/{plugin-header-Deqthnjp.js → plugin-header-D9DU3BMG.js} +1 -1
- package/dist/client/assets/{plugin-layout-m0OkUjnq.js → plugin-layout-DSjok7-L.js} +1 -1
- package/dist/client/assets/{popover-DIqVWKAH.js → popover-3D5jsJh1.js} +1 -1
- package/dist/client/assets/{profile-Ck6jHCNy.js → profile-BdmoV93F.js} +1 -1
- package/dist/client/assets/{project-app-view-D--E6naM.js → project-app-view-CmNwDiw0.js} +1 -1
- package/dist/client/assets/registry-C8zMtgwr.js +2 -0
- package/dist/client/assets/{registry-layout-BaLlt8iJ.js → registry-layout-xyKYdVRG.js} +1 -1
- package/dist/client/assets/{required-auth-layout-4lbvRXP9.js → required-auth-layout-W0nsPTz2.js} +1 -1
- package/dist/client/assets/{reset-password-E281j__o.js → reset-password-BVEdYLL2.js} +1 -1
- package/dist/client/assets/{roles-CG_umLTJ.js → roles-CtNr9Xv_.js} +1 -1
- package/dist/client/assets/{scroll-area-Dpf0WEDP.js → scroll-area-D71z0--k.js} +1 -1
- package/dist/client/assets/{search-input-BcoDzgCL.js → search-input-C1sIJN1c.js} +1 -1
- package/dist/client/assets/{select-CsQfJ0qv.js → select-mWz1b_ZH.js} +1 -1
- package/dist/client/assets/{select-model-Vwe69qWq.js → select-model-tmulvVLX.js} +1 -1
- package/dist/client/assets/{settings-layout-Cw1Oq9lP.js → settings-layout-BqXIUoEI.js} +1 -1
- package/dist/client/assets/{settings-section-Bcn_yZSc.js → settings-section-OvOVUTcw.js} +1 -1
- package/dist/client/assets/{shell-layout-BQPFdNnv.js → shell-layout-5NI7-V2p.js} +1 -1
- package/dist/client/assets/{skeleton-DFE9g6JF.js → skeleton-Bq5_S0j2.js} +1 -1
- package/dist/client/assets/{sso-DFJ1V_Eq.js → sso-CbTsdhS9.js} +1 -1
- package/dist/client/assets/{store-BupAo568.js → store-Dfk_RNXS.js} +1 -1
- package/dist/client/assets/store-registry-Cc1z30ih.js +2 -0
- package/dist/client/assets/{switch-B9pehtZv.js → switch-KcpCgqTm.js} +1 -1
- package/dist/client/assets/{table-CvhbCrhO.js → table-Dcu4orQb.js} +1 -1
- package/dist/client/assets/{tabs-Dxl_bMcE.js → tabs-yr1sdiKv.js} +1 -1
- package/dist/client/assets/{task-status-BWs0NSVc.js → task-status-feSWSO3m.js} +1 -1
- package/dist/client/assets/{textarea-DH2INXqG.js → textarea-B5KVzuoV.js} +1 -1
- package/dist/client/assets/{toggle-group-BKADQha7.js → toggle-group-DhgFoVFU.js} +1 -1
- package/dist/client/assets/{tools-list-CVKmigbN.js → tools-list-B0Yp2GUj.js} +1 -1
- package/dist/client/assets/{tooltip-CzkIRbGJ.js → tooltip-BPT840gf.js} +1 -1
- package/dist/client/assets/{types-CiOXD-c9.js → types-9jOTGnHq.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BSpy6MGb.js → use-ai-providers-D69mlQI8.js} +1 -1
- package/dist/client/assets/{use-collections-BgNhuD43.js → use-collections-DwvEVl8v.js} +1 -1
- package/dist/client/assets/{use-connection-BypaB8s_.js → use-connection-JJHjF6rv.js} +1 -1
- package/dist/client/assets/{use-copy-DUQETT2i.js → use-copy-C9_Hg3HJ.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Cr6RxP_0.js → use-create-virtual-mcp-D-lXC80m.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DO41C7Df.js → use-debounced-autosave-DFbpcKm7.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Bd5bEjkf.js → use-decopilot-events-BcK-yZDw.js} +1 -1
- package/dist/client/assets/{use-delete-connection-v1LXlIsA.js → use-delete-connection-CPz0jmtA.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-QOTO_hJO.js → use-infinite-scroll-B1xILXLP.js} +1 -1
- package/dist/client/assets/{use-list-state-C_A7sIoE.js → use-list-state-BZRsAUdo.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Dneo9PV9.js → use-mcp-tools-D73stCOo.js} +1 -1
- package/dist/client/assets/{use-members-ClknS2e8.js → use-members-DsN3ITf2.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-jsYNoTy7.js → use-navigate-to-agent-CJDDIver.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-piAjQuqe.js → use-org-auth-client-Bq9q7Hza.js} +1 -1
- package/dist/client/assets/{use-org-sso-BbOiG5xt.js → use-org-sso-D22xZlY0.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DRnvDp6V.js → use-organization-roles-Q3jXj8C7.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Cl63rukI.js → use-organization-settings-DC8b5MPT.js} +1 -1
- package/dist/client/assets/{use-registry-connections-nKQr071c.js → use-registry-connections-XqvUTmE5.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DNBT8d2Q.js → use-status-sounds-CCFuBFY0.js} +1 -1
- package/dist/client/assets/{use-tasks-D6w8iRzc.js → use-tasks-Btt8g-fe.js} +1 -1
- package/dist/client/assets/{use-view-mode-EFwbm8pp.js → use-view-mode-BvotgnsQ.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BW1ujP1y.js → use-virtual-mcp-BgZ2h4E7.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DxaE8j48.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-CgPS4Lvz.js +1 -0
- package/dist/client/assets/{user-B9J8wn-0.js → user-C-74yDDj.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-P1fMVeBh.js → view-mode-toggle-BX0KOixc.js} +1 -1
- package/dist/client/assets/{workflow-Bk-2rBg-.js → workflow-D8djL2VH.js} +1 -1
- package/dist/client/assets/workflow-detail-eNmJkRLG.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/node_modules/get-east-asian-width/index.d.ts +60 -0
- package/dist/server/node_modules/get-east-asian-width/index.js +30 -0
- package/dist/server/node_modules/get-east-asian-width/lookup-data.js +18 -0
- package/dist/server/node_modules/get-east-asian-width/lookup.js +135 -0
- package/dist/server/node_modules/get-east-asian-width/package.json +71 -0
- package/dist/server/node_modules/get-east-asian-width/readme.md +65 -0
- package/dist/server/node_modules/get-east-asian-width/utilities.js +24 -0
- package/dist/server/node_modules/ink/build/ansi-tokenizer.d.ts +38 -0
- package/dist/server/node_modules/ink/build/ansi-tokenizer.js +316 -0
- package/dist/server/node_modules/ink/build/ansi-tokenizer.js.map +1 -0
- package/dist/server/node_modules/ink/build/apply-styles.js +175 -0
- package/dist/server/node_modules/ink/build/build-layout.js +77 -0
- package/dist/server/node_modules/ink/build/calculate-wrapped-text.js +53 -0
- package/dist/server/node_modules/ink/build/colorize.d.ts +3 -0
- package/dist/server/node_modules/ink/build/colorize.js +48 -0
- package/dist/server/node_modules/ink/build/colorize.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/AccessibilityContext.d.ts +3 -0
- package/dist/server/node_modules/ink/build/components/AccessibilityContext.js +5 -0
- package/dist/server/node_modules/ink/build/components/AccessibilityContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/App.d.ts +18 -0
- package/dist/server/node_modules/ink/build/components/App.js +351 -0
- package/dist/server/node_modules/ink/build/components/App.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/AppContext.d.ts +15 -0
- package/dist/server/node_modules/ink/build/components/AppContext.js +11 -0
- package/dist/server/node_modules/ink/build/components/AppContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/BackgroundContext.d.ts +4 -0
- package/dist/server/node_modules/ink/build/components/BackgroundContext.js +3 -0
- package/dist/server/node_modules/ink/build/components/BackgroundContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Box.d.ts +117 -0
- package/dist/server/node_modules/ink/build/components/Box.js +34 -0
- package/dist/server/node_modules/ink/build/components/Box.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Color.js +62 -0
- package/dist/server/node_modules/ink/build/components/Cursor.d.ts +83 -0
- package/dist/server/node_modules/ink/build/components/Cursor.js +53 -0
- package/dist/server/node_modules/ink/build/components/Cursor.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/CursorContext.d.ts +11 -0
- package/dist/server/node_modules/ink/build/components/CursorContext.js +8 -0
- package/dist/server/node_modules/ink/build/components/CursorContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/ErrorBoundary.d.ts +18 -0
- package/dist/server/node_modules/ink/build/components/ErrorBoundary.js +23 -0
- package/dist/server/node_modules/ink/build/components/ErrorBoundary.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/ErrorOverview.d.ts +6 -0
- package/dist/server/node_modules/ink/build/components/ErrorOverview.js +84 -0
- package/dist/server/node_modules/ink/build/components/ErrorOverview.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/FocusContext.d.ts +16 -0
- package/dist/server/node_modules/ink/build/components/FocusContext.js +17 -0
- package/dist/server/node_modules/ink/build/components/FocusContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Newline.d.ts +13 -0
- package/dist/server/node_modules/ink/build/components/Newline.js +8 -0
- package/dist/server/node_modules/ink/build/components/Newline.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Spacer.d.ts +7 -0
- package/dist/server/node_modules/ink/build/components/Spacer.js +11 -0
- package/dist/server/node_modules/ink/build/components/Spacer.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Static.d.ts +24 -0
- package/dist/server/node_modules/ink/build/components/Static.js +28 -0
- package/dist/server/node_modules/ink/build/components/Static.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/StderrContext.d.ts +15 -0
- package/dist/server/node_modules/ink/build/components/StderrContext.js +13 -0
- package/dist/server/node_modules/ink/build/components/StderrContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/StdinContext.d.ts +22 -0
- package/dist/server/node_modules/ink/build/components/StdinContext.js +19 -0
- package/dist/server/node_modules/ink/build/components/StdinContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/StdoutContext.d.ts +15 -0
- package/dist/server/node_modules/ink/build/components/StdoutContext.js +13 -0
- package/dist/server/node_modules/ink/build/components/StdoutContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Text.d.ts +55 -0
- package/dist/server/node_modules/ink/build/components/Text.js +50 -0
- package/dist/server/node_modules/ink/build/components/Text.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Transform.d.ts +16 -0
- package/dist/server/node_modules/ink/build/components/Transform.js +15 -0
- package/dist/server/node_modules/ink/build/components/Transform.js.map +1 -0
- package/dist/server/node_modules/ink/build/cursor-helpers.d.ts +38 -0
- package/dist/server/node_modules/ink/build/cursor-helpers.js +56 -0
- package/dist/server/node_modules/ink/build/cursor-helpers.js.map +1 -0
- package/dist/server/node_modules/ink/build/devtools-window-polyfill.d.ts +1 -0
- package/dist/server/node_modules/ink/build/devtools-window-polyfill.js +65 -0
- package/dist/server/node_modules/ink/build/devtools-window-polyfill.js.map +1 -0
- package/dist/server/node_modules/ink/build/devtools.d.ts +1 -0
- package/dist/server/node_modules/ink/build/devtools.js +11 -0
- package/dist/server/node_modules/ink/build/devtools.js.map +1 -0
- package/dist/server/node_modules/ink/build/dom.d.ts +56 -0
- package/dist/server/node_modules/ink/build/dom.js +124 -0
- package/dist/server/node_modules/ink/build/dom.js.map +1 -0
- package/dist/server/node_modules/ink/build/experimental/apply-style.js +140 -0
- package/dist/server/node_modules/ink/build/experimental/dom.js +123 -0
- package/dist/server/node_modules/ink/build/experimental/output.js +91 -0
- package/dist/server/node_modules/ink/build/experimental/reconciler.js +141 -0
- package/dist/server/node_modules/ink/build/experimental/renderer.js +81 -0
- package/dist/server/node_modules/ink/build/get-max-width.d.ts +3 -0
- package/dist/server/node_modules/ink/build/get-max-width.js +10 -0
- package/dist/server/node_modules/ink/build/get-max-width.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-app.d.ts +5 -0
- package/dist/server/node_modules/ink/build/hooks/use-app.js +8 -0
- package/dist/server/node_modules/ink/build/hooks/use-app.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-cursor.d.ts +12 -0
- package/dist/server/node_modules/ink/build/hooks/use-cursor.js +29 -0
- package/dist/server/node_modules/ink/build/hooks/use-cursor.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-focus-manager.d.ts +28 -0
- package/dist/server/node_modules/ink/build/hooks/use-focus-manager.js +17 -0
- package/dist/server/node_modules/ink/build/hooks/use-focus-manager.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-focus.d.ts +29 -0
- package/dist/server/node_modules/ink/build/hooks/use-focus.js +42 -0
- package/dist/server/node_modules/ink/build/hooks/use-focus.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-input.d.ts +131 -0
- package/dist/server/node_modules/ink/build/hooks/use-input.js +124 -0
- package/dist/server/node_modules/ink/build/hooks/use-input.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.d.ts +5 -0
- package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js +11 -0
- package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-stderr.d.ts +5 -0
- package/dist/server/node_modules/ink/build/hooks/use-stderr.js +8 -0
- package/dist/server/node_modules/ink/build/hooks/use-stderr.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-stdin.d.ts +5 -0
- package/dist/server/node_modules/ink/build/hooks/use-stdin.js +8 -0
- package/dist/server/node_modules/ink/build/hooks/use-stdin.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-stdout.d.ts +5 -0
- package/dist/server/node_modules/ink/build/hooks/use-stdout.js +8 -0
- package/dist/server/node_modules/ink/build/hooks/use-stdout.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/useInput.js +38 -0
- package/dist/server/node_modules/ink/build/index.d.ts +34 -0
- package/dist/server/node_modules/ink/build/index.js +20 -0
- package/dist/server/node_modules/ink/build/index.js.map +1 -0
- package/dist/server/node_modules/ink/build/ink.d.ts +90 -0
- package/dist/server/node_modules/ink/build/ink.js +637 -0
- package/dist/server/node_modules/ink/build/ink.js.map +1 -0
- package/dist/server/node_modules/ink/build/input-parser.d.ts +7 -0
- package/dist/server/node_modules/ink/build/input-parser.js +154 -0
- package/dist/server/node_modules/ink/build/input-parser.js.map +1 -0
- package/dist/server/node_modules/ink/build/instance.js +205 -0
- package/dist/server/node_modules/ink/build/instances.d.ts +3 -0
- package/dist/server/node_modules/ink/build/instances.js +8 -0
- package/dist/server/node_modules/ink/build/instances.js.map +1 -0
- package/dist/server/node_modules/ink/build/kitty-keyboard.d.ts +23 -0
- package/dist/server/node_modules/ink/build/kitty-keyboard.js +32 -0
- package/dist/server/node_modules/ink/build/kitty-keyboard.js.map +1 -0
- package/dist/server/node_modules/ink/build/layout.d.ts +7 -0
- package/dist/server/node_modules/ink/build/layout.js +33 -0
- package/dist/server/node_modules/ink/build/layout.js.map +1 -0
- package/dist/server/node_modules/ink/build/log-update.d.ts +19 -0
- package/dist/server/node_modules/ink/build/log-update.js +242 -0
- package/dist/server/node_modules/ink/build/log-update.js.map +1 -0
- package/dist/server/node_modules/ink/build/measure-element.d.ts +16 -0
- package/dist/server/node_modules/ink/build/measure-element.js +9 -0
- package/dist/server/node_modules/ink/build/measure-element.js.map +1 -0
- package/dist/server/node_modules/ink/build/measure-text.d.ts +6 -0
- package/dist/server/node_modules/ink/build/measure-text.js +21 -0
- package/dist/server/node_modules/ink/build/measure-text.js.map +1 -0
- package/dist/server/node_modules/ink/build/options.d.ts +52 -0
- package/dist/server/node_modules/ink/build/options.js +2 -0
- package/dist/server/node_modules/ink/build/options.js.map +1 -0
- package/dist/server/node_modules/ink/build/output.d.ts +35 -0
- package/dist/server/node_modules/ink/build/output.js +183 -0
- package/dist/server/node_modules/ink/build/output.js.map +1 -0
- package/dist/server/node_modules/ink/build/parse-keypress.d.ts +22 -0
- package/dist/server/node_modules/ink/build/parse-keypress.js +493 -0
- package/dist/server/node_modules/ink/build/parse-keypress.js.map +1 -0
- package/dist/server/node_modules/ink/build/reconciler.d.ts +4 -0
- package/dist/server/node_modules/ink/build/reconciler.js +274 -0
- package/dist/server/node_modules/ink/build/reconciler.js.map +1 -0
- package/dist/server/node_modules/ink/build/render-background.d.ts +4 -0
- package/dist/server/node_modules/ink/build/render-background.js +25 -0
- package/dist/server/node_modules/ink/build/render-background.js.map +1 -0
- package/dist/server/node_modules/ink/build/render-border.d.ts +4 -0
- package/dist/server/node_modules/ink/build/render-border.js +73 -0
- package/dist/server/node_modules/ink/build/render-border.js.map +1 -0
- package/dist/server/node_modules/ink/build/render-node-to-output.d.ts +14 -0
- package/dist/server/node_modules/ink/build/render-node-to-output.js +147 -0
- package/dist/server/node_modules/ink/build/render-node-to-output.js.map +1 -0
- package/dist/server/node_modules/ink/build/render-to-string.d.ts +38 -0
- package/dist/server/node_modules/ink/build/render-to-string.js +115 -0
- package/dist/server/node_modules/ink/build/render-to-string.js.map +1 -0
- package/dist/server/node_modules/ink/build/render.d.ts +121 -0
- package/dist/server/node_modules/ink/build/render.js +55 -0
- package/dist/server/node_modules/ink/build/render.js.map +1 -0
- package/dist/server/node_modules/ink/build/renderer.d.ts +8 -0
- package/dist/server/node_modules/ink/build/renderer.js +55 -0
- package/dist/server/node_modules/ink/build/renderer.js.map +1 -0
- package/dist/server/node_modules/ink/build/sanitize-ansi.d.ts +2 -0
- package/dist/server/node_modules/ink/build/sanitize-ansi.js +27 -0
- package/dist/server/node_modules/ink/build/sanitize-ansi.js.map +1 -0
- package/dist/server/node_modules/ink/build/screen-reader-update.d.ts +13 -0
- package/dist/server/node_modules/ink/build/screen-reader-update.js +38 -0
- package/dist/server/node_modules/ink/build/screen-reader-update.js.map +1 -0
- package/dist/server/node_modules/ink/build/squash-text-nodes.d.ts +3 -0
- package/dist/server/node_modules/ink/build/squash-text-nodes.js +36 -0
- package/dist/server/node_modules/ink/build/squash-text-nodes.js.map +1 -0
- package/dist/server/node_modules/ink/build/styles.d.ts +240 -0
- package/dist/server/node_modules/ink/build/styles.js +232 -0
- package/dist/server/node_modules/ink/build/styles.js.map +1 -0
- package/dist/server/node_modules/ink/build/utils.d.ts +2 -0
- package/dist/server/node_modules/ink/build/utils.js +4 -0
- package/dist/server/node_modules/ink/build/utils.js.map +1 -0
- package/dist/server/node_modules/ink/build/wrap-text.d.ts +3 -0
- package/dist/server/node_modules/ink/build/wrap-text.js +31 -0
- package/dist/server/node_modules/ink/build/wrap-text.js.map +1 -0
- package/dist/server/node_modules/ink/build/write-synchronized.d.ts +4 -0
- package/dist/server/node_modules/ink/build/write-synchronized.js +7 -0
- package/dist/server/node_modules/ink/build/write-synchronized.js.map +1 -0
- package/dist/server/node_modules/{figures → ink}/license +1 -0
- package/dist/server/node_modules/ink/package.json +201 -0
- package/dist/server/node_modules/ink/readme.md +2636 -0
- package/dist/server/node_modules/slice-ansi/index.d.ts +19 -0
- package/dist/server/node_modules/slice-ansi/index.js +260 -0
- package/dist/server/node_modules/{widest-line → slice-ansi}/license +1 -0
- package/dist/server/node_modules/slice-ansi/package.json +59 -0
- package/dist/server/node_modules/slice-ansi/readme.md +54 -0
- package/dist/server/node_modules/slice-ansi/tokenize-ansi.js +752 -0
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-C-HLT43p.js +0 -1
- package/dist/client/assets/index-BlefTMU9.js +0 -1
- package/dist/client/assets/registry-DSbGbl6G.js +0 -2
- package/dist/client/assets/store-registry-CHPlZpA7.js +0 -2
- package/dist/client/assets/useInfiniteQuery-B0aJ536b.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DMQVbZ7w.js +0 -1
- package/dist/client/assets/workflow-detail-cax1DGc8.js +0 -1
- package/dist/server/node_modules/cli-truncate/index.d.ts +0 -118
- package/dist/server/node_modules/cli-truncate/index.js +0 -168
- package/dist/server/node_modules/cli-truncate/package.json +0 -52
- package/dist/server/node_modules/cli-truncate/readme.md +0 -154
- package/dist/server/node_modules/deepmerge/.editorconfig +0 -7
- package/dist/server/node_modules/deepmerge/.eslintcache +0 -1
- package/dist/server/node_modules/deepmerge/changelog.md +0 -167
- package/dist/server/node_modules/deepmerge/dist/cjs.js +0 -133
- package/dist/server/node_modules/deepmerge/dist/umd.js +0 -139
- package/dist/server/node_modules/deepmerge/index.d.ts +0 -20
- package/dist/server/node_modules/deepmerge/index.js +0 -106
- package/dist/server/node_modules/deepmerge/license.txt +0 -21
- package/dist/server/node_modules/deepmerge/package.json +0 -42
- package/dist/server/node_modules/deepmerge/readme.md +0 -264
- package/dist/server/node_modules/deepmerge/rollup.config.js +0 -22
- package/dist/server/node_modules/figures/index.d.ts +0 -279
- package/dist/server/node_modules/figures/index.js +0 -292
- package/dist/server/node_modules/figures/package.json +0 -49
- package/dist/server/node_modules/figures/readme.md +0 -337
- package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
- package/dist/server/node_modules/mimic-fn/index.js +0 -13
- package/dist/server/node_modules/mimic-fn/license +0 -9
- package/dist/server/node_modules/mimic-fn/package.json +0 -42
- package/dist/server/node_modules/mimic-fn/readme.md +0 -69
- package/dist/server/node_modules/pg-int8/LICENSE +0 -13
- package/dist/server/node_modules/pg-int8/README.md +0 -16
- package/dist/server/node_modules/pg-int8/index.js +0 -100
- package/dist/server/node_modules/pg-int8/package.json +0 -24
- package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
- package/dist/server/node_modules/postgres-array/index.js +0 -97
- package/dist/server/node_modules/postgres-array/license +0 -21
- package/dist/server/node_modules/postgres-array/package.json +0 -35
- package/dist/server/node_modules/postgres-array/readme.md +0 -43
- package/dist/server/node_modules/postgres-bytea/index.js +0 -33
- package/dist/server/node_modules/postgres-bytea/license +0 -21
- package/dist/server/node_modules/postgres-bytea/package.json +0 -34
- package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
- package/dist/server/node_modules/postgres-date/index.js +0 -116
- package/dist/server/node_modules/postgres-date/license +0 -21
- package/dist/server/node_modules/postgres-date/package.json +0 -33
- package/dist/server/node_modules/postgres-date/readme.md +0 -49
- package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
- package/dist/server/node_modules/postgres-interval/index.js +0 -125
- package/dist/server/node_modules/postgres-interval/license +0 -21
- package/dist/server/node_modules/postgres-interval/package.json +0 -36
- package/dist/server/node_modules/postgres-interval/readme.md +0 -48
- package/dist/server/node_modules/split2/LICENSE +0 -13
- package/dist/server/node_modules/split2/README.md +0 -85
- package/dist/server/node_modules/split2/bench.js +0 -27
- package/dist/server/node_modules/split2/index.js +0 -141
- package/dist/server/node_modules/split2/package.json +0 -39
- package/dist/server/node_modules/split2/test.js +0 -409
- package/dist/server/node_modules/widest-line/index.d.ts +0 -12
- package/dist/server/node_modules/widest-line/index.js +0 -11
- package/dist/server/node_modules/widest-line/package.json +0 -60
- package/dist/server/node_modules/widest-line/readme.md +0 -26
- package/dist/server/node_modules/xtend/.jshintrc +0 -30
- package/dist/server/node_modules/xtend/LICENSE +0 -20
- package/dist/server/node_modules/xtend/README.md +0 -32
- package/dist/server/node_modules/xtend/immutable.js +0 -19
- package/dist/server/node_modules/xtend/mutable.js +0 -17
- package/dist/server/node_modules/xtend/package.json +0 -55
- package/dist/server/node_modules/xtend/test.js +0 -103
- /package/dist/server/node_modules/{cli-truncate → get-east-asian-width}/license +0 -0
|
@@ -0,0 +1,752 @@
|
|
|
1
|
+
import ansiStyles from 'ansi-styles';
|
|
2
|
+
import isFullwidthCodePoint from 'is-fullwidth-code-point';
|
|
3
|
+
|
|
4
|
+
const ESCAPE_CODE_POINT = 27;
|
|
5
|
+
const C1_DCS_CODE_POINT = 144;
|
|
6
|
+
const C1_SOS_CODE_POINT = 152;
|
|
7
|
+
const C1_CSI_CODE_POINT = 155;
|
|
8
|
+
const C1_ST_CODE_POINT = 156;
|
|
9
|
+
const C1_OSC_CODE_POINT = 157;
|
|
10
|
+
const C1_PM_CODE_POINT = 158;
|
|
11
|
+
const C1_APC_CODE_POINT = 159;
|
|
12
|
+
const ESCAPES = new Set([
|
|
13
|
+
ESCAPE_CODE_POINT,
|
|
14
|
+
C1_DCS_CODE_POINT,
|
|
15
|
+
C1_SOS_CODE_POINT,
|
|
16
|
+
C1_CSI_CODE_POINT,
|
|
17
|
+
C1_ST_CODE_POINT,
|
|
18
|
+
C1_OSC_CODE_POINT,
|
|
19
|
+
C1_PM_CODE_POINT,
|
|
20
|
+
C1_APC_CODE_POINT,
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
const ESCAPE = '\u001B';
|
|
24
|
+
const ANSI_BELL = '\u0007';
|
|
25
|
+
const ANSI_CSI = '[';
|
|
26
|
+
const ANSI_OSC = ']';
|
|
27
|
+
const ANSI_DCS = 'P';
|
|
28
|
+
const ANSI_SOS = 'X';
|
|
29
|
+
const ANSI_PM = '^';
|
|
30
|
+
const ANSI_APC = '_';
|
|
31
|
+
const ANSI_SGR_TERMINATOR = 'm';
|
|
32
|
+
const ANSI_OSC_TERMINATOR = '\\';
|
|
33
|
+
const ANSI_STRING_TERMINATOR = `${ESCAPE}${ANSI_OSC_TERMINATOR}`;
|
|
34
|
+
const C1_OSC = '\u009D';
|
|
35
|
+
const C1_STRING_TERMINATOR = '\u009C';
|
|
36
|
+
const ANSI_HYPERLINK_ESC_PREFIX = `${ESCAPE}${ANSI_OSC}8;`;
|
|
37
|
+
const ANSI_HYPERLINK_C1_PREFIX = `${C1_OSC}8;`;
|
|
38
|
+
const ANSI_HYPERLINK_ESC_CLOSE = `${ANSI_HYPERLINK_ESC_PREFIX};`;
|
|
39
|
+
const ANSI_HYPERLINK_C1_CLOSE = `${ANSI_HYPERLINK_C1_PREFIX};`;
|
|
40
|
+
|
|
41
|
+
const CODE_POINT_0 = '0'.codePointAt(0);
|
|
42
|
+
const CODE_POINT_9 = '9'.codePointAt(0);
|
|
43
|
+
const CODE_POINT_SEMICOLON = ';'.codePointAt(0);
|
|
44
|
+
const CODE_POINT_COLON = ':'.codePointAt(0);
|
|
45
|
+
// ECMA-48 CSI format: parameter bytes 0x30-0x3F, intermediates 0x20-0x2F, final 0x40-0x7E.
|
|
46
|
+
const CODE_POINT_CSI_PARAMETER_START = '0'.codePointAt(0);
|
|
47
|
+
const CODE_POINT_CSI_PARAMETER_END = '?'.codePointAt(0);
|
|
48
|
+
const CODE_POINT_CSI_INTERMEDIATE_START = ' '.codePointAt(0);
|
|
49
|
+
const CODE_POINT_CSI_INTERMEDIATE_END = '/'.codePointAt(0);
|
|
50
|
+
const CODE_POINT_CSI_FINAL_START = '@'.codePointAt(0);
|
|
51
|
+
const CODE_POINT_CSI_FINAL_END = '~'.codePointAt(0);
|
|
52
|
+
const REGIONAL_INDICATOR_SYMBOL_LETTER_A = 127_462;
|
|
53
|
+
const REGIONAL_INDICATOR_SYMBOL_LETTER_Z = 127_487;
|
|
54
|
+
const SGR_RESET_CODE = 0;
|
|
55
|
+
const SGR_EXTENDED_FOREGROUND_CODE = 38;
|
|
56
|
+
const SGR_DEFAULT_FOREGROUND_CODE = 39;
|
|
57
|
+
const SGR_EXTENDED_BACKGROUND_CODE = 48;
|
|
58
|
+
const SGR_DEFAULT_BACKGROUND_CODE = 49;
|
|
59
|
+
const SGR_COLOR_TYPE_ANSI_256 = 5;
|
|
60
|
+
const SGR_COLOR_TYPE_TRUECOLOR = 2;
|
|
61
|
+
const SGR_ANSI_256_FRAGMENT_LENGTH = 3;
|
|
62
|
+
const SGR_TRUECOLOR_FRAGMENT_LENGTH = 5;
|
|
63
|
+
const SGR_ANSI_256_LAST_PARAMETER_OFFSET = 2;
|
|
64
|
+
const SGR_TRUECOLOR_LAST_PARAMETER_OFFSET = 4;
|
|
65
|
+
const VARIATION_SELECTOR_16_CODE_POINT = 65_039;
|
|
66
|
+
const COMBINING_ENCLOSING_KEYCAP_CODE_POINT = 8419;
|
|
67
|
+
const EMOJI_PRESENTATION_GRAPHEME_REGEX = /\p{Emoji_Presentation}/u;
|
|
68
|
+
const GRAPHEME_SEGMENTER = new Intl.Segmenter(undefined, {granularity: 'grapheme'});
|
|
69
|
+
|
|
70
|
+
const endCodeNumbers = new Set();
|
|
71
|
+
for (const [, end] of ansiStyles.codes) {
|
|
72
|
+
endCodeNumbers.add(end);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function isSgrParameterCharacter(codePoint) {
|
|
76
|
+
return (
|
|
77
|
+
(codePoint >= CODE_POINT_0 && codePoint <= CODE_POINT_9)
|
|
78
|
+
|| codePoint === CODE_POINT_SEMICOLON
|
|
79
|
+
|| codePoint === CODE_POINT_COLON
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function isCsiParameterCharacter(codePoint) {
|
|
84
|
+
return codePoint >= CODE_POINT_CSI_PARAMETER_START && codePoint <= CODE_POINT_CSI_PARAMETER_END;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function isCsiIntermediateCharacter(codePoint) {
|
|
88
|
+
return codePoint >= CODE_POINT_CSI_INTERMEDIATE_START && codePoint <= CODE_POINT_CSI_INTERMEDIATE_END;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function isCsiFinalCharacter(codePoint) {
|
|
92
|
+
return codePoint >= CODE_POINT_CSI_FINAL_START && codePoint <= CODE_POINT_CSI_FINAL_END;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function isRegionalIndicatorCodePoint(codePoint) {
|
|
96
|
+
return codePoint >= REGIONAL_INDICATOR_SYMBOL_LETTER_A && codePoint <= REGIONAL_INDICATOR_SYMBOL_LETTER_Z;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function createControlParseResult(code, endIndex) {
|
|
100
|
+
return {
|
|
101
|
+
token: {
|
|
102
|
+
type: 'control',
|
|
103
|
+
code,
|
|
104
|
+
},
|
|
105
|
+
endIndex,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function isEmojiStyleGrapheme(grapheme) {
|
|
110
|
+
if (EMOJI_PRESENTATION_GRAPHEME_REGEX.test(grapheme)) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
for (const character of grapheme) {
|
|
115
|
+
const codePoint = character.codePointAt(0);
|
|
116
|
+
if (
|
|
117
|
+
codePoint === VARIATION_SELECTOR_16_CODE_POINT
|
|
118
|
+
|| codePoint === COMBINING_ENCLOSING_KEYCAP_CODE_POINT
|
|
119
|
+
) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function getGraphemeWidth(grapheme) {
|
|
128
|
+
let regionalIndicatorCount = 0;
|
|
129
|
+
for (const character of grapheme) {
|
|
130
|
+
const codePoint = character.codePointAt(0);
|
|
131
|
+
if (isFullwidthCodePoint(codePoint)) {
|
|
132
|
+
return 2;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (isRegionalIndicatorCodePoint(codePoint)) {
|
|
136
|
+
regionalIndicatorCount++;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (regionalIndicatorCount >= 1) {
|
|
141
|
+
return 2;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (isEmojiStyleGrapheme(grapheme)) {
|
|
145
|
+
return 2;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return 1;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function getSgrPrefix(code) {
|
|
152
|
+
if (code.startsWith('\u009B')) {
|
|
153
|
+
return '\u009B';
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return `${ESCAPE}${ANSI_CSI}`;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function createSgrCode(prefix, values) {
|
|
160
|
+
return `${prefix}${values.join(';')}${ANSI_SGR_TERMINATOR}`;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function getSgrFragments(code) {
|
|
164
|
+
const fragments = [];
|
|
165
|
+
const sgrPrefix = getSgrPrefix(code);
|
|
166
|
+
let parameterString;
|
|
167
|
+
|
|
168
|
+
if (code.startsWith(`${ESCAPE}${ANSI_CSI}`)) {
|
|
169
|
+
parameterString = code.slice(2, -1);
|
|
170
|
+
} else if (code.startsWith('\u009B')) {
|
|
171
|
+
parameterString = code.slice(1, -1);
|
|
172
|
+
} else {
|
|
173
|
+
return fragments;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const rawCodes = parameterString.length === 0 ? [String(SGR_RESET_CODE)] : parameterString.split(';');
|
|
177
|
+
let index = 0;
|
|
178
|
+
while (index < rawCodes.length) {
|
|
179
|
+
const codeNumber = Number.parseInt(rawCodes[index], 10);
|
|
180
|
+
if (Number.isNaN(codeNumber)) {
|
|
181
|
+
index++;
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (codeNumber === SGR_RESET_CODE) {
|
|
186
|
+
fragments.push({type: 'reset'});
|
|
187
|
+
index++;
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (codeNumber === SGR_EXTENDED_FOREGROUND_CODE || codeNumber === SGR_EXTENDED_BACKGROUND_CODE) {
|
|
192
|
+
const colorType = Number.parseInt(rawCodes[index + 1], 10);
|
|
193
|
+
if (colorType === SGR_COLOR_TYPE_ANSI_256 && index + SGR_ANSI_256_LAST_PARAMETER_OFFSET < rawCodes.length) {
|
|
194
|
+
const openCode = createSgrCode(sgrPrefix, rawCodes.slice(index, index + SGR_ANSI_256_FRAGMENT_LENGTH));
|
|
195
|
+
fragments.push({
|
|
196
|
+
type: 'start',
|
|
197
|
+
code: openCode,
|
|
198
|
+
endCode: ansiStyles.color.ansi(codeNumber === SGR_EXTENDED_FOREGROUND_CODE ? SGR_DEFAULT_FOREGROUND_CODE : SGR_DEFAULT_BACKGROUND_CODE),
|
|
199
|
+
});
|
|
200
|
+
index += SGR_ANSI_256_FRAGMENT_LENGTH;
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (colorType === SGR_COLOR_TYPE_TRUECOLOR && index + SGR_TRUECOLOR_LAST_PARAMETER_OFFSET < rawCodes.length) {
|
|
205
|
+
const openCode = createSgrCode(sgrPrefix, rawCodes.slice(index, index + SGR_TRUECOLOR_FRAGMENT_LENGTH));
|
|
206
|
+
fragments.push({
|
|
207
|
+
type: 'start',
|
|
208
|
+
code: openCode,
|
|
209
|
+
endCode: ansiStyles.color.ansi(codeNumber === SGR_EXTENDED_FOREGROUND_CODE ? SGR_DEFAULT_FOREGROUND_CODE : SGR_DEFAULT_BACKGROUND_CODE),
|
|
210
|
+
});
|
|
211
|
+
index += SGR_TRUECOLOR_FRAGMENT_LENGTH;
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const openCode = createSgrCode(sgrPrefix, [rawCodes[index]]);
|
|
216
|
+
fragments.push({
|
|
217
|
+
type: 'start',
|
|
218
|
+
code: openCode,
|
|
219
|
+
endCode: ansiStyles.color.ansi(codeNumber === SGR_EXTENDED_FOREGROUND_CODE ? SGR_DEFAULT_FOREGROUND_CODE : SGR_DEFAULT_BACKGROUND_CODE),
|
|
220
|
+
});
|
|
221
|
+
index++;
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (endCodeNumbers.has(codeNumber)) {
|
|
226
|
+
fragments.push({
|
|
227
|
+
type: 'end',
|
|
228
|
+
endCode: ansiStyles.color.ansi(codeNumber),
|
|
229
|
+
});
|
|
230
|
+
index++;
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const mappedEndCode = ansiStyles.codes.get(codeNumber);
|
|
235
|
+
if (mappedEndCode !== undefined) {
|
|
236
|
+
const openCode = createSgrCode(sgrPrefix, [rawCodes[index]]);
|
|
237
|
+
fragments.push({
|
|
238
|
+
type: 'start',
|
|
239
|
+
code: openCode,
|
|
240
|
+
endCode: ansiStyles.color.ansi(mappedEndCode),
|
|
241
|
+
});
|
|
242
|
+
index++;
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const openCode = createSgrCode(sgrPrefix, [rawCodes[index]]);
|
|
247
|
+
fragments.push({
|
|
248
|
+
type: 'start',
|
|
249
|
+
code: openCode,
|
|
250
|
+
endCode: ansiStyles.reset.open,
|
|
251
|
+
});
|
|
252
|
+
index++;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (fragments.length === 0) {
|
|
256
|
+
fragments.push({type: 'reset'});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return fragments;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function parseCsiCode(string, index) {
|
|
263
|
+
const escapeCodePoint = string.codePointAt(index);
|
|
264
|
+
let sequenceStartIndex;
|
|
265
|
+
|
|
266
|
+
if (escapeCodePoint === ESCAPE_CODE_POINT) {
|
|
267
|
+
if (string[index + 1] !== ANSI_CSI) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
sequenceStartIndex = index + 2;
|
|
272
|
+
} else if (escapeCodePoint === C1_CSI_CODE_POINT) {
|
|
273
|
+
sequenceStartIndex = index + 1;
|
|
274
|
+
} else {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
let hasCanonicalSgrParameters = true;
|
|
279
|
+
for (let sequenceIndex = sequenceStartIndex; sequenceIndex < string.length; sequenceIndex++) {
|
|
280
|
+
const codePoint = string.codePointAt(sequenceIndex);
|
|
281
|
+
|
|
282
|
+
if (isCsiFinalCharacter(codePoint)) {
|
|
283
|
+
const code = string.slice(index, sequenceIndex + 1);
|
|
284
|
+
if (string[sequenceIndex] !== ANSI_SGR_TERMINATOR || !hasCanonicalSgrParameters) {
|
|
285
|
+
return createControlParseResult(code, sequenceIndex + 1);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return {
|
|
289
|
+
token: {
|
|
290
|
+
type: 'sgr',
|
|
291
|
+
code,
|
|
292
|
+
fragments: getSgrFragments(code),
|
|
293
|
+
},
|
|
294
|
+
endIndex: sequenceIndex + 1,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
if (isCsiParameterCharacter(codePoint)) {
|
|
299
|
+
if (!isSgrParameterCharacter(codePoint)) {
|
|
300
|
+
hasCanonicalSgrParameters = false;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (isCsiIntermediateCharacter(codePoint)) {
|
|
307
|
+
hasCanonicalSgrParameters = false;
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
const endIndex = sequenceIndex;
|
|
312
|
+
return createControlParseResult(string.slice(index, endIndex), endIndex);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
return createControlParseResult(string.slice(index), string.length);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function parseHyperlinkCode(string, index) {
|
|
319
|
+
let hyperlinkPrefix;
|
|
320
|
+
let hyperlinkClose;
|
|
321
|
+
const codePoint = string.codePointAt(index);
|
|
322
|
+
|
|
323
|
+
if (
|
|
324
|
+
codePoint === ESCAPE_CODE_POINT
|
|
325
|
+
&& string.startsWith(ANSI_HYPERLINK_ESC_PREFIX, index)
|
|
326
|
+
) {
|
|
327
|
+
hyperlinkPrefix = ANSI_HYPERLINK_ESC_PREFIX;
|
|
328
|
+
hyperlinkClose = ANSI_HYPERLINK_ESC_CLOSE;
|
|
329
|
+
} else if (
|
|
330
|
+
codePoint === C1_OSC_CODE_POINT
|
|
331
|
+
&& string.startsWith(ANSI_HYPERLINK_C1_PREFIX, index)
|
|
332
|
+
) {
|
|
333
|
+
hyperlinkPrefix = ANSI_HYPERLINK_C1_PREFIX;
|
|
334
|
+
hyperlinkClose = ANSI_HYPERLINK_C1_CLOSE;
|
|
335
|
+
} else {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
const uriStart = string.indexOf(';', index + hyperlinkPrefix.length);
|
|
340
|
+
if (uriStart === -1) {
|
|
341
|
+
return createControlParseResult(string.slice(index), string.length);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
for (let sequenceIndex = uriStart + 1; sequenceIndex < string.length; sequenceIndex++) {
|
|
345
|
+
const character = string[sequenceIndex];
|
|
346
|
+
|
|
347
|
+
if (character === ANSI_BELL) {
|
|
348
|
+
const code = string.slice(index, sequenceIndex + 1);
|
|
349
|
+
const action = sequenceIndex === uriStart + 1 ? 'close' : 'open';
|
|
350
|
+
return {
|
|
351
|
+
token: {
|
|
352
|
+
type: 'hyperlink',
|
|
353
|
+
code,
|
|
354
|
+
action,
|
|
355
|
+
closePrefix: hyperlinkClose,
|
|
356
|
+
terminator: ANSI_BELL,
|
|
357
|
+
},
|
|
358
|
+
endIndex: sequenceIndex + 1,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
if (
|
|
363
|
+
character === ESCAPE
|
|
364
|
+
&& string[sequenceIndex + 1] === ANSI_OSC_TERMINATOR
|
|
365
|
+
) {
|
|
366
|
+
const code = string.slice(index, sequenceIndex + 2);
|
|
367
|
+
const action = sequenceIndex === uriStart + 1 ? 'close' : 'open';
|
|
368
|
+
return {
|
|
369
|
+
token: {
|
|
370
|
+
type: 'hyperlink',
|
|
371
|
+
code,
|
|
372
|
+
action,
|
|
373
|
+
closePrefix: hyperlinkClose,
|
|
374
|
+
terminator: ANSI_STRING_TERMINATOR,
|
|
375
|
+
},
|
|
376
|
+
endIndex: sequenceIndex + 2,
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
if (character === C1_STRING_TERMINATOR) {
|
|
381
|
+
const code = string.slice(index, sequenceIndex + 1);
|
|
382
|
+
const action = sequenceIndex === uriStart + 1 ? 'close' : 'open';
|
|
383
|
+
return {
|
|
384
|
+
token: {
|
|
385
|
+
type: 'hyperlink',
|
|
386
|
+
code,
|
|
387
|
+
action,
|
|
388
|
+
closePrefix: hyperlinkClose,
|
|
389
|
+
terminator: C1_STRING_TERMINATOR,
|
|
390
|
+
},
|
|
391
|
+
endIndex: sequenceIndex + 1,
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
return createControlParseResult(string.slice(index), string.length);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
function parseControlStringCode(string, index) {
|
|
400
|
+
const codePoint = string.codePointAt(index);
|
|
401
|
+
let sequenceStartIndex;
|
|
402
|
+
let supportsBellTerminator = false;
|
|
403
|
+
|
|
404
|
+
switch (codePoint) {
|
|
405
|
+
case ESCAPE_CODE_POINT: {
|
|
406
|
+
const command = string[index + 1];
|
|
407
|
+
switch (command) {
|
|
408
|
+
case ANSI_OSC: {
|
|
409
|
+
// OSC accepts ST (ECMA-48) and BEL (xterm compatibility extension).
|
|
410
|
+
sequenceStartIndex = index + 2;
|
|
411
|
+
supportsBellTerminator = true;
|
|
412
|
+
break;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
case ANSI_DCS:
|
|
416
|
+
case ANSI_SOS:
|
|
417
|
+
case ANSI_PM:
|
|
418
|
+
case ANSI_APC: {
|
|
419
|
+
sequenceStartIndex = index + 2;
|
|
420
|
+
break;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
case ANSI_OSC_TERMINATOR: {
|
|
424
|
+
return createControlParseResult(ANSI_STRING_TERMINATOR, index + 2);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
default: {
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
case C1_OSC_CODE_POINT: {
|
|
436
|
+
sequenceStartIndex = index + 1;
|
|
437
|
+
supportsBellTerminator = true;
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
case C1_DCS_CODE_POINT:
|
|
442
|
+
case C1_SOS_CODE_POINT:
|
|
443
|
+
case C1_PM_CODE_POINT:
|
|
444
|
+
case C1_APC_CODE_POINT: {
|
|
445
|
+
sequenceStartIndex = index + 1;
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
case C1_ST_CODE_POINT: {
|
|
450
|
+
return createControlParseResult(C1_STRING_TERMINATOR, index + 1);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
default: {
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
for (let sequenceIndex = sequenceStartIndex; sequenceIndex < string.length; sequenceIndex++) {
|
|
459
|
+
if (supportsBellTerminator && string[sequenceIndex] === ANSI_BELL) {
|
|
460
|
+
return createControlParseResult(string.slice(index, sequenceIndex + 1), sequenceIndex + 1);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
if (
|
|
464
|
+
string[sequenceIndex] === ESCAPE
|
|
465
|
+
&& string[sequenceIndex + 1] === ANSI_OSC_TERMINATOR
|
|
466
|
+
) {
|
|
467
|
+
return createControlParseResult(string.slice(index, sequenceIndex + 2), sequenceIndex + 2);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if (string[sequenceIndex] === C1_STRING_TERMINATOR) {
|
|
471
|
+
return createControlParseResult(string.slice(index, sequenceIndex + 1), sequenceIndex + 1);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
return createControlParseResult(string.slice(index), string.length);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
function parseAnsiCode(string, index) {
|
|
479
|
+
const codePoint = string.codePointAt(index);
|
|
480
|
+
if (codePoint === ESCAPE_CODE_POINT || codePoint === C1_OSC_CODE_POINT) {
|
|
481
|
+
const hyperlinkCode = parseHyperlinkCode(string, index);
|
|
482
|
+
if (hyperlinkCode) {
|
|
483
|
+
return hyperlinkCode;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
const controlStringCode = parseControlStringCode(string, index);
|
|
488
|
+
if (controlStringCode) {
|
|
489
|
+
return controlStringCode;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
return parseCsiCode(string, index);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
function appendTrailingAnsiTokens(string, index, tokens) {
|
|
496
|
+
while (index < string.length) {
|
|
497
|
+
const nextCodePoint = string.codePointAt(index);
|
|
498
|
+
if (!ESCAPES.has(nextCodePoint)) {
|
|
499
|
+
break;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
const escapeCode = parseAnsiCode(string, index);
|
|
503
|
+
if (!escapeCode) {
|
|
504
|
+
break;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
tokens.push(escapeCode.token);
|
|
508
|
+
index = escapeCode.endIndex;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
return index;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
function parseCharacterTokenWithRawSegmentation(string, index, graphemeSegments) {
|
|
515
|
+
const segment = graphemeSegments.containing(index);
|
|
516
|
+
if (!segment || segment.index !== index) {
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
return {
|
|
521
|
+
token: {
|
|
522
|
+
type: 'character',
|
|
523
|
+
// Intentionally preserve UAX29 behavior (GB3): CRLF is one grapheme cluster.
|
|
524
|
+
value: segment.segment,
|
|
525
|
+
visibleWidth: getGraphemeWidth(segment.segment),
|
|
526
|
+
isGraphemeContinuation: false,
|
|
527
|
+
},
|
|
528
|
+
endIndex: index + segment.segment.length,
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
function collectVisibleCharacters(string) {
|
|
533
|
+
const visibleCharacters = [];
|
|
534
|
+
let index = 0;
|
|
535
|
+
|
|
536
|
+
while (index < string.length) {
|
|
537
|
+
const codePoint = string.codePointAt(index);
|
|
538
|
+
if (ESCAPES.has(codePoint)) {
|
|
539
|
+
const code = parseAnsiCode(string, index);
|
|
540
|
+
if (code) {
|
|
541
|
+
index = code.endIndex;
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
const value = String.fromCodePoint(codePoint);
|
|
547
|
+
visibleCharacters.push({
|
|
548
|
+
value,
|
|
549
|
+
visibleWidth: 1,
|
|
550
|
+
isGraphemeContinuation: false,
|
|
551
|
+
});
|
|
552
|
+
index += value.length;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
return visibleCharacters;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
function applyGraphemeMetadata(visibleCharacters) {
|
|
559
|
+
if (visibleCharacters.length === 0) {
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
const visibleString = visibleCharacters.map(({value}) => value).join('');
|
|
564
|
+
const scalarOffsets = [];
|
|
565
|
+
let scalarOffset = 0;
|
|
566
|
+
|
|
567
|
+
for (const visibleCharacter of visibleCharacters) {
|
|
568
|
+
scalarOffsets.push(scalarOffset);
|
|
569
|
+
scalarOffset += visibleCharacter.value.length;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
let scalarIndex = 0;
|
|
573
|
+
for (const segment of GRAPHEME_SEGMENTER.segment(visibleString)) {
|
|
574
|
+
while (
|
|
575
|
+
scalarIndex < visibleCharacters.length
|
|
576
|
+
&& scalarOffsets[scalarIndex] < segment.index
|
|
577
|
+
) {
|
|
578
|
+
scalarIndex++;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
let graphemeIndex = scalarIndex;
|
|
582
|
+
let isFirstInGrapheme = true;
|
|
583
|
+
while (
|
|
584
|
+
graphemeIndex < visibleCharacters.length
|
|
585
|
+
&& scalarOffsets[graphemeIndex] < segment.index + segment.segment.length
|
|
586
|
+
) {
|
|
587
|
+
visibleCharacters[graphemeIndex].visibleWidth = isFirstInGrapheme ? getGraphemeWidth(segment.segment) : 0;
|
|
588
|
+
visibleCharacters[graphemeIndex].isGraphemeContinuation = !isFirstInGrapheme;
|
|
589
|
+
isFirstInGrapheme = false;
|
|
590
|
+
graphemeIndex++;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
scalarIndex = graphemeIndex;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
function tokenizeAnsiWithVisibleSegmentation(string, {endCharacter = Number.POSITIVE_INFINITY} = {}) {
|
|
598
|
+
const tokens = [];
|
|
599
|
+
const visibleCharacters = collectVisibleCharacters(string);
|
|
600
|
+
applyGraphemeMetadata(visibleCharacters);
|
|
601
|
+
|
|
602
|
+
let index = 0;
|
|
603
|
+
let visibleCharacterIndex = 0;
|
|
604
|
+
let visibleCount = 0;
|
|
605
|
+
while (index < string.length) {
|
|
606
|
+
const codePoint = string.codePointAt(index);
|
|
607
|
+
|
|
608
|
+
if (ESCAPES.has(codePoint)) {
|
|
609
|
+
const code = parseAnsiCode(string, index);
|
|
610
|
+
if (code) {
|
|
611
|
+
tokens.push(code.token);
|
|
612
|
+
index = code.endIndex;
|
|
613
|
+
continue;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
const value = String.fromCodePoint(codePoint);
|
|
618
|
+
const visibleCharacter = visibleCharacters[visibleCharacterIndex];
|
|
619
|
+
let visibleWidth = isFullwidthCodePoint(codePoint) ? 2 : value.length;
|
|
620
|
+
if (visibleCharacter) {
|
|
621
|
+
visibleWidth = visibleCharacter.visibleWidth;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
const token = {
|
|
625
|
+
type: 'character',
|
|
626
|
+
value,
|
|
627
|
+
visibleWidth,
|
|
628
|
+
isGraphemeContinuation: visibleCharacter ? visibleCharacter.isGraphemeContinuation : false,
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
tokens.push(token);
|
|
632
|
+
index += value.length;
|
|
633
|
+
visibleCharacterIndex++;
|
|
634
|
+
visibleCount += token.visibleWidth;
|
|
635
|
+
|
|
636
|
+
if (visibleCount >= endCharacter) {
|
|
637
|
+
const nextVisibleCharacter = visibleCharacters[visibleCharacterIndex];
|
|
638
|
+
if (
|
|
639
|
+
!nextVisibleCharacter
|
|
640
|
+
|| !nextVisibleCharacter.isGraphemeContinuation
|
|
641
|
+
) {
|
|
642
|
+
index = appendTrailingAnsiTokens(string, index, tokens);
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
return tokens;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
function areValuesInSameGrapheme(leftValue, rightValue) {
|
|
652
|
+
const pair = `${leftValue}${rightValue}`;
|
|
653
|
+
const splitIndex = leftValue.length;
|
|
654
|
+
|
|
655
|
+
for (const segment of GRAPHEME_SEGMENTER.segment(pair)) {
|
|
656
|
+
if (segment.index === splitIndex) {
|
|
657
|
+
return false;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
if (segment.index > splitIndex) {
|
|
661
|
+
return true;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
return true;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
function hasAnsiSplitContinuationAhead(string, startIndex, previousVisibleValue, graphemeSegments) {
|
|
669
|
+
if (!previousVisibleValue) {
|
|
670
|
+
return false;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
let index = startIndex;
|
|
674
|
+
let hasAnsiCode = false;
|
|
675
|
+
while (index < string.length) {
|
|
676
|
+
const codePoint = string.codePointAt(index);
|
|
677
|
+
if (ESCAPES.has(codePoint)) {
|
|
678
|
+
const code = parseAnsiCode(string, index);
|
|
679
|
+
if (code) {
|
|
680
|
+
hasAnsiCode = true;
|
|
681
|
+
index = code.endIndex;
|
|
682
|
+
continue;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
if (!hasAnsiCode) {
|
|
687
|
+
return false;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
const characterToken = parseCharacterTokenWithRawSegmentation(string, index, graphemeSegments);
|
|
691
|
+
if (!characterToken) {
|
|
692
|
+
return true;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
return areValuesInSameGrapheme(previousVisibleValue, characterToken.token.value);
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
return false;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
export default function tokenizeAnsi(string, {endCharacter = Number.POSITIVE_INFINITY} = {}) {
|
|
702
|
+
const tokens = [];
|
|
703
|
+
const graphemeSegments = GRAPHEME_SEGMENTER.segment(string);
|
|
704
|
+
|
|
705
|
+
let index = 0;
|
|
706
|
+
let visibleCount = 0;
|
|
707
|
+
let previousVisibleValue;
|
|
708
|
+
let hasAnsiSinceLastVisible = false;
|
|
709
|
+
while (index < string.length) {
|
|
710
|
+
const codePoint = string.codePointAt(index);
|
|
711
|
+
|
|
712
|
+
if (ESCAPES.has(codePoint)) {
|
|
713
|
+
const code = parseAnsiCode(string, index);
|
|
714
|
+
if (code) {
|
|
715
|
+
tokens.push(code.token);
|
|
716
|
+
index = code.endIndex;
|
|
717
|
+
hasAnsiSinceLastVisible = true;
|
|
718
|
+
continue;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
const characterToken = parseCharacterTokenWithRawSegmentation(string, index, graphemeSegments);
|
|
723
|
+
if (!characterToken) {
|
|
724
|
+
return tokenizeAnsiWithVisibleSegmentation(string, {endCharacter});
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
if (
|
|
728
|
+
hasAnsiSinceLastVisible
|
|
729
|
+
&& previousVisibleValue
|
|
730
|
+
&& areValuesInSameGrapheme(previousVisibleValue, characterToken.token.value)
|
|
731
|
+
) {
|
|
732
|
+
return tokenizeAnsiWithVisibleSegmentation(string, {endCharacter});
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
tokens.push(characterToken.token);
|
|
736
|
+
index = characterToken.endIndex;
|
|
737
|
+
visibleCount += characterToken.token.visibleWidth;
|
|
738
|
+
hasAnsiSinceLastVisible = false;
|
|
739
|
+
previousVisibleValue = characterToken.token.value;
|
|
740
|
+
|
|
741
|
+
if (visibleCount >= endCharacter) {
|
|
742
|
+
if (hasAnsiSplitContinuationAhead(string, index, previousVisibleValue, graphemeSegments)) {
|
|
743
|
+
return tokenizeAnsiWithVisibleSegmentation(string, {endCharacter});
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
index = appendTrailingAnsiTokens(string, index, tokens);
|
|
747
|
+
break;
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
return tokens;
|
|
752
|
+
}
|