@asteroidai/cli 1.9.555 → 1.9.556

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/asteroid.js CHANGED
@@ -2591,7 +2591,7 @@ var COMMANDS = [
2591
2591
  command: "insight-rule create",
2592
2592
  tool: "insight_rule_create",
2593
2593
  title: "Create insight rule",
2594
- description: "Create an insight rule. `match` is a CEL expression over one finished execution, read as `execution` (`status`, `outcome`, `outputNodeId`, `cancelReason`, `duration` in seconds, `scriptFailures` with `nodeId`, `nodeName`, `scriptFilepath`, `actionId`, `error`) and `params`. `fire` reads `window` (the last `lookbackSeconds`) and `baseline` (the `baselineSeconds` before it), each with `total`, `matched`, `rate` and `avg.duration`, and `params`. Put thresholds in `params`, each with a type (`number`, `percent` as a fraction, `text`, `list`): for example `fire` `window.rate >= params.minRate && window.total >= params.minExecutions` with `minRate` percent 0.2 and `minExecutions` number 10. Set `workflowId` for one workflow, or omit it for every workflow. Run `insight_rule_validate` first: it checks the rule and shows on which of the last 14 days it would have fired. The rule opens at /insights?tab=rules&rule=<id>.",
2594
+ description: 'Create an insight rule from three CEL expressions. `scope` reads `workflow` (`workflow.id`): `true` for every workflow, `workflow.id in ["<id>"]` for some, `!(workflow.id in ["<id>"])` for all but some. `match` reads one finished `execution` (`status`, `outcome`, `outputNodeId`, `cancelReason`, `duration` in seconds, `scriptFailures` with `nodeId`, `nodeName`, `scriptFilepath`, `actionId`, `error`) and `params`. `fire` reads `window` (the last `lookbackSeconds`) and `baseline` (the `baselineSeconds` before it), each with `total`, `matched`, `rate` and `avg.duration`, and `params`. Put thresholds in `params`, each with a type (`number`, `percent` as a fraction, `text`, `list`): for example `fire` `window.rate >= params.minRate && window.total >= params.minExecutions` with `minRate` percent 0.2 and `minExecutions` number 10. A workflow can change param values for itself in `workflows`. Run `insight_rule_validate` first: it checks the rule and shows on which of the last 14 days it would have fired. The rule opens at /insights?tab=rules&rule=<id>.',
2595
2595
  method: "POST",
2596
2596
  path: "/astro/v2/insight-rules",
2597
2597
  args: [],
@@ -2616,17 +2616,25 @@ var COMMANDS = [
2616
2616
  required: false
2617
2617
  },
2618
2618
  {
2619
- name: "workflowId",
2620
- flag: "workflow-id",
2619
+ name: "enabled",
2620
+ flag: "enabled",
2621
+ type: "boolean",
2622
+ required: false,
2623
+ description: "Defaults to true."
2624
+ },
2625
+ {
2626
+ name: "scope",
2627
+ flag: "scope",
2621
2628
  type: "string",
2622
2629
  required: false,
2623
- description: "Apply the rule to one workflow. Omit it for every workflow in the organization."
2630
+ description: "CEL over `workflow` (`workflow.id`). Which workflows the rule checks. `true`, the default, is every workflow."
2624
2631
  },
2625
2632
  {
2626
2633
  name: "match",
2627
2634
  flag: "match",
2628
2635
  type: "string",
2629
- required: true
2636
+ required: true,
2637
+ description: "CEL over one finished `execution` and `params`. Which executions count."
2630
2638
  },
2631
2639
  {
2632
2640
  name: "fire",
@@ -2658,11 +2666,12 @@ var COMMANDS = [
2658
2666
  record: "json"
2659
2667
  },
2660
2668
  {
2661
- name: "enabled",
2662
- flag: "enabled",
2663
- type: "boolean",
2669
+ name: "workflows",
2670
+ flag: "workflows",
2671
+ type: "json",
2664
2672
  required: false,
2665
- description: "Defaults to true."
2673
+ description: "Per-workflow param values, keyed by workflow ID.",
2674
+ record: "json"
2666
2675
  }
2667
2676
  ],
2668
2677
  files: [],
@@ -2713,7 +2722,7 @@ var COMMANDS = [
2713
2722
  command: "insight-rule list",
2714
2723
  tool: "insight_rules_list",
2715
2724
  title: "List insight rules",
2716
- description: "List an organization's insight rules. A rule watches finished executions: `match` is a CEL expression that picks the executions that count, and `fire`, also CEL, says when Astro investigates and records an insight. A rule with `presetKey` is maintained by Asteroid.",
2725
+ description: "List an organization's insight rules. A rule has three CEL expressions: `scope` picks the workflows it checks, `match` picks the finished executions that count, and `fire` says when Astro investigates and records an insight. A rule with `presetKey` is maintained by Asteroid.",
2717
2726
  method: "GET",
2718
2727
  path: "/astro/v2/insight-rules",
2719
2728
  args: [],
@@ -2739,7 +2748,7 @@ var COMMANDS = [
2739
2748
  command: "insight-rule update",
2740
2749
  tool: "insight_rule_update",
2741
2750
  title: "Update insight rule",
2742
- description: "Change an insight rule. Send only the fields to change. A rule with `presetKey` keeps its `match`, its `fire` and its params' names and types. Run `insight_rule_validate` before you change `match` or `fire`.",
2751
+ description: "Change an insight rule. Send only the fields to change. A rule with `presetKey` keeps its `match`, its `fire` and its params' names and types. `workflows` replaces every workflow's values, so send the full map. Run `insight_rule_validate` before you change an expression.",
2743
2752
  method: "PATCH",
2744
2753
  path: "/astro/v2/insight-rules/{ruleId}",
2745
2754
  args: [
@@ -2770,11 +2779,26 @@ var COMMANDS = [
2770
2779
  type: "string",
2771
2780
  required: false
2772
2781
  },
2782
+ {
2783
+ name: "enabled",
2784
+ flag: "enabled",
2785
+ type: "boolean",
2786
+ required: false,
2787
+ description: "The master switch. False turns the rule off for every workflow."
2788
+ },
2789
+ {
2790
+ name: "scope",
2791
+ flag: "scope",
2792
+ type: "string",
2793
+ required: false,
2794
+ description: "CEL over `workflow` (`workflow.id`). Which workflows the rule checks. `true` is every workflow."
2795
+ },
2773
2796
  {
2774
2797
  name: "match",
2775
2798
  flag: "match",
2776
2799
  type: "string",
2777
- required: false
2800
+ required: false,
2801
+ description: "CEL over one finished `execution` and `params`. Which executions count."
2778
2802
  },
2779
2803
  {
2780
2804
  name: "fire",
@@ -2806,10 +2830,12 @@ var COMMANDS = [
2806
2830
  record: "json"
2807
2831
  },
2808
2832
  {
2809
- name: "enabled",
2810
- flag: "enabled",
2811
- type: "boolean",
2812
- required: false
2833
+ name: "workflows",
2834
+ flag: "workflows",
2835
+ type: "json",
2836
+ required: false,
2837
+ description: "Replaces the per-workflow param values, keyed by workflow ID.",
2838
+ record: "json"
2813
2839
  }
2814
2840
  ],
2815
2841
  files: [],
@@ -2820,7 +2846,7 @@ var COMMANDS = [
2820
2846
  command: "insight-rule validate",
2821
2847
  tool: "insight_rule_validate",
2822
2848
  title: "Validate insight rule",
2823
- description: "Check an insight rule before it is saved, and test it against the last 14 days of executions. `valid` is false with an `error` when `match` or `fire` does not parse, reads a name or field that does not exist, reads a param that `params` lacks, or does not give true or false, or when a param's value does not fit its type. When valid, `days` gives each day's finished executions, how many `match` counts, and whether the rule would have fired. Saves nothing.",
2849
+ description: "Check an insight rule before it is saved, and test it against the last 14 days of executions. `valid` is false with an `error` when `scope`, `match` or `fire` does not parse, reads a name or field that does not exist, reads a param that `params` lacks, or does not give true or false, or when a param's value does not fit its type. When valid, `days` gives each day's finished executions, how many `match` counts, and whether the rule would have fired. Saves nothing.",
2824
2850
  method: "POST",
2825
2851
  path: "/astro/v2/insight-rules/validate",
2826
2852
  args: [],
@@ -2837,13 +2863,35 @@ var COMMANDS = [
2837
2863
  flag: "workflow-id",
2838
2864
  type: "string",
2839
2865
  required: false,
2840
- description: "Test against one workflow. Omit it to test against every workflow in the organization."
2866
+ description: "Test against one workflow. Omit it to test against every workflow `scope` allows."
2867
+ },
2868
+ {
2869
+ name: "name",
2870
+ flag: "name",
2871
+ type: "string",
2872
+ required: false,
2873
+ description: "The name the rule will have, at most 120 characters. It is not part of the check. A client that shows the draft uses it."
2874
+ },
2875
+ {
2876
+ name: "description",
2877
+ flag: "description",
2878
+ type: "string",
2879
+ required: false,
2880
+ description: "The description the rule will have, at most 2,000 characters. It is not part of the check."
2881
+ },
2882
+ {
2883
+ name: "scope",
2884
+ flag: "scope",
2885
+ type: "string",
2886
+ required: false,
2887
+ description: "CEL over `workflow` (`workflow.id`). Which workflows the rule checks. `true` is every workflow."
2841
2888
  },
2842
2889
  {
2843
2890
  name: "match",
2844
2891
  flag: "match",
2845
2892
  type: "string",
2846
- required: true
2893
+ required: true,
2894
+ description: "CEL over one finished `execution` and `params`. Which executions count."
2847
2895
  },
2848
2896
  {
2849
2897
  name: "fire",
@@ -8878,7 +8926,7 @@ var ApiError = class extends Error {
8878
8926
  status;
8879
8927
  body;
8880
8928
  };
8881
- var VERSION = "1.9.555";
8929
+ var VERSION = "1.9.556";
8882
8930
  function problem(status, body, fallback) {
8883
8931
  if (body && typeof body === "object") {
8884
8932
  const record2 = body;
package/dist/core.js CHANGED
@@ -2612,7 +2612,7 @@ var COMMANDS = [
2612
2612
  command: "insight-rule create",
2613
2613
  tool: "insight_rule_create",
2614
2614
  title: "Create insight rule",
2615
- description: "Create an insight rule. `match` is a CEL expression over one finished execution, read as `execution` (`status`, `outcome`, `outputNodeId`, `cancelReason`, `duration` in seconds, `scriptFailures` with `nodeId`, `nodeName`, `scriptFilepath`, `actionId`, `error`) and `params`. `fire` reads `window` (the last `lookbackSeconds`) and `baseline` (the `baselineSeconds` before it), each with `total`, `matched`, `rate` and `avg.duration`, and `params`. Put thresholds in `params`, each with a type (`number`, `percent` as a fraction, `text`, `list`): for example `fire` `window.rate >= params.minRate && window.total >= params.minExecutions` with `minRate` percent 0.2 and `minExecutions` number 10. Set `workflowId` for one workflow, or omit it for every workflow. Run `insight_rule_validate` first: it checks the rule and shows on which of the last 14 days it would have fired. The rule opens at /insights?tab=rules&rule=<id>.",
2615
+ description: 'Create an insight rule from three CEL expressions. `scope` reads `workflow` (`workflow.id`): `true` for every workflow, `workflow.id in ["<id>"]` for some, `!(workflow.id in ["<id>"])` for all but some. `match` reads one finished `execution` (`status`, `outcome`, `outputNodeId`, `cancelReason`, `duration` in seconds, `scriptFailures` with `nodeId`, `nodeName`, `scriptFilepath`, `actionId`, `error`) and `params`. `fire` reads `window` (the last `lookbackSeconds`) and `baseline` (the `baselineSeconds` before it), each with `total`, `matched`, `rate` and `avg.duration`, and `params`. Put thresholds in `params`, each with a type (`number`, `percent` as a fraction, `text`, `list`): for example `fire` `window.rate >= params.minRate && window.total >= params.minExecutions` with `minRate` percent 0.2 and `minExecutions` number 10. A workflow can change param values for itself in `workflows`. Run `insight_rule_validate` first: it checks the rule and shows on which of the last 14 days it would have fired. The rule opens at /insights?tab=rules&rule=<id>.',
2616
2616
  method: "POST",
2617
2617
  path: "/astro/v2/insight-rules",
2618
2618
  args: [],
@@ -2637,17 +2637,25 @@ var COMMANDS = [
2637
2637
  required: false
2638
2638
  },
2639
2639
  {
2640
- name: "workflowId",
2641
- flag: "workflow-id",
2640
+ name: "enabled",
2641
+ flag: "enabled",
2642
+ type: "boolean",
2643
+ required: false,
2644
+ description: "Defaults to true."
2645
+ },
2646
+ {
2647
+ name: "scope",
2648
+ flag: "scope",
2642
2649
  type: "string",
2643
2650
  required: false,
2644
- description: "Apply the rule to one workflow. Omit it for every workflow in the organization."
2651
+ description: "CEL over `workflow` (`workflow.id`). Which workflows the rule checks. `true`, the default, is every workflow."
2645
2652
  },
2646
2653
  {
2647
2654
  name: "match",
2648
2655
  flag: "match",
2649
2656
  type: "string",
2650
- required: true
2657
+ required: true,
2658
+ description: "CEL over one finished `execution` and `params`. Which executions count."
2651
2659
  },
2652
2660
  {
2653
2661
  name: "fire",
@@ -2679,11 +2687,12 @@ var COMMANDS = [
2679
2687
  record: "json"
2680
2688
  },
2681
2689
  {
2682
- name: "enabled",
2683
- flag: "enabled",
2684
- type: "boolean",
2690
+ name: "workflows",
2691
+ flag: "workflows",
2692
+ type: "json",
2685
2693
  required: false,
2686
- description: "Defaults to true."
2694
+ description: "Per-workflow param values, keyed by workflow ID.",
2695
+ record: "json"
2687
2696
  }
2688
2697
  ],
2689
2698
  files: [],
@@ -2734,7 +2743,7 @@ var COMMANDS = [
2734
2743
  command: "insight-rule list",
2735
2744
  tool: "insight_rules_list",
2736
2745
  title: "List insight rules",
2737
- description: "List an organization's insight rules. A rule watches finished executions: `match` is a CEL expression that picks the executions that count, and `fire`, also CEL, says when Astro investigates and records an insight. A rule with `presetKey` is maintained by Asteroid.",
2746
+ description: "List an organization's insight rules. A rule has three CEL expressions: `scope` picks the workflows it checks, `match` picks the finished executions that count, and `fire` says when Astro investigates and records an insight. A rule with `presetKey` is maintained by Asteroid.",
2738
2747
  method: "GET",
2739
2748
  path: "/astro/v2/insight-rules",
2740
2749
  args: [],
@@ -2760,7 +2769,7 @@ var COMMANDS = [
2760
2769
  command: "insight-rule update",
2761
2770
  tool: "insight_rule_update",
2762
2771
  title: "Update insight rule",
2763
- description: "Change an insight rule. Send only the fields to change. A rule with `presetKey` keeps its `match`, its `fire` and its params' names and types. Run `insight_rule_validate` before you change `match` or `fire`.",
2772
+ description: "Change an insight rule. Send only the fields to change. A rule with `presetKey` keeps its `match`, its `fire` and its params' names and types. `workflows` replaces every workflow's values, so send the full map. Run `insight_rule_validate` before you change an expression.",
2764
2773
  method: "PATCH",
2765
2774
  path: "/astro/v2/insight-rules/{ruleId}",
2766
2775
  args: [
@@ -2791,11 +2800,26 @@ var COMMANDS = [
2791
2800
  type: "string",
2792
2801
  required: false
2793
2802
  },
2803
+ {
2804
+ name: "enabled",
2805
+ flag: "enabled",
2806
+ type: "boolean",
2807
+ required: false,
2808
+ description: "The master switch. False turns the rule off for every workflow."
2809
+ },
2810
+ {
2811
+ name: "scope",
2812
+ flag: "scope",
2813
+ type: "string",
2814
+ required: false,
2815
+ description: "CEL over `workflow` (`workflow.id`). Which workflows the rule checks. `true` is every workflow."
2816
+ },
2794
2817
  {
2795
2818
  name: "match",
2796
2819
  flag: "match",
2797
2820
  type: "string",
2798
- required: false
2821
+ required: false,
2822
+ description: "CEL over one finished `execution` and `params`. Which executions count."
2799
2823
  },
2800
2824
  {
2801
2825
  name: "fire",
@@ -2827,10 +2851,12 @@ var COMMANDS = [
2827
2851
  record: "json"
2828
2852
  },
2829
2853
  {
2830
- name: "enabled",
2831
- flag: "enabled",
2832
- type: "boolean",
2833
- required: false
2854
+ name: "workflows",
2855
+ flag: "workflows",
2856
+ type: "json",
2857
+ required: false,
2858
+ description: "Replaces the per-workflow param values, keyed by workflow ID.",
2859
+ record: "json"
2834
2860
  }
2835
2861
  ],
2836
2862
  files: [],
@@ -2841,7 +2867,7 @@ var COMMANDS = [
2841
2867
  command: "insight-rule validate",
2842
2868
  tool: "insight_rule_validate",
2843
2869
  title: "Validate insight rule",
2844
- description: "Check an insight rule before it is saved, and test it against the last 14 days of executions. `valid` is false with an `error` when `match` or `fire` does not parse, reads a name or field that does not exist, reads a param that `params` lacks, or does not give true or false, or when a param's value does not fit its type. When valid, `days` gives each day's finished executions, how many `match` counts, and whether the rule would have fired. Saves nothing.",
2870
+ description: "Check an insight rule before it is saved, and test it against the last 14 days of executions. `valid` is false with an `error` when `scope`, `match` or `fire` does not parse, reads a name or field that does not exist, reads a param that `params` lacks, or does not give true or false, or when a param's value does not fit its type. When valid, `days` gives each day's finished executions, how many `match` counts, and whether the rule would have fired. Saves nothing.",
2845
2871
  method: "POST",
2846
2872
  path: "/astro/v2/insight-rules/validate",
2847
2873
  args: [],
@@ -2858,13 +2884,35 @@ var COMMANDS = [
2858
2884
  flag: "workflow-id",
2859
2885
  type: "string",
2860
2886
  required: false,
2861
- description: "Test against one workflow. Omit it to test against every workflow in the organization."
2887
+ description: "Test against one workflow. Omit it to test against every workflow `scope` allows."
2888
+ },
2889
+ {
2890
+ name: "name",
2891
+ flag: "name",
2892
+ type: "string",
2893
+ required: false,
2894
+ description: "The name the rule will have, at most 120 characters. It is not part of the check. A client that shows the draft uses it."
2895
+ },
2896
+ {
2897
+ name: "description",
2898
+ flag: "description",
2899
+ type: "string",
2900
+ required: false,
2901
+ description: "The description the rule will have, at most 2,000 characters. It is not part of the check."
2902
+ },
2903
+ {
2904
+ name: "scope",
2905
+ flag: "scope",
2906
+ type: "string",
2907
+ required: false,
2908
+ description: "CEL over `workflow` (`workflow.id`). Which workflows the rule checks. `true` is every workflow."
2862
2909
  },
2863
2910
  {
2864
2911
  name: "match",
2865
2912
  flag: "match",
2866
2913
  type: "string",
2867
- required: true
2914
+ required: true,
2915
+ description: "CEL over one finished `execution` and `params`. Which executions count."
2868
2916
  },
2869
2917
  {
2870
2918
  name: "fire",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asteroidai/cli",
3
- "version": "1.9.555",
3
+ "version": "1.9.556",
4
4
  "description": "The asteroid command-line interface for the Asteroid platform.",
5
5
  "type": "module",
6
6
  "license": "MIT",