@dexto/core 1.6.18 → 1.6.20

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.
@@ -147,6 +147,7 @@ class ChatSession {
147
147
  async initializeServices() {
148
148
  const runtimeConfig = this.services.stateManager.getRuntimeConfig(this.id);
149
149
  const llmConfig = runtimeConfig.llm;
150
+ const workspace = await this.services.workspaceManager?.getWorkspace();
150
151
  this.historyProvider = createDatabaseHistoryProvider(
151
152
  this.services.storageManager.getDatabase(),
152
153
  this.id,
@@ -168,7 +169,8 @@ class ChatSession {
168
169
  // Pass logger for dependency injection
169
170
  {
170
171
  usageScopeId: runtimeConfig.usageScopeId,
171
- compactionStrategy
172
+ compactionStrategy,
173
+ cwd: workspace?.path
172
174
  }
173
175
  );
174
176
  this.logger.debug(`ChatSession ${this.id}: Services initialized with storage`);
@@ -456,6 +458,7 @@ class ChatSession {
456
458
  async switchLLM(newLLMConfig) {
457
459
  try {
458
460
  const runtimeConfig = this.services.stateManager.getRuntimeConfig(this.id);
461
+ const workspace = await this.services.workspaceManager?.getWorkspace();
459
462
  const compactionStrategy = this.services.compactionStrategy;
460
463
  const newLLMService = createLLMService(
461
464
  newLLMConfig,
@@ -470,7 +473,8 @@ class ChatSession {
470
473
  this.logger,
471
474
  {
472
475
  usageScopeId: runtimeConfig.usageScopeId,
473
- compactionStrategy
476
+ compactionStrategy,
477
+ cwd: workspace?.path
474
478
  }
475
479
  );
476
480
  this.llmService = newLLMService;
@@ -99,6 +99,25 @@ function hasProjectRootMarker(dirPath) {
99
99
  (relativePath) => (0, import_fs.existsSync)(path.join(dirPath, relativePath))
100
100
  );
101
101
  }
102
+ function getForcedProjectRoot() {
103
+ const value = process.env.DEXTO_PROJECT_ROOT?.trim();
104
+ if (!value) {
105
+ return null;
106
+ }
107
+ try {
108
+ const resolved = path.resolve(value);
109
+ if (!(0, import_fs.statSync)(resolved).isDirectory()) {
110
+ return null;
111
+ }
112
+ const root = (0, import_fs.realpathSync)(resolved);
113
+ if (isDextoProjectDirectory(root) || isDextoSourceDirectory(root) || hasProjectRootMarker(root)) {
114
+ return root;
115
+ }
116
+ return null;
117
+ } catch {
118
+ return null;
119
+ }
120
+ }
102
121
  function isDextoSourceDirectory(dirPath) {
103
122
  return readPackageName(dirPath) === "dexto-monorepo";
104
123
  }
@@ -128,9 +147,16 @@ function findDextoSourceRoot(startPath = process.cwd()) {
128
147
  return (0, import_fs_walk.walkUpDirectories)(startPath, isDextoSourceDirectory);
129
148
  }
130
149
  function findDextoProjectRoot(startPath = process.cwd()) {
150
+ const forcedProjectRoot = getForcedProjectRoot();
151
+ if (forcedProjectRoot) {
152
+ return forcedProjectRoot;
153
+ }
131
154
  return (0, import_fs_walk.walkUpDirectories)(startPath, isDextoProjectDirectory);
132
155
  }
133
156
  function getExecutionContext(startPath = process.cwd()) {
157
+ if (getForcedProjectRoot()) {
158
+ return "dexto-project";
159
+ }
134
160
  if (findDextoSourceRoot(startPath)) {
135
161
  return "dexto-source";
136
162
  }
@@ -1 +1 @@
1
- {"version":3,"file":"execution-context.d.ts","sourceRoot":"","sources":["../../src/utils/execution-context.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG,eAAe,GAAG,YAAY,CAAC;AA2H/E;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,GAAE,MAAsB,GAAG,MAAM,GAAG,IAAI,CAEpF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,GAAE,MAAsB,GAAG,MAAM,GAAG,IAAI,CAErF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,GAAE,MAAsB,GAAG,gBAAgB,CAavF"}
1
+ {"version":3,"file":"execution-context.d.ts","sourceRoot":"","sources":["../../src/utils/execution-context.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG,eAAe,GAAG,YAAY,CAAC;AAsJ/E;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,GAAE,MAAsB,GAAG,MAAM,GAAG,IAAI,CAEpF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,GAAE,MAAsB,GAAG,MAAM,GAAG,IAAI,CAMrF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,GAAE,MAAsB,GAAG,gBAAgB,CAiBvF"}
@@ -1,6 +1,6 @@
1
1
  import "../chunk-PTJYTZNU.js";
2
2
  import { walkUpDirectories } from "./fs-walk.js";
3
- import { existsSync, readFileSync, readdirSync, statSync } from "fs";
3
+ import { existsSync, readFileSync, realpathSync, readdirSync, statSync } from "fs";
4
4
  import * as path from "path";
5
5
  const DIRECT_PROJECT_ROOT_MARKERS = [
6
6
  path.join(".dexto", "deploy.json"),
@@ -65,6 +65,25 @@ function hasProjectRootMarker(dirPath) {
65
65
  (relativePath) => existsSync(path.join(dirPath, relativePath))
66
66
  );
67
67
  }
68
+ function getForcedProjectRoot() {
69
+ const value = process.env.DEXTO_PROJECT_ROOT?.trim();
70
+ if (!value) {
71
+ return null;
72
+ }
73
+ try {
74
+ const resolved = path.resolve(value);
75
+ if (!statSync(resolved).isDirectory()) {
76
+ return null;
77
+ }
78
+ const root = realpathSync(resolved);
79
+ if (isDextoProjectDirectory(root) || isDextoSourceDirectory(root) || hasProjectRootMarker(root)) {
80
+ return root;
81
+ }
82
+ return null;
83
+ } catch {
84
+ return null;
85
+ }
86
+ }
68
87
  function isDextoSourceDirectory(dirPath) {
69
88
  return readPackageName(dirPath) === "dexto-monorepo";
70
89
  }
@@ -94,9 +113,16 @@ function findDextoSourceRoot(startPath = process.cwd()) {
94
113
  return walkUpDirectories(startPath, isDextoSourceDirectory);
95
114
  }
96
115
  function findDextoProjectRoot(startPath = process.cwd()) {
116
+ const forcedProjectRoot = getForcedProjectRoot();
117
+ if (forcedProjectRoot) {
118
+ return forcedProjectRoot;
119
+ }
97
120
  return walkUpDirectories(startPath, isDextoProjectDirectory);
98
121
  }
99
122
  function getExecutionContext(startPath = process.cwd()) {
123
+ if (getForcedProjectRoot()) {
124
+ return "dexto-project";
125
+ }
100
126
  if (findDextoSourceRoot(startPath)) {
101
127
  return "dexto-source";
102
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dexto/core",
3
- "version": "1.6.18",
3
+ "version": "1.6.20",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -35,7 +35,7 @@
35
35
  "@ai-sdk/openai-compatible": "^1.0.30",
36
36
  "@ai-sdk/provider": "^2.0.0",
37
37
  "@ai-sdk/xai": "^2.0.0",
38
- "@modelcontextprotocol/sdk": "^1.27.1",
38
+ "@modelcontextprotocol/sdk": "^1.28.0",
39
39
  "@openrouter/ai-sdk-provider": "^1.5.4",
40
40
  "@opentelemetry/api": "^1.9.0",
41
41
  "ai": "^5.0.0",
@@ -46,7 +46,7 @@
46
46
  "glob": "^12.0.0",
47
47
  "nanoid": "^5.1.6",
48
48
  "winston": "^3.17.0",
49
- "yaml": "^2.7.1",
49
+ "yaml": "^2.8.3",
50
50
  "zod-to-json-schema": "^3.24.6"
51
51
  },
52
52
  "devDependencies": {