@engini/cli 0.32.0 → 0.33.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 (3) hide show
  1. package/README.md +6 -0
  2. package/dist/cli.js +20 -9
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -78,11 +78,17 @@ table on stderr (a JSON object when piped) and exits 3 (401/403, e.g. `API_KEY_R
78
78
  ```bash
79
79
  engini workflows folders --name sales # folder ids (names are unique per workspace + environment)
80
80
  engini workflows list --name "lead alert" --folder Sales
81
+ engini workflows schema monday.create_item --connection 42 --selected BOARD_ID=123 # pick a board, re-read its fields
81
82
  engini workflows compile --file plan.json # dry run: hasErrors + diagnostics
82
83
  engini workflows create --file plan.json --folder-id 7
83
84
  engini workflows plan 1234 > plan.json && engini workflows update 1234 --file plan.json --expected-revision-id 3
84
85
  ```
85
86
 
87
+ `schema` lists `objectPickers` (`{field, side}`: a board, a Salesforce object, …). Pick a value
88
+ per field with `--selected FIELD=value` (repeatable, needs `--connection`) and read again: the
89
+ picked object's fields come back as input properties named by field id. A pick that cannot be
90
+ resolved still answers 200 and is listed in `unresolvedPicks` (`not_found` | `read_failed`).
91
+
86
92
  The `mcp` group maintains the MCP endpoints Engini **exposes** (not the
87
93
  `MCPClient` connection kind, which is Engini *consuming* someone else's server).
88
94
  Servers are account-wide and are created/deleted in the engini.io UI, so the group
package/dist/cli.js CHANGED
@@ -465,7 +465,7 @@ function saveConfig(config, path = configPath()) {
465
465
  }
466
466
 
467
467
  // src/version.ts
468
- var VERSION = true ? "0.32.0" : "0.0.0";
468
+ var VERSION = true ? "0.33.0" : "0.0.0";
469
469
 
470
470
  // src/http.ts
471
471
  var USER_AGENT_PREFIX = `engini-cli/${VERSION}`;
@@ -5364,21 +5364,26 @@ async function searchBody(query, opts) {
5364
5364
  }
5365
5365
  async function schemaBody(slug, opts) {
5366
5366
  if (!slug) fail(2 /* USAGE */, "A catalog slug is required.");
5367
+ const selected = parsePairs(opts.selected, "--selected");
5368
+ if (selected !== void 0 && opts.connection === void 0) {
5369
+ fail(2 /* USAGE */, "--selected needs --connection: a pick is read through a connection.");
5370
+ }
5367
5371
  const schema = await apiErrors(
5368
5372
  async () => buildClient().workflows.getSchema(slug, {
5369
5373
  connectionId: parseOptId(opts.connection, "--connection"),
5370
5374
  kind: opts.kind,
5371
- table: opts.table
5375
+ table: opts.table,
5376
+ selected
5372
5377
  })
5373
5378
  );
5374
5379
  printOutput(schema);
5375
5380
  }
5376
- function parseDependsOn(pairs) {
5381
+ function parsePairs(pairs, flag) {
5377
5382
  if (pairs === void 0) return void 0;
5378
5383
  const out = {};
5379
5384
  for (const pair of pairs) {
5380
5385
  const eq = pair.indexOf("=");
5381
- if (eq <= 0) fail(2 /* USAGE */, `--depends-on must be field=value, got '${pair}'.`);
5386
+ if (eq <= 0) fail(2 /* USAGE */, `${flag} must be field=value, got '${pair}'.`);
5382
5387
  out[pair.slice(0, eq)] = pair.slice(eq + 1);
5383
5388
  }
5384
5389
  return out;
@@ -5390,7 +5395,7 @@ async function optionsBody(slug, opts) {
5390
5395
  field: opts.field,
5391
5396
  connectionId: parseOptId(opts.connection, "--connection"),
5392
5397
  kind: opts.kind,
5393
- dependsOn: parseDependsOn(opts.dependsOn)
5398
+ dependsOn: parsePairs(opts.dependsOn, "--depends-on")
5394
5399
  })
5395
5400
  );
5396
5401
  printOutput(items);
@@ -5488,11 +5493,17 @@ function registerWorkflows(program) {
5488
5493
  search.action(async (q, opts, command) => {
5489
5494
  await runCommand(command, opts, false, () => searchBody(q, opts));
5490
5495
  });
5491
- const schema = workflows.command("schema").description("Input/output schema of one catalog entry (the slug from `search`).").argument("[slug]", "Catalog slug, e.g. slack.post_message").option("--connection <id>", "Resolve dynamic fields against this connection").option("--kind <kind>", "action | trigger | block").option("--table <id>", "Table the entry is used on");
5496
+ const schema = workflows.command("schema").description("Input/output schema of one catalog entry (the slug from `search`).").argument("[slug]", "Catalog slug, e.g. slack.post_message").option("--connection <id>", "Resolve dynamic fields against this connection").option("--kind <kind>", "action | trigger | block").option("--table <id>", "Table the entry is used on").option("--selected <FIELD=value>", "Pick an object for a picker field; repeatable. Needs --connection", collect4);
5497
+ schema.addHelpText(
5498
+ "after",
5499
+ "\nObject pickers (a Monday board, a Salesforce object, \u2026): the first read lists them in\n`objectPickers` ({field, side: request|response|both}). Pick a value for each with\n--selected FIELD=value and read again: the picked object's fields come back as input\nproperties named by field id, with their enums. A pick that cannot be resolved is listed\nin `unresolvedPicks` ({field, value, reason: not_found|read_failed}); the answer is still\n200. A {{ref}} value picks nothing.\n\nExamples:\n engini workflows schema monday.create_item --connection 42\n engini workflows schema monday.create_item --connection 42 --selected BOARD_ID=123"
5500
+ );
5492
5501
  addUniversalOptions(schema);
5493
- schema.action(async (slug, opts, command) => {
5494
- await runCommand(command, opts, false, () => schemaBody(slug, opts));
5495
- });
5502
+ schema.action(
5503
+ async (slug, opts, command) => {
5504
+ await runCommand(command, opts, false, () => schemaBody(slug, opts));
5505
+ }
5506
+ );
5496
5507
  const options = workflows.command("options").description("Dropdown values ({id, label}) for one field of a catalog entry.").argument("[slug]", "Catalog slug").option("--field <name>", "The field to list values for").option("--connection <id>", "Connection to read the values through").option("--kind <kind>", "action | trigger | block").option("--depends-on <field=value>", "Value of a parent field; repeatable", collect4);
5497
5508
  options.addHelpText(
5498
5509
  "after",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engini/cli",
3
- "version": "0.32.0",
3
+ "version": "0.33.0",
4
4
  "description": "Engini CLI — machine-first command line over the Engini Public API",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "test": "vitest run"
27
27
  },
28
28
  "dependencies": {
29
- "@engini/sdk": "^0.32.0",
29
+ "@engini/sdk": "^0.33.0",
30
30
  "commander": "^12.1.0",
31
31
  "smol-toml": "^1.3.0"
32
32
  },