@compilr-dev/agents 0.1.0 → 0.2.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/dist/agent.d.ts +168 -1
- package/dist/agent.js +268 -14
- package/dist/context/file-tracker.d.ts +156 -0
- package/dist/context/file-tracker.js +358 -0
- package/dist/context/file-tracking-hook.d.ts +29 -0
- package/dist/context/file-tracking-hook.js +103 -0
- package/dist/context/index.d.ts +5 -1
- package/dist/context/index.js +3 -0
- package/dist/context/manager.d.ts +69 -1
- package/dist/context/manager.js +304 -0
- package/dist/context/types.d.ts +95 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +7 -3
- package/dist/messages/index.d.ts +13 -0
- package/dist/messages/index.js +51 -0
- package/dist/permissions/manager.js +6 -1
- package/dist/providers/gemini.js +1 -3
- package/dist/providers/mock.js +8 -0
- package/dist/providers/openai-compatible.js +1 -3
- package/dist/skills/index.js +691 -0
- package/dist/tools/builtin/index.d.ts +6 -1
- package/dist/tools/builtin/index.js +7 -0
- package/dist/tools/builtin/suggest.d.ts +57 -0
- package/dist/tools/builtin/suggest.js +99 -0
- package/dist/tools/builtin/task.js +13 -8
- package/dist/tools/builtin/tool-names.d.ts +44 -0
- package/dist/tools/builtin/tool-names.js +51 -0
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +5 -1
- package/dist/tools/registry.d.ts +4 -0
- package/dist/tools/registry.js +9 -0
- package/package.json +4 -4
package/dist/providers/gemini.js
CHANGED
|
@@ -34,9 +34,7 @@ export class GeminiProvider extends OpenAICompatibleProvider {
|
|
|
34
34
|
name = 'gemini';
|
|
35
35
|
apiKey;
|
|
36
36
|
constructor(config = {}) {
|
|
37
|
-
const apiKey = config.apiKey ??
|
|
38
|
-
process.env.GOOGLE_AI_API_KEY ??
|
|
39
|
-
process.env.GEMINI_API_KEY;
|
|
37
|
+
const apiKey = config.apiKey ?? process.env.GOOGLE_AI_API_KEY ?? process.env.GEMINI_API_KEY;
|
|
40
38
|
if (!apiKey) {
|
|
41
39
|
throw new ProviderError('Gemini API key not found. Set GOOGLE_AI_API_KEY or GEMINI_API_KEY environment variable, or pass apiKey in config.', 'gemini');
|
|
42
40
|
}
|
package/dist/providers/mock.js
CHANGED
|
@@ -185,6 +185,14 @@ export class MockProvider {
|
|
|
185
185
|
if (block.type === 'text') {
|
|
186
186
|
charCount += block.text.length;
|
|
187
187
|
}
|
|
188
|
+
else if (block.type === 'tool_result') {
|
|
189
|
+
// Count tool result content (always a string per our type definition)
|
|
190
|
+
charCount += block.content.length;
|
|
191
|
+
}
|
|
192
|
+
else if (block.type === 'tool_use') {
|
|
193
|
+
// Count tool use input
|
|
194
|
+
charCount += JSON.stringify(block.input).length;
|
|
195
|
+
}
|
|
188
196
|
}
|
|
189
197
|
}
|
|
190
198
|
}
|
|
@@ -198,9 +198,7 @@ export class OpenAICompatibleProvider {
|
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
else if (block.type === 'tool_result') {
|
|
201
|
-
const content = typeof block.content === 'string'
|
|
202
|
-
? block.content
|
|
203
|
-
: JSON.stringify(block.content);
|
|
201
|
+
const content = typeof block.content === 'string' ? block.content : JSON.stringify(block.content);
|
|
204
202
|
toolResults.push({
|
|
205
203
|
id: block.toolUseId,
|
|
206
204
|
content,
|