@hasna/skills 0.1.62 → 0.1.64

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 (541) hide show
  1. package/README.md +38 -12
  2. package/bin/index.js +15743 -21709
  3. package/bin/mcp.js +3866 -11522
  4. package/bin/migrate.js +281 -35
  5. package/bin/server.js +5805 -2682
  6. package/bin/worker.js +5280 -2388
  7. package/dist/cli/commands/publish.d.ts +2 -0
  8. package/dist/cli/commands/registry-reconcile.d.ts +2 -0
  9. package/dist/cli/components/App.d.ts +2 -1
  10. package/dist/cli/components/CategorySelect.d.ts +2 -1
  11. package/dist/cli/components/Header.d.ts +2 -1
  12. package/dist/cli/components/InstallProgress.d.ts +2 -1
  13. package/dist/cli/components/SearchView.d.ts +2 -1
  14. package/dist/cli/components/SkillSelect.d.ts +2 -1
  15. package/dist/index.d.ts +5 -2
  16. package/dist/index.js +5386 -13739
  17. package/dist/lib/agent-sync.d.ts +61 -6
  18. package/dist/lib/auth-store.d.ts +37 -0
  19. package/dist/lib/config.d.ts +51 -0
  20. package/dist/lib/home-adoption.d.ts +91 -0
  21. package/dist/lib/home-census.d.ts +26 -0
  22. package/dist/lib/home-migration.d.ts +60 -0
  23. package/dist/lib/native-storage.d.ts +1 -1
  24. package/dist/lib/portable-skills-files.d.ts +21 -1
  25. package/dist/lib/portable-skills-types.d.ts +46 -0
  26. package/dist/lib/portable-skills.d.ts +35 -6
  27. package/dist/lib/pull.d.ts +97 -0
  28. package/dist/lib/registry-reconcile.d.ts +114 -0
  29. package/dist/lib/registry.d.ts +7 -4
  30. package/dist/lib/remote-client.d.ts +124 -1
  31. package/dist/lib/remote-registry.d.ts +26 -0
  32. package/dist/lib/revision.d.ts +29 -0
  33. package/dist/lib/run-state.d.ts +5 -0
  34. package/dist/lib/skill-bundles.d.ts +54 -0
  35. package/dist/lib/skill-contract.d.ts +35 -0
  36. package/dist/lib/skill-hash.d.ts +77 -0
  37. package/dist/sdk/cancel.d.ts +30 -0
  38. package/dist/sdk/dispatcher.d.ts +40 -0
  39. package/dist/sdk/event-sink.d.ts +2 -0
  40. package/dist/sdk/events.d.ts +79 -0
  41. package/dist/sdk/execution/admission.d.ts +44 -0
  42. package/dist/sdk/execution/dispatchers/e2b.d.ts +17 -0
  43. package/dist/sdk/execution/dispatchers/ecs.d.ts +151 -0
  44. package/dist/sdk/execution/image-profile.d.ts +73 -0
  45. package/dist/sdk/execution/index.d.ts +15 -0
  46. package/dist/sdk/execution/receipts.d.ts +44 -0
  47. package/dist/sdk/execution/state-machine.d.ts +38 -0
  48. package/dist/sdk/execution/storage.d.ts +158 -0
  49. package/dist/sdk/execution/types.d.ts +130 -0
  50. package/dist/sdk/executor.d.ts +17 -0
  51. package/dist/sdk/governance-store.d.ts +156 -0
  52. package/dist/sdk/governance.d.ts +92 -0
  53. package/dist/sdk/index.d.ts +26 -0
  54. package/dist/sdk/index.js +49728 -0
  55. package/dist/sdk/offline.d.ts +16 -0
  56. package/dist/sdk/outputs.d.ts +71 -0
  57. package/dist/sdk/registry.d.ts +28 -0
  58. package/dist/sdk/runs.d.ts +229 -0
  59. package/dist/sdk/server.d.ts +35 -0
  60. package/dist/sdk/spend.d.ts +36 -0
  61. package/dist/sdk/storage.d.ts +25 -0
  62. package/dist/server/app.d.ts +42 -0
  63. package/dist/server/artifact-storage.d.ts +102 -0
  64. package/dist/server/auth.d.ts +5 -0
  65. package/dist/server/config.d.ts +50 -0
  66. package/dist/server/database-url.d.ts +42 -0
  67. package/dist/server/handlers.d.ts +3 -0
  68. package/dist/server/index.d.ts +2 -0
  69. package/dist/server/migrate.d.ts +13 -0
  70. package/dist/server/migrations-dir.d.ts +18 -0
  71. package/dist/server/redaction.d.ts +1 -0
  72. package/dist/server/registry.d.ts +5 -0
  73. package/dist/server/rows.d.ts +24 -0
  74. package/dist/server/skills-api.d.ts +170 -0
  75. package/dist/server/sqlite-store.d.ts +131 -0
  76. package/dist/server/store-fixtures.d.ts +25 -0
  77. package/dist/server/store.d.ts +170 -0
  78. package/dist/server/types.d.ts +337 -0
  79. package/dist/server/worker.d.ts +4 -0
  80. package/dist/storage.js +39 -2
  81. package/docs/skill-standard.md +211 -39
  82. package/migrations/postgres/0003_run_outputs_governance.sql +83 -0
  83. package/migrations/postgres/0004_hosted_pins.sql +28 -0
  84. package/migrations/postgres/0005_revision_tombstone_registry.sql +37 -0
  85. package/migrations/postgres/0005_tag_projection.sql +36 -0
  86. package/migrations/sqlite/0003_run_outputs_governance.sql +58 -0
  87. package/migrations/sqlite/0004_hosted_pins.sql +21 -0
  88. package/migrations/sqlite/0005_revision_tombstone_registry.sql +18 -0
  89. package/migrations/sqlite/0005_tag_projection.sql +25 -0
  90. package/package.json +12 -8
  91. package/schemas/skill.schema.json +181 -0
  92. package/agent-skills/README.md +0 -41
  93. package/agent-skills/fleet-package-rollout/SKILL.md +0 -169
  94. package/agent-skills/inbox/SKILL.md +0 -25
  95. package/agent-skills/inbox/scripts/inbox +0 -109
  96. package/agent-skills/inbox/tests/test_registered_sender_id.sh +0 -92
  97. package/agent-skills/inbox-monitor/SKILL.md +0 -41
  98. package/agent-skills/inbox-monitor/scripts/inbox_monitor.sh +0 -91
  99. package/agent-skills/inbox-monitor/scripts/test_inbox_monitor.sh +0 -71
  100. package/agent-skills/merge-pr/SKILL.md +0 -85
  101. package/agent-skills/merge-pr/references/merge-safety.md +0 -82
  102. package/agent-skills/merge-pr/scripts/merge_pr_guard.py +0 -694
  103. package/agent-skills/merge-pr/scripts/test_merge_pr_guard.py +0 -647
  104. package/agent-skills/merge-pr/tests/fixtures/multi-commit-synthesized.json +0 -28
  105. package/agent-skills/merge-pr/tests/fixtures/trailer-free-provider.json +0 -28
  106. package/agent-skills/skill-goal-execute/SKILL.md +0 -115
  107. package/agent-skills/skill-login/SKILL.md +0 -109
  108. package/agent-skills/skill-project-create/SKILL.md +0 -91
  109. package/agent-skills/skill-publish/SKILL.md +0 -254
  110. package/agent-skills/skill-publish/scripts/capture_registry.js +0 -47
  111. package/agent-skills/skill-publish/scripts/publish_with_git_head.sh +0 -143
  112. package/agent-skills/skill-publish/scripts/test_publish_with_git_head.sh +0 -231
  113. package/skills/_common/auth.ts +0 -45
  114. package/skills/_common/http-client.ts +0 -143
  115. package/skills/_common/index.ts +0 -26
  116. package/skills/_common/install.sh +0 -7
  117. package/skills/_common/installer.ts +0 -72
  118. package/skills/_common/skill-install.ts +0 -37
  119. package/skills/_common/vision.ts +0 -374
  120. package/skills/ad-creative-pack/SKILL.md +0 -55
  121. package/skills/ad-creative-pack/package.json +0 -10
  122. package/skills/analyze-data/CLAUDE.md +0 -16
  123. package/skills/analyze-data/SKILL.md +0 -112
  124. package/skills/analyze-data/package.json +0 -23
  125. package/skills/analyze-data/src/analysis.ts +0 -401
  126. package/skills/analyze-data/src/cli.ts +0 -66
  127. package/skills/analyze-data/src/formatters.ts +0 -235
  128. package/skills/analyze-data/src/index.ts +0 -74
  129. package/skills/analyze-data/src/logger.ts +0 -36
  130. package/skills/analyze-data/src/parsers.ts +0 -57
  131. package/skills/analyze-data/src/stats.ts +0 -151
  132. package/skills/analyze-data/src/types.ts +0 -85
  133. package/skills/analyze-data/tsconfig.json +0 -19
  134. package/skills/api-docs-portal/SKILL.md +0 -84
  135. package/skills/api-docs-portal/package.json +0 -35
  136. package/skills/api-docs-portal/src/index.ts +0 -919
  137. package/skills/api-docs-portal/tsconfig.json +0 -17
  138. package/skills/api-test-suite/CLAUDE.md +0 -19
  139. package/skills/api-test-suite/package.json +0 -27
  140. package/skills/api-test-suite/src/index.ts +0 -381
  141. package/skills/api-test-suite/tsconfig.json +0 -10
  142. package/skills/audio-extract/CLAUDE.md +0 -9
  143. package/skills/audio-extract/SKILL.md +0 -73
  144. package/skills/audio-extract/package.json +0 -23
  145. package/skills/audio-extract/src/index.ts +0 -323
  146. package/skills/audio-extract/tsconfig.json +0 -11
  147. package/skills/bio-sequence-tool/CLAUDE.md +0 -19
  148. package/skills/bio-sequence-tool/package.json +0 -27
  149. package/skills/bio-sequence-tool/src/index.ts +0 -85
  150. package/skills/bio-sequence-tool/tsconfig.json +0 -10
  151. package/skills/blog-article/CLAUDE.md +0 -12
  152. package/skills/blog-article/SKILL.md +0 -55
  153. package/skills/blog-article/package.json +0 -10
  154. package/skills/blog-article/tsconfig.json +0 -10
  155. package/skills/brand-assets/SKILL.md +0 -118
  156. package/skills/brand-assets/package.json +0 -35
  157. package/skills/brand-assets/src/cli.ts +0 -155
  158. package/skills/brand-assets/src/constants.ts +0 -8
  159. package/skills/brand-assets/src/extract.ts +0 -236
  160. package/skills/brand-assets/src/index.ts +0 -668
  161. package/skills/brand-assets/src/types.ts +0 -59
  162. package/skills/brand-assets/tsconfig.json +0 -17
  163. package/skills/brand-kit/SKILL.md +0 -54
  164. package/skills/brand-kit/package.json +0 -10
  165. package/skills/businessactivity/CLAUDE.md +0 -176
  166. package/skills/businessactivity/LICENSE +0 -192
  167. package/skills/businessactivity/README.md +0 -287
  168. package/skills/businessactivity/package.json +0 -25
  169. package/skills/businessactivity/scripts/publish.ts +0 -210
  170. package/skills/businessactivity/src/commands/activity.ts +0 -211
  171. package/skills/businessactivity/src/commands/function.ts +0 -227
  172. package/skills/businessactivity/src/commands/owner.ts +0 -193
  173. package/skills/businessactivity/src/commands/profile.ts +0 -121
  174. package/skills/businessactivity/src/commands/responsibility.ts +0 -264
  175. package/skills/businessactivity/src/commands/team.ts +0 -244
  176. package/skills/businessactivity/src/commands/workflow.ts +0 -359
  177. package/skills/businessactivity/src/index.ts +0 -3
  178. package/skills/businessactivity/src/lib/config.ts +0 -167
  179. package/skills/businessactivity/src/lib/output.ts +0 -76
  180. package/skills/businessactivity/src/lib/paths.ts +0 -79
  181. package/skills/businessactivity/src/lib/storage.ts +0 -95
  182. package/skills/businessactivity/src/types/index.ts +0 -86
  183. package/skills/businessactivity/tsconfig.json +0 -29
  184. package/skills/codefix/LICENSE +0 -192
  185. package/skills/codefix/README.md +0 -232
  186. package/skills/codefix/SKILL.md +0 -94
  187. package/skills/codefix/package.json +0 -21
  188. package/skills/codefix/src/fixers/batch.ts +0 -213
  189. package/skills/codefix/src/fixers/detector.ts +0 -160
  190. package/skills/codefix/src/fixers/index.ts +0 -7
  191. package/skills/codefix/src/fixers/runner.ts +0 -522
  192. package/skills/codefix/src/index-local.ts +0 -431
  193. package/skills/codefix/src/index.ts +0 -4
  194. package/skills/codefix/src/types.ts +0 -211
  195. package/skills/codefix/tsconfig.json +0 -15
  196. package/skills/commitpush/SKILL.md +0 -57
  197. package/skills/commitpush/package.json +0 -33
  198. package/skills/commitpush/src/index.ts +0 -34
  199. package/skills/commitpush/tsconfig.json +0 -17
  200. package/skills/commitpushpr/SKILL.md +0 -55
  201. package/skills/commitpushpr/package.json +0 -33
  202. package/skills/commitpushpr/src/index.ts +0 -34
  203. package/skills/commitpushpr/tsconfig.json +0 -17
  204. package/skills/compress-video/CLAUDE.md +0 -9
  205. package/skills/compress-video/SKILL.md +0 -79
  206. package/skills/compress-video/package.json +0 -23
  207. package/skills/compress-video/src/index.ts +0 -473
  208. package/skills/compress-video/tsconfig.json +0 -11
  209. package/skills/contract-review-report/SKILL.md +0 -52
  210. package/skills/contract-review-report/package.json +0 -10
  211. package/skills/customer-feedback-report/SKILL.md +0 -52
  212. package/skills/customer-feedback-report/package.json +0 -10
  213. package/skills/dashboard-builder/CLAUDE.md +0 -19
  214. package/skills/dashboard-builder/package.json +0 -29
  215. package/skills/dashboard-builder/src/index.ts +0 -150
  216. package/skills/dashboard-builder/tsconfig.json +0 -10
  217. package/skills/data-anonymizer/CLAUDE.md +0 -19
  218. package/skills/data-anonymizer/package.json +0 -27
  219. package/skills/data-anonymizer/src/index.ts +0 -183
  220. package/skills/data-anonymizer/tsconfig.json +0 -10
  221. package/skills/database-explorer/CLAUDE.md +0 -19
  222. package/skills/database-explorer/package.json +0 -29
  223. package/skills/database-explorer/src/index.ts +0 -95
  224. package/skills/database-explorer/tsconfig.json +0 -10
  225. package/skills/diff-viewer/CLAUDE.md +0 -19
  226. package/skills/diff-viewer/package.json +0 -30
  227. package/skills/diff-viewer/src/index.ts +0 -164
  228. package/skills/diff-viewer/tsconfig.json +0 -10
  229. package/skills/doc-read/SKILL.md +0 -45
  230. package/skills/doc-read/package.json +0 -29
  231. package/skills/doc-read/src/index.ts +0 -324
  232. package/skills/doc-read/tsconfig.json +0 -8
  233. package/skills/domainpurchase/LICENSE +0 -192
  234. package/skills/domainpurchase/SKILL.md +0 -29
  235. package/skills/domainpurchase/package.json +0 -30
  236. package/skills/domainpurchase/src/index.ts +0 -3
  237. package/skills/domainpurchase/tsconfig.json +0 -21
  238. package/skills/email-sequence/SKILL.md +0 -53
  239. package/skills/email-sequence/package.json +0 -10
  240. package/skills/experiment-power-calculator/CLAUDE.md +0 -19
  241. package/skills/experiment-power-calculator/package.json +0 -29
  242. package/skills/experiment-power-calculator/src/index.ts +0 -86
  243. package/skills/experiment-power-calculator/tsconfig.json +0 -10
  244. package/skills/extract-frames/CLAUDE.md +0 -19
  245. package/skills/extract-frames/package.json +0 -27
  246. package/skills/extract-frames/src/index.ts +0 -616
  247. package/skills/extract-frames/tsconfig.json +0 -10
  248. package/skills/file-organizer/CLAUDE.md +0 -19
  249. package/skills/file-organizer/package.json +0 -27
  250. package/skills/file-organizer/src/index.ts +0 -91
  251. package/skills/file-organizer/tsconfig.json +0 -10
  252. package/skills/folder-tree/CLAUDE.md +0 -19
  253. package/skills/folder-tree/package.json +0 -29
  254. package/skills/folder-tree/src/index.ts +0 -568
  255. package/skills/folder-tree/tsconfig.json +0 -10
  256. package/skills/form-filler/CLAUDE.md +0 -19
  257. package/skills/form-filler/package.json +0 -29
  258. package/skills/form-filler/src/index.ts +0 -81
  259. package/skills/form-filler/tsconfig.json +0 -10
  260. package/skills/generate-api-client/CLAUDE.md +0 -19
  261. package/skills/generate-api-client/package.json +0 -29
  262. package/skills/generate-api-client/src/generator.ts +0 -47
  263. package/skills/generate-api-client/src/index.ts +0 -92
  264. package/skills/generate-api-client/src/logger.ts +0 -34
  265. package/skills/generate-api-client/src/python-generator.ts +0 -245
  266. package/skills/generate-api-client/src/spec-loader.ts +0 -48
  267. package/skills/generate-api-client/src/type-mappers.ts +0 -79
  268. package/skills/generate-api-client/src/types.ts +0 -76
  269. package/skills/generate-api-client/src/typescript-generator.ts +0 -247
  270. package/skills/generate-api-client/tsconfig.json +0 -10
  271. package/skills/generate-chart/CLAUDE.md +0 -19
  272. package/skills/generate-chart/package.json +0 -27
  273. package/skills/generate-chart/src/index.ts +0 -510
  274. package/skills/generate-chart/tsconfig.json +0 -10
  275. package/skills/generate-dockerfile/CLAUDE.md +0 -19
  276. package/skills/generate-dockerfile/package.json +0 -27
  277. package/skills/generate-dockerfile/src/cli.ts +0 -78
  278. package/skills/generate-dockerfile/src/dockerfile-templates.ts +0 -392
  279. package/skills/generate-dockerfile/src/index.ts +0 -81
  280. package/skills/generate-dockerfile/src/logger.ts +0 -30
  281. package/skills/generate-dockerfile/src/project-detection.ts +0 -68
  282. package/skills/generate-dockerfile/src/support-files.ts +0 -171
  283. package/skills/generate-dockerfile/src/types.ts +0 -29
  284. package/skills/generate-dockerfile/tsconfig.json +0 -10
  285. package/skills/generate-env/CLAUDE.md +0 -19
  286. package/skills/generate-env/package.json +0 -29
  287. package/skills/generate-env/src/cli.ts +0 -85
  288. package/skills/generate-env/src/detection.ts +0 -161
  289. package/skills/generate-env/src/env-data.ts +0 -66
  290. package/skills/generate-env/src/generators.ts +0 -240
  291. package/skills/generate-env/src/index.ts +0 -120
  292. package/skills/generate-env/src/runtime.ts +0 -30
  293. package/skills/generate-env/src/types.ts +0 -32
  294. package/skills/generate-env/tsconfig.json +0 -10
  295. package/skills/generate-favicon/CLAUDE.md +0 -19
  296. package/skills/generate-favicon/package.json +0 -29
  297. package/skills/generate-favicon/src/index.ts +0 -421
  298. package/skills/generate-favicon/tsconfig.json +0 -10
  299. package/skills/generate-qrcode/CLAUDE.md +0 -19
  300. package/skills/generate-qrcode/package.json +0 -30
  301. package/skills/generate-qrcode/src/index.ts +0 -584
  302. package/skills/generate-qrcode/tsconfig.json +0 -10
  303. package/skills/generate-resume/CLAUDE.md +0 -19
  304. package/skills/generate-resume/package.json +0 -27
  305. package/skills/generate-resume/src/cli.ts +0 -157
  306. package/skills/generate-resume/src/index.ts +0 -178
  307. package/skills/generate-resume/src/parsers.ts +0 -95
  308. package/skills/generate-resume/src/renderers.ts +0 -538
  309. package/skills/generate-resume/src/security.ts +0 -39
  310. package/skills/generate-resume/src/types.ts +0 -86
  311. package/skills/generate-resume/tsconfig.json +0 -10
  312. package/skills/generate-sitemap/CLAUDE.md +0 -19
  313. package/skills/generate-sitemap/package.json +0 -27
  314. package/skills/generate-sitemap/src/index.ts +0 -626
  315. package/skills/generate-sitemap/tsconfig.json +0 -10
  316. package/skills/gif-maker/CLAUDE.md +0 -19
  317. package/skills/gif-maker/package.json +0 -30
  318. package/skills/gif-maker/src/index.ts +0 -600
  319. package/skills/gif-maker/tsconfig.json +0 -10
  320. package/skills/hook/LICENSE +0 -192
  321. package/skills/hook/README.md +0 -74
  322. package/skills/hook/SKILL.md +0 -85
  323. package/skills/hook/bunfig.toml +0 -5
  324. package/skills/hook/package.json +0 -28
  325. package/skills/hook/src/commands/create.ts +0 -112
  326. package/skills/hook/src/commands/events.ts +0 -37
  327. package/skills/hook/src/commands/validate.ts +0 -117
  328. package/skills/hook/src/index.ts +0 -118
  329. package/skills/hook/src/templates/root.ts +0 -196
  330. package/skills/hook/src/templates/source.ts +0 -647
  331. package/skills/hook/tsconfig.json +0 -18
  332. package/skills/http-server/CLAUDE.md +0 -19
  333. package/skills/http-server/package.json +0 -29
  334. package/skills/http-server/src/index.ts +0 -51
  335. package/skills/http-server/tsconfig.json +0 -10
  336. package/skills/implementation/LICENSE +0 -192
  337. package/skills/implementation/README.md +0 -53
  338. package/skills/implementation/SKILL.md +0 -57
  339. package/skills/implementation/bunfig.toml +0 -5
  340. package/skills/implementation/package.json +0 -28
  341. package/skills/implementation/src/commands/create.ts +0 -187
  342. package/skills/implementation/src/index.ts +0 -62
  343. package/skills/implementation/tsconfig.json +0 -18
  344. package/skills/implementation-plan/CLAUDE.md +0 -19
  345. package/skills/implementation-plan/package.json +0 -29
  346. package/skills/implementation-plan/src/index.ts +0 -520
  347. package/skills/implementation-plan/tsconfig.json +0 -10
  348. package/skills/implementation-todo/CLAUDE.md +0 -19
  349. package/skills/implementation-todo/package.json +0 -29
  350. package/skills/implementation-todo/src/index.ts +0 -429
  351. package/skills/implementation-todo/tsconfig.json +0 -10
  352. package/skills/invoice/.env.example +0 -3
  353. package/skills/invoice/CLAUDE.md +0 -31
  354. package/skills/invoice/LICENSE +0 -192
  355. package/skills/invoice/README.md +0 -70
  356. package/skills/invoice/package.json +0 -26
  357. package/skills/invoice/src/commands/companies.ts +0 -202
  358. package/skills/invoice/src/commands/config.ts +0 -132
  359. package/skills/invoice/src/commands/generate.ts +0 -177
  360. package/skills/invoice/src/commands/invoices.ts +0 -218
  361. package/skills/invoice/src/index.ts +0 -3
  362. package/skills/invoice/src/lib/api.ts +0 -124
  363. package/skills/invoice/src/lib/storage.ts +0 -171
  364. package/skills/invoice/src/types/index.ts +0 -86
  365. package/skills/invoice/src/utils/logger.ts +0 -33
  366. package/skills/invoice/src/utils/paths.ts +0 -25
  367. package/skills/invoice/tsconfig.json +0 -23
  368. package/skills/invoice-reconciliation/SKILL.md +0 -98
  369. package/skills/invoice-reconciliation/package.json +0 -36
  370. package/skills/invoice-reconciliation/src/index.ts +0 -743
  371. package/skills/invoice-reconciliation/tsconfig.json +0 -17
  372. package/skills/landing-page-pack/SKILL.md +0 -55
  373. package/skills/landing-page-pack/package.json +0 -10
  374. package/skills/latex-table-generator/CLAUDE.md +0 -19
  375. package/skills/latex-table-generator/package.json +0 -29
  376. package/skills/latex-table-generator/src/index.ts +0 -113
  377. package/skills/latex-table-generator/tsconfig.json +0 -10
  378. package/skills/logo-design/SKILL.md +0 -94
  379. package/skills/logo-design/package.json +0 -35
  380. package/skills/logo-design/src/cli.ts +0 -132
  381. package/skills/logo-design/src/constants.ts +0 -5
  382. package/skills/logo-design/src/docs.ts +0 -102
  383. package/skills/logo-design/src/geometry.ts +0 -324
  384. package/skills/logo-design/src/index.ts +0 -212
  385. package/skills/logo-design/src/palette.ts +0 -258
  386. package/skills/logo-design/src/types.ts +0 -50
  387. package/skills/logo-design/tsconfig.json +0 -17
  388. package/skills/lorem-generator/CLAUDE.md +0 -19
  389. package/skills/lorem-generator/package.json +0 -29
  390. package/skills/lorem-generator/src/index.ts +0 -59
  391. package/skills/lorem-generator/tsconfig.json +0 -10
  392. package/skills/managemcp/CLAUDE.md +0 -14
  393. package/skills/managemcp/README.md +0 -24
  394. package/skills/managemcp/package.json +0 -16
  395. package/skills/managemcp/src/index.ts +0 -3
  396. package/skills/managemcp/tsconfig.json +0 -27
  397. package/skills/markdown-validator/CLAUDE.md +0 -19
  398. package/skills/markdown-validator/package.json +0 -29
  399. package/skills/markdown-validator/src/index.ts +0 -92
  400. package/skills/markdown-validator/tsconfig.json +0 -10
  401. package/skills/market-research-report/SKILL.md +0 -51
  402. package/skills/market-research-report/package.json +0 -10
  403. package/skills/meeting-pack/SKILL.md +0 -52
  404. package/skills/meeting-pack/package.json +0 -10
  405. package/skills/merge-pdfs/CLAUDE.md +0 -19
  406. package/skills/merge-pdfs/package.json +0 -31
  407. package/skills/merge-pdfs/src/index.ts +0 -427
  408. package/skills/merge-pdfs/tsconfig.json +0 -10
  409. package/skills/migration-plan-pack/SKILL.md +0 -56
  410. package/skills/migration-plan-pack/package.json +0 -10
  411. package/skills/monitor/SKILL.md +0 -69
  412. package/skills/monitor/package.json +0 -33
  413. package/skills/monitor/src/index.ts +0 -34
  414. package/skills/monitor/tsconfig.json +0 -17
  415. package/skills/one-page-website/SKILL.md +0 -128
  416. package/skills/one-page-website/package.json +0 -34
  417. package/skills/one-page-website/src/design.ts +0 -336
  418. package/skills/one-page-website/src/docs.ts +0 -159
  419. package/skills/one-page-website/src/index.ts +0 -357
  420. package/skills/one-page-website/src/page.ts +0 -340
  421. package/skills/one-page-website/src/styles.ts +0 -508
  422. package/skills/one-page-website/src/types.ts +0 -78
  423. package/skills/one-page-website/tsconfig.json +0 -17
  424. package/skills/pdf-generate/CLAUDE.md +0 -19
  425. package/skills/pdf-generate/SKILL.md +0 -86
  426. package/skills/pdf-generate/package.json +0 -21
  427. package/skills/pdf-generate/src/cli.ts +0 -162
  428. package/skills/pdf-generate/src/html.ts +0 -84
  429. package/skills/pdf-generate/src/index.ts +0 -62
  430. package/skills/pdf-generate/src/markdown.ts +0 -27
  431. package/skills/pdf-generate/src/pdf-writer.ts +0 -78
  432. package/skills/pdf-generate/src/runtime.ts +0 -34
  433. package/skills/pdf-generate/src/security.ts +0 -37
  434. package/skills/pdf-generate/src/templates.ts +0 -311
  435. package/skills/pdf-generate/src/types.ts +0 -28
  436. package/skills/pdf-generate/tsconfig.json +0 -16
  437. package/skills/pdf-to-dataset/SKILL.md +0 -88
  438. package/skills/pdf-to-dataset/package.json +0 -37
  439. package/skills/pdf-to-dataset/src/index.ts +0 -790
  440. package/skills/pdf-to-dataset/tsconfig.json +0 -17
  441. package/skills/pdf-to-markdown/SKILL.md +0 -81
  442. package/skills/pdf-to-markdown/package.json +0 -35
  443. package/skills/pdf-to-markdown/src/index.ts +0 -694
  444. package/skills/pdf-to-markdown/tsconfig.json +0 -17
  445. package/skills/performance-audit-report/SKILL.md +0 -49
  446. package/skills/performance-audit-report/package.json +0 -10
  447. package/skills/pitch-deck/SKILL.md +0 -51
  448. package/skills/pitch-deck/package.json +0 -10
  449. package/skills/product-mockup/SKILL.md +0 -107
  450. package/skills/product-mockup/package.json +0 -32
  451. package/skills/product-mockup/src/cli.ts +0 -150
  452. package/skills/product-mockup/src/design.ts +0 -151
  453. package/skills/product-mockup/src/docs.ts +0 -134
  454. package/skills/product-mockup/src/index.ts +0 -182
  455. package/skills/product-mockup/src/render.ts +0 -407
  456. package/skills/product-mockup/src/types.ts +0 -66
  457. package/skills/product-mockup/tsconfig.json +0 -17
  458. package/skills/proposal-pack/SKILL.md +0 -53
  459. package/skills/proposal-pack/package.json +0 -10
  460. package/skills/read-csv/SKILL.md +0 -62
  461. package/skills/read-csv/package.json +0 -37
  462. package/skills/read-csv/src/index.ts +0 -356
  463. package/skills/read-csv/tsconfig.json +0 -17
  464. package/skills/read-excel/SKILL.md +0 -64
  465. package/skills/read-excel/package.json +0 -36
  466. package/skills/read-excel/src/index.ts +0 -266
  467. package/skills/read-excel/tsconfig.json +0 -17
  468. package/skills/regex-tester/CLAUDE.md +0 -19
  469. package/skills/regex-tester/package.json +0 -27
  470. package/skills/regex-tester/src/index.ts +0 -183
  471. package/skills/regex-tester/tsconfig.json +0 -10
  472. package/skills/repo-onboarding-report/SKILL.md +0 -52
  473. package/skills/repo-onboarding-report/package.json +0 -10
  474. package/skills/scancommitpr/SKILL.md +0 -178
  475. package/skills/scancommitpr/package.json +0 -34
  476. package/skills/scancommitpr/src/index.ts +0 -44
  477. package/skills/scancommitpr/tsconfig.json +0 -13
  478. package/skills/scancommitpush/SKILL.md +0 -174
  479. package/skills/scancommitpush/package.json +0 -32
  480. package/skills/scancommitpush/src/index.ts +0 -44
  481. package/skills/scancommitpush/tsconfig.json +0 -13
  482. package/skills/scientific-figure-check/CLAUDE.md +0 -19
  483. package/skills/scientific-figure-check/package.json +0 -29
  484. package/skills/scientific-figure-check/src/index.ts +0 -83
  485. package/skills/scientific-figure-check/tsconfig.json +0 -10
  486. package/skills/security-audit/CLAUDE.md +0 -19
  487. package/skills/security-audit/package.json +0 -27
  488. package/skills/security-audit/src/index.ts +0 -145
  489. package/skills/security-audit/tsconfig.json +0 -10
  490. package/skills/security-audit-report/SKILL.md +0 -52
  491. package/skills/security-audit-report/package.json +0 -10
  492. package/skills/seo-content-pack/SKILL.md +0 -54
  493. package/skills/seo-content-pack/package.json +0 -10
  494. package/skills/siteanalyze/SKILL.md +0 -25
  495. package/skills/siteanalyze/package.json +0 -27
  496. package/skills/siteanalyze/src/index.ts +0 -592
  497. package/skills/slide-deck-generator/SKILL.md +0 -93
  498. package/skills/slide-deck-generator/package.json +0 -38
  499. package/skills/slide-deck-generator/src/cli.ts +0 -133
  500. package/skills/slide-deck-generator/src/index.ts +0 -148
  501. package/skills/slide-deck-generator/src/model.ts +0 -307
  502. package/skills/slide-deck-generator/src/pptx.ts +0 -143
  503. package/skills/slide-deck-generator/src/render.ts +0 -248
  504. package/skills/slide-deck-generator/src/types.ts +0 -114
  505. package/skills/slide-deck-generator/src/utils.ts +0 -53
  506. package/skills/slide-deck-generator/tsconfig.json +0 -17
  507. package/skills/social-content-calendar/SKILL.md +0 -54
  508. package/skills/social-content-calendar/package.json +0 -10
  509. package/skills/split-pdf/CLAUDE.md +0 -19
  510. package/skills/split-pdf/package.json +0 -30
  511. package/skills/split-pdf/src/index.ts +0 -301
  512. package/skills/split-pdf/tsconfig.json +0 -10
  513. package/skills/statistical-test-selector/CLAUDE.md +0 -19
  514. package/skills/statistical-test-selector/package.json +0 -27
  515. package/skills/statistical-test-selector/src/index.ts +0 -75
  516. package/skills/statistical-test-selector/tsconfig.json +0 -10
  517. package/skills/test-suite-generator/SKILL.md +0 -51
  518. package/skills/test-suite-generator/package.json +0 -10
  519. package/skills/tmux-session/SKILL.md +0 -109
  520. package/skills/tmux-session/package.json +0 -33
  521. package/skills/tmux-session/src/index.ts +0 -34
  522. package/skills/tmux-session/tsconfig.json +0 -17
  523. package/skills/todos-plan/SKILL.md +0 -363
  524. package/skills/todos-plan/agents/openai.yaml +0 -4
  525. package/skills/todos-plan/package.json +0 -9
  526. package/skills/todos-plan/src/index.ts +0 -68
  527. package/skills/tsconfig.base.json +0 -12
  528. package/skills/validate-config/CLAUDE.md +0 -19
  529. package/skills/validate-config/package.json +0 -29
  530. package/skills/validate-config/src/index.ts +0 -56
  531. package/skills/validate-config/tsconfig.json +0 -10
  532. package/skills/video-downloader/CLAUDE.md +0 -19
  533. package/skills/video-downloader/package.json +0 -29
  534. package/skills/video-downloader/src/index.ts +0 -561
  535. package/skills/video-downloader/tsconfig.json +0 -10
  536. package/skills/video-highlight-pack/SKILL.md +0 -54
  537. package/skills/video-highlight-pack/package.json +0 -10
  538. package/skills/watermark/CLAUDE.md +0 -19
  539. package/skills/watermark/package.json +0 -32
  540. package/skills/watermark/src/index.ts +0 -587
  541. package/skills/watermark/tsconfig.json +0 -10
