@ycodium-ai/agent-claude 0.2.2908 → 0.2.2920
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/index.js +8 -10
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -24705,6 +24705,7 @@ function toClaudeMcpServers(entries) {
|
|
|
24705
24705
|
}
|
|
24706
24706
|
function createClaudeAdapter(recipe, host, options) {
|
|
24707
24707
|
const boundInstanceId = options?.instanceId ?? host.instanceId ?? "claudeAgent";
|
|
24708
|
+
const now = options?.now ?? (() => Date.now());
|
|
24708
24709
|
const claudeHomeEnvironment = makeClaudeEnvironment(recipe, options?.environment);
|
|
24709
24710
|
const claudeSdkExecutablePath = resolveClaudeSdkExecutablePath(
|
|
24710
24711
|
recipe.binaryPath,
|
|
@@ -24728,9 +24729,9 @@ function createClaudeAdapter(recipe, host, options) {
|
|
|
24728
24729
|
let modelCatalogFailedAt;
|
|
24729
24730
|
const currentModelCatalog = () => modelCatalog?.models ?? [];
|
|
24730
24731
|
const refreshModelCatalog = (input) => {
|
|
24731
|
-
const fresh = modelCatalog !== void 0 &&
|
|
24732
|
+
const fresh = modelCatalog !== void 0 && now() - modelCatalog.readAt < CLAUDE_SDK_MODELS_TTL_MS;
|
|
24732
24733
|
if (fresh && input?.force !== true) return Promise.resolve();
|
|
24733
|
-
if (input?.force !== true && modelCatalogFailedAt !== void 0 &&
|
|
24734
|
+
if (input?.force !== true && modelCatalogFailedAt !== void 0 && now() - modelCatalogFailedAt < CLAUDE_SDK_MODELS_RETRY_MS) {
|
|
24734
24735
|
return Promise.resolve();
|
|
24735
24736
|
}
|
|
24736
24737
|
if (modelCatalogRead !== void 0) return modelCatalogRead;
|
|
@@ -24748,10 +24749,10 @@ function createClaudeAdapter(recipe, host, options) {
|
|
|
24748
24749
|
}
|
|
24749
24750
|
});
|
|
24750
24751
|
if (models === void 0) {
|
|
24751
|
-
modelCatalogFailedAt =
|
|
24752
|
+
modelCatalogFailedAt = now();
|
|
24752
24753
|
} else {
|
|
24753
24754
|
modelCatalogFailedAt = void 0;
|
|
24754
|
-
modelCatalog = { models: claudeCatalogFromSdk(models), readAt:
|
|
24755
|
+
modelCatalog = { models: claudeCatalogFromSdk(models), readAt: now() };
|
|
24755
24756
|
}
|
|
24756
24757
|
})().finally(() => {
|
|
24757
24758
|
modelCatalogRead = void 0;
|
|
@@ -24762,8 +24763,8 @@ function createClaudeAdapter(recipe, host, options) {
|
|
|
24762
24763
|
const declaredModels = [CLAUDE_CARD.defaultModel];
|
|
24763
24764
|
const sessions = /* @__PURE__ */ new Map();
|
|
24764
24765
|
const runtimeEventQueue = new EventBus();
|
|
24765
|
-
const nowIso = () =>
|
|
24766
|
-
const randomUUIDv4 = () => crypto.randomUUID();
|
|
24766
|
+
const nowIso = () => new Date(now()).toISOString();
|
|
24767
|
+
const randomUUIDv4 = options?.randomId ?? (() => crypto.randomUUID());
|
|
24767
24768
|
const makeEventStamp = async () => ({ eventId: randomUUIDv4(), createdAt: nowIso() });
|
|
24768
24769
|
const offerRuntimeEvent = (context, event) => {
|
|
24769
24770
|
runtimeEventQueue.push({
|
|
@@ -24967,9 +24968,6 @@ function createClaudeAdapter(recipe, host, options) {
|
|
|
24967
24968
|
}
|
|
24968
24969
|
};
|
|
24969
24970
|
const emitRuntimeError = async (context, message, cause) => {
|
|
24970
|
-
if (cause !== void 0) {
|
|
24971
|
-
void cause;
|
|
24972
|
-
}
|
|
24973
24971
|
const turnState = context.turnState;
|
|
24974
24972
|
const stamp = await makeEventStamp();
|
|
24975
24973
|
offerRuntimeEvent(context, {
|
|
@@ -25786,7 +25784,7 @@ function createClaudeAdapter(recipe, host, options) {
|
|
|
25786
25784
|
usageLimit: {
|
|
25787
25785
|
rejected: context.turnState.rejectedRateLimits,
|
|
25788
25786
|
latestAssistantRateLimited: context.turnState.latestAssistantRateLimited,
|
|
25789
|
-
nowMs:
|
|
25787
|
+
nowMs: now()
|
|
25790
25788
|
}
|
|
25791
25789
|
}
|
|
25792
25790
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/agent-claude",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2920",
|
|
4
4
|
"description": "Claude executor: Claude Code CLI via @anthropic-ai/claude-agent-sdk.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"@types/node": "24.12.4",
|
|
25
25
|
"esbuild": "0.28.1",
|
|
26
26
|
"vite-plus": "0.2.2",
|
|
27
|
-
"@ycodium-ai/plugin-api": "0.2.2908",
|
|
28
27
|
"ycodium-composer-tokens": "0.0.0",
|
|
28
|
+
"@ycodium-ai/plugin-api": "0.2.2920",
|
|
29
29
|
"ycodium-executor-testing": "0.0.0",
|
|
30
30
|
"ycodium-jsonl-stream": "0.0.0"
|
|
31
31
|
},
|