@erdoai/cli 0.193.1 → 0.194.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 +22 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1515,6 +1515,9 @@ var ErdoClient = class {
1515
1515
  setProviderLeadSource(input) {
1516
1516
  return this.request("PUT", "/v1/provider-lead-sources", input, false);
1517
1517
  }
1518
+ upsertDeclaration(input) {
1519
+ return this.request("PUT", "/v1/declarations", input, false);
1520
+ }
1518
1521
  importLeadSourceRows(input) {
1519
1522
  return this.request("POST", "/v1/provider-lead-sources/import", input, false);
1520
1523
  }
@@ -10306,6 +10309,25 @@ pipelinesCmd.command("mark-handled <slug>").description("Record that failed exec
10306
10309
  fail(e);
10307
10310
  }
10308
10311
  });
10312
+ var declarationsCmd = program.command("declarations").description("Metric and other declarations an app commits for this organization");
10313
+ declarationsCmd.command("upsert").description("Write one declaration. The same namespace, kind, key and scope update the existing row").requiredOption("--namespace <namespace>", "the owning app's namespace").requiredOption("--kind <kind>", "declaration kind, for example metric").requiredOption("--key <key>", "what is declared, for example spend").option("--meaning <meaning>", "the expression; leave empty with --adopt to take the connector template").option("--status <status>", "confirmed only after the owning app merged it through a reviewed pull request; anything else is a draft", "draft").option("--source <source>", "synced source the declaration covers (requires --table)").option("--table <table>", "synced table the declaration covers (requires --source)").option("--adopt", "copy the connector template for this kind, key, source and table").option("--reasoning <text>", "why").option("--confidence <level>", "confidence in a proposal").action(async (opts) => {
10314
+ try {
10315
+ if (Boolean(opts.source) !== Boolean(opts.table)) throw new Error("--source and --table must be set together");
10316
+ print(await new ErdoClient().upsertDeclaration({
10317
+ namespace: opts.namespace,
10318
+ kind: opts.kind,
10319
+ key: opts.key,
10320
+ meaning: opts.meaning ?? "",
10321
+ status: opts.status,
10322
+ reasoning: opts.reasoning,
10323
+ confidence: opts.confidence,
10324
+ adopt: opts.adopt,
10325
+ scope: opts.source && opts.table ? { source: opts.source, table: opts.table } : void 0
10326
+ }));
10327
+ } catch (e) {
10328
+ fail(e);
10329
+ }
10330
+ });
10309
10331
  var knowledgeCmd = program.command("knowledge").description("Knowledge objects");
10310
10332
  knowledgeCmd.command("create").description("Create a Knowledge object").requiredOption("--title <title>", "title").requiredOption("--body <body>", "body text, or @file").option("--description <description>", "short description").option("--type <type>", "snippet or skill", "snippet").option("--category <category>", "category").option("--tags <tags>", "comma-separated tags").option("--agent <name>", "name of the agent making the write").action(async (opts) => {
10311
10333
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.193.1",
4
- "description": "Erdo CLI — drive datasets, pages, and evals from the terminal or CI",
3
+ "version": "0.194.0",
4
+ "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "erdo": "dist/index.js"