@ai-setting/roy-agent-cli 1.7.50 → 1.7.52

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.
@@ -9487,7 +9487,7 @@ class CliQuietModeService {
9487
9487
  // package.json
9488
9488
  var package_default = {
9489
9489
  name: "@ai-setting/roy-agent-cli",
9490
- version: "1.7.50",
9490
+ version: "1.7.52",
9491
9491
  type: "module",
9492
9492
  description: "CLI for roy-agent - Non-interactive command execution",
9493
9493
  main: "./dist/index.js",
@@ -22371,6 +22371,9 @@ var EventSourceAddCommand = {
22371
22371
  alias: "c",
22372
22372
  describe: "执行的命令(lark-cli 类型)",
22373
22373
  type: "string"
22374
+ }).option("event-keys", {
22375
+ describe: "lark-cli 要消费的 EventKey 列表(逗号分隔,如 " + "'im.message.receive_v1,card.action.trigger')。" + "lark-cli `event consume` 只接受一个 key,多个 key = 多个 consume 子进程",
22376
+ type: "string"
22374
22377
  }).option("url", {
22375
22378
  alias: "u",
22376
22379
  describe: "WebSocket URL",
@@ -22416,6 +22419,14 @@ var EventSourceAddCommand = {
22416
22419
  process.exit(1);
22417
22420
  }
22418
22421
  const eventTypes = a.eventTypes?.split(",").map((s) => s.trim());
22422
+ const eventKeys = typeof a.eventKeys === "string" ? a.eventKeys.split(",").map((s) => s.trim()).filter(Boolean) : undefined;
22423
+ if (eventKeys && eventKeys.some((k) => k.includes("*"))) {
22424
+ output.error(chalk61.red(`
22425
+ ✗ --event-keys 不支持通配符(如 im.*):lark-cli event consume 只接受精确 EventKey。
22426
+ ` + ` 用 \`lark-cli event list\` 查可用 key。
22427
+ `));
22428
+ process.exit(1);
22429
+ }
22419
22430
  let resolvedEmail = a.email;
22420
22431
  let resolvedProfileName = a.profile;
22421
22432
  let profileApiBase;
@@ -22462,6 +22473,7 @@ var EventSourceAddCommand = {
22462
22473
  type: a.type,
22463
22474
  enabled: true,
22464
22475
  eventTypes,
22476
+ ...eventKeys && eventKeys.length > 0 ? { eventKeys } : {},
22465
22477
  command: a.command,
22466
22478
  url: a.url,
22467
22479
  interval: a.interval,
@@ -22547,6 +22559,9 @@ var EventSourceUpdateCommand = {
22547
22559
  alias: "c",
22548
22560
  describe: "执行的命令(lark-cli 类型)",
22549
22561
  type: "string"
22562
+ }).option("event-keys", {
22563
+ describe: "lark-cli 要消费的 EventKey 列表(逗号分隔,如 " + "'im.message.receive_v1,card.action.trigger');一个 key = 一个 consume 子进程",
22564
+ type: "string"
22550
22565
  }).option("url", {
22551
22566
  alias: "u",
22552
22567
  describe: "WebSocket URL",
@@ -22628,6 +22643,9 @@ var EventSourceUpdateCommand = {
22628
22643
  }
22629
22644
  if (a.command !== undefined)
22630
22645
  partial.command = a.command;
22646
+ if (a.eventKeys !== undefined) {
22647
+ partial.eventKeys = String(a.eventKeys).split(",").map((s) => s.trim()).filter(Boolean);
22648
+ }
22631
22649
  if (a.url !== undefined)
22632
22650
  partial.url = a.url;
22633
22651
  if (a.cron !== undefined)
@@ -24274,6 +24292,8 @@ function getSupportedNodeTypes() {
24274
24292
  }
24275
24293
 
24276
24294
  // src/commands/workflow/validators/workflow-validator.ts
24295
+ import { validateTemplateContracts as validateTemplateContractsCore } from "@ai-setting/roy-agent-core/env/workflow/utils";
24296
+
24277
24297
  class WorkflowValidator {
24278
24298
  validate(workflow) {
24279
24299
  const errors = [];
@@ -24294,6 +24314,8 @@ class WorkflowValidator {
24294
24314
  errors.push(...depErrors);
24295
24315
  const templateErrors = this.validateTemplateReferences(nodes, nodeIds);
24296
24316
  errors.push(...templateErrors);
24317
+ const contractErrors = this.collectTemplateContractErrors(workflow, nodes);
24318
+ errors.push(...contractErrors);
24297
24319
  const inputErrors = this.validateWorkflowInputs(nodes, workflow.inputs);
24298
24320
  errors.push(...inputErrors);
24299
24321
  return {
@@ -24403,6 +24425,28 @@ class WorkflowValidator {
24403
24425
  errors.push(...circularErrors);
24404
24426
  return errors;
24405
24427
  }
24428
+ collectTemplateContractErrors(workflow, nodes) {
24429
+ if (nodes.length === 0)
24430
+ return [];
24431
+ try {
24432
+ const findings = validateTemplateContractsCore({
24433
+ ...workflow,
24434
+ nodes
24435
+ });
24436
+ return findings.filter((f) => f.severity === "error").map((f) => ({
24437
+ type: "INVALID_TEMPLATE_REFERENCE" /* INVALID_TEMPLATE_REFERENCE */,
24438
+ description: `[template-contract:${f.rule}] ${f.message}`,
24439
+ expected: "Template field must match the source node's output contract",
24440
+ actual: `Template "${f.template}" references a field the source node (${f.sourceNodeType ?? "?"}) does not expose`,
24441
+ fix: f.suggestion ? `Change it to "${f.suggestion}"` : "Use the source node's declared output field (see node output contracts)",
24442
+ nodeId: f.nodeId,
24443
+ template: f.template,
24444
+ referencedNodeId: f.sourceNodeId
24445
+ }));
24446
+ } catch {
24447
+ return [];
24448
+ }
24449
+ }
24406
24450
  validateTemplateReferences(nodes, nodeIds) {
24407
24451
  const errors = [];
24408
24452
  const templatePatterns = [
package/dist/index.js CHANGED
@@ -9486,7 +9486,7 @@ class CliQuietModeService {
9486
9486
  // package.json
9487
9487
  var package_default = {
9488
9488
  name: "@ai-setting/roy-agent-cli",
9489
- version: "1.7.50",
9489
+ version: "1.7.52",
9490
9490
  type: "module",
9491
9491
  description: "CLI for roy-agent - Non-interactive command execution",
9492
9492
  main: "./dist/index.js",
@@ -22370,6 +22370,9 @@ var EventSourceAddCommand = {
22370
22370
  alias: "c",
22371
22371
  describe: "执行的命令(lark-cli 类型)",
22372
22372
  type: "string"
22373
+ }).option("event-keys", {
22374
+ describe: "lark-cli 要消费的 EventKey 列表(逗号分隔,如 " + "'im.message.receive_v1,card.action.trigger')。" + "lark-cli `event consume` 只接受一个 key,多个 key = 多个 consume 子进程",
22375
+ type: "string"
22373
22376
  }).option("url", {
22374
22377
  alias: "u",
22375
22378
  describe: "WebSocket URL",
@@ -22415,6 +22418,14 @@ var EventSourceAddCommand = {
22415
22418
  process.exit(1);
22416
22419
  }
22417
22420
  const eventTypes = a.eventTypes?.split(",").map((s) => s.trim());
22421
+ const eventKeys = typeof a.eventKeys === "string" ? a.eventKeys.split(",").map((s) => s.trim()).filter(Boolean) : undefined;
22422
+ if (eventKeys && eventKeys.some((k) => k.includes("*"))) {
22423
+ output.error(chalk61.red(`
22424
+ ✗ --event-keys 不支持通配符(如 im.*):lark-cli event consume 只接受精确 EventKey。
22425
+ ` + ` 用 \`lark-cli event list\` 查可用 key。
22426
+ `));
22427
+ process.exit(1);
22428
+ }
22418
22429
  let resolvedEmail = a.email;
22419
22430
  let resolvedProfileName = a.profile;
22420
22431
  let profileApiBase;
@@ -22461,6 +22472,7 @@ var EventSourceAddCommand = {
22461
22472
  type: a.type,
22462
22473
  enabled: true,
22463
22474
  eventTypes,
22475
+ ...eventKeys && eventKeys.length > 0 ? { eventKeys } : {},
22464
22476
  command: a.command,
22465
22477
  url: a.url,
22466
22478
  interval: a.interval,
@@ -22546,6 +22558,9 @@ var EventSourceUpdateCommand = {
22546
22558
  alias: "c",
22547
22559
  describe: "执行的命令(lark-cli 类型)",
22548
22560
  type: "string"
22561
+ }).option("event-keys", {
22562
+ describe: "lark-cli 要消费的 EventKey 列表(逗号分隔,如 " + "'im.message.receive_v1,card.action.trigger');一个 key = 一个 consume 子进程",
22563
+ type: "string"
22549
22564
  }).option("url", {
22550
22565
  alias: "u",
22551
22566
  describe: "WebSocket URL",
@@ -22627,6 +22642,9 @@ var EventSourceUpdateCommand = {
22627
22642
  }
22628
22643
  if (a.command !== undefined)
22629
22644
  partial.command = a.command;
22645
+ if (a.eventKeys !== undefined) {
22646
+ partial.eventKeys = String(a.eventKeys).split(",").map((s) => s.trim()).filter(Boolean);
22647
+ }
22630
22648
  if (a.url !== undefined)
22631
22649
  partial.url = a.url;
22632
22650
  if (a.cron !== undefined)
@@ -24273,6 +24291,8 @@ function getSupportedNodeTypes() {
24273
24291
  }
24274
24292
 
24275
24293
  // src/commands/workflow/validators/workflow-validator.ts
24294
+ import { validateTemplateContracts as validateTemplateContractsCore } from "@ai-setting/roy-agent-core/env/workflow/utils";
24295
+
24276
24296
  class WorkflowValidator {
24277
24297
  validate(workflow) {
24278
24298
  const errors = [];
@@ -24293,6 +24313,8 @@ class WorkflowValidator {
24293
24313
  errors.push(...depErrors);
24294
24314
  const templateErrors = this.validateTemplateReferences(nodes, nodeIds);
24295
24315
  errors.push(...templateErrors);
24316
+ const contractErrors = this.collectTemplateContractErrors(workflow, nodes);
24317
+ errors.push(...contractErrors);
24296
24318
  const inputErrors = this.validateWorkflowInputs(nodes, workflow.inputs);
24297
24319
  errors.push(...inputErrors);
24298
24320
  return {
@@ -24402,6 +24424,28 @@ class WorkflowValidator {
24402
24424
  errors.push(...circularErrors);
24403
24425
  return errors;
24404
24426
  }
24427
+ collectTemplateContractErrors(workflow, nodes) {
24428
+ if (nodes.length === 0)
24429
+ return [];
24430
+ try {
24431
+ const findings = validateTemplateContractsCore({
24432
+ ...workflow,
24433
+ nodes
24434
+ });
24435
+ return findings.filter((f) => f.severity === "error").map((f) => ({
24436
+ type: "INVALID_TEMPLATE_REFERENCE" /* INVALID_TEMPLATE_REFERENCE */,
24437
+ description: `[template-contract:${f.rule}] ${f.message}`,
24438
+ expected: "Template field must match the source node's output contract",
24439
+ actual: `Template "${f.template}" references a field the source node (${f.sourceNodeType ?? "?"}) does not expose`,
24440
+ fix: f.suggestion ? `Change it to "${f.suggestion}"` : "Use the source node's declared output field (see node output contracts)",
24441
+ nodeId: f.nodeId,
24442
+ template: f.template,
24443
+ referencedNodeId: f.sourceNodeId
24444
+ }));
24445
+ } catch {
24446
+ return [];
24447
+ }
24448
+ }
24405
24449
  validateTemplateReferences(nodes, nodeIds) {
24406
24450
  const errors = [];
24407
24451
  const templatePatterns = [
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/roy-agent-linux-x64/bin/roy-agent
3
- size: 109738112 bytes
4
- sha256: 6f42d0a97bd8cdca9ab16f1ede8679d3bf22073a61bdab36b2a6a6ddf6a35e90
3
+ size: 109787264 bytes
4
+ sha256: 8caba701e046d4639e90cc7d78e09ed389728d81781e63798c3e76663e4f1fe8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-setting/roy-agent-cli",
3
- "version": "1.7.50",
3
+ "version": "1.7.52",
4
4
  "type": "module",
5
5
  "description": "CLI for roy-agent - Non-interactive command execution",
6
6
  "main": "./dist/index.js",