@witty-ai/skill-insight 0.4.0-beta → 0.5.0-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/.env.example +50 -5
- 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/routes-manifest.json +6 -0
- package/.next/standalone/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +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 +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- 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/api/auth/organization/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/organization/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/auth/organization/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/organization/route.js +7 -0
- package/.next/standalone/.next/server/app/api/auth/organization/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/organization/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/organization/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/config/create/route.js +2 -2
- package/.next/standalone/.next/server/app/api/config/create/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/config/route.js +1 -1
- package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/data/route.js +1 -1
- package/.next/standalone/.next/server/app/api/data/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/executions/[executionId]/analyze-match/route.js +1 -1
- package/.next/standalone/.next/server/app/api/executions/[executionId]/analyze-match/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/otel/v1/logs/route.js +1 -1
- package/.next/standalone/.next/server/app/api/otel/v1/logs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/otel/v1/traces/route.js +1 -1
- package/.next/standalone/.next/server/app/api/otel/v1/traces/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/proxy/[taskId]/[...path]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/proxy/[taskId]/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/proxy/[taskId]/end/route.js +3 -3
- package/.next/standalone/.next/server/app/api/proxy/[taskId]/end/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/rejudge/route.js +1 -1
- package/.next/standalone/.next/server/app/api/rejudge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/session/route.js +3 -3
- package/.next/standalone/.next/server/app/api/session/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/settings/route.js +1 -1
- package/.next/standalone/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/download/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/parse-flow/route.js +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/parse-flow/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/logs/route.js +1 -1
- package/.next/standalone/.next/server/app/api/skills/logs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/upload/route.js +1 -1
- package/.next/standalone/.next/server/app/api/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/details/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/details/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/details.html +1 -1
- package/.next/standalone/.next/server/app/details.rsc +4 -4
- package/.next/standalone/.next/server/app/details.segments/_full.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/details.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/details.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/details.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/details.segments/details/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/details.segments/details.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/login/page.js.nft.json +1 -1
- 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 +4 -4
- package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +3 -3
- 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 +2 -2
- package/.next/standalone/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/skills/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- 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/_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 +3 -3
- package/.next/standalone/.next/server/app/skills.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/skills.segments/skills/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/skills.segments/skills.segment.rsc +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +1 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__02ddba88._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ce5e3b8._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4a6d443b._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__53775b48._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5444db55._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__6923eecf._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__98b3de5e._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a4d3d791._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__bd91659b._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c200214a._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d7fab946._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d8c1808b._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d9b9fecc._.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_organization_route_actions_f58710b7.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_c33286ed.js +2 -41
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_f42faeee.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_12408140._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__5d576168._.js → [root-of-the-server]__40353d98._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__89851212._.js → [root-of-the-server]__480fcd92._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__28978655._.js → [root-of-the-server]__48f8fbcb._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__a5ef0b61._.js → [root-of-the-server]__49921b2a._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__317833f9._.js → [root-of-the-server]__593be3d6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__ca101543._.js → [root-of-the-server]__5e9ff641._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__90641614._.js → [root-of-the-server]__66cc6ff2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__cda1e286._.js → [root-of-the-server]__9889bdc8._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__42ba97b6._.js → [root-of-the-server]__9905ca7a._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__9ab7cc4a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__7bb97139._.js → [root-of-the-server]__9d6b7d48._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__6b8b9bb9._.js → [root-of-the-server]__b8edc8c6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__b9972e88._.js → [root-of-the-server]__d691ecb0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__52851239._.js → [root-of-the-server]__e5ddfd15._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__9630dedf._.js → [root-of-the-server]__f72f330e._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__99ab66d7._.js → [root-of-the-server]__f843e085._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__d424fa04._.js → [root-of-the-server]__fd69d276._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_7688d7cd._.js → _049876f0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_72a74a0c._.js → _09546b95._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_8f5379ab._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_cf1f3d2c._.js → _b121f1ae._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_c8c8c083._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_fd46f439._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_f2653232._.js → node_modules_039c6a11._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_da87f0e3._.js → node_modules_0d3530cd._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_afb1ecef._.js → node_modules_0e883565._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_8d9e56b7._.js → node_modules_11dbf165._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_76d6c533._.js → node_modules_2041c122._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_b007145b._.js → node_modules_235267bb._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_11d81adf._.js → node_modules_25dfb0ba._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_4ea9b27b._.js → node_modules_2b12c669._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_cc19e85c._.js → node_modules_32996880._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_62621b34._.js → node_modules_35885fe9._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_ed4150ad._.js → node_modules_38a95353._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_f596a14c._.js → node_modules_3a317c51._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_fddab329._.js → node_modules_44966ab2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_e272ac31._.js → node_modules_53af751a._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_abf4f826._.js → node_modules_5f539891._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_86b6ffa4._.js → node_modules_60402210._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_3769cd60._.js → node_modules_60eccfb6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_fdf808cf._.js → node_modules_632c098c._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_442994dc._.js → node_modules_6c42f75c._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_5b6dbbc3._.js → node_modules_6fbe276d._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_6716e25d._.js → node_modules_740e9d59._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_ed1f1845._.js → node_modules_7a3d551c._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_4f41f172._.js → node_modules_861cb9cf._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_2aaea4ea._.js → node_modules_8a892761._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_3964c298._.js → node_modules_a5a4946e._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_3d9afa91._.js → node_modules_a712c937._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_330b9e3c._.js → node_modules_a8c276dd._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_ad69a9e4._.js → node_modules_acc9d529._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_8301968d._.js → node_modules_ad07ab39._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_1d88c7cc._.js → node_modules_b38efa22._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_e20e8c2a._.js → node_modules_b4ef036d._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_2e206c58._.js → node_modules_b6bad701._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_c90fa812._.js → node_modules_b9810024._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_db8af6e3._.js → node_modules_b9ad808d._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_7287189a._.js → node_modules_bc287d9f._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_2e38bc5c._.js → node_modules_c6469d93._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_c657890f._.js → node_modules_c704e802._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_b8803ba6._.js → node_modules_cda46cfc._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_aa6da06c._.js → node_modules_cf171d0c._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_2d9e03d1._.js → node_modules_e8927fc2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_login_page_tsx_72f58654._.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/static/chunks/1e782a49beaf489c.js +1 -0
- package/.next/standalone/.next/static/chunks/4071dbec4cf7e72e.js +109 -0
- package/.next/standalone/.next/static/chunks/67bd1a5de2195779.js +1 -0
- package/.next/standalone/.next/static/chunks/a87b5e84254095a5.js +1 -0
- package/.next/standalone/.next/static/chunks/c6bd2818656b1f20.css +1 -0
- package/.next/standalone/.next/static/chunks/{6d12c79948c7e0ac.js → dc59a07a8f327b40.js} +1 -1
- package/.next/standalone/next.config.ts +14 -2
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/scripts/opencode_plugin.ts +257 -36
- package/.next/static/chunks/1e782a49beaf489c.js +1 -0
- package/.next/static/chunks/4071dbec4cf7e72e.js +109 -0
- package/.next/static/chunks/67bd1a5de2195779.js +1 -0
- package/.next/static/chunks/a87b5e84254095a5.js +1 -0
- package/.next/static/chunks/c6bd2818656b1f20.css +1 -0
- package/.next/static/chunks/{6d12c79948c7e0ac.js → dc59a07a8f327b40.js} +1 -1
- package/package.json +1 -1
- package/scripts/opencode_plugin.ts +257 -36
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fceba52._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__13132848._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__30769f6e._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__426bc4ab._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__610d08bc._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__75e3674c._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__761462f8._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__9aa700a4._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b7ad2649._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c00180dd._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ed8f9b78._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__082c32a2._.js +0 -3
- package/.next/standalone/.next/static/chunks/222a937a6c859036.js +0 -1
- package/.next/standalone/.next/static/chunks/2a3dd49367e2c198.js +0 -1
- package/.next/standalone/.next/static/chunks/3e33f7adc10a38d3.js +0 -109
- package/.next/standalone/.next/static/chunks/428e6cf64b115e9d.css +0 -1
- package/.next/standalone/.next/static/chunks/62129f27f303a5ba.js +0 -1
- package/.next/static/chunks/222a937a6c859036.js +0 -1
- package/.next/static/chunks/2a3dd49367e2c198.js +0 -1
- package/.next/static/chunks/3e33f7adc10a38d3.js +0 -109
- package/.next/static/chunks/428e6cf64b115e9d.css +0 -1
- package/.next/static/chunks/62129f27f303a5ba.js +0 -1
- /package/.next/standalone/.next/static/{Eytv_Fh4x2HPaupjXiAYj → H581Rok68JtPV4bAVVH3l}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{Eytv_Fh4x2HPaupjXiAYj → H581Rok68JtPV4bAVVH3l}/_clientMiddlewareManifest.json +0 -0
- /package/.next/standalone/.next/static/{Eytv_Fh4x2HPaupjXiAYj → H581Rok68JtPV4bAVVH3l}/_ssgManifest.js +0 -0
- /package/.next/static/{Eytv_Fh4x2HPaupjXiAYj → H581Rok68JtPV4bAVVH3l}/_buildManifest.js +0 -0
- /package/.next/static/{Eytv_Fh4x2HPaupjXiAYj → H581Rok68JtPV4bAVVH3l}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{Eytv_Fh4x2HPaupjXiAYj → H581Rok68JtPV4bAVVH3l}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[77800,e=>{"use strict";function t(){let e=[],t=1;for(;;){let r=process.env[`DEFAULT_MODEL_${t}_NAME`],n=process.env[`DEFAULT_MODEL_${t}_PROVIDER`],s=process.env[`DEFAULT_MODEL_${t}_API_KEY`];if(!r||!n||!s)break;e.push({id:`default_${t}`,name:r,provider:n,apiKey:s,baseUrl:process.env[`DEFAULT_MODEL_${t}_BASE_URL`],model:process.env[`DEFAULT_MODEL_${t}_MODEL`]}),t++}return e}e.s(["loadDefaultModelConfigs",()=>t])},22965,e=>e.a(async(t,r)=>{try{var n=e.i(98043),s=e.i(77800),a=t([n]);async function i(e){let t=await o(e);return t&&t.activeConfigId&&t.configs.find(e=>e.id===t.activeConfigId)||null}async function o(e){if(!e)return{activeConfigId:null,configs:[]};let t=(0,s.loadDefaultModelConfigs)(),r=[],a=null;try{let t=await n.db.findUserSettings(e);if(t?.settingsJson){let e=JSON.parse(t.settingsJson);r=e.configs.filter(e=>!e.id.startsWith("default_")),a=e.activeConfigId}}catch(e){console.error("Failed to load user settings:",e)}let i=[...t,...r];return a&&i.find(e=>e.id===a)||(a=t.length>0?t[0].id:null),{activeConfigId:a,configs:i}}async function d(e,t){let r=t.configs.filter(e=>!e.id.startsWith("default_")),s=JSON.stringify({activeConfigId:t.activeConfigId,configs:r});await n.db.upsertUserSettings(e,s)}[n]=a.then?(await a)():a,e.s(["getActiveConfig",()=>i,"getUserSettings",()=>o,"saveUserSettings",()=>d]),r()}catch(e){r(e)}},!1),46786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},54799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},66680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},98043,e=>e.a(async(t,r)=>{try{let d;var n,s=e.i(97289),a=e.i(63021),i=e.i(86414),o=t([i]);[i]=o.then?(await o)():o,(0,s.config)();let l=e.g.prisma||new a.PrismaClient,u=(0,i.getDatabaseAdapter)(),c=process.env.DB_HOST?(d=(n=u).getClient())instanceof a.PrismaClient?d:{user:{findUnique:async e=>e.where?.apiKey?n.findUserByApiKey(e.where.apiKey):e.where?.username?n.findUserByUsername(e.where.username):null,findFirst:async e=>e.where?.username?n.findUserByUsername(e.where.username):null},skill:{findFirst:async e=>{let t=e.where?.name,r=e.where?.OR?.[0]?.user??e.where?.OR?.[1]?.user;return n.findSkill(t,r)},findMany:async e=>n.findSkills(e.where||{}),findUnique:async e=>n.findSkill(e.where?.name,e.where?.user),delete:async e=>(console.warn("[OpenGaussAdapter] skill.delete not fully implemented"),null)},skillVersion:{findFirst:async e=>e.where?.skillId?n.findLatestSkillVersion(e.where.skillId):null},config:{findMany:async e=>n.findConfigs(e.where||{})},session:{findUnique:async e=>e.where?.taskId?n.findSessionByTaskId(e.where.taskId):null,update:async e=>e.where?.id?n.updateSession(e.where.id,e.data):null,upsert:async e=>{let t=e.where?.taskId;return t?n.upsertSession(t,e.create,e.update):null}},execution:{findUnique:async e=>e.where?.id?n.findExecutionById(e.where.id):null,upsert:async e=>n.upsertExecution(e),findMany:async e=>n.findExecutions(e.where,e.orderBy)}}:l;e.s(["db",0,u,"prisma",0,c]),r()}catch(e){r(e)}},!1),81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},87769,(e,t,r)=>{t.exports=e.x("node:events",()=>require("node:events"))},57764,(e,t,r)=>{t.exports=e.x("node:url",()=>require("node:url"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},24387,e=>e.a(async(t,r)=>{try{var n=e.i(85765),s=e.i(98043),a=e.i(89171),i=t([n,s]);async function o(e){try{let{searchParams:t}=new URL(e.url),r=t.get("user")||void 0,s=t.get("query")||void 0,i=t.get("taskId")||void 0,o=t.get("framework")||void 0,d=t.get("skill")||void 0,l=t.get("skillVersion"),u=l?parseInt(l,10):void 0,c=await (0,n.readRecords)(r,{query:s,taskId:i,framework:o,skill:d,skillVersion:u});return c.length>0&&console.log(`[Data-API] 📤 Sending ${c.length} records. Top record skills: ${JSON.stringify(c[0].skills)}`),a.NextResponse.json(c)}catch(e){return console.error("Read Data Error:",e),a.NextResponse.json({error:"Failed to read data"},{status:500})}}async function d(e){try{let t=await e.json(),r=0;return t.upload_id?r=+!!await s.db.deleteExecution(t.upload_id):t.task_id?r=await s.db.deleteExecutions({taskId:t.task_id}):t.timestamp&&t.framework&&t.query&&(r=await s.db.deleteExecutions({timestamp:new Date(t.timestamp),framework:t.framework,query:t.query})),a.NextResponse.json({success:!0,count:r})}catch(e){return console.error("Delete Error:",e),a.NextResponse.json({error:"Failed to delete"},{status:500})}}async function l(e){try{let{task_id:t,upload_id:r,query:i,user_feedback:o,label:d,final_result:l}=await e.json();if(!t&&!r)return a.NextResponse.json({error:"task_id or upload_id is required"},{status:400});if(void 0!==o){let e=await (0,n.saveExecutionRecord)({task_id:t||void 0,upload_id:r||void 0,user_feedback:o,force_judgment:!1});return a.NextResponse.json({success:e.success,record:e.record,message:"用户反馈已更新"})}if(void 0!==d){let e=await (0,n.saveExecutionRecord)({task_id:t||void 0,upload_id:r||void 0,label:d,force_judgment:!1});return a.NextResponse.json({success:e.success,record:e.record,message:"Label 已更新"})}if("string"==typeof i){if(!i.trim())return a.NextResponse.json({error:"query must be a non-empty string"},{status:400});let e=await (0,n.saveExecutionRecord)({task_id:t||void 0,upload_id:r||void 0,query:i.trim(),skip_evaluation:!0,force_query_update:!0});return a.NextResponse.json({success:e.success,record:e.record,message:"Query 已更新"})}if("string"==typeof l){let e=r||t;if(!e)return a.NextResponse.json({error:"upload_id or task_id is required"},{status:400});try{return await s.db.upsertExecution({where:{id:e},create:{id:e,taskId:t,finalResult:l.trim(),judgmentReason:"结果评估中..."},update:{finalResult:l.trim(),judgmentReason:"结果评估中..."}}),(0,n.saveExecutionRecord)({task_id:t||void 0,upload_id:r||void 0,final_result:l.trim(),force_judgment:!0}).catch(e=>{console.error("[Background Re-judgment Error]",e)}),a.NextResponse.json({success:!0,message:"Final Result 已保存,正在后台重新评估"})}catch(e){return console.error("Update Final Result Error:",e),a.NextResponse.json({error:"Failed to update final result"},{status:500})}}return a.NextResponse.json({error:"No valid fields to update"},{status:400})}catch(e){return console.error("Patch/Update Data Error:",e),a.NextResponse.json({error:"Failed to update data"},{status:500})}}[n,s]=i.then?(await i)():i,e.s(["DELETE",()=>d,"GET",()=>o,"PATCH",()=>l,"dynamic",0,"force-dynamic"]),r()}catch(e){r(e)}},!1),84101,e=>e.a(async(t,r)=>{try{var n=e.i(47909),s=e.i(74017),a=e.i(60476),i=e.i(59756),o=e.i(61916),d=e.i(74677),l=e.i(69741),u=e.i(16795),c=e.i(87718),p=e.i(95169),f=e.i(47587),h=e.i(66012),x=e.i(70101),g=e.i(26937),y=e.i(10372),v=e.i(93695);e.i(52474);var m=e.i(220),R=e.i(24387),w=t([R]);[R]=w.then?(await w)():w;let k=new n.AppRouteRouteModule({definition:{kind:s.RouteKind.APP_ROUTE,page:"/api/data/route",pathname:"/api/data",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/data/route.ts",nextConfigOutput:"standalone",userland:R}),{workAsyncStorage:C,workUnitAsyncStorage:q,serverHooks:A}=k;function E(){return(0,a.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:q})}async function _(e,t,r){k.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let n="/api/data/route";n=n.replace(/\/index$/,"")||"/";let a=await k.prepare(e,t,{srcPage:n,multiZoneDraftMode:!1});if(!a)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:R,params:w,nextConfig:E,parsedUrl:_,isDraftMode:C,prerenderManifest:q,routerServerContext:A,isOnDemandRevalidate:N,revalidateOnlyGenerated:b,resolvedPathname:j,clientReferenceManifest:U,serverActionsManifest:S}=a,D=(0,l.normalizeAppPath)(n),I=!!(q.dynamicRoutes[D]||q.routes[j]),O=async()=>((null==A?void 0:A.render404)?await A.render404(e,t,_,!1):t.end("This page could not be found"),null);if(I&&!C){let e=!!q.routes[j],t=q.dynamicRoutes[D];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await O();throw new v.NoFallbackError}}let T=null;!I||k.isDev||C||(T=j,T="/index"===T?"/":T);let P=!0===k.isDev||!I,M=I&&!P;S&&U&&(0,d.setManifestsSingleton)({page:n,clientReferenceManifest:U,serverActionsManifest:S});let F=e.method||"GET",L=(0,o.getTracer)(),H=L.getActiveScopeSpan(),$={params:w,prerenderManifest:q,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:P,incrementalCache:(0,i.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,s)=>k.onRequestError(e,t,n,s,A)},sharedContext:{buildId:R}},B=new u.NodeNextRequest(e),K=new u.NodeNextResponse(t),V=c.NextRequestAdapter.fromNodeNextRequest(B,(0,c.signalFromNodeResponse)(t));try{let a=async e=>k.handle(V,$).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=L.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=r.get("next.route");if(s){let t=`${F} ${s}`;e.setAttributes({"next.route":s,"http.route":s,"next.span_name":t}),e.updateName(t)}else e.updateName(`${F} ${n}`)}),d=!!(0,i.getRequestMeta)(e,"minimalMode"),l=async i=>{var o,l;let u=async({previousCacheEntry:s})=>{try{if(!d&&N&&b&&!s)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await a(i);e.fetchMetrics=$.renderOpts.fetchMetrics;let o=$.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let l=$.renderOpts.collectedTags;if(!I)return await (0,h.sendResponse)(B,K,n,$.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,x.toNodeOutgoingHttpHeaders)(n.headers);l&&(t[y.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==$.renderOpts.collectedRevalidate&&!($.renderOpts.collectedRevalidate>=y.INFINITE_CACHE)&&$.renderOpts.collectedRevalidate,s=void 0===$.renderOpts.collectedExpire||$.renderOpts.collectedExpire>=y.INFINITE_CACHE?void 0:$.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==s?void 0:s.isStale)&&await k.onRequestError(e,t,{routerKind:"App Router",routePath:n,routeType:"route",revalidateReason:(0,f.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:N})},!1,A),t}},c=await k.handleResponse({req:e,nextConfig:E,cacheKey:T,routeKind:s.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:q,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:b,responseGenerator:u,waitUntil:r.waitUntil,isMinimalMode:d});if(!I)return null;if((null==c||null==(o=c.value)?void 0:o.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(l=c.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});d||t.setHeader("x-nextjs-cache",N?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),C&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,x.fromNodeOutgoingHttpHeaders)(c.value.headers);return d&&I||p.delete(y.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,g.getCacheControlHeader)(c.cacheControl)),await (0,h.sendResponse)(B,K,new Response(c.value.body,{headers:p,status:c.value.status||200})),null};H?await l(H):await L.withPropagatedContext(e.headers,()=>L.trace(p.BaseServerSpan.handleRequest,{spanName:`${F} ${n}`,kind:o.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},l))}catch(t){if(t instanceof v.NoFallbackError||await k.onRequestError(e,t,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,f.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:N})},!1,A),I)throw t;return await (0,h.sendResponse)(B,K,new Response(null,{status:500})),null}}e.s(["handler",()=>_,"patchFetch",()=>E,"routeModule",()=>k,"serverHooks",()=>A,"workAsyncStorage",()=>C,"workUnitAsyncStorage",()=>q]),r()}catch(e){r(e)}},!1)];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__c200214a._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[46786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},54799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},66680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},98043,e=>e.a(async(t,r)=>{try{let l;var n,a=e.i(97289),s=e.i(63021),i=e.i(86414),o=t([i]);[i]=o.then?(await o)():o,(0,a.config)();let d=e.g.prisma||new s.PrismaClient,u=(0,i.getDatabaseAdapter)(),p=process.env.DB_HOST?(l=(n=u).getClient())instanceof s.PrismaClient?l:{user:{findUnique:async e=>e.where?.apiKey?n.findUserByApiKey(e.where.apiKey):e.where?.username?n.findUserByUsername(e.where.username):null,findFirst:async e=>e.where?.username?n.findUserByUsername(e.where.username):null},skill:{findFirst:async e=>{let t=e.where?.name,r=e.where?.OR?.[0]?.user??e.where?.OR?.[1]?.user;return n.findSkill(t,r)},findMany:async e=>n.findSkills(e.where||{}),findUnique:async e=>n.findSkill(e.where?.name,e.where?.user),delete:async e=>(console.warn("[OpenGaussAdapter] skill.delete not fully implemented"),null)},skillVersion:{findFirst:async e=>e.where?.skillId?n.findLatestSkillVersion(e.where.skillId):null},config:{findMany:async e=>n.findConfigs(e.where||{})},session:{findUnique:async e=>e.where?.taskId?n.findSessionByTaskId(e.where.taskId):null,update:async e=>e.where?.id?n.updateSession(e.where.id,e.data):null,upsert:async e=>{let t=e.where?.taskId;return t?n.upsertSession(t,e.create,e.update):null}},execution:{findUnique:async e=>e.where?.id?n.findExecutionById(e.where.id):null,upsert:async e=>n.upsertExecution(e),findMany:async e=>n.findExecutions(e.where,e.orderBy)}}:d;e.s(["db",0,u,"prisma",0,p]),r()}catch(e){r(e)}},!1),4302,e=>e.a(async(t,r)=>{try{var n=e.i(98043),a=e.i(54799),s=e.i(89171),i=t([n]);async function o(e){let t=process.env.ORG_USER_INFO_URL;if(!t)return s.NextResponse.json({error:"Organization mode not configured"},{status:500});try{let r=e.headers.get("cookie")||void 0,i=await fetch(t,{method:"GET",headers:{Accept:"*/*",...r?{Cookie:r}:{}}});if(!i.ok)return s.NextResponse.json({error:"Failed to get user info from organization"},{status:i.status});let o=await i.json(),l=o?.data??o,d=l?.id,u=l?.userName,p=l?.userEmail,c=d||p||u;if(!c)return s.NextResponse.json({error:"No user ID returned from organization"},{status:400});let h=await n.db.findUserByUsername(c);if(!h){let e=`sk-${a.default.randomBytes(16).toString("hex")}`;h=await n.db.createUser({username:c,apiKey:e})}return s.NextResponse.json({username:h.username,displayName:u||p||h.username,apiKey:h.apiKey})}catch(e){return console.error("Organization auth error:",e),s.NextResponse.json({error:"Internal server error"},{status:500})}}[n]=i.then?(await i)():i,e.s(["GET",()=>o]),r()}catch(e){r(e)}},!1),52302,e=>e.a(async(t,r)=>{try{var n=e.i(47909),a=e.i(74017),s=e.i(60476),i=e.i(59756),o=e.i(61916),l=e.i(74677),d=e.i(69741),u=e.i(16795),p=e.i(87718),c=e.i(95169),h=e.i(47587),x=e.i(66012),f=e.i(70101),y=e.i(26937),w=e.i(10372),m=e.i(93695);e.i(52474);var R=e.i(220),g=e.i(4302),v=t([g]);[g]=v.then?(await v)():v;let k=new n.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/auth/organization/route",pathname:"/api/auth/organization",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/auth/organization/route.ts",nextConfigOutput:"standalone",userland:g}),{workAsyncStorage:A,workUnitAsyncStorage:N,serverHooks:b}=k;function E(){return(0,s.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:N})}async function C(e,t,r){k.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let n="/api/auth/organization/route";n=n.replace(/\/index$/,"")||"/";let s=await k.prepare(e,t,{srcPage:n,multiZoneDraftMode:!1});if(!s)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:E,parsedUrl:C,isDraftMode:A,prerenderManifest:N,routerServerContext:b,isOnDemandRevalidate:U,revalidateOnlyGenerated:q,resolvedPathname:O,clientReferenceManifest:S,serverActionsManifest:T}=s,I=(0,d.normalizeAppPath)(n),P=!!(N.dynamicRoutes[I]||N.routes[O]),_=async()=>((null==b?void 0:b.render404)?await b.render404(e,t,C,!1):t.end("This page could not be found"),null);if(P&&!A){let e=!!N.routes[O],t=N.dynamicRoutes[I];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await _();throw new m.NoFallbackError}}let j=null;!P||k.isDev||A||(j=O,j="/index"===j?"/":j);let H=!0===k.isDev||!P,D=P&&!H;T&&S&&(0,l.setManifestsSingleton)({page:n,clientReferenceManifest:S,serverActionsManifest:T});let M=e.method||"GET",B=(0,o.getTracer)(),F=B.getActiveScopeSpan(),K={params:v,prerenderManifest:N,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:H,incrementalCache:(0,i.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>k.onRequestError(e,t,n,a,b)},sharedContext:{buildId:g}},$=new u.NodeNextRequest(e),z=new u.NodeNextResponse(t),G=p.NextRequestAdapter.fromNodeNextRequest($,(0,p.signalFromNodeResponse)(t));try{let s=async e=>k.handle(G,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=B.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${M} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${n}`)}),l=!!(0,i.getRequestMeta)(e,"minimalMode"),d=async i=>{var o,d;let u=async({previousCacheEntry:a})=>{try{if(!l&&U&&q&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await s(i);e.fetchMetrics=K.renderOpts.fetchMetrics;let o=K.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let d=K.renderOpts.collectedTags;if(!P)return await (0,x.sendResponse)($,z,n,K.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(n.headers);d&&(t[w.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=w.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,a=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=w.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:R.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==a?void 0:a.isStale)&&await k.onRequestError(e,t,{routerKind:"App Router",routePath:n,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:U})},!1,b),t}},p=await k.handleResponse({req:e,nextConfig:E,cacheKey:j,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:U,revalidateOnlyGenerated:q,responseGenerator:u,waitUntil:r.waitUntil,isMinimalMode:l});if(!P)return null;if((null==p||null==(o=p.value)?void 0:o.kind)!==R.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==p||null==(d=p.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});l||t.setHeader("x-nextjs-cache",U?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,f.fromNodeOutgoingHttpHeaders)(p.value.headers);return l&&P||c.delete(w.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,y.getCacheControlHeader)(p.cacheControl)),await (0,x.sendResponse)($,z,new Response(p.value.body,{headers:c,status:p.value.status||200})),null};F?await d(F):await B.withPropagatedContext(e.headers,()=>B.trace(c.BaseServerSpan.handleRequest,{spanName:`${M} ${n}`,kind:o.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},d))}catch(t){if(t instanceof m.NoFallbackError||await k.onRequestError(e,t,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:U})},!1,b),P)throw t;return await (0,x.sendResponse)($,z,new Response(null,{status:500})),null}}e.s(["handler",()=>C,"patchFetch",()=>E,"routeModule",()=>k,"serverHooks",()=>b,"workAsyncStorage",()=>A,"workUnitAsyncStorage",()=>N]),r()}catch(e){r(e)}},!1)];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__d7fab946._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[46786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},54799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},66680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},98043,e=>e.a(async(t,r)=>{try{let l;var n,a=e.i(97289),s=e.i(63021),i=e.i(86414),o=t([i]);[i]=o.then?(await o)():o,(0,a.config)();let d=e.g.prisma||new s.PrismaClient,u=(0,i.getDatabaseAdapter)(),
|
|
1
|
+
module.exports=[46786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},54799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},66680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},98043,e=>e.a(async(t,r)=>{try{let l;var n,a=e.i(97289),s=e.i(63021),i=e.i(86414),o=t([i]);[i]=o.then?(await o)():o,(0,a.config)();let d=e.g.prisma||new s.PrismaClient,u=(0,i.getDatabaseAdapter)(),c=process.env.DB_HOST?(l=(n=u).getClient())instanceof s.PrismaClient?l:{user:{findUnique:async e=>e.where?.apiKey?n.findUserByApiKey(e.where.apiKey):e.where?.username?n.findUserByUsername(e.where.username):null,findFirst:async e=>e.where?.username?n.findUserByUsername(e.where.username):null},skill:{findFirst:async e=>{let t=e.where?.name,r=e.where?.OR?.[0]?.user??e.where?.OR?.[1]?.user;return n.findSkill(t,r)},findMany:async e=>n.findSkills(e.where||{}),findUnique:async e=>n.findSkill(e.where?.name,e.where?.user),delete:async e=>(console.warn("[OpenGaussAdapter] skill.delete not fully implemented"),null)},skillVersion:{findFirst:async e=>e.where?.skillId?n.findLatestSkillVersion(e.where.skillId):null},config:{findMany:async e=>n.findConfigs(e.where||{})},session:{findUnique:async e=>e.where?.taskId?n.findSessionByTaskId(e.where.taskId):null,update:async e=>e.where?.id?n.updateSession(e.where.id,e.data):null,upsert:async e=>{let t=e.where?.taskId;return t?n.upsertSession(t,e.create,e.update):null}},execution:{findUnique:async e=>e.where?.id?n.findExecutionById(e.where.id):null,upsert:async e=>n.upsertExecution(e),findMany:async e=>n.findExecutions(e.where,e.orderBy)}}:d;e.s(["db",0,u,"prisma",0,c]),r()}catch(e){r(e)}},!1),82660,e=>e.a(async(t,r)=>{try{var n=e.i(98043),a=e.i(89171),s=t([n]);async function i(e){try{let{searchParams:t}=new URL(e.url);if("true"===t.get("check_org"))return a.NextResponse.json({org_mode:"true"===process.env.ORGANIZATION_MODE,org_login_redirect_url:process.env.ORG_LOGIN_REDIRECT_URL||""});let r=t.get("id");if(!r)return a.NextResponse.json({error:"Missing id parameter"},{status:400});let s=await n.db.findConfigById(r);if(!s)return a.NextResponse.json({error:"Config not found"},{status:404});let i=[],o=[];try{s.rootCauses&&(i=JSON.parse(s.rootCauses)),s.keyActions&&(o=JSON.parse(s.keyActions))}catch(e){}return a.NextResponse.json({id:s.id,query:s.query,skill:s.skill,standard_answer:s.standardAnswer,root_causes:i,key_actions:o,parse_status:s.parseStatus||"completed"})}catch(e){return console.error("Config Status Error:",e),a.NextResponse.json({error:e.message||"Internal Server Error"},{status:500})}}[n]=s.then?(await s)():s,e.s(["GET",()=>i,"dynamic",0,"force-dynamic"]),r()}catch(e){r(e)}},!1),46116,e=>e.a(async(t,r)=>{try{var n=e.i(47909),a=e.i(74017),s=e.i(60476),i=e.i(59756),o=e.i(61916),l=e.i(74677),d=e.i(69741),u=e.i(16795),c=e.i(87718),p=e.i(95169),h=e.i(47587),f=e.i(66012),x=e.i(70101),y=e.i(26937),w=e.i(10372),R=e.i(93695);e.i(52474);var g=e.i(220),m=e.i(82660),v=t([m]);[m]=v.then?(await v)():v;let k=new n.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/config/status/route",pathname:"/api/config/status",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/config/status/route.ts",nextConfigOutput:"standalone",userland:m}),{workAsyncStorage:A,workUnitAsyncStorage:_,serverHooks:N}=k;function E(){return(0,s.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:_})}async function C(e,t,r){k.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let n="/api/config/status/route";n=n.replace(/\/index$/,"")||"/";let s=await k.prepare(e,t,{srcPage:n,multiZoneDraftMode:!1});if(!s)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:m,params:v,nextConfig:E,parsedUrl:C,isDraftMode:A,prerenderManifest:_,routerServerContext:N,isOnDemandRevalidate:O,revalidateOnlyGenerated:S,resolvedPathname:q,clientReferenceManifest:b,serverActionsManifest:T}=s,I=(0,d.normalizeAppPath)(n),U=!!(_.dynamicRoutes[I]||_.routes[q]),P=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,C,!1):t.end("This page could not be found"),null);if(U&&!A){let e=!!_.routes[q],t=_.dynamicRoutes[I];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await P();throw new R.NoFallbackError}}let j=null;!U||k.isDev||A||(j=q,j="/index"===j?"/":j);let H=!0===k.isDev||!U,D=U&&!H;T&&b&&(0,l.setManifestsSingleton)({page:n,clientReferenceManifest:b,serverActionsManifest:T});let M=e.method||"GET",B=(0,o.getTracer)(),F=B.getActiveScopeSpan(),K={params:v,prerenderManifest:_,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:H,incrementalCache:(0,i.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>k.onRequestError(e,t,n,a,N)},sharedContext:{buildId:m}},L=new u.NodeNextRequest(e),$=new u.NodeNextResponse(t),G=c.NextRequestAdapter.fromNodeNextRequest(L,(0,c.signalFromNodeResponse)(t));try{let s=async e=>k.handle(G,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=B.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${M} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${n}`)}),l=!!(0,i.getRequestMeta)(e,"minimalMode"),d=async i=>{var o,d;let u=async({previousCacheEntry:a})=>{try{if(!l&&O&&S&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await s(i);e.fetchMetrics=K.renderOpts.fetchMetrics;let o=K.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let d=K.renderOpts.collectedTags;if(!U)return await (0,f.sendResponse)(L,$,n,K.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,x.toNodeOutgoingHttpHeaders)(n.headers);d&&(t[w.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=w.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,a=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=w.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==a?void 0:a.isStale)&&await k.onRequestError(e,t,{routerKind:"App Router",routePath:n,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:O})},!1,N),t}},c=await k.handleResponse({req:e,nextConfig:E,cacheKey:j,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:_,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:S,responseGenerator:u,waitUntil:r.waitUntil,isMinimalMode:l});if(!U)return null;if((null==c||null==(o=c.value)?void 0:o.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(d=c.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});l||t.setHeader("x-nextjs-cache",O?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,x.fromNodeOutgoingHttpHeaders)(c.value.headers);return l&&U||p.delete(w.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,y.getCacheControlHeader)(c.cacheControl)),await (0,f.sendResponse)(L,$,new Response(c.value.body,{headers:p,status:c.value.status||200})),null};F?await d(F):await B.withPropagatedContext(e.headers,()=>B.trace(p.BaseServerSpan.handleRequest,{spanName:`${M} ${n}`,kind:o.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},d))}catch(t){if(t instanceof R.NoFallbackError||await k.onRequestError(e,t,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:O})},!1,N),U)throw t;return await (0,f.sendResponse)(L,$,new Response(null,{status:500})),null}}e.s(["handler",()=>C,"patchFetch",()=>E,"routeModule",()=>k,"serverHooks",()=>N,"workAsyncStorage",()=>A,"workUnitAsyncStorage",()=>_]),r()}catch(e){r(e)}},!1)];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__d8c1808b._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[77800,e=>{"use strict";function t(){let e=[],t=1;for(;;){let r=process.env[`DEFAULT_MODEL_${t}_NAME`],n=process.env[`DEFAULT_MODEL_${t}_PROVIDER`],a=process.env[`DEFAULT_MODEL_${t}_API_KEY`];if(!r||!n||!a)break;e.push({id:`default_${t}`,name:r,provider:n,apiKey:a,baseUrl:process.env[`DEFAULT_MODEL_${t}_BASE_URL`],model:process.env[`DEFAULT_MODEL_${t}_MODEL`]}),t++}return e}e.s(["loadDefaultModelConfigs",()=>t])},22965,e=>e.a(async(t,r)=>{try{var n=e.i(98043),a=e.i(77800),s=t([n]);async function i(e){let t=await o(e);return t&&t.activeConfigId&&t.configs.find(e=>e.id===t.activeConfigId)||null}async function o(e){if(!e)return{activeConfigId:null,configs:[]};let t=(0,a.loadDefaultModelConfigs)(),r=[],s=null;try{let t=await n.db.findUserSettings(e);if(t?.settingsJson){let e=JSON.parse(t.settingsJson);r=e.configs.filter(e=>!e.id.startsWith("default_")),s=e.activeConfigId}}catch(e){console.error("Failed to load user settings:",e)}let i=[...t,...r];return s&&i.find(e=>e.id===s)||(s=t.length>0?t[0].id:null),{activeConfigId:s,configs:i}}async function l(e,t){let r=t.configs.filter(e=>!e.id.startsWith("default_")),a=JSON.stringify({activeConfigId:t.activeConfigId,configs:r});await n.db.upsertUserSettings(e,a)}[n]=s.then?(await s)():s,e.s(["getActiveConfig",()=>i,"getUserSettings",()=>o,"saveUserSettings",()=>l]),r()}catch(e){r(e)}},!1),46786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},54799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},66680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},98043,e=>e.a(async(t,r)=>{try{let l;var n,a=e.i(97289),s=e.i(63021),i=e.i(86414),o=t([i]);[i]=o.then?(await o)():o,(0,a.config)();let d=e.g.prisma||new s.PrismaClient,u=(0,i.getDatabaseAdapter)(),c=process.env.DB_HOST?(l=(n=u).getClient())instanceof s.PrismaClient?l:{user:{findUnique:async e=>e.where?.apiKey?n.findUserByApiKey(e.where.apiKey):e.where?.username?n.findUserByUsername(e.where.username):null,findFirst:async e=>e.where?.username?n.findUserByUsername(e.where.username):null},skill:{findFirst:async e=>{let t=e.where?.name,r=e.where?.OR?.[0]?.user??e.where?.OR?.[1]?.user;return n.findSkill(t,r)},findMany:async e=>n.findSkills(e.where||{}),findUnique:async e=>n.findSkill(e.where?.name,e.where?.user),delete:async e=>(console.warn("[OpenGaussAdapter] skill.delete not fully implemented"),null)},skillVersion:{findFirst:async e=>e.where?.skillId?n.findLatestSkillVersion(e.where.skillId):null},config:{findMany:async e=>n.findConfigs(e.where||{})},session:{findUnique:async e=>e.where?.taskId?n.findSessionByTaskId(e.where.taskId):null,update:async e=>e.where?.id?n.updateSession(e.where.id,e.data):null,upsert:async e=>{let t=e.where?.taskId;return t?n.upsertSession(t,e.create,e.update):null}},execution:{findUnique:async e=>e.where?.id?n.findExecutionById(e.where.id):null,upsert:async e=>n.upsertExecution(e),findMany:async e=>n.findExecutions(e.where,e.orderBy)}}:d;e.s(["db",0,u,"prisma",0,c]),r()}catch(e){r(e)}},!1),81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},87769,(e,t,r)=>{t.exports=e.x("node:events",()=>require("node:events"))},57764,(e,t,r)=>{t.exports=e.x("node:url",()=>require("node:url"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},99276,e=>e.a(async(t,r)=>{try{var n=e.i(89171),a=e.i(2988),s=e.i(98043),i=t([a,s]);async function o(e,t){try{let r=await s.db.findSkill(e,t);if(!r)return null;let n=await s.db.findSkillById(r.id);if(!n||!n.versions||0===n.versions.length)return null;let a=n.activeVersion||0;if(n.versions.some(e=>e.version===a))return{skillId:r.id,version:a};{let e=n.versions.map(e=>e.version),t=Math.max(...e);return{skillId:r.id,version:t}}}catch{return null}}async function l(e,{params:t}){try{let r,{executionId:i}=await t,l=await e.json().catch(()=>({})),d=l.user||null,u=l.mode||"compare",c=await s.db.findExecutionById(i);if(!c)return n.NextResponse.json({error:"Execution not found"},{status:404});let p=c.skill,f=c.skillVersion??void 0;if(!p&&c.skills)try{let e=JSON.parse(c.skills);Array.isArray(e)&&e.length>0&&(p=e[0])}catch{}if("dynamic"===u){let e=await (0,a.analyzeDynamicOnly)(i,d);if(!e.success)return n.NextResponse.json({error:e.error},{status:500});return n.NextResponse.json({success:!0,mode:"dynamic",dynamicMermaid:e.dynamicMermaid,interactionCount:e.interactionCount})}if(!p)return n.NextResponse.json({error:"No skill associated with this execution"},{status:400});let h=await o(p,d);if(!h)return n.NextResponse.json({error:`Skill "${p}" 未找到或没有版本。请确认 Skill 已创建并至少有一个版本,或者使用"动态分析"功能。`},{status:400});r=h.skillId,f||(f=h.version);let x=await (0,a.analyzeExecutionMatch)(i,r,f,d);if(!x.success)return n.NextResponse.json({error:x.error},{status:500});return n.NextResponse.json({success:!0,mode:"compare",match:x.result,staticMermaid:x.staticMermaid,dynamicMermaid:x.dynamicMermaid,interactionCount:x.interactionCount,usedSkillName:p,usedSkillVersion:f})}catch(t){let e=t instanceof Error?t.message:"Internal server error";return console.error("Analyze execution match error:",t),n.NextResponse.json({error:e},{status:500})}}async function d(e,{params:t}){try{let{executionId:e}=await t,r=await (0,a.getExecutionMatch)(e);if(!r)return n.NextResponse.json({analyzed:!1,message:"Execution not analyzed yet"});let i=await s.db.findSessionByTaskId(e),o=0;if(i&&i.interactions)try{let e="string"==typeof i.interactions?JSON.parse(i.interactions):i.interactions;o=Array.isArray(e)?e.length:0}catch{}let l=await s.db.findExecutionById(e),d=l?.skill||null;return n.NextResponse.json({analyzed:!0,mode:r.mode||"compare",matchJson:r.matchJson,staticMermaid:r.staticMermaid,dynamicMermaid:r.dynamicMermaid,analysisText:r.analysisText,interactionCount:r.interactionCount,currentInteractionCount:o,hasUpdate:o>r.interactionCount,matchedAt:r.matchedAt,usedSkillName:d,usedSkillVersion:r.skillVersion})}catch(t){let e=t instanceof Error?t.message:"Internal server error";return console.error("Get execution match error:",t),n.NextResponse.json({error:e},{status:500})}}[a,s]=i.then?(await i)():i,e.s(["GET",()=>d,"POST",()=>l]),r()}catch(e){r(e)}},!1),96655,e=>e.a(async(t,r)=>{try{var n=e.i(47909),a=e.i(74017),s=e.i(60476),i=e.i(59756),o=e.i(61916),l=e.i(74677),d=e.i(69741),u=e.i(16795),c=e.i(87718),p=e.i(95169),f=e.i(47587),h=e.i(66012),x=e.i(70101),y=e.i(26937),m=e.i(10372),g=e.i(93695);e.i(52474);var w=e.i(220),v=e.i(99276),R=t([v]);[v]=R.then?(await R)():R;let k=new n.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/executions/[executionId]/analyze-match/route",pathname:"/api/executions/[executionId]/analyze-match",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/executions/[executionId]/analyze-match/route.ts",nextConfigOutput:"standalone",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:S,serverHooks:I}=k;function E(){return(0,s.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:S})}async function C(e,t,r){k.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let n="/api/executions/[executionId]/analyze-match/route";n=n.replace(/\/index$/,"")||"/";let s=await k.prepare(e,t,{srcPage:n,multiZoneDraftMode:!1});if(!s)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:v,params:R,nextConfig:E,parsedUrl:C,isDraftMode:A,prerenderManifest:S,routerServerContext:I,isOnDemandRevalidate:N,revalidateOnlyGenerated:_,resolvedPathname:b,clientReferenceManifest:O,serverActionsManifest:M}=s,U=(0,d.normalizeAppPath)(n),T=!!(S.dynamicRoutes[U]||S.routes[b]),q=async()=>((null==I?void 0:I.render404)?await I.render404(e,t,C,!1):t.end("This page could not be found"),null);if(T&&!A){let e=!!S.routes[b],t=S.dynamicRoutes[U];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await q();throw new g.NoFallbackError}}let D=null;!T||k.isDev||A||(D=b,D="/index"===D?"/":D);let j=!0===k.isDev||!T,P=T&&!j;M&&O&&(0,l.setManifestsSingleton)({page:n,clientReferenceManifest:O,serverActionsManifest:M});let H=e.method||"GET",L=(0,o.getTracer)(),B=L.getActiveScopeSpan(),F={params:R,prerenderManifest:S,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:j,incrementalCache:(0,i.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>k.onRequestError(e,t,n,a,I)},sharedContext:{buildId:v}},$=new u.NodeNextRequest(e),K=new u.NodeNextResponse(t),z=c.NextRequestAdapter.fromNodeNextRequest($,(0,c.signalFromNodeResponse)(t));try{let s=async e=>k.handle(z,F).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=L.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${H} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${H} ${n}`)}),l=!!(0,i.getRequestMeta)(e,"minimalMode"),d=async i=>{var o,d;let u=async({previousCacheEntry:a})=>{try{if(!l&&N&&_&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await s(i);e.fetchMetrics=F.renderOpts.fetchMetrics;let o=F.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let d=F.renderOpts.collectedTags;if(!T)return await (0,h.sendResponse)($,K,n,F.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,x.toNodeOutgoingHttpHeaders)(n.headers);d&&(t[m.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==F.renderOpts.collectedRevalidate&&!(F.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&F.renderOpts.collectedRevalidate,a=void 0===F.renderOpts.collectedExpire||F.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:F.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==a?void 0:a.isStale)&&await k.onRequestError(e,t,{routerKind:"App Router",routePath:n,routeType:"route",revalidateReason:(0,f.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:N})},!1,I),t}},c=await k.handleResponse({req:e,nextConfig:E,cacheKey:D,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:_,responseGenerator:u,waitUntil:r.waitUntil,isMinimalMode:l});if(!T)return null;if((null==c||null==(o=c.value)?void 0:o.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(d=c.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});l||t.setHeader("x-nextjs-cache",N?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,x.fromNodeOutgoingHttpHeaders)(c.value.headers);return l&&T||p.delete(m.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,y.getCacheControlHeader)(c.cacheControl)),await (0,h.sendResponse)($,K,new Response(c.value.body,{headers:p,status:c.value.status||200})),null};B?await d(B):await L.withPropagatedContext(e.headers,()=>L.trace(p.BaseServerSpan.handleRequest,{spanName:`${H} ${n}`,kind:o.SpanKind.SERVER,attributes:{"http.method":H,"http.target":e.url}},d))}catch(t){if(t instanceof g.NoFallbackError||await k.onRequestError(e,t,{routerKind:"App Router",routePath:U,routeType:"route",revalidateReason:(0,f.getRevalidateReason)({isStaticGeneration:P,isOnDemandRevalidate:N})},!1,I),T)throw t;return await (0,h.sendResponse)($,K,new Response(null,{status:500})),null}}e.s(["handler",()=>C,"patchFetch",()=>E,"routeModule",()=>k,"serverHooks",()=>I,"workAsyncStorage",()=>A,"workUnitAsyncStorage",()=>S]),r()}catch(e){r(e)}},!1)];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__d9b9fecc._.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[81176,e=>{"use strict";var t=e.i(47909),n=e.i(74017),i=e.i(60476),s=e.i(59756),l=e.i(61916),o=e.i(74677),r=e.i(69741),a=e.i(16795),c=e.i(87718),h=e.i(95169),p=e.i(47587),d=e.i(66012),S=e.i(70101),u=e.i(26937),_=e.i(10372),E=e.i(93695);e.i(52474);var L=e.i(220),I=e.i(89171);async function g(e){var t,n,i;let s,l,o,r,{searchParams:a}=new URL(e.url),c=a.get("apiKey"),h=a.get("host");if(!c||!h)return new I.NextResponse("Missing required parameters: apiKey and host",{status:400,headers:{"Content-Type":"text/plain"}});let p=e.headers.get("host")||"127.0.0.1:3000",d=e.headers.get("x-forwarded-proto")||"http",S=new URL(e.url).pathname.replace(/\/api\/setup\/auto\/?$/,""),u=`${d}://${p}${S}`;return"windows"==(o=e.headers.get("user-agent")||"",(r=e.headers.get("x-platform")||"")?"windows"===r.toLowerCase()?"windows":"unix":/windows|win32|win64/i.test(o)?"windows":"unix")?(s=["# =============================================================================\n# Skill-insight Auto Setup (Non-Interactive) - PowerShell\n# =============================================================================\n",'$SKILL_INSIGHT_HOST = "'+h+'"','$SKILL_INSIGHT_BASE_URL = "'+u+'"','$SKILL_INSIGHT_API_KEY = "'+c+'"','\nWrite-Host "🚀 Fetching Skill-insight telemetry components from $SKILL_INSIGHT_BASE_URL..."\n\n# 1. Setup Directories\n$skillInsightDir = Join-Path $env:USERPROFILE ".skill-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 if not already installed\nSet-Location $skillInsightDir\nif (-not (Test-Path "node_modules\\inquirer")) {\n Write-Host "📦 Installing inquirer for interactive selection..."\n npm install inquirer --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: \'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 + \'\\\\.skill-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\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_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 "openclaw") {\n $INSTALL_OPENCLAW = $true\n}\n\n# Exit if nothing selected\nif (-not $INSTALL_OPENCODE -and -not $INSTALL_CLAUDE -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 Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/api/setup/opencode" -OutFile (Join-Path $opencodePluginsDir "Witty-Skill-Insight.ts")\n \n Write-Host "⏬ Downloading Skill Sync Tool..."\n Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/sync_skills.ts" -OutFile (Join-Path $skillInsightDir "sync_skills.ts")\n}\n\nif ($INSTALL_CLAUDE) {\n Write-Host "⏬ Downloading Claude Code Watcher..."\n Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/api/setup/claude-watcher" -OutFile (Join-Path $skillInsightDir "claude_watcher_client.ts")\n}\n\nif ($INSTALL_OPENCLAW) {\n Write-Host "⏬ Downloading OpenClaw Watcher..."\n Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/api/setup/openclaw-watcher" -OutFile (Join-Path $skillInsightDir "openclaw_watcher_client.ts")\n}\n\n# 4. Configure ~/.skill-insight/.env (Auto mode - no interaction)\n$SKILL_INSIGHT_CONFIG_FILE = Join-Path $skillInsightDir ".env"\n\nWrite-Host "⚙️ Updating configuration..."\nif (Test-Path $SKILL_INSIGHT_CONFIG_FILE) {\n $existingContent = Get-Content $SKILL_INSIGHT_CONFIG_FILE\n $filteredContent = $existingContent | Where-Object { $_ -notmatch "^SKILL_INSIGHT_HOST=" -and $_ -notmatch "^SKILL_INSIGHT_API_KEY=" }\n Set-Content -Path $SKILL_INSIGHT_CONFIG_FILE -Value $filteredContent\n} else {\n New-Item -ItemType File -Path $SKILL_INSIGHT_CONFIG_FILE -Force | Out-Null\n}\nAdd-Content -Path $SKILL_INSIGHT_CONFIG_FILE -Value "SKILL_INSIGHT_HOST=$SKILL_INSIGHT_HOST"\nAdd-Content -Path $SKILL_INSIGHT_CONFIG_FILE -Value "SKILL_INSIGHT_API_KEY=$SKILL_INSIGHT_API_KEY"\nWrite-Host "✅ Configuration updated at $SKILL_INSIGHT_CONFIG_FILE"\nWrite-Host " SKILL_INSIGHT_HOST=$SKILL_INSIGHT_HOST"\nWrite-Host " SKILL_INSIGHT_API_KEY=********"\n\n# 5. Sync Opencode Skills\nif ($INSTALL_OPENCODE) {\n Write-Host ""\n Write-Host "🚀 Syncing Opencode Skills..."\n if (Get-Command npx -ErrorAction SilentlyContinue) {\n npx -y tsx (Join-Path $skillInsightDir "sync_skills.ts") --agent opencode\n } else {\n Write-Host "⚠️ Node.js (npx) not found. Skipping skill sync."\n }\n}\n\n# 6. Install Watcher Dependencies (only if any watcher is selected)\nif ($INSTALL_CLAUDE -or $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# 7. Create Watcher Startup/Stop Scripts\n$NEEDS_WATCHER_SCRIPTS = $INSTALL_CLAUDE -or $INSTALL_OPENCLAW\n\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "📝 Creating watcher management scripts..."\n\n # Claude Watcher Start Script\n if ($INSTALL_CLAUDE) {\n $startClaudeScript = @\'\n# Stop existing watcher if running\nGet-Process | Where-Object { $_.CommandLine -like "*claude_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\n\n# Start watcher in background\n$skillInsightDir = Join-Path $env:USERPROFILE ".skill-insight"\n$logFile = Join-Path $skillInsightDir "logs\\claude_watcher.log"\n$scriptPath = Join-Path $skillInsightDir "claude_watcher_client.ts"\n\nStart-Process -FilePath "npx" -ArgumentList "-y", "tsx", $scriptPath -NoNewWindow -RedirectStandardOutput $logFile -RedirectStandardError $logFile\nWrite-Host "Claude watcher started"\n\'@\n $startClaudePath = Join-Path $skillInsightDir "start_claude_watcher.ps1"\n Set-Content -Path $startClaudePath -Value $startClaudeScript -Encoding UTF8\n Write-Host "✅ Claude watcher start script created"\n\n # Claude Watcher Stop Script\n $stopClaudeScript = @\'\nWrite-Host "Stopping Claude watcher..."\nGet-Process | Where-Object { $_.CommandLine -like "*claude_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nWrite-Host "Claude watcher stopped"\n\'@\n $stopClaudePath = Join-Path $skillInsightDir "stop_claude_watcher.ps1"\n Set-Content -Path $stopClaudePath -Value $stopClaudeScript -Encoding UTF8\n Write-Host "✅ Claude watcher stop script created"\n }\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 ".skill-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_CLAUDE) {\n $startLines += \'powershell -File "\' + $skillInsightDir + \'\\start_claude_watcher.ps1"\'\n }\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_CLAUDE) {\n $stopLines += \'powershell -File "\' + $skillInsightDir + \'\\stop_claude_watcher.ps1"\'\n }\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# 9. Configure Claude Code Auto-Sync Wrapper (PowerShell profile)\nif ($INSTALL_CLAUDE) {\n Write-Host ""\n Write-Host "🔄 Configuring Claude Code Auto-Sync Wrapper..."\n \n $claudeWrapper = @\'\n\n# Skill Insight Claude Alliance\nfunction skill-insight-claude {\n if (Get-Command npx -ErrorAction SilentlyContinue) {\n npx -y tsx "$env:USERPROFILE\\.skill-insight\\sync_skills.ts" --agent claude 2>$null\n }\n claude $args\n}\nSet-Alias -Name claude -Value skill-insight-claude -Force\n\'@\n\n $profilePath = $PROFILE\n if (Test-Path $profilePath) {\n $profileContent = Get-Content $profilePath -Raw\n if ($profileContent -notmatch "skill-insight-claude") {\n Add-Content -Path $profilePath -Value $claudeWrapper\n Write-Host "✅ Installed Claude wrapper to $profilePath"\n }\n } else {\n $profileDir = Split-Path $profilePath -Parent\n if (-not (Test-Path $profileDir)) {\n New-Item -ItemType Directory -Path $profileDir -Force | Out-Null\n }\n Set-Content -Path $profilePath -Value $claudeWrapper -Encoding UTF8\n Write-Host "✅ Created PowerShell profile with Claude wrapper at $profilePath"\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 Watcher: ~/.skill-insight/claude_watcher_client.ts"\n}\nif ($INSTALL_OPENCLAW) {\n Write-Host " ✅ OpenClaw Watcher: ~/.skill-insight/openclaw_watcher_client.ts"\n}\n\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "Watcher Management:"\n Write-Host " Start all: ~/.skill-insight/start_watchers.ps1"\n Write-Host " Stop all: ~/.skill-insight/stop_watchers.ps1"\n if ($INSTALL_CLAUDE) {\n Write-Host " Start Claude: ~/.skill-insight/start_claude_watcher.ps1"\n Write-Host " Stop Claude: ~/.skill-insight/stop_claude_watcher.ps1"\n }\n if ($INSTALL_OPENCLAW) {\n Write-Host " Start OpenClaw: ~/.skill-insight/start_openclaw_watcher.ps1"\n Write-Host " Stop OpenClaw: ~/.skill-insight/stop_openclaw_watcher.ps1"\n }\n Write-Host " Logs: ~/.skill-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. Run: claude (restart terminal first)"\n}\nif ($INSTALL_OPENCLAW) {\n Write-Host " 3. OpenClaw will automatically monitor and upload telemetry"\n}\nWrite-Host "------------------------------------------------"'].join("\n"),new I.NextResponse("\uFEFF"+s,{headers:{"Content-Type":"application/x-powershell; charset=utf-8"}})):(t=u,n=h,i=c,l=`#!/bin/bash
|
|
1
|
+
module.exports=[81176,e=>{"use strict";var t=e.i(47909),n=e.i(74017),i=e.i(60476),s=e.i(59756),o=e.i(61916),r=e.i(74677),l=e.i(69741),a=e.i(16795),c=e.i(87718),h=e.i(95169),p=e.i(47587),S=e.i(66012),d=e.i(70101),_=e.i(26937),u=e.i(10372),E=e.i(93695);e.i(52474);var L=e.i(220),I=e.i(89171);async function w(e){var t,n,i;let s,o,r,l,{searchParams:a}=new URL(e.url),c=a.get("apiKey"),h=a.get("host");if(!c||!h)return new I.NextResponse("Missing required parameters: apiKey and host",{status:400,headers:{"Content-Type":"text/plain"}});let p=e.headers.get("host")||"127.0.0.1:3000",S=e.headers.get("x-forwarded-proto")||"http",d=new URL(e.url).pathname.replace(/\/api\/setup\/auto\/?$/,""),_=`${S}://${p}${d}`;return"windows"==(r=e.headers.get("user-agent")||"",(l=e.headers.get("x-platform")||"")?"windows"===l.toLowerCase()?"windows":"unix":/windows|win32|win64/i.test(r)?"windows":"unix")?(s=["# =============================================================================\n# Skill-insight Auto Setup (Non-Interactive) - PowerShell\n# =============================================================================\n",'$SKILL_INSIGHT_HOST = "'+h+'"','$SKILL_INSIGHT_BASE_URL = "'+_+'"','$SKILL_INSIGHT_API_KEY = "'+c+'"','\nWrite-Host "🚀 Fetching Skill-insight telemetry components from $SKILL_INSIGHT_BASE_URL..."\n\n# 1. Setup Directories\n$skillInsightDir = Join-Path $env:USERPROFILE ".skill-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 if not already installed\nSet-Location $skillInsightDir\nif (-not (Test-Path "node_modules\\inquirer")) {\n Write-Host "📦 Installing inquirer for interactive selection..."\n npm install inquirer --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: \'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 + \'\\\\.skill-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\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_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 "openclaw") {\n $INSTALL_OPENCLAW = $true\n}\n\n# Exit if nothing selected\nif (-not $INSTALL_OPENCODE -and -not $INSTALL_CLAUDE -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 Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/api/setup/opencode" -OutFile (Join-Path $opencodePluginsDir "Witty-Skill-Insight.ts")\n}\n\nif ($INSTALL_CLAUDE) {\n Write-Host "⏬ Downloading Claude Code Watcher..."\n Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/api/setup/claude-watcher" -OutFile (Join-Path $skillInsightDir "claude_watcher_client.ts")\n}\n\nif ($INSTALL_OPENCLAW) {\n Write-Host "⏬ Downloading OpenClaw Watcher..."\n Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/api/setup/openclaw-watcher" -OutFile (Join-Path $skillInsightDir "openclaw_watcher_client.ts")\n}\n\n# 4. Configure ~/.skill-insight/.env (Auto mode - no interaction)\n$SKILL_INSIGHT_CONFIG_FILE = Join-Path $skillInsightDir ".env"\n\nWrite-Host "⚙️ Updating configuration..."\nif (Test-Path $SKILL_INSIGHT_CONFIG_FILE) {\n $existingContent = Get-Content $SKILL_INSIGHT_CONFIG_FILE\n $filteredContent = $existingContent | Where-Object { $_ -notmatch "^SKILL_INSIGHT_HOST=" -and $_ -notmatch "^SKILL_INSIGHT_API_KEY=" }\n Set-Content -Path $SKILL_INSIGHT_CONFIG_FILE -Value $filteredContent\n} else {\n New-Item -ItemType File -Path $SKILL_INSIGHT_CONFIG_FILE -Force | Out-Null\n}\nAdd-Content -Path $SKILL_INSIGHT_CONFIG_FILE -Value "SKILL_INSIGHT_HOST=$SKILL_INSIGHT_HOST"\nAdd-Content -Path $SKILL_INSIGHT_CONFIG_FILE -Value "SKILL_INSIGHT_API_KEY=$SKILL_INSIGHT_API_KEY"\nWrite-Host "✅ Configuration updated at $SKILL_INSIGHT_CONFIG_FILE"\nWrite-Host " SKILL_INSIGHT_HOST=$SKILL_INSIGHT_HOST"\nWrite-Host " SKILL_INSIGHT_API_KEY=********"\n\n# 6. Install Watcher Dependencies (only if any watcher is selected)\nif ($INSTALL_CLAUDE -or $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# 7. Create Watcher Startup/Stop Scripts\n$NEEDS_WATCHER_SCRIPTS = $INSTALL_CLAUDE -or $INSTALL_OPENCLAW\n\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "📝 Creating watcher management scripts..."\n\n # Claude Watcher Start Script\n if ($INSTALL_CLAUDE) {\n $startClaudeScript = @\'\n# Stop existing watcher if running\nGet-Process | Where-Object { $_.CommandLine -like "*claude_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\n\n# Start watcher in background\n$skillInsightDir = Join-Path $env:USERPROFILE ".skill-insight"\n$logFile = Join-Path $skillInsightDir "logs\\claude_watcher.log"\n$scriptPath = Join-Path $skillInsightDir "claude_watcher_client.ts"\n\nStart-Process -FilePath "npx" -ArgumentList "-y", "tsx", $scriptPath -NoNewWindow -RedirectStandardOutput $logFile -RedirectStandardError $logFile\nWrite-Host "Claude watcher started"\n\'@\n $startClaudePath = Join-Path $skillInsightDir "start_claude_watcher.ps1"\n Set-Content -Path $startClaudePath -Value $startClaudeScript -Encoding UTF8\n Write-Host "✅ Claude watcher start script created"\n\n # Claude Watcher Stop Script\n $stopClaudeScript = @\'\nWrite-Host "Stopping Claude watcher..."\nGet-Process | Where-Object { $_.CommandLine -like "*claude_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nWrite-Host "Claude watcher stopped"\n\'@\n $stopClaudePath = Join-Path $skillInsightDir "stop_claude_watcher.ps1"\n Set-Content -Path $stopClaudePath -Value $stopClaudeScript -Encoding UTF8\n Write-Host "✅ Claude watcher stop script created"\n }\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 ".skill-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_CLAUDE) {\n $startLines += \'powershell -File "\' + $skillInsightDir + \'\\start_claude_watcher.ps1"\'\n }\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_CLAUDE) {\n $stopLines += \'powershell -File "\' + $skillInsightDir + \'\\stop_claude_watcher.ps1"\'\n }\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 Watcher: ~/.skill-insight/claude_watcher_client.ts"\n}\nif ($INSTALL_OPENCLAW) {\n Write-Host " ✅ OpenClaw Watcher: ~/.skill-insight/openclaw_watcher_client.ts"\n}\n\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "Watcher Management:"\n Write-Host " Start all: ~/.skill-insight/start_watchers.ps1"\n Write-Host " Stop all: ~/.skill-insight/stop_watchers.ps1"\n if ($INSTALL_CLAUDE) {\n Write-Host " Start Claude: ~/.skill-insight/start_claude_watcher.ps1"\n Write-Host " Stop Claude: ~/.skill-insight/stop_claude_watcher.ps1"\n }\n if ($INSTALL_OPENCLAW) {\n Write-Host " Start OpenClaw: ~/.skill-insight/start_openclaw_watcher.ps1"\n Write-Host " Stop OpenClaw: ~/.skill-insight/stop_openclaw_watcher.ps1"\n }\n Write-Host " Logs: ~/.skill-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. Run: claude (restart terminal first)"\n}\nif ($INSTALL_OPENCLAW) {\n Write-Host " 3. OpenClaw will automatically monitor and upload telemetry"\n}\nWrite-Host "------------------------------------------------"'].join("\n"),new I.NextResponse("\uFEFF"+s,{headers:{"Content-Type":"application/x-powershell; charset=utf-8"}})):(t=_,n=h,i=c,o=`#!/bin/bash
|
|
2
2
|
# =============================================================================
|
|
3
3
|
# Skill-insight Auto Setup (Non-Interactive)
|
|
4
4
|
# =============================================================================
|
|
@@ -130,9 +130,6 @@ fi
|
|
|
130
130
|
if [ "$INSTALL_OPENCODE" = "true" ]; then
|
|
131
131
|
echo "⏬ Downloading OpenCode Plugin..."
|
|
132
132
|
curl -sSf "$SKILL_INSIGHT_BASE_URL/api/setup/opencode" -o "$HOME/.opencode/plugins/Witty-Skill-Insight.ts"
|
|
133
|
-
|
|
134
|
-
echo "⏬ Downloading Skill Sync Tool..."
|
|
135
|
-
curl -sSf "$SKILL_INSIGHT_BASE_URL/sync_skills.ts" -o "$HOME/.skill-insight/sync_skills.ts"
|
|
136
133
|
fi
|
|
137
134
|
|
|
138
135
|
if [ "$INSTALL_CLAUDE" = "true" ]; then
|
|
@@ -161,17 +158,6 @@ echo "✅ Configuration updated at $SKILL_INSIGHT_CONFIG_FILE"
|
|
|
161
158
|
echo " SKILL_INSIGHT_HOST=$SKILL_INSIGHT_HOST"
|
|
162
159
|
echo " SKILL_INSIGHT_API_KEY=********"
|
|
163
160
|
|
|
164
|
-
# 5. Sync Opencode Skills
|
|
165
|
-
if [ "$INSTALL_OPENCODE" = "true" ]; then
|
|
166
|
-
echo ""
|
|
167
|
-
echo "🚀 Syncing Opencode Skills..."
|
|
168
|
-
if command -v npx &> /dev/null; then
|
|
169
|
-
npx -y tsx "$HOME/.skill-insight/sync_skills.ts" --agent opencode
|
|
170
|
-
else
|
|
171
|
-
echo "⚠️ Node.js (npx) not found. Skipping skill sync."
|
|
172
|
-
fi
|
|
173
|
-
fi
|
|
174
|
-
|
|
175
161
|
# 6. Install Watcher Dependencies (only if any watcher is selected)
|
|
176
162
|
if [ "$INSTALL_CLAUDE" = "true" ] || [ "$INSTALL_OPENCLAW" = "true" ]; then
|
|
177
163
|
echo ""
|
|
@@ -298,31 +284,6 @@ if [ "$NEEDS_WATCHER_SCRIPTS" = "true" ]; then
|
|
|
298
284
|
fi
|
|
299
285
|
fi
|
|
300
286
|
|
|
301
|
-
# 9. Configure Claude Code Auto-Sync Wrapper
|
|
302
|
-
if [ "$INSTALL_CLAUDE" = "true" ]; then
|
|
303
|
-
echo ""
|
|
304
|
-
echo "🔄 Configuring Claude Code Auto-Sync Wrapper..."
|
|
305
|
-
CLAUDE_WRAPPER='
|
|
306
|
-
# Skill Insight Claude Alliance
|
|
307
|
-
skill-insight-claude() {
|
|
308
|
-
if command -v npx &> /dev/null; then
|
|
309
|
-
npx -y tsx "$HOME/.skill-insight/sync_skills.ts" --agent claude >/dev/null 2>&1
|
|
310
|
-
fi
|
|
311
|
-
command claude "$@"
|
|
312
|
-
}
|
|
313
|
-
alias claude="skill-insight-claude"
|
|
314
|
-
'
|
|
315
|
-
|
|
316
|
-
for rc_file in "$HOME/.bashrc" "$HOME/.zshrc"; do
|
|
317
|
-
if [ -f "$rc_file" ]; then
|
|
318
|
-
if ! grep -q "skill-insight-claude()" "$rc_file" 2>/dev/null; then
|
|
319
|
-
echo "$CLAUDE_WRAPPER" >> "$rc_file"
|
|
320
|
-
echo "✅ Installed Claude wrapper to $rc_file"
|
|
321
|
-
fi
|
|
322
|
-
fi
|
|
323
|
-
done
|
|
324
|
-
fi
|
|
325
|
-
|
|
326
287
|
# 10. Final Summary
|
|
327
288
|
echo ""
|
|
328
289
|
echo "🌟 Skill-Insight Telemetry: READY"
|
|
@@ -366,6 +327,6 @@ if [ "$INSTALL_OPENCLAW" = "true" ]; then
|
|
|
366
327
|
echo " 3. OpenClaw will automatically monitor and upload telemetry"
|
|
367
328
|
fi
|
|
368
329
|
echo "------------------------------------------------"
|
|
369
|
-
`,new I.NextResponse(
|
|
330
|
+
`,new I.NextResponse(o,{headers:{"Content-Type":"text/x-shellscript"}}))}e.s(["GET",()=>w],87745);var g=e.i(87745);let C=new t.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/setup/auto/route",pathname:"/api/setup/auto",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/setup/auto/route.ts",nextConfigOutput:"standalone",userland:g}),{workAsyncStorage:$,workUnitAsyncStorage:O,serverHooks:T}=C;function f(){return(0,i.patchFetch)({workAsyncStorage:$,workUnitAsyncStorage:O})}async function m(e,t,i){C.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let I="/api/setup/auto/route";I=I.replace(/\/index$/,"")||"/";let w=await C.prepare(e,t,{srcPage:I,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve()),null;let{buildId:g,params:$,nextConfig:O,parsedUrl:T,isDraftMode:f,prerenderManifest:m,routerServerContext:N,isOnDemandRevalidate:A,revalidateOnlyGenerated:H,resolvedPathname:R,clientReferenceManifest:k,serverActionsManifest:P}=w,W=(0,l.normalizeAppPath)(I),D=!!(m.dynamicRoutes[W]||m.routes[R]),F=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,T,!1):t.end("This page could not be found"),null);if(D&&!f){let e=!!m.routes[R],t=m.dynamicRoutes[W];if(t&&!1===t.fallback&&!e){if(O.experimental.adapterPath)return await F();throw new E.NoFallbackError}}let x=null;!D||C.isDev||f||(x="/index"===(x=R)?"/":x);let v=!0===C.isDev||!D,b=D&&!v;P&&k&&(0,r.setManifestsSingleton)({page:I,clientReferenceManifest:k,serverActionsManifest:P});let y=e.method||"GET",U=(0,o.getTracer)(),G=U.getActiveScopeSpan(),K={params:$,prerenderManifest:m,renderOpts:{experimental:{authInterrupts:!!O.experimental.authInterrupts},cacheComponents:!!O.cacheComponents,supportsDynamicResponse:v,incrementalCache:(0,s.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:O.cacheLife,waitUntil:i.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,n,i,s)=>C.onRequestError(e,t,i,s,N)},sharedContext:{buildId:g}},M=new a.NodeNextRequest(e),q=new a.NodeNextResponse(t),j=c.NextRequestAdapter.fromNodeNextRequest(M,(0,c.signalFromNodeResponse)(t));try{let r=async e=>C.handle(j,K).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")!==h.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=`${y} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":t}),e.updateName(t)}else e.updateName(`${y} ${I}`)}),l=!!(0,s.getRequestMeta)(e,"minimalMode"),a=async s=>{var o,a;let c=async({previousCacheEntry:n})=>{try{if(!l&&A&&H&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await r(s);e.fetchMetrics=K.renderOpts.fetchMetrics;let a=K.renderOpts.pendingWaitUntil;a&&i.waitUntil&&(i.waitUntil(a),a=void 0);let c=K.renderOpts.collectedTags;if(!D)return await (0,S.sendResponse)(M,q,o,K.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,d.toNodeOutgoingHttpHeaders)(o.headers);c&&(t[u.NEXT_CACHE_TAGS_HEADER]=c),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let n=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=u.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,i=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=u.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:L.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:n,expire:i}}}}catch(t){throw(null==n?void 0:n.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:b,isOnDemandRevalidate:A})},!1,N),t}},h=await C.handleResponse({req:e,nextConfig:O,cacheKey:x,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:m,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:H,responseGenerator:c,waitUntil:i.waitUntil,isMinimalMode:l});if(!D)return null;if((null==h||null==(o=h.value)?void 0:o.kind)!==L.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==h||null==(a=h.value)?void 0:a.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});l||t.setHeader("x-nextjs-cache",A?"REVALIDATED":h.isMiss?"MISS":h.isStale?"STALE":"HIT"),f&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let E=(0,d.fromNodeOutgoingHttpHeaders)(h.value.headers);return l&&D||E.delete(u.NEXT_CACHE_TAGS_HEADER),!h.cacheControl||t.getHeader("Cache-Control")||E.get("Cache-Control")||E.set("Cache-Control",(0,_.getCacheControlHeader)(h.cacheControl)),await (0,S.sendResponse)(M,q,new Response(h.value.body,{headers:E,status:h.value.status||200})),null};G?await a(G):await U.withPropagatedContext(e.headers,()=>U.trace(h.BaseServerSpan.handleRequest,{spanName:`${y} ${I}`,kind:o.SpanKind.SERVER,attributes:{"http.method":y,"http.target":e.url}},a))}catch(t){if(t instanceof E.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:W,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:b,isOnDemandRevalidate:A})},!1,N),D)throw t;return await (0,S.sendResponse)(M,q,new Response(null,{status:500})),null}}e.s(["handler",()=>m,"patchFetch",()=>f,"routeModule",()=>C,"serverHooks",()=>T,"workAsyncStorage",()=>$,"workUnitAsyncStorage",()=>O],81176)}];
|
|
370
331
|
|
|
371
332
|
//# sourceMappingURL=node_modules_next_dist_esm_build_templates_app-route_c33286ed.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[26984,e=>{"use strict";var n=e.i(47909),t=e.i(74017),i=e.i(60476),s=e.i(59756),l=e.i(61916),o=e.i(74677),r=e.i(69741),a=e.i(16795),c=e.i(87718),h=e.i(95169),S=e.i(47587),_=e.i(66012),I=e.i(70101),E=e.i(26937),d=e.i(10372),p=e.i(93695);e.i(52474);var L=e.i(220),u=e.i(89171);async function $(e){let n,t,i=e.headers.get("x-forwarded-host")||e.headers.get("host")||"127.0.0.1:3000",s=e.headers.get("x-forwarded-proto")||"https",l=new URL(e.url).pathname.replace(/\/api\/setup\/?$/,""),o=`${s}://${i}${l}`,r=`${s}://${i}${l}`;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# Skill-insight One-Click Setup (PowerShell)\n# =============================================================================\n",'$SKILL_INSIGHT_HOST = "'+r+'"','$SKILL_INSIGHT_BASE_URL = "'+o+'"','\nWrite-Host "🚀 Fetching Skill-insight telemetry components from $SKILL_INSIGHT_BASE_URL..."\n\n# 1. Setup Directories\n$homeDir = $env:USERPROFILE\nNew-Item -ItemType Directory -Force -Path "$homeDir\\.skill-insight" | Out-Null\nNew-Item -ItemType Directory -Force -Path "$homeDir\\.skill-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 "$homeDir\\.openclaw\\agents" | 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\\.skill-insight\\framework_selector.mjs"\n$SELECTOR_RESULT = "$homeDir\\.skill-insight\\.selector_result"\n\n# Install inquirer if not already installed\nSet-Location "$homeDir\\.skill-insight"\nif (-not (Test-Path "node_modules\\inquirer")) {\n Write-Host "📦 Installing inquirer for interactive selection..."\n npm install inquirer --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: \'OpenClaw\', value: \'openclaw\' }\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\', \'║ ✨ 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 const resultFile = process.env.SELECTOR_RESULT_FILE || process.env.USERPROFILE + \'\\\\.skill-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\\.skill-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_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 "openclaw") {\n $INSTALL_OPENCLAW = $true\n}\n\n# Exit if nothing selected\nif (-not $INSTALL_OPENCODE -and -not $INSTALL_CLAUDE -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 Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/api/setup/opencode" -OutFile "$homeDir\\.opencode\\plugins\\Witty-Skill-Insight.ts"\n \n Write-Host "⏬ Downloading Skill Sync Tool..."\n Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/sync_skills.ts" -OutFile "$homeDir\\.skill-insight\\sync_skills.ts"\n}\n\nif ($INSTALL_CLAUDE) {\n Write-Host "⏬ Downloading Claude Code Watcher..."\n Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/api/setup/claude-watcher" -OutFile "$homeDir\\.skill-insight\\claude_watcher_client.ts"\n}\n\nif ($INSTALL_OPENCLAW) {\n Write-Host "⏬ Downloading OpenClaw Watcher..."\n Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/api/setup/openclaw-watcher" -OutFile "$homeDir\\.skill-insight\\openclaw_watcher_client.ts"\n}\n\n# 4. Configure ~/.skill-insight/.env\n$SKILL_INSIGHT_CONFIG_FILE = "$homeDir\\.skill-insight\\.env"\n$EXISTING_KEY = ""\n$EXISTING_HOST = ""\nif (Test-Path $SKILL_INSIGHT_CONFIG_FILE) {\n $content = Get-Content $SKILL_INSIGHT_CONFIG_FILE\n $keyLine = $content | Select-String \'^SKILL_INSIGHT_API_KEY=\' | Select-Object -First 1\n $hostLine = $content | Select-String \'^SKILL_INSIGHT_HOST=\' | Select-Object -First 1\n if ($keyLine) {\n $EXISTING_KEY = $keyLine.Line.Substring(\'SKILL_INSIGHT_API_KEY=\'.Length)\n }\n if ($hostLine) {\n $EXISTING_HOST = $hostLine.Line.Substring(\'SKILL_INSIGHT_HOST=\'.Length)\n }\n}\n\n# -- API Key Logic --\n$FINAL_KEY = $EXISTING_KEY\nif ($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 "🔑 SKILL_INSIGHT_API_KEY is not set."\n $FINAL_KEY = Read-Host "👉 Please enter your API Key"\n}\n\n# -- Host Logic --\n$FINAL_HOST = $SKILL_INSIGHT_HOST\nif ($EXISTING_HOST -and ($EXISTING_HOST -ne $SKILL_INSIGHT_HOST)) {\n Write-Host "🌐 Current Host in config: $EXISTING_HOST"\n Write-Host "🌐 New Host detected: $SKILL_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 = $SKILL_INSIGHT_HOST\n}\n\nif (-not $FINAL_KEY) {\n Write-Host "⚠️ Warning: No API Key provided. Telemetry upload will fail until you set it in $SKILL_INSIGHT_CONFIG_FILE"\n}\n\nWrite-Host "⚙️ Updating configuration..."\nNew-Item -ItemType File -Path $SKILL_INSIGHT_CONFIG_FILE -Force | Out-Null\nCopy-Item $SKILL_INSIGHT_CONFIG_FILE "$SKILL_INSIGHT_CONFIG_FILE.bak"\n$content = Get-Content "$SKILL_INSIGHT_CONFIG_FILE.bak"\n$content | Where-Object { $_ -notmatch \'^SKILL_INSIGHT_HOST=\' -and $_ -notmatch \'^SKILL_INSIGHT_API_KEY=\' } | Set-Content $SKILL_INSIGHT_CONFIG_FILE\nAdd-Content $SKILL_INSIGHT_CONFIG_FILE "SKILL_INSIGHT_HOST=$FINAL_HOST"\nAdd-Content $SKILL_INSIGHT_CONFIG_FILE "SKILL_INSIGHT_API_KEY=$FINAL_KEY"\nRemove-Item "$SKILL_INSIGHT_CONFIG_FILE.bak" -Force\nWrite-Host "✅ Configuration updated at $SKILL_INSIGHT_CONFIG_FILE"\n\n# 5. Sync Opencode Skills\nif ($INSTALL_OPENCODE) {\n Write-Host ""\n Write-Host "🚀 Syncing Opencode Skills..."\n if (Get-Command npx -ErrorAction SilentlyContinue) {\n npx -y tsx "$homeDir\\.skill-insight\\sync_skills.ts" --agent opencode\n } else {\n Write-Host "⚠️ Node.js (npx) not found. Skipping skill sync."\n }\n}\n\n# 6. Install Watcher Dependencies\nif ($INSTALL_CLAUDE -or $INSTALL_OPENCLAW) {\n Write-Host ""\n Write-Host "📦 Installing watcher dependencies..."\n if (Get-Command npm -ErrorAction SilentlyContinue) {\n Set-Location "$homeDir\\.skill-insight"\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# 7. Create Watcher Startup/Stop Scripts\n$NEEDS_WATCHER_SCRIPTS = $false\nif ($INSTALL_CLAUDE -or $INSTALL_OPENCLAW) {\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_CLAUDE) {\n $startScript = @\'\npkill -f "claude_watcher_client.ts" 2>/dev/null\nSet-Location "$env:USERPROFILE\\.skill-insight"\nStart-Process -FilePath "npx" -ArgumentList "-y", "tsx", "$env:USERPROFILE\\.skill-insight\\claude_watcher_client.ts" -RedirectStandardOutput "$env:USERPROFILE\\.skill-insight\\logs\\claude_watcher.log" -RedirectStandardError "$env:USERPROFILE\\.skill-insight\\logs\\claude_watcher_error.log" -NoNewWindow\nWrite-Host "Claude watcher started"\n\'@\n Set-Content -Path "$homeDir\\.skill-insight\\start_claude_watcher.ps1" -Value $startScript -Encoding UTF8\n\n $stopScript = @\'\nGet-Process | Where-Object { $_.CommandLine -like "*claude_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nRemove-Item "$env:USERPROFILE\\.skill-insight\\claude_watcher.pid" -Force -ErrorAction SilentlyContinue\nWrite-Host "Claude watcher stopped"\n\'@\n Set-Content -Path "$homeDir\\.skill-insight\\stop_claude_watcher.ps1" -Value $stopScript -Encoding UTF8\n }\n\n if ($INSTALL_OPENCLAW) {\n $startScript = @\'\npkill -f "openclaw_watcher_client.ts" 2>/dev/null\nSet-Location "$env:USERPROFILE\\.skill-insight"\nStart-Process -FilePath "npx" -ArgumentList "-y", "tsx", "$env:USERPROFILE\\.skill-insight\\openclaw_watcher_client.ts" -RedirectStandardOutput "$env:USERPROFILE\\.skill-insight\\logs\\openclaw_watcher.log" -RedirectStandardError "$env:USERPROFILE\\.skill-insight\\logs\\openclaw_watcher_error.log" -NoNewWindow\nWrite-Host "OpenClaw watcher started"\n\'@\n Set-Content -Path "$homeDir\\.skill-insight\\start_openclaw_watcher.ps1" -Value $startScript -Encoding UTF8\n\n $stopScript = @\'\nGet-Process | Where-Object { $_.CommandLine -like "*openclaw_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nRemove-Item "$env:USERPROFILE\\.skill-insight\\openclaw_watcher.pid" -Force -ErrorAction SilentlyContinue\nWrite-Host "OpenClaw watcher stopped"\n\'@\n Set-Content -Path "$homeDir\\.skill-insight\\stop_openclaw_watcher.ps1" -Value $stopScript -Encoding UTF8\n }\n\n $combinedStart = \'Write-Host "Starting Skill-Insight watchers..."\'\n if ($INSTALL_CLAUDE) { $combinedStart += [char]10 + "& `"$homeDir\\.skill-insight\\start_claude_watcher.ps1`"" }\n if ($INSTALL_OPENCLAW) { $combinedStart += [char]10 + "& `"$homeDir\\.skill-insight\\start_openclaw_watcher.ps1`"" }\n $combinedStart += [char]10 + \'Write-Host "All watchers started!"\'\n Set-Content -Path "$homeDir\\.skill-insight\\start_watchers.ps1" -Value $combinedStart -Encoding UTF8\n\n $combinedStop = \'Write-Host "Stopping Skill-Insight watchers..."\'\n if ($INSTALL_CLAUDE) { $combinedStop += [char]10 + "& `"$homeDir\\.skill-insight\\stop_claude_watcher.ps1`"" }\n if ($INSTALL_OPENCLAW) { $combinedStop += [char]10 + "& `"$homeDir\\.skill-insight\\stop_openclaw_watcher.ps1`"" }\n $combinedStop += [char]10 + \'Write-Host "All watchers stopped!"\'\n Set-Content -Path "$homeDir\\.skill-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\\.skill-insight\\start_watchers.ps1"\n } else {\n Write-Host "⚠️ Node.js (npx) not found. Skipping watcher startup."\n }\n}\n\n# 9. Configure Claude Code Auto-Sync Wrapper\nif ($INSTALL_CLAUDE) {\n Write-Host ""\n Write-Host "🔄 Configuring Claude Code Auto-Sync Wrapper..."\n \n $profileContent = @\'\n\n# Skill Insight Claude Alliance\nfunction skill-insight-claude {\n if (Get-Command npx -ErrorAction SilentlyContinue) {\n npx -y tsx "$env:USERPROFILE\\.skill-insight\\sync_skills.ts" --agent claude 2>$null\n }\n claude $args\n}\nSet-Alias -Name claude -Value skill-insight-claude -Force\n\'@\n\n $profilePath = $PROFILE\n if (-not (Test-Path $profilePath)) {\n $profileDir = Split-Path $profilePath -Parent\n if (-not (Test-Path $profileDir)) {\n New-Item -ItemType Directory -Path $profileDir -Force | Out-Null\n }\n New-Item -ItemType File -Path $profilePath -Force | Out-Null\n }\n \n $currentProfile = Get-Content $profilePath -Raw -ErrorAction SilentlyContinue\n if ($currentProfile -notmatch "skill-insight-claude") {\n Add-Content -Path $profilePath -Value $profileContent\n Write-Host "✅ Installed Claude wrapper to $profilePath"\n }\n}\n\n# 10. Final Summary\nWrite-Host ""\nWrite-Host "🌟 Skill-Insight Telemetry: READY"\nWrite-Host "------------------------------------------------"\nWrite-Host "Installed Components:"\nif ($INSTALL_OPENCODE) { Write-Host " ✅ OpenCode Plugin: ~/.opencode/plugins/Witty-Skill-Insight.ts" }\nif ($INSTALL_CLAUDE) { Write-Host " ✅ Claude Watcher: ~/.skill-insight/claude_watcher_client.ts" }\nif ($INSTALL_OPENCLAW) { Write-Host " ✅ OpenClaw Watcher: ~/.skill-insight/openclaw_watcher_client.ts" }\n\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "Watcher Management:"\n Write-Host " Start all: ~/.skill-insight/start_watchers.ps1"\n Write-Host " Stop all: ~/.skill-insight/stop_watchers.ps1"\n Write-Host " Logs: ~/.skill-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. Run: claude (restart terminal first)" }\nif ($INSTALL_OPENCLAW) { Write-Host " 3. OpenClaw will automatically monitor and upload telemetry" }\nWrite-Host "------------------------------------------------"'].join("\n");return new u.NextResponse(e,{headers:{"Content-Type":"text/plain; charset=utf-8"}})}{let e=["#!/bin/bash\n# =============================================================================\n# Skill-insight One-Click Setup\n# =============================================================================\n",'SKILL_INSIGHT_HOST="'+r+'"','SKILL_INSIGHT_BASE_URL="'+o+'"','\necho "🚀 Fetching Skill-insight telemetry components from $SKILL_INSIGHT_BASE_URL..."\n\n# 1. Setup Directories\nmkdir -p "$HOME/.skill-insight"\nmkdir -p "$HOME/.skill-insight/logs"\nmkdir -p "$HOME/.opencode/plugins"\nmkdir -p "$HOME/.opencode/skills"\nmkdir -p "$HOME/.claude/projects"\nmkdir -p "$HOME/.openclaw/agents"\nmkdir -p ".opencode/skills"\necho "📂 Created necessary directories"\n\n# 2. Interactive Framework Selection with inquirer\necho ""\n\nSELECTOR_SCRIPT="$HOME/.skill-insight/framework_selector.mjs"\nSELECTOR_RESULT="$HOME/.skill-insight/.selector_result"\n\n# Install inquirer if not already installed\ncd "$HOME/.skill-insight"\nif [ ! -d "node_modules/inquirer" ]; then\n echo "📦 Installing inquirer for interactive selection..."\n npm install inquirer --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: \'OpenClaw\', value: \'openclaw\' }\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\', \'║ ✨ 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 const resultFile = process.env.SELECTOR_RESULT_FILE || process.env.HOME + \'/.skill-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/.skill-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_OPENCLAW=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" == *"openclaw"* ]]; then\n INSTALL_OPENCLAW=true\nfi\n\n# Exit if nothing selected\nif [ "$INSTALL_OPENCODE" = "false" ] && [ "$INSTALL_CLAUDE" = "false" ] && [ "$INSTALL_OPENCLAW" = "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 curl -sSf "$SKILL_INSIGHT_BASE_URL/api/setup/opencode" -o "$HOME/.opencode/plugins/Witty-Skill-Insight.ts"\n \n echo "⏬ Downloading Skill Sync Tool..."\n curl -sSf "$SKILL_INSIGHT_BASE_URL/sync_skills.ts" -o "$HOME/.skill-insight/sync_skills.ts"\nfi\n\nif [ "$INSTALL_CLAUDE" = "true" ]; then\n echo "⏬ Downloading Claude Code Watcher..."\n curl -sSf "$SKILL_INSIGHT_BASE_URL/api/setup/claude-watcher" -o "$HOME/.skill-insight/claude_watcher_client.ts"\nfi\n\nif [ "$INSTALL_OPENCLAW" = "true" ]; then\n echo "⏬ Downloading OpenClaw Watcher..."\n curl -sSf "$SKILL_INSIGHT_BASE_URL/api/setup/openclaw-watcher" -o "$HOME/.skill-insight/openclaw_watcher_client.ts"\nfi\n\n# 4. Configure ~/.skill-insight/.env\nSKILL_INSIGHT_CONFIG_FILE="$HOME/.skill-insight/.env"\nEXISTING_KEY=""\nEXISTING_HOST=""\nif [ -f "$SKILL_INSIGHT_CONFIG_FILE" ]; then\n EXISTING_KEY=$(grep \'^SKILL_INSIGHT_API_KEY=\' "$SKILL_INSIGHT_CONFIG_FILE" | head -n 1 | cut -d\'=\' -f2-)\n EXISTING_HOST=$(grep \'^SKILL_INSIGHT_HOST=\' "$SKILL_INSIGHT_CONFIG_FILE" | head -n 1 | cut -d\'=\' -f2-)\nfi\n\n# -- API Key Logic --\nFINAL_KEY="$EXISTING_KEY"\nif [ -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 "🔑 SKILL_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="$SKILL_INSIGHT_HOST"\nif [ -n "$EXISTING_HOST" ] && [ "$EXISTING_HOST" != "$SKILL_INSIGHT_HOST" ]; then\n echo "🌐 Current Host in config: $EXISTING_HOST"\n echo "🌐 New Host detected: $SKILL_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="$SKILL_INSIGHT_HOST"\nfi\n\nif [ -z "$FINAL_KEY" ]; then\n echo "⚠️ Warning: No API Key provided. Telemetry upload will fail until you set it in $SKILL_INSIGHT_CONFIG_FILE"\nfi\n\necho "⚙️ Updating configuration..."\ntouch "$SKILL_INSIGHT_CONFIG_FILE"\ncp "$SKILL_INSIGHT_CONFIG_FILE" "${SKILL_INSIGHT_CONFIG_FILE}.bak"\ngrep -v "^SKILL_INSIGHT_HOST=" "${SKILL_INSIGHT_CONFIG_FILE}.bak" | grep -v "^SKILL_INSIGHT_API_KEY=" > "$SKILL_INSIGHT_CONFIG_FILE"\necho "SKILL_INSIGHT_HOST=$FINAL_HOST" >> "$SKILL_INSIGHT_CONFIG_FILE"\necho "SKILL_INSIGHT_API_KEY=$FINAL_KEY" >> "$SKILL_INSIGHT_CONFIG_FILE"\nrm "${SKILL_INSIGHT_CONFIG_FILE}.bak"\necho "✅ Configuration updated at $SKILL_INSIGHT_CONFIG_FILE"\n\n# 5. Sync Opencode Skills\nif [ "$INSTALL_OPENCODE" = "true" ]; then\n echo ""\n echo "🚀 Syncing Opencode Skills..."\n if command -v npx &> /dev/null; then\n npx -y tsx "$HOME/.skill-insight/sync_skills.ts" --agent opencode\n else\n echo "⚠️ Node.js (npx) not found. Skipping skill sync."\n fi\nfi\n\n# 6. Install Watcher Dependencies\nif [ "$INSTALL_CLAUDE" = "true" ] || [ "$INSTALL_OPENCLAW" = "true" ]; then\n echo ""\n echo "📦 Installing watcher dependencies..."\n if command -v npm &> /dev/null; then\n cd "$HOME/.skill-insight"\n if [ ! -f "package.json" ]; then\n echo \'{"name": "skill-insight-watcher", "version": "1.0.0", "type": "module", "dependencies": {}}\' > package.json\n fi\n npm install chokidar --save 2>/dev/null\n echo "✅ Dependencies installed"\n else\n echo "⚠️ npm not found. Skipping dependency installation."\n fi\nfi\n\n# 7. Create Watcher Startup/Stop Scripts\nNEEDS_WATCHER_SCRIPTS=false\nif [ "$INSTALL_CLAUDE" = "true" ] || [ "$INSTALL_OPENCLAW" = "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_CLAUDE" = "true" ]; then\n cat > "$HOME/.skill-insight/start_claude_watcher.sh" << \'WATCHER_EOF\'\n#!/bin/bash\npkill -f "claude_watcher_client.ts" 2>/dev/null\ncd "$HOME/.skill-insight" && nohup npx -y tsx "$HOME/.skill-insight/claude_watcher_client.ts" > "$HOME/.skill-insight/logs/claude_watcher.log" 2>&1 &\necho $! > "$HOME/.skill-insight/claude_watcher.pid"\necho "Claude watcher started with PID $(cat $HOME/.skill-insight/claude_watcher.pid)"\nWATCHER_EOF\n chmod +x "$HOME/.skill-insight/start_claude_watcher.sh"\n\n cat > "$HOME/.skill-insight/stop_claude_watcher.sh" << \'STOP_CLAUDE_EOF\'\n#!/bin/bash\npkill -f "claude_watcher_client.ts" 2>/dev/null\nrm -f "$HOME/.skill-insight/claude_watcher.pid"\necho "Claude watcher stopped"\nSTOP_CLAUDE_EOF\n chmod +x "$HOME/.skill-insight/stop_claude_watcher.sh"\n fi\n\n if [ "$INSTALL_OPENCLAW" = "true" ]; then\n cat > "$HOME/.skill-insight/start_openclaw_watcher.sh" << \'WATCHER_EOF\'\n#!/bin/bash\npkill -f "openclaw_watcher_client.ts" 2>/dev/null\ncd "$HOME/.skill-insight" && nohup npx -y tsx "$HOME/.skill-insight/openclaw_watcher_client.ts" > "$HOME/.skill-insight/logs/openclaw_watcher.log" 2>&1 &\necho $! > "$HOME/.skill-insight/openclaw_watcher.pid"\necho "OpenClaw watcher started with PID $(cat $HOME/.skill-insight/openclaw_watcher.pid)"\nWATCHER_EOF\n chmod +x "$HOME/.skill-insight/start_openclaw_watcher.sh"\n\n cat > "$HOME/.skill-insight/stop_openclaw_watcher.sh" << \'STOP_OPENCLAW_EOF\'\n#!/bin/bash\npkill -f "openclaw_watcher_client.ts" 2>/dev/null\nrm -f "$HOME/.skill-insight/openclaw_watcher.pid"\necho "OpenClaw watcher stopped"\nSTOP_OPENCLAW_EOF\n chmod +x "$HOME/.skill-insight/stop_openclaw_watcher.sh"\n fi\n\n cat > "$HOME/.skill-insight/start_watchers.sh" << \'WATCHER_HEADER\'\n#!/bin/bash\necho "Starting Skill-Insight watchers..."\nWATCHER_HEADER\n if [ "$INSTALL_CLAUDE" = "true" ]; then echo \'"$HOME/.skill-insight/start_claude_watcher.sh"\' >> "$HOME/.skill-insight/start_watchers.sh"; fi\n if [ "$INSTALL_OPENCLAW" = "true" ]; then echo \'"$HOME/.skill-insight/start_openclaw_watcher.sh"\' >> "$HOME/.skill-insight/start_watchers.sh"; fi\n echo \'echo "All watchers started!"\' >> "$HOME/.skill-insight/start_watchers.sh"\n chmod +x "$HOME/.skill-insight/start_watchers.sh"\n\n cat > "$HOME/.skill-insight/stop_watchers.sh" << \'STOP_HEADER\'\n#!/bin/bash\necho "Stopping Skill-Insight watchers..."\nSTOP_HEADER\n if [ "$INSTALL_CLAUDE" = "true" ]; then echo \'"$HOME/.skill-insight/stop_claude_watcher.sh"\' >> "$HOME/.skill-insight/stop_watchers.sh"; fi\n if [ "$INSTALL_OPENCLAW" = "true" ]; then echo \'"$HOME/.skill-insight/stop_openclaw_watcher.sh"\' >> "$HOME/.skill-insight/stop_watchers.sh"; fi\n echo \'echo "All watchers stopped!"\' >> "$HOME/.skill-insight/stop_watchers.sh"\n chmod +x "$HOME/.skill-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/.skill-insight/start_watchers.sh"\n else\n echo "⚠️ Node.js (npx) not found. Skipping watcher startup."\n fi\nfi\n\n# 9. Configure Claude Code Auto-Sync Wrapper\nif [ "$INSTALL_CLAUDE" = "true" ]; then\n echo ""\n echo "🔄 Configuring Claude Code Auto-Sync Wrapper..."\n for rc_file in "$HOME/.bashrc" "$HOME/.zshrc"; do\n if [ -f "$rc_file" ]; then\n if ! grep -q "skill-insight-claude()" "$rc_file" 2>/dev/null; then\n cat >> "$rc_file" << \'CLAUDE_EOF\'\n\n# Skill Insight Claude Alliance\nskill-insight-claude() {\n if command -v npx &> /dev/null; then\n npx -y tsx "$HOME/.skill-insight/sync_skills.ts" --agent claude >/dev/null 2>&1\n fi\n command claude "$@"\n}\nalias claude="skill-insight-claude"\nCLAUDE_EOF\n echo "✅ Installed Claude wrapper to $rc_file"\n fi\n fi\n done\nfi\n\n# 10. Final Summary\necho ""\necho "🌟 Skill-Insight Telemetry: READY"\necho "------------------------------------------------"\necho "Installed Components:"\nif [ "$INSTALL_OPENCODE" = "true" ]; then echo " ✅ OpenCode Plugin: ~/.opencode/plugins/Witty-Skill-Insight.ts"; fi\nif [ "$INSTALL_CLAUDE" = "true" ]; then echo " ✅ Claude Watcher: ~/.skill-insight/claude_watcher_client.ts"; fi\nif [ "$INSTALL_OPENCLAW" = "true" ]; then echo " ✅ OpenClaw Watcher: ~/.skill-insight/openclaw_watcher_client.ts"; fi\n\nif [ "$NEEDS_WATCHER_SCRIPTS" = "true" ]; then\n echo ""\n echo "Watcher Management:"\n echo " Start all: ~/.skill-insight/start_watchers.sh"\n echo " Stop all: ~/.skill-insight/stop_watchers.sh"\n echo " Logs: ~/.skill-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. Run: claude (restart terminal first)"; fi\nif [ "$INSTALL_OPENCLAW" = "true" ]; then echo " 3. OpenClaw will automatically monitor and upload telemetry"; fi\necho "------------------------------------------------"'].join("\n");return new u.NextResponse(e,{headers:{"Content-Type":"text/x-shellscript"}})}}e.s(["GET",()=>$],21965);var T=e.i(21965);let g=new n.AppRouteRouteModule({definition:{kind:t.RouteKind.APP_ROUTE,page:"/api/setup/route",pathname:"/api/setup",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/setup/route.ts",nextConfigOutput:"standalone",userland:T}),{workAsyncStorage:N,workUnitAsyncStorage:f,serverHooks:O}=g;function C(){return(0,i.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:f})}async function m(e,n,i){g.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let u="/api/setup/route";u=u.replace(/\/index$/,"")||"/";let $=await g.prepare(e,n,{srcPage:u,multiZoneDraftMode:!1});if(!$)return n.statusCode=400,n.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve()),null;let{buildId:T,params:N,nextConfig:f,parsedUrl:O,isDraftMode:C,prerenderManifest:m,routerServerContext:H,isOnDemandRevalidate:w,revalidateOnlyGenerated:A,resolvedPathname:R,clientReferenceManifest:k,serverActionsManifest:P}=$,F=(0,r.normalizeAppPath)(u),y=!!(m.dynamicRoutes[F]||m.routes[R]),W=async()=>((null==H?void 0:H.render404)?await H.render404(e,n,O,!1):n.end("This page could not be found"),null);if(y&&!C){let e=!!m.routes[R],n=m.dynamicRoutes[F];if(n&&!1===n.fallback&&!e){if(f.experimental.adapterPath)return await W();throw new p.NoFallbackError}}let D=null;!y||g.isDev||C||(D="/index"===(D=R)?"/":D);let G=!0===g.isDev||!y,x=y&&!G;P&&k&&(0,o.setManifestsSingleton)({page:u,clientReferenceManifest:k,serverActionsManifest:P});let v=e.method||"GET",K=(0,l.getTracer)(),b=K.getActiveScopeSpan(),U={params:N,prerenderManifest:m,renderOpts:{experimental:{authInterrupts:!!f.experimental.authInterrupts},cacheComponents:!!f.cacheComponents,supportsDynamicResponse:G,incrementalCache:(0,s.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:f.cacheLife,waitUntil:i.waitUntil,onClose:e=>{n.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(n,t,i,s)=>g.onRequestError(e,n,i,s,H)},sharedContext:{buildId:T}},M=new a.NodeNextRequest(e),q=new a.NodeNextResponse(n),X=c.NextRequestAdapter.fromNodeNextRequest(M,(0,c.signalFromNodeResponse)(n));try{let o=async e=>g.handle(X,U).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":n.statusCode,"next.rsc":!1});let t=K.getRootSpanAttributes();if(!t)return;if(t.get("next.span_type")!==h.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=`${v} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":n}),e.updateName(n)}else e.updateName(`${v} ${u}`)}),r=!!(0,s.getRequestMeta)(e,"minimalMode"),a=async s=>{var l,a;let c=async({previousCacheEntry:t})=>{try{if(!r&&w&&A&&!t)return n.statusCode=404,n.setHeader("x-nextjs-cache","REVALIDATED"),n.end("This page could not be found"),null;let l=await o(s);e.fetchMetrics=U.renderOpts.fetchMetrics;let a=U.renderOpts.pendingWaitUntil;a&&i.waitUntil&&(i.waitUntil(a),a=void 0);let c=U.renderOpts.collectedTags;if(!y)return await (0,_.sendResponse)(M,q,l,U.renderOpts.pendingWaitUntil),null;{let e=await l.blob(),n=(0,I.toNodeOutgoingHttpHeaders)(l.headers);c&&(n[d.NEXT_CACHE_TAGS_HEADER]=c),!n["content-type"]&&e.type&&(n["content-type"]=e.type);let t=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=d.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,i=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=d.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:L.CachedRouteKind.APP_ROUTE,status:l.status,body:Buffer.from(await e.arrayBuffer()),headers:n},cacheControl:{revalidate:t,expire:i}}}}catch(n){throw(null==t?void 0:t.isStale)&&await g.onRequestError(e,n,{routerKind:"App Router",routePath:u,routeType:"route",revalidateReason:(0,S.getRevalidateReason)({isStaticGeneration:x,isOnDemandRevalidate:w})},!1,H),n}},h=await g.handleResponse({req:e,nextConfig:f,cacheKey:D,routeKind:t.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:m,isRoutePPREnabled:!1,isOnDemandRevalidate:w,revalidateOnlyGenerated:A,responseGenerator:c,waitUntil:i.waitUntil,isMinimalMode:r});if(!y)return null;if((null==h||null==(l=h.value)?void 0:l.kind)!==L.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==h||null==(a=h.value)?void 0:a.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});r||n.setHeader("x-nextjs-cache",w?"REVALIDATED":h.isMiss?"MISS":h.isStale?"STALE":"HIT"),C&&n.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,I.fromNodeOutgoingHttpHeaders)(h.value.headers);return r&&y||p.delete(d.NEXT_CACHE_TAGS_HEADER),!h.cacheControl||n.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,E.getCacheControlHeader)(h.cacheControl)),await (0,_.sendResponse)(M,q,new Response(h.value.body,{headers:p,status:h.value.status||200})),null};b?await a(b):await K.withPropagatedContext(e.headers,()=>K.trace(h.BaseServerSpan.handleRequest,{spanName:`${v} ${u}`,kind:l.SpanKind.SERVER,attributes:{"http.method":v,"http.target":e.url}},a))}catch(n){if(n instanceof p.NoFallbackError||await g.onRequestError(e,n,{routerKind:"App Router",routePath:F,routeType:"route",revalidateReason:(0,S.getRevalidateReason)({isStaticGeneration:x,isOnDemandRevalidate:w})},!1,H),y)throw n;return await (0,_.sendResponse)(M,q,new Response(null,{status:500})),null}}e.s(["handler",()=>m,"patchFetch",()=>C,"routeModule",()=>g,"serverHooks",()=>O,"workAsyncStorage",()=>N,"workUnitAsyncStorage",()=>f],26984)}];
|
|
1
|
+
module.exports=[26984,e=>{"use strict";var n=e.i(47909),t=e.i(74017),i=e.i(60476),s=e.i(59756),o=e.i(61916),l=e.i(74677),r=e.i(69741),a=e.i(16795),c=e.i(87718),h=e.i(95169),S=e.i(47587),_=e.i(66012),I=e.i(70101),E=e.i(26937),L=e.i(10372),d=e.i(93695);e.i(52474);var p=e.i(220),u=e.i(89171);async function T(e){let n,t,i=e.headers.get("x-forwarded-host")||e.headers.get("host")||"127.0.0.1:3000",s=e.headers.get("x-forwarded-proto")||"https";new URL(e.url).pathname.replace(/\/api\/setup\/?$/,"");let o=`${s}://${i}`;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# Skill-insight One-Click Setup (PowerShell)\n# =============================================================================\n",'$SKILL_INSIGHT_HOST = "'+o+'"','$SKILL_INSIGHT_BASE_URL = "'+o+'"','\nWrite-Host "🚀 Fetching Skill-insight telemetry components from $SKILL_INSIGHT_BASE_URL..."\n\n# 1. Setup Directories\n$homeDir = $env:USERPROFILE\nNew-Item -ItemType Directory -Force -Path "$homeDir\\.skill-insight" | Out-Null\nNew-Item -ItemType Directory -Force -Path "$homeDir\\.skill-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 "$homeDir\\.openclaw\\agents" | 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\\.skill-insight\\framework_selector.mjs"\n$SELECTOR_RESULT = "$homeDir\\.skill-insight\\.selector_result"\n\n# Install inquirer if not already installed\nSet-Location "$homeDir\\.skill-insight"\nif (-not (Test-Path "node_modules\\inquirer")) {\n Write-Host "📦 Installing inquirer for interactive selection..."\n npm install inquirer --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: \'OpenClaw\', value: \'openclaw\' }\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\', \'║ ✨ 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 const resultFile = process.env.SELECTOR_RESULT_FILE || process.env.USERPROFILE + \'\\\\.skill-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\\.skill-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_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 "openclaw") {\n $INSTALL_OPENCLAW = $true\n}\n\n# Exit if nothing selected\nif (-not $INSTALL_OPENCODE -and -not $INSTALL_CLAUDE -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 Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/api/setup/opencode" -OutFile "$homeDir\\.opencode\\plugins\\Witty-Skill-Insight.ts"\n}\n\nif ($INSTALL_CLAUDE) {\n Write-Host "⏬ Downloading Claude Code Watcher..."\n Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/api/setup/claude-watcher" -OutFile "$homeDir\\.skill-insight\\claude_watcher_client.ts"\n}\n\nif ($INSTALL_OPENCLAW) {\n Write-Host "⏬ Downloading OpenClaw Watcher..."\n Invoke-WebRequest -Uri "$SKILL_INSIGHT_BASE_URL/api/setup/openclaw-watcher" -OutFile "$homeDir\\.skill-insight\\openclaw_watcher_client.ts"\n}\n\n# 4. Configure ~/.skill-insight/.env\n$SKILL_INSIGHT_CONFIG_FILE = "$homeDir\\.skill-insight\\.env"\n$EXISTING_KEY = ""\n$EXISTING_HOST = ""\nif (Test-Path $SKILL_INSIGHT_CONFIG_FILE) {\n $content = Get-Content $SKILL_INSIGHT_CONFIG_FILE\n $keyLine = $content | Select-String \'^SKILL_INSIGHT_API_KEY=\' | Select-Object -First 1\n $hostLine = $content | Select-String \'^SKILL_INSIGHT_HOST=\' | Select-Object -First 1\n if ($keyLine) {\n $EXISTING_KEY = $keyLine.Line.Substring(\'SKILL_INSIGHT_API_KEY=\'.Length)\n }\n if ($hostLine) {\n $EXISTING_HOST = $hostLine.Line.Substring(\'SKILL_INSIGHT_HOST=\'.Length)\n }\n}\n\n# -- API Key Logic --\n$FINAL_KEY = $EXISTING_KEY\nif ($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 "🔑 SKILL_INSIGHT_API_KEY is not set."\n $FINAL_KEY = Read-Host "👉 Please enter your API Key"\n}\n\n# -- Host Logic --\n$FINAL_HOST = $SKILL_INSIGHT_HOST\nif ($EXISTING_HOST -and ($EXISTING_HOST -ne $SKILL_INSIGHT_HOST)) {\n Write-Host "🌐 Current Host in config: $EXISTING_HOST"\n Write-Host "🌐 New Host detected: $SKILL_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 = $SKILL_INSIGHT_HOST\n}\n\nif (-not $FINAL_KEY) {\n Write-Host "⚠️ Warning: No API Key provided. Telemetry upload will fail until you set it in $SKILL_INSIGHT_CONFIG_FILE"\n}\n\nWrite-Host "⚙️ Updating configuration..."\nNew-Item -ItemType File -Path $SKILL_INSIGHT_CONFIG_FILE -Force | Out-Null\nCopy-Item $SKILL_INSIGHT_CONFIG_FILE "$SKILL_INSIGHT_CONFIG_FILE.bak"\n$content = Get-Content "$SKILL_INSIGHT_CONFIG_FILE.bak"\n$content | Where-Object { $_ -notmatch \'^SKILL_INSIGHT_HOST=\' -and $_ -notmatch \'^SKILL_INSIGHT_API_KEY=\' } | Set-Content $SKILL_INSIGHT_CONFIG_FILE\nAdd-Content $SKILL_INSIGHT_CONFIG_FILE "SKILL_INSIGHT_HOST=$FINAL_HOST"\nAdd-Content $SKILL_INSIGHT_CONFIG_FILE "SKILL_INSIGHT_API_KEY=$FINAL_KEY"\nRemove-Item "$SKILL_INSIGHT_CONFIG_FILE.bak" -Force\nWrite-Host "✅ Configuration updated at $SKILL_INSIGHT_CONFIG_FILE"\n\n# 6. Install Watcher Dependencies\nif ($INSTALL_CLAUDE -or $INSTALL_OPENCLAW) {\n Write-Host ""\n Write-Host "📦 Installing watcher dependencies..."\n if (Get-Command npm -ErrorAction SilentlyContinue) {\n Set-Location "$homeDir\\.skill-insight"\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# 7. Create Watcher Startup/Stop Scripts\n$NEEDS_WATCHER_SCRIPTS = $false\nif ($INSTALL_CLAUDE -or $INSTALL_OPENCLAW) {\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_CLAUDE) {\n $startScript = @\'\npkill -f "claude_watcher_client.ts" 2>/dev/null\nSet-Location "$env:USERPROFILE\\.skill-insight"\nStart-Process -FilePath "npx" -ArgumentList "-y", "tsx", "$env:USERPROFILE\\.skill-insight\\claude_watcher_client.ts" -RedirectStandardOutput "$env:USERPROFILE\\.skill-insight\\logs\\claude_watcher.log" -RedirectStandardError "$env:USERPROFILE\\.skill-insight\\logs\\claude_watcher_error.log" -NoNewWindow\nWrite-Host "Claude watcher started"\n\'@\n Set-Content -Path "$homeDir\\.skill-insight\\start_claude_watcher.ps1" -Value $startScript -Encoding UTF8\n\n $stopScript = @\'\nGet-Process | Where-Object { $_.CommandLine -like "*claude_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nRemove-Item "$env:USERPROFILE\\.skill-insight\\claude_watcher.pid" -Force -ErrorAction SilentlyContinue\nWrite-Host "Claude watcher stopped"\n\'@\n Set-Content -Path "$homeDir\\.skill-insight\\stop_claude_watcher.ps1" -Value $stopScript -Encoding UTF8\n }\n\n if ($INSTALL_OPENCLAW) {\n $startScript = @\'\npkill -f "openclaw_watcher_client.ts" 2>/dev/null\nSet-Location "$env:USERPROFILE\\.skill-insight"\nStart-Process -FilePath "npx" -ArgumentList "-y", "tsx", "$env:USERPROFILE\\.skill-insight\\openclaw_watcher_client.ts" -RedirectStandardOutput "$env:USERPROFILE\\.skill-insight\\logs\\openclaw_watcher.log" -RedirectStandardError "$env:USERPROFILE\\.skill-insight\\logs\\openclaw_watcher_error.log" -NoNewWindow\nWrite-Host "OpenClaw watcher started"\n\'@\n Set-Content -Path "$homeDir\\.skill-insight\\start_openclaw_watcher.ps1" -Value $startScript -Encoding UTF8\n\n $stopScript = @\'\nGet-Process | Where-Object { $_.CommandLine -like "*openclaw_watcher_client.ts*" } | Stop-Process -Force -ErrorAction SilentlyContinue\nRemove-Item "$env:USERPROFILE\\.skill-insight\\openclaw_watcher.pid" -Force -ErrorAction SilentlyContinue\nWrite-Host "OpenClaw watcher stopped"\n\'@\n Set-Content -Path "$homeDir\\.skill-insight\\stop_openclaw_watcher.ps1" -Value $stopScript -Encoding UTF8\n }\n\n $combinedStart = \'Write-Host "Starting Skill-Insight watchers..."\'\n if ($INSTALL_CLAUDE) { $combinedStart += [char]10 + "& `"$homeDir\\.skill-insight\\start_claude_watcher.ps1`"" }\n if ($INSTALL_OPENCLAW) { $combinedStart += [char]10 + "& `"$homeDir\\.skill-insight\\start_openclaw_watcher.ps1`"" }\n $combinedStart += [char]10 + \'Write-Host "All watchers started!"\'\n Set-Content -Path "$homeDir\\.skill-insight\\start_watchers.ps1" -Value $combinedStart -Encoding UTF8\n\n $combinedStop = \'Write-Host "Stopping Skill-Insight watchers..."\'\n if ($INSTALL_CLAUDE) { $combinedStop += [char]10 + "& `"$homeDir\\.skill-insight\\stop_claude_watcher.ps1`"" }\n if ($INSTALL_OPENCLAW) { $combinedStop += [char]10 + "& `"$homeDir\\.skill-insight\\stop_openclaw_watcher.ps1`"" }\n $combinedStop += [char]10 + \'Write-Host "All watchers stopped!"\'\n Set-Content -Path "$homeDir\\.skill-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\\.skill-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 "🌟 Skill-Insight Telemetry: READY"\nWrite-Host "------------------------------------------------"\nWrite-Host "Installed Components:"\nif ($INSTALL_OPENCODE) { Write-Host " ✅ OpenCode Plugin: ~/.opencode/plugins/Witty-Skill-Insight.ts" }\nif ($INSTALL_CLAUDE) { Write-Host " ✅ Claude Watcher: ~/.skill-insight/claude_watcher_client.ts" }\nif ($INSTALL_OPENCLAW) { Write-Host " ✅ OpenClaw Watcher: ~/.skill-insight/openclaw_watcher_client.ts" }\n\nif ($NEEDS_WATCHER_SCRIPTS) {\n Write-Host ""\n Write-Host "Watcher Management:"\n Write-Host " Start all: ~/.skill-insight/start_watchers.ps1"\n Write-Host " Stop all: ~/.skill-insight/stop_watchers.ps1"\n Write-Host " Logs: ~/.skill-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. Run: claude (restart terminal first)" }\nif ($INSTALL_OPENCLAW) { Write-Host " 3. OpenClaw will automatically monitor and upload telemetry" }\nWrite-Host "------------------------------------------------"'].join("\n");return new u.NextResponse(e,{headers:{"Content-Type":"text/plain; charset=utf-8"}})}{let e=["#!/bin/bash\n# =============================================================================\n# Skill-insight One-Click Setup\n# =============================================================================\n",'SKILL_INSIGHT_HOST="'+o+'"','SKILL_INSIGHT_BASE_URL="'+o+'"','\necho "🚀 Fetching Skill-insight telemetry components from $SKILL_INSIGHT_BASE_URL..."\n\n# 1. Setup Directories\nmkdir -p "$HOME/.skill-insight"\nmkdir -p "$HOME/.skill-insight/logs"\nmkdir -p "$HOME/.opencode/plugins"\nmkdir -p "$HOME/.opencode/skills"\nmkdir -p "$HOME/.claude/projects"\nmkdir -p "$HOME/.openclaw/agents"\nmkdir -p ".opencode/skills"\necho "📂 Created necessary directories"\n\n# 2. Interactive Framework Selection with inquirer\necho ""\n\nSELECTOR_SCRIPT="$HOME/.skill-insight/framework_selector.mjs"\nSELECTOR_RESULT="$HOME/.skill-insight/.selector_result"\n\n# Install inquirer if not already installed\ncd "$HOME/.skill-insight"\nif [ ! -d "node_modules/inquirer" ]; then\n echo "📦 Installing inquirer for interactive selection..."\n npm install inquirer --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: \'OpenClaw\', value: \'openclaw\' }\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\', \'║ ✨ 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 const resultFile = process.env.SELECTOR_RESULT_FILE || process.env.HOME + \'/.skill-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/.skill-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_OPENCLAW=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" == *"openclaw"* ]]; then\n INSTALL_OPENCLAW=true\nfi\n\n# Exit if nothing selected\nif [ "$INSTALL_OPENCODE" = "false" ] && [ "$INSTALL_CLAUDE" = "false" ] && [ "$INSTALL_OPENCLAW" = "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 curl -sSf "$SKILL_INSIGHT_BASE_URL/api/setup/opencode" -o "$HOME/.opencode/plugins/Witty-Skill-Insight.ts"\nfi\n\nif [ "$INSTALL_CLAUDE" = "true" ]; then\n echo "⏬ Downloading Claude Code Watcher..."\n curl -sSf "$SKILL_INSIGHT_BASE_URL/api/setup/claude-watcher" -o "$HOME/.skill-insight/claude_watcher_client.ts"\nfi\n\nif [ "$INSTALL_OPENCLAW" = "true" ]; then\n echo "⏬ Downloading OpenClaw Watcher..."\n curl -sSf "$SKILL_INSIGHT_BASE_URL/api/setup/openclaw-watcher" -o "$HOME/.skill-insight/openclaw_watcher_client.ts"\nfi\n\n# 4. Configure ~/.skill-insight/.env\nSKILL_INSIGHT_CONFIG_FILE="$HOME/.skill-insight/.env"\nEXISTING_KEY=""\nEXISTING_HOST=""\nif [ -f "$SKILL_INSIGHT_CONFIG_FILE" ]; then\n EXISTING_KEY=$(grep \'^SKILL_INSIGHT_API_KEY=\' "$SKILL_INSIGHT_CONFIG_FILE" | head -n 1 | cut -d\'=\' -f2-)\n EXISTING_HOST=$(grep \'^SKILL_INSIGHT_HOST=\' "$SKILL_INSIGHT_CONFIG_FILE" | head -n 1 | cut -d\'=\' -f2-)\nfi\n\n# -- API Key Logic --\nFINAL_KEY="$EXISTING_KEY"\nif [ -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 "🔑 SKILL_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="$SKILL_INSIGHT_HOST"\nif [ -n "$EXISTING_HOST" ] && [ "$EXISTING_HOST" != "$SKILL_INSIGHT_HOST" ]; then\n echo "🌐 Current Host in config: $EXISTING_HOST"\n echo "🌐 New Host detected: $SKILL_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="$SKILL_INSIGHT_HOST"\nfi\n\nif [ -z "$FINAL_KEY" ]; then\n echo "⚠️ Warning: No API Key provided. Telemetry upload will fail until you set it in $SKILL_INSIGHT_CONFIG_FILE"\nfi\n\necho "⚙️ Updating configuration..."\ntouch "$SKILL_INSIGHT_CONFIG_FILE"\ncp "$SKILL_INSIGHT_CONFIG_FILE" "${SKILL_INSIGHT_CONFIG_FILE}.bak"\ngrep -v "^SKILL_INSIGHT_HOST=" "${SKILL_INSIGHT_CONFIG_FILE}.bak" | grep -v "^SKILL_INSIGHT_API_KEY=" > "$SKILL_INSIGHT_CONFIG_FILE"\necho "SKILL_INSIGHT_HOST=$FINAL_HOST" >> "$SKILL_INSIGHT_CONFIG_FILE"\necho "SKILL_INSIGHT_API_KEY=$FINAL_KEY" >> "$SKILL_INSIGHT_CONFIG_FILE"\nrm "${SKILL_INSIGHT_CONFIG_FILE}.bak"\necho "✅ Configuration updated at $SKILL_INSIGHT_CONFIG_FILE"\n\n# 6. Install Watcher Dependencies\nif [ "$INSTALL_CLAUDE" = "true" ] || [ "$INSTALL_OPENCLAW" = "true" ]; then\n echo ""\n echo "📦 Installing watcher dependencies..."\n if command -v npm &> /dev/null; then\n cd "$HOME/.skill-insight"\n if [ ! -f "package.json" ]; then\n echo \'{"name": "skill-insight-watcher", "version": "1.0.0", "type": "module", "dependencies": {}}\' > package.json\n fi\n npm install chokidar --save 2>/dev/null\n echo "✅ Dependencies installed"\n else\n echo "⚠️ npm not found. Skipping dependency installation."\n fi\nfi\n\n# 7. Create Watcher Startup/Stop Scripts\nNEEDS_WATCHER_SCRIPTS=false\nif [ "$INSTALL_CLAUDE" = "true" ] || [ "$INSTALL_OPENCLAW" = "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_CLAUDE" = "true" ]; then\n cat > "$HOME/.skill-insight/start_claude_watcher.sh" << \'WATCHER_EOF\'\n#!/bin/bash\npkill -f "claude_watcher_client.ts" 2>/dev/null\ncd "$HOME/.skill-insight" && nohup npx -y tsx "$HOME/.skill-insight/claude_watcher_client.ts" > "$HOME/.skill-insight/logs/claude_watcher.log" 2>&1 &\necho $! > "$HOME/.skill-insight/claude_watcher.pid"\necho "Claude watcher started with PID $(cat $HOME/.skill-insight/claude_watcher.pid)"\nWATCHER_EOF\n chmod +x "$HOME/.skill-insight/start_claude_watcher.sh"\n\n cat > "$HOME/.skill-insight/stop_claude_watcher.sh" << \'STOP_CLAUDE_EOF\'\n#!/bin/bash\npkill -f "claude_watcher_client.ts" 2>/dev/null\nrm -f "$HOME/.skill-insight/claude_watcher.pid"\necho "Claude watcher stopped"\nSTOP_CLAUDE_EOF\n chmod +x "$HOME/.skill-insight/stop_claude_watcher.sh"\n fi\n\n if [ "$INSTALL_OPENCLAW" = "true" ]; then\n cat > "$HOME/.skill-insight/start_openclaw_watcher.sh" << \'WATCHER_EOF\'\n#!/bin/bash\npkill -f "openclaw_watcher_client.ts" 2>/dev/null\ncd "$HOME/.skill-insight" && nohup npx -y tsx "$HOME/.skill-insight/openclaw_watcher_client.ts" > "$HOME/.skill-insight/logs/openclaw_watcher.log" 2>&1 &\necho $! > "$HOME/.skill-insight/openclaw_watcher.pid"\necho "OpenClaw watcher started with PID $(cat $HOME/.skill-insight/openclaw_watcher.pid)"\nWATCHER_EOF\n chmod +x "$HOME/.skill-insight/start_openclaw_watcher.sh"\n\n cat > "$HOME/.skill-insight/stop_openclaw_watcher.sh" << \'STOP_OPENCLAW_EOF\'\n#!/bin/bash\npkill -f "openclaw_watcher_client.ts" 2>/dev/null\nrm -f "$HOME/.skill-insight/openclaw_watcher.pid"\necho "OpenClaw watcher stopped"\nSTOP_OPENCLAW_EOF\n chmod +x "$HOME/.skill-insight/stop_openclaw_watcher.sh"\n fi\n\n cat > "$HOME/.skill-insight/start_watchers.sh" << \'WATCHER_HEADER\'\n#!/bin/bash\necho "Starting Skill-Insight watchers..."\nWATCHER_HEADER\n if [ "$INSTALL_CLAUDE" = "true" ]; then echo \'"$HOME/.skill-insight/start_claude_watcher.sh"\' >> "$HOME/.skill-insight/start_watchers.sh"; fi\n if [ "$INSTALL_OPENCLAW" = "true" ]; then echo \'"$HOME/.skill-insight/start_openclaw_watcher.sh"\' >> "$HOME/.skill-insight/start_watchers.sh"; fi\n echo \'echo "All watchers started!"\' >> "$HOME/.skill-insight/start_watchers.sh"\n chmod +x "$HOME/.skill-insight/start_watchers.sh"\n\n cat > "$HOME/.skill-insight/stop_watchers.sh" << \'STOP_HEADER\'\n#!/bin/bash\necho "Stopping Skill-Insight watchers..."\nSTOP_HEADER\n if [ "$INSTALL_CLAUDE" = "true" ]; then echo \'"$HOME/.skill-insight/stop_claude_watcher.sh"\' >> "$HOME/.skill-insight/stop_watchers.sh"; fi\n if [ "$INSTALL_OPENCLAW" = "true" ]; then echo \'"$HOME/.skill-insight/stop_openclaw_watcher.sh"\' >> "$HOME/.skill-insight/stop_watchers.sh"; fi\n echo \'echo "All watchers stopped!"\' >> "$HOME/.skill-insight/stop_watchers.sh"\n chmod +x "$HOME/.skill-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/.skill-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 "🌟 Skill-Insight Telemetry: READY"\necho "------------------------------------------------"\necho "Installed Components:"\nif [ "$INSTALL_OPENCODE" = "true" ]; then echo " ✅ OpenCode Plugin: ~/.opencode/plugins/Witty-Skill-Insight.ts"; fi\nif [ "$INSTALL_CLAUDE" = "true" ]; then echo " ✅ Claude Watcher: ~/.skill-insight/claude_watcher_client.ts"; fi\nif [ "$INSTALL_OPENCLAW" = "true" ]; then echo " ✅ OpenClaw Watcher: ~/.skill-insight/openclaw_watcher_client.ts"; fi\n\nif [ "$NEEDS_WATCHER_SCRIPTS" = "true" ]; then\n echo ""\n echo "Watcher Management:"\n echo " Start all: ~/.skill-insight/start_watchers.sh"\n echo " Stop all: ~/.skill-insight/stop_watchers.sh"\n echo " Logs: ~/.skill-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. Run: claude (restart terminal first)"; fi\nif [ "$INSTALL_OPENCLAW" = "true" ]; then echo " 3. OpenClaw will automatically monitor and upload telemetry"; fi\necho "------------------------------------------------"'].join("\n");return new u.NextResponse(e,{headers:{"Content-Type":"text/x-shellscript"}})}}e.s(["GET",()=>T],21965);var $=e.i(21965);let N=new n.AppRouteRouteModule({definition:{kind:t.RouteKind.APP_ROUTE,page:"/api/setup/route",pathname:"/api/setup",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/setup/route.ts",nextConfigOutput:"standalone",userland:$}),{workAsyncStorage:g,workUnitAsyncStorage:O,serverHooks:C}=N;function m(){return(0,i.patchFetch)({workAsyncStorage:g,workUnitAsyncStorage:O})}async function w(e,n,i){N.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let u="/api/setup/route";u=u.replace(/\/index$/,"")||"/";let T=await N.prepare(e,n,{srcPage:u,multiZoneDraftMode:!1});if(!T)return n.statusCode=400,n.end("Bad Request"),null==i.waitUntil||i.waitUntil.call(i,Promise.resolve()),null;let{buildId:$,params:g,nextConfig:O,parsedUrl:C,isDraftMode:m,prerenderManifest:w,routerServerContext:H,isOnDemandRevalidate:f,revalidateOnlyGenerated:A,resolvedPathname:R,clientReferenceManifest:k,serverActionsManifest:F}=T,P=(0,r.normalizeAppPath)(u),W=!!(w.dynamicRoutes[P]||w.routes[R]),G=async()=>((null==H?void 0:H.render404)?await H.render404(e,n,C,!1):n.end("This page could not be found"),null);if(W&&!m){let e=!!w.routes[R],n=w.dynamicRoutes[P];if(n&&!1===n.fallback&&!e){if(O.experimental.adapterPath)return await G();throw new d.NoFallbackError}}let D=null;!W||N.isDev||m||(D="/index"===(D=R)?"/":D);let y=!0===N.isDev||!W,K=W&&!y;F&&k&&(0,l.setManifestsSingleton)({page:u,clientReferenceManifest:k,serverActionsManifest:F});let v=e.method||"GET",x=(0,o.getTracer)(),b=x.getActiveScopeSpan(),U={params:g,prerenderManifest:w,renderOpts:{experimental:{authInterrupts:!!O.experimental.authInterrupts},cacheComponents:!!O.cacheComponents,supportsDynamicResponse:y,incrementalCache:(0,s.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:O.cacheLife,waitUntil:i.waitUntil,onClose:e=>{n.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(n,t,i,s)=>N.onRequestError(e,n,i,s,H)},sharedContext:{buildId:$}},M=new a.NodeNextRequest(e),q=new a.NodeNextResponse(n),X=c.NextRequestAdapter.fromNodeNextRequest(M,(0,c.signalFromNodeResponse)(n));try{let l=async e=>N.handle(X,U).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")!==h.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=`${v} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":n}),e.updateName(n)}else e.updateName(`${v} ${u}`)}),r=!!(0,s.getRequestMeta)(e,"minimalMode"),a=async s=>{var o,a;let c=async({previousCacheEntry:t})=>{try{if(!r&&f&&A&&!t)return n.statusCode=404,n.setHeader("x-nextjs-cache","REVALIDATED"),n.end("This page could not be found"),null;let o=await l(s);e.fetchMetrics=U.renderOpts.fetchMetrics;let a=U.renderOpts.pendingWaitUntil;a&&i.waitUntil&&(i.waitUntil(a),a=void 0);let c=U.renderOpts.collectedTags;if(!W)return await (0,_.sendResponse)(M,q,o,U.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),n=(0,I.toNodeOutgoingHttpHeaders)(o.headers);c&&(n[L.NEXT_CACHE_TAGS_HEADER]=c),!n["content-type"]&&e.type&&(n["content-type"]=e.type);let t=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=L.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,i=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=L.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:p.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:n},cacheControl:{revalidate:t,expire:i}}}}catch(n){throw(null==t?void 0:t.isStale)&&await N.onRequestError(e,n,{routerKind:"App Router",routePath:u,routeType:"route",revalidateReason:(0,S.getRevalidateReason)({isStaticGeneration:K,isOnDemandRevalidate:f})},!1,H),n}},h=await N.handleResponse({req:e,nextConfig:O,cacheKey:D,routeKind:t.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:w,isRoutePPREnabled:!1,isOnDemandRevalidate:f,revalidateOnlyGenerated:A,responseGenerator:c,waitUntil:i.waitUntil,isMinimalMode:r});if(!W)return null;if((null==h||null==(o=h.value)?void 0:o.kind)!==p.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==h||null==(a=h.value)?void 0:a.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});r||n.setHeader("x-nextjs-cache",f?"REVALIDATED":h.isMiss?"MISS":h.isStale?"STALE":"HIT"),m&&n.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,I.fromNodeOutgoingHttpHeaders)(h.value.headers);return r&&W||d.delete(L.NEXT_CACHE_TAGS_HEADER),!h.cacheControl||n.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,E.getCacheControlHeader)(h.cacheControl)),await (0,_.sendResponse)(M,q,new Response(h.value.body,{headers:d,status:h.value.status||200})),null};b?await a(b):await x.withPropagatedContext(e.headers,()=>x.trace(h.BaseServerSpan.handleRequest,{spanName:`${v} ${u}`,kind:o.SpanKind.SERVER,attributes:{"http.method":v,"http.target":e.url}},a))}catch(n){if(n instanceof d.NoFallbackError||await N.onRequestError(e,n,{routerKind:"App Router",routePath:P,routeType:"route",revalidateReason:(0,S.getRevalidateReason)({isStaticGeneration:K,isOnDemandRevalidate:f})},!1,H),W)throw n;return await (0,_.sendResponse)(M,q,new Response(null,{status:500})),null}}e.s(["handler",()=>w,"patchFetch",()=>m,"routeModule",()=>N,"serverHooks",()=>C,"workAsyncStorage",()=>g,"workUnitAsyncStorage",()=>O],26984)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=node_modules_next_dist_esm_build_templates_app-route_f42faeee.js.map
|