@twsxtd/hapi-openclaw 0.1.4 → 0.1.6
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.js +11 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -331,14 +331,18 @@ class RealOpenClawAdapter {
|
|
|
331
331
|
try {
|
|
332
332
|
const config = this.runtime.config.loadConfig();
|
|
333
333
|
const agentId = parseHapiSessionKey(action.conversationId)?.agentId ?? getDefaultAgentId();
|
|
334
|
-
const workspaceDir = this.runtime.agent.
|
|
335
|
-
|
|
334
|
+
const workspaceDir = (await this.runtime.agent.ensureAgentWorkspace({
|
|
335
|
+
dir: this.runtime.agent.resolveAgentWorkspaceDir(config, agentId)
|
|
336
|
+
})).dir;
|
|
337
|
+
const agentDir = this.runtime.agent.resolveAgentDir(config, agentId);
|
|
336
338
|
const { sessionId, sessionFile } = await ensureSessionBinding(this.runtime, action.conversationId, agentId);
|
|
337
|
-
const result = await this.runtime.agent.
|
|
339
|
+
const result = await this.runtime.agent.runEmbeddedPiAgent({
|
|
338
340
|
sessionId,
|
|
339
341
|
sessionKey: action.conversationId,
|
|
340
342
|
sessionFile,
|
|
341
343
|
workspaceDir,
|
|
344
|
+
agentDir,
|
|
345
|
+
config,
|
|
342
346
|
agentId,
|
|
343
347
|
prompt: action.text,
|
|
344
348
|
timeoutMs: this.runtime.agent.resolveAgentTimeoutMs({ cfg: config }),
|
|
@@ -2294,6 +2298,10 @@ function createPluginApp(deps) {
|
|
|
2294
2298
|
|
|
2295
2299
|
// src/index.ts
|
|
2296
2300
|
function resolveRegisteredPluginConfig(api) {
|
|
2301
|
+
const runtimeConfigured = resolvePluginConfigFromOpenClawConfig(api.runtime?.config?.loadConfig?.());
|
|
2302
|
+
if (runtimeConfigured) {
|
|
2303
|
+
return runtimeConfigured;
|
|
2304
|
+
}
|
|
2297
2305
|
const configured = resolvePluginConfigFromOpenClawConfig(api.config);
|
|
2298
2306
|
if (configured) {
|
|
2299
2307
|
return configured;
|