@dypt/cli 0.1.8 → 0.1.9

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/README.md CHANGED
@@ -62,9 +62,24 @@ dypt task update 123 --priority high
62
62
  dypt task update 123 --deadline 2026-05-01T09:00:00Z
63
63
  dypt task update 123 --parent Work
64
64
  dypt task update 123 --parent root --preview
65
+ dypt task update 123 --position 0
65
66
  dypt task update 123 --archive
66
67
  ```
67
68
 
69
+ ### Reorder tasks
70
+
71
+ Set visible sibling order from an explicit task list. Preview first for safe
72
+ bulk changes:
73
+
74
+ ```bash
75
+ dypt task reorder 71595 71594 71598 --preview
76
+ dypt task reorder 71595 71594 71598
77
+ dypt task reorder 71595 71594 71598 --parent Work
78
+ ```
79
+
80
+ Dependencies and blockers are not changed by reordering; use `dypt dep` commands
81
+ for execution dependencies.
82
+
68
83
  ## JSON output
69
84
 
70
85
  Most commands support `--json` for agent and automation use.
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import { Argument, Command, Option } from "commander";
9
9
  // package.json
10
10
  var package_default = {
11
11
  name: "@dypt/cli",
12
- version: "0.1.8",
12
+ version: "0.1.9",
13
13
  description: "Command-line interface for dypt task management",
14
14
  license: "SEE LICENSE IN LICENSE",
15
15
  homepage: "https://dypt.app",
@@ -294,6 +294,8 @@ async function createCliApi(options = {}) {
294
294
  getAuthStatus: () => cliClient.cli.v1.auth.status.query(),
295
295
  createTask: (input) => cliClient.cli.v1.tasks.create.mutate(input),
296
296
  updateTask: (input) => cliClient.cli.v1.tasks.update.mutate(input),
297
+ reorderTasks: (input) => cliClient.cli.v1.tasks.reorder.mutate(input),
298
+ previewReorderTasks: (input) => cliClient.cli.v1.tasks.previewReorder.query(input),
297
299
  archiveTask: (input) => cliClient.cli.v1.tasks.archive.mutate(input),
298
300
  unarchiveTask: (input) => cliClient.cli.v1.tasks.unarchive.mutate(input),
299
301
  updateManyTasks: (input) => cliClient.cli.v1.tasks.updateMany.mutate(input),
@@ -451,6 +453,9 @@ When working on repo tasks:
451
453
  - Do not create a parallel markdown TODO tracker.
452
454
  - Do not set leaf tasks to in progress; dypt derives in progress for parent
453
455
  tasks from child state.
456
+ - When creating a task tree from an implementation plan, set task positions to
457
+ match the recommended execution order. Use visible order for sequencing and
458
+ dependencies only for true blocker relationships.
454
459
  - Preview cleanup or bulk changes before applying them when preview is
455
460
  available.
456
461
  - If the dypt-cli skill is available, use it for dypt task workflows.
@@ -478,6 +483,9 @@ dypt dep list <ref>
478
483
  dypt task plan next-actions <ref>
479
484
  dypt task plan focus <ref>
480
485
  dypt task plan metadata <ref> --leaves-only
486
+ dypt task update <ref> --position <n>
487
+ dypt task reorder <ref-1> <ref-2> <ref-3> --preview
488
+ dypt task reorder <ref-1> <ref-2> <ref-3>
481
489
  \`\`\`
482
490
  `;
