@jinn-network/client 0.1.1 → 0.1.2-canary.6237288d

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 (424) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/CONTRIBUTING.md +123 -0
  3. package/README.md +213 -37
  4. package/deployments/deployment-claim-registry-baseSepolia.json +13 -0
  5. package/deployments/deployment-jinn-testnet-faucet-baseSepolia-fast.json +15 -0
  6. package/dist/adapters/adapter.d.ts +7 -0
  7. package/dist/adapters/claim-registry/abi.d.ts +127 -0
  8. package/dist/adapters/claim-registry/abi.js +93 -0
  9. package/dist/adapters/claim-registry/abi.js.map +1 -0
  10. package/dist/adapters/claim-registry/client.d.ts +89 -0
  11. package/dist/adapters/claim-registry/client.js +205 -0
  12. package/dist/adapters/claim-registry/client.js.map +1 -0
  13. package/dist/adapters/mech/adapter.d.ts +5 -0
  14. package/dist/adapters/mech/adapter.js +211 -56
  15. package/dist/adapters/mech/adapter.js.map +1 -1
  16. package/dist/adapters/mech/contracts.d.ts +19 -1
  17. package/dist/adapters/mech/contracts.js +112 -8
  18. package/dist/adapters/mech/contracts.js.map +1 -1
  19. package/dist/adapters/mech/ipfs.d.ts +38 -5
  20. package/dist/adapters/mech/ipfs.js +174 -17
  21. package/dist/adapters/mech/ipfs.js.map +1 -1
  22. package/dist/adapters/mech/safe.js +8 -6
  23. package/dist/adapters/mech/safe.js.map +1 -1
  24. package/dist/adapters/mech/types.d.ts +22 -46
  25. package/dist/adapters/mech/types.js +16 -35
  26. package/dist/adapters/mech/types.js.map +1 -1
  27. package/dist/api/balance-build.js +3 -3
  28. package/dist/api/balance-build.js.map +1 -1
  29. package/dist/api/fleet-build.js +35 -40
  30. package/dist/api/fleet-build.js.map +1 -1
  31. package/dist/api/gather-status.d.ts +6 -0
  32. package/dist/api/gather-status.js +187 -4
  33. package/dist/api/gather-status.js.map +1 -1
  34. package/dist/api/history-build.d.ts +5 -1
  35. package/dist/api/history-build.js +51 -26
  36. package/dist/api/history-build.js.map +1 -1
  37. package/dist/api/portfolio-v0-build.d.ts +83 -0
  38. package/dist/api/portfolio-v0-build.js +143 -0
  39. package/dist/api/portfolio-v0-build.js.map +1 -0
  40. package/dist/api/portfolio-v0-doctor.d.ts +37 -0
  41. package/dist/api/portfolio-v0-doctor.js +123 -0
  42. package/dist/api/portfolio-v0-doctor.js.map +1 -0
  43. package/dist/api/rewards-build.js +30 -14
  44. package/dist/api/rewards-build.js.map +1 -1
  45. package/dist/api/status-build.d.ts +39 -6
  46. package/dist/api/status-build.js +3 -1
  47. package/dist/api/status-build.js.map +1 -1
  48. package/dist/api/status-rollup-build.d.ts +2 -0
  49. package/dist/api/status-rollup-build.js +30 -3
  50. package/dist/api/status-rollup-build.js.map +1 -1
  51. package/dist/bin/jinn-mcp.d.ts +0 -12
  52. package/dist/bin/jinn-mcp.js +5 -14
  53. package/dist/bin/jinn-mcp.js.map +1 -1
  54. package/dist/build-meta.json +1 -1
  55. package/dist/cli/commands/auth.js +137 -25
  56. package/dist/cli/commands/auth.js.map +1 -1
  57. package/dist/cli/commands/balance.js +8 -1
  58. package/dist/cli/commands/balance.js.map +1 -1
  59. package/dist/cli/commands/bootstrap.js +23 -0
  60. package/dist/cli/commands/bootstrap.js.map +1 -1
  61. package/dist/cli/commands/doctor.js +160 -14
  62. package/dist/cli/commands/doctor.js.map +1 -1
  63. package/dist/cli/commands/fleet-scale.js +1 -0
  64. package/dist/cli/commands/fleet-scale.js.map +1 -1
  65. package/dist/cli/commands/fleet.js +10 -1
  66. package/dist/cli/commands/fleet.js.map +1 -1
  67. package/dist/cli/commands/fund-requirements.js +2 -0
  68. package/dist/cli/commands/fund-requirements.js.map +1 -1
  69. package/dist/cli/commands/history.js +25 -6
  70. package/dist/cli/commands/history.js.map +1 -1
  71. package/dist/cli/commands/intents.d.ts +17 -0
  72. package/dist/cli/commands/intents.js +489 -0
  73. package/dist/cli/commands/intents.js.map +1 -0
  74. package/dist/cli/commands/keys-backup.js +13 -11
  75. package/dist/cli/commands/keys-backup.js.map +1 -1
  76. package/dist/cli/commands/logs.js +35 -11
  77. package/dist/cli/commands/logs.js.map +1 -1
  78. package/dist/cli/commands/mcp.d.ts +3 -0
  79. package/dist/cli/commands/mcp.js +19 -0
  80. package/dist/cli/commands/mcp.js.map +1 -0
  81. package/dist/cli/commands/plugin-install.js +8 -4
  82. package/dist/cli/commands/plugin-install.js.map +1 -1
  83. package/dist/cli/commands/quickstart.js +99 -5
  84. package/dist/cli/commands/quickstart.js.map +1 -1
  85. package/dist/cli/commands/rewards.js +27 -1
  86. package/dist/cli/commands/rewards.js.map +1 -1
  87. package/dist/cli/commands/run.js +38 -0
  88. package/dist/cli/commands/run.js.map +1 -1
  89. package/dist/cli/commands/status.js +11 -1
  90. package/dist/cli/commands/status.js.map +1 -1
  91. package/dist/cli/commands/submit-intent.js +110 -44
  92. package/dist/cli/commands/submit-intent.js.map +1 -1
  93. package/dist/cli/commands/version.js +1 -0
  94. package/dist/cli/commands/version.js.map +1 -1
  95. package/dist/cli/deployment-digest.js +5 -0
  96. package/dist/cli/deployment-digest.js.map +1 -1
  97. package/dist/cli/execution-context.js +1 -0
  98. package/dist/cli/execution-context.js.map +1 -1
  99. package/dist/cli/index.js +4 -0
  100. package/dist/cli/index.js.map +1 -1
  101. package/dist/cli/intent-registry-access.d.ts +62 -0
  102. package/dist/cli/intent-registry-access.js +165 -0
  103. package/dist/cli/intent-registry-access.js.map +1 -0
  104. package/dist/cli/introspection-context.js +12 -8
  105. package/dist/cli/introspection-context.js.map +1 -1
  106. package/dist/cli/password.d.ts +21 -9
  107. package/dist/cli/password.js +45 -24
  108. package/dist/cli/password.js.map +1 -1
  109. package/dist/config.d.ts +137 -8
  110. package/dist/config.js +70 -12
  111. package/dist/config.js.map +1 -1
  112. package/dist/daemon/balance-topup-loop.js +32 -4
  113. package/dist/daemon/balance-topup-loop.js.map +1 -1
  114. package/dist/daemon/creator.d.ts +7 -4
  115. package/dist/daemon/creator.js +55 -26
  116. package/dist/daemon/creator.js.map +1 -1
  117. package/dist/daemon/daemon.d.ts +35 -3
  118. package/dist/daemon/daemon.js +99 -7
  119. package/dist/daemon/daemon.js.map +1 -1
  120. package/dist/daemon/delivery-watcher.d.ts +3 -1
  121. package/dist/daemon/delivery-watcher.js +19 -1
  122. package/dist/daemon/delivery-watcher.js.map +1 -1
  123. package/dist/daemon/reward-claim-loop.js +38 -1
  124. package/dist/daemon/reward-claim-loop.js.map +1 -1
  125. package/dist/dashboard/index.html +71 -496
  126. package/dist/discovery/registry.d.ts +54 -0
  127. package/dist/discovery/registry.js +73 -0
  128. package/dist/discovery/registry.js.map +1 -1
  129. package/dist/earning/bootstrap.d.ts +2 -1
  130. package/dist/earning/bootstrap.js +71 -33
  131. package/dist/earning/bootstrap.js.map +1 -1
  132. package/dist/earning/contracts.d.ts +10 -0
  133. package/dist/earning/contracts.js +24 -0
  134. package/dist/earning/contracts.js.map +1 -1
  135. package/dist/earning/jinn-rewards.d.ts +9 -0
  136. package/dist/earning/jinn-rewards.js +7 -0
  137. package/dist/earning/jinn-rewards.js.map +1 -1
  138. package/dist/earning/stolas-claim.d.ts +6 -0
  139. package/dist/earning/stolas-claim.js +7 -0
  140. package/dist/earning/stolas-claim.js.map +1 -1
  141. package/dist/intents/kinds/constants.d.ts +5 -0
  142. package/dist/intents/kinds/constants.js +6 -0
  143. package/dist/intents/kinds/constants.js.map +1 -0
  144. package/dist/intents/kinds/index.d.ts +28 -0
  145. package/dist/intents/kinds/index.js +50 -0
  146. package/dist/intents/kinds/index.js.map +1 -0
  147. package/dist/intents/kinds/portfolio-v0.d.ts +2 -0
  148. package/dist/intents/kinds/portfolio-v0.js +13 -0
  149. package/dist/intents/kinds/portfolio-v0.js.map +1 -0
  150. package/dist/intents/kinds/prediction-apy-v0.d.ts +3 -0
  151. package/dist/intents/kinds/prediction-apy-v0.js +21 -0
  152. package/dist/intents/kinds/prediction-apy-v0.js.map +1 -0
  153. package/dist/intents/kinds/prediction-v0.d.ts +3 -0
  154. package/dist/intents/kinds/prediction-v0.js +32 -0
  155. package/dist/intents/kinds/prediction-v0.js.map +1 -0
  156. package/dist/intents/kinds/spec-kind.d.ts +38 -0
  157. package/dist/intents/kinds/spec-kind.js +6 -0
  158. package/dist/intents/kinds/spec-kind.js.map +1 -0
  159. package/dist/intents/posting-service.d.ts +26 -0
  160. package/dist/intents/posting-service.js +218 -0
  161. package/dist/intents/posting-service.js.map +1 -0
  162. package/dist/intents/prediction-apy-v0-auto.d.ts +11 -0
  163. package/dist/intents/prediction-apy-v0-auto.js +46 -0
  164. package/dist/intents/prediction-apy-v0-auto.js.map +1 -0
  165. package/dist/intents/prediction-apy-v0-template.d.ts +8 -0
  166. package/dist/intents/prediction-apy-v0-template.js +22 -0
  167. package/dist/intents/prediction-apy-v0-template.js.map +1 -0
  168. package/dist/intents/prediction-v0-auto.d.ts +53 -0
  169. package/dist/intents/prediction-v0-auto.js +84 -0
  170. package/dist/intents/prediction-v0-auto.js.map +1 -0
  171. package/dist/intents/prediction-v0-template.d.ts +70 -0
  172. package/dist/intents/prediction-v0-template.js +145 -0
  173. package/dist/intents/prediction-v0-template.js.map +1 -0
  174. package/dist/intents/sources.d.ts +39 -0
  175. package/dist/intents/sources.js +42 -0
  176. package/dist/intents/sources.js.map +1 -0
  177. package/dist/main.js +175 -3
  178. package/dist/main.js.map +1 -1
  179. package/dist/mcp/operator-server.d.ts +1 -1
  180. package/dist/mcp/operator-server.js +1 -1
  181. package/dist/mcp/server.js +8 -4
  182. package/dist/mcp/server.js.map +1 -1
  183. package/dist/observability/emit-event.d.ts +12 -0
  184. package/dist/observability/emit-event.js +27 -0
  185. package/dist/observability/emit-event.js.map +1 -0
  186. package/dist/preflight/api-port.d.ts +13 -0
  187. package/dist/preflight/api-port.js +32 -0
  188. package/dist/preflight/api-port.js.map +1 -0
  189. package/dist/preflight/claude-auth.d.ts +12 -1
  190. package/dist/preflight/claude-auth.js +21 -3
  191. package/dist/preflight/claude-auth.js.map +1 -1
  192. package/dist/preflight/rpc-network.d.ts +44 -0
  193. package/dist/preflight/rpc-network.js +121 -0
  194. package/dist/preflight/rpc-network.js.map +1 -0
  195. package/dist/restorer/engine/canonical-json.d.ts +18 -0
  196. package/dist/restorer/engine/canonical-json.js +59 -0
  197. package/dist/restorer/engine/canonical-json.js.map +1 -0
  198. package/dist/restorer/engine/claim.d.ts +69 -0
  199. package/dist/restorer/engine/claim.js +104 -0
  200. package/dist/restorer/engine/claim.js.map +1 -0
  201. package/dist/restorer/engine/delivery.d.ts +52 -0
  202. package/dist/restorer/engine/delivery.js +63 -0
  203. package/dist/restorer/engine/delivery.js.map +1 -0
  204. package/dist/restorer/engine/engine.d.ts +213 -0
  205. package/dist/restorer/engine/engine.js +769 -0
  206. package/dist/restorer/engine/engine.js.map +1 -0
  207. package/dist/restorer/engine/manifest-assembly.d.ts +67 -0
  208. package/dist/restorer/engine/manifest-assembly.js +79 -0
  209. package/dist/restorer/engine/manifest-assembly.js.map +1 -0
  210. package/dist/restorer/engine/packaging.d.ts +87 -0
  211. package/dist/restorer/engine/packaging.js +350 -0
  212. package/dist/restorer/engine/packaging.js.map +1 -0
  213. package/dist/restorer/engine/persistence.d.ts +170 -0
  214. package/dist/restorer/engine/persistence.js +381 -0
  215. package/dist/restorer/engine/persistence.js.map +1 -0
  216. package/dist/restorer/engine/recovery.d.ts +22 -0
  217. package/dist/restorer/engine/recovery.js +24 -0
  218. package/dist/restorer/engine/recovery.js.map +1 -0
  219. package/dist/restorer/engine/registry.d.ts +62 -0
  220. package/dist/restorer/engine/registry.js +73 -0
  221. package/dist/restorer/engine/registry.js.map +1 -0
  222. package/dist/restorer/engine/signing.d.ts +30 -0
  223. package/dist/restorer/engine/signing.js +39 -0
  224. package/dist/restorer/engine/signing.js.map +1 -0
  225. package/dist/restorer/engine/state.d.ts +42 -0
  226. package/dist/restorer/engine/state.js +87 -0
  227. package/dist/restorer/engine/state.js.map +1 -0
  228. package/dist/restorer/impls/claude-mcp-hyperliquid/api-wallet.d.ts +64 -0
  229. package/dist/restorer/impls/claude-mcp-hyperliquid/api-wallet.js +96 -0
  230. package/dist/restorer/impls/claude-mcp-hyperliquid/api-wallet.js.map +1 -0
  231. package/dist/restorer/impls/claude-mcp-hyperliquid/index.d.ts +104 -0
  232. package/dist/restorer/impls/claude-mcp-hyperliquid/index.js +721 -0
  233. package/dist/restorer/impls/claude-mcp-hyperliquid/index.js.map +1 -0
  234. package/dist/restorer/impls/claude-mcp-hyperliquid/mcp-tools.d.ts +137 -0
  235. package/dist/restorer/impls/claude-mcp-hyperliquid/mcp-tools.js +865 -0
  236. package/dist/restorer/impls/claude-mcp-hyperliquid/mcp-tools.js.map +1 -0
  237. package/dist/restorer/impls/claude-mcp-hyperliquid/safety-rails.d.ts +74 -0
  238. package/dist/restorer/impls/claude-mcp-hyperliquid/safety-rails.js +74 -0
  239. package/dist/restorer/impls/claude-mcp-hyperliquid/safety-rails.js.map +1 -0
  240. package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.d.ts +97 -0
  241. package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js +226 -0
  242. package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js.map +1 -0
  243. package/dist/restorer/impls/claude-mcp-prediction/index.d.ts +44 -0
  244. package/dist/restorer/impls/claude-mcp-prediction/index.js +239 -0
  245. package/dist/restorer/impls/claude-mcp-prediction/index.js.map +1 -0
  246. package/dist/restorer/impls/claude-mcp-prediction/mcp-tools.d.ts +38 -0
  247. package/dist/restorer/impls/claude-mcp-prediction/mcp-tools.js +135 -0
  248. package/dist/restorer/impls/claude-mcp-prediction/mcp-tools.js.map +1 -0
  249. package/dist/restorer/impls/claude-mcp-prediction/prompt.d.ts +8 -0
  250. package/dist/restorer/impls/claude-mcp-prediction/prompt.js +54 -0
  251. package/dist/restorer/impls/claude-mcp-prediction/prompt.js.map +1 -0
  252. package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.d.ts +36 -0
  253. package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js +137 -0
  254. package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js.map +1 -0
  255. package/dist/restorer/impls/claude-mcp-prediction/types.d.ts +84 -0
  256. package/dist/restorer/impls/claude-mcp-prediction/types.js +6 -0
  257. package/dist/restorer/impls/claude-mcp-prediction/types.js.map +1 -0
  258. package/dist/restorer/impls/claude-mcp-prediction-apy/index.d.ts +34 -0
  259. package/dist/restorer/impls/claude-mcp-prediction-apy/index.js +233 -0
  260. package/dist/restorer/impls/claude-mcp-prediction-apy/index.js.map +1 -0
  261. package/dist/restorer/impls/claude-mcp-prediction-apy/mcp-tools.d.ts +18 -0
  262. package/dist/restorer/impls/claude-mcp-prediction-apy/mcp-tools.js +136 -0
  263. package/dist/restorer/impls/claude-mcp-prediction-apy/mcp-tools.js.map +1 -0
  264. package/dist/restorer/impls/claude-mcp-prediction-apy/prompt.d.ts +7 -0
  265. package/dist/restorer/impls/claude-mcp-prediction-apy/prompt.js +46 -0
  266. package/dist/restorer/impls/claude-mcp-prediction-apy/prompt.js.map +1 -0
  267. package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.d.ts +27 -0
  268. package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.js +128 -0
  269. package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.js.map +1 -0
  270. package/dist/restorer/impls/claude-mcp-prediction-apy/types.d.ts +64 -0
  271. package/dist/restorer/impls/claude-mcp-prediction-apy/types.js +6 -0
  272. package/dist/restorer/impls/claude-mcp-prediction-apy/types.js.map +1 -0
  273. package/dist/restorer/impls/evaluation-context.d.ts +16 -0
  274. package/dist/restorer/impls/evaluation-context.js +18 -0
  275. package/dist/restorer/impls/evaluation-context.js.map +1 -0
  276. package/dist/restorer/impls/index.d.ts +46 -0
  277. package/dist/restorer/impls/index.js +88 -0
  278. package/dist/restorer/impls/index.js.map +1 -0
  279. package/dist/restorer/impls/legacy-claude/index.d.ts +52 -0
  280. package/dist/restorer/impls/legacy-claude/index.js +140 -0
  281. package/dist/restorer/impls/legacy-claude/index.js.map +1 -0
  282. package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.d.ts +68 -0
  283. package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.js +117 -0
  284. package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.js.map +1 -0
  285. package/dist/restorer/impls/portfolio-v0-evaluator/checks/availability.d.ts +49 -0
  286. package/dist/restorer/impls/portfolio-v0-evaluator/checks/availability.js +91 -0
  287. package/dist/restorer/impls/portfolio-v0-evaluator/checks/availability.js.map +1 -0
  288. package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.d.ts +78 -0
  289. package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.js +274 -0
  290. package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.js.map +1 -0
  291. package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.d.ts +23 -0
  292. package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.js +49 -0
  293. package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.js.map +1 -0
  294. package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.d.ts +25 -0
  295. package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.js +44 -0
  296. package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.js.map +1 -0
  297. package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.d.ts +17 -0
  298. package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.js +43 -0
  299. package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.js.map +1 -0
  300. package/dist/restorer/impls/portfolio-v0-evaluator/index.d.ts +44 -0
  301. package/dist/restorer/impls/portfolio-v0-evaluator/index.js +440 -0
  302. package/dist/restorer/impls/portfolio-v0-evaluator/index.js.map +1 -0
  303. package/dist/restorer/impls/portfolio-v0-evaluator/score.d.ts +21 -0
  304. package/dist/restorer/impls/portfolio-v0-evaluator/score.js +32 -0
  305. package/dist/restorer/impls/portfolio-v0-evaluator/score.js.map +1 -0
  306. package/dist/restorer/impls/portfolio-v0-evaluator/types.d.ts +34 -0
  307. package/dist/restorer/impls/portfolio-v0-evaluator/types.js +8 -0
  308. package/dist/restorer/impls/portfolio-v0-evaluator/types.js.map +1 -0
  309. package/dist/restorer/impls/prediction-apy-v0-baseline/index.d.ts +40 -0
  310. package/dist/restorer/impls/prediction-apy-v0-baseline/index.js +107 -0
  311. package/dist/restorer/impls/prediction-apy-v0-baseline/index.js.map +1 -0
  312. package/dist/restorer/impls/prediction-apy-v0-baseline/strategy.d.ts +2 -0
  313. package/dist/restorer/impls/prediction-apy-v0-baseline/strategy.js +7 -0
  314. package/dist/restorer/impls/prediction-apy-v0-baseline/strategy.js.map +1 -0
  315. package/dist/restorer/impls/prediction-apy-v0-baseline/types.d.ts +4 -0
  316. package/dist/restorer/impls/prediction-apy-v0-baseline/types.js +2 -0
  317. package/dist/restorer/impls/prediction-apy-v0-baseline/types.js.map +1 -0
  318. package/dist/restorer/impls/prediction-apy-v0-evaluator/canonical-metrics.d.ts +6 -0
  319. package/dist/restorer/impls/prediction-apy-v0-evaluator/canonical-metrics.js +11 -0
  320. package/dist/restorer/impls/prediction-apy-v0-evaluator/canonical-metrics.js.map +1 -0
  321. package/dist/restorer/impls/prediction-apy-v0-evaluator/index.d.ts +42 -0
  322. package/dist/restorer/impls/prediction-apy-v0-evaluator/index.js +208 -0
  323. package/dist/restorer/impls/prediction-apy-v0-evaluator/index.js.map +1 -0
  324. package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.d.ts +7 -0
  325. package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.js +29 -0
  326. package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.js.map +1 -0
  327. package/dist/restorer/impls/prediction-apy-v0-evaluator/score.d.ts +9 -0
  328. package/dist/restorer/impls/prediction-apy-v0-evaluator/score.js +20 -0
  329. package/dist/restorer/impls/prediction-apy-v0-evaluator/score.js.map +1 -0
  330. package/dist/restorer/impls/prediction-apy-v0-evaluator/types.d.ts +7 -0
  331. package/dist/restorer/impls/prediction-apy-v0-evaluator/types.js +2 -0
  332. package/dist/restorer/impls/prediction-apy-v0-evaluator/types.js.map +1 -0
  333. package/dist/restorer/impls/prediction-v0-baseline/index.d.ts +31 -0
  334. package/dist/restorer/impls/prediction-v0-baseline/index.js +100 -0
  335. package/dist/restorer/impls/prediction-v0-baseline/index.js.map +1 -0
  336. package/dist/restorer/impls/prediction-v0-baseline/strategy.d.ts +8 -0
  337. package/dist/restorer/impls/prediction-v0-baseline/strategy.js +41 -0
  338. package/dist/restorer/impls/prediction-v0-baseline/strategy.js.map +1 -0
  339. package/dist/restorer/impls/prediction-v0-baseline/types.d.ts +7 -0
  340. package/dist/restorer/impls/prediction-v0-baseline/types.js +2 -0
  341. package/dist/restorer/impls/prediction-v0-baseline/types.js.map +1 -0
  342. package/dist/restorer/impls/prediction-v0-evaluator/canonical-metrics.d.ts +20 -0
  343. package/dist/restorer/impls/prediction-v0-evaluator/canonical-metrics.js +66 -0
  344. package/dist/restorer/impls/prediction-v0-evaluator/canonical-metrics.js.map +1 -0
  345. package/dist/restorer/impls/prediction-v0-evaluator/checks/availability.d.ts +9 -0
  346. package/dist/restorer/impls/prediction-v0-evaluator/checks/availability.js +23 -0
  347. package/dist/restorer/impls/prediction-v0-evaluator/checks/availability.js.map +1 -0
  348. package/dist/restorer/impls/prediction-v0-evaluator/checks/eligibility.d.ts +3 -0
  349. package/dist/restorer/impls/prediction-v0-evaluator/checks/eligibility.js +13 -0
  350. package/dist/restorer/impls/prediction-v0-evaluator/checks/eligibility.js.map +1 -0
  351. package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.d.ts +13 -0
  352. package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.js +111 -0
  353. package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.js.map +1 -0
  354. package/dist/restorer/impls/prediction-v0-evaluator/checks/spec.d.ts +5 -0
  355. package/dist/restorer/impls/prediction-v0-evaluator/checks/spec.js +20 -0
  356. package/dist/restorer/impls/prediction-v0-evaluator/checks/spec.js.map +1 -0
  357. package/dist/restorer/impls/prediction-v0-evaluator/index.d.ts +36 -0
  358. package/dist/restorer/impls/prediction-v0-evaluator/index.js +234 -0
  359. package/dist/restorer/impls/prediction-v0-evaluator/index.js.map +1 -0
  360. package/dist/restorer/impls/prediction-v0-evaluator/score.d.ts +8 -0
  361. package/dist/restorer/impls/prediction-v0-evaluator/score.js +15 -0
  362. package/dist/restorer/impls/prediction-v0-evaluator/score.js.map +1 -0
  363. package/dist/restorer/impls/prediction-v0-evaluator/types.d.ts +7 -0
  364. package/dist/restorer/impls/prediction-v0-evaluator/types.js +2 -0
  365. package/dist/restorer/impls/prediction-v0-evaluator/types.js.map +1 -0
  366. package/dist/restorer/types.d.ts +194 -0
  367. package/dist/restorer/types.js +28 -0
  368. package/dist/restorer/types.js.map +1 -0
  369. package/dist/rpc-error-context.d.ts +10 -0
  370. package/dist/rpc-error-context.js +26 -0
  371. package/dist/rpc-error-context.js.map +1 -0
  372. package/dist/store/store.d.ts +101 -1
  373. package/dist/store/store.js +334 -4
  374. package/dist/store/store.js.map +1 -1
  375. package/dist/trajectory/schema.d.ts +510 -0
  376. package/dist/trajectory/schema.js +74 -0
  377. package/dist/trajectory/schema.js.map +1 -0
  378. package/dist/types/desired-state.d.ts +53 -0
  379. package/dist/types/desired-state.js +20 -0
  380. package/dist/types/desired-state.js.map +1 -1
  381. package/dist/types/index.d.ts +4 -1
  382. package/dist/types/index.js +4 -1
  383. package/dist/types/index.js.map +1 -1
  384. package/dist/types/portfolio.d.ts +1000 -0
  385. package/dist/types/portfolio.js +168 -0
  386. package/dist/types/portfolio.js.map +1 -0
  387. package/dist/types/prediction-apy.d.ts +930 -0
  388. package/dist/types/prediction-apy.js +133 -0
  389. package/dist/types/prediction-apy.js.map +1 -0
  390. package/dist/types/prediction.d.ts +926 -0
  391. package/dist/types/prediction.js +141 -0
  392. package/dist/types/prediction.js.map +1 -0
  393. package/dist/venues/aave-v3/addresses.d.ts +6 -0
  394. package/dist/venues/aave-v3/addresses.js +19 -0
  395. package/dist/venues/aave-v3/addresses.js.map +1 -0
  396. package/dist/venues/aave-v3/client.d.ts +85 -0
  397. package/dist/venues/aave-v3/client.js +106 -0
  398. package/dist/venues/aave-v3/client.js.map +1 -0
  399. package/dist/venues/chainlink/client.d.ts +99 -0
  400. package/dist/venues/chainlink/client.js +130 -0
  401. package/dist/venues/chainlink/client.js.map +1 -0
  402. package/dist/venues/chainlink/feeds.d.ts +8 -0
  403. package/dist/venues/chainlink/feeds.js +9 -0
  404. package/dist/venues/chainlink/feeds.js.map +1 -0
  405. package/dist/venues/hyperliquid/account-value.d.ts +30 -0
  406. package/dist/venues/hyperliquid/account-value.js +30 -0
  407. package/dist/venues/hyperliquid/account-value.js.map +1 -0
  408. package/dist/venues/hyperliquid/client.d.ts +63 -0
  409. package/dist/venues/hyperliquid/client.js +135 -0
  410. package/dist/venues/hyperliquid/client.js.map +1 -0
  411. package/dist/venues/hyperliquid/grid.d.ts +36 -0
  412. package/dist/venues/hyperliquid/grid.js +61 -0
  413. package/dist/venues/hyperliquid/grid.js.map +1 -0
  414. package/dist/venues/hyperliquid/types.d.ts +81 -0
  415. package/dist/venues/hyperliquid/types.js +8 -0
  416. package/dist/venues/hyperliquid/types.js.map +1 -0
  417. package/dist/withdraw/run-withdraw-plan.js +2 -0
  418. package/dist/withdraw/run-withdraw-plan.js.map +1 -1
  419. package/docker-compose.yml +44 -0
  420. package/package.json +15 -3
  421. package/skills/jinn-operator/SKILL.md +85 -0
  422. package/dist/daemon/restorer.d.ts +0 -19
  423. package/dist/daemon/restorer.js +0 -82
  424. package/dist/daemon/restorer.js.map +0 -1