@@ -1,5 +1,16 @@
1
1
  import { type PortableSkillOptions } from "./portable-skills.js";
2
+ import { type SkillBundleEntry } from "./skill-bundle.js";
2
3
  import type { SkillKind } from "./registry-types.js";
4
+ /** Header carrying the canonical content digest of the served bundle. */
5
+ export declare const BUNDLE_DIGEST_HEADER = "X-Skill-Bundle-Sha256";
6
+ /** Header carrying the HMAC signature of the served bundle, when the server can sign. */
7
+ export declare const BUNDLE_SIGNATURE_HEADER = "X-Skill-Bundle-Signature";
8
+ /** Header carrying the immutable revision identity of the served row (todos d061fcda). */
9
+ export declare const BUNDLE_REVISION_ID_HEADER = "X-Skill-Revision-Id";
10
+ /** Header carrying the per-slug write counter of the served row. */
11
+ export declare const BUNDLE_REVISION_NUMBER_HEADER = "X-Skill-Revision-Number";
12
+ /** Marker file written inside each corpus skill directory recording pull provenance. */
13
+ export declare const PULL_MARKER_FILE = ".hasna-skills.json";
3
14
  /**
4
15
  * The slice of RemoteSkillsClient that `pullSkills` needs. Narrowed to an interface so a
5
16
  * test can inject a fake and the real HTTP client (which satisfies it structurally) is
@@ -9,6 +20,12 @@ export interface SkillPullClient {
9
20
  listSkills(): Promise<unknown[]>;
10
21
  getSkill(slug: string): Promise<unknown>;
11
22
  getSkillMd(slug: string): Promise<string | null>;
23
+ /**
24
+ * The skill's bundle, headers intact, or null when the instance serves none.
25
+ * `Response` is the natural transport type here: verification reads the
26
+ * X-Skill-Bundle-Sha256 / X-Skill-Bundle-Signature headers off it.
27
+ */
28
+ getBundle(slug: string): Promise<Response | null>;
12
29
  }
