chatccc 0.2.231 → 0.2.232

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 (127) hide show
  1. package/.agents/skills/create-chatccc-feishu-app/SKILL.md +85 -85
  2. package/.claude/skills/create-chatccc-feishu-app/SKILL.md +85 -85
  3. package/.cursor/skills/create-chatccc-feishu-app/SKILL.md +85 -85
  4. package/README.md +90 -90
  5. package/agent-prompts/claude_specific.md +45 -45
  6. package/agent-prompts/codex_specific.md +2 -2
  7. package/agent-prompts/cursor_specific.md +13 -13
  8. package/bin/cccagent.mjs +17 -17
  9. package/im-skills/feishu-skill/receive-send-file.md +63 -63
  10. package/im-skills/feishu-skill/receive-send-image.md +24 -24
  11. package/im-skills/feishu-skill/skill.md +3 -3
  12. package/im-skills/wechat-file-skill/receive-send-file.md +38 -38
  13. package/im-skills/wechat-file-skill/send-file.mjs +83 -83
  14. package/im-skills/wechat-file-skill/skill.md +10 -10
  15. package/im-skills/wechat-image-skill/skill.md +10 -10
  16. package/im-skills/wechat-video-skill/receive-send-video.md +38 -38
  17. package/im-skills/wechat-video-skill/send-video.mjs +79 -79
  18. package/im-skills/wechat-video-skill/skill.md +10 -10
  19. package/package.json +1 -1
  20. package/scripts/postinstall-sharp-check.mjs +58 -58
  21. package/src/__tests__/agent-activity.test.ts +86 -86
  22. package/src/__tests__/agent-delegate-task-rpc.test.ts +165 -165
  23. package/src/__tests__/agent-reload-config-rpc.test.ts +99 -99
  24. package/src/__tests__/builtin-chat-session.test.ts +449 -393
  25. package/src/__tests__/builtin-cli-json.test.ts +39 -39
  26. package/src/__tests__/builtin-config.test.ts +26 -26
  27. package/src/__tests__/builtin-context.test.ts +319 -202
  28. package/src/__tests__/builtin-file-tools.test.ts +240 -240
  29. package/src/__tests__/builtin-permissions.test.ts +211 -211
  30. package/src/__tests__/builtin-session-search.test.ts +228 -0
  31. package/src/__tests__/builtin-session-select.test.ts +116 -116
  32. package/src/__tests__/builtin-sigint.test.ts +56 -56
  33. package/src/__tests__/builtin-skills.test.ts +284 -284
  34. package/src/__tests__/builtin-web-tools.test.ts +220 -220
  35. package/src/__tests__/card-action-routing.test.ts +18 -18
  36. package/src/__tests__/cardkit.test.ts +60 -60
  37. package/src/__tests__/ccc-adapter.test.ts +170 -170
  38. package/src/__tests__/chatgpt-subscription-rpc.test.ts +89 -89
  39. package/src/__tests__/chatgpt-subscription.test.ts +135 -135
  40. package/src/__tests__/chrome-devtools-guard.test.ts +165 -165
  41. package/src/__tests__/claude-adapter.test.ts +614 -614
  42. package/src/__tests__/claude-raw-stream-log.test.ts +87 -87
  43. package/src/__tests__/codex-adapter.test.ts +58 -58
  44. package/src/__tests__/codex-raw-stream-log.test.ts +170 -170
  45. package/src/__tests__/codex-reset-actions.test.ts +146 -146
  46. package/src/__tests__/cursor-adapter.test.ts +268 -268
  47. package/src/__tests__/feishu-api.test.ts +60 -60
  48. package/src/__tests__/feishu-avatar.test.ts +164 -164
  49. package/src/__tests__/feishu-message-ingress.test.ts +138 -138
  50. package/src/__tests__/feishu-platform.test.ts +22 -22
  51. package/src/__tests__/format-message.test.ts +47 -47
  52. package/src/__tests__/jsonl-stream.test.ts +79 -79
  53. package/src/__tests__/package-files.test.ts +24 -24
  54. package/src/__tests__/privacy.test.ts +198 -198
  55. package/src/__tests__/progress-reducer.test.ts +121 -121
  56. package/src/__tests__/raw-stream-log.test.ts +106 -106
  57. package/src/__tests__/response-stall.test.ts +49 -49
  58. package/src/__tests__/restart.test.ts +132 -132
  59. package/src/__tests__/session.test.ts +199 -199
  60. package/src/__tests__/shared-prefix.test.ts +36 -36
  61. package/src/__tests__/sim-platform.test.ts +16 -16
  62. package/src/__tests__/startup-lifecycle.test.ts +231 -231
  63. package/src/__tests__/stop-session.test.ts +34 -34
  64. package/src/__tests__/stream-state.test.ts +42 -42
  65. package/src/__tests__/terminal-error.test.ts +54 -54
  66. package/src/__tests__/terminal-renderer.test.ts +247 -247
  67. package/src/__tests__/update-command-guard.test.ts +144 -144
  68. package/src/__tests__/web-ui.test.ts +326 -326
  69. package/src/adapters/adapter-interface.ts +33 -33
  70. package/src/adapters/ccc-adapter.ts +141 -141
  71. package/src/adapters/claude-adapter.ts +620 -620
  72. package/src/adapters/claude-session-meta-store.ts +120 -120
  73. package/src/adapters/codex-adapter.ts +426 -426
  74. package/src/adapters/cursor-adapter.ts +681 -681
  75. package/src/adapters/jsonl-stream.ts +157 -157
  76. package/src/adapters/raw-stream-log.ts +124 -124
  77. package/src/adapters/resource-monitor.ts +140 -140
  78. package/src/agent-activity.ts +175 -175
  79. package/src/agent-delegate-task-rpc.ts +153 -153
  80. package/src/agent-delegate-task.ts +91 -91
  81. package/src/agent-reload-config-rpc.ts +34 -34
  82. package/src/agent-stop-stuck.ts +129 -129
  83. package/src/builtin/cli.ts +6 -0
  84. package/src/builtin/config.ts +84 -84
  85. package/src/builtin/context.ts +465 -391
  86. package/src/builtin/file-log.ts +38 -38
  87. package/src/builtin/file-tools.ts +34 -0
  88. package/src/builtin/index.ts +24 -23
  89. package/src/builtin/proc-tree-kill.ts +61 -61
  90. package/src/builtin/progress/cards-helpers.ts +76 -76
  91. package/src/builtin/progress/reducer.ts +113 -113
  92. package/src/builtin/progress/terminal-renderer.ts +294 -294
  93. package/src/builtin/progress/view.ts +77 -77
  94. package/src/builtin/raw-stream-log.ts +124 -124
  95. package/src/builtin/session-search.ts +363 -0
  96. package/src/builtin/session-select.ts +48 -48
  97. package/src/builtin/sigint.ts +50 -50
  98. package/src/builtin/skills.ts +205 -205
  99. package/src/builtin/web-tools.ts +313 -313
  100. package/src/card-action-routing.ts +14 -14
  101. package/src/chatgpt-subscription-rpc.ts +27 -27
  102. package/src/chatgpt-subscription.ts +299 -299
  103. package/src/chrome-devtools-guard.ts +318 -318
  104. package/src/codex-reset-actions.ts +184 -184
  105. package/src/feishu-api.ts +193 -193
  106. package/src/feishu-message-ingress.ts +195 -195
  107. package/src/feishu-platform.ts +20 -20
  108. package/src/format-message.ts +293 -293
  109. package/src/litellm-proxy.ts +374 -374
  110. package/src/orchestrator.ts +2494 -2494
  111. package/src/platform-adapter.ts +6 -6
  112. package/src/privacy.ts +118 -118
  113. package/src/progress/reducer.ts +113 -113
  114. package/src/progress/terminal-renderer.ts +294 -294
  115. package/src/progress/view.ts +77 -77
  116. package/src/response-stall.ts +28 -28
  117. package/src/runtime-reload.ts +34 -34
  118. package/src/session-chat-binding.ts +82 -82
  119. package/src/session-name.ts +8 -8
  120. package/src/session.ts +201 -201
  121. package/src/shared-prefix.ts +29 -29
  122. package/src/sim-platform.ts +20 -20
  123. package/src/startup-lifecycle.ts +250 -250
  124. package/src/stream-state.ts +21 -21
  125. package/src/terminal-error.ts +129 -129
  126. package/src/turn-cards.ts +117 -117
  127. package/src/update-command-guard.ts +165 -165
