@cortexkit/opencode-antigravity-auth 3.0.10 → 3.0.12

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 (110) hide show
  1. package/dist/cli.js +2077 -1451
  2. package/dist/cli.js.map +4 -4
  3. package/dist/cli.meta.json +207 -120
  4. package/dist/index.js +1526 -861
  5. package/dist/index.js.map +4 -4
  6. package/dist/index.meta.json +214 -127
  7. package/dist/server.js +1524 -859
  8. package/dist/server.js.map +4 -4
  9. package/dist/server.meta.json +1 -1
  10. package/dist/src/common-auth-embedded/claustrum/consumer.d.ts +7 -1
  11. package/dist/src/common-auth-embedded/claustrum/consumer.js +17 -2
  12. package/dist/src/common-auth-embedded/claustrum/enrollment.d.ts +5 -0
  13. package/dist/src/common-auth-embedded/claustrum/enrollment.js +27 -0
  14. package/dist/src/common-auth-embedded/claustrum/errors.d.ts +1 -1
  15. package/dist/src/common-auth-embedded/claustrum/index.d.ts +1 -1
  16. package/dist/src/common-auth-embedded/claustrum/index.js +1 -1
  17. package/dist/src/common-auth-embedded/claustrum/quota-writer.js +4 -54
  18. package/dist/src/common-auth-embedded/claustrum/roster.d.ts +31 -0
  19. package/dist/src/common-auth-embedded/claustrum/roster.js +72 -0
  20. package/dist/src/common-auth-embedded/commands/builtins.d.ts +37 -0
  21. package/dist/src/common-auth-embedded/commands/builtins.js +95 -13
  22. package/dist/src/common-auth-embedded/commands/index.d.ts +1 -1
  23. package/dist/src/common-auth-embedded/fs/private-files.d.ts +2 -0
  24. package/dist/src/common-auth-embedded/fs/private-files.js +49 -3
  25. package/dist/src/common-auth-embedded/opencode2/install.d.ts +3 -2
  26. package/dist/src/common-auth-embedded/opencode2/install.js +184 -63
  27. package/dist/src/common-auth-embedded/opencode2/types.d.ts +43 -6
  28. package/dist/src/common-auth-embedded/quota/pending.js +48 -0
  29. package/dist/src/common-auth-embedded/setup/enroll.d.ts +34 -0
  30. package/dist/src/common-auth-embedded/setup/enroll.js +116 -34
  31. package/dist/src/common-auth-embedded/setup/index.d.ts +1 -0
  32. package/dist/src/common-auth-embedded/setup/index.js +1 -0
  33. package/dist/src/common-auth-embedded/setup/process-fence.d.ts +7 -0
  34. package/dist/src/common-auth-embedded/setup/process-fence.js +56 -1
  35. package/dist/src/common-auth-embedded/setup/types.d.ts +5 -0
  36. package/dist/src/common-auth-embedded/source-output.json +121 -97
  37. package/dist/src/common-auth-embedded/store/attribution.d.ts +5 -0
  38. package/dist/src/common-auth-embedded/store/attribution.js +39 -25
  39. package/dist/src/common-auth-embedded/store/pool.d.ts +17 -0
  40. package/dist/src/common-auth-embedded/store/pool.js +18 -3
  41. package/dist/src/common-auth-embedded/store/pull.js +3 -1
  42. package/dist/src/common-auth-embedded/store/quota-writer.js +298 -0
  43. package/dist/src/common-auth-embedded/store/runtime.d.ts +2 -0
  44. package/dist/src/plugin/lifecycle.d.ts.map +1 -1
  45. package/dist/src/plugin/lifecycle.js +48 -27
  46. package/dist/src/plugin/lifecycle.js.map +1 -1
  47. package/dist/src/plugin/shared/request-services.d.ts.map +1 -1
  48. package/dist/src/plugin/shared/request-services.js +3 -2
  49. package/dist/src/plugin/shared/request-services.js.map +1 -1
  50. package/dist/src/plugin/vault-custody.d.ts.map +1 -1
  51. package/dist/src/plugin/vault-custody.js +13 -3
  52. package/dist/src/plugin/vault-custody.js.map +1 -1
  53. package/dist/tui-build-map.json +5 -5
  54. package/dist/tui-ga-build-map.json +1 -1
  55. package/dist/types/src/common-auth-embedded/claustrum/consumer.d.ts +7 -1
  56. package/dist/types/src/common-auth-embedded/claustrum/enrollment.d.ts +5 -0
  57. package/dist/types/src/common-auth-embedded/claustrum/errors.d.ts +1 -1
  58. package/dist/types/src/common-auth-embedded/claustrum/index.d.ts +1 -1
  59. package/dist/types/src/common-auth-embedded/claustrum/roster.d.ts +31 -0
  60. package/dist/types/src/common-auth-embedded/commands/builtins.d.ts +37 -0
  61. package/dist/types/src/common-auth-embedded/commands/index.d.ts +1 -1
  62. package/dist/types/src/common-auth-embedded/opencode2/install.d.ts +3 -2
  63. package/dist/types/src/common-auth-embedded/opencode2/types.d.ts +43 -6
  64. package/dist/types/src/common-auth-embedded/setup/enroll.d.ts +34 -0
  65. package/dist/types/src/common-auth-embedded/setup/index.d.ts +1 -0
  66. package/dist/types/src/common-auth-embedded/setup/process-fence.d.ts +7 -0
  67. package/dist/types/src/common-auth-embedded/setup/types.d.ts +5 -0
  68. package/dist/types/src/common-auth-embedded/store/attribution.d.ts +5 -0
  69. package/dist/types/src/common-auth-embedded/store/pool.d.ts +17 -0
  70. package/dist/types/src/common-auth-embedded/store/runtime.d.ts +2 -0
  71. package/dist/types/src/plugin/lifecycle.d.ts.map +1 -1
  72. package/dist/types/src/plugin/shared/request-services.d.ts.map +1 -1
  73. package/dist/types/src/plugin/vault-custody.d.ts.map +1 -1
  74. package/package.json +2 -2
  75. package/src/common-auth-embedded/claustrum/consumer.d.ts +7 -1
  76. package/src/common-auth-embedded/claustrum/consumer.js +17 -2
  77. package/src/common-auth-embedded/claustrum/enrollment.d.ts +5 -0
  78. package/src/common-auth-embedded/claustrum/enrollment.js +27 -0
  79. package/src/common-auth-embedded/claustrum/errors.d.ts +1 -1
  80. package/src/common-auth-embedded/claustrum/index.d.ts +1 -1
  81. package/src/common-auth-embedded/claustrum/index.js +1 -1
  82. package/src/common-auth-embedded/claustrum/quota-writer.js +4 -54
  83. package/src/common-auth-embedded/claustrum/roster.d.ts +31 -0
  84. package/src/common-auth-embedded/claustrum/roster.js +72 -0
  85. package/src/common-auth-embedded/commands/builtins.d.ts +37 -0
  86. package/src/common-auth-embedded/commands/builtins.js +95 -13
  87. package/src/common-auth-embedded/commands/index.d.ts +1 -1
  88. package/src/common-auth-embedded/fs/private-files.d.ts +2 -0
  89. package/src/common-auth-embedded/fs/private-files.js +49 -3
  90. package/src/common-auth-embedded/opencode2/install.d.ts +3 -2
  91. package/src/common-auth-embedded/opencode2/install.js +184 -63
  92. package/src/common-auth-embedded/opencode2/types.d.ts +43 -6
  93. package/src/common-auth-embedded/quota/pending.js +48 -0
  94. package/src/common-auth-embedded/setup/enroll.d.ts +34 -0
  95. package/src/common-auth-embedded/setup/enroll.js +116 -34
  96. package/src/common-auth-embedded/setup/index.d.ts +1 -0
  97. package/src/common-auth-embedded/setup/index.js +1 -0
  98. package/src/common-auth-embedded/setup/process-fence.d.ts +7 -0
  99. package/src/common-auth-embedded/setup/process-fence.js +56 -1
  100. package/src/common-auth-embedded/setup/types.d.ts +5 -0
  101. package/src/common-auth-embedded/source-output.json +121 -97
  102. package/src/common-auth-embedded/store/attribution.d.ts +5 -0
  103. package/src/common-auth-embedded/store/attribution.js +39 -25
  104. package/src/common-auth-embedded/store/pool.d.ts +17 -0
  105. package/src/common-auth-embedded/store/pool.js +18 -3
  106. package/src/common-auth-embedded/store/pull.js +3 -1
  107. package/src/common-auth-embedded/store/quota-writer.js +298 -0
  108. package/src/common-auth-embedded/store/runtime.d.ts +2 -0
  109. package/src/tui-compiled/common-auth-embedded/fs/private-files.js +49 -3
  110. package/src/tui-raw/common-auth-embedded/fs/private-files.js +49 -3
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "package": "@cortexkit/common-auth",
4
- "version": "0.23.0",
4
+ "version": "0.26.0",
5
5
  "artifactStatus": "published",
