@cortexkit/opencode-antigravity-auth 3.0.9 → 3.0.10

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 (99) hide show
  1. package/dist/cli.js +489 -175
  2. package/dist/cli.js.map +4 -4
  3. package/dist/cli.meta.json +101 -37
  4. package/dist/index.js +666 -269
  5. package/dist/index.js.map +4 -4
  6. package/dist/index.meta.json +106 -42
  7. package/dist/server.js +697 -300
  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 +3 -1
  11. package/dist/src/common-auth-embedded/claustrum/consumer.js +25 -21
  12. package/dist/src/common-auth-embedded/claustrum/index.d.ts +1 -0
  13. package/dist/src/common-auth-embedded/claustrum/index.js +1 -0
  14. package/dist/src/common-auth-embedded/claustrum/quota-writer.d.ts +18 -0
  15. package/dist/src/common-auth-embedded/claustrum/quota-writer.js +253 -0
  16. package/dist/src/common-auth-embedded/claustrum/roster.d.ts +18 -2
  17. package/dist/src/common-auth-embedded/claustrum/roster.js +100 -43
  18. package/dist/src/common-auth-embedded/fs/with-lock.d.ts +1 -0
  19. package/dist/src/common-auth-embedded/fs/with-lock.js +2 -0
  20. package/dist/src/common-auth-embedded/quota/format.d.ts +19 -0
  21. package/dist/src/common-auth-embedded/quota/format.js +50 -5
  22. package/dist/src/common-auth-embedded/quota/index.d.ts +3 -3
  23. package/dist/src/common-auth-embedded/quota/index.js +2 -2
  24. package/dist/src/common-auth-embedded/quota/map.d.ts +24 -1
  25. package/dist/src/common-auth-embedded/quota/map.js +31 -6
  26. package/dist/src/common-auth-embedded/quota/merge.d.ts +6 -1
  27. package/dist/src/common-auth-embedded/quota/merge.js +17 -3
  28. package/dist/src/common-auth-embedded/quota/projection.d.ts +3 -1
  29. package/dist/src/common-auth-embedded/quota/projection.js +3 -1
  30. package/dist/src/common-auth-embedded/setup/process-fence.d.ts +7 -0
  31. package/dist/src/common-auth-embedded/setup/process-fence.js +5 -3
  32. package/dist/src/common-auth-embedded/source-output.json +83 -67
  33. package/dist/src/plugin/request-helpers.d.ts +5 -0
  34. package/dist/src/plugin/request-helpers.d.ts.map +1 -1
  35. package/dist/src/plugin/request-helpers.js +1 -0
  36. package/dist/src/plugin/request-helpers.js.map +1 -1
  37. package/dist/src/plugin/shared/request-services.d.ts.map +1 -1
  38. package/dist/src/plugin/shared/request-services.js +123 -5
  39. package/dist/src/plugin/shared/request-services.js.map +1 -1
  40. package/dist/tui-build-map.json +21 -21
  41. package/dist/tui-ga-build-map.json +21 -21
  42. package/dist/types/src/common-auth-embedded/claustrum/consumer.d.ts +3 -1
  43. package/dist/types/src/common-auth-embedded/claustrum/index.d.ts +1 -0
  44. package/dist/types/src/common-auth-embedded/claustrum/quota-writer.d.ts +18 -0
  45. package/dist/types/src/common-auth-embedded/claustrum/roster.d.ts +18 -2
  46. package/dist/types/src/common-auth-embedded/quota/format.d.ts +19 -0
  47. package/dist/types/src/common-auth-embedded/quota/index.d.ts +3 -3
  48. package/dist/types/src/common-auth-embedded/quota/map.d.ts +24 -1
  49. package/dist/types/src/common-auth-embedded/quota/merge.d.ts +6 -1
  50. package/dist/types/src/common-auth-embedded/quota/projection.d.ts +3 -1
  51. package/dist/types/src/common-auth-embedded/setup/process-fence.d.ts +7 -0
  52. package/dist/types/src/plugin/config/schema.d.ts +2 -2
  53. package/dist/types/src/plugin/request-helpers.d.ts +5 -0
  54. package/dist/types/src/plugin/request-helpers.d.ts.map +1 -1
  55. package/dist/types/src/plugin/shared/request-services.d.ts.map +1 -1
  56. package/package.json +2 -2
  57. package/src/common-auth-embedded/claustrum/consumer.d.ts +3 -1
  58. package/src/common-auth-embedded/claustrum/consumer.js +25 -21
  59. package/src/common-auth-embedded/claustrum/index.d.ts +1 -0
  60. package/src/common-auth-embedded/claustrum/index.js +1 -0
  61. package/src/common-auth-embedded/claustrum/quota-writer.d.ts +18 -0
  62. package/src/common-auth-embedded/claustrum/quota-writer.js +253 -0
  63. package/src/common-auth-embedded/claustrum/roster.d.ts +18 -2
  64. package/src/common-auth-embedded/claustrum/roster.js +100 -43
  65. package/src/common-auth-embedded/fs/with-lock.d.ts +1 -0
  66. package/src/common-auth-embedded/fs/with-lock.js +2 -0
  67. package/src/common-auth-embedded/quota/format.d.ts +19 -0
  68. package/src/common-auth-embedded/quota/format.js +50 -5
  69. package/src/common-auth-embedded/quota/index.d.ts +3 -3
  70. package/src/common-auth-embedded/quota/index.js +2 -2
  71. package/src/common-auth-embedded/quota/map.d.ts +24 -1
  72. package/src/common-auth-embedded/quota/map.js +31 -6
  73. package/src/common-auth-embedded/quota/merge.d.ts +6 -1
  74. package/src/common-auth-embedded/quota/merge.js +17 -3
  75. package/src/common-auth-embedded/quota/projection.d.ts +3 -1
  76. package/src/common-auth-embedded/quota/projection.js +3 -1
  77. package/src/common-auth-embedded/setup/process-fence.d.ts +7 -0
  78. package/src/common-auth-embedded/setup/process-fence.js +5 -3
  79. package/src/common-auth-embedded/source-output.json +83 -67
  80. package/src/tui-compiled/common-auth-embedded/quota/format.js +50 -5
  81. package/src/tui-compiled/common-auth-embedded/quota/index.js +2 -2
  82. package/src/tui-compiled/common-auth-embedded/quota/map.js +31 -6
  83. package/src/tui-compiled/common-auth-embedded/quota/merge.js +17 -3
  84. package/src/tui-compiled/common-auth-embedded/quota/projection.js +3 -1
  85. package/src/tui-ga-compiled/shared/1ff34afa7c42d196-projection.js +3 -1
  86. package/src/tui-ga-compiled/shared/77138df80c7ae006-map.js +31 -6
  87. package/src/tui-ga-compiled/shared/aef2402f8fc342f0-format.js +50 -5
  88. package/src/tui-ga-compiled/shared/bf17cbee28e58197-index.js +2 -2
  89. package/src/tui-ga-compiled/shared/ecc214300932dfb6-merge.js +17 -3
  90. package/src/tui-ga-raw/shared/1ff34afa7c42d196-projection.js +3 -1
  91. package/src/tui-ga-raw/shared/77138df80c7ae006-map.js +31 -6
  92. package/src/tui-ga-raw/shared/aef2402f8fc342f0-format.js +50 -5
  93. package/src/tui-ga-raw/shared/bf17cbee28e58197-index.js +2 -2
  94. package/src/tui-ga-raw/shared/ecc214300932dfb6-merge.js +17 -3
  95. package/src/tui-raw/common-auth-embedded/quota/format.js +50 -5
  96. package/src/tui-raw/common-auth-embedded/quota/index.js +2 -2
  97. package/src/tui-raw/common-auth-embedded/quota/map.js +31 -6
  98. package/src/tui-raw/common-auth-embedded/quota/merge.js +17 -3
  99. package/src/tui-raw/common-auth-embedded/quota/projection.js +3 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "package": "@cortexkit/common-auth",
