@intella/sdk 0.0.1 → 0.0.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 (117) hide show
  1. package/README.md +6 -483
  2. package/dist/agent-manager.d.ts +47 -0
  3. package/dist/agent-manager.d.ts.map +1 -0
  4. package/dist/agent-manager.js +90 -0
  5. package/dist/agent-manager.js.map +1 -0
  6. package/dist/agents/base-agent.d.ts +41 -0
  7. package/dist/agents/base-agent.d.ts.map +1 -0
  8. package/dist/agents/base-agent.js +148 -0
  9. package/dist/agents/base-agent.js.map +1 -0
  10. package/dist/agents/claude-agent.d.ts +24 -0
  11. package/dist/agents/claude-agent.d.ts.map +1 -0
  12. package/dist/agents/claude-agent.js +65 -0
  13. package/dist/agents/claude-agent.js.map +1 -0
  14. package/dist/agents/codex-agent.d.ts +25 -0
  15. package/dist/agents/codex-agent.d.ts.map +1 -0
  16. package/dist/agents/codex-agent.js +62 -0
  17. package/dist/agents/codex-agent.js.map +1 -0
  18. package/dist/agents/intella-lite-agent.d.ts +21 -0
  19. package/dist/agents/intella-lite-agent.d.ts.map +1 -0
  20. package/dist/agents/intella-lite-agent.js +43 -0
  21. package/dist/agents/intella-lite-agent.js.map +1 -0
  22. package/dist/agents/opencode-agent.d.ts +20 -0
  23. package/dist/agents/opencode-agent.d.ts.map +1 -0
  24. package/dist/agents/opencode-agent.js +36 -0
  25. package/dist/agents/opencode-agent.js.map +1 -0
  26. package/dist/filesystem/base-provider.d.ts +55 -0
  27. package/dist/filesystem/base-provider.d.ts.map +1 -0
  28. package/dist/filesystem/base-provider.js +45 -0
  29. package/dist/filesystem/base-provider.js.map +1 -0
  30. package/dist/filesystem/index.d.ts +3 -0
  31. package/dist/filesystem/index.d.ts.map +1 -0
  32. package/{src/filesystem/index.ts → dist/filesystem/index.js} +1 -2
  33. package/dist/filesystem/index.js.map +1 -0
  34. package/dist/filesystem/memory-provider.d.ts +44 -0
  35. package/dist/filesystem/memory-provider.d.ts.map +1 -0
  36. package/dist/filesystem/memory-provider.js +227 -0
  37. package/dist/filesystem/memory-provider.js.map +1 -0
  38. package/dist/filesystem-manager.d.ts +75 -0
  39. package/dist/filesystem-manager.d.ts.map +1 -0
  40. package/dist/filesystem-manager.js +162 -0
  41. package/dist/filesystem-manager.js.map +1 -0
  42. package/dist/index.d.ts +18 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/{src/index.ts → dist/index.js} +4 -47
  45. package/dist/index.js.map +1 -0
  46. package/dist/orchestrator.d.ts +32 -0
  47. package/dist/orchestrator.d.ts.map +1 -0
  48. package/dist/orchestrator.js +137 -0
  49. package/dist/orchestrator.js.map +1 -0
  50. package/dist/sandbox/base-provider.d.ts +106 -0
  51. package/dist/sandbox/base-provider.d.ts.map +1 -0
  52. package/dist/sandbox/base-provider.js +74 -0
  53. package/dist/sandbox/base-provider.js.map +1 -0
  54. package/dist/sandbox/daytona-provider.d.ts +93 -0
  55. package/dist/sandbox/daytona-provider.d.ts.map +1 -0
  56. package/dist/sandbox/daytona-provider.js +378 -0
  57. package/dist/sandbox/daytona-provider.js.map +1 -0
  58. package/dist/sandbox/e2b-provider.d.ts +85 -0
  59. package/dist/sandbox/e2b-provider.d.ts.map +1 -0
  60. package/dist/sandbox/e2b-provider.js +363 -0
  61. package/dist/sandbox/e2b-provider.js.map +1 -0
  62. package/dist/sandbox/modal-provider.d.ts +92 -0
  63. package/dist/sandbox/modal-provider.d.ts.map +1 -0
  64. package/dist/sandbox/modal-provider.js +516 -0
  65. package/dist/sandbox/modal-provider.js.map +1 -0
  66. package/dist/sandbox-manager.d.ts +59 -0
  67. package/dist/sandbox-manager.d.ts.map +1 -0
  68. package/dist/sandbox-manager.js +141 -0
  69. package/dist/sandbox-manager.js.map +1 -0
  70. package/dist/sdk.d.ts +173 -0
  71. package/dist/sdk.d.ts.map +1 -0
  72. package/dist/sdk.js +277 -0
  73. package/dist/sdk.js.map +1 -0
  74. package/dist/types.d.ts +423 -0
  75. package/dist/types.d.ts.map +1 -0
  76. package/dist/types.js +2 -0
  77. package/dist/types.js.map +1 -0
  78. package/dist/utils/code-extractor.d.ts +103 -0
  79. package/dist/utils/code-extractor.d.ts.map +1 -0
  80. package/dist/utils/code-extractor.js +133 -0
  81. package/dist/utils/code-extractor.js.map +1 -0
  82. package/package.json +23 -11
  83. package/examples/claude-code/README.md +0 -178
  84. package/examples/claude-code/advanced-config.ts +0 -55
  85. package/examples/claude-code/basic-usage.ts +0 -56
  86. package/examples/claude-code/model-comparison.ts +0 -50
  87. package/examples/claude-code/orchestration.ts +0 -70
  88. package/examples/claude-code/streaming.ts +0 -69
  89. package/examples/claude-code/tsconfig.json +0 -19
  90. package/examples/code-extractor/README.md +0 -77
  91. package/examples/code-extractor/example.ts +0 -145
  92. package/examples/filesystem/basic-usage.ts +0 -84
  93. package/examples/integrated-task/README.md +0 -68
  94. package/examples/integrated-task/integrated-usage.ts +0 -193
  95. package/examples/integrated-task/simple-example.ts +0 -51
  96. package/examples/integrated-task/tsconfig.json +0 -19
  97. package/examples/sandbox/basic-usage.ts +0 -173
  98. package/src/agent-manager.ts +0 -104
  99. package/src/agents/base-agent.ts +0 -166
  100. package/src/agents/claude-agent.ts +0 -77
  101. package/src/agents/codex-agent.ts +0 -72
  102. package/src/agents/intella-lite-agent.ts +0 -55
  103. package/src/agents/opencode-agent.ts +0 -45
  104. package/src/filesystem/agentfs-provider.ts +0 -328
  105. package/src/filesystem/base-provider.ts +0 -98
  106. package/src/filesystem/memory-provider.ts +0 -267
  107. package/src/filesystem-manager.ts +0 -213
  108. package/src/orchestrator.ts +0 -177
  109. package/src/sandbox/base-provider.ts +0 -184
  110. package/src/sandbox/daytona-provider.ts +0 -462
  111. package/src/sandbox/e2b-provider.ts +0 -419
  112. package/src/sandbox/modal-provider.ts +0 -597
  113. package/src/sandbox-manager.ts +0 -175
  114. package/src/sdk.ts +0 -401
  115. package/src/types.ts +0 -451
  116. package/src/utils/code-extractor.ts +0 -194
  117. package/tsconfig.json +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C9C,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,WAAW,CACzB,IAAY,EACZ,QAAiB;IAEjB,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACnC,CAAC"}
