open-multi-agent-kit 0.90.5 → 0.90.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.
Files changed (88) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +9 -9
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +1 -0
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/codexbar-cli.d.ts +39 -0
  7. package/dist/codexbar-cli.d.ts.map +1 -0
  8. package/dist/codexbar-cli.js +230 -0
  9. package/dist/codexbar-cli.js.map +1 -0
  10. package/dist/commands/doctor-provider.d.ts.map +1 -1
  11. package/dist/commands/doctor-provider.js +16 -3
  12. package/dist/commands/doctor-provider.js.map +1 -1
  13. package/dist/core/agent-session.d.ts.map +1 -1
  14. package/dist/core/agent-session.js +30 -8
  15. package/dist/core/agent-session.js.map +1 -1
  16. package/dist/core/codexbar-adapter.d.ts +44 -0
  17. package/dist/core/codexbar-adapter.d.ts.map +1 -0
  18. package/dist/core/codexbar-adapter.js +211 -0
  19. package/dist/core/codexbar-adapter.js.map +1 -0
  20. package/dist/core/compaction/index.d.ts +2 -0
  21. package/dist/core/compaction/index.d.ts.map +1 -1
  22. package/dist/core/compaction/index.js +2 -0
  23. package/dist/core/compaction/index.js.map +1 -1
  24. package/dist/core/compaction/model-policy.d.ts +9 -0
  25. package/dist/core/compaction/model-policy.d.ts.map +1 -0
  26. package/dist/core/compaction/model-policy.js +37 -0
  27. package/dist/core/compaction/model-policy.js.map +1 -0
  28. package/dist/core/compaction/resume-policy.d.ts +6 -0
  29. package/dist/core/compaction/resume-policy.d.ts.map +1 -0
  30. package/dist/core/compaction/resume-policy.js +8 -0
  31. package/dist/core/compaction/resume-policy.js.map +1 -0
  32. package/dist/core/domain-loadouts.d.ts.map +1 -1
  33. package/dist/core/domain-loadouts.js +68 -1
  34. package/dist/core/domain-loadouts.js.map +1 -1
  35. package/dist/core/extensions/loader.d.ts.map +1 -1
  36. package/dist/core/extensions/loader.js +12 -0
  37. package/dist/core/extensions/loader.js.map +1 -1
  38. package/dist/core/extensions/runner.d.ts.map +1 -1
  39. package/dist/core/extensions/runner.js +3 -0
  40. package/dist/core/extensions/runner.js.map +1 -1
  41. package/dist/core/extensions/types.d.ts +15 -0
  42. package/dist/core/extensions/types.d.ts.map +1 -1
  43. package/dist/core/extensions/types.js.map +1 -1
  44. package/dist/core/grok-harness-dispatch.d.ts +22 -0
  45. package/dist/core/grok-harness-dispatch.d.ts.map +1 -0
  46. package/dist/core/grok-harness-dispatch.js +44 -0
  47. package/dist/core/grok-harness-dispatch.js.map +1 -0
  48. package/dist/core/grok-harness.d.ts +25 -0
  49. package/dist/core/grok-harness.d.ts.map +1 -0
  50. package/dist/core/grok-harness.js +61 -0
  51. package/dist/core/grok-harness.js.map +1 -0
  52. package/dist/core/grok-playbook.d.ts +7 -0
  53. package/dist/core/grok-playbook.d.ts.map +1 -0
  54. package/dist/core/grok-playbook.js +34 -0
  55. package/dist/core/grok-playbook.js.map +1 -0
  56. package/dist/core/sdk.d.ts.map +1 -1
  57. package/dist/core/sdk.js +31 -12
  58. package/dist/core/sdk.js.map +1 -1
  59. package/dist/main.d.ts.map +1 -1
  60. package/dist/main.js +4 -0
  61. package/dist/main.js.map +1 -1
  62. package/dist/utils/tools-manager.d.ts +3 -2
  63. package/dist/utils/tools-manager.d.ts.map +1 -1
  64. package/dist/utils/tools-manager.js +42 -17
  65. package/dist/utils/tools-manager.js.map +1 -1
  66. package/docs/correctness-wall.md +117 -0
  67. package/docs/grok-harness.md +63 -0
  68. package/docs/loadout-domains/README.md +2 -1
  69. package/docs/loadout-domains/ai-agent-ops.md +8 -1
  70. package/docs/loadout-domains/grok-harness.md +74 -0
  71. package/docs/providers.md +4 -0
  72. package/examples/extensions/correctness-wall/LOADOUT.md +87 -0
  73. package/examples/extensions/correctness-wall/README.md +111 -0
  74. package/examples/extensions/correctness-wall/adjudication-fixture.ts +151 -0
  75. package/examples/extensions/correctness-wall/index.ts +470 -0
  76. package/examples/extensions/correctness-wall/repair-state.ts +77 -0
  77. package/examples/extensions/correctness-wall/wall-cache.ts +81 -0
  78. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  79. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  80. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  81. package/examples/extensions/gondolin/package-lock.json +2 -2
  82. package/examples/extensions/gondolin/package.json +1 -1
  83. package/examples/extensions/sandbox/package-lock.json +2 -2
  84. package/examples/extensions/sandbox/package.json +1 -1
  85. package/examples/extensions/with-deps/package-lock.json +2 -2
  86. package/examples/extensions/with-deps/package.json +1 -1
  87. package/npm-shrinkwrap.json +12 -12
  88. package/package.json +5 -5
