@standards/cli 1.0.0-alpha.386 → 1.0.0-alpha.388

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/bin.mjs +24 -2
  2. package/package.json +4 -4
package/dist/bin.mjs CHANGED
@@ -4,7 +4,7 @@ import { createRequire } from "node:module";
4
4
  import { styleText } from "node:util";
5
5
  import { StandardsRequestError, createTransport } from "@standards/client";
6
6
  import { Command } from "commander";
7
- import { DEVICE_CHANNEL_WORKER_CLOSE_PROTOCOL_VIOLATION, RECORDING_OVERRIDES, RECORD_ACCESS_ROLES, RESOURCE_VISIBILITIES, SchemaError, SchemaErrorCode, ValidationError, canonicalStringify, computeReconnectDelay, computeRetryDelay, deviceChannelUrl, diffSchemaState, formatByteSize, parseRecordAccessRole, parseSchemaState, parseServerFrame, schemaStateSourcePayload } from "@standards/schema";
7
+ import { DEVICE_CHANNEL_WORKER_CLOSE_PROTOCOL_VIOLATION, MEETING_RESPONSES, RECORDING_OVERRIDES, RECORD_ACCESS_ROLES, RESOURCE_VISIBILITIES, SchemaError, SchemaErrorCode, ValidationError, canonicalStringify, computeReconnectDelay, computeRetryDelay, deviceChannelUrl, diffSchemaState, formatByteSize, parseRecordAccessRole, parseSchemaState, parseServerFrame, schemaStateSourcePayload } from "@standards/schema";
8
8
  import Table from "cli-table3";
9
9
  import { createAppClient } from "@standards/client/app";
10
10
  import { homedir, hostname } from "node:os";
@@ -1428,7 +1428,7 @@ function registerDocumentsCommand(program) {
1428
1428
  //#endregion
1429
1429
  //#region src/commands/embeddings.ts
1430
1430
  function registerEmbeddingsCommand(program) {
1431
- program.command("embeddings").description("Maintain record embeddings").command("drain").description("Embed every pending memory and skill record of the tenant").action(async (_opts, cmd) => {
1431
+ program.command("embeddings").description("Maintain record and email embeddings").command("drain").description("Embed every pending record and email of the tenant").action(async (_opts, cmd) => {
1432
1432
  const tenant = requireTenant(cmd, "An embedding drain names its tenant explicitly. Pass \"--tenant <id>\".");
1433
1433
  await getAppClientFromCommand(cmd).embeddingsAdmin.drain({ tenantId: tenant });
1434
1434
  process.stdout.write(`${styleText("green", "✓")} Embedding drain accepted for tenant ${tenant}.\n`);
@@ -1620,6 +1620,11 @@ function buildQuery(opts) {
1620
1620
  if (opts.offset !== void 0) query.offset = parseCount("--offset", opts.offset);
1621
1621
  return query;
1622
1622
  }
1623
+ /** "needs_action" is no answer, so the API takes only the schema's answers. */
1624
+ function parseResponse(response) {
1625
+ if (MEETING_RESPONSES.includes(response)) return response;
1626
+ throw new ValidationError(`response must be one of: ${MEETING_RESPONSES.join(", ")}`, []);
1627
+ }
1623
1628
  /** `--auto` clears the override; `--force` / `--skip` set it. Exactly one flag. */
1624
1629
  function parseOverride(opts) {
1625
1630
  const chosen = RECORDING_OVERRIDES.filter((override) => opts[override]);
@@ -1656,6 +1661,16 @@ function registerMeetingsCommand(program) {
1656
1661
  override
1657
1662
  }), getFormat(cmd));
1658
1663
  });
1664
+ meetings.command("respond").description("Answer a meeting invitation").argument("<id>", "meeting ID").argument("<response>", `one of: ${MEETING_RESPONSES.join(", ")}`).option("--notify-organizer", "send the answer to the organizer").action(async (id, response, opts, cmd) => {
1665
+ formatOutput(await getAppClientFromCommand(cmd).meetings.respond({
1666
+ meetingId: id,
1667
+ response: parseResponse(response),
1668
+ notifyOrganizer: opts.notifyOrganizer === true
1669
+ }), getFormat(cmd));
1670
+ });
1671
+ meetings.command("stop-recording").description("Stop the recording of a meeting in progress").argument("<id>", "meeting ID").action(async (id, _opts, cmd) => {
1672
+ formatOutput(await getAppClientFromCommand(cmd).meetings.stopRecording({ meetingId: id }), getFormat(cmd));
1673
+ });
1659
1674
  meetings.command("grants-recompute").description("Recompute the attendee grants of every private meeting of the tenant").action(async (_opts, cmd) => {
1660
1675
  const tenant = requireTenant(cmd, "A meeting grants recompute names its tenant explicitly. Pass \"--tenant <id>\".");
1661
1676
  await getAppClientFromCommand(cmd).meetingsAdmin.recomputeGrants({ tenantId: tenant });
@@ -1822,6 +1837,13 @@ function registerRecordsCommand(program) {
1822
1837
  throw error;
1823
1838
  }
1824
1839
  });
1840
+ records.command("set-logo").description("Set a record's image to the logo of a company's domain").argument("<object>", "object name (e.g. companies)").argument("<recordId>", "record ID").argument("<domain>", "website or bare domain (e.g. acme.com)").action(async (objectName, recordId, domain, _opts, cmd) => {
1841
+ formatOutput(await getAppClientFromCommand(cmd).records.setLogo({
1842
+ objectName,
1843
+ recordId,
1844
+ domain
1845
+ }), getFormat(cmd));
1846
+ });
1825
1847
  records.command("attach-document").description("Upload and attach a local file to a record").argument("<object>", "object name (e.g. contacts)").argument("<recordId>", "record ID").requiredOption("--file <path>", "local file path to upload").option("--attribute <attr>", "attribute name to attach the document to").option("--parent-id <folderId>", "parent folder ID").option("--title <title>", "document title (defaults to filename)").action(async (objectName, recordId, opts, cmd) => {
1826
1848
  const fileContent = await readFile(opts.file);
1827
1849
  const fileName = basename(opts.file);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@standards/cli",
3
- "version": "1.0.0-alpha.386",
3
+ "version": "1.0.0-alpha.388",
4
4
  "description": "CLI tool to interact with Standards API",
5
5
  "type": "module",
6
6
  "bin": {
@@ -19,9 +19,9 @@
19
19
  "commander": "^13.1.0",
20
20
  "typescript": "^5.6.3",
21
21
  "ws": "8.21.1",
22
- "@standards/client": "1.0.0-alpha.386",
23
- "@standards/constants": "1.0.0-alpha.386",
24
- "@standards/schema": "1.0.0-alpha.386"
22
+ "@standards/client": "1.0.0-alpha.388",
23
+ "@standards/constants": "1.0.0-alpha.388",
24
+ "@standards/schema": "1.0.0-alpha.388"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/node": "^25.6.0",