@robbeverhelst/do 1.366.0 → 1.367.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 (2) hide show
  1. package/dist/do.js +218 -7
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -14420,7 +14420,7 @@ var configError = (message) => new CliError("config", message, EXIT.CONFIG);
14420
14420
 
14421
14421
  // src/meta.ts
14422
14422
  var CLI_NAME = "do";
14423
- var VERSION = "1.366.0";
14423
+ var VERSION = "1.367.0";
14424
14424
  var API_PREFIX = "/api/v1";
14425
14425
  var DEFAULT_API_URL = "http://localhost:3001";
14426
14426
 
@@ -19520,6 +19520,177 @@ var linkGoogleInputSchema = object({
19520
19520
  state: string2().min(1)
19521
19521
  });
19522
19522
 
19523
+ // ../../packages/schema/src/contracts/post-cards.ts
19524
+ var line2 = string2().trim().min(1).max(200);
19525
+ var words = string2().trim().max(2000);
19526
+ var href = string2().trim().min(1).max(2000);
19527
+ var postCardWhoSchema = object({
19528
+ name: line2,
19529
+ av: union([
19530
+ object({
19531
+ kind: literal("initials"),
19532
+ text: string2().trim().min(1).max(3),
19533
+ tone: _enum2(["you", "plum", "sky", "sea", "sun", "cc", "cx", "clay", "mist"])
19534
+ }),
19535
+ object({ kind: _enum2(["echo", "job", "system"]) })
19536
+ ])
19537
+ });
19538
+ var postCardStepSchema = object({
19539
+ label: line2,
19540
+ state: _enum2(["done", "running", "failed", "waiting", "queued"]),
19541
+ at: string2().trim().max(20).optional(),
19542
+ detail: words.optional()
19543
+ });
19544
+ var postCardTextSchema = object({ markdown: string2().max(8000) });
19545
+ var postCardBriefSchema = object({
19546
+ title: line2,
19547
+ sub: line2.optional(),
19548
+ read: line2.optional(),
19549
+ sections: array(object({
19550
+ title: line2,
19551
+ n: union([string2().max(20), number2()]).optional(),
19552
+ body: string2().max(4000)
19553
+ })).min(1).max(12),
19554
+ open: array(number2().int().nonnegative()).max(12).optional()
19555
+ });
19556
+ var postCardRunSchema = object({
19557
+ kind: _enum2(["kanban", "job", "session"]).optional(),
19558
+ title: line2,
19559
+ agent: postCardWhoSchema,
19560
+ machine: line2,
19561
+ account: line2.optional(),
19562
+ since: line2.optional(),
19563
+ state: _enum2(["queued", "running", "paused", "waiting", "done", "failed", "stopped"]),
19564
+ stateText: line2.optional(),
19565
+ now: words.optional(),
19566
+ progress: number2().min(0).max(1).optional(),
19567
+ progressText: line2.optional(),
19568
+ steps: array(postCardStepSchema).max(30).optional(),
19569
+ outputs: array(object({ icon: string2().max(24), label: line2, href })).max(12).optional()
19570
+ });
19571
+ var postCardDeploySchema = object({
19572
+ title: line2,
19573
+ sub: line2.optional(),
19574
+ state: _enum2(["running", "live", "failed", "queued"]),
19575
+ steps: array(postCardStepSchema).max(30),
19576
+ siteHref: href.optional(),
19577
+ logsHref: href.optional()
19578
+ });
19579
+ var postCardAskSchema = object({
19580
+ kind: _enum2(["approval", "question", "review"]),
19581
+ state: _enum2(["open", "answered", "expired", "snoozed", "delegated"]).default("open"),
19582
+ from: postCardWhoSchema,
19583
+ title: line2,
19584
+ detail: words.optional(),
19585
+ code: string2().max(4000).optional(),
19586
+ why: words.optional(),
19587
+ risk: literal("high").optional(),
19588
+ expires: object({
19589
+ at: exports_iso.datetime({ offset: true }),
19590
+ windowS: number2().int().positive().max(7 * 24 * 3600).optional(),
19591
+ note: words.optional()
19592
+ }).optional(),
19593
+ yes: line2.optional(),
19594
+ no: line2.optional(),
19595
+ options: array(object({ label: line2, sub: line2.optional() })).max(12).optional(),
19596
+ multi: boolean2().optional(),
19597
+ submit: line2.optional(),
19598
+ acts: array(object({ label: line2, primary: boolean2().optional(), href: href.optional() })).max(6).optional(),
19599
+ done: object({
19600
+ answer: line2.optional(),
19601
+ answeredAt: line2.optional(),
19602
+ expiredAt: line2.optional(),
19603
+ expiredWhat: words.optional(),
19604
+ until: line2.optional(),
19605
+ delegatedWhat: words.optional()
19606
+ }).optional()
19607
+ });
19608
+ var postCardPrSchema = object({
19609
+ title: line2,
19610
+ repo: line2,
19611
+ num: union([string2().trim().min(1).max(20), number2().int().positive()]),
19612
+ branch: line2.optional(),
19613
+ state: _enum2(["checks", "ready", "red", "merged", "draft", "closed"]),
19614
+ add: string2().max(20),
19615
+ del: string2().max(20),
19616
+ files: string2().max(20),
19617
+ by: postCardWhoSchema.optional(),
19618
+ checks: array(object({
19619
+ name: line2,
19620
+ state: string2().trim().min(1).max(20),
19621
+ note: string2().max(40).optional()
19622
+ })).max(40).optional(),
19623
+ mergedAt: line2.optional(),
19624
+ mergedBy: line2.optional(),
19625
+ href: href.optional()
19626
+ });
19627
+ var postCardDigestSchema = object({
19628
+ title: line2,
19629
+ sub: line2,
19630
+ items: array(object({
19631
+ id: string2().trim().min(1).max(64).optional(),
19632
+ at: string2().trim().max(20),
19633
+ text: line2
19634
+ })).min(1).max(50)
19635
+ });
19636
+ var postCardChipsSchema = object({
19637
+ items: array(object({
19638
+ id: string2().trim().min(1).max(64).optional(),
19639
+ kind: _enum2(["task", "habit", "event"]).optional(),
19640
+ title: line2,
19641
+ meta: line2.optional(),
19642
+ done: boolean2().optional(),
19643
+ href: href.optional()
19644
+ })).min(1).max(20)
19645
+ });
19646
+ var tableBody = object({
19647
+ label: line2.optional(),
19648
+ cols: array(string2().trim().max(60)).min(1).max(12),
19649
+ rows: array(array(string2().max(500)).min(1).max(12)).max(100),
19650
+ num: array(number2().int().nonnegative()).max(12).optional()
19651
+ }).refine((t) => t.rows.every((r) => r.length <= t.cols.length), {
19652
+ message: "a row has at most as many cells as there are columns"
19653
+ }).refine((t) => new Set(t.rows.map((r) => r[0])).size === t.rows.length, {
19654
+ message: "each row's head is its own"
19655
+ });
19656
+ var bars = array(object({
19657
+ label: line2,
19658
+ value: number2(),
19659
+ tone: _enum2(["warn", "err"]).optional(),
19660
+ text: string2().max(20).optional()
19661
+ })).min(1).max(30);
19662
+ var postCardTableSchema = object({ title: line2.optional(), sub: line2.optional() }).and(tableBody);
19663
+ var postCardChartSchema = object({
19664
+ title: line2,
19665
+ sub: line2.optional(),
19666
+ label: line2,
19667
+ bars
19668
+ });
19669
+ var postCardReportSchema = object({
19670
+ title: line2,
19671
+ sub: line2.optional(),
19672
+ state: string2().trim().min(1).max(20).optional(),
19673
+ stateText: line2.optional(),
19674
+ lead: string2().max(4000),
19675
+ stats: array(tuple([string2().trim().max(20), line2])).max(8).optional(),
19676
+ chart: object({ label: line2, bars }).optional(),
19677
+ table: tableBody.optional(),
19678
+ href: href.optional()
19679
+ });
19680
+ var POST_CARD_DATA = {
19681
+ text: postCardTextSchema,
19682
+ brief: postCardBriefSchema,
19683
+ run: postCardRunSchema,
19684
+ deploy: postCardDeploySchema,
19685
+ ask: postCardAskSchema,
19686
+ pr: postCardPrSchema,
19687
+ digest: postCardDigestSchema,
19688
+ chips: postCardChipsSchema,
19689
+ table: postCardTableSchema,
19690
+ chart: postCardChartSchema,
19691
+ report: postCardReportSchema
19692
+ };
19693
+
19523
19694
  // ../../packages/schema/src/contracts/agent-gateway.ts