6
6
  "publicRoots": {
7
7
  "./rpc": {
@@ -61,15 +61,15 @@
61
61
  "import": "./dist/opencode2/index.js"
62
62
  }
63
63
  },
64
- "input": "tools/common-auth-build/inputs/cortexkit-common-auth-0.23.0.tgz",
65
- "tarballSha256": "8a2cd4a5df7c056c4f815c8cd59b109ceb02135eb7b7b0e14a1b3d9891af2cfb",
66
- "sri": "sha512-WwCjPwOhbZBomCAPxEooCiSDgvcaIsEn5yjTqmEy0PU0ZJUKSr3cE8Il0AsW7xU2h2Wo267rsciZhV3rPlUPCA==",
67
- "canonicalFiles": 184,
68
- "canonicalBytes": 1054172,
64
+ "input": "tools/common-auth-build/inputs/cortexkit-common-auth-0.26.0.tgz",
65
+ "tarballSha256": "a5a6cb7051ee8c45e86e19cf7a918d0e28ce1b6a80301e982efbc7bb4b98208d",
66
+ "sri": "sha512-qTmQ9aMG+HcyDbhKie8Nq9wxKMRQ6GXH2hKq8Fab9kHqFfzswdp2NpXofGY52RhQ2VxuyMOQr5T6lUrkbny5VQ==",
67
+ "canonicalFiles": 187,
68
+ "canonicalBytes": 1104078,
69
69
  "generator": {
70
70
  "path": "packages/opencode/scripts/embed-common-auth.ts",
71
71
  "version": 3,
72
- "sha256": "886385f4eedd9fcd82bcb3e7751e0c7193fbb6c59238fa35be82909635955dbf"
72
+ "sha256": "89dbeb07d77e0657abeb72a40fcc03a900e98292956865252349a01a15999ed0"
73
73
  },
