@tokenbuddy/tb-admin 1.0.35 → 1.0.37

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 (93) hide show
  1. package/dist/src/cli.js +92 -19
  2. package/dist/src/config.d.ts +7 -1
  3. package/dist/src/config.js +16 -4
  4. package/dist/src/display-format.js +6 -14
  5. package/dist/src/init-command.d.ts +50 -0
  6. package/dist/src/init-command.js +347 -0
  7. package/dist/src/providers/fly-io.d.ts +3 -0
  8. package/dist/src/providers/fly-io.js +137 -0
  9. package/dist/src/providers/provider-definition.d.ts +38 -0
  10. package/dist/src/providers/provider-definition.js +2 -0
  11. package/dist/src/seller.d.ts +2 -0
  12. package/dist/src/seller.js +30 -13
  13. package/dist/src/server-cmd.d.ts +1 -0
  14. package/dist/src/server-cmd.js +9 -2
  15. package/dist/src/ui-actions.d.ts +3 -0
  16. package/dist/src/ui-actions.js +199 -27
  17. package/dist/src/ui-command.js +3 -2
  18. package/dist/src/ui-state.d.ts +1 -3
  19. package/dist/src/ui-state.js +4 -8
  20. package/dist/src/ui-static.js +43 -15
  21. package/dist/src/workdir.d.ts +21 -0
  22. package/dist/src/workdir.js +50 -0
  23. package/package.json +8 -2
  24. package/templates/providers/fly.io/admin.toml.example +18 -0
  25. package/templates/providers/fly.io/deploy-secrets/bootstrap/README.md +18 -0
  26. package/templates/providers/fly.io/deploy-secrets/bootstrap/admin-web.example.env +3 -0
  27. package/templates/providers/fly.io/deploy-secrets/bootstrap/cloudflare-r2.example.env +6 -0
  28. package/templates/providers/fly.io/deploy-secrets/bootstrap/registry-signing-key.example.json +6 -0
  29. package/templates/providers/fly.io/deploy-secrets/bootstrap/registry.example.json +14 -0
  30. package/templates/providers/fly.io/deploy-secrets/bootstrap/tb-registry.example.yaml +14 -0
  31. package/templates/providers/fly.io/deploy-secrets/seller-configs/README.md +13 -0
  32. package/templates/providers/fly.io/deploy-secrets/seller-configs/seller.example.yaml +35 -0
  33. package/templates/providers/fly.io/env/deploy.env.example +12 -0
  34. package/templates/providers/fly.io/fly/fly.tb-registry.toml +31 -0
  35. package/templates/providers/fly.io/fly/fly.tb-seller.toml +25 -0
  36. package/templates/providers/fly.io/provider.toml.example +10 -0
  37. package/dist/src/bootstrap-registry.d.ts.map +0 -1
  38. package/dist/src/bootstrap-registry.js.map +0 -1
  39. package/dist/src/cli.d.ts.map +0 -1
  40. package/dist/src/cli.js.map +0 -1
  41. package/dist/src/client.d.ts.map +0 -1
  42. package/dist/src/client.js.map +0 -1
  43. package/dist/src/config.d.ts.map +0 -1
  44. package/dist/src/config.js.map +0 -1
  45. package/dist/src/display-format.d.ts.map +0 -1
  46. package/dist/src/display-format.js.map +0 -1
  47. package/dist/src/index.d.ts.map +0 -1
  48. package/dist/src/index.js.map +0 -1
  49. package/dist/src/provider.d.ts.map +0 -1
  50. package/dist/src/provider.js.map +0 -1
  51. package/dist/src/seller.d.ts.map +0 -1
  52. package/dist/src/seller.js.map +0 -1
  53. package/dist/src/server-cmd.d.ts.map +0 -1
  54. package/dist/src/server-cmd.js.map +0 -1
  55. package/dist/src/ui-actions.d.ts.map +0 -1
  56. package/dist/src/ui-actions.js.map +0 -1
  57. package/dist/src/ui-command.d.ts.map +0 -1
  58. package/dist/src/ui-command.js.map +0 -1
  59. package/dist/src/ui-server.d.ts.map +0 -1
  60. package/dist/src/ui-server.js.map +0 -1
  61. package/dist/src/ui-state.d.ts.map +0 -1
  62. package/dist/src/ui-state.js.map +0 -1
  63. package/dist/src/ui-static.d.ts.map +0 -1
  64. package/dist/src/ui-static.js.map +0 -1
  65. package/dist/src/upstream-balance-probe.d.ts.map +0 -1
  66. package/dist/src/upstream-balance-probe.js.map +0 -1
  67. package/dist/src/vendor-client.d.ts.map +0 -1
  68. package/dist/src/vendor-client.js.map +0 -1
  69. package/dist/src/vendor-commands.d.ts.map +0 -1
  70. package/dist/src/vendor-commands.js.map +0 -1
  71. package/src/bootstrap-registry.ts +0 -90
  72. package/src/cli.ts +0 -1614
  73. package/src/client.ts +0 -179
  74. package/src/config.ts +0 -194
  75. package/src/display-format.ts +0 -411
  76. package/src/index.ts +0 -11
  77. package/src/provider.ts +0 -150
  78. package/src/seller.ts +0 -538
  79. package/src/server-cmd.ts +0 -362
  80. package/src/ui-actions.ts +0 -1040
  81. package/src/ui-command.ts +0 -44
  82. package/src/ui-server.ts +0 -353
  83. package/src/ui-state.ts +0 -1318
  84. package/src/ui-static.ts +0 -673
  85. package/src/upstream-balance-probe.ts +0 -13
  86. package/src/vendor-client.ts +0 -23
  87. package/src/vendor-commands.ts +0 -65
  88. package/tests/admin.test.ts +0 -2162
  89. package/tests/seller.test.ts +0 -388
  90. package/tests/ui-state-fleet.test.ts +0 -526
  91. package/tests/ui-static-row.test.ts +0 -467
  92. package/tests/vendor-cli.test.ts +0 -241
  93. package/tsconfig.json +0 -8
