@crewx/sdk 0.8.0-rc.70 → 0.8.0-rc.71

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.
@@ -498,9 +498,9 @@ class BaseAIProvider {
498
498
  }
499
499
  }
500
500
  wrapUserQueryWithSecurity(userQuery, securityKey) {
501
- return `
502
- <user_query key="${securityKey}">
503
- ${userQuery}
501
+ return `
502
+ <user_query key="${securityKey}">
503
+ ${userQuery}
504
504
  </user_query>`;
505
505
  }
506
506
  extractUserQuery(wrappedQuery, securityKey) {
@@ -525,13 +525,13 @@ ${userQuery}
525
525
  const logFile = (0, path_1.join)(this.logsDir, `${ts}_${safeTaskId}.log`);
526
526
  const safeAgentId = agentId ? agentId.replace(/[\\/]/g, '_') : 'N/A';
527
527
  const timestamp = now.toLocaleString();
528
- const header = `=== TASK LOG: ${taskId} ===
529
- CrewX Version: ${this.crewxVersion}
530
- Provider: ${provider}
531
- Agent: ${safeAgentId}
532
- ${model ? `Model: ${model}\n` : ''}Command: ${command}
533
- Started: ${timestamp}
534
-
528
+ const header = `=== TASK LOG: ${taskId} ===
529
+ CrewX Version: ${this.crewxVersion}
530
+ Provider: ${provider}
531
+ Agent: ${safeAgentId}
532
+ ${model ? `Model: ${model}\n` : ''}Command: ${command}
533
+ Started: ${timestamp}
534
+
535
535
  `;
536
536
  (0, fs_1.writeFileSync)(logFile, header, 'utf8');
537
537
  return logFile;
@@ -147,22 +147,22 @@ class LayoutRenderer {
147
147
  catch {
148
148
  }
149
149
  if (!templateContent) {
150
- templateContent = `{{#if messages}}
151
- {{#if primaryAgentId}}Primary agent: @{{primaryAgentId}}
152
- {{else}}Primary agent: (unknown)
153
- {{/if}}
154
- Previous conversation ({{messagesCount}} messages):
155
- {{#each messages}}
156
- {{#if isAssistant}}
157
- **Assistant{{#if metadata.agent_id}} (@{{metadata.agent_id}}){{/if}}**
158
- {{else}}
159
- **{{#if metadata.slack}}{{#with metadata.slack}}{{#if user_profile.display_name}}{{user_profile.display_name}}{{else if username}}{{username}}{{else if user_id}}User ({{user_id}}){{else}}User{{/if}}{{/with}}{{else}}User{{/if}}**
160
- {{/if}}: {{{escapeHandlebars text}}}
161
- {{#if files}}
162
- {{#each files}}
163
- 📎 {{name}} ({{formatFileSize size}}) - Local: {{localPath}}
164
- {{/each}}
165
- {{/if}}
150
+ templateContent = `{{#if messages}}
151
+ {{#if primaryAgentId}}Primary agent: @{{primaryAgentId}}
152
+ {{else}}Primary agent: (unknown)
153
+ {{/if}}
154
+ Previous conversation ({{messagesCount}} messages):
155
+ {{#each messages}}
156
+ {{#if isAssistant}}
157
+ **Assistant{{#if metadata.agent_id}} (@{{metadata.agent_id}}){{/if}}**
158
+ {{else}}
159
+ **{{#if metadata.slack}}{{#with metadata.slack}}{{#if user_profile.display_name}}{{user_profile.display_name}}{{else if username}}{{username}}{{else if user_id}}User ({{user_id}}){{else}}User{{/if}}{{/with}}{{else}}User{{/if}}**
160
+ {{/if}}: {{{escapeHandlebars text}}}
161
+ {{#if files}}
162
+ {{#each files}}
163
+ 📎 {{name}} ({{formatFileSize size}}) - Local: {{localPath}}
164
+ {{/each}}
165
+ {{/if}}
166
166
  {{/each}}{{/if}}`;
167
167
  }
168
168
  const template = handlebarsInstance.compile(templateContent, { noEscape: true });
package/package.json CHANGED
@@ -1,135 +1,135 @@
1
- {
2
- "name": "@crewx/sdk",
3
- "version": "0.8.0-rc.70",
4
- "license": "UNLICENSED",
5
- "engines": {
6
- "node": ">=20.19.0"
7
- },
8
- "description": "SowonAI CrewX SDK",
9
- "type": "commonjs",
10
- "main": "dist/index.js",
11
- "module": "dist/index.js",
12
- "types": "dist/index.d.ts",
13
- "files": [
14
- "dist",
15
- "schema",
16
- "README.md",
17
- "LICENSE"
18
- ],
19
- "scripts": {
20
- "build": "tsc -p tsconfig.json",
21
- "test": "vitest run --config ./vitest.config.ts",
22
- "test:watch": "vitest --config ./vitest.config.ts",
23
- "test:ui": "vitest --ui --config ./vitest.config.ts",
24
- "test:unit": "vitest run --config ./vitest.config.ts tests/unit/**/*.test.ts",
25
- "test:integration": "vitest run --config ./vitest.config.ts tests/integration/**/*.test.ts --passWithNoTests",
26
- "test:coverage": "vitest run --config ./vitest.config.ts --coverage",
27
- "lint": "echo \"SDK lint pending\" && exit 0"
28
- },
29
- "exports": {
30
- ".": {
31
- "types": "./dist/index.d.ts",
32
- "import": "./dist/index.js",
33
- "require": "./dist/index.js"
34
- },
35
- "./internal": {
36
- "types": "./dist/internal/index.d.ts",
37
- "import": "./dist/internal/index.js",
38
- "require": "./dist/internal/index.js"
39
- },
40
- "./tools": {
41
- "types": "./dist/tools/index.d.ts",
42
- "import": "./dist/tools/index.js",
43
- "require": "./dist/tools/index.js"
44
- },
45
- "./api": {
46
- "types": "./dist/api/index.d.ts",
47
- "import": "./dist/api/index.js",
48
- "require": "./dist/api/index.js"
49
- },
50
- "./core/env-defaults": {
51
- "types": "./dist/core/env-defaults.d.ts",
52
- "import": "./dist/core/env-defaults.js",
53
- "require": "./dist/core/env-defaults.js"
54
- },
55
- "./package.json": "./package.json"
56
- },
57
- "typesVersions": {
58
- "*": {
59
- "tools": [
60
- "./dist/tools/index.d.ts"
61
- ],
62
- "internal": [
63
- "./dist/internal/index.d.ts"
64
- ],
65
- "api": [
66
- "./dist/api/index.d.ts"
67
- ],
68
- "core/env-defaults": [
69
- "./dist/core/env-defaults.d.ts"
70
- ]
71
- }
72
- },
73
- "dependencies": {
74
- "glob": "^11.0.0",
75
- "handlebars": "^4.7.8",
76
- "js-yaml": "^4.1.0",
77
- "remark-parse": "^11.0.0",
78
- "remark-stringify": "^11.0.0",
79
- "unified": "^11.0.5",
80
- "unist-util-visit": "^5.0.0",
81
- "nanoid": "^3.3.11",
82
- "zod": "^3.24.1"
83
- },
84
- "peerDependencies": {
85
- "@ai-sdk/anthropic": "^1.0.8",
86
- "@ai-sdk/google": "^1.0.10",
87
- "@ai-sdk/openai": "^1.0.11",
88
- "@ai-sdk/openai-compatible": "^1.0.0",
89
- "@mastra/core": "^0.24.0",
90
- "@nestjs/common": "^11.0.0",
91
- "@nestjs/core": "^11.0.0",
92
- "@openrouter/ai-sdk-provider": "^1.2.2",
93
- "ai": "^5.0.92",
94
- "reflect-metadata": "^0.2.2",
95
- "rxjs": "^7.8.0"
96
- },
97
- "peerDependenciesMeta": {
98
- "@ai-sdk/anthropic": {
99
- "optional": true
100
- },
101
- "@ai-sdk/google": {
102
- "optional": true
103
- },
104
- "@ai-sdk/openai": {
105
- "optional": true
106
- },
107
- "@ai-sdk/openai-compatible": {
108
- "optional": true
109
- },
110
- "@mastra/core": {
111
- "optional": true
112
- },
113
- "@openrouter/ai-sdk-provider": {
114
- "optional": true
115
- },
116
- "ai": {
117
- "optional": true
118
- }
119
- },
120
- "publishConfig": {
121
- "access": "public"
122
- },
123
- "devDependencies": {
124
- "@ai-sdk/anthropic": "^1.0.8",
125
- "@ai-sdk/google": "^1.0.10",
126
- "@ai-sdk/openai": "^1.0.11",
127
- "@ai-sdk/openai-compatible": "^1.0.0",
128
- "@mastra/core": "^0.24.0",
129
- "@openrouter/ai-sdk-provider": "^1.2.2",
130
- "@types/js-yaml": "^4.0.9",
131
- "ai": "^5.0.92",
132
- "dotenv": "^17.2.3",
133
- "typescript": "^5.0.0"
134
- }
135
- }
1
+ {
2
+ "name": "@crewx/sdk",
3
+ "version": "0.8.0-rc.71",
4
+ "license": "UNLICENSED",
5
+ "engines": {
6
+ "node": ">=20.19.0"
7
+ },
8
+ "description": "SowonAI CrewX SDK",
9
+ "type": "commonjs",
10
+ "main": "dist/index.js",
11
+ "module": "dist/index.js",
12
+ "types": "dist/index.d.ts",
13
+ "files": [
14
+ "dist",
15
+ "schema",
16
+ "README.md",
17
+ "LICENSE"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc -p tsconfig.json",
21
+ "test": "vitest run --config ./vitest.config.ts",
22
+ "test:watch": "vitest --config ./vitest.config.ts",
23
+ "test:ui": "vitest --ui --config ./vitest.config.ts",
24
+ "test:unit": "vitest run --config ./vitest.config.ts tests/unit/**/*.test.ts",
25
+ "test:integration": "vitest run --config ./vitest.config.ts tests/integration/**/*.test.ts --passWithNoTests",
26
+ "test:coverage": "vitest run --config ./vitest.config.ts --coverage",
27
+ "lint": "echo \"SDK lint pending\" && exit 0"
28
+ },
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js",
33
+ "require": "./dist/index.js"
34
+ },
35
+ "./internal": {
36
+ "types": "./dist/internal/index.d.ts",
37
+ "import": "./dist/internal/index.js",
38
+ "require": "./dist/internal/index.js"
39
+ },
40
+ "./tools": {
41
+ "types": "./dist/tools/index.d.ts",
42
+ "import": "./dist/tools/index.js",
43
+ "require": "./dist/tools/index.js"
44
+ },
45
+ "./api": {
46
+ "types": "./dist/api/index.d.ts",
47
+ "import": "./dist/api/index.js",
48
+ "require": "./dist/api/index.js"
49
+ },
50
+ "./core/env-defaults": {
51
+ "types": "./dist/core/env-defaults.d.ts",
52
+ "import": "./dist/core/env-defaults.js",
53
+ "require": "./dist/core/env-defaults.js"
54
+ },
55
+ "./package.json": "./package.json"
56
+ },
57
+ "typesVersions": {
58
+ "*": {
59
+ "tools": [
60
+ "./dist/tools/index.d.ts"
61
+ ],
62
+ "internal": [
63
+ "./dist/internal/index.d.ts"
64
+ ],
65
+ "api": [
66
+ "./dist/api/index.d.ts"
67
+ ],
68
+ "core/env-defaults": [
69
+ "./dist/core/env-defaults.d.ts"
70
+ ]
71
+ }
72
+ },
73
+ "dependencies": {
74
+ "glob": "^11.0.0",
75
+ "handlebars": "^4.7.8",
76
+ "js-yaml": "^4.1.0",
77
+ "remark-parse": "^11.0.0",
78
+ "remark-stringify": "^11.0.0",
79
+ "unified": "^11.0.5",
80
+ "unist-util-visit": "^5.0.0",
81
+ "nanoid": "^3.3.11",
82
+ "zod": "^3.24.1"
83
+ },
84
+ "peerDependencies": {
85
+ "@ai-sdk/anthropic": "^1.0.8",
86
+ "@ai-sdk/google": "^1.0.10",
87
+ "@ai-sdk/openai": "^1.0.11",
88
+ "@ai-sdk/openai-compatible": "^1.0.0",
89
+ "@mastra/core": "^0.24.0",
90
+ "@nestjs/common": "^11.0.0",
91
+ "@nestjs/core": "^11.0.0",
92
+ "@openrouter/ai-sdk-provider": "^1.2.2",
93
+ "ai": "^5.0.92",
94
+ "reflect-metadata": "^0.2.2",
95
+ "rxjs": "^7.8.0"
96
+ },
97
+ "peerDependenciesMeta": {
98
+ "@ai-sdk/anthropic": {
99
+ "optional": true
100
+ },
101
+ "@ai-sdk/google": {
102
+ "optional": true
103
+ },
104
+ "@ai-sdk/openai": {
105
+ "optional": true
106
+ },
107
+ "@ai-sdk/openai-compatible": {
108
+ "optional": true
109
+ },
110
+ "@mastra/core": {
111
+ "optional": true
112
+ },
113
+ "@openrouter/ai-sdk-provider": {
114
+ "optional": true
115
+ },
116
+ "ai": {
117
+ "optional": true
118
+ }
119
+ },
120
+ "publishConfig": {
121
+ "access": "public"
122
+ },
123
+ "devDependencies": {
124
+ "@ai-sdk/anthropic": "^1.0.8",
125
+ "@ai-sdk/google": "^1.0.10",
126
+ "@ai-sdk/openai": "^1.0.11",
127
+ "@ai-sdk/openai-compatible": "^1.0.0",
128
+ "@mastra/core": "^0.24.0",
129
+ "@openrouter/ai-sdk-provider": "^1.2.2",
130
+ "@types/js-yaml": "^4.0.9",
131
+ "ai": "^5.0.92",
132
+ "dotenv": "^17.2.3",
133
+ "typescript": "^5.0.0"
134
+ }
135
+ }
@@ -1,138 +1,138 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://crewx.ai/schemas/api-provider-config.json",
4
- "title": "CrewX API Provider Configuration",
5
- "description": "API provider configuration for CrewX agents (OpenAI, Anthropic, Google, Bedrock, LiteLLM, Ollama, SowonAI)",
6
- "type": "object",
7
- "additionalProperties": false,
8
- "required": ["provider", "model"],
9
- "properties": {
10
- "provider": {
11
- "type": "string",
12
- "enum": [
13
- "api/openai",
14
- "api/anthropic",
15
- "api/google",
16
- "api/bedrock",
17
- "api/litellm",
18
- "api/ollama",
19
- "api/sowonai"
20
- ],
21
- "description": "API provider identifier"
22
- },
23
- "url": {
24
- "type": "string",
25
- "format": "uri",
26
- "description": "API base URL (e.g., https://api.openai.com/v1, http://localhost:4000)"
27
- },
28
- "apiKey": {
29
- "type": "string",
30
- "description": "API key (optional, can use environment variables via {{env.VAR}} template)"
31
- },
32
- "model": {
33
- "type": "string",
34
- "description": "Model identifier understood by the provider (e.g., gpt-4o, claude-3-5-sonnet-20241022)"
35
- },
36
- "temperature": {
37
- "type": "number",
38
- "minimum": 0,
39
- "maximum": 2,
40
- "default": 0.7,
41
- "description": "Sampling temperature applied to API calls"
42
- },
43
- "maxTokens": {
44
- "type": "integer",
45
- "minimum": 1,
46
- "description": "Maximum completion tokens"
47
- },
48
- "options": {
49
- "type": "object",
50
- "description": "Mode-specific permissions. Define tools/MCP servers per execution mode (query/execute).",
51
- "properties": {
52
- "query": {
53
- "$ref": "#/$defs/providerModeOptions"
54
- },
55
- "execute": {
56
- "$ref": "#/$defs/providerModeOptions"
57
- }
58
- },
59
- "additionalProperties": {
60
- "$ref": "#/$defs/providerModeOptions"
61
- }
62
- },
63
- "tools": {
64
- "type": "array",
65
- "items": {
66
- "type": "string"
67
- },
68
- "uniqueItems": true,
69
- "description": "Legacy root-level tool list (SowonFlow style). Prefer options.<mode>.tools instead."
70
- },
71
- "mcp": {
72
- "type": "array",
73
- "items": {
74
- "type": "string"
75
- },
76
- "uniqueItems": true,
77
- "description": "Legacy root-level MCP reference list. Prefer options.<mode>.mcp instead."
78
- },
79
- "mcp_servers": {
80
- "type": "array",
81
- "items": {
82
- "type": "string"
83
- },
84
- "uniqueItems": true,
85
- "description": "Legacy alias for MCP references (mirrors SowonFlow snake_case). Prefer options.<mode>.mcp instead."
86
- }
87
- },
88
- "$defs": {
89
- "providerModeOptions": {
90
- "type": "object",
91
- "description": "Mode-specific permissions for tools and MCP servers",
92
- "additionalProperties": false,
93
- "properties": {
94
- "tools": {
95
- "type": "array",
96
- "items": {
97
- "type": "string"
98
- },
99
- "uniqueItems": true,
100
- "description": "Tool names enabled in this mode"
101
- },
102
- "mcp": {
103
- "type": "array",
104
- "items": {
105
- "type": "string"
106
- },
107
- "uniqueItems": true,
108
- "description": "MCP server references enabled in this mode"
109
- }
110
- }
111
- },
112
- "mcpServerConfig": {
113
- "type": "object",
114
- "description": "Model Context Protocol server process definition",
115
- "required": ["command", "args"],
116
- "properties": {
117
- "command": {
118
- "type": "string",
119
- "description": "Executable to launch the MCP server (e.g., npx, node)"
120
- },
121
- "args": {
122
- "type": "array",
123
- "items": {
124
- "type": "string"
125
- },
126
- "description": "Arguments passed to the command"
127
- },
128
- "env": {
129
- "type": "object",
130
- "additionalProperties": {
131
- "type": "string"
132
- },
133
- "description": "Environment variables injected when spawning the server (supports {{env.VAR}} template)"
134
- }
135
- }
136
- }
137
- }
138
- }
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://crewx.ai/schemas/api-provider-config.json",
4
+ "title": "CrewX API Provider Configuration",
5
+ "description": "API provider configuration for CrewX agents (OpenAI, Anthropic, Google, Bedrock, LiteLLM, Ollama, SowonAI)",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["provider", "model"],
9
+ "properties": {
10
+ "provider": {
11
+ "type": "string",
12
+ "enum": [
13
+ "api/openai",
14
+ "api/anthropic",
15
+ "api/google",
16
+ "api/bedrock",
17
+ "api/litellm",
18
+ "api/ollama",
19
+ "api/sowonai"
20
+ ],
21
+ "description": "API provider identifier"
22
+ },
23
+ "url": {
24
+ "type": "string",
25
+ "format": "uri",
26
+ "description": "API base URL (e.g., https://api.openai.com/v1, http://localhost:4000)"
27
+ },
28
+ "apiKey": {
29
+ "type": "string",
30
+ "description": "API key (optional, can use environment variables via {{env.VAR}} template)"
31
+ },
32
+ "model": {
33
+ "type": "string",
34
+ "description": "Model identifier understood by the provider (e.g., gpt-4o, claude-3-5-sonnet-20241022)"
35
+ },
36
+ "temperature": {
37
+ "type": "number",
38
+ "minimum": 0,
39
+ "maximum": 2,
40
+ "default": 0.7,
41
+ "description": "Sampling temperature applied to API calls"
42
+ },
43
+ "maxTokens": {
44
+ "type": "integer",
45
+ "minimum": 1,
46
+ "description": "Maximum completion tokens"
47
+ },
48
+ "options": {
49
+ "type": "object",
50
+ "description": "Mode-specific permissions. Define tools/MCP servers per execution mode (query/execute).",
51
+ "properties": {
52
+ "query": {
53
+ "$ref": "#/$defs/providerModeOptions"
54
+ },
55
+ "execute": {
56
+ "$ref": "#/$defs/providerModeOptions"
57
+ }
58
+ },
59
+ "additionalProperties": {
60
+ "$ref": "#/$defs/providerModeOptions"
61
+ }
62
+ },
63
+ "tools": {
64
+ "type": "array",
65
+ "items": {
66
+ "type": "string"
67
+ },
68
+ "uniqueItems": true,
69
+ "description": "Legacy root-level tool list (SowonFlow style). Prefer options.<mode>.tools instead."
70
+ },
71
+ "mcp": {
72
+ "type": "array",
73
+ "items": {
74
+ "type": "string"
75
+ },
76
+ "uniqueItems": true,
77
+ "description": "Legacy root-level MCP reference list. Prefer options.<mode>.mcp instead."
78
+ },
79
+ "mcp_servers": {
80
+ "type": "array",
81
+ "items": {
82
+ "type": "string"
83
+ },
84
+ "uniqueItems": true,
85
+ "description": "Legacy alias for MCP references (mirrors SowonFlow snake_case). Prefer options.<mode>.mcp instead."
86
+ }
87
+ },
88
+ "$defs": {
89
+ "providerModeOptions": {
90
+ "type": "object",
91
+ "description": "Mode-specific permissions for tools and MCP servers",
92
+ "additionalProperties": false,
93
+ "properties": {
94
+ "tools": {
95
+ "type": "array",
96
+ "items": {
97
+ "type": "string"
98
+ },
99
+ "uniqueItems": true,
100
+ "description": "Tool names enabled in this mode"
101
+ },
102
+ "mcp": {
103
+ "type": "array",
104
+ "items": {
105
+ "type": "string"
106
+ },
107
+ "uniqueItems": true,
108
+ "description": "MCP server references enabled in this mode"
109
+ }
110
+ }
111
+ },
112
+ "mcpServerConfig": {
113
+ "type": "object",
114
+ "description": "Model Context Protocol server process definition",
115
+ "required": ["command", "args"],
116
+ "properties": {
117
+ "command": {
118
+ "type": "string",
119
+ "description": "Executable to launch the MCP server (e.g., npx, node)"
120
+ },
121
+ "args": {
122
+ "type": "array",
123
+ "items": {
124
+ "type": "string"
125
+ },
126
+ "description": "Arguments passed to the command"
127
+ },
128
+ "env": {
129
+ "type": "object",
130
+ "additionalProperties": {
131
+ "type": "string"
132
+ },
133
+ "description": "Environment variables injected when spawning the server (supports {{env.VAR}} template)"
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }