@cargo-ai/cli 1.0.42 → 1.0.43

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.
@@ -1 +1 @@
1
- {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/commands/observability/alert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AA0BxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAiMN"}
1
+ {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/commands/observability/alert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AA0BxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAsMN"}
@@ -16,7 +16,7 @@ function parseBooleanOption(value, optionName) {
16
16
  export function registerAlertCommands(parent, getApi) {
17
17
  const alert = parent
18
18
  .command("alert")
19
- .description("Span alert operations (scheduled threshold alerts on spans)");
19
+ .description("Alert operations (scheduled threshold alerts on spans, runs, records, SQL or a model)");
20
20
  alert
21
21
  .command("list")
22
22
  .description("List all alerts")
@@ -38,8 +38,8 @@ export function registerAlertCommands(parent, getApi) {
38
38
  .description("Create an alert")
39
39
  .requiredOption("--name <name>", "Alert name")
40
40
  .requiredOption("--cron <cron>", 'Evaluation schedule: 5-field cron or "@every <interval>" (UTC), at most once a minute')
41
- .requiredOption("--scope <json>", 'Scope (JSON, e.g. {"kind":"spans","workflowUuid":"..."} or {"kind":"orchestrationSql","sql":"select ..."})')
42
- .requiredOption("--threshold <json>", 'Threshold (JSON). Spans scopes: {"metric":"errorRate","operator":"gte","value":10}, {"metric":"duration","aggregation":"p95","operator":"gte","value":30}, {"metric":"credits","aggregation":"sum","operator":"gte","value":500} or {"metric":"count","operator":"lte","value":0}; SQL scopes: {"metric":"query","operator":"gte","value":10}')
41
+ .requiredOption("--scope <json>", 'Scope (JSON), one of: {"kind":"spans","workflowUuid":"..."}, {"kind":"runs","workflowUuid":"...","statuses":["error"]}, {"kind":"records","workflowUuid":"...","statuses":["error"]}, {"kind":"orchestrationQuery","query":"select ..."}, {"kind":"storageQuery","query":"select ..."} or {"kind":"model","modelUuid":"...","filter":{...}}')
42
+ .requiredOption("--threshold <json>", 'Threshold (JSON). Spans, runs and records scopes: {"metric":"errorRate","operator":"gte","value":10}, {"metric":"duration","aggregation":"p95","operator":"gte","value":30}, {"metric":"credits","aggregation":"sum","operator":"gte","value":500} or {"metric":"count","operator":"lte","value":0}; model scopes: {"metric":"recordsCount","operator":"lte","value":0}, {"metric":"recordsShare","operator":"gte","value":30} (needs a scope filter), {"metric":"freshness","operator":"gte","value":60} or {"metric":"syncDuration","operator":"gte","value":300}; query scopes: {"metric":"query","operator":"gte","value":10}')
43
43
  .option("--actions <json>", "Actions fired as runs on breach (JSON Action[]: connector, tool, or agent nodes)")
44
44
  .option("--disabled", "Create the alert disabled")
45
45
  .option("--description <text>", "What this alert watches")
@@ -67,8 +67,8 @@ export function registerAlertCommands(parent, getApi) {
67
67
  .option("--name <name>", "Alert name")
68
68
  .option("--cron <cron>", 'Evaluation schedule: 5-field cron or "@every <interval>" (UTC), at most once a minute')
69
69
  .option("--enabled <boolean>", "Enable or disable the alert (true/false)")
70
- .option("--scope <json>", "Span scope (JSON)")
71
- .option("--threshold <json>", "Threshold (JSON)")
70
+ .option("--scope <json>", "Scope (JSON). See `alert create`")
71
+ .option("--threshold <json>", "Threshold (JSON). See `alert create`")
72
72
  .option("--actions <json>", "Actions fired as runs on breach (JSON Action[])")
73
73
  .option("--description <text>", 'What this alert watches, or "none" to clear it')
74
74
  .option("--folder <uuid>", 'Folder UUID to move the alert to, or "none" to remove it from its folder')
@@ -116,9 +116,9 @@ export function registerAlertCommands(parent, getApi) {
116
116
  alert
117
117
  .command("preview")
118
118
  .description("Evaluate a scope + threshold now, without firing actions")
119
- .requiredOption("--scope <json>", "Span scope (JSON)")
120
- .requiredOption("--threshold <json>", "Threshold (JSON)")
121
- .option("--window-minutes <minutes>", "Evaluation window ending now (filters scope only)", "60")
119
+ .requiredOption("--scope <json>", "Scope (JSON). See `alert create`")
120
+ .requiredOption("--threshold <json>", "Threshold (JSON). See `alert create`")
121
+ .option("--window-minutes <minutes>", "Evaluation window ending now (spans, runs and records scopes only; a model is measured as it stands, and a query windows itself)", "60")
122
122
  .action(async (opts) => {
123
123
  const api = getApi();
124
124
  const result = await handleApiCall(() => api.observability.alert.preview({
@@ -2,11 +2,11 @@ import { handleApiCall, outputJson } from "../runHandler.js";
2
2
  export function registerQueryCommands(parent, getApi) {
3
3
  const query = parent
4
4
  .command("query")
5
- .description("Execute SQL queries against orchestration tables");
5
+ .description("Execute ClickHouse SQL queries against orchestration tables");
6
6
  query
7
7
  .command("execute")
8
- .description("Execute a read-only SQL query")
9
- .argument("<sql>", "SQL query string")
8
+ .description("Execute a read-only ClickHouse SQL query")
9
+ .argument("<sql>", "ClickHouse SQL query string")
10
10
  .addHelpText("after", `
11
11
  Available tables: spans, runs, batches, records
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cargo-ai/cli",
3
- "version": "1.0.42",
3
+ "version": "1.0.43",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "description": "Command-line interface for the Cargo API",
@@ -30,7 +30,7 @@
30
30
  "format:check": "prettier --check ."
31
31
  },
32
32
  "dependencies": {
33
- "@cargo-ai/api": "^1.0.53",
33
+ "@cargo-ai/api": "^1.0.54",
34
34
  "@cargo-ai/app-sdk": "^1.0.5",
35
35
  "@cargo-ai/cdk": "*",
36
36
  "@cargo-ai/types": "*",