@songsid/agend 2.1.2-beta.2 → 2.1.2-beta.21

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 (147) hide show
  1. package/dist/access-path.js +15 -6
  2. package/dist/access-path.js.map +1 -1
  3. package/dist/agent-endpoint.d.ts +2 -0
  4. package/dist/agent-endpoint.js +17 -1
  5. package/dist/agent-endpoint.js.map +1 -1
  6. package/dist/backend/antigravity.d.ts +18 -0
  7. package/dist/backend/antigravity.js +32 -3
  8. package/dist/backend/antigravity.js.map +1 -1
  9. package/dist/backend/claude-code.d.ts +37 -0
  10. package/dist/backend/claude-code.js +43 -1
  11. package/dist/backend/claude-code.js.map +1 -1
  12. package/dist/backend/codex.d.ts +1 -0
  13. package/dist/backend/codex.js +25 -0
  14. package/dist/backend/codex.js.map +1 -1
  15. package/dist/backend/grok.d.ts +23 -0
  16. package/dist/backend/grok.js +45 -0
  17. package/dist/backend/grok.js.map +1 -1
  18. package/dist/backend/kiro.d.ts +20 -0
  19. package/dist/backend/kiro.js +77 -2
  20. package/dist/backend/kiro.js.map +1 -1
  21. package/dist/backend/types.d.ts +34 -0
  22. package/dist/backend/types.js +1 -1
  23. package/dist/backend/types.js.map +1 -1
  24. package/dist/channel/adapters/discord.d.ts +15 -0
  25. package/dist/channel/adapters/discord.js +91 -2
  26. package/dist/channel/adapters/discord.js.map +1 -1
  27. package/dist/channel/adapters/telegram.d.ts +21 -0
  28. package/dist/channel/adapters/telegram.js +82 -0
  29. package/dist/channel/adapters/telegram.js.map +1 -1
  30. package/dist/channel/ipc-bridge.d.ts +17 -1
  31. package/dist/channel/ipc-bridge.js +53 -17
  32. package/dist/channel/ipc-bridge.js.map +1 -1
  33. package/dist/channel/ipc-timeouts.d.ts +46 -0
  34. package/dist/channel/ipc-timeouts.js +65 -0
  35. package/dist/channel/ipc-timeouts.js.map +1 -0
  36. package/dist/channel/mcp-server.js +30 -14
  37. package/dist/channel/mcp-server.js.map +1 -1
  38. package/dist/channel/mcp-tools.js +28 -1
  39. package/dist/channel/mcp-tools.js.map +1 -1
  40. package/dist/channel/reconnect-backoff.d.ts +17 -0
  41. package/dist/channel/reconnect-backoff.js +21 -0
  42. package/dist/channel/reconnect-backoff.js.map +1 -0
  43. package/dist/channel/types.d.ts +29 -0
  44. package/dist/classic-channel-manager.js +1 -5
  45. package/dist/classic-channel-manager.js.map +1 -1
  46. package/dist/cli.js +132 -52
  47. package/dist/cli.js.map +1 -1
  48. package/dist/completion.d.ts +27 -0
  49. package/dist/completion.js +121 -0
  50. package/dist/completion.js.map +1 -0
  51. package/dist/config-validator.js +9 -0
  52. package/dist/config-validator.js.map +1 -1
  53. package/dist/config.js +1 -0
  54. package/dist/config.js.map +1 -1
  55. package/dist/cost-guard.d.ts +3 -1
  56. package/dist/cost-guard.js +3 -1
  57. package/dist/cost-guard.js.map +1 -1
  58. package/dist/daemon.d.ts +219 -13
  59. package/dist/daemon.js +919 -303
  60. package/dist/daemon.js.map +1 -1
  61. package/dist/event-log.d.ts +31 -0
  62. package/dist/event-log.js +96 -0
  63. package/dist/event-log.js.map +1 -1
  64. package/dist/fleet-manager.d.ts +238 -2
  65. package/dist/fleet-manager.js +1008 -90
  66. package/dist/fleet-manager.js.map +1 -1
  67. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +22 -0
  68. package/dist/general-knowledge/skills/model-discovery/SKILL.md +14 -23
  69. package/dist/general-knowledge/skills/session-management/SKILL.md +15 -34
  70. package/dist/hang-detector.d.ts +19 -13
  71. package/dist/hang-detector.js +19 -49
  72. package/dist/hang-detector.js.map +1 -1
  73. package/dist/instance-lifecycle.d.ts +13 -1
  74. package/dist/instance-lifecycle.js +84 -3
  75. package/dist/instance-lifecycle.js.map +1 -1
  76. package/dist/instructions.d.ts +5 -0
  77. package/dist/instructions.js +9 -11
  78. package/dist/instructions.js.map +1 -1
  79. package/dist/locale.js +2 -1
  80. package/dist/locale.js.map +1 -1
  81. package/dist/logger.js +14 -0
  82. package/dist/logger.js.map +1 -1
  83. package/dist/mcp-liveness.d.ts +21 -0
  84. package/dist/mcp-liveness.js +27 -0
  85. package/dist/mcp-liveness.js.map +1 -0
  86. package/dist/outbound-handlers.d.ts +16 -0
  87. package/dist/outbound-handlers.js +121 -27
  88. package/dist/outbound-handlers.js.map +1 -1
  89. package/dist/outbound-schemas.d.ts +8 -3
  90. package/dist/outbound-schemas.js +13 -2
  91. package/dist/outbound-schemas.js.map +1 -1
  92. package/dist/pane-write-lock.d.ts +48 -0
  93. package/dist/pane-write-lock.js +73 -0
  94. package/dist/pane-write-lock.js.map +1 -0
  95. package/dist/process-memory.d.ts +31 -0
  96. package/dist/process-memory.js +79 -0
  97. package/dist/process-memory.js.map +1 -0
  98. package/dist/quickstart.js +17 -16
  99. package/dist/quickstart.js.map +1 -1
  100. package/dist/reply-dedup.d.ts +41 -0
  101. package/dist/reply-dedup.js +0 -0
  102. package/dist/reply-dedup.js.map +1 -0
  103. package/dist/scheduler/db.js +3 -0
  104. package/dist/scheduler/db.js.map +1 -1
  105. package/dist/sd-notify.d.ts +27 -0
  106. package/dist/sd-notify.js +33 -1
  107. package/dist/sd-notify.js.map +1 -1
  108. package/dist/secret-file.d.ts +33 -0
  109. package/dist/secret-file.js +36 -0
  110. package/dist/secret-file.js.map +1 -0
  111. package/dist/setup-wizard.js +9 -7
  112. package/dist/setup-wizard.js.map +1 -1
  113. package/dist/tmux-control.d.ts +58 -5
  114. package/dist/tmux-control.js +102 -14
  115. package/dist/tmux-control.js.map +1 -1
  116. package/dist/tmux-manager.d.ts +31 -1
  117. package/dist/tmux-manager.js +40 -11
  118. package/dist/tmux-manager.js.map +1 -1
  119. package/dist/topic-commands.d.ts +50 -10
  120. package/dist/topic-commands.js +242 -106
  121. package/dist/topic-commands.js.map +1 -1
  122. package/dist/tui-glyphs.d.ts +25 -0
  123. package/dist/tui-glyphs.js +26 -0
  124. package/dist/tui-glyphs.js.map +1 -0
  125. package/dist/types.d.ts +6 -0
  126. package/dist/ui/view.html +123 -2
  127. package/dist/usage/format-rich.d.ts +11 -0
  128. package/dist/usage/format-rich.js +108 -0
  129. package/dist/usage/format-rich.js.map +1 -0
  130. package/dist/usage/providers.d.ts +97 -0
  131. package/dist/usage/providers.js +834 -0
  132. package/dist/usage/providers.js.map +1 -0
  133. package/dist/usage/usage-api.d.ts +50 -0
  134. package/dist/usage/usage-api.js +111 -0
  135. package/dist/usage/usage-api.js.map +1 -0
  136. package/dist/view-api.d.ts +3 -0
  137. package/dist/view-api.js +11 -2
  138. package/dist/view-api.js.map +1 -1
  139. package/dist/web-api.js +5 -2
  140. package/dist/web-api.js.map +1 -1
  141. package/package.json +4 -1
  142. package/dist/channel/tool-tracker.d.ts +0 -13
  143. package/dist/channel/tool-tracker.js +0 -58
  144. package/dist/channel/tool-tracker.js.map +0 -1
  145. package/dist/daemon-entry.d.ts +0 -1
  146. package/dist/daemon-entry.js +0 -30
  147. package/dist/daemon-entry.js.map +0 -1
