newmark-agent 0.5.14 → 0.6.0

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 (68) hide show
  1. package/dist/conversation-utility-host.bundle.cjs +4565 -2998
  2. package/dist/conversation-utility-host.js +1 -1
  3. package/dist/core/agent.d.ts +108 -16
  4. package/dist/core/agent.js +698 -195
  5. package/dist/core/agentKernel/agent.d.ts +1 -0
  6. package/dist/core/agentKernel/agent.js +9 -0
  7. package/dist/core/agentKernelDiagnostics.d.ts +4 -6
  8. package/dist/core/agentKernelDiagnostics.js +12 -9
  9. package/dist/core/agentKernelRunner.d.ts +5 -0
  10. package/dist/core/agentKernelRunner.js +250 -107
  11. package/dist/core/autoRouter.js +17 -27
  12. package/dist/core/config.d.ts +2 -0
  13. package/dist/core/config.js +7 -1
  14. package/dist/core/conversationCommandState.d.ts +17 -0
  15. package/dist/core/conversationCommandState.js +140 -0
  16. package/dist/core/conversationKernel.d.ts +25 -4
  17. package/dist/core/conversationKernel.js +360 -89
  18. package/dist/core/conversationListEvent.d.ts +6 -0
  19. package/dist/core/conversationListEvent.js +14 -0
  20. package/dist/core/electronUtilityAgentClient.d.ts +4 -1
  21. package/dist/core/electronUtilityAgentClient.js +4 -4
  22. package/dist/core/electronUtilityRuntimePool.d.ts +8 -2
  23. package/dist/core/electronUtilityRuntimePool.js +11 -5
  24. package/dist/core/installUpdate.js +41 -29
  25. package/dist/core/modelResponseHealth.d.ts +17 -0
  26. package/dist/core/modelResponseHealth.js +193 -0
  27. package/dist/core/providerUsageAccounting.d.ts +47 -0
  28. package/dist/core/providerUsageAccounting.js +71 -0
  29. package/dist/core/requestContextEstimate.d.ts +18 -0
  30. package/dist/core/requestContextEstimate.js +54 -0
  31. package/dist/core/subagent.d.ts +89 -5
  32. package/dist/core/subagent.js +264 -41
  33. package/dist/core/subagentCommunication.d.ts +43 -0
  34. package/dist/core/subagentCommunication.js +167 -0
  35. package/dist/core/types.d.ts +34 -1
  36. package/dist/core/utilityAgentProtocol.d.ts +4 -0
  37. package/dist/core/workEventCoalescer.js +4 -1
  38. package/dist/core/wslAgentClient.d.ts +18 -5
  39. package/dist/core/wslAgentClient.js +79 -27
  40. package/dist/core/wslAgentProtocol.d.ts +7 -0
  41. package/dist/core/wslAgentRuntimePool.d.ts +8 -2
  42. package/dist/core/wslAgentRuntimePool.js +19 -6
  43. package/dist/core/wslRuntimeProcessTree.d.ts +10 -0
  44. package/dist/core/wslRuntimeProcessTree.js +104 -0
  45. package/dist/llm/provider.d.ts +5 -12
  46. package/dist/llm/provider.js +150 -269
  47. package/dist/main.js +582 -356
  48. package/dist/preload.js +3 -3
  49. package/dist/providers/chat-completions.adapter.d.ts +2 -0
  50. package/dist/providers/chat-completions.adapter.js +84 -36
  51. package/dist/providers/provider-adapter.d.ts +2 -0
  52. package/dist/providers/provider-events.d.ts +23 -14
  53. package/dist/providers/provider-events.js +148 -43
  54. package/dist/providers/provider-headers.d.ts +7 -3
  55. package/dist/providers/provider-headers.js +109 -39
  56. package/dist/providers/provider-request-compat.d.ts +6 -0
  57. package/dist/providers/provider-request-compat.js +37 -0
  58. package/dist/providers/responses.adapter.d.ts +2 -0
  59. package/dist/providers/responses.adapter.js +192 -126
  60. package/dist/server.d.ts +9 -2
  61. package/dist/server.js +100 -24
  62. package/dist/tools/index.js +17 -1
  63. package/dist/ui/index.html +2515 -693
  64. package/dist/ui/lucide-sprite.svg +7 -0
  65. package/dist/ui/startup.html +6 -6
  66. package/dist/wsl-agent-host.bundle.cjs +4575 -3006
  67. package/dist/wsl-agent-host.js +9 -4
  68. package/package.json +23 -4
