@neuralis/brain-core 0.3.1 → 0.4.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.
Files changed (371) hide show
  1. package/README.md +88 -1417
  2. package/app/README.md +4 -4
  3. package/app/cards/FilesystemCardShell.tsx +42 -4
  4. package/app/cards/FilesystemChangeCard.tsx +34 -11
  5. package/app/cards/README.md +6 -5
  6. package/app/cards/diffUtils.ts +99 -1
  7. package/app/filesystem/FilesystemHost.tsx +24 -2
  8. package/app/filesystem/README.md +1 -1
  9. package/app/filesystem/api/README.md +3 -3
  10. package/app/filesystem/api/index.ts +38 -14
  11. package/app/filesystem/api/projectPackages.ts +13 -102
  12. package/app/filesystem/domain/types.ts +30 -10
  13. package/app/filesystem/hooks/README.md +4 -4
  14. package/app/filesystem/hooks/useDiscoverableSources.ts +19 -30
  15. package/app/filesystem/hooks/useFilesystemSSE.ts +42 -2
  16. package/app/filesystem/host/README.md +6 -4
  17. package/app/filesystem/host/buildFilesystemHostValue.ts +28 -2
  18. package/app/filesystem/host/installFilesystemHostComponents.tsx +1 -1
  19. package/app/filesystem/lib/sourceKindForm.ts +210 -27
  20. package/app/filesystem/lib/treeVisualState.tsx +98 -4
  21. package/app/filesystem/store/README.md +1 -0
  22. package/app/filesystem/store/filesystemStore.ts +99 -8
  23. package/app/filesystem/store/gitSlice.ts +5 -0
  24. package/app/filesystem/store/helpers.ts +17 -0
  25. package/app/filesystem/store/listSlice.ts +8 -0
  26. package/app/filesystem/ui/CodeEditor.tsx +18 -3
  27. package/app/filesystem/ui/DiscoverDock.tsx +5 -1
  28. package/app/filesystem/ui/FileEditor.tsx +15 -10
  29. package/app/filesystem/ui/FileTree.tsx +75 -24
  30. package/app/filesystem/ui/FilesystemWidget.tsx +10 -2
  31. package/app/filesystem/ui/FolderPicker.tsx +251 -0
  32. package/app/filesystem/ui/GitControlPanel.tsx +7 -2
  33. package/app/filesystem/ui/PackagesPanel.tsx +52 -374
  34. package/app/filesystem/ui/PendingChangesPanel.tsx +1 -1
  35. package/app/filesystem/ui/PolicyEditor.tsx +109 -24
  36. package/app/filesystem/ui/README.md +30 -23
  37. package/app/filesystem/ui/RawMediaPreview.tsx +58 -0
  38. package/app/filesystem/ui/SourceBranchHeader.tsx +4 -4
  39. package/app/filesystem/ui/SourcesPanel.tsx +502 -342
  40. package/app/filesystem/ui/Toolbar.tsx +1 -2
  41. package/app/filesystem/ui/VectorHealthPanel.tsx +2 -2
  42. package/app/shared/filesystem.png +0 -0
  43. package/dist/app/host.js +58 -46
  44. package/dist/scripts/sourceRootPairV1.d.ts +47 -0
  45. package/dist/scripts/sourceRootPairV1.d.ts.map +1 -0
  46. package/dist/scripts/sourceRootPairV1.js +147 -0
  47. package/dist/scripts/sourceRootPairV1.js.map +1 -0
  48. package/dist/scripts/sourceToFolderV1.d.ts +56 -0
  49. package/dist/scripts/sourceToFolderV1.d.ts.map +1 -0
  50. package/dist/scripts/sourceToFolderV1.js +152 -0
  51. package/dist/scripts/sourceToFolderV1.js.map +1 -0
  52. package/dist/scripts/sourceToHostV1.d.ts +56 -0
  53. package/dist/scripts/sourceToHostV1.d.ts.map +1 -0
  54. package/dist/scripts/sourceToHostV1.js +132 -0
  55. package/dist/scripts/sourceToHostV1.js.map +1 -0
  56. package/dist/src/channels/filesystem.d.ts +1 -1
  57. package/dist/src/channels/filesystem.js +1 -1
  58. package/dist/src/connectors/AppSourceConfigStore.d.ts +17 -3
  59. package/dist/src/connectors/AppSourceConfigStore.d.ts.map +1 -1
  60. package/dist/src/connectors/AppSourceConfigStore.js +46 -6
  61. package/dist/src/connectors/AppSourceConfigStore.js.map +1 -1
  62. package/dist/src/connectors/HostConnector.d.ts +201 -0
  63. package/dist/src/connectors/HostConnector.d.ts.map +1 -0
  64. package/dist/src/connectors/HostConnector.js +903 -0
  65. package/dist/src/connectors/HostConnector.js.map +1 -0
  66. package/dist/src/connectors/inProcessTransport.d.ts +131 -0
  67. package/dist/src/connectors/inProcessTransport.d.ts.map +1 -0
  68. package/dist/src/connectors/inProcessTransport.js +447 -0
  69. package/dist/src/connectors/inProcessTransport.js.map +1 -0
  70. package/dist/src/domain/access/callerPermissions.d.ts +29 -0
  71. package/dist/src/domain/access/callerPermissions.d.ts.map +1 -1
  72. package/dist/src/domain/access/callerPermissions.js +85 -5
  73. package/dist/src/domain/access/callerPermissions.js.map +1 -1
  74. package/dist/src/domain/access/nativeLocalFence.d.ts +65 -0
  75. package/dist/src/domain/access/nativeLocalFence.d.ts.map +1 -0
  76. package/dist/src/domain/access/nativeLocalFence.js +171 -0
  77. package/dist/src/domain/access/nativeLocalFence.js.map +1 -0
  78. package/dist/src/domain/access/uriPermission.js +3 -3
  79. package/dist/src/domain/access/uriPermission.js.map +1 -1
  80. package/dist/src/domain/byteRange.d.ts +15 -0
  81. package/dist/src/domain/byteRange.d.ts.map +1 -0
  82. package/dist/src/domain/byteRange.js +30 -0
  83. package/dist/src/domain/byteRange.js.map +1 -0
  84. package/dist/src/domain/defaultPermissions.d.ts.map +1 -1
  85. package/dist/src/domain/defaultPermissions.js +29 -0
  86. package/dist/src/domain/defaultPermissions.js.map +1 -1
  87. package/dist/src/domain/mime.d.ts +11 -19
  88. package/dist/src/domain/mime.d.ts.map +1 -1
  89. package/dist/src/domain/mime.js +13 -102
  90. package/dist/src/domain/mime.js.map +1 -1
  91. package/dist/src/domain/paths.d.ts.map +1 -1
  92. package/dist/src/domain/paths.js +5 -3
  93. package/dist/src/domain/paths.js.map +1 -1
  94. package/dist/src/domain/scopeAccessCtx.d.ts +2 -2
  95. package/dist/src/domain/scopeAccessCtx.js +2 -2
  96. package/dist/src/domain/sourceConfig.d.ts +52 -19
  97. package/dist/src/domain/sourceConfig.d.ts.map +1 -1
  98. package/dist/src/domain/sourceConfig.js +103 -19
  99. package/dist/src/domain/sourceConfig.js.map +1 -1
  100. package/dist/src/domain/sourcePackages.d.ts +8 -8
  101. package/dist/src/domain/sourcePackages.d.ts.map +1 -1
  102. package/dist/src/domain/sourceRootPair.d.ts +88 -0
  103. package/dist/src/domain/sourceRootPair.d.ts.map +1 -0
  104. package/dist/src/domain/sourceRootPair.js +108 -0
  105. package/dist/src/domain/sourceRootPair.js.map +1 -0
  106. package/dist/src/domain/syncTypes.d.ts +8 -1
  107. package/dist/src/domain/syncTypes.d.ts.map +1 -1
  108. package/dist/src/domain/syncTypes.js +1 -0
  109. package/dist/src/domain/syncTypes.js.map +1 -1
  110. package/dist/src/domain/types.d.ts +32 -2
  111. package/dist/src/domain/types.d.ts.map +1 -1
  112. package/dist/src/domain/uri.d.ts.map +1 -1
  113. package/dist/src/domain/uri.js +3 -2
  114. package/dist/src/domain/uri.js.map +1 -1
  115. package/dist/src/embeddings/clients/GeminiEmbedder.d.ts.map +1 -1
  116. package/dist/src/embeddings/clients/GeminiEmbedder.js +2 -5
  117. package/dist/src/embeddings/clients/GeminiEmbedder.js.map +1 -1
  118. package/dist/src/embeddings/clients/OpenAIEmbedder.d.ts.map +1 -1
  119. package/dist/src/embeddings/clients/OpenAIEmbedder.js +2 -3
  120. package/dist/src/embeddings/clients/OpenAIEmbedder.js.map +1 -1
  121. package/dist/src/embeddings/clients/QwenEmbedder.d.ts +2 -0
  122. package/dist/src/embeddings/clients/QwenEmbedder.d.ts.map +1 -1
  123. package/dist/src/embeddings/clients/QwenEmbedder.js +10 -2
  124. package/dist/src/embeddings/clients/QwenEmbedder.js.map +1 -1
  125. package/dist/src/embeddings/clients/VoyageEmbedder.d.ts +2 -0
  126. package/dist/src/embeddings/clients/VoyageEmbedder.d.ts.map +1 -1
  127. package/dist/src/embeddings/clients/VoyageEmbedder.js +8 -1
  128. package/dist/src/embeddings/clients/VoyageEmbedder.js.map +1 -1
  129. package/dist/src/embeddings/factory.d.ts +5 -3
  130. package/dist/src/embeddings/factory.d.ts.map +1 -1
  131. package/dist/src/embeddings/factory.js +7 -3
  132. package/dist/src/embeddings/factory.js.map +1 -1
  133. package/dist/src/embeddings/models.d.ts +1 -1
  134. package/dist/src/embeddings/models.d.ts.map +1 -1
  135. package/dist/src/embeddings/retry.js +1 -1
  136. package/dist/src/embeddings/retry.js.map +1 -1
  137. package/dist/src/embeddings/types.d.ts +6 -0
  138. package/dist/src/embeddings/types.d.ts.map +1 -1
  139. package/dist/src/embeddings/types.js +11 -0
  140. package/dist/src/embeddings/types.js.map +1 -1
  141. package/dist/src/events/pending.d.ts +1 -1
  142. package/dist/src/events/pending.js +1 -1
  143. package/dist/src/git/GitRunner.d.ts +110 -30
  144. package/dist/src/git/GitRunner.d.ts.map +1 -1
  145. package/dist/src/git/GitRunner.js +511 -199
  146. package/dist/src/git/GitRunner.js.map +1 -1
  147. package/dist/src/git/GitWatchRegistry.d.ts +41 -35
  148. package/dist/src/git/GitWatchRegistry.d.ts.map +1 -1
  149. package/dist/src/git/GitWatchRegistry.js +61 -79
  150. package/dist/src/git/GitWatchRegistry.js.map +1 -1
  151. package/dist/src/git/gitPlace.d.ts +61 -0
  152. package/dist/src/git/gitPlace.d.ts.map +1 -0
  153. package/dist/src/git/gitPlace.js +74 -0
  154. package/dist/src/git/gitPlace.js.map +1 -0
  155. package/dist/src/git/sourceGitControl.d.ts +33 -21
  156. package/dist/src/git/sourceGitControl.d.ts.map +1 -1
  157. package/dist/src/git/sourceGitControl.js +211 -95
  158. package/dist/src/git/sourceGitControl.js.map +1 -1
  159. package/dist/src/git/sourceGitStatus.js +1 -1
  160. package/dist/src/git/sourceGitStatus.js.map +1 -1
  161. package/dist/src/git/untrackedStats.js +1 -1
  162. package/dist/src/git/untrackedStats.js.map +1 -1
  163. package/dist/src/index.d.ts +2 -1
  164. package/dist/src/index.d.ts.map +1 -1
  165. package/dist/src/index.js +2 -1
  166. package/dist/src/index.js.map +1 -1
  167. package/dist/src/lifecycle.d.ts +9 -12
  168. package/dist/src/lifecycle.d.ts.map +1 -1
  169. package/dist/src/lifecycle.js +2 -1
  170. package/dist/src/lifecycle.js.map +1 -1
  171. package/dist/src/routes/approve.d.ts +1 -1
  172. package/dist/src/routes/approve.js +1 -1
  173. package/dist/src/routes/events.d.ts +1 -1
  174. package/dist/src/routes/events.js +1 -1
  175. package/dist/src/routes/git.d.ts +7 -7
  176. package/dist/src/routes/git.d.ts.map +1 -1
  177. package/dist/src/routes/git.js +201 -72
  178. package/dist/src/routes/git.js.map +1 -1
  179. package/dist/src/routes/health.d.ts +6 -6
  180. package/dist/src/routes/health.js +12 -12
  181. package/dist/src/routes/helpers/sourceNotConfigured.d.ts +1 -1
  182. package/dist/src/routes/helpers/sourceNotConfigured.js +1 -1
  183. package/dist/src/routes/helpers/uriGuard.d.ts +1 -1
  184. package/dist/src/routes/helpers/uriGuard.d.ts.map +1 -1
  185. package/dist/src/routes/helpers/uriGuard.js +3 -2
  186. package/dist/src/routes/helpers/uriGuard.js.map +1 -1
  187. package/dist/src/routes/helpers.d.ts +11 -4
  188. package/dist/src/routes/helpers.d.ts.map +1 -1
  189. package/dist/src/routes/helpers.js +13 -6
  190. package/dist/src/routes/helpers.js.map +1 -1
  191. package/dist/src/routes/list.d.ts +1 -1
  192. package/dist/src/routes/list.d.ts.map +1 -1
  193. package/dist/src/routes/list.js +3 -4
  194. package/dist/src/routes/list.js.map +1 -1
  195. package/dist/src/routes/pending.d.ts +4 -4
  196. package/dist/src/routes/pending.js +9 -9
  197. package/dist/src/routes/policies.d.ts +10 -8
  198. package/dist/src/routes/policies.d.ts.map +1 -1
  199. package/dist/src/routes/policies.js +31 -25
  200. package/dist/src/routes/policies.js.map +1 -1
  201. package/dist/src/routes/raw.d.ts +1 -1
  202. package/dist/src/routes/raw.d.ts.map +1 -1
  203. package/dist/src/routes/raw.js +66 -12
  204. package/dist/src/routes/raw.js.map +1 -1
  205. package/dist/src/routes/read.d.ts +1 -1
  206. package/dist/src/routes/read.js +1 -1
  207. package/dist/src/routes/search.d.ts +1 -1
  208. package/dist/src/routes/search.js +1 -1
  209. package/dist/src/routes/sources.d.ts +63 -6
  210. package/dist/src/routes/sources.d.ts.map +1 -1
  211. package/dist/src/routes/sources.js +494 -382
  212. package/dist/src/routes/sources.js.map +1 -1
  213. package/dist/src/routes/upload.d.ts +1 -1
  214. package/dist/src/routes/upload.js +1 -1
  215. package/dist/src/routes/write.d.ts +2 -2
  216. package/dist/src/routes/write.js +2 -2
  217. package/dist/src/services/BridgeService.d.ts +21 -35
  218. package/dist/src/services/BridgeService.d.ts.map +1 -1
  219. package/dist/src/services/BridgeService.js +42 -88
  220. package/dist/src/services/BridgeService.js.map +1 -1
  221. package/dist/src/services/FilesystemService.d.ts +4 -3
  222. package/dist/src/services/FilesystemService.d.ts.map +1 -1
  223. package/dist/src/services/FilesystemService.js +112 -34
  224. package/dist/src/services/FilesystemService.js.map +1 -1
  225. package/dist/src/services/FilesystemUiService.d.ts +4 -1
  226. package/dist/src/services/FilesystemUiService.d.ts.map +1 -1
  227. package/dist/src/services/FilesystemUiService.js +66 -25
  228. package/dist/src/services/FilesystemUiService.js.map +1 -1
  229. package/dist/src/services/SyncScheduler.d.ts +12 -4
  230. package/dist/src/services/SyncScheduler.d.ts.map +1 -1
  231. package/dist/src/services/SyncScheduler.js +37 -8
  232. package/dist/src/services/SyncScheduler.js.map +1 -1
  233. package/dist/src/services/baselineRepair.d.ts +13 -3
  234. package/dist/src/services/baselineRepair.d.ts.map +1 -1
  235. package/dist/src/services/baselineRepair.js +13 -3
  236. package/dist/src/services/baselineRepair.js.map +1 -1
  237. package/dist/src/services/declaredSources.d.ts +132 -43
  238. package/dist/src/services/declaredSources.d.ts.map +1 -1
  239. package/dist/src/services/declaredSources.js +118 -45
  240. package/dist/src/services/declaredSources.js.map +1 -1
  241. package/dist/src/store/dataFormats.d.ts +17 -2
  242. package/dist/src/store/dataFormats.d.ts.map +1 -1
  243. package/dist/src/store/dataFormats.js +18 -3
  244. package/dist/src/store/dataFormats.js.map +1 -1
  245. package/dist/src/sync/DeltaSyncRunner.d.ts.map +1 -1
  246. package/dist/src/sync/DeltaSyncRunner.js +144 -4
  247. package/dist/src/sync/DeltaSyncRunner.js.map +1 -1
  248. package/dist/src/sync/SyncJobQueue.d.ts +7 -2
  249. package/dist/src/sync/SyncJobQueue.d.ts.map +1 -1
  250. package/dist/src/sync/SyncJobQueue.js +16 -10
  251. package/dist/src/sync/SyncJobQueue.js.map +1 -1
  252. package/dist/src/sync/SyncWatchService.d.ts +21 -4
  253. package/dist/src/sync/SyncWatchService.d.ts.map +1 -1
  254. package/dist/src/sync/SyncWatchService.js +115 -10
  255. package/dist/src/sync/SyncWatchService.js.map +1 -1
  256. package/dist/src/sync/categoryInference.d.ts +1 -1
  257. package/dist/src/sync/categoryInference.js +1 -1
  258. package/dist/src/tools/execCtx.d.ts +2 -2
  259. package/dist/src/tools/execCtx.js +2 -2
  260. package/dist/src/tools/fs_read.d.ts.map +1 -1
  261. package/dist/src/tools/fs_read.js +5 -0
  262. package/dist/src/tools/fs_read.js.map +1 -1
  263. package/dist/src/usecases/admitSourceRoot.d.ts +65 -0
  264. package/dist/src/usecases/admitSourceRoot.d.ts.map +1 -0
  265. package/dist/src/usecases/admitSourceRoot.js +85 -0
  266. package/dist/src/usecases/admitSourceRoot.js.map +1 -0
  267. package/dist/src/usecases/browseSourceFolders.d.ts +85 -0
  268. package/dist/src/usecases/browseSourceFolders.d.ts.map +1 -0
  269. package/dist/src/usecases/browseSourceFolders.js +210 -0
  270. package/dist/src/usecases/browseSourceFolders.js.map +1 -0
  271. package/dist/src/usecases/createDeclaredSources.d.ts +13 -2
  272. package/dist/src/usecases/createDeclaredSources.d.ts.map +1 -1
  273. package/dist/src/usecases/createDeclaredSources.js +39 -0
  274. package/dist/src/usecases/createDeclaredSources.js.map +1 -1
  275. package/dist/src/usecases/embeddingBacklog.js +1 -1
  276. package/dist/src/usecases/embeddingBacklog.js.map +1 -1
  277. package/dist/src/usecases/list.d.ts.map +1 -1
  278. package/dist/src/usecases/list.js +83 -26
  279. package/dist/src/usecases/list.js.map +1 -1
  280. package/dist/src/usecases/listAttachableDevices.d.ts +13 -0
  281. package/dist/src/usecases/listAttachableDevices.d.ts.map +1 -0
  282. package/dist/src/usecases/listAttachableDevices.js +10 -0
  283. package/dist/src/usecases/listAttachableDevices.js.map +1 -0
  284. package/dist/src/usecases/listSourcePackages.d.ts.map +1 -1
  285. package/dist/src/usecases/listSourcePackages.js +2 -5
  286. package/dist/src/usecases/listSourcePackages.js.map +1 -1
  287. package/dist/src/usecases/purgeExcludedPoints.d.ts.map +1 -1
  288. package/dist/src/usecases/purgeExcludedPoints.js +3 -2
  289. package/dist/src/usecases/purgeExcludedPoints.js.map +1 -1
  290. package/dist/src/usecases/readFiles.d.ts.map +1 -1
  291. package/dist/src/usecases/readFiles.js +99 -1
  292. package/dist/src/usecases/readFiles.js.map +1 -1
  293. package/dist/src/usecases/reconcileSourcePackageRoots.d.ts +1 -1
  294. package/dist/src/usecases/reconcileSourcePackageRoots.d.ts.map +1 -1
  295. package/dist/src/usecases/reconcileSourcePackageRoots.js +2 -1
  296. package/dist/src/usecases/reconcileSourcePackageRoots.js.map +1 -1
  297. package/dist/src/usecases/revokePrincipal.d.ts +7 -5
  298. package/dist/src/usecases/revokePrincipal.d.ts.map +1 -1
  299. package/dist/src/usecases/revokePrincipal.js +29 -7
  300. package/dist/src/usecases/revokePrincipal.js.map +1 -1
  301. package/dist/src/usecases/scheduleSourceSync.d.ts +7 -0
  302. package/dist/src/usecases/scheduleSourceSync.d.ts.map +1 -1
  303. package/dist/src/usecases/scheduleSourceSync.js +6 -5
  304. package/dist/src/usecases/scheduleSourceSync.js.map +1 -1
  305. package/dist/src/usecases/syncPointWrites.d.ts +2 -0
  306. package/dist/src/usecases/syncPointWrites.d.ts.map +1 -1
  307. package/dist/src/usecases/syncPointWrites.js +5 -1
  308. package/dist/src/usecases/syncPointWrites.js.map +1 -1
  309. package/dist/src/usecases/triggerSourceSync.d.ts +46 -0
  310. package/dist/src/usecases/triggerSourceSync.d.ts.map +1 -0
  311. package/dist/src/usecases/triggerSourceSync.js +75 -0
  312. package/dist/src/usecases/triggerSourceSync.js.map +1 -0
  313. package/dist/src/usecases/uploadBinary.d.ts +2 -1
  314. package/dist/src/usecases/uploadBinary.d.ts.map +1 -1
  315. package/dist/src/usecases/uploadBinary.js +2 -2
  316. package/dist/src/usecases/uploadBinary.js.map +1 -1
  317. package/dist/src/usecases/vector/endpointGuard.d.ts +1 -1
  318. package/dist/src/usecases/vector/endpointGuard.js +1 -1
  319. package/dist/src/usecases/vectorMaintenance.js +1 -1
  320. package/dist/src/usecases/vectorMaintenance.js.map +1 -1
  321. package/dist/src/usecases/write/content.js +1 -1
  322. package/dist/src/vector/qdrantClient.d.ts +1 -1
  323. package/dist/src/vector/qdrantClient.js +1 -1
  324. package/dist/src/wiring.d.ts +3 -0
  325. package/dist/src/wiring.d.ts.map +1 -1
  326. package/dist/src/wiring.js +72 -6
  327. package/dist/src/wiring.js.map +1 -1
  328. package/dist/tools/fs_list.json +1 -1
  329. package/dist/tools/fs_read.json +1 -1
  330. package/dist/tools/fs_search.json +1 -1
  331. package/dist/tools/fs_write.json +1 -1
  332. package/instructions/brain-model.md +1 -1
  333. package/package.json +212 -114
  334. package/rules/brain-rules.md +2 -2
  335. package/skills/brain-start/SKILL.md +1 -1
  336. package/skills/connect-business-data/SKILL.md +3 -3
  337. package/skills/create-package/SKILL.md +26 -26
  338. package/skills/create-package/references/config-and-credentials.md +16 -13
  339. package/skills/create-package/references/connectors-and-uri-policies.md +39 -25
  340. package/skills/create-package/references/manifest-and-discovery.md +12 -12
  341. package/skills/create-package/references/runtime-and-build.md +19 -19
  342. package/skills/create-package/references/skills-and-context.md +36 -20
  343. package/skills/create-package/references/surfaces-and-design.md +16 -16
  344. package/skills/create-package/references/team-and-workflows.md +2 -2
  345. package/skills/create-package/references/test-and-ship.md +21 -21
  346. package/skills/create-package/references/tools-and-schemas.md +5 -5
  347. package/skills/create-package/scripts/{check-package.sh → check-package.mjs} +79 -65
  348. package/skills/create-package/scripts/{verify-loaded.sh → verify-loaded.mjs} +156 -162
  349. package/skills/git/SKILL.md +53 -51
  350. package/skills/manage-files/SKILL.md +22 -25
  351. package/skills/manage-sources/SKILL.md +128 -87
  352. package/skills/manage-uri-policy/SKILL.md +18 -15
  353. package/skills/organize/SKILL.md +1 -1
  354. package/skills/sync/SKILL.md +3 -3
  355. package/tools/fs_list.json +1 -1
  356. package/tools/fs_read.json +1 -1
  357. package/tools/fs_search.json +1 -1
  358. package/tools/fs_write.json +1 -1
  359. package/workflows/sources-digest.json +1 -1
  360. package/dist/src/connectors/LocalDiskConnector.d.ts +0 -171
  361. package/dist/src/connectors/LocalDiskConnector.d.ts.map +0 -1
  362. package/dist/src/connectors/LocalDiskConnector.js +0 -1233
  363. package/dist/src/connectors/LocalDiskConnector.js.map +0 -1
  364. package/docs/drive-overview.md +0 -59
  365. package/skills/manage-files/scripts/copy.sh +0 -7
  366. package/skills/manage-files/scripts/create.sh +0 -7
  367. package/skills/manage-files/scripts/mkdir.sh +0 -7
  368. package/skills/manage-files/scripts/modify.sh +0 -7
  369. package/skills/manage-files/scripts/upload.sh +0 -16
  370. package/skills/manage-files/scripts/write.sh +0 -29
  371. package/skills/manage-sources/scripts/reembed.sh +0 -23
