@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
@@ -21,7 +21,7 @@ All three must be true. Two is not done.
21
21
  3. **The structure is what you intended** —
22
22
  `fs_list({ uri: "packages://<slug>", recursive: true })`.
23
23
 
24
- Pre-flight, before you ship: `bash ${SKILL_DIR}/scripts/check-package.sh <package-root>`. It picks
24
+ Pre-flight, before you ship: `node "${SKILL_DIR}/scripts/check-package.mjs" <package-root>`. It picks
25
25
  its mode from disk and prints which one it ran: a `package.json` carrying a `neuralis` block (or a
26
26
  `neuralis.package.json`) is **manifest mode**; no manifest at all is **markdown mode** — the
27
27
  source-package / bare-skill layout, which **is** checkable.
@@ -37,7 +37,7 @@ SKIPPED — manifest, tools, workflows, app surfaces, runtime, dist — so nothi
37
37
  when it was not. Exit `0` no errors · `1` errors · `2` usage. Passing proves nothing about loading
38
38
  or discovery, in either mode.
39
39
 
40
- After the restart, rescan or sync: `bash ${SKILL_DIR}/scripts/verify-loaded.sh <package-id>` — the
40
+ After the restart, rescan or sync: `node "${SKILL_DIR}/scripts/verify-loaded.mjs" <package-id>` — the
41
41
  manifest id for (a), the instance URI for (b) and (c) (§2).
42
42
 
43
43
  ---
@@ -59,7 +59,7 @@ Three `partial` reasons exist, and only three:
59
59
  valid emitted route manifest. Routes fail closed rather than being served ungated. Rebuild.
60
60
  - **`runtime-unavailable`** — the code runtime failed to start (a sandbox load failure, or an MCP
61
61
  subprocess that would not spawn).
62
- - **`untrusted-node`** — a non-first-party package left `runtime.type` at its `node` default while
62
+ - **`untrusted-node`** — a non-native package left `runtime.type` at its `node` default while
63
63
  shipping code. Declare `"runtime": { "type": "wasm" }` and rebuild. The most misread state in the
64
64
  system: markdown contributions still appear, so it looks like it half worked.
65
65
 
@@ -71,7 +71,7 @@ has no status, no `reason` of that kind and no load line — done-gate step 1 fo
71
71
  the packages overview", not "it loaded". It is listed there under `sourcePackages[]`, keyed by its
72
72
  instance id: the package ROOT's URI, no trailing slash, plus `?project=<p>&scope=<scope>`. A
73
73
  package rooted at `data://acme-pack` is `data://acme-pack?project=<p>&scope=project`; one at the
74
- source root itself is `data://?project=<p>&scope=project`. Pass that id to `verify-loaded.sh` and it prints the root, the
74
+ source root itself is `data://?project=<p>&scope=project`. Pass that id to `verify-loaded.mjs` and it prints the root, the
75
75
  grouping reason and the per-category file counts in place of a status.
76
76
 
77
77
  Where to read it without server-log access:
@@ -88,7 +88,7 @@ is read — caller-supplied identity is not an auth mechanism anywhere on this p
88
88
 
89
89
  Entries carry `{ packageId, status, reason?, error?, trust, registered }`. The route is gated on
90
90
  the `core.observe` feature: **a `403` here means you lack the diagnostics capability, not that the
91
- package is missing.** Treat those as two different outcomes — `verify-loaded.sh` wraps this exact
91
+ package is missing.** Treat those as two different outcomes — `verify-loaded.mjs` wraps this exact
92
92
  call and makes that split for you.
93
93
 
94
94
  ---
@@ -129,9 +129,9 @@ nothing:
129
129
  one everybody skips.
130
130
  5. **It activates**, and `${SKILL_DIR}` resolves to a real path. The placeholder falls back to a
131
131
  sentinel string only when the skill has no host-side directory at all — a source-contributed
132
- skill whose connector exposes no container path. An installed package and a project-folder drop
132
+ skill whose connector exposes no local path. An installed package and a project-folder drop
133
133
  both resolve real directories.
134
- 6. **A bundled script runs**: `bash ${SKILL_DIR}/scripts/<name>.sh`.
134
+ 6. **A bundled script runs**: `node "${SKILL_DIR}/scripts/<name>.mjs"`.
135
135
 
136
136
  ---
137
137
 
@@ -165,7 +165,7 @@ it loads, the snapshot lists it, and the panel is blank or unstyled. Work the ma
165
165
 
166
166
  | Check | How | What it catches |
167
167
  |---|---|---|
