@tonyclaw/agent-inspector 3.1.32 → 4.0.2

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 (373) hide show
  1. package/.output/backend/nitro.json +1 -1
  2. package/.output/cli.js +241 -120
  3. package/.output/server/_ssr/index.mjs +1 -1
  4. package/.output/server/_ssr/{router-oXUk3MBR.mjs → router-BBY_zWRK.mjs} +91 -3
  5. package/.output/server/index.mjs +1 -1
  6. package/.output/ui/assets/{CompareDrawer-BtfPSpkV.js → CompareDrawer-rtNElN-B.js} +1 -1
  7. package/.output/ui/assets/{InspectorPet-D9DPPQ3n.js → InspectorPet-QaAiuF3d.js} +1 -1
  8. package/.output/ui/assets/{ProxyViewerContainer-Buu8vkCK.js → ProxyViewerContainer-6twNZHwl.js} +4 -4
  9. package/.output/ui/assets/{ReplayDialog-BER-QzpD.js → ReplayDialog-B7KlziO2.js} +1 -1
  10. package/.output/ui/assets/{RequestAnatomy-C8Zwxrr7.js → RequestAnatomy-2XVFBrW4.js} +1 -1
  11. package/.output/ui/assets/{ResponseView-DDpKdYk6.js → ResponseView-BULgzLVB.js} +1 -1
  12. package/.output/ui/assets/{StreamingChunkSequence-sMPGG7Sw.js → StreamingChunkSequence-DSkvkbns.js} +1 -1
  13. package/.output/ui/assets/{_sessionId-e4IheHnP.js → _sessionId-D2dmJi3G.js} +1 -1
  14. package/.output/ui/assets/{_sessionId-C5Uv72Fx.js → _sessionId-DcS0s1Mr.js} +1 -1
  15. package/.output/ui/assets/{index-B__qT0Yd.js → index-B0TN1KKO.js} +2 -2
  16. package/.output/ui/assets/{index-Be3bTCzi.js → index-Bva1zHEs.js} +1 -1
  17. package/.output/ui/assets/{index-C9q__p8J.js → index-BzBExOxu.js} +1 -1
  18. package/.output/ui/assets/{index-CtB0deSZ.js → index-k6sRQz55.js} +1 -1
  19. package/.output/ui/assets/{json-viewer-Db0AFp-7.js → json-viewer-CWM4tY-j.js} +1 -1
  20. package/.output/ui/assets/{jszip.min-DkY0Ym_q.js → jszip.min-BkWvRFlo.js} +1 -1
  21. package/.output/ui/index.html +1 -1
  22. package/package.json +8 -13
  23. package/src/assets/IDE/claudecode-color.svg +0 -1
  24. package/src/assets/IDE/codex-color.svg +0 -1
  25. package/src/assets/IDE/opencode.svg +0 -1
  26. package/src/assets/IDE/xiaomimimo.svg +0 -1
  27. package/src/assets/favicon.svg +0 -21
  28. package/src/assets/logos/alibaba.svg +0 -1
  29. package/src/assets/logos/anthropic.svg +0 -1
  30. package/src/assets/logos/claude-code.svg +0 -4
  31. package/src/assets/logos/deepseek.svg +0 -1
  32. package/src/assets/logos/minimax.jpeg +0 -0
  33. package/src/assets/logos/openai.svg +0 -1
  34. package/src/assets/logos/opencode.svg +0 -4
  35. package/src/assets/logos/qwen.webp +0 -0
  36. package/src/assets/logos/zhipuai.svg +0 -219
  37. package/src/backend/router.tsx +0 -36
  38. package/src/backend/routes/$.ts +0 -26
  39. package/src/backend/routes/__root.ts +0 -4
  40. package/src/backend/routes/api/-instances.ts +0 -7
  41. package/src/backend/routes/api/alerts.summary.ts +0 -28
  42. package/src/backend/routes/api/alerts.ts +0 -70
  43. package/src/backend/routes/api/config.paths.ts +0 -14
  44. package/src/backend/routes/api/config.ts +0 -73
  45. package/src/backend/routes/api/ecosystem.packages.$packageId.help.ts +0 -11
  46. package/src/backend/routes/api/ecosystem.packages.$packageId.install.ts +0 -11
  47. package/src/backend/routes/api/ecosystem.packages.$packageId.runner-presets.ts +0 -11
  48. package/src/backend/routes/api/ecosystem.packages.$packageId.upgrade.ts +0 -11
  49. package/src/backend/routes/api/ecosystem.packages.ts +0 -21
  50. package/src/backend/routes/api/ecosystem.recipes.$recipeId.run.ts +0 -11
  51. package/src/backend/routes/api/ecosystem.tasks.$taskId.ts +0 -16
  52. package/src/backend/routes/api/ecosystem.tasks.ts +0 -12
  53. package/src/backend/routes/api/groups.$groupId.evidence.ts +0 -55
  54. package/src/backend/routes/api/groups.$groupId.sessions.ts +0 -50
  55. package/src/backend/routes/api/groups.$groupId.ts +0 -93
  56. package/src/backend/routes/api/groups.ts +0 -79
  57. package/src/backend/routes/api/health.ts +0 -22
  58. package/src/backend/routes/api/instances.$name.connection.ts +0 -12
  59. package/src/backend/routes/api/instances.$name.restart.ts +0 -23
  60. package/src/backend/routes/api/instances.$name.start.ts +0 -18
  61. package/src/backend/routes/api/instances.$name.stop.ts +0 -23
  62. package/src/backend/routes/api/instances.$name.ts +0 -12
  63. package/src/backend/routes/api/instances.ts +0 -16
  64. package/src/backend/routes/api/knowledge.candidates.$candidateId.promote.ts +0 -32
  65. package/src/backend/routes/api/knowledge.candidates.$candidateId.ts +0 -50
  66. package/src/backend/routes/api/knowledge.candidates.ts +0 -10
  67. package/src/backend/routes/api/knowledge.project-context.ts +0 -29
  68. package/src/backend/routes/api/knowledge.search.ts +0 -62
  69. package/src/backend/routes/api/knowledge.sessions.$sessionId.candidates.ts +0 -26
  70. package/src/backend/routes/api/logs.$id.body.ts +0 -58
  71. package/src/backend/routes/api/logs.$id.chunks.ts +0 -37
  72. package/src/backend/routes/api/logs.$id.replay.ts +0 -297
  73. package/src/backend/routes/api/logs.$id.ts +0 -23
  74. package/src/backend/routes/api/logs.import.ts +0 -39
  75. package/src/backend/routes/api/logs.stream.ts +0 -174
  76. package/src/backend/routes/api/logs.ts +0 -214
  77. package/src/backend/routes/api/mcp.ts +0 -25
  78. package/src/backend/routes/api/models.ts +0 -10
  79. package/src/backend/routes/api/pi-agent.ts +0 -29
  80. package/src/backend/routes/api/providers.$providerId.model-metadata.ts +0 -173
  81. package/src/backend/routes/api/providers.$providerId.test.log.ts +0 -342
  82. package/src/backend/routes/api/providers.$providerId.ts +0 -111
  83. package/src/backend/routes/api/providers.export.ts +0 -44
  84. package/src/backend/routes/api/providers.import.ts +0 -81
  85. package/src/backend/routes/api/providers.scan.ts +0 -28
  86. package/src/backend/routes/api/providers.ts +0 -102
  87. package/src/backend/routes/api/runs.$runId.evidence.ts +0 -55
  88. package/src/backend/routes/api/runs.$runId.ts +0 -50
  89. package/src/backend/routes/api/runs.ts +0 -62
  90. package/src/backend/routes/api/runtime.ts +0 -46
  91. package/src/backend/routes/api/sessions.ts +0 -51
  92. package/src/backend/routes/api/storage.ts +0 -56
  93. package/src/backend/routes/livez.ts +0 -13
  94. package/src/backend/routes/metrics.ts +0 -14
  95. package/src/backend/routes/proxy/$.ts +0 -15
  96. package/src/backend/routes/readyz.ts +0 -18
  97. package/src/backend/start.ts +0 -10
  98. package/src/cli/alias.ts +0 -431
  99. package/src/cli/detect-tools.ts +0 -123
  100. package/src/cli/doctor.ts +0 -836
  101. package/src/cli/instance.ts +0 -1071
  102. package/src/cli/instanceApi.ts +0 -213
  103. package/src/cli/instanceArgs.ts +0 -301
  104. package/src/cli/instanceControl.ts +0 -191
  105. package/src/cli/instanceModel.ts +0 -276
  106. package/src/cli/instanceRegistry.ts +0 -731
  107. package/src/cli/networkHints.ts +0 -170
  108. package/src/cli/onboard.ts +0 -1668
  109. package/src/cli/onboardTarget.ts +0 -228
  110. package/src/cli/rustBackendPackage.ts +0 -458
  111. package/src/cli/startupOutput.ts +0 -16
  112. package/src/cli/templates/codex-skill-onboard.ts +0 -320
  113. package/src/cli/templates/command-onboard.ts +0 -25
  114. package/src/cli/templates/skill-onboard.ts +0 -625
  115. package/src/cli.ts +0 -1397
  116. package/src/components/OnboardingBanner.tsx +0 -115
  117. package/src/components/ProxyViewer.tsx +0 -2259
  118. package/src/components/ProxyViewerContainer.tsx +0 -1076
  119. package/src/components/alerts/AlertsDialog.tsx +0 -615
  120. package/src/components/clients/ClientLogo.tsx +0 -175
  121. package/src/components/ecosystem/AgentLabDialog.tsx +0 -947
  122. package/src/components/errors/SafeErrorBoundary.tsx +0 -201
  123. package/src/components/groups/GroupsDialog.tsx +0 -1304
  124. package/src/components/inspector-pet/InspectorPet.tsx +0 -398
  125. package/src/components/inspector-pet/InspectorPetCrab3D.tsx +0 -455
  126. package/src/components/inspector-pet/inspectorPetLogic.ts +0 -272
  127. package/src/components/pi-agent/PiAgentPanel.tsx +0 -446
  128. package/src/components/pi-agent/piAgentChatLogic.ts +0 -273
  129. package/src/components/providers/ImportWizardDialog.tsx +0 -281
  130. package/src/components/providers/ProviderCard.tsx +0 -347
  131. package/src/components/providers/ProviderForm.tsx +0 -1183
  132. package/src/components/providers/ProviderLogo.tsx +0 -122
  133. package/src/components/providers/ProviderTestResultsView.tsx +0 -734
  134. package/src/components/providers/ProvidersPanel.tsx +0 -714
  135. package/src/components/providers/SettingsDialog.tsx +0 -1042
  136. package/src/components/providers/providerFormCapabilities.ts +0 -36
  137. package/src/components/proxy-viewer/AgentTraceSummary.tsx +0 -902
  138. package/src/components/proxy-viewer/AnswerMarkdown.tsx +0 -51
  139. package/src/components/proxy-viewer/ApplicationBar.tsx +0 -123
  140. package/src/components/proxy-viewer/CompareDrawer.tsx +0 -984
  141. package/src/components/proxy-viewer/ConversationGroup.tsx +0 -208
  142. package/src/components/proxy-viewer/ConversationGroupList.tsx +0 -652
  143. package/src/components/proxy-viewer/ConversationHeader.tsx +0 -429
  144. package/src/components/proxy-viewer/LiveConnectionStatus.tsx +0 -186
  145. package/src/components/proxy-viewer/LogEntry.tsx +0 -1419
  146. package/src/components/proxy-viewer/LogEntryHeader.tsx +0 -596
  147. package/src/components/proxy-viewer/ProviderLogoStack.tsx +0 -57
  148. package/src/components/proxy-viewer/RawExportWarning.tsx +0 -77
  149. package/src/components/proxy-viewer/ReplayDialog.tsx +0 -636
  150. package/src/components/proxy-viewer/RequestToolsPanel.tsx +0 -299
  151. package/src/components/proxy-viewer/ResponseView.tsx +0 -202
  152. package/src/components/proxy-viewer/SessionLoadProgressBar.tsx +0 -61
  153. package/src/components/proxy-viewer/StreamingChunkSequence.tsx +0 -265
  154. package/src/components/proxy-viewer/ThreadConnector.tsx +0 -165
  155. package/src/components/proxy-viewer/ToolTraceEvents.tsx +0 -64
  156. package/src/components/proxy-viewer/TurnGroup.tsx +0 -383
  157. package/src/components/proxy-viewer/TurnGroupList.tsx +0 -156
  158. package/src/components/proxy-viewer/accessibility.ts +0 -8
  159. package/src/components/proxy-viewer/anatomy/RequestAnatomy.tsx +0 -887
  160. package/src/components/proxy-viewer/anatomy/SegmentBar.tsx +0 -222
  161. package/src/components/proxy-viewer/anatomy/contextIntelligence.ts +0 -737
  162. package/src/components/proxy-viewer/anatomy/sessionContextSummary.ts +0 -268
  163. package/src/components/proxy-viewer/anatomy/tokenEstimate.ts +0 -53
  164. package/src/components/proxy-viewer/anatomy/types.ts +0 -41
  165. package/src/components/proxy-viewer/anatomy/useAnatomyJump.ts +0 -114
  166. package/src/components/proxy-viewer/bodyHydration.ts +0 -123
  167. package/src/components/proxy-viewer/cacheTrend.ts +0 -50
  168. package/src/components/proxy-viewer/diff/DiffView.tsx +0 -321
  169. package/src/components/proxy-viewer/diff/computeDiff.ts +0 -178
  170. package/src/components/proxy-viewer/diff/index.ts +0 -3
  171. package/src/components/proxy-viewer/formats/anthropic/ContentBlocks.tsx +0 -194
  172. package/src/components/proxy-viewer/formats/anthropic/ResponseView.tsx +0 -81
  173. package/src/components/proxy-viewer/formats/anthropic/thinkingExtract.ts +0 -21
  174. package/src/components/proxy-viewer/formats/index.tsx +0 -47
  175. package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +0 -442
  176. package/src/components/proxy-viewer/index.ts +0 -9
  177. package/src/components/proxy-viewer/lazy.ts +0 -41
  178. package/src/components/proxy-viewer/liveConnectionState.ts +0 -158
  179. package/src/components/proxy-viewer/log-formats/anthropic.ts +0 -191
  180. package/src/components/proxy-viewer/log-formats/index.ts +0 -23
  181. package/src/components/proxy-viewer/log-formats/openai.ts +0 -256
  182. package/src/components/proxy-viewer/log-formats/types.ts +0 -40
  183. package/src/components/proxy-viewer/log-formats/unknown.ts +0 -18
  184. package/src/components/proxy-viewer/logEntryVisibility.ts +0 -73
  185. package/src/components/proxy-viewer/logFocus.ts +0 -54
  186. package/src/components/proxy-viewer/proxyViewerContainerLogic.ts +0 -124
  187. package/src/components/proxy-viewer/proxyViewerLogic.ts +0 -488
  188. package/src/components/proxy-viewer/replayComparison.ts +0 -131
  189. package/src/components/proxy-viewer/requestDiff.ts +0 -277
  190. package/src/components/proxy-viewer/requestTools.ts +0 -220
  191. package/src/components/proxy-viewer/useCopyFeedback.ts +0 -38
  192. package/src/components/proxy-viewer/useKeyboardNavigation.ts +0 -232
  193. package/src/components/proxy-viewer/viewerState.ts +0 -176
  194. package/src/components/ui/badge.tsx +0 -47
  195. package/src/components/ui/button.tsx +0 -47
  196. package/src/components/ui/collapsible.tsx +0 -21
  197. package/src/components/ui/confirm-dialog.tsx +0 -51
  198. package/src/components/ui/crab-logo.tsx +0 -45
  199. package/src/components/ui/crab-variants.tsx +0 -467
  200. package/src/components/ui/dialog.tsx +0 -130
  201. package/src/components/ui/icon-trigger.ts +0 -2
  202. package/src/components/ui/json-viewer-bulk.ts +0 -132
  203. package/src/components/ui/json-viewer.tsx +0 -508
  204. package/src/components/ui/scroll-area.tsx +0 -54
  205. package/src/components/ui/select.tsx +0 -178
  206. package/src/components/ui/separator.tsx +0 -28
  207. package/src/components/ui/tabs.tsx +0 -88
  208. package/src/components/ui/tooltip.tsx +0 -51
  209. package/src/components/ui/transient-toast.tsx +0 -105
  210. package/src/contracts/anthropic.ts +0 -230
  211. package/src/contracts/index.ts +0 -59
  212. package/src/contracts/json.ts +0 -37
  213. package/src/contracts/log.ts +0 -139
  214. package/src/contracts/openai.ts +0 -267
  215. package/src/index.css +0 -11
  216. package/src/knowledge/candidateStore.ts +0 -94
  217. package/src/knowledge/distiller.ts +0 -98
  218. package/src/knowledge/openclawClient.ts +0 -161
  219. package/src/knowledge/openclawGatewayClient.ts +0 -249
  220. package/src/knowledge/openclawMarkdown.ts +0 -146
  221. package/src/knowledge/redactor.ts +0 -80
  222. package/src/knowledge/types.ts +0 -83
  223. package/src/lib/alertContract.ts +0 -76
  224. package/src/lib/apiClient.ts +0 -166
  225. package/src/lib/apiFormat.ts +0 -29
  226. package/src/lib/backendImplementation.ts +0 -16
  227. package/src/lib/basePath.ts +0 -107
  228. package/src/lib/browserRuntimeContract.ts +0 -124
  229. package/src/lib/browserRuntimeResolver.ts +0 -333
  230. package/src/lib/chunkLoadRecovery.ts +0 -83
  231. package/src/lib/claudeCodeStrip.ts +0 -98
  232. package/src/lib/clipboard.ts +0 -67
  233. package/src/lib/codingAgentEndpoints.ts +0 -54
  234. package/src/lib/ecosystemContract.ts +0 -130
  235. package/src/lib/export-logs.ts +0 -287
  236. package/src/lib/groupContract.ts +0 -166
  237. package/src/lib/instanceContract.ts +0 -239
  238. package/src/lib/jsonFile.ts +0 -46
  239. package/src/lib/logImportContract.ts +0 -12
  240. package/src/lib/managedInstance.ts +0 -112
  241. package/src/lib/mask.ts +0 -4
  242. package/src/lib/objectUtils.ts +0 -22
  243. package/src/lib/piAgentContract.ts +0 -102
  244. package/src/lib/providerContract.ts +0 -125
  245. package/src/lib/providerImportContract.ts +0 -27
  246. package/src/lib/providerModelMetadata.ts +0 -458
  247. package/src/lib/providerTestContract.ts +0 -170
  248. package/src/lib/providerTestPrompt.ts +0 -100
  249. package/src/lib/publicBasePathContext.ts +0 -137
  250. package/src/lib/resourceLimits.ts +0 -345
  251. package/src/lib/runContract.ts +0 -164
  252. package/src/lib/runtimeConfig.ts +0 -43
  253. package/src/lib/safeDiagnostic.ts +0 -38
  254. package/src/lib/safeFetch.ts +0 -508
  255. package/src/lib/serverPort.ts +0 -47
  256. package/src/lib/sessionInfoContract.ts +0 -78
  257. package/src/lib/sessionUrl.ts +0 -46
  258. package/src/lib/ssrfGuard.ts +0 -133
  259. package/src/lib/stopReason.ts +0 -130
  260. package/src/lib/themeMode.ts +0 -41
  261. package/src/lib/timeDisplay.ts +0 -22
  262. package/src/lib/toolTrace.ts +0 -290
  263. package/src/lib/uiScale.ts +0 -117
  264. package/src/lib/unknown.ts +0 -27
  265. package/src/lib/upstreamUrl.ts +0 -150
  266. package/src/lib/useAlerts.ts +0 -82
  267. package/src/lib/useGroupEvidence.ts +0 -37
  268. package/src/lib/useGroups.ts +0 -32
  269. package/src/lib/useOnboarding.ts +0 -93
  270. package/src/lib/useProviders.ts +0 -30
  271. package/src/lib/useStripConfig.ts +0 -154
  272. package/src/lib/useThemeMode.ts +0 -40
  273. package/src/lib/useUiScale.ts +0 -52
  274. package/src/lib/utils.ts +0 -78
  275. package/src/mcp/currentContext.ts +0 -65
  276. package/src/mcp/instanceHandlers.ts +0 -151
  277. package/src/mcp/loopback.ts +0 -88
  278. package/src/mcp/mode.ts +0 -75
  279. package/src/mcp/previewExtractor.ts +0 -233
  280. package/src/mcp/server.ts +0 -2274
  281. package/src/mcp/toolHandlers.ts +0 -1533
  282. package/src/proxy/alerts.ts +0 -664
  283. package/src/proxy/chunkStorage.ts +0 -123
  284. package/src/proxy/config.ts +0 -218
  285. package/src/proxy/constants.ts +0 -66
  286. package/src/proxy/dataDir.ts +0 -147
  287. package/src/proxy/ecosystemExecutionConfirmation.ts +0 -114
  288. package/src/proxy/ecosystemExecutionRoute.ts +0 -116
  289. package/src/proxy/ecosystemRegistry.ts +0 -296
  290. package/src/proxy/ecosystemTasks.ts +0 -415
  291. package/src/proxy/evidenceAnalysis.ts +0 -526
  292. package/src/proxy/evidenceExporter.ts +0 -235
  293. package/src/proxy/formats/anthropic/anthropicProvider.ts +0 -75
  294. package/src/proxy/formats/anthropic/handler.ts +0 -75
  295. package/src/proxy/formats/anthropic/index.ts +0 -13
  296. package/src/proxy/formats/anthropic/register.ts +0 -4
  297. package/src/proxy/formats/anthropic/schemas.ts +0 -6
  298. package/src/proxy/formats/anthropic/stream.ts +0 -205
  299. package/src/proxy/formats/handler.ts +0 -46
  300. package/src/proxy/formats/index.ts +0 -13
  301. package/src/proxy/formats/jsonSchema.ts +0 -2
  302. package/src/proxy/formats/openai/alibabaProvider.ts +0 -34
  303. package/src/proxy/formats/openai/codexMetadata.ts +0 -61
  304. package/src/proxy/formats/openai/handler.ts +0 -133
  305. package/src/proxy/formats/openai/index.ts +0 -33
  306. package/src/proxy/formats/openai/provider.ts +0 -50
  307. package/src/proxy/formats/openai/register.ts +0 -4
  308. package/src/proxy/formats/openai/schemas.ts +0 -25
  309. package/src/proxy/formats/openai/stream.ts +0 -600
  310. package/src/proxy/formats/openai/zhipuProvider.ts +0 -31
  311. package/src/proxy/formats/providerAdapter.ts +0 -50
  312. package/src/proxy/formats/providerRegistry.ts +0 -51
  313. package/src/proxy/formats/providers/index.ts +0 -3
  314. package/src/proxy/formats/registry.ts +0 -65
  315. package/src/proxy/groupEvidenceExporter.ts +0 -371
  316. package/src/proxy/groupStore.ts +0 -336
  317. package/src/proxy/handler.ts +0 -729
  318. package/src/proxy/identityProxy.ts +0 -1842
  319. package/src/proxy/jsonlRecovery.ts +0 -554
  320. package/src/proxy/logBodyChunks.ts +0 -91
  321. package/src/proxy/logFinalizer.ts +0 -777
  322. package/src/proxy/logFinalizer.worker.ts +0 -24
  323. package/src/proxy/logImportUpload.ts +0 -128
  324. package/src/proxy/logImporter.ts +0 -813
  325. package/src/proxy/logIndex.ts +0 -663
  326. package/src/proxy/logSearch.ts +0 -122
  327. package/src/proxy/logger.ts +0 -537
  328. package/src/proxy/openaiOrphanToolStrip.ts +0 -142
  329. package/src/proxy/platformCommands.ts +0 -253
  330. package/src/proxy/privateDataPath.ts +0 -419
  331. package/src/proxy/providerImporters.ts +0 -578
  332. package/src/proxy/providerScanStore.ts +0 -87
  333. package/src/proxy/providerSecretStore.ts +0 -216
  334. package/src/proxy/providers.ts +0 -998
  335. package/src/proxy/rawStreamCapture.ts +0 -342
  336. package/src/proxy/runFailures.ts +0 -94
  337. package/src/proxy/runStore.ts +0 -214
  338. package/src/proxy/runtimeAdmission.ts +0 -55
  339. package/src/proxy/runtimeHealth.ts +0 -221
  340. package/src/proxy/runtimeMetrics.ts +0 -149
  341. package/src/proxy/runtimeShutdown.ts +0 -157
  342. package/src/proxy/schemas.ts +0 -112
  343. package/src/proxy/sessionArchive.ts +0 -479
  344. package/src/proxy/sessionInfo.ts +0 -266
  345. package/src/proxy/sessionProcess.ts +0 -194
  346. package/src/proxy/sessionRuntime.ts +0 -121
  347. package/src/proxy/sessionSupervisor.ts +0 -305
  348. package/src/proxy/sessionWorkerEntry.ts +0 -26
  349. package/src/proxy/shutdownCoordinator.ts +0 -90
  350. package/src/proxy/socketTracker.ts +0 -639
  351. package/src/proxy/sqliteLogIndex.ts +0 -733
  352. package/src/proxy/storageLifecycle.ts +0 -432
  353. package/src/proxy/store.ts +0 -1773
  354. package/src/proxy/streamTiming.ts +0 -31
  355. package/src/proxy/toolSchemaWarnings.ts +0 -529
  356. package/src/proxy/uiAssetServer.ts +0 -106
  357. package/src/proxy/upstream.ts +0 -127
  358. package/src/services/alerts.ts +0 -12
  359. package/src/services/groups.ts +0 -119
  360. package/src/services/piAgent.ts +0 -421
  361. package/src/services/piAgentRetrieval.ts +0 -1180
  362. package/src/services/result.ts +0 -17
  363. package/src/services/runs.ts +0 -76
  364. package/src/ui/bootstrap.ts +0 -167
  365. package/src/ui/index.html +0 -38
  366. package/src/ui/logsStreamClient.ts +0 -20
  367. package/src/ui/main.tsx +0 -13
  368. package/src/ui/public/runtime-config.js +0 -2
  369. package/src/ui/router.tsx +0 -13
  370. package/src/ui/routes/__root.tsx +0 -69
  371. package/src/ui/routes/index.tsx +0 -35
  372. package/src/ui/routes/session/$sessionId.tsx +0 -50
  373. package/src/ui/runtimeDiscovery.ts +0 -50
