@lark-apaas/miaoda-cli 0.1.7-alpha.eb0aa5c → 0.1.7-beta.8880029
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/api/deploy/schemas.js +3 -0
- package/dist/cli/commands/app/index.js +2 -7
- package/dist/cli/commands/skills/index.js +6 -6
- package/dist/cli/handlers/app/init.js +7 -2
- package/dist/cli/handlers/app/sync.js +49 -3
- package/dist/cli/handlers/plugin/plugin-local.js +1 -1
- package/dist/cli/handlers/skills/sync.js +8 -11
- package/dist/services/app/init/install.js +11 -2
- package/dist/utils/githooks.js +18 -0
- package/package.json +3 -2
- package/upgrade/templates/design-stack/templates/scripts/dev-local.js +2 -1
- package/upgrade/templates/design-stack/templates/scripts/dev.sh +0 -1
- package/upgrade/templates/nestjs-react-fullstack/templates/scripts/dev-local.js +4 -2
- package/upgrade/templates/nestjs-react-fullstack/templates/scripts/dev.sh +0 -1
|
@@ -19,6 +19,9 @@ function nodeStatusText(v) {
|
|
|
19
19
|
return v;
|
|
20
20
|
if (typeof v !== 'number')
|
|
21
21
|
return undefined;
|
|
22
|
+
// `number` 不在 `NodeStatus` 枚举键集时,TS Partial<Record<NodeStatus,_>> 推断
|
|
23
|
+
// 出来类型不友好(eslint 报 unsafe-return);cast 到 Record<number,string|undefined>
|
|
24
|
+
// 等价安全访问。
|
|
22
25
|
return NODE_STATUS_TEXT[v];
|
|
23
26
|
}
|
|
24
27
|
/** NodeStatus 文本(CLI flag 字符串)→ 枚举数值 */
|
|
@@ -121,7 +121,7 @@ function registerAppInit(parent) {
|
|
|
121
121
|
.command('init')
|
|
122
122
|
.description('初始化应用代码:抓 template 渲染、同步 upgrade/templates、装 .agent/steering/ skills、写 .spark/meta.json。.spark/meta.json 已存在则直接退出')
|
|
123
123
|
.option('--template <stack>', `技术栈短名(${index_1.SUPPORTED_STACKS.join(' / ')})`)
|
|
124
|
-
.option('--conf <json>', 'init 配置 JSON。支持 {"version": "<template 版本>"}
|
|
124
|
+
.option('--conf <json>', 'init 配置 JSON。支持 {"version": "<template 版本>"},默认 latest')
|
|
125
125
|
.option('--skip-install', '跳过依赖安装', false)
|
|
126
126
|
.addOption((0, shared_1.appIdOption)())
|
|
127
127
|
.addHelpText('after', `
|
|
@@ -161,7 +161,6 @@ JSON 输出
|
|
|
161
161
|
$ miaoda app init --template vite-react
|
|
162
162
|
$ miaoda app init --template nestjs-react-fullstack --app-id app_xxx
|
|
163
163
|
$ miaoda app init --template vite-react --conf '{"version": "0.1.0"}'
|
|
164
|
-
$ miaoda app init --template vite-react --conf '{"steeringVersion": "0.1.0"}'
|
|
165
164
|
$ miaoda app init --template vite-react --skip-install
|
|
166
165
|
$ MIAODA_DEP_CACHE_DIR=/tmp/dep-cache miaoda app init --template vite-react
|
|
167
166
|
`);
|
|
@@ -193,11 +192,7 @@ function parseInitConf(raw) {
|
|
|
193
192
|
if (version !== undefined && typeof version !== 'string') {
|
|
194
193
|
throw new error_1.AppError('ARGS_INVALID', '--conf.version 必须是字符串');
|
|
195
194
|
}
|
|
196
|
-
|
|
197
|
-
if (steeringVersion !== undefined && typeof steeringVersion !== 'string') {
|
|
198
|
-
throw new error_1.AppError('ARGS_INVALID', '--conf.steeringVersion 必须是字符串');
|
|
199
|
-
}
|
|
200
|
-
return { version, steeringVersion };
|
|
195
|
+
return { version };
|
|
201
196
|
}
|
|
202
197
|
function isPlainObject(v) {
|
|
203
198
|
return typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
@@ -22,8 +22,8 @@ function registerSkillsSync(parent) {
|
|
|
22
22
|
const cmd = parent
|
|
23
23
|
.command('sync')
|
|
24
24
|
.description('同步 coding-steering(latest 或指定版本)到 user app')
|
|
25
|
-
.argument('[version]', 'coding-steering 包版本或 dist-tag,缺省 latest')
|
|
26
25
|
.option('--dir <path>', '项目目录,默认当前目录', '.')
|
|
26
|
+
.option('--version <ver>', 'coding-steering 包版本或 dist-tag,缺省 latest')
|
|
27
27
|
.option('--local', '走本地 dev / agent 输出形态:拷到 .agents/skills 平铺 + 创建 .claude/skills 软链。' +
|
|
28
28
|
'不传时退回老形态:拷到 .agent/skills/steering/<stack>/skills/(跟沙箱端 update-skills.sh 对齐)', false)
|
|
29
29
|
.addHelpText('after', `
|
|
@@ -46,15 +46,15 @@ JSON 输出
|
|
|
46
46
|
"claudeSkillsLink": "created|updated|noop|conflict" // 仅 --local 时}}
|
|
47
47
|
|
|
48
48
|
示例
|
|
49
|
-
$ miaoda skills sync
|
|
50
|
-
$ miaoda skills sync --local
|
|
51
|
-
$ miaoda skills sync 0.2.0
|
|
49
|
+
$ miaoda skills sync # 拉 @latest
|
|
50
|
+
$ miaoda skills sync --local # 本地 dev / agent 用
|
|
51
|
+
$ miaoda skills sync --version 0.2.0 # 显式指定版本
|
|
52
52
|
$ miaoda skills sync --dir ./my-app
|
|
53
53
|
`);
|
|
54
|
-
cmd.action((0, shared_1.withHelp)(cmd, async (
|
|
54
|
+
cmd.action((0, shared_1.withHelp)(cmd, async (rawOpts) => {
|
|
55
55
|
await (0, index_1.handleSkillsSync)({
|
|
56
56
|
dir: rawOpts.dir,
|
|
57
|
-
version,
|
|
57
|
+
version: rawOpts.version,
|
|
58
58
|
local: rawOpts.local,
|
|
59
59
|
});
|
|
60
60
|
}));
|
|
@@ -64,14 +64,20 @@ async function handleAppInit(opts) {
|
|
|
64
64
|
const upgradedPackages = (0, sync_1.upgradePlatformDeps)(targetDir, 'init');
|
|
65
65
|
// skills 同步软失败:拉不到 coding-steering 包不该阻断 writeSparkMeta /
|
|
66
66
|
// activateGitHooks(之前会让 .spark/meta.json 没写,下次 init 半渲染状态又得重跑全套)。
|
|
67
|
+
// 按 stack 分流 outputLayout:
|
|
68
|
+
// - nestjs-react-fullstack:本地主战场,用 flat 布局
|
|
69
|
+
// (.agents/skills + .claude/skills 软链),不再创建 .agent/ 老目录
|
|
70
|
+
// - 其他 stack:仍走默认 nested (.agent/skills/steering/<stack>/skills/),
|
|
71
|
+
// 跟沙箱端 update-skills.sh 老链路对齐,避免破坏
|
|
72
|
+
const outputLayout = stack === 'nestjs-react-fullstack' ? 'flat' : 'nested';
|
|
67
73
|
let steeringResult;
|
|
68
74
|
let steeringError;
|
|
69
75
|
try {
|
|
70
76
|
steeringResult = (0, coding_steering_1.syncCodingSteering)({
|
|
71
77
|
stack,
|
|
72
78
|
targetDir,
|
|
73
|
-
version: opts.conf?.steeringVersion,
|
|
74
79
|
logPrefix: 'init',
|
|
80
|
+
outputLayout,
|
|
75
81
|
});
|
|
76
82
|
}
|
|
77
83
|
catch (err) {
|
|
@@ -91,7 +97,6 @@ async function handleAppInit(opts) {
|
|
|
91
97
|
version: tplResult.version,
|
|
92
98
|
archType: tplResult.archType,
|
|
93
99
|
app_id: opts.appId,
|
|
94
|
-
steeringVersion: steeringResult.version,
|
|
95
100
|
});
|
|
96
101
|
const syncedSummary = syncRunResult.stackFound
|
|
97
102
|
? syncRunResult.rulesApplied.length > 0
|
|
@@ -7,6 +7,7 @@ exports.handleAppUpgrade = void 0;
|
|
|
7
7
|
exports.handleAppSync = handleAppSync;
|
|
8
8
|
exports.runStackSync = runStackSync;
|
|
9
9
|
exports.summarizeSyncResults = summarizeSyncResults;
|
|
10
|
+
exports.listManagedDeps = listManagedDeps;
|
|
10
11
|
exports.upgradePlatformDeps = upgradePlatformDeps;
|
|
11
12
|
const node_child_process_1 = require("node:child_process");
|
|
12
13
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
@@ -15,6 +16,7 @@ const sync_configs_1 = require("../../../config/sync-configs");
|
|
|
15
16
|
const sync_rule_1 = require("../../../utils/sync-rule");
|
|
16
17
|
const platform_sync_1 = require("../../../utils/platform-sync");
|
|
17
18
|
const githooks_1 = require("../../../utils/githooks");
|
|
19
|
+
const install_1 = require("../../../services/app/init/install");
|
|
18
20
|
const spark_meta_1 = require("../../../utils/spark-meta");
|
|
19
21
|
const error_1 = require("../../../utils/error");
|
|
20
22
|
const output_1 = require("../../../utils/output");
|
|
@@ -81,11 +83,32 @@ async function handleAppSync(opts) {
|
|
|
81
83
|
const upgradedPackages = upgradePlatformDeps(targetDir, 'sync');
|
|
82
84
|
// 3. activate git hooks(template 自带 .githooks/pre-commit,core.hooksPath 一次性设置)
|
|
83
85
|
const hookActivation = (0, githooks_1.activateGitHooks)(targetDir);
|
|
84
|
-
// 4. npm install —— 跟 init
|
|
85
|
-
|
|
86
|
+
// 4. npm install —— 跟 init 一样软失败,install 挂了不该阻断 emit / sync 总结输出。
|
|
87
|
+
// 把 user app 装着的**所有**管控包显式作为位置参数传给 npm install,强制 npm 重新
|
|
88
|
+
// resolve lockfile entry。原因:
|
|
89
|
+
// - 即便 package.json spec 已经是 "latest"(没有 from→to 变化),user app 老 lockfile
|
|
90
|
+
// 可能锁着具体老版本 (如 fullstack-vite-preset@1.0.9),纯 `npm install` 会按 lockfile
|
|
91
|
+
// 拉老版,绕过 spec "latest" 的解析意图
|
|
92
|
+
// - 显式 `npm install foo@latest bar@latest` 让 npm 重新解析,lockfile 跟着更新到当前 latest
|
|
93
|
+
// - 没装的管控包不动 (sync 的职责是对齐,不是塞依赖)
|
|
94
|
+
// --ignore-scripts 绕开 action-plugin postinstall 在缺平台 env 时的 ENOENT。
|
|
95
|
+
// --registry 跟 init 钉同一份 npmmirror,避免 user 全局 ~/.npmrc 把 sync 拉到另一个源
|
|
96
|
+
// (详见 services/app/init/install.ts 上的注释)。MIAODA_NPM_REGISTRY env 兜底。
|
|
97
|
+
const installArgs = [
|
|
98
|
+
'install',
|
|
99
|
+
'--no-audit',
|
|
100
|
+
'--no-fund',
|
|
101
|
+
'--ignore-scripts',
|
|
102
|
+
'--registry',
|
|
103
|
+
(0, install_1.resolveNpmInstallRegistry)(),
|
|
104
|
+
];
|
|
105
|
+
for (const name of listManagedDeps(targetDir)) {
|
|
106
|
+
installArgs.push(`${name}@${MANAGED_PLATFORM_PACKAGES[name]}`);
|
|
107
|
+
}
|
|
108
|
+
(0, logger_1.log)('sync', `Running npm ${installArgs.join(' ')}...`);
|
|
86
109
|
let installError;
|
|
87
110
|
try {
|
|
88
|
-
(0, node_child_process_1.execFileSync)('npm',
|
|
111
|
+
(0, node_child_process_1.execFileSync)('npm', installArgs, {
|
|
89
112
|
cwd: targetDir,
|
|
90
113
|
stdio: (0, output_1.isJsonMode)() ? ['ignore', 'ignore', 'inherit'] : 'inherit',
|
|
91
114
|
});
|
|
@@ -180,6 +203,29 @@ function readPackageJson(pkgJsonPath) {
|
|
|
180
203
|
return null;
|
|
181
204
|
return JSON.parse(node_fs_1.default.readFileSync(pkgJsonPath, 'utf-8'));
|
|
182
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* 列出 user app 装着的 @lark-apaas/* 管控包 (在 MANAGED_PLATFORM_PACKAGES 白名单内的)。
|
|
208
|
+
* sync handler 用来给 `npm install` 显式列管控包名 + @latest,强制 npm 重新 resolve
|
|
209
|
+
* lockfile entry —— 即便 package.json spec 已经是 "latest" 没 from→to 变化,
|
|
210
|
+
* 老 lockfile 锁的具体老版本(如 fullstack-vite-preset@1.0.9)也会被刷掉。
|
|
211
|
+
*/
|
|
212
|
+
function listManagedDeps(targetDir) {
|
|
213
|
+
const pkg = readPackageJson(node_path_1.default.join(targetDir, 'package.json'));
|
|
214
|
+
if (!pkg)
|
|
215
|
+
return [];
|
|
216
|
+
const names = new Set();
|
|
217
|
+
for (const section of ['dependencies', 'devDependencies']) {
|
|
218
|
+
const deps = pkg[section];
|
|
219
|
+
if (!deps || typeof deps !== 'object')
|
|
220
|
+
continue;
|
|
221
|
+
for (const name of Object.keys(deps)) {
|
|
222
|
+
if (Object.prototype.hasOwnProperty.call(MANAGED_PLATFORM_PACKAGES, name)) {
|
|
223
|
+
names.add(name);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return [...names];
|
|
228
|
+
}
|
|
183
229
|
/**
|
|
184
230
|
* 把 user app package.json 里已装的 @lark-apaas/* 平台包改写成 MANAGED_PLATFORM_PACKAGES
|
|
185
231
|
* 表里的目标 spec(缺省 `"latest"`)。由 `miaoda app sync` 和 `miaoda app init`(template
|
|
@@ -76,7 +76,7 @@ function parsePluginName(input) {
|
|
|
76
76
|
if (!match) {
|
|
77
77
|
throw new error_1.AppError('INVALID_PLUGIN_NAME', `Invalid plugin name format: ${input}. Expected: @scope/name or @scope/name@version`, { next_actions: ['示例:@demo/example-plugin 或 @demo/example-plugin@1.2.3'] });
|
|
78
78
|
}
|
|
79
|
-
return { name: match[1], version: match[2]
|
|
79
|
+
return { name: match[1], version: match[2] || 'latest' };
|
|
80
80
|
}
|
|
81
81
|
// ── package.json actionPlugins CRUD ──
|
|
82
82
|
function readPackageJson() {
|
|
@@ -10,10 +10,13 @@ const spark_meta_1 = require("../../../utils/spark-meta");
|
|
|
10
10
|
const error_1 = require("../../../utils/error");
|
|
11
11
|
const output_1 = require("../../../utils/output");
|
|
12
12
|
/**
|
|
13
|
-
* miaoda skills sync [
|
|
13
|
+
* miaoda skills sync [--dir <path>] [--version <ver>]
|
|
14
14
|
*
|
|
15
|
-
* 从 .spark/meta.json 读 stack
|
|
16
|
-
*
|
|
15
|
+
* 从 .spark/meta.json 读 stack,把 coding-steering 包内对应 stack 的 skills + tech.md
|
|
16
|
+
* 同步到 <dir>/.agent/steering/。需要先跑过 `miaoda app init`。
|
|
17
|
+
*
|
|
18
|
+
* 版本来源:CLI `--version` flag 或默认 `latest`。**不读 meta.json**——steering 版本
|
|
19
|
+
* 不在 meta 里钉,每次 sync 都跟随 `--version` 显式传或退回 @latest。
|
|
17
20
|
*/
|
|
18
21
|
async function handleSkillsSync(opts) {
|
|
19
22
|
await Promise.resolve();
|
|
@@ -22,23 +25,17 @@ async function handleSkillsSync(opts) {
|
|
|
22
25
|
if (meta.stack === undefined || meta.stack === '') {
|
|
23
26
|
throw new error_1.AppError('SKILLS_META_INCOMPLETE', '.spark/meta.json missing stack — run `miaoda app init` first');
|
|
24
27
|
}
|
|
25
|
-
const version = opts.version ?? meta.steeringVersion;
|
|
26
|
-
const versionSource = opts.version
|
|
27
|
-
? 'cli-arg'
|
|
28
|
-
: meta.steeringVersion
|
|
29
|
-
? 'meta.json'
|
|
30
|
-
: 'default-latest';
|
|
31
28
|
const result = (0, coding_steering_1.syncCodingSteering)({
|
|
32
29
|
stack: meta.stack,
|
|
33
30
|
targetDir,
|
|
34
|
-
version,
|
|
31
|
+
version: opts.version,
|
|
35
32
|
outputLayout: opts.local === true ? 'flat' : 'nested',
|
|
36
33
|
});
|
|
37
34
|
(0, output_1.emit)({
|
|
38
35
|
data: {
|
|
39
36
|
stack: meta.stack,
|
|
40
37
|
version: result.version,
|
|
41
|
-
versionSource,
|
|
38
|
+
versionSource: opts.version !== undefined ? 'cli-arg' : 'default-latest',
|
|
42
39
|
syncedSkills: result.syncedSkills,
|
|
43
40
|
techSynced: result.techSynced,
|
|
44
41
|
...(result.claudeSkillsLink !== undefined
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.installDependencies = installDependencies;
|
|
7
|
+
exports.resolveNpmInstallRegistry = resolveNpmInstallRegistry;
|
|
7
8
|
const node_child_process_1 = require("node:child_process");
|
|
8
9
|
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
9
10
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
@@ -111,12 +112,20 @@ function extractZip(zipPath, targetDir, stdio) {
|
|
|
111
112
|
* - 字节内网 DNS 会把 npmmirror 域名透明指向公司镜像,外网就是公网阿里源;同一行配置
|
|
112
113
|
* 在两套环境都拉得到 @lark-apaas/* 私包(内网经公司镜像,外网经阿里同步过去的副本)。
|
|
113
114
|
* - 留 `MIAODA_NPM_REGISTRY` env 应急覆盖。
|
|
115
|
+
*
|
|
116
|
+
* `miaoda app sync` 也用同款规则,通过 resolveNpmInstallRegistry() 共享。
|
|
114
117
|
*/
|
|
115
118
|
const NPM_INSTALL_REGISTRY_DEFAULT = 'https://registry.npmmirror.com/';
|
|
119
|
+
/**
|
|
120
|
+
* 解析 miaoda 内部 npm install 命令使用的 registry。init / sync 共用。
|
|
121
|
+
* 优先级:`MIAODA_NPM_REGISTRY` env > `NPM_INSTALL_REGISTRY_DEFAULT`。
|
|
122
|
+
*/
|
|
123
|
+
function resolveNpmInstallRegistry() {
|
|
124
|
+
return process.env.MIAODA_NPM_REGISTRY ?? NPM_INSTALL_REGISTRY_DEFAULT;
|
|
125
|
+
}
|
|
116
126
|
function runNpmInstall(targetDir, stdio) {
|
|
117
127
|
(0, logger_1.log)('init', `npm install in ${targetDir}...`);
|
|
118
|
-
|
|
119
|
-
(0, node_child_process_1.execFileSync)('npm', ['install', '--no-audit', '--no-fund', '--registry', registry], {
|
|
128
|
+
(0, node_child_process_1.execFileSync)('npm', ['install', '--no-audit', '--no-fund', '--registry', resolveNpmInstallRegistry()], {
|
|
120
129
|
cwd: targetDir,
|
|
121
130
|
stdio,
|
|
122
131
|
});
|
package/dist/utils/githooks.js
CHANGED
|
@@ -8,6 +8,21 @@ const node_fs_1 = __importDefault(require("node:fs"));
|
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const node_child_process_1 = require("node:child_process");
|
|
10
10
|
const logger_1 = require("../utils/logger");
|
|
11
|
+
const GIT_LEAKED_ENV_KEYS = new Set([
|
|
12
|
+
'GIT_DIR',
|
|
13
|
+
'GIT_WORK_TREE',
|
|
14
|
+
'GIT_INDEX_FILE',
|
|
15
|
+
'GIT_COMMON_DIR',
|
|
16
|
+
'GIT_PREFIX',
|
|
17
|
+
'GIT_OBJECT_DIRECTORY',
|
|
18
|
+
'GIT_ALTERNATE_OBJECT_DIRECTORIES',
|
|
19
|
+
'GIT_CONFIG',
|
|
20
|
+
'GIT_CONFIG_PARAMETERS',
|
|
21
|
+
'GIT_CONFIG_COUNT',
|
|
22
|
+
]);
|
|
23
|
+
function envWithoutGitLeaks() {
|
|
24
|
+
return Object.fromEntries(Object.entries(process.env).filter(([key]) => !GIT_LEAKED_ENV_KEYS.has(key)));
|
|
25
|
+
}
|
|
11
26
|
/**
|
|
12
27
|
* 把 `.githooks/` 注册为本仓库的 git hooks 目录,让 pre-commit 等 hook 立即生效。
|
|
13
28
|
*
|
|
@@ -33,8 +48,10 @@ function activateGitHooks(targetDir) {
|
|
|
33
48
|
if ((currentMode & 0o111) !== 0o111) {
|
|
34
49
|
node_fs_1.default.chmodSync(hookFile, 0o755);
|
|
35
50
|
}
|
|
51
|
+
const env = envWithoutGitLeaks();
|
|
36
52
|
const probe = (0, node_child_process_1.spawnSync)('git', ['config', '--get', 'core.hooksPath'], {
|
|
37
53
|
cwd: targetDir,
|
|
54
|
+
env,
|
|
38
55
|
stdio: ['ignore', 'pipe', 'ignore'],
|
|
39
56
|
});
|
|
40
57
|
const currentHooksPath = probe.stdout.toString().trim();
|
|
@@ -43,6 +60,7 @@ function activateGitHooks(targetDir) {
|
|
|
43
60
|
}
|
|
44
61
|
const res = (0, node_child_process_1.spawnSync)('git', ['config', 'core.hooksPath', '.githooks'], {
|
|
45
62
|
cwd: targetDir,
|
|
63
|
+
env,
|
|
46
64
|
stdio: ['ignore', 'ignore', 'pipe'],
|
|
47
65
|
});
|
|
48
66
|
if (res.status !== 0) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/miaoda-cli",
|
|
3
|
-
"version": "0.1.7-
|
|
3
|
+
"version": "0.1.7-beta.8880029",
|
|
4
4
|
"description": "Miaoda 平台命令行工具,面向 Agent 调用",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
7
7
|
"miaoda": "bin/miaoda.js"
|
|
8
8
|
},
|
|
9
9
|
"publishConfig": {
|
|
10
|
-
"access": "public"
|
|
10
|
+
"access": "public",
|
|
11
|
+
"registry": "https://registry.npmjs.org/"
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
14
|
"LICENSE",
|
|
@@ -47,9 +47,10 @@ if (hasLarkCli) {
|
|
|
47
47
|
warn('lark-cli 未安装,跳过 env pull;请确保 .env.local 已就绪');
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
// skills sync —— --local 切 flat layout;不传 --version,handler 默认 coding-steering@latest。
|
|
50
51
|
console.log('[dev-local] (2/4) miaoda skills sync...');
|
|
51
52
|
try {
|
|
52
|
-
execSync('npx -y @lark-apaas/miaoda-cli@latest skills sync', { stdio: 'inherit' });
|
|
53
|
+
execSync('npx -y @lark-apaas/miaoda-cli@latest skills sync --local', { stdio: 'inherit' });
|
|
53
54
|
} catch {
|
|
54
55
|
console.log(' (skills sync 失败,继续启动)');
|
|
55
56
|
}
|
|
@@ -19,7 +19,6 @@ fi
|
|
|
19
19
|
|
|
20
20
|
# 本地启动前先跑一次 miaoda app sync:同步 platform-controlled 内容 + 升 @lark-apaas/* 到
|
|
21
21
|
# latest + 迁移老 npm scripts。沙箱不走这里(SANDBOX_ID 分支已经 exec return)。
|
|
22
|
-
# 走 npx 不依赖用户全局装 miaoda;跟 latest dist-tag。
|
|
23
22
|
npx -y @lark-apaas/miaoda-cli@latest app sync || echo "[dev] miaoda app sync 失败,按现状继续" >&2
|
|
24
23
|
|
|
25
24
|
exec node "$SCRIPT_DIR/dev-local.js" "$@"
|
|
@@ -55,10 +55,12 @@ if (hasLarkCli) {
|
|
|
55
55
|
warn('lark-cli 未安装,跳过 env pull;请确保 .env.local 已就绪');
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
// 2. skills sync
|
|
58
|
+
// 2. skills sync —— --local 切到 flat layout (.agents/skills + .claude/skills 软链),
|
|
59
|
+
// 跟沙箱 nested layout 区分。不传 --version,handler 默认拉 coding-steering@latest,
|
|
60
|
+
// 保证每次本地 npm run dev 都把 skills 升到最新。
|
|
59
61
|
console.log('[dev-local] (2/4) miaoda skills sync...');
|
|
60
62
|
try {
|
|
61
|
-
execSync('npx -y @lark-apaas/miaoda-cli@latest skills sync', { stdio: 'inherit' });
|
|
63
|
+
execSync('npx -y @lark-apaas/miaoda-cli@latest skills sync --local', { stdio: 'inherit' });
|
|
62
64
|
} catch {
|
|
63
65
|
console.log(' (skills sync 失败,继续启动)');
|
|
64
66
|
}
|
|
@@ -19,7 +19,6 @@ fi
|
|
|
19
19
|
|
|
20
20
|
# 本地启动前先跑一次 miaoda app sync:同步 platform-controlled 内容 + 升 @lark-apaas/* 到
|
|
21
21
|
# latest + 迁移老 npm scripts。沙箱不走这里(SANDBOX_ID 分支已经 exec return)。
|
|
22
|
-
# 走 npx 不依赖用户全局装 miaoda;跟 latest dist-tag。
|
|
23
22
|
npx -y @lark-apaas/miaoda-cli@latest app sync || echo "[dev] miaoda app sync 失败,按现状继续" >&2
|
|
24
23
|
|
|
25
24
|
exec node "$SCRIPT_DIR/dev-local.js" "$@"
|