@projectservan8n/cnapse 0.7.0 → 0.8.0
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/ProviderSelector-MXRZFAOB.js +6 -0
- package/dist/chunk-OPX7FFL6.js +391 -0
- package/dist/index.js +733 -702
- package/package.json +17 -16
- package/src/agents/executor.ts +20 -13
- package/src/index.tsx +32 -6
- package/src/lib/tasks.ts +307 -323
- package/src/services/browser.ts +669 -0
- package/src/tools/index.ts +0 -1
- package/dist/ConfigUI-I2CJVODT.js +0 -305
- package/dist/Setup-KGYXCA7Y.js +0 -177
- package/dist/chunk-COKO6V5J.js +0 -50
- package/src/components/ConfigUI.tsx +0 -352
- package/src/components/Setup.tsx +0 -202
- package/src/lib/screen.ts +0 -118
- package/src/tools/vision.ts +0 -65
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@projectservan8n/cnapse",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Autonomous PC intelligence - AI assistant for desktop automation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,30 +29,31 @@
|
|
|
29
29
|
"homepage": "https://c-napse.up.railway.app",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"
|
|
33
|
-
"react": "^18.3.1",
|
|
34
|
-
"ink-text-input": "^6.0.0",
|
|
35
|
-
"ink-spinner": "^5.0.0",
|
|
32
|
+
"boxen": "^8.0.1",
|
|
36
33
|
"chalk": "^5.3.0",
|
|
37
|
-
"conf": "^13.0.1",
|
|
38
|
-
"ora": "^8.0.1",
|
|
39
|
-
"marked": "^14.1.0",
|
|
40
|
-
"marked-terminal": "^7.1.0",
|
|
41
34
|
"clipboardy": "^4.0.0",
|
|
35
|
+
"conf": "^13.0.1",
|
|
42
36
|
"execa": "^9.3.0",
|
|
43
|
-
"globby": "^14.0.2",
|
|
44
|
-
"node-fetch": "^3.3.2",
|
|
45
37
|
"figlet": "^1.7.0",
|
|
38
|
+
"globby": "^14.0.2",
|
|
46
39
|
"gradient-string": "^2.0.2",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
40
|
+
"ink": "^5.0.1",
|
|
41
|
+
"ink-spinner": "^5.0.0",
|
|
42
|
+
"ink-text-input": "^6.0.0",
|
|
43
|
+
"marked": "^14.1.0",
|
|
44
|
+
"marked-terminal": "^7.1.0",
|
|
45
|
+
"node-fetch": "^3.3.2",
|
|
46
|
+
"ora": "^8.0.1",
|
|
47
|
+
"playwright": "^1.58.1",
|
|
48
|
+
"react": "^18.3.1",
|
|
49
|
+
"screenshot-desktop": "^1.15.0",
|
|
50
|
+
"telegraf": "^4.16.3"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
|
-
"@types/node": "^22.0.0",
|
|
53
|
-
"@types/react": "^18.3.3",
|
|
54
53
|
"@types/figlet": "^1.5.8",
|
|
55
54
|
"@types/gradient-string": "^1.1.6",
|
|
55
|
+
"@types/node": "^22.0.0",
|
|
56
|
+
"@types/react": "^18.3.3",
|
|
56
57
|
"tsup": "^8.2.4",
|
|
57
58
|
"tsx": "^4.16.5",
|
|
58
59
|
"typescript": "^5.5.4"
|
package/src/agents/executor.ts
CHANGED
|
@@ -12,7 +12,7 @@ import * as clipboard from '../tools/clipboard.js';
|
|
|
12
12
|
import * as network from '../tools/network.js';
|
|
13
13
|
import * as processTools from '../tools/process.js';
|
|
14
14
|
import * as computer from '../tools/computer.js';
|
|
15
|
-
import
|
|
15
|
+
import { describeScreen, captureScreenshot } from '../lib/vision.js';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Execute a tool call and return the result
|
|
@@ -136,19 +136,26 @@ export async function executeTool(call: ToolCall): Promise<ToolResult> {
|
|
|
136
136
|
|
|
137
137
|
// Vision tools
|
|
138
138
|
case 'takeScreenshot':
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
139
|
+
try {
|
|
140
|
+
const screenshot = await captureScreenshot();
|
|
141
|
+
return {
|
|
142
|
+
success: !!screenshot,
|
|
143
|
+
output: screenshot || '',
|
|
144
|
+
error: screenshot ? undefined : 'Failed to capture screenshot',
|
|
145
|
+
};
|
|
146
|
+
} catch (e) {
|
|
147
|
+
return { success: false, output: '', error: e instanceof Error ? e.message : 'Screenshot failed' };
|
|
148
|
+
}
|
|
145
149
|
case 'describeCurrentScreen':
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
try {
|
|
151
|
+
const visionResult = await describeScreen();
|
|
152
|
+
return {
|
|
153
|
+
success: true,
|
|
154
|
+
output: visionResult.description,
|
|
155
|
+
};
|
|
156
|
+
} catch (e) {
|
|
157
|
+
return { success: false, output: '', error: e instanceof Error ? e.message : 'Vision failed' };
|
|
158
|
+
}
|
|
152
159
|
|
|
153
160
|
default:
|
|
154
161
|
return { success: false, output: '', error: `Unknown tool: ${name}` };
|
package/src/index.tsx
CHANGED
|
@@ -41,8 +41,19 @@ async function main() {
|
|
|
41
41
|
|
|
42
42
|
// Interactive config TUI if no subcommand
|
|
43
43
|
if (!subcommand) {
|
|
44
|
-
const {
|
|
45
|
-
|
|
44
|
+
const { ProviderSelector } = await import('./components/ProviderSelector.js');
|
|
45
|
+
const { Box } = await import('ink');
|
|
46
|
+
render(
|
|
47
|
+
<Box flexDirection="column" padding={1}>
|
|
48
|
+
<ProviderSelector
|
|
49
|
+
onClose={() => process.exit(0)}
|
|
50
|
+
onSelect={(provider, model) => {
|
|
51
|
+
console.log(`\n✓ Set to ${provider} / ${model}`);
|
|
52
|
+
process.exit(0);
|
|
53
|
+
}}
|
|
54
|
+
/>
|
|
55
|
+
</Box>
|
|
56
|
+
);
|
|
46
57
|
return; // Don't render App
|
|
47
58
|
}
|
|
48
59
|
|
|
@@ -148,14 +159,29 @@ ${dim}GitHub: https://github.com/projectservan8n/C-napse${reset}
|
|
|
148
159
|
case 'version':
|
|
149
160
|
case '--version':
|
|
150
161
|
case '-v': {
|
|
151
|
-
console.log('cnapse v0.
|
|
162
|
+
console.log('cnapse v0.8.0');
|
|
152
163
|
process.exit(0);
|
|
153
164
|
}
|
|
154
165
|
|
|
155
166
|
case 'init': {
|
|
156
|
-
// Interactive setup with Ink UI
|
|
157
|
-
const {
|
|
158
|
-
|
|
167
|
+
// Interactive setup with Ink UI - uses ProviderSelector
|
|
168
|
+
const { ProviderSelector } = await import('./components/ProviderSelector.js');
|
|
169
|
+
const { Box, Text } = await import('ink');
|
|
170
|
+
render(
|
|
171
|
+
<Box flexDirection="column" padding={1}>
|
|
172
|
+
<Box marginBottom={1}>
|
|
173
|
+
<Text bold color="cyan">C-napse Setup</Text>
|
|
174
|
+
</Box>
|
|
175
|
+
<ProviderSelector
|
|
176
|
+
onClose={() => process.exit(0)}
|
|
177
|
+
onSelect={(provider, model) => {
|
|
178
|
+
console.log(`\n✓ Setup complete! Provider: ${provider}, Model: ${model}`);
|
|
179
|
+
console.log('Run `cnapse` to start chatting.');
|
|
180
|
+
process.exit(0);
|
|
181
|
+
}}
|
|
182
|
+
/>
|
|
183
|
+
</Box>
|
|
184
|
+
);
|
|
159
185
|
return; // Don't render App
|
|
160
186
|
}
|
|
161
187
|
|