package/package.json CHANGED
@@ -1,19 +1,26 @@
1
1
  {
2
2
  "name": "@intella/sdk",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Agent orchestrator SDK for managing tasks across multiple AI agents using AI SDK v6",
5
- "type": "module",
6
5
  "main": "./dist/index.js",
7
6
  "types": "./dist/index.d.ts",
7
+ "module": "./dist/index.js",
8
+ "type": "module",
8
9
  "exports": {
9
10
  ".": {
10
11
  "import": "./dist/index.js",
11
- "types": "./dist/index.d.ts"
12
+ "types": "./dist/index.d.ts",
13
+ "require": "./dist/index.js"
12
14
  }
13
15
  },
16
+ "files": [
17
+ "dist/**/*",
18
+ "README.md"
19
+ ],
14
20
  "scripts": {
15
- "build": "tsc",
21
+ "build": "pnpm run clean && tsc",
16
22
  "dev": "tsc --watch",
23
+ "prepublishOnly": "pnpm run build",
17
24
  "clean": "rm -rf dist",
18
25
  "example:basic": "tsx examples/claude-code/basic-usage.ts",
19
26
  "example:streaming": "tsx examples/claude-code/streaming.ts",
@@ -21,7 +28,11 @@
21
28
  "example:model-comparison": "tsx examples/claude-code/model-comparison.ts",
22
29
  "example:integrated-task": "tsx examples/integrated-task/integrated-usage.ts",
23
30
  "example:simple-example": "tsx examples/integrated-task/simple-example.ts",
24
- "example:sandbox": "tsx examples/sandbox/basic-usage.ts"
31
+ "example:sandbox": "tsx examples/sandbox/basic-usage.ts",
32
+ "example:e2b-template": "tsx examples/e2b-template/use-template.ts",
33
+ "example:e2b-cli-agent": "tsx examples/e2b-cli-agent/agent-execution.ts",
34
+ "template:build:dev": "tsx templates/e2b-intella/build.dev.ts",
35
+ "template:build:prod": "tsx templates/e2b-intella/build.prod.ts"
25
36
  },
26
37
  "keywords": [
27
38
  "ai",
@@ -35,22 +46,23 @@
35
46
  "dependencies": {
36
47
  "@daytonaio/sdk": "^0.129.0",
37
48
  "@e2b/code-interpreter": "^2.3.3",
38
- "agentfs-sdk": "^0.5.0",
39
- "ai": "^6.0.0",
49
+ "ai": "6.0.23",
40
50
  "ai-sdk-provider-claude-code": "^3.1.0",
41
51
  "ai-sdk-provider-codex-cli": "^1.0.4",
42
52
  "ai-sdk-provider-opencode-sdk": "^1.0.0",
43
53
  "dotenv": "^17.2.3",
54
+ "e2b": "^2.9.0",
44
55
  "modal": "^0.6.0",
45
- "ts-node": "^10.9.2",
46
56
  "tsx": "^4.21.0",
47
- "zod": "^3.25.76"
57
+ "ts-node": "^10.9.2"
48
58
  },
49
59
  "peerDependencies": {
50
60
  "@ai-sdk/openai": "*"
51
61
  },
52
62
  "devDependencies": {
53
63
  "@types/node": "^22.19.3",
54
- "typescript": "^5.8.3"
64
+ "typescript": "^5.8.3",
65
+ "@types/bun": "latest",
66
+ "redis": "^5.10.0"
55
67
  }
56
- }
68
+ }
@@ -1,178 +0,0 @@
1
- # Claude Code Agent Examples
2
-
3
- This folder contains examples demonstrating how to use the Claude Code agent through the Intella SDK.
4
-
5
- ## Prerequisites
6
-
7
- 1. **Install dependencies:**
8
- ```bash
9
- npm install @intella/sdk ai ai-sdk-provider-claude-code
10
- ```
11
-
12
- 2. **Install Claude Code CLI:**
13
- ```bash
14
- npm install -g @anthropic-ai/claude-code
15
- ```
16
-
17
- 3. **Authenticate:**
18
- ```bash
19
- claude login
20
- ```
21
- This will open a browser window for authentication. You need a Claude Pro or Max subscription.
22
-
23
- ## Examples
24
-
25
- ### 1. Basic Usage (`basic-usage.ts`)
26
-
27
- Demonstrates the simplest way to use the Claude Code agent:
28
-
29
- ```bash
30
- npx tsx examples/claude-code/basic-usage.ts
31
- ```
32
-
33
- **Features:**
34
- - Basic agent configuration
35
- - Simple task execution
36
- - Response handling
37
-
38
- ### 2. Advanced Configuration (`advanced-config.ts`)
39
-
40
- Shows how to configure the Claude Code agent with advanced options:
41
-
42
- ```bash
43
- npx tsx examples/claude-code/advanced-config.ts
44
- ```
45
-
46
- **Features:**
47
- - Tool permissions (allowedTools, disallowedTools)
48
- - Permission modes
49
- - MCP server configuration
50
- - Custom working directory
51
- - Verbose logging
52
-
53
- ### 3. Streaming (`streaming.ts`)
54
-
55
- Demonstrates streaming responses from the Claude Code agent:
56
-
57
- ```bash
58
- npx tsx examples/claude-code/streaming.ts
59
- ```
60
-
61
- **Features:**
62
- - Real-time response streaming
63
- - Chunk-by-chunk output
64
- - Completion detection
65
-
66
- ### 4. Orchestration (`orchestration.ts`)
67
-
68
- Shows how to orchestrate multiple agents including Claude Code:
69
-
70
- ```bash
71
- npx tsx examples/claude-code/orchestration.ts
72
- ```
73
-
74
- **Features:**
75
- - Sequential orchestration (agents work in sequence)
76
- - Parallel orchestration (agents work simultaneously)
77
- - Result combination strategies
78
-
79
- ### 5. Model Comparison (`model-comparison.ts`)
80
-
81
- Compares different Claude models (Opus, Sonnet, Haiku) on the same task:
82
-
83
- ```bash
84
- npx tsx examples/claude-code/model-comparison.ts
85
- ```
86
-
87
- **Features:**
88
- - Model performance comparison
89
- - Response time analysis
90
- - Token usage tracking
91
-
92
- ## Claude Code Models
93
-
94
- The Claude Code provider supports three model shortcuts:
95
-
96
- - **`opus`**: Claude Opus - Most capable model, best for complex reasoning
97
- - **`sonnet`**: Claude Sonnet - Balanced performance and capability (default)
98
- - **`haiku`**: Claude Haiku - Fastest model, good for simple tasks
99
-
100
- You can also use full model identifiers:
101
- - `claude-opus-4-5`
102
- - `claude-sonnet-4-5-20250929`
103
- - `claude-haiku-4-5`
104
-
105
- ## Configuration Options
106
-
107
- ### Basic Configuration
108
-
109
- ```typescript
110
- sdk.configureAgent('claude', {
111
- model: 'sonnet', // Model shortcut or full ID
112
- });
113
- ```
114
-
115
- ### Advanced Configuration
116
-
117
- ```typescript
118
- sdk.configureAgent('claude', {
119
- model: 'opus',
120
- allowedTools: ['Read', 'Write', 'Edit'],
121
- disallowedTools: ['Bash'],
122
- permissionMode: 'default',
123
- maxTurns: 10,
124
- cwd: process.cwd(),
125
- verbose: true,
126
- });
127
- ```
128
-
129
- ## Tool Permissions
130
-
131
- Claude Code has built-in tools (Bash, Edit, Read, Write, etc.) that execute autonomously. You can control which tools are available:
132
-
133
- - **`allowedTools`**: Array of tool names to allow (whitelist)
134
- - **`disallowedTools`**: Array of tool names to disallow (blacklist)
135
- - **`permissionMode`**: How to handle tool permissions
136
- - `'default'`: Standard permission handling
137
- - `'acceptEdits'`: Automatically accept file edits
138
- - `'bypassPermissions'`: Skip permission prompts
139
- - `'plan'`: Show plan before execution
140
-
141
- ## MCP Servers
142
-
143
- You can configure Model Context Protocol (MCP) servers for extended functionality:
144
-
145
- ```typescript
146
- sdk.configureAgent('claude', {
147
- mcpServers: {
148
- 'my-server': {
149
- command: 'node',
150
- args: ['server.js'],
151
- },
152
- },
153
- });
154
- ```
155
-
156
- ## Authentication
157
-
158
- Claude Code uses CLI authentication. After running `claude login`, your Claude Pro or Max subscription is automatically used. No API keys are needed in your code.
159
-
160
- ## More Information
161
-
162
- - [Claude Code Provider Documentation](https://ai-sdk.dev/providers/community-providers/claude-code)
163
- - [Intella SDK Documentation](../../README.md)
164
- - [Claude Code CLI Documentation](https://github.com/anthropics/claude-code)
165
-
166
- ## Running Examples
167
-
168
- Make sure you have TypeScript execution support. You can use:
169
-
170
- - `tsx` (recommended): `npm install -g tsx`
171
- - `ts-node`: `npm install -g ts-node`
172
- - Or compile first: `tsc` then `node dist/example.js`
173
-
174
- Example:
175
- ```bash
176
- npx tsx examples/claude-code/basic-usage.ts
177
- ```
178
-
@@ -1,55 +0,0 @@
1
- /**
2
- * Advanced Claude Code Agent Configuration
3
- *
4
- * This example demonstrates advanced configuration options for the Claude Code agent,
5
- * including tool permissions, MCP servers, and custom settings.
6
- *
7
- * Prerequisites:
8
- * 1. Install dependencies: npm install @intella/sdk ai ai-sdk-provider-claude-code
9
- * 2. Install Claude Code CLI: npm install -g @anthropic-ai/claude-code
10
- * 3. Authenticate: claude login
11
- */
12
-
13
- import { IntellaSDK } from '../../src/index';
14
-
15
- async function main() {
16
- const sdk = new IntellaSDK();
17
-
18
- // Select and configure Claude agent with advanced options
19
- sdk.selectAgent('claude', {
20
- model: 'opus', // Most capable model
21
-
22
- // Tool permissions
23
- allowedTools: ['Read', 'Write', 'Edit'], // Only allow these tools
24
- disallowedTools: ['Bash'], // Explicitly disallow Bash
25
-
26
- // Permission mode
27
- permissionMode: 'default', // Options: 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan'
28
-
29
- // MCP server configuration (optional)
30
- // mcpServers: {
31
- // 'my-server': {
32
- // command: 'node',
33
- // args: ['server.js'],
34
- // },
35
- // },
36
-
37
- // Other options
38
- maxTurns: 10, // Maximum conversation turns
39
- cwd: process.cwd(), // Working directory
40
- verbose: true, // Enable debug logging
41
- });
42
-
43
- console.log('Claude agent configured with advanced settings\n');
44
-
45
- // Execute a task that might use tools
46
- const response = await sdk.executeTask({
47
- prompt: 'Read the package.json file and summarize the dependencies.',
48
- systemPrompt: 'You are a helpful coding assistant.',
49
- });
50
-
51
- console.log('Response:', response.text);
52
- }
53
-
54
- main().catch(console.error);
55
-
@@ -1,56 +0,0 @@
1
- /**
2
- * Basic Claude Code Agent Usage
3
- *
4
- * This example demonstrates basic usage of the Claude Code agent
5
- * through the Intella SDK.
6
- *
7
- * Prerequisites:
8
- * 1. Install dependencies: npm install @intella/sdk ai ai-sdk-provider-claude-code
9
- * 2. Install Claude Code CLI: npm install -g @anthropic-ai/claude-code
10
- * 3. Authenticate: claude login
11
- */
12
-
13
- import { IntellaSDK } from '../../src/index';
14
-
15
- async function main() {
16
- const sdk = new IntellaSDK();
17
-
18
- // Verify default agent before selection
19
- console.log('Default agent before selection:', sdk.getDefaultAgentType());
20
- console.log('Available agents:', sdk.listAgents());
21
- console.log('');
22
-
23
- // Select and configure Claude agent as default
24
- // Claude Code uses CLI authentication (claude login)
25
- sdk.selectAgent('claude', {
26
- model: 'sonnet', // Options: 'opus', 'sonnet', 'haiku'
27
- verbose: true, // Enable verbose logging to see Claude Code in action
28
- });
29
-
30
- // Verify agent selection
31
- console.log('Default agent after selection:', sdk.getDefaultAgentType());
32
- console.log('Claude agent config:', sdk.getAgentConfig('claude'));
33
- console.log('');
34
-
35
- // Execute a simple task (will use Claude as it's now the default)
36
- console.log('Executing task with Claude Code agent...\n');
37
- const response = await sdk.executeTask(
38
- 'Write a brief explanation of quantum computing in 2-3 sentences.'
39
- );
40
-
41
- console.log('\n=== Response ===');
42
- console.log('Agent Type:', response.agentType);
43
- console.log('Response:', response.text);
44
- console.log('\n=== Metadata ===');
45
- console.log(JSON.stringify(response.metadata, null, 2));
46
-
47
- // Final verification
48
- if (response.agentType === 'claude') {
49
- console.log('\n✅ SUCCESS: Claude Code agent was used!');
50
- } else {
51
- console.log(`\n❌ WARNING: Expected 'claude' but got '${response.agentType}'`);
52
- }
53
- }
54
-
55
- main().catch(console.error);
56
-
@@ -1,50 +0,0 @@
1
- /**
2
- * Claude Code Model Comparison
3
- *
4
- * This example demonstrates using different Claude models (Opus, Sonnet, Haiku)
5
- * to compare their responses to the same prompt.
6
- *
7
- * Prerequisites:
8
- * 1. Install dependencies: npm install @intella/sdk ai ai-sdk-provider-claude-code
9
- * 2. Install Claude Code CLI: npm install -g @anthropic-ai/claude-code
10
- * 3. Authenticate: claude login
11
- */
12
-
13
- import { IntellaSDK } from '../../src/index';
14
-
15
- async function main() {
16
- const sdk = new IntellaSDK();
17
-
18
- const prompt = 'Explain the concept of recursion in programming with a simple example.';
19
- const models = ['haiku', 'sonnet', 'opus'] as const;
20
-
21
- console.log('Comparing Claude models on the same prompt...\n');
22
- console.log('Prompt:', prompt);
23
- console.log('='.repeat(80) + '\n');
24
-
25
- for (const model of models) {
26
- console.log(`\n${model.toUpperCase()} Model:`);
27
- console.log('-'.repeat(80));
28
-
29
- // Select agent with specific model
30
- sdk.selectAgent('claude', { model });
31
-
32
- const startTime = Date.now();
33
- const response = await sdk.executeTask(prompt);
34
- const duration = Date.now() - startTime;
35
-
36
- console.log(response.text);
37
- console.log(`\nResponse time: ${duration}ms`);
38
- console.log(`Tokens: ${response.metadata?.usage?.totalTokens || 'N/A'}`);
39
- console.log('='.repeat(80));
40
- }
41
-
42
- console.log('\nComparison complete!');
43
- console.log('\nModel characteristics:');
44
- console.log('- Haiku: Fastest, good for simple tasks');
45
- console.log('- Sonnet: Balanced performance and capability');
46
- console.log('- Opus: Most capable, best for complex reasoning');
47
- }
48
-
49
- main().catch(console.error);
50
-
@@ -1,70 +0,0 @@
1
- /**
2
- * Multi-Agent Orchestration with Claude Code
3
- *
4
- * This example demonstrates orchestrating multiple agents including Claude Code
5
- * for complex tasks that benefit from multiple AI perspectives.
6
- *
7
- * Prerequisites:
8
- * 1. Install dependencies: npm install @intella/sdk ai ai-sdk-provider-claude-code
9
- * 2. Install Claude Code CLI: npm install -g @anthropic-ai/claude-code
10
- * 3. Authenticate: claude login
11
- */
12
-
13
- import { IntellaSDK } from '../../src/index';
14
-
15
- async function main() {
16
- const sdk = new IntellaSDK();
17
-
18
- // Configure multiple agents
19
- sdk.configureAgent('claude', {
20
- model: 'sonnet',
21
- });
22
-
23
- sdk.configureAgent('intella-lite', {
24
- apiKey: process.env.OPENAI_API_KEY,
25
- model: 'gpt-4o-mini',
26
- });
27
-
28
- console.log('Orchestrating task across multiple agents...\n');
29
-
30
- // Sequential orchestration: Claude analyzes, then Intella Lite refines
31
- const sequentialResult = await sdk.orchestrateTask(
32
- {
33
- prompt: 'Analyze the pros and cons of microservices architecture, then create a summary.',
34
- systemPrompt: 'You are a software architecture expert.',
35
- },
36
- ['claude', 'intella-lite'],
37
- 'sequential',
38
- {
39
- passResults: true, // Pass Claude's analysis to Intella Lite for summarization
40
- }
41
- );
42
-
43
- console.log('Sequential Orchestration Result:');
44
- console.log('='.repeat(50));
45
- console.log(sequentialResult.result);
46
- console.log('\nAgent Responses:');
47
- sequentialResult.agentResponses.forEach((agentResponse, index) => {
48
- console.log(`\n${index + 1}. ${agentResponse.agentType}:`);
49
- console.log(agentResponse.response.substring(0, 200) + '...');
50
- });
51
-
52
- console.log('\n\n' + '='.repeat(50) + '\n');
53
-
54
- // Parallel orchestration: Get multiple perspectives simultaneously
55
- const parallelResult = await sdk.orchestrateTask(
56
- 'What are the key considerations when choosing a database for a new project?',
57
- ['claude', 'intella-lite'],
58
- 'parallel',
59
- {
60
- combineStrategy: 'merge', // Combine all responses
61
- }
62
- );
63
-
64
- console.log('Parallel Orchestration Result:');
65
- console.log('='.repeat(50));
66
- console.log(parallelResult.result);
67
- }
68
-
69
- main().catch(console.error);
70
-
@@ -1,69 +0,0 @@
1
- /**
2
- * Streaming with Claude Code Agent
3
- *
4
- * This example demonstrates how to stream responses from the Claude Code agent.
5
- *
6
- * Prerequisites:
7
- * 1. Install dependencies: npm install @intella/sdk ai ai-sdk-provider-claude-code
8
- * 2. Install Claude Code CLI: npm install -g @anthropic-ai/claude-code
9
- * 3. Authenticate: claude login
10
- */
11
-
12
- import { IntellaSDK, extractCodeBlock } from '../../src/index';
13
-
14
- async function main() {
15
- const sdk = new IntellaSDK();
16
-
17
- // Select and configure Claude agent
18
- sdk.selectAgent('intella-lite', {
19
- model: 'gpt-4o-mini',
20
- });
21
-
22
- console.log('Streaming response from Claude Code agent...\n');
23
-
24
- let code = ''
25
-
26
- let chunks = []
27
-
28
- // Stream the response
29
- for await (const chunk of sdk.streamTask(
30
- 'Write a python script to generate ascii art of a cat'
31
- )) {
32
- // Write each chunk as it arrives
33
- process.stdout.write(chunk.text);
34
- chunks.push(chunk.text);
35
-
36
- if (chunk.isDone) {
37
- console.log('\n\nStreaming complete!');
38
- console.log('Agent Type:', chunk.agentType);
39
- }
40
- }
41
-
42
- let response = chunks.join('');
43
-
44
- console.log('Response:', response);
45
-
46
- // Extract the code from the response
47
-
48
- const codeBlock = extractCodeBlock(response, 'python');
49
- if (!codeBlock) {
50
- throw new Error('No python code block found');
51
- }
52
- code = codeBlock.code;
53
-
54
- // Execute the code
55
-
56
- console.log('Code:', code);
57
-
58
- const sandbox = await sdk.initializeSandbox('e2b', {
59
- templateId: 'base',
60
- });
61
- const result = await sandbox.runCode(code, {
62
- language: 'python',
63
- });
64
- console.log('Result:', result);
65
-
66
- }
67
-
68
- main().catch(console.error);
69
-
@@ -1,19 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./dist",
5
- "rootDir": "../..",
6
- "moduleResolution": "node",
7
- "esModuleInterop": true,
8
- "skipLibCheck": true,
9
- "types": ["node"],
10
- "lib": ["ES2020"],
11
- "baseUrl": "../..",
12
- "paths": {
13
- "@intella/sdk": ["./src/index.ts"]
14
- }
15
- },
16
- "include": ["*.ts", "../../src/**/*.ts"],
17
- "exclude": ["node_modules", "dist"]
18
- }
19
-
@@ -1,77 +0,0 @@
1
- # Code Extractor Utility Example
2
-
3
- This example demonstrates how to use the code extractor utility functions to extract code blocks from LLM responses in markdown format.
4
-
5
- ## Functions
6
-
7
- ### `extractCodeBlocks(text, options?)`
8
-
9
- Extracts all code blocks from markdown text. Returns an array of `CodeBlock` objects or code strings.
10
-
11
- **Options:**
12
- - `languages?: string[]` - Filter by specific language(s) (case-insensitive)
13
- - `codeOnly?: boolean` - Return only code strings instead of full objects
14
- - `includeFullMatch?: boolean` - Include the full match including fences
15
- - `customWrapper?: { start: string; end: string }` - Use custom wrapper strings instead of default ``` markers
16
-
17
- ### `extractCodeBlock(text, language?)`
18
-
19
- Extracts the first code block from markdown text. Optionally filter by language.
20
-
21
- ### `extractCode(text, language?)`
22
-
23
- Extracts the code content from the first code block as a string. Optionally filter by language.
24
-
25
- ## Usage Examples
26
-
27
- ```typescript
28
- import { extractCodeBlocks, extractCodeBlock, extractCode } from '@intella/sdk';
29
-
30
- const markdown = `
31
- Here's some code:
32
- \`\`\`typescript
33
- const x = 1;
34
- \`\`\`
35
-
36
- And a command:
37
- \`\`\`bash
38
- npm install
39
- \`\`\`
40
- `;
41
-
42
- // Extract all code blocks
43
- const blocks = extractCodeBlocks(markdown);
44
- // Returns: [
45
- // { language: 'typescript', code: 'const x = 1;' },
46
- // { language: 'bash', code: 'npm install' }
47
- // ]
48
-
49
- // Extract only TypeScript blocks
50
- const tsBlocks = extractCodeBlocks(markdown, { languages: ['typescript'] });
51
-
52
- // Extract only code strings
53
- const codeStrings = extractCodeBlocks(markdown, { codeOnly: true });
54
- // Returns: ['const x = 1;', 'npm install']
55
-
56
- // Extract first block
57
- const firstBlock = extractCodeBlock(markdown);
58
- // Returns: { language: 'typescript', code: 'const x = 1;' }
59
-
60
- // Extract code string only
61
- const code = extractCode(markdown, 'bash');
62
- // Returns: 'npm install'
63
-
64
- // Using custom wrapper
65
- const customMarkdown = '<code>typescript\nconst x = 1;\n</code>';
66
- const customBlocks = extractCodeBlocks(customMarkdown, {
67
- customWrapper: { start: '<code>', end: '</code>' }
68
- });
69
- // Returns: [{ language: 'typescript', code: 'const x = 1;' }]
70
- ```
71
-
72
- ## Running the Example
73
-
74
- ```bash
75
- # From the SDK root directory
76
- npx tsx examples/code-extractor/example.ts
77
- ```