@dazitech/cli 3.0.4 → 3.0.5

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/README.md CHANGED
@@ -78,7 +78,7 @@ pnpm run publish:cli
78
78
 
79
79
  ```powershell
80
80
  # 全局
81
- pnpm add -g @dazitech/cli@3.0.4
81
+ pnpm add -g @dazitech/cli@3.0.5
82
82
 
83
83
  # 确认 PATH(pnpm 全局 bin)
84
84
  pnpm bin -g
@@ -16753,7 +16753,7 @@ function registerLegacyCompatCommands(program3) {
16753
16753
  var program2 = new Command();
16754
16754
  program2.name("dazi-app").description(
16755
16755
  "\u642D\u5B50 App CLI \u2014 DRAP \u524D\u7AEF\u5E94\u7528\uFF08manifest / build / upload / preview\uFF09"
16756
- ).version("3.0.4", "-v, --version");
16756
+ ).version("3.0.5", "-v, --version");
16757
16757
  registerAuth(program2);
16758
16758
  registerBuild(program2);
16759
16759
  registerDev(program2);
@@ -4512,7 +4512,23 @@ var require_flowDirResolve = __commonJS({
4512
4512
  function isWorkspaceRootCandidate(dir) {
4513
4513
  return fs_1.default.existsSync(path_1.default.join(dir, "\u9879\u76EE")) || fs_1.default.existsSync(path_1.default.join(dir, "scripts", "dazi.ps1"));
4514
4514
  }
4515
- function resolveFlowDirForCli(dir) {
4515
+ function isValidFlowTargetDir(dir) {
4516
+ if (isWorkspaceRootCandidate(dir))
4517
+ return false;
4518
+ const norm = path_1.default.resolve(dir).replace(/\\/g, "/");
4519
+ const base = path_1.default.basename(norm.replace(/\/$/, ""));
4520
+ if (["flows", "\u89C4\u5212", "\u6D41\u7A0B", "\u9879\u76EE", "\u8282\u70B9", "\u53D8\u91CF", "_run"].includes(base))
4521
+ return false;
4522
+ if (/(?:^|\/)项目\/[^/]+\/流程\/flows\/[^/]+(?:\/|$)/.test(norm))
4523
+ return true;
4524
+ const legacy = norm.match(/(?:^|\/)项目\/([^/]+)\/流程\/([^/]+)(?:\/|$)/);
4525
+ if (legacy && legacy[2] !== "flows" && legacy[2] !== "\u89C4\u5212")
4526
+ return true;
4527
+ if (/(?:^|\/)项目\/flow_[^/]+\/流程\/[^/]+(?:\/|$)/.test(norm))
4528
+ return true;
4529
+ return false;
4530
+ }
4531
+ function resolveFlowDirForCli(dir, opts) {
4516
4532
  const requested = path_1.default.resolve(dir ?? process.cwd());
4517
4533
  const warnings = [];
4518
4534
  if (fs_1.default.existsSync(path_1.default.join(requested, exports2.FLOW_JSON))) {
@@ -4525,6 +4541,9 @@ var require_flowDirResolve = __commonJS({
4525
4541
  }
4526
4542
  return { flowDir: found, resolvedFromParent: found !== requested, warnings };
4527
4543
  }
4544
+ if (opts?.allowMissingFlowJson && isValidFlowTargetDir(requested)) {
4545
+ return { flowDir: requested, resolvedFromParent: false, warnings };
4546
+ }
4528
4547
  const hasMetaOnly = fs_1.default.existsSync(path_1.default.join(requested, exports2.FLOW_META_JSON)) && !fs_1.default.existsSync(path_1.default.join(requested, exports2.FLOW_JSON));
4529
4548
  if (hasMetaOnly || isWorkspaceRootCandidate(requested) && !fs_1.default.existsSync(path_1.default.join(requested, exports2.FLOW_JSON))) {
4530
4549
  return {
@@ -4543,7 +4562,7 @@ var require_flowDirResolve = __commonJS({
4543
4562
  }
4544
4563
  exports2.resolveFlowDirForCli = resolveFlowDirForCli;
4545
4564
  function resolveFlowDir5(dir, opts) {
4546
- const result = resolveFlowDirForCli(dir);
4565
+ const result = resolveFlowDirForCli(dir, opts);
4547
4566
  if (!opts?.json) {
4548
4567
  for (const w of result.warnings)
4549
4568
  console.warn(`\u26A0\uFE0F ${w}`);
@@ -7218,7 +7237,7 @@ function makeManagedFilesCommand() {
7218
7237
 
7219
7238
  // cli/dazi-flow/src/index.ts
7220
7239
  var program2 = new Command();
7221
- program2.name("dazi-flow").description("\u642D\u5B50 Flow CLI \u2014 \u5DE5\u4F5C\u6D41\u7BA1\u7406").version("3.0.4", "-v, --version");
7240
+ program2.name("dazi-flow").description("\u642D\u5B50 Flow CLI \u2014 \u5DE5\u4F5C\u6D41\u7BA1\u7406").version("3.0.5", "-v, --version");
7222
7241
  program2.addCommand(makeFlowsCommand());
7223
7242
  program2.addCommand(makeSnapshotCommand());
7224
7243
  program2.addCommand(makeProjectCommand());
@@ -3978,7 +3978,7 @@ function makeMcpCommand() {
3978
3978
  result: {
3979
3979
  protocolVersion: "2024-11-05",
3980
3980
  capabilities: { tools: {} },
3981
- serverInfo: { name: "dazi-onto", version: "3.0.4" }
3981
+ serverInfo: { name: "dazi-onto", version: "3.0.5" }
3982
3982
  }
3983
3983
  };
3984
3984
  process.stdout.write(JSON.stringify(response) + "\n");
@@ -4001,7 +4001,7 @@ function makeMcpCommand() {
4001
4001
 
4002
4002
  // cli/dazi-onto/src/index.ts
4003
4003
  var program2 = new Command();
4004
- program2.name("dazi-onto").description("\u642D\u5B50 Onto CLI \u2014 \u672C\u4F53\uFF08Ontology\uFF09\u7BA1\u7406").version("3.0.4", "-v, --version");
4004
+ program2.name("dazi-onto").description("\u642D\u5B50 Onto CLI \u2014 \u672C\u4F53\uFF08Ontology\uFF09\u7BA1\u7406").version("3.0.5", "-v, --version");
4005
4005
  program2.addCommand(makeSpaceCommand());
4006
4006
  program2.addCommand(makeFunctionCommand());
4007
4007
  program2.addCommand(makeActionCommand());
package/dist/clis/dazi.js CHANGED
@@ -4024,7 +4024,7 @@ function makeEnvCommand() {
4024
4024
  return new Command("env").description("\u663E\u793A\u73AF\u5883\u4FE1\u606F").action(() => {
4025
4025
  const auth = tryLoadAuth();
4026
4026
  const env = {
4027
- version: "3.0.4",
4027
+ version: "3.0.5",
4028
4028
  node: process.version,
4029
4029
  platform: `${import_os5.default.type()} ${import_os5.default.arch()}`,
4030
4030
  serverUrl: getServerUrl(),
@@ -5694,7 +5694,7 @@ function dispatch(msg) {
5694
5694
  result: {
5695
5695
  protocolVersion: "2024-11-05",
5696
5696
  capabilities: { tools: {} },
5697
- serverInfo: { name: "dazi", version: "3.0.4" }
5697
+ serverInfo: { name: "dazi", version: "3.0.5" }
5698
5698
  }
5699
5699
  };
5700
5700
  case "initialized":
@@ -5817,7 +5817,7 @@ function forwardToCli(cliName, extraArgs) {
5817
5817
  process.exit(result.status ?? 1);
5818
5818
  }
5819
5819
  var program2 = new Command();
5820
- program2.name("dazi").description("\u642D\u5B50 v3 \u2014 Onto / Flow / App \u7EDF\u4E00 CLI").version("3.0.4", "-v, --version");
5820
+ program2.name("dazi").description("\u642D\u5B50 v3 \u2014 Onto / Flow / App \u7EDF\u4E00 CLI").version("3.0.5", "-v, --version");
5821
5821
  program2.addCommand(makeAuthCommand());
5822
5822
  program2.addCommand(makeDoctorCommand());
5823
5823
  program2.addCommand(makeEnvCommand());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazitech/cli",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "description": "搭子 v3 命令行工具(Onto / Flow / App),与 dazi-vscode 同版本",
5
5
  "license": "MIT",
6
6
  "engines": {