@nextclaw/server 0.5.28 → 0.5.30

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 CHANGED
@@ -55,7 +55,6 @@ type AgentProfileView = {
55
55
  default?: boolean;
56
56
  workspace?: string;
57
57
  model?: string;
58
- maxTokens?: number;
59
58
  contextTokens?: number;
60
59
  maxToolIterations?: number;
61
60
  };
@@ -268,7 +267,6 @@ type ConfigView = {
268
267
  defaults: {
269
268
  model: string;
270
269
  workspace?: string;
271
- maxTokens?: number;
272
270
  contextTokens?: number;
273
271
  maxToolIterations?: number;
274
272
  };
@@ -631,7 +629,6 @@ declare function executeConfigAction(configPath: string, actionId: string, reque
631
629
  declare function loadConfigOrDefault(configPath: string): Config;
632
630
  declare function updateModel(configPath: string, patch: {
633
631
  model?: string;
634
- maxTokens?: number;
635
632
  }): ConfigView;
636
633
  declare function updateProvider(configPath: string, providerName: string, patch: ProviderConfigUpdate): ProviderConfigView | null;
637
634
  declare function createCustomProvider(configPath: string, patch?: ProviderConfigUpdate): {
package/dist/index.js CHANGED
@@ -63,6 +63,7 @@ var PREFERRED_PROVIDER_ORDER_INDEX = new Map(
63
63
  var BUILTIN_PROVIDER_NAMES = new Set(PROVIDERS.map((spec) => spec.name));
64
64
  var CUSTOM_PROVIDER_WIRE_API_OPTIONS = ["auto", "chat", "responses"];
65
65
  var CUSTOM_PROVIDER_PREFIX = "custom-";
66
+ var PROVIDER_TEST_MAX_TOKENS = 16;
66
67
  function normalizeOptionalDisplayName(value) {
67
68
  if (typeof value !== "string") {
68
69
  return null;
@@ -518,9 +519,6 @@ function updateModel(configPath, patch) {
518
519
  if (typeof patch.model === "string") {
519
520
  config.agents.defaults.model = patch.model;
520
521
  }
521
- if (typeof patch.maxTokens === "number" && Number.isFinite(patch.maxTokens)) {
522
- config.agents.defaults.maxTokens = Math.max(1, Math.trunc(patch.maxTokens));
523
- }
524
522
  const next = ConfigSchema.parse(config);
525
523
  saveConfig(next, configPath);
526
524
  return buildConfigView(next);
@@ -709,7 +707,7 @@ async function testProviderConnection(configPath, providerName, patch) {
709
707
  await probe.chat({
710
708
  model,
711
709
  messages: [{ role: "user", content: "ping" }],
712
- maxTokens: 8
710
+ maxTokens: PROVIDER_TEST_MAX_TOKENS
713
711
  });
714
712
  return {
715
713
  success: true,
@@ -2247,23 +2245,17 @@ function createUiRouter(options) {
2247
2245
  return c.json(err("INVALID_BODY", "invalid json body"), 400);
2248
2246
  }
2249
2247
  const hasModel = typeof body.data.model === "string";
2250
- const hasMaxTokens = typeof body.data.maxTokens === "number";
2251
- if (!hasModel && !hasMaxTokens) {
2252
- return c.json(err("INVALID_BODY", "model or maxTokens is required"), 400);
2248
+ if (!hasModel) {
2249
+ return c.json(err("INVALID_BODY", "model is required"), 400);
2253
2250
  }
2254
2251
  const view = updateModel(options.configPath, {
2255
- model: hasModel ? body.data.model : void 0,
2256
- maxTokens: hasMaxTokens ? body.data.maxTokens : void 0
2252
+ model: body.data.model
2257
2253
  });
2258
2254
  if (hasModel) {
2259
2255
  options.publish({ type: "config.updated", payload: { path: "agents.defaults.model" } });
2260
2256
  }
2261
- if (hasMaxTokens) {
2262
- options.publish({ type: "config.updated", payload: { path: "agents.defaults.maxTokens" } });
2263
- }
2264
2257
  return c.json(ok({
2265
- model: view.agents.defaults.model,
2266
- maxTokens: view.agents.defaults.maxTokens
2258
+ model: view.agents.defaults.model
2267
2259
  }));
2268
2260
  });
2269
2261
  app.put("/api/config/providers/:provider", async (c) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/server",
3
- "version": "0.5.28",
3
+ "version": "0.5.30",
4
4
  "private": false,
5
5
  "description": "Nextclaw UI/API server.",
6
6
  "type": "module",
@@ -15,10 +15,10 @@
15
15
  ],
16
16
  "dependencies": {
17
17
  "@hono/node-server": "^1.13.3",
18
- "@nextclaw/openclaw-compat": "^0.1.33",
18
+ "@nextclaw/openclaw-compat": "^0.1.34",
19
19
  "hono": "^4.6.2",
20
20
  "ws": "^8.18.0",
21
- "@nextclaw/core": "^0.6.44"
21
+ "@nextclaw/core": "^0.6.45"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/node": "^20.17.6",