@dayofweek/dcli 1.7.0 → 1.9.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,117 @@ 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
+ });
331
+ brainActors
332
+ .command("matrix")
333
+ .description("The interview matrix: guide questions × active actors")
334
+ .requiredOption("--area <areaId>", "Area id (from `brain list`)")
335
+ .action(async (opts) => {
336
+ output(await getClient().getBrainActorMatrix(opts.area));
337
+ });
338
+ brainActors
339
+ .command("extract")
340
+ .description("Trigger the platform's answer extraction (all active actors, or one)")
341
+ .requiredOption("--area <areaId>", "Area id (from `brain list`)")
342
+ .option("--actor <actorId>", "Only this actor")
343
+ .action(async (opts) => {
344
+ output(await getClient().extractBrainActorAnswers({ areaId: opts.area, actorId: opts.actor }));
345
+ });
346
+ brainActors
347
+ .command("answer")
348
+ .description("Write one interview-matrix cell directly (marked capturedVia dcli, authoritative)")
349
+ .requiredOption("--actor <actorId>", "Actor id (from `brain actors list`)")
350
+ .requiredOption("--question <questionId>", "Question id (from `brain actors matrix`)")
351
+ .requiredOption("--answer <text>", "The answer; cite the source material in the text")
352
+ .option("--status <status>", "answered | partial | unknown", "answered")
353
+ .action(async (opts) => {
354
+ if (!["answered", "partial", "unknown"].includes(opts.status)) {
355
+ throw new Error(`--status must be answered, partial or unknown, got "${opts.status}"`);
356
+ }
357
+ output(await getClient().setBrainActorAnswer({
358
+ actorId: opts.actor,
359
+ questionId: opts.question,
360
+ answer: opts.answer,
361
+ status: opts.status,
362
+ }));
363
+ });
364
+ brainActors
365
+ .command("scores")
366
+ .description("Readiness scores: dimensions × active actors with full cells")
367
+ .requiredOption("--area <areaId>", "Area id (from `brain list`)")
368
+ .action(async (opts) => {
369
+ output(await getClient().getBrainActorScores(opts.area));
370
+ });
371
+ brainActors
372
+ .command("score")
373
+ .description("Trigger the platform's readiness scoring (all active actors, or one)")
374
+ .requiredOption("--area <areaId>", "Area id (from `brain list`)")
375
+ .option("--actor <actorId>", "Only this actor")
376
+ .action(async (opts) => {
377
+ output(await getClient().scoreBrainActors({ areaId: opts.area, actorId: opts.actor }));
378
+ });
379
+ brainActors
380
+ .command("set-score")
381
+ .description("Write one readiness band directly (marked capturedVia dcli, authoritative)")
382
+ .requiredOption("--actor <actorId>", "Actor id (from `brain actors list`)")
383
+ .requiredOption("--dimension <key>", "Dimension key (from `brain actors scores`)")
384
+ .requiredOption("--band <band>", "red | orange | green")
385
+ .requiredOption("--rationale <text>", "Grounds for the band — required")
386
+ .option("--score <number>", "0..1 numeric backing (default derived from band)", parseFloat)
387
+ .option("--gaps <items...>", "Identified gaps")
388
+ .action(async (opts) => {
389
+ if (!["red", "orange", "green"].includes(opts.band)) {
390
+ throw new Error(`--band must be red, orange or green, got "${opts.band}"`);
391
+ }
392
+ output(await getClient().setBrainActorScore({
393
+ actorId: opts.actor,
394
+ dimensionKey: opts.dimension,
395
+ band: opts.band,
396
+ score: opts.score,
397
+ rationale: opts.rationale,
398
+ gaps: opts.gaps,
399
+ }));
400
+ });
401
+ brainSource
402
+ .command("scope <sourceId>")
403
+ .description("Scope a source to an actor (feeds the readiness tables)")
404
+ .option("--actor <actorId>", "Actor id (from `brain actors list`)")
405
+ .option("--clear", "Return the source to area level")
406
+ .action(async (sourceId, opts) => {
407
+ if (Boolean(opts.actor) === Boolean(opts.clear)) {
408
+ throw new Error("Pass exactly one of --actor <actorId> or --clear");
409
+ }
410
+ output(await getClient().scopeBrainSource(sourceId, opts.actor ?? null));
411
+ });
301
412
  auth
