negotium 0.1.24 → 0.1.26

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 (47) hide show
  1. package/README.md +5 -2
  2. package/dist/agent-helpers.js +64 -8
  3. package/dist/agent-helpers.js.map +9 -9
  4. package/dist/background-bash.js.map +1 -1
  5. package/dist/chunk-7azk83mw.js.map +1 -1
  6. package/dist/cron.js +161 -50
  7. package/dist/cron.js.map +20 -19
  8. package/dist/hosted-agent.js +2 -2
  9. package/dist/hosted-agent.js.map +5 -5
  10. package/dist/main.js +321 -130
  11. package/dist/main.js.map +23 -22
  12. package/dist/mcp-factories.js.map +1 -1
  13. package/dist/prompts.js +22 -2
  14. package/dist/prompts.js.map +4 -4
  15. package/dist/registry.js +8 -3
  16. package/dist/registry.js.map +3 -3
  17. package/dist/runtime/src/agents/api-topic-agent-switch.ts +8 -2
  18. package/dist/runtime/src/agents/auth-check.ts +33 -3
  19. package/dist/runtime/src/agents/idle-archiver.ts +20 -1
  20. package/dist/runtime/src/agents/maestro-provider.ts +2 -1
  21. package/dist/runtime/src/agents/maestro-registry.ts +11 -6
  22. package/dist/runtime/src/agents/mcp-tools/spawn-subagent.ts +16 -10
  23. package/dist/runtime/src/agents/model-catalog.ts +47 -5
  24. package/dist/runtime/src/agents/public-helpers.ts +2 -0
  25. package/dist/runtime/src/agents/self-config-core.ts +17 -5
  26. package/dist/runtime/src/agents/topic-agent-switch.ts +4 -2
  27. package/dist/runtime/src/application/switch-topic-model.ts +3 -0
  28. package/dist/runtime/src/index.ts +1 -1
  29. package/dist/runtime/src/platform/playwright/headed-launch.ts +61 -0
  30. package/dist/runtime/src/platform/playwright/manager.ts +39 -9
  31. package/dist/runtime/src/runtime/errors.ts +2 -2
  32. package/dist/runtime/src/topics/derive.ts +7 -3
  33. package/dist/runtime/src/topics/session.ts +45 -1
  34. package/dist/runtime/src/types.ts +1 -1
  35. package/dist/runtime/src/version.ts +1 -1
  36. package/dist/runtime-helpers.js.map +1 -1
  37. package/dist/storage.js.map +1 -1
  38. package/dist/types/packages/core/src/agents/auth-check.d.ts +2 -0
  39. package/dist/types/packages/core/src/agents/idle-archiver.d.ts +4 -0
  40. package/dist/types/packages/core/src/agents/maestro-provider.d.ts +2 -1
  41. package/dist/types/packages/core/src/agents/maestro-registry.d.ts +3 -5
  42. package/dist/types/packages/core/src/agents/model-catalog.d.ts +5 -1
  43. package/dist/types/packages/core/src/agents/public-helpers.d.ts +2 -1
  44. package/dist/types/packages/core/src/types.d.ts +1 -1
  45. package/dist/types/packages/core/src/version.d.ts +1 -1
  46. package/dist/vault.js.map +1 -1
  47. package/package.json +2 -2
package/README.md CHANGED
@@ -4,6 +4,8 @@ The one-command installer for the complete Negotium multi-agent node. The packag
4
4
  runtime, MCP services, Cron module, and first-party Terminal, Telegram, and Otium adapters.
5
5
 
6
6
  Requires Bun 1.2.15 or newer on macOS or Linux, plus credentials for Claude, Codex, or Maestro.
7
+ Linux hosts without `DISPLAY` or `WAYLAND_DISPLAY` also require Xvfb (`xvfb-run`) for browser
8
+ tools.
7
9
 
8
10
  ```bash
9
11
  npm install --global negotium
@@ -19,8 +21,9 @@ negotium -v
19
21
  ```
20
22
 
21
23
  Authenticate Claude with `claude`, Codex with `codex login`, or Maestro with
