@coda-console/claude 1.11.0 → 1.12.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.
package/agent/errors.mjs CHANGED
@@ -10,12 +10,13 @@ const exhausted = message => /^(?:You've (?:hit|reached) your (?:session|weekly|
10
10
  // which the CLI sends only as a window moves), the reason says it as a time mark instead, which each client writes in
11
11
  // its own time zone (Coda's docs/agent-protocol.md「文字里的时刻」).
12
12
  const windowReset = /^(You've (?:hit|reached) your [^·]+ · resets )[^·()]+ \([^()]+\)/;
13
- const marked = (message, window) => window?.status === 'rejected' && Number.isSafeInteger(window.resetsAt) && window.resetsAt > 0
14
- ? message.replace(windowReset, (_, said) => `${said}<t:${new Date(window.resetsAt * 1000).toISOString()}>`) : message;
13
+ const resetTime = window => window?.status === 'rejected' && Number.isSafeInteger(window.resetsAt) && window.resetsAt > 0 &&
14
+ window.resetsAt <= 253402300799 ? new Date(window.resetsAt * 1000).toISOString() : undefined;
15
15
 
16
16
  export function claudeFailure(message, { error, limits, window } = {}) {
17
17
  const quota = (!error || ['rate_limit', 'billing_error'].includes(error)) &&
18
18
  (exhausted(message) || (error === 'rate_limit' && limits?.status === 'rejected'));
19
- const data = quota ? { _meta: { coda: { failure: { kind: 'quota_exhausted' } } } } : undefined;
20
- return new RequestError(-32603, quota ? marked(message, window) : message, data);
19
+ const resetAt = quota ? resetTime(window) : undefined;
20
+ const data = quota ? { _meta: { coda: { failure: { kind: 'quota_exhausted', ...(resetAt ? { resetAt } : {}) } } } } : undefined;
21
+ return new RequestError(-32603, resetAt ? message.replace(windowReset, (_, said) => `${said}<t:${resetAt}>`) : message, data);
21
22
  }
@@ -59,8 +59,10 @@ export const MESSAGES = {
59
59
  'system/post_turn_summary': internal,
60
60
  'system/task_summary': internal,
61
61
  'system/session_metadata': internal,
62
+ 'system/dev_intent': internal,
62
63
  active_goal: internal,
63
64
  autocompact_state: internal,
65
+ command_lifecycle: internal,
64
66
  };
65
67
 
66
68
  const results = hidden('服务端工具的结果,给模型读的');
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "id": "claude",
4
4
  "displayName": "Claude",
5
5
  "description": "用 Claude Agent SDK 跑会话",
6
- "version": "1.11.0",
6
+ "version": "1.12.1",
7
7
  "categories": [
8
8
  "Agent"
9
9
  ],