@stoneforge/quarry 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +160 -0
  3. package/dist/api/index.d.ts +8 -0
  4. package/dist/api/index.d.ts.map +1 -0
  5. package/dist/api/index.js +8 -0
  6. package/dist/api/index.js.map +1 -0
  7. package/dist/api/quarry-api.d.ts +268 -0
  8. package/dist/api/quarry-api.d.ts.map +1 -0
  9. package/dist/api/quarry-api.js +3905 -0
  10. package/dist/api/quarry-api.js.map +1 -0
  11. package/dist/api/types.d.ts +1359 -0
  12. package/dist/api/types.d.ts.map +1 -0
  13. package/dist/api/types.js +204 -0
  14. package/dist/api/types.js.map +1 -0
  15. package/dist/bin/sf.d.ts +3 -0
  16. package/dist/bin/sf.d.ts.map +1 -0
  17. package/dist/bin/sf.js +9 -0
  18. package/dist/bin/sf.js.map +1 -0
  19. package/dist/cli/commands/admin.d.ts +11 -0
  20. package/dist/cli/commands/admin.d.ts.map +1 -0
  21. package/dist/cli/commands/admin.js +465 -0
  22. package/dist/cli/commands/admin.js.map +1 -0
  23. package/dist/cli/commands/alias.d.ts +8 -0
  24. package/dist/cli/commands/alias.d.ts.map +1 -0
  25. package/dist/cli/commands/alias.js +70 -0
  26. package/dist/cli/commands/alias.js.map +1 -0
  27. package/dist/cli/commands/channel.d.ts +13 -0
  28. package/dist/cli/commands/channel.d.ts.map +1 -0
  29. package/dist/cli/commands/channel.js +680 -0
  30. package/dist/cli/commands/channel.js.map +1 -0
  31. package/dist/cli/commands/completion.d.ts +8 -0
  32. package/dist/cli/commands/completion.d.ts.map +1 -0
  33. package/dist/cli/commands/completion.js +87 -0
  34. package/dist/cli/commands/completion.js.map +1 -0
  35. package/dist/cli/commands/config.d.ts +12 -0
  36. package/dist/cli/commands/config.d.ts.map +1 -0
  37. package/dist/cli/commands/config.js +242 -0
  38. package/dist/cli/commands/config.js.map +1 -0
  39. package/dist/cli/commands/crud.d.ts +64 -0
  40. package/dist/cli/commands/crud.d.ts.map +1 -0
  41. package/dist/cli/commands/crud.js +805 -0
  42. package/dist/cli/commands/crud.js.map +1 -0
  43. package/dist/cli/commands/dep.d.ts +16 -0
  44. package/dist/cli/commands/dep.d.ts.map +1 -0
  45. package/dist/cli/commands/dep.js +499 -0
  46. package/dist/cli/commands/dep.js.map +1 -0
  47. package/dist/cli/commands/document.d.ts +12 -0
  48. package/dist/cli/commands/document.d.ts.map +1 -0
  49. package/dist/cli/commands/document.js +1039 -0
  50. package/dist/cli/commands/document.js.map +1 -0
  51. package/dist/cli/commands/embeddings.d.ts +12 -0
  52. package/dist/cli/commands/embeddings.d.ts.map +1 -0
  53. package/dist/cli/commands/embeddings.js +273 -0
  54. package/dist/cli/commands/embeddings.js.map +1 -0
  55. package/dist/cli/commands/entity.d.ts +16 -0
  56. package/dist/cli/commands/entity.d.ts.map +1 -0
  57. package/dist/cli/commands/entity.js +522 -0
  58. package/dist/cli/commands/entity.js.map +1 -0
  59. package/dist/cli/commands/gc.d.ts +10 -0
  60. package/dist/cli/commands/gc.d.ts.map +1 -0
  61. package/dist/cli/commands/gc.js +257 -0
  62. package/dist/cli/commands/gc.js.map +1 -0
  63. package/dist/cli/commands/help.d.ts +11 -0
  64. package/dist/cli/commands/help.d.ts.map +1 -0
  65. package/dist/cli/commands/help.js +169 -0
  66. package/dist/cli/commands/help.js.map +1 -0
  67. package/dist/cli/commands/history.d.ts +9 -0
  68. package/dist/cli/commands/history.d.ts.map +1 -0
  69. package/dist/cli/commands/history.js +160 -0
  70. package/dist/cli/commands/history.js.map +1 -0
  71. package/dist/cli/commands/identity.d.ts +18 -0
  72. package/dist/cli/commands/identity.d.ts.map +1 -0
  73. package/dist/cli/commands/identity.js +698 -0
  74. package/dist/cli/commands/identity.js.map +1 -0
  75. package/dist/cli/commands/inbox.d.ts +20 -0
  76. package/dist/cli/commands/inbox.d.ts.map +1 -0
  77. package/dist/cli/commands/inbox.js +493 -0
  78. package/dist/cli/commands/inbox.js.map +1 -0
  79. package/dist/cli/commands/init.d.ts +20 -0
  80. package/dist/cli/commands/init.d.ts.map +1 -0
  81. package/dist/cli/commands/init.js +144 -0
  82. package/dist/cli/commands/init.js.map +1 -0
  83. package/dist/cli/commands/install.d.ts +9 -0
  84. package/dist/cli/commands/install.d.ts.map +1 -0
  85. package/dist/cli/commands/install.js +200 -0
  86. package/dist/cli/commands/install.js.map +1 -0
  87. package/dist/cli/commands/library.d.ts +12 -0
  88. package/dist/cli/commands/library.d.ts.map +1 -0
  89. package/dist/cli/commands/library.js +665 -0
  90. package/dist/cli/commands/library.js.map +1 -0
  91. package/dist/cli/commands/message.d.ts +11 -0
  92. package/dist/cli/commands/message.d.ts.map +1 -0
  93. package/dist/cli/commands/message.js +608 -0
  94. package/dist/cli/commands/message.js.map +1 -0
  95. package/dist/cli/commands/plan.d.ts +17 -0
  96. package/dist/cli/commands/plan.d.ts.map +1 -0
  97. package/dist/cli/commands/plan.js +698 -0
  98. package/dist/cli/commands/plan.js.map +1 -0
  99. package/dist/cli/commands/playbook.d.ts +12 -0
  100. package/dist/cli/commands/playbook.d.ts.map +1 -0
  101. package/dist/cli/commands/playbook.js +730 -0
  102. package/dist/cli/commands/playbook.js.map +1 -0
  103. package/dist/cli/commands/reset.d.ts +12 -0
  104. package/dist/cli/commands/reset.d.ts.map +1 -0
  105. package/dist/cli/commands/reset.js +306 -0
  106. package/dist/cli/commands/reset.js.map +1 -0
  107. package/dist/cli/commands/serve.d.ts +11 -0
  108. package/dist/cli/commands/serve.d.ts.map +1 -0
  109. package/dist/cli/commands/serve.js +106 -0
  110. package/dist/cli/commands/serve.js.map +1 -0
  111. package/dist/cli/commands/stats.d.ts +8 -0
  112. package/dist/cli/commands/stats.d.ts.map +1 -0
  113. package/dist/cli/commands/stats.js +82 -0
  114. package/dist/cli/commands/stats.js.map +1 -0
  115. package/dist/cli/commands/sync.d.ts +14 -0
  116. package/dist/cli/commands/sync.d.ts.map +1 -0
  117. package/dist/cli/commands/sync.js +370 -0
  118. package/dist/cli/commands/sync.js.map +1 -0
  119. package/dist/cli/commands/task.d.ts +25 -0
  120. package/dist/cli/commands/task.d.ts.map +1 -0
  121. package/dist/cli/commands/task.js +1153 -0
  122. package/dist/cli/commands/task.js.map +1 -0
  123. package/dist/cli/commands/team.d.ts +13 -0
  124. package/dist/cli/commands/team.d.ts.map +1 -0
  125. package/dist/cli/commands/team.js +471 -0
  126. package/dist/cli/commands/team.js.map +1 -0
  127. package/dist/cli/commands/workflow.d.ts +16 -0
  128. package/dist/cli/commands/workflow.d.ts.map +1 -0
  129. package/dist/cli/commands/workflow.js +753 -0
  130. package/dist/cli/commands/workflow.js.map +1 -0
  131. package/dist/cli/completion.d.ts +28 -0
  132. package/dist/cli/completion.d.ts.map +1 -0
  133. package/dist/cli/completion.js +295 -0
  134. package/dist/cli/completion.js.map +1 -0
  135. package/dist/cli/db.d.ts +38 -0
  136. package/dist/cli/db.d.ts.map +1 -0
  137. package/dist/cli/db.js +90 -0
  138. package/dist/cli/db.js.map +1 -0
  139. package/dist/cli/formatter.d.ts +87 -0
  140. package/dist/cli/formatter.d.ts.map +1 -0
  141. package/dist/cli/formatter.js +464 -0
  142. package/dist/cli/formatter.js.map +1 -0
  143. package/dist/cli/index.d.ts +33 -0
  144. package/dist/cli/index.d.ts.map +1 -0
  145. package/dist/cli/index.js +38 -0
  146. package/dist/cli/index.js.map +1 -0
  147. package/dist/cli/parser.d.ts +45 -0
  148. package/dist/cli/parser.d.ts.map +1 -0
  149. package/dist/cli/parser.js +256 -0
  150. package/dist/cli/parser.js.map +1 -0
  151. package/dist/cli/plugin-loader.d.ts +39 -0
  152. package/dist/cli/plugin-loader.d.ts.map +1 -0
  153. package/dist/cli/plugin-loader.js +165 -0
  154. package/dist/cli/plugin-loader.js.map +1 -0
  155. package/dist/cli/plugin-registry.d.ts +50 -0
  156. package/dist/cli/plugin-registry.d.ts.map +1 -0
  157. package/dist/cli/plugin-registry.js +206 -0
  158. package/dist/cli/plugin-registry.js.map +1 -0
  159. package/dist/cli/plugin-types.d.ts +106 -0
  160. package/dist/cli/plugin-types.d.ts.map +1 -0
  161. package/dist/cli/plugin-types.js +103 -0
  162. package/dist/cli/plugin-types.js.map +1 -0
  163. package/dist/cli/runner.d.ts +35 -0
  164. package/dist/cli/runner.d.ts.map +1 -0
  165. package/dist/cli/runner.js +340 -0
  166. package/dist/cli/runner.js.map +1 -0
  167. package/dist/cli/suggest.d.ts +15 -0
  168. package/dist/cli/suggest.d.ts.map +1 -0
  169. package/dist/cli/suggest.js +49 -0
  170. package/dist/cli/suggest.js.map +1 -0
  171. package/dist/cli/types.d.ts +138 -0
  172. package/dist/cli/types.d.ts.map +1 -0
  173. package/dist/cli/types.js +63 -0
  174. package/dist/cli/types.js.map +1 -0
  175. package/dist/config/config.d.ts +86 -0
  176. package/dist/config/config.d.ts.map +1 -0
  177. package/dist/config/config.js +348 -0
  178. package/dist/config/config.js.map +1 -0
  179. package/dist/config/defaults.d.ts +66 -0
  180. package/dist/config/defaults.d.ts.map +1 -0
  181. package/dist/config/defaults.js +114 -0
  182. package/dist/config/defaults.js.map +1 -0
  183. package/dist/config/duration.d.ts +75 -0
  184. package/dist/config/duration.d.ts.map +1 -0
  185. package/dist/config/duration.js +190 -0
  186. package/dist/config/duration.js.map +1 -0
  187. package/dist/config/env.d.ts +67 -0
  188. package/dist/config/env.d.ts.map +1 -0
  189. package/dist/config/env.js +207 -0
  190. package/dist/config/env.js.map +1 -0
  191. package/dist/config/file.d.ts +97 -0
  192. package/dist/config/file.d.ts.map +1 -0
  193. package/dist/config/file.js +365 -0
  194. package/dist/config/file.js.map +1 -0
  195. package/dist/config/index.d.ts +35 -0
  196. package/dist/config/index.d.ts.map +1 -0
  197. package/dist/config/index.js +41 -0
  198. package/dist/config/index.js.map +1 -0
  199. package/dist/config/merge.d.ts +53 -0
  200. package/dist/config/merge.d.ts.map +1 -0
  201. package/dist/config/merge.js +226 -0
  202. package/dist/config/merge.js.map +1 -0
  203. package/dist/config/types.d.ts +257 -0
  204. package/dist/config/types.d.ts.map +1 -0
  205. package/dist/config/types.js +72 -0
  206. package/dist/config/types.js.map +1 -0
  207. package/dist/config/validation.d.ts +55 -0
  208. package/dist/config/validation.d.ts.map +1 -0
  209. package/dist/config/validation.js +251 -0
  210. package/dist/config/validation.js.map +1 -0
  211. package/dist/http/index.d.ts +8 -0
  212. package/dist/http/index.d.ts.map +1 -0
  213. package/dist/http/index.js +12 -0
  214. package/dist/http/index.js.map +1 -0
  215. package/dist/http/sync-handlers.d.ts +162 -0
  216. package/dist/http/sync-handlers.d.ts.map +1 -0
  217. package/dist/http/sync-handlers.js +271 -0
  218. package/dist/http/sync-handlers.js.map +1 -0
  219. package/dist/index.d.ts +25 -0
  220. package/dist/index.d.ts.map +1 -0
  221. package/dist/index.js +69 -0
  222. package/dist/index.js.map +1 -0
  223. package/dist/server/index.d.ts +34 -0
  224. package/dist/server/index.d.ts.map +1 -0
  225. package/dist/server/index.js +3329 -0
  226. package/dist/server/index.js.map +1 -0
  227. package/dist/server/static.d.ts +18 -0
  228. package/dist/server/static.d.ts.map +1 -0
  229. package/dist/server/static.js +71 -0
  230. package/dist/server/static.js.map +1 -0
  231. package/dist/server/ws/broadcaster.d.ts +8 -0
  232. package/dist/server/ws/broadcaster.d.ts.map +1 -0
  233. package/dist/server/ws/broadcaster.js +7 -0
  234. package/dist/server/ws/broadcaster.js.map +1 -0
  235. package/dist/server/ws/handler.d.ts +55 -0
  236. package/dist/server/ws/handler.d.ts.map +1 -0
  237. package/dist/server/ws/handler.js +160 -0
  238. package/dist/server/ws/handler.js.map +1 -0
  239. package/dist/services/blocked-cache.d.ts +297 -0
  240. package/dist/services/blocked-cache.d.ts.map +1 -0
  241. package/dist/services/blocked-cache.js +755 -0
  242. package/dist/services/blocked-cache.js.map +1 -0
  243. package/dist/services/dependency.d.ts +205 -0
  244. package/dist/services/dependency.d.ts.map +1 -0
  245. package/dist/services/dependency.js +566 -0
  246. package/dist/services/dependency.js.map +1 -0
  247. package/dist/services/embeddings/fusion.d.ts +33 -0
  248. package/dist/services/embeddings/fusion.d.ts.map +1 -0
  249. package/dist/services/embeddings/fusion.js +34 -0
  250. package/dist/services/embeddings/fusion.js.map +1 -0
  251. package/dist/services/embeddings/index.d.ts +12 -0
  252. package/dist/services/embeddings/index.d.ts.map +1 -0
  253. package/dist/services/embeddings/index.js +10 -0
  254. package/dist/services/embeddings/index.js.map +1 -0
  255. package/dist/services/embeddings/local-provider.d.ts +31 -0
  256. package/dist/services/embeddings/local-provider.d.ts.map +1 -0
  257. package/dist/services/embeddings/local-provider.js +80 -0
  258. package/dist/services/embeddings/local-provider.js.map +1 -0
  259. package/dist/services/embeddings/service.d.ts +76 -0
  260. package/dist/services/embeddings/service.d.ts.map +1 -0
  261. package/dist/services/embeddings/service.js +153 -0
  262. package/dist/services/embeddings/service.js.map +1 -0
  263. package/dist/services/embeddings/types.d.ts +70 -0
  264. package/dist/services/embeddings/types.d.ts.map +1 -0
  265. package/dist/services/embeddings/types.js +8 -0
  266. package/dist/services/embeddings/types.js.map +1 -0
  267. package/dist/services/id-length-cache.d.ts +156 -0
  268. package/dist/services/id-length-cache.d.ts.map +1 -0
  269. package/dist/services/id-length-cache.js +197 -0
  270. package/dist/services/id-length-cache.js.map +1 -0
  271. package/dist/services/inbox.d.ts +147 -0
  272. package/dist/services/inbox.d.ts.map +1 -0
  273. package/dist/services/inbox.js +428 -0
  274. package/dist/services/inbox.js.map +1 -0
  275. package/dist/services/index.d.ts +10 -0
  276. package/dist/services/index.d.ts.map +1 -0
  277. package/dist/services/index.js +10 -0
  278. package/dist/services/index.js.map +1 -0
  279. package/dist/services/priority-service.d.ts +145 -0
  280. package/dist/services/priority-service.d.ts.map +1 -0
  281. package/dist/services/priority-service.js +272 -0
  282. package/dist/services/priority-service.js.map +1 -0
  283. package/dist/services/search-utils.d.ts +47 -0
  284. package/dist/services/search-utils.d.ts.map +1 -0
  285. package/dist/services/search-utils.js +83 -0
  286. package/dist/services/search-utils.js.map +1 -0
  287. package/dist/sync/hash.d.ts +48 -0
  288. package/dist/sync/hash.d.ts.map +1 -0
  289. package/dist/sync/hash.js +136 -0
  290. package/dist/sync/hash.js.map +1 -0
  291. package/dist/sync/index.d.ts +11 -0
  292. package/dist/sync/index.d.ts.map +1 -0
  293. package/dist/sync/index.js +16 -0
  294. package/dist/sync/index.js.map +1 -0
  295. package/dist/sync/merge.d.ts +80 -0
  296. package/dist/sync/merge.d.ts.map +1 -0
  297. package/dist/sync/merge.js +310 -0
  298. package/dist/sync/merge.js.map +1 -0
  299. package/dist/sync/serialization.d.ts +132 -0
  300. package/dist/sync/serialization.d.ts.map +1 -0
  301. package/dist/sync/serialization.js +306 -0
  302. package/dist/sync/serialization.js.map +1 -0
  303. package/dist/sync/service.d.ts +102 -0
  304. package/dist/sync/service.d.ts.map +1 -0
  305. package/dist/sync/service.js +493 -0
  306. package/dist/sync/service.js.map +1 -0
  307. package/dist/sync/types.d.ts +275 -0
  308. package/dist/sync/types.d.ts.map +1 -0
  309. package/dist/sync/types.js +76 -0
  310. package/dist/sync/types.js.map +1 -0
  311. package/dist/systems/identity.d.ts +479 -0
  312. package/dist/systems/identity.d.ts.map +1 -0
  313. package/dist/systems/identity.js +817 -0
  314. package/dist/systems/identity.js.map +1 -0
  315. package/dist/systems/index.d.ts +8 -0
  316. package/dist/systems/index.d.ts.map +1 -0
  317. package/dist/systems/index.js +29 -0
  318. package/dist/systems/index.js.map +1 -0
  319. package/package.json +121 -0
  320. package/web/assets/charts-vendor-D1YcbGux.js +55 -0
  321. package/web/assets/dnd-vendor-DmxE-_ZH.js +5 -0
  322. package/web/assets/editor-vendor-BxraAWts.js +279 -0
  323. package/web/assets/index-B77vv208.js +341 -0
  324. package/web/assets/index-CF_XnVLh.css +1 -0
  325. package/web/assets/router-vendor-BCKpRBrB.js +41 -0
  326. package/web/assets/ui-vendor-DUahGnbT.js +45 -0
  327. package/web/assets/utils-vendor-CfYKiENT.js +813 -0
  328. package/web/favicon.ico +0 -0
  329. package/web/index.html +23 -0
  330. package/web/logo.png +0 -0
