@dayofweek/dcli 1.8.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
@@ -328,6 +328,87 @@ brainActors
328
328
  description: opts.description,
329
329
  }));
330
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
+ });
331
412
  auth
332
413
  .command("devices")
333
414
  .description("List your agent tokens")
@@ -4484,6 +4484,40 @@ var DayOfWeekClient = class {
4484
4484
  async createBrainActor(input) {
4485
4485
  return this.post("/brain/actors", input);
4486
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
+ }
4487
4521
  /** Entities with an active customer role and no investor/partner/producer role. */
4488
4522
  async adminCustomersOnly() {
4489
4523
  return this.get("/admin/customers-only");
@@ -5110,7 +5144,7 @@ var import_promises4 = require("node:readline/promises");
5110
5144
  // package.json
5111
5145
  var package_default = {
5112
5146
  name: "@dayofweek/dcli",
5113
- version: "1.8.0",
5147
+ version: "1.9.0",
5114
5148
  description: "CLI for the Day of Week AgTech platform \u2014 read data and submit proposals for review",
5115
5149
  license: "MIT",
5116
5150
  type: "module",
@@ -5441,6 +5475,48 @@ brainActors.command("add").description("Add an actor to an area (idempotent on n
5441
5475
  description: opts.description
5442
5476
  }));
5443
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
+ });
5444
5520
  auth.command("devices").description("List your agent tokens").action(async () => {
5445
5521
  const client = getClient();
5446
5522
  const devices = await client.listDevices();
package/dist/client.d.ts CHANGED
@@ -213,6 +213,44 @@ export declare class DayOfWeekClient {
213
213
  role?: string;
214
214
  description?: string;
215
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>;
216
254
  /** Entities with an active customer role and no investor/partner/producer role. */
217
255
  adminCustomersOnly(): Promise<any>;
218
256
  /** Tips mailed to press@mail.dayofweek.com, read by the press-scan skill. */
package/dist/client.js CHANGED
@@ -344,6 +344,40 @@ export class DayOfWeekClient {
344
344
  async createBrainActor(input) {
345
345
  return this.post("/brain/actors", input);
346
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
+ }
347
381
  /** Entities with an active customer role and no investor/partner/producer role. */
348
382
  async adminCustomersOnly() {
349
383
  return this.get("/admin/customers-only");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dayofweek/dcli",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
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",