@agentclientprotocol/claude-agent-acp 0.36.0 → 0.37.0
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/dist/acp-agent.d.ts.map +1 -1
- package/dist/acp-agent.js +153 -31
- package/package.json +8 -8
package/dist/acp-agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acp-agent.d.ts","sourceRoot":"","sources":["../src/acp-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,mBAAmB,EACnB,mBAAmB,EAGnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EAEnB,iBAAiB,EACjB,kBAAkB,EAElB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EAEpB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,6BAA6B,EAC7B,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAKV,SAAS,EAET,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,KAAK,EAIL,gBAAgB,EAChB,0BAA0B,EAC1B,cAAc,EAEf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAKlG,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;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B,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GACA,mBAAmB,EAAE,CAqSvB;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,0BAA0B,EACnC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IACR,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GACA,mBAAmB,EAAE,CA4CvB;AAED,wBAAgB,MAAM;;;EAWrB"}
|
package/dist/acp-agent.js
CHANGED
|
@@ -456,6 +456,7 @@ export class ClaudeAcpAgent {
|
|
|
456
456
|
}
|
|
457
457
|
session.promptRunning = true;
|
|
458
458
|
let handedOff = false;
|
|
459
|
+
let errored = false;
|
|
459
460
|
let stopReason = "end_turn";
|
|
460
461
|
try {
|
|
461
462
|
while (true) {
|
|
@@ -533,10 +534,50 @@ export class ClaudeAcpAgent {
|
|
|
533
534
|
}
|
|
534
535
|
case "session_state_changed": {
|
|
535
536
|
if (message.state === "idle") {
|
|
537
|
+
if (session.cancelled) {
|
|
538
|
+
stopReason = "cancelled";
|
|
539
|
+
}
|
|
536
540
|
return { stopReason, usage: sessionUsage(session) };
|
|
537
541
|
}
|
|
538
542
|
break;
|
|
539
543
|
}
|
|
544
|
+
case "memory_recall": {
|
|
545
|
+
const isSynthesis = message.mode === "synthesize";
|
|
546
|
+
const locations = isSynthesis
|
|
547
|
+
? []
|
|
548
|
+
: message.memories.map((m) => ({ path: m.path }));
|
|
549
|
+
const content = isSynthesis
|
|
550
|
+
? message.memories
|
|
551
|
+
.filter((m) => typeof m.content === "string")
|
|
552
|
+
.map((m) => ({
|
|
553
|
+
type: "content",
|
|
554
|
+
content: { type: "text", text: m.content },
|
|
555
|
+
}))
|
|
556
|
+
: [];
|
|
557
|
+
const count = message.memories.length;
|
|
558
|
+
const title = isSynthesis
|
|
559
|
+
? "Recalled synthesized memory"
|
|
560
|
+
: `Recalled ${count} ${count === 1 ? "memory" : "memories"}`;
|
|
561
|
+
await this.client.sessionUpdate({
|
|
562
|
+
sessionId: message.session_id,
|
|
563
|
+
update: {
|
|
564
|
+
sessionUpdate: "tool_call",
|
|
565
|
+
toolCallId: message.uuid,
|
|
566
|
+
title,
|
|
567
|
+
kind: "read",
|
|
568
|
+
status: "completed",
|
|
569
|
+
...(locations.length > 0 && { locations }),
|
|
570
|
+
...(content.length > 0 && { content }),
|
|
571
|
+
_meta: {
|
|
572
|
+
claudeCode: {
|
|
573
|
+
toolName: "memory_recall",
|
|
574
|
+
toolResponse: { mode: message.mode },
|
|
575
|
+
},
|
|
576
|
+
},
|
|
577
|
+
},
|
|
578
|
+
});
|
|
579
|
+
break;
|
|
580
|
+
}
|
|
540
581
|
case "hook_started":
|
|
541
582
|
case "hook_progress":
|
|
542
583
|
case "hook_response":
|
|
@@ -547,7 +588,6 @@ export class ClaudeAcpAgent {
|
|
|
547
588
|
case "task_updated":
|
|
548
589
|
case "elicitation_complete":
|
|
549
590
|
case "plugin_install":
|
|
550
|
-
case "memory_recall":
|
|
551
591
|
case "notification":
|
|
552
592
|
case "api_retry":
|
|
553
593
|
case "mirror_error":
|
|
@@ -827,6 +867,30 @@ export class ClaudeAcpAgent {
|
|
|
827
867
|
throw new Error("Session did not end in result");
|
|
828
868
|
}
|
|
829
869
|
catch (error) {
|
|
870
|
+
errored = true;
|
|
871
|
+
// A failed turn typically leaves a trailing `session_state_changed: idle`
|
|
872
|
+
// (and possibly more) in the query iterator. If we don't drain it here,
|
|
873
|
+
// the next prompt's first `query.next()` consumes that stale idle and
|
|
874
|
+
// short-circuits to end_turn with zero usage
|
|
875
|
+
// Bounded so a misbehaving SDK can't hang the next prompt indefinitely.
|
|
876
|
+
try {
|
|
877
|
+
await session.query.interrupt();
|
|
878
|
+
const MAX_DRAIN = 100;
|
|
879
|
+
for (let i = 0; i < MAX_DRAIN; i++) {
|
|
880
|
+
const { value: m, done } = await session.query.next();
|
|
881
|
+
if (done || !m)
|
|
882
|
+
break;
|
|
883
|
+
if (m.type === "system" && m.subtype === "session_state_changed" && m.state === "idle") {
|
|
884
|
+
break;
|
|
885
|
+
}
|
|
886
|
+
if (i === MAX_DRAIN - 1) {
|
|
887
|
+
this.logger.error(`Session ${params.sessionId}: drained ${MAX_DRAIN} messages after error without observing idle`);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
catch (drainErr) {
|
|
892
|
+
this.logger.error(`Session ${params.sessionId}: failed to drain query after prompt error:`, drainErr);
|
|
893
|
+
}
|
|
830
894
|
if (error instanceof RequestError || !(error instanceof Error)) {
|
|
831
895
|
throw error;
|
|
832
896
|
}
|
|
@@ -847,10 +911,20 @@ export class ClaudeAcpAgent {
|
|
|
847
911
|
finally {
|
|
848
912
|
if (!handedOff) {
|
|
849
913
|
session.promptRunning = false;
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
914
|
+
if (errored) {
|
|
915
|
+
// The query stream was just drained — handing pending prompts off
|
|
916
|
+
// onto it would let them race with the recovery. Cancel them so
|
|
917
|
+
// each waiting prompt() returns stopReason: "cancelled" and the
|
|
918
|
+
// client can decide whether to retry.
|
|
919
|
+
for (const pending of session.pendingMessages.values()) {
|
|
920
|
+
pending.resolve(true);
|
|
921
|
+
}
|
|
922
|
+
session.pendingMessages.clear();
|
|
923
|
+
}
|
|
924
|
+
else if (session.pendingMessages.size > 0) {
|
|
925
|
+
// This usually should not happen, but in case the loop finishes
|
|
926
|
+
// without claude sending all message replays, we resolve the
|
|
927
|
+
// next pending prompt call to ensure no prompts get stuck.
|
|
854
928
|
const next = [...session.pendingMessages.entries()].sort((a, b) => a[1].order - b[1].order)[0];
|
|
855
929
|
if (next) {
|
|
856
930
|
next[1].resolve(false);
|
|
@@ -1264,7 +1338,7 @@ export class ClaudeAcpAgent {
|
|
|
1264
1338
|
const newEffort = typeof newEffortOpt?.currentValue === "string" ? newEffortOpt.currentValue : undefined;
|
|
1265
1339
|
if (newEffort !== currentEffort) {
|
|
1266
1340
|
await session.query.applyFlagSettings({
|
|
1267
|
-
effortLevel: newEffort,
|
|
1341
|
+
effortLevel: toSdkEffortLevel(newEffort),
|
|
1268
1342
|
});
|
|
1269
1343
|
}
|
|
1270
1344
|
// Emit current_mode_update only after session.modes AND
|
|
@@ -1287,7 +1361,7 @@ export class ClaudeAcpAgent {
|
|
|
1287
1361
|
session.configOptions = session.configOptions.map((o) => o.id === configId && typeof o.currentValue === "string" ? { ...o, currentValue: value } : o);
|
|
1288
1362
|
if (configId === "effort") {
|
|
1289
1363
|
await session.query.applyFlagSettings({
|
|
1290
|
-
effortLevel: value,
|
|
1364
|
+
effortLevel: toSdkEffortLevel(value),
|
|
1291
1365
|
});
|
|
1292
1366
|
}
|
|
1293
1367
|
}
|
|
@@ -1559,7 +1633,7 @@ export class ClaudeAcpAgent {
|
|
|
1559
1633
|
const allowedModels = Array.isArray(settingsAvailableModels)
|
|
1560
1634
|
? applyAvailableModelsAllowlist(initializationResult.models, settingsAvailableModels)
|
|
1561
1635
|
: initializationResult.models;
|
|
1562
|
-
const models = await getAvailableModels(q, allowedModels, settingsManager, this.logger);
|
|
1636
|
+
const models = await getAvailableModels(q, allowedModels, initializationResult.models, settingsManager, this.logger);
|
|
1563
1637
|
// Gate `auto` (and future model-specific modes) on the resolved model's
|
|
1564
1638
|
// `ModelInfo`. See `buildAvailableModes` for the canonical SDK signal.
|
|
1565
1639
|
const currentModelInfo = allowedModels.find((m) => m.value === models.currentModelId);
|
|
@@ -1598,7 +1672,9 @@ export class ClaudeAcpAgent {
|
|
|
1598
1672
|
const configOptions = buildConfigOptions(modes, models, allowedModels, settingsManager.getSettings().effortLevel);
|
|
1599
1673
|
// Apply the initial effort level to the SDK so it matches the UI default
|
|
1600
1674
|
const initialEffort = configOptions.find((o) => o.id === "effort");
|
|
1601
|
-
if (initialEffort &&
|
|
1675
|
+
if (initialEffort &&
|
|
1676
|
+
typeof initialEffort.currentValue === "string" &&
|
|
1677
|
+
initialEffort.currentValue !== "default") {
|
|
1602
1678
|
await q.applyFlagSettings({
|
|
1603
1679
|
effortLevel: initialEffort.currentValue,
|
|
1604
1680
|
});
|
|
@@ -1714,7 +1790,7 @@ function createEnvForGateway(request) {
|
|
|
1714
1790
|
return {
|
|
1715
1791
|
ANTHROPIC_BASE_URL: request._meta.gateway.baseUrl,
|
|
1716
1792
|
ANTHROPIC_CUSTOM_HEADERS: customHeaders,
|
|
1717
|
-
ANTHROPIC_AUTH_TOKEN: "", // Must be specified to bypass claude login requirement
|
|
1793
|
+
ANTHROPIC_AUTH_TOKEN: " ", // Must be specified to bypass claude login requirement
|
|
1718
1794
|
};
|
|
1719
1795
|
}
|
|
1720
1796
|
/**
|
|
@@ -1759,6 +1835,15 @@ function buildAvailableModes(modelInfo) {
|
|
|
1759
1835
|
}
|
|
1760
1836
|
return modes;
|
|
1761
1837
|
}
|
|
1838
|
+
// Translate a UI effort value into the flag-layer payload. The SDK
|
|
1839
|
+
// shallow-merges `applyFlagSettings`, drops `undefined` during JSON transport,
|
|
1840
|
+
// and only clears a key when an explicit `null` is sent — see
|
|
1841
|
+
// `applyFlagSettings` in @anthropic-ai/claude-agent-sdk. Mapping both the
|
|
1842
|
+
// `"default"` sentinel and `undefined` (effort option absent for the model) to
|
|
1843
|
+
// `null` ensures any previously-applied flag is actually cleared.
|
|
1844
|
+
function toSdkEffortLevel(value) {
|
|
1845
|
+
return value === undefined || value === "default" ? null : value;
|
|
1846
|
+
}
|
|
1762
1847
|
function buildConfigOptions(modes, models, modelInfos, currentEffortLevel) {
|
|
1763
1848
|
const options = [
|
|
1764
1849
|
{
|
|
@@ -1794,23 +1879,18 @@ function buildConfigOptions(modes, models, modelInfos, currentEffortLevel) {
|
|
|
1794
1879
|
? (currentModelInfo.supportedEffortLevels ?? [])
|
|
1795
1880
|
: [];
|
|
1796
1881
|
if (supportedLevels.length > 0) {
|
|
1797
|
-
const effortOptions =
|
|
1798
|
-
value:
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
const
|
|
1808
|
-
|
|
1809
|
-
: includes("xhigh")
|
|
1810
|
-
? "xhigh"
|
|
1811
|
-
: includes("high")
|
|
1812
|
-
? "high"
|
|
1813
|
-
: supportedLevels[0];
|
|
1882
|
+
const effortOptions = [
|
|
1883
|
+
{ value: "default", name: "Default" },
|
|
1884
|
+
...supportedLevels.map((level) => ({
|
|
1885
|
+
value: level,
|
|
1886
|
+
name: level
|
|
1887
|
+
.split(/[_-]/)
|
|
1888
|
+
.map((part) => (part ? part.charAt(0).toUpperCase() + part.slice(1) : part))
|
|
1889
|
+
.join(" "),
|
|
1890
|
+
})),
|
|
1891
|
+
];
|
|
1892
|
+
const includes = (l) => l === "default" || supportedLevels.includes(l);
|
|
1893
|
+
const validEffort = currentEffortLevel && includes(currentEffortLevel) ? currentEffortLevel : "default";
|
|
1814
1894
|
options.push({
|
|
1815
1895
|
id: "effort",
|
|
1816
1896
|
name: "Effort",
|
|
@@ -1826,6 +1906,25 @@ function buildConfigOptions(modes, models, modelInfos, currentEffortLevel) {
|
|
|
1826
1906
|
// Claude Code CLI persists display strings like "opus[1m]" in settings,
|
|
1827
1907
|
// but the SDK model list uses IDs like "claude-opus-4-6-1m".
|
|
1828
1908
|
const MODEL_CONTEXT_HINT_PATTERN = /\[(\d+m)\]$/i;
|
|
1909
|
+
// Captures a model family version such as `4-6` or `4.7` so we can keep
|
|
1910
|
+
// `claude-opus-4-6` from being copied onto the SDK's `opus` alias when that
|
|
1911
|
+
// alias currently resolves to a different family version (e.g. Opus 4.7).
|
|
1912
|
+
const MODEL_FAMILY_VERSION_PATTERN = /\b(\d+)[-.](\d+)\b/;
|
|
1913
|
+
function extractModelFamilyVersion(s) {
|
|
1914
|
+
const match = s.match(MODEL_FAMILY_VERSION_PATTERN);
|
|
1915
|
+
return match ? `${match[1]}.${match[2]}` : null;
|
|
1916
|
+
}
|
|
1917
|
+
function modelVersionsCompatible(preference, candidate) {
|
|
1918
|
+
const preferred = extractModelFamilyVersion(preference);
|
|
1919
|
+
if (!preferred)
|
|
1920
|
+
return true;
|
|
1921
|
+
const candidateVersion = extractModelFamilyVersion(candidate.value) ??
|
|
1922
|
+
extractModelFamilyVersion(candidate.displayName) ??
|
|
1923
|
+
extractModelFamilyVersion(candidate.description);
|
|
1924
|
+
if (!candidateVersion)
|
|
1925
|
+
return true;
|
|
1926
|
+
return preferred === candidateVersion;
|
|
1927
|
+
}
|
|
1829
1928
|
function tokenizeModelPreference(model) {
|
|
1830
1929
|
const lower = model.trim().toLowerCase();
|
|
1831
1930
|
const contextHint = lower.match(MODEL_CONTEXT_HINT_PATTERN)?.[1]?.toLowerCase();
|
|
@@ -1866,6 +1965,8 @@ function resolveModelPreference(models, preference) {
|
|
|
1866
1965
|
return directMatch;
|
|
1867
1966
|
// Substring match
|
|
1868
1967
|
const includesMatch = models.find((model) => {
|
|
1968
|
+
if (!modelVersionsCompatible(trimmed, model))
|
|
1969
|
+
return false;
|
|
1869
1970
|
const value = model.value.toLowerCase();
|
|
1870
1971
|
const display = model.displayName.toLowerCase();
|
|
1871
1972
|
return value.includes(lower) || display.includes(lower) || lower.includes(value);
|
|
@@ -1879,6 +1980,8 @@ function resolveModelPreference(models, preference) {
|
|
|
1879
1980
|
let bestMatch = null;
|
|
1880
1981
|
let bestScore = 0;
|
|
1881
1982
|
for (const model of models) {
|
|
1983
|
+
if (!modelVersionsCompatible(trimmed, model))
|
|
1984
|
+
continue;
|
|
1882
1985
|
const score = scoreModelMatch(model, tokens, contextHint);
|
|
1883
1986
|
if (0 < score && (!bestMatch || bestScore < score)) {
|
|
1884
1987
|
bestMatch = model;
|
|
@@ -1941,9 +2044,10 @@ function applyAvailableModelsAllowlist(sdkModels, allowlist) {
|
|
|
1941
2044
|
}
|
|
1942
2045
|
return result;
|
|
1943
2046
|
}
|
|
1944
|
-
async function getAvailableModels(query, models, settingsManager, logger) {
|
|
2047
|
+
async function getAvailableModels(query, models, sdkModels, settingsManager, logger) {
|
|
1945
2048
|
const settings = settingsManager.getSettings();
|
|
1946
2049
|
let currentModel = models[0];
|
|
2050
|
+
let resolvedFromInput;
|
|
1947
2051
|
// Model priority (highest to lowest):
|
|
1948
2052
|
// 1. ANTHROPIC_MODEL environment variable
|
|
1949
2053
|
// 2. settings.model (user configuration)
|
|
@@ -1952,15 +2056,32 @@ async function getAvailableModels(query, models, settingsManager, logger) {
|
|
|
1952
2056
|
const match = resolveModelPreference(models, process.env.ANTHROPIC_MODEL);
|
|
1953
2057
|
if (match) {
|
|
1954
2058
|
currentModel = match;
|
|
2059
|
+
resolvedFromInput = process.env.ANTHROPIC_MODEL;
|
|
1955
2060
|
}
|
|
1956
2061
|
}
|
|
1957
|
-
else {
|
|
2062
|
+
else if (typeof settings.model === "string") {
|
|
1958
2063
|
const match = resolveSettingsModel(models, settings.model, logger);
|
|
1959
2064
|
if (match) {
|
|
1960
2065
|
currentModel = match;
|
|
1961
|
-
|
|
2066
|
+
resolvedFromInput = settings.model;
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
// Skip the setModel round-trip when we can prove the SDK has already landed
|
|
2070
|
+
// on the same model. Two cases qualify:
|
|
2071
|
+
// (a) No override applied — currentModel stayed at models[0]; the SDK is on
|
|
2072
|
+
// its own default and we have nothing to sync.
|
|
2073
|
+
// (b) The resolver returned the user's input verbatim AND that value exists
|
|
2074
|
+
// in the SDK's original model list — meaning no fuzzy match or
|
|
2075
|
+
// allowlist rewrite was involved, and the SDK (which reads the same
|
|
2076
|
+
// ANTHROPIC_MODEL / settings.json) will have arrived at the same entry.
|
|
2077
|
+
// Anything else (fuzzy match, allowlist-synthesized value, alias) gets a
|
|
2078
|
+
// setModel call so we don't drift from the user's intended pin.
|
|
2079
|
+
const sdkSawSameValue = sdkModels.some((m) => m.value === currentModel.value);
|
|
2080
|
+
const skipSetModel = resolvedFromInput === undefined ||
|
|
2081
|
+
(currentModel.value === resolvedFromInput && sdkSawSameValue);
|
|
2082
|
+
if (!skipSetModel) {
|
|
2083
|
+
await query.setModel(currentModel.value);
|
|
1962
2084
|
}
|
|
1963
|
-
await query.setModel(currentModel.value);
|
|
1964
2085
|
return {
|
|
1965
2086
|
availableModels: models.map((model) => ({
|
|
1966
2087
|
modelId: model.value,
|
|
@@ -1972,6 +2093,7 @@ async function getAvailableModels(query, models, settingsManager, logger) {
|
|
|
1972
2093
|
}
|
|
1973
2094
|
function getAvailableSlashCommands(commands) {
|
|
1974
2095
|
const UNSUPPORTED_COMMANDS = [
|
|
2096
|
+
"clear",
|
|
1975
2097
|
"cost",
|
|
1976
2098
|
"keybindings-help",
|
|
1977
2099
|
"login",
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.37.0",
|
|
7
7
|
"description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
|
|
8
8
|
"main": "dist/lib.js",
|
|
9
9
|
"types": "dist/lib.d.ts",
|
|
@@ -60,22 +60,22 @@
|
|
|
60
60
|
"author": "Zed Industries",
|
|
61
61
|
"license": "Apache-2.0",
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@agentclientprotocol/sdk": "0.22.
|
|
64
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
63
|
+
"@agentclientprotocol/sdk": "0.22.1",
|
|
64
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.146",
|
|
65
65
|
"zod": "^3.25.0 || ^4.0.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@anthropic-ai/sdk": "0.
|
|
68
|
+
"@anthropic-ai/sdk": "0.97.1",
|
|
69
69
|
"@eslint/js": "10.0.1",
|
|
70
|
-
"@types/node": "25.
|
|
71
|
-
"@typescript-eslint/eslint-plugin": "8.59.
|
|
72
|
-
"@typescript-eslint/parser": "8.59.
|
|
70
|
+
"@types/node": "25.9.1",
|
|
71
|
+
"@typescript-eslint/eslint-plugin": "8.59.4",
|
|
72
|
+
"@typescript-eslint/parser": "8.59.4",
|
|
73
73
|
"eslint": "10.4.0",
|
|
74
74
|
"eslint-config-prettier": "10.1.8",
|
|
75
75
|
"globals": "17.6.0",
|
|
76
76
|
"prettier": "3.8.3",
|
|
77
77
|
"ts-node": "10.9.2",
|
|
78
78
|
"typescript": "6.0.3",
|
|
79
|
-
"vitest": "4.1.
|
|
79
|
+
"vitest": "4.1.7"
|
|
80
80
|
}
|
|
81
81
|
}
|