@@ -95,10 +95,14 @@ function runtimeIdentity() {
95
95
  const fields = stat.slice(commandEnd + 2).trim().split(/\s+/);
96
96
  const pgid = Number(fields[2] || 0);
97
97
  const sessionId = Number(fields[3] || 0);
98
- if (![pid, pgid, sessionId].every(value => Number.isSafeInteger(value) && value > 1)) {
98
+ const startTimeTicks = String(fields[19] || '');
99
+ const bootId = fs.readFileSync('/proc/sys/kernel/random/boot_id', 'utf8').trim().toLowerCase();
100
+ if (![pid, pgid, sessionId].every(value => Number.isSafeInteger(value) && value > 1)
101
+ || !/^\d+$/.test(startTimeTicks)
102
+ || !/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(bootId)) {
99
103
  throw new Error(`Invalid WSL runtime identity: pid=${pid} pgid=${pgid} session=${sessionId}`);
100
104
  }
101
- return { pid, pgid, sessionId };
105
+ return { pid, pgid, sessionId, startTimeTicks, bootId };
102
106
  }
103
107
  function applyWorkspace(workspace) {
104
108
  if (!workspace) {
@@ -148,7 +152,8 @@ async function handle(request) {
148
152
  (0, terminalTakeover_1.shutdownTerminalTakeoverSessions)('wsl-host-shutdown');
149
153
  if (!host.goal || host.goal.paused)
150
154
  (0, runtimeLifecycle_1.markRuntimeLifecycleClean)(root, 'wsl');
151
- setTimeout(() => process.exit(0), 10);
155
+ if (!request.params?.supervisorTerminates)
156
+ setTimeout(() => process.exit(0), 10);
152
157
  return true;
153
158
  }
154
159
  if (request.method === 'reset') {
@@ -180,7 +185,7 @@ async function handle(request) {
180
185
  }
181
186
  if (request.method === 'snapshot') {
182
187
  const target = requestTarget(request.params);
183
- return { ...kernel.snapshot(target), backend: 'wsl', distro };
188
+ return { ...kernel.snapshot(target, request.params.options), backend: 'wsl', distro };
184
189
  }
185
190
  if (request.method === 'rewind') {
186
191
  return kernel.rewind(requestTarget(request.params), request.params.messageIndex);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "newmark-agent",
3
3
  "productName": "Newmark Agent",
4
- "version": "0.5.14",
4
+ "version": "0.6.0",
5
5
  "description": "Newmark Agent — Portable AI coding agent with rich GUI and CLI (TypeScript)",
6
6
  "homepage": "https://github.com/positer/Newmark-Agent",
7
7
  "repository": {
@@ -24,6 +24,8 @@
24
24
  "config.example.json"
25
25
  ],
26
26
  "scripts": {
27
+ "test:subagent-continuity": "npm run build && npm run test:subagent-continuity:built",
28
+ "test:subagent-continuity:built": "node dist/tests/subagentMailboxConcurrencyVerify.js && node dist/tests/subagentCommunicationVerify.js && node dist/tests/subagentUltraDelegationVerify.js && node scripts/test-subagent-cache-continuity.cjs && node scripts/test-subagent-settlement-receipts.cjs && node scripts/subagent-streaming-relay-stress.cjs",
27
29
  "clean": "tsc --build --clean && node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
28
30
  "build": "tsc && node scripts/build-windows-process-tree-helper.cjs && node scripts/build-typebox-compile.cjs && node scripts/build-ui-icons.cjs && node scripts/build-wsl-agent-host.cjs && node scripts/build-conversation-utility-host.cjs && node scripts/build-tui.cjs",
29
31
  "build:clean": "npm run clean && npm run build",
@@ -57,13 +59,15 @@
57
59
  "test:desktop": "npm run build && node dist/tests/conversationHistoryFirstVerify.js && npm run test:desktop:built",
58
60
  "test:deletion-safety": "npm run build && npm run test:deletion-safety:built",
59
61
  "test:deletion-safety:built": "node scripts/deletion-safety-stress.cjs",
60
- "test:desktop:built": "node dist/tests/verify.js && node dist/tests/searchMcpPoolVerify.js && node dist/tests/thinkingTierMapCacheStressVerify.js && node dist/tests/computerUseSessionVerify.js && node dist/tests/contextSystemV2Verify.js && node dist/tests/contextSystemV2StressVerify.js && node dist/tests/providerAdapterV2Verify.js && node dist/tests/providerTimeoutRecoveryVerify.js && node dist/tests/agentRuntimeV2Verify.js && node dist/tests/toolchainExposureV2Verify.js && node dist/tests/localOcrFallbackVerify.js && node dist/tests/dev018ModeSubagentStressVerify.js && node dist/tests/conversationBranchStressVerify.js && node dist/tests/conversationArchiveConcurrencyVerify.js && node dist/tests/conversationArchiveRuntimeVerify.js && node dist/tests/dev040ComprehensiveStressVerify.js && node dist/tests/memoryPolicyVerify.js && node dist/tests/newmarkSelectVerify.js && node dist/tests/mcpManagerVerify.js && node dist/tests/dshCompatibilityVerify.js && node dist/tests/performanceOptimizationVerify.js && node scripts/compression-pressure-stress.cjs && node dist/tests/compressionFidelityVerify.js && node dist/tests/responseTrajectoryVerify.js && node dist/tests/normalChatRegressionVerify.js && node dist/tests/dev008-subagent.js && node dist/tests/dev009Verify.js && node dist/tests/runtimeIsolationVerify.js && node dist/tests/runtimePoolCapacityVerify.js && node dist/tests/guideWorkRunVerify.js && node dist/tests/modelSwitchBehaviorVerify.js && node scripts/flow-pause-stop-draft-stress.cjs && node dist/tests/guideUiReconcileVerify.js && node dist/tests/workReviewDedupVerify.js && node dist/tests/queueAttachmentIsolationVerify.js && node dist/tests/queueDrainUserMessageVerify.js && node dist/tests/pcGlassMigrationVerify.js && node dist/tests/longHistoryDisplayVerify.js && node dist/tests/workspaceMenuVerify.js && node dist/tests/userImagePersistenceVerify.js && node dist/tests/displayImageVerify.js && node dist/tests/visualPreferencesVerify.js && node dist/tests/browserUseVerify.js && node dist/tests/toolProcessVerify.js && node dist/tests/toolProvisioningVerify.js && node dist/tests/taskToolsVerify.js && node dist/tests/contextCacheHitStressVerify.js && node dist/tests/startupPrewarmVerify.js && node dist/tests/pdfPreviewServerVerify.js && node dist/tests/editorLifecycleVerify.js && node dist/tests/terminalTakeoverVerify.js && node dist/tests/workspaceFileRouterVerify.js && node dist/tests/screenCaptureIndependentVerify.js && node dist/tests/computerUsePerformanceVerify.js && node dist/tests/autoRouterVerify.js && node dist/tests/autoAgentIntegrationVerify.js && node dist/tests/modelRecoveryStressVerify.js && node dist/tests/autoRouteRatingVerify.js && node dist/tests/providerIdentityVerify.js && node dist/tests/modelValidationVerify.js && node dist/tests/modelValidationAgentIntegrationVerify.js && node scripts/deletion-safety-stress.cjs",
62
+ "test:desktop:built": "node dist/tests/verify.js && node dist/tests/searchMcpPoolVerify.js && node dist/tests/thinkingTierMapCacheStressVerify.js && node dist/tests/computerUseSessionVerify.js && node dist/tests/contextSystemV2Verify.js && node dist/tests/contextSystemV2StressVerify.js && node dist/tests/providerAdapterV2Verify.js && node dist/tests/providerTimeoutRecoveryVerify.js && node dist/tests/agentRuntimeV2Verify.js && node dist/tests/toolchainExposureV2Verify.js && node dist/tests/localOcrFallbackVerify.js && node dist/tests/dev018ModeSubagentStressVerify.js && npm run test:subagent-continuity:built && node dist/tests/conversationBranchStressVerify.js && node dist/tests/conversationArchiveConcurrencyVerify.js && node dist/tests/conversationArchiveRuntimeVerify.js && node dist/tests/dev040ComprehensiveStressVerify.js && node dist/tests/memoryPolicyVerify.js && node dist/tests/newmarkSelectVerify.js && node dist/tests/mcpManagerVerify.js && node dist/tests/dshCompatibilityVerify.js && node dist/tests/performanceOptimizationVerify.js && node scripts/compression-pressure-stress.cjs && node dist/tests/compressionFidelityVerify.js && node dist/tests/responseTrajectoryVerify.js && node dist/tests/normalChatRegressionVerify.js && node dist/tests/dev008-subagent.js && node dist/tests/dev009Verify.js && node dist/tests/runtimeIsolationVerify.js && node dist/tests/runtimePoolCapacityVerify.js && node dist/tests/guideWorkRunVerify.js && node dist/tests/modelSwitchBehaviorVerify.js && node scripts/test-conversation-model-binding.cjs && node scripts/test-model-response-health.cjs && node scripts/test-image-ocr-recovery.cjs && node scripts/flow-pause-stop-draft-stress.cjs && node dist/tests/guideUiReconcileVerify.js && node dist/tests/workReviewDedupVerify.js && node dist/tests/queueAttachmentIsolationVerify.js && node scripts/test-queue-continuation-identity.cjs && node scripts/test-hosted-command-transport.cjs && node scripts/test-conversation-list-notifications.cjs && node scripts/test-conversation-command-state.cjs && node scripts/test-shared-conversation-commands.cjs && node scripts/test-queue-start-failure.cjs && node scripts/test-queue-acceptance-boundary.cjs && node dist/tests/queueDrainUserMessageVerify.js && node dist/tests/pcGlassMigrationVerify.js && node dist/tests/longHistoryDisplayVerify.js && node dist/tests/workspaceMenuVerify.js && node dist/tests/userImagePersistenceVerify.js && node dist/tests/displayImageVerify.js && node dist/tests/visualPreferencesVerify.js && node dist/tests/browserUseVerify.js && node dist/tests/toolProcessVerify.js && node dist/tests/toolProvisioningVerify.js && node dist/tests/taskToolsVerify.js && node dist/tests/contextCacheHitStressVerify.js && node dist/tests/buildCacheDiagnosticsVerify.js && node dist/tests/buildCacheRetryVerify.js && node dist/tests/buildProviderReuseVerify.js && node dist/tests/providerCompletionIntegrityVerify.js && node scripts/test-build-recovery-continuity.cjs && node scripts/test-build-retry-cancellation.cjs && node scripts/test-build-continuity-http.cjs && node scripts/test-build-continuity-ui.cjs && node dist/tests/workEventCoalescerVerify.js && node scripts/test-provider-request-compat.cjs && node scripts/test-provider-header-metadata.cjs && node dist/tests/providerUsageAccountingVerify.js && node dist/tests/providerUsageReportingVerify.js && node scripts/test-context-usage-ownership.cjs && node scripts/test-context-request-accounting.cjs && node scripts/test-context-inspector-accounting.cjs && node dist/tests/startupPrewarmVerify.js && node dist/tests/pdfPreviewServerVerify.js && node dist/tests/editorLifecycleVerify.js && node dist/tests/terminalTakeoverVerify.js && node dist/tests/workspaceFileRouterVerify.js && node dist/tests/screenCaptureIndependentVerify.js && node dist/tests/computerUsePerformanceVerify.js && node dist/tests/autoRouterVerify.js && node dist/tests/autoAgentIntegrationVerify.js && node dist/tests/modelRecoveryStressVerify.js && node dist/tests/autoRouteRatingVerify.js && node dist/tests/providerIdentityVerify.js && node dist/tests/modelValidationVerify.js && node dist/tests/modelValidationAgentIntegrationVerify.js && node scripts/deletion-safety-stress.cjs && node scripts/test-install-update-msi.cjs && node scripts/test-provider-usage-persistence.cjs && node scripts/test-long-conversation-ui-ordering.cjs && node scripts/test-flow-start-cancellation.cjs && node scripts/test-conversation-history-window.cjs",
61
63
  "test:conversation-branch-stress": "npm run build && node dist/tests/conversationBranchStressVerify.js",
62
64
  "test:conversation-archive-concurrency": "npm run build && node dist/tests/conversationArchiveConcurrencyVerify.js",
63
65
  "test:memory-policy": "npm run build && node dist/tests/memoryPolicyVerify.js",
64
66
  "test:context-system-v2": "npm run build && node dist/tests/contextSystemV2Verify.js",
65
67
  "test:context-budget": "npm run build && node dist/tests/contextBudgetVerify.js",
66
68
  "test:context-cache-hit-stress": "npm run build && node dist/tests/contextCacheHitStressVerify.js",
69
+ "test:build-cache": "npm run build && npm run test:build-cache:built",
70
+ "test:build-cache:built": "node dist/tests/contextCacheHitStressVerify.js && node dist/tests/buildCacheDiagnosticsVerify.js && node dist/tests/buildCacheRetryVerify.js && node dist/tests/buildProviderReuseVerify.js",
67
71
  "test:thinking-tier-map-cache-stress": "npm run build && node dist/tests/thinkingTierMapCacheStressVerify.js",
68
72
  "test:context-compression-api": "npm run build && node dist/tests/contextCompressionApiVerify.js",
69
73
  "test:compression-pressure": "npm run build && node scripts/compression-pressure-stress.cjs",
@@ -74,7 +78,9 @@
74
78
  "test:toolchain-exposure-v2": "npm run build && node dist/tests/toolchainExposureV2Verify.js",
75
79
  "test:temp-context-conversation-stress": "npm run build && node scripts/release-temp-context-conversation-stress.cjs",
76
80
  "test:conversation-branch-canary": "npm run build && node scripts/conversation-branch-regression-canary.cjs dist/core/agent.js",
77
- "test:runtime-isolation": "npm run build && node dist/tests/runtimeIsolationVerify.js",
81
+ "test:runtime-isolation": "npm run build && node dist/tests/runtimeIsolationVerify.js && npm run test:wsl-stop-isolation:built",
82
+ "test:wsl-stop-isolation": "npm run build && npm run test:wsl-stop-isolation:built",
83
+ "test:wsl-stop-isolation:built": "node scripts/test-wsl-runtime-process-tree.cjs --built",
78
84
  "test:guide-workrun": "npm run build && node dist/tests/guideWorkRunVerify.js",
79
85
  "test:guide-ui": "npm run build && node dist/tests/guideUiReconcileVerify.js",
80
86
  "test:queue-attachments": "npm run build && node dist/tests/queueAttachmentIsolationVerify.js",
@@ -197,7 +203,14 @@
197
203
  "release:ocr-budget-smoke": "node scripts/verify-ocr-package-budget.cjs",
198
204
  "release:packaged-ocr-smoke": "node scripts/release-packaged-ocr-smoke.cjs",
199
205
  "test:stream-unlimited-timeout-stress": "npm run build && node dist/tests/streamUnlimitedTimeoutStressVerify.js",
200
- "test:queue-unify-stress": "npm run build && node dist/tests/queueUnifyStressVerify.js && node dist/tests/queueDrainUserMessageVerify.js"
206
+ "test:queue-unify-stress": "npm run build && node dist/tests/queueUnifyStressVerify.js && node dist/tests/queueDrainUserMessageVerify.js",
207
+ "test:installer": "node scripts/test-install-update-msi.cjs",
208
+ "test:liquid-gestures": "node scripts/dev-liquid-gesture-regression.cjs",
209
+ "test:user-soak:transport": "node --expose-gc scripts/test-user-soak-transport.cjs",
210
+ "test:user-soak:backend": "node --expose-gc scripts/test-user-soak-backend.cjs",
211
+ "test:user-soak:gui": "node scripts/test-user-soak-gui.cjs",
212
+ "test:user-soak:real-model": "node scripts/test-user-soak-real-model.cjs",
213
+ "test:user-soak:owner-release": "node --expose-gc scripts/test-provider-owner-release.cjs"
201
214
  },
202
215
  "build": {
203
216
  "npmRebuild": false,
@@ -249,6 +262,12 @@
249
262
  "to": "THIRD_PARTY_NOTICES.md"
250
263
  }
251
264
  ],
265
+ "extraResources": [
266
+ {
267
+ "from": "scripts/install-windows-msi.ps1",
268
+ "to": "installer/install-windows-msi.ps1"
269
+ }
270
+ ],
252
271
  "win": {
253
272
  "icon": "assets/icon.ico",
254
273
  "signExecutable": false,