@@ -23,13 +23,16 @@ import { formatNoApiKeyFoundMessage, formatNoModelSelectedMessage } from "./auth
23
23
  import { parseBangInvocation } from "./bang-skill-invocation.js";
24
24
  import { executeBashWithOperations } from "./bash-executor.js";
25
25
  import { classifyShellCommand } from "./command-safety.js";
26
- import { calculateContextTokens, collectEntriesForBranchSummary, compact, estimateContextTokens, estimateProjectedContextTokens, generateBranchSummary, prepareCompaction, shouldCompact, } from "./compaction/index.js";
26
+ import { calculateContextTokens, collectEntriesForBranchSummary, compact, estimateContextTokens, estimateProjectedContextTokens, generateBranchSummary, prepareCompaction, resolveCompactionModel, shouldCompact, } from "./compaction/index.js";
27
+ import { compactionEmitWillRetry } from "./compaction/resume-policy.js";
27
28
  import { DEFAULT_THINKING_LEVEL } from "./defaults.js";
28
29
  import { exportSessionToHtml } from "./export-html/index.js";
29
30
  import { createToolHtmlRenderer } from "./export-html/tool-renderer.js";
30
31
  import { buildBlockedBashResult, evaluateCommandGate, isCommandSafetyAssumeYesEnabled, } from "./extensions/builtin/command-safety-gate.js";
31
32
  import { ExtensionRunner, wrapRegisteredTools, } from "./extensions/index.js";
32
33
  import { emitSessionShutdownEvent } from "./extensions/runner.js";
34
+ import { assertTextChatModelForCompletion } from "./grok-harness.js";
35
+ import { grokPlaybookAppendForProvider } from "./grok-playbook.js";
33
36
  import { assertLoadoutAccess, decideLoadoutAccess } from "./loadout-access-policy.js";
34
37
  import { expandPromptTemplate } from "./prompt-templates.js";
35
38
  import { getBiasStepsForCell, getDefaultRouterBiasSnapshotPath, parseRouterBiasSnapshot, } from "./reasoning-router-bias.js";
@@ -825,7 +828,12 @@ export class AgentSession {
825
828
  }
826
829
  const loaderSystemPrompt = this._resourceLoader.getSystemPrompt();
827
830
  const loaderAppendSystemPrompt = this._resourceLoader.getAppendSystemPrompt();
828
- const appendSystemPrompt = loaderAppendSystemPrompt.length > 0 ? loaderAppendSystemPrompt.join("\n\n") : undefined;
831
+ const grokAppend = grokPlaybookAppendForProvider(this.model?.provider);
832
+ const appendParts = [...loaderAppendSystemPrompt];
833
+ if (grokAppend) {
834
+ appendParts.push(grokAppend);
835
+ }
836
+ const appendSystemPrompt = appendParts.length > 0 ? appendParts.join("\n\n") : undefined;
829
837
  const loadedSkills = this._resourceLoader.getSkills().skills;
830
838
  const loadedContextFiles = this._resourceLoader.getAgentsFiles().agentsFiles;
