@indigoai-us/hq-cli 5.345.91 → 5.345.93

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 (47) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/assets/scaffold/core/scripts/qmd-reindex-bg.sh +17 -4
  3. package/dist/command-catalog.generated.d.ts +252 -0
  4. package/dist/command-catalog.generated.js +306 -0
  5. package/dist/command-registration-plan.d.ts +6 -0
  6. package/dist/command-registration-plan.js +1 -0
  7. package/dist/commands/capacity.d.ts +71 -0
  8. package/dist/commands/capacity.js +666 -0
  9. package/dist/commands/integrations-connect.js +64 -5
  10. package/dist/commands/lanes-accounts.d.ts +1 -0
  11. package/dist/commands/lanes-accounts.js +6 -0
  12. package/dist/lib/capacity/accounts.d.ts +36 -0
  13. package/dist/lib/capacity/accounts.js +90 -0
  14. package/dist/lib/capacity/collect.d.ts +33 -0
  15. package/dist/lib/capacity/collect.js +164 -0
  16. package/dist/lib/capacity/collectors/claude-oauth.d.ts +145 -0
  17. package/dist/lib/capacity/collectors/claude-oauth.js +1211 -0
  18. package/dist/lib/capacity/collectors/claude-statusline.d.ts +72 -0
  19. package/dist/lib/capacity/collectors/claude-statusline.js +436 -0
  20. package/dist/lib/capacity/collectors/codex.d.ts +120 -0
  21. package/dist/lib/capacity/collectors/codex.js +1134 -0
  22. package/dist/lib/capacity/collectors/grok.d.ts +86 -0
  23. package/dist/lib/capacity/collectors/grok.js +588 -0
  24. package/dist/lib/capacity/lane-login.d.ts +29 -0
  25. package/dist/lib/capacity/lane-login.js +91 -0
  26. package/dist/lib/capacity/ledger.d.ts +399 -0
  27. package/dist/lib/capacity/ledger.js +1441 -0
  28. package/dist/lib/capacity/project.d.ts +12 -0
  29. package/dist/lib/capacity/project.js +264 -0
  30. package/dist/lib/capacity/read.d.ts +62 -0
  31. package/dist/lib/capacity/read.js +264 -0
  32. package/dist/lib/capacity/refusal.d.ts +30 -0
  33. package/dist/lib/capacity/refusal.js +183 -0
  34. package/dist/lib/capacity/scheduler.d.ts +76 -0
  35. package/dist/lib/capacity/scheduler.js +800 -0
  36. package/dist/lib/capacity/sign-in.d.ts +103 -0
  37. package/dist/lib/capacity/sign-in.js +517 -0
  38. package/dist/lib/capacity/widget.d.ts +22 -0
  39. package/dist/lib/capacity/widget.js +418 -0
  40. package/dist/lib/lanes/spawn.js +12 -0
  41. package/dist/lib/mesh/live/daemon/run.d.ts +5 -0
  42. package/dist/lib/mesh/live/daemon/run.js +29 -1
  43. package/dist/lib/search-index/background.d.ts +31 -8
  44. package/dist/lib/search-index/background.js +86 -7
  45. package/dist/lib/search-index/index.d.ts +24 -0
  46. package/dist/lib/search-index/index.js +25 -0
  47. package/package.json +1 -1
@@ -0,0 +1,71 @@
1
+ /**
2
+ * hq capacity. `capacity`, `history`, and `doctor` read the local ledger.
3
+ * `enable`, `login`, and `ingest` write. Pinned CLI versions are the US-001
4
+ * version tokens; the installed version is the cliVersion on the latest reading.
5
+ *
6
+ * Codex rate limits use `codex app-server` only after 30 minutes idle and
7
+ * while no codex process is running. `account/rateLimits/read` does not
8
+ * refresh tokens. Starting app-server can still rewrite ~/.codex/auth.json
9
+ * for a managed ChatGPT login, so the read stays idle-gated.
10
+ */
11
+ import { Command } from "commander";
12
+ import { type CapacityState, type LedgerEvent, type LedgerOptions, type NowView, type ParserFailureEvent, type Reading, type ReadingSource } from "../lib/capacity/ledger.js";
13
+ import { type CapacityAccount } from "../lib/capacity/accounts.js";
14
+ export declare const CAPACITY_SCHEMA_VERSION: "hq-capacity-now-view.v1";
15
+ export declare const DOCTOR_SCHEMA_VERSION = "hq-capacity-doctor.v1";
16
+ export declare const PARSER_FAILURE_WINDOW_MS: number;
17
+ /** now.json older than this is stale: the collector is not keeping the view current. */
18
+ export declare const CAPACITY_STALE_MS: number;
19
+ /** Short versions inside test/fixtures/capacity/cli-versions.json. */
20
+ export declare const PINNED_CLI_VERSIONS: Record<string, string>;
21
+ export interface CapacityJson extends NowView {
22
+ schemaVersion: string;
23
+ stale: boolean;
24
+ ageMs: number;
25
+ /** null when collector.json is absent. false means the collector was turned off. */
26
+ collectorEnabled: boolean | null;
27
+ }
28
+ export interface CapacityFreshness {
29
+ stale: boolean;
30
+ ageMs: number;
31
+ message: string | null;
32
+ }
33
+ export interface DoctorSource {
34
+ source: ReadingSource;
35
+ lastSuccess: string | null;
36
+ }
37
+ export interface DoctorVersion {
38
+ provider: string;
39
+ pinned: string | null;
40
+ installed: string | null;
41
+ match: boolean;
42
+ }
43
+ export interface DoctorReport {
44
+ schemaVersion: typeof DOCTOR_SCHEMA_VERSION;
45
+ collector: "on" | "off";
46
+ sources: DoctorSource[];
47
+ versions: DoctorVersion[];
48
+ parserFailures: ParserFailureEvent[];
49
+ providers: {
50
+ provider: string;
51
+ state: CapacityState;
52
+ }[];
53
+ ok: boolean;
54
+ stale: boolean;
55
+ ageMs: number;
56
+ }
57
+ export declare function capacityOptionsFromEnv(env?: NodeJS.ProcessEnv): LedgerOptions;
58
+ export declare function withSchemaVersion(view: NowView): Omit<CapacityJson, "stale" | "ageMs" | "collectorEnabled">;
59
+ /** Stale when generatedAt is missing or older than five minutes. */
60
+ export declare function capacityFreshness(generatedAt: string, nowMs: number): CapacityFreshness;
61
+ export declare function parseSince(since: string, nowMs: number): number;
62
+ export declare function selectReadings(events: LedgerEvent[], filter?: {
63
+ provider?: string;
64
+ sinceMs?: number;
65
+ }): Reading[];
66
+ export declare function formatCapacityTable(view: NowView, nowMs: number, accounts?: readonly CapacityAccount[]): string;
67
+ export declare function formatHistory(readings: Reading[]): string;
68
+ export declare function buildDoctorReport(options?: LedgerOptions): DoctorReport;
69
+ export declare function formatDoctor(report: DoctorReport): string;
70
+ export declare function registerCapacityCommand(program: Command): Command;
71
+ //# sourceMappingURL=capacity.d.ts.map