483
491
  function metadataPath(targetPath) {
@@ -1093,10 +1101,10 @@ async function runTaskTree(input, deps) {
1093
1101
 
1094
1102
  // src/commands/task/update.ts
1095
1103
  async function runTaskUpdate(input, deps) {
1096
- const hasMutations = input.title !== void 0 || input.status !== void 0 || input.priority !== void 0 || input.deadline !== void 0 || input.expectedTimeTaken !== void 0 || input.actualTimeTaken !== void 0 || input.archivedAt !== void 0 || input.parentRef !== void 0;
1104
+ const hasMutations = input.title !== void 0 || input.status !== void 0 || input.priority !== void 0 || input.deadline !== void 0 || input.expectedTimeTaken !== void 0 || input.actualTimeTaken !== void 0 || input.archivedAt !== void 0 || input.parentRef !== void 0 || input.position !== void 0;
1097
1105
  if (!hasMutations) {
1098
1106
  throw new Error(
1099
- "No changes specified. Use --title, --status, --priority, --deadline, --expected-time, --actual-time, --archive, --unarchive, or --parent."
1107
+ "No changes specified. Use --title, --status, --priority, --deadline, --expected-time, --actual-time, --archive, --unarchive, --parent, or --position."
1100
1108
  );
1101
1109
  }
1102
1110
  if (input.preview && input.title !== void 0) {
@@ -1111,7 +1119,8 @@ async function runTaskUpdate(input, deps) {
1111
1119
  expectedTimeTaken: input.expectedTimeTaken,
1112
1120
  actualTimeTaken: input.actualTimeTaken,
1113
1121
  archivedAt: input.archivedAt,
1114
- parentRef: input.parentRef
1122
+ parentRef: input.parentRef,
1123
+ position: input.position
1115
1124
  };
1116
1125
  const result = input.preview ? await deps.previewTask({
1117
1126
  ref: args.ref,
@@ -1121,7 +1130,8 @@ async function runTaskUpdate(input, deps) {
1121
1130
  expectedTimeTaken: args.expectedTimeTaken,
1122
1131
  actualTimeTaken: args.actualTimeTaken,
1123
1132
  archivedAt: args.archivedAt,
1124
- parentRef: args.parentRef
1133
+ parentRef: args.parentRef,
1134
+ position: args.position
1125
1135
  }) : await deps.updateTask(args);
1126
1136
  if (input.json) {
1127
1137
  deps.printJson(result);
@@ -1156,6 +1166,23 @@ async function runTaskUpdateMany(input, deps) {
1156
1166
  deps.printTable(result);
1157
1167
  }
1158
1168
 
1169
+ // src/commands/task/reorder.ts
1170
+ async function runTaskReorder(input, deps) {
1171
+ if (input.refs.length < 2) {
1172
+ throw new Error("Reorder requires at least two task refs.");
1173
+ }
1174
+ const args = {
1175
+ refs: input.refs,
1176
+ parentRef: input.parentRef
1177
+ };
1178
+ const result = input.preview ? await deps.previewReorderTasks(args) : await deps.reorderTasks(args);
1179
+ if (input.json) {
1180
+ deps.printJson(result);
1181
+ return;
1182
+ }
1183
+ deps.printTable(result);
1184
+ }
1185
+
1159
1186
  // src/commands/task/cleanupPlan.ts
1160
1187
  import { readFile as readFile3 } from "fs/promises";
1161
1188
  async function loadCleanupPlan(input) {
@@ -2951,7 +2978,7 @@ function buildCli() {
2951
2978
  "--priority <priority>",
2952
2979
  `new priority (${taskPriorityChoices.join("|")})`
2953
2980
  ).choices([...taskPriorityChoices])
2954
- ).option("--deadline <deadline>", "ISO deadline").option("--expected-time <minutes>", "expected minutes").option("--actual-time <minutes>", "actual minutes").option("--archive", "archive the task").option("--unarchive", "unarchive the task").option("--parent <ref>", 'move task under the given parent or "root"').option("--preview", "preview the update without mutating").option("--json", "print JSON output").action(
2981
+ ).option("--deadline <deadline>", "ISO deadline").option("--expected-time <minutes>", "expected minutes").option("--actual-time <minutes>", "actual minutes").option("--archive", "archive the task").option("--unarchive", "unarchive the task").option("--parent <ref>", 'move task under the given parent or "root"').option("--position <position>", "0-based sibling position").option("--preview", "preview the update without mutating").option("--json", "print JSON output").action(
2955
2982
  async (ref, options) => {
2956
2983
  await runTaskUpdate(
2957
2984
  {
@@ -2964,6 +2991,7 @@ function buildCli() {
2964
2991
  actualTimeTaken: options.actualTime,
2965
2992
  archivedAt: options.archive ? /* @__PURE__ */ new Date() : options.unarchive ? null : void 0,
2966
2993
  parentRef: options.parent,
2994
+ position: options.position,
2967
2995
  preview: Boolean(options.preview),
2968
2996
  json: Boolean(options.json)
2969
2997
  },
@@ -2981,7 +3009,8 @@ function buildCli() {
2981
3009
  parentId: await resolveParentId(
2982
3010
  input.parentRef,
2983
3011
  (ref2) => resolveTaskId(api, ref2)
2984
- )
3012
+ ),
3013
+ position: parseIntegerOption(input.position, "--position")
2985
3014
  });
2986
3015
  }),
2987
3016
  previewTask: (input) => withCliApi(async (api) => {
@@ -2996,7 +3025,8 @@ function buildCli() {
2996
3025
  parentId: await resolveParentId(
2997
3026
  input.parentRef,
2998
3027
  (ref2) => resolveTaskId(api, ref2)
2999
- )
3028
+ ),
3029
+ position: parseIntegerOption(input.position, "--position")
3000
3030
  });
3001
3031
  }),
3002
3032
  printJson,
@@ -3095,6 +3125,46 @@ function buildCli() {
3095
3125
  );
3096
3126
  }
3097
3127
  );
3128
+ task.command("reorder").argument("<refs...>").option("--parent <ref>", 'validate task order under the given parent or "root"').option("--preview", "preview the reorder without mutating").option("--json", "print JSON output").action(
3129
+ async (refs, options) => {
3130
+ await runTaskReorder(
3131
+ {
3132
+ refs,
3133
+ parentRef: options.parent,
3134
+ preview: Boolean(options.preview),
3135
+ json: Boolean(options.json)
3136
+ },
3137
+ {
3138
+ reorderTasks: (input) => withCliApi(async (api) => {
3139
+ const taskIds = await Promise.all(
3140
+ input.refs.map((ref) => resolveTaskId(api, ref))
3141
+ );
3142
+ return api.reorderTasks({
3143
+ taskIds,
3144
+ parentId: await resolveParentId(
3145
+ input.parentRef,
3146
+ (ref) => resolveTaskId(api, ref)
3147
+ )
3148
+ });
3149
+ }),
3150
+ previewReorderTasks: (input) => withCliApi(async (api) => {
3151
+ const taskIds = await Promise.all(
3152
+ input.refs.map((ref) => resolveTaskId(api, ref))
3153
+ );
3154
+ return api.previewReorderTasks({
3155
+ taskIds,
3156
+ parentId: await resolveParentId(
3157
+ input.parentRef,
3158
+ (ref) => resolveTaskId(api, ref)
3159
+ )
3160
+ });
3161
+ }),
3162
+ printJson,
3163
+ printTable
3164
+ }
3165
+ );
3166
+ }
3167
+ );
3098
3168
  const cleanup = addGroupHelpAction(
3099
3169
  task.command("cleanup").description(
3100
3170
  [