@@ -0,0 +1,97 @@
1
+ export interface UsageMetric {
2
+ label: string;
3
+ type: "percent" | "dollars" | "count" | "text";
4
+ used?: number;
5
+ limit?: number;
6
+ value?: number | string;
7
+ unit?: string;
8
+ note?: string;
9
+ resetsAt?: string | null;
10
+ windowMs?: number | null;
11
+ }
12
+ export interface ProviderUsage {
13
+ id: string;
14
+ name: string;
15
+ status: "ok" | "error" | "no-credentials";
16
+ plan?: string | null;
17
+ error?: string;
18
+ hint?: string;
19
+ metrics: UsageMetric[];
20
+ }
21
+ /**
22
+ * Where the Claude OAuth bearer comes from, in preference order:
23
+ *
24
+ * 1. `~/.claude/.credentials.json` (`claudeAiOauth.accessToken`) when present and
25
+ * unexpired — the interactive `/login` flow. Carries plan metadata.
26
+ * 2. `CLAUDE_CODE_OAUTH_TOKEN` — the long-lived (annual) token minted by
27
+ * `claude setup-token`. Users on this flow often have NO credentials file at
28
+ * all (or a stale one from an old login), which is why /usage showed them
29
+ * "not logged in" / "token expired" while their CLI worked fine. Same token
30
+ * family (`sk-ant-oat…`), same usage endpoint; it just carries no plan
31
+ * metadata, so plan shows unknown.
32
+ * 3. An expired file token with no env fallback stays an explicit error.
33
+ * 4. `ANTHROPIC_API_KEY` alone is named in the hint but NOT used: console API
34
+ * keys are pay-per-token and have no subscription usage to query — the OAuth
35
+ * endpoint rejects them, and pretending otherwise would render a misleading
36
+ * error instead of an accurate "log in" hint.
37
+ */
38
+ export declare function resolveClaudeAuth(file: {
39
+ accessToken?: string;
40
+ expiresAt?: number;
41
+ subscriptionType?: string;
42
+ rateLimitTier?: string;
43
+ } | null, env?: NodeJS.ProcessEnv): {
44
+ token: string;
45
+ plan: string | null;
46
+ } | {
47
+ error: string;
48
+ plan: string | null;
49
+ } | null;
50
+ interface AgyBucket {
51
+ bucketId?: string;
52
+ displayName?: string;
53
+ remainingFraction?: number;
54
+ resetTime?: string;
55
+ }
56
+ /**
57
+ * Pool the summary's buckets into at most four metrics.
58
+ *
59
+ * Two payload shapes exist. Older accounts report pooled ids (`gemini-5h`,
60
+ * `gemini-weekly`, `3p-5h`, `3p-weekly`), which map 1:1. This machine's live
61
+ * response instead lists PER-MODEL buckets (`gemini-3.6-flash-high`,
62
+ * `claude-sonnet-4-6`, `gpt-oss-120b-medium`, …) — those aggregate into a
63
+ * Gemini pool and an everything-else pool, keeping each pool's WORST remaining
64
+ * fraction, because eleven per-model meters is noise and the binding constraint
65
+ * is the one that runs out first.
66
+ */
67
+ export declare function agyPoolMetrics(buckets: AgyBucket[]): UsageMetric[];
68
+ interface KiroToken {
69
+ access_token?: string;
70
+ expires_at?: string;
71
+ region?: string;
72
+ profile_arn?: string;
73
+ /** IAM Identity Center portal URL — present only for Q Developer Pro logins. */
74
+ start_url?: string;
75
+ /** Social login provider (google/github/…) — present only for free-tier logins. */
76
+ provider?: string;
77
+ }
78
+ /**
79
+ * Which Kiro login is in use. Verified against a real kiro-cli auth store:
80
+ * - IAM Identity Center (Amazon Q Developer Pro) tokens carry `start_url`
81
+ * (e.g. `https://d-xxxx.awsapps.com/start/`) and no social `provider`.
82
+ * - Free-tier social logins (Builder ID / Google / GitHub) carry `provider`
83
+ * and a `profile_arn`.
84
+ * Q Developer Pro is a seat-licensed subscription, so the credit/usage endpoint
85
+ * that Builder ID reports against does not describe it.
86
+ */
87
+ export type KiroAuthKind = "q-developer-pro" | "builder-id";
88
+ export declare function kiroAuthKind(token: KiroToken): KiroAuthKind;
89
+ /** Exported for tests: the Q-Pro and expired paths return without any network call. */
90
+ export declare function fetchKiroUsage(): Promise<Omit<ProviderUsage, "id" | "name">>;
91
+ /** Fetch every provider in parallel. Providers without local credentials are
92
+ * skipped (per the panel's contract: absent CLIs simply don't show). */
93
+ export declare function fetchAllUsage(): Promise<{
94
+ fetchedAt: string;
95
+ providers: ProviderUsage[];
96
+ }>;
97
+ export {};