dexto 1.0.1 → 1.0.2
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/README.md +13 -11
- package/dist/src/app/{chunk-O5YHNFMH.js → chunk-W7G44EAE.js} +49 -21
- package/dist/src/app/{cli-confirmation-handler-2APQRKHG.js → cli-confirmation-handler-EZF6AMUS.js} +1 -1
- package/dist/src/app/index.js +9182 -236
- package/dist/src/app/{sqlite-backend-KIJZ5IP3.js → sqlite-backend-VRXGIKHQ.js} +1 -1
- package/dist/src/app/webui/.next/standalone/.next/BUILD_ID +1 -1
- package/dist/src/app/webui/.next/standalone/.next/build-manifest.json +2 -2
- package/dist/src/app/webui/.next/standalone/.next/prerender-manifest.json +9 -9
- package/dist/src/app/webui/.next/standalone/.next/required-server-files.json +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/index.html +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/index.rsc +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground.html +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground.rsc +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/pages/404.html +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/pages/500.html +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/src/app/webui/.next/standalone/server.js +1 -1
- package/dist/src/core/{chunk-BGO5B3L4.js → chunk-6VYPSHEV.js} +49 -20
- package/dist/src/core/index.cjs +93 -79
- package/dist/src/core/index.d.cts +46 -9
- package/dist/src/core/index.d.ts +46 -9
- package/dist/src/core/index.js +42 -53
- package/dist/src/core/{sqlite-backend-RKK4WBHE.js → sqlite-backend-M2ZPSSIZ.js} +1 -1
- package/package.json +3 -2
- package/dist/src/app/chunk-M4OZIDPC.js +0 -8651
- package/dist/src/app/interactive-api-key-setup-V3GAACLN.js +0 -269
- /package/dist/src/app/webui/.next/standalone/.next/static/{H-71qcBOOk528tDEa_ldn → L4341-2-iEIknMYuTWeoz}/_buildManifest.js +0 -0
- /package/dist/src/app/webui/.next/standalone/.next/static/{H-71qcBOOk528tDEa_ldn → L4341-2-iEIknMYuTWeoz}/_ssgManifest.js +0 -0
- /package/dist/src/app/webui/.next/static/{H-71qcBOOk528tDEa_ldn → L4341-2-iEIknMYuTWeoz}/_buildManifest.js +0 -0
- /package/dist/src/app/webui/.next/static/{H-71qcBOOk528tDEa_ldn → L4341-2-iEIknMYuTWeoz}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -134,7 +134,7 @@ await agent.stop();
|
|
|
134
134
|
|
|
135
135
|
Everything in the CLI is powered by this same class—so whatever the CLI can do, your code can too.
|
|
136
136
|
|
|
137
|
-
Check out our [Typescript SDK docs](https://
|
|
137
|
+
Check out our [Typescript SDK docs](https://docs.dexto.ai/api/category/typescript-sdk) for a complete guide.
|
|
138
138
|
|
|
139
139
|
---
|
|
140
140
|
|
|
@@ -164,7 +164,7 @@ systemPrompt: |
|
|
|
164
164
|
|
|
165
165
|
Change the file, reload the agent, and chat—the conversation state, memory, and tools will update.
|
|
166
166
|
|
|
167
|
-
Check out our [Configuration guide](https://
|
|
167
|
+
Check out our [Configuration guide](https://docs.dexto.ai/category/dexto-configuration-guide) for the complete reference.
|
|
168
168
|
|
|
169
169
|
---
|
|
170
170
|
|
|
@@ -188,7 +188,7 @@ dexto --agent ./agents/examples/email_slack.yml
|
|
|
188
188
|
```
|
|
189
189
|
<img src="assets/email_slack_demo.gif" alt="Email to Slack Demo" width="600">
|
|
190
190
|
|
|
191
|
-
More ready-to-run recipes live in [`agents/examples`](agents/examples) and the [docs site](https://
|
|
191
|
+
More ready-to-run recipes live in [`agents/examples`](agents/examples) and the [docs site](https://docs.dexto.ai/).
|
|
192
192
|
|
|
193
193
|
---
|
|
194
194
|
|
|
@@ -227,7 +227,7 @@ dexto -m claude-3.5-sonnet-20240620
|
|
|
227
227
|
dexto -m gemini-1.5-flash-latest
|
|
228
228
|
```
|
|
229
229
|
|
|
230
|
-
For comprehensive setup instructions, see our **[LLM Providers Guide](https://
|
|
230
|
+
For comprehensive setup instructions, see our **[LLM Providers Guide](https://docs.dexto.ai/guides/configuring-dexto/llm/providers)**.
|
|
231
231
|
|
|
232
232
|
---
|
|
233
233
|
|
|
@@ -260,7 +260,7 @@ console.log('File contents:', result);
|
|
|
260
260
|
await manager.disconnectAll();
|
|
261
261
|
```
|
|
262
262
|
|
|
263
|
-
See the **[MCP Manager Documentation](https://
|
|
263
|
+
See the **[MCP Manager Documentation](https://docs.dexto.ai/guides/mcp-manager)** for the complete API reference.
|
|
264
264
|
|
|
265
265
|
---
|
|
266
266
|
|
|
@@ -272,14 +272,16 @@ See the **[MCP Manager Documentation](https://truffle-ai.github.io/dexto/docs/gu
|
|
|
272
272
|
```
|
|
273
273
|
Usage: dexto [options] [command] [prompt...]
|
|
274
274
|
|
|
275
|
-
The Dexto CLI allows you to talk to Dexto, build custom AI Agents, and create complex AI applications.
|
|
275
|
+
The Dexto CLI allows you to talk to Dexto, build custom AI Agents, and create complex AI applications.
|
|
276
|
+
|
|
277
|
+
For full documentation, visit https://docs.dexto.ai.
|
|
276
278
|
|
|
277
279
|
Arguments:
|
|
278
280
|
prompt Natural-language prompt to run once. If empty, starts interactive CLI.
|
|
279
281
|
|
|
280
282
|
Options:
|
|
281
283
|
-v, --version output the current version
|
|
282
|
-
-a, --agent <path> Path to agent config file
|
|
284
|
+
-a, --agent <path> Path to agent config file
|
|
283
285
|
-s, --strict Require all server connections to succeed
|
|
284
286
|
--no-verbose Disable verbose output
|
|
285
287
|
-m, --model <model> Specify the LLM model to use.
|
|
@@ -299,10 +301,10 @@ Commands:
|
|
|
299
301
|
|
|
300
302
|
## Next Steps
|
|
301
303
|
|
|
302
|
-
* **[Quick Start](https://
|
|
303
|
-
* **[Configuration Guide](https://
|
|
304
|
-
* **[Building with Dexto](https://
|
|
305
|
-
* **[API Reference](https://
|
|
304
|
+
* **[Quick Start](https://docs.dexto.ai/getting-started/intro)** – Get up and running in minutes.
|
|
305
|
+
* **[Configuration Guide](https://docs.dexto.ai/category/guides)** – Configure agents, LLMs, and tools.
|
|
306
|
+
* **[Building with Dexto](https://docs.dexto.ai/category/tutorials)** – Developer guides and patterns.
|
|
307
|
+
* **[API Reference](https://docs.dexto.ai/api)** – REST APIs, WebSocket, and SDKs.
|
|
306
308
|
|
|
307
309
|
---
|
|
308
310
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/core/utils/path.ts
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import { existsSync, readFileSync } from "fs";
|
|
4
|
+
import { promises as fs } from "fs";
|
|
4
5
|
import { homedir } from "os";
|
|
5
6
|
import { createRequire } from "module";
|
|
6
7
|
|
|
@@ -46,22 +47,10 @@ var ConfigParseError = class extends ConfigurationError {
|
|
|
46
47
|
super(`Failed to parse YAML configuration: ${cause}`, configPath);
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
|
-
var ConfigEnvVarError = class extends ConfigurationError {
|
|
50
|
-
/**
|
|
51
|
-
* Creates an instance of ConfigEnvVarError.
|
|
52
|
-
* @param configPath - The path to the configuration file where the environment variable issue occurred.
|
|
53
|
-
* @param envVar - The name of the environment variable that caused the error.
|
|
54
|
-
* @param cause - Optional. A string describing the specific reason for the expansion failure (e.g., "not defined").
|
|
55
|
-
*/
|
|
56
|
-
constructor(configPath, envVar, cause) {
|
|
57
|
-
const message = cause ? `Failed to expand environment variable '${envVar}': ${cause}` : `Environment variable '${envVar}' is required but not set`;
|
|
58
|
-
super(message, configPath);
|
|
59
|
-
this.envVar = envVar;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
50
|
|
|
63
51
|
// src/core/utils/path.ts
|
|
64
52
|
var DEFAULT_CONFIG_PATH = "agents/agent.yml";
|
|
53
|
+
var USER_CONFIG_PATH = ".dexto/agent.yml";
|
|
65
54
|
function walkUpDirectories(startPath, predicate) {
|
|
66
55
|
let currentPath = path.resolve(startPath);
|
|
67
56
|
const rootPath = path.parse(currentPath).root;
|
|
@@ -110,11 +99,11 @@ function resolveConfigPath(configPath, startPath) {
|
|
|
110
99
|
const projectRoot = getDextoProjectRoot(startPath);
|
|
111
100
|
if (projectRoot) {
|
|
112
101
|
const configPaths = [
|
|
113
|
-
path.join(projectRoot,
|
|
102
|
+
path.join(projectRoot, DEFAULT_CONFIG_PATH),
|
|
114
103
|
// Standard
|
|
115
|
-
path.join(projectRoot, "src",
|
|
104
|
+
path.join(projectRoot, "src", DEFAULT_CONFIG_PATH),
|
|
116
105
|
// Common
|
|
117
|
-
path.join(projectRoot, "src", "dexto",
|
|
106
|
+
path.join(projectRoot, "src", "dexto", DEFAULT_CONFIG_PATH),
|
|
118
107
|
// Test app structure
|
|
119
108
|
path.join(projectRoot, ".dexto", "agent.yml"),
|
|
120
109
|
// Hidden
|
|
@@ -130,8 +119,12 @@ function resolveConfigPath(configPath, startPath) {
|
|
|
130
119
|
`No agent.yml found in project. Searched: ${configPaths.join(", ")}`
|
|
131
120
|
);
|
|
132
121
|
} else {
|
|
122
|
+
const userConfigPath = getUserConfigPath();
|
|
123
|
+
if (existsSync(userConfigPath)) {
|
|
124
|
+
return userConfigPath;
|
|
125
|
+
}
|
|
133
126
|
try {
|
|
134
|
-
const bundledConfigPath =
|
|
127
|
+
const bundledConfigPath = getBundledConfigPath();
|
|
135
128
|
if (existsSync(bundledConfigPath)) {
|
|
136
129
|
return bundledConfigPath;
|
|
137
130
|
}
|
|
@@ -162,12 +155,43 @@ function resolveBundledScript(scriptPath) {
|
|
|
162
155
|
return path.resolve(packageRoot, scriptPath);
|
|
163
156
|
}
|
|
164
157
|
}
|
|
158
|
+
async function ensureDextoGlobalDirectory() {
|
|
159
|
+
const dextoDir = path.join(homedir(), ".dexto");
|
|
160
|
+
try {
|
|
161
|
+
await fs.mkdir(dextoDir, { recursive: true });
|
|
162
|
+
} catch (error) {
|
|
163
|
+
if (error.code !== "EEXIST") {
|
|
164
|
+
throw error;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function getDextoEnvPath(startPath = process.cwd()) {
|
|
169
|
+
const projectRoot = getDextoProjectRoot(startPath);
|
|
170
|
+
if (projectRoot) {
|
|
171
|
+
return path.join(projectRoot, ".env");
|
|
172
|
+
} else {
|
|
173
|
+
return path.join(homedir(), ".dexto", ".env");
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function getUserConfigPath() {
|
|
177
|
+
return path.join(homedir(), USER_CONFIG_PATH);
|
|
178
|
+
}
|
|
179
|
+
function getBundledConfigPath() {
|
|
180
|
+
return resolveBundledScript(DEFAULT_CONFIG_PATH);
|
|
181
|
+
}
|
|
182
|
+
function isUsingBundledConfig(configPath) {
|
|
183
|
+
try {
|
|
184
|
+
return configPath === getBundledConfigPath();
|
|
185
|
+
} catch {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
165
189
|
|
|
166
190
|
// src/core/logger/logger.ts
|
|
167
191
|
import * as winston from "winston";
|
|
168
192
|
import chalk from "chalk";
|
|
169
193
|
import boxen from "boxen";
|
|
170
|
-
import * as
|
|
194
|
+
import * as fs2 from "fs";
|
|
171
195
|
import * as path2 from "path";
|
|
172
196
|
var logLevels = {
|
|
173
197
|
error: 0,
|
|
@@ -258,7 +282,7 @@ var Logger = class {
|
|
|
258
282
|
try {
|
|
259
283
|
if (this.logFilePath) {
|
|
260
284
|
const logDir = path2.dirname(this.logFilePath);
|
|
261
|
-
|
|
285
|
+
fs2.mkdirSync(logDir, { recursive: true });
|
|
262
286
|
transports2.push(
|
|
263
287
|
new winston.transports.File({
|
|
264
288
|
filename: this.logFilePath,
|
|
@@ -425,11 +449,15 @@ export {
|
|
|
425
449
|
ConfigFileNotFoundError,
|
|
426
450
|
ConfigFileReadError,
|
|
427
451
|
ConfigParseError,
|
|
428
|
-
|
|
429
|
-
DEFAULT_CONFIG_PATH,
|
|
452
|
+
getDextoProjectRoot,
|
|
430
453
|
getDextoPath,
|
|
431
454
|
resolveConfigPath,
|
|
432
455
|
findPackageRoot,
|
|
433
456
|
resolveBundledScript,
|
|
457
|
+
ensureDextoGlobalDirectory,
|
|
458
|
+
getDextoEnvPath,
|
|
459
|
+
getUserConfigPath,
|
|
460
|
+
getBundledConfigPath,
|
|
461
|
+
isUsingBundledConfig,
|
|
434
462
|
logger
|
|
435
463
|
};
|