@witty-ai/skill-insight 0.5.0-beta → 0.6.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 +5 -0
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +4 -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 +24 -0
- package/.next/standalone/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/config/route.js +3 -3
- package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/data/route.js +3 -3
- package/.next/standalone/.next/server/app/api/data/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/otel/v1/logs/route.js +3 -3
- 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]/end/route.js +4 -4
- 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 +3 -3
- package/.next/standalone/.next/server/app/api/rejudge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/session/route.js +1 -1
- package/.next/standalone/.next/server/app/api/session/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route.js +6 -0
- package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/setup/opencode-commands/si-optimizer/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/setup/opencode-tui/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/setup/opencode-tui/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/setup/opencode-tui/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/setup/opencode-tui/route.js +6 -0
- package/.next/standalone/.next/server/app/api/setup/opencode-tui/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/setup/opencode-tui/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/setup/opencode-tui/route_client-reference-manifest.js +2 -0
- 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]/route.js +3 -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/automation/import/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/logs/route.js +2 -2
- 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 +3 -2
- package/.next/standalone/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route.js +8 -0
- package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/skills/sync-enterprise/route_client-reference-manifest.js +2 -0
- package/.next/standalone/.next/server/app/api/task-stats/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/task-stats/route/build-manifest.json +11 -0
- package/.next/standalone/.next/server/app/api/task-stats/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/task-stats/route.js +11 -0
- package/.next/standalone/.next/server/app/api/task-stats/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/task-stats/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/task-stats/route_client-reference-manifest.js +2 -0
- 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/react-loadable-manifest.json +2 -2
- 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 +2 -2
- package/.next/standalone/.next/server/app/details.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/details.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/details.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/details.segments/_tree.segment.rsc +1 -1
- 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 +2 -2
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.html +1 -1
- package/.next/standalone/.next/server/app/login.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/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 +1 -1
- package/.next/standalone/.next/server/app/skills.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.segments/skills/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/skills.segments/skills.segment.rsc +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__15dbd1f2._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ce5e3b8._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__53775b48._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__6923eecf._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__6d8053e2._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__8402dfd1._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__863cf6de._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__89404730._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__aa5c8858._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__c20da96a._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__ddf63a21._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__f9e66e02._.js +3 -0
- package/.next/standalone/.next/server/chunks/_3e8b4d8c._.js +1 -1
- package/.next/standalone/.next/server/chunks/_41a98bd8._.js +1 -1
- package/.next/standalone/.next/server/chunks/_4c806e26._.js +3 -0
- package/.next/standalone/.next/server/chunks/_cd3d20ca._.js +1 -1
- package/.next/standalone/.next/server/chunks/_ddffef3e._.js +1 -1
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_setup_opencode-tui_route_actions_fc8ae29f.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_skills_sync-enterprise_route_actions_0ca45899.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_task-stats_route_actions_983505cd.js +3 -0
- package/.next/standalone/.next/server/chunks/ce889_server_app_api_setup_opencode-commands_si-optimizer_route_actions_fcde30ef.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_c33286ed.js +47 -4
- 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_98433cb8._.js +175 -0
- package/.next/standalone/.next/server/chunks/src_lib_12408140._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_c8c8c083._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_fd46f439._.js +2 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_dagre-d3-es_src_dagre_index_3582f3d0.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_lodash-es_a1341fea._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_lodash-es_e1de6ed8._.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/{01eddf501c574a44.js → 4ee8dc41c9f15b7b.js} +1 -1
- package/.next/standalone/.next/static/chunks/{737b8cff3c6a4e30.js → 9445b2873a413c58.js} +1 -1
- package/.next/standalone/.next/static/chunks/94dfb15df65ef720.js +2 -0
- package/.next/standalone/.next/static/chunks/9d1c5c3494fa53de.js +109 -0
- package/.next/standalone/.next/static/chunks/{e09d9ee16fe90255.js → cd0fde15dc0dfcca.js} +1 -1
- package/.next/standalone/.next/static/chunks/{ff6357067630b168.js → e13d208072a48316.js} +1 -1
- package/.next/standalone/node_modules/.prisma/client/edge.js +6 -3
- package/.next/standalone/node_modules/.prisma/client/index-browser.js +3 -0
- package/.next/standalone/node_modules/.prisma/client/index.js +6 -3
- package/.next/standalone/node_modules/.prisma/client/package.json +1 -1
- package/.next/standalone/node_modules/.prisma/client/schema.prisma +12 -9
- package/.next/standalone/node_modules/.prisma/client/wasm.js +3 -0
- package/.next/standalone/node_modules/adm-zip/util/constants.js +142 -0
- package/.next/standalone/node_modules/adm-zip/util/decoder.js +5 -0
- package/.next/standalone/node_modules/adm-zip/util/errors.js +63 -0
- package/.next/standalone/node_modules/adm-zip/util/fattr.js +76 -0
- package/.next/standalone/node_modules/adm-zip/util/index.js +5 -0
- package/.next/standalone/node_modules/adm-zip/util/utils.js +339 -0
- package/.next/standalone/package.json +6 -2
- package/.next/standalone/prisma/schema.prisma +3 -0
- package/.next/standalone/scripts/opencode_plugin.ts +23 -5
- package/.next/standalone/scripts/opencode_tui_plugin.tsx +308 -0
- package/.next/standalone/scripts/si-optimizer.md +5 -0
- package/.next/static/chunks/{01eddf501c574a44.js → 4ee8dc41c9f15b7b.js} +1 -1
- package/.next/static/chunks/{737b8cff3c6a4e30.js → 9445b2873a413c58.js} +1 -1
- package/.next/static/chunks/94dfb15df65ef720.js +2 -0
- package/.next/static/chunks/9d1c5c3494fa53de.js +109 -0
- package/.next/static/chunks/{e09d9ee16fe90255.js → cd0fde15dc0dfcca.js} +1 -1
- package/.next/static/chunks/{ff6357067630b168.js → e13d208072a48316.js} +1 -1
- package/package.json +6 -2
- package/prisma/schema.prisma +3 -0
- package/scripts/activate_telemetry.sh +44 -1
- package/scripts/opencode_plugin.ts +23 -5
- package/scripts/opencode_tui_plugin.tsx +308 -0
- package/scripts/si-optimizer.md +5 -0
- package/scripts/utils.js +0 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__e2f0baee._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__fc05579d._.js +0 -3
- package/.next/standalone/.next/server/chunks/src_497d2ad2._.js +0 -175
- package/.next/standalone/.next/static/chunks/4071dbec4cf7e72e.js +0 -109
- package/.next/standalone/.next/static/chunks/a87b5e84254095a5.js +0 -1
- package/.next/standalone/LICENSE +0 -21
- package/.next/standalone/bin/cli.js +0 -106
- package/.next/standalone/custom-models.example.json +0 -21
- package/.next/standalone/eslint.config.mjs +0 -18
- package/.next/standalone/features/feature-skill-used-jump-link/design/2026-03-18-skill-used-jump-link-design.md +0 -126
- package/.next/standalone/features/feature-skill-used-jump-link/feature.json +0 -32
- package/.next/standalone/features/feature-skill-used-jump-link/issue.md +0 -32
- package/.next/standalone/features/feature-skill-used-jump-link/plans/2026-03-18-skill-used-jump-link.md +0 -528
- package/.next/standalone/next.config.ts +0 -41
- package/.next/standalone/scripts/activate_telemetry.sh +0 -159
- package/.next/standalone/scripts/create_migration_package.sh +0 -124
- package/.next/standalone/scripts/fix_models.js +0 -66
- package/.next/standalone/scripts/init_opengauss.py +0 -284
- package/.next/standalone/scripts/install.js +0 -273
- package/.next/standalone/scripts/logs.js +0 -38
- package/.next/standalone/scripts/otel_data/logs.jsonl +0 -12
- package/.next/standalone/scripts/otel_data/metrics.jsonl +0 -21
- package/.next/standalone/scripts/otel_data/raw_requests.jsonl +0 -8
- package/.next/standalone/scripts/otel_data/raw_requests.jsonl.bak +0 -6
- package/.next/standalone/scripts/otel_receiver.py +0 -580
- package/.next/standalone/scripts/postinstall.js +0 -192
- package/.next/standalone/scripts/publish-npm.js +0 -401
- package/.next/standalone/scripts/restart.js +0 -26
- package/.next/standalone/scripts/restart.sh +0 -138
- package/.next/standalone/scripts/restart_dev.sh +0 -132
- package/.next/standalone/scripts/start.js +0 -291
- package/.next/standalone/scripts/status.js +0 -41
- package/.next/standalone/scripts/stop.js +0 -90
- package/.next/standalone/scripts/sync_skills.js +0 -216
- package/.next/standalone/scripts/utils.js +0 -235
- package/.next/standalone/tests/setup_skill_optimizer.sh +0 -118
- package/.next/standalone/tsconfig.json +0 -34
- package/.next/static/chunks/4071dbec4cf7e72e.js +0 -109
- package/.next/static/chunks/a87b5e84254095a5.js +0 -1
- /package/.next/standalone/.next/static/{H581Rok68JtPV4bAVVH3l → 0uvhCJooDO_gMNlKOaHwB}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{H581Rok68JtPV4bAVVH3l → 0uvhCJooDO_gMNlKOaHwB}/_clientMiddlewareManifest.json +0 -0
- /package/.next/standalone/.next/static/{H581Rok68JtPV4bAVVH3l → 0uvhCJooDO_gMNlKOaHwB}/_ssgManifest.js +0 -0
- /package/.next/static/{H581Rok68JtPV4bAVVH3l → 0uvhCJooDO_gMNlKOaHwB}/_buildManifest.js +0 -0
- /package/.next/static/{H581Rok68JtPV4bAVVH3l → 0uvhCJooDO_gMNlKOaHwB}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{H581Rok68JtPV4bAVVH3l → 0uvhCJooDO_gMNlKOaHwB}/_ssgManifest.js +0 -0
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Skill-Insight Skill Synchronizer
|
|
4
|
-
*
|
|
5
|
-
* Fetches configured skills from Dashboard and installs them locally.
|
|
6
|
-
* Usage: node sync_skills.js [--check-only] [--agent <name>]
|
|
7
|
-
*
|
|
8
|
-
* Requires: ~/.skill-insight/.env configuration
|
|
9
|
-
*/
|
|
10
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
-
}
|
|
16
|
-
Object.defineProperty(o, k2, desc);
|
|
17
|
-
}) : (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
o[k2] = m[k];
|
|
20
|
-
}));
|
|
21
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
-
}) : function(o, v) {
|
|
24
|
-
o["default"] = v;
|
|
25
|
-
});
|
|
26
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
-
var ownKeys = function(o) {
|
|
28
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
-
var ar = [];
|
|
30
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
-
return ar;
|
|
32
|
-
};
|
|
33
|
-
return ownKeys(o);
|
|
34
|
-
};
|
|
35
|
-
return function (mod) {
|
|
36
|
-
if (mod && mod.__esModule) return mod;
|
|
37
|
-
var result = {};
|
|
38
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
-
__setModuleDefault(result, mod);
|
|
40
|
-
return result;
|
|
41
|
-
};
|
|
42
|
-
})();
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
const fs = __importStar(require("fs"));
|
|
45
|
-
const http = __importStar(require("http"));
|
|
46
|
-
const https = __importStar(require("https"));
|
|
47
|
-
const os = __importStar(require("os"));
|
|
48
|
-
const path = __importStar(require("path"));
|
|
49
|
-
const AGENTS_DIR_MAP = {
|
|
50
|
-
"opencode": ".opencode/skills",
|
|
51
|
-
"openhands": ".openhands/skills",
|
|
52
|
-
"claude": ".claude/skills",
|
|
53
|
-
"deepagents": ".deepagents/skills"
|
|
54
|
-
};
|
|
55
|
-
function loadConfiguration() {
|
|
56
|
-
let config = {};
|
|
57
|
-
try {
|
|
58
|
-
const envPath = path.join(os.homedir(), '.skill-insight', '.env');
|
|
59
|
-
if (fs.existsSync(envPath)) {
|
|
60
|
-
const content = fs.readFileSync(envPath, 'utf8');
|
|
61
|
-
content.split('\n').forEach(line => {
|
|
62
|
-
const match = line.match(/^\s*([\w_]+)\s*=\s*(.*)?\s*$/);
|
|
63
|
-
if (match && match[1]) {
|
|
64
|
-
config[match[1]] = (match[2] || '').trim().replace(/^['"](.*)['"]$/, '$1');
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
catch (e) { }
|
|
70
|
-
return {
|
|
71
|
-
apiKey: config['SKILL_INSIGHT_API_KEY'] || process.env.SKILL_INSIGHT_API_KEY,
|
|
72
|
-
host: config['SKILL_INSIGHT_HOST'] || process.env.SKILL_INSIGHT_HOST || '127.0.0.1:3000'
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
async function fetchManifest(host) {
|
|
76
|
-
const urlStr = host.match(/^https?:\/\//) ? host : `http://${host}`;
|
|
77
|
-
const parsedUrl = new URL(urlStr);
|
|
78
|
-
const requestModule = parsedUrl.protocol === 'https:' ? https : http;
|
|
79
|
-
return new Promise((resolve, reject) => {
|
|
80
|
-
const req = requestModule.get(`${urlStr}/api/sync/manifest`, (res) => {
|
|
81
|
-
if (res.statusCode !== 200) {
|
|
82
|
-
reject(new Error(`Failed to fetch manifest: ${res.statusCode}`));
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
let data = '';
|
|
86
|
-
res.on('data', chunk => data += chunk);
|
|
87
|
-
res.on('end', () => {
|
|
88
|
-
try {
|
|
89
|
-
resolve(JSON.parse(data));
|
|
90
|
-
}
|
|
91
|
-
catch (e) {
|
|
92
|
-
reject(e);
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
req.on('error', reject);
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
function ensureDir(dirPath) {
|
|
100
|
-
if (!fs.existsSync(dirPath)) {
|
|
101
|
-
fs.mkdirSync(dirPath, { recursive: true });
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
// Simple unzip implementation using zlib if available or just raw write if not zipped
|
|
105
|
-
// Note: This is a placeholder. Real implementations use 'adm-zip' or 'unzip' command.
|
|
106
|
-
// For simplicity in a script without dependencies, we'll assume the /download endpoint returns raw content for single file
|
|
107
|
-
// or we use system unzip command.
|
|
108
|
-
async function downloadAndInstall(host, downloadPath, targetDir) {
|
|
109
|
-
const urlStr = host.match(/^https?:\/\//) ? host : `http://${host}`;
|
|
110
|
-
const parsedUrl = new URL(urlStr + downloadPath);
|
|
111
|
-
const requestModule = parsedUrl.protocol === 'https:' ? https : http;
|
|
112
|
-
// Use system curl/unzip if available for robustness
|
|
113
|
-
const tempZip = path.join(os.tmpdir(), `witty_skill_${Date.now()}.zip`);
|
|
114
|
-
return new Promise((resolve, reject) => {
|
|
115
|
-
const file = fs.createWriteStream(tempZip);
|
|
116
|
-
const req = requestModule.get(parsedUrl.href, (res) => {
|
|
117
|
-
if (res.statusCode !== 200) {
|
|
118
|
-
reject(new Error(`Download failed: ${res.statusCode}`));
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
res.pipe(file);
|
|
122
|
-
file.on('finish', () => {
|
|
123
|
-
file.close();
|
|
124
|
-
// Unzip
|
|
125
|
-
try {
|
|
126
|
-
// Try unzip command
|
|
127
|
-
const { execSync } = require('child_process');
|
|
128
|
-
ensureDir(targetDir);
|
|
129
|
-
// Clear target first? Maybe dangerous. Better overwrite.
|
|
130
|
-
execSync(`unzip -o "${tempZip}" -d "${targetDir}"`, { stdio: 'ignore' });
|
|
131
|
-
fs.unlinkSync(tempZip);
|
|
132
|
-
resolve();
|
|
133
|
-
}
|
|
134
|
-
catch (e) {
|
|
135
|
-
// Fallback or error
|
|
136
|
-
fs.unlinkSync(tempZip);
|
|
137
|
-
reject(e);
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
req.on('error', (err) => {
|
|
142
|
-
fs.unlinkSync(tempZip);
|
|
143
|
-
reject(err);
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
async function syncSkills(targetAgent) {
|
|
148
|
-
const { host } = loadConfiguration();
|
|
149
|
-
console.log(`🔄 Checking for skill updates from ${host}...`);
|
|
150
|
-
try {
|
|
151
|
-
const manifest = await fetchManifest(host);
|
|
152
|
-
const remoteSkills = manifest.skills || [];
|
|
153
|
-
if (remoteSkills.length === 0) {
|
|
154
|
-
console.log("✓ No skills configured on dashboard.");
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
const agents = targetAgent ? [targetAgent] : Object.keys(AGENTS_DIR_MAP);
|
|
158
|
-
let updatedCount = 0;
|
|
159
|
-
for (const agent of agents) {
|
|
160
|
-
const relativePath = AGENTS_DIR_MAP[agent];
|
|
161
|
-
if (!relativePath)
|
|
162
|
-
continue;
|
|
163
|
-
// Resolve path relative to CWD (where user runs command)
|
|
164
|
-
// OR relative to HOME? Standard is usually project root or HOME based on agent.
|
|
165
|
-
// For global tools like OpenCode/Claude, it's usually ~/.opencode/skills
|
|
166
|
-
// But AGENTS_DIR_MAP keys start with .
|
|
167
|
-
// Let's assume paths are relative to CWD (Current Working Directory)
|
|
168
|
-
// This prevents polluting global ~/.opencode, allowing project-specific skills
|
|
169
|
-
const skillsDir = path.join(process.cwd(), relativePath);
|
|
170
|
-
const manifestPath = path.join(skillsDir, 'manifest.json');
|
|
171
|
-
let localManifest = {};
|
|
172
|
-
try {
|
|
173
|
-
if (fs.existsSync(manifestPath)) {
|
|
174
|
-
localManifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
catch (e) { }
|
|
178
|
-
for (const skill of remoteSkills) {
|
|
179
|
-
const localVer = localManifest[skill.name]?.version || -1;
|
|
180
|
-
if (skill.version > localVer) {
|
|
181
|
-
console.log(`⬇️ [${agent}] Updating ${skill.name} (v${localVer} -> v${skill.version})...`);
|
|
182
|
-
const targetSkillDir = path.join(skillsDir, skill.name);
|
|
183
|
-
try {
|
|
184
|
-
await downloadAndInstall(host, skill.downloadUrl, targetSkillDir);
|
|
185
|
-
localManifest[skill.name] = {
|
|
186
|
-
version: skill.version,
|
|
187
|
-
updatedAt: new Date().toISOString()
|
|
188
|
-
};
|
|
189
|
-
updatedCount++;
|
|
190
|
-
}
|
|
191
|
-
catch (e) {
|
|
192
|
-
console.error(`❌ Failed to update ${skill.name}:`, e);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
if (updatedCount > 0) {
|
|
197
|
-
ensureDir(skillsDir);
|
|
198
|
-
fs.writeFileSync(manifestPath, JSON.stringify(localManifest, null, 2));
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
if (updatedCount > 0) {
|
|
202
|
-
console.log(`✅ Synced ${updatedCount} skills.`);
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
console.log("✓ All skills up to date.");
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
catch (e) {
|
|
209
|
-
console.error("⚠️ Skill sync failed (Dashboard offline?):", e.message);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
// Run
|
|
213
|
-
const args = process.argv.slice(2);
|
|
214
|
-
const agentArgIndex = args.indexOf('--agent');
|
|
215
|
-
const targetAgent = agentArgIndex !== -1 ? args[agentArgIndex + 1] : undefined;
|
|
216
|
-
syncSkills(targetAgent);
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
const { execSync, spawn } = require('child_process')
|
|
2
|
-
const fs = require('fs')
|
|
3
|
-
const path = require('path')
|
|
4
|
-
const http = require('http')
|
|
5
|
-
const os = require('os')
|
|
6
|
-
|
|
7
|
-
function getDataRoot() {
|
|
8
|
-
if (process.env.SKILL_INSIGHT_DATA_DIR) {
|
|
9
|
-
return process.env.SKILL_INSIGHT_DATA_DIR
|
|
10
|
-
}
|
|
11
|
-
if (__dirname.includes('node_modules')) {
|
|
12
|
-
return path.join(os.homedir(), '.skill-insight')
|
|
13
|
-
}
|
|
14
|
-
return path.resolve(__dirname, '..')
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function migrateDataIfNeeded() {
|
|
18
|
-
const newDataRoot = path.join(os.homedir(), '.skill-insight')
|
|
19
|
-
const newDbPath = path.join(newDataRoot, 'data', 'witty_insight.db')
|
|
20
|
-
const oldDbPath = path.resolve(__dirname, '../data/witty_insight.db')
|
|
21
|
-
|
|
22
|
-
const newExists = fs.existsSync(newDbPath)
|
|
23
|
-
const oldExists = fs.existsSync(oldDbPath)
|
|
24
|
-
|
|
25
|
-
if (newExists && oldExists) {
|
|
26
|
-
console.log('Database already exists at new location, skipping migration')
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (newExists && !oldExists) {
|
|
31
|
-
console.log('Using existing database at ' + newDbPath)
|
|
32
|
-
return
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (!newExists && oldExists) {
|
|
36
|
-
console.log('Migrating database to new location...')
|
|
37
|
-
const newDataPath = path.join(newDataRoot, 'data')
|
|
38
|
-
if (!fs.existsSync(newDataPath)) {
|
|
39
|
-
fs.mkdirSync(newDataPath, { recursive: true })
|
|
40
|
-
}
|
|
41
|
-
fs.copyFileSync(oldDbPath, newDbPath)
|
|
42
|
-
console.log('✓ Database migrated to ' + newDbPath)
|
|
43
|
-
|
|
44
|
-
try { fs.renameSync(oldDbPath, oldDbPath + '.bak') } catch (e) {}
|
|
45
|
-
return
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
console.log('Creating new database at ' + newDbPath)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function findPidOnPort(port) {
|
|
52
|
-
const platform = process.platform
|
|
53
|
-
|
|
54
|
-
try {
|
|
55
|
-
if (platform === 'win32') {
|
|
56
|
-
const output = execSync(`netstat -ano | findstr :${port}`, { encoding: 'utf8' })
|
|
57
|
-
const lines = output.trim().split('\n')
|
|
58
|
-
for (const line of lines) {
|
|
59
|
-
const parts = line.trim().split(/\s+/)
|
|
60
|
-
if (parts.length >= 5) {
|
|
61
|
-
const localAddress = parts[1]
|
|
62
|
-
const state = parts[3]
|
|
63
|
-
const pid = parts[4]
|
|
64
|
-
const portMatch = localAddress.match(/:(\d+)$/)
|
|
65
|
-
if (portMatch && parseInt(portMatch[1]) === port && state === 'LISTENING') {
|
|
66
|
-
console.log(`[Windows] Found process ${pid} listening on port ${port}`)
|
|
67
|
-
return pid
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
console.log(`[Windows] No process found listening on port ${port}`)
|
|
72
|
-
} else {
|
|
73
|
-
if (fs.existsSync('/usr/bin/lsof') || fs.existsSync('/usr/sbin/lsof')) {
|
|
74
|
-
try {
|
|
75
|
-
const pid = execSync(`lsof -t -i:${port} -sTCP:LISTEN`, { encoding: 'utf8' })
|
|
76
|
-
if (pid.trim()) return pid.trim()
|
|
77
|
-
} catch (e) {}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (fs.existsSync('/bin/ss') || fs.existsSync('/usr/bin/ss')) {
|
|
81
|
-
try {
|
|
82
|
-
const output = execSync(`ss -lptn "sport = :${port}"`, { encoding: 'utf8' })
|
|
83
|
-
const match = output.match(/pid=(\d+)/)
|
|
84
|
-
if (match) return match[1]
|
|
85
|
-
} catch (e) {}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (fs.existsSync('/bin/netstat') || fs.existsSync('/usr/bin/netstat')) {
|
|
89
|
-
try {
|
|
90
|
-
const output = execSync(`netstat -nlp 2>/dev/null | grep ":${port} "`, { encoding: 'utf8' })
|
|
91
|
-
const match = output.match(/(\d+)\//)
|
|
92
|
-
if (match) return match[1]
|
|
93
|
-
} catch (e) {}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
try {
|
|
97
|
-
const output = execSync(`fuser ${port}/tcp 2>/dev/null`, { encoding: 'utf8' })
|
|
98
|
-
if (output.trim()) return output.trim()
|
|
99
|
-
} catch (e) {}
|
|
100
|
-
}
|
|
101
|
-
} catch (e) {}
|
|
102
|
-
|
|
103
|
-
return null
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function isPortListening(port) {
|
|
107
|
-
return new Promise((resolve) => {
|
|
108
|
-
const req = http.request({
|
|
109
|
-
hostname: 'localhost',
|
|
110
|
-
port: port,
|
|
111
|
-
path: '/',
|
|
112
|
-
method: 'HEAD',
|
|
113
|
-
timeout: 1000
|
|
114
|
-
}, (res) => {
|
|
115
|
-
resolve(true)
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
req.on('error', () => {
|
|
119
|
-
resolve(false)
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
req.on('timeout', () => {
|
|
123
|
-
req.destroy()
|
|
124
|
-
resolve(false)
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
req.end()
|
|
128
|
-
})
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function killProcess(pid) {
|
|
132
|
-
const platform = process.platform
|
|
133
|
-
|
|
134
|
-
try {
|
|
135
|
-
if (platform === 'win32') {
|
|
136
|
-
console.log(`[Windows] Attempting to kill process with PID ${pid} using taskkill...`)
|
|
137
|
-
execSync(`taskkill /F /PID ${pid}`, { stdio: 'ignore' })
|
|
138
|
-
console.log(`[Windows] Successfully killed process ${pid}`)
|
|
139
|
-
return true
|
|
140
|
-
} else {
|
|
141
|
-
console.log(`[Unix] Attempting to kill process with PID ${pid} using kill -9...`)
|
|
142
|
-
execSync(`kill -9 ${pid}`, { stdio: 'ignore' })
|
|
143
|
-
console.log(`[Unix] Successfully killed process ${pid}`)
|
|
144
|
-
return true
|
|
145
|
-
}
|
|
146
|
-
} catch (e) {
|
|
147
|
-
console.error(`Failed to kill process ${pid}: ${e.message}`)
|
|
148
|
-
return false
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function getPort(options) {
|
|
153
|
-
if (options.port) return options.port
|
|
154
|
-
if (process.env.PORT) return parseInt(process.env.PORT)
|
|
155
|
-
|
|
156
|
-
const envPath = path.join(process.cwd(), '.env')
|
|
157
|
-
if (fs.existsSync(envPath)) {
|
|
158
|
-
const envContent = fs.readFileSync(envPath, 'utf8')
|
|
159
|
-
const match = envContent.match(/^PORT=(\d+)$/m)
|
|
160
|
-
if (match) return parseInt(match[1])
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return 3000
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function ensureEnvFile(packageRoot) {
|
|
167
|
-
const root = getDataRoot()
|
|
168
|
-
const envPath = path.join(root, '.env')
|
|
169
|
-
const envExamplePath = path.join(path.resolve(__dirname, '..'), '.env.example')
|
|
170
|
-
|
|
171
|
-
if (!fs.existsSync(envPath) && fs.existsSync(envExamplePath)) {
|
|
172
|
-
console.log('No .env found. Initializing from .env.example...')
|
|
173
|
-
fs.mkdirSync(path.dirname(envPath), { recursive: true })
|
|
174
|
-
fs.copyFileSync(envExamplePath, envPath)
|
|
175
|
-
console.log('✓ .env file created at ' + envPath)
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function ensureDataDirectory(packageRoot) {
|
|
180
|
-
const root = getDataRoot()
|
|
181
|
-
const dataPath = path.join(root, 'data')
|
|
182
|
-
if (!fs.existsSync(dataPath)) {
|
|
183
|
-
console.log('Creating data directory...')
|
|
184
|
-
fs.mkdirSync(dataPath, { recursive: true })
|
|
185
|
-
console.log('✓ data directory created at ' + dataPath)
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function runCommand(command, options = {}) {
|
|
190
|
-
return new Promise((resolve, reject) => {
|
|
191
|
-
console.log(`Running: ${command}`)
|
|
192
|
-
const [cmd, ...args] = command.split(' ')
|
|
193
|
-
const proc = spawn(cmd, args, {
|
|
194
|
-
stdio: 'inherit',
|
|
195
|
-
shell: true,
|
|
196
|
-
...options
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
proc.on('close', (code) => {
|
|
200
|
-
if (code === 0) {
|
|
201
|
-
resolve()
|
|
202
|
-
} else {
|
|
203
|
-
reject(new Error(`Command failed with code ${code}`))
|
|
204
|
-
}
|
|
205
|
-
})
|
|
206
|
-
})
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
function sleep(ms) {
|
|
210
|
-
return new Promise(resolve => setTimeout(resolve, ms))
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
function findAvailablePort(startPort = 3000, maxAttempts = 100) {
|
|
214
|
-
for (let port = startPort; port < startPort + maxAttempts; port++) {
|
|
215
|
-
const pid = findPidOnPort(port)
|
|
216
|
-
if (!pid) {
|
|
217
|
-
return port
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return startPort
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
module.exports = {
|
|
224
|
-
findPidOnPort,
|
|
225
|
-
killProcess,
|
|
226
|
-
getPort,
|
|
227
|
-
ensureEnvFile,
|
|
228
|
-
ensureDataDirectory,
|
|
229
|
-
runCommand,
|
|
230
|
-
sleep,
|
|
231
|
-
isPortListening,
|
|
232
|
-
findAvailablePort,
|
|
233
|
-
getDataRoot,
|
|
234
|
-
migrateDataIfNeeded
|
|
235
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Setup script for skill-optimizer testing
|
|
4
|
-
# This script copies skill-optimizer to .opencode/skills directory
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
9
|
-
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
|
10
|
-
SKILL_SOURCE="$PROJECT_ROOT/skills/skill-optimizer"
|
|
11
|
-
SKILL_TARGET="$PROJECT_ROOT/.opencode/skills/skill-optimizer"
|
|
12
|
-
OVERWRITE_LOCAL=false
|
|
13
|
-
|
|
14
|
-
usage() {
|
|
15
|
-
echo "Usage: $(basename "$0") [--overwrite-local]"
|
|
16
|
-
echo ""
|
|
17
|
-
echo " --overwrite-local Overwrite local files in target (.env and .opt/)."
|
|
18
|
-
echo " Default: preserve existing .env and .opt/ if present."
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
for arg in "$@"; do
|
|
22
|
-
case "$arg" in
|
|
23
|
-
--overwrite-local)
|
|
24
|
-
OVERWRITE_LOCAL=true
|
|
25
|
-
;;
|
|
26
|
-
-h|--help)
|
|
27
|
-
usage
|
|
28
|
-
exit 0
|
|
29
|
-
;;
|
|
30
|
-
*)
|
|
31
|
-
echo "❌ Error: Unknown argument: $arg"
|
|
32
|
-
echo ""
|
|
33
|
-
usage
|
|
34
|
-
exit 1
|
|
35
|
-
;;
|
|
36
|
-
esac
|
|
37
|
-
done
|
|
38
|
-
|
|
39
|
-
echo "=========================================="
|
|
40
|
-
echo " Skill Optimizer Setup Script"
|
|
41
|
-
echo "=========================================="
|
|
42
|
-
echo ""
|
|
43
|
-
|
|
44
|
-
# Check if source exists
|
|
45
|
-
if [ ! -d "$SKILL_SOURCE" ]; then
|
|
46
|
-
echo "❌ Error: skill-optimizer source not found at:"
|
|
47
|
-
echo " $SKILL_SOURCE"
|
|
48
|
-
exit 1
|
|
49
|
-
fi
|
|
50
|
-
|
|
51
|
-
if [ ! -f "$SKILL_SOURCE/SKILL.md" ]; then
|
|
52
|
-
echo "❌ Error: SKILL.md not found in skill-optimizer"
|
|
53
|
-
exit 1
|
|
54
|
-
fi
|
|
55
|
-
|
|
56
|
-
# Create target directory if not exists
|
|
57
|
-
mkdir -p "$PROJECT_ROOT/.opencode/skills"
|
|
58
|
-
|
|
59
|
-
if [ -d "$SKILL_TARGET" ]; then
|
|
60
|
-
if [ "$OVERWRITE_LOCAL" = true ]; then
|
|
61
|
-
echo "🔄 Removing existing skill-optimizer..."
|
|
62
|
-
rm -rf "$SKILL_TARGET"
|
|
63
|
-
echo "📦 Copying skill-optimizer to .opencode/skills/..."
|
|
64
|
-
cp -r "$SKILL_SOURCE" "$SKILL_TARGET"
|
|
65
|
-
else
|
|
66
|
-
echo "�️ Preserving existing .env and .opt/ in target (use --overwrite-local to override)"
|
|
67
|
-
TMP_DIR="$(mktemp -d)"
|
|
68
|
-
cleanup() {
|
|
69
|
-
rm -rf "$TMP_DIR"
|
|
70
|
-
}
|
|
71
|
-
trap cleanup EXIT
|
|
72
|
-
|
|
73
|
-
cp -r "$SKILL_SOURCE" "$TMP_DIR/skill-optimizer"
|
|
74
|
-
|
|
75
|
-
if [ -f "$SKILL_TARGET/.env" ]; then
|
|
76
|
-
cp "$SKILL_TARGET/.env" "$TMP_DIR/skill-optimizer/.env"
|
|
77
|
-
fi
|
|
78
|
-
|
|
79
|
-
if [ -d "$SKILL_TARGET/.opt" ]; then
|
|
80
|
-
rm -rf "$TMP_DIR/skill-optimizer/.opt"
|
|
81
|
-
cp -R "$SKILL_TARGET/.opt" "$TMP_DIR/skill-optimizer/.opt"
|
|
82
|
-
fi
|
|
83
|
-
|
|
84
|
-
rm -rf "$SKILL_TARGET"
|
|
85
|
-
mv "$TMP_DIR/skill-optimizer" "$SKILL_TARGET"
|
|
86
|
-
trap - EXIT
|
|
87
|
-
cleanup
|
|
88
|
-
fi
|
|
89
|
-
else
|
|
90
|
-
echo "📦 Copying skill-optimizer to .opencode/skills/..."
|
|
91
|
-
cp -r "$SKILL_SOURCE" "$SKILL_TARGET"
|
|
92
|
-
fi
|
|
93
|
-
|
|
94
|
-
# Verify
|
|
95
|
-
if [ -f "$SKILL_TARGET/SKILL.md" ]; then
|
|
96
|
-
echo ""
|
|
97
|
-
echo "✅ Setup complete!"
|
|
98
|
-
echo ""
|
|
99
|
-
echo " Source: $SKILL_SOURCE"
|
|
100
|
-
echo " Target: $SKILL_TARGET"
|
|
101
|
-
echo ""
|
|
102
|
-
echo "=========================================="
|
|
103
|
-
echo " Next Steps"
|
|
104
|
-
echo "=========================================="
|
|
105
|
-
echo ""
|
|
106
|
-
echo " 1. Restart opencode to load the skill:"
|
|
107
|
-
echo " Exit current session and run 'opencode' again"
|
|
108
|
-
echo ""
|
|
109
|
-
echo " 2. Test the skill:"
|
|
110
|
-
echo " opencode run '帮我优化 /path/to/your/skill'"
|
|
111
|
-
echo ""
|
|
112
|
-
echo " 3. Or test interactively in opencode session:"
|
|
113
|
-
echo " > 帮我优化这个 skill: /path/to/skill"
|
|
114
|
-
echo ""
|
|
115
|
-
else
|
|
116
|
-
echo "❌ Error: Failed to copy skill-optimizer"
|
|
117
|
-
exit 1
|
|
118
|
-
fi
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2017",
|
|
4
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"skipLibCheck": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"module": "esnext",
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"isolatedModules": true,
|
|
14
|
-
"jsx": "react-jsx",
|
|
15
|
-
"incremental": true,
|
|
16
|
-
"plugins": [
|
|
17
|
-
{
|
|
18
|
-
"name": "next"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"paths": {
|
|
22
|
-
"@/*": ["./src/*"]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"include": [
|
|
26
|
-
"next-env.d.ts",
|
|
27
|
-
"**/*.ts",
|
|
28
|
-
"**/*.tsx",
|
|
29
|
-
".next/types/**/*.ts",
|
|
30
|
-
".next/dev/types/**/*.ts",
|
|
31
|
-
"**/*.mts"
|
|
32
|
-
],
|
|
33
|
-
"exclude": ["node_modules"]
|
|
34
|
-
}
|