831
839
  this._baseSystemPromptOptions = {
@@ -960,6 +968,8 @@ export class AgentSession {
960
968
  if (!this.model) {
961
969
  throw new Error(formatNoModelSelectedMessage());
962
970
  }
971
+ // Grok OAuth: refuse Imagine ids on the chat/completions path (tool-only).
972
+ assertTextChatModelForCompletion(this.model.id, this.model.provider);
963
973
  if (!this._modelRegistry.hasConfiguredAuth(this.model)) {
964
974
  const isOAuth = this._modelRegistry.isUsingOAuth(this.model);
965
975
  if (isOAuth) {
@@ -1318,6 +1328,8 @@ export class AgentSession {
1318
1328
  if (!this._modelRegistry.hasConfiguredAuth(model)) {
1319
1329
  throw new Error(`No API key for ${model.provider}/${model.id}`);
1320
1330
  }
1331
+ // Grok OAuth: block selecting Imagine models as the session chat model.
1332
+ assertTextChatModelForCompletion(model.id, model.provider);
1321
1333
  const previousModel = this.model;
1322
1334
  const thinkingLevel = this._getThinkingLevelForModelSwitch();
1323
1335
  this.agent.state.model = model;
@@ -1651,7 +1663,8 @@ export class AgentSession {
1651
1663
  if (!this.model) {
1652
1664
  throw new Error(formatNoModelSelectedMessage());
1653
1665
  }
1654
- const { apiKey, headers } = await this._getCompactionRequestAuth(this.model);
1666
+ const compactionModel = resolveCompactionModel(this.model, this._modelRegistry.getAvailable());
1667
+ const { apiKey, headers } = await this._getCompactionRequestAuth(compactionModel);
1655
1668
  const pathEntries = this.sessionManager.getBranch();
1656
1669
  const settings = this.settingsManager.getCompactionSettings();
1657
1670
  const preparation = prepareCompaction(pathEntries, settings);
@@ -1694,7 +1707,7 @@ export class AgentSession {
1694
1707
  }
1695
1708
  else {
1696
1709
  // Generate compaction result
1697
- const result = await compact(preparation, this.model, apiKey, headers, customInstructions, this._compactionAbortController.signal, this.thinkingLevel, this.agent.streamFn);
1710
+ const result = await compact(preparation, compactionModel, apiKey, headers, customInstructions, this._compactionAbortController.signal, this.thinkingLevel, this.agent.streamFn);
1698
1711
  summary = result.summary;
1699
1712
  firstKeptEntryId = result.firstKeptEntryId;
1700
1713
  tokensBefore = result.tokensBefore;
@@ -1884,17 +1897,21 @@ export class AgentSession {
1884
1897
  });
1885
1898
  return false;
1886
1899
  }
1900
+ const compactionModel = resolveCompactionModel(this.model, this._modelRegistry.getAvailable());
1887
1901
  let apiKey;
1888
1902
  let headers;
1889
1903
  if (this.agent.streamFn === streamSimple) {
1890
- const authResult = await this._modelRegistry.getApiKeyAndHeaders(this.model);
1904
+ const authResult = await this._modelRegistry.getApiKeyAndHeaders(compactionModel);
1891
1905
  if (!authResult.ok || !authResult.apiKey) {
1906
+ const providerLabel = compactionModel.provider;
1892
1907
  this._emit({
1893
1908
  type: "compaction_end",
1894
1909
  reason,
1895
1910
  result: undefined,
1896
1911
  aborted: false,
1897
1912
  willRetry: false,
1913
+ errorMessage: `Auto-compaction could not authenticate for "${providerLabel}" (${compactionModel.id}). ` +
1914
+ `Check proxy/OAuth health and run '/login ${providerLabel}' if needed.`,
1898
1915
  });
1899
1916
  return false;
1900
1917
  }
@@ -1902,7 +1919,7 @@ export class AgentSession {
1902
1919
  headers = authResult.headers;
1903
1920
  }
1904
1921
  else {
1905
- ({ apiKey, headers } = await this._getCompactionRequestAuth(this.model));
1922
+ ({ apiKey, headers } = await this._getCompactionRequestAuth(compactionModel));
1906
1923
  }
1907
1924
  const pathEntries = this.sessionManager.getBranch();
1908
1925
  const preparation = prepareCompaction(pathEntries, settings);
@@ -1954,7 +1971,7 @@ export class AgentSession {
1954
1971
  }
1955
1972
  else {
1956
1973
  // Generate compaction result
1957
- const compactResult = await compact(preparation, this.model, apiKey, headers, undefined, this._autoCompactionAbortController.signal, this.thinkingLevel, this.agent.streamFn);
1974
+ const compactResult = await compact(preparation, compactionModel, apiKey, headers, undefined, this._autoCompactionAbortController.signal, this.thinkingLevel, this.agent.streamFn);
1958
1975
  summary = compactResult.summary;
1959
1976
  firstKeptEntryId = compactResult.firstKeptEntryId;
1960
1977
  tokensBefore = compactResult.tokensBefore;
@@ -1989,7 +2006,8 @@ export class AgentSession {
1989
2006
  tokensBefore,
1990
2007
  details,
1991
2008
  };
1992
- this._emit({ type: "compaction_end", reason, result, aborted: false, willRetry });
2009
+ const emitWillRetry = compactionEmitWillRetry(willRetry, this.agent.hasQueuedMessages());
2010
+ this._emit({ type: "compaction_end", reason, result, aborted: false, willRetry: emitWillRetry });
1993
2011
  if (willRetry) {
1994
2012
  const messages = this.agent.state.messages;
1995
2013
  const lastMsg = messages[messages.length - 1];
@@ -2178,6 +2196,10 @@ export class AgentSession {
2178
2196
  },
2179
2197
  getThinkingLevel: () => this.thinkingLevel,
2180
2198
  setThinkingLevel: (level) => this.setThinkingLevel(level),
2199
+ // Optional: no in-process MCP client manager yet. Leave unbound so
2200
+ // ExtensionAPI.callMcpTool remains present (load-time capture) but throws
2201
+ // until a session-level handler is provided. Tests / future MCP hub bind here.
2202
+ callMcpTool: undefined,
2181
2203
  }, {
2182
2204
  getModel: () => this.model,
2183
2205
  isIdle: () => !this.isStreaming,