codexgpt 1.0.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.
- package/AGENTS.example.md +20 -0
- package/CHANGELOG.md +342 -0
- package/CHATGPT_PROMPT.md +12 -0
- package/CLOUDFLARED_VERIFIED_INSTALL.md +94 -0
- package/CODEX_PROMPT.md +12 -0
- package/CONTRIBUTING.md +62 -0
- package/DOMAIN_SETUP.md +275 -0
- package/FAQ.md +366 -0
- package/FAQ_ZH.md +329 -0
- package/LICENSE +21 -0
- package/PUBLIC_LAUNCH_CHECKLIST.md +111 -0
- package/README.md +490 -0
- package/README_ZH.md +747 -0
- package/SECURITY.md +295 -0
- package/config.example.env +103 -0
- package/dist/access/fullAccessLease.js +148 -0
- package/dist/access/fullAccessLease.js.map +1 -0
- package/dist/access/protectedRoots.js +122 -0
- package/dist/access/protectedRoots.js.map +1 -0
- package/dist/access/rootAdmission.js +347 -0
- package/dist/access/rootAdmission.js.map +1 -0
- package/dist/analysis/cache.js +27 -0
- package/dist/analysis/cache.js.map +1 -0
- package/dist/analysis/classify.js +102 -0
- package/dist/analysis/classify.js.map +1 -0
- package/dist/analysis/extract.js +139 -0
- package/dist/analysis/extract.js.map +1 -0
- package/dist/analysis/graph.js +22 -0
- package/dist/analysis/graph.js.map +1 -0
- package/dist/analysis/impact.js +167 -0
- package/dist/analysis/impact.js.map +1 -0
- package/dist/analysis/index.js +215 -0
- package/dist/analysis/index.js.map +1 -0
- package/dist/analysis/inventory.js +51 -0
- package/dist/analysis/inventory.js.map +1 -0
- package/dist/analysis/providers.js +24 -0
- package/dist/analysis/providers.js.map +1 -0
- package/dist/analysis/rank.js +27 -0
- package/dist/analysis/rank.js.map +1 -0
- package/dist/analysis/types.js +8 -0
- package/dist/analysis/types.js.map +1 -0
- package/dist/audit/canonicalJson.js +79 -0
- package/dist/audit/canonicalJson.js.map +1 -0
- package/dist/audit/diagnostics.js +128 -0
- package/dist/audit/diagnostics.js.map +1 -0
- package/dist/audit/index.js +12 -0
- package/dist/audit/index.js.map +1 -0
- package/dist/audit/lifecycleV3.js +53 -0
- package/dist/audit/lifecycleV3.js.map +1 -0
- package/dist/audit/lifecycleV4.js +70 -0
- package/dist/audit/lifecycleV4.js.map +1 -0
- package/dist/audit/lock.js +195 -0
- package/dist/audit/lock.js.map +1 -0
- package/dist/audit/queryTool.js +120 -0
- package/dist/audit/queryTool.js.map +1 -0
- package/dist/audit/runtime.js +48 -0
- package/dist/audit/runtime.js.map +1 -0
- package/dist/audit/schemas.js +640 -0
- package/dist/audit/schemas.js.map +1 -0
- package/dist/audit/store.js +1309 -0
- package/dist/audit/store.js.map +1 -0
- package/dist/audit/transactionParticipant.js +45 -0
- package/dist/audit/transactionParticipant.js.map +1 -0
- package/dist/audit/types.js +11 -0
- package/dist/audit/types.js.map +1 -0
- package/dist/auth/audit.js +44 -0
- package/dist/auth/audit.js.map +1 -0
- package/dist/auth/authorizationStore.js +333 -0
- package/dist/auth/authorizationStore.js.map +1 -0
- package/dist/auth/challenges.js +25 -0
- package/dist/auth/challenges.js.map +1 -0
- package/dist/auth/clientStore.js +469 -0
- package/dist/auth/clientStore.js.map +1 -0
- package/dist/auth/cloudflareConfig.js +112 -0
- package/dist/auth/cloudflareConfig.js.map +1 -0
- package/dist/auth/configuration.js +167 -0
- package/dist/auth/configuration.js.map +1 -0
- package/dist/auth/credentialStore.js +65 -0
- package/dist/auth/credentialStore.js.map +1 -0
- package/dist/auth/deploymentLock.js +220 -0
- package/dist/auth/deploymentLock.js.map +1 -0
- package/dist/auth/deploymentRegistry.js +149 -0
- package/dist/auth/deploymentRegistry.js.map +1 -0
- package/dist/auth/errors.js +26 -0
- package/dist/auth/errors.js.map +1 -0
- package/dist/auth/grantStore.js +307 -0
- package/dist/auth/grantStore.js.map +1 -0
- package/dist/auth/index.js +39 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/keyManager.js +148 -0
- package/dist/auth/keyManager.js.map +1 -0
- package/dist/auth/localAdminSession.js +173 -0
- package/dist/auth/localAdminSession.js.map +1 -0
- package/dist/auth/metadata.js +69 -0
- package/dist/auth/metadata.js.map +1 -0
- package/dist/auth/oauthProvider.js +589 -0
- package/dist/auth/oauthProvider.js.map +1 -0
- package/dist/auth/ownerApproval.js +51 -0
- package/dist/auth/ownerApproval.js.map +1 -0
- package/dist/auth/policyIdentity.js +189 -0
- package/dist/auth/policyIdentity.js.map +1 -0
- package/dist/auth/rateLimits.js +66 -0
- package/dist/auth/rateLimits.js.map +1 -0
- package/dist/auth/recovery.js +275 -0
- package/dist/auth/recovery.js.map +1 -0
- package/dist/auth/requestContext.js +34 -0
- package/dist/auth/requestContext.js.map +1 -0
- package/dist/auth/resourceMiddleware.js +147 -0
- package/dist/auth/resourceMiddleware.js.map +1 -0
- package/dist/auth/runtimeStatus.js +51 -0
- package/dist/auth/runtimeStatus.js.map +1 -0
- package/dist/auth/schemas.js +84 -0
- package/dist/auth/schemas.js.map +1 -0
- package/dist/auth/stateStore.js +468 -0
- package/dist/auth/stateStore.js.map +1 -0
- package/dist/auth/tokenService.js +631 -0
- package/dist/auth/tokenService.js.map +1 -0
- package/dist/auth/toolSecurity.js +108 -0
- package/dist/auth/toolSecurity.js.map +1 -0
- package/dist/auth/types.js +6 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/auth/windowsDpapi.js +193 -0
- package/dist/auth/windowsDpapi.js.map +1 -0
- package/dist/bashOps.js +292 -0
- package/dist/bashOps.js.map +1 -0
- package/dist/capabilitiesOps.js +412 -0
- package/dist/capabilitiesOps.js.map +1 -0
- package/dist/changesets/crypto.js +92 -0
- package/dist/changesets/crypto.js.map +1 -0
- package/dist/changesets/index.js +9 -0
- package/dist/changesets/index.js.map +1 -0
- package/dist/changesets/moveStore.js +237 -0
- package/dist/changesets/moveStore.js.map +1 -0
- package/dist/changesets/moveUndo.js +386 -0
- package/dist/changesets/moveUndo.js.map +1 -0
- package/dist/changesets/schemas.js +234 -0
- package/dist/changesets/schemas.js.map +1 -0
- package/dist/changesets/store.js +573 -0
- package/dist/changesets/store.js.map +1 -0
- package/dist/changesets/types.js +9 -0
- package/dist/changesets/types.js.map +1 -0
- package/dist/changesets/undo.js +525 -0
- package/dist/changesets/undo.js.map +1 -0
- package/dist/changesets/unifiedUndo.js +31 -0
- package/dist/changesets/unifiedUndo.js.map +1 -0
- package/dist/cliEnvironment.js +85 -0
- package/dist/cliEnvironment.js.map +1 -0
- package/dist/codexSessions.js +733 -0
- package/dist/codexSessions.js.map +1 -0
- package/dist/codexgptSupertool.js +216 -0
- package/dist/codexgptSupertool.js.map +1 -0
- package/dist/codexproSupertool.js +204 -0
- package/dist/codexproSupertool.js.map +1 -0
- package/dist/config.js +733 -0
- package/dist/config.js.map +1 -0
- package/dist/control/localApprovalClient.js +287 -0
- package/dist/control/localApprovalClient.js.map +1 -0
- package/dist/control/localApprovalServer.js +466 -0
- package/dist/control/localApprovalServer.js.map +1 -0
- package/dist/control/runtime.js +178 -0
- package/dist/control/runtime.js.map +1 -0
- package/dist/control/schemas.js +184 -0
- package/dist/control/schemas.js.map +1 -0
- package/dist/control/windowsLocalControl.js +348 -0
- package/dist/control/windowsLocalControl.js.map +1 -0
- package/dist/fsOps.js +541 -0
- package/dist/fsOps.js.map +1 -0
- package/dist/git/admission.js +26 -0
- package/dist/git/admission.js.map +1 -0
- package/dist/git/branchService.js +51 -0
- package/dist/git/branchService.js.map +1 -0
- package/dist/git/capabilities.js +143 -0
- package/dist/git/capabilities.js.map +1 -0
- package/dist/git/commitService.js +344 -0
- package/dist/git/commitService.js.map +1 -0
- package/dist/git/durableState.js +151 -0
- package/dist/git/durableState.js.map +1 -0
- package/dist/git/execution.js +451 -0
- package/dist/git/execution.js.map +1 -0
- package/dist/git/fileTransaction.js +50 -0
- package/dist/git/fileTransaction.js.map +1 -0
- package/dist/git/indexService.js +421 -0
- package/dist/git/indexService.js.map +1 -0
- package/dist/git/integrations.js +653 -0
- package/dist/git/integrations.js.map +1 -0
- package/dist/git/locks.js +287 -0
- package/dist/git/locks.js.map +1 -0
- package/dist/git/mutationContext.js +92 -0
- package/dist/git/mutationContext.js.map +1 -0
- package/dist/git/mutationJournal.js +91 -0
- package/dist/git/mutationJournal.js.map +1 -0
- package/dist/git/mutationService.js +352 -0
- package/dist/git/mutationService.js.map +1 -0
- package/dist/git/normalization.js +57 -0
- package/dist/git/normalization.js.map +1 -0
- package/dist/git/objectQuarantine.js +243 -0
- package/dist/git/objectQuarantine.js.map +1 -0
- package/dist/git/opaqueRecordStore.js +187 -0
- package/dist/git/opaqueRecordStore.js.map +1 -0
- package/dist/git/operationStore.js +287 -0
- package/dist/git/operationStore.js.map +1 -0
- package/dist/git/parsers.js +311 -0
- package/dist/git/parsers.js.map +1 -0
- package/dist/git/privateIndex.js +79 -0
- package/dist/git/privateIndex.js.map +1 -0
- package/dist/git/productionBootstrap.js +39 -0
- package/dist/git/productionBootstrap.js.map +1 -0
- package/dist/git/readService.js +846 -0
- package/dist/git/readService.js.map +1 -0
- package/dist/git/recovery.js +417 -0
- package/dist/git/recovery.js.map +1 -0
- package/dist/git/repositoryIdentity.js +611 -0
- package/dist/git/repositoryIdentity.js.map +1 -0
- package/dist/git/repositoryStore.js +237 -0
- package/dist/git/repositoryStore.js.map +1 -0
- package/dist/git/resources.js +113 -0
- package/dist/git/resources.js.map +1 -0
- package/dist/git/restoreService.js +178 -0
- package/dist/git/restoreService.js.map +1 -0
- package/dist/git/reviewToken.js +86 -0
- package/dist/git/reviewToken.js.map +1 -0
- package/dist/git/stashService.js +566 -0
- package/dist/git/stashService.js.map +1 -0
- package/dist/git/stateToken.js +139 -0
- package/dist/git/stateToken.js.map +1 -0
- package/dist/gitOps.js +147 -0
- package/dist/gitOps.js.map +1 -0
- package/dist/guard.js +608 -0
- package/dist/guard.js.map +1 -0
- package/dist/guidance/diagnostics.js +14 -0
- package/dist/guidance/diagnostics.js.map +1 -0
- package/dist/guidance/instructions.js +167 -0
- package/dist/guidance/instructions.js.map +1 -0
- package/dist/guidance/mode.js +18 -0
- package/dist/guidance/mode.js.map +1 -0
- package/dist/guidance/openaiSkillMetadata.js +29 -0
- package/dist/guidance/openaiSkillMetadata.js.map +1 -0
- package/dist/guidance/safeTextReader.js +171 -0
- package/dist/guidance/safeTextReader.js.map +1 -0
- package/dist/guidance/skillCatalog.js +70 -0
- package/dist/guidance/skillCatalog.js.map +1 -0
- package/dist/guidance/skillDiscovery.js +353 -0
- package/dist/guidance/skillDiscovery.js.map +1 -0
- package/dist/guidance/skillMetadata.js +115 -0
- package/dist/guidance/skillMetadata.js.map +1 -0
- package/dist/guidance/skillResources.js +146 -0
- package/dist/guidance/skillResources.js.map +1 -0
- package/dist/handoffOps.js +449 -0
- package/dist/handoffOps.js.map +1 -0
- package/dist/http/localAdminApp.js +203 -0
- package/dist/http/localAdminApp.js.map +1 -0
- package/dist/http/oauthMcpRuntime.js +294 -0
- package/dist/http/oauthMcpRuntime.js.map +1 -0
- package/dist/http/publicApp.js +350 -0
- package/dist/http/publicApp.js.map +1 -0
- package/dist/http/securityHeaders.js +11 -0
- package/dist/http/securityHeaders.js.map +1 -0
- package/dist/http.js +2076 -0
- package/dist/http.js.map +1 -0
- package/dist/moves/engine.js +1079 -0
- package/dist/moves/engine.js.map +1 -0
- package/dist/moves/index.js +6 -0
- package/dist/moves/index.js.map +1 -0
- package/dist/moves/planner.js +270 -0
- package/dist/moves/planner.js.map +1 -0
- package/dist/moves/recovery.js +557 -0
- package/dist/moves/recovery.js.map +1 -0
- package/dist/moves/service.js +300 -0
- package/dist/moves/service.js.map +1 -0
- package/dist/moves/types.js +11 -0
- package/dist/moves/types.js.map +1 -0
- package/dist/mutations/index.js +4 -0
- package/dist/mutations/index.js.map +1 -0
- package/dist/mutations/lifecycle.js +165 -0
- package/dist/mutations/lifecycle.js.map +1 -0
- package/dist/mutations/localService.js +163 -0
- package/dist/mutations/localService.js.map +1 -0
- package/dist/mutations/runtime.js +322 -0
- package/dist/mutations/runtime.js.map +1 -0
- package/dist/mutations/types.js +2 -0
- package/dist/mutations/types.js.map +1 -0
- package/dist/mutations/writers.js +360 -0
- package/dist/mutations/writers.js.map +1 -0
- package/dist/patchOps.js +420 -0
- package/dist/patchOps.js.map +1 -0
- package/dist/policy/approval.js +306 -0
- package/dist/policy/approval.js.map +1 -0
- package/dist/policy/audit.js +88 -0
- package/dist/policy/audit.js.map +1 -0
- package/dist/policy/authorizationFacts.js +187 -0
- package/dist/policy/authorizationFacts.js.map +1 -0
- package/dist/policy/compat.js +104 -0
- package/dist/policy/compat.js.map +1 -0
- package/dist/policy/context.js +31 -0
- package/dist/policy/context.js.map +1 -0
- package/dist/policy/enforcement.js +46 -0
- package/dist/policy/enforcement.js.map +1 -0
- package/dist/policy/evaluator.js +338 -0
- package/dist/policy/evaluator.js.map +1 -0
- package/dist/policy/executionCapabilities.js +80 -0
- package/dist/policy/executionCapabilities.js.map +1 -0
- package/dist/policy/executionResources.js +192 -0
- package/dist/policy/executionResources.js.map +1 -0
- package/dist/policy/fullAccessResources.js +23 -0
- package/dist/policy/fullAccessResources.js.map +1 -0
- package/dist/policy/hardPolicy.js +50 -0
- package/dist/policy/hardPolicy.js.map +1 -0
- package/dist/policy/identity.js +142 -0
- package/dist/policy/identity.js.map +1 -0
- package/dist/policy/integration.js +331 -0
- package/dist/policy/integration.js.map +1 -0
- package/dist/policy/pendingApprovals.js +301 -0
- package/dist/policy/pendingApprovals.js.map +1 -0
- package/dist/policy/profileStore.js +367 -0
- package/dist/policy/profileStore.js.map +1 -0
- package/dist/policy/resources.js +249 -0
- package/dist/policy/resources.js.map +1 -0
- package/dist/policy/runtime.js +713 -0
- package/dist/policy/runtime.js.map +1 -0
- package/dist/policy/schemas.js +625 -0
- package/dist/policy/schemas.js.map +1 -0
- package/dist/policy/toolPolicy.js +141 -0
- package/dist/policy/toolPolicy.js.map +1 -0
- package/dist/policy/transport.js +10 -0
- package/dist/policy/transport.js.map +1 -0
- package/dist/policy/types.js +31 -0
- package/dist/policy/types.js.map +1 -0
- package/dist/proContext.js +675 -0
- package/dist/proContext.js.map +1 -0
- package/dist/process/authority.js +18 -0
- package/dist/process/authority.js.map +1 -0
- package/dist/process/backendDiscovery.js +83 -0
- package/dist/process/backendDiscovery.js.map +1 -0
- package/dist/process/commandCompiler.js +71 -0
- package/dist/process/commandCompiler.js.map +1 -0
- package/dist/process/outputCursor.js +67 -0
- package/dist/process/outputCursor.js.map +1 -0
- package/dist/process/outputQuota.js +94 -0
- package/dist/process/outputQuota.js.map +1 -0
- package/dist/process/outputRing.js +138 -0
- package/dist/process/outputRing.js.map +1 -0
- package/dist/process/processAuditCoordinator.js +52 -0
- package/dist/process/processAuditCoordinator.js.map +1 -0
- package/dist/process/processManager.js +311 -0
- package/dist/process/processManager.js.map +1 -0
- package/dist/process/runCommand.js +332 -0
- package/dist/process/runCommand.js.map +1 -0
- package/dist/process/streamingRedactor.js +105 -0
- package/dist/process/streamingRedactor.js.map +1 -0
- package/dist/process/types.js +2 -0
- package/dist/process/types.js.map +1 -0
- package/dist/process/windowsHostClient.js +604 -0
- package/dist/process/windowsHostClient.js.map +1 -0
- package/dist/process/windowsHostProtocol.js +270 -0
- package/dist/process/windowsHostProtocol.js.map +1 -0
- package/dist/process/windowsPersistentBackend.js +263 -0
- package/dist/process/windowsPersistentBackend.js.map +1 -0
- package/dist/productionRuntime.js +907 -0
- package/dist/productionRuntime.js.map +1 -0
- package/dist/profileStore.js +231 -0
- package/dist/profileStore.js.map +1 -0
- package/dist/redact.js +124 -0
- package/dist/redact.js.map +1 -0
- package/dist/searchOps.js +186 -0
- package/dist/searchOps.js.map +1 -0
- package/dist/selfTestOps.js +786 -0
- package/dist/selfTestOps.js.map +1 -0
- package/dist/semantic/budgets.js +12 -0
- package/dist/semantic/budgets.js.map +1 -0
- package/dist/semantic/builtin/typescriptAssets.js +68 -0
- package/dist/semantic/builtin/typescriptAssets.js.map +1 -0
- package/dist/semantic/builtin/typescriptProvider.js +211 -0
- package/dist/semantic/builtin/typescriptProvider.js.map +1 -0
- package/dist/semantic/builtin/typescriptWorker.js +365 -0
- package/dist/semantic/builtin/typescriptWorker.js.map +1 -0
- package/dist/semantic/diffPreview.js +36 -0
- package/dist/semantic/diffPreview.js.map +1 -0
- package/dist/semantic/index.js +11 -0
- package/dist/semantic/index.js.map +1 -0
- package/dist/semantic/manager.js +522 -0
- package/dist/semantic/manager.js.map +1 -0
- package/dist/semantic/positions.js +86 -0
- package/dist/semantic/positions.js.map +1 -0
- package/dist/semantic/previewStore.js +276 -0
- package/dist/semantic/previewStore.js.map +1 -0
- package/dist/semantic/projectResolver.js +309 -0
- package/dist/semantic/projectResolver.js.map +1 -0
- package/dist/semantic/sourceSnapshot.js +54 -0
- package/dist/semantic/sourceSnapshot.js.map +1 -0
- package/dist/semantic/status.js +46 -0
- package/dist/semantic/status.js.map +1 -0
- package/dist/semantic/types.js +2 -0
- package/dist/semantic/types.js.map +1 -0
- package/dist/server.js +8676 -0
- package/dist/server.js.map +1 -0
- package/dist/stdio.js +64 -0
- package/dist/stdio.js.map +1 -0
- package/dist/toolCardWidget.js +2000 -0
- package/dist/toolCardWidget.js.map +1 -0
- package/dist/tools/contracts/catalog.js +111 -0
- package/dist/tools/contracts/catalog.js.map +1 -0
- package/dist/tools/contracts/index.js +8 -0
- package/dist/tools/contracts/index.js.map +1 -0
- package/dist/tools/contracts/registration.js +27 -0
- package/dist/tools/contracts/registration.js.map +1 -0
- package/dist/tools/contracts/schemas.js +11 -0
- package/dist/tools/contracts/schemas.js.map +1 -0
- package/dist/tools/contracts/types.js +2 -0
- package/dist/tools/contracts/types.js.map +1 -0
- package/dist/tools/contracts/v3.js +76 -0
- package/dist/tools/contracts/v3.js.map +1 -0
- package/dist/tools/contracts/v4.js +39 -0
- package/dist/tools/contracts/v4.js.map +1 -0
- package/dist/tools/contracts/v5.js +20 -0
- package/dist/tools/contracts/v5.js.map +1 -0
- package/dist/tools/phase3dServer.js +350 -0
- package/dist/tools/phase3dServer.js.map +1 -0
- package/dist/tools/schemas/applyPatch.js +388 -0
- package/dist/tools/schemas/applyPatch.js.map +1 -0
- package/dist/tools/schemas/bash.js +202 -0
- package/dist/tools/schemas/bash.js.map +1 -0
- package/dist/tools/schemas/closeWorkspace.js +105 -0
- package/dist/tools/schemas/closeWorkspace.js.map +1 -0
- package/dist/tools/schemas/codexContext.js +402 -0
- package/dist/tools/schemas/codexContext.js.map +1 -0
- package/dist/tools/schemas/codexSessions.js +328 -0
- package/dist/tools/schemas/codexSessions.js.map +1 -0
- package/dist/tools/schemas/codexgpt.js +1068 -0
- package/dist/tools/schemas/codexgpt.js.map +1 -0
- package/dist/tools/schemas/codexgptInventory.js +359 -0
- package/dist/tools/schemas/codexgptInventory.js.map +1 -0
- package/dist/tools/schemas/codexgptSelfTest.js +563 -0
- package/dist/tools/schemas/codexgptSelfTest.js.map +1 -0
- package/dist/tools/schemas/codexpro.js +917 -0
- package/dist/tools/schemas/codexpro.js.map +1 -0
- package/dist/tools/schemas/codexproInventory.js +352 -0
- package/dist/tools/schemas/codexproInventory.js.map +1 -0
- package/dist/tools/schemas/codexproSelfTest.js +546 -0
- package/dist/tools/schemas/codexproSelfTest.js.map +1 -0
- package/dist/tools/schemas/common.js +21 -0
- package/dist/tools/schemas/common.js.map +1 -0
- package/dist/tools/schemas/createTaskWorktree.js +51 -0
- package/dist/tools/schemas/createTaskWorktree.js.map +1 -0
- package/dist/tools/schemas/edit.js +321 -0
- package/dist/tools/schemas/edit.js.map +1 -0
- package/dist/tools/schemas/execution.js +330 -0
- package/dist/tools/schemas/execution.js.map +1 -0
- package/dist/tools/schemas/exportProContext.js +370 -0
- package/dist/tools/schemas/exportProContext.js.map +1 -0
- package/dist/tools/schemas/getTaskWorktree.js +19 -0
- package/dist/tools/schemas/getTaskWorktree.js.map +1 -0
- package/dist/tools/schemas/gitBranch.js +42 -0
- package/dist/tools/schemas/gitBranch.js.map +1 -0
- package/dist/tools/schemas/gitCommit.js +40 -0
- package/dist/tools/schemas/gitCommit.js.map +1 -0
- package/dist/tools/schemas/gitCreateBranch.js +22 -0
- package/dist/tools/schemas/gitCreateBranch.js.map +1 -0
- package/dist/tools/schemas/gitDiff.js +222 -0
- package/dist/tools/schemas/gitDiff.js.map +1 -0
- package/dist/tools/schemas/gitLog.js +41 -0
- package/dist/tools/schemas/gitLog.js.map +1 -0
- package/dist/tools/schemas/gitRestore.js +47 -0
- package/dist/tools/schemas/gitRestore.js.map +1 -0
- package/dist/tools/schemas/gitStage.js +33 -0
- package/dist/tools/schemas/gitStage.js.map +1 -0
- package/dist/tools/schemas/gitStash.js +102 -0
- package/dist/tools/schemas/gitStash.js.map +1 -0
- package/dist/tools/schemas/gitStatus.js +226 -0
- package/dist/tools/schemas/gitStatus.js.map +1 -0
- package/dist/tools/schemas/gitV4Common.js +205 -0
- package/dist/tools/schemas/gitV4Common.js.map +1 -0
- package/dist/tools/schemas/guidance.js +40 -0
- package/dist/tools/schemas/guidance.js.map +1 -0
- package/dist/tools/schemas/handoffToAgent.js +276 -0
- package/dist/tools/schemas/handoffToAgent.js.map +1 -0
- package/dist/tools/schemas/handoffToCodex.js +137 -0
- package/dist/tools/schemas/handoffToCodex.js.map +1 -0
- package/dist/tools/schemas/inspectWorkspace.js +379 -0
- package/dist/tools/schemas/inspectWorkspace.js.map +1 -0
- package/dist/tools/schemas/listTaskWorktrees.js +21 -0
- package/dist/tools/schemas/listTaskWorktrees.js.map +1 -0
- package/dist/tools/schemas/listWorkspaces.js +134 -0
- package/dist/tools/schemas/listWorkspaces.js.map +1 -0
- package/dist/tools/schemas/loadSkill.js +619 -0
- package/dist/tools/schemas/loadSkill.js.map +1 -0
- package/dist/tools/schemas/mergeTaskWorktree.js +105 -0
- package/dist/tools/schemas/mergeTaskWorktree.js.map +1 -0
- package/dist/tools/schemas/movePaths.js +175 -0
- package/dist/tools/schemas/movePaths.js.map +1 -0
- package/dist/tools/schemas/openCurrentWorkspace.js +174 -0
- package/dist/tools/schemas/openCurrentWorkspace.js.map +1 -0
- package/dist/tools/schemas/openFullAccessWorkspace.js +81 -0
- package/dist/tools/schemas/openFullAccessWorkspace.js.map +1 -0
- package/dist/tools/schemas/openWorkspace.js +193 -0
- package/dist/tools/schemas/openWorkspace.js.map +1 -0
- package/dist/tools/schemas/queryAuditEvents.js +193 -0
- package/dist/tools/schemas/queryAuditEvents.js.map +1 -0
- package/dist/tools/schemas/read.js +199 -0
- package/dist/tools/schemas/read.js.map +1 -0
- package/dist/tools/schemas/readCodexSession.js +353 -0
- package/dist/tools/schemas/readCodexSession.js.map +1 -0
- package/dist/tools/schemas/readHandoff.js +446 -0
- package/dist/tools/schemas/readHandoff.js.map +1 -0
- package/dist/tools/schemas/removeTaskWorktree.js +40 -0
- package/dist/tools/schemas/removeTaskWorktree.js.map +1 -0
- package/dist/tools/schemas/search.js +235 -0
- package/dist/tools/schemas/search.js.map +1 -0
- package/dist/tools/schemas/semantic.js +195 -0
- package/dist/tools/schemas/semantic.js.map +1 -0
- package/dist/tools/schemas/serverConfig.js +157 -0
- package/dist/tools/schemas/serverConfig.js.map +1 -0
- package/dist/tools/schemas/showChanges.js +283 -0
- package/dist/tools/schemas/showChanges.js.map +1 -0
- package/dist/tools/schemas/transactionResult.js +11 -0
- package/dist/tools/schemas/transactionResult.js.map +1 -0
- package/dist/tools/schemas/tree.js +136 -0
- package/dist/tools/schemas/tree.js.map +1 -0
- package/dist/tools/schemas/undoChangeSet.js +152 -0
- package/dist/tools/schemas/undoChangeSet.js.map +1 -0
- package/dist/tools/schemas/waitForHandoff.js +462 -0
- package/dist/tools/schemas/waitForHandoff.js.map +1 -0
- package/dist/tools/schemas/workspaceSnapshot.js +145 -0
- package/dist/tools/schemas/workspaceSnapshot.js.map +1 -0
- package/dist/tools/schemas/write.js +285 -0
- package/dist/tools/schemas/write.js.map +1 -0
- package/dist/transactions/atomicFs.js +438 -0
- package/dist/transactions/atomicFs.js.map +1 -0
- package/dist/transactions/atomicStateFile.js +190 -0
- package/dist/transactions/atomicStateFile.js.map +1 -0
- package/dist/transactions/engine.js +574 -0
- package/dist/transactions/engine.js.map +1 -0
- package/dist/transactions/index.js +12 -0
- package/dist/transactions/index.js.map +1 -0
- package/dist/transactions/installation.js +158 -0
- package/dist/transactions/installation.js.map +1 -0
- package/dist/transactions/manifestV2Store.js +96 -0
- package/dist/transactions/manifestV2Store.js.map +1 -0
- package/dist/transactions/participantRecovery.js +98 -0
- package/dist/transactions/participantRecovery.js.map +1 -0
- package/dist/transactions/recovery.js +513 -0
- package/dist/transactions/recovery.js.map +1 -0
- package/dist/transactions/schemas.js +365 -0
- package/dist/transactions/schemas.js.map +1 -0
- package/dist/transactions/stateRoot.js +63 -0
- package/dist/transactions/stateRoot.js.map +1 -0
- package/dist/transactions/types.js +11 -0
- package/dist/transactions/types.js.map +1 -0
- package/dist/transactions/workspaceLock.js +201 -0
- package/dist/transactions/workspaceLock.js.map +1 -0
- package/dist/workspaceOps.js +924 -0
- package/dist/workspaceOps.js.map +1 -0
- package/dist/worktrees/candidateWorkspace.js +566 -0
- package/dist/worktrees/candidateWorkspace.js.map +1 -0
- package/dist/worktrees/manager.js +258 -0
- package/dist/worktrees/manager.js.map +1 -0
- package/dist/worktrees/materializer.js +60 -0
- package/dist/worktrees/materializer.js.map +1 -0
- package/dist/worktrees/mergeExecute.js +498 -0
- package/dist/worktrees/mergeExecute.js.map +1 -0
- package/dist/worktrees/mergePlanStore.js +247 -0
- package/dist/worktrees/mergePlanStore.js.map +1 -0
- package/dist/worktrees/mergePrepare.js +709 -0
- package/dist/worktrees/mergePrepare.js.map +1 -0
- package/dist/worktrees/recovery.js +294 -0
- package/dist/worktrees/recovery.js.map +1 -0
- package/dist/worktrees/remove.js +296 -0
- package/dist/worktrees/remove.js.map +1 -0
- package/dist/worktrees/remover.js +57 -0
- package/dist/worktrees/remover.js.map +1 -0
- package/dist/worktrees/root.js +47 -0
- package/dist/worktrees/root.js.map +1 -0
- package/dist/worktrees/service.js +245 -0
- package/dist/worktrees/service.js.map +1 -0
- package/dist/worktrees/store.js +156 -0
- package/dist/worktrees/store.js.map +1 -0
- package/dist/worktrees/treeManifest.js +106 -0
- package/dist/worktrees/treeManifest.js.map +1 -0
- package/dist/worktrees/verificationReceipts.js +215 -0
- package/dist/worktrees/verificationReceipts.js.map +1 -0
- package/dist/worktrees/verificationTerminal.js +23 -0
- package/dist/worktrees/verificationTerminal.js.map +1 -0
- package/dist/worktrees/workspaceAuthority.js +64 -0
- package/dist/worktrees/workspaceAuthority.js.map +1 -0
- package/docs/favicon.svg +5 -0
- package/docs/index.html +624 -0
- package/docs/og.svg +52 -0
- package/docs/script.js +33 -0
- package/docs/star.svg +11 -0
- package/docs/styles.css +1571 -0
- package/docs/zh.html +428 -0
- package/package.json +121 -0
- package/scripts/analysis-cli-smoke.mjs +81 -0
- package/scripts/analysis-smoke.mjs +179 -0
- package/scripts/atomic-file.mjs +137 -0
- package/scripts/ci-change-classifier.mjs +59 -0
- package/scripts/ci-failure-summary.mjs +92 -0
- package/scripts/cloudflared-installer.mjs +215 -0
- package/scripts/cloudflared-release.mjs +63 -0
- package/scripts/codexgpt-entry.mjs +235 -0
- package/scripts/codexgpt.mjs +4987 -0
- package/scripts/connector-auth-output-shim.cjs +66 -0
- package/scripts/doctor-smoke.mjs +90 -0
- package/scripts/doctor.mjs +165 -0
- package/scripts/exact-head-ci.mjs +126 -0
- package/scripts/execute-handoff-smoke-platform-compat.mjs +38 -0
- package/scripts/execute-handoff-smoke.mjs +1117 -0
- package/scripts/g8-u-live-probe.mjs +208 -0
- package/scripts/http-smoke-compat.mjs +151 -0
- package/scripts/http-smoke.mjs +776 -0
- package/scripts/long-task-runner.mjs +1037 -0
- package/scripts/oauth-admin.mjs +1608 -0
- package/scripts/output-bounds.mjs +29 -0
- package/scripts/owned-temp-root.d.mts +50 -0
- package/scripts/owned-temp-root.mjs +567 -0
- package/scripts/phase-4a-smoke.mjs +36 -0
- package/scripts/policy-windows-spike.mjs +135 -0
- package/scripts/pro-apply.mjs +152 -0
- package/scripts/pro-bundle.mjs +121 -0
- package/scripts/pro-smoke.mjs +97 -0
- package/scripts/process-identity.mjs +67 -0
- package/scripts/repository-policy.mjs +166 -0
- package/scripts/run-and-summarize.mjs +134 -0
- package/scripts/run-smoke.mjs +52 -0
- package/scripts/run-with-cleanup.mjs +98 -0
- package/scripts/settings-smoke-platform-compat.mjs +85 -0
- package/scripts/settings-smoke.mjs +769 -0
- package/scripts/smoke-platform-compat.mjs +302 -0
- package/scripts/smoke.mjs +1180 -0
- package/scripts/stress-contract-compat.mjs +94 -0
- package/scripts/stress.mjs +882 -0
- package/scripts/test-domains.mjs +247 -0
- package/scripts/test-execution-profile-manifest.mjs +273 -0
- package/scripts/test-execution-profiles.mjs +147 -0
- package/scripts/test-performance-reporter.mjs +291 -0
- package/scripts/toolchain-manager.mjs +266 -0
- package/scripts/toolchains.json +19 -0
- package/scripts/windows-conpty-probe-child.mjs +82 -0
- package/scripts/windows-conpty-worker.ps1 +24 -0
- package/scripts/windows-credential-host-manifest.json +16 -0
- package/scripts/windows-credential-host-protocol-v1.json +16 -0
- package/scripts/windows-credential-host.cs +256 -0
- package/scripts/windows-credential-host.ps1 +26 -0
- package/scripts/windows-local-control-manifest.json +23 -0
- package/scripts/windows-local-control-spike.cs +738 -0
- package/scripts/windows-local-control-spike.mjs +415 -0
- package/scripts/windows-local-control-spike.ps1 +35 -0
- package/scripts/windows-local-control.cs +738 -0
- package/scripts/windows-local-control.ps1 +35 -0
- package/scripts/windows-native-api-inventory-v1.json +90 -0
- package/scripts/windows-process-host-manifest.json +20 -0
- package/scripts/windows-process-host-protocol-v1.json +59 -0
- package/scripts/windows-process-host.cs +2385 -0
- package/scripts/windows-process-host.ps1 +59 -0
- package/scripts/windows-realpath-shim.cjs +78 -0
|
@@ -0,0 +1,2000 @@
|
|
|
1
|
+
export const TOOL_CARD_URI = "ui://widget/codexgpt-tool-card-v9.html";
|
|
2
|
+
export const TOOL_CARD_LEGACY_URIS = ["ui://widget/codexgpt-tool-card-v8.html"];
|
|
3
|
+
export const TOOL_CARD_MIME_TYPE = "text/html;profile=mcp-app";
|
|
4
|
+
export const toolCardWidgetHtml = String.raw `
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<div id="root" class="wrap">
|
|
7
|
+
<article class="card pending">
|
|
8
|
+
<div class="rail"></div>
|
|
9
|
+
<header class="head">
|
|
10
|
+
<span class="glyph">C</span>
|
|
11
|
+
<div class="headline">
|
|
12
|
+
<div class="title">CodexGPT</div>
|
|
13
|
+
<div class="subtitle">Waiting for tool result...</div>
|
|
14
|
+
</div>
|
|
15
|
+
<span class="pill info">waiting</span>
|
|
16
|
+
</header>
|
|
17
|
+
<div class="skeleton">
|
|
18
|
+
<span></span>
|
|
19
|
+
<span></span>
|
|
20
|
+
<span></span>
|
|
21
|
+
</div>
|
|
22
|
+
</article>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<style>
|
|
26
|
+
:root {
|
|
27
|
+
color-scheme: dark light;
|
|
28
|
+
--panel: #11151c;
|
|
29
|
+
--panel-2: #161b24;
|
|
30
|
+
--panel-3: #0c1016;
|
|
31
|
+
--panel-4: #1d222b;
|
|
32
|
+
--line: rgba(212, 219, 229, 0.13);
|
|
33
|
+
--line-strong: rgba(212, 219, 229, 0.24);
|
|
34
|
+
--text: #f2f4f7;
|
|
35
|
+
--soft: #c9d0da;
|
|
36
|
+
--muted: #97a1af;
|
|
37
|
+
--quiet: #6f7988;
|
|
38
|
+
--accent: #d7b56d;
|
|
39
|
+
--accent-soft: rgba(215, 181, 109, 0.12);
|
|
40
|
+
--blue: #9dc3ff;
|
|
41
|
+
--green: #8edc99;
|
|
42
|
+
--red: #f29a9a;
|
|
43
|
+
--amber: #e8c978;
|
|
44
|
+
--shadow: rgba(0, 0, 0, 0.26);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
* { box-sizing: border-box; }
|
|
48
|
+
|
|
49
|
+
body {
|
|
50
|
+
margin: 0;
|
|
51
|
+
background: transparent;
|
|
52
|
+
color: var(--text);
|
|
53
|
+
font: 12px/1.48 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
54
|
+
letter-spacing: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.wrap {
|
|
58
|
+
width: 100%;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.card {
|
|
62
|
+
position: relative;
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
border: 1px solid var(--line);
|
|
65
|
+
border-radius: 8px;
|
|
66
|
+
background:
|
|
67
|
+
radial-gradient(circle at 18px 0, rgba(215, 181, 109, 0.12), transparent 42px),
|
|
68
|
+
linear-gradient(180deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0)),
|
|
69
|
+
var(--panel);
|
|
70
|
+
box-shadow: 0 14px 34px var(--shadow);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.rail {
|
|
74
|
+
position: absolute;
|
|
75
|
+
inset: 0 auto 0 0;
|
|
76
|
+
width: 3px;
|
|
77
|
+
background: linear-gradient(180deg, var(--accent), rgba(142, 220, 153, 0.75) 64%, transparent);
|
|
78
|
+
opacity: 0.88;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.head {
|
|
82
|
+
display: grid;
|
|
83
|
+
grid-template-columns: 28px minmax(0, 1fr) auto;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: 10px;
|
|
86
|
+
min-height: 56px;
|
|
87
|
+
padding: 11px 12px 10px 14px;
|
|
88
|
+
border-bottom: 1px solid var(--line);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.glyph {
|
|
92
|
+
display: inline-grid;
|
|
93
|
+
place-items: center;
|
|
94
|
+
width: 26px;
|
|
95
|
+
height: 26px;
|
|
96
|
+
border: 1px solid rgba(215, 181, 109, 0.28);
|
|
97
|
+
border-radius: 8px;
|
|
98
|
+
background: linear-gradient(180deg, rgba(215, 181, 109, 0.16), rgba(215, 181, 109, 0.04));
|
|
99
|
+
color: var(--accent);
|
|
100
|
+
font-size: 10px;
|
|
101
|
+
font-weight: 900;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.headline {
|
|
105
|
+
min-width: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.title {
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
color: var(--text);
|
|
111
|
+
font-size: 12px;
|
|
112
|
+
font-weight: 760;
|
|
113
|
+
text-overflow: ellipsis;
|
|
114
|
+
white-space: nowrap;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.subtitle {
|
|
118
|
+
overflow: hidden;
|
|
119
|
+
margin-top: 2px;
|
|
120
|
+
color: var(--muted);
|
|
121
|
+
font-size: 11px;
|
|
122
|
+
font-weight: 650;
|
|
123
|
+
text-overflow: ellipsis;
|
|
124
|
+
white-space: nowrap;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.meta {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-wrap: wrap;
|
|
130
|
+
justify-content: flex-end;
|
|
131
|
+
gap: 6px;
|
|
132
|
+
min-width: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.pill {
|
|
136
|
+
display: inline-flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
min-height: 20px;
|
|
139
|
+
max-width: 22ch;
|
|
140
|
+
overflow: hidden;
|
|
141
|
+
padding: 2px 7px;
|
|
142
|
+
border: 1px solid var(--line);
|
|
143
|
+
border-radius: 6px;
|
|
144
|
+
background: rgba(255, 255, 255, 0.035);
|
|
145
|
+
color: var(--muted);
|
|
146
|
+
font-size: 10px;
|
|
147
|
+
font-weight: 720;
|
|
148
|
+
text-overflow: ellipsis;
|
|
149
|
+
white-space: nowrap;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.pill.good { color: var(--green); border-color: rgba(134, 239, 172, 0.28); background: rgba(134, 239, 172, 0.08); }
|
|
153
|
+
.pill.bad { color: var(--red); border-color: rgba(253, 164, 175, 0.28); background: rgba(253, 164, 175, 0.08); }
|
|
154
|
+
.pill.info { color: var(--blue); border-color: rgba(157, 195, 255, 0.28); background: rgba(157, 195, 255, 0.08); }
|
|
155
|
+
.pill.warn { color: var(--amber); border-color: rgba(253, 230, 138, 0.28); background: rgba(253, 230, 138, 0.08); }
|
|
156
|
+
|
|
157
|
+
.body {
|
|
158
|
+
max-height: 420px;
|
|
159
|
+
overflow: auto;
|
|
160
|
+
padding: 10px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.metrics {
|
|
164
|
+
display: grid;
|
|
165
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
166
|
+
gap: 8px;
|
|
167
|
+
margin-bottom: 10px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.metric {
|
|
171
|
+
min-width: 0;
|
|
172
|
+
padding: 8px 9px;
|
|
173
|
+
border: 1px solid var(--line);
|
|
174
|
+
border-radius: 7px;
|
|
175
|
+
background: rgba(255, 255, 255, 0.025);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.metric .label {
|
|
179
|
+
display: block;
|
|
180
|
+
margin-bottom: 4px;
|
|
181
|
+
color: var(--quiet);
|
|
182
|
+
font-size: 10px;
|
|
183
|
+
font-weight: 900;
|
|
184
|
+
text-transform: uppercase;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.metric .value {
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
color: var(--soft);
|
|
190
|
+
text-overflow: ellipsis;
|
|
191
|
+
white-space: nowrap;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.code {
|
|
195
|
+
overflow: hidden;
|
|
196
|
+
border: 1px solid var(--line);
|
|
197
|
+
border-radius: 7px;
|
|
198
|
+
background: var(--panel-3);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.codebar {
|
|
202
|
+
display: flex;
|
|
203
|
+
align-items: center;
|
|
204
|
+
justify-content: space-between;
|
|
205
|
+
gap: 10px;
|
|
206
|
+
min-height: 30px;
|
|
207
|
+
padding: 6px 9px;
|
|
208
|
+
border-bottom: 1px solid var(--line);
|
|
209
|
+
background: var(--panel-2);
|
|
210
|
+
color: var(--muted);
|
|
211
|
+
font-size: 11px;
|
|
212
|
+
font-weight: 720;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
pre {
|
|
216
|
+
margin: 0;
|
|
217
|
+
padding: 10px;
|
|
218
|
+
overflow: visible;
|
|
219
|
+
color: var(--soft);
|
|
220
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
221
|
+
font-size: 11px;
|
|
222
|
+
line-height: 1.52;
|
|
223
|
+
white-space: pre-wrap;
|
|
224
|
+
overflow-wrap: anywhere;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.diff-line { display: block; min-height: 18px; padding: 0 4px; border-radius: 3px; }
|
|
228
|
+
.diff-add { color: var(--green); background: rgba(142, 220, 153, 0.08); }
|
|
229
|
+
.diff-del { color: var(--red); background: rgba(242, 154, 154, 0.08); }
|
|
230
|
+
.diff-hunk { color: var(--blue); }
|
|
231
|
+
.terminal pre { color: #dbe7f5; }
|
|
232
|
+
.prompt { color: var(--accent); }
|
|
233
|
+
|
|
234
|
+
.summary {
|
|
235
|
+
display: grid;
|
|
236
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
237
|
+
gap: 8px;
|
|
238
|
+
margin-bottom: 10px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.summary-item {
|
|
242
|
+
min-width: 0;
|
|
243
|
+
padding: 9px 10px;
|
|
244
|
+
border: 1px solid var(--line);
|
|
245
|
+
border-radius: 7px;
|
|
246
|
+
background: rgba(255, 255, 255, 0.025);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.summary-label {
|
|
250
|
+
display: block;
|
|
251
|
+
margin-bottom: 4px;
|
|
252
|
+
color: var(--quiet);
|
|
253
|
+
font-size: 10px;
|
|
254
|
+
font-weight: 760;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.summary-value {
|
|
258
|
+
color: var(--text);
|
|
259
|
+
font-size: 15px;
|
|
260
|
+
font-variant-numeric: tabular-nums;
|
|
261
|
+
font-weight: 760;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.file-list {
|
|
265
|
+
display: grid;
|
|
266
|
+
gap: 4px;
|
|
267
|
+
margin-bottom: 10px;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.section-label {
|
|
271
|
+
margin: 10px 1px 6px;
|
|
272
|
+
color: var(--quiet);
|
|
273
|
+
font-size: 10px;
|
|
274
|
+
font-weight: 850;
|
|
275
|
+
text-transform: uppercase;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.fold {
|
|
279
|
+
margin-top: 8px;
|
|
280
|
+
border: 1px solid var(--line);
|
|
281
|
+
border-radius: 7px;
|
|
282
|
+
background: rgba(255, 255, 255, 0.018);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.fold > summary {
|
|
286
|
+
display: grid;
|
|
287
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
288
|
+
gap: 10px;
|
|
289
|
+
align-items: center;
|
|
290
|
+
min-height: 34px;
|
|
291
|
+
padding: 8px 10px;
|
|
292
|
+
cursor: pointer;
|
|
293
|
+
color: var(--soft);
|
|
294
|
+
font-weight: 760;
|
|
295
|
+
list-style: none;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.fold > summary::-webkit-details-marker { display: none; }
|
|
299
|
+
|
|
300
|
+
.fold-title {
|
|
301
|
+
overflow: hidden;
|
|
302
|
+
text-overflow: ellipsis;
|
|
303
|
+
white-space: nowrap;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.fold-count {
|
|
307
|
+
color: var(--muted);
|
|
308
|
+
font-size: 10px;
|
|
309
|
+
font-weight: 800;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.fold-body {
|
|
313
|
+
padding: 0 8px 8px;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.file-row {
|
|
317
|
+
display: grid;
|
|
318
|
+
grid-template-columns: 42px minmax(0, 1fr);
|
|
319
|
+
gap: 8px;
|
|
320
|
+
align-items: center;
|
|
321
|
+
padding: 7px 8px;
|
|
322
|
+
border: 1px solid var(--line);
|
|
323
|
+
border-radius: 7px;
|
|
324
|
+
background: rgba(255, 255, 255, 0.022);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.file-code {
|
|
328
|
+
color: var(--accent);
|
|
329
|
+
font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
330
|
+
font-weight: 800;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.file-name {
|
|
334
|
+
overflow: hidden;
|
|
335
|
+
color: var(--soft);
|
|
336
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
337
|
+
text-overflow: ellipsis;
|
|
338
|
+
white-space: nowrap;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.empty {
|
|
342
|
+
padding: 10px;
|
|
343
|
+
border: 1px dashed var(--line-strong);
|
|
344
|
+
border-radius: 7px;
|
|
345
|
+
background: rgba(255, 255, 255, 0.018);
|
|
346
|
+
color: var(--muted);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.search {
|
|
350
|
+
display: grid;
|
|
351
|
+
gap: 4px;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.hit {
|
|
355
|
+
display: grid;
|
|
356
|
+
grid-template-columns: minmax(120px, 0.34fr) minmax(0, 1fr);
|
|
357
|
+
gap: 8px;
|
|
358
|
+
padding: 6px 8px;
|
|
359
|
+
border-radius: 7px;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.hit:nth-child(odd) {
|
|
363
|
+
background: rgba(255, 255, 255, 0.025);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.hit-file {
|
|
367
|
+
overflow: hidden;
|
|
368
|
+
color: var(--blue);
|
|
369
|
+
font-weight: 850;
|
|
370
|
+
text-overflow: ellipsis;
|
|
371
|
+
white-space: nowrap;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.hit-text {
|
|
375
|
+
color: var(--soft);
|
|
376
|
+
overflow-wrap: anywhere;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.muted { color: var(--muted); }
|
|
380
|
+
|
|
381
|
+
.skeleton {
|
|
382
|
+
display: grid;
|
|
383
|
+
gap: 7px;
|
|
384
|
+
padding: 11px 13px 13px 17px;
|
|
385
|
+
border-top: 1px solid rgba(255, 255, 255, 0.02);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.skeleton span {
|
|
389
|
+
height: 8px;
|
|
390
|
+
max-width: 78%;
|
|
391
|
+
border-radius: 999px;
|
|
392
|
+
background: linear-gradient(90deg, rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.22), rgba(148, 163, 184, 0.12));
|
|
393
|
+
animation: codexgpt-sheen 1.55s ease-in-out infinite;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.skeleton span:nth-child(2) { max-width: 52%; animation-delay: 0.12s; }
|
|
397
|
+
.skeleton span:nth-child(3) { max-width: 66%; animation-delay: 0.24s; }
|
|
398
|
+
|
|
399
|
+
@keyframes codexgpt-sheen {
|
|
400
|
+
0%, 100% { opacity: 0.46; transform: translateX(0); }
|
|
401
|
+
50% { opacity: 1; transform: translateX(2px); }
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
@media (max-width: 640px) {
|
|
405
|
+
.head { grid-template-columns: 28px minmax(0, 1fr); }
|
|
406
|
+
.meta { grid-column: 1 / -1; justify-content: flex-start; }
|
|
407
|
+
.summary,
|
|
408
|
+
.metrics,
|
|
409
|
+
.hit { grid-template-columns: 1fr; }
|
|
410
|
+
}
|
|
411
|
+
</style>
|
|
412
|
+
|
|
413
|
+
<script>
|
|
414
|
+
const root = document.getElementById("root");
|
|
415
|
+
|
|
416
|
+
function esc(value) {
|
|
417
|
+
return String(value ?? "")
|
|
418
|
+
.replaceAll("&", "&")
|
|
419
|
+
.replaceAll("<", "<")
|
|
420
|
+
.replaceAll(">", ">")
|
|
421
|
+
.replaceAll('"', """);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
function truncate(value, max = 9000) {
|
|
425
|
+
const text = String(value ?? "");
|
|
426
|
+
return text.length > max ? text.slice(0, max) + "\n...[truncated in widget]" : text;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
function countLines(value) {
|
|
430
|
+
const text = String(value || "");
|
|
431
|
+
if (!text) return 0;
|
|
432
|
+
return text.replace(/\n$/, "").split("\n").length;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
function previewLines(value, maxLines = 18) {
|
|
436
|
+
const text = String(value || "").replace(/\n$/, "");
|
|
437
|
+
if (!text) return "";
|
|
438
|
+
const lines = text.split("\n");
|
|
439
|
+
const shown = lines.slice(0, maxLines).join("\n");
|
|
440
|
+
const remaining = lines.length - maxLines;
|
|
441
|
+
return remaining > 0 ? shown + "\n...[" + remaining + " more lines]" : shown;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
function basename(value) {
|
|
445
|
+
const text = String(value || "");
|
|
446
|
+
return text.split("/").filter(Boolean).pop() || text || ".";
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
function titleFor(tool) {
|
|
450
|
+
const titles = {
|
|
451
|
+
server_config: "Server config",
|
|
452
|
+
codexgpt_self_test: "Self-test",
|
|
453
|
+
codexgpt_inventory: "Inventory",
|
|
454
|
+
codex_sessions: "Codex sessions",
|
|
455
|
+
read_codex_session: "Codex transcript",
|
|
456
|
+
load_skill: "Skill",
|
|
457
|
+
list_workspaces: "Workspaces",
|
|
458
|
+
open_current_workspace: "Workspace",
|
|
459
|
+
open_workspace: "Workspace",
|
|
460
|
+
workspace_snapshot: "Workspace snapshot",
|
|
461
|
+
inspect_workspace: "Workspace analysis",
|
|
462
|
+
tree: "File tree",
|
|
463
|
+
write: "File write",
|
|
464
|
+
edit: "Exact edit",
|
|
465
|
+
apply_patch: "Patch",
|
|
466
|
+
git_status: "Git Status",
|
|
467
|
+
git_diff: "Git Diff",
|
|
468
|
+
show_changes: "Change review",
|
|
469
|
+
read_handoff: "Handoff context",
|
|
470
|
+
wait_for_handoff: "Handoff wait",
|
|
471
|
+
codex_context: "Codex context",
|
|
472
|
+
export_pro_context: "Pro context",
|
|
473
|
+
handoff_to_agent: "Agent handoff",
|
|
474
|
+
handoff_to_codex: "Codex handoff",
|
|
475
|
+
bash: "Terminal",
|
|
476
|
+
search: "Search",
|
|
477
|
+
read: "Read file"
|
|
478
|
+
};
|
|
479
|
+
return titles[tool] || "CodexGPT";
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
function iconFor(tool) {
|
|
483
|
+
if (tool === "server_config") return "S";
|
|
484
|
+
if (tool === "codexgpt_self_test") return "T";
|
|
485
|
+
if (tool === "codexgpt_inventory") return "I";
|
|
486
|
+
if (tool === "codex_sessions") return "C";
|
|
487
|
+
if (tool === "read_codex_session") return "R";
|
|
488
|
+
if (tool === "load_skill") return "L";
|
|
489
|
+
if (tool === "list_workspaces") return "W";
|
|
490
|
+
if (tool === "open_current_workspace" || tool === "open_workspace") return "W";
|
|
491
|
+
if (tool === "workspace_snapshot") return "W";
|
|
492
|
+
if (tool === "inspect_workspace") return "I";
|
|
493
|
+
if (tool === "tree") return "T";
|
|
494
|
+
if (tool === "write") return "W";
|
|
495
|
+
if (tool === "edit") return "E";
|
|
496
|
+
if (tool === "apply_patch") return "P";
|
|
497
|
+
if (tool === "git_status" || tool === "git_diff") return "G";
|
|
498
|
+
if (tool === "show_changes") return "D";
|
|
499
|
+
if (tool === "read_handoff") return "H";
|
|
500
|
+
if (tool === "wait_for_handoff") return "H";
|
|
501
|
+
if (tool === "codex_context") return "C";
|
|
502
|
+
if (tool === "export_pro_context") return "P";
|
|
503
|
+
if (tool === "handoff_to_agent") return "A";
|
|
504
|
+
if (tool === "handoff_to_codex") return "H";
|
|
505
|
+
if (tool === "bash") return "$";
|
|
506
|
+
if (tool === "search") return "S";
|
|
507
|
+
if (tool === "read") return "R";
|
|
508
|
+
return "C";
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
function workspaceResultData(data) {
|
|
512
|
+
const isWorkspaceResult =
|
|
513
|
+
data?.codexgpt_tool === "open_current_workspace" ||
|
|
514
|
+
data?.codexgpt_tool === "open_workspace" ||
|
|
515
|
+
data?.codexgpt_tool === "workspace_snapshot";
|
|
516
|
+
return isWorkspaceResult && data?.data && typeof data.data === "object"
|
|
517
|
+
? data.data
|
|
518
|
+
: (data ?? {});
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
function listWorkspacesResultData(data) {
|
|
522
|
+
const nested =
|
|
523
|
+
data?.codexgpt_tool === "list_workspaces" &&
|
|
524
|
+
data?.data &&
|
|
525
|
+
typeof data.data === "object";
|
|
526
|
+
return nested ? data.data : (data ?? {});
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
function inspectWorkspaceResultData(data) {
|
|
530
|
+
const nested =
|
|
531
|
+
data?.codexgpt_tool === "inspect_workspace" &&
|
|
532
|
+
data?.data &&
|
|
533
|
+
typeof data.data === "object";
|
|
534
|
+
return nested ? data.data : (data ?? {});
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
function selfTestResultData(data) {
|
|
538
|
+
const nested =
|
|
539
|
+
data?.codexgpt_tool === "codexgpt_self_test" &&
|
|
540
|
+
data?.ok === true &&
|
|
541
|
+
data?.data &&
|
|
542
|
+
typeof data.data === "object";
|
|
543
|
+
return nested ? data.data : {};
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
function inventoryResultData(data) {
|
|
547
|
+
const nested =
|
|
548
|
+
data?.codexgpt_tool === "codexgpt_inventory" &&
|
|
549
|
+
data?.data &&
|
|
550
|
+
typeof data.data === "object";
|
|
551
|
+
return nested ? data.data : (data ?? {});
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
function loadSkillResultData(data) {
|
|
555
|
+
const nested =
|
|
556
|
+
data?.codexgpt_tool === "load_skill" &&
|
|
557
|
+
data?.data &&
|
|
558
|
+
typeof data.data === "object";
|
|
559
|
+
return nested ? data.data : (data ?? {});
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
function codexSessionsResultData(data) {
|
|
563
|
+
const nested =
|
|
564
|
+
data?.codexgpt_tool === "codex_sessions" &&
|
|
565
|
+
data?.data &&
|
|
566
|
+
typeof data.data === "object";
|
|
567
|
+
return nested ? data.data : {};
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
function readCodexSessionResultData(data) {
|
|
571
|
+
const nested =
|
|
572
|
+
data?.codexgpt_tool === "read_codex_session" &&
|
|
573
|
+
data?.data &&
|
|
574
|
+
typeof data.data === "object";
|
|
575
|
+
return nested ? data.data : {};
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
function readHandoffResultData(data) {
|
|
579
|
+
const nested =
|
|
580
|
+
data?.codexgpt_tool === "read_handoff" &&
|
|
581
|
+
data?.data &&
|
|
582
|
+
typeof data.data === "object";
|
|
583
|
+
return nested ? data.data : (data ?? {});
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
function waitForHandoffResultData(data) {
|
|
587
|
+
const nested =
|
|
588
|
+
data?.codexgpt_tool === "wait_for_handoff" &&
|
|
589
|
+
data?.data &&
|
|
590
|
+
typeof data.data === "object";
|
|
591
|
+
return nested ? data.data : (data ?? {});
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
function codexContextResultData(data) {
|
|
595
|
+
const nested =
|
|
596
|
+
data?.codexgpt_tool === "codex_context" &&
|
|
597
|
+
data?.data &&
|
|
598
|
+
typeof data.data === "object";
|
|
599
|
+
return nested ? data.data : (data ?? {});
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
function exportProContextResultData(data) {
|
|
603
|
+
const nested =
|
|
604
|
+
data?.codexgpt_tool === "export_pro_context" &&
|
|
605
|
+
data?.data &&
|
|
606
|
+
typeof data.data === "object";
|
|
607
|
+
return nested ? data.data : (data ?? {});
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
function handoffToAgentResultData(data) {
|
|
611
|
+
const nested =
|
|
612
|
+
(data?.codexgpt_tool === "handoff_to_agent" ||
|
|
613
|
+
data?.codexgpt_tool === "handoff_to_codex") &&
|
|
614
|
+
data?.data &&
|
|
615
|
+
typeof data.data === "object";
|
|
616
|
+
return nested ? data.data : {};
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
function subtitleFor(data) {
|
|
620
|
+
if (data?.codexgpt_tool === "open_current_workspace" || data?.codexgpt_tool === "open_workspace") {
|
|
621
|
+
if (data?.ok === false) return data?.error?.code || "Workspace unavailable";
|
|
622
|
+
const workspace = workspaceResultData(data);
|
|
623
|
+
return workspace.root || "Workspace opened";
|
|
624
|
+
}
|
|
625
|
+
if (data?.codexgpt_tool === "show_changes") {
|
|
626
|
+
const review = data?.data ?? {};
|
|
627
|
+
const error = data?.error ?? {};
|
|
628
|
+
if (data?.ok === false) return error.code || "Git state unavailable";
|
|
629
|
+
const count = Array.isArray(review.changed_files) ? review.changed_files.length : 0;
|
|
630
|
+
if (!count && !review.changed) return "Workspace is clean";
|
|
631
|
+
return count === 1 ? "1 changed file" : count + " changed files";
|
|
632
|
+
}
|
|
633
|
+
if (data?.codexgpt_tool === "codexgpt_self_test") {
|
|
634
|
+
if (data?.ok === false) return data?.error?.code || "Self-test unavailable";
|
|
635
|
+
const selfTest = selfTestResultData(data);
|
|
636
|
+
return selfTest.status ? "Status " + selfTest.status : "Local diagnostic";
|
|
637
|
+
}
|
|
638
|
+
if (data?.codexgpt_tool === "codexgpt_inventory") {
|
|
639
|
+
if (data?.ok === false) return data?.error?.code || "Inventory unavailable";
|
|
640
|
+
const inventory = inventoryResultData(data);
|
|
641
|
+
const limited = inventory.skills_truncated || inventory.mcp_servers_truncated ? " (limited)" : "";
|
|
642
|
+
return (inventory.skill_count ?? 0) + " skills, " + (inventory.mcp_server_count ?? 0) + " MCP servers" + limited;
|
|
643
|
+
}
|
|
644
|
+
if (data?.codexgpt_tool === "codex_sessions") {
|
|
645
|
+
if (data?.ok === false) return data?.error?.code || "Session index unavailable";
|
|
646
|
+
const sessions = codexSessionsResultData(data);
|
|
647
|
+
const limited = sessions.output_limited ? " (limited)" : "";
|
|
648
|
+
return (sessions.session_count ?? 0) + " of " + (sessions.total_found ?? 0) + " matching sessions" + limited;
|
|
649
|
+
}
|
|
650
|
+
if (data?.codexgpt_tool === "read_codex_session") {
|
|
651
|
+
if (data?.ok === false) return data?.error?.code || "Transcript unavailable";
|
|
652
|
+
const transcript = readCodexSessionResultData(data);
|
|
653
|
+
const limited = transcript.output_limited ? " (limited)" : "";
|
|
654
|
+
return (transcript.message_count ?? 0) + " transcript messages" + limited;
|
|
655
|
+
}
|
|
656
|
+
if (data?.codexgpt_tool === "list_workspaces") {
|
|
657
|
+
if (data?.ok === false) return data?.error?.code || "Workspace list unavailable";
|
|
658
|
+
const listed = listWorkspacesResultData(data);
|
|
659
|
+
return (listed?.count ?? 0) + " open workspaces";
|
|
660
|
+
}
|
|
661
|
+
if (data?.codexgpt_tool === "server_config") {
|
|
662
|
+
const config = data?.data ?? {};
|
|
663
|
+
const session = config?.bashSessionId || config?.bash_session_id;
|
|
664
|
+
return "tools " + (config?.toolMode || config?.tool_mode || "-") + ", bash " + (config?.bashMode || config?.bash_mode || "-") + ", policy " + (config?.policyEngineMode || "legacy") + (session ? ", session " + session : "");
|
|
665
|
+
}
|
|
666
|
+
if (data?.codexgpt_tool === "tree") {
|
|
667
|
+
if (data?.ok === false) return data?.error?.code || "File tree unavailable";
|
|
668
|
+
const tree = data?.data ?? {};
|
|
669
|
+
return tree.root || "File tree";
|
|
670
|
+
}
|
|
671
|
+
if (data?.codexgpt_tool === "read") {
|
|
672
|
+
if (data?.ok === false) return data?.error?.code || "File unavailable";
|
|
673
|
+
const file = data?.data ?? {};
|
|
674
|
+
return file.path || "Read file";
|
|
675
|
+
}
|
|
676
|
+
if (data?.codexgpt_tool === "workspace_snapshot") {
|
|
677
|
+
if (data?.ok === false) return data?.error?.code || "Workspace snapshot unavailable";
|
|
678
|
+
const workspace = workspaceResultData(data);
|
|
679
|
+
return workspace.root || "Workspace snapshot";
|
|
680
|
+
}
|
|
681
|
+
if (data?.codexgpt_tool === "inspect_workspace") {
|
|
682
|
+
if (data?.ok === false) return data?.error?.code || "Workspace analysis unavailable";
|
|
683
|
+
const analysis = inspectWorkspaceResultData(data);
|
|
684
|
+
const coverage = analysis?.coverage || {};
|
|
685
|
+
return (coverage.analyzedFiles ?? coverage.analyzed_files ?? 0) +
|
|
686
|
+
" files analyzed, " +
|
|
687
|
+
(coverage.symbolCount ?? coverage.symbol_count ?? 0) +
|
|
688
|
+
" symbols";
|
|
689
|
+
}
|
|
690
|
+
if (data?.codexgpt_tool === "git_status") {
|
|
691
|
+
if (data?.ok === false) return data?.error?.code || "Git status unavailable";
|
|
692
|
+
const statusData = data?.data ?? {};
|
|
693
|
+
const count = Array.isArray(statusData.changed_files)
|
|
694
|
+
? statusData.changed_files.length
|
|
695
|
+
: 0;
|
|
696
|
+
return count ? count + " changed entries" : "Working tree clean";
|
|
697
|
+
}
|
|
698
|
+
if (data?.codexgpt_tool === "codex_context") {
|
|
699
|
+
if (data?.ok === false) return data?.error?.code || "Codex context unavailable";
|
|
700
|
+
const context = codexContextResultData(data);
|
|
701
|
+
return (context?.agents_files?.length ?? 0) + " AGENTS, " + (context?.ai_context_files?.length ?? 0) + " bridge files";
|
|
702
|
+
}
|
|
703
|
+
if (data?.codexgpt_tool === "export_pro_context") {
|
|
704
|
+
if (data?.ok === false) return data?.error?.code || "Pro context export unavailable";
|
|
705
|
+
const context = exportProContextResultData(data);
|
|
706
|
+
return (context?.file_count ?? context?.files_included?.length ?? 0) +
|
|
707
|
+
" files exported to " + (context?.path || "context bundle");
|
|
708
|
+
}
|
|
709
|
+
if (data?.codexgpt_tool === "read_handoff") {
|
|
710
|
+
if (data?.ok === false) return data?.error?.code || "Handoff unavailable";
|
|
711
|
+
const handoff = readHandoffResultData(data);
|
|
712
|
+
return (handoff?.file_count ?? handoff?.files?.length ?? 0) + " bridge files";
|
|
713
|
+
}
|
|
714
|
+
if (data?.codexgpt_tool === "wait_for_handoff") {
|
|
715
|
+
if (data?.ok === false) return data?.error?.code || "Handoff wait unavailable";
|
|
716
|
+
const wait = waitForHandoffResultData(data);
|
|
717
|
+
return wait.awaited_terminal
|
|
718
|
+
? "Terminal run " + (wait.state || "ready")
|
|
719
|
+
: "Waiting: " + (wait.state || "unknown");
|
|
720
|
+
}
|
|
721
|
+
if (data?.codexgpt_tool === "load_skill") {
|
|
722
|
+
if (data?.ok === false) return data?.error?.code || "Skill unavailable";
|
|
723
|
+
const skillData = loadSkillResultData(data);
|
|
724
|
+
return skillData?.skill?.name || "Skill instructions";
|
|
725
|
+
}
|
|
726
|
+
if (data?.codexgpt_tool === "handoff_to_agent" || data?.codexgpt_tool === "handoff_to_codex") {
|
|
727
|
+
if (data?.ok === false) return data?.error?.code || "Handoff unavailable";
|
|
728
|
+
const handoff = handoffToAgentResultData(data);
|
|
729
|
+
return handoff.agent_name || handoff.plan_path || "Handoff";
|
|
730
|
+
}
|
|
731
|
+
if (data?.path) return data.path;
|
|
732
|
+
if (data?.plan_path) return data.plan_path;
|
|
733
|
+
if (data?.root) return data.root;
|
|
734
|
+
if (data?.cwd) return data.cwd;
|
|
735
|
+
return "Tool output";
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
function pill(text, cls) {
|
|
739
|
+
return '<span class="pill ' + esc(cls || "") + '">' + esc(text) + '</span>';
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
function header(data, pills) {
|
|
743
|
+
const tool = data?.codexgpt_tool;
|
|
744
|
+
return [
|
|
745
|
+
'<div class="rail"></div>',
|
|
746
|
+
'<header class="head">',
|
|
747
|
+
'<span class="glyph">' + esc(iconFor(tool)) + '</span>',
|
|
748
|
+
'<div class="headline"><div class="title">' + esc(titleFor(tool)) + '</div><div class="subtitle">' + esc(subtitleFor(data)) + '</div></div>',
|
|
749
|
+
'<div class="meta">' + (pills || '') + '</div>',
|
|
750
|
+
'</header>'
|
|
751
|
+
].join('');
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
function metric(label, value) {
|
|
755
|
+
return '<div class="metric"><span class="label">' + esc(label) + '</span><div class="value">' + esc(value ?? "-") + '</div></div>';
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
function summaryItem(label, value) {
|
|
759
|
+
return '<div class="summary-item"><span class="summary-label">' + esc(label) + '</span><div class="summary-value">' + esc(value ?? "-") + '</div></div>';
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
function codebox(label, text, extraClass) {
|
|
763
|
+
return '<div class="code ' + esc(extraClass || "") + '"><div class="codebar"><span>' + esc(label || "output") + '</span></div><pre>' + text + '</pre></div>';
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
function fold(title, count, body, open) {
|
|
767
|
+
if (!body) return "";
|
|
768
|
+
return '<details class="fold"' + (open ? " open" : "") + '><summary><span class="fold-title">' + esc(title) + '</span><span class="fold-count">' + esc(count || "") + '</span></summary><div class="fold-body">' + body + '</div></details>';
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
function shortSource(value) {
|
|
772
|
+
if (value === "workspace") return "repo";
|
|
773
|
+
if (value === "plugin") return "plug";
|
|
774
|
+
if (value === "user") return "user";
|
|
775
|
+
return "skill";
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
function renderDiff(diff) {
|
|
779
|
+
return truncate(diff, 14000).split("\n").map((line) => {
|
|
780
|
+
let cls = "diff-line";
|
|
781
|
+
if (line.startsWith("+") && !line.startsWith("+++")) cls += " diff-add";
|
|
782
|
+
else if (line.startsWith("-") && !line.startsWith("---")) cls += " diff-del";
|
|
783
|
+
else if (line.startsWith("@@")) cls += " diff-hunk";
|
|
784
|
+
return '<span class="' + cls + '">' + esc(line) + '</span>';
|
|
785
|
+
}).join("");
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
function renderWrite(data) {
|
|
789
|
+
const writeData = data?.data ?? {};
|
|
790
|
+
const error = data?.error ?? {};
|
|
791
|
+
const failed = data?.ok === false;
|
|
792
|
+
const pills = failed
|
|
793
|
+
? pill(error.code || "error", "bad")
|
|
794
|
+
: [
|
|
795
|
+
writeData.bytes !== undefined ? pill(writeData.bytes + " bytes") : "",
|
|
796
|
+
writeData.additions !== undefined ? pill("+" + writeData.additions, "good") : "",
|
|
797
|
+
writeData.deletions !== undefined ? pill("-" + writeData.deletions, "bad") : ""
|
|
798
|
+
].join("");
|
|
799
|
+
const body = failed
|
|
800
|
+
? '<div class="empty">' + esc(error.message || "Write failed.") + '</div>'
|
|
801
|
+
: '<div class="summary">' +
|
|
802
|
+
summaryItem("Path", writeData.path || "-") +
|
|
803
|
+
summaryItem("Existed", writeData.existed ? "yes" : "no") +
|
|
804
|
+
summaryItem("SHA-256", writeData.sha256 || "-") +
|
|
805
|
+
'</div>' +
|
|
806
|
+
(writeData.diff
|
|
807
|
+
? codebox(basename(writeData.path || "file"), renderDiff(writeData.diff), "")
|
|
808
|
+
: '<div class="empty">No diff returned.</div>');
|
|
809
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' + body + '</div></article>';
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
function renderEdit(data) {
|
|
813
|
+
const editData = data?.data ?? {};
|
|
814
|
+
const error = data?.error ?? {};
|
|
815
|
+
const failed = data?.ok === false;
|
|
816
|
+
const pills = failed
|
|
817
|
+
? pill(error.code || "error", "bad")
|
|
818
|
+
: [
|
|
819
|
+
editData.replacements !== undefined ? pill(editData.replacements + " replacements", "info") : "",
|
|
820
|
+
editData.bytes !== undefined ? pill(editData.bytes + " bytes") : "",
|
|
821
|
+
editData.additions !== undefined ? pill("+" + editData.additions, "good") : "",
|
|
822
|
+
editData.deletions !== undefined ? pill("-" + editData.deletions, "bad") : ""
|
|
823
|
+
].join("");
|
|
824
|
+
const body = failed
|
|
825
|
+
? '<div class="empty">' + esc(error.message || "Edit failed.") + '</div>'
|
|
826
|
+
: '<div class="summary">' +
|
|
827
|
+
summaryItem("Path", editData.path || "-") +
|
|
828
|
+
summaryItem("SHA-256", editData.sha256 || "-") +
|
|
829
|
+
'</div>' +
|
|
830
|
+
(editData.diff
|
|
831
|
+
? codebox(basename(editData.path || "file"), renderDiff(editData.diff), "")
|
|
832
|
+
: '<div class="empty">No diff returned.</div>');
|
|
833
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' + body + '</div></article>';
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
function renderApplyPatch(data) {
|
|
837
|
+
const patchData = data?.data ?? {};
|
|
838
|
+
const error = data?.error ?? {};
|
|
839
|
+
const failed = data?.ok === false;
|
|
840
|
+
const paths = Array.isArray(patchData.paths) ? patchData.paths : [];
|
|
841
|
+
const visiblePaths = paths.slice(0, 8);
|
|
842
|
+
const pathPreview = visiblePaths.join(", ") +
|
|
843
|
+
(paths.length > visiblePaths.length ? ", … +" + (paths.length - visiblePaths.length) : "");
|
|
844
|
+
const pills = failed
|
|
845
|
+
? pill(error.code || "error", "bad")
|
|
846
|
+
: [
|
|
847
|
+
pill(paths.length + " files", "info"),
|
|
848
|
+
patchData.additions !== undefined ? pill("+" + patchData.additions, "good") : "",
|
|
849
|
+
patchData.deletions !== undefined ? pill("-" + patchData.deletions, "bad") : ""
|
|
850
|
+
].join("");
|
|
851
|
+
const body = failed
|
|
852
|
+
? '<div class="empty">' + esc(error.message || "Apply patch failed.") + '</div>'
|
|
853
|
+
: '<div class="summary">' +
|
|
854
|
+
summaryItem("Paths", pathPreview || "-") +
|
|
855
|
+
summaryItem("Changed", patchData.changed ? "yes" : "no") +
|
|
856
|
+
'</div>' +
|
|
857
|
+
(patchData.diff
|
|
858
|
+
? codebox("patch", renderDiff(patchData.diff), "")
|
|
859
|
+
: '<div class="empty">No diff returned.</div>');
|
|
860
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' + body + '</div></article>';
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
function renderFile(data) {
|
|
864
|
+
const pills = [
|
|
865
|
+
data.bytes !== undefined ? pill(data.bytes + " bytes") : "",
|
|
866
|
+
data.additions !== undefined ? pill("+" + data.additions, "good") : "",
|
|
867
|
+
data.deletions !== undefined ? pill("-" + data.deletions, "bad") : "",
|
|
868
|
+
data.replacements !== undefined ? pill(data.replacements + " replacements", "info") : ""
|
|
869
|
+
].join("");
|
|
870
|
+
const body = data.diff ? renderDiff(data.diff) : esc(truncate(data.text || ""));
|
|
871
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
872
|
+
codebox(basename(data.path || data.plan_path || "file"), body, "") +
|
|
873
|
+
'</div></article>';
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
function renderGitDiff(data) {
|
|
877
|
+
const diffData = data?.data ?? {};
|
|
878
|
+
const error = data?.error ?? {};
|
|
879
|
+
const failed = data?.ok === false;
|
|
880
|
+
const pills = failed
|
|
881
|
+
? pill(error.code || "error", "bad")
|
|
882
|
+
: [
|
|
883
|
+
diffData.changed ? pill("changed", "info") : pill("clean", "good"),
|
|
884
|
+
pill("+" + (diffData.additions ?? 0), "good"),
|
|
885
|
+
pill("-" + (diffData.deletions ?? 0), "bad")
|
|
886
|
+
].join("");
|
|
887
|
+
const body = failed
|
|
888
|
+
? '<div class="empty">' + esc(error.message || "Git diff failed.") + '</div>'
|
|
889
|
+
: '<div class="summary">' +
|
|
890
|
+
summaryItem("Staged", diffData.staged ? "yes" : "no") +
|
|
891
|
+
summaryItem("Added", "+" + (diffData.additions ?? 0)) +
|
|
892
|
+
summaryItem("Deleted", "-" + (diffData.deletions ?? 0)) +
|
|
893
|
+
'</div>' +
|
|
894
|
+
(diffData.diff
|
|
895
|
+
? codebox("diff", renderDiff(diffData.diff), "")
|
|
896
|
+
: '<div class="empty">' + esc(diffData.changed ? "Raw diff omitted." : "No changes.") + '</div>');
|
|
897
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' + body + '</div></article>';
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
function renderChanges(data) {
|
|
901
|
+
const review = data?.data ?? {};
|
|
902
|
+
const files = Array.isArray(review.changed_files) ? review.changed_files : [];
|
|
903
|
+
const error = data?.error ?? {};
|
|
904
|
+
const warnings = Array.isArray(data?.meta?.warnings) ? data.meta.warnings : [];
|
|
905
|
+
const failed = data?.ok === false;
|
|
906
|
+
const changed = Boolean(review.changed);
|
|
907
|
+
const pills = [
|
|
908
|
+
failed ? pill("git unavailable", "warn") : changed ? pill("changed", "info") : pill("clean", "good"),
|
|
909
|
+
review.additions !== undefined ? pill("+" + review.additions, "good") : "",
|
|
910
|
+
review.deletions !== undefined ? pill("-" + review.deletions, "bad") : ""
|
|
911
|
+
].join("");
|
|
912
|
+
const fileRows = files.slice(0, 10).map((line) => {
|
|
913
|
+
const status = String(line).slice(0, 2).trim() || "?";
|
|
914
|
+
const name = String(line).slice(2).trim() || String(line);
|
|
915
|
+
return '<div class="file-row"><span class="file-code">' + esc(status) + '</span><span class="file-name">' + esc(name) + '</span></div>';
|
|
916
|
+
}).join("");
|
|
917
|
+
const moreFiles = files.length > 10 ? '<div class="empty">+' + esc(files.length - 10) + ' more changed files</div>' : "";
|
|
918
|
+
const state = failed
|
|
919
|
+
? '<div class="empty">' + esc(error.message || "Git state unavailable.") + '</div>'
|
|
920
|
+
: fileRows
|
|
921
|
+
? '<div class="file-list">' + fileRows + '</div>' + moreFiles
|
|
922
|
+
: '<div class="empty">No changed files.</div>';
|
|
923
|
+
const warning = warnings.length ? '<div class="empty">' + esc(warnings[0]) + '</div>' : "";
|
|
924
|
+
const diff = review.diff ? codebox("diff", renderDiff(review.diff), "") : "";
|
|
925
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
926
|
+
'<div class="summary">' +
|
|
927
|
+
summaryItem("Files", files.length) +
|
|
928
|
+
summaryItem("Added", "+" + (review.additions ?? 0)) +
|
|
929
|
+
summaryItem("Deleted", "-" + (review.deletions ?? 0)) +
|
|
930
|
+
'</div>' +
|
|
931
|
+
state +
|
|
932
|
+
warning +
|
|
933
|
+
diff +
|
|
934
|
+
'</div></article>';
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
function compactRows(values, code, max = 8) {
|
|
938
|
+
const items = Array.isArray(values) ? values : [];
|
|
939
|
+
const rows = items.slice(0, max).map((value) => {
|
|
940
|
+
const label = typeof value === "string" ? value : (value?.path || value?.label || value?.name || "item");
|
|
941
|
+
const detail = typeof value === "object" && value ? (value?.reasons || []).join(", ") : "";
|
|
942
|
+
return '<div class="file-row"><span class="file-code">' + esc(code) + '</span><span class="file-name">' + esc(label + (detail ? ": " + detail : "")) + '</span></div>';
|
|
943
|
+
}).join("");
|
|
944
|
+
const more = items.length > max ? '<div class="empty">+' + esc(items.length - max) + ' more</div>' : "";
|
|
945
|
+
return '<div class="file-list">' + (rows || '<div class="empty">None.</div>') + more + '</div>';
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
function renderWorkspaceAnalysis(data) {
|
|
949
|
+
const failed = data?.ok === false;
|
|
950
|
+
const error = data?.error ?? {};
|
|
951
|
+
const analysis = inspectWorkspaceResultData(data);
|
|
952
|
+
const coverage = analysis.coverage || {};
|
|
953
|
+
const languages = Array.isArray(analysis.languages) ? analysis.languages : [];
|
|
954
|
+
const projects = Array.isArray(analysis.project_types) ? analysis.project_types : [];
|
|
955
|
+
const entrypoints = Array.isArray(analysis.entrypoints) ? analysis.entrypoints : [];
|
|
956
|
+
const areas = Array.isArray(analysis.areas) ? analysis.areas : [];
|
|
957
|
+
const symbols = Array.isArray(analysis.symbols) ? analysis.symbols : [];
|
|
958
|
+
const relationships = Array.isArray(analysis.relationships) ? analysis.relationships : [];
|
|
959
|
+
const warnings = Array.isArray(analysis.warnings) ? analysis.warnings : [];
|
|
960
|
+
const partial = Boolean(coverage.truncated || analysis.output_limited);
|
|
961
|
+
const pills = failed
|
|
962
|
+
? pill(error.code || "error", "bad")
|
|
963
|
+
: [
|
|
964
|
+
pill(projects.join(", ") || "project", "info"),
|
|
965
|
+
pill(languages.length + " languages"),
|
|
966
|
+
partial ? pill("limited", "warn") : pill("complete", "good")
|
|
967
|
+
].join("");
|
|
968
|
+
if (failed) {
|
|
969
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
970
|
+
'<div class="empty">' + esc(error.message || "Workspace analysis unavailable.") + '</div>' +
|
|
971
|
+
'</div></article>';
|
|
972
|
+
}
|
|
973
|
+
const relationshipRows = relationships.slice(0, 8).map((edge) =>
|
|
974
|
+
'<div class="file-row"><span class="file-code">' + esc(edge?.kind || "edge") + '</span><span class="file-name">' + esc((edge?.from || "?") + " → " + (edge?.to || "?")) + '</span></div>'
|
|
975
|
+
).join("");
|
|
976
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
977
|
+
'<div class="summary">' +
|
|
978
|
+
summaryItem("Files", coverage.inventoryFiles ?? coverage.inventory_files ?? 0) +
|
|
979
|
+
summaryItem("Analyzed", coverage.analyzedFiles ?? coverage.analyzed_files ?? 0) +
|
|
980
|
+
summaryItem("Symbols", coverage.symbolCount ?? coverage.symbol_count ?? symbols.length) +
|
|
981
|
+
'</div>' +
|
|
982
|
+
'<div class="section-label">Entrypoints</div>' + compactRows(entrypoints, "entry") +
|
|
983
|
+
fold("Areas", areas.length + " areas", compactRows(areas, "area"), false) +
|
|
984
|
+
fold("Symbols", symbols.length + " symbols", compactRows(symbols, "sym"), false) +
|
|
985
|
+
fold("Relationships", relationships.length + " edges", '<div class="file-list">' + (relationshipRows || '<div class="empty">None.</div>') + '</div>', false) +
|
|
986
|
+
(warnings.length ? fold("Warnings", warnings.length + " warnings", compactRows(warnings, "warn"), false) : "") +
|
|
987
|
+
'</div></article>';
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
function renderStructuredSearch(data) {
|
|
991
|
+
const search = data?.data ?? {};
|
|
992
|
+
const analysis = search.analysis || {};
|
|
993
|
+
const groups = analysis.groups || {};
|
|
994
|
+
const order = ["definitions", "references", "tests", "configuration", "documentation", "other"];
|
|
995
|
+
const count = order.reduce((sum, name) => sum + (Array.isArray(groups[name]) ? groups[name].length : 0), 0);
|
|
996
|
+
const sections = order.map((name) => {
|
|
997
|
+
const matches = Array.isArray(groups[name]) ? groups[name] : [];
|
|
998
|
+
if (!matches.length) return "";
|
|
999
|
+
const rows = matches.slice(0, 8).map((match) =>
|
|
1000
|
+
'<div class="hit"><div class="hit-file">' + esc((match.path || "match") + ":" + (match.line || 0)) + '</div><div class="hit-text">' + esc((match.text || "") + (match.reasons?.length ? ": " + match.reasons.join(", ") : "")) + '</div></div>'
|
|
1001
|
+
).join("");
|
|
1002
|
+
const more = matches.length > 8 ? '<div class="empty">+' + esc(matches.length - 8) + ' more</div>' : "";
|
|
1003
|
+
return fold(name, matches.length + " matches", '<div class="search">' + rows + more + '</div>', name === "definitions");
|
|
1004
|
+
}).join("");
|
|
1005
|
+
const coverage = analysis.coverage || {};
|
|
1006
|
+
const pills = [pill(count + " grouped matches", "info"), pill(analysis.intent || "structured"), coverage.truncated ? pill("partial", "warn") : ""].join("");
|
|
1007
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
1008
|
+
'<div class="summary">' + summaryItem("Definitions", groups.definitions?.length ?? 0) + summaryItem("References", groups.references?.length ?? 0) + summaryItem("Tests", groups.tests?.length ?? 0) + '</div>' +
|
|
1009
|
+
(sections || '<div class="empty">No grouped matches.</div>') +
|
|
1010
|
+
'</div></article>';
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
function renderChangeAnalysis(data) {
|
|
1014
|
+
const review = data?.data ?? {};
|
|
1015
|
+
const analysis = review.analysis ?? {};
|
|
1016
|
+
const files = Array.isArray(review.changed_files) ? review.changed_files : [];
|
|
1017
|
+
const risks = Array.isArray(analysis.risk_signals) ? analysis.risk_signals : [];
|
|
1018
|
+
const tests = Array.isArray(analysis.related_tests) ? analysis.related_tests : [];
|
|
1019
|
+
const commands = Array.isArray(analysis.recommended_commands) ? analysis.recommended_commands : [];
|
|
1020
|
+
const affected = Array.isArray(analysis.affected_areas) ? analysis.affected_areas : [];
|
|
1021
|
+
const pills = [
|
|
1022
|
+
pill(review.changed ? "changed" : "clean", review.changed ? "info" : "good"),
|
|
1023
|
+
risks.length ? pill(risks.length + " risks", "warn") : pill("no risks", "good"),
|
|
1024
|
+
pill("+" + (review.additions ?? 0), "good"),
|
|
1025
|
+
pill("-" + (review.deletions ?? 0), "bad")
|
|
1026
|
+
].join("");
|
|
1027
|
+
const commandRows = commands.slice(0, 8).map((item) =>
|
|
1028
|
+
'<div class="file-row"><span class="file-code">run</span><span class="file-name">' + esc(item?.command || "") + '</span></div>'
|
|
1029
|
+
).join("");
|
|
1030
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
1031
|
+
'<div class="summary">' + summaryItem("Files", files.length) + summaryItem("Areas", affected.length) + summaryItem("Tests", tests.length) + '</div>' +
|
|
1032
|
+
'<div class="section-label">Affected areas</div>' + compactRows(affected, "area") +
|
|
1033
|
+
fold("Risk signals", risks.length + " signals", compactRows(risks, "risk"), risks.length > 0) +
|
|
1034
|
+
fold("Related tests", tests.length + " tests", compactRows(tests, "test"), false) +
|
|
1035
|
+
fold("Verification", commands.length + " commands", '<div class="file-list">' + (commandRows || '<div class="empty">None.</div>') + '</div>', false) +
|
|
1036
|
+
(review.diff ? fold("Diff", "+" + (review.additions ?? 0) + " -" + (review.deletions ?? 0), codebox("diff", renderDiff(review.diff), ""), false) : "") +
|
|
1037
|
+
'</div></article>';
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
function gitStatusRows(status, max = 8) {
|
|
1041
|
+
return String(status || "")
|
|
1042
|
+
.split("\n")
|
|
1043
|
+
.map((line) => line.trim())
|
|
1044
|
+
.filter((line) => line && !line.startsWith("##"))
|
|
1045
|
+
.slice(0, max)
|
|
1046
|
+
.map((line) => {
|
|
1047
|
+
const code = line.slice(0, 2).trim() || "?";
|
|
1048
|
+
const name = line.slice(2).trim() || line;
|
|
1049
|
+
return '<div class="file-row"><span class="file-code">' + esc(code) + '</span><span class="file-name">' + esc(name) + '</span></div>';
|
|
1050
|
+
})
|
|
1051
|
+
.join("");
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
function renderWorkspace(data) {
|
|
1055
|
+
const workspace = workspaceResultData(data);
|
|
1056
|
+
const error = data?.error ?? {};
|
|
1057
|
+
if (data?.ok === false) {
|
|
1058
|
+
return '<article class="card">' +
|
|
1059
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1060
|
+
'<div class="body"><div class="empty">' +
|
|
1061
|
+
esc(error.message || "Workspace unavailable.") +
|
|
1062
|
+
'</div></div></article>';
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
const skills = Array.isArray(workspace.skill_inventory)
|
|
1066
|
+
? workspace.skill_inventory
|
|
1067
|
+
: (Array.isArray(workspace.skills) ? workspace.skills : []);
|
|
1068
|
+
const skillCount = Number(workspace.skill_counts?.total ?? skills.length);
|
|
1069
|
+
const changedRows = gitStatusRows(workspace.git_status, 8);
|
|
1070
|
+
const gitLines = String(workspace.git_status || "").split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("##"));
|
|
1071
|
+
const agentsLabel = workspace.agents_loaded ? (workspace.agents_path || "AGENTS.md") : "no AGENTS";
|
|
1072
|
+
const pills = [
|
|
1073
|
+
pill(agentsLabel, workspace.agents_loaded ? "good" : "warn"),
|
|
1074
|
+
pill(skillCount + " skills", skillCount ? "info" : ""),
|
|
1075
|
+
workspace.tool_mode ? pill("tools " + workspace.tool_mode) : ""
|
|
1076
|
+
].join("");
|
|
1077
|
+
const contextRows = [
|
|
1078
|
+
'<div class="file-row"><span class="file-code">root</span><span class="file-name">' + esc(workspace.root || ".") + '</span></div>',
|
|
1079
|
+
workspace.workspace_id ? '<div class="file-row"><span class="file-code">id</span><span class="file-name">' + esc(workspace.workspace_id) + '</span></div>' : "",
|
|
1080
|
+
workspace.agents_loaded ? '<div class="file-row"><span class="file-code">rules</span><span class="file-name">' + esc(workspace.agents_path || "AGENTS.md") + '</span></div>' : ""
|
|
1081
|
+
].join("");
|
|
1082
|
+
const skillRows = skills.slice(0, 16).map((skill) => {
|
|
1083
|
+
const value = typeof skill === "string" ? skill : (skill?.name || "skill");
|
|
1084
|
+
const source = typeof skill === "string" ? "skill" : shortSource(skill?.source);
|
|
1085
|
+
return '<div class="file-row"><span class="file-code">' + esc(source) + '</span><span class="file-name">' + esc(value) + '</span></div>';
|
|
1086
|
+
}).join("");
|
|
1087
|
+
const skillText = skills.length
|
|
1088
|
+
? '<div class="file-list">' + skillRows + '</div>' + (skills.length > 16 ? '<div class="empty">+' + esc(skills.length - 16) + ' more skills</div>' : "")
|
|
1089
|
+
: '<div class="empty">No skills discovered. Use include_global_skills=true if this is unexpected.</div>';
|
|
1090
|
+
const gitText = changedRows
|
|
1091
|
+
? '<div class="file-list">' + changedRows + '</div>' + (gitLines.length > 8 ? '<div class="empty">+' + esc(gitLines.length - 8) + ' more changed files</div>' : "")
|
|
1092
|
+
: '<div class="empty">Working tree clean.</div>';
|
|
1093
|
+
const aiContextFiles = Array.isArray(workspace.ai_context_files)
|
|
1094
|
+
? workspace.ai_context_files
|
|
1095
|
+
: [];
|
|
1096
|
+
const aiContextRows = aiContextFiles.slice(0, 12).map((file) =>
|
|
1097
|
+
'<div class="file-row"><span class="file-code">ctx</span><span class="file-name">' + esc(file) + '</span></div>'
|
|
1098
|
+
).join("");
|
|
1099
|
+
const aiContextText = aiContextFiles.length
|
|
1100
|
+
? '<div class="file-list">' + aiContextRows + '</div>' + (aiContextFiles.length > 12 ? '<div class="empty">+' + esc(aiContextFiles.length - 12) + ' more context files</div>' : "")
|
|
1101
|
+
: '<div class="empty">No readable AI handoff files.</div>';
|
|
1102
|
+
const aiContextSection = data?.codexgpt_tool === "workspace_snapshot"
|
|
1103
|
+
? fold("AI handoff", aiContextFiles.length + " files", aiContextText, false)
|
|
1104
|
+
: "";
|
|
1105
|
+
const tree = workspace.tree ? codebox("tree", esc(previewLines(workspace.tree, 18)), "") : "";
|
|
1106
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
1107
|
+
'<div class="summary">' +
|
|
1108
|
+
summaryItem("Write", workspace.write_mode || "-") +
|
|
1109
|
+
summaryItem("Bash", workspace.bash_mode || "-") +
|
|
1110
|
+
summaryItem("Tools", workspace.tool_mode || "-") +
|
|
1111
|
+
'</div>' +
|
|
1112
|
+
'<div class="section-label">Context</div><div class="file-list">' + contextRows + '</div>' +
|
|
1113
|
+
fold("Git", gitLines.length ? gitLines.length + " changed" : "clean", gitText, false) +
|
|
1114
|
+
aiContextSection +
|
|
1115
|
+
fold("Skills", skillCount + " discovered", skillText, false) +
|
|
1116
|
+
fold("Tree", workspace.tree ? "available" : "", tree, false) +
|
|
1117
|
+
'</div></article>';
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
function renderHandoff(data) {
|
|
1121
|
+
const handoff = handoffToAgentResultData(data);
|
|
1122
|
+
const error = data?.error ?? {};
|
|
1123
|
+
if (data?.ok === false) {
|
|
1124
|
+
return '<article class="card">' +
|
|
1125
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1126
|
+
'<div class="body"><div class="empty">' +
|
|
1127
|
+
esc(error.message || "Agent handoff unavailable.") +
|
|
1128
|
+
'</div></div></article>';
|
|
1129
|
+
}
|
|
1130
|
+
const pills = [
|
|
1131
|
+
handoff.agent_name ? pill(handoff.agent_name, "info") : "",
|
|
1132
|
+
handoff.model ? pill(handoff.model) : "",
|
|
1133
|
+
handoff.append_requested ? pill(handoff.append_applied ? "appended" : "new plan", handoff.append_applied ? "good" : "warn") : "",
|
|
1134
|
+
handoff.additions !== undefined ? pill("+" + handoff.additions, "good") : "",
|
|
1135
|
+
handoff.deletions !== undefined ? pill("-" + handoff.deletions, "bad") : ""
|
|
1136
|
+
].join("");
|
|
1137
|
+
const rows = [
|
|
1138
|
+
handoff.plan_path ? '<div class="file-row"><span class="file-code">plan</span><span class="file-name">' + esc(handoff.plan_path) + '</span></div>' : "",
|
|
1139
|
+
handoff.status_path ? '<div class="file-row"><span class="file-code">status</span><span class="file-name">' + esc(handoff.status_path) + '</span></div>' : "",
|
|
1140
|
+
handoff.diff_path ? '<div class="file-row"><span class="file-code">diff</span><span class="file-name">' + esc(handoff.diff_path) + '</span></div>' : "",
|
|
1141
|
+
handoff.log_path ? '<div class="file-row"><span class="file-code">log</span><span class="file-name">' + esc(handoff.log_path) + '</span></div>' : "",
|
|
1142
|
+
handoff.execution_log_path ? '<div class="file-row"><span class="file-code">exec</span><span class="file-name">' + esc(handoff.execution_log_path) + '</span></div>' : ""
|
|
1143
|
+
].join("");
|
|
1144
|
+
const prompt = handoff.prompt
|
|
1145
|
+
? codebox("agent prompt", esc(truncate(handoff.prompt, 4000)), "terminal")
|
|
1146
|
+
: "";
|
|
1147
|
+
const diff = handoff.diff
|
|
1148
|
+
? codebox("plan file diff", renderDiff(truncate(handoff.diff, 9000)), "")
|
|
1149
|
+
: "";
|
|
1150
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
1151
|
+
(handoff.plan_sha256 ? '<div class="summary">' +
|
|
1152
|
+
summaryItem("Plan hash", String(handoff.plan_sha256).slice(0, 12)) +
|
|
1153
|
+
summaryItem("Bytes", handoff.plan_bytes ?? "-") +
|
|
1154
|
+
summaryItem("Logged", handoff.logged_count ?? "-") +
|
|
1155
|
+
'</div>' : "") +
|
|
1156
|
+
'<div class="file-list">' + rows + '</div>' +
|
|
1157
|
+
prompt + diff +
|
|
1158
|
+
'</div></article>';
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
function renderBash(data) {
|
|
1162
|
+
const commandResult = data?.data ?? {};
|
|
1163
|
+
const error = data?.error ?? {};
|
|
1164
|
+
if (data?.ok === false) {
|
|
1165
|
+
return '<article class="card">' +
|
|
1166
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1167
|
+
'<div class="body"><div class="empty">' +
|
|
1168
|
+
esc(error.message || "Bash unavailable.") +
|
|
1169
|
+
'</div></div></article>';
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
const commandPassed = Number(commandResult.exitCode) === 0;
|
|
1173
|
+
const stdoutLines = countLines(commandResult.stdout);
|
|
1174
|
+
const stderrLines = countLines(commandResult.stderr);
|
|
1175
|
+
const totalLines = stdoutLines + stderrLines;
|
|
1176
|
+
const pills = [
|
|
1177
|
+
pill(commandPassed ? "passed" : "failed", commandPassed ? "good" : "bad"),
|
|
1178
|
+
commandResult.signal ? pill(commandResult.signal, "warn") : "",
|
|
1179
|
+
commandResult.truncated ? pill("truncated", "warn") : "",
|
|
1180
|
+
commandResult.bash_session_id ? pill("session " + commandResult.bash_session_id, "info") : "",
|
|
1181
|
+
pill(totalLines + " lines", "info"),
|
|
1182
|
+
pill((commandResult.durationMs ?? "-") + " ms")
|
|
1183
|
+
].join("");
|
|
1184
|
+
const command = '<span class="prompt">$</span> ' + esc(truncate(commandResult.command || "", 1000));
|
|
1185
|
+
const stdout = previewLines(commandResult.stdout || "", 18);
|
|
1186
|
+
const stderr = previewLines(commandResult.stderr || "", 18);
|
|
1187
|
+
const outputBoxes = [
|
|
1188
|
+
stdout ? fold("stdout", stdoutLines + " lines", codebox("stdout preview", esc(truncate(stdout, 5000)), "terminal"), false) : "",
|
|
1189
|
+
stderr ? fold("stderr", stderrLines + " lines", codebox("stderr preview", esc(truncate(stderr, 5000)), "terminal"), false) : ""
|
|
1190
|
+
].join("") || '<div class="empty">Command produced no output.</div>';
|
|
1191
|
+
|
|
1192
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
1193
|
+
'<div class="summary">' +
|
|
1194
|
+
summaryItem("Exit", commandResult.exitCode ?? "-") +
|
|
1195
|
+
summaryItem("Signal", commandResult.signal || "-") +
|
|
1196
|
+
summaryItem("Lines", totalLines) +
|
|
1197
|
+
summaryItem("Duration", (commandResult.durationMs ?? "-") + " ms") +
|
|
1198
|
+
'</div>' +
|
|
1199
|
+
codebox("command", command, "terminal") +
|
|
1200
|
+
outputBoxes +
|
|
1201
|
+
'</div></article>';
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
function renderSearch(data) {
|
|
1205
|
+
const search = data?.data ?? {};
|
|
1206
|
+
const error = data?.error ?? {};
|
|
1207
|
+
if (data?.ok === false) {
|
|
1208
|
+
return '<article class="card">' +
|
|
1209
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1210
|
+
'<div class="body"><div class="empty">' +
|
|
1211
|
+
esc(error.message || "Search unavailable.") +
|
|
1212
|
+
'</div></div></article>';
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
const matches = Array.isArray(search.matches) ? search.matches : [];
|
|
1216
|
+
const hits = matches.slice(0, 90).map((match) => {
|
|
1217
|
+
const file = (match?.path || "match") + ":" + (match?.line || 0);
|
|
1218
|
+
const body = match?.text || "";
|
|
1219
|
+
return '<div class="hit"><div class="hit-file">' + esc(file) + '</div><div class="hit-text">' + esc(body) + '</div></div>';
|
|
1220
|
+
}).join("") || '<div class="muted">No matches.</div>';
|
|
1221
|
+
return '<article class="card">' + header(data, pill(matches.length + " matches", "info") + pill(search.used || "search")) +
|
|
1222
|
+
'<div class="body"><div class="search">' + hits + '</div></div></article>';
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
function renderSelfTest(data) {
|
|
1226
|
+
const error = data?.error ?? {};
|
|
1227
|
+
if (data?.ok === false) {
|
|
1228
|
+
return '<article class="card">' +
|
|
1229
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1230
|
+
'<div class="body"><div class="empty">' +
|
|
1231
|
+
esc(error.message || "Self-test unavailable.") +
|
|
1232
|
+
'</div></div></article>';
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
const selfTest = selfTestResultData(data);
|
|
1236
|
+
const checks = Array.isArray(selfTest.checks) ? selfTest.checks : [];
|
|
1237
|
+
const counts = selfTest.counts ?? {};
|
|
1238
|
+
const status = String(selfTest.status || "unknown");
|
|
1239
|
+
const expectedTools = Array.isArray(selfTest.expected_tools) ? selfTest.expected_tools : [];
|
|
1240
|
+
const missingTools = Array.isArray(selfTest.missing_tools) ? selfTest.missing_tools : [];
|
|
1241
|
+
const unexpectedTools = Array.isArray(selfTest.unexpected_tools) ? selfTest.unexpected_tools : [];
|
|
1242
|
+
const pills = [
|
|
1243
|
+
pill(status, status === "pass" ? "good" : status === "fail" ? "bad" : "warn"),
|
|
1244
|
+
pill(expectedTools.length + " tools", "info"),
|
|
1245
|
+
pill((data?.meta?.durationMs ?? "-") + " ms")
|
|
1246
|
+
].join("");
|
|
1247
|
+
const rows = checks.slice(0, 17).map((check) => {
|
|
1248
|
+
const state = String(check?.status || "?").toUpperCase();
|
|
1249
|
+
const cls = check?.status === "pass" ? "good" : check?.status === "fail" ? "bad" : "warn";
|
|
1250
|
+
const label = (check?.name || "check") + " [" + (check?.code || "-") + "]: " + (check?.message || "");
|
|
1251
|
+
return '<div class="file-row"><span class="file-code ' + esc(cls) + '">' + esc(state) + '</span><span class="file-name">' + esc(label) + '</span></div>';
|
|
1252
|
+
}).join("");
|
|
1253
|
+
const mismatch = [
|
|
1254
|
+
missingTools.length ? fold("Missing tools", missingTools.length + " tools", codebox("missing", esc(missingTools.join("\\n")), ""), false) : "",
|
|
1255
|
+
unexpectedTools.length ? fold("Unexpected tools", unexpectedTools.length + " tools", codebox("unexpected", esc(unexpectedTools.join("\\n")), ""), false) : ""
|
|
1256
|
+
].join("");
|
|
1257
|
+
const artifact = selfTest.probe_artifact
|
|
1258
|
+
? '<div class="file-list"><div class="file-row"><span class="file-code">probe</span><span class="file-name">' + esc(selfTest.probe_artifact) + '</span></div></div>'
|
|
1259
|
+
: "";
|
|
1260
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
1261
|
+
'<div class="summary">' +
|
|
1262
|
+
summaryItem("Passed", counts.passed ?? 0) +
|
|
1263
|
+
summaryItem("Warned", counts.warned ?? 0) +
|
|
1264
|
+
summaryItem("Failed", counts.failed ?? 0) +
|
|
1265
|
+
summaryItem("Skipped", counts.skipped ?? 0) +
|
|
1266
|
+
'</div>' +
|
|
1267
|
+
'<div class="file-list">' + (rows || '<div class="empty">No checks returned.</div>') + '</div>' +
|
|
1268
|
+
mismatch + artifact +
|
|
1269
|
+
fold("Expected tools", expectedTools.length + " tools", codebox("tools", esc(expectedTools.join("\\n")), ""), false) +
|
|
1270
|
+
'</div></article>';
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
function renderInventory(data) {
|
|
1274
|
+
const error = data?.error ?? {};
|
|
1275
|
+
if (data?.ok === false) {
|
|
1276
|
+
return '<article class="card">' +
|
|
1277
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1278
|
+
'<div class="body"><div class="empty">' +
|
|
1279
|
+
esc(error.message || "Inventory unavailable.") +
|
|
1280
|
+
'</div></div></article>';
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
const inventory = inventoryResultData(data);
|
|
1284
|
+
const skills = Array.isArray(inventory.skills) ? inventory.skills : [];
|
|
1285
|
+
const servers = Array.isArray(inventory.mcp_servers) ? inventory.mcp_servers : [];
|
|
1286
|
+
const limited = inventory.skills_truncated || inventory.mcp_servers_truncated;
|
|
1287
|
+
const skillRows = skills.slice(0, 18).map((skill) =>
|
|
1288
|
+
'<div class="file-row"><span class="file-code">' + esc(shortSource(skill?.source)) + '</span><span class="file-name">' + esc((skill?.name || "skill") + (skill?.description ? " — " + skill.description : "")) + '</span></div>'
|
|
1289
|
+
).join("");
|
|
1290
|
+
const serverRows = servers.slice(0, 18).map((server) =>
|
|
1291
|
+
'<div class="file-row"><span class="file-code">mcp</span><span class="file-name">' + esc((server?.name || "server") + (server?.source ? " — " + server.source : "")) + '</span></div>'
|
|
1292
|
+
).join("");
|
|
1293
|
+
return '<article class="card">' + header(data, pill((inventory.skill_count ?? skills.length) + " skills", "info") + pill((inventory.mcp_server_count ?? servers.length) + " MCP") + (limited ? pill("limited", "warn") : "")) +
|
|
1294
|
+
'<div class="body">' +
|
|
1295
|
+
'<div class="summary">' +
|
|
1296
|
+
summaryItem("Write", inventory.write_mode || "-") +
|
|
1297
|
+
summaryItem("Bash", inventory.bash_mode || "-") +
|
|
1298
|
+
summaryItem("Tools", inventory.tool_mode || "-") +
|
|
1299
|
+
'</div>' +
|
|
1300
|
+
fold("Skills", (inventory.skill_count ?? skills.length) + (inventory.skills_truncated ? " returned, limited" : " found"), '<div class="file-list">' + (skillRows || '<div class="empty">No skills discovered.</div>') + '</div>', false) +
|
|
1301
|
+
fold("MCP servers", (inventory.mcp_server_count ?? servers.length) + (inventory.mcp_servers_truncated ? " returned, limited" : " found"), '<div class="file-list">' + (serverRows || '<div class="empty">No MCP server names discovered.</div>') + '</div>', false) +
|
|
1302
|
+
'</div></article>';
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
function renderCodexSessions(data) {
|
|
1306
|
+
const error = data?.error ?? {};
|
|
1307
|
+
if (data?.ok === false) {
|
|
1308
|
+
return '<article class="card">' +
|
|
1309
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1310
|
+
'<div class="body"><div class="empty">' +
|
|
1311
|
+
esc(error.message || "Session index unavailable.") +
|
|
1312
|
+
'</div></div></article>';
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
const index = codexSessionsResultData(data);
|
|
1316
|
+
const sessions = Array.isArray(index.sessions) ? index.sessions : [];
|
|
1317
|
+
const rows = sessions.slice(0, 12).map((session) => {
|
|
1318
|
+
const id = truncate(session?.session_id || "session", 48);
|
|
1319
|
+
const title = truncate(session?.title || "(untitled)", 140);
|
|
1320
|
+
const project = truncate(session?.project_dir || "cwd unknown", 180);
|
|
1321
|
+
const resume = truncate(session?.resume_command || "", 96);
|
|
1322
|
+
const detail = title + " — " + project + (resume ? " — " + resume : "");
|
|
1323
|
+
return '<div class="file-row"><span class="file-code">' +
|
|
1324
|
+
esc(session?.storage === "archived" ? "arc" : "run") +
|
|
1325
|
+
'</span><span class="file-name" title="' + esc(id) + '">' +
|
|
1326
|
+
esc(detail) + '</span></div>';
|
|
1327
|
+
}).join("");
|
|
1328
|
+
const limited = index.output_limited === true;
|
|
1329
|
+
const pills = [
|
|
1330
|
+
pill((index.session_count ?? sessions.length) + " returned", "info"),
|
|
1331
|
+
pill((index.total_found ?? 0) + " matched"),
|
|
1332
|
+
limited ? pill("limited", "warn") : pill("complete", "good")
|
|
1333
|
+
].join("");
|
|
1334
|
+
|
|
1335
|
+
return '<article class="card">' + header(data, pills) +
|
|
1336
|
+
'<div class="body">' +
|
|
1337
|
+
'<div class="summary">' +
|
|
1338
|
+
summaryItem("Scanned", index.scanned_file_count ?? 0) +
|
|
1339
|
+
summaryItem("Indexed", index.indexed_session_count ?? 0) +
|
|
1340
|
+
summaryItem("Excluded", index.excluded_file_count ?? 0) +
|
|
1341
|
+
'</div>' +
|
|
1342
|
+
'<div class="file-list">' +
|
|
1343
|
+
(rows || '<div class="empty">No matching Codex sessions.</div>') +
|
|
1344
|
+
'</div>' +
|
|
1345
|
+
(sessions.length > 12
|
|
1346
|
+
? '<div class="empty">' + esc(sessions.length - 12) + ' more sessions remain in structured data.</div>'
|
|
1347
|
+
: "") +
|
|
1348
|
+
'</div></article>';
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
function renderReadCodexSession(data) {
|
|
1352
|
+
const error = data?.error ?? {};
|
|
1353
|
+
if (data?.ok === false) {
|
|
1354
|
+
return '<article class="card">' +
|
|
1355
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1356
|
+
'<div class="body"><div class="empty">' +
|
|
1357
|
+
esc(error.message || "Transcript unavailable.") +
|
|
1358
|
+
'</div></div></article>';
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
const transcript = readCodexSessionResultData(data);
|
|
1362
|
+
const session = transcript.session ?? {};
|
|
1363
|
+
const messages = Array.isArray(transcript.messages) ? transcript.messages : [];
|
|
1364
|
+
const previews = messages.slice(0, 8).map((message) => {
|
|
1365
|
+
const label = (message?.ordinal ?? "-") + ". " +
|
|
1366
|
+
(message?.role || "unknown") + " / " +
|
|
1367
|
+
(message?.kind || "message");
|
|
1368
|
+
const content = truncate(message?.content || "", 600);
|
|
1369
|
+
return codebox(label, esc(content), message?.truncated ? "warn" : "");
|
|
1370
|
+
}).join("");
|
|
1371
|
+
const limited = transcript.output_limited === true;
|
|
1372
|
+
const pills = [
|
|
1373
|
+
pill((transcript.message_count ?? messages.length) + " messages", "info"),
|
|
1374
|
+
pill((transcript.content_bytes ?? 0) + " bytes"),
|
|
1375
|
+
limited ? pill("limited", "warn") : pill("complete", "good")
|
|
1376
|
+
].join("");
|
|
1377
|
+
|
|
1378
|
+
return '<article class="card">' + header(data, pills) +
|
|
1379
|
+
'<div class="body">' +
|
|
1380
|
+
'<div class="summary">' +
|
|
1381
|
+
summaryItem("Session", truncate(session.session_id || "-", 48)) +
|
|
1382
|
+
summaryItem("Title", truncate(session.title || "(untitled)", 100)) +
|
|
1383
|
+
summaryItem("Selection", transcript.selection || "-") +
|
|
1384
|
+
'</div>' +
|
|
1385
|
+
(previews || '<div class="empty">No readable transcript messages.</div>') +
|
|
1386
|
+
(messages.length > 8
|
|
1387
|
+
? '<div class="empty">' + esc(messages.length - 8) + ' more messages remain in structured data.</div>'
|
|
1388
|
+
: "") +
|
|
1389
|
+
'</div></article>';
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
function renderLoadSkill(data) {
|
|
1393
|
+
const error = data?.error ?? {};
|
|
1394
|
+
if (data?.ok === false) {
|
|
1395
|
+
return '<article class="card">' +
|
|
1396
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1397
|
+
'<div class="body"><div class="empty">' +
|
|
1398
|
+
esc(error.message || "Skill unavailable.") +
|
|
1399
|
+
'</div></div></article>';
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
const skillData = loadSkillResultData(data);
|
|
1403
|
+
const skill = skillData?.skill ?? {};
|
|
1404
|
+
const pills = [
|
|
1405
|
+
pill(shortSource(skill.source), "info"),
|
|
1406
|
+
pill((skillData.returned_bytes ?? 0) + " returned bytes"),
|
|
1407
|
+
skillData.truncated ? pill("partial", "warn") : pill("complete", "good"),
|
|
1408
|
+
skillData.redacted ? pill("redacted", "warn") : ""
|
|
1409
|
+
].join("");
|
|
1410
|
+
|
|
1411
|
+
return '<article class="card">' +
|
|
1412
|
+
header(data, pills) +
|
|
1413
|
+
'<div class="body">' +
|
|
1414
|
+
'<div class="metrics">' +
|
|
1415
|
+
metric("skill", skill.name || "-") +
|
|
1416
|
+
metric("source", skill.source || "-") +
|
|
1417
|
+
metric("path", skill.path || "-") +
|
|
1418
|
+
'</div>' +
|
|
1419
|
+
codebox(
|
|
1420
|
+
"SKILL.md",
|
|
1421
|
+
esc(previewLines(skillData.text, 80)),
|
|
1422
|
+
""
|
|
1423
|
+
) +
|
|
1424
|
+
'</div></article>';
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
function renderWorkspaces(data) {
|
|
1428
|
+
const error = data?.error ?? {};
|
|
1429
|
+
if (data?.ok === false) {
|
|
1430
|
+
return '<article class="card">' +
|
|
1431
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1432
|
+
'<div class="body"><div class="empty">' +
|
|
1433
|
+
esc(error.message || "Workspace list unavailable.") +
|
|
1434
|
+
'</div></div></article>';
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
const listed = listWorkspacesResultData(data);
|
|
1438
|
+
const spaces = Array.isArray(listed.workspaces) ? listed.workspaces : [];
|
|
1439
|
+
const rows = spaces.map((workspace) =>
|
|
1440
|
+
'<div class="file-row"><span class="file-code">ws</span><span class="file-name">' + esc((workspace?.id || "workspace") + " — " + (workspace?.root || "")) + '</span></div>'
|
|
1441
|
+
).join("");
|
|
1442
|
+
return '<article class="card">' + header(data, pill((listed.count ?? spaces.length) + " open", "info")) +
|
|
1443
|
+
'<div class="body"><div class="file-list">' + (rows || '<div class="empty">No workspaces opened yet.</div>') + '</div></div></article>';
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
function renderServerConfig(data) {
|
|
1447
|
+
const config = data?.data ?? {};
|
|
1448
|
+
const blocked = Array.isArray(config.blockedGlobs) ? config.blockedGlobs : [];
|
|
1449
|
+
const allowed = Array.isArray(config.allowedRoots) ? config.allowedRoots : [];
|
|
1450
|
+
const bashSession = config.bashSessionId || config.bash_session_id || "";
|
|
1451
|
+
const bashSessionRequired = Boolean(config.requireBashSession || config.require_bash_session);
|
|
1452
|
+
const enforcement = config.enforcement ?? {};
|
|
1453
|
+
const missingCapabilities = Array.isArray(enforcement.missingCapabilities) ? enforcement.missingCapabilities : [];
|
|
1454
|
+
const policyRows = [
|
|
1455
|
+
'<div class="file-row"><span class="file-code">mode</span><span class="file-name">' + esc(config.policyEngineMode || "legacy") + '</span></div>',
|
|
1456
|
+
'<div class="file-row"><span class="file-code">rev</span><span class="file-name">' + esc(config.policyRevision || "inactive") + '</span></div>',
|
|
1457
|
+
'<div class="file-row"><span class="file-code">hard</span><span class="file-name">' + esc(config.hardPolicyRevision || "-") + '</span></div>',
|
|
1458
|
+
'<div class="file-row"><span class="file-code">backend</span><span class="file-name">' + esc((enforcement.backendId || "-") + " / " + (enforcement.evidenceRevision || "-")) + '</span></div>',
|
|
1459
|
+
'<div class="file-row"><span class="file-code">limits</span><span class="file-name">' + esc(missingCapabilities.length ? missingCapabilities.join(", ") : "none reported") + '</span></div>'
|
|
1460
|
+
].join("");
|
|
1461
|
+
const rootRows = [
|
|
1462
|
+
'<div class="file-row"><span class="file-code">root</span><span class="file-name">' + esc(config.defaultRoot || "-") + '</span></div>',
|
|
1463
|
+
'<div class="file-row"><span class="file-code">url</span><span class="file-name">' + esc((config.host || "127.0.0.1") + ":" + (config.port || "-")) + '</span></div>',
|
|
1464
|
+
'<div class="file-row"><span class="file-code">ui</span><span class="file-name">' + esc(config.widgetDomain || "-") + '</span></div>',
|
|
1465
|
+
bashSession ? '<div class="file-row"><span class="file-code">bash</span><span class="file-name">' + esc("session " + bashSession + (bashSessionRequired ? " required" : "")) + '</span></div>' : ""
|
|
1466
|
+
].join("");
|
|
1467
|
+
const allowedRows = allowed.map((root) =>
|
|
1468
|
+
'<div class="file-row"><span class="file-code">allow</span><span class="file-name">' + esc(root) + '</span></div>'
|
|
1469
|
+
).join("");
|
|
1470
|
+
const blockedRows = blocked.slice(0, 24).map((pattern) =>
|
|
1471
|
+
'<div class="file-row"><span class="file-code">block</span><span class="file-name">' + esc(pattern) + '</span></div>'
|
|
1472
|
+
).join("");
|
|
1473
|
+
const limits = [
|
|
1474
|
+
summaryItem("Read", config.maxReadBytes ?? "-"),
|
|
1475
|
+
summaryItem("Write", config.maxWriteBytes ?? "-"),
|
|
1476
|
+
summaryItem("Output", config.maxOutputBytes ?? "-")
|
|
1477
|
+
].join("");
|
|
1478
|
+
return '<article class="card">' + header(data, [
|
|
1479
|
+
pill("tools " + (config.toolMode || "-"), "info"),
|
|
1480
|
+
pill("bash " + (config.bashMode || "-")),
|
|
1481
|
+
pill("policy " + (config.policyEngineMode || "legacy"), config.policyEngineMode === "enforce" ? "good" : config.policyEngineMode === "shadow" ? "warn" : "info"),
|
|
1482
|
+
bashSession ? pill("session " + bashSession, bashSessionRequired ? "warn" : "info") : "",
|
|
1483
|
+
pill(config.authEnabled ? "auth on" : "auth off", config.authEnabled ? "good" : "warn")
|
|
1484
|
+
].join("")) + '<div class="body">' +
|
|
1485
|
+
'<div class="summary">' +
|
|
1486
|
+
summaryItem("Write", config.writeMode || "-") +
|
|
1487
|
+
summaryItem("Bash", config.bashMode || "-") +
|
|
1488
|
+
summaryItem("Session", bashSession ? bashSession + (bashSessionRequired ? " required" : "") : "-") +
|
|
1489
|
+
summaryItem("Tools", config.toolMode || "-") +
|
|
1490
|
+
summaryItem("Policy", config.policyEngineMode || "legacy") +
|
|
1491
|
+
summaryItem("Profile", config.permissionProfileId || "compat-v1") +
|
|
1492
|
+
'</div>' +
|
|
1493
|
+
'<div class="section-label">Runtime</div><div class="file-list">' + rootRows + '</div>' +
|
|
1494
|
+
fold("Policy", (config.policyEngineMode || "legacy") + " / " + (enforcement.active ? "active" : "inactive"), '<div class="file-list">' + policyRows + '</div>', false) +
|
|
1495
|
+
fold("Allowed roots", allowed.length + " roots", '<div class="file-list">' + (allowedRows || '<div class="empty">No roots configured.</div>') + '</div>', false) +
|
|
1496
|
+
fold("Limits", "", '<div class="summary">' + limits + '</div>', false) +
|
|
1497
|
+
fold("Blocked paths", blocked.length + " patterns", '<div class="file-list">' + (blockedRows || '<div class="empty">No blocked globs configured.</div>') + '</div>', false) +
|
|
1498
|
+
fold("Raw config", "", codebox("config", esc(truncate(JSON.stringify(config || {}, null, 2), 8000)), ""), false) +
|
|
1499
|
+
'</div></article>';
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
function renderStatus(data) {
|
|
1503
|
+
const statusData = data?.data ?? {};
|
|
1504
|
+
const error = data?.error ?? {};
|
|
1505
|
+
|
|
1506
|
+
if (data?.ok === false) {
|
|
1507
|
+
return '<article class="card">' +
|
|
1508
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1509
|
+
'<div class="body"><div class="empty">' +
|
|
1510
|
+
esc(error.message || "Git status unavailable.") +
|
|
1511
|
+
'</div></div></article>';
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
const files = Array.isArray(statusData.changed_files)
|
|
1515
|
+
? statusData.changed_files
|
|
1516
|
+
: [];
|
|
1517
|
+
const rows = files.slice(0, 14).map((line) => {
|
|
1518
|
+
const status = String(line).slice(0, 2).trim() || "?";
|
|
1519
|
+
const name = String(line).slice(2).trim() || String(line);
|
|
1520
|
+
return '<div class="file-row"><span class="file-code">' +
|
|
1521
|
+
esc(status) +
|
|
1522
|
+
'</span><span class="file-name">' +
|
|
1523
|
+
esc(name) +
|
|
1524
|
+
'</span></div>';
|
|
1525
|
+
}).join("");
|
|
1526
|
+
const state = rows || '<div class="empty">Working tree clean.</div>';
|
|
1527
|
+
const changed = Boolean(statusData.changed);
|
|
1528
|
+
|
|
1529
|
+
return '<article class="card">' +
|
|
1530
|
+
header(data, pill(changed ? files.length + " changed" : "clean", changed ? "info" : "good")) +
|
|
1531
|
+
'<div class="body"><div class="file-list">' + state + '</div>' +
|
|
1532
|
+
fold(
|
|
1533
|
+
"Raw status",
|
|
1534
|
+
countLines(statusData.status) + " lines",
|
|
1535
|
+
codebox("git status", esc(previewLines(statusData.status, 40)), ""),
|
|
1536
|
+
false
|
|
1537
|
+
) +
|
|
1538
|
+
'</div></article>';
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
function renderTextSummary(data, label) {
|
|
1542
|
+
const files = Array.isArray(data.files) ? data.files : Array.isArray(data.ai_context_files) ? data.ai_context_files : [];
|
|
1543
|
+
const preview = data.preview || data.text || data.status || "";
|
|
1544
|
+
const rows = files.slice(0, 14).map((file) =>
|
|
1545
|
+
'<div class="file-row"><span class="file-code">file</span><span class="file-name">' + esc(file) + '</span></div>'
|
|
1546
|
+
).join("");
|
|
1547
|
+
return '<article class="card">' + header(data, pill(files.length + " files", "info")) +
|
|
1548
|
+
'<div class="body">' +
|
|
1549
|
+
(rows ? '<div class="file-list">' + rows + '</div>' : '<div class="empty">No files listed.</div>') +
|
|
1550
|
+
fold(label || "Preview", countLines(preview) + " lines", codebox(label || "preview", esc(previewLines(preview, 40)), ""), false) +
|
|
1551
|
+
'</div></article>';
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
function renderReadHandoff(data) {
|
|
1555
|
+
const handoff = readHandoffResultData(data);
|
|
1556
|
+
const error = data?.error ?? {};
|
|
1557
|
+
if (data?.ok === false) {
|
|
1558
|
+
return '<article class="card">' +
|
|
1559
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1560
|
+
'<div class="body"><div class="empty">' +
|
|
1561
|
+
esc(error.message || "Handoff context unavailable.") +
|
|
1562
|
+
'</div></div></article>';
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
const artifacts = Array.isArray(handoff.artifacts) ? handoff.artifacts : [];
|
|
1566
|
+
const unavailable = Array.isArray(handoff.unavailable) ? handoff.unavailable : [];
|
|
1567
|
+
const legacyFiles = !artifacts.length && Array.isArray(handoff.files) ? handoff.files : [];
|
|
1568
|
+
const readableCount = handoff.file_count ?? (artifacts.length || legacyFiles.length);
|
|
1569
|
+
const pills = [
|
|
1570
|
+
pill(readableCount + " readable", "info"),
|
|
1571
|
+
unavailable.length ? pill(unavailable.length + " unavailable", "warn") : pill("complete", "good"),
|
|
1572
|
+
handoff.output_limited ? pill("limited", "warn") : "",
|
|
1573
|
+
handoff.redacted ? pill("redacted", "warn") : ""
|
|
1574
|
+
].join("");
|
|
1575
|
+
const unavailableRows = unavailable.map((item) =>
|
|
1576
|
+
'<div class="file-row"><span class="file-code">' + esc(item?.reason || "unavailable") + '</span><span class="file-name">' + esc(item?.path || "artifact") + '</span></div>'
|
|
1577
|
+
).join("");
|
|
1578
|
+
const legacyRows = legacyFiles.map((file) =>
|
|
1579
|
+
'<div class="file-row"><span class="file-code">file</span><span class="file-name">' + esc(file) + '</span></div>'
|
|
1580
|
+
).join("");
|
|
1581
|
+
const artifactSections = artifacts.map((artifact) =>
|
|
1582
|
+
fold(
|
|
1583
|
+
artifact?.path || artifact?.kind || "artifact",
|
|
1584
|
+
(artifact?.line_count ?? countLines(artifact?.text)) + " lines",
|
|
1585
|
+
codebox(
|
|
1586
|
+
artifact?.kind || "handoff",
|
|
1587
|
+
esc(truncate(previewLines(artifact.text, 20), 4000)),
|
|
1588
|
+
""
|
|
1589
|
+
),
|
|
1590
|
+
false
|
|
1591
|
+
)
|
|
1592
|
+
).join("");
|
|
1593
|
+
const legacyPreview = !artifacts.length && handoff.preview
|
|
1594
|
+
? fold("Handoff", countLines(handoff.preview) + " lines", codebox("handoff", esc(truncate(previewLines(handoff.preview, 20), 4000)), ""), false)
|
|
1595
|
+
: "";
|
|
1596
|
+
const empty = !artifacts.length && !legacyFiles.length
|
|
1597
|
+
? '<div class="empty">' + esc(handoff.context_exists === false ? "No handoff context exists yet." : "No readable handoff artifacts.") + '</div>'
|
|
1598
|
+
: "";
|
|
1599
|
+
|
|
1600
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
1601
|
+
'<div class="summary">' +
|
|
1602
|
+
summaryItem("Readable", readableCount) +
|
|
1603
|
+
summaryItem("Unavailable", handoff.unavailable_count ?? unavailable.length) +
|
|
1604
|
+
summaryItem("Bytes", (handoff.loaded_bytes ?? 0) + "/" + (handoff.max_total_bytes ?? "-")) +
|
|
1605
|
+
'</div>' +
|
|
1606
|
+
(unavailableRows ? '<div class="section-label">Unavailable</div><div class="file-list">' + unavailableRows + '</div>' : "") +
|
|
1607
|
+
(legacyRows ? '<div class="file-list">' + legacyRows + '</div>' : "") +
|
|
1608
|
+
artifactSections + legacyPreview + empty +
|
|
1609
|
+
'</div></article>';
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
function renderWaitForHandoff(data) {
|
|
1613
|
+
const wait = waitForHandoffResultData(data);
|
|
1614
|
+
const error = data?.error ?? {};
|
|
1615
|
+
if (data?.ok === false) {
|
|
1616
|
+
return '<article class="card">' +
|
|
1617
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1618
|
+
'<div class="body"><div class="empty">' +
|
|
1619
|
+
esc(error.message || "Handoff wait unavailable.") +
|
|
1620
|
+
'</div></div></article>';
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
const nestedArtifacts = Array.isArray(wait.artifacts) ? wait.artifacts : [];
|
|
1624
|
+
const legacyArtifacts = nestedArtifacts.length ? [] : [
|
|
1625
|
+
wait.status_excerpt ? { path: wait.status_file || "agent-status.md", kind: "status", text: wait.status_excerpt } : null,
|
|
1626
|
+
wait.diff_excerpt ? { path: wait.diff_file || "implementation-diff.patch", kind: "diff", text: wait.diff_excerpt } : null,
|
|
1627
|
+
wait.log_excerpt ? { path: wait.log_file || "execution-log.jsonl", kind: "log", text: wait.log_excerpt } : null,
|
|
1628
|
+
wait.tests_excerpt ? { path: wait.tests_file || "loop-tests.txt", kind: "tests", text: wait.tests_excerpt } : null
|
|
1629
|
+
].filter(Boolean);
|
|
1630
|
+
const artifacts = nestedArtifacts.length ? nestedArtifacts : legacyArtifacts;
|
|
1631
|
+
const unavailable = Array.isArray(wait.unavailable) ? wait.unavailable : [];
|
|
1632
|
+
const state = wait.state || wait.run_state || "unknown";
|
|
1633
|
+
const terminal = wait.awaited_terminal === true;
|
|
1634
|
+
const pills = [
|
|
1635
|
+
pill(state, terminal ? (wait.succeeded ? "good" : "warn") : "info"),
|
|
1636
|
+
terminal ? pill("terminal", "good") : pill("deadline", "warn"),
|
|
1637
|
+
wait.output_limited ? pill("limited", "warn") : "",
|
|
1638
|
+
wait.redacted ? pill("redacted", "warn") : ""
|
|
1639
|
+
].join("");
|
|
1640
|
+
const unavailableRows = unavailable.map((item) =>
|
|
1641
|
+
'<div class="file-row"><span class="file-code">' + esc(item?.reason || "unavailable") + '</span><span class="file-name">' + esc(item?.path || "artifact") + '</span></div>'
|
|
1642
|
+
).join("");
|
|
1643
|
+
const artifactSections = artifacts.map((artifact) =>
|
|
1644
|
+
fold(
|
|
1645
|
+
artifact?.path || artifact?.kind || "artifact",
|
|
1646
|
+
(artifact?.line_count ?? countLines(artifact?.text)) + " lines",
|
|
1647
|
+
codebox(
|
|
1648
|
+
artifact?.kind || "handoff",
|
|
1649
|
+
esc(truncate(previewLines(artifact.text, 20), 4000)),
|
|
1650
|
+
""
|
|
1651
|
+
),
|
|
1652
|
+
false
|
|
1653
|
+
)
|
|
1654
|
+
).join("");
|
|
1655
|
+
const empty = !artifacts.length
|
|
1656
|
+
? '<div class="empty">' + esc(terminal ? "No readable handoff result artifacts." : "No matching terminal result yet.") + '</div>'
|
|
1657
|
+
: "";
|
|
1658
|
+
|
|
1659
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
1660
|
+
'<div class="summary">' +
|
|
1661
|
+
summaryItem("State", state) +
|
|
1662
|
+
summaryItem("Iteration", wait.run?.iteration ?? wait.iteration ?? "-") +
|
|
1663
|
+
summaryItem("Bytes", (wait.returned_bytes ?? 0) + "/" + (wait.max_total_bytes ?? "-")) +
|
|
1664
|
+
'</div>' +
|
|
1665
|
+
(unavailableRows ? '<div class="section-label">Unavailable</div><div class="file-list">' + unavailableRows + '</div>' : "") +
|
|
1666
|
+
artifactSections + empty +
|
|
1667
|
+
'</div></article>';
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
function renderCodexContext(data) {
|
|
1671
|
+
const context = codexContextResultData(data);
|
|
1672
|
+
const error = data?.error ?? {};
|
|
1673
|
+
if (data?.ok === false) {
|
|
1674
|
+
return '<article class="card">' +
|
|
1675
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1676
|
+
'<div class="body"><div class="empty">' +
|
|
1677
|
+
esc(error.message || "Codex context unavailable.") +
|
|
1678
|
+
'</div></div></article>';
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
const agents = Array.isArray(context.agents_files) ? context.agents_files : [];
|
|
1682
|
+
const bridge = Array.isArray(context.ai_context_files) ? context.ai_context_files : [];
|
|
1683
|
+
const unavailable = Array.isArray(context.unavailable_sources) ? context.unavailable_sources : [];
|
|
1684
|
+
const preview = typeof context.preview === "string" ? context.preview : "";
|
|
1685
|
+
const pills = [
|
|
1686
|
+
pill(agents.length + " AGENTS", "info"),
|
|
1687
|
+
pill(bridge.length + " bridge"),
|
|
1688
|
+
unavailable.length ? pill(unavailable.length + " unavailable", "warn") : pill("sources ready", "good"),
|
|
1689
|
+
context.output_limited ? pill("limited", "warn") : "",
|
|
1690
|
+
context.redacted ? pill("redacted", "warn") : ""
|
|
1691
|
+
].join("");
|
|
1692
|
+
const agentRows = agents.slice(0, 14).map((file) =>
|
|
1693
|
+
'<div class="file-row"><span class="file-code">agent</span><span class="file-name">' + esc(file) + '</span></div>'
|
|
1694
|
+
).join("");
|
|
1695
|
+
const bridgeRows = bridge.slice(0, 14).map((file) =>
|
|
1696
|
+
'<div class="file-row"><span class="file-code">bridge</span><span class="file-name">' + esc(file) + '</span></div>'
|
|
1697
|
+
).join("");
|
|
1698
|
+
const unavailableRows = unavailable.slice(0, 20).map((item) =>
|
|
1699
|
+
'<div class="file-row"><span class="file-code">' + esc(item?.reason || "unavailable") + '</span><span class="file-name">' + esc(item?.path || "source") + '</span></div>'
|
|
1700
|
+
).join("");
|
|
1701
|
+
|
|
1702
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
1703
|
+
'<div class="summary">' +
|
|
1704
|
+
summaryItem("Target", context.target_path || ".") +
|
|
1705
|
+
summaryItem("Kind", context.target_kind || "-") +
|
|
1706
|
+
summaryItem("Bytes", (context.context_bytes ?? "-") + "/" + (context.max_total_bytes ?? "-")) +
|
|
1707
|
+
'</div>' +
|
|
1708
|
+
(agentRows ? '<div class="section-label">AGENTS chain</div><div class="file-list">' + agentRows + '</div>' : "") +
|
|
1709
|
+
(bridgeRows ? '<div class="section-label">AI bridge</div><div class="file-list">' + bridgeRows + '</div>' : "") +
|
|
1710
|
+
(unavailableRows ? '<div class="section-label">Unavailable</div><div class="file-list">' + unavailableRows + '</div>' : "") +
|
|
1711
|
+
(!agentRows && !bridgeRows && !unavailableRows ? '<div class="empty">No context source files were listed.</div>' : "") +
|
|
1712
|
+
fold("Context preview", countLines(preview) + " lines", codebox("context", esc(truncate(previewLines(preview, 40), 9000)), ""), false) +
|
|
1713
|
+
'</div></article>';
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
function renderExportProContext(data) {
|
|
1717
|
+
const context = exportProContextResultData(data);
|
|
1718
|
+
const error = data?.error ?? {};
|
|
1719
|
+
if (data?.ok === false) {
|
|
1720
|
+
return '<article class="card">' +
|
|
1721
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1722
|
+
'<div class="body"><div class="empty">' +
|
|
1723
|
+
esc(error.message || "Pro context export unavailable.") +
|
|
1724
|
+
'</div></div></article>';
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
const included = Array.isArray(context.files_included) ? context.files_included : [];
|
|
1728
|
+
const skipped = Array.isArray(context.files_skipped) ? context.files_skipped : [];
|
|
1729
|
+
const created = Array.isArray(context.created_context_files) ? context.created_context_files : [];
|
|
1730
|
+
const bridge = Array.isArray(context.ai_context_files) ? context.ai_context_files : [];
|
|
1731
|
+
const unavailable = Array.isArray(context.ai_context_unavailable) ? context.ai_context_unavailable : [];
|
|
1732
|
+
const pills = [
|
|
1733
|
+
pill(included.length + " included", "info"),
|
|
1734
|
+
skipped.length ? pill(skipped.length + " skipped", "warn") : pill("no skips", "good"),
|
|
1735
|
+
context.existed ? pill("replaced") : pill("created", "good"),
|
|
1736
|
+
context.output_limited ? pill("limited", "warn") : "",
|
|
1737
|
+
context.redacted ? pill("redacted", "warn") : ""
|
|
1738
|
+
].join("");
|
|
1739
|
+
const includedRows = included.slice(0, 14).map((file) =>
|
|
1740
|
+
'<div class="file-row"><span class="file-code">file</span><span class="file-name">' + esc(file) + '</span></div>'
|
|
1741
|
+
).join("");
|
|
1742
|
+
const skippedRows = skipped.slice(0, 20).map((item) =>
|
|
1743
|
+
'<div class="file-row"><span class="file-code">' + esc(item?.reason || "skipped") + '</span><span class="file-name">' + esc(item?.path || "candidate") + '</span></div>'
|
|
1744
|
+
).join("");
|
|
1745
|
+
const createdRows = created.slice(0, 14).map((file) =>
|
|
1746
|
+
'<div class="file-row"><span class="file-code">created</span><span class="file-name">' + esc(file) + '</span></div>'
|
|
1747
|
+
).join("");
|
|
1748
|
+
const bridgeRows = bridge.slice(0, 14).map((file) =>
|
|
1749
|
+
'<div class="file-row"><span class="file-code">bridge</span><span class="file-name">' + esc(file) + '</span></div>'
|
|
1750
|
+
).join("");
|
|
1751
|
+
const unavailableRows = unavailable.slice(0, 20).map((file) =>
|
|
1752
|
+
'<div class="file-row"><span class="file-code">unavailable</span><span class="file-name">' + esc(file) + '</span></div>'
|
|
1753
|
+
).join("");
|
|
1754
|
+
|
|
1755
|
+
return '<article class="card">' + header(data, pills) + '<div class="body">' +
|
|
1756
|
+
'<div class="summary">' +
|
|
1757
|
+
summaryItem("Path", context.path || "-") +
|
|
1758
|
+
summaryItem("Bytes", (context.bytes ?? "-") + "/" + (context.max_total_bytes ?? "-")) +
|
|
1759
|
+
summaryItem("SHA-256", context.sha256 ? String(context.sha256).slice(0, 12) : "-") +
|
|
1760
|
+
'</div>' +
|
|
1761
|
+
(includedRows ? '<div class="section-label">Included files</div><div class="file-list">' + includedRows + '</div>' : "") +
|
|
1762
|
+
(skippedRows ? '<div class="section-label">Skipped candidates</div><div class="file-list">' + skippedRows + '</div>' : "") +
|
|
1763
|
+
(bridgeRows ? '<div class="section-label">AI bridge</div><div class="file-list">' + bridgeRows + '</div>' : "") +
|
|
1764
|
+
(unavailableRows ? '<div class="section-label">Unavailable AI bridge</div><div class="file-list">' + unavailableRows + '</div>' : "") +
|
|
1765
|
+
(createdRows ? '<div class="section-label">Created scaffold</div><div class="file-list">' + createdRows + '</div>' : "") +
|
|
1766
|
+
(!includedRows && !skippedRows && !bridgeRows && !unavailableRows && !createdRows
|
|
1767
|
+
? '<div class="empty">No export details were listed.</div>'
|
|
1768
|
+
: "") +
|
|
1769
|
+
'</div></article>';
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
function renderTree(data) {
|
|
1773
|
+
const tree = data?.data ?? {};
|
|
1774
|
+
const error = data?.error ?? {};
|
|
1775
|
+
|
|
1776
|
+
if (data?.ok === false) {
|
|
1777
|
+
return '<article class="card">' +
|
|
1778
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1779
|
+
'<div class="body"><div class="empty">' +
|
|
1780
|
+
esc(error.message || "File tree unavailable.") +
|
|
1781
|
+
'</div></div></article>';
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
const entries = Number.isFinite(tree.entries) ? tree.entries : 0;
|
|
1785
|
+
const truncated = tree.truncated === true;
|
|
1786
|
+
const text = typeof tree.text === "string" ? tree.text : "";
|
|
1787
|
+
const pills = [
|
|
1788
|
+
pill(entries + " entries", "info"),
|
|
1789
|
+
truncated ? pill("truncated", "warn") : pill("complete", "good")
|
|
1790
|
+
].join("");
|
|
1791
|
+
|
|
1792
|
+
return '<article class="card">' +
|
|
1793
|
+
header(data, pills) +
|
|
1794
|
+
'<div class="body">' +
|
|
1795
|
+
'<div class="metrics">' + metric("root", tree.root || "-") + '</div>' +
|
|
1796
|
+
fold(
|
|
1797
|
+
"Tree",
|
|
1798
|
+
countLines(text) + " lines",
|
|
1799
|
+
codebox("tree", esc(previewLines(text, 40)), ""),
|
|
1800
|
+
false
|
|
1801
|
+
) +
|
|
1802
|
+
'</div></article>';
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
function renderRead(data) {
|
|
1806
|
+
const file = data?.data ?? {};
|
|
1807
|
+
const error = data?.error ?? {};
|
|
1808
|
+
|
|
1809
|
+
if (data?.ok === false) {
|
|
1810
|
+
return '<article class="card">' +
|
|
1811
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1812
|
+
'<div class="body"><div class="empty">' +
|
|
1813
|
+
esc(error.message || "File unavailable.") +
|
|
1814
|
+
'</div></div></article>';
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
const text = typeof file.text === "string" ? file.text : "";
|
|
1818
|
+
const bytes = Number.isFinite(file.bytes) ? file.bytes : 0;
|
|
1819
|
+
const startLine = Number.isFinite(file.startLine) ? file.startLine : "-";
|
|
1820
|
+
const endLine = Number.isFinite(file.endLine) ? file.endLine : "-";
|
|
1821
|
+
const totalLines = Number.isFinite(file.totalLines) ? file.totalLines : "-";
|
|
1822
|
+
const truncated = file.truncated === true;
|
|
1823
|
+
const pills = [
|
|
1824
|
+
pill(bytes + " bytes", "info"),
|
|
1825
|
+
pill(startLine + "-" + endLine + " of " + totalLines + " lines"),
|
|
1826
|
+
truncated ? pill("partial", "warn") : pill("complete", "good")
|
|
1827
|
+
].join("");
|
|
1828
|
+
|
|
1829
|
+
return '<article class="card">' +
|
|
1830
|
+
header(data, pills) +
|
|
1831
|
+
'<div class="body">' +
|
|
1832
|
+
codebox(
|
|
1833
|
+
basename(file.path || "file"),
|
|
1834
|
+
esc(previewLines(text, 80)),
|
|
1835
|
+
""
|
|
1836
|
+
) +
|
|
1837
|
+
'</div></article>';
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
function renderCodexGPT(data) {
|
|
1841
|
+
const result = data?.data ?? {};
|
|
1842
|
+
const error = data?.error ?? {};
|
|
1843
|
+
if (data?.ok === false) {
|
|
1844
|
+
return '<article class="card">' +
|
|
1845
|
+
header(data, pill(error.code || "error", "bad")) +
|
|
1846
|
+
'<div class="body"><div class="empty">' +
|
|
1847
|
+
esc(error.message || "CodexGPT action unavailable.") +
|
|
1848
|
+
'</div></div></article>';
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
const actions = Array.isArray(result.actions)
|
|
1852
|
+
? result.actions.filter((action) => typeof action === "string").slice(0, 40)
|
|
1853
|
+
: [];
|
|
1854
|
+
const actionCount = Number.isFinite(result.action_count)
|
|
1855
|
+
? result.action_count
|
|
1856
|
+
: actions.length;
|
|
1857
|
+
return '<article class="card">' +
|
|
1858
|
+
header(data, pill(actionCount + " actions", "info")) +
|
|
1859
|
+
'<div class="body">' +
|
|
1860
|
+
'<div class="metrics">' + metric("action_count", actionCount) + '</div>' +
|
|
1861
|
+
codebox("available actions", esc(actions.join("\n")), "") +
|
|
1862
|
+
'</div></article>';
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
function renderGeneric(data) {
|
|
1866
|
+
const keys = Object.keys(data || {}).filter((key) => !key.startsWith("codexgpt_"));
|
|
1867
|
+
const metrics = keys.slice(0, 3).map((key) => metric(key, typeof data[key] === "object" ? JSON.stringify(data[key]) : data[key])).join("");
|
|
1868
|
+
return '<article class="card">' + header(data, pill("structured", "info")) +
|
|
1869
|
+
'<div class="body">' + (metrics ? '<div class="metrics">' + metrics + '</div>' : '') +
|
|
1870
|
+
codebox("structured output", esc(truncate(JSON.stringify(data || {}, null, 2))), "") +
|
|
1871
|
+
'</div></article>';
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
function isPlaceholderPayload(data) {
|
|
1875
|
+
if (!data || typeof data !== "object") return true;
|
|
1876
|
+
const keys = Object.keys(data);
|
|
1877
|
+
return !keys.length || (keys.length === 1 && data.codexgpt_tool === "codexgpt");
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
function renderPending() {
|
|
1881
|
+
root.innerHTML = [
|
|
1882
|
+
'<article class="card pending">',
|
|
1883
|
+
'<div class="rail"></div>',
|
|
1884
|
+
'<header class="head">',
|
|
1885
|
+
'<span class="glyph">C</span>',
|
|
1886
|
+
'<div class="headline"><div class="title">CodexGPT</div><div class="subtitle">Waiting for tool result...</div></div>',
|
|
1887
|
+
'<span class="pill info">waiting</span>',
|
|
1888
|
+
'</header>',
|
|
1889
|
+
'<div class="skeleton"><span></span><span></span><span></span></div>',
|
|
1890
|
+
'</article>'
|
|
1891
|
+
].join("");
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
function render(data) {
|
|
1895
|
+
if (isPlaceholderPayload(data)) {
|
|
1896
|
+
renderPending();
|
|
1897
|
+
return;
|
|
1898
|
+
}
|
|
1899
|
+
const tool = data.codexgpt_tool;
|
|
1900
|
+
if (data?.codexgpt_tool === "codexgpt") {
|
|
1901
|
+
root.innerHTML = renderCodexGPT(data);
|
|
1902
|
+
} else if (tool === "server_config") {
|
|
1903
|
+
root.innerHTML = renderServerConfig(data);
|
|
1904
|
+
} else if (tool === "codexgpt_self_test") {
|
|
1905
|
+
root.innerHTML = renderSelfTest(data);
|
|
1906
|
+
} else if (tool === "codexgpt_inventory") {
|
|
1907
|
+
root.innerHTML = renderInventory(data);
|
|
1908
|
+
} else if (tool === "codex_sessions") {
|
|
1909
|
+
root.innerHTML = renderCodexSessions(data);
|
|
1910
|
+
} else if (tool === "read_codex_session") {
|
|
1911
|
+
root.innerHTML = renderReadCodexSession(data);
|
|
1912
|
+
} else if (tool === "load_skill") {
|
|
1913
|
+
root.innerHTML = renderLoadSkill(data);
|
|
1914
|
+
} else if (tool === "list_workspaces") {
|
|
1915
|
+
root.innerHTML = renderWorkspaces(data);
|
|
1916
|
+
} else if (tool === "open_current_workspace" || tool === "open_workspace" || tool === "workspace_snapshot") {
|
|
1917
|
+
root.innerHTML = renderWorkspace(data);
|
|
1918
|
+
} else if (tool === "tree") {
|
|
1919
|
+
root.innerHTML = renderTree(data);
|
|
1920
|
+
} else if (tool === "read") {
|
|
1921
|
+
root.innerHTML = renderRead(data);
|
|
1922
|
+
} else if (tool === "inspect_workspace") {
|
|
1923
|
+
root.innerHTML = renderWorkspaceAnalysis(data);
|
|
1924
|
+
} else if (tool === "git_status") {
|
|
1925
|
+
root.innerHTML = renderStatus(data);
|
|
1926
|
+
} else if (tool === "show_changes") {
|
|
1927
|
+
const review = data?.data ?? {};
|
|
1928
|
+
root.innerHTML = review.analysis ? renderChangeAnalysis(data) : renderChanges(data);
|
|
1929
|
+
} else if (tool === "handoff_to_agent") {
|
|
1930
|
+
root.innerHTML = renderHandoff(data);
|
|
1931
|
+
} else if (tool === "handoff_to_codex") {
|
|
1932
|
+
root.innerHTML = renderHandoff(data);
|
|
1933
|
+
} else if (tool === "git_diff") {
|
|
1934
|
+
root.innerHTML = renderGitDiff(data);
|
|
1935
|
+
} else if (tool === "write") {
|
|
1936
|
+
root.innerHTML = renderWrite(data);
|
|
1937
|
+
} else if (tool === "edit") {
|
|
1938
|
+
root.innerHTML = renderEdit(data);
|
|
1939
|
+
} else if (tool === "apply_patch") {
|
|
1940
|
+
root.innerHTML = renderApplyPatch(data);
|
|
1941
|
+
} else if (tool === "export_pro_context") {
|
|
1942
|
+
root.innerHTML = renderExportProContext(data);
|
|
1943
|
+
} else if (tool === "bash") {
|
|
1944
|
+
root.innerHTML = renderBash(data);
|
|
1945
|
+
} else if (tool === "search") {
|
|
1946
|
+
const search = data?.data ?? {};
|
|
1947
|
+
root.innerHTML = search.analysis ? renderStructuredSearch(data) : renderSearch(data);
|
|
1948
|
+
} else if (tool === "read_handoff") {
|
|
1949
|
+
root.innerHTML = renderReadHandoff(data);
|
|
1950
|
+
} else if (tool === "wait_for_handoff") {
|
|
1951
|
+
root.innerHTML = renderWaitForHandoff(data);
|
|
1952
|
+
} else if (tool === "codex_context") {
|
|
1953
|
+
root.innerHTML = renderCodexContext(data);
|
|
1954
|
+
} else {
|
|
1955
|
+
root.innerHTML = renderGeneric(data);
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
function extractStructuredContent(value) {
|
|
1960
|
+
if (!value || typeof value !== "object") return {};
|
|
1961
|
+
if (value.codexgpt_tool || value.codexgpt_title) return value;
|
|
1962
|
+
const candidates = [
|
|
1963
|
+
value.structuredContent,
|
|
1964
|
+
value.toolOutput?.structuredContent,
|
|
1965
|
+
value.toolOutput,
|
|
1966
|
+
value.toolResponseMetadata?.structuredContent,
|
|
1967
|
+
value.mcp_tool_result?.structuredContent,
|
|
1968
|
+
value.call_tool_result?.structuredContent,
|
|
1969
|
+
value.result?.structuredContent
|
|
1970
|
+
];
|
|
1971
|
+
for (const candidate of candidates) {
|
|
1972
|
+
if (candidate && typeof candidate === "object") return candidate;
|
|
1973
|
+
}
|
|
1974
|
+
return {};
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
render(extractStructuredContent(window.openai?.toolOutput || window.openai?.toolResponseMetadata || {}));
|
|
1978
|
+
|
|
1979
|
+
window.addEventListener("openai:set_globals", (event) => {
|
|
1980
|
+
render(extractStructuredContent(
|
|
1981
|
+
event.detail?.globals?.toolOutput ||
|
|
1982
|
+
event.detail?.globals?.toolResponseMetadata ||
|
|
1983
|
+
event.detail ||
|
|
1984
|
+
window.openai?.toolOutput ||
|
|
1985
|
+
window.openai?.toolResponseMetadata ||
|
|
1986
|
+
{}
|
|
1987
|
+
));
|
|
1988
|
+
}, { passive: true });
|
|
1989
|
+
|
|
1990
|
+
window.addEventListener("message", (event) => {
|
|
1991
|
+
if (event.source !== window.parent) return;
|
|
1992
|
+
const message = event.data;
|
|
1993
|
+
if (!message || message.jsonrpc !== "2.0") return;
|
|
1994
|
+
if (message.method === "ui/notifications/tool-result") {
|
|
1995
|
+
render(extractStructuredContent(message.params || {}));
|
|
1996
|
+
}
|
|
1997
|
+
}, { passive: true });
|
|
1998
|
+
</script>
|
|
1999
|
+
`.trim();
|
|
2000
|
+
//# sourceMappingURL=toolCardWidget.js.map
|