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/logger.tsx
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as fs from 'fs'
|
|
2
|
+
import * as path from 'path'
|
|
3
|
+
import { useEffect } from 'react'
|
|
4
|
+
|
|
5
|
+
const LOG_FILE = path.join(process.cwd(), 'app.log')
|
|
6
|
+
|
|
7
|
+
// Delete log file on process start
|
|
8
|
+
if (fs.existsSync(LOG_FILE)) {
|
|
9
|
+
fs.unlinkSync(LOG_FILE)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function serialize(msg: any): string {
|
|
13
|
+
if (msg instanceof Error) {
|
|
14
|
+
return `${msg.message}\n${msg.stack}`
|
|
15
|
+
}
|
|
16
|
+
if (typeof msg === 'string') {
|
|
17
|
+
return msg
|
|
18
|
+
}
|
|
19
|
+
return Bun.inspect(msg, { depth: 3 })
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const logger = {
|
|
23
|
+
log: (...messages: any[]) => {
|
|
24
|
+
const timestamp = new Date().toISOString()
|
|
25
|
+
const formattedMessages = messages.map(serialize).join(' ')
|
|
26
|
+
const logEntry = `[${timestamp}] ${formattedMessages}\n`
|
|
27
|
+
fs.appendFileSync(LOG_FILE, logEntry)
|
|
28
|
+
},
|
|
29
|
+
error: (...messages: any[]) => {
|
|
30
|
+
const timestamp = new Date().toISOString()
|
|
31
|
+
const formattedMessages = messages.map(serialize).join(' ')
|
|
32
|
+
const logEntry = `[${timestamp}] ERROR: ${formattedMessages}\n`
|
|
33
|
+
fs.appendFileSync(LOG_FILE, logEntry)
|
|
34
|
+
},
|
|
35
|
+
warn: (...messages: any[]) => {
|
|
36
|
+
const timestamp = new Date().toISOString()
|
|
37
|
+
const formattedMessages = messages.map(serialize).join(' ')
|
|
38
|
+
const logEntry = `[${timestamp}] WARN: ${formattedMessages}\n`
|
|
39
|
+
fs.appendFileSync(LOG_FILE, logEntry)
|
|
40
|
+
},
|
|
41
|
+
trace: (...messages: any[]) => {
|
|
42
|
+
const timestamp = new Date().toISOString()
|
|
43
|
+
let stack: string = ''
|
|
44
|
+
try {
|
|
45
|
+
throw new Error()
|
|
46
|
+
} catch (err: any) {
|
|
47
|
+
if (err instanceof Error && err.stack) {
|
|
48
|
+
stack = err.stack.split('\n').slice(2).join('\n')
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const formattedMessages = messages.map(serialize).join(' ')
|
|
52
|
+
const logEntry = `[${timestamp}] TRACE: ${formattedMessages}\n${stack}\n`
|
|
53
|
+
fs.appendFileSync(LOG_FILE, logEntry)
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Catch unhandled errors and exceptions
|
|
58
|
+
process.on('uncaughtException', (error: Error) => {
|
|
59
|
+
if (error instanceof Error) {
|
|
60
|
+
logger.error('Uncaught Exception:', error.message, error.stack)
|
|
61
|
+
} else {
|
|
62
|
+
logger.error('Uncaught Exception:', serialize(error))
|
|
63
|
+
}
|
|
64
|
+
process.exit(1)
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
process.on('unhandledRejection', async (reason: any, promise: Promise<any>) => {
|
|
68
|
+
if (reason instanceof Error) {
|
|
69
|
+
logger.error(
|
|
70
|
+
'Unhandled Rejection at:',
|
|
71
|
+
promise,
|
|
72
|
+
'reason:',
|
|
73
|
+
reason.message,
|
|
74
|
+
reason.stack,
|
|
75
|
+
)
|
|
76
|
+
} else {
|
|
77
|
+
logger.error(
|
|
78
|
+
'Unhandled Rejection at:',
|
|
79
|
+
promise,
|
|
80
|
+
'reason:',
|
|
81
|
+
serialize(reason),
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
})
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
|
|
4
|
+
interface RaycastPreference {
|
|
5
|
+
name: string
|
|
6
|
+
title: string
|
|
7
|
+
description: string
|
|
8
|
+
type:
|
|
9
|
+
| 'textfield'
|
|
10
|
+
| 'password'
|
|
11
|
+
| 'checkbox'
|
|
12
|
+
| 'dropdown'
|
|
13
|
+
| 'appPicker'
|
|
14
|
+
| 'file'
|
|
15
|
+
| 'directory'
|
|
16
|
+
required: boolean
|
|
17
|
+
placeholder?: string
|
|
18
|
+
default?: any
|
|
19
|
+
label?: string
|
|
20
|
+
data?: Array<{ title: string; value: string }>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface RaycastArgument {
|
|
24
|
+
name: string
|
|
25
|
+
type: 'text' | 'password' | 'dropdown'
|
|
26
|
+
placeholder: string
|
|
27
|
+
required?: boolean
|
|
28
|
+
data?: Array<{ title: string; value: string }>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface RaycastCommand {
|
|
32
|
+
name: string
|
|
33
|
+
title: string
|
|
34
|
+
subtitle?: string
|
|
35
|
+
description: string
|
|
36
|
+
icon?: string
|
|
37
|
+
mode: 'view' | 'no-view' | 'menu-bar'
|
|
38
|
+
interval?: string
|
|
39
|
+
keywords?: string[]
|
|
40
|
+
arguments?: RaycastArgument[]
|
|
41
|
+
preferences?: RaycastPreference[]
|
|
42
|
+
disabledByDefault?: boolean
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface RaycastTool {
|
|
46
|
+
name: string
|
|
47
|
+
title: string
|
|
48
|
+
description: string
|
|
49
|
+
icon?: string
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface RaycastPackageJson {
|
|
53
|
+
name: string
|
|
54
|
+
title: string
|
|
55
|
+
description: string
|
|
56
|
+
icon?: string
|
|
57
|
+
author?: string
|
|
58
|
+
categories?: string[]
|
|
59
|
+
license?: string
|
|
60
|
+
commands?: RaycastCommand[]
|
|
61
|
+
tools?: RaycastTool[]
|
|
62
|
+
platforms?: string[]
|
|
63
|
+
ai?: {
|
|
64
|
+
instructions?: string
|
|
65
|
+
evals?: any
|
|
66
|
+
}
|
|
67
|
+
owner?: string
|
|
68
|
+
access?: 'public' | 'private'
|
|
69
|
+
contributors?: string[]
|
|
70
|
+
pastContributors?: string[]
|
|
71
|
+
keywords?: string[]
|
|
72
|
+
preferences?: RaycastPreference[]
|
|
73
|
+
external?: string[]
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function parsePackageJson({
|
|
77
|
+
packageJsonPath,
|
|
78
|
+
}: {
|
|
79
|
+
packageJsonPath?: string
|
|
80
|
+
} = {}): RaycastPackageJson {
|
|
81
|
+
const resolvedPath =
|
|
82
|
+
packageJsonPath || path.join(process.cwd(), 'package.json')
|
|
83
|
+
|
|
84
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
85
|
+
throw new Error(`Package.json not found at: ${resolvedPath}`)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const rawContent = fs.readFileSync(resolvedPath, 'utf-8')
|
|
89
|
+
const packageJson = JSON.parse(rawContent)
|
|
90
|
+
|
|
91
|
+
const raycastConfig: RaycastPackageJson = {
|
|
92
|
+
name: packageJson.name || '',
|
|
93
|
+
title: packageJson.title || packageJson.name || '',
|
|
94
|
+
description: packageJson.description || '',
|
|
95
|
+
icon: packageJson.icon,
|
|
96
|
+
author: packageJson.author,
|
|
97
|
+
categories: packageJson.categories || [],
|
|
98
|
+
license: packageJson.license,
|
|
99
|
+
commands: packageJson.commands || [],
|
|
100
|
+
tools: packageJson.tools || [],
|
|
101
|
+
platforms: packageJson.platforms,
|
|
102
|
+
ai: packageJson.ai,
|
|
103
|
+
owner: packageJson.owner,
|
|
104
|
+
access: packageJson.access,
|
|
105
|
+
contributors: packageJson.contributors || [],
|
|
106
|
+
pastContributors: packageJson.pastContributors || [],
|
|
107
|
+
keywords: packageJson.keywords || [],
|
|
108
|
+
preferences: packageJson.preferences || [],
|
|
109
|
+
external: packageJson.external || [],
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return raycastConfig
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
interface CommandWithFile extends RaycastCommand {
|
|
116
|
+
filePath: string
|
|
117
|
+
exists: boolean
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface CommandsWithFiles {
|
|
121
|
+
packageJson: RaycastPackageJson
|
|
122
|
+
packageJsonPath: string
|
|
123
|
+
projectRoot: string
|
|
124
|
+
commands: CommandWithFile[]
|
|
125
|
+
}
|
|
126
|
+
export function getCommandsWithFiles({
|
|
127
|
+
packageJsonPath,
|
|
128
|
+
}: {
|
|
129
|
+
packageJsonPath?: string
|
|
130
|
+
} = {}): CommandsWithFiles {
|
|
131
|
+
const resolvedPath =
|
|
132
|
+
packageJsonPath || path.join(process.cwd(), 'package.json')
|
|
133
|
+
const projectRoot = path.dirname(resolvedPath)
|
|
134
|
+
const packageJson = parsePackageJson({ packageJsonPath: resolvedPath })
|
|
135
|
+
|
|
136
|
+
const commands: CommandWithFile[] = (packageJson.commands || []).map(
|
|
137
|
+
(command) => {
|
|
138
|
+
const possibleExtensions = ['.tsx', '.ts', '.jsx', '.js']
|
|
139
|
+
let filePath = ''
|
|
140
|
+
let exists = false
|
|
141
|
+
|
|
142
|
+
// First, look for the file outside "src"
|
|
143
|
+
for (const ext of possibleExtensions) {
|
|
144
|
+
const candidatePath = path.join(projectRoot, `${command.name}${ext}`)
|
|
145
|
+
if (fs.existsSync(candidatePath)) {
|
|
146
|
+
filePath = candidatePath
|
|
147
|
+
exists = true
|
|
148
|
+
break
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// If not found, look for the file inside "src"
|
|
153
|
+
if (!exists) {
|
|
154
|
+
for (const ext of possibleExtensions) {
|
|
155
|
+
const candidatePath = path.join(
|
|
156
|
+
projectRoot,
|
|
157
|
+
'src',
|
|
158
|
+
`${command.name}${ext}`,
|
|
159
|
+
)
|
|
160
|
+
if (fs.existsSync(candidatePath)) {
|
|
161
|
+
filePath = candidatePath
|
|
162
|
+
exists = true
|
|
163
|
+
break
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// If still not found, default to "src/commandName.tsx"
|
|
169
|
+
if (!filePath) {
|
|
170
|
+
filePath = path.join(projectRoot, 'src', `${command.name}.tsx`)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return {
|
|
174
|
+
...command,
|
|
175
|
+
filePath,
|
|
176
|
+
exists,
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
return {
|
|
182
|
+
packageJson,
|
|
183
|
+
packageJsonPath: resolvedPath,
|
|
184
|
+
projectRoot,
|
|
185
|
+
commands,
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export type {
|
|
190
|
+
RaycastPreference,
|
|
191
|
+
RaycastArgument,
|
|
192
|
+
RaycastCommand,
|
|
193
|
+
RaycastTool,
|
|
194
|
+
RaycastPackageJson,
|
|
195
|
+
CommandWithFile,
|
|
196
|
+
CommandsWithFiles,
|
|
197
|
+
}
|
package/src/preload.tsx
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { plugin } from 'bun'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import { logger } from './logger'
|
|
4
|
+
|
|
5
|
+
plugin({
|
|
6
|
+
name: 'alias-raycast-to-termcast',
|
|
7
|
+
setup(build) {
|
|
8
|
+
build.onResolve({ filter: /@raycast\/api/ }, () => {
|
|
9
|
+
return {
|
|
10
|
+
path: require.resolve('termcast'),
|
|
11
|
+
}
|
|
12
|
+
})
|
|
13
|
+
// build.onResolve({ filter: /@raycast\/utils/ }, (args) => {
|
|
14
|
+
// return {
|
|
15
|
+
// path: require.resolve('@raycast/utils', {
|
|
16
|
+
// paths: [args.importer],
|
|
17
|
+
// }),
|
|
18
|
+
|
|
19
|
+
// }
|
|
20
|
+
// })
|
|
21
|
+
// build.onLoad({ filter: /@raycast\/utils/ }, (args) => {
|
|
22
|
+
// const filePath = require
|
|
23
|
+
// .resolve(args.path.replace('file:', ''))
|
|
24
|
+
// .replace('file:', '')
|
|
25
|
+
// return {
|
|
26
|
+
// contents: require('fs').readFileSync(filePath, 'utf8'),
|
|
27
|
+
|
|
28
|
+
// loader: 'js',
|
|
29
|
+
// }
|
|
30
|
+
// })
|
|
31
|
+
},
|
|
32
|
+
})
|
package/src/state.tsx
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { create } from 'zustand'
|
|
2
|
+
import { type ReactNode } from 'react'
|
|
3
|
+
import type { RaycastPackageJson } from './package-json'
|
|
4
|
+
|
|
5
|
+
export type DialogPosition = 'center' | 'top-right' | 'bottom-right'
|
|
6
|
+
|
|
7
|
+
export interface DialogStackItem {
|
|
8
|
+
element: ReactNode
|
|
9
|
+
position?: DialogPosition
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface NavigationStackItem {
|
|
13
|
+
element: ReactNode
|
|
14
|
+
onPop?: () => void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface AppState {
|
|
18
|
+
toast: ReactNode | null
|
|
19
|
+
dialogStack: DialogStackItem[]
|
|
20
|
+
// Navigation state
|
|
21
|
+
navigationStack: NavigationStackItem[]
|
|
22
|
+
// Dev mode state
|
|
23
|
+
devElement: ReactNode | null
|
|
24
|
+
devRebuildCount: number
|
|
25
|
+
// Extension and command state
|
|
26
|
+
extensionPath: string | null
|
|
27
|
+
extensionPackageJson: RaycastPackageJson | null
|
|
28
|
+
currentCommandName: string | null
|
|
29
|
+
// OAuth state
|
|
30
|
+
googleAccessToken?: string
|
|
31
|
+
googleIdToken?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const useStore = create<AppState>(() => ({
|
|
35
|
+
toast: null,
|
|
36
|
+
dialogStack: [],
|
|
37
|
+
// Navigation state
|
|
38
|
+
navigationStack: [],
|
|
39
|
+
// Dev mode state
|
|
40
|
+
devElement: null,
|
|
41
|
+
devRebuildCount: 0,
|
|
42
|
+
// Extension and command state
|
|
43
|
+
extensionPath: null,
|
|
44
|
+
extensionPackageJson: null,
|
|
45
|
+
currentCommandName: null,
|
|
46
|
+
// OAuth state
|
|
47
|
+
googleAccessToken: undefined,
|
|
48
|
+
googleIdToken: undefined,
|
|
49
|
+
}))
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { describe, test, expect } from 'bun:test'
|
|
2
|
+
import { downloadExtension } from './download'
|
|
3
|
+
describe('downloadExtension', () => {
|
|
4
|
+
test('downloads a real raycast extension and returns filenames', async () => {
|
|
5
|
+
// Test with a timeout since it needs to download from the API
|
|
6
|
+
const files = await downloadExtension({
|
|
7
|
+
author: 'xmorse',
|
|
8
|
+
extension: 'spiceblow-database',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const filenames = files.map((f) => f.filename).sort()
|
|
12
|
+
|
|
13
|
+
// Just check we get some files
|
|
14
|
+
expect(filenames).toMatchInlineSnapshot(`
|
|
15
|
+
[
|
|
16
|
+
"assets/extension-icon.png",
|
|
17
|
+
"package.json",
|
|
18
|
+
"search-database.js",
|
|
19
|
+
"search-database.js.map",
|
|
20
|
+
]
|
|
21
|
+
`)
|
|
22
|
+
expect(filenames.length).toBeGreaterThan(0)
|
|
23
|
+
|
|
24
|
+
// Check package.json commands field
|
|
25
|
+
const packageJson = files.find((f) => f.filename === 'package.json')
|
|
26
|
+
const packageData = JSON.parse(packageJson?.buffer.toString()!)
|
|
27
|
+
expect(packageData.commands).toMatchInlineSnapshot(`
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
"description": "Search and update your PostgreSQL or MySQL database",
|
|
31
|
+
"mode": "view",
|
|
32
|
+
"name": "search-database",
|
|
33
|
+
"title": "Manage Database",
|
|
34
|
+
},
|
|
35
|
+
]
|
|
36
|
+
`)
|
|
37
|
+
}, 10000)
|
|
38
|
+
})
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import JSZip from 'jszip'
|
|
2
|
+
import path from 'path'
|
|
3
|
+
|
|
4
|
+
export async function downloadExtension({
|
|
5
|
+
author,
|
|
6
|
+
extension,
|
|
7
|
+
}: {
|
|
8
|
+
author: string
|
|
9
|
+
extension: string
|
|
10
|
+
}): Promise<{ buffer: Buffer; filename: string }[]> {
|
|
11
|
+
// curl -H 'cookie: __raycast_session=<SESSION_TOKEN>' \
|
|
12
|
+
// -H 'accept: */*' \
|
|
13
|
+
// -H 'user-agent: Raycast/1.102.6 (macOS Version 15.6 (Build 24G84))' \
|
|
14
|
+
// -H 'accept-language: en-GB,en;q=0.9' \
|
|
15
|
+
// -H 'authorization: Bearer <AUTH_TOKEN>' \
|
|
16
|
+
// https://backend.raycast.com/api/v1/extensions/mt40/memo/download
|
|
17
|
+
const url = `https://backend.raycast.com/api/v1/extensions/${author}/${extension}/download`
|
|
18
|
+
|
|
19
|
+
const response = await fetch(url, {
|
|
20
|
+
redirect: 'follow',
|
|
21
|
+
headers: {
|
|
22
|
+
accept: '*/*',
|
|
23
|
+
'user-agent': 'Raycast/1.102.6 (macOS Version 15.6 (Build 24G84))',
|
|
24
|
+
'accept-language': 'en-GB,en;q=0.9',
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const arrayBuffer = await response.arrayBuffer()
|
|
29
|
+
|
|
30
|
+
// Check if we got an error response instead of a zip
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
const text = new TextDecoder().decode(arrayBuffer)
|
|
33
|
+
throw new Error(
|
|
34
|
+
`Failed to download extension: ${response.status} - ${text}`,
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const zip = await JSZip.loadAsync(Buffer.from(arrayBuffer))
|
|
39
|
+
|
|
40
|
+
const files: { buffer: Buffer; filename: string }[] = []
|
|
41
|
+
|
|
42
|
+
for (const [filename, file] of Object.entries(zip.files)) {
|
|
43
|
+
if (!file.dir) {
|
|
44
|
+
const buffer = await file.async('nodebuffer')
|
|
45
|
+
const pathParts = filename.split('/')
|
|
46
|
+
const filenameWithoutTopLevel = path.posix.join(...pathParts.slice(1))
|
|
47
|
+
files.push({ buffer, filename: filenameWithoutTopLevel })
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return files
|
|
52
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { describe, test, expect } from 'bun:test'
|
|
2
|
+
import { fetchExtension } from './extension'
|
|
3
|
+
|
|
4
|
+
describe('fetchExtension', () => {
|
|
5
|
+
test('fetches a raycast extension metadata', async () => {
|
|
6
|
+
const extension = await fetchExtension({
|
|
7
|
+
author: 'xmorse',
|
|
8
|
+
extension: 'spiceblow-database',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
// Check basic structure
|
|
12
|
+
expect(extension.id).toBeTruthy()
|
|
13
|
+
expect(extension.name).toBe('spiceblow-database')
|
|
14
|
+
expect(extension.author.handle).toBe('xmorse')
|
|
15
|
+
|
|
16
|
+
// Snapshot the command names
|
|
17
|
+
const commandNames = extension.commands.map((c) => c.name).sort()
|
|
18
|
+
expect(commandNames).toMatchInlineSnapshot(`
|
|
19
|
+
[
|
|
20
|
+
"search-database",
|
|
21
|
+
]
|
|
22
|
+
`)
|
|
23
|
+
}, 10000)
|
|
24
|
+
})
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// curl -H 'accept: application/json' \
|
|
2
|
+
// -H 'content-type: application/json' \
|
|
3
|
+
// -H 'cookie: __raycast_session=REDACTED' \
|
|
4
|
+
// -H 'user-agent: Raycast/1.102.6 (macOS Version 15.6 (Build 24G84))' \
|
|
5
|
+
// -H 'authorization: Bearer REDACTED' \
|
|
6
|
+
// -H 'accept-language: en-GB,en;q=0.9' \
|
|
7
|
+
// https://backend.raycast.com/api/v1/extensions/mt40/memo
|
|
8
|
+
|
|
9
|
+
export async function fetchExtension({
|
|
10
|
+
author,
|
|
11
|
+
extension,
|
|
12
|
+
}: {
|
|
13
|
+
author: string
|
|
14
|
+
extension: string
|
|
15
|
+
}): Promise<ExtensionResponse> {
|
|
16
|
+
const response = await fetch(
|
|
17
|
+
`https://backend.raycast.com/api/v1/extensions/${author}/${extension}`,
|
|
18
|
+
{
|
|
19
|
+
method: 'GET',
|
|
20
|
+
headers: {
|
|
21
|
+
accept: 'application/json',
|
|
22
|
+
'content-type': 'application/json',
|
|
23
|
+
'user-agent': 'Raycast/1.102.6 (macOS Version 15.6 (Build 24G84))',
|
|
24
|
+
'accept-language': 'en-GB,en;q=0.9',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
`Failed to fetch extension: ${response.status} ${response.statusText}`,
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return response.json() as any
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface Author {
|
|
39
|
+
id: string
|
|
40
|
+
name: string
|
|
41
|
+
handle: string
|
|
42
|
+
bio: string | null
|
|
43
|
+
twitter_handle: string | null
|
|
44
|
+
github_handle: string | null
|
|
45
|
+
location: string | null
|
|
46
|
+
initials: string
|
|
47
|
+
avatar_placeholder_color: string
|
|
48
|
+
slack_community_username: string | null
|
|
49
|
+
slack_community_user_id: string | null
|
|
50
|
+
created_at: number
|
|
51
|
+
website_anchor: string | null
|
|
52
|
+
website: string | null
|
|
53
|
+
credits: number
|
|
54
|
+
username: string
|
|
55
|
+
avatar: string | null
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface Icons {
|
|
59
|
+
light: string | null
|
|
60
|
+
dark: string | null
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface Command {
|
|
64
|
+
id: string
|
|
65
|
+
name: string
|
|
66
|
+
title: string
|
|
67
|
+
subtitle: string
|
|
68
|
+
description: string
|
|
69
|
+
keywords: string[]
|
|
70
|
+
mode: string
|
|
71
|
+
disabled_by_default: boolean
|
|
72
|
+
beta: boolean
|
|
73
|
+
icons: Icons
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface ChangelogVersion {
|
|
77
|
+
title: string
|
|
78
|
+
title_link: string | null
|
|
79
|
+
date: string
|
|
80
|
+
markdown: string
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface Changelog {
|
|
84
|
+
versions: ChangelogVersion[]
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
interface ExtensionResponse {
|
|
88
|
+
id: string
|
|
89
|
+
name: string
|
|
90
|
+
native_id: string | null
|
|
91
|
+
seo_categories: string[]
|
|
92
|
+
platforms: string[] | null
|
|
93
|
+
author: Author
|
|
94
|
+
created_at: number
|
|
95
|
+
kill_listed_at: number
|
|
96
|
+
owner: Author
|
|
97
|
+
status: string
|
|
98
|
+
is_new: boolean
|
|
99
|
+
access: string
|
|
100
|
+
store_url: string
|
|
101
|
+
download_count: number
|
|
102
|
+
past_contributors: any[]
|
|
103
|
+
listed: boolean
|
|
104
|
+
title: string
|
|
105
|
+
description: string
|
|
106
|
+
commit_sha: string
|
|
107
|
+
relative_path: string
|
|
108
|
+
api_version: string
|
|
109
|
+
categories: string[]
|
|
110
|
+
prompt_examples: any[]
|
|
111
|
+
metadata_count: number
|
|
112
|
+
updated_at: number
|
|
113
|
+
source_url: string
|
|
114
|
+
readme_url: string
|
|
115
|
+
readme_assets_path: string
|
|
116
|
+
icons: Icons
|
|
117
|
+
commands: Command[]
|
|
118
|
+
tools: any[]
|
|
119
|
+
download_url: string
|
|
120
|
+
contributors: any[]
|
|
121
|
+
metadata: string[]
|
|
122
|
+
changelog: Changelog
|
|
123
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { describe, test, expect } from 'bun:test'
|
|
2
|
+
import { searchStoreListings } from './search'
|
|
3
|
+
|
|
4
|
+
describe('searchStoreListings', () => {
|
|
5
|
+
test('searches for extensions in the store', async () => {
|
|
6
|
+
const results = await searchStoreListings({
|
|
7
|
+
query: 'database',
|
|
8
|
+
perPage: 5,
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
// Check we got results
|
|
12
|
+
expect(results.data).toBeDefined()
|
|
13
|
+
expect(results.data.length).toBeGreaterThan(0)
|
|
14
|
+
expect(results.data.length).toBeLessThanOrEqual(5)
|
|
15
|
+
|
|
16
|
+
// Snapshot the extension names
|
|
17
|
+
const extensionNames = results.data.map((d) => d.name).sort()
|
|
18
|
+
expect(extensionNames).toMatchInlineSnapshot(`
|
|
19
|
+
[
|
|
20
|
+
"discogs",
|
|
21
|
+
"notion",
|
|
22
|
+
"spiceblow-database",
|
|
23
|
+
"tmdb",
|
|
24
|
+
"turso",
|
|
25
|
+
]
|
|
26
|
+
`)
|
|
27
|
+
}, 10000)
|
|
28
|
+
|
|
29
|
+
test.skip('returns results when searching without a query', async () => {
|
|
30
|
+
const results = await searchStoreListings({
|
|
31
|
+
query: '',
|
|
32
|
+
perPage: 5,
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
expect(results.data).toBeDefined()
|
|
36
|
+
expect(results.data.length).toBeGreaterThan(0)
|
|
37
|
+
expect(results.data.length).toBeLessThanOrEqual(5)
|
|
38
|
+
|
|
39
|
+
const extensionNames = results.data.map((d) => d.name).sort()
|
|
40
|
+
expect(extensionNames).toMatchInlineSnapshot(`
|
|
41
|
+
[
|
|
42
|
+
"baidu-ocr",
|
|
43
|
+
"fhir",
|
|
44
|
+
"gitee",
|
|
45
|
+
"mobius-materials",
|
|
46
|
+
"xpf-converter",
|
|
47
|
+
]
|
|
48
|
+
`)
|
|
49
|
+
}, 10000)
|
|
50
|
+
})
|