newmark-agent 0.6.4 → 0.6.8

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 (76) hide show
  1. package/config.example.json +13 -3
  2. package/dist/cli-commands.d.ts +1 -1
  3. package/dist/cli-commands.js +54 -3
  4. package/dist/cli-discovery.js +3 -0
  5. package/dist/conversation-utility-host.bundle.cjs +4472 -1767
  6. package/dist/conversation-utility-host.js +94 -7
  7. package/dist/core/agent.d.ts +126 -12
  8. package/dist/core/agent.js +785 -172
  9. package/dist/core/agentKernelRunner.d.ts +7 -1
  10. package/dist/core/agentKernelRunner.js +160 -20
  11. package/dist/core/autoRouter.d.ts +49 -44
  12. package/dist/core/autoRouter.js +117 -302
  13. package/dist/core/computerUseSession.js +1 -1
  14. package/dist/core/config.js +27 -11
  15. package/dist/core/continuation/contracts.d.ts +1 -1
  16. package/dist/core/continuation/store.d.ts +91 -1
  17. package/dist/core/continuation/store.js +291 -61
  18. package/dist/core/conversationKernel.d.ts +49 -7
  19. package/dist/core/conversationKernel.js +303 -51
  20. package/dist/core/conversationStateDocument.d.ts +18 -0
  21. package/dist/core/conversationStateDocument.js +88 -0
  22. package/dist/core/conversationVisualBudget.d.ts +74 -0
  23. package/dist/core/conversationVisualBudget.js +153 -0
  24. package/dist/core/electronUtilityAgentClient.d.ts +3 -2
  25. package/dist/core/electronUtilityAgentClient.js +32 -8
  26. package/dist/core/electronUtilityRuntimePool.d.ts +28 -3
  27. package/dist/core/electronUtilityRuntimePool.js +93 -24
  28. package/dist/core/fileWriteObservation.d.ts +41 -0
  29. package/dist/core/fileWriteObservation.js +454 -0
  30. package/dist/core/hostRuntimeHooks.d.ts +23 -0
  31. package/dist/core/hostRuntimeHooks.js +17 -0
  32. package/dist/core/jevDecision.d.ts +144 -0
  33. package/dist/core/jevDecision.js +226 -0
  34. package/dist/core/memoryProbe.d.ts +24 -0
  35. package/dist/core/memoryProbe.js +104 -0
  36. package/dist/core/mobilePairing.d.ts +7 -1
  37. package/dist/core/mobilePairing.js +9 -1
  38. package/dist/core/performanceDiagnostics.d.ts +1 -1
  39. package/dist/core/routeDecisionValidator.d.ts +86 -0
  40. package/dist/core/routeDecisionValidator.js +249 -0
  41. package/dist/core/routeEligibility.d.ts +52 -0
  42. package/dist/core/routeEligibility.js +108 -0
  43. package/dist/core/runtimeMemoryBudget.d.ts +6 -0
  44. package/dist/core/runtimeMemoryBudget.js +12 -0
  45. package/dist/core/toolPolicy.d.ts +1 -1
  46. package/dist/core/toolPolicy.js +1 -1
  47. package/dist/core/utilityAgentProtocol.d.ts +8 -10
  48. package/dist/core/utilityHostToolRouter.js +2 -0
  49. package/dist/core/visualDownscale.d.ts +6 -0
  50. package/dist/core/visualDownscale.js +137 -0
  51. package/dist/core/wslAgentClient.d.ts +1 -2
  52. package/dist/core/wslAgentClient.js +0 -8
  53. package/dist/core/wslAgentProtocol.d.ts +1 -10
  54. package/dist/core/wslAgentRuntimePool.d.ts +1 -3
  55. package/dist/core/wslAgentRuntimePool.js +17 -22
  56. package/dist/llm/provider.d.ts +3 -1
  57. package/dist/llm/provider.js +53 -9
  58. package/dist/main.js +107 -30
  59. package/dist/preload.js +3 -1
  60. package/dist/server.js +30 -18
  61. package/dist/tools/computerUse.d.ts +6 -0
  62. package/dist/tools/computerUse.js +406 -21
  63. package/dist/tools/computerUsePowerShellHost.d.ts +6 -1
  64. package/dist/tools/computerUsePowerShellHost.js +105 -31
  65. package/dist/tools/index.d.ts +3 -4
  66. package/dist/tools/index.js +146 -66
  67. package/dist/tui/src/adapters/core-runtime-adapter.js +13 -1
  68. package/dist/tui/src/i18n.js +12 -1
  69. package/dist/tui/src/render.js +9 -2
  70. package/dist/tui/src/settings-schema.js +19 -0
  71. package/dist/tui/src/state.js +69 -1
  72. package/dist/ui/index.html +651 -233
  73. package/dist/ui/lucide-sprite.svg +0 -8
  74. package/dist/wsl-agent-host.bundle.cjs +4302 -1767
  75. package/dist/wsl-agent-host.js +0 -3
  76. package/package.json +39 -10