22
- `DEEPSEEK_API_KEY`. See the [main repository](https://github.com/maestrojeong/negotium) for
23
- configuration, security guidance, and architecture.
24
+ `DEEPSEEK_API_KEY` for DeepSeek or `MOONSHOT_API_KEY` for Kimi. See the
25
+ [main repository](https://github.com/maestrojeong/negotium) for configuration, security guidance,
26
+ and architecture.
24
27
 
25
28
  ## Hosted execution API
26
29
 
@@ -301,15 +301,33 @@ function checkAgentAuth(agent, host = defaultAgentAuthHost) {
301
301
  };
302
302
  }
303
303
  case "maestro": {
304
- if (host.environment.DEEPSEEK_API_KEY)
304
+ if (host.environment.DEEPSEEK_API_KEY || host.environment.MOONSHOT_API_KEY) {
305
305
  return { ok: true };
306
+ }
306
307
  return {
307
308
  ok: false,
308
- error: "maestro is not authenticated (DEEPSEEK_API_KEY env var not set)"
309
+ error: "maestro is not authenticated (neither DEEPSEEK_API_KEY nor MOONSHOT_API_KEY env var is set)"
309
310
  };
310
311
  }
311
312
  }
312
313
  }
314
+ function checkAgentModelAuth(agent, model, host = defaultAgentAuthHost) {
315
+ if (agent !== "maestro")
316
+ return checkAgentAuth(agent, host);
317
+ if (model.startsWith("kimi")) {
318
+ return host.environment.MOONSHOT_API_KEY ? { ok: true } : {
319
+ ok: false,
320
+ error: `maestro is not authenticated for model '${model}' (MOONSHOT_API_KEY env var not set)`
321
+ };
322
+ }
323
+ if (model.startsWith("deepseek")) {
324
+ return host.environment.DEEPSEEK_API_KEY ? { ok: true } : {
325
+ ok: false,
326
+ error: `maestro is not authenticated for model '${model}' (DEEPSEEK_API_KEY env var not set)`
327
+ };
328
+ }
329
+ return checkAgentAuth(agent, host);
330
+ }
313
331
  // ../../packages/core/src/agents/codex-tree-kill.ts
314
332
  import { execFileSync as execFileSync2 } from "child_process";
315
333
 
@@ -1672,10 +1690,15 @@ import {
1672
1690
  setConversationReader,
1673
1691
  maestroRegistry as upstreamMaestroRegistry
1674
1692
  } from "maestro-agent-sdk";
1693
+ var DISABLED_MODEL_ALIASES = new Set(["deepseek", "deepseek-flash", "deepseek-v4-flash"]);
1694
+ var upstream = upstreamMaestroRegistry;
1675
1695
  setConversationReader(readConversation);
1676
1696
  var maestroRegistry = {
1677
- ...upstreamMaestroRegistry,
1678
- defaultModel: "deepseek-pro"
1697
+ ...upstream,
1698
+ defaultModel: "deepseek-pro",
1699
+ validateModel(model) {
1700
+ return !DISABLED_MODEL_ALIASES.has(model) && upstream.validateModel(model);
1701
+ }
1679
1702
  };
1680
1703
 
1681
1704
  // ../../packages/core/src/agents/registry.ts
@@ -3315,7 +3338,7 @@ import { createRequire } from "module";
3315
3338
  import { dirname as dirname6, join as join11 } from "path";
3316
3339
 
3317
3340
  // ../../packages/core/src/version.ts
3318
- var NEGOTIUM_VERSION = "0.1.24";
3341
+ var NEGOTIUM_VERSION = "0.1.26";
3319
3342
 
3320
3343
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
3321
3344
  var NEGOTIUM_MODEL_CATALOG = "negotium-model-catalog.json";
