termcast 1.3.9
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/action-utils.d.ts +25 -0
- package/dist/action-utils.d.ts.map +1 -0
- package/dist/action-utils.js +209 -0
- package/dist/action-utils.js.map +1 -0
- package/dist/ai.d.ts +104 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +135 -0
- package/dist/ai.js.map +1 -0
- package/dist/apis/ai.d.ts +104 -0
- package/dist/apis/ai.d.ts.map +1 -0
- package/dist/apis/ai.js +135 -0
- package/dist/apis/ai.js.map +1 -0
- package/dist/apis/cache.d.ts +84 -0
- package/dist/apis/cache.d.ts.map +1 -0
- package/dist/apis/cache.js +307 -0
- package/dist/apis/cache.js.map +1 -0
- package/dist/apis/cache.test.d.ts +2 -0
- package/dist/apis/cache.test.d.ts.map +1 -0
- package/dist/apis/cache.test.js +246 -0
- package/dist/apis/cache.test.js.map +1 -0
- package/dist/apis/clipboard.d.ts +36 -0
- package/dist/apis/clipboard.d.ts.map +1 -0
- package/dist/apis/clipboard.js +154 -0
- package/dist/apis/clipboard.js.map +1 -0
- package/dist/apis/environment.d.ts +63 -0
- package/dist/apis/environment.d.ts.map +1 -0
- package/dist/apis/environment.js +189 -0
- package/dist/apis/environment.js.map +1 -0
- package/dist/apis/hud.d.ts +7 -0
- package/dist/apis/hud.d.ts.map +1 -0
- package/dist/apis/hud.js +45 -0
- package/dist/apis/hud.js.map +1 -0
- package/dist/apis/localstorage.d.ts +13 -0
- package/dist/apis/localstorage.d.ts.map +1 -0
- package/dist/apis/localstorage.js +190 -0
- package/dist/apis/localstorage.js.map +1 -0
- package/dist/apis/localstorage.test.d.ts +2 -0
- package/dist/apis/localstorage.test.d.ts.map +1 -0
- package/dist/apis/localstorage.test.js +131 -0
- package/dist/apis/localstorage.test.js.map +1 -0
- package/dist/apis/oauth.d.ts +142 -0
- package/dist/apis/oauth.d.ts.map +1 -0
- package/dist/apis/oauth.js +551 -0
- package/dist/apis/oauth.js.map +1 -0
- package/dist/apis/preferences.d.ts +23 -0
- package/dist/apis/preferences.d.ts.map +1 -0
- package/dist/apis/preferences.js +105 -0
- package/dist/apis/preferences.js.map +1 -0
- package/dist/apis/toast.d.ts +81 -0
- package/dist/apis/toast.d.ts.map +1 -0
- package/dist/apis/toast.js +275 -0
- package/dist/apis/toast.js.map +1 -0
- package/dist/apis/toast.test.d.ts +2 -0
- package/dist/apis/toast.test.d.ts.map +1 -0
- package/dist/apis/toast.test.js +67 -0
- package/dist/apis/toast.test.js.map +1 -0
- package/dist/apis/window.d.ts +12 -0
- package/dist/apis/window.d.ts.map +1 -0
- package/dist/apis/window.js +47 -0
- package/dist/apis/window.js.map +1 -0
- package/dist/build.d.ts +15 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +213 -0
- package/dist/build.js.map +1 -0
- package/dist/build.test.d.ts +2 -0
- package/dist/build.test.d.ts.map +1 -0
- package/dist/build.test.js +73 -0
- package/dist/build.test.js.map +1 -0
- package/dist/cache.d.ts +32 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +205 -0
- package/dist/cache.js.map +1 -0
- package/dist/cache.test.d.ts +2 -0
- package/dist/cache.test.d.ts.map +1 -0
- package/dist/cache.test.js +246 -0
- package/dist/cache.test.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +278 -0
- package/dist/cli.js.map +1 -0
- package/dist/clipboard.d.ts +36 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +154 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/colors.d.ts +15 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +13 -0
- package/dist/colors.js.map +1 -0
- package/dist/components/actions.d.ts +120 -0
- package/dist/components/actions.d.ts.map +1 -0
- package/dist/components/actions.js +371 -0
- package/dist/components/actions.js.map +1 -0
- package/dist/components/alert.d.ts +25 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +99 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/detail.d.ts +65 -0
- package/dist/components/detail.d.ts.map +1 -0
- package/dist/components/detail.js +147 -0
- package/dist/components/detail.js.map +1 -0
- package/dist/components/dropdown.d.ts +40 -0
- package/dist/components/dropdown.d.ts.map +1 -0
- package/dist/components/dropdown.js +202 -0
- package/dist/components/dropdown.js.map +1 -0
- package/dist/components/extension-preferences.d.ts +8 -0
- package/dist/components/extension-preferences.d.ts.map +1 -0
- package/dist/components/extension-preferences.js +139 -0
- package/dist/components/extension-preferences.js.map +1 -0
- package/dist/components/form/assign-components.d.ts +2 -0
- package/dist/components/form/assign-components.d.ts.map +1 -0
- package/dist/components/form/assign-components.js +22 -0
- package/dist/components/form/assign-components.js.map +1 -0
- package/dist/components/form/checkbox.d.ts +7 -0
- package/dist/components/form/checkbox.d.ts.map +1 -0
- package/dist/components/form/checkbox.js +46 -0
- package/dist/components/form/checkbox.js.map +1 -0
- package/dist/components/form/date-picker.d.ts +18 -0
- package/dist/components/form/date-picker.d.ts.map +1 -0
- package/dist/components/form/date-picker.js +69 -0
- package/dist/components/form/date-picker.js.map +1 -0
- package/dist/components/form/description.d.ts +7 -0
- package/dist/components/form/description.d.ts.map +1 -0
- package/dist/components/form/description.js +8 -0
- package/dist/components/form/description.js.map +1 -0
- package/dist/components/form/dropdown.d.ts +25 -0
- package/dist/components/form/dropdown.d.ts.map +1 -0
- package/dist/components/form/dropdown.js +286 -0
- package/dist/components/form/dropdown.js.map +1 -0
- package/dist/components/form/file-autocomplete.d.ts +12 -0
- package/dist/components/form/file-autocomplete.d.ts.map +1 -0
- package/dist/components/form/file-autocomplete.js +84 -0
- package/dist/components/form/file-autocomplete.js.map +1 -0
- package/dist/components/form/file-picker.d.ts +31 -0
- package/dist/components/form/file-picker.d.ts.map +1 -0
- package/dist/components/form/file-picker.js +113 -0
- package/dist/components/form/file-picker.js.map +1 -0
- package/dist/components/form/form-end.d.ts +2 -0
- package/dist/components/form/form-end.d.ts.map +1 -0
- package/dist/components/form/form-end.js +6 -0
- package/dist/components/form/form-end.js.map +1 -0
- package/dist/components/form/form-type-only.d.ts +174 -0
- package/dist/components/form/form-type-only.d.ts.map +1 -0
- package/dist/components/form/form-type-only.js +2 -0
- package/dist/components/form/form-type-only.js.map +1 -0
- package/dist/components/form/index.d.ts +46 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/index.js +106 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/form/password-field.d.ts +7 -0
- package/dist/components/form/password-field.d.ts.map +1 -0
- package/dist/components/form/password-field.js +34 -0
- package/dist/components/form/password-field.js.map +1 -0
- package/dist/components/form/separator.d.ts +2 -0
- package/dist/components/form/separator.d.ts.map +1 -0
- package/dist/components/form/separator.js +8 -0
- package/dist/components/form/separator.js.map +1 -0
- package/dist/components/form/tagpicker.d.ts +134 -0
- package/dist/components/form/tagpicker.d.ts.map +1 -0
- package/dist/components/form/tagpicker.js +79 -0
- package/dist/components/form/tagpicker.js.map +1 -0
- package/dist/components/form/text-area.d.ts +8 -0
- package/dist/components/form/text-area.d.ts.map +1 -0
- package/dist/components/form/text-area.js +26 -0
- package/dist/components/form/text-area.js.map +1 -0
- package/dist/components/form/text-field.d.ts +7 -0
- package/dist/components/form/text-field.d.ts.map +1 -0
- package/dist/components/form/text-field.js +28 -0
- package/dist/components/form/text-field.js.map +1 -0
- package/dist/components/form/types.d.ts +43 -0
- package/dist/components/form/types.d.ts.map +1 -0
- package/dist/components/form/types.js +2 -0
- package/dist/components/form/types.js.map +1 -0
- package/dist/components/form/use-form-handling.d.ts +4 -0
- package/dist/components/form/use-form-handling.d.ts.map +1 -0
- package/dist/components/form/use-form-handling.js +37 -0
- package/dist/components/form/use-form-handling.js.map +1 -0
- package/dist/components/form/use-form-navigation.d.ts +8 -0
- package/dist/components/form/use-form-navigation.d.ts.map +1 -0
- package/dist/components/form/use-form-navigation.js +58 -0
- package/dist/components/form/use-form-navigation.js.map +1 -0
- package/dist/components/form/with-left-border.d.ts +17 -0
- package/dist/components/form/with-left-border.d.ts.map +1 -0
- package/dist/components/form/with-left-border.js +10 -0
- package/dist/components/form/with-left-border.js.map +1 -0
- package/dist/components/icon.d.ts +9 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/icon.js +485 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/image.d.ts +19 -0
- package/dist/components/image.d.ts.map +1 -0
- package/dist/components/image.js +32 -0
- package/dist/components/image.js.map +1 -0
- package/dist/components/list.d.ts +234 -0
- package/dist/components/list.d.ts.map +1 -0
- package/dist/components/list.js +667 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/loading-bar.d.ts +8 -0
- package/dist/components/loading-bar.d.ts.map +1 -0
- package/dist/components/loading-bar.js +107 -0
- package/dist/components/loading-bar.js.map +1 -0
- package/dist/components/menubar-extra.d.ts +68 -0
- package/dist/components/menubar-extra.d.ts.map +1 -0
- package/dist/components/menubar-extra.js +39 -0
- package/dist/components/menubar-extra.js.map +1 -0
- package/dist/descendants.d.ts +25 -0
- package/dist/descendants.d.ts.map +1 -0
- package/dist/descendants.js +81 -0
- package/dist/descendants.js.map +1 -0
- package/dist/dev-ui.d.ts +7 -0
- package/dist/dev-ui.d.ts.map +1 -0
- package/dist/dev-ui.js +118 -0
- package/dist/dev-ui.js.map +1 -0
- package/dist/e2e-node.d.ts +63 -0
- package/dist/e2e-node.d.ts.map +1 -0
- package/dist/e2e-node.js +255 -0
- package/dist/e2e-node.js.map +1 -0
- package/dist/e2e.d.ts +39 -0
- package/dist/e2e.d.ts.map +1 -0
- package/dist/e2e.js +127 -0
- package/dist/e2e.js.map +1 -0
- package/dist/environment.d.ts +63 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +189 -0
- package/dist/environment.js.map +1 -0
- package/dist/examples/action-show-in-finder.d.ts +2 -0
- package/dist/examples/action-show-in-finder.d.ts.map +1 -0
- package/dist/examples/action-show-in-finder.js +13 -0
- package/dist/examples/action-show-in-finder.js.map +1 -0
- package/dist/examples/datepicker.d.ts +2 -0
- package/dist/examples/datepicker.d.ts.map +1 -0
- package/dist/examples/datepicker.js +344 -0
- package/dist/examples/datepicker.js.map +1 -0
- package/dist/examples/environment-test.d.ts +2 -0
- package/dist/examples/environment-test.d.ts.map +1 -0
- package/dist/examples/environment-test.js +28 -0
- package/dist/examples/environment-test.js.map +1 -0
- package/dist/examples/error-boundary.d.ts +6 -0
- package/dist/examples/error-boundary.d.ts.map +1 -0
- package/dist/examples/error-boundary.js +67 -0
- package/dist/examples/error-boundary.js.map +1 -0
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts +2 -0
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts.map +1 -0
- package/dist/examples/form-basic-arrow-keys.vitest.js +46 -0
- package/dist/examples/form-basic-arrow-keys.vitest.js.map +1 -0
- package/dist/examples/form-basic.d.ts +2 -0
- package/dist/examples/form-basic.d.ts.map +1 -0
- package/dist/examples/form-basic.js +21 -0
- package/dist/examples/form-basic.js.map +1 -0
- package/dist/examples/form-basic.vitest.d.ts +2 -0
- package/dist/examples/form-basic.vitest.d.ts.map +1 -0
- package/dist/examples/form-basic.vitest.js +995 -0
- package/dist/examples/form-basic.vitest.js.map +1 -0
- package/dist/examples/form-dropdown-with-sections.d.ts +2 -0
- package/dist/examples/form-dropdown-with-sections.d.ts.map +1 -0
- package/dist/examples/form-dropdown-with-sections.js +13 -0
- package/dist/examples/form-dropdown-with-sections.js.map +1 -0
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts +2 -0
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts.map +1 -0
- package/dist/examples/form-dropdown-with-sections.vitest.js +75 -0
- package/dist/examples/form-dropdown-with-sections.vitest.js.map +1 -0
- package/dist/examples/form-dropdown.d.ts +2 -0
- package/dist/examples/form-dropdown.d.ts.map +1 -0
- package/dist/examples/form-dropdown.js +13 -0
- package/dist/examples/form-dropdown.js.map +1 -0
- package/dist/examples/form-dropdown.vitest.d.ts +2 -0
- package/dist/examples/form-dropdown.vitest.d.ts.map +1 -0
- package/dist/examples/form-dropdown.vitest.js +722 -0
- package/dist/examples/form-dropdown.vitest.js.map +1 -0
- package/dist/examples/form-multiselect-dropdown.d.ts +2 -0
- package/dist/examples/form-multiselect-dropdown.d.ts.map +1 -0
- package/dist/examples/form-multiselect-dropdown.js +13 -0
- package/dist/examples/form-multiselect-dropdown.js.map +1 -0
- package/dist/examples/form-tagpicker.d.ts +2 -0
- package/dist/examples/form-tagpicker.d.ts.map +1 -0
- package/dist/examples/form-tagpicker.js +13 -0
- package/dist/examples/form-tagpicker.js.map +1 -0
- package/dist/examples/form-tagpicker.vitest.d.ts +2 -0
- package/dist/examples/form-tagpicker.vitest.d.ts.map +1 -0
- package/dist/examples/form-tagpicker.vitest.js +491 -0
- package/dist/examples/form-tagpicker.vitest.js.map +1 -0
- package/dist/examples/internal/descendants-filtering.d.ts +2 -0
- package/dist/examples/internal/descendants-filtering.d.ts.map +1 -0
- package/dist/examples/internal/descendants-filtering.js +144 -0
- package/dist/examples/internal/descendants-filtering.js.map +1 -0
- package/dist/examples/internal/descendants.d.ts +2 -0
- package/dist/examples/internal/descendants.d.ts.map +1 -0
- package/dist/examples/internal/descendants.js +134 -0
- package/dist/examples/internal/descendants.js.map +1 -0
- package/dist/examples/internal/nested-boxes.d.ts +2 -0
- package/dist/examples/internal/nested-boxes.d.ts.map +1 -0
- package/dist/examples/internal/nested-boxes.js +7 -0
- package/dist/examples/internal/nested-boxes.js.map +1 -0
- package/dist/examples/internal/scrollbox-demo.d.ts +2 -0
- package/dist/examples/internal/scrollbox-demo.d.ts.map +1 -0
- package/dist/examples/internal/scrollbox-demo.js +104 -0
- package/dist/examples/internal/scrollbox-demo.js.map +1 -0
- package/dist/examples/internal/simple-dialog.d.ts +2 -0
- package/dist/examples/internal/simple-dialog.d.ts.map +1 -0
- package/dist/examples/internal/simple-dialog.js +43 -0
- package/dist/examples/internal/simple-dialog.js.map +1 -0
- package/dist/examples/internal/text-stacking.d.ts +2 -0
- package/dist/examples/internal/text-stacking.d.ts.map +1 -0
- package/dist/examples/internal/text-stacking.js +53 -0
- package/dist/examples/internal/text-stacking.js.map +1 -0
- package/dist/examples/internal/unicode-square-repro.d.ts +2 -0
- package/dist/examples/internal/unicode-square-repro.d.ts.map +1 -0
- package/dist/examples/internal/unicode-square-repro.js +7 -0
- package/dist/examples/internal/unicode-square-repro.js.map +1 -0
- package/dist/examples/list-dropdown-default.d.ts +2 -0
- package/dist/examples/list-dropdown-default.d.ts.map +1 -0
- package/dist/examples/list-dropdown-default.js +14 -0
- package/dist/examples/list-dropdown-default.js.map +1 -0
- package/dist/examples/list-dropdown-default.vitest.d.ts +2 -0
- package/dist/examples/list-dropdown-default.vitest.d.ts.map +1 -0
- package/dist/examples/list-dropdown-default.vitest.js +164 -0
- package/dist/examples/list-dropdown-default.vitest.js.map +1 -0
- package/dist/examples/list-fetch-data.d.ts +2 -0
- package/dist/examples/list-fetch-data.d.ts.map +1 -0
- package/dist/examples/list-fetch-data.js +87 -0
- package/dist/examples/list-fetch-data.js.map +1 -0
- package/dist/examples/list-fetch-data.vitest.d.ts +2 -0
- package/dist/examples/list-fetch-data.vitest.d.ts.map +1 -0
- package/dist/examples/list-fetch-data.vitest.js +103 -0
- package/dist/examples/list-fetch-data.vitest.js.map +1 -0
- package/dist/examples/list-filter-navigation.d.ts +2 -0
- package/dist/examples/list-filter-navigation.d.ts.map +1 -0
- package/dist/examples/list-filter-navigation.js +8 -0
- package/dist/examples/list-filter-navigation.js.map +1 -0
- package/dist/examples/list-with-detail.d.ts +2 -0
- package/dist/examples/list-with-detail.d.ts.map +1 -0
- package/dist/examples/list-with-detail.js +94 -0
- package/dist/examples/list-with-detail.js.map +1 -0
- package/dist/examples/list-with-detail.vitest.d.ts +2 -0
- package/dist/examples/list-with-detail.vitest.d.ts.map +1 -0
- package/dist/examples/list-with-detail.vitest.js +438 -0
- package/dist/examples/list-with-detail.vitest.js.map +1 -0
- package/dist/examples/list-with-dropdown.d.ts +2 -0
- package/dist/examples/list-with-dropdown.d.ts.map +1 -0
- package/dist/examples/list-with-dropdown.js +43 -0
- package/dist/examples/list-with-dropdown.js.map +1 -0
- package/dist/examples/list-with-dropdown.vitest.d.ts +2 -0
- package/dist/examples/list-with-dropdown.vitest.d.ts.map +1 -0
- package/dist/examples/list-with-dropdown.vitest.js +297 -0
- package/dist/examples/list-with-dropdown.vitest.js.map +1 -0
- package/dist/examples/list-with-sections.d.ts +2 -0
- package/dist/examples/list-with-sections.d.ts.map +1 -0
- package/dist/examples/list-with-sections.js +67 -0
- package/dist/examples/list-with-sections.js.map +1 -0
- package/dist/examples/list-with-sections.vitest.d.ts +2 -0
- package/dist/examples/list-with-sections.vitest.d.ts.map +1 -0
- package/dist/examples/list-with-sections.vitest.js +441 -0
- package/dist/examples/list-with-sections.vitest.js.map +1 -0
- package/dist/examples/miscellaneous.d.ts +2 -0
- package/dist/examples/miscellaneous.d.ts.map +1 -0
- package/dist/examples/miscellaneous.js +313 -0
- package/dist/examples/miscellaneous.js.map +1 -0
- package/dist/examples/nested-navigation.d.ts +2 -0
- package/dist/examples/nested-navigation.d.ts.map +1 -0
- package/dist/examples/nested-navigation.js +35 -0
- package/dist/examples/nested-navigation.js.map +1 -0
- package/dist/examples/preferences-test.d.ts +2 -0
- package/dist/examples/preferences-test.d.ts.map +1 -0
- package/dist/examples/preferences-test.js +43 -0
- package/dist/examples/preferences-test.js.map +1 -0
- package/dist/examples/simple-dropdown.d.ts +2 -0
- package/dist/examples/simple-dropdown.d.ts.map +1 -0
- package/dist/examples/simple-dropdown.js +15 -0
- package/dist/examples/simple-dropdown.js.map +1 -0
- package/dist/examples/simple-file-picker.d.ts +2 -0
- package/dist/examples/simple-file-picker.d.ts.map +1 -0
- package/dist/examples/simple-file-picker.js +21 -0
- package/dist/examples/simple-file-picker.js.map +1 -0
- package/dist/examples/simple-file-picker.vitest.d.ts +2 -0
- package/dist/examples/simple-file-picker.vitest.d.ts.map +1 -0
- package/dist/examples/simple-file-picker.vitest.js +277 -0
- package/dist/examples/simple-file-picker.vitest.js.map +1 -0
- package/dist/examples/simple-grid.d.ts +2 -0
- package/dist/examples/simple-grid.d.ts.map +1 -0
- package/dist/examples/simple-grid.js +51 -0
- package/dist/examples/simple-grid.js.map +1 -0
- package/dist/examples/simple-grid.vitest.d.ts +2 -0
- package/dist/examples/simple-grid.vitest.d.ts.map +1 -0
- package/dist/examples/simple-grid.vitest.js +498 -0
- package/dist/examples/simple-grid.vitest.js.map +1 -0
- package/dist/examples/simple-hud.d.ts +2 -0
- package/dist/examples/simple-hud.d.ts.map +1 -0
- package/dist/examples/simple-hud.js +18 -0
- package/dist/examples/simple-hud.js.map +1 -0
- package/dist/examples/simple-list-search.d.ts +2 -0
- package/dist/examples/simple-list-search.d.ts.map +1 -0
- package/dist/examples/simple-list-search.js +26 -0
- package/dist/examples/simple-list-search.js.map +1 -0
- package/dist/examples/simple-list.d.ts +2 -0
- package/dist/examples/simple-list.d.ts.map +1 -0
- package/dist/examples/simple-list.js +50 -0
- package/dist/examples/simple-list.js.map +1 -0
- package/dist/examples/simple-navigation.d.ts +2 -0
- package/dist/examples/simple-navigation.d.ts.map +1 -0
- package/dist/examples/simple-navigation.js +36 -0
- package/dist/examples/simple-navigation.js.map +1 -0
- package/dist/examples/simple-navigation.vitest.d.ts +2 -0
- package/dist/examples/simple-navigation.vitest.d.ts.map +1 -0
- package/dist/examples/simple-navigation.vitest.js +522 -0
- package/dist/examples/simple-navigation.vitest.js.map +1 -0
- package/dist/examples/store.d.ts +2 -0
- package/dist/examples/store.d.ts.map +1 -0
- package/dist/examples/store.js +5 -0
- package/dist/examples/store.js.map +1 -0
- package/dist/examples/store.vitest.d.ts +2 -0
- package/dist/examples/store.vitest.d.ts.map +1 -0
- package/dist/examples/store.vitest.js +52 -0
- package/dist/examples/store.vitest.js.map +1 -0
- package/dist/examples/tanstack-demo.d.ts +2 -0
- package/dist/examples/tanstack-demo.d.ts.map +1 -0
- package/dist/examples/tanstack-demo.js +51 -0
- package/dist/examples/tanstack-demo.js.map +1 -0
- package/dist/examples/use-promise-demo.d.ts +2 -0
- package/dist/examples/use-promise-demo.d.ts.map +1 -0
- package/dist/examples/use-promise-demo.js +45 -0
- package/dist/examples/use-promise-demo.js.map +1 -0
- package/dist/extensions/dev.d.ts +7 -0
- package/dist/extensions/dev.d.ts.map +1 -0
- package/dist/extensions/dev.js +124 -0
- package/dist/extensions/dev.js.map +1 -0
- package/dist/extensions/home.d.ts +8 -0
- package/dist/extensions/home.d.ts.map +1 -0
- package/dist/extensions/home.js +184 -0
- package/dist/extensions/home.js.map +1 -0
- package/dist/extensions/store.d.ts +6 -0
- package/dist/extensions/store.d.ts.map +1 -0
- package/dist/extensions/store.js +203 -0
- package/dist/extensions/store.js.map +1 -0
- package/dist/globals.d.ts +9 -0
- package/dist/globals.d.ts.map +1 -0
- package/dist/globals.js +21 -0
- package/dist/globals.js.map +1 -0
- package/dist/home-command.d.ts +8 -0
- package/dist/home-command.d.ts.map +1 -0
- package/dist/home-command.js +181 -0
- package/dist/home-command.js.map +1 -0
- package/dist/hooks/hooks.test.d.ts +2 -0
- package/dist/hooks/hooks.test.d.ts.map +1 -0
- package/dist/hooks/hooks.test.js +37 -0
- package/dist/hooks/hooks.test.js.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-action-panel.d.ts +16 -0
- package/dist/hooks/use-action-panel.d.ts.map +1 -0
- package/dist/hooks/use-action-panel.js +19 -0
- package/dist/hooks/use-action-panel.js.map +1 -0
- package/dist/hooks/use-id.d.ts +9 -0
- package/dist/hooks/use-id.d.ts.map +1 -0
- package/dist/hooks/use-id.js +17 -0
- package/dist/hooks/use-id.js.map +1 -0
- package/dist/hooks/use-unstable-ai.d.ts +9 -0
- package/dist/hooks/use-unstable-ai.d.ts.map +1 -0
- package/dist/hooks/use-unstable-ai.js +13 -0
- package/dist/hooks/use-unstable-ai.js.map +1 -0
- package/dist/hooks.d.ts +10 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +20 -0
- package/dist/hooks.js.map +1 -0
- package/dist/hover-repro.d.ts +2 -0
- package/dist/hover-repro.d.ts.map +1 -0
- package/dist/hover-repro.js +20 -0
- package/dist/hover-repro.js.map +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/date-picker-widget.d.ts +9 -0
- package/dist/internal/date-picker-widget.d.ts.map +1 -0
- package/dist/internal/date-picker-widget.js +380 -0
- package/dist/internal/date-picker-widget.js.map +1 -0
- package/dist/internal/dialog.d.ts +21 -0
- package/dist/internal/dialog.d.ts.map +1 -0
- package/dist/internal/dialog.js +122 -0
- package/dist/internal/dialog.js.map +1 -0
- package/dist/internal/error-handler.d.ts +2 -0
- package/dist/internal/error-handler.d.ts.map +1 -0
- package/dist/internal/error-handler.js +29 -0
- package/dist/internal/error-handler.js.map +1 -0
- package/dist/internal/focus-context.d.ts +10 -0
- package/dist/internal/focus-context.d.ts.map +1 -0
- package/dist/internal/focus-context.js +12 -0
- package/dist/internal/focus-context.js.map +1 -0
- package/dist/internal/navigation.d.ts +18 -0
- package/dist/internal/navigation.d.ts.map +1 -0
- package/dist/internal/navigation.js +83 -0
- package/dist/internal/navigation.js.map +1 -0
- package/dist/internal/providers.d.ts +8 -0
- package/dist/internal/providers.d.ts.map +1 -0
- package/dist/internal/providers.js +262 -0
- package/dist/internal/providers.js.map +1 -0
- package/dist/localstorage.d.ts +13 -0
- package/dist/localstorage.d.ts.map +1 -0
- package/dist/localstorage.js +190 -0
- package/dist/localstorage.js.map +1 -0
- package/dist/localstorage.test.d.ts +2 -0
- package/dist/localstorage.test.d.ts.map +1 -0
- package/dist/localstorage.test.js +131 -0
- package/dist/localstorage.test.js.map +1 -0
- package/dist/logger.d.ts +7 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +70 -0
- package/dist/logger.js.map +1 -0
- package/dist/oauth.d.ts +142 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +551 -0
- package/dist/oauth.js.map +1 -0
- package/dist/package-json.d.ts +84 -0
- package/dist/package-json.d.ts.map +1 -0
- package/dist/package-json.js +77 -0
- package/dist/package-json.js.map +1 -0
- package/dist/preferences.d.ts +23 -0
- package/dist/preferences.d.ts.map +1 -0
- package/dist/preferences.js +105 -0
- package/dist/preferences.js.map +1 -0
- package/dist/preload.d.ts +2 -0
- package/dist/preload.d.ts.map +1 -0
- package/dist/preload.js +28 -0
- package/dist/preload.js.map +1 -0
- package/dist/state.d.ts +26 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +18 -0
- package/dist/state.js.map +1 -0
- package/dist/store-api/download.d.ts +8 -0
- package/dist/store-api/download.d.ts.map +1 -0
- package/dist/store-api/download.js +37 -0
- package/dist/store-api/download.js.map +1 -0
- package/dist/store-api/download.test.d.ts +2 -0
- package/dist/store-api/download.test.d.ts.map +1 -0
- package/dist/store-api/download.test.js +36 -0
- package/dist/store-api/download.test.js.map +1 -0
- package/dist/store-api/extension.d.ts +87 -0
- package/dist/store-api/extension.d.ts.map +1 -0
- package/dist/store-api/extension.js +23 -0
- package/dist/store-api/extension.js.map +1 -0
- package/dist/store-api/extension.test.d.ts +2 -0
- package/dist/store-api/extension.test.d.ts.map +1 -0
- package/dist/store-api/extension.test.js +22 -0
- package/dist/store-api/extension.test.js.map +1 -0
- package/dist/store-api/search.d.ts +101 -0
- package/dist/store-api/search.d.ts.map +1 -0
- package/dist/store-api/search.js +29 -0
- package/dist/store-api/search.js.map +1 -0
- package/dist/store-api/search.test.d.ts +2 -0
- package/dist/store-api/search.test.d.ts.map +1 -0
- package/dist/store-api/search.test.js +45 -0
- package/dist/store-api/search.test.js.map +1 -0
- package/dist/store.d.ts +21 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +84 -0
- package/dist/store.js.map +1 -0
- package/dist/theme.d.ts +20 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +26 -0
- package/dist/theme.js.map +1 -0
- package/dist/toast.d.ts +44 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +221 -0
- package/dist/toast.js.map +1 -0
- package/dist/utils/file-system.d.ts +11 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +66 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils.d.ts +234 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +473 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.test.d.ts +2 -0
- package/dist/utils.test.d.ts.map +1 -0
- package/dist/utils.test.js +152 -0
- package/dist/utils.test.js.map +1 -0
- package/dist/window.d.ts +12 -0
- package/dist/window.d.ts.map +1 -0
- package/dist/window.js +48 -0
- package/dist/window.js.map +1 -0
- package/package.json +56 -0
- package/src/action-utils.tsx +207 -0
- package/src/apis/ai.tsx +177 -0
- package/src/apis/cache.test.ts +311 -0
- package/src/apis/cache.tsx +394 -0
- package/src/apis/clipboard.tsx +200 -0
- package/src/apis/environment.tsx +239 -0
- package/src/apis/hud.tsx +86 -0
- package/src/apis/localstorage.test.ts +164 -0
- package/src/apis/localstorage.tsx +215 -0
- package/src/apis/oauth.tsx +744 -0
- package/src/apis/preferences.tsx +140 -0
- package/src/apis/toast.tsx +388 -0
- package/src/apis/window.tsx +61 -0
- package/src/build.test.tsx +78 -0
- package/src/build.tsx +273 -0
- package/src/cli.tsx +328 -0
- package/src/colors.tsx +15 -0
- package/src/components/actions.tsx +718 -0
- package/src/components/alert.tsx +205 -0
- package/src/components/detail.tsx +359 -0
- package/src/components/dropdown.tsx +438 -0
- package/src/components/extension-preferences.tsx +269 -0
- package/src/components/form/assign-components.tsx +22 -0
- package/src/components/form/checkbox.tsx +96 -0
- package/src/components/form/date-picker.tsx +125 -0
- package/src/components/form/description.tsx +30 -0
- package/src/components/form/dropdown.tsx +512 -0
- package/src/components/form/file-autocomplete.tsx +141 -0
- package/src/components/form/file-picker.tsx +233 -0
- package/src/components/form/form-end.tsx +6 -0
- package/src/components/form/index.tsx +242 -0
- package/src/components/form/password-field.tsx +87 -0
- package/src/components/form/separator.tsx +15 -0
- package/src/components/form/tagpicker.tsx +245 -0
- package/src/components/form/text-area.tsx +82 -0
- package/src/components/form/text-field.tsx +82 -0
- package/src/components/form/types.tsx +49 -0
- package/src/components/form/use-form-navigation.tsx +65 -0
- package/src/components/form/with-left-border.tsx +53 -0
- package/src/components/icon.tsx +496 -0
- package/src/components/image.tsx +54 -0
- package/src/components/list.tsx +1564 -0
- package/src/components/loading-bar.tsx +141 -0
- package/src/components/menubar-extra.tsx +181 -0
- package/src/descendants.tsx +134 -0
- package/src/e2e-node.tsx +303 -0
- package/src/e2e.tsx +147 -0
- package/src/examples/action-show-in-finder.tsx +80 -0
- package/src/examples/environment-test.tsx +50 -0
- package/src/examples/error-boundary.tsx +217 -0
- package/src/examples/form-basic.tsx +122 -0
- package/src/examples/form-basic.vitest.tsx +1035 -0
- package/src/examples/form-dropdown.tsx +102 -0
- package/src/examples/form-dropdown.vitest.tsx +758 -0
- package/src/examples/form-tagpicker.tsx +66 -0
- package/src/examples/form-tagpicker.vitest.tsx +523 -0
- package/src/examples/internal/descendants-filtering.tsx +223 -0
- package/src/examples/internal/descendants.tsx +208 -0
- package/src/examples/internal/scrollbox-demo.tsx +149 -0
- package/src/examples/internal/simple-dialog.tsx +124 -0
- package/src/examples/internal/text-stacking.tsx +90 -0
- package/src/examples/list-dropdown-default.tsx +69 -0
- package/src/examples/list-dropdown-default.vitest.tsx +187 -0
- package/src/examples/list-fetch-data.tsx +123 -0
- package/src/examples/list-fetch-data.vitest.tsx +110 -0
- package/src/examples/list-with-detail.tsx +161 -0
- package/src/examples/list-with-detail.vitest.tsx +468 -0
- package/src/examples/list-with-dropdown.tsx +97 -0
- package/src/examples/list-with-dropdown.vitest.tsx +324 -0
- package/src/examples/list-with-sections.tsx +196 -0
- package/src/examples/list-with-sections.vitest.tsx +479 -0
- package/src/examples/miscellaneous.tsx +780 -0
- package/src/examples/nested-navigation.tsx +118 -0
- package/src/examples/preferences-test.tsx +82 -0
- package/src/examples/simple-dropdown.tsx +95 -0
- package/src/examples/simple-file-picker.tsx +75 -0
- package/src/examples/simple-file-picker.vitest.tsx +306 -0
- package/src/examples/simple-grid.tsx +149 -0
- package/src/examples/simple-grid.vitest.tsx +535 -0
- package/src/examples/simple-hud.tsx +60 -0
- package/src/examples/simple-list-search.tsx +93 -0
- package/src/examples/simple-list.tsx +149 -0
- package/src/examples/simple-navigation.tsx +89 -0
- package/src/examples/simple-navigation.vitest.tsx +571 -0
- package/src/examples/store.tsx +4 -0
- package/src/examples/store.vitest.tsx +59 -0
- package/src/examples/tanstack-demo.tsx +104 -0
- package/src/examples/use-promise-demo.tsx +96 -0
- package/src/extensions/dev.tsx +215 -0
- package/src/extensions/home.tsx +332 -0
- package/src/extensions/store.tsx +375 -0
- package/src/globals.ts +34 -0
- package/src/hooks/index.tsx +8 -0
- package/src/hooks/use-action-panel.tsx +28 -0
- package/src/hooks/use-id.tsx +19 -0
- package/src/hooks/use-unstable-ai.tsx +15 -0
- package/src/hooks.tsx +22 -0
- package/src/index.tsx +240 -0
- package/src/internal/date-picker-widget.tsx +500 -0
- package/src/internal/dialog.tsx +202 -0
- package/src/internal/error-handler.tsx +32 -0
- package/src/internal/focus-context.tsx +23 -0
- package/src/internal/navigation.tsx +149 -0
- package/src/internal/providers.tsx +430 -0
- package/src/logger.tsx +84 -0
- package/src/package-json.tsx +197 -0
- package/src/preload.tsx +32 -0
- package/src/state.tsx +49 -0
- package/src/store-api/download.test.tsx +38 -0
- package/src/store-api/download.tsx +52 -0
- package/src/store-api/extension.test.tsx +24 -0
- package/src/store-api/extension.tsx +123 -0
- package/src/store-api/search.test.tsx +50 -0
- package/src/store-api/search.tsx +146 -0
- package/src/theme.tsx +31 -0
- package/src/utils/file-system.ts +87 -0
- package/src/utils.test.tsx +204 -0
- package/src/utils.tsx +657 -0
package/src/utils.tsx
ADDED
|
@@ -0,0 +1,657 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react'
|
|
2
|
+
import { render } from '@opentui/react'
|
|
3
|
+
import { Providers } from 'termcast/src/internal/providers'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import fs from 'node:fs'
|
|
6
|
+
import os from 'node:os'
|
|
7
|
+
import {
|
|
8
|
+
parsePackageJson,
|
|
9
|
+
type RaycastPackageJson,
|
|
10
|
+
getCommandsWithFiles,
|
|
11
|
+
type CommandWithFile,
|
|
12
|
+
} from './package-json'
|
|
13
|
+
import { logger } from './logger'
|
|
14
|
+
|
|
15
|
+
export function renderWithProviders(element: ReactNode): void {
|
|
16
|
+
render(<Providers>{element}</Providers>)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type CommonProps = {
|
|
20
|
+
key?: any
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface Application {
|
|
24
|
+
name: string
|
|
25
|
+
localizedName?: string
|
|
26
|
+
path: string
|
|
27
|
+
bundleId?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type PathLike = string | Buffer | { href: string; toString(): string }
|
|
31
|
+
|
|
32
|
+
export function sleep(ms: number): Promise<void> {
|
|
33
|
+
return new Promise((resolve) => setTimeout(resolve, ms))
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export async function getApplications(path?: PathLike): Promise<Application[]> {
|
|
37
|
+
// TODO: Implement system call to get applications
|
|
38
|
+
// For now, return common applications
|
|
39
|
+
const apps: Application[] = [
|
|
40
|
+
{
|
|
41
|
+
name: 'Finder',
|
|
42
|
+
localizedName: 'Finder',
|
|
43
|
+
path: '/System/Library/CoreServices/Finder.app',
|
|
44
|
+
bundleId: 'com.apple.finder',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Terminal',
|
|
48
|
+
localizedName: 'Terminal',
|
|
49
|
+
path: '/System/Applications/Utilities/Terminal.app',
|
|
50
|
+
bundleId: 'com.apple.Terminal',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'Visual Studio Code',
|
|
54
|
+
localizedName: 'Visual Studio Code',
|
|
55
|
+
path: '/Applications/Visual Studio Code.app',
|
|
56
|
+
bundleId: 'com.microsoft.VSCode',
|
|
57
|
+
},
|
|
58
|
+
]
|
|
59
|
+
return Promise.resolve(apps)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export async function getDefaultApplication(
|
|
63
|
+
path: PathLike,
|
|
64
|
+
): Promise<Application> {
|
|
65
|
+
// TODO: Implement system call to get default application for file type
|
|
66
|
+
// For now, return a default app
|
|
67
|
+
const defaultApp: Application = {
|
|
68
|
+
name: 'Finder',
|
|
69
|
+
localizedName: 'Finder',
|
|
70
|
+
path: '/System/Library/CoreServices/Finder.app',
|
|
71
|
+
bundleId: 'com.apple.finder',
|
|
72
|
+
}
|
|
73
|
+
return Promise.resolve(defaultApp)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export async function getFrontmostApplication(): Promise<Application> {
|
|
77
|
+
// TODO: Implement system call to get frontmost application
|
|
78
|
+
// For now, return Terminal as default
|
|
79
|
+
const frontmostApp: Application = {
|
|
80
|
+
name: 'Terminal',
|
|
81
|
+
localizedName: 'Terminal',
|
|
82
|
+
path: '/System/Applications/Utilities/Terminal.app',
|
|
83
|
+
bundleId: 'com.apple.Terminal',
|
|
84
|
+
}
|
|
85
|
+
return Promise.resolve(frontmostApp)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export async function showInFinder(path: PathLike): Promise<void> {
|
|
89
|
+
// TODO: Implement system call to show file in Finder
|
|
90
|
+
const pathStr = typeof path === 'string' ? path : path.toString()
|
|
91
|
+
console.log(`[showInFinder] Would open: ${pathStr}`)
|
|
92
|
+
return Promise.resolve()
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export async function trash(path: PathLike | PathLike[]): Promise<void> {
|
|
96
|
+
// TODO: Implement system call to move files to trash
|
|
97
|
+
const paths = Array.isArray(path) ? path : [path]
|
|
98
|
+
const pathStrs = paths.map((p) => (typeof p === 'string' ? p : p.toString()))
|
|
99
|
+
console.log(`[trash] Would trash: ${pathStrs.join(', ')}`)
|
|
100
|
+
return Promise.resolve()
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export async function open(
|
|
104
|
+
target: string,
|
|
105
|
+
application?: Application | string,
|
|
106
|
+
): Promise<void> {
|
|
107
|
+
// TODO: Implement system call to open file/URL with application
|
|
108
|
+
const appName =
|
|
109
|
+
typeof application === 'string' ? application : application?.name
|
|
110
|
+
console.log(`[open] Would open ${target}${appName ? ` with ${appName}` : ''}`)
|
|
111
|
+
return Promise.resolve()
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function captureException(exception: unknown): void {
|
|
115
|
+
// TODO: Implement error reporting to Developer Hub
|
|
116
|
+
console.error('[captureException] Exception captured:', exception)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function getExtensionPath(extensionName: string): string {
|
|
120
|
+
const storeDir = getStoreDirectory()
|
|
121
|
+
return path.join(storeDir, extensionName)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function getExtensionPackageJsonPath(extensionName: string): string {
|
|
125
|
+
return path.join(getExtensionPath(extensionName), 'package.json')
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function getExtensionPackageJson(
|
|
129
|
+
extensionName: string,
|
|
130
|
+
): RaycastPackageJson | null {
|
|
131
|
+
const packageJsonPath = getExtensionPackageJsonPath(extensionName)
|
|
132
|
+
|
|
133
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
134
|
+
return null
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
try {
|
|
138
|
+
return parsePackageJson({ packageJsonPath })
|
|
139
|
+
} catch (error) {
|
|
140
|
+
console.error(`Failed to parse package.json for ${extensionName}:`, error)
|
|
141
|
+
return null
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface ExtensionPreferencesInfo {
|
|
146
|
+
hasPreferences: boolean
|
|
147
|
+
hasRequiredPreferences: boolean
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function checkExtensionPreferences(
|
|
151
|
+
extensionName: string,
|
|
152
|
+
): ExtensionPreferencesInfo {
|
|
153
|
+
const packageJson = getExtensionPackageJson(extensionName)
|
|
154
|
+
|
|
155
|
+
if (!packageJson) {
|
|
156
|
+
return { hasPreferences: false, hasRequiredPreferences: false }
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Check for extension-wide preferences
|
|
160
|
+
const hasExtensionPreferences =
|
|
161
|
+
packageJson.preferences && packageJson.preferences.length > 0
|
|
162
|
+
|
|
163
|
+
// Check if any command has preferences
|
|
164
|
+
const commandsWithPreferences = (packageJson.commands || []).filter(
|
|
165
|
+
(cmd) => cmd.preferences && cmd.preferences.length > 0,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
const hasPreferences =
|
|
169
|
+
hasExtensionPreferences || commandsWithPreferences.length > 0
|
|
170
|
+
|
|
171
|
+
// Check for required extension-wide preferences
|
|
172
|
+
const requiredExtensionPrefs = (packageJson.preferences || []).filter(
|
|
173
|
+
(pref) => pref.required,
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
// Check if any command has required preferences
|
|
177
|
+
const commandsWithRequiredPrefs = (packageJson.commands || []).filter(
|
|
178
|
+
(cmd) => {
|
|
179
|
+
const requiredPrefs = (cmd.preferences || []).filter(
|
|
180
|
+
(pref) => pref.required,
|
|
181
|
+
)
|
|
182
|
+
return requiredPrefs.length > 0
|
|
183
|
+
},
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
const hasRequiredPreferences =
|
|
187
|
+
requiredExtensionPrefs.length > 0 || commandsWithRequiredPrefs.length > 0
|
|
188
|
+
|
|
189
|
+
return { hasPreferences, hasRequiredPreferences }
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Store management types
|
|
193
|
+
interface BundledCommand extends CommandWithFile {
|
|
194
|
+
bundledPath: string
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
interface StoredExtension {
|
|
198
|
+
name: string
|
|
199
|
+
packageJsonPath: string
|
|
200
|
+
commands: BundledCommand[]
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export function resolveCommandPath({
|
|
204
|
+
commandName,
|
|
205
|
+
dir,
|
|
206
|
+
}: {
|
|
207
|
+
commandName: string
|
|
208
|
+
dir: string
|
|
209
|
+
}): string {
|
|
210
|
+
// First check for .termcast-bundle directory
|
|
211
|
+
const bundleDir = path.join(dir, '.termcast-bundle')
|
|
212
|
+
const bundledPath = path.join(bundleDir, `${commandName}.js`)
|
|
213
|
+
if (fs.existsSync(bundledPath)) {
|
|
214
|
+
return bundledPath
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Then check for top-level command file
|
|
218
|
+
const topLevelPath = path.join(dir, `${commandName}.js`)
|
|
219
|
+
if (fs.existsSync(topLevelPath)) {
|
|
220
|
+
return topLevelPath
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Return empty string if not found
|
|
224
|
+
return ''
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export function getStoreDirectory(): string {
|
|
228
|
+
const homeDir = os.homedir()
|
|
229
|
+
const storeDir = path.join(homeDir, '.termcast', 'store')
|
|
230
|
+
|
|
231
|
+
// Ensure store directory exists
|
|
232
|
+
if (!fs.existsSync(storeDir)) {
|
|
233
|
+
fs.mkdirSync(storeDir, { recursive: true })
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return storeDir
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export function installExtension({
|
|
240
|
+
extensionName,
|
|
241
|
+
extensionSourcePath,
|
|
242
|
+
}: {
|
|
243
|
+
extensionName: string
|
|
244
|
+
extensionSourcePath: string
|
|
245
|
+
}): void {
|
|
246
|
+
const storeDir = getStoreDirectory()
|
|
247
|
+
const extensionDir = path.join(storeDir, extensionName)
|
|
248
|
+
|
|
249
|
+
// Remove existing extension directory if it exists
|
|
250
|
+
if (fs.existsSync(extensionDir)) {
|
|
251
|
+
fs.rmSync(extensionDir, { recursive: true, force: true })
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Create extension directory
|
|
255
|
+
fs.mkdirSync(extensionDir, { recursive: true })
|
|
256
|
+
|
|
257
|
+
// Copy entire extension source directory
|
|
258
|
+
fs.cpSync(extensionSourcePath, extensionDir, { recursive: true })
|
|
259
|
+
|
|
260
|
+
logger.log(`Extension '${extensionName}' installed to ${extensionDir}`)
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export function getStoredExtensions(): StoredExtension[] {
|
|
264
|
+
const storeDir = getStoreDirectory()
|
|
265
|
+
const extensions: StoredExtension[] = []
|
|
266
|
+
|
|
267
|
+
if (!fs.existsSync(storeDir)) {
|
|
268
|
+
return extensions
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const entries = fs.readdirSync(storeDir, { withFileTypes: true })
|
|
272
|
+
|
|
273
|
+
for (const entry of entries) {
|
|
274
|
+
if (!entry.isDirectory()) continue
|
|
275
|
+
|
|
276
|
+
const extensionDir = path.join(storeDir, entry.name)
|
|
277
|
+
const packageJsonPath = path.join(extensionDir, 'package.json')
|
|
278
|
+
|
|
279
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
280
|
+
logger.log(`Skipping ${entry.name}: no package.json found`)
|
|
281
|
+
continue
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
try {
|
|
285
|
+
const commandsData = getCommandsWithFiles({ packageJsonPath })
|
|
286
|
+
|
|
287
|
+
// Map commands to bundled commands using the resolver
|
|
288
|
+
const bundledCommands: BundledCommand[] = commandsData.commands.map(
|
|
289
|
+
(command) => {
|
|
290
|
+
const bundledPath = resolveCommandPath({
|
|
291
|
+
commandName: command.name,
|
|
292
|
+
dir: extensionDir,
|
|
293
|
+
})
|
|
294
|
+
|
|
295
|
+
return {
|
|
296
|
+
...command,
|
|
297
|
+
bundledPath,
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
extensions.push({
|
|
303
|
+
name: entry.name,
|
|
304
|
+
packageJsonPath,
|
|
305
|
+
commands: bundledCommands,
|
|
306
|
+
})
|
|
307
|
+
} catch (error: any) {
|
|
308
|
+
logger.error(`Failed to load extension ${entry.name}:`, error.message)
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
return extensions
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export type ParseExecOutputHandler<T = any> = (args: { stdout: string }) => T
|
|
316
|
+
|
|
317
|
+
export interface ExecuteOptions<T> {
|
|
318
|
+
humanReadableOutput?: boolean
|
|
319
|
+
language?: 'AppleScript' | 'JavaScript'
|
|
320
|
+
signal?: AbortSignal
|
|
321
|
+
timeout?: number
|
|
322
|
+
parseOutput?: ParseExecOutputHandler<T>
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Executes an AppleScript or JavaScript for Automation script on macOS.
|
|
327
|
+
*
|
|
328
|
+
* This function provides a way to interact with macOS system features and applications
|
|
329
|
+
* through AppleScript or JavaScript for Automation (JXA). Only available on macOS.
|
|
330
|
+
*
|
|
331
|
+
* @param script - The AppleScript or JavaScript code to execute
|
|
332
|
+
* @param arguments_ - Optional array of arguments to pass to the script
|
|
333
|
+
* @param options - Execution options
|
|
334
|
+
* @param options.humanReadableOutput - Whether to format output for human readability (default: true)
|
|
335
|
+
* @param options.language - Script language: "AppleScript" (default) or "JavaScript"
|
|
336
|
+
* @param options.signal - AbortSignal to cancel execution
|
|
337
|
+
* @param options.timeout - Maximum execution time in milliseconds (default: 10000)
|
|
338
|
+
* @param options.parseOutput - Custom function to parse the script output
|
|
339
|
+
* @returns A Promise that resolves to the script output (string by default, or custom type if parseOutput is provided)
|
|
340
|
+
* @throws Error if not running on macOS or if script execution fails
|
|
341
|
+
*
|
|
342
|
+
* @example
|
|
343
|
+
* ```typescript
|
|
344
|
+
* // Simple AppleScript
|
|
345
|
+
* const result = await runAppleScript('return "Hello World"')
|
|
346
|
+
*
|
|
347
|
+
* // AppleScript with arguments
|
|
348
|
+
* const greeting = await runAppleScript(
|
|
349
|
+
* 'return "Hello " & item 1 of argv',
|
|
350
|
+
* ['John']
|
|
351
|
+
* )
|
|
352
|
+
*
|
|
353
|
+
* // JavaScript for Automation
|
|
354
|
+
* const apps = await runAppleScript(
|
|
355
|
+
* 'Application("System Events").processes.name()',
|
|
356
|
+
* undefined,
|
|
357
|
+
* { language: 'JavaScript' }
|
|
358
|
+
* )
|
|
359
|
+
*
|
|
360
|
+
* // Custom output parsing
|
|
361
|
+
* interface SystemInfo {
|
|
362
|
+
* name: string
|
|
363
|
+
* version: string
|
|
364
|
+
* }
|
|
365
|
+
* const info = await runAppleScript<SystemInfo>(
|
|
366
|
+
* 'return "{\\"name\\": \\"macOS\\", \\"version\\": \\"14.0\\"}"',
|
|
367
|
+
* undefined,
|
|
368
|
+
* { parseOutput: ({ stdout }) => JSON.parse(stdout) }
|
|
369
|
+
* )
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
export async function runAppleScript<T = string>(
|
|
373
|
+
script: string,
|
|
374
|
+
arguments_?: string[],
|
|
375
|
+
options?: ExecuteOptions<T>,
|
|
376
|
+
): Promise<T> {
|
|
377
|
+
if (process.platform !== 'darwin') {
|
|
378
|
+
throw new Error('runAppleScript is only supported on macOS')
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
const { exec } = await import('node:child_process')
|
|
382
|
+
const { promisify } = await import('node:util')
|
|
383
|
+
const execAsync = promisify(exec)
|
|
384
|
+
|
|
385
|
+
const language = options?.language || 'AppleScript'
|
|
386
|
+
const timeout = options?.timeout || 10000
|
|
387
|
+
const parseOutput = options?.parseOutput
|
|
388
|
+
|
|
389
|
+
let command: string
|
|
390
|
+
let fullScript = script
|
|
391
|
+
|
|
392
|
+
if (arguments_ && arguments_.length > 0) {
|
|
393
|
+
if (language === 'AppleScript') {
|
|
394
|
+
const args = arguments_
|
|
395
|
+
.map((arg) => `"${arg.replace(/"/g, '\\"')}"`)
|
|
396
|
+
.join(', ')
|
|
397
|
+
// Check if the script already has an "on run" handler
|
|
398
|
+
if (script.includes('on run')) {
|
|
399
|
+
fullScript = script
|
|
400
|
+
} else {
|
|
401
|
+
fullScript = `on run argv\n${script}\nend run`
|
|
402
|
+
}
|
|
403
|
+
// Execute with arguments passed separately
|
|
404
|
+
command = `osascript ${options?.humanReadableOutput === false ? '' : '-ss'} -e '${fullScript.replace(/'/g, "'\"'\"'")}' ${args}`
|
|
405
|
+
} else {
|
|
406
|
+
// JavaScript for Automation
|
|
407
|
+
const args = arguments_.map((arg) => `'${arg.replace(/'/g, "\\'")}'`)
|
|
408
|
+
fullScript = `const argv = [${args.join(', ')}];\n${script}`
|
|
409
|
+
const wrappedScript = `(function() { ${fullScript.replace(/'/g, "'\"'\"'")} })()`
|
|
410
|
+
command = `osascript -l JavaScript -e '${wrappedScript}'`
|
|
411
|
+
}
|
|
412
|
+
} else {
|
|
413
|
+
const escapedScript = fullScript.replace(/'/g, "'\"'\"'")
|
|
414
|
+
|
|
415
|
+
if (language === 'JavaScript') {
|
|
416
|
+
// For JavaScript, wrap in a function to allow return statements
|
|
417
|
+
const wrappedScript = `(function() { ${escapedScript} })()`
|
|
418
|
+
command = `osascript -l JavaScript -e '${wrappedScript}'`
|
|
419
|
+
} else {
|
|
420
|
+
command = `osascript ${options?.humanReadableOutput === false ? '' : '-ss'} -e '${escapedScript}'`
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
try {
|
|
425
|
+
const { stdout, stderr } = await execAsync(command, {
|
|
426
|
+
timeout,
|
|
427
|
+
signal: options?.signal,
|
|
428
|
+
})
|
|
429
|
+
|
|
430
|
+
if (stderr) {
|
|
431
|
+
throw new Error(stderr)
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
let result = stdout.trim()
|
|
435
|
+
|
|
436
|
+
// Remove surrounding quotes if present (AppleScript returns quoted strings)
|
|
437
|
+
if (
|
|
438
|
+
result.startsWith('"') &&
|
|
439
|
+
result.endsWith('"') &&
|
|
440
|
+
options?.humanReadableOutput !== false
|
|
441
|
+
) {
|
|
442
|
+
result = result.slice(1, -1)
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
if (parseOutput) {
|
|
446
|
+
return parseOutput({ stdout: result })
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
return result as T
|
|
450
|
+
} catch (error: any) {
|
|
451
|
+
if (error.code === 'ETIMEDOUT') {
|
|
452
|
+
throw new Error(`AppleScript execution timed out after ${timeout}ms`)
|
|
453
|
+
}
|
|
454
|
+
throw error
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
export enum LaunchType {
|
|
459
|
+
UserInitiated = 'userInitiated',
|
|
460
|
+
Background = 'background',
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export enum DeeplinkType {
|
|
464
|
+
Extension = 'extension',
|
|
465
|
+
ScriptCommand = 'script-command',
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export interface LaunchProps {
|
|
469
|
+
name?: string
|
|
470
|
+
path?: string
|
|
471
|
+
callback?: () => void
|
|
472
|
+
fallbackText?: string
|
|
473
|
+
preferredItemHeight?: string
|
|
474
|
+
resizeToContent?: boolean
|
|
475
|
+
subtitle?: string
|
|
476
|
+
onSearchTextChange?: (text: string) => void
|
|
477
|
+
arguments?: any
|
|
478
|
+
context?: any
|
|
479
|
+
type?: string
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
interface ExtensionDeeplinkOptions {
|
|
483
|
+
type?: DeeplinkType.Extension
|
|
484
|
+
command: string
|
|
485
|
+
launchType?: LaunchType
|
|
486
|
+
arguments?: LaunchProps['arguments']
|
|
487
|
+
fallbackText?: string
|
|
488
|
+
ownerOrAuthorName?: string
|
|
489
|
+
extensionName?: string
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
interface ScriptCommandDeeplinkOptions {
|
|
493
|
+
type: DeeplinkType.ScriptCommand
|
|
494
|
+
command: string
|
|
495
|
+
arguments?: string[]
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Creates a Raycast deeplink URL for extensions or script commands.
|
|
500
|
+
*
|
|
501
|
+
* Deeplinks allow you to launch Raycast commands from external applications or share
|
|
502
|
+
* direct links to specific functionality. Supports both installed extensions and
|
|
503
|
+
* script commands.
|
|
504
|
+
*
|
|
505
|
+
* @param options - Configuration for the deeplink
|
|
506
|
+
* @param options.type - Type of deeplink: DeeplinkType.Extension (default) or DeeplinkType.ScriptCommand
|
|
507
|
+
* @param options.command - The command name to execute
|
|
508
|
+
* @param options.launchType - How to launch the command: LaunchType.UserInitiated or LaunchType.Background (extension only)
|
|
509
|
+
* @param options.arguments - Arguments to pass to the command (extension: any object, script: string array)
|
|
510
|
+
* @param options.fallbackText - Text to show if the command is not available (extension only)
|
|
511
|
+
* @param options.ownerOrAuthorName - The owner or author name for published extensions (extension only)
|
|
512
|
+
* @param options.extensionName - The extension name (extension only)
|
|
513
|
+
* @returns A Raycast deeplink URL string
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* ```typescript
|
|
517
|
+
* // Extension deeplink
|
|
518
|
+
* const extensionUrl = createDeeplink({
|
|
519
|
+
* command: 'search-notes',
|
|
520
|
+
* extensionName: 'notion',
|
|
521
|
+
* ownerOrAuthorName: 'raycast',
|
|
522
|
+
* arguments: { query: 'meeting notes' },
|
|
523
|
+
* fallbackText: 'Search Notion'
|
|
524
|
+
* })
|
|
525
|
+
* // Returns: "raycast://extensions/raycast/notion/search-notes?fallbackText=Search+Notion&arguments=%257B%2522query%2522%253A%2522meeting%2520notes%2522%257D"
|
|
526
|
+
*
|
|
527
|
+
* // Script command deeplink
|
|
528
|
+
* const scriptUrl = createDeeplink({
|
|
529
|
+
* type: DeeplinkType.ScriptCommand,
|
|
530
|
+
* command: 'toggle-system-appearance',
|
|
531
|
+
* arguments: ['dark']
|
|
532
|
+
* })
|
|
533
|
+
* // Returns: "raycast://script-commands/toggle-system-appearance?name=toggle-system-appearance&arguments=dark"
|
|
534
|
+
*
|
|
535
|
+
* // Background launch
|
|
536
|
+
* const backgroundUrl = createDeeplink({
|
|
537
|
+
* command: 'sync-data',
|
|
538
|
+
* launchType: LaunchType.Background,
|
|
539
|
+
* extensionName: 'my-extension'
|
|
540
|
+
* })
|
|
541
|
+
* ```
|
|
542
|
+
*/
|
|
543
|
+
export function createDeeplink(
|
|
544
|
+
options: ExtensionDeeplinkOptions | ScriptCommandDeeplinkOptions,
|
|
545
|
+
): string {
|
|
546
|
+
const baseUrl = 'raycast://'
|
|
547
|
+
|
|
548
|
+
if (options.type === DeeplinkType.ScriptCommand) {
|
|
549
|
+
const params = new URLSearchParams()
|
|
550
|
+
params.set('name', options.command)
|
|
551
|
+
|
|
552
|
+
if (options.arguments && options.arguments.length > 0) {
|
|
553
|
+
params.set('arguments', options.arguments.join('\t'))
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
return `${baseUrl}script-commands/${options.command}?${params.toString()}`
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// Extension deeplink
|
|
560
|
+
const extensionOptions = options as ExtensionDeeplinkOptions
|
|
561
|
+
const params = new URLSearchParams()
|
|
562
|
+
|
|
563
|
+
if (extensionOptions.fallbackText) {
|
|
564
|
+
params.set('fallbackText', extensionOptions.fallbackText)
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
if (extensionOptions.launchType) {
|
|
568
|
+
params.set('launchType', extensionOptions.launchType)
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
if (extensionOptions.arguments) {
|
|
572
|
+
params.set(
|
|
573
|
+
'arguments',
|
|
574
|
+
encodeURIComponent(JSON.stringify(extensionOptions.arguments)),
|
|
575
|
+
)
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
let path = 'extensions'
|
|
579
|
+
|
|
580
|
+
if (extensionOptions.ownerOrAuthorName && extensionOptions.extensionName) {
|
|
581
|
+
path = `${path}/${extensionOptions.ownerOrAuthorName}/${extensionOptions.extensionName}`
|
|
582
|
+
} else if (extensionOptions.extensionName) {
|
|
583
|
+
path = `${path}/${extensionOptions.extensionName}`
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
const queryString = params.toString()
|
|
587
|
+
const url = `${baseUrl}${path}/${extensionOptions.command}${queryString ? '?' + queryString : ''}`
|
|
588
|
+
|
|
589
|
+
return url
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Executes a SQL query on a local SQLite database and returns the results.
|
|
594
|
+
*
|
|
595
|
+
* This function provides read-only access to SQLite databases, useful for querying
|
|
596
|
+
* application data, browser history, or other local SQLite-based storage.
|
|
597
|
+
*
|
|
598
|
+
* @param databasePath - Absolute path to the SQLite database file
|
|
599
|
+
* @param query - SQL query to execute (SELECT statements recommended)
|
|
600
|
+
* @returns A Promise that resolves to an array of result objects
|
|
601
|
+
* @throws Error if the database file doesn't exist or query execution fails
|
|
602
|
+
* @template T - Type of the expected result objects (default: unknown)
|
|
603
|
+
*
|
|
604
|
+
* @example
|
|
605
|
+
* ```typescript
|
|
606
|
+
* // Query browser bookmarks
|
|
607
|
+
* interface Bookmark {
|
|
608
|
+
* title: string
|
|
609
|
+
* url: string
|
|
610
|
+
* date_added: number
|
|
611
|
+
* }
|
|
612
|
+
* const bookmarks = await executeSQL<Bookmark>(
|
|
613
|
+
* '/Users/john/Library/Safari/Bookmarks.db',
|
|
614
|
+
* 'SELECT title, url, date_added FROM bookmarks ORDER BY date_added DESC LIMIT 10'
|
|
615
|
+
* )
|
|
616
|
+
*
|
|
617
|
+
* // Query application data
|
|
618
|
+
* const appData = await executeSQL(
|
|
619
|
+
* '/path/to/app.db',
|
|
620
|
+
* 'SELECT * FROM settings WHERE key = "theme"'
|
|
621
|
+
* )
|
|
622
|
+
*
|
|
623
|
+
* // Aggregate query
|
|
624
|
+
* interface Stats {
|
|
625
|
+
* total: number
|
|
626
|
+
* average: number
|
|
627
|
+
* }
|
|
628
|
+
* const stats = await executeSQL<Stats>(
|
|
629
|
+
* '/path/to/data.db',
|
|
630
|
+
* 'SELECT COUNT(*) as total, AVG(score) as average FROM results'
|
|
631
|
+
* )
|
|
632
|
+
* ```
|
|
633
|
+
*/
|
|
634
|
+
export async function executeSQL<T = unknown>(
|
|
635
|
+
databasePath: string,
|
|
636
|
+
query: string,
|
|
637
|
+
): Promise<T[]> {
|
|
638
|
+
const { Database } = await import('bun:sqlite')
|
|
639
|
+
|
|
640
|
+
if (!fs.existsSync(databasePath)) {
|
|
641
|
+
throw new Error(`Database file not found: ${databasePath}`)
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
const db = new Database(databasePath, {
|
|
645
|
+
readonly: true,
|
|
646
|
+
})
|
|
647
|
+
|
|
648
|
+
try {
|
|
649
|
+
const stmt = db.prepare(query)
|
|
650
|
+
const results = stmt.all() as T[]
|
|
651
|
+
return results
|
|
652
|
+
} catch (error: any) {
|
|
653
|
+
throw new Error(`SQL execution failed: ${error.message}`)
|
|
654
|
+
} finally {
|
|
655
|
+
db.close()
|
|
656
|
+
}
|
|
657
|
+
}
|