@robbeverhelst/do 1.366.0 → 1.368.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 +286 -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.368.0";
14424
14424
  var API_PREFIX = "/api/v1";
14425
14425
  var DEFAULT_API_URL = "http://localhost:3001";
14426
14426
 
@@ -19520,6 +19520,233 @@ 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 postCardHandoffSchema = object({
19681
+ from: line2,
19682
+ to: line2,
19683
+ what: string2().trim().min(1).max(2000),
19684
+ sub: line2.optional(),
19685
+ state: _enum2(["stuck", "seen", "picked"]),
19686
+ reassignHref: href.optional()
19687
+ });
19688
+ var postCardDecisionSchema = object({
19689
+ text: string2().trim().min(1).max(2000),
19690
+ when: line2.optional(),
19691
+ by: line2.optional()
19692
+ });
19693
+ var postCardInvoiceSchema = object({
19694
+ title: line2,
19695
+ to: line2,
19696
+ due: line2,
19697
+ state: _enum2(["draft", "sent", "paid"]),
19698
+ amount: string2().trim().min(1).max(40),
19699
+ lines: words.optional(),
19700
+ sentAt: line2.optional(),
19701
+ paidAt: line2.optional(),
19702
+ editHref: href.optional()
19703
+ });
19704
+ var postCardMailSchema = object({
19705
+ subject: line2,
19706
+ to: line2,
19707
+ from: line2.optional(),
19708
+ state: _enum2(["draft", "sent"]).default("draft"),
19709
+ text: string2().max(8000),
19710
+ note: line2.optional(),
19711
+ sentAt: line2.optional(),
19712
+ undoUntil: line2.optional()
19713
+ });
19714
+ var postCardLinkSchema = object({
19715
+ href,
19716
+ site: line2,
19717
+ title: line2,
19718
+ desc: words.optional(),
19719
+ image: href.optional()
19720
+ });
19721
+ var postCardFileSchema = object({
19722
+ name: line2,
19723
+ meta: line2.optional(),
19724
+ preview: union([
19725
+ object({ kind: literal("pdf"), title: line2 }),
19726
+ object({ kind: literal("text"), text: string2().max(2000) })
19727
+ ]).optional(),
19728
+ href: href.optional()
19729
+ });
19730
+ var POST_CARD_DATA = {
19731
+ text: postCardTextSchema,
19732
+ brief: postCardBriefSchema,
19733
+ run: postCardRunSchema,
19734
+ deploy: postCardDeploySchema,
19735
+ ask: postCardAskSchema,
19736
+ pr: postCardPrSchema,
19737
+ digest: postCardDigestSchema,
19738
+ chips: postCardChipsSchema,
19739
+ table: postCardTableSchema,
19740
+ chart: postCardChartSchema,
19741
+ report: postCardReportSchema,
19742
+ handoff: postCardHandoffSchema,
19743
+ decision: postCardDecisionSchema,
19744
+ invoice: postCardInvoiceSchema,
19745
+ mail: postCardMailSchema,
19746
+ link: postCardLinkSchema,
19747
+ file: postCardFileSchema
19748
+ };
19749
+
19523
19750
  // ../../packages/schema/src/contracts/agent-gateway.ts
19524
19751
  var AGENT_GATEWAY_VERSION = 1;
19525
19752
  var AGENT_GATEWAY_MAX_FRAME_BYTES = 1024 * 1024;
@@ -19570,13 +19797,52 @@ var postCardTypeSchema = _enum2([
19570
19797
  "decision",
19571
19798
  "answer"
19572
19799
  ]);
