@nextclaw/nextclaw-engine-codex-sdk 0.3.0 → 0.3.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 (2) hide show
  1. package/dist/index.js +6 -13
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from "node:module";
2
2
  import {
3
- getApiBase,
4
- getProvider,
3
+ buildRequestedSkillsUserPrompt,
4
+ resolveProviderRuntime,
5
5
  SkillsLoader
6
6
  } from "@nextclaw/core";
7
7
  function readString(input, key) {
@@ -113,9 +113,9 @@ function readWebSearchMode(input, key) {
113
113
  return void 0;
114
114
  }
115
115
  function resolveEngineConfig(config, model, engineConfig) {
116
- const provider = getProvider(config, model);
117
- const apiKey = readString(engineConfig, "apiKey") ?? provider?.apiKey ?? void 0;
118
- const apiBase = readString(engineConfig, "apiBase") ?? getApiBase(config, model) ?? void 0;
116
+ const resolvedProviderRuntime = resolveProviderRuntime(config, model);
117
+ const apiKey = readString(engineConfig, "apiKey") ?? resolvedProviderRuntime.apiKey ?? void 0;
118
+ const apiBase = readString(engineConfig, "apiBase") ?? resolvedProviderRuntime.apiBase ?? void 0;
119
119
  return { apiKey, apiBase };
120
120
  }
121
121
  const require2 = createRequire(import.meta.url);
@@ -170,14 +170,7 @@ class PluginCodexSdkEngine {
170
170
  }
171
171
  const userEvent = this.options.sessionManager.addMessage(session, "user", params.content, userExtra);
172
172
  params.onSessionEvent?.(userEvent);
173
- const requestedSkillsContent = this.skillsLoader.loadSkillsForContext(requestedSkills);
174
- const prompt = requestedSkillsContent.trim().length > 0 ? [
175
- "## Requested Skills",
176
- "Use the following selected skills for this turn:",
177
- requestedSkillsContent,
178
- "## User Message",
179
- params.content
180
- ].join("\n\n") : params.content;
173
+ const prompt = buildRequestedSkillsUserPrompt(this.skillsLoader, requestedSkills, params.content);
181
174
  const thread = await this.resolveThread(sessionKey, model);
182
175
  const streamed = await thread.runStreamed(prompt, {
183
176
  ...params.abortSignal ? { signal: params.abortSignal } : {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/nextclaw-engine-codex-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "private": false,
5
5
  "description": "NextClaw Codex engine plugin backed by OpenAI Codex SDK.",
6
6
  "type": "module",
@@ -22,7 +22,7 @@
22
22
  ]
23
23
  },
24
24
  "dependencies": {
25
- "@nextclaw/core": "^0.9.0",
25
+ "@nextclaw/core": "^0.9.12",
26
26
  "@openai/codex-sdk": "^0.107.0"
27
27
  },
28
28
  "devDependencies": {