@avasis-ai/synthcode 1.0.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.
Files changed (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +292 -0
  3. package/dist/chunk-53ZOIXM4.js +624 -0
  4. package/dist/chunk-53ZOIXM4.js.map +1 -0
  5. package/dist/chunk-BWXHO6UJ.js +115 -0
  6. package/dist/chunk-BWXHO6UJ.js.map +1 -0
  7. package/dist/chunk-CARUMOML.js +123 -0
  8. package/dist/chunk-CARUMOML.js.map +1 -0
  9. package/dist/chunk-DGUM43GV.js +11 -0
  10. package/dist/chunk-DGUM43GV.js.map +1 -0
  11. package/dist/chunk-F34HO4RA.js +487 -0
  12. package/dist/chunk-F34HO4RA.js.map +1 -0
  13. package/dist/chunk-FK7S2S7V.js +132 -0
  14. package/dist/chunk-FK7S2S7V.js.map +1 -0
  15. package/dist/chunk-MQ7XP6VT.js +174 -0
  16. package/dist/chunk-MQ7XP6VT.js.map +1 -0
  17. package/dist/chunk-TLPOO6C3.js +176 -0
  18. package/dist/chunk-TLPOO6C3.js.map +1 -0
  19. package/dist/chunk-W6OLZ2OI.js +56 -0
  20. package/dist/chunk-W6OLZ2OI.js.map +1 -0
  21. package/dist/cli/index.cjs +151 -0
  22. package/dist/cli/index.cjs.map +1 -0
  23. package/dist/cli/index.d.cts +1 -0
  24. package/dist/cli/index.d.ts +1 -0
  25. package/dist/cli/index.js +8 -0
  26. package/dist/cli/index.js.map +1 -0
  27. package/dist/cli/run.cjs +128 -0
  28. package/dist/cli/run.cjs.map +1 -0
  29. package/dist/cli/run.d.cts +1 -0
  30. package/dist/cli/run.d.ts +1 -0
  31. package/dist/cli/run.js +126 -0
  32. package/dist/cli/run.js.map +1 -0
  33. package/dist/index-D-K6sx8s.d.cts +8 -0
  34. package/dist/index-D-K6sx8s.d.ts +8 -0
  35. package/dist/index.cjs +2909 -0
  36. package/dist/index.cjs.map +1 -0
  37. package/dist/index.d.cts +274 -0
  38. package/dist/index.d.ts +274 -0
  39. package/dist/index.js +1048 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/llm/index.cjs +531 -0
  42. package/dist/llm/index.cjs.map +1 -0
  43. package/dist/llm/index.d.cts +70 -0
  44. package/dist/llm/index.d.ts +70 -0
  45. package/dist/llm/index.js +24 -0
  46. package/dist/llm/index.js.map +1 -0
  47. package/dist/mcp/index.cjs +323 -0
  48. package/dist/mcp/index.cjs.map +1 -0
  49. package/dist/mcp/index.d.cts +39 -0
  50. package/dist/mcp/index.d.ts +39 -0
  51. package/dist/mcp/index.js +11 -0
  52. package/dist/mcp/index.js.map +1 -0
  53. package/dist/memory/index.cjs +146 -0
  54. package/dist/memory/index.cjs.map +1 -0
  55. package/dist/memory/index.d.cts +51 -0
  56. package/dist/memory/index.d.ts +51 -0
  57. package/dist/memory/index.js +10 -0
  58. package/dist/memory/index.js.map +1 -0
  59. package/dist/tools/fuzzy-edit.cjs +200 -0
  60. package/dist/tools/fuzzy-edit.cjs.map +1 -0
  61. package/dist/tools/fuzzy-edit.d.cts +9 -0
  62. package/dist/tools/fuzzy-edit.d.ts +9 -0
  63. package/dist/tools/fuzzy-edit.js +12 -0
  64. package/dist/tools/fuzzy-edit.js.map +1 -0
  65. package/dist/tools/index.cjs +1032 -0
  66. package/dist/tools/index.cjs.map +1 -0
  67. package/dist/tools/index.d.cts +4 -0
  68. package/dist/tools/index.d.ts +4 -0
  69. package/dist/tools/index.js +39 -0
  70. package/dist/tools/index.js.map +1 -0
  71. package/dist/types-C11cw5ZD.d.cts +177 -0
  72. package/dist/types-C11cw5ZD.d.ts +177 -0
  73. package/dist/utils-TF4TBXQJ.js +10 -0
  74. package/dist/utils-TF4TBXQJ.js.map +1 -0
  75. package/dist/web-fetch-B42QzYD2.d.cts +85 -0
  76. package/dist/web-fetch-EDdhxmEf.d.ts +85 -0
  77. package/package.json +134 -0
@@ -0,0 +1,85 @@
1
+ import { T as Tool, A as APIToolDefinition, v as ToolUseBlock, t as ToolContext } from './types-C11cw5ZD.js';
2
+
3
+ /** Registry for managing tool lookup and deduplication. */
4
+ declare class ToolRegistry {
5
+ private readonly tools;
6
+ constructor(tools?: Tool[]);
7
+ /** Add a tool to the registry. Duplicate names are ignored (first one wins). */
8
+ add(tool: Tool): void;
9
+ /** Get a tool by name. */
10
+ get(name: string): Tool | undefined;
11
+ /** Check if a tool exists by name. */
12
+ has(name: string): boolean;
13
+ /** Find tool by case-insensitive name. Returns undefined if not found. */
14
+ findCaseInsensitive(name: string): string | undefined;
15
+ /** List all registered tool names. */
16
+ listNames(): string[];
17
+ /** Get all registered tools. */
18
+ getAll(): Tool[];
19
+ /** Get all tools in API format, sorted by name for cache stability. */
20
+ getAPI(): APIToolDefinition[];
21
+ /** Number of registered tools. */
22
+ get size(): number;
23
+ }
24
+
25
+ /** Result of a single tool execution. */
26
+ interface ToolExecutionResult {
27
+ id: string;
28
+ name: string;
29
+ output: string;
30
+ isError: boolean;
31
+ durationMs: number;
32
+ }
33
+ /**
34
+ * Orchestrate execution of multiple tool calls with partition-based concurrency.
35
+ *
36
+ * Read-only, concurrency-safe tools are grouped into concurrent batches (max 10 parallel).
37
+ * Non-safe tools are executed serially in their own batches.
38
+ * Results are returned in the original call order.
39
+ */
40
+ declare function orchestrateTools(tools: ToolRegistry, toolCalls: ToolUseBlock[], context: ToolContext, permissionCheck?: (name: string, input: Record<string, unknown>) => Promise<boolean>, abortSignal?: AbortSignal): Promise<ToolExecutionResult[]>;
41
+
42
+ declare const BashTool: Tool<{
43
+ command: string;
44
+ timeout?: number | undefined;
45
+ workdir?: string | undefined;
46
+ }>;
47
+
48
+ declare const FileReadTool: Tool<{
49
+ path: string;
50
+ offset?: number | undefined;
51
+ limit?: number | undefined;
52
+ }>;
53
+
54
+ declare const FileWriteTool: Tool<{
55
+ path: string;
56
+ content: string;
57
+ }>;
58
+
59
+ declare const FileEditTool: Tool<{
60
+ path: string;
61
+ oldString: string;
62
+ newString: string;
63
+ replaceAll?: boolean | undefined;
64
+ }>;
65
+
66
+ declare const GlobTool: Tool<{
67
+ pattern: string;
68
+ path?: string | undefined;
69
+ include?: string | undefined;
70
+ }>;
71
+
72
+ declare const GrepTool: Tool<{
73
+ pattern: string;
74
+ path?: string | undefined;
75
+ include?: string | undefined;
76
+ }>;
77
+
78
+ declare const WebFetchTool: Tool<{
79
+ url: string;
80
+ method?: "GET" | "POST" | "PUT" | "DELETE" | undefined;
81
+ headers?: Record<string, string> | undefined;
82
+ body?: string | undefined;
83
+ }>;
84
+
85
+ export { BashTool as B, FileEditTool as F, GlobTool as G, type ToolExecutionResult as T, WebFetchTool as W, FileReadTool as a, FileWriteTool as b, GrepTool as c, ToolRegistry as d, orchestrateTools as o };
package/package.json ADDED
@@ -0,0 +1,134 @@
1
+ {
2
+ "name": "@avasis-ai/synthcode",
3
+ "version": "1.0.0",
4
+ "description": "SynthCode - Synthesize any LLM into a production-grade AI agent. Battle-tested agentic patterns, model-agnostic, TypeScript-first.",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ }
19
+ },
20
+ "./llm": {
21
+ "import": {
22
+ "types": "./dist/llm/index.d.ts",
23
+ "default": "./dist/llm/index.js"
24
+ },
25
+ "require": {
26
+ "types": "./dist/llm/index.d.cts",
27
+ "default": "./dist/llm/index.cjs"
28
+ }
29
+ },
30
+ "./tools": {
31
+ "import": {
32
+ "types": "./dist/tools/index.d.ts",
33
+ "default": "./dist/tools/index.js"
34
+ },
35
+ "require": {
36
+ "types": "./dist/tools/index.d.cts",
37
+ "default": "./dist/tools/index.cjs"
38
+ }
39
+ },
40
+ "./memory": {
41
+ "import": {
42
+ "types": "./dist/memory/index.d.ts",
43
+ "default": "./dist/memory/index.js"
44
+ },
45
+ "require": {
46
+ "types": "./dist/memory/index.d.cts",
47
+ "default": "./dist/memory/index.cjs"
48
+ }
49
+ },
50
+ "./mcp": {
51
+ "import": {
52
+ "types": "./dist/mcp/index.d.ts",
53
+ "default": "./dist/mcp/index.js"
54
+ },
55
+ "require": {
56
+ "types": "./dist/mcp/index.d.cts",
57
+ "default": "./dist/mcp/index.cjs"
58
+ }
59
+ },
60
+ "./tools/fuzzy-edit": {
61
+ "import": {
62
+ "types": "./dist/tools/fuzzy-edit.d.ts",
63
+ "default": "./dist/tools/fuzzy-edit.js"
64
+ },
65
+ "require": {
66
+ "types": "./dist/tools/fuzzy-edit.d.cts",
67
+ "default": "./dist/tools/fuzzy-edit.cjs"
68
+ }
69
+ }
70
+ },
71
+ "bin": {
72
+ "synthcode": "dist/cli/run.js"
73
+ },
74
+ "files": [
75
+ "dist",
76
+ "LICENSE",
77
+ "README.md"
78
+ ],
79
+ "scripts": {
80
+ "build": "tsup",
81
+ "dev": "tsup --watch",
82
+ "typecheck": "tsc --noEmit",
83
+ "test": "vitest run",
84
+ "lint": "biome check src/",
85
+ "prepublishOnly": "npm run build"
86
+ },
87
+ "peerDependencies": {
88
+ "@anthropic-ai/sdk": ">=0.30.0",
89
+ "openai": "^4.70.0",
90
+ "zod": "^3.23.0"
91
+ },
92
+ "peerDependenciesMeta": {
93
+ "@anthropic-ai/sdk": {
94
+ "optional": true
95
+ },
96
+ "openai": {
97
+ "optional": true
98
+ },
99
+ "zod": {
100
+ "optional": true
101
+ }
102
+ },
103
+ "devDependencies": {
104
+ "@anthropic-ai/sdk": "^0.39.0",
105
+ "@biomejs/biome": "^1.9.0",
106
+ "@types/node": "^22.0.0",
107
+ "openai": "^4.78.0",
108
+ "tsup": "^8.3.0",
109
+ "typescript": "^5.9.3",
110
+ "vitest": "^2.1.0",
111
+ "zod": "^3.24.0"
112
+ },
113
+ "keywords": [
114
+ "ai",
115
+ "agent",
116
+ "llm",
117
+ "agentic",
118
+ "claude",
119
+ "claude-code",
120
+ "gpt",
121
+ "tool-use",
122
+ "mcp",
123
+ "context-management",
124
+ "synthcode",
125
+ "typescript"
126
+ ],
127
+ "license": "MIT",
128
+ "repository": {
129
+ "type": "git",
130
+ "url": "git+https://github.com/avasis-ai/synthcode.git"
131
+ },
132
+ "homepage": "https://github.com/avasis-ai/synthcode#readme",
133
+ "dependencies": {}
134
+ }