74
74
  "files": [
75
75
  {
@@ -251,17 +251,17 @@
251
251
  {
252
252
  "source": "package/dist/claustrum/consumer.d.ts",
253
253
  "output": "claustrum/consumer.d.ts",
254
- "bytes": 9548,
255
- "sourceSha256": "150eac9038881740a78e5664501a6ef0aa5e177a6dd46854cbeaf38513463e90",
256
- "outputSha256": "150eac9038881740a78e5664501a6ef0aa5e177a6dd46854cbeaf38513463e90",
254
+ "bytes": 9907,
255
+ "sourceSha256": "8001ce3f928af1bc9124223071eb9c85ea3273436cd7be073c588217f942b248",
256
+ "outputSha256": "8001ce3f928af1bc9124223071eb9c85ea3273436cd7be073c588217f942b248",
257
257
  "transform": "verbatim"
258
258
  },
259
259
  {
260
260
  "source": "package/dist/claustrum/consumer.js",
261
261
  "output": "claustrum/consumer.js",
262
- "bytes": 25698,
263
- "sourceSha256": "ec47dc016bf4d95655c17093a78d9c214b623214c821d352f73ea60f830c0d83",
264
- "outputSha256": "ec47dc016bf4d95655c17093a78d9c214b623214c821d352f73ea60f830c0d83",
262
+ "bytes": 26470,
263
+ "sourceSha256": "b2087accd6e8759fb49173dc744243ed703520d5011386ef514672be8fe79fbe",
264
+ "outputSha256": "b2087accd6e8759fb49173dc744243ed703520d5011386ef514672be8fe79fbe",
265
265
  "transform": "verbatim"
266
266
  },
267
267
  {
@@ -283,25 +283,25 @@
283
283
  {
284
284
  "source": "package/dist/claustrum/enrollment.d.ts",
285
285
  "output": "claustrum/enrollment.d.ts",
286
- "bytes": 7743,
287
- "sourceSha256": "7503e56a09f94e77a94a7ae15fd616f149ec9f675ec7c79bdea4a014ca014143",
288
- "outputSha256": "7503e56a09f94e77a94a7ae15fd616f149ec9f675ec7c79bdea4a014ca014143",
286
+ "bytes": 7976,
287
+ "sourceSha256": "d6b4e8561ccc0ff2f9b4386856c5fe3dc7c475e13f98314a0666d0b20458d43b",
288
+ "outputSha256": "d6b4e8561ccc0ff2f9b4386856c5fe3dc7c475e13f98314a0666d0b20458d43b",
289
289
  "transform": "verbatim"
290
290
  },
291
291
  {
292
292
  "source": "package/dist/claustrum/enrollment.js",
293
293
  "output": "claustrum/enrollment.js",
294
- "bytes": 33520,
295
- "sourceSha256": "eeac604495c093503007478ab803c05b6e0bce8bf281f8bf9bbfee44c8ff85f1",
296
- "outputSha256": "eeac604495c093503007478ab803c05b6e0bce8bf281f8bf9bbfee44c8ff85f1",
294
+ "bytes": 35060,
295
+ "sourceSha256": "a9ca3a23778cc86ab9798051ba19dcb3b2b8e3dc4c4fda356cbd56eca50097db",
296
+ "outputSha256": "a9ca3a23778cc86ab9798051ba19dcb3b2b8e3dc4c4fda356cbd56eca50097db",
297
297
  "transform": "verbatim"
298
298
  },
299
299
  {
300
300
  "source": "package/dist/claustrum/errors.d.ts",
301
301
  "output": "claustrum/errors.d.ts",
302
- "bytes": 1145,
303
- "sourceSha256": "b7533d4c281807224d6d05f4bb7a596006862a6c05dc4462fae02af388054bce",
304
- "outputSha256": "b7533d4c281807224d6d05f4bb7a596006862a6c05dc4462fae02af388054bce",
302
+ "bytes": 1163,
303
+ "sourceSha256": "a6e5ec8be3ae7160b78456e642b440494604c2e2cdc987550744521dc873fb40",
304
+ "outputSha256": "a6e5ec8be3ae7160b78456e642b440494604c2e2cdc987550744521dc873fb40",
305
305
  "transform": "verbatim"
306
306
  },
307
307
  {
@@ -331,17 +331,17 @@
331
331
  {
332
332
  "source": "package/dist/claustrum/index.d.ts",
333
333
  "output": "claustrum/index.d.ts",
334
- "bytes": 3761,
335
- "sourceSha256": "f2c1b8d99048666c068805b08b430492b2632be08e2beda466ee56b871572847",
336
- "outputSha256": "f2c1b8d99048666c068805b08b430492b2632be08e2beda466ee56b871572847",
334
+ "bytes": 3844,
335
+ "sourceSha256": "36c0b94c5e18972463f48bfd7e1506d9655372aa8df065786b3a47d199cdb5e0",
336
+ "outputSha256": "36c0b94c5e18972463f48bfd7e1506d9655372aa8df065786b3a47d199cdb5e0",
337
337
  "transform": "verbatim"
338
338
  },
339
339
  {
340
340
  "source": "package/dist/claustrum/index.js",
341
341
  "output": "claustrum/index.js",
342
- "bytes": 2509,
343
- "sourceSha256": "5f8b4bebfc2dec055b69769adcd1ce48ad7acc2c26256edbe4a2e984dc788147",
344
- "outputSha256": "5f8b4bebfc2dec055b69769adcd1ce48ad7acc2c26256edbe4a2e984dc788147",
342
+ "bytes": 2529,
343
+ "sourceSha256": "42c9e67bb5ec6749de488933a56fb3ee253c3b9e3588d692f171d87c59bcbd89",
344
+ "outputSha256": "42c9e67bb5ec6749de488933a56fb3ee253c3b9e3588d692f171d87c59bcbd89",
345
345
  "transform": "verbatim"
346
346
  },
347
347
  {
@@ -387,25 +387,25 @@
387
387
  {
388
388
  "source": "package/dist/claustrum/quota-writer.js",
389
389
  "output": "claustrum/quota-writer.js",
390
- "bytes": 9694,
391
- "sourceSha256": "5a7d5d1059dcadc06aa41e81e0707cc444636473822047f0ec72da7589c770f1",
392
- "outputSha256": "5a7d5d1059dcadc06aa41e81e0707cc444636473822047f0ec72da7589c770f1",
390
+ "bytes": 7579,
391
+ "sourceSha256": "0054a12ca94aab2eecf50f9b5e090879ff184e7f286cc979f32d311e22011906",
392
+ "outputSha256": "0054a12ca94aab2eecf50f9b5e090879ff184e7f286cc979f32d311e22011906",
393
393
  "transform": "verbatim"
394
394
  },
395
395
  {
396
396
  "source": "package/dist/claustrum/roster.d.ts",
397
397
  "output": "claustrum/roster.d.ts",
398
- "bytes": 10931,
399
- "sourceSha256": "c394bc08c7cce4dc68fd539ac03cb200727534693600c7daf5ba7c9c4d0618ce",
400
- "outputSha256": "c394bc08c7cce4dc68fd539ac03cb200727534693600c7daf5ba7c9c4d0618ce",
398
+ "bytes": 12574,
399
+ "sourceSha256": "c9ab3a89e04f72de09c5f15ccf1436b91f8a245e2253f24ec5998120058aebe7",
400
+ "outputSha256": "c9ab3a89e04f72de09c5f15ccf1436b91f8a245e2253f24ec5998120058aebe7",
401
401
  "transform": "verbatim"
402
402
  },
403
403
  {
404
404
  "source": "package/dist/claustrum/roster.js",
405
405
  "output": "claustrum/roster.js",
406
- "bytes": 27602,
407
- "sourceSha256": "45ed2d4e69fad154ce86f5ff4f839c2ae9269dd9146ce7a8b2e5b6f49476ddf8",
408
- "outputSha256": "45ed2d4e69fad154ce86f5ff4f839c2ae9269dd9146ce7a8b2e5b6f49476ddf8",
406
+ "bytes": 30876,
407
+ "sourceSha256": "d02184fd4d32aa8917369919edea4c44328e7332e30f3ddc41ce350e5fd1df07",
408
+ "outputSha256": "d02184fd4d32aa8917369919edea4c44328e7332e30f3ddc41ce350e5fd1df07",
409
409
  "transform": "verbatim"
410
410
  },
411
411
  {
@@ -427,25 +427,25 @@
427
427
  {
428
428
  "source": "package/dist/commands/builtins.d.ts",
429
429
  "output": "commands/builtins.d.ts",
430
- "bytes": 2931,
431
- "sourceSha256": "b70028ea58b51d344e83ac62f36fa95499ab32af753e657ade8116491488bab9",
432
- "outputSha256": "b70028ea58b51d344e83ac62f36fa95499ab32af753e657ade8116491488bab9",
430
+ "bytes": 4576,
431
+ "sourceSha256": "5ab6cbab696c91fef0fc7288d4b82803cd0bac809b68f939d73671505fc1d894",
432
+ "outputSha256": "5ab6cbab696c91fef0fc7288d4b82803cd0bac809b68f939d73671505fc1d894",
433
433
  "transform": "verbatim"
434
434
  },
435
435
  {
436
436
  "source": "package/dist/commands/builtins.js",
437
437
  "output": "commands/builtins.js",
438
- "bytes": 21323,
439
- "sourceSha256": "9b3461ace8a585dde5eff3f9b709ddc766ab3d77e680b687499efd1871a341ce",
440
- "outputSha256": "9b3461ace8a585dde5eff3f9b709ddc766ab3d77e680b687499efd1871a341ce",
438
+ "bytes": 25155,
439
+ "sourceSha256": "c5f7fca0e36dc2f3253b88e7600d3dbed6a193d2b8abbf07d16913b6b46551e6",
440
+ "outputSha256": "c5f7fca0e36dc2f3253b88e7600d3dbed6a193d2b8abbf07d16913b6b46551e6",
441
441
  "transform": "verbatim"
442
442
  },
443
443
  {
444
444
  "source": "package/dist/commands/index.d.ts",
445
445
  "output": "commands/index.d.ts",
446
- "bytes": 1081,
447
- "sourceSha256": "cfe14cdf7ae83a3bf37cfc3e4199c8f80e7720b982a0e875064113b1461c2967",
448
- "outputSha256": "cfe14cdf7ae83a3bf37cfc3e4199c8f80e7720b982a0e875064113b1461c2967",
446
+ "bytes": 1100,
447
+ "sourceSha256": "4be7eec728211b7ad707121b1f2bbe2c219574aaa4e1c5be3f8964b185d4377c",
448
+ "outputSha256": "4be7eec728211b7ad707121b1f2bbe2c219574aaa4e1c5be3f8964b185d4377c",
449
449
  "transform": "verbatim"
450
450
  },
451
451
  {
@@ -571,17 +571,17 @@
571
571
  {
572
572
  "source": "package/dist/fs/private-files.d.ts",
573
573
  "output": "fs/private-files.d.ts",
574
- "bytes": 3228,
575
- "sourceSha256": "1882d869cfebb3cebc8b9db47fb15083f8300c51c26c71666e898377fcd9a1ba",
576
- "outputSha256": "1882d869cfebb3cebc8b9db47fb15083f8300c51c26c71666e898377fcd9a1ba",
574
+ "bytes": 3398,
575
+ "sourceSha256": "b344509a32fcd983f09e5814286630a53c8e577ad1b973eabe19f8e58659e8d3",
576
+ "outputSha256": "b344509a32fcd983f09e5814286630a53c8e577ad1b973eabe19f8e58659e8d3",
577
577
  "transform": "verbatim"
578
578
  },
579
579
  {
580
580
  "source": "package/dist/fs/private-files.js",
581
581
  "output": "fs/private-files.js",
582
- "bytes": 12448,
583
- "sourceSha256": "1c8f34202b535d774d8c1a53bd403255f02701760c7378e020756c02c55a97c4",
584
- "outputSha256": "1c8f34202b535d774d8c1a53bd403255f02701760c7378e020756c02c55a97c4",
582
+ "bytes": 14779,
583
+ "sourceSha256": "114c06ce4c0998087878d99c5dc37425e90d5fad205f57fe0bdf9694e3c8e31d",
584
+ "outputSha256": "114c06ce4c0998087878d99c5dc37425e90d5fad205f57fe0bdf9694e3c8e31d",
585
585
  "transform": "verbatim"
586
586
  },
587
587
  {
@@ -715,17 +715,17 @@
715
715
  {
716
716
  "source": "package/dist/opencode2/install.d.ts",
717
717
  "output": "opencode2/install.d.ts",
718
- "bytes": 3566,
719
- "sourceSha256": "9bdc589d379c353b74b401b3b4fc3eff6ab2fef19ab8a6737f4595b8155c9025",
720
- "outputSha256": "9bdc589d379c353b74b401b3b4fc3eff6ab2fef19ab8a6737f4595b8155c9025",
718
+ "bytes": 3658,
719
+ "sourceSha256": "7d7ee46966c9dba09c706a799496e798752780d0967c62fa922e243df3038ad5",
720
+ "outputSha256": "7d7ee46966c9dba09c706a799496e798752780d0967c62fa922e243df3038ad5",
721
721
  "transform": "verbatim"
722
722
  },
723
723
  {
724
724
  "source": "package/dist/opencode2/install.js",
725
725
  "output": "opencode2/install.js",
726
- "bytes": 36235,
727
- "sourceSha256": "9b16eb3d63bf5167d2f0fa660eb6576f66d012af245d592d59062014cc8669e7",
728
- "outputSha256": "9b16eb3d63bf5167d2f0fa660eb6576f66d012af245d592d59062014cc8669e7",
726
+ "bytes": 42489,
727
+ "sourceSha256": "82b12a88456d3fec034cf52dad13aa0a2736bc4c0dbbfb4b32bb98e6fcc899b6",
728
+ "outputSha256": "82b12a88456d3fec034cf52dad13aa0a2736bc4c0dbbfb4b32bb98e6fcc899b6",
729
729
  "transform": "verbatim"
730
730
  },
731
731
  {
@@ -763,9 +763,9 @@
763
763
  {
764
764
  "source": "package/dist/opencode2/types.d.ts",
765
765
  "output": "opencode2/types.d.ts",
766
- "bytes": 19205,
767
- "sourceSha256": "b612e0737e370f83e492afa59cb6f4205b6ab9743f0ec53c6272c754f24d2271",
768
- "outputSha256": "b612e0737e370f83e492afa59cb6f4205b6ab9743f0ec53c6272c754f24d2271",
766
+ "bytes": 21401,
767
+ "sourceSha256": "70033152b714eebab005a0b7fc5f84b95b0f14d1af579dc710200bbca3f8570f",
768
+ "outputSha256": "70033152b714eebab005a0b7fc5f84b95b0f14d1af579dc710200bbca3f8570f",
769
769
  "transform": "verbatim"
770
770
  },
771
771
  {
@@ -888,6 +888,14 @@
888
888
  "outputSha256": "b1d76faf1fb480b97ef1886ce75dbd2156002baedc39249468559cb4eece5bbb",
889
889
  "transform": "verbatim"
890
890
  },
891
+ {
892
+ "source": "package/dist/quota/pending.js",
893
+ "output": "quota/pending.js",
894
+ "bytes": 1876,
895
+ "sourceSha256": "e757a3fa9f8440190668c6154468a5baec8a84e20d6c831a6d7935c3b9bebe29",
896
+ "outputSha256": "e757a3fa9f8440190668c6154468a5baec8a84e20d6c831a6d7935c3b9bebe29",
897
+ "transform": "verbatim"
898
+ },
891
899
  {
892
900
  "source": "package/dist/quota/projection.d.ts",
893
901
  "output": "quota/projection.d.ts",
@@ -1160,28 +1168,36 @@
1160
1168
  "outputSha256": "025b5f7b429978cc3842cc72240b8bc154a86859ceb2ad3b5ad8636ab334e649",
1161
1169
  "transform": "verbatim"
1162
1170
  },
1171
+ {
1172
+ "source": "package/dist/setup/enroll.d.ts",
1173
+ "output": "setup/enroll.d.ts",
1174
+ "bytes": 2274,
1175
+ "sourceSha256": "067d636aea631befae2548b5aeed01dc10c22e9c44efb43c31496fe8c0a9ab68",
1176
+ "outputSha256": "067d636aea631befae2548b5aeed01dc10c22e9c44efb43c31496fe8c0a9ab68",
1177
+ "transform": "verbatim"
1178
+ },
1163
1179
  {
1164
1180
  "source": "package/dist/setup/enroll.js",
1165
1181
  "output": "setup/enroll.js",
1166
- "bytes": 4022,
1167
- "sourceSha256": "233b36d6422c93e7de0f7e73d1c09fdac54d8ae4090b15b91e1b99160e1ad0fa",
1168
- "outputSha256": "233b36d6422c93e7de0f7e73d1c09fdac54d8ae4090b15b91e1b99160e1ad0fa",
1182
+ "bytes": 8557,
1183
+ "sourceSha256": "dd21599c916733c327bca81c48372034a349a2840e50fac7d2d30b33668a1537",
1184
+ "outputSha256": "dd21599c916733c327bca81c48372034a349a2840e50fac7d2d30b33668a1537",
1169
1185
  "transform": "verbatim"
1170
1186
  },
1171
1187
  {
1172
1188
  "source": "package/dist/setup/index.d.ts",
1173
1189
  "output": "setup/index.d.ts",
1174
- "bytes": 842,
1175
- "sourceSha256": "43b22470cb458058db2bc628e6502f4cd55184deff519c86213dd8d0e3e0000e",
1176
- "outputSha256": "43b22470cb458058db2bc628e6502f4cd55184deff519c86213dd8d0e3e0000e",
1190
+ "bytes": 970,
1191
+ "sourceSha256": "f443b8d501334f8384878606ff19beee0241e70e7f4cc3dd0d0fd4636f8433c5",
1192
+ "outputSha256": "f443b8d501334f8384878606ff19beee0241e70e7f4cc3dd0d0fd4636f8433c5",
1177
1193
  "transform": "verbatim"
1178
1194
  },
1179
1195
  {
1180
1196
  "source": "package/dist/setup/index.js",
1181
1197
  "output": "setup/index.js",
1182
- "bytes": 517,
1183
- "sourceSha256": "4b00ca576b580ce54b53c2ef6c2a03d1e00c3fde9d3174328cd7458edd38ec79",
1184
- "outputSha256": "4b00ca576b580ce54b53c2ef6c2a03d1e00c3fde9d3174328cd7458edd38ec79",
1198
+ "bytes": 617,
1199
+ "sourceSha256": "3ab259b0ba5e5e6d83ea9077adf11e2c561d4a7788710adbb6e8e0ed88dcd44b",
1200
+ "outputSha256": "3ab259b0ba5e5e6d83ea9077adf11e2c561d4a7788710adbb6e8e0ed88dcd44b",
1185
1201
  "transform": "verbatim"
1186
1202
  },
1187
1203
  {
@@ -1195,17 +1211,17 @@
1195
1211
  {
1196
1212
  "source": "package/dist/setup/process-fence.d.ts",
1197
1213
  "output": "setup/process-fence.d.ts",
1198
- "bytes": 1897,
1199
- "sourceSha256": "12161c0ddc3ed14c50ff62dd441158aeaa5285bb49f6735c5b2e5b3a430364fb",
1200
- "outputSha256": "12161c0ddc3ed14c50ff62dd441158aeaa5285bb49f6735c5b2e5b3a430364fb",
1214
+ "bytes": 2223,
1215
+ "sourceSha256": "ed246d2c16821cc51170e4099466450e26821c81fc3b96ad2d7fde18ea4ee9c6",
1216
+ "outputSha256": "ed246d2c16821cc51170e4099466450e26821c81fc3b96ad2d7fde18ea4ee9c6",
1201
1217
  "transform": "verbatim"
1202
1218
  },
1203
1219
  {
1204
1220
  "source": "package/dist/setup/process-fence.js",
1205
1221
  "output": "setup/process-fence.js",
1206
- "bytes": 11015,
1207
- "sourceSha256": "ff848eb647b155a2dfbb8a201b5330b8b9ba3ac12dc6af7bc4f0f514d94a83c4",
1208
- "outputSha256": "ff848eb647b155a2dfbb8a201b5330b8b9ba3ac12dc6af7bc4f0f514d94a83c4",
1222
+ "bytes": 14008,
1223
+ "sourceSha256": "8ca9546a205fe9d6daecc2604c7e4608df5d09e0bd0f774fe8da40f26a3ffefb",
1224
+ "outputSha256": "8ca9546a205fe9d6daecc2604c7e4608df5d09e0bd0f774fe8da40f26a3ffefb",
1209
1225
  "transform": "verbatim"
1210
1226
  },
1211
1227
  {
@@ -1235,25 +1251,25 @@
1235
1251
  {
1236
1252
  "source": "package/dist/setup/types.d.ts",
1237
1253
  "output": "setup/types.d.ts",
1238
- "bytes": 5535,
1239
- "sourceSha256": "69f8ee1e9345d72dec1e04bb5ce9fa38e6cc77339f53ad042b625c636c415068",
1240
- "outputSha256": "69f8ee1e9345d72dec1e04bb5ce9fa38e6cc77339f53ad042b625c636c415068",
1254
+ "bytes": 5722,
1255
+ "sourceSha256": "db068b3f2428734ad731c120443c7e5a432f5d568a8a61c21c7978855e613063",
1256
+ "outputSha256": "db068b3f2428734ad731c120443c7e5a432f5d568a8a61c21c7978855e613063",
1241
1257
  "transform": "verbatim"
1242
1258
  },
1243
1259
  {
1244
1260
  "source": "package/dist/store/attribution.d.ts",
1245
1261
  "output": "store/attribution.d.ts",
1246
- "bytes": 1528,
1247
- "sourceSha256": "441dba300556a927e872597c1df3e4fbb1ac61c0a3989e98dcd3a94a773b8ed7",
1248
- "outputSha256": "441dba300556a927e872597c1df3e4fbb1ac61c0a3989e98dcd3a94a773b8ed7",
1262
+ "bytes": 1951,
1263
+ "sourceSha256": "16919a55fe944b459ff511c125ac2ba34714949d38db006c8ab047dd48ab51a6",
1264
+ "outputSha256": "16919a55fe944b459ff511c125ac2ba34714949d38db006c8ab047dd48ab51a6",
1249
1265
  "transform": "verbatim"
1250
1266
  },
1251
1267
  {
1252
1268
  "source": "package/dist/store/attribution.js",
1253
1269
  "output": "store/attribution.js",
1254
- "bytes": 2880,
1255
- "sourceSha256": "4bda762db5756c0d498d987aa3bc97eeee94be1c1ad2f005ed0ed46785e242d9",
1256
- "outputSha256": "4bda762db5756c0d498d987aa3bc97eeee94be1c1ad2f005ed0ed46785e242d9",
1270
+ "bytes": 3280,
1271
+ "sourceSha256": "5b54980a4f158c9b61cd90c4a83a14e83268fe98101fc88409500bb73d1126bb",
1272
+ "outputSha256": "5b54980a4f158c9b61cd90c4a83a14e83268fe98101fc88409500bb73d1126bb",
1257
1273
  "transform": "verbatim"
1258
1274
  },
1259
1275
  {
@@ -1339,17 +1355,17 @@
1339
1355
  {
1340
1356
  "source": "package/dist/store/pool.d.ts",
1341
1357
  "output": "store/pool.d.ts",
1342
- "bytes": 10785,
1343
- "sourceSha256": "192ea359d2ce746b31693cf06795a281f2e06804c567975f127ea05fa6fb4aef",
1344
- "outputSha256": "192ea359d2ce746b31693cf06795a281f2e06804c567975f127ea05fa6fb4aef",
1358
+ "bytes": 11743,
1359
+ "sourceSha256": "0693e165ef937c22c375a3f63d01209c844d101ddf1a6702c8acc99bb5fc2a9d",
1360
+ "outputSha256": "0693e165ef937c22c375a3f63d01209c844d101ddf1a6702c8acc99bb5fc2a9d",
1345
1361
  "transform": "verbatim"
1346
1362
  },
1347
1363
  {
1348
1364
  "source": "package/dist/store/pool.js",
1349
1365
  "output": "store/pool.js",
1350
- "bytes": 5671,
1351
- "sourceSha256": "8dc0d27b37204c2c3229296e8efbbfac6bcb30538b39d8d95771267487a06292",
1352
- "outputSha256": "8dc0d27b37204c2c3229296e8efbbfac6bcb30538b39d8d95771267487a06292",
1366
+ "bytes": 6332,
1367
+ "sourceSha256": "45a696753691027dfcadd8e94b38b111ad5085ba1cb4f769225b15efc68125d7",
1368
+ "outputSha256": "45a696753691027dfcadd8e94b38b111ad5085ba1cb4f769225b15efc68125d7",
1353
1369
  "transform": "verbatim"
1354
1370
  },
1355
1371
  {
@@ -1395,9 +1411,17 @@
1395
1411
  {
1396
1412
  "source": "package/dist/store/pull.js",
1397
1413
  "output": "store/pull.js",
1398
- "bytes": 5470,
1399
- "sourceSha256": "4db913a0d196ed634277e4f3569c275579038f948e4adf6eb4dbbae257a41c92",
1400
- "outputSha256": "4db913a0d196ed634277e4f3569c275579038f948e4adf6eb4dbbae257a41c92",
1414
+ "bytes": 5602,
1415
+ "sourceSha256": "512a723a49dae3be50aa8c67ca8f6a5c165ec72e8a991a166d8d93e33e895350",
1416
+ "outputSha256": "512a723a49dae3be50aa8c67ca8f6a5c165ec72e8a991a166d8d93e33e895350",
1417
+ "transform": "verbatim"
1418
+ },
1419
+ {
1420
+ "source": "package/dist/store/quota-writer.js",
1421
+ "output": "store/quota-writer.js",
1422
+ "bytes": 12396,
1423
+ "sourceSha256": "ade5fdda516011baf11e40f672263364cea07c45bdcbfc11107e22794e9aef21",
1424
+ "outputSha256": "ade5fdda516011baf11e40f672263364cea07c45bdcbfc11107e22794e9aef21",
1401
1425
  "transform": "verbatim"
1402
1426
  },
1403
1427
  {
@@ -1459,9 +1483,9 @@
1459
1483
  {
1460
1484
  "source": "package/dist/store/runtime.d.ts",
1461
1485
  "output": "store/runtime.d.ts",
1462
- "bytes": 1949,
1463
- "sourceSha256": "6838abdf1de68578c8403f76d3404a86e0d286c28a99ff32cb8bd84544a718cb",
1464
- "outputSha256": "6838abdf1de68578c8403f76d3404a86e0d286c28a99ff32cb8bd84544a718cb",
1486
+ "bytes": 2100,
1487
+ "sourceSha256": "34efe7252b6c0aead222cab6164340e76e9c22202049158164c56c3b46bab91f",
1488
+ "outputSha256": "34efe7252b6c0aead222cab6164340e76e9c22202049158164c56c3b46bab91f",
1465
1489
  "transform": "verbatim"
1466
1490
  },
1467
1491
  {
@@ -1,4 +1,6 @@
1
+ import { type StoreContext } from './mutate.js';
1
2
  import { type StoreRuntime } from './runtime.js';
3
+ import { type PoolRow } from './schema.js';
2
4
  /**
3
5
  * What a pull or refresh captured about its row (named by id alongside) when
4
6
  * it was issued. A result applies only while the row with that id still has
@@ -20,6 +22,9 @@ export interface Attribution {
20
22
  credentialEpoch: number;
21
23
  identity?: string;
22
24
  }
25
+ export declare function assertQuotaEpoch(id: string, attribution: Attribution): void;
26
+ export declare function assertQuotaRow(id: string, attribution: Attribution, row: PoolRow | undefined): asserts row is PoolRow;
27
+ export declare function mergedQuota(ctx: StoreContext, id: string, stored: unknown, observation: unknown): unknown;
23
28
  /**
24
29
  * Merges a quota observation into a row's stored map under the store locks,
25
30
  * after attribution passes. Needs no row lock, so it is permitted from
@@ -1,8 +1,41 @@
1
1
  import { PoolOperationError } from './errors.js';
2
- import { toFailure, withTransaction } from './mutate.js';
2
+ import { toFailure, withTransaction, } from './mutate.js';
3
3
  import { LockStack } from './refresh-lock.js';
4
4
  import { refusal, requireBound, unknownRow, } from './runtime.js';
5
5
  import { isCredentialEpoch } from './schema.js';
6
+ export function assertQuotaEpoch(id, attribution) {
7
+ if (!isCredentialEpoch(attribution?.credentialEpoch))
8
+ throw refusal('pull', id, 'invalid-input', 'the credential epoch the reading was issued for must be a positive safe integer');
9
+ }
10
+ // Shared by preflight and the locked commit: accepting into memory must never
11
+ // hide a refusal the immediate writer would have returned to its caller.
12
+ export function assertQuotaRow(id, attribution, row) {
13
+ if (!row)
14
+ throw unknownRow('pull', id);
15
+ if (row.invalid)
16
+ throw refusal('pull', id, 'invalid-row', `row ${id} is invalid`);
17
+ if (!row.credential)
18
+ throw refusal('pull', id, 'no-credential', `row ${id} holds no credential`);
19
+ requireBound('pull', row);
20
+ if (row.torn ||
21
+ !row.hasEntry ||
22
+ row.credentialEpoch !== attribution.credentialEpoch ||
23
+ row.identity !== attribution.identity)
24
+ throw new PoolOperationError({
25
+ operation: 'pull',
26
+ rowId: id,
27
+ phase: 'pull',
28
+ retryable: true,
29
+ kind: 'attribution',
30
+ message: `quota for ${id} was issued for a credential the row no longer holds`,
31
+ });
32
+ }
33
+ export function mergedQuota(ctx, id, stored, observation) {
34
+ const merged = ctx.codec.merge(stored, observation);
35
+ if (!ctx.codec.validate(merged))
36
+ throw refusal('pull', id, 'invalid-quota', 'the quota codec rejected the merged map');
37
+ return merged;
38
+ }
6
39
  /**
7
40
  * Merges a quota observation into a row's stored map under the store locks,
8
41
  * after attribution passes. Needs no row lock, so it is permitted from
@@ -13,37 +46,18 @@ export async function recordQuota(rt, id, attribution, observation) {
13
46
  const locks = new LockStack(ctx.lockDefaults, ctx.lockEnv);
14
47
  const progress = { writes: 0 };
15
48
  try {
16
- if (!isCredentialEpoch(attribution?.credentialEpoch))
17
- throw refusal('pull', id, 'invalid-input', 'the credential epoch the reading was issued for must be a positive safe integer');
49
+ assertQuotaEpoch(id, attribution);
18
50
  await withTransaction(ctx, locks, progress, { operation: 'pull', rowId: id }, async (tx) => {
19
51
  tx.assertNotStaged(id);
20
52
  const row = tx.row(id);
21
- if (!row)
22
- throw unknownRow('pull', id);
23
- if (row.invalid)
24
- throw refusal('pull', id, 'invalid-row', `row ${id} is invalid`);
25
53
  // A reading belongs to one (epoch, identity, credential). A row
26
54
  // holding no credential, or torn between the writes of a replace,
27
55
  // has no such triple on disk, so no reading is recorded for it.
28
- if (!row.credential)
29
- throw refusal('pull', id, 'no-credential', `row ${id} holds no credential`);
30
- requireBound('pull', row);
56
+ assertQuotaRow(id, attribution, row);
31
57
  const entry = tx.entry(id);
32
- if (row.torn ||
33
- !entry ||
34
- entry.credentialEpoch !== attribution.credentialEpoch ||
35
- row.identity !== attribution.identity)
36
- throw new PoolOperationError({
37
- operation: 'pull',
38
- rowId: id,
39
- phase: 'pull',
40
- retryable: true,
41
- kind: 'attribution',
42
- message: `quota for ${id} was issued for a credential the row no longer holds`,
43
- });
44
- const merged = ctx.codec.merge(entry.quota, observation);
45
- if (!ctx.codec.validate(merged))
46
- throw refusal('pull', id, 'invalid-quota', 'the quota codec rejected the merged map');
58
+ if (!entry)
59
+ throw unknownRow('pull', id);
60
+ const merged = mergedQuota(ctx, id, entry.quota, observation);
47
61
  tx.setEntry(id, { ...entry, quota: merged, needsFirstReading: false });
48
62
  await tx.commitConfig();
49
63
  },
@@ -16,6 +16,19 @@ export interface OpenPoolStoreOptions {
16
16
  configPath: string;
17
17
  statePath: string;
18
18
  quota: QuotaCodec;
19
+ /**
20
+ * Opt in to detached, coalesced quota publication, with any `quota` codec.
21
+ * Each accepted observation is queued whole for its row and binding, and
22
+ * the queue is applied in arrival order through `quota.merge` under the
23
+ * store locks, so the codec's own merge decides which fields a newer or
24
+ * older reading replaces. Accepted readings appear in read/load
25
+ * immediately, merged the same way; the returned promise still rejects
26
+ * current-row refusals before queueing. Await dispose or close at shutdown
27
+ * to drain.
28
+ */
29
+ coalesceQuota?: boolean;
30
+ /** Bounded quota drain on close/dispose, in milliseconds; defaults to 1,000. */
31
+ quotaDrainTimeoutMs?: number;
19
32
  /**
20
33
  * The codec of the provider state kept beside each row's credential (see
21
34
  * `ProviderStateCodec`). Without it no row shows a provider state, and
@@ -189,6 +202,10 @@ export interface PoolStore {
189
202
  }>;
190
203
  refresh(id: string, provider: ProviderRefresh, options?: RefreshOptions): Promise<RefreshOutcome>;
191
204
  recordQuota(id: string, attribution: Attribution, observation: unknown): Promise<void>;
205
+ /** Drain opted-in quota publication; subsequent coalesced readings refuse. Idempotent. */
206
+ close(): Promise<void>;
207
+ /** Same bounded quota drain as close(). Does not wait for provider pull hooks. */
208
+ dispose(): Promise<void>;
192
209
  /** Fires a pull for a row admission refused for want of a reading. */
193
210
  requestReading(id: string): void;
194
211
  /** Resolves once every pull fired so far has settled. */
@@ -3,6 +3,7 @@ import { initializePool, readPool, } from './mutate.js';
3
3
  import { updateProviderStateRow, } from './provider-state.js';
4
4
  import { publication, publishRoster, } from './publication.js';
5
5
  import { PullScheduler } from './pull.js';
6
+ import { PoolQuotaWriter } from './quota-writer.js';
6
7
  import { refreshRow, } from './refresh.js';
7
8
  import { POOL_LOCK_DEFAULTS, } from './refresh-lock.js';
8
9
  import { addRow, disableRow, enableRow, recordRowIdentity, removeRow, reorderRows, replaceRow, rotateRow, } from './rows.js';
@@ -80,9 +81,21 @@ export function openPoolStore(options) {
80
81
  rowLockOptions: options.rowLockOptions ?? {},
81
82
  firePull: (id, reason) => pulls.fire(id, reason),
82
83
  };
84
+ const quotaWriter = options.coalesceQuota
85
+ ? new PoolQuotaWriter(rt, options.quotaDrainTimeoutMs)
86
+ : undefined;
87
+ const record = (id, attribution, observation) => quotaWriter
88
+ ? quotaWriter.record(id, attribution, observation)
89
+ : recordQuota(rt, id, attribution, observation);
90
+ rt.publishQuota = record;
91
+ const overlay = (result) => {
92
+ if (result.status === 'ready' && quotaWriter)
93
+ return { ...result, rows: quotaWriter.overlay(result.rows) };
94
+ return result;
95
+ };
83
96
  return {
84
97
  async load() {
85
- const result = await readPool(ctx);
98
+ const result = overlay(await readPool(ctx));
86
99
  if (result.status === 'ready') {
87
100
  // A torn row is no candidate, but its pull is fired too: the pull
88
101
  // completes the row on disk before reading it, so an interrupted
@@ -96,7 +109,7 @@ export function openPoolStore(options) {
96
109
  return toLoad(result);
97
110
  },
98
111
  async read() {
99
- return toLoad(await readPool(ctx));
112
+ return toLoad(overlay(await readPool(ctx)));
100
113
  },
101
114
  async initialize(input = {}) {
102
115
  return { status: await initializePool(ctx, input.dropKeys ?? []) };
@@ -115,7 +128,9 @@ export function openPoolStore(options) {
115
128
  updateSettings: (mutator, callOptions) => updatePoolSettings(rt, mutator, callOptions),
116
129
  recordIdentity: (id, identity, attribution, callOptions) => recordRowIdentity(rt, id, identity, attribution, callOptions),
117
130
  refresh: (id, provider, callOptions) => refreshRow(rt, id, provider, callOptions),
118
- recordQuota: (id, attribution, observation) => recordQuota(rt, id, attribution, observation),
131
+ recordQuota: record,
132
+ close: () => quotaWriter?.close() ?? Promise.resolve(),
133
+ dispose: () => quotaWriter?.close() ?? Promise.resolve(),
119
134
  requestReading: (id) => pulls.fire(id, 'admission'),
120
135
  pullsSettled: () => pulls.settled(),
121
136
  };
@@ -105,7 +105,9 @@ export class PullScheduler {
105
105
  cause,
106
106
  });
107
107
  }
108
- await recordQuota(rt, id, {
108
+ const publish = rt.publishQuota ??
109
+ ((rowId, attribution, value) => recordQuota(rt, rowId, attribution, value));
110
+ await publish(id, {
109
111
  credentialEpoch: request.credentialEpoch,
110
112
  ...(request.identity !== undefined
111
113
  ? { identity: request.identity }