UNPKG

@lark-project/cli

Version:

飞书项目插件开发工具

37 lines (36 loc) 1.78 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.addWorkspaceCommand = void 0; // ⚠️ 改命令名 / flag / alias 时,同步 grep `lpm` skills/ .claude/skills/ 修文档引用 const path_1 = __importDefault(require("path")); const types_1 = require("../../types"); const run_script_1 = __importDefault(require("../../utils/run-script")); function addWorkspaceCommand(program) { const workspace = program .command('workspace') .description('Manage the .lpm-cache/ workspace directory (schema snapshots, config drafts, mcp cache)'); workspace .command('clean') .description('Remove cached artifacts under .lpm-cache/. Useful after interrupted runs.') .option('--scope <scope>', 'Scope to clean: schema | config | mcp | all', 'all') .option('--include-state', 'Also remove state.json (workflow checkpoint). By default state.json is preserved even with --scope=all.', false) .action(options => { const { scope, includeState } = options; const validScopes = ['schema', 'config', 'mcp', 'all']; const finalScope = validScopes.includes(scope !== null && scope !== void 0 ? scope : '') ? scope : 'all'; (0, run_script_1.default)(path_1.default.join(__dirname, '../dispatcher'), [ '--command', types_1.ECommandName.workspace, '--payload', JSON.stringify({ action: 'clean', scope: finalScope, include_state: Boolean(includeState), }), ]); }); } exports.addWorkspaceCommand = addWorkspaceCommand;