keystone-cli 0.7.0 → 0.7.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/package.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { afterAll, beforeAll, describe, expect, it, mock, spyOn } from 'bun:test';
|
|
2
|
+
import { existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
2
4
|
import type { ExpressionContext } from '../expression/evaluator';
|
|
3
5
|
import type { LlmStep, Step } from '../parser/schema';
|
|
4
6
|
import { ConsoleLogger } from '../utils/logger';
|
|
@@ -10,10 +12,30 @@ describe('Standard Tools Integration', () => {
|
|
|
10
12
|
|
|
11
13
|
beforeAll(() => {
|
|
12
14
|
// Mocking OpenAI Adapter
|
|
15
|
+
// Ensure .keystone/workflows/agents exists
|
|
16
|
+
const agentsDir = join(process.cwd(), '.keystone', 'workflows', 'agents');
|
|
17
|
+
if (!existsSync(agentsDir)) {
|
|
18
|
+
mkdirSync(agentsDir, { recursive: true });
|
|
19
|
+
}
|
|
20
|
+
// Create test-agent.md
|
|
21
|
+
writeFileSync(
|
|
22
|
+
join(agentsDir, 'test-agent.md'),
|
|
23
|
+
`---
|
|
24
|
+
name: test-agent
|
|
25
|
+
model: gpt-4o
|
|
26
|
+
---
|
|
27
|
+
System prompt`,
|
|
28
|
+
'utf8'
|
|
29
|
+
);
|
|
13
30
|
});
|
|
14
31
|
|
|
15
32
|
afterAll(() => {
|
|
16
33
|
OpenAIAdapter.prototype.chat = originalOpenAIChat;
|
|
34
|
+
// Cleanup test-agent.md
|
|
35
|
+
const agentPath = join(process.cwd(), '.keystone', 'workflows', 'agents', 'test-agent.md');
|
|
36
|
+
if (existsSync(agentPath)) {
|
|
37
|
+
rmSync(agentPath);
|
|
38
|
+
}
|
|
17
39
|
});
|
|
18
40
|
|
|
19
41
|
it('should inject standard tools when useStandardTools is true', async () => {
|