agent-insight 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +1 -0
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +6 -0
- package/.next/standalone/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/channels.html +1 -1
- package/.next/standalone/.next/server/app/accessconfig/channels.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/channels.segments/!KG1haW4p/accessconfig/channels/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/channels.segments/!KG1haW4p/accessconfig/channels.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/channels.segments/!KG1haW4p/accessconfig.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/channels.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/channels.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/channels.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/channels.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/channels.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/health.html +1 -1
- package/.next/standalone/.next/server/app/accessconfig/health.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/health.segments/!KG1haW4p/accessconfig/health/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/health.segments/!KG1haW4p/accessconfig/health.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/health.segments/!KG1haW4p/accessconfig.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/health.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/health.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/health.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/health.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/health.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/install.html +2 -2
- package/.next/standalone/.next/server/app/accessconfig/install.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/install.segments/!KG1haW4p/accessconfig/install/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/install.segments/!KG1haW4p/accessconfig/install.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/install.segments/!KG1haW4p/accessconfig.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/install.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/install.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/install.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/install.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/install.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/webhooks.html +1 -1
- package/.next/standalone/.next/server/app/accessconfig/webhooks.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/webhooks.segments/!KG1haW4p/accessconfig/webhooks/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/webhooks.segments/!KG1haW4p/accessconfig/webhooks.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/webhooks.segments/!KG1haW4p/accessconfig.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/webhooks.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/webhooks.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/webhooks.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/webhooks.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig/webhooks.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig.html +1 -1
- package/.next/standalone/.next/server/app/accessconfig.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig.segments/!KG1haW4p/accessconfig/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig.segments/!KG1haW4p/accessconfig.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/agents.html +1 -1
- package/.next/standalone/.next/server/app/agents.rsc +1 -1
- package/.next/standalone/.next/server/app/agents.segments/!KG1haW4p/agents/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/agents.segments/!KG1haW4p/agents.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/agents.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/agents.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/agents.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/agents.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/agents.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/agent/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/stream/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent-datasets/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent-datasets/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agents/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agents/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/apikey/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/organization/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/dashboard/stats/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/debug/batch-tasks/[taskId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/debug/batch-tasks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/debug/execute/[jobId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/debug/execute/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/debug/grayscale-tasks/[taskId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/debug/grayscale-tasks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/debug/history/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/debug/history/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/config/backfill-routing/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/config/create/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/config/reparse/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/config/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/evaluation/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/rejudge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/settings/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/settings/test/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/terminate-all/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/trajectory/results/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/trajectory/results/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/trajectory/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/trajectory/runs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/evaluation/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/evaluation/cancel/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/fault/diagnosis/session/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/fault/diagnosis/stream/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/fleet/breakdowns/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/fleet/trends/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/guide/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ingest/opencode/session-complete/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ingest/otel/v1/logs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ingest/otel/v1/metrics/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ingest/otel/v1/traces/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ingest/proxy/[taskId]/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ingest/proxy/[taskId]/end/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ingest/proxy/[taskId]/start/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ingest/setup/opencode-offline-fix/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/ingest/setup/opencode-offline-fix/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/ingest/setup/opencode-offline-fix/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/ingest/setup/opencode-offline-fix/route.js +7 -0
- package/.next/standalone/.next/server/app/api/ingest/setup/opencode-offline-fix/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/ingest/setup/opencode-offline-fix/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/ingest/setup/opencode-offline-fix/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/ingest/sync/manifest/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ingest/sync/opencode/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ingest/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/data/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/executions/[executionId]/agent-debug/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/executions/[executionId]/agent-debug/skills-analysis/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/executions/[executionId]/analyze-match/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/executions/[executionId]/infra/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/infra/history/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/infra/poll/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/infra/sources/derive/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/infra/sources/overview/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/infra/sources/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/infra/sources/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/infra/sources/test/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/session/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/observe/task-stats/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/public/otel/v1/traces/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/quality/agents/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/quality/backfill/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/quality/executions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/quality/report/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-eval/trigger/[skillName]/draft/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-eval/trigger/[skillName]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-eval/trigger/[skillName]/run/[runId]/cancel/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-eval/trigger/[skillName]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-eval/trigger/[skillName]/runs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-eval/trigger/[skillName]/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-generator/attachments/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-generator/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-generator/download/[sessionId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-generator/files/content/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-generator/files/download/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-generator/files/info/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-generator/files/list/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-generator/sessions/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-generator/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-opt/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-opt/plan/items/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-opt/plan/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-opt/sessions/[id]/iterations/[draftNumber]/apply/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-opt/sessions/[id]/iterations/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-opt/sessions/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-opt/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/activate/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/benchmark-generate/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/runs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/toggle/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/download/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/evaluate/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/evaluation-summary/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/files/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/parse-flow/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/automation/import/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/automation/push/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/by-name/[name]/analysis-diagnosis/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/by-name/[name]/optimization-points/resolve/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/by-name/[name]/optimization-points/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/by-name/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/logs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/publish/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/user-evaluators/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/dashboard.html +1 -1
- package/.next/standalone/.next/server/app/dashboard.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard.segments/!KG1haW4p/dashboard/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard.segments/!KG1haW4p/dashboard.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dataset.html +1 -1
- package/.next/standalone/.next/server/app/dataset.rsc +1 -1
- package/.next/standalone/.next/server/app/dataset.segments/!KG1haW4p/dataset/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dataset.segments/!KG1haW4p/dataset.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dataset.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dataset.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dataset.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dataset.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dataset.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval/trajectory.html +1 -1
- package/.next/standalone/.next/server/app/eval/trajectory.rsc +1 -1
- package/.next/standalone/.next/server/app/eval/trajectory.segments/!KG1haW4p/eval/trajectory/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval/trajectory.segments/!KG1haW4p/eval/trajectory.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval/trajectory.segments/!KG1haW4p/eval.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval/trajectory.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval/trajectory.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval/trajectory.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval/trajectory.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval/trajectory.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval.html +1 -1
- package/.next/standalone/.next/server/app/eval.rsc +1 -1
- package/.next/standalone/.next/server/app/eval.segments/!KG1haW4p/eval/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval.segments/!KG1haW4p/eval.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/fault.html +1 -1
- package/.next/standalone/.next/server/app/fault.rsc +1 -1
- package/.next/standalone/.next/server/app/fault.segments/!KG1haW4p/fault/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/fault.segments/!KG1haW4p/fault.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/fault.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/fault.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/fault.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/fault.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/fault.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra/sources.html +1 -1
- package/.next/standalone/.next/server/app/infra/sources.rsc +1 -1
- package/.next/standalone/.next/server/app/infra/sources.segments/!KG1haW4p/infra/sources/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra/sources.segments/!KG1haW4p/infra/sources.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra/sources.segments/!KG1haW4p/infra.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra/sources.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra/sources.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra/sources.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra/sources.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra/sources.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra.html +1 -1
- package/.next/standalone/.next/server/app/infra.rsc +1 -1
- package/.next/standalone/.next/server/app/infra.segments/!KG1haW4p/infra/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra.segments/!KG1haW4p/infra.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/infra.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.html +1 -1
- package/.next/standalone/.next/server/app/login.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/memory.html +1 -1
- package/.next/standalone/.next/server/app/memory.rsc +1 -1
- package/.next/standalone/.next/server/app/memory.segments/!KG1haW4p/memory/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/memory.segments/!KG1haW4p/memory.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/memory.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/memory.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/memory.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/memory.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/memory.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/metrics.html +1 -1
- package/.next/standalone/.next/server/app/metrics.rsc +1 -1
- package/.next/standalone/.next/server/app/metrics.segments/!KG1haW4p/metrics/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/metrics.segments/!KG1haW4p/metrics.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/metrics.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/metrics.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/metrics.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/metrics.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/metrics.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/registry.html +1 -1
- package/.next/standalone/.next/server/app/modelconfig/registry.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/registry.segments/!KG1haW4p/modelconfig/registry/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/registry.segments/!KG1haW4p/modelconfig/registry.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/registry.segments/!KG1haW4p/modelconfig.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/registry.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/registry.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/registry.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/registry.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/registry.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/web-search.html +1 -1
- package/.next/standalone/.next/server/app/modelconfig/web-search.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/web-search.segments/!KG1haW4p/modelconfig/web-search/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/web-search.segments/!KG1haW4p/modelconfig/web-search.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/web-search.segments/!KG1haW4p/modelconfig.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/web-search.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/web-search.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/web-search.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/web-search.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig/web-search.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig.html +1 -1
- package/.next/standalone/.next/server/app/modelconfig.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig.segments/!KG1haW4p/modelconfig/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig.segments/!KG1haW4p/modelconfig.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/optapi.html +1 -1
- package/.next/standalone/.next/server/app/optapi.rsc +1 -1
- package/.next/standalone/.next/server/app/optapi.segments/!KG1haW4p/optapi/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/optapi.segments/!KG1haW4p/optapi.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/optapi.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/optapi.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/optapi.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/optapi.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/optapi.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/quality.html +1 -1
- package/.next/standalone/.next/server/app/quality.rsc +1 -1
- package/.next/standalone/.next/server/app/quality.segments/!KG1haW4p/quality/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/quality.segments/!KG1haW4p/quality.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/quality.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/quality.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/quality.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/quality.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/quality.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/security.html +1 -1
- package/.next/standalone/.next/server/app/security.rsc +1 -1
- package/.next/standalone/.next/server/app/security.segments/!KG1haW4p/security/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/security.segments/!KG1haW4p/security.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/security.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/security.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/security.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/security.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/security.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-detail.html +1 -1
- package/.next/standalone/.next/server/app/skill-detail.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-detail.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-detail.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-detail.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-detail.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-detail.segments/skill-detail/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-detail.segments/skill-detail.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval/grayscale.html +2 -2
- package/.next/standalone/.next/server/app/skill-eval/grayscale.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval/grayscale.segments/!KG1haW4p/skill-eval/grayscale/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval/grayscale.segments/!KG1haW4p/skill-eval/grayscale.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval/grayscale.segments/!KG1haW4p/skill-eval.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval/grayscale.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval/grayscale.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval/grayscale.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval/grayscale.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval/grayscale.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval.html +1 -1
- package/.next/standalone/.next/server/app/skill-eval.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval.segments/!KG1haW4p/skill-eval/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval.segments/!KG1haW4p/skill-eval.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-eval.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-generator.html +1 -1
- package/.next/standalone/.next/server/app/skill-generator.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-generator.segments/!KG1haW4p/skill-generator/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-generator.segments/!KG1haW4p/skill-generator.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-generator.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-generator.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-generator.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-generator.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-generator.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-history.html +1 -1
- package/.next/standalone/.next/server/app/skill-history.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-history.segments/!KG1haW4p/skill-history/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-history.segments/!KG1haW4p/skill-history.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-history.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-history.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-history.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-history.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-history.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-opt.html +1 -1
- package/.next/standalone/.next/server/app/skill-opt.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-opt.segments/!KG1haW4p/skill-opt/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-opt.segments/!KG1haW4p/skill-opt.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-opt.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-opt.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-opt.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-opt.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-opt.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-release.html +1 -1
- package/.next/standalone/.next/server/app/skill-release.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-release.segments/!KG1haW4p/skill-release/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-release.segments/!KG1haW4p/skill-release.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-release.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-release.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-release.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-release.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skill-release.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.html +1 -1
- package/.next/standalone/.next/server/app/skills.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.segments/!KG1haW4p/skills/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.segments/!KG1haW4p/skills.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/trace.html +1 -1
- package/.next/standalone/.next/server/app/trace.rsc +1 -1
- package/.next/standalone/.next/server/app/trace.segments/!KG1haW4p/trace/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/trace.segments/!KG1haW4p/trace.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/trace.segments/!KG1haW4p.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/trace.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/trace.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/trace.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/trace.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +1 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__edc6a75f._.js +3 -0
- package/.next/standalone/.next/server/chunks/ce889_server_app_api_ingest_setup_opencode-offline-fix_route_actions_13b9e7e1.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_c4a195e5.js +1 -1
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +2 -2
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/Evaluation_and_Research/agent_evaluator_research_qna_2.md +1312 -0
- package/.next/standalone/Evaluation_and_Research/agent_evaluator_research_qna_3.md +712 -0
- package/.next/standalone/Evaluation_and_Research/agent_evaluator_research_qna_4.md +1228 -0
- package/.next/standalone/docker-compose.amd64.yml +1 -1
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/scripts/opencode-offline-fix.ps1 +93 -0
- package/.next/standalone/scripts/opencode_tui_plugin.tsx +23 -1
- package/package.json +1 -1
- package/scripts/opencode-offline-fix.ps1 +93 -0
- package/scripts/opencode_tui_plugin.tsx +23 -1
- package/.next/standalone/scripts/activate_telemetry.sh +0 -202
- package/.next/standalone/scripts/insight-paths.js +0 -33
- package/.next/standalone/scripts/opencode_otel_schema.ts +0 -73
- package/.next/standalone/scripts/opencode_plugin.ts +0 -1063
- package/scripts/activate_telemetry.sh +0 -202
- package/scripts/insight-paths.js +0 -33
- package/scripts/opencode_otel_schema.ts +0 -73
- package/scripts/opencode_plugin.ts +0 -1063
- /package/.next/standalone/.next/static/{xzZesDmllz08gJIxUNkXr → iE8084jR9Kgb7Bhs3Xokh}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{xzZesDmllz08gJIxUNkXr → iE8084jR9Kgb7Bhs3Xokh}/_clientMiddlewareManifest.json +0 -0
- /package/.next/standalone/.next/static/{xzZesDmllz08gJIxUNkXr → iE8084jR9Kgb7Bhs3Xokh}/_ssgManifest.js +0 -0
- /package/.next/static/{xzZesDmllz08gJIxUNkXr → iE8084jR9Kgb7Bhs3Xokh}/_buildManifest.js +0 -0
- /package/.next/static/{xzZesDmllz08gJIxUNkXr → iE8084jR9Kgb7Bhs3Xokh}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{xzZesDmllz08gJIxUNkXr → iE8084jR9Kgb7Bhs3Xokh}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[901411,e=>{"use strict";var n=e.i(747909),t=e.i(174017),i=e.i(996250),o=e.i(759756),s=e.i(561916),_=e.i(174677),r=e.i(869741),E=e.i(316795),a=e.i(487718),l=e.i(995169),I=e.i(47587),N=e.i(666012),T=e.i(570101),S=e.i(626937),c=e.i(10372),h=e.i(193695);e.i(52474);var d=e.i(600220),O=e.i(89171);function $(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\$/g,"\\$").replace(/`/g,"\\`")}function u(e){return e.replace(/`/g,"``").replace(/"/g,'`"').replace(/\$/g,"`$")}async function g(e){let n,t,i=e.headers.get("x-forwarded-host")||e.headers.get("host")||"127.0.0.1:3000",o=e.headers.get("x-forwarded-proto")||"https",s=new URL(e.url),_=process.env.NEXT_PUBLIC_URL_PREFIX||"",r=`${o}://${i}${_}`,E=s.searchParams.get("key")||s.searchParams.get("apiKey")||"",a=s.searchParams.get("yes")??s.searchParams.get("y")??s.searchParams.get("noninteractive"),l=null!==a&&!["0","false","no"].includes(a.trim().toLowerCase()),I=(s.searchParams.get("frameworks")||s.searchParams.get("framework")||"opencode").trim()||"opencode",N=s.searchParams.get("nokey")??s.searchParams.get("no-key"),T=null!==N&&!["0","false","no"].includes(N.trim().toLowerCase());if("windows"==(n=e.headers.get("user-agent")||"",(t=e.headers.get("x-platform")||"")?"windows"===t.toLowerCase()?"windows":"unix":n.toLowerCase().includes("windows")?"windows":"unix")){let e=function(e,n,t,i=!1,o="opencode",s=!1){return["# =============================================================================\n# Agent-insight One-Click Setup (PowerShell)\n# =============================================================================\n",'$AGENT_INSIGHT_HOST = "'+u(e)+'"','$AGENT_INSIGHT_BASE_URL = "'+u(n)+'"','$AGENT_INSIGHT_SETUP_API_KEY = "'+u(t)+'"','\n# ── 非交互模式(?yes=1 / ?nokey=1,或 env):全程无提示,默认只装 opencode ──────\n# iex (irm "<host>/api/ingest/setup?yes=1&nokey=1")\n# 或 env: $env:AGENT_INSIGHT_NONINTERACTIVE=1; $env:AGENT_INSIGHT_NO_KEY=1',"$NONINTERACTIVE = $"+(i?"true":"false"),'$NONINTERACTIVE_FRAMEWORKS = "'+u(o||"opencode")+'"',"$FORCE_NO_KEY = $"+(s?"true":"false"),'if ($env:AGENT_INSIGHT_NONINTERACTIVE -eq "1" -or $env:AGENT_INSIGHT_NONINTERACTIVE -eq "true") { $NONINTERACTIVE = $true }\nif ($env:AGENT_INSIGHT_NO_KEY -eq "1" -or $env:AGENT_INSIGHT_NO_KEY -eq "true") { $FORCE_NO_KEY = $true }\nif ($NONINTERACTIVE) { Write-Host "🤖 非交互模式:跳过所有提示,安装框架 = $NONINTERACTIVE_FRAMEWORKS" }\n\nWrite-Host "🚀 Fetching Agent-insight telemetry components from $AGENT_INSIGHT_BASE_URL..."\n\n# 0. Check Node.js version\n$nodeCmd = Get-Command node -ErrorAction SilentlyContinue\nif (-not $nodeCmd) {\n Write-Host "❌ Error: Node.js is not installed." -ForegroundColor Red\n Write-Host " Agent-insight requires Node.js 20 or higher."\n Write-Host " Please install Node.js: https://nodejs.org/"\n exit 1\n}\n\n$nodeVersion = (node -v 2>$null) -replace "^v", ""\n$nodeMajor = $nodeVersion.Split(".")[0]\nif ([int]$nodeMajor -lt 20) {\n Write-Host "❌ Error: Node.js version $nodeVersion is not supported." -ForegroundColor Red\n Write-Host " Agent-insight requires Node.js 20 or higher."\n Write-Host " Please upgrade your Node.js version: https://nodejs.org/"\n exit 1\n}\nWrite-Host "✅ Node.js version: $nodeVersion"\n\n# 1. Setup Directories\n$homeDir = $env:USERPROFILE\nNew-Item -ItemType Directory -Force -Path "$homeDir\\.agent-insight" | Out-Null\nNew-Item -ItemType Directory -Force -Path "$homeDir\\.agent-insight\\logs" | Out-Null\nNew-Item -ItemType Directory -Force -Path "$homeDir\\.opencode\\skills" | Out-Null\nNew-Item -ItemType Directory -Force -Path "$homeDir\\.claude\\projects" | Out-Null\nNew-Item -ItemType Directory -Force -Path ".opencode\\skills" | Out-Null\nWrite-Host "📂 Created necessary directories"\n\n# 2. Framework Selection(非交互模式跳过 inquirer,用默认 $NONINTERACTIVE_FRAMEWORKS)\nWrite-Host ""\n\nif ($NONINTERACTIVE) {\n $SELECTED_FRAMEWORKS = $NONINTERACTIVE_FRAMEWORKS\n} else {\n\n$SELECTOR_SCRIPT = "$homeDir\\.agent-insight\\framework_selector.mjs"\n$SELECTOR_RESULT = "$homeDir\\.agent-insight\\.selector_result"\n\n# Install inquirer and tsx if not already installed\nSet-Location "$homeDir\\.agent-insight"\nif (-not (Test-Path "package.json")) {\n \'{"name": "agent-insight-setup", "version": "1.0.0", "type": "module", "dependencies": {}}\' | Out-File -FilePath "package.json" -Encoding utf8\n}\nif (-not (Test-Path "node_modules\\inquirer") -or -not (Test-Path "node_modules\\tsx")) {\n Write-Host "📦 Installing dependencies for interactive selection..."\n npm install inquirer tsx --save 2>$null\n}\n\n$selectorContent = @\'\nimport inquirer from \'inquirer\';\nimport fs from \'fs\';\n\nconst frameworks = [\n { name: \'OpenCode\', value: \'opencode\' },\n { name: \'Claude Code\', value: \'claude\' },\n { name: \'Hermes\', value: \'hermes\' },\n { name: \'JiuwenSwarm\', value: \'jiuwen\' }\n];\n\nasync function select() {\n console.log(\'\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'╔══════════════════════════════════════════════════════════╗\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'║ ║\');\n console.log(\'\\x1b[1m\\x1b[36m%s\\x1b[0m\', \'║ ✨ Agent-insight ✨ ║\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'║ ║\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'╚══════════════════════════════════════════════════════════╝\');\n console.log(\'\');\n console.log(\'\\x1b[90m%s\\x1b[0m\', \' 提示: ↑↓ 移动 | 空格 选择 | a 全选 | i 反选 | Enter 确认\');\n console.log(\'\');\n\n const answers = await inquirer.prompt([\n {\n type: \'checkbox\',\n name: \'frameworks\',\n message: \'集成到:\',\n choices: frameworks,\n default: [\'opencode\'],\n pageSize: 10,\n loop: false\n }\n ]);\n\n const selected = answers.frameworks;\n \n if (selected.length > 0) {\n console.log(\'\');\n console.log(\'\\x1b[32m%s\\x1b[0m\', \'✅ 将安装以下组件:\');\n selected.forEach(fw => {\n const name = frameworks.find(f => f.value === fw)?.name || fw;\n console.log(\'\\x1b[32m%s\\x1b[0m\', \' • \' + name);\n });\n console.log(\'\');\n } else {\n console.log(\'\');\n console.log(\'\\x1b[33m%s\\x1b[0m\', \'⚠️ 未选择任何组件,将不进行安装。\');\n console.log(\'\');\n }\n\n const resultFile = process.env.SELECTOR_RESULT_FILE || process.env.USERPROFILE + \'\\\\.agent-insight\\\\.selector_result\';\n fs.writeFileSync(resultFile, selected.join(\',\'));\n}\n\nselect().catch(err => {\n console.error(\'Error:\', err);\n process.exit(1);\n});\n\'@\n\nSet-Content -Path $SELECTOR_SCRIPT -Value $selectorContent -Encoding UTF8\n\n# Run the selector interactively\n$env:SELECTOR_RESULT_FILE = $SELECTOR_RESULT\nSet-Location "$homeDir\\.agent-insight"\nnpx -y tsx $SELECTOR_SCRIPT\n\n# Read the selection result from file\nif (Test-Path $SELECTOR_RESULT) {\n $SELECTED_FRAMEWORKS = Get-Content $SELECTOR_RESULT\n Remove-Item $SELECTOR_RESULT -Force\n} else {\n $SELECTED_FRAMEWORKS = ""\n}\n} # end: 交互 vs 非交互 框架选择\n\n# Set installation flags based on selection\n$INSTALL_OPENCODE = $false\n$INSTALL_CLAUDE = $false\n$INSTALL_HERMES = $false\n$INSTALL_JIUWEN = $false\n\nif ($SELECTED_FRAMEWORKS -match "opencode") {\n $INSTALL_OPENCODE = $true\n}\nif ($SELECTED_FRAMEWORKS -match "claude") {\n $INSTALL_CLAUDE = $true\n}\nif ($SELECTED_FRAMEWORKS -match "hermes") {\n $INSTALL_HERMES = $true\n}\nif ($SELECTED_FRAMEWORKS -match "jiuwen") {\n $INSTALL_JIUWEN = $true\n}\n\n# Exit if nothing selected\nif (-not $INSTALL_OPENCODE -and -not $INSTALL_CLAUDE -and -not $INSTALL_HERMES -and -not $INSTALL_JIUWEN) {\n Write-Host "⚠️ 未选择任何框架组件,将跳过插件安装。"\n Write-Host " 继续执行配置步骤..."\n Write-Host ""\n}\n\n# 3. Download Components\nif ($INSTALL_OPENCODE) {\n Write-Host "⏬ Downloading OpenCode Plugin..."\n $opencodeConfigDir = Join-Path $homeDir ".config\\opencode"\n New-Item -ItemType Directory -Path (Join-Path $opencodeConfigDir "plugins") -Force | Out-Null\n Remove-Item -Path (Join-Path $opencodeConfigDir "plugins\\Skill-Insight.ts") -Force -ErrorAction SilentlyContinue\n Remove-Item -Path (Join-Path $opencodeConfigDir "plugins\\Witty-Skill-Insight.ts") -Force -ErrorAction SilentlyContinue\n Remove-Item -Path (Join-Path $homeDir ".opencode\\plugins\\Skill-Insight.ts") -Force -ErrorAction SilentlyContinue\n Remove-Item -Path (Join-Path $homeDir ".opencode\\plugins\\Witty-Skill-Insight.ts") -Force -ErrorAction SilentlyContinue\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/opencode" -OutFile (Join-Path $opencodeConfigDir "plugins\\Witty-Skill-Insight.ts")\n Write-Host "⏬ Downloading OpenCode Uploader..."\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/opencode-uploader" -OutFile (Join-Path $homeDir ".agent-insight\\opencode_uploader_client.js")\n Write-Host "⏬ Downloading OpenCode TUI Plugin..."\n $tuiPluginPath = (Join-Path $opencodeConfigDir "plugins\\Witty-Skill-Insight.tui.tsx")\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/opencode-tui" -OutFile $tuiPluginPath\n $tuiConfigFile = (Join-Path $opencodeConfigDir "tui.json")\n try {\n $data = @{}\n if (Test-Path $tuiConfigFile) {\n $raw = Get-Content $tuiConfigFile -Raw\n if ($raw -and $raw.Trim()) { $data = $raw | ConvertFrom-Json }\n }\n if (-not $data.plugin) { $data | Add-Member -MemberType NoteProperty -Name plugin -Value @() -Force }\n if ($data.plugin -notcontains $tuiPluginPath) { $data.plugin += $tuiPluginPath }\n $data | ConvertTo-Json -Depth 10 | Set-Content -Path $tuiConfigFile -Encoding UTF8\n } catch {\n Write-Host "⚠️ Failed to patch tui.json for TUI plugin."\n }\n}\n\nif ($INSTALL_CLAUDE) {\n Write-Host "🛰️ Claude Code will use official OpenTelemetry logs; no session-file watcher is required."\n}\n\nif ($INSTALL_HERMES) {\n Write-Host "Installing Agent Insight Hermes plugin..."\n $hermesHome = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $homeDir ".hermes" }\n $hermesPluginDir = Join-Path $hermesHome "plugins\\agent_insight_hermes"\n New-Item -ItemType Directory -Path $hermesPluginDir -Force | Out-Null\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/hermes-plugin" -OutFile (Join-Path $hermesPluginDir "__init__.py")\n @("name: agent_insight_hermes", "version: 0.2.0", "description: Agent Insight telemetry for Hermes", "provides_hooks:", " - pre_llm_call", " - post_llm_call", " - pre_api_request", " - post_api_request", " - api_request_error", " - pre_tool_call", " - post_tool_call", " - subagent_start", " - subagent_stop", " - on_session_end") | Set-Content -Path (Join-Path $hermesPluginDir "plugin.yaml") -Encoding UTF8\n $hermesCmd = Get-Command hermes -ErrorAction SilentlyContinue\n if ($hermesCmd) {\n & $hermesCmd.Source plugins enable agent_insight_hermes\n } else {\n Write-Host "Warning: hermes command not found. The plugin files were installed; enable agent_insight_hermes after installing Hermes."\n }\n}\n\nif ($INSTALL_JIUWEN) {\n Write-Host "⏬ Installing Agent-insight JiuwenSwarm extension..."\n $jwHome = if ($env:JIUWENSWARM_DATA_DIR) { $env:JIUWENSWARM_DATA_DIR } else { Join-Path $homeDir ".jiuwenswarm" }\n $jwExtDir = Join-Path $jwHome "extensions\\agent-insight-observability"\n New-Item -ItemType Directory -Path $jwExtDir -Force | Out-Null\n New-Item -ItemType Directory -Path (Join-Path $jwHome "config") -Force | Out-Null\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/jiuwen-extension" -OutFile (Join-Path $jwExtDir "extension.py")\n @(\'id: agent-insight-observability\', \'name: agent-insight-observability\', \'version: 0.1.0\', \'description: Zero-code observability onboarding for JiuwenSwarm via agent-core OTLP.\', \'author: agent-insight\', \'min_jiuwenswarm_version: "0.2.0"\', \'dependencies: {}\', \'config_schema:\', \' type: object\') | Set-Content -Path (Join-Path $jwExtDir "extension.yaml") -Encoding UTF8\n Write-Host "✅ JiuwenSwarm extension installed at $jwExtDir"\n}\n\n# 4. Configure ~/.agent-insight/.env\n$AGENT_INSIGHT_CONFIG_FILE = "$homeDir\\.agent-insight\\.env"\n$EXISTING_KEY = ""\n$EXISTING_HOST = ""\n$EXISTING_SHOW_TASK_STATS = ""\n$EXISTING_UPLOAD_SINCE_MS = ""\nif (Test-Path $AGENT_INSIGHT_CONFIG_FILE) {\n $content = Get-Content $AGENT_INSIGHT_CONFIG_FILE\n $keyLine = $content | Select-String \'^AGENT_INSIGHT_API_KEY=\' | Select-Object -First 1\n $hostLine = $content | Select-String \'^AGENT_INSIGHT_HOST=\' | Select-Object -First 1\n $showLine = $content | Select-String \'^AGENT_INSIGHT_SHOW_TASK_STATS=\' | Select-Object -First 1\n $sinceLine = $content | Select-String \'^AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=\' | Select-Object -First 1\n if ($keyLine) {\n $EXISTING_KEY = $keyLine.Line.Substring(\'AGENT_INSIGHT_API_KEY=\'.Length)\n }\n if ($hostLine) {\n $EXISTING_HOST = $hostLine.Line.Substring(\'AGENT_INSIGHT_HOST=\'.Length)\n }\n if ($showLine) {\n $EXISTING_SHOW_TASK_STATS = $showLine.Line.Substring(\'AGENT_INSIGHT_SHOW_TASK_STATS=\'.Length)\n }\n if ($sinceLine) {\n $EXISTING_UPLOAD_SINCE_MS = $sinceLine.Line.Substring(\'AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=\'.Length)\n }\n}\n\n# -- API Key Logic --\n$FINAL_KEY = if ($AGENT_INSIGHT_SETUP_API_KEY) { $AGENT_INSIGHT_SETUP_API_KEY } else { $EXISTING_KEY }\nif ($FORCE_NO_KEY) {\n $FINAL_KEY = ""\n Write-Host "🔑 --no-key:强制无 key(清空本机已有 key),数据归到服务端 AGENT_INSIGHT_DEFAULT_INGEST_USER 指定的共享账号。"\n} elseif ($NONINTERACTIVE) {\n if ($FINAL_KEY) { Write-Host "🔑 Using API Key (from setup URL / existing config)." }\n else { Write-Host "🔑 非交互模式且未提供 API Key —— 以「无 key」方式上报,数据归到服务端 AGENT_INSIGHT_DEFAULT_INGEST_USER 指定的共享账号。" }\n} elseif ($AGENT_INSIGHT_SETUP_API_KEY) {\n Write-Host "🔑 Using API Key from setup URL."\n} elseif ($EXISTING_KEY) {\n Write-Host "🔑 Found existing API Key."\n $USE_EXISTING = Read-Host "👉 Use existing key? (y/N, Default: y)"\n if ($USE_EXISTING -match \'^[Nn]$\') {\n $FINAL_KEY = Read-Host "👉 Please enter your NEW API Key"\n }\n} else {\n Write-Host "🔑 AGENT_INSIGHT_API_KEY is not set."\n $FINAL_KEY = Read-Host "👉 Please enter your API Key"\n}\n\n# -- Host Logic --\n$FINAL_HOST = $AGENT_INSIGHT_HOST\nif (-not $NONINTERACTIVE -and $EXISTING_HOST -and ($EXISTING_HOST -ne $AGENT_INSIGHT_HOST)) {\n Write-Host "🌐 Current Host in config: $EXISTING_HOST"\n Write-Host "🌐 New Host detected: $AGENT_INSIGHT_HOST"\n $CHANGE_HOST = Read-Host "👉 Change to new Host? (y/N, Default: y)"\n if ($CHANGE_HOST -match \'^[Nn]$\') {\n $FINAL_HOST = $EXISTING_HOST\n }\n} elseif (-not $EXISTING_HOST) {\n $FINAL_HOST = $AGENT_INSIGHT_HOST\n}\n\n$FINAL_SHOW_TASK_STATS = $EXISTING_SHOW_TASK_STATS\nif (-not $FINAL_SHOW_TASK_STATS) {\n $FINAL_SHOW_TASK_STATS = "true"\n}\n\nif (-not $FINAL_KEY) {\n if ($NONINTERACTIVE -or $FORCE_NO_KEY) {\n Write-Host "ℹ️ 未配置 API Key:以「无 key」方式上报,数据归到服务端默认共享账号(需服务端已配 AGENT_INSIGHT_DEFAULT_INGEST_USER)。"\n } else {\n Write-Host "⚠️ Warning: No API Key provided. Telemetry upload will fail until you set it in $AGENT_INSIGHT_CONFIG_FILE"\n }\n}\n\n# -- Per-account isolation: namespace opencode spool/checkpoint by API-key hash --\n$CLIENT_KEY_HASH = ([System.BitConverter]::ToString(([System.Security.Cryptography.SHA256]::Create()).ComputeHash([System.Text.Encoding]::UTF8.GetBytes([string]$FINAL_KEY))) -replace \'-\',\'\').ToLower().Substring(0,16)\n$NOW_MS = [string][long]([DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds())\nif ($EXISTING_UPLOAD_SINCE_MS -and ($FINAL_KEY -eq $EXISTING_KEY)) { $UPLOAD_SINCE_MS = $EXISTING_UPLOAD_SINCE_MS } else { $UPLOAD_SINCE_MS = $NOW_MS }\n\nWrite-Host "⚙️ Updating configuration..."\nNew-Item -ItemType File -Path $AGENT_INSIGHT_CONFIG_FILE -Force | Out-Null\nCopy-Item $AGENT_INSIGHT_CONFIG_FILE "$AGENT_INSIGHT_CONFIG_FILE.bak"\n$content = Get-Content "$AGENT_INSIGHT_CONFIG_FILE.bak"\n$content | Where-Object { $_ -notmatch \'^AGENT_INSIGHT_HOST=\' -and $_ -notmatch \'^AGENT_INSIGHT_API_KEY=\' -and $_ -notmatch \'^AGENT_INSIGHT_SHOW_TASK_STATS=\' -and $_ -notmatch \'^AGENT_INSIGHT_RETENTION_DAYS=\' -and $_ -notmatch \'^AGENT_INSIGHT_OPENCODE_OTEL_ENABLE=\' -and $_ -notmatch \'^AGENT_INSIGHT_OPENCODE_SPOOL_DIR=\' -and $_ -notmatch \'^AGENT_INSIGHT_OPENCODE_UPLOADER=\' -and $_ -notmatch \'^AGENT_INSIGHT_CLAUDE_OTEL_SPOOL_DIR=\' -and $_ -notmatch \'^AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES=\' -and $_ -notmatch \'^AGENT_INSIGHT_MAX_TOOL_IO=\' -and $_ -notmatch \'^AGENT_INSIGHT_MAX_EVENT_STRING=\' -and $_ -notmatch \'^AGENT_INSIGHT_OPENCODE_UPLOAD_COOLDOWN_MS=\' -and $_ -notmatch \'^AGENT_INSIGHT_CLIENT_KEY_HASH=\' -and $_ -notmatch \'^AGENT_INSIGHT_OPENCODE_CHECKPOINT=\' -and $_ -notmatch \'^AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=\' } | Set-Content $AGENT_INSIGHT_CONFIG_FILE\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_HOST=$FINAL_HOST"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_API_KEY=$FINAL_KEY"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_SHOW_TASK_STATS=$FINAL_SHOW_TASK_STATS"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_RETENTION_DAYS=10"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_OPENCODE_OTEL_ENABLE=true"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_CLIENT_KEY_HASH=$CLIENT_KEY_HASH"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_OPENCODE_SPOOL_DIR=$homeDir\\.agent-insight\\otel_data\\opencode\\$CLIENT_KEY_HASH"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_OPENCODE_CHECKPOINT=$homeDir\\.agent-insight\\opencode_uploader_checkpoint_$CLIENT_KEY_HASH.json"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=$UPLOAD_SINCE_MS"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_OPENCODE_UPLOADER=$homeDir\\.agent-insight\\opencode_uploader_client.js"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_CLAUDE_OTEL_SPOOL_DIR=$homeDir\\.agent-insight\\otel_data\\claude"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES=file:$homeDir\\.agent-insight\\claude_raw_bodies"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_MAX_TOOL_IO=4000"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_MAX_EVENT_STRING=20000"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_OPENCODE_UPLOAD_COOLDOWN_MS=15000"\nRemove-Item "$AGENT_INSIGHT_CONFIG_FILE.bak" -Force\n\n# 6.4 Configure Agent Insight Hermes plugin\nif ($INSTALL_HERMES) {\n $hermesHome = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $homeDir ".hermes" }\n $hermesPluginDir = Join-Path $hermesHome "plugins\\agent_insight_hermes"\n New-Item -ItemType Directory -Path $hermesPluginDir -Force | Out-Null\n $hermesConfig = @{ host = $FINAL_HOST.TrimEnd("/"); api_key = $FINAL_KEY; service_name = "hermes"; max_content_chars = 200000; spool_dir = (Join-Path $skillInsightDir "data\\hermes-otel-spool"); log_file = (Join-Path $skillInsightDir "logs\\hermes-plugin.log") } | ConvertTo-Json\n Set-Content -Path (Join-Path $hermesPluginDir "config.json") -Value $hermesConfig -Encoding UTF8\n Write-Host "Agent Insight Hermes config written to $hermesPluginDir\\config.json"\n}\n\n# 6.45 Configure JiuwenSwarm telemetry (workspace config\\.env, read by the extension)\nif ($INSTALL_JIUWEN) {\n $jwHome = if ($env:JIUWENSWARM_DATA_DIR) { $env:JIUWENSWARM_DATA_DIR } else { Join-Path $homeDir ".jiuwenswarm" }\n $jwEnv = Join-Path $jwHome "config\\.env"\n $jwExtParent = Join-Path $jwHome "extensions"\n $jwOtlpEndpoint = $FINAL_HOST.TrimEnd("/") + "/api/ingest/otel/v1/traces"\n New-Item -ItemType Directory -Path (Join-Path $jwHome "config") -Force | Out-Null\n New-Item -ItemType File -Path $jwEnv -Force | Out-Null\n $jwPrev = Get-Content $jwEnv\n $prevExtLine = $jwPrev | Select-String \'^EXTENSION_DIRS=\' | Select-Object -First 1\n # 去掉历史值可能带的成对引号(模板默认 EXTENSION_DIRS=""),否则拼出 "";<dir> 会破坏 dotenv 解析\n $prevExtDirs = if ($prevExtLine) { $prevExtLine.Line.Substring(\'EXTENSION_DIRS=\'.Length).Trim(\'"\').Trim("\'") } else { "jiuwenswarm/extensions" }\n if (-not $prevExtDirs) { $prevExtDirs = "jiuwenswarm/extensions" }\n if ($prevExtDirs.Split(";") -notcontains $jwExtParent) { $newExtDirs = "$prevExtDirs;$jwExtParent" } else { $newExtDirs = $prevExtDirs }\n $jwPrev | Where-Object { $_ -notmatch \'^OTEL_ENABLED=\' -and $_ -notmatch \'^AGENT_INSIGHT_OTLP_ENDPOINT=\' -and $_ -notmatch \'^AGENT_INSIGHT_API_KEY=\' -and $_ -notmatch \'^EXTENSION_DIRS=\' } | Set-Content $jwEnv\n Add-Content $jwEnv "OTEL_ENABLED=true"\n Add-Content $jwEnv "AGENT_INSIGHT_OTLP_ENDPOINT=$jwOtlpEndpoint"\n Add-Content $jwEnv "AGENT_INSIGHT_API_KEY=$FINAL_KEY"\n Add-Content $jwEnv "EXTENSION_DIRS=$newExtDirs"\n Write-Host "✅ JiuwenSwarm telemetry configured -> $jwOtlpEndpoint (service=jiuwenswarm)"\n}\nWrite-Host "✅ Configuration updated at $AGENT_INSIGHT_CONFIG_FILE"\n\n# 6.5 Configure Claude Code official OTel logs\nif ($INSTALL_CLAUDE) {\n $claudeOtelScript = @\'\nfunction Invoke-SkillInsightClaude {\n $envFile = Join-Path $env:USERPROFILE ".agent-insight\\.env"\n if (Test-Path $envFile) {\n Get-Content $envFile | ForEach-Object {\n if ($_ -match "^([^#=]+)=(.*)$") { [Environment]::SetEnvironmentVariable($matches[1], $matches[2], "Process") }\n }\n }\n $siHost = if ($env:AGENT_INSIGHT_HOST) { $env:AGENT_INSIGHT_HOST } else { "127.0.0.1:3000" }\n if ($siHost -notmatch "^https?://") { $siHost = "http://$siHost" }\n $siHost = $siHost.TrimEnd("/")\n $env:CLAUDE_CODE_ENABLE_TELEMETRY = "1"\n $env:OTEL_LOGS_EXPORTER = "otlp"\n if (-not $env:OTEL_METRICS_EXPORTER) { $env:OTEL_METRICS_EXPORTER = "none" }\n $env:OTEL_EXPORTER_OTLP_LOGS_PROTOCOL = "http/json"\n $env:OTEL_EXPORTER_OTLP_LOGS_ENDPOINT = "$siHost/api/ingest/otel/v1/logs"\n $env:OTEL_EXPORTER_OTLP_HEADERS = "x-witty-api-key=$($env:AGENT_INSIGHT_API_KEY)"\n $env:OTEL_LOG_USER_PROMPTS = "1"\n $env:OTEL_LOG_TOOL_DETAILS = "1"\n $env:OTEL_LOG_TOOL_CONTENT = "1"\n $rawBodyDir = Join-Path $env:USERPROFILE ".agent-insight\\claude_raw_bodies"\n New-Item -ItemType Directory -Path $rawBodyDir -Force | Out-Null\n if (-not $env:AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES) { $env:AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES = "file:$rawBodyDir" }\n $env:OTEL_LOG_RAW_API_BODIES = $env:AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES\n $cmd = Get-Command claude -CommandType Application -ErrorAction SilentlyContinue\n if (-not $cmd) { throw "claude executable not found in PATH" }\n & $cmd.Source @args\n}\nSet-Alias claude Invoke-SkillInsightClaude\n\'@\n $claudeOtelPath = "$homeDir\\.agent-insight\\claude_otel_env.ps1"\n Set-Content -Path $claudeOtelPath -Value $claudeOtelScript -Encoding UTF8\n $profileDir = Split-Path $PROFILE -Parent\n if ($profileDir) { New-Item -ItemType Directory -Path $profileDir -Force | Out-Null }\n $profileText = if (Test-Path $PROFILE) { Get-Content $PROFILE -Raw } else { "" }\n if (-not ($profileText.Contains(".agent-insight\\claude_otel_env.ps1") -or $profileText.Contains(".agent-insight/claude_otel_env.ps1"))) {\n Add-Content -Path $PROFILE -Value ""\n Add-Content -Path $PROFILE -Value "# Skill-Insight Claude Code OTel"\n Add-Content -Path $PROFILE -Value ". `"$claudeOtelPath`""\n }\n Write-Host "✅ Claude Code OTel env installed at $claudeOtelPath"\n Write-Host " Restart PowerShell or run: . `"$claudeOtelPath`""\n Get-Process | Where-Object { $_.CommandLine -like "*claude_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\n Remove-Item "$homeDir\\.agent-insight\\claude_watcher_client.ts", "$homeDir\\.agent-insight\\start_claude_watcher.ps1", "$homeDir\\.agent-insight\\stop_claude_watcher.ps1", "$homeDir\\.agent-insight\\claude_watcher.pid" -Force -ErrorAction SilentlyContinue\n Write-Host "🧹 Removed legacy Claude session-file watcher if it was installed."\n}\n\n# 7. Create Watcher Startup/Stop Scripts\n$NEEDS_WATCHER_SCRIPTS = $false\nif ($INSTALL_OPENCODE) {\n $NEEDS_WATCHER_SCRIPTS = $true\n}\n\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "📝 Creating watcher management scripts..."\n\n if ($INSTALL_OPENCODE) {\n $startScript = @\'\nGet-Process | Where-Object { $_.CommandLine -like "*opencode_uploader_client.js*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nGet-Process | Where-Object { $_.CommandLine -like "*skill-insight-opencode-uploader-loop*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nNew-Item -ItemType Directory -Path "$env:USERPROFILE\\.agent-insight\\logs" -Force | Out-Null\n$intervalSec = if ($env:AGENT_INSIGHT_OPENCODE_UPLOADER_INTERVAL_SEC) { $env:AGENT_INSIGHT_OPENCODE_UPLOADER_INTERVAL_SEC } else { "300" }\n$logFile = "$env:USERPROFILE\\.agent-insight\\logs\\opencode_uploader.log"\n$uploaderPath = "$env:USERPROFILE\\.agent-insight\\opencode_uploader_client.js"\n$runtime = if (Get-Command node -ErrorAction SilentlyContinue) { "node" } elseif (Get-Command bun -ErrorAction SilentlyContinue) { "bun" } else { $null }\nif (-not $runtime) {\n Add-Content $logFile "[$(Get-Date)] Skipped: node/bun not installed"\n return\n}\n# Sentinel marker in script body so it can be matched by CommandLine search.\n$loopBody = @"\n# skill-insight-opencode-uploader-loop\nwhile (`$true) {\n & `"$runtime`" `"$uploaderPath`" *>> `"$logFile`"\n Start-Sleep -Seconds $intervalSec\n}\n"@\n$proc = Start-Process -FilePath "powershell" -ArgumentList "-NoProfile", "-Command", $loopBody -PassThru -WindowStyle Hidden\nSet-Content "$env:USERPROFILE\\.agent-insight\\opencode_uploader.pid" $proc.Id\nWrite-Host "OpenCode uploader daemon started with PID $($proc.Id) (interval=${intervalSec}s)"\n\'@\n Set-Content -Path "$homeDir\\.agent-insight\\start_opencode_uploader.ps1" -Value $startScript -Encoding UTF8\n\n $stopScript = @\'\nGet-Process | Where-Object { $_.CommandLine -like "*skill-insight-opencode-uploader-loop*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nGet-Process | Where-Object { $_.CommandLine -like "*opencode_uploader_client.js*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nRemove-Item "$env:USERPROFILE\\.agent-insight\\opencode_uploader.pid" -Force -ErrorAction SilentlyContinue\nWrite-Host "OpenCode uploader daemon stopped"\n\'@\n Set-Content -Path "$homeDir\\.agent-insight\\stop_opencode_uploader.ps1" -Value $stopScript -Encoding UTF8\n }\n\n $combinedStart = \'Write-Host "Starting Agent-Insight watchers..."\'\n if ($INSTALL_OPENCODE) { $combinedStart += [char]10 + "& `"$homeDir\\.agent-insight\\start_opencode_uploader.ps1`"" }\n $combinedStart += [char]10 + \'Write-Host "All watchers started!"\'\n Set-Content -Path "$homeDir\\.agent-insight\\start_watchers.ps1" -Value $combinedStart -Encoding UTF8\n\n $combinedStop = \'Write-Host "Stopping Agent-Insight watchers..."\'\n if ($INSTALL_OPENCODE) { $combinedStop += [char]10 + "& `"$homeDir\\.agent-insight\\stop_opencode_uploader.ps1`"" }\n $combinedStop += [char]10 + \'Write-Host "All watchers stopped!"\'\n Set-Content -Path "$homeDir\\.agent-insight\\stop_watchers.ps1" -Value $combinedStop -Encoding UTF8\n}\n\n# 8. Start Watchers Now\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "🚀 Starting telemetry watchers..."\n if (Get-Command npx -ErrorAction SilentlyContinue) {\n & "$homeDir\\.agent-insight\\start_watchers.ps1"\n } else {\n Write-Host "⚠️ Node.js (npx) not found. Skipping watcher startup."\n }\n}\n\n# 10. Final Summary\nWrite-Host ""\nWrite-Host "🌟 Agent-Insight Telemetry: READY"\nWrite-Host "------------------------------------------------"\nWrite-Host "Installed Components:"\nif ($INSTALL_OPENCODE) { Write-Host " ✅ OpenCode Plugin: $opencodeConfigDir\\plugins\\Witty-Skill-Insight.ts" }\nif ($INSTALL_OPENCODE) { Write-Host " ✅ OpenCode Uploader Daemon: ~/.agent-insight/opencode_uploader_client.js (5-min poll)" }\nif ($INSTALL_CLAUDE) { Write-Host " ✅ Claude Code OTel: ~/.agent-insight/claude_otel_env.ps1" }\nif ($INSTALL_HERMES) { $summaryHermesHome = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $homeDir ".hermes" }; Write-Host " ✅ Agent Insight Hermes Plugin: $summaryHermesHome\\plugins\\agent_insight_hermes\\config.json" }\nif ($INSTALL_JIUWEN) { $summaryJwHome = if ($env:JIUWENSWARM_DATA_DIR) { $env:JIUWENSWARM_DATA_DIR } else { Join-Path $homeDir ".jiuwenswarm" }; Write-Host " ✅ JiuwenSwarm Extension: $summaryJwHome\\extensions\\agent-insight-observability (telemetry in config\\.env)" }\n\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "Watcher Management:"\n Write-Host " Start all: ~/.agent-insight/start_watchers.ps1"\n Write-Host " Stop all: ~/.agent-insight/stop_watchers.ps1"\n Write-Host " Logs: ~/.agent-insight/logs/"\n}\n\nWrite-Host ""\nWrite-Host "Usage:"\nif ($INSTALL_OPENCODE) { Write-Host " 1. Run: opencode run \'hello\'" }\nif ($INSTALL_CLAUDE) { Write-Host " 2. Restart PowerShell, then run: claude" }\nif ($INSTALL_HERMES) { Write-Host " 3. Restart Hermes or start a new Hermes conversation" }\nWrite-Host "------------------------------------------------"'].join("\n")}(r,r,E,l,I,T);return new O.NextResponse(e,{headers:{"Content-Type":"text/plain; charset=utf-8"}})}{let e=function(e,n,t,i=!1,o="opencode",s=!1){return["#!/bin/bash\n# =============================================================================\n# Agent-insight One-Click Setup\n# =============================================================================\n",'AGENT_INSIGHT_HOST="'+$(e)+'"','AGENT_INSIGHT_BASE_URL="'+$(n)+'"','AGENT_INSIGHT_SETUP_API_KEY="'+$(t)+'"','OPENCODE_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/opencode"\n\n# ── 非交互模式(-y / --yes):全程无提示,默认只装 opencode ─────────────────────\n# curl -sSf "<host>/api/ingest/setup" | bash -s -- -y\n# URL 直接带: curl -sSf "<host>/api/ingest/setup?yes=1" | bash\n# env: curl -sSf "<host>/api/ingest/setup" | AGENT_INSIGHT_NONINTERACTIVE=1 bash\n# 指定框架: ... | bash -s -- -y --frameworks=opencode,claude\n# 强制无 key: ... ?yes=1&nokey=1 或 bash -s -- -y --no-key(清空本机已有 key,切共享账号)',"NONINTERACTIVE="+(i?"true":"false"),'NONINTERACTIVE_FRAMEWORKS="'+$(o||"opencode")+'"',"FORCE_NO_KEY="+(s?"true":"false"),'for arg in "$@"; do\n case "$arg" in\n -y|--yes|--non-interactive|--noninteractive) NONINTERACTIVE=true ;;\n --no-key|--nokey) FORCE_NO_KEY=true ;;\n --frameworks=*) NONINTERACTIVE=true; NONINTERACTIVE_FRAMEWORKS="${arg#*=}" ;;\n esac\ndone\nif [ "${AGENT_INSIGHT_NONINTERACTIVE:-}" = "1" ] || [ "${AGENT_INSIGHT_NONINTERACTIVE:-}" = "true" ]; then NONINTERACTIVE=true; fi\nif [ "$NONINTERACTIVE" = "true" ]; then echo "🤖 非交互模式:跳过所有提示,安装框架 = $NONINTERACTIVE_FRAMEWORKS"; fi\n\necho "🚀 Fetching Agent-insight telemetry components from $AGENT_INSIGHT_BASE_URL..."\n\n# 0. Check Node.js version\nif ! command -v node &> /dev/null; then\n echo "❌ Error: Node.js is not installed."\n echo " Agent-insight requires Node.js 20 or higher."\n echo " Please install Node.js: https://nodejs.org/"\n exit 1\nfi\n\nNODE_VERSION=$(node -v 2>/dev/null | sed "s/v//")\nNODE_MAJOR=$(echo "$NODE_VERSION" | cut -d. -f1)\nif [ "$NODE_MAJOR" -lt 20 ]; then\n echo "❌ Error: Node.js version $NODE_VERSION is not supported."\n echo " Agent-insight requires Node.js 20 or higher."\n echo " Please upgrade your Node.js version: https://nodejs.org/"\n exit 1\nfi\necho "✅ Node.js version: $NODE_VERSION"\n\n# 1. Setup Directories\nmkdir -p "$HOME/.agent-insight"\nmkdir -p "$HOME/.agent-insight/logs"\nmkdir -p "$OPENCODE_CONFIG_DIR/plugins"\nmkdir -p "$HOME/.opencode/skills"\nmkdir -p "$HOME/.claude/projects"\nmkdir -p ".opencode/skills"\nmkdir -p "$HOME/.agent-insight/example"\necho "📂 Created necessary directories"\n\n# 1b. Download built-in example messages log (for the bundled "messages 日志分析" dataset / demo traces)\nif curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/example-messages" -o "$HOME/.agent-insight/example/messages"; then\n echo "📄 Example log ready at $HOME/.agent-insight/example/messages"\nelse\n echo "⚠️ Skipped example messages log download (non-fatal)"\nfi\n\n# 2. Framework Selection(非交互模式跳过 inquirer,直接用 $NONINTERACTIVE_FRAMEWORKS)\necho ""\n\nif [ "$NONINTERACTIVE" = "true" ]; then\n SELECTED_FRAMEWORKS="$NONINTERACTIVE_FRAMEWORKS"\nelse\n\nSELECTOR_SCRIPT="$HOME/.agent-insight/framework_selector.mjs"\nSELECTOR_RESULT="$HOME/.agent-insight/.selector_result"\n\n# Install inquirer and tsx if not already installed\ncd "$HOME/.agent-insight"\nif [ ! -f "package.json" ]; then\n echo \'{"name": "agent-insight-setup", "version": "1.0.0", "type": "module", "dependencies": {}}\' > package.json\nfi\nif [ ! -d "node_modules/inquirer" ] || [ ! -d "node_modules/tsx" ]; then\n echo "📦 Installing dependencies for interactive selection..."\n npm install inquirer tsx --save 2>/dev/null\nfi\n\ncat > "$SELECTOR_SCRIPT" << \'SELECTOR_EOF\'\nimport inquirer from \'inquirer\';\nimport fs from \'fs\';\n\nconst frameworks = [\n { name: \'OpenCode\', value: \'opencode\' },\n { name: \'Claude Code\', value: \'claude\' },\n { name: \'Hermes\', value: \'hermes\' },\n { name: \'JiuwenSwarm\', value: \'jiuwen\' }\n];\n\nasync function select() {\n console.log(\'\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'╔══════════════════════════════════════════════════════════╗\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'║ ║\');\n console.log(\'\\x1b[1m\\x1b[36m%s\\x1b[0m\', \'║ ✨ Agent-insight ✨ ║\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'║ ║\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'╚══════════════════════════════════════════════════════════╝\');\n console.log(\'\');\n console.log(\'\\x1b[90m%s\\x1b[0m\', \' 提示: ↑↓ 移动 | 空格 选择 | a 全选 | i 反选 | Enter 确认\');\n console.log(\'\');\n\n const answers = await inquirer.prompt([\n {\n type: \'checkbox\',\n name: \'frameworks\',\n message: \'集成到:\',\n choices: frameworks,\n default: [\'opencode\'],\n pageSize: 10,\n loop: false\n }\n ]);\n\n const selected = answers.frameworks;\n \n if (selected.length > 0) {\n console.log(\'\');\n console.log(\'\\x1b[32m%s\\x1b[0m\', \'✅ 将安装以下组件:\');\n selected.forEach(fw => {\n const name = frameworks.find(f => f.value === fw)?.name || fw;\n console.log(\'\\x1b[32m%s\\x1b[0m\', \' • \' + name);\n });\n console.log(\'\');\n } else {\n console.log(\'\');\n console.log(\'\\x1b[33m%s\\x1b[0m\', \'⚠️ 未选择任何组件,将不进行安装。\');\n console.log(\'\');\n }\n\n const resultFile = process.env.SELECTOR_RESULT_FILE || process.env.HOME + \'/.agent-insight/.selector_result\';\n fs.writeFileSync(resultFile, selected.join(\',\'));\n}\n\nselect().catch(err => {\n console.error(\'Error:\', err);\n process.exit(1);\n});\nSELECTOR_EOF\n\n# Run the selector interactively from /dev/tty\nexport SELECTOR_RESULT_FILE="$SELECTOR_RESULT"\ncd "$HOME/.agent-insight" && npx -y tsx "$SELECTOR_SCRIPT" < /dev/tty\n\n# Read the selection result from file\nif [ -f "$SELECTOR_RESULT" ]; then\n SELECTED_FRAMEWORKS=$(cat "$SELECTOR_RESULT")\n rm -f "$SELECTOR_RESULT"\nelse\n SELECTED_FRAMEWORKS=""\nfi\nfi # end: 交互 vs 非交互 框架选择\n\n# Set installation flags based on selection\nINSTALL_OPENCODE=false\nINSTALL_CLAUDE=false\nINSTALL_HERMES=false\nINSTALL_JIUWEN=false\n\nif [[ "$SELECTED_FRAMEWORKS" == *"opencode"* ]]; then\n INSTALL_OPENCODE=true\nfi\nif [[ "$SELECTED_FRAMEWORKS" == *"claude"* ]]; then\n INSTALL_CLAUDE=true\nfi\nif [[ "$SELECTED_FRAMEWORKS" == *"hermes"* ]]; then\n INSTALL_HERMES=true\nfi\nif [[ "$SELECTED_FRAMEWORKS" == *"jiuwen"* ]]; then\n INSTALL_JIUWEN=true\nfi\n\n# Exit if nothing selected\nif [ "$INSTALL_OPENCODE" = "false" ] && [ "$INSTALL_CLAUDE" = "false" ] && [ "$INSTALL_HERMES" = "false" ] && [ "$INSTALL_JIUWEN" = "false" ]; then\n echo "⚠️ 未选择任何框架组件,将跳过插件安装。"\n echo " 继续执行配置步骤..."\n echo ""\nfi\n\n# 3. Download Components\nif [ "$INSTALL_OPENCODE" = "true" ]; then\n echo "⏬ Downloading OpenCode Plugin..."\n rm -f "$OPENCODE_CONFIG_DIR/plugins/Skill-Insight.ts" "$OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.ts" 2>/dev/null || true\n rm -f "$HOME/.opencode/plugins/Skill-Insight.ts" "$HOME/.opencode/plugins/Witty-Skill-Insight.ts" 2>/dev/null || true\n curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/opencode" -o "$OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.ts"\n echo "⏬ Downloading OpenCode Uploader..."\n curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/opencode-uploader" -o "$HOME/.agent-insight/opencode_uploader_client.js"\n echo "⏬ Installing OpenCode commands..."\n mkdir -p "$OPENCODE_CONFIG_DIR/commands"\n curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/opencode-commands/si-optimizer" -o "$OPENCODE_CONFIG_DIR/commands/si-optimizer.md"\n echo "⏬ Downloading OpenCode TUI Plugin..."\n curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/opencode-tui" -o "$OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.tui.tsx"\n export TUI_PLUGIN_PATH="$OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.tui.tsx"\n export TUI_CONFIG_FILE="$OPENCODE_CONFIG_DIR/tui.json"\n if command -v node &> /dev/null; then\n node - <<\'NODE\'\nconst fs = require("fs");\nconst path = require("path");\nconst file = process.env.TUI_CONFIG_FILE;\nconst pluginPath = process.env.TUI_PLUGIN_PATH;\nlet data = {};\ntry {\n if (fs.existsSync(file)) {\n const text = fs.readFileSync(file, "utf8");\n data = text && text.trim() ? JSON.parse(text) : {};\n }\n} catch {}\nif (!data || typeof data !== "object") data = {};\nconst list = Array.isArray(data.plugin) ? data.plugin.slice() : [];\nif (pluginPath && !list.includes(pluginPath)) list.push(pluginPath);\ndata.plugin = list;\nfs.mkdirSync(path.dirname(file), { recursive: true });\nfs.writeFileSync(file, JSON.stringify(data, null, 2));\nNODE\n else\n echo "⚠️ node not found; skip TUI plugin config patch."\n fi\nfi\n\nif [ "$INSTALL_CLAUDE" = "true" ]; then\n echo "🛰️ Claude Code will use official OpenTelemetry logs; no session-file watcher is required."\nfi\n\nif [ "$INSTALL_HERMES" = "true" ]; then\n echo "Installing Agent Insight Hermes plugin..."\n HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}"\n HERMES_PLUGIN_DIR="$HERMES_HOME/plugins/agent_insight_hermes"\n mkdir -p "$HERMES_PLUGIN_DIR"\n curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/hermes-plugin" -o "$HERMES_PLUGIN_DIR/__init__.py"\n cat > "$HERMES_PLUGIN_DIR/plugin.yaml" <<\'HERMES_PLUGIN_EOF\'\nname: agent_insight_hermes\nversion: 0.2.0\ndescription: Agent Insight telemetry for Hermes\nprovides_hooks:\n - pre_llm_call\n - post_llm_call\n - pre_api_request\n - post_api_request\n - api_request_error\n - pre_tool_call\n - post_tool_call\n - subagent_start\n - subagent_stop\n - on_session_end\nHERMES_PLUGIN_EOF\n if command -v hermes >/dev/null 2>&1; then\n hermes plugins enable agent_insight_hermes || echo "Warning: enable the plugin manually with: hermes plugins enable agent_insight_hermes"\n else\n echo "Warning: hermes command not found. The plugin files were installed; enable agent_insight_hermes after installing Hermes."\n fi\nfi\n\nif [ "$INSTALL_JIUWEN" = "true" ]; then\n echo "⏬ Installing Agent-insight JiuwenSwarm extension..."\n JW_HOME="${JIUWENSWARM_DATA_DIR:-$HOME/.jiuwenswarm}"\n JW_EXT_DIR="$JW_HOME/extensions/agent-insight-observability"\n mkdir -p "$JW_EXT_DIR" "$JW_HOME/config"\n curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/jiuwen-extension" -o "$JW_EXT_DIR/extension.py"\n cat > "$JW_EXT_DIR/extension.yaml" <<\'JIUWEN_EXT_EOF\'\nid: agent-insight-observability\nname: agent-insight-observability\nversion: 0.1.0\ndescription: Zero-code observability onboarding for JiuwenSwarm via agent-core OTLP.\nauthor: agent-insight\nmin_jiuwenswarm_version: "0.2.0"\ndependencies: {}\nconfig_schema:\n type: object\nJIUWEN_EXT_EOF\n echo "✅ JiuwenSwarm extension installed at $JW_EXT_DIR"\nfi\n\n# 4. Configure ~/.agent-insight/.env\nAGENT_INSIGHT_CONFIG_FILE="$HOME/.agent-insight/.env"\nEXISTING_KEY=""\nEXISTING_HOST=""\nEXISTING_SHOW_TASK_STATS=""\nif [ -f "$AGENT_INSIGHT_CONFIG_FILE" ]; then\n EXISTING_KEY=$(grep \'^AGENT_INSIGHT_API_KEY=\' "$AGENT_INSIGHT_CONFIG_FILE" | head -n 1 | cut -d\'=\' -f2-)\n EXISTING_HOST=$(grep \'^AGENT_INSIGHT_HOST=\' "$AGENT_INSIGHT_CONFIG_FILE" | head -n 1 | cut -d\'=\' -f2-)\n EXISTING_SHOW_TASK_STATS=$(grep \'^AGENT_INSIGHT_SHOW_TASK_STATS=\' "$AGENT_INSIGHT_CONFIG_FILE" | head -n 1 | cut -d\'=\' -f2-)\n EXISTING_UPLOAD_SINCE_MS=$(grep \'^AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=\' "$AGENT_INSIGHT_CONFIG_FILE" | head -n 1 | cut -d\'=\' -f2-)\nfi\n\n# -- API Key Logic --\nFINAL_KEY="${AGENT_INSIGHT_SETUP_API_KEY:-$EXISTING_KEY}"\nif [ "$FORCE_NO_KEY" = "true" ]; then\n FINAL_KEY=""\n echo "🔑 --no-key:强制无 key(清空本机已有 key),数据归到服务端 AGENT_INSIGHT_DEFAULT_INGEST_USER 指定的共享账号。"\nelif [ "$NONINTERACTIVE" = "true" ]; then\n if [ -n "$FINAL_KEY" ]; then\n echo "🔑 Using API Key (from setup URL / existing config)."\n else\n echo "🔑 非交互模式且未提供 API Key —— 以「无 key」方式上报,数据归到服务端 AGENT_INSIGHT_DEFAULT_INGEST_USER 指定的共享账号。"\n fi\nelif [ -n "$AGENT_INSIGHT_SETUP_API_KEY" ]; then\n echo "🔑 Using API Key from setup URL."\nelif [ -n "$EXISTING_KEY" ]; then\n echo "🔑 Found existing API Key."\n read -p "👉 Use existing key? (y/N, Default: y): " USE_EXISTING < /dev/tty\n if [[ "$USE_EXISTING" =~ ^[Nn]$ ]]; then\n read -p "👉 Please enter your NEW API Key: " FINAL_KEY < /dev/tty\n fi\nelse\n echo "🔑 AGENT_INSIGHT_API_KEY is not set."\n read -p "👉 Please enter your API Key: " FINAL_KEY < /dev/tty\nfi\n\n# -- Host Logic --\nFINAL_HOST="$AGENT_INSIGHT_HOST"\nif [ "$NONINTERACTIVE" != "true" ] && [ -n "$EXISTING_HOST" ] && [ "$EXISTING_HOST" != "$AGENT_INSIGHT_HOST" ]; then\n echo "🌐 Current Host in config: $EXISTING_HOST"\n echo "🌐 New Host detected: $AGENT_INSIGHT_HOST"\n read -p "👉 Change to new Host? (y/N, Default: y): " CHANGE_HOST < /dev/tty\n if [[ "$CHANGE_HOST" =~ ^[Nn]$ ]]; then\n FINAL_HOST="$EXISTING_HOST"\n fi\nelif [ -z "$EXISTING_HOST" ]; then\n FINAL_HOST="$AGENT_INSIGHT_HOST"\nfi\n\nFINAL_SHOW_TASK_STATS="$EXISTING_SHOW_TASK_STATS"\nif [ -z "$FINAL_SHOW_TASK_STATS" ]; then\n FINAL_SHOW_TASK_STATS="true"\nfi\n\nif [ -z "$FINAL_KEY" ]; then\n if [ "$NONINTERACTIVE" = "true" ] || [ "$FORCE_NO_KEY" = "true" ]; then\n echo "ℹ️ 未配置 API Key:以「无 key」方式上报,数据归到服务端默认共享账号(需服务端已配 AGENT_INSIGHT_DEFAULT_INGEST_USER)。"\n else\n echo "⚠️ Warning: No API Key provided. Telemetry upload will fail until you set it in $AGENT_INSIGHT_CONFIG_FILE"\n fi\nfi\n\n# -- Per-account isolation: hash the API key so opencode spool/checkpoint are\n# namespaced per account. Switching accounts on the same machine no longer\n# replays another account\'s history under the current key.\nCLIENT_KEY_HASH=$(printf \'%s\' "$FINAL_KEY" | { shasum -a 256 2>/dev/null || sha256sum; } | cut -c1-16)\nNOW_MS=$(node -e \'process.stdout.write(String(Date.now()))\' 2>/dev/null || echo $(( $(date +%s) * 1000 )))\n# Keep an existing baseline when re-installing the SAME key; reset to now for a\n# new/changed key so only traces produced after THIS install are uploaded.\nif [ -n "$EXISTING_UPLOAD_SINCE_MS" ] && [ "$FINAL_KEY" = "$EXISTING_KEY" ]; then\n UPLOAD_SINCE_MS="$EXISTING_UPLOAD_SINCE_MS"\nelse\n UPLOAD_SINCE_MS="$NOW_MS"\nfi\n\necho "⚙️ Updating configuration..."\ntouch "$AGENT_INSIGHT_CONFIG_FILE"\ncp "$AGENT_INSIGHT_CONFIG_FILE" "${AGENT_INSIGHT_CONFIG_FILE}.bak"\ngrep -v "^AGENT_INSIGHT_HOST=" "${AGENT_INSIGHT_CONFIG_FILE}.bak" | grep -v "^AGENT_INSIGHT_API_KEY=" | grep -v "^AGENT_INSIGHT_SHOW_TASK_STATS=" | grep -v "^AGENT_INSIGHT_RETENTION_DAYS=" | grep -v "^AGENT_INSIGHT_OPENCODE_OTEL_ENABLE=" | grep -v "^AGENT_INSIGHT_OPENCODE_SPOOL_DIR=" | grep -v "^AGENT_INSIGHT_OPENCODE_UPLOADER=" | grep -v "^AGENT_INSIGHT_CLAUDE_OTEL_SPOOL_DIR=" | grep -v "^AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES=" | grep -v "^AGENT_INSIGHT_MAX_TOOL_IO=" | grep -v "^AGENT_INSIGHT_MAX_EVENT_STRING=" | grep -v "^AGENT_INSIGHT_OPENCODE_UPLOAD_COOLDOWN_MS=" | grep -v "^AGENT_INSIGHT_CLIENT_KEY_HASH=" | grep -v "^AGENT_INSIGHT_OPENCODE_CHECKPOINT=" | grep -v "^AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=" > "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_HOST=$FINAL_HOST" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_API_KEY=$FINAL_KEY" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_SHOW_TASK_STATS=$FINAL_SHOW_TASK_STATS" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_RETENTION_DAYS=10" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_OPENCODE_OTEL_ENABLE=true" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_CLIENT_KEY_HASH=$CLIENT_KEY_HASH" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_OPENCODE_SPOOL_DIR=$HOME/.agent-insight/otel_data/opencode/$CLIENT_KEY_HASH" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_OPENCODE_CHECKPOINT=$HOME/.agent-insight/opencode_uploader_checkpoint_$CLIENT_KEY_HASH.json" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=$UPLOAD_SINCE_MS" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_OPENCODE_UPLOADER=$HOME/.agent-insight/opencode_uploader_client.js" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_CLAUDE_OTEL_SPOOL_DIR=$HOME/.agent-insight/otel_data/claude" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES=file:$HOME/.agent-insight/claude_raw_bodies" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_MAX_TOOL_IO=4000" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_MAX_EVENT_STRING=20000" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_OPENCODE_UPLOAD_COOLDOWN_MS=15000" >> "$AGENT_INSIGHT_CONFIG_FILE"\nrm "${AGENT_INSIGHT_CONFIG_FILE}.bak"\necho "✅ Configuration updated at $AGENT_INSIGHT_CONFIG_FILE"\n\n# 6.4 Configure Agent Insight Hermes plugin\nif [ "$INSTALL_HERMES" = "true" ]; then\n HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}"\n HERMES_PLUGIN_DIR="$HERMES_HOME/plugins/agent_insight_hermes"\n mkdir -p "$HERMES_PLUGIN_DIR"\n cat > "$HERMES_PLUGIN_DIR/config.json" <<HERMES_CONFIG_EOF\n{\n "host": "${FINAL_HOST%/}",\n "api_key": "$FINAL_KEY",\n "service_name": "hermes",\n "max_content_chars": 200000,\n "spool_dir": "$HOME/.agent-insight/data/hermes-otel-spool",\n "log_file": "$HOME/.agent-insight/logs/hermes-plugin.log"\n}\nHERMES_CONFIG_EOF\n echo "Agent Insight Hermes config written to $HERMES_PLUGIN_DIR/config.json"\nfi\n\n# 6.45 Configure JiuwenSwarm telemetry (workspace config/.env, read by the extension)\nif [ "$INSTALL_JIUWEN" = "true" ]; then\n JW_HOME="${JIUWENSWARM_DATA_DIR:-$HOME/.jiuwenswarm}"\n JW_ENV="$JW_HOME/config/.env"\n JW_EXT_PARENT="$JW_HOME/extensions"\n JW_OTLP_ENDPOINT="${FINAL_HOST%/}/api/ingest/otel/v1/traces"\n mkdir -p "$JW_HOME/config"\n touch "$JW_ENV"\n cp "$JW_ENV" "${JW_ENV}.bak"\n # EXTENSION_DIRS: 保留既有(默认 jiuwenswarm/extensions) + 追加我们的目录(去重)\n PREV_EXT_DIRS=$(grep \'^EXTENSION_DIRS=\' "${JW_ENV}.bak" | head -n 1 | cut -d\'=\' -f2-)\n # 去掉历史值可能带的成对双引号:jiuwenswarm 模板默认 EXTENSION_DIRS="",\n # 直接拼接会写出 "";<dir>,python-dotenv 无法解析整行而丢弃 → 扩展目录失效。\n PREV_EXT_DIRS="${PREV_EXT_DIRS#\\"}"; PREV_EXT_DIRS="${PREV_EXT_DIRS%\\"}"\n if [ -z "$PREV_EXT_DIRS" ]; then PREV_EXT_DIRS="jiuwenswarm/extensions"; fi\n case ";$PREV_EXT_DIRS;" in\n *";$JW_EXT_PARENT;"*) NEW_EXT_DIRS="$PREV_EXT_DIRS" ;;\n *) NEW_EXT_DIRS="$PREV_EXT_DIRS;$JW_EXT_PARENT" ;;\n esac\n grep -v \'^OTEL_ENABLED=\' "${JW_ENV}.bak" | grep -v \'^AGENT_INSIGHT_OTLP_ENDPOINT=\' | grep -v \'^AGENT_INSIGHT_API_KEY=\' | grep -v \'^EXTENSION_DIRS=\' > "$JW_ENV"\n echo "OTEL_ENABLED=true" >> "$JW_ENV"\n echo "AGENT_INSIGHT_OTLP_ENDPOINT=$JW_OTLP_ENDPOINT" >> "$JW_ENV"\n echo "AGENT_INSIGHT_API_KEY=$FINAL_KEY" >> "$JW_ENV"\n echo "EXTENSION_DIRS=$NEW_EXT_DIRS" >> "$JW_ENV"\n rm -f "${JW_ENV}.bak"\n echo "✅ JiuwenSwarm telemetry configured -> $JW_OTLP_ENDPOINT (service=jiuwenswarm)"\n echo " 重启 JiuwenSwarm(agentserver)后,agent/LLM/tool trace 自动上报。"\nfi\n\n# 6.5 Configure Claude Code official OTel logs\nif [ "$INSTALL_CLAUDE" = "true" ]; then\n cat > "$HOME/.agent-insight/claude_otel_env.sh" << \'CLAUDE_OTEL_EOF\'\n# Agent-Insight Claude Code OpenTelemetry integration\nunalias claude 2>/dev/null || true\n\n_skill_insight_claude_load_env() {\n if [ -f "$HOME/.agent-insight/.env" ]; then\n set -a\n . "$HOME/.agent-insight/.env"\n set +a\n fi\n}\n\nclaude() {\n _skill_insight_claude_load_env\n local _si_host="${AGENT_INSIGHT_HOST:-127.0.0.1:3000}"\n case "$_si_host" in http://*|https://*) ;; *) _si_host="http://$_si_host" ;; esac\n _si_host="${_si_host%/}"\n mkdir -p "$HOME/.agent-insight/claude_raw_bodies" 2>/dev/null || true\n env \\\n CLAUDE_CODE_ENABLE_TELEMETRY=1 \\\n OTEL_LOGS_EXPORTER=otlp \\\n OTEL_METRICS_EXPORTER="${OTEL_METRICS_EXPORTER:-none}" \\\n OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/json \\\n OTEL_EXPORTER_OTLP_LOGS_ENDPOINT="$_si_host/api/ingest/otel/v1/logs" \\\n OTEL_EXPORTER_OTLP_HEADERS="x-witty-api-key=${AGENT_INSIGHT_API_KEY:-}" \\\n OTEL_LOG_USER_PROMPTS=1 \\\n OTEL_LOG_TOOL_DETAILS=1 \\\n OTEL_LOG_TOOL_CONTENT=1 \\\n OTEL_LOG_RAW_API_BODIES="${AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES:-file:$HOME/.agent-insight/claude_raw_bodies}" \\\n claude "$@"\n}\nCLAUDE_OTEL_EOF\n SHELL_RC="$HOME/.zshrc"\n [ -f "$HOME/.bashrc" ] && SHELL_RC="$HOME/.bashrc"\n if [ -f "$SHELL_RC" ] && ! grep -q "\\.agent-insight/claude_otel_env\\.sh" "$SHELL_RC"; then\n echo "" >> "$SHELL_RC"\n echo "# Agent-Insight Claude Code OTel" >> "$SHELL_RC"\n echo "source \\"$HOME/.agent-insight/claude_otel_env.sh\\"" >> "$SHELL_RC"\n fi\n echo "✅ Claude Code OTel env installed at $HOME/.agent-insight/claude_otel_env.sh"\n echo " Restart your terminal or run: source $HOME/.agent-insight/claude_otel_env.sh"\n pkill -f "claude_watcher_client.ts" 2>/dev/null || true\n rm -f "$HOME/.agent-insight/claude_watcher_client.ts" "$HOME/.agent-insight/start_claude_watcher.sh" "$HOME/.agent-insight/stop_claude_watcher.sh" "$HOME/.agent-insight/claude_watcher.pid"\n echo "🧹 Removed legacy Claude session-file watcher if it was installed."\nfi\n\n# 7. Create Watcher Startup/Stop Scripts\nNEEDS_WATCHER_SCRIPTS=false\nif [ "$INSTALL_OPENCODE" = "true" ]; then\n NEEDS_WATCHER_SCRIPTS=true\nfi\n\nif [ "$NEEDS_WATCHER_SCRIPTS" = "true" ]; then\n echo ""\n echo "📝 Creating watcher management scripts..."\n\n if [ "$INSTALL_OPENCODE" = "true" ]; then\n cat > "$HOME/.agent-insight/start_opencode_uploader.sh" << \'OPENCODE_UP_EOF\'\n#!/bin/bash\n# Kill any previous instance (the sentinel string lets pkill -f find the loop).\npkill -f "skill-insight-opencode-uploader-loop" 2>/dev/null\npkill -f "opencode_uploader_client.js" 2>/dev/null\nmkdir -p "$HOME/.agent-insight/logs"\nINTERVAL_SEC="${AGENT_INSIGHT_OPENCODE_UPLOADER_INTERVAL_SEC:-300}"\nLOG_FILE="$HOME/.agent-insight/logs/opencode_uploader.log"\nif command -v node >/dev/null 2>&1; then\n RUNTIME=node\nelif command -v bun >/dev/null 2>&1; then\n RUNTIME=bun\nelse\n echo "[$(date)] Skipped: node/bun not installed" >> "$LOG_FILE"\n exit 0\nfi\n# Loop body has a sentinel comment so `pkill -f skill-insight-opencode-uploader-loop` matches.\nnohup bash -c "\n# skill-insight-opencode-uploader-loop\nwhile true; do\n \\"$RUNTIME\\" \\"$HOME/.agent-insight/opencode_uploader_client.js\\" >> \\"$LOG_FILE\\" 2>&1\n sleep \\"$INTERVAL_SEC\\"\ndone" > /dev/null 2>&1 &\necho $! > "$HOME/.agent-insight/opencode_uploader.pid"\necho "OpenCode uploader daemon started with PID $(cat $HOME/.agent-insight/opencode_uploader.pid) (interval=${INTERVAL_SEC}s)"\nOPENCODE_UP_EOF\n chmod +x "$HOME/.agent-insight/start_opencode_uploader.sh"\n\n cat > "$HOME/.agent-insight/stop_opencode_uploader.sh" << \'STOP_OPENCODE_UP_EOF\'\n#!/bin/bash\npkill -f "skill-insight-opencode-uploader-loop" 2>/dev/null\npkill -f "opencode_uploader_client.js" 2>/dev/null\nPID_FILE="$HOME/.agent-insight/opencode_uploader.pid"\nif [ -f "$PID_FILE" ]; then kill "$(cat $PID_FILE)" 2>/dev/null; rm -f "$PID_FILE"; fi\necho "OpenCode uploader daemon stopped"\nSTOP_OPENCODE_UP_EOF\n chmod +x "$HOME/.agent-insight/stop_opencode_uploader.sh"\n fi\n\n cat > "$HOME/.agent-insight/start_watchers.sh" << \'WATCHER_HEADER\'\n#!/bin/bash\necho "Starting Agent-Insight watchers..."\nWATCHER_HEADER\n if [ "$INSTALL_OPENCODE" = "true" ]; then echo \'"$HOME/.agent-insight/start_opencode_uploader.sh"\' >> "$HOME/.agent-insight/start_watchers.sh"; fi\n echo \'echo "All watchers started!"\' >> "$HOME/.agent-insight/start_watchers.sh"\n chmod +x "$HOME/.agent-insight/start_watchers.sh"\n\n cat > "$HOME/.agent-insight/stop_watchers.sh" << \'STOP_HEADER\'\n#!/bin/bash\necho "Stopping Agent-Insight watchers..."\nSTOP_HEADER\n if [ "$INSTALL_OPENCODE" = "true" ]; then echo \'"$HOME/.agent-insight/stop_opencode_uploader.sh"\' >> "$HOME/.agent-insight/stop_watchers.sh"; fi\n echo \'echo "All watchers stopped!"\' >> "$HOME/.agent-insight/stop_watchers.sh"\n chmod +x "$HOME/.agent-insight/stop_watchers.sh"\nfi\n\n# 8. Start Watchers Now\nif [ "$NEEDS_WATCHER_SCRIPTS" = "true" ]; then\n echo ""\n echo "🚀 Starting telemetry watchers..."\n if command -v npx &> /dev/null; then\n "$HOME/.agent-insight/start_watchers.sh"\n else\n echo "⚠️ Node.js (npx) not found. Skipping watcher startup."\n fi\nfi\n\n# 10. Final Summary\necho ""\necho "🌟 Agent-Insight Telemetry: READY"\necho "------------------------------------------------"\necho "Installed Components:"\nif [ "$INSTALL_OPENCODE" = "true" ]; then echo " ✅ OpenCode Plugin: $OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.ts"; fi\nif [ "$INSTALL_OPENCODE" = "true" ]; then echo " ✅ OpenCode Command: ~/.config/opencode/commands/si-optimizer.md"; fi\nif [ "$INSTALL_OPENCODE" = "true" ]; then echo " ✅ OpenCode Uploader Daemon: ~/.agent-insight/opencode_uploader_client.js (5-min poll)"; fi\nif [ "$INSTALL_CLAUDE" = "true" ]; then echo " ✅ Claude Code OTel: ~/.agent-insight/claude_otel_env.sh"; fi\nif [ "$INSTALL_HERMES" = "true" ]; then echo " ✅ Agent Insight Hermes Plugin: ${HERMES_HOME:-$HOME/.hermes}/plugins/agent_insight_hermes/config.json"; fi\nif [ "$INSTALL_JIUWEN" = "true" ]; then echo " ✅ JiuwenSwarm Extension: ${JIUWENSWARM_DATA_DIR:-$HOME/.jiuwenswarm}/extensions/agent-insight-observability (telemetry in config/.env)"; fi\n\nif [ "$NEEDS_WATCHER_SCRIPTS" = "true" ]; then\n echo ""\n echo "Watcher Management:"\n echo " Start all: ~/.agent-insight/start_watchers.sh"\n echo " Stop all: ~/.agent-insight/stop_watchers.sh"\n echo " Logs: ~/.agent-insight/logs/"\nfi\n\necho ""\necho "Usage:"\nif [ "$INSTALL_OPENCODE" = "true" ]; then echo " 1. Run: opencode run \'hello\'"; fi\nif [ "$INSTALL_CLAUDE" = "true" ]; then echo " 2. Restart terminal, then run: claude"; fi\nif [ "$INSTALL_HERMES" = "true" ]; then echo " 3. Restart Hermes or start a new Hermes conversation"; fi\necho "------------------------------------------------"'].join("\n")}(r,r,E,l,I,T);return new O.NextResponse(e,{headers:{"Content-Type":"text/x-shellscript"}})}}e.s(["GET",()=>g],640112);var A=e.i(640112);let p=new n.AppRouteRouteModule({definition:{kind:t.RouteKind.APP_ROUTE,page:"/api/ingest/setup/route",pathname:"/api/ingest/setup",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/ingest/setup/route.ts",nextConfigOutput:"standalone",userland:A}),{workAsyncStorage:m,workUnitAsyncStorage:H,serverHooks:L}=p;function G(){return(0,i.patchFetch)({workAsyncStorage:m,workUnitAsyncStorage:H})}async function C(e,n,i){p.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let O="/api/ingest/setup/route";O=O.replace(/\/index$/,"")||"/";let $=await p.prepare(e,n,{srcPage:O,multiZoneDraftMode:!1});if(!$)return n.statusCode=400,n.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve()),null;let{buildId:u,params:g,nextConfig:A,parsedUrl:m,isDraftMode:H,prerenderManifest:L,routerServerContext:G,isOnDemandRevalidate:C,revalidateOnlyGenerated:R,resolvedPathname:f,clientReferenceManifest:P,serverActionsManifest:D}=$,F=(0,r.normalizeAppPath)(O),w=!!(L.dynamicRoutes[F]||L.routes[f]),v=async()=>((null==G?void 0:G.render404)?await G.render404(e,n,m,!1):n.end("This page could not be found"),null);if(w&&!H){let e=!!L.routes[f],n=L.dynamicRoutes[F];if(n&&!1===n.fallback&&!e){if(A.experimental.adapterPath)return await v();throw new h.NoFallbackError}}let y=null;!w||p.isDev||H||(y="/index"===(y=f)?"/":y);let W=!0===p.isDev||!w,U=w&&!W;D&&P&&(0,_.setManifestsSingleton)({page:O,clientReferenceManifest:P,serverActionsManifest:D});let M=e.method||"GET",x=(0,s.getTracer)(),b=x.getActiveScopeSpan(),k={params:g,prerenderManifest:L,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts},cacheComponents:!!A.cacheComponents,supportsDynamicResponse:W,incrementalCache:(0,o.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:A.cacheLife,waitUntil:i.waitUntil,onClose:e=>{n.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(n,t,i,o)=>p.onRequestError(e,n,i,o,G)},sharedContext:{buildId:u}},K=new E.NodeNextRequest(e),j=new E.NodeNextResponse(n),J=a.NextRequestAdapter.fromNodeNextRequest(K,(0,a.signalFromNodeResponse)(n));try{let _=async e=>p.handle(J,k).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":n.statusCode,"next.rsc":!1});let t=x.getRootSpanAttributes();if(!t)return;if(t.get("next.span_type")!==l.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${t.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let i=t.get("next.route");if(i){let n=`${M} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":n}),e.updateName(n)}else e.updateName(`${M} ${O}`)}),r=!!(0,o.getRequestMeta)(e,"minimalMode"),E=async o=>{var s,E;let a=async({previousCacheEntry:t})=>{try{if(!r&&C&&R&&!t)return n.statusCode=404,n.setHeader("x-nextjs-cache","REVALIDATED"),n.end("This page could not be found"),null;let s=await _(o);e.fetchMetrics=k.renderOpts.fetchMetrics;let E=k.renderOpts.pendingWaitUntil;E&&i.waitUntil&&(i.waitUntil(E),E=void 0);let a=k.renderOpts.collectedTags;if(!w)return await (0,N.sendResponse)(K,j,s,k.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),n=(0,T.toNodeOutgoingHttpHeaders)(s.headers);a&&(n[c.NEXT_CACHE_TAGS_HEADER]=a),!n["content-type"]&&e.type&&(n["content-type"]=e.type);let t=void 0!==k.renderOpts.collectedRevalidate&&!(k.renderOpts.collectedRevalidate>=c.INFINITE_CACHE)&&k.renderOpts.collectedRevalidate,i=void 0===k.renderOpts.collectedExpire||k.renderOpts.collectedExpire>=c.INFINITE_CACHE?void 0:k.renderOpts.collectedExpire;return{value:{kind:d.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:n},cacheControl:{revalidate:t,expire:i}}}}catch(n){throw(null==t?void 0:t.isStale)&&await p.onRequestError(e,n,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,I.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:C})},!1,G),n}},l=await p.handleResponse({req:e,nextConfig:A,cacheKey:y,routeKind:t.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:L,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:R,responseGenerator:a,waitUntil:i.waitUntil,isMinimalMode:r});if(!w)return null;if((null==l||null==(s=l.value)?void 0:s.kind)!==d.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(E=l.value)?void 0:E.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});r||n.setHeader("x-nextjs-cache",C?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),H&&n.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,T.fromNodeOutgoingHttpHeaders)(l.value.headers);return r&&w||h.delete(c.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||n.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,S.getCacheControlHeader)(l.cacheControl)),await (0,N.sendResponse)(K,j,new Response(l.value.body,{headers:h,status:l.value.status||200})),null};b?await E(b):await x.withPropagatedContext(e.headers,()=>x.trace(l.BaseServerSpan.handleRequest,{spanName:`${M} ${O}`,kind:s.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},E))}catch(n){if(n instanceof h.NoFallbackError||await p.onRequestError(e,n,{routerKind:"App Router",routePath:F,routeType:"route",revalidateReason:(0,I.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:C})},!1,G),w)throw n;return await (0,N.sendResponse)(K,j,new Response(null,{status:500})),null}}e.s(["handler",()=>C,"patchFetch",()=>G,"routeModule",()=>p,"serverHooks",()=>L,"workAsyncStorage",()=>m,"workUnitAsyncStorage",()=>H],901411)}];
|
|
1
|
+
module.exports=[901411,e=>{"use strict";var n=e.i(747909),t=e.i(174017),i=e.i(996250),o=e.i(759756),s=e.i(561916),_=e.i(174677),r=e.i(869741),E=e.i(316795),a=e.i(487718),l=e.i(995169),I=e.i(47587),N=e.i(666012),T=e.i(570101),S=e.i(626937),c=e.i(10372),h=e.i(193695);e.i(52474);var d=e.i(600220),O=e.i(89171);function u(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\$/g,"\\$").replace(/`/g,"\\`")}function $(e){return e.replace(/`/g,"``").replace(/"/g,'`"').replace(/\$/g,"`$")}async function g(e){let n,t,i=e.headers.get("x-forwarded-host")||e.headers.get("host")||"127.0.0.1:3000",o=e.headers.get("x-forwarded-proto")||"https",s=new URL(e.url),_=process.env.NEXT_PUBLIC_URL_PREFIX||"",r=`${o}://${i}${_}`,E=s.searchParams.get("key")||s.searchParams.get("apiKey")||"",a=s.searchParams.get("yes")??s.searchParams.get("y")??s.searchParams.get("noninteractive"),l=null!==a&&!["0","false","no"].includes(a.trim().toLowerCase()),I=(s.searchParams.get("frameworks")||s.searchParams.get("framework")||"opencode").trim()||"opencode",N=s.searchParams.get("nokey")??s.searchParams.get("no-key"),T=null!==N&&!["0","false","no"].includes(N.trim().toLowerCase());if("windows"==(n=e.headers.get("user-agent")||"",(t=e.headers.get("x-platform")||"")?"windows"===t.toLowerCase()?"windows":"unix":n.toLowerCase().includes("windows")?"windows":"unix")){let e=function(e,n,t,i=!1,o="opencode",s=!1){return["# =============================================================================\n# Agent-insight One-Click Setup (PowerShell)\n# =============================================================================\n",'$AGENT_INSIGHT_HOST = "'+$(e)+'"','$AGENT_INSIGHT_BASE_URL = "'+$(n)+'"','$AGENT_INSIGHT_SETUP_API_KEY = "'+$(t)+'"','\n# ── 非交互模式(?yes=1 / ?nokey=1,或 env):全程无提示,默认只装 opencode ──────\n# iex (irm "<host>/api/ingest/setup?yes=1&nokey=1")\n# 或 env: $env:AGENT_INSIGHT_NONINTERACTIVE=1; $env:AGENT_INSIGHT_NO_KEY=1',"$NONINTERACTIVE = $"+(i?"true":"false"),'$NONINTERACTIVE_FRAMEWORKS = "'+$(o||"opencode")+'"',"$FORCE_NO_KEY = $"+(s?"true":"false"),'if ($env:AGENT_INSIGHT_NONINTERACTIVE -eq "1" -or $env:AGENT_INSIGHT_NONINTERACTIVE -eq "true") { $NONINTERACTIVE = $true }\nif ($env:AGENT_INSIGHT_NO_KEY -eq "1" -or $env:AGENT_INSIGHT_NO_KEY -eq "true") { $FORCE_NO_KEY = $true }\nif ($NONINTERACTIVE) { Write-Host "🤖 非交互模式:跳过所有提示,安装框架 = $NONINTERACTIVE_FRAMEWORKS" }\n\nWrite-Host "🚀 Fetching Agent-insight telemetry components from $AGENT_INSIGHT_BASE_URL..."\n\n# 0. Check Node.js version\n$nodeCmd = Get-Command node -ErrorAction SilentlyContinue\nif (-not $nodeCmd) {\n Write-Host "❌ Error: Node.js is not installed." -ForegroundColor Red\n Write-Host " Agent-insight requires Node.js 20 or higher."\n Write-Host " Please install Node.js: https://nodejs.org/"\n exit 1\n}\n\n$nodeVersion = (node -v 2>$null) -replace "^v", ""\n$nodeMajor = $nodeVersion.Split(".")[0]\nif ([int]$nodeMajor -lt 20) {\n Write-Host "❌ Error: Node.js version $nodeVersion is not supported." -ForegroundColor Red\n Write-Host " Agent-insight requires Node.js 20 or higher."\n Write-Host " Please upgrade your Node.js version: https://nodejs.org/"\n exit 1\n}\nWrite-Host "✅ Node.js version: $nodeVersion"\n\n# 1. Setup Directories\n$homeDir = $env:USERPROFILE\nNew-Item -ItemType Directory -Force -Path "$homeDir\\.agent-insight" | Out-Null\nNew-Item -ItemType Directory -Force -Path "$homeDir\\.agent-insight\\logs" | Out-Null\nNew-Item -ItemType Directory -Force -Path "$homeDir\\.opencode\\skills" | Out-Null\nNew-Item -ItemType Directory -Force -Path "$homeDir\\.claude\\projects" | Out-Null\nNew-Item -ItemType Directory -Force -Path ".opencode\\skills" | Out-Null\nWrite-Host "📂 Created necessary directories"\n\n# 2. Framework Selection(非交互模式跳过 inquirer,用默认 $NONINTERACTIVE_FRAMEWORKS)\nWrite-Host ""\n\nif ($NONINTERACTIVE) {\n $SELECTED_FRAMEWORKS = $NONINTERACTIVE_FRAMEWORKS\n} else {\n\n$SELECTOR_SCRIPT = "$homeDir\\.agent-insight\\framework_selector.mjs"\n$SELECTOR_RESULT = "$homeDir\\.agent-insight\\.selector_result"\n\n# Install inquirer and tsx if not already installed\nSet-Location "$homeDir\\.agent-insight"\nif (-not (Test-Path "package.json")) {\n \'{"name": "agent-insight-setup", "version": "1.0.0", "type": "module", "dependencies": {}}\' | Out-File -FilePath "package.json" -Encoding utf8\n}\nif (-not (Test-Path "node_modules\\inquirer") -or -not (Test-Path "node_modules\\tsx")) {\n Write-Host "📦 Installing dependencies for interactive selection..."\n npm install inquirer tsx --save 2>$null\n}\n\n$selectorContent = @\'\nimport inquirer from \'inquirer\';\nimport fs from \'fs\';\n\nconst frameworks = [\n { name: \'OpenCode\', value: \'opencode\' },\n { name: \'Claude Code\', value: \'claude\' },\n { name: \'Hermes\', value: \'hermes\' },\n { name: \'JiuwenSwarm\', value: \'jiuwen\' }\n];\n\nasync function select() {\n console.log(\'\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'╔══════════════════════════════════════════════════════════╗\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'║ ║\');\n console.log(\'\\x1b[1m\\x1b[36m%s\\x1b[0m\', \'║ ✨ Agent-insight ✨ ║\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'║ ║\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'╚══════════════════════════════════════════════════════════╝\');\n console.log(\'\');\n console.log(\'\\x1b[90m%s\\x1b[0m\', \' 提示: ↑↓ 移动 | 空格 选择 | a 全选 | i 反选 | Enter 确认\');\n console.log(\'\');\n\n const answers = await inquirer.prompt([\n {\n type: \'checkbox\',\n name: \'frameworks\',\n message: \'集成到:\',\n choices: frameworks,\n default: [\'opencode\'],\n pageSize: 10,\n loop: false\n }\n ]);\n\n const selected = answers.frameworks;\n \n if (selected.length > 0) {\n console.log(\'\');\n console.log(\'\\x1b[32m%s\\x1b[0m\', \'✅ 将安装以下组件:\');\n selected.forEach(fw => {\n const name = frameworks.find(f => f.value === fw)?.name || fw;\n console.log(\'\\x1b[32m%s\\x1b[0m\', \' • \' + name);\n });\n console.log(\'\');\n } else {\n console.log(\'\');\n console.log(\'\\x1b[33m%s\\x1b[0m\', \'⚠️ 未选择任何组件,将不进行安装。\');\n console.log(\'\');\n }\n\n const resultFile = process.env.SELECTOR_RESULT_FILE || process.env.USERPROFILE + \'\\\\.agent-insight\\\\.selector_result\';\n fs.writeFileSync(resultFile, selected.join(\',\'));\n}\n\nselect().catch(err => {\n console.error(\'Error:\', err);\n process.exit(1);\n});\n\'@\n\nSet-Content -Path $SELECTOR_SCRIPT -Value $selectorContent -Encoding UTF8\n\n# Run the selector interactively\n$env:SELECTOR_RESULT_FILE = $SELECTOR_RESULT\nSet-Location "$homeDir\\.agent-insight"\nnpx -y tsx $SELECTOR_SCRIPT\n\n# Read the selection result from file\nif (Test-Path $SELECTOR_RESULT) {\n $SELECTED_FRAMEWORKS = Get-Content $SELECTOR_RESULT\n Remove-Item $SELECTOR_RESULT -Force\n} else {\n $SELECTED_FRAMEWORKS = ""\n}\n} # end: 交互 vs 非交互 框架选择\n\n# Set installation flags based on selection\n$INSTALL_OPENCODE = $false\n$INSTALL_CLAUDE = $false\n$INSTALL_HERMES = $false\n$INSTALL_JIUWEN = $false\n\nif ($SELECTED_FRAMEWORKS -match "opencode") {\n $INSTALL_OPENCODE = $true\n}\nif ($SELECTED_FRAMEWORKS -match "claude") {\n $INSTALL_CLAUDE = $true\n}\nif ($SELECTED_FRAMEWORKS -match "hermes") {\n $INSTALL_HERMES = $true\n}\nif ($SELECTED_FRAMEWORKS -match "jiuwen") {\n $INSTALL_JIUWEN = $true\n}\n\n# Exit if nothing selected\nif (-not $INSTALL_OPENCODE -and -not $INSTALL_CLAUDE -and -not $INSTALL_HERMES -and -not $INSTALL_JIUWEN) {\n Write-Host "⚠️ 未选择任何框架组件,将跳过插件安装。"\n Write-Host " 继续执行配置步骤..."\n Write-Host ""\n}\n\n# 3. Download Components\nif ($INSTALL_OPENCODE) {\n Write-Host "⏬ Downloading OpenCode Plugin..."\n $opencodeConfigDir = Join-Path $homeDir ".config\\opencode"\n New-Item -ItemType Directory -Path (Join-Path $opencodeConfigDir "plugins") -Force | Out-Null\n Remove-Item -Path (Join-Path $opencodeConfigDir "plugins\\Skill-Insight.ts") -Force -ErrorAction SilentlyContinue\n Remove-Item -Path (Join-Path $opencodeConfigDir "plugins\\Witty-Skill-Insight.ts") -Force -ErrorAction SilentlyContinue\n Remove-Item -Path (Join-Path $homeDir ".opencode\\plugins\\Skill-Insight.ts") -Force -ErrorAction SilentlyContinue\n Remove-Item -Path (Join-Path $homeDir ".opencode\\plugins\\Witty-Skill-Insight.ts") -Force -ErrorAction SilentlyContinue\n Remove-Item -Path (Join-Path $opencodeConfigDir "plugins\\Witty-Skill-Insight.tui.tsx") -Force -ErrorAction SilentlyContinue\n Remove-Item -Path (Join-Path $homeDir ".opencode\\plugins\\Witty-Skill-Insight.tui.tsx") -Force -ErrorAction SilentlyContinue\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/opencode" -OutFile (Join-Path $opencodeConfigDir "plugins\\Witty-Skill-Insight.ts")\n Write-Host "⏬ Downloading OpenCode Uploader..."\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/opencode-uploader" -OutFile (Join-Path $homeDir ".agent-insight\\opencode_uploader_client.js")\n # TUI 插件是终端(TUI)专用统计页脚,依赖 solid-js/@opentui/solid;\n # 非交互(desktop/headless/共享账户)用不到,历史上会因缺依赖拖垮 opencode 启动 → 跳过\n if ($NONINTERACTIVE) {\n Write-Host "⏭️ 非交互模式:跳过 TUI 统计插件(仅终端 TUI 需要)。"\n } else {\n Write-Host "⏬ Downloading OpenCode TUI Plugin..."\n $tuiPluginPath = (Join-Path $opencodeConfigDir "plugins\\Witty-Skill-Insight.tui.tsx")\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/opencode-tui" -OutFile $tuiPluginPath\n $tuiConfigFile = (Join-Path $opencodeConfigDir "tui.json")\n try {\n $data = @{}\n if (Test-Path $tuiConfigFile) {\n $raw = Get-Content $tuiConfigFile -Raw\n if ($raw -and $raw.Trim()) { $data = $raw | ConvertFrom-Json }\n }\n if (-not $data.plugin) { $data | Add-Member -MemberType NoteProperty -Name plugin -Value @() -Force }\n if ($data.plugin -notcontains $tuiPluginPath) { $data.plugin += $tuiPluginPath }\n $data | ConvertTo-Json -Depth 10 | Set-Content -Path $tuiConfigFile -Encoding UTF8\n } catch {\n Write-Host "⚠️ Failed to patch tui.json for TUI plugin."\n }\n }\n}\n\nif ($INSTALL_CLAUDE) {\n Write-Host "🛰️ Claude Code will use official OpenTelemetry logs; no session-file watcher is required."\n}\n\nif ($INSTALL_HERMES) {\n Write-Host "Installing Agent Insight Hermes plugin..."\n $hermesHome = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $homeDir ".hermes" }\n $hermesPluginDir = Join-Path $hermesHome "plugins\\agent_insight_hermes"\n New-Item -ItemType Directory -Path $hermesPluginDir -Force | Out-Null\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/hermes-plugin" -OutFile (Join-Path $hermesPluginDir "__init__.py")\n @("name: agent_insight_hermes", "version: 0.2.0", "description: Agent Insight telemetry for Hermes", "provides_hooks:", " - pre_llm_call", " - post_llm_call", " - pre_api_request", " - post_api_request", " - api_request_error", " - pre_tool_call", " - post_tool_call", " - subagent_start", " - subagent_stop", " - on_session_end") | Set-Content -Path (Join-Path $hermesPluginDir "plugin.yaml") -Encoding UTF8\n $hermesCmd = Get-Command hermes -ErrorAction SilentlyContinue\n if ($hermesCmd) {\n & $hermesCmd.Source plugins enable agent_insight_hermes\n } else {\n Write-Host "Warning: hermes command not found. The plugin files were installed; enable agent_insight_hermes after installing Hermes."\n }\n}\n\nif ($INSTALL_JIUWEN) {\n Write-Host "⏬ Installing Agent-insight JiuwenSwarm extension..."\n $jwHome = if ($env:JIUWENSWARM_DATA_DIR) { $env:JIUWENSWARM_DATA_DIR } else { Join-Path $homeDir ".jiuwenswarm" }\n $jwExtDir = Join-Path $jwHome "extensions\\agent-insight-observability"\n New-Item -ItemType Directory -Path $jwExtDir -Force | Out-Null\n New-Item -ItemType Directory -Path (Join-Path $jwHome "config") -Force | Out-Null\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/jiuwen-extension" -OutFile (Join-Path $jwExtDir "extension.py")\n @(\'id: agent-insight-observability\', \'name: agent-insight-observability\', \'version: 0.1.0\', \'description: Zero-code observability onboarding for JiuwenSwarm via agent-core OTLP.\', \'author: agent-insight\', \'min_jiuwenswarm_version: "0.2.0"\', \'dependencies: {}\', \'config_schema:\', \' type: object\') | Set-Content -Path (Join-Path $jwExtDir "extension.yaml") -Encoding UTF8\n Write-Host "✅ JiuwenSwarm extension installed at $jwExtDir"\n}\n\n# 4. Configure ~/.agent-insight/.env\n$AGENT_INSIGHT_CONFIG_FILE = "$homeDir\\.agent-insight\\.env"\n$EXISTING_KEY = ""\n$EXISTING_HOST = ""\n$EXISTING_SHOW_TASK_STATS = ""\n$EXISTING_UPLOAD_SINCE_MS = ""\nif (Test-Path $AGENT_INSIGHT_CONFIG_FILE) {\n $content = Get-Content $AGENT_INSIGHT_CONFIG_FILE\n $keyLine = $content | Select-String \'^AGENT_INSIGHT_API_KEY=\' | Select-Object -First 1\n $hostLine = $content | Select-String \'^AGENT_INSIGHT_HOST=\' | Select-Object -First 1\n $showLine = $content | Select-String \'^AGENT_INSIGHT_SHOW_TASK_STATS=\' | Select-Object -First 1\n $sinceLine = $content | Select-String \'^AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=\' | Select-Object -First 1\n if ($keyLine) {\n $EXISTING_KEY = $keyLine.Line.Substring(\'AGENT_INSIGHT_API_KEY=\'.Length)\n }\n if ($hostLine) {\n $EXISTING_HOST = $hostLine.Line.Substring(\'AGENT_INSIGHT_HOST=\'.Length)\n }\n if ($showLine) {\n $EXISTING_SHOW_TASK_STATS = $showLine.Line.Substring(\'AGENT_INSIGHT_SHOW_TASK_STATS=\'.Length)\n }\n if ($sinceLine) {\n $EXISTING_UPLOAD_SINCE_MS = $sinceLine.Line.Substring(\'AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=\'.Length)\n }\n}\n\n# -- API Key Logic --\n$FINAL_KEY = if ($AGENT_INSIGHT_SETUP_API_KEY) { $AGENT_INSIGHT_SETUP_API_KEY } else { $EXISTING_KEY }\nif ($FORCE_NO_KEY) {\n $FINAL_KEY = ""\n Write-Host "🔑 --no-key:强制无 key(清空本机已有 key),数据归到服务端 AGENT_INSIGHT_DEFAULT_INGEST_USER 指定的共享账号。"\n} elseif ($NONINTERACTIVE) {\n if ($FINAL_KEY) { Write-Host "🔑 Using API Key (from setup URL / existing config)." }\n else { Write-Host "🔑 非交互模式且未提供 API Key —— 以「无 key」方式上报,数据归到服务端 AGENT_INSIGHT_DEFAULT_INGEST_USER 指定的共享账号。" }\n} elseif ($AGENT_INSIGHT_SETUP_API_KEY) {\n Write-Host "🔑 Using API Key from setup URL."\n} elseif ($EXISTING_KEY) {\n Write-Host "🔑 Found existing API Key."\n $USE_EXISTING = Read-Host "👉 Use existing key? (y/N, Default: y)"\n if ($USE_EXISTING -match \'^[Nn]$\') {\n $FINAL_KEY = Read-Host "👉 Please enter your NEW API Key"\n }\n} else {\n Write-Host "🔑 AGENT_INSIGHT_API_KEY is not set."\n $FINAL_KEY = Read-Host "👉 Please enter your API Key"\n}\n\n# -- Host Logic --\n$FINAL_HOST = $AGENT_INSIGHT_HOST\nif (-not $NONINTERACTIVE -and $EXISTING_HOST -and ($EXISTING_HOST -ne $AGENT_INSIGHT_HOST)) {\n Write-Host "🌐 Current Host in config: $EXISTING_HOST"\n Write-Host "🌐 New Host detected: $AGENT_INSIGHT_HOST"\n $CHANGE_HOST = Read-Host "👉 Change to new Host? (y/N, Default: y)"\n if ($CHANGE_HOST -match \'^[Nn]$\') {\n $FINAL_HOST = $EXISTING_HOST\n }\n} elseif (-not $EXISTING_HOST) {\n $FINAL_HOST = $AGENT_INSIGHT_HOST\n}\n\n$FINAL_SHOW_TASK_STATS = $EXISTING_SHOW_TASK_STATS\nif (-not $FINAL_SHOW_TASK_STATS) {\n $FINAL_SHOW_TASK_STATS = "true"\n}\n\nif (-not $FINAL_KEY) {\n if ($NONINTERACTIVE -or $FORCE_NO_KEY) {\n Write-Host "ℹ️ 未配置 API Key:以「无 key」方式上报,数据归到服务端默认共享账号(需服务端已配 AGENT_INSIGHT_DEFAULT_INGEST_USER)。"\n } else {\n Write-Host "⚠️ Warning: No API Key provided. Telemetry upload will fail until you set it in $AGENT_INSIGHT_CONFIG_FILE"\n }\n}\n\n# -- Per-account isolation: namespace opencode spool/checkpoint by API-key hash --\n$CLIENT_KEY_HASH = ([System.BitConverter]::ToString(([System.Security.Cryptography.SHA256]::Create()).ComputeHash([System.Text.Encoding]::UTF8.GetBytes([string]$FINAL_KEY))) -replace \'-\',\'\').ToLower().Substring(0,16)\n$NOW_MS = [string][long]([DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds())\nif ($EXISTING_UPLOAD_SINCE_MS -and ($FINAL_KEY -eq $EXISTING_KEY)) { $UPLOAD_SINCE_MS = $EXISTING_UPLOAD_SINCE_MS } else { $UPLOAD_SINCE_MS = $NOW_MS }\n\nWrite-Host "⚙️ Updating configuration..."\nNew-Item -ItemType File -Path $AGENT_INSIGHT_CONFIG_FILE -Force | Out-Null\nCopy-Item $AGENT_INSIGHT_CONFIG_FILE "$AGENT_INSIGHT_CONFIG_FILE.bak"\n$content = Get-Content "$AGENT_INSIGHT_CONFIG_FILE.bak"\n$content | Where-Object { $_ -notmatch \'^AGENT_INSIGHT_HOST=\' -and $_ -notmatch \'^AGENT_INSIGHT_API_KEY=\' -and $_ -notmatch \'^AGENT_INSIGHT_SHOW_TASK_STATS=\' -and $_ -notmatch \'^AGENT_INSIGHT_RETENTION_DAYS=\' -and $_ -notmatch \'^AGENT_INSIGHT_OPENCODE_OTEL_ENABLE=\' -and $_ -notmatch \'^AGENT_INSIGHT_OPENCODE_SPOOL_DIR=\' -and $_ -notmatch \'^AGENT_INSIGHT_OPENCODE_UPLOADER=\' -and $_ -notmatch \'^AGENT_INSIGHT_CLAUDE_OTEL_SPOOL_DIR=\' -and $_ -notmatch \'^AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES=\' -and $_ -notmatch \'^AGENT_INSIGHT_MAX_TOOL_IO=\' -and $_ -notmatch \'^AGENT_INSIGHT_MAX_EVENT_STRING=\' -and $_ -notmatch \'^AGENT_INSIGHT_OPENCODE_UPLOAD_COOLDOWN_MS=\' -and $_ -notmatch \'^AGENT_INSIGHT_CLIENT_KEY_HASH=\' -and $_ -notmatch \'^AGENT_INSIGHT_OPENCODE_CHECKPOINT=\' -and $_ -notmatch \'^AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=\' } | Set-Content $AGENT_INSIGHT_CONFIG_FILE\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_HOST=$FINAL_HOST"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_API_KEY=$FINAL_KEY"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_SHOW_TASK_STATS=$FINAL_SHOW_TASK_STATS"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_RETENTION_DAYS=10"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_OPENCODE_OTEL_ENABLE=true"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_CLIENT_KEY_HASH=$CLIENT_KEY_HASH"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_OPENCODE_SPOOL_DIR=$homeDir\\.agent-insight\\otel_data\\opencode\\$CLIENT_KEY_HASH"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_OPENCODE_CHECKPOINT=$homeDir\\.agent-insight\\opencode_uploader_checkpoint_$CLIENT_KEY_HASH.json"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=$UPLOAD_SINCE_MS"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_OPENCODE_UPLOADER=$homeDir\\.agent-insight\\opencode_uploader_client.js"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_CLAUDE_OTEL_SPOOL_DIR=$homeDir\\.agent-insight\\otel_data\\claude"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES=file:$homeDir\\.agent-insight\\claude_raw_bodies"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_MAX_TOOL_IO=4000"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_MAX_EVENT_STRING=20000"\nAdd-Content $AGENT_INSIGHT_CONFIG_FILE "AGENT_INSIGHT_OPENCODE_UPLOAD_COOLDOWN_MS=15000"\nRemove-Item "$AGENT_INSIGHT_CONFIG_FILE.bak" -Force\n\n# 6.4 Configure Agent Insight Hermes plugin\nif ($INSTALL_HERMES) {\n $hermesHome = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $homeDir ".hermes" }\n $hermesPluginDir = Join-Path $hermesHome "plugins\\agent_insight_hermes"\n New-Item -ItemType Directory -Path $hermesPluginDir -Force | Out-Null\n $hermesConfig = @{ host = $FINAL_HOST.TrimEnd("/"); api_key = $FINAL_KEY; service_name = "hermes"; max_content_chars = 200000; spool_dir = (Join-Path $skillInsightDir "data\\hermes-otel-spool"); log_file = (Join-Path $skillInsightDir "logs\\hermes-plugin.log") } | ConvertTo-Json\n Set-Content -Path (Join-Path $hermesPluginDir "config.json") -Value $hermesConfig -Encoding UTF8\n Write-Host "Agent Insight Hermes config written to $hermesPluginDir\\config.json"\n}\n\n# 6.45 Configure JiuwenSwarm telemetry (workspace config\\.env, read by the extension)\nif ($INSTALL_JIUWEN) {\n $jwHome = if ($env:JIUWENSWARM_DATA_DIR) { $env:JIUWENSWARM_DATA_DIR } else { Join-Path $homeDir ".jiuwenswarm" }\n $jwEnv = Join-Path $jwHome "config\\.env"\n $jwExtParent = Join-Path $jwHome "extensions"\n $jwOtlpEndpoint = $FINAL_HOST.TrimEnd("/") + "/api/ingest/otel/v1/traces"\n New-Item -ItemType Directory -Path (Join-Path $jwHome "config") -Force | Out-Null\n New-Item -ItemType File -Path $jwEnv -Force | Out-Null\n $jwPrev = Get-Content $jwEnv\n $prevExtLine = $jwPrev | Select-String \'^EXTENSION_DIRS=\' | Select-Object -First 1\n # 去掉历史值可能带的成对引号(模板默认 EXTENSION_DIRS=""),否则拼出 "";<dir> 会破坏 dotenv 解析\n $prevExtDirs = if ($prevExtLine) { $prevExtLine.Line.Substring(\'EXTENSION_DIRS=\'.Length).Trim(\'"\').Trim("\'") } else { "jiuwenswarm/extensions" }\n if (-not $prevExtDirs) { $prevExtDirs = "jiuwenswarm/extensions" }\n if ($prevExtDirs.Split(";") -notcontains $jwExtParent) { $newExtDirs = "$prevExtDirs;$jwExtParent" } else { $newExtDirs = $prevExtDirs }\n $jwPrev | Where-Object { $_ -notmatch \'^OTEL_ENABLED=\' -and $_ -notmatch \'^AGENT_INSIGHT_OTLP_ENDPOINT=\' -and $_ -notmatch \'^AGENT_INSIGHT_API_KEY=\' -and $_ -notmatch \'^EXTENSION_DIRS=\' } | Set-Content $jwEnv\n Add-Content $jwEnv "OTEL_ENABLED=true"\n Add-Content $jwEnv "AGENT_INSIGHT_OTLP_ENDPOINT=$jwOtlpEndpoint"\n Add-Content $jwEnv "AGENT_INSIGHT_API_KEY=$FINAL_KEY"\n Add-Content $jwEnv "EXTENSION_DIRS=$newExtDirs"\n Write-Host "✅ JiuwenSwarm telemetry configured -> $jwOtlpEndpoint (service=jiuwenswarm)"\n}\nWrite-Host "✅ Configuration updated at $AGENT_INSIGHT_CONFIG_FILE"\n\n# 6.5 Configure Claude Code official OTel logs\nif ($INSTALL_CLAUDE) {\n $claudeOtelScript = @\'\nfunction Invoke-SkillInsightClaude {\n $envFile = Join-Path $env:USERPROFILE ".agent-insight\\.env"\n if (Test-Path $envFile) {\n Get-Content $envFile | ForEach-Object {\n if ($_ -match "^([^#=]+)=(.*)$") { [Environment]::SetEnvironmentVariable($matches[1], $matches[2], "Process") }\n }\n }\n $siHost = if ($env:AGENT_INSIGHT_HOST) { $env:AGENT_INSIGHT_HOST } else { "127.0.0.1:3000" }\n if ($siHost -notmatch "^https?://") { $siHost = "http://$siHost" }\n $siHost = $siHost.TrimEnd("/")\n $env:CLAUDE_CODE_ENABLE_TELEMETRY = "1"\n $env:OTEL_LOGS_EXPORTER = "otlp"\n if (-not $env:OTEL_METRICS_EXPORTER) { $env:OTEL_METRICS_EXPORTER = "none" }\n $env:OTEL_EXPORTER_OTLP_LOGS_PROTOCOL = "http/json"\n $env:OTEL_EXPORTER_OTLP_LOGS_ENDPOINT = "$siHost/api/ingest/otel/v1/logs"\n $env:OTEL_EXPORTER_OTLP_HEADERS = "x-witty-api-key=$($env:AGENT_INSIGHT_API_KEY)"\n $env:OTEL_LOG_USER_PROMPTS = "1"\n $env:OTEL_LOG_TOOL_DETAILS = "1"\n $env:OTEL_LOG_TOOL_CONTENT = "1"\n $rawBodyDir = Join-Path $env:USERPROFILE ".agent-insight\\claude_raw_bodies"\n New-Item -ItemType Directory -Path $rawBodyDir -Force | Out-Null\n if (-not $env:AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES) { $env:AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES = "file:$rawBodyDir" }\n $env:OTEL_LOG_RAW_API_BODIES = $env:AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES\n $cmd = Get-Command claude -CommandType Application -ErrorAction SilentlyContinue\n if (-not $cmd) { throw "claude executable not found in PATH" }\n & $cmd.Source @args\n}\nSet-Alias claude Invoke-SkillInsightClaude\n\'@\n $claudeOtelPath = "$homeDir\\.agent-insight\\claude_otel_env.ps1"\n Set-Content -Path $claudeOtelPath -Value $claudeOtelScript -Encoding UTF8\n $profileDir = Split-Path $PROFILE -Parent\n if ($profileDir) { New-Item -ItemType Directory -Path $profileDir -Force | Out-Null }\n $profileText = if (Test-Path $PROFILE) { Get-Content $PROFILE -Raw } else { "" }\n if (-not ($profileText.Contains(".agent-insight\\claude_otel_env.ps1") -or $profileText.Contains(".agent-insight/claude_otel_env.ps1"))) {\n Add-Content -Path $PROFILE -Value ""\n Add-Content -Path $PROFILE -Value "# Skill-Insight Claude Code OTel"\n Add-Content -Path $PROFILE -Value ". `"$claudeOtelPath`""\n }\n Write-Host "✅ Claude Code OTel env installed at $claudeOtelPath"\n Write-Host " Restart PowerShell or run: . `"$claudeOtelPath`""\n Get-Process | Where-Object { $_.CommandLine -like "*claude_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\n Remove-Item "$homeDir\\.agent-insight\\claude_watcher_client.ts", "$homeDir\\.agent-insight\\start_claude_watcher.ps1", "$homeDir\\.agent-insight\\stop_claude_watcher.ps1", "$homeDir\\.agent-insight\\claude_watcher.pid" -Force -ErrorAction SilentlyContinue\n Write-Host "🧹 Removed legacy Claude session-file watcher if it was installed."\n}\n\n# 7. Create Watcher Startup/Stop Scripts\n$NEEDS_WATCHER_SCRIPTS = $false\nif ($INSTALL_OPENCODE) {\n $NEEDS_WATCHER_SCRIPTS = $true\n}\n\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "📝 Creating watcher management scripts..."\n\n if ($INSTALL_OPENCODE) {\n $startScript = @\'\nGet-Process | Where-Object { $_.CommandLine -like "*opencode_uploader_client.js*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nGet-Process | Where-Object { $_.CommandLine -like "*skill-insight-opencode-uploader-loop*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nNew-Item -ItemType Directory -Path "$env:USERPROFILE\\.agent-insight\\logs" -Force | Out-Null\n$intervalSec = if ($env:AGENT_INSIGHT_OPENCODE_UPLOADER_INTERVAL_SEC) { $env:AGENT_INSIGHT_OPENCODE_UPLOADER_INTERVAL_SEC } else { "300" }\n$logFile = "$env:USERPROFILE\\.agent-insight\\logs\\opencode_uploader.log"\n$uploaderPath = "$env:USERPROFILE\\.agent-insight\\opencode_uploader_client.js"\n$runtime = if (Get-Command node -ErrorAction SilentlyContinue) { "node" } elseif (Get-Command bun -ErrorAction SilentlyContinue) { "bun" } else { $null }\nif (-not $runtime) {\n Add-Content $logFile "[$(Get-Date)] Skipped: node/bun not installed"\n return\n}\n# Sentinel marker in script body so it can be matched by CommandLine search.\n$loopBody = @"\n# skill-insight-opencode-uploader-loop\nwhile (`$true) {\n & `"$runtime`" `"$uploaderPath`" *>> `"$logFile`"\n Start-Sleep -Seconds $intervalSec\n}\n"@\n$proc = Start-Process -FilePath "powershell" -ArgumentList "-NoProfile", "-Command", $loopBody -PassThru -WindowStyle Hidden\nSet-Content "$env:USERPROFILE\\.agent-insight\\opencode_uploader.pid" $proc.Id\nWrite-Host "OpenCode uploader daemon started with PID $($proc.Id) (interval=${intervalSec}s)"\n\'@\n Set-Content -Path "$homeDir\\.agent-insight\\start_opencode_uploader.ps1" -Value $startScript -Encoding UTF8\n\n $stopScript = @\'\nGet-Process | Where-Object { $_.CommandLine -like "*skill-insight-opencode-uploader-loop*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nGet-Process | Where-Object { $_.CommandLine -like "*opencode_uploader_client.js*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nRemove-Item "$env:USERPROFILE\\.agent-insight\\opencode_uploader.pid" -Force -ErrorAction SilentlyContinue\nWrite-Host "OpenCode uploader daemon stopped"\n\'@\n Set-Content -Path "$homeDir\\.agent-insight\\stop_opencode_uploader.ps1" -Value $stopScript -Encoding UTF8\n }\n\n $combinedStart = \'Write-Host "Starting Agent-Insight watchers..."\'\n if ($INSTALL_OPENCODE) { $combinedStart += [char]10 + "& `"$homeDir\\.agent-insight\\start_opencode_uploader.ps1`"" }\n $combinedStart += [char]10 + \'Write-Host "All watchers started!"\'\n Set-Content -Path "$homeDir\\.agent-insight\\start_watchers.ps1" -Value $combinedStart -Encoding UTF8\n\n $combinedStop = \'Write-Host "Stopping Agent-Insight watchers..."\'\n if ($INSTALL_OPENCODE) { $combinedStop += [char]10 + "& `"$homeDir\\.agent-insight\\stop_opencode_uploader.ps1`"" }\n $combinedStop += [char]10 + \'Write-Host "All watchers stopped!"\'\n Set-Content -Path "$homeDir\\.agent-insight\\stop_watchers.ps1" -Value $combinedStop -Encoding UTF8\n}\n\n# 8. Start Watchers Now\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "🚀 Starting telemetry watchers..."\n if (Get-Command npx -ErrorAction SilentlyContinue) {\n & "$homeDir\\.agent-insight\\start_watchers.ps1"\n } else {\n Write-Host "⚠️ Node.js (npx) not found. Skipping watcher startup."\n }\n}\n\n# 10. Final Summary\nWrite-Host ""\nWrite-Host "🌟 Agent-Insight Telemetry: READY"\nWrite-Host "------------------------------------------------"\nWrite-Host "Installed Components:"\nif ($INSTALL_OPENCODE) { Write-Host " ✅ OpenCode Plugin: $opencodeConfigDir\\plugins\\Witty-Skill-Insight.ts" }\nif ($INSTALL_OPENCODE) { Write-Host " ✅ OpenCode Uploader Daemon: ~/.agent-insight/opencode_uploader_client.js (5-min poll)" }\nif ($INSTALL_CLAUDE) { Write-Host " ✅ Claude Code OTel: ~/.agent-insight/claude_otel_env.ps1" }\nif ($INSTALL_HERMES) { $summaryHermesHome = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $homeDir ".hermes" }; Write-Host " ✅ Agent Insight Hermes Plugin: $summaryHermesHome\\plugins\\agent_insight_hermes\\config.json" }\nif ($INSTALL_JIUWEN) { $summaryJwHome = if ($env:JIUWENSWARM_DATA_DIR) { $env:JIUWENSWARM_DATA_DIR } else { Join-Path $homeDir ".jiuwenswarm" }; Write-Host " ✅ JiuwenSwarm Extension: $summaryJwHome\\extensions\\agent-insight-observability (telemetry in config\\.env)" }\n\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "Watcher Management:"\n Write-Host " Start all: ~/.agent-insight/start_watchers.ps1"\n Write-Host " Stop all: ~/.agent-insight/stop_watchers.ps1"\n Write-Host " Logs: ~/.agent-insight/logs/"\n}\n\nWrite-Host ""\nWrite-Host "Usage:"\nif ($INSTALL_OPENCODE) { Write-Host " 1. Run: opencode run \'hello\'" }\nif ($INSTALL_CLAUDE) { Write-Host " 2. Restart PowerShell, then run: claude" }\nif ($INSTALL_HERMES) { Write-Host " 3. Restart Hermes or start a new Hermes conversation" }\nWrite-Host "------------------------------------------------"'].join("\n")}(r,r,E,l,I,T);return new O.NextResponse(e,{headers:{"Content-Type":"text/plain; charset=utf-8"}})}{let e=function(e,n,t,i=!1,o="opencode",s=!1){return["#!/bin/bash\n# =============================================================================\n# Agent-insight One-Click Setup\n# =============================================================================\n",'AGENT_INSIGHT_HOST="'+u(e)+'"','AGENT_INSIGHT_BASE_URL="'+u(n)+'"','AGENT_INSIGHT_SETUP_API_KEY="'+u(t)+'"','OPENCODE_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/opencode"\n\n# ── 非交互模式(-y / --yes):全程无提示,默认只装 opencode ─────────────────────\n# curl -sSf "<host>/api/ingest/setup" | bash -s -- -y\n# URL 直接带: curl -sSf "<host>/api/ingest/setup?yes=1" | bash\n# env: curl -sSf "<host>/api/ingest/setup" | AGENT_INSIGHT_NONINTERACTIVE=1 bash\n# 指定框架: ... | bash -s -- -y --frameworks=opencode,claude\n# 强制无 key: ... ?yes=1&nokey=1 或 bash -s -- -y --no-key(清空本机已有 key,切共享账号)',"NONINTERACTIVE="+(i?"true":"false"),'NONINTERACTIVE_FRAMEWORKS="'+u(o||"opencode")+'"',"FORCE_NO_KEY="+(s?"true":"false"),'for arg in "$@"; do\n case "$arg" in\n -y|--yes|--non-interactive|--noninteractive) NONINTERACTIVE=true ;;\n --no-key|--nokey) FORCE_NO_KEY=true ;;\n --frameworks=*) NONINTERACTIVE=true; NONINTERACTIVE_FRAMEWORKS="${arg#*=}" ;;\n esac\ndone\nif [ "${AGENT_INSIGHT_NONINTERACTIVE:-}" = "1" ] || [ "${AGENT_INSIGHT_NONINTERACTIVE:-}" = "true" ]; then NONINTERACTIVE=true; fi\nif [ "$NONINTERACTIVE" = "true" ]; then echo "🤖 非交互模式:跳过所有提示,安装框架 = $NONINTERACTIVE_FRAMEWORKS"; fi\n\necho "🚀 Fetching Agent-insight telemetry components from $AGENT_INSIGHT_BASE_URL..."\n\n# 0. Check Node.js version\nif ! command -v node &> /dev/null; then\n echo "❌ Error: Node.js is not installed."\n echo " Agent-insight requires Node.js 20 or higher."\n echo " Please install Node.js: https://nodejs.org/"\n exit 1\nfi\n\nNODE_VERSION=$(node -v 2>/dev/null | sed "s/v//")\nNODE_MAJOR=$(echo "$NODE_VERSION" | cut -d. -f1)\nif [ "$NODE_MAJOR" -lt 20 ]; then\n echo "❌ Error: Node.js version $NODE_VERSION is not supported."\n echo " Agent-insight requires Node.js 20 or higher."\n echo " Please upgrade your Node.js version: https://nodejs.org/"\n exit 1\nfi\necho "✅ Node.js version: $NODE_VERSION"\n\n# 1. Setup Directories\nmkdir -p "$HOME/.agent-insight"\nmkdir -p "$HOME/.agent-insight/logs"\nmkdir -p "$OPENCODE_CONFIG_DIR/plugins"\nmkdir -p "$HOME/.opencode/skills"\nmkdir -p "$HOME/.claude/projects"\nmkdir -p ".opencode/skills"\nmkdir -p "$HOME/.agent-insight/example"\necho "📂 Created necessary directories"\n\n# 1b. Download built-in example messages log (for the bundled "messages 日志分析" dataset / demo traces)\nif curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/example-messages" -o "$HOME/.agent-insight/example/messages"; then\n echo "📄 Example log ready at $HOME/.agent-insight/example/messages"\nelse\n echo "⚠️ Skipped example messages log download (non-fatal)"\nfi\n\n# 2. Framework Selection(非交互模式跳过 inquirer,直接用 $NONINTERACTIVE_FRAMEWORKS)\necho ""\n\nif [ "$NONINTERACTIVE" = "true" ]; then\n SELECTED_FRAMEWORKS="$NONINTERACTIVE_FRAMEWORKS"\nelse\n\nSELECTOR_SCRIPT="$HOME/.agent-insight/framework_selector.mjs"\nSELECTOR_RESULT="$HOME/.agent-insight/.selector_result"\n\n# Install inquirer and tsx if not already installed\ncd "$HOME/.agent-insight"\nif [ ! -f "package.json" ]; then\n echo \'{"name": "agent-insight-setup", "version": "1.0.0", "type": "module", "dependencies": {}}\' > package.json\nfi\nif [ ! -d "node_modules/inquirer" ] || [ ! -d "node_modules/tsx" ]; then\n echo "📦 Installing dependencies for interactive selection..."\n npm install inquirer tsx --save 2>/dev/null\nfi\n\ncat > "$SELECTOR_SCRIPT" << \'SELECTOR_EOF\'\nimport inquirer from \'inquirer\';\nimport fs from \'fs\';\n\nconst frameworks = [\n { name: \'OpenCode\', value: \'opencode\' },\n { name: \'Claude Code\', value: \'claude\' },\n { name: \'Hermes\', value: \'hermes\' },\n { name: \'JiuwenSwarm\', value: \'jiuwen\' }\n];\n\nasync function select() {\n console.log(\'\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'╔══════════════════════════════════════════════════════════╗\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'║ ║\');\n console.log(\'\\x1b[1m\\x1b[36m%s\\x1b[0m\', \'║ ✨ Agent-insight ✨ ║\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'║ ║\');\n console.log(\'\\x1b[36m%s\\x1b[0m\', \'╚══════════════════════════════════════════════════════════╝\');\n console.log(\'\');\n console.log(\'\\x1b[90m%s\\x1b[0m\', \' 提示: ↑↓ 移动 | 空格 选择 | a 全选 | i 反选 | Enter 确认\');\n console.log(\'\');\n\n const answers = await inquirer.prompt([\n {\n type: \'checkbox\',\n name: \'frameworks\',\n message: \'集成到:\',\n choices: frameworks,\n default: [\'opencode\'],\n pageSize: 10,\n loop: false\n }\n ]);\n\n const selected = answers.frameworks;\n \n if (selected.length > 0) {\n console.log(\'\');\n console.log(\'\\x1b[32m%s\\x1b[0m\', \'✅ 将安装以下组件:\');\n selected.forEach(fw => {\n const name = frameworks.find(f => f.value === fw)?.name || fw;\n console.log(\'\\x1b[32m%s\\x1b[0m\', \' • \' + name);\n });\n console.log(\'\');\n } else {\n console.log(\'\');\n console.log(\'\\x1b[33m%s\\x1b[0m\', \'⚠️ 未选择任何组件,将不进行安装。\');\n console.log(\'\');\n }\n\n const resultFile = process.env.SELECTOR_RESULT_FILE || process.env.HOME + \'/.agent-insight/.selector_result\';\n fs.writeFileSync(resultFile, selected.join(\',\'));\n}\n\nselect().catch(err => {\n console.error(\'Error:\', err);\n process.exit(1);\n});\nSELECTOR_EOF\n\n# Run the selector interactively from /dev/tty\nexport SELECTOR_RESULT_FILE="$SELECTOR_RESULT"\ncd "$HOME/.agent-insight" && npx -y tsx "$SELECTOR_SCRIPT" < /dev/tty\n\n# Read the selection result from file\nif [ -f "$SELECTOR_RESULT" ]; then\n SELECTED_FRAMEWORKS=$(cat "$SELECTOR_RESULT")\n rm -f "$SELECTOR_RESULT"\nelse\n SELECTED_FRAMEWORKS=""\nfi\nfi # end: 交互 vs 非交互 框架选择\n\n# Set installation flags based on selection\nINSTALL_OPENCODE=false\nINSTALL_CLAUDE=false\nINSTALL_HERMES=false\nINSTALL_JIUWEN=false\n\nif [[ "$SELECTED_FRAMEWORKS" == *"opencode"* ]]; then\n INSTALL_OPENCODE=true\nfi\nif [[ "$SELECTED_FRAMEWORKS" == *"claude"* ]]; then\n INSTALL_CLAUDE=true\nfi\nif [[ "$SELECTED_FRAMEWORKS" == *"hermes"* ]]; then\n INSTALL_HERMES=true\nfi\nif [[ "$SELECTED_FRAMEWORKS" == *"jiuwen"* ]]; then\n INSTALL_JIUWEN=true\nfi\n\n# Exit if nothing selected\nif [ "$INSTALL_OPENCODE" = "false" ] && [ "$INSTALL_CLAUDE" = "false" ] && [ "$INSTALL_HERMES" = "false" ] && [ "$INSTALL_JIUWEN" = "false" ]; then\n echo "⚠️ 未选择任何框架组件,将跳过插件安装。"\n echo " 继续执行配置步骤..."\n echo ""\nfi\n\n# 3. Download Components\nif [ "$INSTALL_OPENCODE" = "true" ]; then\n echo "⏬ Downloading OpenCode Plugin..."\n rm -f "$OPENCODE_CONFIG_DIR/plugins/Skill-Insight.ts" "$OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.ts" "$OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.tui.tsx" 2>/dev/null || true\n rm -f "$HOME/.opencode/plugins/Skill-Insight.ts" "$HOME/.opencode/plugins/Witty-Skill-Insight.ts" "$HOME/.opencode/plugins/Witty-Skill-Insight.tui.tsx" 2>/dev/null || true\n curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/opencode" -o "$OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.ts"\n echo "⏬ Downloading OpenCode Uploader..."\n curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/opencode-uploader" -o "$HOME/.agent-insight/opencode_uploader_client.js"\n echo "⏬ Installing OpenCode commands..."\n mkdir -p "$OPENCODE_CONFIG_DIR/commands"\n curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/opencode-commands/si-optimizer" -o "$OPENCODE_CONFIG_DIR/commands/si-optimizer.md"\n # TUI 插件是终端(TUI)专用的统计页脚,依赖 solid-js/@opentui/solid;\n # 非交互(desktop/headless/共享账户)场景用不到,历史上还会因缺依赖拖垮 opencode 启动 → 跳过\n if [ "$NONINTERACTIVE" = "true" ]; then\n echo "⏭️ 非交互模式:跳过 TUI 统计插件(仅终端 TUI 需要)。"\n else\n echo "⏬ Downloading OpenCode TUI Plugin..."\n curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/opencode-tui" -o "$OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.tui.tsx"\n export TUI_PLUGIN_PATH="$OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.tui.tsx"\n export TUI_CONFIG_FILE="$OPENCODE_CONFIG_DIR/tui.json"\n if command -v node &> /dev/null; then\n node - <<\'NODE\'\nconst fs = require("fs");\nconst path = require("path");\nconst file = process.env.TUI_CONFIG_FILE;\nconst pluginPath = process.env.TUI_PLUGIN_PATH;\nlet data = {};\ntry {\n if (fs.existsSync(file)) {\n const text = fs.readFileSync(file, "utf8");\n data = text && text.trim() ? JSON.parse(text) : {};\n }\n} catch {}\nif (!data || typeof data !== "object") data = {};\nconst list = Array.isArray(data.plugin) ? data.plugin.slice() : [];\nif (pluginPath && !list.includes(pluginPath)) list.push(pluginPath);\ndata.plugin = list;\nfs.mkdirSync(path.dirname(file), { recursive: true });\nfs.writeFileSync(file, JSON.stringify(data, null, 2));\nNODE\n else\n echo "⚠️ node not found; skip TUI plugin config patch."\n fi\n fi\nfi\n\nif [ "$INSTALL_CLAUDE" = "true" ]; then\n echo "🛰️ Claude Code will use official OpenTelemetry logs; no session-file watcher is required."\nfi\n\nif [ "$INSTALL_HERMES" = "true" ]; then\n echo "Installing Agent Insight Hermes plugin..."\n HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}"\n HERMES_PLUGIN_DIR="$HERMES_HOME/plugins/agent_insight_hermes"\n mkdir -p "$HERMES_PLUGIN_DIR"\n curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/hermes-plugin" -o "$HERMES_PLUGIN_DIR/__init__.py"\n cat > "$HERMES_PLUGIN_DIR/plugin.yaml" <<\'HERMES_PLUGIN_EOF\'\nname: agent_insight_hermes\nversion: 0.2.0\ndescription: Agent Insight telemetry for Hermes\nprovides_hooks:\n - pre_llm_call\n - post_llm_call\n - pre_api_request\n - post_api_request\n - api_request_error\n - pre_tool_call\n - post_tool_call\n - subagent_start\n - subagent_stop\n - on_session_end\nHERMES_PLUGIN_EOF\n if command -v hermes >/dev/null 2>&1; then\n hermes plugins enable agent_insight_hermes || echo "Warning: enable the plugin manually with: hermes plugins enable agent_insight_hermes"\n else\n echo "Warning: hermes command not found. The plugin files were installed; enable agent_insight_hermes after installing Hermes."\n fi\nfi\n\nif [ "$INSTALL_JIUWEN" = "true" ]; then\n echo "⏬ Installing Agent-insight JiuwenSwarm extension..."\n JW_HOME="${JIUWENSWARM_DATA_DIR:-$HOME/.jiuwenswarm}"\n JW_EXT_DIR="$JW_HOME/extensions/agent-insight-observability"\n mkdir -p "$JW_EXT_DIR" "$JW_HOME/config"\n curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/jiuwen-extension" -o "$JW_EXT_DIR/extension.py"\n cat > "$JW_EXT_DIR/extension.yaml" <<\'JIUWEN_EXT_EOF\'\nid: agent-insight-observability\nname: agent-insight-observability\nversion: 0.1.0\ndescription: Zero-code observability onboarding for JiuwenSwarm via agent-core OTLP.\nauthor: agent-insight\nmin_jiuwenswarm_version: "0.2.0"\ndependencies: {}\nconfig_schema:\n type: object\nJIUWEN_EXT_EOF\n echo "✅ JiuwenSwarm extension installed at $JW_EXT_DIR"\nfi\n\n# 4. Configure ~/.agent-insight/.env\nAGENT_INSIGHT_CONFIG_FILE="$HOME/.agent-insight/.env"\nEXISTING_KEY=""\nEXISTING_HOST=""\nEXISTING_SHOW_TASK_STATS=""\nif [ -f "$AGENT_INSIGHT_CONFIG_FILE" ]; then\n EXISTING_KEY=$(grep \'^AGENT_INSIGHT_API_KEY=\' "$AGENT_INSIGHT_CONFIG_FILE" | head -n 1 | cut -d\'=\' -f2-)\n EXISTING_HOST=$(grep \'^AGENT_INSIGHT_HOST=\' "$AGENT_INSIGHT_CONFIG_FILE" | head -n 1 | cut -d\'=\' -f2-)\n EXISTING_SHOW_TASK_STATS=$(grep \'^AGENT_INSIGHT_SHOW_TASK_STATS=\' "$AGENT_INSIGHT_CONFIG_FILE" | head -n 1 | cut -d\'=\' -f2-)\n EXISTING_UPLOAD_SINCE_MS=$(grep \'^AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=\' "$AGENT_INSIGHT_CONFIG_FILE" | head -n 1 | cut -d\'=\' -f2-)\nfi\n\n# -- API Key Logic --\nFINAL_KEY="${AGENT_INSIGHT_SETUP_API_KEY:-$EXISTING_KEY}"\nif [ "$FORCE_NO_KEY" = "true" ]; then\n FINAL_KEY=""\n echo "🔑 --no-key:强制无 key(清空本机已有 key),数据归到服务端 AGENT_INSIGHT_DEFAULT_INGEST_USER 指定的共享账号。"\nelif [ "$NONINTERACTIVE" = "true" ]; then\n if [ -n "$FINAL_KEY" ]; then\n echo "🔑 Using API Key (from setup URL / existing config)."\n else\n echo "🔑 非交互模式且未提供 API Key —— 以「无 key」方式上报,数据归到服务端 AGENT_INSIGHT_DEFAULT_INGEST_USER 指定的共享账号。"\n fi\nelif [ -n "$AGENT_INSIGHT_SETUP_API_KEY" ]; then\n echo "🔑 Using API Key from setup URL."\nelif [ -n "$EXISTING_KEY" ]; then\n echo "🔑 Found existing API Key."\n read -p "👉 Use existing key? (y/N, Default: y): " USE_EXISTING < /dev/tty\n if [[ "$USE_EXISTING" =~ ^[Nn]$ ]]; then\n read -p "👉 Please enter your NEW API Key: " FINAL_KEY < /dev/tty\n fi\nelse\n echo "🔑 AGENT_INSIGHT_API_KEY is not set."\n read -p "👉 Please enter your API Key: " FINAL_KEY < /dev/tty\nfi\n\n# -- Host Logic --\nFINAL_HOST="$AGENT_INSIGHT_HOST"\nif [ "$NONINTERACTIVE" != "true" ] && [ -n "$EXISTING_HOST" ] && [ "$EXISTING_HOST" != "$AGENT_INSIGHT_HOST" ]; then\n echo "🌐 Current Host in config: $EXISTING_HOST"\n echo "🌐 New Host detected: $AGENT_INSIGHT_HOST"\n read -p "👉 Change to new Host? (y/N, Default: y): " CHANGE_HOST < /dev/tty\n if [[ "$CHANGE_HOST" =~ ^[Nn]$ ]]; then\n FINAL_HOST="$EXISTING_HOST"\n fi\nelif [ -z "$EXISTING_HOST" ]; then\n FINAL_HOST="$AGENT_INSIGHT_HOST"\nfi\n\nFINAL_SHOW_TASK_STATS="$EXISTING_SHOW_TASK_STATS"\nif [ -z "$FINAL_SHOW_TASK_STATS" ]; then\n FINAL_SHOW_TASK_STATS="true"\nfi\n\nif [ -z "$FINAL_KEY" ]; then\n if [ "$NONINTERACTIVE" = "true" ] || [ "$FORCE_NO_KEY" = "true" ]; then\n echo "ℹ️ 未配置 API Key:以「无 key」方式上报,数据归到服务端默认共享账号(需服务端已配 AGENT_INSIGHT_DEFAULT_INGEST_USER)。"\n else\n echo "⚠️ Warning: No API Key provided. Telemetry upload will fail until you set it in $AGENT_INSIGHT_CONFIG_FILE"\n fi\nfi\n\n# -- Per-account isolation: hash the API key so opencode spool/checkpoint are\n# namespaced per account. Switching accounts on the same machine no longer\n# replays another account\'s history under the current key.\nCLIENT_KEY_HASH=$(printf \'%s\' "$FINAL_KEY" | { shasum -a 256 2>/dev/null || sha256sum; } | cut -c1-16)\nNOW_MS=$(node -e \'process.stdout.write(String(Date.now()))\' 2>/dev/null || echo $(( $(date +%s) * 1000 )))\n# Keep an existing baseline when re-installing the SAME key; reset to now for a\n# new/changed key so only traces produced after THIS install are uploaded.\nif [ -n "$EXISTING_UPLOAD_SINCE_MS" ] && [ "$FINAL_KEY" = "$EXISTING_KEY" ]; then\n UPLOAD_SINCE_MS="$EXISTING_UPLOAD_SINCE_MS"\nelse\n UPLOAD_SINCE_MS="$NOW_MS"\nfi\n\necho "⚙️ Updating configuration..."\ntouch "$AGENT_INSIGHT_CONFIG_FILE"\ncp "$AGENT_INSIGHT_CONFIG_FILE" "${AGENT_INSIGHT_CONFIG_FILE}.bak"\ngrep -v "^AGENT_INSIGHT_HOST=" "${AGENT_INSIGHT_CONFIG_FILE}.bak" | grep -v "^AGENT_INSIGHT_API_KEY=" | grep -v "^AGENT_INSIGHT_SHOW_TASK_STATS=" | grep -v "^AGENT_INSIGHT_RETENTION_DAYS=" | grep -v "^AGENT_INSIGHT_OPENCODE_OTEL_ENABLE=" | grep -v "^AGENT_INSIGHT_OPENCODE_SPOOL_DIR=" | grep -v "^AGENT_INSIGHT_OPENCODE_UPLOADER=" | grep -v "^AGENT_INSIGHT_CLAUDE_OTEL_SPOOL_DIR=" | grep -v "^AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES=" | grep -v "^AGENT_INSIGHT_MAX_TOOL_IO=" | grep -v "^AGENT_INSIGHT_MAX_EVENT_STRING=" | grep -v "^AGENT_INSIGHT_OPENCODE_UPLOAD_COOLDOWN_MS=" | grep -v "^AGENT_INSIGHT_CLIENT_KEY_HASH=" | grep -v "^AGENT_INSIGHT_OPENCODE_CHECKPOINT=" | grep -v "^AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=" > "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_HOST=$FINAL_HOST" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_API_KEY=$FINAL_KEY" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_SHOW_TASK_STATS=$FINAL_SHOW_TASK_STATS" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_RETENTION_DAYS=10" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_OPENCODE_OTEL_ENABLE=true" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_CLIENT_KEY_HASH=$CLIENT_KEY_HASH" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_OPENCODE_SPOOL_DIR=$HOME/.agent-insight/otel_data/opencode/$CLIENT_KEY_HASH" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_OPENCODE_CHECKPOINT=$HOME/.agent-insight/opencode_uploader_checkpoint_$CLIENT_KEY_HASH.json" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_OPENCODE_UPLOAD_SINCE_MS=$UPLOAD_SINCE_MS" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_OPENCODE_UPLOADER=$HOME/.agent-insight/opencode_uploader_client.js" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_CLAUDE_OTEL_SPOOL_DIR=$HOME/.agent-insight/otel_data/claude" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES=file:$HOME/.agent-insight/claude_raw_bodies" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_MAX_TOOL_IO=4000" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_MAX_EVENT_STRING=20000" >> "$AGENT_INSIGHT_CONFIG_FILE"\necho "AGENT_INSIGHT_OPENCODE_UPLOAD_COOLDOWN_MS=15000" >> "$AGENT_INSIGHT_CONFIG_FILE"\nrm "${AGENT_INSIGHT_CONFIG_FILE}.bak"\necho "✅ Configuration updated at $AGENT_INSIGHT_CONFIG_FILE"\n\n# 6.4 Configure Agent Insight Hermes plugin\nif [ "$INSTALL_HERMES" = "true" ]; then\n HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}"\n HERMES_PLUGIN_DIR="$HERMES_HOME/plugins/agent_insight_hermes"\n mkdir -p "$HERMES_PLUGIN_DIR"\n cat > "$HERMES_PLUGIN_DIR/config.json" <<HERMES_CONFIG_EOF\n{\n "host": "${FINAL_HOST%/}",\n "api_key": "$FINAL_KEY",\n "service_name": "hermes",\n "max_content_chars": 200000,\n "spool_dir": "$HOME/.agent-insight/data/hermes-otel-spool",\n "log_file": "$HOME/.agent-insight/logs/hermes-plugin.log"\n}\nHERMES_CONFIG_EOF\n echo "Agent Insight Hermes config written to $HERMES_PLUGIN_DIR/config.json"\nfi\n\n# 6.45 Configure JiuwenSwarm telemetry (workspace config/.env, read by the extension)\nif [ "$INSTALL_JIUWEN" = "true" ]; then\n JW_HOME="${JIUWENSWARM_DATA_DIR:-$HOME/.jiuwenswarm}"\n JW_ENV="$JW_HOME/config/.env"\n JW_EXT_PARENT="$JW_HOME/extensions"\n JW_OTLP_ENDPOINT="${FINAL_HOST%/}/api/ingest/otel/v1/traces"\n mkdir -p "$JW_HOME/config"\n touch "$JW_ENV"\n cp "$JW_ENV" "${JW_ENV}.bak"\n # EXTENSION_DIRS: 保留既有(默认 jiuwenswarm/extensions) + 追加我们的目录(去重)\n PREV_EXT_DIRS=$(grep \'^EXTENSION_DIRS=\' "${JW_ENV}.bak" | head -n 1 | cut -d\'=\' -f2-)\n # 去掉历史值可能带的成对双引号:jiuwenswarm 模板默认 EXTENSION_DIRS="",\n # 直接拼接会写出 "";<dir>,python-dotenv 无法解析整行而丢弃 → 扩展目录失效。\n PREV_EXT_DIRS="${PREV_EXT_DIRS#\\"}"; PREV_EXT_DIRS="${PREV_EXT_DIRS%\\"}"\n if [ -z "$PREV_EXT_DIRS" ]; then PREV_EXT_DIRS="jiuwenswarm/extensions"; fi\n case ";$PREV_EXT_DIRS;" in\n *";$JW_EXT_PARENT;"*) NEW_EXT_DIRS="$PREV_EXT_DIRS" ;;\n *) NEW_EXT_DIRS="$PREV_EXT_DIRS;$JW_EXT_PARENT" ;;\n esac\n grep -v \'^OTEL_ENABLED=\' "${JW_ENV}.bak" | grep -v \'^AGENT_INSIGHT_OTLP_ENDPOINT=\' | grep -v \'^AGENT_INSIGHT_API_KEY=\' | grep -v \'^EXTENSION_DIRS=\' > "$JW_ENV"\n echo "OTEL_ENABLED=true" >> "$JW_ENV"\n echo "AGENT_INSIGHT_OTLP_ENDPOINT=$JW_OTLP_ENDPOINT" >> "$JW_ENV"\n echo "AGENT_INSIGHT_API_KEY=$FINAL_KEY" >> "$JW_ENV"\n echo "EXTENSION_DIRS=$NEW_EXT_DIRS" >> "$JW_ENV"\n rm -f "${JW_ENV}.bak"\n echo "✅ JiuwenSwarm telemetry configured -> $JW_OTLP_ENDPOINT (service=jiuwenswarm)"\n echo " 重启 JiuwenSwarm(agentserver)后,agent/LLM/tool trace 自动上报。"\nfi\n\n# 6.5 Configure Claude Code official OTel logs\nif [ "$INSTALL_CLAUDE" = "true" ]; then\n cat > "$HOME/.agent-insight/claude_otel_env.sh" << \'CLAUDE_OTEL_EOF\'\n# Agent-Insight Claude Code OpenTelemetry integration\nunalias claude 2>/dev/null || true\n\n_skill_insight_claude_load_env() {\n if [ -f "$HOME/.agent-insight/.env" ]; then\n set -a\n . "$HOME/.agent-insight/.env"\n set +a\n fi\n}\n\nclaude() {\n _skill_insight_claude_load_env\n local _si_host="${AGENT_INSIGHT_HOST:-127.0.0.1:3000}"\n case "$_si_host" in http://*|https://*) ;; *) _si_host="http://$_si_host" ;; esac\n _si_host="${_si_host%/}"\n mkdir -p "$HOME/.agent-insight/claude_raw_bodies" 2>/dev/null || true\n env \\\n CLAUDE_CODE_ENABLE_TELEMETRY=1 \\\n OTEL_LOGS_EXPORTER=otlp \\\n OTEL_METRICS_EXPORTER="${OTEL_METRICS_EXPORTER:-none}" \\\n OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/json \\\n OTEL_EXPORTER_OTLP_LOGS_ENDPOINT="$_si_host/api/ingest/otel/v1/logs" \\\n OTEL_EXPORTER_OTLP_HEADERS="x-witty-api-key=${AGENT_INSIGHT_API_KEY:-}" \\\n OTEL_LOG_USER_PROMPTS=1 \\\n OTEL_LOG_TOOL_DETAILS=1 \\\n OTEL_LOG_TOOL_CONTENT=1 \\\n OTEL_LOG_RAW_API_BODIES="${AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES:-file:$HOME/.agent-insight/claude_raw_bodies}" \\\n claude "$@"\n}\nCLAUDE_OTEL_EOF\n SHELL_RC="$HOME/.zshrc"\n [ -f "$HOME/.bashrc" ] && SHELL_RC="$HOME/.bashrc"\n if [ -f "$SHELL_RC" ] && ! grep -q "\\.agent-insight/claude_otel_env\\.sh" "$SHELL_RC"; then\n echo "" >> "$SHELL_RC"\n echo "# Agent-Insight Claude Code OTel" >> "$SHELL_RC"\n echo "source \\"$HOME/.agent-insight/claude_otel_env.sh\\"" >> "$SHELL_RC"\n fi\n echo "✅ Claude Code OTel env installed at $HOME/.agent-insight/claude_otel_env.sh"\n echo " Restart your terminal or run: source $HOME/.agent-insight/claude_otel_env.sh"\n pkill -f "claude_watcher_client.ts" 2>/dev/null || true\n rm -f "$HOME/.agent-insight/claude_watcher_client.ts" "$HOME/.agent-insight/start_claude_watcher.sh" "$HOME/.agent-insight/stop_claude_watcher.sh" "$HOME/.agent-insight/claude_watcher.pid"\n echo "🧹 Removed legacy Claude session-file watcher if it was installed."\nfi\n\n# 7. Create Watcher Startup/Stop Scripts\nNEEDS_WATCHER_SCRIPTS=false\nif [ "$INSTALL_OPENCODE" = "true" ]; then\n NEEDS_WATCHER_SCRIPTS=true\nfi\n\nif [ "$NEEDS_WATCHER_SCRIPTS" = "true" ]; then\n echo ""\n echo "📝 Creating watcher management scripts..."\n\n if [ "$INSTALL_OPENCODE" = "true" ]; then\n cat > "$HOME/.agent-insight/start_opencode_uploader.sh" << \'OPENCODE_UP_EOF\'\n#!/bin/bash\n# Kill any previous instance (the sentinel string lets pkill -f find the loop).\npkill -f "skill-insight-opencode-uploader-loop" 2>/dev/null\npkill -f "opencode_uploader_client.js" 2>/dev/null\nmkdir -p "$HOME/.agent-insight/logs"\nINTERVAL_SEC="${AGENT_INSIGHT_OPENCODE_UPLOADER_INTERVAL_SEC:-300}"\nLOG_FILE="$HOME/.agent-insight/logs/opencode_uploader.log"\nif command -v node >/dev/null 2>&1; then\n RUNTIME=node\nelif command -v bun >/dev/null 2>&1; then\n RUNTIME=bun\nelse\n echo "[$(date)] Skipped: node/bun not installed" >> "$LOG_FILE"\n exit 0\nfi\n# Loop body has a sentinel comment so `pkill -f skill-insight-opencode-uploader-loop` matches.\nnohup bash -c "\n# skill-insight-opencode-uploader-loop\nwhile true; do\n \\"$RUNTIME\\" \\"$HOME/.agent-insight/opencode_uploader_client.js\\" >> \\"$LOG_FILE\\" 2>&1\n sleep \\"$INTERVAL_SEC\\"\ndone" > /dev/null 2>&1 &\necho $! > "$HOME/.agent-insight/opencode_uploader.pid"\necho "OpenCode uploader daemon started with PID $(cat $HOME/.agent-insight/opencode_uploader.pid) (interval=${INTERVAL_SEC}s)"\nOPENCODE_UP_EOF\n chmod +x "$HOME/.agent-insight/start_opencode_uploader.sh"\n\n cat > "$HOME/.agent-insight/stop_opencode_uploader.sh" << \'STOP_OPENCODE_UP_EOF\'\n#!/bin/bash\npkill -f "skill-insight-opencode-uploader-loop" 2>/dev/null\npkill -f "opencode_uploader_client.js" 2>/dev/null\nPID_FILE="$HOME/.agent-insight/opencode_uploader.pid"\nif [ -f "$PID_FILE" ]; then kill "$(cat $PID_FILE)" 2>/dev/null; rm -f "$PID_FILE"; fi\necho "OpenCode uploader daemon stopped"\nSTOP_OPENCODE_UP_EOF\n chmod +x "$HOME/.agent-insight/stop_opencode_uploader.sh"\n fi\n\n cat > "$HOME/.agent-insight/start_watchers.sh" << \'WATCHER_HEADER\'\n#!/bin/bash\necho "Starting Agent-Insight watchers..."\nWATCHER_HEADER\n if [ "$INSTALL_OPENCODE" = "true" ]; then echo \'"$HOME/.agent-insight/start_opencode_uploader.sh"\' >> "$HOME/.agent-insight/start_watchers.sh"; fi\n echo \'echo "All watchers started!"\' >> "$HOME/.agent-insight/start_watchers.sh"\n chmod +x "$HOME/.agent-insight/start_watchers.sh"\n\n cat > "$HOME/.agent-insight/stop_watchers.sh" << \'STOP_HEADER\'\n#!/bin/bash\necho "Stopping Agent-Insight watchers..."\nSTOP_HEADER\n if [ "$INSTALL_OPENCODE" = "true" ]; then echo \'"$HOME/.agent-insight/stop_opencode_uploader.sh"\' >> "$HOME/.agent-insight/stop_watchers.sh"; fi\n echo \'echo "All watchers stopped!"\' >> "$HOME/.agent-insight/stop_watchers.sh"\n chmod +x "$HOME/.agent-insight/stop_watchers.sh"\nfi\n\n# 8. Start Watchers Now\nif [ "$NEEDS_WATCHER_SCRIPTS" = "true" ]; then\n echo ""\n echo "🚀 Starting telemetry watchers..."\n if command -v npx &> /dev/null; then\n "$HOME/.agent-insight/start_watchers.sh"\n else\n echo "⚠️ Node.js (npx) not found. Skipping watcher startup."\n fi\nfi\n\n# 10. Final Summary\necho ""\necho "🌟 Agent-Insight Telemetry: READY"\necho "------------------------------------------------"\necho "Installed Components:"\nif [ "$INSTALL_OPENCODE" = "true" ]; then echo " ✅ OpenCode Plugin: $OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.ts"; fi\nif [ "$INSTALL_OPENCODE" = "true" ]; then echo " ✅ OpenCode Command: ~/.config/opencode/commands/si-optimizer.md"; fi\nif [ "$INSTALL_OPENCODE" = "true" ]; then echo " ✅ OpenCode Uploader Daemon: ~/.agent-insight/opencode_uploader_client.js (5-min poll)"; fi\nif [ "$INSTALL_CLAUDE" = "true" ]; then echo " ✅ Claude Code OTel: ~/.agent-insight/claude_otel_env.sh"; fi\nif [ "$INSTALL_HERMES" = "true" ]; then echo " ✅ Agent Insight Hermes Plugin: ${HERMES_HOME:-$HOME/.hermes}/plugins/agent_insight_hermes/config.json"; fi\nif [ "$INSTALL_JIUWEN" = "true" ]; then echo " ✅ JiuwenSwarm Extension: ${JIUWENSWARM_DATA_DIR:-$HOME/.jiuwenswarm}/extensions/agent-insight-observability (telemetry in config/.env)"; fi\n\nif [ "$NEEDS_WATCHER_SCRIPTS" = "true" ]; then\n echo ""\n echo "Watcher Management:"\n echo " Start all: ~/.agent-insight/start_watchers.sh"\n echo " Stop all: ~/.agent-insight/stop_watchers.sh"\n echo " Logs: ~/.agent-insight/logs/"\nfi\n\necho ""\necho "Usage:"\nif [ "$INSTALL_OPENCODE" = "true" ]; then echo " 1. Run: opencode run \'hello\'"; fi\nif [ "$INSTALL_CLAUDE" = "true" ]; then echo " 2. Restart terminal, then run: claude"; fi\nif [ "$INSTALL_HERMES" = "true" ]; then echo " 3. Restart Hermes or start a new Hermes conversation"; fi\necho "------------------------------------------------"'].join("\n")}(r,r,E,l,I,T);return new O.NextResponse(e,{headers:{"Content-Type":"text/x-shellscript"}})}}e.s(["GET",()=>g],640112);var A=e.i(640112);let p=new n.AppRouteRouteModule({definition:{kind:t.RouteKind.APP_ROUTE,page:"/api/ingest/setup/route",pathname:"/api/ingest/setup",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/ingest/setup/route.ts",nextConfigOutput:"standalone",userland:A}),{workAsyncStorage:m,workUnitAsyncStorage:H,serverHooks:L}=p;function C(){return(0,i.patchFetch)({workAsyncStorage:m,workUnitAsyncStorage:H})}async function G(e,n,i){p.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let O="/api/ingest/setup/route";O=O.replace(/\/index$/,"")||"/";let u=await p.prepare(e,n,{srcPage:O,multiZoneDraftMode:!1});if(!u)return n.statusCode=400,n.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve()),null;let{buildId:$,params:g,nextConfig:A,parsedUrl:m,isDraftMode:H,prerenderManifest:L,routerServerContext:C,isOnDemandRevalidate:G,revalidateOnlyGenerated:R,resolvedPathname:f,clientReferenceManifest:P,serverActionsManifest:D}=u,F=(0,r.normalizeAppPath)(O),w=!!(L.dynamicRoutes[F]||L.routes[f]),v=async()=>((null==C?void 0:C.render404)?await C.render404(e,n,m,!1):n.end("This page could not be found"),null);if(w&&!H){let e=!!L.routes[f],n=L.dynamicRoutes[F];if(n&&!1===n.fallback&&!e){if(A.experimental.adapterPath)return await v();throw new h.NoFallbackError}}let y=null;!w||p.isDev||H||(y="/index"===(y=f)?"/":y);let W=!0===p.isDev||!w,U=w&&!W;D&&P&&(0,_.setManifestsSingleton)({page:O,clientReferenceManifest:P,serverActionsManifest:D});let M=e.method||"GET",x=(0,s.getTracer)(),b=x.getActiveScopeSpan(),k={params:g,prerenderManifest:L,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts},cacheComponents:!!A.cacheComponents,supportsDynamicResponse:W,incrementalCache:(0,o.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:A.cacheLife,waitUntil:i.waitUntil,onClose:e=>{n.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(n,t,i,o)=>p.onRequestError(e,n,i,o,C)},sharedContext:{buildId:$}},K=new E.NodeNextRequest(e),j=new E.NodeNextResponse(n),J=a.NextRequestAdapter.fromNodeNextRequest(K,(0,a.signalFromNodeResponse)(n));try{let _=async e=>p.handle(J,k).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":n.statusCode,"next.rsc":!1});let t=x.getRootSpanAttributes();if(!t)return;if(t.get("next.span_type")!==l.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${t.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let i=t.get("next.route");if(i){let n=`${M} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":n}),e.updateName(n)}else e.updateName(`${M} ${O}`)}),r=!!(0,o.getRequestMeta)(e,"minimalMode"),E=async o=>{var s,E;let a=async({previousCacheEntry:t})=>{try{if(!r&&G&&R&&!t)return n.statusCode=404,n.setHeader("x-nextjs-cache","REVALIDATED"),n.end("This page could not be found"),null;let s=await _(o);e.fetchMetrics=k.renderOpts.fetchMetrics;let E=k.renderOpts.pendingWaitUntil;E&&i.waitUntil&&(i.waitUntil(E),E=void 0);let a=k.renderOpts.collectedTags;if(!w)return await (0,N.sendResponse)(K,j,s,k.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),n=(0,T.toNodeOutgoingHttpHeaders)(s.headers);a&&(n[c.NEXT_CACHE_TAGS_HEADER]=a),!n["content-type"]&&e.type&&(n["content-type"]=e.type);let t=void 0!==k.renderOpts.collectedRevalidate&&!(k.renderOpts.collectedRevalidate>=c.INFINITE_CACHE)&&k.renderOpts.collectedRevalidate,i=void 0===k.renderOpts.collectedExpire||k.renderOpts.collectedExpire>=c.INFINITE_CACHE?void 0:k.renderOpts.collectedExpire;return{value:{kind:d.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:n},cacheControl:{revalidate:t,expire:i}}}}catch(n){throw(null==t?void 0:t.isStale)&&await p.onRequestError(e,n,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,I.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:G})},!1,C),n}},l=await p.handleResponse({req:e,nextConfig:A,cacheKey:y,routeKind:t.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:L,isRoutePPREnabled:!1,isOnDemandRevalidate:G,revalidateOnlyGenerated:R,responseGenerator:a,waitUntil:i.waitUntil,isMinimalMode:r});if(!w)return null;if((null==l||null==(s=l.value)?void 0:s.kind)!==d.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(E=l.value)?void 0:E.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});r||n.setHeader("x-nextjs-cache",G?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),H&&n.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,T.fromNodeOutgoingHttpHeaders)(l.value.headers);return r&&w||h.delete(c.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||n.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,S.getCacheControlHeader)(l.cacheControl)),await (0,N.sendResponse)(K,j,new Response(l.value.body,{headers:h,status:l.value.status||200})),null};b?await E(b):await x.withPropagatedContext(e.headers,()=>x.trace(l.BaseServerSpan.handleRequest,{spanName:`${M} ${O}`,kind:s.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},E))}catch(n){if(n instanceof h.NoFallbackError||await p.onRequestError(e,n,{routerKind:"App Router",routePath:F,routeType:"route",revalidateReason:(0,I.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:G})},!1,C),w)throw n;return await (0,N.sendResponse)(K,j,new Response(null,{status:500})),null}}e.s(["handler",()=>G,"patchFetch",()=>C,"routeModule",()=>p,"serverHooks",()=>L,"workAsyncStorage",()=>m,"workUnitAsyncStorage",()=>H],901411)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=node_modules_next_dist_esm_build_templates_app-route_c4a195e5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--iE8084jR9Kgb7Bhs3Xokh--><html lang="zh-CN"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/e159d293fc72e91b.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/54918f1e5761dce2.js"/><script src="/_next/static/chunks/47e400e111f79958.js" async=""></script><script src="/_next/static/chunks/aaf71b20c0654b49.js" async=""></script><script src="/_next/static/chunks/b01cf8712eab1754.js" async=""></script><script src="/_next/static/chunks/turbopack-89cfd3d0d2bc7891.js" async=""></script><script src="/_next/static/chunks/4ca08eb48dd2a872.js" async=""></script><script src="/_next/static/chunks/04c3eddd5a36fbd9.js" async=""></script><script src="/_next/static/chunks/94fdb955b1dc512a.js" async=""></script><script src="/_next/static/chunks/d96012bcfc98706a.js" async=""></script><script src="/_next/static/chunks/73e3194f06db260e.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Agent-insight</title><meta name="description" content="Agent 全生命周期可观测、评估、归因与优化平台"/><link rel="icon" href="/favicon.ico?favicon.0b3bf435.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><!--$--><!--/$--><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><script src="/_next/static/chunks/54918f1e5761dce2.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[397319,[\"/_next/static/chunks/4ca08eb48dd2a872.js\",\"/_next/static/chunks/04c3eddd5a36fbd9.js\",\"/_next/static/chunks/94fdb955b1dc512a.js\"],\"Providers\"]\n3:I[339756,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"default\"]\n4:I[837457,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"default\"]\n5:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"ViewportBoundary\"]\na:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"MetadataBoundary\"]\nc:I[168027,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"default\"]\n:HL[\"/_next/static/chunks/e159d293fc72e91b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"iE8084jR9Kgb7Bhs3Xokh\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/e159d293fc72e91b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/4ca08eb48dd2a872.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/04c3eddd5a36fbd9.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-2\",{\"src\":\"/_next/static/chunks/94fdb955b1dc512a.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"zh-CN\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"suppressHydrationWarning\":true,\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[27201,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"IconMark\"]\n7:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Agent-insight\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Agent 全生命周期可观测、评估、归因与优化平台\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0b3bf435.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Ld\",\"3\",{}]]\n"])</script></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
2
|
-
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/54918f1e5761dce2.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[339756,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"default\"]\n3:I[837457,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"default\"]\n4:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"ViewportBoundary\"]\n9:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"MetadataBoundary\"]\nb:I[168027,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"
|
|
1
|
+
<!DOCTYPE html><!--iE8084jR9Kgb7Bhs3Xokh--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/54918f1e5761dce2.js"/><script src="/_next/static/chunks/47e400e111f79958.js" async=""></script><script src="/_next/static/chunks/aaf71b20c0654b49.js" async=""></script><script src="/_next/static/chunks/b01cf8712eab1754.js" async=""></script><script src="/_next/static/chunks/turbopack-89cfd3d0d2bc7891.js" async=""></script><script src="/_next/static/chunks/d96012bcfc98706a.js" async=""></script><script src="/_next/static/chunks/73e3194f06db260e.js" async=""></script><title>500: Internal Server Error.</title><link rel="icon" href="/favicon.ico?favicon.0b3bf435.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
|
|
2
|
+
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/54918f1e5761dce2.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[339756,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"default\"]\n3:I[837457,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"default\"]\n4:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"ViewportBoundary\"]\n9:I[897367,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"MetadataBoundary\"]\nb:I[168027,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"iE8084jR9Kgb7Bhs3Xokh\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"c:I[27201,[\"/_next/static/chunks/d96012bcfc98706a.js\",\"/_next/static/chunks/73e3194f06db260e.js\"],\"IconMark\"]\n6:null\na:[[\"$\",\"link\",\"0\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0b3bf435.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Lc\",\"1\",{}]]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"
|
|
1
|
+
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"Ly1+MIjuHs1eN/w5Jx1n34xqUbWxuuJ4ETZe+w8Cn10=\"\n}"
|