@cardstack/boxel-cli 0.13.0-unstable.0 → 0.13.0-unstable.1

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 (75) hide show
  1. package/bundled-realms/base/command.gts +4 -4
  2. package/bundled-realms/base/realm-api-keys.gts +35 -3
  3. package/bundled-test-harness/assets/{ai-module-creation-test-Czsh1MyP.js → ai-module-creation-test-DxxsXNXe.js} +1 -1
  4. package/bundled-test-harness/assets/{app-hXF_bqWy.js → app-BEvPLshl.js} +5 -5
  5. package/bundled-test-harness/assets/{binary-upload-dedupe-test-Bt5RqtEk.js → binary-upload-dedupe-test-B_gcWqxF.js} +1 -1
  6. package/bundled-test-harness/assets/{bundled-base-DtxlKFXx.js → bundled-base-CYD5iFX3.js} +3 -3
  7. package/bundled-test-harness/assets/{bundled-base-modules-test-D1fXHMTE.js → bundled-base-modules-test-bO7yZysu.js} +1 -1
  8. package/bundled-test-harness/assets/{can-invoke-test-DqBuecdl.js → can-invoke-test-BBTE4_cE.js} +1 -1
  9. package/bundled-test-harness/assets/{card-chooser-paging-test-Cf8r032c.js → card-chooser-paging-test-14IqQei3.js} +1 -1
  10. package/bundled-test-harness/assets/{card-chooser-test-q_qnUKxi.js → card-chooser-test-CRg2JrXQ.js} +1 -1
  11. package/bundled-test-harness/assets/{card-def-field-def-relationships-test-C5xkWMZi.js → card-def-field-def-relationships-test-BapYGyoB.js} +1 -1
  12. package/bundled-test-harness/assets/{card-delete-test-KB4aJuv_.js → card-delete-test-CvbDQUUE.js} +1 -1
  13. package/bundled-test-harness/assets/{codeblocks-test-DLVRpBAl.js → codeblocks-test-j4ES37-L.js} +1 -1
  14. package/bundled-test-harness/assets/{compaction-test-zX01t57K.js → compaction-test-CyhMODxy.js} +1 -1
  15. package/bundled-test-harness/assets/{container-BCOmNUou.css → container-CAEYXGQg.css} +179 -155
  16. package/bundled-test-harness/assets/{container-CXZoEvul.js → container-CATqNgYF.js} +10 -10
  17. package/bundled-test-harness/assets/{create-listing-modal-test-DPgVovcL.js → create-listing-modal-test-QmWcm9hl.js} +1 -1
  18. package/bundled-test-harness/assets/{debug-message-test-CWl-ido2.js → debug-message-test-D-4Dcu8y.js} +1 -1
  19. package/bundled-test-harness/assets/{externals-Ddhtv753.js → externals-Cw0MmkHM.js} +1 -1
  20. package/bundled-test-harness/assets/{fallback-banner-live-delete-test-CFbMEFHo.js → fallback-banner-live-delete-test-Bzqw4uMs.js} +1 -1
  21. package/bundled-test-harness/assets/{fallback-banner-test-3O0imkxJ.js → fallback-banner-test-BMQVK4gy.js} +1 -1
  22. package/bundled-test-harness/assets/{fallback-models-test-hyQfQLuM.js → fallback-models-test-DkdjPwvA.js} +1 -1
  23. package/bundled-test-harness/assets/{file-attachment-test-C63Ttyaj.js → file-attachment-test-yvR5gw9_.js} +1 -1
  24. package/bundled-test-harness/assets/{general-test-wrSeNkrm.js → general-test-D2j4JhrD.js} +1 -1
  25. package/bundled-test-harness/assets/{index-query-engine-test-DvfKgn6s.js → index-query-engine-test-DFkm037X.js} +1 -1
  26. package/bundled-test-harness/assets/{instance-filter-matcher-test-KqGi-K79.js → instance-filter-matcher-test-UqB2Rto8.js} +1 -1
  27. package/bundled-test-harness/assets/{main-CoUo04VF.js → main-CM62YtMN.js} +1 -1
  28. package/bundled-test-harness/assets/{model-cost-tier-test-B5ByLtAP.js → model-cost-tier-test-CDXxio0B.js} +1 -1
  29. package/bundled-test-harness/assets/{operation-lowering-test-Bz81V0Gt.js → operation-lowering-test-C_CaTJ0F.js} +1 -1
  30. package/bundled-test-harness/assets/{operator-mode-card-chooser-test-DNOnplV8.js → operator-mode-card-chooser-test-CU5f7q6r.js} +1 -1
  31. package/bundled-test-harness/assets/{operator-mode-links-test-BeXsOYMU.js → operator-mode-links-test-CoeF3prV.js} +1 -1
  32. package/bundled-test-harness/assets/{operator-mode-test-jdeCXqhV.js → operator-mode-test-B9c6N5FF.js} +1 -1
  33. package/bundled-test-harness/assets/{operator-mode-ui-test-DdiFZylM.js → operator-mode-ui-test-CJQxypf_.js} +1 -1
  34. package/bundled-test-harness/assets/{overlay-menu-items-test-C_Q4sJlC.js → overlay-menu-items-test-CFWZ-tzq.js} +1 -1
  35. package/bundled-test-harness/assets/{past-sessions-test-Bm1UiLD0.js → past-sessions-test-7FgLJlog.js} +1 -1
  36. package/bundled-test-harness/assets/{permission-checking-realm-test-Jq7R-yRT.js → permission-checking-realm-test-Cm9eB-hE.js} +1 -1
  37. package/bundled-test-harness/assets/{quick-look-test-BrnxRRsq.js → quick-look-test-DrqgCLlM.js} +1 -1
  38. package/bundled-test-harness/assets/{realm-api-keys-Tlj0OK1c.css → realm-api-keys-16eN_yJb.css} +35 -25
  39. package/bundled-test-harness/assets/{realm-api-keys-CHPnfcko.js → realm-api-keys-ZJedocgl.js} +10 -4
  40. package/bundled-test-harness/assets/realm-api-keys-m-EOSWuV.js +2 -0
  41. package/bundled-test-harness/assets/{realm-api-keys-test-mrgvnhFJ.js → realm-api-keys-test-Ba_1CKJu.js} +3 -5
  42. package/bundled-test-harness/assets/{realm-api-keys-test-CHBGOFcx.js → realm-api-keys-test-jXscHLbS.js} +1 -1
  43. package/bundled-test-harness/assets/{realm-config-C7c3B2er.js → realm-config-DIOozzdQ.js} +1 -1
  44. package/bundled-test-harness/assets/{realm-config-policy-standing-test-C8aNeb6_.js → realm-config-policy-standing-test-DEFQEEvl.js} +1 -1
  45. package/bundled-test-harness/assets/{realm-config-routing-rule-edit-test-Dmnw-VQz.js → realm-config-routing-rule-edit-test-CtLYsxzq.js} +1 -1
  46. package/bundled-test-harness/assets/{realm-config-settings-test-C6V0Mx35.js → realm-config-settings-test-Dsatuv-T.js} +1 -1
  47. package/bundled-test-harness/assets/{reasoning-test-Dn0Xb42V.js → reasoning-test-3p_PygAV.js} +1 -1
  48. package/bundled-test-harness/assets/{schema-generation-test-De1eamwr.js → schema-generation-test-hkFzUr7-.js} +1 -1
  49. package/bundled-test-harness/assets/{scrolling-test-sLBz7Gxv.js → scrolling-test-B8CudFE9.js} +1 -1
  50. package/bundled-test-harness/assets/{searchable-option-test-Ix9_H5QV.js → searchable-option-test-B8lZyJij.js} +1 -1
  51. package/bundled-test-harness/assets/{sending-test-_Pqzq1bN.js → sending-test-BtH1z2uE.js} +1 -1
  52. package/bundled-test-harness/assets/{skills-test-DUHRQGiC.js → skills-test-DIQvoCLm.js} +1 -1
  53. package/bundled-test-harness/assets/{store-test-9C-s0-H6.js → store-test-DoHgyfQA.js} +1 -1
  54. package/bundled-test-harness/assets/{tests-CVpu0hZj.js → tests-DXX9TrgY.js} +369 -360
  55. package/bundled-test-harness/assets/{text-input-validator-test-CcVh-MFa.js → text-input-validator-test-D56aDP2e.js} +1 -1
  56. package/bundled-test-harness/assets/{to-device-streaming-test-RFHD62PN.js → to-device-streaming-test-Ug8UnlUl.js} +1 -1
  57. package/bundled-test-harness/assets/{token-usage-test-B2iJC-UX.js → token-usage-test-BolKbZVL.js} +1 -1
  58. package/bundled-test-harness/assets/{tools-DRCjAZCp.js → tools-CkouX4wE.js} +1 -1
  59. package/bundled-test-harness/assets/{tools-test-BZOWfXML.js → tools-test-CdYgRu5Z.js} +1 -1
  60. package/bundled-test-harness/assets/{turn-settling-test-Cvu2rvzM.js → turn-settling-test-CS0PlpTg.js} +1 -1
  61. package/bundled-test-harness/assets/{unshare-key-Dfy1IK9g.js → unshare-key-W_bNI_MF.js} +0 -1
  62. package/bundled-test-harness/index.html +9 -9
  63. package/bundled-test-harness/tests/index.html +9 -9
  64. package/bundled-types/base/command.d.ts +0 -1
  65. package/bundled-types/host-app/components/operator-mode/dashboard/add-workspace.gts +5 -3
  66. package/bundled-types/host-app/components/operator-mode/dashboard/archived-workspace.gts +3 -5
  67. package/bundled-types/host-app/components/operator-mode/dashboard/catalog-shelf.gts +24 -7
  68. package/bundled-types/host-app/components/operator-mode/dashboard/workspace.gts +9 -4
  69. package/bundled-types/host-app/lib/key-shares.ts +0 -1
  70. package/bundled-types/host-app/tools/get-key-share-usage.ts +0 -1
  71. package/dist/index.js +161 -161
  72. package/package.json +1 -1
  73. package/src/commands/keys/manage.ts +22 -6
  74. package/src/lib/user-keys.ts +18 -5
  75. package/bundled-test-harness/assets/realm-api-keys-GLBmvu4U.js +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cardstack/boxel-cli",