302
413
  .command("devices")
303
414
  .description("List your agent tokens")
@@ -4472,6 +4472,52 @@ 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
+ }
4487
+ /** The interview matrix: guide questions × active actors with answer cells. */
4488
+ async getBrainActorMatrix(areaId) {
4489
+ return this.get(`/brain/actors/matrix?area=${encodeURIComponent(areaId)}`);
4490
+ }
4491
+ /** Trigger the platform's answer extraction (one actor, or all active). */
4492
+ async extractBrainActorAnswers(input) {
4493
+ return this.post("/brain/actors/extract", input);
4494
+ }
4495
+ /**
4496
+ * Write one interview-matrix cell directly. The cell is marked
4497
+ * capturedVia "dcli" and the platform's extraction never overwrites it.
4498
+ */
4499
+ async setBrainActorAnswer(input) {
4500
+ return this.post("/brain/actors/answers", input);
4501
+ }
4502
+ /** Readiness scores: dimensions × active actors with full cells. */
4503
+ async getBrainActorScores(areaId) {
4504
+ return this.get(`/brain/actors/scores?area=${encodeURIComponent(areaId)}`);
4505
+ }
4506
+ /** Trigger the platform's readiness scoring (one actor, or all active). */
4507
+ async scoreBrainActors(input) {
4508
+ return this.post("/brain/actors/score", input);
4509
+ }
4510
+ /**
4511
+ * Write one readiness band directly (rationale required). The row is marked
4512
+ * capturedVia "dcli" and the platform's scoring never overwrites it.
4513
+ */
4514
+ async setBrainActorScore(input) {
4515
+ return this.post("/brain/actors/scores", input);
4516
+ }
4517
+ /** Scope a source to an actor (actorId null returns it to area level). */
4518
+ async scopeBrainSource(sourceId, actorId) {
4519
+ return this.patch(`/brain/sources/${encodeURIComponent(sourceId)}/actor`, { actorId });
4520
+ }
4475
4521
  /** Entities with an active customer role and no investor/partner/producer role. */
4476
4522
  async adminCustomersOnly() {
4477
4523
  return this.get("/admin/customers-only");
@@ -5098,7 +5144,7 @@ var import_promises4 = require("node:readline/promises");
5098
5144
  // package.json
5099
5145
  var package_default = {
5100
5146
  name: "@dayofweek/dcli",
5101
- version: "1.7.0",
5147
+ version: "1.9.0",
5102
5148
  description: "CLI for the Day of Week AgTech platform \u2014 read data and submit proposals for review",
5103
5149
  license: "MIT",
5104
5150
  type: "module",
@@ -5413,6 +5459,64 @@ brainSource.command("download <uri>").description("Download exact original bytes
5413
5459
  overwrite: opts.overwrite
5414
5460
  }));
5415
5461
  });