168
- | The pre-flight is clean | `bash ${SKILL_DIR}/scripts/check-package.sh <root>` | the canonical entry root, a removed renderer, a conflicting card profile, and the **self-containment** rule — which nothing else can check (see below) |
168
+ | The pre-flight is clean | `node "${SKILL_DIR}/scripts/check-package.mjs" <root>` | the canonical entry root, a removed renderer, a conflicting card profile, and the **self-containment** rule — which nothing else can check (see below) |
169
169
  | The surface is in the snapshot | fetch the runtime snapshot with the `x-project-id` header | `meta.hosts` missing `neuralis-workspace`; a dropped untrusted absolute url |
170
170
  | The widget is **reachable** | the dock rail shows the companion item and it opens the panel | a widget with no `kind: "dock"` sibling — validates, loads, opens for nobody |
171
171
  | The card **appears** on a real tool call | run the tool in chat | the `ui.cardType` ↔ card `type` ↔ (for `direct`) registered-type triple; a mismatch silently renders the generic default card |
@@ -177,7 +177,7 @@ it loads, the snapshot lists it, and the panel is blank or unstyled. Work the ma
177
177
 
178
178
  **Least trust, deliberately.** Test the surface at the tier it will actually ship on. A dropped
179
179
  package is pinned untrusted: `direct` is unavailable to it, an absolute iframe url is dropped
180
- fail-closed, and the privileged bridge is a hard validation error. Proving a surface as first-party
180
+ fail-closed, and the privileged bridge is a hard validation error. Proving a surface as native
181
181
  and shipping it untrusted is the same class of mistake as testing gates as the owner.
182
182
 
183
183
  **Self-containment can only be proven here.** The load-time validator receives the manifest
@@ -207,7 +207,7 @@ session denies.
207
207
  |---|---|
208
208
  | `createMockSession(overrides?)` | role `owner`, `grantedFeatures: ['*']` |
209
209
  | `createDeniedSession(overrides?)` | same identity, `grantedFeatures: []` |
210
- | `createTrustedSession(overrides?)` | role `member`, features `['drive.read','drive.write','workflow.read']` |
210
+ | `createTrustedSession(overrides?)` | role `member`, features `['files.read','files.write','workflow.read']` |
211
211
  | `createViewerSession(overrides?)` | role `viewer`, `agentAccess: 'view'`, **zero** features |
212
212
 
213
213
  **The route helpers BUILD a request. They do not invoke anything.** You call the handler yourself.
