@dayofweek/dcli 1.7.0 → 1.8.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.
package/dist/bin/dcli.js CHANGED
@@ -298,6 +298,36 @@ brainSource
298
298
  overwrite: opts.overwrite,
299
299
  }));
300
300
  });
301
+ const brainActors = brain
302
+ .command("actors")
303
+ .description("Work with an area's actors (people and organizations)");
304
+ brainActors
305
+ .command("list")
306
+ .description("List an area's actors (active, sorted by name)")
307
+ .requiredOption("--area <areaId>", "Area id (from `brain list`)")
308
+ .action(async (opts) => {
309
+ output(await getClient().listBrainActors(opts.area));
310
+ });
311
+ brainActors
312
+ .command("add")
313
+ .description("Add an actor to an area (idempotent on name)")
314
+ .requiredOption("--area <areaId>", "Area id (from `brain list`)")
315
+ .requiredOption("--name <name>", "Actor name (person or organization)")
316
+ .option("--kind <kind>", "person | organization", "organization")
317
+ .option("--role <text>", "Role or relationship in the project")
318
+ .option("--description <text>", "Longer free-text description")
319
+ .action(async (opts) => {
320
+ if (opts.kind !== "person" && opts.kind !== "organization") {
321
+ throw new Error(`--kind must be "person" or "organization", got "${opts.kind}"`);
322
+ }
323
+ output(await getClient().createBrainActor({
324
+ areaId: opts.area,
325
+ name: opts.name,
326
+ kind: opts.kind,
327
+ role: opts.role,
328
+ description: opts.description,
329
+ }));
330
+ });
301
331
  auth
302
332
  .command("devices")
303
333
  .description("List your agent tokens")
@@ -4472,6 +4472,18 @@ var DayOfWeekClient = class {
4472
4472
  async listBrainSources(areaId) {
4473
4473
  return this.get(`/brain/sources?area=${encodeURIComponent(areaId)}`);
4474
4474
  }
4475
+ /** An area's actors (people and organizations, the Actors tab). Active only. */
4476
+ async listBrainActors(areaId) {
4477
+ return this.get(`/brain/actors?area=${encodeURIComponent(areaId)}`);
4478
+ }
4479
+ /**
4480
+ * Create an actor in an area. Idempotent on (area, name): an existing active
4481
+ * actor comes back with `created: false` instead of a duplicate, so imports
4482
+ * can re-run safely.
4483
+ */
4484
+ async createBrainActor(input) {
4485
+ return this.post("/brain/actors", input);
4486
+ }
4475
4487
  /** Entities with an active customer role and no investor/partner/producer role. */
4476
4488
  async adminCustomersOnly() {
4477
4489
  return this.get("/admin/customers-only");
@@ -5098,7 +5110,7 @@ var import_promises4 = require("node:readline/promises");
5098
5110
  // package.json
5099
5111
  var package_default = {
5100
5112
  name: "@dayofweek/dcli",
5101
- version: "1.7.0",
5113
+ version: "1.8.0",
5102
5114
  description: "CLI for the Day of Week AgTech platform \u2014 read data and submit proposals for review",
5103
5115
  license: "MIT",
5104
5116
  type: "module",
@@ -5413,6 +5425,22 @@ brainSource.command("download <uri>").description("Download exact original bytes
5413
5425
  overwrite: opts.overwrite
5414
5426
  }));
5415
5427
  });
5428
+ var brainActors = brain.command("actors").description("Work with an area's actors (people and organizations)");
5429
+ brainActors.command("list").description("List an area's actors (active, sorted by name)").requiredOption("--area <areaId>", "Area id (from `brain list`)").action(async (opts) => {
5430
+ output(await getClient().listBrainActors(opts.area));
5431
+ });
5432
+ brainActors.command("add").description("Add an actor to an area (idempotent on name)").requiredOption("--area <areaId>", "Area id (from `brain list`)").requiredOption("--name <name>", "Actor name (person or organization)").option("--kind <kind>", "person | organization", "organization").option("--role <text>", "Role or relationship in the project").option("--description <text>", "Longer free-text description").action(async (opts) => {
5433
+ if (opts.kind !== "person" && opts.kind !== "organization") {
5434
+ throw new Error(`--kind must be "person" or "organization", got "${opts.kind}"`);
5435
+ }
5436
+ output(await getClient().createBrainActor({
5437
+ areaId: opts.area,
5438
+ name: opts.name,
5439
+ kind: opts.kind,
5440
+ role: opts.role,
5441
+ description: opts.description
5442
+ }));
5443
+ });
5416
5444
  auth.command("devices").description("List your agent tokens").action(async () => {
5417
5445
  const client = getClient();
5418
5446
  const devices = await client.listDevices();
package/dist/client.d.ts CHANGED
@@ -199,6 +199,20 @@ export declare class DayOfWeekClient {
199
199
  }): Promise<any>;
200
200
  /** Area sources, metadata only, newest first — the freshness evidence. */
201
201
  listBrainSources(areaId: string): Promise<any>;
202
+ /** An area's actors (people and organizations, the Actors tab). Active only. */
203
+ listBrainActors(areaId: string): Promise<any>;
204
+ /**
205
+ * Create an actor in an area. Idempotent on (area, name): an existing active
206
+ * actor comes back with `created: false` instead of a duplicate, so imports
207
+ * can re-run safely.
208
+ */
209
+ createBrainActor(input: {
210
+ areaId: string;
211
+ name: string;
212
+ kind: "person" | "organization";
213
+ role?: string;
214
+ description?: string;
215
+ }): Promise<any>;
202
216
  /** Entities with an active customer role and no investor/partner/producer role. */
203
217
  adminCustomersOnly(): Promise<any>;
204
218
  /** Tips mailed to press@mail.dayofweek.com, read by the press-scan skill. */
@@ -429,7 +443,7 @@ export type SharedSkillSummary = {
429
443
  httpsUrl: string;
430
444
  updatedAt: number;
431
445
  };
432
- export type SharedSkillBundle = Omit<SharedSkillSummary, "fileCount" | "byteSize"> & {
446
+ export type SharedSkillBundle = SharedSkillSummary & {
433
447
  files: Array<{
434
448
  path: string;
435
449
  content: string;
package/dist/client.js CHANGED
@@ -332,6 +332,18 @@ export class DayOfWeekClient {
332
332
  async listBrainSources(areaId) {
333
333
  return this.get(`/brain/sources?area=${encodeURIComponent(areaId)}`);
334
334
  }
335
+ /** An area's actors (people and organizations, the Actors tab). Active only. */
336
+ async listBrainActors(areaId) {
337
+ return this.get(`/brain/actors?area=${encodeURIComponent(areaId)}`);
338
+ }
339
+ /**
340
+ * Create an actor in an area. Idempotent on (area, name): an existing active
341
+ * actor comes back with `created: false` instead of a duplicate, so imports
342
+ * can re-run safely.
343
+ */
344
+ async createBrainActor(input) {
345
+ return this.post("/brain/actors", input);
346
+ }
335
347
  /** Entities with an active customer role and no investor/partner/producer role. */
336
348
  async adminCustomersOnly() {
337
349
  return this.get("/admin/customers-only");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dayofweek/dcli",
3
- "version": "1.7.0",
4
- "description": "CLI for the Day of Week AgTech platform read data and submit proposals for review",
3
+ "version": "1.8.0",
4
+ "description": "CLI for the Day of Week AgTech platform \u2014 read data and submit proposals for review",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {