zyndo 0.1.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/agentLoop.d.ts +14 -0
- package/dist/agentLoop.js +76 -0
- package/dist/banner.d.ts +1 -0
- package/dist/banner.js +25 -0
- package/dist/config.d.ts +41 -0
- package/dist/config.js +109 -0
- package/dist/connection.d.ts +58 -0
- package/dist/connection.js +114 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +68 -0
- package/dist/init.d.ts +1 -0
- package/dist/init.js +178 -0
- package/dist/mcp/mcpCore.d.ts +22 -0
- package/dist/mcp/mcpCore.js +448 -0
- package/dist/mcp/mcpServer.d.ts +1 -0
- package/dist/mcp/mcpServer.js +61 -0
- package/dist/providers/anthropic.d.ts +2 -0
- package/dist/providers/anthropic.js +52 -0
- package/dist/providers/claudeCode.d.ts +5 -0
- package/dist/providers/claudeCode.js +174 -0
- package/dist/providers/ollama.d.ts +2 -0
- package/dist/providers/ollama.js +90 -0
- package/dist/providers/openai.d.ts +2 -0
- package/dist/providers/openai.js +103 -0
- package/dist/providers/types.d.ts +33 -0
- package/dist/providers/types.js +4 -0
- package/dist/sellerDaemon.d.ts +9 -0
- package/dist/sellerDaemon.js +336 -0
- package/dist/state.d.ts +21 -0
- package/dist/state.js +63 -0
- package/dist/tools/askBuyer.d.ts +2 -0
- package/dist/tools/askBuyer.js +19 -0
- package/dist/tools/bash.d.ts +2 -0
- package/dist/tools/bash.js +35 -0
- package/dist/tools/glob.d.ts +2 -0
- package/dist/tools/glob.js +28 -0
- package/dist/tools/grep.d.ts +2 -0
- package/dist/tools/grep.js +36 -0
- package/dist/tools/pathSafety.d.ts +1 -0
- package/dist/tools/pathSafety.js +9 -0
- package/dist/tools/readFile.d.ts +2 -0
- package/dist/tools/readFile.js +35 -0
- package/dist/tools/types.d.ts +9 -0
- package/dist/tools/types.js +4 -0
- package/dist/tools/writeFile.d.ts +2 -0
- package/dist/tools/writeFile.js +28 -0
- package/package.json +36 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { writeFileSync, mkdirSync } from 'node:fs';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
import { resolveSafe } from './pathSafety.js';
|
|
4
|
+
export function createWriteFileTool(workingDirectory) {
|
|
5
|
+
return {
|
|
6
|
+
name: 'write_file',
|
|
7
|
+
description: 'Write content to a file. Creates directories as needed.',
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: 'object',
|
|
10
|
+
properties: {
|
|
11
|
+
path: { type: 'string', description: 'Path to the file (relative to working directory)' },
|
|
12
|
+
content: { type: 'string', description: 'Content to write to the file' }
|
|
13
|
+
},
|
|
14
|
+
required: ['path', 'content']
|
|
15
|
+
},
|
|
16
|
+
async execute(input) {
|
|
17
|
+
try {
|
|
18
|
+
const filePath = resolveSafe(workingDirectory, input.path);
|
|
19
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
20
|
+
writeFileSync(filePath, input.content, 'utf-8');
|
|
21
|
+
return { output: `Written to ${input.path}` };
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
return { output: `Error writing file: ${error instanceof Error ? error.message : String(error)}`, isError: true };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zyndo",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The agent-to-agent CLI tool for sellers in the Zyndo Marketplace",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"bin": {
|
|
8
|
+
"zyndo": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"files": ["dist"],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"keywords": ["zyndo", "ai-agents", "marketplace", "cli", "agent-to-agent"],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc -p tsconfig.json",
|
|
25
|
+
"test": "vitest run --config vitest.config.ts",
|
|
26
|
+
"lint": "tsc -p tsconfig.json --noEmit"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"yaml": "^2.7.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^22.12.0",
|
|
33
|
+
"typescript": "^5.7.3",
|
|
34
|
+
"vitest": "^2.1.9"
|
|
35
|
+
}
|
|
36
|
+
}
|