13
30
  export interface PullSkillsOptions extends PortableSkillOptions {
14
31
  /** Explicit skill names to pull. Ignored when `all` is set. */
@@ -20,6 +37,8 @@ export interface PullSkillsOptions extends PortableSkillOptions {
20
37
  * `null` models "no credential available" so the null-handling path stays testable.
21
38
  */
22
39
  client?: SkillPullClient | null;
40
+ /** HMAC signing key for bundle signature verification. Defaults to $SKILLS_SIGNING_KEY. */
41
+ signingKey?: string;
23
42
  }
24
43
  export interface PulledSkillResult {
25
44
  name: string;
@@ -27,8 +46,32 @@ export interface PulledSkillResult {
27
46
  path?: string;
28
47
  kind?: SkillKind;
29
48
  version?: string;
49
+ /** Canonical content hash of the installed bundle, when one was verified. */
50
+ contentHash?: string;
51
+ /** Source commit recorded on the bundle, when the instance reported one. */
52
+ sourceCommit?: string;
30
53
  /** True when the pull created the corpus entry, false when it updated an existing one. */
31
54
  created?: boolean;
55
+ /**
56
+ * The revision id (todos d061fcda) this pull installed, when the instance reported one.
57
+ * Recorded in the marker so a later pull can detect that the remote moved on.
58
+ */
59
+ revisionId?: string;
60
+ /** True when the instance answered 410: the slug was deleted and pull reconciled. */
61
+ tombstoned?: boolean;
62
+ /** With `tombstoned`: true when a local corpus entry existed and was removed. */
63
+ removed?: boolean;
64
+ /**
65
+ * With `tombstoned`: true when the local corpus entry was NOT pull-managed (no pull
66
+ * marker), so it was left in place — a remote 410 never deletes a user-created skill.
67
+ */
68
+ leftInPlace?: boolean;
69
+ /**
70
+ * True when the instance no longer serves a published revision under this slug (its
71
+ * tombstone window expired) but the local copy is a revision-marked published install.
72
+ * Reported instead of silently swapping in a bundled skill of the same name.
73
+ */
74
+ purged?: boolean;
32
75
  error?: string;
33
76
  }
34
77
  export interface PullSkillsResult {
@@ -38,4 +81,58 @@ export declare class PullSkillError extends Error {
38
81
  readonly detail?: string[] | undefined;
39
82
  constructor(message: string, detail?: string[] | undefined);
40
83
  }
84
+ export interface VerifiedBundle {
85
+ /** The received bundle bytes, owned by this process. */
86
+ bytes: Uint8Array;
87
+ /** Canonical sha256 of `bytes`. */
88
+ contentHash: string;
89
+ /** The server-declared digest, when the header was present. */
90
+ serverHash?: string;
91
+ /** The server-declared signature, when the header was present. */
92
+ signature?: string;
93
+ /** The server-declared revision id, when the header was present and well-formed. */
94
+ revisionId?: string;
95
+ /** The server-declared per-slug write counter, when the header was present. */
96
+ revisionNumber?: number;
97
+ }
41
98
  export declare function pullSkills(options?: PullSkillsOptions): Promise<PullSkillsResult>;
99
+ /**
100
+ * The verification core, synchronous over already-buffered bytes: the digest header
101
+ * (when present) must equal the canonical sha256 of the received bytes, and the
102
+ * signature header (when present) must verify against the signing key when one is
103
+ * available — otherwise it is recorded with a warning, because a pull cannot check a
104
+ * signature it has no key for.
105
+ */
106
+ export declare function verifyBundleResponseBytes(buffer: ArrayBuffer, response: Response, verify?: {
107
+ signingKey?: string;
108
+ }): VerifiedBundle;
109
+ /**
110
+ * Atomically replace the corpus entry for a verified bundle: stage every entry in a
111
+ * sibling directory, then rename into place (the existing entry is moved aside first
112
+ * and removed only after the staged tree is in position). A failure at any point leaves
113
+ * either the old entry or nothing — never a partial skill.
114
+ */
115
+ export declare function installBundleAtomically(name: string, entries: SkillBundleEntry[], options?: PortableSkillOptions, marker?: {
116
+ version?: string;
117
+ contentHash?: string;
118
+ sourceCommit?: string;
119
+ signature?: string;
120
+ revisionId?: string;
121
+ }): {
122
+ path: string;
123
+ created: boolean;
124
+ };
125
+ /**
126
+ * Record what a pull installed. Version/hash/source-commit are the provenance a later
127
+ * `skills sync --check` or drift census needs; the signature is recorded when one was
128
+ * present so an audit can tell "verified" from "declared".
129
+ */
130
+ export declare function writePullMarker(dir: string, record: {
131
+ skill: string;
132
+ version?: string;
133
+ contentHash?: string;
134
+ sourceCommit?: string;
135
+ signature?: string;
136
+ revisionId?: string;
137
+ source?: "pull" | "sync";
138
+ }): void;
@@ -0,0 +1,114 @@
1
+ import { type PortableSkillOptions } from "./portable-skills.js";
2
+ import { RemoteSkillsClient } from "./remote-client.js";
3
+ export type ReconcileConflictPolicy = "local" | "remote" | "skip";
4
+ /**
5
+ * The default policy, named exactly as the plan specifies: when the digests are identical
6
+ * the local state wins by construction (nothing to resolve); every other divergence is
7
+ * skipped and reported unless --conflict says otherwise.
8
+ */
9
+ export declare const DEFAULT_CONFLICT_POLICY: "local-wins-on-identical-digest-else-skip-and-report";
10
+ export declare const CONFLICT_POLICIES: readonly ReconcileConflictPolicy[];
11
+ /** Corpus-root cursor recording the last sync run. */
12
+ export declare const SYNC_CURSOR_FILE = ".sync-cursor.json";
13
+ export declare const SYNC_CURSOR_SCHEMA_VERSION: 1;
14
+ export interface ReconcileRegistryOptions extends PortableSkillOptions {
15
+ /** Push local-only, changed-locally, and conflicts won by local. */
16
+ push?: boolean;
17
+ /** Pull remote-only, changed-remotely, and conflicts won by remote. */
18
+ pull?: boolean;
19
+ /** Both directions (the default when neither --push nor --pull is given). */
20
+ all?: boolean;
21
+ /** Plan and report without writing anything. */
22
+ dryRun?: boolean;
23
+ /** Conflict resolution policy. */
24
+ conflict?: ReconcileConflictPolicy;
25
+ /** Client override. `undefined` resolves one from configuration; `null` models "no credential". */
26
+ client?: RemoteSkillsClient | null;
27
+ /** HMAC signing key for bundle signature verification. Defaults to $SKILLS_SIGNING_KEY. */
28
+ signingKey?: string;
29
+ }
30
+ export type ReconcileSkillState = "local-only" | "remote-only" | "changed-locally" | "changed-remotely" | "conflict" | "in-sync";
31
+ export type ReconcileAction = "push" | "pull" | "skip" | "none";
32
+ export interface ReconcileSkillEntry {
33
+ slug: string;
34
+ state: ReconcileSkillState;
35
+ action: ReconcileAction;
36
+ localVersion?: string;
37
+ remoteVersion?: string;
38
+ localSha256?: string;
39
+ remoteSha256?: string;
40
+ /** Why the entry was classified or skipped this way. */
41
+ reason?: string;
42
+ /** Present only for executed (non-dry-run) actions. */
43
+ result?: {
44
+ ok: boolean;
45
+ detail?: string;
46
+ };
47
+ }
48
+ export interface ReconcileSummary {
49
+ /** Skills found in the local corpus. */
50
+ local: number;
51
+ /** Skills the registry serves (published plus bundled). */
52
+ remote: number;
53
+ inSync: number;
54
+ pushed: number;
55
+ pulled: number;
56
+ /** Divergences the conflict policy had to resolve (or decline to resolve). */
57
+ conflicts: number;
58
+ /** Divergences skipped under the policy. */
59
+ skipped: number;
60
+ errors: number;
61
+ }
62
+ export interface ReconcileCursor {
63
+ schemaVersion: typeof SYNC_CURSOR_SCHEMA_VERSION;
64
+ managedBy: string;
65
+ lastSyncedAt: string;
66
+ runCount: number;
67
+ summary: ReconcileSummary;
68
+ }
69
+ export interface ReconcileRegistryResult {
70
+ corpusRoot: string;
71
+ /** True when a real run would first migrate the legacy corpus layout into place. */
72
+ migrationPending: boolean;
73
+ direction: "push" | "pull" | "all";
74
+ dryRun: boolean;
75
+ conflictPolicy: ReconcileConflictPolicy;
76
+ /** The full declared policy label; identical to conflictPolicy for local/remote. */
77
+ conflictPolicyDescription: string;
78
+ summary: ReconcileSummary;
79
+ skills: ReconcileSkillEntry[];
80
+ /** Present only when the run was real and completed without errors. */
81
+ cursor?: Pick<ReconcileCursor, "lastSyncedAt" | "runCount">;
82
+ }
83
+ export declare class ReconcileRegistryError extends Error {
84
+ readonly detail?: string[] | undefined;
85
+ constructor(message: string, detail?: string[] | undefined);
86
+ }
87
+ /**
88
+ * Re-check the local side of one pull candidate, immediately before the pull batch.
89
+ *
90
+ * Packs FIRST, then samples existence: a directory that appeared between the plan and
91
+ * the pack is provably on disk when the sample runs. Sampling before the pack let a
92
+ * concurrent editor's partial tree read as "still absent" — the pack then threw on it
93
+ * while the stale sample stayed false, so localMoved was false and the pull replaced
94
+ * the newly created directory (review P1). The ops seam exists so a test can pin that
95
+ * ordering deterministically: pack throws on the partial tree, the post-pack sample
96
+ * sees it, and the candidate counts as moved.
97
+ *
98
+ * Returns true when the local side moved since the plan: a digest different from the
99
+ * planned one, or a directory present where the plan saw none (a concurrent editor).
100
+ */
101
+ export declare function recheckLocalSide(plannedLocal: string | undefined, localDir: string, ops?: {
102
+ pack: (dir: string) => string;
103
+ exists: (dir: string) => boolean;
104
+ }): boolean;
105
+ /**
106
+ * Run one sync pass.
107
+ *
108
+ * The plan (classification + per-skill action) is computed in full before anything is
109
+ * executed, and a dry run stops at the plan: no publish, no pull, no marker, no cursor —
110
+ * proven by readback in the tests. Every executed mutation re-checks both sides first
111
+ * (see the module header); a side that moved since the plan skips that skill and reports
112
+ * it rather than overwriting state the plan did not see.
113
+ */
114
+ export declare function reconcileRegistry(options?: ReconcileRegistryOptions): Promise<ReconcileRegistryResult>;
@@ -9,12 +9,15 @@ export declare function isBasicSkillName(name: string): boolean;
9
9
  export declare function findExtensionSkillPath(name: string): string | null;
10
10
  /**
11
11
  * Load the full registry: official skills merged with a configured private
12
- * extension checkout and global custom skills from ~/.hasna/skills/installed/<name>/
13
- * (plus the legacy ~/.hasna/skills/custom/<name>/ migration safety net).
12
+ * extension checkout and global custom skills from the canonical local corpus
13
+ * <app folder>/installed/<name>/ before the owner-layout migration, <app
14
+ * folder>/skills/<name>/ after it (resolveCorpusRoot(), the one resolution
15
+ * every discovery path shares) — plus the legacy ~/.hasna/skills/custom/<name>/
16
+ * migration safety net.
14
17
  *
15
18
  * Custom skills take precedence over extensions, which take precedence over
16
- * official skills. Extension skills are read in place and never copied into installed/.
17
- * Results are cached for 5 seconds.
19
+ * official skills. Extension skills are read in place and never copied into the
20
+ * corpus. Results are cached for 5 seconds.
18
21
  */
19
22
  export declare function loadRegistry(cwd?: string): SkillMeta[];
20
23
  export declare function loadBasicRegistry(cwd?: string): SkillMeta[];
@@ -1,12 +1,83 @@
1
1
  import { type RemoteSkillRunContract } from "./remote-run-contract.js";
2
+ /**
3
+ * A server that predates this client's pin/tag/incremental-sync routes answered
4
+ * 404/405 for them. The caller must never mistake that for "no pins" or "empty
5
+ * listing" — a silently-empty sync would look like success and drop nothing on
6
+ * the next push. This error is how the version-skew surfaces fail-closed.
7
+ */
8
+ export declare class RemoteRouteUnsupportedError extends Error {
9
+ readonly path: string;
10
+ readonly status: number;
11
+ readonly instance: string;
12
+ constructor(path: string, status: number, instance: string);
13
+ }
14
+ /** Any other non-ok response on the new-route methods, with the status attached. */
15
+ export declare class RemoteRequestError extends Error {
16
+ readonly path: string;
17
+ readonly status: number;
18
+ constructor(path: string, status: number, statusText: string);
19
+ }
20
+ /**
21
+ * A remote pin on a skill, matching the hosted-pins wire shape
22
+ * (`{ slug, pinnedAt, metadata }`). `pinnedAt`/`metadata` are server-reported
23
+ * and may be absent.
24
+ */
25
+ export interface RemotePin {
26
+ slug: string;
27
+ pinnedAt?: string;
28
+ metadata?: Record<string, unknown>;
29
+ }
30
+ /** The minimal per-skill row the pin/tag/updated-since routes serve. */
31
+ export interface RemoteSkillSummary {
32
+ slug: string;
33
+ name?: string;
34
+ version?: string;
35
+ updatedAt?: string;
36
+ }
37
+ /**
38
+ * One page of an incremental listing. `nextCursor` is an opaque continuation
39
+ * token; null (or an absent field) means the listing is complete.
40
+ */
41
+ export interface UpdatedSincePage {
42
+ skills: RemoteSkillSummary[];
43
+ nextCursor: string | null;
44
+ }
2
45
  export declare class RemoteSkillsClient {
3
46
  private apiUrl;
4
47
  private apiKey;
5
48
  constructor(apiKey: string, apiUrl?: string);
6
49
  private request;
50
+ /**
51
+ * Fail-closed version-skew guard for the pin/tag/updated-since routes.
52
+ *
53
+ * A server that predates these routes answers 404 (unmatched path) or 405
54
+ * (unmatched method). Both are surfaced as `RemoteRouteUnsupportedError` —
55
+ * never as an empty listing, which would read as "no pins / no changes" and
56
+ * silently desynchronize the caller. Every other non-ok response becomes a
57
+ * `RemoteRequestError` carrying the status.
58
+ *
59
+ * `domainNotFoundCodes` is the one deliberate exception: a route the server
60
+ * DOES have can 404 for a domain reason (the hosted-pins DELETE answers
61
+ * `{ code: "PIN_NOT_FOUND" }` when no pin exists). A 404 whose JSON body
62
+ * carries one of those codes is returned to the caller (status intact) so it
63
+ * can apply domain semantics instead of misreporting version skew. Every
64
+ * other 404 — including the dispatcher's `{ code: "NOT_FOUND" }` on a route
65
+ * the server lacks — still throws `RemoteRouteUnsupportedError`.
66
+ */
67
+ private requestNewRoute;
7
68
  listSkills(): Promise<any[]>;
8
69
  getSkillMd(slug: string): Promise<string | null>;
9
70
  getSkill(slug: string): Promise<any | null>;
71
+ /**
72
+ * Raw GET for one skill, with the HTTP status surfaced. Used by the reconcile
73
+ * re-check (registry-reconcile.ts) so it can distinguish "no such skill" (404) from
74
+ * "the registry failed to answer" (any other non-success status) instead of treating
75
+ * both as absent.
76
+ */
77
+ getSkillStatus(slug: string): Promise<{
78
+ status: number;
79
+ body: unknown;
80
+ }>;
10
81
  submitRun(slug: string, input?: Record<string, unknown>, args?: string[]): Promise<RemoteSkillRunContract>;
11
82
  getRun(runId: string): Promise<RemoteSkillRunContract | null>;
12
83
  getRunLogs(runId: string): Promise<any[]>;
@@ -24,9 +95,61 @@ export declare class RemoteSkillsClient {
24
95
  * Note the deliberate absence of `request()`: that helper pins
25
96
  * `Content-Type: application/json`, and a multipart body whose Content-Type does not
26
97
  * carry the generated boundary is unparseable at the other end.
98
+ *
99
+ * Optimistic concurrency (todos d061fcda): pass the revision id this client last read
100
+ * for the slug (from getSkill().revisionId) as `ifMatch`. The instance refuses a
101
+ * publish against a live slug that does not name its current revision with 409 — this
102
+ * is how a push never silently overwrites a newer remote revision.
27
103
  */
28
- publishSkill(manifest: Record<string, unknown>, bundle?: Uint8Array): Promise<Response>;
104
+ publishSkill(manifest: Record<string, unknown>, bundle?: Uint8Array, ifMatch?: string): Promise<Response>;
29
105
  deleteSkill(slug: string): Promise<Response>;
30
106
  downloadSkillBundle(slug: string): Promise<Response>;
107
+ /**
108
+ * Bundle fetch for the verified-pull path. Returns the raw Response so the caller can
109
+ * read the X-Skill-Bundle-Sha256 / X-Skill-Bundle-Signature headers, or null when the
110
+ * instance serves no bundle for this skill (the metadata-only fallback path).
111
+ */
112
+ getBundle(slug: string): Promise<Response | null>;
113
+ /** List the pins the instance holds for this principal. */
114
+ listPins(): Promise<RemotePin[]>;
115
+ /**
116
+ * Pin a skill on the instance (upsert — pinning again refreshes it). The
117
+ * wire contract matches the hosted-pins routes: a PUT with an optional
118
+ * `{ metadata }` body, answered with the stored pin (`slug`, `pinnedAt`,
119
+ * `metadata`).
120
+ */
121
+ pin(slug: string, metadata?: Record<string, unknown>): Promise<RemotePin>;
122
+ /**
123
+ * Unpin a skill on the instance. Resolves true when a pin existed and was
124
+ * deleted; false when the instance has no pin for this slug (its 404
125
+ * carries `code: "PIN_NOT_FOUND"` — a domain answer, not version skew). A
126
+ * bare 404 (route not deployed) still throws `RemoteRouteUnsupportedError`.
127
+ */
128
+ unpin(slug: string): Promise<boolean>;
129
+ /** List the tag names the instance serves. */
130
+ listTags(): Promise<string[]>;
131
+ /** List the skills carrying a tag on the instance. */
132
+ skillsByTag(tag: string): Promise<RemoteSkillSummary[]>;
133
+ /**
134
+ * Cursor-based incremental listing of skills updated after `since` (ISO 8601).
135
+ * Each page carries an opaque `nextCursor`; null means the listing is complete.
136
+ * This is the feed T9's sync reconciliation verb consumes.
137
+ */
138
+ listUpdatedSince(since: string, options?: {
139
+ cursor?: string;
140
+ limit?: number;
141
+ }): Promise<UpdatedSincePage>;
31
142
  }
32
143
  export declare function createRemoteSkillsClient(): RemoteSkillsClient | null;
144
+ /**
145
+ * Write-free client resolution for read-only paths (e.g. `sync --dry-run`).
146
+ *
147
+ * createRemoteSkillsClient() resolves the stored credential through
148
+ * getAuthFilePath() and the stored origin through loadConfig() — both route
149
+ * through getDataDir(), which WRITES (mkdirs the app dir, merges legacy ~/.skills
150
+ * content, copies the legacy config). A dry run must resolve the same client a
151
+ * real run would without performing any of that: the credential and the origin
152
+ * are read from the same files at the same computed paths, and the MissingApiUrl
153
+ * failure mode is preserved (a key with no origin still fails loudly).
154
+ */
155
+ export declare function createRemoteSkillsClientReadOnly(): RemoteSkillsClient | null;
@@ -19,4 +19,30 @@ export declare function buildSkillsApiUrl(apiUrl: string, endpoint?: string): st
19
19
  export declare function parseRemoteRegistryPayload(payload: unknown): SkillMeta[];
20
20
  export declare function parseRemoteSkillPayload(payload: unknown): SkillMeta;
21
21
  export declare function loadRemoteRegistry(options?: RemoteRegistryOptions): Promise<SkillMeta[]>;
22
+ /**
23
+ * Merge the authenticated remote registry into a local listing, whenever the
24
+ * install is pointed at a hosted instance.
25
+ *
26
+ * This is the fail-closed (R1) default-read merge: a client configured with an
27
+ * origin sees the folder UNION cloud in the plain `list`/`search` path, while
28
+ * every other install keeps today's exact local behavior.
29
+ *
30
+ * - No origin configured -> the local list is returned unchanged and no
31
+ * request is attempted. An unconfigured install must stay byte-identical
32
+ * to the pre-merge output.
33
+ * - Origin configured but no credential -> the local list is returned
34
+ * unchanged and nothing throws. Auth-missing must never crash a read.
35
+ * - Origin + credential -> the remote registry is fetched and merged under
36
+ * the precedence in registry-merge.ts (custom > extension > private >
37
+ * private-hosted > remote > upstream > official), remote rows tagged
38
+ * `source: "remote"`.
39
+ * - A configured, authenticated read that FAILS (auth rejection, HTTP
40
+ * error, network failure) throws a clear error rather than silently
41
+ * returning the local half — a silent partial listing would report
42
+ * success for a union the caller asked to include.
43
+ *
44
+ * The explicit `--remote` path stays on loadRemoteRegistry(): an explicit
45
+ * request has always been fatal on failure, and that contract is unchanged.
46
+ */
47
+ export declare function mergeRemoteRegistry(local: SkillMeta[], options?: RemoteRegistryOptions): Promise<SkillMeta[]>;
22
48
  export declare function loadRemoteSkill(name: string, options?: RemoteRegistryOptions): Promise<SkillMeta>;
@@ -0,0 +1,29 @@
1
+ /** The row's content-addressed revision identity: a lowercase hex sha-256. */
2
+ export declare const REVISION_ID_PATTERN: RegExp;
3
+ export interface RevisionContent {
4
+ slug: string;
5
+ displayName: string;
6
+ description: string;
7
+ category: string;
8
+ tags: string[];
9
+ source: string;
10
+ kind: "executable" | "instruction";
11
+ version?: string;
12
+ skillMd?: string;
13
+ bundleSha256?: string;
14
+ bundleByteSize?: number;
15
+ }
16
+ export declare function revisionIdOf(content: RevisionContent): string;
17
+ export declare function revisionIdOfRecord(record: RevisionContent): string;
18
+ /**
19
+ * The legacy-row marker the 0004 migration leaves behind.
20
+ *
21
+ * Migration 0004 adds revision_id with DEFAULT '', so rows written before the migration
22
+ * carry an empty id. An empty id would make the If-Match guard vacuous for those rows:
23
+ * two clients that both read '' would both "match" and both land, silently overwriting
24
+ * each other. The stores replace the marker with a real content sha on first open
25
+ * (idempotent: new code always writes a full id, so the marker never reappears).
26
+ */
27
+ export declare const LEGACY_REVISION_ID = "";
28
+ /** True when a revision id is the empty legacy marker (needs backfill). */
29
+ export declare function isLegacyRevisionId(value: string): boolean;
@@ -19,6 +19,10 @@ export interface SkillRunRecord {
19
19
  args: string[];
20
20
  startedAt: string;
21
21
  completedAt?: string;
22
+ /** Exit code of the skill child process, when one was observed. */
23
+ exitCode?: number;
24
+ /** Wall time between startedAt and completedAt, in milliseconds. */
25
+ durationMs?: number;
22
26
  remote: boolean;
23
27
  remoteRunId?: string;
24
28
  costCents?: number;
@@ -51,6 +55,7 @@ export declare function completeSkillRun(context: SkillRunContext, patch: {
51
55
  error?: string;
52
56
  remoteRunId?: string;
53
57
  costCents?: number;
58
+ exitCode?: number;
54
59
  }): SkillRunRecord;
55
60
  export declare function updateSkillRun(context: SkillRunContext, patch: Partial<SkillRunRecord>): SkillRunRecord;
56
61
  export declare function writeRunLogs(context: SkillRunContext, stdout?: string, stderr?: string): void;
@@ -0,0 +1,54 @@
1
+ import { type PackedSkillBundle } from "./skill-bundle.js";
2
+ /** Environment variable holding the HMAC signing key. Never logged, never printed. */
3
+ export declare const SKILLS_SIGNING_KEY_ENV = "SKILLS_SIGNING_KEY";
4
+ /** Environment variable naming the source commit the bundle was built from. */
5
+ export declare const SKILLS_SOURCE_COMMIT_ENV = "SKILLS_SOURCE_COMMIT";
6
+ /** Prefix of the signature string. The remainder is lowercase hex. */
7
+ export declare const SIGNATURE_PREFIX = "hmac-sha256:";
8
+ export interface SkillBundleManifest {
9
+ name: string;
10
+ version: string;
11
+ source_commit: string;
12
+ /** Canonical sha256 of the bundle bytes (the skill's content address). */
13
+ content_hash: string;
14
+ /** `hmac-sha256:<hex>` over the bundle bytes. Omitted when no key is available. */
15
+ signature?: string;
16
+ published_at: string;
17
+ }
18
+ export interface BuildSkillBundleOptions {
19
+ name: string;
20
+ /** The skill directory to pack. */
21
+ dir: string;
22
+ version: string;
23
+ /** Source commit the skill came from. `unknown` when the provenance is unavailable. */
24
+ sourceCommit: string;
25
+ /** Signing key. Defaults to reading process.env[SKILLS_SIGNING_KEY_ENV]. */
26
+ signingKey?: string;
27
+ /** Explicit published_at. Defaults to now. Tests only. */
28
+ publishedAt?: string;
29
+ }
30
+ export interface BuiltSkillBundle {
31
+ bundle: PackedSkillBundle;
32
+ manifest: SkillBundleManifest;
33
+ }
34
+ /**
35
+ * Resolve the signing key from the environment. Returns null when unset, and the
36
+ * caller decides how to behave (omit the signature, warn, or refuse) — this function
37
+ * never touches stdout, so nothing about the key can leak through it.
38
+ */
39
+ export declare function resolveSigningKey(env?: Record<string, string | undefined>): string | null;
40
+ /** Sign canonical bundle bytes with an HMAC key. Returns `hmac-sha256:<hex>`. */
41
+ export declare function signBundleBytes(bytes: Uint8Array, key: string): string;
42
+ /**
43
+ * Verify a signature string against bundle bytes and a key. Returns true only for a
44
+ * well-formed `hmac-sha256:<hex>` signature computed over exactly these bytes.
45
+ * timingSafeEqual keeps the comparison from leaking a byte-at-a-time signal; the
46
+ * length check is a format check (a hex digest is a fixed length), not a leak.
47
+ */
48
+ export declare function verifyBundleSignature(bytes: Uint8Array, signature: string, key: string): boolean;
49
+ /**
50
+ * Pack a skill directory and build its signed manifest in one call — the unit the CI
51
+ * bundle script, push, and pull all share, so a bundle built by CI and one pushed by
52
+ * a machine agree on the canonical content_hash by construction.
53
+ */
54
+ export declare function buildSkillBundle(options: BuildSkillBundleOptions): BuiltSkillBundle;
@@ -0,0 +1,35 @@
1
+ import { type PortableSkillManifest } from "./portable-skills-types.js";
2
+ import type { SkillValidationMessage } from "./skill-validation.js";
3
+ /**
4
+ * Field-level validator implementing the hasna.skill.v1 JSON Schema
5
+ * (schemas/skill.schema.json). Checks the portable manifest against the
6
+ * contract and verifies the self-referencing content_hash when a skill
7
+ * folder is available. Returns exact field errors with `contract.*` codes.
8
+ *
9
+ * The parity test (skill-contract.test.ts) asserts this validator and the
10
+ * schema file agree on required fields, runtime/sandbox enums, and the
11
+ * system-deps allowlist, so the two cannot drift apart silently.
12
+ */
13
+ export declare const SEMVER_PATTERN = "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$";
14
+ export declare const CONTENT_HASH_PATTERN = "^[a-f0-9]{64}$";
15
+ export declare const ENV_REFERENCE_PATTERN = "^[A-Z0-9_]+$";
16
+ export declare const MAX_RUNTIME_TIMEOUT_SECONDS = 900;
17
+ export declare const DEFAULT_RUNTIME_TIMEOUT_SECONDS = 900;
18
+ export interface PortableContractOptions {
19
+ /**
20
+ * Whether the manifest is the full portable contract (a skill.json exists).
21
+ * When true, the runtime contract and content_hash are required; a manifest
22
+ * present without its integrity field is not portable. SKILL.md-only legacy
23
+ * skills stay under the relaxed rule.
24
+ */
25
+ strict?: boolean;
26
+ /** Skill folder for content_hash verification. */
27
+ skillPath?: string;
28
+ }
29
+ /**
30
+ * Validate the portable manifest against the hasna.skill.v1 contract.
31
+ * Returns issues only; callers combine with existing directory validation.
32
+ */
33
+ export declare function validatePortableManifestContract(manifest: PortableSkillManifest | undefined, options?: PortableContractOptions): SkillValidationMessage[];
34
+ /** Read a skill.json from disk and parse it, tolerating absence. */
35
+ export declare function readRawSkillJson(skillPath: string): Record<string, unknown> | undefined;
@@ -0,0 +1,77 @@
1
+ import type { PortableSkillManifest } from "./portable-skills-types.js";
2
+ /**
3
+ * Canonical content hashing for the hasna.skill.v1 portable bundle.
4
+ *
5
+ * The hash covers the normalized skill bundle: skill.json (blank-canonicalized —
6
+ * its own `content_hash` field removed, keys sorted, line endings normalized)
7
+ * plus SKILL.md and every file under src/, scripts/, assets/, and references/,
8
+ * plus AGENTS.md, package.json, and tsconfig.json. Entries are sorted by
9
+ * relative path and hash-stable across platforms (posix separators, LF
10
+ * endings, sorted keys), so two checkouts of the same skill produce the same
11
+ * hash regardless of OS or editor.
12
+ *
13
+ * Excluded, mirroring the port/copy rules: node_modules, .git, dist, build,
14
+ * .turbo, dot-entries, and symlinks (symlinks are validation errors anyway).
15
+ */
16
+ export declare const CONTENT_HASH_ALGORITHM = "sha256";
17
+ export declare const CONTENT_HASH_HEX_LENGTH = 64;
18
+ /** Normalize CRLF/CR to LF for hash stability across platforms. */
19
+ export declare function normalizeLineEndings(content: string): string;
20
+ /**
21
+ * Blank-canonicalize a skill.json manifest for hashing: parse it, drop the
22
+ * self-referencing `content_hash` field, and re-serialize with sorted keys so
23
+ * key order and the hash's own presence never change the digest.
24
+ */
25
+ export declare function canonicalizeManifest(raw: string): string;
26
+ export interface BundleFile {
27
+ /** Posix relative path from the skill root, e.g. `scripts/setup.sh`. */
28
+ rel: string;
29
+ /** Normalized text content for text files; raw buffer for binary files. */
30
+ content: Uint8Array;
31
+ }
32
+ /**
33
+ * Collect the normalized bundle files for a skill folder, sorted by relative
34
+ * path. Only the documented coverage set is included.
35
+ */
36
+ export declare function collectBundleFiles(skillPath: string): BundleFile[];
37
+ /**
38
+ * Compute the canonical content hash of a skill folder. Stable across
39
+ * platforms: sorted posix paths, LF line endings, canonicalized manifest.
40
+ */
41
+ export declare function computeContentHash(skillPath: string): string;
42
+ export interface ContentHashVerification {
43
+ /** Whether the skill declares a content_hash at all. */
44
+ declared: boolean;
45
+ /** Whether the declared hash is present, well-formed, and matches the bundle. */
46
+ valid: boolean;
47
+ /** The declared value, if any. */
48
+ declaredHash?: string;
49
+ /** The recomputed hash over the current bundle. */
50
+ computedHash?: string;
51
+ }
52
+ /**
53
+ * Verify a skill folder's declared content_hash against the recomputed
54
+ * canonical hash of the current bundle. A missing declaration or a mismatch
55
+ * fails; a malformed declaration fails.
56
+ */
57
+ export declare function verifyContentHash(skillPath: string, manifest?: PortableSkillManifest): ContentHashVerification;
58
+ /** Path sanity helper used by the contract validator: the skill folder exists. */
59
+ export declare function skillFolderExists(skillPath: string): boolean;
60
+ /**
61
+ * Canonical SKILL.md document hash for home-vs-corpus comparison.
62
+ *
63
+ * The bundle-wide hash above covers a whole skill folder; agent home
64
+ * directories carry only a SKILL.md, so the home comparison hashes exactly
65
+ * that one document. The normalization is the canonical one: LF line endings
66
+ * (LF-invariant, so the same document hashes identically across platforms),
67
+ * with the single agent-adaptation delta removed — `user_invocable` frontmatter
68
+ * lines, which `sync` injects for Claude and strips for every other agent.
69
+ * Two copies that differ only in those two ways hash identically, so an
70
+ * unmarked home copy that matches the canonical SKILL.md modulo adaptation is
71
+ * recognised as an exact match.
72
+ */
73
+ export declare function canonicalAgentSkillMarkdown(content: string): string;
74
+ /** Canonical hash of a SKILL.md document (modulo LF endings and user_invocable). */
75
+ export declare function hashSkillMarkdown(content: string): string;
76
+ /** Canonical hash of the SKILL.md at `path`. */
77
+ export declare function hashSkillMarkdownFile(path: string): string;