@@ -3,19 +3,22 @@
3
3
  /**
4
4
  * Filesystem panel → Packages tab.
5
5
  *
6
- * Per-project list of installed packages (_packages/). Users flip trust and
7
- * trigger WASM build from here. Trust storage lives in the platform zone
8
- * (`ProjectRecord.packageTrust`) — the UI calls a host route that writes it.
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
- HelpCircle,
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. Click Build to compile it.',
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 first-party trust, so no subprocess was started. Declare `runtime.type: "wasm"` in the manifest to enable handlers.',
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
- // R2b — owner/admin-effective (priority ≤ 2) gates the access-feature override
80
- // control. Server (`canManagePackages`) is the enforcement floor.
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 isOwnerEffective = (host.currentRole?.priority ?? 99) <= 2;
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 — the per-row
279
- Build button stays. */}
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
- Untrusted packages register their declarative content (skills, tool schemas,
305
- commands) but cannot execute in-process code or call other packages.
213
+ What this agent can use from the project&apos;s own packages and its sources&apos;
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
- Flip trust when you know the author. Run Build only for packages with server-side
309
- code in <span className="font-mono">src/</span>.
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 installed yet. Drop packages into{' '}
352
- <span className="font-mono text-white/70">_packages/</span> to see them here.
262
+ No packages for this agent yet. Drop one into{' '}
263
+ <span className="font-mono text-white/70">_packages/</span> or a source&apos;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, pending, canGovern, featureIds, onToggle, onFlipTrust, onBuild, onSetAccessFeature } = props;
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
- {/* Actions */}
513
- <div className="flex items-center gap-2 pt-1">
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 === 'first-party') {
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" /> First-party
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
- }
@@ -216,7 +216,7 @@ const NO_FILTERS: ChangeFilters = { kind: 'all', source: '', repo: '', branch: '
216
216
  export function PendingChangesPanel({ agentId, projectId }: Props) {
217
217
  const client = useFilesystemStore((s) => s.client);
218
218
  const host = useFilesystemHost();
219
- const canWrite = hasFeature({ grantedFeatures: [...(host.grantedFeatures ?? [])] }, 'drive.write');
219
+ const canWrite = hasFeature({ grantedFeatures: [...(host.grantedFeatures ?? [])] }, 'files.write');
220
220
  const storeApi = useFilesystemStoreApi();
221
221
  const sources = useFilesystemStore(s => s.sources);
222
222
  const liveRevisions = useFilesystemStore(s => s.sourceChangeRevision);