@camerontaylor/paseo-plugin 0.11.0-beta.1.fork.1 → 0.11.0-beta.3.fork.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.
@@ -33,26 +33,47 @@ export interface UsageDetail {
33
33
  value: string;
34
34
  tone?: UsageWindow["tone"];
35
35
  }
36
- export interface UsageReport {
37
- status: "available" | "unavailable" | "error";
36
+ export type UsageProblem = {
37
+ kind: "expired";
38
+ expiresAt: string;
39
+ refreshedBy?: string;
40
+ } | {
41
+ kind: "rejected";
42
+ status: number;
43
+ refreshedBy?: string;
44
+ } | {
45
+ kind: "no_quota";
46
+ detail: string;
47
+ };
48
+ export type UsageReport = {
49
+ status: "available";
38
50
  planLabel?: string;
39
51
  windows: UsageWindow[];
40
52
  balances?: UsageBalance[];
41
53
  details?: UsageDetail[];
42
- error?: string;
54
+ } | {
55
+ status: "unavailable";
56
+ problem: UsageProblem;
57
+ } | {
58
+ status: "error";
59
+ error: string;
60
+ };
61
+ export interface UsageAccount {
62
+ /** Stable across token rotation; [A-Za-z0-9._-]{1,128}. Never a credential or raw email. */
63
+ key: string;
64
+ label?: string;
65
+ /** Store locator, opaque to the daemon. */
66
+ input: JsonValue;
43
67
  }
44
68
  export interface UsageSourceRegistration {
45
69
  id: string;
46
70
  label: string;
47
71
  icon?: string;
48
72
  input: ZodType;
49
- /** Stable account identity, resolved without fetching usage. */
50
- identify(input: unknown): Promise<{
51
- key: string;
52
- label?: string;
53
- } | null>;
73
+ /** Every account whose login exists on this machine. Empty when none. */
74
+ discover(): Promise<UsageAccount[]>;
75
+ /** Re-reads the login store; never writes it. */
54
76
  fetch(input: unknown): Promise<UsageReport>;
55
- discover(): Promise<JsonValue[]>;
56
77
  }
57
78
  export declare function windowFromUsedPct(input: {
58
79
  id: string;
@@ -81,5 +102,5 @@ export declare function balanceToneFromRemaining(remaining: number | null | unde
81
102
  /** Percentage of a limit consumed, or null when either side is unknown. */
82
103
  export declare function usedPctOf(used: number | null | undefined, limit: number | null | undefined): number | null;
83
104
  export declare function hashAccountKey(value: string): string;
84
- export declare function unavailableUsage(): UsageReport;
105
+ export declare function unavailable(problem: UsageProblem): UsageReport;
85
106
  //# sourceMappingURL=usage.d.ts.map
@@ -54,12 +54,7 @@ export function usedPctOf(used, limit) {
54
54
  export function hashAccountKey(value) {
55
55
  return createHash("sha256").update(value).digest("hex");
56
56
  }
57
- export function unavailableUsage() {
58
- return {
59
- status: "unavailable",
60
- windows: [],
61
- balances: [],
62
- details: [],
63
- };
57
+ export function unavailable(problem) {
58
+ return { status: "unavailable", problem };
64
59
  }
65
60
  //# sourceMappingURL=usage.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camerontaylor/paseo-plugin",
3
- "version": "0.11.0-beta.1.fork.1",
3
+ "version": "0.11.0-beta.3.fork.1",
4
4
  "description": "Paseo plugin SDK package",
5
5
  "files": [
6
6
  "dist",
@@ -70,8 +70,8 @@
70
70
  "use-sync-external-store": "^1.6.0"
71
71
  },
72
72
  "devDependencies": {
73
- "@camerontaylor/paseo-client": "0.11.0-beta.1.fork.1",
74
- "@camerontaylor/paseo-protocol": "0.11.0-beta.1.fork.1",
73
+ "@camerontaylor/paseo-client": "0.11.0-beta.3.fork.1",
74
+ "@camerontaylor/paseo-protocol": "0.11.0-beta.3.fork.1",
75
75
  "@types/node": "^20.9.0",
76
76
  "@types/react": "~19.2.0",
77
77
  "react": "19.1.0",
@@ -81,8 +81,8 @@
81
81
  "zod": "^4.4.3"
82
82
  },
83
83
  "peerDependencies": {
84
- "@camerontaylor/paseo-client": "0.11.0-beta.1.fork.1",
85
- "@camerontaylor/paseo-protocol": "0.11.0-beta.1.fork.1",
84
+ "@camerontaylor/paseo-client": "0.11.0-beta.3.fork.1",
85
+ "@camerontaylor/paseo-protocol": "0.11.0-beta.3.fork.1",
86
86
  "react": "~19.1.0",
87
87
  "react-native": ">=0.81.5",
88
88
  "zod": "^4.4.3"