@siming-org/cli 0.7.1 → 0.7.2
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 +25 -9
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3682,9 +3682,26 @@ import { Command as Command5 } from "commander";
|
|
|
3682
3682
|
function createDagCommand() {
|
|
3683
3683
|
const dag = new Command5("dag").description("DAG template & instance management");
|
|
3684
3684
|
const tpl = dag.command("template").description("DAG template management");
|
|
3685
|
-
withCommonOpts(tpl.command("list"), "table").option("--project <id>", "filter by
|
|
3685
|
+
withCommonOpts(tpl.command("list"), "table").option("--project <key|id>", "filter by project (key or id; defaults to workspace defaultProject)").description("List DAG templates (summary projection: node labels only, no prompts \u2014 use `show` for full detail)").action(async (opts) => {
|
|
3686
3686
|
const client = createClient(opts.url);
|
|
3687
|
-
const
|
|
3687
|
+
const projectOpt = opts.project ?? readWorkspaceConfig()?.defaultProject;
|
|
3688
|
+
let projectId;
|
|
3689
|
+
if (projectOpt !== void 0) {
|
|
3690
|
+
const r = await resolveProjectId(client, projectOpt);
|
|
3691
|
+
if (!r.success) {
|
|
3692
|
+
if (opts.project === void 0) {
|
|
3693
|
+
renderResult(opts.format, fail({
|
|
3694
|
+
...r.error,
|
|
3695
|
+
hint: `workspace defaultProject "${projectOpt}" \u89E3\u6790\u5931\u8D25\u2014\u2014siming config unset defaultProject \u540E\u91CD\u8BD5\uFF0C\u6216\u663E\u5F0F --project <key|id>`
|
|
3696
|
+
}));
|
|
3697
|
+
} else {
|
|
3698
|
+
renderResult(opts.format, r);
|
|
3699
|
+
}
|
|
3700
|
+
return;
|
|
3701
|
+
}
|
|
3702
|
+
projectId = r.data;
|
|
3703
|
+
}
|
|
3704
|
+
const result = await handleListTemplates(client, projectId);
|
|
3688
3705
|
if (!result.success) {
|
|
3689
3706
|
renderResult(opts.format, result);
|
|
3690
3707
|
return;
|
|
@@ -4775,7 +4792,7 @@ function createFlowCommand() {
|
|
|
4775
4792
|
});
|
|
4776
4793
|
flow.command("install <pkg-spec>").description(
|
|
4777
4794
|
"Install a node library package from npm \u2014 validate 1.1 manifest \u2192 plan complete assets \u2192 confirm \u2192 apply dependencies \u2192 nodes \u2192 library"
|
|
4778
|
-
).option("--url <url>", "server base URL").option("--scope <scope>", "install scope: global|project", "global").option("--project <key|id>", "target project (required when scope=project)").option("--registry <url>", "npm registry for pack (e.g. private mirror; default npm config)").option("--yes", "skip interactive confirmation").option("--force", "allow version downgrade; admin may also
|
|
4795
|
+
).option("--url <url>", "server base URL").option("--scope <scope>", "install scope: global|project", "global").option("--project <key|id>", "target project (required when scope=project)").option("--registry <url>", "npm registry for pack (e.g. private mirror; default npm config)").option("--yes", "skip interactive confirmation").option("--force", "allow version downgrade; admin may also sync a conflicting model alias display name (realModel is never overwritten)").action(async (pkgSpec, opts) => {
|
|
4779
4796
|
const scopeResult = parseEnum(opts.scope, SkillScopeSchema3, "scope");
|
|
4780
4797
|
if (!scopeResult.success) {
|
|
4781
4798
|
renderResult("json", scopeResult);
|
|
@@ -4817,7 +4834,7 @@ function createFlowCommand() {
|
|
|
4817
4834
|
${conflicts.map((item) => ` ${item.kind}:${item.key} \u2014 ${item.reason ?? "\u5185\u5BB9\u51B2\u7A81"}`).join("\n")}`,
|
|
4818
4835
|
httpStatus: 0,
|
|
4819
4836
|
bizCode: conflicts.some((item) => item.conflictKind === "model-alias") ? "FLOW_MODEL_ALIAS_CONFLICT" : "FLOW_ASSET_SCOPE_CONFLICT",
|
|
4820
|
-
hint: "\u6309\u6761\u76EE\u4FEE\u590D\u76EE\u6807\u73AF\u5883\u6216\u5305\u5185\u5BB9\u540E\u91CD\u65B0\u6267\u884C\uFF1B--force \u53EA\u653E\u884C\u7248\u672C\u964D\u7EA7\u53CA admin \
|
|
4837
|
+
hint: "\u6309\u6761\u76EE\u4FEE\u590D\u76EE\u6807\u73AF\u5883\u6216\u5305\u5185\u5BB9\u540E\u91CD\u65B0\u6267\u884C\uFF1B--force \u53EA\u653E\u884C\u7248\u672C\u964D\u7EA7\u53CA admin \u5BF9 Model Alias \u5C55\u793A\u540D\u7684\u540C\u6B65\uFF08realModel \u6C38\u4E0D\u8986\u76D6\uFF09"
|
|
4821
4838
|
}));
|
|
4822
4839
|
return;
|
|
4823
4840
|
}
|
|
@@ -5085,14 +5102,14 @@ function planModelAlias(payload, existing, access, force) {
|
|
|
5085
5102
|
...base,
|
|
5086
5103
|
action: "conflict",
|
|
5087
5104
|
conflictKind: "model-alias",
|
|
5088
|
-
reason: `Model Alias \
|
|
5105
|
+
reason: `Model Alias \u5C55\u793A\u540D\u4E0D\u540C\uFF08${diffs.join(", ")}\uFF09\uFF1B\u4EC5 admin \u663E\u5F0F --force \u53EF\u540C\u6B65\u5C55\u793A\u540D\uFF08realModel \u6C38\u4E0D\u8986\u76D6\uFF09`,
|
|
5089
5106
|
expectedState: snapshotModelAlias(existing)
|
|
5090
5107
|
};
|
|
5091
5108
|
}
|
|
5092
5109
|
return {
|
|
5093
5110
|
...base,
|
|
5094
5111
|
action: "update",
|
|
5095
|
-
reason: `admin --force \
|
|
5112
|
+
reason: `admin --force \u540C\u6B65\u5C55\u793A\u540D\uFF1A${diffs.join(", ")}\uFF08realModel \u4E0D\u5199\u5165\uFF09`,
|
|
5096
5113
|
expectedState: snapshotModelAlias(existing)
|
|
5097
5114
|
};
|
|
5098
5115
|
}
|
|
@@ -5300,7 +5317,6 @@ function diffAgent(payload, entity) {
|
|
|
5300
5317
|
function diffModelAlias(payload, entity) {
|
|
5301
5318
|
const diffs = [];
|
|
5302
5319
|
if (entity.name !== payload.name) diffs.push("name");
|
|
5303
|
-
if (entity.realModel !== payload.realModel) diffs.push("realModel");
|
|
5304
5320
|
return diffs;
|
|
5305
5321
|
}
|
|
5306
5322
|
function diffNode(payload, entity, packageName) {
|
|
@@ -5354,7 +5370,7 @@ function snapshotAgent(entity) {
|
|
|
5354
5370
|
};
|
|
5355
5371
|
}
|
|
5356
5372
|
function snapshotModelAlias(entity) {
|
|
5357
|
-
return { code: entity.code, name: entity.name
|
|
5373
|
+
return { code: entity.code, name: entity.name };
|
|
5358
5374
|
}
|
|
5359
5375
|
function snapshotNode(entity) {
|
|
5360
5376
|
return {
|
|
@@ -5517,7 +5533,7 @@ async function writeAsset(client, manifest, plan, item) {
|
|
|
5517
5533
|
const input = { code: payload2.code, name: payload2.name, realModel: payload2.realModel };
|
|
5518
5534
|
return client.postJson("/api/model-aliases", input);
|
|
5519
5535
|
}
|
|
5520
|
-
const patch2 = { name: payload2.name
|
|
5536
|
+
const patch2 = { name: payload2.name };
|
|
5521
5537
|
return client.putJson(`/api/model-aliases/${encodeURIComponent(payload2.code)}`, patch2);
|
|
5522
5538
|
}
|
|
5523
5539
|
if (item.kind === "skill") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siming-org/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Wuchao",
|
|
6
6
|
"engines": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"picocolors": "^1.1.1",
|
|
28
28
|
"yaml": "^2.6.0",
|
|
29
29
|
"zod": "^4.4.3",
|
|
30
|
-
"@siming-org/core": "0.7.
|
|
31
|
-
"@siming-org/server": "0.7.
|
|
30
|
+
"@siming-org/core": "0.7.2",
|
|
31
|
+
"@siming-org/server": "0.7.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"tsup": "^8.3.5",
|