@mo7yw4ng/openape 1.0.1 → 1.0.3
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/README.md +8 -5
- package/esm/_dnt.polyfills.d.ts +83 -6
- package/esm/_dnt.polyfills.d.ts.map +1 -0
- package/esm/_dnt.polyfills.js +127 -1
- package/esm/_dnt.shims.d.ts +1 -0
- package/esm/_dnt.shims.d.ts.map +1 -0
- package/esm/deno.d.ts +2 -0
- package/esm/deno.d.ts.map +1 -0
- package/esm/deno.js +2 -1
- package/esm/src/commands/announcements.d.ts +3 -0
- package/esm/src/commands/announcements.d.ts.map +1 -0
- package/esm/src/commands/announcements.js +135 -0
- package/esm/src/commands/auth.d.ts +3 -0
- package/esm/src/commands/auth.d.ts.map +1 -0
- package/esm/src/commands/auth.js +260 -0
- package/esm/src/commands/calendar.d.ts +3 -0
- package/esm/src/commands/calendar.d.ts.map +1 -0
- package/esm/src/commands/calendar.js +180 -0
- package/esm/src/commands/courses.d.ts +3 -0
- package/esm/src/commands/courses.d.ts.map +1 -0
- package/esm/src/commands/courses.js +348 -0
- package/esm/src/commands/forums.d.ts +3 -0
- package/esm/src/commands/forums.d.ts.map +1 -0
- package/esm/src/commands/forums.js +226 -0
- package/esm/src/commands/grades.d.ts +3 -0
- package/esm/src/commands/grades.d.ts.map +1 -0
- package/esm/src/commands/grades.js +121 -0
- package/esm/src/commands/materials.d.ts +3 -0
- package/esm/src/commands/materials.d.ts.map +1 -0
- package/esm/src/commands/materials.js +522 -0
- package/esm/src/commands/quizzes.d.ts +3 -0
- package/esm/src/commands/quizzes.d.ts.map +1 -0
- package/esm/src/commands/quizzes.js +160 -0
- package/esm/src/commands/skills.d.ts +3 -0
- package/esm/src/commands/skills.d.ts.map +1 -0
- package/esm/src/commands/skills.js +110 -0
- package/esm/src/commands/videos.d.ts +3 -0
- package/esm/src/commands/videos.d.ts.map +1 -0
- package/esm/src/commands/videos.js +335 -0
- package/esm/src/index.d.ts +27 -0
- package/esm/src/index.d.ts.map +1 -0
- package/esm/src/index.js +149 -0
- package/esm/src/lib/auth.d.ts +25 -0
- package/esm/src/lib/auth.d.ts.map +1 -0
- package/esm/src/lib/auth.js +194 -0
- package/esm/src/lib/config.d.ts +6 -0
- package/esm/src/lib/config.d.ts.map +1 -0
- package/esm/src/lib/config.js +36 -0
- package/esm/src/lib/logger.d.ts +3 -0
- package/esm/src/lib/logger.d.ts.map +1 -0
- package/esm/src/lib/logger.js +24 -0
- package/esm/src/lib/moodle.d.ts +251 -0
- package/esm/src/lib/moodle.d.ts.map +1 -0
- package/esm/src/lib/moodle.js +833 -0
- package/esm/src/lib/session.d.ts +8 -0
- package/esm/src/lib/session.d.ts.map +1 -0
- package/esm/src/lib/session.js +42 -0
- package/esm/src/lib/token.d.ts +38 -0
- package/esm/src/lib/token.d.ts.map +1 -0
- package/esm/src/lib/token.js +178 -0
- package/esm/src/lib/types.d.ts +272 -0
- package/esm/src/lib/types.d.ts.map +1 -0
- package/esm/src/lib/types.js +1 -0
- package/esm/src/lib/utils.d.ts +37 -0
- package/esm/src/lib/utils.d.ts.map +1 -0
- package/esm/src/lib/utils.js +82 -0
- package/package.json +4 -4
- package/script/_dnt.polyfills.d.ts +83 -6
- package/script/_dnt.polyfills.d.ts.map +1 -0
- package/script/_dnt.polyfills.js +128 -0
- package/script/_dnt.shims.d.ts +1 -0
- package/script/_dnt.shims.d.ts.map +1 -0
- package/script/deno.d.ts +2 -0
- package/script/deno.d.ts.map +1 -0
- package/script/deno.js +2 -1
- package/script/src/commands/announcements.d.ts +1 -0
- package/script/src/commands/announcements.d.ts.map +1 -0
- package/script/src/commands/announcements.js +75 -222
- package/script/src/commands/auth.d.ts +2 -1
- package/script/src/commands/auth.d.ts.map +1 -0
- package/script/src/commands/auth.js +52 -24
- package/script/src/commands/calendar.d.ts +1 -0
- package/script/src/commands/calendar.d.ts.map +1 -0
- package/script/src/commands/calendar.js +112 -301
- package/script/src/commands/courses.d.ts +1 -0
- package/script/src/commands/courses.d.ts.map +1 -0
- package/script/src/commands/courses.js +43 -173
- package/script/src/commands/forums.d.ts +1 -0
- package/script/src/commands/forums.d.ts.map +1 -0
- package/script/src/commands/forums.js +145 -316
- package/script/src/commands/grades.d.ts +1 -0
- package/script/src/commands/grades.d.ts.map +1 -0
- package/script/src/commands/grades.js +62 -194
- package/script/src/commands/materials.d.ts +1 -0
- package/script/src/commands/materials.d.ts.map +1 -0
- package/script/src/commands/materials.js +283 -178
- package/script/src/commands/quizzes.d.ts +1 -0
- package/script/src/commands/quizzes.d.ts.map +1 -0
- package/script/src/commands/quizzes.js +40 -102
- package/script/src/commands/skills.d.ts +1 -0
- package/script/src/commands/skills.d.ts.map +1 -0
- package/script/src/commands/skills.js +17 -18
- package/script/src/commands/videos.d.ts +1 -0
- package/script/src/commands/videos.d.ts.map +1 -0
- package/script/src/commands/videos.js +127 -120
- package/script/src/index.d.ts +1 -0
- package/script/src/index.d.ts.map +1 -0
- package/script/src/index.js +5 -5
- package/script/src/lib/auth.d.ts +1 -0
- package/script/src/lib/auth.d.ts.map +1 -0
- package/script/src/lib/auth.js +9 -10
- package/script/src/lib/config.d.ts +1 -0
- package/script/src/lib/config.d.ts.map +1 -0
- package/script/src/lib/config.js +6 -7
- package/script/src/lib/logger.d.ts +1 -0
- package/script/src/lib/logger.d.ts.map +1 -0
- package/script/src/lib/logger.js +1 -2
- package/script/src/lib/moodle.d.ts +72 -55
- package/script/src/lib/moodle.d.ts.map +1 -0
- package/script/src/lib/moodle.js +275 -350
- package/script/src/lib/session.d.ts +1 -0
- package/script/src/lib/session.d.ts.map +1 -0
- package/script/src/lib/session.js +3 -29
- package/script/src/lib/token.d.ts +16 -5
- package/script/src/lib/token.d.ts.map +1 -0
- package/script/src/lib/token.js +71 -36
- package/script/src/lib/types.d.ts +11 -0
- package/script/src/lib/types.d.ts.map +1 -0
- package/script/src/lib/utils.d.ts +32 -0
- package/script/src/lib/utils.d.ts.map +1 -0
- package/script/src/lib/utils.js +93 -13
- package/skills/openape/SKILL.md +6 -26
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.registerQuizzesCommand =
|
|
6
|
+
exports.registerQuizzesCommand = registerQuizzesCommand;
|
|
7
7
|
const utils_js_1 = require("../lib/utils.js");
|
|
8
8
|
const moodle_js_1 = require("../lib/moodle.js");
|
|
9
9
|
const logger_js_1 = require("../lib/logger.js");
|
|
@@ -12,8 +12,8 @@ const session_js_1 = require("../lib/session.js");
|
|
|
12
12
|
const auth_js_2 = require("../lib/auth.js");
|
|
13
13
|
const index_js_1 = require("../index.js");
|
|
14
14
|
const token_js_1 = require("../lib/token.js");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
16
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
17
17
|
function registerQuizzesCommand(program) {
|
|
18
18
|
const quizzesCmd = program.command("quizzes");
|
|
19
19
|
quizzesCmd.description("Quiz operations");
|
|
@@ -28,14 +28,17 @@ function registerQuizzesCommand(program) {
|
|
|
28
28
|
const silent = outputFormat === "json" && !opts.verbose;
|
|
29
29
|
const log = (0, logger_js_1.createLogger)(opts.verbose, silent);
|
|
30
30
|
const baseDir = (0, utils_js_1.getBaseDir)();
|
|
31
|
-
const sessionPath =
|
|
31
|
+
const sessionPath = node_path_1.default.resolve(baseDir, ".auth", "storage-state.json");
|
|
32
32
|
// Check if session exists
|
|
33
|
-
if (!
|
|
33
|
+
if (!node_fs_1.default.existsSync(sessionPath)) {
|
|
34
|
+
log.error("未找到登入 session。請先執行 'openape auth login' 進行登入。");
|
|
35
|
+
log.info(`Session 預期位置: ${sessionPath}`);
|
|
34
36
|
return null;
|
|
35
37
|
}
|
|
36
38
|
// Try to load WS token
|
|
37
39
|
const wsToken = (0, token_js_1.loadWsToken)(sessionPath);
|
|
38
40
|
if (!wsToken) {
|
|
41
|
+
log.error("未找到 WS token。請先執行 'openape auth login' 進行登入。");
|
|
39
42
|
return null;
|
|
40
43
|
}
|
|
41
44
|
return {
|
|
@@ -46,17 +49,15 @@ function registerQuizzesCommand(program) {
|
|
|
46
49
|
},
|
|
47
50
|
};
|
|
48
51
|
}
|
|
49
|
-
// Helper function to create session context
|
|
52
|
+
// Helper function to create session context (for open command only)
|
|
50
53
|
async function createSessionContext(options, command) {
|
|
51
|
-
// Get global options if command is provided (for --verbose, --silent flags)
|
|
52
54
|
const opts = command?.optsWithGlobals ? command.optsWithGlobals() : options;
|
|
53
|
-
// Auto-enable silent mode for JSON output (unless --verbose is also set)
|
|
54
55
|
const outputFormat = getOutputFormat(command || { optsWithGlobals: () => ({ output: "json" }) });
|
|
55
56
|
const silent = outputFormat === "json" && !opts.verbose;
|
|
56
57
|
const log = (0, logger_js_1.createLogger)(opts.verbose, silent);
|
|
57
58
|
const baseDir = (0, utils_js_1.getBaseDir)();
|
|
58
|
-
const sessionPath =
|
|
59
|
-
if (!
|
|
59
|
+
const sessionPath = node_path_1.default.resolve(baseDir, ".auth", "storage-state.json");
|
|
60
|
+
if (!node_fs_1.default.existsSync(sessionPath)) {
|
|
60
61
|
log.error("未找到登入 session。請先執行 'openape auth login' 進行登入。");
|
|
61
62
|
return null;
|
|
62
63
|
}
|
|
@@ -90,43 +91,17 @@ function registerQuizzesCommand(program) {
|
|
|
90
91
|
.option("--output <format>", "Output format: json|csv|table|silent")
|
|
91
92
|
.action(async (courseId, options, command) => {
|
|
92
93
|
const output = getOutputFormat(command);
|
|
93
|
-
// Try pure API mode (no browser, fast!)
|
|
94
94
|
const apiContext = await createApiContext(options, command);
|
|
95
|
-
if (apiContext) {
|
|
96
|
-
try {
|
|
97
|
-
const quizzes = await (0, moodle_js_1.getQuizzesByCoursesApi)(apiContext.session, [parseInt(courseId, 10)]);
|
|
98
|
-
// Filter by available only if requested (API returns all, no completion status)
|
|
99
|
-
// Note: API doesn't provide completion status, so --available-only won't work in API mode
|
|
100
|
-
if (options.availableOnly) {
|
|
101
|
-
apiContext.log.warn("--available-only is not supported in API mode, showing all quizzes");
|
|
102
|
-
}
|
|
103
|
-
(0, index_js_1.formatAndOutput)(quizzes, output, apiContext.log);
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
catch (e) {
|
|
107
|
-
// API failed, fall through to browser mode
|
|
108
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
109
|
-
console.error(`// API mode failed: ${msg}, trying browser mode...`);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
// Fallback to browser mode
|
|
113
|
-
const context = await createSessionContext(options, command);
|
|
114
|
-
if (!context) {
|
|
95
|
+
if (!apiContext) {
|
|
115
96
|
process.exitCode = 1;
|
|
116
97
|
return;
|
|
117
98
|
}
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (options.availableOnly) {
|
|
123
|
-
filteredQuizzes = quizzes.filter(q => !q.isComplete);
|
|
124
|
-
}
|
|
125
|
-
(0, index_js_1.formatAndOutput)(filteredQuizzes, output, log);
|
|
126
|
-
}
|
|
127
|
-
finally {
|
|
128
|
-
await (0, auth_js_2.closeBrowserSafely)(browser, browserContext);
|
|
99
|
+
const quizzes = await (0, moodle_js_1.getQuizzesByCoursesApi)(apiContext.session, [parseInt(courseId, 10)]);
|
|
100
|
+
// Note: API doesn't provide completion status, so --available-only shows all
|
|
101
|
+
if (options.availableOnly) {
|
|
102
|
+
apiContext.log.warn("--available-only is not supported in API mode, showing all quizzes");
|
|
129
103
|
}
|
|
104
|
+
(0, index_js_1.formatAndOutput)(quizzes, output, apiContext.log);
|
|
130
105
|
});
|
|
131
106
|
quizzesCmd
|
|
132
107
|
.command("list-all")
|
|
@@ -135,71 +110,35 @@ function registerQuizzesCommand(program) {
|
|
|
135
110
|
.option("--output <format>", "Output format: json|csv|table|silent")
|
|
136
111
|
.action(async (options, command) => {
|
|
137
112
|
const output = getOutputFormat(command);
|
|
138
|
-
// Try pure API mode (no browser, fast!)
|
|
139
113
|
const apiContext = await createApiContext(options, command);
|
|
140
|
-
if (apiContext) {
|
|
141
|
-
try {
|
|
142
|
-
const classification = options.level === "all" ? undefined : "inprogress";
|
|
143
|
-
const courses = await (0, moodle_js_1.getEnrolledCoursesApi)(apiContext.session, {
|
|
144
|
-
classification,
|
|
145
|
-
});
|
|
146
|
-
// Get quizzes via WS API (no browser needed!)
|
|
147
|
-
const courseIds = courses.map(c => c.id);
|
|
148
|
-
const apiQuizzes = await (0, moodle_js_1.getQuizzesByCoursesApi)(apiContext.session, courseIds);
|
|
149
|
-
// Build a map of courseId -> course for quick lookup
|
|
150
|
-
const courseMap = new Map(courses.map(c => [c.id, c]));
|
|
151
|
-
const allQuizzes = [];
|
|
152
|
-
for (const q of apiQuizzes) {
|
|
153
|
-
const course = courseMap.get(q.courseId);
|
|
154
|
-
if (course) {
|
|
155
|
-
allQuizzes.push({
|
|
156
|
-
courseName: course.fullname,
|
|
157
|
-
name: q.name,
|
|
158
|
-
url: q.url,
|
|
159
|
-
cmid: q.cmid,
|
|
160
|
-
isComplete: q.isComplete,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
apiContext.log.info(`\n總計發現 ${allQuizzes.length} 個測驗。`);
|
|
165
|
-
(0, index_js_1.formatAndOutput)(allQuizzes, output, apiContext.log);
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
catch (e) {
|
|
169
|
-
// API failed, fall through to browser mode
|
|
170
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
171
|
-
console.error(`// API mode failed: ${msg}, trying browser mode...`);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
// Fallback to browser mode
|
|
175
|
-
const context = await createSessionContext(options, command);
|
|
176
|
-
if (!context) {
|
|
114
|
+
if (!apiContext) {
|
|
177
115
|
process.exitCode = 1;
|
|
178
116
|
return;
|
|
179
117
|
}
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
118
|
+
const classification = options.level === "all" ? undefined : "inprogress";
|
|
119
|
+
const courses = await (0, moodle_js_1.getEnrolledCoursesApi)(apiContext.session, {
|
|
120
|
+
classification,
|
|
121
|
+
});
|
|
122
|
+
// Get quizzes via WS API (no browser needed!)
|
|
123
|
+
const courseIds = courses.map(c => c.id);
|
|
124
|
+
const apiQuizzes = await (0, moodle_js_1.getQuizzesByCoursesApi)(apiContext.session, courseIds);
|
|
125
|
+
// Build a map of courseId -> course for quick lookup
|
|
126
|
+
const courseMap = new Map(courses.map(c => [c.id, c]));
|
|
127
|
+
const allQuizzes = [];
|
|
128
|
+
for (const q of apiQuizzes) {
|
|
129
|
+
const course = courseMap.get(q.courseId);
|
|
130
|
+
if (course) {
|
|
131
|
+
allQuizzes.push({
|
|
132
|
+
courseName: course.fullname,
|
|
133
|
+
name: q.name,
|
|
134
|
+
url: q.url,
|
|
135
|
+
cmid: q.cmid,
|
|
136
|
+
isComplete: q.isComplete,
|
|
137
|
+
});
|
|
196
138
|
}
|
|
197
|
-
log.info(`\n總計發現 ${allQuizzes.length} 個測驗。`);
|
|
198
|
-
(0, index_js_1.formatAndOutput)(allQuizzes, output, log);
|
|
199
|
-
}
|
|
200
|
-
finally {
|
|
201
|
-
await (0, auth_js_2.closeBrowserSafely)(browser, browserContext);
|
|
202
139
|
}
|
|
140
|
+
apiContext.log.info(`\n總計發現 ${allQuizzes.length} 個測驗。`);
|
|
141
|
+
(0, index_js_1.formatAndOutput)(allQuizzes, output, apiContext.log);
|
|
203
142
|
});
|
|
204
143
|
quizzesCmd
|
|
205
144
|
.command("open")
|
|
@@ -225,4 +164,3 @@ function registerQuizzesCommand(program) {
|
|
|
225
164
|
}
|
|
226
165
|
});
|
|
227
166
|
}
|
|
228
|
-
exports.registerQuizzesCommand = registerQuizzesCommand;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../../src/src/commands/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6CpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0E5D"}
|
|
@@ -3,19 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.registerSkillsCommand =
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
6
|
+
exports.registerSkillsCommand = registerSkillsCommand;
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
10
10
|
const SKILL_NAME = "openape";
|
|
11
11
|
const GITHUB_RAW_URL = `https://raw.githubusercontent.com/mo7yw4ng/openape/refs/heads/main/skills/${SKILL_NAME}/SKILL.md`;
|
|
12
12
|
/**
|
|
13
13
|
* Known agent platforms and their skills directories
|
|
14
14
|
*/
|
|
15
15
|
const PLATFORMS = {
|
|
16
|
-
claude: { name: "Claude Code", path:
|
|
17
|
-
codex: { name: "Codex CLI", path:
|
|
18
|
-
opencode: { name: "OpenCode", path:
|
|
16
|
+
claude: { name: "Claude Code", path: node_path_1.default.join(node_os_1.default.homedir(), ".claude", "skills") },
|
|
17
|
+
codex: { name: "Codex CLI", path: node_path_1.default.join(node_os_1.default.homedir(), ".codex", "skills") },
|
|
18
|
+
opencode: { name: "OpenCode", path: node_path_1.default.join(node_os_1.default.homedir(), ".opencode", "skills") },
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Try to read SKILL.md from local project first (dev mode / bundled build),
|
|
@@ -24,13 +24,13 @@ const PLATFORMS = {
|
|
|
24
24
|
async function readSkillContent() {
|
|
25
25
|
// Try local path first (relative to this file's location)
|
|
26
26
|
try {
|
|
27
|
-
const base =
|
|
27
|
+
const base = node_path_1.default.dirname(new URL(globalThis[Symbol.for("import-meta-ponyfill-commonjs")](require, module).url).pathname);
|
|
28
28
|
const normalized = process.platform === "win32" ? base.replace(/^\//, "") : base;
|
|
29
29
|
// When running from source: src/commands/ → ../../skills/openape/SKILL.md
|
|
30
30
|
// When bundled by dnt into build/: esm/commands/ or script/ → ../../skills/openape/SKILL.md
|
|
31
|
-
const localPath =
|
|
32
|
-
if (
|
|
33
|
-
return
|
|
31
|
+
const localPath = node_path_1.default.resolve(normalized, "..", "..", "skills", SKILL_NAME, "SKILL.md");
|
|
32
|
+
if (node_fs_1.default.existsSync(localPath)) {
|
|
33
|
+
return node_fs_1.default.readFileSync(localPath, "utf-8");
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
catch {
|
|
@@ -56,8 +56,8 @@ function registerSkillsCommand(program) {
|
|
|
56
56
|
let targets = [];
|
|
57
57
|
if (opts?.all) {
|
|
58
58
|
for (const [key, info] of Object.entries(PLATFORMS)) {
|
|
59
|
-
const parentDir =
|
|
60
|
-
if (
|
|
59
|
+
const parentDir = node_path_1.default.dirname(info.path);
|
|
60
|
+
if (node_fs_1.default.existsSync(parentDir)) {
|
|
61
61
|
targets.push({ key, ...info });
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -86,11 +86,11 @@ function registerSkillsCommand(program) {
|
|
|
86
86
|
const content = await readSkillContent();
|
|
87
87
|
for (const target of targets) {
|
|
88
88
|
console.log(`Installing to ${target.name} (${target.path})...`);
|
|
89
|
-
const destDir =
|
|
90
|
-
if (!
|
|
91
|
-
|
|
89
|
+
const destDir = node_path_1.default.join(target.path, SKILL_NAME);
|
|
90
|
+
if (!node_fs_1.default.existsSync(destDir)) {
|
|
91
|
+
node_fs_1.default.mkdirSync(destDir, { recursive: true });
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
node_fs_1.default.writeFileSync(node_path_1.default.join(destDir, "SKILL.md"), content, "utf-8");
|
|
94
94
|
console.log(` \x1b[32m✔\x1b[0m ${SKILL_NAME} installed!`);
|
|
95
95
|
}
|
|
96
96
|
console.log("\nDone!");
|
|
@@ -114,4 +114,3 @@ function registerSkillsCommand(program) {
|
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
exports.registerSkillsCommand = registerSkillsCommand;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"videos.d.ts","sourceRoot":"","sources":["../../../src/src/commands/videos.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+X5D"}
|