pulse-coder-engine 0.0.1-alpha.1 → 0.0.1-alpha.3

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 (44) hide show
  1. package/dist/built-in/index.cjs +1291 -0
  2. package/dist/built-in/index.cjs.map +1 -0
  3. package/dist/built-in/index.d.cts +3 -0
  4. package/dist/built-in/index.d.ts +3 -0
  5. package/dist/built-in/index.js +1250 -0
  6. package/dist/built-in/index.js.map +1 -0
  7. package/dist/index-DDqISE31.d.cts +120 -0
  8. package/dist/index-DDqISE31.d.ts +120 -0
  9. package/dist/index.cjs +1826 -0
  10. package/dist/index.cjs.map +1 -0
  11. package/dist/index.d.cts +484 -0
  12. package/dist/index.d.ts +484 -0
  13. package/dist/index.js +1769 -0
  14. package/dist/index.js.map +1 -0
  15. package/package.json +13 -5
  16. package/examples/new-engine-usage.ts +0 -52
  17. package/src/Engine.ts +0 -150
  18. package/src/ai/index.ts +0 -116
  19. package/src/built-in/index.ts +0 -27
  20. package/src/built-in/mcp-plugin/index.ts +0 -104
  21. package/src/built-in/skills-plugin/index.ts +0 -223
  22. package/src/built-in/sub-agent-plugin/index.ts +0 -203
  23. package/src/config/index.ts +0 -35
  24. package/src/context/index.ts +0 -134
  25. package/src/core/loop.ts +0 -147
  26. package/src/index.ts +0 -17
  27. package/src/plugin/EnginePlugin.ts +0 -60
  28. package/src/plugin/PluginManager.ts +0 -426
  29. package/src/plugin/UserConfigPlugin.ts +0 -183
  30. package/src/prompt/index.ts +0 -1
  31. package/src/prompt/system.ts +0 -126
  32. package/src/shared/types.ts +0 -50
  33. package/src/tools/bash.ts +0 -59
  34. package/src/tools/clarify.ts +0 -74
  35. package/src/tools/edit.ts +0 -79
  36. package/src/tools/grep.ts +0 -148
  37. package/src/tools/index.ts +0 -44
  38. package/src/tools/ls.ts +0 -20
  39. package/src/tools/read.ts +0 -69
  40. package/src/tools/tavily.ts +0 -55
  41. package/src/tools/utils.ts +0 -16
  42. package/src/tools/write.ts +0 -42
  43. package/tsconfig.json +0 -9
  44. package/tsup.config.ts +0 -11
@@ -1,55 +0,0 @@
1
- import z from "zod";
2
- import type { Tool } from "../shared/types";
3
- import { truncateOutput } from "./utils";
4
-
5
- export const TavilyTool: Tool<
6
- { query: string; maxResults?: number },
7
- { results: Array<{ title: string; url: string; content: string; score?: number }> }
8
- > = {
9
- name: 'tavily',
10
- description: 'Search the web using Tavily API',
11
- inputSchema: z.object({
12
- query: z.string().describe('The search query'),
13
- maxResults: z.number().optional().default(5).describe('Maximum number of results to return'),
14
- }),
15
- execute: async ({ query, maxResults = 5 }) => {
16
- const apiKey = process.env.TAVILY_API_KEY;
17
-
18
- if (!apiKey) {
19
- throw new Error('TAVILY_API_KEY environment variable is not set');
20
- }
21
-
22
- const response = await fetch('https://api.tavily.com/search', {
23
- method: 'POST',
24
- headers: {
25
- 'Content-Type': 'application/json',
26
- },
27
- body: JSON.stringify({
28
- api_key: apiKey,
29
- query,
30
- max_results: maxResults,
31
- search_depth: 'basic',
32
- include_answer: false,
33
- include_raw_content: false,
34
- include_images: false,
35
- }),
36
- });
37
-
38
- if (!response.ok) {
39
- throw new Error(`Tavily API error: ${response.status} ${response.statusText}`);
40
- }
41
-
42
- const data = await response.json();
43
-
44
- return {
45
- results: data.results?.map((result: any) => ({
46
- title: result.title || '',
47
- url: result.url || '',
48
- content: truncateOutput(result.content || ''),
49
- score: result.score || 0,
50
- })) || [],
51
- };
52
- },
53
- };
54
-
55
- export default TavilyTool;
@@ -1,16 +0,0 @@
1
- import { MAX_TOOL_OUTPUT_LENGTH } from "../config";
2
-
3
- export const truncateOutput = (output: string): string => {
4
- if (output.length <= MAX_TOOL_OUTPUT_LENGTH) {
5
- return output;
6
- }
7
-
8
- const half = Math.floor(MAX_TOOL_OUTPUT_LENGTH / 2);
9
- const removed = output.length - MAX_TOOL_OUTPUT_LENGTH;
10
-
11
- return (
12
- output.slice(0, half) +
13
- `\n\n... [truncated ${removed} characters] ...\n\n` +
14
- output.slice(-half)
15
- );
16
- };
@@ -1,42 +0,0 @@
1
- import z from "zod";
2
- import { writeFileSync, mkdirSync, existsSync } from "fs";
3
- import { dirname } from "path";
4
- import type { Tool } from "../shared/types";
5
-
6
- export const WriteTool: Tool<
7
- { filePath: string; content: string },
8
- { success: boolean; created: boolean; bytes: number }
9
- > = {
10
- name: 'write',
11
- description: 'Write contents to a file. Automatically creates parent directories if they do not exist. Will overwrite existing files.',
12
- inputSchema: z.object({
13
- filePath: z.string().describe('The absolute path to the file to write (must be absolute, not relative)'),
14
- content: z.string().describe('The content to write to the file'),
15
- }),
16
- execute: async ({ filePath, content }) => {
17
- // Check if file already exists
18
- const fileExists = existsSync(filePath);
19
-
20
- // Get the directory path
21
- const dir = dirname(filePath);
22
-
23
- // Create parent directories if they don't exist
24
- if (!existsSync(dir)) {
25
- mkdirSync(dir, { recursive: true });
26
- }
27
-
28
- // Write the file
29
- writeFileSync(filePath, content, 'utf-8');
30
-
31
- // Calculate bytes written
32
- const bytes = Buffer.byteLength(content, 'utf-8');
33
-
34
- return {
35
- success: true,
36
- created: !fileExists,
37
- bytes,
38
- };
39
- },
40
- };
41
-
42
- export default WriteTool;
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./dist",
5
- "rootDir": "./src"
6
- },
7
- "include": ["src/**/*"],
8
- "exclude": ["**/*.test.ts", "**/*.spec.ts"]
9
- }
package/tsup.config.ts DELETED
@@ -1,11 +0,0 @@
1
- import { defineConfig } from 'tsup';
2
-
3
- export default defineConfig({
4
- entry: ['src/index.ts'],
5
- format: ['esm'],
6
- dts: true,
7
- clean: true,
8
- splitting: false,
9
- sourcemap: true,
10
- target: 'es2022'
11
- });