@orbit-build/cli 0.1.0 → 0.1.2

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/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "outDir": "./dist",
5
- "rootDir": "./src"
6
- },
7
- "include": ["src/**/*"]
8
- }
@@ -1,91 +0,0 @@
1
- import { ConfigLoader } from '@orbit-build/config';
2
- import { AgentLoop } from '@orbit-build/core';
3
- import { join } from 'path';
4
-
5
- class MockProvider {
6
- id = 'mock-provider';
7
- type = 'openai-compatible';
8
- capabilities = {
9
- streaming: true,
10
- toolCalls: true,
11
- jsonMode: true,
12
- thinking: false,
13
- vision: false,
14
- promptCaching: false,
15
- };
16
-
17
- constructor() {
18
- this.step = 0;
19
- }
20
-
21
- async *chat(input) {
22
- this.step++;
23
- if (this.step === 1) {
24
- yield {
25
- type: 'tool_call',
26
- toolCall: {
27
- id: 'call_1',
28
- name: 'read_file',
29
- arguments: JSON.stringify({ path: 'math.js' }),
30
- },
31
- };
32
- } else if (this.step === 2) {
33
- yield {
34
- type: 'tool_call',
35
- toolCall: {
36
- id: 'call_2',
37
- name: 'edit_file',
38
- arguments: JSON.stringify({
39
- path: 'math.js',
40
- oldText: 'return a - b;',
41
- newText: 'return a + b;',
42
- }),
43
- },
44
- };
45
- } else if (this.step === 3) {
46
- yield {
47
- type: 'tool_call',
48
- toolCall: {
49
- id: 'call_3',
50
- name: 'run_tests',
51
- arguments: '{}',
52
- },
53
- };
54
- } else {
55
- yield {
56
- type: 'text_delta',
57
- text: 'I have successfully located and fixed the bug in math.js! The test suite is now passing.',
58
- };
59
- yield { type: 'done' };
60
- }
61
- }
62
- }
63
-
64
- async function verify() {
65
- // Path points to mock-project
66
- const cwd = join(process.cwd(), '..', '..', 'mock-project');
67
- const config = ConfigLoader.loadSync(cwd);
68
-
69
- config.permissions.mode = 'auto';
70
-
71
- const interaction = {
72
- async askApproval(reason, preview) {
73
- console.log(`[Interaction] Auto-approving action for verification: ${reason}`);
74
- return true;
75
- },
76
- showText(text) {
77
- console.log(text);
78
- },
79
- showDiff(filePath, before, after) {
80
- console.log(`[Interaction] File Modified Diff (${filePath}):`);
81
- console.log(`- Before: ${before?.trim()}`);
82
- console.log(`+ After: ${after?.trim()}`);
83
- },
84
- };
85
-
86
- const provider = new MockProvider();
87
- const loop = new AgentLoop(cwd, config, provider, 'fix the math tests', interaction);
88
- await loop.run();
89
- }
90
-
91
- verify().catch(console.error);