agent-insight 0.3.0-beta โ 0.3.1-beta
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/(main)/accessconfig/channels/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/accessconfig/health/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/accessconfig/install/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/accessconfig/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/accessconfig/webhooks/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/agents/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/dashboard/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/dataset/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/dataset/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/eval/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(main)/eval/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/eval/run/[runId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/eval/trajectory/[taskId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/eval/trajectory/[taskId]/trace/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/eval/trajectory/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/evaluation/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/fault/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/memory/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/metrics/evaluators/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/metrics/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/modelconfig/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/modelconfig/registry/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(main)/modelconfig/registry/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/modelconfig/web-search/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/optapi/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/quality/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(main)/quality/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/security/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/skill-eval/grayscale/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/skill-eval/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/skill-eval/trigger/[skillName]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/skill-generator/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/skill-history/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(main)/skill-history/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/skill-opt/[name]/[version]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/skill-opt/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/skill-release/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/skills/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(main)/skills/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(main)/trace/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(main)/trace/page_client-reference-manifest.js +1 -1
- 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/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/accessconfig/channels.html +1 -1
- package/.next/standalone/.next/server/app/accessconfig/channels.rsc +2 -2
- 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 +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/accessconfig/channels.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/accessconfig/health.html +1 -1
- package/.next/standalone/.next/server/app/accessconfig/health.rsc +2 -2
- 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 +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/accessconfig/health.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/accessconfig/install.html +1 -1
- package/.next/standalone/.next/server/app/accessconfig/install.rsc +3 -3
- package/.next/standalone/.next/server/app/accessconfig/install.segments/!KG1haW4p/accessconfig/install/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- 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 +2 -2
- package/.next/standalone/.next/server/app/accessconfig/install.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/accessconfig/webhooks.html +1 -1
- package/.next/standalone/.next/server/app/accessconfig/webhooks.rsc +2 -2
- 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 +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/accessconfig/webhooks.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/accessconfig.html +1 -1
- package/.next/standalone/.next/server/app/accessconfig.rsc +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/accessconfig.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/accessconfig.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/accessconfig.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/agents.html +1 -1
- package/.next/standalone/.next/server/app/agents.rsc +3 -3
- package/.next/standalone/.next/server/app/agents.segments/!KG1haW4p/agents/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- package/.next/standalone/.next/server/app/agents.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/agents.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/agents.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/agent/run/route.js +5 -5
- 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 +3 -3
- package/.next/standalone/.next/server/app/api/agent/stream/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/debug/batch-tasks/[taskId]/route.js +5 -5
- 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/execute/route.js +5 -5
- 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 +11 -11
- package/.next/standalone/.next/server/app/api/debug/grayscale-tasks/[taskId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/config/backfill-routing/route.js +4 -4
- 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/route.js +6 -6
- package/.next/standalone/.next/server/app/api/eval/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/rejudge/route.js +6 -6
- package/.next/standalone/.next/server/app/api/eval/rejudge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/eval/terminate-all/route.js +6 -6
- 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/run/route.js +9 -9
- package/.next/standalone/.next/server/app/api/eval/trajectory/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/evaluation/[id]/route.js +2 -2
- package/.next/standalone/.next/server/app/api/fault/diagnosis/stream/route.js +5 -5
- package/.next/standalone/.next/server/app/api/fault/diagnosis/stream/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ingest/opencode/session-complete/route.js +5 -5
- 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/traces/route.js +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]/end/route.js +5 -5
- 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/setup/hermes-plugin/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/ingest/setup/hermes-plugin/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/ingest/setup/hermes-plugin/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/ingest/setup/hermes-plugin/route.js +7 -0
- package/.next/standalone/.next/server/app/api/ingest/setup/hermes-plugin/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/ingest/setup/hermes-plugin/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/ingest/setup/hermes-plugin/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/ingest/upload/route.js +7 -7
- 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 +4 -4
- 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 +5 -5
- 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 +9 -9
- 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/task-stats/route.js +3 -3
- package/.next/standalone/.next/server/app/api/observe/task-stats/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/quality/agents/route.js +4 -4
- package/.next/standalone/.next/server/app/api/quality/agents/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/quality/executions/route.js +4 -4
- package/.next/standalone/.next/server/app/api/quality/executions/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]/run/route.js +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-generator/attachments/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skill-generator/chat/route.js +5 -5
- 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/files/content/route.js +3 -3
- 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 +5 -5
- 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 +3 -3
- 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 +3 -3
- 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-opt/chat/route.js +4 -4
- package/.next/standalone/.next/server/app/api/skill-opt/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/benchmark-generate/route.js +5 -5
- 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 +3 -3
- 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]/versions/[version]/evaluate/route.js +2 -2
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/evaluation-summary/route.js +2 -2
- 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/logs/route.js +4 -4
- package/.next/standalone/.next/server/app/api/skills/logs/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 +3 -3
- package/.next/standalone/.next/server/app/dashboard.segments/!KG1haW4p/dashboard/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- package/.next/standalone/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/dataset.html +1 -1
- package/.next/standalone/.next/server/app/dataset.rsc +3 -3
- package/.next/standalone/.next/server/app/dataset.segments/!KG1haW4p/dataset/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- package/.next/standalone/.next/server/app/dataset.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dataset.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/dataset.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/eval/trajectory.html +1 -1
- package/.next/standalone/.next/server/app/eval/trajectory.rsc +3 -3
- package/.next/standalone/.next/server/app/eval/trajectory.segments/!KG1haW4p/eval/trajectory/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- 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 +2 -2
- package/.next/standalone/.next/server/app/eval/trajectory.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/eval.html +1 -1
- package/.next/standalone/.next/server/app/eval.rsc +3 -3
- package/.next/standalone/.next/server/app/eval.segments/!KG1haW4p/eval/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- package/.next/standalone/.next/server/app/eval.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/eval.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/eval.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/fault.html +1 -1
- package/.next/standalone/.next/server/app/fault.rsc +3 -3
- package/.next/standalone/.next/server/app/fault.segments/!KG1haW4p/fault/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- package/.next/standalone/.next/server/app/fault.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/fault.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/fault.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login.html +1 -1
- package/.next/standalone/.next/server/app/login.rsc +2 -2
- package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- 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 +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/memory.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/memory.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/memory.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/metrics.html +1 -1
- package/.next/standalone/.next/server/app/metrics.rsc +3 -3
- package/.next/standalone/.next/server/app/metrics.segments/!KG1haW4p/metrics/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- package/.next/standalone/.next/server/app/metrics.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/metrics.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/metrics.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/modelconfig/registry.html +1 -1
- package/.next/standalone/.next/server/app/modelconfig/registry.rsc +3 -3
- package/.next/standalone/.next/server/app/modelconfig/registry.segments/!KG1haW4p/modelconfig/registry/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- 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 +2 -2
- package/.next/standalone/.next/server/app/modelconfig/registry.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/modelconfig/web-search.html +1 -1
- package/.next/standalone/.next/server/app/modelconfig/web-search.rsc +3 -3
- package/.next/standalone/.next/server/app/modelconfig/web-search.segments/!KG1haW4p/modelconfig/web-search/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- 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 +2 -2
- package/.next/standalone/.next/server/app/modelconfig/web-search.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/modelconfig.html +1 -1
- package/.next/standalone/.next/server/app/modelconfig.rsc +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/modelconfig.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/modelconfig.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/modelconfig.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/optapi.html +1 -1
- package/.next/standalone/.next/server/app/optapi.rsc +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/optapi.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/optapi.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/optapi.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/quality.html +1 -1
- package/.next/standalone/.next/server/app/quality.rsc +3 -3
- package/.next/standalone/.next/server/app/quality.segments/!KG1haW4p/quality/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- package/.next/standalone/.next/server/app/quality.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/quality.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/quality.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/security.html +1 -1
- package/.next/standalone/.next/server/app/security.rsc +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/security.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/security.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/security.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/skill-detail/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/skill-detail.html +1 -1
- package/.next/standalone/.next/server/app/skill-detail.rsc +2 -2
- package/.next/standalone/.next/server/app/skill-detail.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/skill-detail.segments/_tree.segment.rsc +2 -2
- 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 +5 -5
- package/.next/standalone/.next/server/app/skill-eval/grayscale.segments/!KG1haW4p/skill-eval/grayscale/__PAGE__.segment.rsc +2 -2
- 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 +5 -5
- 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 +2 -2
- package/.next/standalone/.next/server/app/skill-eval/grayscale.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/skill-eval.html +1 -1
- package/.next/standalone/.next/server/app/skill-eval.rsc +5 -5
- package/.next/standalone/.next/server/app/skill-eval.segments/!KG1haW4p/skill-eval/__PAGE__.segment.rsc +3 -3
- 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 +5 -5
- 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 +2 -2
- package/.next/standalone/.next/server/app/skill-eval.segments/_tree.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/skill-generator.html +1 -1
- package/.next/standalone/.next/server/app/skill-generator.rsc +3 -3
- package/.next/standalone/.next/server/app/skill-generator.segments/!KG1haW4p/skill-generator/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- 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 +2 -2
- package/.next/standalone/.next/server/app/skill-generator.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/skill-history.html +1 -1
- package/.next/standalone/.next/server/app/skill-history.rsc +3 -3
- package/.next/standalone/.next/server/app/skill-history.segments/!KG1haW4p/skill-history/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- 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 +2 -2
- package/.next/standalone/.next/server/app/skill-history.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/skill-opt.html +1 -1
- package/.next/standalone/.next/server/app/skill-opt.rsc +3 -3
- package/.next/standalone/.next/server/app/skill-opt.segments/!KG1haW4p/skill-opt/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- 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 +2 -2
- package/.next/standalone/.next/server/app/skill-opt.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/skill-release.html +1 -1
- package/.next/standalone/.next/server/app/skill-release.rsc +2 -2
- 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 +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/skill-release.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/skills.html +1 -1
- package/.next/standalone/.next/server/app/skills.rsc +4 -4
- package/.next/standalone/.next/server/app/skills.segments/!KG1haW4p/skills/__PAGE__.segment.rsc +3 -3
- 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 +4 -4
- package/.next/standalone/.next/server/app/skills.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/skills.segments/_tree.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/trace.html +1 -1
- package/.next/standalone/.next/server/app/trace.rsc +3 -3
- package/.next/standalone/.next/server/app/trace.segments/!KG1haW4p/trace/__PAGE__.segment.rsc +2 -2
- 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 +3 -3
- package/.next/standalone/.next/server/app/trace.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/trace.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/trace.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app-paths-manifest.json +1 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__040b569f._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__045587bf._.js +6 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__bfd5933a._.js โ [root-of-the-server]__0b0ca028._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0e81c059._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1e033f42._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__35b27244._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__b88f14c0._.js โ [root-of-the-server]__363f8caf._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__45f15a40._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5c5398f8._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__677bd848._.js +21 -21
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__d436a672._.js โ [root-of-the-server]__6de56d9f._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b57a53c2._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b9ea78fe._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__7c29779d._.js โ [root-of-the-server]__c5028c19._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ca706dfb._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__67e8aa0f._.js โ [root-of-the-server]__cc29b58c._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__cc3948c5._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e8b45be8._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__eb171d10._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__fef5bbd7._.js +1 -1
- package/.next/standalone/.next/server/chunks/_19441465._.js +370 -0
- package/.next/standalone/.next/server/chunks/{_1715c14d._.js โ _1bd51141._.js} +1 -1
- package/.next/standalone/.next/server/chunks/_5041b697._.js +14 -14
- package/.next/standalone/.next/server/chunks/_73cb0d03._.js +1 -1
- package/.next/standalone/.next/server/chunks/_a0c6d359._.js +7 -7
- package/.next/standalone/.next/server/chunks/_b8c4ce57._.js +3 -0
- package/.next/standalone/.next/server/chunks/_c14dfae2._.js +1 -1
- package/.next/standalone/.next/server/chunks/_e0991a0e._.js +1 -1
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_ingest_setup_hermes-plugin_route_actions_212af014.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_3239b80e._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_@langchain_core_dist_051f8412._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_@langchain_core_dist_0cad7765._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_@langchain_core_dist_8e3308fa._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_@langchain_langgraph_dist_index_23ed4b74.js +25 -25
- package/.next/standalone/.next/server/chunks/node_modules_d933a926._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_23ab65eb.js +39 -51
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_c4a195e5.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_undici_206d7c0f._.js +15 -15
- package/.next/standalone/.next/server/chunks/src_34fb142e._.js +15 -15
- package/.next/standalone/.next/server/chunks/src_lib_1466262d._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_5d86eca7._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_7bae418f._.js +6 -0
- package/.next/standalone/.next/server/chunks/{src_lib_ac48c2f3._.js โ src_lib_beee2d37._.js} +6 -6
- package/.next/standalone/.next/server/chunks/src_lib_c6d9db51._.js +3 -0
- package/.next/standalone/.next/server/chunks/{src_lib_3205a4fa._.js โ src_lib_e361eb76._.js} +6 -6
- package/.next/standalone/.next/server/chunks/src_lib_engine_evaluation_d6ad3d54._.js +6 -6
- package/.next/standalone/.next/server/chunks/src_lib_engine_evaluation_evaluator-execution-recorder_ts_d7fedcdd._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_engine_general-agent_970b1dfe._.js +3 -3
- package/.next/standalone/.next/server/chunks/src_lib_engine_skill-issues_static-evaluator_5e9f2d8a._.js +12 -7
- package/.next/standalone/.next/server/chunks/src_lib_ingest_1accb82d._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__dfea64df._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0141e5c7._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_10e7e5d6._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_633b8c91._.js โ _231821bd._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_23385550._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_338db557._.js +1 -5
- package/.next/standalone/.next/server/chunks/ssr/_37d91d48._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_4796bd79._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_5e0dfc4e._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_5ea9f29c._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_ad052dd8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_c16d64b3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_cebf2190._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_cfe5178e._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_d4828542._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_d710ba85._.js +1 -5
- package/.next/standalone/.next/server/chunks/ssr/node_modules_05c89d2c._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_0b1debc8._.js +17 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_118dfa2f._.js +26 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_241c62ac._.js +31 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_264cd040._.js +11 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_3ae4ac61._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_42146d1f._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_4eadc088._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_564ffb11._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_5d8dc663._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_653b0c30._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_77281965._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_77b8869b._.js +17 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_7a0d9afc._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_7f5b5ff9._.js +45 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_7f7e9f17._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_7fe3c357._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_803c6412._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_8108cb01._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_831dfa9a._.js +17 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_971a1a98._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_9d323b89._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_db228c3c._.js โ node_modules_@mermaid-js_parser_dist_16c88699._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_22ce2656._.js โ node_modules_@mermaid-js_parser_dist_21851c70._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_544082c1._.js โ node_modules_@mermaid-js_parser_dist_31b46481._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_c48c72e0._.js โ node_modules_@mermaid-js_parser_dist_32bdec7b._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_ddbd29b7._.js โ node_modules_@mermaid-js_parser_dist_66f35908._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_c8a78e27._.js โ node_modules_@mermaid-js_parser_dist_94ecdc22._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_4f77a544._.js โ node_modules_@mermaid-js_parser_dist_b85775a0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_3ab41ad8._.js โ node_modules_@mermaid-js_parser_dist_c8728ae8._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_@radix-ui_react-popper_dist_index_mjs_0d6fc757._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_a22450a1._.js +17 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_ab0108ca._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_cad8d256._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_d40eabb5._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_f89ffeff._.js +17 -0
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_2a7c4de9._.js โ node_modules_fca55bff._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_mermaid_dist_chunks_mermaid_core_chunk-5ZQYHXKU_mjs_9293a43d._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_mermaid_dist_chunks_mermaid_core_chunk-CSCIHK7Q_mjs_5da5edc3._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/node_modules_mermaid_dist_mermaid_core_mjs_a11916de._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_(main)_skill-eval_page_tsx_d6828614._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_components_evaluation_index_ts_95565210._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_components_ui_select_tsx_4c0f64d8._.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/.next/static/chunks/{8b7ff3e53c4bbf8b.js โ 0c7b05946b227f5a.js} +1 -5
- package/.next/standalone/.next/static/chunks/130e114057a9ebcd.js +1 -0
- package/.next/standalone/.next/static/chunks/14befe775870fecd.js +1 -0
- package/.next/standalone/.next/static/chunks/25ad82636e5b58a3.js +2 -0
- package/.next/{static/chunks/9b3f944a84387392.js โ standalone/.next/static/chunks/3336df3d1032eecc.js} +1 -1
- package/.next/standalone/.next/static/chunks/43df5d7cd8ec46ff.js +1 -0
- package/.next/standalone/.next/static/chunks/463b43ecde7acc6b.js +1 -0
- package/.next/standalone/.next/static/chunks/{e5a2f98833719cb8.css โ 5163848f38ac1cf6.css} +1 -1
- package/.next/standalone/.next/static/chunks/{30396061c28bf72c.js โ 53af8dcc7be02445.js} +1 -1
- package/.next/standalone/.next/static/chunks/5e43a260c9f4f214.js +1 -0
- package/.next/{static/chunks/853a1f6bf3b6d443.js โ standalone/.next/static/chunks/623f3222303930bb.js} +1 -1
- package/.next/{static/chunks/5407d16db75c16c3.js โ standalone/.next/static/chunks/669150ee69928668.js} +1 -1
- package/.next/standalone/.next/static/chunks/6dbed19ae114b533.js +1 -0
- package/.next/standalone/.next/static/chunks/{9bdf47a06c8d728a.js โ 72fce1376de53ff1.js} +1 -5
- package/.next/standalone/.next/static/chunks/7aff5373689149f6.css +1 -0
- package/.next/standalone/.next/static/chunks/{2f80f58326d89fa4.js โ 7b15bab143d8c60f.js} +1 -1
- package/.next/{static/chunks/7ac51daef174f857.js โ standalone/.next/static/chunks/83910a2aebec21cd.js} +1 -1
- package/.next/{static/chunks/4e25ec4dd6ef0459.js โ standalone/.next/static/chunks/aab0b35af6737aed.js} +1 -1
- package/.next/standalone/.next/static/chunks/{7ac51daef174f857.js โ ac4d824ecef761ad.js} +1 -1
- package/.next/standalone/.next/static/chunks/c44ecbd264254739.js +1 -0
- package/.next/standalone/.next/static/chunks/d04e17c648ef7960.js +4 -0
- package/.next/standalone/.next/static/chunks/e03cb31f10551f0b.js +119 -0
- package/.next/standalone/.next/static/chunks/e1ca3a6b74761a34.js +1 -0
- package/.next/standalone/.next/static/chunks/e4c086f27bba33f9.js +1 -0
- package/.next/standalone/.next/static/chunks/e623d8fba24bdb29.js +1 -0
- package/.next/standalone/.next/static/chunks/f4436f20374d2dbb.js +1 -0
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/scripts/hermes_agent_insight_plugin.py +882 -0
- package/.next/static/chunks/{8b7ff3e53c4bbf8b.js โ 0c7b05946b227f5a.js} +1 -5
- package/.next/static/chunks/130e114057a9ebcd.js +1 -0
- package/.next/static/chunks/14befe775870fecd.js +1 -0
- package/.next/static/chunks/25ad82636e5b58a3.js +2 -0
- package/.next/{standalone/.next/static/chunks/9b3f944a84387392.js โ static/chunks/3336df3d1032eecc.js} +1 -1
- package/.next/static/chunks/43df5d7cd8ec46ff.js +1 -0
- package/.next/static/chunks/463b43ecde7acc6b.js +1 -0
- package/.next/static/chunks/{e5a2f98833719cb8.css โ 5163848f38ac1cf6.css} +1 -1
- package/.next/static/chunks/{30396061c28bf72c.js โ 53af8dcc7be02445.js} +1 -1
- package/.next/static/chunks/5e43a260c9f4f214.js +1 -0
- package/.next/{standalone/.next/static/chunks/853a1f6bf3b6d443.js โ static/chunks/623f3222303930bb.js} +1 -1
- package/.next/{standalone/.next/static/chunks/5407d16db75c16c3.js โ static/chunks/669150ee69928668.js} +1 -1
- package/.next/static/chunks/6dbed19ae114b533.js +1 -0
- package/.next/static/chunks/{9bdf47a06c8d728a.js โ 72fce1376de53ff1.js} +1 -5
- package/.next/static/chunks/7aff5373689149f6.css +1 -0
- package/.next/static/chunks/{2f80f58326d89fa4.js โ 7b15bab143d8c60f.js} +1 -1
- package/.next/{standalone/.next/static/chunks/82647ed55d4480ce.js โ static/chunks/83910a2aebec21cd.js} +1 -1
- package/.next/{standalone/.next/static/chunks/4e25ec4dd6ef0459.js โ static/chunks/aab0b35af6737aed.js} +1 -1
- package/.next/static/chunks/ac4d824ecef761ad.js +1 -0
- package/.next/static/chunks/c44ecbd264254739.js +1 -0
- package/.next/static/chunks/d04e17c648ef7960.js +4 -0
- package/.next/static/chunks/e03cb31f10551f0b.js +119 -0
- package/.next/static/chunks/e1ca3a6b74761a34.js +1 -0
- package/.next/static/chunks/e4c086f27bba33f9.js +1 -0
- package/.next/static/chunks/e623d8fba24bdb29.js +1 -0
- package/.next/static/chunks/f4436f20374d2dbb.js +1 -0
- package/package.json +1 -1
- package/scripts/hermes_agent_insight_plugin.py +882 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__00c0800e._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2e16866c._.js +0 -6
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__52e5e5b6._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5782a103._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e80a8314._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f7423c32._.js +0 -3
- package/.next/standalone/.next/server/chunks/_7ecc72d5._.js +0 -370
- package/.next/standalone/.next/server/chunks/_fbb1d006._.js +0 -3
- package/.next/standalone/.next/server/chunks/src_lib_68596f16._.js +0 -6
- package/.next/standalone/.next/server/chunks/src_lib_69eb724e._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__afc1fc82._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1409f211._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/_53a193b7._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_8e246656._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/_c5121a52._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_ddf088e7._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_ff4f28a3._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/node_modules_03a4e1e8._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_107e06c2._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_1478fd1a._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_28567d0f._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_2b979638._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_2be5a018._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_302487e0._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_327acc03._.js +0 -26
- package/.next/standalone/.next/server/chunks/ssr/node_modules_39d86cba._.js +0 -17
- package/.next/standalone/.next/server/chunks/ssr/node_modules_3c01063a._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_3e9eb0ee._.js +0 -11
- package/.next/standalone/.next/server/chunks/ssr/node_modules_3f93cf58._.js +0 -45
- package/.next/standalone/.next/server/chunks/ssr/node_modules_4327b3e7._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_4bea67c9._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_561578ad._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_5997198a._.js +0 -31
- package/.next/standalone/.next/server/chunks/ssr/node_modules_64378d98._.js +0 -17
- package/.next/standalone/.next/server/chunks/ssr/node_modules_6e79a594._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_7cccaf98._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_8ac545aa._.js +0 -17
- package/.next/standalone/.next/server/chunks/ssr/node_modules_9bf47e56._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_9f38447b._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_@mermaid-js_parser_dist_b213ca58._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_cdddc2e8._.js +0 -17
- package/.next/standalone/.next/server/chunks/ssr/node_modules_e51942b7._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_f9ad22f8._.js +0 -17
- package/.next/standalone/.next/static/chunks/01874bd5a7fda069.js +0 -5
- package/.next/standalone/.next/static/chunks/05f725ad2bd51889.js +0 -5
- package/.next/standalone/.next/static/chunks/28c31d9589800fe1.js +0 -1
- package/.next/standalone/.next/static/chunks/41708ee675c0cc34.js +0 -1
- package/.next/standalone/.next/static/chunks/8481480a23164da3.js +0 -1
- package/.next/standalone/.next/static/chunks/8552cadf84c26cfe.js +0 -4
- package/.next/standalone/.next/static/chunks/8dc215cff38e080b.js +0 -5
- package/.next/standalone/.next/static/chunks/a5d8acb3d2573b32.js +0 -1
- package/.next/standalone/.next/static/chunks/a7e72ad6eda9aad1.js +0 -5
- package/.next/standalone/.next/static/chunks/bb69bd8f3fb2597f.js +0 -1
- package/.next/standalone/.next/static/chunks/c356ee0aa836b01c.js +0 -2
- package/.next/standalone/.next/static/chunks/c7b67d9c0be1999f.js +0 -1
- package/.next/standalone/.next/static/chunks/cdad5bb63a64bc1a.js +0 -119
- package/.next/standalone/.next/static/chunks/e0b132c675c3513e.js +0 -1
- package/.next/standalone/.next/static/chunks/e6562c7e7bb67446.css +0 -1
- package/.next/static/chunks/01874bd5a7fda069.js +0 -5
- package/.next/static/chunks/05f725ad2bd51889.js +0 -5
- package/.next/static/chunks/28c31d9589800fe1.js +0 -1
- package/.next/static/chunks/41708ee675c0cc34.js +0 -1
- package/.next/static/chunks/82647ed55d4480ce.js +0 -1
- package/.next/static/chunks/8481480a23164da3.js +0 -1
- package/.next/static/chunks/8552cadf84c26cfe.js +0 -4
- package/.next/static/chunks/8dc215cff38e080b.js +0 -5
- package/.next/static/chunks/a5d8acb3d2573b32.js +0 -1
- package/.next/static/chunks/a7e72ad6eda9aad1.js +0 -5
- package/.next/static/chunks/bb69bd8f3fb2597f.js +0 -1
- package/.next/static/chunks/c356ee0aa836b01c.js +0 -2
- package/.next/static/chunks/c7b67d9c0be1999f.js +0 -1
- package/.next/static/chunks/cdad5bb63a64bc1a.js +0 -119
- package/.next/static/chunks/e0b132c675c3513e.js +0 -1
- package/.next/static/chunks/e6562c7e7bb67446.css +0 -1
- /package/.next/standalone/.next/static/{1I9NXkgb5T_a680craVmT โ XvmH6p-x60yNMPW2ZorCE}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{1I9NXkgb5T_a680craVmT โ XvmH6p-x60yNMPW2ZorCE}/_clientMiddlewareManifest.json +0 -0
- /package/.next/standalone/.next/static/{1I9NXkgb5T_a680craVmT โ XvmH6p-x60yNMPW2ZorCE}/_ssgManifest.js +0 -0
- /package/.next/static/{1I9NXkgb5T_a680craVmT โ XvmH6p-x60yNMPW2ZorCE}/_buildManifest.js +0 -0
- /package/.next/static/{1I9NXkgb5T_a680craVmT โ XvmH6p-x60yNMPW2ZorCE}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{1I9NXkgb5T_a680craVmT โ XvmH6p-x60yNMPW2ZorCE}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[868578,e=>{"use strict";var t=e.i(747909),n=e.i(174017),i=e.i(996250),o=e.i(759756),s=e.i(561916),r=e.i(174677),a=e.i(869741),l=e.i(316795),E=e.i(487718),_=e.i(995169),c=e.i(47587),h=e.i(666012),p=e.i(570101),I=e.i(626937),d=e.i(10372),T=e.i(193695);e.i(52474);var S=e.i(600220),O=e.i(89171);async function u(e){var t,n,i;let o,s,r,a,{searchParams:l}=new URL(e.url),E=l.get("apiKey"),_=l.get("host");if(!E||!_)return new O.NextResponse("Missing required parameters: apiKey and host",{status:400,headers:{"Content-Type":"text/plain"}});let c=e.headers.get("host")||"127.0.0.1:3000",h=e.headers.get("x-forwarded-proto")||"http",p=new URL(e.url).pathname.replace(/\/api\/setup\/auto\/?$/,""),I=`${h}://${c}${p}`;return"windows"==(r=e.headers.get("user-agent")||"",(a=e.headers.get("x-platform")||"")?"windows"===a.toLowerCase()?"windows":"unix":/windows|win32|win64/i.test(r)?"windows":"unix")?(o=["# =============================================================================\n# Skill-insight Auto Setup (Non-Interactive) - PowerShell\n# =============================================================================\n",'$AGENT_INSIGHT_HOST = "'+_+'"','$AGENT_INSIGHT_BASE_URL = "'+I+'"','$AGENT_INSIGHT_API_KEY = "'+E+'"','\nWrite-Host "๐ Fetching Skill-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 " Skill-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 " Skill-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$skillInsightDir = Join-Path $env:USERPROFILE ".agent-insight"\n$skillInsightLogsDir = Join-Path $skillInsightDir "logs"\n$opencodePluginsDir = Join-Path $env:USERPROFILE ".opencode\\plugins"\n$opencodeSkillsDir = Join-Path $env:USERPROFILE ".opencode\\skills"\n$claudeProjectsDir = Join-Path $env:USERPROFILE ".claude\\projects"\n$openclawAgentsDir = Join-Path $env:USERPROFILE ".openclaw\\agents"\n\nNew-Item -ItemType Directory -Force -Path $skillInsightDir | Out-Null\nNew-Item -ItemType Directory -Force -Path $skillInsightLogsDir | Out-Null\nNew-Item -ItemType Directory -Force -Path $opencodePluginsDir | Out-Null\nNew-Item -ItemType Directory -Force -Path $opencodeSkillsDir | Out-Null\nNew-Item -ItemType Directory -Force -Path $claudeProjectsDir | Out-Null\nNew-Item -ItemType Directory -Force -Path $openclawAgentsDir | Out-Null\nNew-Item -ItemType Directory -Force -Path ".opencode\\skills" | Out-Null\nWrite-Host "๐ Created necessary directories"\n\n# 2. Interactive Framework Selection with inquirer\nWrite-Host ""\n\n$SELECTOR_SCRIPT = Join-Path $skillInsightDir "framework_selector.mjs"\n$SELECTOR_RESULT = Join-Path $skillInsightDir ".selector_result"\n\n# Install inquirer and tsx if not already installed\nSet-Location $skillInsightDir\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$selectorLines = @(\n "import inquirer from \'inquirer\';"\n "import fs from \'fs\';"\n ""\n "const frameworks = ["\n " { name: \'OpenCode\', value: \'opencode\' },"\n " { name: \'Claude Code\', value: \'claude\' },"\n " { name: \'Hermes\', value: \'hermes\' },"\n " { name: \'OpenClaw\', value: \'openclaw\' }"\n "];"\n ""\n "async 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\', \'โ โจ Skill-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 " 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 " // Write result to file for PowerShell to read"\n " const resultFile = process.env.SELECTOR_RESULT_FILE || process.env.USERPROFILE + \'\\\\.agent-insight\\\\.selector_result\';"\n " fs.writeFileSync(resultFile, selected.join(\',\'));"\n "}"\n ""\n "select().catch(err => {"\n " console.error(\'Error:\', err);"\n " process.exit(1);"\n "});"\n)\n$selectorContent = $selectorLines -join [char]10\nSet-Content -Path $SELECTOR_SCRIPT -Value $selectorContent -Encoding UTF8\n\n# Run the selector interactively\n$env:SELECTOR_RESULT_FILE = $SELECTOR_RESULT\nSet-Location $skillInsightDir\n./node_modules/.bin/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\n# Set installation flags based on selection\n$INSTALL_OPENCODE = $false\n$INSTALL_CLAUDE = $false\n$INSTALL_HERMES = $false\n$INSTALL_OPENCLAW = $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 "openclaw") {\n $INSTALL_OPENCLAW = $true\n}\n\n# Exit if nothing selected\nif (-not $INSTALL_OPENCODE -and -not $INSTALL_CLAUDE -and -not $INSTALL_HERMES -and -not $INSTALL_OPENCLAW) {\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 = if ($env:XDG_CONFIG_HOME) { Join-Path $env:XDG_CONFIG_HOME "opencode" } elseif ($env:APPDATA) { Join-Path $env:APPDATA "opencode" } else { Join-Path $env:USERPROFILE ".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 $opencodePluginsDir "Skill-Insight.ts") -Force -ErrorAction SilentlyContinue\n Remove-Item -Path (Join-Path $opencodePluginsDir "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 Copy-Item (Join-Path $opencodeConfigDir "plugins\\Witty-Skill-Insight.ts") (Join-Path $opencodePluginsDir "Witty-Skill-Insight.ts") -Force -ErrorAction SilentlyContinue\n Write-Host "โฌ Downloading OpenCode Uploader..."\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/opencode-uploader" -OutFile (Join-Path $skillInsightDir "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 Copy-Item $tuiPluginPath (Join-Path $opencodePluginsDir "Witty-Skill-Insight.tui.tsx") -Force -ErrorAction SilentlyContinue\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 Hermes OTel plugin..."\n $hermesHome = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $env:USERPROFILE ".hermes" }\n $hermesAgentDir = Join-Path $hermesHome "hermes-agent"\n $hermesOtelPluginDir = Join-Path $hermesHome "plugins\\hermes_otel"\n $hermesCmd = Get-Command hermes -ErrorAction SilentlyContinue\n if ($hermesCmd) {\n & $hermesCmd.Source plugins install briancaffey/hermes-otel --enable\n } else {\n Write-Host "Warning: hermes command not found. Install Hermes first, then rerun this setup or run: hermes plugins install briancaffey/hermes-otel"\n }\n New-Item -ItemType Directory -Path $hermesOtelPluginDir -Force | Out-Null\n $hermesPip = $null\n foreach ($rel in @("venv\\Scripts\\pip.exe", "venv\\bin\\pip")) {\n $candidate = Join-Path $hermesAgentDir $rel\n if (-not $hermesPip -and (Test-Path $candidate)) { $hermesPip = $candidate }\n }\n $venvCandidates = @($env:HERMES_AGENT_VENV, $env:HERMES_VENV, (Join-Path $env:USERPROFILE "git\\hermes-agent\\venv"), (Join-Path $env:USERPROFILE "agent\\hermes-agent\\venv"))\n foreach ($venv in $venvCandidates) {\n if (-not $hermesPip -and $venv) {\n foreach ($rel in @("Scripts\\pip.exe", "bin\\pip")) {\n $candidate = Join-Path $venv $rel\n if (Test-Path $candidate) { $hermesPip = $candidate; break }\n }\n }\n }\n if ($hermesPip) {\n & $hermesPip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http pyyaml\n if ((Test-Path (Join-Path $hermesOtelPluginDir "pyproject.toml")) -or (Test-Path (Join-Path $hermesOtelPluginDir "setup.py"))) {\n & $hermesPip install -e $hermesOtelPluginDir\n }\n Write-Host "Hermes OTel dependencies installed with $hermesPip"\n } else {\n Write-Host "Warning: could not find hermes-agent venv pip under $hermesAgentDir\\venv, ~/git/hermes-agent/venv, or ~/agent/hermes-agent/venv. Set HERMES_AGENT_VENV=/path/to/venv and rerun setup if Hermes cannot load OTel dependencies."\n }\n}\n\nif ($INSTALL_OPENCLAW) {\n Write-Host "โฌ Downloading OpenClaw Watcher..."\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/openclaw-watcher" -OutFile (Join-Path $skillInsightDir "openclaw_watcher_client.ts")\n}\n\n# 4. Configure ~/.agent-insight/.env (Auto mode - no interaction)\n$AGENT_INSIGHT_CONFIG_FILE = Join-Path $skillInsightDir ".env"\n\nWrite-Host "โ๏ธ Updating configuration..."\nif (Test-Path $AGENT_INSIGHT_CONFIG_FILE) {\n $existingContent = Get-Content $AGENT_INSIGHT_CONFIG_FILE\n $existingShow = ($existingContent | Where-Object { $_ -match "^AGENT_INSIGHT_SHOW_TASK_STATS=" } | Select-Object -First 1)\n $showValue = "true"\n if ($existingShow) { $showValue = ($existingShow -split "=", 2)[1] }\n $filteredContent = $existingContent | 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=" }\n Set-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value $filteredContent\n} else {\n New-Item -ItemType File -Path $AGENT_INSIGHT_CONFIG_FILE -Force | Out-Null\n $showValue = "true"\n}\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_HOST=$AGENT_INSIGHT_HOST"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_API_KEY=$AGENT_INSIGHT_API_KEY"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_SHOW_TASK_STATS=$showValue"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_RETENTION_DAYS=10"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_OPENCODE_OTEL_ENABLE=true"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_OPENCODE_SPOOL_DIR=$skillInsightDir\\otel_data\\opencode"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_OPENCODE_UPLOADER=$skillInsightDir\\opencode_uploader_client.js"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_CLAUDE_OTEL_SPOOL_DIR=$skillInsightDir\\otel_data\\claude"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES=file:$skillInsightDir\\claude_raw_bodies"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_MAX_TOOL_IO=4000"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_MAX_EVENT_STRING=20000"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_OPENCODE_UPLOAD_COOLDOWN_MS=15000"\nWrite-Host "โ
Configuration updated at $AGENT_INSIGHT_CONFIG_FILE"\nWrite-Host " AGENT_INSIGHT_HOST=$AGENT_INSIGHT_HOST"\nWrite-Host " AGENT_INSIGHT_API_KEY=********"\n\n# 6.4 Configure Hermes OTel plugin\nif ($INSTALL_HERMES) {\n $hermesHome = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $env:USERPROFILE ".hermes" }\n $hermesOtelPluginDir = Join-Path $hermesHome "plugins\\hermes_otel"\n New-Item -ItemType Directory -Path $hermesOtelPluginDir -Force | Out-Null\n $hermesOtelEndpoint = $AGENT_INSIGHT_HOST\n if ($hermesOtelEndpoint -notmatch "^https?://") { $hermesOtelEndpoint = "http://$hermesOtelEndpoint" }\n $hermesOtelEndpoint = $hermesOtelEndpoint.TrimEnd("/") + "/api/ingest/otel/v1/traces"\n $hermesOtelConfig = @"\nenabled: true\ncapture_previews: true\npreview_max_chars: 4000\ncapture_conversation_history: true\nconversation_history_max_chars: 40000\ncapture_full_prompts: false\ncapture_full_responses: true\nresource_attributes:\n service.name: hermes\nbackends:\n - type: otlp\n name: agent-insight\n endpoint: $hermesOtelEndpoint\n headers:\n x-witty-api-key: "$AGENT_INSIGHT_API_KEY"\n"@\n Set-Content -Path (Join-Path $hermesOtelPluginDir "config.yaml") -Value $hermesOtelConfig -Encoding UTF8\n Write-Host "Hermes OTel config written to $hermesOtelPluginDir\\config.yaml"\n}\n\n# 6. Install Watcher Dependencies (only if OpenClaw watcher is selected)\nif ($INSTALL_OPENCLAW) {\n Write-Host ""\n Write-Host "๐ฆ Installing watcher dependencies..."\n if (Get-Command npm -ErrorAction SilentlyContinue) {\n Set-Location $skillInsightDir\n if (-not (Test-Path "package.json")) {\n \'{"name": "skill-insight-watcher", "version": "1.0.0", "type": "module", "dependencies": {}}\' | Out-File -FilePath "package.json" -Encoding utf8\n }\n npm install chokidar --save 2>$null\n Write-Host "โ
Dependencies installed"\n } else {\n Write-Host "โ ๏ธ npm not found. Skipping dependency installation."\n }\n}\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 = Join-Path $skillInsightDir "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 if (-not (Test-Path $PROFILE) -or -not ((Get-Content $PROFILE -Raw) -match "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 (Join-Path $skillInsightDir "claude_watcher_client.ts"), (Join-Path $skillInsightDir "start_claude_watcher.ps1"), (Join-Path $skillInsightDir "stop_claude_watcher.ps1"), (Join-Path $skillInsightDir "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 = $INSTALL_OPENCLAW\n\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "๐ Creating watcher management scripts..."\n\n # OpenClaw Watcher Start Script\n if ($INSTALL_OPENCLAW) {\n $startOpenclawScript = @\'\n# Stop existing watcher if running\nGet-Process | Where-Object { $_.CommandLine -like "*openclaw_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\n\n# Start watcher in background\n$skillInsightDir = Join-Path $env:USERPROFILE ".agent-insight"\n$logFile = Join-Path $skillInsightDir "logs\\openclaw_watcher.log"\n$scriptPath = Join-Path $skillInsightDir "openclaw_watcher_client.ts"\n\nStart-Process -FilePath "npx" -ArgumentList "-y", "tsx", $scriptPath -NoNewWindow -RedirectStandardOutput $logFile -RedirectStandardError $logFile\nWrite-Host "OpenClaw watcher started"\n\'@\n $startOpenclawPath = Join-Path $skillInsightDir "start_openclaw_watcher.ps1"\n Set-Content -Path $startOpenclawPath -Value $startOpenclawScript -Encoding UTF8\n Write-Host "โ
OpenClaw watcher start script created"\n\n # OpenClaw Watcher Stop Script\n $stopOpenclawScript = @\'\nWrite-Host "Stopping OpenClaw watcher..."\nGet-Process | Where-Object { $_.CommandLine -like "*openclaw_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nWrite-Host "OpenClaw watcher stopped"\n\'@\n $stopOpenclawPath = Join-Path $skillInsightDir "stop_openclaw_watcher.ps1"\n Set-Content -Path $stopOpenclawPath -Value $stopOpenclawScript -Encoding UTF8\n Write-Host "โ
OpenClaw watcher stop script created"\n }\n\n # Combined Start Script\n $startLines = @()\n $startLines += \'Write-Host "Starting Skill-Insight watchers..."\'\n if ($INSTALL_OPENCLAW) {\n $startLines += \'powershell -File "\' + $skillInsightDir + \'\\start_openclaw_watcher.ps1"\'\n }\n $startLines += \'Write-Host "All watchers started!"\'\n $startLines -join [char]10 | Set-Content -Path (Join-Path $skillInsightDir "start_watchers.ps1") -Encoding UTF8\n Write-Host "โ
Combined start script created"\n\n # Combined Stop Script\n $stopLines = @()\n $stopLines += \'Write-Host "Stopping Skill-Insight watchers..."\'\n if ($INSTALL_OPENCLAW) {\n $stopLines += \'powershell -File "\' + $skillInsightDir + \'\\stop_openclaw_watcher.ps1"\'\n }\n $stopLines += \'Write-Host "All watchers stopped!"\'\n $stopLines -join [char]10 | Set-Content -Path (Join-Path $skillInsightDir "stop_watchers.ps1") -Encoding UTF8\n Write-Host "โ
Combined stop script created"\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 & (Join-Path $skillInsightDir "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 "๐ Skill-Insight Telemetry: READY"\nWrite-Host "------------------------------------------------"\nWrite-Host "Installed Components:"\nif ($INSTALL_OPENCODE) {\n Write-Host " โ
OpenCode Plugin: ~/.opencode/plugins/Witty-Skill-Insight.ts"\n}\nif ($INSTALL_CLAUDE) {\n Write-Host " โ
Claude Code OTel: ~/.agent-insight/claude_otel_env.ps1"\n}\nif ($INSTALL_HERMES) {\n $summaryHermesHome = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $env:USERPROFILE ".hermes" }\n Write-Host " โ
Hermes OTel Plugin: $summaryHermesHome\\plugins\\hermes_otel\\config.yaml"\n}\nif ($INSTALL_OPENCLAW) {\n Write-Host " โ
OpenClaw Watcher: ~/.agent-insight/openclaw_watcher_client.ts"\n}\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 if ($INSTALL_OPENCLAW) {\n Write-Host " Start OpenClaw: ~/.agent-insight/start_openclaw_watcher.ps1"\n Write-Host " Stop OpenClaw: ~/.agent-insight/stop_openclaw_watcher.ps1"\n }\n Write-Host " Logs: ~/.agent-insight/logs/"\n}\n\nWrite-Host ""\nWrite-Host "Usage:"\nif ($INSTALL_OPENCODE) {\n Write-Host " 1. Run: opencode run \'hello\'"\n}\nif ($INSTALL_CLAUDE) {\n Write-Host " 2. Restart PowerShell, then run: claude"\n}\nif ($INSTALL_HERMES) {\n Write-Host " 3. Restart Hermes or start a new Hermes conversation"\n}\nif ($INSTALL_OPENCLAW) {\n Write-Host " 4. OpenClaw will automatically monitor and upload telemetry"\n}\nWrite-Host "------------------------------------------------"'].join("\n"),new O.NextResponse("\uFEFF"+o,{headers:{"Content-Type":"application/x-powershell; charset=utf-8"}})):(t=I,n=_,i=E,s=`#!/bin/bash
|
|
1
|
+
module.exports=[868578,e=>{"use strict";var t=e.i(747909),n=e.i(174017),i=e.i(996250),o=e.i(759756),s=e.i(561916),a=e.i(174677),r=e.i(869741),l=e.i(316795),_=e.i(487718),E=e.i(995169),c=e.i(47587),h=e.i(666012),I=e.i(570101),p=e.i(626937),d=e.i(10372),S=e.i(193695);e.i(52474);var T=e.i(600220),u=e.i(89171);async function g(e){var t,n,i;let o,s,a,r,{searchParams:l}=new URL(e.url),_=l.get("apiKey"),E=l.get("host");if(!_||!E)return new u.NextResponse("Missing required parameters: apiKey and host",{status:400,headers:{"Content-Type":"text/plain"}});let c=e.headers.get("host")||"127.0.0.1:3000",h=e.headers.get("x-forwarded-proto")||"http",I=new URL(e.url).pathname.replace(/\/api\/setup\/auto\/?$/,""),p=`${h}://${c}${I}`;return"windows"==(a=e.headers.get("user-agent")||"",(r=e.headers.get("x-platform")||"")?"windows"===r.toLowerCase()?"windows":"unix":/windows|win32|win64/i.test(a)?"windows":"unix")?(o=["# =============================================================================\n# Skill-insight Auto Setup (Non-Interactive) - PowerShell\n# =============================================================================\n",'$AGENT_INSIGHT_HOST = "'+E+'"','$AGENT_INSIGHT_BASE_URL = "'+p+'"','$AGENT_INSIGHT_API_KEY = "'+_+'"','\nWrite-Host "๐ Fetching Skill-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 " Skill-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 " Skill-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$skillInsightDir = Join-Path $env:USERPROFILE ".agent-insight"\n$skillInsightLogsDir = Join-Path $skillInsightDir "logs"\n$opencodePluginsDir = Join-Path $env:USERPROFILE ".opencode\\plugins"\n$opencodeSkillsDir = Join-Path $env:USERPROFILE ".opencode\\skills"\n$claudeProjectsDir = Join-Path $env:USERPROFILE ".claude\\projects"\n$openclawAgentsDir = Join-Path $env:USERPROFILE ".openclaw\\agents"\n\nNew-Item -ItemType Directory -Force -Path $skillInsightDir | Out-Null\nNew-Item -ItemType Directory -Force -Path $skillInsightLogsDir | Out-Null\nNew-Item -ItemType Directory -Force -Path $opencodePluginsDir | Out-Null\nNew-Item -ItemType Directory -Force -Path $opencodeSkillsDir | Out-Null\nNew-Item -ItemType Directory -Force -Path $claudeProjectsDir | Out-Null\nNew-Item -ItemType Directory -Force -Path $openclawAgentsDir | Out-Null\nNew-Item -ItemType Directory -Force -Path ".opencode\\skills" | Out-Null\nWrite-Host "๐ Created necessary directories"\n\n# 2. Interactive Framework Selection with inquirer\nWrite-Host ""\n\n$SELECTOR_SCRIPT = Join-Path $skillInsightDir "framework_selector.mjs"\n$SELECTOR_RESULT = Join-Path $skillInsightDir ".selector_result"\n\n# Install inquirer and tsx if not already installed\nSet-Location $skillInsightDir\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$selectorLines = @(\n "import inquirer from \'inquirer\';"\n "import fs from \'fs\';"\n ""\n "const frameworks = ["\n " { name: \'OpenCode\', value: \'opencode\' },"\n " { name: \'Claude Code\', value: \'claude\' },"\n " { name: \'Hermes\', value: \'hermes\' },"\n " { name: \'OpenClaw\', value: \'openclaw\' }"\n "];"\n ""\n "async 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\', \'โ โจ Skill-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 " 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 " // Write result to file for PowerShell to read"\n " const resultFile = process.env.SELECTOR_RESULT_FILE || process.env.USERPROFILE + \'\\\\.agent-insight\\\\.selector_result\';"\n " fs.writeFileSync(resultFile, selected.join(\',\'));"\n "}"\n ""\n "select().catch(err => {"\n " console.error(\'Error:\', err);"\n " process.exit(1);"\n "});"\n)\n$selectorContent = $selectorLines -join [char]10\nSet-Content -Path $SELECTOR_SCRIPT -Value $selectorContent -Encoding UTF8\n\n# Run the selector interactively\n$env:SELECTOR_RESULT_FILE = $SELECTOR_RESULT\nSet-Location $skillInsightDir\n./node_modules/.bin/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\n# Set installation flags based on selection\n$INSTALL_OPENCODE = $false\n$INSTALL_CLAUDE = $false\n$INSTALL_HERMES = $false\n$INSTALL_OPENCLAW = $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 "openclaw") {\n $INSTALL_OPENCLAW = $true\n}\n\n# Exit if nothing selected\nif (-not $INSTALL_OPENCODE -and -not $INSTALL_CLAUDE -and -not $INSTALL_HERMES -and -not $INSTALL_OPENCLAW) {\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 = if ($env:XDG_CONFIG_HOME) { Join-Path $env:XDG_CONFIG_HOME "opencode" } elseif ($env:APPDATA) { Join-Path $env:APPDATA "opencode" } else { Join-Path $env:USERPROFILE ".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 $opencodePluginsDir "Skill-Insight.ts") -Force -ErrorAction SilentlyContinue\n Remove-Item -Path (Join-Path $opencodePluginsDir "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 Copy-Item (Join-Path $opencodeConfigDir "plugins\\Witty-Skill-Insight.ts") (Join-Path $opencodePluginsDir "Witty-Skill-Insight.ts") -Force -ErrorAction SilentlyContinue\n Write-Host "โฌ Downloading OpenCode Uploader..."\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/opencode-uploader" -OutFile (Join-Path $skillInsightDir "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 Copy-Item $tuiPluginPath (Join-Path $opencodePluginsDir "Witty-Skill-Insight.tui.tsx") -Force -ErrorAction SilentlyContinue\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 $env:USERPROFILE ".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_OPENCLAW) {\n Write-Host "โฌ Downloading OpenClaw Watcher..."\n Invoke-WebRequest -Uri "$AGENT_INSIGHT_BASE_URL/api/setup/openclaw-watcher" -OutFile (Join-Path $skillInsightDir "openclaw_watcher_client.ts")\n}\n\n# 4. Configure ~/.agent-insight/.env (Auto mode - no interaction)\n$AGENT_INSIGHT_CONFIG_FILE = Join-Path $skillInsightDir ".env"\n\nWrite-Host "โ๏ธ Updating configuration..."\nif (Test-Path $AGENT_INSIGHT_CONFIG_FILE) {\n $existingContent = Get-Content $AGENT_INSIGHT_CONFIG_FILE\n $existingShow = ($existingContent | Where-Object { $_ -match "^AGENT_INSIGHT_SHOW_TASK_STATS=" } | Select-Object -First 1)\n $showValue = "true"\n if ($existingShow) { $showValue = ($existingShow -split "=", 2)[1] }\n $filteredContent = $existingContent | 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=" }\n Set-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value $filteredContent\n} else {\n New-Item -ItemType File -Path $AGENT_INSIGHT_CONFIG_FILE -Force | Out-Null\n $showValue = "true"\n}\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_HOST=$AGENT_INSIGHT_HOST"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_API_KEY=$AGENT_INSIGHT_API_KEY"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_SHOW_TASK_STATS=$showValue"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_RETENTION_DAYS=10"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_OPENCODE_OTEL_ENABLE=true"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_OPENCODE_SPOOL_DIR=$skillInsightDir\\otel_data\\opencode"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_OPENCODE_UPLOADER=$skillInsightDir\\opencode_uploader_client.js"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_CLAUDE_OTEL_SPOOL_DIR=$skillInsightDir\\otel_data\\claude"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_CLAUDE_OTEL_RAW_API_BODIES=file:$skillInsightDir\\claude_raw_bodies"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_MAX_TOOL_IO=4000"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_MAX_EVENT_STRING=20000"\nAdd-Content -Path $AGENT_INSIGHT_CONFIG_FILE -Value "AGENT_INSIGHT_OPENCODE_UPLOAD_COOLDOWN_MS=15000"\nWrite-Host "โ
Configuration updated at $AGENT_INSIGHT_CONFIG_FILE"\nWrite-Host " AGENT_INSIGHT_HOST=$AGENT_INSIGHT_HOST"\nWrite-Host " AGENT_INSIGHT_API_KEY=********"\n\n# 6.4 Configure Agent Insight Hermes plugin\nif ($INSTALL_HERMES) {\n $hermesHome = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $env:USERPROFILE ".hermes" }\n $hermesPluginDir = Join-Path $hermesHome "plugins\\agent_insight_hermes"\n New-Item -ItemType Directory -Path $hermesPluginDir -Force | Out-Null\n $hermesConfig = @{ host = $AGENT_INSIGHT_HOST.TrimEnd("/"); api_key = $AGENT_INSIGHT_API_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. Install Watcher Dependencies (only if OpenClaw watcher is selected)\nif ($INSTALL_OPENCLAW) {\n Write-Host ""\n Write-Host "๐ฆ Installing watcher dependencies..."\n if (Get-Command npm -ErrorAction SilentlyContinue) {\n Set-Location $skillInsightDir\n if (-not (Test-Path "package.json")) {\n \'{"name": "skill-insight-watcher", "version": "1.0.0", "type": "module", "dependencies": {}}\' | Out-File -FilePath "package.json" -Encoding utf8\n }\n npm install chokidar --save 2>$null\n Write-Host "โ
Dependencies installed"\n } else {\n Write-Host "โ ๏ธ npm not found. Skipping dependency installation."\n }\n}\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 = Join-Path $skillInsightDir "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 if (-not (Test-Path $PROFILE) -or -not ((Get-Content $PROFILE -Raw) -match "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 (Join-Path $skillInsightDir "claude_watcher_client.ts"), (Join-Path $skillInsightDir "start_claude_watcher.ps1"), (Join-Path $skillInsightDir "stop_claude_watcher.ps1"), (Join-Path $skillInsightDir "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 = $INSTALL_OPENCLAW\n\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "๐ Creating watcher management scripts..."\n\n # OpenClaw Watcher Start Script\n if ($INSTALL_OPENCLAW) {\n $startOpenclawScript = @\'\n# Stop existing watcher if running\nGet-Process | Where-Object { $_.CommandLine -like "*openclaw_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\n\n# Start watcher in background\n$skillInsightDir = Join-Path $env:USERPROFILE ".agent-insight"\n$logFile = Join-Path $skillInsightDir "logs\\openclaw_watcher.log"\n$scriptPath = Join-Path $skillInsightDir "openclaw_watcher_client.ts"\n\nStart-Process -FilePath "npx" -ArgumentList "-y", "tsx", $scriptPath -NoNewWindow -RedirectStandardOutput $logFile -RedirectStandardError $logFile\nWrite-Host "OpenClaw watcher started"\n\'@\n $startOpenclawPath = Join-Path $skillInsightDir "start_openclaw_watcher.ps1"\n Set-Content -Path $startOpenclawPath -Value $startOpenclawScript -Encoding UTF8\n Write-Host "โ
OpenClaw watcher start script created"\n\n # OpenClaw Watcher Stop Script\n $stopOpenclawScript = @\'\nWrite-Host "Stopping OpenClaw watcher..."\nGet-Process | Where-Object { $_.CommandLine -like "*openclaw_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nWrite-Host "OpenClaw watcher stopped"\n\'@\n $stopOpenclawPath = Join-Path $skillInsightDir "stop_openclaw_watcher.ps1"\n Set-Content -Path $stopOpenclawPath -Value $stopOpenclawScript -Encoding UTF8\n Write-Host "โ
OpenClaw watcher stop script created"\n }\n\n # Combined Start Script\n $startLines = @()\n $startLines += \'Write-Host "Starting Skill-Insight watchers..."\'\n if ($INSTALL_OPENCLAW) {\n $startLines += \'powershell -File "\' + $skillInsightDir + \'\\start_openclaw_watcher.ps1"\'\n }\n $startLines += \'Write-Host "All watchers started!"\'\n $startLines -join [char]10 | Set-Content -Path (Join-Path $skillInsightDir "start_watchers.ps1") -Encoding UTF8\n Write-Host "โ
Combined start script created"\n\n # Combined Stop Script\n $stopLines = @()\n $stopLines += \'Write-Host "Stopping Skill-Insight watchers..."\'\n if ($INSTALL_OPENCLAW) {\n $stopLines += \'powershell -File "\' + $skillInsightDir + \'\\stop_openclaw_watcher.ps1"\'\n }\n $stopLines += \'Write-Host "All watchers stopped!"\'\n $stopLines -join [char]10 | Set-Content -Path (Join-Path $skillInsightDir "stop_watchers.ps1") -Encoding UTF8\n Write-Host "โ
Combined stop script created"\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 & (Join-Path $skillInsightDir "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 "๐ Skill-Insight Telemetry: READY"\nWrite-Host "------------------------------------------------"\nWrite-Host "Installed Components:"\nif ($INSTALL_OPENCODE) {\n Write-Host " โ
OpenCode Plugin: ~/.opencode/plugins/Witty-Skill-Insight.ts"\n}\nif ($INSTALL_CLAUDE) {\n Write-Host " โ
Claude Code OTel: ~/.agent-insight/claude_otel_env.ps1"\n}\nif ($INSTALL_HERMES) {\n $summaryHermesHome = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $env:USERPROFILE ".hermes" }\n Write-Host " โ
Agent Insight Hermes Plugin: $summaryHermesHome\\plugins\\agent_insight_hermes\\config.json"\n}\nif ($INSTALL_OPENCLAW) {\n Write-Host " โ
OpenClaw Watcher: ~/.agent-insight/openclaw_watcher_client.ts"\n}\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 if ($INSTALL_OPENCLAW) {\n Write-Host " Start OpenClaw: ~/.agent-insight/start_openclaw_watcher.ps1"\n Write-Host " Stop OpenClaw: ~/.agent-insight/stop_openclaw_watcher.ps1"\n }\n Write-Host " Logs: ~/.agent-insight/logs/"\n}\n\nWrite-Host ""\nWrite-Host "Usage:"\nif ($INSTALL_OPENCODE) {\n Write-Host " 1. Run: opencode run \'hello\'"\n}\nif ($INSTALL_CLAUDE) {\n Write-Host " 2. Restart PowerShell, then run: claude"\n}\nif ($INSTALL_HERMES) {\n Write-Host " 3. Restart Hermes or start a new Hermes conversation"\n}\nif ($INSTALL_OPENCLAW) {\n Write-Host " 4. OpenClaw will automatically monitor and upload telemetry"\n}\nWrite-Host "------------------------------------------------"'].join("\n"),new u.NextResponse("\uFEFF"+o,{headers:{"Content-Type":"application/x-powershell; charset=utf-8"}})):(t=p,n=E,i=_,s=`#!/bin/bash
|
|
2
2
|
# =============================================================================
|
|
3
3
|
# Agent-insight Auto Setup (Non-Interactive)
|
|
4
4
|
# =============================================================================
|
|
@@ -198,33 +198,31 @@ if [ "$INSTALL_CLAUDE" = "true" ]; then
|
|
|
198
198
|
fi
|
|
199
199
|
|
|
200
200
|
if [ "$INSTALL_HERMES" = "true" ]; then
|
|
201
|
-
echo "Installing Hermes
|
|
201
|
+
echo "Installing Agent Insight Hermes plugin..."
|
|
202
202
|
HERMES_HOME="\${HERMES_HOME:-$HOME/.hermes}"
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
HERMES_PLUGIN_DIR="$HERMES_HOME/plugins/agent_insight_hermes"
|
|
204
|
+
mkdir -p "$HERMES_PLUGIN_DIR"
|
|
205
|
+
curl -sSf "$AGENT_INSIGHT_BASE_URL/api/setup/hermes-plugin" -o "$HERMES_PLUGIN_DIR/__init__.py"
|
|
206
|
+
cat > "$HERMES_PLUGIN_DIR/plugin.yaml" <<'HERMES_PLUGIN_EOF'
|
|
207
|
+
name: agent_insight_hermes
|
|
208
|
+
version: 0.2.0
|
|
209
|
+
description: Agent Insight telemetry for Hermes
|
|
210
|
+
provides_hooks:
|
|
211
|
+
- pre_llm_call
|
|
212
|
+
- post_llm_call
|
|
213
|
+
- pre_api_request
|
|
214
|
+
- post_api_request
|
|
215
|
+
- api_request_error
|
|
216
|
+
- pre_tool_call
|
|
217
|
+
- post_tool_call
|
|
218
|
+
- subagent_start
|
|
219
|
+
- subagent_stop
|
|
220
|
+
- on_session_end
|
|
221
|
+
HERMES_PLUGIN_EOF
|
|
205
222
|
if command -v hermes >/dev/null 2>&1; then
|
|
206
|
-
hermes plugins
|
|
223
|
+
hermes plugins enable agent_insight_hermes || echo "Warning: enable the plugin manually with: hermes plugins enable agent_insight_hermes"
|
|
207
224
|
else
|
|
208
|
-
echo "Warning: hermes command not found.
|
|
209
|
-
fi
|
|
210
|
-
mkdir -p "$HERMES_OTEL_PLUGIN_DIR"
|
|
211
|
-
HERMES_PIP=""
|
|
212
|
-
if [ -x "$HERMES_AGENT_DIR/venv/bin/pip" ]; then
|
|
213
|
-
HERMES_PIP="$HERMES_AGENT_DIR/venv/bin/pip"
|
|
214
|
-
fi
|
|
215
|
-
for HERMES_VENV in "\${HERMES_AGENT_VENV:-}" "\${HERMES_VENV:-}" "$HOME/git/hermes-agent/venv" "$HOME/agent/hermes-agent/venv"; do
|
|
216
|
-
if [ -z "$HERMES_PIP" ] && [ -n "$HERMES_VENV" ] && [ -x "$HERMES_VENV/bin/pip" ]; then
|
|
217
|
-
HERMES_PIP="$HERMES_VENV/bin/pip"
|
|
218
|
-
fi
|
|
219
|
-
done
|
|
220
|
-
if [ -n "$HERMES_PIP" ]; then
|
|
221
|
-
"$HERMES_PIP" install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http pyyaml
|
|
222
|
-
if [ -f "$HERMES_OTEL_PLUGIN_DIR/pyproject.toml" ] || [ -f "$HERMES_OTEL_PLUGIN_DIR/setup.py" ]; then
|
|
223
|
-
"$HERMES_PIP" install -e "$HERMES_OTEL_PLUGIN_DIR" || true
|
|
224
|
-
fi
|
|
225
|
-
echo "Hermes OTel dependencies installed with $HERMES_PIP"
|
|
226
|
-
else
|
|
227
|
-
echo "Warning: could not find hermes-agent venv pip under $HERMES_AGENT_DIR/venv, ~/git/hermes-agent/venv, or ~/agent/hermes-agent/venv. Set HERMES_AGENT_VENV=/path/to/venv and rerun setup if Hermes cannot load OTel dependencies."
|
|
225
|
+
echo "Warning: hermes command not found. The plugin files were installed; enable agent_insight_hermes after installing Hermes."
|
|
228
226
|
fi
|
|
229
227
|
fi
|
|
230
228
|
|
|
@@ -266,32 +264,22 @@ echo "โ
Configuration updated at $AGENT_INSIGHT_CONFIG_FILE"
|
|
|
266
264
|
echo " AGENT_INSIGHT_HOST=$AGENT_INSIGHT_HOST"
|
|
267
265
|
echo " AGENT_INSIGHT_API_KEY=********"
|
|
268
266
|
|
|
269
|
-
# 6.4 Configure Hermes
|
|
267
|
+
# 6.4 Configure Agent Insight Hermes plugin
|
|
270
268
|
if [ "$INSTALL_HERMES" = "true" ]; then
|
|
271
269
|
HERMES_HOME="\${HERMES_HOME:-$HOME/.hermes}"
|
|
272
|
-
|
|
273
|
-
mkdir -p "$
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
resource_attributes:
|
|
286
|
-
service.name: hermes
|
|
287
|
-
backends:
|
|
288
|
-
- type: otlp
|
|
289
|
-
name: agent-insight
|
|
290
|
-
endpoint: \${HERMES_OTEL_ENDPOINT}
|
|
291
|
-
headers:
|
|
292
|
-
x-witty-api-key: "\${AGENT_INSIGHT_API_KEY}"
|
|
293
|
-
HERMES_OTEL_CONFIG
|
|
294
|
-
echo "Hermes OTel config written to $HERMES_OTEL_PLUGIN_DIR/config.yaml"
|
|
270
|
+
HERMES_PLUGIN_DIR="$HERMES_HOME/plugins/agent_insight_hermes"
|
|
271
|
+
mkdir -p "$HERMES_PLUGIN_DIR"
|
|
272
|
+
cat > "$HERMES_PLUGIN_DIR/config.json" <<HERMES_CONFIG_EOF
|
|
273
|
+
{
|
|
274
|
+
"host": "\${AGENT_INSIGHT_HOST%/}",
|
|
275
|
+
"api_key": "$AGENT_INSIGHT_API_KEY",
|
|
276
|
+
"service_name": "hermes",
|
|
277
|
+
"max_content_chars": 200000,
|
|
278
|
+
"spool_dir": "$HOME/.agent-insight/data/hermes-otel-spool",
|
|
279
|
+
"log_file": "$HOME/.agent-insight/logs/hermes-plugin.log"
|
|
280
|
+
}
|
|
281
|
+
HERMES_CONFIG_EOF
|
|
282
|
+
echo "Agent Insight Hermes config written to $HERMES_PLUGIN_DIR/config.json"
|
|
295
283
|
fi
|
|
296
284
|
|
|
297
285
|
# 6. Install Watcher Dependencies (only if OpenClaw watcher is selected)
|
|
@@ -448,7 +436,7 @@ if [ "$INSTALL_CLAUDE" = "true" ]; then
|
|
|
448
436
|
echo " โ
Claude Code OTel: ~/.agent-insight/claude_otel_env.sh"
|
|
449
437
|
fi
|
|
450
438
|
if [ "$INSTALL_HERMES" = "true" ]; then
|
|
451
|
-
echo " โ
Hermes
|
|
439
|
+
echo " โ
Agent Insight Hermes Plugin: \${HERMES_HOME:-$HOME/.hermes}/plugins/agent_insight_hermes/config.json"
|
|
452
440
|
fi
|
|
453
441
|
if [ "$INSTALL_OPENCLAW" = "true" ]; then
|
|
454
442
|
echo " โ
OpenClaw Watcher: ~/.agent-insight/openclaw_watcher_client.ts"
|
|
@@ -481,6 +469,6 @@ if [ "$INSTALL_OPENCLAW" = "true" ]; then
|
|
|
481
469
|
echo " 4. OpenClaw will automatically monitor and upload telemetry"
|
|
482
470
|
fi
|
|
483
471
|
echo "------------------------------------------------"
|
|
484
|
-
`,new
|
|
472
|
+
`,new u.NextResponse(s,{headers:{"Content-Type":"text/x-shellscript"}}))}e.s(["GET",()=>g],423393);var O=e.i(423393);let N=new t.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/ingest/setup/auto/route",pathname:"/api/ingest/setup/auto",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/ingest/setup/auto/route.ts",nextConfigOutput:"standalone",userland:O}),{workAsyncStorage:$,workUnitAsyncStorage:A,serverHooks:L}=N;function C(){return(0,i.patchFetch)({workAsyncStorage:$,workUnitAsyncStorage:A})}async function m(e,t,i){N.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let u="/api/ingest/setup/auto/route";u=u.replace(/\/index$/,"")||"/";let g=await N.prepare(e,t,{srcPage:u,multiZoneDraftMode:!1});if(!g)return t.statusCode=400,t.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve()),null;let{buildId:O,params:$,nextConfig:A,parsedUrl:L,isDraftMode:C,prerenderManifest:m,routerServerContext:H,isOnDemandRevalidate:P,revalidateOnlyGenerated:f,resolvedPathname:G,clientReferenceManifest:R,serverActionsManifest:w}=g,D=(0,r.normalizeAppPath)(u),F=!!(m.dynamicRoutes[D]||m.routes[G]),v=async()=>((null==H?void 0:H.render404)?await H.render404(e,t,L,!1):t.end("This page could not be found"),null);if(F&&!C){let e=!!m.routes[G],t=m.dynamicRoutes[D];if(t&&!1===t.fallback&&!e){if(A.experimental.adapterPath)return await v();throw new S.NoFallbackError}}let W=null;!F||N.isDev||C||(W="/index"===(W=G)?"/":W);let M=!0===N.isDev||!F,y=F&&!M;w&&R&&(0,a.setManifestsSingleton)({page:u,clientReferenceManifest:R,serverActionsManifest:w});let k=e.method||"GET",U=(0,s.getTracer)(),x=U.getActiveScopeSpan(),b={params:$,prerenderManifest:m,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts},cacheComponents:!!A.cacheComponents,supportsDynamicResponse:M,incrementalCache:(0,o.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:A.cacheLife,waitUntil:i.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,n,i,o)=>N.onRequestError(e,t,i,o,H)},sharedContext:{buildId:O}},j=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),q=_.NextRequestAdapter.fromNodeNextRequest(j,(0,_.signalFromNodeResponse)(t));try{let a=async e=>N.handle(q,b).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let n=U.getRootSpanAttributes();if(!n)return;if(n.get("next.span_type")!==E.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${n.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let i=n.get("next.route");if(i){let t=`${k} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":t}),e.updateName(t)}else e.updateName(`${k} ${u}`)}),r=!!(0,o.getRequestMeta)(e,"minimalMode"),l=async o=>{var s,l;let _=async({previousCacheEntry:n})=>{try{if(!r&&P&&f&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await a(o);e.fetchMetrics=b.renderOpts.fetchMetrics;let l=b.renderOpts.pendingWaitUntil;l&&i.waitUntil&&(i.waitUntil(l),l=void 0);let _=b.renderOpts.collectedTags;if(!F)return await (0,h.sendResponse)(j,J,s,b.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,I.toNodeOutgoingHttpHeaders)(s.headers);_&&(t[d.NEXT_CACHE_TAGS_HEADER]=_),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let n=void 0!==b.renderOpts.collectedRevalidate&&!(b.renderOpts.collectedRevalidate>=d.INFINITE_CACHE)&&b.renderOpts.collectedRevalidate,i=void 0===b.renderOpts.collectedExpire||b.renderOpts.collectedExpire>=d.INFINITE_CACHE?void 0:b.renderOpts.collectedExpire;return{value:{kind:T.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:n,expire:i}}}}catch(t){throw(null==n?void 0:n.isStale)&&await N.onRequestError(e,t,{routerKind:"App Router",routePath:u,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:y,isOnDemandRevalidate:P})},!1,H),t}},E=await N.handleResponse({req:e,nextConfig:A,cacheKey:W,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:m,isRoutePPREnabled:!1,isOnDemandRevalidate:P,revalidateOnlyGenerated:f,responseGenerator:_,waitUntil:i.waitUntil,isMinimalMode:r});if(!F)return null;if((null==E||null==(s=E.value)?void 0:s.kind)!==T.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==E||null==(l=E.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});r||t.setHeader("x-nextjs-cache",P?"REVALIDATED":E.isMiss?"MISS":E.isStale?"STALE":"HIT"),C&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let S=(0,I.fromNodeOutgoingHttpHeaders)(E.value.headers);return r&&F||S.delete(d.NEXT_CACHE_TAGS_HEADER),!E.cacheControl||t.getHeader("Cache-Control")||S.get("Cache-Control")||S.set("Cache-Control",(0,p.getCacheControlHeader)(E.cacheControl)),await (0,h.sendResponse)(j,J,new Response(E.value.body,{headers:S,status:E.value.status||200})),null};x?await l(x):await U.withPropagatedContext(e.headers,()=>U.trace(E.BaseServerSpan.handleRequest,{spanName:`${k} ${u}`,kind:s.SpanKind.SERVER,attributes:{"http.method":k,"http.target":e.url}},l))}catch(t){if(t instanceof S.NoFallbackError||await N.onRequestError(e,t,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:y,isOnDemandRevalidate:P})},!1,H),F)throw t;return await (0,h.sendResponse)(j,J,new Response(null,{status:500})),null}}e.s(["handler",()=>m,"patchFetch",()=>C,"routeModule",()=>N,"serverHooks",()=>L,"workAsyncStorage",()=>$,"workUnitAsyncStorage",()=>A],868578)}];
|
|
485
473
|
|
|
486
474
|
//# sourceMappingURL=node_modules_next_dist_esm_build_templates_app-route_23ab65eb.js.map
|
|
@@ -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),r=e.i(174677),a=e.i(869741),l=e.i(316795),_=e.i(487718),E=e.i(995169),c=e.i(47587),I=e.i(666012),T=e.i(570101),d=e.i(626937),h=e.i(10372),S=e.i(193695);e.i(52474);var N=e.i(600220),p=e.i(89171);function O(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\$/g,"\\$").replace(/`/g,"\\`")}function u(e){return e.replace(/`/g,"``").replace(/"/g,'`"').replace(/\$/g,"`$")}async function $(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),r=process.env.NEXT_PUBLIC_URL_PREFIX||"",a=`${o}://${i}${r}`,l=s.searchParams.get("key")||s.searchParams.get("apiKey")||"";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=["# =============================================================================\n# Agent-insight One-Click Setup (PowerShell)\n# =============================================================================\n",'$AGENT_INSIGHT_HOST = "'+u(a)+'"','$AGENT_INSIGHT_BASE_URL = "'+u(a)+'"','$AGENT_INSIGHT_SETUP_API_KEY = "'+u(l)+'"','\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\\plugins" | 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. Interactive Framework Selection with inquirer\nWrite-Host ""\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];\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\n# Set installation flags based on selection\n$INSTALL_OPENCODE = $false\n$INSTALL_CLAUDE = $false\n$INSTALL_HERMES = $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}\n\n# Exit if nothing selected\nif (-not $INSTALL_OPENCODE -and -not $INSTALL_CLAUDE -and -not $INSTALL_HERMES) {\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 = if ($env:XDG_CONFIG_HOME) { Join-Path $env:XDG_CONFIG_HOME "opencode" } elseif ($env:APPDATA) { Join-Path $env:APPDATA "opencode" } else { 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 Copy-Item (Join-Path $opencodeConfigDir "plugins\\Witty-Skill-Insight.ts") "$homeDir\\.opencode\\plugins\\Witty-Skill-Insight.ts" -Force -ErrorAction SilentlyContinue\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 Copy-Item $tuiPluginPath "$homeDir\\.opencode\\plugins\\Witty-Skill-Insight.tui.tsx" -Force -ErrorAction SilentlyContinue\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 Hermes OTel plugin..."\n $hermesHome = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $homeDir ".hermes" }\n $hermesAgentDir = Join-Path $hermesHome "hermes-agent"\n $hermesOtelPluginDir = Join-Path $hermesHome "plugins\\hermes_otel"\n $hermesCmd = Get-Command hermes -ErrorAction SilentlyContinue\n if ($hermesCmd) {\n & $hermesCmd.Source plugins install briancaffey/hermes-otel --enable\n } else {\n Write-Host "Warning: hermes command not found. Install Hermes first, then rerun this setup or run: hermes plugins install briancaffey/hermes-otel"\n }\n New-Item -ItemType Directory -Path $hermesOtelPluginDir -Force | Out-Null\n $hermesPip = $null\n foreach ($rel in @("venv\\Scripts\\pip.exe", "venv\\bin\\pip")) {\n $candidate = Join-Path $hermesAgentDir $rel\n if (-not $hermesPip -and (Test-Path $candidate)) { $hermesPip = $candidate }\n }\n $venvCandidates = @($env:HERMES_AGENT_VENV, $env:HERMES_VENV, (Join-Path $homeDir "git\\hermes-agent\\venv"), (Join-Path $homeDir "agent\\hermes-agent\\venv"))\n foreach ($venv in $venvCandidates) {\n if (-not $hermesPip -and $venv) {\n foreach ($rel in @("Scripts\\pip.exe", "bin\\pip")) {\n $candidate = Join-Path $venv $rel\n if (Test-Path $candidate) { $hermesPip = $candidate; break }\n }\n }\n }\n if ($hermesPip) {\n & $hermesPip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http pyyaml\n if ((Test-Path (Join-Path $hermesOtelPluginDir "pyproject.toml")) -or (Test-Path (Join-Path $hermesOtelPluginDir "setup.py"))) {\n & $hermesPip install -e $hermesOtelPluginDir\n }\n Write-Host "Hermes OTel dependencies installed with $hermesPip"\n } else {\n Write-Host "Warning: could not find hermes-agent venv pip under $hermesAgentDir\\venv, ~/git/hermes-agent/venv, or ~/agent/hermes-agent/venv. Set HERMES_AGENT_VENV=/path/to/venv and rerun setup if Hermes cannot load OTel dependencies."\n }\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 = ""\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 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}\n\n# -- API Key Logic --\n$FINAL_KEY = if ($AGENT_INSIGHT_SETUP_API_KEY) { $AGENT_INSIGHT_SETUP_API_KEY } else { $EXISTING_KEY }\nif ($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 ($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 Write-Host "โ ๏ธ Warning: No API Key provided. Telemetry upload will fail until you set it in $AGENT_INSIGHT_CONFIG_FILE"\n}\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=\' } | 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_OPENCODE_SPOOL_DIR=$homeDir\\.agent-insight\\otel_data\\opencode"\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 Hermes OTel plugin\nif ($INSTALL_HERMES) {\n $hermesHome = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $homeDir ".hermes" }\n $hermesOtelPluginDir = Join-Path $hermesHome "plugins\\hermes_otel"\n New-Item -ItemType Directory -Path $hermesOtelPluginDir -Force | Out-Null\n $hermesOtelEndpoint = $FINAL_HOST\n if ($hermesOtelEndpoint -notmatch "^https?://") { $hermesOtelEndpoint = "http://$hermesOtelEndpoint" }\n $hermesOtelEndpoint = $hermesOtelEndpoint.TrimEnd("/") + "/api/ingest/otel/v1/traces"\n $hermesOtelConfig = @"\nenabled: true\ncapture_previews: true\npreview_max_chars: 4000\ncapture_conversation_history: true\nconversation_history_max_chars: 40000\ncapture_full_prompts: false\ncapture_full_responses: true\nresource_attributes:\n service.name: hermes\nbackends:\n - type: otlp\n name: agent-insight\n endpoint: $hermesOtelEndpoint\n headers:\n x-witty-api-key: "$FINAL_KEY"\n"@\n Set-Content -Path (Join-Path $hermesOtelPluginDir "config.yaml") -Value $hermesOtelConfig -Encoding UTF8\n Write-Host "Hermes OTel config written to $hermesOtelPluginDir\\config.yaml"\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 if (-not (Test-Path $PROFILE) -or -not ((Get-Content $PROFILE -Raw) -match "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: ~/.opencode/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 " โ
Hermes OTel Plugin: $summaryHermesHome\\plugins\\hermes_otel\\config.yaml" }\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");return new p.NextResponse(e,{headers:{"Content-Type":"text/plain; charset=utf-8"}})}{let e=["#!/bin/bash\n# =============================================================================\n# Agent-insight One-Click Setup\n# =============================================================================\n",'AGENT_INSIGHT_HOST="'+O(a)+'"','AGENT_INSIGHT_BASE_URL="'+O(a)+'"','AGENT_INSIGHT_SETUP_API_KEY="'+O(l)+'"','OPENCODE_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/opencode"\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 "$HOME/.opencode/plugins"\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. Interactive Framework Selection with inquirer\necho ""\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];\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\n\n# Set installation flags based on selection\nINSTALL_OPENCODE=false\nINSTALL_CLAUDE=false\nINSTALL_HERMES=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\n\n# Exit if nothing selected\nif [ "$INSTALL_OPENCODE" = "false" ] && [ "$INSTALL_CLAUDE" = "false" ] && [ "$INSTALL_HERMES" = "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 cp "$OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.ts" "$HOME/.opencode/plugins/Witty-Skill-Insight.ts" 2>/dev/null || true\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 cp "$OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.tui.tsx" "$HOME/.opencode/plugins/Witty-Skill-Insight.tui.tsx" 2>/dev/null || true\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 Hermes OTel plugin..."\n HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}"\n HERMES_AGENT_DIR="$HERMES_HOME/hermes-agent"\n HERMES_OTEL_PLUGIN_DIR="$HERMES_HOME/plugins/hermes_otel"\n if command -v hermes >/dev/null 2>&1; then\n hermes plugins install briancaffey/hermes-otel --enable || echo "Warning: hermes plugin install failed; will still write config if plugin dir exists."\n else\n echo "Warning: hermes command not found. Install Hermes first, then rerun this setup or run: hermes plugins install briancaffey/hermes-otel"\n fi\n mkdir -p "$HERMES_OTEL_PLUGIN_DIR"\n HERMES_PIP=""\n if [ -x "$HERMES_AGENT_DIR/venv/bin/pip" ]; then\n HERMES_PIP="$HERMES_AGENT_DIR/venv/bin/pip"\n fi\n for HERMES_VENV in "${HERMES_AGENT_VENV:-}" "${HERMES_VENV:-}" "$HOME/git/hermes-agent/venv" "$HOME/agent/hermes-agent/venv"; do\n if [ -z "$HERMES_PIP" ] && [ -n "$HERMES_VENV" ] && [ -x "$HERMES_VENV/bin/pip" ]; then\n HERMES_PIP="$HERMES_VENV/bin/pip"\n fi\n done\n if [ -n "$HERMES_PIP" ]; then\n "$HERMES_PIP" install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http pyyaml\n if [ -f "$HERMES_OTEL_PLUGIN_DIR/pyproject.toml" ] || [ -f "$HERMES_OTEL_PLUGIN_DIR/setup.py" ]; then\n "$HERMES_PIP" install -e "$HERMES_OTEL_PLUGIN_DIR" || true\n fi\n echo "Hermes OTel dependencies installed with $HERMES_PIP"\n else\n echo "Warning: could not find hermes-agent venv pip under $HERMES_AGENT_DIR/venv, ~/git/hermes-agent/venv, or ~/agent/hermes-agent/venv. Set HERMES_AGENT_VENV=/path/to/venv and rerun setup if Hermes cannot load OTel dependencies."\n fi\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-)\nfi\n\n# -- API Key Logic --\nFINAL_KEY="${AGENT_INSIGHT_SETUP_API_KEY:-$EXISTING_KEY}"\nif [ -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 [ -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 echo "โ ๏ธ Warning: No API Key provided. Telemetry upload will fail until you set it in $AGENT_INSIGHT_CONFIG_FILE"\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=" > "$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_OPENCODE_SPOOL_DIR=$HOME/.agent-insight/otel_data/opencode" >> "$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 Hermes OTel plugin\nif [ "$INSTALL_HERMES" = "true" ]; then\n HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}"\n HERMES_OTEL_PLUGIN_DIR="$HERMES_HOME/plugins/hermes_otel"\n mkdir -p "$HERMES_OTEL_PLUGIN_DIR"\n HERMES_OTEL_ENDPOINT="$FINAL_HOST"\n case "$HERMES_OTEL_ENDPOINT" in http://*|https://*) ;; *) HERMES_OTEL_ENDPOINT="http://$HERMES_OTEL_ENDPOINT" ;; esac\n HERMES_OTEL_ENDPOINT="${HERMES_OTEL_ENDPOINT%/}/api/ingest/otel/v1/traces"\n cat > "$HERMES_OTEL_PLUGIN_DIR/config.yaml" << HERMES_OTEL_CONFIG\nenabled: true\ncapture_previews: true\npreview_max_chars: 4000\ncapture_conversation_history: true\nconversation_history_max_chars: 40000\ncapture_full_prompts: false\ncapture_full_responses: true\nresource_attributes:\n service.name: hermes\nbackends:\n - type: otlp\n name: agent-insight\n endpoint: ${HERMES_OTEL_ENDPOINT}\n headers:\n x-witty-api-key: "${FINAL_KEY}"\nHERMES_OTEL_CONFIG\n echo "Hermes OTel config written to $HERMES_OTEL_PLUGIN_DIR/config.yaml"\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 "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/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 " โ
Hermes OTel Plugin: ${HERMES_HOME:-$HOME/.hermes}/plugins/hermes_otel/config.yaml"; 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");return new p.NextResponse(e,{headers:{"Content-Type":"text/x-shellscript"}})}}e.s(["GET",()=>$],640112);var g=e.i(640112);let m=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:g}),{workAsyncStorage:A,workUnitAsyncStorage:H,serverHooks:L}=m;function G(){return(0,i.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:H})}async function C(e,n,i){m.isDev&&(0,o.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let p="/api/ingest/setup/route";p=p.replace(/\/index$/,"")||"/";let O=await m.prepare(e,n,{srcPage:p,multiZoneDraftMode:!1});if(!O)return n.statusCode=400,n.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve()),null;let{buildId:u,params:$,nextConfig:g,parsedUrl:A,isDraftMode:H,prerenderManifest:L,routerServerContext:G,isOnDemandRevalidate:C,revalidateOnlyGenerated:f,resolvedPathname:R,clientReferenceManifest:P,serverActionsManifest:D}=O,v=(0,a.normalizeAppPath)(p),F=!!(L.dynamicRoutes[v]||L.routes[R]),y=async()=>((null==G?void 0:G.render404)?await G.render404(e,n,A,!1):n.end("This page could not be found"),null);if(F&&!H){let e=!!L.routes[R],n=L.dynamicRoutes[v];if(n&&!1===n.fallback&&!e){if(g.experimental.adapterPath)return await y();throw new S.NoFallbackError}}let w=null;!F||m.isDev||H||(w="/index"===(w=R)?"/":w);let M=!0===m.isDev||!F,W=F&&!M;D&&P&&(0,r.setManifestsSingleton)({page:p,clientReferenceManifest:P,serverActionsManifest:D});let U=e.method||"GET",x=(0,s.getTracer)(),b=x.getActiveScopeSpan(),k={params:$,prerenderManifest:L,renderOpts:{experimental:{authInterrupts:!!g.experimental.authInterrupts},cacheComponents:!!g.cacheComponents,supportsDynamicResponse:M,incrementalCache:(0,o.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:g.cacheLife,waitUntil:i.waitUntil,onClose:e=>{n.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(n,t,i,o)=>m.onRequestError(e,n,i,o,G)},sharedContext:{buildId:u}},K=new l.NodeNextRequest(e),j=new l.NodeNextResponse(n),X=_.NextRequestAdapter.fromNodeNextRequest(K,(0,_.signalFromNodeResponse)(n));try{let r=async e=>m.handle(X,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")!==E.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=`${U} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":n}),e.updateName(n)}else e.updateName(`${U} ${p}`)}),a=!!(0,o.getRequestMeta)(e,"minimalMode"),l=async o=>{var s,l;let _=async({previousCacheEntry:t})=>{try{if(!a&&C&&f&&!t)return n.statusCode=404,n.setHeader("x-nextjs-cache","REVALIDATED"),n.end("This page could not be found"),null;let s=await r(o);e.fetchMetrics=k.renderOpts.fetchMetrics;let l=k.renderOpts.pendingWaitUntil;l&&i.waitUntil&&(i.waitUntil(l),l=void 0);let _=k.renderOpts.collectedTags;if(!F)return await (0,I.sendResponse)(K,j,s,k.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),n=(0,T.toNodeOutgoingHttpHeaders)(s.headers);_&&(n[h.NEXT_CACHE_TAGS_HEADER]=_),!n["content-type"]&&e.type&&(n["content-type"]=e.type);let t=void 0!==k.renderOpts.collectedRevalidate&&!(k.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&k.renderOpts.collectedRevalidate,i=void 0===k.renderOpts.collectedExpire||k.renderOpts.collectedExpire>=h.INFINITE_CACHE?void 0:k.renderOpts.collectedExpire;return{value:{kind:N.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 m.onRequestError(e,n,{routerKind:"App Router",routePath:p,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:W,isOnDemandRevalidate:C})},!1,G),n}},E=await m.handleResponse({req:e,nextConfig:g,cacheKey:w,routeKind:t.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:L,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:f,responseGenerator:_,waitUntil:i.waitUntil,isMinimalMode:a});if(!F)return null;if((null==E||null==(s=E.value)?void 0:s.kind)!==N.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==E||null==(l=E.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});a||n.setHeader("x-nextjs-cache",C?"REVALIDATED":E.isMiss?"MISS":E.isStale?"STALE":"HIT"),H&&n.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let S=(0,T.fromNodeOutgoingHttpHeaders)(E.value.headers);return a&&F||S.delete(h.NEXT_CACHE_TAGS_HEADER),!E.cacheControl||n.getHeader("Cache-Control")||S.get("Cache-Control")||S.set("Cache-Control",(0,d.getCacheControlHeader)(E.cacheControl)),await (0,I.sendResponse)(K,j,new Response(E.value.body,{headers:S,status:E.value.status||200})),null};b?await l(b):await x.withPropagatedContext(e.headers,()=>x.trace(E.BaseServerSpan.handleRequest,{spanName:`${U} ${p}`,kind:s.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},l))}catch(n){if(n instanceof S.NoFallbackError||await m.onRequestError(e,n,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:W,isOnDemandRevalidate:C})},!1,G),F)throw n;return await (0,I.sendResponse)(K,j,new Response(null,{status:500})),null}}e.s(["handler",()=>C,"patchFetch",()=>G,"routeModule",()=>m,"serverHooks",()=>L,"workAsyncStorage",()=>A,"workUnitAsyncStorage",()=>H],901411)}];
|
|
1
|
+
module.exports=[901411,e=>{"use strict";var n=e.i(747909),t=e.i(174017),o=e.i(996250),i=e.i(759756),s=e.i(561916),r=e.i(174677),a=e.i(869741),_=e.i(316795),l=e.i(487718),E=e.i(995169),I=e.i(47587),c=e.i(666012),h=e.i(570101),T=e.i(626937),d=e.i(10372),S=e.i(193695);e.i(52474);var N=e.i(600220),g=e.i(89171);function u(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\$/g,"\\$").replace(/`/g,"\\`")}function p(e){return e.replace(/`/g,"``").replace(/"/g,'`"').replace(/\$/g,"`$")}async function O(e){let n,t,o=e.headers.get("x-forwarded-host")||e.headers.get("host")||"127.0.0.1:3000",i=e.headers.get("x-forwarded-proto")||"https",s=new URL(e.url),r=process.env.NEXT_PUBLIC_URL_PREFIX||"",a=`${i}://${o}${r}`,_=s.searchParams.get("key")||s.searchParams.get("apiKey")||"";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=["# =============================================================================\n# Agent-insight One-Click Setup (PowerShell)\n# =============================================================================\n",'$AGENT_INSIGHT_HOST = "'+p(a)+'"','$AGENT_INSIGHT_BASE_URL = "'+p(a)+'"','$AGENT_INSIGHT_SETUP_API_KEY = "'+p(_)+'"','\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\\plugins" | 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. Interactive Framework Selection with inquirer\nWrite-Host ""\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];\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\n# Set installation flags based on selection\n$INSTALL_OPENCODE = $false\n$INSTALL_CLAUDE = $false\n$INSTALL_HERMES = $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}\n\n# Exit if nothing selected\nif (-not $INSTALL_OPENCODE -and -not $INSTALL_CLAUDE -and -not $INSTALL_HERMES) {\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 = if ($env:XDG_CONFIG_HOME) { Join-Path $env:XDG_CONFIG_HOME "opencode" } elseif ($env:APPDATA) { Join-Path $env:APPDATA "opencode" } else { 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 Copy-Item (Join-Path $opencodeConfigDir "plugins\\Witty-Skill-Insight.ts") "$homeDir\\.opencode\\plugins\\Witty-Skill-Insight.ts" -Force -ErrorAction SilentlyContinue\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 Copy-Item $tuiPluginPath "$homeDir\\.opencode\\plugins\\Witty-Skill-Insight.tui.tsx" -Force -ErrorAction SilentlyContinue\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\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 = ""\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 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}\n\n# -- API Key Logic --\n$FINAL_KEY = if ($AGENT_INSIGHT_SETUP_API_KEY) { $AGENT_INSIGHT_SETUP_API_KEY } else { $EXISTING_KEY }\nif ($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 ($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 Write-Host "โ ๏ธ Warning: No API Key provided. Telemetry upload will fail until you set it in $AGENT_INSIGHT_CONFIG_FILE"\n}\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=\' } | 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_OPENCODE_SPOOL_DIR=$homeDir\\.agent-insight\\otel_data\\opencode"\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}\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 if (-not (Test-Path $PROFILE) -or -not ((Get-Content $PROFILE -Raw) -match "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: ~/.opencode/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" }\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");return new g.NextResponse(e,{headers:{"Content-Type":"text/plain; charset=utf-8"}})}{let e=["#!/bin/bash\n# =============================================================================\n# Agent-insight One-Click Setup\n# =============================================================================\n",'AGENT_INSIGHT_HOST="'+u(a)+'"','AGENT_INSIGHT_BASE_URL="'+u(a)+'"','AGENT_INSIGHT_SETUP_API_KEY="'+u(_)+'"','OPENCODE_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/opencode"\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 "$HOME/.opencode/plugins"\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. Interactive Framework Selection with inquirer\necho ""\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];\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\n\n# Set installation flags based on selection\nINSTALL_OPENCODE=false\nINSTALL_CLAUDE=false\nINSTALL_HERMES=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\n\n# Exit if nothing selected\nif [ "$INSTALL_OPENCODE" = "false" ] && [ "$INSTALL_CLAUDE" = "false" ] && [ "$INSTALL_HERMES" = "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 cp "$OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.ts" "$HOME/.opencode/plugins/Witty-Skill-Insight.ts" 2>/dev/null || true\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 cp "$OPENCODE_CONFIG_DIR/plugins/Witty-Skill-Insight.tui.tsx" "$HOME/.opencode/plugins/Witty-Skill-Insight.tui.tsx" 2>/dev/null || true\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\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-)\nfi\n\n# -- API Key Logic --\nFINAL_KEY="${AGENT_INSIGHT_SETUP_API_KEY:-$EXISTING_KEY}"\nif [ -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 [ -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 echo "โ ๏ธ Warning: No API Key provided. Telemetry upload will fail until you set it in $AGENT_INSIGHT_CONFIG_FILE"\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=" > "$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_OPENCODE_SPOOL_DIR=$HOME/.agent-insight/otel_data/opencode" >> "$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.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 "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/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\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");return new g.NextResponse(e,{headers:{"Content-Type":"text/x-shellscript"}})}}e.s(["GET",()=>O],640112);var $=e.i(640112);let A=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:$}),{workAsyncStorage:m,workUnitAsyncStorage:H,serverHooks:L}=A;function G(){return(0,o.patchFetch)({workAsyncStorage:m,workUnitAsyncStorage:H})}async function C(e,n,o){A.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/ingest/setup/route";g=g.replace(/\/index$/,"")||"/";let u=await A.prepare(e,n,{srcPage:g,multiZoneDraftMode:!1});if(!u)return n.statusCode=400,n.end("Bad Request"),null==o.waitUntil||o.waitUntil.call(o,Promise.resolve()),null;let{buildId:p,params:O,nextConfig:$,parsedUrl:m,isDraftMode:H,prerenderManifest:L,routerServerContext:G,isOnDemandRevalidate:C,revalidateOnlyGenerated:f,resolvedPathname:R,clientReferenceManifest:P,serverActionsManifest:D}=u,F=(0,a.normalizeAppPath)(g),v=!!(L.dynamicRoutes[F]||L.routes[R]),y=async()=>((null==G?void 0:G.render404)?await G.render404(e,n,m,!1):n.end("This page could not be found"),null);if(v&&!H){let e=!!L.routes[R],n=L.dynamicRoutes[F];if(n&&!1===n.fallback&&!e){if($.experimental.adapterPath)return await y();throw new S.NoFallbackError}}let w=null;!v||A.isDev||H||(w="/index"===(w=R)?"/":w);let M=!0===A.isDev||!v,U=v&&!M;D&&P&&(0,r.setManifestsSingleton)({page:g,clientReferenceManifest:P,serverActionsManifest:D});let W=e.method||"GET",b=(0,s.getTracer)(),x=b.getActiveScopeSpan(),k={params:O,prerenderManifest:L,renderOpts:{experimental:{authInterrupts:!!$.experimental.authInterrupts},cacheComponents:!!$.cacheComponents,supportsDynamicResponse:M,incrementalCache:(0,i.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:$.cacheLife,waitUntil:o.waitUntil,onClose:e=>{n.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(n,t,o,i)=>A.onRequestError(e,n,o,i,G)},sharedContext:{buildId:p}},K=new _.NodeNextRequest(e),j=new _.NodeNextResponse(n),X=l.NextRequestAdapter.fromNodeNextRequest(K,(0,l.signalFromNodeResponse)(n));try{let r=async e=>A.handle(X,k).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":n.statusCode,"next.rsc":!1});let t=b.getRootSpanAttributes();if(!t)return;if(t.get("next.span_type")!==E.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 o=t.get("next.route");if(o){let n=`${W} ${o}`;e.setAttributes({"next.route":o,"http.route":o,"next.span_name":n}),e.updateName(n)}else e.updateName(`${W} ${g}`)}),a=!!(0,i.getRequestMeta)(e,"minimalMode"),_=async i=>{var s,_;let l=async({previousCacheEntry:t})=>{try{if(!a&&C&&f&&!t)return n.statusCode=404,n.setHeader("x-nextjs-cache","REVALIDATED"),n.end("This page could not be found"),null;let s=await r(i);e.fetchMetrics=k.renderOpts.fetchMetrics;let _=k.renderOpts.pendingWaitUntil;_&&o.waitUntil&&(o.waitUntil(_),_=void 0);let l=k.renderOpts.collectedTags;if(!v)return await (0,c.sendResponse)(K,j,s,k.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),n=(0,h.toNodeOutgoingHttpHeaders)(s.headers);l&&(n[d.NEXT_CACHE_TAGS_HEADER]=l),!n["content-type"]&&e.type&&(n["content-type"]=e.type);let t=void 0!==k.renderOpts.collectedRevalidate&&!(k.renderOpts.collectedRevalidate>=d.INFINITE_CACHE)&&k.renderOpts.collectedRevalidate,o=void 0===k.renderOpts.collectedExpire||k.renderOpts.collectedExpire>=d.INFINITE_CACHE?void 0:k.renderOpts.collectedExpire;return{value:{kind:N.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:n},cacheControl:{revalidate:t,expire:o}}}}catch(n){throw(null==t?void 0:t.isStale)&&await A.onRequestError(e,n,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,I.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:C})},!1,G),n}},E=await A.handleResponse({req:e,nextConfig:$,cacheKey:w,routeKind:t.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:L,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:f,responseGenerator:l,waitUntil:o.waitUntil,isMinimalMode:a});if(!v)return null;if((null==E||null==(s=E.value)?void 0:s.kind)!==N.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==E||null==(_=E.value)?void 0:_.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});a||n.setHeader("x-nextjs-cache",C?"REVALIDATED":E.isMiss?"MISS":E.isStale?"STALE":"HIT"),H&&n.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let S=(0,h.fromNodeOutgoingHttpHeaders)(E.value.headers);return a&&v||S.delete(d.NEXT_CACHE_TAGS_HEADER),!E.cacheControl||n.getHeader("Cache-Control")||S.get("Cache-Control")||S.set("Cache-Control",(0,T.getCacheControlHeader)(E.cacheControl)),await (0,c.sendResponse)(K,j,new Response(E.value.body,{headers:S,status:E.value.status||200})),null};x?await _(x):await b.withPropagatedContext(e.headers,()=>b.trace(E.BaseServerSpan.handleRequest,{spanName:`${W} ${g}`,kind:s.SpanKind.SERVER,attributes:{"http.method":W,"http.target":e.url}},_))}catch(n){if(n instanceof S.NoFallbackError||await A.onRequestError(e,n,{routerKind:"App Router",routePath:F,routeType:"route",revalidateReason:(0,I.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:C})},!1,G),v)throw n;return await (0,c.sendResponse)(K,j,new Response(null,{status:500})),null}}e.s(["handler",()=>C,"patchFetch",()=>G,"routeModule",()=>A,"serverHooks",()=>L,"workAsyncStorage",()=>m,"workUnitAsyncStorage",()=>H],901411)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=node_modules_next_dist_esm_build_templates_app-route_c4a195e5.js.map
|