@neuralis/brain-core 0.3.2 → 0.4.1
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/README.md +80 -1410
- package/app/README.md +1 -1
- package/app/cards/FilesystemCardShell.tsx +42 -4
- package/app/cards/FilesystemChangeCard.tsx +34 -11
- package/app/cards/README.md +6 -5
- package/app/cards/diffUtils.ts +99 -1
- package/app/filesystem/FilesystemHost.tsx +17 -2
- package/app/filesystem/api/README.md +3 -3
- package/app/filesystem/api/index.ts +35 -11
- package/app/filesystem/api/projectPackages.ts +13 -102
- package/app/filesystem/domain/types.ts +30 -10
- package/app/filesystem/hooks/README.md +3 -3
- package/app/filesystem/hooks/useDiscoverableSources.ts +19 -30
- package/app/filesystem/hooks/useFilesystemSSE.ts +1 -1
- package/app/filesystem/host/README.md +5 -3
- package/app/filesystem/host/buildFilesystemHostValue.ts +19 -0
- package/app/filesystem/host/installFilesystemHostComponents.tsx +1 -1
- package/app/filesystem/lib/sourceKindForm.ts +118 -39
- package/app/filesystem/lib/treeVisualState.tsx +98 -4
- package/app/filesystem/store/README.md +1 -0
- package/app/filesystem/store/filesystemStore.ts +86 -5
- package/app/filesystem/store/gitSlice.ts +5 -0
- package/app/filesystem/store/helpers.ts +17 -0
- package/app/filesystem/store/listSlice.ts +8 -0
- package/app/filesystem/ui/CodeEditor.tsx +18 -3
- package/app/filesystem/ui/FileEditor.tsx +15 -10
- package/app/filesystem/ui/FileTree.tsx +41 -16
- package/app/filesystem/ui/FolderPicker.tsx +251 -0
- package/app/filesystem/ui/GitControlPanel.tsx +5 -0
- package/app/filesystem/ui/PackagesPanel.tsx +52 -374
- package/app/filesystem/ui/PolicyEditor.tsx +109 -24
- package/app/filesystem/ui/README.md +17 -11
- package/app/filesystem/ui/RawMediaPreview.tsx +58 -0
- package/app/filesystem/ui/SourceBranchHeader.tsx +4 -4
- package/app/filesystem/ui/SourcesPanel.tsx +420 -360
- package/app/filesystem/ui/Toolbar.tsx +1 -2
- package/app/shared/filesystem.png +0 -0
- package/dist/app/host.js +53 -48
- package/dist/scripts/sourceRootPairV1.d.ts +47 -0
- package/dist/scripts/sourceRootPairV1.d.ts.map +1 -0
- package/dist/scripts/sourceRootPairV1.js +147 -0
- package/dist/scripts/sourceRootPairV1.js.map +1 -0
- package/dist/scripts/sourceToFolderV1.d.ts +56 -0
- package/dist/scripts/sourceToFolderV1.d.ts.map +1 -0
- package/dist/scripts/sourceToFolderV1.js +152 -0
- package/dist/scripts/sourceToFolderV1.js.map +1 -0
- package/dist/scripts/sourceToHostV1.d.ts +56 -0
- package/dist/scripts/sourceToHostV1.d.ts.map +1 -0
- package/dist/scripts/sourceToHostV1.js +132 -0
- package/dist/scripts/sourceToHostV1.js.map +1 -0
- package/dist/src/config/env.d.ts +8 -0
- package/dist/src/config/env.d.ts.map +1 -1
- package/dist/src/config/env.js +17 -6
- package/dist/src/config/env.js.map +1 -1
- package/dist/src/connectors/AppSourceConfigStore.d.ts +17 -3
- package/dist/src/connectors/AppSourceConfigStore.d.ts.map +1 -1
- package/dist/src/connectors/AppSourceConfigStore.js +46 -6
- package/dist/src/connectors/AppSourceConfigStore.js.map +1 -1
- package/dist/src/connectors/HostConnector.d.ts +201 -0
- package/dist/src/connectors/HostConnector.d.ts.map +1 -0
- package/dist/src/connectors/HostConnector.js +903 -0
- package/dist/src/connectors/HostConnector.js.map +1 -0
- package/dist/src/connectors/inProcessTransport.d.ts +131 -0
- package/dist/src/connectors/inProcessTransport.d.ts.map +1 -0
- package/dist/src/connectors/inProcessTransport.js +447 -0
- package/dist/src/connectors/inProcessTransport.js.map +1 -0
- package/dist/src/domain/BrainError.d.ts +14 -0
- package/dist/src/domain/BrainError.d.ts.map +1 -1
- package/dist/src/domain/BrainError.js +21 -0
- package/dist/src/domain/BrainError.js.map +1 -1
- package/dist/src/domain/access/callerPermissions.d.ts +29 -0
- package/dist/src/domain/access/callerPermissions.d.ts.map +1 -1
- package/dist/src/domain/access/callerPermissions.js +85 -5
- package/dist/src/domain/access/callerPermissions.js.map +1 -1
- package/dist/src/domain/access/nativeLocalFence.d.ts +65 -0
- package/dist/src/domain/access/nativeLocalFence.d.ts.map +1 -0
- package/dist/src/domain/access/nativeLocalFence.js +171 -0
- package/dist/src/domain/access/nativeLocalFence.js.map +1 -0
- package/dist/src/domain/access/uriPermission.js +3 -3
- package/dist/src/domain/access/uriPermission.js.map +1 -1
- package/dist/src/domain/byteRange.d.ts +15 -0
- package/dist/src/domain/byteRange.d.ts.map +1 -0
- package/dist/src/domain/byteRange.js +30 -0
- package/dist/src/domain/byteRange.js.map +1 -0
- package/dist/src/domain/defaultPermissions.d.ts.map +1 -1
- package/dist/src/domain/defaultPermissions.js +29 -0
- package/dist/src/domain/defaultPermissions.js.map +1 -1
- package/dist/src/domain/mime.d.ts +8 -16
- package/dist/src/domain/mime.d.ts.map +1 -1
- package/dist/src/domain/mime.js +10 -99
- package/dist/src/domain/mime.js.map +1 -1
- package/dist/src/domain/paths.d.ts.map +1 -1
- package/dist/src/domain/paths.js +5 -3
- package/dist/src/domain/paths.js.map +1 -1
- package/dist/src/domain/sourceConfig.d.ts +52 -19
- package/dist/src/domain/sourceConfig.d.ts.map +1 -1
- package/dist/src/domain/sourceConfig.js +103 -19
- package/dist/src/domain/sourceConfig.js.map +1 -1
- package/dist/src/domain/sourcePackages.d.ts +8 -8
- package/dist/src/domain/sourcePackages.d.ts.map +1 -1
- package/dist/src/domain/sourceRootPair.d.ts +88 -0
- package/dist/src/domain/sourceRootPair.d.ts.map +1 -0
- package/dist/src/domain/sourceRootPair.js +108 -0
- package/dist/src/domain/sourceRootPair.js.map +1 -0
- package/dist/src/domain/syncTypes.d.ts +8 -1
- package/dist/src/domain/syncTypes.d.ts.map +1 -1
- package/dist/src/domain/syncTypes.js +1 -0
- package/dist/src/domain/syncTypes.js.map +1 -1
- package/dist/src/domain/types.d.ts +29 -1
- package/dist/src/domain/types.d.ts.map +1 -1
- package/dist/src/domain/uri.d.ts.map +1 -1
- package/dist/src/domain/uri.js +3 -2
- package/dist/src/domain/uri.js.map +1 -1
- package/dist/src/embeddings/clients/GeminiEmbedder.d.ts.map +1 -1
- package/dist/src/embeddings/clients/GeminiEmbedder.js +2 -5
- package/dist/src/embeddings/clients/GeminiEmbedder.js.map +1 -1
- package/dist/src/embeddings/clients/OpenAIEmbedder.d.ts.map +1 -1
- package/dist/src/embeddings/clients/OpenAIEmbedder.js +2 -3
- package/dist/src/embeddings/clients/OpenAIEmbedder.js.map +1 -1
- package/dist/src/embeddings/clients/QwenEmbedder.d.ts +2 -0
- package/dist/src/embeddings/clients/QwenEmbedder.d.ts.map +1 -1
- package/dist/src/embeddings/clients/QwenEmbedder.js +10 -2
- package/dist/src/embeddings/clients/QwenEmbedder.js.map +1 -1
- package/dist/src/embeddings/clients/VoyageEmbedder.d.ts +2 -0
- package/dist/src/embeddings/clients/VoyageEmbedder.d.ts.map +1 -1
- package/dist/src/embeddings/clients/VoyageEmbedder.js +8 -1
- package/dist/src/embeddings/clients/VoyageEmbedder.js.map +1 -1
- package/dist/src/embeddings/factory.d.ts +5 -3
- package/dist/src/embeddings/factory.d.ts.map +1 -1
- package/dist/src/embeddings/factory.js +7 -3
- package/dist/src/embeddings/factory.js.map +1 -1
- package/dist/src/embeddings/models.d.ts +2 -3
- package/dist/src/embeddings/models.d.ts.map +1 -1
- package/dist/src/embeddings/models.js +1 -2
- package/dist/src/embeddings/models.js.map +1 -1
- package/dist/src/embeddings/retry.js +1 -1
- package/dist/src/embeddings/retry.js.map +1 -1
- package/dist/src/embeddings/types.d.ts +6 -0
- package/dist/src/embeddings/types.d.ts.map +1 -1
- package/dist/src/embeddings/types.js +11 -0
- package/dist/src/embeddings/types.js.map +1 -1
- package/dist/src/git/GitRunner.d.ts +110 -30
- package/dist/src/git/GitRunner.d.ts.map +1 -1
- package/dist/src/git/GitRunner.js +511 -199
- package/dist/src/git/GitRunner.js.map +1 -1
- package/dist/src/git/GitWatchRegistry.d.ts +41 -35
- package/dist/src/git/GitWatchRegistry.d.ts.map +1 -1
- package/dist/src/git/GitWatchRegistry.js +61 -79
- package/dist/src/git/GitWatchRegistry.js.map +1 -1
- package/dist/src/git/gitPlace.d.ts +61 -0
- package/dist/src/git/gitPlace.d.ts.map +1 -0
- package/dist/src/git/gitPlace.js +74 -0
- package/dist/src/git/gitPlace.js.map +1 -0
- package/dist/src/git/sourceGitControl.d.ts +31 -19
- package/dist/src/git/sourceGitControl.d.ts.map +1 -1
- package/dist/src/git/sourceGitControl.js +208 -92
- package/dist/src/git/sourceGitControl.js.map +1 -1
- package/dist/src/git/sourceGitStatus.js +1 -1
- package/dist/src/git/sourceGitStatus.js.map +1 -1
- package/dist/src/git/untrackedStats.js +1 -1
- package/dist/src/git/untrackedStats.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lifecycle.d.ts +12 -16
- package/dist/src/lifecycle.d.ts.map +1 -1
- package/dist/src/lifecycle.js +2 -1
- package/dist/src/lifecycle.js.map +1 -1
- package/dist/src/routes/approve.d.ts.map +1 -1
- package/dist/src/routes/approve.js +3 -3
- package/dist/src/routes/approve.js.map +1 -1
- package/dist/src/routes/git.d.ts.map +1 -1
- package/dist/src/routes/git.js +183 -54
- package/dist/src/routes/git.js.map +1 -1
- package/dist/src/routes/health.d.ts.map +1 -1
- package/dist/src/routes/health.js +8 -5
- package/dist/src/routes/health.js.map +1 -1
- package/dist/src/routes/helpers/uriGuard.d.ts +1 -1
- package/dist/src/routes/helpers/uriGuard.d.ts.map +1 -1
- package/dist/src/routes/helpers/uriGuard.js +3 -2
- package/dist/src/routes/helpers/uriGuard.js.map +1 -1
- package/dist/src/routes/helpers.d.ts +20 -4
- package/dist/src/routes/helpers.d.ts.map +1 -1
- package/dist/src/routes/helpers.js +38 -5
- package/dist/src/routes/helpers.js.map +1 -1
- package/dist/src/routes/list.d.ts.map +1 -1
- package/dist/src/routes/list.js +5 -6
- package/dist/src/routes/list.js.map +1 -1
- package/dist/src/routes/pending.d.ts.map +1 -1
- package/dist/src/routes/pending.js +5 -5
- package/dist/src/routes/pending.js.map +1 -1
- package/dist/src/routes/policies.d.ts +6 -4
- package/dist/src/routes/policies.d.ts.map +1 -1
- package/dist/src/routes/policies.js +22 -16
- package/dist/src/routes/policies.js.map +1 -1
- package/dist/src/routes/raw.d.ts.map +1 -1
- package/dist/src/routes/raw.js +68 -14
- package/dist/src/routes/raw.js.map +1 -1
- package/dist/src/routes/read.d.ts.map +1 -1
- package/dist/src/routes/read.js +3 -3
- package/dist/src/routes/read.js.map +1 -1
- package/dist/src/routes/search.d.ts.map +1 -1
- package/dist/src/routes/search.js +3 -3
- package/dist/src/routes/search.js.map +1 -1
- package/dist/src/routes/sources.d.ts +60 -18
- package/dist/src/routes/sources.d.ts.map +1 -1
- package/dist/src/routes/sources.js +420 -308
- package/dist/src/routes/sources.js.map +1 -1
- package/dist/src/routes/upload.d.ts.map +1 -1
- package/dist/src/routes/upload.js +3 -3
- package/dist/src/routes/upload.js.map +1 -1
- package/dist/src/services/BridgeService.d.ts +15 -35
- package/dist/src/services/BridgeService.d.ts.map +1 -1
- package/dist/src/services/BridgeService.js +30 -88
- package/dist/src/services/BridgeService.js.map +1 -1
- package/dist/src/services/FilesystemService.d.ts +3 -2
- package/dist/src/services/FilesystemService.d.ts.map +1 -1
- package/dist/src/services/FilesystemService.js +116 -32
- package/dist/src/services/FilesystemService.js.map +1 -1
- package/dist/src/services/FilesystemUiService.d.ts +4 -1
- package/dist/src/services/FilesystemUiService.d.ts.map +1 -1
- package/dist/src/services/FilesystemUiService.js +71 -27
- package/dist/src/services/FilesystemUiService.js.map +1 -1
- package/dist/src/services/SyncScheduler.d.ts +12 -4
- package/dist/src/services/SyncScheduler.d.ts.map +1 -1
- package/dist/src/services/SyncScheduler.js +45 -10
- package/dist/src/services/SyncScheduler.js.map +1 -1
- package/dist/src/services/baselineRepair.d.ts +13 -3
- package/dist/src/services/baselineRepair.d.ts.map +1 -1
- package/dist/src/services/baselineRepair.js +13 -3
- package/dist/src/services/baselineRepair.js.map +1 -1
- package/dist/src/services/declaredSources.d.ts +125 -42
- package/dist/src/services/declaredSources.d.ts.map +1 -1
- package/dist/src/services/declaredSources.js +117 -45
- package/dist/src/services/declaredSources.js.map +1 -1
- package/dist/src/store/dataFormats.d.ts +17 -2
- package/dist/src/store/dataFormats.d.ts.map +1 -1
- package/dist/src/store/dataFormats.js +18 -3
- package/dist/src/store/dataFormats.js.map +1 -1
- package/dist/src/sync/DeltaSyncRunner.d.ts.map +1 -1
- package/dist/src/sync/DeltaSyncRunner.js +144 -4
- package/dist/src/sync/DeltaSyncRunner.js.map +1 -1
- package/dist/src/sync/SyncJobQueue.d.ts +14 -2
- package/dist/src/sync/SyncJobQueue.d.ts.map +1 -1
- package/dist/src/sync/SyncJobQueue.js +56 -10
- package/dist/src/sync/SyncJobQueue.js.map +1 -1
- package/dist/src/sync/SyncWatchService.d.ts +21 -4
- package/dist/src/sync/SyncWatchService.d.ts.map +1 -1
- package/dist/src/sync/SyncWatchService.js +115 -10
- package/dist/src/sync/SyncWatchService.js.map +1 -1
- package/dist/src/sync/categoryInference.d.ts +1 -1
- package/dist/src/sync/categoryInference.js +1 -1
- package/dist/src/tools/execCtx.d.ts +6 -0
- package/dist/src/tools/execCtx.d.ts.map +1 -1
- package/dist/src/tools/execCtx.js +11 -0
- package/dist/src/tools/execCtx.js.map +1 -1
- package/dist/src/tools/fs_list.js +2 -2
- package/dist/src/tools/fs_list.js.map +1 -1
- package/dist/src/tools/fs_read.js +2 -2
- package/dist/src/tools/fs_read.js.map +1 -1
- package/dist/src/tools/fs_search.js +2 -2
- package/dist/src/tools/fs_search.js.map +1 -1
- package/dist/src/tools/fs_write.js +2 -2
- package/dist/src/tools/fs_write.js.map +1 -1
- package/dist/src/usecases/admitSourceRoot.d.ts +65 -0
- package/dist/src/usecases/admitSourceRoot.d.ts.map +1 -0
- package/dist/src/usecases/admitSourceRoot.js +85 -0
- package/dist/src/usecases/admitSourceRoot.js.map +1 -0
- package/dist/src/usecases/browseSourceFolders.d.ts +85 -0
- package/dist/src/usecases/browseSourceFolders.d.ts.map +1 -0
- package/dist/src/usecases/browseSourceFolders.js +210 -0
- package/dist/src/usecases/browseSourceFolders.js.map +1 -0
- package/dist/src/usecases/createDeclaredSources.d.ts +13 -2
- package/dist/src/usecases/createDeclaredSources.d.ts.map +1 -1
- package/dist/src/usecases/createDeclaredSources.js +39 -0
- package/dist/src/usecases/createDeclaredSources.js.map +1 -1
- package/dist/src/usecases/deprovisionProject.d.ts +4 -5
- package/dist/src/usecases/deprovisionProject.d.ts.map +1 -1
- package/dist/src/usecases/deprovisionProject.js +3 -8
- package/dist/src/usecases/deprovisionProject.js.map +1 -1
- package/dist/src/usecases/list.d.ts.map +1 -1
- package/dist/src/usecases/list.js +83 -26
- package/dist/src/usecases/list.js.map +1 -1
- package/dist/src/usecases/listAttachableDevices.d.ts +13 -0
- package/dist/src/usecases/listAttachableDevices.d.ts.map +1 -0
- package/dist/src/usecases/listAttachableDevices.js +10 -0
- package/dist/src/usecases/listAttachableDevices.js.map +1 -0
- package/dist/src/usecases/listSourcePackages.d.ts.map +1 -1
- package/dist/src/usecases/listSourcePackages.js +95 -79
- package/dist/src/usecases/listSourcePackages.js.map +1 -1
- package/dist/src/usecases/purgeExcludedPoints.d.ts.map +1 -1
- package/dist/src/usecases/purgeExcludedPoints.js +3 -2
- package/dist/src/usecases/purgeExcludedPoints.js.map +1 -1
- package/dist/src/usecases/readFiles.d.ts.map +1 -1
- package/dist/src/usecases/readFiles.js +17 -1
- package/dist/src/usecases/readFiles.js.map +1 -1
- package/dist/src/usecases/reconcileSourcePackageRoots.d.ts +1 -1
- package/dist/src/usecases/reconcileSourcePackageRoots.d.ts.map +1 -1
- package/dist/src/usecases/reconcileSourcePackageRoots.js +2 -1
- package/dist/src/usecases/reconcileSourcePackageRoots.js.map +1 -1
- package/dist/src/usecases/revokePrincipal.d.ts +7 -5
- package/dist/src/usecases/revokePrincipal.d.ts.map +1 -1
- package/dist/src/usecases/revokePrincipal.js +29 -7
- package/dist/src/usecases/revokePrincipal.js.map +1 -1
- package/dist/src/usecases/scheduleSourceSync.d.ts +7 -0
- package/dist/src/usecases/scheduleSourceSync.d.ts.map +1 -1
- package/dist/src/usecases/scheduleSourceSync.js +6 -5
- package/dist/src/usecases/scheduleSourceSync.js.map +1 -1
- package/dist/src/usecases/searchFiles.d.ts.map +1 -1
- package/dist/src/usecases/searchFiles.js +13 -3
- package/dist/src/usecases/searchFiles.js.map +1 -1
- package/dist/src/usecases/sourcePackageInventory.d.ts +10 -2
- package/dist/src/usecases/sourcePackageInventory.d.ts.map +1 -1
- package/dist/src/usecases/sourcePackageInventory.js +24 -7
- package/dist/src/usecases/sourcePackageInventory.js.map +1 -1
- package/dist/src/usecases/triggerSourceSync.d.ts +46 -0
- package/dist/src/usecases/triggerSourceSync.d.ts.map +1 -0
- package/dist/src/usecases/triggerSourceSync.js +75 -0
- package/dist/src/usecases/triggerSourceSync.js.map +1 -0
- package/dist/src/usecases/uploadBinary.d.ts +2 -1
- package/dist/src/usecases/uploadBinary.d.ts.map +1 -1
- package/dist/src/usecases/uploadBinary.js +2 -2
- package/dist/src/usecases/uploadBinary.js.map +1 -1
- package/dist/src/usecases/vector/endpointGuard.d.ts +1 -1
- package/dist/src/usecases/vector/endpointGuard.js +1 -1
- package/dist/src/usecases/vectorActivityWatch.d.ts +20 -13
- package/dist/src/usecases/vectorActivityWatch.d.ts.map +1 -1
- package/dist/src/usecases/vectorActivityWatch.js +61 -36
- package/dist/src/usecases/vectorActivityWatch.js.map +1 -1
- package/dist/src/usecases/vectorMaintenance.d.ts.map +1 -1
- package/dist/src/usecases/vectorMaintenance.js +16 -1
- package/dist/src/usecases/vectorMaintenance.js.map +1 -1
- package/dist/src/usecases/write/index.d.ts.map +1 -1
- package/dist/src/usecases/write/index.js +17 -2
- package/dist/src/usecases/write/index.js.map +1 -1
- package/dist/src/usecases/write/occupancy.d.ts +5 -1
- package/dist/src/usecases/write/occupancy.d.ts.map +1 -1
- package/dist/src/usecases/write/occupancy.js +13 -4
- package/dist/src/usecases/write/occupancy.js.map +1 -1
- package/dist/src/usecases/write/structure.d.ts.map +1 -1
- package/dist/src/usecases/write/structure.js +20 -5
- package/dist/src/usecases/write/structure.js.map +1 -1
- package/dist/src/vector/FilesystemVectorIndex.d.ts +72 -2
- package/dist/src/vector/FilesystemVectorIndex.d.ts.map +1 -1
- package/dist/src/vector/FilesystemVectorIndex.js +211 -27
- package/dist/src/vector/FilesystemVectorIndex.js.map +1 -1
- package/dist/src/vector/InMemoryVectorIndex.d.ts.map +1 -1
- package/dist/src/vector/InMemoryVectorIndex.js +55 -7
- package/dist/src/vector/InMemoryVectorIndex.js.map +1 -1
- package/dist/src/vector/qdrantClient.d.ts +18 -1
- package/dist/src/vector/qdrantClient.d.ts.map +1 -1
- package/dist/src/vector/qdrantClient.js +48 -6
- package/dist/src/vector/qdrantClient.js.map +1 -1
- package/dist/src/wiring.d.ts +10 -12
- package/dist/src/wiring.d.ts.map +1 -1
- package/dist/src/wiring.js +101 -61
- package/dist/src/wiring.js.map +1 -1
- package/package.json +166 -54
- package/skills/connect-business-data/SKILL.md +2 -2
- package/skills/create-package/SKILL.md +18 -18
- package/skills/create-package/references/config-and-credentials.md +16 -13
- package/skills/create-package/references/connectors-and-uri-policies.md +36 -27
- package/skills/create-package/references/manifest-and-discovery.md +12 -12
- package/skills/create-package/references/runtime-and-build.md +18 -18
- package/skills/create-package/references/skills-and-context.md +35 -19
- package/skills/create-package/references/surfaces-and-design.md +16 -16
- package/skills/create-package/references/team-and-workflows.md +2 -2
- package/skills/create-package/references/test-and-ship.md +17 -17
- package/skills/create-package/references/tools-and-schemas.md +5 -5
- package/skills/create-package/scripts/{check-package.sh → check-package.mjs} +78 -64
- package/skills/create-package/scripts/{verify-loaded.sh → verify-loaded.mjs} +156 -162
- package/skills/git/SKILL.md +31 -29
- package/skills/manage-files/SKILL.md +11 -14
- package/skills/manage-sources/SKILL.md +85 -45
- package/skills/manage-uri-policy/SKILL.md +9 -6
- package/skills/sync/SKILL.md +2 -2
- package/dist/src/connectors/LocalDiskConnector.d.ts +0 -171
- package/dist/src/connectors/LocalDiskConnector.d.ts.map +0 -1
- package/dist/src/connectors/LocalDiskConnector.js +0 -1233
- package/dist/src/connectors/LocalDiskConnector.js.map +0 -1
- package/skills/manage-files/scripts/copy.sh +0 -7
- package/skills/manage-files/scripts/create.sh +0 -7
- package/skills/manage-files/scripts/mkdir.sh +0 -7
- package/skills/manage-files/scripts/modify.sh +0 -7
- package/skills/manage-files/scripts/upload.sh +0 -16
- package/skills/manage-files/scripts/write.sh +0 -29
- package/skills/manage-sources/scripts/reembed.sh +0 -23
|
@@ -3,19 +3,22 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Filesystem panel → Packages tab.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* The packages the active agent can use in this project — its `_packages/`
|
|
7
|
+
* drop zone and every source package folder (a device's offline ones marked
|
|
8
|
+
* "Not available") — exactly as the agent gets them: the host's scoped
|
|
9
|
+
* snapshot for this caller and this agent. Native packages are not listed;
|
|
10
|
+
* they are the host's own and live in Admin → Packages. So do the changes a
|
|
11
|
+
* package manager makes (trust, Build, the access feature): this panel shows
|
|
12
|
+
* the state and, to a holder of `packages.manage`, a link there.
|
|
9
13
|
*/
|
|
10
14
|
|
|
11
15
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
12
|
-
import { createPortal } from 'react-dom';
|
|
13
16
|
import {
|
|
14
17
|
AlertTriangle,
|
|
15
18
|
CheckCircle2,
|
|
16
19
|
ChevronDown,
|
|
17
20
|
ChevronRight,
|
|
18
|
-
|
|
21
|
+
ExternalLink,
|
|
19
22
|
Info,
|
|
20
23
|
Loader2,
|
|
21
24
|
Package as PackageIcon,
|
|
@@ -23,43 +26,28 @@ import {
|
|
|
23
26
|
Shield,
|
|
24
27
|
ShieldAlert,
|
|
25
28
|
ShieldCheck,
|
|
26
|
-
ShieldOff,
|
|
27
|
-
Wrench,
|
|
28
29
|
Zap,
|
|
29
30
|
} from 'lucide-react';
|
|
31
|
+
import { hasFeature } from '@neuralis/package-system/access';
|
|
30
32
|
import { SkillLauncher } from '@neuralis/package-system/client';
|
|
31
33
|
import {
|
|
32
|
-
buildPackage,
|
|
33
34
|
getPackagesDiagnostics,
|
|
34
35
|
listProjectPackages,
|
|
35
|
-
setPackageTrust,
|
|
36
|
-
setPackageAccessFeature,
|
|
37
|
-
getGrantableFeatureIds,
|
|
38
36
|
type ProjectPackageRow,
|
|
39
|
-
type BuildResponse,
|
|
40
37
|
type PackageDiagnosticEntry,
|
|
41
|
-
type TrustValue,
|
|
42
38
|
} from '../api/projectPackages';
|
|
43
39
|
import { useFilesystemHost } from '../FilesystemHost';
|
|
44
40
|
|
|
45
41
|
type Props = {
|
|
46
42
|
projectId: string;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
type PendingAction = 'none' | 'trust' | 'build' | 'access-feature';
|
|
50
|
-
|
|
51
|
-
type LogModal = {
|
|
52
|
-
slug: string;
|
|
53
|
-
logs: string[];
|
|
54
|
-
ok?: boolean;
|
|
55
|
-
error?: string;
|
|
56
|
-
durationMs?: number;
|
|
43
|
+
/** The Files window's agent: its own packages show, and the Admin link opens in its window. */
|
|
44
|
+
agentId?: string;
|
|
57
45
|
};
|
|
58
46
|
|
|
59
47
|
const PARTIAL_REASON_COPY: Record<string, { label: string; hint: string }> = {
|
|
60
48
|
'build-missing': {
|
|
61
49
|
label: 'Needs build',
|
|
62
|
-
hint: 'The package has server-side code (src/) but the WASM binary is missing.
|
|
50
|
+
hint: 'The package has server-side code (src/) but the WASM binary is missing. A package manager builds it in Admin → Packages.',
|
|
63
51
|
},
|
|
64
52
|
'runtime-unavailable': {
|
|
65
53
|
label: 'Runtime unavailable',
|
|
@@ -71,39 +59,37 @@ const PARTIAL_REASON_COPY: Record<string, { label: string; hint: string }> = {
|
|
|
71
59
|
},
|
|
72
60
|
'untrusted-mcp': {
|
|
73
61
|
label: 'Declarative only',
|
|
74
|
-
hint: 'The "mcp" runtime spawns a subprocess as the host user and needs
|
|
62
|
+
hint: 'The "mcp" runtime spawns a subprocess as the host user and needs native trust, so no subprocess was started. Declare `runtime.type: "wasm"` in the manifest to enable handlers.',
|
|
63
|
+
},
|
|
64
|
+
'device-offline': {
|
|
65
|
+
label: 'Not available',
|
|
66
|
+
hint: 'The device that holds this package is offline. Its skills and tools return when the device reconnects; nothing of it is copied to this server.',
|
|
75
67
|
},
|
|
76
68
|
};
|
|
77
69
|
|
|
78
|
-
export function PackagesPanel({ projectId }: Props) {
|
|
79
|
-
//
|
|
80
|
-
//
|
|
70
|
+
export function PackagesPanel({ projectId, agentId }: Props) {
|
|
71
|
+
// The link mirrors the admin route's own gate (`packages.manage`): hidden,
|
|
72
|
+
// never disabled, for anyone without it — the host re-checks every change.
|
|
81
73
|
const host = useFilesystemHost();
|
|
82
|
-
const
|
|
74
|
+
const canOpenAdmin = Boolean(agentId && host.openAdminPackages && hasFeature({ grantedFeatures: [...(host.grantedFeatures ?? [])] }, 'packages.manage'));
|
|
75
|
+
const openAdmin = useCallback(() => {
|
|
76
|
+
if (agentId) host.openAdminPackages?.(agentId);
|
|
77
|
+
}, [agentId, host]);
|
|
83
78
|
const [rows, setRows] = useState<ProjectPackageRow[]>([]);
|
|
84
79
|
const [loading, setLoading] = useState(true);
|
|
85
80
|
const [loadError, setLoadError] = useState<string | null>(null);
|
|
86
81
|
const [expanded, setExpanded] = useState<Record<string, boolean>>({});
|
|
87
|
-
const [pending, setPending] = useState<Record<string, PendingAction>>({});
|
|
88
|
-
const [toast, setToast] = useState<string | null>(null);
|
|
89
|
-
// SSR guard for the portals below (no `document` on the server pass).
|
|
90
|
-
const [mounted, setMounted] = useState(false);
|
|
91
|
-
useEffect(() => { setMounted(true); }, []);
|
|
92
|
-
const [logModal, setLogModal] = useState<LogModal | null>(null);
|
|
93
82
|
// W3F — per-package diagnostic entries from /packages/diagnostics so the
|
|
94
83
|
// panel can surface concrete validation/init errors instead of silently
|
|
95
84
|
// dropping a broken `_packages/<x>/` from the list.
|
|
96
85
|
const [diagnostics, setDiagnostics] = useState<PackageDiagnosticEntry[]>([]);
|
|
97
86
|
const [diagnosticsError, setDiagnosticsError] = useState<string | null>(null);
|
|
98
|
-
// R2b — grantable feature ids for the access-feature governance picker
|
|
99
|
-
// (owner/admin only; degrades to free-text if the fetch fails).
|
|
100
|
-
const [featureIds, setFeatureIds] = useState<string[]>([]);
|
|
101
87
|
|
|
102
88
|
const reload = useCallback(async () => {
|
|
103
89
|
setLoading(true);
|
|
104
90
|
setLoadError(null);
|
|
105
91
|
try {
|
|
106
|
-
const list = await listProjectPackages(projectId);
|
|
92
|
+
const list = await listProjectPackages(projectId, agentId);
|
|
107
93
|
setRows(list);
|
|
108
94
|
} catch (err) {
|
|
109
95
|
setLoadError(err instanceof Error ? err.message : String(err));
|
|
@@ -119,98 +105,16 @@ export function PackagesPanel({ projectId }: Props) {
|
|
|
119
105
|
setDiagnostics([]);
|
|
120
106
|
setDiagnosticsError(err instanceof Error ? err.message : String(err));
|
|
121
107
|
}
|
|
122
|
-
}, [projectId]);
|
|
108
|
+
}, [projectId, agentId]);
|
|
123
109
|
|
|
124
110
|
useEffect(() => {
|
|
125
111
|
void reload();
|
|
126
112
|
}, [reload]);
|
|
127
113
|
|
|
128
|
-
// R2b — load the grantable feature catalog once per project (owner/admin only;
|
|
129
|
-
// non-owners get 403 and we silently keep the empty list → free-text fallback).
|
|
130
|
-
useEffect(() => {
|
|
131
|
-
if (!isOwnerEffective) return;
|
|
132
|
-
let cancelled = false;
|
|
133
|
-
getGrantableFeatureIds(projectId)
|
|
134
|
-
.then((ids) => { if (!cancelled) setFeatureIds(ids); })
|
|
135
|
-
.catch(() => { /* silent — free-text fallback */ });
|
|
136
|
-
return () => { cancelled = true; };
|
|
137
|
-
}, [projectId, isOwnerEffective]);
|
|
138
|
-
|
|
139
114
|
const handleToggleExpand = useCallback((slug: string) => {
|
|
140
115
|
setExpanded((prev) => ({ ...prev, [slug]: !prev[slug] }));
|
|
141
116
|
}, []);
|
|
142
117
|
|
|
143
|
-
const handleFlipTrust = useCallback(
|
|
144
|
-
async (row: ProjectPackageRow) => {
|
|
145
|
-
const currentTrust = row.access?.trust ?? 'untrusted';
|
|
146
|
-
if (currentTrust === 'first-party') return;
|
|
147
|
-
const next: TrustValue = currentTrust === 'trusted' ? 'untrusted' : 'trusted';
|
|
148
|
-
setPending((p) => ({ ...p, [row.slug]: 'trust' }));
|
|
149
|
-
try {
|
|
150
|
-
await setPackageTrust(projectId, row.slug, next);
|
|
151
|
-
setToast(`Trust: ${row.slug} → ${next}`);
|
|
152
|
-
await reload();
|
|
153
|
-
} catch (err) {
|
|
154
|
-
setToast(err instanceof Error ? err.message : 'Failed to set trust');
|
|
155
|
-
} finally {
|
|
156
|
-
setPending((p) => ({ ...p, [row.slug]: 'none' }));
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
[projectId, reload],
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
const handleSetAccessFeature = useCallback(
|
|
163
|
-
async (row: ProjectPackageRow, featureId: string | null) => {
|
|
164
|
-
setPending((p) => ({ ...p, [row.slug]: 'access-feature' }));
|
|
165
|
-
try {
|
|
166
|
-
await setPackageAccessFeature(projectId, row.packageId, featureId);
|
|
167
|
-
setToast(featureId ? `Access feature: ${row.slug} → ${featureId}` : `Access feature cleared: ${row.slug}`);
|
|
168
|
-
await reload();
|
|
169
|
-
} catch (err) {
|
|
170
|
-
setToast(err instanceof Error ? err.message : 'Failed to set access feature');
|
|
171
|
-
} finally {
|
|
172
|
-
setPending((p) => ({ ...p, [row.slug]: 'none' }));
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
[projectId, reload],
|
|
176
|
-
);
|
|
177
|
-
|
|
178
|
-
const handleBuild = useCallback(
|
|
179
|
-
async (row: ProjectPackageRow) => {
|
|
180
|
-
setPending((p) => ({ ...p, [row.slug]: 'build' }));
|
|
181
|
-
setLogModal({ slug: row.slug, logs: ['Starting build…'] });
|
|
182
|
-
let response: BuildResponse | null = null;
|
|
183
|
-
try {
|
|
184
|
-
response = await buildPackage(projectId, row.slug);
|
|
185
|
-
setLogModal({
|
|
186
|
-
slug: row.slug,
|
|
187
|
-
logs: response.logs,
|
|
188
|
-
ok: response.ok,
|
|
189
|
-
error: response.error,
|
|
190
|
-
durationMs: response.durationMs,
|
|
191
|
-
});
|
|
192
|
-
if (response.ok) {
|
|
193
|
-
setToast(`Build complete: ${row.slug} (${response.durationMs}ms)`);
|
|
194
|
-
await reload();
|
|
195
|
-
} else {
|
|
196
|
-
setToast(`Build failed: ${response.error ?? 'unknown'}`);
|
|
197
|
-
}
|
|
198
|
-
} catch (err) {
|
|
199
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
200
|
-
setLogModal({
|
|
201
|
-
slug: row.slug,
|
|
202
|
-
logs: [`Request failed: ${msg}`],
|
|
203
|
-
ok: false,
|
|
204
|
-
error: msg,
|
|
205
|
-
});
|
|
206
|
-
setToast(`Build request failed: ${msg}`);
|
|
207
|
-
} finally {
|
|
208
|
-
setPending((p) => ({ ...p, [row.slug]: 'none' }));
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
[projectId, reload],
|
|
212
|
-
);
|
|
213
|
-
|
|
214
118
|
const sortedRows = useMemo(() => {
|
|
215
119
|
return [...rows].sort((a, b) => a.name.localeCompare(b.name));
|
|
216
120
|
}, [rows]);
|
|
@@ -220,13 +124,8 @@ export function PackagesPanel({ projectId }: Props) {
|
|
|
220
124
|
// their package is missing.
|
|
221
125
|
const orphanDiagnostics = useMemo(() => {
|
|
222
126
|
const knownIds = new Set(rows.map((r) => r.packageId));
|
|
223
|
-
return diagnostics.filter((d) => !knownIds.has(d.packageId) || d.status === 'missing' || d.status === 'error');
|
|
127
|
+
return diagnostics.filter((d) => d.trust !== 'native' && (!knownIds.has(d.packageId) || d.status === 'missing' || d.status === 'error'));
|
|
224
128
|
}, [diagnostics, rows]);
|
|
225
|
-
const diagnosticByPkg = useMemo(() => {
|
|
226
|
-
const map = new Map<string, PackageDiagnosticEntry>();
|
|
227
|
-
for (const d of diagnostics) map.set(d.packageId, d);
|
|
228
|
-
return map;
|
|
229
|
-
}, [diagnostics]);
|
|
230
129
|
|
|
231
130
|
if (loading) {
|
|
232
131
|
return (
|
|
@@ -265,6 +164,16 @@ export function PackagesPanel({ projectId }: Props) {
|
|
|
265
164
|
</span>
|
|
266
165
|
</div>
|
|
267
166
|
<div className="flex items-center gap-1.5">
|
|
167
|
+
{canOpenAdmin ? (
|
|
168
|
+
<button
|
|
169
|
+
className="inline-flex items-center gap-1 rounded-md bg-white/5 px-2 py-1 text-[11px] text-white/60 hover:bg-white/10 hover:text-white/85"
|
|
170
|
+
onClick={openAdmin}
|
|
171
|
+
title="Trust, Build and the access feature"
|
|
172
|
+
>
|
|
173
|
+
<ExternalLink className="w-3 h-3" />
|
|
174
|
+
Admin → Packages
|
|
175
|
+
</button>
|
|
176
|
+
) : null}
|
|
268
177
|
{/* Authoring affordance — hands package scaffold/build (including the
|
|
269
178
|
WASM pipeline) to the agent via the one `create-package` skill.
|
|
270
179
|
The SKILL itself is ungated by design (so it stays importable),
|
|
@@ -275,8 +184,8 @@ export function PackagesPanel({ projectId }: Props) {
|
|
|
275
184
|
than hiding it. `alsoRequires` can only ever REMOVE the button,
|
|
276
185
|
never reveal one, so this cannot become a disclosure. Do not "fix"
|
|
277
186
|
it to match the skill's own gate. Script-less skill, so the click
|
|
278
|
-
prefills the composer with the skill alone. Additive —
|
|
279
|
-
|
|
187
|
+
prefills the composer with the skill alone. Additive — Build
|
|
188
|
+
itself lives in Admin → Packages. */}
|
|
280
189
|
<SkillLauncher
|
|
281
190
|
variant="label"
|
|
282
191
|
size="sm"
|
|
@@ -301,12 +210,14 @@ export function PackagesPanel({ projectId }: Props) {
|
|
|
301
210
|
<Info className="w-3.5 h-3.5 shrink-0 mt-0.5 text-violet-300/80" />
|
|
302
211
|
<div className="space-y-1">
|
|
303
212
|
<div>
|
|
304
|
-
|
|
305
|
-
|
|
213
|
+
What this agent can use from the project's own packages and its sources'
|
|
214
|
+
package folders. Untrusted packages register their declarative content (skills,
|
|
215
|
+
tool schemas, commands) but cannot execute in-process code or call other packages.
|
|
306
216
|
</div>
|
|
307
217
|
<div className="text-violet-100/60">
|
|
308
|
-
|
|
309
|
-
|
|
218
|
+
Marking a package trusted, building one with code in{' '}
|
|
219
|
+
<span className="font-mono">src/</span> and gating one behind a feature happen in
|
|
220
|
+
Admin → Packages.
|
|
310
221
|
</div>
|
|
311
222
|
</div>
|
|
312
223
|
</div>
|
|
@@ -348,8 +259,8 @@ export function PackagesPanel({ projectId }: Props) {
|
|
|
348
259
|
|
|
349
260
|
{sortedRows.length === 0 ? (
|
|
350
261
|
<div className="mx-1 mt-6 rounded-lg border border-white/10 bg-white/[0.02] p-6 text-center text-white/50 text-sm">
|
|
351
|
-
No packages
|
|
352
|
-
<span className="font-mono text-white/70">_packages/</span> to see
|
|
262
|
+
No packages for this agent yet. Drop one into{' '}
|
|
263
|
+
<span className="font-mono text-white/70">_packages/</span> or a source's package folder to see it here.
|
|
353
264
|
</div>
|
|
354
265
|
) : (
|
|
355
266
|
<div className="space-y-1">
|
|
@@ -358,72 +269,12 @@ export function PackagesPanel({ projectId }: Props) {
|
|
|
358
269
|
key={row.slug}
|
|
359
270
|
row={row}
|
|
360
271
|
expanded={!!expanded[row.slug]}
|
|
361
|
-
pending={pending[row.slug] ?? 'none'}
|
|
362
|
-
canGovern={isOwnerEffective}
|
|
363
|
-
featureIds={featureIds}
|
|
364
272
|
onToggle={() => handleToggleExpand(row.slug)}
|
|
365
|
-
onFlipTrust={() => void handleFlipTrust(row)}
|
|
366
|
-
onBuild={() => void handleBuild(row)}
|
|
367
|
-
onSetAccessFeature={(featureId) => void handleSetAccessFeature(row, featureId)}
|
|
368
273
|
/>
|
|
369
274
|
))}
|
|
370
275
|
</div>
|
|
371
276
|
)}
|
|
372
277
|
|
|
373
|
-
{/* Toast + build-log modal are `position: fixed` and PORTALED to the body:
|
|
374
|
-
inside the widget they would anchor to (and clip against) `PanelChrome`
|
|
375
|
-
depending on the transparency setting — the app-surfaces rule. */}
|
|
376
|
-
{toast && mounted ? createPortal(
|
|
377
|
-
<div
|
|
378
|
-
className="fixed bottom-4 right-4 z-[100000] rounded-lg border border-white/15 bg-neutral-900/95 px-3 py-2 text-[11px] text-white/85 shadow-lg"
|
|
379
|
-
onClick={() => setToast(null)}
|
|
380
|
-
>
|
|
381
|
-
{toast}
|
|
382
|
-
</div>,
|
|
383
|
-
document.body,
|
|
384
|
-
) : null}
|
|
385
|
-
|
|
386
|
-
{logModal && mounted ? createPortal(
|
|
387
|
-
<div
|
|
388
|
-
className="fixed inset-0 z-[100000] flex items-center justify-center bg-black/60 backdrop-blur-sm"
|
|
389
|
-
onClick={() => setLogModal(null)}
|
|
390
|
-
>
|
|
391
|
-
<div
|
|
392
|
-
className="w-full max-w-xl rounded-lg border border-white/15 bg-neutral-900/95 p-4 shadow-xl"
|
|
393
|
-
onClick={(e) => e.stopPropagation()}
|
|
394
|
-
>
|
|
395
|
-
<div className="flex items-center justify-between mb-3">
|
|
396
|
-
<div className="flex items-center gap-2">
|
|
397
|
-
{logModal.ok === undefined ? (
|
|
398
|
-
<Loader2 className="w-4 h-4 animate-spin text-white/60" />
|
|
399
|
-
) : logModal.ok ? (
|
|
400
|
-
<CheckCircle2 className="w-4 h-4 text-emerald-400" />
|
|
401
|
-
) : (
|
|
402
|
-
<AlertTriangle className="w-4 h-4 text-amber-300" />
|
|
403
|
-
)}
|
|
404
|
-
<span className="text-sm font-semibold text-white/85">
|
|
405
|
-
Build — {logModal.slug}
|
|
406
|
-
</span>
|
|
407
|
-
{logModal.durationMs !== undefined ? (
|
|
408
|
-
<span className="text-[10px] text-white/45">
|
|
409
|
-
{logModal.durationMs}ms
|
|
410
|
-
</span>
|
|
411
|
-
) : null}
|
|
412
|
-
</div>
|
|
413
|
-
<button
|
|
414
|
-
className="text-white/50 hover:text-white/80 text-xs"
|
|
415
|
-
onClick={() => setLogModal(null)}
|
|
416
|
-
>
|
|
417
|
-
Close
|
|
418
|
-
</button>
|
|
419
|
-
</div>
|
|
420
|
-
<pre className="max-h-80 overflow-y-auto rounded-md bg-black/40 border border-white/10 p-2 text-[11px] font-mono text-white/75 whitespace-pre-wrap">
|
|
421
|
-
{logModal.logs.join('\n')}
|
|
422
|
-
</pre>
|
|
423
|
-
</div>
|
|
424
|
-
</div>,
|
|
425
|
-
document.body,
|
|
426
|
-
) : null}
|
|
427
278
|
</div>
|
|
428
279
|
);
|
|
429
280
|
}
|
|
@@ -431,21 +282,13 @@ export function PackagesPanel({ projectId }: Props) {
|
|
|
431
282
|
function PackageCard(props: {
|
|
432
283
|
row: ProjectPackageRow;
|
|
433
284
|
expanded: boolean;
|
|
434
|
-
pending: PendingAction;
|
|
435
|
-
canGovern: boolean;
|
|
436
|
-
featureIds: string[];
|
|
437
285
|
onToggle: () => void;
|
|
438
|
-
onFlipTrust: () => void;
|
|
439
|
-
onBuild: () => void;
|
|
440
|
-
onSetAccessFeature: (featureId: string | null) => void;
|
|
441
286
|
}) {
|
|
442
|
-
const { row, expanded,
|
|
287
|
+
const { row, expanded, onToggle } = props;
|
|
443
288
|
const trust = row.access?.trust ?? 'untrusted';
|
|
444
289
|
const runtimeType = row.runtime?.type ?? 'node';
|
|
445
290
|
const partialReason = row.partialReason;
|
|
446
291
|
const partialCopy = partialReason ? PARTIAL_REASON_COPY[partialReason] : undefined;
|
|
447
|
-
const canBuild = runtimeType === 'wasm' && row.status === 'partial' && partialReason === 'build-missing';
|
|
448
|
-
const trustLocked = trust === 'first-party';
|
|
449
292
|
|
|
450
293
|
return (
|
|
451
294
|
<div className="rounded-lg border border-white/10 bg-white/[0.02] hover:bg-white/[0.035] transition-colors">
|
|
@@ -509,74 +352,8 @@ function PackageCard(props: {
|
|
|
509
352
|
{`runtime: ${runtimeType}`}
|
|
510
353
|
</div>
|
|
511
354
|
|
|
512
|
-
{
|
|
513
|
-
|
|
514
|
-
<button
|
|
515
|
-
type="button"
|
|
516
|
-
className={[
|
|
517
|
-
'inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[11px] transition',
|
|
518
|
-
trustLocked
|
|
519
|
-
? 'bg-white/5 text-white/35 cursor-not-allowed'
|
|
520
|
-
: trust === 'trusted'
|
|
521
|
-
? 'bg-emerald-500/15 border border-emerald-500/25 text-emerald-100 hover:bg-emerald-500/20'
|
|
522
|
-
: 'bg-white/5 border border-white/10 text-white/70 hover:bg-white/10',
|
|
523
|
-
].join(' ')}
|
|
524
|
-
disabled={trustLocked || pending !== 'none'}
|
|
525
|
-
onClick={onFlipTrust}
|
|
526
|
-
title={trustLocked ? 'First-party packages are trust-locked' : undefined}
|
|
527
|
-
>
|
|
528
|
-
{pending === 'trust' ? (
|
|
529
|
-
<Loader2 className="w-3 h-3 animate-spin" />
|
|
530
|
-
) : trust === 'trusted' ? (
|
|
531
|
-
<ShieldCheck className="w-3 h-3" />
|
|
532
|
-
) : (
|
|
533
|
-
<ShieldOff className="w-3 h-3" />
|
|
534
|
-
)}
|
|
535
|
-
{trust === 'trusted' ? 'Revert to untrusted' : 'Mark as trusted'}
|
|
536
|
-
</button>
|
|
537
|
-
|
|
538
|
-
<button
|
|
539
|
-
type="button"
|
|
540
|
-
className={[
|
|
541
|
-
'inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[11px] transition',
|
|
542
|
-
canBuild
|
|
543
|
-
? 'bg-violet-500/15 border border-violet-500/25 text-violet-100 hover:bg-violet-500/20'
|
|
544
|
-
: 'bg-white/5 text-white/35 cursor-not-allowed',
|
|
545
|
-
].join(' ')}
|
|
546
|
-
disabled={!canBuild || pending !== 'none'}
|
|
547
|
-
onClick={onBuild}
|
|
548
|
-
title={
|
|
549
|
-
canBuild
|
|
550
|
-
? 'Compile src/ → dist/package.wasm on the server'
|
|
551
|
-
: runtimeType !== 'wasm'
|
|
552
|
-
? 'Build is only required for runtime.type: "wasm" packages'
|
|
553
|
-
: 'Build is only needed when status is partial / build-missing'
|
|
554
|
-
}
|
|
555
|
-
>
|
|
556
|
-
{pending === 'build' ? (
|
|
557
|
-
<Loader2 className="w-3 h-3 animate-spin" />
|
|
558
|
-
) : (
|
|
559
|
-
<Wrench className="w-3 h-3" />
|
|
560
|
-
)}
|
|
561
|
-
Build
|
|
562
|
-
</button>
|
|
563
|
-
|
|
564
|
-
<TrustHelp trust={trust} />
|
|
565
|
-
</div>
|
|
566
|
-
|
|
567
|
-
{/* R2b — base-access feature governance (owner/admin-effective). Attach
|
|
568
|
-
a required feature to gate the WHOLE package's visibility, or clear
|
|
569
|
-
it. Works for first-party AND WASM packages (both listed here). */}
|
|
570
|
-
{canGovern ? (
|
|
571
|
-
<AccessFeatureControl
|
|
572
|
-
row={row}
|
|
573
|
-
featureIds={featureIds}
|
|
574
|
-
pending={pending === 'access-feature'}
|
|
575
|
-
disabled={pending !== 'none'}
|
|
576
|
-
onSetAccessFeature={onSetAccessFeature}
|
|
577
|
-
/>
|
|
578
|
-
) : row.accessFeature ? (
|
|
579
|
-
<div className="mt-2 text-[10px] text-white/45">
|
|
355
|
+
{row.accessFeature ? (
|
|
356
|
+
<div className="text-[10px] text-white/45">
|
|
580
357
|
Access feature: <span className="font-mono text-white/65">{row.accessFeature}</span>
|
|
581
358
|
<span className="text-white/30"> ({row.accessFeatureSource})</span>
|
|
582
359
|
</div>
|
|
@@ -587,76 +364,6 @@ function PackageCard(props: {
|
|
|
587
364
|
);
|
|
588
365
|
}
|
|
589
366
|
|
|
590
|
-
function AccessFeatureControl(props: {
|
|
591
|
-
row: ProjectPackageRow;
|
|
592
|
-
featureIds: string[];
|
|
593
|
-
pending: boolean;
|
|
594
|
-
disabled: boolean;
|
|
595
|
-
onSetAccessFeature: (featureId: string | null) => void;
|
|
596
|
-
}) {
|
|
597
|
-
const { row, featureIds, pending, disabled, onSetAccessFeature } = props;
|
|
598
|
-
const [value, setValue] = useState(row.accessFeature ?? '');
|
|
599
|
-
const listId = `af-${row.slug}`;
|
|
600
|
-
// Resync when the row's effective feature changes (after a save/reload).
|
|
601
|
-
useEffect(() => { setValue(row.accessFeature ?? ''); }, [row.accessFeature]);
|
|
602
|
-
const isManifest = row.accessFeatureSource === 'manifest';
|
|
603
|
-
const trimmed = value.trim();
|
|
604
|
-
const current = row.accessFeatureSource === 'override' ? (row.accessFeature ?? '') : '';
|
|
605
|
-
const dirty = trimmed !== current;
|
|
606
|
-
|
|
607
|
-
return (
|
|
608
|
-
<div className="mt-2 rounded-md border border-white/10 bg-white/[0.02] px-2.5 py-2 space-y-1.5">
|
|
609
|
-
<div className="flex items-center gap-1.5 text-[10px] font-semibold text-white/60">
|
|
610
|
-
<Shield className="w-3 h-3 text-cyan-300/80" />
|
|
611
|
-
Base-access feature
|
|
612
|
-
{row.accessFeature ? (
|
|
613
|
-
<span className="ml-auto font-mono text-[9px] text-white/45">
|
|
614
|
-
{row.accessFeature} <span className="text-white/30">({row.accessFeatureSource})</span>
|
|
615
|
-
</span>
|
|
616
|
-
) : null}
|
|
617
|
-
</div>
|
|
618
|
-
<div className="text-[9px] text-white/40 leading-snug">
|
|
619
|
-
{isManifest
|
|
620
|
-
? 'Declared in the manifest (requires.accessFeature) — not editable here. An override below adds an ADDITIONAL required feature.'
|
|
621
|
-
: 'Pick a feature to hide this package from anyone who lacks it (restrict-only), then grant that feature to a role in Admin → Roles. Clear to remove.'}
|
|
622
|
-
</div>
|
|
623
|
-
<div className="flex items-center gap-1.5">
|
|
624
|
-
{/* datalist (not a native <select>) — avoids the option-popup opacity gotcha;
|
|
625
|
-
still type-to-filter + free-text fallback when the catalog is empty. */}
|
|
626
|
-
<input
|
|
627
|
-
list={listId}
|
|
628
|
-
value={value}
|
|
629
|
-
onChange={(e) => setValue(e.target.value)}
|
|
630
|
-
placeholder="feature.id (e.g. labs.access)"
|
|
631
|
-
disabled={disabled}
|
|
632
|
-
className="flex-1 min-w-0 rounded bg-black/30 border border-white/10 px-2 py-1 text-[10px] font-mono text-white/80 placeholder:text-white/25 focus:outline-none focus:border-cyan-400/40"
|
|
633
|
-
/>
|
|
634
|
-
<datalist id={listId}>
|
|
635
|
-
{featureIds.map((id) => <option key={id} value={id} />)}
|
|
636
|
-
</datalist>
|
|
637
|
-
<button
|
|
638
|
-
type="button"
|
|
639
|
-
disabled={disabled || !dirty || trimmed.length === 0}
|
|
640
|
-
onClick={() => onSetAccessFeature(trimmed)}
|
|
641
|
-
className="inline-flex items-center gap-1 rounded-md bg-cyan-500/15 border border-cyan-400/25 px-2 py-1 text-[10px] text-cyan-100 hover:bg-cyan-500/20 transition disabled:opacity-35"
|
|
642
|
-
>
|
|
643
|
-
{pending ? <Loader2 className="w-3 h-3 animate-spin" /> : null}
|
|
644
|
-
Set
|
|
645
|
-
</button>
|
|
646
|
-
<button
|
|
647
|
-
type="button"
|
|
648
|
-
disabled={disabled || row.accessFeatureSource !== 'override'}
|
|
649
|
-
onClick={() => onSetAccessFeature(null)}
|
|
650
|
-
title={row.accessFeatureSource === 'manifest' ? 'Manifest-declared features cannot be cleared here' : 'Clear the override'}
|
|
651
|
-
className="inline-flex items-center gap-1 rounded-md bg-white/5 border border-white/10 px-2 py-1 text-[10px] text-white/65 hover:bg-white/10 transition disabled:opacity-35"
|
|
652
|
-
>
|
|
653
|
-
Clear
|
|
654
|
-
</button>
|
|
655
|
-
</div>
|
|
656
|
-
</div>
|
|
657
|
-
);
|
|
658
|
-
}
|
|
659
|
-
|
|
660
367
|
function StatusPill(props: { status: ProjectPackageRow['status']; partialLabel?: string }) {
|
|
661
368
|
const { status, partialLabel } = props;
|
|
662
369
|
if (status === 'partial') {
|
|
@@ -689,10 +396,10 @@ function StatusPill(props: { status: ProjectPackageRow['status']; partialLabel?:
|
|
|
689
396
|
|
|
690
397
|
function TrustBadge(props: { trust: string }) {
|
|
691
398
|
const { trust } = props;
|
|
692
|
-
if (trust === '
|
|
399
|
+
if (trust === 'native') {
|
|
693
400
|
return (
|
|
694
401
|
<span className="inline-flex items-center gap-1 rounded-full border border-sky-500/25 bg-sky-500/10 px-2 py-0.5 text-[10px] text-sky-100/85">
|
|
695
|
-
<Shield className="w-2.5 h-2.5" />
|
|
402
|
+
<Shield className="w-2.5 h-2.5" /> Native
|
|
696
403
|
</span>
|
|
697
404
|
);
|
|
698
405
|
}
|
|
@@ -728,32 +435,3 @@ function Stat(props: { label: string; value: number }) {
|
|
|
728
435
|
</div>
|
|
729
436
|
);
|
|
730
437
|
}
|
|
731
|
-
|
|
732
|
-
function TrustHelp(props: { trust: string }) {
|
|
733
|
-
const [open, setOpen] = useState(false);
|
|
734
|
-
return (
|
|
735
|
-
<div className="relative">
|
|
736
|
-
<button
|
|
737
|
-
type="button"
|
|
738
|
-
className="inline-flex items-center rounded-md bg-white/5 p-1 text-white/40 hover:text-white/70 hover:bg-white/10"
|
|
739
|
-
onClick={() => setOpen((o) => !o)}
|
|
740
|
-
>
|
|
741
|
-
<HelpCircle className="w-3 h-3" />
|
|
742
|
-
</button>
|
|
743
|
-
{open ? (
|
|
744
|
-
<div className="absolute right-0 bottom-full mb-2 w-64 rounded-lg border border-white/15 bg-neutral-900/95 p-2.5 text-[11px] text-white/75 shadow-xl z-10">
|
|
745
|
-
<div className="font-semibold text-white/85 mb-1">
|
|
746
|
-
{props.trust === 'trusted' ? 'Trusted' : props.trust === 'first-party' ? 'First-party' : 'Untrusted'}
|
|
747
|
-
</div>
|
|
748
|
-
<div className="text-white/60">
|
|
749
|
-
{props.trust === 'first-party'
|
|
750
|
-
? 'Built-in package, full access — trust is locked.'
|
|
751
|
-
: props.trust === 'trusted'
|
|
752
|
-
? 'Full fs / network / cross-package API. Only flip this when you trust the author.'
|
|
753
|
-
: 'Data-only filesystem, no network, no cross-package API. Safe default for unknown packages.'}
|
|
754
|
-
</div>
|
|
755
|
-
</div>
|
|
756
|
-
) : null}
|
|
757
|
-
</div>
|
|
758
|
-
);
|
|
759
|
-
}
|