@@ -0,0 +1,510 @@
1
+ /**
2
+ * jinn.trajectory.v1 — OTLP-JSON-shaped trace blob signed and uploaded once
3
+ * per run. Scope: docs/superpowers/specs/2026-04-23-jinn-execution-envelope-tee-scope.md
4
+ * §3.1 trajectory row + K6 span profile, §4.3 trajectory profile deliverable.
5
+ *
6
+ * Each span carries jinn.prevSpanHash (in-run hash chain) + jinn.span.kind
7
+ * (normative profile). Secret-scrub (§4.3 V1 minimum) produces a run-level
8
+ * redactionManifest signed alongside the spans.
9
+ */
10
+ import { z } from 'zod';
11
+ export declare const JinnSpanKindSchema: z.ZodEnum<["jinn.phase", "jinn.llm_call", "jinn.mcp_call", "jinn.artifact.emit", "jinn.venue_io", "jinn.state_transition"]>;
12
+ export type JinnSpanKind = z.infer<typeof JinnSpanKindSchema>;
13
+ /** An OTLP-shaped span with Jinn-required attributes. */
14
+ export declare const SpanSchema: z.ZodObject<{
15
+ traceId: z.ZodString;
16
+ spanId: z.ZodString;
17
+ parentSpanId: z.ZodNullable<z.ZodString>;
18
+ name: z.ZodString;
19
+ kind: z.ZodEnum<["INTERNAL", "CLIENT", "SERVER", "PRODUCER", "CONSUMER"]>;
20
+ startTimeUnixNano: z.ZodString;
21
+ endTimeUnixNano: z.ZodString;
22
+ attributes: z.ZodEffects<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>, Record<string, unknown>, Record<string, unknown>>;
23
+ events: z.ZodArray<z.ZodObject<{
24
+ timeUnixNano: z.ZodString;
25
+ name: z.ZodString;
26
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ name: string;
29
+ timeUnixNano: string;
30
+ attributes?: Record<string, unknown> | undefined;
31
+ }, {
32
+ name: string;
33
+ timeUnixNano: string;
34
+ attributes?: Record<string, unknown> | undefined;
35
+ }>, "many">;
36
+ status: z.ZodObject<{
37
+ code: z.ZodEnum<["UNSET", "OK", "ERROR"]>;
38
+ message: z.ZodOptional<z.ZodString>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ code: "UNSET" | "OK" | "ERROR";
41
+ message?: string | undefined;
42
+ }, {
43
+ code: "UNSET" | "OK" | "ERROR";
44
+ message?: string | undefined;
45
+ }>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ name: string;
48
+ status: {
49
+ code: "UNSET" | "OK" | "ERROR";
50
+ message?: string | undefined;
51
+ };
52
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
53
+ events: {
54
+ name: string;
55
+ timeUnixNano: string;
56
+ attributes?: Record<string, unknown> | undefined;
57
+ }[];
58
+ attributes: Record<string, unknown>;
59
+ traceId: string;
60
+ spanId: string;
61
+ parentSpanId: string | null;
62
+ startTimeUnixNano: string;
63
+ endTimeUnixNano: string;
64
+ }, {
65
+ name: string;
66
+ status: {
67
+ code: "UNSET" | "OK" | "ERROR";
68
+ message?: string | undefined;
69
+ };
70
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
71
+ events: {
72
+ name: string;
73
+ timeUnixNano: string;
74
+ attributes?: Record<string, unknown> | undefined;
75
+ }[];
76
+ attributes: Record<string, unknown>;
77
+ traceId: string;
78
+ spanId: string;
79
+ parentSpanId: string | null;
80
+ startTimeUnixNano: string;
81
+ endTimeUnixNano: string;
82
+ }>;
83
+ export type Span = z.infer<typeof SpanSchema>;
84
+ export declare const RedactionManifestSchema: z.ZodEffects<z.ZodObject<{
85
+ spans: z.ZodArray<z.ZodObject<{
86
+ spanId: z.ZodString;
87
+ redactedKeys: z.ZodArray<z.ZodString, "many">;
88
+ }, "strip", z.ZodTypeAny, {
89
+ spanId: string;
90
+ redactedKeys: string[];
91
+ }, {
92
+ spanId: string;
93
+ redactedKeys: string[];
94
+ }>, "many">;
95
+ totalRedactions: z.ZodNumber;
96
+ }, "strip", z.ZodTypeAny, {
97
+ spans: {
98
+ spanId: string;
99
+ redactedKeys: string[];
100
+ }[];
101
+ totalRedactions: number;
102
+ }, {
103
+ spans: {
104
+ spanId: string;
105
+ redactedKeys: string[];
106
+ }[];
107
+ totalRedactions: number;
108
+ }>, {
109
+ spans: {
110
+ spanId: string;
111
+ redactedKeys: string[];
112
+ }[];
113
+ totalRedactions: number;
114
+ }, {
115
+ spans: {
116
+ spanId: string;
117
+ redactedKeys: string[];
118
+ }[];
119
+ totalRedactions: number;
120
+ }>;
121
+ export type RedactionManifest = z.infer<typeof RedactionManifestSchema>;
122
+ export declare const JinnTrajectoryV1Schema: z.ZodObject<{
123
+ schemaVersion: z.ZodLiteral<"jinn.trajectory.v1">;
124
+ runId: z.ZodString;
125
+ parentEnvelopeCid: z.ZodNullable<z.ZodString>;
126
+ spans: z.ZodArray<z.ZodObject<{
127
+ traceId: z.ZodString;
128
+ spanId: z.ZodString;
129
+ parentSpanId: z.ZodNullable<z.ZodString>;
130
+ name: z.ZodString;
131
+ kind: z.ZodEnum<["INTERNAL", "CLIENT", "SERVER", "PRODUCER", "CONSUMER"]>;
132
+ startTimeUnixNano: z.ZodString;
133
+ endTimeUnixNano: z.ZodString;
134
+ attributes: z.ZodEffects<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>, Record<string, unknown>, Record<string, unknown>>;
135
+ events: z.ZodArray<z.ZodObject<{
136
+ timeUnixNano: z.ZodString;
137
+ name: z.ZodString;
138
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
139
+ }, "strip", z.ZodTypeAny, {
140
+ name: string;
141
+ timeUnixNano: string;
142
+ attributes?: Record<string, unknown> | undefined;
143
+ }, {
144
+ name: string;
145
+ timeUnixNano: string;
146
+ attributes?: Record<string, unknown> | undefined;
147
+ }>, "many">;
148
+ status: z.ZodObject<{
149
+ code: z.ZodEnum<["UNSET", "OK", "ERROR"]>;
150
+ message: z.ZodOptional<z.ZodString>;
151
+ }, "strip", z.ZodTypeAny, {
152
+ code: "UNSET" | "OK" | "ERROR";
153
+ message?: string | undefined;
154
+ }, {
155
+ code: "UNSET" | "OK" | "ERROR";
156
+ message?: string | undefined;
157
+ }>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ name: string;
160
+ status: {
161
+ code: "UNSET" | "OK" | "ERROR";
162
+ message?: string | undefined;
163
+ };
164
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
165
+ events: {
166
+ name: string;
167
+ timeUnixNano: string;
168
+ attributes?: Record<string, unknown> | undefined;
169
+ }[];
170
+ attributes: Record<string, unknown>;
171
+ traceId: string;
172
+ spanId: string;
173
+ parentSpanId: string | null;
174
+ startTimeUnixNano: string;
175
+ endTimeUnixNano: string;
176
+ }, {
177
+ name: string;
178
+ status: {
179
+ code: "UNSET" | "OK" | "ERROR";
180
+ message?: string | undefined;
181
+ };
182
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
183
+ events: {
184
+ name: string;
185
+ timeUnixNano: string;
186
+ attributes?: Record<string, unknown> | undefined;
187
+ }[];
188
+ attributes: Record<string, unknown>;
189
+ traceId: string;
190
+ spanId: string;
191
+ parentSpanId: string | null;
192
+ startTimeUnixNano: string;
193
+ endTimeUnixNano: string;
194
+ }>, "many">;
195
+ redactionManifest: z.ZodEffects<z.ZodObject<{
196
+ spans: z.ZodArray<z.ZodObject<{
197
+ spanId: z.ZodString;
198
+ redactedKeys: z.ZodArray<z.ZodString, "many">;
199
+ }, "strip", z.ZodTypeAny, {
200
+ spanId: string;
201
+ redactedKeys: string[];
202
+ }, {
203
+ spanId: string;
204
+ redactedKeys: string[];
205
+ }>, "many">;
206
+ totalRedactions: z.ZodNumber;
207
+ }, "strip", z.ZodTypeAny, {
208
+ spans: {
209
+ spanId: string;
210
+ redactedKeys: string[];
211
+ }[];
212
+ totalRedactions: number;
213
+ }, {
214
+ spans: {
215
+ spanId: string;
216
+ redactedKeys: string[];
217
+ }[];
218
+ totalRedactions: number;
219
+ }>, {
220
+ spans: {
221
+ spanId: string;
222
+ redactedKeys: string[];
223
+ }[];
224
+ totalRedactions: number;
225
+ }, {
226
+ spans: {
227
+ spanId: string;
228
+ redactedKeys: string[];
229
+ }[];
230
+ totalRedactions: number;
231
+ }>;
232
+ signature: z.ZodObject<{
233
+ algo: z.ZodLiteral<"secp256k1">;
234
+ signer: z.ZodString;
235
+ hash: z.ZodString;
236
+ sig: z.ZodString;
237
+ }, "strip", z.ZodTypeAny, {
238
+ hash: string;
239
+ algo: "secp256k1";
240
+ signer: string;
241
+ sig: string;
242
+ }, {
243
+ hash: string;
244
+ algo: "secp256k1";
245
+ signer: string;
246
+ sig: string;
247
+ }>;
248
+ }, "strip", z.ZodTypeAny, {
249
+ signature: {
250
+ hash: string;
251
+ algo: "secp256k1";
252
+ signer: string;
253
+ sig: string;
254
+ };
255
+ schemaVersion: "jinn.trajectory.v1";
256
+ parentEnvelopeCid: string | null;
257
+ spans: {
258
+ name: string;
259
+ status: {
260
+ code: "UNSET" | "OK" | "ERROR";
261
+ message?: string | undefined;
262
+ };
263
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
264
+ events: {
265
+ name: string;
266
+ timeUnixNano: string;
267
+ attributes?: Record<string, unknown> | undefined;
268
+ }[];
269
+ attributes: Record<string, unknown>;
270
+ traceId: string;
271
+ spanId: string;
272
+ parentSpanId: string | null;
273
+ startTimeUnixNano: string;
274
+ endTimeUnixNano: string;
275
+ }[];
276
+ runId: string;
277
+ redactionManifest: {
278
+ spans: {
279
+ spanId: string;
280
+ redactedKeys: string[];
281
+ }[];
282
+ totalRedactions: number;
283
+ };
284
+ }, {
285
+ signature: {
286
+ hash: string;
287
+ algo: "secp256k1";
288
+ signer: string;
289
+ sig: string;
290
+ };
291
+ schemaVersion: "jinn.trajectory.v1";
292
+ parentEnvelopeCid: string | null;
293
+ spans: {
294
+ name: string;
295
+ status: {
296
+ code: "UNSET" | "OK" | "ERROR";
297
+ message?: string | undefined;
298
+ };
299
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
300
+ events: {
301
+ name: string;
302
+ timeUnixNano: string;
303
+ attributes?: Record<string, unknown> | undefined;
304
+ }[];
305
+ attributes: Record<string, unknown>;
306
+ traceId: string;
307
+ spanId: string;
308
+ parentSpanId: string | null;
309
+ startTimeUnixNano: string;
310
+ endTimeUnixNano: string;
311
+ }[];
312
+ runId: string;
313
+ redactionManifest: {
314
+ spans: {
315
+ spanId: string;
316
+ redactedKeys: string[];
317
+ }[];
318
+ totalRedactions: number;
319
+ };
320
+ }>;
321
+ export type JinnTrajectoryV1 = z.infer<typeof JinnTrajectoryV1Schema>;
322
+ /** Unsigned form — what we hash + sign. */
323
+ export declare const UnsignedTrajectorySchema: z.ZodObject<Omit<{
324
+ schemaVersion: z.ZodLiteral<"jinn.trajectory.v1">;
325
+ runId: z.ZodString;
326
+ parentEnvelopeCid: z.ZodNullable<z.ZodString>;
327
+ spans: z.ZodArray<z.ZodObject<{
328
+ traceId: z.ZodString;
329
+ spanId: z.ZodString;
330
+ parentSpanId: z.ZodNullable<z.ZodString>;
331
+ name: z.ZodString;
332
+ kind: z.ZodEnum<["INTERNAL", "CLIENT", "SERVER", "PRODUCER", "CONSUMER"]>;
333
+ startTimeUnixNano: z.ZodString;
334
+ endTimeUnixNano: z.ZodString;
335
+ attributes: z.ZodEffects<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>, Record<string, unknown>, Record<string, unknown>>;
336
+ events: z.ZodArray<z.ZodObject<{
337
+ timeUnixNano: z.ZodString;
338
+ name: z.ZodString;
339
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
340
+ }, "strip", z.ZodTypeAny, {
341
+ name: string;
342
+ timeUnixNano: string;
343
+ attributes?: Record<string, unknown> | undefined;
344
+ }, {
345
+ name: string;
346
+ timeUnixNano: string;
347
+ attributes?: Record<string, unknown> | undefined;
348
+ }>, "many">;
349
+ status: z.ZodObject<{
350
+ code: z.ZodEnum<["UNSET", "OK", "ERROR"]>;
351
+ message: z.ZodOptional<z.ZodString>;
352
+ }, "strip", z.ZodTypeAny, {
353
+ code: "UNSET" | "OK" | "ERROR";
354
+ message?: string | undefined;
355
+ }, {
356
+ code: "UNSET" | "OK" | "ERROR";
357
+ message?: string | undefined;
358
+ }>;
359
+ }, "strip", z.ZodTypeAny, {
360
+ name: string;
361
+ status: {
362
+ code: "UNSET" | "OK" | "ERROR";
363
+ message?: string | undefined;
364
+ };
365
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
366
+ events: {
367
+ name: string;
368
+ timeUnixNano: string;
369
+ attributes?: Record<string, unknown> | undefined;
370
+ }[];
371
+ attributes: Record<string, unknown>;
372
+ traceId: string;
373
+ spanId: string;
374
+ parentSpanId: string | null;
375
+ startTimeUnixNano: string;
376
+ endTimeUnixNano: string;
377
+ }, {
378
+ name: string;
379
+ status: {
380
+ code: "UNSET" | "OK" | "ERROR";
381
+ message?: string | undefined;
382
+ };
383
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
384
+ events: {
385
+ name: string;
386
+ timeUnixNano: string;
387
+ attributes?: Record<string, unknown> | undefined;
388
+ }[];
389
+ attributes: Record<string, unknown>;
390
+ traceId: string;
391
+ spanId: string;
392
+ parentSpanId: string | null;
393
+ startTimeUnixNano: string;
394
+ endTimeUnixNano: string;
395
+ }>, "many">;
396
+ redactionManifest: z.ZodEffects<z.ZodObject<{
397
+ spans: z.ZodArray<z.ZodObject<{
398
+ spanId: z.ZodString;
399
+ redactedKeys: z.ZodArray<z.ZodString, "many">;
400
+ }, "strip", z.ZodTypeAny, {
401
+ spanId: string;
402
+ redactedKeys: string[];
403
+ }, {
404
+ spanId: string;
405
+ redactedKeys: string[];
406
+ }>, "many">;
407
+ totalRedactions: z.ZodNumber;
408
+ }, "strip", z.ZodTypeAny, {
409
+ spans: {
410
+ spanId: string;
411
+ redactedKeys: string[];
412
+ }[];
413
+ totalRedactions: number;
414
+ }, {
415
+ spans: {
416
+ spanId: string;
417
+ redactedKeys: string[];
418
+ }[];
419
+ totalRedactions: number;
420
+ }>, {
421
+ spans: {
422
+ spanId: string;
423
+ redactedKeys: string[];
424
+ }[];
425
+ totalRedactions: number;
426
+ }, {
427
+ spans: {
428
+ spanId: string;
429
+ redactedKeys: string[];
430
+ }[];
431
+ totalRedactions: number;
432
+ }>;
433
+ signature: z.ZodObject<{
434
+ algo: z.ZodLiteral<"secp256k1">;
435
+ signer: z.ZodString;
436
+ hash: z.ZodString;
437
+ sig: z.ZodString;
438
+ }, "strip", z.ZodTypeAny, {
439
+ hash: string;
440
+ algo: "secp256k1";
441
+ signer: string;
442
+ sig: string;
443
+ }, {
444
+ hash: string;
445
+ algo: "secp256k1";
446
+ signer: string;
447
+ sig: string;
448
+ }>;
449
+ }, "signature">, "strip", z.ZodTypeAny, {
450
+ schemaVersion: "jinn.trajectory.v1";
451
+ parentEnvelopeCid: string | null;
452
+ spans: {
453
+ name: string;
454
+ status: {
455
+ code: "UNSET" | "OK" | "ERROR";
456
+ message?: string | undefined;
457
+ };
458
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
459
+ events: {
460
+ name: string;
461
+ timeUnixNano: string;
462
+ attributes?: Record<string, unknown> | undefined;
463
+ }[];
464
+ attributes: Record<string, unknown>;
465
+ traceId: string;
466
+ spanId: string;
467
+ parentSpanId: string | null;
468
+ startTimeUnixNano: string;
469
+ endTimeUnixNano: string;
470
+ }[];
471
+ runId: string;
472
+ redactionManifest: {
473
+ spans: {
474
+ spanId: string;
475
+ redactedKeys: string[];
476
+ }[];
477
+ totalRedactions: number;
478
+ };
479
+ }, {
480
+ schemaVersion: "jinn.trajectory.v1";
481
+ parentEnvelopeCid: string | null;
482
+ spans: {
483
+ name: string;
484
+ status: {
485
+ code: "UNSET" | "OK" | "ERROR";
486
+ message?: string | undefined;
487
+ };
488
+ kind: "INTERNAL" | "CLIENT" | "SERVER" | "PRODUCER" | "CONSUMER";
489
+ events: {
490
+ name: string;
491
+ timeUnixNano: string;
492
+ attributes?: Record<string, unknown> | undefined;
493
+ }[];
494
+ attributes: Record<string, unknown>;
495
+ traceId: string;
496
+ spanId: string;
497
+ parentSpanId: string | null;
498
+ startTimeUnixNano: string;
499
+ endTimeUnixNano: string;
500
+ }[];
501
+ runId: string;
502
+ redactionManifest: {
503
+ spans: {
504
+ spanId: string;
505
+ redactedKeys: string[];
506
+ }[];
507
+ totalRedactions: number;
508
+ };
509
+ }>;
510
+ export type UnsignedTrajectory = z.infer<typeof UnsignedTrajectorySchema>;
@@ -0,0 +1,74 @@
1
+ /**
2
+ * jinn.trajectory.v1 — OTLP-JSON-shaped trace blob signed and uploaded once
3
+ * per run. Scope: docs/superpowers/specs/2026-04-23-jinn-execution-envelope-tee-scope.md
4
+ * §3.1 trajectory row + K6 span profile, §4.3 trajectory profile deliverable.
5
+ *
6
+ * Each span carries jinn.prevSpanHash (in-run hash chain) + jinn.span.kind
7
+ * (normative profile). Secret-scrub (§4.3 V1 minimum) produces a run-level
8
+ * redactionManifest signed alongside the spans.
9
+ */
10
+ import { z } from 'zod';
11
+ const HexStringSchema = z.string().regex(/^0x[0-9a-fA-F]*$/);
12
+ export const JinnSpanKindSchema = z.enum([
13
+ 'jinn.phase',
14
+ 'jinn.llm_call',
15
+ 'jinn.mcp_call',
16
+ 'jinn.artifact.emit',
17
+ 'jinn.venue_io',
18
+ 'jinn.state_transition',
19
+ ]);
20
+ const EventSchema = z.object({
21
+ timeUnixNano: z.string(),
22
+ name: z.string(),
23
+ attributes: z.record(z.unknown()).optional(),
24
+ });
25
+ const SpanStatusSchema = z.object({
26
+ code: z.enum(['UNSET', 'OK', 'ERROR']),
27
+ message: z.string().optional(),
28
+ });
29
+ /** An OTLP-shaped span with Jinn-required attributes. */
30
+ export const SpanSchema = z.object({
31
+ traceId: z.string().regex(/^[0-9a-f]{32}$/),
32
+ spanId: z.string().regex(/^[0-9a-f]{16}$/),
33
+ parentSpanId: z.string().regex(/^[0-9a-f]{16}$/).nullable(),
34
+ name: z.string().min(1),
35
+ kind: z.enum(['INTERNAL', 'CLIENT', 'SERVER', 'PRODUCER', 'CONSUMER']),
36
+ startTimeUnixNano: z.string(),
37
+ endTimeUnixNano: z.string(),
38
+ attributes: z
39
+ .record(z.unknown())
40
+ .refine((a) => typeof a['jinn.span.kind'] === 'string', {
41
+ message: 'jinn.span.kind attribute required',
42
+ })
43
+ .refine((a) => typeof a['jinn.prevSpanHash'] === 'string', {
44
+ message: 'jinn.prevSpanHash attribute required',
45
+ }),
46
+ events: z.array(EventSchema),
47
+ status: SpanStatusSchema,
48
+ });
49
+ export const RedactionManifestSchema = z
50
+ .object({
51
+ spans: z.array(z.object({
52
+ spanId: z.string().regex(/^[0-9a-f]{16}$/),
53
+ redactedKeys: z.array(z.string()),
54
+ })),
55
+ totalRedactions: z.number().int().nonnegative(),
56
+ })
57
+ .refine((m) => m.spans.reduce((acc, s) => acc + s.redactedKeys.length, 0) === m.totalRedactions, { message: 'totalRedactions must equal sum of per-span redactedKeys' });
58
+ const SignatureSchema = z.object({
59
+ algo: z.literal('secp256k1'),
60
+ signer: HexStringSchema,
61
+ hash: HexStringSchema,
62
+ sig: HexStringSchema,
63
+ });
64
+ export const JinnTrajectoryV1Schema = z.object({
65
+ schemaVersion: z.literal('jinn.trajectory.v1'),
66
+ runId: z.string().min(1),
67
+ parentEnvelopeCid: z.string().nullable(),
68
+ spans: z.array(SpanSchema),
69
+ redactionManifest: RedactionManifestSchema,
70
+ signature: SignatureSchema,
71
+ });
72
+ /** Unsigned form — what we hash + sign. */
73
+ export const UnsignedTrajectorySchema = JinnTrajectoryV1Schema.omit({ signature: true });
74
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/trajectory/schema.ts"],"names":[],"mappings":"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"}
@@ -1,17 +1,62 @@
1
1
  import { z } from 'zod';