@@ -243,7 +243,7 @@ it('denies a caller who does not — via the dispatcher, where the gate lives',
243
243
  Other helpers, with the details that bite:
244
244
 
245
245
  - `createMockInitContext({ packageSlug, dataDir?, globalDir?, projectsRoot?, logger?, hostId?, apis? })` — the
246
- context is first-party by default (a `globalDir` is present); pass `globalDir: null` to build a
246
+ context is native by default (a `globalDir` is present); pass `globalDir: null` to build a
247
247
  project-installed package's context, which has none. The
248
248
  key is **`packageSlug`**. A `slug` key is silently ignored and you get `'test-package'`.
249
249
  - `createMockToolCallContext(...)` / `createDeniedToolCallContext(...)` take a **shaped override
@@ -293,7 +293,7 @@ you publish.
293
293
 
294
294
  ## 10. Ship it
295
295
 
296
- **(a) Installed node package — first-party, in-process.** Build so the compiled output exists (or
296
+ **(a) Installed node package — native, in-process.** Build so the compiled output exists (or
297
297
  leave a directory to the image build, which builds it), then have an admin register it as a
298
298
  dependency of the host — register, rebuild the image (`neuralis rebuild` installs it), verify.
299
299
  That sequence is the **deploying admin's terminal work, not yours**; registering a directory or a
@@ -306,7 +306,7 @@ and never joins the in-process class. (Where the operator has the `neuralweb` CL
306
306
  `neuralweb install <identity> --channel builtin` prints these commands with a trust notice
307
307
  and never executes anything.) **Registering the dependency IS the trust act**: every dependency
308
308
  whose own `package.json` carries a `neuralis` block is discovered at boot and loaded in-process
309
- with host-assigned first-party trust — the same trust as the platform's own packages. Do it only
309
+ with host-assigned native trust — the same trust as the platform's own packages. Do it only
310
310
  for packages the deploying admin has vetted, exactly as any npm dependency. A dependency with no
311
311
  `neuralis` block is skipped silently and never exists.
312
312
 
@@ -319,7 +319,7 @@ plus an undeclared runtime type is the `untrusted-node` partial from §2.
319
319
  open when the other two are closed to you. It carries the five markdown categories and nothing else.
320
320
 
321
321
  **What discovery recognises.** No marker file, no manifest and no dot-directory is required — the
322
- folder layout alone decides. The platform records *why* it grouped a package, and `verify-loaded.sh`
322
+ folder layout alone decides. The platform records *why* it grouped a package, and `verify-loaded.mjs`
323
323
  prints that `reason` back to you:
324
324
 
325
325
  | `reason` | What made it a package |
@@ -337,10 +337,10 @@ nothing.
337
337
 
338
338
  **Where to write it.** A source slug *is* a URI scheme, so the address is `<slug>://<path>`. To learn
339
339
  which slugs exist, read the `sources` list already in your `<runtime_stack>` block — one row per
340
- source, carrying the URI root, the connector, the container path and **your own** resolved
340
+ source, carrying the URI root, the connector, the local path and **your own** resolved
341
341
  `policy=read/write/exec`. That block is the only place those coordinates appear. `fs_list` with no
342
342
  `uri` also prints a registry line per root, but it carries counts and sync status only — no
343
- connector, no container path, no policy — so it answers "is this indexed", never "may I write here,
343
+ connector, no local path, no policy — so it answers "is this indexed", never "may I write here,
344
344
  and where does that land on disk". Every project seeds a writable `data://`.
345
345
 
346
346
  Worked example — a one-skill package needing no other file:
@@ -354,7 +354,7 @@ data://acme-pack/skills/release-notes/SKILL.md → root data://acme-pack (ca
354
354
  lands as a *pending change*, and a pending file's frontmatter is never captured: at best the skill
355
355
  reaches the model under its directory name with no description line — the description being its
356
356
  entire discovery surface — and under the tool's default category it is not indexed as a contribution
357
- at all. Writing the file into the source's container path (the `container=` value on that source's
357
+ at all. Writing the file into the source's local path (the `container=` value on that source's
358
358
  `<runtime_stack>` row) has neither problem.
359
359
 
360
360
  **Then get it indexed.** Discovery reads the sync index, never the live tree: unsynced means
@@ -370,14 +370,14 @@ invisible, with **no error anywhere** — indistinguishable from correctly hidde
370
370
 
371
371
  It answers `202` with a job snapshot; the run is asynchronous, so poll
372
372
  `neuralis request GET @neuralis/brain-core/sources/sync-status -f source=data`.
373
- - **Without `drive.sync` that call returns `403 {"error":"Sync requires drive.sync."}`.** Do not retry
373
+ - **Without `sources.sync` that call returns `403 {"error":"Sync requires sources.sync."}`.** Do not retry
374
374
  it and do not route around it — say which thing is off, in these words: *"I wrote the package files
375
- to `<uri>`. Indexing them needs a sync, which requires the `drive.sync` feature my role does not
376
- hold. Either open the Files widget → Sources → `<slug>` → **Sync**, or grant my role `drive.sync`.
375
+ to `<uri>`. Indexing them needs a sync, which requires the `sources.sync` feature my role does not
376
+ hold. Either open the Files widget → Sources → `<slug>` → **Sync**, or grant my role `sources.sync`.
377
377
  Until then the files are on disk but the package will not appear."*
378
378
 
379
379
  **Then prove it with the script** — it is the authoritative check:
380
- `bash ${SKILL_DIR}/scripts/verify-loaded.sh 'data://acme-pack?project=<p>&scope=project'`. It reads the overview surface,
380
+ `node "${SKILL_DIR}/scripts/verify-loaded.mjs" 'data://acme-pack?project=<p>&scope=project'`. It reads the overview surface,
381
381
  which lists every discovered source package and reports each category as `N (M active)`. Once the
382
382
  sync has landed the package shows on the next stream — discovery is resolved fresh each time.
383
383
 
@@ -26,7 +26,7 @@ So a `catalog_manage` with `action: ["list","update","delete"]` has one posture
26
26
 
27
27
  One `.json` per tool in the package-root `tools/` folder. **The tool name is the filename minus `.json`** — there is no `name` field (MCP-first), so renaming the file renames the tool and silently breaks every skill or prompt that named the old one. House style `<family>_<action>` in snake_case, not enforced. The file **is** the input schema: everything except `x-neuralis` is taken verbatim as `inputSchema`.
28
28
 
29
- **That name is GLOBAL to the deployment, and there is no per-package prefix.** If another installed package already declares it, exactly one entry owns it — the first-party one, otherwise the lexically-smaller `packageId` — and yours is **shadowed**: still loaded, its other tools untouched, but that name answers from the owner unless the owner is unavailable to the caller or an agent picks your package in Tool Access. Nothing is renamed for you. Pick a name nobody else will pick; `manifest-and-discovery.md` § *A tool name is global* has the rule and where the diagnostic shows up.
29
+ **That name is GLOBAL to the deployment, and there is no per-package prefix.** If another installed package already declares it, exactly one entry owns it — the native one, otherwise the lexically-smaller `packageId` — and yours is **shadowed**: still loaded, its other tools untouched, but that name answers from the owner unless the owner is unavailable to the caller or an agent picks your package in Tool Access. Nothing is renamed for you. Pick a name nobody else will pick; `manifest-and-discovery.md` § *A tool name is global* has the rule and where the diagnostic shows up.
30
30
 
31
31
  ```json
32
32
  {
@@ -87,7 +87,7 @@ The load check accepts the bare-`http` form with or without the trailing `#`, an
87
87
 
88
88
  ### Session identity is never a tool input
89
89
 
90
- Seventeen names are banned as **root-level** properties: `userId`, `projectId`, `agentId`, `conversationId`, `requestId`, `toolUseId`, `delegateRunId`, `delegateMode`, `role`, `priority`, `grantedFeatures`, `spendLimits`, `llmRateLimitRpm`, `agentAccess`, `agentOwnership`, `session`, and the retired `dailyLimits`. Declaring one fails the load with `inputSchema.properties.userId is reserved session context and must not be tool input`. The fix is not to rename it — read `session.userId` in the handler. Identity always comes from the verified session, never from what the model typed.
90
+ Nineteen names are banned as **root-level** properties: `userId`, `projectId`, `agentId`, `conversationId`, `requestId`, `toolUseId`, `delegateRunId`, `delegateMode`, `role`, `priority`, `rolePriorities`, `grantedFeatures`, `spendLimits`, `llmRateLimitRpm`, `agentAccess`, `agentOwnership`, `displayName`, `session`, and the retired `dailyLimits`. Declaring one fails the load with `inputSchema.properties.userId is reserved session context and must not be tool input`. The fix is not to rename it — read `session.userId` in the handler. Identity always comes from the verified session, never from what the model typed.
91
91
 
92
92
  The ban is **root-only by design**: `todos[].priority`, `members[].userId`, a message `role` are legitimate nested domain fields and none of them error. Only the top-level arguments object could be mistaken for caller identity.
93
93
 
@@ -217,7 +217,7 @@ For a sandboxed (WASM) package you write no dispatch switch — the build import
217
217
 
218
218
  **Presentation.** `ui.presentation` is `inline | card | explored`. Card type resolves first-match-wins: an MCP-app marker on the result, then `ui.cardType`, then `operation`, then `structuredContent.kind`/`.type` (the literal `tool.output` ignored), then the tool name, else `default`. **`ui.cardType` must match a declared card surface's `type`** — see `references/surfaces-and-design.md`.
219
219
 
220
- **Settled-header convention.** The chat card header draws ONE status icon, and its accessible name (`title` + `aria-label`) is the status word; there is no visible status pill. The settled status derives from `structuredContent`: `ok: true` (or a string `status` of `success`/`completed`/`pending_review`) → the green check; `ok: false` → the red X; any other string `status` becomes the icon's name, and its TONE is derived from the word by substring — a word containing `error` or `fail` draws the red X, `partial` the amber triangle, and a word containing `pending` draws the IN-FLIGHT SPINNER. Declaring `ok` on success payloads is the first-party convention. A completed tool with NO marker at all still settles (the platform floors runtime-`completed` to committed — a foreign tool cannot be forced into the convention), but two sharp edges: never reuse `status` for a domain value (an HTTP status number belongs under `httpStatus`), and never emit a settled status word containing `pending` — `pending_review` is the one floored carve-out. A card that claims to be running forever is a lie the user cannot dismiss, and the platform cannot tell it apart from a call that really is still open. The platform's own status spinner no longer splits the timeline into compositor layers, but anything YOUR card body animates still can — the prohibition, and the primitives that replace an `animate-*` utility, are in `references/surfaces-and-design.md` §Design floor.
220
+ **Settled-header convention.** The chat card header draws ONE status icon, and its accessible name (`title` + `aria-label`) is the status word; there is no visible status pill. The settled status derives from `structuredContent`: `ok: true` (or a string `status` of `success`/`completed`/`pending_review`) → the green check; `ok: false` → the red X; any other string `status` becomes the icon's name, and its TONE is derived from the word by substring — a word containing `error` or `fail` draws the red X, `partial` the amber triangle, and a word containing `pending` draws the IN-FLIGHT SPINNER. Declaring `ok` on success payloads is the native convention. A completed tool with NO marker at all still settles (the platform floors runtime-`completed` to committed — a foreign tool cannot be forced into the convention), but two sharp edges: never reuse `status` for a domain value (an HTTP status number belongs under `httpStatus`), and never emit a settled status word containing `pending` — `pending_review` is the one floored carve-out. A card that claims to be running forever is a lie the user cannot dismiss, and the platform cannot tell it apart from a call that really is still open. The platform's own status spinner no longer splits the timeline into compositor layers, but anything YOUR card body animates still can — the prohibition, and the primitives that replace an `animate-*` utility, are in `references/surfaces-and-design.md` §Design floor.
221
221
 
222
222
  An unmatched `cardType` is not an error and not a blank: the result falls back to the **generic default card**, which is often deliberate (a host/builtin card type, a tool that only needs the standard rendering). The pre-flight warns rather than rejects for exactly that reason — but if you meant to ship your own card, that warning is the whole signal you will get.
223
223
 
@@ -241,9 +241,9 @@ An unmatched `cardType` is not an error and not a blank: the result falls back t
241
241
  | `Tool rate limit exceeded` | trust-tier rate limit — untrusted 10/min, trusted 100/min |
242
242
  | the handler got a number where you expected a rejected string | the dispatch validator coerces types; `"50"` becomes `50`. Guard on semantics, not on "it was validated" |
243
243
  | tools catalogued but every call policy-denied | an untrusted package with no explicit tool allowlist gets an **empty** one until an admin elevates it |
244
- | package `partial`, reason `untrusted-node` | a non-first-party package declaring the in-process runtime. Declare the sandboxed or MCP runtime instead |
244
+ | package `partial`, reason `untrusted-node` | a non-native package declaring the in-process runtime. Declare the sandboxed or MCP runtime instead |
245
245
 
246
- Untrusted tools are rate-limited an order of magnitude harder and time out sooner than first-party ones; the full trust-ceiling table is in `references/runtime-and-build.md`.
246
+ Untrusted tools are rate-limited an order of magnitude harder and time out sooner than native ones; the full trust-ceiling table is in `references/runtime-and-build.md`.
247
247
 
248
248
  ---
249
249
 
@@ -1,59 +1,74 @@
1
- #!/usr/bin/env bash
2
- #
3
- # create-package/check-package.sh — static pre-flight for a package directory.
4
- #
5
- # It catches only what fails SILENTLY — a frontmatter key nobody parses, a
6
- # `files[]` whitelist that ships an empty tarball, a `$schema` that loads and
7
- # then breaks every call, an unreachable widget, a UI entry whose stylesheet
8
- # never loads, compiled output one directory from where the loader looks. What
9
- # the loader itself reports BY NAME at install (id charset, reserved ids,
10
- # uriPolicies, workflow templates, most manifest validation) is NOT repeated
11
- # here — install and read the load status.
12
- #
13
- # ONE class here is authoring-only by construction: what a package UI entry may
14
- # reference. The kernel validator receives the manifest OBJECT — no package root,
15
- # no filesystem — so it can never inspect a file's CONTENT, and the platform
16
- # blocks nothing at runtime. The rules INVERT with the surface's declared
17
- # `assetMode`: a SELF-CONTAINED entry (the default) must inline everything, since
18
- # its subresource request leaves an opaque origin with no session cookie and is
19
- # not served; a "bundle" entry has its siblings served, and must keep every
20
- # reference inside the two roots that lane serves. This script is where both are
21
- # enforced, before either becomes a blank surface.
22
- #
23
- # Findings here are AUTHORING findings. They never set a package's load status —
24
- # that belongs to the contribution validator, and a new ERROR there would
25
- # retroactively flip already-installed packages to `error`.
26
- #
27
- # MODE comes from disk. `package.json`#neuralis or `neuralis.package.json` =
28
- # manifest mode. NO manifest = markdown mode (the source-package / bare-skill
29
- # layout): it checks package recognition, the markdown categories and their
30
- # frontmatter, SKIPS every manifest-dependent check and PRINTS the skip — so
31
- # nothing here ever reads as verified when it was not.
32
- #
33
- # CANNOT CHECK anything needing a running platform (did it load, does a handler
34
- # work, does a feature id exist). Nor your trust tier — trust is assigned by
35
- # where the package came FROM, never declared in a manifest, so nothing here
36
- # reads `access.trust` as a grant. Load proof, after install:
37
- # bash "${SKILL_DIR}/scripts/verify-loaded.sh" <package-id>
38
- #
39
- # USAGE bash check-package.sh <package-root>
40
- # EXIT 0 = no errors (warnings may print) · 1 = ERRORs · 2 = usage / no node
41
- # https://docs.neuralisapp.com/package-system/directory-contract
42
- # https://docs.neuralisapp.com/package-system/source-packages
1
+ //
2
+ // create-package/check-package.mjs — static pre-flight for a package directory.
3
+ //
4
+ // It catches only what fails SILENTLY — a frontmatter key nobody parses, a
5
+ // `files[]` whitelist that ships an empty tarball, a `$schema` that loads and
6
+ // then breaks every call, an unreachable widget, a UI entry whose stylesheet
7
+ // never loads, compiled output one directory from where the loader looks. What
8
+ // the loader itself reports BY NAME at install (id charset, reserved ids,
9
+ // uriPolicies, workflow templates, most manifest validation) is NOT repeated
10
+ // here — install and read the load status.
11
+ //
12
+ // ONE class here is authoring-only by construction: what a package UI entry may
13
+ // reference. The kernel validator receives the manifest OBJECT — no package root,
14
+ // no filesystem — so it can never inspect a file's CONTENT, and the platform
15
+ // blocks nothing at runtime. The rules INVERT with the surface's declared
16
+ // `assetMode`: a SELF-CONTAINED entry (the default) must inline everything, since
17
+ // its subresource request leaves an opaque origin with no session cookie and is
18
+ // not served; a "bundle" entry has its siblings served, and must keep every
19
+ // reference inside the two roots that lane serves. This script is where both are
20
+ // enforced, before either becomes a blank surface.
21
+ //
22
+ // Findings here are AUTHORING findings. They never set a package's load status —
23
+ // that belongs to the contribution validator, and a new ERROR there would
24
+ // retroactively flip already-installed packages to `error`.
25
+ //
26
+ // MODE comes from disk. `package.json`#neuralis or `neuralis.package.json` =
27
+ // manifest mode. NO manifest = markdown mode (the source-package / bare-skill
28
+ // layout): it checks package recognition, the markdown categories and their
29
+ // frontmatter, SKIPS every manifest-dependent check and PRINTS the skip — so
30
+ // nothing here ever reads as verified when it was not.
31
+ //
32
+ // CANNOT CHECK anything needing a running platform (did it load, does a handler
33
+ // work, does a feature id exist). Nor your trust tier — trust is assigned by
34
+ // where the package came FROM, never declared in a manifest, so nothing here
35
+ // reads `access.trust` as a grant. Load proof, after install:
36
+ // node "${SKILL_DIR}/scripts/verify-loaded.mjs" <package-id>
37
+ //
38
+ // USAGE node check-package.mjs <package-root>
39
+ // EXIT 0 = no errors (warnings may print) · 1 = ERRORs · 2 = usage
40
+ // https://docs.neuralisapp.com/package-system/directory-contract
41
+ // https://docs.neuralisapp.com/package-system/source-packages
43
42
 
44
- set -euo pipefail
43
+ import fs from 'node:fs';
44
+ import { createRequire } from 'node:module';
45
+ import path from 'node:path';
46
+ import { fileURLToPath } from 'node:url';
45
47
 
46
- if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then
47
- sed -n '2,35p' "$0" | sed 's/^#\{0,1\} \{0,1\}//'; exit 0
48
- fi
49
- [ "$#" -eq 1 ] || { echo "usage: bash check-package.sh <package-root>" >&2; exit 2; }
50
- [ -d "$1" ] || { echo "ERROR $1 is not a directory — pass the package ROOT folder" >&2; exit 2; }
51
- command -v node >/dev/null 2>&1 || { echo "ERROR node not on PATH (this parses JSON with node, not jq)" >&2; exit 2; }
52
-
53
- node - "$1" "$(dirname "$0")" <<'NODE_CHECK'
54
- 'use strict';
55
- const fs = require('fs'), path = require('path');
56
- const ROOT = process.argv[2], SCRIPT_DIR = process.argv[3], F = [];
48
+ // `require.resolve(spec, { paths: [from] })` walks node_modules up from each
49
+ // root, exactly as the CommonJS loader does — the platform modules below are
50
+ // found from the package, the cwd or this script's own install.
51
+ const require = createRequire(import.meta.url);
52
+ const SELF = fileURLToPath(import.meta.url);
53
+ const SCRIPT_DIR = path.dirname(SELF);
54
+ const argv = process.argv.slice(2);
55
+ if (argv[0] === '-h' || argv[0] === '--help') {
56
+ const head = fs.readFileSync(SELF, 'utf8').split('\n');
57
+ const end = head.findIndex((l) => !l.startsWith('//'));
58
+ process.stdout.write(`${head.slice(1, end).map((l) => l.replace(/^\/\/ ?/, '')).join('\n')}\n`);
59
+ process.exit(0);
60
+ }
61
+ if (argv.length !== 1) {
62
+ process.stderr.write('usage: node check-package.mjs <package-root>\n');
63
+ process.exit(2);
64
+ }
65
+ let isDirectory = false;
66
+ try { isDirectory = fs.statSync(argv[0]).isDirectory(); } catch { isDirectory = false; }
67
+ if (!isDirectory) {
68
+ process.stderr.write(`ERROR ${argv[0]} is not a directory — pass the package ROOT folder\n`);
69
+ process.exit(2);
70
+ }
71
+ const ROOT = argv[0], F = [];
57
72
  const rel = (p) => path.relative(ROOT, p) || '.';
58
73
  const err = (f, m) => F.push({ lvl: 'ERROR', f, m });
59
74
  const warn = (f, m) => F.push({ lvl: 'WARN', f, m });
@@ -63,7 +78,7 @@ const json = (p) => JSON.parse(fs.readFileSync(p, 'utf8'));
63
78
  const at = (...p) => path.join(ROOT, ...p);
64
79
 
65
80
  const SKIP = new Set(['node_modules', '.git', 'dist', 'build', 'coverage', 'scripts', 'references', 'assets']);
66
- const DOTS = new Set(['.claude', '.agents', '.cursor', '.codex', '.gemini', '.windsurf', '.github', '.opencode', '.kilo', '.roo']);
81
+ const DOTS = new Set(['.claude', '.agents', '.cursor', '.codex', '.gemini', '.windsurf', '.devin', '.github', '.opencode', '.kilo', '.roo']);
67
82
  const CATS = ['skills', 'instructions', 'rules', 'agents', 'docs', 'commands'];
68
83
 
69
84
  function walk(d, out = [], depth = 0) {
@@ -105,7 +120,7 @@ const FIX = 'NO gate. Use `requiredFeatures: [a.b]` or an indented `- a.b` list'
105
120
 
106
121
  // The two gate traps — every markdown category, both modes.
107
122
  function gates(f, fm) {
108
- if (fm.obj.has('requires')) err(f, `a nested \`requires:\` block parses to nothing — this file has ${FIX}`);
123
+ if (fm.obj.has('requires')) err(f, `a nested \`requires:\` block is read by nothing — this file has ${FIX}`);
109
124
  const rf = fm.sc.requiredFeatures;
110
125
  if (rf === undefined || (rf.startsWith('[') && rf.endsWith(']'))) return;
111
126
  if (rf === '' && fm.list.has('requiredFeatures')) return;
@@ -214,7 +229,7 @@ if (man) {
214
229
 
215
230
  // tools — the silent traps only.
216
231
  const D7 = 'http://json-schema.org/draft-07/schema#';
217
- const IDENT = /^(user|project|agent|conversation|request|toolUse)Id$|^(role|priority|grantedFeatures|spendLimits|dailyLimits|llmRateLimitRpm|agentAccess|agentOwnership|session)$/;
232
+ const IDENT = /^(user|project|agent|conversation|request|toolUse|delegateRun)Id$|^(delegateMode|role|priority|rolePriorities|grantedFeatures|spendLimits|dailyLimits|llmRateLimitRpm|agentAccess|agentOwnership|displayName|session)$/;
218
233
  const toolCardTypes = [];
219
234
  for (const n of dir(at('tools')) ? fs.readdirSync(at('tools')).filter((x) => x.endsWith('.json')) : []) {
220
235
  const f = `tools/${n}`;
@@ -276,7 +291,7 @@ if (man) {
276
291
  }
277
292
 
278
293
  // --- cards + the surface asset contract ------------------------------------
279
- // TWO renderers exist: `direct` (first-party compiled React, registered by the
294
+ // TWO renderers exist: `direct` (native compiled React, registered by the
280
295
  // package's OWN host entrypoint) and `iframe` (every sandboxed path). An
281
296
  // asset-backed iframe entry lives under its own canonical
282
297
  // `app/surfaces/{kind}/{surfaceId}/` root — widget `{surfaceId}` is its `type`,
@@ -477,14 +492,14 @@ if (man) {
477
492
  return;
478
493
  }
479
494
  if (renderer === 'direct') {
480
- warn(MF, `${L} renderer "direct" renders only under an ASSIGNED first-party tier — a dropped package must use "iframe"`);
495
+ warn(MF, `${L} renderer "direct" renders only under an ASSIGNED native tier — a dropped package must use "iframe"`);
481
496
  return;
482
497
  }
483
498
  if (renderer !== 'iframe') return;
484
499
  const url = typeof render.url === 'string' ? render.url.trim() : '';
485
500
  if (!url) { err(MF, `${L} renderer "iframe" with no "url" — nothing to load`); return; }
486
501
  if (isAbsUrl(url)) {
487
- warn(MF, `${L} absolute iframe url "${url}" loads only under an ASSIGNED trusted/first-party tier — the tier comes from where the package was installed FROM, never from access.trust; an untrusted package's absolute surface is dropped from the snapshot fail-closed`);
502
+ warn(MF, `${L} absolute iframe url "${url}" loads only under an ASSIGNED trusted/native tier — the tier comes from where the package was installed FROM, never from access.trust; an untrusted package's absolute surface is dropped from the snapshot fail-closed`);
488
503
  if (declaredMode === 'bundle') {
489
504
  warn(MF, `${label}: "assetMode":"bundle" is IGNORED on an absolute url — the platform serves bundle subresources only for an entry under the surface's own asset root.`);
490
505
  }
@@ -661,8 +676,8 @@ if (man) {
661
676
  if (rt.skillScripts !== undefined && rt.skillScripts !== 'none') need.push(`runtime.skillScripts "${rt.skillScripts}" (validation fails below trusted — declare "none" or omit)`);
662
677
  if (pm.exec === true || pm.net === 'full' || pm.fs === 'full') need.push('runtime.permissions exec / net:"full" / fs:"full" (rejected outright when untrusted)');
663
678
  if (need.length) warn(MF, `${need.join(' · ')} — ${TIER}`);
664
- if (rt.type === 'node') warn(MF, `runtime.type "node" runs IN-PROCESS and needs an ASSIGNED first-party tier — elsewhere it loads PARTIAL ("untrusted-node") and every handler errors. Use "wasm"`);
665
- if (rt.type === 'mcp') warn(MF, `runtime.type "mcp" spawns a subprocess as the HOST USER and needs an ASSIGNED first-party tier — elsewhere it loads PARTIAL ("untrusted-mcp"), nothing spawns and every handler errors. "wasm" is the only code runtime below first-party. Use "wasm"`);
679
+ if (rt.type === 'node') warn(MF, `runtime.type "node" runs IN-PROCESS and needs an ASSIGNED native tier — elsewhere it loads PARTIAL ("untrusted-node") and every handler errors. Use "wasm"`);
680
+ if (rt.type === 'mcp') warn(MF, `runtime.type "mcp" spawns a subprocess as the HOST USER and needs an ASSIGNED native tier — elsewhere it loads PARTIAL ("untrusted-mcp"), nothing spawns and every handler errors. "wasm" is the only code runtime below native. Use "wasm"`);
666
681
  if (rt.type === 'mcp' && !(rt.entry && rt.entry.command)) warn(MF, 'runtime.type "mcp" without runtime.entry.command — nothing spawns, so it loads PARTIAL ("runtime-unavailable")');
667
682
 
668
683
  // compiled output — the loader looks ONLY under dist/src/**.
@@ -689,7 +704,6 @@ const e = F.filter((x) => x.lvl === 'ERROR').length;
689
704
  const sk = F.filter((x) => x.lvl === 'SKIP').length;
690
705
  out.write(`\n${e} error(s), ${F.length - e - sk} warning(s)${sk ? `, ${sk} check(s) SKIPPED` : ''} — ${path.basename(ROOT)}\n`);
691
706
  if (e === 0) out.write(MODE === 'manifest'
692
- ? 'Static checks pass — that proves NOTHING about loading. Install, then verify-loaded.sh.\n'
693
- : 'Static checks pass for what markdown can carry — that proves NOTHING about discovery.\nThe files must be indexed by a sync first, then: verify-loaded.sh "<slug>://<path>?project=<p>&scope=…".\n');
707
+ ? 'Static checks pass — that proves NOTHING about loading. Install, then verify-loaded.mjs.\n'
708
+ : 'Static checks pass for what markdown can carry — that proves NOTHING about discovery.\nThe files must be indexed by a sync first, then: verify-loaded.mjs "<slug>://<path>?project=<p>&scope=…".\n');
694
709
  process.exit(e > 0 ? 1 : 0);
695
- NODE_CHECK