@@ -1,195 +1,195 @@
1
- import { homedir } from "node:os";
2
- import { dirname, join } from "node:path";
3
- import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
4
-
5
- export const MAX_PROCESSED = 5000;
6
-
7
- export type FeishuMessageDisposition = "accepted" | "duplicate" | "stale";
8
-
9
- export interface FeishuMessageIdentity {
10
- messageId?: string;
11
- chatId: string;
12
- createTime: number;
13
- }
14
-
15
- interface PersistedMessageEntry {
16
- messageId: string;
17
- chatId: string;
18
- createTime: number;
19
- }
20
-
21
- interface PersistedMessageLedger {
22
- version: 1;
23
- entries: PersistedMessageEntry[];
24
- }
25
-
26
- type ScheduleTask = (task: () => void) => void;
27
-
28
- const defaultSchedule: ScheduleTask = (task) => {
29
- setImmediate(task);
30
- };
31
-
32
- /**
33
- * The Feishu SDK waits for an event handler's return value before sending its
34
- * WebSocket response. Schedule the real work for the next event-loop turn so
35
- * the SDK callback can return and acknowledge the event immediately.
36
- */
37
- export function createAckFirstEventHandler<T>(
38
- worker: (data: T) => Promise<void>,
39
- onError: (error: unknown) => void,
40
- schedule: ScheduleTask = defaultSchedule,
41
- ): (data: T) => Promise<void> {
42
- return async (data) => {
43
- schedule(() => {
44
- void worker(data).catch(onError);
45
- });
46
- };
47
- }
48
-
49
- function isPersistedEntry(value: unknown): value is PersistedMessageEntry {
50
- if (!value || typeof value !== "object") return false;
51
- const entry = value as Record<string, unknown>;
52
- return typeof entry.messageId === "string"
53
- && entry.messageId.length > 0
54
- && typeof entry.chatId === "string"
55
- && typeof entry.createTime === "number"
56
- && Number.isFinite(entry.createTime);
57
- }
58
-
59
- export class FeishuMessageLedger {
60
- private readonly messageIds: Set<string>;
61
- private entries: PersistedMessageEntry[] = [];
62
- private latestCreateTimeByChat = new Map<string, number>();
63
- private persistTail: Promise<void> = Promise.resolve();
64
-
65
- constructor(
66
- public readonly filePath: string,
67
- private readonly maxEntries = MAX_PROCESSED,
68
- messageIds?: Set<string>,
69
- ) {
70
- this.messageIds = messageIds ?? new Set<string>();
71
- }
72
-
73
- async load(): Promise<void> {
74
- this.clearMemory();
75
-
76
- try {
77
- const raw = await readFile(this.filePath, "utf-8");
78
- const parsed = JSON.parse(raw) as Partial<PersistedMessageLedger>;
79
- const entries = Array.isArray(parsed.entries)
80
- ? parsed.entries.filter(isPersistedEntry)
81
- : [];
82
- this.entries = entries.slice(-this.maxEntries);
83
- this.rebuildIndexes();
84
-
85
- if (entries.length > this.maxEntries) {
86
- await this.persist();
87
- }
88
- } catch (error) {
89
- if ((error as NodeJS.ErrnoException).code !== "ENOENT") {
90
- console.error(
91
- `[FEISHU-DEDUP] Failed to load ${this.filePath}: ${(error as Error).message}`,
92
- );
93
- }
94
- }
95
- }
96
-
97
- async accept(identity: FeishuMessageIdentity): Promise<FeishuMessageDisposition> {
98
- const { messageId, chatId, createTime } = identity;
99
-
100
- if (messageId && this.messageIds.has(messageId)) {
101
- return "duplicate";
102
- }
103
-
104
- const latestCreateTime = this.latestCreateTimeByChat.get(chatId);
105
- if (latestCreateTime !== undefined && createTime < latestCreateTime) {
106
- return "stale";
107
- }
108
-
109
- if (!messageId) {
110
- this.recordLatestCreateTime(chatId, createTime);
111
- return "accepted";
112
- }
113
-
114
- this.entries.push({ messageId, chatId, createTime });
115
- this.messageIds.add(messageId);
116
- this.recordLatestCreateTime(chatId, createTime);
117
-
118
- if (this.entries.length > this.maxEntries) {
119
- this.entries = this.entries.slice(-this.maxEntries);
120
- this.rebuildIndexes();
121
- }
122
-
123
- try {
124
- await this.persist();
125
- } catch (error) {
126
- console.error(
127
- `[FEISHU-DEDUP] Failed to persist ${this.filePath}: ${(error as Error).message}`,
128
- );
129
- }
130
- return "accepted";
131
- }
132
-
133
- clearMemory(): void {
134
- this.entries = [];
135
- this.messageIds.clear();
136
- this.latestCreateTimeByChat.clear();
137
- this.persistTail = Promise.resolve();
138
- }
139
-
140
- private recordLatestCreateTime(chatId: string, createTime: number): void {
141
- const current = this.latestCreateTimeByChat.get(chatId);
142
- if (current === undefined || createTime > current) {
143
- this.latestCreateTimeByChat.set(chatId, createTime);
144
- }
145
- }
146
-
147
- private rebuildIndexes(): void {
148
- this.messageIds.clear();
149
- this.latestCreateTimeByChat.clear();
150
- for (const entry of this.entries) {
151
- this.messageIds.add(entry.messageId);
152
- this.recordLatestCreateTime(entry.chatId, entry.createTime);
153
- }
154
- }
155
-
156
- private persist(): Promise<void> {
157
- const snapshot: PersistedMessageLedger = {
158
- version: 1,
159
- entries: this.entries.map((entry) => ({ ...entry })),
160
- };
161
-
162
- const nextPersist = this.persistTail
163
- .catch(() => {})
164
- .then(async () => {
165
- await mkdir(dirname(this.filePath), { recursive: true });
166
- const tempPath = `${this.filePath}.${process.pid}.tmp`;
167
- try {
168
- await writeFile(tempPath, JSON.stringify(snapshot), "utf-8");
169
- await rename(tempPath, this.filePath);
170
- } finally {
171
- await rm(tempPath, { force: true }).catch(() => {});
172
- }
173
- });
174
- this.persistTail = nextPersist;
175
- return nextPersist;
176
- }
177
- }
178
-
179
- const defaultLedgerPath = join(
180
- homedir(),
181
- ".chatccc",
182
- "state",
183
- "feishu-message-ledger.json",
184
- );
185
-
186
- export const processedMessages = new Set<string>();
187
- export const feishuMessageLedger = new FeishuMessageLedger(
188
- defaultLedgerPath,
189
- MAX_PROCESSED,
190
- processedMessages,
191
- );
192
-
193
- export function clearFeishuMessageLedgerMemory(): void {
194
- feishuMessageLedger.clearMemory();
195
- }
1
+ import { homedir } from "node:os";
2
+ import { dirname, join } from "node:path";
3
+ import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
4
+
5
+ export const MAX_PROCESSED = 5000;
6
+
7
+ export type FeishuMessageDisposition = "accepted" | "duplicate" | "stale";
8
+
9
+ export interface FeishuMessageIdentity {
10
+ messageId?: string;
11
+ chatId: string;
12
+ createTime: number;
13
+ }
14
+
15
+ interface PersistedMessageEntry {
16
+ messageId: string;
17
+ chatId: string;
18
+ createTime: number;
19
+ }
20
+
21
+ interface PersistedMessageLedger {
22
+ version: 1;
23
+ entries: PersistedMessageEntry[];
24
+ }
25
+
26
+ type ScheduleTask = (task: () => void) => void;
27
+
28
+ const defaultSchedule: ScheduleTask = (task) => {
29
+ setImmediate(task);
30
+ };
31
+
32
+ /**
33
+ * The Feishu SDK waits for an event handler's return value before sending its
34
+ * WebSocket response. Schedule the real work for the next event-loop turn so
35
+ * the SDK callback can return and acknowledge the event immediately.
36
+ */
37
+ export function createAckFirstEventHandler<T>(
38
+ worker: (data: T) => Promise<void>,
39
+ onError: (error: unknown) => void,
40
+ schedule: ScheduleTask = defaultSchedule,
41
+ ): (data: T) => Promise<void> {
42
+ return async (data) => {
43
+ schedule(() => {
44
+ void worker(data).catch(onError);
45
+ });
46
+ };
47
+ }
48
+
49
+ function isPersistedEntry(value: unknown): value is PersistedMessageEntry {
50
+ if (!value || typeof value !== "object") return false;
51
+ const entry = value as Record<string, unknown>;
52
+ return typeof entry.messageId === "string"
53
+ && entry.messageId.length > 0
54
+ && typeof entry.chatId === "string"
55
+ && typeof entry.createTime === "number"
56
+ && Number.isFinite(entry.createTime);
57
+ }
58
+
59
+ export class FeishuMessageLedger {
60
+ private readonly messageIds: Set<string>;
61
+ private entries: PersistedMessageEntry[] = [];
62
+ private latestCreateTimeByChat = new Map<string, number>();
63
+ private persistTail: Promise<void> = Promise.resolve();
64
+
65
+ constructor(
66
+ public readonly filePath: string,
67
+ private readonly maxEntries = MAX_PROCESSED,
68
+ messageIds?: Set<string>,
69
+ ) {
70
+ this.messageIds = messageIds ?? new Set<string>();
71
+ }
72
+
73
+ async load(): Promise<void> {
74
+ this.clearMemory();
75
+
76
+ try {
77
+ const raw = await readFile(this.filePath, "utf-8");
78
+ const parsed = JSON.parse(raw) as Partial<PersistedMessageLedger>;
79
+ const entries = Array.isArray(parsed.entries)
80
+ ? parsed.entries.filter(isPersistedEntry)
81
+ : [];
82
+ this.entries = entries.slice(-this.maxEntries);
83
+ this.rebuildIndexes();
84
+
85
+ if (entries.length > this.maxEntries) {
86
+ await this.persist();
87
+ }
88
+ } catch (error) {
89
+ if ((error as NodeJS.ErrnoException).code !== "ENOENT") {
90
+ console.error(
91
+ `[FEISHU-DEDUP] Failed to load ${this.filePath}: ${(error as Error).message}`,
92
+ );
93
+ }
94
+ }
95
+ }
96
+
97
+ async accept(identity: FeishuMessageIdentity): Promise<FeishuMessageDisposition> {
98
+ const { messageId, chatId, createTime } = identity;
99
+
100
+ if (messageId && this.messageIds.has(messageId)) {
101
+ return "duplicate";
102
+ }
103
+
104
+ const latestCreateTime = this.latestCreateTimeByChat.get(chatId);
105
+ if (latestCreateTime !== undefined && createTime < latestCreateTime) {
106
+ return "stale";
107
+ }
108
+
109
+ if (!messageId) {
110
+ this.recordLatestCreateTime(chatId, createTime);
111
+ return "accepted";
112
+ }
113
+
114
+ this.entries.push({ messageId, chatId, createTime });
115
+ this.messageIds.add(messageId);
116
+ this.recordLatestCreateTime(chatId, createTime);
117
+
118
+ if (this.entries.length > this.maxEntries) {
119
+ this.entries = this.entries.slice(-this.maxEntries);
120
+ this.rebuildIndexes();
121
+ }
122
+
123
+ try {
124
+ await this.persist();
125
+ } catch (error) {
126
+ console.error(
127
+ `[FEISHU-DEDUP] Failed to persist ${this.filePath}: ${(error as Error).message}`,
128
+ );
129
+ }
130
+ return "accepted";
131
+ }
132
+
133
+ clearMemory(): void {
134
+ this.entries = [];
135
+ this.messageIds.clear();
136
+ this.latestCreateTimeByChat.clear();
137
+ this.persistTail = Promise.resolve();
138
+ }
139
+
140
+ private recordLatestCreateTime(chatId: string, createTime: number): void {
141
+ const current = this.latestCreateTimeByChat.get(chatId);
142
+ if (current === undefined || createTime > current) {
143
+ this.latestCreateTimeByChat.set(chatId, createTime);
144
+ }
145
+ }
146
+
147
+ private rebuildIndexes(): void {
148
+ this.messageIds.clear();
149
+ this.latestCreateTimeByChat.clear();
150
+ for (const entry of this.entries) {
151
+ this.messageIds.add(entry.messageId);
152
+ this.recordLatestCreateTime(entry.chatId, entry.createTime);
153
+ }
154
+ }
155
+
156
+ private persist(): Promise<void> {
157
+ const snapshot: PersistedMessageLedger = {
158
+ version: 1,
159
+ entries: this.entries.map((entry) => ({ ...entry })),
160
+ };
161
+
162
+ const nextPersist = this.persistTail
163
+ .catch(() => {})
164
+ .then(async () => {
165
+ await mkdir(dirname(this.filePath), { recursive: true });
166
+ const tempPath = `${this.filePath}.${process.pid}.tmp`;
167
+ try {
168
+ await writeFile(tempPath, JSON.stringify(snapshot), "utf-8");
169
+ await rename(tempPath, this.filePath);
170
+ } finally {
171
+ await rm(tempPath, { force: true }).catch(() => {});
172
+ }
173
+ });
174
+ this.persistTail = nextPersist;
175
+ return nextPersist;
176
+ }
177
+ }
178
+
179
+ const defaultLedgerPath = join(
180
+ homedir(),
181
+ ".chatccc",
182
+ "state",
183
+ "feishu-message-ledger.json",
184
+ );
185
+
186
+ export const processedMessages = new Set<string>();
187
+ export const feishuMessageLedger = new FeishuMessageLedger(
188
+ defaultLedgerPath,
189
+ MAX_PROCESSED,
190
+ processedMessages,
191
+ );
192
+
193
+ export function clearFeishuMessageLedgerMemory(): void {
194
+ feishuMessageLedger.clearMemory();
195
+ }
@@ -29,10 +29,10 @@ export interface FeishuPlatform {
29
29
  updateChatInfo: typeof realApi.updateChatInfo;
30
30
  getChatInfo: typeof realApi.getChatInfo;
31
31
  disbandChat: typeof realApi.disbandChat;
32
- setChatAvatar: typeof realApi.setChatAvatar;
33
- getCodexUsageSummary: typeof realApi.getCodexUsageSummary;
34
- consumeCodexRateLimitResetCredit: typeof realApi.consumeCodexRateLimitResetCredit;
35
- getOrDownloadImage: typeof realApi.getOrDownloadImage;
32
+ setChatAvatar: typeof realApi.setChatAvatar;
33
+ getCodexUsageSummary: typeof realApi.getCodexUsageSummary;
34
+ consumeCodexRateLimitResetCredit: typeof realApi.consumeCodexRateLimitResetCredit;
35
+ getOrDownloadImage: typeof realApi.getOrDownloadImage;
36
36
  verifyAllPermissions: typeof realApi.verifyAllPermissions;
37
37
  reportPermissionResults: typeof realApi.reportPermissionResults;
38
38
  extractSessionInfo: typeof realApi.extractSessionInfo;
@@ -110,21 +110,21 @@ export function disbandChat(...args: Parameters<typeof realApi.disbandChat>): Re
110
110
  return _impl.disbandChat(...args);
111
111
  }
