ccem 2.110.0 → 2.111.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.
Files changed (2) hide show
  1. package/dist/index.js +10 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5611,6 +5611,7 @@ function createCronTask(input, tasksPath = getCronTasksPath()) {
5611
5611
  maxBudgetUsd,
5612
5612
  allowedTools: input.allowedTools ?? [],
5613
5613
  disallowedTools: input.disallowedTools ?? [],
5614
+ requiredSkills: normalizeRequiredSkills(input.requiredSkills ?? []),
5614
5615
  enabled: input.enabled ?? true,
5615
5616
  timeoutSecs,
5616
5617
  templateId: input.templateId?.trim() || null,
@@ -5663,6 +5664,7 @@ function parseCronCreateJson(raw) {
5663
5664
  envName: typeof parsed.envName === "string" ? parsed.envName : null,
5664
5665
  executionProfile: typeof parsed.executionProfile === "string" ? parsed.executionProfile : null,
5665
5666
  maxBudgetUsd: typeof parsed.maxBudgetUsd === "number" ? parsed.maxBudgetUsd : null,
5667
+ requiredSkills: normalizeRequiredSkills(parsed.requiredSkills ?? []),
5666
5668
  allowedTools: Array.isArray(parsed.allowedTools) ? parsed.allowedTools.map(String) : null,
5667
5669
  disallowedTools: Array.isArray(parsed.disallowedTools) ? parsed.disallowedTools.map(String) : null,
5668
5670
  enabled: typeof parsed.enabled === "boolean" ? parsed.enabled : null,
@@ -5682,6 +5684,12 @@ function formatCronTaskTableRows(tasks) {
5682
5684
  String(task.timeoutSecs)
5683
5685
  ]);
5684
5686
  }
5687
+ function normalizeRequiredSkills(skills) {
5688
+ if (!Array.isArray(skills) || skills.some((name) => typeof name !== "string" || !/^[a-zA-Z0-9_.:-]{1,256}$/.test(name.trim()))) {
5689
+ throw new Error("Invalid required skill name");
5690
+ }
5691
+ return [...new Set(skills.map((name) => name.trim()))];
5692
+ }
5685
5693
 
5686
5694
  // src/cronCommands.ts
5687
5695
  function registerCronCommands(program2) {
@@ -5722,7 +5730,7 @@ function registerCronCommands(program2) {
5722
5730
  process.exitCode = 1;
5723
5731
  }
5724
5732
  });
5725
- cronCmd.command("create").description("Create a CCEM cron task").option("--from-json <json>", "Read task input from inline JSON, @file, or - for stdin").option("--name <name>", "Task name").option("--cron-expression <expr>", "5-field cron expression").option("--schedule <expr>", "Alias for --cron-expression").option("--prompt <prompt>", "Prompt to run when the task fires").option("--working-dir <dir>", "Task working directory").option("--env-name <name>", "CCEM environment name").option("--execution-profile <profile>", "conservative, standard, or autonomous").option("--max-budget-usd <amount>", "Optional max budget in USD").option("--allowed-tools <items>", "Comma-separated or JSON array of allowed tools").option("--disallowed-tools <items>", "Comma-separated or JSON array of disallowed tools").option("--timeout-secs <seconds>", "Task timeout in seconds").option("--template-id <id>", "Optional template id").option("--wecom-result", "Send cron result summary to the configured WeCom default target").option("--wecom-bot-id <id>", "WeCom bot id for cron result notifications").option("--wecom-peer-id <id>", "WeCom peer id for cron result notifications").option("--disabled", "Create task disabled").option("--json", "Output as JSON").action(async (options) => {
5733
+ cronCmd.command("create").description("Create a CCEM cron task").option("--from-json <json>", "Read task input from inline JSON, @file, or - for stdin").option("--name <name>", "Task name").option("--cron-expression <expr>", "5-field cron expression").option("--schedule <expr>", "Alias for --cron-expression").option("--prompt <prompt>", "Prompt to run when the task fires").option("--working-dir <dir>", "Task working directory").option("--env-name <name>", "CCEM environment name").option("--execution-profile <profile>", "conservative, standard, or autonomous").option("--max-budget-usd <amount>", "Optional max budget in USD").option("--allowed-tools <items>", "Comma-separated or JSON array of allowed tools").option("--disallowed-tools <items>", "Comma-separated or JSON array of disallowed tools").option("--required-skills <items>", "Skills required before the task may run").option("--timeout-secs <seconds>", "Task timeout in seconds").option("--template-id <id>", "Optional template id").option("--wecom-result", "Send cron result summary to the configured WeCom default target").option("--wecom-bot-id <id>", "WeCom bot id for cron result notifications").option("--wecom-peer-id <id>", "WeCom peer id for cron result notifications").option("--disabled", "Create task disabled").option("--json", "Output as JSON").action(async (options) => {
5726
5734
  try {
5727
5735
  const input = options.fromJson ? parseCronCreateJson(options.fromJson) : {
5728
5736
  name: options.name,
@@ -5734,6 +5742,7 @@ function registerCronCommands(program2) {
5734
5742
  maxBudgetUsd: options.maxBudgetUsd === void 0 ? null : Number(options.maxBudgetUsd),
5735
5743
  allowedTools: parseStringList(options.allowedTools),
5736
5744
  disallowedTools: parseStringList(options.disallowedTools),
5745
+ requiredSkills: parseStringList(options.requiredSkills),
5737
5746
  enabled: options.disabled ? false : true,
5738
5747
  timeoutSecs: options.timeoutSecs === void 0 ? null : Number(options.timeoutSecs),
5739
5748
  templateId: options.templateId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccem",
3
- "version": "2.110.0",
3
+ "version": "2.111.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "Claude Code Environment Manager",