@@ -1,320 +0,0 @@
1
- /**
2
- * Renders `~/.codex/skills/agent-inspector-onboard/SKILL.md` for Codex.
3
- *
4
- * This is intentionally separate from the Claude Code onboarding skill because
5
- * Codex uses `~/.codex/config.toml` and supports streamable HTTP MCP servers via
6
- * `mcp_servers.<id>.url`.
7
- */
8
-
9
- export type CodexSkillOnboardContext = {
10
- /** Package version (from `package.json`), stamped into the frontmatter. */
11
- readonly version: string;
12
- /** The default proxy port (mirrors `DEFAULT_PORT` in `src/cli.ts`). */
13
- readonly port: number;
14
- /** Public backend control/agent Base URL, including the configured Base Path. */
15
- readonly baseUrl: string;
16
- /** Optional composed or standalone UI URL. Undefined preserves the legacy composed default. */
17
- readonly uiUrl?: string | null;
18
- /** REST/SSE Base URL. Falls back to baseUrl for compatibility. */
19
- readonly controlBaseUrl?: string;
20
- /** Proxy/MCP Base URL. Falls back to baseUrl for compatibility. */
21
- readonly agentBaseUrl?: string;
22
- /** MCP config key selected by onboarding. */
23
- readonly mcpName?: string;
24
- /** Selected onboarding target type. */
25
- readonly targetKind?: "default" | "instance" | "base-url";
26
- /** Normalized registry name for a named target. */
27
- readonly instanceName?: string | null;
28
- /** CLI arguments that reproduce the selected target. */
29
- readonly onboardTargetArguments?: string;
30
- };
31
-
32
- export const REQUIRED_CODEX_PHASE_HEADINGS = [
33
- "Phase 0: Preflight",
34
- "Phase 1: Start Agent Inspector",
35
- "Phase 2: Wire Codex MCP",
36
- "Phase 3: Restart and verify Codex",
37
- "Phase 4: First Inspector query",
38
- "Phase 5: Capture and memory review",
39
- ] as const;
40
-
41
- export function renderCodexSkillOnboard(ctx: CodexSkillOnboardContext): string {
42
- const { version } = ctx;
43
- const controlBaseUrl = ctx.controlBaseUrl ?? ctx.baseUrl;
44
- const agentBaseUrl = ctx.agentBaseUrl ?? ctx.baseUrl;
45
- const uiUrl = ctx.uiUrl === undefined ? ctx.baseUrl : ctx.uiUrl;
46
- const mcpName = ctx.mcpName ?? "agent-inspector";
47
- const targetKind = ctx.targetKind ?? "default";
48
- const targetArguments = ctx.onboardTargetArguments ?? "";
49
- const instanceName = ctx.instanceName ?? null;
50
- const healthUrl = `${controlBaseUrl}/api/health`;
51
- const runtimeUrl = `${controlBaseUrl}/api/runtime`;
52
- const configUrl = `${controlBaseUrl}/api/config`;
53
- const anthropicProxyUrl = `${agentBaseUrl}/proxy`;
54
- const openAiProxyUrl = `${agentBaseUrl}/proxy/v1`;
55
- const mcpUrl = `${agentBaseUrl}/api/mcp`;
56
- const mcpTomlKey = /^[A-Za-z0-9_-]+$/u.test(mcpName) ? mcpName : JSON.stringify(mcpName);
57
- const statusCommand = `agent-inspector onboard --status${targetArguments}`;
58
- const refreshCommand = `agent-inspector onboard --force${targetArguments}`;
59
- const startCommand =
60
- targetKind === "instance" && instanceName !== null
61
- ? `agent-inspector instance start ${instanceName}`
62
- : targetKind === "base-url"
63
- ? `# Explicit control target ${controlBaseUrl}: do not start a replacement local runtime.`
64
- : "agent-inspector --mode simple --background --no-open";
65
- const fullModeCommand =
66
- targetKind === "instance" && instanceName !== null
67
- ? `agent-inspector instance restart ${instanceName} --mode full`
68
- : targetKind === "base-url"
69
- ? "ask the target operator to enable Full capture mode"
70
- : "agent-inspector --mode full --force-restart";
71
- const startExplanation =
72
- targetKind === "base-url"
73
- ? `The selected Inspector target uses control Base URL \`${controlBaseUrl}\` and agent Base URL \`${agentBaseUrl}\`. Do not start the default local runtime as a substitute; verify the selected target and ask its operator for help if it is unavailable.`
74
- : `Start or reuse the selected Agent Inspector backend before wiring MCP. The default command composes a UI, while backend-only named instances retain proxy, REST, health, and MCP without UI files. Prefer the installed binary so Windows users get the branded runtime in Task Manager. Use \`${fullModeCommand}\` only when the user needs raw headers, raw response, or SSE chunks.`;
75
- const selectedUi =
76
- uiUrl === null ? "not supplied (do not infer one from a backend URL)" : `\`${uiUrl}\``;
77
- const providerTestUiGuidance =
78
- uiUrl === null
79
- ? `No UI URL was supplied. Do not open \`${controlBaseUrl}\` or \`${agentBaseUrl}\` as a page; use the MCP Provider Test tools and log/session resources, or ask the operator for a standalone UI URL.`
80
- : `The operator supplied the explicit composed or standalone UI URL \`${uiUrl}\`. Use that URL for browser steps; do not substitute the control or agent Base URL.`;
81
- return `---
82
- name: agent-inspector-onboard
83
- description: Guide Codex users through connecting Agent Inspector v${version} as a local MCP server.
84
- metadata:
85
- author: agent-inspector
86
- version: ${version}
87
- ---
88
-
89
- # Agent Inspector onboard for Codex
90
-
91
- Use this skill when the user wants to set up Agent Inspector inside Codex, connect the Agent Inspector MCP server, inspect captured model traffic from Codex, or turn Inspector sessions into reviewable knowledge candidates.
92
-
93
- The selected deployment has these explicit surfaces:
94
-
95
- - UI URL: ${selectedUi}
96
- - Control Base URL: \`${controlBaseUrl}\`
97
- - Agent Base URL: \`${agentBaseUrl}\`
98
-
99
- Composed mode may use one URL for all three, but backend-only mode and separately hosted UI deployments do not require UI and backend to share a process, origin, or port. The selected MCP endpoint is:
100
-
101
- \`\`\`text
102
- ${mcpUrl}
103
- \`\`\`
104
-
105
- This skill is installed at \`~/.codex/skills/agent-inspector-onboard/SKILL.md\`.
106
- Codex user-level configuration lives in \`~/.codex/config.toml\`. Codex supports streamable HTTP MCP servers with \`mcp_servers.<id>.url\`, so no extra stdio bridge package is needed.
107
-
108
- Use exactly one MCP transport for the same Inspector instance:
109
-
110
- - Streamable HTTP MCP: configure \`url = "${mcpUrl}"\`.
111
- - Stdio-only MCP clients: configure \`agent-inspector-mcp stdio --url ${mcpUrl}\`.
112
-
113
- Do not configure both transports in the same MCP client, or the client may show duplicate Inspector tools.
114
-
115
- Keep this setup local and explicit. Agent Inspector MCP tools can read captured requests and provider configuration, so only wire it into trusted local Codex environments.
116
-
117
- The backend publishes token-free runtime discovery at \`${runtimeUrl}\`. Treat \`backend-only\` as healthy when REST, proxy, and MCP capabilities are present.
118
-
119
- Agent Inspector starts in **Simple mode** by default. Keep Simple mode for everyday capture: requests, responses, tools, timing, and token usage stay available without retaining heavier raw headers, raw response, or detailed SSE chunk artifacts. Use **Full mode** only when the user is debugging provider headers, raw response payloads, or SSE stream details.
120
-
121
- ---
122
-
123
- ## Phase 0: Preflight
124
-
125
- Check that the package and Codex home exist without printing secrets.
126
-
127
- \`\`\`powershell
128
- Get-Command agent-inspector -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source
129
- ${statusCommand}
130
- Test-Path (Join-Path $env:USERPROFILE ".codex")
131
- Test-Path (Join-Path $env:USERPROFILE ".codex\\config.toml")
132
- \`\`\`
133
-
134
- \`\`\`bash
135
- node -e "const fs=require('node:fs'),p=require('node:path');const names=process.platform==='win32'?['agent-inspector.cmd','agent-inspector.exe','agent-inspector']:['agent-inspector'];const found=(process.env.PATH||'').split(p.delimiter).some(d=>names.some(n=>fs.existsSync(p.join(d,n))));console.log(found?'agent-inspector: present':'agent-inspector: missing')"
136
- ${statusCommand}
137
- test -d "$HOME/.codex" && echo "codex home: present" || echo "codex home: missing"
138
- test -f "$HOME/.codex/config.toml" && echo "config: present" || echo "config: missing"
139
- \`\`\`
140
-
141
- If \`agent-inspector\` is missing, ask the user to install it first:
142
-
143
- \`\`\`bash
144
- npm install -g @tonyclaw/agent-inspector
145
- \`\`\`
146
-
147
- If \`${statusCommand}\` reports \`outdated\` or \`missing\`, ask the user to run
148
- \`${refreshCommand}\` and restart this skill before continuing.
149
-
150
- Do not read \`~/.codex/auth.json\`, token files, or unrelated Codex state files.
151
-
152
- ---
153
-
154
- ## Phase 1: Start Agent Inspector
155
-
156
- ${startExplanation}
157
-
158
- \`\`\`powershell
159
- ${startCommand}
160
- Invoke-RestMethod -Uri "${healthUrl}" -TimeoutSec 3
161
- Invoke-RestMethod -Uri "${runtimeUrl}" -TimeoutSec 3 | Select-Object deploymentMode, capabilities
162
- Invoke-RestMethod -Uri "${configUrl}" -TimeoutSec 3 | Select-Object captureMode
163
- \`\`\`
164
-
165
- \`\`\`bash
166
- ${startCommand}
167
- curl -fsS "${healthUrl}"
168
- curl -fsS "${runtimeUrl}"
169
- curl -fsS "${configUrl}" | grep -o '"captureMode":"[^"]*"'
170
- \`\`\`
171
-
172
- If the health check fails, show only the relevant error and ask whether to diagnose the selected target before editing Codex config. If deeper capture is required, offer \`${fullModeCommand}\`.
173
-
174
- ---
175
-
176
- ## Phase 2: Wire Codex MCP
177
-
178
- Add the \`${mcpName}\` MCP server to \`~/.codex/config.toml\`. Preserve the user's existing config and merge the table instead of replacing the file.
179
-
180
- Recommended user-level config for Codex builds that support Streamable HTTP MCP:
181
-
182
- \`\`\`toml
183
- [mcp_servers.${mcpTomlKey}]
184
- url = "${mcpUrl}"
185
- startup_timeout_sec = 30
186
- tool_timeout_sec = 60
187
- \`\`\`
188
-
189
- Fallback config for a stdio-only MCP client:
190
-
191
- \`\`\`toml
192
- [mcp_servers.${mcpTomlKey}]
193
- command = "agent-inspector-mcp"
194
- args = ["stdio", "--url", "${mcpUrl}"]
195
- \`\`\`
196
-
197
- The stdio command is only a bridge to the same HTTP MCP endpoint. It does not start a second Inspector server.
198
-
199
- If the user's Codex environment is managed by an admin allowlist, they may also need a matching identity rule in the managed requirements layer:
200
-
201
- \`\`\`toml
202
- [mcp_servers.${mcpTomlKey}.identity]
203
- url = "${mcpUrl}"
204
- \`\`\`
205
-
206
- When editing:
207
-
208
- - Ask before changing \`~/.codex/config.toml\`.
209
- - Keep existing \`mcp_servers.*\`, \`projects.*\`, profiles, sandbox, approval, and model settings intact.
210
- - Remove any duplicate Inspector MCP entry that points to the same \`/api/mcp\` endpoint or runs the same \`agent-inspector-mcp stdio\` bridge under another name.
211
- - Do not write provider API keys into Codex config.
212
- - Do not expose a raw Inspector listener to untrusted networks. For remote use, require the operator's authenticated same-origin gateway and keep control credentials in environment variables rather than generated config.
213
-
214
- ---
215
-
216
- ## Phase 3: Restart and verify Codex
217
-
218
- Tell the user that Codex loads MCP servers at session startup. After saving \`config.toml\`, they should start a new Codex session or restart the Codex app.
219
-
220
- Before restart, verify the HTTP endpoint itself:
221
-
222
- \`\`\`bash
223
- curl -sS -X POST "${mcpUrl}" \\
224
- -H "Content-Type: application/json" \\
225
- -H "Accept: application/json, text/event-stream" \\
226
- -d '{
227
- "jsonrpc": "2.0",
228
- "id": 1,
229
- "method": "initialize",
230
- "params": {
231
- "protocolVersion": "2025-03-26",
232
- "capabilities": {},
233
- "clientInfo": { "name": "codex-onboard-check", "version": "0" }
234
- }
235
- }'
236
- \`\`\`
237
-
238
- Expected signal: a 200 response containing \`serverInfo\` with \`agent-inspector\`.
239
-
240
- ---
241
-
242
- ## Phase 4: First Inspector query
243
-
244
- After Codex restarts with the MCP server configured, ask Codex to use Agent Inspector:
245
-
246
- \`\`\`text
247
- Use Agent Inspector to list the latest captured logs.
248
- \`\`\`
249
-
250
- The expected tool is \`inspector_list_logs\`. If no logs exist yet, that is still a successful MCP connection.
251
-
252
- Useful follow-up tools:
253
-
254
- - \`inspector_list_logs\`
255
- - \`inspector_get_log\`
256
- - \`inspector_get_log_chunks\`
257
- - \`inspector_list_sessions\`
258
- - \`inspector_test_provider\`
259
- - \`inspector_create_session_knowledge\`
260
- - \`inspector_list_knowledge_candidates\`
261
- - \`inspector_search_knowledge\`
262
- - \`inspector_get_project_context\`
263
-
264
- Provider mutation tools expose and modify local provider configuration. Ask for explicit user confirmation before using \`inspector_add_provider\`, \`inspector_update_provider\`, or \`inspector_replay_log\`.
265
-
266
- ---
267
-
268
- ## Phase 5: Capture and memory review
269
-
270
- To capture traffic through Agent Inspector, use the protocol-correct base URL:
271
-
272
- \`\`\`text
273
- Anthropic: ${anthropicProxyUrl}
274
- OpenAI Responses / Codex: ${openAiProxyUrl}
275
- \`\`\`
276
-
277
- For Anthropic-compatible tools, set \`ANTHROPIC_BASE_URL=${anthropicProxyUrl}\`. For OpenAI-compatible tools and Codex Responses providers, set \`OPENAI_BASE_URL=${openAiProxyUrl}\`.
278
-
279
- Example Codex Responses provider snippet:
280
-
281
- \`\`\`toml
282
- [model_providers.agent-inspector]
283
- name = "Agent Inspector"
284
- base_url = "${openAiProxyUrl}"
285
- wire_api = "responses"
286
- \`\`\`
287
-
288
- If Codex or another AI tool runs in a different container, VM, WSL distro, or host than Agent
289
- Inspector, \`localhost\` points at the tool's own environment. Replace \`localhost\` with an Inspector
290
- address reachable from that environment, then verify the network/firewall path before debugging
291
- provider credentials.
292
-
293
- For a Provider Test memory probe, first read \`${runtimeUrl}\`. ${providerTestUiGuidance}
294
-
295
- When an explicit UI URL is available:
296
-
297
- 1. Open the supplied UI URL.
298
- 2. Go to Settings -> Providers.
299
- 3. Add or edit a Provider.
300
- 4. Run Test.
301
- 5. Check the \`provider-test\` session.
302
-
303
- If discovery reports \`backend-only\`, do not fail onboarding. A separately hosted UI may still exist only when its URL was explicitly supplied; otherwise use the MCP Provider Test tools and log/session resources. Proxy, REST, health, and MCP remain fully usable without UI files.
304
-
305
- Then ask Codex:
306
-
307
- \`\`\`text
308
- Use Agent Inspector to create knowledge candidates for the provider-test session, then list the candidates.
309
- \`\`\`
310
-
311
- Expected flow:
312
-
313
- - Raw Trace stays in Agent Inspector logs.
314
- - Session Episode is reconstructed from the session.
315
- - Memory Candidate is generated for review.
316
- - Promotion to OpenClaw happens only after review through Agent Inspector.
317
-
318
- Stop after showing candidates unless the user explicitly approves promotion.
319
- `;
320
- }
@@ -1,25 +0,0 @@
1
- /**
2
- * Renders `~/.claude/commands/agent-inspector:onboard.md` - a thin slash
3
- * command that loads the `agent-inspector-onboard` skill. Claude Code
4
- * auto-discovers both the skill and the command once they're written,
5
- * so the command body just references the skill by name.
6
- */
7
-
8
- export type CommandOnboardContext = {
9
- /** Package version (from `package.json`), stamped into the frontmatter. */
10
- readonly version: string;
11
- };
12
-
13
- export function renderCommandOnboard(ctx: CommandOnboardContext): string {
14
- return `---
15
- description: Walk through agent-inspector setup - start the proxy, wire your AI tool, capture your first request.
16
- metadata:
17
- author: agent-inspector
18
- version: ${ctx.version}
19
- ---
20
-
21
- Invoke the \`agent-inspector-onboard\` skill and follow its phases.
22
-
23
- The user wants to set up agent-inspector. If they have specific context (e.g. "I'm on Windows", "I already added my API key"), honor it - but otherwise just run the skill end-to-end and let the \`EXPLAIN / DO / PAUSE\` markers drive the conversation.
24
- `;
25
- }