@@ -110,14 +110,14 @@
110
110
  "value": "builtin"
111
111
  },
112
112
  "auto_switch": {
113
- "_description": "Enable auditable single-model Auto routing",
113
+ "_description": "Enable JEV-controlled auditable Auto routing",
114
114
  "_type": "boolean",
115
115
  "value": false
116
116
  },
117
117
  "auto_switch_preference": {
118
- "_description": "Auto routing policy",
118
+ "_description": "Qualitative tendency for current-model Auto decisions",
119
119
  "_type": "choice",
120
- "_values": ["quality", "balanced", "cost", "speed"],
120
+ "_values": ["conservative", "balanced", "aggressive"],
121
121
  "value": "balanced"
122
122
  },
123
123
  "auto_switch_scope": {
@@ -162,6 +162,16 @@
162
162
  "_type": "number",
163
163
  "value": 0
164
164
  },
165
+ "jev_enabled": {
166
+ "_description": "Use the current eligible conversation model for strict-JSON Auto decisions",
167
+ "_type": "boolean",
168
+ "value": true
169
+ },
170
+ "jev_timeout_ms": {
171
+ "_description": "Hard timeout for one current-model JEV decision in milliseconds",
172
+ "_type": "number",
173
+ "value": 3000
174
+ },
165
175
  "fallback_on_unavailable": {
166
176
  "_description": "Use the scope-safe retry/fallback ladder",
167
177
  "_type": "boolean",
@@ -1,4 +1,4 @@
1
- export declare const CLI_COMMANDS: readonly ["state", "tool", "send", "validate-models", "fuzzy-inject", "skills-market", "memory-lab", "install-update", "compat", "compat-tool", "pair", "remote"];
1
+ export declare const CLI_COMMANDS: readonly ["state", "tool", "send", "validate-models", "fuzzy-inject", "skills-market", "memory-lab", "install-update", "compat", "compat-tool", "pair", "remote", "jev"];
2
2
  export declare function cliHelpRequested(args: string[]): boolean;
3
3
  /**
4
4
  * Compatibility discovery reads third-party metadata outside the selected
@@ -50,7 +50,7 @@ const dshCompatibility_1 = require("./core/dshCompatibility");
50
50
  const memoryLab_1 = require("./core/memoryLab");
51
51
  const installUpdate_1 = require("./core/installUpdate");
52
52
  const mobilePairing_1 = require("./core/mobilePairing");
53
- exports.CLI_COMMANDS = ['state', 'tool', 'send', 'validate-models', 'fuzzy-inject', 'skills-market', 'memory-lab', 'install-update', 'compat', 'compat-tool', 'pair', 'remote'];
53
+ exports.CLI_COMMANDS = ['state', 'tool', 'send', 'validate-models', 'fuzzy-inject', 'skills-market', 'memory-lab', 'install-update', 'compat', 'compat-tool', 'pair', 'remote', 'jev'];
54
54
  const CLI_COMMAND_HELP = {
55
55
  state: [
56
56
  'Usage: Newmark.exe state [--root <dir>]',
@@ -101,6 +101,11 @@ const CLI_COMMAND_HELP = {
101
101
  'Usage: Newmark.exe compat-tool --list | --name <opencode-tool> [json-args | --args-file path] [--root <dir>]',
102
102
  'List or run one compatible OpenCode tool.',
103
103
  ],
104
+ jev: [
105
+ 'Usage: Newmark.exe jev [--json] [--root <dir>]',
106
+ ' Newmark.exe jev --enable|--disable [--timeout <ms>]',
107
+ 'Read or edit current-model Auto routing policy. Decisions use only the current eligible conversation model with thinking off and strict JSON Schema output; failures stop Auto routing.',
108
+ ],
104
109
  };
105
110
  function cliHelpRequested(args) {
106
111
  return args.some(arg => ['--help', '-h'].includes(String(arg).toLowerCase()));
@@ -114,12 +119,13 @@ const CLI_VALUE_FLAGS = new Set([
114
119
  '--remove-source', '--enable-source', '--disable-source', '--source', '--target', '--target-file',
115
120
  '--expected-version', '--preserve', '--repo', '--tag', '--asset', '--version', '--content-file',
116
121
  '--content', '--description', '--tags', '--msi', '--log-dir',
122
+ '--timeout',
117
123
  ]);
118
124
  const CLI_BOOLEAN_FLAGS = new Set([
119
125
  '--persist', '--agent-only', '--list', '--preview-only', '--sources', '--add-source', '--check-github',
120
126
  '--from-github', '--dry-run', '--read', '--index', '--reindex', '--update', '--version', '--folder', '--help', '-h',
121
127
  '--branch-communication', '--yes', '--confirm-stop', '--confirm-remove-legacy', '--no-uninstall-previous', '--no-elevate',
122
- '--on', '--off',
128
+ '--on', '--off', '--json', '--enable', '--disable',
123
129
  ]);
124
130
  function invalidCliCommandArgument(args) {
125
131
  let skipNext = false;
@@ -235,6 +241,7 @@ function positionalAfter(args, commandName) {
235
241
  '--tag',
236
242
  '--asset',
237
243
  '--list',
244
+ '--timeout',
238
245
  ].includes(arg)) {
239
246
  i++;
240
247
  continue;
@@ -337,7 +344,7 @@ function classifyCliToolOutput(tool, output) {
337
344
  if (/^\[(?:context_compress|context_history_manage)]/i.test(firstLine)) {
338
345
  return { envelope: { ok: false, tool, error: firstLine, route: 'direct' }, exitCode: 4 };
339
346
  }
340
- if (/^\[(?:tool disabled|permission|Subagent sandbox)]/i.test(firstLine)) {
347
+ if (/^\[(?:tool disabled|permission|write gate blocked|Subagent sandbox)]/i.test(firstLine)) {
341
348
  return { envelope: { ok: false, tool, error: firstLine, route: 'direct' }, exitCode: 3 };
342
349
  }
343
350
  if (/abort(?:ed|ing)?/i.test(firstLine)) {
@@ -761,6 +768,50 @@ async function runCliCommand(root, args) {
761
768
  printJson(safeState(agent, root));
762
769
  return true;
763
770
  }
771
+ /** Current-model JEV policy editor; there is no separate decision runtime. */
772
+ if (command === 'jev') {
773
+ const patch = {};
774
+ if (args.includes('--enable'))
775
+ patch.enabled = true;
776
+ if (args.includes('--disable'))
777
+ patch.enabled = false;
778
+ const timeout = argValue(args, '--timeout');
779
+ if (timeout !== undefined)
780
+ patch.timeoutMs = Number(timeout);
781
+ let update = null;
782
+ if (Object.keys(patch).length) {
783
+ update = agent.updateJevDecisionModel(patch);
784
+ if (!update.ok) {
785
+ const message = update.reason === 'auto_disabled'
786
+ ? 'Auto routing is off: current-model decision settings are locked and no model may change. Turn Auto on first.'
787
+ : 'Rejected: invalid current-model JEV setting.';
788
+ safeStderr(`${message}\n`);
789
+ process.exitCode = 2;
790
+ if (!args.includes('--json'))
791
+ return true;
792
+ }
793
+ }
794
+ const state = update?.state || agent.jevDecisionModelState();
795
+ if (args.includes('--json')) {
796
+ printJson({
797
+ ok: update ? update.ok : true,
798
+ ...(update?.reason ? { reason: update.reason } : {}),
799
+ root,
800
+ autoDecisionModel: state,
801
+ });
802
+ return true;
803
+ }
804
+ safeStdout([
805
+ `Auto routing: ${state.autoEnabled ? 'on' : 'off'}`,
806
+ `Current-model decision: ${state.enabled ? 'enabled' : 'disabled'}${state.locked ? ' (locked: Auto is off)' : ''}`,
807
+ `Decision source: ${state.decisionModel}`,
808
+ `Thinking mode: ${state.thinkingMode}`,
809
+ `Output format: ${state.outputFormat}`,
810
+ `Decision timeout: ${state.timeoutMs} ms`,
811
+ '',
812
+ ].join('\n'));
813
+ return true;
814
+ }
764
815
  if (command === 'tool') {
765
816
  if (args.includes('--list')) {
766
817
  emitCliToolEnvelope({
@@ -66,6 +66,7 @@ const VALUE_FLAGS = new Set([
66
66
  '--viewer-request',
67
67
  '--msi',
68
68
  '--log-dir',
69
+ '--timeout',
69
70
  ]);
70
71
  const BOOLEAN_FLAGS = new Set([
71
72
  '--tui',
@@ -111,6 +112,8 @@ const BOOLEAN_FLAGS = new Set([
111
112
  '--no-elevate',
112
113
  '--on',
113
114
  '--off',
115
+ '--enable',
116
+ '--disable',
114
117
  ]);
115
118
  /** Public version spellings accepted by every Newmark entrypoint. */
116
119
  function isVersionArgument(args) {