@coze-arch/cli 0.0.22 → 0.0.23-alpha.65c1bd

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/lib/cli.js CHANGED
@@ -1628,7 +1628,7 @@ function createNodeTransport() {
1628
1628
  };
1629
1629
  }
1630
1630
 
1631
- function _nullishCoalesce$9(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$s(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
1631
+ function _nullishCoalesce$a(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$s(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
1632
1632
  * Slardar CLI Reporter 主类
1633
1633
  * 封装 @slardar/base 的初始化和上报逻辑
1634
1634
  */
@@ -1685,7 +1685,7 @@ class SlardarCLIReporter {constructor() { SlardarCLIReporter.prototype.__init.ca
1685
1685
  release: config.release,
1686
1686
  env: config.env,
1687
1687
  name: config.name,
1688
- useLocalConfig: _nullishCoalesce$9(config.useLocalConfig, () => ( false)), // 默认使用服务端配置
1688
+ useLocalConfig: _nullishCoalesce$a(config.useLocalConfig, () => ( false)), // 默认使用服务端配置
1689
1689
  domain: config.domain,
1690
1690
  // 设置本地采样率为 100%,确保事件不被过滤
1691
1691
  sample: {
@@ -2107,7 +2107,7 @@ const EventBuilder = {
2107
2107
  };
2108
2108
 
2109
2109
  var name = "@coze-arch/cli";
2110
- var version = "0.0.21";
2110
+ var version = "0.0.23-alpha.65c1bd";
2111
2111
  var description = "coze coding devtools cli";
2112
2112
  var license = "MIT";
2113
2113
  var author = "fanwenjie.fe@bytedance.com";
@@ -2149,7 +2149,7 @@ var dependencies = {
2149
2149
  "ajv-formats": "^3.0.1",
2150
2150
  "change-case": "^5.4.4",
2151
2151
  commander: "~12.1.0",
2152
- debug: "^4.3.7",
2152
+ debug: "^4.4.3",
2153
2153
  ejs: "^3.1.10",
2154
2154
  "fast-glob": "^3.3.3",
2155
2155
  "js-yaml": "^4.1.0",
@@ -2168,7 +2168,6 @@ var devDependencies = {
2168
2168
  "@coze-coding/lambda": "workspace:*",
2169
2169
  "@emnapi/runtime": "^1.7.1",
2170
2170
  "@inquirer/prompts": "^3.2.0",
2171
- "@playwright/test": "~1.55.0",
2172
2171
  "@rollup/plugin-commonjs": "^28.0.2",
2173
2172
  "@rollup/plugin-json": "~6.0.0",
2174
2173
  "@rollup/plugin-node-resolve": "^15.3.0",
@@ -2181,15 +2180,15 @@ var devDependencies = {
2181
2180
  "@types/minimist": "^1.2.5",
2182
2181
  "@types/node": "^24",
2183
2182
  "@types/shelljs": "^0.10.0",
2184
- "@vitest/coverage-v8": "~4.0.18",
2183
+ "@vitest/coverage-v8": "~4.1.6",
2185
2184
  knip: "^5.30.1",
2186
2185
  minimatch: "^10.0.1",
2187
- playwright: "~1.55.0",
2186
+ playwright: "~1.60.0",
2188
2187
  rollup: "^4.60.1",
2189
- sucrase: "^3.35.0",
2188
+ sucrase: "^3.35.1",
2190
2189
  "tree-kill": "^1.2.2",
2191
- tsx: "^4.20.6",
2192
- vitest: "~4.0.18"
2190
+ tsx: "^4.21.0",
2191
+ vitest: "~4.1.6"
2193
2192
  };
2194
2193
  var publishConfig = {
2195
2194
  access: "public",
@@ -2383,7 +2382,7 @@ const flushSlardar = safeRun('flushSlardar', async () => {
2383
2382
  await reporter.flush();
2384
2383
  });
2385
2384
 
2386
- function _nullishCoalesce$8(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$p(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var LogLevel; (function (LogLevel) {
2385
+ function _nullishCoalesce$9(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$p(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var LogLevel; (function (LogLevel) {
2387
2386
  const ERROR = 0; LogLevel[LogLevel["ERROR"] = ERROR] = "ERROR";
2388
2387
  const WARN = 1; LogLevel[LogLevel["WARN"] = WARN] = "WARN";
2389
2388
  const SUCCESS = 2; LogLevel[LogLevel["SUCCESS"] = SUCCESS] = "SUCCESS";
@@ -2421,7 +2420,7 @@ class Logger {
2421
2420
 
2422
2421
  constructor(options = {}) {
2423
2422
  this.level = this.parseLogLevel(options.level);
2424
- this.useColor = _nullishCoalesce$8(options.useColor, () => ( this.isColorSupported()));
2423
+ this.useColor = _nullishCoalesce$9(options.useColor, () => ( this.isColorSupported()));
2425
2424
  this.prefix = options.prefix;
2426
2425
  }
2427
2426
 
@@ -2467,7 +2466,7 @@ class Logger {
2467
2466
 
2468
2467
  const icon = this.colorize(options.icon, options.color);
2469
2468
  const prefix = this.prefix ? `${icon} ${this.prefix}` : icon;
2470
- console.log(prefix, options.message, ...(_nullishCoalesce$8(options.args, () => ( []))));
2469
+ console.log(prefix, options.message, ...(_nullishCoalesce$9(options.args, () => ( []))));
2471
2470
  }
2472
2471
 
2473
2472
  error(message, ...args) {
@@ -2721,10 +2720,11 @@ const getTemplatePath = async (
2721
2720
  try {
2722
2721
  await fs$1.access(templatePath);
2723
2722
  logger.verbose(' - Template directory exists: ✓');
2724
- // eslint-disable-next-line @coze-arch/use-error-in-catch -- Error handling done in throw statement
2725
- } catch (e) {
2723
+ } catch (error) {
2726
2724
  logger.error(' - Template directory does not exist: ✗');
2727
- throw new Error(`Template directory not found: ${templatePath}`);
2725
+ throw new Error(
2726
+ `Template directory not found: ${templatePath} (cause: ${error instanceof Error ? error.message : String(error)})`,
2727
+ );
2728
2728
  }
2729
2729
 
2730
2730
  return templatePath;
@@ -3737,8 +3737,10 @@ class Alias extends NodeBase {
3737
3737
  * instance of the `source` anchor before this node.
3738
3738
  */
3739
3739
  resolve(doc, ctx) {
3740
+ if (_optionalChain$l([ctx, 'optionalAccess', _ => _.maxAliasCount]) === 0)
3741
+ throw new ReferenceError('Alias resolution is disabled');
3740
3742
  let nodes;
3741
- if (_optionalChain$l([ctx, 'optionalAccess', _ => _.aliasResolveCache])) {
3743
+ if (_optionalChain$l([ctx, 'optionalAccess', _2 => _2.aliasResolveCache])) {
3742
3744
  nodes = ctx.aliasResolveCache;
3743
3745
  }
3744
3746
  else {
@@ -3777,7 +3779,7 @@ class Alias extends NodeBase {
3777
3779
  data = anchors.get(source);
3778
3780
  }
3779
3781
  /* istanbul ignore if */
3780
- if (_optionalChain$l([data, 'optionalAccess', _2 => _2.res]) === undefined) {
3782
+ if (_optionalChain$l([data, 'optionalAccess', _3 => _3.res]) === undefined) {
3781
3783
  const msg = 'This should not happen: Alias anchor was not resolved?';
3782
3784
  throw new ReferenceError(msg);
3783
3785
  }
@@ -3849,12 +3851,12 @@ Scalar.PLAIN = 'PLAIN';
3849
3851
  Scalar.QUOTE_DOUBLE = 'QUOTE_DOUBLE';
3850
3852
  Scalar.QUOTE_SINGLE = 'QUOTE_SINGLE';
3851
3853
 
3852
- function _nullishCoalesce$7(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$j(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
3854
+ function _nullishCoalesce$8(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$j(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
3853
3855
  const defaultTagPrefix = 'tag:yaml.org,2002:';
3854
3856
  function findTagObject(value, tagName, tags) {
3855
3857
  if (tagName) {
3856
3858
  const match = tags.filter(t => t.tag === tagName);
3857
- const tagObj = _nullishCoalesce$7(match.find(t => !t.format), () => ( match[0]));
3859
+ const tagObj = _nullishCoalesce$8(match.find(t => !t.format), () => ( match[0]));
3858
3860
  if (!tagObj)
3859
3861
  throw new Error(`Tag ${tagName} not found`);
3860
3862
  return tagObj;
@@ -3886,7 +3888,7 @@ function createNode(value, tagName, ctx) {
3886
3888
  if (aliasDuplicateObjects && value && typeof value === 'object') {
3887
3889
  ref = sourceObjects.get(value);
3888
3890
  if (ref) {
3889
- _nullishCoalesce$7(ref.anchor, () => ( (ref.anchor = onAnchor(value))));
3891
+ _nullishCoalesce$8(ref.anchor, () => ( (ref.anchor = onAnchor(value))));
3890
3892
  return new Alias(ref.anchor);
3891
3893
  }
3892
3894
  else {
@@ -4572,7 +4574,7 @@ function stringifyString(item, ctx, onComment, onChompKeep) {
4572
4574
  return res;
4573
4575
  }
4574
4576
 
4575
- function _nullishCoalesce$6(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$h(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
4577
+ function _nullishCoalesce$7(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$h(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
4576
4578
  function createStringifyContext(doc, options) {
4577
4579
  const opt = Object.assign({
4578
4580
  blockQuote: true,
@@ -4619,7 +4621,7 @@ function getTagObject(tags, item) {
4619
4621
  if (item.tag) {
4620
4622
  const match = tags.filter(t => t.tag === item.tag);
4621
4623
  if (match.length > 0)
4622
- return _nullishCoalesce$6(match.find(t => t.format === item.format), () => ( match[0]));
4624
+ return _nullishCoalesce$7(match.find(t => t.format === item.format), () => ( match[0]));
4623
4625
  }
4624
4626
  let tagObj = undefined;
4625
4627
  let obj;
@@ -4632,14 +4634,14 @@ function getTagObject(tags, item) {
4632
4634
  match = testMatch;
4633
4635
  }
4634
4636
  tagObj =
4635
- _nullishCoalesce$6(match.find(t => t.format === item.format), () => ( match.find(t => !t.format)));
4637
+ _nullishCoalesce$7(match.find(t => t.format === item.format), () => ( match.find(t => !t.format)));
4636
4638
  }
4637
4639
  else {
4638
4640
  obj = item;
4639
4641
  tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
4640
4642
  }
4641
4643
  if (!tagObj) {
4642
- const name = _nullishCoalesce$6(_optionalChain$h([obj, 'optionalAccess', _3 => _3.constructor, 'optionalAccess', _4 => _4.name]), () => ( (obj === null ? 'null' : typeof obj)));
4644
+ const name = _nullishCoalesce$7(_optionalChain$h([obj, 'optionalAccess', _3 => _3.constructor, 'optionalAccess', _4 => _4.name]), () => ( (obj === null ? 'null' : typeof obj)));
4643
4645
  throw new Error(`Tag not resolved for ${name} value`);
4644
4646
  }
4645
4647
  return tagObj;
@@ -4654,7 +4656,7 @@ function stringifyProps(node, tagObj, { anchors, doc }) {
4654
4656
  anchors.add(anchor);
4655
4657
  props.push(`&${anchor}`);
4656
4658
  }
4657
- const tag = _nullishCoalesce$6(node.tag, () => ( (tagObj.default ? null : tagObj.tag)));
4659
+ const tag = _nullishCoalesce$7(node.tag, () => ( (tagObj.default ? null : tagObj.tag)));
4658
4660
  if (tag)
4659
4661
  props.push(doc.directives.tagString(tag));
4660
4662
  return props.join(' ');
@@ -4680,10 +4682,10 @@ function stringify(item, ctx, onComment, onChompKeep) {
4680
4682
  const node = isNode(item)
4681
4683
  ? item
4682
4684
  : ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
4683
- _nullishCoalesce$6(tagObj, () => ( (tagObj = getTagObject(ctx.doc.schema.tags, node))));
4685
+ _nullishCoalesce$7(tagObj, () => ( (tagObj = getTagObject(ctx.doc.schema.tags, node))));
4684
4686
  const props = stringifyProps(node, tagObj, ctx);
4685
4687
  if (props.length > 0)
4686
- ctx.indentAtStart = (_nullishCoalesce$6(ctx.indentAtStart, () => ( 0))) + props.length + 1;
4688
+ ctx.indentAtStart = (_nullishCoalesce$7(ctx.indentAtStart, () => ( 0))) + props.length + 1;
4687
4689
  const str = typeof tagObj.stringify === 'function'
4688
4690
  ? tagObj.stringify(node, ctx, onComment, onChompKeep)
4689
4691
  : isScalar(node)
@@ -4696,7 +4698,7 @@ function stringify(item, ctx, onComment, onChompKeep) {
4696
4698
  : `${props}\n${ctx.indent}${str}`;
4697
4699
  }
4698
4700
 
4699
- function _nullishCoalesce$5(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
4701
+ function _nullishCoalesce$6(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
4700
4702
  function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
4701
4703
  const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
4702
4704
  let keyComment = (isNode(key) && key.comment) || null;
@@ -4806,7 +4808,7 @@ function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
4806
4808
  const vs0 = valueStr[0];
4807
4809
  const nl0 = valueStr.indexOf('\n');
4808
4810
  const hasNewline = nl0 !== -1;
4809
- const flow = _nullishCoalesce$5(_nullishCoalesce$5(ctx.inFlow, () => ( value.flow)), () => ( value.items.length === 0));
4811
+ const flow = _nullishCoalesce$6(_nullishCoalesce$6(ctx.inFlow, () => ( value.flow)), () => ( value.items.length === 0));
4810
4812
  if (hasNewline || !flow) {
4811
4813
  let hasPropsLine = false;
4812
4814
  if (hasNewline && (vs0 === '&' || vs0 === '!')) {
@@ -4873,18 +4875,18 @@ const isMergeKey = (ctx, key) => (merge.identify(key) ||
4873
4875
  merge.identify(key.value))) &&
4874
4876
  _optionalChain$g([ctx, 'optionalAccess', _ => _.doc, 'access', _2 => _2.schema, 'access', _3 => _3.tags, 'access', _4 => _4.some, 'call', _5 => _5(tag => tag.tag === merge.tag && tag.default)]);
4875
4877
  function addMergeToJSMap(ctx, map, value) {
4876
- value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
4877
- if (isSeq(value))
4878
- for (const it of value.items)
4878
+ const source = resolveAliasValue(ctx, value);
4879
+ if (isSeq(source))
4880
+ for (const it of source.items)
4879
4881
  mergeValue(ctx, map, it);
4880
- else if (Array.isArray(value))
4881
- for (const it of value)
4882
+ else if (Array.isArray(source))
4883
+ for (const it of source)
4882
4884
  mergeValue(ctx, map, it);
4883
4885
  else
4884
- mergeValue(ctx, map, value);
4886
+ mergeValue(ctx, map, source);
4885
4887
  }
4886
4888
  function mergeValue(ctx, map, value) {
4887
- const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
4889
+ const source = resolveAliasValue(ctx, value);
4888
4890
  if (!isMap(source))
4889
4891
  throw new Error('Merge sources must be maps or map aliases');
4890
4892
  const srcMap = source.toJSON(null, ctx, Map);
@@ -4907,6 +4909,9 @@ function mergeValue(ctx, map, value) {
4907
4909
  }
4908
4910
  return map;
4909
4911
  }
4912
+ function resolveAliasValue(ctx, value) {
4913
+ return ctx && isAlias(value) ? value.resolve(ctx.doc, ctx) : value;
4914
+ }
4910
4915
 
4911
4916
  function _optionalChain$f(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
4912
4917
  function addPairToJSMap(ctx, map, { key, value }) {
@@ -4996,9 +5001,9 @@ class Pair {
4996
5001
  }
4997
5002
  }
4998
5003
 
4999
- function _nullishCoalesce$4(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$d(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5004
+ function _nullishCoalesce$5(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$d(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5000
5005
  function stringifyCollection(collection, ctx, options) {
5001
- const flow = _nullishCoalesce$4(ctx.inFlow, () => ( collection.flow));
5006
+ const flow = _nullishCoalesce$5(ctx.inFlow, () => ( collection.flow));
5002
5007
  const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection;
5003
5008
  return stringify(collection, ctx, options);
5004
5009
  }
@@ -5145,7 +5150,7 @@ function addCommentBefore({ indent, options: { commentString } }, lines, comment
5145
5150
  }
5146
5151
  }
5147
5152
 
5148
- function _nullishCoalesce$3(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$c(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5153
+ function _nullishCoalesce$4(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$c(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
5149
5154
  function findPair(items, key) {
5150
5155
  const k = isScalar(key) ? key.value : key;
5151
5156
  for (const it of items) {
@@ -5242,7 +5247,7 @@ class YAMLMap extends Collection {
5242
5247
  get(key, keepScalar) {
5243
5248
  const it = findPair(this.items, key);
5244
5249
  const node = _optionalChain$c([it, 'optionalAccess', _5 => _5.value]);
5245
- return _nullishCoalesce$3((!keepScalar && isScalar(node) ? node.value : node), () => ( undefined));
5250
+ return _nullishCoalesce$4((!keepScalar && isScalar(node) ? node.value : node), () => ( undefined));
5246
5251
  }
5247
5252
  has(key) {
5248
5253
  return !!findPair(this.items, key);
@@ -7309,7 +7314,7 @@ const getTemplatePatches = (
7309
7314
  ) =>
7310
7315
  patches.filter(patch => patch.template === template);
7311
7316
 
7312
- function _nullishCoalesce$2(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$2(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
7317
+ function _nullishCoalesce$3(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$2(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
7313
7318
  const DEFAULT_LEGACY_VERSION = 'legacy';
7314
7319
 
7315
7320
  const loadFlagsWithFallback = async () => {
@@ -7492,7 +7497,7 @@ const executePatch = async (
7492
7497
 
7493
7498
  if (options.dryRun) {
7494
7499
  logger.info(`Detected template: ${template}`);
7495
- logger.info(`Current version: ${_nullishCoalesce$2(projectVersion, () => ( DEFAULT_LEGACY_VERSION))}`);
7500
+ logger.info(`Current version: ${_nullishCoalesce$3(projectVersion, () => ( DEFAULT_LEGACY_VERSION))}`);
7496
7501
  logger.info(`Applied patches: ${appliedPatches.join(', ') || '(none)'}`);
7497
7502
  logger.info('Matched patches:');
7498
7503
  matchedPatches.forEach(patch => {
@@ -7557,7 +7562,9 @@ const registerCommand$4 = program => {
7557
7562
  );
7558
7563
  };
7559
7564
 
7560
- function _nullishCoalesce$1(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
7565
+ function _nullishCoalesce$2(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
7566
+ const d$1 = debug('coze-init-cli:run');
7567
+
7561
7568
  /**
7562
7569
  * 日志文件名常量
7563
7570
  */
@@ -7657,9 +7664,12 @@ const executeRun = async (
7657
7664
  const fixStartTime = Date.now();
7658
7665
  try {
7659
7666
  await executePatch();
7660
- // eslint-disable-next-line @coze-arch/no-empty-catch, @coze-arch/use-error-in-catch -- intentionally ignored
7661
- } catch (_e) {
7662
- // fix errors are intentionally ignored to allow the main command to proceed
7667
+ } catch (patchError) {
7668
+ // patch errors are intentionally non-fatal: trace and proceed with the main command
7669
+ d$1(
7670
+ 'patch step failed (continuing): %s',
7671
+ patchError instanceof Error ? patchError.message : String(patchError),
7672
+ );
7663
7673
  }
7664
7674
  fixDuration = Date.now() - fixStartTime;
7665
7675
  logger.info('');
@@ -7711,7 +7721,7 @@ const executeRun = async (
7711
7721
  const buildDuration = Date.now() - buildStartTime;
7712
7722
 
7713
7723
  if (code !== 0) {
7714
- const errorMessage = `Command exited with code ${_nullishCoalesce$1(code, () => ( 'unknown'))}${signal ? ` and signal ${signal}` : ''}`;
7724
+ const errorMessage = `Command exited with code ${_nullishCoalesce$2(code, () => ( 'unknown'))}${signal ? ` and signal ${signal}` : ''}`;
7715
7725
  logger.error(errorMessage);
7716
7726
  logger.error(`Check log file for details: ${logFilePath}`);
7717
7727
 
@@ -7723,12 +7733,12 @@ const executeRun = async (
7723
7733
  categories: {
7724
7734
  fixDuration: String(fixDuration),
7725
7735
  buildDuration: String(buildDuration),
7726
- exitCode: String(_nullishCoalesce$1(code, () => ( 'unknown'))),
7736
+ exitCode: String(_nullishCoalesce$2(code, () => ( 'unknown'))),
7727
7737
  projectType,
7728
7738
  },
7729
7739
  errorContext: {
7730
- exitCode: String(_nullishCoalesce$1(code, () => ( 'unknown'))),
7731
- signal: _nullishCoalesce$1(signal, () => ( 'none')),
7740
+ exitCode: String(_nullishCoalesce$2(code, () => ( 'unknown'))),
7741
+ signal: _nullishCoalesce$2(signal, () => ( 'none')),
7732
7742
  logFile: logFilePath,
7733
7743
  projectType,
7734
7744
  },
@@ -8737,6 +8747,9 @@ const registerCommand$2 = program => {
8737
8747
  });
8738
8748
  };
8739
8749
 
8750
+ function _nullishCoalesce$1(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
8751
+
8752
+
8740
8753
  const d = debug('coze-init-cli:check-bins');
8741
8754
 
8742
8755
 
@@ -8748,7 +8761,6 @@ const d = debug('coze-init-cli:check-bins');
8748
8761
  const checkBins = async (cwd, fix) => {
8749
8762
  d('starting check, cwd=%s fix=%s', cwd, fix);
8750
8763
 
8751
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- fallback {} ensures non-null
8752
8764
  const pkgJson = safeJsonParse
8753
8765
 
8754
8766
 
@@ -8792,8 +8804,7 @@ const checkBins = async (cwd, fix) => {
8792
8804
 
8793
8805
  const bins =
8794
8806
  typeof depPkg.bin === 'string'
8795
- ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- split always has ≥1 element
8796
- { [depName.split('/').pop()]: depPkg.bin }
8807
+ ? { [_nullishCoalesce$1(depName.split('/').pop(), () => ( depName))]: depPkg.bin }
8797
8808
  : depPkg.bin;
8798
8809
 
8799
8810
  d('%s declares bins: %o', depName, Object.keys(bins));
@@ -8949,6 +8960,8 @@ const validateParams = (
8949
8960
  return params ;
8950
8961
  };
8951
8962
 
8963
+ const ARGV_USER_ARGS_OFFSET = 2;
8964
+
8952
8965
  /**
8953
8966
  * 从 Commander 解析透传参数
8954
8967
  * 将 kebab-case 的 CLI 参数转换为 camelCase
@@ -8963,9 +8976,7 @@ const parsePassThroughParams = (
8963
8976
  command,
8964
8977
  knownOptions = new Set(),
8965
8978
  ) => {
8966
- // 使用 minimist 解析所有参数
8967
- // eslint-disable-next-line @typescript-eslint/no-magic-numbers -- slice(2) to skip node and script path
8968
- const parsed = minimist(process.argv.slice(2));
8979
+ const parsed = minimist(process.argv.slice(ARGV_USER_ARGS_OFFSET));
8969
8980
 
8970
8981
  // 过滤掉已知选项和位置参数(_)
8971
8982
  const filtered = Object.entries(parsed).reduce(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coze-arch/cli",
3
- "version": "0.0.22",
3
+ "version": "0.0.23-alpha.65c1bd",
4
4
  "private": false,
5
5
  "description": "coze coding devtools cli",
6
6
  "license": "MIT",
@@ -42,7 +42,7 @@
42
42
  "ajv-formats": "^3.0.1",
43
43
  "change-case": "^5.4.4",
44
44
  "commander": "~12.1.0",
45
- "debug": "^4.3.7",
45
+ "debug": "^4.4.3",
46
46
  "ejs": "^3.1.10",
47
47
  "fast-glob": "^3.3.3",
48
48
  "js-yaml": "^4.1.0",
@@ -61,7 +61,6 @@
61
61
  "@coze-coding/lambda": "workspace:*",
62
62
  "@emnapi/runtime": "^1.7.1",
63
63
  "@inquirer/prompts": "^3.2.0",
64
- "@playwright/test": "~1.55.0",
65
64
  "@rollup/plugin-commonjs": "^28.0.2",
66
65
  "@rollup/plugin-json": "~6.0.0",
67
66
  "@rollup/plugin-node-resolve": "^15.3.0",
@@ -74,15 +73,15 @@
74
73
  "@types/minimist": "^1.2.5",
75
74
  "@types/node": "^24",
76
75
  "@types/shelljs": "^0.10.0",
77
- "@vitest/coverage-v8": "~4.0.18",
76
+ "@vitest/coverage-v8": "~4.1.6",
78
77
  "knip": "^5.30.1",
79
78
  "minimatch": "^10.0.1",
80
- "playwright": "~1.55.0",
79
+ "playwright": "~1.60.0",
81
80
  "rollup": "^4.60.1",
82
- "sucrase": "^3.35.0",
81
+ "sucrase": "^3.35.1",
83
82
  "tree-kill": "^1.2.2",
84
- "tsx": "^4.20.6",
85
- "vitest": "~4.0.18"
83
+ "tsx": "^4.21.0",
84
+ "vitest": "~4.1.6"
86
85
  },
87
86
  "publishConfig": {
88
87
  "access": "public",