@@ -0,0 +1,479 @@
1
+ /**
2
+ * Identity System - Authentication and Signature Verification
3
+ *
4
+ * The identity system manages entity authentication and verification, supporting
5
+ * both soft (name-based) and cryptographic (key-based) identity models.
6
+ *
7
+ * Features:
8
+ * - Identity mode configuration (soft, cryptographic, hybrid)
9
+ * - Ed25519 signature generation and verification
10
+ * - Signed request validation with time tolerance
11
+ * - Actor context management
12
+ */
13
+ import { Timestamp } from '@stoneforge/core';
14
+ /**
15
+ * Identity mode determines the level of verification required
16
+ */
17
+ export declare const IdentityMode: {
18
+ /** Name-based identity without verification (default) */
19
+ readonly SOFT: "soft";
20
+ /** Key-based identity with signature verification */
21
+ readonly CRYPTOGRAPHIC: "cryptographic";
22
+ /** Mixed mode - accepts both verified and unverified actors */
23
+ readonly HYBRID: "hybrid";
24
+ };
25
+ export type IdentityMode = (typeof IdentityMode)[keyof typeof IdentityMode];
26
+ /**
27
+ * Base64-encoded Ed25519 signature (88 characters for 64 bytes)
28
+ */
29
+ declare const SignatureBrand: unique symbol;
30
+ export type Signature = string & {
31
+ readonly [SignatureBrand]: typeof SignatureBrand;
32
+ };
33
+ /**
34
+ * Base64-encoded Ed25519 public key (44 characters for 32 bytes)
35
+ */
36
+ declare const PublicKeyBrand: unique symbol;
37
+ export type PublicKey = string & {
38
+ readonly [PublicKeyBrand]: typeof PublicKeyBrand;
39
+ };
40
+ /**
41
+ * Signed request fields included in cryptographic requests
42
+ */
43
+ export interface SignedRequestFields {
44
+ /** Base64 Ed25519 signature */
45
+ readonly signature: Signature;
46
+ /** Timestamp when the request was signed (ISO 8601) */
47
+ readonly signedAt: Timestamp;
48
+ /** Entity name making the request */
49
+ readonly actor: string;
50
+ }
51
+ /**
52
+ * Input for signing a request
53
+ */
54
+ export interface SigningInput {
55
+ /** Entity name making the request */
56
+ actor: string;
57
+ /** Hash of the request body (SHA256, hex encoded) */
58
+ requestHash: string;
59
+ }
60
+ /**
61
+ * Signed data format: actor|signedAt|requestHash
62
+ */
63
+ export interface SignedData {
64
+ readonly actor: string;
65
+ readonly signedAt: Timestamp;
66
+ readonly requestHash: string;
67
+ }
68
+ /**
69
+ * Result of signature verification
70
+ */
71
+ export declare const VerificationStatus: {
72
+ /** Signature is valid */
73
+ readonly VALID: "valid";
74
+ /** Signature is invalid or doesn't match */
75
+ readonly INVALID: "invalid";
76
+ /** Signature has expired (outside time tolerance) */
77
+ readonly EXPIRED: "expired";
78
+ /** Entity not found for verification */
79
+ readonly ACTOR_NOT_FOUND: "actor_not_found";
80
+ /** Entity has no public key */
81
+ readonly NO_PUBLIC_KEY: "no_public_key";
82
+ /** Signature was not provided */
83
+ readonly NOT_SIGNED: "not_signed";
84
+ };
85
+ export type VerificationStatus = (typeof VerificationStatus)[keyof typeof VerificationStatus];
86
+ /**
87
+ * Full verification result with details
88
+ */
89
+ export interface VerificationResult {
90
+ /** Overall verification status */
91
+ readonly status: VerificationStatus;
92
+ /** Whether the request should be allowed */
93
+ readonly allowed: boolean;
94
+ /** Actor name if verified */
95
+ readonly actor?: string;
96
+ /** Error message if verification failed */
97
+ readonly error?: string;
98
+ /** Additional details about the verification */
99
+ readonly details?: {
100
+ /** How old the signature is in milliseconds */
101
+ signatureAgeMs?: number;
102
+ /** Whether the entity was found */
103
+ entityFound?: boolean;
104
+ /** Whether the entity has a public key */
105
+ hasPublicKey?: boolean;
106
+ };
107
+ }
108
+ /**
109
+ * Identity system configuration
110
+ */
111
+ export interface IdentityConfig {
112
+ /** Identity verification mode */
113
+ mode: IdentityMode;
114
+ /** Time tolerance for signature expiry in milliseconds (default: 5 minutes) */
115
+ timeTolerance: number;
116
+ /** Whether to allow unregistered actors in soft mode */
117
+ allowUnregisteredActors: boolean;
118
+ }
119
+ /** Default time tolerance: 5 minutes in milliseconds */
120
+ export declare const DEFAULT_TIME_TOLERANCE: number;
121
+ /**
122
+ * Default identity configuration
123
+ */
124
+ export declare const DEFAULT_IDENTITY_CONFIG: IdentityConfig;
125
+ /**
126
+ * Validates an identity mode value
127
+ */
128
+ export declare function isValidIdentityMode(value: unknown): value is IdentityMode;
129
+ /**
130
+ * Validates identity mode and throws if invalid
131
+ */
132
+ export declare function validateIdentityMode(value: unknown): IdentityMode;
133
+ /**
134
+ * Validates a base64-encoded Ed25519 public key format
135
+ */
136
+ export declare function isValidPublicKey(value: unknown): value is PublicKey;
137
+ /**
138
+ * Validates a public key and throws if invalid format
139
+ */
140
+ export declare function validatePublicKey(value: unknown): PublicKey;
141
+ /**
142
+ * Validates a base64-encoded Ed25519 signature format
143
+ */
144
+ export declare function isValidSignature(value: unknown): value is Signature;
145
+ /**
146
+ * Validates a signature and throws if invalid format
147
+ */
148
+ export declare function validateSignature(value: unknown): Signature;
149
+ /**
150
+ * Validates a request hash (SHA256 hex)
151
+ */
152
+ export declare function isValidRequestHash(value: unknown): value is string;
153
+ /**
154
+ * Validates a request hash and throws if invalid
155
+ */
156
+ export declare function validateRequestHash(value: unknown): string;
157
+ /**
158
+ * Validates time tolerance value
159
+ */
160
+ export declare function isValidTimeTolerance(value: unknown): value is number;
161
+ /**
162
+ * Validates time tolerance and throws if invalid
163
+ */
164
+ export declare function validateTimeTolerance(value: unknown): number;
165
+ /**
166
+ * Type guard for SignedRequestFields
167
+ */
168
+ export declare function isSignedRequestFields(value: unknown): value is SignedRequestFields;
169
+ /**
170
+ * Validates SignedRequestFields and throws detailed errors
171
+ */
172
+ export declare function validateSignedRequestFields(value: unknown): SignedRequestFields;
173
+ /**
174
+ * Type guard for VerificationResult
175
+ */
176
+ export declare function isVerificationResult(value: unknown): value is VerificationResult;
177
+ /**
178
+ * Type guard for IdentityConfig
179
+ */
180
+ export declare function isIdentityConfig(value: unknown): value is IdentityConfig;
181
+ /**
182
+ * Validates IdentityConfig and throws detailed errors
183
+ */
184
+ export declare function validateIdentityConfig(value: unknown): IdentityConfig;
185
+ /**
186
+ * Constructs the signed data string from components
187
+ * Format: actor|signedAt|requestHash
188
+ */
189
+ export declare function constructSignedData(data: SignedData): string;
190
+ /**
191
+ * Parses a signed data string into components
192
+ * Format: actor|signedAt|requestHash
193
+ */
194
+ export declare function parseSignedData(signedDataString: string): SignedData;
195
+ /**
196
+ * Checks if a signature timestamp is within the allowed time tolerance
197
+ *
198
+ * @param signedAt - The timestamp when the request was signed
199
+ * @param tolerance - Time tolerance in milliseconds (default: 5 minutes)
200
+ * @param now - Current timestamp for testing (defaults to now)
201
+ * @returns Object with validity and age information
202
+ */
203
+ export declare function checkTimeTolerance(signedAt: Timestamp, tolerance?: number, now?: Date): {
204
+ valid: boolean;
205
+ ageMs: number;
206
+ expiredBy?: number;
207
+ };
208
+ /**
209
+ * Checks time tolerance and throws if expired
210
+ */
211
+ export declare function validateTimeTolerance2(signedAt: Timestamp, tolerance?: number, now?: Date): void;
212
+ /**
213
+ * Creates a successful verification result
214
+ */
215
+ export declare function verificationSuccess(actor: string, ageMs?: number): VerificationResult;
216
+ /**
217
+ * Creates a failed verification result
218
+ */
219
+ export declare function verificationFailure(status: VerificationStatus, error: string, details?: VerificationResult['details']): VerificationResult;
220
+ /**
221
+ * Creates a "not signed" result (may be allowed in soft/hybrid mode)
222
+ */
223
+ export declare function verificationNotSigned(allowed: boolean, actor?: string): VerificationResult;
224
+ /**
225
+ * Verifies an Ed25519 signature using Bun's native crypto
226
+ *
227
+ * @param publicKey - Base64-encoded Ed25519 public key
228
+ * @param signature - Base64-encoded Ed25519 signature
229
+ * @param data - The data that was signed (as string or Uint8Array)
230
+ * @returns true if signature is valid, false otherwise
231
+ */
232
+ export declare function verifyEd25519Signature(publicKey: PublicKey, signature: Signature, data: string | Uint8Array): Promise<boolean>;
233
+ /**
234
+ * Signs data using Ed25519 (for testing purposes)
235
+ * In production, signing should be done by the entity externally
236
+ *
237
+ * @param privateKey - Base64-encoded Ed25519 private key in PKCS8 format
238
+ * @param data - The data to sign
239
+ * @returns Base64-encoded signature
240
+ */
241
+ export declare function signEd25519(privateKey: string, data: string | Uint8Array): Promise<Signature>;
242
+ /**
243
+ * Generates a new Ed25519 keypair (for testing purposes)
244
+ *
245
+ * @returns Object with base64-encoded public and private keys (PKCS8 format for private)
246
+ */
247
+ export declare function generateEd25519Keypair(): Promise<{
248
+ publicKey: PublicKey;
249
+ privateKey: string;
250
+ }>;
251
+ /**
252
+ * Entity lookup function type for verification
253
+ */
254
+ export type EntityLookup = (actor: string) => Promise<{
255
+ publicKey?: string;
256
+ } | null>;
257
+ /**
258
+ * Full verification options
259
+ */
260
+ export interface VerifySignatureOptions {
261
+ /** The signed request fields */
262
+ signedRequest: SignedRequestFields;
263
+ /** The hash of the request body */
264
+ requestHash: string;
265
+ /** Function to look up entity by name */
266
+ lookupEntity: EntityLookup;
267
+ /** Identity configuration */
268
+ config?: Partial<IdentityConfig>;
269
+ /** Current time for testing */
270
+ now?: Date;
271
+ }
272
+ /**
273
+ * Performs full signature verification pipeline
274
+ *
275
+ * 1. Validates signature format
276
+ * 2. Looks up entity's public key
277
+ * 3. Constructs signed data
278
+ * 4. Checks time tolerance
279
+ * 5. Verifies signature cryptographically
280
+ */
281
+ export declare function verifySignature(options: VerifySignatureOptions): Promise<VerificationResult>;
282
+ /**
283
+ * Determines if a request should be allowed based on identity mode
284
+ */
285
+ export declare function shouldAllowRequest(mode: IdentityMode, verificationResult: VerificationResult): boolean;
286
+ /**
287
+ * Creates a SHA256 hash of the request body for signing
288
+ */
289
+ export declare function hashRequestBody(body: string | object): Promise<string>;
290
+ /**
291
+ * Creates a signed request from signing input
292
+ */
293
+ export declare function createSignedRequest(input: SigningInput, privateKey: string, signedAt?: Timestamp): Promise<SignedRequestFields>;
294
+ /**
295
+ * Merges partial config with defaults
296
+ */
297
+ export declare function createIdentityConfig(partial?: Partial<IdentityConfig>): IdentityConfig;
298
+ /**
299
+ * Sources from which actor identity can be determined
300
+ */
301
+ export declare const ActorSource: {
302
+ /** Explicitly provided in the operation */
303
+ readonly EXPLICIT: "explicit";
304
+ /** From CLI --actor flag */
305
+ readonly CLI_FLAG: "cli_flag";
306
+ /** From configuration file */
307
+ readonly CONFIG: "config";
308
+ /** From element's createdBy field (fallback) */
309
+ readonly ELEMENT: "element";
310
+ /** System-generated operations */
311
+ readonly SYSTEM: "system";
312
+ };
313
+ export type ActorSource = (typeof ActorSource)[keyof typeof ActorSource];
314
+ /**
315
+ * Actor context for tracking who is performing an operation
316
+ */
317
+ export interface ActorContext {
318
+ /** The actor's entity ID or name */
319
+ readonly actor: string;
320
+ /** Where the actor identity came from */
321
+ readonly source: ActorSource;
322
+ /** Whether the actor has been verified (always false in soft mode) */
323
+ readonly verified: boolean;
324
+ /** Optional entity ID if the actor was looked up and exists */
325
+ readonly entityId?: string;
326
+ }
327
+ /**
328
+ * Options for resolving actor context
329
+ */
330
+ export interface ActorResolutionOptions {
331
+ /** Explicitly provided actor (highest priority) */
332
+ explicitActor?: string;
333
+ /** Actor from CLI flag */
334
+ cliActor?: string;
335
+ /** Actor from configuration */
336
+ configActor?: string;
337
+ /** Fallback actor from element's createdBy (lowest priority) */
338
+ elementCreatedBy?: string;
339
+ /** Identity configuration */
340
+ config?: Partial<IdentityConfig>;
341
+ /** Function to look up entity by name */
342
+ lookupEntity?: EntityLookup;
343
+ }
344
+ /**
345
+ * Result of actor validation
346
+ */
347
+ export interface ActorValidationResult {
348
+ /** Whether the actor is valid */
349
+ valid: boolean;
350
+ /** The resolved actor context if valid */
351
+ context?: ActorContext;
352
+ /** Error message if invalid */
353
+ error?: string;
354
+ /** Whether the actor entity exists (only checked in soft mode with lookupEntity) */
355
+ entityExists?: boolean;
356
+ }
357
+ /**
358
+ * Resolves actor context from multiple sources
359
+ *
360
+ * Priority order (highest to lowest):
361
+ * 1. Explicit actor (provided in operation)
362
+ * 2. CLI actor (--actor flag)
363
+ * 3. Config actor (default actor in config)
364
+ * 4. Element's createdBy (fallback for updates/deletes)
365
+ *
366
+ * @param options - Resolution options with actor sources
367
+ * @returns The resolved actor context
368
+ * @throws ValidationError if no actor can be resolved
369
+ */
370
+ export declare function resolveActor(options: ActorResolutionOptions): ActorContext;
371
+ /**
372
+ * Validates an actor in soft identity mode
373
+ *
374
+ * In soft mode:
375
+ * - Accepts any non-empty string as actor
376
+ * - Optionally checks if entity exists (if lookupEntity provided and allowUnregisteredActors is false)
377
+ * - Always returns verified: false
378
+ *
379
+ * @param actor - The actor name/ID to validate
380
+ * @param options - Validation options
381
+ * @returns Validation result with context if valid
382
+ */
383
+ export declare function validateSoftActor(actor: string, options?: {
384
+ lookupEntity?: EntityLookup;
385
+ config?: Partial<IdentityConfig>;
386
+ }): Promise<ActorValidationResult>;
387
+ /**
388
+ * Type guard for ActorContext
389
+ */
390
+ export declare function isActorContext(value: unknown): value is ActorContext;
391
+ /**
392
+ * Creates an actor context for system operations
393
+ */
394
+ export declare function createSystemActorContext(): ActorContext;
395
+ /**
396
+ * Creates an actor context from an explicit actor string
397
+ */
398
+ export declare function createActorContext(actor: string, source?: ActorSource): ActorContext;
399
+ /**
400
+ * Middleware context for request verification
401
+ */
402
+ export interface MiddlewareContext {
403
+ /** The actor making the request (if authenticated) */
404
+ actor?: string;
405
+ /** Whether the request was verified cryptographically */
406
+ verified: boolean;
407
+ /** The verification result (if verification was attempted) */
408
+ verificationResult?: VerificationResult;
409
+ /** The identity mode used */
410
+ mode: IdentityMode;
411
+ }
412
+ /**
413
+ * Request object that may contain signed fields
414
+ */
415
+ export interface SignableRequest {
416
+ /** Optional signed request fields for cryptographic verification */
417
+ signedRequest?: SignedRequestFields;
418
+ /** The request body (used to compute hash for verification) */
419
+ body?: string | object;
420
+ }
421
+ /**
422
+ * Middleware result
423
+ */
424
+ export interface MiddlewareResult {
425
+ /** Whether the request is allowed to proceed */
426
+ allowed: boolean;
427
+ /** The middleware context with authentication info */
428
+ context: MiddlewareContext;
429
+ /** Error message if not allowed */
430
+ error?: string;
431
+ }
432
+ /**
433
+ * Options for verification middleware
434
+ */
435
+ export interface VerificationMiddlewareOptions {
436
+ /** Identity configuration */
437
+ config?: Partial<IdentityConfig>;
438
+ /** Function to look up entity by actor name */
439
+ lookupEntity: EntityLookup;
440
+ /** Current time (for testing) */
441
+ now?: Date;
442
+ }
443
+ /**
444
+ * Creates a verification middleware function
445
+ *
446
+ * The middleware:
447
+ * 1. Checks identity mode from config
448
+ * 2. In soft mode: allows all requests, extracts actor if provided
449
+ * 3. In cryptographic mode: requires valid signature
450
+ * 4. In hybrid mode: allows unsigned or validly signed requests
451
+ *
452
+ * @param options - Middleware options
453
+ * @returns A middleware function that verifies requests
454
+ *
455
+ * @example
456
+ * ```typescript
457
+ * const middleware = createVerificationMiddleware({
458
+ * lookupEntity: (actor) => api.lookupEntityByName(actor),
459
+ * config: { mode: IdentityMode.CRYPTOGRAPHIC }
460
+ * });
461
+ *
462
+ * const result = await middleware(request);
463
+ * if (!result.allowed) {
464
+ * throw new Error(result.error);
465
+ * }
466
+ * // Use result.context.actor for the verified actor
467
+ * ```
468
+ */
469
+ export declare function createVerificationMiddleware(options: VerificationMiddlewareOptions): (request: SignableRequest) => Promise<MiddlewareResult>;
470
+ /**
471
+ * Creates middleware context for an unsigned request in soft mode
472
+ */
473
+ export declare function createSoftModeContext(actor?: string): MiddlewareContext;
474
+ /**
475
+ * Creates middleware context for a verified request
476
+ */
477
+ export declare function createVerifiedContext(actor: string, verificationResult: VerificationResult): MiddlewareContext;
478
+ export {};
479
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/systems/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAA6C,SAAS,EAAoB,MAAM,kBAAkB,CAAC;AAM1G;;GAEG;AACH,eAAO,MAAM,YAAY;IACvB,yDAAyD;;IAEzD,qDAAqD;;IAErD,+DAA+D;;CAEvD,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAA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