3
- "version": "0.13.0-unstable.0",
3
+ "version": "0.13.0-unstable.1",
4
4
  "license": "MIT",
5
5
  "description": "CLI tools for Boxel workspace management",
6
6
  "main": "./dist/index.js",
@@ -48,6 +48,7 @@ import {
48
48
  unshareUserKey,
49
49
  type ConnectableClient,
50
50
  type KeyLimitChanges,
51
+ type KeyLimitName,
51
52
  type KeyLimits,
52
53
  type KeyShare,
53
54
  type KeyUsage,
@@ -1100,13 +1101,28 @@ function limitChanges(options: LimitsOptions): KeyLimitChanges {
1100
1101
  return changes;
1101
1102
  }
1102
1103
 
1104
+ // Each limit in force, one line each, marked where it is the platform's
1105
+ // default rather than one its owner set. The rate's two halves are marked
1106
+ // apart, since either may be set without the other.
1107
+ export function limitLines(what: string, limits: KeyLimits): string[] {
1108
+ let mark = (name: KeyLimitName) =>
1109
+ limits.set?.[name] === null ? ' (default)' : '';
1110
+ let monthlyDefault =
1111
+ limits.set?.monthlyBudget === null
1112
+ ? ` (default: ${limits.defaults?.monthlyBudgetDays ?? 30} × the daily budget)`
1113
+ : '';
1114
+ return [
1115
+ `Limits on ${what}:`,
1116
+ ` rate: ${limits.rateBurst} calls at once per caller${mark('rateBurst')}, refilled at ${limits.rateRefillPerMinute} a minute${mark('rateRefillPerMinute')}`,
1117
+ ` daily budget: ${limits.dailyBudget} calls${mark('dailyBudget')}`,
1118
+ ` monthly budget: ${limits.monthlyBudget} calls${monthlyDefault}`,
1119
+ ];
1120
+ }
1121
+
1103
1122
  function printLimits(what: string, limits: KeyLimits): void {
1104
- console.log(`Limits on ${what}:`);
1105
- console.log(
1106
- ` rate: ${limits.rateBurst} calls at once per caller, refilled at ${limits.rateRefillPerMinute} a minute`,
1107
- );
1108
- console.log(` daily budget: ${limits.dailyBudget} calls`);
1109
- console.log(` monthly budget: ${limits.monthlyBudget} calls`);
1123
+ for (let line of limitLines(what, limits)) {
1124
+ console.log(line);
1125
+ }
1110
1126
  }
1111
1127
 
1112
1128
  // A share named by its label with `--realm`, or else one of the user's own
@@ -157,19 +157,33 @@ export interface KeyShare {
157
157
 
158
158
  // How much of a key interactive calls may spend: a token bucket per caller
159
159
  // (`rateBurst` calls at once, refilled at `rateRefillPerMinute`) and the calls
160
- // the share or key serves in a UTC day and month, across every caller.
160
+ // the share or key serves in a UTC day and month, across every caller. `set`
161
+ // holds each as its owner set it, null where the platform's default is in
162
+ // force, and `defaults` what an unset one takes: an unset monthly budget is
163
+ // `monthlyBudgetDays` daily budgets, so it follows the daily budget.
161
164
  export interface KeyLimits {
162
165
  rateBurst: number;
163
166
  rateRefillPerMinute: number;
164
167
  dailyBudget: number;
165
168
  monthlyBudget: number;
169
+ set?: Record<KeyLimitName, number | null>;
170
+ defaults?: {
171
+ rateBurst: number;
172
+ rateRefillPerMinute: number;
173
+ dailyBudget: number;
174
+ monthlyBudgetDays: number;
175
+ };
166
176
  }
167
177
 
178
+ export type KeyLimitName =
179
+ | 'rateBurst'
180
+ | 'rateRefillPerMinute'
181
+ | 'dailyBudget'
182
+ | 'monthlyBudget';
183
+
168
184
  // A change to some of a key's limits: a limit left out keeps what it was, and
169
185
  // null puts it back to the platform's default.
170
- export type KeyLimitChanges = Partial<{
171
- [limit in keyof KeyLimits]: number | null;
172
- }>;
186
+ export type KeyLimitChanges = Partial<Record<KeyLimitName, number | null>>;
173
187
 
174
188
  export interface KeyShareOperation {
175
189
  bindingId: string;
@@ -209,7 +223,6 @@ export interface KeyUsage {
209
223
  vendorOutcomes: { status: number; count: number; outcome?: string }[];
210
224
  grants: {
211
225
  id: string;
212
- host: string;
213
226
  destination: string;
214
227
  state: 'active' | 'rejected';
215
228
  rejectedAt: string | null;
@@ -1,2 +0,0 @@
1
- import { t as RealmApiKeys } from "./realm-api-keys-CHPnfcko.js";
2
- export { RealmApiKeys as default };