112
112
 
113
- export function setChatAvatar(...args: Parameters<typeof realApi.setChatAvatar>): ReturnType<typeof realApi.setChatAvatar> {
114
- return _impl.setChatAvatar(...args);
115
- }
116
-
117
- export function getCodexUsageSummary(...args: Parameters<typeof realApi.getCodexUsageSummary>): ReturnType<typeof realApi.getCodexUsageSummary> {
118
- return _impl.getCodexUsageSummary(...args);
119
- }
120
-
121
- export function consumeCodexRateLimitResetCredit(...args: Parameters<typeof realApi.consumeCodexRateLimitResetCredit>): ReturnType<typeof realApi.consumeCodexRateLimitResetCredit> {
122
- return _impl.consumeCodexRateLimitResetCredit(...args);
123
- }
124
-
125
- export function getOrDownloadImage(...args: Parameters<typeof realApi.getOrDownloadImage>): ReturnType<typeof realApi.getOrDownloadImage> {
126
- return _impl.getOrDownloadImage(...args);
127
- }
113
+ export function setChatAvatar(...args: Parameters<typeof realApi.setChatAvatar>): ReturnType<typeof realApi.setChatAvatar> {
114
+ return _impl.setChatAvatar(...args);
115
+ }
116
+
117
+ export function getCodexUsageSummary(...args: Parameters<typeof realApi.getCodexUsageSummary>): ReturnType<typeof realApi.getCodexUsageSummary> {
118
+ return _impl.getCodexUsageSummary(...args);
119
+ }
120
+
121
+ export function consumeCodexRateLimitResetCredit(...args: Parameters<typeof realApi.consumeCodexRateLimitResetCredit>): ReturnType<typeof realApi.consumeCodexRateLimitResetCredit> {
122
+ return _impl.consumeCodexRateLimitResetCredit(...args);
123
+ }
124
+
125
+ export function getOrDownloadImage(...args: Parameters<typeof realApi.getOrDownloadImage>): ReturnType<typeof realApi.getOrDownloadImage> {
126
+ return _impl.getOrDownloadImage(...args);
127
+ }
128
128
 
129
129
  export function verifyAllPermissions(...args: Parameters<typeof realApi.verifyAllPermissions>): ReturnType<typeof realApi.verifyAllPermissions> {
130
130
  return _impl.verifyAllPermissions(...args);
@@ -156,4 +156,4 @@ export function sendRestartCard(...args: Parameters<typeof realApi.sendRestartCa
156
156
 
157
157
  export function getMergeForwardMessages(...args: Parameters<typeof realApi.getMergeForwardMessages>): ReturnType<typeof realApi.getMergeForwardMessages> {
158
158
  return _impl.getMergeForwardMessages(...args);
159
- }
159
+ }