@spaceflow/core 0.24.0 → 0.25.0
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
CHANGED
|
@@ -5674,9 +5674,9 @@ var dev_namespaceObject = JSON.parse('{"description":"开发模式 - 监听 skil
|
|
|
5674
5674
|
;// CONCATENATED MODULE: ./src/locales/en/dev.json
|
|
5675
5675
|
var en_dev_namespaceObject = JSON.parse('{"description":"Dev mode - watch and auto-rebuild skill packages","startFailed":"❌ Dev mode failed to start: {{error}}","extensionDescription":"Start plugin dev mode (watch and auto-rebuild)"}')
|
|
5676
5676
|
;// CONCATENATED MODULE: ./src/locales/zh-cn/install.json
|
|
5677
|
-
var install_namespaceObject = JSON.parse('{"description":"安装技能包(支持 npm 包和 git 仓库),不带参数时更新配置文件中的所有 skills","options.name":"指定技能包名称(默认从 source 自动提取)","options.global":"安装到全局目录 (~/.spaceflow) 并关联到全局编辑器目录","options.ignoreErrors":"忽略安装错误,不退出进程","globalNoSource":"❌ 全局安装必须指定 source 参数","globalUsage":" 用法: spaceflow install <source> -g [--name <名称>]","installFailed":"❌ 安装失败: {{error}}","extensionDescription":"安装插件/技能到项目中","envPlaceholder":"<请填写 {{key}}>","registerMcp":" 注册 MCP Server: {{name}}","mcpEnvHint":" ⚠️ 请在 {{path}} 中配置环境变量: {{vars}}","installingExtension":"📦 安装 Extension: {{source}}","installDone":"✅ 安装完成: {{name}}","typeLocal":" 类型: 本地路径","sourcePath":" 源路径: {{path}}","typeGit":" 类型: git 仓库","sourceUrl":" 源: {{url}}","typeNpm":" 类型: npm 包","targetDir":" 目标目录: {{dir}}","extensionInstallFailed":"Extension 安装失败: {{source}}","creatingDir":" 创建目录: {{dir}}","dirExistsSkip":" 目录已存在,跳过克隆","cloningRepo":" 克隆仓库...","cloneFailed":"克隆仓库失败: {{error}}","removingGit":" 移除 .git 目录...","depsLinkExists":" deps 链接已存在,跳过","depsExists":" deps/{{name}} 已存在,跳过","createDepsLink":" 创建 deps 链接: {{dep}} -> {{source}}","skillLinkExists":" skills/{{name}} 链接已存在,跳过","createSkillLink":" 创建 skills 链接: skills/{{name}} -> {{target}}","copySkill":" 复制 skills/{{name}}","globalInstalling":"🔄 全局安装: {{name}} ({{dir}})","pluginTypes":" 插件类型: {{types}}","globalInstallDone":"\\n✅ 全局安装完成","updatingAll":"🔄 更新所有依赖...","noDeps":" 配置文件中没有 dependencies","foundDeps":" 找到 {{count}} 个依赖","installingDeps":"\\n📦 安装依赖...","pmInstallFailed":" 警告: {{pm}} install 失败","depNotInstalled":" ⚠️ {{name}} 未安装成功,跳过","allExtensionsDone":"\\n✅ 所有 Extension 更新完成","updatedPackageJson":" ✓ 更新 .spaceflow/package.json","symlinkExists":" ✓ 符号链接已存在","createSymlink":" 创建符号链接: {{target}} -> {{source}}","createSymlinkFailed":"创建符号链接失败: {{error}}","pullFailed":" 警告: 拉取最新代码失败","checkoutVersion":" 切换到版本: {{ref}}","checkoutFailed":" 警告: 切换版本失败","installingDepsEllipsis":" 安装依赖...","depsInstallFailed":" 警告: 依赖安装失败","depsInstalled":" ✓ 依赖已安装","buildingPlugin":" 构建插件...","buildFailed":" 警告: 构建失败","buildExists":" ✓ 构建已存在","repoExists":" 仓库已存在,更新...","repoUpdateFailed":" 警告: 更新仓库失败","cloneRepoFailed":" 警告: 克隆仓库失败","skillMdExists":" ✓ SKILL.md 已存在","skillMdGenerated":" ✓ 生成 SKILL.md","skillMdFailed":" 警告: 生成 SKILL.md 失败","commandMdGenerated":" ✓ 生成 commands/{{name}}.md","commandMdFailed":" 警告: 生成 commands/{{name}}.md 失败","configUpdated":" 更新配置文件: {{path}}","configAlreadyExists":" 配置文件已包含该技能包","depsUpToDate":" ✓ 依赖已是最新","buildUpToDate":" ✓ 构建已是最新","detailSection":"详细说明","usageSection":"用法","commandDefault":"{{name}} 命令"}')
|
|
5677
|
+
var install_namespaceObject = JSON.parse('{"description":"安装技能包(支持 npm 包和 git 仓库),不带参数时更新配置文件中的所有 skills","options.name":"指定技能包名称(默认从 source 自动提取)","options.global":"安装到全局目录 (~/.spaceflow) 并关联到全局编辑器目录","options.ignoreErrors":"忽略安装错误,不退出进程","globalNoSource":"❌ 全局安装必须指定 source 参数","globalUsage":" 用法: spaceflow install <source> -g [--name <名称>]","installFailed":"❌ 安装失败: {{error}}","extensionDescription":"安装插件/技能到项目中","envPlaceholder":"<请填写 {{key}}>","registerMcp":" 注册 MCP Server: {{name}}","mcpEnvHint":" ⚠️ 请在 {{path}} 中配置环境变量: {{vars}}","installingExtension":"📦 安装 Extension: {{source}}","installDone":"✅ 安装完成: {{name}}","typeLocal":" 类型: 本地路径","sourcePath":" 源路径: {{path}}","typeGit":" 类型: git 仓库","sourceUrl":" 源: {{url}}","typeNpm":" 类型: npm 包","targetDir":" 目标目录: {{dir}}","extensionInstallFailed":"Extension 安装失败: {{source}}","creatingDir":" 创建目录: {{dir}}","dirExistsSkip":" 目录已存在,跳过克隆","cloningRepo":" 克隆仓库...","cloneFailed":"克隆仓库失败: {{error}}","removingGit":" 移除 .git 目录...","depsLinkExists":" deps 链接已存在,跳过","depsExists":" deps/{{name}} 已存在,跳过","createDepsLink":" 创建 deps 链接: {{dep}} -> {{source}}","skillLinkExists":" skills/{{name}} 链接已存在,跳过","createSkillLink":" 创建 skills 链接: skills/{{name}} -> {{target}}","copySkill":" 复制 skills/{{name}}","globalInstalling":"🔄 全局安装: {{name}} ({{dir}})","pluginTypes":" 插件类型: {{types}}","globalInstallDone":"\\n✅ 全局安装完成","updatingAll":"🔄 更新所有依赖...","noDeps":" 配置文件中没有 dependencies","foundDeps":" 找到 {{count}} 个依赖","coreVersionChanged":"📦 @spaceflow/core 版本变更: {{prev}} → {{current}}","installingDeps":"\\n📦 安装依赖...","pmInstallFailed":" 警告: {{pm}} install 失败","depNotInstalled":" ⚠️ {{name}} 未安装成功,跳过","allExtensionsDone":"\\n✅ 所有 Extension 更新完成","updatedPackageJson":" ✓ 更新 .spaceflow/package.json","symlinkExists":" ✓ 符号链接已存在","createSymlink":" 创建符号链接: {{target}} -> {{source}}","createSymlinkFailed":"创建符号链接失败: {{error}}","pullFailed":" 警告: 拉取最新代码失败","checkoutVersion":" 切换到版本: {{ref}}","checkoutFailed":" 警告: 切换版本失败","installingDepsEllipsis":" 安装依赖...","depsInstallFailed":" 警告: 依赖安装失败","depsInstalled":" ✓ 依赖已安装","buildingPlugin":" 构建插件...","buildFailed":" 警告: 构建失败","buildExists":" ✓ 构建已存在","repoExists":" 仓库已存在,更新...","repoUpdateFailed":" 警告: 更新仓库失败","cloneRepoFailed":" 警告: 克隆仓库失败","skillMdExists":" ✓ SKILL.md 已存在","skillMdGenerated":" ✓ 生成 SKILL.md","skillMdFailed":" 警告: 生成 SKILL.md 失败","commandMdGenerated":" ✓ 生成 commands/{{name}}.md","commandMdFailed":" 警告: 生成 commands/{{name}}.md 失败","configUpdated":" 更新配置文件: {{path}}","configAlreadyExists":" 配置文件已包含该技能包","depsUpToDate":" ✓ 依赖已是最新","buildUpToDate":" ✓ 构建已是最新","detailSection":"详细说明","usageSection":"用法","commandDefault":"{{name}} 命令"}')
|
|
5678
5678
|
;// CONCATENATED MODULE: ./src/locales/en/install.json
|
|
5679
|
-
var en_install_namespaceObject = JSON.parse('{"description":"Install skill packages (npm or git), update all skills when no arguments","options.name":"Specify skill package name (auto-detected from source by default)","options.global":"Install to global directory (~/.spaceflow) and link to global editor directories","options.ignoreErrors":"Ignore installation errors without exiting","globalNoSource":"❌ Global install requires a source argument","globalUsage":" Usage: spaceflow install <source> -g [--name <name>]","installFailed":"❌ Installation failed: {{error}}","extensionDescription":"Install plugins/skills to project","envPlaceholder":"<Please fill in {{key}}>","registerMcp":" Register MCP Server: {{name}}","mcpEnvHint":" ⚠️ Please configure environment variables in {{path}}: {{vars}}","installingExtension":"📦 Installing Extension: {{source}}","installDone":"✅ Installation complete: {{name}}","typeLocal":" Type: local path","sourcePath":" Source path: {{path}}","typeGit":" Type: git repository","sourceUrl":" Source: {{url}}","typeNpm":" Type: npm package","targetDir":" Target directory: {{dir}}","extensionInstallFailed":"Extension installation failed: {{source}}","creatingDir":" Creating directory: {{dir}}","dirExistsSkip":" Directory exists, skipping clone","cloningRepo":" Cloning repository...","cloneFailed":"Failed to clone repository: {{error}}","removingGit":" Removing .git directory...","depsLinkExists":" deps link exists, skipping","depsExists":" deps/{{name}} exists, skipping","createDepsLink":" Creating deps link: {{dep}} -> {{source}}","skillLinkExists":" skills/{{name}} link exists, skipping","createSkillLink":" Creating skills link: skills/{{name}} -> {{target}}","copySkill":" Copying skills/{{name}}","globalInstalling":"🔄 Global install: {{name}} ({{dir}})","pluginTypes":" Plugin types: {{types}}","globalInstallDone":"\\n✅ Global installation complete","updatingAll":"🔄 Updating all dependencies...","noDeps":" No dependencies in config file","foundDeps":" Found {{count}} dependencies","installingDeps":"\\n📦 Installing dependencies...","pmInstallFailed":" Warning: {{pm}} install failed","depNotInstalled":" ⚠️ {{name}} not installed successfully, skipping","allExtensionsDone":"\\n✅ All extensions updated","updatedPackageJson":" ✓ Updated .spaceflow/package.json","symlinkExists":" ✓ Symlink already exists","createSymlink":" Creating symlink: {{target}} -> {{source}}","createSymlinkFailed":"Failed to create symlink: {{error}}","pullFailed":" Warning: Failed to pull latest code","checkoutVersion":" Checking out version: {{ref}}","checkoutFailed":" Warning: Failed to checkout version","installingDepsEllipsis":" Installing dependencies...","depsInstallFailed":" Warning: Dependency installation failed","depsInstalled":" ✓ Dependencies installed","buildingPlugin":" Building plugin...","buildFailed":" Warning: Build failed","buildExists":" ✓ Build exists","repoExists":" Repository exists, updating...","repoUpdateFailed":" Warning: Repository update failed","cloneRepoFailed":" Warning: Clone repository failed","skillMdExists":" ✓ SKILL.md already exists","skillMdGenerated":" ✓ Generated SKILL.md","skillMdFailed":" Warning: Failed to generate SKILL.md","commandMdGenerated":" ✓ Generated commands/{{name}}.md","commandMdFailed":" Warning: Failed to generate commands/{{name}}.md","configUpdated":" Config updated: {{path}}","configAlreadyExists":" Config already contains this skill package","depsUpToDate":" ✓ Dependencies are up to date","buildUpToDate":" ✓ Build is up to date","detailSection":"Details","usageSection":"Usage","commandDefault":"{{name}} command"}')
|
|
5679
|
+
var en_install_namespaceObject = JSON.parse('{"description":"Install skill packages (npm or git), update all skills when no arguments","options.name":"Specify skill package name (auto-detected from source by default)","options.global":"Install to global directory (~/.spaceflow) and link to global editor directories","options.ignoreErrors":"Ignore installation errors without exiting","globalNoSource":"❌ Global install requires a source argument","globalUsage":" Usage: spaceflow install <source> -g [--name <name>]","installFailed":"❌ Installation failed: {{error}}","extensionDescription":"Install plugins/skills to project","envPlaceholder":"<Please fill in {{key}}>","registerMcp":" Register MCP Server: {{name}}","mcpEnvHint":" ⚠️ Please configure environment variables in {{path}}: {{vars}}","installingExtension":"📦 Installing Extension: {{source}}","installDone":"✅ Installation complete: {{name}}","typeLocal":" Type: local path","sourcePath":" Source path: {{path}}","typeGit":" Type: git repository","sourceUrl":" Source: {{url}}","typeNpm":" Type: npm package","targetDir":" Target directory: {{dir}}","extensionInstallFailed":"Extension installation failed: {{source}}","creatingDir":" Creating directory: {{dir}}","dirExistsSkip":" Directory exists, skipping clone","cloningRepo":" Cloning repository...","cloneFailed":"Failed to clone repository: {{error}}","removingGit":" Removing .git directory...","depsLinkExists":" deps link exists, skipping","depsExists":" deps/{{name}} exists, skipping","createDepsLink":" Creating deps link: {{dep}} -> {{source}}","skillLinkExists":" skills/{{name}} link exists, skipping","createSkillLink":" Creating skills link: skills/{{name}} -> {{target}}","copySkill":" Copying skills/{{name}}","globalInstalling":"🔄 Global install: {{name}} ({{dir}})","pluginTypes":" Plugin types: {{types}}","globalInstallDone":"\\n✅ Global installation complete","updatingAll":"🔄 Updating all dependencies...","noDeps":" No dependencies in config file","foundDeps":" Found {{count}} dependencies","coreVersionChanged":"📦 @spaceflow/core version changed: {{prev}} → {{current}}","installingDeps":"\\n📦 Installing dependencies...","pmInstallFailed":" Warning: {{pm}} install failed","depNotInstalled":" ⚠️ {{name}} not installed successfully, skipping","allExtensionsDone":"\\n✅ All extensions updated","updatedPackageJson":" ✓ Updated .spaceflow/package.json","symlinkExists":" ✓ Symlink already exists","createSymlink":" Creating symlink: {{target}} -> {{source}}","createSymlinkFailed":"Failed to create symlink: {{error}}","pullFailed":" Warning: Failed to pull latest code","checkoutVersion":" Checking out version: {{ref}}","checkoutFailed":" Warning: Failed to checkout version","installingDepsEllipsis":" Installing dependencies...","depsInstallFailed":" Warning: Dependency installation failed","depsInstalled":" ✓ Dependencies installed","buildingPlugin":" Building plugin...","buildFailed":" Warning: Build failed","buildExists":" ✓ Build exists","repoExists":" Repository exists, updating...","repoUpdateFailed":" Warning: Repository update failed","cloneRepoFailed":" Warning: Clone repository failed","skillMdExists":" ✓ SKILL.md already exists","skillMdGenerated":" ✓ Generated SKILL.md","skillMdFailed":" Warning: Failed to generate SKILL.md","commandMdGenerated":" ✓ Generated commands/{{name}}.md","commandMdFailed":" Warning: Failed to generate commands/{{name}}.md","configUpdated":" Config updated: {{path}}","configAlreadyExists":" Config already contains this skill package","depsUpToDate":" ✓ Dependencies are up to date","buildUpToDate":" ✓ Build is up to date","detailSection":"Details","usageSection":"Usage","commandDefault":"{{name}} command"}')
|
|
5680
5680
|
;// CONCATENATED MODULE: ./src/locales/zh-cn/list.json
|
|
5681
5681
|
var list_namespaceObject = JSON.parse('{"description":"列出已安装的技能包","extensionDescription":"列出已安装的插件/技能","noSkills":"📦 没有已安装的技能包","installHint":"使用以下命令安装技能包:","installedExtensions":"📦 已安装的扩展 ({{installed}}/{{total}}):","commands":"命令: {{commands}}"}')
|
|
5682
5682
|
;// CONCATENATED MODULE: ./src/locales/en/list.json
|
|
@@ -9161,9 +9161,30 @@ class InstallService {
|
|
|
9161
9161
|
if (shouldLog(verbose, 1)) console.log(i18n_t("install:foundDeps", {
|
|
9162
9162
|
count: Object.keys(dependencies).length
|
|
9163
9163
|
}));
|
|
9164
|
-
// 1.
|
|
9164
|
+
// 1. 记录更新前的 @spaceflow/core 版本
|
|
9165
|
+
const spaceflowPkgPath = (0,external_path_.join)(spaceflowDir, "package.json");
|
|
9166
|
+
let prevCoreVersion;
|
|
9167
|
+
if (existsSync(spaceflowPkgPath)) {
|
|
9168
|
+
try {
|
|
9169
|
+
const prevPkg = JSON.parse(await (0,promises_.readFile)(spaceflowPkgPath, "utf-8"));
|
|
9170
|
+
prevCoreVersion = prevPkg.dependencies?.["@spaceflow/core"];
|
|
9171
|
+
} catch {
|
|
9172
|
+
// ignore
|
|
9173
|
+
}
|
|
9174
|
+
}
|
|
9175
|
+
// 2. 更新 .spaceflow/package.json 中的所有依赖
|
|
9165
9176
|
await this.updateSpaceflowPackageJson(dependencies, spaceflowDir, verbose);
|
|
9166
|
-
//
|
|
9177
|
+
// 3. 版本变更提示
|
|
9178
|
+
const currentCoreVersion = getSpaceflowCoreVersion();
|
|
9179
|
+
if (prevCoreVersion && prevCoreVersion !== currentCoreVersion) {
|
|
9180
|
+
if (shouldLog(verbose, 1)) {
|
|
9181
|
+
console.log(i18n_t("install:coreVersionChanged", {
|
|
9182
|
+
prev: prevCoreVersion,
|
|
9183
|
+
current: currentCoreVersion
|
|
9184
|
+
}));
|
|
9185
|
+
}
|
|
9186
|
+
}
|
|
9187
|
+
// 4. 安装所有依赖
|
|
9167
9188
|
if (shouldLog(verbose, 1)) console.log(i18n_t("install:installingDeps"));
|
|
9168
9189
|
const pm = detectPackageManager(spaceflowDir);
|
|
9169
9190
|
try {
|
|
@@ -9176,7 +9197,7 @@ class InstallService {
|
|
|
9176
9197
|
pm
|
|
9177
9198
|
}));
|
|
9178
9199
|
}
|
|
9179
|
-
//
|
|
9200
|
+
// 5. 处理每个依赖的 skills/commands 关联
|
|
9180
9201
|
for (const [name, config] of Object.entries(dependencies)){
|
|
9181
9202
|
const { source } = this.parseExtensionConfig(config);
|
|
9182
9203
|
const sourceType = getSourceType(source);
|
|
@@ -11619,7 +11640,7 @@ async function exec(extensions = [], options = {}) {
|
|
|
11619
11640
|
// 6. 创建 CLI 程序
|
|
11620
11641
|
const program = new Command();
|
|
11621
11642
|
const cliVersion = options.cliVersion || "0.0.0";
|
|
11622
|
-
const coreVersion = true ? "0.
|
|
11643
|
+
const coreVersion = true ? "0.25.0" : 0;
|
|
11623
11644
|
const versionOutput = `spaceflow/${cliVersion} core/${coreVersion}`;
|
|
11624
11645
|
program.name("spaceflow").description("Spaceflow CLI").version(versionOutput, "-V, --version", "显示版本信息");
|
|
11625
11646
|
// 定义全局 verbose 选项(支持计数:-v, -vv, -vvv)
|