@game_ryo/lsji 1.2.1 → 1.2.3
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 +1 -1
- package/src/execution/budget/index.js +16 -0
- package/src/index.js +1 -1
- package/src/server/index.js +8 -5
- package/src/server/ui/dist/assets/{main-v74qobjz.js → main-cTHaY04L.js} +8 -8
- package/src/server/ui/dist/index.html +1 -1
- package/src/server/ui/src/App.jsx +11 -1
- package/src/server/ui/src/components/NewRunModal.jsx +70 -35
package/package.json
CHANGED
|
@@ -53,6 +53,22 @@ export function createBudgetController(config = {}) {
|
|
|
53
53
|
};
|
|
54
54
|
},
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Record cost/usage after operation (alias for recordUsage)
|
|
58
|
+
* Supports both recordCost(budgetId, usage) and recordCost({ budgetId, ...usage })
|
|
59
|
+
*/
|
|
60
|
+
recordCost(budgetId, usage) {
|
|
61
|
+
// Handle both calling conventions:
|
|
62
|
+
// 1. recordCost(budgetId, usageObj)
|
|
63
|
+
// 2. recordCost({ budgetId, ...usageObj })
|
|
64
|
+
if (usage === undefined && budgetId && typeof budgetId === 'object') {
|
|
65
|
+
// Called as recordCost({ budgetId, ...usage })
|
|
66
|
+
const obj = budgetId;
|
|
67
|
+
return this.recordUsage(obj.budgetId, obj);
|
|
68
|
+
}
|
|
69
|
+
return this.recordUsage(budgetId, usage);
|
|
70
|
+
},
|
|
71
|
+
|
|
56
72
|
/**
|
|
57
73
|
* Reset run budget
|
|
58
74
|
*/
|
package/src/index.js
CHANGED
package/src/server/index.js
CHANGED
|
@@ -138,13 +138,16 @@ export function createApp(config = {}) {
|
|
|
138
138
|
toolRegistry.register({ ...tool, category: 'plugin' });
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
// Create LLM agent
|
|
141
|
+
// Create LLM agent with API key from request
|
|
142
|
+
const finalApiKey = llm.apiKey || process.env[llm.provider === 'gemini' ? 'GEMINI_API_KEY' : llm.provider === 'openai' ? 'OPENAI_API_KEY' : llm.provider === 'anthropic' ? 'ANTHROPIC_API_KEY' : ''];
|
|
143
|
+
const storageConfig = { type: config.storage?.type || 'sqlite', options: config.storage?.options || {} };
|
|
142
144
|
const agent = await createLLMAgent({
|
|
143
|
-
llm,
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
llm: { ...llm, apiKey: finalApiKey },
|
|
146
|
+
storage: storageConfig,
|
|
147
|
+
execution: { storage: storageConfig },
|
|
148
|
+
hitl: { enabled: hitl.enabled !== false, defaultTimeout: 300000, store: storageConfig },
|
|
146
149
|
budget,
|
|
147
|
-
memory: { conversation: true, episodic: true },
|
|
150
|
+
memory: { conversation: true, episodic: true, semantic: true },
|
|
148
151
|
tools: { custom: toolRegistry },
|
|
149
152
|
});
|
|
150
153
|
|