@@ -1,13 +0,0 @@
1
- export {
2
- BalanceProbeCache,
3
- defaultBalanceProbeCache,
4
- probeUpstreamBalance
5
- } from "@tokenbuddy/contracts";
6
- export type {
7
- BalanceCurrency,
8
- BalanceProbeConfig,
9
- BalanceProbeOptions,
10
- BalanceProbeTemplate,
11
- BalanceSnapshot,
12
- BalanceSource
13
- } from "@tokenbuddy/contracts";
@@ -1,23 +0,0 @@
1
- /**
2
- * Type alias for the seller entry shape vendor commands work with.
3
- * Mirrors the server-side `SellerRegistryEntry` but stays decoupled
4
- * from `wallet-bootstrap`'s internal types so this package does not
5
- * become a build-time dependency of the registry service.
6
- */
7
- export interface SellerRegistryEntry {
8
- id: string;
9
- name?: string;
10
- profile?: string;
11
- app?: string;
12
- url: string;
13
- status?: string;
14
- region?: string;
15
- modelsCount?: number;
16
- sampleModels?: string[];
17
- models?: string[];
18
- supportedProtocols: string[];
19
- paymentMethods: string[];
20
- recommendedFor?: string[];
21
- }
22
-
23
- export { RegistryVendorClient, RegistryAdminClient } from "./client.js";
@@ -1,65 +0,0 @@
1
- import * as fs from "fs";
2
- import { RegistryVendorClient, SellerRegistryEntry } from "./vendor-client.js";
3
-
4
- /**
5
- * vendor CLI helpers for the `bootstrap sellers` and
6
- * `bootstrap release` subcommands. Step 5 of the registry redesign.
7
- *
8
- * - `bootstrap sellers add --file <path>`: stage a single seller
9
- * for inclusion in the next release request submitted by this
10
- * vendor. The server validates the payload shape, persists it to
11
- * `seller_pending`, and returns a `pendingSeller` row.
12
- * - `bootstrap release submit --note <text> --staged <id>`: submit
13
- * a release request that includes one or more staged sellers.
14
- * - `bootstrap release list`: list the vendor's release requests.
15
- * - `bootstrap release show <id>`: show one release request.
16
- * - `bootstrap release force-publish <id>`: super-admin path; the
17
- * vendor token cannot force-publish itself (the platform owns
18
- * the scheduler loop in Step 7), but we keep the command here
19
- * so CI scripts have a single entry point.
20
- */
21
-
22
- export interface StageSellerInput {
23
- client: RegistryVendorClient;
24
- file: string;
25
- }
26
-
27
- export async function stageSellerFromFile({ client, file }: StageSellerInput): Promise<{ pendingSeller: unknown }> {
28
- const content = fs.readFileSync(file, "utf8");
29
- const parsed = JSON.parse(content) as SellerRegistryEntry;
30
- if (!parsed.id || typeof parsed.id !== "string") {
31
- throw new Error(`seller id is required in ${file}`);
32
- }
33
- return client.stageSeller(parsed);
34
- }
35
-
36
- export interface SubmitReleaseInput {
37
- client: RegistryVendorClient;
38
- stagedSellerIds: string[];
39
- note?: string;
40
- }
41
-
42
- export async function submitRelease({ client, stagedSellerIds, note }: SubmitReleaseInput): Promise<{ releaseRequest: unknown }> {
43
- if (stagedSellerIds.length === 0) {
44
- throw new Error("at least one --staged <seller-id> is required");
45
- }
46
- return client.submitRelease({ stagedSellerIds, note });
47
- }
48
-
49
- export function printReleaseRequestSummary(record: any): string {
50
- if (!record) {
51
- return "no release request";
52
- }
53
- const summary = record.payloadSummary || { count: 0, sellerIds: [] };
54
- return [
55
- `id: #${record.id}`,
56
- `status: ${record.status}`,
57
- `vendor: ${record.vendorId}`,
58
- `sellers: ${summary.count} (${(summary.sellerIds || []).join(", ") || "—"})`,
59
- `submittedAt: ${record.submittedAt || "—"}`,
60
- `decidedAt: ${record.decidedAt || "—"}`,
61
- `version: ${record.publishedVersion !== null && record.publishedVersion !== undefined ? `v${record.publishedVersion}` : "—"}`,
62
- record.note ? `note: ${record.note}` : null,
63
- record.errorMessage ? `error: ${record.errorMessage}` : null
64
- ].filter(Boolean).join("\n");
65
- }