@robbeverhelst/do 1.178.0 → 1.179.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 +70 -1
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -19327,6 +19327,22 @@ var restAreaInputSchema = object({
19327
19327
  until: exports_iso.date(),
19328
19328
  habits: _enum2(["keep", "pause"]).default("keep")
19329
19329
  }).strict();
19330
+ var areaToProjectInputSchema = object({ projectId: ulidSchema, intoAreaId: ulidSchema.nullable() }).strict();
19331
+ var areaMovedSchema = object({
19332
+ tasks: array(string2()),
19333
+ projects: array(string2()),
19334
+ habits: array(string2()),
19335
+ routines: array(string2()),
19336
+ notes: array(string2()),
19337
+ collectionItems: array(string2())
19338
+ });
19339
+ var areaToProjectResultSchema = object({
19340
+ areaId: string2(),
19341
+ projectId: string2(),
19342
+ intoAreaId: string2().nullable(),
19343
+ moved: areaMovedSchema
19344
+ });
19345
+ var undoAreaToProjectInputSchema = object({ projectId: ulidSchema, moved: areaMovedSchema }).strict();
19330
19346
 
19331
19347
  // ../../packages/schema/src/presets/facets.ts
19332
19348
  var PANTRY_DISPLAY_KIND = "pantry";
@@ -21624,7 +21640,7 @@ function parseCapture2(input, now) {
21624
21640
 
21625
21641
  // src/meta.ts
21626
21642
  var CLI_NAME = "do";
21627
- var VERSION = "1.178.0";
21643
+ var VERSION = "1.179.0";
21628
21644
  var API_PREFIX = "/api/v1";
21629
21645
  var DEFAULT_API_URL = "http://localhost:3001";
21630
21646
 
@@ -23548,6 +23564,36 @@ var COMMAND_SPECS = [
23548
23564
  returns: "UserSettings",
23549
23565
  notes: "Reads then patches settings.pinnedAreaIds."
23550
23566
  },
23567
+ {
23568
+ path: ["areas", "make-project"],
23569
+ summary: "Make an Area that finishes a Project (prints the receipt for undo).",
23570
+ args: [{ name: "id", required: true, description: "Area ULID." }],
23571
+ flags: [
23572
+ {
23573
+ name: "into",
23574
+ type: "string",
23575
+ description: "The Area to file the new Project under (none when left out)."
23576
+ }
23577
+ ],
23578
+ scopes: ["areas:write", "projects:write"],
23579
+ returns: "AreaToProjectResult",
23580
+ notes: "POST /api/v1/areas/{id}/to-project (Areas 8). The Project takes the Area's title; its loose tasks go inside, its Projects, habits, routines and notes move beside it, and the Area is archived. An agent proposes this; only the member runs it."
23581
+ },
23582
+ {
23583
+ path: ["areas", "undo-make-project"],
23584
+ summary: "Undo `areas make-project` from its receipt.",
23585
+ args: [{ name: "id", required: true, description: "Area ULID." }],
23586
+ flags: [
23587
+ {
23588
+ name: "data",
23589
+ type: "string",
23590
+ description: "The receipt as JSON: { projectId, moved } from `areas make-project`."
23591
+ }
23592
+ ],
23593
+ scopes: ["areas:write", "projects:write"],
23594
+ returns: "AreaView",
23595
+ notes: "POST /api/v1/areas/{id}/to-project/undo (Areas 8). Everything comes back; the Project goes."
23596
+ },
23551
23597
  {
23552
23598
  path: ["places", "import"],
23553
23599
  summary: "Import the rooms of the house once from Gaard's house.json.",
@@ -25965,6 +26011,29 @@ var HANDLERS = {
25965
26011
  },
25966
26012
  "areas pin": async ({ args, requireClient }) => setAreaPinned(args, requireClient, true),
25967
26013
  "areas unpin": async ({ args, requireClient }) => setAreaPinned(args, requireClient, false),
26014
+ "areas make-project": async ({ args, flags, requireClient }) => {
26015
+ const id = requireArg(args, 0, "area id");
26016
+ const input = parseInput(areaToProjectInputSchema, {
26017
+ projectId: ulid3(),
26018
+ intoAreaId: flagString(flags, "into") ?? null
26019
+ });
26020
+ return {
26021
+ data: await requireClient().post(`/areas/${id}/to-project`, input),
26022
+ render: renderRecord
26023
+ };
26024
+ },
26025
+ "areas undo-make-project": async ({ args, flags, requireClient }) => {
26026
+ const id = requireArg(args, 0, "area id");
26027
+ const receipt = readDataFlag(flags);
26028
+ const input = parseInput(undoAreaToProjectInputSchema, {
26029
+ projectId: receipt.projectId,
26030
+ moved: receipt.moved
26031
+ });
26032
+ return {
26033
+ data: await requireClient().post(`/areas/${id}/to-project/undo`, input),
26034
+ render: renderRecord
26035
+ };
26036
+ },
25968
26037
  "places import": async ({ args, flags, requireClient }) => {
25969
26038
  const path = requireArg(args, 0, "house.json path");
25970
26039
  let file;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.178.0",
3
+ "version": "1.179.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",