@avi2dg/subquo 0.0.0 → 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 (61) hide show
  1. package/.bun-version +1 -0
  2. package/.github/actions/setup/action.yml +21 -0
  3. package/.github/actions/setup/bun-without-unzip.sh +20 -0
  4. package/.github/workflows/ci.yml +177 -0
  5. package/.github/workflows/main.yml +108 -0
  6. package/.github/workflows/mutation.yml +106 -0
  7. package/.github/workflows/pr-title.yml +43 -0
  8. package/.github/workflows/release.yml +34 -0
  9. package/.jscpd.json +5 -0
  10. package/.no-mistakes.yaml +3 -0
  11. package/AGENTS.md +15 -0
  12. package/CHANGELOG.md +21 -0
  13. package/CLAUDE.md +2 -0
  14. package/LICENSE +21 -0
  15. package/README.md +80 -0
  16. package/VISION.md +39 -0
  17. package/bun.lock +909 -0
  18. package/bunfig.toml +3 -0
  19. package/checks.config.ts +7 -0
  20. package/docs/accounts.md +55 -0
  21. package/docs/design.md +122 -0
  22. package/docs/shadow-run.md +49 -0
  23. package/docs/stage-1-findings.md +65 -0
  24. package/knip.config.ts +3 -0
  25. package/oxlint.config.ts +3 -0
  26. package/package.json +45 -3
  27. package/scripts/release-assets.ts +28 -0
  28. package/src/accounts.ts +62 -0
  29. package/src/cli.ts +122 -0
  30. package/src/codex-credentials.ts +1 -0
  31. package/src/collect.ts +45 -0
  32. package/src/collectors.ts +210 -0
  33. package/src/index.ts +146 -0
  34. package/src/keychain.ts +25 -0
  35. package/src/launch.ts +21 -0
  36. package/src/pi-codex.ts +17 -0
  37. package/src/renewal.ts +158 -0
  38. package/src/storage.ts +48 -0
  39. package/src/usage.ts +400 -0
  40. package/stryker.conf.mjs +3 -0
  41. package/templates/adr.md +32 -0
  42. package/templates/agents.md +9 -0
  43. package/templates/changelog.md +39 -0
  44. package/templates/claude.md +2 -0
  45. package/templates/explanation.md +15 -0
  46. package/templates/how-to.md +33 -0
  47. package/templates/readme.md +48 -0
  48. package/templates/reference.md +15 -0
  49. package/templates/tutorial.md +31 -0
  50. package/templates/vision.md +16 -0
  51. package/tests/e2e/cli.test.ts +193 -0
  52. package/tests/e2e/npm-package.test.ts +30 -0
  53. package/tests/e2e/release-assets.test.ts +53 -0
  54. package/tests/fixtures/snapshots/fresh.json +54 -0
  55. package/tests/fixtures/snapshots/incomplete.json +66 -0
  56. package/tests/unit/collect.test.ts +51 -0
  57. package/tests/unit/collectors.test.ts +401 -0
  58. package/tests/unit/no-mistakes.test.ts +8 -0
  59. package/tests/unit/renewal.test.ts +17 -0
  60. package/tests/unit/snapshot.test.ts +169 -0
  61. package/tsconfig.json +46 -0
package/VISION.md ADDED
@@ -0,0 +1,39 @@
1
+ # Vision
2
+
3
+ Every paid AI coding account a person names reports how much it has left, in one file any tool can read.
4
+ It serves people who run agent work across several paid subscriptions and pick an account before each job.
5
+ It owns the read of each named account's quota windows, and the one snapshot that holds them.
6
+
7
+ ## Report, never route
8
+
9
+ - It allows a reader to see each window's percent left and reset time, it forbids subquo picking an account, a floor or a spend order, and it takes the trade of each reading tool keeping its own rules.
10
+
11
+ ## Read a login, never own it
12
+
13
+ - It allows reading a login in memory and asking the vendor's tool to renew it, it forbids writing or switching a login, and it leaves sign-in to you.
14
+
15
+ ## No secret leaves the read
16
+
17
+ - It allows only listed fields and safe error codes in output, it forbids a token, a raw vendor response or a login path in the snapshot, errors, logs or test files, and it takes the trade of less detail when a read fails.
18
+
19
+ ## Unknown is never full
20
+
21
+ - It allows a fresh reading as evidence for a pick, it forbids counting a stale, missing or unchecked reading as room, and it takes the trade of passing over an account that may still have room.
22
+
23
+ ## Every account is named
24
+
25
+ - It allows only the accounts an explicit account list names, it forbids guessing an account from a default login or reading another account's login in its place, and it takes the trade of a list each machine's owner writes by hand.
26
+
27
+ ## A read never waits on a vendor
28
+
29
+ - It allows `subquo read` to print the last complete snapshot without the network, it forbids a read that waits on a vendor, a lock or a password prompt, and it takes the trade of readings as old as the refresh interval.
30
+
31
+ ## Scope
32
+
33
+ - Signing in and renewing a login belong to each vendor's own tool, and subquo only reads the login that tool saved.
34
+ - Picking an account, its floors and its spend order belong to the scheduler or dashboard that reads the snapshot.
35
+ - Session token counts and cost reports belong to usage trackers, and subquo reads only what a subscription has left.
36
+ - Running the refresh on a timer belongs to the machine's own scheduler, and subquo runs no service of its own.
37
+
38
+ A change aligns when it makes one account's reading more truthful about what is left, how old it is or why it is missing.
39
+ A change should be resisted when it makes subquo keep a secret, start a login or decide for the tools that read it.