4
- "version": "0.22.0",
4
+ "version": "0.23.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.22.0.tgz",
65
- "tarballSha256": "846844993cfddd8511e5cf9b0a364629b210a3efbd086ba7d51eed8fc52581ab",
66
- "sri": "sha512-02yOfdzAI1QSwtofnjvSeFsELl6Lo1kp7jE4pCRFLRx0q0aFxlGeJgWacIVvM7y/DClkhstQvaRrtL/VSs8jUQ==",
67
- "canonicalFiles": 182,
68
- "canonicalBytes": 1032551,
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,
69
69
  "generator": {
70
70
  "path": "packages/opencode/scripts/embed-common-auth.ts",
71
71
  "version": 3,
72
- "sha256": "01b7caa2370617052fe82fa0f7dd3ebc43d23de75e19b53a8683150259a1d5bc"
72
+ "sha256": "886385f4eedd9fcd82bcb3e7751e0c7193fbb6c59238fa35be82909635955dbf"
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": 9422,
255
- "sourceSha256": "757c3c0e9a0d03984d0510dc5a6248e35426fe03d2b72a0a1f59204b9f1666ef",
256
- "outputSha256": "757c3c0e9a0d03984d0510dc5a6248e35426fe03d2b72a0a1f59204b9f1666ef",
254
+ "bytes": 9548,
255
+ "sourceSha256": "150eac9038881740a78e5664501a6ef0aa5e177a6dd46854cbeaf38513463e90",
256
+ "outputSha256": "150eac9038881740a78e5664501a6ef0aa5e177a6dd46854cbeaf38513463e90",
257
257
  "transform": "verbatim"
258
258
  },
259
259
  {
260
260
  "source": "package/dist/claustrum/consumer.js",
261
261
  "output": "claustrum/consumer.js",
262
- "bytes": 25150,
263
- "sourceSha256": "58cd180a286241cbe699441939045a28132c04ba1fb0b4e5a07ff1b18b3ff486",
264
- "outputSha256": "58cd180a286241cbe699441939045a28132c04ba1fb0b4e5a07ff1b18b3ff486",
262
+ "bytes": 25698,
263
+ "sourceSha256": "ec47dc016bf4d95655c17093a78d9c214b623214c821d352f73ea60f830c0d83",
264
+ "outputSha256": "ec47dc016bf4d95655c17093a78d9c214b623214c821d352f73ea60f830c0d83",
265
265
  "transform": "verbatim"
266
266
  },
