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.
Files changed (32) hide show
  1. package/README.md +13 -11
  2. package/dist/src/app/{chunk-O5YHNFMH.js → chunk-W7G44EAE.js} +49 -21
  3. package/dist/src/app/{cli-confirmation-handler-2APQRKHG.js → cli-confirmation-handler-EZF6AMUS.js} +1 -1
  4. package/dist/src/app/index.js +9182 -236
  5. package/dist/src/app/{sqlite-backend-KIJZ5IP3.js → sqlite-backend-VRXGIKHQ.js} +1 -1
  6. package/dist/src/app/webui/.next/standalone/.next/BUILD_ID +1 -1
  7. package/dist/src/app/webui/.next/standalone/.next/build-manifest.json +2 -2
  8. package/dist/src/app/webui/.next/standalone/.next/prerender-manifest.json +9 -9
  9. package/dist/src/app/webui/.next/standalone/.next/required-server-files.json +1 -1
  10. package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found.html +1 -1
  11. package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found.rsc +1 -1
  12. package/dist/src/app/webui/.next/standalone/.next/server/app/index.html +1 -1
  13. package/dist/src/app/webui/.next/standalone/.next/server/app/index.rsc +1 -1
  14. package/dist/src/app/webui/.next/standalone/.next/server/app/playground.html +1 -1
  15. package/dist/src/app/webui/.next/standalone/.next/server/app/playground.rsc +1 -1
  16. package/dist/src/app/webui/.next/standalone/.next/server/pages/404.html +1 -1
  17. package/dist/src/app/webui/.next/standalone/.next/server/pages/500.html +1 -1
  18. package/dist/src/app/webui/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  19. package/dist/src/app/webui/.next/standalone/server.js +1 -1
  20. package/dist/src/core/{chunk-BGO5B3L4.js → chunk-6VYPSHEV.js} +49 -20
  21. package/dist/src/core/index.cjs +93 -79
  22. package/dist/src/core/index.d.cts +46 -9
  23. package/dist/src/core/index.d.ts +46 -9
  24. package/dist/src/core/index.js +42 -53
  25. package/dist/src/core/{sqlite-backend-RKK4WBHE.js → sqlite-backend-M2ZPSSIZ.js} +1 -1
  26. package/package.json +3 -2
  27. package/dist/src/app/chunk-M4OZIDPC.js +0 -8651
  28. package/dist/src/app/interactive-api-key-setup-V3GAACLN.js +0 -269
  29. /package/dist/src/app/webui/.next/standalone/.next/static/{H-71qcBOOk528tDEa_ldn → L4341-2-iEIknMYuTWeoz}/_buildManifest.js +0 -0
  30. /package/dist/src/app/webui/.next/standalone/.next/static/{H-71qcBOOk528tDEa_ldn → L4341-2-iEIknMYuTWeoz}/_ssgManifest.js +0 -0
  31. /package/dist/src/app/webui/.next/static/{H-71qcBOOk528tDEa_ldn → L4341-2-iEIknMYuTWeoz}/_buildManifest.js +0 -0
  32. /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://truffle-ai.github.io/dexto/api/category/typescript-sdk) for a complete guide.
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://truffle-ai.github.io/dexto/docs/category/dexto-configuration-guide) for the complete reference.
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://truffle-ai.github.io/dexto/).
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://truffle-ai.github.io/dexto/docs/guides/configuring-dexto/llm/providers)**.
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://truffle-ai.github.io/dexto/docs/guides/mcp-manager)** for the complete API reference.
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. For full documentation, visit https://github.com/truffle-ai/dexto.
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 (default: "agents/agent.yml")
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://truffle-ai.github.io/dexto/docs/getting-started/intro)** – Get up and running in minutes.
303
- * **[Configuration Guide](https://truffle-ai.github.io/dexto/docs/category/guides)** – Configure agents, LLMs, and tools.
304
- * **[Building with Dexto](https://truffle-ai.github.io/dexto/docs/category/tutorials)** – Developer guides and patterns.
305
- * **[API Reference](https://truffle-ai.github.io/dexto/api)** – REST APIs, WebSocket, and SDKs.
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, "agents", "agent.yml"),
102
+ path.join(projectRoot, DEFAULT_CONFIG_PATH),
114
103
  // Standard
115
- path.join(projectRoot, "src", "agents", "agent.yml"),
104
+ path.join(projectRoot, "src", DEFAULT_CONFIG_PATH),
116
105
  // Common
117
- path.join(projectRoot, "src", "dexto", "agents", "agent.yml"),
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 = resolveBundledScript("agents/agent.yml");
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 fs from "fs";
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
- fs.mkdirSync(logDir, { recursive: true });
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
- ConfigEnvVarError,
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
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-O5YHNFMH.js";
3
+ } from "./chunk-W7G44EAE.js";
4
4
 
5
5
  // src/app/cli/tool-confirmation/cli-confirmation-handler.ts
6
6
  import * as readline from "readline";