termcast 1.3.9 → 1.3.16
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.js +1 -1
- package/dist/action-utils.js.map +1 -1
- package/dist/apis/ai.js +1 -1
- package/dist/apis/ai.js.map +1 -1
- package/dist/apis/clipboard.js +2 -2
- package/dist/apis/clipboard.js.map +1 -1
- package/dist/apis/hud.d.ts +2 -2
- package/dist/apis/hud.d.ts.map +1 -1
- package/dist/apis/hud.js +5 -5
- package/dist/apis/hud.js.map +1 -1
- package/dist/apis/oauth.d.ts +1 -1
- package/dist/apis/oauth.d.ts.map +1 -1
- package/dist/apis/oauth.js +8 -8
- package/dist/apis/oauth.js.map +1 -1
- package/dist/apis/preferences.js +4 -4
- package/dist/apis/preferences.js.map +1 -1
- package/dist/apis/toast.d.ts +1 -5
- package/dist/apis/toast.d.ts.map +1 -1
- package/dist/apis/toast.js +26 -20
- package/dist/apis/toast.js.map +1 -1
- package/dist/build.d.ts +2 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +9 -8
- package/dist/build.js.map +1 -1
- package/dist/cli.js +44 -2
- package/dist/cli.js.map +1 -1
- package/dist/colors.d.ts +8 -1
- package/dist/colors.d.ts.map +1 -1
- package/dist/colors.js +12 -0
- package/dist/colors.js.map +1 -1
- package/dist/compile.d.ts +30 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +156 -0
- package/dist/compile.js.map +1 -0
- package/dist/components/actions.d.ts +2 -1
- package/dist/components/actions.d.ts.map +1 -1
- package/dist/components/actions.js +11 -8
- package/dist/components/actions.js.map +1 -1
- package/dist/components/alert.js +4 -4
- package/dist/components/alert.js.map +1 -1
- package/dist/components/command-arguments.d.ts +9 -0
- package/dist/components/command-arguments.d.ts.map +1 -0
- package/dist/components/command-arguments.js +21 -0
- package/dist/components/command-arguments.js.map +1 -0
- package/dist/components/detail.d.ts +3 -3
- package/dist/components/detail.d.ts.map +1 -1
- package/dist/components/detail.js +20 -42
- package/dist/components/detail.js.map +1 -1
- package/dist/components/dropdown.d.ts +2 -1
- package/dist/components/dropdown.d.ts.map +1 -1
- package/dist/components/dropdown.js +81 -25
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/extension-preferences.d.ts.map +1 -1
- package/dist/components/extension-preferences.js +23 -33
- package/dist/components/extension-preferences.js.map +1 -1
- package/dist/components/form/checkbox.d.ts.map +1 -1
- package/dist/components/form/checkbox.js +11 -4
- package/dist/components/form/checkbox.js.map +1 -1
- package/dist/components/form/date-picker.d.ts.map +1 -1
- package/dist/components/form/date-picker.js +18 -31
- package/dist/components/form/date-picker.js.map +1 -1
- package/dist/components/form/description.d.ts +2 -0
- package/dist/components/form/description.d.ts.map +1 -1
- package/dist/components/form/description.js +21 -3
- package/dist/components/form/description.js.map +1 -1
- package/dist/components/form/dropdown.d.ts.map +1 -1
- package/dist/components/form/dropdown.js +17 -32
- package/dist/components/form/dropdown.js.map +1 -1
- package/dist/components/form/file-autocomplete.d.ts +7 -4
- package/dist/components/form/file-autocomplete.d.ts.map +1 -1
- package/dist/components/form/file-autocomplete.js +56 -48
- package/dist/components/form/file-autocomplete.js.map +1 -1
- package/dist/components/form/file-picker.d.ts +5 -0
- package/dist/components/form/file-picker.d.ts.map +1 -1
- package/dist/components/form/file-picker.js +48 -51
- package/dist/components/form/file-picker.js.map +1 -1
- package/dist/components/form/form-end.js +1 -1
- package/dist/components/form/form-end.js.map +1 -1
- package/dist/components/form/form-ref.d.ts +43 -0
- package/dist/components/form/form-ref.d.ts.map +1 -0
- package/dist/components/form/form-ref.js +53 -0
- package/dist/components/form/form-ref.js.map +1 -0
- package/dist/components/form/index.d.ts +16 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +90 -27
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/form/password-field.d.ts.map +1 -1
- package/dist/components/form/password-field.js +33 -17
- package/dist/components/form/password-field.js.map +1 -1
- package/dist/components/form/separator.js +1 -1
- package/dist/components/form/separator.js.map +1 -1
- package/dist/components/form/tagpicker.d.ts +1 -1
- package/dist/components/form/tagpicker.d.ts.map +1 -1
- package/dist/components/form/text-area.d.ts.map +1 -1
- package/dist/components/form/text-area.js +33 -16
- package/dist/components/form/text-area.js.map +1 -1
- package/dist/components/form/text-field.d.ts.map +1 -1
- package/dist/components/form/text-field.js +38 -18
- package/dist/components/form/text-field.js.map +1 -1
- package/dist/components/form/use-form-navigation.d.ts +4 -0
- package/dist/components/form/use-form-navigation.d.ts.map +1 -1
- package/dist/components/form/use-form-navigation.js +35 -18
- package/dist/components/form/use-form-navigation.js.map +1 -1
- package/dist/components/form/with-left-border.d.ts.map +1 -1
- package/dist/components/form/with-left-border.js +3 -3
- package/dist/components/form/with-left-border.js.map +1 -1
- package/dist/components/icon.d.ts +3 -1
- package/dist/components/icon.d.ts.map +1 -1
- package/dist/components/icon.js +494 -469
- package/dist/components/icon.js.map +1 -1
- package/dist/components/image.js +1 -1
- package/dist/components/image.js.map +1 -1
- package/dist/components/list.d.ts +12 -8
- package/dist/components/list.d.ts.map +1 -1
- package/dist/components/list.js +172 -40
- package/dist/components/list.js.map +1 -1
- package/dist/components/loading-bar.js +2 -2
- package/dist/components/loading-bar.js.map +1 -1
- package/dist/components/menubar-extra.d.ts +1 -1
- package/dist/components/menubar-extra.d.ts.map +1 -1
- package/dist/components/menubar-extra.js +2 -2
- package/dist/components/menubar-extra.js.map +1 -1
- package/dist/descendants.d.ts.map +1 -1
- package/dist/descendants.js +8 -5
- package/dist/descendants.js.map +1 -1
- package/dist/e2e-node.d.ts +2 -0
- package/dist/e2e-node.d.ts.map +1 -1
- package/dist/e2e-node.js +14 -0
- package/dist/e2e-node.js.map +1 -1
- package/dist/examples/action-show-in-finder.js +3 -3
- package/dist/examples/action-show-in-finder.js.map +1 -1
- package/dist/examples/environment-test.js +4 -4
- package/dist/examples/environment-test.js.map +1 -1
- package/dist/examples/error-boundary.js +5 -5
- package/dist/examples/error-boundary.js.map +1 -1
- package/dist/examples/form-basic.d.ts.map +1 -1
- package/dist/examples/form-basic.js +6 -6
- package/dist/examples/form-basic.js.map +1 -1
- package/dist/examples/form-dropdown.js +3 -3
- package/dist/examples/form-dropdown.js.map +1 -1
- package/dist/examples/form-scroll.d.ts +2 -0
- package/dist/examples/form-scroll.d.ts.map +1 -0
- package/dist/examples/form-scroll.js +8 -0
- package/dist/examples/form-scroll.js.map +1 -0
- package/dist/examples/form-tagpicker.js +3 -3
- package/dist/examples/form-tagpicker.js.map +1 -1
- package/dist/examples/internal/descendants-filtering.js +10 -5
- package/dist/examples/internal/descendants-filtering.js.map +1 -1
- package/dist/examples/internal/descendants.js +13 -6
- package/dist/examples/internal/descendants.js.map +1 -1
- package/dist/examples/internal/rhf-custom-ref.d.ts +2 -0
- package/dist/examples/internal/rhf-custom-ref.d.ts.map +1 -0
- package/dist/examples/internal/rhf-custom-ref.js +67 -0
- package/dist/examples/internal/rhf-custom-ref.js.map +1 -0
- package/dist/examples/internal/scrollbox-demo.js +4 -8
- package/dist/examples/internal/scrollbox-demo.js.map +1 -1
- package/dist/examples/internal/scrollbox-with-descendants.d.ts +2 -0
- package/dist/examples/internal/scrollbox-with-descendants.d.ts.map +1 -0
- package/dist/examples/internal/scrollbox-with-descendants.js +63 -0
- package/dist/examples/internal/scrollbox-with-descendants.js.map +1 -0
- package/dist/examples/internal/simple-dialog.js +7 -7
- package/dist/examples/internal/simple-dialog.js.map +1 -1
- package/dist/examples/internal/simple-scrollbox.d.ts +2 -0
- package/dist/examples/internal/simple-scrollbox.d.ts.map +1 -0
- package/dist/examples/internal/simple-scrollbox.js +25 -0
- package/dist/examples/internal/simple-scrollbox.js.map +1 -0
- package/dist/examples/internal/text-stacking.js +4 -2
- package/dist/examples/internal/text-stacking.js.map +1 -1
- package/dist/examples/list-dropdown-default.js +3 -3
- package/dist/examples/list-dropdown-default.js.map +1 -1
- package/dist/examples/list-fetch-data.js +3 -3
- package/dist/examples/list-fetch-data.js.map +1 -1
- package/dist/examples/list-scrollbox.d.ts +2 -0
- package/dist/examples/list-scrollbox.d.ts.map +1 -0
- package/dist/examples/list-scrollbox.js +29 -0
- package/dist/examples/list-scrollbox.js.map +1 -0
- package/dist/examples/list-with-detail.js +2 -2
- package/dist/examples/list-with-detail.js.map +1 -1
- package/dist/examples/list-with-dropdown.js +2 -2
- package/dist/examples/list-with-dropdown.js.map +1 -1
- package/dist/examples/list-with-sections.js +6 -6
- package/dist/examples/list-with-sections.js.map +1 -1
- package/dist/examples/miscellaneous.js +14 -14
- package/dist/examples/miscellaneous.js.map +1 -1
- package/dist/examples/nested-navigation.js +9 -7
- package/dist/examples/nested-navigation.js.map +1 -1
- package/dist/examples/preferences-test.js +4 -4
- package/dist/examples/preferences-test.js.map +1 -1
- package/dist/examples/simple-dropdown.js +4 -4
- package/dist/examples/simple-dropdown.js.map +1 -1
- package/dist/examples/simple-file-picker.js +3 -3
- package/dist/examples/simple-file-picker.js.map +1 -1
- package/dist/examples/simple-grid.js +2 -2
- package/dist/examples/simple-grid.js.map +1 -1
- package/dist/examples/simple-hud.js +4 -4
- package/dist/examples/simple-hud.js.map +1 -1
- package/dist/examples/simple-list-search.js +21 -5
- package/dist/examples/simple-list-search.js.map +1 -1
- package/dist/examples/simple-list.js +4 -4
- package/dist/examples/simple-list.js.map +1 -1
- package/dist/examples/simple-navigation.js +9 -7
- package/dist/examples/simple-navigation.js.map +1 -1
- package/dist/examples/store.js +1 -1
- package/dist/examples/store.js.map +1 -1
- package/dist/examples/submodule-diff.d.ts +2 -0
- package/dist/examples/submodule-diff.d.ts.map +1 -0
- package/dist/examples/submodule-diff.js +99 -0
- package/dist/examples/submodule-diff.js.map +1 -0
- package/dist/examples/tanstack-demo.js +3 -3
- package/dist/examples/tanstack-demo.js.map +1 -1
- package/dist/examples/use-promise-demo.js +3 -3
- package/dist/examples/use-promise-demo.js.map +1 -1
- package/dist/extensions/dev.d.ts +8 -0
- package/dist/extensions/dev.d.ts.map +1 -1
- package/dist/extensions/dev.js +60 -35
- package/dist/extensions/dev.js.map +1 -1
- package/dist/extensions/home.d.ts.map +1 -1
- package/dist/extensions/home.js +22 -97
- package/dist/extensions/home.js.map +1 -1
- package/dist/extensions/store.js +2 -2
- package/dist/extensions/store.js.map +1 -1
- package/dist/globals.js +1 -1
- package/dist/globals.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-action-panel.js +1 -1
- package/dist/hooks/use-action-panel.js.map +1 -1
- package/dist/hooks/use-unstable-ai.js +1 -1
- package/dist/hooks/use-unstable-ai.js.map +1 -1
- package/dist/index.d.ts +57 -55
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -38
- package/dist/index.js.map +1 -1
- package/dist/internal/date-picker-widget.d.ts.map +1 -1
- package/dist/internal/date-picker-widget.js +56 -48
- package/dist/internal/date-picker-widget.js.map +1 -1
- package/dist/internal/dialog.d.ts +3 -3
- package/dist/internal/dialog.d.ts.map +1 -1
- package/dist/internal/dialog.js +10 -10
- package/dist/internal/dialog.js.map +1 -1
- package/dist/internal/error-handler.js +2 -2
- package/dist/internal/error-handler.js.map +1 -1
- package/dist/internal/focus-context.d.ts +1 -1
- package/dist/internal/focus-context.d.ts.map +1 -1
- package/dist/internal/navigation.d.ts +1 -1
- package/dist/internal/navigation.d.ts.map +1 -1
- package/dist/internal/navigation.js +2 -2
- package/dist/internal/navigation.js.map +1 -1
- package/dist/internal/providers.d.ts +2 -2
- package/dist/internal/providers.d.ts.map +1 -1
- package/dist/internal/providers.js +9 -9
- package/dist/internal/providers.js.map +1 -1
- package/dist/internal/scrollbox.d.ts +12 -0
- package/dist/internal/scrollbox.d.ts.map +1 -0
- package/dist/internal/scrollbox.js +34 -0
- package/dist/internal/scrollbox.js.map +1 -0
- package/dist/preload.js +1 -1
- package/dist/preload.js.map +1 -1
- package/dist/release.d.ts +11 -0
- package/dist/release.d.ts.map +1 -0
- package/dist/release.js +113 -0
- package/dist/release.js.map +1 -0
- package/dist/state.d.ts +1 -0
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +1 -0
- package/dist/state.js.map +1 -1
- package/dist/theme.d.ts +11 -8
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +31 -8
- package/dist/theme.js.map +1 -1
- package/dist/utils/run-command.d.ts +22 -0
- package/dist/utils/run-command.d.ts.map +1 -0
- package/dist/utils/run-command.js +127 -0
- package/dist/utils/run-command.js.map +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +6 -4
- package/dist/utils.js.map +1 -1
- package/package.json +13 -8
- package/src/apis/toast.tsx +38 -17
- package/src/build.tsx +5 -3
- package/src/cli.tsx +46 -0
- package/src/colors.tsx +22 -1
- package/src/compile.tsx +219 -0
- package/src/components/actions.tsx +7 -1
- package/src/components/command-arguments.tsx +81 -0
- package/src/components/detail.tsx +26 -58
- package/src/components/dropdown.tsx +108 -23
- package/src/components/extension-preferences.tsx +55 -35
- package/src/components/form/checkbox.tsx +13 -5
- package/src/components/form/date-picker.tsx +24 -29
- package/src/components/form/description.tsx +35 -7
- package/src/components/form/dropdown.tsx +16 -30
- package/src/components/form/file-autocomplete.tsx +87 -77
- package/src/components/form/file-picker.tsx +69 -57
- package/src/components/form/form-ref.tsx +68 -0
- package/src/components/form/index.tsx +152 -41
- package/src/components/form/password-field.tsx +35 -22
- package/src/components/form/text-area.tsx +78 -58
- package/src/components/form/text-field.tsx +82 -61
- package/src/components/form/use-form-navigation.tsx +43 -23
- package/src/components/form/with-left-border.tsx +2 -1
- package/src/components/icon.tsx +497 -469
- package/src/components/list.tsx +279 -112
- package/src/components/loading-bar.tsx +1 -1
- package/src/descendants.tsx +15 -5
- package/src/e2e-node.tsx +16 -0
- package/src/examples/action-show-in-finder.tsx +1 -1
- package/src/examples/environment-test.tsx +1 -1
- package/src/examples/error-boundary.tsx +1 -1
- package/src/examples/file-autocomplete.vitest.tsx +245 -0
- package/src/examples/form-basic.tsx +12 -12
- package/src/examples/form-basic.vitest.tsx +297 -671
- package/src/examples/form-dropdown.tsx +1 -1
- package/src/examples/form-dropdown.vitest.tsx +353 -221
- package/src/examples/form-scroll.tsx +56 -0
- package/src/examples/form-scroll.vitest.tsx +228 -0
- package/src/examples/form-tagpicker.tsx +1 -1
- package/src/examples/form-tagpicker.vitest.tsx +438 -193
- package/src/examples/internal/descendants-filtering.tsx +13 -5
- package/src/examples/internal/descendants.tsx +17 -5
- package/src/examples/internal/rhf-custom-ref.tsx +152 -0
- package/src/examples/internal/scrollbox-demo.tsx +15 -7
- package/src/examples/internal/scrollbox-with-descendants.tsx +94 -0
- package/src/examples/internal/simple-dialog.tsx +1 -1
- package/src/examples/internal/simple-scrollbox.tsx +58 -0
- package/src/examples/internal/simple-scrollbox.vitest.tsx +104 -0
- package/src/examples/internal/text-stacking.tsx +4 -2
- package/src/examples/list-dropdown-default.tsx +1 -1
- package/src/examples/list-dropdown-default.vitest.tsx +136 -71
- package/src/examples/list-fetch-data.tsx +1 -1
- package/src/examples/list-fetch-data.vitest.tsx +42 -33
- package/src/examples/list-scrollbox.tsx +46 -0
- package/src/examples/list-scrollbox.vitest.tsx +103 -0
- package/src/examples/list-with-detail.tsx +1 -1
- package/src/examples/list-with-detail.vitest.tsx +290 -294
- package/src/examples/list-with-dropdown.tsx +1 -1
- package/src/examples/list-with-dropdown.vitest.tsx +190 -150
- package/src/examples/list-with-sections.tsx +12 -1
- package/src/examples/list-with-sections.vitest.tsx +390 -218
- package/src/examples/miscellaneous.tsx +1 -1
- package/src/examples/nested-navigation.tsx +7 -5
- package/src/examples/preferences-test.tsx +1 -1
- package/src/examples/simple-dropdown.tsx +1 -1
- package/src/examples/simple-file-picker.tsx +1 -1
- package/src/examples/simple-file-picker.vitest.tsx +533 -127
- package/src/examples/simple-grid.tsx +1 -1
- package/src/examples/simple-grid.vitest.tsx +258 -234
- package/src/examples/simple-hud.tsx +1 -1
- package/src/examples/simple-list-search.tsx +42 -1
- package/src/examples/simple-list.tsx +1 -1
- package/src/examples/simple-navigation.tsx +7 -5
- package/src/examples/simple-navigation.vitest.tsx +434 -238
- package/src/examples/store.tsx +1 -1
- package/src/examples/store.vitest.tsx +31 -14
- package/src/examples/submodule-diff.tsx +153 -0
- package/src/examples/tanstack-demo.tsx +1 -1
- package/src/examples/use-promise-demo.tsx +1 -1
- package/src/extensions/dev.tsx +76 -38
- package/src/extensions/dev.vitest.tsx +220 -0
- package/src/extensions/home.tsx +20 -121
- package/src/globals.ts +1 -1
- package/src/index.tsx +12 -25
- package/src/internal/date-picker-widget.tsx +56 -46
- package/src/internal/dialog.tsx +6 -6
- package/src/internal/providers.tsx +1 -1
- package/src/internal/scrollbox.tsx +63 -0
- package/src/release.tsx +159 -0
- package/src/state.tsx +2 -0
- package/src/store-api/search.test.tsx +4 -13
- package/src/theme.tsx +33 -8
- package/src/utils/run-command.tsx +204 -0
- package/src/utils.tsx +6 -4
- package/dist/ai.d.ts +0 -104
- package/dist/ai.d.ts.map +0 -1
- package/dist/ai.js +0 -135
- package/dist/ai.js.map +0 -1
- package/dist/apis/cache.test.d.ts +0 -2
- package/dist/apis/cache.test.d.ts.map +0 -1
- package/dist/apis/cache.test.js +0 -246
- package/dist/apis/cache.test.js.map +0 -1
- package/dist/apis/localstorage.test.d.ts +0 -2
- package/dist/apis/localstorage.test.d.ts.map +0 -1
- package/dist/apis/localstorage.test.js +0 -131
- package/dist/apis/localstorage.test.js.map +0 -1
- package/dist/apis/toast.test.d.ts +0 -2
- package/dist/apis/toast.test.d.ts.map +0 -1
- package/dist/apis/toast.test.js +0 -67
- package/dist/apis/toast.test.js.map +0 -1
- package/dist/build.test.d.ts +0 -2
- package/dist/build.test.d.ts.map +0 -1
- package/dist/build.test.js +0 -73
- package/dist/build.test.js.map +0 -1
- package/dist/cache.d.ts +0 -32
- package/dist/cache.d.ts.map +0 -1
- package/dist/cache.js +0 -205
- package/dist/cache.js.map +0 -1
- package/dist/cache.test.d.ts +0 -2
- package/dist/cache.test.d.ts.map +0 -1
- package/dist/cache.test.js +0 -246
- package/dist/cache.test.js.map +0 -1
- package/dist/clipboard.d.ts +0 -36
- package/dist/clipboard.d.ts.map +0 -1
- package/dist/clipboard.js +0 -154
- package/dist/clipboard.js.map +0 -1
- package/dist/components/form/form-type-only.d.ts +0 -174
- package/dist/components/form/form-type-only.d.ts.map +0 -1
- package/dist/components/form/form-type-only.js +0 -2
- package/dist/components/form/form-type-only.js.map +0 -1
- package/dist/components/form/use-form-handling.d.ts +0 -4
- package/dist/components/form/use-form-handling.d.ts.map +0 -1
- package/dist/components/form/use-form-handling.js +0 -37
- package/dist/components/form/use-form-handling.js.map +0 -1
- package/dist/dev-ui.d.ts +0 -7
- package/dist/dev-ui.d.ts.map +0 -1
- package/dist/dev-ui.js +0 -118
- package/dist/dev-ui.js.map +0 -1
- package/dist/environment.d.ts +0 -63
- package/dist/environment.d.ts.map +0 -1
- package/dist/environment.js +0 -189
- package/dist/environment.js.map +0 -1
- package/dist/examples/datepicker.d.ts +0 -2
- package/dist/examples/datepicker.d.ts.map +0 -1
- package/dist/examples/datepicker.js +0 -344
- package/dist/examples/datepicker.js.map +0 -1
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts +0 -2
- package/dist/examples/form-basic-arrow-keys.vitest.d.ts.map +0 -1
- package/dist/examples/form-basic-arrow-keys.vitest.js +0 -46
- package/dist/examples/form-basic-arrow-keys.vitest.js.map +0 -1
- package/dist/examples/form-basic.vitest.d.ts +0 -2
- package/dist/examples/form-basic.vitest.d.ts.map +0 -1
- package/dist/examples/form-basic.vitest.js +0 -995
- package/dist/examples/form-basic.vitest.js.map +0 -1
- package/dist/examples/form-dropdown-with-sections.d.ts +0 -2
- package/dist/examples/form-dropdown-with-sections.d.ts.map +0 -1
- package/dist/examples/form-dropdown-with-sections.js +0 -13
- package/dist/examples/form-dropdown-with-sections.js.map +0 -1
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts +0 -2
- package/dist/examples/form-dropdown-with-sections.vitest.d.ts.map +0 -1
- package/dist/examples/form-dropdown-with-sections.vitest.js +0 -75
- package/dist/examples/form-dropdown-with-sections.vitest.js.map +0 -1
- package/dist/examples/form-dropdown.vitest.d.ts +0 -2
- package/dist/examples/form-dropdown.vitest.d.ts.map +0 -1
- package/dist/examples/form-dropdown.vitest.js +0 -722
- package/dist/examples/form-dropdown.vitest.js.map +0 -1
- package/dist/examples/form-multiselect-dropdown.d.ts +0 -2
- package/dist/examples/form-multiselect-dropdown.d.ts.map +0 -1
- package/dist/examples/form-multiselect-dropdown.js +0 -13
- package/dist/examples/form-multiselect-dropdown.js.map +0 -1
- package/dist/examples/form-tagpicker.vitest.d.ts +0 -2
- package/dist/examples/form-tagpicker.vitest.d.ts.map +0 -1
- package/dist/examples/form-tagpicker.vitest.js +0 -491
- package/dist/examples/form-tagpicker.vitest.js.map +0 -1
- package/dist/examples/internal/nested-boxes.d.ts +0 -2
- package/dist/examples/internal/nested-boxes.d.ts.map +0 -1
- package/dist/examples/internal/nested-boxes.js +0 -7
- package/dist/examples/internal/nested-boxes.js.map +0 -1
- package/dist/examples/internal/unicode-square-repro.d.ts +0 -2
- package/dist/examples/internal/unicode-square-repro.d.ts.map +0 -1
- package/dist/examples/internal/unicode-square-repro.js +0 -7
- package/dist/examples/internal/unicode-square-repro.js.map +0 -1
- package/dist/examples/list-dropdown-default.vitest.d.ts +0 -2
- package/dist/examples/list-dropdown-default.vitest.d.ts.map +0 -1
- package/dist/examples/list-dropdown-default.vitest.js +0 -164
- package/dist/examples/list-dropdown-default.vitest.js.map +0 -1
- package/dist/examples/list-fetch-data.vitest.d.ts +0 -2
- package/dist/examples/list-fetch-data.vitest.d.ts.map +0 -1
- package/dist/examples/list-fetch-data.vitest.js +0 -103
- package/dist/examples/list-fetch-data.vitest.js.map +0 -1
- package/dist/examples/list-filter-navigation.d.ts +0 -2
- package/dist/examples/list-filter-navigation.d.ts.map +0 -1
- package/dist/examples/list-filter-navigation.js +0 -8
- package/dist/examples/list-filter-navigation.js.map +0 -1
- package/dist/examples/list-with-detail.vitest.d.ts +0 -2
- package/dist/examples/list-with-detail.vitest.d.ts.map +0 -1
- package/dist/examples/list-with-detail.vitest.js +0 -438
- package/dist/examples/list-with-detail.vitest.js.map +0 -1
- package/dist/examples/list-with-dropdown.vitest.d.ts +0 -2
- package/dist/examples/list-with-dropdown.vitest.d.ts.map +0 -1
- package/dist/examples/list-with-dropdown.vitest.js +0 -297
- package/dist/examples/list-with-dropdown.vitest.js.map +0 -1
- package/dist/examples/list-with-sections.vitest.d.ts +0 -2
- package/dist/examples/list-with-sections.vitest.d.ts.map +0 -1
- package/dist/examples/list-with-sections.vitest.js +0 -441
- package/dist/examples/list-with-sections.vitest.js.map +0 -1
- package/dist/examples/simple-file-picker.vitest.d.ts +0 -2
- package/dist/examples/simple-file-picker.vitest.d.ts.map +0 -1
- package/dist/examples/simple-file-picker.vitest.js +0 -277
- package/dist/examples/simple-file-picker.vitest.js.map +0 -1
- package/dist/examples/simple-grid.vitest.d.ts +0 -2
- package/dist/examples/simple-grid.vitest.d.ts.map +0 -1
- package/dist/examples/simple-grid.vitest.js +0 -498
- package/dist/examples/simple-grid.vitest.js.map +0 -1
- package/dist/examples/simple-navigation.vitest.d.ts +0 -2
- package/dist/examples/simple-navigation.vitest.d.ts.map +0 -1
- package/dist/examples/simple-navigation.vitest.js +0 -522
- package/dist/examples/simple-navigation.vitest.js.map +0 -1
- package/dist/examples/store.vitest.d.ts +0 -2
- package/dist/examples/store.vitest.d.ts.map +0 -1
- package/dist/examples/store.vitest.js +0 -52
- package/dist/examples/store.vitest.js.map +0 -1
- package/dist/home-command.d.ts +0 -8
- package/dist/home-command.d.ts.map +0 -1
- package/dist/home-command.js +0 -181
- package/dist/home-command.js.map +0 -1
- package/dist/hooks/hooks.test.d.ts +0 -2
- package/dist/hooks/hooks.test.d.ts.map +0 -1
- package/dist/hooks/hooks.test.js +0 -37
- package/dist/hooks/hooks.test.js.map +0 -1
- package/dist/hover-repro.d.ts +0 -2
- package/dist/hover-repro.d.ts.map +0 -1
- package/dist/hover-repro.js +0 -20
- package/dist/hover-repro.js.map +0 -1
- package/dist/localstorage.d.ts +0 -13
- package/dist/localstorage.d.ts.map +0 -1
- package/dist/localstorage.js +0 -190
- package/dist/localstorage.js.map +0 -1
- package/dist/localstorage.test.d.ts +0 -2
- package/dist/localstorage.test.d.ts.map +0 -1
- package/dist/localstorage.test.js +0 -131
- package/dist/localstorage.test.js.map +0 -1
- package/dist/oauth.d.ts +0 -142
- package/dist/oauth.d.ts.map +0 -1
- package/dist/oauth.js +0 -551
- package/dist/oauth.js.map +0 -1
- package/dist/preferences.d.ts +0 -23
- package/dist/preferences.d.ts.map +0 -1
- package/dist/preferences.js +0 -105
- package/dist/preferences.js.map +0 -1
- package/dist/store-api/download.test.d.ts +0 -2
- package/dist/store-api/download.test.d.ts.map +0 -1
- package/dist/store-api/download.test.js +0 -36
- package/dist/store-api/download.test.js.map +0 -1
- package/dist/store-api/extension.test.d.ts +0 -2
- package/dist/store-api/extension.test.d.ts.map +0 -1
- package/dist/store-api/extension.test.js +0 -22
- package/dist/store-api/extension.test.js.map +0 -1
- package/dist/store-api/search.test.d.ts +0 -2
- package/dist/store-api/search.test.d.ts.map +0 -1
- package/dist/store-api/search.test.js +0 -45
- package/dist/store-api/search.test.js.map +0 -1
- package/dist/store.d.ts +0 -21
- package/dist/store.d.ts.map +0 -1
- package/dist/store.js +0 -84
- package/dist/store.js.map +0 -1
- package/dist/toast.d.ts +0 -44
- package/dist/toast.d.ts.map +0 -1
- package/dist/toast.js +0 -221
- package/dist/toast.js.map +0 -1
- package/dist/utils.test.d.ts +0 -2
- package/dist/utils.test.d.ts.map +0 -1
- package/dist/utils.test.js +0 -152
- package/dist/utils.test.js.map +0 -1
- package/dist/window.d.ts +0 -12
- package/dist/window.d.ts.map +0 -1
- package/dist/window.js +0 -48
- package/dist/window.js.map +0 -1
package/src/release.tsx
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import { execSync, exec } from 'node:child_process'
|
|
4
|
+
import { promisify } from 'node:util'
|
|
5
|
+
|
|
6
|
+
const execAsync = promisify(exec)
|
|
7
|
+
import {
|
|
8
|
+
compileExtension,
|
|
9
|
+
ALL_TARGETS,
|
|
10
|
+
targetToFileSuffix,
|
|
11
|
+
getArchiveExtension,
|
|
12
|
+
type CompileTarget,
|
|
13
|
+
} from './compile'
|
|
14
|
+
|
|
15
|
+
export interface ReleaseOptions {
|
|
16
|
+
extensionPath: string
|
|
17
|
+
single?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ReleaseResult {
|
|
21
|
+
success: boolean
|
|
22
|
+
version: string
|
|
23
|
+
uploadedFiles: string[]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function releaseExtension({
|
|
27
|
+
extensionPath,
|
|
28
|
+
single = false,
|
|
29
|
+
}: ReleaseOptions): Promise<ReleaseResult> {
|
|
30
|
+
const resolvedPath = path.resolve(extensionPath)
|
|
31
|
+
|
|
32
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
33
|
+
throw new Error(`Extension path does not exist: ${resolvedPath}`)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const packageJsonPath = path.join(resolvedPath, 'package.json')
|
|
37
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
38
|
+
throw new Error(`No package.json found at: ${packageJsonPath}`)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'))
|
|
42
|
+
const name = packageJson.name
|
|
43
|
+
const version = packageJson.version
|
|
44
|
+
|
|
45
|
+
if (!name) {
|
|
46
|
+
throw new Error('package.json must have a name field')
|
|
47
|
+
}
|
|
48
|
+
if (!version) {
|
|
49
|
+
throw new Error('package.json must have a version field')
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const tag = `${name}@${version}`
|
|
53
|
+
console.log(`Preparing release ${tag}...`)
|
|
54
|
+
|
|
55
|
+
// Check if release already exists
|
|
56
|
+
try {
|
|
57
|
+
const checkResult = execSync(`gh release view "${tag}" --json tagName`, {
|
|
58
|
+
cwd: resolvedPath,
|
|
59
|
+
encoding: 'utf-8',
|
|
60
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
61
|
+
})
|
|
62
|
+
if (checkResult.includes(tag)) {
|
|
63
|
+
throw new Error(`Release ${tag} already exists. Bump the version in package.json first.`)
|
|
64
|
+
}
|
|
65
|
+
} catch (error: any) {
|
|
66
|
+
if (error.message?.includes('already exists')) {
|
|
67
|
+
throw error
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Install dependencies for all platforms
|
|
72
|
+
console.log('Installing dependencies for all platforms...')
|
|
73
|
+
execSync('bun install --os="*" --cpu="*"', {
|
|
74
|
+
cwd: resolvedPath,
|
|
75
|
+
stdio: 'inherit',
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
const targets: CompileTarget[] = single
|
|
79
|
+
? ALL_TARGETS.filter((t) => t.os === process.platform && t.arch === process.arch)
|
|
80
|
+
: ALL_TARGETS
|
|
81
|
+
|
|
82
|
+
if (targets.length === 0) {
|
|
83
|
+
throw new Error(`No targets found for current platform: ${process.platform}-${process.arch}`)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const outputDir = path.join(resolvedPath, 'dist')
|
|
87
|
+
if (!fs.existsSync(outputDir)) {
|
|
88
|
+
fs.mkdirSync(outputDir, { recursive: true })
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Compile for all targets in parallel
|
|
92
|
+
console.log(`Compiling for ${targets.length} targets in parallel...`)
|
|
93
|
+
const compileResults = await Promise.all(
|
|
94
|
+
targets.map(async (target) => {
|
|
95
|
+
const suffix = targetToFileSuffix(target)
|
|
96
|
+
const binaryName = `${name}-${suffix}`
|
|
97
|
+
const outfile = path.join(outputDir, binaryName)
|
|
98
|
+
|
|
99
|
+
const result = await compileExtension({
|
|
100
|
+
extensionPath: resolvedPath,
|
|
101
|
+
outfile,
|
|
102
|
+
minify: true,
|
|
103
|
+
target,
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
console.log(` ✓ ${path.basename(result.outfile)}`)
|
|
107
|
+
|
|
108
|
+
const archiveExt = getArchiveExtension(target)
|
|
109
|
+
const archiveName = `${name}-${suffix}${archiveExt}`
|
|
110
|
+
const archivePath = path.join(outputDir, archiveName)
|
|
111
|
+
|
|
112
|
+
if (archiveExt === '.tar.gz') {
|
|
113
|
+
await execAsync(`tar -czvf "${archiveName}" "${binaryName}"`, { cwd: outputDir })
|
|
114
|
+
} else {
|
|
115
|
+
await execAsync(`zip "${archiveName}" "${binaryName}"`, { cwd: outputDir })
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
fs.unlinkSync(result.outfile)
|
|
119
|
+
console.log(` ✓ ${archiveName}`)
|
|
120
|
+
|
|
121
|
+
return archivePath
|
|
122
|
+
}),
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
// Create GitHub release
|
|
126
|
+
console.log(`\nCreating GitHub release ${tag}...`)
|
|
127
|
+
try {
|
|
128
|
+
execSync(`gh release create "${tag}" --title "${tag}" --notes "Release ${version}"`, {
|
|
129
|
+
cwd: resolvedPath,
|
|
130
|
+
stdio: 'inherit',
|
|
131
|
+
})
|
|
132
|
+
} catch (error: any) {
|
|
133
|
+
throw new Error(`Failed to create release: ${error.message}`)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Upload all binaries in parallel
|
|
137
|
+
console.log('\nUploading binaries in parallel...')
|
|
138
|
+
await Promise.all(
|
|
139
|
+
compileResults.map(async (file) => {
|
|
140
|
+
const fileName = path.basename(file)
|
|
141
|
+
await execAsync(`gh release upload "${tag}" "${file}" --clobber`, {
|
|
142
|
+
cwd: resolvedPath,
|
|
143
|
+
})
|
|
144
|
+
console.log(` ✓ ${fileName}`)
|
|
145
|
+
}),
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
console.log(`\n✅ Release ${tag} published successfully!`)
|
|
151
|
+
console.log(` ${compileResults.length} binaries uploaded`)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
return {
|
|
155
|
+
success: true,
|
|
156
|
+
version,
|
|
157
|
+
uploadedFiles: compileResults,
|
|
158
|
+
}
|
|
159
|
+
}
|
package/src/state.tsx
CHANGED
|
@@ -26,6 +26,7 @@ interface AppState {
|
|
|
26
26
|
extensionPath: string | null
|
|
27
27
|
extensionPackageJson: RaycastPackageJson | null
|
|
28
28
|
currentCommandName: string | null
|
|
29
|
+
currentCommandArguments: Record<string, string> | null
|
|
29
30
|
// OAuth state
|
|
30
31
|
googleAccessToken?: string
|
|
31
32
|
googleIdToken?: string
|
|
@@ -43,6 +44,7 @@ export const useStore = create<AppState>(() => ({
|
|
|
43
44
|
extensionPath: null,
|
|
44
45
|
extensionPackageJson: null,
|
|
45
46
|
currentCommandName: null,
|
|
47
|
+
currentCommandArguments: null,
|
|
46
48
|
// OAuth state
|
|
47
49
|
googleAccessToken: undefined,
|
|
48
50
|
googleIdToken: undefined,
|
|
@@ -4,26 +4,17 @@ import { searchStoreListings } from './search'
|
|
|
4
4
|
describe('searchStoreListings', () => {
|
|
5
5
|
test('searches for extensions in the store', async () => {
|
|
6
6
|
const results = await searchStoreListings({
|
|
7
|
-
query: 'database',
|
|
7
|
+
query: 'spiceblow-database',
|
|
8
8
|
perPage: 5,
|
|
9
9
|
})
|
|
10
10
|
|
|
11
11
|
// Check we got results
|
|
12
12
|
expect(results.data).toBeDefined()
|
|
13
13
|
expect(results.data.length).toBeGreaterThan(0)
|
|
14
|
-
expect(results.data.length).toBeLessThanOrEqual(5)
|
|
15
14
|
|
|
16
|
-
//
|
|
17
|
-
const extensionNames = results.data.map((d) => d.name)
|
|
18
|
-
expect(extensionNames).
|
|
19
|
-
[
|
|
20
|
-
"discogs",
|
|
21
|
-
"notion",
|
|
22
|
-
"spiceblow-database",
|
|
23
|
-
"tmdb",
|
|
24
|
-
"turso",
|
|
25
|
-
]
|
|
26
|
-
`)
|
|
15
|
+
// Verify the specific extension is found
|
|
16
|
+
const extensionNames = results.data.map((d) => d.name)
|
|
17
|
+
expect(extensionNames).toContain('spiceblow-database')
|
|
27
18
|
}, 10000)
|
|
28
19
|
|
|
29
20
|
test.skip('returns results when searching without a query', async () => {
|
package/src/theme.tsx
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { SyntaxStyle, RGBA } from '@opentui/core'
|
|
2
|
+
|
|
1
3
|
export const Theme = {
|
|
2
4
|
// Text colors
|
|
3
5
|
text: '#FFFFFF',
|
|
@@ -8,24 +10,47 @@ export const Theme = {
|
|
|
8
10
|
backgroundPanel: '#1E1E1E', // Dark gray panel background
|
|
9
11
|
|
|
10
12
|
// Primary/accent colors
|
|
11
|
-
primary: '#
|
|
12
|
-
accent: '#
|
|
13
|
+
primary: '#FFC000', // Bright golden orange
|
|
14
|
+
accent: '#FFC000', // Bright golden orange
|
|
13
15
|
|
|
14
16
|
// Accessory colors (from List component)
|
|
15
|
-
info: '#
|
|
16
|
-
success: '#
|
|
17
|
-
warning: '#
|
|
17
|
+
info: '#FFC000', // Orange for text accessories
|
|
18
|
+
success: '#FFC000', // Orange for date accessories
|
|
19
|
+
warning: '#FFC000', // Orange for tag accessories
|
|
18
20
|
error: '#FF0000', // Red for errors
|
|
19
21
|
|
|
20
22
|
// Additional UI colors
|
|
21
23
|
border: '#333333',
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
selectedMuted: '#AA8000', // Dimmer orange for selected values when not focused
|
|
25
|
+
highlight: '#FFC000',
|
|
26
|
+
selected: '#FFC000',
|
|
24
27
|
yellow: '#FFFF00', // Yellow for icons
|
|
25
|
-
link: '#
|
|
28
|
+
link: '#FFC000', // Orange for links
|
|
26
29
|
|
|
27
30
|
// Transparent
|
|
28
31
|
transparent: undefined, // Use undefined for no background color
|
|
29
32
|
} as const
|
|
30
33
|
|
|
34
|
+
export const markdownSyntaxStyle = SyntaxStyle.fromStyles({
|
|
35
|
+
default: { fg: RGBA.fromHex(Theme.text) },
|
|
36
|
+
'markup.heading.1': { fg: RGBA.fromHex(Theme.primary), bold: true },
|
|
37
|
+
'markup.heading.2': { fg: RGBA.fromHex(Theme.primary), bold: true },
|
|
38
|
+
'markup.heading.3': { fg: RGBA.fromHex(Theme.primary), bold: true },
|
|
39
|
+
'markup.heading.4': { fg: RGBA.fromHex(Theme.primary), bold: true },
|
|
40
|
+
'markup.heading.5': { fg: RGBA.fromHex(Theme.primary), bold: true },
|
|
41
|
+
'markup.heading.6': { fg: RGBA.fromHex(Theme.primary), bold: true },
|
|
42
|
+
'markup.heading': { fg: RGBA.fromHex(Theme.primary), bold: true },
|
|
43
|
+
'markup.raw.block': { fg: RGBA.fromHex(Theme.accent) },
|
|
44
|
+
'markup.link.url': { fg: RGBA.fromHex(Theme.link) },
|
|
45
|
+
'markup.link.label': { fg: RGBA.fromHex(Theme.link) },
|
|
46
|
+
'markup.list': { fg: RGBA.fromHex(Theme.warning) },
|
|
47
|
+
'markup.list.checked': { fg: RGBA.fromHex(Theme.success) },
|
|
48
|
+
'markup.list.unchecked': { fg: RGBA.fromHex(Theme.textMuted) },
|
|
49
|
+
'markup.quote': { fg: RGBA.fromHex(Theme.textMuted), italic: true },
|
|
50
|
+
'punctuation.special': { fg: RGBA.fromHex(Theme.textMuted) },
|
|
51
|
+
'punctuation.delimiter': { fg: RGBA.fromHex(Theme.textMuted) },
|
|
52
|
+
'string.escape': { fg: RGBA.fromHex(Theme.warning) },
|
|
53
|
+
label: { fg: RGBA.fromHex(Theme.accent) },
|
|
54
|
+
})
|
|
55
|
+
|
|
31
56
|
export default Theme
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useStore } from 'termcast/src/state'
|
|
3
|
+
import { showToast, Toast } from 'termcast/src/apis/toast'
|
|
4
|
+
import { LocalStorage } from 'termcast/src/apis/localstorage'
|
|
5
|
+
import { CommandArguments } from 'termcast/src/components/command-arguments'
|
|
6
|
+
import { ExtensionPreferences } from 'termcast/src/components/extension-preferences'
|
|
7
|
+
import type { RaycastArgument, RaycastPackageJson } from 'termcast/src/package-json'
|
|
8
|
+
import type { LaunchProps } from 'termcast/src/apis/environment'
|
|
9
|
+
|
|
10
|
+
export interface RunnableCommand {
|
|
11
|
+
name: string
|
|
12
|
+
title: string
|
|
13
|
+
mode: 'view' | 'no-view' | 'menu-bar'
|
|
14
|
+
arguments?: RaycastArgument[]
|
|
15
|
+
preferences?: any[]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface RunCommandOptions {
|
|
19
|
+
command: RunnableCommand
|
|
20
|
+
extensionName: string
|
|
21
|
+
packageJson?: RaycastPackageJson
|
|
22
|
+
bundledPath?: string
|
|
23
|
+
Component?: (props: LaunchProps) => any
|
|
24
|
+
push: (element: React.ReactNode) => void
|
|
25
|
+
// For dev mode, adds cache busting query param
|
|
26
|
+
cacheBustParam?: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function runCommand(options: RunCommandOptions): Promise<void> {
|
|
30
|
+
const {
|
|
31
|
+
command,
|
|
32
|
+
extensionName,
|
|
33
|
+
packageJson,
|
|
34
|
+
bundledPath,
|
|
35
|
+
Component: BuiltInComponent,
|
|
36
|
+
push,
|
|
37
|
+
cacheBustParam,
|
|
38
|
+
} = options
|
|
39
|
+
|
|
40
|
+
// Check if command has required preferences that are missing
|
|
41
|
+
const prefsCheck = await checkRequiredPreferences({
|
|
42
|
+
command,
|
|
43
|
+
extensionName,
|
|
44
|
+
packageJson,
|
|
45
|
+
hasBuiltInComponent: !!BuiltInComponent,
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
if (!prefsCheck.hasRequiredPreferences) {
|
|
49
|
+
// TODO: Use replace instead of push to avoid stacking navigation
|
|
50
|
+
// Redirect to preferences with onSubmit to run command after
|
|
51
|
+
push(
|
|
52
|
+
<ExtensionPreferences
|
|
53
|
+
extensionName={extensionName}
|
|
54
|
+
commandName={
|
|
55
|
+
prefsCheck.requiredPreferences === 'command'
|
|
56
|
+
? command.name
|
|
57
|
+
: undefined
|
|
58
|
+
}
|
|
59
|
+
onSubmit={() => {
|
|
60
|
+
runCommand(options)
|
|
61
|
+
}}
|
|
62
|
+
/>,
|
|
63
|
+
)
|
|
64
|
+
return
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Check if command has arguments that need to be collected
|
|
68
|
+
const commandArgs = command.arguments || []
|
|
69
|
+
const currentArgs = useStore.getState().currentCommandArguments
|
|
70
|
+
const needsArguments = commandArgs.length > 0 && !currentArgs
|
|
71
|
+
|
|
72
|
+
if (needsArguments) {
|
|
73
|
+
push(
|
|
74
|
+
<CommandArguments
|
|
75
|
+
arguments={commandArgs}
|
|
76
|
+
commandTitle={command.title}
|
|
77
|
+
onSubmit={(args) => {
|
|
78
|
+
useStore.setState({ currentCommandArguments: args })
|
|
79
|
+
runCommand(options)
|
|
80
|
+
}}
|
|
81
|
+
/>,
|
|
82
|
+
)
|
|
83
|
+
return
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Set the current command in state
|
|
87
|
+
useStore.setState({ currentCommandName: command.name })
|
|
88
|
+
|
|
89
|
+
// Get the component/function to run
|
|
90
|
+
let CommandComponent: ((props: LaunchProps) => any) | undefined
|
|
91
|
+
|
|
92
|
+
if (BuiltInComponent) {
|
|
93
|
+
CommandComponent = BuiltInComponent
|
|
94
|
+
} else if (bundledPath) {
|
|
95
|
+
const importPath = cacheBustParam
|
|
96
|
+
? `${bundledPath}?rebuild=${cacheBustParam}`
|
|
97
|
+
: bundledPath
|
|
98
|
+
const module = await import(importPath)
|
|
99
|
+
CommandComponent = module.default
|
|
100
|
+
|
|
101
|
+
if (!CommandComponent) {
|
|
102
|
+
await showToast({
|
|
103
|
+
style: Toast.Style.Failure,
|
|
104
|
+
title: 'No default export',
|
|
105
|
+
message: `Command file ${command.name} has no default export`,
|
|
106
|
+
})
|
|
107
|
+
return
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
await showToast({
|
|
111
|
+
style: Toast.Style.Failure,
|
|
112
|
+
title: 'Command not available',
|
|
113
|
+
message: `Command ${command.name} has no implementation`,
|
|
114
|
+
})
|
|
115
|
+
return
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Build LaunchProps
|
|
119
|
+
const launchProps: LaunchProps = {
|
|
120
|
+
arguments: useStore.getState().currentCommandArguments || {},
|
|
121
|
+
fallbackText: undefined,
|
|
122
|
+
launchContext: undefined,
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Handle no-view commands (they export an async function, not a component)
|
|
126
|
+
if (command.mode === 'no-view') {
|
|
127
|
+
if (typeof CommandComponent === 'function') {
|
|
128
|
+
await CommandComponent(launchProps)
|
|
129
|
+
}
|
|
130
|
+
return
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// For view commands, push the component
|
|
134
|
+
push(<CommandComponent {...launchProps} />)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
async function checkRequiredPreferences({
|
|
138
|
+
command,
|
|
139
|
+
extensionName,
|
|
140
|
+
packageJson,
|
|
141
|
+
hasBuiltInComponent,
|
|
142
|
+
}: {
|
|
143
|
+
command: RunnableCommand
|
|
144
|
+
extensionName: string
|
|
145
|
+
packageJson?: RaycastPackageJson
|
|
146
|
+
hasBuiltInComponent: boolean
|
|
147
|
+
}): Promise<{
|
|
148
|
+
hasRequiredPreferences: boolean
|
|
149
|
+
requiredPreferences?: 'command' | 'extension'
|
|
150
|
+
}> {
|
|
151
|
+
// Built-in commands or commands without packageJson don't have preferences
|
|
152
|
+
if (hasBuiltInComponent || !packageJson) {
|
|
153
|
+
return { hasRequiredPreferences: true }
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Check command-specific preferences
|
|
157
|
+
const commandDef = packageJson.commands?.find(
|
|
158
|
+
(cmd) => cmd.name === command.name,
|
|
159
|
+
)
|
|
160
|
+
const commandPrefs = commandDef?.preferences || []
|
|
161
|
+
|
|
162
|
+
// Check extension-wide preferences
|
|
163
|
+
const extensionPrefs = packageJson.preferences || []
|
|
164
|
+
|
|
165
|
+
// Get saved preferences
|
|
166
|
+
const commandPrefsKey = `preferences.${extensionName}.${command.name}`
|
|
167
|
+
const extensionPrefsKey = `preferences.${extensionName}`
|
|
168
|
+
|
|
169
|
+
const savedCommandPrefs = await LocalStorage.getItem(commandPrefsKey)
|
|
170
|
+
const savedExtensionPrefs = await LocalStorage.getItem(extensionPrefsKey)
|
|
171
|
+
|
|
172
|
+
const parsedCommandPrefs = savedCommandPrefs
|
|
173
|
+
? JSON.parse(savedCommandPrefs as string)
|
|
174
|
+
: {}
|
|
175
|
+
const parsedExtensionPrefs = savedExtensionPrefs
|
|
176
|
+
? JSON.parse(savedExtensionPrefs as string)
|
|
177
|
+
: {}
|
|
178
|
+
|
|
179
|
+
// Check if all required command preferences are set
|
|
180
|
+
for (const pref of commandPrefs) {
|
|
181
|
+
if (pref.required && parsedCommandPrefs[pref.name] == null) {
|
|
182
|
+
return {
|
|
183
|
+
hasRequiredPreferences: false,
|
|
184
|
+
requiredPreferences: 'command',
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Check if all required extension preferences are set
|
|
190
|
+
for (const pref of extensionPrefs) {
|
|
191
|
+
if (pref.required && parsedExtensionPrefs[pref.name] == null) {
|
|
192
|
+
return {
|
|
193
|
+
hasRequiredPreferences: false,
|
|
194
|
+
requiredPreferences: 'extension',
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return { hasRequiredPreferences: true }
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export function clearCommandArguments(): void {
|
|
203
|
+
useStore.setState({ currentCommandArguments: null })
|
|
204
|
+
}
|
package/src/utils.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { createRoot } from '@opentui/react'
|
|
3
|
+
import { createCliRenderer } from '@opentui/core'
|
|
4
|
+
import { TermcastProvider } from 'termcast/src/internal/providers'
|
|
4
5
|
import path from 'node:path'
|
|
5
6
|
import fs from 'node:fs'
|
|
6
7
|
import os from 'node:os'
|
|
@@ -12,8 +13,9 @@ import {
|
|
|
12
13
|
} from './package-json'
|
|
13
14
|
import { logger } from './logger'
|
|
14
15
|
|
|
15
|
-
export function renderWithProviders(element: ReactNode): void {
|
|
16
|
-
|
|
16
|
+
export async function renderWithProviders(element: ReactNode): Promise<void> {
|
|
17
|
+
const renderer = await createCliRenderer()
|
|
18
|
+
createRoot(renderer).render(<TermcastProvider>{element}</TermcastProvider>)
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
export type CommonProps = {
|
package/dist/ai.d.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI API - Interface for AI model interactions
|
|
3
|
-
*
|
|
4
|
-
* Raycast Docs: https://developers.raycast.com/api-reference/ai
|
|
5
|
-
*
|
|
6
|
-
* The AI namespace provides methods to interact with various AI models for
|
|
7
|
-
* generating text completions. It supports streaming responses and multiple
|
|
8
|
-
* model providers including OpenAI, Anthropic, Google, and others.
|
|
9
|
-
*
|
|
10
|
-
* Key features:
|
|
11
|
-
* - Stream text completions with AI.ask()
|
|
12
|
-
* - Support for multiple AI models via Model enum
|
|
13
|
-
* - Configurable creativity levels
|
|
14
|
-
* - Abort signal support for cancellation
|
|
15
|
-
* - Event-based streaming with "data" events
|
|
16
|
-
*
|
|
17
|
-
* Usage:
|
|
18
|
-
* const stream = AI.ask("Explain quantum computing")
|
|
19
|
-
* stream.on("data", (chunk) => console.log(chunk))
|
|
20
|
-
* const result = await stream
|
|
21
|
-
*
|
|
22
|
-
* Models include GPT-4, Claude, Gemini, Llama, Mistral, and many others.
|
|
23
|
-
* Creativity can be set from "none" to "maximum" or as a number 0-2.
|
|
24
|
-
*/
|
|
25
|
-
export declare namespace AI {
|
|
26
|
-
export type Creativity = 'none' | 'low' | 'medium' | 'high' | 'maximum' | number;
|
|
27
|
-
export enum Model {
|
|
28
|
-
OpenAI_GPT4 = "openai-gpt-4",
|
|
29
|
-
'OpenAI_GPT4-turbo' = "openai-gpt-4-turbo",
|
|
30
|
-
'OpenAI_GPT4.1' = "openai-gpt-4.1",
|
|
31
|
-
'OpenAI_GPT4.1-nano' = "openai-gpt-4.1-nano",
|
|
32
|
-
'OpenAI_GPT4.1-mini' = "openai-gpt-4.1-mini",
|
|
33
|
-
OpenAI_GPT4o = "openai-gpt-4o",
|
|
34
|
-
'OpenAI_GPT4o-mini' = "openai-gpt-4o-mini",
|
|
35
|
-
'OpenAI_o3-mini' = "openai_o1-o3-mini",
|
|
36
|
-
'OpenAI_o4-mini' = "openai_o1-o4-mini",
|
|
37
|
-
OpenAI_o1 = "openai_o1-o1",
|
|
38
|
-
OpenAI_o3 = "openai_o1-o3",
|
|
39
|
-
Anthropic_Claude_Haiku = "anthropic-claude-haiku",
|
|
40
|
-
Anthropic_Claude_Opus = "anthropic-claude-opus",
|
|
41
|
-
Anthropic_Claude_Sonnet = "anthropic-claude-sonnet",
|
|
42
|
-
'Anthropic_Claude_Sonnet_3.7' = "anthropic-claude-3-7-sonnet-latest",
|
|
43
|
-
Anthropic_Claude_4_Sonnet = "anthropic-claude-sonnet-4",
|
|
44
|
-
Anthropic_Claude_4_Opus = "anthropic-claude-opus-4",
|
|
45
|
-
Mistral_Nemo = "mistral-nemo",
|
|
46
|
-
Mistral_Large = "mistral-large",
|
|
47
|
-
Mistral_Medium = "mistral-mistral-medium-latest",
|
|
48
|
-
Mistral_Small = "mistral-small",
|
|
49
|
-
Mistral_Codestral = "mistral-codestral",
|
|
50
|
-
'Llama3.3_70B' = "groq-llama-3.3-70b-versatile",
|
|
51
|
-
'Llama3.1_8B' = "llama3.1-8b",
|
|
52
|
-
'Llama3.1_405B' = "llama3.1-405b",
|
|
53
|
-
'Llama4_Scout' = "groq-meta-llama/llama-4-scout-17b-16e-instruct",
|
|
54
|
-
Perplexity_Sonar = "perplexity-sonar",
|
|
55
|
-
Perplexity_Sonar_Pro = "perplexity-sonar-pro",
|
|
56
|
-
Perplexity_Sonar_Reasoning = "perplexity-sonar-reasoning",
|
|
57
|
-
Perplexity_Sonar_Reasoning_Pro = "perplexity-sonar-reasoning-pro",
|
|
58
|
-
DeepSeek_R1 = "together-deepseek-ai/DeepSeek-R1",
|
|
59
|
-
DeepSeek_V3 = "together-deepseek-ai/DeepSeek-V3",
|
|
60
|
-
'DeepSeek_R1_Distill_Llama_3.3_70B' = "groq-deepseek-r1-distill-llama-70b",
|
|
61
|
-
'Google_Gemini_2.0_Flash' = "google-gemini-2.0-flash",
|
|
62
|
-
'Google_Gemini_2.0_Flash_Thinking' = "google-gemini-2.0-flash-thinking",
|
|
63
|
-
'Google_Gemini_2.5_Flash' = "google-gemini-2.5-flash",
|
|
64
|
-
'Google_Gemini_2.5_Pro' = "google-gemini-2.5-pro",
|
|
65
|
-
xAI_Grok_2 = "xai-grok-2-latest",
|
|
66
|
-
xAI_Grok_3 = "xai-grok-3",
|
|
67
|
-
xAI_Grok_3_Mini = "xai-grok-3-mini",
|
|
68
|
-
'OpenAI_GPT3.5-turbo-instruct' = "openai-gpt-4o-mini",
|
|
69
|
-
Llama2_70B = "llama2-70b",
|
|
70
|
-
Perplexity_Sonar_Medium_Online = "perplexity-sonar",
|
|
71
|
-
Perplexity_Sonar_Small_Online = "perplexity-sonar",
|
|
72
|
-
Codellama_70B_instruct = "codellama-70b-instruct",
|
|
73
|
-
Perplexity_Llama3_Sonar_Large = "perplexity-sonar",
|
|
74
|
-
Perplexity_Llama3_Sonar_Small = "perplexity-sonar",
|
|
75
|
-
'OpenAI_GPT3.5-turbo' = "openai-gpt-4o-mini",
|
|
76
|
-
'Llama3.1_70B' = "groq-llama-3.3-70b-versatile",
|
|
77
|
-
'Perplexity_Llama3.1_Sonar_Huge' = "perplexity-sonar-pro",
|
|
78
|
-
'Perplexity_Llama3.1_Sonar_Large' = "perplexity-sonar",
|
|
79
|
-
'Perplexity_Llama3.1_Sonar_Small' = "perplexity-sonar",
|
|
80
|
-
'Mistral_Large2' = "mistral-large",
|
|
81
|
-
'Groq_DeepSeek_R1_Distill_Llama_3.3_70B' = "groq-deepseek-r1-distill-llama-70b",
|
|
82
|
-
'Together_DeepSeek_R1' = "together-deepseek-ai/DeepSeek-R1",
|
|
83
|
-
'MixtraL_8x7B' = "mistral-nemo",
|
|
84
|
-
'Google_Gemini_1.5_Flash' = "google-gemini-1.5-flash",
|
|
85
|
-
'Google_Gemini_1.5_Pro' = "google-gemini-2.0-flash",
|
|
86
|
-
Mixtral_8x7B = "mistral-nemo",
|
|
87
|
-
'Qwen_2.5_32B' = "openai-gpt-4o-mini",
|
|
88
|
-
'OpenAI_o1-preview' = "openai_o1-o1",
|
|
89
|
-
'OpenAI_o1-mini' = "openai_o1-o1-mini",
|
|
90
|
-
Llama3_70B = "llama3-70b"
|
|
91
|
-
}
|
|
92
|
-
export type __DeprecatedModelUnion = 'openai-gpt-3.5-turbo-instruct' | 'openai-gpt-3.5-turbo' | 'openai-gpt-4' | 'openai-gpt-4-turbo' | 'anthropic-claude-haiku' | 'anthropic-claude-opus' | 'anthropic-claude-sonnet' | 'perplexity-sonar-medium-online' | 'perplexity-sonar-small-online' | 'llama2-70b' | 'mixtral-8x7b' | 'codellama-70b-instruct' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-instruct' | 'gpt-4' | 'text-davinci-003';
|
|
93
|
-
export type AskOptions = {
|
|
94
|
-
creativity?: Creativity;
|
|
95
|
-
model?: Model | __DeprecatedModelUnion;
|
|
96
|
-
signal?: AbortSignal;
|
|
97
|
-
};
|
|
98
|
-
interface AskStream extends Promise<string> {
|
|
99
|
-
on(event: 'data', listener: (chunk: string) => void): void;
|
|
100
|
-
}
|
|
101
|
-
export function ask(prompt: string, options?: AskOptions): AskStream;
|
|
102
|
-
export {};
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=ai.d.ts.map
|
package/dist/ai.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../src/ai.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,yBAAiB,EAAE,CAAC;IAClB,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,KAAK,GACL,QAAQ,GACR,MAAM,GACN,SAAS,GACT,MAAM,CAAA;IAEV,MAAM,MAAM,KAAK;QACf,WAAW,iBAAiB;QAC5B,mBAAmB,uBAAuB;QAC1C,eAAe,mBAAmB;QAClC,oBAAoB,wBAAwB;QAC5C,oBAAoB,wBAAwB;QAC5C,YAAY,kBAAkB;QAC9B,mBAAmB,uBAAuB;QAC1C,gBAAgB,sBAAsB;QACtC,gBAAgB,sBAAsB;QACtC,SAAS,iBAAiB;QAC1B,SAAS,iBAAiB;QAC1B,sBAAsB,2BAA2B;QACjD,qBAAqB,0BAA0B;QAC/C,uBAAuB,4BAA4B;QACnD,6BAA6B,uCAAuC;QACpE,yBAAyB,8BAA8B;QACvD,uBAAuB,4BAA4B;QACnD,YAAY,iBAAiB;QAC7B,aAAa,kBAAkB;QAC/B,cAAc,kCAAkC;QAChD,aAAa,kBAAkB;QAC/B,iBAAiB,sBAAsB;QACvC,cAAc,iCAAiC;QAC/C,aAAa,gBAAgB;QAC7B,eAAe,kBAAkB;QACjC,cAAc,mDAAmD;QACjE,gBAAgB,qBAAqB;QACrC,oBAAoB,yBAAyB;QAC7C,0BAA0B,+BAA+B;QACzD,8BAA8B,mCAAmC;QACjE,WAAW,qCAAqC;QAChD,WAAW,qCAAqC;QAChD,mCAAmC,uCAAuC;QAC1E,yBAAyB,4BAA4B;QACrD,kCAAkC,qCAAqC;QACvE,yBAAyB,4BAA4B;QACrD,uBAAuB,0BAA0B;QACjD,UAAU,sBAAsB;QAChC,UAAU,eAAe;QACzB,eAAe,oBAAoB;QAEnC,8BAA8B,uBAAuB;QACrD,UAAU,eAAe;QACzB,8BAA8B,qBAAqB;QACnD,6BAA6B,qBAAqB;QAClD,sBAAsB,2BAA2B;QACjD,6BAA6B,qBAAqB;QAClD,6BAA6B,qBAAqB;QAClD,qBAAqB,uBAAuB;QAC5C,cAAc,iCAAiC;QAC/C,gCAAgC,yBAAyB;QACzD,iCAAiC,qBAAqB;QACtD,iCAAiC,qBAAqB;QACtD,gBAAgB,kBAAkB;QAClC,wCAAwC,uCAAuC;QAC/E,sBAAsB,qCAAqC;QAC3D,cAAc,iBAAiB;QAC/B,yBAAyB,4BAA4B;QACrD,uBAAuB,4BAA4B;QACnD,YAAY,iBAAiB;QAC7B,cAAc,uBAAuB;QACrC,mBAAmB,iBAAiB;QACpC,gBAAgB,sBAAsB;QACtC,UAAU,eAAe;KAC1B;IAED,MAAM,MAAM,sBAAsB,GAC9B,+BAA+B,GAC/B,sBAAsB,GACtB,cAAc,GACd,oBAAoB,GACpB,wBAAwB,GACxB,uBAAuB,GACvB,yBAAyB,GACzB,gCAAgC,GAChC,+BAA+B,GAC/B,YAAY,GACZ,cAAc,GACd,wBAAwB,GACxB,eAAe,GACf,wBAAwB,GACxB,OAAO,GACP,kBAAkB,CAAA;IAEtB,MAAM,MAAM,UAAU,GAAG;QACvB,UAAU,CAAC,EAAE,UAAU,CAAA;QACvB,KAAK,CAAC,EAAE,KAAK,GAAG,sBAAsB,CAAA;QACtC,MAAM,CAAC,EAAE,WAAW,CAAA;KACrB,CAAA;IAED,UAAU,SAAU,SAAQ,OAAO,CAAC,MAAM,CAAC;QACzC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAA;KAC3D;IAED,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CA2CnE;;CACF"}
|