19800
+ var postDigestKeySchema = string2().trim().min(1).max(40);
19573
19801
  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`
19802
+ var withinLimit = (d) => JSON.stringify(d ?? {}).length <= POST_CARD_DATA_MAX;
19803
+ var LIMIT = `a card's data is at most ${POST_CARD_DATA_MAX} characters as JSON`;
19804
+ var pinned = (type) => object({ type: literal(type), data: POST_CARD_DATA[type] });
19805
+ var postCardSchema = discriminatedUnion("type", [
19806
+ pinned("text"),
19807
+ pinned("brief"),
19808
+ pinned("run"),
19809
+ pinned("deploy"),
19810
+ pinned("ask"),
19811
+ pinned("pr"),
19812
+ pinned("digest"),
19813
+ pinned("chips"),
19814
+ pinned("table"),
19815
+ pinned("chart"),
19816
+ pinned("report"),
19817
+ pinned("handoff"),
19818
+ pinned("decision"),
19819
+ pinned("invoice"),
19820
+ pinned("mail"),
19821
+ pinned("link"),
19822
+ pinned("file"),
19823
+ object({
19824
+ type: postCardTypeSchema.exclude([
19825
+ "text",
19826
+ "brief",
19827
+ "run",
19828
+ "deploy",
19829
+ "ask",
19830
+ "pr",
19831
+ "digest",
19832
+ "chips",
19833
+ "table",
19834
+ "chart",
19835
+ "report",
19836
+ "handoff",
19837
+ "decision",
19838
+ "invoice",
19839
+ "mail",
19840
+ "link",
19841
+ "file"
19842
+ ]),
19843
+ data: record(string2(), unknown()).default({})
19578
19844
  })
19579
- });
19845
+ ]).refine((card) => withinLimit(card.data), { message: LIMIT, path: ["data"] });
19580
19846
  var briefSchema = object({
19581
19847
  label: string2().trim().min(1).max(40),
19582
19848
  title: string2().trim().min(1).max(200),
@@ -19690,6 +19956,7 @@ var agentPostInputSchema = object({
19690
19956
  recovered: boolean2().optional(),
19691
19957
  brief: briefSchema.optional(),
19692
19958
  card: postCardSchema.optional(),
19959
+ digestKey: postDigestKeySchema.optional(),
19693
19960
  receipt: postReceiptInputSchema.optional()
19694
19961
  });
19695
19962
  var agentPostEditSchema = object({
@@ -27335,6 +27602,7 @@ var echoPostSchema = object({
27335
27602
  updatedAt: exports_coerce.date(),
27336
27603
  brief: briefSchema.nullable().default(null),
27337
27604
  card: postCardSchema.nullable().default(null),
27605
+ digestKey: string2().nullable().default(null),
27338
27606
  context: echoPostContextSchema.nullable().default(null)
27339
27607
  });
27340
27608
  var threadPushSchema = _enum2(["needs_you", "all", "off"]);
@@ -43853,7 +44121,8 @@ async function agentPost({
43853
44121
  level: flagString(flags, "level"),
43854
44122
  final: !flagBool(flags, "draft"),
43855
44123
  brief,
43856
- card
44124
+ card,
44125
+ digestKey: flagString(flags, "digest-key")
43857
44126
  });
43858
44127
  return { data: await client.post(pathOf(agentPostOperations.post), body), render: renderRecord };
43859
44128
  }
@@ -44566,6 +44835,11 @@ var commands = [
44566
44835
  type: "string",
44567
44836
  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
44837
  },
44838
+ {
44839
+ name: "digest-key",
44840
+ type: "string",
44841
+ description: "A quiet post's noun (`heartbeat`): with --level for_later, do v2 folds such posts into one digest line."
44842
+ },
44569
44843
  { name: "edit", type: "string", description: "Edit this post (its id) instead: its text." },
44570
44844
  { name: "delete", type: "string", description: "Take this post (its id) back." }
44571
44845
  ],
@@ -47912,6 +48186,11 @@ var commands16 = [
47912
48186
  type: "string",
47913
48187
  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
48188
  },
48189
+ {
48190
+ name: "digest-key",
48191
+ type: "string",
48192
+ description: "A quiet post's noun (`heartbeat`): with --level for_later, do v2 folds such posts into one digest line."
48193
+ },
47915
48194
  { name: "edit", type: "string", description: "Edit this post (its id) instead: its text." },
47916
48195
  { name: "delete", type: "string", description: "Take this post (its id) back." }
47917
48196
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.366.0",
3
+ "version": "1.368.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",