@cardstack/boxel-cli 0.2.0-unstable.448 → 0.3.0-unstable.13
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/bundled-types/base/-private.d.ts +1 -0
- package/bundled-types/base/address.d.ts +17 -0
- package/bundled-types/base/ai-app-generator.d.ts +14 -0
- package/bundled-types/base/amount-with-currency.d.ts +10 -0
- package/bundled-types/base/avif-image-def.d.ts +12 -0
- package/bundled-types/base/avif-meta-extractor.d.ts +4 -0
- package/bundled-types/base/base64-image.d.ts +25 -0
- package/bundled-types/base/big-integer.d.ts +12 -0
- package/bundled-types/base/boolean.d.ts +14 -0
- package/bundled-types/base/brand-functional-palette.d.ts +16 -0
- package/bundled-types/base/brand-guide.d.ts +26 -0
- package/bundled-types/base/brand-logo.d.ts +29 -0
- package/bundled-types/base/card-api.d.ts +513 -0
- package/bundled-types/base/card-serialization.d.ts +47 -0
- package/bundled-types/base/cards-grid.d.ts +10 -0
- package/bundled-types/base/code-ref.d.ts +14 -0
- package/bundled-types/base/codemirror-editor.d.ts +135 -0
- package/bundled-types/base/color-field/components/advanced-color-picker.d.ts +66 -0
- package/bundled-types/base/color-field/components/color-picker-field.d.ts +22 -0
- package/bundled-types/base/color-field/components/color-wheel-picker.d.ts +44 -0
- package/bundled-types/base/color-field/components/contrast-checker-addon.d.ts +14 -0
- package/bundled-types/base/color-field/components/recent-colors-addon.d.ts +19 -0
- package/bundled-types/base/color-field/components/slider-picker.d.ts +40 -0
- package/bundled-types/base/color-field/components/swatches-picker.d.ts +5 -0
- package/bundled-types/base/color-field/modifiers/setup-element-modifier.d.ts +10 -0
- package/bundled-types/base/color-field/util/color-field-signature.d.ts +9 -0
- package/bundled-types/base/color-field/util/color-utils.d.ts +96 -0
- package/bundled-types/base/color-field/util/css-color-parsers.d.ts +11 -0
- package/bundled-types/base/color.d.ts +10 -0
- package/bundled-types/base/command.d.ts +593 -0
- package/bundled-types/base/commands/search-card-result.d.ts +36 -0
- package/bundled-types/base/components/age.d.ts +22 -0
- package/bundled-types/base/components/business-days.d.ts +16 -0
- package/bundled-types/base/components/card-list.d.ts +25 -0
- package/bundled-types/base/components/cards-grid-layout.d.ts +58 -0
- package/bundled-types/base/components/countdown.d.ts +31 -0
- package/bundled-types/base/components/expiration-warning.d.ts +24 -0
- package/bundled-types/base/components/time-ago.d.ts +24 -0
- package/bundled-types/base/components/time-slots.d.ts +20 -0
- package/bundled-types/base/components/timeline.d.ts +22 -0
- package/bundled-types/base/contains-many-component.d.ts +7 -0
- package/bundled-types/base/coordinate.d.ts +7 -0
- package/bundled-types/base/country.d.ts +23 -0
- package/bundled-types/base/css-value.d.ts +6 -0
- package/bundled-types/base/csv-file-def.d.ts +29 -0
- package/bundled-types/base/currency.d.ts +16 -0
- package/bundled-types/base/date/day.d.ts +9 -0
- package/bundled-types/base/date/month-day.d.ts +10 -0
- package/bundled-types/base/date/month-year.d.ts +9 -0
- package/bundled-types/base/date/month.d.ts +9 -0
- package/bundled-types/base/date/quarter.d.ts +10 -0
- package/bundled-types/base/date/week.d.ts +9 -0
- package/bundled-types/base/date/year.d.ts +9 -0
- package/bundled-types/base/date-range-field.d.ts +12 -0
- package/bundled-types/base/date.d.ts +12 -0
- package/bundled-types/base/datetime-stamp.d.ts +7 -0
- package/bundled-types/base/datetime.d.ts +12 -0
- package/bundled-types/base/default-templates/atom.d.ts +10 -0
- package/bundled-types/base/default-templates/card-info.d.ts +32 -0
- package/bundled-types/base/default-templates/embedded.d.ts +11 -0
- package/bundled-types/base/default-templates/field-edit.d.ts +10 -0
- package/bundled-types/base/default-templates/file-def-edit.d.ts +8 -0
- package/bundled-types/base/default-templates/fitted.d.ts +12 -0
- package/bundled-types/base/default-templates/head.d.ts +13 -0
- package/bundled-types/base/default-templates/image-def-atom.d.ts +8 -0
- package/bundled-types/base/default-templates/image-def-embedded.d.ts +8 -0
- package/bundled-types/base/default-templates/image-def-fitted.d.ts +8 -0
- package/bundled-types/base/default-templates/image-def-isolated.d.ts +8 -0
- package/bundled-types/base/default-templates/isolated-and-edit.d.ts +15 -0
- package/bundled-types/base/default-templates/markdown-fallback.d.ts +19 -0
- package/bundled-types/base/default-templates/markdown.d.ts +60 -0
- package/bundled-types/base/default-templates/missing-template.d.ts +13 -0
- package/bundled-types/base/default-templates/theme-dashboard.d.ts +126 -0
- package/bundled-types/base/detailed-style-reference.d.ts +48 -0
- package/bundled-types/base/email.d.ts +10 -0
- package/bundled-types/base/enum.d.ts +30 -0
- package/bundled-types/base/ethereum-address.d.ts +13 -0
- package/bundled-types/base/field-component.d.ts +65 -0
- package/bundled-types/base/field-support.d.ts +55 -0
- package/bundled-types/base/file-api.d.ts +2 -0
- package/bundled-types/base/file-menu-items.d.ts +4 -0
- package/bundled-types/base/gif-image-def.d.ts +12 -0
- package/bundled-types/base/gif-meta-extractor.d.ts +4 -0
- package/bundled-types/base/gts-file-def.d.ts +7 -0
- package/bundled-types/base/helpers/country.d.ts +3198 -0
- package/bundled-types/base/helpers/sanitized-html.d.ts +2 -0
- package/bundled-types/base/helpers/set-background-image.d.ts +2 -0
- package/bundled-types/base/image-file-def.d.ts +1 -0
- package/bundled-types/base/image.d.ts +8 -0
- package/bundled-types/base/index.d.ts +1 -0
- package/bundled-types/base/join-the-community.d.ts +14 -0
- package/bundled-types/base/jpg-image-def.d.ts +12 -0
- package/bundled-types/base/jpg-meta-extractor.d.ts +4 -0
- package/bundled-types/base/json-file-def.d.ts +23 -0
- package/bundled-types/base/links-to-editor.d.ts +22 -0
- package/bundled-types/base/links-to-many-component.d.ts +7 -0
- package/bundled-types/base/llm-model.d.ts +6 -0
- package/bundled-types/base/markdown-file-def.d.ts +25 -0
- package/bundled-types/base/markdown-helpers.d.ts +26 -0
- package/bundled-types/base/markdown.d.ts +1 -0
- package/bundled-types/base/matrix-event.d.ts +400 -0
- package/bundled-types/base/menu-items.d.ts +21 -0
- package/bundled-types/base/number/components/badge-counter.d.ts +32 -0
- package/bundled-types/base/number/components/badge-metric.d.ts +34 -0
- package/bundled-types/base/number/components/badge-notification.d.ts +38 -0
- package/bundled-types/base/number/components/gauge.d.ts +45 -0
- package/bundled-types/base/number/components/number-input.d.ts +27 -0
- package/bundled-types/base/number/components/progress-bar.d.ts +44 -0
- package/bundled-types/base/number/components/progress-circle.d.ts +41 -0
- package/bundled-types/base/number/components/score.d.ts +41 -0
- package/bundled-types/base/number/components/stat.d.ts +38 -0
- package/bundled-types/base/number/util/index.d.ts +29 -0
- package/bundled-types/base/number.d.ts +52 -0
- package/bundled-types/base/percentage.d.ts +9 -0
- package/bundled-types/base/phone-number.d.ts +25 -0
- package/bundled-types/base/png-image-def.d.ts +12 -0
- package/bundled-types/base/png-meta-extractor.d.ts +4 -0
- package/bundled-types/base/positioned-card.d.ts +7 -0
- package/bundled-types/base/query-field-support.d.ts +6 -0
- package/bundled-types/base/realm-config.d.ts +16 -0
- package/bundled-types/base/realm.d.ts +7 -0
- package/bundled-types/base/resources/command-data.d.ts +43 -0
- package/bundled-types/base/response-field.d.ts +6 -0
- package/bundled-types/base/rich-markdown.d.ts +30 -0
- package/bundled-types/base/shared-state.d.ts +1 -0
- package/bundled-types/base/skill-plus.d.ts +79 -0
- package/bundled-types/base/skill-reference.d.ts +12 -0
- package/bundled-types/base/skill-set.d.ts +18 -0
- package/bundled-types/base/skill.d.ts +21 -0
- package/bundled-types/base/spec.d.ts +108 -0
- package/bundled-types/base/string.d.ts +2 -0
- package/bundled-types/base/structured-theme-variables.d.ts +85 -0
- package/bundled-types/base/structured-theme.d.ts +32 -0
- package/bundled-types/base/style-reference.d.ts +14 -0
- package/bundled-types/base/svg-image-def.d.ts +12 -0
- package/bundled-types/base/svg-meta-extractor.d.ts +12 -0
- package/bundled-types/base/system-card.d.ts +17 -0
- package/bundled-types/base/tag.d.ts +15 -0
- package/bundled-types/base/text-area.d.ts +2 -0
- package/bundled-types/base/text-file-def.d.ts +23 -0
- package/bundled-types/base/text-input-validator.d.ts +13 -0
- package/bundled-types/base/theme.d.ts +2 -0
- package/bundled-types/base/time/duration.d.ts +14 -0
- package/bundled-types/base/time/relative-time.d.ts +10 -0
- package/bundled-types/base/time/time-range.d.ts +11 -0
- package/bundled-types/base/time.d.ts +9 -0
- package/bundled-types/base/ts-file-def.d.ts +26 -0
- package/bundled-types/base/ts-highlight.d.ts +1 -0
- package/bundled-types/base/types/@cardstack/boxel-host/index.d.ts +5 -0
- package/bundled-types/base/types/ember-css-url/index.d.ts +15 -0
- package/bundled-types/base/typography.d.ts +14 -0
- package/bundled-types/base/url.d.ts +13 -0
- package/bundled-types/base/watched-array.d.ts +7 -0
- package/bundled-types/base/webp-image-def.d.ts +12 -0
- package/bundled-types/base/webp-meta-extractor.d.ts +4 -0
- package/bundled-types/base/website.d.ts +8 -0
- package/bundled-types/base/welcome-to-boxel.d.ts +22 -0
- package/bundled-types/boxel-ui/components/accordion/index.gts +50 -0
- package/bundled-types/boxel-ui/components/accordion/item/index.gts +156 -0
- package/bundled-types/boxel-ui/components/accordion/usage.gts +157 -0
- package/bundled-types/boxel-ui/components/add-button/index.gts +46 -0
- package/bundled-types/boxel-ui/components/add-button/usage.gts +54 -0
- package/bundled-types/boxel-ui/components/alert/index.gts +151 -0
- package/bundled-types/boxel-ui/components/alert/usage.gts +66 -0
- package/bundled-types/boxel-ui/components/avatar/index.gts +79 -0
- package/bundled-types/boxel-ui/components/avatar/usage.gts +96 -0
- package/bundled-types/boxel-ui/components/basic-fitted/index.gts +340 -0
- package/bundled-types/boxel-ui/components/basic-fitted/usage.gts +223 -0
- package/bundled-types/boxel-ui/components/button/index.gts +416 -0
- package/bundled-types/boxel-ui/components/button/usage.gts +334 -0
- package/bundled-types/boxel-ui/components/card-container/index.gts +251 -0
- package/bundled-types/boxel-ui/components/card-container/usage.gts +53 -0
- package/bundled-types/boxel-ui/components/card-header/index.gts +473 -0
- package/bundled-types/boxel-ui/components/card-header/usage.gts +295 -0
- package/bundled-types/boxel-ui/components/circle-spinner/index.gts +42 -0
- package/bundled-types/boxel-ui/components/circle-spinner/usage.gts +48 -0
- package/bundled-types/boxel-ui/components/color-palette/index.gts +134 -0
- package/bundled-types/boxel-ui/components/color-palette/usage.gts +69 -0
- package/bundled-types/boxel-ui/components/color-picker/index.gts +125 -0
- package/bundled-types/boxel-ui/components/color-picker/usage.gts +56 -0
- package/bundled-types/boxel-ui/components/container/index.gts +67 -0
- package/bundled-types/boxel-ui/components/container/usage.gts +59 -0
- package/bundled-types/boxel-ui/components/context-button/index.gts +184 -0
- package/bundled-types/boxel-ui/components/context-button/usage.gts +125 -0
- package/bundled-types/boxel-ui/components/copy-button/index.gts +79 -0
- package/bundled-types/boxel-ui/components/copy-button/usage.gts +25 -0
- package/bundled-types/boxel-ui/components/date-range-picker/index.gts +211 -0
- package/bundled-types/boxel-ui/components/date-range-picker/setup.gts +11 -0
- package/bundled-types/boxel-ui/components/date-range-picker/usage.gts +52 -0
- package/bundled-types/boxel-ui/components/drag-and-drop/index.gts +256 -0
- package/bundled-types/boxel-ui/components/drag-and-drop/usage.gts +142 -0
- package/bundled-types/boxel-ui/components/dropdown/index.gts +478 -0
- package/bundled-types/boxel-ui/components/dropdown/trigger/index.gts +70 -0
- package/bundled-types/boxel-ui/components/dropdown/trigger/usage.gts +54 -0
- package/bundled-types/boxel-ui/components/dropdown/usage.gts +119 -0
- package/bundled-types/boxel-ui/components/email-input/index.gts +111 -0
- package/bundled-types/boxel-ui/components/email-input/usage.gts +75 -0
- package/bundled-types/boxel-ui/components/entity-icon-display/index.gts +144 -0
- package/bundled-types/boxel-ui/components/entity-icon-display/usage.gts +54 -0
- package/bundled-types/boxel-ui/components/entity-thumbnail-display/index.gts +148 -0
- package/bundled-types/boxel-ui/components/entity-thumbnail-display/usage.gts +76 -0
- package/bundled-types/boxel-ui/components/field-container/index.gts +150 -0
- package/bundled-types/boxel-ui/components/field-container/usage.gts +188 -0
- package/bundled-types/boxel-ui/components/filter-list/index.gts +255 -0
- package/bundled-types/boxel-ui/components/filter-list/usage.gts +153 -0
- package/bundled-types/boxel-ui/components/fitted-card-container/index.gts +66 -0
- package/bundled-types/boxel-ui/components/fitted-card-container/usage.gts +81 -0
- package/bundled-types/boxel-ui/components/grid-container/grid-item-container/index.gts +37 -0
- package/bundled-types/boxel-ui/components/grid-container/index.gts +116 -0
- package/bundled-types/boxel-ui/components/grid-container/usage.gts +105 -0
- package/bundled-types/boxel-ui/components/header/index.gts +101 -0
- package/bundled-types/boxel-ui/components/header/usage.gts +116 -0
- package/bundled-types/boxel-ui/components/icon-button/index.gts +148 -0
- package/bundled-types/boxel-ui/components/icon-button/usage.gts +249 -0
- package/bundled-types/boxel-ui/components/input/index.gts +560 -0
- package/bundled-types/boxel-ui/components/input/usage.gts +449 -0
- package/bundled-types/boxel-ui/components/input-group/accessories/index.gts +191 -0
- package/bundled-types/boxel-ui/components/input-group/controls/index.gts +54 -0
- package/bundled-types/boxel-ui/components/input-group/index.gts +347 -0
- package/bundled-types/boxel-ui/components/input-group/usage.gts +437 -0
- package/bundled-types/boxel-ui/components/kanban/card.gts +89 -0
- package/bundled-types/boxel-ui/components/kanban/column-header.gts +151 -0
- package/bundled-types/boxel-ui/components/kanban/drag.gts +1007 -0
- package/bundled-types/boxel-ui/components/kanban/engine.ts +247 -0
- package/bundled-types/boxel-ui/components/kanban/ghost.gts +64 -0
- package/bundled-types/boxel-ui/components/kanban/index.gts +16 -0
- package/bundled-types/boxel-ui/components/kanban/modifiers.gts +42 -0
- package/bundled-types/boxel-ui/components/kanban/plane-inner.gts +525 -0
- package/bundled-types/boxel-ui/components/kanban/plane.gts +163 -0
- package/bundled-types/boxel-ui/components/kanban/usage.gts +392 -0
- package/bundled-types/boxel-ui/components/label/index.gts +64 -0
- package/bundled-types/boxel-ui/components/loading-indicator/index.gts +78 -0
- package/bundled-types/boxel-ui/components/loading-indicator/usage.gts +72 -0
- package/bundled-types/boxel-ui/components/menu/index.gts +267 -0
- package/bundled-types/boxel-ui/components/menu/usage.gts +100 -0
- package/bundled-types/boxel-ui/components/message/index.gts +146 -0
- package/bundled-types/boxel-ui/components/message/usage.gts +263 -0
- package/bundled-types/boxel-ui/components/modal/index.gts +159 -0
- package/bundled-types/boxel-ui/components/modal/usage.gts +206 -0
- package/bundled-types/boxel-ui/components/multi-select/after-options.gts +59 -0
- package/bundled-types/boxel-ui/components/multi-select/index.gts +230 -0
- package/bundled-types/boxel-ui/components/multi-select/selected-item.gts +91 -0
- package/bundled-types/boxel-ui/components/multi-select/trigger.gts +190 -0
- package/bundled-types/boxel-ui/components/multi-select/usage.gts +420 -0
- package/bundled-types/boxel-ui/components/phone-input/index.gts +149 -0
- package/bundled-types/boxel-ui/components/phone-input/usage.gts +73 -0
- package/bundled-types/boxel-ui/components/picker/before-options-with-search.gts +340 -0
- package/bundled-types/boxel-ui/components/picker/index.gts +427 -0
- package/bundled-types/boxel-ui/components/picker/option-row.gts +270 -0
- package/bundled-types/boxel-ui/components/picker/selected-item.gts +171 -0
- package/bundled-types/boxel-ui/components/picker/trigger-labeled.gts +216 -0
- package/bundled-types/boxel-ui/components/picker/usage.gts +179 -0
- package/bundled-types/boxel-ui/components/pill/index.gts +231 -0
- package/bundled-types/boxel-ui/components/pill/usage.gts +230 -0
- package/bundled-types/boxel-ui/components/progress-bar/index.gts +124 -0
- package/bundled-types/boxel-ui/components/progress-bar/usage.gts +131 -0
- package/bundled-types/boxel-ui/components/progress-radial/index.gts +95 -0
- package/bundled-types/boxel-ui/components/progress-radial/usage.gts +79 -0
- package/bundled-types/boxel-ui/components/radio-input/index.gts +143 -0
- package/bundled-types/boxel-ui/components/radio-input/item.gts +210 -0
- package/bundled-types/boxel-ui/components/radio-input/usage.gts +303 -0
- package/bundled-types/boxel-ui/components/realm-icon/index.gts +129 -0
- package/bundled-types/boxel-ui/components/realm-icon/usage.gts +62 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/handle.gts +180 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/index.gts +341 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/panel.gts +86 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/usage.gts +350 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/adjust-layout-by-delta.ts +231 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/assert.ts +10 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/calculate-delta-percentage.ts +41 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/calculate-unsafe-default-layout.ts +53 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/compare-layouts.ts +12 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/const.ts +6 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/determine-pivot-indices.ts +15 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-panel-element.ts +10 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-panel-elements-for-group.ts +8 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-panel-group-element.ts +21 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-resize-handle-element-index.ts +14 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-resize-handle-element.ts +12 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-resize-handle-elements-for-group.ts +10 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/fuzzy-layouts-equal.ts +22 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/fuzzy-numbers.ts +21 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/get-resize-event-coordinates.ts +8 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/get-resize-event-cursor-position.ts +10 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/panel-resize-handle-registry.ts +446 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/resize-panel.ts +35 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/types.ts +23 -0
- package/bundled-types/boxel-ui/components/resizable-panel-group/utils/validate-panel-group-layout.ts +86 -0
- package/bundled-types/boxel-ui/components/select/index.gts +882 -0
- package/bundled-types/boxel-ui/components/select/trigger.gts +132 -0
- package/bundled-types/boxel-ui/components/select/usage.gts +353 -0
- package/bundled-types/boxel-ui/components/skeleton-placeholder/index.gts +89 -0
- package/bundled-types/boxel-ui/components/skeleton-placeholder/usage.gts +102 -0
- package/bundled-types/boxel-ui/components/sort-dropdown/index.gts +91 -0
- package/bundled-types/boxel-ui/components/sort-dropdown/usage.gts +77 -0
- package/bundled-types/boxel-ui/components/swatch/index.gts +81 -0
- package/bundled-types/boxel-ui/components/swatch/usage.gts +57 -0
- package/bundled-types/boxel-ui/components/switch/index.gts +95 -0
- package/bundled-types/boxel-ui/components/switch/usage.gts +79 -0
- package/bundled-types/boxel-ui/components/tabbed-header/index.gts +141 -0
- package/bundled-types/boxel-ui/components/tabbed-header/usage.gts +103 -0
- package/bundled-types/boxel-ui/components/tag/index.gts +50 -0
- package/bundled-types/boxel-ui/components/tag/usage.gts +89 -0
- package/bundled-types/boxel-ui/components/tag-list/index.gts +85 -0
- package/bundled-types/boxel-ui/components/tag-list/usage.gts +129 -0
- package/bundled-types/boxel-ui/components/tooltip/index.gts +306 -0
- package/bundled-types/boxel-ui/components/tooltip/usage.gts +168 -0
- package/bundled-types/boxel-ui/components/view-selector/index.gts +166 -0
- package/bundled-types/boxel-ui/components/view-selector/usage.gts +149 -0
- package/bundled-types/boxel-ui/components.ts +169 -0
- package/bundled-types/boxel-ui/helpers/add-class-to-svg.ts +8 -0
- package/bundled-types/boxel-ui/helpers/clipboard.ts +21 -0
- package/bundled-types/boxel-ui/helpers/cn.ts +12 -0
- package/bundled-types/boxel-ui/helpers/color-tools.ts +331 -0
- package/bundled-types/boxel-ui/helpers/compact.ts +3 -0
- package/bundled-types/boxel-ui/helpers/contrast-color.ts +32 -0
- package/bundled-types/boxel-ui/helpers/css-var.ts +41 -0
- package/bundled-types/boxel-ui/helpers/currency-format.ts +25 -0
- package/bundled-types/boxel-ui/helpers/dayjs-format.ts +27 -0
- package/bundled-types/boxel-ui/helpers/deterministic-color-from-string.ts +45 -0
- package/bundled-types/boxel-ui/helpers/element.ts +16 -0
- package/bundled-types/boxel-ui/helpers/extract-css-variables.ts +126 -0
- package/bundled-types/boxel-ui/helpers/format-age.ts +72 -0
- package/bundled-types/boxel-ui/helpers/format-countdown.ts +110 -0
- package/bundled-types/boxel-ui/helpers/format-currency.ts +95 -0
- package/bundled-types/boxel-ui/helpers/format-date-time.ts +567 -0
- package/bundled-types/boxel-ui/helpers/format-duration.ts +143 -0
- package/bundled-types/boxel-ui/helpers/format-file-size.ts +49 -0
- package/bundled-types/boxel-ui/helpers/format-list.ts +73 -0
- package/bundled-types/boxel-ui/helpers/format-names.ts +103 -0
- package/bundled-types/boxel-ui/helpers/format-number.ts +140 -0
- package/bundled-types/boxel-ui/helpers/format-ordinal.ts +115 -0
- package/bundled-types/boxel-ui/helpers/format-period.ts +188 -0
- package/bundled-types/boxel-ui/helpers/format-relative-time.ts +789 -0
- package/bundled-types/boxel-ui/helpers/generate-css-variables.ts +47 -0
- package/bundled-types/boxel-ui/helpers/markdown-escape.ts +36 -0
- package/bundled-types/boxel-ui/helpers/math-helpers.ts +18 -0
- package/bundled-types/boxel-ui/helpers/menu-divider.ts +15 -0
- package/bundled-types/boxel-ui/helpers/menu-item.ts +76 -0
- package/bundled-types/boxel-ui/helpers/optional.ts +7 -0
- package/bundled-types/boxel-ui/helpers/pick.ts +11 -0
- package/bundled-types/boxel-ui/helpers/sanitize-html.ts +45 -0
- package/bundled-types/boxel-ui/helpers/string.ts +15 -0
- package/bundled-types/boxel-ui/helpers/theme-css.ts +148 -0
- package/bundled-types/boxel-ui/helpers/truth-helpers.ts +48 -0
- package/bundled-types/boxel-ui/helpers/validate-email-format.ts +138 -0
- package/bundled-types/boxel-ui/helpers/validate-phone-format.ts +201 -0
- package/bundled-types/boxel-ui/helpers.ts +134 -0
- package/bundled-types/boxel-ui/icons/ai-bw.gts +22 -0
- package/bundled-types/boxel-ui/icons/arrow-left.gts +25 -0
- package/bundled-types/boxel-ui/icons/arrow-right.gts +28 -0
- package/bundled-types/boxel-ui/icons/arrow-top-left.gts +22 -0
- package/bundled-types/boxel-ui/icons/arrow-up.gts +25 -0
- package/bundled-types/boxel-ui/icons/atom.gts +26 -0
- package/bundled-types/boxel-ui/icons/boxel-icon-with-text.gts +29 -0
- package/bundled-types/boxel-ui/icons/boxel-icon.gts +34 -0
- package/bundled-types/boxel-ui/icons/card-definition.gts +26 -0
- package/bundled-types/boxel-ui/icons/card-instance.gts +26 -0
- package/bundled-types/boxel-ui/icons/card.gts +24 -0
- package/bundled-types/boxel-ui/icons/cardbot-lg.gts +24 -0
- package/bundled-types/boxel-ui/icons/caret-down.gts +23 -0
- package/bundled-types/boxel-ui/icons/caret-up.gts +23 -0
- package/bundled-types/boxel-ui/icons/check-mark.gts +23 -0
- package/bundled-types/boxel-ui/icons/chevron-right.gts +23 -0
- package/bundled-types/boxel-ui/icons/copy.gts +28 -0
- package/bundled-types/boxel-ui/icons/diagonal-arrow-left-up.gts +21 -0
- package/bundled-types/boxel-ui/icons/download.gts +19 -0
- package/bundled-types/boxel-ui/icons/dropdown-arrow-down.gts +20 -0
- package/bundled-types/boxel-ui/icons/dropdown-arrow-filled.gts +19 -0
- package/bundled-types/boxel-ui/icons/dropdown-arrow-up.gts +20 -0
- package/bundled-types/boxel-ui/icons/edit.gts +14 -0
- package/bundled-types/boxel-ui/icons/embedded.gts +34 -0
- package/bundled-types/boxel-ui/icons/exclamation-circle.gts +26 -0
- package/bundled-types/boxel-ui/icons/exclamation.gts +20 -0
- package/bundled-types/boxel-ui/icons/eye.gts +19 -0
- package/bundled-types/boxel-ui/icons/failure-bordered.gts +26 -0
- package/bundled-types/boxel-ui/icons/field.gts +26 -0
- package/bundled-types/boxel-ui/icons/file-alert.gts +28 -0
- package/bundled-types/boxel-ui/icons/file.gts +27 -0
- package/bundled-types/boxel-ui/icons/fitted.gts +42 -0
- package/bundled-types/boxel-ui/icons/folder.gts +26 -0
- package/bundled-types/boxel-ui/icons/form.gts +38 -0
- package/bundled-types/boxel-ui/icons/four-lines.gts +21 -0
- package/bundled-types/boxel-ui/icons/grid-3x3.gts +26 -0
- package/bundled-types/boxel-ui/icons/group.gts +22 -0
- package/bundled-types/boxel-ui/icons/head.gts +28 -0
- package/bundled-types/boxel-ui/icons/highlight-icon.gts +46 -0
- package/bundled-types/boxel-ui/icons/icon-circle-selected.gts +25 -0
- package/bundled-types/boxel-ui/icons/icon-circle.gts +25 -0
- package/bundled-types/boxel-ui/icons/icon-code.gts +22 -0
- package/bundled-types/boxel-ui/icons/icon-funnel.gts +23 -0
- package/bundled-types/boxel-ui/icons/icon-globe.gts +19 -0
- package/bundled-types/boxel-ui/icons/icon-grid.gts +68 -0
- package/bundled-types/boxel-ui/icons/icon-hexagon.gts +22 -0
- package/bundled-types/boxel-ui/icons/icon-inherit.gts +19 -0
- package/bundled-types/boxel-ui/icons/icon-link.gts +20 -0
- package/bundled-types/boxel-ui/icons/icon-list.gts +40 -0
- package/bundled-types/boxel-ui/icons/icon-minus-circle.gts +26 -0
- package/bundled-types/boxel-ui/icons/icon-pencil-crossed-out.gts +33 -0
- package/bundled-types/boxel-ui/icons/icon-pencil-not-crossed-out.gts +21 -0
- package/bundled-types/boxel-ui/icons/icon-pencil.gts +23 -0
- package/bundled-types/boxel-ui/icons/icon-plus-circle.gts +31 -0
- package/bundled-types/boxel-ui/icons/icon-plus-thin.gts +19 -0
- package/bundled-types/boxel-ui/icons/icon-plus.gts +20 -0
- package/bundled-types/boxel-ui/icons/icon-search-thick.gts +27 -0
- package/bundled-types/boxel-ui/icons/icon-search.gts +25 -0
- package/bundled-types/boxel-ui/icons/icon-table.gts +44 -0
- package/bundled-types/boxel-ui/icons/icon-trash.gts +24 -0
- package/bundled-types/boxel-ui/icons/icon-turn-down-right.gts +18 -0
- package/bundled-types/boxel-ui/icons/icon-x.gts +21 -0
- package/bundled-types/boxel-ui/icons/image-placeholder.gts +30 -0
- package/bundled-types/boxel-ui/icons/isolated.gts +20 -0
- package/bundled-types/boxel-ui/icons/loading-indicator.gts +26 -0
- package/bundled-types/boxel-ui/icons/lock.gts +23 -0
- package/bundled-types/boxel-ui/icons/markdown.gts +19 -0
- package/bundled-types/boxel-ui/icons/profile.gts +23 -0
- package/bundled-types/boxel-ui/icons/publish-site-icon.gts +25 -0
- package/bundled-types/boxel-ui/icons/rows-4.gts +26 -0
- package/bundled-types/boxel-ui/icons/select-all.gts +25 -0
- package/bundled-types/boxel-ui/icons/send.gts +21 -0
- package/bundled-types/boxel-ui/icons/sparkle.gts +21 -0
- package/bundled-types/boxel-ui/icons/star-filled.gts +25 -0
- package/bundled-types/boxel-ui/icons/star-half-fill.gts +27 -0
- package/bundled-types/boxel-ui/icons/star.gts +25 -0
- package/bundled-types/boxel-ui/icons/success-bordered.gts +30 -0
- package/bundled-types/boxel-ui/icons/three-dots-horizontal.gts +21 -0
- package/bundled-types/boxel-ui/icons/triangle-left.gts +23 -0
- package/bundled-types/boxel-ui/icons/triangle-right.gts +23 -0
- package/bundled-types/boxel-ui/icons/types.ts +10 -0
- package/bundled-types/boxel-ui/icons/upload.gts +20 -0
- package/bundled-types/boxel-ui/icons/warning.gts +19 -0
- package/bundled-types/boxel-ui/icons.gts +249 -0
- package/bundled-types/boxel-ui/modifiers/auto-focus.ts +7 -0
- package/bundled-types/boxel-ui/modifiers/set-css-var.ts +24 -0
- package/bundled-types/boxel-ui/modifiers.ts +14 -0
- package/bundled-types/boxel-ui/types/@cardstack/boxel-ui/index.d.ts +3 -0
- package/bundled-types/boxel-ui/types/ember-css-url/index.d.ts +15 -0
- package/bundled-types/boxel-ui/types/ember-draggable-modifiers/index.d.ts +109 -0
- package/bundled-types/boxel-ui/types/ember-draggable-modifiers/utils.d.ts +7 -0
- package/bundled-types/boxel-ui/types/ember-focus-trap/index.d.ts +20 -0
- package/bundled-types/boxel-ui/types/ember-power-calendar/components/index.d.ts +9 -0
- package/bundled-types/boxel-ui/types/ember-resize-modifier/index.d.ts +14 -0
- package/bundled-types/boxel-ui/types/ember-set-body-class/index.d.ts +12 -0
- package/bundled-types/boxel-ui/types/ember-sortable/index.d.ts +52 -0
- package/bundled-types/boxel-ui/types/global.d.ts +7 -0
- package/bundled-types/boxel-ui/usage.ts +112 -0
- package/bundled-types/boxel-ui/utils/date-utils.ts +192 -0
- package/bundled-types/boxel-ui/utils/fitted-formats.ts +161 -0
- package/bundled-types/host-app/app.ts +22 -0
- package/bundled-types/host-app/commands/add-field-to-card-definition.ts +74 -0
- package/bundled-types/host-app/commands/ai-assistant.ts +203 -0
- package/bundled-types/host-app/commands/apply-markdown-edit.ts +203 -0
- package/bundled-types/host-app/commands/apply-search-replace-block.ts +225 -0
- package/bundled-types/host-app/commands/ask-ai.ts +66 -0
- package/bundled-types/host-app/commands/authed-fetch.ts +53 -0
- package/bundled-types/host-app/commands/bot-requests/create-listing-pr-request.ts +77 -0
- package/bundled-types/host-app/commands/bot-requests/send-bot-trigger-event.ts +53 -0
- package/bundled-types/host-app/commands/can-read-realm.ts +34 -0
- package/bundled-types/host-app/commands/cancel-indexing-job.ts +29 -0
- package/bundled-types/host-app/commands/check-correctness.ts +309 -0
- package/bundled-types/host-app/commands/copy-and-edit.ts +311 -0
- package/bundled-types/host-app/commands/copy-card-as-markdown.ts +41 -0
- package/bundled-types/host-app/commands/copy-card-to-stack.ts +70 -0
- package/bundled-types/host-app/commands/copy-card.ts +67 -0
- package/bundled-types/host-app/commands/copy-file-to-realm.ts +82 -0
- package/bundled-types/host-app/commands/copy-source.ts +46 -0
- package/bundled-types/host-app/commands/create-ai-assistant-room.ts +144 -0
- package/bundled-types/host-app/commands/create-and-open-submission-workflow-card.ts +30 -0
- package/bundled-types/host-app/commands/create-specs.ts +422 -0
- package/bundled-types/host-app/commands/create-submission-workflow.ts +172 -0
- package/bundled-types/host-app/commands/evaluate-module.ts +119 -0
- package/bundled-types/host-app/commands/execute-atomic-operations.ts +44 -0
- package/bundled-types/host-app/commands/fetch-card-json.ts +33 -0
- package/bundled-types/host-app/commands/full-reindex-realm.ts +30 -0
- package/bundled-types/host-app/commands/generate-example-cards.ts +298 -0
- package/bundled-types/host-app/commands/generate-readme-spec.ts +116 -0
- package/bundled-types/host-app/commands/generate-theme-example.ts +147 -0
- package/bundled-types/host-app/commands/generate-thumbnail.ts +247 -0
- package/bundled-types/host-app/commands/get-all-realm-metas.ts +38 -0
- package/bundled-types/host-app/commands/get-available-realm-identifiers.ts +29 -0
- package/bundled-types/host-app/commands/get-card-type-schema.ts +59 -0
- package/bundled-types/host-app/commands/get-card.ts +34 -0
- package/bundled-types/host-app/commands/get-catalog-realm-identifiers.ts +29 -0
- package/bundled-types/host-app/commands/get-default-writable-realm.ts +28 -0
- package/bundled-types/host-app/commands/get-events-from-room.ts +70 -0
- package/bundled-types/host-app/commands/get-realm-of-resource-identifier.ts +37 -0
- package/bundled-types/host-app/commands/get-user-system-card.ts +38 -0
- package/bundled-types/host-app/commands/index.ts +590 -0
- package/bundled-types/host-app/commands/instantiate-card.ts +185 -0
- package/bundled-types/host-app/commands/invalidate-realm-identifiers.ts +33 -0
- package/bundled-types/host-app/commands/invite-user-to-room.ts +34 -0
- package/bundled-types/host-app/commands/lint-and-fix.ts +60 -0
- package/bundled-types/host-app/commands/listing-action-build.ts +79 -0
- package/bundled-types/host-app/commands/listing-action-init.ts +106 -0
- package/bundled-types/host-app/commands/listing-create.ts +632 -0
- package/bundled-types/host-app/commands/listing-generate-example.ts +83 -0
- package/bundled-types/host-app/commands/listing-install.ts +227 -0
- package/bundled-types/host-app/commands/listing-remix.ts +150 -0
- package/bundled-types/host-app/commands/listing-update-specs.ts +116 -0
- package/bundled-types/host-app/commands/listing-use.ts +97 -0
- package/bundled-types/host-app/commands/one-shot-llm-request.ts +209 -0
- package/bundled-types/host-app/commands/open-ai-assistant-room.ts +38 -0
- package/bundled-types/host-app/commands/open-create-listing-modal.ts +52 -0
- package/bundled-types/host-app/commands/open-in-interact-mode.ts +36 -0
- package/bundled-types/host-app/commands/open-workspace.ts +38 -0
- package/bundled-types/host-app/commands/patch-card-instance.ts +108 -0
- package/bundled-types/host-app/commands/patch-code.ts +243 -0
- package/bundled-types/host-app/commands/patch-fields.ts +304 -0
- package/bundled-types/host-app/commands/patch-theme.ts +52 -0
- package/bundled-types/host-app/commands/persist-module-inspector-view.ts +41 -0
- package/bundled-types/host-app/commands/populate-with-sample-data.ts +84 -0
- package/bundled-types/host-app/commands/preview-format.ts +52 -0
- package/bundled-types/host-app/commands/read-binary-file.ts +62 -0
- package/bundled-types/host-app/commands/read-card-for-ai-assistant.ts +50 -0
- package/bundled-types/host-app/commands/read-file-for-ai-assistant.ts +46 -0
- package/bundled-types/host-app/commands/read-source.ts +46 -0
- package/bundled-types/host-app/commands/read-text-file.ts +44 -0
- package/bundled-types/host-app/commands/register-bot.ts +42 -0
- package/bundled-types/host-app/commands/reindex-realm.ts +30 -0
- package/bundled-types/host-app/commands/retry-submission-workflow.ts +119 -0
- package/bundled-types/host-app/commands/sanitize-module-list.ts +83 -0
- package/bundled-types/host-app/commands/save-card.ts +44 -0
- package/bundled-types/host-app/commands/screenshot-card.ts +148 -0
- package/bundled-types/host-app/commands/search-and-choose.ts +180 -0
- package/bundled-types/host-app/commands/search-cards.ts +102 -0
- package/bundled-types/host-app/commands/search-google-images.ts +100 -0
- package/bundled-types/host-app/commands/send-ai-assistant-message.ts +122 -0
- package/bundled-types/host-app/commands/send-request-via-proxy.ts +70 -0
- package/bundled-types/host-app/commands/serialize-card.ts +45 -0
- package/bundled-types/host-app/commands/set-active-llm.ts +39 -0
- package/bundled-types/host-app/commands/set-user-system-card.ts +29 -0
- package/bundled-types/host-app/commands/show-card.ts +102 -0
- package/bundled-types/host-app/commands/show-file.ts +39 -0
- package/bundled-types/host-app/commands/store-add.ts +37 -0
- package/bundled-types/host-app/commands/summarize-session.ts +82 -0
- package/bundled-types/host-app/commands/switch-submode.ts +112 -0
- package/bundled-types/host-app/commands/sync-openrouter-models.ts +373 -0
- package/bundled-types/host-app/commands/transform-cards.ts +59 -0
- package/bundled-types/host-app/commands/unregister-bot.ts +29 -0
- package/bundled-types/host-app/commands/update-code-path-with-selection.ts +45 -0
- package/bundled-types/host-app/commands/update-playground-selection.ts +37 -0
- package/bundled-types/host-app/commands/update-room-skills.ts +231 -0
- package/bundled-types/host-app/commands/utils.ts +178 -0
- package/bundled-types/host-app/commands/validate-realm.ts +40 -0
- package/bundled-types/host-app/commands/write-binary-file.ts +142 -0
- package/bundled-types/host-app/commands/write-text-file.ts +104 -0
- package/bundled-types/host-app/components/.gitkeep +0 -0
- package/bundled-types/host-app/components/ai-assistant/action-bar.gts +188 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-button-active-bg.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-button-active-bg@2x.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-button-active-bg@3x.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon-animated.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon-bw.png +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon-bw@2x.png +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon-bw@3x.png +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon@2x.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/ai-assist-icon@3x.webp +0 -0
- package/bundled-types/host-app/components/ai-assistant/apply-button/index.gts +226 -0
- package/bundled-types/host-app/components/ai-assistant/apply-button/usage.gts +81 -0
- package/bundled-types/host-app/components/ai-assistant/attached-file-dropdown-menu.gts +179 -0
- package/bundled-types/host-app/components/ai-assistant/attachment-picker/attach-button.gts +176 -0
- package/bundled-types/host-app/components/ai-assistant/attachment-picker/attached-items.gts +271 -0
- package/bundled-types/host-app/components/ai-assistant/attachment-picker/index.gts +144 -0
- package/bundled-types/host-app/components/ai-assistant/attachment-picker/usage.gts +127 -0
- package/bundled-types/host-app/components/ai-assistant/button.gts +60 -0
- package/bundled-types/host-app/components/ai-assistant/chat-input/index.gts +203 -0
- package/bundled-types/host-app/components/ai-assistant/chat-input/usage.gts +68 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/actions.gts +58 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/apply-code-patch-button.gts +66 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/command-header.gts +115 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/diff-editor-header.gts +209 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/index.gts +228 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/patch-footer.gts +32 -0
- package/bundled-types/host-app/components/ai-assistant/code-block/view-code-button.gts +73 -0
- package/bundled-types/host-app/components/ai-assistant/focus-pill/index.gts +60 -0
- package/bundled-types/host-app/components/ai-assistant/focus-pill/usage.gts +45 -0
- package/bundled-types/host-app/components/ai-assistant/llm-mode-toggle.gts +113 -0
- package/bundled-types/host-app/components/ai-assistant/llm-select.gts +158 -0
- package/bundled-types/host-app/components/ai-assistant/message/aibot-message.gts +374 -0
- package/bundled-types/host-app/components/ai-assistant/message/attachments.gts +153 -0
- package/bundled-types/host-app/components/ai-assistant/message/index.gts +678 -0
- package/bundled-types/host-app/components/ai-assistant/message/meta.gts +66 -0
- package/bundled-types/host-app/components/ai-assistant/message/text-content.gts +32 -0
- package/bundled-types/host-app/components/ai-assistant/message/usage.gts +182 -0
- package/bundled-types/host-app/components/ai-assistant/message/user-message.gts +52 -0
- package/bundled-types/host-app/components/ai-assistant/new-session-button.gts +126 -0
- package/bundled-types/host-app/components/ai-assistant/new-session-settings.gts +180 -0
- package/bundled-types/host-app/components/ai-assistant/new-session.gts +83 -0
- package/bundled-types/host-app/components/ai-assistant/panel-popover.gts +102 -0
- package/bundled-types/host-app/components/ai-assistant/panel.gts +453 -0
- package/bundled-types/host-app/components/ai-assistant/past-session-item.gts +323 -0
- package/bundled-types/host-app/components/ai-assistant/past-sessions.gts +115 -0
- package/bundled-types/host-app/components/ai-assistant/rename-session.gts +144 -0
- package/bundled-types/host-app/components/ai-assistant/restore-file-modal.gts +105 -0
- package/bundled-types/host-app/components/ai-assistant/skill-menu/index.gts +190 -0
- package/bundled-types/host-app/components/ai-assistant/skill-menu/skill-toggle.gts +168 -0
- package/bundled-types/host-app/components/ai-assistant/skill-menu/usage.gts +48 -0
- package/bundled-types/host-app/components/ai-assistant/toast.gts +293 -0
- package/bundled-types/host-app/components/card-catalog/modal.gts +579 -0
- package/bundled-types/host-app/components/card-error.gts +41 -0
- package/bundled-types/host-app/components/card-instance-picker/index.gts +54 -0
- package/bundled-types/host-app/components/card-pill.gts +189 -0
- package/bundled-types/host-app/components/card-prerender.gts +880 -0
- package/bundled-types/host-app/components/card-renderer.gts +84 -0
- package/bundled-types/host-app/components/card-search/constants.ts +76 -0
- package/bundled-types/host-app/components/card-search/item-button.gts +243 -0
- package/bundled-types/host-app/components/card-search/panel.gts +150 -0
- package/bundled-types/host-app/components/card-search/search-bar.gts +218 -0
- package/bundled-types/host-app/components/card-search/search-content.gts +604 -0
- package/bundled-types/host-app/components/card-search/search-result-header.gts +165 -0
- package/bundled-types/host-app/components/card-search/search-result-section.gts +545 -0
- package/bundled-types/host-app/components/card-search/section-header.gts +117 -0
- package/bundled-types/host-app/components/editor/directory.gts +308 -0
- package/bundled-types/host-app/components/editor/file-tree.gts +69 -0
- package/bundled-types/host-app/components/editor/import-module.gts +27 -0
- package/bundled-types/host-app/components/editor/indexed-file-tree.gts +572 -0
- package/bundled-types/host-app/components/editor/recent-files.gts +141 -0
- package/bundled-types/host-app/components/file-pill.gts +206 -0
- package/bundled-types/host-app/components/head-format-preview.gts +781 -0
- package/bundled-types/host-app/components/host-mode/breadcrumb-item.gts +150 -0
- package/bundled-types/host-app/components/host-mode/breadcrumbs.gts +131 -0
- package/bundled-types/host-app/components/host-mode/card.gts +199 -0
- package/bundled-types/host-app/components/host-mode/content.gts +195 -0
- package/bundled-types/host-app/components/host-mode/stack-item.gts +310 -0
- package/bundled-types/host-app/components/host-mode/stack.gts +91 -0
- package/bundled-types/host-app/components/matrix/auth-container.gts +66 -0
- package/bundled-types/host-app/components/matrix/auth.gts +73 -0
- package/bundled-types/host-app/components/matrix/forgot-password.gts +487 -0
- package/bundled-types/host-app/components/matrix/login.gts +241 -0
- package/bundled-types/host-app/components/matrix/register-user.gts +843 -0
- package/bundled-types/host-app/components/matrix/room-message-command.gts +330 -0
- package/bundled-types/host-app/components/matrix/room-message.gts +261 -0
- package/bundled-types/host-app/components/matrix/room.gts +1872 -0
- package/bundled-types/host-app/components/matrix/user-profile.gts +99 -0
- package/bundled-types/host-app/components/modal-container.gts +171 -0
- package/bundled-types/host-app/components/operator-mode/binary-file-info.gts +77 -0
- package/bundled-types/host-app/components/operator-mode/card-adoption-chain.gts +99 -0
- package/bundled-types/host-app/components/operator-mode/card-error-detail.gts +87 -0
- package/bundled-types/host-app/components/operator-mode/card-error.gts +177 -0
- package/bundled-types/host-app/components/operator-mode/card-schema-editor.gts +616 -0
- package/bundled-types/host-app/components/operator-mode/card-url-bar.gts +197 -0
- package/bundled-types/host-app/components/operator-mode/choose-file-modal.gts +562 -0
- package/bundled-types/host-app/components/operator-mode/choose-subscription-plan-modal.gts +517 -0
- package/bundled-types/host-app/components/operator-mode/code-editor.gts +736 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/editor-indicator.gts +128 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/format-chooser.gts +589 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/inner-container.gts +162 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/left-panel-toggle.gts +267 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/module-inspector.gts +836 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/field-chooser-modal.gts +97 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/instance-chooser-dropdown.gts +346 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/playground-background.png +0 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/playground-panel.gts +1274 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/playground-preview.gts +155 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/playground.gts +98 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/playground/spec-search.gts +70 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/schema-editor.gts +205 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/spec-preview-badge.gts +72 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/spec-preview.gts +432 -0
- package/bundled-types/host-app/components/operator-mode/code-submode/toggle-button.gts +72 -0
- package/bundled-types/host-app/components/operator-mode/code-submode.gts +1030 -0
- package/bundled-types/host-app/components/operator-mode/container.gts +270 -0
- package/bundled-types/host-app/components/operator-mode/context-menu-button.gts +95 -0
- package/bundled-types/host-app/components/operator-mode/copy-button.gts +277 -0
- package/bundled-types/host-app/components/operator-mode/create-file-modal.gts +1087 -0
- package/bundled-types/host-app/components/operator-mode/create-listing-modal.gts +513 -0
- package/bundled-types/host-app/components/operator-mode/definition-container/base.gts +222 -0
- package/bundled-types/host-app/components/operator-mode/definition-container/clickable.gts +59 -0
- package/bundled-types/host-app/components/operator-mode/definition-container/divider.gts +48 -0
- package/bundled-types/host-app/components/operator-mode/definition-container/index.gts +108 -0
- package/bundled-types/host-app/components/operator-mode/delete-modal.gts +123 -0
- package/bundled-types/host-app/components/operator-mode/detail-panel-selector.gts +320 -0
- package/bundled-types/host-app/components/operator-mode/detail-panel.gts +834 -0
- package/bundled-types/host-app/components/operator-mode/edit-field-modal.gts +450 -0
- package/bundled-types/host-app/components/operator-mode/error-display.gts +590 -0
- package/bundled-types/host-app/components/operator-mode/host-submode/open-site-popover.gts +127 -0
- package/bundled-types/host-app/components/operator-mode/host-submode/publishing-realm-popover.gts +159 -0
- package/bundled-types/host-app/components/operator-mode/host-submode.gts +373 -0
- package/bundled-types/host-app/components/operator-mode/interact-submode/neighbor-stack-trigger.gts +116 -0
- package/bundled-types/host-app/components/operator-mode/interact-submode.gts +1021 -0
- package/bundled-types/host-app/components/operator-mode/new-file-button.gts +187 -0
- package/bundled-types/host-app/components/operator-mode/operator-mode-overlays.gts +511 -0
- package/bundled-types/host-app/components/operator-mode/overlays.gts +342 -0
- package/bundled-types/host-app/components/operator-mode/preview-panel/fitted-format-gallery.gts +127 -0
- package/bundled-types/host-app/components/operator-mode/preview-panel/index.gts +443 -0
- package/bundled-types/host-app/components/operator-mode/preview-panel/markdown-preview.gts +175 -0
- package/bundled-types/host-app/components/operator-mode/preview-panel/metadata-panel.gts +214 -0
- package/bundled-types/host-app/components/operator-mode/preview-panel/rendered-markdown.gts +718 -0
- package/bundled-types/host-app/components/operator-mode/private-dependency-violation.gts +70 -0
- package/bundled-types/host-app/components/operator-mode/profile/profile-email.gts +686 -0
- package/bundled-types/host-app/components/operator-mode/profile/profile-settings-modal.gts +454 -0
- package/bundled-types/host-app/components/operator-mode/profile/profile-subscription.gts +170 -0
- package/bundled-types/host-app/components/operator-mode/profile-info-popover.gts +263 -0
- package/bundled-types/host-app/components/operator-mode/publish-realm-modal.gts +1529 -0
- package/bundled-types/host-app/components/operator-mode/remove-field-modal.gts +135 -0
- package/bundled-types/host-app/components/operator-mode/send-error-to-ai-assistant.gts +195 -0
- package/bundled-types/host-app/components/operator-mode/stack-item.gts +1341 -0
- package/bundled-types/host-app/components/operator-mode/stack.gts +191 -0
- package/bundled-types/host-app/components/operator-mode/submode-layout.gts +781 -0
- package/bundled-types/host-app/components/operator-mode/syntax-error-display.gts +72 -0
- package/bundled-types/host-app/components/operator-mode/workspace-chooser/add-workspace.gts +282 -0
- package/bundled-types/host-app/components/operator-mode/workspace-chooser/index.gts +299 -0
- package/bundled-types/host-app/components/operator-mode/workspace-chooser/item-container.gts +50 -0
- package/bundled-types/host-app/components/operator-mode/workspace-chooser/workspace-loading-indicator.gts +50 -0
- package/bundled-types/host-app/components/operator-mode/workspace-chooser/workspace.gts +1079 -0
- package/bundled-types/host-app/components/pill-menu/index.gts +281 -0
- package/bundled-types/host-app/components/pill-menu/usage.gts +64 -0
- package/bundled-types/host-app/components/prerendered-card-search.gts +274 -0
- package/bundled-types/host-app/components/realm-dropdown.gts +209 -0
- package/bundled-types/host-app/components/realm-picker/index.gts +142 -0
- package/bundled-types/host-app/components/search-sheet/index.gts +426 -0
- package/bundled-types/host-app/components/search-sheet/usage.gts +99 -0
- package/bundled-types/host-app/components/submode-switcher.gts +260 -0
- package/bundled-types/host-app/components/type-picker/index.gts +111 -0
- package/bundled-types/host-app/components/with-known-realms-loaded.gts +47 -0
- package/bundled-types/host-app/components/with-loaded-realm.gts +39 -0
- package/bundled-types/host-app/components/with-subscription-data.gts +247 -0
- package/bundled-types/host-app/config/environment.ts +66 -0
- package/bundled-types/host-app/deprecation-workflow.js +30 -0
- package/bundled-types/host-app/lib/browser-queue.ts +198 -0
- package/bundled-types/host-app/lib/codemirror-context.ts +1081 -0
- package/bundled-types/host-app/lib/command-definitions.ts +41 -0
- package/bundled-types/host-app/lib/download-realm.ts +9 -0
- package/bundled-types/host-app/lib/example-card-helpers.ts +99 -0
- package/bundled-types/host-app/lib/externals.ts +247 -0
- package/bundled-types/host-app/lib/field-path-parser.ts +520 -0
- package/bundled-types/host-app/lib/file-def-manager.ts +712 -0
- package/bundled-types/host-app/lib/file-upload-state.ts +6 -0
- package/bundled-types/host-app/lib/formatted-message/utils.ts +272 -0
- package/bundled-types/host-app/lib/gc-card-store.ts +1084 -0
- package/bundled-types/host-app/lib/host-base-command.ts +29 -0
- package/bundled-types/host-app/lib/html-component.ts +144 -0
- package/bundled-types/host-app/lib/html-to-markdown.ts +96 -0
- package/bundled-types/host-app/lib/isolated-render.gts +90 -0
- package/bundled-types/host-app/lib/known-file-meta-urls.ts +17 -0
- package/bundled-types/host-app/lib/limited-set.ts +68 -0
- package/bundled-types/host-app/lib/matrix-classes/member.ts +28 -0
- package/bundled-types/host-app/lib/matrix-classes/message-builder.ts +444 -0
- package/bundled-types/host-app/lib/matrix-classes/message-code-patch-result.ts +44 -0
- package/bundled-types/host-app/lib/matrix-classes/message-command.ts +109 -0
- package/bundled-types/host-app/lib/matrix-classes/message.ts +239 -0
- package/bundled-types/host-app/lib/matrix-classes/room.ts +174 -0
- package/bundled-types/host-app/lib/matrix-utils.ts +114 -0
- package/bundled-types/host-app/lib/mutex.ts +62 -0
- package/bundled-types/host-app/lib/prerender-fetch-headers.ts +46 -0
- package/bundled-types/host-app/lib/prerender-util.ts +31 -0
- package/bundled-types/host-app/lib/public-path.ts +1 -0
- package/bundled-types/host-app/lib/random-name.ts +26 -0
- package/bundled-types/host-app/lib/realm-utils.ts +45 -0
- package/bundled-types/host-app/lib/search-cache-key.ts +33 -0
- package/bundled-types/host-app/lib/search-in-flight-key.ts +28 -0
- package/bundled-types/host-app/lib/search-replace-block-parsing.ts +101 -0
- package/bundled-types/host-app/lib/setup-globals.ts +15 -0
- package/bundled-types/host-app/lib/sqlite-adapter.ts +510 -0
- package/bundled-types/host-app/lib/stack-item.ts +164 -0
- package/bundled-types/host-app/lib/utils.ts +84 -0
- package/bundled-types/host-app/lib/window-error-handler.ts +132 -0
- package/bundled-types/host-app/router.ts +31 -0
- package/bundled-types/host-app/services/ai-assistant-panel-service.ts +850 -0
- package/bundled-types/host-app/services/billing-service.ts +208 -0
- package/bundled-types/host-app/services/card-service.ts +373 -0
- package/bundled-types/host-app/services/card-type-service.ts +226 -0
- package/bundled-types/host-app/services/code-semantics-service.ts +297 -0
- package/bundled-types/host-app/services/command-service.ts +975 -0
- package/bundled-types/host-app/services/environment-service.ts +26 -0
- package/bundled-types/host-app/services/error-display.ts +42 -0
- package/bundled-types/host-app/services/file-upload.ts +212 -0
- package/bundled-types/host-app/services/host-mode-service.ts +381 -0
- package/bundled-types/host-app/services/host-mode-state-service.ts +160 -0
- package/bundled-types/host-app/services/loader-service.ts +148 -0
- package/bundled-types/host-app/services/local-indexer.ts +68 -0
- package/bundled-types/host-app/services/local-persistence-service.ts +296 -0
- package/bundled-types/host-app/services/logger-service.ts +13 -0
- package/bundled-types/host-app/services/matrix-sdk-loader.ts +346 -0
- package/bundled-types/host-app/services/matrix-service.ts +2287 -0
- package/bundled-types/host-app/services/message-service.ts +84 -0
- package/bundled-types/host-app/services/module-contents-service.ts +333 -0
- package/bundled-types/host-app/services/monaco-service.ts +333 -0
- package/bundled-types/host-app/services/network.ts +101 -0
- package/bundled-types/host-app/services/operator-mode-state-service.ts +1591 -0
- package/bundled-types/host-app/services/playground-panel-service.ts +236 -0
- package/bundled-types/host-app/services/queue.ts +30 -0
- package/bundled-types/host-app/services/realm-info-service.ts +37 -0
- package/bundled-types/host-app/services/realm-server.ts +1209 -0
- package/bundled-types/host-app/services/realm.ts +1413 -0
- package/bundled-types/host-app/services/recent-cards-service.ts +174 -0
- package/bundled-types/host-app/services/recent-files-service.ts +224 -0
- package/bundled-types/host-app/services/render-error-state.ts +55 -0
- package/bundled-types/host-app/services/render-service.ts +362 -0
- package/bundled-types/host-app/services/render-store.ts +27 -0
- package/bundled-types/host-app/services/reset.ts +19 -0
- package/bundled-types/host-app/services/scroll-position-service.ts +81 -0
- package/bundled-types/host-app/services/spec-panel-service.ts +107 -0
- package/bundled-types/host-app/services/store.ts +2540 -0
- package/bundled-types/host-app/utils/assert-never.ts +3 -0
- package/bundled-types/host-app/utils/auth-error-guard.ts +183 -0
- package/bundled-types/host-app/utils/auth-service-worker-registration.ts +123 -0
- package/bundled-types/host-app/utils/card-search/query-builder.ts +169 -0
- package/bundled-types/host-app/utils/card-search/section-pagination.ts +57 -0
- package/bundled-types/host-app/utils/card-search/sections.ts +240 -0
- package/bundled-types/host-app/utils/card-search/type-filter.ts +124 -0
- package/bundled-types/host-app/utils/card-search/types.ts +11 -0
- package/bundled-types/host-app/utils/card-search/url.ts +23 -0
- package/bundled-types/host-app/utils/clipboard.ts +23 -0
- package/bundled-types/host-app/utils/editor/boxel-formatter.ts +65 -0
- package/bundled-types/host-app/utils/editor/editor-language.ts +88 -0
- package/bundled-types/host-app/utils/editor/monaco-test-waiter.ts +302 -0
- package/bundled-types/host-app/utils/file-def-attributes-extractor.ts +438 -0
- package/bundled-types/host-app/utils/file-name.ts +38 -0
- package/bundled-types/host-app/utils/id-from-card-or-url.ts +11 -0
- package/bundled-types/host-app/utils/lint-formatting.ts +57 -0
- package/bundled-types/host-app/utils/local-storage-keys.ts +28 -0
- package/bundled-types/host-app/utils/normalized-dir-path.ts +3 -0
- package/bundled-types/host-app/utils/prettify-messages.ts +21 -0
- package/bundled-types/host-app/utils/prettify-prompts.ts +21 -0
- package/bundled-types/host-app/utils/realm-index-boilerplate.ts +27 -0
- package/bundled-types/host-app/utils/register-boxel-transition.ts +17 -0
- package/bundled-types/host-app/utils/render-desync-detector.ts +362 -0
- package/bundled-types/host-app/utils/render-error.ts +455 -0
- package/bundled-types/host-app/utils/render-timer-stub.ts +249 -0
- package/bundled-types/host-app/utils/run-while-active.ts +14 -0
- package/bundled-types/host-app/utils/schema-editor.ts +25 -0
- package/bundled-types/host-app/utils/text-suggestion.ts +82 -0
- package/bundled-types/host-app/utils/titleize.ts +10 -0
- package/bundled-types/host-app/utils/uuid.ts +13 -0
- package/bundled-types/host-tests/helpers/adapter.ts +464 -0
- package/bundled-types/host-tests/helpers/base-realm.ts +464 -0
- package/bundled-types/host-tests/helpers/cards/view-card-demo.ts +119 -0
- package/bundled-types/host-tests/helpers/field-test-helpers.gts +54 -0
- package/bundled-types/host-tests/helpers/image-fixture.ts +3 -0
- package/bundled-types/host-tests/helpers/index.gts +2099 -0
- package/bundled-types/host-tests/helpers/indexer.ts +293 -0
- package/bundled-types/host-tests/helpers/interact-submode-setup.gts +551 -0
- package/bundled-types/host-tests/helpers/mock-matrix/_client.ts +1042 -0
- package/bundled-types/host-tests/helpers/mock-matrix/_sdk.ts +71 -0
- package/bundled-types/host-tests/helpers/mock-matrix/_server-state.ts +343 -0
- package/bundled-types/host-tests/helpers/mock-matrix/_sliding-sync.ts +140 -0
- package/bundled-types/host-tests/helpers/mock-matrix/_utils.ts +146 -0
- package/bundled-types/host-tests/helpers/mock-matrix.ts +200 -0
- package/bundled-types/host-tests/helpers/operator-mode-parameters-match.ts +71 -0
- package/bundled-types/host-tests/helpers/operator-mode-state.ts +18 -0
- package/bundled-types/host-tests/helpers/percy-snapshot.ts +228 -0
- package/bundled-types/host-tests/helpers/playground.ts +130 -0
- package/bundled-types/host-tests/helpers/realm-server-mock/index.ts +100 -0
- package/bundled-types/host-tests/helpers/realm-server-mock/routes.ts +617 -0
- package/bundled-types/host-tests/helpers/realm-server-mock/types.ts +24 -0
- package/bundled-types/host-tests/helpers/recent-files-cards.ts +86 -0
- package/bundled-types/host-tests/helpers/render-component.ts +40 -0
- package/bundled-types/host-tests/helpers/setup-qunit.js +164 -0
- package/bundled-types/host-tests/helpers/setup.ts +349 -0
- package/bundled-types/host-tests/helpers/shard-warmup.ts +72 -0
- package/bundled-types/host-tests/helpers/stream.ts +60 -0
- package/bundled-types/host-tests/helpers/test-auth.ts +27 -0
- package/bundled-types/host-tests/helpers/test-realm-registry.ts +23 -0
- package/bundled-types/host-tests/helpers/test-realm-service-worker.ts +92 -0
- package/bundled-types/host-tests/helpers/uncaught-exceptions.ts +16 -0
- package/bundled-types/host-tests/helpers/visit-operator-mode.ts +39 -0
- package/bundled-types/host-types/@cardstack/host/index.d.ts +3 -0
- package/bundled-types/host-types/@joplin/turndown-plugin-gfm/index.d.ts +15 -0
- package/bundled-types/host-types/@sqlite.org/sqlite-wasm/index.d.ts +122 -0
- package/bundled-types/host-types/ember-click-outside/modifiers/on-click-outside.ts +16 -0
- package/bundled-types/host-types/ember-concurrency/helpers/perform.d.ts +3 -0
- package/bundled-types/host-types/ember-css-url/index.d.ts +15 -0
- package/bundled-types/host-types/ember-data/types/registries/model.d.ts +6 -0
- package/bundled-types/host-types/ember-elsewhere/from-elsewhere.d.ts +12 -0
- package/bundled-types/host-types/ember-elsewhere/to-elsewhere.d.ts +16 -0
- package/bundled-types/host-types/ember-focus-trap/index.d.ts +4 -0
- package/bundled-types/host-types/ember-keyboard/modifiers/on-key.d.ts +15 -0
- package/bundled-types/host-types/index.d.ts +6 -0
- package/bundled-types/local-types/eslint-js.d.ts +5 -0
- package/bundled-types/local-types/index.d.ts +115 -0
- package/bundled-types/local-types/marked-gfm-heading-id.d.ts +12 -0
- package/bundled-types/local-types/matrix-js-sdk/index.d.ts +11 -0
- package/bundled-types/local-types/package.json +13 -0
- package/bundled-types/shims/boxel-cli-shims.d.ts +10 -0
- package/dist/index.js +100 -100
- package/package.json +13 -7
- package/src/commands/parse.ts +277 -34
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { guidFor } from '@ember/object/internals';
|
|
2
|
+
import { cached, tracked } from '@glimmer/tracking';
|
|
3
|
+
|
|
4
|
+
import { TrackedArray } from 'tracked-built-ins';
|
|
5
|
+
|
|
6
|
+
import { escapeHtmlOutsideCodeBlocks } from '@cardstack/runtime-common/helpers/html';
|
|
7
|
+
import { markdownToHtml } from '@cardstack/runtime-common/marked-sync';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
parseHtmlContent,
|
|
11
|
+
type HtmlTagGroup,
|
|
12
|
+
} from '@cardstack/host/lib/formatted-message/utils';
|
|
13
|
+
|
|
14
|
+
import type { FileDef } from 'https://cardstack.com/base/file-api';
|
|
15
|
+
|
|
16
|
+
import type { RoomMember } from './member';
|
|
17
|
+
|
|
18
|
+
import type MessageCodePatchResult from './message-code-patch-result';
|
|
19
|
+
|
|
20
|
+
import type MessageCommand from './message-command';
|
|
21
|
+
import type { EventStatus } from 'matrix-js-sdk';
|
|
22
|
+
|
|
23
|
+
const ErrorMessage: Record<string, string> = {
|
|
24
|
+
['M_TOO_LARGE']: 'Message is too large',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
type RoomMessageInterface = RoomMessageRequired & RoomMessageOptional;
|
|
28
|
+
|
|
29
|
+
interface RoomMessageRequired {
|
|
30
|
+
roomId: string;
|
|
31
|
+
author: RoomMember;
|
|
32
|
+
created: Date;
|
|
33
|
+
updated: Date;
|
|
34
|
+
body: string;
|
|
35
|
+
eventId: string;
|
|
36
|
+
status: EventStatus | null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface RoomMessageOptional {
|
|
40
|
+
transactionId?: string | null;
|
|
41
|
+
attachedCardIds?: string[] | null;
|
|
42
|
+
attachedFiles?: FileDef[];
|
|
43
|
+
isStreamingFinished?: boolean;
|
|
44
|
+
index?: number;
|
|
45
|
+
errorMessage?: string;
|
|
46
|
+
clientGeneratedId?: string | null;
|
|
47
|
+
reasoningContent?: string | null;
|
|
48
|
+
isDebugMessage?: boolean;
|
|
49
|
+
reloadBillingData?: boolean;
|
|
50
|
+
hasContinuation?: boolean;
|
|
51
|
+
continuationOf?: string | null;
|
|
52
|
+
agentId?: string;
|
|
53
|
+
isCodePatchCorrectness?: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export class Message implements RoomMessageInterface {
|
|
57
|
+
@tracked _body: string;
|
|
58
|
+
@tracked _reasoningContent?: string | null;
|
|
59
|
+
@tracked _commands: TrackedArray<MessageCommand>;
|
|
60
|
+
@tracked codePatchResults: TrackedArray<MessageCodePatchResult>;
|
|
61
|
+
@tracked created: Date;
|
|
62
|
+
@tracked _isStreamingFinished?: boolean;
|
|
63
|
+
@tracked _isCanceled?: boolean;
|
|
64
|
+
@tracked hasContinuation?: boolean;
|
|
65
|
+
@tracked continuedInMessage?: Message | null;
|
|
66
|
+
@tracked continuationOf?: string | null;
|
|
67
|
+
|
|
68
|
+
attachedCardIds?: string[] | null;
|
|
69
|
+
attachedFiles?: FileDef[];
|
|
70
|
+
attachedCardsAsFiles?: FileDef[];
|
|
71
|
+
attachedSkillCardIds?: string[] | null;
|
|
72
|
+
index?: number;
|
|
73
|
+
transactionId?: string | null;
|
|
74
|
+
@tracked errorMessage?: string;
|
|
75
|
+
clientGeneratedId?: string;
|
|
76
|
+
isDebugMessage?: boolean;
|
|
77
|
+
reloadBillingData?: boolean;
|
|
78
|
+
isCodePatchCorrectness?: boolean;
|
|
79
|
+
|
|
80
|
+
author: RoomMember;
|
|
81
|
+
@tracked status: EventStatus | null;
|
|
82
|
+
@tracked _updated: Date;
|
|
83
|
+
eventId: string;
|
|
84
|
+
roomId: string;
|
|
85
|
+
agentId?: string;
|
|
86
|
+
|
|
87
|
+
//This property is used for testing purpose
|
|
88
|
+
instanceId: string;
|
|
89
|
+
|
|
90
|
+
constructor(init: RoomMessageInterface) {
|
|
91
|
+
this._body = init.body;
|
|
92
|
+
this._reasoningContent = init.reasoningContent;
|
|
93
|
+
this._commands = new TrackedArray<MessageCommand>();
|
|
94
|
+
this.author = init.author;
|
|
95
|
+
this.eventId = init.eventId;
|
|
96
|
+
this.created = init.created;
|
|
97
|
+
this._updated = init.updated;
|
|
98
|
+
this.status = init.status;
|
|
99
|
+
this.roomId = init.roomId;
|
|
100
|
+
this.agentId = init.agentId;
|
|
101
|
+
this.attachedFiles = init.attachedFiles;
|
|
102
|
+
this.hasContinuation = init.hasContinuation;
|
|
103
|
+
this.continuationOf = init.continuationOf;
|
|
104
|
+
this._reasoningContent = init.reasoningContent;
|
|
105
|
+
this._commands = new TrackedArray<MessageCommand>();
|
|
106
|
+
this.codePatchResults = new TrackedArray<MessageCodePatchResult>();
|
|
107
|
+
this.instanceId = guidFor(this);
|
|
108
|
+
this.isCodePatchCorrectness = false;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
get isRetryable() {
|
|
112
|
+
return (
|
|
113
|
+
this.errorMessage === undefined ||
|
|
114
|
+
(this.errorMessage && this.errorMessage !== ErrorMessage['M_TOO_LARGE'])
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
get reasoningContent(): string {
|
|
119
|
+
return [this._reasoningContent, this.continuedReasoningContent]
|
|
120
|
+
.filter(Boolean)
|
|
121
|
+
.join('');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
setReasoningContent(reasoningContent: string | null) {
|
|
125
|
+
if (this._reasoningContent !== reasoningContent) {
|
|
126
|
+
this._reasoningContent = reasoningContent;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
get continuedReasoningContent() {
|
|
131
|
+
return this.continuedInMessage?.reasoningContent ?? '';
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
get body(): string {
|
|
135
|
+
return [this._body, this.continuedBody].filter(Boolean).join('');
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
setBody(body: string) {
|
|
139
|
+
if (this._body !== body) {
|
|
140
|
+
this._body = body;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
get continuedBody() {
|
|
145
|
+
return this.continuedInMessage?.body;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
get commands(): MessageCommand[] {
|
|
149
|
+
return (this.continuedInMessage?.commands?.length ?? 0) > 0
|
|
150
|
+
? this.continuedInMessage!.commands
|
|
151
|
+
: (this._commands ?? []);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
setCommands(commands: MessageCommand[]) {
|
|
155
|
+
this._commands = new TrackedArray<MessageCommand>(commands);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
get continuedCommands() {
|
|
159
|
+
return this.continuedInMessage?.commands;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
setIsStreamingFinished(isStreamingFinished: boolean | undefined) {
|
|
163
|
+
if (this._isStreamingFinished !== isStreamingFinished) {
|
|
164
|
+
this._isStreamingFinished = isStreamingFinished;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
setIsCanceled(isCanceled: boolean | undefined) {
|
|
169
|
+
if (this._isCanceled !== isCanceled) {
|
|
170
|
+
this._isCanceled = isCanceled;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
get isCanceled(): boolean {
|
|
175
|
+
return this._isCanceled ?? false;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
get isStreamingFinished(): boolean | undefined {
|
|
179
|
+
if (this.hasContinuation) {
|
|
180
|
+
return this.continuedInMessage?.isStreamingFinished ?? false;
|
|
181
|
+
}
|
|
182
|
+
return this._isStreamingFinished;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
get isStreamingOfEventFinished(): boolean {
|
|
186
|
+
return this._isStreamingFinished === true;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
get updated(): Date {
|
|
190
|
+
return this.continuedInMessage?.updated ?? this._updated;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
setUpdated(updated: Date) {
|
|
194
|
+
if (this._updated.getTime() !== updated.getTime()) {
|
|
195
|
+
this._updated = updated;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@cached
|
|
200
|
+
get bodyHTML() {
|
|
201
|
+
// message is expected to be in markdown so we need to convert the markdown to html when the message is sent by the ai bot
|
|
202
|
+
if (!this.body) {
|
|
203
|
+
return this.body;
|
|
204
|
+
}
|
|
205
|
+
return markdownToHtml(escapeHtmlOutsideCodeBlocks(this.body), {
|
|
206
|
+
sanitize: false,
|
|
207
|
+
escapeHtmlInCodeBlocks: true,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/*
|
|
212
|
+
We are splitting the html into parts so that we can target the
|
|
213
|
+
code blocks (<pre> tags) and apply Monaco editor to them. Here is an
|
|
214
|
+
example of the html argument:
|
|
215
|
+
|
|
216
|
+
<p>Here is some code for you.</p>
|
|
217
|
+
<pre data-codeblock="javascript">const x = 1;</pre>
|
|
218
|
+
<p>I hope you like this code. But here is some more!</p>
|
|
219
|
+
<pre data-codeblock="javascript">const y = 2;</pre>
|
|
220
|
+
<p>Feel free to use it in your project.</p>
|
|
221
|
+
|
|
222
|
+
A drawback of this approach is that we can't render monaco editors for
|
|
223
|
+
code blocks that are nested inside other elements. We should make sure
|
|
224
|
+
our skills teach the model to respond with code blocks that are not nested
|
|
225
|
+
inside other elements.
|
|
226
|
+
*/
|
|
227
|
+
@cached
|
|
228
|
+
get htmlParts(): HtmlTagGroup[] {
|
|
229
|
+
let htmlParts = parseHtmlContent(this.bodyHTML, this.roomId, this.eventId);
|
|
230
|
+
if (this._isCanceled) {
|
|
231
|
+
htmlParts.push({
|
|
232
|
+
type: 'non_pre_tag',
|
|
233
|
+
content: '<p style="font-weight: bold;">{Generation Cancelled}</p>',
|
|
234
|
+
codeData: null,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
return htmlParts;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { cached, tracked } from '@glimmer/tracking';
|
|
2
|
+
|
|
3
|
+
import EventEmitter from 'eventemitter3';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
APP_BOXEL_ACTIVE_LLM,
|
|
7
|
+
APP_BOXEL_ROOM_SKILLS_EVENT_TYPE,
|
|
8
|
+
APP_BOXEL_LLM_MODE,
|
|
9
|
+
type LLMMode,
|
|
10
|
+
} from '@cardstack/runtime-common/matrix-constants';
|
|
11
|
+
|
|
12
|
+
import type { SerializedFile } from 'https://cardstack.com/base/file-api';
|
|
13
|
+
import type {
|
|
14
|
+
ActiveLLMEvent,
|
|
15
|
+
MatrixEvent as DiscreteMatrixEvent,
|
|
16
|
+
} from 'https://cardstack.com/base/matrix-event';
|
|
17
|
+
|
|
18
|
+
import Mutex from '../mutex';
|
|
19
|
+
|
|
20
|
+
import type { IEvent } from 'matrix-js-sdk';
|
|
21
|
+
|
|
22
|
+
import type * as MatrixSDK from 'matrix-js-sdk';
|
|
23
|
+
|
|
24
|
+
export type TempEvent = Partial<IEvent> & {
|
|
25
|
+
status: MatrixSDK.EventStatus | null;
|
|
26
|
+
error?: MatrixSDK.MatrixError;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type SkillsConfig = {
|
|
30
|
+
enabledSkillCards: SerializedFile[];
|
|
31
|
+
disabledSkillCards: SerializedFile[];
|
|
32
|
+
commandDefinitions: SerializedFile[];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default class Room {
|
|
36
|
+
@tracked private _events: DiscreteMatrixEvent[] = [];
|
|
37
|
+
@tracked private _roomState: MatrixSDK.RoomState | undefined;
|
|
38
|
+
|
|
39
|
+
constructor(public readonly roomId: string) {}
|
|
40
|
+
|
|
41
|
+
readonly mutex = new Mutex();
|
|
42
|
+
private readonly emitter = new EventEmitter();
|
|
43
|
+
|
|
44
|
+
waitForNextEvent(): Promise<void> {
|
|
45
|
+
return new Promise((resolve) => {
|
|
46
|
+
this.emitter.once('event.added', resolve);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
get events() {
|
|
51
|
+
return this._events;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
get name() {
|
|
55
|
+
return this._roomState?.events.get('m.room.name')?.get('')?.event.content
|
|
56
|
+
?.name;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@cached
|
|
60
|
+
get memberIds(): string[] {
|
|
61
|
+
let memberEvents = (this._roomState?.events
|
|
62
|
+
.get('m.room.member')
|
|
63
|
+
?.values() ?? []) as MatrixSDK.MatrixEvent[];
|
|
64
|
+
let memberIds = [...memberEvents.map((ev) => ev.event.state_key)];
|
|
65
|
+
return memberIds.filter((id) => id !== undefined) as string[];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
hasActiveMember(userId: string): boolean {
|
|
69
|
+
let memberEvent = this._roomState?.events.get('m.room.member')?.get(userId);
|
|
70
|
+
let membership = memberEvent?.event.content?.membership;
|
|
71
|
+
return membership === 'join' || membership === 'invite';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
notifyRoomStateUpdated(rs: MatrixSDK.RoomState) {
|
|
75
|
+
this._roomState = rs; // this is usually the same object, but some internal state has changed. This assignment kicks off reactivity.
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get hasRoomState() {
|
|
79
|
+
return this._roomState !== undefined;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
get skillsConfig() {
|
|
83
|
+
const content = this._roomState?.events
|
|
84
|
+
.get(APP_BOXEL_ROOM_SKILLS_EVENT_TYPE)
|
|
85
|
+
?.get('')?.event.content ?? {
|
|
86
|
+
enabledSkillCards: [],
|
|
87
|
+
disabledSkillCards: [],
|
|
88
|
+
commandDefinitions: [],
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
enabledSkillCards: content.enabledSkillCards
|
|
93
|
+
? content.enabledSkillCards
|
|
94
|
+
: [],
|
|
95
|
+
disabledSkillCards: content.disabledSkillCards
|
|
96
|
+
? content.disabledSkillCards
|
|
97
|
+
: [],
|
|
98
|
+
commandDefinitions: content.commandDefinitions ?? [],
|
|
99
|
+
} as {
|
|
100
|
+
enabledSkillCards: SerializedFile[];
|
|
101
|
+
disabledSkillCards: SerializedFile[];
|
|
102
|
+
commandDefinitions: SerializedFile[];
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
get activeLLMEventContent(): ActiveLLMEvent['content'] | undefined {
|
|
107
|
+
let event = this._roomState?.events
|
|
108
|
+
.get(APP_BOXEL_ACTIVE_LLM)
|
|
109
|
+
?.get('')?.event;
|
|
110
|
+
return (event as ActiveLLMEvent)?.content;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
get activeLLM() {
|
|
114
|
+
return this.activeLLMEventContent?.model;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
get activeInputModalities(): string[] | undefined {
|
|
118
|
+
return this.activeLLMEventContent?.inputModalities;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
get activeLLMMode(): LLMMode {
|
|
122
|
+
let event = this._roomState?.events.get(APP_BOXEL_LLM_MODE)?.get('')?.event;
|
|
123
|
+
return event && (event as any).content?.mode
|
|
124
|
+
? ((event as any).content.mode as LLMMode)
|
|
125
|
+
: 'ask';
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
addEvent(event: TempEvent, oldEventId?: string) {
|
|
129
|
+
let { event_id: eventId, state_key: stateKey } = event;
|
|
130
|
+
eventId = eventId ?? stateKey; // room state may not necessary have an event ID
|
|
131
|
+
|
|
132
|
+
// If we are receiving an event which contains
|
|
133
|
+
// a data field, we may need to parse it
|
|
134
|
+
// because matrix doesn't support all json types
|
|
135
|
+
// Corresponding encoding is done in
|
|
136
|
+
// sendEvent in the matrix-service
|
|
137
|
+
if (event.content?.data) {
|
|
138
|
+
if (typeof event.content.data === 'string') {
|
|
139
|
+
event.content.data = JSON.parse(event.content.data);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
eventId = eventId ?? stateKey; // room state may not necessary have an event ID
|
|
143
|
+
if (!eventId) {
|
|
144
|
+
throw new Error(
|
|
145
|
+
`bug: event ID is undefined for event ${JSON.stringify(
|
|
146
|
+
event,
|
|
147
|
+
null,
|
|
148
|
+
2,
|
|
149
|
+
)}`,
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
// duplicate events may be emitted from matrix, as well as the resolved room card might already contain this event
|
|
153
|
+
let matchingEvents = this._events.filter(
|
|
154
|
+
(e) => e.event_id === eventId || e.event_id === oldEventId,
|
|
155
|
+
);
|
|
156
|
+
if (matchingEvents.length > 1) {
|
|
157
|
+
throw new Error(
|
|
158
|
+
`bug: ${matchingEvents.length} events with the same event_id(s): ${eventId}, ${oldEventId}, expected a maximum of 1`,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
if (matchingEvents.length === 0) {
|
|
162
|
+
this._events = [
|
|
163
|
+
...(this._events ?? []),
|
|
164
|
+
event as unknown as DiscreteMatrixEvent,
|
|
165
|
+
];
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
let eventToReplace = matchingEvents[0];
|
|
169
|
+
let eventIndex = this._events.indexOf(eventToReplace);
|
|
170
|
+
this._events[eventIndex] = event as unknown as DiscreteMatrixEvent;
|
|
171
|
+
this._events = [...this._events];
|
|
172
|
+
this.emitter.emit('event.added');
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import difference from 'lodash/difference';
|
|
2
|
+
|
|
3
|
+
export interface MatrixError {
|
|
4
|
+
data: {
|
|
5
|
+
errcode: string;
|
|
6
|
+
error: string;
|
|
7
|
+
retry_after_ms?: number;
|
|
8
|
+
};
|
|
9
|
+
httpStatus: number;
|
|
10
|
+
errcode: string;
|
|
11
|
+
}
|
|
12
|
+
export const eventDebounceMs = 100;
|
|
13
|
+
|
|
14
|
+
export function isMatrixError(err: any): err is MatrixError {
|
|
15
|
+
return (
|
|
16
|
+
typeof err === 'object' &&
|
|
17
|
+
'data' in err &&
|
|
18
|
+
typeof err.data === 'object' &&
|
|
19
|
+
'errcode' in err.data &&
|
|
20
|
+
typeof err.data.errcode === 'string' &&
|
|
21
|
+
'error' in err.data &&
|
|
22
|
+
typeof err.data.error === 'string' &&
|
|
23
|
+
'httpStatus' in err &&
|
|
24
|
+
typeof err.httpStatus === 'number' &&
|
|
25
|
+
'errcode' in err &&
|
|
26
|
+
typeof err.errcode === 'string'
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function isValidPassword(password: string): boolean {
|
|
31
|
+
return password?.length >= 8;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface InteractiveAuth {
|
|
35
|
+
completed?: string[];
|
|
36
|
+
session: string;
|
|
37
|
+
flows: Flow[];
|
|
38
|
+
error?: string;
|
|
39
|
+
errcode?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface Flow {
|
|
43
|
+
stages: string[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function isFlow(flow: any): flow is Flow {
|
|
47
|
+
if (
|
|
48
|
+
typeof flow === 'object' &&
|
|
49
|
+
'stages' in flow &&
|
|
50
|
+
Array.isArray(flow.stages)
|
|
51
|
+
) {
|
|
52
|
+
if (flow.stages.find((s: any) => typeof s !== 'string')) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function isInteractiveAuth(json: any): json is InteractiveAuth {
|
|
61
|
+
if (
|
|
62
|
+
typeof json === 'object' &&
|
|
63
|
+
'session' in json &&
|
|
64
|
+
typeof json.session === 'string' &&
|
|
65
|
+
'flows' in json &&
|
|
66
|
+
Array.isArray(json.flows)
|
|
67
|
+
) {
|
|
68
|
+
if ('error' in json && typeof json.error !== 'string') {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
if ('errcode' in json && typeof json.errcode !== 'string') {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
if ('completed' in json && !Array.isArray(json.completed)) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
if (
|
|
78
|
+
'completed' in json &&
|
|
79
|
+
json.completed.length > 0 &&
|
|
80
|
+
json.completed.find((c: any) => typeof c !== 'string')
|
|
81
|
+
) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return json.flows.every((f: any) => isFlow(f));
|
|
86
|
+
}
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function nextUncompletedStage(authFlow: InteractiveAuth) {
|
|
91
|
+
if (authFlow.flows.length === 0) {
|
|
92
|
+
throw new Error(
|
|
93
|
+
`Completed all interactive auth stages but encountered unsuccessful interactive auth response: ${JSON.stringify(
|
|
94
|
+
authFlow,
|
|
95
|
+
null,
|
|
96
|
+
2,
|
|
97
|
+
)}`,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
let remainingStages = difference(
|
|
101
|
+
authFlow.flows[0].stages,
|
|
102
|
+
authFlow.completed ?? [],
|
|
103
|
+
);
|
|
104
|
+
if (remainingStages.length === 0) {
|
|
105
|
+
throw new Error(
|
|
106
|
+
`Completed all interactive auth stages but encountered unsuccessful interactive auth response: ${JSON.stringify(
|
|
107
|
+
authFlow,
|
|
108
|
+
null,
|
|
109
|
+
2,
|
|
110
|
+
)}`,
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
return remainingStages[0];
|
|
114
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { buildWaiter } from '@ember/test-waiters';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
This class uses promises to implement a "mutex", which is a type of lock that can be used to
|
|
5
|
+
ensure only one block of provided async code is run at a time, and that they are run in the
|
|
6
|
+
order they were requested.
|
|
7
|
+
|
|
8
|
+
It uses Ember's test waiter API to ensure that tests wait for any code waiting for the lock to complete execution.
|
|
9
|
+
|
|
10
|
+
Usage example:
|
|
11
|
+
|
|
12
|
+
// Usage example
|
|
13
|
+
const mutex = new Mutex();
|
|
14
|
+
|
|
15
|
+
async function criticalSection(num: number) {
|
|
16
|
+
await mutex.dispatch(async () => {
|
|
17
|
+
await new Promise((resolve) => setTimeout(resolve, Math.random() * 100));
|
|
18
|
+
console.log('Critical section ' + num);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
criticalSection(1);
|
|
22
|
+
criticalSection(2);
|
|
23
|
+
criticalSection(3);
|
|
24
|
+
|
|
25
|
+
// Output: (order is guaranteed despite the calling code not waiting to call the function three times and the random delays)
|
|
26
|
+
// -> Critical section 1
|
|
27
|
+
// -> Critical section 2
|
|
28
|
+
// -> Critical section 3
|
|
29
|
+
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
const waiter = buildWaiter('mutex:waiter');
|
|
33
|
+
|
|
34
|
+
export default class Mutex {
|
|
35
|
+
private mutex = Promise.resolve();
|
|
36
|
+
|
|
37
|
+
// This method is private because the dispatch method is a less
|
|
38
|
+
// dangerous way to use the mutex. If we encounter a situation
|
|
39
|
+
// where we need to expose this method, we can do so.
|
|
40
|
+
private async lock(): Promise<() => void> {
|
|
41
|
+
let begin: (unlock: () => void) => void = (_unlock) => {};
|
|
42
|
+
|
|
43
|
+
this.mutex = this.mutex.then(() => {
|
|
44
|
+
return new Promise(begin);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return new Promise((res) => {
|
|
48
|
+
begin = res;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async dispatch<T>(fn: (() => T) | (() => Promise<T>)): Promise<T> {
|
|
53
|
+
const token = waiter.beginAsync();
|
|
54
|
+
const unlock = await this.lock();
|
|
55
|
+
try {
|
|
56
|
+
return await fn();
|
|
57
|
+
} finally {
|
|
58
|
+
unlock();
|
|
59
|
+
waiter.endAsync(token);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DURING_PRERENDER_HEADER,
|
|
3
|
+
X_BOXEL_CONSUMING_REALM_HEADER,
|
|
4
|
+
X_BOXEL_JOB_ID_HEADER,
|
|
5
|
+
} from '@cardstack/runtime-common';
|
|
6
|
+
|
|
7
|
+
// Set by the prerender server's `evaluateOnNewDocument` before the
|
|
8
|
+
// SPA boots — `__boxelDuringPrerender = true`. Read here so the
|
|
9
|
+
// realm-server fetch wrappers can attach the marker header on
|
|
10
|
+
// search calls only, narrowly scoping the signal to the endpoints
|
|
11
|
+
// that need it. See realm.ts:DURING_PRERENDER_HEADER for the full
|
|
12
|
+
// chain.
|
|
13
|
+
export function duringPrerenderHeaders(): Record<string, string> {
|
|
14
|
+
let flag = (globalThis as unknown as { __boxelDuringPrerender?: boolean })
|
|
15
|
+
.__boxelDuringPrerender;
|
|
16
|
+
return flag ? { [DURING_PRERENDER_HEADER]: '1' } : {};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// While rendering inside a prerender tab the render route writes
|
|
20
|
+
// `__boxelConsumingRealm` with the URL of the realm whose card is
|
|
21
|
+
// being rendered. Attach it to outbound search requests so the
|
|
22
|
+
// realm-server's job-scoped cache layer can gate caching on the
|
|
23
|
+
// indexer-traffic shape. Read each fetch (not cached at module
|
|
24
|
+
// scope) so a tab that renders cards from multiple realms in
|
|
25
|
+
// sequence sends the correct header per request. Returns an empty
|
|
26
|
+
// object when the global is not set so non-prerender (live SPA)
|
|
27
|
+
// fetches behave exactly as before.
|
|
28
|
+
export function consumingRealmHeader(): Record<string, string> {
|
|
29
|
+
let r = (globalThis as unknown as { __boxelConsumingRealm?: string })
|
|
30
|
+
.__boxelConsumingRealm;
|
|
31
|
+
return r ? { [X_BOXEL_CONSUMING_REALM_HEADER]: r } : {};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Companion to `consumingRealmHeader()`. The prerender server's
|
|
35
|
+
// `prerenderVisitAttempt` injects `__boxelJobId` onto the page
|
|
36
|
+
// before transitioning into the render route — see
|
|
37
|
+
// `packages/realm-server/prerender/render-runner.ts`. Read it on
|
|
38
|
+
// each fetch (not module-scope-cached) so a page reused across
|
|
39
|
+
// multiple visits picks up the current visit's job id. Outside a
|
|
40
|
+
// prerender tab the global is undefined and we send no header, so
|
|
41
|
+
// user / API callers continue to bypass the realm-server's
|
|
42
|
+
// job-scoped cache.
|
|
43
|
+
export function jobIdHeader(): Record<string, string> {
|
|
44
|
+
let j = (globalThis as unknown as { __boxelJobId?: string }).__boxelJobId;
|
|
45
|
+
return j ? { [X_BOXEL_JOB_ID_HEADER]: j } : {};
|
|
46
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
visitModuleDeps,
|
|
3
|
+
resolveCardReference,
|
|
4
|
+
type LooseCardResource,
|
|
5
|
+
type Loader,
|
|
6
|
+
} from '@cardstack/runtime-common';
|
|
7
|
+
|
|
8
|
+
export function directModuleDeps(
|
|
9
|
+
resource: LooseCardResource,
|
|
10
|
+
instanceURL: URL,
|
|
11
|
+
): string[] {
|
|
12
|
+
let result: string[] = [];
|
|
13
|
+
visitModuleDeps(resource, (moduleURL) => {
|
|
14
|
+
result.push(resolveCardReference(moduleURL, instanceURL));
|
|
15
|
+
});
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function transitiveModuleDeps(
|
|
20
|
+
directDeps: string[],
|
|
21
|
+
loader: Loader,
|
|
22
|
+
) {
|
|
23
|
+
return new Set([
|
|
24
|
+
...directDeps,
|
|
25
|
+
...(
|
|
26
|
+
await Promise.all(
|
|
27
|
+
directDeps.map((moduleDep) => loader.getConsumedModules(moduleDep)),
|
|
28
|
+
)
|
|
29
|
+
).flat(),
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis as any).__bootStart = performance.now();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
adjectives,
|
|
3
|
+
animals,
|
|
4
|
+
NumberDictionary,
|
|
5
|
+
uniqueNamesGenerator,
|
|
6
|
+
} from 'unique-names-generator';
|
|
7
|
+
|
|
8
|
+
const numberDictionary = NumberDictionary.generate({ min: 0, max: 99 });
|
|
9
|
+
|
|
10
|
+
export function generateRandomWorkspaceName(): string {
|
|
11
|
+
let includeNumber = Math.random() < 0.7;
|
|
12
|
+
let dictionaries = includeNumber
|
|
13
|
+
? [adjectives, animals, numberDictionary]
|
|
14
|
+
: [adjectives, animals];
|
|
15
|
+
|
|
16
|
+
let slug = uniqueNamesGenerator({
|
|
17
|
+
dictionaries,
|
|
18
|
+
separator: '-',
|
|
19
|
+
style: 'lowerCase',
|
|
20
|
+
});
|
|
21
|
+
return slug
|
|
22
|
+
.split('-')
|
|
23
|
+
.filter(Boolean)
|
|
24
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
25
|
+
.join(' ');
|
|
26
|
+
}
|