267
267
  {
@@ -331,17 +331,17 @@
331
331
  {
332
332
  "source": "package/dist/claustrum/index.d.ts",
333
333
  "output": "claustrum/index.d.ts",
334
- "bytes": 3708,
335
- "sourceSha256": "97dc7d8f1cd9a74301a55569a06a2661d54966240edbfdcaf5989d112ec94885",
336
- "outputSha256": "97dc7d8f1cd9a74301a55569a06a2661d54966240edbfdcaf5989d112ec94885",
334
+ "bytes": 3761,
335
+ "sourceSha256": "f2c1b8d99048666c068805b08b430492b2632be08e2beda466ee56b871572847",
336
+ "outputSha256": "f2c1b8d99048666c068805b08b430492b2632be08e2beda466ee56b871572847",
337
337
  "transform": "verbatim"
338
338
  },
339
339
  {
340
340
  "source": "package/dist/claustrum/index.js",
341
341
  "output": "claustrum/index.js",
342
- "bytes": 2456,
343
- "sourceSha256": "1e2ae0ee6f2754189e846298a1c6ce2dd4a5eb8cb7f9293f6c24f9725b8537be",
344
- "outputSha256": "1e2ae0ee6f2754189e846298a1c6ce2dd4a5eb8cb7f9293f6c24f9725b8537be",
342
+ "bytes": 2509,
343
+ "sourceSha256": "5f8b4bebfc2dec055b69769adcd1ce48ad7acc2c26256edbe4a2e984dc788147",
344
+ "outputSha256": "5f8b4bebfc2dec055b69769adcd1ce48ad7acc2c26256edbe4a2e984dc788147",
345
345
  "transform": "verbatim"
346
346
  },
347
347
  {
@@ -376,20 +376,36 @@
376
376
  "outputSha256": "031b95ccc3b3779ddb3be78278b29d6b2a741fc8217443a610ad2f98fe33ef33",
377
377
  "transform": "verbatim"
378
378
  },
379
+ {
380
+ "source": "package/dist/claustrum/quota-writer.d.ts",
381
+ "output": "claustrum/quota-writer.d.ts",
382
+ "bytes": 1112,
383
+ "sourceSha256": "35c3193c833ef169b5ebd9fdb03a8e08c234e9154b68b04d3cbea79975fffd14",
384
+ "outputSha256": "35c3193c833ef169b5ebd9fdb03a8e08c234e9154b68b04d3cbea79975fffd14",
385
+ "transform": "verbatim"
386
+ },
387
+ {
388
+ "source": "package/dist/claustrum/quota-writer.js",
389
+ "output": "claustrum/quota-writer.js",
390
+ "bytes": 9694,
391
+ "sourceSha256": "5a7d5d1059dcadc06aa41e81e0707cc444636473822047f0ec72da7589c770f1",
392
+ "outputSha256": "5a7d5d1059dcadc06aa41e81e0707cc444636473822047f0ec72da7589c770f1",
393
+ "transform": "verbatim"
394
+ },
379
395
  {
380
396
  "source": "package/dist/claustrum/roster.d.ts",
381
397
  "output": "claustrum/roster.d.ts",
382
- "bytes": 9932,
383
- "sourceSha256": "7c5684ff5c3f66d418f3624d07565a08556662f445cb96a7575a270851fab9c3",
384
- "outputSha256": "7c5684ff5c3f66d418f3624d07565a08556662f445cb96a7575a270851fab9c3",
398
+ "bytes": 10931,
399
+ "sourceSha256": "c394bc08c7cce4dc68fd539ac03cb200727534693600c7daf5ba7c9c4d0618ce",
400
+ "outputSha256": "c394bc08c7cce4dc68fd539ac03cb200727534693600c7daf5ba7c9c4d0618ce",
385
401
  "transform": "verbatim"
386
402
  },
387
403
  {
388
404
  "source": "package/dist/claustrum/roster.js",
389
405
  "output": "claustrum/roster.js",
390
- "bytes": 25106,
391
- "sourceSha256": "e6ac8f59dab51db4756ccbaa89fc73acd213a7a4795fdf5a7c7e4f653455fe94",
392
- "outputSha256": "e6ac8f59dab51db4756ccbaa89fc73acd213a7a4795fdf5a7c7e4f653455fe94",
406
+ "bytes": 27602,
407
+ "sourceSha256": "45ed2d4e69fad154ce86f5ff4f839c2ae9269dd9146ce7a8b2e5b6f49476ddf8",
408
+ "outputSha256": "45ed2d4e69fad154ce86f5ff4f839c2ae9269dd9146ce7a8b2e5b6f49476ddf8",
393
409
  "transform": "verbatim"
394
410
  },
395
411
  {
@@ -587,17 +603,17 @@
587
603
  {
588
604
  "source": "package/dist/fs/with-lock.d.ts",
589
605
  "output": "fs/with-lock.d.ts",
590
- "bytes": 1153,
591
- "sourceSha256": "a0509ca4ee64b392b69c7a8555c7b33c0c223a8e58aec48848c3216350f1ba0c",
592
- "outputSha256": "a0509ca4ee64b392b69c7a8555c7b33c0c223a8e58aec48848c3216350f1ba0c",
606
+ "bytes": 1179,
607
+ "sourceSha256": "403d301f0cc332b72f8e7d904ac26f8efc93081cbd2cddd46b3f6a5a61d52685",
608
+ "outputSha256": "403d301f0cc332b72f8e7d904ac26f8efc93081cbd2cddd46b3f6a5a61d52685",
593
609
  "transform": "verbatim"
594
610
  },
595
611
  {
596
612
  "source": "package/dist/fs/with-lock.js",
597
613
  "output": "fs/with-lock.js",
598
- "bytes": 1697,
599
- "sourceSha256": "35b4ed6dec77ffcb7850e655a35957da15c14a0fa27b6f3d1d634e243de43456",
600
- "outputSha256": "35b4ed6dec77ffcb7850e655a35957da15c14a0fa27b6f3d1d634e243de43456",
614
+ "bytes": 1789,
615
+ "sourceSha256": "94fa839ec83d730280048f7e586453daadc590c4fbcf5601fd96f4a2d4193d6b",
616
+ "outputSha256": "94fa839ec83d730280048f7e586453daadc590c4fbcf5601fd96f4a2d4193d6b",
601
617
  "transform": "verbatim"
602
618
  },
603
619
  {
@@ -811,81 +827,81 @@
811
827
  {
812
828
  "source": "package/dist/quota/format.d.ts",
813
829
  "output": "quota/format.d.ts",
814
- "bytes": 4415,
815
- "sourceSha256": "293073e9f75e7f15790669f4be8340061566e889259593fcfaf17be9fa4f0a01",
816
- "outputSha256": "293073e9f75e7f15790669f4be8340061566e889259593fcfaf17be9fa4f0a01",
830
+ "bytes": 5507,
831
+ "sourceSha256": "7df60af3e135f34e157bf41c05b59052047f1a583ff3f1dabb3ca4e525b8089a",
832
+ "outputSha256": "7df60af3e135f34e157bf41c05b59052047f1a583ff3f1dabb3ca4e525b8089a",
817
833
  "transform": "verbatim"
818
834
  },
819
835
  {
820
836
  "source": "package/dist/quota/format.js",
821
837
  "output": "quota/format.js",
822
- "bytes": 16323,
823
- "sourceSha256": "d4856ea40dc4269f9a6ffa78bee8564ba648170530e8ff71af4cf38ba5f3baaa",
824
- "outputSha256": "d4856ea40dc4269f9a6ffa78bee8564ba648170530e8ff71af4cf38ba5f3baaa",
838
+ "bytes": 18143,
839
+ "sourceSha256": "e00f3bb6d9da8b13522f02f953387e218f9cc6b62b80821ca081aa06f76d27c6",
840
+ "outputSha256": "e00f3bb6d9da8b13522f02f953387e218f9cc6b62b80821ca081aa06f76d27c6",
825
841
  "transform": "verbatim"
826
842
  },
827
843
  {
828
844
  "source": "package/dist/quota/index.d.ts",
829
845
  "output": "quota/index.d.ts",
830
- "bytes": 1059,
831
- "sourceSha256": "fbb7a865108f98da1f3bb44fba20614a2998ccf5c906b271419b49d37a814214",
832
- "outputSha256": "fbb7a865108f98da1f3bb44fba20614a2998ccf5c906b271419b49d37a814214",
846
+ "bytes": 1107,
847
+ "sourceSha256": "bbc90a42ee076209b368a3ffd477b0554dbe86da63c7e345cd3515b8ffc8950a",
848
+ "outputSha256": "bbc90a42ee076209b368a3ffd477b0554dbe86da63c7e345cd3515b8ffc8950a",
833
849
  "transform": "verbatim"
834
850
  },
835
851
  {
836
852
  "source": "package/dist/quota/index.js",
837
853
  "output": "quota/index.js",
838
- "bytes": 511,
839
- "sourceSha256": "691e7db4bf6025770991f98adda82ca4cb9be45eeefa3709b114fb2decfdf66e",
840
- "outputSha256": "691e7db4bf6025770991f98adda82ca4cb9be45eeefa3709b114fb2decfdf66e",
854
+ "bytes": 545,
855
+ "sourceSha256": "781024edb9aa55a4cb88dfd0657abe569a1d9d15ac2b9a4a90456499a21a85fd",
856
+ "outputSha256": "781024edb9aa55a4cb88dfd0657abe569a1d9d15ac2b9a4a90456499a21a85fd",
841
857
  "transform": "verbatim"
842
858
  },
843
859
  {
844
860
  "source": "package/dist/quota/map.d.ts",
845
861
  "output": "quota/map.d.ts",
846
- "bytes": 2901,
847
- "sourceSha256": "28ba151926d76d45051065b243032ae4f698a3c4f94b44f32341c97467c7faf6",
848
- "outputSha256": "28ba151926d76d45051065b243032ae4f698a3c4f94b44f32341c97467c7faf6",
862
+ "bytes": 3876,
863
+ "sourceSha256": "95a8545c91726fecad46289ffd7fb400b62c376bfbc44477348ae30efe2ee853",
864
+ "outputSha256": "95a8545c91726fecad46289ffd7fb400b62c376bfbc44477348ae30efe2ee853",
849
865
  "transform": "verbatim"
850
866
  },
851
867
  {
852
868
  "source": "package/dist/quota/map.js",
853
869
  "output": "quota/map.js",
854
- "bytes": 5669,
855
- "sourceSha256": "95339af4c80684b4e462f5ba32affeaa5f8b5885db599dc5e8ac1ffd1890d729",
856
- "outputSha256": "95339af4c80684b4e462f5ba32affeaa5f8b5885db599dc5e8ac1ffd1890d729",
870
+ "bytes": 6610,
871
+ "sourceSha256": "c25cf67edc7d9cdc697d8956181d55cd13e823bead30c6acc82477c8222eb1df",
872
+ "outputSha256": "c25cf67edc7d9cdc697d8956181d55cd13e823bead30c6acc82477c8222eb1df",
857
873
  "transform": "verbatim"
858
874
  },
859
875
  {
860
876
  "source": "package/dist/quota/merge.d.ts",
861
877
  "output": "quota/merge.d.ts",
862
- "bytes": 1775,
863
- "sourceSha256": "3531d738712f40b79415cd58940c55bf4cce6827c500fc3912368ff012e31f25",
864
- "outputSha256": "3531d738712f40b79415cd58940c55bf4cce6827c500fc3912368ff012e31f25",
878
+ "bytes": 1997,
879
+ "sourceSha256": "b1f5d76d4176b118f7dbc19dd7d2f986697c8ecae2476b2cbe0c5a2538560527",
880
+ "outputSha256": "b1f5d76d4176b118f7dbc19dd7d2f986697c8ecae2476b2cbe0c5a2538560527",
865
881
  "transform": "verbatim"
866
882
  },
867
883
  {
868
884
  "source": "package/dist/quota/merge.js",
869
885
  "output": "quota/merge.js",
870
- "bytes": 7439,
871
- "sourceSha256": "64440806fd70d214eb6a6f4c98f3a6ba442ca48d39762395a202c25fbf08a23e",
872
- "outputSha256": "64440806fd70d214eb6a6f4c98f3a6ba442ca48d39762395a202c25fbf08a23e",
886
+ "bytes": 8096,
887
+ "sourceSha256": "b1d76faf1fb480b97ef1886ce75dbd2156002baedc39249468559cb4eece5bbb",
888
+ "outputSha256": "b1d76faf1fb480b97ef1886ce75dbd2156002baedc39249468559cb4eece5bbb",
873
889
  "transform": "verbatim"
874
890
  },
875
891
  {
876
892
  "source": "package/dist/quota/projection.d.ts",
877
893
  "output": "quota/projection.d.ts",
878
- "bytes": 3549,
879
- "sourceSha256": "2bbf4942bc034f3521c6c35e30446d73de525a099f7ba49c004d160e4dd917ea",
880
- "outputSha256": "2bbf4942bc034f3521c6c35e30446d73de525a099f7ba49c004d160e4dd917ea",
894
+ "bytes": 3661,
895
+ "sourceSha256": "c4f4c8c53245bd0c8bd08a1483aede705a4c3e21e4a131f14835340ffee38fab",
896
+ "outputSha256": "c4f4c8c53245bd0c8bd08a1483aede705a4c3e21e4a131f14835340ffee38fab",
881
897
  "transform": "verbatim"
882
898
  },
883
899
  {
884
900
  "source": "package/dist/quota/projection.js",
885
901
  "output": "quota/projection.js",
886
- "bytes": 5640,
887
- "sourceSha256": "be7012f1df5845a1f3377b148f35ffe029583c1b9b5426f70a7ba96f7b49a150",
888
- "outputSha256": "be7012f1df5845a1f3377b148f35ffe029583c1b9b5426f70a7ba96f7b49a150",
902
+ "bytes": 5787,
903
+ "sourceSha256": "762f4ba4f64accc7f7344402897ddaad3cfc908c11ff8e6ee9b6277602b78702",
904
+ "outputSha256": "762f4ba4f64accc7f7344402897ddaad3cfc908c11ff8e6ee9b6277602b78702",
889
905
  "transform": "verbatim"
890
906
  },
891
907
  {
@@ -1179,17 +1195,17 @@
1179
1195
  {
1180
1196
  "source": "package/dist/setup/process-fence.d.ts",
1181
1197
  "output": "setup/process-fence.d.ts",
1182
- "bytes": 1615,
1183
- "sourceSha256": "9eda9454a17fb7f8482746d9e8cf0e04a81f752d3ccff07a77880966a3550e7d",
1184
- "outputSha256": "9eda9454a17fb7f8482746d9e8cf0e04a81f752d3ccff07a77880966a3550e7d",
1198
+ "bytes": 1897,
1199
+ "sourceSha256": "12161c0ddc3ed14c50ff62dd441158aeaa5285bb49f6735c5b2e5b3a430364fb",
1200
+ "outputSha256": "12161c0ddc3ed14c50ff62dd441158aeaa5285bb49f6735c5b2e5b3a430364fb",
1185
1201
  "transform": "verbatim"
1186
1202
  },
1187
1203
  {
1188
1204
  "source": "package/dist/setup/process-fence.js",
1189
1205
  "output": "setup/process-fence.js",
1190
- "bytes": 10923,
1191
- "sourceSha256": "e2db85ab7ae29b99e9801787c0bb4f0bf58acc5b8c231a0c4acef30cde812747",
1192
- "outputSha256": "e2db85ab7ae29b99e9801787c0bb4f0bf58acc5b8c231a0c4acef30cde812747",
1206
+ "bytes": 11015,
1207
+ "sourceSha256": "ff848eb647b155a2dfbb8a201b5330b8b9ba3ac12dc6af7bc4f0f514d94a83c4",
1208
+ "outputSha256": "ff848eb647b155a2dfbb8a201b5330b8b9ba3ac12dc6af7bc4f0f514d94a83c4",
1193
1209
  "transform": "verbatim"
1194
1210
  },
1195
1211
  {
@@ -106,6 +106,25 @@ export function quotaWindowParts(quota, options) {
106
106
  const parts = windows.map(({ part }) => part);
107
107
  return age === undefined ? { windows: parts } : { windows: parts, age };
108
108
  }
109
+ /**
110
+ * The narrow label of each scoped window part, as `narrowTextParts` names
111
+ * them: model short names are worked out over every model-scoped window in
112
+ * the reading, so two models never share a short name.
113
+ */
114
+ function withShortNames(windows) {
115
+ const abbreviations = scopeAbbreviations(windows
116
+ .filter(({ part, scope }) => part.kind === 'window' && scope !== ALL_SCOPE)
117
+ .map(({ scope }) => scope));
118
+ for (const window of windows) {
119
+ window.part.short =
120
+ window.part.kind === 'budget'
121
+ ? 'cr'
122
+ : window.scope === ALL_SCOPE
123
+ ? window.part.name
124
+ : (abbreviations.get(window.scope) ?? window.scope);
125
+ }
126
+ return windows;
127
+ }
109
128
  /**
110
129
  * `quotaWindowParts` with each window's scope kept beside it. The narrow form
111
130
  * needs the scope to name and pick model-scoped windows; the public parts do
@@ -128,6 +147,7 @@ function scopedWindowParts(quota, options) {
128
147
  part: {
129
148
  kind: 'window',
130
149
  name: quotaWindowName(limit),
150
+ short: '',
131
151
  figure: percentLeft(limit.remainingPercent ?? 0),
132
152
  remainingPercent,
133
153
  checkedAt: limit.checkedAt,
@@ -149,6 +169,7 @@ function scopedWindowParts(quota, options) {
149
169
  part: {
150
170
  kind: 'budget',
151
171
  name: 'credits',
172
+ short: '',
152
173
  figure,
153
174
  ...(remainingPercent === undefined
154
175
  ? {}
@@ -158,6 +179,7 @@ function scopedWindowParts(quota, options) {
158
179
  },
159
180
  });
160
181
  }
182
+ withShortNames(windows);
161
183
  if (windows.length > 0) {
162
184
  const age = now - Math.min(...windows.map(({ part }) => part.checkedAt));
163
185
  if (age > (options.staleAfterMs ?? QUOTA_STALE_AFTER_MS)) {
@@ -298,20 +320,21 @@ function narrowTextParts(quota, options) {
298
320
  return grouped;
299
321
  const general = windows.filter(({ part, scope }) => part.kind === 'window' && scope === ALL_SCOPE);
300
322
  const scoped = windows.filter(({ part, scope }) => part.kind === 'window' && scope !== ALL_SCOPE);
301
- const abbreviations = scopeAbbreviations(scoped.map(({ scope }) => scope));
302
323
  // The items competing for the one slot after the account-wide windows, in
303
324
  // tie-break order: scoped windows in display order, then the budget. A
304
325
  // spent budget counts as 0% left; one without a percentage cannot compete.
326
+ // Their labels are the parts' short names, so the narrow line and a layout
327
+ // reading `short` always agree.
305
328
  const budget = windows.find(({ part }) => part.kind === 'budget');
306
329
  const budgetLeft = budget?.spent ? 0 : budget?.part.remainingPercent;
307
330
  const extras = [
308
- ...scoped.map(({ scope, part }) => ({
309
- label: abbreviations.get(scope) ?? scope,
331
+ ...scoped.map(({ part }) => ({
332
+ label: part.short,
310
333
  remaining: part.remainingPercent ?? 0,
311
334
  })),
312
- ...(budgetLeft === undefined
335
+ ...(budgetLeft === undefined || budget === undefined
313
336
  ? []
314
- : [{ label: 'cr', remaining: budgetLeft }]),
337
+ : [{ label: budget.part.short, remaining: budgetLeft }]),
315
338
  ];
316
339
  // Strictly lower wins, so on a tie the earlier item keeps the slot.
317
340
  const tightest = extras.reduce((best, item) => best === undefined || item.remaining < best.remaining ? item : best, undefined);
@@ -357,3 +380,25 @@ export function formatQuota(quota, options) {
357
380
  ? NO_LIMITS_REPORTED
358
381
  : NO_QUOTA_READING;
359
382
  }
383
+ /**
384
+ * Prepaid credits as one short value, worded as the official Codex client's
385
+ * status view words them: `Unlimited` for unlimited credits, `<n> credits`
386
+ * for a finite positive balance (rounded to a whole number), `Available` when
387
+ * the account has credits but no usable balance was reported, and undefined
388
+ * when the account has no credits (or `credits` is undefined), so a caller
389
+ * shows no credits row at all. Unlimited wins even when `hasCredits` is false.
390
+ * No other formatter adds this text; a caller that wants a credits row asks
391
+ * for it.
392
+ */
393
+ export function quotaCreditsText(credits) {
394
+ if (credits === undefined)
395
+ return undefined;
396
+ if (credits.unlimited)
397
+ return 'Unlimited';
398
+ if (!credits.hasCredits)
399
+ return undefined;
400
+ const { balance } = credits;
401
+ return typeof balance === 'number' && Number.isFinite(balance) && balance > 0
402
+ ? `${Math.round(balance)} credits`
403
+ : 'Available';
404
+ }
@@ -1,5 +1,5 @@
1
1
  export { quotaCodec } from "./codec.js";
2
- export { formatQuota, isQuotaStale, NO_LIMITS_REPORTED, NO_QUOTA_READING, QUOTA_STALE_AFTER_MS, quotaTextParts, quotaWindowName, quotaWindowParts, } from "./format.js";
3
- export { ALL_SCOPE, DEFAULT_REQUIRED_LABELS, decodeQuotaMap, emptyQuotaMap, isQuotaMap, } from "./map.js";
2
+ export { formatQuota, isQuotaStale, NO_LIMITS_REPORTED, NO_QUOTA_READING, QUOTA_STALE_AFTER_MS, quotaCreditsText, quotaTextParts, quotaWindowName, quotaWindowParts, } from "./format.js";
3
+ export { ALL_SCOPE, DEFAULT_REQUIRED_LABELS, decodeQuotaMap, emptyQuotaMap, isQuotaCredits, isQuotaMap, } from "./map.js";
4
4
  export { isQuotaObservation, mergeQuotaObservation, QuotaCodecError, } from "./merge.js";
5
5
  export { budgetExhaustedResetAt, futureResetAt, projectQuota, readsExhausted, } from "./projection.js";
@@ -14,6 +14,9 @@
14
14
  // reset clock. It is a tri-state: absent (never reported), a reading, or
15
15
  // cleared (the provider reported that no budget exists).
16
16
  //
17
+ // Provider-named counters and the prepaid credits record sit beside them too,
18
+ // each judged by its own observation time rather than the limits'.
19
+ //
17
20
  // The map is plain JSON so the store can persist it without interpreting it.
18
21
  /** The scope of a limit that binds every request regardless of model. */
19
22
  export const ALL_SCOPE = 'all';
@@ -93,6 +96,18 @@ function isQuotaCounter(value) {
93
96
  export function isQuotaCounters(value) {
94
97
  return isRecord(value) && Object.values(value).every(isQuotaCounter);
95
98
  }
99
+ function isBoolean(value) {
100
+ return typeof value === 'boolean';
101
+ }
102
+ /** True when `value` is a well-formed prepaid-credits record. */
103
+ export function isQuotaCredits(value) {
104
+ return (isRecord(value) &&
105
+ typeof value.hasCredits === 'boolean' &&
106
+ typeof value.unlimited === 'boolean' &&
107
+ optional(value, 'balance', isFiniteNumber) &&
108
+ optional(value, 'overageLimitReached', isBoolean) &&
109
+ isFiniteNumber(value.checkedAt));
110
+ }
96
111
  /** Keep usable counters without letting one malformed count hide a quota map. */
97
112
  export function readQuotaCounters(value) {
98
113
  if (!isRecord(value))
@@ -102,20 +117,29 @@ export function readQuotaCounters(value) {
102
117
  ? undefined
103
118
  : Object.fromEntries(entries);
104
119
  }
105
- /** Decode persisted quota, dropping malformed counters but not limit evidence. */
120
+ /**
121
+ * Decode persisted quota, dropping malformed counters or a malformed credits
122
+ * record but not limit or budget evidence.
123
+ */
106
124
  export function decodeQuotaMap(value) {
107
125
  // A valid map is returned as the same object, so stored quota keeps the
108
- // identity it had before counters existed; only a map with a malformed
109
- // counter is copied without it.
126
+ // identity it had before counters and credits existed. A map with a
127
+ // malformed counter or credits record is copied with those malformed
128
+ // fields left out.
110
129
  if (isQuotaMap(value))
111
130
  return value;
112
131
  if (!isRecord(value))
113
132
  return undefined;
114
- const { counters: rawCounters, ...rest } = value;
133
+ const { counters: rawCounters, credits: rawCredits, ...rest } = value;
115
134
  if (!isQuotaMap(rest))
116
135
  return undefined;
117
136
  const counters = readQuotaCounters(rawCounters);
118
- return { ...rest, ...(counters === undefined ? {} : { counters }) };
137
+ const credits = isQuotaCredits(rawCredits) ? rawCredits : undefined;
138
+ return {
139
+ ...rest,
140
+ ...(counters === undefined ? {} : { counters }),
141
+ ...(credits === undefined ? {} : { credits }),
142
+ };
119
143
  }
120
144
  /**
121
145
  * True when `value` is a well-formed quota map. Unrecognised top-level keys
@@ -136,5 +160,6 @@ export function isQuotaMap(value) {
136
160
  seen.add(key);
137
161
  }
138
162
  return (optional(value, 'budget', isCreditBudgetEntry) &&
139
- optional(value, 'counters', isQuotaCounters));
163
+ optional(value, 'counters', isQuotaCounters) &&
164
+ optional(value, 'credits', isQuotaCredits));
140
165
  }
@@ -11,7 +11,7 @@
11
11
  // no entry gets an absence record. A pair outside the coverage is never
12
12
  // touched, so a header-shaped partial observation (which covers only what it
13
13
  // carries) cannot erase a family limit or the budget.
14
- import { ALL_SCOPE, decodeQuotaMap, entryTime, isQuotaCounters, limitKey, } from "./map.js";
14
+ import { ALL_SCOPE, decodeQuotaMap, entryTime, isQuotaCounters, isQuotaCredits, limitKey, } from "./map.js";
15
15
  /** Thrown by `mergeQuotaObservation` when either argument is malformed. */
16
16
  export class QuotaCodecError extends TypeError {
17
17
  constructor(message) {
@@ -84,7 +84,8 @@ export function isQuotaObservation(value) {
84
84
  if (!coverage.every(isObservedPair))
85
85
  return false;
86
86
  return ((value.budget === undefined || isObservedBudget(value.budget)) &&
87
- (value.counters === undefined || isQuotaCounters(value.counters)));
87
+ (value.counters === undefined || isQuotaCounters(value.counters)) &&
88
+ (value.credits === undefined || isQuotaCredits(value.credits)));
88
89
  }
89
90
  function compareEntries(left, right) {
90
91
  if (left.scope !== right.scope)
@@ -110,6 +111,17 @@ function mergeCounters(stored, observed) {
110
111
  }
111
112
  return counters.size === 0 ? undefined : Object.fromEntries(counters);
112
113
  }
114
+ // Credits merge like a single counter: the newer record wins, an equal time
115
+ // applies (the observation applied last wins), and an observation without
116
+ // credits leaves the stored record alone.
117
+ function mergeCredits(stored, observed) {
118
+ if (observed === undefined)
119
+ return stored;
120
+ if (stored !== undefined && observed.checkedAt < stored.checkedAt) {
121
+ return stored;
122
+ }
123
+ return { ...observed };
124
+ }
113
125
  /**
114
126
  * Applies `observation` to `stored` (undefined for a row with no map yet) and
115
127
  * returns the new map. Pure: neither argument is modified. Throws
@@ -166,13 +178,15 @@ export function mergeQuotaObservation(stored, observation) {
166
178
  : { scope, label: pair.label, kind: 'retired', retiredAt: at });
167
179
  }
168
180
  // Keys this module does not recognise are carried over untouched.
169
- const { limits: _limits, budget: _budget, counters: _counters, ...unknownKeys } = base;
181
+ const { limits: _limits, budget: _budget, counters: _counters, credits: _credits, ...unknownKeys } = base;
170
182
  const budget = mergeBudget(base.budget, observation.budget, at);
171
183
  const counters = mergeCounters(base.counters, observation.counters);
184
+ const credits = mergeCredits(base.credits, observation.credits);
172
185
  return {
173
186
  ...unknownKeys,
174
187
  limits: [...entries.values()].sort(compareEntries),
175
188
  ...(budget === undefined ? {} : { budget }),
176
189
  ...(counters === undefined ? {} : { counters }),
190
+ ...(credits === undefined ? {} : { credits }),
177
191
  };
178
192
  }
@@ -6,7 +6,7 @@
6
6
  // scope, orders the result the way the primitives expect, and carries each
7
7
  // entry's (scope, label) so a decision names the limit it judged rather than
8
8
  // the position it occupied.
9
- import { ALL_SCOPE, readQuotaCounters, } from "./map.js";
9
+ import { ALL_SCOPE, isQuotaCredits, readQuotaCounters, } from "./map.js";
10
10
  function project(entry) {
11
11
  if (entry.kind === 'retired') {
12
12
  return {
@@ -95,12 +95,14 @@ export function projectQuota(map, scope = ALL_SCOPE) {
95
95
  : undefined;
96
96
  const budget = map?.budget?.kind === 'reading' ? projectBudget(map.budget) : undefined;
97
97
  const counters = readQuotaCounters(map?.counters);
98
+ const credits = isQuotaCredits(map?.credits) ? map.credits : undefined;
98
99
  return {
99
100
  scope,
100
101
  limits,
101
102
  ...(checkedAt === undefined ? {} : { checkedAt }),
102
103
  ...(budget === undefined ? {} : { budget }),
103
104
  ...(counters === undefined ? {} : { counters }),
105
+ ...(credits === undefined ? {} : { credits }),
104
106
  };
105
107
  }
106
108
  /**
@@ -6,7 +6,7 @@
6
6
  // scope, orders the result the way the primitives expect, and carries each
7
7
  // entry's (scope, label) so a decision names the limit it judged rather than
8
8
  // the position it occupied.
9
- import { ALL_SCOPE, readQuotaCounters, } from "./77138df80c7ae006-map.js";
9
+ import { ALL_SCOPE, isQuotaCredits, readQuotaCounters, } from "./77138df80c7ae006-map.js";
10
10
  function project(entry) {
11
11
  if (entry.kind === 'retired') {
12
12
  return {
@@ -95,12 +95,14 @@ export function projectQuota(map, scope = ALL_SCOPE) {
95
95
  : undefined;
96
96
  const budget = map?.budget?.kind === 'reading' ? projectBudget(map.budget) : undefined;
97
97
  const counters = readQuotaCounters(map?.counters);
98
+ const credits = isQuotaCredits(map?.credits) ? map.credits : undefined;
98
99
  return {
99
100
  scope,
100
101
  limits,
101
102
  ...(checkedAt === undefined ? {} : { checkedAt }),
102
103
  ...(budget === undefined ? {} : { budget }),
103
104
  ...(counters === undefined ? {} : { counters }),
105
+ ...(credits === undefined ? {} : { credits }),
104
106
  };
105
107
  }
106
108
  /**
@@ -14,6 +14,9 @@
14
14
  // reset clock. It is a tri-state: absent (never reported), a reading, or
15
15
  // cleared (the provider reported that no budget exists).
16
16
  //
17
+ // Provider-named counters and the prepaid credits record sit beside them too,
18
+ // each judged by its own observation time rather than the limits'.
19
+ //
17
20
  // The map is plain JSON so the store can persist it without interpreting it.
18
21
  /** The scope of a limit that binds every request regardless of model. */
19
22
  export const ALL_SCOPE = 'all';
@@ -93,6 +96,18 @@ function isQuotaCounter(value) {
93
96
  export function isQuotaCounters(value) {
94
97
  return isRecord(value) && Object.values(value).every(isQuotaCounter);
95
98
  }
99
+ function isBoolean(value) {
100
+ return typeof value === 'boolean';
101
+ }
102
+ /** True when `value` is a well-formed prepaid-credits record. */
103
+ export function isQuotaCredits(value) {
104
+ return (isRecord(value) &&
105
+ typeof value.hasCredits === 'boolean' &&
106
+ typeof value.unlimited === 'boolean' &&
107
+ optional(value, 'balance', isFiniteNumber) &&
108
+ optional(value, 'overageLimitReached', isBoolean) &&
109
+ isFiniteNumber(value.checkedAt));
110
+ }
96
111
  /** Keep usable counters without letting one malformed count hide a quota map. */
97
112
  export function readQuotaCounters(value) {
98
113
  if (!isRecord(value))
@@ -102,20 +117,29 @@ export function readQuotaCounters(value) {
102
117
  ? undefined
103
118
  : Object.fromEntries(entries);
104
119
  }
105
- /** Decode persisted quota, dropping malformed counters but not limit evidence. */
120
+ /**
121
+ * Decode persisted quota, dropping malformed counters or a malformed credits
122
+ * record but not limit or budget evidence.
123
+ */
106
124
  export function decodeQuotaMap(value) {
107
125
  // A valid map is returned as the same object, so stored quota keeps the
108
- // identity it had before counters existed; only a map with a malformed
109
- // counter is copied without it.
126
+ // identity it had before counters and credits existed. A map with a
127
+ // malformed counter or credits record is copied with those malformed
128
+ // fields left out.
110
129
  if (isQuotaMap(value))
111
130
  return value;
112
131
  if (!isRecord(value))
113
132
  return undefined;
114
- const { counters: rawCounters, ...rest } = value;
133
+ const { counters: rawCounters, credits: rawCredits, ...rest } = value;
115
134
  if (!isQuotaMap(rest))
116
135
  return undefined;
117
136
  const counters = readQuotaCounters(rawCounters);
118
- return { ...rest, ...(counters === undefined ? {} : { counters }) };
137
+ const credits = isQuotaCredits(rawCredits) ? rawCredits : undefined;
138
+ return {
139
+ ...rest,
140
+ ...(counters === undefined ? {} : { counters }),
141
+ ...(credits === undefined ? {} : { credits }),
142
+ };
119
143
  }
120
144
  /**
121
145
  * True when `value` is a well-formed quota map. Unrecognised top-level keys
@@ -136,5 +160,6 @@ export function isQuotaMap(value) {
136
160
  seen.add(key);
137
161
  }
138
162
  return (optional(value, 'budget', isCreditBudgetEntry) &&
139
- optional(value, 'counters', isQuotaCounters));
163
+ optional(value, 'counters', isQuotaCounters) &&
164
+ optional(value, 'credits', isQuotaCredits));
140
165
  }