5462
+ var brainActors = brain.command("actors").description("Work with an area's actors (people and organizations)");
5463
+ brainActors.command("list").description("List an area's actors (active, sorted by name)").requiredOption("--area <areaId>", "Area id (from `brain list`)").action(async (opts) => {
5464
+ output(await getClient().listBrainActors(opts.area));
5465
+ });
5466
+ 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) => {
5467
+ if (opts.kind !== "person" && opts.kind !== "organization") {
5468
+ throw new Error(`--kind must be "person" or "organization", got "${opts.kind}"`);
5469
+ }
5470
+ output(await getClient().createBrainActor({
5471
+ areaId: opts.area,
5472
+ name: opts.name,
5473
+ kind: opts.kind,
5474
+ role: opts.role,
5475
+ description: opts.description
5476
+ }));
5477
+ });
5478
+ brainActors.command("matrix").description("The interview matrix: guide questions \xD7 active actors").requiredOption("--area <areaId>", "Area id (from `brain list`)").action(async (opts) => {
5479
+ output(await getClient().getBrainActorMatrix(opts.area));
5480
+ });
5481
+ brainActors.command("extract").description("Trigger the platform's answer extraction (all active actors, or one)").requiredOption("--area <areaId>", "Area id (from `brain list`)").option("--actor <actorId>", "Only this actor").action(async (opts) => {
5482
+ output(await getClient().extractBrainActorAnswers({ areaId: opts.area, actorId: opts.actor }));
5483
+ });
5484
+ brainActors.command("answer").description("Write one interview-matrix cell directly (marked capturedVia dcli, authoritative)").requiredOption("--actor <actorId>", "Actor id (from `brain actors list`)").requiredOption("--question <questionId>", "Question id (from `brain actors matrix`)").requiredOption("--answer <text>", "The answer; cite the source material in the text").option("--status <status>", "answered | partial | unknown", "answered").action(async (opts) => {
5485
+ if (!["answered", "partial", "unknown"].includes(opts.status)) {
5486
+ throw new Error(`--status must be answered, partial or unknown, got "${opts.status}"`);
5487
+ }
5488
+ output(await getClient().setBrainActorAnswer({
5489
+ actorId: opts.actor,
5490
+ questionId: opts.question,
5491
+ answer: opts.answer,
5492
+ status: opts.status
5493
+ }));
5494
+ });
5495
+ brainActors.command("scores").description("Readiness scores: dimensions \xD7 active actors with full cells").requiredOption("--area <areaId>", "Area id (from `brain list`)").action(async (opts) => {
5496
+ output(await getClient().getBrainActorScores(opts.area));
5497
+ });
5498
+ brainActors.command("score").description("Trigger the platform's readiness scoring (all active actors, or one)").requiredOption("--area <areaId>", "Area id (from `brain list`)").option("--actor <actorId>", "Only this actor").action(async (opts) => {
5499
+ output(await getClient().scoreBrainActors({ areaId: opts.area, actorId: opts.actor }));
5500
+ });
5501
+ brainActors.command("set-score").description("Write one readiness band directly (marked capturedVia dcli, authoritative)").requiredOption("--actor <actorId>", "Actor id (from `brain actors list`)").requiredOption("--dimension <key>", "Dimension key (from `brain actors scores`)").requiredOption("--band <band>", "red | orange | green").requiredOption("--rationale <text>", "Grounds for the band \u2014 required").option("--score <number>", "0..1 numeric backing (default derived from band)", parseFloat).option("--gaps <items...>", "Identified gaps").action(async (opts) => {
5502
+ if (!["red", "orange", "green"].includes(opts.band)) {
5503
+ throw new Error(`--band must be red, orange or green, got "${opts.band}"`);
5504
+ }
5505
+ output(await getClient().setBrainActorScore({
5506
+ actorId: opts.actor,
5507
+ dimensionKey: opts.dimension,
5508
+ band: opts.band,
5509
+ score: opts.score,
5510
+ rationale: opts.rationale,
5511
+ gaps: opts.gaps
5512
+ }));
5513
+ });
5514
+ brainSource.command("scope <sourceId>").description("Scope a source to an actor (feeds the readiness tables)").option("--actor <actorId>", "Actor id (from `brain actors list`)").option("--clear", "Return the source to area level").action(async (sourceId, opts) => {
5515
+ if (Boolean(opts.actor) === Boolean(opts.clear)) {
5516
+ throw new Error("Pass exactly one of --actor <actorId> or --clear");
5517
+ }
5518
+ output(await getClient().scopeBrainSource(sourceId, opts.actor ?? null));
5519
+ });
5416
5520
  auth.command("devices").description("List your agent tokens").action(async () => {
5417
5521
  const client = getClient();
5418
5522
  const devices = await client.listDevices();
package/dist/client.d.ts CHANGED
@@ -199,6 +199,58 @@ 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>;
216
+ /** The interview matrix: guide questions × active actors with answer cells. */
217
+ getBrainActorMatrix(areaId: string): Promise<any>;
218
+ /** Trigger the platform's answer extraction (one actor, or all active). */
219
+ extractBrainActorAnswers(input: {
220
+ areaId: string;
221
+ actorId?: string;
222
+ }): Promise<any>;
223
+ /**
224
+ * Write one interview-matrix cell directly. The cell is marked
225
+ * capturedVia "dcli" and the platform's extraction never overwrites it.
226
+ */
227
+ setBrainActorAnswer(input: {
228
+ actorId: string;
229
+ questionId: string;
230
+ answer: string;
231
+ status?: "answered" | "partial" | "unknown";
232
+ }): Promise<any>;
233
+ /** Readiness scores: dimensions × active actors with full cells. */
234
+ getBrainActorScores(areaId: string): Promise<any>;
235
+ /** Trigger the platform's readiness scoring (one actor, or all active). */
236
+ scoreBrainActors(input: {
237
+ areaId: string;
238
+ actorId?: string;
239
+ }): Promise<any>;
240
+ /**
241
+ * Write one readiness band directly (rationale required). The row is marked
242
+ * capturedVia "dcli" and the platform's scoring never overwrites it.
243
+ */
244
+ setBrainActorScore(input: {
245
+ actorId: string;
246
+ dimensionKey: string;
247
+ band: "red" | "orange" | "green";
248
+ score?: number;
249
+ rationale: string;
250
+ gaps?: string[];
251
+ }): Promise<any>;
252
+ /** Scope a source to an actor (actorId null returns it to area level). */
253
+ scopeBrainSource(sourceId: string, actorId: string | null): Promise<any>;
202
254
  /** Entities with an active customer role and no investor/partner/producer role. */
203
255
  adminCustomersOnly(): Promise<any>;
204
256
  /** Tips mailed to press@mail.dayofweek.com, read by the press-scan skill. */
@@ -429,7 +481,7 @@ export type SharedSkillSummary = {
429
481
  httpsUrl: string;
430
482
  updatedAt: number;
431
483
  };
432
- export type SharedSkillBundle = Omit<SharedSkillSummary, "fileCount" | "byteSize"> & {
484
+ export type SharedSkillBundle = SharedSkillSummary & {
433
485
  files: Array<{
434
486
  path: string;
435
487
  content: string;
package/dist/client.js CHANGED
@@ -332,6 +332,52 @@ 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
+ }
347
+ /** The interview matrix: guide questions × active actors with answer cells. */
348
+ async getBrainActorMatrix(areaId) {
349
+ return this.get(`/brain/actors/matrix?area=${encodeURIComponent(areaId)}`);
350
+ }
351
+ /** Trigger the platform's answer extraction (one actor, or all active). */
352
+ async extractBrainActorAnswers(input) {
353
+ return this.post("/brain/actors/extract", input);
354
+ }
355
+ /**
356
+ * Write one interview-matrix cell directly. The cell is marked
357
+ * capturedVia "dcli" and the platform's extraction never overwrites it.
358
+ */
359
+ async setBrainActorAnswer(input) {
360
+ return this.post("/brain/actors/answers", input);
361
+ }
362
+ /** Readiness scores: dimensions × active actors with full cells. */
363
+ async getBrainActorScores(areaId) {
364
+ return this.get(`/brain/actors/scores?area=${encodeURIComponent(areaId)}`);
365
+ }
366
+ /** Trigger the platform's readiness scoring (one actor, or all active). */
367
+ async scoreBrainActors(input) {
368
+ return this.post("/brain/actors/score", input);
369
+ }
370
+ /**
371
+ * Write one readiness band directly (rationale required). The row is marked
372
+ * capturedVia "dcli" and the platform's scoring never overwrites it.
373
+ */
374
+ async setBrainActorScore(input) {
375
+ return this.post("/brain/actors/scores", input);
376
+ }
377
+ /** Scope a source to an actor (actorId null returns it to area level). */
378
+ async scopeBrainSource(sourceId, actorId) {
379
+ return this.patch(`/brain/sources/${encodeURIComponent(sourceId)}/actor`, { actorId });
380
+ }
335
381
  /** Entities with an active customer role and no investor/partner/producer role. */
336
382
  async adminCustomersOnly() {
337
383
  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.9.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": {