@junctionpanel/server 0.1.50 → 0.1.51

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.
@@ -0,0 +1,72 @@
1
+ import { type ProviderRuntimeSettings } from "./agent/provider-launch-config.js";
2
+ import { type CodexAppServerRateLimitsReadResult } from "./agent/providers/codex-app-server-agent.js";
3
+ import type { ManagedDaemonProvider } from "./daemon-provider-settings.js";
4
+ export type DaemonProviderRateLimitWindow = {
5
+ id: string;
6
+ label: string;
7
+ windowLabel: string;
8
+ unitLabel: string | null;
9
+ limit: number | null;
10
+ used: number | null;
11
+ remaining: number | null;
12
+ resetsAt: string | null;
13
+ message: string | null;
14
+ };
15
+ export type DaemonProviderRateLimit = {
16
+ provider: ManagedDaemonProvider;
17
+ status: "available" | "unavailable" | "error";
18
+ sourceLabel: string | null;
19
+ planLabel: string | null;
20
+ accountLabel: string | null;
21
+ message: string | null;
22
+ refreshedAt: string;
23
+ windows: DaemonProviderRateLimitWindow[];
24
+ };
25
+ export type DaemonProviderRateLimitsSnapshot = {
26
+ homeDir: string;
27
+ rootDir: string;
28
+ providers: Record<ManagedDaemonProvider, DaemonProviderRateLimit>;
29
+ };
30
+ type CommandResult = {
31
+ status: number | null;
32
+ stdout: string;
33
+ stderr: string;
34
+ signal: NodeJS.Signals | null;
35
+ pid: number | undefined;
36
+ output: [string, string];
37
+ };
38
+ type LoadDaemonProviderRateLimitsOptions = {
39
+ env?: NodeJS.ProcessEnv;
40
+ homeDir?: string;
41
+ junctionHome?: string;
42
+ platform?: NodeJS.Platform;
43
+ now?: Date;
44
+ allowClaudeOAuthProbe?: boolean;
45
+ commandRunner?: (command: string, args: string[], options: {
46
+ env: NodeJS.ProcessEnv;
47
+ }) => CommandResult | Promise<CommandResult>;
48
+ timeoutMs?: number;
49
+ codexRateLimitReader?: (input: {
50
+ runtimeSettings?: ProviderRuntimeSettings;
51
+ timeoutMs?: number;
52
+ }) => Promise<CodexAppServerRateLimitsReadResult>;
53
+ claudeRateLimitReader?: (input: {
54
+ accessToken: string;
55
+ timeoutMs?: number;
56
+ }) => Promise<ClaudeOAuthRateLimitSnapshot>;
57
+ };
58
+ type ClaudeOAuthRateLimitSnapshot = {
59
+ fiveHourResetsAt: string | null;
60
+ fiveHourUtilization: number | null;
61
+ sevenDayResetsAt: string | null;
62
+ sevenDayUtilization: number | null;
63
+ };
64
+ /**
65
+ * Loads daemon-scoped rate-limit snapshots for Claude, Codex, and Gemini.
66
+ *
67
+ * Each provider is probed independently so a failure in one provider degrades
68
+ * only that provider's snapshot instead of aborting the whole response.
69
+ */
70
+ export declare function loadDaemonProviderRateLimits(options?: LoadDaemonProviderRateLimitsOptions): Promise<DaemonProviderRateLimitsSnapshot>;
71
+ export {};
72
+ //# sourceMappingURL=daemon-provider-rate-limits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daemon-provider-rate-limits.d.ts","sourceRoot":"","sources":["../../../src/server/daemon-provider-rate-limits.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,KAAK,kCAAkC,EACxC,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAG3E,MAAM,MAAM,6BAA6B,GAAG;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAC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