@dypt/cli 0.1.8 → 0.1.10

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.10",
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) {
@@ -885,7 +893,7 @@ async function runNoteSet(input, deps) {
885
893
  async function runTaskCreate(input, deps) {
886
894
  const result = await deps.createTask({
887
895
  title: input.title,
888
- parentId: input.parentId ? Number(input.parentId) : null,
896
+ parentId: input.parentId ?? null,
889
897
  priority: input.priority,
890
898
  deadline: input.deadline,
891
899
  expectedTimeTaken: input.expectedTimeTaken
@@ -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) {
@@ -2870,7 +2897,7 @@ function buildCli() {
2870
2897
  if (taskNote) {
2871
2898
  addTaskNoteCommands(taskNote);
2872
2899
  }
2873
- task.command("create").argument("<title>").option("--parent <taskId>", "parent task id").addOption(
2900
+ task.command("create").argument("<title>").option("--parent <ref>", 'parent task id, title, or "root"').addOption(
2874
2901
  new Option(
2875
2902
  "--priority <priority>",
2876
2903
  `task priority (${taskPriorityChoices.join("|")})`
@@ -2880,7 +2907,6 @@ function buildCli() {
2880
2907
  await runTaskCreate(
2881
2908
  {
2882
2909
  title,
2883
- parentId: options.parent,
2884
2910
  priority: normalizePriority(options.priority),
2885
2911
  deadline: options.deadline ? parseDateOption(options.deadline, "start") : void 0,
2886
2912
  expectedTimeTaken: parseIntegerOption(
@@ -2890,7 +2916,15 @@ function buildCli() {
2890
2916
  json: Boolean(options.json)
2891
2917
  },
2892
2918
  {
2893
- createTask: (input) => withCliApi((api) => api.createTask(input)),
2919
+ createTask: (input) => withCliApi(
2920
+ async (api) => api.createTask({
2921
+ ...input,
2922
+ parentId: await resolveParentId(
2923
+ options.parent,
2924
+ (ref) => resolveTaskId(api, ref)
2925
+ )
2926
+ })
2927
+ ),
2894
2928
  printJson,
2895
2929
  printTable
2896
2930
  }
@@ -2951,7 +2985,7 @@ function buildCli() {
2951
2985
  "--priority <priority>",
2952
2986
  `new priority (${taskPriorityChoices.join("|")})`
2953
2987
  ).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(
2988
+ ).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
2989
  async (ref, options) => {
2956
2990
  await runTaskUpdate(
2957
2991
  {
@@ -2964,6 +2998,7 @@ function buildCli() {
2964
2998
  actualTimeTaken: options.actualTime,
2965
2999
  archivedAt: options.archive ? /* @__PURE__ */ new Date() : options.unarchive ? null : void 0,
2966
3000
  parentRef: options.parent,
3001
+ position: options.position,
2967
3002
  preview: Boolean(options.preview),
2968
3003
  json: Boolean(options.json)
2969
3004
  },
@@ -2981,7 +3016,8 @@ function buildCli() {
2981
3016
  parentId: await resolveParentId(
2982
3017
  input.parentRef,
2983
3018
  (ref2) => resolveTaskId(api, ref2)
2984
- )
3019
+ ),
3020
+ position: parseIntegerOption(input.position, "--position")
2985
3021
  });
2986
3022
  }),
2987
3023
  previewTask: (input) => withCliApi(async (api) => {
@@ -2996,7 +3032,8 @@ function buildCli() {
2996
3032
  parentId: await resolveParentId(
2997
3033
  input.parentRef,
2998
3034
  (ref2) => resolveTaskId(api, ref2)
2999
- )
3035
+ ),
3036
+ position: parseIntegerOption(input.position, "--position")
3000
3037
  });
3001
3038
  }),
3002
3039
  printJson,
@@ -3095,6 +3132,46 @@ function buildCli() {
3095
3132
  );
3096
3133
  }
3097
3134
  );
3135
+ 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(
3136
+ async (refs, options) => {
3137
+ await runTaskReorder(
3138
+ {
3139
+ refs,
3140
+ parentRef: options.parent,
3141
+ preview: Boolean(options.preview),
3142
+ json: Boolean(options.json)
3143
+ },
3144
+ {
3145
+ reorderTasks: (input) => withCliApi(async (api) => {
3146
+ const taskIds = await Promise.all(
3147
+ input.refs.map((ref) => resolveTaskId(api, ref))
3148
+ );
3149
+ return api.reorderTasks({
3150
+ taskIds,
3151
+ parentId: await resolveParentId(
3152
+ input.parentRef,
3153
+ (ref) => resolveTaskId(api, ref)
3154
+ )
3155
+ });
3156
+ }),
3157
+ previewReorderTasks: (input) => withCliApi(async (api) => {
3158
+ const taskIds = await Promise.all(
3159
+ input.refs.map((ref) => resolveTaskId(api, ref))
3160
+ );
3161
+ return api.previewReorderTasks({
3162
+ taskIds,
3163
+ parentId: await resolveParentId(
3164
+ input.parentRef,
3165
+ (ref) => resolveTaskId(api, ref)
3166
+ )
3167
+ });
3168
+ }),
3169
+ printJson,
3170
+ printTable
3171
+ }
3172
+ );
3173
+ }
3174
+ );
3098
3175
  const cleanup = addGroupHelpAction(
3099
3176
  task.command("cleanup").description(
3100
3177
  [