19524
19695
  var AGENT_GATEWAY_VERSION = 1;
19525
19696
  var AGENT_GATEWAY_MAX_FRAME_BYTES = 1024 * 1024;
@@ -19570,13 +19741,40 @@ var postCardTypeSchema = _enum2([
19570
19741
  "decision",
19571
19742
  "answer"
19572
19743
  ]);
19744
+ var postDigestKeySchema = string2().trim().min(1).max(40);
19573
19745
  var POST_CARD_DATA_MAX = 16000;
19574
- var postCardSchema = object({
19575
- type: postCardTypeSchema,
19576
- data: record(string2(), unknown()).default({}).refine((d) => JSON.stringify(d).length <= POST_CARD_DATA_MAX, {
19577
- message: `a card's data is at most ${POST_CARD_DATA_MAX} characters as JSON`
19746
+ var withinLimit = (d) => JSON.stringify(d ?? {}).length <= POST_CARD_DATA_MAX;
19747
+ var LIMIT = `a card's data is at most ${POST_CARD_DATA_MAX} characters as JSON`;
19748
+ var pinned = (type) => object({ type: literal(type), data: POST_CARD_DATA[type] });
19749
+ var postCardSchema = discriminatedUnion("type", [
19750
+ pinned("text"),
19751
+ pinned("brief"),
19752
+ pinned("run"),
19753
+ pinned("deploy"),
19754
+ pinned("ask"),
19755
+ pinned("pr"),
19756
+ pinned("digest"),
19757
+ pinned("chips"),
19758
+ pinned("table"),
19759
+ pinned("chart"),
19760
+ pinned("report"),
19761
+ object({
19762
+ type: postCardTypeSchema.exclude([
19763
+ "text",
19764
+ "brief",
19765
+ "run",
19766
+ "deploy",
19767
+ "ask",
19768
+ "pr",
19769
+ "digest",
19770
+ "chips",
19771
+ "table",
19772
+ "chart",
19773
+ "report"
19774
+ ]),
19775
+ data: record(string2(), unknown()).default({})
19578
19776
  })
19579
- });
19777
+ ]).refine((card) => withinLimit(card.data), { message: LIMIT, path: ["data"] });
19580
19778
  var briefSchema = object({
19581
19779
  label: string2().trim().min(1).max(40),
19582
19780
  title: string2().trim().min(1).max(200),
@@ -19690,6 +19888,7 @@ var agentPostInputSchema = object({
19690
19888
  recovered: boolean2().optional(),
19691
19889
  brief: briefSchema.optional(),
19692
19890
  card: postCardSchema.optional(),
19891
+ digestKey: postDigestKeySchema.optional(),
19693
19892
  receipt: postReceiptInputSchema.optional()
19694
19893
  });
19695
19894
  var agentPostEditSchema = object({
@@ -27335,6 +27534,7 @@ var echoPostSchema = object({
27335
27534
  updatedAt: exports_coerce.date(),
27336
27535
  brief: briefSchema.nullable().default(null),
27337
27536
  card: postCardSchema.nullable().default(null),
27537
+ digestKey: string2().nullable().default(null),
27338
27538
  context: echoPostContextSchema.nullable().default(null)
27339
27539
  });
27340
27540
  var threadPushSchema = _enum2(["needs_you", "all", "off"]);
@@ -43853,7 +44053,8 @@ async function agentPost({
43853
44053
  level: flagString(flags, "level"),
43854
44054
  final: !flagBool(flags, "draft"),
43855
44055
  brief,
43856
- card
44056
+ card,
44057
+ digestKey: flagString(flags, "digest-key")
43857
44058
  });
43858
44059
  return { data: await client.post(pathOf(agentPostOperations.post), body), render: renderRecord };
43859
44060
  }
@@ -44566,6 +44767,11 @@ var commands = [
44566
44767
  type: "string",
44567
44768
  description: `A typed card as JSON: {"type":"pr","data":{\u2026}} (do v2's Echo draws it by type, else the text). Makes the post a card; the same --external-id changes it in place.`
44568
44769
  },
44770
+ {
44771
+ name: "digest-key",
44772
+ type: "string",
44773
+ description: "A quiet post's noun (`heartbeat`): with --level for_later, do v2 folds such posts into one digest line."
44774
+ },
44569
44775
  { name: "edit", type: "string", description: "Edit this post (its id) instead: its text." },
44570
44776
  { name: "delete", type: "string", description: "Take this post (its id) back." }
44571
44777
  ],
@@ -47912,6 +48118,11 @@ var commands16 = [
47912
48118
  type: "string",
47913
48119
  description: `A typed card as JSON: {"type":"pr","data":{\u2026}} (do v2's Echo draws it by type, else the text). Makes the post a card; the same --external-id changes it in place.`
47914
48120
  },
48121
+ {
48122
+ name: "digest-key",
48123
+ type: "string",
48124
+ description: "A quiet post's noun (`heartbeat`): with --level for_later, do v2 folds such posts into one digest line."
48125
+ },
47915
48126
  { name: "edit", type: "string", description: "Edit this post (its id) instead: its text." },
47916
48127
  { name: "delete", type: "string", description: "Take this post (its id) back." }
47917
48128
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.366.0",
3
+ "version": "1.367.0",
4
4
  "private": false,
5
5
  "description": "do — the agent-drivable CLI over the public /api/v1 surface",
6
6
  "homepage": "https://github.com/robbeverhelst/do/tree/main/apps/cli",