@karmaniverous/jeeves 0.1.4 → 0.1.5
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/dist/index.d.ts +7 -2
- package/dist/index.js +12 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -188,10 +188,15 @@ declare function createComponentWriter(component: JeevesComponent, options?: Cre
|
|
|
188
188
|
*
|
|
189
189
|
* @remarks
|
|
190
190
|
* Tries three sources in order:
|
|
191
|
-
* 1. `api.
|
|
192
|
-
* 2. `api.
|
|
191
|
+
* 1. `api.config.agents.defaults.workspace` — explicit config (most authoritative)
|
|
192
|
+
* 2. `api.resolvePath('.')` — gateway-provided path resolver
|
|
193
193
|
* 3. `process.cwd()` — last resort (unsafe when gateway runs from system32)
|
|
194
194
|
*
|
|
195
|
+
* The config value is checked first because `api.resolvePath('.')` delegates
|
|
196
|
+
* to `path.resolve('.')`, which returns `process.cwd()` — not the workspace.
|
|
197
|
+
* When the gateway runs as a Windows service from `C:\Windows\system32`,
|
|
198
|
+
* `resolvePath('.')` returns system32, not the configured workspace.
|
|
199
|
+
*
|
|
195
200
|
* Plugins should call this once at registration time and pass the result
|
|
196
201
|
* to `init({ workspacePath })`.
|
|
197
202
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1611,10 +1611,15 @@ function createComponentWriter(component, options) {
|
|
|
1611
1611
|
*
|
|
1612
1612
|
* @remarks
|
|
1613
1613
|
* Tries three sources in order:
|
|
1614
|
-
* 1. `api.
|
|
1615
|
-
* 2. `api.
|
|
1614
|
+
* 1. `api.config.agents.defaults.workspace` — explicit config (most authoritative)
|
|
1615
|
+
* 2. `api.resolvePath('.')` — gateway-provided path resolver
|
|
1616
1616
|
* 3. `process.cwd()` — last resort (unsafe when gateway runs from system32)
|
|
1617
1617
|
*
|
|
1618
|
+
* The config value is checked first because `api.resolvePath('.')` delegates
|
|
1619
|
+
* to `path.resolve('.')`, which returns `process.cwd()` — not the workspace.
|
|
1620
|
+
* When the gateway runs as a Windows service from `C:\Windows\system32`,
|
|
1621
|
+
* `resolvePath('.')` returns system32, not the configured workspace.
|
|
1622
|
+
*
|
|
1618
1623
|
* Plugins should call this once at registration time and pass the result
|
|
1619
1624
|
* to `init({ workspacePath })`.
|
|
1620
1625
|
*/
|
|
@@ -1625,15 +1630,15 @@ function createComponentWriter(component, options) {
|
|
|
1625
1630
|
* @returns Absolute path to the workspace root.
|
|
1626
1631
|
*/
|
|
1627
1632
|
function resolveWorkspacePath(api) {
|
|
1628
|
-
// 1.
|
|
1629
|
-
if (typeof api.resolvePath === 'function') {
|
|
1630
|
-
return api.resolvePath('.');
|
|
1631
|
-
}
|
|
1632
|
-
// 2. OpenClaw config value
|
|
1633
|
+
// 1. Explicit config value (most authoritative)
|
|
1633
1634
|
const configured = api.config?.agents?.defaults?.workspace;
|
|
1634
1635
|
if (typeof configured === 'string' && configured.trim()) {
|
|
1635
1636
|
return configured;
|
|
1636
1637
|
}
|
|
1638
|
+
// 2. Gateway-provided path resolver
|
|
1639
|
+
if (typeof api.resolvePath === 'function') {
|
|
1640
|
+
return api.resolvePath('.');
|
|
1641
|
+
}
|
|
1637
1642
|
// 3. Last resort — unsafe when gateway runs from system32
|
|
1638
1643
|
return process.cwd();
|
|
1639
1644
|
}
|
package/package.json
CHANGED