@@ -4481,6 +4504,26 @@ var SELECTABLE_MODELS = [
4481
4504
  marginalTokenCost: "Claude API/extra usage introductory rate: $2/M input, $2.50/M cache write, $0.20/M cache read, $10/M output through 2026-08-31; then $3/M input and $15/M output",
4482
4505
  estimatedUsage: `${CLAUDE_COMMUNITY_SESSION}; Sonnet also has a separate weekly allowance and normally provides the highest Claude throughput. No stable weekly token cap is published.`
4483
4506
  },
4507
+ {
4508
+ model: "kimi-k3",
4509
+ agent: "maestro",
4510
+ description: "Frontier Kimi route for long-horizon coding and knowledge work.",
4511
+ intelligenceTier: "fable",
4512
+ routingSummary: "frontier general/coding route; 1M context; highest Maestro API cost",
4513
+ accessCost: "Moonshot AI pay-as-you-go API; no monthly subscription required",
4514
+ marginalTokenCost: "Kimi API: $3/M cache-miss input, $0.30/M cached input, $15/M output",
4515
+ estimatedUsage: "No subscription token cap; pay per token. Supports a 1M-token context window."
4516
+ },
4517
+ {
4518
+ model: "kimi-k2.7-code",
4519
+ agent: "maestro",
4520
+ description: "Coding-specialized Kimi route for repository-scale, long-horizon work.",
4521
+ intelligenceTier: "opus",
4522
+ routingSummary: "coding-specialized route; 256K context; cheaper than Kimi K3",
4523
+ accessCost: "Moonshot AI pay-as-you-go API; no monthly subscription required",
4524
+ marginalTokenCost: "Kimi API: $0.95/M cache-miss input, $0.19/M cached input, $4/M output",
4525
+ estimatedUsage: "No subscription token cap; pay per token. Always uses thinking and supports a 256K context window."
4526
+ },
4484
4527
  {
4485
4528
  model: "deepseek-pro",
4486
4529
  agent: "maestro",
@@ -5463,6 +5506,7 @@ ${rolled.join(`
5463
5506
  }
5464
5507
 
5465
5508
  // ../../packages/core/src/agents/memory-archive-policy.ts
5509
+ var MIN_MEMORY_ARCHIVE_EXCHANGES = 6;
5466
5510
  function countMemoryArchiveExchanges(rows) {
5467
5511
  let waitingForAssistant = false;
5468
5512
  let completed = 0;
@@ -6217,7 +6261,17 @@ function archiveActiveTopicForMemory(topicId, userId, options) {
6217
6261
  archivePath: job.archivePath,
6218
6262
  messageCount: job.messageCount,
6219
6263
  mode: "active-topic",
6220
- onSettled: (success) => settleTopicArchiveJob(topicId, job.archivePath, success)
6264
+ onSettled: (success) => {
6265
+ let settled = false;
6266
+ try {
6267
+ (options.settleArchiveJob ?? settleTopicArchiveJob)(topicId, job.archivePath, success);
6268
+ settled = true;
6269
+ } catch (err) {
6270
+ logger.warn({ err, topicId, archive: job.archivePath }, "topic-memory-archiver: failed to settle archive job");
6271
+ } finally {
6272
+ options.onSettled?.(settled && success);
6273
+ }
6274
+ }
6221
6275
  });
6222
6276
  if (!launched) {
6223
6277
  settleTopicArchiveJob(topicId, job.archivePath, false);
@@ -6354,11 +6408,13 @@ export {
6354
6408
  createCodexTreeManager,
6355
6409
  createAgentForkHelpers,
6356
6410
  cleanupAgentFork,
6411
+ checkAgentModelAuth,
6357
6412
  checkAgentAuth,
6358
6413
  archiveActiveTopicForMemory,
6359
6414
  acquireCodexSpawnLock,
6360
6415
  VISUALS_MCP_KEY,
6361
- VAULT_BROKER_REDIRECT_ERROR
6416
+ VAULT_BROKER_REDIRECT_ERROR,
6417
+ MIN_MEMORY_ARCHIVE_EXCHANGES
6362
6418
  };
6363
6419
 
6364
- //# debugId=9524E348462F8E0864756E2164756E21
6420
+ //# debugId=1573196B12F24CE464756E2164756E21