shraga 0.1.71 → 0.1.72

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shraga",
3
- "version": "0.1.71",
3
+ "version": "0.1.72",
4
4
  "description": "The teammate you delegate coding to — a self-hostable, multi-user AI coding agent web UI (Claude Code, with a pluggable engine seam).",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -249,14 +249,18 @@ function toLimit(l: any): ClaudeUsageLimit | null {
249
249
  }
250
250
 
251
251
  let cachedVersion: string | null = null;
252
- /** Best effort the endpoint gates on the `claude-code/` PREFIX, not the exact number, so a stale
253
- * fallback still keeps us out of the throttled bucket. */
252
+ /** The UA this endpoint gates on is the Claude Code CLI's, and prod proved the gate is real: we were
253
+ * sending `claude-code/0.2.141` the AGENT SDK's version, which is not a Claude Code version at all
254
+ * (those are 2.x) — and drew a sustained rate_limit_error with ~40min Retry-Afters. Read the CLI's
255
+ * own package when it is installed; otherwise send a plausible CURRENT version, never the SDK's. */
256
+ const FALLBACK_CLI_VERSION = '2.0.0';
254
257
  function claudeCodeVersion(): string {
255
258
  if (cachedVersion) return cachedVersion;
256
259
  try {
257
260
  const require = createRequire(import.meta.url);
258
- cachedVersion = require('@anthropic-ai/claude-agent-sdk/package.json').version || '2.0.0';
259
- } catch { cachedVersion = '2.0.0'; }
261
+ const v = require('@anthropic-ai/claude-code/package.json').version;
262
+ cachedVersion = typeof v === 'string' && /^\d+\./.test(v) ? v : FALLBACK_CLI_VERSION;
263
+ } catch { cachedVersion = FALLBACK_CLI_VERSION; }
260
264
  return cachedVersion!;
261
265
  }
262
266