outclaw 0.2.2 → 0.2.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/dist/index.js +87 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -175,20 +175,83 @@ ${body}
|
|
|
175
175
|
import * as path2 from "path";
|
|
176
176
|
import * as os from "os";
|
|
177
177
|
import * as fs2 from "fs/promises";
|
|
178
|
-
|
|
178
|
+
var openclawConfigCache = void 0;
|
|
179
|
+
function getOpenclawConfigPath() {
|
|
180
|
+
const override = process.env.OPENCLAW_CONFIG_PATH?.trim();
|
|
181
|
+
if (override) {
|
|
182
|
+
return resolveUserPath(override);
|
|
183
|
+
}
|
|
184
|
+
const stateDir = process.env.OPENCLAW_STATE_DIR?.trim();
|
|
185
|
+
if (stateDir) {
|
|
186
|
+
return path2.join(resolveUserPath(stateDir), "openclaw.json");
|
|
187
|
+
}
|
|
188
|
+
return path2.join(os.homedir(), ".openclaw", "openclaw.json");
|
|
189
|
+
}
|
|
190
|
+
function resolveUserPath(input4) {
|
|
191
|
+
const trimmed = input4.trim();
|
|
192
|
+
if (!trimmed) return "";
|
|
193
|
+
if (trimmed.startsWith("~")) {
|
|
194
|
+
return path2.resolve(trimmed.replace(/^~(?=$|[\\/])/, os.homedir()));
|
|
195
|
+
}
|
|
196
|
+
return path2.resolve(trimmed);
|
|
197
|
+
}
|
|
198
|
+
async function readOpenclawConfig() {
|
|
199
|
+
if (openclawConfigCache !== void 0) {
|
|
200
|
+
return openclawConfigCache;
|
|
201
|
+
}
|
|
202
|
+
try {
|
|
203
|
+
const configPath = getOpenclawConfigPath();
|
|
204
|
+
const raw = await fs2.readFile(configPath, "utf-8");
|
|
205
|
+
const parsed = JSON.parse(raw);
|
|
206
|
+
if (!parsed || typeof parsed !== "object") {
|
|
207
|
+
openclawConfigCache = null;
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
openclawConfigCache = parsed;
|
|
211
|
+
return openclawConfigCache;
|
|
212
|
+
} catch {
|
|
213
|
+
openclawConfigCache = null;
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
async function getWorkspaceFromConfig() {
|
|
218
|
+
const config = await readOpenclawConfig();
|
|
219
|
+
if (!config) return null;
|
|
220
|
+
const defaultsWorkspace = config.agents?.defaults?.workspace;
|
|
221
|
+
if (defaultsWorkspace) {
|
|
222
|
+
return resolveUserPath(defaultsWorkspace);
|
|
223
|
+
}
|
|
224
|
+
const agentWorkspace = config.agent?.workspace;
|
|
225
|
+
if (agentWorkspace) {
|
|
226
|
+
return resolveUserPath(agentWorkspace);
|
|
227
|
+
}
|
|
228
|
+
const listedAgents = config.agents?.list ?? [];
|
|
229
|
+
const defaultAgent = listedAgents.find((entry) => entry.default) ?? listedAgents.find((entry) => entry.id === "main");
|
|
230
|
+
if (defaultAgent?.workspace) {
|
|
231
|
+
return resolveUserPath(defaultAgent.workspace);
|
|
232
|
+
}
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
function getDefaultWorkspace() {
|
|
236
|
+
return path2.join(os.homedir(), ".openclaw", "workspace");
|
|
237
|
+
}
|
|
238
|
+
async function getSkillsPathAsync(scope) {
|
|
179
239
|
if (scope === "global") {
|
|
180
|
-
|
|
240
|
+
const workspace = await getWorkspaceFromConfig();
|
|
241
|
+
return path2.join(workspace || getDefaultWorkspace(), "skills");
|
|
181
242
|
}
|
|
182
243
|
return path2.join(process.cwd(), "skills");
|
|
183
244
|
}
|
|
184
|
-
function
|
|
245
|
+
async function getLockFilePathAsync(scope) {
|
|
185
246
|
if (scope === "global") {
|
|
186
|
-
|
|
247
|
+
const workspace = await getWorkspaceFromConfig();
|
|
248
|
+
return path2.join(workspace || getDefaultWorkspace(), "lock.json");
|
|
187
249
|
}
|
|
188
250
|
return path2.join(process.cwd(), ".outclaw", "lock.json");
|
|
189
251
|
}
|
|
190
|
-
function
|
|
191
|
-
|
|
252
|
+
async function getSkillPathAsync(skillName, scope) {
|
|
253
|
+
const skillsPath = await getSkillsPathAsync(scope);
|
|
254
|
+
return path2.join(skillsPath, skillName);
|
|
192
255
|
}
|
|
193
256
|
async function ensureDir(dirPath) {
|
|
194
257
|
await fs2.mkdir(dirPath, { recursive: true });
|
|
@@ -204,28 +267,31 @@ async function pathExists(filePath) {
|
|
|
204
267
|
function getConfigPath() {
|
|
205
268
|
return path2.join(os.homedir(), ".config", "outclaw");
|
|
206
269
|
}
|
|
207
|
-
function getManifestPath(scope) {
|
|
208
|
-
return getLockFilePath(scope);
|
|
209
|
-
}
|
|
210
270
|
|
|
211
271
|
// src/core/skill-manager.ts
|
|
212
272
|
var SkillManager = class {
|
|
213
273
|
scope;
|
|
214
|
-
basePath;
|
|
274
|
+
basePath = null;
|
|
215
275
|
constructor(scope = "project") {
|
|
216
276
|
this.scope = scope;
|
|
217
|
-
|
|
277
|
+
}
|
|
278
|
+
async getBasePath() {
|
|
279
|
+
if (!this.basePath) {
|
|
280
|
+
this.basePath = await getSkillsPathAsync(this.scope);
|
|
281
|
+
}
|
|
282
|
+
return this.basePath;
|
|
218
283
|
}
|
|
219
284
|
/**
|
|
220
285
|
* List all installed skills
|
|
221
286
|
*/
|
|
222
287
|
async listSkills() {
|
|
223
288
|
const skills = [];
|
|
289
|
+
const basePath = await this.getBasePath();
|
|
224
290
|
try {
|
|
225
|
-
const dirs = await fs3.readdir(
|
|
291
|
+
const dirs = await fs3.readdir(basePath);
|
|
226
292
|
for (const dir of dirs) {
|
|
227
293
|
if (dir.startsWith(".")) continue;
|
|
228
|
-
const skillPath = path3.join(
|
|
294
|
+
const skillPath = path3.join(basePath, dir);
|
|
229
295
|
const stat3 = await fs3.stat(skillPath);
|
|
230
296
|
if (stat3.isDirectory()) {
|
|
231
297
|
try {
|
|
@@ -244,7 +310,7 @@ var SkillManager = class {
|
|
|
244
310
|
* Get a specific skill by name
|
|
245
311
|
*/
|
|
246
312
|
async getSkill(name) {
|
|
247
|
-
const skillPath =
|
|
313
|
+
const skillPath = await getSkillPathAsync(name, this.scope);
|
|
248
314
|
try {
|
|
249
315
|
const parser = new SkillParser(skillPath);
|
|
250
316
|
const skill = await parser.parse();
|
|
@@ -257,14 +323,14 @@ var SkillManager = class {
|
|
|
257
323
|
* Check if a skill exists
|
|
258
324
|
*/
|
|
259
325
|
async skillExists(name) {
|
|
260
|
-
const skillPath =
|
|
326
|
+
const skillPath = await getSkillPathAsync(name, this.scope);
|
|
261
327
|
return await pathExists(path3.join(skillPath, "SKILL.md"));
|
|
262
328
|
}
|
|
263
329
|
/**
|
|
264
330
|
* Create a new skill
|
|
265
331
|
*/
|
|
266
332
|
async createSkill(options) {
|
|
267
|
-
const skillPath =
|
|
333
|
+
const skillPath = await getSkillPathAsync(options.name, options.scope);
|
|
268
334
|
if (await pathExists(skillPath)) {
|
|
269
335
|
throw new Error(`Skill "${options.name}" already exists at ${skillPath}`);
|
|
270
336
|
}
|
|
@@ -307,7 +373,7 @@ Your skill instructions here...
|
|
|
307
373
|
* Install a skill from content
|
|
308
374
|
*/
|
|
309
375
|
async installSkill(name, skillMdContent, options) {
|
|
310
|
-
const skillPath =
|
|
376
|
+
const skillPath = await getSkillPathAsync(name, this.scope);
|
|
311
377
|
if (!options.force && await pathExists(skillPath)) {
|
|
312
378
|
throw new Error(`Skill "${name}" already exists. Use --force to overwrite.`);
|
|
313
379
|
}
|
|
@@ -320,7 +386,7 @@ Your skill instructions here...
|
|
|
320
386
|
* Uninstall a skill
|
|
321
387
|
*/
|
|
322
388
|
async uninstallSkill(name) {
|
|
323
|
-
const skillPath =
|
|
389
|
+
const skillPath = await getSkillPathAsync(name, this.scope);
|
|
324
390
|
if (!await pathExists(skillPath)) {
|
|
325
391
|
throw new Error(`Skill "${name}" not found`);
|
|
326
392
|
}
|
|
@@ -331,7 +397,7 @@ Your skill instructions here...
|
|
|
331
397
|
* Get manifest
|
|
332
398
|
*/
|
|
333
399
|
async getManifest() {
|
|
334
|
-
const manifestPath =
|
|
400
|
+
const manifestPath = await getLockFilePathAsync(this.scope);
|
|
335
401
|
try {
|
|
336
402
|
const content = await fs3.readFile(manifestPath, "utf-8");
|
|
337
403
|
return JSON.parse(content);
|
|
@@ -343,7 +409,7 @@ Your skill instructions here...
|
|
|
343
409
|
* Update manifest with new skill
|
|
344
410
|
*/
|
|
345
411
|
async updateManifest(name, source) {
|
|
346
|
-
const manifestPath =
|
|
412
|
+
const manifestPath = await getLockFilePathAsync(this.scope);
|
|
347
413
|
const manifest = await this.getManifest();
|
|
348
414
|
const entry = {
|
|
349
415
|
name,
|
|
@@ -365,7 +431,7 @@ Your skill instructions here...
|
|
|
365
431
|
* Remove skill from manifest
|
|
366
432
|
*/
|
|
367
433
|
async removeFromManifest(name) {
|
|
368
|
-
const manifestPath =
|
|
434
|
+
const manifestPath = await getLockFilePathAsync(this.scope);
|
|
369
435
|
try {
|
|
370
436
|
const content = await fs3.readFile(manifestPath, "utf-8");
|
|
371
437
|
const manifest = JSON.parse(content);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts","../src/commands/init.ts","../src/core/skill-manager.ts","../src/parsers/skill-parser.ts","../src/schemas/skill.schema.ts","../src/utils/paths.ts","../src/ui/logger.ts","../src/ui/table.ts","../src/commands/list.ts","../src/commands/install.ts","../src/core/config.ts","../src/core/api-client.ts","../src/ui/spinner.ts","../src/commands/uninstall.ts","../src/commands/search.ts","../src/commands/info.ts","../src/commands/login.ts","../src/commands/logout.ts","../src/commands/whoami.ts","../src/commands/publish.ts","../src/index.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { initCommand } from './commands/init.js';\nimport { listCommand } from './commands/list.js';\nimport { installCommand } from './commands/install.js';\nimport { uninstallCommand } from './commands/uninstall.js';\nimport { searchCommand } from './commands/search.js';\nimport { infoCommand } from './commands/info.js';\nimport { loginCommand } from './commands/login.js';\nimport { logoutCommand } from './commands/logout.js';\nimport { whoamiCommand } from './commands/whoami.js';\nimport { publishCommand } from './commands/publish.js';\n\nconst VERSION = '0.1.0';\n\nexport const cli = new Command();\n\ncli\n .name('outclaw')\n .description('CLI tool for managing Claude Code Skills')\n .version(VERSION);\n\n// login command\ncli\n .command('login')\n .description('Authenticate with Outclaws')\n .option('-t, --token <key>', 'API key for authentication')\n .action(async (options) => {\n await loginCommand(options);\n });\n\n// logout command\ncli\n .command('logout')\n .description('Log out and remove stored credentials')\n .option('-y, --yes', 'Skip confirmation prompt')\n .action(async (options) => {\n await logoutCommand(options);\n });\n\n// whoami command\ncli\n .command('whoami')\n .description('Show current authenticated agent')\n .option('--json', 'Output as JSON')\n .action(async (options) => {\n await whoamiCommand(options);\n });\n\n// init command\ncli\n .command('init [name]')\n .description('Create a new skill project')\n .option('-g, --global', 'Create in global skills directory (~/.claude/skills)')\n .option('-t, --template <type>', 'Skill template (minimal, standard, complete)', 'minimal')\n .option('-y, --yes', 'Skip prompts and use defaults')\n .action(async (name, options) => {\n await initCommand({ name, ...options });\n });\n\n// install command\ncli\n .command('install <skill>')\n .alias('i')\n .alias('add')\n .description('Install a skill from registry, GitHub, or URL')\n .option('-g, --global', 'Install globally (~/.claude/skills)')\n .option('-f, --force', 'Overwrite existing skill')\n .option('-y, --yes', 'Skip confirmation prompts')\n .action(async (skill, options) => {\n await installCommand(skill, options);\n });\n\n// uninstall command\ncli\n .command('uninstall <skill>')\n .alias('rm')\n .alias('remove')\n .description('Uninstall a skill')\n .option('-g, --global', 'Uninstall from global directory')\n .option('-y, --yes', 'Skip confirmation prompts')\n .action(async (skill, options) => {\n await uninstallCommand(skill, options);\n });\n\n// list command\ncli\n .command('list')\n .alias('ls')\n .description('List installed skills')\n .option('-g, --global', 'List only global skills')\n .option('-p, --project', 'List only project skills')\n .option('--json', 'Output as JSON')\n .action(async (options) => {\n await listCommand(options);\n });\n\n// search command\ncli\n .command('search <query>')\n .alias('find')\n .description('Search for skills in the registry')\n .option('-l, --limit <number>', 'Maximum results', '20')\n .option('--json', 'Output as JSON')\n .action(async (query, options) => {\n await searchCommand(query, { ...options, limit: parseInt(options.limit) });\n });\n\n// info command\ncli\n .command('info <skill>')\n .description('Show detailed information about a skill')\n .option('-g, --global', 'Look in global skills')\n .action(async (skill, options) => {\n await infoCommand(skill, options);\n });\n\n// publish command\ncli\n .command('publish <path>')\n .description('Publish a skill to Outclaws registry')\n .option('-t, --title <title>', 'Skill title')\n .option('-d, --description <desc>', 'Skill description')\n .option('-c, --community <id>', 'Community ID')\n .option('-y, --yes', 'Skip confirmation prompt')\n .action(async (path, options) => {\n await publishCommand(path, options);\n });\n\n// Handle unknown commands\ncli.on('command:*', () => {\n console.error(`Unknown command: ${cli.args.join(' ')}`);\n console.log('Run \"outclaw --help\" for available commands.');\n process.exit(1);\n});\n","import { input, select, checkbox, confirm } from '@inquirer/prompts';\nimport { SkillManager } from '../core/skill-manager.js';\nimport { logger } from '../ui/logger.js';\nimport type { Scope } from '../utils/paths.js';\n\nconst AVAILABLE_TOOLS = [\n { name: 'Read - Read files', value: 'Read' },\n { name: 'Write - Write files', value: 'Write' },\n { name: 'Edit - Edit files', value: 'Edit' },\n { name: 'Grep - Search file contents', value: 'Grep' },\n { name: 'Glob - Find files by pattern', value: 'Glob' },\n { name: 'Bash - Execute shell commands', value: 'Bash' },\n { name: 'WebFetch - Fetch web content', value: 'WebFetch' },\n { name: 'WebSearch - Search the web', value: 'WebSearch' },\n];\n\nexport interface InitOptions {\n name?: string;\n global?: boolean;\n template?: 'minimal' | 'standard' | 'complete';\n yes?: boolean;\n}\n\nexport async function initCommand(options: InitOptions): Promise<void> {\n try {\n // Determine scope\n const scope: Scope = options.global ? 'global' : 'project';\n\n // Get skill name\n let name = options.name;\n if (!name) {\n name = await input({\n message: 'Skill name:',\n validate: (value) => {\n if (!value) return 'Name is required';\n if (!/^[a-z0-9-]+$/.test(value)) {\n return 'Name must be lowercase alphanumeric with hyphens (e.g., my-skill)';\n }\n return true;\n },\n });\n }\n\n // Check if skill already exists\n const manager = new SkillManager(scope);\n if (await manager.skillExists(name)) {\n logger.error(`Skill \"${name}\" already exists`);\n process.exit(1);\n }\n\n let description: string;\n let userInvocable = true;\n let disableModelInvocation = false;\n let allowedTools: string[] = [];\n let argumentHint: string | undefined;\n let context: 'normal' | 'fork' | undefined;\n\n if (options.yes) {\n // Use defaults\n description = `${name} skill for Claude Code`;\n } else {\n // Interactive prompts\n description = await input({\n message: 'Description (for trigger matching):',\n validate: (value) => {\n if (!value || value.length < 10) {\n return 'Description should be at least 10 characters for good trigger matching';\n }\n return true;\n },\n });\n\n userInvocable = await confirm({\n message: 'User-invocable (can be called via /skill-name)?',\n default: true,\n });\n\n disableModelInvocation = await confirm({\n message: 'Disable automatic model invocation (only manual trigger)?',\n default: false,\n });\n\n allowedTools = await checkbox({\n message: 'Select allowed tools (tools that can be used without permission):',\n choices: AVAILABLE_TOOLS,\n });\n\n const wantsArgs = await confirm({\n message: 'Does this skill accept arguments?',\n default: false,\n });\n\n if (wantsArgs) {\n argumentHint = await input({\n message: 'Argument hint (e.g., [file-path] [options]):',\n });\n }\n\n const runInSubagent = await confirm({\n message: 'Run in isolated subagent context?',\n default: false,\n });\n\n if (runInSubagent) {\n context = 'fork';\n }\n }\n\n // Create the skill\n const skillPath = await manager.createSkill({\n name,\n description,\n scope,\n userInvocable,\n disableModelInvocation,\n allowedTools,\n argumentHint,\n context,\n });\n\n logger.success(`Skill created at: ${skillPath}`);\n logger.info('');\n logger.info('Next steps:');\n logger.dim(` 1. Edit ${skillPath}/SKILL.md to add your skill instructions`);\n logger.dim(` 2. Use /${name} in Claude Code to invoke your skill`);\n logger.info('');\n } catch (error) {\n if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n process.exit(1);\n }\n}\n","import * as fs from 'fs/promises';\nimport * as path from 'path';\nimport { SkillParser, generateSkillMd } from '../parsers/skill-parser.js';\nimport {\n getSkillsPath,\n getSkillPath,\n getManifestPath,\n ensureDir,\n pathExists,\n type Scope,\n} from '../utils/paths.js';\nimport type { Skill, SkillFrontmatter } from '../schemas/skill.schema.js';\nimport type { OutclawManifest, SkillManifest, SkillSource } from '../schemas/manifest.schema.js';\n\nexport interface SkillInfo extends Skill {\n scope: Scope;\n}\n\nexport interface CreateSkillOptions {\n name: string;\n description: string;\n version?: string;\n disableModelInvocation?: boolean;\n userInvocable?: boolean;\n allowedTools?: string[];\n argumentHint?: string;\n model?: string;\n context?: 'normal' | 'fork';\n agent?: string;\n scope: Scope;\n content?: string;\n}\n\nexport interface InstallOptions {\n force?: boolean;\n source: SkillSource;\n}\n\nexport class SkillManager {\n private scope: Scope;\n private basePath: string;\n\n constructor(scope: Scope = 'project') {\n this.scope = scope;\n this.basePath = getSkillsPath(scope);\n }\n\n /**\n * List all installed skills\n */\n async listSkills(): Promise<SkillInfo[]> {\n const skills: SkillInfo[] = [];\n\n try {\n const dirs = await fs.readdir(this.basePath);\n\n for (const dir of dirs) {\n // Skip hidden files and manifest\n if (dir.startsWith('.')) continue;\n\n const skillPath = path.join(this.basePath, dir);\n const stat = await fs.stat(skillPath);\n\n if (stat.isDirectory()) {\n try {\n const parser = new SkillParser(skillPath);\n const skill = await parser.parse();\n skills.push({ ...skill, scope: this.scope });\n } catch {\n // Skip invalid skills\n }\n }\n }\n } catch {\n // Directory doesn't exist\n }\n\n return skills;\n }\n\n /**\n * Get a specific skill by name\n */\n async getSkill(name: string): Promise<SkillInfo | null> {\n const skillPath = getSkillPath(name, this.scope);\n\n try {\n const parser = new SkillParser(skillPath);\n const skill = await parser.parse();\n return { ...skill, scope: this.scope };\n } catch {\n return null;\n }\n }\n\n /**\n * Check if a skill exists\n */\n async skillExists(name: string): Promise<boolean> {\n const skillPath = getSkillPath(name, this.scope);\n return await pathExists(path.join(skillPath, 'SKILL.md'));\n }\n\n /**\n * Create a new skill\n */\n async createSkill(options: CreateSkillOptions): Promise<string> {\n const skillPath = getSkillPath(options.name, options.scope);\n\n // Check if skill already exists\n if (await pathExists(skillPath)) {\n throw new Error(`Skill \"${options.name}\" already exists at ${skillPath}`);\n }\n\n // Create skill directory\n await ensureDir(skillPath);\n\n // Build frontmatter\n const frontmatter: Partial<SkillFrontmatter> = {\n name: options.name,\n description: options.description,\n version: options.version || '1.0.0',\n };\n\n if (options.disableModelInvocation !== undefined) {\n frontmatter['disable-model-invocation'] = options.disableModelInvocation;\n }\n if (options.userInvocable !== undefined) {\n frontmatter['user-invocable'] = options.userInvocable;\n }\n if (options.allowedTools?.length) {\n frontmatter['allowed-tools'] = options.allowedTools;\n }\n if (options.argumentHint) {\n frontmatter['argument-hint'] = options.argumentHint;\n }\n if (options.model) {\n frontmatter.model = options.model;\n }\n if (options.context) {\n frontmatter.context = options.context;\n }\n if (options.agent) {\n frontmatter.agent = options.agent;\n }\n\n // Generate SKILL.md content\n const content = options.content || `# ${options.name}\\n\\nYour skill instructions here...\\n`;\n const skillMdContent = generateSkillMd(frontmatter, content);\n\n // Write SKILL.md\n await fs.writeFile(path.join(skillPath, 'SKILL.md'), skillMdContent, 'utf-8');\n\n return skillPath;\n }\n\n /**\n * Install a skill from content\n */\n async installSkill(\n name: string,\n skillMdContent: string,\n options: InstallOptions\n ): Promise<string> {\n const skillPath = getSkillPath(name, this.scope);\n\n // Check if skill already exists\n if (!options.force && (await pathExists(skillPath))) {\n throw new Error(`Skill \"${name}\" already exists. Use --force to overwrite.`);\n }\n\n // Create skill directory\n await ensureDir(skillPath);\n\n // Write SKILL.md\n await fs.writeFile(path.join(skillPath, 'SKILL.md'), skillMdContent, 'utf-8');\n\n // Update manifest\n await this.updateManifest(name, options.source);\n\n return skillPath;\n }\n\n /**\n * Uninstall a skill\n */\n async uninstallSkill(name: string): Promise<void> {\n const skillPath = getSkillPath(name, this.scope);\n\n if (!(await pathExists(skillPath))) {\n throw new Error(`Skill \"${name}\" not found`);\n }\n\n await fs.rm(skillPath, { recursive: true, force: true });\n await this.removeFromManifest(name);\n }\n\n /**\n * Get manifest\n */\n async getManifest(): Promise<OutclawManifest> {\n const manifestPath = getManifestPath(this.scope);\n\n try {\n const content = await fs.readFile(manifestPath, 'utf-8');\n return JSON.parse(content);\n } catch {\n return { version: 1, skills: [] };\n }\n }\n\n /**\n * Update manifest with new skill\n */\n private async updateManifest(name: string, source: SkillSource): Promise<void> {\n const manifestPath = getManifestPath(this.scope);\n const manifest = await this.getManifest();\n\n const entry: SkillManifest = {\n name,\n version: '1.0.0',\n installedAt: new Date().toISOString(),\n source,\n scope: this.scope,\n };\n\n // Update or add skill entry\n const index = manifest.skills.findIndex((s) => s.name === name);\n if (index >= 0) {\n manifest.skills[index] = entry;\n } else {\n manifest.skills.push(entry);\n }\n\n await ensureDir(path.dirname(manifestPath));\n await fs.writeFile(manifestPath, JSON.stringify(manifest, null, 2));\n }\n\n /**\n * Remove skill from manifest\n */\n private async removeFromManifest(name: string): Promise<void> {\n const manifestPath = getManifestPath(this.scope);\n\n try {\n const content = await fs.readFile(manifestPath, 'utf-8');\n const manifest: OutclawManifest = JSON.parse(content);\n manifest.skills = manifest.skills.filter((s) => s.name !== name);\n await fs.writeFile(manifestPath, JSON.stringify(manifest, null, 2));\n } catch {\n // Manifest doesn't exist, nothing to update\n }\n }\n}\n","import * as fs from 'fs/promises';\nimport * as path from 'path';\nimport matter from 'gray-matter';\nimport { SkillFrontmatterSchema, type Skill, type SkillFrontmatter } from '../schemas/skill.schema.js';\n\nexport interface SkillStructure {\n hasSkillMd: boolean;\n hasReferences: boolean;\n hasScripts: boolean;\n hasExamples: boolean;\n files: string[];\n}\n\nexport class SkillParser {\n private basePath: string;\n\n constructor(basePath: string) {\n this.basePath = basePath;\n }\n\n /**\n * Parse SKILL.md and return the full skill object\n */\n async parse(): Promise<Skill> {\n const skillMdPath = path.join(this.basePath, 'SKILL.md');\n const content = await fs.readFile(skillMdPath, 'utf-8');\n\n const { data, content: body } = matter(content);\n\n // Validate frontmatter with Zod\n const frontmatter = SkillFrontmatterSchema.parse(data);\n\n return {\n ...frontmatter,\n content: body.trim(),\n path: this.basePath,\n };\n }\n\n /**\n * Parse only the frontmatter without validating\n */\n async parseFrontmatter(): Promise<SkillFrontmatter> {\n const skillMdPath = path.join(this.basePath, 'SKILL.md');\n const content = await fs.readFile(skillMdPath, 'utf-8');\n\n const { data } = matter(content);\n return SkillFrontmatterSchema.parse(data);\n }\n\n /**\n * Get the structure of the skill directory\n */\n async getStructure(): Promise<SkillStructure> {\n const structure: SkillStructure = {\n hasSkillMd: false,\n hasReferences: false,\n hasScripts: false,\n hasExamples: false,\n files: [],\n };\n\n try {\n const entries = await fs.readdir(this.basePath, { withFileTypes: true });\n\n for (const entry of entries) {\n if (entry.isFile() && entry.name === 'SKILL.md') {\n structure.hasSkillMd = true;\n } else if (entry.isDirectory()) {\n switch (entry.name) {\n case 'references':\n structure.hasReferences = true;\n break;\n case 'scripts':\n structure.hasScripts = true;\n break;\n case 'examples':\n structure.hasExamples = true;\n break;\n }\n }\n structure.files.push(entry.name);\n }\n } catch {\n // Directory doesn't exist\n }\n\n return structure;\n }\n\n /**\n * Check if a valid skill exists at this path\n */\n async isValid(): Promise<boolean> {\n try {\n await this.parse();\n return true;\n } catch {\n return false;\n }\n }\n}\n\n/**\n * Parse SKILL.md content string and return frontmatter and body\n */\nexport function parseSkillFrontmatter(content: string): { frontmatter: Record<string, unknown>; body: string } {\n const { data, content: body } = matter(content);\n return { frontmatter: data, body: body.trim() };\n}\n\n/**\n * Generate SKILL.md content from frontmatter and body\n */\nexport function generateSkillMd(frontmatter: Partial<SkillFrontmatter>, body: string): string {\n const yamlLines: string[] = [];\n\n if (frontmatter.name) {\n yamlLines.push(`name: ${frontmatter.name}`);\n }\n if (frontmatter.description) {\n yamlLines.push(`description: ${frontmatter.description}`);\n }\n if (frontmatter.version) {\n yamlLines.push(`version: ${frontmatter.version}`);\n }\n if (frontmatter['disable-model-invocation'] !== undefined) {\n yamlLines.push(`disable-model-invocation: ${frontmatter['disable-model-invocation']}`);\n }\n if (frontmatter['user-invocable'] !== undefined) {\n yamlLines.push(`user-invocable: ${frontmatter['user-invocable']}`);\n }\n if (frontmatter['allowed-tools']?.length) {\n const tools = Array.isArray(frontmatter['allowed-tools'])\n ? frontmatter['allowed-tools'].join(', ')\n : frontmatter['allowed-tools'];\n yamlLines.push(`allowed-tools: ${tools}`);\n }\n if (frontmatter['argument-hint']) {\n yamlLines.push(`argument-hint: ${frontmatter['argument-hint']}`);\n }\n if (frontmatter.model) {\n yamlLines.push(`model: ${frontmatter.model}`);\n }\n if (frontmatter.context) {\n yamlLines.push(`context: ${frontmatter.context}`);\n }\n if (frontmatter.agent) {\n yamlLines.push(`agent: ${frontmatter.agent}`);\n }\n\n return `---\n${yamlLines.join('\\n')}\n---\n\n${body}\n`;\n}\n","import { z } from 'zod';\n\n// SKILL.md frontmatter schema\nexport const SkillFrontmatterSchema = z.object({\n name: z\n .string()\n .min(1, 'Name is required')\n .regex(/^[a-z0-9-]+$/, 'Name must be lowercase alphanumeric with hyphens'),\n\n description: z\n .string()\n .min(10, 'Description should be detailed for good triggering'),\n\n version: z\n .string()\n .regex(/^\\d+\\.\\d+\\.\\d+$/, 'Version must be semver format')\n .optional(),\n\n 'disable-model-invocation': z.boolean().optional().default(false),\n\n 'user-invocable': z.boolean().optional().default(true),\n\n 'allowed-tools': z\n .union([z.string(), z.array(z.string())])\n .optional()\n .transform((val) => {\n if (typeof val === 'string') {\n return val.split(',').map((t) => t.trim());\n }\n return val;\n }),\n\n 'argument-hint': z.string().optional(),\n\n model: z.string().optional(),\n\n context: z.enum(['normal', 'fork']).optional(),\n\n agent: z.string().optional(),\n\n license: z.string().optional(),\n\n author: z\n .union([\n z.string(),\n z.object({\n name: z.string(),\n email: z.string().email().optional(),\n url: z.string().url().optional(),\n }),\n ])\n .optional(),\n\n keywords: z.array(z.string()).optional(),\n\n repository: z.string().optional(),\n});\n\n// Full skill schema including content\nexport const SkillSchema = SkillFrontmatterSchema.extend({\n content: z.string().min(1, 'Skill content is required'),\n path: z.string(),\n});\n\nexport type SkillFrontmatter = z.infer<typeof SkillFrontmatterSchema>;\nexport type Skill = z.infer<typeof SkillSchema>;\n","import * as path from 'path';\nimport * as os from 'os';\nimport * as fs from 'fs/promises';\n\nexport type Scope = 'global' | 'project';\n\n/**\n * Get the skills directory path for a given scope\n * - global: ~/.openclaw/workspace/skills/\n * - project: ./skills/ (current working directory)\n */\nexport function getSkillsPath(scope: Scope): string {\n if (scope === 'global') {\n return path.join(os.homedir(), '.openclaw', 'workspace', 'skills');\n }\n return path.join(process.cwd(), 'skills');\n}\n\n/**\n * Get the lock file path for a given scope\n * - global: ~/.openclaw/workspace/lock.json\n * - project: .outclaw/lock.json\n */\nexport function getLockFilePath(scope: Scope): string {\n if (scope === 'global') {\n return path.join(os.homedir(), '.openclaw', 'workspace', 'lock.json');\n }\n return path.join(process.cwd(), '.outclaw', 'lock.json');\n}\n\n/**\n * Get the path to a specific skill\n */\nexport function getSkillPath(skillName: string, scope: Scope): string {\n return path.join(getSkillsPath(scope), skillName);\n}\n\n/**\n * Get the SKILL.md path for a specific skill\n */\nexport function getSkillMdPath(skillName: string, scope: Scope): string {\n return path.join(getSkillPath(skillName, scope), 'SKILL.md');\n}\n\n/**\n * Ensure directory exists\n */\nexport async function ensureDir(dirPath: string): Promise<void> {\n await fs.mkdir(dirPath, { recursive: true });\n}\n\n/**\n * Check if a path exists\n */\nexport async function pathExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Get config directory path (for API credentials)\n */\nexport function getConfigPath(): string {\n return path.join(os.homedir(), '.config', 'outclaw');\n}\n\n/**\n * @deprecated Use getLockFilePath instead\n */\nexport function getManifestPath(scope: Scope): string {\n return getLockFilePath(scope);\n}\n","import chalk from 'chalk';\n\nexport const logger = {\n info: (message: string) => {\n console.log(message);\n },\n\n success: (message: string) => {\n console.log(chalk.green('✓'), message);\n },\n\n error: (message: string) => {\n console.error(chalk.red('✗'), message);\n },\n\n warn: (message: string) => {\n console.log(chalk.yellow('⚠'), message);\n },\n\n dim: (message: string) => {\n console.log(chalk.dim(message));\n },\n\n skill: (info: { name: string; description: string; author?: string; downloads?: number; installCmd?: string }) => {\n console.log();\n console.log(chalk.bold.cyan(info.name));\n console.log(chalk.dim(info.description));\n const meta: string[] = [];\n if (info.author) {\n meta.push(`by ${info.author}`);\n }\n if (info.downloads !== undefined) {\n meta.push(`${info.downloads.toLocaleString()} downloads`);\n }\n if (meta.length > 0) {\n console.log(chalk.dim(meta.join(' · ')));\n }\n if (info.installCmd) {\n console.log(chalk.dim(`$ ${info.installCmd}`));\n }\n },\n\n box: (title: string, content: string) => {\n const lines = content.split('\\n');\n const maxLen = Math.max(title.length, ...lines.map((l) => l.length));\n const border = '─'.repeat(maxLen + 2);\n\n console.log(`┌${border}┐`);\n console.log(`│ ${chalk.bold(title.padEnd(maxLen))} │`);\n console.log(`├${border}┤`);\n for (const line of lines) {\n console.log(`│ ${line.padEnd(maxLen)} │`);\n }\n console.log(`└${border}┘`);\n },\n};\n","import Table from 'cli-table3';\nimport chalk from 'chalk';\n\nexport interface TableOptions {\n headers: string[];\n rows: string[][];\n}\n\nexport function renderTable(options: TableOptions): void {\n const table = new Table({\n head: options.headers.map((h) => chalk.bold.cyan(h)),\n style: {\n head: [],\n border: [],\n },\n });\n\n for (const row of options.rows) {\n table.push(row);\n }\n\n console.log(table.toString());\n}\n","import { SkillManager, type SkillInfo } from '../core/skill-manager.js';\nimport { logger } from '../ui/logger.js';\nimport { renderTable } from '../ui/table.js';\nimport type { Scope } from '../utils/paths.js';\n\nexport interface ListOptions {\n global?: boolean;\n project?: boolean;\n json?: boolean;\n}\n\nexport async function listCommand(options: ListOptions): Promise<void> {\n try {\n const scopes: Scope[] = [];\n\n if (options.global) {\n scopes.push('global');\n } else if (options.project) {\n scopes.push('project');\n } else {\n scopes.push('global', 'project');\n }\n\n const allSkills: SkillInfo[] = [];\n\n for (const scope of scopes) {\n const manager = new SkillManager(scope);\n const skills = await manager.listSkills();\n allSkills.push(...skills);\n }\n\n if (allSkills.length === 0) {\n logger.info('No skills installed.');\n logger.info('');\n logger.dim('Install skills with: outclaw install <skill>');\n logger.dim('Create a new skill with: outclaw init');\n return;\n }\n\n if (options.json) {\n console.log(JSON.stringify(allSkills, null, 2));\n return;\n }\n\n logger.info(`Found ${allSkills.length} skill(s):\\n`);\n\n renderTable({\n headers: ['Name', 'Version', 'Scope', 'Description'],\n rows: allSkills.map((s) => [\n s.name,\n s.version || '-',\n s.scope,\n s.description.length > 50 ? s.description.slice(0, 47) + '...' : s.description,\n ]),\n });\n } catch (error) {\n if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n process.exit(1);\n }\n}\n","import { confirm } from '@inquirer/prompts';\nimport { SkillManager } from '../core/skill-manager.js';\nimport { ApiClient, ApiError } from '../core/api-client.js';\nimport { isLoggedIn } from '../core/config.js';\nimport { logger } from '../ui/logger.js';\nimport { spinner } from '../ui/spinner.js';\nimport type { Scope } from '../utils/paths.js';\nimport type { SkillSource } from '../schemas/manifest.schema.js';\n\nexport interface InstallOptions {\n global?: boolean;\n force?: boolean;\n yes?: boolean;\n}\n\ninterface ParsedSource {\n type: 'github' | 'url' | 'local' | 'registry';\n owner?: string;\n repo?: string;\n skillPath?: string;\n ref?: string;\n url?: string;\n localPath?: string;\n registryId?: string; // UUID or slug for registry\n}\n\n// UUID regex pattern\nconst UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * Parse skill specifier to determine source\n * Formats:\n * - github:owner/repo\n * - github:owner/repo@ref\n * - github:owner/repo/path/to/skill\n * - https://github.com/owner/repo\n * - ./local/path\n * - <uuid> (registry ID)\n * - <name> (registry search - single word)\n */\nfunction parseSkillSpecifier(specifier: string): ParsedSource {\n // GitHub shorthand: github:owner/repo[@ref][/path]\n if (specifier.startsWith('github:')) {\n const rest = specifier.slice(7);\n const [ownerRepo, ...pathParts] = rest.split('/');\n const [owner, repoWithRef] = ownerRepo.includes('/')\n ? [ownerRepo.split('/')[0], ownerRepo.split('/').slice(1).join('/')]\n : [ownerRepo, pathParts[0]];\n\n let repo = repoWithRef || pathParts[0] || '';\n let ref: string | undefined;\n\n if (repo.includes('@')) {\n [repo, ref] = repo.split('@');\n }\n\n const skillPath = pathParts.slice(1).join('/');\n\n return {\n type: 'github',\n owner,\n repo,\n ref,\n skillPath: skillPath || undefined,\n };\n }\n\n // GitHub URL\n if (specifier.includes('github.com')) {\n const url = new URL(specifier);\n const parts = url.pathname.slice(1).split('/');\n const owner = parts[0];\n let repo = parts[1];\n let ref: string | undefined;\n\n // Handle .git suffix\n if (repo?.endsWith('.git')) {\n repo = repo.slice(0, -4);\n }\n\n // Handle tree/branch reference\n if (parts[2] === 'tree' && parts[3]) {\n ref = parts[3];\n }\n\n const skillPath = parts.slice(4).join('/');\n\n return {\n type: 'github',\n owner,\n repo,\n ref,\n skillPath: skillPath || undefined,\n };\n }\n\n // Generic URL\n if (specifier.startsWith('http://') || specifier.startsWith('https://')) {\n return {\n type: 'url',\n url: specifier,\n };\n }\n\n // Local path\n if (specifier.startsWith('./') || specifier.startsWith('/') || specifier.startsWith('../')) {\n return {\n type: 'local',\n localPath: specifier,\n };\n }\n\n // GitHub shorthand: owner/repo\n if (specifier.includes('/')) {\n const [owner, repoWithRef] = specifier.split('/');\n let repo = repoWithRef;\n let ref: string | undefined;\n\n if (repo?.includes('@')) {\n [repo, ref] = repo.split('@');\n }\n\n return {\n type: 'github',\n owner,\n repo,\n ref,\n };\n }\n\n // UUID - registry ID\n if (UUID_PATTERN.test(specifier)) {\n return {\n type: 'registry',\n registryId: specifier,\n };\n }\n\n // Single name - assume registry search/slug\n return {\n type: 'registry',\n registryId: specifier,\n };\n}\n\nasync function fetchFromGitHub(source: ParsedSource): Promise<{ name: string; content: string }> {\n const { owner, repo, ref = 'main', skillPath = '' } = source;\n\n // Construct raw GitHub URL for SKILL.md\n const basePath = skillPath ? `${skillPath}/` : '';\n const skillMdUrl = `https://raw.githubusercontent.com/${owner}/${repo}/${ref}/${basePath}SKILL.md`;\n\n const response = await fetch(skillMdUrl);\n\n if (!response.ok) {\n if (response.status === 404) {\n throw new Error(`SKILL.md not found at ${skillMdUrl}`);\n }\n throw new Error(`Failed to fetch skill: ${response.statusText}`);\n }\n\n const content = await response.text();\n\n // Extract name from frontmatter or use repo name\n const nameMatch = content.match(/^name:\\s*(.+)$/m);\n const name = nameMatch ? nameMatch[1].trim() : repo!;\n\n return { name, content };\n}\n\nasync function fetchFromRegistry(\n client: ApiClient,\n registryId: string\n): Promise<{ name: string; content: string; workflowId: string }> {\n // Check if it's a UUID or need to search\n if (UUID_PATTERN.test(registryId)) {\n // Direct ID - download\n const content = await client.downloadWorkflow(registryId);\n const workflow = await client.getWorkflow(registryId);\n\n // Extract name from content frontmatter or use title\n const nameMatch = content.match(/^name:\\s*(.+)$/m);\n const name = nameMatch ? nameMatch[1].trim() : workflow.title;\n\n return { name, content, workflowId: registryId };\n }\n\n // Search by name/slug\n const results = await client.searchWorkflows(registryId, { limit: 5 });\n\n if (results.workflows.length === 0) {\n throw new Error(`No skill found matching \"${registryId}\" in the registry.`);\n }\n\n // If exact match found, use it\n const exactMatch = results.workflows.find(\n (w) => w.title.toLowerCase() === registryId.toLowerCase() || w.slug === registryId\n );\n\n const workflow = exactMatch || results.workflows[0];\n\n if (!exactMatch && results.workflows.length > 1) {\n logger.warn(`Multiple skills found. Installing \"${workflow.title}\".`);\n logger.dim('Use the workflow ID for exact match: outclaw install <uuid>');\n }\n\n // Download the content\n const content = await client.downloadWorkflow(workflow.id);\n\n // Extract name from content frontmatter or use title\n const nameMatch = content.match(/^name:\\s*(.+)$/m);\n const name = nameMatch ? nameMatch[1].trim() : workflow.title;\n\n return { name, content, workflowId: workflow.id };\n}\n\nexport async function installCommand(specifier: string, options: InstallOptions): Promise<void> {\n const spin = spinner('Resolving skill...').start();\n\n try {\n // Parse specifier\n const source = parseSkillSpecifier(specifier);\n\n if (source.type === 'local') {\n spin.fail('Local installation not yet implemented');\n process.exit(1);\n }\n\n if (source.type === 'url') {\n spin.fail('URL installation not yet implemented');\n process.exit(1);\n }\n\n let name: string;\n let content: string;\n let skillSource: SkillSource;\n\n if (source.type === 'registry') {\n // Registry installation requires login\n if (!(await isLoggedIn())) {\n spin.fail('Authentication required');\n logger.error('You must be logged in to install from the registry.');\n logger.dim('Run \"outclaw login\" to authenticate.');\n process.exit(1);\n }\n\n spin.text = `Searching registry for \"${source.registryId}\"...`;\n\n const client = await ApiClient.create();\n const result = await fetchFromRegistry(client, source.registryId!);\n\n name = result.name;\n content = result.content;\n skillSource = {\n type: 'registry',\n id: result.workflowId,\n };\n\n spin.text = `Found skill: ${name}`;\n } else {\n // GitHub installation\n spin.text = `Fetching from GitHub: ${source.owner}/${source.repo}...`;\n const result = await fetchFromGitHub(source);\n\n name = result.name;\n content = result.content;\n skillSource = {\n type: 'github',\n url: `https://github.com/${source.owner}/${source.repo}`,\n ref: source.ref,\n };\n\n spin.text = `Found skill: ${name}`;\n }\n\n // Check for existing skill\n const scope: Scope = options.global ? 'global' : 'project';\n const manager = new SkillManager(scope);\n\n if (await manager.skillExists(name)) {\n if (!options.force) {\n spin.stop();\n\n if (!options.yes) {\n const proceed = await confirm({\n message: `Skill \"${name}\" already exists. Overwrite?`,\n default: false,\n });\n\n if (!proceed) {\n logger.info('Installation cancelled');\n return;\n }\n }\n\n spin.start('Installing...');\n }\n }\n\n // Install\n spin.text = `Installing ${name}...`;\n\n const skillPath = await manager.installSkill(name, content, {\n force: options.force || false,\n source: skillSource,\n });\n\n spin.succeed(`Installed ${name}`);\n logger.info('');\n logger.box(`Skill Installed: ${name}`, [\n `Path: ${skillPath}`,\n `Scope: ${scope}`,\n '',\n `Use /${name} in OpenClaw to invoke this skill`,\n ].join('\\n'));\n } catch (error) {\n spin.fail('Installation failed');\n\n if (error instanceof ApiError) {\n if (error.statusCode === 401) {\n logger.error('Authentication failed. Please run \"outclaw login\".');\n } else if (error.statusCode === 404) {\n logger.error('Skill not found in the registry.');\n } else {\n logger.error(error.message);\n }\n } else if (error instanceof Error) {\n logger.error(error.message);\n }\n\n process.exit(1);\n }\n}\n","import * as fs from 'fs/promises';\nimport * as path from 'path';\nimport { getConfigPath, ensureDir, pathExists } from '../utils/paths.js';\n\nexport interface OutclawConfig {\n api_key?: string;\n agent_id?: string;\n agent_name?: string;\n verified?: boolean;\n api_base?: string;\n}\n\nconst CONFIG_FILE = 'config.json';\nconst DEFAULT_API_BASE = 'https://outclaws.ai/api';\n\n/**\n * Get config file path\n */\nfunction getConfigFilePath(): string {\n return path.join(getConfigPath(), CONFIG_FILE);\n}\n\n/**\n * Load config from disk\n */\nexport async function loadConfig(): Promise<OutclawConfig> {\n const configPath = getConfigFilePath();\n\n if (!(await pathExists(configPath))) {\n return {};\n }\n\n try {\n const content = await fs.readFile(configPath, 'utf-8');\n return JSON.parse(content) as OutclawConfig;\n } catch {\n return {};\n }\n}\n\n/**\n * Save config to disk\n */\nexport async function saveConfig(config: OutclawConfig): Promise<void> {\n const configDir = getConfigPath();\n await ensureDir(configDir);\n\n const configPath = getConfigFilePath();\n await fs.writeFile(configPath, JSON.stringify(config, null, 2), 'utf-8');\n}\n\n/**\n * Clear config (logout)\n */\nexport async function clearConfig(): Promise<void> {\n const configPath = getConfigFilePath();\n\n if (await pathExists(configPath)) {\n await fs.unlink(configPath);\n }\n}\n\n/**\n * Get API key from config or environment\n */\nexport async function getApiKey(): Promise<string | undefined> {\n // Environment variable takes precedence\n if (process.env.OUTCLAW_API_KEY) {\n return process.env.OUTCLAW_API_KEY;\n }\n\n const config = await loadConfig();\n return config.api_key;\n}\n\n/**\n * Get API base URL\n */\nexport async function getApiBase(): Promise<string> {\n if (process.env.OUTCLAW_API_BASE) {\n return process.env.OUTCLAW_API_BASE;\n }\n\n const config = await loadConfig();\n return config.api_base || DEFAULT_API_BASE;\n}\n\n/**\n * Check if user is logged in\n */\nexport async function isLoggedIn(): Promise<boolean> {\n const apiKey = await getApiKey();\n return !!apiKey;\n}\n","import { getApiKey, getApiBase } from './config.js';\n\nexport interface WorkflowSearchResult {\n id: string;\n title: string;\n slug: string;\n description: string;\n downloads: number;\n created_at: string;\n creator?: {\n id: string;\n twitter_handle?: string;\n name?: string;\n };\n community?: {\n id: string;\n slug: string;\n name: string;\n };\n}\n\nexport interface WorkflowListResponse {\n workflows: WorkflowSearchResult[];\n total: number;\n page: number;\n pages: number;\n}\n\nexport interface WorkflowDetail extends WorkflowSearchResult {\n content: string;\n target_audience?: string;\n example_input?: string;\n example_output?: string;\n status: string;\n avg_rating?: number;\n}\n\nexport interface AgentInfo {\n id: string;\n name: string;\n verified: boolean;\n user_id?: string;\n created_at: string;\n description?: string;\n api_key?: string; // Only shown as prefix in /me\n}\n\nexport interface RegisterAgentRequest {\n name: string;\n description?: string;\n}\n\nexport interface RegisterAgentResponse {\n agent_id: string;\n api_key: string; // Full key - only returned once!\n claim_url: string;\n verification_code: string;\n status: 'pending_claim';\n}\n\nexport interface PublishWorkflowRequest {\n title: string;\n description: string;\n content: string;\n target_audience?: string;\n community_id?: string;\n example_input?: string;\n example_output?: string;\n}\n\nexport interface PublishWorkflowResponse {\n id: string;\n status: 'published' | 'rejected';\n message: string;\n security_scan?: {\n passed: boolean;\n risk_factors: string[];\n explanation: string;\n };\n}\n\nexport class ApiError extends Error {\n constructor(\n message: string,\n public statusCode: number,\n public code?: string\n ) {\n super(message);\n this.name = 'ApiError';\n }\n}\n\n/**\n * Outclaws API Client\n */\nexport class ApiClient {\n private apiBase: string;\n private apiKey?: string;\n\n constructor(apiBase: string, apiKey?: string) {\n this.apiBase = apiBase;\n this.apiKey = apiKey;\n }\n\n /**\n * Create client with config\n */\n static async create(): Promise<ApiClient> {\n const apiBase = await getApiBase();\n const apiKey = await getApiKey();\n return new ApiClient(apiBase, apiKey);\n }\n\n /**\n * Make API request\n */\n private async request<T>(\n endpoint: string,\n options: RequestInit = {}\n ): Promise<T> {\n const url = `${this.apiBase}${endpoint}`;\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n ...(options.headers as Record<string, string>),\n };\n\n if (this.apiKey) {\n headers['Authorization'] = `Bearer ${this.apiKey}`;\n }\n\n const response = await fetch(url, {\n ...options,\n headers,\n });\n\n if (!response.ok) {\n let message = `API request failed: ${response.statusText}`;\n let code: string | undefined;\n\n try {\n const errorData = (await response.json()) as { error?: string; message?: string; code?: string };\n message = errorData.error || errorData.message || message;\n code = errorData.code;\n } catch {\n // Ignore JSON parse errors\n }\n\n throw new ApiError(message, response.status, code);\n }\n\n // Handle non-JSON responses (like download)\n const contentType = response.headers.get('content-type');\n if (contentType?.includes('text/markdown')) {\n return (await response.text()) as T;\n }\n\n return (await response.json()) as T;\n }\n\n /**\n * Search workflows\n */\n async searchWorkflows(\n query: string,\n options: {\n limit?: number;\n offset?: number;\n sort?: 'hot' | 'new' | 'top';\n community?: string;\n } = {}\n ): Promise<WorkflowListResponse> {\n const params = new URLSearchParams();\n params.set('search', query);\n\n if (options.limit) params.set('limit', options.limit.toString());\n if (options.offset) params.set('offset', options.offset.toString());\n if (options.sort) params.set('sort', options.sort);\n if (options.community) params.set('community', options.community);\n\n return this.request<WorkflowListResponse>(`/workflows?${params.toString()}`);\n }\n\n /**\n * Get workflow detail\n */\n async getWorkflow(id: string): Promise<WorkflowDetail> {\n return this.request<WorkflowDetail>(`/workflows/${id}`);\n }\n\n /**\n * Download workflow content (requires auth)\n */\n async downloadWorkflow(id: string): Promise<string> {\n if (!this.apiKey) {\n throw new ApiError('Authentication required. Please run: outclaw login', 401, 'unauthorized');\n }\n return this.request<string>(`/workflows/${id}/download`);\n }\n\n /**\n * Get current agent info (requires auth)\n */\n async getMe(): Promise<AgentInfo> {\n if (!this.apiKey) {\n throw new ApiError('Authentication required. Please run: outclaw login', 401, 'unauthorized');\n }\n return this.request<AgentInfo>('/agents/me');\n }\n\n /**\n * Verify API key is valid\n */\n async verifyApiKey(): Promise<AgentInfo | null> {\n try {\n return await this.getMe();\n } catch (error) {\n if (error instanceof ApiError && error.statusCode === 401) {\n return null;\n }\n throw error;\n }\n }\n\n /**\n * Register a new agent (no auth required)\n */\n async registerAgent(data: RegisterAgentRequest): Promise<RegisterAgentResponse> {\n return this.request<RegisterAgentResponse>('/agents/register', {\n method: 'POST',\n body: JSON.stringify(data),\n });\n }\n\n /**\n * Verify API key with a specific key (for login)\n */\n async verifyApiKeyWith(apiKey: string): Promise<AgentInfo | null> {\n const tempClient = new ApiClient(this.apiBase, apiKey);\n return tempClient.verifyApiKey();\n }\n\n /**\n * Publish a workflow (requires auth + verified)\n */\n async publishWorkflow(data: PublishWorkflowRequest): Promise<PublishWorkflowResponse> {\n if (!this.apiKey) {\n throw new ApiError('Authentication required. Please run: outclaw login', 401, 'unauthorized');\n }\n return this.request<PublishWorkflowResponse>('/workflows', {\n method: 'POST',\n body: JSON.stringify(data),\n });\n }\n}\n","import ora, { type Ora } from 'ora';\n\nexport function spinner(text: string): Ora {\n return ora({\n text,\n spinner: 'dots',\n });\n}\n\nexport { type Ora };\n","import { confirm } from '@inquirer/prompts';\nimport { SkillManager } from '../core/skill-manager.js';\nimport { logger } from '../ui/logger.js';\nimport { spinner } from '../ui/spinner.js';\nimport type { Scope } from '../utils/paths.js';\n\nexport interface UninstallOptions {\n global?: boolean;\n yes?: boolean;\n}\n\nexport async function uninstallCommand(name: string, options: UninstallOptions): Promise<void> {\n try {\n const scope: Scope = options.global ? 'global' : 'project';\n const manager = new SkillManager(scope);\n\n // Check if skill exists\n const skill = await manager.getSkill(name);\n\n if (!skill) {\n logger.error(`Skill \"${name}\" not found in ${scope} skills`);\n process.exit(1);\n }\n\n // Confirm uninstall\n if (!options.yes) {\n const proceed = await confirm({\n message: `Are you sure you want to uninstall \"${name}\"?`,\n default: false,\n });\n\n if (!proceed) {\n logger.info('Uninstall cancelled');\n return;\n }\n }\n\n const spin = spinner(`Uninstalling ${name}...`).start();\n\n await manager.uninstallSkill(name);\n\n spin.succeed(`Uninstalled ${name}`);\n } catch (error) {\n if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n process.exit(1);\n }\n}\n","import { logger } from '../ui/logger.js';\nimport { spinner } from '../ui/spinner.js';\nimport { renderTable } from '../ui/table.js';\nimport { ApiClient, ApiError } from '../core/api-client.js';\n\nexport interface SearchOptions {\n limit: number;\n json?: boolean;\n sort?: 'hot' | 'new' | 'top';\n community?: string;\n}\n\nexport async function searchCommand(query: string, options: SearchOptions): Promise<void> {\n const spin = spinner(`Searching for \"${query}\"...`).start();\n\n try {\n const client = await ApiClient.create();\n\n const result = await client.searchWorkflows(query, {\n limit: options.limit,\n sort: options.sort,\n community: options.community,\n });\n\n spin.stop();\n\n if (result.workflows.length === 0) {\n logger.info(`No skills found matching \"${query}\"`);\n logger.info('');\n logger.dim('Try a different search term or browse all skills at https://outclaws.ai');\n return;\n }\n\n if (options.json) {\n console.log(JSON.stringify(result.workflows, null, 2));\n return;\n }\n\n logger.info(`Found ${result.total} skill(s)${result.total > result.workflows.length ? ` (showing ${result.workflows.length})` : ''}:\\n`);\n\n renderTable({\n headers: ['Name', 'Author', 'Downloads', 'Description'],\n rows: result.workflows.map((w) => {\n const author = w.creator?.twitter_handle\n ? `@${w.creator.twitter_handle}`\n : w.creator?.name || 'unknown';\n const desc = w.description.length > 40 ? w.description.slice(0, 37) + '...' : w.description;\n return [w.title, author, String(w.downloads || 0), desc];\n }),\n });\n\n logger.info('');\n logger.dim('Install with: outclaw install <name>');\n\n if (result.pages > 1) {\n logger.info('');\n logger.dim(`Page ${result.page} of ${result.pages}. Use --limit and search again for more results.`);\n }\n } catch (error) {\n spin.fail('Search failed');\n\n if (error instanceof ApiError) {\n logger.error(error.message);\n\n if (error.statusCode === 0 || error.message.includes('fetch')) {\n logger.dim('Could not connect to Outclaws API. Check your internet connection.');\n }\n } else if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n\n process.exit(1);\n }\n}\n","import chalk from 'chalk';\nimport { SkillManager } from '../core/skill-manager.js';\nimport { logger } from '../ui/logger.js';\nimport type { Scope } from '../utils/paths.js';\n\nexport interface InfoOptions {\n global?: boolean;\n}\n\nexport async function infoCommand(name: string, options: InfoOptions): Promise<void> {\n try {\n // Try both scopes if not specified\n const scopes: Scope[] = options.global ? ['global'] : ['project', 'global'];\n\n let skill = null;\n let foundScope: Scope | null = null;\n\n for (const scope of scopes) {\n const manager = new SkillManager(scope);\n skill = await manager.getSkill(name);\n if (skill) {\n foundScope = scope;\n break;\n }\n }\n\n if (!skill || !foundScope) {\n logger.error(`Skill \"${name}\" not found`);\n logger.dim('');\n logger.dim('Search for skills: outclaw search <query>');\n process.exit(1);\n }\n\n // Display skill info\n console.log();\n console.log(chalk.bold.cyan(` ${skill.name}`));\n console.log();\n console.log(chalk.dim(' Description:'), skill.description);\n console.log(chalk.dim(' Version:'), skill.version || 'unversioned');\n console.log(chalk.dim(' Scope:'), foundScope);\n console.log(chalk.dim(' Path:'), skill.path);\n\n if (skill['user-invocable'] !== undefined) {\n console.log(chalk.dim(' User-invocable:'), skill['user-invocable'] ? 'yes' : 'no');\n }\n\n if (skill['disable-model-invocation'] !== undefined) {\n console.log(\n chalk.dim(' Model invocation:'),\n skill['disable-model-invocation'] ? 'disabled' : 'enabled'\n );\n }\n\n if (skill['allowed-tools']?.length) {\n console.log(chalk.dim(' Allowed tools:'), skill['allowed-tools'].join(', '));\n }\n\n if (skill['argument-hint']) {\n console.log(chalk.dim(' Arguments:'), skill['argument-hint']);\n }\n\n if (skill.context) {\n console.log(chalk.dim(' Context:'), skill.context);\n }\n\n if (skill.agent) {\n console.log(chalk.dim(' Agent:'), skill.agent);\n }\n\n if (skill.model) {\n console.log(chalk.dim(' Model:'), skill.model);\n }\n\n console.log();\n console.log(chalk.dim(' ─'.repeat(30)));\n console.log();\n console.log(chalk.dim(' Content preview:'));\n console.log();\n\n // Show first 10 lines of content\n const lines = skill.content.split('\\n').slice(0, 10);\n for (const line of lines) {\n console.log(chalk.dim(' │ ') + line);\n }\n\n if (skill.content.split('\\n').length > 10) {\n console.log(chalk.dim(' │ ...'));\n }\n\n console.log();\n } catch (error) {\n if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n process.exit(1);\n }\n}\n","import { input, select } from '@inquirer/prompts';\nimport { ApiClient, ApiError } from '../core/api-client.js';\nimport { saveConfig, loadConfig, isLoggedIn, getApiBase } from '../core/config.js';\nimport { logger } from '../ui/logger.js';\nimport { spinner } from '../ui/spinner.js';\n\nexport interface LoginOptions {\n token?: string;\n}\n\nexport async function loginCommand(options: LoginOptions): Promise<void> {\n // Check if already logged in\n if (await isLoggedIn()) {\n const config = await loadConfig();\n logger.warn(`Already logged in as \"${config.agent_name || 'unknown'}\".`);\n logger.dim('Run \"outclaw logout\" first if you want to switch accounts.');\n return;\n }\n\n const apiBase = await getApiBase();\n const client = new ApiClient(apiBase);\n\n // If token provided via flag, use it directly\n if (options.token) {\n await loginWithToken(client, options.token);\n return;\n }\n\n // Interactive mode - ask user what they want to do\n const choice = await select({\n message: 'How would you like to authenticate?',\n choices: [\n {\n value: 'token',\n name: 'Enter existing API Key',\n description: 'If you already have an API key from Outclaws',\n },\n {\n value: 'register',\n name: 'Register new Agent',\n description: 'Create a new agent and get an API key',\n },\n ],\n });\n\n if (choice === 'token') {\n const token = await input({\n message: 'Enter your API Key:',\n validate: (value) => {\n if (!value.trim()) return 'API Key is required';\n if (!value.startsWith('oc_')) return 'Invalid API Key format (should start with oc_)';\n return true;\n },\n });\n await loginWithToken(client, token.trim());\n } else {\n await registerNewAgent(client);\n }\n}\n\nasync function loginWithToken(client: ApiClient, token: string): Promise<void> {\n const spin = spinner('Verifying API Key...').start();\n\n try {\n const agent = await client.verifyApiKeyWith(token);\n\n if (!agent) {\n spin.fail('Invalid API Key');\n logger.error('The provided API Key is invalid or expired.');\n process.exit(1);\n }\n\n // Save to config\n await saveConfig({\n api_key: token,\n agent_id: agent.id,\n agent_name: agent.name,\n verified: agent.verified,\n });\n\n spin.succeed(`Logged in as \"${agent.name}\"`);\n\n if (!agent.verified) {\n logger.info('');\n logger.warn('Your agent is not verified yet.');\n logger.dim('Visit https://outclaws.ai to complete verification (required for publishing).');\n }\n } catch (error) {\n spin.fail('Login failed');\n\n if (error instanceof ApiError) {\n logger.error(error.message);\n } else if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n\n process.exit(1);\n }\n}\n\nasync function registerNewAgent(client: ApiClient): Promise<void> {\n // Get agent name\n const name = await input({\n message: 'Enter a name for your agent:',\n validate: (value) => {\n if (!value.trim()) return 'Name is required';\n if (value.trim().length > 100) return 'Name must be 100 characters or less';\n return true;\n },\n });\n\n // Get optional description\n const description = await input({\n message: 'Enter a description (optional):',\n });\n\n const spin = spinner('Registering agent...').start();\n\n try {\n const result = await client.registerAgent({\n name: name.trim(),\n description: description.trim() || undefined,\n });\n\n // Save to config\n await saveConfig({\n api_key: result.api_key,\n agent_id: result.agent_id,\n agent_name: name.trim(),\n verified: false,\n });\n\n spin.succeed('Agent registered successfully!');\n\n logger.info('');\n logger.box('Important - Save Your API Key!', [\n `API Key: ${result.api_key}`,\n '',\n 'This key is only shown once. Store it securely!',\n ].join('\\n'));\n\n logger.info('');\n logger.info('To verify your agent (required for publishing):');\n logger.dim(`1. Visit: ${result.claim_url}`);\n logger.dim(`2. Post on X/Twitter with code: ${result.verification_code}`);\n logger.dim('3. Submit the tweet URL to complete verification');\n } catch (error) {\n spin.fail('Registration failed');\n\n if (error instanceof ApiError) {\n logger.error(error.message);\n } else if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n\n process.exit(1);\n }\n}\n","import { confirm } from '@inquirer/prompts';\nimport { clearConfig, isLoggedIn, loadConfig } from '../core/config.js';\nimport { logger } from '../ui/logger.js';\n\nexport interface LogoutOptions {\n yes?: boolean;\n}\n\nexport async function logoutCommand(options: LogoutOptions): Promise<void> {\n // Check if logged in\n if (!(await isLoggedIn())) {\n logger.info('You are not logged in.');\n return;\n }\n\n // Get current config for display\n const config = await loadConfig();\n const agentName = config.agent_name || 'Unknown';\n\n // Confirm logout\n if (!options.yes) {\n const proceed = await confirm({\n message: `Log out from agent \"${agentName}\"?`,\n default: true,\n });\n\n if (!proceed) {\n logger.info('Logout cancelled.');\n return;\n }\n }\n\n // Clear config\n await clearConfig();\n\n logger.success('Logged out successfully.');\n logger.dim('Your API key has been removed from local storage.');\n}\n","import { ApiClient, ApiError } from '../core/api-client.js';\nimport { isLoggedIn, loadConfig } from '../core/config.js';\nimport { logger } from '../ui/logger.js';\nimport { spinner } from '../ui/spinner.js';\n\nexport interface WhoamiOptions {\n json?: boolean;\n}\n\nexport async function whoamiCommand(options: WhoamiOptions): Promise<void> {\n // Check if logged in\n if (!(await isLoggedIn())) {\n logger.error('Not logged in.');\n logger.dim('Run \"outclaw login\" to authenticate.');\n process.exit(1);\n }\n\n const spin = spinner('Fetching account info...').start();\n\n try {\n const client = await ApiClient.create();\n const agent = await client.getMe();\n const config = await loadConfig();\n\n spin.stop();\n\n if (options.json) {\n console.log(JSON.stringify({\n id: agent.id,\n name: agent.name,\n verified: agent.verified,\n created_at: agent.created_at,\n }, null, 2));\n return;\n }\n\n logger.info('');\n logger.box(`Agent: ${agent.name}`, [\n `ID: ${agent.id}`,\n `Verified: ${agent.verified ? '✓ Yes' : '✗ No'}`,\n `API Key: ${config.api_key?.substring(0, 10)}...`,\n ].join('\\n'));\n logger.info('');\n\n if (!agent.verified) {\n logger.warn('Your agent is not verified.');\n logger.dim('Visit https://outclaws.ai to complete verification (required for publishing).');\n }\n } catch (error) {\n spin.fail('Failed to fetch account info');\n\n if (error instanceof ApiError) {\n if (error.statusCode === 401) {\n logger.error('Your API key is invalid or expired.');\n logger.dim('Run \"outclaw logout\" then \"outclaw login\" to re-authenticate.');\n } else {\n logger.error(error.message);\n }\n } else if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n\n process.exit(1);\n }\n}\n","import * as fs from 'fs/promises';\nimport * as path from 'path';\nimport { input, confirm } from '@inquirer/prompts';\nimport { ApiClient, ApiError, type PublishWorkflowRequest } from '../core/api-client.js';\nimport { isLoggedIn, loadConfig } from '../core/config.js';\nimport { logger } from '../ui/logger.js';\nimport { spinner } from '../ui/spinner.js';\nimport { pathExists } from '../utils/paths.js';\nimport { parseSkillFrontmatter } from '../parsers/skill-parser.js';\n\nexport interface PublishOptions {\n title?: string;\n description?: string;\n community?: string;\n yes?: boolean;\n}\n\nexport async function publishCommand(skillPath: string, options: PublishOptions): Promise<void> {\n // Check if logged in\n if (!(await isLoggedIn())) {\n logger.error('You must be logged in to publish.');\n logger.dim('Run \"outclaw login\" to authenticate.');\n process.exit(1);\n }\n\n // Check if verified\n const config = await loadConfig();\n if (!config.verified) {\n logger.error('Your agent must be verified to publish.');\n logger.dim('Visit https://outclaws.ai to complete verification.');\n process.exit(1);\n }\n\n // Resolve skill path\n const resolvedPath = path.resolve(skillPath);\n let skillMdPath: string;\n\n // Check if it's a directory or file\n try {\n const stat = await fs.stat(resolvedPath);\n if (stat.isDirectory()) {\n skillMdPath = path.join(resolvedPath, 'SKILL.md');\n } else {\n skillMdPath = resolvedPath;\n }\n } catch {\n logger.error(`Path not found: ${skillPath}`);\n process.exit(1);\n }\n\n // Check if SKILL.md exists\n if (!(await pathExists(skillMdPath))) {\n logger.error(`SKILL.md not found at ${skillMdPath}`);\n logger.dim('Make sure you are in a skill directory or specify the path to SKILL.md');\n process.exit(1);\n }\n\n // Read SKILL.md content\n const content = await fs.readFile(skillMdPath, 'utf-8');\n\n // Parse frontmatter for metadata\n const parsed = parseSkillFrontmatter(content);\n\n // Get title and description from options or frontmatter\n let title: string | undefined = options.title || (parsed.frontmatter?.name as string | undefined);\n let description: string | undefined = options.description || (parsed.frontmatter?.description as string | undefined);\n\n // Prompt for missing required fields\n if (!title) {\n title = await input({\n message: 'Enter a title for your skill:',\n validate: (value) => {\n if (!value.trim()) return 'Title is required';\n if (value.trim().length > 200) return 'Title must be 200 characters or less';\n return true;\n },\n });\n }\n\n if (!description) {\n description = await input({\n message: 'Enter a description for your skill:',\n validate: (value) => {\n if (!value.trim()) return 'Description is required';\n if (value.trim().length > 1000) return 'Description must be 1000 characters or less';\n return true;\n },\n });\n }\n\n // Confirm publish\n if (!options.yes) {\n logger.info('');\n logger.info(` Title: ${title}`);\n logger.info(` Description: ${description.substring(0, 50)}${description.length > 50 ? '...' : ''}`);\n logger.info(` File: ${skillMdPath}`);\n logger.info('');\n\n const proceed = await confirm({\n message: 'Publish this skill to Outclaws?',\n default: true,\n });\n\n if (!proceed) {\n logger.info('Publish cancelled.');\n return;\n }\n }\n\n const spin = spinner('Publishing skill...').start();\n\n try {\n const client = await ApiClient.create();\n\n const request: PublishWorkflowRequest = {\n title: title.trim(),\n description: description.trim(),\n content: content,\n target_audience: parsed.frontmatter?.['target-audience'] as string | undefined,\n };\n\n if (options.community) {\n request.community_id = options.community;\n }\n\n const response = await client.publishWorkflow(request);\n\n if (response.status === 'published') {\n spin.succeed('Skill published successfully!');\n logger.info('');\n logger.info(` ID: ${response.id}`);\n logger.info(` URL: https://outclaws.ai/workflow/${response.id}`);\n logger.info('');\n logger.dim('Your skill is now available in the registry.');\n } else {\n spin.fail('Skill rejected by security scan');\n logger.info('');\n logger.error(response.message);\n\n if (response.security_scan) {\n logger.info('');\n logger.warn('Risk factors:');\n for (const factor of response.security_scan.risk_factors) {\n logger.dim(` - ${factor}`);\n }\n logger.info('');\n logger.dim(response.security_scan.explanation);\n }\n\n process.exit(1);\n }\n } catch (error) {\n spin.fail('Publish failed');\n\n if (error instanceof ApiError) {\n if (error.statusCode === 401) {\n logger.error('Authentication failed. Please run \"outclaw login\".');\n } else if (error.code === 'verification_required') {\n logger.error('Your agent must be verified to publish.');\n logger.dim('Visit https://outclaws.ai to complete verification.');\n } else {\n logger.error(error.message);\n }\n } else if (error instanceof Error) {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AAQ,IAAI,8CAA8C;AAC1D,UAAQ,KAAK,CAAC;AAChB,CAAC;;;AoBnID,IAAI,MAAM;","names":["fs","path","path","fs","stat","chalk","confirm","fs","path","content","workflow","nameMatch","name","confirm","confirm","confirm","chalk","chalk","input","select","select","input","confirm","confirm","fs","path","input","confirm","stat","input","confirm","path"]}
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts","../src/commands/init.ts","../src/core/skill-manager.ts","../src/parsers/skill-parser.ts","../src/schemas/skill.schema.ts","../src/utils/paths.ts","../src/ui/logger.ts","../src/ui/table.ts","../src/commands/list.ts","../src/commands/install.ts","../src/core/config.ts","../src/core/api-client.ts","../src/ui/spinner.ts","../src/commands/uninstall.ts","../src/commands/search.ts","../src/commands/info.ts","../src/commands/login.ts","../src/commands/logout.ts","../src/commands/whoami.ts","../src/commands/publish.ts","../src/index.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { initCommand } from './commands/init.js';\nimport { listCommand } from './commands/list.js';\nimport { installCommand } from './commands/install.js';\nimport { uninstallCommand } from './commands/uninstall.js';\nimport { searchCommand } from './commands/search.js';\nimport { infoCommand } from './commands/info.js';\nimport { loginCommand } from './commands/login.js';\nimport { logoutCommand } from './commands/logout.js';\nimport { whoamiCommand } from './commands/whoami.js';\nimport { publishCommand } from './commands/publish.js';\n\nconst VERSION = '0.1.0';\n\nexport const cli = new Command();\n\ncli\n .name('outclaw')\n .description('CLI tool for managing Claude Code Skills')\n .version(VERSION);\n\n// login command\ncli\n .command('login')\n .description('Authenticate with Outclaws')\n .option('-t, --token <key>', 'API key for authentication')\n .action(async (options) => {\n await loginCommand(options);\n });\n\n// logout command\ncli\n .command('logout')\n .description('Log out and remove stored credentials')\n .option('-y, --yes', 'Skip confirmation prompt')\n .action(async (options) => {\n await logoutCommand(options);\n });\n\n// whoami command\ncli\n .command('whoami')\n .description('Show current authenticated agent')\n .option('--json', 'Output as JSON')\n .action(async (options) => {\n await whoamiCommand(options);\n });\n\n// init command\ncli\n .command('init [name]')\n .description('Create a new skill project')\n .option('-g, --global', 'Create in global skills directory (~/.claude/skills)')\n .option('-t, --template <type>', 'Skill template (minimal, standard, complete)', 'minimal')\n .option('-y, --yes', 'Skip prompts and use defaults')\n .action(async (name, options) => {\n await initCommand({ name, ...options });\n });\n\n// install command\ncli\n .command('install <skill>')\n .alias('i')\n .alias('add')\n .description('Install a skill from registry, GitHub, or URL')\n .option('-g, --global', 'Install globally (~/.claude/skills)')\n .option('-f, --force', 'Overwrite existing skill')\n .option('-y, --yes', 'Skip confirmation prompts')\n .action(async (skill, options) => {\n await installCommand(skill, options);\n });\n\n// uninstall command\ncli\n .command('uninstall <skill>')\n .alias('rm')\n .alias('remove')\n .description('Uninstall a skill')\n .option('-g, --global', 'Uninstall from global directory')\n .option('-y, --yes', 'Skip confirmation prompts')\n .action(async (skill, options) => {\n await uninstallCommand(skill, options);\n });\n\n// list command\ncli\n .command('list')\n .alias('ls')\n .description('List installed skills')\n .option('-g, --global', 'List only global skills')\n .option('-p, --project', 'List only project skills')\n .option('--json', 'Output as JSON')\n .action(async (options) => {\n await listCommand(options);\n });\n\n// search command\ncli\n .command('search <query>')\n .alias('find')\n .description('Search for skills in the registry')\n .option('-l, --limit <number>', 'Maximum results', '20')\n .option('--json', 'Output as JSON')\n .action(async (query, options) => {\n await searchCommand(query, { ...options, limit: parseInt(options.limit) });\n });\n\n// info command\ncli\n .command('info <skill>')\n .description('Show detailed information about a skill')\n .option('-g, --global', 'Look in global skills')\n .action(async (skill, options) => {\n await infoCommand(skill, options);\n });\n\n// publish command\ncli\n .command('publish <path>')\n .description('Publish a skill to Outclaws registry')\n .option('-t, --title <title>', 'Skill title')\n .option('-d, --description <desc>', 'Skill description')\n .option('-c, --community <id>', 'Community ID')\n .option('-y, --yes', 'Skip confirmation prompt')\n .action(async (path, options) => {\n await publishCommand(path, options);\n });\n\n// Handle unknown commands\ncli.on('command:*', () => {\n console.error(`Unknown command: ${cli.args.join(' ')}`);\n console.log('Run \"outclaw --help\" for available commands.');\n process.exit(1);\n});\n","import { input, select, checkbox, confirm } from '@inquirer/prompts';\nimport { SkillManager } from '../core/skill-manager.js';\nimport { logger } from '../ui/logger.js';\nimport type { Scope } from '../utils/paths.js';\n\nconst AVAILABLE_TOOLS = [\n { name: 'Read - Read files', value: 'Read' },\n { name: 'Write - Write files', value: 'Write' },\n { name: 'Edit - Edit files', value: 'Edit' },\n { name: 'Grep - Search file contents', value: 'Grep' },\n { name: 'Glob - Find files by pattern', value: 'Glob' },\n { name: 'Bash - Execute shell commands', value: 'Bash' },\n { name: 'WebFetch - Fetch web content', value: 'WebFetch' },\n { name: 'WebSearch - Search the web', value: 'WebSearch' },\n];\n\nexport interface InitOptions {\n name?: string;\n global?: boolean;\n template?: 'minimal' | 'standard' | 'complete';\n yes?: boolean;\n}\n\nexport async function initCommand(options: InitOptions): Promise<void> {\n try {\n // Determine scope\n const scope: Scope = options.global ? 'global' : 'project';\n\n // Get skill name\n let name = options.name;\n if (!name) {\n name = await input({\n message: 'Skill name:',\n validate: (value) => {\n if (!value) return 'Name is required';\n if (!/^[a-z0-9-]+$/.test(value)) {\n return 'Name must be lowercase alphanumeric with hyphens (e.g., my-skill)';\n }\n return true;\n },\n });\n }\n\n // Check if skill already exists\n const manager = new SkillManager(scope);\n if (await manager.skillExists(name)) {\n logger.error(`Skill \"${name}\" already exists`);\n process.exit(1);\n }\n\n let description: string;\n let userInvocable = true;\n let disableModelInvocation = false;\n let allowedTools: string[] = [];\n let argumentHint: string | undefined;\n let context: 'normal' | 'fork' | undefined;\n\n if (options.yes) {\n // Use defaults\n description = `${name} skill for Claude Code`;\n } else {\n // Interactive prompts\n description = await input({\n message: 'Description (for trigger matching):',\n validate: (value) => {\n if (!value || value.length < 10) {\n return 'Description should be at least 10 characters for good trigger matching';\n }\n return true;\n },\n });\n\n userInvocable = await confirm({\n message: 'User-invocable (can be called via /skill-name)?',\n default: true,\n });\n\n disableModelInvocation = await confirm({\n message: 'Disable automatic model invocation (only manual trigger)?',\n default: false,\n });\n\n allowedTools = await checkbox({\n message: 'Select allowed tools (tools that can be used without permission):',\n choices: AVAILABLE_TOOLS,\n });\n\n const wantsArgs = await confirm({\n message: 'Does this skill accept arguments?',\n default: false,\n });\n\n if (wantsArgs) {\n argumentHint = await input({\n message: 'Argument hint (e.g., [file-path] [options]):',\n });\n }\n\n const runInSubagent = await confirm({\n message: 'Run in isolated subagent context?',\n default: false,\n });\n\n if (runInSubagent) {\n context = 'fork';\n }\n }\n\n // Create the skill\n const skillPath = await manager.createSkill({\n name,\n description,\n scope,\n userInvocable,\n disableModelInvocation,\n allowedTools,\n argumentHint,\n context,\n });\n\n logger.success(`Skill created at: ${skillPath}`);\n logger.info('');\n logger.info('Next steps:');\n logger.dim(` 1. Edit ${skillPath}/SKILL.md to add your skill instructions`);\n logger.dim(` 2. Use /${name} in Claude Code to invoke your skill`);\n logger.info('');\n } catch (error) {\n if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n process.exit(1);\n }\n}\n","import * as fs from 'fs/promises';\nimport * as path from 'path';\nimport { SkillParser, generateSkillMd } from '../parsers/skill-parser.js';\nimport {\n getSkillsPathAsync,\n getSkillPathAsync,\n getLockFilePathAsync,\n ensureDir,\n pathExists,\n type Scope,\n} from '../utils/paths.js';\nimport type { Skill, SkillFrontmatter } from '../schemas/skill.schema.js';\nimport type { OutclawManifest, SkillManifest, SkillSource } from '../schemas/manifest.schema.js';\n\nexport interface SkillInfo extends Skill {\n scope: Scope;\n}\n\nexport interface CreateSkillOptions {\n name: string;\n description: string;\n version?: string;\n disableModelInvocation?: boolean;\n userInvocable?: boolean;\n allowedTools?: string[];\n argumentHint?: string;\n model?: string;\n context?: 'normal' | 'fork';\n agent?: string;\n scope: Scope;\n content?: string;\n}\n\nexport interface InstallOptions {\n force?: boolean;\n source: SkillSource;\n}\n\nexport class SkillManager {\n private scope: Scope;\n private basePath: string | null = null;\n\n constructor(scope: Scope = 'project') {\n this.scope = scope;\n }\n\n private async getBasePath(): Promise<string> {\n if (!this.basePath) {\n this.basePath = await getSkillsPathAsync(this.scope);\n }\n return this.basePath;\n }\n\n /**\n * List all installed skills\n */\n async listSkills(): Promise<SkillInfo[]> {\n const skills: SkillInfo[] = [];\n const basePath = await this.getBasePath();\n\n try {\n const dirs = await fs.readdir(basePath);\n\n for (const dir of dirs) {\n // Skip hidden files and manifest\n if (dir.startsWith('.')) continue;\n\n const skillPath = path.join(basePath, dir);\n const stat = await fs.stat(skillPath);\n\n if (stat.isDirectory()) {\n try {\n const parser = new SkillParser(skillPath);\n const skill = await parser.parse();\n skills.push({ ...skill, scope: this.scope });\n } catch {\n // Skip invalid skills\n }\n }\n }\n } catch {\n // Directory doesn't exist\n }\n\n return skills;\n }\n\n /**\n * Get a specific skill by name\n */\n async getSkill(name: string): Promise<SkillInfo | null> {\n const skillPath = await getSkillPathAsync(name, this.scope);\n\n try {\n const parser = new SkillParser(skillPath);\n const skill = await parser.parse();\n return { ...skill, scope: this.scope };\n } catch {\n return null;\n }\n }\n\n /**\n * Check if a skill exists\n */\n async skillExists(name: string): Promise<boolean> {\n const skillPath = await getSkillPathAsync(name, this.scope);\n return await pathExists(path.join(skillPath, 'SKILL.md'));\n }\n\n /**\n * Create a new skill\n */\n async createSkill(options: CreateSkillOptions): Promise<string> {\n const skillPath = await getSkillPathAsync(options.name, options.scope);\n\n // Check if skill already exists\n if (await pathExists(skillPath)) {\n throw new Error(`Skill \"${options.name}\" already exists at ${skillPath}`);\n }\n\n // Create skill directory\n await ensureDir(skillPath);\n\n // Build frontmatter\n const frontmatter: Partial<SkillFrontmatter> = {\n name: options.name,\n description: options.description,\n version: options.version || '1.0.0',\n };\n\n if (options.disableModelInvocation !== undefined) {\n frontmatter['disable-model-invocation'] = options.disableModelInvocation;\n }\n if (options.userInvocable !== undefined) {\n frontmatter['user-invocable'] = options.userInvocable;\n }\n if (options.allowedTools?.length) {\n frontmatter['allowed-tools'] = options.allowedTools;\n }\n if (options.argumentHint) {\n frontmatter['argument-hint'] = options.argumentHint;\n }\n if (options.model) {\n frontmatter.model = options.model;\n }\n if (options.context) {\n frontmatter.context = options.context;\n }\n if (options.agent) {\n frontmatter.agent = options.agent;\n }\n\n // Generate SKILL.md content\n const content = options.content || `# ${options.name}\\n\\nYour skill instructions here...\\n`;\n const skillMdContent = generateSkillMd(frontmatter, content);\n\n // Write SKILL.md\n await fs.writeFile(path.join(skillPath, 'SKILL.md'), skillMdContent, 'utf-8');\n\n return skillPath;\n }\n\n /**\n * Install a skill from content\n */\n async installSkill(\n name: string,\n skillMdContent: string,\n options: InstallOptions\n ): Promise<string> {\n const skillPath = await getSkillPathAsync(name, this.scope);\n\n // Check if skill already exists\n if (!options.force && (await pathExists(skillPath))) {\n throw new Error(`Skill \"${name}\" already exists. Use --force to overwrite.`);\n }\n\n // Create skill directory\n await ensureDir(skillPath);\n\n // Write SKILL.md\n await fs.writeFile(path.join(skillPath, 'SKILL.md'), skillMdContent, 'utf-8');\n\n // Update manifest\n await this.updateManifest(name, options.source);\n\n return skillPath;\n }\n\n /**\n * Uninstall a skill\n */\n async uninstallSkill(name: string): Promise<void> {\n const skillPath = await getSkillPathAsync(name, this.scope);\n\n if (!(await pathExists(skillPath))) {\n throw new Error(`Skill \"${name}\" not found`);\n }\n\n await fs.rm(skillPath, { recursive: true, force: true });\n await this.removeFromManifest(name);\n }\n\n /**\n * Get manifest\n */\n async getManifest(): Promise<OutclawManifest> {\n const manifestPath = await getLockFilePathAsync(this.scope);\n\n try {\n const content = await fs.readFile(manifestPath, 'utf-8');\n return JSON.parse(content);\n } catch {\n return { version: 1, skills: [] };\n }\n }\n\n /**\n * Update manifest with new skill\n */\n private async updateManifest(name: string, source: SkillSource): Promise<void> {\n const manifestPath = await getLockFilePathAsync(this.scope);\n const manifest = await this.getManifest();\n\n const entry: SkillManifest = {\n name,\n version: '1.0.0',\n installedAt: new Date().toISOString(),\n source,\n scope: this.scope,\n };\n\n // Update or add skill entry\n const index = manifest.skills.findIndex((s) => s.name === name);\n if (index >= 0) {\n manifest.skills[index] = entry;\n } else {\n manifest.skills.push(entry);\n }\n\n await ensureDir(path.dirname(manifestPath));\n await fs.writeFile(manifestPath, JSON.stringify(manifest, null, 2));\n }\n\n /**\n * Remove skill from manifest\n */\n private async removeFromManifest(name: string): Promise<void> {\n const manifestPath = await getLockFilePathAsync(this.scope);\n\n try {\n const content = await fs.readFile(manifestPath, 'utf-8');\n const manifest: OutclawManifest = JSON.parse(content);\n manifest.skills = manifest.skills.filter((s) => s.name !== name);\n await fs.writeFile(manifestPath, JSON.stringify(manifest, null, 2));\n } catch {\n // Manifest doesn't exist, nothing to update\n }\n }\n}\n","import * as fs from 'fs/promises';\nimport * as path from 'path';\nimport matter from 'gray-matter';\nimport { SkillFrontmatterSchema, type Skill, type SkillFrontmatter } from '../schemas/skill.schema.js';\n\nexport interface SkillStructure {\n hasSkillMd: boolean;\n hasReferences: boolean;\n hasScripts: boolean;\n hasExamples: boolean;\n files: string[];\n}\n\nexport class SkillParser {\n private basePath: string;\n\n constructor(basePath: string) {\n this.basePath = basePath;\n }\n\n /**\n * Parse SKILL.md and return the full skill object\n */\n async parse(): Promise<Skill> {\n const skillMdPath = path.join(this.basePath, 'SKILL.md');\n const content = await fs.readFile(skillMdPath, 'utf-8');\n\n const { data, content: body } = matter(content);\n\n // Validate frontmatter with Zod\n const frontmatter = SkillFrontmatterSchema.parse(data);\n\n return {\n ...frontmatter,\n content: body.trim(),\n path: this.basePath,\n };\n }\n\n /**\n * Parse only the frontmatter without validating\n */\n async parseFrontmatter(): Promise<SkillFrontmatter> {\n const skillMdPath = path.join(this.basePath, 'SKILL.md');\n const content = await fs.readFile(skillMdPath, 'utf-8');\n\n const { data } = matter(content);\n return SkillFrontmatterSchema.parse(data);\n }\n\n /**\n * Get the structure of the skill directory\n */\n async getStructure(): Promise<SkillStructure> {\n const structure: SkillStructure = {\n hasSkillMd: false,\n hasReferences: false,\n hasScripts: false,\n hasExamples: false,\n files: [],\n };\n\n try {\n const entries = await fs.readdir(this.basePath, { withFileTypes: true });\n\n for (const entry of entries) {\n if (entry.isFile() && entry.name === 'SKILL.md') {\n structure.hasSkillMd = true;\n } else if (entry.isDirectory()) {\n switch (entry.name) {\n case 'references':\n structure.hasReferences = true;\n break;\n case 'scripts':\n structure.hasScripts = true;\n break;\n case 'examples':\n structure.hasExamples = true;\n break;\n }\n }\n structure.files.push(entry.name);\n }\n } catch {\n // Directory doesn't exist\n }\n\n return structure;\n }\n\n /**\n * Check if a valid skill exists at this path\n */\n async isValid(): Promise<boolean> {\n try {\n await this.parse();\n return true;\n } catch {\n return false;\n }\n }\n}\n\n/**\n * Parse SKILL.md content string and return frontmatter and body\n */\nexport function parseSkillFrontmatter(content: string): { frontmatter: Record<string, unknown>; body: string } {\n const { data, content: body } = matter(content);\n return { frontmatter: data, body: body.trim() };\n}\n\n/**\n * Generate SKILL.md content from frontmatter and body\n */\nexport function generateSkillMd(frontmatter: Partial<SkillFrontmatter>, body: string): string {\n const yamlLines: string[] = [];\n\n if (frontmatter.name) {\n yamlLines.push(`name: ${frontmatter.name}`);\n }\n if (frontmatter.description) {\n yamlLines.push(`description: ${frontmatter.description}`);\n }\n if (frontmatter.version) {\n yamlLines.push(`version: ${frontmatter.version}`);\n }\n if (frontmatter['disable-model-invocation'] !== undefined) {\n yamlLines.push(`disable-model-invocation: ${frontmatter['disable-model-invocation']}`);\n }\n if (frontmatter['user-invocable'] !== undefined) {\n yamlLines.push(`user-invocable: ${frontmatter['user-invocable']}`);\n }\n if (frontmatter['allowed-tools']?.length) {\n const tools = Array.isArray(frontmatter['allowed-tools'])\n ? frontmatter['allowed-tools'].join(', ')\n : frontmatter['allowed-tools'];\n yamlLines.push(`allowed-tools: ${tools}`);\n }\n if (frontmatter['argument-hint']) {\n yamlLines.push(`argument-hint: ${frontmatter['argument-hint']}`);\n }\n if (frontmatter.model) {\n yamlLines.push(`model: ${frontmatter.model}`);\n }\n if (frontmatter.context) {\n yamlLines.push(`context: ${frontmatter.context}`);\n }\n if (frontmatter.agent) {\n yamlLines.push(`agent: ${frontmatter.agent}`);\n }\n\n return `---\n${yamlLines.join('\\n')}\n---\n\n${body}\n`;\n}\n","import { z } from 'zod';\n\n// SKILL.md frontmatter schema\nexport const SkillFrontmatterSchema = z.object({\n name: z\n .string()\n .min(1, 'Name is required')\n .regex(/^[a-z0-9-]+$/, 'Name must be lowercase alphanumeric with hyphens'),\n\n description: z\n .string()\n .min(10, 'Description should be detailed for good triggering'),\n\n version: z\n .string()\n .regex(/^\\d+\\.\\d+\\.\\d+$/, 'Version must be semver format')\n .optional(),\n\n 'disable-model-invocation': z.boolean().optional().default(false),\n\n 'user-invocable': z.boolean().optional().default(true),\n\n 'allowed-tools': z\n .union([z.string(), z.array(z.string())])\n .optional()\n .transform((val) => {\n if (typeof val === 'string') {\n return val.split(',').map((t) => t.trim());\n }\n return val;\n }),\n\n 'argument-hint': z.string().optional(),\n\n model: z.string().optional(),\n\n context: z.enum(['normal', 'fork']).optional(),\n\n agent: z.string().optional(),\n\n license: z.string().optional(),\n\n author: z\n .union([\n z.string(),\n z.object({\n name: z.string(),\n email: z.string().email().optional(),\n url: z.string().url().optional(),\n }),\n ])\n .optional(),\n\n keywords: z.array(z.string()).optional(),\n\n repository: z.string().optional(),\n});\n\n// Full skill schema including content\nexport const SkillSchema = SkillFrontmatterSchema.extend({\n content: z.string().min(1, 'Skill content is required'),\n path: z.string(),\n});\n\nexport type SkillFrontmatter = z.infer<typeof SkillFrontmatterSchema>;\nexport type Skill = z.infer<typeof SkillSchema>;\n","import * as path from 'path';\nimport * as os from 'os';\nimport * as fs from 'fs/promises';\n\nexport type Scope = 'global' | 'project';\n\n// Cache for openclaw config\nlet openclawConfigCache: OpenclawConfig | null | undefined = undefined;\n\ninterface OpenclawConfig {\n agents?: {\n defaults?: {\n workspace?: string;\n };\n list?: Array<{\n id?: string;\n default?: boolean;\n workspace?: string;\n }>;\n };\n agent?: {\n workspace?: string;\n };\n}\n\n/**\n * Get OpenClaw config file path\n */\nfunction getOpenclawConfigPath(): string {\n const override = process.env.OPENCLAW_CONFIG_PATH?.trim();\n if (override) {\n return resolveUserPath(override);\n }\n const stateDir = process.env.OPENCLAW_STATE_DIR?.trim();\n if (stateDir) {\n return path.join(resolveUserPath(stateDir), 'openclaw.json');\n }\n return path.join(os.homedir(), '.openclaw', 'openclaw.json');\n}\n\n/**\n * Resolve user path (expand ~ to home directory)\n */\nfunction resolveUserPath(input: string): string {\n const trimmed = input.trim();\n if (!trimmed) return '';\n if (trimmed.startsWith('~')) {\n return path.resolve(trimmed.replace(/^~(?=$|[\\\\/])/, os.homedir()));\n }\n return path.resolve(trimmed);\n}\n\n/**\n * Read OpenClaw config file\n */\nasync function readOpenclawConfig(): Promise<OpenclawConfig | null> {\n if (openclawConfigCache !== undefined) {\n return openclawConfigCache;\n }\n\n try {\n const configPath = getOpenclawConfigPath();\n const raw = await fs.readFile(configPath, 'utf-8');\n const parsed = JSON.parse(raw);\n if (!parsed || typeof parsed !== 'object') {\n openclawConfigCache = null;\n return null;\n }\n openclawConfigCache = parsed as OpenclawConfig;\n return openclawConfigCache;\n } catch {\n openclawConfigCache = null;\n return null;\n }\n}\n\n/**\n * Get workspace path from OpenClaw config\n */\nasync function getWorkspaceFromConfig(): Promise<string | null> {\n const config = await readOpenclawConfig();\n if (!config) return null;\n\n // Check agents.defaults.workspace first\n const defaultsWorkspace = config.agents?.defaults?.workspace;\n if (defaultsWorkspace) {\n return resolveUserPath(defaultsWorkspace);\n }\n\n // Check legacy agent.workspace\n const agentWorkspace = config.agent?.workspace;\n if (agentWorkspace) {\n return resolveUserPath(agentWorkspace);\n }\n\n // Check agents.list for default agent\n const listedAgents = config.agents?.list ?? [];\n const defaultAgent = listedAgents.find((entry) => entry.default) ??\n listedAgents.find((entry) => entry.id === 'main');\n if (defaultAgent?.workspace) {\n return resolveUserPath(defaultAgent.workspace);\n }\n\n return null;\n}\n\n/**\n * Get the default workspace path (fallback)\n */\nfunction getDefaultWorkspace(): string {\n return path.join(os.homedir(), '.openclaw', 'workspace');\n}\n\n/**\n * Get the skills directory path for a given scope\n * - global: reads from ~/.openclaw/openclaw.json or falls back to ~/.openclaw/workspace/skills/\n * - project: ./skills/ (current working directory)\n */\nexport function getSkillsPath(scope: Scope): string {\n if (scope === 'global') {\n // For sync version, use cached value or default\n // The async version should be preferred when possible\n return path.join(getDefaultWorkspace(), 'skills');\n }\n return path.join(process.cwd(), 'skills');\n}\n\n/**\n * Async version that reads from config\n */\nexport async function getSkillsPathAsync(scope: Scope): Promise<string> {\n if (scope === 'global') {\n const workspace = await getWorkspaceFromConfig();\n return path.join(workspace || getDefaultWorkspace(), 'skills');\n }\n return path.join(process.cwd(), 'skills');\n}\n\n/**\n * Get the lock file path for a given scope\n * - global: ~/.openclaw/workspace/lock.json\n * - project: .outclaw/lock.json\n */\nexport function getLockFilePath(scope: Scope): string {\n if (scope === 'global') {\n return path.join(getDefaultWorkspace(), 'lock.json');\n }\n return path.join(process.cwd(), '.outclaw', 'lock.json');\n}\n\n/**\n * Async version that reads from config\n */\nexport async function getLockFilePathAsync(scope: Scope): Promise<string> {\n if (scope === 'global') {\n const workspace = await getWorkspaceFromConfig();\n return path.join(workspace || getDefaultWorkspace(), 'lock.json');\n }\n return path.join(process.cwd(), '.outclaw', 'lock.json');\n}\n\n/**\n * Get the path to a specific skill\n */\nexport function getSkillPath(skillName: string, scope: Scope): string {\n return path.join(getSkillsPath(scope), skillName);\n}\n\n/**\n * Async version that reads from config\n */\nexport async function getSkillPathAsync(skillName: string, scope: Scope): Promise<string> {\n const skillsPath = await getSkillsPathAsync(scope);\n return path.join(skillsPath, skillName);\n}\n\n/**\n * Get the SKILL.md path for a specific skill\n */\nexport function getSkillMdPath(skillName: string, scope: Scope): string {\n return path.join(getSkillPath(skillName, scope), 'SKILL.md');\n}\n\n/**\n * Ensure directory exists\n */\nexport async function ensureDir(dirPath: string): Promise<void> {\n await fs.mkdir(dirPath, { recursive: true });\n}\n\n/**\n * Check if a path exists\n */\nexport async function pathExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Get config directory path (for API credentials)\n */\nexport function getConfigPath(): string {\n return path.join(os.homedir(), '.config', 'outclaw');\n}\n\n/**\n * @deprecated Use getLockFilePath instead\n */\nexport function getManifestPath(scope: Scope): string {\n return getLockFilePath(scope);\n}\n","import chalk from 'chalk';\n\nexport const logger = {\n info: (message: string) => {\n console.log(message);\n },\n\n success: (message: string) => {\n console.log(chalk.green('✓'), message);\n },\n\n error: (message: string) => {\n console.error(chalk.red('✗'), message);\n },\n\n warn: (message: string) => {\n console.log(chalk.yellow('⚠'), message);\n },\n\n dim: (message: string) => {\n console.log(chalk.dim(message));\n },\n\n skill: (info: { name: string; description: string; author?: string; downloads?: number; installCmd?: string }) => {\n console.log();\n console.log(chalk.bold.cyan(info.name));\n console.log(chalk.dim(info.description));\n const meta: string[] = [];\n if (info.author) {\n meta.push(`by ${info.author}`);\n }\n if (info.downloads !== undefined) {\n meta.push(`${info.downloads.toLocaleString()} downloads`);\n }\n if (meta.length > 0) {\n console.log(chalk.dim(meta.join(' · ')));\n }\n if (info.installCmd) {\n console.log(chalk.dim(`$ ${info.installCmd}`));\n }\n },\n\n box: (title: string, content: string) => {\n const lines = content.split('\\n');\n const maxLen = Math.max(title.length, ...lines.map((l) => l.length));\n const border = '─'.repeat(maxLen + 2);\n\n console.log(`┌${border}┐`);\n console.log(`│ ${chalk.bold(title.padEnd(maxLen))} │`);\n console.log(`├${border}┤`);\n for (const line of lines) {\n console.log(`│ ${line.padEnd(maxLen)} │`);\n }\n console.log(`└${border}┘`);\n },\n};\n","import Table from 'cli-table3';\nimport chalk from 'chalk';\n\nexport interface TableOptions {\n headers: string[];\n rows: string[][];\n}\n\nexport function renderTable(options: TableOptions): void {\n const table = new Table({\n head: options.headers.map((h) => chalk.bold.cyan(h)),\n style: {\n head: [],\n border: [],\n },\n });\n\n for (const row of options.rows) {\n table.push(row);\n }\n\n console.log(table.toString());\n}\n","import { SkillManager, type SkillInfo } from '../core/skill-manager.js';\nimport { logger } from '../ui/logger.js';\nimport { renderTable } from '../ui/table.js';\nimport type { Scope } from '../utils/paths.js';\n\nexport interface ListOptions {\n global?: boolean;\n project?: boolean;\n json?: boolean;\n}\n\nexport async function listCommand(options: ListOptions): Promise<void> {\n try {\n const scopes: Scope[] = [];\n\n if (options.global) {\n scopes.push('global');\n } else if (options.project) {\n scopes.push('project');\n } else {\n scopes.push('global', 'project');\n }\n\n const allSkills: SkillInfo[] = [];\n\n for (const scope of scopes) {\n const manager = new SkillManager(scope);\n const skills = await manager.listSkills();\n allSkills.push(...skills);\n }\n\n if (allSkills.length === 0) {\n logger.info('No skills installed.');\n logger.info('');\n logger.dim('Install skills with: outclaw install <skill>');\n logger.dim('Create a new skill with: outclaw init');\n return;\n }\n\n if (options.json) {\n console.log(JSON.stringify(allSkills, null, 2));\n return;\n }\n\n logger.info(`Found ${allSkills.length} skill(s):\\n`);\n\n renderTable({\n headers: ['Name', 'Version', 'Scope', 'Description'],\n rows: allSkills.map((s) => [\n s.name,\n s.version || '-',\n s.scope,\n s.description.length > 50 ? s.description.slice(0, 47) + '...' : s.description,\n ]),\n });\n } catch (error) {\n if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n process.exit(1);\n }\n}\n","import { confirm } from '@inquirer/prompts';\nimport { SkillManager } from '../core/skill-manager.js';\nimport { ApiClient, ApiError } from '../core/api-client.js';\nimport { isLoggedIn } from '../core/config.js';\nimport { logger } from '../ui/logger.js';\nimport { spinner } from '../ui/spinner.js';\nimport type { Scope } from '../utils/paths.js';\nimport type { SkillSource } from '../schemas/manifest.schema.js';\n\nexport interface InstallOptions {\n global?: boolean;\n force?: boolean;\n yes?: boolean;\n}\n\ninterface ParsedSource {\n type: 'github' | 'url' | 'local' | 'registry';\n owner?: string;\n repo?: string;\n skillPath?: string;\n ref?: string;\n url?: string;\n localPath?: string;\n registryId?: string; // UUID or slug for registry\n}\n\n// UUID regex pattern\nconst UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * Parse skill specifier to determine source\n * Formats:\n * - github:owner/repo\n * - github:owner/repo@ref\n * - github:owner/repo/path/to/skill\n * - https://github.com/owner/repo\n * - ./local/path\n * - <uuid> (registry ID)\n * - <name> (registry search - single word)\n */\nfunction parseSkillSpecifier(specifier: string): ParsedSource {\n // GitHub shorthand: github:owner/repo[@ref][/path]\n if (specifier.startsWith('github:')) {\n const rest = specifier.slice(7);\n const [ownerRepo, ...pathParts] = rest.split('/');\n const [owner, repoWithRef] = ownerRepo.includes('/')\n ? [ownerRepo.split('/')[0], ownerRepo.split('/').slice(1).join('/')]\n : [ownerRepo, pathParts[0]];\n\n let repo = repoWithRef || pathParts[0] || '';\n let ref: string | undefined;\n\n if (repo.includes('@')) {\n [repo, ref] = repo.split('@');\n }\n\n const skillPath = pathParts.slice(1).join('/');\n\n return {\n type: 'github',\n owner,\n repo,\n ref,\n skillPath: skillPath || undefined,\n };\n }\n\n // GitHub URL\n if (specifier.includes('github.com')) {\n const url = new URL(specifier);\n const parts = url.pathname.slice(1).split('/');\n const owner = parts[0];\n let repo = parts[1];\n let ref: string | undefined;\n\n // Handle .git suffix\n if (repo?.endsWith('.git')) {\n repo = repo.slice(0, -4);\n }\n\n // Handle tree/branch reference\n if (parts[2] === 'tree' && parts[3]) {\n ref = parts[3];\n }\n\n const skillPath = parts.slice(4).join('/');\n\n return {\n type: 'github',\n owner,\n repo,\n ref,\n skillPath: skillPath || undefined,\n };\n }\n\n // Generic URL\n if (specifier.startsWith('http://') || specifier.startsWith('https://')) {\n return {\n type: 'url',\n url: specifier,\n };\n }\n\n // Local path\n if (specifier.startsWith('./') || specifier.startsWith('/') || specifier.startsWith('../')) {\n return {\n type: 'local',\n localPath: specifier,\n };\n }\n\n // GitHub shorthand: owner/repo\n if (specifier.includes('/')) {\n const [owner, repoWithRef] = specifier.split('/');\n let repo = repoWithRef;\n let ref: string | undefined;\n\n if (repo?.includes('@')) {\n [repo, ref] = repo.split('@');\n }\n\n return {\n type: 'github',\n owner,\n repo,\n ref,\n };\n }\n\n // UUID - registry ID\n if (UUID_PATTERN.test(specifier)) {\n return {\n type: 'registry',\n registryId: specifier,\n };\n }\n\n // Single name - assume registry search/slug\n return {\n type: 'registry',\n registryId: specifier,\n };\n}\n\nasync function fetchFromGitHub(source: ParsedSource): Promise<{ name: string; content: string }> {\n const { owner, repo, ref = 'main', skillPath = '' } = source;\n\n // Construct raw GitHub URL for SKILL.md\n const basePath = skillPath ? `${skillPath}/` : '';\n const skillMdUrl = `https://raw.githubusercontent.com/${owner}/${repo}/${ref}/${basePath}SKILL.md`;\n\n const response = await fetch(skillMdUrl);\n\n if (!response.ok) {\n if (response.status === 404) {\n throw new Error(`SKILL.md not found at ${skillMdUrl}`);\n }\n throw new Error(`Failed to fetch skill: ${response.statusText}`);\n }\n\n const content = await response.text();\n\n // Extract name from frontmatter or use repo name\n const nameMatch = content.match(/^name:\\s*(.+)$/m);\n const name = nameMatch ? nameMatch[1].trim() : repo!;\n\n return { name, content };\n}\n\nasync function fetchFromRegistry(\n client: ApiClient,\n registryId: string\n): Promise<{ name: string; content: string; workflowId: string }> {\n // Check if it's a UUID or need to search\n if (UUID_PATTERN.test(registryId)) {\n // Direct ID - download\n const content = await client.downloadWorkflow(registryId);\n const workflow = await client.getWorkflow(registryId);\n\n // Extract name from content frontmatter or use title\n const nameMatch = content.match(/^name:\\s*(.+)$/m);\n const name = nameMatch ? nameMatch[1].trim() : workflow.title;\n\n return { name, content, workflowId: registryId };\n }\n\n // Search by name/slug\n const results = await client.searchWorkflows(registryId, { limit: 5 });\n\n if (results.workflows.length === 0) {\n throw new Error(`No skill found matching \"${registryId}\" in the registry.`);\n }\n\n // If exact match found, use it\n const exactMatch = results.workflows.find(\n (w) => w.title.toLowerCase() === registryId.toLowerCase() || w.slug === registryId\n );\n\n const workflow = exactMatch || results.workflows[0];\n\n if (!exactMatch && results.workflows.length > 1) {\n logger.warn(`Multiple skills found. Installing \"${workflow.title}\".`);\n logger.dim('Use the workflow ID for exact match: outclaw install <uuid>');\n }\n\n // Download the content\n const content = await client.downloadWorkflow(workflow.id);\n\n // Extract name from content frontmatter or use title\n const nameMatch = content.match(/^name:\\s*(.+)$/m);\n const name = nameMatch ? nameMatch[1].trim() : workflow.title;\n\n return { name, content, workflowId: workflow.id };\n}\n\nexport async function installCommand(specifier: string, options: InstallOptions): Promise<void> {\n const spin = spinner('Resolving skill...').start();\n\n try {\n // Parse specifier\n const source = parseSkillSpecifier(specifier);\n\n if (source.type === 'local') {\n spin.fail('Local installation not yet implemented');\n process.exit(1);\n }\n\n if (source.type === 'url') {\n spin.fail('URL installation not yet implemented');\n process.exit(1);\n }\n\n let name: string;\n let content: string;\n let skillSource: SkillSource;\n\n if (source.type === 'registry') {\n // Registry installation requires login\n if (!(await isLoggedIn())) {\n spin.fail('Authentication required');\n logger.error('You must be logged in to install from the registry.');\n logger.dim('Run \"outclaw login\" to authenticate.');\n process.exit(1);\n }\n\n spin.text = `Searching registry for \"${source.registryId}\"...`;\n\n const client = await ApiClient.create();\n const result = await fetchFromRegistry(client, source.registryId!);\n\n name = result.name;\n content = result.content;\n skillSource = {\n type: 'registry',\n id: result.workflowId,\n };\n\n spin.text = `Found skill: ${name}`;\n } else {\n // GitHub installation\n spin.text = `Fetching from GitHub: ${source.owner}/${source.repo}...`;\n const result = await fetchFromGitHub(source);\n\n name = result.name;\n content = result.content;\n skillSource = {\n type: 'github',\n url: `https://github.com/${source.owner}/${source.repo}`,\n ref: source.ref,\n };\n\n spin.text = `Found skill: ${name}`;\n }\n\n // Check for existing skill\n const scope: Scope = options.global ? 'global' : 'project';\n const manager = new SkillManager(scope);\n\n if (await manager.skillExists(name)) {\n if (!options.force) {\n spin.stop();\n\n if (!options.yes) {\n const proceed = await confirm({\n message: `Skill \"${name}\" already exists. Overwrite?`,\n default: false,\n });\n\n if (!proceed) {\n logger.info('Installation cancelled');\n return;\n }\n }\n\n spin.start('Installing...');\n }\n }\n\n // Install\n spin.text = `Installing ${name}...`;\n\n const skillPath = await manager.installSkill(name, content, {\n force: options.force || false,\n source: skillSource,\n });\n\n spin.succeed(`Installed ${name}`);\n logger.info('');\n logger.box(`Skill Installed: ${name}`, [\n `Path: ${skillPath}`,\n `Scope: ${scope}`,\n '',\n `Use /${name} in OpenClaw to invoke this skill`,\n ].join('\\n'));\n } catch (error) {\n spin.fail('Installation failed');\n\n if (error instanceof ApiError) {\n if (error.statusCode === 401) {\n logger.error('Authentication failed. Please run \"outclaw login\".');\n } else if (error.statusCode === 404) {\n logger.error('Skill not found in the registry.');\n } else {\n logger.error(error.message);\n }\n } else if (error instanceof Error) {\n logger.error(error.message);\n }\n\n process.exit(1);\n }\n}\n","import * as fs from 'fs/promises';\nimport * as path from 'path';\nimport { getConfigPath, ensureDir, pathExists } from '../utils/paths.js';\n\nexport interface OutclawConfig {\n api_key?: string;\n agent_id?: string;\n agent_name?: string;\n verified?: boolean;\n api_base?: string;\n}\n\nconst CONFIG_FILE = 'config.json';\nconst DEFAULT_API_BASE = 'https://outclaws.ai/api';\n\n/**\n * Get config file path\n */\nfunction getConfigFilePath(): string {\n return path.join(getConfigPath(), CONFIG_FILE);\n}\n\n/**\n * Load config from disk\n */\nexport async function loadConfig(): Promise<OutclawConfig> {\n const configPath = getConfigFilePath();\n\n if (!(await pathExists(configPath))) {\n return {};\n }\n\n try {\n const content = await fs.readFile(configPath, 'utf-8');\n return JSON.parse(content) as OutclawConfig;\n } catch {\n return {};\n }\n}\n\n/**\n * Save config to disk\n */\nexport async function saveConfig(config: OutclawConfig): Promise<void> {\n const configDir = getConfigPath();\n await ensureDir(configDir);\n\n const configPath = getConfigFilePath();\n await fs.writeFile(configPath, JSON.stringify(config, null, 2), 'utf-8');\n}\n\n/**\n * Clear config (logout)\n */\nexport async function clearConfig(): Promise<void> {\n const configPath = getConfigFilePath();\n\n if (await pathExists(configPath)) {\n await fs.unlink(configPath);\n }\n}\n\n/**\n * Get API key from config or environment\n */\nexport async function getApiKey(): Promise<string | undefined> {\n // Environment variable takes precedence\n if (process.env.OUTCLAW_API_KEY) {\n return process.env.OUTCLAW_API_KEY;\n }\n\n const config = await loadConfig();\n return config.api_key;\n}\n\n/**\n * Get API base URL\n */\nexport async function getApiBase(): Promise<string> {\n if (process.env.OUTCLAW_API_BASE) {\n return process.env.OUTCLAW_API_BASE;\n }\n\n const config = await loadConfig();\n return config.api_base || DEFAULT_API_BASE;\n}\n\n/**\n * Check if user is logged in\n */\nexport async function isLoggedIn(): Promise<boolean> {\n const apiKey = await getApiKey();\n return !!apiKey;\n}\n","import { getApiKey, getApiBase } from './config.js';\n\nexport interface WorkflowSearchResult {\n id: string;\n title: string;\n slug: string;\n description: string;\n downloads: number;\n created_at: string;\n creator?: {\n id: string;\n twitter_handle?: string;\n name?: string;\n };\n community?: {\n id: string;\n slug: string;\n name: string;\n };\n}\n\nexport interface WorkflowListResponse {\n workflows: WorkflowSearchResult[];\n total: number;\n page: number;\n pages: number;\n}\n\nexport interface WorkflowDetail extends WorkflowSearchResult {\n content: string;\n target_audience?: string;\n example_input?: string;\n example_output?: string;\n status: string;\n avg_rating?: number;\n}\n\nexport interface AgentInfo {\n id: string;\n name: string;\n verified: boolean;\n user_id?: string;\n created_at: string;\n description?: string;\n api_key?: string; // Only shown as prefix in /me\n}\n\nexport interface RegisterAgentRequest {\n name: string;\n description?: string;\n}\n\nexport interface RegisterAgentResponse {\n agent_id: string;\n api_key: string; // Full key - only returned once!\n claim_url: string;\n verification_code: string;\n status: 'pending_claim';\n}\n\nexport interface PublishWorkflowRequest {\n title: string;\n description: string;\n content: string;\n target_audience?: string;\n community_id?: string;\n example_input?: string;\n example_output?: string;\n}\n\nexport interface PublishWorkflowResponse {\n id: string;\n status: 'published' | 'rejected';\n message: string;\n security_scan?: {\n passed: boolean;\n risk_factors: string[];\n explanation: string;\n };\n}\n\nexport class ApiError extends Error {\n constructor(\n message: string,\n public statusCode: number,\n public code?: string\n ) {\n super(message);\n this.name = 'ApiError';\n }\n}\n\n/**\n * Outclaws API Client\n */\nexport class ApiClient {\n private apiBase: string;\n private apiKey?: string;\n\n constructor(apiBase: string, apiKey?: string) {\n this.apiBase = apiBase;\n this.apiKey = apiKey;\n }\n\n /**\n * Create client with config\n */\n static async create(): Promise<ApiClient> {\n const apiBase = await getApiBase();\n const apiKey = await getApiKey();\n return new ApiClient(apiBase, apiKey);\n }\n\n /**\n * Make API request\n */\n private async request<T>(\n endpoint: string,\n options: RequestInit = {}\n ): Promise<T> {\n const url = `${this.apiBase}${endpoint}`;\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n ...(options.headers as Record<string, string>),\n };\n\n if (this.apiKey) {\n headers['Authorization'] = `Bearer ${this.apiKey}`;\n }\n\n const response = await fetch(url, {\n ...options,\n headers,\n });\n\n if (!response.ok) {\n let message = `API request failed: ${response.statusText}`;\n let code: string | undefined;\n\n try {\n const errorData = (await response.json()) as { error?: string; message?: string; code?: string };\n message = errorData.error || errorData.message || message;\n code = errorData.code;\n } catch {\n // Ignore JSON parse errors\n }\n\n throw new ApiError(message, response.status, code);\n }\n\n // Handle non-JSON responses (like download)\n const contentType = response.headers.get('content-type');\n if (contentType?.includes('text/markdown')) {\n return (await response.text()) as T;\n }\n\n return (await response.json()) as T;\n }\n\n /**\n * Search workflows\n */\n async searchWorkflows(\n query: string,\n options: {\n limit?: number;\n offset?: number;\n sort?: 'hot' | 'new' | 'top';\n community?: string;\n } = {}\n ): Promise<WorkflowListResponse> {\n const params = new URLSearchParams();\n params.set('search', query);\n\n if (options.limit) params.set('limit', options.limit.toString());\n if (options.offset) params.set('offset', options.offset.toString());\n if (options.sort) params.set('sort', options.sort);\n if (options.community) params.set('community', options.community);\n\n return this.request<WorkflowListResponse>(`/workflows?${params.toString()}`);\n }\n\n /**\n * Get workflow detail\n */\n async getWorkflow(id: string): Promise<WorkflowDetail> {\n return this.request<WorkflowDetail>(`/workflows/${id}`);\n }\n\n /**\n * Download workflow content (requires auth)\n */\n async downloadWorkflow(id: string): Promise<string> {\n if (!this.apiKey) {\n throw new ApiError('Authentication required. Please run: outclaw login', 401, 'unauthorized');\n }\n return this.request<string>(`/workflows/${id}/download`);\n }\n\n /**\n * Get current agent info (requires auth)\n */\n async getMe(): Promise<AgentInfo> {\n if (!this.apiKey) {\n throw new ApiError('Authentication required. Please run: outclaw login', 401, 'unauthorized');\n }\n return this.request<AgentInfo>('/agents/me');\n }\n\n /**\n * Verify API key is valid\n */\n async verifyApiKey(): Promise<AgentInfo | null> {\n try {\n return await this.getMe();\n } catch (error) {\n if (error instanceof ApiError && error.statusCode === 401) {\n return null;\n }\n throw error;\n }\n }\n\n /**\n * Register a new agent (no auth required)\n */\n async registerAgent(data: RegisterAgentRequest): Promise<RegisterAgentResponse> {\n return this.request<RegisterAgentResponse>('/agents/register', {\n method: 'POST',\n body: JSON.stringify(data),\n });\n }\n\n /**\n * Verify API key with a specific key (for login)\n */\n async verifyApiKeyWith(apiKey: string): Promise<AgentInfo | null> {\n const tempClient = new ApiClient(this.apiBase, apiKey);\n return tempClient.verifyApiKey();\n }\n\n /**\n * Publish a workflow (requires auth + verified)\n */\n async publishWorkflow(data: PublishWorkflowRequest): Promise<PublishWorkflowResponse> {\n if (!this.apiKey) {\n throw new ApiError('Authentication required. Please run: outclaw login', 401, 'unauthorized');\n }\n return this.request<PublishWorkflowResponse>('/workflows', {\n method: 'POST',\n body: JSON.stringify(data),\n });\n }\n}\n","import ora, { type Ora } from 'ora';\n\nexport function spinner(text: string): Ora {\n return ora({\n text,\n spinner: 'dots',\n });\n}\n\nexport { type Ora };\n","import { confirm } from '@inquirer/prompts';\nimport { SkillManager } from '../core/skill-manager.js';\nimport { logger } from '../ui/logger.js';\nimport { spinner } from '../ui/spinner.js';\nimport type { Scope } from '../utils/paths.js';\n\nexport interface UninstallOptions {\n global?: boolean;\n yes?: boolean;\n}\n\nexport async function uninstallCommand(name: string, options: UninstallOptions): Promise<void> {\n try {\n const scope: Scope = options.global ? 'global' : 'project';\n const manager = new SkillManager(scope);\n\n // Check if skill exists\n const skill = await manager.getSkill(name);\n\n if (!skill) {\n logger.error(`Skill \"${name}\" not found in ${scope} skills`);\n process.exit(1);\n }\n\n // Confirm uninstall\n if (!options.yes) {\n const proceed = await confirm({\n message: `Are you sure you want to uninstall \"${name}\"?`,\n default: false,\n });\n\n if (!proceed) {\n logger.info('Uninstall cancelled');\n return;\n }\n }\n\n const spin = spinner(`Uninstalling ${name}...`).start();\n\n await manager.uninstallSkill(name);\n\n spin.succeed(`Uninstalled ${name}`);\n } catch (error) {\n if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n process.exit(1);\n }\n}\n","import { logger } from '../ui/logger.js';\nimport { spinner } from '../ui/spinner.js';\nimport { renderTable } from '../ui/table.js';\nimport { ApiClient, ApiError } from '../core/api-client.js';\n\nexport interface SearchOptions {\n limit: number;\n json?: boolean;\n sort?: 'hot' | 'new' | 'top';\n community?: string;\n}\n\nexport async function searchCommand(query: string, options: SearchOptions): Promise<void> {\n const spin = spinner(`Searching for \"${query}\"...`).start();\n\n try {\n const client = await ApiClient.create();\n\n const result = await client.searchWorkflows(query, {\n limit: options.limit,\n sort: options.sort,\n community: options.community,\n });\n\n spin.stop();\n\n if (result.workflows.length === 0) {\n logger.info(`No skills found matching \"${query}\"`);\n logger.info('');\n logger.dim('Try a different search term or browse all skills at https://outclaws.ai');\n return;\n }\n\n if (options.json) {\n console.log(JSON.stringify(result.workflows, null, 2));\n return;\n }\n\n logger.info(`Found ${result.total} skill(s)${result.total > result.workflows.length ? ` (showing ${result.workflows.length})` : ''}:\\n`);\n\n renderTable({\n headers: ['Name', 'Author', 'Downloads', 'Description'],\n rows: result.workflows.map((w) => {\n const author = w.creator?.twitter_handle\n ? `@${w.creator.twitter_handle}`\n : w.creator?.name || 'unknown';\n const desc = w.description.length > 40 ? w.description.slice(0, 37) + '...' : w.description;\n return [w.title, author, String(w.downloads || 0), desc];\n }),\n });\n\n logger.info('');\n logger.dim('Install with: outclaw install <name>');\n\n if (result.pages > 1) {\n logger.info('');\n logger.dim(`Page ${result.page} of ${result.pages}. Use --limit and search again for more results.`);\n }\n } catch (error) {\n spin.fail('Search failed');\n\n if (error instanceof ApiError) {\n logger.error(error.message);\n\n if (error.statusCode === 0 || error.message.includes('fetch')) {\n logger.dim('Could not connect to Outclaws API. Check your internet connection.');\n }\n } else if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n\n process.exit(1);\n }\n}\n","import chalk from 'chalk';\nimport { SkillManager } from '../core/skill-manager.js';\nimport { logger } from '../ui/logger.js';\nimport type { Scope } from '../utils/paths.js';\n\nexport interface InfoOptions {\n global?: boolean;\n}\n\nexport async function infoCommand(name: string, options: InfoOptions): Promise<void> {\n try {\n // Try both scopes if not specified\n const scopes: Scope[] = options.global ? ['global'] : ['project', 'global'];\n\n let skill = null;\n let foundScope: Scope | null = null;\n\n for (const scope of scopes) {\n const manager = new SkillManager(scope);\n skill = await manager.getSkill(name);\n if (skill) {\n foundScope = scope;\n break;\n }\n }\n\n if (!skill || !foundScope) {\n logger.error(`Skill \"${name}\" not found`);\n logger.dim('');\n logger.dim('Search for skills: outclaw search <query>');\n process.exit(1);\n }\n\n // Display skill info\n console.log();\n console.log(chalk.bold.cyan(` ${skill.name}`));\n console.log();\n console.log(chalk.dim(' Description:'), skill.description);\n console.log(chalk.dim(' Version:'), skill.version || 'unversioned');\n console.log(chalk.dim(' Scope:'), foundScope);\n console.log(chalk.dim(' Path:'), skill.path);\n\n if (skill['user-invocable'] !== undefined) {\n console.log(chalk.dim(' User-invocable:'), skill['user-invocable'] ? 'yes' : 'no');\n }\n\n if (skill['disable-model-invocation'] !== undefined) {\n console.log(\n chalk.dim(' Model invocation:'),\n skill['disable-model-invocation'] ? 'disabled' : 'enabled'\n );\n }\n\n if (skill['allowed-tools']?.length) {\n console.log(chalk.dim(' Allowed tools:'), skill['allowed-tools'].join(', '));\n }\n\n if (skill['argument-hint']) {\n console.log(chalk.dim(' Arguments:'), skill['argument-hint']);\n }\n\n if (skill.context) {\n console.log(chalk.dim(' Context:'), skill.context);\n }\n\n if (skill.agent) {\n console.log(chalk.dim(' Agent:'), skill.agent);\n }\n\n if (skill.model) {\n console.log(chalk.dim(' Model:'), skill.model);\n }\n\n console.log();\n console.log(chalk.dim(' ─'.repeat(30)));\n console.log();\n console.log(chalk.dim(' Content preview:'));\n console.log();\n\n // Show first 10 lines of content\n const lines = skill.content.split('\\n').slice(0, 10);\n for (const line of lines) {\n console.log(chalk.dim(' │ ') + line);\n }\n\n if (skill.content.split('\\n').length > 10) {\n console.log(chalk.dim(' │ ...'));\n }\n\n console.log();\n } catch (error) {\n if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n process.exit(1);\n }\n}\n","import { input, select } from '@inquirer/prompts';\nimport { ApiClient, ApiError } from '../core/api-client.js';\nimport { saveConfig, loadConfig, isLoggedIn, getApiBase } from '../core/config.js';\nimport { logger } from '../ui/logger.js';\nimport { spinner } from '../ui/spinner.js';\n\nexport interface LoginOptions {\n token?: string;\n}\n\nexport async function loginCommand(options: LoginOptions): Promise<void> {\n // Check if already logged in\n if (await isLoggedIn()) {\n const config = await loadConfig();\n logger.warn(`Already logged in as \"${config.agent_name || 'unknown'}\".`);\n logger.dim('Run \"outclaw logout\" first if you want to switch accounts.');\n return;\n }\n\n const apiBase = await getApiBase();\n const client = new ApiClient(apiBase);\n\n // If token provided via flag, use it directly\n if (options.token) {\n await loginWithToken(client, options.token);\n return;\n }\n\n // Interactive mode - ask user what they want to do\n const choice = await select({\n message: 'How would you like to authenticate?',\n choices: [\n {\n value: 'token',\n name: 'Enter existing API Key',\n description: 'If you already have an API key from Outclaws',\n },\n {\n value: 'register',\n name: 'Register new Agent',\n description: 'Create a new agent and get an API key',\n },\n ],\n });\n\n if (choice === 'token') {\n const token = await input({\n message: 'Enter your API Key:',\n validate: (value) => {\n if (!value.trim()) return 'API Key is required';\n if (!value.startsWith('oc_')) return 'Invalid API Key format (should start with oc_)';\n return true;\n },\n });\n await loginWithToken(client, token.trim());\n } else {\n await registerNewAgent(client);\n }\n}\n\nasync function loginWithToken(client: ApiClient, token: string): Promise<void> {\n const spin = spinner('Verifying API Key...').start();\n\n try {\n const agent = await client.verifyApiKeyWith(token);\n\n if (!agent) {\n spin.fail('Invalid API Key');\n logger.error('The provided API Key is invalid or expired.');\n process.exit(1);\n }\n\n // Save to config\n await saveConfig({\n api_key: token,\n agent_id: agent.id,\n agent_name: agent.name,\n verified: agent.verified,\n });\n\n spin.succeed(`Logged in as \"${agent.name}\"`);\n\n if (!agent.verified) {\n logger.info('');\n logger.warn('Your agent is not verified yet.');\n logger.dim('Visit https://outclaws.ai to complete verification (required for publishing).');\n }\n } catch (error) {\n spin.fail('Login failed');\n\n if (error instanceof ApiError) {\n logger.error(error.message);\n } else if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n\n process.exit(1);\n }\n}\n\nasync function registerNewAgent(client: ApiClient): Promise<void> {\n // Get agent name\n const name = await input({\n message: 'Enter a name for your agent:',\n validate: (value) => {\n if (!value.trim()) return 'Name is required';\n if (value.trim().length > 100) return 'Name must be 100 characters or less';\n return true;\n },\n });\n\n // Get optional description\n const description = await input({\n message: 'Enter a description (optional):',\n });\n\n const spin = spinner('Registering agent...').start();\n\n try {\n const result = await client.registerAgent({\n name: name.trim(),\n description: description.trim() || undefined,\n });\n\n // Save to config\n await saveConfig({\n api_key: result.api_key,\n agent_id: result.agent_id,\n agent_name: name.trim(),\n verified: false,\n });\n\n spin.succeed('Agent registered successfully!');\n\n logger.info('');\n logger.box('Important - Save Your API Key!', [\n `API Key: ${result.api_key}`,\n '',\n 'This key is only shown once. Store it securely!',\n ].join('\\n'));\n\n logger.info('');\n logger.info('To verify your agent (required for publishing):');\n logger.dim(`1. Visit: ${result.claim_url}`);\n logger.dim(`2. Post on X/Twitter with code: ${result.verification_code}`);\n logger.dim('3. Submit the tweet URL to complete verification');\n } catch (error) {\n spin.fail('Registration failed');\n\n if (error instanceof ApiError) {\n logger.error(error.message);\n } else if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n\n process.exit(1);\n }\n}\n","import { confirm } from '@inquirer/prompts';\nimport { clearConfig, isLoggedIn, loadConfig } from '../core/config.js';\nimport { logger } from '../ui/logger.js';\n\nexport interface LogoutOptions {\n yes?: boolean;\n}\n\nexport async function logoutCommand(options: LogoutOptions): Promise<void> {\n // Check if logged in\n if (!(await isLoggedIn())) {\n logger.info('You are not logged in.');\n return;\n }\n\n // Get current config for display\n const config = await loadConfig();\n const agentName = config.agent_name || 'Unknown';\n\n // Confirm logout\n if (!options.yes) {\n const proceed = await confirm({\n message: `Log out from agent \"${agentName}\"?`,\n default: true,\n });\n\n if (!proceed) {\n logger.info('Logout cancelled.');\n return;\n }\n }\n\n // Clear config\n await clearConfig();\n\n logger.success('Logged out successfully.');\n logger.dim('Your API key has been removed from local storage.');\n}\n","import { ApiClient, ApiError } from '../core/api-client.js';\nimport { isLoggedIn, loadConfig } from '../core/config.js';\nimport { logger } from '../ui/logger.js';\nimport { spinner } from '../ui/spinner.js';\n\nexport interface WhoamiOptions {\n json?: boolean;\n}\n\nexport async function whoamiCommand(options: WhoamiOptions): Promise<void> {\n // Check if logged in\n if (!(await isLoggedIn())) {\n logger.error('Not logged in.');\n logger.dim('Run \"outclaw login\" to authenticate.');\n process.exit(1);\n }\n\n const spin = spinner('Fetching account info...').start();\n\n try {\n const client = await ApiClient.create();\n const agent = await client.getMe();\n const config = await loadConfig();\n\n spin.stop();\n\n if (options.json) {\n console.log(JSON.stringify({\n id: agent.id,\n name: agent.name,\n verified: agent.verified,\n created_at: agent.created_at,\n }, null, 2));\n return;\n }\n\n logger.info('');\n logger.box(`Agent: ${agent.name}`, [\n `ID: ${agent.id}`,\n `Verified: ${agent.verified ? '✓ Yes' : '✗ No'}`,\n `API Key: ${config.api_key?.substring(0, 10)}...`,\n ].join('\\n'));\n logger.info('');\n\n if (!agent.verified) {\n logger.warn('Your agent is not verified.');\n logger.dim('Visit https://outclaws.ai to complete verification (required for publishing).');\n }\n } catch (error) {\n spin.fail('Failed to fetch account info');\n\n if (error instanceof ApiError) {\n if (error.statusCode === 401) {\n logger.error('Your API key is invalid or expired.');\n logger.dim('Run \"outclaw logout\" then \"outclaw login\" to re-authenticate.');\n } else {\n logger.error(error.message);\n }\n } else if (error instanceof Error) {\n logger.error(error.message);\n } else {\n logger.error('An unexpected error occurred');\n }\n\n process.exit(1);\n }\n}\n","import * as fs from 'fs/promises';\nimport * as path from 'path';\nimport { input, confirm } from '@inquirer/prompts';\nimport { ApiClient, ApiError, type PublishWorkflowRequest } from '../core/api-client.js';\nimport { isLoggedIn, loadConfig } from '../core/config.js';\nimport { logger } from '../ui/logger.js';\nimport { spinner } from '../ui/spinner.js';\nimport { pathExists } from '../utils/paths.js';\nimport { parseSkillFrontmatter } from '../parsers/skill-parser.js';\n\nexport interface PublishOptions {\n title?: string;\n description?: string;\n community?: string;\n yes?: boolean;\n}\n\nexport async function publishCommand(skillPath: string, options: PublishOptions): Promise<void> {\n // Check if logged in\n if (!(await isLoggedIn())) {\n logger.error('You must be logged in to publish.');\n logger.dim('Run \"outclaw login\" to authenticate.');\n process.exit(1);\n }\n\n // Check if verified\n const config = await loadConfig();\n if (!config.verified) {\n logger.error('Your agent must be verified to publish.');\n logger.dim('Visit https://outclaws.ai to complete verification.');\n process.exit(1);\n }\n\n // Resolve skill path\n const resolvedPath = path.resolve(skillPath);\n let skillMdPath: string;\n\n // Check if it's a directory or file\n try {\n const stat = await fs.stat(resolvedPath);\n if (stat.isDirectory()) {\n skillMdPath = path.join(resolvedPath, 'SKILL.md');\n } else {\n skillMdPath = resolvedPath;\n }\n } catch {\n logger.error(`Path not found: ${skillPath}`);\n process.exit(1);\n }\n\n // Check if SKILL.md exists\n if (!(await pathExists(skillMdPath))) {\n logger.error(`SKILL.md not found at ${skillMdPath}`);\n logger.dim('Make sure you are in a skill directory or specify the path to SKILL.md');\n process.exit(1);\n }\n\n // Read SKILL.md content\n const content = await fs.readFile(skillMdPath, 'utf-8');\n\n // Parse frontmatter for metadata\n const parsed = parseSkillFrontmatter(content);\n\n // Get title and description from options or frontmatter\n let title: string | undefined = options.title || (parsed.frontmatter?.name as string | undefined);\n let description: string | undefined = options.description || (parsed.frontmatter?.description as string | undefined);\n\n // Prompt for missing required fields\n if (!title) {\n title = await input({\n message: 'Enter a title for your skill:',\n validate: (value) => {\n if (!value.trim()) return 'Title is required';\n if (value.trim().length > 200) return 'Title must be 200 characters or less';\n return true;\n },\n });\n }\n\n if (!description) {\n description = await input({\n message: 'Enter a description for your skill:',\n validate: (value) => {\n if (!value.trim()) return 'Description is required';\n if (value.trim().length > 1000) return 'Description must be 1000 characters or less';\n return true;\n },\n });\n }\n\n // Confirm publish\n if (!options.yes) {\n logger.info('');\n logger.info(` Title: ${title}`);\n logger.info(` Description: ${description.substring(0, 50)}${description.length > 50 ? '...' : ''}`);\n logger.info(` File: ${skillMdPath}`);\n logger.info('');\n\n const proceed = await confirm({\n message: 'Publish this skill to Outclaws?',\n default: true,\n });\n\n if (!proceed) {\n logger.info('Publish cancelled.');\n return;\n }\n }\n\n const spin = spinner('Publishing skill...').start();\n\n try {\n const client = await ApiClient.create();\n\n const request: PublishWorkflowRequest = {\n title: title.trim(),\n description: description.trim(),\n content: content,\n target_audience: parsed.frontmatter?.['target-audience'] as string | undefined,\n };\n\n if (options.community) {\n request.community_id = options.community;\n }\n\n const response = await client.publishWorkflow(request);\n\n if (response.status === 'published') {\n spin.succeed('Skill published successfully!');\n logger.info('');\n logger.info(` ID: ${response.id}`);\n logger.info(` URL: https://outclaws.ai/workflow/${response.id}`);\n logger.info('');\n logger.dim('Your skill is now available in the registry.');\n } else {\n spin.fail('Skill rejected by security scan');\n logger.info('');\n logger.error(response.message);\n\n if (response.security_scan) {\n logger.info('');\n logger.warn('Risk factors:');\n for (const factor of response.security_scan.risk_factors) {\n logger.dim(` - ${factor}`);\n }\n logger.info('');\n logger.dim(response.security_scan.explanation);\n }\n\n process.exit(1);\n }\n } catch (error) {\n spin.fail('Publish failed');\n\n if (error instanceof ApiError) {\n if (error.statusCode === 401) {\n logger.error('Authentication failed. Please run \"outclaw login\".');\n } else if (error.code === 'verification_required') {\n logger.error('Your agent must be verified to publish.');\n logger.dim('Visit https://outclaws.ai to complete verification.');\n } else {\n logger.error(error.message);\n }\n } else if (error instanceof Error) {\n logger.error(error.message);\n }\n\n process.exit(1);\n }\n}\n","import { cli } from './cli.js';\n\ncli.parse();\n"],"mappings":";;;AAAA,SAAS,eAAe;;;ACAxB,SAAS,OAAe,UAAU,eAAe;;;ACAjD,YAAYA,SAAQ;AACpB,YAAYC,WAAU;;;ACDtB,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,OAAO,YAAY;;;ACFnB,SAAS,SAAS;AAGX,IAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,MAAM,EACH,OAAO,EACP,IAAI,GAAG,kBAAkB,EACzB,MAAM,gBAAgB,kDAAkD;AAAA,EAE3E,aAAa,EACV,OAAO,EACP,IAAI,IAAI,oDAAoD;AAAA,EAE/D,SAAS,EACN,OAAO,EACP,MAAM,mBAAmB,+BAA+B,EACxD,SAAS;AAAA,EAEZ,4BAA4B,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,KAAK;AAAA,EAEhE,kBAAkB,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,IAAI;AAAA,EAErD,iBAAiB,EACd,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EACvC,SAAS,EACT,UAAU,CAAC,QAAQ;AAClB,QAAI,OAAO,QAAQ,UAAU;AAC3B,aAAO,IA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AM,EACd,MAAM,IAAI,EACV,YAAY,uBAAuB,EACnC,OAAO,gBAAgB,yBAAyB,EAChD,OAAO,iBAAiB,0BAA0B,EAClD,OAAO,UAAU,gBAAgB,EACjC,OAAO,OAAO,YAAY;AACzB,QAAM,YAAY,OAAO;AAC3B,CAAC;AAGH,IACG,QAAQ,gBAAgB,EACxB,MAAM,MAAM,EACZ,YAAY,mCAAmC,EAC/C,OAAO,wBAAwB,mBAAmB,IAAI,EACtD,OAAO,UAAU,gBAAgB,EACjC,OAAO,OAAO,OAAO,YAAY;AAChC,QAAM,cAAc,OAAO,EAAE,GAAG,SAAS,OAAO,SAAS,QAAQ,KAAK,EAAE,CAAC;AAC3E,CAAC;AAGH,IACG,QAAQ,cAAc,EACtB,YAAY,yCAAyC,EACrD,OAAO,gBAAgB,uBAAuB,EAC9C,OAAO,OAAO,OAAO,YAAY;AAChC,QAAM,YAAY,OAAO,OAAO;AAClC,CAAC;AAGH,IACG,QAAQ,gBAAgB,EACxB,YAAY,sCAAsC,EAClD,OAAO,uBAAuB,aAAa,EAC3C,OAAO,4BAA4B,mBAAmB,EACtD,OAAO,wBAAwB,cAAc,EAC7C,OAAO,aAAa,0BAA0B,EAC9C,OAAO,OAAOC,OAAM,YAAY;AAC/B,QAAM,eAAeA,OAAM,OAAO;AACpC,CAAC;AAGH,IAAI,GAAG,aAAa,MAAM;AACxB,UAAQ,MAAM,oBAAoB,IAAI,KAAK,KAAK,GAAG,CAAC,EAAE;AACtD,UAAQ,IAAI,8CAA8C;AAC1D,UAAQ,KAAK,CAAC;AAChB,CAAC;;;AoBnID,IAAI,MAAM;","names":["fs","path","path","fs","input","stat","chalk","confirm","fs","path","content","workflow","nameMatch","name","confirm","confirm","confirm","chalk","chalk","input","select","select","input","confirm","confirm","fs","path","input","confirm","stat","input","confirm","path"]}
|