@witty-ai/skill-insight 0.3.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 +51 -6
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +2 -0
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +12 -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 +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- 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/apikey/route.js +2 -2
- package/.next/standalone/.next/server/app/api/auth/apikey/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/organization/route/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 +5 -5
- 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 +5 -4
- package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/config/status/route.js +2 -2
- package/.next/standalone/.next/server/app/api/config/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/data/route.js +5 -4
- 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 +4 -4
- package/.next/standalone/.next/server/app/api/executions/[executionId]/analyze-match/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/guide/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/guide/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/guide/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/guide/route.js +7 -0
- package/.next/standalone/.next/server/app/api/guide/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/guide/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/guide/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/otel/v1/logs/route.js +5 -4
- 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 +5 -4
- 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 +3 -3
- 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 +5 -4
- package/.next/standalone/.next/server/app/api/proxy/[taskId]/end/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/proxy/[taskId]/start/route.js +2 -2
- package/.next/standalone/.next/server/app/api/proxy/[taskId]/start/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/rejudge/route.js +5 -4
- package/.next/standalone/.next/server/app/api/rejudge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/session/route.js +5 -5
- package/.next/standalone/.next/server/app/api/session/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/settings/route.js +2 -2
- package/.next/standalone/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/settings/test/route.js +2 -2
- package/.next/standalone/.next/server/app/api/settings/test/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/activate/route.js +2 -2
- package/.next/standalone/.next/server/app/api/skills/[id]/activate/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/toggle/route.js +2 -2
- package/.next/standalone/.next/server/app/api/skills/[id]/toggle/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/download/route.js +3 -3
- 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 +4 -4
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/parse-flow/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/route.js +2 -2
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/[version]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/route.js +2 -2
- package/.next/standalone/.next/server/app/api/skills/[id]/versions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/automation/import/route.js +2 -2
- package/.next/standalone/.next/server/app/api/skills/automation/import/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/automation/push/route.js +2 -2
- package/.next/standalone/.next/server/app/api/skills/automation/push/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/by-name/route.js +2 -2
- package/.next/standalone/.next/server/app/api/skills/by-name/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/logs/route.js +5 -4
- package/.next/standalone/.next/server/app/api/skills/logs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/route.js +2 -2
- package/.next/standalone/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/upload/route.js +2 -2
- package/.next/standalone/.next/server/app/api/skills/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sync/manifest/route.js +2 -2
- package/.next/standalone/.next/server/app/api/sync/manifest/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sync/opencode/route.js +2 -2
- package/.next/standalone/.next/server/app/api/sync/opencode/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/upload/route.js +5 -3
- package/.next/standalone/.next/server/app/api/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/details/page/react-loadable-manifest.json +3 -3
- 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 +5 -5
- package/.next/standalone/.next/server/app/details.segments/_full.segment.rsc +5 -5
- 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 +5 -5
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -5
- 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 +5 -5
- package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +5 -5
- 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 +5 -5
- package/.next/standalone/.next/server/app/skills.segments/_full.segment.rsc +5 -5
- 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 +2 -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]__05e510f4._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0a140a5a._.js +122 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1013b265._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1c95bcde._.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]__591248f3._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__5d8178f6._.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]__6d8053e2._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__6fc12878._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__73ce6d21._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__863cf6de._.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]__9d551ea2._.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]__c6c98b22._.js → [root-of-the-server]__aa5c8858._.js} +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b11acc79._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__b835ea7f._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ba01f286._.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 +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__d9b9fecc._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e280561d._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e2f0baee._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e550423c._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__fc05579d._.js +3 -0
- package/.next/standalone/.next/server/chunks/_33c0c729._.js +1 -1
- package/.next/standalone/.next/server/chunks/_41a98bd8._.js +3 -0
- package/.next/standalone/.next/server/chunks/_c48f7c66._.js +1 -1
- package/.next/standalone/.next/server/chunks/_c82df3e0._.js +3 -3
- package/.next/standalone/.next/server/chunks/_cd3d20ca._.js +1 -1
- package/.next/standalone/.next/server/chunks/_fa49adfa._.js +3 -3
- 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/_next-internal_server_app_api_guide_route_actions_6c188449.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_c33286ed.js +71 -110
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_f42faeee.js +1 -400
- package/.next/standalone/.next/server/chunks/src_497d2ad2._.js +22 -22
- package/.next/standalone/.next/server/chunks/src_c8971a2d._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_12408140._.js +3 -0
- 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]__72a7f3ed._.js → [root-of-the-server]__48f8fbcb._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__438a2c90._.js → [root-of-the-server]__49921b2a._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__51073007._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__c9e3c893._.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]__37bfda90._.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]__1dfe61f8._.js → [root-of-the-server]__d691ecb0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__d0917d6e._.js → [root-of-the-server]__e5ddfd15._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__e5e3a145._.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]__8a82ef12._.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/{_981cd263._.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 +18 -42
- package/.next/standalone/.next/server/chunks/ssr/_fd46f439._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_a4a1f3c3._.js → node_modules_039c6a11._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_a7a82280._.js → node_modules_0d3530cd._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_0c2939c3._.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_205ce1c9._.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_ee43cfd6._.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_776b68cf._.js → node_modules_44966ab2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_514c148b._.js +3 -0
- 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_23d38260._.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_60cf7de2._.js → node_modules_6c42f75c._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_2f215d2b._.js → node_modules_6fbe276d._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_4cd41088._.js → node_modules_740e9d59._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_d0af4cb2._.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_db8af6e3._.js → node_modules_8a892761._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_28fef057._.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_abf4f826._.js → node_modules_acc9d529._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_39a3e684._.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_8633bac6._.js → node_modules_b4ef036d._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_abc9e5a6._.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_f56b62b0._.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_5ab83f0a._.js → node_modules_c411d7df._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_c98dd942._.js → node_modules_c6469d93._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_6391b0cd._.js → node_modules_c704e802._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_df113a74._.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_be61cdef._.js → node_modules_e8927fc2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_katex_dist_katex_mjs_d037b3b1._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_mermaid_dist_chunks_mermaid_core_chunk-7R4GIKGN_mjs_e5dda8cc._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_66a70595._.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/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/{d60f0b3e2f4689ac.js → 01eddf501c574a44.js} +1 -1
- package/.next/{static/chunks/ec0de430276c8209.js → standalone/.next/static/chunks/078d76156083f265.js} +1 -1
- package/.next/standalone/.next/static/chunks/{6a17b619eed04f07.js → 07c9f28a269c701a.js} +2 -2
- package/.next/standalone/.next/static/chunks/1e782a49beaf489c.js +1 -0
- package/.next/{static/chunks/55723b38de737547.js → standalone/.next/static/chunks/21105f8885631d60.js} +1 -1
- package/.next/standalone/.next/static/chunks/4071dbec4cf7e72e.js +109 -0
- package/.next/{static/chunks/052f178ab7519d8d.js → standalone/.next/static/chunks/5432ce4a494bc74d.js} +2 -2
- package/.next/standalone/.next/static/chunks/59cd76b8d89e776a.js +1 -0
- package/.next/standalone/.next/static/chunks/67bd1a5de2195779.js +1 -0
- package/.next/standalone/.next/static/chunks/6baf949fafec6be3.js +1 -0
- package/.next/standalone/.next/static/chunks/737b8cff3c6a4e30.js +1 -0
- package/.next/standalone/.next/static/chunks/7e35f4cf2e266022.js +1 -0
- package/.next/standalone/.next/static/chunks/a87b5e84254095a5.js +1 -0
- package/.next/standalone/.next/static/chunks/b43afe7d924243d9.js +2 -0
- package/.next/standalone/.next/static/chunks/c6bd2818656b1f20.css +1 -0
- package/.next/{static/chunks/559e55a53f22f5d1.js → standalone/.next/static/chunks/c875bd2ff662b46f.js} +1 -1
- package/.next/{static/chunks/6d12c79948c7e0ac.js → standalone/.next/static/chunks/dc59a07a8f327b40.js} +1 -1
- package/.next/standalone/.next/static/chunks/e09d9ee16fe90255.js +1 -0
- package/.next/standalone/.next/static/chunks/{20337e5244416041.js → e20b02ee30c11a26.js} +1 -1
- package/.next/standalone/.next/static/chunks/ff6357067630b168.js +1 -0
- package/.next/standalone/LICENSE +1 -1
- package/.next/standalone/bin/cli.js +1 -1
- package/.next/standalone/features/feature-skill-used-jump-link/design/2026-03-18-skill-used-jump-link-design.md +126 -0
- package/.next/standalone/features/feature-skill-used-jump-link/feature.json +32 -0
- package/.next/standalone/features/feature-skill-used-jump-link/issue.md +32 -0
- package/.next/standalone/features/feature-skill-used-jump-link/plans/2026-03-18-skill-used-jump-link.md +528 -0
- package/.next/standalone/next.config.ts +14 -2
- package/.next/standalone/node_modules/.prisma/client/edge.js +23 -5
- package/.next/standalone/node_modules/.prisma/client/index-browser.js +20 -2
- package/.next/standalone/node_modules/.prisma/client/index.js +23 -5
- package/.next/standalone/node_modules/.prisma/client/package.json +1 -1
- package/.next/standalone/node_modules/.prisma/client/schema.prisma +19 -2
- package/.next/standalone/node_modules/.prisma/client/wasm.js +20 -2
- package/.next/standalone/node_modules/@img/colour/color.cjs +11 -9
- package/.next/standalone/node_modules/@img/colour/package.json +21 -8
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/prisma/schema.prisma +19 -2
- package/.next/standalone/scripts/activate_telemetry.sh +24 -24
- package/.next/standalone/scripts/claude_watcher_client.ts +9 -7
- package/.next/standalone/scripts/init_opengauss.py +15 -0
- package/.next/standalone/scripts/install.js +68 -35
- package/.next/standalone/scripts/logs.js +1 -1
- package/.next/standalone/scripts/openclaw_watcher_client.ts +9 -7
- package/.next/standalone/scripts/opencode_plugin.ts +278 -46
- package/.next/standalone/scripts/postinstall.js +80 -38
- package/.next/standalone/scripts/restart.js +1 -1
- package/.next/standalone/scripts/start.js +84 -60
- package/.next/standalone/scripts/status.js +1 -1
- package/.next/standalone/scripts/stop.js +38 -14
- package/.next/standalone/scripts/sync_skills.js +5 -5
- package/.next/standalone/scripts/utils.js +91 -23
- package/.next/standalone/tests/setup_skill_optimizer.sh +118 -0
- package/.next/static/chunks/{d60f0b3e2f4689ac.js → 01eddf501c574a44.js} +1 -1
- package/.next/{standalone/.next/static/chunks/ec0de430276c8209.js → static/chunks/078d76156083f265.js} +1 -1
- package/.next/static/chunks/{6a17b619eed04f07.js → 07c9f28a269c701a.js} +2 -2
- package/.next/static/chunks/1e782a49beaf489c.js +1 -0
- package/.next/{standalone/.next/static/chunks/55723b38de737547.js → static/chunks/21105f8885631d60.js} +1 -1
- package/.next/static/chunks/4071dbec4cf7e72e.js +109 -0
- package/.next/{standalone/.next/static/chunks/052f178ab7519d8d.js → static/chunks/5432ce4a494bc74d.js} +2 -2
- package/.next/static/chunks/59cd76b8d89e776a.js +1 -0
- package/.next/static/chunks/67bd1a5de2195779.js +1 -0
- package/.next/static/chunks/6baf949fafec6be3.js +1 -0
- package/.next/static/chunks/737b8cff3c6a4e30.js +1 -0
- package/.next/static/chunks/7e35f4cf2e266022.js +1 -0
- package/.next/static/chunks/a87b5e84254095a5.js +1 -0
- package/.next/static/chunks/b43afe7d924243d9.js +2 -0
- package/.next/static/chunks/c6bd2818656b1f20.css +1 -0
- package/.next/{standalone/.next/static/chunks/559e55a53f22f5d1.js → static/chunks/c875bd2ff662b46f.js} +1 -1
- package/.next/{standalone/.next/static/chunks/6d12c79948c7e0ac.js → static/chunks/dc59a07a8f327b40.js} +1 -1
- package/.next/static/chunks/e09d9ee16fe90255.js +1 -0
- package/.next/static/chunks/{20337e5244416041.js → e20b02ee30c11a26.js} +1 -1
- package/.next/static/chunks/ff6357067630b168.js +1 -0
- package/LICENSE +1 -1
- package/README.md +7 -6
- package/bin/cli.js +1 -1
- package/package.json +1 -1
- package/prisma/schema.prisma +19 -2
- package/scripts/activate_telemetry.sh +24 -24
- package/scripts/claude_watcher_client.ts +9 -7
- package/scripts/init_opengauss.py +15 -0
- package/scripts/install.js +68 -35
- package/scripts/logs.js +1 -1
- package/scripts/openclaw_watcher_client.ts +9 -7
- package/scripts/opencode_plugin.ts +278 -46
- package/scripts/postinstall.js +80 -38
- package/scripts/restart.js +1 -1
- package/scripts/start.js +84 -60
- package/scripts/status.js +1 -1
- package/scripts/stop.js +38 -14
- package/scripts/sync_skills.js +5 -5
- package/scripts/utils.js +91 -23
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1306e4eb._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1809fb2b._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__19594bdd._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__19db3d34._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__2b2e7f49._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__3c02de9b._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__3f3ad12b._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4c1ad182._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__4dce0fe6._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__582cdc68._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__625e84f3._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__68b5a8b3._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__704b8533._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__78ea20f2._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__7f754db9._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__824c33e1._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__92449e6d._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__9465727f._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__9c3018b5._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a12846e0._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a637116a._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a8f83ee4._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a8ffc1b1._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__a9cb205c._.js +0 -122
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ab7048b0._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ac25e4ae._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ae5ac9cd._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__bebf4267._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c5ae3ebd._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ebdafae4._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__eefd5f5b._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__082c32a2._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_b7889f85._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_0b762d3e._.js +0 -3
- package/.next/standalone/.next/static/chunks/024c9acb4aa490c8.js +0 -1
- package/.next/standalone/.next/static/chunks/104f2c1fb93033c0.js +0 -1
- package/.next/standalone/.next/static/chunks/222a937a6c859036.js +0 -1
- package/.next/standalone/.next/static/chunks/2e1b2125198a02c4.js +0 -1
- package/.next/standalone/.next/static/chunks/32b26ff1bbd034fd.js +0 -1
- package/.next/standalone/.next/static/chunks/428e6cf64b115e9d.css +0 -1
- package/.next/standalone/.next/static/chunks/62e251619a96dc26.js +0 -1
- package/.next/standalone/.next/static/chunks/65c652f23d2d68bd.js +0 -133
- package/.next/standalone/.next/static/chunks/876e2d70185fd438.js +0 -1
- package/.next/standalone/.next/static/chunks/c647b2e4532050e0.js +0 -1
- package/.next/standalone/.next/static/chunks/d2e574310159a10b.js +0 -1
- package/.next/standalone/.next/static/chunks/dab1749712763979.js +0 -2
- package/.next/static/chunks/024c9acb4aa490c8.js +0 -1
- package/.next/static/chunks/104f2c1fb93033c0.js +0 -1
- package/.next/static/chunks/222a937a6c859036.js +0 -1
- package/.next/static/chunks/2e1b2125198a02c4.js +0 -1
- package/.next/static/chunks/32b26ff1bbd034fd.js +0 -1
- package/.next/static/chunks/428e6cf64b115e9d.css +0 -1
- package/.next/static/chunks/62e251619a96dc26.js +0 -1
- package/.next/static/chunks/65c652f23d2d68bd.js +0 -133
- package/.next/static/chunks/876e2d70185fd438.js +0 -1
- package/.next/static/chunks/c647b2e4532050e0.js +0 -1
- package/.next/static/chunks/d2e574310159a10b.js +0 -1
- package/.next/static/chunks/dab1749712763979.js +0 -2
- /package/.next/standalone/.next/static/{Zt2VD1Py2IilfVNJL-9Wm → H581Rok68JtPV4bAVVH3l}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{Zt2VD1Py2IilfVNJL-9Wm → H581Rok68JtPV4bAVVH3l}/_clientMiddlewareManifest.json +0 -0
- /package/.next/standalone/.next/static/{Zt2VD1Py2IilfVNJL-9Wm → H581Rok68JtPV4bAVVH3l}/_ssgManifest.js +0 -0
- /package/.next/static/{Zt2VD1Py2IilfVNJL-9Wm → H581Rok68JtPV4bAVVH3l}/_buildManifest.js +0 -0
- /package/.next/static/{Zt2VD1Py2IilfVNJL-9Wm → H581Rok68JtPV4bAVVH3l}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{Zt2VD1Py2IilfVNJL-9Wm → H581Rok68JtPV4bAVVH3l}/_ssgManifest.js +0 -0
|
@@ -18,9 +18,151 @@ function logDebug(msg) {
|
|
|
18
18
|
|
|
19
19
|
// Global store
|
|
20
20
|
let sessionStore = new Map();
|
|
21
|
-
let uploadedSessions = new
|
|
21
|
+
let uploadedSessions = new Map(); // sessionId -> uploaded message count
|
|
22
22
|
let sessionGraph = new Map(); // parent_id -> [child_ids]
|
|
23
23
|
let pendingChildSessions = new Map(); // child_id -> {parent_id, data}
|
|
24
|
+
let lastDeltaByPartField = new Map();
|
|
25
|
+
|
|
26
|
+
const STORE_PATH = path.join(os.homedir(), '.opencode', 'witty_plugin_session_store.json');
|
|
27
|
+
|
|
28
|
+
function cleanupOldSessions() {
|
|
29
|
+
const now = Date.now();
|
|
30
|
+
const threeDays = 3 * 24 * 3600 * 1000;
|
|
31
|
+
|
|
32
|
+
let deletedCount = 0;
|
|
33
|
+
for (const [msgId, entry] of sessionStore.entries()) {
|
|
34
|
+
const time = entry.info?.created || entry.info?.time?.created;
|
|
35
|
+
if (time && (now - time > threeDays)) {
|
|
36
|
+
sessionStore.delete(msgId);
|
|
37
|
+
deletedCount++;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (deletedCount > 0) logDebug(`Cleaned up ${deletedCount} old messages from sessionStore`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function loadStore() {
|
|
44
|
+
try {
|
|
45
|
+
if (fs.existsSync(STORE_PATH)) {
|
|
46
|
+
const fileData = fs.readFileSync(STORE_PATH, 'utf8');
|
|
47
|
+
if (!fileData.trim()) return;
|
|
48
|
+
const data = JSON.parse(fileData);
|
|
49
|
+
|
|
50
|
+
// Merge sessionStore: disk entries fill in gaps, but don't overwrite in-memory entries
|
|
51
|
+
if (data.sessionStore) {
|
|
52
|
+
const diskStore = new Map(data.sessionStore);
|
|
53
|
+
for (const [msgId, entry] of diskStore.entries()) {
|
|
54
|
+
if (!sessionStore.has(msgId)) {
|
|
55
|
+
if (entry.parts && !Array.isArray(entry.parts) && typeof entry.parts === 'object' && !(entry.parts instanceof Map)) {
|
|
56
|
+
entry.parts = new Map(Object.entries(entry.parts));
|
|
57
|
+
} else if (Array.isArray(entry.parts)) {
|
|
58
|
+
entry.parts = new Map(entry.parts);
|
|
59
|
+
} else if (!entry.parts) {
|
|
60
|
+
entry.parts = new Map();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (entry.toolParts && !Array.isArray(entry.toolParts) && typeof entry.toolParts === 'object' && !(entry.toolParts instanceof Map)) {
|
|
64
|
+
entry.toolParts = new Map(Object.entries(entry.toolParts));
|
|
65
|
+
} else if (Array.isArray(entry.toolParts)) {
|
|
66
|
+
entry.toolParts = new Map(entry.toolParts);
|
|
67
|
+
} else if (!entry.toolParts) {
|
|
68
|
+
entry.toolParts = new Map();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
sessionStore.set(msgId, entry);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Merge uploadedSessions: keep the "newer" signature between memory and disk
|
|
77
|
+
if (data.uploadedSessions) {
|
|
78
|
+
for (const x of data.uploadedSessions) {
|
|
79
|
+
const sid = Array.isArray(x) ? x[0] : x;
|
|
80
|
+
const diskVal = Array.isArray(x) ? x[1] : 0;
|
|
81
|
+
|
|
82
|
+
const normalize = (v) => {
|
|
83
|
+
if (typeof v === 'number') return { count: v, lastAssistantLen: 0, lastTs: 0 };
|
|
84
|
+
if (v && typeof v === 'object') {
|
|
85
|
+
return {
|
|
86
|
+
count: Number(v.count || 0),
|
|
87
|
+
lastAssistantLen: Number(v.lastAssistantLen || 0),
|
|
88
|
+
lastTs: Number(v.lastTs || 0)
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return { count: 0, lastAssistantLen: 0, lastTs: 0 };
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const memSig = normalize(uploadedSessions.get(sid));
|
|
95
|
+
const diskSig = normalize(diskVal);
|
|
96
|
+
|
|
97
|
+
const diskNewer =
|
|
98
|
+
diskSig.count > memSig.count ||
|
|
99
|
+
(diskSig.count === memSig.count && diskSig.lastAssistantLen > memSig.lastAssistantLen) ||
|
|
100
|
+
(diskSig.count === memSig.count && diskSig.lastAssistantLen === memSig.lastAssistantLen && diskSig.lastTs > memSig.lastTs);
|
|
101
|
+
|
|
102
|
+
if (diskNewer) {
|
|
103
|
+
uploadedSessions.set(sid, diskVal);
|
|
104
|
+
} else if (!uploadedSessions.has(sid)) {
|
|
105
|
+
uploadedSessions.set(sid, memSig);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Merge sessionGraph: union child lists
|
|
111
|
+
if (data.sessionGraph) {
|
|
112
|
+
const diskGraph = new Map(data.sessionGraph);
|
|
113
|
+
for (const [parentId, childIds] of diskGraph.entries()) {
|
|
114
|
+
if (!sessionGraph.has(parentId)) {
|
|
115
|
+
sessionGraph.set(parentId, childIds);
|
|
116
|
+
} else {
|
|
117
|
+
const existing = sessionGraph.get(parentId);
|
|
118
|
+
for (const cid of childIds) {
|
|
119
|
+
if (!existing.includes(cid)) existing.push(cid);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Merge pendingChildSessions
|
|
126
|
+
if (data.pendingChildSessions) {
|
|
127
|
+
const diskPending = new Map(data.pendingChildSessions);
|
|
128
|
+
for (const [childId, childData] of diskPending.entries()) {
|
|
129
|
+
if (!pendingChildSessions.has(childId)) {
|
|
130
|
+
pendingChildSessions.set(childId, childData);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
logDebug(`Loaded store (merged): ${sessionStore.size} messages`);
|
|
136
|
+
}
|
|
137
|
+
} catch(e) {
|
|
138
|
+
logDebug("Store read err: " + e.message);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function saveStore() {
|
|
143
|
+
try {
|
|
144
|
+
cleanupOldSessions();
|
|
145
|
+
|
|
146
|
+
// Merge with disk state to prevent concurrent process data loss.
|
|
147
|
+
// loadStore() uses merge semantics (won't overwrite in-memory entries).
|
|
148
|
+
loadStore();
|
|
149
|
+
|
|
150
|
+
const data = {
|
|
151
|
+
sessionStore: Array.from(sessionStore.entries()).map(([k, v]) => [k, {
|
|
152
|
+
...v,
|
|
153
|
+
parts: v.parts instanceof Map ? Array.from(v.parts.entries()) : (v.parts || []),
|
|
154
|
+
toolParts: v.toolParts instanceof Map ? Array.from(v.toolParts.entries()) : (v.toolParts || [])
|
|
155
|
+
}]),
|
|
156
|
+
uploadedSessions: Array.from(uploadedSessions.entries()),
|
|
157
|
+
sessionGraph: Array.from(sessionGraph.entries()),
|
|
158
|
+
pendingChildSessions: Array.from(pendingChildSessions.entries()),
|
|
159
|
+
timestamp: new Date().toISOString()
|
|
160
|
+
};
|
|
161
|
+
fs.writeFileSync(STORE_PATH, JSON.stringify(data, null, 2), 'utf8');
|
|
162
|
+
} catch(e) {
|
|
163
|
+
logDebug("Store sync err: " + e.message);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
24
166
|
|
|
25
167
|
function toMsTimestamp(v) {
|
|
26
168
|
if (v == null) return null;
|
|
@@ -74,7 +216,7 @@ function getRequestOptions(targetUrl, apiKey, bodyLength) {
|
|
|
74
216
|
let options = {
|
|
75
217
|
hostname: targetUrl.hostname,
|
|
76
218
|
port: targetUrl.port || (protocol === 'https:' ? 443 : 80),
|
|
77
|
-
path:
|
|
219
|
+
path: (targetUrl.pathname === '/' ? '' : targetUrl.pathname) + '/api/upload',
|
|
78
220
|
method: 'POST',
|
|
79
221
|
headers: {
|
|
80
222
|
'Content-Type': 'application/json',
|
|
@@ -103,7 +245,7 @@ function getRequestOptions(targetUrl, apiKey, bodyLength) {
|
|
|
103
245
|
function loadConfiguration() {
|
|
104
246
|
let config = {};
|
|
105
247
|
try {
|
|
106
|
-
const envPath = path.join(os.homedir(), '.
|
|
248
|
+
const envPath = path.join(os.homedir(), '.skill-insight', '.env');
|
|
107
249
|
if (fs.existsSync(envPath)) {
|
|
108
250
|
const content = fs.readFileSync(envPath, 'utf8');
|
|
109
251
|
content.split('\n').forEach(line => {
|
|
@@ -113,18 +255,19 @@ function loadConfiguration() {
|
|
|
113
255
|
}
|
|
114
256
|
} catch (e) {}
|
|
115
257
|
return {
|
|
116
|
-
apiKey: config['
|
|
117
|
-
host: config['
|
|
258
|
+
apiKey: config['SKILL_INSIGHT_API_KEY'] || process.env.SKILL_INSIGHT_API_KEY,
|
|
259
|
+
host: config['SKILL_INSIGHT_HOST'] || process.env.SKILL_INSIGHT_HOST
|
|
118
260
|
};
|
|
119
261
|
}
|
|
120
262
|
|
|
121
263
|
function collectSessionMessages(sessionId) {
|
|
122
264
|
const messages = [];
|
|
265
|
+
logDebug(`collectSessionMessages: scanning ${sessionStore.size} entries for session ${sessionId}`);
|
|
123
266
|
for (const [mid, entry] of sessionStore.entries()) {
|
|
124
267
|
if (entry.info.sessionID === sessionId) {
|
|
125
268
|
// Calculate latency for this message if possible from parts
|
|
126
269
|
let partBasedDuration = 0;
|
|
127
|
-
if (entry.parts.size > 0) {
|
|
270
|
+
if (entry.parts instanceof Map && entry.parts.size > 0) {
|
|
128
271
|
const parts = Array.from(entry.parts.values()).map(p => p.time?.start || 0).filter(t => t > 0).sort((a,b)=>a-b);
|
|
129
272
|
if (parts.length >= 1) {
|
|
130
273
|
const start = parts[0];
|
|
@@ -133,9 +276,13 @@ function collectSessionMessages(sessionId) {
|
|
|
133
276
|
}
|
|
134
277
|
}
|
|
135
278
|
|
|
279
|
+
const role = entry.info.role || 'unknown';
|
|
280
|
+
const content = entry.content || entry.info.content || "";
|
|
281
|
+
logDebug(`Found message in store: id=${mid}, role=${role}, content_len=${content.length}`);
|
|
282
|
+
|
|
136
283
|
messages.push({
|
|
137
|
-
role:
|
|
138
|
-
content:
|
|
284
|
+
role: role,
|
|
285
|
+
content: content,
|
|
139
286
|
tool_calls: entry.info.tool_calls || entry.info.toolCalls,
|
|
140
287
|
function_call: entry.info.function_call || entry.info.functionCall,
|
|
141
288
|
usage: entry.info.usage || entry.info.tokens,
|
|
@@ -147,6 +294,7 @@ function collectSessionMessages(sessionId) {
|
|
|
147
294
|
});
|
|
148
295
|
}
|
|
149
296
|
}
|
|
297
|
+
logDebug(`collectSessionMessages: collected ${messages.length} messages for ${sessionId}`);
|
|
150
298
|
return messages;
|
|
151
299
|
}
|
|
152
300
|
|
|
@@ -196,6 +344,7 @@ function collectSessionWithChildren(sessionId) {
|
|
|
196
344
|
}
|
|
197
345
|
|
|
198
346
|
export default async function WittySkillInsightPlugin(input) {
|
|
347
|
+
loadStore();
|
|
199
348
|
const { apiKey, host } = loadConfiguration();
|
|
200
349
|
if (!apiKey || !host) {
|
|
201
350
|
logDebug("Plugin disabled: Missing API Key or Host");
|
|
@@ -212,7 +361,7 @@ export default async function WittySkillInsightPlugin(input) {
|
|
|
212
361
|
|
|
213
362
|
// Auto-Sync Skills on Startup
|
|
214
363
|
try {
|
|
215
|
-
const syncScript = path.join(os.homedir(), '.
|
|
364
|
+
const syncScript = path.join(os.homedir(), '.skill-insight', 'sync_skills.ts');
|
|
216
365
|
if (fs.existsSync(syncScript)) {
|
|
217
366
|
const cp = require('child_process');
|
|
218
367
|
// Run async to avoid blocking
|
|
@@ -254,23 +403,6 @@ export default async function WittySkillInsightPlugin(input) {
|
|
|
254
403
|
// Attempt to find session ID in various places
|
|
255
404
|
const sessionId = event.session_id || event.properties?.sessionID || event.payload?.session_id;
|
|
256
405
|
|
|
257
|
-
// 0. Handle session.created events to establish parent-child relationships
|
|
258
|
-
if (event.type === 'session.created') {
|
|
259
|
-
const sessionInfo = event.properties?.info || event.payload?.info;
|
|
260
|
-
if (sessionInfo && sessionInfo.id && sessionInfo.parentID) {
|
|
261
|
-
const childId = sessionInfo.id;
|
|
262
|
-
const parentId = sessionInfo.parentID;
|
|
263
|
-
|
|
264
|
-
if (!sessionGraph.has(parentId)) {
|
|
265
|
-
sessionGraph.set(parentId, []);
|
|
266
|
-
}
|
|
267
|
-
if (!sessionGraph.get(parentId).includes(childId)) {
|
|
268
|
-
sessionGraph.get(parentId).push(childId);
|
|
269
|
-
logDebug(`Session created: ${childId} is child of ${parentId}`);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
406
|
// 1. Accumulate Message Metadata
|
|
275
407
|
if (event.type === 'message.created' || event.type === 'message.updated') {
|
|
276
408
|
let info = (event.payload && event.payload.message) || (event.properties && event.properties.info);
|
|
@@ -309,6 +441,8 @@ export default async function WittySkillInsightPlugin(input) {
|
|
|
309
441
|
});
|
|
310
442
|
}
|
|
311
443
|
const entry = sessionStore.get(msgId);
|
|
444
|
+
if (!(entry.parts instanceof Map)) entry.parts = new Map(Array.isArray(entry.parts) ? entry.parts : []);
|
|
445
|
+
if (entry.toolParts && !(entry.toolParts instanceof Map)) entry.toolParts = new Map(Array.isArray(entry.toolParts) ? entry.toolParts : []);
|
|
312
446
|
|
|
313
447
|
// Store part
|
|
314
448
|
const partId = part.id || `temp_${Date.now()}_${Math.random()}`;
|
|
@@ -414,22 +548,81 @@ export default async function WittySkillInsightPlugin(input) {
|
|
|
414
548
|
}
|
|
415
549
|
}
|
|
416
550
|
|
|
551
|
+
if (event.type === 'message.part.delta') {
|
|
552
|
+
const props = event.properties || event.payload || {};
|
|
553
|
+
const msgId = props.messageID || props.message_id;
|
|
554
|
+
const partId = props.partID || props.part_id;
|
|
555
|
+
const field = props.field;
|
|
556
|
+
const delta = props.delta;
|
|
557
|
+
|
|
558
|
+
if (msgId && partId && field && typeof delta === 'string') {
|
|
559
|
+
if (!sessionStore.has(msgId)) {
|
|
560
|
+
sessionStore.set(msgId, {
|
|
561
|
+
info: { sessionID: sessionId },
|
|
562
|
+
parts: new Map(),
|
|
563
|
+
toolParts: new Map(),
|
|
564
|
+
content: ''
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
const entry = sessionStore.get(msgId);
|
|
569
|
+
if (!(entry.parts instanceof Map)) entry.parts = new Map(Array.isArray(entry.parts) ? entry.parts : []);
|
|
570
|
+
|
|
571
|
+
const dedupeKey = `${msgId}:${partId}:${field}`;
|
|
572
|
+
const lastDelta = lastDeltaByPartField.get(dedupeKey);
|
|
573
|
+
if (lastDelta !== delta) {
|
|
574
|
+
lastDeltaByPartField.set(dedupeKey, delta);
|
|
575
|
+
if (lastDeltaByPartField.size > 5000) {
|
|
576
|
+
for (const k of lastDeltaByPartField.keys()) {
|
|
577
|
+
lastDeltaByPartField.delete(k);
|
|
578
|
+
if (lastDeltaByPartField.size <= 4000) break;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
const existingPart = entry.parts.get(partId) || {
|
|
583
|
+
id: partId,
|
|
584
|
+
messageID: msgId,
|
|
585
|
+
sessionID: sessionId,
|
|
586
|
+
type: 'text'
|
|
587
|
+
};
|
|
588
|
+
const prev = typeof existingPart[field] === 'string' ? existingPart[field] : '';
|
|
589
|
+
existingPart[field] = prev + delta;
|
|
590
|
+
entry.parts.set(partId, existingPart);
|
|
591
|
+
|
|
592
|
+
let full = "";
|
|
593
|
+
const sortedParts = Array.from(entry.parts.values()).sort((a, b) => {
|
|
594
|
+
const ta = a.time?.start || (a.meta && a.meta.start) || 0;
|
|
595
|
+
const tb = b.time?.start || (b.meta && b.meta.start) || 0;
|
|
596
|
+
return ta - tb;
|
|
597
|
+
});
|
|
598
|
+
|
|
599
|
+
for (const p of sortedParts) {
|
|
600
|
+
if (p.text) full += p.text;
|
|
601
|
+
else if (p.content) full += p.content;
|
|
602
|
+
}
|
|
603
|
+
entry.content = full;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
417
608
|
// 3. Upload on Session Idle
|
|
418
609
|
if (event.type === "session.idle") {
|
|
419
610
|
if (!sessionId || !sessionId.startsWith("ses")) return;
|
|
420
611
|
|
|
421
|
-
//
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
612
|
+
// Reload store from disk to pick up any data written by
|
|
613
|
+
// concurrent child processes (e.g. opencode run executed
|
|
614
|
+
// from within the opencode interactive interface).
|
|
615
|
+
loadStore();
|
|
616
|
+
|
|
617
|
+
// Only treat a session as "child" when it was detected via Task tool
|
|
618
|
+
// (i.e. registered in sessionGraph). Do NOT rely on event.parentID because
|
|
619
|
+
// nested `opencode run ...` can also set parentID and we want both sessions uploaded.
|
|
620
|
+
let foundParentId = null;
|
|
621
|
+
for (const [potentialParent, childIds] of sessionGraph.entries()) {
|
|
622
|
+
if (childIds.includes(sessionId)) {
|
|
623
|
+
foundParentId = potentialParent;
|
|
624
|
+
logDebug(`Found parent ${foundParentId} for for child ${sessionId} from sessionGraph`);
|
|
625
|
+
break;
|
|
433
626
|
}
|
|
434
627
|
}
|
|
435
628
|
|
|
@@ -587,11 +780,38 @@ export default async function WittySkillInsightPlugin(input) {
|
|
|
587
780
|
timestamp: new Date().toISOString()
|
|
588
781
|
};
|
|
589
782
|
|
|
590
|
-
|
|
591
|
-
|
|
783
|
+
let lastTs = 0;
|
|
784
|
+
for (const m of messages) {
|
|
785
|
+
const t1 = toMsTimestamp(m.timestamp) || 0;
|
|
786
|
+
const t2 = toMsTimestamp(m.timeInfo?.completed) || 0;
|
|
787
|
+
const t3 = toMsTimestamp(m.timeInfo?.created) || 0;
|
|
788
|
+
lastTs = Math.max(lastTs, t1, t2, t3);
|
|
789
|
+
}
|
|
790
|
+
const lastAssistantLen = (lastAssistantContent || '').length;
|
|
791
|
+
|
|
792
|
+
const normalize = (v) => {
|
|
793
|
+
if (typeof v === 'number') return { count: v, lastAssistantLen: 0, lastTs: 0 };
|
|
794
|
+
if (v && typeof v === 'object') {
|
|
795
|
+
return {
|
|
796
|
+
count: Number(v.count || 0),
|
|
797
|
+
lastAssistantLen: Number(v.lastAssistantLen || 0),
|
|
798
|
+
lastTs: Number(v.lastTs || 0)
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
return { count: 0, lastAssistantLen: 0, lastTs: 0 };
|
|
802
|
+
};
|
|
803
|
+
|
|
804
|
+
const prevSig = normalize(uploadedSessions.get(sessionId));
|
|
805
|
+
const shouldSkip =
|
|
806
|
+
messages.length <= prevSig.count &&
|
|
807
|
+
lastAssistantLen <= prevSig.lastAssistantLen &&
|
|
808
|
+
lastTs <= prevSig.lastTs;
|
|
809
|
+
|
|
810
|
+
if (shouldSkip) {
|
|
811
|
+
logDebug(`Session ${sessionId} already uploaded (count=${prevSig.count}, lastAssistantLen=${prevSig.lastAssistantLen}, lastTs=${prevSig.lastTs}) (cur: count=${messages.length}, lastAssistantLen=${lastAssistantLen}, lastTs=${lastTs}), skipping.`);
|
|
592
812
|
return;
|
|
593
813
|
}
|
|
594
|
-
uploadedSessions.
|
|
814
|
+
uploadedSessions.set(sessionId, { count: messages.length, lastAssistantLen, lastTs });
|
|
595
815
|
|
|
596
816
|
const body = JSON.stringify(payload);
|
|
597
817
|
logDebug(`Payload Body Size: ${Buffer.byteLength(body)} bytes`);
|
|
@@ -658,16 +878,27 @@ try {
|
|
|
658
878
|
// We must explicitly resolve the node binary path.
|
|
659
879
|
let nodeBin = 'node';
|
|
660
880
|
try {
|
|
661
|
-
|
|
881
|
+
const nodeCmd = process.platform === 'win32' ? 'where node' : 'which node';
|
|
882
|
+
nodeBin = cp.execSync(nodeCmd, { encoding: 'utf8', timeout: 3000 }).trim() || 'node';
|
|
883
|
+
if (process.platform === 'win32') {
|
|
884
|
+
const lines = nodeBin.split('\n');
|
|
885
|
+
nodeBin = lines[0].trim() || 'node';
|
|
886
|
+
}
|
|
662
887
|
} catch (e) {
|
|
663
888
|
logDebug(`Could not resolve node path, falling back to 'node'`);
|
|
664
889
|
}
|
|
665
|
-
|
|
666
|
-
logDebug(`Launching uploader
|
|
890
|
+
|
|
891
|
+
logDebug(`Launching uploader: node=${nodeBin}, script=${scriptPath}`);
|
|
667
892
|
try {
|
|
668
|
-
cp.
|
|
893
|
+
const uploader = cp.spawn(nodeBin, [scriptPath], {
|
|
894
|
+
detached: true,
|
|
895
|
+
stdio: ['ignore', fs.openSync(logPath, 'a'), fs.openSync(logPath, 'a')],
|
|
896
|
+
windowsHide: true
|
|
897
|
+
});
|
|
898
|
+
uploader.unref();
|
|
899
|
+
logDebug(`Uploader spawned successfully (PID: ${uploader.pid})`);
|
|
669
900
|
} catch (spawnErr) {
|
|
670
|
-
logDebug(`
|
|
901
|
+
logDebug(`spawn uploader error: ${spawnErr.message}`);
|
|
671
902
|
}
|
|
672
903
|
|
|
673
904
|
/*
|
|
@@ -681,6 +912,7 @@ try {
|
|
|
681
912
|
} catch (err) {
|
|
682
913
|
logDebug(`Plugin Exception: ${err.message}`);
|
|
683
914
|
}
|
|
915
|
+
saveStore();
|
|
684
916
|
}
|
|
685
917
|
};
|
|
686
918
|
}
|
package/scripts/postinstall.js
CHANGED
|
@@ -7,67 +7,85 @@ const path = require('path')
|
|
|
7
7
|
const {
|
|
8
8
|
ensureEnvFile,
|
|
9
9
|
ensureDataDirectory,
|
|
10
|
-
runCommand
|
|
10
|
+
runCommand,
|
|
11
|
+
getDataRoot,
|
|
12
|
+
migrateDataIfNeeded
|
|
11
13
|
} = require('./utils.js')
|
|
12
14
|
|
|
13
15
|
const PACKAGE_ROOT = path.resolve(__dirname, '..')
|
|
14
16
|
|
|
15
|
-
console.log('===
|
|
17
|
+
console.log('=== Skill-Insight Post-Install Initialization ===\n')
|
|
16
18
|
|
|
17
19
|
try {
|
|
18
|
-
|
|
20
|
+
migrateDataIfNeeded()
|
|
19
21
|
console.log()
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
|
|
23
|
+
ensureEnvFile()
|
|
24
|
+
console.log()
|
|
25
|
+
|
|
26
|
+
ensureDataDirectory()
|
|
22
27
|
console.log()
|
|
23
|
-
|
|
28
|
+
|
|
29
|
+
const dataRoot = getDataRoot()
|
|
30
|
+
const dbPath = path.join(dataRoot, 'data', 'witty_insight.db')
|
|
31
|
+
const dbUrl = `file:${dbPath}`
|
|
32
|
+
process.env.DATABASE_URL = dbUrl
|
|
33
|
+
|
|
24
34
|
console.log('Syncing database schema...')
|
|
25
|
-
execSync('npx prisma db push', {
|
|
35
|
+
execSync('npx prisma db push', {
|
|
36
|
+
stdio: 'inherit',
|
|
37
|
+
cwd: PACKAGE_ROOT,
|
|
38
|
+
env: { ...process.env, DATABASE_URL: dbUrl }
|
|
39
|
+
})
|
|
26
40
|
console.log('✓ Database schema synced')
|
|
27
41
|
console.log()
|
|
28
|
-
|
|
42
|
+
|
|
29
43
|
console.log('Generating Prisma client...')
|
|
30
|
-
execSync('npx prisma generate', {
|
|
44
|
+
execSync('npx prisma generate', {
|
|
45
|
+
stdio: 'inherit',
|
|
46
|
+
cwd: PACKAGE_ROOT,
|
|
47
|
+
env: { ...process.env, DATABASE_URL: dbUrl }
|
|
48
|
+
})
|
|
31
49
|
console.log('✓ Prisma client generated')
|
|
32
50
|
console.log()
|
|
33
|
-
|
|
51
|
+
|
|
34
52
|
const standaloneDir = path.join(PACKAGE_ROOT, '.next', 'standalone')
|
|
35
53
|
if (fs.existsSync(standaloneDir)) {
|
|
36
54
|
console.log('Setting up standalone environment...')
|
|
37
|
-
|
|
55
|
+
|
|
38
56
|
const staticDir = path.join(PACKAGE_ROOT, '.next', 'static')
|
|
39
57
|
const standaloneStaticDir = path.join(standaloneDir, '.next', 'static')
|
|
40
|
-
|
|
58
|
+
|
|
41
59
|
if (fs.existsSync(staticDir) && !fs.existsSync(standaloneStaticDir)) {
|
|
42
60
|
fs.mkdirSync(path.dirname(standaloneStaticDir), { recursive: true })
|
|
43
|
-
|
|
61
|
+
fs.cpSync(staticDir, standaloneStaticDir, { recursive: true })
|
|
44
62
|
console.log('✓ Static files copied to standalone')
|
|
45
63
|
}
|
|
46
|
-
|
|
64
|
+
|
|
47
65
|
const publicDir = path.join(PACKAGE_ROOT, 'public')
|
|
48
66
|
const standalonePublicDir = path.join(standaloneDir, 'public')
|
|
49
|
-
|
|
67
|
+
|
|
50
68
|
if (fs.existsSync(publicDir) && !fs.existsSync(standalonePublicDir)) {
|
|
51
|
-
|
|
69
|
+
fs.cpSync(publicDir, standalonePublicDir, { recursive: true })
|
|
52
70
|
console.log('✓ Public files copied to standalone')
|
|
53
71
|
}
|
|
54
|
-
|
|
72
|
+
|
|
55
73
|
const prismaClientDir = path.join(PACKAGE_ROOT, 'node_modules', '.prisma', 'client')
|
|
56
74
|
const standaloneNodeModules = path.join(standaloneDir, 'node_modules')
|
|
57
75
|
const standalonePrismaDir = path.join(standaloneNodeModules, '.prisma')
|
|
58
76
|
const standaloneClientDir = path.join(standalonePrismaDir, 'client')
|
|
59
|
-
|
|
77
|
+
|
|
60
78
|
if (fs.existsSync(prismaClientDir)) {
|
|
61
79
|
fs.mkdirSync(standalonePrismaDir, { recursive: true })
|
|
62
|
-
|
|
80
|
+
|
|
63
81
|
if (fs.existsSync(standaloneClientDir)) {
|
|
64
82
|
fs.rmSync(standaloneClientDir, { recursive: true, force: true })
|
|
65
83
|
}
|
|
66
|
-
|
|
67
|
-
|
|
84
|
+
|
|
85
|
+
fs.cpSync(prismaClientDir, standaloneClientDir, { recursive: true })
|
|
68
86
|
console.log('✓ Prisma client copied to standalone')
|
|
69
87
|
}
|
|
70
|
-
|
|
88
|
+
|
|
71
89
|
const pgDir = path.join(PACKAGE_ROOT, 'node_modules', 'pg')
|
|
72
90
|
if (fs.existsSync(pgDir)) {
|
|
73
91
|
if (!fs.existsSync(standaloneNodeModules)) {
|
|
@@ -75,61 +93,85 @@ try {
|
|
|
75
93
|
}
|
|
76
94
|
const standalonePgDir = path.join(standaloneNodeModules, 'pg')
|
|
77
95
|
if (!fs.existsSync(standalonePgDir)) {
|
|
78
|
-
|
|
96
|
+
fs.cpSync(pgDir, standalonePgDir, { recursive: true })
|
|
79
97
|
console.log('✓ pg module copied to standalone')
|
|
80
98
|
}
|
|
81
99
|
}
|
|
82
|
-
|
|
100
|
+
|
|
83
101
|
const chunksDir = path.join(standaloneDir, '.next', 'server', 'chunks')
|
|
84
102
|
if (fs.existsSync(chunksDir)) {
|
|
85
103
|
const chunkFiles = fs.readdirSync(chunksDir).filter(f => f.endsWith('.js'))
|
|
86
104
|
let foundPrismaHash = null
|
|
87
105
|
let foundPgHash = null
|
|
88
|
-
|
|
106
|
+
|
|
89
107
|
for (const file of chunkFiles) {
|
|
90
108
|
const filePath = path.join(chunksDir, file)
|
|
91
109
|
const content = fs.readFileSync(filePath, 'utf8')
|
|
92
|
-
|
|
110
|
+
|
|
93
111
|
if (!foundPrismaHash) {
|
|
94
112
|
const prismaHashMatch = content.match(/@prisma\/client-([a-f0-9]+)/)
|
|
95
113
|
if (prismaHashMatch) {
|
|
96
114
|
foundPrismaHash = prismaHashMatch[1]
|
|
97
115
|
}
|
|
98
116
|
}
|
|
99
|
-
|
|
117
|
+
|
|
100
118
|
if (!foundPgHash) {
|
|
101
119
|
const pgHashMatch = content.match(/["']pg-([a-f0-9]+)["']/)
|
|
102
120
|
if (pgHashMatch) {
|
|
103
121
|
foundPgHash = pgHashMatch[1]
|
|
104
122
|
}
|
|
105
123
|
}
|
|
106
|
-
|
|
124
|
+
|
|
107
125
|
if (foundPrismaHash && foundPgHash) {
|
|
108
126
|
break
|
|
109
127
|
}
|
|
110
128
|
}
|
|
111
|
-
|
|
129
|
+
|
|
112
130
|
if (foundPrismaHash) {
|
|
113
131
|
const hashName = `@prisma/client-${foundPrismaHash}`
|
|
114
132
|
const hashDir = path.join(standaloneNodeModules, hashName)
|
|
115
|
-
|
|
133
|
+
|
|
116
134
|
if (!fs.existsSync(hashDir)) {
|
|
117
135
|
fs.mkdirSync(path.dirname(hashDir), { recursive: true })
|
|
118
|
-
|
|
119
|
-
|
|
136
|
+
if (process.platform === 'win32') {
|
|
137
|
+
try {
|
|
138
|
+
fs.symlinkSync(standaloneClientDir, hashDir, 'junction')
|
|
139
|
+
console.log(`✓ Created junction: ${hashName} -> .prisma/client`)
|
|
140
|
+
} catch (err) {
|
|
141
|
+
console.log(`⚠️ Could not create junction on Windows: ${err.message}`)
|
|
142
|
+
console.log(` Falling back to copying directory...`)
|
|
143
|
+
fs.cpSync(standaloneClientDir, hashDir, { recursive: true })
|
|
144
|
+
console.log(`✓ Copied directory: ${hashName}`)
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
fs.symlinkSync(standaloneClientDir, hashDir, 'dir')
|
|
148
|
+
console.log(`✓ Created symlink: ${hashName} -> .prisma/client`)
|
|
149
|
+
}
|
|
120
150
|
}
|
|
121
151
|
} else {
|
|
122
152
|
console.log('⚠️ Could not find Prisma hash in build output')
|
|
123
153
|
}
|
|
124
|
-
|
|
154
|
+
|
|
125
155
|
if (foundPgHash) {
|
|
126
156
|
const pgHashName = `pg-${foundPgHash}`
|
|
127
157
|
const pgHashDir = path.join(standaloneNodeModules, pgHashName)
|
|
128
158
|
const pgTargetDir = path.join(standaloneNodeModules, 'pg')
|
|
129
|
-
|
|
159
|
+
|
|
130
160
|
if (!fs.existsSync(pgHashDir) && fs.existsSync(pgTargetDir)) {
|
|
131
|
-
|
|
132
|
-
|
|
161
|
+
if (process.platform === 'win32') {
|
|
162
|
+
try {
|
|
163
|
+
fs.symlinkSync(pgTargetDir, pgHashDir, 'junction')
|
|
164
|
+
console.log(`✓ Created junction: ${pgHashName} -> pg`)
|
|
165
|
+
} catch (err) {
|
|
166
|
+
console.log(`⚠️ Could not create junction on Windows: ${err.message}`)
|
|
167
|
+
console.log(` Falling back to copying directory...`)
|
|
168
|
+
fs.cpSync(pgTargetDir, pgHashDir, { recursive: true })
|
|
169
|
+
console.log(`✓ Copied directory: ${pgHashName}`)
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
fs.symlinkSync(pgTargetDir, pgHashDir, 'dir')
|
|
173
|
+
console.log(`✓ Created symlink: ${pgHashName} -> pg`)
|
|
174
|
+
}
|
|
133
175
|
}
|
|
134
176
|
} else {
|
|
135
177
|
console.log('⚠️ Could not find pg hash in build output')
|
|
@@ -137,7 +179,7 @@ try {
|
|
|
137
179
|
}
|
|
138
180
|
console.log()
|
|
139
181
|
}
|
|
140
|
-
|
|
182
|
+
|
|
141
183
|
console.log('=== Initialization Complete ===')
|
|
142
184
|
console.log('\nStart the service with:')
|
|
143
185
|
console.log(' npx @witty-ai/skill-insight start')
|
|
@@ -147,4 +189,4 @@ try {
|
|
|
147
189
|
} catch (error) {
|
|
148
190
|
console.error('\n❌ Initialization failed:', error.message)
|
|
149
191
|
process.exit(1)
|
|
150
|
-
}
|
|
192
|
+
}
|
package/scripts/restart.js
CHANGED