cursedbelt 1.0.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +1 -1
- package/dist/core/category/index.d.ts.map +1 -1
- package/dist/core/category/index.js +2 -1
- package/dist/core/category/index.js.map +1 -1
- package/dist/core/category/types.js +1 -1
- package/dist/core/category/types.js.map +1 -1
- package/dist/core/file-tree/fileTreeModel.d.ts +49 -0
- package/dist/core/file-tree/fileTreeModel.d.ts.map +1 -1
- package/dist/core/file-tree/fileTreeModel.js +84 -0
- package/dist/core/file-tree/fileTreeModel.js.map +1 -1
- package/dist/core/layout/index.js +1 -1
- package/dist/core/layout/index.js.map +1 -1
- package/dist/core/media/index.js +1 -1
- package/dist/core/media/index.js.map +1 -1
- package/dist/core/media/types.js +1 -1
- package/dist/core/media/types.js.map +1 -1
- package/dist/core/media/uploadLimits.js +1 -1
- package/dist/core/media/uploadLimits.js.map +1 -1
- package/dist/core/sharing/model.d.ts +1 -1
- package/dist/ctgr/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react/activity-bar/ActivityBar.d.ts +17 -0
- package/dist/react/activity-bar/ActivityBar.d.ts.map +1 -1
- package/dist/react/activity-bar/ActivityBar.js.map +1 -1
- package/dist/react/analytics/index.d.ts +1 -1
- package/dist/react/analytics/index.js +1 -1
- package/dist/react/chat/MessageComposer.d.ts.map +1 -1
- package/dist/react/chat/MessageComposer.js +5 -4
- package/dist/react/chat/MessageComposer.js.map +1 -1
- package/dist/react/components/Button.d.ts.map +1 -1
- package/dist/react/components/Button.js +3 -2
- package/dist/react/components/Button.js.map +1 -1
- package/dist/react/components/Checkbox.d.ts +19 -3
- package/dist/react/components/Checkbox.d.ts.map +1 -1
- package/dist/react/components/Checkbox.js +29 -12
- package/dist/react/components/Checkbox.js.map +1 -1
- package/dist/react/components/CodeArea.d.ts.map +1 -1
- package/dist/react/components/CodeArea.js +2 -1
- package/dist/react/components/CodeArea.js.map +1 -1
- package/dist/react/components/Collapsible.d.ts.map +1 -1
- package/dist/react/components/Collapsible.js +2 -1
- package/dist/react/components/Collapsible.js.map +1 -1
- package/dist/react/components/ComboboxField.d.ts.map +1 -1
- package/dist/react/components/ComboboxField.js +3 -2
- package/dist/react/components/ComboboxField.js.map +1 -1
- package/dist/react/components/CopyButton.d.ts.map +1 -1
- package/dist/react/components/CopyButton.js +2 -1
- package/dist/react/components/CopyButton.js.map +1 -1
- package/dist/react/components/DataTable/ColumnChecklist.d.ts.map +1 -1
- package/dist/react/components/DataTable/ColumnChecklist.js +2 -1
- package/dist/react/components/DataTable/ColumnChecklist.js.map +1 -1
- package/dist/react/components/DataTable/Pagination.d.ts.map +1 -1
- package/dist/react/components/DataTable/Pagination.js +2 -1
- package/dist/react/components/DataTable/Pagination.js.map +1 -1
- package/dist/react/components/DataTable/SortHeader.d.ts.map +1 -1
- package/dist/react/components/DataTable/SortHeader.js +2 -1
- package/dist/react/components/DataTable/SortHeader.js.map +1 -1
- package/dist/react/components/DataTable/TableFilterBuilder.d.ts +61 -0
- package/dist/react/components/DataTable/TableFilterBuilder.d.ts.map +1 -0
- package/dist/react/components/DataTable/{FilterBuilder.js → TableFilterBuilder.js} +26 -3
- package/dist/react/components/DataTable/TableFilterBuilder.js.map +1 -0
- package/dist/react/components/DataTable/Toolbar.d.ts +1 -1
- package/dist/react/components/DataTable/Toolbar.js +3 -3
- package/dist/react/components/DataTable/Toolbar.js.map +1 -1
- package/dist/react/components/DataTable/cells/LinkCell.d.ts.map +1 -1
- package/dist/react/components/DataTable/cells/LinkCell.js +2 -1
- package/dist/react/components/DataTable/cells/LinkCell.js.map +1 -1
- package/dist/react/components/DataTable/index.d.ts +1 -1
- package/dist/react/components/DataTable/index.d.ts.map +1 -1
- package/dist/react/components/DataTable/index.js +4 -1
- package/dist/react/components/DataTable/index.js.map +1 -1
- package/dist/react/components/DragHandle.d.ts.map +1 -1
- package/dist/react/components/DragHandle.js +2 -1
- package/dist/react/components/DragHandle.js.map +1 -1
- package/dist/react/components/EmojiField.d.ts.map +1 -1
- package/dist/react/components/EmojiField.js +2 -1
- package/dist/react/components/EmojiField.js.map +1 -1
- package/dist/react/components/EventTimeline.d.ts +3 -2
- package/dist/react/components/EventTimeline.d.ts.map +1 -1
- package/dist/react/components/EventTimeline.js +3 -2
- package/dist/react/components/EventTimeline.js.map +1 -1
- package/dist/react/components/IconButton.d.ts +1 -1
- package/dist/react/components/IconButton.js +1 -1
- package/dist/react/components/InfoHint.d.ts.map +1 -1
- package/dist/react/components/InfoHint.js +5 -4
- package/dist/react/components/InfoHint.js.map +1 -1
- package/dist/react/components/InheritBadge.js +1 -1
- package/dist/react/components/InheritBadge.js.map +1 -1
- package/dist/react/components/InlineEditableText.d.ts.map +1 -1
- package/dist/react/components/InlineEditableText.js +2 -1
- package/dist/react/components/InlineEditableText.js.map +1 -1
- package/dist/react/components/MeterList.d.ts.map +1 -1
- package/dist/react/components/MeterList.js +2 -1
- package/dist/react/components/MeterList.js.map +1 -1
- package/dist/react/components/PathText.d.ts +2 -2
- package/dist/react/components/PathText.d.ts.map +1 -1
- package/dist/react/components/PathText.js +2 -1
- package/dist/react/components/PathText.js.map +1 -1
- package/dist/react/components/RatingField.d.ts.map +1 -1
- package/dist/react/components/RatingField.js +2 -1
- package/dist/react/components/RatingField.js.map +1 -1
- package/dist/react/components/SecretInput.js +3 -2
- package/dist/react/components/SecretInput.js.map +1 -1
- package/dist/react/components/SegmentedControl.d.ts.map +1 -1
- package/dist/react/components/SegmentedControl.js +2 -1
- package/dist/react/components/SegmentedControl.js.map +1 -1
- package/dist/react/components/StarRating.d.ts.map +1 -1
- package/dist/react/components/StarRating.js +9 -5
- package/dist/react/components/StarRating.js.map +1 -1
- package/dist/react/components/StatStrip.d.ts.map +1 -1
- package/dist/react/components/StatStrip.js +2 -1
- package/dist/react/components/StatStrip.js.map +1 -1
- package/dist/react/components/StatTile.d.ts.map +1 -1
- package/dist/react/components/StatTile.js +3 -2
- package/dist/react/components/StatTile.js.map +1 -1
- package/dist/react/components/Tabs.d.ts.map +1 -1
- package/dist/react/components/Tabs.js +2 -1
- package/dist/react/components/Tabs.js.map +1 -1
- package/dist/react/components/TruncatedText.d.ts +2 -1
- package/dist/react/components/TruncatedText.d.ts.map +1 -1
- package/dist/react/components/TruncatedText.js +2 -1
- package/dist/react/components/TruncatedText.js.map +1 -1
- package/dist/react/components/calendar/MonthGrid.d.ts.map +1 -1
- package/dist/react/components/calendar/MonthGrid.js +2 -1
- package/dist/react/components/calendar/MonthGrid.js.map +1 -1
- package/dist/react/components/calendar/WeekView.d.ts.map +1 -1
- package/dist/react/components/calendar/WeekView.js +2 -1
- package/dist/react/components/calendar/WeekView.js.map +1 -1
- package/dist/react/components/revealOnHover.d.ts.map +1 -1
- package/dist/react/components/revealOnHover.js +2 -1
- package/dist/react/components/revealOnHover.js.map +1 -1
- package/dist/react/file-tree/FileTree.d.ts +50 -1
- package/dist/react/file-tree/FileTree.d.ts.map +1 -1
- package/dist/react/file-tree/FileTree.js +234 -6
- package/dist/react/file-tree/FileTree.js.map +1 -1
- package/dist/react/file-tree/fileTree.css +52 -0
- package/dist/react/filter-rail/FilterRail.d.ts.map +1 -1
- package/dist/react/filter-rail/FilterRail.js +5 -4
- package/dist/react/filter-rail/FilterRail.js.map +1 -1
- package/dist/react/folder-tree/FolderTreeRail.d.ts.map +1 -1
- package/dist/react/folder-tree/FolderTreeRail.js +2 -1
- package/dist/react/folder-tree/FolderTreeRail.js.map +1 -1
- package/dist/react/index.d.ts +5 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +5 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/layoutEngine/index.js +1 -1
- package/dist/react/layoutEngine/index.js.map +1 -1
- package/dist/react/lib/field.d.ts.map +1 -1
- package/dist/react/lib/field.js +3 -2
- package/dist/react/lib/field.js.map +1 -1
- package/dist/react/lib/floatingStyles.d.ts.map +1 -1
- package/dist/react/lib/floatingStyles.js +2 -1
- package/dist/react/lib/floatingStyles.js.map +1 -1
- package/dist/react/lib/tapTarget.d.ts +96 -0
- package/dist/react/lib/tapTarget.d.ts.map +1 -0
- package/dist/react/lib/tapTarget.js +96 -0
- package/dist/react/lib/tapTarget.js.map +1 -0
- package/dist/react/media/VideoTrimmer.d.ts +1 -1
- package/dist/react/media/VideoTrimmer.js +1 -1
- package/dist/react/media/denseGallery.css +3 -3
- package/dist/react/media/ffmpegWasm.js +2 -2
- package/dist/react/media/ffmpegWasm.js.map +1 -1
- package/dist/react/media/videoPlayer.css +42 -0
- package/dist/react/namespace/NamespaceTargetCapsule.d.ts +2 -2
- package/dist/react/namespace/NamespaceTargetCapsule.d.ts.map +1 -1
- package/dist/react/nav/BreadcrumbTrail.d.ts.map +1 -1
- package/dist/react/nav/BreadcrumbTrail.js +4 -3
- package/dist/react/nav/BreadcrumbTrail.js.map +1 -1
- package/dist/react/nav/HubTileGrid.d.ts.map +1 -1
- package/dist/react/nav/HubTileGrid.js +2 -1
- package/dist/react/nav/HubTileGrid.js.map +1 -1
- package/dist/react/nav/SideNav.d.ts.map +1 -1
- package/dist/react/nav/SideNav.js +4 -3
- package/dist/react/nav/SideNav.js.map +1 -1
- package/dist/react/nav/SideNavCustomize.d.ts.map +1 -1
- package/dist/react/nav/SideNavCustomize.js +2 -1
- package/dist/react/nav/SideNavCustomize.js.map +1 -1
- package/dist/react/palette/CommandPalette.d.ts.map +1 -1
- package/dist/react/palette/CommandPalette.js +3 -2
- package/dist/react/palette/CommandPalette.js.map +1 -1
- package/dist/server/drivers/pooledControlStores.pg.test.js +1 -0
- package/dist/server/drivers/pooledControlStores.pg.test.js.map +1 -1
- package/dist/server/drivers/pooledIdentityStore.pg.test.js +1 -0
- package/dist/server/drivers/pooledIdentityStore.pg.test.js.map +1 -1
- package/dist/server/drivers/retentionPolicy.pg.test.js +1 -0
- package/dist/server/drivers/retentionPolicy.pg.test.js.map +1 -1
- package/dist/server/guard/argon2Binding.d.ts +1 -1
- package/dist/server/guard/argon2Binding.js +1 -1
- package/dist/server/incidents/store.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/master-lock/masterLock.d.ts +1 -1
- package/dist/server/media-bun/index.js +1 -1
- package/dist/server/media-bun/index.js.map +1 -1
- package/dist/server/paths/appDataHome.d.ts +20 -0
- package/dist/server/paths/appDataHome.d.ts.map +1 -0
- package/dist/server/paths/appDataHome.js +69 -0
- package/dist/server/paths/appDataHome.js.map +1 -0
- package/dist/server/retention/archive.d.ts +3 -4
- package/dist/server/retention/archive.d.ts.map +1 -1
- package/dist/server/retention/archive.js +20 -15
- package/dist/server/retention/archive.js.map +1 -1
- package/dist/server/retention/index.d.ts +1 -1
- package/dist/server/retention/index.js +1 -1
- package/dist/server/retention/policy.d.ts +2 -2
- package/dist/server/retention/policy.d.ts.map +1 -1
- package/dist/server/retention/policy.js +1 -1
- package/dist/server/retention/store.d.ts.map +1 -1
- package/dist/server/retention/store.js +27 -20
- package/dist/server/retention/store.js.map +1 -1
- package/dist/server/runtime/localHost.d.ts +10 -5
- package/dist/server/runtime/localHost.d.ts.map +1 -1
- package/dist/server/runtime/localHost.js +12 -8
- package/dist/server/runtime/localHost.js.map +1 -1
- package/dist/server/runtime/meterRollup.pg.test.js +1 -0
- package/dist/server/runtime/meterRollup.pg.test.js.map +1 -1
- package/dist/server/runtime/recipe.d.ts +4 -4
- package/dist/server/runtime/retentionJob.pg.test.js +1 -0
- package/dist/server/runtime/retentionJob.pg.test.js.map +1 -1
- package/dist/server/search/pgSearchProvider.pg.test.js +1 -0
- package/dist/server/search/pgSearchProvider.pg.test.js.map +1 -1
- package/dist/shared/errors.d.ts +1 -1
- package/dist/shared/errors.js +1 -1
- package/dist/styles-static.css +391 -0
- package/dist/styles.css +27 -0
- package/package.json +19 -167
- package/scripts/generateStaticStyles.ts +122 -0
- package/scripts/publicSurface.ts +455 -0
- package/scripts/testTmpRoot.ts +34 -5
- package/src/client/index.ts +1 -1
- package/src/core/category/index.ts +2 -1
- package/src/core/category/types.ts +1 -1
- package/src/core/file-tree/fileTreeModel.spec.ts +134 -0
- package/src/core/file-tree/fileTreeModel.ts +104 -0
- package/src/core/layout/index.ts +1 -1
- package/src/core/media/index.ts +1 -1
- package/src/core/media/types.ts +1 -1
- package/src/core/media/uploadLimits.ts +1 -1
- package/src/core/sharing/model.ts +1 -1
- package/src/ctgr/index.ts +1 -1
- package/src/declaredDepsAreImported.spec.ts +87 -0
- package/src/demoFixture.spec.ts +133 -0
- package/src/index.ts +1 -1
- package/src/lockfileIsTracked.spec.ts +50 -0
- package/src/namedSubpathsResolve.spec.ts +119 -0
- package/src/publicSurface.spec.ts +72 -0
- package/src/react/activity-bar/ActivityBar.tsx +17 -0
- package/src/react/analytics/index.ts +1 -1
- package/src/react/chat/MessageComposer.tsx +5 -4
- package/src/react/components/Button.tsx +3 -2
- package/src/react/components/Checkbox.spec.tsx +51 -0
- package/src/react/components/Checkbox.tsx +68 -26
- package/src/react/components/CodeArea.tsx +2 -1
- package/src/react/components/CodeChip.spec.tsx +2 -2
- package/src/react/components/Collapsible.tsx +2 -1
- package/src/react/components/ComboboxField.tsx +3 -2
- package/src/react/components/CopyButton.tsx +2 -1
- package/src/react/components/CopyableText.spec.tsx +1 -1
- package/src/react/components/DataTable/ColumnChecklist.tsx +2 -1
- package/src/react/components/DataTable/Pagination.tsx +2 -1
- package/src/react/components/DataTable/SortHeader.tsx +2 -1
- package/src/react/components/DataTable/{FilterBuilder.tsx → TableFilterBuilder.tsx} +33 -5
- package/src/react/components/DataTable/Toolbar.tsx +3 -3
- package/src/react/components/DataTable/cells/LinkCell.tsx +2 -1
- package/src/react/components/DataTable/index.ts +8 -1
- package/src/react/components/DragHandle.tsx +2 -1
- package/src/react/components/EmojiField.tsx +2 -1
- package/src/react/components/EventTimeline.tsx +3 -2
- package/src/react/components/FileLocation.spec.tsx +1 -1
- package/src/react/components/IconButton.tsx +1 -1
- package/src/react/components/InfoHint.tsx +5 -4
- package/src/react/components/InheritBadge.tsx +1 -1
- package/src/react/components/InlineEditableText.tsx +2 -1
- package/src/react/components/MeterList.tsx +2 -1
- package/src/react/components/PathText.tsx +4 -3
- package/src/react/components/RatingField.tsx +2 -1
- package/src/react/components/SecretInput.tsx +3 -3
- package/src/react/components/SegmentedControl.tsx +2 -2
- package/src/react/components/StarRating.spec.tsx +2 -2
- package/src/react/components/StarRating.tsx +9 -5
- package/src/react/components/StatStrip.tsx +2 -1
- package/src/react/components/StatTile.tsx +3 -3
- package/src/react/components/Tabs.spec.tsx +3 -2
- package/src/react/components/Tabs.tsx +2 -1
- package/src/react/components/TruncatedText.tsx +2 -1
- package/src/react/components/calendar/MonthGrid.spec.tsx +2 -1
- package/src/react/components/calendar/MonthGrid.tsx +2 -1
- package/src/react/components/calendar/WeekView.tsx +2 -1
- package/src/react/components/revealOnHover.ts +3 -2
- package/src/react/file-tree/FileTree.spec.tsx +248 -0
- package/src/react/file-tree/FileTree.tsx +304 -4
- package/src/react/file-tree/fileTree.css +52 -0
- package/src/react/file-tree/fileTreeGeometry.fixture.json +151 -0
- package/src/react/file-tree/fileTreeGeometry.spec.ts +33 -52
- package/src/react/filter-rail/FilterRail.spec.tsx +2 -1
- package/src/react/filter-rail/FilterRail.tsx +5 -4
- package/src/react/folder-tree/FolderTreeRail.tsx +2 -1
- package/src/react/index.ts +13 -3
- package/src/react/layoutEngine/index.ts +1 -1
- package/src/react/layoutEngine/types.ts +1 -1
- package/src/react/lib/field.ts +4 -2
- package/src/react/lib/floatingStyles.spec.ts +2 -1
- package/src/react/lib/floatingStyles.ts +3 -1
- package/src/react/lib/tapTarget.ts +100 -0
- package/src/react/media/MaskPainter.tsx +2 -2
- package/src/react/media/VideoTrimmer.tsx +1 -1
- package/src/react/media/denseGallery.css +3 -3
- package/src/react/media/ffmpegWasm.ts +2 -2
- package/src/react/media/videoPlayer.css +42 -0
- package/src/react/namespace/NamespaceTargetCapsule.tsx +2 -2
- package/src/react/nav/BreadcrumbTrail.tsx +4 -3
- package/src/react/nav/HubTileGrid.tsx +2 -1
- package/src/react/nav/SideNav.tsx +4 -3
- package/src/react/nav/SideNavCustomize.tsx +2 -1
- package/src/react/palette/CommandPalette.tsx +3 -2
- package/src/server/ctgr.ts +1 -1
- package/src/server/drivers/pooledControlStores.pg.test.ts +1 -0
- package/src/server/drivers/pooledIdentityStore.pg.test.ts +1 -0
- package/src/server/drivers/retentionPolicy.pg.test.ts +1 -0
- package/src/server/guard/argon2Binding.ts +1 -1
- package/src/server/incidents/store.ts +3 -3
- package/src/server/index.ts +1 -1
- package/src/server/master-lock/masterLock.spec.ts +18 -2
- package/src/server/master-lock/masterLock.ts +1 -1
- package/src/server/media-bun/image.spec.ts +1 -0
- package/src/server/media-bun/index.ts +1 -1
- package/src/server/media-bun/video.spec.ts +1 -0
- package/src/server/paths/appDataHome.spec.ts +87 -0
- package/src/server/paths/appDataHome.ts +84 -0
- package/src/server/retention/archive.spec.ts +26 -4
- package/src/server/retention/archive.ts +20 -15
- package/src/server/retention/index.ts +1 -1
- package/src/server/retention/policy.ts +2 -2
- package/src/server/retention/store.spec.ts +38 -10
- package/src/server/retention/store.ts +26 -19
- package/src/server/runtime/localHost.spec.ts +22 -3
- package/src/server/runtime/localHost.ts +12 -9
- package/src/server/runtime/meterRollup.pg.test.ts +1 -0
- package/src/server/runtime/recipe.ts +4 -4
- package/src/server/runtime/retentionJob.pg.test.ts +1 -0
- package/src/server/search/pgSearchProvider.pg.test.ts +1 -0
- package/src/server/storage/binaryServerProcessing.integration.spec.ts +6 -2
- package/src/server/storage/chunked.integration.spec.ts +5 -2
- package/src/server/storage/fileUploadClient-chunked.integration.spec.ts +5 -2
- package/src/server/storage/files/adapter.photo.display.spec.ts +1 -0
- package/src/server/storage/imageThumbnail.spec.ts +1 -0
- package/src/server/storage/transcode.integration.spec.ts +5 -2
- package/src/server/storage/videoProcessor.posterOnly.spec.ts +1 -0
- package/src/shared/errors.ts +1 -1
- package/src/skippedTestsAreAnswered.spec.ts +215 -0
- package/src/styles-static.css +391 -0
- package/src/styles.css +27 -0
- package/src/stylesStaticMatches.spec.ts +134 -0
- package/src/tapTargetStylesheet.spec.ts +150 -0
- package/src/testTmpRoot.spec.ts +102 -0
- package/dist/core/duplicates/index.d.ts +0 -116
- package/dist/core/duplicates/index.d.ts.map +0 -1
- package/dist/core/duplicates/index.js +0 -178
- package/dist/core/duplicates/index.js.map +0 -1
- package/dist/core/namespace/helpers.d.ts +0 -14
- package/dist/core/namespace/helpers.d.ts.map +0 -1
- package/dist/core/namespace/helpers.js +0 -29
- package/dist/core/namespace/helpers.js.map +0 -1
- package/dist/core/namespace/index.d.ts +0 -4
- package/dist/core/namespace/index.d.ts.map +0 -1
- package/dist/core/namespace/index.js +0 -6
- package/dist/core/namespace/index.js.map +0 -1
- package/dist/core/namespace/memoryStore.d.ts +0 -19
- package/dist/core/namespace/memoryStore.d.ts.map +0 -1
- package/dist/core/namespace/memoryStore.js +0 -70
- package/dist/core/namespace/memoryStore.js.map +0 -1
- package/dist/core/namespace/types.d.ts +0 -44
- package/dist/core/namespace/types.d.ts.map +0 -1
- package/dist/core/namespace/types.js +0 -8
- package/dist/core/namespace/types.js.map +0 -1
- package/dist/game/core/DisposeRegistry.d.ts +0 -42
- package/dist/game/core/DisposeRegistry.d.ts.map +0 -1
- package/dist/game/core/DisposeRegistry.js +0 -67
- package/dist/game/core/DisposeRegistry.js.map +0 -1
- package/dist/game/core/drawBudget.d.ts +0 -26
- package/dist/game/core/drawBudget.d.ts.map +0 -1
- package/dist/game/core/drawBudget.js +0 -55
- package/dist/game/core/drawBudget.js.map +0 -1
- package/dist/game/core/fixedTimestep.d.ts +0 -38
- package/dist/game/core/fixedTimestep.d.ts.map +0 -1
- package/dist/game/core/fixedTimestep.js +0 -47
- package/dist/game/core/fixedTimestep.js.map +0 -1
- package/dist/game/core/index.d.ts +0 -9
- package/dist/game/core/index.d.ts.map +0 -1
- package/dist/game/core/index.js +0 -8
- package/dist/game/core/index.js.map +0 -1
- package/dist/game/core/inputCollector.d.ts +0 -82
- package/dist/game/core/inputCollector.d.ts.map +0 -1
- package/dist/game/core/inputCollector.js +0 -176
- package/dist/game/core/inputCollector.js.map +0 -1
- package/dist/game/core/resizeCanvas.d.ts +0 -19
- package/dist/game/core/resizeCanvas.d.ts.map +0 -1
- package/dist/game/core/resizeCanvas.js +0 -29
- package/dist/game/core/resizeCanvas.js.map +0 -1
- package/dist/game/react/index.d.ts +0 -3
- package/dist/game/react/index.d.ts.map +0 -1
- package/dist/game/react/index.js +0 -5
- package/dist/game/react/index.js.map +0 -1
- package/dist/game/react/useGameEngine.d.ts +0 -64
- package/dist/game/react/useGameEngine.d.ts.map +0 -1
- package/dist/game/react/useGameEngine.js +0 -78
- package/dist/game/react/useGameEngine.js.map +0 -1
- package/dist/react/canvas/CanvasNavHUD.d.ts +0 -64
- package/dist/react/canvas/CanvasNavHUD.d.ts.map +0 -1
- package/dist/react/canvas/CanvasNavHUD.js +0 -58
- package/dist/react/canvas/CanvasNavHUD.js.map +0 -1
- package/dist/react/canvas/fitLabel.d.ts +0 -53
- package/dist/react/canvas/fitLabel.d.ts.map +0 -1
- package/dist/react/canvas/fitLabel.js +0 -104
- package/dist/react/canvas/fitLabel.js.map +0 -1
- package/dist/react/canvas/index.d.ts +0 -4
- package/dist/react/canvas/index.d.ts.map +0 -1
- package/dist/react/canvas/index.js +0 -4
- package/dist/react/canvas/index.js.map +0 -1
- package/dist/react/canvas/lod.d.ts +0 -40
- package/dist/react/canvas/lod.d.ts.map +0 -1
- package/dist/react/canvas/lod.js +0 -37
- package/dist/react/canvas/lod.js.map +0 -1
- package/dist/react/components/DataTable/FilterBuilder.d.ts +0 -38
- package/dist/react/components/DataTable/FilterBuilder.d.ts.map +0 -1
- package/dist/react/components/DataTable/FilterBuilder.js.map +0 -1
- package/dist/react/seo/HeadProvider.d.ts +0 -14
- package/dist/react/seo/HeadProvider.d.ts.map +0 -1
- package/dist/react/seo/HeadProvider.js +0 -44
- package/dist/react/seo/HeadProvider.js.map +0 -1
- package/dist/react/seo/applyHeadToDocument.d.ts +0 -3
- package/dist/react/seo/applyHeadToDocument.d.ts.map +0 -1
- package/dist/react/seo/applyHeadToDocument.js +0 -66
- package/dist/react/seo/applyHeadToDocument.js.map +0 -1
- package/dist/react/seo/index.d.ts +0 -3
- package/dist/react/seo/index.d.ts.map +0 -1
- package/dist/react/seo/index.js +0 -7
- package/dist/react/seo/index.js.map +0 -1
- package/dist/react/timeline/ClipView.d.ts +0 -29
- package/dist/react/timeline/ClipView.d.ts.map +0 -1
- package/dist/react/timeline/ClipView.js +0 -53
- package/dist/react/timeline/ClipView.js.map +0 -1
- package/dist/react/timeline/Playhead.d.ts +0 -16
- package/dist/react/timeline/Playhead.d.ts.map +0 -1
- package/dist/react/timeline/Playhead.js +0 -26
- package/dist/react/timeline/Playhead.js.map +0 -1
- package/dist/react/timeline/TimeRuler.d.ts +0 -21
- package/dist/react/timeline/TimeRuler.d.ts.map +0 -1
- package/dist/react/timeline/TimeRuler.js +0 -31
- package/dist/react/timeline/TimeRuler.js.map +0 -1
- package/dist/react/timeline/TimelineSurface.d.ts +0 -29
- package/dist/react/timeline/TimelineSurface.d.ts.map +0 -1
- package/dist/react/timeline/TimelineSurface.js +0 -56
- package/dist/react/timeline/TimelineSurface.js.map +0 -1
- package/dist/react/timeline/TrackLane.d.ts +0 -31
- package/dist/react/timeline/TrackLane.d.ts.map +0 -1
- package/dist/react/timeline/TrackLane.js +0 -32
- package/dist/react/timeline/TrackLane.js.map +0 -1
- package/dist/react/timeline/index.d.ts +0 -6
- package/dist/react/timeline/index.d.ts.map +0 -1
- package/dist/react/timeline/index.js +0 -12
- package/dist/react/timeline/index.js.map +0 -1
- package/dist/server/private-media/index.d.ts +0 -7
- package/dist/server/private-media/index.d.ts.map +0 -1
- package/dist/server/private-media/index.js +0 -13
- package/dist/server/private-media/index.js.map +0 -1
- package/dist/server/seo/index.d.ts +0 -3
- package/dist/server/seo/index.d.ts.map +0 -1
- package/dist/server/seo/index.js +0 -6
- package/dist/server/seo/index.js.map +0 -1
- package/dist/server/seo/mountSeoRoutes.d.ts +0 -9
- package/dist/server/seo/mountSeoRoutes.d.ts.map +0 -1
- package/dist/server/seo/mountSeoRoutes.js +0 -19
- package/dist/server/seo/mountSeoRoutes.js.map +0 -1
- package/dist/server/seo/serveHeadInjectedIndex.d.ts +0 -9
- package/dist/server/seo/serveHeadInjectedIndex.d.ts.map +0 -1
- package/dist/server/seo/serveHeadInjectedIndex.js +0 -20
- package/dist/server/seo/serveHeadInjectedIndex.js.map +0 -1
- package/dist/upload.d.ts +0 -148
- package/dist/upload.d.ts.map +0 -1
- package/dist/upload.js +0 -159
- package/dist/upload.js.map +0 -1
- package/dist/verify/runtime/index.d.ts +0 -16
- package/dist/verify/runtime/index.d.ts.map +0 -1
- package/dist/verify/runtime/index.js +0 -16
- package/dist/verify/runtime/index.js.map +0 -1
- package/scripts/demoCheck.ts +0 -42
- package/src/core/duplicates/index.spec.ts +0 -116
- package/src/core/duplicates/index.ts +0 -203
- package/src/core/namespace/helpers.ts +0 -31
- package/src/core/namespace/index.ts +0 -12
- package/src/core/namespace/memoryStore.ts +0 -77
- package/src/core/namespace/namespace.spec.ts +0 -117
- package/src/core/namespace/types.ts +0 -53
- package/src/game/core/DisposeRegistry.spec.ts +0 -53
- package/src/game/core/DisposeRegistry.ts +0 -70
- package/src/game/core/drawBudget.spec.ts +0 -51
- package/src/game/core/drawBudget.ts +0 -75
- package/src/game/core/fixedTimestep.spec.ts +0 -91
- package/src/game/core/fixedTimestep.ts +0 -79
- package/src/game/core/index.ts +0 -16
- package/src/game/core/inputCollector.spec.ts +0 -29
- package/src/game/core/inputCollector.ts +0 -245
- package/src/game/core/resizeCanvas.ts +0 -31
- package/src/game/react/index.ts +0 -10
- package/src/game/react/useGameEngine.ts +0 -125
- package/src/react/canvas/CanvasNavHUD.spec.tsx +0 -62
- package/src/react/canvas/CanvasNavHUD.tsx +0 -210
- package/src/react/canvas/fitLabel.spec.ts +0 -82
- package/src/react/canvas/fitLabel.ts +0 -150
- package/src/react/canvas/index.ts +0 -15
- package/src/react/canvas/lod.ts +0 -53
- package/src/react/seo/HeadProvider.tsx +0 -67
- package/src/react/seo/applyHeadToDocument.ts +0 -73
- package/src/react/seo/index.ts +0 -12
- package/src/react/seo/seo.spec.tsx +0 -101
- package/src/react/timeline/ClipView.tsx +0 -146
- package/src/react/timeline/Playhead.tsx +0 -63
- package/src/react/timeline/TimeRuler.tsx +0 -85
- package/src/react/timeline/TimelineSurface.tsx +0 -157
- package/src/react/timeline/TrackLane.tsx +0 -87
- package/src/react/timeline/index.ts +0 -12
- package/src/react/timeline/timeline.spec.tsx +0 -175
- package/src/server/private-media/index.ts +0 -45
- package/src/server/seo/index.ts +0 -8
- package/src/server/seo/mountSeoRoutes.ts +0 -37
- package/src/server/seo/seo.spec.ts +0 -128
- package/src/server/seo/serveHeadInjectedIndex.ts +0 -36
- package/src/upload.spec.ts +0 -300
- package/src/upload.ts +0 -288
- package/src/verify/runtime/index.ts +0 -64
package/dist/upload.js
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
// cursedbelt/upload — framework-agnostic upload primitive
|
|
2
|
-
//
|
|
3
|
-
// Sits above the transport (fileUploadClient) and below the UI layer. Provides:
|
|
4
|
-
// • Client-side validation (MIME type + byte size)
|
|
5
|
-
// • Progress events during upload
|
|
6
|
-
// • Drag-and-drop drop-zone wiring (pure DOM, no React)
|
|
7
|
-
// • HEIC/HEIF mobile-photo detection (conversion is server-side)
|
|
8
|
-
// • Typed UploadResult contract consumed by MediaUploadControl and app plugins
|
|
9
|
-
//
|
|
10
|
-
// Consumers that want the raw transport client import createFileUploadClient from
|
|
11
|
-
// 'cursedbelt/react/media'; this module layers validation + progress on top.
|
|
12
|
-
// ── MIME / HEIC ──────────────────────────────────────────────────────────────
|
|
13
|
-
/** True for iPhone HEIC/HEIF images — the server converts these to JPEG. */
|
|
14
|
-
export function isHeicFile(file) {
|
|
15
|
-
const mime = file.type.toLowerCase();
|
|
16
|
-
if (mime === 'image/heic' || mime === 'image/heif')
|
|
17
|
-
return true;
|
|
18
|
-
const name = file.name.toLowerCase();
|
|
19
|
-
return name.endsWith('.heic') || name.endsWith('.heif');
|
|
20
|
-
}
|
|
21
|
-
function mimeMatches(mime, pattern) {
|
|
22
|
-
if (pattern === mime)
|
|
23
|
-
return true;
|
|
24
|
-
if (pattern.endsWith('/*')) {
|
|
25
|
-
return mime.startsWith(pattern.slice(0, -1));
|
|
26
|
-
}
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
export function validateFile(file, constraints) {
|
|
30
|
-
if (constraints.accept?.length) {
|
|
31
|
-
const mime = file.type || 'application/octet-stream';
|
|
32
|
-
const ok = constraints.accept.some((p) => mimeMatches(mime, p));
|
|
33
|
-
if (!ok)
|
|
34
|
-
return {
|
|
35
|
-
ok: false,
|
|
36
|
-
error: { kind: 'type', file: file.name, mime, accept: constraints.accept },
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
if (constraints.maxBytes !== undefined && file.size > constraints.maxBytes) {
|
|
40
|
-
return {
|
|
41
|
-
ok: false,
|
|
42
|
-
error: { kind: 'size', file: file.name, bytes: file.size, maxBytes: constraints.maxBytes },
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
return { ok: true };
|
|
46
|
-
}
|
|
47
|
-
export function formatValidationError(error) {
|
|
48
|
-
if (error.kind === 'type') {
|
|
49
|
-
return `"${error.file}" is not an accepted file type (${error.mime}). Accepted: ${error.accept.join(', ')}.`;
|
|
50
|
-
}
|
|
51
|
-
return `"${error.file}" is too large (${(error.bytes / 1024 / 1024).toFixed(1)} MB). Max: ${(error.maxBytes / 1024 / 1024).toFixed(1)} MB.`;
|
|
52
|
-
}
|
|
53
|
-
export async function uploadFile(file, opts) {
|
|
54
|
-
const { transport, constraints = {}, tags, onProgress } = opts;
|
|
55
|
-
const emit = (p) => {
|
|
56
|
-
onProgress?.(p);
|
|
57
|
-
};
|
|
58
|
-
emit({ phase: 'validating' });
|
|
59
|
-
const validation = validateFile(file, constraints);
|
|
60
|
-
if (!validation.ok) {
|
|
61
|
-
const msg = formatValidationError(validation.error);
|
|
62
|
-
emit({ phase: 'error', message: msg });
|
|
63
|
-
return { ok: false, error: msg, validationError: validation.error };
|
|
64
|
-
}
|
|
65
|
-
emit({ phase: 'uploading', loaded: 0, total: file.size });
|
|
66
|
-
const heic = isHeicFile(file);
|
|
67
|
-
const res = await transport.uploadAuto(file, { tags }).catch((e) => ({
|
|
68
|
-
ok: false,
|
|
69
|
-
error: e instanceof Error ? e.message : 'upload failed',
|
|
70
|
-
}));
|
|
71
|
-
if (!res.ok) {
|
|
72
|
-
emit({ phase: 'error', message: res.error });
|
|
73
|
-
return { ok: false, error: res.error };
|
|
74
|
-
}
|
|
75
|
-
const f = res.file;
|
|
76
|
-
if (!f) {
|
|
77
|
-
emit({ phase: 'error', message: 'upload succeeded but no file record returned' });
|
|
78
|
-
return { ok: false, error: 'upload succeeded but no file record returned' };
|
|
79
|
-
}
|
|
80
|
-
emit({ phase: 'done' });
|
|
81
|
-
return {
|
|
82
|
-
ok: true,
|
|
83
|
-
file: {
|
|
84
|
-
id: f.id,
|
|
85
|
-
name: f.name,
|
|
86
|
-
mime: f.mime,
|
|
87
|
-
size: f.size,
|
|
88
|
-
fileType: f.fileType,
|
|
89
|
-
tags: f.tags,
|
|
90
|
-
processingStatus: f.processingStatus,
|
|
91
|
-
heicConverted: heic,
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
/** Upload multiple files sequentially, stopping on the first error. */
|
|
96
|
-
export async function uploadFiles(files, opts) {
|
|
97
|
-
const results = [];
|
|
98
|
-
for (const file of files) {
|
|
99
|
-
const result = await uploadFile(file, opts);
|
|
100
|
-
results.push(result);
|
|
101
|
-
if (!result.ok)
|
|
102
|
-
return { results, firstError: result.error };
|
|
103
|
-
}
|
|
104
|
-
return { results, firstError: null };
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Returns plain event handler objects that wire a DOM element as a drop zone.
|
|
108
|
-
* Attach them with addEventListener or pass to a React component's onDrag* props.
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* const { onDragOver, onDragLeave, onDrop } = createDropZoneHandlers({ onFiles });
|
|
112
|
-
* el.addEventListener('dragover', onDragOver);
|
|
113
|
-
* el.addEventListener('dragleave', onDragLeave);
|
|
114
|
-
* el.addEventListener('drop', onDrop);
|
|
115
|
-
*/
|
|
116
|
-
export function createDropZoneHandlers(opts) {
|
|
117
|
-
const { onFiles, onEnter, onLeave, accept } = opts;
|
|
118
|
-
const onDragOver = (e) => {
|
|
119
|
-
e.preventDefault();
|
|
120
|
-
onEnter?.();
|
|
121
|
-
};
|
|
122
|
-
const onDragLeave = (e) => {
|
|
123
|
-
e.preventDefault();
|
|
124
|
-
onLeave?.();
|
|
125
|
-
};
|
|
126
|
-
const onDrop = (e) => {
|
|
127
|
-
e.preventDefault();
|
|
128
|
-
onLeave?.();
|
|
129
|
-
const items = e.dataTransfer?.files;
|
|
130
|
-
if (!items?.length)
|
|
131
|
-
return;
|
|
132
|
-
let files = Array.from(items);
|
|
133
|
-
if (accept?.length) {
|
|
134
|
-
files = files.filter((f) => accept.some((p) => mimeMatches(f.type || '', p)));
|
|
135
|
-
}
|
|
136
|
-
if (files.length)
|
|
137
|
-
onFiles(files);
|
|
138
|
-
};
|
|
139
|
-
return { onDragOver, onDragLeave, onDrop };
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Mount a drop zone on `el`, returning an unmount function.
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* const unmount = mountDropZone(containerEl, { onFiles, accept: ['image/*'] });
|
|
146
|
-
* // later: unmount();
|
|
147
|
-
*/
|
|
148
|
-
export function mountDropZone(el, opts) {
|
|
149
|
-
const { onDragOver, onDragLeave, onDrop } = createDropZoneHandlers(opts);
|
|
150
|
-
el.addEventListener('dragover', onDragOver);
|
|
151
|
-
el.addEventListener('dragleave', onDragLeave);
|
|
152
|
-
el.addEventListener('drop', onDrop);
|
|
153
|
-
return () => {
|
|
154
|
-
el.removeEventListener('dragover', onDragOver);
|
|
155
|
-
el.removeEventListener('dragleave', onDragLeave);
|
|
156
|
-
el.removeEventListener('drop', onDrop);
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
//# sourceMappingURL=upload.js.map
|
package/dist/upload.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,EAAE;AACF,gFAAgF;AAChF,qDAAqD;AACrD,oCAAoC;AACpC,0DAA0D;AAC1D,mEAAmE;AACnE,iFAAiF;AACjF,EAAE;AACF,kFAAkF;AAClF,6EAA6E;AAE7E,gFAAgF;AAEhF,4EAA4E;AAC5E,MAAM,UAAU,UAAU,CAAC,IAAU;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACrC,IAAI,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,YAAY;QAAE,OAAO,IAAI,CAAC;IAChE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC1D,CAAC;AAiBD,SAAS,WAAW,CAAC,IAAY,EAAE,OAAe;IAChD,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAClC,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,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CAAC,CAAC;QAChF,CAAC;QACD,IAAI,KAAK,CAAC,MAAM;YAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC,CAAC;IAEF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AAC7C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,EAAe,EAAE,IAAqB;IAClE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;IACzE,EAAE,CAAC,gBAAgB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC5C,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC9C,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,OAAO,GAAG,EAAE;QACV,EAAE,CAAC,mBAAmB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAC/C,EAAE,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QACjD,EAAE,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `cursedbelt/verify/runtime` — V7: verify-mode boot, the probe suite, and the
|
|
3
|
-
* PID jail that guarantees a run leaves nothing behind (04 §2 V7, §5.7).
|
|
4
|
-
*
|
|
5
|
-
* Server-side only (Bun + Hono); the static V0–V6 compiler in `cursedbelt/verify`
|
|
6
|
-
* has no runtime dependencies and runs anywhere.
|
|
7
|
-
*/
|
|
8
|
-
export { type CliOptions, type CliResult, type CorpusFailure, parseArgs, runCli, runCorpus, writeArtifacts, } from './cli';
|
|
9
|
-
export { type HostProbeOptions, probeHostCapabilities } from './hostCapabilities';
|
|
10
|
-
export { createFakeSpawn, createVerifyContext, createVerifyGuard, createVerifyExec, createVerifyJobBroker, createVerifyCognitiveDriver, createVerifyStorage, createVerifyTelemetry, VERIFY_COMMANDS, type VerifyContext, type VerifyContextOptions, type VerifyGuard, } from './verifyContext';
|
|
11
|
-
export { createVerifyAssetService, createVerifyDevService, createVerifyGuardService, createVerifyKnowledgeService, createVerifySystemService, PRIVATE_ITEM_IDS, PUBLIC_ITEM_IDS, } from './verifyServices';
|
|
12
|
-
export { CORE_PROBES, crossTabLockProbe, deepLinkTenantProbe, eventLoopGuardProbe, execJailProbe, injectionGuardProbe, instanceIsolationProbe, integrityTamperProbe, lastGoodProbe, layoutProbe, lifecycleProbe, type Probe, type ProbeContext, privateModeProbe, rbacProbe, reconnectProbe, routeSurfaceProbe, securityHeaderProbe, wireSmokeProbe, } from './probes';
|
|
13
|
-
export { isPortBound, ProcessJail, runJailed, type SweepReport, type TrackedChild } from './processJail';
|
|
14
|
-
export { type ProbeRunResult, type RunProbesOptions, runVerifyProbes, VERIFY_TIMEOUT_MS } from './runner';
|
|
15
|
-
export { createVerifyServer, type Role, type VerifyClaims, type VerifyServer, type VerifyServerOptions } from './verifyServer';
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/verify/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,SAAS,EACT,MAAM,EACN,SAAS,EACT,cAAc,GACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,WAAW,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,cAAc,EACd,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,GACf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC1G,OAAO,EAAE,kBAAkB,EAAE,KAAK,IAAI,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `cursedbelt/verify/runtime` — V7: verify-mode boot, the probe suite, and the
|
|
3
|
-
* PID jail that guarantees a run leaves nothing behind (04 §2 V7, §5.7).
|
|
4
|
-
*
|
|
5
|
-
* Server-side only (Bun + Hono); the static V0–V6 compiler in `cursedbelt/verify`
|
|
6
|
-
* has no runtime dependencies and runs anywhere.
|
|
7
|
-
*/
|
|
8
|
-
export { parseArgs, runCli, runCorpus, writeArtifacts, } from './cli';
|
|
9
|
-
export { probeHostCapabilities } from './hostCapabilities';
|
|
10
|
-
export { createFakeSpawn, createVerifyContext, createVerifyGuard, createVerifyExec, createVerifyJobBroker, createVerifyCognitiveDriver, createVerifyStorage, createVerifyTelemetry, VERIFY_COMMANDS, } from './verifyContext';
|
|
11
|
-
export { createVerifyAssetService, createVerifyDevService, createVerifyGuardService, createVerifyKnowledgeService, createVerifySystemService, PRIVATE_ITEM_IDS, PUBLIC_ITEM_IDS, } from './verifyServices';
|
|
12
|
-
export { CORE_PROBES, crossTabLockProbe, deepLinkTenantProbe, eventLoopGuardProbe, execJailProbe, injectionGuardProbe, instanceIsolationProbe, integrityTamperProbe, lastGoodProbe, layoutProbe, lifecycleProbe, privateModeProbe, rbacProbe, reconnectProbe, routeSurfaceProbe, securityHeaderProbe, wireSmokeProbe, } from './probes';
|
|
13
|
-
export { isPortBound, ProcessJail, runJailed } from './processJail';
|
|
14
|
-
export { runVerifyProbes, VERIFY_TIMEOUT_MS } from './runner';
|
|
15
|
-
export { createVerifyServer } from './verifyServer';
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/verify/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAIL,SAAS,EACT,MAAM,EACN,SAAS,EACT,cAAc,GACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAyB,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,GAIhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,cAAc,EAGd,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,GACf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAuC,MAAM,eAAe,CAAC;AACzG,OAAO,EAA8C,eAAe,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC1G,OAAO,EAAE,kBAAkB,EAA6E,MAAM,gBAAgB,CAAC"}
|
package/scripts/demoCheck.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Typechecks the kitchen-sink demo (`demo/`) as part of cursedbelt's own gate — the
|
|
3
|
-
* demo is the component proof surface an e2e suite drives, so its tsc debt must not
|
|
4
|
-
* be able to silently regrow (cbux-71).
|
|
5
|
-
*
|
|
6
|
-
* `demo/` is intentionally NOT a root workspace member (see demo/package.json's
|
|
7
|
-
* `cursedbelt` dependency: a relative `file:..` — worktree-safe, resolves to
|
|
8
|
-
* WHICHEVER checkout this script runs from, never the primary). That means it has
|
|
9
|
-
* its own `node_modules`/`bun.lock`, so a completely fresh clone/worktree needs one
|
|
10
|
-
* `bun install` here before `tsc` can resolve anything. Only pay for that install
|
|
11
|
-
* when it's actually missing: a demo install pulls cursedbelt's full dependency
|
|
12
|
-
* tree (400+ packages, individually file-symlinked — see the `file:` link note in
|
|
13
|
-
* demo/package.json) and reliably takes 60–120s even when nothing changed, so
|
|
14
|
-
* re-running it on every gate invocation would make `bun run done` unusable.
|
|
15
|
-
* `bun run setup` (repo root) also installs this proactively so a fresh worktree's
|
|
16
|
-
* FIRST gate run isn't the one paying that cost.
|
|
17
|
-
*/
|
|
18
|
-
import { existsSync } from "node:fs";
|
|
19
|
-
import { resolve } from "node:path";
|
|
20
|
-
|
|
21
|
-
const demoDir = resolve(import.meta.dir, "..", "demo");
|
|
22
|
-
|
|
23
|
-
async function run(cmd: string[], cwd: string): Promise<number> {
|
|
24
|
-
const proc = Bun.spawn(cmd, { cwd, stdout: "inherit", stderr: "inherit" });
|
|
25
|
-
return await proc.exited;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (!existsSync(resolve(demoDir, "node_modules", "cursedbelt"))) {
|
|
29
|
-
console.log("• demo: node_modules missing/stale — installing…");
|
|
30
|
-
const installExit = await run(["bun", "install"], demoDir);
|
|
31
|
-
if (installExit !== 0) {
|
|
32
|
-
console.error("✗ demo install failed — see output above.");
|
|
33
|
-
process.exit(installExit);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const tscExit = await run(["bunx", "tsc", "--noEmit", "-p", "tsconfig.json"], demoDir);
|
|
38
|
-
if (tscExit !== 0) {
|
|
39
|
-
console.error("✗ demo typecheck failed — see output above.");
|
|
40
|
-
process.exit(tscExit);
|
|
41
|
-
}
|
|
42
|
-
console.log("✓ demo typecheck clean");
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The shared duplicate rules, proved against the cases that produced them.
|
|
3
|
-
*
|
|
4
|
-
* Every assertion here is a measured incident from `binary-server` or `music`, not an
|
|
5
|
-
* invented example — see the module header for which.
|
|
6
|
-
*/
|
|
7
|
-
import { describe, expect, it } from "bun:test";
|
|
8
|
-
import {
|
|
9
|
-
DURATION_TOLERANCE,
|
|
10
|
-
durationsClose,
|
|
11
|
-
isGenericName,
|
|
12
|
-
likelyTheSameFile,
|
|
13
|
-
normalizeName,
|
|
14
|
-
SIZE_TOLERANCE,
|
|
15
|
-
sizesClose,
|
|
16
|
-
} from "./index";
|
|
17
|
-
|
|
18
|
-
describe("normalizeName", () => {
|
|
19
|
-
it("reduces the marks a copy picks up to the same stem", () => {
|
|
20
|
-
expect(normalizeName("My Video (1).mp4")).toBe("myvideo");
|
|
21
|
-
expect(normalizeName("my_video.MP4")).toBe("myvideo");
|
|
22
|
-
expect(normalizeName("My-Video copy 2.mov")).toBe("myvideo");
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it("strips the extension, so a re-encode still pairs with its source", () => {
|
|
26
|
-
expect(normalizeName("Song.wma")).toBe(normalizeName("Song.mp3"));
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("🔴 keeps a four-digit camera sequence — the 2026-08-14 flood", () => {
|
|
30
|
-
// `IMG_4595` and `IMG_4646` must NOT collapse onto each other.
|
|
31
|
-
expect(normalizeName("IMG_4595.MOV")).not.toBe(normalizeName("IMG_4646.MOV"));
|
|
32
|
-
// …while a two-digit copy marker still does.
|
|
33
|
-
expect(normalizeName("mix_2.mp3")).toBe(normalizeName("mix.mp3"));
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it("drops the directory", () => {
|
|
37
|
-
expect(normalizeName("Main 1/rap/Song.mp3")).toBe("song");
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
describe("isGenericName", () => {
|
|
42
|
-
it("rejects the stems that name a device rather than a file", () => {
|
|
43
|
-
expect(isGenericName(normalizeName("IMG_1.MOV"))).toBe(true);
|
|
44
|
-
expect(isGenericName(normalizeName("Track01.mp3"))).toBe(true);
|
|
45
|
-
expect(isGenericName(normalizeName("Between U.mp3"))).toBe(false);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
describe("sizesClose", () => {
|
|
50
|
-
it("accepts a re-encode and refuses a different file", () => {
|
|
51
|
-
expect(sizesClose(10_000_000, 10_400_000)).toBe(true);
|
|
52
|
-
expect(sizesClose(10_000_000, 20_000_000)).toBe(false);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it("🔴 two zero-byte files are not close — nothing is known about either", () => {
|
|
56
|
-
expect(sizesClose(0, 0)).toBe(false);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it("is bounded by the exported tolerance", () => {
|
|
60
|
-
expect(sizesClose(100, 100 * (1 + SIZE_TOLERANCE))).toBe(true);
|
|
61
|
-
expect(sizesClose(100, 100 * (1 + SIZE_TOLERANCE * 2))).toBe(false);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
describe("durationsClose", () => {
|
|
66
|
-
it("🔴 answers null when nobody has measured, never false", () => {
|
|
67
|
-
expect(durationsClose(null, 200)).toBeNull();
|
|
68
|
-
expect(durationsClose(0, 200)).toBeNull();
|
|
69
|
-
expect(durationsClose(undefined, undefined)).toBeNull();
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it("refuses the owner's 3:56-vs-1:52 pair", () => {
|
|
73
|
-
expect(durationsClose(236, 112)).toBe(false);
|
|
74
|
-
expect(durationsClose(236, 236 * (1 + DURATION_TOLERANCE / 2))).toBe(true);
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
describe("likelyTheSameFile", () => {
|
|
79
|
-
const facts = (name: string, sizeBytes: number, duration?: number | null) => ({
|
|
80
|
-
name,
|
|
81
|
-
sizeBytes,
|
|
82
|
-
...(duration === undefined ? {} : { duration }),
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it("pairs a re-encode of the same song", () => {
|
|
86
|
-
const verdict = likelyTheSameFile(
|
|
87
|
-
facts("Between U.mp3", 8_000_000, 312),
|
|
88
|
-
facts("Between U.wma", 7_800_000, 312),
|
|
89
|
-
);
|
|
90
|
-
expect(verdict.match).toBe(true);
|
|
91
|
-
expect(verdict.reason).toContain("same name");
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it("does not pair two different songs of a similar size", () => {
|
|
95
|
-
expect(likelyTheSameFile(facts("A.mp3", 8_000_000), facts("B.mp3", 8_010_000)).match).toBe(
|
|
96
|
-
false,
|
|
97
|
-
);
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it("🔴 a length that disagrees kills a name+size match", () => {
|
|
101
|
-
expect(
|
|
102
|
-
likelyTheSameFile(facts("Set.mp3", 8_000_000, 236), facts("Set.mp3", 8_100_000, 112)).match,
|
|
103
|
-
).toBe(false);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it("🔴 an unmeasured length does not — that would find nothing in an unprobed library", () => {
|
|
107
|
-
expect(
|
|
108
|
-
likelyTheSameFile(facts("Set.mp3", 8_000_000, null), facts("Set.mp3", 8_100_000, null)).match,
|
|
109
|
-
).toBe(true);
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
it("refuses a generic stem, and refuses two nameless files", () => {
|
|
113
|
-
expect(likelyTheSameFile(facts("IMG_1.MOV", 500), facts("IMG_1.MOV", 500)).match).toBe(false);
|
|
114
|
-
expect(likelyTheSameFile(facts("", 500), facts("", 500)).match).toBe(false);
|
|
115
|
-
});
|
|
116
|
-
});
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* "Are these two files the same thing?" — the fleet's ONE answer, with no I/O in it.
|
|
3
|
-
*
|
|
4
|
-
* ── Why this is here and not in an app ──────────────────────────────────────────────────
|
|
5
|
-
* `binary-server` wrote these rules first (2026-08-13, the owner: *"make strategy to always
|
|
6
|
-
* check for duplicate binaries in same app for same user … mark likely the duplicates for
|
|
7
|
-
* users to confirm"*), and they were measured against a real store: the copy-counter cap, the
|
|
8
|
-
* camera-generic stem list and the 5% size window each exist because a wider rule proposed
|
|
9
|
-
* thousands of pairs nobody could ever review. `music` then needed the same question asked of
|
|
10
|
-
* a 5,400-track library — *"I want to see a duplicate next to the file that it is a possible
|
|
11
|
-
* duplicate of … The 'binary-server' app (bs) already has this feature for checking duplicate
|
|
12
|
-
* files. We can reuse it and enhance the customizability if needed so the main strategy is
|
|
13
|
-
* shared."*
|
|
14
|
-
*
|
|
15
|
-
* So the strategy lives once, here, and both consume it. What each app keeps for itself is the
|
|
16
|
-
* evidence only it has: bs's perceptual frame hashes, music's artist/title key.
|
|
17
|
-
*
|
|
18
|
-
* ── What is NOT here, deliberately ──────────────────────────────────────────────────────
|
|
19
|
-
* Anything that needs a database, a filesystem, a fetch or a picture decoder. This module is
|
|
20
|
-
* pure so both consumers can prove their behaviour with `bun test` instead of against a live
|
|
21
|
-
* store, and so a browser bundle may import it (music renders the pair side by side).
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* How far two sizes may differ and still be called the same thing.
|
|
26
|
-
*
|
|
27
|
-
* A re-encode at a different quality is the case this exists for, and those land within a few
|
|
28
|
-
* percent. Zero would make a name match a strict subset of "same name AND same size", which
|
|
29
|
-
* misses precisely the files worth asking about; much larger starts pairing a clip with its
|
|
30
|
-
* own trailer.
|
|
31
|
-
*/
|
|
32
|
-
export const SIZE_TOLERANCE = 0.05;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* How far two playing times may differ and still be the same recording.
|
|
36
|
-
*
|
|
37
|
-
* Wide enough for a re-encode (a trim of a trailing black frame, a container that rounds), far
|
|
38
|
-
* too narrow for the owner's 2026-08-14 report of a 3:56 video paired with a 1:52 one.
|
|
39
|
-
*/
|
|
40
|
-
export const DURATION_TOLERANCE = 0.05;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The name to compare, reduced to what a human means by "the same file".
|
|
44
|
-
*
|
|
45
|
-
* Strips the directory, the extension, and the marks a copy picks up along the way —
|
|
46
|
-
* `Finder`'s ` copy`/` copy 2`, a browser's ` (1)`, a script's `_1`/`-1` — then collapses
|
|
47
|
-
* everything that is not a letter or a digit. `My Video (1).mp4`, `my_video.MP4` and
|
|
48
|
-
* `My-Video copy 2.mov` all reduce to `myvideo`.
|
|
49
|
-
*
|
|
50
|
-
* 🔴 The extension is stripped ON PURPOSE, so a re-encode (`.mov` → `.mp4`, `.wma` → `.mp3`)
|
|
51
|
-
* still pairs with its source. That is the single most common likely-duplicate in this fleet's
|
|
52
|
-
* stores and a rule that kept the extension would never see one.
|
|
53
|
-
*
|
|
54
|
-
* 🔴 **The copy-counter strip is capped at two digits**, and that cap is a measured bug fix
|
|
55
|
-
* (bs, 2026-08-14). It used to be `[-_]\d+$`, which eats a CAMERA SEQUENCE as readily as a copy
|
|
56
|
-
* marker: `IMG_4595` and `IMG_4646` both reduced to `img`, so every iPhone capture in a tenant
|
|
57
|
-
* shared one bucket and paired with every other one whose size was within 5%. `_1`…`_99` is
|
|
58
|
-
* what a copy marker actually looks like; four digits is a photo's identity, and it must
|
|
59
|
-
* survive.
|
|
60
|
-
*/
|
|
61
|
-
export function normalizeName(name: string | null | undefined): string {
|
|
62
|
-
if (!name) return "";
|
|
63
|
-
const leaf = name.split(/[\\/]/).pop() ?? "";
|
|
64
|
-
const stem = leaf.replace(/\.[a-z0-9]{1,5}$/i, "");
|
|
65
|
-
return stem
|
|
66
|
-
.toLowerCase()
|
|
67
|
-
.replace(/\s*\(\d+\)\s*$/, "")
|
|
68
|
-
.replace(/\s+copy(\s+\d+)?\s*$/, "")
|
|
69
|
-
.replace(/[-_]\d{1,2}\s*$/, "")
|
|
70
|
-
.replace(/[^a-z0-9]+/g, "");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Stems that name a CAMERA, not a file.
|
|
75
|
-
*
|
|
76
|
-
* `IMG`, `DSC`, `PXL`, `VID` are what a device calls everything it produces; two files whose
|
|
77
|
-
* names reduce to one of these have told us nothing except that they came from a phone. Even
|
|
78
|
-
* with the counter cap above, `IMG_1.MOV` still reduces to `img`, and a bucket called "img" is
|
|
79
|
-
* every photo the owner has ever taken.
|
|
80
|
-
*
|
|
81
|
-
* 🔴 This rejects a MATCH, never a file. Both copies stay wherever they are, and an
|
|
82
|
-
* identical-bytes pair is unaffected — a checksum match never consults the name.
|
|
83
|
-
*/
|
|
84
|
-
export const GENERIC_STEMS: ReadonlySet<string> = new Set([
|
|
85
|
-
"img",
|
|
86
|
-
"image",
|
|
87
|
-
"images",
|
|
88
|
-
"dsc",
|
|
89
|
-
"dscf",
|
|
90
|
-
"dscn",
|
|
91
|
-
"pxl",
|
|
92
|
-
"vid",
|
|
93
|
-
"video",
|
|
94
|
-
"movie",
|
|
95
|
-
"mov",
|
|
96
|
-
"photo",
|
|
97
|
-
"pic",
|
|
98
|
-
"picture",
|
|
99
|
-
"screenshot",
|
|
100
|
-
"screenrecording",
|
|
101
|
-
"untitled",
|
|
102
|
-
"unknown",
|
|
103
|
-
"file",
|
|
104
|
-
"download",
|
|
105
|
-
"scan",
|
|
106
|
-
"capture",
|
|
107
|
-
"copy",
|
|
108
|
-
"new",
|
|
109
|
-
"temp",
|
|
110
|
-
"tmp",
|
|
111
|
-
// Music's own version of the same problem: an untagged rip is called this by every ripper
|
|
112
|
-
// ever written, and `track01` from two albums is two different songs.
|
|
113
|
-
"track",
|
|
114
|
-
"audiotrack",
|
|
115
|
-
"unknownartist",
|
|
116
|
-
]);
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* A name that could belong to any file from that device tells us nothing about identity.
|
|
120
|
-
*
|
|
121
|
-
* 🔴 The trailing digit run is stripped BEFORE the lookup, and only here — never in
|
|
122
|
-
* {@link normalizeName}, where removing it is what made every camera capture one bucket. The
|
|
123
|
-
* two are asked at different moments: `normalizeName` decides whether two names are the SAME
|
|
124
|
-
* (so `img4595` and `img4646` must stay apart), and this decides whether a name that already
|
|
125
|
-
* matched is worth anything (so two files both called `Track01` have told us nothing, and a
|
|
126
|
-
* ripper names half a library that).
|
|
127
|
-
*/
|
|
128
|
-
export const isGenericName = (normalized: string): boolean =>
|
|
129
|
-
normalized.length < 3 ||
|
|
130
|
-
GENERIC_STEMS.has(normalized) ||
|
|
131
|
-
GENERIC_STEMS.has(normalized.replace(/\d+$/, ""));
|
|
132
|
-
|
|
133
|
-
/** Within {@link SIZE_TOLERANCE} of each other. Two zero-byte files are not "close" — they
|
|
134
|
-
* are two files nothing is known about. */
|
|
135
|
-
export function sizesClose(a: number, b: number, tolerance = SIZE_TOLERANCE): boolean {
|
|
136
|
-
if (a === b && a > 0) return true;
|
|
137
|
-
const larger = Math.max(a, b);
|
|
138
|
-
if (larger <= 0) return false;
|
|
139
|
-
return Math.abs(a - b) / larger <= tolerance;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Within {@link DURATION_TOLERANCE} of each other.
|
|
144
|
-
*
|
|
145
|
-
* 🔴 A missing or zero duration answers `null`, never `false`: "nobody has measured this yet"
|
|
146
|
-
* and "these are different lengths" are opposite answers, and collapsing them makes an
|
|
147
|
-
* unprobed library look like a library with no duplicates in it.
|
|
148
|
-
*/
|
|
149
|
-
export function durationsClose(
|
|
150
|
-
a: number | null | undefined,
|
|
151
|
-
b: number | null | undefined,
|
|
152
|
-
tolerance = DURATION_TOLERANCE,
|
|
153
|
-
): boolean | null {
|
|
154
|
-
if (!a || !b || a <= 0 || b <= 0) return null;
|
|
155
|
-
return Math.abs(a - b) / Math.max(a, b) <= tolerance;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/** One file, reduced to what this module can reason about. Units are the caller's — pass
|
|
159
|
-
* both durations in the same unit or not at all. */
|
|
160
|
-
export interface NamedFileFacts {
|
|
161
|
-
/** The name a person would recognise: a display title, else the last path segment. */
|
|
162
|
-
name: string | null | undefined;
|
|
163
|
-
sizeBytes: number;
|
|
164
|
-
/** Playing time, in whatever unit the caller uses consistently. Null = never measured. */
|
|
165
|
-
duration?: number | null;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export interface NameMatchVerdict {
|
|
169
|
-
match: boolean;
|
|
170
|
-
/** Written for the owner reading a review queue, never for a log. Empty when `match` is
|
|
171
|
-
* false — a non-match has nothing to explain. */
|
|
172
|
-
reason: string;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* The shared "these look like the same thing" test: the NAME agrees after normalization, the
|
|
177
|
-
* sizes are close, and nothing about the length says otherwise.
|
|
178
|
-
*
|
|
179
|
-
* It is deliberately a QUESTION and never an action. Both consumers act only on a checksum,
|
|
180
|
-
* which is proof; this decides what is worth showing a person side by side.
|
|
181
|
-
*/
|
|
182
|
-
export function likelyTheSameFile(a: NamedFileFacts, b: NamedFileFacts): NameMatchVerdict {
|
|
183
|
-
const na = normalizeName(a.name);
|
|
184
|
-
const nb = normalizeName(b.name);
|
|
185
|
-
// Two empty names are not a match with each other — it means neither file has a name worth
|
|
186
|
-
// comparing (a bare digest key, an untitled upload), and pairing those proposes every
|
|
187
|
-
// unnamed object as a duplicate of every other.
|
|
188
|
-
if (!na || na !== nb) return { match: false, reason: "" };
|
|
189
|
-
if (isGenericName(na)) return { match: false, reason: "" };
|
|
190
|
-
if (!sizesClose(a.sizeBytes, b.sizeBytes)) return { match: false, reason: "" };
|
|
191
|
-
if (durationsClose(a.duration, b.duration) === false) return { match: false, reason: "" };
|
|
192
|
-
|
|
193
|
-
const pct = Math.round(
|
|
194
|
-
(Math.abs(a.sizeBytes - b.sizeBytes) / Math.max(a.sizeBytes, b.sizeBytes, 1)) * 100,
|
|
195
|
-
);
|
|
196
|
-
return {
|
|
197
|
-
match: true,
|
|
198
|
-
reason:
|
|
199
|
-
a.sizeBytes === b.sizeBytes
|
|
200
|
-
? "same name, same size, different bytes"
|
|
201
|
-
: `same name, size within ${pct}%, different bytes`,
|
|
202
|
-
};
|
|
203
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Namespace } from './types';
|
|
2
|
-
|
|
3
|
-
/** Irrational angle (in degrees) whose repeated steps around a 360° wheel
|
|
4
|
-
* never re-align on a short cycle, so successive hues stay maximally spread
|
|
5
|
-
* regardless of how many namespaces already exist. */
|
|
6
|
-
const GOLDEN_ANGLE = 137.50776405003785;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Picks the next hue (0–359) for a new namespace by stepping around the color
|
|
10
|
-
* wheel by the golden angle once per existing namespace, then nudging past
|
|
11
|
-
* any exact collision with a hue already in use. Golden-angle stepping keeps
|
|
12
|
-
* consecutive hues far apart without tracking gaps explicitly.
|
|
13
|
-
*/
|
|
14
|
-
export function nextHue(existing: Namespace[]): number {
|
|
15
|
-
const used = new Set(existing.map((n) => n.hue));
|
|
16
|
-
let hue = Math.round((existing.length * GOLDEN_ANGLE) % 360);
|
|
17
|
-
while (used.has(hue)) {
|
|
18
|
-
hue = (hue + 1) % 360;
|
|
19
|
-
}
|
|
20
|
-
return hue;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Trims and collapses internal whitespace in a namespace label, caps it at 40
|
|
25
|
-
* characters, and rejects a label that is empty/blank after normalization.
|
|
26
|
-
*/
|
|
27
|
-
export function normalizeNamespaceLabel(label: string): string {
|
|
28
|
-
const normalized = label.trim().replace(/\s+/g, ' ').slice(0, 40);
|
|
29
|
-
if (!normalized) throw new Error('namespace label must not be empty');
|
|
30
|
-
return normalized;
|
|
31
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// `cursedbelt/namespace` — reusable flat namespace/workspace model. Pure and
|
|
2
|
-
// React-free (the switcher/picker UI lives in the consuming app), so servers
|
|
3
|
-
// can import the contract + store without pulling any UI runtime.
|
|
4
|
-
|
|
5
|
-
export type {
|
|
6
|
-
Namespace,
|
|
7
|
-
NamespaceCreateInput,
|
|
8
|
-
NamespaceStore,
|
|
9
|
-
NamespaceUpdateInput,
|
|
10
|
-
} from './types';
|
|
11
|
-
export { nextHue, normalizeNamespaceLabel } from './helpers';
|
|
12
|
-
export { createMemoryNamespaceStore } from './memoryStore';
|