2
2
  export type RequestId = string;
3
+ export declare const WindowSchema: z.ZodObject<{
4
+ startTs: z.ZodNumber;
5
+ endTs: z.ZodNumber;
6
+ }, "strip", z.ZodTypeAny, {
7
+ startTs: number;
8
+ endTs: number;
9
+ }, {
10
+ startTs: number;
11
+ endTs: number;
12
+ }>;
13
+ export type Window = z.infer<typeof WindowSchema>;
3
14
  export declare const DesiredStateSchema: z.ZodObject<{
4
15
  id: z.ZodOptional<z.ZodString>;
5
16
  description: z.ZodString;
6
17
  context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
18
+ window: z.ZodOptional<z.ZodObject<{
19
+ startTs: z.ZodNumber;
20
+ endTs: z.ZodNumber;
21
+ }, "strip", z.ZodTypeAny, {
22
+ startTs: number;
23
+ endTs: number;
24
+ }, {
25
+ startTs: number;
26
+ endTs: number;
27
+ }>>;
28
+ spec: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
29
+ kind: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ kind: string;
32
+ }, {
33
+ kind: string;
34
+ }>, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
35
+ eligibility: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7
36
  }, "strip", z.ZodTypeAny, {
8
37
  description: string;
9
38
  id?: string | undefined;
10
39
  context?: Record<string, unknown> | undefined;
40
+ window?: {
41
+ startTs: number;
42
+ endTs: number;
43
+ } | undefined;
44
+ spec?: ({
45
+ kind: string;
46
+ } & Record<string, unknown>) | undefined;
47
+ eligibility?: Record<string, unknown> | undefined;
11
48
  }, {
12
49
  description: string;
13
50
  id?: string | undefined;
14
51
  context?: Record<string, unknown> | undefined;
52
+ window?: {
53
+ startTs: number;
54
+ endTs: number;
55
+ } | undefined;
56
+ spec?: ({
57
+ kind: string;
58
+ } & Record<string, unknown>) | undefined;
59
+ eligibility?: Record<string, unknown> | undefined;
15
60
  }>;
16
61
  export interface DesiredState {
17
62
  id: string;
@@ -21,6 +66,11 @@ export interface DesiredState {
21
66
  attemptId?: string;
22
67
  attemptNumber?: number;
23
68
  restorationRequestId?: string;
69
+ window?: Window;
70
+ spec?: {
71
+ kind: string;
72
+ } & Record<string, unknown>;
73
+ eligibility?: Record<string, unknown>;
24
74
  }
25
75
  export declare function parseDesiredState(input: unknown): DesiredState;
26
76
  export interface RestorationRequest {
@@ -28,6 +78,9 @@ export interface RestorationRequest {
28
78
  desiredState: DesiredState;
29
79
  payment?: string;
30
80
  timeout?: number;
81
+ intentCid?: string;
82
+ onchainCreationTx?: `0x${string}`;
83
+ onchainCreationBlock?: number;
31
84
  }
32
85
  export interface RestorationResult {
33
86
  data: string;